Open video stream on VLC Player through the browser

95,707

Solution 1

UPDATE: 2018-09-25 Most of this response only applies to older browsers, so updating some sections.

It was possible on older browsers, but required a client-side browser plugin depending on your Browser and OS versions, see: https://web.archive.org/web/20150212035837/http://www.videolan.org/doc/play-howto/en/ch04.html

Here's an excerpt showing how to embed and fallback to download or click to stream:

<object type="application/x-vlc-plugin" data="http://server.example.com/video1.mpeg" width="400" height="300" id="video1">
     <param name="movie" value="http://server.example.com/video1.mpeg"/>
     <embed type="application/x-vlc-plugin" name="video1"
     autoplay="no" loop="no" width="400" height="300"
     target="http://server.example.com/video1.mpeg" />
     <a href="http://server.example.com/video1.mpeg">Download Video1</a>
</object>

The VLC player plugin exposes a useful JavaScript API accessed either by name or ID:

<a href="javascript:;" onclick='document.video1.play()'>Play video1</a>
<a href="javascript:;" onclick='document.getElementById('video1').pause()'>Pause video1</a>
<a href="javascript:;" onclick='document.video1.stop()'>Stop video1</a>
<a href="javascript:;" onclick='document.video1.fullscreen()'>Fullscreen</a>

The MIME-type application/x-vlc-plugin is used to activate the VLC plugin (when it is available). You should provide some form of fallback, such as a regular link.

As for linking to VLC-supported protocols, it will depend on the user's device and/or OS settings, particularly which application they've selected as the default Media player for a given protocol. But an example could be:

http://www.example.com/your_file.mpg

OR:

rtsp://www.example.com/your_file.3gp

You could include "help" instructions on how to set VLC as your default player, or, alternatively you would require some software of your own to be installed on the client-side to ensure that VLC is the application that gets opened, not something else. VLC can easily be run by command-line (specified at the top of the page in that VLC Chapter 4 link).

Note that with HTML5 support getting more and more ubiquitous you might want to consider using HTML5 <video> tag and encoding in a supported profile of Ogg, MP4 or WebM.

UPDATE: 2018-09-25 The above notice is now more important to take into consideration than ever. Stick to HTML5 & open standards. The above just won't work anymore, unless VLC team brings the plugin back from the dead by developing a version that works with WebExtensions standard. For personal use, you could still use an old browser on your local network if you had built something in particular for your own video streaming using that, but would not suggest you build anything for regular web users/visitors this way.

Solution 2

I have built a few programs to open vlc:// links in Windows, Mac and Linux. See https://github.com/stefansundin/vlc-protocol

You basically need a program in between the protocol and VLC, to remove "vlc://" because VLC doesn't know about these links and that it needs to remove this prefix before trying to open the URL.

Solution 3

In iOs you can use a callback-url to open vlc from a web page:

vlc-x-callback://x-callback-url/ACTION?url=...&PARAMETER=...

Check out more info here: https://wiki.videolan.org/Documentation:IOS/#x-callback-url.

In Chrome on Android you can do it with an Intent:

https://developer.chrome.com/multidevice/android/intents

Here an example opening a Barcode reader from a link:

href="intent://scan/#Intent;scheme=zxing;package=com.google.zxing.client.android;end"

Solution 4

You can open a streaming site, view the source of the page and find the URL of the video (sometimes you have to play the video in order to be able to see the URL). Then copy and paste this link on "Open network stream..." (Ctrl+N) and here you go.

I wrote a little script that automates this process finding the URL in the streaming site and then opening it with VLC using a custom protocol. It's a really simple JS script that find the videos URL in the page and redirect to vlcs:URL; the custom protocol opens another script that delete the vlcs: from the string and send the resulting URL to VLC. All this simply by opening the streaming site.

It works with some streaming sites but I will upgrade the script with also others. Feel free read the code and add your favorite streaming site or send pull requests for new sites.

Here's the link with the instructions: https://github.com/giuseppe-dandrea/Stream-to-VLC

Hope it could help you!

Share:
95,707

Related videos on Youtube

Metafaniel
Author by

Metafaniel

Gamer, brony, developer, father, nocturnal, vampire, animaniac.

Updated on September 26, 2020

Comments

  • Metafaniel
    Metafaniel over 3 years

    Is it possible to add a type of link on a webpage that will open up VLC Player and start playing a stream video? Like this one:

    Alternatively, is it possible to embed VLC Player in the browser?

  • LordWilmore
    LordWilmore over 6 years
    Your link may well contain useful information, but you should provide a suitable description of the problem here, and then include the link as a reference if you like.
  • giuseppe-dandrea
    giuseppe-dandrea over 6 years
    Ok, I posted a more complete answer, hope it's useful now
  • ThePhi
    ThePhi over 5 years
    the plugin isn't available anymore
  • bcmoney
    bcmoney over 5 years
    Yeah, this comment is now outdated for the majority of internet users receiving auto-update via Chrome, FF, Edge, Safari... stick to HTML5 and open formats as suggested at the end of the answer.
  • ThePhi
    ThePhi over 5 years
    Thanks for your reply! Maybe you'd have an idea about my related question that I've just posted? stackoverflow.com/questions/52473966/…
  • Preview
    Preview over 4 years
    Good stuff, should be higher up :)
  • Nathan Osman
    Nathan Osman about 3 years
    I can't seem to get the intent working for Android. For example, this only opens the Play Store page for VLC: intent://vlclauncher/#Intent;package=org.videolan.vlc;scheme‌​=org.videolan.vlc;en‌​d;