Difference between revisions of "Documentation:WebPlugin"

From VideoLAN Wiki
Jump to navigation Jump to search
m
Line 1: Line 1:
 
{{RightMenu|documentation play howto toc}}  
 
{{RightMenu|documentation play howto toc}}  
==Building HTML pages for Mozilla/Firefox/Internet Explorer/Safari ==
+
 
 +
== Building HTML pages for Mozilla Firefox [[Image:Firefox-logo.png|100x100px]]/Internet Explorer[[Image:20101105053305!Internet_Explorer_9.png|100x100px]] /Safari [[Image:Apple_Safari.png|100x100px]] ==
  
 
The following description works for any of the browsers VLC supports. The JavaScript API has been unified between Mozilla/Firefox/IE (ActiveX) and Safari, thus targeting at all of the major OS out there.  
 
The following description works for any of the browsers VLC supports. The JavaScript API has been unified between Mozilla/Firefox/IE (ActiveX) and Safari, thus targeting at all of the major OS out there.  
  
This is only valid for {{VLC}} version 0.8.6 and above.
+
This is only valid for {{VLC}} version 0.8.6 and above.  
  
Additionally to viewing video on all pages, you can build custom pages that will use the advanced features of the plugin, using Javascript functions to control playback or extract information from the
+
Additionally to viewing video on all pages, you can build custom pages that will use the advanced features of the plugin, using Javascript functions to control playback or extract information from the plugin.  
plugin.
 
  
 +
<br> '''Warning to developers who wish to embed VLC: As of v1.1.5 (plugin v2), the use of CSS3 transitions or transforms with embedded VLC object will cause VLC to crash. Also, VLC does not respond to z-index, it will always force itself on top. This was tested on FF4b9 and Chrome8.0.552.237. Neither of these problems exist with HTML5 &lt;video&gt; (fully tested) or flash (partially tested).'''
  
'''Warning to developers who wish to embed VLC: As of v1.1.5 (plugin v2), the use of CSS3 transitions or transforms with embedded VLC object will cause VLC to crash. Also, VLC does not respond to z-index, it will always force itself on top. This was tested on FF4b9 and Chrome8.0.552.237. Neither of these problems exist with HTML5 <video> (fully tested) or flash (partially tested).'''
+
== API description  ==
  
== API description ==
+
The vlc plugin exports several objects that can be accessed for setting and getting information. When used improperly the API's will throw an exception that includes a string that explains what happened. For example when asking for vlc.input.length when there is no playlist item playing.  
The vlc plugin exports several objects that can be accessed for setting and getting information. When used improperly the API's will throw an exception that includes a string that explains what happened. For example when asking for vlc.input.length when there is no playlist item playing.
 
  
The vlc plugin knows the following objects:
+
The vlc plugin knows the following objects:  
  
*'''audio''': Access audio properties.
+
*'''audio''': Access audio properties.  
*'''input''': Access input properties.
+
*'''input''': Access input properties.  
*'''playlist''': Access playlist properties.
+
*'''playlist''': Access playlist properties.  
*'''subtitle''': Access subtitle properties.
+
*'''subtitle''': Access subtitle properties.  
*'''video''': Access video properties.
+
*'''video''': Access video properties.  
**'''video.marquee''': Access marquee video filter properties.
+
**'''video.marquee''': Access marquee video filter properties.  
**'''video.logo''': Access logo video filter properties.
+
**'''video.logo''': Access logo video filter properties.  
*'''log''': Access log properties (only available in vlc version <= 1.0.0-rc1).
+
*'''log''': Access log properties (only available in vlc version &lt;= 1.0.0-rc1).  
*'''messages''': Access to log message properties (only available in vlc version <= 1.0.0-rc1).
+
*'''messages''': Access to log message properties (only available in vlc version &lt;= 1.0.0-rc1).  
*'''iterator''': Access to log iterator properties (only available in vlc version <= 1.0.0-rc1).
+
*'''iterator''': Access to log iterator properties (only available in vlc version &lt;= 1.0.0-rc1).
  
The following JavaScript code shows howto get a reference to the vlc plugin. This reference can then be used to access the objects of the vlc plugin.
+
The following JavaScript code shows howto get a reference to the vlc plugin. This reference can then be used to access the objects of the vlc plugin.  
  
 
  &lt;html&gt;
 
  &lt;html&gt;
Line 34: Line 34:
 
  &lt;body&gt;
 
  &lt;body&gt;
 
  &lt;embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" version="VideoLAN.VLCPlugin.2"
 
  &lt;embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" version="VideoLAN.VLCPlugin.2"
    width="640"
+
    width="640"
    height="480"
+
    height="480"
    id="vlc"&gt;
+
    id="vlc"&gt;
 
  &lt;/embed&gt;
 
  &lt;/embed&gt;
 
  &lt;script language="Javascript"&gt;
 
  &lt;script language="Javascript"&gt;
Line 47: Line 47:
 
  &lt;/html&gt;
 
  &lt;/html&gt;
  
====Root object====
+
==== Root object ====
 +
 
 +
readonly properties
  
readonly properties
 
 
*'''VersionInfo''': returns version information string
 
*'''VersionInfo''': returns version information string
  
read/write properties
+
read/write properties  
 +
 
 
*''none''
 
*''none''
  
methods
+
methods  
 +
 
 
*'''vlc.versionInfo()''': returns version information string (same as VersionInfo)
 
*'''vlc.versionInfo()''': returns version information string (same as VersionInfo)
  
*'''vlc.addEventListener(eventname, callback, bubble)''': (only for Mozilla) add a listener for mentioned event name, callback expects a function and bubble influences the order of eventhandling by JS (usually it is set to false).
+
*'''vlc.addEventListener(eventname, callback, bubble)''': (only for Mozilla) add a listener for mentioned event name, callback expects a function and bubble influences the order of eventhandling by JS (usually it is set to false).  
 
*'''vlc.removeEventListener(eventname, callback, bubble)''': (only for Mozilla) remove listener for mentioned event name, callback expects a function and bubble influences the order of eventhandling by JS (usually it is set to false).
 
*'''vlc.removeEventListener(eventname, callback, bubble)''': (only for Mozilla) remove listener for mentioned event name, callback expects a function and bubble influences the order of eventhandling by JS (usually it is set to false).
  
*'''vlc.attachEvent(eventname, callback)''': (only for ActiveX) add listener for mentioned event name, callback expects a function
+
*'''vlc.attachEvent(eventname, callback)''': (only for ActiveX) add listener for mentioned event name, callback expects a function  
 
*'''vlc.removeEvent(eventname, callback)''': (only for ActiveX) remove listener for mentioned event name, callback expects a function
 
*'''vlc.removeEvent(eventname, callback)''': (only for ActiveX) remove listener for mentioned event name, callback expects a function
  
events
+
events  
*'''MediaPlayerNothingSpecial''': vlc is in idle state doing nothing but waiting for a command to be issued
+
 
*'''MediaPlayerOpening''': vlc is opening an media resource locator (MRL)
+
*'''MediaPlayerNothingSpecial''': vlc is in idle state doing nothing but waiting for a command to be issued  
*'''MediaPlayerBuffering''': vlc is buffering
+
*'''MediaPlayerOpening''': vlc is opening an media resource locator (MRL)  
*'''MediaPlayerPlaying''': vlc is playing a media
+
*'''MediaPlayerBuffering''': vlc is buffering  
*'''MediaPlayerPaused''': vlc is in paused state
+
*'''MediaPlayerPlaying''': vlc is playing a media  
*'''MediaPlayerForward''': vlc is fastforwarding through the media (works only when an input supports forward playback)
+
*'''MediaPlayerPaused''': vlc is in paused state  
*'''MediaPlayerBackward''': vlc is going backwards through the media (works only when an input supports backwards playback)
+
*'''MediaPlayerForward''': vlc is fastforwarding through the media (works only when an input supports forward playback)  
*'''MediaPlayerEncounteredError''': vlc has encountered an error and is unable to continue
+
*'''MediaPlayerBackward''': vlc is going backwards through the media (works only when an input supports backwards playback)  
*'''MediaPlayerEndReached''': vlc has reached the end of current playlist
+
*'''MediaPlayerEncounteredError''': vlc has encountered an error and is unable to continue  
*'''MediaPlayerTimeChanged''': time has changed
+
*'''MediaPlayerEndReached''': vlc has reached the end of current playlist  
*'''MediaPlayerPositionChanged''': media position has changed
+
*'''MediaPlayerTimeChanged''': time has changed  
*'''MediaPlayerSeekableChanged''': media seekable flag has changed (true means media is seekable, false means it is not)
+
*'''MediaPlayerPositionChanged''': media position has changed  
 +
*'''MediaPlayerSeekableChanged''': media seekable flag has changed (true means media is seekable, false means it is not)  
 
*'''MediaPlayerPausableChanged''': media pausable flag has changed (true means media is pauseable, false means it is not)
 
*'''MediaPlayerPausableChanged''': media pausable flag has changed (true means media is pauseable, false means it is not)
  
The following code snippit provides easy functions to register and unregister event callbacks on all supported platforms (currently only Linux mozilla based browsers and windows activeX objects for Internet Explorer).
+
The following code snippit provides easy functions to register and unregister event callbacks on all supported platforms (currently only Linux mozilla based browsers and windows activeX objects for Internet Explorer).  
  
  <SCRIPT language="javascript">
