You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
146 lines
4.1 KiB
146 lines
4.1 KiB
<html> |
|
<head> |
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
|
<title>视频播放</title> |
|
<style> |
|
body { |
|
margin: 0px; |
|
overflow: hidden |
|
} |
|
</style> |
|
<script type="text/javascript" src="jquery-1.10.2.min.js"></script> |
|
<script type="text/javascript" src="HiMsg.js"></script> |
|
|
|
<script type="text/javascript"> |
|
var GetInstanceCallback; |
|
|
|
function GetUrlParam(paraName) { |
|
var url = window.document.location.href.toString(); |
|
var arrObj = url.split("?"); |
|
if (arrObj.length > 1) { |
|
var arrPara = arrObj[1].split("&"); |
|
var arr; |
|
for (var i = 0; i < arrPara.length; i++) { |
|
arr = arrPara[i].split("="); |
|
if (arr != null && arr[0] == paraName) { |
|
return arr[1]; |
|
} |
|
} |
|
return ""; |
|
} |
|
else { |
|
return ""; |
|
} |
|
} |
|
|
|
function playFourVideo(params) { |
|
var videolist = params.split(";"); |
|
commonVideoActiveX.setLayout(2); |
|
var videonum = videolist.length > 4 ? 4 : videolist.length; |
|
for(var i = 0; i< videonum; i++) { |
|
commonVideoActiveX.SetFocus(i+1); |
|
var videoinfo = (videolist[i]|| '').split(","); |
|
if (videoinfo.length != 2) { |
|
continue; |
|
} |
|
var cameraid = videoinfo[0]; |
|
if (cameraid != null) { |
|
commonVideoActiveX.Play(cameraid, 1); |
|
} |
|
var preset = videoinfo[1]; |
|
if (preset != null && preset != 'null') { |
|
commonVideoActiveX.PTZGotoPreset(preset); |
|
} |
|
} |
|
} |
|
function stopPlayFourVideo() { |
|
for(var i = 1; i<=4; i++) { |
|
commonVideoActiveX.SetFocus(i); |
|
commonVideoActiveX.Stop(); |
|
} |
|
} |
|
|
|
//播放单个视频 |
|
function playOne(cameraid) { |
|
commonVideoActiveX.Play(cameraid, 1); |
|
} |
|
|
|
function login(initpam, callback) { |
|
GetInstanceCallback = callback; |
|
if (typeof initpam == 'string') { |
|
commonVideoActiveX.GetInstance(initpam); |
|
} else { |
|
try { |
|
commonVideoActiveX.GetInstance(initpam.strURL); |
|
} catch (e) { |
|
// alert('请安装视频控件!'); |
|
} |
|
} |
|
} |
|
|
|
function initMDSParam() { |
|
var url = "/HiatmpPro/scs/common/getParams?paramcode=" + "COMM_VIDEO_QUERY_LOCATION"; |
|
$.ajax({ |
|
url: url, |
|
type: 'get', |
|
dataType: 'json', |
|
cache: false, |
|
success: function (data) { |
|
var params = data.params; |
|
var paramvalue = params[0].paramvalue; |
|
var initParam = { |
|
strIndex: 1,//平台唯一 |
|
nCmsType: 12, //平台类型 |
|
strURL: paramvalue |
|
} |
|
login(initParam, function (params) { |
|
if (params == 'success') { |
|
setInterval(getTouPingMsg,1000); |
|
} else { |
|
alert('初始化失败'); |
|
} |
|
}); |
|
} |
|
}); |
|
} |
|
function getTouPingMsg(){ |
|
var url = "/HiatmpPro/scs/jcbj/getTouPingMsg"; |
|
$.ajax({ |
|
url: url, |
|
type: 'get', |
|
dataType: 'json', |
|
cache: false, |
|
success: function (data) { |
|
if(data.result) { |
|
var msg = data.msgbody; |
|
if(msg != null && msg != '') { |
|
stopPlayFourVideo(); |
|
playFourVideo(msg); |
|
} |
|
} |
|
} |
|
}); |
|
} |
|
</script> |
|
<script language="javascript" FOR="commonVideoActiveX" EVENT="OnGetInstance(lIndex)"> |
|
GetInstanceCallback.call(this, 'success'); |
|
</script> |
|
|
|
<script language="javascript" FOR="commonVideoActiveX" EVENT="OnGetInstanceFailed(lIndex,error)"> |
|
GetInstanceCallback.call(this, 'false'); |
|
</script> |
|
|
|
<script language="javascript" FOR="commonVideoActiveX" EVENT="OnGetInstance()"> |
|
GetInstanceCallback.call(this, 'success'); |
|
</script> |
|
|
|
<script language="javascript" FOR="commonVideoActiveX" EVENT="OnGetInstanceFailedEx(error)"> |
|
GetInstanceCallback.call(this, 'false'); |
|
</script> |
|
</head> |
|
<body scroll="no" onload="this.initMDSParam()"> |
|
<object id="commonVideoActiveX" classid="clsid:A8B6BBF3-DA78-4BCB-ABAB-FB0410A463E4" width=100% height=99% |
|
codebase="/CommonCMSOCX.cab#version=1,0,0,1729" VIEWASTEXT> |
|
</object> |
|
</body> |
|
</html>
|
|
|