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

xmoov works but can't display video

10 replies [Last post]

I have spent many hours reading/trying suggestions in this forum regarding xmoov/jwplayer, but have been unable to make it work so far!

I best test case I found is:

www.opsysguy/jwtest1/test6.html

I have verified the following:

1. It enters xmoov correctly, and downloads the image as expected, either specifying xmoov explicitly or as initiated from test6.html.

2. The player executes and displays the video box.

3. When the start button is clicked it comes back with an error saying "Video not found: "video_x.flv".

4. With debug code added to xmoov I have verified that the paths are correct, the file is opened, positioned, and that the contents are read and sent as expected. The debug output is also included below.

5. If the name of the xmoov in the .php file is modified to be invalid, then the video does display correctly, but obviously the xmoov is not entered. This implies that the paths are correct.

6. The absolute root path to the folder containing all the files (test6.html, player.swf, swfobject.js, video_x.flv, etc.) is:

/home/content/s/k/o/skottaka/html/jwtest1/

The server relative path is:

/jwtest1/

7. The headers as detected by the browser are also shown below.

8. The phpinfo can be viewed at:

www.opsysguy.com/phpinfo.html

Any suggestions would be appreciated.

test6.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">

  <head>

    <title>XMOOV streamer - jwtest1 - test #6</title>

    <script type="text/javascript" src="swfobject.js"></script>

  </head>

  <body>

    <div id="mediaspace">This text will be replaced
      <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Get the Adobe Flash Player to see this video.</a>
    </div>

    <script type="text/javascript">
      var so = new SWFObject('http://www.opsysguy.com/jwtest1/player.swf', 'mp1', '470', '320', '9.0.124');
        so.addParam('allowscriptaccess',    'true');
        so.addParam('allowfullscreen',      'true');
        so.addVariable('streamer',          'http://www.opsysguy.com/jwtest1/xmoov6.php');
        so.addVariable('file',              'video_x.flv');
        so.addVariable('type',              'http');
        so.addVariable('http.startparam',   'start');
        so.write('mediaspace');
    </script>

  </body>

</html>

xmoov6.php

   <?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', $_SERVER['DOCUMENT_ROOT']);
//define('XMOOV_PATH_ROOT', '/');
//
// points to the folder containing the video files.
//define('XMOOV_PATH_FILES', '');
define('XMOOV_PATH_FILES', '/jwtest1/');


//------------------------------------------------------------------------------------------
// 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', 'pos');   // v3.x player
define('XMOOV_GET_POSITION', 'start'); // v4.x player
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 //
///////////////////////////////////////////////////////////////////////////////////////////////////////////////

function debtsj($line, $msg)
{
   
$fhd = fopen($_SERVER['REMOTE_ADDR'] . '.txt', 'a+');
   
fwrite($fhd, $line . ': ' . $msg . PHP_EOL);
   
fclose($fhd);
}
   
debtsj(__LINE__, date('ymdhms') . ' Server = ' . $_SERVER['REMOTE_ADDR']);

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

if(isset($_GET[XMOOV_GET_FILE]))
{
 
// PROCESS VARIABLES
  // get seek position
 
$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;

 
debtsj(__LINE__, 'Before file_exists=' . $file);
 
 
// security improved by by TRUI www.trui.net
 
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 (' . $fileName . ')');

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

   
debtsj(__LINE__, 'Filesize=' . $fileSize);

   
// 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");
     
debtsj(__LINE__, 'nocache headers sent');
    }

   
// 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));
     
debtsj(__LINE__, 'print FLV issued');
    }

   
// seek to requested file position
   
fseek($fh, $seekPos);
   
debtsj(__LINE__, 'fseek=' . $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);
        }
       
debtsj(__LINE__, 'time_start=' . $time_start . ' time_stop=' . $time_stop);
      }
      else
      {
       
// output file without bandwidth limiting
         
debtsj(__LINE__, 'Enter output file without bandwidth limiting');
        while (!
feof($fh))
        {
          print(
fread($fh, 16384));
         
debtsj(__LINE__, 'print from fread');
        }
      }
    }
  }
}


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