+
  &lt;SCRIPT language="javascript"&gt;
 
  &lt;!--
 
  &lt;!--
 
  function registerVLCEvent(event, handler)
 
  function registerVLCEvent(event, handler)
 
  {
 
  {
    var vlc = getVLC("vlc");
+
  var vlc = getVLC("vlc");
    if (vlc) {
+
  if (vlc) {
        if (vlc.attachEvent) {
+
      if (vlc.attachEvent) {
            // Microsoft
+
          // Microsoft
            vlc.attachEvent (event, handler);
+
          vlc.attachEvent (event, handler);
        } else if (vlc.addEventListener) {
+
      } else if (vlc.addEventListener) {
            // Mozilla: DOM level 2
+
          // Mozilla: DOM level 2
            vlc.addEventListener (event, handler, false);
+
          vlc.addEventListener (event, handler, false);
        } else {
+
      } else {
            // DOM level 0
+
          // DOM level 0
            vlc["on" + event] = handler;
+
          vlc["on" + event] = handler;
        }
+
      }
    }
+
  }
 
  }
 
  }
 
  // stop listening to event
 
  // stop listening to event
 
  function unregisterVLCEvent(event, handler)
 
  function unregisterVLCEvent(event, handler)
 
  {
 
  {
    var vlc = getVLC("vlc");
+
  var vlc = getVLC("vlc");
    if (vlc) {
+
  if (vlc) {
        if (vlc.detachEvent) {
+
      if (vlc.detachEvent) {
            // Microsoft
+
          // Microsoft
            vlc.detachEvent (event, handler);
+
          vlc.detachEvent (event, handler);
        } else if (vlc.removeEventListener) {
+
      } else if (vlc.removeEventListener) {
            // Mozilla: DOM level 2
+
          // Mozilla: DOM level 2
            vlc.removeEventListener (event, handler, false);
+
          vlc.removeEventListener (event, handler, false);
        } else {
+
      } else {
            // DOM level 0
+
          // DOM level 0
            vlc["on" + event] = null;
+
          vlc["on" + event] = null;
        }
+
      }
    }
+
  }
 
  }
 
  }
 
  // event callback function for testing
 
  // event callback function for testing
 
  function handleEvents(event)
 
  function handleEvents(event)
 
  {
 
  {
    if (!event)
+
  if (!event)
        event = window.event; // IE
+
      event = window.event; // IE
    if (event.target) {
+
  if (event.target) {
        // Netscape based browser
+
      // Netscape based browser
        targ = event.target;
+
      targ = event.target;
    } else if (event.srcElement) {
+
  } else if (event.srcElement) {
        // ActiveX
+
      // ActiveX
        targ = event.srcElement;
+
      targ = event.srcElement;
    } else {
+
  } else {
        // No event object, just the value
+
      // No event object, just the value
        alert("Event value" + event );
+
      alert("Event value" + event );
        return;
+
      return;
    }
+
  }
    if (targ.nodeType == 3) // defeat Safari bug
+
  if (targ.nodeType == 3) // defeat Safari bug
        targ = targ.parentNode;
+
      targ = targ.parentNode;
    alert("Event " + event.type + " has fired from " + targ );
+
  alert("Event " + event.type + " has fired from " + targ );
 
  }
 
  }
 
  // handle mouse grab event from video filter
 
  // handle mouse grab event from video filter
 
  function handleMouseGrab(event,X,Y)
 
  function handleMouseGrab(event,X,Y)
 
  {
 
  {
    if (!event)
+
  if (!event)
        event = window.event; // IE
+
      event = window.event; // IE
    alert("new position (" + X + "," + Y + ")");
+
  alert("new position (" + X + "," + Y + ")");
 
  }
 
  }
 
  // Register a bunch of callbacks.
 
  // Register a bunch of callbacks.
Line 157: Line 161:
 
  registerVLCEvent('MediaPlayerSeekableChanged', handleEvents);
 
  registerVLCEvent('MediaPlayerSeekableChanged', handleEvents);
 
  registerVLCEvent('MediaPlayerPausableChanged', handleEvents);
 
  registerVLCEvent('MediaPlayerPausableChanged', handleEvents);
  </script>
+
  &lt;/script&gt;
 
  --&gt;
 
  --&gt;
  
====Audio object====
+
==== Audio object ====
 +
 
 +
readonly properties
 +
 
 +
*'''vlc.audio.count''': (supported in vlc version &gt;= 1.1.0) returns the number of audio track available.
  
readonly properties
+
read/write properties  
*'''vlc.audio.count''': (supported in vlc version >= 1.1.0) returns the number of audio track available.
 
  
read/write properties
+
*'''vlc.audio.mute''': boolean value to mute and unmute the audio.  
*'''vlc.audio.mute''': boolean value to mute and unmute the audio.
+
*'''vlc.audio.volume''': a value between [0-200] which indicates a percentage of the volume.  
*'''vlc.audio.volume''': a value between [0-200] which indicates a percentage of the volume.
+
*'''vlc.audio.track''': (supported in vlc version &gt; 0.8.6) a value between [1-65535] which indicates the audio track to play or that is playing. a value of 0 means the audio is/will be disabled.  
*'''vlc.audio.track''': (supported in vlc version > 0.8.6) a value between [1-65535] which indicates the audio track to play or that is playing. a value of 0 means the audio is/will be disabled.
+
*'''vlc.audio.channel''': (supported in vlc version &gt; 0.8.6) integer value between [1-5] that indicates which audio channel mode is used, values can be: "1=stereo", "2=reverse stereo", "3=left", "4=right", "5=dolby". Use vlc.audio.channel to check if setting of the audio channel mode has succeeded.
*'''vlc.audio.channel''': (supported in vlc version > 0.8.6) integer value between [1-5] that indicates which audio channel mode is used, values can be: "1=stereo", "2=reverse stereo", "3=left", "4=right", "5=dolby". Use vlc.audio.channel to check if setting of the audio channel mode has succeeded.
 
  
 
  Audio Channel:
 
  Audio Channel:
  <SELECT readonly onChange='doAudioChannel(this.value)'>
+
  &lt;SELECT readonly onChange='doAudioChannel(this.value)'&gt;
    <OPTION value=1>Stereo</OPTION>
+
  &lt;OPTION value=1&gt;Stereo&lt;/OPTION&gt;
    <OPTION value=2>Reverse stereo</OPTION>
+
  &lt;OPTION value=2&gt;Reverse stereo&lt;/OPTION&gt;
    <OPTION value=3>Left</OPTION>
+
  &lt;OPTION value=3&gt;Left&lt;/OPTION&gt;
    <OPTION value=4>Right</OPTION>
+
  &lt;OPTION value=4&gt;Right&lt;/OPTION&gt;
    <OPTION value=5>Dolby</OPTION>
+
  &lt;OPTION value=5&gt;Dolby&lt;/OPTION&gt;
  </SELECT>
+
  &lt;/SELECT&gt;
  
  <SCRIPT language="javascript">
+
  &lt;SCRIPT language="javascript"&gt;
 
  &lt;!--
 
  &lt;!--
 
  function doAudioChannel(value)
 
  function doAudioChannel(value)
 
  {
 
  {
    var vlc = getVLC("vlc");
+
  var vlc = getVLC("vlc");
    vlc.audio.channel = parseInt(value);
+
  vlc.audio.channel = parseInt(value);
    alert(vlc.audio.channel);
+
  alert(vlc.audio.channel);
 
  };
 
  };
 
  --&gt;
 
  --&gt;
  
methods
+
methods  
*'''vlc.audio.toggleMute()''': boolean toggle that mutes and unmutes the audio based upon the previous state.
+
 
*'''vlc.audio.description(int i)''': (supported in vlc version >= 1.1.0) give the i-th audio track name. 0 corresponds to disable and 1 to the first audio track.
+
*'''vlc.audio.toggleMute()''': boolean toggle that mutes and unmutes the audio based upon the previous state.  
 +
*'''vlc.audio.description(int i)''': (supported in vlc version &gt;= 1.1.0) give the i-th audio track name. 0 corresponds to disable and 1 to the first audio track.
 +
 
 +
==== Input object ====
  
====Input object====
+
readonly properties
  
readonly properties
 
 
*'''vlc.input.length''': length of the input file in number of milliseconds. 0 is returned for 'live' streams or clips whose length cannot be determined by VLC. It returns -1 if no input is playing.  
 
*'''vlc.input.length''': length of the input file in number of milliseconds. 0 is returned for 'live' streams or clips whose length cannot be determined by VLC. It returns -1 if no input is playing.  
*'''vlc.input.fps''': frames per second returned as a float (typically 60.0, 50.0, 23.976, etc...)
+
*'''vlc.input.fps''': frames per second returned as a float (typically 60.0, 50.0, 23.976, etc...)  
 
*'''vlc.input.hasVout''': a boolean that returns true when the video is being displayed, it returns false when video is not displayed
 
*'''vlc.input.hasVout''': a boolean that returns true when the video is being displayed, it returns false when video is not displayed
  
read/write properties
+
read/write properties  
*'''vlc.input.position''': normalized position in multimedia stream item given as a float value between [0.0 - 1.0]
+
 
 +
*'''vlc.input.position''': normalized position in multimedia stream item given as a float value between [0.0 - 1.0]  
 
*'''vlc.input.time''': the absolute position in time given in milliseconds, this property can be used to seek through the stream
 
*'''vlc.input.time''': the absolute position in time given in milliseconds, this property can be used to seek through the stream
  &lt;!-- absolute seek in stream !--&gt;
+
 
 +
  &lt;!-- absolute seek in stream&nbsp;!--&gt;
 
  vlc.input.time = &lt;absolute seek&gt;
 
  vlc.input.time = &lt;absolute seek&gt;
  &lt;!-- relative seek in stream !--&gt;
