import { loginUser } from "../../../public/js/url.js"; import { currentEventData } from "./orgApi/getAlarmEventList.js"; import { mqttUrl } from "../../../public/js/url.js"; import { deviceHash } from "../api/moveDeviceWebsocket.js"; var currentVideoPage={};//保存当前页面打开的视频 var currentStation=""; function openMoveDeviceVideo(deviceArr){ var deviceidArr=[]; for(let i=0;i{ var urlArr=[]; for(let i=0;idiv:nth-child(${i+1})`).attr("deviceid",deviceid) } } urlArr.forEach((item,index)=>{ $(`.videoMonitor>div:nth-child(${index+1})`).html(``); }) console.log(urlArr); },1500) } //单独打开视频 function aloneOpenVideo(obj){ let deviceid=obj["deviceid"]; let showname=obj["showname"]; let station=obj["station"]; currentStation=station; let power=0; let url=`./rtc/moveDeviceVideoOne.html?id=${deviceid}&power=${power}&mdDeviceName=${encodeURI(encodeURI(showname))}&station=${encodeURI(encodeURI(station))}&username=${loginUser}`; createVideoOpenData([obj["deviceid"]]) window.open(url,'',"width=1280,height=720,top=0,left=0,status='no',location='no',resizable='no',toolbar='no'"); } //监听iframe过来的数据,改变页面 window.addEventListener('message', function(e) { var data=e.data var cmd=data["cmd"]; var deviceid=data["deviceid"]; if(cmd=="closePage"){ var mdiv= $(`.videoMonitor>div`); for(var i=0;i`) } } } }) function sendCloseVideo(deviceid){ var videoCallObj={ "rtmpflag":0, "camera":1, "rotation":0 } var rtmObj=getRtmData("videoclose",JSON.stringify(videoCallObj),[deviceid]); //发送开启视频的指令 sendMqttData(rtmObj); } export { openMoveDeviceVideo, aloneOpenVideo }