Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

HTTP Streaming Problems with xmoov.php

53 replies [Last post]

I am having problems with the xmoov.php script. Here are the details.

Using JW Player 5.0.753

Running PHP 5.2

PHP scripts run properly on my server:

http://video.uams.edu/CME/rhp/phpinfo.php

xmoov.php seems to be configured properly because the following link prompts a download of the flv file:

http://video.uams.edu/CME/rhp/PreHealth/xmoov.php?file=AHEC-PB-ResidencyProfile-High.flv&start=0

However, when added to a player, it still seems to behave as a progressive download, as I can't scrub to undownloaded parts of the video:

http://video.uams.edu/CME/rhp/PreHealth/xmoov-test.html

Furthermore, I can tell from Live HTTP Headers in Firefox that the player is not sending the proper streaming request. It only sends:

http://video.uams.edu/CME/rhp/PreHealth/AHEC-PB-ResidencyProfile-High-Meta.flv

Asking for the video file only, without the streamer, which makes me think the problem is in my script. I feel like I am not identifying the streamer properly. Here is my browser script:

<script type='text/javascript' src='http://video.uams.edu/CME/rhp/_JWPlayer/mediaplayer/swfobject.js'></script>
<script type='text/javascript'>
  var so = new SWFObject('http://video.uams.edu/CME/rhp/_JWPlayer/mediaplayer/player.swf','mpl','597','360','9');
  so.addParam('allowfullscreen','true');
  so.addParam('allowscriptaccess','always');
  so.addParam('wmode','opaque');
  so.addVariable('file','http://video.uams.edu/CME/rhp/PreHealth/AHEC-PB-ResidencyProfile-High-Meta.flv&streamer=http://video.uams.edu/CME/rhp/PreHealth/xmoov.php');
  so.addVariable('image','http://video.uams.edu/CME/rhp/PreHealth/AHEC-PB/AHEC-PB-Thumb2.jpg');
  so.write('preview');
</script>

Here is the test page link:

http://video.uams.edu/CME/rhp/PreHealth/xmoov-test.html

I can provide other information if necessary, including the source of my xmoov.php file. Any help is greatly appreciated.

Screwed up the test link above, should be:

http://video.uams.edu/CME/rhp/PreHealth/xmoovstream-test.html

Thanks again for any assistance!

@Philip - can you try using this player - http://developer.longtailvideo.com/player/trunk/fl5/player.swf

Thanks for the swift reply, Ethan. So I changed the script on my html page to read:

<script type='text/javascript' src='http://video.uams.edu/CME/rhp/_JWPlayer/mediaplayer/swfobject.js'></script>
<script type='text/javascript'>
  var so = new SWFObject('http://developer.longtailvideo.com/player/trunk/fl5/player.swf','mpl','597','360','9');
  so.addParam('allowfullscreen','true');
  so.addParam('allowscriptaccess','always');
  so.addParam('wmode','opaque');
  so.addVariable('file','http://video.uams.edu/CME/rhp/PreHealth/AHEC-PB-ResidencyProfile-High-Meta.flv&streamer=http://video.uams.edu/CME/rhp/PreHealth/xmoov.php');
  so.addVariable('image','http://video.uams.edu/CME/rhp/PreHealth/AHEC-PB/Thumbnails/HH-Episode1-Thumb.jpg');
  so.write('preview');
</script>

Still no pseudo-streaming. See here:

http://video.uams.edu/CME/rhp/PreHealth/xmoovstream-test.html

The request to the server (according to Live HTTP headers in Firefox) still seems to be coming through as just a call to the flv file, with no streamer attached. Any other thoughts?

You need to break this out into two lines:

so.addVariable('file','http://video.uams.edu/CME/rhp/PreHealth/AHEC-PB-ResidencyProfile-High-Meta.flv&streamer=http://video.uams.edu/CME/rhp/PreHealth/xmoov.php');

It should be file and streamer separately.

Okay, thanks again for your availability. Here's what I have in the script now:

<script type='text/javascript' src='http://video.uams.edu/CME/rhp/_JWPlayer/mediaplayer/swfobject.js'></script>

<script type='text/javascript'>

var so = new SWFObject('http://developer.longtailvideo.com/player/trunk/fl5/player.swf','mpl','597','360','9');

so.addParam('allowfullscreen','true');

so.addParam('allowscriptaccess','always');

so.addParam('wmode','opaque');

so.addVariable('file','http://video.uams.edu/CME/rhp/PreHealth/AHEC-PB-ResidencyProfile-High-Meta.flv');

so.addVariable('image','http://video.uams.edu/CME/rhp/PreHealth/Thumbnails/HH-Episode1-Thumb.jpg');

