•
If you open a link to a video file handled by the VLC plugin (To get the list of handled types, browse to about:plugins) or a page with an embedded video, the plugin should open and read the video.
Build HTML pages that use the plugin (version <= 0.8.5)
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 to go back in normal view.
Demo of VLC mozilla plugin - Example 1
Play video1 Pause video1 Stop video1 Fullscreen
Example 2
In this example, the plugin will read a multicast RTP/UDP stream in a dedicated video output window.
Demo of VLC mozilla plugin - Example 2
Play video2 Stop video2 Fullscreen
Build HTML pages that use the plugin (version > 0.8.5.1)
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 exports serveral 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.
•video : Access video properties.
•log : Access log properties.
•messages : Access to log message properties.
•iterator : Access to log iterator properties.
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.
Root object
readonly properties
•VersionInfo : returns version information string
read/write properties
•none
methods
•vlc.versionInfo() : returns version information string
Audio object
readonly properties
•none
read/write properties
•vlc.audio.mute : boolean value to mute and ummute the audio
•vlc.audio.volume : a value between [0-200] which indicates a percentage of the volume.
•vlc.audio.track : a value between [0-65535] which indicates the audio track to play or that is playing. (supported in vlc version > 0.8.6)
•vlc.audio.channel : an integer between 1 and 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 new audio channel has succeeded. (supported in vlc version > 0.8.6)
Audio Channel: