Ubuntu下firefox浏览器VLC插件使用


【vlc插件检测】

<%@ page pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"%>
<%@ include file="../../include/taglibs.jsp"%>




视频显示


 





	  

 
 
 


【添加vlc插件】


Demo of VLC mozilla plugin

Demo of Firefox VLC Plugin


Play Pause Stop Fullscreen Volume_Up Volume_Down Mute Seek_forward Seek_backward FastForward BackForward


FROM:http://www.videolan.org/doc/play-howto/en/ch04.html#id591206

The Mozilla plugin

VLC can also be embedded in a web browser ! The following browsers are supported Mozilla, Firefox and Safari.

Install the plugin

GNU/Linux Debian

You should already have the following lines in your /etc/apt/sources.list file, if you run Debian Woody:

     deb http://download.videolan.org/pub/videolan/debian woody main
     deb-src http://download.videolan.org/pub/videolan/debian woody main

VLC's latest packaged version is always in the official Debian unstable branch. However you should still use our apt-get line if you need libdvdcss in its latest version:

     deb http://download.videolan.org/pub/videolan/debian sid main
     deb-src http://download.videolan.org/pub/videolan/debian sid main

Install the mozilla-plugin-vlc package:

# apt-get update
# apt-get install mozilla-plugin-vlc

Windows

Quit Firefox or Mozilla

Copy the two files in VLC_Installation_folder\mozilla (usually C:\Program Files\VideoLAN\VLC\mozilla) to your mozilla plugins directory (Usually C:\Program Files\Mozilla\plugins or C:\Program Files\Mozilla Firefox\plugins).

Restart Firefox or Mozilla

MacOS X

The Mozilla/Safari plugin for MacOS X is only available from vlc version 0.8.5.1 and onwards.

Quit Safari browser

Download the Mozilla/safari plugin package from MacOS X download page.

Run the installer from the dmg image.

Compile the sources yourself

Please look at the developers page for information on how to do this.

Use the plugin

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



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



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.


VLC Mozilla plugin test page






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: