Documentation:WebPlugin

这篇文档讲述的是 VLC media player Web plugins 和怎样在网页使用它

Contents

Introduction: Building Web pages with Video

   VLC media player webplugins 是浏览器原生插件,类似于Flash和Silverlight 插件,并且能够在浏览器中播放所有 VLC media player 能读取的视频。

  除了能在网页上播放视频外,你也可以用插件的高级特性来定制自定义页面,并且通过javascript来控制播放或者获取其他的信息。

  目前主要有两种插件:一个是IE的Activex插件,另外一个是其他浏览器的NAAPI插件,这两个插件具有相同的特性。

  在以前的旧版本中,这些插件很容易崩溃,我们强烈建议你用VLC2.0.0或者更新版本.

浏览器支持

测试了以下浏览器:

Mozilla Firefox(52版本以下,译者注)
Internet Explorer
Safari
Chrome  
Konqueror  
Opera  

测试了下面的平台 GNU/Linux, Windows and MacOS.

Embed标签树形

想把插件嵌入到网页中,用下面的 <embed>模版:

<embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" />

如果你在IE上用小于2.2.0版本的vlc,请用下面的<object>模版:

<object classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" codebase="http://download.videolan.org/pub/videolan/vlc/last/win32/axvlc.cab"></object>

用<param>来给声明标签属性,下面是例子:

<object classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" codebase="http://download.videolan.org/pub/videolan/vlc/last/win32/axvlc.cab">

  <param name="autostart" value="true" />

  <param name="allowfullscreen" value="false" />

</object>

你可以用两个标签来兼容火狐浏览器:

<object classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" codebase="http://download.videolan.org/pub/videolan/vlc/last/win32/axvlc.cab" id="vlc">

  <embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" name="vlc" />

</object>

必备元素

下面是<embed>标签必备属性:

    • width: 指定插件的宽度.
    • height: 指定插件的高度
    • target (获取下面几个别名之一: mrlfilenamesrc): 指定视频要加载的资源url

可选元素

这些是<embed>标签的附加属性:

    • autoplayautostart: 指定插件在加载成功后是否自动播放,默认为true
    • allowfullscreen (or fullscreenEnabledfullscreen): (从VLC 2.2.0 开始) 指定是否用户可以切换到全屏模式,默认为 true
    • windowless: (从VLC 2.0.6开始,只适用于火狐浏览器)在(非加速)无窗体表面绘制,允许样式叠加(css叠加,3D转换等等),默认为 false
    • mute: 指定是否将视频音量初始化为静音,默认为 false
    • volume: (从VLC 2.2.2开始) 用百分比来指定初始化音量,默认为100
    • loopautoloop: 指定视频结束后是否循环,默认为 false
    • controls (or toolbar): 指定显示默认的控件,默认为true
    • bgcolor: 指定视频播放器的背景颜色,默认为: #000000
    • text: (仅仅针对MacOS的火狐)指定没有视频显示时显示的文本,默认为empty
    • branding: (仅仅针对MacOS上的火狐浏览器使用小于2.2.2版本的VLC),指定是否在web插件中绘制VLC logopecifies whether VLC品牌,默认为 true

正常的DOM元素

    • id: DOM id
    • name: DOM name

Javascript API 描述

VLC导出很多可以用于设置和获取属性的对象,当不正确使用API的时候,会抛出一个包含异常信息的字符串。例如当你设置vlc.audio.track出界的时候。

VLC 对象

vlc插件包含下列对象s:

audio: 获取视频属性.

input: 获取输入树形.

    • input.title: 获取标题树形(版本要求:vlc version >= 2.2.2, 仅支持>= 3.0.0)
    • input.chapter: 获取章节属性 (版本要求:vlc version >= 2.2.2, 仅支持 >= 3.0.0)

        playlist: 获取播放列表属性.

    • playlist.items: 获取播放列表项的属性.
    • subtitle: 获取字母属性.

video: 获取视频属性.

    • video.deinterlace: 获取各行处理属性.
    • video.marquee: 获取视频选取过滤属性.
    • video.logo: 访问视频logo过滤器属性.

         mediaDescription: 访问媒体信息属性 (版本要求: vlc version >= 2.0.2).

