猿大师中间件VLC播放器内嵌网页小程序开发文档
基于猿大师中间件网络高级版开发,底层调用VLC的ActiveX控件axvlc.dll(需安装VLC media player或搭配绿色版VLC播放程序)可实现在网页中内嵌播放多路RTSP的实时视频流。最低可用在Chrome 41、Firefox 50、Edge 80(Chromium内核)、360极速/安全、IE、Oprea 36、QQ等浏览器,也兼容运行于这些浏览器的最新版本。
本小程序具有如下优点:
1、全市场可实现较低延迟(300毫秒)的成熟播放方案,主流版本的浏览器都支持;
2、支持多路同时播放、支持回放和抓图、高清视频或大屏播放性能好;
3、底层播放技术采用VLC的开放源代码方案,后续服务有保障,播放格式兼容好,支持H.264和H.265;
4、VLC网页播放小程序额外付费后可获得源代码进行定制开发;
5、支持海康、大华等主流的摄像头,只要能提供标准的RTSP流,都可以播放;
6、移动端可直接采用VLC的APP来使用。
说明:以下功能请通过Web Socket连接猿大师主服务(ws://localhost:83?sid=12345&flag=1)后可执行,如默认侦听端口不是83(关于如何配置侦听端口,请参考SDK包中的文档“猿大师开发者手册.doc”),请在连接地址中指定端口号进行连接。
HTTP网页在线充满网页区测试:http://test.yuanmaster.com/vlcwebfull.html
HTTP网页在线局部加载测试:http://test.yuanmaster.com/VLCWebPlayer.html
如还需兼容IE浏览器使用,网络版测试网页中 <object ID="WrlWS" CLASSID="CLSID:C0971B90-4513-4E2D-A0B6-15B915FE748A" width="0" height="0"></object>
的CLSID需要替换为:21ADE2E6-B4DD-4F3E-8BD5-9DDAD1785F3A
前端集成可参考以上测试网页进行,HTML网页中需要嵌入以下类似代码;
A、标记小程序的显示位置和大小
.VLCWebPlayer {
margin: 20px 0 0 20px;
width: 480px;
height: 320px;
border: 1px solid blue;
}
或者
.VLCWebPlayer{
width: 480px;
height: 320px;
top: 20px;
left: 20px;
border: 1px solid blue;
}
如果在网页Header区没有标记小程序初始显示位置和大小,请在启动小程序的JSON参数里,添加以下参数:
"Left":20,"Top":20,"Width":480,"Height":320
B、网页中嵌入元素
支持IFrame的:
<iframe name="VLCWebPlayer" id="VLCWebPlayer" src="VLCWebPlayer3.html" frameborder="0" align="left" width="550" height="540" scrolling="no>
<param ID="2" Play="http://www.yuanmaster.com/Files/RTSP.mp4" />
<param ID="3" Play="rtsp://wzh:test123456@192.168.1.8:554/h264/ch1/main/av_stream" Caching="500" />
</iframe>
或者直接用
<div id="VLCWebPlayer" class="VLCWebPlayer"</div>
另外需要嵌入用到的JS脚本,脚本程序是完全开源的。
播放窗口选中状态时单击即可全屏显示,全屏显示状态通过ESC按键取消,全屏切换会发送JSON包的VLC_FullScreen通知。
1)、请求启动VLC网页播放小程序:
Type为浏览器类型,传0自动判断(前提是当前浏览器已启动并显示在最前端,Flag指定当前页加载时必须是0) 可强制指定浏览器类型Type(1代表IE 2代表Chrome 4代表Firefox 8代表Opera 16代表Edge(Chromium内核) 32代表360极速浏览器 33代表360安全浏览器 34代表360企业安全浏览器 50代表QQ浏览器 60代表搜狗浏览器)
Title:网页标题中的关键词
Flag掩码标记:1指定新标签加载(1和16都不指定时为当前页加载) 2小程序显示窗口边框 4不自动裁剪越界窗口 8自动适配网页高度和宽度显示
ShowType 播放窗口分屏类型,默认1只显示一个播放窗口,支持1-22 24 25等多达20种多窗口播放
Url:加载小程序所在的网页实际地址,在网页中指定小程序的显示位置和大小,分屏多窗口播放地址和选项等
IframeX和IframeY分别为iframe嵌套的横竖偏移修正坐标
BarW和BarH分别是网页右侧和底部预留区域,ScrollTop为顶部滚动预留高度
小程序实际显示首先会基于Url网页中指定的坐标和大小,再根据IframeX、IframeY、BarW、BarH设定的值做修正
Web:播放配置(新增方式),可代替Url使用,Flag值+64使用此配置,此命令中必须指定Left、Top、Width、Height的值
Open :启动后第一个窗口自动播放的流地址或本地多媒体文件路径,斜杠\替换成/再传,也可以在Web中指定
注意:Open、Url、Web中如果有特殊字符= & 双引号或中文等,需要用URL编码处理后传递 如非本地全路径,默认使用中间件程序Data子目录作为根目录使用
举例:
自动识别当前浏览器指定位置和大小启动:
{"req":"Wrl_VLCWebPlayer","rid":4,"para":{"Type":"0","Title":"VLC Web Player","Flag":2,"IframeX":0,"IframeY":0,"BarW":0,"BarH":0,"ScrollTop":0,"Url": "http://test.yuanmaster.com/VLCWebPlayer.html","ShowType":1,"Open":"https://vjs.zencdn.net/v/oceans.mp4"}}
自动识别当前浏览器自动适配网页大小启动:
{"req":"Wrl_VLCWebPlayer","rid":4,"para":{"Type":"0","Title":"VLC Web Player","Flag":10,"IframeX":0,"IframeY":0,"BarW":0,"BarH":0,"ScrollTop":0,"Url": "http://test.yuanmaster.com/VLCWebPlayer.html","ShowType":1,"Open":"http://www.yuanmaster.com/Files/RTSP.mp4"}}
自动识别当前浏览器指定位置和大小启动(不需要Url参数):
{"req":"Wrl_VLCWebPlayer","rid":4,"para":{"Type":"0","Title":"VLC Web Player","Flag":66,"Left":20,"Top":230,"Width":480,"Height":320,"IframeX":0,"IframeY":0,"BarW":0,"BarH":0,"ScrollTop":0,"ShowType":4,"Open":"https://vjs.zencdn.net/v/oceans.mp4","Web":[{"ID":2,"Uri":"rtsp://wzh:test123456@192.168.1.8:554/h264/ch1/main/av_stream","Option":":rtsp-tcp"},{"ID":3,"Uri":"http://www.yuanmaster.com/Files/RTSP.mp4","Option":":file-caching=300"},{"ID":4,"Uri":"rtsp://wzh:test123456@192.168.1.8:554/h264/ch1/sub/av_stream","Option":":network-caching=200"}]}}
当前页指定位置自动适配网页加载测试
http://test.yuanmaster.com/VLCWebPlayer.html
启动后会前后收到三个JSON数据包
A、{"ret":0,"rid":1,"data":{"ID":2}}
代表小程序WS侦听服务就绪
B、{"event":"Wrl_Listen","aid":2,"data":{"SID":"123","PID":"VLCWebPlayer","port":935}}
返回的侦听端口,可再建立一个Web Socket连接后,调用小程序中的相关功能,比如重新指定播放一个视频。
代表小程序创建成功,返回ID为当前小程序运行ID,通过此ID,可执行Wrl_AppletControl、Wrl_AppletScroll、Wrl_AppletResize等命令。
C、{"event":"Wrl_AppletOK","aid":2,"rid":4,"data":{"SID":"123","PID":"VLCWebPlayer","Port":935}}
2)、请求控制VLC网页播放小程序:
当前端不再需要小程序时可指定关闭,或者显示/隐藏及全屏显示等
ID为Wrl_VLCWebPlayer启动小程序时返回的ID值,Code代表控制类型掩码:1关闭 2全屏显示 4自动隐藏 8还原显示 16自动适配网页高度和宽度显示模式切换 32强制隐藏。其中全屏显示2,可直接通过热键ESC或取消,设置4和32隐藏后可通过8恢复显示
{"req":"Wrl_AppletControl","rid":2,"para":{"ID":"1","Code":4}}
3)、请求滚动VLC网页播放小程序:
当前端截取到网页滚动通知时,需要调用此接口实现小程序和网页的滚动联动
ID为启动小程序时返回JSON中的ID值
Code为滚动方向1是水平直,2是垂直,3是同时
Left为横向滚动条位置,Top为纵向滚动条位置
{"req":"Wrl_AppletScroll","rid":3,"para":{"ID":"1","Code":2,"Left":0,"Top":100}}
4)、请求改变VLC网页播放小程序显示位置或大小:
当前端网页显示区域缩放时,可动态修改小程序的显示位置或大小
ID为Wrl_VLCWebPlayer启动小程序时返回的ID值,Width和Height分别为新的宽度和高度
X和Y分别为新的显示位置,不指定时保持不变,指定时原设置的IframeX和IframeY失效
{"req":"Wrl_AppletResize","rid":4,"para":{"ID":1,"Width":500,"Height":600}}
或,同时修改小程序显示起始坐标
{"req":"Wrl_AppletResize","rid":5,"para":{"ID":1,"Width":500,"Height":600,"X":20,"Y":20}}
5)、请求设置网页预留右侧宽度和底部高度,滚动条信息、垂直滚动及水平滚动位置:
当小程序显示区域超过当前网页时,需去除滚动条的显示影响
ID为启动小程序时返回的ID值,BarW为预留右侧宽度 BarH为预留底部高度
Code 1代表有水平滚动条,2代表有垂直滚动条,3代表都有
ScrollTop垂直滚动条位置 ScrollTop水平滚动条位置
{"req":"Wrl_ScrollBar","rid":6,"para":{"ID":"1","Code":2,"BarW":0,"BarH":0,"ScrollTop":0,"ScrollLeft":0}}
6)、请求对小程序窗口做Alpha透明处理,便于前端临时显示覆盖到小程序窗口的菜单等:
ID为Wrl_VLCWebPlayer启动小程序时返回的ID值,Alpha为透明度百分比,1-100
{"req":"Wrl_AppletAlpha","rid":7,"para":{"ID":1,"Alpha":30}}
7)、请求对小程序窗口内容进行截图:
ID为启动小程序时返回JSON中的ID值,
File为指定截图文件保存路径或扩展名
Base64指定为1时代表返回BASE64编码的图像内容
{"req":"Wrl_AppletSnap","rid":10,"para":{"ID":1,"Base64":1,"File":".png"}}
8)、请求缩放内嵌网页小程序,用于浏览器网页按比例缩放,一般不需要处理:
ID为启动小程序时返回JSON中的ID值,不指定Scale时,获取当前小程序所用的缩放百分比,一般和系统缩放比例一致
{"req":"Wrl_AppletScale","rid":11,"para":{"ID":1,"Scale":120}}
3、小程序安装、升级、卸载
1)、请求安装VLC网页播放小程序
请在测试网页输入框中,输入如下请求,然后点击发送,完成安装:
{"req":"Plugin_Install","rid":1,"para":{"Name":"VLC内嵌网页多媒体播放小程序","PID":"VLCWebPlayer","Date":"2022-01-05","Desc":"猿大师之上跨浏览器的VLC多媒体播放内嵌网页小程序,支持在Chrome、Edge、Firefox、IE、Oprea、360、QQ等最新版本浏览器网页中直接内嵌使用,可播放多路海康及大华等设备的实时视频","DownAddr":"http://local.zorrosoft.com/Files/Net/VlcPlayerApplet.pid","MD5":"1556B3BB9C0A760D0D1A61BB92860C19","Version":"2.2.3.9","Size":1933312,"HideIns":0,"Type":8,"Cookie":"","Auth":"","TK":"B18EB9EECDEC361690103985C1D34CB73B6FA12FC750690B49541388217469A7B27E84F1C2644CA108B3F9C0A107A271695D224F2207FC2B4AC2BB90AFF5A1F5F155C1CDDDDC00E10DF62449BBCEE55CADFEA003E55B08C4944DE481C75761F96779040FC22593B3A9917FFD4A9B673B68F086E1F0569A78EC997F494DBF461AA9713B2F4D8C05DFE46A8C0F08ACED1B509C3F8A7B2241AD5725EBAF2007A9C5048BB6D717458379CA015F7707D50D8E5C9446215320C252415FF9F954966A88D154A1B7A9BCFBF36837DF70EF435F01AF70E3C9D29ED52D7EC70175A116F65D70AC63B9B3F9D03FB0663E2CD94E840CF2457DB45A71FC7195A3ECB3C63E4EFD"}}
启动安装后,会不断收到安装进度直到安装结束。
2)、请求升级VLC网页播放小程序:
{"req":"Plugin_Update","rid":1,"para":{"Name":"VLC内嵌网页多媒体播放小程序","PID":"VLCWebPlayer","Date":"2022-01-05","Desc":"猿大师之上跨浏览器的VLC多媒体播放内嵌网页小程序,支持在Chrome、Edge、Firefox、IE、Oprea、360、QQ等最新版本浏览器网页中直接内嵌使用,可播放多路海康及大华等设备的实时视频","DownAddr":"http://local.zorrosoft.com/Files/Net/VlcPlayerApplet_Update.pid","MD5":"FA17D3CEBF7A159D05FF4C4DE5713A83","Version":"2.2.3.9","Size":1933312,"HideIns":0,"Type":8,"Cookie":"","Auth":"","TK":"08E2718E44A8F6662F4747C7065911B17C4ACFD017494488DA1992D6696FF4EA49B828D7426BB15E095CCCD8CAEE271F00A0BE6647589AD92DEA3C5B415620362E858F2E519A097203C2B335D07D89413132F839DE615584B31EF6B4D2F61B5DA9EC23E0E591618EACF71F60BD64997C1CD509794B4395277567360838041957B78693988969D845199AC0C127FA80B84A90532D4DEAEAA9F2EB28EC0B06D111868632A9826BC9698C037F4D063FDAC4D03B3A2269DC2EE1557E89022798D6CD1B8C9A2DF85DC932325C93DB2073337C2E5C249B6DDCDD148F1CF7B2E13A319F2E46F8AF6A507EF07F3384D18D6C92F933F92A3F36042C9BC21A72EEB089CE32"}}
以上安装和升级的JSON请求包,可能因版本升级导致内容不同,如遇安装或升级时报错,请联系客服获取最新的请求包。
3)、请求卸载VLC网页播放小程序:
正式版需要添加TK校验,具体规则请参考SDK包中文档“猿大师中间件安全解决方案.doc”,可在SDK包中的打包程序ZbaPackage.exe的中间件维护生成带TK的请求。
{"req":"Plugin_Remove","rid":3,"para":{"PID":"VLCWebPlayer","Type":8}}
4、VLC网页播放小程序转调用ActiveX接口(接口说明:https://wiki.videolan.org/Documentation:WebPlugin ),先根据Wrl_VLCWebPlayer请求启动后返回的端口号,针对此端口新建一个WebSocket连接后可执行如下指令:
A、ActiveX接口功能请求:
支持创建多个ActiveX控件窗口同时播放多路实时视频,所以请求参数里需要指定窗口序号ID,从1开始,序号原则是从左向右开始编号,然后从上到下开始顺序编号,如遇右侧多层排列窗口时,直到右侧窗口序号排序完成
1) 取指定ID播放窗口属性AutoLoop(自动循环)值,举例:
请求:{"req":"VLC_GetAutoLoop","rid":41,"para":[{"ID":1},{"ID":2}]}
分别返回:{"ret":0,"rid":41,"ID":1,"data":{"Ret":0,"AutoLoop":0}} 和 {"ret":0,"rid":41,"ID":2,"data":{"Ret":0,"AutoLoop":0}}
ret为请求返回值,0正常,非零不正常,不正常时请取和ret同级的错误描述err,下同
Ret为调用ActiveX对应函数返回值,0代表正常
2) 设置指定ID控件窗口AutoLoop(自动循环)值,举例:
请求:{"req":"VLC_PutAutoLoop","rid":42,"para":[{"ID":1,"AutoLoop":1},{"ID":2,"AutoLoop":0}]}
分别返回:{"ret":0,"rid":42,"ID":1,"data":{"Ret":0}} 和 {"ret":0,"rid":42,"ID":2,"data":{"Ret":0}}
3) 取指定ID控件窗口AutoPlay(自动播放)值,举例:
请求:{"req":"VLC_GetAutoPlay","rid":43,"para":[{"ID":1},{"ID":2}]}
分别返回:{"ret":0,"rid":43,"ID":1,"data":{"Ret":0,"AutoPlay":0}} 和 {"ret":0,"rid":43,"ID":2,"data":{"Ret":0,"AutoPlay":0}}
4) 设置指定ID窗口AutoPlay(自动播放)值,举例:
请求:{"req":"VLC_PutAutoPlay","rid":44,"para":[{"ID":1,"AutoPlay":1},{"ID":2,"AutoPlay":0}]}
分别返回:{"ret":0,"rid":44,"ID":1,"data":{"Ret":0}} 和 {"ret":0,"rid":44,"ID":2,"data":{"Ret":0}}
5) 取指定ID窗口StartTime(开始时间)值,举例:
请求:{"req":"VLC_GetStartTime","rid":45,"para":[{"ID":1},{"ID":2}]}
分别返回:{"ret":0,"rid":45,"ID":1,"data":{"Ret":0,"StartTime":0}} 和 {"ret":0,"rid":45,"ID":2,"data":{"Ret":0,"StartTime":0}}
6) 设置指定ID窗口StartTime(开始时间)值,举例:
请求:{"req":"VLC_PutStartTime","rid":46,"para":[{"ID":1,"StartTime":0},{"ID":2,"StartTime":0}]}
分别返回:{"ret":0,"rid":46,"ID":1,"data":{"Ret":0}} 和 {"ret":0,"rid":46,"ID":2,"data":{"Ret":0}}
7) 取指定ID窗口MRL(播放源)值,举例:
请求:{"req":"VLC_GetMRL","rid":47,"para":[{"ID":1},{"ID":2}]}
分别返回:{"ret":0,"rid":47,"ID":1,"data":{"Ret":0,"MRL":""}} 和 {"ret":0,"rid":47,"ID":2,"data":{"Ret":0,"MRL":""}}
8) 设置指定ID窗口MRL(播放源)值,举例:
请求:{"req":"VLC_PutMRL","rid":48,"para":[{"ID":1,"MRL":"rtsp://wzh:test123456@192.168.1.8:554/h264/ch1/main/av_stream"},{"ID":2,"MRL":"rtsp://wzh:test123456@192.168.1.8:554/h264/ch1/main/av_stream"}]}
分别返回:{"ret":0,"rid":48,"ID":1,"data":{"Ret":0}} 和 {"ret":0,"rid":48,"ID":2,"data":{"Ret":0}}
9) 取指定ID窗口Visible(可见性),举例:
请求:{"req":"VLC_GetVisible","rid":49,"para":[{"ID":1},{"ID":2}]}
分别返回:{"ret":0,"rid":49,"ID":1,"data":{"Ret":0,"Visible":1}} 和 {"ret":0,"rid":49,"ID":2,"data":{"Ret":0,"Visible":0}}
10) 设置指定ID窗口Visible(可见性),举例:
请求:{"req":"VLC_PutVisible","rid":48,"para":[{"ID":1,"Visible":1},{"ID":2,"Visible":0}]}
分别返回:{"ret":0,"rid":50,"ID":1,"data":{"Ret":0}} 和 {"ret":0,"rid":50,"ID":2,"data":{"Ret":0}}
11) 取指定ID窗口Volume(音量),举例:
请求:{"req":"VLC_GetVolume","rid":51,"para":[{"ID":1},{"ID":2}]}
分别返回:{"ret":0,"rid":51,"ID":1,"data":{"Ret":0,"Volume":0}} 和 {"ret":0,"rid":51,"ID":2,"data":{"Ret":0,"Volume":0}}
12) 设置指定ID窗口Volume(音量),举例:
请求:{"req":"VLC_PutVolume","rid":52,"para":[{"ID":1,"Volume":0},{"ID":2,"Volume":0}]}
分别返回:{"ret":0,"rid":52,"ID":1,"data":{"Ret":0}} 和 {"ret":0,"rid":52,"ID":2,"data":{"Ret":0}}
13) 取指定ID窗口BackColor(背景色),举例:
请求:{"req":"VLC_GetBackColor","rid":53,"para":[{"ID":1},{"ID":2}]}
BackColor返回的是长整型(COLORREF)
分别返回:{"ret":0,"rid":53,"ID":1,"data":{"Ret":0,"BackColor":0}} 和 {"ret":0,"rid":53,"ID":2,"data":{"Ret":0,"BackColor":0}}
14) 设置指定ID窗口BackColor(背景色),举例:
BackColor可用长整型(COLORREF),也可以用#000000这样的颜色值
请求:{"req":"VLC_PutBackColor","rid":54,"para":[{"ID":1,"BackColor":0},{"ID":2,"BackColor":"0"}]}
分别返回:{"ret":0,"rid":54,"ID":1,"data":{"Ret":0}} 和 {"ret":0,"rid":54,"ID":2,"data":{"Ret":0}}
15) 取指定ID窗口Toolbar(工具栏)显示与否,举例:
请求:{"req":"VLC_GetToolbar","rid":55,"para":[{"ID":1},{"ID":2}]}
分别返回:{"ret":0,"rid":55,"ID":1,"data":{"Ret":0,"Toolbar":0}} 和 {"ret":0,"rid":55,"ID":2,"data":{"Ret":0,"Toolbar":0}}
16) 设置指定ID窗口Toolbar(工具栏)显示与否,举例:
请求:{"req":"VLC_PutToolbar","rid":56,"para":[{"ID":1,"Toolbar":0},{"ID":2,"Toolbar":0}]}
分别返回:{"ret":0,"rid":56,"ID":1,"data":{"Ret":0}} 和 {"ret":0,"rid":56,"ID":2,"data":{"Ret":0}}
17) 取指定ID窗口推送信息屏蔽掩码,举例:
请求:{"req":"VLC_GetBlockFlag","rid":57,"para":[{"ID":1},{"ID":2}]}
分别返回:{"ret":0,"rid":57,"ID":1,"data":{"Ret":0,"BlockFlag":0}} 和 {"ret":0,"rid":57,"ID":2,"data":{"Ret":0,"BlockFlag":0}}
18) 设置指定ID窗口推送信息屏蔽掩码,举例:
由于以下几种信息通知比较多,所以增加阻止通知设置,比如阻止鼠标移动和位置通知,就设置9
1阻止鼠标移动通知 2阻止时间变化通知 4阻止缓存通知 8阻止进度百分比通知
请求:{"req":"VLC_PutBlockFlag","rid":58,"para":[{"ID":1,"BlockFlag":0},{"ID":2,"BlockFlag":0}]}
分别返回:{"ret":0,"rid":58,"ID":1,"data":{"Ret":0}} 和 {"ret":0,"rid":58,"ID":2,"data":{"Ret":0}}
19) 取指定ID窗口版本信息,举例:
请求:{"req":"VLC_GetVersionInfo","rid":59,"para":[{"ID":1},{"ID":2}]}
分别返回:{"ret":0,"rid":59,"ID":1,"data":{"Ret":0,"VersionInfo":""}} 和 {"ret":0,"rid":59,"ID":2,"data":{"Ret":0,"VersionInfo":""}}
20) 取指定ID窗口多媒体描述信息,举例:
请求:{"req":"VLC_MediaDescGet","rid":60,"para":[{"ID":1},{"ID":2}]}
分别返回:{"ret":0,"rid":60,"ID":1,"data":{"Ret":0,"Title":"","Artist":"","Genre":"","Copyright":"","Album":"","TrackNumber":"","Desc":"","Rating":"","Date":"","Setting":"","Url":"","Language":"","NowPlaying":"","Publisher":"","EncodedBy":"","ArtworkURL":"","TrackID":""}} 和 {"ret":0,"rid":60,"ID":2,"data":{"Ret":0,"Title":"","Artist":"","Genre":"","Copyright":"","Album":"","TrackNumber":"","Desc":"","Rating":"","Date":"","Setting":"","Url":"","Language":"","NowPlaying":"","Publisher":"","EncodedBy":"","ArtworkURL":"","TrackID":""}}
21) 取指定ID窗口音频信息,举例:
取时自动获得全部属性
请求:{"req":"VLC_AudioGet","rid":61,"para":[{"ID":1},{"ID":2}]}
分别返回:{"ret":0,"rid":61,"ID":1,"data":{"Ret":0,"Mute":0,"Volume":100,"Track":"","TrackNumber":"","Channel":"","Desc":""}} 和 {"ret":0,"rid":61,"ID":2,"data":{"Ret":0,"Mute":"","Volume":"","Track":"","TrackNumber":"","Channel":"","Desc":""}}
22) 设置指定ID窗口音频信息,举例:
设置时不要求全部属性,只设置需要设置的
请求:{"req":"VLC_AudioPut","rid":62,"para":[{"ID":1,"Mute":0,"Volume":100,"Track":"","TrackNumber":"","Channel":"","Desc":""},{"ID":2,"Mute":"","Volume":""}]}
分别返回:{"ret":0,"rid":62,"ID":1,"data":{"Ret":0}} 和 {"ret":0,"rid":62,"ID":2,"data":{"Ret":0}}
23) 取指定ID窗口播放信息,举例:
取时自动获得全部属性
请求:{"req":"VLC_GetPlay","rid":63,"para":[{"ID":1},{"ID":2}]}
分别返回:{"ret":0,"rid":63,"ID":1,"data":{"Ret":0,"IsPlay":1,"ItemCount":3,"CurrentItem":1}} 和 {"ret":0,"rid":63,"ID":2,"data":{"Ret":0,"IsPlay":1,"ItemCount":5,"CurrentItem":2}}
24) 指定ID窗口添加播放内容,举例:
Uri需要进行UrlEncode编码,Option可不设置用缺省值 Uri如非本地全路径,默认使用中间件程序Data子目录作为根目录使用
请求:{"req":"VLC_AddPlay","rid":64,"para":[{"ID":1,"Uri":"rtsp://wzh:test123456@192.168.1.8:554/h264/ch1/main/av_stream","Name":"test","Option":":network-caching=300"},{"ID":2,"Uri":"rtsp://wzh:test123456@192.168.1.8:554/h264/ch1/main/av_stream","Name":"test","Option":":rtsp-tcp"}]}
分别返回:{"ret":0,"rid":64,"ID":1,"data":{"Ret":0,"Item":1}} 和 {"ret":0,"rid":64,"ID":2,"data":{"Ret":0,"Item":2}}
25) 指定ID窗口播放(指定多媒体),举例:
ItemId是序号,可缺省
请求:{"req":"VLC_Play","rid":65,"para":[{"ID":1,"ItemId":1},{"ID":2}]}
分别返回:{"ret":0,"rid":65,"ID":1,"data":{"Ret":0}} 和 {"ret":0,"rid":65,"ID":2,"data":{"Ret":0}}
26) 控制指定ID窗口播放器,举例:
Type可以是这些值:Pause,Play,Stop,StopAsync,Next,Prev,Clear,TogglePause
请求:{"req":"VLC_Control","rid":66,"para":[{"ID":1,"Type":"Pause"},{"ID":2,"Type":"Play"}]}
分别返回:{"ret":0,"rid":66,"ID":1,"data":{"Ret":0}} 和 {"ret":0,"rid":66,"ID":2,"data":{"Ret":0}}
27) 指定ID窗口移除多媒体内容,举例:
ItemId是当前已存在的序号
请求:{"req":"VLC_RemoveItem","rid":67,"para":[{"ID":1,"ItemId":1},{"ID":2,"ItemId":2}]}
分别返回:{"ret":0,"rid":67,"ID":1,"data":{"Ret":0}} 和 {"ret":0,"rid":67,"ID":2,"data":{"Ret":0}}
28) 指定ID窗口解析选项,举例:
请求:{"req":"VLC_Parse","rid":68,"para":[{"ID":1,"Option":"","Timeout":0},{"ID":2,,"Option":"","Timeout":0}]}
分别返回:{"ret":0,"rid":68,"ID":1,"data":{"Ret":0,"Status":0}} 和 {"ret":0,"rid":68,"ID":2,"data":{"Ret":0,"Status":0}}
29) 取指定ID窗口SubTitle信息,举例:
NameID指定时获取描述信息
请求:{"req":"VLC_GetSubTitle","rid":69,"para":[{"ID":1,"NameID":0},{"ID":2}]}
分别返回:{"ret":0,"rid":69,"ID":1,"data":{"Ret":0,"Spu":1,"SpuNumber":0,"Desc":""}} 和 {"ret":0,"rid":69,"ID":2,"data":{"Ret":0,"Spu":1,"SpuNumber":0}}
30) 设置指定ID窗口SubTitleSpu,举例:
请求:{"req":"VLC_PutSubTitle","rid":70,"para":[{"ID":1,"Spu":0},{"ID":2,"Spu":0}]}
分别返回:{"ret":0,"rid":70,"ID":1,"data":{"Ret":0}} 和 {"ret":0,"rid":70,"ID":2,"data":{"Ret":0}}
31) 取指定ID窗口视频信息,举例:
TrackID指定时获取描述信息
请求:{"req":"VLC_VideoGet","rid":71,"para":[{"ID":1,"TrackID":1},{"ID":2}]}
分别返回:{"ret":0,"rid":71,"ID":1,"data":{"Ret":0,"FullScreent":0,"Width":0,"Height":0,"SubTitle":0,"Track":0,"TrackCount":0,"TeleText":0,"Scale":100,"AspectRatio":"","Crop":"","Desc":""}} 和 {"ret":0,"rid":71,"ID":2,"data":{"Ret":0,"Width":0,"Height":0,"SubTitle":0,"Track":0,"TrackCount":0,"TeleText":0,"Scale":100,"AspectRatio":"","Crop":""}}
32) 设置指定ID窗口视频信息,举例:
需要的才设置 FullScreen设置是否全屏显示,Scale比例 AspectRatio宽高尺寸 SubTitle子标题
请求:{"req":"VLC_VideoPut","rid":72,"para":[{"ID":1,"FullScreen":1,"Scale":100,"AspectRatio":"","SubTitle":0,"TeleText":0,"Track":0},{"ID":2,"FullScreen":0}]}
分别返回:{"ret":0,"rid":72,"data":{"Ret":0}} 和 {"ret":0,"rid":72,"ID":2,"data":{"Ret":0}}
设置充满指定窗口大小显示:{"req":"VLC_VideoPut","rid":72,"para":[{"ID":1,"Scale":0,"AspectRatio":"480:320"}]}
33) 切换指定ID窗口视频全屏,一次只能请求一个分屏窗口,举例:
请求:{"req":"VLC_VideoToggleFullscreen","rid":73,"para":[{"ID":1}]}
分别返回:{"ret":0,"rid":73,"ID":1,"data":{"Ret":0}}
34) 切换指定ID窗口视频图文,举例:
请求:{"req":"VLC_VideoToggleTeletext","rid":74,"para":[{"ID":1},{"ID":2}]}
分别返回:{"ret":0,"rid":74,"ID":1,"data":{"Ret":0}} 和 {"ret":0,"rid":74,"ID":2,"data":{"Ret":0}}
35) 取指定ID窗口字幕信息,举例:
Text指定时获取文字信息 Position指定时获取位置信息
请求:{"req":"VLC_MarqueeGet","rid":75,"para":[{"ID":1,"Text":1,"Position":1},{"ID":2}]}
分别返回:{"ret":0,"rid":75,"ID":1,"data":{"Ret":0,"Color":0,"Opacity":0,"Refresh":0,"Size":0,"Timeout":0,"X":0,"Y":"","Text":"","Position":""}} 和 {"ret":0,"rid":75,"ID":2,"data":{"Ret":0,"Color":0,"Opacity":0,"Refresh":0,"Size":0,"Timeout":0,"X":0,"Y":""}}
36) 设置指定ID窗口字幕信息,举例:
指定的参数,需要的才设置,必须视频开始播放才能设置
Text 文字内容
Opacity 透明度 0-256 0完全透明 256完全不透明
Position 显示位置有center left right top bottom top-left top-right bottom-left bottom-right 不指定时由X和Y坐标决定
X 和 Y分别指定文字开始坐标
Timeout 超时
Color 颜色 可用长整型(COLORREF),也可以用#000000这样的颜色值
Size 字体大小
请求:{"req":"VLC_MarqueePut","rid":76,"para":[{"ID":1,"Text":"Hello","Position":"TOP","Timeout":0,"Color":"16777215","Opacity":128,"Refresh":1,"Size":50,"X":50,"Y":50},{"ID":2,"Opacity":256}]}
分别返回:{"ret":0,"rid":76,"ID":1,"data":{"Ret":0}} 和 {"ret":0,"rid":76,"ID":2,"data":{"Ret":0}}
37) 控制指定ID窗口字幕,举例:
请求:{"req":"VLC_MarqueeControl","rid":77,"para":[{"ID":1,"Enable":1},{"ID":2,"Enable":0}]}
分别返回:{"ret":0,"rid":77,"ID":1,"data":{"Ret":0}} 和 {"ret":0,"rid":77,"ID":2,"data":{"Ret":0}}
38) 指定ID窗口帧速控制工具,举例:
Mode为空时禁用,取值有blend bob discard linear mean x yadif yadif2x phosphor ivtc auto
请求:{"req":"VLC_DeinterlaceControl","rid":78,"para":[{"ID":1,"Mode":"my_mode"},{"ID":2,"Mode":""}]}
分别返回:{"ret":0,"rid":78,"ID":1,"data":{"Ret":0}} 和 {"ret":0,"rid":78,"ID":2,"data":{"Ret":0}}
39) 动态改变分屏数量或播放内容
ShowType指定分屏数量,如果不变就不设置
Play重新指定播放内容:Uri中如果有特殊字符= & 双引号或中文等,需要用URL编码处理后传递 Uri如非本地全路径,默认使用中间件程序Data子目录作为根目录使用
请求范例1:{"req":"VLC_ChangePlay","rid":79,"para":{"ShowType":2}}
请求范例2:{"req":"VLC_ChangePlay","rid":79,"para":{"Play":[{"ID":1,"Uri":"rtsp://wzh:test123456@192.168.1.8:554/h264/ch1/main/av_stream","Name":"BrowserApplet1","Option":":rtsp-tcp"},{"ID":2,"Uri":"http://www.yuanmaster.com/Files/RTSP.mp4","Name":"BrowserApplet2","Option":":file-caching=300"}]}}
请求范例3:{"req":"VLC_ChangePlay","rid":79,"para":{"ShowType":3,"Play":[{"ID":1,"Uri":"rtsp://wzh:test123456@192.168.1.8:554/h264/ch1/main/av_stream","Name":"BrowserApplet1","Option":":rtsp-tcp :network-caching=300"},{"ID":2,"Uri":"http://www.yuanmaster.com/Files/RTSP.mp4","Name":"BrowserApplet2","Option":":file-caching=400"},{"ID":3,"Uri":"rtsp://wzh:test123456@192.168.1.8:554/h264/ch1/main/av_stream","Name":"BrowserApplet3","Option":":rtsp-tcp"}]}}
分别返回:{"ret":0,"rid":80,"data":{"Ret":0,"Play":[]}}
40) 设置当前焦点播放窗口
ID是当前播放窗口序号,ID是从1开始,需要确保不越界
{"req":"VLC_SetSelect","rid":80,"para":{"ID":2}}
返回:{"ret":0,"rid":80,"ID":2,"data":{"Ret":1}}
41) 获取当前焦点播放窗口序号
{"req":"VLC_GetSelect","rid":81,"para":{}}
返回:{"ret":0,"rid":81,"ID":2,"data":{"Ret":1}}
ID为当前播放焦点窗口
42) 指定ID窗口截图
Type 指定图像类型,默认4(PNG) 可指定1(BMP,不支持BASE64编码内容)、3(JPG)
Base64指定为1时代表返回BASE64编码的图像内容
AutoDel设置1 Base64为1时生效,自动删临时生成的图片文件,不删除设置0
Count截取图数量,默认截取一张,Delay指定延迟毫秒数开始,Interval多张时间隔毫秒数
FileName 指定截图文件名称,中文等需要先进行UrlEncode编码,可缺省使用默认值
CustomPath 指定截图保存路径,中文等需要先进行UrlEncode编码,不指定时由PathType决定
PathType 指定截图图片保存路径类型,0默认临时目录,1操作系统桌面 2当前登录用户我的图片目录 3中间件数据目录
多窗口播放情况下,只能指定某个窗口截图,不能同时指定多个窗口
请求1:{"req":"VLC_VideoSnapshot","rid":82,"para":[{"ID":1,"Type":3,"PathType":3,"Count":3,"Base64":1,"AutoDel":1,"Delay":1000,"Interval":200}]}
请求2: {"req":"VLC_VideoSnapshot","rid":82,"para":[{"ID":1,"Type":3,"Count":3,"CustomPath":"D:/Zorro","FileName":"TestFileName"}]}
分别返回:{"ret":0,"rid":82,"data":{"Ret":0,"Img":[{"Size":0,"Width":0,"Height":0,"File":""}]}} 和 {"ret":0,"rid":82,"ID":2,"data":{"Ret":0,,"Img":[{"Size":0,"Width":0,"Height":0,"File":""}]}}
43) 设置RTSP流网络方式,HTTP还是TCP
{"req":"VLC_SetRtspTcp","rid":83,"para":{"Tcp":1}}
返回:{"ret":0,"rid":83,"data":{"Ret":1}}
44) 获取RTSP流网络方式,HTTP还是TCP
{"req":"VLC_GetRtspTcp","rid":84,"para":{}}
返回:{"ret":0,"rid":84,"data":{"Tcp":1}}
45) 设置播放内容是否充满窗口
{"req":"VLC_PutFillWnd","rid":85,"para":[{"ID":1,"FillWnd":1},{"ID":2,"FillWnd":0}]}
分别返回:{"ret":0,"rid":85,"ID":1,"data":{"Ret":0}} 和 {"ret":0,"rid":85,"ID":2,"data":{"Ret":0}}
46) 获取播放内容是否充满窗口
{"req":"VLC_GetFillWnd","rid":86,"para":[{"ID":1},{"ID":2}]}
分别返回:{"ret":0,"rid":86,"ID":1,"data":{"Ret":0,"FillWnd":1}} 和 {"ret":0,"rid":86,"ID":2,"data":{"Ret":0,"FillWnd":0}}
47) 获取水印显示信息
{"req":"VLC_GetShowLogo","rid":87,"para":[{"ID":1},{"ID":2}]}
分别返回:{"ret":0,"rid":87,"ID":1,"data":{"Ret":0,"File":"","Position":"","Delay":0,"Repeat":0,"Opacity":0,"X":0,"Y":0,"Enable":0}} 和 {"ret":0,"rid":87,"ID":2,"data":{"Ret":0}}
48) 设置水印显示
ID为窗口序号
File 水印文件路径,如有特殊符号请先进行UrlEncode,为空默认用小程序目录的Logo.png
Position 显示位置有center left right top bottom top-left top-right bottom-left bottom-right,默认undefined未定义,显示位置有坐标X和Y控制
Delay 水印间隔图像时间为毫秒 0 - 60000 默认1000
Repeat 循环 水印动画的循环数量 -1继续(默认) 0关闭
Opacity 透明度 (数值介于 0(完全透明) 与 255(完全不透明,默认)
X 水印X坐标
Y 水印Y坐标
{"req":"VLC_PutLogoShow","rid":88,"para":[{"ID":1,"File":"VLC.png" ,"Delay":20,"Repeat":-1,"Opacity":128,"X":100,"Y":100},{"ID":2,"Position":" center ","Delay":100,"Repeat":-1,"Opacity":256,"X":200,"Y":0}]}
分别返回:{"ret":0,"rid":88,"ID":1,"data":{"Ret":0,"Enable":1}} 和 {"ret":0,"rid":88,"ID":2,"data":{"Ret":0,"Enable":0}}
49) 水印显示控制
ID为窗口序号 Flag为1代表启用,0代表禁用
{"req":"VLC_LogoControl","rid":89,"para":[{"ID":1,"Flag":1},{"ID":2,"Flag":0}]}
分别返回:{"ret":0,"rid":89,"ID":1,"data":{"Ret":0,"Enable":1}} 和 {"ret":0,"rid":89,"ID":2,"data":{"Ret":0,"Enable":0}}
50) 对指定RTSP流录像到文件
Url为RTSP流地址,不指定时取当前焦点窗口流的
File为录像目标文件不指定时自动生成 Second为录制限时时间(秒),0代表由前端指定停止
{"req":"VLC_RecordFile","rid":90,"para":{"Url":"rtsp://wzh:test123456@192.168.1.8:554/h264/ch1/main/av_stream","File":"D:/Zorro/test.mp4","Second":30}}
返回:{"ret":0,"rid":90,"data":{"Ret":0,"PID":1}}
51) 停止录像
传入指定录像时返回的PID
{"req":"VLC_StopRecord","rid":91,"para":{"PID":1}}
File为录像文件路径,Size为录像文件大小
返回:{"ret":0,"rid":91,"data":{"Ret":0,"File":"D:/Zorro/test.mp4","Size":321}}
52) 获取输入源信息
Title为1支持获取标题更多信息,标题中支持获取指定Track的描述
Chapter为1支持获取章节更多信息 章节中可指定TitleID获取TrackCount,再指定ChapterID获得章节描述
{"req":"VLC_GetInputInfo","rid":92,"para":[{"ID":1,"Title":1},{"ID":2,"Chapter":1}]}
分别返回:{"ret":0,"rid":92,"ID":1,"data":{"Ret":0,"InputInfo":{"Status":3,"HasVout":1,"Len":0.0,"Pos":0.0,"Time":9667.0,"Rate":1.0,"Fps":25.000,"Title":{"Count":0,"Track":0,"Desc":""},"Chapter":{}}}}
和 {"ret":0,"rid":92,"ID":2,"data":{"Ret":0,"InputInfo":{"Status":3,"HasVout":1,"Len":117078.0,"Pos":0.075,"Time":8854.0,"Rate":1.0,"Fps":9.982,"Title":{},"Chapter":{"Count":0,"Track":0,"TrackCount":0,"Desc":""}}}}
返回值字段含义:
HasVout:当显示视频时返回1
State:作为枚举给出的输入链的当前状态 0闲 1打开 2缓冲 3播放 4暂停 5停止 6已结束 7错误
Rate:输入速度为float(1.0为正常速度,0.5为半速,2.0为两倍快)
Len:输入文件的长度,以毫秒为单位 返回0的是实时流或剪辑,其长度不能确定
Fps:以秒为单位返回的帧数
Pos:在多媒体流项目中播放位置,[0.0 - 1.0]
Time:以毫秒为单位给出的绝对位置,此属性可用于通过流来查找
53) 设置输入源信息
Pos是位置 Time是时间 Rate是速度 TitleTrack标题轨
{"req":"VLC_PutInputInfo","rid":93,"para":[{"ID":1,"Pos":0.075,"Time":9667.0,"Rate":1,"TitleTrack":0},{"ID":2,"Rate":1}]}
分别返回:{"ret":0,"rid":93,"ID":1,"data":{"Ret":0}} 和 {"ret":0,"rid":93,"ID":2,"data":{"Ret":0}}
54) 操作章节信息
Track 章节跟踪。该属性将整数作为输入值[0-0.65535]
Opt是操作类型,1是前进 2是后退
{"req":"VLC_StatusShow","rid":94,"para":[{"ID":1,"Track":0},{"ID":2,"Opt":1}]}
分别返回:{"ret":0,"rid":94,"ID":1,"data":{"Ret":0}} 和 {"ret":0,"rid":94,"ID":2,"data":{"Ret":0}}
55) 设置状态信息显示
Text为空时或直接无Status节点时代表取消状态显示文字,打开视频播放时,由Config.json中的Status节点配置状态,前端可对状态显示文字进行更改
{"req":"VLC_StatusShow","rid":95,"para":[{"ID":1, "Status":{"Text":""}
},{"ID":2, "Status":{"Text":"播放异常,请检查流地址或数据是否合法!","Color":"#00FF7F","Opacity":255,"Size":16,"Name":"宋体"}
}]}
分别返回:{"ret":0,"rid":95,"ID":1,"data":{"Ret":0}} 和 {"ret":0,"rid":94,"ID":2,"data":{"Ret":0}}
56) 播放失败时(网络错误)尝试恢复设置
Count 尝试次数,大于0有效 Second 尝试间隔秒数,最低1秒
{"req":"VLC_PutErrTry","rid":96,"para":[{"ID":1,"Count":3,"Second":6},{"ID":2,"Count":5,"Second":15}]}
分别返回:{"ret":0,"rid":96,"ID":1,"data":{"Ret":0}} 和 {"ret":0,"rid":96,"ID":2,"data":{"Ret":0}}
60) 设置指定ID窗口下方文字信息,定制功能,举例:
指定的参数,需要的才设置
Text 文字内容,必须参数
Color 颜色 可用长整型(COLORREF),也可以用#000000这样的颜色值,默认白色
Size 字体大小,默认18
请求:{"req":"VLC_CustomText","rid":80,"para":[{"ID":1,"Text":"Hello1","Color":"16777215","Size":50},{"ID":2,"Text":"Hello2"},{"ID":3,"Text":"Hello3"},{"ID":4,"Text":"Hello4"}]}
分别返回:{"ret":0,"rid":80,"data":{"Ret":0}}
5、VLC网页播放小程序接收的通知:
这些通知必须使用Web Socket连接到此小程序实际侦听的端口才能接收到。
A、ActiveX事件:
文档参考:https://wiki.videolan.org/Documentation:WebPlugin
1) vlc is in idle state doing nothing but waiting for a command to be issued 播放器空闲中
{"event":"VLC_MediaPlayerNothingSpeciale","ID":1,"data":{}}
2) vlc is opening an media resource locator (MRL) 正在打开播放源
{"event":"VLC_MediaPlayerOpening","ID":1,"data":{}}
3) vlc is buffering 播放器正在缓存数据 通过VLC_PutBlockFlag设置掩码2可阻止通知,默认不阻止
{"event":"VLC_MediaPlayerBuffering","ID":1,"data":{"cache":0}}
4) vlc is playing a media 正在播放中,第一次WS连接过来会收到此通知,也可以通过调用VLC_GetPlay获得IsPlay是否播放状态
{"event":"VLC_MediaPlayerPlaying","ID":1,"data":{}}
5) vlc is in paused state 播放暂停状态
{"event":"VLC_MediaPlayerPaused","ID":1,"data":{}}
6) vlc is fastforwarding 快进播放
{"event":"VLC_MediaPlayerForward","ID":1,"data":{}}
7) vlc is going backwards 后退播放
{"event":"VLC_MediaPlayerBackward","ID":1,"data":{}}
8) vlc has encountered an error and is unable to continue 出现错误不能继续,前端需捕获处理如执行重新播放等
{"event":"VLC_MediaPlayerEncounteredError","ID":1,"data":{}}
9) vlc has reached the end of current playlist 播放到尾部(如设置了循环播放,会自动从头开始播)
{"event":"VLC_MediaPlayerEndReached","ID":1,"data":{}}
10) time has changed 时间改变 通过VLC_PutBlockFlag设置掩码2可阻止通知,默认不阻止,可通过持续监听此通知判断播放是否正常状态
{"event":"VLC_MediaPlayerTimeChanged","ID":1,"data":{"time":0}}
11) media position has changed 位置改变 通过VLC_PutBlockFlag设置掩码8可阻止通知,默认不阻止
同时返回总长度和当前播放时间
{"event":"VLC_MediaPlayerPositionChanged","ID":1,"data":{"position":0,"length":0,"time":0}}
12) Play stopped 播放停止
{"event":"VLC_MediaPlayerStopped","ID":1,"data":{}}
13) Play stop async done 异步播放停止
{"event":"VLC_MediaPlayerStopAsyncDone","ID":1,"data":{}}
14) media seekable flag has changed (true means media is seekable, false means it is not)
{"event":"VLC_MediaPlayerSeekableChanged","ID":1,"data":{"seekable":0}}
15) media pausable flag has changed (true means media is pauseable, false means it is not)
{"event":"VLC_MediaPlayerPausableChanged","ID":1,"data":{"pausable":0}}
16) media has changed 播放源改变
{"event":"VLC_MediaPlayerMediaChanged","ID":1,"data":{}}
17) chapter has changed (DVD/Blu-ray) 章节已更改(DVD/蓝光)
{"event":"VLC_MediaPlayerChapterChanged","ID":1,"data":{"chapter":0}}
18) the number of video output has changed 视频输出数量发生变化
{"event":"VLC_MediaPlayerVout","ID":1,"data":{"count":0}}
19) audio volume was muted 静音
{"event":"VLC_MediaPlayerMuted","ID":1,"data":{}}
20) audio volume was unmuted 取消静音
{"event":"VLC_MediaPlayerUnmuted","ID":1,"data":{}}
21) audio volume has changed 音量改变
{"event":"VLC_MediaPlayerAudioVolume","ID":1,"data":{"volume":0}}
22) KeyDown 按键按下
{"event":"VLC_KeyDown","ID":1,"data":{"KeyCode":0,"Shift":0}}
23) KeyPress 按键码
{"event":"VLC_KeyPress","ID":1,"data":{"KeyCode":0}}
24) KeyUp 按键弹起
{"event":"VLC_KeyUp","ID":1,"data":{"KeyCode":0,"Shift":0}}
25) MouseMove 鼠标移动通知 通过VLC_PutBlockFlag设置掩码1可阻止通知,默认阻止
{"event":"VLC_MouseMove","ID":1,"data":{"Button":0,"Shift":0,"X":0,"Y":0}}
26) MouseDown 鼠标按下
{"event":"VLC_MouseDown","ID":1,"data":{"Button":0,"Shift":0,"X":0,"Y":0}}
27) MouseUp 鼠标弹起
{"event":"VLC_MouseUp","ID":1,"data":{"Button":0,"Shift":0,"X":0,"Y":0}}
/// 以下几个非ActiveX控件事件通知
28) Selected 选中分屏窗口序号通知
{"event":"VLC_Selected","ID":1,"data":{}}
29) ToggleFullScreen 某个分屏窗口切换全屏通知
{"event":"VLC_ToggleFullScreen","ID":1,"data":{}}
30) 录像结束通知(限时录制时发出)
{"event":"VLC_StopRecord","PID":1,"data":{"Ret":0,"File":"D:/Zorro/test.mp4","Size":321}}
31) 定制图标被点击
CID 标识窗口序号
{"event":"VLC_CustomClicked","CID":1,"data":{}}
B、猿大师支持的事件通知:
1) VLC_FullScreen 播放小程序是否响应了热键全屏
{"event":"VLC_FullScreen","data":{"FullScreen":0}} FullScreen为当前是否全屏标记
2) Wrl_AppletExit 小程序退出通知
{"event":"Wrl_AppletExit","data":{"ID":1}}
6、其它
请求参数的JSON数据包,请确保是UTF-8无签名的编码。
更多接口请求说明,请参考安装目录中的文档TestWrl.txt、SDK包中的“猿大师开发者手册.pdf”及“猿大师中间件安全解决方案.pdf”。