Search code examples
javascripthtmlrtspvlc

Cross-browser embed VLC plugin


I have embedded vlc plugin for Google Chrome this way:

<embed 
  type='application/x-vlc-plugin'
  pluginspage='http://www.videolan.org'
  version='VideoLAN.VLCPlugin.2'
  width='800'
  height='600'
  id='vlc'
  loop='yes'
  autoplay='yes'
  target='rtsp://127.0.0.1:8554/realtime_1db07ff1-c5f9-4597-abf6-0d442454d06c'>
</embed>

But this approach doesn't work with Internet Explorer.

Are any universal methods available to embed this player in all browsers?


Solution

  • I posted examples for both IE and Mozilla on the VideoLan forum a while ago here.

    I wrote myself a switch that distinguishes between IE and "the rest" and embeds either one control for IE, or another one for Mozilla and Chrome.

    In your particular case, the code for IE should work like this:

    <object
      classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" 
      codebase="http://download.videolan.org/pub/videolan/vlc/last/win32/axvlc.cab"
      id="vlc"
      name="vlc"
      class="vlcPlayer"
      events="True">
        <param name="Src" value="rtsp://127.0.0.1:8554/realtime_1db07ff1-c5f9-4597-abf6-0d442454d06c" />
        <param name="ShowDisplay" value="True" />
        <param name="AutoLoop" value="True" />
        <param name="AutoPlay" value="True" />
     </object>
    

    You can find further information in the VideoLan Wiki here.

    The VLC cab file unfortunately isn't available in this location anymore btw. The post I referenced above is part of a whole thread in the VLC forum about why it's not being provided anymore.