猿大师在Chrome用VLC播放RTSP小程序多路时设置播放源方法

李不白

如果不满足单一播放,实现多路同时播放可以在HTML代码中做如下设置:

<iframe name="VLCApplet" id="VLCApplet" src="VLCApplet3.html" frameborder="0" align="left" width="550" height="540" scrolling="no>
        <param ID="2" Play="http://www.yuanmaster.com/DAHUARTSP.mp4" />
        <param ID="3" Play="rtsp://wzh:test123456@192.168.1.8:554/h264/ch1/main/av_stream" Caching="500" />
    </iframe>

或者直接用

<div id="VLCApplet" class="VLCApplet"
<param ID="2" Play="http://www.yuanmaster.com/DAHUARTSP.mp4" />
        <param ID="3" Play="rtsp://wzh:test123456@192.168.1.8:554/h264/ch1/main/av_stream" Caching="500" />
</div>

其中param指定具体的播放源,ID为窗口序号,第一个窗口的播放源已经在启动播放的JSON包中配置,这里就无需再配置。Caching是指定缓存时间,控制播放延迟效果的关键参数,如在这里设置了,那么Config.json中的配置就无效。如果在HTML网页中不方便配置多源,可在启动播放窗口后,新建一个WS连接到启动后的播放小程序侦听端口,再调用以下指令指定播放源:
动态改变分屏数量或播放内容
ShowType指定分屏数量,如果不变就不设置
Play重新指定播放内容

请求范例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.zorrosoft.com/Files/PluginOKBrowserApplet.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.zorrosoft.com/Files/PluginOKBrowserApplet.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":[]}}
阅读 180
10 声望
0 粉丝
0 条评论
你知道吗?

10 声望
0 粉丝
宣传栏