- Open file in VLC via HTML/JS or PHP
- Resuming VLC Media Player Video in PHP is the
- Open file in VLC via HTML/JS or PHP
- Play Media files using Python
- How to auto-resume the last played file in VLC
- Python VLC MediaListPlayer
- How to open a video stream in an application from HTML
- The VideoLAN Forums
- PHP & VLC media player.
Open file in VLC via HTML/JS or PHP
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 ");
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!
Resuming VLC Media Player Video in PHP is the
The media list player is designed to play a sequence of media files, such as a TV series, rather than playing individual files one at a time. While its operation is comparable to that of the MediaPlayer object, it has the ability to play a list of media files.
Open file in VLC via HTML/JS or PHP
Ultimately, I was able to make it functional (only on firefox) so that when I click on a file’s URL, the file will be launched in the assigned software outside of firefox.
It was discovered that by disabling Firefox’s VLC plugin, setting security.fileuri.strict_origin_policy to false, and enabling allAccess for capability.policy.default.checkloaduri.enabled, the issue was resolved.
Despite my attempts to execute commands via PHP at an administrator level, I have yet to discover a crossbrowser solution. Unfortunately, my hope for finding one has diminished.
Although I’m not certain about JS due to security reasons, you can accomplish this task in PHP since you mentioned that you are operating it locally.
$vlc = "C:\Program Files (x86)\VideoLan\VLC\vlc.exe"; // or whatever the path to vlc is; $path_file = "C:\your\path\file.mp4"; // you can also retrieve that with a relative path like using realpath(relative_path); // launch vlc pclose(popen("start \"$vlc\" \"$path_file\"", "r"));
You have the option to open all the files in a folder.
pclose(popen("start "VLCFlux" \"$vlc\" \"$path_folder\"", "r"));
When this script is executed through an ajax call, there is not a significant variance.
(PHP) Problem with filename after downloading it, The PHP-Script consist in letting a user download a .mp4 file. The download works without any issues but the file downloaded can not be played.
Play Media files using Python
Play Media files using Python code by just two lines of code with example! This video covers Duration: 3:38
How to auto-resume the last played file in VLC
To enable resume playback, it is necessary to download and install it from the VLC marketplace.
Kindly go through the tutorials below for instructions on how to accomplish it.
The latest update to VLC offers a range of new features, including support for in-app extensions, the ability to resume playback, and compatibility with Android TV. The update was recently announced on PCWorld’s website.
Python VLC MediaListPlayer, VLC media player is a free and open-source portable cross-platform media player software and streaming media server developed by the VideoLAN
Python VLC MediaListPlayer
Learn how to pause and resume the MediaListPlayer object in the python vlc module in this article. Developed by the VideoLAN project, VLC media player is a portable cross-platform media player software and streaming media server that is free and open-source. The MediaListPlayer object is used to play a series of media files in a row, rather than a single media file. Although it works similarly to the MediaPlayer object, it can play a list of media files. You can pause and resume the media list player at any time, causing the frame and audio to stop when paused, and resume from the paused point when resumed.
To accomplish this, the MediaListPlayer object will be employed utilizing the set_pause technique.
The following syntax can be used to pause the media list player: media_list_player.set_pause(1)
The argument states that a value of zero is required to play or resume, while any non-zero value is needed to pause.
The function has a return statement that does not return any value.
Below is the implementation
The following codes are listed below: # importing vlc module import vlc # importing time module import time # creating a media player object media_player = vlc.MediaListPlayer() # creating Instance class object player = vlc.Instance() # creating a new media list object media_list = player.media_list_new() # creating a new media media = player.media_new( «death_note.mkv» ) # adding media to media list media_list.add_media(media) # setting media list to the media player media_player.set_media_list(media_list) # start playing video media_player.play() # wait so the video can be played for 5 seconds # irrespective for length of video time.sleep( 5 ) # pausing media media_player.set_pause( 1 ) # wait for 4 second # so that it remained paused for 4 seconds time.sleep( 4 ) |
The following is the result:
Here’s an illustration followed by its execution.
The following codes are listed below: Code 1 Code 2, Code 3 Code 4 Code 5 Code 6, Code 7 Code 8 Code 9 Code 10, Code 11, Code 12 Code 13 Code 14 Code 15, Code 16, Code 17 Code 18 Code 19 Code 20, Code 21, Code 22 Code 23 Code 24 Code 25, Code 26, Code 27, Code 28, Code 29 Code 30 Code 31 Code 32 Code 33 Code 34 Code 35 Code 36 Code 37 Code 38 Code 39 Code 40 Code 41 Code 42 Code 43, Code 44, Code 45 Code 46 Code 47 Code 48, Code 49, Code 50 Code 51 Code 52 Code 53 Code 54, Code 55, Code 56 |
Here is the result obtained:
Play Media files using Python, Play Media files using Python code by just two lines of code with example! This video covers Duration: 3:38
How to open a video stream in an application from HTML
Python VLC MediaPlayer, VLC media player is a free and open-source portable cross-platform media player software and streaming media server developed by the
The VideoLAN Forums
ArmadaNL New Cone
Posts: 2 Joined: 24 Jan 2005 15:03
PHP & VLC media player.
Post by ArmadaNL » 24 Jan 2005 15:07
Doesn’t anyone know how to refer to a moviefile in a php page with VLC accepting it?
When I use IE will simply download to movie, but VLC can’t use it as a stream.
The weird part is that the link to the file does appear in VLC promptly. So it does know there is a reference, but isn’t willing to open it.
The DJ Cone Master
Posts: 5987 Joined: 22 Nov 2003 21:52 VLC version: git Operating System: Mac OS X Location: Enschede, Holland Contact:
Post by The DJ » 25 Jan 2005 01:33
You are doing http-header redirect or something?
I don’t think Location: is something VLC accepts. Isn’t there another form of http redirecting you can use?
ArmadaNL New Cone
Posts: 2 Joined: 24 Jan 2005 15:03
Post by ArmadaNL » 25 Jan 2005 12:12
The only other form I know of is include(«page.php»);, but that doesn’t work for movie files. (only for other webpages)
Post by christian.roessler » 04 Apr 2006 18:16
The only other form I know of is include(«page.php»);, but that doesn’t work for movie files. (only for other webpages)
take a look at php.net -> header in function list
you can send additional header information to make a browser/app save a file, download it or make it streaming..
its like
header(«content-type: application/octet-stream»);
header(«content-disposition: attachment»);
header(«. «);
.
and so on
just play a bit, more information can be found in google.
it just wont work with: include() or header location: movie.mpg