The Blog of a Programmer
FLV Media Player with PHP Streaming
Modified to Work Smoothly with DreamHost
***UPDATE***
The example script has been updated due to the help from MattaProductions.com – a problem was noticed in that the swfobject.js script wasn’t being called in the example.html page!
***END UPDATE***
I’ve seen some people have trouble with the media player on DreamHost (mostly due to instructions). I’ve put together a simple, easy to install, and use flv player package. Hope you DreamHost people’s like it! I’ll be making changes to this post as I build out a nice set of instructions as to how to make it work, but for most people, this should be pretty easy.
Please note this is meant to be used on DreamHost because of the way I build the filepath to the videos. Also, you can NOT use remote video files, because the stream script will only attempt to use videos inside your filepath. Not to mention DreamHost gives a HUGE amount of space/bandwidth that can be used to play your videos from.
You can see an example of it working here. (The video is from a buddy of mine!) Then download the files!
Also if you have trouble with having your videos que up make sure you run it through the FLV MetaData Injector!
| This entry was posted by JuanJose on November 27, 2007 at 11:47 pm, and is filed under PHP, Software. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |
about 1 year ago
Thanks for doing this. It saved me a lot of time and headaches. Is it possible to embed the flv on another site? Like if I wanted to post a streaming video that I was hosting on Dreamhost on a blogspot blog. Thanks so much.
about 1 year ago
Honestly I’m not sure, you could try using the embed method for the jw flv player. Then again lots of websites strip out embed tags, but it’s always worth a try!
about 12 months ago
This is great! I was able to get it working with a bit of tweaking, and am using this to stream content below the www level, so that I can make sure not to serve video content for users that aren’t authorized to access it.
It’s not working correctly though… stream.php is grabbing the correct file, but the fseek doesn’t seem to be working. I can’t seek any further than what is already loaded. Have you run into this before?
about 12 months ago
A note for those using sessions:
No other page can load while the php file is loading the flv file because of session rules. Adding session_write_close(); before the readfile line in this script will remote that lock, otherwise you won’t be able to switch to another page until the full movie is downloaded, which could take a very long time for larger movies!
about 9 months ago
I’ve seen this script example numerous times on the “internets” today. I can’t seem to find a version that will allow the user to navigate way from the page while the movie is loading.
If you have a 20mb movie loading you have to sit there until it’s done. That makes this example unusable.
about 9 months ago
I’ve heard people say that before, although I’ve found it odd that I don’t run into the issue myself. My guess is that is has to do with the web server or PHP configuration, although without seeing the problem live it’s awfully hard to give more then an educated guess.
about 5 months ago
Wow! I’ve been trying to solve this problem for days and this works great. Thanks!
One question: I’m trying to move the flash player out of the site root to a subdirectory but when I do it seems like it stops finding the media file. I moved the php and js files and adusted their paths in the code without a problem it’s just when I move the player itself. Any suggestions?