接着我的上一篇文章vlc连接方法,继续讨论一些除了连接工作以外其他方法
- 判断是否安装了vlc插件方法
//适用于IE6/7/8/9/10/11浏览器,并且安装有vlc插件,则返回true;
function isInsalledIEVLC() {
var vlcObj = null;
var vlcInstalled = false;
try {
vlcObj = new ActiveXObject("VideoLAN.Vlcplugin.2");
if (vlcObj != null) {
vlcInstalled = true
}
} catch (e) {
vlcInstalled = false;
}
return vlcInstalled;
}
- 判断是不是IE浏览器
function isIE()//判断浏览器类型
{
if(!!window.ActiveXObject || "ActiveXObject" in window)
return true;
else
return false;
}
- 判断系统是32位还是64位
function getPlatform() {
var agent = navigator.platform.toLowerCase();
if (agent.indexOf("win64") >= 0 || agent.indexOf("wow64") >= 0) {
return "win64";
} else if (agent.indexOf("win32") >= 0 || agent.indexOf("wow32") >= 0) {
return "win32";
}
}
- 关闭视频
let video = document.getElementById('vlcId');
video.playlist.stop();
video.playlist.items.clear();
- 播放视频
let video = document.getElementById('vlcId');
video .playlist.play();
- 暂停播放
let video = document.getElementById('vlcId');
video.playlist.pause();
- 快进10s
let video = document.getElementById('vlcId');
video.input.time += 10000;
- 快退10s
let video = document.getElementById('vlcId');
video.input.time -= 10000;
- 绑定倍速
let video = document.getElementById('vlcId');
video.input.rate = 1;