(this.webpackJsonp=this.webpackJsonp||[]).push([["w41m"],{w41m:function(e,t,o){"use strict";!function(t,o){"object"==typeof e&&"object"==typeof e.exports?e.exports=t.document?o(t,!0):function(e){if(!e.document)throw new Error("EZUIPlayer requires a window with a document");return o(e)}:o(t)}("undefined"!=typeof window?window:void 0,function(e,t){function o(e,t){for(var o=document.getElementsByTagName("head")[0].getElementsByTagName("script"),a=!1,i=0;i<o.length;i++)o[i].getAttribute("src")==e&&(a=!0,t());if(!a){var n=document.createElement("script");n.setAttribute("src",e),n.onload=t,document.getElementsByTagName("head")[0].appendChild(n)}}function a(e,t,o,a,i,n){var s=e,l=new XMLHttpRequest;l.onreadystatechange=function(){if(4==l.readyState&&200==l.status){var e=JSON.parse(l.responseText);i(e)}},l.open(t,s,!0);var c=new FormData;for(var r in o)c.append(r,o[r]);l.send(c)}var i={EZUIKitPlayer:void 0,EZUIKitTalk:void 0,opt:{apiDomain:"https://open.ys7.com/api/lapp/live/talk/url",filePath:"https://open.ys7.com/assets/ezuikit_v2.6.4",accessToken:"",url:"",deviceSerial:"",channelNo:"",id:"",talkLink:"",rtcUrl:"",ttsUrl:"",stream:"",isReliesReady:!1,template:"simple",plugin:[],audio:1,autoplay:1,videoLoading:!1},state:{countTimer:void 0,recodeTime:0,recodeTimer:void 0,recodeTime:0,fetchDefaultList:!1,page:0,pageSize:5},handleTalkSuccess:function(){},handleTalkError:function(){}},n="https://open.ys7.com",s=n,l=function(t){var l=this;this.opt={id:t.id,apiDomain:n+"/api/lapp/live/talk/url",filePath:s+"/assets/ezuikit_v2.6.4",accessToken:"",url:"",deviceSerial:"",channelNo:"",talkLink:"",rtcUrl:"",ttsUrl:"",stream:"",isReliesReady:!1,template:"simple",plugin:[],audio:1,autoplay:1,fullScreenStatus:0,bSupporDoubleClickFull:!0,videoLoading:!1},this.params=t,t.id&&(this.opt.id=t.id),t.accessToken&&(this.opt.accessToken=t.accessToken),void 0!==t.audio&&(this.opt.audio=t.audio),void 0!==t.env&&(void 0!==t.env.domain&&(n=t.env.domain,this.opt.apiDomain=n+"/api/lapp/live/talk/url"),void 0!==t.env.filePathDomain&&(s=t.env.filePathDomain,this.opt.filePathDomain=t.env.filePathDomain)),t.url&&(this.opt.url=t.url,this.opt.deviceSerial=t.url.split("/")[3],this.opt.channelNo=t.url.split("/")[4].split(".")[0]),void 0!==t.template&&(this.opt.template=t.template),t.plugin&&(this.opt.plugin=t.plugin),void 0!==t.autoplay&&(this.opt.autoplay=t.autoplay?1:0),void 0!==t.bSupporDoubleClickFull&&(this.opt.bSupporDoubleClickFull=t.bSupporDoubleClickFull),void 0!==t.handleTalkSuccess&&(e.EZUIKit.handleTalkSuccess=t.handleTalkSuccess),void 0!==t.handleTalkError&&(e.EZUIKit.handleTalkError=t.handleTalkError);var c=this.opt.id,r=document.getElementById(c);r.style.fontSize=0,r.style.overflowY="auto",r.style.position="relative";var d=document.createElement("iframe");d.src=function(){switch(l.opt.template){case"simple":var e=n+"/ezopen/h5/iframe?bSupporDoubleClickFull=0&url="+l.opt.url+"&autoplay="+l.opt.autoplay+"&audio="+l.opt.audio+"&accessToken="+t.accessToken+"&templete=0&id="+c;return void 0!==t.controls&&t.controls&&(console.log("typeof",typeof t.controls),t.controls.length>0&&(e+="&controls="+t.controls.join(","))),t.websocketParams&&(e+="&websocketParams="+JSON.stringify(t.websocketParams)),e;case"standard":return n+"/ezopen/h5/iframe?bSupporDoubleClickFull=0&url="+l.opt.url+"&autoplay="+l.opt.autoplay+"&audio="+l.opt.audio+"&accessToken="+t.accessToken+"&templete=1&id="+c;case"security":return n+"/ezopen/h5/iframe_se?bSupporDoubleClickFull=0&url="+l.opt.url+"&autoplay="+l.opt.autoplay+"&audio="+l.opt.audio+"&accessToken="+t.accessToken+"&templete=0&id="+c;default:return n+"/ezopen/h5/iframe?bSupporDoubleClickFull=0&url="+l.opt.url+"&autoplay="+l.opt.autoplay+"&audio="+l.opt.audio+"&accessToken="+t.accessToken+"&templete=0&id="+c}}();var p=document.getElementById(c).offsetHeight,u=document.getElementById(c).offsetWidth;t.height&&(p=parseInt(t.height)),t.width&&(u=parseInt(t.width)),d.width=u,d.height=p,d.id="EZUIKitPlayer-"+c,d.setAttribute("allowfullscreen",!0),d.setAttribute("allow","autoplay"),d.setAttribute("frameborder",0),r.appendChild(d);o(l.opt.filePath+"/js/jquery.js",function(){o("https://open.ys7.com/assets/layer/layer.js",function(){if(g().headerContainer){var s=document.createElement("div");s.setAttribute("class","panel-top");var c=document.createElement("div");if(c.setAttribute("class","contros"),s.appendChild(c),r.insertBefore(s,d),g().capturePictureModule){var p=document.createElement("span");p.innerHTML='<span title="截图"><svg id="capturePicture" title="截图" t="1578882764585" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5958" width="24" height="24"> <path d="M887.296 315.904h-153.6c-51.2 0-68.096-102.4-119.296-102.4H392.704c-34.304 0-51.2 102.4-102.4 102.4h-153.6c-29.696 0-51.2 21.504-51.2 51.2v439.296c0 25.6 21.504 47.104 51.2 47.104h751.104c29.696 0 51.2-21.504 51.2-51.2v-435.2c-0.512-30.208-21.504-51.2-51.712-51.2zM512 768c-115.2 0-204.8-89.6-204.8-200.704s89.6-200.704 204.8-200.704 204.8 89.6 204.8 200.704-93.696 200.704-204.8 200.704z m247.296-354.304c-12.8 0-25.6-12.8-25.6-25.6s12.8-25.6 25.6-25.6 25.6 12.8 25.6 25.6c0 17.408-12.8 25.6-25.6 25.6zM256 264.704c0-8.704-8.704-16.896-16.896-16.896h-51.2c-8.704 0-16.896 8.704-16.896 16.896V281.6H256v-16.896z m256 148.992c-85.504 0-153.6 68.096-153.6 153.6s68.096 153.6 153.6 153.6 153.6-68.096 153.6-153.6-68.096-153.6-153.6-153.6z" fill="#ffffff" p-id="5959"></path></svg></span>',p.onclick=function(){l.capturePicture()},c.appendChild(p)}if(console.log("matchHeaderOpt().saveModule",g().saveModule),g().saveModule){var u=document.createElement("span");u.innerHTML='<span title="开始录像"> <svg id="startSave" t="1578882716693" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3782" width="24" height="24"> <path d="M915.2 729.6l-128-76.8c-25.6-12.8-44.8-32-44.8-51.2V435.2c0-25.6 19.2-38.4 44.8-51.2l128-76.8c25.6-12.8 44.8 0 44.8 19.2V704c0 32-19.2 38.4-44.8 25.6z m-332.8 89.6H96c-51.2 0-89.6-38.4-89.6-89.6V332.8c0-51.2 38.4-89.6 89.6-89.6h486.4c51.2 0 89.6 38.4 89.6 89.6v396.8c0 51.2-38.4 89.6-89.6 89.6zM192 364.8c-32 6.4-57.6 32-64 64-12.8 57.6 38.4 115.2 96 102.4 32-6.4 57.6-32 64-70.4 12.8-57.6-38.4-108.8-96-96z m0 0" p-id="3783" fill="#ffffff"></path> </svg></span>',u.onclick=function(){l.startSave(),document.getElementById("startSave").setAttribute("class","icon hide"),document.getElementById("stopSave").setAttribute("class","icon")},c.appendChild(u);var m=document.createElement("span");m.innerHTML='<span title="结束录像"> <svg id="stopSave" t="1578882716693" class="icon hide" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3782" width="24" height="24"> <path d="M915.2 729.6l-128-76.8c-25.6-12.8-44.8-32-44.8-51.2V435.2c0-25.6 19.2-38.4 44.8-51.2l128-76.8c25.6-12.8 44.8 0 44.8 19.2V704c0 32-19.2 38.4-44.8 25.6z m-332.8 89.6H96c-51.2 0-89.6-38.4-89.6-89.6V332.8c0-51.2 38.4-89.6 89.6-89.6h486.4c51.2 0 89.6 38.4 89.6 89.6v396.8c0 51.2-38.4 89.6-89.6 89.6zM192 364.8c-32 6.4-57.6 32-64 64-12.8 57.6 38.4 115.2 96 102.4 32-6.4 57.6-32 64-70.4 12.8-57.6-38.4-108.8-96-96z m0 0" p-id="3783" fill="red"></path> </svg> </span>',m.onclick=function(){l.stopSave(),document.getElementById("stopSave").setAttribute("class","icon hide"),document.getElementById("startSave").setAttribute("class","icon")},c.appendChild(m)}if(g().zoomModule){var h=document.createElement("span");h.innerHTML='<span title="开启电子放大"> <svg id="enableZoom" t="1578882639834" class="icon" viewBox="0 0 1000 1000" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2227" width="24" height="24"> <path d="M830.6119 441.1089c0-193.7756-157.0939-350.8641-350.8775-350.8641S128.8559 247.3333 128.8559 441.1089 285.9508 791.972 479.7344 791.972 830.6119 634.8845 830.6119 441.1089zM483.2821 710.4863c-146.7975 0-265.8187-118.9953-265.8187-265.8088S336.4847 178.8697 483.2821 178.8697s265.8197 118.9953 265.8197 265.8078S630.0796 710.4863 483.2821 710.4863zM770.6031 653.5739l-72.6417 75.9485 141.6917 160.1814 82.0737-90.0739L770.6031 653.5739zM527.5849 267.4727h-88.60655762279428v132.90489048425167H306.0690340253259v88.60292721534799h132.90933675248866v132.9038911617923h88.60655762279428V488.9794719180395h132.90933675248866v-88.60292721534799H527.5849284006089V267.4726535408993z" p-id="2228" fill="#ffffff"></path> </svg></span>',h.onclick=function(){l.enableZoom(),document.getElementById("enableZoom").setAttribute("class","icon hide"),document.getElementById("closeZoom").setAttribute("class","icon")},c.appendChild(h);var f=document.createElement("span");f.innerHTML='<span title="关闭电子放大"> <svg id="closeZoom" t="1578882639834" class="icon hide" viewBox="0 0 1000 1000" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2227" width="24" height="24"> <path d="M830.6119 441.1089c0-193.7756-157.0939-350.8641-350.8775-350.8641S128.8559 247.3333 128.8559 441.1089 285.9508 791.972 479.7344 791.972 830.6119 634.8845 830.6119 441.1089zM483.2821 710.4863c-146.7975 0-265.8187-118.9953-265.8187-265.8088S336.4847 178.8697 483.2821 178.8697s265.8197 118.9953 265.8197 265.8078S630.0796 710.4863 483.2821 710.4863zM770.6031 653.5739l-72.6417 75.9485 141.6917 160.1814 82.0737-90.0739L770.6031 653.5739zM527.5849 267.4727h-88.60655762279428v132.90489048425167H306.0690340253259v88.60292721534799h132.90933675248866v132.9038911617923h88.60655762279428V488.9794719180395h132.90933675248866v-88.60292721534799H527.5849284006089V267.4726535408993z" p-id="2228" fill="red"></path> </svg></span>',f.onclick=function(){l.closeZoom(),document.getElementById("closeZoom").setAttribute("class","icon hide"),document.getElementById("enableZoom").setAttribute("class","icon")},c.appendChild(f)}}function v(){var e={footerContainer:!1,talkModule:!1,broadcastModule:!1,hdModule:!1,fullScreenModule:!1};switch(l.opt.template){case"simple":case"standard":var o;if(t.footer&&t.footer instanceof Array)e={footerContainer:!0,talkModule:-1!==(o=t.footer).indexOf("talk"),broadcastModule:-1!==o.indexOf("broadcast"),hdModule:-1!==o.indexOf("hd"),fullScreenModule:-1!==o.indexOf("fullScreen")};break;case"security":break;case"voice":e={footerContainer:!0,talkModule:!0,broadcastModule:!0,hdModule:!0,fullScreenModule:!0}}return e}function g(){var e={headerContainer:!1,capturePictureModule:!1,saveModule:!1,zoomModule:!1};switch(l.opt.template){case"simple":if(t.header&&t.header instanceof Array){var o=t.header;e={headerContainer:!0,capturePictureModule:-1!==o.indexOf("capturePicture"),saveModule:-1!==o.indexOf("save"),zoomModule:-1!==o.indexOf("zoom")}}break;case"standard":case"security":break;case"voice":e={headerContainer:!0,capturePictureModule:!0,saveModule:!0,zoomModule:!0}}return e}if(v().footerContainer||-1!==l.opt.plugin.indexOf("talk")){var y=l.opt.filePath+"/npm/css/recoder.css",w=l.opt.filePath+"/npm/js/recoder.js",k=l.opt.filePath+"/recorder.js";if(function(e,t){for(var o=document.getElementsByTagName("head")[0].getElementsByTagName("link"),a=!1,i=0;i<o.length;i++)o[i].getAttribute("href")==e&&(a=!0,t());if(!a){var n=document.createElement("link");n.rel="stylesheet",n.type="text/css",n.href=e,n.onload=t,document.getElementsByTagName("head")[0].appendChild(n)}}(y,function(){}),o(w,function(){o(k,function(){})}),-1!==l.opt.plugin.indexOf("talk")||v().talkModule){a(l.opt.apiDomain,"POST",{accessToken:l.opt.accessToken,deviceSerial:l.opt.deviceSerial,channelNo:l.opt.channelNo},0,function(e){if(console.log("data",e),200==e.code){var t=e.data;if(t){var a=t.rtcUrl;-1===a.indexOf("ws")&&(a=a.replace("https","wss").replace("rtcgw","rtcgw-ws")),l.opt.rtcUrl=a,l.opt.ttsUrl="tts://"+t.ttsUrl;var n="talk://"+l.opt.deviceSerial+":0:"+l.opt.channelNo+":cas.ys7.com:6500";if(l.opt.talkLink=l.opt.ttsUrl+"/"+n,l.opt.stream=t.stream,console.log("_this.opt",l.opt),!l.opt.isReliesReady){var s=l.opt.filePath+"/npm/js/adapeter.js",c=l.opt.filePath+"/npm/js/janus.js",r=l.opt.filePath+"/npm/js/tts.js";console.log("加载jquery.js"),o(s,function(){console.log("加载adapeter.js"),o(c,function(){console.log("加载janus.js"),o(r,function(){console.log("加载tts.js"),l.opt.isReliesReady=!0})})})}if(!document.getElementById("audioleft")){var d=document.createElement("div");d.style.display="none",d.id="audioleft",document.body.appendChild(d)}if(!document.getElementById("audioright")){var p=document.createElement("div");p.style.display="none",p.id="audioright",document.body.appendChild(p)}}}i.opt=l.opt})}if(v().footerContainer){var S=document.createElement("div");if(S.setAttribute("class","audio-controls"),r.appendChild(S),v().hdModule||v().fullScreenModule){var b=document.createElement("div");if(b.setAttribute("class","contros"),S.appendChild(b),v().hdModule){var M=document.createElement("span");M.setAttribute("id","video-hd"),M.innerHTML=-1===l.opt.url.indexOf(".hd")?"标清":"高清",M.onclick=function(){if(l.opt.videoLoading)return layer.msg("视频加载中,请稍后"),!1;var e=l.stop();l.opt.videoLoading=!0,e.then(e=>{l.opt.videoLoading=!1,-1===l.opt.url.indexOf(".hd")?(l.opt.url=l.opt.url.replace(".live",".hd.live"),M.innerHTML=-1===l.opt.url.indexOf(".hd")?"标清":"高清"):(l.opt.url=l.opt.url.replace(".hd.live",".live"),M.innerHTML=-1===l.opt.url.indexOf(".hd")?"标清":"高清"),l.play(l.opt.url)}).catch(e=>{console.log("error",e)})},b.appendChild(M)}if(v().fullScreenModule){var E=document.createElement("span");E.setAttribute("class","hide"),E.setAttribute("id","ezuikit-open-sound"),E.setAttribute("title","打开声音"),E.setAttribute("style","vertical-align: top;"),E.innerHTML='<svg t="1590476263239" class="icon" viewBox="0 0 1178 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2273" width="16" height="16"><path d="M665.6 51.2 665.6 51.2c-10.24-30.72-40.96-51.2-71.68-51.2-5.12 0-15.36 0-20.48 5.12l0 0L358.4 153.6 51.2 209.92l0 0C20.48 220.16 0 250.88 0 281.6 0 286.72 0 291.84 0 307.2l0 0 0 409.6 0 0c0 15.36 0 20.48 0 25.6 0 30.72 20.48 61.44 51.2 71.68l0 0L358.4 870.4l97.28 71.68 107.52 76.8 0 0c5.12 5.12 15.36 5.12 25.6 5.12 40.96 0 76.8-35.84 76.8-76.8 0-10.24 0-10.24 0-25.6l0 0L665.6 51.2zM563.2 870.4l-153.6-102.4-307.2-51.2L102.4 307.2l307.2-51.2 153.6-102.4L563.2 870.4z" p-id="2274" fill="#FF0000"></path><path d="M1049.6 537.6l112.64-112.64c20.48-20.48 20.48-56.32 0-76.8-20.48-20.48-56.32-20.48-76.8 0L972.8 460.8l-112.64-112.64c0 0 0 0 0 0-20.48-20.48-56.32-20.48-76.8 0 0 0 0 0 0 0-20.48 20.48-20.48 56.32 0 76.8l112.64 112.64-112.64 112.64c-20.48 20.48-20.48 56.32 0 76.8 20.48 20.48 56.32 20.48 76.8 0L972.8 614.4l112.64 112.64c20.48 20.48 56.32 20.48 76.8 0s20.48-56.32 0-76.8L1049.6 537.6z" p-id="2275" fill="#FF0000"></path></svg>',E.onclick=function(){l.openSound(0),E.setAttribute("class","hide"),T.setAttribute("class","")};var T=document.createElement("span");E.setAttribute("id","ezuikit-close-sound"),T.setAttribute("class","hide"),T.setAttribute("title","关闭声音"),T.setAttribute("style","vertical-align: top;"),T.innerHTML='<svg t="1590414410633" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="20545" width="16" height="16"><path d="M840.533333 98.133333c-17.066667-17.066667-42.666667-17.066667-59.733333 0-17.066667 17.066667-17.066667 42.666667 0 59.733334C883.2 256 938.666667 392.533333 938.666667 533.333333c0 140.8-55.466667 277.333333-157.866667 375.466667-17.066667 17.066667-17.066667 42.666667 0 59.733333 8.533333 8.533333 21.333333 12.8 29.866667 12.8 8.533333 0 21.333333-4.266667 29.866666-12.8 115.2-110.933333 183.466667-268.8 183.466667-435.2 0-166.4-68.266667-324.266667-183.466667-435.2zM571.733333 12.8c-17.066667-8.533333-34.133333-4.266667-46.933333 8.533333L281.6 256H42.666667c-25.6 0-42.666667 17.066667-42.666667 42.666667v426.666666c0 25.6 17.066667 42.666667 42.666667 42.666667h238.933333l243.2 234.666667c8.533333 8.533333 17.066667 12.8 29.866667 12.8 4.266667 0 12.8 0 17.066666-4.266667 17.066667-8.533333 25.6-21.333333 25.6-38.4V51.2c0-17.066667-8.533333-34.133333-25.6-38.4zM512 870.4l-183.466667-179.2c-8.533333-4.266667-17.066667-8.533333-29.866666-8.533333H85.333333V341.333333h213.333334c12.8 0 21.333333-4.266667 29.866666-12.8L512 153.6v716.8z" p-id="20546" fill="#ffffff"></path><path d="M759.466667 349.866667c-12.8-21.333333-38.4-25.6-59.733334-8.533334-21.333333 12.8-25.6 38.4-8.533333 59.733334 21.333333 29.866667 34.133333 76.8 34.133333 123.733333 0 46.933333-12.8 93.866667-34.133333 123.733333-12.8 21.333333-8.533333 46.933333 8.533333 59.733334 8.533333 4.266667 17.066667 8.533333 25.6 8.533333 12.8 0 25.6-4.266667 34.133334-17.066667 34.133333-46.933333 51.2-106.666667 51.2-174.933333 0-68.266667-17.066667-128-51.2-174.933333z" p-id="20547" fill="#ffffff"></path></svg>',T.onclick=function(){l.closeSound(0),E.setAttribute("class",""),T.setAttribute("class","hide")},b.appendChild(E),b.appendChild(T)}if(1==l.opt.audio?T.setAttribute("class",""):(E.setAttribute("class",""),l.closeSound(0)),v().fullScreenModule){var z=document.createElement("span");z.setAttribute("title","全屏"),z.setAttribute("style","vertical-align: top;"),z.innerHTML='<svg id="fullScreen" t="1578020167938" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5035" width="16" height="16"> <path d="M348.373333 625.706667l-128 128-64 64v-128a33.28 33.28 0 0 0-35.413333-35.413334A33.493333 33.493333 0 0 0 85.333333 689.706667v213.333333A33.706667 33.706667 0 0 0 120.96 938.666667h213.333333a35.626667 35.626667 0 0 0 0-71.04h-128l64-64 128-128a35.2 35.2 0 0 0-49.92-49.92zM206.293333 156.373333h128a33.28 33.28 0 0 0 35.413334-35.413333A33.493333 33.493333 0 0 0 334.293333 85.333333H113.706667c-7.04 0-14.08 7.04-21.333334 14.293334a26.026667 26.026667 0 0 0-7.04 21.333333v213.333333a33.493333 33.493333 0 0 0 35.626667 35.413334 33.28 33.28 0 0 0 35.413333-35.413334v-128l192 192a35.2 35.2 0 0 0 49.92-49.92zM903.04 85.333333h-213.333333a33.493333 33.493333 0 0 0-35.413334 35.626667 33.28 33.28 0 0 0 35.413334 35.413333h128l-64 64-128 128a35.2 35.2 0 0 0 49.92 49.92l128-128 64-64v128a35.626667 35.626667 0 0 0 71.04 0v-213.333333A33.706667 33.706667 0 0 0 903.04 85.333333zM903.04 654.293333a33.28 33.28 0 0 0-35.413333 35.413334v128l-64-64-128-128a35.2 35.2 0 0 0-49.92 49.92l128 128 64 64h-128a35.626667 35.626667 0 0 0 0 71.04h213.333333A33.706667 33.706667 0 0 0 938.666667 903.04v-213.333333a33.493333 33.493333 0 0 0-35.626667-35.413334z" p-id="5036" fill="#ffffff"></path></svg>',z.onclick=function(){l.fullScreen()},b.appendChild(z)}}if(v().talkModule){var I=document.createElement("div"),B=document.createElement("div");I.setAttribute("class","ptp-talk off"),I.innerHTML='<span title="对讲"><svg t="1581930496966" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1641" width="16" height="16"> <path d="M715.648 647.872c-30.208-22.336-61.568 39.36-100.992 77.44-39.36 38.08-34.112 31.488-123.392-17.088S311.488 540.224 280 491.648C248.448 443.072 265.472 424.704 265.472 424.704s78.72-62.976 97.152-81.344c18.368-18.368 13.12-30.208 13.12-30.208l-128.64-190.144c-23.616-5.184-64.32 5.12-128.576 57.6C54.208 233.088 30.592 353.856 151.296 575.68c120.768 221.824 347.84 330.752 485.568 374.08 137.856 43.328 228.416-61.696 249.408-103.68 21.056-41.984 13.12-85.312 13.12-85.312S745.856 670.208 715.648 647.872z" p-id="1642" fill="#ffffff"></path> <path d="M715.328 64C580.992 64 472.192 172.864 472.192 307.2s108.8 243.2 243.136 243.2 243.2-108.864 243.2-243.2S849.6 64 715.328 64zM715.328 461.056c-84.992 0-153.856-68.864-153.856-153.856s68.864-153.856 153.856-153.856 153.856 68.928 153.856 153.856S800.32 461.056 715.328 461.056z" p-id="1643" fill="#ffffff"></path> <path d="M777.472 277.376c-18.176 0-32.96-14.784-32.96-33.024 0-8.448 3.136-16.064 8.32-21.888-11.52-5.12-24.128-8-37.568-8-51.2 0-92.672 41.472-92.672 92.736s41.472 92.736 92.672 92.736S808.064 358.4 808.064 307.2c0-13.696-3.072-26.688-8.384-38.4C793.728 274.112 786.048 277.376 777.472 277.376zM715.328 340.928c-18.624 0-33.664-15.104-33.664-33.728 0-18.624 15.04-33.728 33.664-33.728 18.688 0 33.728 15.104 33.728 33.728C749.056 325.824 734.016 340.928 715.328 340.928z" p-id="1644" fill="#ffffff"></path> </svg> </span> <span>开启对讲</span>',I.onclick=function(){if(console.log("EZUIKit.state.countTimer",i.state.countTimer),i.state.countTimer)return e.layer.msg("语音设备正忙,请稍后重试"),!1;O("add",0),console.log("开始对讲,关闭声音"),l.closeSound(0),console.log(l.opt),l.startTalk(),this.setAttribute("class","ptp-talk off hide"),B.setAttribute("class","ptp-talk on")},B.setAttribute("class","ptp-talk on hide"),B.innerHTML='<span title="对讲"> <svg t="1581930496966" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1641" width="16" height="16"> <path d="M715.648 647.872c-30.208-22.336-61.568 39.36-100.992 77.44-39.36 38.08-34.112 31.488-123.392-17.088S311.488 540.224 280 491.648C248.448 443.072 265.472 424.704 265.472 424.704s78.72-62.976 97.152-81.344c18.368-18.368 13.12-30.208 13.12-30.208l-128.64-190.144c-23.616-5.184-64.32 5.12-128.576 57.6C54.208 233.088 30.592 353.856 151.296 575.68c120.768 221.824 347.84 330.752 485.568 374.08 137.856 43.328 228.416-61.696 249.408-103.68 21.056-41.984 13.12-85.312 13.12-85.312S745.856 670.208 715.648 647.872z" p-id="1642" fill="#ff0000"></path> <path d="M715.328 64C580.992 64 472.192 172.864 472.192 307.2s108.8 243.2 243.136 243.2 243.2-108.864 243.2-243.2S849.6 64 715.328 64zM715.328 461.056c-84.992 0-153.856-68.864-153.856-153.856s68.864-153.856 153.856-153.856 153.856 68.928 153.856 153.856S800.32 461.056 715.328 461.056z" p-id="1643" fill="#ff0000"></path> <path d="M777.472 277.376c-18.176 0-32.96-14.784-32.96-33.024 0-8.448 3.136-16.064 8.32-21.888-11.52-5.12-24.128-8-37.568-8-51.2 0-92.672 41.472-92.672 92.736s41.472 92.736 92.672 92.736S808.064 358.4 808.064 307.2c0-13.696-3.072-26.688-8.384-38.4C793.728 274.112 786.048 277.376 777.472 277.376zM715.328 340.928c-18.624 0-33.664-15.104-33.664-33.728 0-18.624 15.04-33.728 33.664-33.728 18.688 0 33.728 15.104 33.728 33.728C749.056 325.824 734.016 340.928 715.328 340.928z" p-id="1644" fill="#ff0000"></path> </svg> </span><span>关闭对讲</span>',B.onclick=function(){console.log(l.opt),l.stopTalk(),O("destory",0),l.openSound(0),this.setAttribute("class","ptp-talk on hide"),I.setAttribute("class","ptp-talk off")},S.appendChild(I),S.appendChild(B)}if(v().broadcastModule){var C=document.createElement("div"),A=document.createElement("div");function x(e){a(n+"/api/lapp/voice/query","POST",{accessToken:l.opt.accessToken,pageStart:e,pageSize:i.state.pageSize,default:i.state.fetchDefaultList?"true":"false"},0,function(t){console.log("data",t),200==t.code&&(function(e){if(console.log("renderVoliceList",e),e&&e.length>0){for(var t=0;t<e.length;t++){var o=document.createElement("li");o.innerHTML="<li class='voice-item' id='voice-item-"+t+"' data-time="+(e[t].duration||20)+" data-url="+e[t].fileUrl+">"+(e[t].voiceName.length>10?e[t].voiceName.substr(0,10)+"...":e[t].voiceName)+"</li>",document.getElementsByClassName("voice-list-ul")[0].append(o),o.onclick=function(e){console.log("点击元素",e.target,e.target.dataset.url);var t=e.target.dataset.url,o=e.target.dataset.time;P(t,o)}}e.length===i.state.pageSize?document.getElementById("voice-list-end").innerHTML="向下滚动加载更多":document.getElementById("voice-list-end").innerHTML="没有更多数据了"}}(t.data),i.state.page=t.page.page,0!=e||0!=t.data.length||i.state.fetchDefaultList||(i.state.fetchDefaultList=!0,x(0)))})}function P(t,o){console.log("播放语音",t,o),a(n+"/api/lapp/voice/send","POST",{accessToken:l.opt.accessToken,deviceSerial:l.opt.deviceSerial,channelNo:l.opt.channelNo,fileUrl:t},0,function(t){console.log("data.data",t.data),200==t.code?O("sub",parseInt(o)):"10001"==t.code?e.layer.msg("未找到当前语音"):e.layer.msg(t.msg||"发送失败,请稍后再试")})}C.setAttribute("class","broadcast off"),A.setAttribute("class","broadcast on hide"),C.innerHTML=' <span title="语音播报"> <svg t="1583561695846" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1126" width="16" height="16"> <path d="M513.82044445 964.38044445c-8.192 0-15.47377778-2.73066667-21.84533334-8.192 0 0-46.42133333-41.87022222-99.21422222-86.47111112-89.20177778-73.728-117.41866667-88.29155555-123.79022222-90.112H35.04355555c-14.56355555 0-26.39644445-11.83288889-26.39644444-27.30666666V271.70133333c0-14.56355555 11.83288889-27.30666667 26.39644444-27.30666666H246.21511111c7.28177778-2.73066667 37.31911111-15.47377778 137.44355556-91.02222222 58.25422222-43.69066667 111.04711111-86.47111111 111.04711111-86.47111112 5.46133333-4.55111111 12.74311111-7.28177778 20.02488889-7.28177778 4.55111111 0 10.01244445 0.91022222 14.56355555 3.6408889 10.92266667 5.46133333 18.20444445 17.29422222 18.20444445 30.03733333v837.40444444c0 12.74311111-7.28177778 25.48622222-19.11466667 30.94755556-5.46133333 1.82044445-10.01244445 2.73066667-14.56355555 2.73066667zM270.79111111 724.992c19.11466667 0 48.24177778 8.192 167.48088889 106.496 16.384 13.65333333 33.67822222 28.21688889 51.88266667 43.69066667l5.46133333 4.55111111V139.71911111l-5.46133333 3.64088889c-22.75555555 17.29422222-44.60088889 34.58844445-65.536 50.06222222C293.54666667 291.72622222 264.41955555 299.008 245.30488889 299.008H82.37511111c-20.02488889 0-21.84533333 12.74311111-21.84533333 26.39644445V694.04444445c0 23.66577778 6.37155555 30.03733333 28.21688889 30.03733333h180.224l1.82044444 0.91022222z m520.64711111 162.01955555c-14.56355555 0-26.39644445-11.83288889-26.39644444-27.30666666 0-11.83288889 8.192-20.02488889 16.384-24.576 112.86755555-67.35644445 182.04444445-191.14666667 182.04444444-324.03911111 0-132.89244445-70.08711111-256.68266667-182.04444444-324.03911111-10.01244445-5.46133333-15.47377778-14.56355555-15.47377778-24.576 0-14.56355555 11.83288889-27.30666667 26.39644445-27.30666667 5.46133333 0 10.01244445 1.82044445 16.384 5.46133333 128.34133333 76.45866667 207.53066667 218.45333333 207.53066666 369.55022222 0 152.00711111-80.09955555 293.09155555-208.44088889 369.55022223-6.37155555 5.46133333-10.92266667 7.28177778-16.384 7.28177777z m-90.112-152.91733333c-14.56355555 0-26.39644445-11.83288889-26.39644444-27.30666667 0-10.01244445 4.55111111-18.20444445 12.74311111-23.66577777 61.89511111-34.58844445 100.12444445-100.12444445 100.12444444-171.12177778 0-70.08711111-37.31911111-134.71288889-96.48355555-170.21155555-8.192-4.55111111-12.74311111-13.65333333-12.74311111-23.66577778 0-14.56355555 11.83288889-27.30666667 26.39644444-27.30666667 4.55111111 0 11.83288889 2.73066667 15.47377778 4.55111111 74.63822222 44.60088889 121.96977778 127.43111111 121.96977778 215.72266667 0 90.112-48.24177778 173.85244445-125.61066667 218.45333333-1.82044445 0-9.10222222 4.55111111-15.47377778 4.55111111z" fill="#ffffff" p-id="1127"></path> </svg></span><span>语音播报</span>',C.onclick=function(){this.setAttribute("class","broadcast off hide"),A.setAttribute("class","broadcast on")},A.innerHTML='<div class="pop-hover"> <div class="pop-hover-content"> <div class="vioce-list" id="voice-list"> <ul class="voice-list-ul"> </ul> <div id="voice-list-end"></div> </div> <div id="voice-custom" style="text-align: center;">自定义语音</div> </div></div><span title="语音播报"> <svg t="1583561695846" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1126" width="16" height="16"> <path d="M513.82044445 964.38044445c-8.192 0-15.47377778-2.73066667-21.84533334-8.192 0 0-46.42133333-41.87022222-99.21422222-86.47111112-89.20177778-73.728-117.41866667-88.29155555-123.79022222-90.112H35.04355555c-14.56355555 0-26.39644445-11.83288889-26.39644444-27.30666666V271.70133333c0-14.56355555 11.83288889-27.30666667 26.39644444-27.30666666H246.21511111c7.28177778-2.73066667 37.31911111-15.47377778 137.44355556-91.02222222 58.25422222-43.69066667 111.04711111-86.47111111 111.04711111-86.47111112 5.46133333-4.55111111 12.74311111-7.28177778 20.02488889-7.28177778 4.55111111 0 10.01244445 0.91022222 14.56355555 3.6408889 10.92266667 5.46133333 18.20444445 17.29422222 18.20444445 30.03733333v837.40444444c0 12.74311111-7.28177778 25.48622222-19.11466667 30.94755556-5.46133333 1.82044445-10.01244445 2.73066667-14.56355555 2.73066667zM270.79111111 724.992c19.11466667 0 48.24177778 8.192 167.48088889 106.496 16.384 13.65333333 33.67822222 28.21688889 51.88266667 43.69066667l5.46133333 4.55111111V139.71911111l-5.46133333 3.64088889c-22.75555555 17.29422222-44.60088889 34.58844445-65.536 50.06222222C293.54666667 291.72622222 264.41955555 299.008 245.30488889 299.008H82.37511111c-20.02488889 0-21.84533333 12.74311111-21.84533333 26.39644445V694.04444445c0 23.66577778 6.37155555 30.03733333 28.21688889 30.03733333h180.224l1.82044444 0.91022222z m520.64711111 162.01955555c-14.56355555 0-26.39644445-11.83288889-26.39644444-27.30666666 0-11.83288889 8.192-20.02488889 16.384-24.576 112.86755555-67.35644445 182.04444445-191.14666667 182.04444444-324.03911111 0-132.89244445-70.08711111-256.68266667-182.04444444-324.03911111-10.01244445-5.46133333-15.47377778-14.56355555-15.47377778-24.576 0-14.56355555 11.83288889-27.30666667 26.39644445-27.30666667 5.46133333 0 10.01244445 1.82044445 16.384 5.46133333 128.34133333 76.45866667 207.53066667 218.45333333 207.53066666 369.55022222 0 152.00711111-80.09955555 293.09155555-208.44088889 369.55022223-6.37155555 5.46133333-10.92266667 7.28177778-16.384 7.28177777z m-90.112-152.91733333c-14.56355555 0-26.39644445-11.83288889-26.39644444-27.30666667 0-10.01244445 4.55111111-18.20444445 12.74311111-23.66577777 61.89511111-34.58844445 100.12444445-100.12444445 100.12444444-171.12177778 0-70.08711111-37.31911111-134.71288889-96.48355555-170.21155555-8.192-4.55111111-12.74311111-13.65333333-12.74311111-23.66577778 0-14.56355555 11.83288889-27.30666667 26.39644444-27.30666667 4.55111111 0 11.83288889 2.73066667 15.47377778 4.55111111 74.63822222 44.60088889 121.96977778 127.43111111 121.96977778 215.72266667 0 90.112-48.24177778 173.85244445-125.61066667 218.45333333-1.82044445 0-9.10222222 4.55111111-15.47377778 4.55111111z" fill="#ff0000" p-id="1127"></path> </svg></span><span>语音播报</span>',A.onclick=function(){this.setAttribute("class","broadcast on hide"),C.setAttribute("class","broadcast off")},S.appendChild(C),S.appendChild(A),document.getElementById("voice-custom").onclick=function(){console.log("显示自定义语音"),H.setAttribute("class","speak off")},x(0);var H=document.createElement("div"),L=document.createElement("div");H.setAttribute("class","speak off hide"),L.setAttribute("class","speak on hide"),H.setAttribute("id","startSpeak"),L.setAttribute("id","stopSpeak"),H.innerHTML='<span title="按住说话"> <svg t="1581994757678" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1639" width="16" height="16"> <path d="M757.059829 393.846154v-52.512821h262.564103v52.512821H757.059829z m-420.102564 481.367521v96.273504h175.042735a8.752137 8.752137 0 0 1 8.752137 8.752137v35.008547a8.752137 8.752137 0 0 1-8.752137 8.752137H109.401709a8.752137 8.752137 0 0 1-8.752136-8.752137v-35.008547a8.752137 8.752137 0 0 1 8.752136-8.752137h175.042735v-96.273504C129.767932 875.213675 4.376068 749.821812 4.376068 595.145299V463.863248a26.25641 26.25641 0 1 1 52.512821 0v113.777778c0 140.174222 113.637744 253.811966 253.811966 253.811965s253.811966-113.637744 253.811966-253.811965V463.863248a26.25641 26.25641 0 1 1 52.51282 0v131.282051c0 154.676513-125.391863 280.068376-280.068376 280.068376z m-26.25641-96.273504c-111.178393 0-201.299145-90.120752-201.299146-201.299145V201.299145C109.401709 90.120752 199.522462 0 310.700855 0s201.299145 90.120752 201.299145 201.299145v376.341881c0 111.178393-90.120752 201.299145-201.299145 201.299145z m691.418803-280.068376H757.059829v-52.512821h245.059829v52.512821z m-17.504273 105.025641H757.059829v-52.512821h227.555556v52.512821z m-17.504274 105.025641H757.059829v-52.512821h210.051282v52.512821z m-8.752137 105.025641H757.059829v-52.512821h201.299145v52.512821z m-17.504273 105.025641H757.059829v-52.512821h183.794872v52.512821z m-26.25641 105.025641H757.059829v-52.512821h157.538462v52.512821z" p-id="1640" fill="#ffffff"></path> </svg></span><span>按住说话</span>',L.innerHTML='<span title="按住说话"><svg t="1581994757678" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1639" width="16" height="16"> <path d="M757.059829 393.846154v-52.512821h262.564103v52.512821H757.059829z m-420.102564 481.367521v96.273504h175.042735a8.752137 8.752137 0 0 1 8.752137 8.752137v35.008547a8.752137 8.752137 0 0 1-8.752137 8.752137H109.401709a8.752137 8.752137 0 0 1-8.752136-8.752137v-35.008547a8.752137 8.752137 0 0 1 8.752136-8.752137h175.042735v-96.273504C129.767932 875.213675 4.376068 749.821812 4.376068 595.145299V463.863248a26.25641 26.25641 0 1 1 52.512821 0v113.777778c0 140.174222 113.637744 253.811966 253.811966 253.811965s253.811966-113.637744 253.811966-253.811965V463.863248a26.25641 26.25641 0 1 1 52.51282 0v131.282051c0 154.676513-125.391863 280.068376-280.068376 280.068376z m-26.25641-96.273504c-111.178393 0-201.299145-90.120752-201.299146-201.299145V201.299145C109.401709 90.120752 199.522462 0 310.700855 0s201.299145 90.120752 201.299145 201.299145v376.341881c0 111.178393-90.120752 201.299145-201.299145 201.299145z m691.418803-280.068376H757.059829v-52.512821h245.059829v52.512821z m-17.504273 105.025641H757.059829v-52.512821h227.555556v52.512821z m-17.504274 105.025641H757.059829v-52.512821h210.051282v52.512821z m-8.752137 105.025641H757.059829v-52.512821h201.299145v52.512821z m-17.504273 105.025641H757.059829v-52.512821h183.794872v52.512821z m-26.25641 105.025641H757.059829v-52.512821h157.538462v52.512821z" p-id="1640" fill="#ff0000"></path></svg></span><span>松开发送</span>',S.appendChild(H),S.appendChild(L),document.getElementById("voice-list").onscroll=function(e){var t=this.scrollHeight;console.log("sum",t,this.scrollTop,document.getElementById("voice-list").clientHeight),t<=this.scrollTop+this.clientHeight&&(console.log("拖动到底,执行加载",i.state.page),x(++i.state.page))};var U,Z=document.createElement("div");Z.setAttribute("class","time-area"),Z.setAttribute("id","time-area"),Z.innerHTML="00:00",S.appendChild(Z),document.getElementById("startSpeak").onmousedown=function(){if(i.state.countTimer)return e.layer.msg("语音设备正忙,请稍后重试"),!1;var t;function o(o){var a=t.createMediaStreamSource(o);U=new e.Recorder(a)}console.log("按住说话"),H.setAttribute("class","speak off hide"),L.setAttribute("class","speak on"),function(){console.log("run init");try{e.AudioContext=e.AudioContext||e.webkitAudioContext,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia,e.URL=e.URL||e.webkitURL,t=new AudioContext,console.log("Audio context set up."),console.log("navigator.getUserMedia "+(navigator.getUserMedia?"available.":"not present!"))}catch(t){console.log("err",t),e.layer.msg("No web audio support in this browser!")}navigator.getUserMedia({audio:!0},o,function(e){console.log("No live audio input: "+e)})}(),O("add",0),setTimeout(function(){i.state.recodeTime=0,U&&U.record()},1e3),i.state.recodeTimer&&clearInterval(i.state.recodeTimer),i.state.recodeTimer=setInterval(function(){i.state.recodeTime>=59?(l.stopTalk(),O("destory",0),this.setAttribute("class","ptp-talk on hide"),I.setAttribute("class","ptp-talk off"),e.layer.msg("不超过1分钟")):i.state.recodeTime=i.state.recodeTime+1},1e3)},document.getElementById("stopSpeak").onmouseup=function(){console.log("松开发送"),L.setAttribute("class","speak on hide"),function(){if(O("destory",0),i.state.recodeTime<1)return e.layer.msg("说话时间过短"),clearInterval(i.state.recodeTimer),!1;clearInterval(i.state.recodeTimer),function(){try{U&&U.stop(),U&&U.exportWAV(function(t){if(console.log("wav_file",t),t.size<1e3)return e.layer.msg("录音失败,请重试"),i.state.recodeTime=0,!1;O("sub",i.state.recodeTime+2);var o=new FormData;o.append("voiceFile",t),o.append("accessToken",l.opt.accessToken),o.append("deviceSerial",l.opt.deviceSerial),o.append("channelNo",l.opt.channelNo),a(n+"/api/lapp/voice/sendonce","POST",{voiceFile:t,accessToken:l.opt.accessToken,deviceSerial:l.opt.deviceSerial,channelNo:l.opt.channelNo},0,function(t){console.log("data.data",t.data),200==t.code?O("sub",i.state.recodeTime+2):"10001"==t.code?e.layer.msg("未找到当前语音"):e.layer.msg(t.msg||"发送失败,请稍后再试")})}),U&&U.clear()}catch(e){console.log(e)}}()}()}}function O(e,t){if(clearInterval(i.state.countTimer),"add"===e){var o=t;i.state.countTimer=setInterval(function(){++o,document.getElementById("time-area").innerHTML=a(o)},1e3)}else if("sub"===e){o=t;i.state.countTimer=setInterval(function(){o>0?(o--,document.getElementById("time-area").innerHTML=a(o)):(clearInterval(i.state.countTimer),i.state.countTimer=void 0,console.log("倒计时结束,开启声音"))},1e3)}else"destory"===e&&(clearInterval(i.state.countTimer),i.state.countTimer=void 0,document.getElementById("time-area").innerHTML="00:00");function a(e){var t,o,a,i=parseInt(e),n=0,s=0;return i>59&&(n=parseInt(i/60),i=parseInt(i%60),n>59&&(s=parseInt(n/60),n=parseInt(n%60))),t=parseInt(i)>9?parseInt(i):"0"+parseInt(i),o=parseInt(n)>9?parseInt(n):"0"+parseInt(n),a=parseInt(s)>9?parseInt(s):"0"+parseInt(s),s>0?a+":"+o+":"+t:n>0?o+":"+t:"00:"+t}}}}})});l=this;e.addEventListener("message",function(e){console.log("EZUIKitPlayer收到反馈",e);e.origin;var o=l.opt.id;if(e.data.type)switch(e.data.type){case"openSound":o==e.data.id&&t.openSoundCallBack&&t.openSoundCallBack(e.data);break;case"closeSound":o==e.data.id&&t.closeSoundCallBack&&t.closeSoundCallBack(e.data);break;case"capturePicture":o==e.data.id&&t.capturePictureCallBack&&t.capturePictureCallBack(e.data);break;case"startSave":o==e.data.id&&t.startSaveCallBack&&t.startSaveCallBack(e.data);break;case"stopSave":o==e.data.id&&t.stopSaveCallBack&&t.stopSaveCallBack(e.data);break;case"fullScreen":o==e.data.id&&t.fullScreenCallBack&&t.fullScreenCallBack(e.data);break;case"getOSDTime":o==e.data.id&&t.getOSDTimeCallBack&&t.getOSDTimeCallBack(e.data);break;case"handleSuccess":o==e.data.id&&t.handleSuccess&&t.handleSuccess(e.data);break;case"handleError":o==e.data.id&&t.handleError&&t.handleError(e.data);break;case"dblclick":o==e.data.id&&l.opt.bSupporDoubleClickFull&&(0===l.opt.fullScreenStatus?l.fullScreen():l.cancelFullScreen())}})};return l.prototype.play=function(t){var o="EZUIKitPlayer-"+this.opt.id,a=document.getElementById(o).contentWindow;"object"==typeof t&&t.url&&(this.opt.url=t.url),"object"==typeof t&&t.accessToken&&(this.opt.accessToken=t.accessToken),"string"==typeof t&&(this.opt.url=t),a.postMessage({action:"play",accessToken:this.opt.accessToken,url:this.opt.url},n+"/ezopen/h5/iframe");var i=this;return this.opt.videoLoading=!0,new Promise(function(t,o){e.addEventListener("message",function(e){i.opt.id==e.data.id&&"handleSuccess"===e.data.type&&(setTimeout(()=>{i.opt.videoLoading=!1},1e3),t(e.data))})})},l.prototype.stop=function(){var t="EZUIKitPlayer-"+this.opt.id;document.getElementById(t).contentWindow.postMessage("stop",n+"/ezopen/h5/iframe");var o=this;return new Promise(function(t,a){e.addEventListener("message",function(e){o.opt.id==e.data.id&&"stop"===e.data.type&&t(e.data)})})},l.prototype.openSound=function(){var t="EZUIKitPlayer-"+this.opt.id;document.getElementById(t).contentWindow.postMessage("openSound",n+"/ezopen/h5/iframe");var o=this;return new Promise(function(t,a){e.addEventListener("message",function(e){o.opt.id==e.data.id&&"openSound"===e.data.type&&t(e.data)})})},l.prototype.closeSound=function(){var t="EZUIKitPlayer-"+this.opt.id;document.getElementById(t).contentWindow.postMessage("closeSound",n+"/ezopen/h5/iframe");var o=this;return new Promise(function(t,a){e.addEventListener("message",function(e){o.opt.id==e.data.id&&"closeSound"===e.data.type&&t(e.data)})})},l.prototype.startSave=function(t){var o="EZUIKitPlayer-"+this.opt.id;document.getElementById(o).contentWindow.postMessage({action:"startSave",fileName:t||"default"},n+"/ezopen/h5/iframe");var a=this;return new Promise(function(t,o){e.addEventListener("message",function(e){a.opt.id==e.data.id&&"startSave"===e.data.type&&t(e.data)})})},l.prototype.stopSave=function(){var t="EZUIKitPlayer-"+this.opt.id;document.getElementById(t).contentWindow.postMessage("stopSave",n+"/ezopen/h5/iframe");var o=this;return new Promise(function(t,a){e.addEventListener("message",function(e){o.opt.id==e.data.id&&"stopSave"===e.data.type&&t(e.data)})})},l.prototype.fullScreen=function(){if(1===this.opt.fullScreenStatus)return!1;var t=this,o="EZUIKitPlayer-"+this.opt.id,a=document.getElementById(o).contentWindow;if(navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)){var i=document.documentElement.clientWidth,s=document.documentElement.clientHeight,l=(document.body,"");l+="width:"+s+"px;",l+="height:"+i+"px;",l+="-webkit-transform: rotate(90deg); transform: rotate(90deg);",l+="-webkit-transform-origin: "+i/2+"px "+i/2+"px;",l+="transform-origin: "+i/2+"px "+i/2+"px;",l+="position: fixed;top: 0;left: 0;z-index:10",document.getElementById(o).style.cssText=l;var c=document.createElement("div");c.id=o+"cancel-full-screen";var r="width:30px;height:"+s+"px;z-index:1000;position:fixed;top:0px;right:0px;";r+="background-image: url(https://resource.ys7cloud.com/group1/M00/00/7E/CtwQE1-01qeAH2wAAAABOliqQ5g167.png);",r+="background-size: contain;background-repeat:no-repeat;background-color:rgba(0,0,0,0.2)",c.style=r,c.onclick=function(){t.cancelFullScreen()},document.body.appendChild(c),setTimeout(function(){a.postMessage("autoResize",n+"/ezopen/h5/iframe")},200)}else{!function(t){var o=t.requestFullScreen||t.webkitRequestFullScreen||t.mozRequestFullScreen||t.msRequestFullScreen;if(o)o.call(t);else if(void 0!==e.ActiveXObject){var a=new ActiveXObject("WScript.Shell");null!==a&&a.SendKeys("{F11}")}}(document.getElementById(o)),setTimeout(function(){a.postMessage("autoResize",n+"/ezopen/h5/iframe")},200)}this.params.fullScreenCallBack&&this.params.fullScreenCallBack(this.opt.id),this.opt.fullScreenStatus=1},l.prototype.cancelFullScreen=function(){if(0===this.opt.fullScreenStatus)return!1;var e="EZUIKitPlayer-"+this.opt.id,t=document.getElementById(e).contentWindow;if(navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)){var o=document.getElementById(e).width,a=document.getElementById(e).height,i=(document.body,"");i+="width:"+o+"px;",i+="height:"+a+"px;",i+="-webkit-transform: rotate(0); transform: rotate(0);",i+="-webkit-transform-origin: 0 0;",i+="transform-origin: 0 0;",document.getElementById(e).style.cssText=i,setTimeout(function(){t.postMessage("autoResize",n+"/ezopen/h5/iframe")},200);var s=e+"cancel-full-screen",l=document.getElementById(s);l&&document.body.removeChild(l)}else document.exitFullscreen?document.exitFullscreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.mozCancelFullScreen&&document.mozCancelFullScreen();this.params.cancelFullScreenCallBack&&this.params.cancelFullScreenCallBack(this.opt.id),this.opt.fullScreenStatus=0},l.prototype.capturePicture=function(t,o){var a="EZUIKitPlayer-"+this.opt.id;document.getElementById(a).contentWindow.postMessage({action:"capturePicture",fileName:t||"default",isUndownload:o},n+"/ezopen/h5/iframe");var i=this;return new Promise(function(t,o){e.addEventListener("message",function(e){i.opt.id==e.data.id&&"capturePicture"===e.data.type&&t(e.data)})})},l.prototype.enableZoom=function(){var e="EZUIKitPlayer-"+this.opt.id;document.getElementById(e).contentWindow.postMessage("enableZoom",n+"/ezopen/h5/iframe")},l.prototype.closeZoom=function(){var e="EZUIKitPlayer-"+this.opt.id;document.getElementById(e).contentWindow.postMessage("closeZoom",n+"/ezopen/h5/iframe")},l.prototype.getOSDTime=function(){var t="EZUIKitPlayer-"+this.opt.id;document.getElementById(t).contentWindow.postMessage("getOSDTime",n+"/ezopen/h5/iframe");var o=this;return new Promise(function(t,a){e.addEventListener("message",function(e){o.opt.id==e.data.id&&"getOSDTime"===e.data.type&&t(e.data)})})},l.prototype.autoResize=function(){var e="EZUIKitPlayer-"+this.opt.id;document.getElementById(e).contentWindow.postMessage("autoResize",n+"/ezopen/h5/iframe")},l.prototype.reSize=function(e,t){var o="EZUIKitPlayer-"+this.opt.id,a=document.getElementById(o).contentWindow,i=document.getElementById(this.opt.id);i.style.width=e+"px",i.style.height=t+"px";var s=document.getElementById(o);s.setAttribute("width",e),s.setAttribute("height",t),setTimeout(function(){a.postMessage({action:"autoResize"},n+"/ezopen/h5/iframe")},200)},l.prototype.startTalk=function(){console.log("执行开始对讲"),console.log(this.opt);var t=this;i.opt=this.opt;a(t.opt.apiDomain,"POST",{accessToken:t.opt.accessToken,deviceSerial:t.opt.deviceSerial,channelNo:t.opt.channelNo},0,function(o){if(200==o.code){var a=o.data;if(a){var i=a.rtcUrl;-1===i.indexOf("ws")&&(i=i.replace("https","wss").replace("rtcgw","rtcgw-ws")),t.opt.rtcUrl=i,t.opt.ttsUrl="tts://"+a.ttsUrl;var n="talk://"+t.opt.deviceSerial+":0:"+t.opt.channelNo+":cas.ys7.com:6500";t.opt.talkLink=t.opt.ttsUrl+"/"+n,t.opt.stream=a.stream,e.startTalk()}}})},l.prototype.stopTalk=function(){console.log("执行结束对讲"),e.stopTalk()},i.EZUIKitPlayer=l,e.EZUIKit=i,t||(e.EZUIKit=i),i})}}]);
|