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

Forums

/

Streaming Xmoov -> video not found

8 replies [Last post]

We had implemented the jw-player succesfully on our site. But our customers want to fast forward the movie, so I added the xmoov script.

On our test site http://www.class-3some.com/cctrial/index.html, I get the remark "video not found -url-", but when I direct the url from the browser http://www.class-3some.com/cctrial/player/4.flv, I can download the movie itself....

Xmoov.php, without the comments:

<?php

define('XMOOV_PATH_ROOT', '');
define('XMOOV_PATH_FILES', './');

define('XMOOV_CONF_LIMIT_BANDWIDTH', FALSE);
define('XMOOV_CONF_ALLOW_FILE_CACHE', TRUE);

define('XMOOV_BW_PACKET_SIZE', 90);
define('XMOOV_BW_PACKET_INTERVAL', 0.3);
define('XMOOV_CONF_ALLOW_DYNAMIC_BANDWIDTH', TRUE);

define('XMOOV_GET_FILE', 'file');
// define('XMOOV_GET_POSITION', 'pos'); // v3.x player
define('XMOOV_GET_POSITION', 'start'); // v4.x player
define('XMOOV_GET_AUTHENTICATION', 'key');
define('XMOOV_GET_BANDWIDTH', 'bw');

if(isset($_GET[XMOOV_GET_FILE]))
{
$seekPos = isset($_GET[XMOOV_GET_POSITION]) ? intval($_GET[XMOOV_GET_POSITION]) : 0;
$fileName = htmlspecialchars($_GET[XMOOV_GET_FILE]);

$file = XMOOV_PATH_ROOT . XMOOV_PATH_FILES . $fileName;

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

if (!file_exists($file))
{
print('<b>ERROR:</b> xmoov-php could not find (' . $file . ') 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 (' . $file . ')');

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

if(!XMOOV_CONF_ALLOW_FILE_CACHE)
{
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");
}

header("Content-Type: video/x-flv");
header("Content-Length: " . $fileSize);

if($seekPos > 0)
{
print('FLV');
print(pack('C', 1));
print(pack('C', 1));
print(pack('N', 9));
print(pack('N', 9));
}

fseek($fh, $seekPos);

while(!feof($fh))
{

if(XMOOV_CONF_LIMIT_BANDWIDTH)
{
list($usec, $sec) = explode(' ', microtime());
$time_start = ((float)$usec + (float)$sec);
print(fread($fh, $packet_size));
list($usec, $sec) = explode(' ', microtime());
$time_stop = ((float)$usec + (float)$sec);
$time_difference = $time_stop - $time_start;
if($time_difference < (float)$packet_interval)
{
usleep((float)$packet_interval * 1000000 - (float)$time_difference * 1000000);
}
}
else
{
print(fread($fh, 16384));
}
}
}
}

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;
}
}

I already tried to change the url for the movie to a shorter version, same problem....

Can someone help me with this?
Ow yes, we have a licensed jw-player.

Greetings

Cindy

 
Test the xmoov script and get it working independently of the player.

This should work, but it doesn't. Perhaps because the script isn't in that location or doesn't have the correct permissions set.

http://www.class-3some.com/cctrial/player/Xmoov.php?file=4.flv&start=12345

Based upon your FLV URI of:http://www.class-3some.com/cctrial/player/4.flv
and your use of current directory here:define('XMOOV_PATH_FILES', './');
if the Xmoov.php script was in that location and executable, I should get some response from your server, yet I don't.

nice, but how can I test the script without the player?

The script is in the same location als the flv-files, ie

http://www.class-3some.com/cctrial/player/xmoov.php

I changed the right on the directory, flv-file and xmoov.php to 777 and still have no success....

Greetings Cindy

I added the flv-file without the xmoov on the same page (sorry, explicit content....)

Still no changes on part of the xmoov....

cindy

 
To test the script independently of the player, just drop this into your browser's address bar:

http://www.class-3some.com/cctrial/player/xmoov.php?file=4.flv&start=12345

I get this error message back:

ERROR: xmoov-php could not find (http://www.class-3some.com/cctrial/player/4.flv) please check your settings.

The xmoov script should not be looking for a URI with protocol and domain (http://www.class-3some.com/). It should be using a local (on your server) filesystem path, like this: /cctrial/player/4.flv

Have you added the protocol & path to the xmoov script?

Thank you,

together with another version of swf-player (4.6.525 in stead of 4.6.485) witch I got from tech-support (seems the 4.6.485 has some bugs) and changing the the uri's to local paths, it works now :-)

I had the local paths in the beginning, but when things don't work, you try by changing such things :-)

thanks for your help

Greetings

funga

I'm having the same problem. I have the xmoov.php file in the same directory as the video I want to stream which is found here:

http://d4mo.co.uk/justoffscreen/test.html

Comes up as video not found. If I check this url:

http://d4mo.co.uk/justoffscreen/xmoov.php?file=2009-11-17SD.mp4&position=0

It says it cannot find the file.

I have XMOOV_PATH_FILES set to ./ and XMOOV_PATH_ROOT set to what my hosting company tells me is my root path. I'm stumped as to why it cannot find the file. Am I missing something really simple?

The xmoov script can't be used for MP4 files. Only FLV files with the time and byte metadata.

The player sends a "start" parameter, not "position".

Fair do's, thanks anyway.