so.addVariable('streamer','http://video.uams.edu/CME/rhp/PreHealth/xmoov.php');

so.write('preview');

</script>

Still not streaming. I tried navigating directly to the file using this again:

http://video.uams.edu/CME/rhp/PreHealth/xmoov.php?file=AHEC-PB-ResidencyProfile-High-Meta.flv&start=0

When prompted, I actually tried to download the file, but it won't actually come down, so it appears there may be a problem with the xmoov.php file after all.

Here are the contents of the file I have:

<?php

// call with: http://www.domain.com/path/xmoov.php?file=video.flv&start=1234

/*
xmoov-php 0.9
Development version 0.9.3 beta

by: Eric Lorenzo Benjamin jr. webmaster (AT) xmoov (DOT) com
    originally inspired by Stefan Richter at flashcomguru.com
    bandwidth limiting by Terry streamingflvcom (AT) dedicatedmanagers (DOT) com

    This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License.
    For more information, visit http://creativecommons.org/licenses/by-nc-sa/3.0/
    For the full license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/legalcode
    or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA.
*/

//    SCRIPT CONFIGURATION

//------------------------------------------------------------------------------------------
//    MEDIA PATH
//
//    you can configure these settings to point to video files outside the public html folder.
//------------------------------------------------------------------------------------------

// points to server root
define('XMOOV_PATH_ROOT', '');

// points to the folder containing the video files.
define('XMOOV_PATH_FILES', './');


//------------------------------------------------------------------------------------------
//    SCRIPT BEHAVIOR
//------------------------------------------------------------------------------------------

//set to TRUE to use bandwidth limiting.
define('XMOOV_CONF_LIMIT_BANDWIDTH', FALSE);

//set to FALSE to prohibit caching of video files.
define('XMOOV_CONF_ALLOW_FILE_CACHE', FALSE);
   
//------------------------------------------------------------------------------------------
//    BANDWIDTH SETTINGS
//
//    these settings are only needed when using bandwidth limiting.
//   
//    bandwidth is limited my sending a limited amount of video data(XMOOV_BW_PACKET_SIZE),
//    in specified time intervals(XMOOV_BW_PACKET_INTERVAL).
//    avoid time intervals over 1.5 seconds for best results.
//   
//    you can also control bandwidth limiting via http command using your video player.
//    the function getBandwidthLimit($part) holds three preconfigured presets(low, mid, high),
//    which can be changed to meet your needs
//------------------------------------------------------------------------------------------   

//set how many kilobytes will be sent per time interval
define('XMOOV_BW_PACKET_SIZE', 90);

//set the time interval in which data packets will be sent in seconds.
define('XMOOV_BW_PACKET_INTERVAL', 0.3);

//set to TRUE to control bandwidth externally via http.
define('XMOOV_CONF_ALLOW_DYNAMIC_BANDWIDTH', TRUE);


//------------------------------------------------------------------------------------------
//    INCOMING GET VARIABLES CONFIGURATION
//   
//    use these settings to configure how video files, seek position and bandwidth settings are accessed by your player
//------------------------------------------------------------------------------------------

define('XMOOV_GET_FILE', 'file');
define('XMOOV_GET_START', 'start');
define('XMOOV_GET_AUTHENTICATION', 'key');
define('XMOOV_GET_BANDWIDTH', 'bw');


//    END SCRIPT CONFIGURATION - do not change anything beyond this point if you do not know what you are doing

//------------------------------------------------------------------------------------------
//    PROCESS FILE REQUEST
//------------------------------------------------------------------------------------------

if(isset($_GET[XMOOV_GET_FILE]) && isset($_GET[XMOOV_GET_START]))
{
 
//    PROCESS VARIABLES

  # get seek position
 
$seekPos = intval($_GET[XMOOV_GET_START]);
 
# get file name
 
$fileName = htmlspecialchars($_GET[XMOOV_GET_FILE]);
 
# assemble file path
 
$file = XMOOV_PATH_ROOT . XMOOV_PATH_FILES . $fileName;


 
# assemble packet interval
 
$packet_interval = (XMOOV_CONF_ALLOW_DYNAMIC_BANDWIDTH && isset($_GET[XMOOV_GET_BANDWIDTH])) ? getBandwidthLimit('interval') : XMOOV_BW_PACKET_INTERVAL;
 
# assemble packet size
 
$packet_size = ((XMOOV_CONF_ALLOW_DYNAMIC_BANDWIDTH && isset($_GET[XMOOV_GET_BANDWIDTH])) ? getBandwidthLimit('size') : XMOOV_BW_PACKET_SIZE) * 1042;


 
# security improved by by TRUI www.trui.net
 
if (!file_exists($file))
  {
    print(
'<b>ERROR:</b> xmoov-php could not find (' . $fileName . ') please check your settings.');
    exit();
  }

  if(
file_exists($file) && strrchr($fileName, '.') == '.flv' && strlen($fileName) > 2 && !eregi(basename($_SERVER['PHP_SELF']), $fileName) && ereg('^[^./][^/]*$', $fileName))
  {
   
$fh = fopen($file, 'rb') or die ('<b>ERROR:</b> xmoov-php could not open (' . $fileName . ')');
   
$fileSize = filesize($file) - (($seekPos > 0) ? $seekPos  + 1 : 0);


   
//    SEND HEADERS
   
if(!XMOOV_CONF_ALLOW_FILE_CACHE)
    {
     
# prohibit caching (different methods for different clients)
     
session_cache_limiter("nocache");
     
header("Expires: Thu, 19 Nov 1981 08:52:00 GMT");
     
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
     
header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
     
header("Pragma: no-cache");
    }

   
# content headers
   
header("Content-Type: video/x-flv");
   
header("Content-Disposition: attachment; filename=\"" . $fileName . "\"");
   
header("Content-Length: " . $fileSize);

   
# FLV file format header
   
if($seekPos != 0)
    {
      print(
'FLV');
      print(
pack('C', 1));
      print(
pack('C', 1));
      print(
pack('N', 9));
      print(
pack('N', 9));
    }

   
# seek to requested file position
   
fseek($fh, $seekPos);

   
# output file
   
while(!feof($fh))
    {
     
# use bandwidth limiting - by Terry
     
if(XMOOV_CONF_LIMIT_BANDWIDTH && $packet_interval > 0)
      {
       
# get start time
       
list($usec, $sec) = explode(' ', microtime());
       
$time_start = ((float)$usec + (float)$sec);
       
# output packet
       
print(fread($fh, $packet_size));
       
# get end time
       
list($usec, $sec) = explode(' ', microtime());
       
$time_stop = ((float)$usec + (float)$sec);
       
# wait if output is slower than $packet_interval
       
$time_difference = $time_stop - $time_start;
        if(
$time_difference < (float)$packet_interval)
        {
         
usleep((float)$packet_interval * 1000000 - (float)$time_difference * 1000000);
        }
      }
      else
      {
       
# output file without bandwidth limiting
print "<br />Output: $file without bandwidth limiting."; exit;
        print(
fread($fh, 16384));
      }
    }
  }
}


//------------------------------------------------------------------------------------------
//    DYNAMIC BANDWIDTH CONTROL
//------------------------------------------------------------------------------------------

function getBandwidthLimit($part)
{
  switch(
$part)
  {
    case
'interval' :
      switch(
$_GET[XMOOV_GET_BANDWIDTH])
      {
        case
'low' :
          return
0.5;
          break;
        case
'mid' :
          return
0.5;
          break;
        case
'high' :
          return
0.2;
          break;
        case
'off' :
          return
0;
          break;
        default :
          return
XMOOV_BW_PACKET_INTERVAL;
          break;
      }
    break;

    case
'size' :
      switch(
$_GET[XMOOV_GET_BANDWIDTH])
      {
        case
'low' :
          return
20;
          break;
        case
'mid' :
          return
40;
          break;
        case
'high' :
          return
90;
          break;
        default :
          return
XMOOV_BW_PACKET_SIZE;
          break;
      }
    break;
}
}

?>

I thought I took this code directly from somewhere on this forum, but I could be wrong. Please look it over if you have time. Video file and xmoov.php are in the same directory.

Thanks!

Hi Philip,

That code should work.

It most likely is that V5 is not working with Xmoov.

Try using this version of the player (4.7), and let me know if it works - http://developer.longtailvideo.com/player/trunk/as3/player.swf

Best,
-Ethan

Okay, now we're cooking. The 4.7 player is actually making the request with the streamer properly attached. Now I am getting a "file not found error" inside the player.

Would you say this is most likely due to some mix-up with the XMOOV_PATH_ROOT and XMOOV_PATH_FILES lines in xmoov.php?

Yeah, make sure the path is correct.

Okay, so I just have no idea where I could be going wrong with this part. I am in charge of this outreach website at the University of Arkansas for Medical Sciences, and we share a video server with several other folks, administered by IT. I only have access to a certain set of directories.

I have been unable to identify the equivalent of the public_html root (like on my personal sites that I administer), because those paths appear to be actual file paths with backslashes, not forward-slashes (like c:\directory-x\etc\).

I thought by just placing the xmoov.php file in the same directory as the video file for testing purposes I could get around this issue, and not have to bother IT about permissions and such.

Could you suggest anything else in the way of troubleshooting the file path issue?

Try making the xmoov path lines like this:

// points to server root
define('XMOOV_PATH_ROOT', '');

// points to the folder containing the video files.
define('XMOOV_PATH_FILES', '');

If everything is in the same directory, it should work.

Best,
-Ethan

Alright ... this is working:

http://video.uams.edu/CME/rhp/PreHealth/xmoovstream-test.html

I actually copied xmoov.php lines directly from the bottom of this post, created a directory "./files/", and moved my video into that directory:

http://www.longtailvideo.com/support/forum/Setup-Problems/21748/XMOOV-pseudo-streaming-video-not-found

I haven't looked through the code thoroughly to see what exactly is different, but all seems to be working now. A couple of questions, though:

1) What is the issue with JWPlayer 5 not calling the streamer properly, and is that being addressed?

2) Can I better organize videos under the "./files/" file path? For instance, could I place a video under "./files/category1/" and stream those videos with xmoov.php, or do all my videos have to be served from a single directory?

Thanks again for walking through all this with me!

Nice, glad you got it all working.

XMOOV / V5 is being looked into.

I don't believe there is a way to better organize the videos, unless you used different xmoov scripts for each category, but that would be pretty messy.

After reviewing the code carefully, there are several major differences between the code that finally worked, and my original code:

Original Line 70:

if(isset($_GET[XMOOV_GET_FILE]) && isset($_GET[XMOOV_GET_START]))

Became:

if(isset($_GET[XMOOV_GET_FILE]))

Original Line 75:

$seekPos = intval($_GET[XMOOV_GET_START]);

Became:

$seekPos = isset($_GET[XMOOV_GET_POSITION]) ? intval($_GET[XMOOV_GET_POSITION]) : 0;

After Original:

if(file_exists($file) && strrchr($fileName, '.') == '.flv' && strlen($fileName) > 2 && !eregi(basename($_SERVER['PHP_SELF']), $fileName) && ereg('^[^./][^/]*$', $fileName))
  {

Added:

# stay clean
    @ob_end_clean();
    @set_time_limit(0);

    # keep binary data safe
    set_magic_quotes_runtime(0);

Original Line 146:

if(XMOOV_CONF_LIMIT_BANDWIDTH && $packet_interval > 0)

Became simply:

if(XMOOV_CONF_LIMIT_BANDWIDTH)

For what it's worth :-)

Hi,

I have struggled over this for two days too, finally seeing that version 5 does not work with xmoov.php. Firebug shows that it does even not send the "start" parameter.

4.7 pseudostreams, however there remains a problem: when the video reaches the end, neither play button will make it restart. I'm going to have to use Flowplayer unless this can be fixed. Any advice? Thanks.

Gavin, can you provide a link to where this is not working?

Hi Ethan,

Yes, I can leave this link up a little while:

http://newgraphic.orlandmedia.net/blinder/test.php

This is using player 4.7 as player 5 does not send the required "start" variable to the script, as mentioned. That player consequently results in "Video not found".

With this one pseudostreaming does work but I seem unable to replay the video. What do you make of it?

btw I have not made any of the amendments (above) to the xmoov script.

Hi Gavin,

Try to set the repeat flashvar to always, let me know if that works.

Also, V5.1 has been updated, it should work now, can you this this file - http://developer.longtailvideo.com/player/trunk/fl5/player.swf

Best,
-Ethan

Hi Ethan,

The new player seems to be working well now, at the same URL.

I have not needed to set repeat to "always", although this did work and made the video repeat.

Thanks!

Gavin

np!

Will someone be kind to post a complete working solution code for JW Player 5.2 Embed code + XMOOV.PHP

Well, I have a mostly working solution I'd love to post but the server gives me this error every time I try to post the code, with or without the code tags.

"Your submission has triggered the spam filter and will not be accepted."

I say mostly because about half the time when I scrub to another location the video plays back in slow motion.

I guess we'll have to mickey mouse our way around the spam filter here ;)

I set up xmoov and the demo files and got them working first. Xmoov doesn't use the xmoov.php any more, by the way. Once I had xmoov running I just changed a couple params on the readme.html page that comes with jwplayer and it seems to work and find the files where xmoov says they are. If I could figure out the slow motion bs I'd be happier. Here's the page, you can view the source and see what I did. I'm doing some work on the site and will eventually move the xmoov scripts and the player files, so they may gone after the weekend, or sooner.

www midwestmusicmakers com/mediaplayer/readme.html

God this forum sucks, I can't even provide a link to the page without this stupid thing blocking it as spam. Really great support site guys, if you can't post code or url's, why even bother?

OK, excuse the earlier outburst, but the spam filter here is totally annoying.

It seems my problem is only in firefox on winxp pro, I'm not able to produce the problem in ie or in firefox on vista home. I tried disabling all my plugins and even did a fresh install of firefox, flash, shockwave, and quicktime, and I still have the problem in firefox on xp pro 32bit.

I did eventually figure out that clicking on the marker in the progress bar fixes it every time. If you just click around randomly after it happens, it usually won't cure itself.

Also, the version of the player doesn't seem to matter either.

Now that I know this is probably only effecting a very small portion of the users, I feel better about using it on the live site. It is strange though....

@MAXX - There is a tutorial here - http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/12534/video-delivery-http-pseudo-streaming

@Kyle - I can't get your MP4 file to load at all. I can't even get it to stream at all.

Note - Xmoov is not supposed to be for MP4 files, I believe.

I was tinkering with the mp4's but I changed it back to an flv just now and I'll leave it that way.

They have the mp4 mime types in the video server config file and I have had mp4's playing back in their player, but not reliably, they crash if you try to scrub past the downloaded portion. I think the newest player from them supports mp4's by way of quicktime. It has lots of bells and whistles, mostly the ability for pre roll and post roll ads, etc.. I haven't tried the new player yet.

I'll leave this up for you, and anyone else, to try and see how it works for you. I can usually produce the no audio / slow playback glitch in about 3 or 4 random scrubs in ff on my xp pro box. I still haven't seen it happen in ie or in firefox on vista.

I just looked at the demos provided by xmoov, the server will stream mp4's to quicktime's player. That player won't allow you to drag the thumb past the downloaded portion of the video in the control, so it works pretty well. Here's the mp4 demo on my server...

www midwestmusicmakers com/xsexamples/?p=quicktimemedia

There a way to stream MP4 with the JW Player, just not with XMOOV.

From - http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/12534/video-delivery-http-pseudo-streaming

You can use this - http://h264.code-shop.com/trac/wiki

Unfortunately this website is on a hosting server and I can't install packages or anything else that requires a make or install, etc.. If I could install packages on the server I wouldn't be wasting my time and effort screwing with http psuedo-streaming, that's for sure ;)

OK - It's working correctly now.

I had originally installed the 5.x player but when I couldn't get it working I went back to 4.x because I had read somewhere on the web that it might work better with xmoov. I just put 5.x back up and it's working great now in firefox on xp pro. I don't know why it didn't occur to me earlier to try 5.x again, lack of sleep I guess.

Thanks for the player and the help :)

