...

View Full Version : Is this possible with PHP? List .avi files and open them in WMP



tomharto
02-01-2012, 10:57 PM
Is that possible to do with PHP? Id like to create a list of files (90% avi video files) on a certain folder (which is on an external hard drive) and when i click on them id like them to open up and play using Windows Media Player.

I've never tried doing anything like that before so i thought it would be a good idea to find out if this is even possible before attempting any thing :p

Fou-Lu
02-01-2012, 11:20 PM
Sure, only locally of course. Use an exec or similar system call and launch the wmplayer:


"%ProgramFiles%\Windows Media Player\wmplayer.exe" /play "/path/to/file"

Fou-Lu
02-01-2012, 11:20 PM
Sure, only locally of course. Use an exec or similar system call and launch the wmplayer:


"%ProgramFiles%\Windows Media Player\wmplayer.exe" /play "/path/to/file"

tomharto
02-01-2012, 11:21 PM
Ahh great :), time to get coding :p, thanks for your help :)

Fou-Lu
02-01-2012, 11:28 PM
You bet.
This will work with start as well. Gave me some trouble then realized it couldn't tell the difference between a title and a path :/


start "" "/path/to/file.mp3"

Start should associate the mp3 with the registered default player (wmp).

tomharto
02-01-2012, 11:29 PM
Thanks for the tip :). just curious, in the first snippet you posted, what do the '%' around Program Files do?

Fou-Lu
02-01-2012, 11:33 PM
Environment variable, PROGRAMFILES refers to the path for your programs.
I can only test this on a x86 machine at work here, but given another registered environment in windows7 is PROGRAMFILES(x86) I'd suspect that program files environment is always the primary architecture. % is simply used in CLI to expand the variable to its value.

tomharto
02-01-2012, 11:35 PM
Oh, okay. Thanks :)

tangoforce
02-02-2012, 12:39 AM
Only thing I'm seeing here is that it won't put the files into the playlist. You'd need the exact length of each file, sleep the script for that duration and then execute the next file.

tomharto
02-02-2012, 12:42 AM
Atm a playlist isnt a problem, ill only be watching one or two each time at most, however if i ever need to create a playlist i think ill have a fair bit of googling to do :p.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum