原文转自:http://blog.csdn.net/gsls200808/article/details/25536113
1.用标签
下面这段代码只支持火狐,不支持IE
VLC 测试width="640"
height="480"
id="vlc">
var vlc = document.getElementById("vlc");
var mrl="rtsp://172.16.15.186:554/12345.sdp";
//将地址添加到播放列表
vlc.playlist.add(mrl);
//播放
vlc.playlist.play();
2.同时支持IE和火狐的代码
通过测试发现,IE8.0并不支持js代码中VLC插件的接口,版本1和2都不支持,但是火狐浏览器支持
VLC 测试width="640" height="480" events="True" id="vlc2">
width="640"
height="480"
id="vlc">
var vlc = document.getElementById("vlc");
var mrl="rtsp://172.16.15.186:554/12345.sdp";
//将地址添加到播放列表
vlc.playlist.add(mrl);
//播放
vlc.playlist.play();
3.进一步精简的代码
VLC 测试codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab"
width="640"
height="480"
events="True"
id="vlc2">
pluginspage="http://www.videolan.org"
width="640"
height="480"
src="rtsp://172.16.15.186:554/12345.sdp";
id="vlc">