| | |
| | | var url = null; |
| | | var videoData = null; |
| | | var playData =null; |
| | | var videoList = null; |
| | | var playData = null; |
| | | var data = { |
| | | "interfaceId": "5604", |
| | | "tokenAuth": "", |
| | | "sign": "10003", |
| | | "outId": "10003", |
| | | "outId": "56041", |
| | | "reqDateTime": new Date(), |
| | | "data": { |
| | | "deptId": "" |
| | |
| | | var data1 = { |
| | | "interfaceId": "5605", |
| | | "tokenAuth": "", |
| | | "sign": "10003", |
| | | "outId": "10003", |
| | | "outId": "56051", |
| | | "reqDateTime": new Date(), |
| | | "data": { |
| | | "id": "", |
| | |
| | | } |
| | | |
| | | function getVideoList() { |
| | | console.log(JSON.stringify(data.data)) |
| | | //发送请求获取视频设备 |
| | | mui.ajax(url, { |
| | | type: "POST", |
| | |
| | | data: JSON.stringify(data), |
| | | success: function(result) { |
| | | if (result.code == "0000") { |
| | | videoData = result.data; |
| | | console.log(JSON.stringify(videoData)) |
| | | videoList = result.data; |
| | | renderVideo(); |
| | | } else { |
| | | renderVideo(); |
| | | mui.alert(result.msg, '提示', ["确定"], function() {}, "div"); |
| | | |
| | | } |
| | | }, |
| | | error: function() { |
| | |
| | | mui.alert('系统繁忙,请重试!', '提示', ["确定"], function() {}, "div"); |
| | | } |
| | | }) |
| | | // videoList = [{ |
| | | // "id": "45", |
| | | // "name": "东图习多", |
| | | // "status": "01", |
| | | // "playType": "id ea", |
| | | // "type": "02" |
| | | // }, |
| | | // { |
| | | // "id": "52", |
| | | // "name": "老出亲事先", |
| | | // "status": "02", |
| | | // "playType": "Ut", |
| | | // "type": "01" |
| | | // }, |
| | | // { |
| | | // "id": "70", |
| | | // "name": "解领文确团离照", |
| | | // "status": "02", |
| | | // "playType": "nisi nostrud", |
| | | // "type": "02" |
| | | // }, |
| | | // { |
| | | // "id": "13", |
| | | // "name": "因局员", |
| | | // "status": "01", |
| | | // "playType": "ex labore esse", |
| | | // "type": "01" |
| | | // } |
| | | // ] |
| | | } |
| | | |
| | | //渲染视频监控设备 |
| | | function renderVideo() { |
| | | var html = ''; |
| | | if (videoData) { |
| | | var videoList = videoData.data; |
| | | if (videoList && videoList.length > 0) { |
| | | $.each(videoList, function(index, item) { |
| | | if (index % 3 == 0) { |
| | | html += |
| | | '<li><a onclick="getVideo('+item.id,item.playType+')" class="con" style="background-image: url(images/icons/g-i15.png);">'; |
| | | } |
| | | if (index % 3 == 1) { |
| | | html += |
| | | '<li><a onclick="getVideo('+item.id,item.playType+')" class="con" style="background-image: url(images/icons/g-i16.png);">'; |
| | | } |
| | | if (index % 3 == 2) { |
| | | html += |
| | | '<li><a onclick="getVideo('+item.id,item.playType+')" class="con" style="background-image: url(images/icons/g-i17.png);">'; |
| | | } |
| | | if (item.type = '02') { |
| | | html += |
| | | '<div class="left"><div class="icon"><img src="images/icons/g-i13.png" alt=""></div><div class="name">' + |
| | | item.name + ' (球机)</div></div>'; |
| | | } |
| | | if (item.type == '01') { |
| | | html += |
| | | '<div class="left"><div class="icon"><img src="images/icons/g-i14.png" alt=""></div><div class="name">' + |
| | | item.name + ' (枪机)</div></div>'; |
| | | } |
| | | if (videoList && videoList.length > 0) { |
| | | $.each(videoList, function(index, item) { |
| | | if (index % 3 == 0) { |
| | | html += |
| | | '<li><a onclick="getVideo(\'' + item.id + '\',\'' + item.playType + |
| | | '\')" class="con" style="background-image: url(images/icons/g-i15.png);">'; |
| | | }else if (index % 3 == 1) { |
| | | html += |
| | | '<li><a onclick="getVideo(\'' + item.id + '\',\'' + item.playType + |
| | | '\')" class="con" style="background-image: url(images/icons/g-i16.png);">'; |
| | | }else if (index % 3 == 2) { |
| | | html += |
| | | '<li><a onclick="getVideo(\'' + item.id + '\',\'' + item.playType + |
| | | '\')" class="con" style="background-image: url(images/icons/g-i17.png);">'; |
| | | } |
| | | if (item.type == '01') { |
| | | html +='<div class="left"><div class="icon"><img src="images/icons/g-i14.png" alt=""></div><div class="name">' + |
| | | item.name + ' (枪机)</div></div>'; |
| | | |
| | | html += '<div class="right"><span class="mui-icon mui-icon-forward"></span></div></a></li>'; |
| | | }) |
| | | } else { |
| | | html += '<li><a class="con" style="background-image: url(images/icons/g-i15.png);"><span>暂无相关设备</span></a></li>'; |
| | | } |
| | | }else{ |
| | | html += '<li><a class="con" style="background-image: url(images/icons/g-i15.png);"><span>暂无相关设备</span></a></li>'; |
| | | }else if (item.type == '02') { |
| | | html += '<div class="left"><div class="icon"><img src="images/icons/g-i13.png" alt=""></div><div class="name">' + |
| | | item.name + ' (球机)</div></div>'; |
| | | |
| | | } |
| | | |
| | | html += '<div class="right"><span class="mui-icon mui-icon-forward"></span></div></a></li>'; |
| | | }) |
| | | } else { |
| | | html += |
| | | '<li><a class="con" style="background-image: url(images/icons/g-i15.png);text-align: center;font-size: 20px;color:#dd524d""><span>暂无相关设备</span></a></li>'; |
| | | } |
| | | $("#recordList").html(html); |
| | | } |
| | | |
| | | |
| | | function getVideo(cameraId,playType){ |
| | | function getVideo(cameraId, playType) { |
| | | data1.data.id = cameraId; |
| | | data1.data.playType = playType; |
| | | |
| | | console.log(JSON.stringify(data1.data)) |
| | | //发送请求获取视频设备 |
| | | mui.ajax(url, { |
| | | type: "POST", |
| | |
| | | console.log(JSON.stringify(playData)) |
| | | toVideo(playData.playAddr); |
| | | } else { |
| | | toVideo(''); |
| | | // toVideo("http://player.alicdn.com/video/aliyunmedia.mp4"); |
| | | toVideo('') |
| | | mui.alert(result.msg, '提示', ["确定"], function() {}, "div"); |
| | | } |
| | | }, |
| | |
| | | }) |
| | | } |
| | | |
| | | function toVideo(playAddr){ |
| | | function toVideo(playAddr) { |
| | | var html = ''; |
| | | html += '<video src="'+playAddr+'" poster="images/pos1.png" class="video" webkit-playsinline="true" playsinline="true" controls></video>' |
| | | html += '<video src="' + playAddr + |
| | | '" poster="images/pos1.png" class="video" webkit-playsinline="true" playsinline="true" controls></video>' |
| | | $("#toVideo").html(html); |
| | | } |
| | | |