/*! * build: vue-admin-beautiful * vue-admin-beautiful author: chuzhixin 1204505056@qq.com * vue-admin-beautiful QQ Group(QQ群): 972435319、1139183756 * time: 2024-10-10 11:14:28 */ (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d216852"],{c38d:function(e,t,n){"use strict";(function(e,n){var i,o,r,a;function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n>>1,U=[["ary",w],["bind",g],["bindKey",v],["curry",C],["curryRight",S],["flip",k],["partial",T],["partialRight",b],["rearg",P]],V="[object Arguments]",H="[object Array]",W="[object AsyncFunction]",Z="[object Boolean]",K="[object Date]",G="[object DOMException]",J="[object Error]",q="[object Function]",X="[object GeneratorFunction]",Y="[object Map]",$="[object Number]",Q="[object Null]",ee="[object Object]",te="[object Promise]",ne="[object Proxy]",ie="[object RegExp]",oe="[object Set]",re="[object String]",ae="[object Symbol]",de="[object Undefined]",ce="[object WeakMap]",se="[object WeakSet]",le="[object ArrayBuffer]",ue="[object DataView]",pe="[object Float32Array]",me="[object Float64Array]",he="[object Int8Array]",fe="[object Int16Array]",ge="[object Int32Array]",ve="[object Uint8Array]",ye="[object Uint8ClampedArray]",Ce="[object Uint16Array]",Se="[object Uint32Array]",Te=/\b__p \+= '';/g,be=/\b(__p \+=) '' \+/g,we=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Pe=/&(?:amp|lt|gt|quot|#39);/g,ke=/[&<>"']/g,Ee=RegExp(Pe.source),Ie=RegExp(ke.source),xe=/<%-([\s\S]+?)%>/g,_e=/<%([\s\S]+?)%>/g,je=/<%=([\s\S]+?)%>/g,Re=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Me=/^\w*$/,De=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ae=/[\\^$.*+?()[\]{}|]/g,Be=RegExp(Ae.source),ze=/^\s+/,Fe=/\s/,Le=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Oe=/\{\n\/\* \[wrapped with (.+)\] \*/,Ne=/,? & /,Ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Ve=/[()=,{}\[\]\/\s]/,He=/\\(\\)?/g,We=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ze=/\w*$/,Ke=/^[-+]0x[0-9a-f]+$/i,Ge=/^0b[01]+$/i,Je=/^\[object .+?Constructor\]$/,qe=/^0o[0-7]+$/i,Xe=/^(?:0|[1-9]\d*)$/,Ye=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,$e=/($^)/,Qe=/['\n\r\u2028\u2029\\]/g,et="\\ud800-\\udfff",tt="\\u0300-\\u036f",nt="\\ufe20-\\ufe2f",it="\\u20d0-\\u20ff",ot=tt+nt+it,rt="\\u2700-\\u27bf",at="a-z\\xdf-\\xf6\\xf8-\\xff",dt="\\xac\\xb1\\xd7\\xf7",ct="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",st="\\u2000-\\u206f",lt=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ut="A-Z\\xc0-\\xd6\\xd8-\\xde",pt="\\ufe0e\\ufe0f",mt=dt+ct+st+lt,ht="['’]",ft="["+et+"]",gt="["+mt+"]",vt="["+ot+"]",yt="\\d+",Ct="["+rt+"]",St="["+at+"]",Tt="[^"+et+mt+yt+rt+at+ut+"]",bt="\\ud83c[\\udffb-\\udfff]",wt="(?:"+vt+"|"+bt+")",Pt="[^"+et+"]",kt="(?:\\ud83c[\\udde6-\\uddff]){2}",Et="[\\ud800-\\udbff][\\udc00-\\udfff]",It="["+ut+"]",xt="\\u200d",_t="(?:"+St+"|"+Tt+")",jt="(?:"+It+"|"+Tt+")",Rt="(?:"+ht+"(?:d|ll|m|re|s|t|ve))?",Mt="(?:"+ht+"(?:D|LL|M|RE|S|T|VE))?",Dt=wt+"?",At="["+pt+"]?",Bt="(?:"+xt+"(?:"+[Pt,kt,Et].join("|")+")"+At+Dt+")*",zt="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ft="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Lt=At+Dt+Bt,Ot="(?:"+[Ct,kt,Et].join("|")+")"+Lt,Nt="(?:"+[Pt+vt+"?",vt,kt,Et,ft].join("|")+")",Ut=RegExp(ht,"g"),Vt=RegExp(vt,"g"),Ht=RegExp(bt+"(?="+bt+")|"+Nt+Lt,"g"),Wt=RegExp([It+"?"+St+"+"+Rt+"(?="+[gt,It,"$"].join("|")+")",jt+"+"+Mt+"(?="+[gt,It+_t,"$"].join("|")+")",It+"?"+_t+"+"+Rt,It+"+"+Mt,Ft,zt,yt,Ot].join("|"),"g"),Zt=RegExp("["+xt+et+ot+pt+"]"),Kt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Gt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Jt=-1,qt={};qt[pe]=qt[me]=qt[he]=qt[fe]=qt[ge]=qt[ve]=qt[ye]=qt[Ce]=qt[Se]=!0,qt[V]=qt[H]=qt[le]=qt[Z]=qt[ue]=qt[K]=qt[J]=qt[q]=qt[Y]=qt[$]=qt[ee]=qt[ie]=qt[oe]=qt[re]=qt[ce]=!1;var Xt={};Xt[V]=Xt[H]=Xt[le]=Xt[ue]=Xt[Z]=Xt[K]=Xt[pe]=Xt[me]=Xt[he]=Xt[fe]=Xt[ge]=Xt[Y]=Xt[$]=Xt[ee]=Xt[ie]=Xt[oe]=Xt[re]=Xt[ae]=Xt[ve]=Xt[ye]=Xt[Ce]=Xt[Se]=!0,Xt[J]=Xt[q]=Xt[ce]=!1;var Yt={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},$t={"&":"&","<":"<",">":">",'"':""","'":"'"},Qt={"&":"&","<":"<",">":">",""":'"',"'":"'"},en={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},tn=parseFloat,nn=parseInt,on="object"==typeof _&&_&&_.Object===Object&&_,rn="object"==typeof self&&self&&self.Object===Object&&self,an=on||rn||Function("return this")(),dn=t&&!t.nodeType&&t,cn=dn&&e&&!e.nodeType&&e,sn=cn&&cn.exports===dn,ln=sn&&on.process,un=function(){try{var e=cn&&cn.require&&cn.require("util").types;return e||ln&&ln.binding&&ln.binding("util")}catch(t){}}(),pn=un&&un.isArrayBuffer,mn=un&&un.isDate,hn=un&&un.isMap,fn=un&&un.isRegExp,gn=un&&un.isSet,vn=un&&un.isTypedArray;function yn(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Cn(e,t,n,i){var o=-1,r=null==e?0:e.length;while(++o-1}function kn(e,t,n){var i=-1,o=null==e?0:e.length;while(++i-1);return n}function $n(e,t){var n=e.length;while(n--&&zn(t,e[n],0)>-1);return n}function Qn(e,t){var n=e.length,i=0;while(n--)e[n]===t&&++i;return i}var ei=Un(Yt),ti=Un($t);function ni(e){return"\\"+en[e]}function ii(e,t){return null==e?n:e[t]}function oi(e){return Zt.test(e)}function ri(e){return Kt.test(e)}function ai(e){var t,n=[];while(!(t=e.next()).done)n.push(t.value);return n}function di(e){var t=-1,n=Array(e.size);return e.forEach((function(e,i){n[++t]=[i,e]})),n}function ci(e,t){return function(n){return e(t(n))}}function si(e,t){var n=-1,i=e.length,o=0,r=[];while(++n-1}function Vi(e,t){var n=this.__data__,i=uo(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}function Hi(e){var t=-1,n=null==e?0:e.length;this.clear();while(++t=t?e:t)),e}function yo(e,t,i,o,r,a){var d,c=t&u,s=t&p,l=t&m;if(i&&(d=r?i(e,o,r,a):i(e)),d!==n)return d;if(!Pl(e))return e;var h=cl(e);if(h){if(d=td(e),!c)return oa(e,d)}else{var f=Ya(e),g=f==q||f==X;if(ml(e))return Jr(e,c);if(f==ee||f==V||g&&!r){if(d=s||g?{}:nd(e),!c)return s?da(e,ho(d,e)):aa(e,mo(d,e))}else{if(!Xt[f])return r?e:{};d=id(e,f,c)}}a||(a=new $i);var v=a.get(e);if(v)return v;a.set(e,d),Fl(e)?e.forEach((function(n){d.add(yo(n,t,i,n,e,a))})):El(e)&&e.forEach((function(n,o){d.set(o,yo(n,t,i,o,e,a))}));var y=l?s?Na:Oa:s?wu:bu,C=h?n:y(e);return Sn(C||e,(function(n,o){C&&(o=n,n=e[o]),lo(d,o,yo(n,t,i,o,e,a))})),d}function Co(e){var t=bu(e);return function(n){return So(n,e,t)}}function So(e,t,i){var o=i.length;if(null==e)return!o;e=nt(e);while(o--){var r=i[o],a=t[r],d=e[r];if(d===n&&!(r in e)||!a(d))return!1}return!0}function To(e,t,i){if("function"!=typeof e)throw new rt(a);return kd((function(){e.apply(n,i)}),t)}function bo(e,t,n,i){var r=-1,a=Pn,d=!0,c=e.length,s=[],l=t.length;if(!c)return s;n&&(t=En(t,Jn(n))),i?(a=kn,d=!1):t.length>=o&&(a=Xn,d=!1,t=new qi(t));e:while(++rr?0:r+i),o=o===n||o>r?r:Jl(o),o<0&&(o+=r),o=i>o?0:ql(o);while(i0&&n(d)?t>1?_o(d,t-1,n,i,o):In(o,d):i||(o[o.length]=d)}return o}var jo=ua(),Ro=ua(!0);function Mo(e,t){return e&&jo(e,t,bu)}function Do(e,t){return e&&Ro(e,t,bu)}function Ao(e,t){return wn(t,(function(t){return Tl(e[t])}))}function Bo(e,t){t=Wr(t,e);var i=0,o=t.length;while(null!=e&&it}function Oo(e,t){return null!=e&&ut.call(e,t)}function No(e,t){return null!=e&&t in nt(e)}function Uo(e,t,n){return e>=Ht(t,n)&&e=120&&u.length>=120)?new qi(d&&u):n}u=e[0];var p=-1,m=c[0];e:while(++p-1)d!==e&&kt.call(d,c,1),kt.call(e,c,1)}return e}function vr(e,t){var n=e?t.length:0,i=n-1;while(n--){var o=t[n];if(n==i||o!==r){var r=o;ad(o)?kt.call(e,o,1):zr(e,o)}}return e}function yr(e,t){return e+At(Kt()*(t-e+1))}function Cr(e,t,n,i){var o=-1,r=Nt(Dt((t-e)/(n||1)),0),a=_(r);while(r--)a[i?r:++o]=e,e+=n;return a}function Sr(e,t){var n="";if(!e||t<1||t>B)return n;do{t%2&&(n+=e),t=At(t/2),t&&(e+=e)}while(t);return n}function Tr(e,t){return Ed(Sd(e,t,jp),e+"")}function br(e){return ro(Uu(e))}function wr(e,t){var n=Uu(e);return _d(n,vo(t,0,n.length))}function Pr(e,t,i,o){if(!Pl(e))return e;t=Wr(t,e);var r=-1,a=t.length,d=a-1,c=e;while(null!=c&&++ro?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;var r=_(o);while(++i>>1,a=e[r];null!==a&&!Ol(a)&&(n?a<=t:a=o){var l=t?null:_a(e);if(l)return li(l);d=!1,r=Xn,s=new qi}else s=t?[]:c;e:while(++i=o?e:xr(e,t,i)}var Gr=jt||function(e){return an.clearTimeout(e)};function Jr(e,t){if(t)return e.slice();var n=e.length,i=Tt?Tt(n):new e.constructor(n);return e.copy(i),i}function qr(e){var t=new e.constructor(e.byteLength);return new St(t).set(new St(e)),t}function Xr(e,t){var n=t?qr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function Yr(e){var t=new e.constructor(e.source,Ze.exec(e));return t.lastIndex=e.lastIndex,t}function $r(e){return Ci?nt(Ci.call(e)):{}}function Qr(e,t){var n=t?qr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function ea(e,t){if(e!==t){var i=e!==n,o=null===e,r=e===e,a=Ol(e),d=t!==n,c=null===t,s=t===t,l=Ol(t);if(!c&&!l&&!a&&e>t||a&&d&&s&&!c&&!l||o&&d&&s||!i&&s||!r)return 1;if(!o&&!a&&!l&&e=d)return c;var s=n[i];return c*("desc"==s?-1:1)}}return e.index-t.index}function na(e,t,n,i){var o=-1,r=e.length,a=n.length,d=-1,c=t.length,s=Nt(r-a,0),l=_(c+s),u=!i;while(++d1?i[r-1]:n,d=r>2?i[2]:n;a=e.length>3&&"function"==typeof a?(r--,a):n,d&&dd(i[0],i[1],d)&&(a=r<3?n:a,r=1),t=nt(t);while(++o-1?r[a?t[d]:d]:n}}function ya(e){return La((function(t){var i=t.length,o=i,r=Ei.prototype.thru;e&&t.reverse();while(o--){var d=t[o];if("function"!=typeof d)throw new rt(a);if(r&&!c&&"wrapper"==Va(d))var c=new Ei([],!0)}o=c?o:i;while(++o1&&g.reverse(),u&&sc))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var p=-1,m=!0,g=i&f?new qi:n;a.set(e,t),a.set(t,e);while(++p1?"& ":"")+t[i],t=t.join(n>2?", ":" "),e.replace(Le,"{\n/* [wrapped with "+t+"] */\n")}function rd(e){return cl(e)||dl(e)||!!(Et&&e&&e[Et])}function ad(e,t){var n=typeof e;return t=null==t?B:t,!!t&&("number"==n||"symbol"!=n&&Xe.test(e))&&e>-1&&e%1==0&&e0){if(++t>=x)return arguments[0]}else t=0;return e.apply(n,arguments)}}function _d(e,t){var i=-1,o=e.length,r=o-1;t=t===n?o:t;while(++i1?e[t-1]:n;return i="function"==typeof i?(e.pop(),i):n,zc(e,i)}));function Zc(e){var t=wi(e);return t.__chain__=!0,t}function Kc(e,t){return t(e),e}function Gc(e,t){return t(e)}var Jc=La((function(e){var t=e.length,i=t?e[0]:0,o=this.__wrapped__,r=function(t){return go(t,e)};return!(t>1||this.__actions__.length)&&o instanceof Ii&&ad(i)?(o=o.slice(i,+i+(t?1:0)),o.__actions__.push({func:Gc,args:[r],thisArg:n}),new Ei(o,this.__chain__).thru((function(e){return t&&!e.length&&e.push(n),e}))):this.thru(r)}));function qc(){return Zc(this)}function Xc(){return new Ei(this.value(),this.__chain__)}function Yc(){this.__values__===n&&(this.__values__=Kl(this.value()));var e=this.__index__>=this.__values__.length,t=e?n:this.__values__[this.__index__++];return{done:e,value:t}}function $c(){return this}function Qc(e){var t,i=this;while(i instanceof ki){var o=Ad(i);o.__index__=0,o.__values__=n,t?r.__wrapped__=o:t=o;var r=o;i=i.__wrapped__}return r.__wrapped__=e,t}function es(){var e=this.__wrapped__;if(e instanceof Ii){var t=e;return this.__actions__.length&&(t=new Ii(this)),t=t.reverse(),t.__actions__.push({func:Gc,args:[hc],thisArg:n}),new Ei(t,this.__chain__)}return this.thru(hc)}function ts(){return Or(this.__wrapped__,this.__actions__)}var ns=ca((function(e,t,n){ut.call(e,n)?++e[n]:fo(e,n,1)}));function is(e,t,i){var o=cl(e)?bn:ko;return i&&dd(e,t,i)&&(t=n),o(e,Wa(t,3))}function os(e,t){var n=cl(e)?wn:xo;return n(e,Wa(t,3))}var rs=va(Kd),as=va(Gd);function ds(e,t){return _o(gs(e,t),1)}function cs(e,t){return _o(gs(e,t),A)}function ss(e,t,i){return i=i===n?1:Jl(i),_o(gs(e,t),i)}function ls(e,t){var n=cl(e)?Sn:wo;return n(e,Wa(t,3))}function us(e,t){var n=cl(e)?Tn:Po;return n(e,Wa(t,3))}var ps=ca((function(e,t,n){ut.call(e,n)?e[n].push(t):fo(e,n,[t])}));function ms(e,t,n,i){e=ll(e)?e:Uu(e),n=n&&!i?Jl(n):0;var o=e.length;return n<0&&(n=Nt(o+n,0)),Ll(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&zn(e,t,n)>-1}var hs=Tr((function(e,t,n){var i=-1,o="function"==typeof t,r=ll(e)?_(e.length):[];return wo(e,(function(e){r[++i]=o?yn(t,e,n):Wo(e,t,n)})),r})),fs=ca((function(e,t,n){fo(e,n,t)}));function gs(e,t){var n=cl(e)?En:ar;return n(e,Wa(t,3))}function vs(e,t,i,o){return null==e?[]:(cl(t)||(t=null==t?[]:[t]),i=o?n:i,cl(i)||(i=null==i?[]:[i]),pr(e,t,i))}var ys=ca((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));function Cs(e,t,n){var i=cl(e)?xn:Vn,o=arguments.length<3;return i(e,Wa(t,4),n,o,wo)}function Ss(e,t,n){var i=cl(e)?_n:Vn,o=arguments.length<3;return i(e,Wa(t,4),n,o,Po)}function Ts(e,t){var n=cl(e)?wn:xo;return n(e,Us(Wa(t,3)))}function bs(e){var t=cl(e)?ro:br;return t(e)}function ws(e,t,i){t=(i?dd(e,t,i):t===n)?1:Jl(t);var o=cl(e)?ao:wr;return o(e,t)}function Ps(e){var t=cl(e)?co:Ir;return t(e)}function ks(e){if(null==e)return 0;if(ll(e))return Ll(e)?hi(e):e.length;var t=Ya(e);return t==Y||t==oe?e.size:ir(e).length}function Es(e,t,i){var o=cl(e)?jn:_r;return i&&dd(e,t,i)&&(t=n),o(e,Wa(t,3))}var Is=Tr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&dd(e,t[0],t[1])?t=[]:n>2&&dd(t[0],t[1],t[2])&&(t=[t[0]]),pr(e,_o(t,1),[])})),xs=Rt||function(){return an.Date.now()};function _s(e,t){if("function"!=typeof t)throw new rt(a);return e=Jl(e),function(){if(--e<1)return t.apply(this,arguments)}}function js(e,t,i){return t=i?n:t,t=e&&null==t?e.length:t,Ra(e,w,n,n,n,n,t)}function Rs(e,t){var i;if("function"!=typeof t)throw new rt(a);return e=Jl(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=n),i}}var Ms=Tr((function(e,t,n){var i=g;if(n.length){var o=si(n,Ha(Ms));i|=T}return Ra(e,i,t,n,o)})),Ds=Tr((function(e,t,n){var i=g|v;if(n.length){var o=si(n,Ha(Ds));i|=T}return Ra(t,i,e,n,o)}));function As(e,t,i){t=i?n:t;var o=Ra(e,C,n,n,n,n,n,t);return o.placeholder=As.placeholder,o}function Bs(e,t,i){t=i?n:t;var o=Ra(e,S,n,n,n,n,n,t);return o.placeholder=Bs.placeholder,o}function zs(e,t,i){var o,r,d,c,s,l,u=0,p=!1,m=!1,h=!0;if("function"!=typeof e)throw new rt(a);function f(t){var i=o,a=r;return o=r=n,u=t,c=e.apply(a,i),c}function g(e){return u=e,s=kd(C,t),p?f(e):c}function v(e){var n=e-l,i=e-u,o=t-n;return m?Ht(o,d-i):o}function y(e){var i=e-l,o=e-u;return l===n||i>=t||i<0||m&&o>=d}function C(){var e=xs();if(y(e))return S(e);s=kd(C,v(e))}function S(e){return s=n,h&&o?f(e):(o=r=n,c)}function T(){s!==n&&Gr(s),u=0,o=l=r=s=n}function b(){return s===n?c:S(xs())}function w(){var e=xs(),i=y(e);if(o=arguments,r=this,l=e,i){if(s===n)return g(l);if(m)return Gr(s),s=kd(C,t),f(l)}return s===n&&(s=kd(C,t)),c}return t=Xl(t)||0,Pl(i)&&(p=!!i.leading,m="maxWait"in i,d=m?Nt(Xl(i.maxWait)||0,t):d,h="trailing"in i?!!i.trailing:h),w.cancel=T,w.flush=b,w}var Fs=Tr((function(e,t){return To(e,1,t)})),Ls=Tr((function(e,t,n){return To(e,Xl(t)||0,n)}));function Os(e){return Ra(e,k)}function Ns(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new rt(a);var n=function(){var i=arguments,o=t?t.apply(this,i):i[0],r=n.cache;if(r.has(o))return r.get(o);var a=e.apply(this,i);return n.cache=r.set(o,a)||r,a};return n.cache=new(Ns.Cache||Hi),n}function Us(e){if("function"!=typeof e)throw new rt(a);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function Vs(e){return Rs(2,e)}Ns.Cache=Hi;var Hs=Zr((function(e,t){t=1==t.length&&cl(t[0])?En(t[0],Jn(Wa())):En(_o(t,1),Jn(Wa()));var n=t.length;return Tr((function(i){var o=-1,r=Ht(i.length,n);while(++o=t})),dl=Zo(function(){return arguments}())?Zo:function(e){return kl(e)&&ut.call(e,"callee")&&!Pt.call(e,"callee")},cl=_.isArray,sl=pn?Jn(pn):Ko;function ll(e){return null!=e&&wl(e.length)&&!Tl(e)}function ul(e){return kl(e)&&ll(e)}function pl(e){return!0===e||!1===e||kl(e)&&Fo(e)==Z}var ml=zt||Jp,hl=mn?Jn(mn):Go;function fl(e){return kl(e)&&1===e.nodeType&&!Al(e)}function gl(e){if(null==e)return!0;if(ll(e)&&(cl(e)||"string"==typeof e||"function"==typeof e.splice||ml(e)||Nl(e)||dl(e)))return!e.length;var t=Ya(e);if(t==Y||t==oe)return!e.size;if(md(e))return!ir(e).length;for(var n in e)if(ut.call(e,n))return!1;return!0}function vl(e,t){return Jo(e,t)}function yl(e,t,i){i="function"==typeof i?i:n;var o=i?i(e,t):n;return o===n?Jo(e,t,n,i):!!o}function Cl(e){if(!kl(e))return!1;var t=Fo(e);return t==J||t==G||"string"==typeof e.message&&"string"==typeof e.name&&!Al(e)}function Sl(e){return"number"==typeof e&&Ft(e)}function Tl(e){if(!Pl(e))return!1;var t=Fo(e);return t==q||t==X||t==W||t==ne}function bl(e){return"number"==typeof e&&e==Jl(e)}function wl(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=B}function Pl(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function kl(e){return null!=e&&"object"==typeof e}var El=hn?Jn(hn):Xo;function Il(e,t){return e===t||Yo(e,t,Ka(t))}function xl(e,t,i){return i="function"==typeof i?i:n,Yo(e,t,Ka(t),i)}function _l(e){return Dl(e)&&e!=+e}function jl(e){if(pd(e))throw new Ue(r);return $o(e)}function Rl(e){return null===e}function Ml(e){return null==e}function Dl(e){return"number"==typeof e||kl(e)&&Fo(e)==$}function Al(e){if(!kl(e)||Fo(e)!=ee)return!1;var t=bt(e);if(null===t)return!0;var n=ut.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&<.call(n)==ft}var Bl=fn?Jn(fn):Qo;function zl(e){return bl(e)&&e>=-B&&e<=B}var Fl=gn?Jn(gn):er;function Ll(e){return"string"==typeof e||!cl(e)&&kl(e)&&Fo(e)==re}function Ol(e){return"symbol"==typeof e||kl(e)&&Fo(e)==ae}var Nl=vn?Jn(vn):tr;function Ul(e){return e===n}function Vl(e){return kl(e)&&Ya(e)==ce}function Hl(e){return kl(e)&&Fo(e)==se}var Wl=Ea(rr),Zl=Ea((function(e,t){return e<=t}));function Kl(e){if(!e)return[];if(ll(e))return Ll(e)?fi(e):oa(e);if(It&&e[It])return ai(e[It]());var t=Ya(e),n=t==Y?di:t==oe?li:Uu;return n(e)}function Gl(e){if(!e)return 0===e?e:0;if(e=Xl(e),e===A||e===-A){var t=e<0?-1:1;return t*z}return e===e?e:0}function Jl(e){var t=Gl(e),n=t%1;return t===t?n?t-n:t:0}function ql(e){return e?vo(Jl(e),0,L):0}function Xl(e){if("number"==typeof e)return e;if(Ol(e))return F;if(Pl(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Pl(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Gn(e);var n=Ge.test(e);return n||qe.test(e)?nn(e.slice(2),n?2:8):Ke.test(e)?F:+e}function Yl(e){return ra(e,wu(e))}function $l(e){return e?vo(Jl(e),-B,B):0===e?e:0}function Ql(e){return null==e?"":Ar(e)}var eu=sa((function(e,t){if(md(t)||ll(t))ra(t,bu(t),e);else for(var n in t)ut.call(t,n)&&lo(e,n,t[n])})),tu=sa((function(e,t){ra(t,wu(t),e)})),nu=sa((function(e,t,n,i){ra(t,wu(t),e,i)})),iu=sa((function(e,t,n,i){ra(t,bu(t),e,i)})),ou=La(go);function ru(e,t){var n=Pi(e);return null==t?n:mo(n,t)}var au=Tr((function(e,t){e=nt(e);var i=-1,o=t.length,r=o>2?t[2]:n;r&&dd(t[0],t[1],r)&&(o=1);while(++i1),t})),ra(e,Na(e),n),i&&(n=yo(n,u|p|m,Aa));var o=t.length;while(o--)zr(n,t[o]);return n}));function _u(e,t){return Ru(e,Us(Wa(t)))}var ju=La((function(e,t){return null==e?{}:mr(e,t)}));function Ru(e,t){if(null==e)return{};var n=En(Na(e),(function(e){return[e]}));return t=Wa(t),hr(e,n,(function(e,n){return t(e,n[0])}))}function Mu(e,t,i){t=Wr(t,e);var o=-1,r=t.length;r||(r=1,e=n);while(++ot){var o=e;e=t,t=o}if(i||e%1||t%1){var r=Kt();return Ht(e+r*(t-e+tn("1e-"+((r+"").length-1))),t)}return yr(e,t)}var Ku=ha((function(e,t,n){return t=t.toLowerCase(),e+(n?Gu(t):t)}));function Gu(e){return Sp(Ql(e).toLowerCase())}function Ju(e){return e=Ql(e),e&&e.replace(Ye,ei).replace(Vt,"")}function qu(e,t,i){e=Ql(e),t=Ar(t);var o=e.length;i=i===n?o:vo(Jl(i),0,o);var r=i;return i-=t.length,i>=0&&e.slice(i,r)==t}function Xu(e){return e=Ql(e),e&&Ie.test(e)?e.replace(ke,ti):e}function Yu(e){return e=Ql(e),e&&Be.test(e)?e.replace(Ae,"\\$&"):e}var $u=ha((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Qu=ha((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),ep=ma("toLowerCase");function tp(e,t,n){e=Ql(e),t=Jl(t);var i=t?hi(e):0;if(!t||i>=t)return e;var o=(t-i)/2;return wa(At(o),n)+e+wa(Dt(o),n)}function np(e,t,n){e=Ql(e),t=Jl(t);var i=t?hi(e):0;return t&&i>>0,i?(e=Ql(e),e&&("string"==typeof t||null!=t&&!Bl(t))&&(t=Ar(t),!t&&oi(e))?Kr(fi(e),0,i):e.split(t,i)):[]}var sp=ha((function(e,t,n){return e+(n?" ":"")+Sp(t)}));function lp(e,t,n){return e=Ql(e),n=null==n?0:vo(Jl(n),0,e.length),t=Ar(t),e.slice(n,n+t.length)==t}function up(e,t,i){var o=wi.templateSettings;i&&dd(e,t,i)&&(t=n),e=Ql(e),t=nu({},t,o,Ma);var r,a,c=nu({},t.imports,o.imports,Ma),s=bu(c),l=qn(c,s),u=0,p=t.interpolate||$e,m="__p += '",h=it((t.escape||$e).source+"|"+p.source+"|"+(p===je?We:$e).source+"|"+(t.evaluate||$e).source+"|$","g"),f="//# sourceURL="+(ut.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Jt+"]")+"\n";e.replace(h,(function(t,n,i,o,d,c){return i||(i=o),m+=e.slice(u,c).replace(Qe,ni),n&&(r=!0,m+="' +\n__e("+n+") +\n'"),d&&(a=!0,m+="';\n"+d+";\n__p += '"),i&&(m+="' +\n((__t = ("+i+")) == null ? '' : __t) +\n'"),u=c+t.length,t})),m+="';\n";var g=ut.call(t,"variable")&&t.variable;if(g){if(Ve.test(g))throw new Ue(d)}else m="with (obj) {\n"+m+"\n}\n";m=(a?m.replace(Te,""):m).replace(be,"$1").replace(we,"$1;"),m="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(r?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+m+"return __p\n}";var v=bp((function(){return et(s,f+"return "+m).apply(n,l)}));if(v.source=m,Cl(v))throw v;return v}function pp(e){return Ql(e).toLowerCase()}function mp(e){return Ql(e).toUpperCase()}function hp(e,t,i){if(e=Ql(e),e&&(i||t===n))return Gn(e);if(!e||!(t=Ar(t)))return e;var o=fi(e),r=fi(t),a=Yn(o,r),d=$n(o,r)+1;return Kr(o,a,d).join("")}function fp(e,t,i){if(e=Ql(e),e&&(i||t===n))return e.slice(0,gi(e)+1);if(!e||!(t=Ar(t)))return e;var o=fi(e),r=$n(o,fi(t))+1;return Kr(o,0,r).join("")}function gp(e,t,i){if(e=Ql(e),e&&(i||t===n))return e.replace(ze,"");if(!e||!(t=Ar(t)))return e;var o=fi(e),r=Yn(o,fi(t));return Kr(o,r).join("")}function vp(e,t){var i=E,o=I;if(Pl(t)){var r="separator"in t?t.separator:r;i="length"in t?Jl(t.length):i,o="omission"in t?Ar(t.omission):o}e=Ql(e);var a=e.length;if(oi(e)){var d=fi(e);a=d.length}if(i>=a)return e;var c=i-hi(o);if(c<1)return o;var s=d?Kr(d,0,c).join(""):e.slice(0,c);if(r===n)return s+o;if(d&&(c+=s.length-c),Bl(r)){if(e.slice(c).search(r)){var l,u=s;r.global||(r=it(r.source,Ql(Ze.exec(r))+"g")),r.lastIndex=0;while(l=r.exec(u))var p=l.index;s=s.slice(0,p===n?c:p)}}else if(e.indexOf(Ar(r),c)!=c){var m=s.lastIndexOf(r);m>-1&&(s=s.slice(0,m))}return s+o}function yp(e){return e=Ql(e),e&&Ee.test(e)?e.replace(Pe,vi):e}var Cp=ha((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Sp=ma("toUpperCase");function Tp(e,t,i){return e=Ql(e),t=i?n:t,t===n?ri(e)?Si(e):Dn(e):e.match(t)||[]}var bp=Tr((function(e,t){try{return yn(e,n,t)}catch(i){return Cl(i)?i:new Ue(i)}})),wp=La((function(e,t){return Sn(t,(function(t){t=Rd(t),fo(e,t,Ms(e[t],e))})),e}));function Pp(e){var t=null==e?0:e.length,n=Wa();return e=t?En(e,(function(e){if("function"!=typeof e[1])throw new rt(a);return[n(e[0]),e[1]]})):[],Tr((function(n){var i=-1;while(++iB)return[];var n=L,i=Ht(e,L);t=Wa(t),e-=L;var o=Zn(i,t);while(++n0||t<0)?new Ii(i):(e<0?i=i.takeRight(-e):e&&(i=i.drop(e)),t!==n&&(t=Jl(t),i=t<0?i.dropRight(-t):i.take(t-e)),i)},Ii.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Ii.prototype.toArray=function(){return this.take(L)},Mo(Ii.prototype,(function(e,t){var i=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),r=wi[o?"take"+("last"==t?"Right":""):t],a=o||/^find/.test(t);r&&(wi.prototype[t]=function(){var t=this.__wrapped__,d=o?[1]:arguments,c=t instanceof Ii,s=d[0],l=c||cl(t),u=function(e){var t=r.apply(wi,In([e],d));return o&&p?t[0]:t};l&&i&&"function"==typeof s&&1!=s.length&&(c=l=!1);var p=this.__chain__,m=!!this.__actions__.length,h=a&&!p,f=c&&!m;if(!a&&l){t=f?t:new Ii(this);var g=e.apply(t,d);return g.__actions__.push({func:Gc,args:[u],thisArg:n}),new Ei(g,p)}return h&&f?e.apply(this,d):(g=this.thru(u),h?o?g.value()[0]:g.value():g)})})),Sn(["pop","push","shift","sort","splice","unshift"],(function(e){var t=at[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",i=/^(?:pop|shift)$/.test(e);wi.prototype[e]=function(){var e=arguments;if(i&&!this.__chain__){var o=this.value();return t.apply(cl(o)?o:[],e)}return this[n]((function(n){return t.apply(cl(n)?n:[],e)}))}})),Mo(Ii.prototype,(function(e,t){var n=wi[t];if(n){var i=n.name+"";ut.call(ln,i)||(ln[i]=[]),ln[i].push({name:t,func:n})}})),ln[Ca(n,v).name]=[{name:"wrapper",func:n}],Ii.prototype.clone=xi,Ii.prototype.reverse=_i,Ii.prototype.value=ji,wi.prototype.at=Jc,wi.prototype.chain=qc,wi.prototype.commit=Xc,wi.prototype.next=Yc,wi.prototype.plant=Qc,wi.prototype.reverse=es,wi.prototype.toJSON=wi.prototype.valueOf=wi.prototype.value=ts,wi.prototype.first=wi.prototype.head,It&&(wi.prototype[It]=$c),wi},bi=Ti();cn?((cn.exports=bi)._=bi,dn._=bi):an._=bi}).call(_)}));function M(e,t){var n=t.parentNode;n.lastChild==t?n.appendChild(e):n.insertBefore(e,t.nextSibling)}var D=function(){function e(t,n){c(this,e),this.id=n,this.jSPlugin=t,this.state={play:!1,loading:!1}}return l(e,[{key:"toString",value:function(){return"".concat(this.coreX,"-").concat(this.coreY)}},{key:"setPlayStatus",value:function(e){this.state=Object.assign(this.state,e)}},{key:"loadingStart",value:function(e){var t=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(t),t.innerHTML="@keyframes antRotate {to {transform: rotate(400deg);transform-origin:50% 50%;}} .loading {display: inline-block;z-index: 1000;-webkit-animation: antRotate 1s infinite linear;animation: antRotate 1s infinite linear;}";var n=e,i=document.getElementById(n),o=i.offsetWidth,r=i.offsetHeight,a=0,d=i.offsetLeft;document.getElementById("".concat(e,"-loading-id-0"))&&document.getElementById("".concat(e,"-loading-id-0")).parentNode.removeChild(document.getElementById("".concat(e,"-loading-id-0")));var c=document.createElement("div");c.setAttribute("id","".concat(e,"-loading-id-0"));var s="position:absolute;outline:none;pointer-events:none;";console.log("this.jSPlugin",this.jSPlugin),s+="width: 100%;background-size: cover; background-repeat:no-repeat;",s+="height: 100%;",s+="top:"+a+";",s+="left:"+d+"px;",c.setAttribute("style",s),c.style.height=r,c.setAttribute("class","loading-container"),M(c,i);var l=1,u=document.createElement("div"),p=document.createElement("div");u.setAttribute("class","loading-item"),u.setAttribute("id","".concat(e,"-loading-item-0"));s="display:inline-flex;pointer-events:none;flex-direction:column;justify-content:center;align-items: center;width:100%;height:"+r+"px;outline:none;vertical-align: top;position:absolute;";function m(e,t,n,i){var o=parseInt(i/n,10)*(e/n),r=i%n*(t/n);return{top:o,left:r}}s+="left:"+m(r,o,l,0).left+"px;",s+="top:"+m(r,o,l,0).top+"px;",u.setAttribute("style",s);var h=document.createElement("div");p.innerHTML="",p.style.color="#fff",h.setAttribute("class","loading");var f='';h.innerHTML=f,u.appendChild(h),u.appendChild(p),c.appendChild(u)}},{key:"loadingSetText",value:function(e){if(this.loadingClearText(),document.getElementById("".concat(this.id,"-loading-item-0"))){var t=document.getElementById("".concat(this.id,"-loading-item-0")).childNodes[1];if(!t){var n=document.getElementById("".concat(this.id,"-loading-item-0"));t=document.createElement("div"),t.innerHTML=e.text,n.appendChild(t)}t.innerHTML=e.text,t.style.fontSize="14px",t.style.color=e.color||"#FFFFFF"}}},{key:"loadingClearText",value:function(){if(document.getElementById("".concat(this.id,"-loading-item-0"))){var e=document.getElementById("".concat(this.id,"-loading-item-0")).childNodes;e.length>1?e[1].parentNode.removeChild(e[1]):e[0]&&e[0].parentNode.removeChild(e[0])}}},{key:"loadingClear",value:function(){if(document.getElementById("".concat(this.id,"-loading-item-0"))){for(var e=document.getElementById("".concat(this.id,"-loading-item-0")).childNodes,t=e.length-1;t>=0;t--)e[t].parentNode.removeChild(e[t]);document.getElementById("".concat(this.id,"-loading-id-0"))&&(document.getElementById("".concat(this.id,"-loading-id-0")).style.background="none")}}},{key:"loadingEnd",value:function(){var e=document.getElementById("".concat(this.id,"-loading-item-0"));if(e){e.parentNode.removeChild(e);var t=document.getElementById("".concat(this.id,"-loading-id-0"));t&&0===t.children.length&&t.parentNode.removeChild(t)}document.getElementById("".concat(this.id,"-loading-item-0")).style.background="none"}}]),e}(),A=function(){function e(t,n){c(this,e),this.id=n,this.jSPlugin=t,this.timer=null,this.state={play:!1,loading:!1}}return l(e,[{key:"default",value:function(e){var t=this,n="msgId";document.getElementById("".concat(this.id,"-").concat(n))&&document.getElementById("".concat(this.id,"-wrap")).removeChild(document.getElementById("".concat(this.id,"-").concat(n)));var i=document.createElement("div");i.id="".concat(this.id,"-").concat(n),i.style="position: absolute;top: 50%;left:calc(50% - ".concat(14*e.length/2,"px);padding: 4px 16px;background: #00000080;color: #FFFFFF;font-size: 14px"),i.innerHTML=e,document.getElementById("".concat(this.id,"-wrap")).appendChild(i),this.timer&&clearTimeout(this.timer),this.timer=setTimeout((function(){document.getElementById("".concat(t.id,"-wrap")).removeChild(document.getElementById("".concat(t.id,"-").concat(n)))}),2e3)}}]),e}(),B=[{moduleCode:"",detailCode:"405984",description:"",solution:"",updateTime:1559564188e3},{moduleCode:"",detailCode:"10035",description:"获取子账户AccessToken异常,子账户不存在或子账户不属于该开发者",solution:"",updateTime:1559551958e3},{moduleCode:"",detailCode:"1052674",description:"获取本地录像失败",solution:"",updateTime:1558579653e3},{moduleCode:"",detailCode:"395547",description:"",solution:"",updateTime:1557367296e3},{moduleCode:"",detailCode:"12",description:"",solution:"",updateTime:1557229476e3},{moduleCode:"",detailCode:"10052",description:"余额不足",solution:"",updateTime:1557121463e3},{moduleCode:"",detailCode:"20108",description:"当前用户和所添加用户不是好友关系",solution:"",updateTime:1556541725e3},{moduleCode:"",detailCode:"10009",description:"",solution:"",updateTime:1556422452e3},{moduleCode:"",detailCode:"320001",description:"通道不存在",solution:"请检查录像机的关联状态是否正常,没有摄像头的通道无法播放",updateTime:1556419044e3},{moduleCode:"",detailCode:"120001",description:"通道不存在",solution:"请检查录像机的关联状态是否正常,没有摄像头的通道无法播放",updateTime:155641903e4},{moduleCode:"",detailCode:"320049",description:"",solution:"",updateTime:1556272984e3},{moduleCode:"",detailCode:"380227",description:"",solution:"",updateTime:1556264379e3},{moduleCode:"",detailCode:"10033",description:"policy参数信息异常",solution:"",updateTime:1555922124e3},{moduleCode:"",detailCode:"10065",description:"weakAppKey 不属于accessToken对应的用户",solution:"",updateTime:1555497522e3},{moduleCode:"",detailCode:"395416",description:"设备达到最大连接数,无法建立连接",solution:"请升级设备固件版本",updateTime:1555394722e3},{moduleCode:"",detailCode:"100001",description:"",solution:"",updateTime:1555141776e3},{moduleCode:"",detailCode:"395558",description:"",solution:"",updateTime:1554987121e3},{moduleCode:"",detailCode:"70001",description:"智能家居买断用户设备受到限制,建议合理选择pagestart和pageSize",solution:"",updateTime:1554691023e3},{moduleCode:"",detailCode:"170001",description:"",solution:"",updateTime:1554691023e3},{moduleCode:"",detailCode:"1012",description:"重置失败",solution:"",updateTime:1554645841e3},{moduleCode:"",detailCode:"1043",description:"重置失败",solution:"",updateTime:1554645834e3},{moduleCode:"",detailCode:"60060",description:"直播功能未开通",solution:"通道未开通直播功能,请先开通直播",updateTime:1554346018e3},{moduleCode:"",detailCode:"380203",description:"",solution:"",updateTime:1554093666e3},{moduleCode:"",detailCode:"399048",description:"免费版并发数达到上限,请升级企业版使用多并发能力",solution:"升级成为企业版套餐即可取消并发数限制",updateTime:1553839878e3},{moduleCode:"",detailCode:"60007",description:"预置点个数超过最大值",solution:"",updateTime:1553671316e3},{moduleCode:"",detailCode:"1005",description:"",solution:"",updateTime:1553513701e3},{moduleCode:"",detailCode:"20605",description:"其他用户正在认证中",solution:"",updateTime:1552976317e3},{moduleCode:"",detailCode:"90004",description:"当前型号设备暂时不支持AI任务:CS-C3W-3B1WFR-YGL",solution:"",updateTime:1552898525e3},{moduleCode:"",detailCode:"60046",description:"添加的设备的IP和本设备的IP冲突",solution:"",updateTime:1552872372e3},{moduleCode:"",detailCode:"3",description:"修改视频清晰度失败!",solution:"",updateTime:1552440229e3},{moduleCode:"",detailCode:"1013",description:"",solution:"",updateTime:1552035069e3},{moduleCode:"",detailCode:"370007",description:"",solution:"",updateTime:1551852327e3},{moduleCode:"",detailCode:"-1",description:"",solution:"",updateTime:1551752889e3},{moduleCode:"",detailCode:"30005",description:"弱账户不存在",solution:"",updateTime:1551422358e3},{moduleCode:"",detailCode:"90006",description:"用户操作AI任务受限",solution:"",updateTime:155107332e4},{moduleCode:"",detailCode:"60203",description:"未开通相关服务",solution:"",updateTime:155062307e4},{moduleCode:"",detailCode:"10002",description:"accessToken过期或异常",solution:"",updateTime:1550300346e3},{moduleCode:"",detailCode:"380339",description:"",solution:"",updateTime:1549889458e3},{moduleCode:"",detailCode:"90002",description:"AI任务设备配置数达到上限:3",solution:"",updateTime:1549071664e3},{moduleCode:"",detailCode:"380008",description:"",solution:"",updateTime:1549005979e3},{moduleCode:"",detailCode:"320227",description:"",solution:"",updateTime:1548739731e3},{moduleCode:"",detailCode:"60059",description:"ezopen地址均不可用",solution:"",updateTime:154839535e4},{moduleCode:"",detailCode:"10005",description:"appKey异常",solution:"",updateTime:1548317858e3},{moduleCode:"",detailCode:"60045",description:"添加的设备的IP和其他通道的IP冲突",solution:"",updateTime:1548155085e3},{moduleCode:"",detailCode:"60047",description:"码流类型不支持",solution:"",updateTime:1547962108e3},{moduleCode:"",detailCode:"60041",description:"添加的设备被其他设备关联或响应超时",solution:"",updateTime:154796098e4},{moduleCode:"",detailCode:"110029",description:"个人用户接口调用频率超限",solution:"请升级企业版:https://open.ys7.com/price.html",updateTime:1547606859e3},{moduleCode:"",detailCode:"380355",description:"设备直连推流异常结束",solution:"",updateTime:1547106294e3},{moduleCode:"",detailCode:"320081",description:"",solution:"",updateTime:1547106279e3},{moduleCode:"",detailCode:"60035",description:"购买云存储服务失败",solution:"",updateTime:1547026959e3},{moduleCode:"",detailCode:"90005",description:"设备已存在:C75714141",solution:"",updateTime:1546940622e3},{moduleCode:"",detailCode:"1053445",description:"该时间段没有录像片段",solution:"",updateTime:1546935727e3},{moduleCode:"",detailCode:"90007",description:"设备未加入到AI任务",solution:"",updateTime:1546932948e3},{moduleCode:"",detailCode:"326000",description:"",solution:"",updateTime:1546823143e3},{moduleCode:"",detailCode:"1021",description:"重置失败",solution:"",updateTime:1546781152e3},{moduleCode:"",detailCode:"2001",description:"删除设备失败!",solution:"",updateTime:1546422886e3},{moduleCode:"",detailCode:"380425",description:"",solution:"",updateTime:1546407694e3},{moduleCode:"",detailCode:"120097",description:"",solution:"",updateTime:1546085995e3},{moduleCode:"",detailCode:"10059",description:"requestId已存在",solution:"",updateTime:1545824509e3},{moduleCode:"",detailCode:"1154723",description:"",solution:"",updateTime:1545795209e3},{moduleCode:"",detailCode:"60043",description:"添加的设备超出最大数量",solution:"",updateTime:1545493607e3},{moduleCode:"",detailCode:"1152677",description:"",solution:"",updateTime:1545313404e3},{moduleCode:"",detailCode:"20097",description:"设备添加异常,设备验证码为ABCDEF或设备被N1,R1关联",solution:"",updateTime:1545310795e3},{moduleCode:"",detailCode:"10060",description:"设备不支持该云存储类型",solution:"",updateTime:1545309064e3},{moduleCode:"",detailCode:"20102",description:"无相应邀请信息,无法接受邀请",solution:"",updateTime:1545204966e3},{moduleCode:"",detailCode:"10053",description:"云存储开通中",solution:"",updateTime:1545100293e3},{moduleCode:"",detailCode:"20401",description:"用户云空间信息不存在",solution:"",updateTime:154501788e4},{moduleCode:"",detailCode:"20600",description:"临时密码数已达上限",solution:"",updateTime:1544873457e3},{moduleCode:"",detailCode:"901",description:"",solution:"",updateTime:1544693519e3},{moduleCode:"",detailCode:"60210",description:"图片数据错误",solution:"",updateTime:1544604457e3},{moduleCode:"",detailCode:"10013",description:"您的应用没有权限调用",solution:"",updateTime:1544416237e3},{moduleCode:"",detailCode:"70007",description:"授权码不存在",solution:"",updateTime:1544179533e3},{moduleCode:"",detailCode:"10015",description:"授权地址不存在",solution:"",updateTime:154416324e4},{moduleCode:"",detailCode:"320423",description:"",solution:"",updateTime:1544100685e3},{moduleCode:"",detailCode:"370009",description:"",solution:"",updateTime:1544077151e3},{moduleCode:"",detailCode:"10031",description:"子账户或萤石用户没有权限",solution:"",updateTime:1543990462e3},{moduleCode:"",detailCode:"10055",description:"设备不支持试用云存储服务",solution:"",updateTime:1543986292e3},{moduleCode:"",detailCode:"60042",description:"添加的设备密码错误",solution:"",updateTime:1543710913e3},{moduleCode:"",detailCode:"60082",description:"设备正在响应本次声源定位",solution:"",updateTime:1543647426e3},{moduleCode:"",detailCode:"10056",description:"设备不支持云存储服务转出",solution:"",updateTime:1543558342e3},{moduleCode:"",detailCode:"20104",description:"好友不存在",solution:"",updateTime:1543492403e3},{moduleCode:"",detailCode:"20111",description:"好友不是等待验证状态,无法接受邀请",solution:"",updateTime:1543492365e3},{moduleCode:"",detailCode:"20107",description:"不能添加自己为好友",solution:"",updateTime:1543480986e3},{moduleCode:"",detailCode:"1",description:"设备返回其他错误",solution:"",updateTime:1543459921e3},{moduleCode:"",detailCode:"60084",description:"当前正在关闭隐私遮蔽",solution:"",updateTime:1543456515e3},{moduleCode:"",detailCode:"380255",description:"",solution:"",updateTime:1543411652e3},{moduleCode:"",detailCode:"20015",description:"设备不支持",solution:"",updateTime:1543390936e3},{moduleCode:"",detailCode:"30003",description:"手机验证码错误",solution:"",updateTime:1543389137e3},{moduleCode:"",detailCode:"20615",description:"锁用户已存在",solution:"",updateTime:1543388325e3},{moduleCode:"",detailCode:"60061",description:"账户流量已超出或未购买,限制开通",solution:"",updateTime:1543372581e3},{moduleCode:"",detailCode:"60020",description:"设备不支持该信令",solution:"",updateTime:1543321636e3},{moduleCode:"",detailCode:"320146",description:"",solution:"",updateTime:1543318472e3},{moduleCode:"",detailCode:"60018",description:"设备升级失败",solution:"",updateTime:1543304928e3},{moduleCode:"",detailCode:"60044",description:"添加的设备网络不可达超时",solution:"",updateTime:1543304102e3},{moduleCode:"",detailCode:"20619",description:"主用户无法删除",solution:"",updateTime:1543290219e3},{moduleCode:"",detailCode:"20608",description:"锁用户不存在",solution:"",updateTime:154328195e4},{moduleCode:"",detailCode:"20609",description:"设备响应超时,门锁通信故障或者电量不足,请重试.",solution:"",updateTime:1543281601e3},{moduleCode:"",detailCode:"1049954",description:"升级设备失败",solution:"",updateTime:1543279264e3},{moduleCode:"",detailCode:"60009",description:"正在调用预置点",solution:"",updateTime:1543238114e3},{moduleCode:"",detailCode:"1052677",description:"获取本地录像失败",solution:"",updateTime:1543207604e3},{moduleCode:"",detailCode:"327000",description:"",solution:"",updateTime:1543196609e3},{moduleCode:"",detailCode:"20021",description:"设备在线,未被用户添加",solution:"",updateTime:1543193436e3},{moduleCode:"",detailCode:"20202",description:"操作留言信息失败",solution:"",updateTime:1543191562e3},{moduleCode:"",detailCode:"1052678",description:"获取本地录像失败",solution:"",updateTime:1543132218e3},{moduleCode:"",detailCode:"1054723",description:"格式化设备失败",solution:"",updateTime:1543129833e3},{moduleCode:"",detailCode:"20109",description:"对应分享不存在",solution:"",updateTime:1543129111e3},{moduleCode:"",detailCode:"60026",description:"设备处于隐私遮蔽状态",solution:"",updateTime:1543110403e3},{moduleCode:"",detailCode:"60083",description:"当前正在开启隐私遮蔽",solution:"",updateTime:1543071148e3},{moduleCode:"",detailCode:"60001",description:"用户无云台控制权限",solution:"",updateTime:1543059167e3},{moduleCode:"",detailCode:"2003",description:"设备不在线",solution:"",updateTime:1543051046e3},{moduleCode:"",detailCode:"-24",description:"设置设备enable错误",solution:"",updateTime:1543042701e3},{moduleCode:"",detailCode:"10018",description:"",solution:"",updateTime:1543041564e3},{moduleCode:"",detailCode:"20103",description:"好友已存在",solution:"",updateTime:154303843e4},{moduleCode:"",detailCode:"70010",description:"授权异常请重试",solution:"",updateTime:154303559e4},{moduleCode:"",detailCode:"60056",description:"删除设备失败",solution:"",updateTime:1543031275e3},{moduleCode:"",detailCode:"60040",description:"添加的设备不在同一局域网",solution:"",updateTime:154303121e4},{moduleCode:"",detailCode:"60019",description:"加密已开启",solution:"",updateTime:1543029931e3},{moduleCode:"",detailCode:"1054722",description:"格式化设备失败",solution:"",updateTime:1543028537e3},{moduleCode:"",detailCode:"20016",description:"当前设备正在格式化",solution:"",updateTime:1543028537e3},{moduleCode:"",detailCode:"10024",description:"透明通道权限校验不通过",solution:"",updateTime:154302554e4},{moduleCode:"",detailCode:"6002",description:"删除设备失败!",solution:"",updateTime:1543025026e3},{moduleCode:"",detailCode:"1011",description:"验证码错误!",solution:"",updateTime:1543016865e3},{moduleCode:"",detailCode:"60032",description:"卡密已使用",solution:"",updateTime:1543006668e3},{moduleCode:"",detailCode:"10034",description:"子账号已存在",solution:"",updateTime:1542989194e3},{moduleCode:"",detailCode:"20301",description:"根据uuid查询联动信息不存在",solution:"",updateTime:1542988651e3},{moduleCode:"",detailCode:"1041",description:"获取验证码过于频繁",solution:"",updateTime:1542980953e3},{moduleCode:"",detailCode:"10012",description:"该appkey下已绑定重复的phone!",solution:"",updateTime:15429808e5},{moduleCode:"",detailCode:"1008",description:"phone不合法!",solution:"",updateTime:1542979812e3},{moduleCode:"",detailCode:"60023",description:"订阅操作失败",solution:"",updateTime:1542979006e3},{moduleCode:"",detailCode:"5",description:"设备返回其他错误",solution:"",updateTime:1542977828e3},{moduleCode:"",detailCode:"60006",description:"云台当前操作失败",solution:"",updateTime:1542977598e3},{moduleCode:"",detailCode:"131",description:"修改视频清晰度失败!",solution:"",updateTime:1542977246e3},{moduleCode:"",detailCode:"10019",description:"密码错误",solution:"",updateTime:1542976628e3},{moduleCode:"",detailCode:"10004",description:"用户不存在",solution:"",updateTime:1542976268e3},{moduleCode:"",detailCode:"20201",description:"操作报警信息失败",solution:"",updateTime:1542975906e3},{moduleCode:"",detailCode:"20024",description:"设备不在线,已经被别的用户添加",solution:"",updateTime:1542975858e3},{moduleCode:"",detailCode:"60004",description:"设备云台旋转达到左限位",solution:"",updateTime:1542975207e3},{moduleCode:"",detailCode:"1052679",description:"修改视频清晰度失败!",solution:"",updateTime:1542974886e3},{moduleCode:"",detailCode:"20031",description:"请在萤石客户端关闭终端绑定",solution:"",updateTime:1542974756e3},{moduleCode:"",detailCode:"1053825",description:"获取本地录像失败",solution:"",updateTime:1542974692e3},{moduleCode:"",detailCode:"60011",description:"预置点不存在",solution:"",updateTime:1542974414e3},{moduleCode:"",detailCode:"1052936",description:"修改视频清晰度失败!",solution:"",updateTime:154297439e4},{moduleCode:"",detailCode:"1016",description:"",solution:"",updateTime:1542974273e3},{moduleCode:"",detailCode:"10032",description:"子账号不存在",solution:"",updateTime:1542973906e3},{moduleCode:"",detailCode:"20013",description:"设备已被别人添加",solution:"",updateTime:1542973817e3},{moduleCode:"",detailCode:"50000",description:"服务器错误!",solution:"",updateTime:1542973801e3},{moduleCode:"",detailCode:"60010",description:"该预置点已经是当前位置",solution:"",updateTime:15429738e5},{moduleCode:"",detailCode:"60003",description:"设备云台旋转达到下限位",solution:"",updateTime:154297377e4},{moduleCode:"",detailCode:"4",description:"设备返回其他错误",solution:"",updateTime:1542973755e3},{moduleCode:"",detailCode:"60016",description:"加密未开启,无需关闭",solution:"",updateTime:1542973753e3},{moduleCode:"",detailCode:"60002",description:"设备云台旋转达到上限位",solution:"",updateTime:1542973742e3},{moduleCode:"",detailCode:"20023",description:"设备不在线,未被用户添加",solution:"",updateTime:1542973685e3},{moduleCode:"",detailCode:"10008",description:"",solution:"",updateTime:1542973676e3},{moduleCode:"",detailCode:"20010",description:"设备验证码错误",solution:"",updateTime:1542973658e3},{moduleCode:"",detailCode:"60005",description:"设备云台旋转达到右限位",solution:"",updateTime:1542973657e3},{moduleCode:"",detailCode:"20017",description:"设备已经被自己添加",solution:"",updateTime:1542973648e3},{moduleCode:"",detailCode:"20020",description:"设备在线,已经被自己添加",solution:"",updateTime:1542973533e3},{moduleCode:"",detailCode:"20029",description:"设备不在线,已经被自己添加",solution:"",updateTime:154297353e4},{moduleCode:"",detailCode:"10014",description:"APPKEY下对应的第三方userId和phone未绑定!",solution:"",updateTime:1542973499e3},{moduleCode:"",detailCode:"20002",description:"设备不存在",solution:"",updateTime:1542973499e3},{moduleCode:"",detailCode:"10030",description:"appkey和appsecret不匹配",solution:"",updateTime:154297349e4},{moduleCode:"",detailCode:"20022",description:"设备在线,已经被别的用户添加",solution:"",updateTime:1542973486e3},{moduleCode:"",detailCode:"20008",description:"设备响应超时",solution:"",updateTime:1542973484e3},{moduleCode:"",detailCode:"20032",description:"该用户下通道不存在",solution:"",updateTime:1542973481e3},{moduleCode:"",detailCode:"20006",description:"网络异常",solution:"",updateTime:1542973475e3},{moduleCode:"",detailCode:"20014",description:"deviceSerial不合法!",solution:"",updateTime:1542973454e3},{moduleCode:"",detailCode:"20007",description:"设备不在线",solution:"",updateTime:1542973454e3},{moduleCode:"",detailCode:"20018",description:"该用户不拥有该设备",solution:"",updateTime:1542973453e3},{moduleCode:"",detailCode:"10010",description:"",solution:"",updateTime:1542973453e3},{moduleCode:"",detailCode:"10011",description:"未绑定!",solution:"",updateTime:1542973453e3},{moduleCode:"",detailCode:"20001",description:"通道不存在!",solution:"",updateTime:1542973452e3},{moduleCode:"",detailCode:"10017",description:"appKey不存在",solution:"",updateTime:1542973451e3},{moduleCode:"",detailCode:"400259",description:"",solution:"",updateTime:1542875643e3},{moduleCode:"",detailCode:"400004",description:"",solution:"",updateTime:1542873364e3},{moduleCode:"",detailCode:"3840",description:"",solution:"",updateTime:154186e7},{moduleCode:"",detailCode:"-1017",description:"",solution:"",updateTime:1541733663e3},{moduleCode:"",detailCode:"320025",description:"",solution:"",updateTime:1541078281e3},{moduleCode:"",detailCode:"320024",description:"",solution:"",updateTime:1540801374e3},{moduleCode:"",detailCode:"321002",description:"",solution:"",updateTime:1540631734e3},{moduleCode:"",detailCode:"321000",description:"",solution:"",updateTime:1540609178e3},{moduleCode:"",detailCode:"321022",description:"",solution:"",updateTime:1540548345e3},{moduleCode:"",detailCode:"321016",description:"",solution:"",updateTime:1540287187e3},{moduleCode:"",detailCode:"320023",description:"",solution:"",updateTime:1539825993e3},{moduleCode:"",detailCode:"-1016",description:"",solution:"",updateTime:1539584931e3},{moduleCode:"",detailCode:"8",description:"",solution:"",updateTime:1539391812e3},{moduleCode:"",detailCode:"1075127593",description:"",solution:"",updateTime:1538959251e3},{moduleCode:"",detailCode:"380421",description:"",solution:"",updateTime:1537288465e3},{moduleCode:"",detailCode:"322000",description:"麦克风权限未开启",solution:"",updateTime:1536820136e3},{moduleCode:"",detailCode:"1152678",description:"",solution:"",updateTime:1536738348e3},{moduleCode:"",detailCode:"320047",description:"",solution:"",updateTime:1536664472e3},{moduleCode:"",detailCode:"327006",description:"",solution:"",updateTime:153613612e4},{moduleCode:"",detailCode:"1074807593",description:"",solution:"",updateTime:1536135035e3},{moduleCode:"",detailCode:"320291",description:"",solution:"",updateTime:1536110836e3},{moduleCode:"",detailCode:"320045",description:"",solution:"",updateTime:1535963775e3},{moduleCode:"",detailCode:"370004",description:"",solution:"",updateTime:1535883699e3},{moduleCode:"",detailCode:"1149954",description:"",solution:"",updateTime:1535700674e3},{moduleCode:"",detailCode:"320053",description:"",solution:"",updateTime:1535681079e3},{moduleCode:"",detailCode:"400000",description:"",solution:"",updateTime:1535532332e3},{moduleCode:"",detailCode:"110028",description:"个人版抓图接口日调用次数超出限制",solution:"请升级企业版:https://open.ys7.com/price.html",updateTime:1535348756e3},{moduleCode:"",detailCode:"110027",description:"个人版帐号数量超出安全限制,无法调用",solution:"请升级企业版:https://open.ys7.com/price.html",updateTime:1535348734e3},{moduleCode:"",detailCode:"110026",description:"设备数量超出个人版限制,当前设备无法操作",solution:"请升级企业版:https://open.ys7.com/price.html",updateTime:1535348588e3},{moduleCode:"",detailCode:"100000",description:"",solution:"",updateTime:1534980008e3},{moduleCode:"",detailCode:"324004",description:"",solution:"",updateTime:1534927762e3},{moduleCode:"",detailCode:"360104",description:"",solution:"",updateTime:1534761006e3},{moduleCode:"",detailCode:"320204",description:"",solution:"",updateTime:1534584221e3},{moduleCode:"",detailCode:"380001",description:"",solution:"",updateTime:1534404715e3},{moduleCode:"",detailCode:"380204",description:"",solution:"",updateTime:1534401682e3},{moduleCode:"",detailCode:"328006",description:"",solution:"",updateTime:1534144407e3},{moduleCode:"",detailCode:"321703",description:"",solution:"",updateTime:1534127274e3},{moduleCode:"",detailCode:"321510",description:"",solution:"",updateTime:1533428892e3},{moduleCode:"",detailCode:"321006",description:"",solution:"",updateTime:1533036916e3},{moduleCode:"",detailCode:"50009",description:"",solution:"",updateTime:1532078548e3},{moduleCode:"",detailCode:"50007",description:"",solution:"",updateTime:153199172e4},{moduleCode:"",detailCode:"50018",description:"",solution:"",updateTime:1531912829e3},{moduleCode:"",detailCode:"380451",description:"",solution:"",updateTime:15316157e5},{moduleCode:"",detailCode:"380336",description:"",solution:"",updateTime:1531231721e3},{moduleCode:"",detailCode:"360020",description:"",solution:"",updateTime:1531117554e3},{moduleCode:"",detailCode:"380418",description:"",solution:"",updateTime:153110707e4},{moduleCode:"",detailCode:"1153445",description:"设备在该时间段内没有录像",solution:"",updateTime:1530944007e3},{moduleCode:"",detailCode:"110007",description:"调用接口总次数达到上限",solution:"请升级企业版,获取更高能力",updateTime:1530935584e3},{moduleCode:"",detailCode:"360019",description:"",solution:"",updateTime:1530869771e3},{moduleCode:"",detailCode:"360100",description:"",solution:"",updateTime:1530786188e3},{moduleCode:"",detailCode:"380042",description:"",solution:"",updateTime:1530775199e3},{moduleCode:"",detailCode:"320355",description:"",solution:"",updateTime:1530716074e3},{moduleCode:"",detailCode:"100003",description:"",solution:"",updateTime:1530232541e3},{moduleCode:"",detailCode:"371026",description:"",solution:"",updateTime:15301926e5},{moduleCode:"",detailCode:"102",description:"",solution:"",updateTime:1529895641e3},{moduleCode:"",detailCode:"380201",description:"",solution:"",updateTime:1529740929e3},{moduleCode:"",detailCode:"320054",description:"",solution:"",updateTime:1529544875e3},{moduleCode:"",detailCode:"500101",description:"",solution:"",updateTime:1529485953e3},{moduleCode:"",detailCode:"321001",description:"",solution:"",updateTime:1529411048e3},{moduleCode:"",detailCode:"321508",description:"",solution:"",updateTime:1529393279e3},{moduleCode:"",detailCode:"405991",description:"",solution:"",updateTime:1529380238e3},{moduleCode:"",detailCode:"380461",description:"",solution:"",updateTime:1529130941e3},{moduleCode:"",detailCode:"-1019",description:"",solution:"",updateTime:1529057245e3},{moduleCode:"",detailCode:"322009",description:"",solution:"",updateTime:1528965717e3},{moduleCode:"",detailCode:"324005",description:"",solution:"",updateTime:1528950153e3},{moduleCode:"",detailCode:"325000",description:"",solution:"",updateTime:1528947143e3},{moduleCode:"",detailCode:"326032",description:"",solution:"",updateTime:1528872971e3},{moduleCode:"",detailCode:"325032",description:"",solution:"",updateTime:1528863189e3},{moduleCode:"",detailCode:"328000",description:"",solution:"",updateTime:1528794505e3},{moduleCode:"",detailCode:"53",description:"",solution:"",updateTime:1528693249e3},{moduleCode:"",detailCode:"-1020",description:"",solution:"",updateTime:152849944e4},{moduleCode:"",detailCode:"329032",description:"",solution:"",updateTime:1528446301e3},{moduleCode:"",detailCode:"-1202",description:"",solution:"",updateTime:152843982e4},{moduleCode:"",detailCode:"2",description:"",solution:"",updateTime:1528434175e3},{moduleCode:"",detailCode:"1152936",description:"",solution:"",updateTime:1528345986e3},{moduleCode:"",detailCode:"328011",description:"",solution:"",updateTime:15283386e5},{moduleCode:"",detailCode:"28",description:"",solution:"",updateTime:152833753e4},{moduleCode:"",detailCode:"320356",description:"",solution:"",updateTime:1528188693e3},{moduleCode:"",detailCode:"320357",description:"",solution:"",updateTime:1528188517e3},{moduleCode:"",detailCode:"405800",description:"",solution:"",updateTime:1528168732e3},{moduleCode:"",detailCode:"405996",description:"",solution:"",updateTime:1528168686e3},{moduleCode:"",detailCode:"380357",description:"",solution:"",updateTime:1528011565e3},{moduleCode:"",detailCode:"328022",description:"",solution:"",updateTime:1527929065e3},{moduleCode:"",detailCode:"380003",description:"",solution:"",updateTime:1527927819e3},{moduleCode:"",detailCode:"50004",description:"",solution:"",updateTime:1527770643e3},{moduleCode:"",detailCode:"50011",description:"",solution:"",updateTime:1527770635e3},{moduleCode:"",detailCode:"370017",description:"",solution:"",updateTime:1527739514e3},{moduleCode:"",detailCode:"327032",description:"",solution:"",updateTime:1527726704e3},{moduleCode:"",detailCode:"324001",description:"",solution:"",updateTime:1527681892e3},{moduleCode:"",detailCode:"405997",description:"",solution:"",updateTime:1527653408e3},{moduleCode:"",detailCode:"405995",description:"",solution:"",updateTime:1527647283e3},{moduleCode:"",detailCode:"1153825",description:"",solution:"",updateTime:1527601747e3},{moduleCode:"",detailCode:"328002",description:"",solution:"",updateTime:1527495292e3},{moduleCode:"",detailCode:"1152679",description:"",solution:"",updateTime:1527486665e3},{moduleCode:"",detailCode:"380356",description:"",solution:"",updateTime:1527125669e3},{moduleCode:"",detailCode:"328032",description:"",solution:"",updateTime:1527069382e3},{moduleCode:"",detailCode:"22",description:"",solution:"",updateTime:1527049826e3},{moduleCode:"",detailCode:"9",description:"",solution:"",updateTime:1527006778e3},{moduleCode:"",detailCode:"89",description:"",solution:"",updateTime:1526622784e3},{moduleCode:"",detailCode:"328016",description:"",solution:"",updateTime:1526452365e3},{moduleCode:"",detailCode:"368005",description:"",solution:"",updateTime:1525921264e3},{moduleCode:"",detailCode:"0",description:"",solution:"",updateTime:1525920242e3},{moduleCode:"",detailCode:"380006",description:"",solution:"",updateTime:1525918868e3},{moduleCode:"",detailCode:"310",description:"",solution:"",updateTime:1525834436e3},{moduleCode:"",detailCode:"360011",description:"",solution:"",updateTime:1525681552e3},{moduleCode:"",detailCode:"170005",description:"",solution:"",updateTime:15254339e5},{moduleCode:"",detailCode:"50023",description:"",solution:"",updateTime:1525403338e3},{moduleCode:"",detailCode:"100131",description:"",solution:"",updateTime:1525229691e3},{moduleCode:"",detailCode:"-1018",description:"",solution:"",updateTime:1525142341e3},{moduleCode:"",detailCode:"362026",description:"",solution:"",updateTime:1524882677e3},{moduleCode:"",detailCode:"368007",description:"",solution:"",updateTime:1524832269e3},{moduleCode:"",detailCode:"54",description:"",solution:"",updateTime:1524793646e3},{moduleCode:"",detailCode:"1154722",description:"",solution:"",updateTime:1524620807e3},{moduleCode:"",detailCode:"320229",description:"",solution:"",updateTime:1524551682e3},{moduleCode:"",detailCode:"360012",description:"",solution:"",updateTime:1524472094e3},{moduleCode:"",detailCode:"380229",description:"",solution:"",updateTime:1524110755e3},{moduleCode:"",detailCode:"360016",description:"",solution:"",updateTime:1523933518e3},{moduleCode:"",detailCode:"-1003",description:"",solution:"",updateTime:1523584804e3},{moduleCode:"",detailCode:"410026",description:"",solution:"",updateTime:152351743e4},{moduleCode:"",detailCode:"360102",description:"TTS初始化失败",solution:"",updateTime:1523503528e3},{moduleCode:"",detailCode:"360013",description:"设备开启了隐私保护",solution:"",updateTime:1523503507e3},{moduleCode:"",detailCode:"360010",description:"设备正在对讲中",solution:"",updateTime:1523503491e3},{moduleCode:"",detailCode:"360007",description:"TTS关闭了与客户端的连接",solution:"",updateTime:1523503475e3},{moduleCode:"",detailCode:"360006",description:"客户端接收发生错误",solution:"",updateTime:1523503457e3},{moduleCode:"",detailCode:"360005",description:"客户端发送的消息错误",solution:"",updateTime:1523503437e3},{moduleCode:"",detailCode:"360004",description:"TTS内部发生错误",solution:"",updateTime:1523503421e3},{moduleCode:"",detailCode:"360003",description:"TTS的设备端发生错误",solution:"",updateTime:1523503397e3},{moduleCode:"",detailCode:"360002",description:"对讲发起超时",solution:"",updateTime:1523503376e3},{moduleCode:"",detailCode:"360001",description:"客户端请求超时",solution:"",updateTime:1523503357e3},{moduleCode:"",detailCode:"320077",description:"",solution:"",updateTime:1523444274e3},{moduleCode:"",detailCode:"370047",description:"",solution:"",updateTime:152344048e4},{moduleCode:"",detailCode:"100002",description:"",solution:"",updateTime:1523413964e3},{moduleCode:"",detailCode:"-1004",description:"",solution:"",updateTime:1523336653e3},{moduleCode:"",detailCode:"380000",description:"",solution:"",updateTime:1523180856e3},{moduleCode:"",detailCode:"380213",description:"",solution:"",updateTime:1523180623e3},{moduleCode:"",detailCode:"380101",description:"",solution:"",updateTime:1522834231e3},{moduleCode:"",detailCode:"50047",description:"",solution:"",updateTime:1522833243e3},{moduleCode:"",detailCode:"-999",description:"",solution:"",updateTime:1522831034e3},{moduleCode:"",detailCode:"320418",description:"",solution:"",updateTime:1522829072e3},{moduleCode:"",detailCode:"-1009",description:"",solution:"",updateTime:1522746247e3},{moduleCode:"",detailCode:"320209",description:"",solution:"",updateTime:1522744395e3},{moduleCode:"",detailCode:"368006",description:"",solution:"",updateTime:15227443e5},{moduleCode:"",detailCode:"369003",description:"",solution:"",updateTime:1522736355e3},{moduleCode:"",detailCode:"405989",description:"",solution:"",updateTime:1522726571e3},{moduleCode:"",detailCode:"-1012",description:"",solution:"",updateTime:1522726203e3},{moduleCode:"",detailCode:"322016",description:"",solution:"",updateTime:1522722918e3},{moduleCode:"",detailCode:"500103",description:"",solution:"",updateTime:1522655556e3},{moduleCode:"",detailCode:"405999",description:"",solution:"",updateTime:1522654716e3},{moduleCode:"",detailCode:"321032",description:"",solution:"",updateTime:1522647732e3},{moduleCode:"",detailCode:"381101",description:"",solution:"",updateTime:1522392414e3},{moduleCode:"",detailCode:"399999",description:"",solution:"",updateTime:1522379834e3},{moduleCode:"",detailCode:"380103",description:"",solution:"",updateTime:1522312724e3},{moduleCode:"",detailCode:"360014",description:"",solution:"",updateTime:1522304341e3},{moduleCode:"",detailCode:"-1005",description:"",solution:"",updateTime:1522288195e3},{moduleCode:"",detailCode:"395454",description:"",solution:"",updateTime:152222018e4},{moduleCode:"",detailCode:"100005",description:"",solution:"",updateTime:1522218849e3},{moduleCode:"",detailCode:"100004",description:"",solution:"",updateTime:1522209053e3},{moduleCode:"",detailCode:"106002",description:"",solution:"",updateTime:15222062e5},{moduleCode:"",detailCode:"410030",description:"",solution:"",updateTime:1522162252e3},{moduleCode:"",detailCode:"-1002",description:"",solution:"",updateTime:152215069e4},{moduleCode:"",detailCode:"-1200",description:"",solution:"",updateTime:1522139025e3},{moduleCode:"",detailCode:"-1001",description:"",solution:"",updateTime:1522046436e3},{moduleCode:"",detailCode:"-1011",description:"",solution:"",updateTime:1522045931e3},{moduleCode:"",detailCode:"381102",description:"",solution:"",updateTime:1522044953e3},{moduleCode:"",detailCode:"381103",description:"",solution:"",updateTime:1522044953e3},{moduleCode:"",detailCode:"391205",description:"vtdu解析服务器ip失败",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"391206",description:"vtdu描述符select失败",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"391207",description:"vtdu文件描述符不在可读中",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"391208",description:"vtdu网络发生错误getsockopt",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"391209",description:"vtdu描述符select超时",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"395000",description:"cas回复信令,发现内存已经释放(和设备之间异常断开)",solution:"检查设备网络;刷新重试",updateTime:1522034841e3},{moduleCode:"",detailCode:"395400",description:"私有化协议vtm检测私有化协议中码流类型小于0或者设备序列号为空等非法参数场景返回(app不重试取流)",solution:"刷新重试",updateTime:1522034841e3},{moduleCode:"",detailCode:"395402",description:"回放找不到录像文件",solution:"检查是否有存储卡并且接触良好",updateTime:1522034841e3},{moduleCode:"",detailCode:"395403",description:"操作码或信令密钥与设备不匹配",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"395404",description:"设备不在线",solution:"检查设备网络;重启设备接入萤石云",updateTime:1522034841e3},{moduleCode:"",detailCode:"395405",description:"流媒体向设备发送或接受信令超时/cas响应超时",solution:"检查设备网络;重启设备",updateTime:1522034841e3},{moduleCode:"",detailCode:"395406",description:"token失效",solution:"刷新重试或者重启设备",updateTime:1522034841e3},{moduleCode:"",detailCode:"395407",description:"客户端的URL格式错误",solution:"刷新重试",updateTime:1522034841e3},{moduleCode:"",detailCode:"395409",description:"预览开启隐私保护",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"395410",description:"设备达到最大连接数",solution:"请升级设备固件版本",updateTime:1522034841e3},{moduleCode:"",detailCode:"395411",description:"token无权限",solution:"刷新重试",updateTime:1522034841e3},{moduleCode:"",detailCode:"395412",description:"session不存在 ",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"395413",description:"验证token的他异常(不具体) ",solution:"刷新重试",updateTime:1522034841e3},{moduleCode:"",detailCode:"395415",description:"设备通道错",solution:"刷新重试",updateTime:1522034841e3},{moduleCode:"",detailCode:"395451",description:"设备不支持的码流类型",solution:"刷新重试或者切换到高清模式",updateTime:1522034841e3},{moduleCode:"",detailCode:"395452",description:"设备链接流媒体服务器失败 ",solution:"检查设备网络,重启设备,刷新重试",updateTime:1522034841e3},{moduleCode:"",detailCode:"395500",description:"服务器处理失败 ",solution:"刷新重试",updateTime:1522034841e3},{moduleCode:"",detailCode:"395501",description:"流媒体vtdu达到最大负载,请扩容",solution:"服务器负载达到上限,请稍后重试",updateTime:1522034841e3},{moduleCode:"",detailCode:"395503",description:"vtm返回分配vtdu失败",solution:"服务器负载达到上限,请稍后重试",updateTime:1522034841e3},{moduleCode:"",detailCode:"395544",description:"设备返回无视频源 ",solution:"设备是否接触良好;",updateTime:1522034841e3},{moduleCode:"",detailCode:"395545",description:"视频分享时间已经结束",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"395546",description:"vtdu返回达到取流并发路数限制",solution:"请升级为企业版,放开并发限制",updateTime:1522034841e3},{moduleCode:"",detailCode:"395560",description:"蚁兵代理不支持的用户取流类型,会重定向到vtdu取流",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"395557",description:"回放服务器等待流头超时",solution:"刷新重试,检测设备网络,重启设备",updateTime:1522034841e3},{moduleCode:"",detailCode:"395600",description:"分享设备不在分享时间内",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"395601",description:"群组分享用户没权限",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"395602",description:"群组分享权限变更",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"395556",description:"ticket取流验证失败",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"395530",description:"机房故障不可用",solution:"刷新重试",updateTime:1522034841e3},{moduleCode:"",detailCode:"395701",description:"cas信令返回格式错误",solution:"刷新重试",updateTime:1522034841e3},{moduleCode:"",detailCode:"396001",description:"客户端参数出错",solution:"刷新重试",updateTime:1522034841e3},{moduleCode:"",detailCode:"396099",description:"客户端默认错误",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"396101",description:"不支持的命令",solution:"刷新重试",updateTime:1522034841e3},{moduleCode:"",detailCode:"396102",description:"设备流头发送失败",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"396103",description:"cas/设备返回错误1",solution:"刷新重试",updateTime:1522034841e3},{moduleCode:"",detailCode:"396104",description:"cas/设备返回错误-1",solution:"刷新重试",updateTime:1522034841e3},{moduleCode:"",detailCode:"396105",description:"设备返回错误码3",solution:"刷新重试",updateTime:1522034841e3},{moduleCode:"",detailCode:"396106",description:"设备返回错误码4",solution:"刷新重试",updateTime:1522034841e3},{moduleCode:"",detailCode:"396107",description:"设备返回错误码5",solution:"刷新重试",updateTime:1522034841e3},{moduleCode:"",detailCode:"396108",description:"cas信令回应重复",solution:"刷新重试",updateTime:1522034841e3},{moduleCode:"",detailCode:"396109",description:"视频广场取消分享",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"396110",description:"设备信令默认错误",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"396501",description:"设备数据链路和实际链路不匹配",solution:"刷新重试",updateTime:1522034841e3},{moduleCode:"",detailCode:"396502",description:"设备数据链路重复建立连接",solution:"刷新重试",updateTime:1522034841e3},{moduleCode:"",detailCode:"396503",description:"设备数据链路端口不匹配",solution:"刷新重试",updateTime:1522034841e3},{moduleCode:"",detailCode:"396504",description:"缓存设备数据链路失败(内存块不足)",solution:"刷新重试",updateTime:1522034841e3},{moduleCode:"",detailCode:"396505",description:"设备发送确认头消息重复",solution:"刷新重试",updateTime:1522034841e3},{moduleCode:"",detailCode:"396506",description:"设备数据先于确定头部到达",solution:"刷新重试",updateTime:1522034841e3},{moduleCode:"",detailCode:"396508",description:"设备数据头部长度非法",solution:"刷新重试,或者重启设备",updateTime:1522034841e3},{moduleCode:"",detailCode:"396509",description:"索引找不到设备数据管理块",solution:"刷新重试",updateTime:1522034841e3},{moduleCode:"",detailCode:"396510",description:"设备数据链路vtdu内存块协议状态不匹配",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"396511",description:"设备数据头部没有streamkey错误",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"396512",description:"设备数据头部非法(较笼统)",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"396513",description:"设备数据长度过小",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"396514",description:"设备老协议推流头部没有streamkey错误",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"396515",description:"设备老协议推流数据非法",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"396516",description:"设备老协议索引找不到内存管理块",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"396517",description:"设备老协议推流数据非法",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"396518",description:"设备数据包过大",solution:"刷新重试,或者重启设备",updateTime:1522034841e3},{moduleCode:"",detailCode:"396519",description:"设备推流链路网络不稳定",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"396520",description:"设备推流链路网络不稳定(默认)",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"170003",description:"refreshToken不存在",solution:"建议用户重新调用logout接口,然后调用openLoginPage接口重新启动登录页面登录",updateTime:1522034841e3},{moduleCode:"",detailCode:"170004",description:"refreshToken已过期",solution:"建议用户重新调用logout接口,然后调用openLoginPage接口重新启动登录页面登录",updateTime:1522034841e3},{moduleCode:"",detailCode:"380011",description:"设备隐私保护中",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"380045",description:"设备直连取流连接数量过大",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"380047",description:"设备不支持该命令",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"380077",description:"设备正在对讲中",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"380102",description:"数据接收异常",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"380205",description:"设备检测入参异常",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"380209",description:"网络连接超时",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"380212",description:"设备端网络连接超时",solution:"",updateTime:1522034841e3},{moduleCode:"",detailCode:"101007",description:"手机号未注册",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120503",description:"正在响铃",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390016",description:"vtdu成功响应未携带流头",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"101008",description:"手机号码不合法",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120504",description:"室内机正在通话",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390017",description:"无数据流,尚未使用",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"101009",description:"用户名与手机不匹配",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120505",description:"设备操作失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390018",description:"信令消息体PB解析失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"101010",description:"获取验证码失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120506",description:"非法命令",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390019",description:"信令消息体PB封装失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"101011",description:"验证码错误",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120507",description:"智能锁密码错误",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390020",description:"申请系统内存资源失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"101012",description:"验证码失效",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120508",description:"开关锁失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390021",description:"vtdu地址尚未获取到",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"101013",description:"用户不存在",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120509",description:"开关锁超时",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390022",description:"客户端尚未支持",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"101014",description:"密码不正确或者appKey不正确",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120510",description:"智能锁设备繁忙",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390023",description:"获取系统socket资源失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"101015",description:"用户被锁住",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120511",description:"远程开锁功能未打开",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390024",description:"上层填充的StreamSsnId不匹配",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"101021",description:"验证参数异常",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120600",description:"临时密码数已达上限",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390025",description:"链接服务器失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"101026",description:"邮箱已经被注册",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120601",description:"添加临时密码失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390026",description:"客户端请求未收到服务端应答",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"101031",description:"邮箱未注册",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120602",description:"删除临时密码失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390027",description:"链路断开",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"101032",description:"邮箱不合法",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120603",description:"该临时密码不存在",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390028",description:"没有取流链接",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"101041",description:"获取验证码过于频繁",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120604",description:"指纹锁射频通信失败,请稍后再试",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390029",description:"流成功停止",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"101043",description:"手机验证码输入错误超过规定次数",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120605",description:"其他用户正在认证中",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390030",description:"客户端防串流校验失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"102000",description:"设备不存在",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120606",description:"验证已启动,请在120s内进行本地验证和调用添加设备接口",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390031",description:"应用层tcp粘包处理缓冲区满",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"102001",description:"摄像机不存在",solution:"摄像机未注册到萤石云平台,请仔细检查摄像机的网络配置,确保连接到网络",updateTime:152203484e4},{moduleCode:"",detailCode:"120607",description:"删除用户失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390032",description:"无效状态迁移",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"102003",description:"设备不在线",solution:"参考服务中心排查方法",updateTime:152203484e4},{moduleCode:"",detailCode:"120608",description:"用户不存在",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390033",description:"无效客户端状态",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"102004",description:"设备异常",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120609",description:"设备响应超时,门锁通信故障或者电量不足,请重试.",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390034",description:"向vtm取流流媒体信息请求超时",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"102007",description:"设备序列号不正确",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120610",description:"获取临时密码列表失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390035",description:"向代理取流请求超时",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"102009",description:"设备请求响应超时异常",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"130001",description:"用户不存在",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390036",description:"向代理保活取流请求超时",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"105000",description:"设备已被自己添加",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"130002",description:"手机号码已经注册",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390037",description:"向vtdu取流请求超时",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"105001",description:"设备已被别人添加",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"130003",description:"手机验证码错误",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390038",description:"向vtdu保活取流请求超时",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"105002",description:"设备验证码错误",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"130004",description:"终端绑定操作失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"391001",description:"vtm地址或端口非法",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"107001",description:"邀请不存在",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"149999",description:"数据异常",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"391002",description:"vtm生成文件描述符失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"107002",description:"邀请验证失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"150000",description:"服务器异常",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"391003",description:"vtm设置文件描述符非阻塞失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"107003",description:"邀请用户不匹配",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160000",description:"设备不支持云台控制",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"391004",description:"vtm设置文件描述符阻塞失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"107004",description:"云存储连接失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160001",description:"用户无云台控制权限",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"391005",description:"vtm解析服务器ip失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"7005",description:"VTDU主动断开连接",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"107005",description:"VTDU主动断开连接",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160002",description:"设备云台旋转达到上限位",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"391006",description:"vtm描述符select失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"107006",description:"不能邀请自己",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160003",description:"设备云台旋转达到下限位",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"391007",description:"vtm文件描述符不在可读中",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"107007",description:"重复邀请",solution:"分享和删除分享必须全部由接口形式操作,如果与萤石客户端混用会造成这个问题,解决办法:在萤石客户端清空所有相关分享数据并重新添加设备,再通过接口操作即可",updateTime:152203484e4},{moduleCode:"",detailCode:"160004",description:"设备云台旋转达到左限位",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"391008",description:"vtm网络发生错误getsockopt",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"110001",description:"参数错误",solution:"参数为空或者格式不对",updateTime:152203484e4},{moduleCode:"",detailCode:"160005",description:"设备云台旋转达到右限位",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"391009",description:"vtm描述符select超时",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"110002",description:"accessToken异常或过期",solution:"accessToken有效期为七天,建议在accessToken即将过期或者出现10002错误码的时候重新获取accessToken",updateTime:152203484e4},{moduleCode:"",detailCode:"160006",description:"云台当前操作失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"391101",description:"proxy地址或端口非法",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"110004",description:"用户不存在",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160007",description:"预置点个数超过最大值",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"391102",description:"proxy生成文件描述符失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"110005",description:"appKey异常",solution:"确认appKey状态,不通过或者冻结状态会返回该错误码",updateTime:152203484e4},{moduleCode:"",detailCode:"160009",description:"正在调用预置点",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"391103",description:"proxy设置文件描述符非阻塞失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"110006",description:"ip受限",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160010",description:"该预置点已经是当前位置",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"391104",description:"proxy设置文件描述符阻塞失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160011",description:"预置点不存在",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"391105",description:"proxy解析服务器ip失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"110008",description:"签名错误",solution:"①获取签名方式详见apidemo及[旧]API文档 ②注意编码格式为UTF-8",updateTime:152203484e4},{moduleCode:"",detailCode:"160013",description:"设备版本已是最新",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"391106",description:"proxy描述符select失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"110009",description:"签名参数错误",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160014",description:"设备正在升级",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"391107",description:"proxy文件描述符不在可读中",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"110010",description:"签名超时",solution:"请调用同步服务器时间接口进行校时",updateTime:152203484e4},{moduleCode:"",detailCode:"160015",description:"设备正在重启",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"391108",description:"proxy网络发生错误getsockopt",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"110011",description:"未开通萤石云服务",solution:"参照绑定流程",updateTime:152203484e4},{moduleCode:"",detailCode:"160016",description:"加密未开启,无须关闭",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"391109",description:"proxy描述符select超时",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"110012",description:"第三方账户与萤石账号已经绑定",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160017",description:"设备抓图失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"391201",description:"vtdu地址或端口非法",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"110013",description:"应用没有权限调用此接口",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160018",description:"设备升级失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"391202",description:"vtdu生成文件描述符失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"110014",description:"APPKEY下对应的第三方userId和phone未绑定",solution:"获取AccessToken时所用appKey与SDK所用appKey不一致",updateTime:152203484e4},{moduleCode:"",detailCode:"160019",description:"加密已开启",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"391203",description:"vtdu设置文件描述符非阻塞失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"110017",description:"appKey不存在",solution:"请填写在官网申请的应用秘钥",updateTime:152203484e4},{moduleCode:"",detailCode:"160020",description:"不支持该命令",solution:"请确认设备是否支持该命令",updateTime:152203484e4},{moduleCode:"",detailCode:"391204",description:"vtdu设置文件描述符阻塞失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"110018",description:"AccessToken与Appkey不匹配",solution:"请检查获取accessToken对应的appKey和SDK中设置的appKey是否一致",updateTime:152203484e4},{moduleCode:"",detailCode:"160023",description:"订阅操作失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"110019",description:"密码错误",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160024",description:"取消订阅操作失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"110020",description:"请求方法为空",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160025",description:"客流统计配置失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"110021",description:"ticket校验失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160026",description:"设备处于隐私遮蔽状态",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"110022",description:"透传目的地非法",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160027",description:"设备正在镜像操作",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"110024",description:"无透传权限",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160028",description:"设备正在键控动作",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"110025",description:"appKey被禁止使用通明通道",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160029",description:"设备处于语音对讲状态",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160030",description:"卡密输入错误次数过多,24小时后再输入",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160031",description:"卡密信息不存在",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160032",description:"卡密状态不对或已过期",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160033",description:"卡密非卖品,只能开通对应的绑定设备",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"110030",description:"appKey和appSecret不匹配",solution:"请检查appKey和appSecret是否对应",updateTime:152203484e4},{moduleCode:"",detailCode:"160035",description:"购买云存储服务失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"110031",description:"子账户或萤石用户没有权限",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160040",description:"添加的设备不在同一局域网",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"110032",description:"子账户不存在",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160041",description:"添加的设备被其他设备关联或响应超时",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"110033",description:"子账户未设置授权策略",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160042",description:"添加的设备密码错误",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"110034",description:"子账户已存在",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160043",description:"添加的设备超出最大数量",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"110035",description:"获取子账户AccessToken异常",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160044",description:"添加的设备网络不可达超时",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"110036",description:"子账户被禁用",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160045",description:"添加的设备的IP和其他通道的IP冲突",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"110051",description:"无权限进行抓图",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160046",description:"添加的设备的IP和本设备的IP冲突",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160047",description:"码流类型不支持",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120002",description:"设备不存在",solution:"①设备没有注册到萤石云平台,请检查下设备网络参数,确保能正常连接网络②设备序列号不存在",updateTime:152203484e4},{moduleCode:"",detailCode:"160048",description:"带宽超出系统接入带宽",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120003",description:"参数异常,SDK版本过低",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160049",description:"IP或者端口不合法",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120004",description:"参数异常,SDK版本过低",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160050",description:"添加的设备版本不支持需要升级才能接入",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120005",description:"安全认证失败,需进行SDK安全认证",solution:"已去掉安全验证",updateTime:152203484e4},{moduleCode:"",detailCode:"160051",description:"添加的设备不支持接入",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120006",description:"网络异常",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160052",description:"添加的设备通道号出错",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120007",description:"设备不在线",solution:"参考服务中心排查方法",updateTime:152203484e4},{moduleCode:"",detailCode:"160053",description:"添加的设备分辨率不支持",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120008",description:"设备响应超时",solution:"设备响应超时,请检测设备网络或重试",updateTime:152203484e4},{moduleCode:"",detailCode:"160054",description:"添加的设备账号被锁定",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120009",description:"子账号不能添加设备",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160055",description:"添加的设备取码流出错",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120010",description:"设备验证码错误",solution:"验证码在设备标签上,六位大写字母,注意大小写",updateTime:152203484e4},{moduleCode:"",detailCode:"160056",description:"删除设备失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120012",description:"设备添加失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160057",description:"删除的设备未关联",solution:"检查IPC与NVR是否有关联关系",updateTime:152203484e4},{moduleCode:"",detailCode:"120013",description:"设备已被别人添加",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160060",description:"地址未绑定",solution:"请前往官网设置直播",updateTime:152203484e4},{moduleCode:"",detailCode:"120014",description:"设备序列号不正确",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160061",description:"账户流量已超出或未购买,限制开通",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120015",description:"设备不支持该功能",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160062",description:"该通道直播已开通",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120016",description:"当前设备正在格式化",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160063",description:"直播未使用或直播已关闭",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120017",description:"设备已被自己添加",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160070",description:"设备不能转移给自己",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120018",description:"该用户不拥有该设备",solution:"确认设备是否属于用户",updateTime:152203484e4},{moduleCode:"",detailCode:"160071",description:"设备不能转移,设备与其他设备存在关联关系",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"400001",description:"参数为空",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120019",description:"设备不支持云存储服务",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160072",description:"设备不能转移,通道被分享给其他用户或者分享到视频广场",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"400002",description:"参数错误",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120020",description:"设备在线,被自己添加",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160073",description:"云存储转移失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"400025",description:"设备不支持对讲",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120021",description:"设备在线,但是未被用户添加",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160080",description:"当前正在声源定位",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"400029",description:"没有初始化或资源被释放",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120022",description:"设备在线,但是已经被别的用户添加",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160081",description:"当前正在轨迹巡航",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"400030",description:"json解析异常",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120023",description:"设备不在线,未被用户添加",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160082",description:"设备正在响应本次声源定位",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"400031",description:"网络异常",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120024",description:"设备不在线,但是已经被别的用户添加",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"160083",description:"当前正在开启隐私遮蔽",solution:"设备正在操作隐私遮蔽,无法进行当前操作",updateTime:152203484e4},{moduleCode:"",detailCode:"400032",description:"设备信息异常为空",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120025",description:"重复申请分享",solution:"确认设备是否由添加过该设备且申请过分享的账户下是否还存在分享记录",updateTime:152203484e4},{moduleCode:"",detailCode:"160084",description:"当前正在关闭隐私遮蔽",solution:"设备正在操作隐私遮蔽,无法进行当前操作",updateTime:152203484e4},{moduleCode:"",detailCode:"400034",description:"取流超时",solution:"一般是由于网络状况不好导致,可以尝试下让用户重新播放",updateTime:152203484e4},{moduleCode:"",detailCode:"120026",description:"视频广场不存在该视频",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"380290",description:" 连接CAS服务器失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"400035",description:"设备已加密,需要输入验证码",solution:"收到此错误码,需要让用户输入验证码后,调用EZPlayer.setPlayKey传入验证码,并重新调用播放函数",updateTime:152203484e4},{moduleCode:"",detailCode:"120027",description:"视频转码失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"361001",description:"对讲服务端排队超时",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"400036",description:"播放验证码错误",solution:"收到此错误码,需要让用户输入验证码后,调用EZPlayer.setPlayKey传入验证码,并重新调用播放函数",updateTime:152203484e4},{moduleCode:"",detailCode:"120028",description:"设备固件升级包不存在",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"361002",description:"对讲服务端处理超时",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"400037",description:"surfacehold错误",solution:"请检查是否是播放之前销毁了surface,收到此错误也可以重新建立surface后播放",updateTime:152203484e4},{moduleCode:"",detailCode:"120029",description:"设备不在线,但是已经被自己添加",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"361003",description:"设备链接对讲服务器超时",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"400100",description:"未知错误",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120030",description:"该用户不拥有该视频广场视频",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"361004",description:"服务器内部错误",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"400200",description:"player sdk出错,这种错误一般开发者也是无法解决,不具体分类传出,传一个统一的inner错误码出去",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120031",description:"开启终端绑定,硬件特征码验证失败",solution:"请在萤石客户端关闭终端绑定,参考此步骤",updateTime:152203484e4},{moduleCode:"",detailCode:"361005",description:"解析消息失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"400300",description:"内存溢出",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120032",description:"该用户下通道不存在",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"361006",description:"请求重定向--需要向其他服务申请对讲",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"400901",description:"设备不在线,可以提示用户",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120033",description:"无法收藏自己分享的视频",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"361007",description:"请求url非法",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"400902",description:"accesstoken异常或失效,需要重新获取accesstoken,并传入到sdk",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120034",description:"该用户下无设备",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"361008",description:"token失效",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"400903",description:"当前账号开启了终端绑定,只允许指定设备登录操作,提示用户登录i.ys7.com解除终端绑定",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120090",description:"用户反馈失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"361009",description:"设备验证码或者通信秘钥不匹配",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"400904",description:"设备正在对讲中",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120095",description:"APP包下载失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"361010",description:"设备已经在对讲",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"400905",description:"设备开启了隐私保护,不允许预览、对讲等",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120096",description:"APP包信息删除失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"361011",description:"设备10s响应超时",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120101",description:"视频不支持分享给本人",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"361012",description:"设备不在线",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"320002",description:"参数无效",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120102",description:"无相应邀请信息",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"361013",description:"设备开启隐私保护拒绝对讲",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"320003",description:"暂不支持此操作",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120103",description:"好友已存在",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"361014",description:"token无权限",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"320004",description:"内存溢出",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120104",description:"好友不存在",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"361015",description:"设备返回session不存在",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"320005",description:"创建CAS session失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120105",description:"好友状态错误",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"361016",description:"验证token其他异常错误",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"320006",description:"创建cloud session失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120106",description:"对应群组不存在",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"361017",description:"服务端监听设备建立端口超时",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"320007",description:"token失效",solution:"重新设置token后再重试",updateTime:152203484e4},{moduleCode:"",detailCode:"120107",description:"不能添加自己为好友",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"361018",description:"设备链路异常",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"320008",description:"token池里面没有token,请传入token",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120108",description:"当前用户和所添加用户不是好友关系",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"361019",description:"对讲服务端不支持的信令消息",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"320009",description:"传入新的INIT_PARAM并reset(保留,目前未用)",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120109",description:"对应分享不存在",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"361020",description:"对讲服务端解析对讲请求未携带会话描述能力集",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"320010",description:"请重试",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120110",description:"好友群组不属于当前用户",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"361021",description:"对讲服务端优先能力集结果为空",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"320011",description:"500毫秒后请重试",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120111",description:"好友不是等待验证状态",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"361022",description:"cas链路异常",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"320012",description:"token池已满",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120112",description:"添加应用下的用户为好友失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"361023",description:"对讲服务端分配对讲会话资源失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"320013",description:"P2P client超过限制",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120201",description:"操作报警信息失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"361024",description:"对讲服务端解析信令消息失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"320014",description:"sdk未初始化",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120202",description:"操作留言信息失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390001",description:"通用错误返回",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"320015",description:"超时",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120301",description:"根据UUID查询报警消息不存在",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390002",description:"入参为空指针",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"320016",description:"正在打洞中",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120302",description:"根据UUID查询图片不存在",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390003",description:"入参值无效",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"320017",description:"没有视频文件头(播放器层面产生和处理此错误)",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120303",description:"根据FID查询图片不存在",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390004",description:"信令消息解析非法",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"320018",description:"解码错误/超时(播放器层面产生和处理此错误)",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120305",description:"设备ip解析错误",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390005",description:"内存资源不足",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"320019",description:"取消(保留,用户不用处理)",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120401",description:"用户云空间信息不存在",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390006",description:"协议格式不对或者消息体长度超过STREAM_MAX_MSGBODY_LEN",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"320020",description:"播放过程中预连接被用户清除预操作信息",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120402",description:"云空间操作失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390007",description:"设备序列号长度不合法",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"320021",description:"流加密码不对",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120403",description:"用户目录不存在",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390008",description:"取流url长度不合法",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"320022",description:"未传入播放窗口",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120404",description:"要操作的目标目录不存在",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390009",description:"解析vtm返回vtdu地址不合法",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"100200",description:"操作成功",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120405",description:"要删除的文件信息不存在",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390010",description:"解析vtm返回级联vtdu地址不合法",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"101001",description:"用户名不合法",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120406",description:"已开通云存储",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390011",description:"解析vtm返回会话标识长度不合法",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"101002",description:"用户名已被占用",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120407",description:"开通记录失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390012",description:"vtdu返回流头长度不合法",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"101003",description:"密码不合法",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120500",description:"获取数据错误",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390013",description:"vtdu会话长度非法",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"101004",description:"密码为同一字符",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120501",description:"开锁失败",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390014",description:"回调函数未注册",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"101006",description:"手机号码已经被注册",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"120502",description:"室内机未收到呼叫",solution:"",updateTime:152203484e4},{moduleCode:"",detailCode:"390015",description:"vtdu成功响应未携带会话标识",solution:"",updateTime:152203484e4}],z="200",F="操作成功!",L={data:B,code:z,msg:F},O=function(){function e(t,n){c(this,e),this.coreX=t,this.coreY=n,console.log("ErrorCode",L)}return l(e,[{key:"toString",value:function(){return"".concat(this.coreX,"-").concat(this.coreY)}},{key:"matchErrorInfo",value:function(e){return L.data.find((function(t){return t.detailCode.substr(-4)==e}))}}]),e}(),N={color:"red",backgroundColor:"red",activeColor:"red",btnList:[{btnKey:"ade5d065a113432e8091a1c5bc819c57-934f270c08b14e928bf0c2ae8e1a937d-header-0",iconId:"deviceID",part:"left",defaultActive:1,isrender:1,themeId:"934f270c08b14e928bf0c2ae8e1a937d"},{btnKey:"ade5d065a113432e8091a1c5bc819c57-934f270c08b14e928bf0c2ae8e1a937d-header-1",iconId:"deviceName",part:"left",defaultActive:1,isrender:1,themeId:"934f270c08b14e928bf0c2ae8e1a937d"}]},U={color:"blue",backgroundColor:"blue",activeColor:"blue",btnList:[{btnKey:"ade5d065a113432e8091a1c5bc819c57-934f270c08b14e928bf0c2ae8e1a937d-footer-0",iconId:"play",part:"left",defaultActive:0,isrender:0,themeId:"934f270c08b14e928bf0c2ae8e1a937d"}]},V={header:N,footer:U},H=function e(t){this.jsPlugin=t;var n={isMouseDown:!1,isOver:!1,mousePosition:null,oldTime:null,nowTime:null,moved:null,hoverTime:"2018-12-07 12:00:00",hoverLeft:0,timeTipShow:!1,randomNum:123,timeWidthTbls:[60,1800,3600,86400],timeUnits:["范围: 1分钟; 单位: 秒","范围: 30分钟; 单位: 分钟","范围: 1小时; 单位: 分钟","范围: 1天; 单位: 小时","范围: 3天; 单位: 小时"],drawPen:null,timeSection:[],canvasWidth:null,canvasHeight:null,timeTips:null},i=this;Object.keys(n).forEach((function(e){i[e]=n[e]})),this.options={width:this.canvasWidth,height:48,time:(new Date).getTime(),timeSection:[],timeWidth:0},e.prototype.subTime=function(e){return e<10?"0"+e:e},e.prototype.tranTime=function(e){var t=e;if(e){var n=new Date(e);t=n.getFullYear()+"/"+(n.getMonth()+1)+"/"+n.getDate()+" "+this.subTime(n.getHours())+":"+this.subTime(n.getMinutes())+":"+this.subTime(n.getSeconds())}return t},e.prototype.init=function(e){e.width&&document.getElementById(e.id).setAttribute("width",parseInt(e.width,10)+"px");var t=this,n=this.options;t.randomNum=(Math.random()+"").split(".").join(""),t.timeWidthTblIndex=n.timeWidth;var i=document.querySelector("#".concat(this.jsPlugin.id,"-canvas"));t.drawPen=i.getContext("2d"),t.nowTime=n.time||Date.now(),t.timeSection=n.timeSection||[],t.canvasWidth=i.offsetWidth,t.canvasHeight=i.offsetHeight,t.updata(),document.getElementById("".concat(this.jsPlugin.id,"-canvas")).addEventListener("mousemove",(function(e){t.options.readOnly||t.mousemove(e)})),document.getElementById("".concat(this.jsPlugin.id,"-canvas")).addEventListener("mouseover",(function(e){t.options.readOnly||t.mouseover(e)})),document.getElementById("".concat(this.jsPlugin.id,"-canvas")).addEventListener("mouseleave",(function(e){t.options.readOnly||t.mouseleave(e)})),document.getElementById("".concat(this.jsPlugin.id,"-canvas")).addEventListener("mousedown",(function(e){t.options.readOnly||t.mousedown(e)})),document.getElementById("".concat(this.jsPlugin.id,"-canvas")).addEventListener("mouseup",(function(n){if(!t.options.readOnly){var i=e.onChange;t.mouseUpFn(n,i)}}))},e.prototype.mousemove=function(e){if(this.isMouseDown&&this.isOver){var t=this.mousePosition-e.pageX;if(0===t)return;var n=0;switch(this.timeWidth){case 60:n=.1;break;case 1800:n=3;break;case 3600:n=3;break;case 86400:n=120;break}var i=new Date(this.oldTime).getTime()+t*n*1e3;this.updata({time:i}),this.moved=!0}else{var o=parseInt(document.getElementById("".concat(this.jsPlugin.id,"-canvas-container")).offsetLeft,10);this.mousePosition=e.pageX-o,this.updata()}},e.prototype.mousedown=function(e){this.isMouseDown=!0,this.mousePosition=e.pageX,this.oldTime=this.nowTime},e.prototype.mouseover=function(e){this.isOver=!0},e.prototype.mouseleave=function(e){this.isOver=!1,this.isMouseDown=!1,this.updata()},e.prototype.changeSize=function(e){console.log("changeSize",e),this.options.timeWidth=e,this.updata({timeWidth:e})},e.prototype.mouseUpFn=function(e,t){if(this.isMouseDown&&(this.isMouseDown=!1,this.moved)){this.moved=!1;var n=this.subTime(new Date(this.nowTime).getHours())+":"+this.subTime(new Date(this.nowTime).getMinutes())+":"+this.subTime(new Date(this.nowTime).getSeconds()),i=new Date(this.oldTime).getFullYear()+"/"+(new Date(this.oldTime).getMonth()+1)+"/"+new Date(this.oldTime).getDate();this.nowTime=new Date("".concat(i," ").concat(n)),this.updata({time:this.nowTime}),this.oldTime=this.nowTime,console.log("nowTime",new Date(this.nowTime),"".concat(i," ").concat(n)),t(this.nowTime)}},e.prototype.readOnly=function(e){console.log("更改为只读"),this.options.readOnly=!0,document.getElementById("".concat(this.jsPlugin.id,"-canvas")).style.cursor="not-allowed"},e.prototype.unReadOnly=function(e){console.log("更改为只读"),this.options.readOnly=!1,document.getElementById("".concat(this.jsPlugin.id,"-canvas")).style.cursor="pointer"},e.prototype.run=function(e){this.isMouseDown||this.updata(e)},e.prototype.getTime=function(e){console.log("this",this),console.log("当前时间",new Date(this.nowTime))},e.prototype.updata=function(e){var t=this;e=e||{},t.nowTime=e.time||t.nowTime,t.timeSection=e.timeSection||t.timeSection,t.timeWidthTblIndex=e.timeWidth||t.timeWidthTblIndex,t.timeWidth=t.timeWidthTbls[e.timeWidth||t.timeWidthTblIndex],t.timeUnit=t.timeUnits[e.timeWidth||t.timeWidthTblIndex],0===e.timeWidth&&(t.timeWidthTblIndex=0,t.timeWidth=t.timeWidthTbls[0],t.timeUnit=t.timeUnits[0]),t.drawPen.fillStyle="#000000",t.drawPen.fillRect(0,0,t.canvasWidth,t.canvasHeight),t.drawScale(),t.drawRecord(),t.drawOtherMsg(),document.getElementById("".concat(this.jsPlugin.id,"-canvas-container")).style.width=this.options.width+"px",document.getElementById("".concat(this.jsPlugin.id,"-canvas")).style.width=this.options.width+"px",document.getElementById("".concat(this.jsPlugin.id,"-canvas-container")).style.height=this.options.height+"px",document.getElementById("".concat(this.jsPlugin.id,"-canvas")).style.height=this.options.height+"px"},e.prototype.drawSolidLine=function(e,t,n,i,o,r){this.drawPen.save(),this.drawPen.strokeStyle=r,this.drawPen.lineWidth=o,this.drawPen.beginPath(),this.drawPen.moveTo(e,t),this.drawPen.lineTo(n,i),this.drawPen.stroke(),this.drawPen.restore()},e.prototype.drawString=function(e,t,n,i,o){this.drawPen.font="12px serif",this.drawPen.fillStyle="#ffffff",this.drawPen.textAlign=i||"left",this.drawPen.fillText(e,t,n+10)},e.prototype.drawScale=function(){var e=this,t="rgba(255,255,255)",n=new Date(e.nowTime),i=n.getFullYear(),o=n.getSeconds(),r=n.getMinutes(),a=n.getHours(),d=n.getDate(),c=0;switch(e.timeWidth){case 60:var s=parseInt(e.canvasWidth/10);n.setSeconds(n.getSeconds()-parseInt(s/2,10)),d=n.getDate(),a=n.getHours(),r=n.getMinutes(),o=n.getSeconds();for(var l=0;lt.canvasWidth&&(o=t.canvasWidth),o<=0&&(o=0),o}},e.prototype.drawOtherMsg=function(){this.drawSolidLine(this.canvasWidth/2,0,this.canvasWidth/2,this.canvasHeight,2,"#1890FF"),this.drawPen.shadowBlur=0,this.isOver&&!this.isMouseDown?(this.mouseTime=this.mousePosition/this.canvasWidth*this.timeWidth*1e3+this.nowTime-this.timeWidth/2*1e3,this.mouseString=this.tranTime(this.mouseTime),this.hoverTime=this.mouseString,this.hoverLeft=this.mousePosition-60,this.timeTipShow=!0):this.timeTipShow=!1}},W=function(){function e(t){if(c(this,e),this.jSPlugin=t,!document.getElementById("".concat(this.jSPlugin.id,"-audioControls")))return!1;this.currentTimeWidth=1,this.date=new Date,this.datepickerVisible=!1,this.seekTimer=null,this.disabled=!1,this.seekFrequency=2e3,this.jSPlugin.params&&this.jSPlugin.params.seekFrequency&&(this.seekFrequency=this.jSPlugin.params.seekFrequency),this.recInit()}return l(e,[{key:"recInit",value:function(){var e=this,t=parseInt(getComputedStyle(document.getElementById(this.jSPlugin.id)).width,10)-100,n=document.createElement("div");n.style="display:inline-block;height:48px;",n.id=this.jSPlugin.id+"-canvas-container";var i=document.createElement("canvas");i.id=this.jSPlugin.id+"-canvas",i.className="time-line-body",i.height="48",i.width=t,i.style="display:inline-block;",i.innerHTML="该浏览器不支持canvas",n.appendChild(i),v(n,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")));var o=document.createElement("div");o.className="timeline-controls",o.style="display:flex;width:100px;height:48px;text-align:center;line-height: 48px;vertical-align: top;background: #000000;";var r='\n
\n \n \n add\n \n \n \n \n \n \n \n \n \n \n \n \n \n reduce\n \n \n \n \n \n \n \n \n
\n\n\n');o.innerHTML=r,v(o,n),this.timeLine=new H(this.jSPlugin),this.timeLine.init({id:this.jSPlugin.id+"-canvas",width:t,onChange:function(t){console.log("time",t,new Date(t).Format("yyyyMMddhhmmss"));var n=new Date(t).Format("yyyyMMddhhmmss");if("cloud.rec"===P(e.jSPlugin.url).type){var i=function(){e.jSPlugin.seek(n.substr(8,6),"235959"),e.unSyncTimeLine(),setTimeout((function(){e.syncTimeLine()}),6e3)};e.seekTimer?clearTimeout(e.seekTimer):i(),e.seekTimer=setTimeout((function(){i(),clearTimeout(e.seekTimer),e.seekTimer=null}),e.seekFrequency)}else{var o=function(){setTimeout((function(){e.disabled=!1}),e.seekFrequency)},r=function(t){e.disabled=!0,e.jSPlugin.pause().then((function(){console.log("暂停成功"),e.jSPlugin.resume(n).then((function(n){console.log("恢复成功"),e.jSPlugin.Theme&&e.jSPlugin.Theme.setDecoderState({play:!0}),e.jSPlugin.Theme&&e.jSPlugin.Theme.decoderState.state.sound&&e.jSPlugin.openSound(),t&&t()}))["catch"]((function(e){console.log("恢复失败",e)}))}))["catch"]((function(){console.log("暂停失败"),e.jSPlugin.resume(n).then((function(n){console.log("恢复成功"),e.jSPlugin.Theme&&e.jSPlugin.Theme.setDecoderState({play:!0}),t&&t()}))["catch"]((function(e){console.log("恢复失败",e)}))}))};e.disabled?(console.log("操作频繁,等待2秒后执行"),e.seekTimer&&clearTimeout(e.seekTimer),e.seekTimer=setTimeout((function(){r(o)}),e.seekFrequency)):r(o)}}}),this.syncTimeLine(),h("".concat(this.jSPlugin.staticPath,"/rec/datepicker.min.css")),m("".concat(this.jSPlugin.staticPath,"/rec/jquery.min.js"),(function(){m("".concat(e.jSPlugin.staticPath,"/rec/datepicker.js"),(function(){m("".concat(e.jSPlugin.staticPath,"/rec/datepicker.zh-CN.js"),(function(){document.getElementsByClassName("datepicker-container")[0]||$("#".concat(e.jSPlugin.id,"-datepicker")).datepicker({autoShow:!1,autoHide:!0,autoPick:!0,language:"zh-CN",defaultDate:new Date,format:"yyyy-mm-dd",endDate:new Date,inline:!0,container:document.getElementById("".concat(e.jSPlugin.id,"-wrap"))}),document.getElementsByClassName("datepicker-container")[0]&&(document.getElementsByClassName("datepicker-container")[0].style.display="none"),e.datepickerVisible=!1,$("#".concat(e.jSPlugin.id,"-datepicker")).on("pick.datepicker",(function(t){console.log("重新选择日期",t.date,new Date(t.date).Format("yyyyMMdd"),new Date(document.getElementById("".concat(e.jSPlugin.id,"-datepicker")).value).Format("yyyyMMdd")),t.date>new Date||new Date(t.date).Format("yyyyMMdd")===new Date(document.getElementById("".concat(e.jSPlugin.id,"-datepicker")).value).Format("yyyyMMdd")?t.preventDefault():(e.renderRec(t.date),e.jSPlugin.changePlayUrl({begin:new Date(t.date).Format("yyyyMMdd")})),document.getElementsByClassName("datepicker-container")[0]&&(document.getElementsByClassName("datepicker-container")[0].style.display="none"),e.datepickerVisible=!1})),$("#".concat(e.jSPlugin.id,"-datepicker")).off("click").on("click",(function(t){console.log("点击日期"),e.datepickerVisible?document.getElementsByClassName("datepicker-container")[0]&&(document.getElementsByClassName("datepicker-container")[0].style.display="none"):document.getElementsByClassName("datepicker-container")[0]&&(document.getElementsByClassName("datepicker-container")[0].style.display="inline"),e.datepickerVisible=!e.datepickerVisible}))}))}))})),document.getElementById("".concat(this.jSPlugin.id,"-timeline-scale-add")).onclick=function(){var t=e.currentTimeWidth;t<3&&e.timeLine.changeSize(++e.currentTimeWidth)},document.getElementById("".concat(this.jSPlugin.id,"-timeline-scale-sub")).onclick=function(){var t=e.currentTimeWidth;t>0&&e.timeLine.changeSize(--e.currentTimeWidth)};var a=g("begin",this.jSPlugin.url)||(new Date).Format("yyyyMMdd");this.renderRec("".concat(a.slice(0,4),"-").concat(a.slice(4,6),"-").concat(a.slice(6,8))),this.observer=new MutationObserver((function(t,n){e.recAutoSize()}));var d={attributes:!0,attributeOldValue:!0,attributeFilter:["style"]},c=document.getElementById("".concat(this.jSPlugin.id));this.observer.observe(c,d)}},{key:"datepickerHide",value:function(){document.getElementsByClassName("datepicker-container")[0]&&(document.getElementsByClassName("datepicker-container")[0].style.display="none"),this.datepickerVisible=!1}},{key:"datepickerShow",value:function(){document.getElementsByClassName("datepicker-container")[0]&&(document.getElementsByClassName("datepicker-container")[0].style.display="inline"),this.datepickerVisible=!0}},{key:"recAutoSize",value:function(){var e=this;if(document.getElementById("".concat(this.jSPlugin.id,"-canvas"))){var t=parseInt(getComputedStyle(document.getElementById(this.jSPlugin.id)).width,10)-100;t!==parseInt(document.getElementById("".concat(this.jSPlugin.id,"-canvas")).width)&&(document.getElementById("".concat(this.jSPlugin.id,"-canvas")).width=t,this.timeLine.init({id:"".concat(this.jSPlugin.id,"-canvas"),width:t,onChange:function(t){console.log("time",t,new Date(t).Format("yyyyMMddhhmmss")),console.log("jSPlugin",e.jSPlugin);var n=new Date(t).Format("yyyyMMddhhmmss");e.jSPlugin.changePlayUrl({begin:n})}}),this.renderRec(this.date))}}},{key:"syncTimeLine",value:function(){var e=this;this.jSPlugin.recTimer&&clearInterval(this.jSPlugin.recTimer),this.jSPlugin.recTimer=setInterval((function(){var t=e.jSPlugin.getOSDTime();t.then((function(t){var n=t.data;-1===n?console.log("获取播放时间错误"):n>0&&e.timeLine.run({time:new Date(n>1e12?n:1e3*n)})}))["catch"]((function(e){}))}),1e3)}},{key:"unSyncTimeLine",value:function(){this.jSPlugin.recTimer&&clearInterval(this.jSPlugin.recTimer)}},{key:"renderRec",value:function(e){var t=this;this.date=e;var n=this,i=new Date(new Date(e).Format("yyyy-MM-dd 00:00:00").replace(/-/g,"/")).getTime(),o=new Date(new Date(e).Format("yyyy-MM-dd 23:59:59").replace(/-/g,"/")).getTime();this.timeLine.getRecord([],i,o);var r={accessToken:this.jSPlugin.accessToken,recType:"cloud.rec"===P(this.jSPlugin.url).type?1:2,deviceSerial:P(this.jSPlugin.url).deviceSerial,channelNo:P(this.jSPlugin.url).channelNo,startTime:i,endTime:o,version:"2.0"},a=function(e){if(e.data&&e.data.files&&e.data.files.length>0){var a=e.data.files,d=(new Date).getTime(),c=e.data.isAll;if(c)t.timeLine.getRecord(a,i,o);else{var s=function e(){function t(t){t.data&&t.data.files&&t.data.files.length>0?0==t.data.isAll?(t.data.files&&(a=a.concat(t.data.files)),d=t.data.nextFileTime>0?t.data.nextFileTime:(new Date).getTime(),e()):(console.log("云存储执行渲染片段"),n.timeLine.getRecord(a,i,o)):n.timeLine.getRecord(a,i,o)}r.startTime=d,E(this.jSPlugin.env.domain+"/api/lapp/video/by/time","POST",r,"",t)};s()}t.timeLine.run({time:new Date(i)})}else e.data&&e.data.length>0&&(console.log("获取本地录像片段成功",e),n.timeLine.getRecord(e.data,i,o),n.timeLine.run({time:new Date(i)}))},d=this.jSPlugin.env.domain+"/api/lapp/video/by/time";E(d,"POST",r,"",a)}}]),e}(),Z=function(e){console.log("执行TimeLine - params",e),this.state={id:e.id,start:"00:00:00",end:"24:00:00",current:0,timelag:30,timeArr:[],availTimeLine:[],scrollTop:0,index:0,date:"",noTimeLineTxt:"",disabled:!1};var t=this;this.setState=function(e){Object.keys(e).forEach((function(n){t.state[n]=e[n],"scrollTop"===n&&document.getElementById("time-line-item").parentNode.scrollTo(0,e[n]),"current"===n&&(document.getElementById("time-line-current").innerHTML=e[n])}))},this.setDisabled=function(e){this.setState({disabled:e}),document.getElementById("time-line-item").parentNode.style.overflowY=e?"hidden":"scroll"},this.timeToSecond=function(e){var t=e.split(":"),n=Number(t[0]),i=Number(t[1]),o=Number(t[2]);return 60*n*60+60*i+(o||0)},this.minuteToTime=function(e){var t=Math.floor(e/60),n=e%60;return(t>9?t:"0"+t)+":"+(n>9?n:"0"+n)},this.timeToMinute=function(e){var t=e.split(":"),n=Number(t[0]),i=Number(t[1]);return 60*n+i},this.getPalyParam=e.getPalyParam,document.getElementById("time-line-item").parentNode.ontouchstart=function(){if(t.state.disabled)return!1;e.ontouchstart()},document.getElementById("time-line-item").parentNode.ontouchmove=function(){if(t.state.disabled)return!1;e.ontouchmove()},document.getElementById("time-line-item").parentNode.ontouchend=function(){if(t.state.disabled)return!1;var n,i=new Promise((function(e,t){var i=-1;n=setInterval((function(){var t=document.getElementById("time-line-item").parentNode.scrollTop;t!==i?(console.log("scolling",t,i),i=t):(console.log("scoll stop",t,i),clearInterval(n),e(t))}),100)}));i.then((function(e){console.log("scollPromise: then",e,t),t.rectTopTotime(e),console.log("页面滚动实际高度",e,t.state),t.getPalyParam({current:t.state.current})})),e.ontouchend()},this.matchTimeDot()};Z.prototype.changeScale=function(e){this.setState({timelag:e}),this.matchTimeDot()},Z.prototype.setDateLine=function(e,t){e.length>0?("undefined"===typeof t&&(t=e.length-1),this.setState({availTimeLine:e,start:e[t].st,end:e[t].et,current:e[t].st}),console.log("this.state",this.state),this.matchRecTimeDot(),this.primaryOffsetH()):(this.setState({availTimeLine:[]}),console.log("this.state",this.state),this.matchRecTimeDot())},Z.prototype.matchTimeDot=function(){var e=this.state,t=e.start,n=e.end,i=e.timelag;e.availTimeLine,console.log("start",t,"end",n);var o=[],r=this.timeToMinute(n);r=Math.floor(r/i)*i;for(var a=r;a>=0;){var d=0,c=0,s=[];a==r&&(d=70),0==a&&(c=230);var l=this.minuteToTime(a);o.push({id:a,current:l,label:"a"+a,marginTop:d,marginBottom:c,recArr:s}),a-=i}this.setState({timeArr:o}),this.renderDateLine()},Z.prototype.matchRecTimeDot=function(){var e=this.state,t=e.start,n=e.end,i=e.timelag,o=e.availTimeLine,r=e.timeArr;console.log("start",t,"end",n);var a=[],d=o.length;if(0===d)for(var c=0;cm&&r[c].id')})),r+="
').concat(e.current,"
"),n.innerHTML=r,i.appendChild(n)}))},Z.prototype.primaryOffsetH=function(){var e=this.state,t=e.start,n=e.timelag,i=e.timeArr,o=i[0].current,r=this.timeToSecond(o),a=this.timeToSecond(t),d=r-a,c=Math.ceil(d/n)+60;this.setState({scrollTop:c}),console.log("起始偏移量",c)},Z.prototype.currentOffsetH=function(){var e=this.state,t=e.current,n=e.timelag,i=e.timeArr,o=i[0].current,r=this.timeToSecond(o),a=this.timeToSecond(t),d=r-a,c=Math.ceil(d/n)+60;this.setState({scrollTop:c})},Z.prototype.rectTopTotime=function(e){var t,n,i=this.state.timelag,o=Math.floor(e/60),r=e-60*o;if(console.log("index:",o,"offsetH:",r),0==r)t=this.state.timeArr[o-1].current,n=0;else{var a=this.state.timeArr[o].current,d=this.timeToMinute(a),c=60-r,s=c*i,l=Math.floor(s/60)+d,u=60*Math.floor(s/60);n=Math.ceil(s-u),t=this.minuteToTime(l)}this.setState({current:t+":"+(n>9?n:"0"+n),scrollTop:e})},Z.prototype.stepScrollTimeLine=function(e){this.setState({current:e}),this.currentOffsetH()},Z.prototype.secondCountDown=function(e){var t=this.state.current,n=t.split(":"),i=Number(n[0]),o=Number(n[1]),r=Number(n[2]),a=60*i*60+60*o+r+1,d=Math.floor(a/3600),c=Math.floor((a-3600*d)/60),s=a-3600*d-60*c;this.setState({current:(d>9?d:"0"+d)+":"+(c>9?c:"0"+c)+":"+(s>9?s:"0"+s)})};var K=Z;function G(e){var t=new Date(e),n=t.getHours(),i=t.getMinutes(),o=t.getSeconds();return(n>9?n:"0"+n)+":"+(i>9?i:"0"+i)+":"+(o>9?o:"0"+o)}Date.prototype.Format=function(e){var t={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};for(var n in/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),t)new RegExp("("+n+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?t[n]:("00"+t[n]).substr((""+t[n]).length)));return e};var J=function(){function e(t){var n=this;c(this,e),this.jSPlugin=t,this.timer=null,this.date=(new Date).Format("yyyy-MM-dd"),this.begin=((new Date).Format("yyyy-MM-dd")+" 00:00:00").replace(/-/g,"/"),this.end=((new Date).Format("yyyy-MM-dd")+" 23:59:59").replace(/-/g,"/"),this.initBegin=null,this.initEnd=null,this.type=P(this.jSPlugin.url).type,this.operating=!1,this.seekTimer=null,this.disabled=!1,this.seekFrequency=2e3,this.jSPlugin.params&&this.jSPlugin.params.seekFrequency&&(this.seekFrequency=this.jSPlugin.params.seekFrequency);var i=document.createElement("style");if(i.innerHTML='\n body{\n padding: 0;\n margin: 0;\n }\n .time-line-container {\n text-align: left;\n height: 300px;\n /* outline: 1px solid red; */\n /* background: gray; */\n position: relative;\n /* padding-top: 60px; */\n margin-top: 20px;\n }\n\n .time-line-container .time-line-item-container {\n display: inline-block;\n /* height: 400px; */\n width: 30%;\n /* background: indianred; */\n overflow-y: scroll;\n overflow-x: hidden;\n /* padding-top: 60px; */\n height: 300px;\n box-sizing: border-box;\n white-space: nowrap;\n position: relative;\n }\n\n .time-line-container .time-line-item-container::-webkit-scrollbar {\n width: 0px;\n /*滚动条宽度*/\n height: 0px;\n /*滚动条高度*/\n }\n\n .time-line-item .time-item {\n position: relative;\n box-sizing: border-box;\n height: 60px;\n font-size: 12px;\n color: rgb(150, 150, 150);\n border-right: 6px solid;\n border-right-color: #ddd;\n }\n\n .time-line-item .time-item .scale {\n width: 6px;\n height: 9px;\n border-bottom: 1px solid #ccc;\n float: right;\n clear: both;\n }\n\n .time-line-item .time-item .item-unavail {\n width: 6px;\n position: absolute;\n left: 100%;\n background-color: #ddd;\n }\n\n .time-line-container .current-time {\n position: absolute;\n left: 0;\n top: 40px;\n height: 29px;\n /* line-height: 58px; */\n border-bottom: 1px solid #648FFC;\n width: 60%;\n margin-left: 26%;\n }\n\n .time-line-container .current-time .current-time-bg {\n position: relative;\n top: 15px;\n width: 100px;\n height: 29px;\n line-height: 29px;\n left: -70px;\n font-size: 12px;\n color: #2C2C2C;\n }\n\n .time-line-container .current-time .current-time-bg::before {\n content: \'\';\n display: inline-block;\n width: 6px;\n height: 6px;\n border-radius: 100%;\n background: #648FFC;\n top: 11px;\n position: absolute;\n right: 30px;\n }\n\n .date-switch-container {\n height: 40px;\n position: relative;\n text-align: center;\n margin: 20px 10px;\n }\n\n .date-switch-container .current-date {\n line-height: 40px;\n height: 22px;\n font-size: 16px;\n color: #2C2C2C;\n text-align: center;\n font-weight: bold;\n }\n\n .date-container {\n width: 40px;\n height: 40px;\n position: absolute;\n right: 0;\n top: 0;\n }\n\n .rec-type-container {\n display: flex;\n justify-content: space-between;\n }\n\n .rec-type-container .rec-type-text {\n padding: 0 15px;\n font-size: 12px;\n color: #2C2C2C;\n }\n\n .rec-type-container .rec-type-switch {\n padding: 0 20px;\n }\n\n .date-container input {\n position: absolute;\n opacity: 0;\n display: inline-block;\n width: 40px;\n height: 40px;\n z-index: 10;\n left: 0;\n }\n\n .date-container label {\n position: absolute;\n left: 0;\n top: 0;\n /* display: none; */\n z-index: 0;\n }\n\n .date-icon {\n display: inline-block;\n width: 40px;\n height: 40px;\n background: url(\'https://resource.eziot.com/group2/M00/00/6A/CtwQF2F6VieAQrU9AAABP-_Nsqo949.png\') no-repeat 100% 100%;\n }\n .select-container {\n padding: 10px;\n display: flex;\n justify-content: space-between;\n }\n\n .advice {\n height: 24px;\n width: 70px;\n display: flex;\n justify-content: space-between;\n line-height: 24px;\n background: #F8F8F8;\n border-radius: 8px;\n }\n\n .advice span {\n width: 40px;\n display: inline-block;\n }\n\n input[type="checkbox"]:not(:checked)+.advice span:first-child {\n box-shadow: 0px 2px 5px 0px rgb(23 45 101 / 20%);\n border-radius: 8px;\n text-align: center;\n\n }\n\n input[type="checkbox"]:checked+.advice span:last-child {\n box-shadow: 0px 2px 5px 0px rgb(23 45 101 / 20%);\n border-radius: 8px;\n text-align: center;\n }\n\n input[type="checkbox"]:not(:checked)+.advice span:first-child svg {\n fill: #648FFC !important;\n }\n\n input[type="checkbox"]:checked+.advice span:last-child svg {\n fill: #648FFC !important;\n }',document.getElementsByTagName("head")[0].appendChild(i),g("begin",this.jSPlugin.url)){var o=g("begin",this.jSPlugin.url);this.date=o.slice(0,4)+"/"+o.slice(4,6)+"/"+o.slice(6,8),this.begin=this.date+" ".concat(o.slice(8,10)||"00",":").concat(o.slice(10,12)||"00",":").concat(o.slice(12,14)||"00"),this.end=this.date+" 23:59:59",this.initBegin=this.begin}if(g("end",this.jSPlugin.url)){var r=g("end",this.jSPlugin.url);this.end=this.date+" ".concat(r.slice(8,10)||"23",":").concat(r.slice(10,12)||"59",":").concat(r.slice(12,14)||"59"),this.initEnd=this.end}var a=document.createElement("div");a.id="date-switch-container-wrap",a.className="date-switch-container-wrap",a.style="",a.innerHTML='\n
\n
今日录像
\n
\n \n \n
\n
\n ',v(a,document.getElementById("".concat(this.jSPlugin.id,"-wrap")));var d=document.createElement("div");d.id="rec-type-container-wrap",d.className="rec-type-container-wrap",d.style="",d.innerHTML='\n
\n
0个录像
\n
\n \n
\n
\n ',v(d,a);var s=document.createElement("div");s.id="mobile-rec-wrap",s.className="mobileRec-wrap",s.style="",s.innerHTML='\n
\n
\n
2020-01-01 00:00:00
\n
\n
\n
\n
\n
\n
\n ',v(s,d);var l=function(e){console.log("子组件传值到父组件",e,e.current);var t=e.current,i=new Date(n.date).Format("yyyyMMdd").substr(0,8)+(e.current?t.replace(/:/g,""):e.current.replace(/:/g,""));if(n.initBegin&&new Date("".concat(n.date," ").concat(e.current)).getTime()new Date(n.initEnd).getTime()&&(console.log("超过限制最高值"),i=new Date(n.initBegin).Format("yyyyMMddhhmmss")),"cloud.rec"===n.type){var o=function(){n.jSPlugin.seek(i.substr(8,6),"235959"),setTimeout((function(){n.syncTimeLine()}),6e3)};n.seekTimer?clearTimeout(n.seekTimer):o(),console.log("this.jsPlug",n.jSPlugin.params),n.seekTimer=setTimeout((function(){o(),clearTimeout(n.seekTimer),n.seekTimer=null}),n.seekFrequency)}else{var r=function(){setTimeout((function(){n.disabled=!1}),n.seekFrequency)},a=function(e){n.disabled=!0,n.jSPlugin.pause().then((function(){console.log("暂停成功"),n.jSPlugin.resume(i).then((function(t){console.log("恢复成功"),n.jSPlugin.Theme&&n.jSPlugin.Theme.setDecoderState({play:!0}),n.jSPlugin.Theme&&n.jSPlugin.Theme.decoderState.state.sound&&n.jSPlugin.openSound(),n.syncTimeLine(),e&&e()}))}))["catch"]((function(){console.log("暂停失败"),n.jSPlugin.resume(i).then((function(t){console.log("恢复成功"),n.jSPlugin.Theme&&n.jSPlugin.Theme.setDecoderState({play:!0}),n.syncTimeLine(),e&&e()}))}))};n.disabled?(console.log("操作频繁,等待2秒后执行"),n.seekTimer&&clearTimeout(n.seekTimer),n.seekTimer=setTimeout((function(){a(r)}),n.seekFrequency)):a(r)}},u=function(){n.operating=!0,n.unSyncTimeLine()},p=function(){},m=function(){n.operating=!1,console.log("ontouchend")};this.TimeLineOBJ=new K({id:"time-line-item",getPalyParam:l,ontouchstart:u,ontouchmove:p,ontouchend:m}),this.fetchDeviceRec(),document.getElementById("date").addEventListener("change",(function(e){if(console.log("日期变化",e.target.value),n.initBegin||n.initEnd)return console.log("您开启了时间限制,无法切换日期"),!1;n.date=new Date(e.target.value).Format("yyyy/MM/dd"),n.begin=n.date+" 00:00:00",n.end=n.date+" 23:59:59",n.fetchDeviceRec(),n.jSPlugin.changePlayUrl({type:n.type,begin:"".concat(new Date(n.date).Format("yyyyMMdd"),"000000")})})),document.getElementById("cloudType").checked="rec"===this.type,document.getElementById("cloudType").addEventListener("change",(function(e){var t=e.target.checked?2:1;n.type=e.target.checked?"rec":"cloud.rec",console.log("recType",t),n.fetchDeviceRec(),n.jSPlugin.changePlayUrl({type:n.type,begin:"".concat(new Date(n.date).Format("yyyyMMdd"),"000000")}).then((function(){console.log("切换类型成功"),n.syncTimeLine()}),(function(e){console.log("err",e)}))["catch"]((function(e){console.log(e)}))})),this.syncTimeLine()}return l(e,[{key:"fetchDeviceRec",value:function(){var e=this,t=function(t){var n=t.length;document.getElementById("recCount").innerHTML=n;for(var i=[],o=n-1;o>=0;o--){var r=t[o],a=G(r.endTime),d=G(r.startTime);i.push({st:d,et:a})}e.TimeLineOBJ.setDateLine(i)},n=new FormData;n.append("deviceSerial",P(this.jSPlugin.url).deviceSerial),n.append("channelNo",P(this.jSPlugin.url).channelNo),n.append("accessToken",this.jSPlugin.accessToken),n.append("recType","cloud.rec"===this.type?1:2),n.append("startTime",new Date(this.begin).getTime()),n.append("endTime",new Date(this.end).getTime()),fetch(this.jSPlugin.env.domain+"/api/lapp/video/by/time",{method:"POST",body:n}).then((function(e){return e.json()})).then((function(e){if(200==e.code&&e.data){var n=[];n=e.data,t(n)}else t([])}))}},{key:"syncTimeLine",value:function(){var e=this,t=function(e){var t=new Date(e),n=t.getHours(),i=t.getMinutes(),o=t.getSeconds();return(n>9?n:"0"+n)+":"+(i>9?i:"0"+i)+":"+(o>9?o:"0"+o)};this.timer&&clearInterval(this.timer),this.timer=setInterval((function(){if(e.operating)return console.log("操作中"),!1;e.jSPlugin.getOSDTime().then((function(n){n.data>0?e.TimeLineOBJ.stepScrollTimeLine(t(1e3*n.data)):console.log("未找到当前获取播放时间,等待中...")}))["catch"]((function(e){console.log("未找到当前获取播放时间,等待中...")}))}),1e3)}},{key:"unSyncTimeLine",value:function(){this.timer&&clearInterval(this.timer)}}]),e}(),q=function(){function e(t){var n=this;if(c(this,e),this.jSPlugin=t,console.log("云台初始化"),document.getElementById(this.jSPlugin.id+"-ez-ptz-item"))return!1;var i=document.createElement("div");i.id=this.jSPlugin.id+"-ez-ptz-item",i.className="ez-ptz-wrap",i.style="display:none";var o=document.createElement("style");o.innerHTML="\n .ez-ptz-container {\n position: relative;\n width: 80px;\n height: 80px;\n background: rgba(255, 255, 255, 0.80);\n box-shadow: 0px 0px 33px 4px rgb(0 0 0 / 15%);\n border: 1px solid rgba(255, 255, 255, 0.80);\n border-radius: 100%;\n cursor: pointer;\n overflow: hidden;\n user-select: none;\n }\n .ez-ptz-container .ez-ptz-icon.top {\n width: 0;\n height: 0;\n border-left: 3px solid transparent;\n border-right: 3px solid transparent;\n border-bottom: 6px solid #333333;\n position: absolute;\n display: inline-block;\n left: calc(50% - 3px);\n top: 2px;\n }\n\n .ez-ptz-container .ez-ptz-icon.top.active {\n border-bottom-color: #1890FF;\n }\n\n .ez-ptz-container .ez-ptz-icon.bottom {\n width: 0;\n height: 0;\n border-left: 3px solid transparent;\n border-right: 3px solid transparent;\n border-top: 6px solid #333333;\n position: absolute;\n display: inline-block;\n left: calc(50% - 3px);\n bottom: 2px;\n }\n\n .ez-ptz-container .ez-ptz-icon.bottom.active {\n border-top-color: #1890FF;\n }\n\n .ez-ptz-container .ez-ptz-icon.right {\n width: 0;\n height: 0;\n border-top: 3px solid transparent;\n border-bottom: 3px solid transparent;\n border-left: 6px solid #333333;\n position: absolute;\n display: inline-block;\n top: calc(50% - 3px);\n right: 2px;\n }\n\n .ez-ptz-container .ez-ptz-icon.right.active {\n border-left-color: #1890FF;\n }\n\n .ez-ptz-container .ez-ptz-icon.left {\n width: 0;\n height: 0;\n border-top: 3px solid transparent;\n border-bottom: 3px solid transparent;\n border-right: 6px solid #333333;\n position: absolute;\n display: inline-block;\n top: calc(50% - 3px);\n left: 2px;\n }\n\n .ez-ptz-container .ez-ptz-icon.left.active {\n border-right-color: #1890FF;\n }\n\n .ez-ptz-container .ez-ptz-main.center {\n width: 23px;\n height: 23px;\n background: #1890FF;\n border-radius: 100%;\n top: calc(50% - 12.3px);\n left: calc(50% - 12.3px);\n position: absolute;\n }\n\n .ez-ptz-wrap {\n position: absolute;\n right: 20px;\n top: calc(50% - 50px);\n width: 100px;\n height: 100px;\n z-index: 999;\n }\n\n .ez-ptz-close {\n position: absolute;\n color: #FFFFFF;\n top: 0;\n right: 0px;\n }",document.getElementsByTagName("head")[0].appendChild(o),i.innerHTML='\n
\n
\n
\n
\n
\n
\n '),document.getElementById("".concat(t.id,"-wrap")).appendChild(i),document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).onmousedown=function(e){e.preventDefault(),console.log("触摸开始"),n._handlePtzTouch(e,"start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).onmouseup=function(e){e.preventDefault(),console.log("触摸结束"),n._handlePtzTouch(e,"stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).ontouchstart=function(e){e.preventDefault(),console.log("触摸开始"),n._handlePtzTouch(e,"start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).ontouchend=function(e){e.preventDefault(),console.log("触摸结束",e),n._handlePtzTouch(e,"stop")}}return l(e,[{key:"show",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-item")).style="display: inline-block"}},{key:"hide",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-item")).style="display: none"}},{key:"_handlePtzTouch",value:function(e,t){var n=this,i=document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).getBoundingClientRect(),o=i.left+41,r=i.top+41,a=e.x||e.changedTouches[0].clientX,d=e.y||e.changedTouches[0].clientY,c=a-o,s=d-r,l=0,u=this.jSPlugin.env.domain+"/api/lapp/device/ptz/start";if(l=Math.abs(c)>Math.abs(s)?c>0?3:2:s>0?1:0,/^rotate\(90/.test(document.getElementById("".concat(this.jSPlugin.id,"-wrap")).style.transform))switch(l){case 0:l=2;break;case 1:l=3;break;case 2:l=1;break;case 3:l=0;break}document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).style="background-image:linear-gradient(".concat(0===l?180:1===l?0:2===l?90:270,"deg, #1d8dd8 0%, rgba(100,143,252,0.00) 30%)"),"stop"===t&&(u=this.jSPlugin.env.domain+"/api/lapp/device/ptz/stop",document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).style="");var p=new FormData;p.append("deviceSerial",P(this.jSPlugin.url).deviceSerial),p.append("channelNo",P(this.jSPlugin.url).channelNo),p.append("speed",1),p.append("direction",l),p.append("accessToken",this.jSPlugin.accessToken),fetch(u,{method:"POST",body:p}).then((function(e){return e.json()})).then((function(e){200==e.code||60005!=e.code&&60002!=e.code&&60003!=e.code&&60004!=e.code||(document.getElementById("".concat(n.jSPlugin.id,"-ez-ptz-container")).style="background-image:linear-gradient(".concat(0===l?180:1===l?0:2===l?90:270,"deg, #f45656 0%, rgba(100,143,252,0.00) 30%)"))}))["catch"]((function(e){console.log("云台调用异常",e)}))}}]),e}();(function(e){"object"===d(t)&&"undefined"!==typeof n?n.exports=e():(o=[],i=e,r="function"===typeof i?i.apply(t,o):i,void 0===r||(n.exports=r))})((function(){return function(){function e(t,n,i){function o(d,c){if(!n[d]){if(!t[d]){var s="function"==typeof a&&a;if(!c&&s)return a(d,!0);if(r)return r(d,!0);var l=new Error("Cannot find module '"+d+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[d]={exports:{}};t[d][0].call(u.exports,(function(e){var n=t[d][1][e];return o(n||e)}),u,u.exports,e,t,n,i)}return n[d].exports}for(var r="function"==typeof a&&a,d=0;d0&&void 0!==arguments[0]?arguments[0]:{},t=e.window,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimEdge:!0,shimSafari:!0},i=o.log,r=o.detectBrowser(t),d={browserDetails:r,commonShim:h,extractVersion:o.extractVersion,disableLog:o.disableLog,disableWarnings:o.disableWarnings};switch(r.browser){case"chrome":if(!a||!a.shimPeerConnection||!n.shimChrome)return i("Chrome shim is not included in this adapter release."),d;i("adapter.js shimming chrome."),d.browserShim=a,a.shimGetUserMedia(t),a.shimMediaStream(t),a.shimPeerConnection(t),a.shimOnTrack(t),a.shimAddTrackRemoveTrack(t),a.shimGetSendersWithDtmf(t),a.shimGetStats(t),a.shimSenderReceiverGetStats(t),a.fixNegotiationNeeded(t),h.shimRTCIceCandidate(t),h.shimConnectionState(t),h.shimMaxMessageSize(t),h.shimSendThrowTypeError(t),h.removeAllowExtmapMixed(t);break;case"firefox":if(!l||!l.shimPeerConnection||!n.shimFirefox)return i("Firefox shim is not included in this adapter release."),d;i("adapter.js shimming firefox."),d.browserShim=l,l.shimGetUserMedia(t),l.shimPeerConnection(t),l.shimOnTrack(t),l.shimRemoveStream(t),l.shimSenderGetStats(t),l.shimReceiverGetStats(t),l.shimRTCDataChannel(t),l.shimAddTransceiver(t),l.shimCreateOffer(t),l.shimCreateAnswer(t),h.shimRTCIceCandidate(t),h.shimConnectionState(t),h.shimMaxMessageSize(t),h.shimSendThrowTypeError(t);break;case"edge":if(!c||!c.shimPeerConnection||!n.shimEdge)return i("MS edge shim is not included in this adapter release."),d;i("adapter.js shimming edge."),d.browserShim=c,c.shimGetUserMedia(t),c.shimGetDisplayMedia(t),c.shimPeerConnection(t),c.shimReplaceTrack(t),h.shimMaxMessageSize(t),h.shimSendThrowTypeError(t);break;case"safari":if(!p||!n.shimSafari)return i("Safari shim is not included in this adapter release."),d;i("adapter.js shimming safari."),d.browserShim=p,p.shimRTCIceServerUrls(t),p.shimCreateOfferLegacy(t),p.shimCallbacksAPI(t),p.shimLocalStreamsAPI(t),p.shimRemoteStreamsAPI(t),p.shimTrackEventTransceiver(t),p.shimGetUserMedia(t),h.shimRTCIceCandidate(t),h.shimMaxMessageSize(t),h.shimSendThrowTypeError(t),h.removeAllowExtmapMixed(t);break;default:i("Unsupported browser!");break}return d}},{"./chrome/chrome_shim":3,"./common_shim":6,"./edge/edge_shim":7,"./firefox/firefox_shim":11,"./safari/safari_shim":14,"./utils":15}],3:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetDisplayMedia=n.shimGetUserMedia=void 0;var i="function"===typeof Symbol&&"symbol"===d(Symbol.iterator)?function(e){return d(e)}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":d(e)},o=e("./getusermedia");Object.defineProperty(n,"shimGetUserMedia",{enumerable:!0,get:function(){return o.shimGetUserMedia}});var r=e("./getdisplaymedia");Object.defineProperty(n,"shimGetDisplayMedia",{enumerable:!0,get:function(){return r.shimGetDisplayMedia}}),n.shimMediaStream=u,n.shimOnTrack=p,n.shimGetSendersWithDtmf=m,n.shimGetStats=h,n.shimSenderReceiverGetStats=f,n.shimAddTrackRemoveTrackWithNative=g,n.shimAddTrackRemoveTrack=v,n.shimPeerConnection=y,n.fixNegotiationNeeded=C;var a=e("../utils.js"),c=s(a);function s(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function p(e){if("object"===("undefined"===typeof e?"undefined":i(e))&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});var t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var n=this;return this._ontrackpoly||(this._ontrackpoly=function(t){t.stream.addEventListener("addtrack",(function(i){var o=void 0;o=e.RTCPeerConnection.prototype.getReceivers?n.getReceivers().find((function(e){return e.track&&e.track.id===i.track.id})):{track:i.track};var r=new Event("track");r.track=i.track,r.receiver=o,r.transceiver={receiver:o},r.streams=[t.stream],n.dispatchEvent(r)})),t.stream.getTracks().forEach((function(i){var o=void 0;o=e.RTCPeerConnection.prototype.getReceivers?n.getReceivers().find((function(e){return e.track&&e.track.id===i.id})):{track:i};var r=new Event("track");r.track=i,r.receiver=o,r.transceiver={receiver:o},r.streams=[t.stream],n.dispatchEvent(r)}))},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else c.wrapPeerConnectionEvent(e,"track",(function(e){return e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e}))}function m(e){if("object"===("undefined"===typeof e?"undefined":i(e))&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){var t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};var n=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,i){var o=n.apply(this,arguments);return o||(o=t(this,e),this._senders.push(o)),o};var o=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){o.apply(this,arguments);var t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}var r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var n=this;this._senders=this._senders||[],r.apply(this,[e]),e.getTracks().forEach((function(e){n._senders.push(t(n,e))}))};var a=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;this._senders=this._senders||[],a.apply(this,[e]),e.getTracks().forEach((function(e){var n=t._senders.find((function(t){return t.track===e}));n&&t._senders.splice(t._senders.indexOf(n),1)}))}}else if("object"===("undefined"===typeof e?"undefined":i(e))&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){var d=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){var e=this,t=d.apply(this,[]);return t.forEach((function(t){return t._pc=e})),t},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function h(e){if(e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){var e=this,n=Array.prototype.slice.call(arguments),i=n[0],o=n[1],r=n[2];if(arguments.length>0&&"function"===typeof i)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!==typeof i))return t.apply(this,[]);var a=function(e){var t={},n=e.result();return n.forEach((function(e){var n={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((function(t){n[t]=e.stat(t)})),t[n.id]=n})),t},d=function(e){return new Map(Object.keys(e).map((function(t){return[t,e[t]]})))};if(arguments.length>=2){var c=function(e){o(d(a(e)))};return t.apply(this,[c,i])}return new Promise((function(n,i){t.apply(e,[function(e){n(d(a(e)))},i])})).then(o,r)}}}function f(e){if("object"===("undefined"===typeof e?"undefined":i(e))&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver){if(!("getStats"in e.RTCRtpSender.prototype)){var t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){var e=this,n=t.apply(this,[]);return n.forEach((function(t){return t._pc=e})),n});var n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){var e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){var e=this;return this._pc.getStats().then((function(t){return c.filterStats(t,e.track,!0)}))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){var o=e.RTCPeerConnection.prototype.getReceivers;o&&(e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,t=o.apply(this,[]);return t.forEach((function(t){return t._pc=e})),t}),c.wrapPeerConnectionEvent(e,"track",(function(e){return e.receiver._pc=e.srcElement,e})),e.RTCRtpReceiver.prototype.getStats=function(){var e=this;return this._pc.getStats().then((function(t){return c.filterStats(t,e.track,!1)}))}}if("getStats"in e.RTCRtpSender.prototype&&"getStats"in e.RTCRtpReceiver.prototype){var r=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){var t=arguments[0],n=void 0,i=void 0,o=void 0;return this.getSenders().forEach((function(e){e.track===t&&(n?o=!0:n=e)})),this.getReceivers().forEach((function(e){return e.track===t&&(i?o=!0:i=e),e.track===t})),o||n&&i?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):n?n.getStats():i?i.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return r.apply(this,arguments)}}}}function g(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((function(t){return e._shimmedLocalStreams[t][0]}))};var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){if(!n)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};var i=t.apply(this,arguments);return this._shimmedLocalStreams[n.id]?-1===this._shimmedLocalStreams[n.id].indexOf(i)&&this._shimmedLocalStreams[n.id].push(i):this._shimmedLocalStreams[n.id]=[n,i],i};var n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var t=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach((function(e){var n=t.getSenders().find((function(t){return t.track===e}));if(n)throw new DOMException("Track already exists.","InvalidAccessError")}));var i=this.getSenders();n.apply(this,arguments);var o=this.getSenders().filter((function(e){return-1===i.indexOf(e)}));this._shimmedLocalStreams[e.id]=[e].concat(o)};var i=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],i.apply(this,arguments)};var o=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((function(n){var i=t._shimmedLocalStreams[n].indexOf(e);-1!==i&&t._shimmedLocalStreams[n].splice(i,1),1===t._shimmedLocalStreams[n].length&&delete t._shimmedLocalStreams[n]})),o.apply(this,arguments)}}function v(e){if(e.RTCPeerConnection){var t=c.detectBrowser(e);if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return g(e);var n=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this,t=n.apply(this);return this._reverseStreams=this._reverseStreams||{},t.map((function(t){return e._reverseStreams[t.id]}))};var i=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){var n=this;if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach((function(e){var t=n.getSenders().find((function(t){return t.track===e}));if(t)throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[t.id]){var o=new e.MediaStream(t.getTracks());this._streams[t.id]=o,this._reverseStreams[o.id]=t,t=o}i.apply(this,[t])};var o=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},o.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,n){var i=this;if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");var o=[].slice.call(arguments,1);if(1!==o.length||!o[0].getTracks().find((function(e){return e===t})))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");var r=this.getSenders().find((function(e){return e.track===t}));if(r)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};var a=this._streams[n.id];if(a)a.addTrack(t),Promise.resolve().then((function(){i.dispatchEvent(new Event("negotiationneeded"))}));else{var d=new e.MediaStream([t]);this._streams[n.id]=d,this._reverseStreams[d.id]=n,this.addStream(d)}return this.getSenders().find((function(e){return e.track===t}))},["createOffer","createAnswer"].forEach((function(t){var n=e.RTCPeerConnection.prototype[t],i=l({},t,(function(){var e=this,t=arguments,i=arguments.length&&"function"===typeof arguments[0];return i?n.apply(this,[function(n){var i=d(e,n);t[0].apply(null,[i])},function(e){t[1]&&t[1].apply(null,e)},arguments[2]]):n.apply(this,arguments).then((function(t){return d(e,t)}))}));e.RTCPeerConnection.prototype[t]=i[t]}));var r=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=s(this,arguments[0]),r.apply(this,arguments)):r.apply(this,arguments)};var a=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get:function(){var e=a.get.apply(this);return""===e.type?e:d(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");var n=e._pc===this;if(!n)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};var i=void 0;Object.keys(this._streams).forEach((function(n){var o=t._streams[n].getTracks().find((function(t){return e.track===t}));o&&(i=t._streams[n])})),i&&(1===i.getTracks().length?this.removeStream(this._reverseStreams[i.id]):i.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function d(e,t){var n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((function(t){var i=e._reverseStreams[t],o=e._streams[i.id];n=n.replace(new RegExp(o.id,"g"),i.id)})),new RTCSessionDescription({type:t.type,sdp:n})}function s(e,t){var n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((function(t){var i=e._reverseStreams[t],o=e._streams[i.id];n=n.replace(new RegExp(i.id,"g"),o.id)})),new RTCSessionDescription({type:t.type,sdp:n})}}function y(e){var t=c.detectBrowser(e);if(!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection){t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){var n=e.RTCPeerConnection.prototype[t],i=l({},t,(function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}));e.RTCPeerConnection.prototype[t]=i[t]}));var n=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?t.version<78&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}}function C(e){c.wrapPeerConnectionEvent(e,"negotiationneeded",(function(e){var t=e.target;if("stable"===t.signalingState)return e}))}},{"../utils.js":15,"./getdisplaymedia":4,"./getusermedia":5}],4:[function(e,t,n){function i(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"===typeof t?e.navigator.mediaDevices.getDisplayMedia=function(n){return t(n).then((function(t){var i=n.video&&n.video.width,o=n.video&&n.video.height,r=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:r||3}},i&&(n.video.mandatory.maxWidth=i),o&&(n.video.mandatory.maxHeight=o),e.navigator.mediaDevices.getUserMedia(n)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetDisplayMedia=i},{}],5:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var i="function"===typeof Symbol&&"symbol"===d(Symbol.iterator)?function(e){return d(e)}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":d(e)};n.shimGetUserMedia=s;var o=e("../utils.js"),r=a(o);function a(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}var c=r.log;function s(e){var t=e&&e.navigator;if(t.mediaDevices){var n=r.detectBrowser(e),o=function(e){if("object"!==("undefined"===typeof e?"undefined":i(e))||e.mandatory||e.optional)return e;var t={};return Object.keys(e).forEach((function(n){if("require"!==n&&"advanced"!==n&&"mediaSource"!==n){var o="object"===i(e[n])?e[n]:{ideal:e[n]};void 0!==o.exact&&"number"===typeof o.exact&&(o.min=o.max=o.exact);var r=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==o.ideal){t.optional=t.optional||[];var a={};"number"===typeof o.ideal?(a[r("min",n)]=o.ideal,t.optional.push(a),a={},a[r("max",n)]=o.ideal,t.optional.push(a)):(a[r("",n)]=o.ideal,t.optional.push(a))}void 0!==o.exact&&"number"!==typeof o.exact?(t.mandatory=t.mandatory||{},t.mandatory[r("",n)]=o.exact):["min","max"].forEach((function(e){void 0!==o[e]&&(t.mandatory=t.mandatory||{},t.mandatory[r(e,n)]=o[e])}))}})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},a=function(e,r){if(n.version>=61)return r(e);if(e=JSON.parse(JSON.stringify(e)),e&&"object"===i(e.audio)){var a=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};e=JSON.parse(JSON.stringify(e)),a(e.audio,"autoGainControl","googAutoGainControl"),a(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=o(e.audio)}if(e&&"object"===i(e.video)){var d=e.video.facingMode;d=d&&("object"===("undefined"===typeof d?"undefined":i(d))?d:{ideal:d});var s=n.version<66;if(d&&("user"===d.exact||"environment"===d.exact||"user"===d.ideal||"environment"===d.ideal)&&(!t.mediaDevices.getSupportedConstraints||!t.mediaDevices.getSupportedConstraints().facingMode||s)){delete e.video.facingMode;var l=void 0;if("environment"===d.exact||"environment"===d.ideal?l=["back","rear"]:"user"!==d.exact&&"user"!==d.ideal||(l=["front"]),l)return t.mediaDevices.enumerateDevices().then((function(t){t=t.filter((function(e){return"videoinput"===e.kind}));var n=t.find((function(e){return l.some((function(t){return e.label.toLowerCase().includes(t)}))}));return!n&&t.length&&l.includes("back")&&(n=t[t.length-1]),n&&(e.video.deviceId=d.exact?{exact:n.deviceId}:{ideal:n.deviceId}),e.video=o(e.video),c("chrome: "+JSON.stringify(e)),r(e)}))}e.video=o(e.video)}return c("chrome: "+JSON.stringify(e)),r(e)},d=function(e){return n.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}},s=function(e,n,i){a(e,(function(e){t.webkitGetUserMedia(e,n,(function(e){i&&i(d(e))}))}))};if(t.getUserMedia=s.bind(t),t.mediaDevices.getUserMedia){var l=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return a(e,(function(e){return l(e).then((function(t){if(e.audio&&!t.getAudioTracks().length||e.video&&!t.getVideoTracks().length)throw t.getTracks().forEach((function(e){e.stop()})),new DOMException("","NotFoundError");return t}),(function(e){return Promise.reject(d(e))}))}))}}}}},{"../utils.js":15}],6:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var i="function"===typeof Symbol&&"symbol"===d(Symbol.iterator)?function(e){return d(e)}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":d(e)};n.shimRTCIceCandidate=u,n.shimMaxMessageSize=p,n.shimSendThrowTypeError=m,n.shimConnectionState=h,n.removeAllowExtmapMixed=f;var o=e("sdp"),r=l(o),a=e("./utils"),c=s(a);function s(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function l(e){return e&&e.__esModule?e:{default:e}}function u(e){if(!(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)){var t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"===("undefined"===typeof e?"undefined":i(e))&&e.candidate&&0===e.candidate.indexOf("a=")&&(e=JSON.parse(JSON.stringify(e)),e.candidate=e.candidate.substr(2)),e.candidate&&e.candidate.length){var n=new t(e),o=r["default"].parseCandidate(e.candidate),a=Object.assign(n,o);return a.toJSON=function(){return{candidate:a.candidate,sdpMid:a.sdpMid,sdpMLineIndex:a.sdpMLineIndex,usernameFragment:a.usernameFragment}},a}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,c.wrapPeerConnectionEvent(e,"icecandidate",(function(t){return t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t}))}}function p(e){if(e.RTCPeerConnection){var t=c.detectBrowser(e);"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get:function(){return"undefined"===typeof this._sctp?null:this._sctp}});var n=function(e){if(!e||!e.sdp)return!1;var t=r["default"].splitSections(e.sdp);return t.shift(),t.some((function(e){var t=r["default"].parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))},i=function(e){var t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;var n=parseInt(t[1],10);return n!==n?-1:n},o=function(e){var n=65536;return"firefox"===t.browser&&(n=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),n},a=function(e,n){var i=65536;"firefox"===t.browser&&57===t.version&&(i=65535);var o=r["default"].matchPrefix(e.sdp,"a=max-message-size:");return o.length>0?i=parseInt(o[0].substr(19),10):"firefox"===t.browser&&-1!==n&&(i=2147483637),i},d=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===t.browser&&t.version>=76){var e=this.getConfiguration(),r=e.sdpSemantics;"plan-b"===r&&Object.defineProperty(this,"sctp",{get:function(){return"undefined"===typeof this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(n(arguments[0])){var c=i(arguments[0]),s=o(c),l=a(arguments[0],c),u=void 0;u=0===s&&0===l?Number.POSITIVE_INFINITY:0===s||0===l?Math.max(s,l):Math.min(s,l);var p={};Object.defineProperty(p,"maxMessageSize",{get:function(){return u}}),this._sctp=p}return d.apply(this,arguments)}}}function m(e){if(e.RTCPeerConnection&&"createDataChannel"in e.RTCPeerConnection.prototype){var t=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){var e=t.apply(this,arguments);return n(e,this),e},c.wrapPeerConnectionEvent(e,"datachannel",(function(e){return n(e.channel,e.target),e}))}function n(e,t){var n=e.send;e.send=function(){var i=arguments[0],o=i.length||i.size||i.byteLength;if("open"===e.readyState&&t.sctp&&o>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return n.apply(e,arguments)}}}function h(e){if(e.RTCPeerConnection&&!("connectionState"in e.RTCPeerConnection.prototype)){var t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get:function(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get:function(){return this._onconnectionstatechange||null},set:function(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((function(e){var n=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=function(e){var t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;var n=new Event("connectionstatechange",e);t.dispatchEvent(n)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}}))}}function f(e){if(e.RTCPeerConnection){var t=c.detectBrowser(e);if(!("chrome"===t.browser&&t.version>=71)){var n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(e){return e&&e.sdp&&-1!==e.sdp.indexOf("\na=extmap-allow-mixed")&&(e.sdp=e.sdp.split("\n").filter((function(e){return"a=extmap-allow-mixed"!==e.trim()})).join("\n")),n.apply(this,arguments)}}}}},{"./utils":15,sdp:17}],7:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetDisplayMedia=n.shimGetUserMedia=void 0;var i=e("./getusermedia");Object.defineProperty(n,"shimGetUserMedia",{enumerable:!0,get:function(){return i.shimGetUserMedia}});var o=e("./getdisplaymedia");Object.defineProperty(n,"shimGetDisplayMedia",{enumerable:!0,get:function(){return o.shimGetDisplayMedia}}),n.shimPeerConnection=p,n.shimReplaceTrack=m;var r=e("../utils"),a=u(r),d=e("./filtericeservers"),c=e("rtcpeerconnection-shim"),s=l(c);function l(e){return e&&e.__esModule?e:{default:e}}function u(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function p(e){var t=a.detectBrowser(e);if(e.RTCIceGatherer&&(e.RTCIceCandidate||(e.RTCIceCandidate=function(e){return e}),e.RTCSessionDescription||(e.RTCSessionDescription=function(e){return e}),t.version<15025)){var n=Object.getOwnPropertyDescriptor(e.MediaStreamTrack.prototype,"enabled");Object.defineProperty(e.MediaStreamTrack.prototype,"enabled",{set:function(e){n.set.call(this,e);var t=new Event("enabled");t.enabled=e,this.dispatchEvent(t)}})}e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)&&Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=new e.RTCDtmfSender(this):"video"===this.track.kind&&(this._dtmf=null)),this._dtmf}}),e.RTCDtmfSender&&!e.RTCDTMFSender&&(e.RTCDTMFSender=e.RTCDtmfSender);var i=(0,s["default"])(e,t.version);e.RTCPeerConnection=function(e){return e&&e.iceServers&&(e.iceServers=(0,d.filterIceServers)(e.iceServers,t.version),a.log("ICE servers after filtering:",e.iceServers)),new i(e)},e.RTCPeerConnection.prototype=i.prototype}function m(e){e.RTCRtpSender&&!("replaceTrack"in e.RTCRtpSender.prototype)&&(e.RTCRtpSender.prototype.replaceTrack=e.RTCRtpSender.prototype.setTrack)}},{"../utils":15,"./filtericeservers":8,"./getdisplaymedia":9,"./getusermedia":10,"rtcpeerconnection-shim":16}],8:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.filterIceServers=a;var i=e("../utils"),o=r(i);function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function a(e,t){var n=!1;return e=JSON.parse(JSON.stringify(e)),e.filter((function(e){if(e&&(e.urls||e.url)){var t=e.urls||e.url;e.url&&!e.urls&&o.deprecated("RTCIceServer.url","RTCIceServer.urls");var i="string"===typeof t;return i&&(t=[t]),t=t.filter((function(e){if(0===e.indexOf("stun:"))return!1;var t=e.startsWith("turn")&&!e.startsWith("turn:[")&&e.includes("transport=udp");return t&&!n?(n=!0,!0):t&&!n})),delete e.url,e.urls=i?t[0]:t,!!t.length}}))}},{"../utils":15}],9:[function(e,t,n){function i(e){"getDisplayMedia"in e.navigator&&e.navigator.mediaDevices&&(e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||(e.navigator.mediaDevices.getDisplayMedia=e.navigator.getDisplayMedia.bind(e.navigator)))}Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetDisplayMedia=i},{}],10:[function(e,t,n){function i(e){var t=e&&e.navigator,n=function(e){return{name:{PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:e.message,constraint:e.constraint,toString:function(){return this.name}}},i=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return i(e)["catch"]((function(e){return Promise.reject(n(e))}))}}Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetUserMedia=i},{}],11:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetDisplayMedia=n.shimGetUserMedia=void 0;var i="function"===typeof Symbol&&"symbol"===d(Symbol.iterator)?function(e){return d(e)}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":d(e)},o=e("./getusermedia");Object.defineProperty(n,"shimGetUserMedia",{enumerable:!0,get:function(){return o.shimGetUserMedia}});var r=e("./getdisplaymedia");Object.defineProperty(n,"shimGetDisplayMedia",{enumerable:!0,get:function(){return r.shimGetDisplayMedia}}),n.shimOnTrack=u,n.shimPeerConnection=p,n.shimSenderGetStats=m,n.shimReceiverGetStats=h,n.shimRemoveStream=f,n.shimRTCDataChannel=g,n.shimAddTransceiver=v,n.shimCreateOffer=y,n.shimCreateAnswer=C;var a=e("../utils"),c=s(a);function s(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e){"object"===("undefined"===typeof e?"undefined":i(e))&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})}function p(e){var t=c.detectBrowser(e);if("object"===("undefined"===typeof e?"undefined":i(e))&&(e.RTCPeerConnection||e.mozRTCPeerConnection)){if(!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){var n=e.RTCPeerConnection.prototype[t],i=l({},t,(function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}));e.RTCPeerConnection.prototype[t]=i[t]})),t.version<68){var n=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?arguments[0]&&""===arguments[0].candidate?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}var o={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},r=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){var e=Array.prototype.slice.call(arguments),n=e[0],i=e[1],a=e[2];return r.apply(this,[n||null]).then((function(e){if(t.version<53&&!i)try{e.forEach((function(e){e.type=o[e.type]||e.type}))}catch(n){if("TypeError"!==n.name)throw n;e.forEach((function(t,n){e.set(n,Object.assign({},t,{type:o[t.type]||t.type}))}))}return e})).then(i,a)}}}function m(e){if("object"===("undefined"===typeof e?"undefined":i(e))&&e.RTCPeerConnection&&e.RTCRtpSender&&(!e.RTCRtpSender||!("getStats"in e.RTCRtpSender.prototype))){var t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){var e=this,n=t.apply(this,[]);return n.forEach((function(t){return t._pc=e})),n});var n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){var e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}}function h(e){if("object"===("undefined"===typeof e?"undefined":i(e))&&e.RTCPeerConnection&&e.RTCRtpSender&&(!e.RTCRtpSender||!("getStats"in e.RTCRtpReceiver.prototype))){var t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,n=t.apply(this,[]);return n.forEach((function(t){return t._pc=e})),n}),c.wrapPeerConnectionEvent(e,"track",(function(e){return e.receiver._pc=e.srcElement,e})),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}}function f(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;c.deprecated("removeStream","removeTrack"),this.getSenders().forEach((function(n){n.track&&e.getTracks().includes(n.track)&&t.removeTrack(n)}))})}function g(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function v(e){if("object"===("undefined"===typeof e?"undefined":i(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];var e=arguments[1],n=e&&"sendEncodings"in e;n&&e.sendEncodings.forEach((function(e){if("rid"in e){var t=/^[a-z0-9]{0,16}$/i;if(!t.test(e.rid))throw new TypeError("Invalid RID value provided.")}if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));var i=t.apply(this,arguments);if(n){var o=i.sender,r=o.getParameters();"encodings"in r||(r.encodings=e.sendEncodings,this.setParametersPromises.push(o.setParameters(r)["catch"]((function(){}))))}return i})}}function y(e){if("object"===("undefined"===typeof e?"undefined":i(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){var e=this,n=arguments;return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((function(){return t.apply(e,n)}))["finally"]((function(){e.setParametersPromises=[]})):t.apply(this,arguments)}}}function C(e){if("object"===("undefined"===typeof e?"undefined":i(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){var e=this,n=arguments;return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((function(){return t.apply(e,n)}))["finally"]((function(){e.setParametersPromises=[]})):t.apply(this,arguments)}}}},{"../utils":15,"./getdisplaymedia":12,"./getusermedia":13}],12:[function(e,t,n){function i(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(n){if(!n||!n.video){var i=new DOMException("getDisplayMedia without video constraints is undefined");return i.name="NotFoundError",i.code=8,Promise.reject(i)}return!0===n.video?n.video={mediaSource:t}:n.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(n)})}Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetDisplayMedia=i},{}],13:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var i="function"===typeof Symbol&&"symbol"===d(Symbol.iterator)?function(e){return d(e)}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":d(e)};n.shimGetUserMedia=c;var o=e("../utils"),r=a(o);function a(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function c(e){var t=r.detectBrowser(e),n=e&&e.navigator,o=e&&e.MediaStreamTrack;if(n.getUserMedia=function(e,t,i){r.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(e).then(t,i)},!(t.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){var a=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},d=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(e){return"object"===("undefined"===typeof e?"undefined":i(e))&&"object"===i(e.audio)&&(e=JSON.parse(JSON.stringify(e)),a(e.audio,"autoGainControl","mozAutoGainControl"),a(e.audio,"noiseSuppression","mozNoiseSuppression")),d(e)},o&&o.prototype.getSettings){var c=o.prototype.getSettings;o.prototype.getSettings=function(){var e=c.apply(this,arguments);return a(e,"mozAutoGainControl","autoGainControl"),a(e,"mozNoiseSuppression","noiseSuppression"),e}}if(o&&o.prototype.applyConstraints){var s=o.prototype.applyConstraints;o.prototype.applyConstraints=function(e){return"audio"===this.kind&&"object"===("undefined"===typeof e?"undefined":i(e))&&(e=JSON.parse(JSON.stringify(e)),a(e,"autoGainControl","mozAutoGainControl"),a(e,"noiseSuppression","mozNoiseSuppression")),s.apply(this,[e])}}}}},{"../utils":15}],14:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var i="function"===typeof Symbol&&"symbol"===d(Symbol.iterator)?function(e){return d(e)}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":d(e)};n.shimLocalStreamsAPI=c,n.shimRemoteStreamsAPI=s,n.shimCallbacksAPI=l,n.shimGetUserMedia=u,n.shimConstraints=p,n.shimRTCIceServerUrls=m,n.shimTrackEventTransceiver=h,n.shimCreateOfferLegacy=f;var o=e("../utils"),r=a(o);function a(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function c(e){if("object"===("undefined"===typeof e?"undefined":i(e))&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){var n=this;this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach((function(i){return t.call(n,i,e)})),e.getVideoTracks().forEach((function(i){return t.call(n,i,e)}))},e.RTCPeerConnection.prototype.addTrack=function(e){var n=arguments[1];return n&&(this._localStreams?this._localStreams.includes(n)||this._localStreams.push(n):this._localStreams=[n]),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;this._localStreams||(this._localStreams=[]);var n=this._localStreams.indexOf(e);if(-1!==n){this._localStreams.splice(n,1);var i=e.getTracks();this.getSenders().forEach((function(e){i.includes(e.track)&&t.removeTrack(e)}))}})}}function s(e){if("object"===("undefined"===typeof e?"undefined":i(e))&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get:function(){return this._onaddstream},set:function(e){var t=this;this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=function(e){e.streams.forEach((function(e){if(t._remoteStreams||(t._remoteStreams=[]),!t._remoteStreams.includes(e)){t._remoteStreams.push(e);var n=new Event("addstream");n.stream=e,t.dispatchEvent(n)}}))})}});var t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach((function(t){if(e._remoteStreams||(e._remoteStreams=[]),!(e._remoteStreams.indexOf(t)>=0)){e._remoteStreams.push(t);var n=new Event("addstream");n.stream=t,e.dispatchEvent(n)}}))}),t.apply(e,arguments)}}}function l(e){if("object"===("undefined"===typeof e?"undefined":i(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype,n=t.createOffer,o=t.createAnswer,r=t.setLocalDescription,a=t.setRemoteDescription,d=t.addIceCandidate;t.createOffer=function(e,t){var i=arguments.length>=2?arguments[2]:arguments[0],o=n.apply(this,[i]);return t?(o.then(e,t),Promise.resolve()):o},t.createAnswer=function(e,t){var n=arguments.length>=2?arguments[2]:arguments[0],i=o.apply(this,[n]);return t?(i.then(e,t),Promise.resolve()):i};var c=function(e,t,n){var i=r.apply(this,[e]);return n?(i.then(t,n),Promise.resolve()):i};t.setLocalDescription=c,c=function(e,t,n){var i=a.apply(this,[e]);return n?(i.then(t,n),Promise.resolve()):i},t.setRemoteDescription=c,c=function(e,t,n){var i=d.apply(this,[e]);return n?(i.then(t,n),Promise.resolve()):i},t.addIceCandidate=c}}function u(e){var t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){var n=t.mediaDevices,i=n.getUserMedia.bind(n);t.mediaDevices.getUserMedia=function(e){return i(p(e))}}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,i){t.mediaDevices.getUserMedia(e).then(n,i)}.bind(t))}function p(e){return e&&void 0!==e.video?Object.assign({},e,{video:r.compactObject(e.video)}):e}function m(e){var t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){for(var i=[],o=0;o=n&&parseInt(i[n],10)}function s(e,t,n){if(e.RTCPeerConnection){var i=e.RTCPeerConnection.prototype,o=i.addEventListener;i.addEventListener=function(e,i){if(e!==t)return o.apply(this,arguments);var r=function(e){var t=n(e);t&&i(t)};return this._eventMap=this._eventMap||{},this._eventMap[i]=r,o.apply(this,[e,r])};var r=i.removeEventListener;i.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[n])return r.apply(this,arguments);var i=this._eventMap[n];return delete this._eventMap[n],r.apply(this,[e,i])},Object.defineProperty(i,"on"+t,{get:function(){return this["_on"+t]},set:function(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}}function l(e){return"boolean"!==typeof e?new Error("Argument type: "+("undefined"===typeof e?"undefined":i(e))+". Please use a boolean."):(r=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function u(e){return"boolean"!==typeof e?new Error("Argument type: "+("undefined"===typeof e?"undefined":i(e))+". Please use a boolean."):(a=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function p(){if("object"===("undefined"===typeof window?"undefined":i(window))){if(r)return;"undefined"!==typeof console&&"function"===typeof console.log&&console.log.apply(console,arguments)}}function m(e,t){a&&console.warn(e+" is deprecated, please use "+t+" instead.")}function h(e){var t=e.navigator,n={browser:null,version:null};if("undefined"===typeof e||!e.navigator)return n.browser="Not a browser.",n;if(t.mozGetUserMedia)n.browser="firefox",n.version=c(t.userAgent,/Firefox\/(\d+)\./,1);else if(t.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection&&!e.RTCIceGatherer)n.browser="chrome",n.version=c(t.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.mediaDevices&&t.userAgent.match(/Edge\/(\d+).(\d+)$/))n.browser="edge",n.version=c(t.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!e.RTCPeerConnection||!t.userAgent.match(/AppleWebKit\/(\d+)\./))return n.browser="Not a supported browser.",n;n.browser="safari",n.version=c(t.userAgent,/AppleWebKit\/(\d+)\./,1),n.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return n}function f(e){return"[object Object]"===Object.prototype.toString.call(e)}function g(e){return f(e)?Object.keys(e).reduce((function(t,n){var i=f(e[n]),r=i?g(e[n]):e[n],a=i&&!Object.keys(r).length;return void 0===r||a?t:Object.assign(t,o({},n,r))}),{}):e}function v(e,t,n){t&&!n.has(t.id)&&(n.set(t.id,t),Object.keys(t).forEach((function(i){i.endsWith("Id")?v(e,e.get(t[i]),n):i.endsWith("Ids")&&t[i].forEach((function(t){v(e,e.get(t),n)}))})))}function y(e,t,n){var i=n?"outbound-rtp":"inbound-rtp",o=new Map;if(null===t)return o;var r=[];return e.forEach((function(e){"track"===e.type&&e.trackIdentifier===t.id&&r.push(e)})),r.forEach((function(t){e.forEach((function(n){n.type===i&&n.trackId===t.id&&v(e,n,o)}))})),o}},{}],16:[function(e,t,n){var i=e("sdp");function o(e){return{inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type}function r(e,t,n,o,r){var a=i.writeRtpDescription(e.kind,t);if(a+=i.writeIceParameters(e.iceGatherer.getLocalParameters()),a+=i.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":r||"active"),a+="a=mid:"+e.mid+"\r\n",e.rtpSender&&e.rtpReceiver?a+="a=sendrecv\r\n":e.rtpSender?a+="a=sendonly\r\n":e.rtpReceiver?a+="a=recvonly\r\n":a+="a=inactive\r\n",e.rtpSender){var d=e.rtpSender._initialTrackId||e.rtpSender.track.id;e.rtpSender._initialTrackId=d;var c="msid:"+(o?o.id:"-")+" "+d+"\r\n";a+="a="+c,a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+c,e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+c,a+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+i.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+i.localCName+"\r\n"),a}function a(e,t){var n=!1;return e=JSON.parse(JSON.stringify(e)),e.filter((function(e){if(e&&(e.urls||e.url)){var i=e.urls||e.url;e.url&&!e.urls&&console.warn("RTCIceServer.url is deprecated! Use urls instead.");var o="string"===typeof i;return o&&(i=[i]),i=i.filter((function(e){var i=0===e.indexOf("turn:")&&-1!==e.indexOf("transport=udp")&&-1===e.indexOf("turn:[")&&!n;return i?(n=!0,!0):0===e.indexOf("stun:")&&t>=14393&&-1===e.indexOf("?transport=udp")})),delete e.url,e.urls=o?i[0]:i,!!i.length}}))}function d(e,t){var n={codecs:[],headerExtensions:[],fecMechanisms:[]},i=function(e,t){e=parseInt(e,10);for(var n=0;n0;d--)this._iceGatherers.push(new e.RTCIceGatherer({iceServers:n.iceServers,gatherPolicy:n.iceTransportPolicy}));else n.iceCandidatePoolSize=0;this._config=n,this.transceivers=[],this._sdpSessionId=i.generateSessionId(),this._sdpSessionVersion=0,this._dtlsRole=void 0,this._isClosed=!1};Object.defineProperty(m.prototype,"localDescription",{configurable:!0,get:function(){return this._localDescription}}),Object.defineProperty(m.prototype,"remoteDescription",{configurable:!0,get:function(){return this._remoteDescription}}),m.prototype.onicecandidate=null,m.prototype.onaddstream=null,m.prototype.ontrack=null,m.prototype.onremovestream=null,m.prototype.onsignalingstatechange=null,m.prototype.oniceconnectionstatechange=null,m.prototype.onconnectionstatechange=null,m.prototype.onicegatheringstatechange=null,m.prototype.onnegotiationneeded=null,m.prototype.ondatachannel=null,m.prototype._dispatchEvent=function(e,t){this._isClosed||(this.dispatchEvent(t),"function"===typeof this["on"+e]&&this["on"+e](t))},m.prototype._emitGatheringStateChange=function(){var e=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",e)},m.prototype.getConfiguration=function(){return this._config},m.prototype.getLocalStreams=function(){return this.localStreams},m.prototype.getRemoteStreams=function(){return this.remoteStreams},m.prototype._createTransceiver=function(e,t){var n=this.transceivers.length>0,i={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:e,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,associatedRemoteMediaStreams:[],wantReceive:!0};if(this.usingBundle&&n)i.iceTransport=this.transceivers[0].iceTransport,i.dtlsTransport=this.transceivers[0].dtlsTransport;else{var o=this._createIceAndDtlsTransports();i.iceTransport=o.iceTransport,i.dtlsTransport=o.dtlsTransport}return t||this.transceivers.push(i),i},m.prototype.addTrack=function(t,n){if(this._isClosed)throw l("InvalidStateError","Attempted to call addTrack on a closed peerconnection.");var i,o=this.transceivers.find((function(e){return e.track===t}));if(o)throw l("InvalidAccessError","Track already exists.");for(var r=0;r=15025)e.getTracks().forEach((function(t){n.addTrack(t,e)}));else{var i=e.clone();e.getTracks().forEach((function(e,t){var n=i.getTracks()[t];e.addEventListener("enabled",(function(e){n.enabled=e.enabled}))})),i.getTracks().forEach((function(e){n.addTrack(e,i)}))}},m.prototype.removeTrack=function(t){if(this._isClosed)throw l("InvalidStateError","Attempted to call removeTrack on a closed peerconnection.");if(!(t instanceof e.RTCRtpSender))throw new TypeError("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.");var n=this.transceivers.find((function(e){return e.rtpSender===t}));if(!n)throw l("InvalidAccessError","Sender was not created by this connection.");var i=n.stream;n.rtpSender.stop(),n.rtpSender=null,n.track=null,n.stream=null;var o=this.transceivers.map((function(e){return e.stream}));-1===o.indexOf(i)&&this.localStreams.indexOf(i)>-1&&this.localStreams.splice(this.localStreams.indexOf(i),1),this._maybeFireNegotiationNeeded()},m.prototype.removeStream=function(e){var t=this;e.getTracks().forEach((function(e){var n=t.getSenders().find((function(t){return t.track===e}));n&&t.removeTrack(n)}))},m.prototype.getSenders=function(){return this.transceivers.filter((function(e){return!!e.rtpSender})).map((function(e){return e.rtpSender}))},m.prototype.getReceivers=function(){return this.transceivers.filter((function(e){return!!e.rtpReceiver})).map((function(e){return e.rtpReceiver}))},m.prototype._createIceGatherer=function(t,n){var i=this;if(n&&t>0)return this.transceivers[0].iceGatherer;if(this._iceGatherers.length)return this._iceGatherers.shift();var o=new e.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});return Object.defineProperty(o,"state",{value:"new",writable:!0}),this.transceivers[t].bufferedCandidateEvents=[],this.transceivers[t].bufferCandidates=function(e){var n=!e.candidate||0===Object.keys(e.candidate).length;o.state=n?"completed":"gathering",null!==i.transceivers[t].bufferedCandidateEvents&&i.transceivers[t].bufferedCandidateEvents.push(e)},o.addEventListener("localcandidate",this.transceivers[t].bufferCandidates),o},m.prototype._gather=function(t,n){var o=this,r=this.transceivers[n].iceGatherer;if(!r.onlocalcandidate){var a=this.transceivers[n].bufferedCandidateEvents;this.transceivers[n].bufferedCandidateEvents=null,r.removeEventListener("localcandidate",this.transceivers[n].bufferCandidates),r.onlocalcandidate=function(e){if(!(o.usingBundle&&n>0)){var a=new Event("icecandidate");a.candidate={sdpMid:t,sdpMLineIndex:n};var d=e.candidate,c=!d||0===Object.keys(d).length;if(c)"new"!==r.state&&"gathering"!==r.state||(r.state="completed");else{"new"===r.state&&(r.state="gathering"),d.component=1,d.ufrag=r.getLocalParameters().usernameFragment;var s=i.writeCandidate(d);a.candidate=Object.assign(a.candidate,i.parseCandidate(s)),a.candidate.candidate=s,a.candidate.toJSON=function(){return{candidate:a.candidate.candidate,sdpMid:a.candidate.sdpMid,sdpMLineIndex:a.candidate.sdpMLineIndex,usernameFragment:a.candidate.usernameFragment}}}var l=i.getMediaSections(o._localDescription.sdp);l[a.candidate.sdpMLineIndex]+=c?"a=end-of-candidates\r\n":"a="+a.candidate.candidate+"\r\n",o._localDescription.sdp=i.getDescription(o._localDescription.sdp)+l.join("");var u=o.transceivers.every((function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state}));"gathering"!==o.iceGatheringState&&(o.iceGatheringState="gathering",o._emitGatheringStateChange()),c||o._dispatchEvent("icecandidate",a),u&&(o._dispatchEvent("icecandidate",new Event("icecandidate")),o.iceGatheringState="complete",o._emitGatheringStateChange())}},e.setTimeout((function(){a.forEach((function(e){r.onlocalcandidate(e)}))}),0)}},m.prototype._createIceAndDtlsTransports=function(){var t=this,n=new e.RTCIceTransport(null);n.onicestatechange=function(){t._updateIceConnectionState(),t._updateConnectionState()};var i=new e.RTCDtlsTransport(n);return i.ondtlsstatechange=function(){t._updateConnectionState()},i.onerror=function(){Object.defineProperty(i,"state",{value:"failed",writable:!0}),t._updateConnectionState()},{iceTransport:n,dtlsTransport:i}},m.prototype._disposeIceAndDtlsTransports=function(e){var t=this.transceivers[e].iceGatherer;t&&(delete t.onlocalcandidate,delete this.transceivers[e].iceGatherer);var n=this.transceivers[e].iceTransport;n&&(delete n.onicestatechange,delete this.transceivers[e].iceTransport);var i=this.transceivers[e].dtlsTransport;i&&(delete i.ondtlsstatechange,delete i.onerror,delete this.transceivers[e].dtlsTransport)},m.prototype._transceive=function(e,n,o){var r=d(e.localCapabilities,e.remoteCapabilities);n&&e.rtpSender&&(r.encodings=e.sendEncodingParameters,r.rtcp={cname:i.localCName,compound:e.rtcpParameters.compound},e.recvEncodingParameters.length&&(r.rtcp.ssrc=e.recvEncodingParameters[0].ssrc),e.rtpSender.send(r)),o&&e.rtpReceiver&&r.codecs.length>0&&("video"===e.kind&&e.recvEncodingParameters&&t<15019&&e.recvEncodingParameters.forEach((function(e){delete e.rtx})),e.recvEncodingParameters.length?r.encodings=e.recvEncodingParameters:r.encodings=[{}],r.rtcp={compound:e.rtcpParameters.compound},e.rtcpParameters.cname&&(r.rtcp.cname=e.rtcpParameters.cname),e.sendEncodingParameters.length&&(r.rtcp.ssrc=e.sendEncodingParameters[0].ssrc),e.rtpReceiver.receive(r))},m.prototype.setLocalDescription=function(e){var t,n,o=this;if(-1===["offer","answer"].indexOf(e.type))return Promise.reject(l("TypeError",'Unsupported type "'+e.type+'"'));if(!c("setLocalDescription",e.type,o.signalingState)||o._isClosed)return Promise.reject(l("InvalidStateError","Can not set local "+e.type+" in state "+o.signalingState));if("offer"===e.type)t=i.splitSections(e.sdp),n=t.shift(),t.forEach((function(e,t){var n=i.parseRtpParameters(e);o.transceivers[t].localCapabilities=n})),o.transceivers.forEach((function(e,t){o._gather(e.mid,t)}));else if("answer"===e.type){t=i.splitSections(o._remoteDescription.sdp),n=t.shift();var r=i.matchPrefix(n,"a=ice-lite").length>0;t.forEach((function(e,t){var a=o.transceivers[t],c=a.iceGatherer,s=a.iceTransport,l=a.dtlsTransport,u=a.localCapabilities,p=a.remoteCapabilities,m=i.isRejected(e)&&0===i.matchPrefix(e,"a=bundle-only").length;if(!m&&!a.rejected){var h=i.getIceParameters(e,n),f=i.getDtlsParameters(e,n);r&&(f.role="server"),o.usingBundle&&0!==t||(o._gather(a.mid,t),"new"===s.state&&s.start(c,h,r?"controlling":"controlled"),"new"===l.state&&l.start(f));var g=d(u,p);o._transceive(a,g.codecs.length>0,!1)}}))}return o._localDescription={type:e.type,sdp:e.sdp},"offer"===e.type?o._updateSignalingState("have-local-offer"):o._updateSignalingState("stable"),Promise.resolve()},m.prototype.setRemoteDescription=function(o){var r=this;if(-1===["offer","answer"].indexOf(o.type))return Promise.reject(l("TypeError",'Unsupported type "'+o.type+'"'));if(!c("setRemoteDescription",o.type,r.signalingState)||r._isClosed)return Promise.reject(l("InvalidStateError","Can not set remote "+o.type+" in state "+r.signalingState));var a={};r.remoteStreams.forEach((function(e){a[e.id]=e}));var m=[],h=i.splitSections(o.sdp),f=h.shift(),g=i.matchPrefix(f,"a=ice-lite").length>0,v=i.matchPrefix(f,"a=group:BUNDLE ").length>0;r.usingBundle=v;var y=i.matchPrefix(f,"a=ice-options:")[0];return r.canTrickleIceCandidates=!!y&&y.substr(14).split(" ").indexOf("trickle")>=0,h.forEach((function(c,l){var p=i.splitLines(c),h=i.getKind(c),y=i.isRejected(c)&&0===i.matchPrefix(c,"a=bundle-only").length,C=p[0].substr(2).split(" ")[2],S=i.getDirection(c,f),T=i.parseMsid(c),b=i.getMid(c)||i.generateIdentifier();if(y||"application"===h&&("DTLS/SCTP"===C||"UDP/DTLS/SCTP"===C))r.transceivers[l]={mid:b,kind:h,protocol:C,rejected:!0};else{var w,P,k,E,I,x,_,j,R;!y&&r.transceivers[l]&&r.transceivers[l].rejected&&(r.transceivers[l]=r._createTransceiver(h,!0));var M,D,A=i.parseRtpParameters(c);y||(M=i.getIceParameters(c,f),D=i.getDtlsParameters(c,f),D.role="client"),_=i.parseRtpEncodingParameters(c);var B=i.parseRtcpParameters(c),z=i.matchPrefix(c,"a=end-of-candidates",f).length>0,F=i.matchPrefix(c,"a=candidate:").map((function(e){return i.parseCandidate(e)})).filter((function(e){return 1===e.component}));if(("offer"===o.type||"answer"===o.type)&&!y&&v&&l>0&&r.transceivers[l]&&(r._disposeIceAndDtlsTransports(l),r.transceivers[l].iceGatherer=r.transceivers[0].iceGatherer,r.transceivers[l].iceTransport=r.transceivers[0].iceTransport,r.transceivers[l].dtlsTransport=r.transceivers[0].dtlsTransport,r.transceivers[l].rtpSender&&r.transceivers[l].rtpSender.setTransport(r.transceivers[0].dtlsTransport),r.transceivers[l].rtpReceiver&&r.transceivers[l].rtpReceiver.setTransport(r.transceivers[0].dtlsTransport)),"offer"!==o.type||y){if("answer"===o.type&&!y){w=r.transceivers[l],P=w.iceGatherer,k=w.iceTransport,E=w.dtlsTransport,I=w.rtpReceiver,x=w.sendEncodingParameters,j=w.localCapabilities,r.transceivers[l].recvEncodingParameters=_,r.transceivers[l].remoteCapabilities=A,r.transceivers[l].rtcpParameters=B,F.length&&"new"===k.state&&(!g&&!z||v&&0!==l?F.forEach((function(e){s(w.iceTransport,e)})):k.setRemoteCandidates(F)),v&&0!==l||("new"===k.state&&k.start(P,M,"controlling"),"new"===E.state&&E.start(D));var L=d(w.localCapabilities,w.remoteCapabilities),O=L.codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length;!O&&w.sendEncodingParameters[0].rtx&&delete w.sendEncodingParameters[0].rtx,r._transceive(w,"sendrecv"===S||"recvonly"===S,"sendrecv"===S||"sendonly"===S),!I||"sendrecv"!==S&&"sendonly"!==S?delete w.rtpReceiver:(R=I.track,T?(a[T.stream]||(a[T.stream]=new e.MediaStream),n(R,a[T.stream]),m.push([R,I,a[T.stream]])):(a["default"]||(a["default"]=new e.MediaStream),n(R,a["default"]),m.push([R,I,a["default"]])))}}else{w=r.transceivers[l]||r._createTransceiver(h),w.mid=b,w.iceGatherer||(w.iceGatherer=r._createIceGatherer(l,v)),F.length&&"new"===w.iceTransport.state&&(!z||v&&0!==l?F.forEach((function(e){s(w.iceTransport,e)})):w.iceTransport.setRemoteCandidates(F)),j=e.RTCRtpReceiver.getCapabilities(h),t<15019&&(j.codecs=j.codecs.filter((function(e){return"rtx"!==e.name}))),x=w.sendEncodingParameters||[{ssrc:1001*(2*l+2)}];var N,U=!1;if("sendrecv"===S||"sendonly"===S){if(U=!w.rtpReceiver,I=w.rtpReceiver||new e.RTCRtpReceiver(w.dtlsTransport,h),U)R=I.track,T&&"-"===T.stream||(T?(a[T.stream]||(a[T.stream]=new e.MediaStream,Object.defineProperty(a[T.stream],"id",{get:function(){return T.stream}})),Object.defineProperty(R,"id",{get:function(){return T.track}}),N=a[T.stream]):(a["default"]||(a["default"]=new e.MediaStream),N=a["default"])),N&&(n(R,N),w.associatedRemoteMediaStreams.push(N)),m.push([R,I,N])}else w.rtpReceiver&&w.rtpReceiver.track&&(w.associatedRemoteMediaStreams.forEach((function(e){var t=e.getTracks().find((function(e){return e.id===w.rtpReceiver.track.id}));t&&u(t,e)})),w.associatedRemoteMediaStreams=[]);w.localCapabilities=j,w.remoteCapabilities=A,w.rtpReceiver=I,w.rtcpParameters=B,w.sendEncodingParameters=x,w.recvEncodingParameters=_,r._transceive(r.transceivers[l],!1,U)}}})),void 0===r._dtlsRole&&(r._dtlsRole="offer"===o.type?"active":"passive"),r._remoteDescription={type:o.type,sdp:o.sdp},"offer"===o.type?r._updateSignalingState("have-remote-offer"):r._updateSignalingState("stable"),Object.keys(a).forEach((function(t){var n=a[t];if(n.getTracks().length){if(-1===r.remoteStreams.indexOf(n)){r.remoteStreams.push(n);var i=new Event("addstream");i.stream=n,e.setTimeout((function(){r._dispatchEvent("addstream",i)}))}m.forEach((function(e){var t=e[0],i=e[1];n.id===e[2].id&&p(r,t,i,[n])}))}})),m.forEach((function(e){e[2]||p(r,e[0],e[1],[])})),e.setTimeout((function(){r&&r.transceivers&&r.transceivers.forEach((function(e){e.iceTransport&&"new"===e.iceTransport.state&&e.iceTransport.getRemoteCandidates().length>0&&(console.warn("Timeout for addRemoteCandidate. Consider sending an end-of-candidates notification"),e.iceTransport.addRemoteCandidate({}))}))}),4e3),Promise.resolve()},m.prototype.close=function(){this.transceivers.forEach((function(e){e.iceTransport&&e.iceTransport.stop(),e.dtlsTransport&&e.dtlsTransport.stop(),e.rtpSender&&e.rtpSender.stop(),e.rtpReceiver&&e.rtpReceiver.stop()})),this._isClosed=!0,this._updateSignalingState("closed")},m.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",t)},m.prototype._maybeFireNegotiationNeeded=function(){var t=this;"stable"===this.signalingState&&!0!==this.needNegotiation&&(this.needNegotiation=!0,e.setTimeout((function(){if(t.needNegotiation){t.needNegotiation=!1;var e=new Event("negotiationneeded");t._dispatchEvent("negotiationneeded",e)}}),0))},m.prototype._updateIceConnectionState=function(){var e,t={new:0,closed:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&!e.rejected&&t[e.iceTransport.state]++})),e="new",t.failed>0?e="failed":t.checking>0?e="checking":t.disconnected>0?e="disconnected":t["new"]>0?e="new":t.connected>0?e="connected":t.completed>0&&(e="completed"),e!==this.iceConnectionState){this.iceConnectionState=e;var n=new Event("iceconnectionstatechange");this._dispatchEvent("iceconnectionstatechange",n)}},m.prototype._updateConnectionState=function(){var e,t={new:0,closed:0,connecting:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&e.dtlsTransport&&!e.rejected&&(t[e.iceTransport.state]++,t[e.dtlsTransport.state]++)})),t.connected+=t.completed,e="new",t.failed>0?e="failed":t.connecting>0?e="connecting":t.disconnected>0?e="disconnected":t["new"]>0?e="new":t.connected>0&&(e="connected"),e!==this.connectionState){this.connectionState=e;var n=new Event("connectionstatechange");this._dispatchEvent("connectionstatechange",n)}},m.prototype.createOffer=function(){var n=this;if(n._isClosed)return Promise.reject(l("InvalidStateError","Can not call createOffer after close"));var o=n.transceivers.filter((function(e){return"audio"===e.kind})).length,a=n.transceivers.filter((function(e){return"video"===e.kind})).length,d=arguments[0];if(d){if(d.mandatory||d.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==d.offerToReceiveAudio&&(o=!0===d.offerToReceiveAudio?1:!1===d.offerToReceiveAudio?0:d.offerToReceiveAudio),void 0!==d.offerToReceiveVideo&&(a=!0===d.offerToReceiveVideo?1:!1===d.offerToReceiveVideo?0:d.offerToReceiveVideo)}n.transceivers.forEach((function(e){"audio"===e.kind?(o--,o<0&&(e.wantReceive=!1)):"video"===e.kind&&(a--,a<0&&(e.wantReceive=!1))}));while(o>0||a>0)o>0&&(n._createTransceiver("audio"),o--),a>0&&(n._createTransceiver("video"),a--);var c=i.writeSessionBoilerplate(n._sdpSessionId,n._sdpSessionVersion++);n.transceivers.forEach((function(o,r){var a=o.track,d=o.kind,c=o.mid||i.generateIdentifier();o.mid=c,o.iceGatherer||(o.iceGatherer=n._createIceGatherer(r,n.usingBundle));var s=e.RTCRtpSender.getCapabilities(d);t<15019&&(s.codecs=s.codecs.filter((function(e){return"rtx"!==e.name}))),s.codecs.forEach((function(e){"H264"===e.name&&void 0===e.parameters["level-asymmetry-allowed"]&&(e.parameters["level-asymmetry-allowed"]="1"),o.remoteCapabilities&&o.remoteCapabilities.codecs&&o.remoteCapabilities.codecs.forEach((function(t){e.name.toLowerCase()===t.name.toLowerCase()&&e.clockRate===t.clockRate&&(e.preferredPayloadType=t.payloadType)}))})),s.headerExtensions.forEach((function(e){var t=o.remoteCapabilities&&o.remoteCapabilities.headerExtensions||[];t.forEach((function(t){e.uri===t.uri&&(e.id=t.id)}))}));var l=o.sendEncodingParameters||[{ssrc:1001*(2*r+1)}];a&&t>=15019&&"video"===d&&!l[0].rtx&&(l[0].rtx={ssrc:l[0].ssrc+1}),o.wantReceive&&(o.rtpReceiver=new e.RTCRtpReceiver(o.dtlsTransport,d)),o.localCapabilities=s,o.sendEncodingParameters=l})),"max-compat"!==n._config.bundlePolicy&&(c+="a=group:BUNDLE "+n.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),c+="a=ice-options:trickle\r\n",n.transceivers.forEach((function(e,t){c+=r(e,e.localCapabilities,"offer",e.stream,n._dtlsRole),c+="a=rtcp-rsize\r\n",!e.iceGatherer||"new"===n.iceGatheringState||0!==t&&n.usingBundle||(e.iceGatherer.getLocalCandidates().forEach((function(e){e.component=1,c+="a="+i.writeCandidate(e)+"\r\n"})),"completed"===e.iceGatherer.state&&(c+="a=end-of-candidates\r\n"))}));var s=new e.RTCSessionDescription({type:"offer",sdp:c});return Promise.resolve(s)},m.prototype.createAnswer=function(){var n=this;if(n._isClosed)return Promise.reject(l("InvalidStateError","Can not call createAnswer after close"));if("have-remote-offer"!==n.signalingState&&"have-local-pranswer"!==n.signalingState)return Promise.reject(l("InvalidStateError","Can not call createAnswer in signalingState "+n.signalingState));var o=i.writeSessionBoilerplate(n._sdpSessionId,n._sdpSessionVersion++);n.usingBundle&&(o+="a=group:BUNDLE "+n.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),o+="a=ice-options:trickle\r\n";var a=i.getMediaSections(n._remoteDescription.sdp).length;n.transceivers.forEach((function(e,i){if(!(i+1>a)){if(e.rejected)return"application"===e.kind?"DTLS/SCTP"===e.protocol?o+="m=application 0 DTLS/SCTP 5000\r\n":o+="m=application 0 "+e.protocol+" webrtc-datachannel\r\n":"audio"===e.kind?o+="m=audio 0 UDP/TLS/RTP/SAVPF 0\r\na=rtpmap:0 PCMU/8000\r\n":"video"===e.kind&&(o+="m=video 0 UDP/TLS/RTP/SAVPF 120\r\na=rtpmap:120 VP8/90000\r\n"),void(o+="c=IN IP4 0.0.0.0\r\na=inactive\r\na=mid:"+e.mid+"\r\n");var c;if(e.stream)"audio"===e.kind?c=e.stream.getAudioTracks()[0]:"video"===e.kind&&(c=e.stream.getVideoTracks()[0]),c&&t>=15019&&"video"===e.kind&&!e.sendEncodingParameters[0].rtx&&(e.sendEncodingParameters[0].rtx={ssrc:e.sendEncodingParameters[0].ssrc+1});var s=d(e.localCapabilities,e.remoteCapabilities),l=s.codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length;!l&&e.sendEncodingParameters[0].rtx&&delete e.sendEncodingParameters[0].rtx,o+=r(e,s,"answer",e.stream,n._dtlsRole),e.rtcpParameters&&e.rtcpParameters.reducedSize&&(o+="a=rtcp-rsize\r\n")}}));var c=new e.RTCSessionDescription({type:"answer",sdp:o});return Promise.resolve(c)},m.prototype.addIceCandidate=function(e){var t,n=this;return e&&void 0===e.sdpMLineIndex&&!e.sdpMid?Promise.reject(new TypeError("sdpMLineIndex or sdpMid required")):new Promise((function(o,r){if(!n._remoteDescription)return r(l("InvalidStateError","Can not add ICE candidate without a remote description"));if(e&&""!==e.candidate){var a=e.sdpMLineIndex;if(e.sdpMid)for(var d=0;d0?i.parseCandidate(e.candidate):{};if("tcp"===u.protocol&&(0===u.port||9===u.port))return o();if(u.component&&1!==u.component)return o();if((0===a||a>0&&c.iceTransport!==n.transceivers[0].iceTransport)&&!s(c.iceTransport,u))return r(l("OperationError","Can not add ICE candidate"));var p=e.candidate.trim();0===p.indexOf("a=")&&(p=p.substr(2)),t=i.getMediaSections(n._remoteDescription.sdp),t[a]+="a="+(u.type?p:"end-of-candidates")+"\r\n",n._remoteDescription.sdp=i.getDescription(n._remoteDescription.sdp)+t.join("")}else for(var m=0;m0?"m="+e:e).trim()+"\r\n"}))},i.getDescription=function(e){var t=i.splitSections(e);return t&&t[0]},i.getMediaSections=function(e){var t=i.splitSections(e);return t.shift(),t},i.matchPrefix=function(e,t){return i.splitLines(e).filter((function(e){return 0===e.indexOf(t)}))},i.parseCandidate=function(e){var t;t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");for(var n={foundation:t[0],component:parseInt(t[1],10),protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]},i=8;i0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},i.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},i.parseFmtp=function(e){for(var t,n={},i=e.substr(e.indexOf(" ")+1).split(";"),o=0;o-1?(n.attribute=e.substr(t+1,i-t-1),n.value=e.substr(i+1)):n.attribute=e.substr(t+1),n},i.parseSsrcGroup=function(e){var t=e.substr(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((function(e){return parseInt(e,10)}))}},i.getMid=function(e){var t=i.matchPrefix(e,"a=mid:")[0];if(t)return t.substr(6)},i.parseFingerprint=function(e){var t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1]}},i.getDtlsParameters=function(e,t){var n=i.matchPrefix(e+t,"a=fingerprint:");return{role:"auto",fingerprints:n.map(i.parseFingerprint)}},i.writeDtlsParameters=function(e,t){var n="a=setup:"+t+"\r\n";return e.fingerprints.forEach((function(e){n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),n},i.getIceParameters=function(e,t){var n=i.splitLines(e);n=n.concat(i.splitLines(t));var o={usernameFragment:n.filter((function(e){return 0===e.indexOf("a=ice-ufrag:")}))[0].substr(12),password:n.filter((function(e){return 0===e.indexOf("a=ice-pwd:")}))[0].substr(10)};return o},i.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},i.parseRtpParameters=function(e){for(var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=i.splitLines(e),o=n[0].split(" "),r=3;r0?"9":"0",n+=" UDP/TLS/RTP/SAVPF ",n+=t.codecs.map((function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType})).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach((function(e){n+=i.writeRtpMap(e),n+=i.writeFmtp(e),n+=i.writeRtcpFb(e)}));var o=0;return t.codecs.forEach((function(e){e.maxptime>o&&(o=e.maxptime)})),o>0&&(n+="a=maxptime:"+o+"\r\n"),n+="a=rtcp-mux\r\n",t.headerExtensions&&t.headerExtensions.forEach((function(e){n+=i.writeExtmap(e)})),n},i.parseRtpEncodingParameters=function(e){var t,n=[],o=i.parseRtpParameters(e),r=-1!==o.fecMechanisms.indexOf("RED"),a=-1!==o.fecMechanisms.indexOf("ULPFEC"),d=i.matchPrefix(e,"a=ssrc:").map((function(e){return i.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute})),c=d.length>0&&d[0].ssrc,s=i.matchPrefix(e,"a=ssrc-group:FID").map((function(e){var t=e.substr(17).split(" ");return t.map((function(e){return parseInt(e,10)}))}));s.length>0&&s[0].length>1&&s[0][0]===c&&(t=s[0][1]),o.codecs.forEach((function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var i={ssrc:c,codecPayloadType:parseInt(e.parameters.apt,10)};c&&t&&(i.rtx={ssrc:t}),n.push(i),r&&(i=JSON.parse(JSON.stringify(i)),i.fec={ssrc:c,mechanism:a?"red+ulpfec":"red"},n.push(i))}})),0===n.length&&c&&n.push({ssrc:c});var l=i.matchPrefix(e,"b=");return l.length&&(l=0===l[0].indexOf("b=TIAS:")?parseInt(l[0].substr(7),10):0===l[0].indexOf("b=AS:")?1e3*parseInt(l[0].substr(5),10)*.95-16e3:void 0,n.forEach((function(e){e.maxBitrate=l}))),n},i.parseRtcpParameters=function(e){var t={},n=i.matchPrefix(e,"a=ssrc:").map((function(e){return i.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute}))[0];n&&(t.cname=n.value,t.ssrc=n.ssrc);var o=i.matchPrefix(e,"a=rtcp-rsize");t.reducedSize=o.length>0,t.compound=0===o.length;var r=i.matchPrefix(e,"a=rtcp-mux");return t.mux=r.length>0,t},i.parseMsid=function(e){var t,n=i.matchPrefix(e,"a=msid:");if(1===n.length)return t=n[0].substr(7).split(" "),{stream:t[0],track:t[1]};var o=i.matchPrefix(e,"a=ssrc:").map((function(e){return i.parseSsrcMedia(e)})).filter((function(e){return"msid"===e.attribute}));return o.length>0?(t=o[0].value.split(" "),{stream:t[0],track:t[1]}):void 0},i.parseSctpDescription=function(e){var t,n=i.parseMLine(e),o=i.matchPrefix(e,"a=max-message-size:");o.length>0&&(t=parseInt(o[0].substr(19),10)),isNaN(t)&&(t=65536);var r=i.matchPrefix(e,"a=sctp-port:");if(r.length>0)return{port:parseInt(r[0].substr(12),10),protocol:n.fmt,maxMessageSize:t};var a=i.matchPrefix(e,"a=sctpmap:");if(a.length>0){var d=i.matchPrefix(e,"a=sctpmap:")[0].substr(10).split(" ");return{port:parseInt(d[0],10),protocol:d[1],maxMessageSize:t}}},i.writeSctpDescription=function(e,t){var n=[];return n="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&n.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),n.join("")},i.generateSessionId=function(){return Math.random().toString().substr(2,21)},i.writeSessionBoilerplate=function(e,t,n){var o,r=void 0!==t?t:2;o=e||i.generateSessionId();var a=n||"thisisadapterortc";return"v=0\r\no="+a+" "+o+" "+r+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},i.writeMediaSection=function(e,t,n,o){var r=i.writeRtpDescription(e.kind,t);if(r+=i.writeIceParameters(e.iceGatherer.getLocalParameters()),r+=i.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":"active"),r+="a=mid:"+e.mid+"\r\n",e.direction?r+="a="+e.direction+"\r\n":e.rtpSender&&e.rtpReceiver?r+="a=sendrecv\r\n":e.rtpSender?r+="a=sendonly\r\n":e.rtpReceiver?r+="a=recvonly\r\n":r+="a=inactive\r\n",e.rtpSender){var a="msid:"+o.id+" "+e.rtpSender.track.id+"\r\n";r+="a="+a,r+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+a,e.sendEncodingParameters[0].rtx&&(r+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+a,r+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return r+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+i.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(r+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+i.localCName+"\r\n"),r},i.getDirection=function(e,t){for(var n=i.splitLines(e),o=0;o=26&&e<=t||Y.extension.isInstalled()}return!0};var X={extensionId:"hapfgfdkleiggjjpfpenajgdnfckjpaj",isInstalled:function(){return null!==document.querySelector("#janus-extension-installed")},getScreen:function(e){var t=window.setTimeout((function(){var t=new Error("NavigatorUserMediaError");return t.name='The required Chrome extension is not installed: click here to install it. (NOTE: this will need you to refresh the page)',e(t)}),1e3);this.cache[t]=e,window.postMessage({type:"janusGetScreen",id:t},"*")},init:function(){var e={};this.cache=e,window.addEventListener("message",(function(t){if(t.origin==window.location.origin)if("janusGotScreen"==t.data.type&&e[t.data.id]){var n=e[t.data.id];if(delete e[t.data.id],""===t.data.sourceId){var i=new Error("NavigatorUserMediaError");i.name="You cancelled the request for permission, giving up...",n(i)}else n(null,t.data.sourceId)}else"janusGetScreenPending"==t.data.type&&(console.log("clearing ",t.data.id),window.clearTimeout(t.data.id))}))}};function Y(e){if(void 0===Y.initDone)return e.error("Library not initialized"),{};if(!Y.isWebrtcSupported())return e.error("WebRTC not supported by this browser"),{};if(Y.log("Library initialized: "+Y.initDone),e=e||{},e.success="function"==typeof e.success?e.success:Y.noop,e.error="function"==typeof e.error?e.error:Y.noop,e.destroyed="function"==typeof e.destroyed?e.destroyed:Y.noop,null===e.server||void 0===e.server)return e.error("Invalid server url"),{};var t=!1,n=null,i={},o=null,r=null,a=0,c=e.server;Y.isArray(c)?(Y.log("Multiple servers provided ("+c.length+"), will use the first that works"),c=null,r=e.server,Y.debug(r)):0===c.indexOf("ws")?(t=!0,Y.log("Using WebSockets to contact Janus: "+c)):(t=!1,Y.log("Using REST API to contact Janus: "+c));var s=e.iceServers;void 0!==s&&null!==s||(s=[{urls:"stun:stun.l.google.com:19302"}]);var l=e.iceTransportPolicy,u=e.bundlePolicy,p=e.ipv6;void 0!==p&&null!==p||(p=!1);var m=!1;void 0!==e.withCredentials&&null!==e.withCredentials&&(m=!0===e.withCredentials);var h=10;void 0!==e.max_poll_events&&null!==e.max_poll_events&&(h=e.max_poll_events),h<1&&(h=1);var f=null;void 0!==e.token&&null!==e.token&&(f=e.token);var g=null;void 0!==e.apisecret&&null!==e.apisecret&&(g=e.apisecret),this.destroyOnUnload=!0,void 0!==e.destroyOnUnload&&null!==e.destroyOnUnload&&(this.destroyOnUnload=!0===e.destroyOnUnload);var v=25e3;void 0!==e.keepAlivePeriod&&null!==e.keepAlivePeriod&&(v=e.keepAlivePeriod),isNaN(v)&&(v=25e3);var y=6e4;function C(e){var t={high:9e5,medium:3e5,low:1e5};return void 0!==e&&null!==e&&(e.high&&(t.high=e.high),e.medium&&(t.medium=e.medium),e.low&&(t.low=e.low)),t}void 0!==e.longPollTimeout&&null!==e.longPollTimeout&&(y=e.longPollTimeout),isNaN(y)&&(y=6e4);var S=!1,T=null,b={},w=this,P=0,k={};function E(){if(null!=T)if(Y.debug("Long poll..."),S){var t=c+"/"+T+"?rid="+(new Date).getTime();void 0!==h&&null!==h&&(t=t+"&maxev="+h),null!==f&&void 0!==f&&(t=t+"&token="+encodeURIComponent(f)),null!==g&&void 0!==g&&(t=t+"&apisecret="+encodeURIComponent(g)),Y.httpAPICall(t,{verb:"GET",withCredentials:m,success:I,timeout:y,error:function(t,n){if(Y.error(t+":",n),P++,P>3)return S=!1,void e.error("Lost connection to the server (is it down?)");E()}})}else Y.warn("Is the server down? (connected=false)")}function I(e,i){if(P=0,t||void 0===T||null===T||!0===i||E(),t||!Y.isArray(e))if("keepalive"!==e["rtcgw"])if("ack"!==e["rtcgw"])if("success"!==e["rtcgw"])if("trickle"===e["rtcgw"]){var o=e["sender"];if(void 0===o||null===o)return void Y.warn("Missing sender...");var r=b[o];if(void 0===r||null===r)return void Y.debug("This handle is not attached to this session");var a=e["candidate"];Y.debug("Got a trickled candidate on session "+T),Y.debug(a);var d=r.webrtcStuff;d.pc&&d.remoteSdp?(Y.debug("Adding remote candidate:",a),a&&!0!==a.completed?d.pc.addIceCandidate(a):d.pc.addIceCandidate(Y.endOfCandidates)):(Y.debug("We didn't do setRemoteDescription (trickle got here before the offer?), caching candidate"),d.candidates||(d.candidates=[]),d.candidates.push(a),Y.debug(d.candidates))}else{if("webrtcup"===e["rtcgw"]){Y.debug("Got a webrtcup event on session "+T),Y.debug(e);o=e["sender"];if(void 0===o||null===o)return void Y.warn("Missing sender...");r=b[o];return void 0===r||null===r?void Y.debug("This handle is not attached to this session"):void r.webrtcState(!0)}if("hangup"===e["rtcgw"]){Y.debug("Got a hangup event on session "+T),Y.debug(e);o=e["sender"];if(void 0===o||null===o)return void Y.warn("Missing sender...");r=b[o];if(void 0===r||null===r)return void Y.debug("This handle is not attached to this session");r.webrtcState(!1,e["reason"]),r.hangup()}else if("detached"===e["rtcgw"]){Y.debug("Got a detached event on session "+T),Y.debug(e);o=e["sender"];if(void 0===o||null===o)return void Y.warn("Missing sender...");r=b[o];if(void 0===r||null===r)return;r.detached=!0,r.ondetached(),r.detach()}else if("media"===e["rtcgw"]){Y.debug("Got a media event on session "+T),Y.debug(e);o=e["sender"];if(void 0===o||null===o)return void Y.warn("Missing sender...");r=b[o];if(void 0===r||null===r)return void Y.debug("This handle is not attached to this session");r.mediaState(e["type"],e["receiving"])}else if("slowlink"===e["rtcgw"]){Y.debug("Got a slowlink event on session "+T),Y.debug(e);o=e["sender"];if(void 0===o||null===o)return void Y.warn("Missing sender...");r=b[o];if(void 0===r||null===r)return void Y.debug("This handle is not attached to this session");r.slowLink(e["uplink"],e["lost"])}else{if("error"===e["rtcgw"]){Y.error("Ooops: "+e["error"].code+" "+e["error"].reason),Y.debug(e);p=e["transaction"];if(null!==p&&void 0!==p){m=k[p];null!==m&&void 0!==m&&m(e),delete k[p]}return}if("event"===e["rtcgw"]){Y.debug("Got a plugin event on session "+T),Y.debug(e);o=e["sender"];if(void 0===o||null===o)return void Y.warn("Missing sender...");var c=e["plugindata"];if(void 0===c||null===c)return void Y.warn("Missing plugindata...");Y.debug(" -- Event is coming from "+o+" ("+c["plugin"]+")");var s=c["data"];Y.debug(s);r=b[o];if(void 0===r||null===r)return void Y.warn("This handle is not attached to this session");var l=e["jsep"];void 0!==l&&null!==l&&(Y.debug("Handling SDP as well..."),Y.debug(l));var u=r.onmessage;null!==u&&void 0!==u?(Y.debug("Notifying application..."),u(s,l)):Y.debug("No provided notification callback")}else{if("timeout"===e["rtcgw"])return Y.error("Timeout on session "+T),Y.debug(e),void(t&&n.close(3504,"Gateway timeout"));Y.warn("Unknown message/event '"+e["rtcgw"]+"' on session "+T),Y.debug(e)}}}else{Y.debug("Got a success on session "+T),Y.debug(e);var p=e["transaction"];if(null!==p&&void 0!==p){var m=k[p];null!==m&&void 0!==m&&m(e),delete k[p]}}else{Y.debug("Got an ack on session "+T),Y.debug(e);var p=e["transaction"];if(null!==p&&void 0!==p){var m=k[p];null!==m&&void 0!==m&&m(e),delete k[p]}}else Y.vdebug("Got a keepalive on session "+T);else for(var h=0;h data channel: "+n),"open"===n){if(r.dataChannel[t].pending&&r.dataChannel[t].pending.length>0){for(var i in Y.log("Sending pending messages on <"+t+">:",r.dataChannel[t].pending.length),r.dataChannel[t].pending){var a=r.dataChannel[t].pending[i];Y.log("Sending string on data channel <"+t+">: "+a),r.dataChannel[t].send(a)}r.dataChannel[t].pending=[]}o.ondataopen(t)}},c=function(e){Y.error("Got error on data channel:",e)};r.dataChannel[t]=n||r.pc.createDataChannel(t,{ordered:!1}),r.dataChannel[t].onmessage=a,r.dataChannel[t].onopen=d,r.dataChannel[t].onclose=d,r.dataChannel[t].onerror=c,r.dataChannel[t].pending=[],i&&r.dataChannel[t].pending.push(i)}else Y.warn("Invalid handle")}function B(e,t){t=t||{},t.success="function"==typeof t.success?t.success:Y.noop,t.error="function"==typeof t.error?t.error:Y.noop;var n=b[e];if(null===n||void 0===n||null===n.webrtcStuff||void 0===n.webrtcStuff)return Y.warn("Invalid handle"),void t.error("Invalid handle");var i=n.webrtcStuff,o=t.text;if(null===o||void 0===o)return Y.warn("Invalid text"),void t.error("Invalid text");var r=t.label?t.label:Y.dataChanDefaultLabel;return i.dataChannel[r]?"open"!==i.dataChannel[r].readyState?(i.dataChannel[r].pending.push(o),void t.success()):(Y.log("Sending string on data channel <"+r+">: "+o),i.dataChannel[r].send(o),void t.success()):(A(e,r,!1,o),void t.success())}function z(e,t){t=t||{},t.success="function"==typeof t.success?t.success:Y.noop,t.error="function"==typeof t.error?t.error:Y.noop;var n=b[e];if(null===n||void 0===n||null===n.webrtcStuff||void 0===n.webrtcStuff)return Y.warn("Invalid handle"),void t.error("Invalid handle");var i=n.webrtcStuff;if(null===i.dtmfSender||void 0===i.dtmfSender){if(void 0!==i.pc&&null!==i.pc){var o=i.pc.getSenders(),r=o.find((function(e){return e.track&&"audio"===e.track.kind}));if(!r)return Y.warn("Invalid DTMF configuration (no audio track)"),void t.error("Invalid DTMF configuration (no audio track)");i.dtmfSender=r.dtmf,i.dtmfSender&&(Y.log("Created DTMF Sender"),i.dtmfSender.ontonechange=function(e){Y.debug("Sent DTMF tone: "+e.tone)})}if(null===i.dtmfSender||void 0===i.dtmfSender)return Y.warn("Invalid DTMF configuration"),void t.error("Invalid DTMF configuration")}var a=t.dtmf;if(null===a||void 0===a)return Y.warn("Invalid DTMF parameters"),void t.error("Invalid DTMF parameters");var d=a.tones;if(null===d||void 0===d)return Y.warn("Invalid DTMF string"),void t.error("Invalid DTMF string");var c=a.duration;null!==c&&void 0!==c||(c=500);var s=a.gap;null!==s&&void 0!==s||(s=50),Y.debug("Sending DTMF string "+d+" (duration "+c+"ms, gap "+s+"ms)"),i.dtmfSender.insertDTMF(d,c,s),t.success()}function F(e,i){i=i||{},i.success="function"==typeof i.success?i.success:Y.noop,i.error="function"==typeof i.error?i.error:Y.noop;var o=!0;void 0!==i.asyncRequest&&null!==i.asyncRequest&&(o=!0===i.asyncRequest);var r=!0;void 0!==i.noRequest&&null!==i.noRequest&&(r=!0===i.noRequest),Y.log("Destroying handle "+e+" (async="+o+")"),q(e);var a=b[e];if(null===a||void 0===a||a.detached)return delete b[e],void i.success();if(r)return delete b[e],void i.success();if(!S)return Y.warn("Is the server down? (connected=false)"),void i.error("Is the server down? (connected=false)");var d={rtcgw:"detach",transaction:Y.randomString(12)};if(null!==a.token&&void 0!==a.token&&(d["token"]=a.token),null!==g&&void 0!==g&&(d["apisecret"]=g),t)return d["session_id"]=T,d["handle_id"]=e,n.send(JSON.stringify(d)),delete b[e],void i.success();Y.httpAPICall(c+"/"+T+"/"+e,{verb:"POST",async:o,withCredentials:m,body:d,success:function(t){Y.log("Destroyed handle:"),Y.debug(t),"success"!==t["rtcgw"]&&Y.error("Ooops: "+t["error"].code+" "+t["error"].reason),delete b[e],i.success()},error:function(t,n){Y.error(t+":",n),delete b[e],i.success()}})}function L(e,t,n,i,o){var r=b[e];if(null===r||void 0===r||null===r.webrtcStuff||void 0===r.webrtcStuff)return Y.warn("Invalid handle"),void i.error("Invalid handle");var a=r.webrtcStuff;Y.debug("streamsDone:",o),o&&(Y.debug(" -- Audio tracks:",o.getAudioTracks()),Y.debug(" -- Video tracks:",o.getVideoTracks()));var c=!1;if(a.myStream&&n.update&&!a.streamExternal){if((!n.update&&$(n)||n.update&&(n.addAudio||n.replaceAudio))&&o.getAudioTracks()&&o.getAudioTracks().length)if(a.myStream.addTrack(o.getAudioTracks()[0]),Y.unifiedPlan){Y.log((n.replaceAudio?"Replacing":"Adding")+" audio track:",o.getAudioTracks()[0]);var m=null,h=a.pc.getTransceivers();if(h&&h.length>0)for(var f in h){var g=h[f];if(g.sender&&g.sender.track&&"audio"===g.sender.track.kind||g.receiver&&g.receiver.track&&"audio"===g.receiver.track.kind){m=g;break}}m&&m.sender?m.sender.replaceTrack(o.getAudioTracks()[0]):a.pc.addTrack(o.getAudioTracks()[0],o)}else Y.log((n.replaceAudio?"Replacing":"Adding")+" audio track:",o.getAudioTracks()[0]),a.pc.addTrack(o.getAudioTracks()[0],o);if((!n.update&&te(n)||n.update&&(n.addVideo||n.replaceVideo))&&o.getVideoTracks()&&o.getVideoTracks().length)if(a.myStream.addTrack(o.getVideoTracks()[0]),Y.unifiedPlan){Y.log((n.replaceVideo?"Replacing":"Adding")+" video track:",o.getVideoTracks()[0]);var v=null;h=a.pc.getTransceivers();if(h&&h.length>0)for(var f in h){g=h[f];if(g.sender&&g.sender.track&&"video"===g.sender.track.kind||g.receiver&&g.receiver.track&&"video"===g.receiver.track.kind){v=g;break}}v&&v.sender?v.sender.replaceTrack(o.getVideoTracks()[0]):a.pc.addTrack(o.getVideoTracks()[0],o)}else Y.log((n.replaceVideo?"Replacing":"Adding")+" video track:",o.getVideoTracks()[0]),a.pc.addTrack(o.getVideoTracks()[0],o)}else a.myStream=o,c=!0;if(!a.pc){var y={iceServers:s,iceTransportPolicy:l,bundlePolicy:u};"chrome"===Y.webRTCAdapter.browserDetails.browser&&(y["sdpSemantics"]=Y.webRTCAdapter.browserDetails.version<72?"plan-b":"unified-plan");var S={optional:[{DtlsSrtpKeyAgreement:!0}]};if(!0===p&&S.optional.push({googIPv6:!0}),i.rtcConstraints&&"object"===d(i.rtcConstraints))for(var f in Y.debug("Adding custom PeerConnection constraints:",i.rtcConstraints),i.rtcConstraints)S.optional.push(i.rtcConstraints[f]);"edge"===Y.webRTCAdapter.browserDetails.browser&&(y.bundlePolicy="max-bundle"),Y.log("Creating PeerConnection"),Y.debug(S),a.pc=new RTCPeerConnection(y,S),Y.debug(a.pc),a.pc.getStats&&(a.volume={},a.bitrate.value="0 kbits/sec"),Y.log("Preparing local SDP and gathering candidates (trickle="+a.trickle+")"),a.pc.oniceconnectionstatechange=function(e){a.pc&&r.iceState(a.pc.iceConnectionState)},a.pc.onicecandidate=function(t){if(null==t.candidate||"edge"===Y.webRTCAdapter.browserDetails.browser&&t.candidate.candidate.indexOf("endOfCandidates")>0)Y.log("End of candidates."),a.iceDone=!0,!0===a.trickle?D(e,{completed:!0}):H(e,i);else{var n={candidate:t.candidate.candidate,sdpMid:t.candidate.sdpMid,sdpMLineIndex:t.candidate.sdpMLineIndex};!0===a.trickle&&D(e,n)}},a.pc.ontrack=function(e){Y.log("Handling Remote Track"),Y.debug(e),e.streams&&(a.remoteStream=e.streams[0],r.onremotestream(a.remoteStream),e.track.onended||(Y.log("Adding onended callback to track:",e.track),e.track.onended=function(e){Y.log("Remote track muted/removed:",e),a.remoteStream&&(a.remoteStream.removeTrack(e.target),r.onremotestream(a.remoteStream))},e.track.onmute=e.track.onended,e.track.onunmute=function(e){Y.log("Remote track flowing again:",e);try{a.remoteStream.addTrack(e.target),r.onremotestream(a.remoteStream)}catch(t){Y.error(t)}}))}}if(c&&null!==o&&void 0!==o){Y.log("Adding local stream");var T=!0===i.simulcast2;o.getTracks().forEach((function(e){if(Y.log("Adding local track:",e),T)if("audio"===e.kind)a.pc.addTrack(e,o);else{Y.log("Enabling rid-based simulcasting:",e);var t=C(i.simulcastMaxBitrates);a.pc.addTransceiver(e,{direction:"sendrecv",streams:[o],sendEncodings:[{rid:"h",active:!0,maxBitrate:t.high},{rid:"m",active:!0,maxBitrate:t.medium,scaleResolutionDownBy:2},{rid:"l",active:!0,maxBitrate:t.low,scaleResolutionDownBy:4}]})}else a.pc.addTrack(e,o)}))}re(n)&&!a.dataChannel[Y.dataChanDefaultLabel]&&(Y.log("Creating data channel"),A(e,Y.dataChanDefaultLabel,!1),a.pc.ondatachannel=function(t){Y.log("Data channel created by Janus:",t),A(e,t.channel.label,t.channel)}),a.myStream&&r.onlocalstream(a.myStream),null===t||void 0===t?U(e,n,i):a.pc.setRemoteDescription(t).then((function(){if(Y.log("Remote description accepted!"),a.remoteSdp=t.sdp,a.candidates&&a.candidates.length>0){for(var o=0;o=26&&E<=I?(g={video:{mandatory:{googLeakyBucket:!0,maxWidth:window.screen.width,maxHeight:window.screen.height,minFrameRate:o.screenshareFrameRate,maxFrameRate:o.screenshareFrameRate,chromeMediaSource:"screen"}},audio:$(o)&&!o.keepAudio},k(g,P)):Y.extension.getScreen((function(e,t){if(e)return r.consentDialog(!1),n.error(e);g={audio:!1,video:{mandatory:{chromeMediaSource:"desktop",maxWidth:window.screen.width,maxHeight:window.screen.height,minFrameRate:o.screenshareFrameRate,maxFrameRate:o.screenshareFrameRate},optional:[{googLeakyBucket:!0},{googTemporalLayeredScreencast:!0}]}},g.video.mandatory.chromeMediaSourceId=t,k(g,P,$(o)&&!o.keepAudio)}))}else if("firefox"===Y.webRTCAdapter.browserDetails.browser){if(!(Y.webRTCAdapter.browserDetails.version>=33)){var x=new Error("NavigatorUserMediaError");return x.name="Your version of Firefox does not support screen sharing, please install Firefox 33 (or more recent versions)",r.consentDialog(!1),void n.error(x)}g={video:{mozMediaSource:o.video,mediaSource:o.video},audio:$(o)&&!o.keepAudio},k(g,(function(e,t){if(P(e,t),!e)var n=t.currentTime,i=window.setInterval((function(){t||window.clearInterval(i),t.currentTime==n&&(window.clearInterval(i),t.onended&&t.onended()),n=t.currentTime}),500)}))}return}}null!==o&&void 0!==o&&"screen"===o.video||navigator.mediaDevices.enumerateDevices().then((function(t){var a=t.some((function(e){return"audioinput"===e.kind})),d=oe(o)||t.some((function(e){return"videoinput"===e.kind})),c=$(o),s=te(o),l=Q(o),u=ne(o);if(c||s||l||u){var m=!!c&&a,h=!!s&&d;if(!m&&!h)return r.consentDialog(!1),n.error("No capture device found"),!1;if(!m&&l)return r.consentDialog(!1),n.error("Audio capture is required, but no capture device found"),!1;if(!h&&u)return r.consentDialog(!1),n.error("Video capture is required, but no capture device found"),!1}var f={audio:!(!a||o.keepAudio)&&v,video:!(!d||o.keepVideo)&&y};Y.debug("getUserMedia constraints",f),f.audio||f.video?navigator.mediaDevices.getUserMedia(f).then((function(t){r.consentDialog(!1),L(e,i,o,n,t)}))["catch"]((function(e){r.consentDialog(!1),n.error({code:e.code,name:e.name,message:e.message})})):(r.consentDialog(!1),L(e,i,o,n,p))}))["catch"]((function(e){r.consentDialog(!1),n.error("enumerateDevices error",e)}))}else L(e,i,o,n)}function N(e,t){t=t||{},t.success="function"==typeof t.success?t.success:Y.noop,t.error="function"==typeof t.error?t.error:J;var n=t.jsep,i=b[e];if(null===i||void 0===i||null===i.webrtcStuff||void 0===i.webrtcStuff)return Y.warn("Invalid handle"),void t.error("Invalid handle");var o=i.webrtcStuff;if(void 0!==n&&null!==n){if(null===o.pc)return Y.warn("Wait, no PeerConnection?? if this is an answer, use createAnswer and not handleRemoteJsep"),void t.error("No PeerConnection: if this is an answer, use createAnswer and not handleRemoteJsep");o.pc.setRemoteDescription(n).then((function(){if(Y.log("Remote description accepted!"),o.remoteSdp=n.sdp,o.candidates&&o.candidates.length>0){for(var e=0;e0)for(var l in s){var u=s[l];u.sender&&u.sender.track&&"audio"===u.sender.track.kind||u.receiver&&u.receiver.track&&"audio"===u.receiver.track.kind?d||(d=u):(u.sender&&u.sender.track&&"video"===u.sender.track.kind||u.receiver&&u.receiver.track&&"video"===u.receiver.track.kind)&&(c||(c=u))}var p=$(t),m=ee(t);p||m?p&&m?d&&(d.setDirection?d.setDirection("sendrecv"):d.direction="sendrecv",Y.log("Setting audio transceiver to sendrecv:",d)):p&&!m?d&&(d.setDirection?d.setDirection("sendonly"):d.direction="sendonly",Y.log("Setting audio transceiver to sendonly:",d)):!p&&m&&(d?(d.setDirection?d.setDirection("recvonly"):d.direction="recvonly",Y.log("Setting audio transceiver to recvonly:",d)):(d=o.pc.addTransceiver("audio",{direction:"recvonly"}),Y.log("Adding recvonly audio transceiver:",d))):t.removeAudio&&d&&(d.setDirection?d.setDirection("inactive"):d.direction="inactive",Y.log("Setting audio transceiver to inactive:",d));var h=te(t),f=ie(t);h||f?h&&f?c&&(c.setDirection?c.setDirection("sendrecv"):c.direction="sendrecv",Y.log("Setting video transceiver to sendrecv:",c)):h&&!f?c&&(c.setDirection?c.setDirection("sendonly"):c.direction="sendonly",Y.log("Setting video transceiver to sendonly:",c)):!h&&f&&(c?(c.setDirection?c.setDirection("recvonly"):c.direction="recvonly",Y.log("Setting video transceiver to recvonly:",c)):(c=o.pc.addTransceiver("video",{direction:"recvonly"}),Y.log("Adding recvonly video transceiver:",c))):t.removeVideo&&c&&(c.setDirection?c.setDirection("inactive"):c.direction="inactive",Y.log("Setting video transceiver to inactive:",c))}else a["offerToReceiveAudio"]=ee(t),a["offerToReceiveVideo"]=ie(t);var g=!0===n.iceRestart;g&&(a["iceRestart"]=!0),Y.debug(a);var v=te(t);if(v&&r&&"firefox"===Y.webRTCAdapter.browserDetails.browser){Y.log("Enabling Simulcasting for Firefox (RID)");var y=o.pc.getSenders().find((function(e){return"video"==e.track.kind}));if(y){var S=y.getParameters();S||(S={});var T=C(n.simulcastMaxBitrates);S.encodings=[{rid:"h",active:!0,maxBitrate:T.high},{rid:"m",active:!0,maxBitrate:T.medium,scaleResolutionDownBy:2},{rid:"l",active:!0,maxBitrate:T.low,scaleResolutionDownBy:4}],y.setParameters(S)}}o.pc.createOffer(a).then((function(e){Y.debug(e);var t={type:e.type,sdp:e.sdp};n.customizeSdp(t),e.sdp=t.sdp,Y.log("Setting local description"),v&&r&&("chrome"===Y.webRTCAdapter.browserDetails.browser||"safari"===Y.webRTCAdapter.browserDetails.browser?(Y.log("Enabling Simulcasting for Chrome (SDP munging)"),e.sdp=X(e.sdp)):"firefox"!==Y.webRTCAdapter.browserDetails.browser&&Y.warn("simulcast=true, but this is not Chrome nor Firefox, ignoring")),o.mySdp=e.sdp,o.pc.setLocalDescription(e)["catch"](n.error),o.mediaConstraints=a,o.iceDone||o.trickle?(Y.log("Offer ready"),Y.debug(n),n.success(e)):Y.log("Waiting for all candidates...")}),n.error)}function V(e,t,n){n=n||{},n.success="function"==typeof n.success?n.success:Y.noop,n.error="function"==typeof n.error?n.error:Y.noop,n.customizeSdp="function"==typeof n.customizeSdp?n.customizeSdp:Y.noop;var i=b[e];if(null===i||void 0===i||null===i.webrtcStuff||void 0===i.webrtcStuff)return Y.warn("Invalid handle"),void n.error("Invalid handle");var o=i.webrtcStuff,r=!0===n.simulcast;r?Y.log("Creating answer (iceDone="+o.iceDone+", simulcast="+r+")"):Y.log("Creating answer (iceDone="+o.iceDone+")");var a=null;if(Y.unifiedPlan){a={};var d=null,c=null,s=o.pc.getTransceivers();if(s&&s.length>0)for(var l in s){var u=s[l];u.sender&&u.sender.track&&"audio"===u.sender.track.kind||u.receiver&&u.receiver.track&&"audio"===u.receiver.track.kind?d||(d=u):(u.sender&&u.sender.track&&"video"===u.sender.track.kind||u.receiver&&u.receiver.track&&"video"===u.receiver.track.kind)&&(c||(c=u))}var p=$(t),m=ee(t);if(p||m){if(p&&m){if(d)try{d.setDirection?d.setDirection("sendrecv"):d.direction="sendrecv",Y.log("Setting audio transceiver to sendrecv:",d)}catch(T){Y.error(T)}}else if(p&&!m)try{d&&(d.setDirection?d.setDirection("sendonly"):d.direction="sendonly",Y.log("Setting audio transceiver to sendonly:",d))}catch(T){Y.error(T)}else if(!p&&m)if(d)try{d.setDirection?d.setDirection("recvonly"):d.direction="recvonly",Y.log("Setting audio transceiver to recvonly:",d)}catch(T){Y.error(T)}else d=o.pc.addTransceiver("audio",{direction:"recvonly"}),Y.log("Adding recvonly audio transceiver:",d)}else if(t.removeAudio&&d)try{d.setDirection?d.setDirection("inactive"):d.direction="inactive",Y.log("Setting audio transceiver to inactive:",d)}catch(T){Y.error(T)}var h=te(t),f=ie(t);if(h||f){if(h&&f){if(c)try{c.setDirection?c.setDirection("sendrecv"):c.direction="sendrecv",Y.log("Setting video transceiver to sendrecv:",c)}catch(T){Y.error(T)}}else if(h&&!f){if(c)try{c.setDirection?c.setDirection("sendonly"):c.direction="sendonly",Y.log("Setting video transceiver to sendonly:",c)}catch(T){Y.error(T)}}else if(!h&&f)if(c)try{c.setDirection?c.setDirection("recvonly"):c.direction="recvonly",Y.log("Setting video transceiver to recvonly:",c)}catch(T){Y.error(T)}else c=o.pc.addTransceiver("video",{direction:"recvonly"}),Y.log("Adding recvonly video transceiver:",c)}else if(t.removeVideo&&c)try{c.setDirection?c.setDirection("inactive"):c.direction="inactive",Y.log("Setting video transceiver to inactive:",c)}catch(T){Y.error(T)}}else a="firefox"==Y.webRTCAdapter.browserDetails.browser||"edge"==Y.webRTCAdapter.browserDetails.browser?{offerToReceiveAudio:ee(t),offerToReceiveVideo:ie(t)}:{mandatory:{OfferToReceiveAudio:ee(t),OfferToReceiveVideo:ie(t)}};Y.debug(a);var g=te(t);if(g&&r&&"firefox"===Y.webRTCAdapter.browserDetails.browser){Y.log("Enabling Simulcasting for Firefox (RID)");var v=o.pc.getSenders()[1];Y.log(v);var y=v.getParameters();Y.log(y);var S=C(n.simulcastMaxBitrates);v.setParameters({encodings:[{rid:"high",active:!0,priority:"high",maxBitrate:S.high},{rid:"medium",active:!0,priority:"medium",maxBitrate:S.medium},{rid:"low",active:!0,priority:"low",maxBitrate:S.low}]})}o.pc.createAnswer(a).then((function(e){Y.debug(e);var t={type:e.type,sdp:e.sdp};n.customizeSdp(t),e.sdp=t.sdp,Y.log("Setting local description"),g&&r&&("chrome"===Y.webRTCAdapter.browserDetails.browser?Y.warn("simulcast=true, but this is an answer, and video breaks in Chrome if we enable it"):"firefox"!==Y.webRTCAdapter.browserDetails.browser&&Y.warn("simulcast=true, but this is not Chrome nor Firefox, ignoring")),o.mySdp=e.sdp,o.pc.setLocalDescription(e)["catch"](n.error),o.mediaConstraints=a,o.iceDone||o.trickle?n.success(e):Y.log("Waiting for all candidates...")}),n.error)}function H(e,t){t=t||{},t.success="function"==typeof t.success?t.success:Y.noop,t.error="function"==typeof t.error?t.error:Y.noop;var n=b[e];if(null!==n&&void 0!==n&&null!==n.webrtcStuff&&void 0!==n.webrtcStuff){var i=n.webrtcStuff;Y.log("Sending offer/answer SDP..."),null!==i.mySdp&&void 0!==i.mySdp?(i.mySdp={type:i.pc.localDescription.type,sdp:i.pc.localDescription.sdp},!1===i.trickle&&(i.mySdp["trickle"]=!1),Y.debug(t),i.sdpSent=!0,t.success(i.mySdp)):Y.warn("Local SDP instance is invalid, not sending anything...")}else Y.warn("Invalid handle, not sending anything")}function W(e,t){var n=b[e];if(null===n||void 0===n||null===n.webrtcStuff||void 0===n.webrtcStuff)return Y.warn("Invalid handle"),0;var i=t?"remote":"local",o=n.webrtcStuff;return o.volume[i]||(o.volume[i]={value:0}),o.pc.getStats&&"chrome"===Y.webRTCAdapter.browserDetails.browser?!t||null!==o.remoteStream&&void 0!==o.remoteStream?t||null!==o.myStream&&void 0!==o.myStream?null===o.volume[i].timer||void 0===o.volume[i].timer?(Y.log("Starting "+i+" volume monitor"),o.volume[i].timer=setInterval((function(){o.pc.getStats((function(e){for(var n=e.result(),r=0;r-1)&&"inbound-rtp"===e.type&&e.id.indexOf("rtcp")<0?t=!0:"ssrc"!=e.type||!e.bytesReceived||"VP8"!==e.googCodecName&&""!==e.googCodecName||(t=!0),t)if(n.bitrate.bsnow=e.bytesReceived,n.bitrate.tsnow=e.timestamp,null===n.bitrate.bsbefore||null===n.bitrate.tsbefore)n.bitrate.bsbefore=n.bitrate.bsnow,n.bitrate.tsbefore=n.bitrate.tsnow;else{var i=n.bitrate.tsnow-n.bitrate.tsbefore;"safari"==Y.webRTCAdapter.browserDetails.browser&&(i/=1e3);var o=Math.round(8*(n.bitrate.bsnow-n.bitrate.bsbefore)/i);"safari"===Y.webRTCAdapter.browserDetails.browser&&(o=parseInt(o/1e3)),n.bitrate.value=o+" kbits/sec",n.bitrate.bsbefore=n.bitrate.bsnow,n.bitrate.tsbefore=n.bitrate.tsnow}}}))}))}),1e3),"0 kbits/sec"):n.bitrate.value:(Y.warn("Getting the video bitrate unsupported by browser"),"Feature unsupported by browser")}function J(e){Y.error("WebRTC error:",e)}function q(e,i){Y.log("Cleaning WebRTC stuff");var o=b[e];if(null!==o&&void 0!==o){var r=o.webrtcStuff;if(null!==r&&void 0!==r){if(!0===i){var a={rtcgw:"hangup",transaction:Y.randomString(12)};null!==o.token&&void 0!==o.token&&(a["token"]=o.token),null!==g&&void 0!==g&&(a["apisecret"]=g),Y.debug("Sending hangup request (handle="+e+"):"),Y.debug(a),t?(a["session_id"]=T,a["handle_id"]=e,n.send(JSON.stringify(a))):Y.httpAPICall(c+"/"+T+"/"+e,{verb:"POST",withCredentials:m,body:a})}r.remoteStream=null,r.volume&&(r.volume["local"]&&r.volume["local"].timer&&clearInterval(r.volume["local"].timer),r.volume["remote"]&&r.volume["remote"].timer&&clearInterval(r.volume["remote"].timer)),r.volume={},r.bitrate.timer&&clearInterval(r.bitrate.timer),r.bitrate.timer=null,r.bitrate.bsnow=null,r.bitrate.bsbefore=null,r.bitrate.tsnow=null,r.bitrate.tsbefore=null,r.bitrate.value=null;try{if(!r.streamExternal&&null!==r.myStream&&void 0!==r.myStream){Y.log("Stopping local stream tracks");var d=r.myStream.getTracks();for(var s in d){var l=d[s];Y.log(l),null!==l&&void 0!==l&&l.stop()}}}catch(u){}r.streamExternal=!1,r.myStream=null;try{r.pc.close()}catch(u){}r.pc=null,r.candidates=null,r.mySdp=null,r.remoteSdp=null,r.iceDone=!1,r.dataChannel={},r.dtmfSender=null}o.oncleanup()}}function X(e){for(var t=e.split("\r\n"),n=!1,i=[-1],o=[-1],r=null,a=null,d=null,c=null,s=-1,l=0;l-1){s=l;break}}else if(n){var m=t[l].match(/a=ssrc-group:FID (\d+) (\d+)/);if(m)i[0]=m[1],o[0]=m[2],t.splice(l,1),l--;else{if(i[0]){var h=t[l].match("a=ssrc:"+i[0]+" cname:(.+)");if(h&&(r=h[1]),h=t[l].match("a=ssrc:"+i[0]+" msid:(.+)"),h&&(a=h[1]),h=t[l].match("a=ssrc:"+i[0]+" mslabel:(.+)"),h&&(d=h[1]),h=t[l].match("a=ssrc:"+i[0]+" label:(.+)"),h&&(c=h[1]),0===t[l].indexOf("a=ssrc:"+o[0])){t.splice(l,1),l--;continue}if(0===t[l].indexOf("a=ssrc:"+i[0])){t.splice(l,1),l--;continue}}0!=t[l].length||(t.splice(l,1),l--)}}}if(i[0]<0){s=-1,n=!1;for(l=0;l-1){s=l;break}}else if(n){if(i[0]<0){var f=t[l].match(/a=ssrc:(\d+)/);if(f){i[0]=f[1],t.splice(l,1),l--;continue}}else{h=t[l].match("a=ssrc:"+i[0]+" cname:(.+)");if(h&&(r=h[1]),h=t[l].match("a=ssrc:"+i[0]+" msid:(.+)"),h&&(a=h[1]),h=t[l].match("a=ssrc:"+i[0]+" mslabel:(.+)"),h&&(d=h[1]),h=t[l].match("a=ssrc:"+i[0]+" label:(.+)"),h&&(c=h[1]),0===t[l].indexOf("a=ssrc:"+o[0])){t.splice(l,1),l--;continue}if(0===t[l].indexOf("a=ssrc:"+i[0])){t.splice(l,1),l--;continue}}0!=t[l].length||(t.splice(l,1),l--)}}}if(i[0]<0)return Y.warn("Couldn't find the video SSRC, simulcasting NOT enabled"),e;s<0&&(s=t.length),i[1]=Math.floor(4294967295*Math.random()),i[2]=Math.floor(4294967295*Math.random()),o[1]=Math.floor(4294967295*Math.random()),o[2]=Math.floor(4294967295*Math.random());for(l=0;l>",e)})),r}}},Y.useOldDependencies=function(e){var t=e&&e.jQuery||jQuery,n=e&&e.WebSocket||WebSocket;return{newWebSocket:function(e,t){return new n(e,t)},isArray:function(e){return t.isArray(e)},extension:e&&e.extension||X,webRTCAdapter:e&&e.adapter||adapter,httpAPICall:function(e,n){var i=void 0!==n.body?{contentType:"application/json",data:JSON.stringify(n.body)}:{},o=void 0!==n.withCredentials?{xhrFields:{withCredentials:n.withCredentials}}:{};return t.ajax(t.extend(i,o,{url:e,type:n.verb,cache:!1,dataType:"json",async:n.async,timeout:n.timeout,success:function(e){d(n.success)===d(Y.noop)&&n.success(e)},error:function(e,t,i){d(n.error)===d(Y.noop)&&n.error(t,i)}}))}}},Y.noop=function(){},Y.dataChanDefaultLabel="JanusDataChannel",Y.endOfCandidates=null,Y.init=function(e){if(e=e||{},e.callback="function"==typeof e.callback?e.callback:Y.noop,!0===Y.initDone)e.callback();else{if("undefined"!=typeof console&&"undefined"!=typeof console.log||(console={log:function(){}}),Y.trace=Y.noop,Y.debug=Y.noop,Y.vdebug=Y.noop,Y.log=Y.noop,Y.warn=Y.noop,Y.error=Y.noop,!0===e.debug||"all"===e.debug)Y.trace=console.trace.bind(console),Y.debug=console.debug.bind(console),Y.vdebug=console.debug.bind(console),Y.log=console.log.bind(console),Y.warn=console.warn.bind(console),Y.error=console.error.bind(console);else if(Array.isArray(e.debug))for(var t in e.debug){var n=e.debug[t];switch(n){case"trace":Y.trace=console.trace.bind(console);break;case"debug":Y.debug=console.debug.bind(console);break;case"vdebug":Y.vdebug=console.debug.bind(console);break;case"log":Y.log=console.log.bind(console);break;case"warn":Y.warn=console.warn.bind(console);break;case"error":Y.error=console.error.bind(console);break;default:console.error("Unknown debugging option '"+n+"' (supported: 'trace', 'debug', 'vdebug', 'log', warn', 'error')");break}}Y.log("Initializing library");var i=e.dependencies||Y.useDefaultDependencies();Y.isArray=i.isArray,Y.webRTCAdapter=i.webRTCAdapter,Y.httpAPICall=i.httpAPICall,Y.newWebSocket=i.newWebSocket,Y.extension=i.extension,Y.extension.init(),Y.listDevices=function(e,t){e="function"==typeof e?e:Y.noop,null==t&&(t={audio:!0,video:!0}),Y.isGetUserMediaAvailable()?navigator.mediaDevices.getUserMedia(t).then((function(t){navigator.mediaDevices.enumerateDevices().then((function(n){Y.debug(n),e(n);try{var i=t.getTracks();for(var o in i){var r=i[o];null!==r&&void 0!==r&&r.stop()}}catch(a){}}))}))["catch"]((function(t){Y.error(t),e([])})):(Y.warn("navigator.mediaDevices unavailable"),e([]))},Y.attachMediaStream=function(e,t){if("chrome"===Y.webRTCAdapter.browserDetails.browser){var n=Y.webRTCAdapter.browserDetails.version;n>=52?e.srcObject=t:"undefined"!==typeof e.src?e.src=URL.createObjectURL(t):Y.error("Error attaching stream to element")}else e.srcObject=t},Y.reattachMediaStream=function(e,t){if("chrome"===Y.webRTCAdapter.browserDetails.browser){var n=Y.webRTCAdapter.browserDetails.version;n>=52?e.srcObject=t.srcObject:"undefined"!==typeof e.src?e.src=t.src:Y.error("Error reattaching stream to element")}else e.srcObject=t.srcObject};var o=["iPad","iPhone","iPod"].indexOf(navigator.platform)>=0,r=o?"pagehide":"beforeunload",a=window["on"+r];if(window.addEventListener(r,(function(e){for(var t in Y.log("Closing window"),Y.sessions)null!==Y.sessions[t]&&void 0!==Y.sessions[t]&&Y.sessions[t].destroyOnUnload&&(Y.log("Destroying session "+t),Y.sessions[t].destroy({asyncRequest:!1,notifyDestroyed:!1}));a&&"function"==typeof a&&a()})),Y.safariVp8=!1,"safari"===Y.webRTCAdapter.browserDetails.browser&&Y.webRTCAdapter.browserDetails.version>=605)if(RTCRtpSender&&RTCRtpSender.getCapabilities&&RTCRtpSender.getCapabilities("video")&&RTCRtpSender.getCapabilities("video").codecs&&RTCRtpSender.getCapabilities("video").codecs.length){for(var t in RTCRtpSender.getCapabilities("video").codecs){var d=RTCRtpSender.getCapabilities("video").codecs[t];if(d&&d.mimeType&&"video/vp8"===d.mimeType.toLowerCase()){Y.safariVp8=!0;break}}Y.safariVp8?Y.log("This version of Safari supports VP8"):Y.warn("This version of Safari does NOT support VP8: if you're using a Technology Preview, try enabling the 'WebRTC VP8 codec' setting in the 'Experimental Features' Develop menu")}else{var c=new RTCPeerConnection({},{});c.createOffer({offerToReceiveVideo:!0}).then((function(e){Y.safariVp8=-1!==e.sdp.indexOf("VP8"),Y.safariVp8?Y.log("This version of Safari supports VP8"):Y.warn("This version of Safari does NOT support VP8: if you're using a Technology Preview, try enabling the 'WebRTC VP8 codec' setting in the 'Experimental Features' Develop menu"),c.close(),c=null}))}if(Y.unifiedPlan=!1,"firefox"===Y.webRTCAdapter.browserDetails.browser&&Y.webRTCAdapter.browserDetails.version>=59)Y.unifiedPlan=!0;else if("chrome"===Y.webRTCAdapter.browserDetails.browser&&Y.webRTCAdapter.browserDetails.version<72)Y.unifiedPlan=!1;else if("undefined"===typeof RTCRtpTransceiver||"currentDirection"in RTCRtpTransceiver.prototype){var s=new RTCPeerConnection;try{s.addTransceiver("audio"),Y.unifiedPlan=!0}catch(l){}s.close()}else Y.unifiedPlan=!1;Y.initDone=!0,e.callback()}},Y.isWebrtcSupported=function(){return void 0!==window.RTCPeerConnection&&null!==window.RTCPeerConnection},Y.isGetUserMediaAvailable=function(){return void 0!==navigator.mediaDevices&&null!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia&&null!==navigator.mediaDevices.getUserMedia},Y.randomString=function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n="",i=0;i\n
\n
\n
\n
\n
\n
\n ',document.getElementById("mobile-ez-ptz-item")||o.appendChild(d),v(o,document.getElementById("".concat(this.jSPlugin.id,"-wrap"))),document.getElementById("mobile-ez-ptz-item").ontouchstart=function(e){e.preventDefault(),console.log("触摸开始"),n._handlePtzTouch(e,"start")},document.getElementById("mobile-ez-ptz-item").ontouchend=function(e){e.preventDefault(),console.log("触摸结束",e),n._handlePtzTouch(e,"stop")},document.getElementById("mobile-ez-ptz-item").onmousedown=function(e){e.preventDefault(),console.log("触摸开始"),n._handlePtzTouch(e,"start")},document.getElementById("mobile-ez-ptz-item").onmouseup=function(e){e.preventDefault(),console.log("触摸结束",e),n._handlePtzTouch(e,"stop")}}return l(e,[{key:"show",value:function(){document.getElementById("mobile-ez-ptz-item").style="display: inline-block"}},{key:"hide",value:function(){document.getElementById("mobile-ez-ptz-item").style="display: none"}},{key:"_handlePtzTouch",value:function(e,t){var n=document.getElementById("mobile-ez-ptz-item").getBoundingClientRect(),i=n.left+130,o=n.top+130,r=e.x||e.changedTouches[0].clientX,a=e.y||e.changedTouches[0].clientY,d=r-i,c=a-o,s=0,l=this.jSPlugin.env.domain+"/api/lapp/device/ptz/start";Math.abs(d)>Math.abs(c)?d>0?(s=3,document.getElementsByClassName("mobile-ez-ptz-icon")[3].className=document.getElementsByClassName("mobile-ez-ptz-icon")[3].className.replace("default","active")):(s=2,document.getElementsByClassName("mobile-ez-ptz-icon")[1].className=document.getElementsByClassName("mobile-ez-ptz-icon")[1].className.replace("default","active")):c>0?(s=1,document.getElementsByClassName("mobile-ez-ptz-icon")[2].className=document.getElementsByClassName("mobile-ez-ptz-icon")[2].className.replace("default","active")):(s=0,document.getElementsByClassName("mobile-ez-ptz-icon")[0].className=document.getElementsByClassName("mobile-ez-ptz-icon")[0].className.replace("default","active")),document.getElementById("mobile-ez-ptz-item").style="background-image:linear-gradient(".concat(0===s?180:1===s?0:2===s?90:270,"deg, #c0ddf1 0%, rgba(100,143,252,0.00) 50%)"),"stop"===t&&(l=this.jSPlugin.env.domain+"/api/lapp/device/ptz/stop",document.getElementById("mobile-ez-ptz-item").style="",document.getElementsByClassName("mobile-ez-ptz-icon")[3].className=document.getElementsByClassName("mobile-ez-ptz-icon")[3].className.replace("active","default"),document.getElementsByClassName("mobile-ez-ptz-icon")[1].className=document.getElementsByClassName("mobile-ez-ptz-icon")[1].className.replace("active","default"),document.getElementsByClassName("mobile-ez-ptz-icon")[2].className=document.getElementsByClassName("mobile-ez-ptz-icon")[2].className.replace("active","default"),document.getElementsByClassName("mobile-ez-ptz-icon")[0].className=document.getElementsByClassName("mobile-ez-ptz-icon")[0].className.replace("active","default"));var u=new FormData;u.append("deviceSerial",P(this.jSPlugin.url).deviceSerial),u.append("channelNo",P(this.jSPlugin.url).channelNo),u.append("speed",1),u.append("direction",s),u.append("accessToken",this.jSPlugin.accessToken),fetch(l,{method:"POST",body:u}).then((function(e){return e.json()})).then((function(e){200==e.code||60005!=e.code&&60002!=e.code&&60003!=e.code&&60004!=e.code||(document.getElementById("mobile-ez-ptz-item").style="background-image:linear-gradient(".concat(0===s?180:1===s?0:2===s?90:270,"deg, #f45656 0%, rgba(100,143,252,0.00) 50%)"))}))["catch"]((function(e){console.log("云台调用异常",e)}))}}]),e}(),re=0,ae="成功",de={header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-0",iconId:"deviceID",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-1",iconId:"deviceName",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-2",iconId:"cloudRec",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-3",iconId:"rec",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"}]},footer:{color:"#FFFFFF",backgroundColor:"rgb(0 0 0 / 0%)",activeColor:"#1890FF",btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-0",iconId:"play",part:"left",defaultActive:1,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-1",iconId:"capturePicture",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-2",iconId:"sound",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-3",iconId:"pantile",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-4",iconId:"recordvideo",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-5",iconId:"talk",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-6",iconId:"hd",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-7",iconId:"webExpend",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-8",iconId:"expend",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"}]}},ce={retcode:re,msg:ae,data:de},se={header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"#00000080",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:0},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:1},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:0},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:1},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}},le={data:se},ue={header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:1},{iconId:"rec",part:"right",defaultActive:0,isrender:1}]},footer:{color:"#FFFFFF",backgroundColor:"#00000080",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:0},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:0},{iconId:"talk",part:"left",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"speed",part:"right",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}},pe={data:ue},me={header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-0",iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-1",iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-2",iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-3",iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"#00000080",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:1},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"speed",part:"right",defaultActive:0,isrender:0},{iconId:"hd",part:"right",defaultActive:0,isrender:1},{iconId:"webExpend",part:"right",defaultActive:0,isrender:1},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}},he={data:me},fe={header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-0",iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-1",iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-2",iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-3",iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"#00000080",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:1},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}},ge={data:fe},ve={header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:0},{iconId:"deviceName",part:"left",defaultActive:0,isrender:0},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:0},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:0},{iconId:"sound",part:"left",defaultActive:1,isrender:0},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:0},{iconId:"talk",part:"left",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:0},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:0}]}},ye={data:ve},Ce={header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"#00000080",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:0},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:0},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}},Se={data:Ce},Te={header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:1},{iconId:"rec",part:"right",defaultActive:0,isrender:1}]},footer:{color:"#FFFFFF",backgroundColor:"#00000080",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"speed",part:"right",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:1},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}},be={data:Te},we=[{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"pcLive",themeIntro:"PC直播全量版",themeName:"PC直播全量版",themeType:"webLive",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_DmANlElAAA-xyivSaw030.png",poster:"https://resource.eziot.com/group1/M00/00/89/CtwQEmLl8r-AZU7wAAETKlvgerU237.png",header:he.data.header,footer:he.data.footer},{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"security",themeIntro:"PC直播安防版",themeName:"PC直播安防版",themeType:"webLive",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_DmANlElAAA-xyivSaw030.png",poster:"https://resource.eziot.com/group1/M00/00/89/CtwQEmLl8r-AZU7wAAETKlvgerU237.png",header:ge.data.header,footer:ge.data.footer},{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"voice",themeIntro:"PC直播语音版",themeName:"PC直播语音版",themeType:"webLive",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_DmANlElAAA-xyivSaw030.png",poster:"https://resource.eziot.com/group1/M00/00/89/CtwQEmLl8r-AZU7wAAETKlvgerU237.png",header:Se.data.header,footer:Se.data.footer},{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"simple",themeIntro:"PC直播极简版",themeName:"PC直播极简版",themeType:"webLive",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_DmANlElAAA-xyivSaw030.png",poster:"",header:ye.data.header,footer:ye.data.footer},{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"pcRec",themeIntro:"PC回放全量版",themeName:"PC回放全量版",themeType:"webRec",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_DmANlElAAA-xyivSaw030.png",poster:"https://resource.eziot.com/group1/M00/00/89/CtwQEmLl8r-AZU7wAAETKlvgerU237.png",header:be.data.header,footer:be.data.footer},{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"mobileLive",themeIntro:"Mobile直播全量版",themeName:"Mobile直播全量版",themeType:"mobileLive",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_GmAL5IhAABZs1vUK0s564.png",poster:"https://resource.eziot.com/group1/M00/00/89/CtwQEmLl8r-AZU7wAAETKlvgerU237.png",header:le.data.header,footer:le.data.footer},{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"mobileRec",themeIntro:"Mobile回放全量版",themeName:"Mobile回放全量版",themeType:"mobileRec",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_GmAL5IhAABZs1vUK0s564.png",poster:"https://resource.eziot.com/group1/M00/00/89/CtwQEmLl8r-AZU7wAAETKlvgerU237.png",header:pe.data.header,footer:pe.data.footer}],Pe=function(){function e(t){var n=this;c(this,e),this.jSPlugin=t,this.enableZoom=!1,this.isMouseDown=!1,this.videoWidth=1920,this.videoHeight=1080,this.currentScale=1,this.currentPosition={x:0,y:0,xPercent:.1,yPercent:.1,xCurrentVideo:0,yCurrentVideo:0,left:0,top:0,right:1920,bottom:1080},this.DOM=document.getElementById(t.id),this.clientRect=document.getElementById(t.id).getBoundingClientRect();var i=document.createElement("div");i.id="".concat(t.id,"-zoom-container"),i.style="position: absolute;\n display:none;\n left: 12px;\n bottom: 80px;";var o='\n \n
2.0X
\n
\n \n \n 放大\n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n
\n
\n
\n
\n \n \n 缩小\n \n \n \n \n \n \n \n \n \n \n
\n \n ');i.innerHTML=o,document.getElementById("".concat(t.id,"-audioControls-left")).parentNode.appendChild(i),document.getElementById("".concat(t.id,"-addScale")).onclick=function(){n.addScale()},document.getElementById("".concat(t.id,"-subScale")).onclick=function(){n.subScale()}}return l(e,[{key:"onMouseDown",value:function(e){this.currentPosition,this.currentScale;var t=this.enableZoom;if(!t)return!1;this.moveX=e.clientX,this.moveY=e.clientY,this.isMouseDown=!0}},{key:"onMouseUp",value:function(e){var t=this.currentPosition,n=this.enableZoom;if(!n)return!1;this.isMouseDown=!1,t.left=t.left-(e.clientX-this.moveX),t.top=t.top-(e.clientY-this.moveY),this.doScale()}},{key:"onMouseOut",value:function(e){var t=this.enableZoom;if(!t)return!1;this.isMouseDown&&(console.log("鼠标按上",e),this.isMouseDown=!1),this.isMouseDown=!1}},{key:"renderDot",value:function(){var e=this.currentScale;document.getElementById("".concat(this.jSPlugin.id,"-scale-value")).innerHTML="".concat(e,".0X"),document.getElementById("".concat(this.jSPlugin.id,"-line-dot")).style.height="".concat((e-1)/7*100,"%"),document.getElementById("".concat(this.jSPlugin.id,"-scale-body-line-dot")).style.bottom="calc(".concat((e-1)/7*100,"% - 6px)")}},{key:"startZoom",value:function(){var e=this,t=this.jSPlugin.jSPlugin._JSPlayM4_GetFrameInfo(0);this.videoWidth=t.width,this.videoHeight=t.height,this.currentPosition.right=t.width,this.currentPosition.bottom=t.height,this.currentScale=1,document.getElementById("".concat(this.jSPlugin.id,"-zoom-container")).style.display="block",this.jSPlugin.jSPlugin._JSPlayM4_SetDisplayRegion(0,this.videoWidth,0,this.videoHeight),this.renderDot(),this.enableZoom=!0,document.getElementById("".concat(this.jSPlugin.id,"canvas_draw0"))?(document.getElementById("".concat(this.jSPlugin.id,"canvas_draw0")).addEventListener("mousedown",(function(t){return e.onMouseDown(t)})),document.getElementById("".concat(this.jSPlugin.id,"canvas_draw0")).addEventListener("mouseup",(function(t){return e.onMouseUp(t)})),document.getElementById("".concat(this.jSPlugin.id,"canvas_draw0")).addEventListener("mouseout",(function(t){return e.onMouseOut(t)}))):document.getElementById("".concat(this.jSPlugin.id,"-player"))&&(document.getElementById("".concat(this.jSPlugin.id,"-player")).addEventListener("mousedown",(function(t){return e.onMouseDown(t)})),document.getElementById("".concat(this.jSPlugin.id,"-player")).addEventListener("mouseup",(function(t){return e.onMouseUp(t)})),document.getElementById("".concat(this.jSPlugin.id,"-player")).addEventListener("mouseout",(function(t){return e.onMouseOut(t)})))}},{key:"stopZoom",value:function(){var e=this;this.currentScale=1,this.jSPlugin.jSPlugin._JSPlayM4_SetDisplayRegion(0,this.videoWidth,0,this.videoHeight),document.getElementById("".concat(this.jSPlugin.id,"-zoom-container")).style.display="none",this.renderDot(),this.enableZoom=!1,document.getElementById(this.jSPlugin.id).removeEventListener("mousedown",(function(t){return e.onMouseDown(t)})),document.getElementById(this.jSPlugin.id).removeEventListener("mouseup",(function(t){return e.onMouseUp(t)})),document.getElementById(this.jSPlugin.id).removeEventListener("mouseout",(function(t){return e.onMouseOut(t)}))}},{key:"doScale",value:function(){console.log("执行放大");var e=this.currentPosition,t=this.currentScale;e.left=e.left+e.xPercent*(e.right-e.left)-this.videoWidth/t*.5,e.left<0?e.left=0:e.left>this.videoWidth-this.videoWidth/t&&(e.left=this.videoWidth-this.videoWidth/t),e.right=e.left+this.videoWidth/t,e.top=e.top+e.yPercent*(e.bottom-e.top)-this.videoHeight/t*.5,e.top<0?e.top=0:e.top>this.videoHeight-this.videoHeight/t&&(e.top=this.videoHeight-this.videoHeight/t),e.bottom=e.top+this.videoHeight/t,e.left=parseInt(e.left,10),e.right=parseInt(e.right,10),e.top=parseInt(e.top,10),e.bottom=parseInt(e.bottom,10),console.log("计算后,",this.jSPlugin.jSPlugin,e.left,e.right,e.top,e.bottom,e.xPercent,e.yPercent),this.jSPlugin.jSPlugin._JSPlayM4_SetDisplayRegion(e.left,e.right,e.top,e.bottom),this.renderDot()}},{key:"calCurrentPosition",value:function(e){var t=this.currentPosition,n=this.clientRect;t.x=e.clientX,t.y=e.clientY,t.xPercent=(e.clientX-n.x)/n.width,t.yPercent=(e.clientY-n.y)/n.height,this.doScale()}},{key:"addScale",value:function(){var e=this.currentScale,t=this.currentPosition;if(e>=8)return console.log("达到最大倍率了"),this.jSPlugin.Message&&this.jSPlugin.Message["default"]("已经放大到最大倍数8.0X"),!1;this.currentScale++,t.xPercent=.5,t.yPercent=.5,this.doScale()}},{key:"subScale",value:function(){var e=this.currentScale,t=this.currentPosition;if(e<=1)return console.log("达到最小倍率了"),!1;this.currentScale--,t.xPercent=.5,t.yPercent=.5,this.doScale()}}]),e}();function ke(e,t){return Math.abs(t.clientX-e.clientX)*Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)*Math.abs(t.clientY-e.clientY)}var Ee=function(){function e(t){var n=this;c(this,e),this.jSPlugin=t,this.enableZoom=!1,this.isDubboTouch=!1,this.videoWidth=0,this.videoHeight=0,this.currentScale=1,this.currentPosition={x:0,y:0,xPercent:.1,yPercent:.1,xCurrentVideo:0,yCurrentVideo:0,left:0,top:0,right:1920,bottom:1080},this.DOM=document.getElementById(t.id),this.clientRect=document.getElementById(t.id).getBoundingClientRect(),this.point1={clientX:0,clientY:0},this.point2={clientX:0,clientY:0},this.touchLineLength=0,this.inited=!1;var i=document.createElement("div");i.id="".concat(t.id,"-zoom-container"),i.style="display:none;\n position: absolute;\n left: 10px;\n top: -30px;\n border: 1px solid rgba(0,0,0,0.6);\n color: #FFFFFF;\n background: rgba(0,0,0,0.6);\n border-radius: 10px;\n width: 36px;\n font-size: 12px;\n text-align: center;\n height: 22px;\n line-height: 22px;";var o="1X";i.innerHTML=o,document.getElementById("".concat(t.id,"-audioControls-left")).parentNode.appendChild(i),document.getElementById(this.jSPlugin.id).addEventListener("touchstart",(function(e){return n.onTouchstart(e)})),document.getElementById(this.jSPlugin.id).addEventListener("touchmove",(function(e){return n.onTouchmove(e)}))}return l(e,[{key:"onTouchstart",value:function(e){if(!this.inited){var t=this.jSPlugin.jSPlugin._JSPlayM4_GetFrameInfo(0);this.videoWidth=t.width,this.videoHeight=t.height,this.currentPosition.right=t.width,this.currentPosition.bottom=t.height,this.inited=!0}var n=this.currentPosition;this.currentScale,console.log("双指按下",n);var i=e.touches,o=i[0],r=i[1];o&&(this.point1.clientX=o.clientX,this.point1.clientY=o.clientY),r&&(this.point2.clientX=r.clientX,this.point2.clientY=r.clientY,this.touchLineLength=ke(this.point1,this.point2),this.isDubboTouch=!0,this.moveX=o.clientX,this.moveY=o.clientY),console.log("双指按下2",n)}},{key:"onTouchmove",value:function(e){var t=this.isDubboTouch,n=this.currentPosition,i=this.clientRect;if(1===e.touches.length){var o=e.touches[0];return n.xPercent=n.xPercent+(this.point1.clientX-o.clientX)/i.width/this.currentScale,n.yPercent=n.yPercent+(this.point1.clientY-o.clientY)/i.height/this.currentScale,this.doScale(),this.point1.clientX=o.clientX,this.point1.clientY=o.clientY,!1}if(!t)return!1;var r=e.touches,a=(o=r[0],r[1]);if(o&&(this.point1.clientX=o.clientX,this.point1.clientY=o.clientY),a){this.point2.clientX=a.clientX,this.point2.clientY=a.clientY;var d=ke(this.point1,this.point2);d!==this.touchLineLength&&(d>this.touchLineLength?this.currentScale<8?(++this.currentScale,n.xPercent=(this.point1.clientX+this.point2.clientX)/2/i.width,n.yPercent=(this.point1.clientY+this.point2.clientY)/2/i.height,this.doScale()):console.log("已经是最大8倍率了"):this.currentScale>1?(--this.currentScale,n.xPercent=(this.point1.clientX+this.point2.clientX)/2/i.width,n.yPercent=(this.point1.clientY+this.point2.clientY)/2/i.height,this.doScale()):console.log("已经是最小1倍率了"),this.isDubboTouch=!1)}}},{key:"startZoom",value:function(){var e=this.jSPlugin.jSPlugin._JSPlayM4_GetFrameInfo(0);this.videoWidth=e.width,this.videoHeight=e.height,this.currentPosition.right=e.width,this.currentPosition.bottom=e.height,this.currentScale=1,document.getElementById("".concat(this.jSPlugin.id,"-zoom-container")).style.display="block",this.jSPlugin.jSPlugin._JSPlayM4_SetDisplayRegion(0,this.videoWidth,0,this.videoHeight),this.renderDot()}},{key:"stopZoom",value:function(){this.currentScale=1,this.jSPlugin.jSPlugin._JSPlayM4_SetDisplayRegion(0,this.videoWidth,0,this.videoHeight),document.getElementById("".concat(this.jSPlugin.id,"-zoom-container")).style.display="none",this.renderDot()}},{key:"doScale",value:function(){var e=this.currentPosition,t=this.currentScale;e.left=e.left+e.xPercent*(e.right-e.left)-this.videoWidth/t*.5,e.left<0?e.left=0:e.left>this.videoWidth-this.videoWidth/t&&(e.left=this.videoWidth-this.videoWidth/t),e.right=e.left+this.videoWidth/t,e.top=e.top+e.yPercent*(e.bottom-e.top)-this.videoHeight/t*.5,e.top<0?e.top=0:e.top>this.videoHeight-this.videoHeight/t&&(e.top=this.videoHeight-this.videoHeight/t),e.bottom=e.top+this.videoHeight/t,e.left=parseInt(e.left,10),e.right=parseInt(e.right,10),e.top=parseInt(e.top,10),e.bottom=parseInt(e.bottom,10),console.log("视频宽高",this.videoWidth,this.videoHeight),console.log("计算后,",e.left,e.right,e.top,e.bottom,e.xPercent,e.yPercent),e.left0&&(this.autoFocus=parseInt(this.themeData.autoFocus),this.startAutoFocus(),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).addEventListener("click",(function(){e.stopAutoFocus()}))),this.setDecoderState({cloudRec:"cloud.rec"===P(this.jSPlugin.url).type,rec:"rec"===P(this.jSPlugin.url).type,type:P(this.jSPlugin.url).type});else if(!this.themeInited)var o=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(o),e.jSPlugin.play(),e.themeInited=!0)}),50);var r=R.findIndex(this.themeData.footer.btnList,(function(e){return"zoom"===e.iconId&&e.isrender>0}))>=0;r&&(this.isMobile?this.jSPlugin.Zoom=new Ee(this.jSPlugin):this.jSPlugin.Zoom=new Pe(this.jSPlugin));var a=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(a),e.jSPlugin.reSize(e.jSPlugin.params.width,e.jSPlugin.params.height))}),50)}},{key:"setDecoderState",value:function(e){var t=this,n=this.themeData,i=n.header,o=n.footer;Object.keys(e).map((function(n,r){var a="#FFFFFF",d="#FFFFFF",c=i.btnList.findIndex((function(e){return e.iconId===n}));switch(-1===c?(a=o.color.replace("-diy",""),d=o.activeColor.replace("-diy","")):(a=i.color.replace("-diy",""),d=o.activeColor.replace("-diy","")),n){case"play":e[n]?document.getElementById("".concat(t.jSPlugin.id,"-play"))&&(document.getElementById("".concat(t.jSPlugin.id,"-play-content")).children[0].children[0].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-play-content")).children[0].children[1].style="display:none",document.getElementById("".concat(t.jSPlugin.id,"-play")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-play-content")).childNodes[0].children[0].style.fill=e[n]?d:a):document.getElementById("".concat(t.jSPlugin.id,"-play"))&&(document.getElementById("".concat(t.jSPlugin.id,"-play-content")).children[0].children[1].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-play-content")).children[0].children[0].style="display:none",document.getElementById("".concat(t.jSPlugin.id,"-play")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-play-content")).childNodes[0].children[1].style.fill=e[n]?d:a);break;case"sound":document.getElementById("".concat(t.jSPlugin.id,"-sound"))&&(e[n]?(document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).children[0].children[1].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).children[0].children[0].style="display:none",document.getElementById("".concat(t.jSPlugin.id,"-sound")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).childNodes[0].children[1].style.fill=e[n]?d:a):(document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).children[0].children[0].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).children[0].children[1].style="display:none",document.getElementById("".concat(t.jSPlugin.id,"-sound")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).childNodes[0].children[0].style.fill=e[n]?d:a));break;case"recordvideo":document.getElementById("".concat(t.jSPlugin.id,"-recordvideo"))&&(document.getElementById("".concat(t.jSPlugin.id,"-recordvideo")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-recordvideo-content")).childNodes[0].style.fill=e[n]?d:a,e[n]?t.countTime("add",0):t.countTime("destroy",0));break;case"talk":document.getElementById("".concat(t.jSPlugin.id,"-talk"))&&(document.getElementById("".concat(t.jSPlugin.id,"-talk")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-talk-content")).childNodes[1].style.fill=e[n]?d:a);break;case"zoom":document.getElementById("".concat(t.jSPlugin.id,"-zoom"))&&(document.getElementById("".concat(t.jSPlugin.id,"-zoom")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-zoom-content")).childNodes[1].style.fill=e[n]?d:a);break;case"pantile":document.getElementById("".concat(t.jSPlugin.id,"-pantile"))&&(document.getElementById("".concat(t.jSPlugin.id,"-pantile")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-pantile-content")).childNodes[0].style.fill=e[n]?d:a);break;case"webExpend":e[n]?(document.getElementById("".concat(t.jSPlugin.id,"-webExpend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-webExpend-content")).children[0].children[1].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-webExpend-content")).children[0].children[0].style="display:none"),document.getElementById("".concat(t.jSPlugin.id,"-expend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-expend")).className="disabled")):(document.getElementById("".concat(t.jSPlugin.id,"-webExpend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-webExpend-content")).children[0].children[0].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-webExpend-content")).children[0].children[1].style="display:none"),document.getElementById("".concat(t.jSPlugin.id,"-expend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-expend")).className="")),document.getElementById("".concat(t.jSPlugin.id,"-webExpend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-webExpend")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-webExpend-content")).childNodes[0].childNodes[0].style.fill=e[n]?d:a,document.getElementById("".concat(t.jSPlugin.id,"-webExpend-content")).childNodes[0].childNodes[1].style.fill=e[n]?d:a);break;case"capturePicture":document.getElementById("".concat(t.jSPlugin.id,"-capturePicture"))&&(document.getElementById("".concat(t.jSPlugin.id,"-capturePicture")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-capturePicture-content")).childNodes[0].style.fill=e[n]?d:a);break;case"expend":e[n]?(document.getElementById("".concat(t.jSPlugin.id,"-expend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-expend-content")).children[0].children[1].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-expend-content")).children[0].children[0].style="display:none"),document.getElementById("".concat(t.jSPlugin.id,"-webExpend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-webExpend")).className="disabled")):(document.getElementById("".concat(t.jSPlugin.id,"-expend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-expend-content")).children[0].children[0].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-expend-content")).children[0].children[1].style="display:none"),document.getElementById("".concat(t.jSPlugin.id,"-webExpend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-webExpend")).className="")),document.getElementById("".concat(t.jSPlugin.id,"-expend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-expend")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-expend-content")).childNodes[0].childNodes[0].style.fill=e[n]?d:a,document.getElementById("".concat(t.jSPlugin.id,"-expend-content")).childNodes[0].childNodes[1].style.fill=e[n]?d:a);break;case"hd":e[n]?document.getElementById("".concat(t.jSPlugin.id,"-hd"))&&(document.getElementById("".concat(t.jSPlugin.id,"-hd-content")).children[1].children[0].style="display:block",document.getElementById("".concat(t.jSPlugin.id,"-hd-content")).children[1].children[1].style="display:none"):document.getElementById("".concat(t.jSPlugin.id,"-hd"))&&(document.getElementById("".concat(t.jSPlugin.id,"-hd-content")).children[1].children[1].style="display:block",document.getElementById("".concat(t.jSPlugin.id,"-hd-content")).children[1].children[0].style="display:none");break;case"speed":document.getElementById("".concat(t.jSPlugin.id,"-speed"))&&(document.getElementById("".concat(t.jSPlugin.id,"-speed-content")).children[1].children[0].style.color=e[n]?d:a,document.getElementById("".concat(t.jSPlugin.id,"-speed-content")).children[1].children[0].style.borderColor=e[n]?d:a),t.isMobile&&e[n]?document.getElementById("".concat(t.jSPlugin.id,"-select-mask")).style.display="block":document.getElementById("".concat(t.jSPlugin.id,"-select-mask")).style.display="none";break;case"cloudRec":document.getElementById("".concat(t.jSPlugin.id,"-cloudRec"))&&(console.log("document.getElementById(`${this.jSPlugin.id}-cloudRec-content`)",document.getElementById("".concat(t.jSPlugin.id,"-cloudRec"))),document.getElementById("".concat(t.jSPlugin.id,"-cloudRec")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-cloudRec-content")).children[0].children[0].style.fill=e[n]?d:a),document.getElementById("".concat(t.jSPlugin.id,"-rec"))&&(document.getElementById("".concat(t.jSPlugin.id,"-rec")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-rec-content")).children[0].children[0].style.fill=e[n]?a:d);break;case"rec":document.getElementById("".concat(t.jSPlugin.id,"-cloudRec"))&&(document.getElementById("".concat(t.jSPlugin.id,"-cloudRec")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-cloudRec-content")).children[0].children[0].style.fill=e[n]?a:d),document.getElementById("".concat(t.jSPlugin.id,"-rec"))&&(document.getElementById("".concat(t.jSPlugin.id,"-rec")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-rec-content")).children[0].children[0].style.fill=e[n]?d:a);break}t.decoderState.state=Object.assign(t.decoderState.state,e)}))}},{key:"startAutoFocus",value:function(){var e=this,t=this.autoFocus;this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.autoFocusTimer=setTimeout((function(){document.getElementById("".concat(e.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(e.jSPlugin.id,"-audioControls")).style.opacity=0,document.getElementById("".concat(e.jSPlugin.id,"-audioControls")).style.pointerEvents="none")}),1e3*t)}},{key:"stopAutoFocus",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.opacity=1,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.pointerEvents="all"),this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.startAutoFocus()}},{key:"toString",value:function(){return"".concat(this.coreX,"-").concat(this.coreY)}},{key:"renderFooter",value:function(e,t){var n=this,i=this.matchBtn(e);if(this.isMobile&&"zoom"===i.id)return!1;var o=document.createElement("div");o.className="theme-icon-item",o.innerHTML="".concat('')+'
')).concat(i.domString,"
")+"
",o.onclick=function(e){if(n.decoderState.state.isEditing)return!1;i.onclick(e)},i.onmouseenter&&(o.onmouseenter=function(e){if(n.decoderState.state.isEditing)return!1;i.onmouseenter(e)}),i.onmouseleave&&(o.onmouseleave=function(e){if(n.decoderState.state.isEditing)return!1;i.onmouseleave(e)});var r=document.createElement("span");r.className="icon-move left",r.innerHTML=''),r.onclick=function(){n.editIcon(i.id,"left","footer")},o.appendChild(r);var a=document.createElement("span");a.className="icon-move right",a.innerHTML=''),a.onclick=function(){n.editIcon(i.id,"right","footer")},o.appendChild(a);var d=document.createElement("span");d.className="icon-move close",d.innerHTML='')+'',d.onclick=function(){n.editIcon(i.id,"delete","footer")},o.appendChild(d),"left"===t?document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).childNodes[0].appendChild(o):document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).childNodes[1].appendChild(o)}},{key:"editIcon",value:function(e,t,n){console.log("编辑组件",e,t,n);var i=this.themeData;console.log("themeData",this.themeData);var o=this.themeData[n].btnList,r=R.findIndex(o,(function(t){return t.iconId===e})),a=o[r];switch(t){case"delete":if("rec"===e){if(-1===R.findIndex(o,(function(e){return"cloudRec"===e.iconId&&1==e.isrender})))return this.jSPlugin.Message&&this.jSPlugin.Message["default"]("必须选中一种存储介质"),!1}else if("cloudRec"===e&&-1===R.findIndex(o,(function(e){return"rec"===e.iconId&&1==e.isrender})))return this.jSPlugin.Message&&this.jSPlugin.Message["default"]("必须选中一种存储介质"),!1;o[r].isrender=0;break;case"right":for(var d=-1,c=r+1;c=0;l--)if(o[l].part===o[r].part&&1==o[l].isrender){s=l;break}-1!==s&&(o[r]=o[s],o[s]=a);break}console.log("new btnList",o),i[n].btnList=o,this.changeTheme(i)}},{key:"renderHeader",value:function(e,t){var n=this,i=this.matchBtn(e),o=document.createElement("div");o.className="theme-icon-item",o.style="max-width:50%;",o.innerHTML="".concat('')+'')).concat(i.domString,"")+'',o.onclick=function(e){if(n.decoderState.state.isEditing)return!1;i.onclick(e)};var r=document.createElement("span");r.className="icon-move close",r.innerHTML='')+'',r.onclick=function(){n.editIcon(i.id,"delete","header")},o.appendChild(r),"left"===t?document.getElementById("".concat(this.jSPlugin.id,"-headControl")).childNodes[0].appendChild(o):document.getElementById("".concat(this.jSPlugin.id,"-headControl")).childNodes[1].appendChild(o)}},{key:"countTime",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this;if(!document.getElementById(this.jSPlugin.id+"time-area")){var i=document.createElement("div");i.id=this.jSPlugin.id+"time-area",i.className="time-area",i.innerHTML='00:00',document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).appendChild(i)}if(this.countTimer&&clearInterval(this.countTimer),"add"===e){var o=t;document.getElementById(n.jSPlugin.id+"time-area").style.display="flex",this.countTimer=setInterval((function(){++o,document.getElementById(n.jSPlugin.id+"time-area").children[1].innerHTML=r(o)}),1e3)}else"destroy"===e&&(this.countTimer&&clearInterval(this.countTimer),this.countTimer=void 0,document.getElementById(n.jSPlugin.id+"time-area")&&(document.getElementById(n.jSPlugin.id+"time-area").children[1].innerHTML="00:00",document.getElementById(n.jSPlugin.id+"time-area").style.display="none"));function r(e){var t=parseInt(e),n=0,i=0,o="00",r="00",a="00";return t>59&&(n=parseInt(t/60),t=parseInt(t%60),n>59&&(i=parseInt(n/60),n=parseInt(n%60))),o=parseInt(t)>9?parseInt(t):"0"+parseInt(t),r=parseInt(n)>9?parseInt(n):"0"+parseInt(n),a=parseInt(i)>9?parseInt(i):"0"+parseInt(i),i>0?a+":"+r+":"+o:n>0?r+":"+o:"00:"+o}}},{key:"matchBtn",value:function(e){var t=this,n=this.themeData,i=n.header,o=n.footer,r={title:"",id:"",domString:"",color:"#FFFFFF",activeColor:"#FFFFFF",onclick:function(){},onmoveleft:function(){},onmoveright:function(){},onremove:function(){}},a=i.btnList.findIndex((function(t){return t.iconId===e}));switch(-1===a?(r.color=o.color,r.backgroundColor=o.backgroundColor,r.activeColor=o.activeColor):(r.color=i.color,r.backgroundColor=i.backgroundColor,r.activeColor=i.activeColor),e){case"play":return r.title="播放/结束播放",r.id=e,r.domString='
'+'')+'')+'
',r.onclick=function(){var e=t.decoderState.state,n=e.play,i=e.isEditing;if(i)return!1;n?t.jSPlugin.stop():t.jSPlugin.play(),t.setDecoderState({play:!n})},r;case"sound":return r.title="声音",r.id=e,r.domString=''+'')+'\n \n \n \n \n ')+"",r.onclick=function(){var e=t.decoderState.state,n=e.play,i=e.sound;n&&(i?(t.jSPlugin.closeSound(),t.setDecoderState({sound:!1})):(t.jSPlugin.openSound(),t.setDecoderState({sound:!0})))},r;case"recordvideo":return r.title="录屏",r.id=e,r.domString='')+'',r.onclick=function(){var e=t.decoderState.state,n=e.play,i=e.recordvideo;n&&(i?(t.jSPlugin.stopSave(),t.setDecoderState({recordvideo:!1})):(t.jSPlugin.startSave("".concat((new Date).getTime())),t.setDecoderState({recordvideo:!0})))},r;case"capturePicture":return r.title="截图",r.id=e,r.domString='')+'',r.onclick=function(){var e=t.decoderState.state.play;e?t.jSPlugin.capturePicture("".concat((new Date).getTime())):console.log("视频未播放,无法截图")},r;case"talk":return r.title="对讲",r.id=e,r.domString="
"+'')+'',r.onclick=function(){var e=t.decoderState.state,n=e.talk,i=e.sound;if(n){console.log("结束对讲"),t.setDecoderState({talk:!1}),t.jSPlugin.Talk.stopTalk();var o=R.findIndex(t.themeData.footer.btnList,(function(e){return"sound"===e.iconId&&1===e.isrender&&1===e.defaultActive}))>-1;t.themeData&&o&&(t.jSPlugin.openSound(),t.setDecoderState({sound:!0}))}else console.log("开始对讲"),t.setDecoderState({talk:!0}),i&&(t.jSPlugin.closeSound(),t.setDecoderState({sound:!1})),t.jSPlugin.Talk.startTalk()},r;case"zoom":return r.title="电子放大",r.id=e,r.domString="
"+'\n \n \n \n \n '),r.onclick=function(){var e=t.decoderState.state,n=e.zoom,i=e.play;if(!i)return!1;n?(console.log("结束电子放大"),t.setDecoderState({zoom:!1}),t.jSPlugin.Zoom.stopZoom()):(console.log("开始电子放大"),t.jSPlugin.Zoom.startZoom(),t.setDecoderState({zoom:!0}))},r;case"pantile":return r.title="云台控制",r.id=e,r.domString='')+'',r.onclick=function(){var e=t.decoderState.state,n=e.pantile,i=e.expend;if(n)console.log("隐藏云台"),t.Ptz.hide(),t.setDecoderState({pantile:!1});else{if(console.log("显示云台"),t.isMobile&&!i)return console.log("移动端,非全屏状态不展示云台"),!1;t.Ptz.show(),t.setDecoderState({pantile:!0})}},r;case"expend":return r.title="全局全屏",r.id=e,r.domString='')+''+'\n '),r.onclick=function(){var e=t.decoderState.state,n=e.webExpend,i=e.expend,o=e.play,r=e.pantile;if(!o)return!1;if(n)return console.log("正在网站全屏"),!1;if(i)if(t.isMobile){d=parseInt(getComputedStyle(document.getElementById("".concat(t.jSPlugin.id,"-wrap"))).height,10)-parseInt(getComputedStyle(document.getElementById(t.jSPlugin.id)).height,10);document.getElementById("".concat(t.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(t.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop="-32px"),document.getElementById("".concat(t.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(t.jSPlugin.id,"-headControl")).style.position="relative"),T(document.getElementById("".concat(t.jSPlugin.id,"-wrap")),t.jSPlugin.width,t.jSPlugin.height+d),t.jSPlugin.jSPlugin.JS_Resize(t.jSPlugin.width,t.jSPlugin.height),r&&(t.Ptz.hide(),t.setDecoderState({pantile:!1}))}else{console.log("取消全局全屏");var a=w();a.then((function(e){console.log("取消全屏",e,t.jSPlugin),t.jSPlugin.jSPlugin.JS_Resize(t.jSPlugin.width,t.jSPlugin.height)}))}else if(console.log("执行全局全屏"),t.isMobile){var d=parseInt(getComputedStyle(document.getElementById("".concat(t.jSPlugin.id,"-wrap"))).height,10)-parseInt(getComputedStyle(document.getElementById(t.jSPlugin.id)).height,10);C(document.getElementById("".concat(t.jSPlugin.id,"-wrap"))),setTimeout((function(){var e=document.documentElement.clientWidth,n=document.documentElement.clientHeight;document.getElementById("".concat(t.jSPlugin.id)).style["backface-visibility"]="hidden",t.jSPlugin.jSPlugin.JS_Resize(n,e-d)}),100)}else{var c=window.screen.width,s=window.screen.height,l=S(document.getElementById("".concat(t.jSPlugin.id)));l.then((function(e){t.jSPlugin.jSPlugin.JS_Resize(c,s)}))["catch"]((function(e){console.log(e)}))}t.setDecoderState({expend:!i})},r;case"webExpend":return r.title="网页全屏",r.id=e,r.domString='')+''+'",r.onclick=function(){var e=t.decoderState.state,n=e.webExpend,i=e.expend,o=e.play;if(!o)return!1;if(i)return console.log("正在全局全屏"),!1;if(n){console.log("取消网页全屏");var r=w();r.then((function(e){t.jSPlugin.jSPlugin.JS_Resize(t.jSPlugin.width,t.jSPlugin.height),t.jSPlugin.Theme.Rec&&t.jSPlugin.Theme.Rec.recAutoSize()}))}else{console.log("执行网页全屏");var a=0,d=0,c=window.screen.width,s=window.screen.height,l=S(document.getElementById("".concat(t.jSPlugin.id,"-wrap")));l.then((function(e){document.getElementById("".concat(t.jSPlugin.id,"-canvas-container"))&&(a=parseInt(window.getComputedStyle(document.getElementById("".concat(t.jSPlugin.id,"-canvas-container"))).height,10)),document.getElementById("".concat(t.jSPlugin.id,"-headControl"))&&(d=parseInt(window.getComputedStyle(document.getElementById("".concat(t.jSPlugin.id,"-headControl"))).height,10)),t.jSPlugin.jSPlugin.JS_Resize(c,s-a-d),t.jSPlugin.Theme.Rec&&t.jSPlugin.Theme.Rec.recAutoSize()}))["catch"]((function(e){console.log(e)}))}t.setDecoderState({webExpend:!n})},r;case"hd":return r.title="画面清晰度",r.id=e,r.domString='"+'')+''+'\n ')+'')+"",r.onclick=function(e){var n=t.decoderState.state,i=n.hd,o=n.expend;i&&e.target.id==="".concat(t.jSPlugin.id,"-select-sd")?(console.log("切换到标清"),t.jSPlugin.changeVideoLevel(0),t.setDecoderState({hd:!1})):i||e.target.id!=="".concat(t.jSPlugin.id,"-select-hd")||(t.jSPlugin.changeVideoLevel(1),t.setDecoderState({hd:!0})),t.showHD=!t.showHD,document.getElementById("".concat(t.jSPlugin.id,"-hdSelect"))&&(document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).style.display="none"===document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).style.display?"block":"none",t.isMobile&&(document.getElementById("".concat(t.jSPlugin.id,"-select-hd-mask")).style.display="none"===document.getElementById("".concat(t.jSPlugin.id,"-select-hd-mask")).style.display?"block":"none")),t.isMobile&&o&&t.showHD?document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).className="hd speed-select mobile expend":document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).className=t.isMobile?"hd speed-select mobile":"speed-select"},r;case"speed":return r.title="回放倍速",r.id=e,r.domString='"+'\n
').concat(1===this.nextRate?"倍速":"".concat(this.nextRate,"倍").replace("3","0.5"),"
\n ")+'')+"
",this.isMobile||(r.onmouseenter=function(e){console.log("鼠标移入",e),t.setDecoderState({speed:!0}),document.getElementById("".concat(t.jSPlugin.id,"-speedSelect"))&&(document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.display="block")},r.onmouseleave=function(e){console.log("鼠标移出",e),t.setDecoderState({speed:!1}),document.getElementById("".concat(t.jSPlugin.id,"-speedSelect"))&&(document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.display="none")}),r.onclick=function(e){var n=t.decoderState.state,i=n.speed,o=n.expend;if(!i&&t.isMobile&&(document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).className=o?"speed speed-select mobile expend":"speed speed-select mobile"),t.nextRate=1,e.target.id)switch(e.target.id){case"".concat(t.jSPlugin.id,"-select-speed1"):console.log("倍速1"),t.nextRate=1,t.jSPlugin.jSPlugin.JS_Speed(t.nextRate),t.changeRecSpeed(1),t.setDecoderState({speed:!i});break;case"".concat(t.jSPlugin.id,"-select-speed2"):console.log("倍速2"),t.nextRate=2,t.jSPlugin.jSPlugin.JS_Speed(t.nextRate),t.changeRecSpeed(2),t.setDecoderState({speed:!i});break;case"".concat(t.jSPlugin.id,"-select-speed4"):console.log("倍速4"),t.nextRate=4,t.jSPlugin.jSPlugin.JS_Speed(t.nextRate),t.changeRecSpeed(4),t.setDecoderState({speed:!i});break;case"".concat(t.jSPlugin.id,"-select-speed05"):console.log("倍速05"),t.nextRate=3,t.jSPlugin.jSPlugin.JS_Speed(t.nextRate),t.changeRecSpeed(.5),t.setDecoderState({speed:!i});break;default:t.isMobile?t.setDecoderState({speed:!i}):t.setDecoderState({speed:!0});break}t.isMobile||e.target.id!=="".concat(t.jSPlugin.id,"-speed-text")?document.getElementById("".concat(t.jSPlugin.id,"-speedSelect"))&&(document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.display="none"===document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.display?"block":"none"):document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.display="block"},r;case"deviceName":return r.title="设备名称",r.id=e,r.domString="设备名称",r.onclick=function(){},r;case"deviceID":return r.title="设备序列号",r.id=e,r.domString="设备序列号",r.onclick=function(){},r;case"cloudRec":return r.title="云存储回放",r.id=e,r.domString='\n \n \n\t\n\t\n\t\n \n \n '),r.onclick=function(){console.log("点击云回放"),t.setDecoderState({type:"cloud.rec",cloudRec:!0,rec:!1}),t.jSPlugin.changePlayUrl({type:"cloud.rec"}),console.log(t.jSPlugin);var e=g("begin",t.jSPlugin.url)||(new Date).Format("yyyyMMdd");t.Rec.renderRec("".concat(e.slice(0,4),"-").concat(e.slice(4,6),"-").concat(e.slice(6,8)))},r;case"rec":return r.title="本地存储",r.id=e,r.domString='\n \n \n \n\n\n\n \n \n '),r.onclick=function(){console.log("点击本地回放"),t.setDecoderState({type:"rec",cloudRec:!1,rec:!0}),t.jSPlugin.changePlayUrl({type:"rec"}),console.log(t.jSPlugin);var e=g("begin",t.jSPlugin.url)||(new Date).Format("yyyyMMdd");t.Rec.renderRec("".concat(e.slice(0,4),"-").concat(e.slice(4,6),"-").concat(e.slice(6,8)))},r;default:return r}}},{key:"changeRecSpeed",value:function(e){var t=this,n=function(e){if(console.log("setLiActive",e),!document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")))return!1;document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[0].className=document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[0].className.replace("active","default"),document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[1].className=document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[1].className.replace("active","default"),document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[2].className=document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[2].className.replace("active","default"),document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[3].className=document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[3].className.replace("active","default"),document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[e].className=document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[e].className.replace("default","active")},i="1";switch(e){case 1:n(2),i="倍速";break;case 2:n(1),i="".concat(e,"倍");break;case 4:n(0),i="".concat(e,"倍");break;case.5:n(3),i="".concat(e,"倍");break;default:n(2),i="".concat(e,"倍");break}document.getElementById("".concat(this.jSPlugin.id,"-speed-text"))&&(document.getElementById("".concat(this.jSPlugin.id,"-speed-text")).innerHTML=i)}},{key:"initThemeData",value:function(){var e=this,t=this.themeData,n=t.header,i=t.footer,o=this.jSPlugin.id;if(this.header=V.header,this.footer=V.footer,this.isNeedRenderHeader=R.findIndex(n.btnList,(function(e){return e.isrender>0}))>=0,this.isMobile&&(this.isNeedRenderHeader=R.findIndex(n.btnList,(function(e){return e.isrender>0&&"deviceID"===e.iconId||e.isrender>0&&"deviceName"===e.iconId}))>=0),this.isNeedRenderFooter=R.findIndex(i.btnList,(function(e){return e.isrender>0}))>=0,this.isNeedRenderTimeLine=R.findIndex(n.btnList,(function(e){return"cloudRec"===e.iconId&&1===e.isrender||"rec"===e.iconId&&1===e.isrender}))>=0&&!this.jSPlugin.disabledTimeLine,["date-switch-container-wrap","rec-type-container-wrap","mobile-rec-wrap","mobile-ez-ptz-container"].forEach((function(e,t){document.getElementById(e)&&document.getElementById(e).parentElement.removeChild(document.getElementById(e))})),this.isNeedRenderHeader)if(document.getElementById("".concat(this.jSPlugin.id,"-headControl")))document.getElementById("".concat(this.jSPlugin.id,"-headControl")).innerHTML="
");else{var r=document.createElement("div");r.setAttribute("id","".concat(this.jSPlugin.id,"-headControl")),r.setAttribute("class","header-controls"),r.innerHTML="
");var a={height:this.jSPlugin.width>xe?"48px":"32px","line-height":this.jSPlugin.width>xe?"48px":"32px",display:"flex","justify-content":"space-between",top:0,"z-index":1,background:"#000000",color:"#FFFFFF",width:"100%"};r.style=Ie(a),document.getElementById("".concat(o,"-wrap")).insertBefore(r,document.getElementById(o));var d=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(d)}),50)}else document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&document.getElementById("".concat(this.jSPlugin.id,"-headControl")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-headControl")));if(this.isNeedRenderFooter)if(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")))document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop="-".concat(this.jSPlugin.width>xe?48:32,"px"),document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).innerHTML='"));else{var c=document.createElement("div");c.setAttribute("id","".concat(this.jSPlugin.id,"-ez-iframe-footer-container")),c.setAttribute("class","ez-iframe-footer-container");var s={"min-height":this.jSPlugin.width>xe?"48px":"32px","max-height":this.jSPlugin.width>xe?"96px":"80px",position:"relative","margin-top":this.jSPlugin.width>xe?"-48px":"-32px",display:"flex","flex-wrap":"wrap","justify-content":"space-between","z-index":999,top:0,color:"#FFFFFF",width:"100%"};c.style=Ie(s),c.innerHTML='"),v(c,document.getElementById(o))}else document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")));if(this.isNeedRenderHeader&&document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.background=n.backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=n.color,n.btnList.map((function(t,n){t.isrender&&e.renderHeader(t.iconId,t.part)}))),this.isNeedRenderFooter&&document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=i.backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=i.color,i.btnList.map((function(t,n){t.isrender&&e.renderFooter(t.iconId,t.part)}))),this.isNeedRenderTimeLine)if(this.isMobile)document.getElementById("".concat(this.jSPlugin.id,"-headControl-right"))&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl-right")).style.display="none"),this.Rec=new J(this.jSPlugin);else{this.Rec?(this.Rec.unSyncTimeLine(),this.Rec.recInit()):this.Rec=new W(this.jSPlugin);var l=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(l)}),50)}var u=R.findIndex(this.themeData.footer.btnList,(function(e){return"pantile"===e.iconId&&1===e.isrender}))>=0&&!this.jSPlugin.disabledPTZ;u&&(this.isMobile&&(this.MobilePtz=new oe(this.jSPlugin)),this.Ptz=new q(this.jSPlugin));var p=function(){var t=e.decoderState.state,n=t.expend,i=t.webExpend,o=document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen;o||(e.jSPlugin.jSPlugin.JS_Resize(e.jSPlugin.width,e.jSPlugin.height),n&&e.setDecoderState({expend:!1}),i&&e.setDecoderState({webExpend:!1})),e.jSPlugin.Theme.Rec&&e.jSPlugin.Theme.Rec.recAutoSize()};if(["fullscreenchange","webkitfullscreenchange","mozfullscreenchange"].forEach((function(e){window.addEventListener(e,(function(e){return p()}))})),this.themeData.poster){this.jSPlugin.poster=this.themeData.poster;var m=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(m),e.jSPlugin.setPoster(e.themeData.poster))}),50)}this.inited=!0,this.getDeviceInfo()}},{key:"getDeviceInfo",value:function(){var e=this,t=function(t){200==t.code&&t.data&&(document.getElementById("".concat(e.jSPlugin.id,"-deviceName-content"))&&(document.getElementById("".concat(e.jSPlugin.id,"-deviceName-content")).style.maxWidth="100%",document.getElementById("".concat(e.jSPlugin.id,"-deviceName-content")).style.overflow="hidden",document.getElementById("".concat(e.jSPlugin.id,"-deviceName-content")).style.textOverflow="ellipsis",document.getElementById("".concat(e.jSPlugin.id,"-deviceName-content")).style.whiteSpace="nowrap",document.getElementById("".concat(e.jSPlugin.id,"-deviceName-content")).innerHTML=t.data.deviceName),document.getElementById("".concat(e.jSPlugin.id,"-deviceID-content"))&&(document.getElementById("".concat(e.jSPlugin.id,"-deviceID-content")).style.maxWidth="100%",document.getElementById("".concat(e.jSPlugin.id,"-deviceID-content")).style.overflow="hidden",document.getElementById("".concat(e.jSPlugin.id,"-deviceID-content")).style.textOverflow="ellipsis",document.getElementById("".concat(e.jSPlugin.id,"-deviceID-content")).style.whiteSpace="nowrap",document.getElementById("".concat(e.jSPlugin.id,"-deviceID-content")).innerHTML=P(e.jSPlugin.url).deviceSerial))};E(this.jSPlugin.env.domain+"/api/lapp/device/info","POST",{accessToken:this.jSPlugin.accessToken,deviceSerial:P(this.jSPlugin.url).deviceSerial},"",t)}},{key:"editStart",value:function(e){var t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),n=document.getElementById("".concat(this.jSPlugin.id,"-headControl"));n&&n.setAttribute("class","header-controls themeEditing"),t&&t.setAttribute("class","footer-controls themeEditing"),this.setDecoderState({isEditing:!0})}},{key:"editEnd",value:function(e){var t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),n=document.getElementById("".concat(this.jSPlugin.id,"-headControl"));n&&n.setAttribute("class","header-controls"),t&&t.setAttribute("class","footer-controls"),this.setDecoderState({isEditing:!1})}},{key:"webExpend",value:function(){var e=this,t=this.decoderState.state;t.webExpend;var n=t.expend,i=t.play;if(!i)return!1;if(n)return console.log("正在全局全屏"),!1;console.log("执行网页全屏");var o=0,r=0,a=S(document.getElementById("".concat(this.jSPlugin.id,"-wrap")));a.then((function(t){console.log("全屏promise",window.screen.width),document.getElementById("".concat(e.jSPlugin.id,"-canvas-container"))&&(o=parseInt(window.getComputedStyle(document.getElementById("".concat(e.jSPlugin.id,"-canvas-container"))).height,10)),document.getElementById("".concat(e.jSPlugin.id,"-headControl"))&&(r=parseInt(window.getComputedStyle(document.getElementById("".concat(e.jSPlugin.id,"-headControl"))).height,10)),console.log("this.jSPlugin.JS_Resiz",o,r,document.body.clientWidth),e.jSPlugin.jSPlugin.JS_Resize(window.screen.width,window.screen.height-o-r)}))["catch"]((function(e){console.log(e)}))}},{key:"expend",value:function(){var e=this,t=this.decoderState.state,n=t.webExpend;t.expend;var i=t.play;if(t.pantile,!i)return!1;if(n)return console.log("正在网站全屏"),!1;if(console.log("执行全局全屏"),this.isMobile){var o=parseInt(getComputedStyle(document.getElementById("".concat(this.jSPlugin.id,"-wrap"))).height,10)-parseInt(getComputedStyle(document.getElementById(this.jSPlugin.id)).height,10);C(document.getElementById("".concat(this.jSPlugin.id,"-wrap"))),setTimeout((function(){var t=document.documentElement.clientWidth,n=document.documentElement.clientHeight;document.getElementById("".concat(e.jSPlugin.id)).style["backface-visibility"]="hidden",e.jSPlugin.jSPlugin.JS_Resize(n,t-o)}),100)}else{var r=S(document.getElementById("".concat(this.jSPlugin.id)));r.then((function(t){e.jSPlugin.jSPlugin.JS_Resize(window.screen.width,window.screen.height)}))["catch"]((function(e){console.log(e)}))}}}]),e}();Date.prototype.Format=function(e){var t={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};for(var n in/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),t)new RegExp("("+n+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?t[n]:("00"+t[n]).substr((""+t[n]).length)));return e};var je=function(){function e(t,n){if(c(this,e),this.params=t,this.state={},this.jsPlugin=n,this.url="https://log.ys7.com/statistics.do?",t.env)switch(t.env){case"test12":this.url="https://test12dclog.ys7.com/statistics.do?";break;case"online":break;default:this.url=t.env;break}}return l(e,[{key:"uuid",value:function(){for(var e=[],t="0123456789abcdef",n=0;n<36;n++)e[n]=t.substr(Math.floor(16*Math.random()),1);e[14]="4",e[19]=t.substr(3&e[19]|8,1),e[8]=e[13]=e[18]=e[23]="-";var i=e.join("");return i}},{key:"dclog",value:function(e){var t=this.url,n=Object.assign({},{systemName:"open_website_monitor"},{bn:"ezuikit-js"},e,{un:e.url},{st:(new Date).getTime(),h:window.location.pathname});Object.keys(n).forEach((function(e,i){var o=n[e];"string"===typeof n[e]&&(o=n[e].replace("%","%25")),"undefined"!==typeof n[e]&&(t+="".concat(0===i?"":"&").concat(e,"=").concat(encodeURIComponent(o)))}));var i=new Image;i.src=t}},{key:"localInfoLog",value:function(e){var t=this.url,n=window.location.protocol+"//"+window.location.host,i={systemName:"open_netstream_localinfo",Ver:"v6.0.0",PlatAddr:n,ExterVer:"v6.0.0",OpId:this.uuid(),CltType:102,AppId:"",playurl:encodeURIComponent(this.jsPlugin.url),StartTime:(new Date).Format("yyyy-MM-dd hh:mm:ss.S"),OS:navigator.platform};i=Object.assign(i,e),Object.keys(i).forEach((function(e,n){var o=i[e];"string"===typeof i[e]&&(o=i[e].replace("%","%25")),"undefined"!==typeof i[e]&&(t+="".concat(0===n?"":"&").concat(e,"=").concat(encodeURIComponent(o)))}));var o=new Image;o.src=t}},{key:"playLog",value:function(e){var t=this.url,n=t,i={systemName:"open_netstream_play_main",playurl:encodeURIComponent(this.jsPlugin.url),Time:(new Date).Format("yyyy-MM-dd hh:mm:ss.S"),Via:2,OpId:this.uuid()};i=Object.assign(i,e),Object.keys(i).forEach((function(e,t){var o=i[e];"string"===typeof i[e]&&(o=i[e].replace("%","%25")),"undefined"!==typeof i[e]&&(n+="".concat(0===t?"":"&").concat(e,"=").concat(encodeURIComponent(o)))}));var o=new Image;o.src=n}}]),e}();(function(e,t){"object"===d(n)&&"object"===d(n.exports)?n.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("EZUIPlayer requires a window with a document");return t(e)}:t(e)})("undefined"!==typeof window?window:void 0,(function(e,t){var n;function i(e,t){for(var n=document.getElementsByTagName("head")[0].getElementsByTagName("script"),i=!1,o=0;o0&&(i=t.controls.join(","),e+="&controls="+i)),t.websocketParams&&(e+="&websocketParams="+JSON.stringify(t.websocketParams)),e;case"standard":return c+"/ezopen/h5/iframe?bSupporDoubleClickFull=0&url="+n.opt.url.replace("?","&")+"&autoplay="+n.opt.autoplay+"&audio="+n.opt.audio+"&accessToken="+t.accessToken+"&templete=1&id="+l+"&decoderVersion="+n.opt.decoderVersion;case"security":return c+"/ezopen/h5/iframe_se?bSupporDoubleClickFull=0&url="+n.opt.url.replace("?","&")+"&autoplay="+n.opt.autoplay+"&audio="+n.opt.audio+"&accessToken="+t.accessToken+"&templete=0&id="+l+"&decoderVersion="+n.opt.decoderVersion;case"theme":return e=c+"/jssdk/theme.html?url=".concat(t.url,"&accessToken=").concat(t.accessToken,"&id=").concat(l,"&isMobile=").concat(t.isMobile),"undefined"!==typeof t.isMobile&&(e+="&isMobile="+t.isMobile),"undefined"!==typeof t.autoplay&&(e+="&autoplay="+t.autoplay),"undefined"!==typeof t.domain&&"https://test12open.ys7.com"==t.domain&&(e+="&env=test12"),"undefined"!==typeof t.env&&"undefined"!==typeof t.env.domain&&"https://test12open.ys7.com"==t.env.domain&&(e+="&env=test12"),"undefined"!==typeof t.header&&(e+="&header="+t.header),e;default:return c+"/ezopen/h5/iframe?bSupporDoubleClickFull=0&url="+n.opt.url.replace("?","&")+"&autoplay="+n.opt.autoplay+"&audio="+n.opt.audio+"&accessToken="+t.accessToken+"&templete=0&id="+l+"&decoderVersion="+n.opt.decoderVersion}}p.src=m();var h=document.getElementById(l).offsetHeight,f=document.getElementById(l).offsetWidth;t.height&&(h=parseInt(t.height),/\%$/.test(t.height)&&(f=document.getElementById(l).offsetWidth*(parseInt(t.height)/100))),t.width&&(f=parseInt(t.width),/\%$/.test(t.width)&&(f=document.getElementById(l).offsetWidth*(parseInt(t.width)/100))),p.width=f,p.height=h,p.id="EZUIKitPlayer-"+l,p.setAttribute("allowfullscreen",!0),p.setAttribute("allow","autoplay"),p.setAttribute("frameborder",0),u.appendChild(p);var g=n.opt.filePath+"/js/jquery.js",v="https://open.ys7.com/assets/layer/layer.js";i(g,(function(){i(v,(function(){if(y().headerContainer){var d=document.createElement("div");d.setAttribute("class","panel-top");var s=document.createElement("div");if(s.setAttribute("class","contros"),d.appendChild(s),u.insertBefore(d,p),y().capturePictureModule){var l=document.createElement("span");l.innerHTML=' ',l.onclick=function(){n.capturePicture()},s.appendChild(l)}if(console.log("matchHeaderOpt().saveModule",y().saveModule),y().saveModule){var m=document.createElement("span");m.innerHTML=' ',m.onclick=function(){n.startSave(),document.getElementById("startSave").setAttribute("class","icon hide"),document.getElementById("stopSave").setAttribute("class","icon")},s.appendChild(m);var h=document.createElement("span");h.innerHTML=' ',h.onclick=function(){n.stopSave(),document.getElementById("stopSave").setAttribute("class","icon hide"),document.getElementById("startSave").setAttribute("class","icon")},s.appendChild(h)}if(y().zoomModule){var f=document.createElement("span");f.innerHTML=' ',f.onclick=function(){n.enableZoom(),document.getElementById("enableZoom").setAttribute("class","icon hide"),document.getElementById("closeZoom").setAttribute("class","icon")},s.appendChild(f);var g=document.createElement("span");g.innerHTML=' ',g.onclick=function(){n.closeZoom(),document.getElementById("closeZoom").setAttribute("class","icon hide"),document.getElementById("enableZoom").setAttribute("class","icon")},s.appendChild(g)}}function v(){var e={footerContainer:!1,talkModule:!1,broadcastModule:!1,hdModule:!1,fullScreenModule:!1},i=n.opt.template;switch(i){case"simple":if(t.footer&&t.footer instanceof Array){var o=t.footer;e={footerContainer:!0,talkModule:-1!==o.indexOf("talk"),broadcastModule:-1!==o.indexOf("broadcast"),hdModule:-1!==o.indexOf("hd"),fullScreenModule:-1!==o.indexOf("fullScreen")}}break;case"standard":if(t.footer&&t.footer instanceof Array){o=t.footer;e={footerContainer:!0,talkModule:-1!==o.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};break}return e}function y(){var e={headerContainer:!1,capturePictureModule:!1,saveModule:!1,zoomModule:!1},i=n.opt.template;switch(i){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":break;case"security":break;case"voice":e={headerContainer:!0,capturePictureModule:!0,saveModule:!0,zoomModule:!0};break}return e}if(v().footerContainer||-1!==n.opt.plugin.indexOf("talk")){var C=n.opt.filePath+"/npm/css/recoder.css",S=n.opt.filePath+"/npm/js/recoder.js",T=n.opt.filePath+"/recorder.js";if(o(C,(function(){})),i(S,(function(){i(T,(function(){}))})),-1!==n.opt.plugin.indexOf("talk")||v().talkModule){var b=function(t){if(console.log("data",t),200==t.code){var o=t.data;if(o){var r=o.rtcUrl;-1===r.indexOf("ws")&&(r=r.replace("https","wss").replace("rtcgw","rtcgw-ws")),n.opt.rtcUrl=r,n.opt.ttsUrl="tts://"+o.ttsUrl;var d="talk://"+n.opt.deviceSerial+":0:"+n.opt.channelNo+":cas.ys7.com:6500";if(n.opt.talkLink=n.opt.ttsUrl+"/"+d,n.opt.stream=o.stream,console.log("_this.opt",n.opt),!n.opt.isReliesReady){var c=n.opt.filePath+"/npm/js/adapeter.js",s=n.opt.filePath+"/npm/js/janus.js",l=n.opt.filePath+"/npm/js/tts.js";console.log("加载jquery.js"),i(c,(function(){console.log("加载adapeter.js"),i(s,(function(){console.log("加载janus.js"),i(l,(function(){console.log("加载tts.js"),n.opt.isReliesReady=!0}))}))}),(function(){return!!e.adapter}))}if(!document.getElementById("audioleft")){var u=document.createElement("div");u.style.display="none",u.id="audioleft",document.body.appendChild(u)}if(!document.getElementById("audioright")){var p=document.createElement("div");p.style.display="none",p.id="audioright",document.body.appendChild(p)}}}a.opt=n.opt,e.EZUIKit&&(e.EZUIKit.opt=n.opt)};r(n.opt.apiDomain,"POST",{accessToken:n.opt.accessToken,deviceSerial:n.opt.deviceSerial,channelNo:n.opt.channelNo},"",b)}if(v().footerContainer){var w=function(e,t){if(clearInterval(a.state.countTimer),"add"===e){var n=t;a.state.countTimer=setInterval((function(){++n,document.getElementById("time-area").innerHTML=i(n)}),1e3)}else if("sub"===e){n=t;a.state.countTimer=setInterval((function(){n>0?(n--,document.getElementById("time-area").innerHTML=i(n)):(clearInterval(a.state.countTimer),a.state.countTimer=void 0,console.log("倒计时结束,开启声音"))}),1e3)}else"destory"===e&&(clearInterval(a.state.countTimer),a.state.countTimer=void 0,document.getElementById("time-area").innerHTML="00:00");function i(e){var t=parseInt(e),n=0,i=0,o="00",r="00",a="00";return t>59&&(n=parseInt(t/60),t=parseInt(t%60),n>59&&(i=parseInt(n/60),n=parseInt(n%60))),o=parseInt(t)>9?parseInt(t):"0"+parseInt(t),r=parseInt(n)>9?parseInt(n):"0"+parseInt(n),a=parseInt(i)>9?parseInt(i):"0"+parseInt(i),i>0?a+":"+r+":"+o:n>0?r+":"+o:"00:"+o}},P=document.createElement("div");if(P.setAttribute("class","audio-controls"),u.appendChild(P),v().hdModule||v().fullScreenModule){var k=document.createElement("div");if(k.setAttribute("class","contros"),P.appendChild(k),v().hdModule){var E=document.createElement("span");E.setAttribute("id","video-hd"),E.innerHTML=-1===n.opt.url.indexOf(".hd")?"标清":"高清",E.onclick=function(){if(n.opt.videoLoading)return layer.msg("视频加载中,请稍后"),!1;var e=n.stop();n.opt.videoLoading=!0,e.then((function(e){n.opt.videoLoading=!1,-1===n.opt.url.indexOf(".hd")?(n.opt.url=n.opt.url.replace(".live",".hd.live"),E.innerHTML=-1===n.opt.url.indexOf(".hd")?"标清":"高清"):(n.opt.url=n.opt.url.replace(".hd.live",".live"),E.innerHTML=-1===n.opt.url.indexOf(".hd")?"标清":"高清"),n.play(n.opt.url)}))["catch"]((function(e){console.log("error",e)}))},k.appendChild(E)}if(v().fullScreenModule){var I=document.createElement("span");I.setAttribute("class","hide"),I.setAttribute("id","ezuikit-open-sound"),I.setAttribute("title","打开声音"),I.setAttribute("style","vertical-align: top;"),I.innerHTML='',I.onclick=function(){n.openSound(0),I.setAttribute("class","hide"),x.setAttribute("class","")};var x=document.createElement("span");I.setAttribute("id","ezuikit-close-sound"),x.setAttribute("class","hide"),x.setAttribute("title","关闭声音"),x.setAttribute("style","vertical-align: top;"),x.innerHTML='',x.onclick=function(){n.closeSound(0),I.setAttribute("class",""),x.setAttribute("class","hide")},k.appendChild(I),k.appendChild(x)}if(1==n.opt.audio?x.setAttribute("class",""):(I.setAttribute("class",""),n.closeSound(0)),v().fullScreenModule){var _=document.createElement("span");_.setAttribute("title","全屏"),_.setAttribute("style","vertical-align: top;"),_.innerHTML=' ',_.onclick=function(){n.fullScreen()},k.appendChild(_)}}if(v().talkModule){var j=document.createElement("div"),R=document.createElement("div");j.setAttribute("class","ptp-talk off"),j.innerHTML=' 开启对讲',j.onclick=function(){if(console.log("EZUIKit.state.countTimer",a.state.countTimer),a.state.countTimer)return e.layer.msg("语音设备正忙,请稍后重试"),!1;w("add",0),console.log("开始对讲,关闭声音"),n.closeSound(0),console.log(n.opt),n.startTalk(),this.setAttribute("class","ptp-talk off hide"),R.setAttribute("class","ptp-talk on")},R.setAttribute("class","ptp-talk on hide"),R.innerHTML=' 关闭对讲',R.onclick=function(){console.log(n.opt),n.stopTalk(),w("destory",0),n.openSound(0),this.setAttribute("class","ptp-talk on hide"),j.setAttribute("class","ptp-talk off")},P.appendChild(j),P.appendChild(R)}if(v().broadcastModule){var M=function e(t){function i(n){console.log("data",n),200==n.code&&(D(n.data,5),a.state.page=n.page.page,0!=t||0!=n.data.length||a.state.fetchDefaultList||(a.state.fetchDefaultList=!0,e(0)))}r(c+"/api/lapp/voice/query","POST",{accessToken:n.opt.accessToken,pageStart:t,pageSize:a.state.pageSize,default:a.state.fetchDefaultList?"true":"false"},"",i)},D=function(e){if(console.log("renderVoliceList",e),e&&e.length>0){for(var t=0;t"+(e[t]["voiceName"].length>10?e[t]["voiceName"].substr(0,10)+"...":e[t]["voiceName"])+"",document.getElementsByClassName("voice-list-ul")[0].append(n),n.onclick=function(e){console.log("点击元素",e.target,e.target.dataset.url);var t=e.target.dataset.url,n=e.target.dataset.time;A(t,n)}}e.length===a.state.pageSize?document.getElementById("voice-list-end").innerHTML="向下滚动加载更多":document.getElementById("voice-list-end").innerHTML="没有更多数据了"}},A=function(t,i){function o(t){console.log("data.data",t.data),200==t.code?w("sub",parseInt(i)):"10001"==t.code?e.layer.msg("未找到当前语音"):e.layer.msg(t.msg||"发送失败,请稍后再试")}console.log("播放语音",t,i),r(c+"/api/lapp/voice/send","POST",{accessToken:n.opt.accessToken,deviceSerial:n.opt.deviceSerial,channelNo:n.opt.channelNo,fileUrl:t},"",o)},B=document.createElement("div"),z=document.createElement("div");B.setAttribute("class","broadcast off"),z.setAttribute("class","broadcast on hide"),B.innerHTML=' 语音播报',B.onclick=function(){this.setAttribute("class","broadcast off hide"),z.setAttribute("class","broadcast on")},z.innerHTML='
自定义语音
语音播报',z.onclick=function(){this.setAttribute("class","broadcast on hide"),B.setAttribute("class","broadcast off")},P.appendChild(B),P.appendChild(z),document.getElementById("voice-custom").onclick=function(){console.log("显示自定义语音"),F.setAttribute("class","speak off")},M(0);var F=document.createElement("div"),L=document.createElement("div");F.setAttribute("class","speak off hide"),L.setAttribute("class","speak on hide"),F.setAttribute("id","startSpeak"),L.setAttribute("id","stopSpeak"),F.innerHTML=' 按住说话',L.innerHTML=' 松开发送',P.appendChild(F),P.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("拖动到底,执行加载",a.state.page),M(++a.state.page))};var O,N=document.createElement("div");N.setAttribute("class","time-area"),N.setAttribute("id","time-area"),N.innerHTML="00:00",P.appendChild(N),document.getElementById("startSpeak").onmousedown=function(){if(a.state.countTimer)return e.layer.msg("语音设备正忙,请稍后重试"),!1;var t;function i(n){var i=t.createMediaStreamSource(n);O=new e.Recorder(i)}function o(){O&&O.record()}function r(){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(n){console.log("err",n),e.layer.msg("No web audio support in this browser!")}navigator.getUserMedia({audio:!0},i,(function(e){console.log("No live audio input: "+e)}))}console.log("按住说话"),F.setAttribute("class","speak off hide"),L.setAttribute("class","speak on"),r(),w("add",0),setTimeout((function(){a.state.recodeTime=0,o()}),1e3),a.state.recodeTimer&&clearInterval(a.state.recodeTimer),a.state.recodeTimer=setInterval((function(){a.state.recodeTime>=59?(n.stopTalk(),w("destory",0),this.setAttribute("class","ptp-talk on hide"),j.setAttribute("class","ptp-talk off"),e.layer.msg("不超过1分钟")):a.state.recodeTime=a.state.recodeTime+1}),1e3)},document.getElementById("stopSpeak").onmouseup=function(){function t(){if(w("destory",0),a.state.recodeTime<1)return e.layer.msg("说话时间过短"),clearInterval(a.state.recodeTimer),!1;clearInterval(a.state.recodeTimer),i()}function i(){try{O&&O.stop(),O&&O.exportWAV((function(t){if(console.log("wav_file",t),t.size<1e3)return e.layer.msg("录音失败,请重试"),a.state.recodeTime=0,!1;w("sub",a.state.recodeTime+2);var i=new FormData;function o(t){console.log("data.data",t.data),200==t.code?w("sub",a.state.recodeTime+2):"10001"==t.code?e.layer.msg("未找到当前语音"):e.layer.msg(t.msg||"发送失败,请稍后再试")}function d(e){console.log("err",e)}i.append("voiceFile",t),i.append("accessToken",n.opt.accessToken),i.append("deviceSerial",n.opt.deviceSerial),i.append("channelNo",n.opt.channelNo),r(c+"/api/lapp/voice/sendonce","POST",{voiceFile:t,accessToken:n.opt.accessToken,deviceSerial:n.opt.deviceSerial,channelNo:n.opt.channelNo},"",o,d)})),O&&O.clear()}catch(t){console.log(t)}}console.log("松开发送"),L.setAttribute("class","speak on hide"),t()}}}}}))}));n=this;function y(e){n.opt.fullScreenStatus=e?1:0,t.fullScreenChangeCallBack&&t.fullScreenChangeCallBack({data:e,id:n.opt.id})}e.addEventListener("message",(function(i){i.origin;var o=n.opt.id;if(i.data.type)switch(i.data.type){case"openSound":o==i.data.id&&t.openSoundCallBack&&t.openSoundCallBack(i.data);break;case"closeSound":o==i.data.id&&t.closeSoundCallBack&&t.closeSoundCallBack(i.data);break;case"capturePicture":o==i.data.id&&t.capturePictureCallBack&&t.capturePictureCallBack(i.data);break;case"startSave":o==i.data.id&&t.startSaveCallBack&&t.startSaveCallBack(i.data);break;case"stopSave":o==i.data.id&&t.stopSaveCallBack&&t.stopSaveCallBack(i.data);break;case"fullScreen":o==i.data.id&&t.fullScreenCallBack&&t.fullScreenCallBack(i.data);break;case"getOSDTime":o==i.data.id&&t.getOSDTimeCallBack&&t.getOSDTimeCallBack(i.data);break;case"handleSuccess":o==i.data.id&&t.handleSuccess&&t.handleSuccess(i.data);break;case"handleError":o==i.data.id&&t.handleError&&t.handleError(i.data);break;case"dblclick":o==i.data.id&&n.opt.bSupporDoubleClickFull&&(0===n.opt.fullScreenStatus?n.fullScreen():n.cancelFullScreen());break;case"startTalk":n.startTalk(),n.closeSound();break;case"stopTalk":n.stopTalk(),n.openSound();break;case"clickEventHandle":console.log("event.data",i.data),t.clickEventHandle&&t.clickEventHandle(i.data);break;case"removeEventHandle":t.removeEventHandle&&t.removeEventHandle(i.data);break;case"esc":t.clickEventHandle&&t.clickEventHandle(i.data);break;case"iframeFullScreen":if(o==i.data.id){var r=function(t){var n=t.requestFullScreen||t.webkitRequestFullScreen||t.mozRequestFullScreen||t.msRequestFullScreen;if(n)n.call(t);else if("undefined"!==typeof e.ActiveXObject){var i=new ActiveXObject("WScript.Shell");null!==i&&i.SendKeys("{F11}")}};r(document.getElementById("EZUIKitPlayer-"+i.data.id))}break}})),"undefined"!==typeof document.fullScreen?document.addEventListener("fullscreenchange",(function(){var e=document.fullscreen||!1;y(e)})):"undefined"!==typeof document.webkitIsFullScreen?document.addEventListener("webkitfullscreenchange",(function(){var e=document.webkitIsFullScreen||!1;y(e)})):"undefined"!==typeof document.mozFullScreen&&document.addEventListener("mozfullscreenchange",(function(){var e=document.mozFullScreen||!1;y(e)}))};l.prototype.play=function(t){var n="EZUIKitPlayer-"+this.opt.id,i=document.getElementById(n).contentWindow;"object"===d(t)&&t.url&&(this.opt.url=t.url),"object"===d(t)&&t.accessToken&&(this.opt.accessToken=t.accessToken),"string"===typeof t&&(this.opt.url=t),i.postMessage({action:"play",accessToken:this.opt.accessToken,url:this.opt.url},c+"/ezopen/h5/iframe");var o=this;this.opt.videoLoading=!0;var r=new Promise((function(t,n){e.addEventListener("message",(function(e){var n=o.opt.id;n==e.data.id&&"handleSuccess"===e.data.type&&(setTimeout((function(){o.opt.videoLoading=!1}),1e3),t(e.data))}))}));return r},l.prototype.stop=function(){var t="EZUIKitPlayer-"+this.opt.id,n=document.getElementById(t).contentWindow;n.postMessage("stop",c+"/ezopen/h5/iframe");var i=this,o=new Promise((function(t,n){e.addEventListener("message",(function(e){var n=i.opt.id;n==e.data.id&&"stop"===e.data.type&&t(e.data)}))}));return o},l.prototype.openSound=function(){var t="EZUIKitPlayer-"+this.opt.id,n=document.getElementById(t).contentWindow;n.postMessage("openSound",c+"/ezopen/h5/iframe");var i=this,o=new Promise((function(t,n){e.addEventListener("message",(function(e){var n=i.opt.id;n==e.data.id&&"openSound"===e.data.type&&t(e.data)}))}));return o},l.prototype.closeSound=function(){var t="EZUIKitPlayer-"+this.opt.id,n=document.getElementById(t).contentWindow;n.postMessage("closeSound",c+"/ezopen/h5/iframe");var i=this,o=new Promise((function(t,n){e.addEventListener("message",(function(e){var n=i.opt.id;n==e.data.id&&"closeSound"===e.data.type&&t(e.data)}))}));return o},l.prototype.startSave=function(t){var n="EZUIKitPlayer-"+this.opt.id,i=document.getElementById(n).contentWindow;i.postMessage({action:"startSave",fileName:t||"default"},c+"/ezopen/h5/iframe");var o=this,r=new Promise((function(t,n){e.addEventListener("message",(function(e){var n=o.opt.id;n==e.data.id&&"startSave"===e.data.type&&t(e.data)}))}));return r},l.prototype.stopSave=function(){var t="EZUIKitPlayer-"+this.opt.id,n=document.getElementById(t).contentWindow;n.postMessage("stopSave",c+"/ezopen/h5/iframe");var i=this,o=new Promise((function(t,n){e.addEventListener("message",(function(e){var n=i.opt.id;n==e.data.id&&"stopSave"===e.data.type&&t(e.data)}))}));return o},l.prototype.fullScreen=function(){if(1===this.opt.fullScreenStatus)return!1;var t="EZUIKitPlayer-"+this.opt.id,n=document.getElementById(t).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,o=document.documentElement.clientHeight,r=document.body;r=document.getElementById(t);var a="";a+="width:"+o+"px;",a+="height:"+i+"px;",a+="-webkit-transform: rotate(90deg); transform: rotate(90deg);",a+="-webkit-transform-origin: "+i/2+"px "+i/2+"px;",a+="transform-origin: "+i/2+"px "+i/2+"px;",a+="position: fixed;top: 0;left: 0;z-index:10",r.style.cssText=a,setTimeout((function(){n.postMessage("autoResize",c+"/ezopen/h5/iframe")}),500)}else{var d=function(t){var n=t.requestFullScreen||t.webkitRequestFullScreen||t.mozRequestFullScreen||t.msRequestFullScreen;if(n)n.call(t);else if("undefined"!==typeof e.ActiveXObject){var i=new ActiveXObject("WScript.Shell");null!==i&&i.SendKeys("{F11}")}};d(document.getElementById(t))}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 n=document.getElementById(e).width,i=document.getElementById(e).height,o=document.body;o=document.getElementById(e);var r="";r+="width:"+n+"px;",r+="height:"+i+"px;",r+="-webkit-transform: none; transform: none;",r+="-webkit-transform-origin: 0 0;",r+="transform-origin: 0 0;",o.style.cssText=r,setTimeout((function(){t.postMessage("autoResize",c+"/ezopen/h5/iframe")}),500);var a=e+"cancel-full-screen",d=document.getElementById(a);d&&document.body.removeChild(d)}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,n){var i="EZUIKitPlayer-"+this.opt.id,o=document.getElementById(i).contentWindow;o.postMessage({action:"capturePicture",fileName:t||"default",isUndownload:n},c+"/ezopen/h5/iframe");var r=this,a=new Promise((function(t,n){e.addEventListener("message",(function(e){var n=r.opt.id;n==e.data.id&&"capturePicture"===e.data.type&&t(e.data)}))}));return a},l.prototype.enableZoom=function(){var e="EZUIKitPlayer-"+this.opt.id,t=document.getElementById(e).contentWindow;t.postMessage("enableZoom",c+"/ezopen/h5/iframe")},l.prototype.closeZoom=function(){var e="EZUIKitPlayer-"+this.opt.id,t=document.getElementById(e).contentWindow;t.postMessage("closeZoom",c+"/ezopen/h5/iframe")},l.prototype.getOSDTime=function(){var t="EZUIKitPlayer-"+this.opt.id,n=document.getElementById(t).contentWindow;n.postMessage("getOSDTime",c+"/ezopen/h5/iframe");var i=this,o=new Promise((function(t,n){e.addEventListener("message",(function(e){var n=i.opt.id;n==e.data.id&&"getOSDTime"===e.data.type&&t(e.data)}))}));return o},l.prototype.autoResize=function(){var e="EZUIKitPlayer-"+this.opt.id,t=document.getElementById(e).contentWindow;t.postMessage("autoResize",c+"/ezopen/h5/iframe")},l.prototype.reSize=function(e,t){var n="EZUIKitPlayer-"+this.opt.id,i=document.getElementById(n).contentWindow,o=document.getElementById(this.opt.id);o.style.width=e+"px",o.style.height=t+"px",document.getElementById(this.opt.id).style.width=e+"px",document.getElementById(this.opt.id).style.height=t+"px";var r=document.getElementById(n);r.setAttribute("width",e),r.setAttribute("height",t),r.style.width=e+"px",r.style.height=t+"px",setTimeout((function(){i.postMessage({action:"autoResize"},c+"/ezopen/h5/iframe")}),500)},l.prototype.startTalk=function(){console.log("执行开始对讲"),console.log(this.opt);var t=this;a.opt=this.opt,e.EZUIKit&&(e.EZUIKit.opt=this.opt);var n=function(n){if(200==n.code){var i=n.data;if(i){var o=i.rtcUrl;-1===o.indexOf("ws")&&(o=o.replace("https","wss").replace("rtcgw","rtcgw-ws")),t.opt.rtcUrl=o,t.opt.ttsUrl="tts://"+i.ttsUrl;var r="talk://"+t.opt.deviceSerial+":0:"+t.opt.channelNo+":cas.ys7.com:6500";t.opt.talkLink=t.opt.ttsUrl+"/"+r,t.opt.stream=i.stream,e.startTalk()}}};r(t.opt.apiDomain,"POST",{accessToken:t.opt.accessToken,deviceSerial:t.opt.deviceSerial,channelNo:t.opt.channelNo},"",n)},l.prototype.stopTalk=function(){console.log("执行结束对讲"),e.stopTalk()},l.prototype.edit=function(){var e="EZUIKitPlayer-"+this.opt.id,t=document.getElementById(e).contentWindow;t.postMessage("edit",c+"/ezopen/h5/iframe")},l.prototype.btnReRender=function(e){var t="EZUIKitPlayer-"+this.opt.id,n=document.getElementById(t).contentWindow;n.postMessage({action:"btnReRender",data:e},c+"/ezopen/h5/iframe")},l.prototype.changePlayUrl=function(e){e.deviceSerial&&(this.opt.deviceSerial=e.deviceSerial),e.channelNo&&(this.opt.channelNo=e.channelNo),e.accessToken&&(this.opt.accessToken=e.accessToken);var t="EZUIKitPlayer-"+this.opt.id,n=document.getElementById(t).contentWindow;n.postMessage({action:"changePlayUrl",data:e},c+"/ezopen/h5/iframe")},l.prototype.fetchThemeData=function(){var e="EZUIKitPlayer-"+this.opt.id,t=document.getElementById(e).contentWindow;t.postMessage({action:"fetchThemeData"},c+"/ezopen/h5/iframe")},l.prototype.setThemeData=function(e,t,n){var i="EZUIKitPlayer-"+this.opt.id,o=document.getElementById(i).contentWindow;o.postMessage({action:"setThemeData",data:{accessToken:e,header:t,footer:n}},c+"/ezopen/h5/iframe")},a.EZUIKitPlayer=l,e.EZUIKitV3=a;var p=a;return p}));var Re=EZUIKitV3,Me=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=void 0,o=void 0,r=void 0,a=[];return function(){var c=De(t),s=(new Date).getTime(),l=!i||s-i>c;i=s;for(var u=arguments.length,p=Array(u),m=0;m0&&i>0){var r=e.left/n,a=e.top/i,d=e.right/n,c=e.bottom/i;o=new Float32Array([d,a,r,a,d,c,r,c])}else o=new Float32Array([1,0,0,0,1,1,0,1]);var s=this.texturePosBuffer;t.bindBuffer(t.ARRAY_BUFFER,s),t.bufferSubData(t.ARRAY_BUFFER,0,o),t.bindBuffer(t.ARRAY_BUFFER,null)},e.prototype.SR_Destroy=function(){var e=this.contextGL,t=this.YUVProgram;e.deleteProgram(t);var n=this.vertexPosBuffer,i=this.texturePosBuffer;e.deleteBuffer(n),e.deleteBuffer(i);var o=this.yTextureRef,r=this.uTextureRef,a=this.vTextureRef;e.deleteTexture(o),e.deleteTexture(r),e.deleteTexture(a)},e}));var Ne="https://open.ys7.com",Ue="".concat(Ne,"/console/ezuikit_static/v65/v2"),Ve="".concat(Ne,"/console/ezuikit_static/v65/v1"),He=function(e,t){var n=["theme","standard"],i=["pcLive","pcRec","mobileLive","mobileRec","noData","security","voice","simple"];if("undefined"===typeof e)return t.themeData?{templateType:"themeData",templateId:"themeData"}:{templateType:"local",templateId:""};if("string"===typeof e){if(32===e.length)return{templateType:"remote",templateId:e};if(-1!==n.indexOf(e))return"simple"===e&&"undefined"===typeof t.header&&"undefined"===typeof t.footer?{templateType:"local",templateId:""}:{templateType:"iframe",templateId:e};if(-1!==i.indexOf(e))return{templateType:"local",templateId:e}}},We=function(){var e=window.navigator.userAgent.toLowerCase(),t={sa:/version.*safari/.test(e),ch:/chrome/.test(e),ff:/gecko/.test(e)&&!/webkit/.test(e)},n=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);if(n)return!1;if(t.ch){var i=function(){for(var e=window.navigator.userAgent.split(" "),t="",n=0;n91&&!!window.SharedArrayBuffer}return!1},Ze=function(){function e(t){var n=this;c(this,e),this.isStoping=!1;var i=t.autoplay,o=void 0===i||i;if((t.template||t.themeData)&&(o=!1),this.params=t,this.autoplay=o,window.EZUIKit[t.id]={state:{EZUIKitPlayer:{init:window.EZUIKit[t.id]&&window.EZUIKit[t.id].state&&window.EZUIKit[t.id].state.EZUIKitPlayer.init||!1,themeInit:window.EZUIKit[t.id]&&window.EZUIKit[t.id].state&&window.EZUIKit[t.id].state.EZUIKitPlayer.themeInit||!1,talkInit:window.EZUIKit[t.id]&&window.EZUIKit[t.id].state&&window.EZUIKit[t.id].state.EZUIKitPlayer.talkInit||!1}}},"iframe"===He(this.params.template,t).templateType)return new Re.EZUIKitPlayer(t);this.Monitor=new je({env:"undefined"!==typeof t.disableMonitor&&t.disableMonitor?"test12":"online"},this),this.id=t.id,this.width=t.width,this.height=t.height,this.url=t.url,this.accessToken=t.accessToken,this.themeId=He(t.template,t).templateId,this.id=t.id,this.audio=!0,this.poster=t.poster,this.speed=1,this.disabledTimeLine=!1,this.disabledPTZ=!1,this.enableSharedArrayBufferGuide=!1,this.capacity={},this.playTimer=null,this.env={domain:"https://open.ys7.com"};var r=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);this.isMobile=r,document.getElementById("".concat(this.id,"-wrap"))&&(document.getElementById("".concat(this.id,"-wrap")).innerHTML="",document.getElementById("".concat(this.id,"-wrap")).id=this.id),this.staticPath=We()?Ue:Ve,"string"===typeof t.staticPath&&(t.staticPath.startsWith("http")?this.staticPath=t.staticPath:this.staticPath=window.location.protocol+"//"+window.location.host+t.staticPath,We()?this.staticPath+="/v2":this.staticPath+="/v1"),"undefined"!==typeof t.audio&&(this.audio=t.audio),"undefined"!==typeof t.env&&(this.env=Object.assign(this.env,t.env)),"undefined"!==typeof t.isMobile&&(this.isMobile=t.isMobile),"undefined"!==typeof t.disabledTimeLine&&(this.disabledTimeLine=t.disabledTimeLine),"undefined"!==typeof t.disabledPTZ&&(this.disabledPTZ=t.disabledPTZ),"undefined"!==typeof t.enableSharedArrayBufferGuide&&(this.enableSharedArrayBufferGuide=t.enableSharedArrayBufferGuide);var a="".concat(this.staticPath,"/js/jsPluginV1-1.0.0.min.js"),d=function(){if(window.addPluginUrlIng=!0,We())console.log("启用多线程解析视频"),a="".concat(n.staticPath,"/js/jsPluginV2-2.0.1.min.js");else{var e=function(){for(var e=navigator.userAgent.split(" "),t="",n=0;n0&&(o=d.width),!e.height&&d.height>0&&(a=d.height)}if(!document.getElementById("".concat(n,"-wrap"))){var c=document.createElement("div");c.id="".concat(n,"-wrap"),c.style="display:inline-block;width:".concat(o,"px;position:relative;vertical-align: bottom;"),document.getElementById(n).parentNode.insertBefore(c,document.getElementById(n)),document.getElementById(n).parentNode.removeChild(document.getElementById(n)),c.innerHTML="
"),document.getElementById(n).style="display:inline-block;width:".concat(o,"px;height:").concat(a,"px;"),document.getElementById(n).style.verticalAlign="top"}this.themeId&&(this.Theme=new _e(this,e.id),window.EZUIKit[e.id].state.EZUIKitPlayer.themeInit=!0,this.Monitor.dclog({url:this.url,action:2,text:this.themeId}),"function"===typeof this.params.handleThemeChange&&(this.handleThemeChange=this.params.handleThemeChange));var s=new A(this,n);this.Message=s;var l=function(i,r){var d;if(We()){d=new window.JSPluginV2({szId:n,iType:2,iWidth:o,iHeight:a,iMaxSplit:1,iCurrentSplit:1,szBasePath:"",staticPath:t.staticPath,oStyle:{border:"none",background:"#000000"}}),t.pluginStatus.loadingStart(n),t.pluginStatus.loadingSetText({text:"初始化播放器完成"}),d.EventCallback={pluginErrorHandler:function(e,n,i){console.log(e,n,i),1003===n&&(console.log("断流"),d.bPlay||t.pluginStatus.loadingSetText({text:"连接断开,请重试",color:"red"}),"function"===typeof t.params.handleError&&t.params.handleError({msg:"连接断开,请重试",retcode:1003,id:t.params.id,type:"handleError"}))}},t.env={domain:"https://open.ys7.com"},"undefined"!==typeof e.env&&(t.env=Object.assign(t.env,e.env)),"undefined"!==typeof e.handleTalkSuccess&&(t.handleTalkSuccess=e.handleTalkSuccess),"undefined"!==typeof e.handleTalkError&&(t.handleTalkError=e.handleTalkError),t.errorHander=new O,t.jSPlugin=d;var c=setInterval((function(){window.JSPlayerModuleLoaded&&(clearInterval(c),"function"===typeof t.params.handleInitSuccess&&t.params.handleInitSuccess({retcode:0,id:t.params.id,type:"handleInitSuccess"}),i({meta:{retcode:200,msg:"初始化成功"}}))}),50)}else d=new window.JSPluginV1({szId:n,iType:2,iWidth:o,iHeight:a,iMaxSplit:1,iCurrentSplit:1,szBasePath:"",staticPath:t.staticPath,oStyle:{border:"none",background:"#000000"}}),t.pluginStatus.loadingStart(n),t.pluginStatus.loadingSetText({text:"初始化播放器完成"}),d.EventCallback={loadEventHandler:function(){},zoomEventResponse:function(){},windowEventSelect:function(e){},pluginErrorHandler:function(e,n,i){console.log(e,n,i),1003===n&&(console.log("断流"),d.bPlay||t.pluginStatus.loadingSetText({text:"连接断开,请重试",color:"red"}),"function"===typeof t.params.handleError&&t.params.handleError({msg:"连接断开,请重试",retcode:1003,id:t.params.id,type:"handleError"}))},windowEventOver:function(e){},windowEventOut:function(e){},windowEventUp:function(e){},windowFullCcreenChange:function(e){},firstFrameDisplay:function(e,n,i){console.log(n,i),d.JS_SetCanFullScreen(!1),t.pluginStatus.loadingClear()},performanceLack:function(){},mouseEvent:function(e,t,n){}},t.env={domain:"https://open.ys7.com"},"undefined"!==typeof e.env&&(t.env=Object.assign(t.env,e.env)),"undefined"!==typeof e.handleTalkSuccess&&(t.handleTalkSuccess=e.handleTalkSuccess),"undefined"!==typeof e.handleTalkError&&(t.handleTalkError=e.handleTalkError),t.errorHander=new O,t.jSPlugin=d,"function"===typeof t.params.handleInitSuccess&&t.params.handleInitSuccess({retcode:0,id:t.params.id,type:"handleInitSuccess"}),i({meta:{retcode:200,msg:"初始化成功"}})},u=new Promise(l);return u}},{key:"_getRealUrlPromise",value:function(e,t){var n=this;console.log("获取播放地址 url => ".concat(t," ").concat(this.accessToken));var i=this.env.domain;this.env&&(i=this.env.domain);var o=function(o,d){var c="",s=i+"/api/lapp/live/url/ezopen",l=new FormData;l.append("ezopen",t),l.append("isFlv","false"),l.append("userAgent",window.navigator.userAgent),l.append("isHttp","false"),l.append("accessToken",e),fetch(s,{method:"POST",body:l}).then((function(e){return e.json()})).then((function(e){if(200==e.code||0==e.retcode){var s="",l="";e.ext&&e.ext.token?(c+=e.data,l=e.ext.token,s=e.data):e.data&&e.data.token&&(c+=e.data.url,l=e.data.token,s=e.data.url);var u=-1!==t.indexOf("live")?"live":"playback";c="live"===u?c+"&ssn="+l+"&auth=1&biz=4&cln=100":c+"&ssn="+l+"&auth=1&cln=100",console.log(c);var p=g("checkCode",c);if(p&&("undefined"!==typeof n.jSPlugin.decoderVersion&&"2.0"===n.jSPlugin.decoderVersion?n.validateCode=p:(console.log("设置密钥",p),n.jSPlugin.JS_SetSecretKey(0,p))),-1!==c.indexOf("playback")){var m=g("begin",s)||g("begin",t),h=g("end",s)||g("end",t);if(m)c=c.replace("&begin="+g("begin",s),"&begin="+r(m,"000000")),g("begin",c)||(c+="&begin="+r(m,"000000"));else{var f=new Date;c=c+"&begin="+f.Format("yyyyMMdd")+"T000000Z"}if(h?(c=c.replace("&end="+g("end",s),"&end="+r(h,"235959")),g("end",c)||(c+="&end="+r(h,"235959"))):c=c+"&end="+r(g("begin",c).substr(0,8),"235959"),g("stream",s)||(c=c.replace("stream","&stream")),-1!==t.indexOf(".cloud")){var v=function(e){if(200==e.code){var t=[];if(e.data&&e.data.files&&e.data.files.length>0){var n=e.data.files,i=(new Date).getTime(),r=e.data.isAll;if(r){t=l(n);var a=JSON.stringify(t).replace("\\","");c+="&recSlice="+a.replace("\\","")+"&r="+Math.random(),o(c)}else{var s=function e(){function r(r){if(r.data&&r.data.files&&r.data.files.length>0)if(0==r.data.isAll)r.data.files&&(n=n.concat(r.data.files)),i=r.data.nextFileTime>0?r.data.nextFileTime:(new Date).getTime(),e();else{t=l(n);var a=JSON.stringify(t).replace("\\","");c+="&recSlice="+a.replace("\\","")+"&r="+Math.random(),o(c)}else{t=l(n);a=JSON.stringify(t).replace("\\","");c+="&recSlice="+a.replace("\\","")+"&r="+Math.random(),o(c)}}w.startTime=i,E(b,"POST",w,"",r)};s()}}else d({retcode:-1,msg:"未找到录像片段"})}else d({retcode:-1,msg:"未找到录像片段"});function l(e){var t=[];return e.forEach((function(e,n){0==t.length||e.downloadPath!==t[t.length-1].downloadPath?t.push({downloadPath:e.downloadPath,ownerId:e.ownerId,iStorageVersion:e.iStorageVersion,videoType:e.videoType,iPlaySpeed:0,startTime:e.startTime,endTime:e.endTime}):t[t.length-1].endTime=e.endTime})),t}},y=a(g("begin",c)),C=a(g("end",c)),S=g("serial",c),T=g("chn",c),b=i+"/api/lapp/video/by/time",w={accessToken:n.accessToken,recType:1,deviceSerial:S,channelNo:T,startTime:y,endTime:C,version:"2.0"};E(b,"POST",w,"",v)}else if(-1!==t.indexOf("alarmId")){var P=function(e){if(200==e.code){var t=[];if(e.data){t=i([e.data]);var n=JSON.stringify(t).replace("\\","");c+="&recSlice="+n.replace("\\",""),console.log("realUrl",c,e.data.recType),c=1==e.data.recType?c.replace("/playback","/cloudplayback"):c.replace("/cloudplayback","/playback"),o(c)}}function i(e){var t=[];return e.forEach((function(e,n){0==t.length||e.downloadPath!==t[t.length-1].downloadPath?t.push({downloadPath:e.downloadPath,ownerId:e.ownerId,iStorageVersion:e.iStorageVersion,videoType:e.videoType,iPlaySpeed:0,startTime:e.startTime,endTime:e.endTime}):t[t.length-1].endTime=e.endTime})),console.log("downloadPathArr",t),t}};console.log("进入alarmId回放");var k=g("alarmId",c);y=a(g("begin",c)),C=a(g("end",c)),S=g("serial",c),T=g("chn",c),b=i+"/api/lapp/video/by/id",w={accessToken:n.accessToken,deviceSerial:S,channelNo:T,alarmId:k};E(b,"POST",w,"",P)}else o(c)}else o(c)}else n.pluginStatus.loadingSetText({text:e.msg,color:"red"}),"function"===typeof n.params.handleError&&n.params.handleError({retcode:e.code,msg:e.msg,id:n.params.id,type:"handleError"}),d(e)}))};return new Promise((function(e,t){return o(e,t)}));function r(e,t){var n=/^[0-9]{8}T[0-9]{6}Z$/;if(n.test(e))return e;if(/[0-9]{8,14}/.test(e)){var i=6-(14-e.length),o=t.length,r=e+t.substring(i,o);return r.slice(0,8)+"T"+r.slice(8)+"Z"}throw new Error("回放时间格式有误,请确认")}function a(e){var t=e.slice(0,4),n=e.slice(4,6),i=e.slice(6,8),o=e.slice(9,11),r=e.slice(11,13),a=e.slice(13,15),d=t+"-"+n+"-"+i+" "+o+":"+r+":"+a;return new Date(d.replace(/-/g,"/")).getTime()}}},{key:"_pluginPlay",value:function(e,t,n){var i=this;if(console.log("执行播放 _pluginPlay",e),!e)return!1;function o(e){var t=e.split("?")[0].replace("/live","").replace("/playback",""),n=(-1===e.indexOf("/live")?-1!==e.indexOf("cloudplayback")?"/cloudplayback?":"/playback?":"/live?")+e.split("?")[1];return-1!==n.indexOf("/playback")&&(n=n.replace("stream=2","stream=1")),{websocketConnectUrl:t,websocketStreamingParam:n}}var r=o(e).websocketConnectUrl;this.env&&this.env.wsUrl&&(r=this.env.wsUrl);var a={playURL:o(e).websocketStreamingParam};console.log("播放前 stop 阶段 结束"),this.isStoping=!1;var d=Date.now();console.log("执行播放 ... this.jSPlugin.JS_Play at ",d),this.jSPlugin.JS_Play(r,a,0).then((function(){if(console.log("执行播放 ... this.jSPlugin.JS_Play 播放成功",r,a),console.log("执行播放耗时 ",Date.now()-d),i.isStoping)console.log("现在在播放前 stop 阶段,此次应为无效播放成功触发。不执行后续回调, 此次耗时无效");else{if(i.validateCode&&"undefined"!==typeof i.jSPlugin.decoderVersion&&"2.0"===i.jSPlugin.decoderVersion&&i.jSPlugin.JS_SetSecretKey(0,i.validateCode),i.pluginStatus.loadingClear(),i.pluginStatus.setPlayStatus({play:!0,loading:!1}),i.Theme){i.Theme.setDecoderState({play:!0});var e=R.findIndex(i.Theme.themeData.footer.btnList,(function(e){return"sound"===e.iconId&&1===e.isrender&&1===e.defaultActive}))>-1;i.audio=e}i.audio&&setTimeout((function(){i.openSound()}),500),"function"===typeof i.params.handleSuccess&&i.params.handleSuccess({retcode:0,id:i.params.id,type:"handleSuccess"}),t(),i.Monitor.dclog({url:i.url,action:211,d:(new Date).getTime()-i.playStartTime,text:"startPlaySuccess"}),i.Monitor.playLog({Enc:-1===i.url.indexOf("@")?0:1,PlTp:-1===i.url.indexOf("back")?1:2,Via:2,ErrCd:0,Cost:(new Date).getTime()-i.playStartTime,Serial:P(i.url).deviceSerial,Channel:P(i.url).channelNo,Ver:We()?"v7.0.0":"v6.0.0"})}}),(function(e){console.log("err",e);var t="播放失败,请检查设备及客户端网络",o=-1;if(i.jSPlugin.bPlay)return!1;if(e&&e.oError&&e.oError.errorCode){var r=i.errorHander.matchErrorInfo(e.oError.errorCode);t=r&&r.description?r.description:"播放失败,请检查设备及客户端网络",o=e.oError.errorCode}i.pluginStatus.loadingSetText({text:t,color:"red"}),"function"===typeof i.params.handleError&&i.params.handleError({retcode:o,msg:t,id:i.params.id,type:"handleError"}),n(),i.Monitor.dclog({url:i.url,action:411,d:(new Date).getTime()-i.playStartTime,text:"startPlayError"}),i.Monitor.playLog({Enc:-1===i.url.indexOf("@")?0:1,PlTp:-1===i.url.indexOf("back")?1:2,Via:2,ErrCd:o,Cost:-1,Serial:P(i.url).deviceSerial,Channel:P(i.url).channelNo,Ver:We()?"v7.0.0":"v6.0.0"})}))}},{key:"_play",value:function(e){var t=this;console.log("执行播放 play options.url =>",e),this.pluginStatus.setPlayStatus({play:!1,loading:!0}),this.playStartTime=(new Date).getTime(),this.Monitor.dclog({url:this.url,action:1,d:(new Date).getTime()-this.initTime,text:"startPlay"}),e&&("string"===typeof e&&(this.url=e),"string"===typeof e.url&&(this.url=e.url),"string"===typeof e.accessToken&&(this.accessToken=e.accessToken),!this.Theme||"string"!==typeof e.url&&"string"!==typeof e.accessToken||this.Theme.getDeviceInfo());var n=new Promise((function(e,n){console.log("执行 播放前 stop"),t.isStoping=!0,t.jSPlugin.JS_Stop(0).then((function(){console.log("播放前 stop 执行成功 this.url => ".concat(t.url," ").concat(t.accessToken)),t._getRealUrlPromise(t.accessToken,t.url).then((function(i){t._pluginPlay(i,(function(){return e(!0)}),(function(){return n(!1)}))}))["catch"]((function(e){var i=e.msg?e.msg:"播放失败,请检查设备及客户端网络";t.pluginStatus.loadingSetText({text:i,color:"red"}),"function"===typeof t.params.handleError&&t.params.handleError({retcode:e.oError?e.oError.errorCode:-1,msg:i,id:t.params.id,type:"handleError"}),n(!1)}))}))}));return n}},{key:"stop",value:function(){var e=this;return this.pluginStatus.setPlayStatus({loading:!0}),this.reSetTheme(),this.jSPlugin.JS_Stop(0).then((function(){console.log("停止成功"),e.pluginStatus.setPlayStatus({play:!1,loading:!1}),e.Theme&&e.Theme.setDecoderState({play:!1})}))}},{key:"changeVideoLevel",value:function(e){var t=this,n=this.url,i=e?n.replace(".live",".hd.live"):n.replace(".hd.live",".live");this.jSPlugin.playURL=e?this.jSPlugin.playURL.replace("stream=2","stream=1"):this.jSPlugin.playURL.replace("stream=1","stream=2"),console.log("changeVideoLevel",i,this.jSPlugin.playURL),this.url=i;var o=new Promise((function(e,n){t.pause().then((function(){console.log("暂停成功"),t.resume().then((function(e){console.log("恢复成功")}))}))["catch"]((function(){console.log("暂停失败"),t.resume().then((function(e){console.log("恢复成功")}))}))}));return o}},{key:"reSetTheme",value:function(){this.Theme&&this.Theme.Ptz&&(this.Theme.setDecoderState({pantile:!1}),this.Theme.Ptz.hide()),this.Theme&&this.Theme.decoderState.state.recordvideo&&this.Theme.setDecoderState({recordvideo:!1}),this.Theme&&this.Theme.decoderState.state.zoom&&(this.Zoom.stopZoom(),this.Theme.setDecoderState({zoom:!1})),this.Theme&&this.Theme.decoderState.state.talk&&(this.stopTalk(),this.Theme.setDecoderState({talk:!1})),this.Theme&&this.Theme.Rec&&!this.Theme.isMobile&&this.Theme.Rec.datepickerHide(),this.Theme&&this.Theme.Rec&&this.Theme.changeRecSpeed(1)}},{key:"_changePlayUrl",value:function(e){var t=this;console.log("_changePlayUrl"),this.reSetTheme();var n=this.url,i=r(n,e);e.accessToken&&(this.accessToken=e.accessToken),this.url=i;var o=new Promise((function(n,o){var r={url:i};return e.accessToken&&(r["accessToken"]=e.accessToken),console.log("切换播放地址 参数 ",r),t.play(r).then((function(){console.log("切换播放地址 play 执行成功 ",i),t.url=i,t.Theme&&t.Theme.decoderState.state.webExpend&&t.Theme.webExpend(),t.Theme&&t.Theme.decoderState.state.expend&&t.Theme.expend(),n(i)}))["catch"]((function(e){o(i)}))}));function r(e,t){if(t.url)return t.url;var n=e.split("/")[4].split(".")[e.split("/")[4].split(".").length-1].split("?")[0];"rec"===n&&-1!==e.indexOf(".cloud.rec")&&(n="cloud.rec"),t.type&&(n=t.type);var i=e.split("/")[3];t.deviceSerial&&(i=t.deviceSerial);var o=e.split("/")[4].split(".")[0];t.channelNo&&(o=t.channelNo);var r=2===e.split("/")[2].split("@").length?e.split("/")[2].split("@")[0]:"";"undefined"!==typeof t.validCode&&(r=t.validCode);var a="undefined"===typeof t.hd?-1!==e.indexOf(".hd"):t.hd,d="ezopen://".concat(r?"".concat(r,"@"):"","open.ys7.com/").concat(i,"/").concat(o).concat(a?".hd":"",".").concat(n);return"live"===n||(d="ezopen://".concat(r?"".concat(r,"@"):"","open.ys7.com/").concat(i,"/").concat(o,".").concat(n),t.begin&&t.end?d+="?begin=".concat(t.begin,"&end=").concat(t.end):t.begin?d+="?begin=".concat(t.begin):g("begin",e)&&(d+="?begin=".concat(g("begin",e)))),d}return o}},{key:"getOSDTime",value:function(){var e=this,t=new Promise((function(t,n){e.jSPlugin.JS_GetOSDTime(0).then((function(n){t({code:0,retcode:0,data:n}),"function"===typeof e.params.getOSDTimeCallBack&&e.params.getOSDTimeCallBack({id:e.id,type:"getOSDTime",code:0,data:n})}))["catch"]((function(t){n({code:-1,retcode:-1,data:t}),"function"===typeof e.params.getOSDTimeCallBack&&e.params.getOSDTimeCallBack({id:e.id,type:"getOSDTime",code:-1,data:-1})}))}));return t}},{key:"capturePicture",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.jSPlugin.JS_CapturePicture(0,e,"JPEG",n,!!n);return f(i)?("function"===typeof this.params.capturePictureCallBack&&i.then((function(){t.params.capturePictureCallBack({id:t.id,type:"capturePicture",code:0})}))["catch"]((function(){t.params.capturePictureCallBack({id:t.id,type:"capturePicture",code:-1})})),i):new Promise((function(e){e(i)}))}},{key:"startSave",value:function(e){var t=this,n=this.jSPlugin.JS_StartSave(0,e);return f(n)?("function"===typeof this.params.startSaveCallBack&&n.then((function(){t.params.startSaveCallBack({id:t.id,type:"startSave",code:0})}))["catch"]((function(){t.params.startSaveCallBack({id:t.id,type:"startSave",code:-1})})),n):(this.Theme&&this.Theme.setDecoderState({recordvideo:!0}),new Promise((function(e){e(n)})))}},{key:"stopSave",value:function(){var e=this,t=this.jSPlugin.JS_StopSave(0);return f(t)?("function"===typeof this.params.startSaveCallBack&&t.then((function(){e.params.stopSaveCallBack({id:e.id,type:"stopSave",code:0})}))["catch"]((function(){e.params.stopSaveCallBack({id:e.id,type:"stopSave",code:-1})})),t):(this.Theme&&this.Theme.setDecoderState({recordvideo:!1}),new Promise((function(e){e(t)})))}},{key:"openSound",value:function(){var e=this.jSPlugin.JS_OpenSound(0);return console.log("打开声音",e),f(e)?e:(this.Theme&&this.Theme.setDecoderState({sound:!0}),"function"===typeof this.params.openSoundCallBack&&this.params.openSoundCallBack({id:this.id,type:"openSound",code:e}),new Promise((function(t){t(e)})))}},{key:"closeSound",value:function(){var e=this.jSPlugin.JS_CloseSound(0);return f(e)?e:(this.Theme&&this.Theme.setDecoderState({sound:!1}),"function"===typeof this.params.closeSoundCallBack&&this.params.closeSoundCallBack({id:this.id,type:"closeSound",code:e}),new Promise((function(t){t(e)})))}},{key:"enableZoom",value:function(){var e=this.jSPlugin.JS_EnableZoom(0);return f(e)?e:new Promise((function(t){t(e)}))}},{key:"closeZoom",value:function(){var e=this.jSPlugin.JS_DisableZoom(0);return f(e)?e:new Promise((function(t){t(e)}))}},{key:"setPoster",value:function(e){We()?document.getElementById("".concat(this.id))&&(document.getElementById("".concat(this.id)).style.backgroundImage="url(".concat(e,")"),document.getElementById("".concat(this.id)).style.backgroundSize="100% 100%"):document.getElementById("".concat(this.id,"canvas0"))&&(document.getElementById("".concat(this.id,"canvas0")).style.backgroundImage="url(".concat(e,")"),document.getElementById("".concat(this.id,"canvas0")).style.backgroundSize="cover")}},{key:"reSize",value:function(e,t){var n=0,i=0;if(this.params.height=t,this.params.width=e,this.Theme&&this.Theme.isNeedRenderHeader&&document.getElementById("".concat(this.id,"-headControl"))&&(n=parseInt(document.getElementById("".concat(this.id,"-headControl")).style.height,10)),this.Theme&&this.Theme.isNeedRenderTimeLine&&!this.isMobile&&(i=48),t=t-n-i,this.width=e,this.height=t,document.getElementById("".concat(this.id,"-wrap")).style="width:".concat(e,"px;position:relative;display:inline-block;vertical-align: bottom;"),document.getElementById("".concat(this.id)).style.width=e+"px",document.getElementById("".concat(this.id)).style.height=t+"px",this.jSPlugin&&this.jSPlugin.bPlay)this.jSPlugin&&(this.jSPlugin.iHeight=t,this.jSPlugin.iWidth=e),this.jSPlugin.JS_Resize(e,t);else{document.getElementById("".concat(this.id,"-player"))&&(document.getElementById("".concat(this.id,"-player")).width=e,document.getElementById("".concat(this.id,"-player")).height=t,document.getElementById("".concat(this.id,"-player")).style.width=e+"px",document.getElementById("".concat(this.id,"-player")).style.height=t+"px");var o=1;if(document.getElementById("".concat(this.id,"canvas0"))){var r=navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i);r&&(o=2),document.getElementById("".concat(this.id,"canvas0")).style.width=e*o+"px",document.getElementById("".concat(this.id,"canvas0")).style.height=t*o+"px",document.getElementById("".concat(this.id,"canvas0")).width=e*o,document.getElementById("".concat(this.id,"canvas0")).height=t*o,document.getElementById("".concat(this.id,"canvas0")).parentNode.style.width=e*o+"px",document.getElementById("".concat(this.id,"canvas0")).parentNode.style.height=t*o+"px",document.getElementById("".concat(this.id,"canvas_draw0")).height=t*o}this.jSPlugin&&(this.jSPlugin.iHeight=t*o,this.jSPlugin.iWidth=e*o)}}},{key:"fast",value:function(e){var t=this,n=this.speed;if(e)var i=this.jSPlugin.JS_Fast(0,e);else{if(1===n)n=2;else{if(2!==n)return"function"===typeof this.params.handleError&&this.params.handleError({msg:"播放速度最大为4倍速度",retcode:1003,id:this.id,type:"handleError"}),new Promise((function(e,i){t.speed=n,i({code:-1,data:{speed:n,result:"播放速度最大为4倍速度"}})}));n=4}i=this.jSPlugin.JS_Fast(0)}return new Promise((function(e){t.speed=n,e({code:0,data:{speed:n,result:i}})}))}},{key:"slow",value:function(){var e=this,t=this.speed;if(4===t)t=2;else{if(2!==t)return"function"===typeof this.params.handleError&&this.params.handleError({msg:"播放速度最小为1倍速度",retcode:1003,id:this.id,type:"handleError"}),new Promise((function(n,i){e.speed=t,i({code:-1,data:{speed:t,result:"播放速度最小为1倍速度"}})}));t=1}var n=this.jSPlugin.JS_Slow(0);return new Promise((function(i){e.speed=t,i({code:0,data:{speed:t,result:n}})}))}},{key:"seek",value:function(e,t){var n=this.url,i=(g("begin",n)||(new Date).Format("yyyyMMdd")).substr(0,8);if(t=o(i,"235959"),6===e.length)e=o(i,e);else{if(16!==e.length)return"function"===typeof this.params.handleError&&this.params.handleError({msg:"seek时间格式错误",retcode:-1,id:this.id,type:"handleError"}),!1;if(e.substr(0,8)!==i)return"function"===typeof this.params.handleError&&this.params.handleError({msg:"seek时间不能跨日期",retcode:-1,id:this.id,type:"handleError"}),!1}function o(e,t){var n=/^[0-9]{8}T[0-9]{6}Z$/;if(n.test(e))return e;if(/[0-9]{8,14}/.test(e)){var i=6-(14-e.length),o=t.length,r=e+t.substring(i,o);return r.slice(0,8)+"T"+r.slice(8)+"Z"}throw new Error("回放时间格式有误,请确认")}var r=this.jSPlugin.JS_Seek(0,e,t);return console.log("seekRT",r),f(r)?r:new Promise((function(e){e(r)}))}},{key:"fullScreen",value:function(){var e=this,t=S(document.getElementById("".concat(this.id)));t.then((function(t){console.log("全屏promise",window.screen.availWidth),e.jSPlugin.JS_Resize(window.screen.availWidth,window.screen.availHeight),"function"===typeof e.params.fullScreenCallBack&&e.params.fullScreenCallBack({id:e.id,type:"fullScreen",code:0})}));var n=function(){var t=document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen;t||e.jSPlugin.JS_Resize(e.width,e.height),"function"===typeof e.params.fullScreenChangeCallBack&&e.params.fullScreenChangeCallBack({id:e.id,type:"fullScreen",code:t})};["fullscreenchange","webkitfullscreenchange","mozfullscreenchange"].forEach((function(e){window.addEventListener(e,(function(e){return n()}))}))}},{key:"cancelFullScreen",value:function(){var e=this,t=w();t.then((function(t){console.log("取消全屏",t,e.jSPlugin),e.jSPlugin.JS_Resize(e.width,e.height)}))}},{key:"startTalk",value:function(){this.Talk.startTalk()}},{key:"stopTalk",value:function(){this.Talk.stopTalk()}},{key:"destroy",value:function(){var e=this.jSPlugin.JS_DestroyWorker(0);return this.Theme&&(this.Theme=null,window.EZUIKit[this.params.id].state.EZUIKitPlayer.themeInit=!1),f(e)?e:new Promise((function(t){t(e)}))}},{key:"getDeviceCapacity",value:function(){var e=this,t=this.env.domain;this.env&&(t=this.env.domain);var n=t+"/api/lapp/device/capacity",i=function(t){200==t.code&&t.data&&(e.capacity=t.data)},o={accessToken:this.accessToken,deviceSerial:P(this.url).deviceSerial};E(n,"POST",o,"",i)}},{key:"pause",value:function(){var e=this;return this.reSetTheme(),new Promise((function(t,n){e.jSPlugin.JS_CloseSound(0),e.jSPlugin.JS_Pause(0).then((function(n){e.Theme&&e.Theme.setDecoderState({play:!1}),t()}))["catch"]((function(e){console.log(e),n(e)}))}))}},{key:"_resume",value:function(e){var t=this;return new Promise((function(n){t.pluginStatus.setPlayStatus({play:!1,loading:!0}),t.jSPlugin.JS_Resume(e).then((function(e){if(-1!==t.url.indexOf(".rec")&&t.Theme&&1!==t.Theme.nextRate&&t.jSPlugin.JS_Speed(t.Theme.nextRate),t.Theme){t.Theme.setDecoderState({play:!0});var i=t.Theme.decoderState.state.sound;i&&setTimeout((function(){t.openSound()}),500)}n(e)}))["catch"]((function(e){console.log("resume err",e)}))}))}}]),e}();(function(e,t){"object"===d(n)&&"object"===d(n.exports)?n.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("EZUIPlayer requires a window with a document");return t(e)}:t(e)})("undefined"!==typeof window?window:void 0,(function(e,t){var n={Core:p,HLS:I,FLV:x,EZUIKitPlayer:Ze};return e.EZUIKit=n,n}))}).call(this,n("c8ba"),n("62e4")(e))}}]);