Pseudo Streaming

From TMM Wiki
Jump to navigationJump to search
CARMA
Extras
The Support Admin
Admin Areas
CARMA Home
Pseudo Streaming
Flash Player
Using mp4 Videos
Zipping Content
Third Party Content
X-Sendfile
Xmoov-php
TMMid

Using Pseudo Streaming

As of version 1.4.0.1, CARMA contains a feature that enables pseudo streaming for your members. Pseudo streaming allows members and surfers to seek in videos that have not been fully downloaded.

If you are looking to pseudo stream MP4 videos, please use look at the Using mp4 Videos article.

Getting the Players

CARMA supports both JW Player and Flow Player for playback of flash movies. Use the following instructions if you wish to install either of these players.

JW PLAYER

You can download JW Player from its website at http://www.longtailvideo.com/players/jw-flv-player/. After you have downloaded the file, unzip its contents and upload the following files to CARMA's site_script directory in carma/site_scripts.

  • player.sqf
  • swfobject.js

If your member site has been set up with symbolic links (symlinks) to the individual files in the site_scripts directory instead of the folder, you will also need to set up a symbolic link for the files you are uploading.

FLOW PLAYER

You can download Flow Player from its website at http://flowplayer.org/. After downloading Flow Player, you will also need to download the plugin that enables pseudo streaming. You can find this plugin on their website under their plugins tab.

Required Code

You can use any of the following code if you wish to implement pseudo streaming on your site(s):

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}

Additional Setup Notes

  • Make sure you add the following line to your config file (found in carma/includes/config.php):
    • $config['ALLOW_FLV_STREAM'] = 1;
  • You can check the variables available to you on each page by putting a statement that resembles the following example:
    • {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. This will create a popup with all of the available variables found on the specified page.