goldvideo-player
Version:
goldplay-h265player
2 lines • 297 kB
JavaScript
/*! GoldPlay built @6/28/2020, 11:46:42 AM */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.GoldPlay=t():e.GoldPlay=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=162)}([function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t,n){var r=n(11),i=n(1);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?i(e):t}},function(e,t,n){var r=n(48);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},,function(e,t){e.exports=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}},function(e,t,n){"use strict";n.d(t,"c",(function(){return r})),n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return a})),n.d(t,"d",(function(){return o}));var r={projectName:"GOLDPLAY",projectAbbreviation:"GP",mode:"production",basePath:"./",get distPath(){var e="";return"development"==this.mode?e="/dist/":"test"==this.mode&&(e="/dist/"),e},get libPath(){return this.distPath+"lib/"},hideBarBoxTime:300,speedList:[{name:"0.5X",value:.5},{name:"1.0X",value:1},{name:"1.5X",value:1.5},{name:"2.0X",value:2},{name:"3.0X",value:3}]},i={maxDuration:30,maxSize:1024e6,maxRetryCount:3},a=1/9e4,o={READYBUFFERLENGTH:1e3,MAXBUFFERLENGTH:5e3}},function(e,t,n){"use strict";var r=n(2),i=n.n(r),a=n(3),o=n.n(a),s=n(0),u=n.n(s),l=n(9),c=console||{};function h(e,t){if(c[e]){if(this.disabled||this.level<0)return;if("production"===l.c.mode&&("error"!==e||"warn"!==e))return;if(1===this.level&&["info"].includes(e))return;if(2===this.level&&["log","info"].includes(e))return;if(this.level>2&&"error"!==e)return;for(var n=(new Date).toLocaleString(),r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];var o=["[32m".concat(t,"[39m")].concat(i,[n]);"error"!==e&&"warn"!==e||(o=[t].concat(i,[n])),"function"==typeof c[e]&&c[e].apply(c,o)}}var f=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i()(this,e),u()(this,"prefix",l.c.projectName),u()(this,"joiner",">"),u()(this,"left","["),u()(this,"right","]"),u()(this,"disabled",!1),u()(this,"level",0),Object.assign(this,n),"string"==typeof t?this.file=t:t&&t.constructor&&(this.file=t.constructor.name)}return o()(e,[{key:"setDisabled",value:function(e){this.disabled=e}},{key:"setLevel",value:function(e){this.level=e}}],[{key:"get",value:function(t,n){return new e(t,n)}}]),e}();["info","log","debug","warn","error"].forEach((function(e){f.prototype[e]=function(t,n){n=void 0===n?"":this.joiner+n;for(var r=this.left+t+n+this.right,i=this.left+this.prefix+" "+this.file+this.right+r,a=arguments.length,o=new Array(a>2?a-2:0),s=2;s<a;s++)o[s-2]=arguments[s];h.apply(this,[e,i].concat(o))}})),t.a=f},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},,,,,,,function(e,t,n){e.exports=n(88)},,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(2),i=n.n(r),a=n(3),o=n.n(a),s=n(0),u=n.n(s),l=n(9),c={eval:EvalError,range:RangeError,reference:ReferenceError,syntax:SyntaxError,type:TypeError,uri:URIError,default:Error},h=null,f=(h||(h=new(function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1001;return i()(this,e),u()(this,"type",""),u()(this,"errorName","DefaultError"),u()(this,"code",null),u()(this,"message",""),u()(this,"stack",""),this.type=t,this.code=n,this.throws.bind(this)}return o()(e,[{key:"throws",value:function(e){for(var t="",n=Error,r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];if(e instanceof Error){for(var o in c)if(e instanceof c[o]){this.errorName=c[o].name,n=e.constructor;break}this.stack=e.stack,i&&i.splice&&(t=i[0],i.splice(0,1))}else t=e.toString();this.message="[".concat(l.c.projectName," ERROR:")+this.type+"-"+this.code+"]"+t;try{throw new n(this.message,"[args]:",i)}catch(e){this.stack=this.stack||e.stack,console.error(e,"[message]:",t,"[args]:",i)}}}]),e}())),h)},function(e,t){e.exports=function(e,t){var n=t.get(e);if(!n)throw new TypeError("attempted to get private field on non-instance");return n.get?n.get.call(e):n.value}},,,function(e,t,n){var r=n(48),i=n(86);function a(t,n,o){return i()?e.exports=a=Reflect.construct:e.exports=a=function(e,t,n){var i=[null];i.push.apply(i,t);var a=new(Function.bind.apply(e,i));return n&&r(a,n.prototype),a},a.apply(null,arguments)}e.exports=a},function(e,t){function n(e,t,n,r,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(i,a){var o=e.apply(t,r);function s(e){n(o,i,a,s,u,"next",e)}function u(e){n(o,i,a,s,u,"throw",e)}s(void 0)}))}}},function(e,t){e.exports=function(e,t,n){var r=t.get(e);if(!r)throw new TypeError("attempted to set private field on non-instance");if(r.set)r.set.call(e,n);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=n}return n}},,,,,function(e,t,n){var r=n(4),i=n(48),a=n(87),o=n(27);function s(t){var n="function"==typeof Map?new Map:void 0;return e.exports=s=function(e){if(null===e||!a(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return o(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),i(t,e)},s(t)}e.exports=s},,,,,,,,,,function(e,t,n){function r(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n.oe=function(e){throw console.error(e),e};var r=n(n.s=ENTRY_MODULE);return r.default||r}var i="\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)";function a(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function o(e,t,r){var o={};o[r]=[];var s=t.toString(),u=s.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!u)return o;for(var l,c=u[1],h=new RegExp("(\\\\n|\\W)"+a(c)+i,"g");l=h.exec(s);)"dll-reference"!==l[3]&&o[r].push(l[3]);for(h=new RegExp("\\("+a(c)+'\\("(dll-reference\\s([\\.|\\-|\\+|\\w|/|@]+))"\\)\\)'+i,"g");l=h.exec(s);)e[l[2]]||(o[r].push(l[1]),e[l[2]]=n(l[1]).m),o[l[2]]=o[l[2]]||[],o[l[2]].push(l[4]);for(var f,d=Object.keys(o),p=0;p<d.length;p++)for(var y=0;y<o[d[p]].length;y++)f=o[d[p]][y],isNaN(1*f)||(o[d[p]][y]=1*o[d[p]][y]);return o}function s(e){return Object.keys(e).reduce((function(t,n){return t||e[n].length>0}),!1)}e.exports=function(e,t){t=t||{};var i={main:n.m},a=t.all?{main:Object.keys(i.main)}:function(e,t){for(var n={main:[t]},r={main:[]},i={main:{}};s(n);)for(var a=Object.keys(n),u=0;u<a.length;u++){var l=a[u],c=n[l].pop();if(i[l]=i[l]||{},!i[l][c]&&e[l][c]){i[l][c]=!0,r[l]=r[l]||[],r[l].push(c);for(var h=o(e,e[l][c],l),f=Object.keys(h),d=0;d<f.length;d++)n[f[d]]=n[f[d]]||[],n[f[d]]=n[f[d]].concat(h[f[d]])}}return r}(i,e),u="";Object.keys(a).filter((function(e){return"main"!==e})).forEach((function(e){for(var t=0;a[e][t];)t++;a[e].push(t),i[e][t]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",u=u+"var "+e+" = ("+r.toString().replace("ENTRY_MODULE",JSON.stringify(t))+")({"+a[e].map((function(t){return JSON.stringify(t)+": "+i[e][t].toString()})).join(",")+"});\n"})),u=u+"new (("+r.toString().replace("ENTRY_MODULE",JSON.stringify(e))+")({"+a.main.map((function(e){return JSON.stringify(e)+": "+i.main[e].toString()})).join(",")+"}))(self);";var l=new window.Blob([u],{type:"text/javascript"});if(t.bare)return l;var c=(window.URL||window.webkitURL||window.mozURL||window.msURL).createObjectURL(l),h=new window.Worker(c);return h.objectURL=c,h}},function(e,t,n){var r,i,a;i=[],void 0===(a="function"==typeof(r=function(){var e=function(){},t={},n={},r={};function i(e,t){if(e){var i=r[e];if(n[e]=t,i)for(;i.length;)i[0](e,t),i.splice(0,1)}}function a(t,n){t.call&&(t={success:t}),n.length?(t.error||e)(n):(t.success||e)(t)}function o(t,n,r,i){var a,s,u=document,l=r.async,c=(r.numRetries||0)+1,h=r.before||e,f=t.replace(/[\?|#].*$/,""),d=t.replace(/^(css|img)!/,"");i=i||0,/(^css!|\.css$)/.test(f)?((s=u.createElement("link")).rel="stylesheet",s.href=d,(a="hideFocus"in s)&&s.relList&&(a=0,s.rel="preload",s.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(f)?(s=u.createElement("img")).src=d:((s=u.createElement("script")).src=t,s.async=void 0===l||l),s.onload=s.onerror=s.onbeforeload=function(e){var u=e.type[0];if(a)try{s.sheet.cssText.length||(u="e")}catch(e){18!=e.code&&(u="e")}if("e"==u){if((i+=1)<c)return o(t,n,r,i)}else if("preload"==s.rel&&"style"==s.as)return s.rel="stylesheet";n(t,u,e.defaultPrevented)},!1!==h(t,s)&&u.head.appendChild(s)}function s(e,n,r){var s,u;if(n&&n.trim&&(s=n),u=(s?r:n)||{},s){if(s in t)throw"LoadJS";t[s]=!0}function l(t,n){!function(e,t,n){var r,i,a=(e=e.push?e:[e]).length,s=a,u=[];for(r=function(e,n,r){if("e"==n&&u.push(e),"b"==n){if(!r)return;u.push(e)}--a||t(u)},i=0;i<s;i++)o(e[i],r,n)}(e,(function(e){a(u,e),t&&a({success:t,error:n},e),i(s,e)}),u)}if(u.returnPromise)return new Promise(l);l()}return s.ready=function(e,t){return function(e,t){e=e.push?e:[e];var i,a,o,s=[],u=e.length,l=u;for(i=function(e,n){n.length&&s.push(e),--l||t(s)};u--;)a=e[u],(o=n[a])?i(a,o):(r[a]=r[a]||[]).push(i)}(e,(function(e){a(t,e)})),s},s.done=function(e){i(e,[])},s.reset=function(){t={},n={},r={}},s.isDefined=function(e){return e in t},s})?r.apply(t,i):r)||(e.exports=a)},,,function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t){!function(){"use strict";function t(e,t){throw new Error("abstract")}t.prototype.drawFrame=function(e){throw new Error("abstract")},t.prototype.clear=function(){throw new Error("abstract")},e.exports=t}()},,,,,,,,,,,function(e,t){var n={validateDimension:function(e){if(e<=0||e!==(0|e))throw"YUV plane dimensions must be a positive integer"},validateOffset:function(e){if(e<0||e!==(0|e))throw"YUV plane offsets must be a non-negative integer"},format:function(e){var t=e.width,n=e.height,r=e.chromaWidth||t,i=e.chromaHeight||n,a=e.cropLeft||0,o=e.cropTop||0,s=e.cropWidth||t-a,u=e.cropHeight||n-o,l=e.displayWidth||s,c=e.displayHeight||u;return this.validateDimension(t),this.validateDimension(n),this.validateDimension(r),this.validateDimension(i),this.validateOffset(a),this.validateOffset(o),this.validateDimension(s),this.validateDimension(u),this.validateDimension(l),this.validateDimension(c),{width:t,height:n,chromaWidth:r,chromaHeight:i,cropLeft:a,cropTop:o,cropWidth:s,cropHeight:u,displayWidth:l,displayHeight:c}},allocPlane:function(e,t){return n.validateDimension(e),n.validateDimension(t),{bytes:new Uint8Array(e*t),stride:e}},suitableStride:function(e){n.validateDimension(e);var t=e%4;return 0==t?e:e+(4-t)},allocPlane:function(e,t,n,r,i){var a,o;if(this.validateDimension(e),this.validateDimension(t),i=i||0,r=r||this.suitableStride(e),this.validateDimension(r),r<e)throw"Invalid input stride for YUV plane; must be larger than width";if(a=r*t,n){if(n.length-i<a)throw"Invalid input buffer for YUV plane; must be large enough for stride times height";o=n.slice(i,i+a)}else o=new Uint8Array(a),r=r||this.suitableStride(e);return{bytes:o,stride:r}},lumaPlane:function(e,t,n,r){return this.allocPlane(e.width,e.height,t,n,r)},chromaPlane:function(e,t,n,r){return this.allocPlane(e.chromaWidth,e.chromaHeight,t,n,r)},frame:function(e,t,n,r){return{format:e,y:t=t||this.lumaPlane(e),u:n=n||this.chromaPlane(e),v:r=r||this.chromaPlane(e)}},copyPlane:function(e){return{bytes:e.bytes.slice(),stride:e.stride}},copyFrame:function(e){return{format:e.format,y:this.copyPlane(e.y),u:this.copyPlane(e.u),v:this.copyPlane(e.v)}},transferables:function(e){return[e.y.bytes.buffer,e.u.bytes.buffer,e.v.bytes.buffer]}};e.exports=n},function(e,t,n){var r=n(95),i=n(96),a=n(97),o=n(99);e.exports=function(e,t){return r(e)||i(e,t)||a(e,t)||o()}},,,,,,,,,,,function(e,t,n){!function(){"use strict";var t=n(49),r=n(89),i=n(92),a={FrameSink:t,SoftwareFrameSink:r,WebGLFrameSink:i,attach:function(e,t){return("webGL"in(t=t||{})?t.webGL:i.isAvailable())?new i(e,t):new r(e,t)}};e.exports=a}()},,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(2),i=n.n(r),a=n(3),o=n.n(a),s=n(5),u=n.n(s),l=n(4),c=n.n(l),h=n(1),f=n.n(h),d=n(6),p=n.n(d),y=n(0),v=n.n(y),g=n(24),m=n.n(g),b=n(29),k=n.n(b),w=n(10),P=w.a.get("Events.js"),_=function(){function e(t){i()(this,e),v()(this,"eventsQueue",{}),v()(this,"target",{}),v()(this,"disallowRepeat",!1),this.target=t}return o()(e,[{key:"add",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var u=o.value;this.on(u,t,n)}}catch(e){i=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw a}}}},{key:"on",value:function(e,t,n){if(void 0===this.eventsQueue[e]&&(this.eventsQueue[e]={methods:[],once:!1}),"function"==typeof t){if(!this.disallowRepeat||!this.eventsQueue[e].methods.includes(t))return this.eventsQueue[e].methods.push(t),void 0!==n&&(this.eventsQueue[e].once=n),this.target}else P.error("on","the argument is not function.",t)}},{key:"once",value:function(e,t){this.on(e,t,!0)}},{key:"off",value:function(e,t){var n=this.eventsQueue[e];if(n){var r=n.methods;if(t)for(var i=r.length;i--;)r[i]===t&&r.splice(i,1);else delete this.eventsQueue[e];return this.target}}},{key:"emit",value:function(e){for(var t=this,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var a=this.eventsQueue[e];if(a){var o=a.methods;return o.forEach((function(e){e.apply(t.target,r)})),a.once&&this.off(e),this.target}}},{key:"clear",value:function(e){delete this.eventsQueue[e]}},{key:"clearAll",value:function(){this.eventsQueue={}}}]),e}(),x=function(e){var t=new _(e);return function(e){return t.target=e,t}},B=n(11),T=n.n(B),E=w.a.get("Element.js"),L=function(){function e(){i()(this,e)}return o()(e,null,[{key:"createEl",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1?arguments[1]:void 0;if("string"!=typeof e)return E.error("please input element name"),null;var n=document.createElement(e,t);return n}},{key:"registerElement",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:HTMLElement,n=arguments.length>2?arguments[2]:void 0,r=document.registerElement(e,{prototype:Object.create(t.prototype),extends:n});return r}},{key:"addEl",value:function(e,t){if(e&&t)try{t.appendChild(e)}catch(e){E.error(e)}}},{key:"removeEl",value:function(e){try{var t=e.parentNode;t&&t.removeChild(e)}catch(e){E.error(e)}}},{key:"addClass",value:function(e){try{for(var t,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(t=e.classList).add.apply(t,r)}catch(e){E.error(e)}}},{key:"removeClass",value:function(){}},{key:"hasClass",value:function(){}},{key:"isElement",value:function(e){try{return e instanceof HTMLElement}catch(t){return"object"===T()(e)&&1===e.nodeType&&"object"===T()(e.style)&&"object"===T()(e.ownerDocument)}}},{key:"setAttributes",value:function(t,n){if(e.isElement(t))for(var r=0,i=n.length;r<i;r++){var a=n[r],o=a.name;o=a.name.replace(/["|']/g,""),t.setAttribute(o,a.value)}}},{key:"syncAttributes",value:function(t,n){var r=n.attributes;e.setAttributes(t,r);var i=t.attributes;e.setAttributes(n,i)}},{key:"getClientWidth",value:function(){return document.documentElement.clientWidth?document.documentElement.clientWidth:document.body.clientWidth}},{key:"getClientHeight",value:function(){return document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight}},{key:"adaptSizeElement",value:function(e,t,n,r){var i=n,a=r;a.width=e||a.width||i.offsetWidth,a.height=t||a.height||i.offsetHeight;var o=a.width,s=a.height,u=0;a.style.position="absolute",i.offsetWidth<=0&&(i.style.width=o+"px"),i.offsetHeight<=0&&(i.style.height=s+"px");var l=i.offsetWidth/o,c=i.offsetHeight/s;u=c>l?l:c,a.style.top=i.offsetTop+(i.offsetHeight-s*u)/2+"px",a.style.left=i.offsetLeft+(i.offsetWidth-o*u)/2+"px",a.style.transform="scale(".concat(u,", ").concat(u,")"),a.style["transform-origin"]="top left",a.style.display="inline-block"}}]),e}(),S=n(27),C=n.n(S),A=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i()(this,e),v()(this,"logger",null),v()(this,"__instance__",null),v()(this,"__singleton__",null),this.options=t,this.setLogger(this.constructor.name+".js")}return o()(e,[{key:"setLogger",value:function(e){this.logger=new w.a(e)}},{key:"getLogger",value:function(){return this.logger}},{key:"setOptions",value:function(e){Object.assign(this.options,e)}},{key:"toString",value:function(){return JSON.stringify(this)}},{key:"events",get:function(){return this.options&&this.options.events?this.options.events(this):x(this)}}],[{key:"getInstance",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.__instance__=C()(this,t),this.__instance__}},{key:"getSingleton",value:function(){if(!this.__singleton__){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.__singleton__=C()(this,t)}return this.__singleton__}}]),e}(),D=function(e){function t(e){var n;return i()(this,t),n=u()(this,c()(t).call(this)),v()(f()(n),"component",null),n.component=e.component,n}return p()(t,e),o()(t,[{key:"confirm",value:function(){}},{key:"show",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.component.data.content=e,"default"!==this.component.data.display&&""!==this.component.data.display||this.component.showBox(),"show"!==this.component.data.display&&this.component.show()}},{key:"hide",value:function(){this.component.hide()}}]),t}(A),R=n(23),O=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i()(this,e),v()(this,"logger",null),this.options=t,this.debug=t.debug||!1,this.setLogger(this.constructor.name+".js")}return o()(e,[{key:"setLogger",value:function(e){this.logger=new w.a(e)}},{key:"getLogger",value:function(){return this.logger}},{key:"setOptions",value:function(e){Object.assign(this.options,e)}},{key:"toString",value:function(){return JSON.stringify(this)}},{key:"events",get:function(){return this.options&&this.options.events?this.options.events(this):x(this)}},{key:"alert",get:function(){var e="";return this.options&&this.options.alertError&&(e=this.options.alertError),e}}]),e}(),M=n(9),U=function(e){function t(){var e;return i()(this,t),e=u()(this,c()(t).call(this)),v()(f()(e),"loadData",null),v()(f()(e),"sourceURL",""),e}return p()(t,e),o()(t,[{key:"init",value:function(){}},{key:"setLoadData",value:function(e){this.loadData=e}},{key:"setSourceURL",value:function(e){this.sourceURL=e}},{key:"getLoadData",value:function(){return this.getLoadData}},{key:"getSourceURL",value:function(){return this.getSourceURL}}]),t}(O),N={LOAD_PLAYLIST:10,get 10(){return"loading playlist"},LOADED_PLAYLIST:11,get 11(){return"playlist is loaded"},IDLE:0,get 0(){return"is free"},LOADING:1,get 1(){return"loading segment"},DONE:2,get 2(){return"segment is loaded"},ERROR:3,get 3(){return"load get error"}},I=w.a.get("M3U8Parser.js",{level:2}),H={lineDelimiter:/\r?\n/,extensionHeader:"#EXTM3U",tagPrefix:"#EXT",segmentPrefix:"#EXTINF",segmentParse:/^#EXTINF: *([0-9.]+)(, *(.+?)?)?$/,tagParse:/^#EXT-X-([A-Z-]+)(:(.+))?$/,version:"VERSION",allowCache:"ALLOW-CACHE",combined:"COMBINED",endList:"ENDLIST",targetDuration:"TARGETDURATION",mediaSequence:"MEDIA-SEQUENCE",discontinuity:"DISCONTINUITY",steamInf:"STREAM-INF",isComment:function(e){return e&&"#"===e[0]&&!e.startsWith(H.tagPrefix)},isBlank:function(e){return""===e},canStrip:function(e){return H.isBlank(e)||H.isComment(e)}},F=0,j=1,W={file:void 0,name:void 0,start:0,end:0,discontinuity:void 0,duration:void 0},V=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i()(this,e),v()(this,"source",""),v()(this,"segments",[]),v()(this,"_currentSegment",null),v()(this,"discontinuous",null),v()(this,"tags",{VERSION:void 0,TARGETDURATION:void 0}),v()(this,"_state",null),this.source=t,this.options=n,this.parse(this.source)}return o()(e,[{key:"readSegment",value:function(e){var t=H.segmentParse.exec(e);if(null!==t){var n=parseFloat(t[1],10),r=t[3];n%1!=0&&this.tags.VERSION>=3&&I.info("readsegment","Version must be 3 or higher to support floating.","duration:",n),n<this.tags.TARGETDURATION&&I.info("readsegment","Segment duration must be less than the TARGETDURATION","duration:",n),n*=1e3,this._currentSegment=Object.assign({},W,{duration:n,name:r,discontinuity:this.discontinuous});var i=this.segments[this.segments.length-1]||{start:0,end:0};this._currentSegment.start=i.end,this._currentSegment.end=i.end+n,this.discontinuous=!1,this._state=j}else I.warn("readsegment","read segment failed","line:",e)}},{key:"readTag",value:function(e){var t=H.tagParse.exec(e);if(null!==t)return{name:t[1],value:t[3]}}},{key:"readLine",value:function(e){if(e.startsWith(H.segmentPrefix))return this.readSegment(e);var t=this.readTag(e);if(t)switch(t.name){case H.version:this.tags.VERSION=parseFloat(t.value,10);break;case H.mediaSequence:this.tags.MEDIA_SEQUENCE=parseFloat(t.value,10);break;case H.allowCache:this.tags.ALLOW_CACHE=!!/\s*(YES|yes)\s*/.test(t.value);break;case H.discontinuity:this.tags.DISCONTINUITY=!0,this.discontinuous=!0;break;case H.targetDuration:this.tags.TARGETDURATION=parseFloat(t.value,10);break;case H.combined:this.tags.COMBINED=t.value;break;case H.streamInf:this.tags.STREAM_INF=t.value;break;case H.endList:this.tags.ENDLIST="EOF";break;default:I.warn("readLine","unknow line","line:",e)}}},{key:"addFile",value:function(e){if("#"!==e[0]){this._currentSegment.file=e;var t=this.parseSDParam(e);if(t>=0){this._currentSegment.start=t,this._currentSegment.end=t+this._currentSegment.duration;var n=this.segments[this.segments.length-1]||{sd:0,start:0,end:0};n.duration=t-n.start,n.end=t}this._currentSegment.name||(this._currentSegment.name=e.substr(Math.max(0,e.lastIndexOf("/")),e.lastIndexOf("."))),this.segments.push(this._currentSegment),this._state=F}else{var r=this.readTag(e);switch(r.name){case"PROGRAM-DATE-TIME":var i=new Date(r.value);this._currentSegment.time=i;break;default:I.warn("addFile","Invalid tag.","tag.name:",r.name)}}}},{key:"parseSDParam",value:function(e){var t=-1;try{var n=new URL(e).searchParams.get("sd");n&&(t=parseInt(n,10))}catch(e){}return t}},{key:"parse",value:function(e){var t=this;if("string"==typeof(e=e||this.source)){this._state=F,this.discontinuous=!1;var n=e.split(H.lineDelimiter);if(n[0]==H.extensionHeader)return n.forEach((function(e){if(!H.canStrip(e))switch(t._state){case F:t.readLine(e);break;case j:t.addFile(e);break;default:Object(R.a)("parsing m3u8 get an error, it is unknow state.")}})),this;I.error("parse","it is not a valid m3u8 header","header:",n[0])}else Object(R.a)("m3u8 file is not text.",e)}},{key:"version",get:function(){return this.tags.VERSION}},{key:"duration",get:function(){return this.segments.length?this.segments.reduce((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0,n="number"==typeof e?e:e.duration;return n+t.duration})):0}},{key:"targetDuration",get:function(){return this.tags.TARGETDURATION}},{key:"mediaSequence",get:function(){return this.tags.MEDIA_SEQUENCE}},{key:"allowCache",get:function(){return this.tags.ALLOW_CACHE}},{key:"length",get:function(){return this.segments.length}}]),e}(),z=n(45),X=n.n(z);function G(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Object";return function(t){var n="[object "+e+"]";return Object.prototype.toString.call(t)==n}}var Y=function(){function e(){i()(this,e)}return o()(e,null,[{key:"importScripts",value:function(e,t,n){var r="ready"+Date.now();e instanceof Array?X()(e,r):X()([e],r),X.a.ready(r,{success:t,error:n})}},{key:"blobData",value:function(e){var t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}},{key:"escapeHTML",value:function(t){if(e.isString(t))return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}},{key:"getInnerWidthHeight",value:function(){return{width:window.innerWidth,height:window.innerHeight}}},{key:"Fullscreen",value:function(){var e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullScreen&&(e.webkitRequestFullScreen(),setTimeout((function(){console.error("fullscreen success"),document.dispatchEvent(new Event("fullscreenchange"))}),0))}},{key:"exitFullscreen",value:function(){var e=document;e.exitFullscreen?e.exitFullscreen():e.mozCancelFullScreen?e.mozCancelFullScreen():e.webkitExitFullscreen&&(e.webkitExitFullscreen(),setTimeout((function(){console.error("exitfullscreen success"),document.dispatchEvent(new Event("fullscreenchange"))}),0))}},{key:"buildFilePath",value:function(e,t){return e.map((function(e){return t+e}))}},{key:"insertSort",value:function(e,t,n){var r,i,a=e.length;if(0!==a)if(n){var o=n(t);r=o.key,i=o.value;for(var s=0;s<a;s++)if(i<e[s][r]){for(var u=a;u>s;)e[u]=e[u-1],u--;return void(e[s]=t)}e.push(t)}else{i=t;for(var l=0;l<a;l++)if(i<e[l]){for(var c=a;c>l;)e[c]=e[c-1],c--;return void(e[l]=i)}e.push(i)}else e.push(t)}},{key:"isSafari",value:function(){var e=navigator.userAgent;return/Safari/.test(e)&&!/Chrome/.test(e)}},{key:"msec2sec",value:function(e){var t=(e/1e3).toFixed(3);return parseFloat(t,10)}}]),e}();v()(Y,"isObject",(function(){return G("Object")})),v()(Y,"isString",(function(){return G("String")})),v()(Y,"isFunction",(function(){return G("Function")}));var $=n(34),q=n.n($),K=function(e){function t(){return i()(this,t),u()(this,c()(t).call(this))}return p()(t,e),o()(t,[{key:"add",value:function(e){this.push(Object.freeze(e))}},{key:"addAll",value:function(e){var t=this;e.forEach((function(e){t.add(e)}))}},{key:"get",value:function(e){return this[e]}},{key:"getLast",value:function(){return this[this.length-1]}},{key:"getBy",value:function(e){var t=this;if("function"==typeof e){var n=new this.constructor;return this.every((function(r,i){return!0===e.call(t,r,i,t)&&n.add(r),!0})),n}}},{key:"indexOfByTime",value:function(e,t){t||(t=function(t){return e>=t.start&&e<t.end});for(var n=this.length-1,r=0;r<=n;){var i=Math.floor((n+r)/2),a=this[i];if(t(a))return i;a.start>e?n=i-1:r=i+1}return-1}},{key:"getByTime",value:function(e){var t=this.indexOfByTime(e);if(t>=0)return this[t]}},{key:"getByKey",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Array.isArray(t[0])&&(t=t[0]),this.getBy((function(e){var n=!1;return t.every((function(t){return!Object.prototype.hasOwnProperty.call(e,t)||(n=!0,!1)})),n}))}},{key:"getByValue",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Array.isArray(t[0])&&(t=t[0]),this.getBy((function(e){var n=!1;return e.each((function(e,r){if(t.includes(r))return n=!0,!1})),n}))}},{key:"getByKeyValue",value:function(e,t){return this.getBy((function(n){return n[e]===t}))}},{key:"getValues",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Array.isArray(t[0])&&(t=t[0]),this.map((function(e){return t.length?e.get(e,t):e.getValues(e)}))}},{key:"indexOfBy",value:function(e){var t=0,n=this.length;for(e=e||function(){return!1};t<n;){if(!0===e.call(this,this[t],t,this))return t;t++}return-1}},{key:"indexOfByKey",value:function(e,t){return this.indexOfBy((function(n){return n[e]===t}))}},{key:"indexOfByKeyValue",value:function(e,t){return this.indexOfByKey(e,t)}},{key:"each",value:function(e){if("function"==typeof e)return this.forEach(e),this}},{key:"remove",value:function(e,t){return this.length<=0?this:(e=e<0?0:e,t=t||e+1,this.splice(e,t-e),this)}},{key:"removeItem",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Array.isArray(t[0])&&(t=t[0]),this.removeBy((function(e){return t.includes(e)}))}},{key:"removeBy",value:function(e){for(var t=0,n=this.length;t<n;t++)!0===e.call(this,this[t],t,this)&&(this.splice(t,1),n--,t--);return this}},{key:"removeByKeyValue",value:function(e,t){return this.removeBy((function(n){return n[e]===t}))}},{key:"toJSON",value:function(){var e=Array.from(this);return e.forEach((function(t,n){e[n]=t&&"function"==typeof t.toJSON?t.toJSON():t})),e}},{key:"toArray",value:function(){return Array.from(this)}},{key:"size",get:function(){return this.length}}]),t}(q()(Array)),Q=function(){function e(){i()(this,e)}return o()(e,[{key:"pair",value:function(){return Object.entries(this)}},{key:"keys",value:function(){return Object.keys(this)}},{key:"set",value:function(e,t){return this[e]=t,this}},{key:"get",value:function(e){return this[e]}},{key:"add",value:function(e,t){return Object.prototype.hasOwnProperty.call(this,e)||this.set(e,t),this}},{key:"addAll",value:function(e){for(var t in e)this.add(t,e[t]);return this}},{key:"toJSON",value:function(){var e={};for(var t in this)Object.prototype.hasOwnProperty.call(this,t)&&(e[t]=this[t]);return e}}]),e}(),Z=function(e){function t(e){var n;return i()(this,t),n=u()(this,c()(t).call(this,e)),v()(f()(n),"no",0),v()(f()(n),"name",null),v()(f()(n),"duration",0),v()(f()(n),"file",null),v()(f()(n),"start",0),v()(f()(n),"end",0),Object.assign(f()(n),e),n}return p()(t,e),t}(Q),J=function(e){function t(e){return i()(this,t),u()(this,c()(t).call(this,e))}return p()(t,e),o()(t,[{key:"add",value:function(e){e instanceof Z||(e=new Z(e)),e.no=this.length+1,Y.isObject(e)&&this.push(e)}}]),t}(K),ee={ProcessorResetEnd:"DataProcessorController.processorResetEnd",DataProcessorReady:"DataProcessorController.dataProcessorReady",DecodeStartDecode:"DecodeController.startDecode",DecodeFlush:"DecodeController.flush",DecodeDecoded:"DecodeController.decoded",DecodeApppendEnd:"DecodeController.appendEnd",DecodeFlushEnd:"DecodeController.flushEnd",DecodeReady:"DecodeController.ready",DemuxResetEnd:"DemuxController.resetEnd",DemuxStartDemux:"DemuxController.startDemux",DemuxLast:"DemuxController.last",DemuxVideo:"DemuxController.video",DemuxAAC:"DemuxController.AAC",DemuxReady:"DemuxController.ready",ImagePlayerRenderEnd:"ImagePlayer.renderEnd",ImagePlayerWait:"ImagePlayer.wait",ImagePlayerReady:"ImagePlayer.ready",ImagePlayerEnd:"ImagePlayer.end",ImagePlayerBuffeUpdate:"ImagePlayer.bufferUpdate",ControlBarPlay:"ControlBar.onPlay",ControlBarPause:"ControlBar.onPause",ControlBarPauseLoading:"ControlBar.onPauseLoading",LoadDataReadBufferByNo:"LoadData.readBufferByNo",LoadDataReadBuffer:"LoadData.readBuffer",LoadDataRead:"LoadData.onRead",LoadDataSeek:"LoadData.onSeek",LoadDataFirstLoaded:"LoadData.onFirstLoaded",LoaderPlayListStart:"Loader.playlistStart",LoaderLoading:"Loader.onLoading",LoaderError:"Loader.onError",LoaderLoaded:"Loader.onLoaded",LoaderUpdateSpeed:"Loader.updateSpeed",LoaderLoadFile:"Loader.loadFile",LoaderPlayListLoaded:"Loader.playlistLoaded",AudioPlayerReady:"AudioPlayer.MSEReady",AudioPlayerDataReady:"AudioPlayer.dataReady",AudioPlayerWait:"AudioPlayer.wait",AudioPlayerEnd:"AudioPlayer.end",AudioPlayerPlaySuccess:"AudioPlayer.playSuccess",AudioPlayerPlayFail:"AudioPlayer.playFail",PlayerMaxPTS:"DemuxController.maxpts",PlayerSeekEnd:"Player.seekend",PlayerSpeedTo:"Player.speedTo",PlayerChangeRate:"Player.changeRate",PlayerChangeSrc:"Player.changeSrc",PlayerPlaying:"Player.playing",PlayerTimeUpdate:"Player.timeUpdate",PlayerbufferUpdate:"Player.bufferupdate",PlayerResetReady:"Player.resetReady",PlayerWait:"Player.wait",PlayerLoadNext:"Player.loadNext",PlayerOnPlay:"Player.onPlay",PlayerOnPause:"Player.onPause",PlayerOnSeek:"Player.onSeek",PlayerOnVolume:"Player.onVolume",PlayerReady:"Player.ready",PlayerPlay:"Player.play",PlayerReset:"Player.reset",PlayerLoadedMetaData:"Player.loadedMetaData",PlayerEnd:"Player.end",PlayerPause:"Player.pause",PlayerSeeking:"Player.seeking",PlayerAlert:"Player.alert",PlayerThrowError:"Player.throwError",StreamDataReady:"StreamController.dataReady"};function te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var ne,re,ie={HLS:function(e){function t(e){var n;return i()(this,t),n=u()(this,c()(t).call(this)),v()(f()(n),"state",N.IDLE),v()(f()(n),"maxBufferDuration",M.b.maxDuration),v()(f()(n),"maxBufferSize",M.b.maxSize),v()(f()(n),"baseUrl",""),v()(f()(n),"options",null),v()(f()(n),"httpWorker",null),v()(f()(n),"sourceData",null),v()(f()(n),"segmentPool",[]),v()(f()(n),"currentNo",null),v()(f()(n),"maxRetryCount",M.b.maxRetryCount),n.options=e,n.loaderController=n.options.loaderController,n.dataController=n.loaderController.dataController,n.httpWorker=e.httpWorker,n.setSegmentPool(new J),n}return p()(t,e),o()(t,[{key:"loadPlaylist",value:function(e){var t=this;this.httpWorker.postMessage({type:"invoke",fileType:"m3u8",method:"get",name:"playlist",url:this.sourceURL}),this.httpWorker.onmessage=function(n){var r=n.data,i=n.data.data;if(i)"playlist"==r.name&&t.parsePlaylist(i,e);else{var a="Get the ".concat(r.fileType," file error. URL: ").concat(r.url);t.events.emit(ee.PlayerAlert,a),t.events.emit(ee.LoaderError,a,r);var o=[t.state,"request playlist error.","data:",r,a];t.events.emit(ee.PlayerThrowError,o)}}}},{key:"parsePlaylist",value:function(e,t){var n=new V(e);if(n.segments&&n.segments.length){n.segments.forEach((function(e){e.start=Y.msec2sec(e.start),e.end=Y.msec2sec(e.end),e.duration=Y.msec2sec(e.duration)})),this.setSourceData(Object.freeze(n)),this.segmentPool.addAll(n.segments),t.call(this,n)}else{this.events.emit(ee.LoaderError,n),this.events.emit(ee.PlayerAlert,"Parse playlist file error.");var r=[this.state,"Parse playlist error.","data:",n];this.events.emit(ee.PlayerThrowError,r)}}},{key:"setSourceData",value:function(e){this.sourceData=e}},{key:"getSourceData",value:function(){return this.sourceData}},{key:"setSegmentPool",value:function(e){this.segmentPool=e}},{key:"getSegmentPool",value:function(){return this.segmentPool}},{key:"isNotFree",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e="["+e+"]loader is not free. please wait.",this.state!==N.IDLE&&this.state!==N.DONE&&(this.logger.warn("isNotFree","check status for loader","notice:",e),!0)}},{key:"getBaseUrl",value:function(e){var t=this.options.sourceURL;if(!(e.indexOf("//")>-1)){var n=t.lastIndexOf("/");return t.substr(0,n+1)}return""}},{key:"checkLoadCondition",value:function(e){return!(e.no>this.segmentPool.length)&&(!(this.dataController.getLoadDataBufferPool().bufferDuration>this.maxBufferDuration)||(this.logger.info("checkLoadCondition","stop load next segment.","bufferDuration:",this.dataController.getLoadDataBufferPool().bufferDuration,"maxBufferDuration:",this.maxBufferDuration),!1))}},{key:"loadFile",value:function(e,t,n){var r=this;if(e instanceof Z)if(this.isNotFree()&&"seek"!==t&&"start"!==t)this.logger.warn("loadFile","is loading","segment:",e,"type:",t);else{if(!this.checkLoadCondition(e))return this.state=N.IDLE,void this.logger.warn("loadFile","checkLoadCondition failed","segment:",e,"type:",t);this.currentNo=e.no;var i=this.getBaseUrl(e.file)+e.file,a=1,o=function(e,t){return"function"==typeof r.options.processURL?r.options.processURL(e,t):e},s=function(){r.httpWorker.postMessage({type:"invoke",fileType:"ts",method:"get",name:e.no,url:o(i,e)})};this.state=N.LOADING,this.events.emit(ee.LoaderLoading,e,t,n),this.httpWorker.onmessage=function(i){r.state=N.DONE;var o=i.data;if(r.logger.info("loadfile","httpWorker","onmessage get data"),o&&"error"!==o.type)"notice"===o.type?"speed"===o.noticeType&&r.events.emit(ee.LoaderUpdateSpeed,o.data):"ts"===o.fileType&&o.name===e.no?(r.logger.info("loadFile","read success","data no:",o.name),r.state=N.IDLE,r.events.emit(ee.LoaderLoaded,o,e,t,n)):r.logger.warn("loadFile","is not ts file or the segment'no is not equal.","fileType:",o.fileType,"data:",o);else if(r.state=N.ERROR,a<=r.maxRetryCount)r.logger.warn("loadFile","retry to load","count:",a,"segment:",e),s(),a+=1;else{r.events.emit(ee.LoaderError,e,t,n);r.events.emit(ee.PlayerAlert,"Load file error, please concat administrator.");var u=[r.state,"Load File error.","load count:",a,"segment:",e];r.events.emit(ee.PlayerThrowError,u)}},s()}}},{key:"destroy",value:function(){this.httpWorker&&this.httpWorker.terminate()}}]),t}(U)},ae=function(e){function t(e,n){var r;return i()(this,t),r=u()(this,c()(t).call(this)),v()(f()(r),"state",null),v()(f()(r),"exeLoader",null),v()(f()(r),"loadData",null),v()(f()(r),"type","HLS"),v()(f()(r),"options",null),v()(f()(r),"dataController",null),r.type=e||r.type,r.player=n.player,r.options=n.player.options,r.dataController=r.player.dataController,r.init(r.type,r.options),r}return p()(t,e),o()(t,[{key:"init",value:function(e,t){this.bindEvent(),this.setExeLoader(new ie[e](function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?te(Object(n),!0).forEach((function(t){v()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):te(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},t,{player:this.player,loaderController:this}))),this.setSourceURL(t.sourceURL),this.player.loadData?this.setLoadData(this.player.loadData):this.setLoadData(this.dataController.getDataInstance("load",t)),this.exeLoader.setLoadData(this.loadData)}},{key:"run",value:function(){this.state=N.LOAD_PLAYLIST,this.events.emit(ee.LoaderPlayListStart,this),this.logger.info("run",N[this.state],"url:",this.options.sourceURL),this.loadPlaylist()}},{key:"bindEvent",value:function(){var e=this;this.events.on(ee.LoaderLoadFile,(function(t,n,r){e.exeLoader.loadFile(t,n,r)}))}},{key:"loadPlaylist",value:function(e){var t=this;this.exeLoader.loadPlaylist((function(n){n?(t.dataController.setLoadDataSourceData(t.exeLoader.getSourceData()),t.dataController.setLoadDataSegmentPool(t.exeLoader.getSegmentPool()),t.state=N.LOADED_PLAYLIST,t.events.emit(ee.LoaderPlayListLoaded,t),"function"==typeof e&&e.call(t,n)):t.logger.error("run","start load m3u8","data:",n)}))}},{key:"switchPlaylist",value:function(e,t){this.setSourceURL(e),this.dataController.clearLoadData(),this.state=N.LOAD_PLAYLIST,this.events.emit(ee.LoaderPlayListStart,this),this.logger.info("switchPlaylist",N[this.state],"url:",e),this.loadPlaylist(t)}},{key:"setExeLoader",value:function(e){this.exeLoader=e}},{key:"getExeLoader",value:function(){return this.exeLoader}},{key:"setSourceURL",value:function(e){this.exeLoader.setSourceURL(e)}},{key:"getSourceURL",value:function(){return this.exeLoader.getSourceURL()}},{key:"setLoadData",value:function(e){this.loadData=e}},{key:"getLoadData",value:function(){return this.loadData}},{key:"getSourceData",value:function(){return this.exeLoader.getSourceData()}},{key:"destroy",value:function(){this.exeLoader.destroy()}}]),t}(A),oe=function(e){function t(e){var n;return i()(this,t),n=u()(this,c()(t).call(this,e)),v()(f()(n),"no",0),v()(f()(n),"start",0),v()(f()(n),"end",0),v()(f()(n),"blob",null),v()(f()(n),"arrayBuffer",null),v()(f()(n),"duration",0),Object.assign(f()(n),e),n}return p()(t,e),o()(t,[{key:"size",get:function(){return this.blob.size}}]),t}(Q),se=function(e){function t(e){return i()(this,t),u()(this,c()(t).call(this,e))}return p()(t,e),o()(t,[{key:"add",value:function(e){e instanceof oe||(e=new oe(e));var t=this.length;if(0!==t){for(;t--;)if(e.no<=this[t].no)return void this.splice(t,1,e);return this.push(e),this}this.push(e)}},{key:"getBufferSize",value:function(){return this.length<=0?0:this.reduce((function(e,t){return isNaN(e)&&(e=e.blob.size),e+t.blob.size}))}},{key:"getBufferDuration",value:function(){return this.length<=0?0:this.reduce((function(e,t){return isNaN(e)&&(e=e.end-e.start),e+(t.end-t.start)}))}},{key:"bufferSize",get:function(){return this.getBufferSize()}},{key:"bufferDuration",get:function(){return this.getBufferDuration()}}]),t}(K),ue=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return i()(this,t),e=u()(this,c()(t).call(this)),v()(f()(e),"bufferPool",[]),v()(f()(e),"sourceData",{}),v()(f()(e),"options",{}),v()(f()(e),"segmentPool",[]),v()(f()(e),"readBufferNo",null),v()(f()(e),"startLoadTime",null),v()(f()(e),"currentSeekTime",null),e.options=n,e.init(),e}return p()(t,e),o()(t,[{key:"init",value:function(){var e=this;this.setBufferPool(new se),this.events.on(ee.LoadDataReadBufferByNo,(function(t,n){e.readBufferByNo(t,n)})),this.events.on(ee.LoadDataReadBuffer,(function(t,n){e.readBuffer(t,n)})),this.events.on(ee.LoaderLoaded,(function(t,n,r,i){var a=e.createBuffer({arrayBuffer:t.arrayBuffer},n);if(e.segmentLoaded(n,a),"seek"===r&&i===e.currentSeekTime)return e.events.emit(ee.LoadDataSeek,a,i),void e.removeBufferByNo(a.no);i===e.startLoadTime&&e.events.emit(ee.LoadDataFirstLoaded,a,i)}))}},{key:"setOptions",value:function(e){Object.assign(this.options,e)}},{key:"startLoad",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.logger.info("startLoad","begin to load ts data","time:",e),isNaN(e)?this.logger.error("seekTime","seek","time:",e):(this.startLoadTime=e,this.loadSegmentByTime(e,"start"))}},{key:"readBuffer",value:function(e,t){var n=this.getSegmentByTime(e);n&&this.readBufferByNo(n.no,t)}},{key:"segmentLoaded",value:function(e,t){t&&this.addBufferPool(t),e.no===this.options.player.currentIndex&&this.readBufferByNo(e.no),e.no<this.segmentPool.getLast().no&&this.loadSegmentByNo(e.no+1)}},{key:"seekTime",value:function(e){if(isNaN(e))this.logger.error("seekTime","seek","time:",e);else{var t;this.currentSeekTime=e;var n=this.bufferPool.indexOfByTime(e);n>-1?(t=this.bufferPool[n],this.events.emit(ee.LoadDataSeek,t,e)):(this.removeBufferPool(this.bufferPool.length),this.loadSegmentByTime(e,"seek"))}}},{key:"loadSegmentByTime",value:function(e,t){if(!isNaN(e)){var n=this.segmentPool.indexOfByTime(e);if(n>=0){var r=this.segmentPool[n];this.events.emit(ee.LoaderLoadFile,r,t,e)}else this.logger.error("loadSegmentByTime","time over","time:",e,"type:",t)}}},{key:"createBuffer",value:function(e,t){if(e){var n={start:t.start,end:t.end,no:t.no,duration:t.end-t.start,arrayBuffer:e.arrayBuffer};return new oe(n)}}},{key:"isValidSegmentNo",value:function(e){return!isNaN(e)&&e>0&&e<=this.segmentPool.length}},{key:"loadSegmentByNo",value:function(e){var t=e-1,n=this.segmentPool.get(t);n&&this.events.emit(ee.LoaderLoadFile,n,"play")}},{key:"readBufferByNo",value:function(e,t){this.isValidSegmentNo(e)?(this.readBufferNo=e,t=t||function(e){this.events.emit(ee.LoadDataRead,e)},this.getBlobByNo(e,t)):this.logger.error("readBufferByNo","check buffer no","is not valid no",e)}},{key:"getSegmentByTime",value:function(e){var t=this.segmentPool.indexOfByTime(e);return this.segmentPool[t]}},{key:"getBlobByNo",value:function(e,t){if(isNaN(e))this.logger.error("getBlobByNo","isNaN","no:",e);else{var n;if(!this.isBufferReading)return this.isBufferReading=!0,n=this.bufferPool.getByKeyValue("no",e)[0],"function"==typeof t&&(t.call(this,n),n&&this.removeBufferByNo(n.no)),this.isBufferReading=!1,n;this.logger.warn("getBlobByNo","isBufferReading","no:",e)}}},{key:"addBufferPool",value:function(e){if(this.bufferPool.length){if(this.bufferPool[0].no===e.no+1)return this.bufferPool.unshift(e),!0;var t=this.bufferPool.getLast();if(e.no-t.no==1)return this.bufferPool.push(e),!0;if(this.bufferPool.indexOfByKey("no",e.no))return!0;this.bufferPool.splice(0,this.bufferPool.length)}this.bufferPool.push(e)}},{key:"removeBufferPool",value:function(e){this.bufferPool.splice(0,e+1)}},{key:"removeBufferByNo",value:function(e){var t=this.bufferPool.indexOfByKey("no",e);if(!(t<=-1))return this.removeBufferPool(t),this.bufferPool.length?this.bufferPool.getLast().no<this.segmentPool.getLast().no&&this.loadSegmentByNo(this.bufferPool.getLast().no+1):e<this.segmentPool.getLast().no&&this.loadSegmentByNo(e+1),!0}},{key:"clear",value:function(){this.sourceData={},this.readBufferNo=null,this.currentSeekTime=null,this.bufferPool.length=0,this.segmentPool.length=0}},{key:"getSegmentByNo",value:function(e){return this.segmentPool.get(e-1)}},{key:"getSegment",value:function(e){return this.segmentPool.getByTime(e)}},{key:"setSourceData",value:function(e){this.sourceData=e}},{key:"getSourceData",value:function(){return this.sourceData}},{key:"setBufferPool",value:function(e){this.bufferPool=e}},{key:"getBufferPool",value:function(){return this.bufferPool}},{key:"setSegmentPool",value:function(e){this.segmentPool=e}},{key:"getSegmentPool",value:function(){return this.segmentPool}}]),t}(O),le=function(e){function t(e){var n;return i()(this,t),n=u()(this,c()(t).call(this)),v()(f()(n),"loadData",null),n.options=e,n}return p()(t,e),o()(t,[{key:"setLoadData",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.loadData=C()(ue,t)}},{key:"getLoadData",value:function(){return this.loadData}},{key:"getLoadDataBufferPool",value:function(){return this.loadData.bufferPool}},{key:"setLoadDataSourceData",value:function(e){this.loadData.setSourceData(e)}},{key:"setLoadDataSegmentPool",value:function(e){this.loadData.setSegmentPool(e)}},{key:"startLoad",value:function(e){e=Math.max(e,0),this.startLoadData(e)}},{key:"startLoadData",value:function(e){this.loadData.startLoad(e)}},{key:"clearLoadData",value:function(){this.loadData.clear()}},{key:"getDataInstance",value:function(e){if(e)switch(e){case"load":if(!this.loadData){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.setLoadData.apply(this,n)}return this.loadData;default:return null}}}]),t}(A),ce=function(e){function t(e){var n;return i()(this,t),n=u()(this,c()(t).call(this,e)),v()(f()(n),"checkHanlder",null),v()(f()(n),"resetStatus",{processor:!1,audioPlayer:!1}),n.player=e.player,n.player?(n.audioPlayer=e.audioPlayer,n.imagePlayer=e.imagePlayer,n.loadData=e.loadData,n.bindEvent(),n):u()(n)}return p()(t,e),o()(t,[{key:"bindEvent",value:function(){var e=this;this.events.on(ee.ProcessorResetEnd,(function(){e.checkResetReady("processor")})),this.events.on(ee.AudioPlayerReady,(function(){e.checkResetReady("audioPlayer")})),this.events.on(ee.PlayerResetReady,(function(){e.onResetReady()})),this.events.on(ee.LoadDataSeek,(function(t,n){e.onSeek(t,n)})),this.events.on(ee.ImagePlayerRenderEnd,(function(t){e.onRenderEnd(t)})),this.events.on(ee.ImagePlayerWait,(function(){e.audioPlayer.pause()}))}},{key:"play",value:function(e){this.logger.warn("play","play start"),this.sync(e)}},{key:"sync",value:function(e){var t=this.player,n=this.audioPlayer,r=this.imagePlayer,i=n.offset,a=r.offset,o=Math.min(i,a),s=Math.max(i,a),u=t.playbackRate;if(t.seeking&&(t.seeking=!1),!t.reseting&&"pause"!==t.status&&"waiting"!==n.status&&"wait"!==r.status)if("end"!==t.status){if(this.setCurrentTime(e),!(e<o))return e>=i&&e<=a?(this.events.once(ee.AudioPlayerPlaySuccess,(function(){r.render(a)})),n.playbackRate=u,void n.play()):void(e>=a&&e<=i?r.render(e):e>s&&(this.audioPlayer.playbackRate=u,this.a