這篇文檔講述的是 VLC media player Web plugins 和怎樣在網頁使用它javascript
Introduction: Building Web pages with Video
VLC media player webplugins 是瀏覽器原生插件,相似於Flash和Silverlight 插件,而且可以在瀏覽器中播放全部 VLC media player 能讀取的視頻。php
除了能在網頁上播放視頻外,你也能夠用插件的高級特性來定製自定義頁面,而且經過javascript來控制播放或者獲取其餘的信息。css
目前主要有兩種插件:一個是IE的Activex插件,另一個是其餘瀏覽器的NAAPI插件,這兩個插件具備相同的特性。html
在之前的舊版本中,這些插件很容易崩潰,咱們強烈建議你用VLC2.0.0或者更新版本.html5
瀏覽器支持
測試瞭如下瀏覽器:java
Mozilla Firefox(52版本如下,譯者注) |
![Firefox-logo.png](http://static.javashuo.com/static/loading.gif) |
Internet Explorer |
![20101105053305!Internet Explorer 9.png](http://static.javashuo.com/static/loading.gif) |
Safari |
![Apple Safari.png](http://static.javashuo.com/static/loading.gif) |
Chrome |
|
Konqueror |
|
Opera |
|
測試了下面的平臺 GNU/Linux, Windows and MacOS.web
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>來給聲明標籤屬性,下面是例子:app
<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 (獲取下面幾個別名之一: mrl, filename, src): 指定視頻要加載的資源url
可選元素
這些是<embed>標籤的附加屬性:
-
- autoplay, autostart: 指定插件在加載成功後是否自動播放,默認爲true
- allowfullscreen (or fullscreenEnabled, fullscreen): (從VLC 2.2.0 開始) 指定是否用戶能夠切換到全屏模式,默認爲 true
- windowless: (從VLC 2.0.6開始,只適用於火狐瀏覽器)在(非加速)無窗體表面繪製,容許樣式疊加(css疊加,3D轉換等等),默認爲 false
- mute: 指定是否將視頻音量初始化爲靜音,默認爲 false
- volume: (從VLC 2.2.2開始) 用百分比來指定初始化音量,默認爲100
- loop, autoloop: 指定視頻結束後是否循環,默認爲 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: 返回版本信息字符串
可讀可寫屬性
方法
- 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>
-
Audio 對象
只讀屬性
- vlc.audio.count: (supported in vlc version >= 1.1.0) 返回視頻數量.
讀寫屬性
- vlc.audio.mute:是否靜音的布爾值.
- vlc.audio.volume: 音頻的百分比,取值爲0-200.
- vlc.audio.track: (supported in vlc version > 0.8.6) 取值範圍爲[1-65535] ,表示播放的音軌或正在播放的音軌。值爲0意味着音頻將被禁用
- vlc.audio.channel: (supported in vlc version > 0.8.6) 整形值,範圍爲[1-5], 指示使用哪一種音頻通道模式,值能夠是:「1 =立體聲」,「2 =反向立體聲」,「3 =左」,「4 =右」,「5 =杜比」。使用vlc.audio.channel檢查音頻信道模式設置成功了。
方法
- vlc.audio.toggleMute(): 布爾值,根據音頻的上一個狀態靜音和非靜音的切換.
- vlc.audio.description(int i): (supported in vlc version >= 1.1.0) 給每一個音軌的名字。0對應于禁用和1到第一音軌。
-
Example
-
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>
-
Input 對象
只讀屬性
- vlc.input.length: 輸入文件的毫秒數,0表示VLC不能肯定長度的直播流或者切片,-1表示沒有輸入在播放.
- vlc.input.fps: 每秒播放的幀數,浮點型 (典型值 60.0, 50.0, 23.976, 等)
- vlc.input.hasVout: 視頻正在顯示時返回ture,不然返回false
讀寫屬性
- vlc.input.position: 在0 [ 1 ]之間做爲浮點值給出的多媒體流項中的歸一化位置
- vlc.input.time:以毫秒爲單位的時間的絕對位置,此屬性可用於經過流查找。
<!-- absolute seek in stream -->
vlc.input.time = <absolute seek>
<!-- relative seek in stream -->
vlc.input.time = vlc.input.time + <relative seek>
- 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.
- vlc.input.rate: 浮點型的輸入速度 (1.0 表示正常速度 0.5 表示一半速度, 2.0 兩倍速率, etc.).
rate > 1 |
fast forward |
rate = 1 |
normal speed |
rate < 1 |
slow motion |
方法
- none
-
Title 對象
只讀屬性
- vlc.input.title.count: (supported in vlc version >= 2.2.2)返回能夠播放的標題數量
讀寫屬性
- vlc.input.title.track: (supported in vlc version >= 2.2.2) 獲取並設置標題軌道,屬性值取值範圍爲 [0..65535],若是沒有標題,則返回-1.
方法
- vlc.input.title.description(int i): (supported in vlc version >= 2.2.2) give the i-th title name.
-
Chapter 對象
只讀屬性
- vlc.input.chapter.count: (supported in vlc version >= 2.2.2) 返回當前章節的標題數量
讀寫方法
- 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
- vlc.input.chapter.description(int i): (supported in vlc version >= 2.2.2) give the i-th chapter name.
- vlc.input.chapter.countForTitle(int i): (supported in vlc version >= 2.2.2) returns the number of chapter available for a specific title.
- vlc.input.chapter.prev(): (supported in vlc version >= 2.2.2) 播放上一章節
- vlc.input.chapter.next(): (supported in vlc version >= 2.2.2) 播放下一章節
-
Playlist 對象
只讀屬性
- vlc.playlist.itemCount:返回當前播放列表中的播放項的數量 (deprecated, do not use, see Playlist items)
- vlc.playlist.isPlaying: 返回一個是否當前播放列表項在播放的布爾值
- vlc.playlist.currentItem: (supported in vlc version >= 2.2.0) 播放列表中播放項當前的索引,若是是空或者沒有激活,則返回-1.
- vlc.playlist.items: 返回播放列表項集合, 見 Playlist items
讀寫屬性
- none
方法
- vlc.playlist.add(mrl): 給播放列表添加 MRL. MRL格式爲字符串格式。返回值爲剛剛添加的資源在播放列表中的索引。
- 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);
- vlc.playlist.play(): 開始播放當前播放列表中的項目
- vlc.playlist.playItem(number): 開始播放指定標識符的項目
- vlc.playlist.pause(): 暫停播放當前播放列表中的項目
- vlc.playlist.togglePause(): 切換播放列表中播放項目的暫停狀態
- vlc.playlist.stop(): 中止播放當前播放項目
- vlc.playlist.next(): 迭代到下一個播放列表項
- vlc.playlist.prev(): 迭代到上一個播放列表項
- vlc.playlist.clear(): 清空播放列表,全部的播放列表會被刪除 (過期的, 不要使用, see Playlist items)
- vlc.playlist.removeItem(number): 移除播放列表中指定索引的播放項目remove the item from playlist whose identifier is number (過期的, 不要使用, see Playlist items)
-
Playlist items 對象
只讀屬性
- vlc.playlist.items.count: 當前播放列表中的項目數量
讀寫屬性
- none
方法
- vlc.playlist.items.clear(): 清空播放列表中的項目,(注意: 若是視頻正在播放,視頻將不會中止播放,也就是說調用這個方法前,先中止播放)
- vlc.playlist.items.remove(number): 從播放列表中刪除標識符編號的項。 (注意:這個數字是播放列表中當前的位置. 不是調用vlc.playlist.add()的返回值, 播放列表中的任何一項均可以被移除)
-
Subtitle 對象
只讀屬性
- vlc.subtitle.count: (支持版本 >= 1.1.0) 返回能夠得到的字幕數量
讀寫屬性
- 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.
方法
- 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 對象
只讀屬性
- vlc.video.width: 返回視頻的寬度
- vlc.video.height: 返回視頻的高度
- vlc.video.count: (supported in vlc version >= 2.2.7) returns the number of video track available.
讀寫屬性
- vlc.video.fullscreen: 當設置爲true的時候,視頻全屏,當設置爲false的時候,視頻非全屏,輸入值爲布爾值。.
- 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.
- 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"
- 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.
- 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.
方法
- vlc.video.takeSnapshot(): (支持版本 >= 0.9.0, only for ActiveX) 生成截圖,並保存到桌面
- vlc.video.toggleFullscreen(): 根據上一個狀態切換全屏狀態
- 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.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.
-
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", "left", "right", "top", "top-left", "top-right", "bottom", "bottom-left", "bottom-right").
- 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.
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.
-
MediaDescription Object
readonly properties
- vlc.mediaDescription.title: (supported in vlc version >= 2.0.2) returns title meta information field.
- vlc.mediaDescription.artist: (supported in vlc version >= 2.0.2) returns artist meta information field.
- vlc.mediaDescription.genre: (supported in vlc version >= 2.0.2) returns genre meta information field.
- vlc.mediaDescription.copyright: (supported in vlc version >= 2.0.2) returns copyright meta information field.
- vlc.mediaDescription.album: (supported in vlc version >= 2.0.2) returns album meta information field.
- vlc.mediaDescription.trackNumber: (supported in vlc version >= 2.0.2) returns trackNumber meta information field.
- vlc.mediaDescription.description: (supported in vlc version >= 2.0.2) returns description meta information field.
- vlc.mediaDescription.rating: (supported in vlc version >= 2.0.2) returns rating meta information field.
- vlc.mediaDescription.date: (supported in vlc version >= 2.0.2) returns date meta information field.
- vlc.mediaDescription.setting: (supported in vlc version >= 2.0.2) returns setting meta information field.
- vlc.mediaDescription.URL: (supported in vlc version >= 2.0.2) returns URL meta information field.
- vlc.mediaDescription.language: (supported in vlc version >= 2.0.2) returns language meta information field.
- vlc.mediaDescription.nowPlaying: (supported in vlc version >= 2.0.2) returns nowPlaying meta information field.
- vlc.mediaDescription.publisher: (supported in vlc version >= 2.0.2) returns publisher meta information field.
- vlc.mediaDescription.encodedBy: (supported in vlc version >= 2.0.2) returns encodedBy meta information field.
- vlc.mediaDescription.artworkURL: (supported in vlc version >= 2.0.2) returns artworkURL meta information field.
- vlc.mediaDescription.trackID: (supported in vlc version >= 2.0.2) returns trackID meta information field.
read/write properties
- none
methods
- none
-
DEPRECATED APIs
-
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
- vlc.log.messages: returns the message collection, see Messages object
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
-
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
- 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.
-
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
- 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
-
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.
- 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