Small script that lists all videos in a directory and enables watching with Webplayer

11 replies [Last post]
beegee1962
beegee1962's picture
User offline. Last seen 2 years 16 weeks ago. Offline

I don't now if anybody is interested in this one. But I created a PHP script that searches for all movies in a directory, then put them into a selection form. A visitor to the page can select a video and it is played with Divx Webplayer.

The main part of the PHP file is from Greg Johnson! =>> http://greg-j.com/phpdl/
He wrote a nice PHP script that scans all files in a directory and list them. I changed his code and used the Webplayer SDK to create an automatic updated list of movies. The visitor just selects the movie he wants to watch and it starts to stream.

Hope this very basic PHP script is usefull to someone.

See an example here:
http://www.giesecke.tk/movies/#divxplaydir.php

Download the script from
http://www.giesecke.tk/scripts/divxplaydir.zip

Have fun with the script. Improve it and post it here!

kerook
kerook's picture
User offline. Last seen 31 weeks 2 days ago. Offline
Joined: 12/15/2010
Posts: 3
this is nice script, I feel

this is nice script, I feel that you are very right that comments will be a growing area to watch this year. Like you say, comments keep the conversation going. They also provide additional insight to the readers and the bloggers. Comments offer a different perspective and put a "face" to the readership.Orange County Web Design

Zeaks
Zeaks's picture
User offline. Last seen 28 weeks 1 day ago. Offline
Joined: 02/09/2010
Posts: 8
Groups: None
Thank you very much for

Thank you very much for updating this, I was unable to get the last one working with my local server because of sub directories and alias or something, this works great.

Rodney68
Rodney68's picture
User offline. Last seen 2 years 12 weeks ago. Offline
code for a blog

dear beegee1962 how are you?, well, i have some blogs and need to put a code with the divx player, not a link, for my visitors can watch videos o movies online from mi site or from another site,
thanks

bindassdesi
bindassdesi's picture
User offline. Last seen 2 years 13 weeks ago. Offline
Joined: 10/22/2009
Posts: 1
Sub Directories Not Possible

Hello,
This script is great though the function works only with root directory and not with sub-directories under the root folder. Is it possible somehow to get the files from subfolders also listed in Drop Down box?

Thanks

somnang
somnang's picture
User offline. Last seen 42 weeks 4 days ago. Offline
This script does not work on

This script does not work on my Apaché

movienut
movienut's picture
User offline. Last seen 1 year 11 weeks ago. Offline
This looks phenomenal, I

This looks phenomenal, I actually have been looking for something like this for both live streaming tv and for Divx. My question to you is, is it mandatory to host the movie yourself? I use embedding features from other hosting services and do not hold video files on my own server. Will this work or is there another script I should be using instead. Thanks.

duba
duba's picture
User offline. Last seen 2 years 18 weeks ago. Offline
symlinks

Has anyone tried using this with a symbolic link on windows? I have my media file on my C:\ drive and my root docs on my E:\ drive. I created a symlink E:\moveis\cmovies, cmovies being a symbolic link to C:\movies. When I change line 3 in dir.php to E:\movies\Cmovies\media the page loads and it shows all the avi files however, when I try to play any of them I get "File does not exist: E:/movies/media/movie.avi, referer: http://192.168.1.100:8080/divx.html" in my error log. Has anyone tried accessing files with divx web player over a symlink on XP and, if so were you able to fix the problem?

beegee1962
beegee1962's picture
User offline. Last seen 2 years 16 weeks ago. Offline
Version 1.2

Updated the script, removed some bugs.

History: 1.0 - basic script, manual adaption of path necessary
1.1 - enhanced calculation of path, works now with out adaption, accepts even a name change of the script
1.2 - removed bug that led to wrong path calculation if script was in subdir

corrected path in original post. You can now find the file and the demo.

edit 2009/04/05:
Included #DIVXPLAYDIR script into my website design. Test it here:
http://www.giesecke.tk/movies

New download path: http://www.giesecke.tk/scripts/divxplaydir.zip

Very Cool!

This is VERY COOL! Thanks for making this... I tried this out on one of my sites and it worked. At some point, we're going to have a DivX gallery where we showcase applications, scripts, and DivX implementations on our website. Do we have your permission to post a link to your script there when we go live?

beegee1962
beegee1962's picture
User offline. Last seen 2 years 16 weeks ago. Offline
permission

Everybody can use this script and post links to it. I am happy that some people find it usefull.

speedrider
speedrider's picture
User offline. Last seen 2 years 16 weeks ago. Offline
Joined: 10/20/2009
Posts: 1
Groups: None
Very useful script and

Very useful script and exactly what I was looking for!

However, I have problems to get it work on my home apache in a virtual directory (different drive). The dropdown list is always empty. I suppose that there are some path problems.

I hope that someone can look into this and I am thankful for any advice.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.