+
  &lt;!-- relative seek in stream&nbsp;!--&gt;
 
  vlc.input.time = vlc.input.time + &lt;relative seek&gt;
 
  vlc.input.time = vlc.input.time + &lt;relative seek&gt;
*'''vlc.input.state''': current state of the input chain given as enumeration (IDLE=0, OPENING=1, BUFFERING=2, PLAYING=3, PAUSED=4, STOPPING=5, ENDED=6, ERROR=7). Note: Test for ENDED=6 to catch end of playback. Checking for STOPPING=5 is NOT ENOUGH.
+
 
 +
*'''vlc.input.state''': current state of the input chain given as enumeration (IDLE=0, OPENING=1, BUFFERING=2, PLAYING=3, PAUSED=4, STOPPING=5, ENDED=6, ERROR=7). Note: Test for ENDED=6 to catch end of playback. Checking for STOPPING=5 is NOT ENOUGH.  
 
*'''vlc.input.rate''': input speed given as float (1.0 for normal speed, 0.5 for half speed, 2.0 for twice as fast, etc.).
 
*'''vlc.input.rate''': input speed given as float (1.0 for normal speed, 0.5 for half speed, 2.0 for twice as fast, etc.).
rate &gt; 1              : is fastforward
 
rate &gt; 0 and rate &lt; 1 : is slow motion
 
rate &lt; 0              : is rewind
 
  
methods
+
rate &gt; 1            &nbsp;: is fastforward
 +
rate &gt; 0 and rate &lt; 1&nbsp;: is slow motion
 +
rate &lt; 0            &nbsp;: is rewind
 +
 
 +
methods  
 +
 
 
*''none''
 
*''none''
  
====Playlist object====
+
==== Playlist object ====
 +
 
 +
readonly properties
 +
 
 +
