I'm trying to set up a local media server, purely for educational purpose,
and want to open local video files in VLC media player via the browser (preferably Chrome)
So far I've tried the following without any luck:
local "file:///" URLs: was able to open local directories in windows explorer
but no luck opening media files in their designated programs (using IE11).
This works if run via command line (php my_file.php), but not via browser:
$file = 'pathToFile';
system("pathtovlc/vlc {$file}");
Running a .bat file via PHP that in turn calls the VLC command line doesn't work either
In the end, opening files directly via the command line, or using PHP via the CLI,
works like a charm but I havent found a way to open a file successfully via the browser.
I'm assuming it's a user permission issue as the apache service is run using system
permissions, but I can't seem to find a workaround for this. I read about running the apache
service with administrator permissions but I'm not able to find how to actually pull this off..
Any input is greatly appreciated!
== EDIT ==
I tried to run a VLC command through psexec, but no luck..the command was run like:
exec('path_to\psexec -u myUsername -p myPassword -c ^path_to\vlc.exe
path_to\media_file');
Again this works great via command line, but not via the browser..
== EDIT 2 ==
Still fiddling around with this as there's bound to be a way to open media files in their designated program from within a webbrowser.
Apache now has administrator rights but still no luck getting this to work!
== EDIT 3==
I fiddled around with the locallinks extension in Chrome and Firefox and this got me a bit further.
Opening <a href="file:///path">link</a>
links by simply clicking on it did work in Chrome, but resulted in the problem of chrome ALWAYS downloading files (even if they're local) instead of just opening them in their designated program.
For firefox, the extension worked but it requires a right click -> locallinks -> open, which seems ok but I'm really looking for a one click solution.
Opening a file directly (say an .mkv file) in VLC works perfectly fine in Firefox via a local .html file, but when served over http://. I changed Firefox's security.fileuri.strict_origin_policy setting in about:config to false, which allows me to open local file:/// URL's even via HTTP, but for some reason it strips the filename from the end of the file URI which means it points to the directory the file is in and not the file itself.. frustrating to say the least