Page 1 of 1

Play videos from folder on server

Posted: Wed May 06, 2009 4:52 pm
by manRay
Can anyone recommend a way to play videos/audio files? I have looked all over the place, and it seems this is the only place where I can get reasonable answers. I have a website where users can upload videos and audio files to a specific folder. When the user logs on these files are links, and open up in a new window, this is a nuisance considering if the user wants to listen to many songs or watch multiple videos. My question is has anyone come across a a way to fix this. I know there is flash player, but I cant find any resources to tell me how to install!

Re: Play videos from folder on server

Posted: Wed May 06, 2009 5:04 pm
by ldougherty
What type of server is your site hosted on, Windows or Linux and is it a shared or private server? The answer to these questions will let people know what your likely hosting limitations could be.

The best bet generally for speed is to link the audio and video clips as you were stating. If the server has the correct mime types then the files will be opened in the correct application.

For reference you can use our listing of mime types on a Windows server.

http://www.hostmysite.com/support/dedic ... _source=bb

Re: Play videos from folder on server

Posted: Wed May 06, 2009 5:17 pm
by manRay
It is a linux server, I dont knwo how to find out if it is shared or private..I am using webhostingpad to host my site.

Re: Play videos from folder on server

Posted: Wed May 06, 2009 5:20 pm
by John Cartwright
Your best bet is to convert the videos to a widely supported supported (and compressed format), such as FLV, during the upload. This can be accomplish with a program such as FFMPEG. From there it is a simple matter of using one of the many freely available flash players.

Re: Play videos from folder on server

Posted: Wed May 06, 2009 5:26 pm
by manRay
How can I do it automatically, on upload.?do I have to add a script? I've considered it, but never understood how to implement it.

Re: Play videos from folder on server

Posted: Wed May 06, 2009 5:31 pm
by John Cartwright
After installing FFMEG and correclty configuring it, you could make an exec() call similiar to

Code: Select all

exec('ffmpeg -y -i /path/to/original/video.avi -acodec mp3 -f flv /path/to/converted/video.flv');
Feel free to read the documentation though.