Open VLC Network Streaming from web browser

2019-07-15 10:10发布

问题:

I have a web server containing video files and client computers that use VLC to view them. Now, in order to view the video, the client must go on the webpage, right click the direct link, copy it, go to VLC, open the Network Stream option and paste the URL in. I know VLC has a web plugin but I don't want to use that.

I am wondering if it is possible, via JavaScript, html, or some other method, to open VLC and copy the video URL to the Network Streaming screen, so my clients simply have to click and watch.

回答1:

This is possible, using a playlist file.

Playlist files, when loaded in a browser, will typically download and automatically launch the associated player. VLC, when installed, will typically register itself as the handler for these types.

For an M3U playlist file, all you really need is a file with a single line, containing the URL of the video you wish to play. You can optionally include some metadata for titling that video:

#EXTM3U
#EXTINF:5000,Super Awesome Example Video Title
http://example.com/videos/super-awesome-example-video.mp4