下面的是弃用的对象:

  • log: 获取log属性(版本要求: vlc version <= 1.0.0-rc1).
  • messages:获取log信息属性 (版本要求: vlc version <= 1.0.0-rc1).
  • iterator: 获取log遍历属性 (版本要求: vlc version <= 1.0.0-rc1).
  • message: 获取log信息属性(版本要求:vlc version <= 1.0.0-rc1).

举例

下面的js代码展示怎样使用vlc插件,然后展示怎样使用vlc插件的对象。

<!DOCTYPE html>

<html>

<title>VLC Mozilla plugin test page</title>

<body>

<embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org"    width="640"  height="480"  id="vlc" />

<script type="text/javascript">

<!--

var vlc = document.getElementById("vlc");

vlc.audio.toggleMute();

//-->

</script>

</body>
</html>

Root 对象

只读属性

  • vlc.VersionInfo: 返回版本信息字符串

可读可写属性

  • none

方法

  • vlc.versionInfo(): (仅用于火狐) 返回版本信息字符串 (类似于VersionInfo属性)
  • vlc.getVersionInfo(): (版本要求vlc version >= 2.2.2) 返回版本信息字符串 (类似于VersionInfo属性和versionInfo()方法)
  • vlc.addEventListener(eventname, callback, bubble): (仅用于火狐) 添加一个事件监听器,包括事件名,回调函数,气泡来JS影响js处理事件的顺序(通常设置为false)
  • vlc.removeEventListener(eventname, callback, bubble): (仅用于火狐) 移除一个事件监听器,包括事件名,回调函数,气泡来JS影响js处理事件的顺序(通常设置为false)
  • vlc.attachEvent(eventname, callback): (仅用于Activex)添加监听器,包括事件名和回调函数
  • vlc.detachEvent(eventname, callback): (仅用于Activex) 移除监听器,包括事件名和回调函数

事件

  • MediaPlayerNothingSpecial: vlc处于空闲状态,等待发出命令
  • MediaPlayerOpening: vlc正打开一个媒体资源
  • MediaPlayerBuffering(int cache): vlc正在缓冲
  • MediaPlayerPlaying: vlc正在播放媒体
  • MediaPlayerPaused: vlc 处于暂停状态
  • MediaPlayerStopped: vlc处于停止状态
  • MediaPlayerForward: vlc的媒体正在快进  (this never gets invoked)
  • MediaPlayerBackward: vlc的媒体正在回退 (this never gets invoked)
  • MediaPlayerEncounteredError: vlc遇到错误,无法继续下去
  • MediaPlayerEndReached: vlc到达播放列表的结尾
  • MediaPlayerTimeChanged(int time): 时间变化
  • MediaPlayerPositionChanged(float position): 媒体位置变化
  • MediaPlayerSeekableChanged(bool seekable): 媒体搜索标记改变 (true 表示媒体可以搜索到, false表示不可搜索到)
  • MediaPlayerPausableChanged(bool pausable): 媒体暂停标记改变 (true 表示媒体是暂停状态, false表示非暂停状态)
  • MediaPlayerMediaChanged: (supported in vlc version >= 2.2.0) 媒体改变
  • MediaPlayerTitleChanged(int title): (in vlc version < 2.2.0 only for Mozilla) 标题改变 (DVD/Blu-ray)
  • MediaPlayerChapterChanged(int chapter): (supported in vlc version >= 3.0.0) 章节改变 (DVD/Blu-ray)
  • MediaPlayerLengthChanged(int length): (in vlc version < 2.2.0 only for Mozilla) 长度改变
  • MediaPlayerVout(int count): (supported in vlc version >= 2.2.7) 输出的视频数量改变
  • MediaPlayerMuted: (supported in vlc version >= 2.2.7) 视频声音静音
  • MediaPlayerUnmuted: (supported in vlc version >= 2.2.7) 视频声音开启声音
  • MediaPlayerAudioVolume(float volume): (supported in vlc version >= 2.2.7) 视频声音变化

例子

下面的简短代码提供了在所有平台上注册和移除事件回调函数的方法。

<script type="text/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);
}
}
} // 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);
}
}
} // event callbacks
function handle_MediaPlayerNothingSpecial(){
alert("Idle");
} function handle_MediaPlayerOpening(){
alert("Opening");
} function handle_MediaPlayerBuffering(val){
alert("Buffering: " + val + "%");
} function handle_MediaPlayerPlaying(){
alert("Playing");
} function handle_MediaPlayerPaused(){
alert("Paused");
} function handle_MediaPlayerStopped(){
alert("Stopped");
} function handle_MediaPlayerForward(){
alert("Forward");
} function handle_MediaPlayerBackward(){
alert("Backward");
} function handle_MediaPlayerEndReached(){
alert("EndReached");
} function handle_MediaPlayerEncounteredError(){
alert("EncounteredError");
} function handle_MediaPlayerTimeChanged(time){
alert("Time changed: " + time + " ms");
} function handle_MediaPlayerPositionChanged(val){
alert("Position changed: " + val);
} function handle_MediaPlayerSeekableChanged(val){
alert("Seekable changed: " + val);
} function handle_MediaPlayerPausableChanged(val){
alert("Pausable changed: " + val);
} function handle_MediaPlayerMediaChanged(){
alert("Media changed");
} function handle_MediaPlayerTitleChanged(val){
alert("Title changed: " + val);
} function handle_MediaPlayerChapterChanged(val){
alert("Chapter changed: " + val);
} function handle_MediaPlayerLengthChanged(val){
alert("Length changed: " + val + " ms");
} function handle_MediaPlayerVout(val){
alert("Number of video output changed: " + val);
} function handle_MediaPlayerMuted(){
alert("Audio volume muted");
} function handle_MediaPlayerUnmuted(){
alert("Audio volume unmuted");
} function handle_MediaPlayerAudioVolume(volume){
alert("Audio volume changed: " + Math.round(volume * 100) + "%");
} // Register a bunch of callbacks.
registerVLCEvent("MediaPlayerNothingSpecial", handle_MediaPlayerNothingSpecial);
registerVLCEvent("MediaPlayerOpening", handle_MediaPlayerOpening);
registerVLCEvent("MediaPlayerBuffering", handle_MediaPlayerBuffering);
registerVLCEvent("MediaPlayerPlaying", handle_MediaPlayerPlaying);
registerVLCEvent("MediaPlayerPaused", handle_MediaPlayerPaused);
registerVLCEvent("MediaPlayerStopped", handle_MediaPlayerStopped);
registerVLCEvent("MediaPlayerForward", handle_MediaPlayerForward);
registerVLCEvent("MediaPlayerBackward", handle_MediaPlayerBackward);
registerVLCEvent("MediaPlayerEndReached", handle_MediaPlayerEndReached);
registerVLCEvent("MediaPlayerEncounteredError", handle_MediaPlayerEncounteredError);
registerVLCEvent("MediaPlayerTimeChanged", handle_MediaPlayerTimeChanged);
registerVLCEvent("MediaPlayerPositionChanged", handle_MediaPlayerPositionChanged);
registerVLCEvent("MediaPlayerSeekableChanged", handle_MediaPlayerSeekableChanged);
registerVLCEvent("MediaPlayerPausableChanged", handle_MediaPlayerPausableChanged);
registerVLCEvent("MediaPlayerMediaChanged", handle_MediaPlayerMediaChanged);
registerVLCEvent("MediaPlayerTitleChanged", handle_MediaPlayerTitleChanged);
registerVLCEvent("MediaPlayerChapterChanged", handle_MediaPlayerChapterChanged);
registerVLCEvent("MediaPlayerLengthChanged", handle_MediaPlayerLengthChanged);
registerVLCEvent("MediaPlayerVout", handle_MediaPlayerVout);
registerVLCEvent("MediaPlayerMuted", handle_MediaPlayerMuted);
registerVLCEvent("MediaPlayerUnmuted", handle_MediaPlayerUnmuted);
registerVLCEvent("MediaPlayerAudioVolume", handle_MediaPlayerAudioVolume); //-->
</script>
  1. Audio 对象

只读属性

  1. vlc.audio.count: (supported in vlc version >= 1.1.0) 返回视频数量.

读写属性

  1. vlc.audio.mute:是否静音的布尔值.
  2. vlc.audio.volume: 音频的百分比,取值为0-200.
  3. vlc.audio.track: (supported in vlc version > 0.8.6)  取值范围为[1-65535] ,表示播放的音轨或正在播放的音轨。值为0意味着音频将被禁用
  4. vlc.audio.channel: (supported in vlc version > 0.8.6) 整形值,范围为[1-5], 指示使用哪种音频通道模式,值可以是:“1 =立体声”,“2 =反向立体声”,“3 =左”,“4 =右”,“5 =杜比”。使用vlc.audio.channel检查音频信道模式设置成功了。

方法

  1. vlc.audio.toggleMute(): 布尔值,根据音频的上一个状态静音和非静音的切换.
  2. vlc.audio.description(int i): (supported in vlc version >= 1.1.0) 给每个音轨的名字。0对应于禁用和1到第一音轨。
  3. Example

  1. Audio Channel:
<select 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 type="text/javascript">
<!--
function doAudioChannel(value)
{
var vlc = getVLC("vlc");
vlc.audio.channel = parseInt(value);
alert(vlc.audio.channel);
}
//-->
</script>
  1. Input 对象

只读属性

  1. vlc.input.length: 输入文件的毫秒数,0表示VLC不能确定长度的直播流或者切片,-1表示没有输入在播放.
  2. vlc.input.fps: 每秒播放的帧数,浮点型 (典型值 60.0, 50.0, 23.976, 等)
  3. vlc.input.hasVout: 视频正在显示时返回ture,否则返回false

读写属性

  1. vlc.input.position: 在0 [ 1 ]之间作为浮点值给出的多媒体流项中的归一化位置
  2. vlc.input.time:以毫秒为单位的时间的绝对位置,此属性可用于通过流查找。
<!-- absolute seek in stream -->
vlc.input.time = <absolute seek>
<!-- relative seek in stream -->
vlc.input.time = vlc.input.time + <relative seek>
  1. vlc.input.state: 输入链的当前状态,取值如下的枚举数:
0 IDLE
1 OPENING
2 BUFFERING
3 PLAYING
4 PAUSED
5 STOPPING
6 ENDED
7 ERROR

Note: Test for ENDED=6 to catch end of playback. Checking for STOPPING=5 is NOT ENOUGH.

  1. vlc.input.rate: 浮点型的输入速度 (1.0 表示正常速度 0.5 表示一半速度, 2.0 两倍速率, etc.).
rate > 1 fast forward
rate = 1 normal speed
rate < 1 slow motion

方法

  1. none
  2. Title 对象

只读属性

  1. vlc.input.title.count: (supported in vlc version >= 2.2.2)返回可以播放的标题数量

读写属性

  1. vlc.input.title.track: (supported in vlc version >= 2.2.2) 获取并设置标题轨道,属性值取值范围为 [0..65535],如果没有标题,则返回-1.

方法

  1. vlc.input.title.description(int i): (supported in vlc version >= 2.2.2) give the i-th title name.
  2. Chapter 对象

只读属性

  1. vlc.input.chapter.count: (supported in vlc version >= 2.2.2) 返回当前章节的标题数量

读写方法

  1. vlc.input.chapter.track: (supported in vlc version >= 2.2.2) get and set the chapter track. The property takes an integer as input value [0..65535]. It returns -1 if no chapters are available.

methods

  1. vlc.input.chapter.description(int i): (supported in vlc version >= 2.2.2) give the i-th chapter name.
  2. vlc.input.chapter.countForTitle(int i): (supported in vlc version >= 2.2.2) returns the number of chapter available for a specific title.
  3. vlc.input.chapter.prev(): (supported in vlc version >= 2.2.2) 播放上一章节
  4. vlc.input.chapter.next(): (supported in vlc version >= 2.2.2) 播放下一章节
  5. Playlist 对象

只读属性

  1. vlc.playlist.itemCount:返回当前播放列表中的播放项的数量 (deprecated, do not use, see Playlist items)
  2. vlc.playlist.isPlaying: 返回一个是否当前播放列表项在播放的布尔值
  3. vlc.playlist.currentItem: (supported in vlc version >= 2.2.0) 播放列表中播放项当前的索引,如果是空或者没有激活,则返回-1.
  4. vlc.playlist.items: 返回播放列表项集合, 见 Playlist items

读写属性

  1. none