Np :) Great!

Looks like I was very wrong :(

After I restarted my xp pro box the player was no longer working in firefox, I checked in firefox in vista and it didn't work there and I just finished setting up a new win7 box and it's hosed in Firefox there as well. I does work in ie on all the boxes, but even there it does some peculiar stuff.

In firefox it doesn't usually play the video first try, even though I can see in firebug that it is downloading to the browser, the wait animation runs for a second or so but that's it. Usually when that happens it won't play even after the whole file is downloaded, oddly enough, triple or quadrupole clicking very rapidly seems to get the video to start playing, but most of the time it doesn't show the buffer status correctly when it does. When it is showing the buffer progress, clicking ahead of the buffer almost always stops the player and shows the thumbnail as if it had finished playing. When it's not working right it shows the buffer at 100% no matter what.

In ie it loads and plays and scrubs properly but often doesn't show the buffer progress correctly as with firefox. Also sometimes the buffer display will load normally for a short while and then zoom to the end of the progress bar even though it is only 20% downloaded. If it was doing this before I went from 4 to 5 I hadn't noticed, but that wasn't what I was looking for earlier.

I haven't changed anything from before except to move from the v4 player to the v5 player and JavaScript. I've made no changes to the xmoov scripts aside from setting up the paths when I put it on the website.

The demo page is still up at the location I posted and I added a second page at readme2.html for when you can't stand the first video any more. Other than the movie being streamed it's the same as the first one.

@Kyle - On your new machine what version of the Flash player are you running?

thx for the link Ethan but I could not find a complete working example of xmoov.php & jwplayer 5+ on that page. will someone be kind to post a tested xmoov.php + jw player 5+ embed code here?

@MAXX - It is just a tutorial, there is no example of the page, unfortunately.

@ Ethan. the tutorial on the page you provided does not contain any additional information about how to setup jw player 5.0+ with xmoov.php

@MAXX - This tutorial is for all kinds of HTTP Streaming.

You can access XMOOV here - http://stream.xmoov.com/

To use XMOOV with JW5, set the streamer flashvar to the location of xmoov.php, set file to the location of the .flv file, and set the provider flashvar to http.

@MAXX

Although I'm having some issues in firefox, that doesn't mean you will, it could be something in my web server config or php.ini that's causing the issue. Go ahead and give this a try, it may work fine for you ;)

I had to break up the domain name so the forum wouldn't flag it as spam, but you do need to use the full url for the stream server with the v5.x player. I have a link above that I copied the code from, have a look at the html there.

I set up the xmoov server and demos straight out of the zip file I downloaded from them, I just edited the paths. If you set up xmoov in your root directory and have their demo working, this should work, you just need to change the domain name and the movie name. Your flv file will need to be in the directory /xmoovStream/xmoovStream_files/ for xmoov to find it if you haven't changed the default file path in xmoov. I think you could enter a full url for the video and the xmoov server will use that path instead, but I won't guarantee that. You can look in the xmoov server docs to find out for sure.

Hope that helps :)

