VLC播放器web插件接口(Part2)
本文转自:http://www.educity.cn/wenda/124878.html
VLC Activex控件(VideoLAN.VLCPlugin.1 VideoLAN.VLCPlugin.2)的所有方法 属性及使用 在一个老外的网站上找到的
无意中在老外的网站上发现了关于VideoLAN.VLCPlugin.1和VideoLAN.VLCPlugin.2所有方法和属性~~公布出来~~以免大家浪费时间去寻找~~(注意你使用的VLC的版本)
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.
<html> <head><title>Demo of VLC mozilla plugin</title></head> <body> <h1>Demo of VLC mozilla plugin - Example 1</h1> <embed type="application/x-vlc-plugin" name="video1" autoplay="no" loop="yes" width="400" height="300" target="" /> <br /> <a javascript:;" onclick='document.video1.play()'>Play video1</a> <a javascript:;" onclick='document.video1.pause()'>Pause video1</a> <a javascript:;" onclick='document.video1.stop()'>Stop video1</a> <a javascript:;" onclick='document.video1.fullscreen()'>Fullscreen</a> </body> </html>
Example 2
In this example, the plugin will read a multicast RTP/UDP stream in a dedicated video output window.
<html> <head><title>Demo of VLC mozilla plugin</title></head> <body> <h1>Demo of VLC mozilla plugin - Example 2</h1> <embed type="application/x-vlc-plugin" name="video2" autoplay="no" loop="no" hidden="yes" target="rtp://@239.255.12.42:5004" /> <br /> <a javascript:;" onclick='document.video2.play()'>Play video2</a> <a javascript:;" onclick='document.video2.stop()'>Stop video2</a> <a javascript:;" onclick='document.video2.fullscreen()'>Fullscreen</a> </body> </html>
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.
<html> <title>VLC Mozilla plugin test page</title> <body> <embed type="application/x-vlc-plugin" pluginspage="" version="VideoLAN.VLCPlugin.2" width="640" height="480" id="vlc"> </embed> <script language="Javascript"> <!-- var vlc = document.getElementById("vlc"); vlc.audio.toggleMute(); !--> </script> </body> </html>
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: <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); alert(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 is being displayed, it returns false when video is not displayed
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 be 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 for 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 is playing and false when it is not playing
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 options 'options'. All input values must be 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 will be deleted from the playlist
vlc.playlist.removeItem(number) : remove the given item number (which cannot be 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 will be displayed in fullscreen mode, when set to false the video will be shown inside the video output size. The property takes a boolean as input.
vlc.video.aspectRatio : get and set the aspect ratio to use in 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 have 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 be called as frequently as possible to not overflow the plugins logging buffer. Call this method after the log messages of interest are read.
messages.iterator() : returns a messages iterator object, which is used to 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 when true, that wheter vlssages.next() returns the next message.
read/write properties
none
methods
iterator.next() : returns the next message object it the log
源文档 <http://blog.csdn.net/fm0517/article/details/39009971>
VLC播放器web插件接口(Part2)的更多相关文章
- VLC播放器web插件接口(Part1)
本文转自:http://blog.csdn.net/xiaoxiaoxuewen/article/details/7698803Embed tag attributesTo embed the plu ...
- 使用vlc播放器做rtsp流媒体服务器
可参考: 使用vlc播放器播放rtsp视频 web网页中使用vlc插件播放相机rtsp流视频 使用vlc进行二次开发做自己的播放器 首先需要安装vlc播放器,下载及安装步骤略 使用vlc播放器做rts ...
- 使用vlc播放器播放rtsp流视频
可参考: 使用vlc播放器做rtsp服务器 web网页中使用vlc插件播放相机rtsp流视频 使用vlc进行二次开发做自己的播放器 首先需要安装vlc播放器,下载及安装步骤略 使用vlc播放器播放rt ...
- Android VLC播放器二次开发1——程序结构分析
最近因为一个新项目需要一个多媒体播放器,所以需要做个视频.音频.图片方面的播放器.也查阅了不少这方面的资料,如果要从头做一个播放器工作量太大了,而且难度也很大.所以最后选择了VLC作为基础,进行二次开 ...
- Android VLC播放器二次开发3——音乐播放(歌曲列表+歌词同步滚动)
今天讲一下对VLC播放器音频播放功能进行二次开发,讲解如何改造音乐播放相关功能.最近一直在忙着优化视频解码部分代码,因为我的视频播放器需要在一台主频比较低的机器上跑(800M主频),所以视频解码能力受 ...
- Android VLC播放器二次开发2——CPU类型检查+界面初始化
上一篇讲了VLC整个程序的模块划分和界面主要使用的技术,今天分析一下VLC程序初始化过程,主要是初始化界面.加载解码库的操作.今天主要分析一下org.videolan.vlc.gui.MainActi ...
- Ubuntu 16.04安装VLC播放器,替代系统默认播放器
VLC播放器应该说是开源项目中最好的视频播放器,但功能不止于视频播放,还有视频直播等等.可以通过安装字幕插件搜索字母等. 安装步骤: 1.安装: sudo add-apt-repository ppa ...
- vlc 播放器的点播和广播服务
vlc 是一个开源的,同时跨平台的播放器.在研究 rtsp 协议时发现,它同时还是一个强大的流媒体服务器 VLM VLM(VideoLAN Manager) 在 vlc 中是一个小型的媒体管理器,它能 ...
- centos7安装VLC播放器
centos7安装VLC播放器 1.安装eple 下载地址:https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noar ...
随机推荐
- ZZNUOJ-2154:单身狗线下聚会【求N个数的最小公倍数,会超longlong,大数乘法,Java】
2154: 单身狗线下聚会 题目描述 马上就到七夕节了,单身狗们决定聚一聚.但是它们沉迷B站上的lo娘,他们每沉迷 ai 单身狗时间(这是它们专业计时)后就会休息 单身狗时间.它们想找到一个时间正好他 ...
- spring实例化三:CglibSubclassingInstantiationStrategy
在SimpleInstantiationStrategy类中,留下了包含MethodOverride对象的bd对象定义未做实现,做了抽象.CglibSubclassingInstanti ...
- MVVM框架(Vue)
问题: 一:说一下使用 JQuery和使用框架的区别? 二: 说一下对 MVVM的理解 三: Vue中如何实现响应式 四: vue中如何解析模板 五:vue整个实现流程 1. 说一下使用 JQuery ...
- Selenium(九)测试用例数据分离与从文件导入数据
一.测试用例数据与代码分离 1.从之前的脚本来看,我还是把数据写在了脚本中,这样脚本的通用性很差.全局的数据其实可以从数据库.文本文件.Excel中直接读取. 2.代码和用户数据分离: 3.数据设计- ...
- CallContext线程数据缓存-调用上下文
一.CallContext 概述 命名空间:System.Runtime.Remoting.Messaging CallContext 用于提供与执行代码路径一起传送的属性集,直白讲就是:提供线程(多 ...
- python自动华 (十四)
Python自动化 [第十四篇]:HTML介绍 本节内容: Html 概述 HTML文档 常用标签 2. CSS 概述 CSS选择器 CSS常用属性 1.HTML 1.1概述 HTML是英文Hyper ...
- 025_自动为其他脚本添加解释器信息#!/bin/bash
#!/bin/bash#先使用 grep 判断对象脚本是否已经有解释器信息,如果没有则使用 sed 添加解释器以及描述信息if ! grep -q "^#!" $1; then # ...
- wangEditor实现ctrl+v粘贴word图片并上传
很多时候我们用一些管理系统的时候,发布新闻.公告等文字类信息时,希望能很快的将word里面的内容直接粘贴到富文本编辑器里面,然后发布出来.减少排版复杂的工作量. 下面是借用百度doc 来快速实现这个w ...
- harbor 私有镜像仓库使用
使用harbor私有镜像仓库 登录镜像仓库reg.lvusyy.com docker login reg.lvusyy.com [centos@k8smaster ~]$ sudo docker lo ...
- Linux监控工具介绍系列——iostat
文章转自:https://www.cnblogs.com/ghj1976/p/5691857.html Linux系统中的 iostat是I/O statistics(输入/输出统计)的缩写,iost ...