Pseudo Streaming

From TMM Wiki
Jump to navigationJump to search

Using Pseudo Streaming

In Carma versions 1.4 and after, there is a feature that enables pseudo streaming. You should be able use any of the following code to implement this feature:

JW Player:

<script type='text/javascript' src='swfobject.js'></script>
<div id='video_holder'>This text will be replaced</div>
<script type='text/javascript'>
var so = new SWFObject('player-viral.swf','mpl','700','400','9');
so.addParam('allowfullscreen','true');
so.addParam('allowscriptaccess','always');
so.addVariable('file', 'view_clip.php/{$smarty.request.galid}/{$smarty.request.type}/{$smarty.request.num}/video.flv');
so.addVariable('provider','http');
so.write('video_holder');
</script>


Flow Player:

<script type='text/javascript' src='jquery.js'></script>
<script type='text/javascript' src='jquery.tools.js'></script>



<div class="video_holder" style="display:block;width:750px;height:460px"> 
</div> 
{literal}

<script>
flowplayer("div.video_holder", 'flowplayer.swf', {
clip: {
autoPlay: false,
autoBuffering: false,
loop: false,
scaling: 'fit',
url: {/literal}'view_clip.php/{$smarty.request.galid}/{$smarty.request.type}/{$smarty.request.num}/video.flv'{literal} ,
provider: 'CARMA'
},
plugins: { 
CARMA: {
url: 'flowplayer.pseudostreaming.swf' 
}
}
} 
);
</script>

{/literal}

Getting the Players

JW PLAYER
You can get the JW Player from http://www.longtailvideo.com/players/jw-flv-player/. Once you've download file, unzip its contents and upload the following files to the site_script directory in carma/site_scripts.

  • player.sqf
  • swfobject.js

If you have your member site set up with symbolic links to the individual files in site_scripts, instead of the folder, the you will also need to set up a symbolic link for these files as well.

FLOW
You can get the Flow Player from http://flowplayer.org/. In additon to the actual player, you will also need the plugin for pseudo streaming which can be found under their plugins tab.

Additional Setup Notes

  • Make sure you add the following to your config file (carma/includes/config.php):

$config['ALLOW_FLV_STREAM'] = 1;

  • The code given above should be used in the view_clip template
  • You can check the variables available to you on each page by putting a statement resembling the following:

{if $smarty.request.debug==1}{debug}{/if}

Then, when you view the page in question, add debug=1 to the URL as a query variable and it will create a popup with all of the available variables for the page.