<!-- START OF THE PLAYER EMBEDDING TO COPY-PASTE -->

<object id="player" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="player" width="400" height="300">

<param name="movie" value="player.swf" />
<param name="allowfullscreen" value="true" />
<param name="allowscriptaccess" value="always" />
<param name="flashvars" value="file=yourVideo.FLV&streamer=http www yourDomain com/xsexamples/servers/video/&image=preview.jpg&provider=http" />

<embed type="application/x-shockwave-flash" id="player2" name="player2" src="player.swf" width="400" height="300" allowscriptaccess="always" allowfullscreen="true" flashvars="file=yourVideo.FLV&streamer=http www yourDomain com/xsexamples/servers/video/&image=preview.jpg&provider=http" />

</object>

<!-- END OF THE PLAYER EMBEDDING -->

@ETHAN

Here's what it says when I get flash info on the win7 box:

You have version 10,1,53,64 installed

It's running win7 ultimate 64bit and has all the available windows updates.

@Kyle - Thanks. There is a slight bug with caching in 5.2, that can be corrected by appending a random number to the end of the player.swf - for example player.swf?1234 (it needs to be random each time).

@KYLE - thx! works.

I only changed the streamer= to point to the exact location of xmoov.php

@ETHAN

I set up a php generated page with the random number after the player, it didn't seem to make any difference in the v5.x player at all. It does seem to make the v4.x player more stable in xp with firefox, it still goes into silent slow motion once and a while but the player doesn't just stop when you scrub. V4.x seems to work correctly in all the other versions of firefox and ie with the random number.

Here's the test page I set up for the v5.x player:

http://midwestmusicmakers.com/test/

Any other ideas?

@Kyle, usually when you are using xmoov, you have to list the full path to the xmoov.php file. You are not doing this here. When I go to the streaming server URL, I get this message - "[07.08.2010, 09:48:11, 24.103.245.86] xmoovStream ERROR: [A file was not set] file: () server: (Streaming Video Server)". You may not have to list http as the type/provider for xmoov, as well. Can you try removing that? I do see an issue with this test page, the player just flickers when I try to play it now.

@Ethan -
I have read so many times in these forums that the http provider had to be there for xmoov to work I just put it in. Taking it out doesn't seem to make any difference in firefox or ie, I'll leave it that way for you to try.

You'll get that error any time you try to call the xmoov server without a file for it to serve, and if you add the file name(index.php) to the streamer path you'll get a security error from the xmoov server as well.

Xmoov doesn't just use a single script in the latest version, in fact it doesn't even have a file named xmoov.php, it has multiple files in multiple directories. What the streamer path is pointing to is file named index.php which uses a combination of mod rewrite calls in the htaccess and an include file to parse the url or embed code and then calls the server with the correct params. You can't access it the way you used to with just the xmoov.php script.

Xmoov has gotten larger and somewhat convoluted now, which is why I have stayed in their example framework until I have the player issues figured out, I'll deal with customizing xmoov afterward. They also don't have a list of compatible players up on their site yet, they are "still testing" players.

Don't feel like the lone ranger, I haven't seen any players using pseudostreaming that work correctly in firefox on xp pro since v10 of the flash player came out, if someone knows of one I'd love to see it.

I'm still all ears if anyone has ideas on a cure for this problem

One other thing. When the player crashes after a scrub or just doesn't do anything on first try, it can be started up by double clicking in the player waiting a half second or more and clicking again. This works every time without fail.

Don't know how helpful that is but I thought I should pass it along.

@Kyle - possibly can you try the older version, the one was was simply just 'xmoov.php'?