方法

  1. vlc.playlist.add(mrl): 给播放列表添加 MRL. MRL格式为字符串格式。返回值为刚刚添加的资源在播放列表中的索引。
  2. vlc.playlist.add(mrl,name,options): 给播放列表添加包含name,options参数的MRL, options可取的文本参数值为:1,包含空格分隔符的字符串,类似于VLC命令行,2,字符串数组。 返回值为刚刚添加的资源在播放列表中的索引
var options = new Array(":aspect-ratio=4:3", "--rtsp-tcp");
// Or: var options = ":aspect-ratio=4:3 --rtsp-tcp";
var id = vlc.playlist.add("rtsp://servername/item/to/play", "fancy name", options);
vlc.playlist.playItem(id);
  1. vlc.playlist.play(): 开始播放当前播放列表中的项目
  2. vlc.playlist.playItem(number): 开始播放指定标识符的项目
  3. vlc.playlist.pause(): 暂停播放当前播放列表中的项目
  4. vlc.playlist.togglePause(): 切换播放列表中播放项目的暂停状态
  5. vlc.playlist.stop(): 停止播放当前播放项目
  6. vlc.playlist.next(): 迭代到下一个播放列表项
  7. vlc.playlist.prev(): 迭代到上一个播放列表项
  8. vlc.playlist.clear(): 清空播放列表,所有的播放列表会被删除 (过时的, 不要使用, see Playlist items)
  9. vlc.playlist.removeItem(number): 移除播放列表中指定索引的播放项目remove the item from playlist whose identifier is number (过时的, 不要使用, see Playlist items)
  10. Playlist items 对象

只读属性

  1. vlc.playlist.items.count: 当前播放列表中的项目数量

读写属性

  1. none

方法

  1. vlc.playlist.items.clear(): 清空播放列表中的项目,(注意: 如果视频正在播放,视频将不会停止播放,也就是说调用这个方法前,先停止播放)
  2. vlc.playlist.items.remove(number): 从播放列表中删除标识符编号的项。 (注意:这个数字是播放列表中当前的位置. 不是调用vlc.playlist.add()的返回值, 播放列表中的任何一项都可以被移除)
  3. Subtitle 对象

只读属性

  1. vlc.subtitle.count: (支持版本 >= 1.1.0) 返回可以获得的字幕数量

读写属性

  1. 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.

方法

  1. 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.
  2. Video 对象

只读属性

  1. vlc.video.width: 返回视频的宽度
  2. vlc.video.height: 返回视频的高度
  3. vlc.video.count: (supported in vlc version >= 2.2.7) returns the number of video track available.

读写属性

  1. vlc.video.fullscreen: 当设置为true的时候,视频全屏,当设置为false的时候,视频非全屏,输入值为布尔值。.
  2. 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"
  3. 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.
  4. vlc.video.crop: get and set the geometry of the zone to crop. This is set as <width> x <height> + <left offset> + <top offset>. A possible value is: "120x120+10+10"
  5. 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..1000] for indicating the teletext page to view, setting the value to 0 means hide teletext.
  6. vlc.video.track: (supported in vlc version >= 2.2.7) a value between [1-65535] which indicates the video track to play or that is playing. a value of 0 means the video is/will be disabled.

方法

  1. vlc.video.takeSnapshot(): (支持版本 >= 0.9.0, only for ActiveX) 生成截图,并保存到桌面
  2. vlc.video.toggleFullscreen(): 根据上一个状态切换全屏状态
  3. vlc.video.toggleTeletext(): (supported in vlc version >= 0.9.0) toggle the teletext page to overlay transparent or not, based on the previous setting
  4. vlc.video.description(int i): (supported in vlc version >= 2.2.7) give the i-th video track name. 0 corresponds to disable and 1 to the first video track.
  5. Deinterlace Object

readonly properties

  1. none

read/write properties

  1. none

methods

  1. 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.
  2. vlc.video.deinterlace.disable(): (supported in vlc version >= 1.1.0) disable deinterlacing.
  3. Marquee Object

readonly properties

  1. none

read/write properties

  1. vlc.video.marquee.text: (supported in vlc version >= 1.1.0) display my text on the screen.
  2. 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...).
  3. 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).
  4. vlc.video.marquee.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").
  5. vlc.video.marquee.refresh: (supported in vlc version >= 1.1.0) change the marquee refresh period.
  6. 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.
  7. 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.
  8. vlc.video.marquee.x: (supported in vlc version >= 1.1.0) change text abscissa.
  9. vlc.video.marquee.y: (supported in vlc version >= 1.1.0) change text ordinate.

methods

  1. vlc.video.marquee.enable(): (supported in vlc version >= 1.1.0) enable marquee filter.
  2. 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]

  1. Logo Object

readonly properties

  1. none

read/write properties

  1. 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).
  2. 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").
  3. 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.
  4. 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).
  5. 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.
  6. 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.

methods

  1. vlc.video.logo.enable(): (supported in vlc version >= 1.1.0) enable logo video filter.
  2. vlc.video.logo.disable(): (supported in vlc version >= 1.1.0) disable logo video filter.
  3. 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.

  1. MediaDescription Object

readonly properties

  1. vlc.mediaDescription.title: (supported in vlc version >= 2.0.2) returns title meta information field.
  2. vlc.mediaDescription.artist: (supported in vlc version >= 2.0.2) returns artist meta information field.
  3. vlc.mediaDescription.genre: (supported in vlc version >= 2.0.2) returns genre meta information field.
  4. vlc.mediaDescription.copyright: (supported in vlc version >= 2.0.2) returns copyright meta information field.
  5. vlc.mediaDescription.album: (supported in vlc version >= 2.0.2) returns album meta information field.
  6. vlc.mediaDescription.trackNumber: (supported in vlc version >= 2.0.2) returns trackNumber meta information field.
  7. vlc.mediaDescription.description: (supported in vlc version >= 2.0.2) returns description meta information field.
  8. vlc.mediaDescription.rating: (supported in vlc version >= 2.0.2) returns rating meta information field.
  9. vlc.mediaDescription.date: (supported in vlc version >= 2.0.2) returns date meta information field.
  10. vlc.mediaDescription.setting: (supported in vlc version >= 2.0.2) returns setting meta information field.
  11. vlc.mediaDescription.URL: (supported in vlc version >= 2.0.2) returns URL meta information field.
  12. vlc.mediaDescription.language: (supported in vlc version >= 2.0.2) returns language meta information field.
  13. vlc.mediaDescription.nowPlaying: (supported in vlc version >= 2.0.2) returns nowPlaying meta information field.
  14. vlc.mediaDescription.publisher: (supported in vlc version >= 2.0.2) returns publisher meta information field.
  15. vlc.mediaDescription.encodedBy: (supported in vlc version >= 2.0.2) returns encodedBy meta information field.
  16. vlc.mediaDescription.artworkURL: (supported in vlc version >= 2.0.2) returns artworkURL meta information field.
  17. vlc.mediaDescription.trackID: (supported in vlc version >= 2.0.2) returns trackID meta information field.

read/write properties

  1. none

methods

  1. none
  2. DEPRECATED APIs

  3. DEPRECATED: 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

  1. vlc.log.messages: returns the message collection, see Messages object

read/write properties

  1. 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

  1. none
  2. DEPRECATED: 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

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

read/write properties

  1. none

methods

  1. 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.
  2. 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.
  3. DEPRECATED: 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

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

read/write properties

  1. none

methods

  1. iterator.next(): returns the next message object in the log, see Message object
  2. DEPRECATED: Message subobject

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.
  1. message.severity: number that indicates the severity of the log message (0 = info, 1 = error, 2 = warning, 3 = debug)
  2. message.name: name of VLC module that printed the log message (e.g: main, http, directx, etc...)
  3. message.type: type of VLC module that printed the log message (eg: input, access, vout, sout, etc...)
  4. message.message: the message text
