demo.js
1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
var OpenFileDlgType = 0;
//当前下载的文件名称
var downloadFileName="";
//插件加载完毕后,会执行初始化化操作
$(function () {
WebVideoCtrl.insertPluginObject("divPlugin",500,300);
//初始化插件
WebVideoCtrl.initPlugin(function () {
//设置视频窗口的显示[1:1x1;2:2*2;3:3*3;4:4*4]
var num = 1;
//设置窗口分割数
WebVideoCtrl.setSplitNum(num);
//设置双击可全屏功能
WebVideoCtrl.enablePreviewDBClickFullSreen(true);
}
);
//alert("模板解析事件");
$.ajax({
type : "GET",
url : "/skboot/v1/sys/video/getVideoIntegrateInfo",
success : function(obj) {
var result = obj.result;
var ip = result.ip;
var port = result.port;
var username = result.username;
var password = result.password;
//调用登陆逻辑
autoLogin(ip,port,username,password,0);
}
});
});
//自动登录
function autoLogin(ip,port,username,password,protocol)
{
//判断当前设备是否已经登录
var ret = WebVideoCtrl.login(ip,port,username,password,0);
if(ret!=0)
{
alert("视频服务登录异常: "+ret);
return;
}
}
function showVideo(channelNum){
var channelVal = $("#channelNum").val();
WebVideoCtrl.connectRealVideo(channelVal,1);
}