@Ethan - I'll try setting up a test with the old xmoov later today, I'll post a link when I do.

Thank you.

@Kyle - this is the xmoov.php I used with JW player 5.2 and your embed code example above. Tested ok in IE, Firefox, XP and Windows 7.

<?php

//------------------------------------------------------------------------------------------
// MEDIA PATH
//------------------------------------------------------------------------------------------
// you can configure these settings to point to video files outside the public html folder.
//
// points to server root
define('XMOOV_PATH_ROOT', './');
//
// points to the folder containing the video files.
define('XMOOV_PATH_FILES', './');


//------------------------------------------------------------------------------------------
// BEHAVIOR
//------------------------------------------------------------------------------------------
//
//set to TRUE to use bandwidth limiting.
define('XMOOV_CONF_LIMIT_BANDWIDTH', FALSE);
//
//set to FALSE to prohibit caching of video files.
define('XMOOV_CONF_ALLOW_FILE_CACHE', TRUE);













//------------------------------------------------------------------------------------------
// BANDWIDTH SETTINGS
//------------------------------------------------------------------------------------------
// these settings are only needed when using bandwidth limiting.
//
// bandwidth is limited my sending a limited amount of video data(XMOOV_BW_PACKET_SIZE),
// in specified time intervals(XMOOV_BW_PACKET_INTERVAL).
// avoid time intervals over 1.5 seconds for best results.
//
// you can also control bandwidth limiting via http command using your video player.
// the function getBandwidthLimit($part) holds three preconfigured presets(low, mid, high),
// which can be changed to meet your needs
//
//set how many kilobytes will be sent per time interval
define('XMOOV_BW_PACKET_SIZE', 90);
//
//set the time interval in which data packets will be sent in seconds.
define('XMOOV_BW_PACKET_INTERVAL', 0.3);
//
//set to TRUE to control bandwidth externally via http.
define('XMOOV_CONF_ALLOW_DYNAMIC_BANDWIDTH', TRUE);


//------------------------------------------------------------------------------------------
// INCOMING GET VARIABLES CONFIGURATION
//------------------------------------------------------------------------------------------
//
// use these settings to configure how video files, seek position and bandwidth settings are
// accessed by your player
//
define('XMOOV_GET_FILE', 'file');
define('XMOOV_GET_POSITION', 'start');
define('XMOOV_GET_AUTHENTICATION', 'key');
define('XMOOV_GET_BANDWIDTH', 'bw');


///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// END SCRIPT CONFIGURATION - do not change anything beyond this point if you do not know what you are doing //
///////////////////////////////////////////////////////////////////////////////////////////////////////////////


//------------------------------------------------------------------------------------------
// PROCESS FILE REQUEST
//------------------------------------------------------------------------------------------

if(isset($_GET[XMOOV_GET_FILE]))
{
 
// PROCESS VARIABLES
  // get seek position - JWMP doesn't send pos on the first request
 
$seekPos = isset($_GET[XMOOV_GET_POSITION]) ? intval($_GET[XMOOV_GET_POSITION]) : 0;
 
// get file name
 
$fileName = htmlspecialchars($_GET[XMOOV_GET_FILE]);
 
// assemble file path
 
$file = XMOOV_PATH_ROOT . XMOOV_PATH_FILES . $fileName;
 
// assemble packet interval
 
$packet_interval = (XMOOV_CONF_ALLOW_DYNAMIC_BANDWIDTH && isset($_GET[XMOOV_GET_BANDWIDTH])) ? getBandwidthLimit('interval') : XMOOV_BW_PACKET_INTERVAL;
 
// assemble packet size
 
$packet_size = ((XMOOV_CONF_ALLOW_DYNAMIC_BANDWIDTH && isset($_GET[XMOOV_GET_BANDWIDTH])) ? getBandwidthLimit('size') : XMOOV_BW_PACKET_SIZE) * 1042;

 
// security improved by by TRUI www.trui.net
 
if (!file_exists($file))
  {
    print(
'<b>ERROR:</b> xmoov-php could not find (' . $fileName . ') please check your settings.');
    exit();
  }

  if(
file_exists($file) && strrchr($fileName, '.') == '.flv' && strlen($fileName) > 2 && !eregi(basename($_SERVER['PHP_SELF']), $fileName) && ereg('^[^./][^/]*$', $fileName))
  {
   
$fh = fopen($file, 'rb') or die ('<b>ERROR:</b> xmoov-php could not open (' . $fileName . ')');

   
$fileSize = filesize($file) - (($seekPos > 0) ? $seekPos + 1 : 0);

   
// SEND HEADERS
   
if(!XMOOV_CONF_ALLOW_FILE_CACHE)
    {
     
// prohibit caching (different methods for different clients)
     
session_cache_limiter("nocache");
     
header("Expires: Thu, 19 Nov 1981 08:52:00 GMT");
     
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
     
header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
     
header("Pragma: no-cache");
    }

   
// content headers
   
header("Content-Type: video/x-flv");
   
// header("Content-Disposition: attachment; filename=\"" . $fileName . "\"");
   
header("Content-Length: " . $fileSize);

   
// FLV file format header
   
if($seekPos != 0)
    {
      print(
'FLV');
      print(
pack('C', 1));
      print(
pack('C', 1));
      print(
pack('N', 9));
      print(
pack('N', 9));
    }

   
// seek to requested file position
   
fseek($fh, $seekPos);

   
// output file
   
while(!feof($fh))
    {
     
// use bandwidth limiting - by Terry
     
if(XMOOV_CONF_LIMIT_BANDWIDTH)
      {
       
// get start time
       
list($usec, $sec) = explode(' ', microtime());
       
$time_start = ((float)$usec + (float)$sec);
       
// output packet
       
print(fread($fh, $packet_size));
       
// get end time
       
list($usec, $sec) = explode(' ', microtime());
       
$time_stop = ((float)$usec + (float)$sec);
       
// wait if output is slower than $packet_interval
       
$time_difference = $time_stop - $time_start;
        if(
$time_difference < (float)$packet_interval)
        {
         
usleep((float)$packet_interval * 1000000 - (float)$time_difference * 1000000);
        }
      }
      else
      {
       
// output file without bandwidth limiting
       
while (!feof($fh))
        {
          print(
fread($fh, 16384));
        }
      }
    }
  }
}















