In this tutorial, I will show you how to use xmoov-php to integrate Pseudo-Streaming in PHPmotion and the JW FLV player. Before I begin the tutorial however, it might be beneficial to explain exactly what pseudo streaming is and how it differs from other methods of providing video content. Here is a detailed explanation of what Pseudo-Streaming is.
Currently PHPmotion uses a video delivery method known as Progressive Download. This type of delivery requires the entire video to be downloaded before you can reach the end. When a video is played, a portion of the video is downloaded into the buffer before it begins. If you attempt to skip to a part of the video that has not yet been downloaded into the buffer, the playhead simply skips to the end of the buffer and usually stops playing until the buffer has had a chance to catch up.
Another method is True Streaming which requires the use of a streaming server software like Adobe’s Flash Media Server. This method allows you to skip anywhere on the video timeline without having to wait on a buffer. This method works great, however it can be difficult to set up and expensive.
Then comes Pseudo-Streaming. Technically this method is still Progressive Download but with the added benefit of being able to skip anywhere on the video timeline without having to wait for the entire video to load. This is the method we will be discussing today.
Below is an example of a video being delivered via Pseudo-Streaming. Click the play button then click anywhere on the timeline to skip forward to a part of the video that has not yet buffered. You will notice that the video will start to buffer for a few seconds then play again from the point where you clicked.
How this works is, when you click on a point on the timeline, the streamer script looks for an access point in the metadata contained within the flv file. The streamer script then tells the player to restart the progressive download from that point. The same thing happens if you then skip back, or forward again, and so on.
Pseudo Streaming requires that all FLV files be injected with metadata. The metadata is how the streamer script knows at what point in the video to move too when a point on the timeline is clicked. Luckely, PHPmotion automatically injects the metadata when converting using FLVtool2 so all we have to do is make the streamer file and change a few lines in the embed code.


