From 2df906a447195f9786dd468512ea895d6cc18532 Mon Sep 17 00:00:00 2001 From: YYC <1833023622@qq.com> Date: 星期四, 15 五月 2025 14:53:54 +0800 Subject: [PATCH] APP3.5开发 --- igds-app/js/admin/security-video.js | 142 +++++++++++++++++++++++++++++------------------ 1 files changed, 88 insertions(+), 54 deletions(-) diff --git a/igds-app/js/admin/security-video.js b/igds-app/js/admin/security-video.js index 8e873a8..e24ad2f 100644 --- a/igds-app/js/admin/security-video.js +++ b/igds-app/js/admin/security-video.js @@ -1,11 +1,10 @@ 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": "" @@ -14,8 +13,7 @@ var data1 = { "interfaceId": "5605", "tokenAuth": "", - "sign": "10003", - "outId": "10003", + "outId": "56051", "reqDateTime": new Date(), "data": { "id": "", @@ -30,13 +28,14 @@ data.tokenAuth = user.tokenAuth; data1.tokenAuth = user.tokenAuth; data.data.deptId = selectDeptId; - url = user.url + "/api-phone/v35/gateway"; + url = user.url + "/api/phone/v35/gateway"; getVideoList(); } function getVideoList() { + console.log(JSON.stringify(data.data)) //鍙戦�佽姹傝幏鍙栬棰戣澶� mui.ajax(url, { type: "POST", @@ -46,13 +45,11 @@ 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() { @@ -60,54 +57,79 @@ 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": "瑙i鏂囩‘鍥㈢鐓�", + // "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", @@ -118,10 +140,13 @@ success: function(result) { if (result.code == "0000") { playData = result.data; - console.log(JSON.stringify(playData)) - toVideo(playData.playAddr); + // toVideo(playData.playAddr); + // toVideo("http://player.alicdn.com/video/aliyunmedia.mp4"); + toVideo("http://192.168.1.62:8889/zlm/rtp/gb_play_41010200492000000001_34020000001310000001.flv"); + } else { - toVideo(''); + toVideo("http://192.168.1.62:8889/zlm/rtp/gb_play_41010200492000000001_34020000001310000001.flv"); + // toVideo('') mui.alert(result.msg, '鎻愮ず', ["纭畾"], function() {}, "div"); } }, @@ -132,14 +157,23 @@ }) } -function toVideo(playAddr){ - var html = ''; - html += '<video src="'+playAddr+'" poster="images/pos1.png" class="video" webkit-playsinline="true" playsinline="true" controls></video>' - $("#toVideo").html(html); -} +// function toVideo(playAddr) { +// var html = ''; +// html += '<video id="mainvideo" src="' + playAddr + +// '" poster="images/pos1.png" class="video" webkit-playsinline="true" playsinline="true" autoplay controls></video>' +// $("#toVideo").html(html); +// } +function toVideo(playAddr) { + var html = ""; + //鍏抽棴杞湀绛夊緟妗� + html = '<easy-player id="easyPlayer" video-url="' + playAddr + + '" live="true" show-custom-button="true" auto-play="true" muted="true"></easy-player>'; + $('#toVideo').html(html); +} + mui('.mui-scroll-wrapper').scroll({ - indicators: false, //鏄惁鏄剧ず婊氬姩鏉� + indicators: true, //鏄惁鏄剧ず婊氬姩鏉� deceleration: 0.0006, //闃诲凹绯绘暟,绯绘暟瓒婂皬婊戝姩瓒婄伒鏁� bounce: false, //鏄惁鍚敤鍥炲脊 deceleration: 0.0005 //flick 鍑忛�熺郴鏁帮紝绯绘暟瓒婂ぇ锛屾粴鍔ㄩ�熷害瓒婃參锛屾粴鍔ㄨ窛绂昏秺灏忥紝榛樿鍊�0.0006 -- Gitblit v1.9.3