//------------------------------------------------------------------------------------------
// DYNAMIC BANDWIDTH CONTROL
//------------------------------------------------------------------------------------------
//
function getBandwidthLimit($part)
{
  switch(
$part)
  {
    case
'interval' :
      switch(
$_GET[XMOOV_GET_BANDWIDTH])
        {
          case
'low' :
            return
1;
            break;
          case
'mid' :
            return
0.5;
            break;
          case
'high' :
            return
0.3;
            break;
          default :
            return
XMOOV_BW_PACKET_INTERVAL;
            break;
        }
      break;
    case
'size' :
      switch(
$_GET[XMOOV_GET_BANDWIDTH])
      {
        case
'low' :
          return
10;
          break;
        case
'mid' :
          return
40;
          break;
        case
'high' :
          return
90;
          break;
        default :
          return
XMOOV_BW_PACKET_SIZE;
          break;
      }
    break;
  }
}

?>

One more thing: I want to get more safety buffer with this 5.2 & xmoov.php in order to increase compatibility with slower connections. Should I use the bufferlength flashvar when xmoov is the http streaming provider or is there another way to increase the buffer length via xmoov.php script?

@MAXX - Thanks, I'll try the script.

The streamer sends a command to the player to start and that's when streaming begins, how much video is streamed and buffered before playback begins is up to the player. So, yes, for slow connections use the bufferlength flashvar, 4 seconds or so would be a good place to start.

@Ethan

Thanks to MAXX's question I found my cure :) I set the bufferlength flashvar to 2 seconds and now both the v4 and v5.2 players are working in firefox on xp and vista. I'll check win7 in a bit but I expect it to behave the same as vista.

Something of to note also is that without the random number after the player the 5.0 player works perfectly but the 5.2 still stops after scrubbing once in a while. But, unlike before, when it does stop you can just start again without dumping the cache or restarting the browser, etc. Also, the buffer progress is now showing correctly all the time in firefox and ie, which it wasn't before.

I'll let you know if it's working for me in win7.

Thanks to both of you :)

Just got done beating it up in win7, after about a hundred scrubs it only stopped 5 times, it used to be about 1 out 5 scrubs would kill the player. It also recovered nicely, whereas before, it was pretty much dead once it failed and I had to restart the browser to fix it. Also, I haven't had a single flash player crash in win7 this time around, I had several in the past. It's nice not to see adobe's grey screen of plugin death for a change ;)

@Ethan - I switched the test page over to the xmoov script MAXX posted and removed the bufferlength flashvar, it's working perfectly in win7 and xp with firefox. Now that I know it's a buffering related problem with the new xmoov I'll see what I can figure out. If I come up with a solid solution I'll post it.

@kyle - great! :) thanks!

Post new comment

  • Allowed HTML tags: <code> <blockquote> <em> <strong> <strike> <ul> <li> <ol>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic).

More information about formatting options