This article transferred from: http://www.educity.cn/wenda/124878.html
VLC ActiveX control (Videolan.vlcplugin.1 videolan.vlcplugin.2) All method properties and use found on a foreigner's website
Inadvertently found on the foreigner's website about Videolan.vlcplugin.1 and videolan.vlcplugin.2 all methods and attributes ~ ~ ~ To avoid wasting time to find ~ ~ (Note the version of VLC you use)
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) o R 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 in all pages, you can build custom pages that would 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 have to is 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 was 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 Strea M. Seek time is specified in seconds.
Here is a few examples of HTML pages that use the Mozilla plugin.
Example 1
In this example, the plugin would read an HTTP stream inside the Web page. If the user goes fullscreen, he would have a to press F to go back in normal view.
Build HTML pages that with the plugin (Version > 0.8.5.1)
Additionally to viewing video in all Pages, you can build custom pages that would use the advanced features of the plugin, using Javascript functions to Contro L playback or extract information from the plugin.
The VLC plugin exports serveral objects that can is accessed for setting and getting information. When used improperly the API ' s would throw a exception that includes a string then explains what happened. For example when asking for vlc.input.length if 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 is 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's playing. (supported in VLC version > 0.8.6)
Vlc.audio.channel:an integer between 1 and 5 that indicates which audio channel mode are 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: <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); Al ERT (Vlc.audio.channel); }; --' >
Methods
Vlc.audio.toggleMute (): Boolean toggle that mutes and unmutes the audio based upon the previous state
Input Object
ReadOnly Properties
Vlc.input.length:length of the input file in number of milliseconds
Vlc.input.fps:frames per second returned as a float
Vlc.input.hasvout:a Boolean that returns True when the video was being displayed, it returns false when video was not disp layed
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 is 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/close=0, Opening=1, buffering=2, playing=3, Paused=4, stopping=5, error=6)
Vlc.input.rate:input speed given as float (1.0 to normal speed, 0.5 for half speed, 2.0 for twice as fast, etc)
Methods
None
Playlist Object
ReadOnly Properties
Vlemcount:number that returns the amount of items currently in the playlist
Vlc.playlist.isplaying:a Boolean that returns True if the current playlist item was playing and false when it was not play Ing
Read/write Properties
None
Methods
Vlc.playlist.add (MRL): Add a playlist item as MRL (multimedia Resource Locator). The MRL must be given as a string.
Vlc.playlist.add (mrl,name,options): Add a playlist item as MRL (multimedia Resource Locator), with Metaname ' name ' and op tions ' options '. All input values must is given as String.
Vlc.playlist.play (): Start playing the current playlist item
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 would be deleted from the playlist
Vlc.playlist.removeItem (number): Remove the given item number (which cannot is greater then Vlemcount)
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 is displayed in fullscreen mode and when set to false the video would b e shown inside the video output size. The property takes a Boolean as input.
Vlc.video.aspectRatio:get and set the aspect ratio to use of the video screen. The property takes a string as input value. Valid values are: "1:1", "4:3", "16:9", "16:10", "221:100" and "5:4"
Methods
Vlc.video.toggleFullscreen (): Toggle the fullscreen mode based on the previous setting
Log Object
ReadOnly Properties
Vlssages:returns a Messages Object
Read/write Properties
Vlc.log.verbosity:write number [ -1,0,1,2,3] for changing the verbosity level of the log messages. The numbers has the following meaning:-1 disable, 0 info, 1 error, 2 warning, 3 Debug.
Methods
None
Messages Object
ReadOnly Properties
Messages.count:returns number of messages in the log
Messages.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
Read/write Properties
None
Methods
Messages.clear (): Clear the current log buffer. It should is called as frequently as possible to not overflow the plugins logging buffer. Call this method after the log messages of interest is read.
Messages.iterator (): Returns a messages iterator object, which is used-iterate over the messages in the log. Don ' t clear the log buffer while holding an iterator object.
Iterator Object
ReadOnly Properties
Iterator.hasNext:returns A Boolean that indicates is true, that wheter vlssages.next () returns the next message.
Read/write Properties
None
Methods
Iterator.next (): Returns the next Message object it the log
Source Document
VLC Player Web plug-in interface (PART2)