?>

Debug output

75: 091024011019 Server = 72.130.73.183
95: Before file_exists=/home/content/s/k/o/skottaka/html/jwtest1/video_x.flv
110: Filesize=216690
142: fseek=0
169: Enter output file without bandwidth limiting
173: print from fread
173: print from fread
173: print from fread
173: print from fread
173: print from fread
173: print from fread
173: print from fread
173: print from fread
173: print from fread
173: print from fread
173: print from fread
173: print from fread
173: print from fread
173: print from fread

html headers received by the browser

http://www.opsysguy.com/jwtest1/test6.html

GET /jwtest1/test6.html HTTP/1.1
Host: www.opsysguy.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: ja_purity_tpl=ja_purity; fontSize=100
Cache-Control: max-age=0

HTTP/1.x 200 OK
Date: Sat, 24 Oct 2009 19:30:15 GMT
Server: Apache
X-Powered-By: ModLayout/3.2.1
Cache-Control: no-cache
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html
----------------------------------------------------------
http://www.opsysguy.com/jwtest1/swfobject.js

GET /jwtest1/swfobject.js HTTP/1.1
Host: www.opsysguy.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3
Accept: */*
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://www.opsysguy.com/jwtest1/test6.html
Cookie: ja_purity_tpl=ja_purity; fontSize=100
If-Modified-Since: Wed, 21 Oct 2009 03:32:14 GMT
If-None-Match: "93b9cf-1ae7-4ade80be"
Cache-Control: max-age=0

HTTP/1.x 304 Not Modified
Date: Sat, 24 Oct 2009 19:30:15 GMT
Server: Apache
Connection: Keep-Alive, Keep-Alive
Keep-Alive: timeout=15, max=98
Etag: "93b9cf-1ae7-4ade80be"
----------------------------------------------------------
http://www.opsysguy.com/jwtest1/player.swf

GET /jwtest1/player.swf HTTP/1.1
Host: www.opsysguy.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://www.opsysguy.com/jwtest1/test6.html
Cookie: ja_purity_tpl=ja_purity; fontSize=100
If-Modified-Since: Wed, 21 Oct 2009 03:32:15 GMT
If-None-Match: "93b9d4-c376-4ade80bf"
Cache-Control: max-age=0

HTTP/1.x 304 Not Modified
Date: Sat, 24 Oct 2009 19:30:15 GMT
Server: Apache
Connection: Keep-Alive, Keep-Alive
Keep-Alive: timeout=15, max=97
Etag: "93b9d4-c376-4ade80bf"
----------------------------------------------------------
https://a12.alphagodaddy.com/hosting_ads/gd01.js

GET /hosting_ads/gd01.js HTTP/1.1
Host: a12.alphagodaddy.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3
Accept: */*
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://www.opsysguy.com/jwtest1/test6.html
If-Modified-Since: Wed, 02 May 2007 17:27:57 GMT
If-None-Match: "10393a-52f-4638ca1d"
Cache-Control: max-age=0

HTTP/1.x 200 OK
Date: Sat, 24 Oct 2009 19:30:15 GMT
Server: Apache/2.2.3 (Red Hat)
Last-Modified: Thu, 17 Sep 2009 22:38:17 GMT
Etag: "137817f-52f-473cdabf08840"
Accept-Ranges: bytes
Content-Length: 1327
Connection: close
Content-Type: application/x-javascript
----------------------------------------------------------
http://a12.alphagodaddy.com/?ref=http://www.opsysguy.com/jwtest1/test6.html&url=http://www.opsysguy.com/jwtest1/test6.html&leo=0

GET /?ref=http://www.opsysguy.com/jwtest1/test6.html&url=http://www.opsysguy.com/jwtest1/test6.html&leo=0 HTTP/1.1
Host: a12.alphagodaddy.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://www.opsysguy.com/jwtest1/test6.html

HTTP/1.x 200 OK
Date: Sat, 24 Oct 2009 19:30:15 GMT
Server: Apache/1.3.34 (Unix) PHP/5.1.2 mod_ssl/2.8.25 OpenSSL/0.9.7a
X-Powered-By: PHP/5.1.2
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html
----------------------------------------------------------
http://www.opsysguy.com/jwtest1/xmoov6.php?file=video_x.flv

GET /jwtest1/xmoov6.php?file=video_x.flv HTTP/1.1
Host: www.opsysguy.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: ja_purity_tpl=ja_purity; fontSize=100

HTTP/1.x 200 OK
Date: Sat, 24 Oct 2009 19:30:16 GMT
Server: Apache
X-Powered-By: ModLayout/3.2.1
Cache-Control: no-cache
Keep-Alive: timeout=15, max=97
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html
----------------------------------------------------------

When I make this request:http://www.opsysguy.com/jwtest1/xmoov6.php?file=video_x.flv&start=0your xmoov script returns this:

<br />
<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /home/content/s/k/o/skottaka/html/jwtest1/xmoov6.php:1) in <b>/home/content/s/k/o/skottaka/html/jwtest1/xmoov6.php</b> on line <b>125</b><br />
<br />
<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /home/content/s/k/o/skottaka/html/jwtest1/xmoov6.php:1) in <b>/home/content/s/k/o/skottaka/html/jwtest1/xmoov6.php</b> on line <b>127</b><br />
FLV
</iframe></noscript></object></layer></span></div></table></body></html><!-- adsok -->
<script language='javascript' src='https://a12.alphagodaddy.com/hosting_ads/gd01.js'></script>

You can trouble shoot filepath problems by putting a print statement on approximately line 90, then calling the script from your broswer with the URI that I posted above.
$file = XMOOV_PATH_ROOT . XMOOV_PATH_FILES . $fileName;
print "File Path: $file"; exit;
// assemble packet interval

Thanks for your suggestions!

I did forget to mention the two warning messages. Also, you get different results after "FLV", where I get the downloaded code (in ascii representation of hex). If I replace the .flv file with a text file with a .flv extension, it downloads and display correctly the entire file, for example:

http://www.opsysguy.com/jwtest1/xmoov6.php?file=a64k.flv&start=0

I have already put in print statements, as you can see in the debug code shown earlier. It shows at

line #25 the filepath was "/home/content/s/k/o/skottaka/html/jwtest1/video_x.flv"

At Line #110 after it opened the file and shows the Filesize=216690

At line #142 that the fseek was successful

At line #169 shows entering the "output file without bandwidth limiting" code.

At line #173 repeated fread and prints for the output.

The only errors are the header errors, which I don't understand. Are these significant errors?

When you ran your test case my debug output showed that the seek also worked,as shown below:

75: 091024031057 Server = 68.164.69.159
95: Before file_exists=/home/content/s/k/o/skottaka/html/jwtest1/video_x.flv
110: Filesize=216690
142: fseek=0
169: Enter output file without bandwidth limiting
173: print from fread
173: print from fread
173: print from fread
173: print from fread
173: print from fread
173: print from fread
173: print from fread
173: print from fread
173: print from fread
173: print from fread
173: print from fread
173: print from fread
173: print from fread
173: print from fread
75: 091024041041 Server = 68.164.69.159
95: Before file_exists=/home/content/s/k/o/skottaka/html/jwtest1/video_x.flv
110: Filesize=204344
137: print FLV issued
142: fseek=12345
169: Enter output file without bandwidth limiting
173: print from fread
173: print from fread
173: print from fread
173: print from fread
173: print from fread
173: print from fread
173: print from fread
173: print from fread
173: print from fread
173: print from fread
173: print from fread
173: print from fread
173: print from fread

I can't understand why xmoov6.php understands the paths, but the player doesn't.

Thanx!

The issue has nothing to do with the player.

I should be able to call the script completely independently of the player and receive a partial FLV in response.

There's something wrong with your PHP. Maybe you're on one of those hosts that don't tolerate any whitespace immediately after the opening <?php tag or immediately before the closing ?> tag.

Your script works on my server.

Try: http://willswonders.myip.org:8074/Scott_xmov.php?file=ThingsFallApart.flv&start=123456

There's an extra while loop in the script. When I added:

      else
      {
        // output file without bandwidth limiting
        debtsj(__LINE__, 'Enter output file without bandwidth limiting');
        while (!feof($fh))
        {
          print(fread($fh, 16384));
          debtsj(__LINE__, 'print from fread');
        }
      }
I wasn't paying attention to the fact that there was already a while loop up a few lines.

So... this is all you need:

      else
      {
        // output file without bandwidth limiting
        print(fread($fh, 16384));
      }

Yea! - I should have also seen the double while.

And Yea! - I am on the lovely GoDaddy host. Removing a leading space before the <?php (and possibly one after, and it) did remove the warning messages. -- Strange!

Unfortunately, I still have the same issue with regard to the "Video not found" message. I used the bunny.flv file downloaded from:

http://developer.longtailvideo.com/trac/browser/testing/files/bunny.flv

but it also gave the same results.

Wish I were a better web guy, so I do appreciate your help.

Scott

bunny.flv is F'd up, no metadata. It'll cause you lots of grief if you try to use it for pseudostreaming.

Use ThingsFallApart.flv from the URI I posted above, just set start=0 to get the whole file.

DAMN! I just realized that there's a mistake in that URI.

Use: http://willswonders.myip.org:8074/Scott_xmoov.php?file=ThingsFallApart.flv&start=0

Two "oo" works better.

I'm still getting the two error messages from your script.

Yes, I see what you mean. When I try your link above it actually downloads the file and allows me to save it. When I do it on my host machine it just displays "FLV%%%" without any option to save.

The same result occurs if I use your "ThingsFallApart.flv file. So, it obviously must be something about the php/host environment.

Are there any magic php.ini settings that would result in this behavior. You can what I currently have defined at:

www.opsysguy.com/phpinfo.php

There is still something strange going on with the whitespace, because I can move things around at the front and the error codes go away on my host.

I am used to API's in operating systems that are somewhat defined, and I still haven't gotten used to the black art of web stuff.

Scott

(Added info):

I compared the two phpinfo.php results at:

http://willswonders.myip.org:8074/phpinfo.php

http://opsysguy.com/phpinfo.php.

I modified mine to be more like yours, without any success.

I have verified that my xmoov.php file works correctly on a local xampp website, but still fails on my godaddy site.

I have traced the packet information between the two sites, and would like some help in deciphering the results.

The first trace is from the GoDaddy site using http://www.opsysguy.com/jwtest1/xmoov9.php?file=Scott_xmoov.flv&start=0

No.     Time        Source                Destination           Protocol Info
      1 0.000000    192.168.123.201       97.74.144.86          TCP      4496 > http [SYN] Seq=0 Win=65535 Len=0 MSS=1460

Frame 1 (62 bytes on wire, 62 bytes captured)

      2 0.028238    97.74.144.86          192.168.123.201       TCP      http > 4496 [SYN, ACK] Seq=0 Ack=1 Win=5840 Len=0 MSS=1460

Frame 2 (62 bytes on wire, 62 bytes captured)

      3 0.028302    192.168.123.201       97.74.144.86          TCP      4496 > http [ACK] Seq=1 Ack=1 Win=65535 Len=0

Frame 3 (60 bytes on wire, 60 bytes captured)

      4 0.030005    192.168.123.201       97.74.144.86          HTTP     GET /jwtest1/xmoov9.php?file=Scott_xmoov.flv&start=0 HTTP/1.1

Frame 4 (544 bytes on wire, 544 bytes captured)

      5 0.064715    97.74.144.86          192.168.123.201       TCP      http > 4496 [ACK] Seq=1 Ack=491 Win=6432 Len=0

Frame 5 (60 bytes on wire, 60 bytes captured)

      6 33.724039   97.74.144.86          192.168.123.201       TCP      [TCP segment of a reassembled PDU]

Frame 6 (309 bytes on wire, 309 bytes captured)

      7 33.724109   97.74.144.86          192.168.123.201       TCP      [TCP segment of a reassembled PDU]

Frame 7 (67 bytes on wire, 67 bytes captured)

      8 33.724634   192.168.123.201       97.74.144.86          TCP      4496 > http [ACK] Seq=491 Ack=269 Win=65267 Len=0

Frame 8 (60 bytes on wire, 60 bytes captured)

      9 33.751057   97.74.144.86          192.168.123.201       HTTP     HTTP/1.1 200 OK (text/html)

Frame 9 (250 bytes on wire, 250 bytes captured)
Ethernet II, Src: Cisco-Li_9b:bd:04 (00:0c:41:9b:bd:04), Dst: Giga-Byt_1d:be:f6 (00:16:e6:1d:be:f6)
Internet Protocol, Src: 97.74.144.86 (97.74.144.86), Dst: 192.168.123.201 (192.168.123.201)
Transmission Control Protocol, Src Port: http (80), Dst Port: 4496 (4496), Seq: 269, Ack: 491, Len: 196
[Reassembled TCP Segments (464 bytes): #6(255), #7(13), #9(196), #10(196)]
Hypertext Transfer Protocol
Line-based text data: text/html

No.     Time        Source                Destination           Protocol Info
     10 33.977572   97.74.144.86          192.168.123.201       TCP      [TCP Retransmission] [TCP segment of a reassembled PDU]

Frame 10 (250 bytes on wire, 250 bytes captured)

     11 33.977637   192.168.123.201       97.74.144.86          TCP      4496 > http [ACK] Seq=491 Ack=465 Win=65071 Len=0

Frame 11 (60 bytes on wire, 60 bytes captured)

     12 50.324034   97.74.144.86          192.168.123.201       TCP      http > 4496 [FIN, ACK] Seq=465 Ack=491 Win=6432 Len=0

Frame 12 (60 bytes on wire, 60 bytes captured)

     13 50.324125   192.168.123.201       97.74.144.86          TCP      4496 > http [ACK] Seq=491 Ack=466 Win=65071 Len=0

The second trace is from the local site at http://192.168.123.207/xampp/jwtest1/xmoov9.php?file=Scott_xmoov.flv&start=0

No.     Time        Source                Destination           Protocol Info
      1 0.000000    192.168.123.201       192.168.123.207       TCP      4336 > http [SYN] Seq=0 Win=65535 Len=0 MSS=1460

Frame 1 (62 bytes on wire, 62 bytes captured)

      2 0.000232    192.168.123.207       192.168.123.201       TCP      http > 4336 [SYN, ACK] Seq=0 Ack=1 Win=65535 Len=0 MSS=1460

Frame 2 (62 bytes on wire, 62 bytes captured)

      3 0.000544    192.168.123.201       192.168.123.207       TCP      4336 > http [ACK] Seq=1 Ack=1 Win=65535 Len=0

Frame 3 (60 bytes on wire, 60 bytes captured)

      4 0.001378    192.168.123.201       192.168.123.207       HTTP     GET /xampp/jwtest1/xmoov9.php?file=Scott_xmoov.flv&start=0 HTTP/1.1

Frame 4 (476 bytes on wire, 476 bytes captured)

No.     Time        Source                Destination           Protocol Info
      5 0.119771    192.168.123.207       192.168.123.201       TCP      http > 4336 [ACK] Seq=1 Ack=423 Win=65113 Len=0

Frame 5 (54 bytes on wire, 54 bytes captured)

      6 1.140385    192.168.123.207       192.168.123.201       TCP      [TCP segment of a reassembled PDU]

Frame 6 (1514 bytes on wire, 1514 bytes captured)

      7 1.140496    192.168.123.207       192.168.123.201       TCP      [TCP segment of a reassembled PDU]

Frame 7 (1514 bytes on wire, 1514 bytes captured)

      8 1.141228    192.168.123.201       192.168.123.207       TCP      4336 > http [ACK] Seq=423 Ack=2921 Win=65535 Len=0

Frame 8 (60 bytes on wire, 60 bytes captured)

      9 1.141413    192.168.123.207       192.168.123.201       TCP      [TCP segment of a reassembled PDU]

Frame 9 (1514 bytes on wire, 1514 bytes captured)

     10 1.141436    192.168.123.207       192.168.123.201       TCP      [TCP segment of a reassembled PDU]

Frame 10 (1514 bytes on wire, 1514 bytes captured)

     11 1.141454    192.168.123.207       192.168.123.201       TCP      [TCP segment of a reassembled PDU]

Frame 11 (1514 bytes on wire, 1514 bytes captured)

     12 1.142047    192.168.123.201       192.168.123.207       TCP      4336 > http [ACK] Seq=423 Ack=7301 Win=65535 Len=0

Frame 12 (60 bytes on wire, 60 bytes captured)

     13 1.142159    192.168.123.207       192.168.123.201       TCP      [TCP segment of a reassembled PDU]

Frame 13 (1514 bytes on wire, 1514 bytes captured)

     14 1.142182    192.168.123.207       192.168.123.201       TCP      [TCP segment of a reassembled PDU]

Frame 14 (1514 bytes on wire, 1514 bytes captured)

     15 1.142201    192.168.123.207       192.168.123.201       TCP      [TCP segment of a reassembled PDU]

Frame 15 (1514 bytes on wire, 1514 bytes captured)

     16 1.142219    192.168.123.207       192.168.123.201       TCP      [TCP segment of a reassembled PDU]

Frame 16 (1514 bytes on wire, 1514 bytes captured)

     17 1.142918    192.168.123.201       192.168.123.207       TCP      4336 > http [ACK] Seq=423 Ack=13141 Win=65535 Len=0

Frame 17 (60 bytes on wire, 60 bytes captured)

     18 1.143044    192.168.123.207       192.168.123.201       TCP      [TCP segment of a reassembled PDU]

Frame 18 (1514 bytes on wire, 1514 bytes captured)

     19 1.143065    192.168.123.207       192.168.123.201       TCP      [TCP segment of a reassembled PDU]

Frame 19 (1514 bytes on wire, 1514 bytes captured)
No.     Time        Source                Destination           Protocol Info
   9262 44.681290   192.168.123.201       192.168.123.207       TCP      4336 > http [ACK] Seq=423 Ack=10172552 Win=65535 Len=0
  


    ...
    ...
    ...
   


Frame 9262 (60 bytes on wire, 60 bytes captured)

   9263 44.681691   192.168.123.201       192.168.123.207       TCP      4336 > http [ACK] Seq=423 Ack=10176932 Win=65535 Len=0

Frame 9263 (60 bytes on wire, 60 bytes captured)

   9264 44.682083   192.168.123.201       192.168.123.207       TCP      4336 > http [ACK] Seq=423 Ack=10181312 Win=65535 Len=0

Frame 9264 (60 bytes on wire, 60 bytes captured)

   9265 44.682453   192.168.123.201       192.168.123.207       TCP      4336 > http [ACK] Seq=423 Ack=10182929 Win=65535 Len=0

Frame 9265 (60 bytes on wire, 60 bytes captured)

   9266 45.058537   192.168.123.207       192.168.123.201       HTTP     Continuation or non-HTTP traffic

Frame 9266 (57 bytes on wire, 57 bytes captured)

No.     Time        Source                Destination           Protocol Info
   9267 45.186621   192.168.123.201       192.168.123.207       TCP      4336 > http [ACK] Seq=423 Ack=10182932 Win=65532 Len=0

I see that first major difference is at Frame 5 with

http > 4336 [ACK] Seq=1 Ack=423 Win=65113 Len=0

and

http > 4744 [ACK] Seq=1 Ack=458 Win=6432 Len=0

Can anyone give me some hints as to what this might mean, and anything I can do to further diagnose the issue?

Another interesting test is when I replace the file Scott_xmoov.flv with:

http://www.opsysguy.com/jwtest1/xmoov9.php?file=a64k.flv&start=0

The a65k.flv file just contains text (not a valid .flv file). It again works correctly on the local site, but in this case the GoDaddy site actually displays the entire text correctly on the browser page rather than downloading it.

This is the trace information for the a64k file from GoDaddy.

No.     Time        Source                Destination           Protocol Info
      1 0.000000    192.168.123.201       97.74.144.86          TCP      4744 > http [SYN] Seq=0 Win=65535 Len=0 MSS=1460

Frame 1 (62 bytes on wire, 62 bytes captured)

      2 0.029051    97.74.144.86          192.168.123.201       TCP      http > 4744 [SYN, ACK] Seq=0 Ack=1 Win=5840 Len=0 MSS=1460

Frame 2 (62 bytes on wire, 62 bytes captured)

      3 0.029153    192.168.123.201       97.74.144.86          TCP      4744 > http [ACK] Seq=1 Ack=1 Win=65535 Len=0

Frame 3 (60 bytes on wire, 60 bytes captured)

      4 0.030180    192.168.123.201       97.74.144.86          HTTP     GET /jwtest1/xmoov9.php?file=a64k.flv&start=0 HTTP/1.1

Frame 4 (511 bytes on wire, 511 bytes captured)

      5 0.063806    97.74.144.86          192.168.123.201       TCP      http > 4744 [ACK] Seq=1 Ack=458 Win=6432 Len=0

Frame 5 (60 bytes on wire, 60 bytes captured)

      6 0.502779    97.74.144.86          192.168.123.201       TCP      [TCP segment of a reassembled PDU]

Frame 6 (309 bytes on wire, 309 bytes captured)
     
      7 0.548154    97.74.144.86          192.168.123.201       TCP      [TCP segment of a reassembled PDU]

Frame 7 (1514 bytes on wire, 1514 bytes captured)

      8 0.548201    192.168.123.201       97.74.144.86          TCP      4744 > http [ACK] Seq=458 Ack=1716 Win=65535 Len=0

Frame 8 (60 bytes on wire, 60 bytes captured)

      9 0.576073    97.74.144.86          192.168.123.201       TCP      [TCP segment of a reassembled PDU]

Frame 9 (1514 bytes on wire, 1514 bytes captured)

No.     Time        Source                Destination           Protocol Info
     10 0.576400    97.74.144.86          192.168.123.201       TCP      [TCP segment of a reassembled PDU]

Frame 10 (1514 bytes on wire, 1514 bytes captured)
    
    
     ...
     ...
     ...
    
    
    
     72 0.741937    97.74.144.86          192.168.123.201       TCP      [TCP segment of a reassembled PDU]

Frame 72 (1514 bytes on wire, 1514 bytes captured)

     73 0.741946    192.168.123.201       97.74.144.86          TCP      4744 > http [ACK] Seq=458 Ack=64496 Win=65535 Len=0

Frame 73 (60 bytes on wire, 60 bytes captured)
    
     74 0.744724    97.74.144.86          192.168.123.201       HTTP     HTTP/1.1 200 OK (text/html)

Frame 74 (99 bytes on wire, 99 bytes captured)
[Reassembled TCP Segments (66000 bytes): #6(255), #7(1460), #9(1460), #10(1460), #12(1460), #13(1460), #15(1460), #16(1460), #18(1460), #19(1460), #20(1460), #22(1460), #24(1460), #25(1460), #27(1460), #28(1460), #30(1460), #31(1460), #33(1]
Hypertext Transfer Protocol
Line-based text data: text/html

     75 0.744749    192.168.123.201       97.74.144.86          TCP      4744 > http [ACK] Seq=458 Ack=66001 Win=65535 Len=0

Frame 75 (60 bytes on wire, 60 bytes captured)
    
     76 16.718822   97.74.144.86          192.168.123.201       TCP      http > 4744 [FIN, ACK] Seq=66001 Ack=458 Win=6432 Len=0

Frame 76 (60 bytes on wire, 60 bytes captured)
    
     77 16.718918   192.168.123.201       97.74.144.86          TCP      4744 > http [ACK] Seq=458 Ack=66002 Win=65535 Len=0

Frame 77 (60 bytes on wire, 60 bytes captured)
    
     78 18.658723   192.168.123.201       97.74.144.86          TCP      4744 > http [FIN, ACK] Seq=458 Ack=66002 Win=65535 Len=0

Frame 78 (60 bytes on wire, 60 bytes captured)
    
     79 18.686874   97.74.144.86          192.168.123.201       TCP      http > 4744 [ACK] Seq=66002 Ack=459 Win=6432 Len=0

Frame 79 (60 bytes on wire, 60 bytes captured)

Any help gratefully appreciated, as this is beyond my understanding!

 
This is what I get from: http://www.opsysguy.com/jwtest1/xmoov9.php?file=Scott_xmoov.flv&start=0

FLV
</iframe></noscript></object></layer></span></div></table></body></html><!-- adsok -->
<script language='javascript' src='https://a12.alphagodaddy.com/hosting_ads/gd01.js'></script>

https://a12.alphagodaddy.com/hosting_ads/gd01.js appears to be a domain check function:
function domainCheck(domain, domainExt)
{
var isType = false;

for(i = 0; i < domainExt.length; i++)
{
re = new RegExp(""+domainExt[i]+"$");
if (domain.match(re))
{
isType = true;
break;

}

return isType;
}

var ref = document.referrer;

if ( ref.length <= 0 )
    ref = window.location;

if(location.protocol == "https:")
{     
  var url="https://a12.alphagodaddy.com/?ref=" + ref + "&url=" + window.location + "&leo=0";
} else {
  var url="http://a12.alphagodaddy.com/?ref=" + ref + "&url=" + window.location + "&leo=0";
}

var htmlStr = '<iframe id="conash3D0" frameborder=0 border=0 width="100%" height="115px" marginwidth=0 marginheight=0 allowtransparency=true vspace=0 hspace=0 scrolling=no src="' + url + &#10;'"></iframe>';

// to include other domain types to be filtered, add it to the list of array items.
var domainExt = new Array(".mobi");

if ( domainCheck(document.domain, domainExt) == false )
{
if ( document.body.insertAdjacentHTML )
{
document.body.insertAdjacentHTML('AfterBegin', htmlStr);
}
else
{
var r = document.createRange();
r.setStartBefore(document.body);

var parsedHTML = r.createContextualFragment(htmlStr);

document.body.insertBefore(parsedHTML, document.body.firstChild);
}

document.body.style.margin = '0px';
document.body.style.padding = '0px';
}

Injecting the JavaScript into your FLV and possibly trying to execute it, is what is messing up your xmoov script.

Finally - got something that works. There were several issues that solved my problem.

1. (Thanks Hobbs for the suggestion) The GoDaddy "free" website interjects advertising on all web pages. This somehow makes xmoov.php to not work . The GoDaddy "free" site has been my sandbox, but I had tested the real sites previously with other bugs in the code and didn't realize it.

2. (Thanks again to Hobbs) The php file is somehow sensitive to whitespace. Didn't exactly find out which whitespace(s) it was/were - but it certainly caused problems.

3. (Thanks to Andy in a post of June 29) " 07-31-08 JWMP doesn't send pos on the first request" So, the code change in xmoov.php as follows was needed:

The original code:
-------------------------

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

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

...

Change to:
---------------

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

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

4. Careful attention to paths, which it seems everyone else has had problems. Not knowing if full URL's are needed in some instances.

Alas - now I can get to doing what I wanted in the first place. Thanks ALL!!!!

 
Wonderful!

Your code had the fix for pos vs. start and for the missing start parmeter on the first request. That is one of the first things that I checked for. I fixed that in the script that you are using a long time ago in 2008.

// define('XMOOV_GET_POSITION', 'pos'); // v3.x player
define('XMOOV_GET_POSITION', 'start'); // v4.x player

// get seek position
$seekPos = isset($_GET[XMOOV_GET_POSITION]) ? intval($_GET[XMOOV_GET_POSITION]) : 0;

Anyway, I am very glad that it is working.

    Good Luck!

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