欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

VLC Web Plugin在Firefox中不支持js的API VLCFireFox 

程序员文章站 2022-07-06 19:26:22
...
Firefox版本:40.0.2
VLC Web Plugin版本:2.2.4
html代码:
[size=xx-small] <object id="vlc_instance1" class="single-vlc-size"
    classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921"
    codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab">
        <param name="mrl" value=""></param>
        <param name="autoplay" value="true"></param>
        <param name="showdisplay" value="true" />
        <embed type="application/x-vlc-plugin"
            pluginspage="http://www.videolan.org" class="single-vlc-size" id="vlc_instance" ></embed>
</object>
[/size]
js代码:
var mrl = "rtsp://admin:admin@192.168.0.220:554/cam/realmonitor?channel=1&amp;subtype=0";

if (monitor.isInsalledFFVLC()) {
    console.log("Firefox VLC Plugin Insalled");
}
if (monitor.isInsalledIEVLC()) {
    console.log("IE VLC Plugin Insalled");
}

var vlc = document.getElementById("vlc_instance");
vlc.playlist.items.clear();
itemId = vlc.playlist.add(mrl);
vlc.playlist.playItem(itemId);
错误:
TypeError: vlc.playlist is undefined
补充:
1、同样的代码放到IE 11上可正常播放视频;
2、如果不使用js方式,而是把mrl直接写在html代码中自动播放视频,是可以正常播放的;
相关标签: VLC FireFox