This page is part of official VLC media player Documentation (User Guide • Streaming HowTo • Hacker's Guide • Modules)

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.
 

VLC WebPlugin中文的更多相关文章

  1. 一劳永逸解决VLC播放中文字幕乱码问题

    VLC对于Mac/Ubuntu用户来说算得上是必备软件.其相当于PC机上的“暴风影音”,但Mac/Ubuntu的新手使用VLC播放avi时都会碰 到字幕乱码的问题.avi字幕的格式有多种,这里假设你使 ...

  2. VLC Web插件的浏览器兼容性

    网页插件实现原理 IE浏览器基于Activex插件来实现,非IE浏览器采用NPAPI来实现,所以,非浏览器需要支持NPAPI来实现. IE浏览器 FF浏览器(版本小于52) 原因从 Firefox 版 ...

  3. vlc for mac设置中文的方法

    VLC for mac是一款mac系统下的多媒体播放器,支持播放MPEG-1.MPEG-2.MPEG-4.DivX.MP3和OGG,以及DVD.VCD.等各种流媒体协议在内的多种协议格式,并且能够对电 ...

  4. you-get中文说明

    来源于:https://github.com/soimort/you-get/wiki/%E4%B8%AD%E6%96%87%E8%AF%B4%E6%98%8E You-Get 乃一小小哒命令行程序, ...

  5. 基于VLC的播放器开发

    VLC的C++封装 因为工作需要,研究了一段时间的播放器开发,如果从头开始做,可以学习下FFmpeg(http://www.ffmpeg.org/),很多播放器都是基于FFmpeg开发的,但是这样工作 ...

  6. 基于Swt、ffmpeg、jacob、vlc、SApi、h2技术编写简单的旁白生成器

    一.简介: 前一段时间尝试录制了几集3D编程方面的视频教程,我发现录制时最大的障碍是让脑中的思考.手上的操作和嘴里的解说保持同步,一旦三个"线程"中有一个出错,就必须停下来重新录制 ...

  7. Movist for Mac(高清媒体播放器)v2.0.7中文特别版

    Movist for Mac中文破解版是目前Mac平台上最好用的视频播放器,功能强大简单好用.movist mac版拥有美观简洁的用户界面,提供多种功能,支持视频解码加速高品质的字幕,全屏幕浏览,是与 ...

  8. lucene中文分词——(四)

    1.分析器的执行过程:

  9. Android VLC播放器二次开发2——CPU类型检查+界面初始化

    上一篇讲了VLC整个程序的模块划分和界面主要使用的技术,今天分析一下VLC程序初始化过程,主要是初始化界面.加载解码库的操作.今天主要分析一下org.videolan.vlc.gui.MainActi ...

随机推荐

  1. MathType如何插入竖直线

    不用键盘上的竖线,用左竖直线和右竖直线.

  2. 三星s3c24xx平台GPIO操作详解

    转:http://blog.chinaunix.net/uid-22030783-id-3391515.html 先介绍三星S3C24XX平台BSP中定义外设寄存器和GPIO的相关头文件 以linux ...

  3. mq使用经验

    1.Producer使用指南--发送消息注意事项 1.正常情况下一个业务系统尽可能用一个Topic,消息子类型用tags来标识,tags可以由业务系统自由设置.只有发送消息设置了tags,消费方在订阅 ...

  4. Android线程与线程池

    引言 在Android中,几乎完全采用了Java中的线程机制.线程是最小的调度单位,在很多情况下为了使APP更加流程地运行,我们不可能将很多事情都放在主线程上执行,这样会造成严重卡顿(ANR),那么这 ...

  5. mac 下安装 mysql (蛋疼)

    mac先安装mydql步骤 1.首先从官网上下载 mac版本的mysql:我的是mysql-5.7.20-macos10.12-x86_64.dmg 2.正常安装: 3.在系统偏好设置的最底下.1:是 ...

  6. u-boot修改出错的问题

    一.u-boot找不到nandflash 我用的开发板是fl2440的,里面没有norflash只有nandflash.我用了s3c2410的u-boot改的,所以要把内核从norflash启动改成适 ...

  7. http://blog.csdn.net/a942980741/article/details/39990699

    http://blog.csdn.net/a942980741/article/details/39990699

  8. Linux(CentOS)修改IP地址

    登陆连接centos系统,输入 ifconfig 可以查看到当前本机的IP地址信息 一 临时修改IP地址: 1.假如查询IP为1.118,输入 ifconfig eth0 (默认是第一个网卡) 后面接 ...

  9. RocketMQ之连接以及连接缓存

    发现rabbitmq有一个ConnectionFactory.发现rocketmq好像没这个东西.按道理来说如果每次发送消息都新建一条连接肯定是不可能的. ps:其实之所以是有上面的疑问是因为数据库连 ...

  10. 利用Bootstrap制作一个流行的网页

    首先是html承载内容: <!DOCTYPE html> <html lang="zh_CN"> <head> <meta charset ...