Hello, were is the tutorial?
I cannot see any tutorial!!!!
You have to go to the next page…
I am getting file error on the video page ???
file not found and also when i try to run the xmoov.php it is throwing error on line 92 wich is
$fileSize = filesize($file) – (($seekPos > 0) ? $seekPos + 1 : 0);
any idea guys??
Hey Just to clarify – It was the code in the PHPMotion (I think) that was causing the issue…
in the embed_code.php file… you mentioned that it would look like this…
$embed_code =‘’;
while in the new one it looks like this:
$embed_code =”;
I’m not sure if the changes matter that much in the code but I’ve been trying to change it to work and have been unsuccessful! You’re help is much appreciated! I was trying to contact you via phpmotion forums – but the PM was not working for me… so I joined your site! Thank You again!!
Ok so my code did not appear…. but the only difference I can find is…
Your code:
type=”application/x-shockwave-flash” pluginspage=”http://www.macromedia.com/go/getflashplayer”
What my recently downloaded phpmotion looks like (in place of the code above)
width=”‘.$width.’” height=”‘.$height.’”
Should I just change that in my code as well and see if it works??? Thanks again for your help
Oh and also I’m using JWplayer 4.3.132 Not JWplayer 5…. I heard it was the ‘best’ one for not needing a license or something like that? I spent forever reading the phpmotion forums
In embed.php, just search for:
instead of the whole block of code. Then make the changes described in the tutorial.
Hey Shawn – I must be an idiot. I actually can’t get any videos to play at all with the modified code… I must be really dumb actually. I make the xmoov.php file, copy+paste your code in to the file and save it, upload it to /includes… great… then I replace that single line of code and add the second line of code to the next line… when I try to play the video (in default theme phpmotion v.3 in a video window (not on the home screen)) it simply gives me the yellow triangle sign w/ an exclaimation mark…
Seriously I’m a computer scientist student and all the guide is asking for is to edit 1 line of code and add a new file and I cannot get it to work. my home directory is the /public_html/ so I didn’t change one line of your codea bove… It plays on the home screen and not in the videos after code change (we both know why it only plays on the home screen (not pseudo-streaming obviously)) but not having any luck with the video windows…
If I paid you to do it could you show me what exactly I keep messing up?? I’ve tried to re-do this simple tutorial ~6 times and it is still not working… I believe it does work somehow but I have been unsuccessful!
My email is located in my user profile
“If I paid you to do it could you show me what exactly I keep messing up?”
Sure
I think that since this article has been published, there have been changes that will not allow this to work… for example: the embed_code.php doens’t look as shown above… I tried installing with newest version and video player 4.3 and had no luck. Sean – you are the best on the internet for answering phpmotion questions! Thank you!
There may have been changes in the new JW 5 player, but I haven’t had a chance to mess with it yet. When I get time, I’ll DL the JW 5 player and have a look, then update the tutorial if necessary.
Hello Shawn, Ive installed the flow player, got rid of all the youtube videos and removed the tags and popular media , but I still have a prob with the player covering up the promoted videos, I think I read this somewhere but not sure where ? is there a fix for this yet?
the player works very well with the exception of the misalignment.
thank you for the quick turn around on the purchase!
Kirk
Is there a tutorial on installing the latest version of JW player in phpmotion?
I followed your guid and it wasn’t working.. I’m running JW player 4.0 so I’m assuming this is the problem.. please help
Hi there,
Hey , Followed this but sorry to say the streaming is not working ….. on the front page v3 but when i go to videos they wont play? I stuck with an error says
“Uploads/videofilename.flv the video stream is not found”
when I remove the below path line from make_player.html
file=[var.video_play]&streamer=[var.base_url]/xmoov.php
i found that videos play fine but streaming is not there,
Can You please help me to resolve the problem. I ll be thankful to you.
Pseudo streaming won’t work with the player on the index page because it isn’t compatible with playlists. This is why I didn’t include instructions for editing inner_index.htm
Bro it worked well… Very impressive!
TeamRagtube
Ragtube.com
Excellent tutorial, easy to implement and a really great feature.
Thanks for sharing this Shawn!
Can we integrate Pseudo-Streaming in zendo v3 if so then how we can do this and do you have any service to integrate Pseudo-Streaming in zendo v3 like i allready have one from you in flowplayer
The instructions for integrating in v3 are on page 2 of this post. There is an installation service available in the store.
I am sorry all texts don’t appear as I type.
$embed_code =”;
Addition to it, for some reasons “the dollor signs “$” changes to numbers when I save in .php format.
Thank you.
I have a hard time understanding. That’s my lack of knowledge.
Here are some problems:
1) in number (8)
>>>I do not see the exact word matching under /edit/embeded_code.php<<>>I tried to replace file=‘.$base_url.’/uploads/‘.$video_play.’ with
file=‘.$video_play.’&streamer=‘.$base_url.’/xmoov.php .
The problem is, ” how about punctuations (….play.’ )?
AFter I replaced my file looks like:
>>$embed_code =”;
<<<
But it does not work.
What is needed? Please help me.
Hey Shawn, Followed this and the streaming is working flawlessly on the front page v3 but when i go to videos they wont play? Sure i did something wrong
never mind, undid it and it is working now
It makes a litter sense to me. Bcoz,
In number (4) /themes/default/templates/make_player.html was opened and edited anyway.
But when it comes to number (10) file name: “make_player.html” changed to “inner_make_player.htm”
(not only file name chages, but also file extension changes.)
Dear Shawn, did you mean to hide something behind?
That was a typo. 10 should have read “make_player.html”. It is corrected now, thanks for the find.
i installed this mod and it works great with the regular player, but the recent videos on the front page no longer works. how can i fix this?
Thanks,
ZachG
That’s because it doesn’t work with Playlists, and why instructions for modifying the player on the index page were not included in the tutorial.
Hey Shawn thanks for this ,its really necessary for a video site. How can you make it work with cluster mod installed though? Cluster mod uses this : so.addVariable(‘file’,’[var.serverPush]/uploads/[var.video_play]‘);
var server push is the remote server where the upload folder is located.
That’ll be kind of tough since xmoov.php does not recognize TBS. I do not use and have not tested with the server cluster mod, so you might need to check with that mod’s author to find out if he/she can help.
does this work with the audio too?
It doesn’t work with audio because PHPmotion doesn’t convert uploaded mp3 files and does not inject metadata into the audio files.
Thanks Shawn, this was great help, like the new site too.
Thanks!
Awesome tutorial! Helped me a whole lot. I’ve been wanting to do this for some time now.
Thanks!
I’m glad it was helpful to you.
in order to make the video work in the latest videos section i had to save the old flvplayer.swf as something else, and go into inner_index.htm in the templates folder and change the player that was loaded to the old one.