zby_web_sdk
Version:
直播云webSDK
1 lines • 482 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.WebSdk=e():t.WebSdk=e()}(window,function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=27)}([function(t,e,n){"use strict";var o,r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};o=function(){return this}();try{o=o||Function("return this")()||(0,eval)("this")}catch(t){"object"===("undefined"==typeof window?"undefined":r(window))&&(o=window)}t.exports=o},function(t,e,n){"use strict";(function(t){var o=n(46),r=n(47),i=n(48),s=n(49),a=n(50),l=n(51),c=navigator.userAgent.match(/Android/i),u=/PhantomJS/i.test(navigator.userAgent),p=c||u;e.protocol=3;var f=e.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},h=o(f),d={type:"error",data:"parser error"},y=n(52);function v(t,e,n){for(var o=new Array(t.length),r=a(t.length,n),i=function(t,n,r){e(n,function(e,n){o[t]=n,r(e,o)})},s=0;s<t.length;s++)i(s,t[s],r)}e.encodePacket=function(n,o,r,i){"function"==typeof o&&(i=o,o=!1),"function"==typeof r&&(i=r,r=null);var s=void 0===n.data?void 0:n.data.buffer||n.data;if(t.ArrayBuffer&&s instanceof ArrayBuffer)return function(t,n,o){if(!n)return e.encodeBase64Packet(t,o);var r=t.data,i=new Uint8Array(r),s=new Uint8Array(1+r.byteLength);s[0]=f[t.type];for(var a=0;a<i.length;a++)s[a+1]=i[a];return o(s.buffer)}(n,o,i);if(y&&s instanceof t.Blob)return function(t,n,o){if(!n)return e.encodeBase64Packet(t,o);if(p)return function(t,n,o){if(!n)return e.encodeBase64Packet(t,o);var r=new FileReader;return r.onload=function(){t.data=r.result,e.encodePacket(t,n,!0,o)},r.readAsArrayBuffer(t.data)}(t,n,o);var r=new Uint8Array(1);r[0]=f[t.type];var i=new y([r.buffer,t.data]);return o(i)}(n,o,i);if(s&&s.base64)return function(t,n){var o="b"+e.packets[t.type]+t.data.data;return n(o)}(n,i);var a=f[n.type];return void 0!==n.data&&(a+=r?l.encode(String(n.data)):String(n.data)),i(""+a)},e.encodeBase64Packet=function(n,o){var r,i="b"+e.packets[n.type];if(y&&n.data instanceof t.Blob){var s=new FileReader;return s.onload=function(){var t=s.result.split(",")[1];o(i+t)},s.readAsDataURL(n.data)}try{r=String.fromCharCode.apply(null,new Uint8Array(n.data))}catch(t){for(var a=new Uint8Array(n.data),l=new Array(a.length),c=0;c<a.length;c++)l[c]=a[c];r=String.fromCharCode.apply(null,l)}return i+=t.btoa(r),o(i)},e.decodePacket=function(t,n,o){if("string"==typeof t||void 0===t){if("b"==t.charAt(0))return e.decodeBase64Packet(t.substr(1),n);if(o)try{t=l.decode(t)}catch(t){return d}var r=t.charAt(0);return Number(r)==r&&h[r]?t.length>1?{type:h[r],data:t.substring(1)}:{type:h[r]}:d}r=new Uint8Array(t)[0];var s=i(t,1);return y&&"blob"===n&&(s=new y([s])),{type:h[r],data:s}},e.decodeBase64Packet=function(e,n){var o=h[e.charAt(0)];if(!t.ArrayBuffer)return{type:o,data:{base64:!0,data:e.substr(1)}};var r=s.decode(e.substr(1));return"blob"===n&&y&&(r=new y([r])),{type:o,data:r}},e.encodePayload=function(t,n,o){"function"==typeof n&&(o=n,n=null);var i=r(t);if(n&&i)return y&&!p?e.encodePayloadAsBlob(t,o):e.encodePayloadAsArrayBuffer(t,o);if(!t.length)return o("0:");v(t,function(t,o){e.encodePacket(t,!!i&&n,!0,function(t){o(null,function(t){return t.length+":"+t}(t))})},function(t,e){return o(e.join(""))})},e.decodePayload=function(t,n,o){if("string"!=typeof t)return e.decodePayloadAsBinary(t,n,o);var r;if("function"==typeof n&&(o=n,n=null),""==t)return o(d,0,1);for(var i,s,a="",l=0,c=t.length;l<c;l++){var u=t.charAt(l);if(":"!=u)a+=u;else{if(""==a||a!=(i=Number(a)))return o(d,0,1);if(a!=(s=t.substr(l+1,i)).length)return o(d,0,1);if(s.length){if(r=e.decodePacket(s,n,!0),d.type==r.type&&d.data==r.data)return o(d,0,1);if(!1===o(r,l+i,c))return}l+=i,a=""}}return""!=a?o(d,0,1):void 0},e.encodePayloadAsArrayBuffer=function(t,n){if(!t.length)return n(new ArrayBuffer(0));v(t,function(t,n){e.encodePacket(t,!0,!0,function(t){return n(null,t)})},function(t,e){var o=e.reduce(function(t,e){var n;return t+(n="string"==typeof e?e.length:e.byteLength).toString().length+n+2},0),r=new Uint8Array(o),i=0;return e.forEach(function(t){var e="string"==typeof t,n=t;if(e){for(var o=new Uint8Array(t.length),s=0;s<t.length;s++)o[s]=t.charCodeAt(s);n=o.buffer}r[i++]=e?0:1;var a=n.byteLength.toString();for(s=0;s<a.length;s++)r[i++]=parseInt(a[s]);r[i++]=255;for(o=new Uint8Array(n),s=0;s<o.length;s++)r[i++]=o[s]}),n(r.buffer)})},e.encodePayloadAsBlob=function(t,n){v(t,function(t,n){e.encodePacket(t,!0,!0,function(t){var e=new Uint8Array(1);if(e[0]=1,"string"==typeof t){for(var o=new Uint8Array(t.length),r=0;r<t.length;r++)o[r]=t.charCodeAt(r);t=o.buffer,e[0]=0}var i=(t instanceof ArrayBuffer?t.byteLength:t.size).toString(),s=new Uint8Array(i.length+1);for(r=0;r<i.length;r++)s[r]=parseInt(i[r]);if(s[i.length]=255,y){var a=new y([e.buffer,s.buffer,t]);n(null,a)}})},function(t,e){return n(new y(e))})},e.decodePayloadAsBinary=function(t,n,o){"function"==typeof n&&(o=n,n=null);for(var r=t,s=[],a=!1;r.byteLength>0;){for(var l=new Uint8Array(r),c=0===l[0],u="",p=1;255!=l[p];p++){if(u.length>310){a=!0;break}u+=l[p]}if(a)return o(d,0,1);r=i(r,2+u.length),u=parseInt(u);var f=i(r,0,u);if(c)try{f=String.fromCharCode.apply(null,new Uint8Array(f))}catch(t){var h=new Uint8Array(f);f="";for(p=0;p<h.length;p++)f+=String.fromCharCode(h[p])}s.push(f),r=i(r,u)}var y=s.length;s.forEach(function(t,r){o(e.decodePacket(t,n,!0),r,y)})}}).call(this,n(0))},function(t,e,n){"use strict";var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function r(){var t;try{t=e.storage.debug}catch(t){}return t}(e=t.exports=n(33)).log=function(){return"object"===("undefined"==typeof console?"undefined":o(console))&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},e.formatArgs=function(){var t=arguments,n=this.useColors;if(t[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+t[0]+(n?"%c ":" ")+"+"+e.humanize(this.diff),!n)return t;var o="color: "+this.color,r=0,i=0;return(t=[t[0],o,"color: inherit"].concat(Array.prototype.slice.call(t,1)))[0].replace(/%[a-z%]/g,function(t){"%%"!==t&&"%c"===t&&(i=++r)}),t.splice(i,0,o),t},e.save=function(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=t}catch(t){}},e.load=r,e.useColors=function(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31},e.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),e.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],e.formatters.j=function(t){return JSON.stringify(t)},e.enable(r())},function(t,e,n){"use strict";t.exports=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)}},function(t,e,n){"use strict";t.exports=function(t,e){var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},function(t,e,n){"use strict";var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function r(){var t;try{t=e.storage.debug}catch(t){}return t}(e=t.exports=n(53)).log=function(){return"object"===("undefined"==typeof console?"undefined":o(console))&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},e.formatArgs=function(){var t=arguments,n=this.useColors;if(t[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+t[0]+(n?"%c ":" ")+"+"+e.humanize(this.diff),!n)return t;var o="color: "+this.color,r=0,i=0;return(t=[t[0],o,"color: inherit"].concat(Array.prototype.slice.call(t,1)))[0].replace(/%[a-z%]/g,function(t){"%%"!==t&&"%c"===t&&(i=++r)}),t.splice(i,0,o),t},e.save=function(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=t}catch(t){}},e.load=r,e.useColors=function(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31},e.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),e.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],e.formatters.j=function(t){return JSON.stringify(t)},e.enable(r())},function(t,e,n){"use strict";var o=n(35)("socket.io-parser"),r=n(38),i=(n(3),n(39)),s=n(40),a=n(14);function l(){}function c(t){var n="",i=!1;return n+=t.type,e.BINARY_EVENT!=t.type&&e.BINARY_ACK!=t.type||(n+=t.attachments,n+="-"),t.nsp&&"/"!=t.nsp&&(i=!0,n+=t.nsp),null!=t.id&&(i&&(n+=",",i=!1),n+=t.id),null!=t.data&&(i&&(n+=","),n+=r.stringify(t.data)),o("encoded %j as %s",t,n),n}function u(){this.reconstructor=null}function p(t){this.reconPack=t,this.buffers=[]}function f(t){return{type:e.ERROR,data:"parser error"}}e.protocol=4,e.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],e.CONNECT=0,e.DISCONNECT=1,e.EVENT=2,e.ACK=3,e.ERROR=4,e.BINARY_EVENT=5,e.BINARY_ACK=6,e.Encoder=l,e.Decoder=u,l.prototype.encode=function(t,n){(o("encoding packet %j",t),e.BINARY_EVENT==t.type||e.BINARY_ACK==t.type)?function(t,e){s.removeBlobs(t,function(t){var n=s.deconstructPacket(t),o=c(n.packet),r=n.buffers;r.unshift(o),e(r)})}(t,n):n([c(t)])},i(u.prototype),u.prototype.add=function(t){var n;if("string"==typeof t)n=function(t){var n={},i=0;if(n.type=Number(t.charAt(0)),null==e.types[n.type])return f();if(e.BINARY_EVENT==n.type||e.BINARY_ACK==n.type){for(var s="";"-"!=t.charAt(++i)&&(s+=t.charAt(i),i!=t.length););if(s!=Number(s)||"-"!=t.charAt(i))throw new Error("Illegal attachments");n.attachments=Number(s)}if("/"==t.charAt(i+1))for(n.nsp="";++i;){var a=t.charAt(i);if(","==a)break;if(n.nsp+=a,i==t.length)break}else n.nsp="/";var l=t.charAt(i+1);if(""!==l&&Number(l)==l){for(n.id="";++i;){var a=t.charAt(i);if(null==a||Number(a)!=a){--i;break}if(n.id+=t.charAt(i),i==t.length)break}n.id=Number(n.id)}if(t.charAt(++i))try{n.data=r.parse(t.substr(i))}catch(t){return f()}return o("decoded %s as %j",t,n),n}(t),e.BINARY_EVENT==n.type||e.BINARY_ACK==n.type?(this.reconstructor=new p(n),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",n)):this.emit("decoded",n);else{if(!a(t)&&!t.base64)throw new Error("Unknown type: "+t);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(n=this.reconstructor.takeBinaryData(t))&&(this.reconstructor=null,this.emit("decoded",n))}},u.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},p.prototype.takeBinaryData=function(t){if(this.buffers.push(t),this.buffers.length==this.reconPack.attachments){var e=s.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null},p.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},function(t,e){(function(e){t.exports=e}).call(this,{})},function(t,e,n){"use strict";var o=n(44);t.exports=function(t){var e=t.xdomain,n=t.xscheme,r=t.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!e||o))return new XMLHttpRequest}catch(t){}try{if("undefined"!=typeof XDomainRequest&&!n&&r)return new XDomainRequest}catch(t){}if(!e)try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}},function(t,e,n){"use strict";var o=n(1),r=n(10);function i(t){this.path=t.path,this.hostname=t.hostname,this.port=t.port,this.secure=t.secure,this.query=t.query,this.timestampParam=t.timestampParam,this.timestampRequests=t.timestampRequests,this.readyState="",this.agent=t.agent||!1,this.socket=t.socket,this.enablesXDR=t.enablesXDR,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized,this.extraHeaders=t.extraHeaders}t.exports=i,r(i.prototype),i.prototype.onError=function(t,e){var n=new Error(t);return n.type="TransportError",n.description=e,this.emit("error",n),this},i.prototype.open=function(){return"closed"!=this.readyState&&""!=this.readyState||(this.readyState="opening",this.doOpen()),this},i.prototype.close=function(){return"opening"!=this.readyState&&"open"!=this.readyState||(this.doClose(),this.onClose()),this},i.prototype.send=function(t){if("open"!=this.readyState)throw new Error("Transport not open");this.write(t)},i.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},i.prototype.onData=function(t){var e=o.decodePacket(t,this.socket.binaryType);this.onPacket(e)},i.prototype.onPacket=function(t){this.emit("packet",t)},i.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},function(t,e,n){"use strict";function o(t){if(t)return function(t){for(var e in o.prototype)t[e]=o.prototype[e];return t}(t)}t.exports=o,o.prototype.on=o.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks[t]=this._callbacks[t]||[]).push(e),this},o.prototype.once=function(t,e){var n=this;function o(){n.off(t,o),e.apply(this,arguments)}return this._callbacks=this._callbacks||{},o.fn=e,this.on(t,o),this},o.prototype.off=o.prototype.removeListener=o.prototype.removeAllListeners=o.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,o=this._callbacks[t];if(!o)return this;if(1==arguments.length)return delete this._callbacks[t],this;for(var r=0;r<o.length;r++)if((n=o[r])===e||n.fn===e){o.splice(r,1);break}return this},o.prototype.emit=function(t){this._callbacks=this._callbacks||{};var e=[].slice.call(arguments,1),n=this._callbacks[t];if(n)for(var o=0,r=(n=n.slice(0)).length;o<r;++o)n[o].apply(this,e);return this},o.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks[t]||[]},o.prototype.hasListeners=function(t){return!!this.listeners(t).length}},function(t,e,n){"use strict";e.encode=function(t){var e="";for(var n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e},e.decode=function(t){for(var e={},n=t.split("&"),o=0,r=n.length;o<r;o++){var i=n[o].split("=");e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e}},function(t,e,n){"use strict";var o=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,r=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];t.exports=function(t){var e=t,n=t.indexOf("["),i=t.indexOf("]");-1!=n&&-1!=i&&(t=t.substring(0,n)+t.substring(n,i).replace(/:/g,";")+t.substring(i,t.length));for(var s=o.exec(t||""),a={},l=14;l--;)a[r[l]]=s[l]||"";return-1!=n&&-1!=i&&(a.source=e,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a}},function(t,e,n){"use strict";t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";(function(e){t.exports=function(t){return e.Buffer&&e.Buffer.isBuffer(t)||e.ArrayBuffer&&t instanceof ArrayBuffer}}).call(this,n(0))},function(t,e,n){"use strict";var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=n(41),i=n(20),s=n(21),a=n(6),l=n(22),c=n(23),u=n(2)("socket.io-client:manager"),p=n(19),f=n(61),h=Object.prototype.hasOwnProperty;function d(t,e){if(!(this instanceof d))return new d(t,e);t&&"object"==(void 0===t?"undefined":o(t))&&(e=t,t=void 0),(e=e||{}).path=e.path||"/socket.io",this.nsps={},this.subs=[],this.opts=e,this.reconnection(!1!==e.reconnection),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor(e.randomizationFactor||.5),this.backoff=new f({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==e.timeout?2e4:e.timeout),this.readyState="closed",this.uri=t,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[],this.encoder=new a.Encoder,this.decoder=new a.Decoder,this.autoConnect=!1!==e.autoConnect,this.autoConnect&&this.open()}t.exports=d,d.prototype.emitAll=function(){for(var t in this.emit.apply(this,arguments),this.nsps)h.call(this.nsps,t)&&this.nsps[t].emit.apply(this.nsps[t],arguments)},d.prototype.updateSocketIds=function(){for(var t in this.nsps)h.call(this.nsps,t)&&(this.nsps[t].id=this.engine.id)},s(d.prototype),d.prototype.reconnection=function(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection},d.prototype.reconnectionAttempts=function(t){return arguments.length?(this._reconnectionAttempts=t,this):this._reconnectionAttempts},d.prototype.reconnectionDelay=function(t){return arguments.length?(this._reconnectionDelay=t,this.backoff&&this.backoff.setMin(t),this):this._reconnectionDelay},d.prototype.randomizationFactor=function(t){return arguments.length?(this._randomizationFactor=t,this.backoff&&this.backoff.setJitter(t),this):this._randomizationFactor},d.prototype.reconnectionDelayMax=function(t){return arguments.length?(this._reconnectionDelayMax=t,this.backoff&&this.backoff.setMax(t),this):this._reconnectionDelayMax},d.prototype.timeout=function(t){return arguments.length?(this._timeout=t,this):this._timeout},d.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},d.prototype.open=d.prototype.connect=function(t){if(u("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;u("opening %s",this.uri),this.engine=r(this.uri,this.opts);var e=this.engine,n=this;this.readyState="opening",this.skipReconnect=!1;var o=l(e,"open",function(){n.onopen(),t&&t()}),i=l(e,"error",function(e){if(u("connect_error"),n.cleanup(),n.readyState="closed",n.emitAll("connect_error",e),t){var o=new Error("Connection error");o.data=e,t(o)}else n.maybeReconnectOnOpen()});if(!1!==this._timeout){var s=this._timeout;u("connect attempt will timeout after %d",s);var a=setTimeout(function(){u("connect attempt timed out after %d",s),o.destroy(),e.close(),e.emit("error","timeout"),n.emitAll("connect_timeout",s)},s);this.subs.push({destroy:function(){clearTimeout(a)}})}return this.subs.push(o),this.subs.push(i),this},d.prototype.onopen=function(){u("open"),this.cleanup(),this.readyState="open",this.emit("open");var t=this.engine;this.subs.push(l(t,"data",c(this,"ondata"))),this.subs.push(l(t,"ping",c(this,"onping"))),this.subs.push(l(t,"pong",c(this,"onpong"))),this.subs.push(l(t,"error",c(this,"onerror"))),this.subs.push(l(t,"close",c(this,"onclose"))),this.subs.push(l(this.decoder,"decoded",c(this,"ondecoded")))},d.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},d.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},d.prototype.ondata=function(t){this.decoder.add(t)},d.prototype.ondecoded=function(t){this.emit("packet",t)},d.prototype.onerror=function(t){u("error",t),this.emitAll("error",t)},d.prototype.socket=function(t){var e=this.nsps[t];if(!e){e=new i(this,t),this.nsps[t]=e;var n=this;e.on("connecting",o),e.on("connect",function(){e.id=n.engine.id}),this.autoConnect&&o()}function o(){~p(n.connecting,e)||n.connecting.push(e)}return e},d.prototype.destroy=function(t){var e=p(this.connecting,t);~e&&this.connecting.splice(e,1),this.connecting.length||this.close()},d.prototype.packet=function(t){u("writing packet %j",t);var e=this;e.encoding?e.packetBuffer.push(t):(e.encoding=!0,this.encoder.encode(t,function(n){for(var o=0;o<n.length;o++)e.engine.write(n[o],t.options);e.encoding=!1,e.processPacketQueue()}))},d.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var t=this.packetBuffer.shift();this.packet(t)}},d.prototype.cleanup=function(){var t;for(u("cleanup");t=this.subs.shift();)t.destroy();this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},d.prototype.close=d.prototype.disconnect=function(){u("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,"opening"==this.readyState&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},d.prototype.onclose=function(t){u("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",t),this._reconnection&&!this.skipReconnect&&this.reconnect()},d.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var t=this;if(this.backoff.attempts>=this._reconnectionAttempts)u("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var e=this.backoff.duration();u("will wait %dms before reconnect attempt",e),this.reconnecting=!0;var n=setTimeout(function(){t.skipReconnect||(u("attempting reconnect"),t.emitAll("reconnect_attempt",t.backoff.attempts),t.emitAll("reconnecting",t.backoff.attempts),t.skipReconnect||t.open(function(e){e?(u("reconnect attempt error"),t.reconnecting=!1,t.reconnect(),t.emitAll("reconnect_error",e.data)):(u("reconnect success"),t.onreconnect())}))},e);this.subs.push({destroy:function(){clearTimeout(n)}})}},d.prototype.onreconnect=function(){var t=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",t)}},function(t,e,n){"use strict";(function(t){var o=n(8),r=n(45),i=n(55),s=n(56);e.polling=function(e){var n=!1,s=!1,a=!1!==e.jsonp;if(t.location){var l="https:"==location.protocol,c=location.port;c||(c=l?443:80),n=e.hostname!=location.hostname||c!=e.port,s=e.secure!=l}if(e.xdomain=n,e.xscheme=s,"open"in new o(e)&&!e.forceJSONP)return new r(e);if(!a)throw new Error("JSONP disabled");return new i(e)},e.websocket=s}).call(this,n(0))},function(t,e,n){"use strict";var o=n(9),r=n(11),i=n(1),s=n(4),a=n(18),l=n(5)("engine.io-client:polling");t.exports=u;var c=null!=new(n(8))({xdomain:!1}).responseType;function u(t){var e=t&&t.forceBase64;c&&!e||(this.supportsBinary=!1),o.call(this,t)}s(u,o),u.prototype.name="polling",u.prototype.doOpen=function(){this.poll()},u.prototype.pause=function(t){var e=this;function n(){l("paused"),e.readyState="paused",t()}if(this.readyState="pausing",this.polling||!this.writable){var o=0;this.polling&&(l("we are currently polling - waiting to pause"),o++,this.once("pollComplete",function(){l("pre-pause polling complete"),--o||n()})),this.writable||(l("we are currently writing - waiting to pause"),o++,this.once("drain",function(){l("pre-pause writing complete"),--o||n()}))}else n()},u.prototype.poll=function(){l("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},u.prototype.onData=function(t){var e=this;l("polling got data %s",t);i.decodePayload(t,this.socket.binaryType,function(t,n,o){if("opening"==e.readyState&&e.onOpen(),"close"==t.type)return e.onClose(),!1;e.onPacket(t)}),"closed"!=this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"==this.readyState?this.poll():l('ignoring poll - transport state "%s"',this.readyState))},u.prototype.doClose=function(){var t=this;function e(){l("writing close packet"),t.write([{type:"close"}])}"open"==this.readyState?(l("transport open - closing"),e()):(l("transport not open - deferring close"),this.once("open",e))},u.prototype.write=function(t){var e=this;this.writable=!1;var n=function(){e.writable=!0,e.emit("drain")};e=this;i.encodePayload(t,this.supportsBinary,function(t){e.doWrite(t,n)})},u.prototype.uri=function(){var t=this.query||{},e=this.secure?"https":"http",n="";return!1!==this.timestampRequests&&(t[this.timestampParam]=a()),this.supportsBinary||t.sid||(t.b64=1),t=r.encode(t),this.port&&("https"==e&&443!=this.port||"http"==e&&80!=this.port)&&(n=":"+this.port),t.length&&(t="?"+t),e+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+n+this.path+t}},function(t,e,n){"use strict";var o,r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),i=64,s={},a=0,l=0;function c(t){var e="";do{e=r[t%i]+e,t=Math.floor(t/i)}while(t>0);return e}function u(){var t=c(+new Date);return t!==o?(a=0,o=t):t+"."+c(a++)}for(;l<i;l++)s[r[l]]=l;u.encode=c,u.decode=function(t){var e=0;for(l=0;l<t.length;l++)e=e*i+s[t.charAt(l)];return e},t.exports=u},function(t,e,n){"use strict";var o=[].indexOf;t.exports=function(t,e){if(o)return t.indexOf(e);for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1}},function(t,e,n){"use strict";var o=n(6),r=n(21),i=n(59),s=n(22),a=n(23),l=n(2)("socket.io-client:socket"),c=n(60);t.exports=f;var u={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},p=r.prototype.emit;function f(t,e){this.io=t,this.nsp=e,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,this.io.autoConnect&&this.open()}r(f.prototype),f.prototype.subEvents=function(){if(!this.subs){var t=this.io;this.subs=[s(t,"open",a(this,"onopen")),s(t,"packet",a(this,"onpacket")),s(t,"close",a(this,"onclose"))]}},f.prototype.open=f.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),"open"==this.io.readyState&&this.onopen(),this.emit("connecting"),this)},f.prototype.send=function(){var t=i(arguments);return t.unshift("message"),this.emit.apply(this,t),this},f.prototype.emit=function(t){if(u.hasOwnProperty(t))return p.apply(this,arguments),this;var e=i(arguments),n=o.EVENT;c(e)&&(n=o.BINARY_EVENT);var r={type:n,data:e,options:{}};return r.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof e[e.length-1]&&(l("emitting packet with ack id %d",this.ids),this.acks[this.ids]=e.pop(),r.id=this.ids++),this.connected?this.packet(r):this.sendBuffer.push(r),delete this.flags,this},f.prototype.packet=function(t){t.nsp=this.nsp,this.io.packet(t)},f.prototype.onopen=function(){l("transport is open - connecting"),"/"!=this.nsp&&this.packet({type:o.CONNECT})},f.prototype.onclose=function(t){l("close (%s)",t),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",t)},f.prototype.onpacket=function(t){if(t.nsp==this.nsp)switch(t.type){case o.CONNECT:this.onconnect();break;case o.EVENT:case o.BINARY_EVENT:this.onevent(t);break;case o.ACK:case o.BINARY_ACK:this.onack(t);break;case o.DISCONNECT:this.ondisconnect();break;case o.ERROR:this.emit("error",t.data)}},f.prototype.onevent=function(t){var e=t.data||[];l("emitting event %j",e),null!=t.id&&(l("attaching ack callback to event"),e.push(this.ack(t.id))),this.connected?p.apply(this,e):this.receiveBuffer.push(e)},f.prototype.ack=function(t){var e=this,n=!1;return function(){if(!n){n=!0;var r=i(arguments);l("sending ack %j",r);var s=c(r)?o.BINARY_ACK:o.ACK;e.packet({type:s,id:t,data:r})}}},f.prototype.onack=function(t){var e=this.acks[t.id];"function"==typeof e?(l("calling ack %s with %j",t.id,t.data),e.apply(this,t.data),delete this.acks[t.id]):l("bad ack %s",t.id)},f.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},f.prototype.emitBuffered=function(){var t;for(t=0;t<this.receiveBuffer.length;t++)p.apply(this,this.receiveBuffer[t]);for(this.receiveBuffer=[],t=0;t<this.sendBuffer.length;t++)this.packet(this.sendBuffer[t]);this.sendBuffer=[]},f.prototype.ondisconnect=function(){l("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},f.prototype.destroy=function(){if(this.subs){for(var t=0;t<this.subs.length;t++)this.subs[t].destroy();this.subs=null}this.io.destroy(this)},f.prototype.close=f.prototype.disconnect=function(){return this.connected&&(l("performing disconnect (%s)",this.nsp),this.packet({type:o.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},f.prototype.compress=function(t){return this.flags=this.flags||{},this.flags.compress=t,this}},function(t,e,n){"use strict";function o(t){if(t)return function(t){for(var e in o.prototype)t[e]=o.prototype[e];return t}(t)}t.exports=o,o.prototype.on=o.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},o.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},o.prototype.off=o.prototype.removeListener=o.prototype.removeAllListeners=o.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,o=this._callbacks["$"+t];if(!o)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var r=0;r<o.length;r++)if((n=o[r])===e||n.fn===e){o.splice(r,1);break}return this},o.prototype.emit=function(t){this._callbacks=this._callbacks||{};var e=[].slice.call(arguments,1),n=this._callbacks["$"+t];if(n)for(var o=0,r=(n=n.slice(0)).length;o<r;++o)n[o].apply(this,e);return this},o.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},o.prototype.hasListeners=function(t){return!!this.listeners(t).length}},function(t,e,n){"use strict";t.exports=function(t,e,n){return t.on(e,n),{destroy:function(){t.removeListener(e,n)}}}},function(t,e,n){"use strict";var o=[].slice;t.exports=function(t,e){if("string"==typeof e&&(e=t[e]),"function"!=typeof e)throw new Error("bind() requires a function");var n=o.call(arguments,2);return function(){return e.apply(t,n.concat(o.call(arguments)))}}},function(t,e,n){"use strict";var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(t){return"function"==typeof t}function s(t){return"object"===(void 0===t?"undefined":o(t))&&null!==t}function a(t){return void 0===t}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(t){if(!function(t){return"number"==typeof t}(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},r.prototype.emit=function(t){var e,n,o,r,l,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||s(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var u=new Error('Uncaught, unspecified "error" event. ('+e+")");throw u.context=e,u}if(a(n=this._events[t]))return!1;if(i(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:r=Array.prototype.slice.call(arguments,1),n.apply(this,r)}else if(s(n))for(r=Array.prototype.slice.call(arguments,1),o=(c=n.slice()).length,l=0;l<o;l++)c[l].apply(this,r);return!0},r.prototype.addListener=function(t,e){var n;if(!i(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,i(e.listener)?e.listener:e),this._events[t]?s(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,s(this._events[t])&&!this._events[t].warned&&(n=a(this._maxListeners)?r.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[t].length>n&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(t,e){if(!i(e))throw TypeError("listener must be a function");var n=!1;function o(){this.removeListener(t,o),n||(n=!0,e.apply(this,arguments))}return o.listener=e,this.on(t,o),this},r.prototype.removeListener=function(t,e){var n,o,r,a;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=(n=this._events[t]).length,o=-1,n===e||i(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(s(n)){for(a=r;a-- >0;)if(n[a]===e||n[a].listener&&n[a].listener===e){o=a;break}if(o<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(o,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},r.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(i(n=this._events[t]))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},r.prototype.listeners=function(t){return this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},r.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},r.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(t,e){if(s(e))throw"obj is empty";t.map(function(t){var n=t.split("|");if(n.length>1){if(!(n.filter(function(t){var n=t.replace(/(^\s*)|(\s*$)/g,""),o=i(n,e),r=o.value;o.path;return!s(r)}).length>0))throw"fields [ "+n.join(", ")+" ] are all null or undefined"}else{var o=i(t,e),r=o.value,a=o.path;if(s(r)){if(null===r)throw a+" is null";if(void 0===r)throw a+" is not defined"}}})},i=function(t,e){for(var n=t.split("."),o=e,r=0;r<n.length;r++){if(o=o[n[r]],r===n.length-1)return{value:o,path:t};if(r<n.length-1&&s(o))return{value:o,path:n.slice(0,r+1).join(".")}}},s=function(t){if(void 0===t)return!0;if("object"===(void 0===t?"undefined":o(t))){if(null===t)return!0;if(t instanceof Array&&0===t.length)return!0;if(t instanceof Object&&"{}"===JSON.stringify(t))return!0}return"string"==typeof t&&""===t};function a(t,e){for(var n in e)e.hasOwnProperty(n)&&!t.hasOwnProperty(n)&&(t[n]=e[n])}e.extend=a,e.optionsValid=r,e.isNullOrEmpty=s,e.default={extend:a,optionsValid:r,isNullOrEmpty:s}},function(t,e,n){"use strict";var o,r,i=t.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function l(t){if(o===setTimeout)return setTimeout(t,0);if((o===s||!o)&&setTimeout)return o=setTimeout,setTimeout(t,0);try{return o(t,0)}catch(e){try{return o.call(null,t,0)}catch(e){return o.call(this,t,0)}}}!function(){try{o="function"==typeof setTimeout?setTimeout:s}catch(t){o=s}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var c,u=[],p=!1,f=-1;function h(){p&&c&&(p=!1,c.length?u=c.concat(u):f=-1,u.length&&d())}function d(){if(!p){var t=l(h);p=!0;for(var e=u.length;e;){for(c=u,u=[];++f<e;)c&&c[f].run();f=-1,e=u.length}c=null,p=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function y(t,e){this.fun=t,this.array=e}function v(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];u.push(new y(t,e)),1!==u.length||p||l(d)},y.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),r=function t(e,n,o){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,o)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(o):void 0},i=h(n(28)),a=h(n(30)),l=h(n(63)),c=n(75),u=n(76),p=n(77),f=n(80);function h(t){return t&&t.__esModule?t:{default:t}}window.onload=function(){!(0,u.hasFlash)()&&(0,u.isPC)()&&(document.getElementsByClassName("flash-tip")[0].style.cssText="display: block")};var d=["class.classId","class.teacherId","class.videoMode","class.classType","user.userId","user.userImg","user.username","user.usercode | user.usertoken","video.id"],y=void 0,v=void 0,m=void 0,g=void 0,b=void 0,_=void 0,j=function(t,e){var n=g?"test-":"",o=location.protocol+"//"+n+"api.weclassroom.com/service/ini/class",r={client_type:(0,u.isPC)()?"flash":"h5",app_id:"0",room_id:t.class.classId,room_type:"code"==t.class.classType?1:2,user_id:t.user.userId,user_type:"student",lang:"zh",teacher_id:t.class.teacherId,version:"1.0.0.0"},s=[];for(var a in r)s.push(a+"="+r[a]);var l=s.sort().join("&"),c=(0,i.default)(l),f=(0,i.default)(c+"7qIdL2kdYQzecQJplq8QXfzpolOgUGOM");r.sign=f,r.main=1,(0,p.post)(o,function(n){if(console.log("云控返回参数:",n),n.status)if(m||"1"!=t.class.videoMode)e(n);else var o=setInterval(function(){m&&(clearInterval(o),e(n))},1e3)},r)},w=null,T=null,k=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=t.class,o=t.video,i=t.user,s=t.datas;g=s.is_test,b=n.videoMode;var a=o;a.urls=[],a.onVideoEvents=function(t,e){return u.emit("videoStatus",t,e)},a.config=s,a.autoplay="1"==n.videoMode;var l={uid:i.userId,class_id:n.classId,course_id:n.courseId,teacher_master_id:n.teacherId,teacher_assist_id:n.assistId,chapter_id:n.chapterId,videotype:"1"==n.videoMode?"live":"vod"};(0,c.extend)(a.config,l);var u=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,Object.assign({device:2,userRole:"student",canTalk:1,url:s.is_test?"https://test-large-im.weclassroom.com":"https://large-im.weclassroom.com"},n,o,i,s,a)));return j(t,function(o){var i=[];if("1"==n.videoMode)for(var s=o.data.new_pull_list,l=0;l<s.length;l++){var c=s[l];i.push({lineid:c.lineid,name:"线路"+(l+1),url:c.url.replace("{sid}",m),streamid:m,supplier:c.supplier})}else if("2"==n.videoMode)for(var p=o.data.vodUrls.split(";"),f=0;f<p.length;f++){var h=p[f];i.push({name:"网络"+(f+1),lineid:f,url:h+"/vod/zby/_"+n.classId+"_"+n.teacherId+"_7.mp4",streamid:"_"+n.classId+"_"+n.teacherId+"_7",type:"mp4"})}a.urls=i,console.log("!!!=========",i),r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setStreamUrls",u).call(u,i),w=t,"function"==typeof T&&T(t)}),u.imInit(),u}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,(0,f.mix)(a.default,l.default)),o(e,[{key:"version",get:function(){return"1.1.1"}}]),o(e,[{key:"initWeb",value:function(){var t=this;w?this._initWeb(w):T=function(e){t._initWeb(e)}}},{key:"initializer",value:function(t){var n=this;this.sendMsg=function(t,o){null!=t&&""!=t?"string"==typeof t?t.length>500?console.log("输入消息长度不能500!"):"function"==typeof o?r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"sendMsg",n).call(n,t,o):console.log("输入cb参数类型错误"):console.log("输入msg参数类型错误"):console.log("未传入参数msg!")},this._play=function(){"1"==b?r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"playCurrent",n).call(n):r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"play",n).call(n)},this.changeLine=function(t){/^[0-9]+.?[0-9]*$/.test(t)?r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"changeLine",n).call(n,t):console.log("输入线路参数 i 不正确!")},this.currentTime=function(t){if("1"!=b)if("number"==typeof t){var o=Number(t);/^[0-9]+.?[0-9]*$/.test(o)?(t=o>n.video.duration()?n.video.duration()-1:t,r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"currentTime",n).call(n,t),console.log(n.video.paused()),n.video.paused()&&(r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"play",n).call(n),setTimeout(function(){r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"pause",n).call(n)},500))):console.log("输入时间 i 格式不正确!")}else console.log("输入时间 i 格式不正确!");else console.log("当前是直播,不允许设置播放时间!")},this.width=function(t){var o=Number(t);/^[0-9]+.?[0-9]*$/.test(o)?0!=o?o<50?console.log("宽度不能小于50!"):o>5e3?console.log("宽度不能大于5000!"):r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"width",n).call(n,o):console.log("宽度不能为空或0!"):console.log("输入参数w不正确!")},this.height=function(t){var o=Number(t);null==t&&console.log("未传入参数 h !"),/^[0-9]+.?[0-9]*$/.test(o)?0!=o?o<50?console.log("高度度不能小于50!"):o>5e3?console.log("高度度不能大于5000!"):r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"height",n).call(n,t):console.log("高度不能为为空或0!"):console.log("输入参数h不正确!")},this.sendQuestion=function(t){void 0!==y&&""!=y?(null!=t&&""!=t||console.log("未传入参数s!"),"string"==typeof t?"xz"!=v||"A"==t||"B"==t||"C"==t||"D"==t?"pd"!=v||"R"==t||"W"==t?"td"!=v||"Y"==t||"N"==t?r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"sendQuestion",n).call(n,t):console.log("提供的答案应是Y或者N!"):console.log("提供的答案应与判断题答案类型相符!"):console.log("提供的答案应与选择题答案类型相符!"):console.log("输入答案参数类型错误!")):console.log("未发现题目信息!")},this.getCurrentTime=function(){if(n.video)return n.video.currentTime();console.log("videosdk未初始化")},this.getFullTime=function(){return n.video.duration()},this.getVolume=function(){return n.video.volume()},this.setVolume=function(t){if(null!=t){var e=Number(t);/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/.test(e)?n.video.volume(t):console.log("输入参数0~1之间")}else console.log("未输入音量参数!")}}},{key:"imInit",value:function(){var t=this;this.on("handlerConnected",function(){t.emit("connected")}),this.on("handlerExit",function(){t.emit("forceExit"),r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setStatus",t).call(t,3),t.dispose()}),this.on("handlerMsg",function(e,n){var o=void 0;"picture"==e.mtype&&(o='<img src="'+JSON.parse(e.message).url+'"alt="图片加载未成功">');var r={history:void 0!==n,avatar:e.avatar,username:e.username,message:"message"==e.mtype?e.message:o};t.emit("message",r)}),this.on("handlerStatusChange",function(n){"1"==b&&(t.emit("statusChange",n),n&&"03"==n.code&&_&&(r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"playCurrent",t).call(t),r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setStatus",t).call(t,2),_=!1),n&&"04"==n.code&&(_=!0,r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"pause",t).call(t),r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setStatus",t).call(t,0)))}),this.on("handlerOnlineCounts",function(e){t.emit("onlineCounts",e)}),this.on("handlerDisconnect",function(){t.emit("disconnect")}),this.on("handlerClassStarted",function(n){"1"==b&&(console.log("=========!!!",t),r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setStatus",t).call(t,2),t.emit("classStarted",n))}),this.on("handlerClassEnded",function(n){"1"==b&&(r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setStatus",t).call(t,3),t.emit("classEnded",n),r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"dispose",t).call(t))}),this.on("handlerAddStream",function(e){var n={streamUrl:e.streamUrl,screenStreamUrl:e.screenStreamUrl,teacherStreamUrl:e.teacherStreamUrl};m=e.streamUrl,t.emit("addStream",n)}),this.on("handlerChatEnable",function(){t.emit("chatEnable")}),this.on("handlerChatDisable",function(){t.emit("chatDisable")}),this.on("handlerCameraClosed",function(){"1"==b&&t.emit("cameraClosed")}),this.on("handlerCameraOpened",function(){"1"==b&&t.emit("cameraOpened")}),this.on("handlerNotice",function(e){var n=e.message,o=(0,u.suitToHtml)(n);t.emit("notice",o)}),this.on("handlerQuestion",function(e){if(v=e.command.args.type,y=e.command.id,"start"==e.command.cmd){var n={qid:e.command.id,tid:e.command.args.tid,type:v};t.emit("questionStart",n)}else y="",t.emit("questionEnd")}),this.on("handlerStreamTalker",function(e){t.emit("streamTalker",e)}),this.on("handlerEnableTalk",function(e){"1"==b&&t.emit("enableTalk",e)}),this.on("handlerInterconnect",function(){"1"==b&&t.emit("interconnect",s)}),this.on("handlerMoveTalkWin",function(e){t.emit("moveTalkWin",e)}),this.initIm()}},{key:"_initWeb",value:function(t){var e=this;(0,c.optionsValid)(d,t);var n=t.video;n.urls=[],n.onVideoEvents=function(t,n){return e.emit("videoStatus",t,n)},n.config=t.datas,n.autoplay="1"==t.class.videoMode;var o={uid:t.user.userId,class_id:t.class.classId,course_id:t.class.courseId,teacher_master_id:t.class.teacherId,teacher_assist_id:t.class.assistId,chapter_id:t.class.chapterId,videotype:"1"==t.class.videoMode?"live":"vod"};(0,c.extend)(n.config,o),this.initVideo()}}]),e}();e.default=k},function(t,e,n){"use strict";var o=n(29);t.exports=function(t){return Array.isArray(t)&&(t=t.join("")),o(t)}},function(t,e,n){"use strict";t.exports=function(t){for(var e=function(t){var e,n=1+(t.length+8>>6),o=new Array(16*n);for(e=0;e<16*n;e++)o[e]=0;for(e=0;e<t.length;e++)o[e>>2]|=t.charCodeAt(e)<<(8*t.length+e)%4*8;o[e>>2]|=128<<(8*t.length+e)%4*8;var r=8*t.length;return o[16*n-2]=255&r,o[16*n-2]|=(r>>>8&255)<<8,o[16*n-2]|=(r>>>16&255)<<16,o[16*n-2]|=(r>>>24&255)<<24,o}(t),n=1732584193,o=-271733879,r=-1732584194,i=271733878,s=0;s<e.length;s+=16){var c=n,d=o,y=r,v=i;n=u(n,o,r,i,e[s+0],7,-680876936),i=u(i,n,o,r,e[s+1],12,-389564586),r=u(r,i,n,o,e[s+2],17,606105819),o=u(o,r,i,n,e[s+3],22,-1044525330),n=u(n,o,r,i,e[s+4],7,-176418897),i=u(i,n,o,r,e[s+5],12,1200080426),r=u(r,i,n,o,e[s+6],17,-1473231341),o=u(o,r,i,n,e[s+7],22,-45705983),n=u(n,o,r,i,e[s+8],7,1770035416),i=u(i,n,o,r,e[s+9],12,-1958414417),r=u(r,i,n,o,e[s+10],17,-42063),o=u(o,r,i,n,e[s+11],22,-1990404162),n=u(n,o,r,i,e[s+12],7,1804603682),i=u(i,n,o,r,e[s+13],12,-40341101),r=u(r,i,n,o,e[s+14],17,-1502002290),o=u(o,r,i,n,e[s+15],22,1236535329),n=p(n,o,r,i,e[s+1],5,-165796510),i=p(i,n,o,r,e[s+6],9,-1069501632),r=p(r,i,n,o,e[s+11],14,643717713),o=p(o,r,i,n,e[s+0],20,-373897302),n=p(n,o,r,i,e[s+5],5,-701558691),i=p(i,n,o,r,e[s+10],9,38016083),r=p(r,i,n,o,e[s+15],14,-660478335),o=p(o,r,i,n,e[s+4],20,-405537848),n=p(n,o,r,i,e[s+9],5,568446438),i=p(i,n,o,r,e[s+14],9,-1019803690),r=p(r,i,n,o,e[s+3],14,-187363961),o=p(o,r,i,n,e[s+8],20,1163531501),n=p(n,o,r,i,e[s+13],5,-1444681467),i=p(i,n,o,r,e[s+2],9,-51403784),r=p(r,i,n,o,e[s+7],14,1735328473),o=p(o,r,i,n,e[s+12],20,-1926607734),n=f(n,o,r,i,e[s+5],4,-378558),i=f(i,n,o,r,e[s+8],11,-2022574463),r=f(r,i,n,o,e[s+11],16,1839030562),o=f(o,r,i,n,e[s+14],23,-35309556),n=f(n,o,r,i,e[s+1],4,-1530992060),i=f(i,n,o,r,e[s+4],11,1272893353),r=f(r,i,n,o,e[s+7],16,-155497632),o=f(o,r,i,n,e[s+10],23,-1094730640),n=f(n,o,r,i,e[s+13],4,681279174),i=f(i,n,o,r,e[s+0],11,-358537222),r=f(r,i,n,o,e[s+3],16,-722521979),o=f(o,r,i,n,e[s+6],23,76029189),n=f(n,o,r,i,e[s+9],4,-640364487),i=f(i,n,o,r,e[s+12],11,-421815835),r=f(r,i,n,o,e[s+15],16,530742520),o=f(o,r,i,n,e[s+2],23,-995338651),n=h(n,o,r,i,e[s+0],6,-198630844),i=h(i,n,o,r,e[s+7],10,1126891415),r=h(r,i,n,o,e[s+14],15,-1416354905),o=h(o,r,i,n,e[s+5],21,-57434055),n=h(n,o,r,i,e[s+12],6,1700485571),i=h(i,n,o,r,e[s+3],1