*'''vlc.playlist.itemCount''': number that returns the amount of items currently in the playlist ('''deprecated''', do not use, see [[#Playlist_items_object|Playlist items]])
 +
*'''vlc.playlist.isPlaying''': a boolean that returns true if the current playlist item is playing and false when it is not playing
 +
*'''vlc.playlist.items''': return the playlist items collection, see [[#Playlist_items_object|Playlist items]]
  
readonly properties
+
read/write properties  
*'''vlc.playlist.itemCount''': number that returns the amount of items currently in the playlist ('''deprecated''', do not use, see [[#Playlist_items_object| Playlist items]])
 
*'''vlc.playlist.isPlaying''': a boolean that returns true if the current playlist item is playing and false when it is not playing
 
*'''vlc.playlist.items''': return the playlist items collection, see [[#Playlist_items_object| Playlist items]]
 
  
read/write properties
 
 
*''none''
 
*''none''
  
methods
+
methods  
*'''vlc.playlist.add(mrl)''': add a playlist item as [[MRL]]. The MRL must be given as a string. Returns a number as an item identifier in playlist (this is not a position in playlist).
+
 
 +
*'''vlc.playlist.add(mrl)''': add a playlist item as [[MRL]]. The MRL must be given as a string. Returns a number as an item identifier in playlist (this is not a position in playlist).  
 
*'''vlc.playlist.add(mrl,name,options)''': add a playlist item as MRL, with metaname 'name' and options 'options'. options are text arguments which can be provided either as a single string containing space separated values, akin to VLC command line, or as an array of string values. Returns a number as an item identifier in playlist (this is not a position in playlist).
 
*'''vlc.playlist.add(mrl,name,options)''': add a playlist item as MRL, with metaname 'name' and options 'options'. options are text arguments which can be provided either as a single string containing space separated values, akin to VLC command line, or as an array of string values. Returns a number as an item identifier in playlist (this is not a position in playlist).
 +
 
   var options = new Array(":aspect-ratio=4:3", "--rtsp-tcp");
 
   var options = new Array(":aspect-ratio=4:3", "--rtsp-tcp");
  var id = vlc.playlist.add("rtsp://servername/item/to/play", "fancy name", options);
+
var id = vlc.playlist.add("rtsp://servername/item/to/play", "fancy name", options);
  vlc.playlist.playItem(id);
+
vlc.playlist.playItem(id);
*'''vlc.playlist.play()''': start playing the current playlist item
 
*'''vlc.playlist.playItem(number)''': start playing the item whose identifier is number
 
*'''vlc.playlist.togglePause()''': toggle the pause state for the current playlist item
 
*'''vlc.playlist.stop()''': stop playing the current playlist item
 
*'''vlc.playlist.next()''': iterate to the next playlist item
 
*'''vlc.playlist.prev()''': iterate to the previous playlist item
 
*'''vlc.playlist.clear()''': empty the current playlist, all items will be deleted from the playlist ('''deprecated''', do not use, see [[#Playlist_items_object| Playlist items]])
 
*'''vlc.playlist.removeItem(number)''': remove the item from playlist whose identifier is number <!-- (note: this number isn't the position in the playlist, but the number given by vlc.playlist.add() ) --> ('''deprecated''', do not use, see [[#Playlist_items_object| Playlist items]])
 
  
====Playlist items object====
+
*'''vlc.playlist.play()''': start playing the current playlist item
 +
*'''vlc.playlist.playItem(number)''': start playing the item whose identifier is number
 +
*'''vlc.playlist.togglePause()''': toggle the pause state for the current playlist item
 +
*'''vlc.playlist.stop()''': stop playing the current playlist item
 +
*'''vlc.playlist.next()''': iterate to the next playlist item
 +
*'''vlc.playlist.prev()''': iterate to the previous playlist item
 +
*'''vlc.playlist.clear()''': empty the current playlist, all items will be deleted from the playlist ('''deprecated''', do not use, see [[#Playlist_items_object|Playlist items]])
 +
*'''vlc.playlist.removeItem(number)''': remove the item from playlist whose identifier is number <!-- (note: this number isn't the position in the playlist, but the number given by vlc.playlist.add() ) --> ('''deprecated''', do not use, see [[#Playlist_items_object|Playlist items]])
 +
 
 +
==== Playlist items object ====
 +
 
 +
readonly properties
  
readonly properties
 
 
*'''vlc.playlist.items.count''': number of items currently in the playlist
 
*'''vlc.playlist.items.count''': number of items currently in the playlist
  
read/write properties
+
read/write properties  
 +
 
 
*''none''
 
*''none''
  
methods
+
methods  
*'''vlc.playlist.items.clear()''': empty the current playlist, all items will be deleted from the playlist. If a movie is playing, it stop. Note that when this method returns, playlist may not have been entirely been cleared as this operation is performed asynchronously; use the ''count'' property to verify/wait until the playlist is empty.
+
 
 +
*'''vlc.playlist.items.clear()''': empty the current playlist, all items will be deleted from the playlist. If a movie is playing, it stop. Note that when this method returns, playlist may not have been entirely been cleared as this operation is performed asynchronously; use the ''count'' property to verify/wait until the playlist is empty.  
 
*'''vlc.playlist.items.remove(number)''': remove the item whose identifier is number from playlist. (note: this number isn't the position in the playlist, but the number given by vlc.playlist.add() )
 
*'''vlc.playlist.items.remove(number)''': remove the item whose identifier is number from playlist. (note: this number isn't the position in the playlist, but the number given by vlc.playlist.add() )
  
====Subtitle object====
+
==== Subtitle object ====
  
readonly properties
+
readonly properties  
  
*'''vlc.subtitle.count''': (supported in vlc version >= 1.1.0) returns the number of subtitle available.
+
*'''vlc.subtitle.count''': (supported in vlc version &gt;= 1.1.0) returns the number of subtitle available.
  
 
read/write properties  
 
read/write properties  
  
*'''vlc.subtitle.track''': (supported in vlc version >= 1.1.0) get and set the subtitle track to show on the video screen. The property takes an integer as input value [1..65535]. If subtitle track is set to 0, the subtitles will be disabled. If set to a value outside the current subtitle tracks range, then it will return -1 and display an error message.
+
*'''vlc.subtitle.track''': (supported in vlc version &gt;= 1.1.0) get and set the subtitle track to show on the video screen. The property takes an integer as input value [1..65535]. If subtitle track is set to 0, the subtitles will be disabled. If set to a value outside the current subtitle tracks range, then it will return -1 and display an error message.
  
methods
+
methods  
  
*'''vlc.subtitle.description(int i)''': (supported in vlc version >= 1.1.0) give the i-th subtitle name. 0 correspond to disable and 1 to the first subtitle.
+
*'''vlc.subtitle.description(int i)''': (supported in vlc version &gt;= 1.1.0) give the i-th subtitle name. 0 correspond to disable and 1 to the first subtitle.
  
====Video object====
+
==== Video object ====
  
readonly properties
+
readonly properties  
*'''vlc.video.width''': returns the horizontal size of the video
+
 
 +
*'''vlc.video.width''': returns the horizontal size of the video  
 
*'''vlc.video.height''': returns the vertical size of the video
 
*'''vlc.video.height''': returns the vertical size of the video
  
read/write properties
+
read/write properties  
*'''vlc.video.fullscreen''': when set to true the video will be displayed in fullscreen mode, when set to false the video will be shown inside the video output size. The property takes a boolean as input.
 
*'''vlc.video.aspectRatio''': get and set the aspect ratio to use in the video screen. The property takes a string as input value. Typical values are: "1:1", "4:3", "16:9", "16:10", "221:100" and "5:4"
 
*'''vlc.video.subtitle''': (supported in vlc version > 0.8.6a) get and set the subtitle track to show on the video screen. The property takes an integer as input value [1..65535]. If subtitle track is set to 0, the subtitles will be disabled. If set to a value outside the current subtitle tracks range, then it will return -1 and display an error message.
 
*'''vlc.video.teletext''': (supported in vlc version >= 0.9.0) get and set teletext page to show on the video stream. This will only work if a teletext elementary stream is available in the video stream. The property takes an integer as input value [0..999] for indicating the teletext page to view, setting the value to 0 means hide teletext. On error it will return -1 and display an error message.
 
  
methods
+
*'''vlc.video.fullscreen''': when set to true the video will be displayed in fullscreen mode, when set to false the video will be shown inside the video output size. The property takes a boolean as input.
*'''vlc.video.toggleFullscreen()''': toggle the fullscreen mode based on the previous setting
+
*'''vlc.video.aspectRatio''': get and set the aspect ratio to use in the video screen. The property takes a string as input value. Typical values are: "1:1", "4:3", "16:9", "16:10", "221:100" and "5:4"
*'''vlc.video.toggleTeletext()''': (supported in vlc version >= 0.9.0) toggle the teletext page to overlay transparent or not, based on the previous setting
+
*'''vlc.video.subtitle''': (supported in vlc version &gt; 0.8.6a) get and set the subtitle track to show on the video screen. The property takes an integer as input value [1..65535]. If subtitle track is set to 0, the subtitles will be disabled. If set to a value outside the current subtitle tracks range, then it will return -1 and display an error message.
 +
*'''vlc.video.teletext''': (supported in vlc version &gt;= 0.9.0) get and set teletext page to show on the video stream. This will only work if a teletext elementary stream is available in the video stream. The property takes an integer as input value [0..999] for indicating the teletext page to view, setting the value to 0 means hide teletext. On error it will return -1 and display an error message.
  
=====Deinterlace Object=====
+
methods
  
readonly properties
+
*'''vlc.video.toggleFullscreen()''': toggle the fullscreen mode based on the previous setting
 +
*'''vlc.video.toggleTeletext()''': (supported in vlc version &gt;= 0.9.0) toggle the teletext page to overlay transparent or not, based on the previous setting
  
* ''none''
+
===== Deinterlace Object =====
  
read/write properties
+
readonly properties  
  
* ''none''
+
*''none''
  
methods
+
read/write properties
 +
 
 +
*''none''
 +
 
 +
methods  
 +
 
 +
*'''vlc.video.deinterlace.enable("my_mode")''': (supported in vlc version &gt;= 1.1.0) enable deinterlacing with my_mode. You can enable it with "blend", "bob", "discard", "linear", "mean", "x", "yadif" or "yadif2x" mode. Enabling too soon deinterlacing may cause some problems. You have to wait that all variable are available before enabling it.
 +
*'''vlc.video.deinterlace.disable()''': (supported in vlc version &gt;= 1.1.0) disable deinterlacing.
 +
 
 +
===== Marquee Object =====
  
*'''vlc.video.deinterlace.enable("my_mode")''': (supported in vlc version >= 1.1.0) enable deinterlacing with my_mode. You can enable it with "blend", "bob", "discard", "linear", "mean", "x", "yadif" or "yadif2x" mode. Enabling too soon deinterlacing may cause some problems. You have to wait that all variable are available before enabling it.
+
readonly properties
*'''vlc.video.deinterlace.disable()''': (supported in vlc version >= 1.1.0) disable deinterlacing.
 
  
=====Marquee Object=====
+
*''none''
  
readonly properties
+
read/write properties  
  
* ''none''
+
*'''vlc.video.marquee.text''': (supported in vlc version &gt;= 1.1.0) display my text on the screen.
 +
*'''vlc.video.marquee.color''': (supported in vlc version &gt;= 1.1.0) change the text color. val is the new color to use (WHITE=0x000000, BLACK=0xFFFFFF, RED=0xFF0000, GREEN=0x00FF00, BLUE=0x0000FF...).
 +
*'''vlc.video.marquee.opacity''': (supported in vlc version &gt;= 1.1.0) change the text opacity, val is defined from 0 (completely transparent) to 255 (completely opaque).
 +
*'''vlc.video.marquee.position''': (supported in vlc version &gt;= 1.1.0) change the text position (CENTER=0, LEFT=1, RIGHT=2, TOP=4, TOP-LEFT=5, TOP-RIGHT=6, BOTTOM=8, BOTTOM-LEFT=9, BOTTOM_RIGHT=10).
 +
*'''vlc.video.marquee.refresh''': (supported in vlc version &gt;= 1.1.0) change the marquee refresh period.
 +
*'''vlc.video.marquee.size''': (supported in vlc version &gt;= 1.1.0) val define the new size for the text displayed on the screen. If the text is bigger than the screen then the text is not displayed.
 +
*'''vlc.video.marquee.timeout''': (supported in vlc version &gt;= 1.1.0) change the timeout value. val is defined in ms, but 0 value correspond to unlimited.
 +
*'''vlc.video.marquee.x''': (supported in vlc version &gt;= 1.1.0) change text abscissa.
 +
*'''vlc.video.marquee.y''': (supported in vlc version &gt;= 1.1.0) change text ordinate.
  
read/write properties
+
methods
  
*'''vlc.video.marquee.text''': (supported in vlc version >= 1.1.0) display my text on the screen.
+
*'''vlc.video.marquee.enable()''': (supported in vlc version &gt;= 1.1.0) enable marquee filter.  
*'''vlc.video.marquee.color''': (supported in vlc version >= 1.1.0) change the text color. val is the new color to use (WHITE=0x000000, BLACK=0xFFFFFF, RED=0xFF0000, GREEN=0x00FF00, BLUE=0x0000FF...).
+
*'''vlc.video.marquee.disable()''': (supported in vlc version &gt;= 1.1.0) disable marquee filter.
*'''vlc.video.marquee.opacity''': (supported in vlc version >= 1.1.0) change the text opacity, val is defined from 0 (completely transparent) to 255 (completely opaque).
 
*'''vlc.video.marquee.position''': (supported in vlc version >= 1.1.0) change the text position (CENTER=0, LEFT=1, RIGHT=2, TOP=4, TOP-LEFT=5, TOP-RIGHT=6, BOTTOM=8, BOTTOM-LEFT=9, BOTTOM_RIGHT=10).
 
*'''vlc.video.marquee.refresh''': (supported in vlc version >= 1.1.0) change the marquee refresh period.
 
*'''vlc.video.marquee.size''': (supported in vlc version >= 1.1.0) val define the new size for the text displayed on the screen. If the text is bigger than the screen then the text is not displayed.
 
*'''vlc.video.marquee.timeout''': (supported in vlc version >= 1.1.0) change the timeout value. val is defined in ms, but 0 value correspond to unlimited.
 
*'''vlc.video.marquee.x''': (supported in vlc version >= 1.1.0) change text abscissa.
 
*'''vlc.video.marquee.y''': (supported in vlc version >= 1.1.0) change text ordinate.
 
  
methods
+
Some problems may happen (option like color or text will not be applied) because of the VLC asynchronous functioning. To avoid it, after enabling marquee, you have to wait a little time before changing an option. But it should be fixed by the new vout implementation.  
*'''vlc.video.marquee.enable()''': (supported in vlc version >= 1.1.0) enable marquee filter.
+
 
*'''vlc.video.marquee.disable()''': (supported in vlc version >= 1.1.0) disable marquee filter.
+
NOTE: [http://forum.videolan.org/viewtopic.php?f=16&t=89427#p295058]
 +
 
 +
===== Logo Object =====
 +
 
 +
readonly properties
 +
 
 +
*''none''
 +
 
 +
read/write properties
  
Some problems may happen (option like color or text will not be applied) because of the VLC asynchronous functioning. To avoid it, after enabling marquee, you have to wait a little time before changing an option. But it should be fixed by the new vout implementation.
+
*'''vlc.video.logo.opacity''': (supported in vlc version &gt;= 1.1.0) change the picture opacity, val is defined from 0 (completely transparent) to 255 (completely opaque).
 +
*'''vlc.video.logo.position''': (supported in vlc version &gt;= 1.1.0) change the text position ("center", "left", "right", "top", "top-left", "top-right", "bottom", "bottom-left", "bottom-right").
 +
*'''vlc.video.logo.delay''': (supported in vlc version &gt;= 1.1.0) display each picture for a duration of 1000 ms (default) before displaying the next picture.
 +
*'''vlc.video.logo.repeat''': (supported in vlc version &gt;= 1.1.0) number of loops for picture animation (-1=continuous, 0=disabled, n=n-times). The default is -1 (continuous).
 +
*'''vlc.video.logo.x''': (supported in vlc version &gt;= 1.1.0) change the x-offset for displaying the picture counting from top-left on the screen.
 +
*'''vlc.video.logo.y''': (supported in vlc version &gt;= 1.1.0) change the y-offset for displaying the picture counting from top-left on the screen.
 +
*'''vlc.video.logo.width''': (supported in vlc version &gt;= 1.1.0) change the picture width.
 +
*'''vlc.video.logo.height''': (supported in vlc version &gt;= 1.1.0) change the picture height.
  
NOTE: [http://forum.videolan.org/viewtopic.php?f=16&t=89427#p295058]
+
methods
  
=====Logo Object=====
+
*'''vlc.video.logo.enable()''': (supported in vlc version &gt;= 1.1.0) enable logo video filter.
 +
*'''vlc.video.logo.disable()''': (supported in vlc version &gt;= 1.1.0) disable logo video filter.
 +
*'''vlc.video.logo.file("file.png")''': (supported in vlc version &gt;= 1.1.0) display my file.png as logo on the screen.
  
readonly properties
+
Some problems may happen because of the VLC asynchronous functioning. To avoid it, after enabling logo video filter, you have to wait a little time before changing an option. But it should be fixed by the new vout implementation.
  
* ''none''
+
==== Log object ====
  
read/write properties
+
:'''CAUTION''': For security concern, VLC 1.0.0-rc1 is the latest (near-to-stable) version in which this object and its children are supported.
*'''vlc.video.logo.opacity''': (supported in vlc version >= 1.1.0) change the picture opacity, val is defined from 0 (completely transparent) to 255 (completely opaque).
 
*'''vlc.video.logo.position''': (supported in vlc version >= 1.1.0) change the text position ("center", "left", "right", "top", "top-left", "top-right", "bottom", "bottom-left", "bottom-right").
 
*'''vlc.video.logo.delay''': (supported in vlc version >= 1.1.0) display each picture for a duration of 1000 ms (default) before displaying the next  picture.
 
*'''vlc.video.logo.repeat''': (supported in vlc version >= 1.1.0) number of loops for picture animation (-1=continuous, 0=disabled, n=n-times). The default is -1 (continuous).
 
*'''vlc.video.logo.x''': (supported in vlc version >= 1.1.0) change the x-offset for displaying the picture counting from top-left on the screen.
 
*'''vlc.video.logo.y''': (supported in vlc version >= 1.1.0) change the y-offset for displaying the picture counting from top-left on the screen.
 
*'''vlc.video.logo.width''': (supported in vlc version >= 1.1.0) change the picture width.
 
*'''vlc.video.logo.height''': (supported in vlc version >= 1.1.0) change the picture height.
 
  
methods
+
This object allows accessing VLC main message logging queue. Typically this queue capacity is very small (no nore than 256 entries) and can easily overflow, therefore messages should be read and cleared as often as possible.  
*'''vlc.video.logo.enable()''': (supported in vlc version >= 1.1.0) enable logo video filter.
 
*'''vlc.video.logo.disable()''': (supported in vlc version >= 1.1.0) disable logo video filter.
 
*'''vlc.video.logo.file("file.png")''': (supported in vlc version >= 1.1.0) display my file.png as logo on the screen.
 
  
Some problems may happen because of the VLC asynchronous functioning. To avoid it, after enabling logo video filter, you have to wait a little time before changing an option. But it should be fixed by the new vout implementation.
+
readonly properties
  
====Log object====
+
*'''vlc.log.messages''': returns the message collection, see [[#Messages_object|Messages object]]
: '''CAUTION''': For security concern, VLC 1.0.0-rc1 is the latest (near-to-stable) version in which this object and its children are supported.
 
  
This object allows accessing VLC main message logging queue. Typically this queue capacity is very small (no nore than 256 entries) and can easily overflow, therefore messages should be read and cleared as often as possible.
+
read/write properties
  
readonly properties
+
*'''vlc.log.verbosity''': write number [-1,0,1,2,3] for changing the verbosity level of the log messages; messages whose verbosity is higher than set will be not be logged in the queue. The numbers have the following meaning: -1 disable, 0 info, 1 error, 2 warning, 3 debug.
*'''vlc.log.messages''': returns the message collection, see [[#Messages object|Messages object]]
 
  
read/write properties
+
methods
*'''vlc.log.verbosity''': write number [-1,0,1,2,3] for changing the verbosity level of the log messages; messages whose verbosity is higher than set will be not be logged in the queue. The numbers have the following meaning: -1 disable, 0 info, 1 error, 2 warning, 3 debug.
 
  
methods
 
 
*''none''
 
*''none''
  
====Messages object====
+
==== Messages object ====
: '''CAUTION''': For security concern, VLC 1.0.0-rc1 is the latest (near-to-stable) version in which this object and its children are supported.
+
 
 +
:'''CAUTION''': For security concern, VLC 1.0.0-rc1 is the latest (near-to-stable) version in which this object and its children are supported.
 +
 
 +
readonly properties
  
readonly properties
 
 
*'''messages.count''': returns number of messages in the log
 
*'''messages.count''': returns number of messages in the log
  
read/write properties
+
read/write properties  
 +
 
 
*''none''
 
*''none''
  
methods
+
methods  
*'''messages.clear()''': clear the current log buffer. It should be called as frequently as possible to not overflow the message queue. Call this method after the log messages of interest are read.
+
 
 +
*'''messages.clear()''': clear the current log buffer. It should be called as frequently as possible to not overflow the message queue. Call this method after the log messages of interest are read.  
 
*'''messages.iterator()''': creates and returns an iterator object, used to iterate over the messages in the log. '''Don't clear the log buffer while holding an iterator object.'''
 
*'''messages.iterator()''': creates and returns an iterator object, used to iterate over the messages in the log. '''Don't clear the log buffer while holding an iterator object.'''
  
====Messages Iterator object====
+
==== Messages Iterator object ====
: '''CAUTION''': For security concern, VLC 1.0.0-rc1 is the latest (near-to-stable) version in which this object and its children are supported.
+
 
 +
:'''CAUTION''': For security concern, VLC 1.0.0-rc1 is the latest (near-to-stable) version in which this object and its children are supported.
 +
 
 +
readonly properties
  
readonly properties
 
 
*'''iterator.hasNext''': returns a boolean that indicates whether ''vlc.log.messages.next()'' will return the next message.
 
*'''iterator.hasNext''': returns a boolean that indicates whether ''vlc.log.messages.next()'' will return the next message.
  
read/write properties
+
read/write properties  
 +
 
 
*''none''
 
*''none''
  
methods
+
methods  
 +
 
 
*'''iterator.next()''': returns the next message object in the log, see [[Message object]]
 
*'''iterator.next()''': returns the next message object in the log, see [[Message object]]
  
====Message object====
+
==== Message object ====
: '''CAUTION''': For security concern, VLC 1.0.0-rc1 is the latest (near-to-stable) version in which this object and its children are supported.
 
  
*'''message.severity''': number that indicates the severity of the log message (0 = info, 1 = error, 2 = warning, 3 = debug)
+
:'''CAUTION''': For security concern, VLC 1.0.0-rc1 is the latest (near-to-stable) version in which this object and its children are supported.
*'''message.name''': name of VLC module that printed the log message (e.g: main, http, directx, etc...)
+
 
*'''message.type''': type of VLC module that printed the log message (eg: input, access, vout, sout, etc...)
+
*'''message.severity''': number that indicates the severity of the log message (0 = info, 1 = error, 2 = warning, 3 = debug)  
 +
*'''message.name''': name of VLC module that printed the log message (e.g: main, http, directx, etc...)  
 +
*'''message.type''': type of VLC module that printed the log message (eg: input, access, vout, sout, etc...)  
 
*'''message.message''': the message text
 
*'''message.message''': the message text
  
==Build HTML pages that use the plugin (VLC version up to 0.8.5)==
+
== Build HTML pages that use the plugin (VLC version up to 0.8.5) ==
  
'''WARNING:''' the APIs described in this section are '''deprecated''', do not use. They no longer work on recent VLC version (> 0.8.5), either it being the ActiveX (Internet Explorer)/ Safari or Mozilla based browsers.
+
'''WARNING:''' the APIs described in this section are '''deprecated''', do not use. They no longer work on recent VLC version (&gt; 0.8.5), either it being the ActiveX (Internet Explorer)/ Safari or Mozilla based browsers.  
  
The following API description is only valid uptill version 0.8.5 of the mozilla plugin.
+
The following API description is only valid uptill version 0.8.5 of the mozilla plugin.  
  
Additionally to viewing video on all pages, you can build custom pages that will use the advanced features of the plugin, using Javascript functions to control playback or extract information from the
+
Additionally to viewing video on all pages, you can build custom pages that will use the advanced features of the plugin, using Javascript functions to control playback or extract information from the plugin.  
plugin.
 
  
The vlc plugin supports the following function calls:
+
The vlc plugin supports the following function calls:  
*'''play()''': Start playing media in the plugin.
+
 
*'''pause()''': Pause playback.
+
*'''play()''': Start playing media in the plugin.  
*'''stop()''': Stop media playback.
+
*'''pause()''': Pause playback.  
*'''fullscreen()''': Switch the video to full screen.
+
*'''stop()''': Stop media playback.  
*'''set_volume(vol)''': Set the volume. '''vol''' has to be an int in the 0-200 range.
+
*'''fullscreen()''': Switch the video to full screen.  
*'''get_volume()''': Get the current volume setting.
+
*'''set_volume(vol)''': Set the volume. '''vol''' has to be an int in the 0-200 range.  
*'''mute()''': Toggle volume muting.
+
*'''get_volume()''': Get the current volume setting.  
*'''set_int_variable(var_name, value)''':
+
*'''mute()''': Toggle volume muting.  
*'''set_bool_variable(var_name, value)''':
+
*'''set_int_variable(var_name, value)''':  
*'''set_str_variable(var_name, value)''':
+
*'''set_bool_variable(var_name, value)''':  
*'''get_int_variable(var_name)''':
+
*'''set_str_variable(var_name, value)''':  
*'''get_bool_variable(var_name)''':
+
*'''get_int_variable(var_name)''':  
*'''get_str_variable(var_name)''':
+
*'''get_bool_variable(var_name)''':  
*'''clear_playlist()''': Clear the playlist.
+
*'''get_str_variable(var_name)''':  
*'''add_item(mrl)''': Append an item whose location is given by the [[media resource locator]] to the playlist.
+
*'''clear_playlist()''': Clear the playlist.  
*'''next()'''
+
*'''add_item(mrl)''': Append an item whose location is given by the [[Media resource locator]] to the playlist.  
*'''previous()'''
+
*'''next()'''  
*'''isplaying()''': return true if the plugin is playing something.
+
*'''previous()'''  
*'''get_length()''': Get the media's length in seconds.
+
*'''isplaying()''': return true if the plugin is playing something.  
*'''get_position()''': Get the current position in the media in percent.
+
*'''get_length()''': Get the media's length in seconds.  
*'''get_time()''': Get the current position in the media in seconds.
+
*'''get_position()''': Get the current position in the media in percent.  
 +
*'''get_time()''': Get the current position in the media in seconds.  
 
*'''seek(seconds,is_relative)''': If is_relative is true, seek relatively to current time, else seek from beginning of the stream. Seek time is specified in seconds.
 
*'''seek(seconds,is_relative)''': If is_relative is true, seek relatively to current time, else seek from beginning of the stream. Seek time is specified in seconds.
  
 +
<br> Here are a few examples of HTML pages that use the Mozilla plugin.
  
Here are a few examples of HTML pages that use the
+
=== Example 1 ===
Mozilla plugin.
 
  
===Example 1===
+
In this example, the plugin will read an HTTP stream inside the web page. If the user goes fullscreen, he will have to press ''f'' or double-click on the video to go back in normal view.  
 
 
In this example, the plugin will read an HTTP stream inside the web page. If the user goes fullscreen, he will have to press ''f'' or double-click on the video to go back in normal view.
 
  
 
  &lt;html&gt;
 
  &lt;html&gt;
Line 444: Line 482:
  
 
  &lt;embed type="application/x-vlc-plugin"
 
  &lt;embed type="application/x-vlc-plugin"
          name="video1"
+
        name="video1"
          autoplay="no" loop="yes" width="400" height="300"
+
        autoplay="no" loop="yes" width="400" height="300"
          target="http://server.example.org/video1.vob" /&gt;
+
        target="http://server.example.org/video1.vob" /&gt;
 
  &lt;br /&gt;
 
  &lt;br /&gt;
  &lt;a href="javascript:;" onclick='document.video1.play()'&gt;Play video1&lt;/a&gt;
+
  &lt;a href="javascript:;" onclick='document.video1.play()'&gt;Play video1&lt;/a&gt;
  &lt;a href="javascript:;" onclick='document.video1.pause()'&gt;Pause video1&lt;/a&gt;
+
  &lt;a href="javascript:;" onclick='document.video1.pause()'&gt;Pause video1&lt;/a&gt;
  &lt;a href="javascript:;" onclick='document.video1.stop()'&gt;Stop video1&lt;/a&gt;
+
  &lt;a href="javascript:;" onclick='document.video1.stop()'&gt;Stop video1&lt;/a&gt;
  &lt;a href="javascript:;" onclick='document.video1.fullscreen()'&gt;Fullscreen&lt;/a&gt;
+
  &lt;a href="javascript:;" onclick='document.video1.fullscreen()'&gt;Fullscreen&lt;/a&gt;
  
 
  &lt;/body&gt;
 
  &lt;/body&gt;
 
  &lt;/html&gt;
 
  &lt;/html&gt;
  
===Example 2===
+
=== Example 2 ===
  
In this example, the plugin will read a multicast UDP/RTP stream in a dedicated video output window.
+
In this example, the plugin will read a multicast UDP/RTP stream in a dedicated video output window.  
  
 
  &lt;html&gt;
 
  &lt;html&gt;
Line 468: Line 506:
  
 
  &lt;embed type="application/x-vlc-plugin"
 
  &lt;embed type="application/x-vlc-plugin"
          name="video2"
+
        name="video2"
          autoplay="no" loop="no" hidden="yes"
+
        autoplay="no" loop="no" hidden="yes"
          target="rtp://@239.255.12.42:5004" /&gt;
+
        target="rtp://@239.255.12.42:5004" /&gt;
 
  &lt;br /&gt;
 
  &lt;br /&gt;
  &lt;a href="javascript:;" onclick='document.video2.play()'&gt;Play video2&lt;/a&gt;
+
  &lt;a href="javascript:;" onclick='document.video2.play()'&gt;Play video2&lt;/a&gt;
  &lt;a href="javascript:;" onclick='document.video2.stop()'&gt;Stop video2&lt;/a&gt;
+
  &lt;a href="javascript:;" onclick='document.video2.stop()'&gt;Stop video2&lt;/a&gt;
  &lt;a href="javascript:;" onclick='document.video2.fullscreen()'&gt;Fullscreen&lt;/a&gt;
+
  &lt;a href="javascript:;" onclick='document.video2.fullscreen()'&gt;Fullscreen&lt;/a&gt;
  
 
  &lt;/body&gt;
 
  &lt;/body&gt;
 
  &lt;/html&gt;
 
  &lt;/html&gt;
  
{{Documentation}}
+
{{Documentation}}  
 +
 
 
[[Category:Embedded]]
 
[[Category:Embedded]]

Revision as of 10:51, 9 December 2011

VLC User Guide

Quick Start Guide
Installing VLC
History
Usage
Interface
Open Media
Audio
Video
Playback
Playlist
Subtitles
Video and Audio Filters
Snapshots
Hotkeys
Uninstalling VLC
Troubleshooting
Advanced usage
Using VLC inside a webpage
Command line
Alternative Interfaces
Misc

Appendix
Building Pages for the HTTP Interface
Format String
Building Lua Playlist Scripts
View this alone

Building HTML pages for Mozilla Firefox Firefox-logo.png/Internet ExplorerInternet Explorer.png /Safari Apple Safari.png

The following description works for any of the browsers VLC supports. The JavaScript API has been unified between Mozilla/Firefox/IE (ActiveX) and Safari, thus targeting at all of the major OS out there.

This is only valid for VLC media player version 0.8.6 and above.

Additionally to viewing video on all pages, you can build custom pages that will use the advanced features of the plugin, using Javascript functions to control playback or extract information from the plugin.


Warning to developers who wish to embed VLC: As of v1.1.5 (plugin v2), the use of CSS3 transitions or transforms with embedded VLC object will cause VLC to crash. Also, VLC does not respond to z-index, it will always force itself on top. This was tested on FF4b9 and Chrome8.0.552.237. Neither of these problems exist with HTML5 <video> (fully tested) or flash (partially tested).

API description

The vlc plugin exports several objects that can be accessed for setting and getting information. When used improperly the API's will throw an exception that includes a string that explains what happened. For example when asking for vlc.input.length when there is no playlist item playing.

The vlc plugin knows the following objects:

  • audio: Access audio properties.
  • input: Access input properties.
  • playlist: Access playlist properties.
  • subtitle: Access subtitle properties.
  • video: Access video properties.
    • video.marquee: Access marquee video filter properties.
    • video.logo: Access logo video filter properties.
  • log: Access log properties (only available in vlc version <= 1.0.0-rc1).
  • messages: Access to log message properties (only available in vlc version <= 1.0.0-rc1).
  • iterator: Access to log iterator properties (only available in vlc version <= 1.0.0-rc1).

The following JavaScript code shows howto get a reference to the vlc plugin. This reference can then be used to access the objects of the vlc plugin.

<html>
<title>VLC Mozilla plugin test page</title>
<body>
<embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" version="VideoLAN.VLCPlugin.2"
   width="640"
   height="480"
   id="vlc">
</embed>
<script language="Javascript">
<!--
var vlc = document.getElementById("vlc");
vlc.audio.toggleMute();
//!-->
</script>
</body>
</html>

Root object

readonly properties

  • VersionInfo: returns version information string

read/write properties

  • none

methods

  • vlc.versionInfo(): returns version information string (same as VersionInfo)
  • vlc.addEventListener(eventname, callback, bubble): (only for Mozilla) add a listener for mentioned event name, callback expects a function and bubble influences the order of eventhandling by JS (usually it is set to false).
  • vlc.removeEventListener(eventname, callback, bubble): (only for Mozilla) remove listener for mentioned event name, callback expects a function and bubble influences the order of eventhandling by JS (usually it is set to false).
  • vlc.attachEvent(eventname, callback): (only for ActiveX) add listener for mentioned event name, callback expects a function
  • vlc.removeEvent(eventname, callback): (only for ActiveX) remove listener for mentioned event name, callback expects a function

events

  • MediaPlayerNothingSpecial: vlc is in idle state doing nothing but waiting for a command to be issued
  • MediaPlayerOpening: vlc is opening an media resource locator (MRL)
  • MediaPlayerBuffering: vlc is buffering
  • MediaPlayerPlaying: vlc is playing a media
  • MediaPlayerPaused: vlc is in paused state
  • MediaPlayerForward: vlc is fastforwarding through the media (works only when an input supports forward playback)
  • MediaPlayerBackward: vlc is going backwards through the media (works only when an input supports backwards playback)
  • MediaPlayerEncounteredError: vlc has encountered an error and is unable to continue
  • MediaPlayerEndReached: vlc has reached the end of current playlist
  • MediaPlayerTimeChanged: time has changed
  • MediaPlayerPositionChanged: media position has changed
  • MediaPlayerSeekableChanged: media seekable flag has changed (true means media is seekable, false means it is not)
  • MediaPlayerPausableChanged: media pausable flag has changed (true means media is pauseable, false means it is not)

The following code snippit provides easy functions to register and unregister event callbacks on all supported platforms (currently only Linux mozilla based browsers and windows activeX objects for Internet Explorer).

<SCRIPT language="javascript">
<!--
function registerVLCEvent(event, handler)
{
  var vlc = getVLC("vlc");
  if (vlc) {
      if (vlc.attachEvent) {
          // Microsoft
          vlc.attachEvent (event, handler);
      } else if (vlc.addEventListener) {
          // Mozilla: DOM level 2
          vlc.addEventListener (event, handler, false);
      } else {
          // DOM level 0
          vlc["on" + event] = handler;
      }
  }
}
// stop listening to event
function unregisterVLCEvent(event, handler)
{
  var vlc = getVLC("vlc");
  if (vlc) {
      if (vlc.detachEvent) {
          // Microsoft
          vlc.detachEvent (event, handler);
      } else if (vlc.removeEventListener) {
          // Mozilla: DOM level 2
          vlc.removeEventListener (event, handler, false);
      } else {
          // DOM level 0
          vlc["on" + event] = null;
      }
  }
}
// event callback function for testing
function handleEvents(event)
{
  if (!event)
      event = window.event; // IE
  if (event.target) {
      // Netscape based browser
      targ = event.target;
  } else if (event.srcElement) {
      // ActiveX
      targ = event.srcElement;
  } else {
      // No event object, just the value
      alert("Event value" + event );
      return;
  }
  if (targ.nodeType == 3) // defeat Safari bug
      targ = targ.parentNode;
  alert("Event " + event.type + " has fired from " + targ );
}
// handle mouse grab event from video filter
function handleMouseGrab(event,X,Y)
{
  if (!event)
      event = window.event; // IE
  alert("new position (" + X + "," + Y + ")");
}
// Register a bunch of callbacks.
registerVLCEvent('MediaPlayerNothingSpecial', handleEvents);
registerVLCEvent('MediaPlayerOpening', handleEvents);
registerVLCEvent('MediaPlayerBuffering', handleEvents);
registerVLCEvent('MediaPlayerPlaying', handleEvents);
registerVLCEvent('MediaPlayerPaused', handleEvents);
registerVLCEvent('MediaPlayerForward', handleEvents);
registerVLCEvent('MediaPlayerBackward', handleEvents);
registerVLCEvent('MediaPlayerEncounteredError', handleEvents);
registerVLCEvent('MediaPlayerEndReached', handleEvents);
registerVLCEvent('MediaPlayerTimeChanged', handleEvents);
registerVLCEvent('MediaPlayerPositionChanged', handleEvents);
registerVLCEvent('MediaPlayerSeekableChanged', handleEvents);
registerVLCEvent('MediaPlayerPausableChanged', handleEvents);
</script>
-->

Audio object

readonly properties

  • vlc.audio.count: (supported in vlc version >= 1.1.0) returns the number of audio track available.

read/write properties

  • vlc.audio.mute: boolean value to mute and unmute the audio.
  • vlc.audio.volume: a value between [0-200] which indicates a percentage of the volume.
  • vlc.audio.track: (supported in vlc version > 0.8.6) a value between [1-65535] which indicates the audio track to play or that is playing. a value of 0 means the audio is/will be disabled.
  • vlc.audio.channel: (supported in vlc version > 0.8.6) integer value between [1-5] that indicates which audio channel mode is used, values can be: "1=stereo", "2=reverse stereo", "3=left", "4=right", "5=dolby". Use vlc.audio.channel to check if setting of the audio channel mode has succeeded.
Audio Channel:
<SELECT readonly onChange='doAudioChannel(this.value)'>
  <OPTION value=1>Stereo</OPTION>
  <OPTION value=2>Reverse stereo</OPTION>
  <OPTION value=3>Left</OPTION>
  <OPTION value=4>Right</OPTION>
  <OPTION value=5>Dolby</OPTION>
</SELECT>
<SCRIPT language="javascript">
<!--
function doAudioChannel(value)
{
  var vlc = getVLC("vlc");
  vlc.audio.channel = parseInt(value);
  alert(vlc.audio.channel);
};
-->

methods

  • vlc.audio.toggleMute(): boolean toggle that mutes and unmutes the audio based upon the previous state.
  • vlc.audio.description(int i): (supported in vlc version >= 1.1.0) give the i-th audio track name. 0 corresponds to disable and 1 to the first audio track.

Input object

readonly properties

  • vlc.input.length: length of the input file in number of milliseconds. 0 is returned for 'live' streams or clips whose length cannot be determined by VLC. It returns -1 if no input is playing.
  • vlc.input.fps: frames per second returned as a float (typically 60.0, 50.0, 23.976, etc...)
  • vlc.input.hasVout: a boolean that returns true when the video is being displayed, it returns false when video is not displayed

read/write properties

  • vlc.input.position: normalized position in multimedia stream item given as a float value between [0.0 - 1.0]
  • vlc.input.time: the absolute position in time given in milliseconds, this property can be used to seek through the stream
<!-- absolute seek in stream !-->
vlc.input.time = <absolute seek>
<!-- relative seek in stream !-->
vlc.input.time = vlc.input.time + <relative seek>
  • vlc.input.state: current state of the input chain given as enumeration (IDLE=0, OPENING=1, BUFFERING=2, PLAYING=3, PAUSED=4, STOPPING=5, ENDED=6, ERROR=7). Note: Test for ENDED=6 to catch end of playback. Checking for STOPPING=5 is NOT ENOUGH.
  • vlc.input.rate: input speed given as float (1.0 for normal speed, 0.5 for half speed, 2.0 for twice as fast, etc.).
rate > 1              : is fastforward
rate > 0 and rate < 1 : is slow motion
rate < 0              : is rewind

methods

  • none

Playlist object

readonly properties

  • vlc.playlist.itemCount: number that returns the amount of items currently in the playlist (deprecated, do not use, see Playlist items)
  • vlc.playlist.isPlaying: a boolean that returns true if the current playlist item is playing and false when it is not playing
  • vlc.playlist.items: return the playlist items collection, see Playlist items

read/write properties

  • none

methods

  • vlc.playlist.add(mrl): add a playlist item as MRL. The MRL must be given as a string. Returns a number as an item identifier in playlist (this is not a position in playlist).
  • vlc.playlist.add(mrl,name,options): add a playlist item as MRL, with metaname 'name' and options 'options'. options are text arguments which can be provided either as a single string containing space separated values, akin to VLC command line, or as an array of string values. Returns a number as an item identifier in playlist (this is not a position in playlist).
 var options = new Array(":aspect-ratio=4:3", "--rtsp-tcp");
var id = vlc.playlist.add("rtsp://servername/item/to/play", "fancy name", options);
vlc.playlist.playItem(id);
  • vlc.playlist.play(): start playing the current playlist item
  • vlc.playlist.playItem(number): start playing the item whose identifier is number
  • vlc.playlist.togglePause(): toggle the pause state for the current playlist item
  • vlc.playlist.stop(): stop playing the current playlist item
  • vlc.playlist.next(): iterate to the next playlist item
  • vlc.playlist.prev(): iterate to the previous playlist item
  • vlc.playlist.clear(): empty the current playlist, all items will be deleted from the playlist (deprecated, do not use, see Playlist items)
  • vlc.playlist.removeItem(number): remove the item from playlist whose identifier is number (deprecated, do not use, see Playlist items)

Playlist items object

readonly properties

  • vlc.playlist.items.count: number of items currently in the playlist

read/write properties

  • none

methods

  • vlc.playlist.items.clear(): empty the current playlist, all items will be deleted from the playlist. If a movie is playing, it stop. Note that when this method returns, playlist may not have been entirely been cleared as this operation is performed asynchronously; use the count property to verify/wait until the playlist is empty.
  • vlc.playlist.items.remove(number): remove the item whose identifier is number from playlist. (note: this number isn't the position in the playlist, but the number given by vlc.playlist.add() )

Subtitle object

readonly properties

  • vlc.subtitle.count: (supported in vlc version >= 1.1.0) returns the number of subtitle available.

read/write properties

  • vlc.subtitle.track: (supported in vlc version >= 1.1.0) get and set the subtitle track to show on the video screen. The property takes an integer as input value [1..65535]. If subtitle track is set to 0, the subtitles will be disabled. If set to a value outside the current subtitle tracks range, then it will return -1 and display an error message.

methods

  • vlc.subtitle.description(int i): (supported in vlc version >= 1.1.0) give the i-th subtitle name. 0 correspond to disable and 1 to the first subtitle.

Video object

readonly properties

  • vlc.video.width: returns the horizontal size of the video
  • vlc.video.height: returns the vertical size of the video

read/write properties

  • vlc.video.fullscreen: when set to true the video will be displayed in fullscreen mode, when set to false the video will be shown inside the video output size. The property takes a boolean as input.
  • vlc.video.aspectRatio: get and set the aspect ratio to use in the video screen. The property takes a string as input value. Typical values are: "1:1", "4:3", "16:9", "16:10", "221:100" and "5:4"
  • vlc.video.subtitle: (supported in vlc version > 0.8.6a) get and set the subtitle track to show on the video screen. The property takes an integer as input value [1..65535]. If subtitle track is set to 0, the subtitles will be disabled. If set to a value outside the current subtitle tracks range, then it will return -1 and display an error message.
  • vlc.video.teletext: (supported in vlc version >= 0.9.0) get and set teletext page to show on the video stream. This will only work if a teletext elementary stream is available in the video stream. The property takes an integer as input value [0..999] for indicating the teletext page to view, setting the value to 0 means hide teletext. On error it will return -1 and display an error message.

methods

  • vlc.video.toggleFullscreen(): toggle the fullscreen mode based on the previous setting
  • vlc.video.toggleTeletext(): (supported in vlc version >= 0.9.0) toggle the teletext page to overlay transparent or not, based on the previous setting
Deinterlace Object

readonly properties

  • none

read/write properties

  • none

methods

  • vlc.video.deinterlace.enable("my_mode"): (supported in vlc version >= 1.1.0) enable deinterlacing with my_mode. You can enable it with "blend", "bob", "discard", "linear", "mean", "x", "yadif" or "yadif2x" mode. Enabling too soon deinterlacing may cause some problems. You have to wait that all variable are available before enabling it.
  • vlc.video.deinterlace.disable(): (supported in vlc version >= 1.1.0) disable deinterlacing.
Marquee Object

readonly properties

  • none

read/write properties

  • vlc.video.marquee.text: (supported in vlc version >= 1.1.0) display my text on the screen.
  • vlc.video.marquee.color: (supported in vlc version >= 1.1.0) change the text color. val is the new color to use (WHITE=0x000000, BLACK=0xFFFFFF, RED=0xFF0000, GREEN=0x00FF00, BLUE=0x0000FF...).
  • vlc.video.marquee.opacity: (supported in vlc version >= 1.1.0) change the text opacity, val is defined from 0 (completely transparent) to 255 (completely opaque).
  • vlc.video.marquee.position: (supported in vlc version >= 1.1.0) change the text position (CENTER=0, LEFT=1, RIGHT=2, TOP=4, TOP-LEFT=5, TOP-RIGHT=6, BOTTOM=8, BOTTOM-LEFT=9, BOTTOM_RIGHT=10).
  • vlc.video.marquee.refresh: (supported in vlc version >= 1.1.0) change the marquee refresh period.
  • vlc.video.marquee.size: (supported in vlc version >= 1.1.0) val define the new size for the text displayed on the screen. If the text is bigger than the screen then the text is not displayed.
  • vlc.video.marquee.timeout: (supported in vlc version >= 1.1.0) change the timeout value. val is defined in ms, but 0 value correspond to unlimited.
  • vlc.video.marquee.x: (supported in vlc version >= 1.1.0) change text abscissa.
  • vlc.video.marquee.y: (supported in vlc version >= 1.1.0) change text ordinate.

methods

  • vlc.video.marquee.enable(): (supported in vlc version >= 1.1.0) enable marquee filter.
  • vlc.video.marquee.disable(): (supported in vlc version >= 1.1.0) disable marquee filter.

Some problems may happen (option like color or text will not be applied) because of the VLC asynchronous functioning. To avoid it, after enabling marquee, you have to wait a little time before changing an option. But it should be fixed by the new vout implementation.

NOTE: [1]

Logo Object

readonly properties

  • none

read/write properties

  • vlc.video.logo.opacity: (supported in vlc version >= 1.1.0) change the picture opacity, val is defined from 0 (completely transparent) to 255 (completely opaque).
  • vlc.video.logo.position: (supported in vlc version >= 1.1.0) change the text position ("center", "left", "right", "top", "top-left", "top-right", "bottom", "bottom-left", "bottom-right").
  • vlc.video.logo.delay: (supported in vlc version >= 1.1.0) display each picture for a duration of 1000 ms (default) before displaying the next picture.
  • vlc.video.logo.repeat: (supported in vlc version >= 1.1.0) number of loops for picture animation (-1=continuous, 0=disabled, n=n-times). The default is -1 (continuous).
  • vlc.video.logo.x: (supported in vlc version >= 1.1.0) change the x-offset for displaying the picture counting from top-left on the screen.
  • vlc.video.logo.y: (supported in vlc version >= 1.1.0) change the y-offset for displaying the picture counting from top-left on the screen.
  • vlc.video.logo.width: (supported in vlc version >= 1.1.0) change the picture width.
  • vlc.video.logo.height: (supported in vlc version >= 1.1.0) change the picture height.

methods

  • vlc.video.logo.enable(): (supported in vlc version >= 1.1.0) enable logo video filter.
  • vlc.video.logo.disable(): (supported in vlc version >= 1.1.0) disable logo video filter.
  • vlc.video.logo.file("file.png"): (supported in vlc version >= 1.1.0) display my file.png as logo on the screen.

Some problems may happen because of the VLC asynchronous functioning. To avoid it, after enabling logo video filter, you have to wait a little time before changing an option. But it should be fixed by the new vout implementation.

Log object

CAUTION: For security concern, VLC 1.0.0-rc1 is the latest (near-to-stable) version in which this object and its children are supported.

This object allows accessing VLC main message logging queue. Typically this queue capacity is very small (no nore than 256 entries) and can easily overflow, therefore messages should be read and cleared as often as possible.

readonly properties

read/write properties

  • vlc.log.verbosity: write number [-1,0,1,2,3] for changing the verbosity level of the log messages; messages whose verbosity is higher than set will be not be logged in the queue. The numbers have the following meaning: -1 disable, 0 info, 1 error, 2 warning, 3 debug.

methods

  • none

Messages object

CAUTION: For security concern, VLC 1.0.0-rc1 is the latest (near-to-stable) version in which this object and its children are supported.

readonly properties

  • messages.count: returns number of messages in the log

read/write properties

  • none

methods

  • messages.clear(): clear the current log buffer. It should be called as frequently as possible to not overflow the message queue. Call this method after the log messages of interest are read.
  • messages.iterator(): creates and returns an iterator object, used to iterate over the messages in the log. Don't clear the log buffer while holding an iterator object.

Messages Iterator object

CAUTION: For security concern, VLC 1.0.0-rc1 is the latest (near-to-stable) version in which this object and its children are supported.

readonly properties

  • iterator.hasNext: returns a boolean that indicates whether vlc.log.messages.next() will return the next message.

read/write properties

  • none

methods

  • iterator.next(): returns the next message object in the log, see Message object

Message object

CAUTION: For security concern, VLC 1.0.0-rc1 is the latest (near-to-stable) version in which this object and its children are supported.
  • message.severity: number that indicates the severity of the log message (0 = info, 1 = error, 2 = warning, 3 = debug)
  • message.name: name of VLC module that printed the log message (e.g: main, http, directx, etc...)
  • message.type: type of VLC module that printed the log message (eg: input, access, vout, sout, etc...)
  • message.message: the message text

Build HTML pages that use the plugin (VLC version up to 0.8.5)

WARNING: the APIs described in this section are deprecated, do not use. They no longer work on recent VLC version (> 0.8.5), either it being the ActiveX (Internet Explorer)/ Safari or Mozilla based browsers.

The following API description is only valid uptill version 0.8.5 of the mozilla plugin.

Additionally to viewing video on all pages, you can build custom pages that will use the advanced features of the plugin, using Javascript functions to control playback or extract information from the plugin.

The vlc plugin supports the following function calls:

  • play(): Start playing media in the plugin.
  • pause(): Pause playback.
  • stop(): Stop media playback.
  • fullscreen(): Switch the video to full screen.
  • set_volume(vol): Set the volume. vol has to be an int in the 0-200 range.
  • get_volume(): Get the current volume setting.
  • mute(): Toggle volume muting.
  • set_int_variable(var_name, value):
  • set_bool_variable(var_name, value):
  • set_str_variable(var_name, value):
  • get_int_variable(var_name):
  • get_bool_variable(var_name):
  • get_str_variable(var_name):
  • clear_playlist(): Clear the playlist.
  • add_item(mrl): Append an item whose location is given by the Media resource locator to the playlist.
  • next()
  • previous()
  • isplaying(): return true if the plugin is playing something.
  • get_length(): Get the media's length in seconds.
  • get_position(): Get the current position in the media in percent.
  • get_time(): Get the current position in the media in seconds.
  • seek(seconds,is_relative): If is_relative is true, seek relatively to current time, else seek from beginning of the stream. Seek time is specified in seconds.


Here are a few examples of HTML pages that use the Mozilla plugin.

Example 1

In this example, the plugin will read an HTTP stream inside the web page. If the user goes fullscreen, he will have to press f or double-click on the video to go back in normal view.

<html>
<head><title>Demo of VLC mozilla plugin</title></head>
<body>
<h1>Demo of VLC mozilla plugin - Example 1</h1>
<embed type="application/x-vlc-plugin"
        name="video1"
        autoplay="no" loop="yes" width="400" height="300"
        target="http://server.example.org/video1.vob" />
<br />
 <a href="javascript:;" onclick='document.video1.play()'>Play video1</a>
 <a href="javascript:;" onclick='document.video1.pause()'>Pause video1</a>
 <a href="javascript:;" onclick='document.video1.stop()'>Stop video1</a>
 <a href="javascript:;" onclick='document.video1.fullscreen()'>Fullscreen</a>
</body>
</html>

Example 2

In this example, the plugin will read a multicast UDP/RTP stream in a dedicated video output window.

<html>
<head><title>Demo of VLC mozilla plugin</title></head>
<body>
<h1>Demo of VLC mozilla plugin - Example 2</h1>
<embed type="application/x-vlc-plugin"
        name="video2"
        autoplay="no" loop="no" hidden="yes"
        target="rtp://@239.255.12.42:5004" />
<br />
 <a href="javascript:;" onclick='document.video2.play()'>Play video2</a>
 <a href="javascript:;" onclick='document.video2.stop()'>Stop video2</a>
 <a href="javascript:;" onclick='document.video2.fullscreen()'>Fullscreen</a>
</body>
</html>
This page is part of official VLC media player Documentation (User GuideStreaming HowToHacker GuideModules)
Please read the Documentation Editing Guidelines before you edit the documentation
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.