chunk-5df4fae9.968202fe.js 602 KB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5df4fae9"],{5392:function(e,t,r){!function(t,r){e.exports=r()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=167)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function e(t,r,n){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,r);if(void 0===i){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,r,n)}if("value"in i)return i.value;var o=i.get;return void 0!==o?o.call(n):void 0},a=p(r(10)),o=p(r(5)),s=p(r(30)),l=p(r(6)),u=p(r(7)),c=p(r(31)),d=p(r(9));r(34);var f=r(8);function p(e){return e&&e.__esModule?e:{default:e}}function h(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var g=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=h(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));if(r.config=o.default.deepCopy({width:600,height:337.5,ignores:[],whitelist:[],lang:(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase(),inactive:3e3,volume:.6,controls:!0,controlsList:["nodownload"]},e),r.version=f.version,r.userTimer=null,r.waitTimer=null,r.history=[],r.isProgressMoving=!1,r.root=o.default.findDom(document,"#"+r.config.id),r.controls=o.default.createDom("xg-controls","",{unselectable:"on",onselectstart:"return false"},"xgplayer-controls"),r.config.isShowControl&&(r.controls.style.display="none"),!r.root){var n=r.config.el;if(!n||1!==n.nodeType)return r.emit("error",new u.default({type:"use",errd:{line:45,handle:"Constructor",msg:"container id can't be empty"},vid:r.config.vid})),console.error("container id can't be empty"),h(r,!1);r.root=n}if(o.default.addClass(r.root,"xgplayer xgplayer-"+s.default.device+" xgplayer-nostart "+(r.config.controls?"":"xgplayer-no-controls")),r.root.appendChild(r.controls),r.config.fluid?(r.root.style["max-width"]="100%",r.root.style.width="100%",r.root.style.height="0",r.root.style["padding-top"]=100*r.config.height/r.config.width+"%",r.video.style.position="absolute",r.video.style.top="0",r.video.style.left="0"):(r.config.width&&("number"!=typeof r.config.width?r.root.style.width=r.config.width:r.root.style.width=r.config.width+"px"),r.config.height&&("number"!=typeof r.config.height?r.root.style.height=r.config.height:r.root.style.height=r.config.height+"px")),r.config.execBeforePluginsCall&&r.config.execBeforePluginsCall.forEach((function(e){e.call(r,r)})),r.config.closeI18n||t.install(d.default.name,d.default.method),r.config.controlStyle&&"String"===o.default.typeOf(r.config.controlStyle)){var i=r;fetch(i.config.controlStyle,{method:"GET",headers:{Accept:"application/json"}}).then((function(e){e.ok&&e.json().then((function(e){for(var t in e)e.hasOwnProperty(t)&&(i.config[t]=e[t]);i.pluginsCall()}))})).catch((function(e){console.log("Fetch错误:"+e)}))}else r.pluginsCall();r.config.controlPlugins&&t.controlsRun(r.config.controlPlugins,r),r.ev.forEach((function(e){var t=Object.keys(e)[0],n=r[e[t]];n&&r.on(t,n)})),["focus","blur"].forEach((function(e){r.on(e,r["on"+e.charAt(0).toUpperCase()+e.slice(1)])}));var a=r;return r.mousemoveFunc=function(){a.emit("focus"),a.config.closeFocusVideoFocus||a.video.focus()},r.root.addEventListener("mousemove",r.mousemoveFunc),r.playFunc=function(){a.emit("focus"),a.config.closePlayVideoFocus||a.video.focus()},a.once("play",r.playFunc),r.getVideoSize=function(){if(this.video.videoWidth&&this.video.videoHeight){var e=a.root.getBoundingClientRect();"auto"===a.config.fitVideoSize?e.width/e.height>this.video.videoWidth/this.video.videoHeight?a.root.style.height=this.video.videoHeight/this.video.videoWidth*e.width+"px":a.root.style.width=this.video.videoWidth/this.video.videoHeight*e.height+"px":"fixWidth"===a.config.fitVideoSize?a.root.style.height=this.video.videoHeight/this.video.videoWidth*e.width+"px":"fixHeight"===a.config.fitVideoSize&&(a.root.style.width=this.video.videoWidth/this.video.videoHeight*e.height+"px")}},a.once("loadeddata",r.getVideoSize),setTimeout((function(){r.emit("ready"),r.isReady=!0}),0),r.config.videoInit&&o.default.hasClass(r.root,"xgplayer-nostart")&&r.start(),a.config.rotate&&(a.on("requestFullscreen",r.updateRotateDeg),a.on("exitFullscreen",r.updateRotateDeg)),a.once("destroy",(function e(){a.root.removeEventListener("mousemove",a.mousemoveFunc),a.off("destroy",e)})),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"attachVideo",value:function(){var e=this;window.XgVideoProxy||this.root.insertBefore(this.video,this.root.firstChild),setTimeout((function(){e.emit("complete"),e.danmu&&"function"==typeof e.danmu.resize&&e.danmu.resize()}),1)}},{key:"start",value:function(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.url,n=this;r&&""!==r||this.emit("urlNull"),this.logParams.playSrc=r,this.canPlayFunc=function(){n.off("canplay",n.canPlayFunc);var e=n.video.play();void 0!==e&&e&&e.then((function(){n.emit("autoplay started")})).catch((function(){n.emit("autoplay was prevented"),t.util.addClass(n.root,"xgplayer-is-autoplay")}))},"Array"!==o.default.typeOf(r)?"String"===o.default.typeOf(r)&&r.indexOf("blob:")>-1&&r===this.video.src||(this.video.src=r):r.forEach((function(t){e.video.appendChild(o.default.createDom("source","",{src:""+t.src,type:""+(t.type||"")}))})),this.logParams.pt=(new Date).getTime(),this.logParams.vt=this.logParams.pt,this.loadeddataFunc=function(){n.logParams.vt=(new Date).getTime(),n.logParams.pt>n.logParams.vt&&(n.logParams.pt=n.logParams.vt),n.logParams.vd=n.video.duration},this.once("loadeddata",this.loadeddataFunc),this.config.autoplay&&(s.default.os.isPhone?this.canPlayFunc():this.on("canplay",this.canPlayFunc)),this.config.disableStartLoad||this.video.load(),this.attachVideo()}},{key:"reload",value:function(){this.video.load(),this.reloadFunc=function(){var e=this.play();void 0!==e&&e&&e.catch((function(e){}))},this.once("loadeddata",this.reloadFunc)}},{key:"destroy",value:function(){var e=this,r=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=this;for(var a in clearInterval(this.bulletResizeTimer),this._interval)clearInterval(this._interval[a]),this._interval[a]=null;function o(){if(this.emit("destroy"),this.video.removeAttribute("src"),this.video.load(),r){this.root.innerHTML="";var e=this.root.className.split(" ");e.length>0?this.root.className=e.filter((function(e){return e.indexOf("xgplayer")<0})).join(" "):this.root.className=""}for(var t in this)delete this[t];(0,c.default)(this)}this.checkTimer&&clearInterval(this.checkTimer),this.waitTimer&&clearTimeout(this.waitTimer),this.ev.forEach((function(t){var r=Object.keys(t)[0],n=e[t[r]];n&&e.off(r,n)})),this.loadeddataFunc&&this.off("loadeddata",this.loadeddataFunc),this.reloadFunc&&this.off("loadeddata",this.reloadFunc),this.replayFunc&&this.off("play",this.replayFunc),this.playFunc&&this.off("play",this.playFunc),this.getVideoSize&&this.off("loadeddata",this.getVideoSize),["focus","blur"].forEach((function(t){e.off(t,e["on"+t.charAt(0).toUpperCase()+t.slice(1)])})),this.config.keyShortcut&&"on"!==this.config.keyShortcut||["video","controls"].forEach((function(t){e[t]&&e[t].removeEventListener("keydown",(function(e){n.onKeydown(e,n)}))})),this.paused?o.call(this):(this.pause(),this.once("pause",o)),i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}},{key:"replay",value:function(){var e=this,t=this._replay;if(o.default.removeClass(this.root,"xgplayer-ended"),s.default.browser.indexOf("ie")>-1&&(this.emit("play"),this.emit("playing")),this.logParams={bc:0,bu_acu_t:0,played:[],pt:(new Date).getTime(),vt:(new Date).getTime(),vd:0},this.logParams.pt=(new Date).getTime(),this.logParams.vt=this.logParams.pt,this.replayFunc=function(){e.logParams.vt=(new Date).getTime(),e.logParams.pt>e.logParams.vt&&(e.logParams.pt=e.logParams.vt),e.logParams.vd=e.video.duration},this.once("play",this.replayFunc),this.logParams.playSrc=this.video.currentSrc,t&&t instanceof Function)t();else{this.currentTime=0;var r=this.play();void 0!==r&&r&&r.catch((function(e){}))}}},{key:"pluginsCall",value:function(){var e=this;t.plugins.s_i18n&&t.plugins.s_i18n.call(this,this);var r=this;if(t.plugins){var n=this.config.ignores;Object.keys(t.plugins).forEach((function(i){var a=t.plugins[i];n.some((function(e){return i===e||i==="s_"+e}))||"s_i18n"===i||(["pc","tablet","mobile"].some((function(e){return e===i}))?i===s.default.device&&setTimeout((function(){r.video&&a.call(r,r)}),0):a.call(e,e))}))}}},{key:"onFocus",value:function(){var e=this;o.default.hasClass(this.root,"xgplayer-inactive")&&e.emit("controlShow"),o.default.removeClass(this.root,"xgplayer-inactive"),e.userTimer&&clearTimeout(e.userTimer),e.userTimer=setTimeout((function(){e.emit("blur")}),e.config.inactive)}},{key:"onBlur",value:function(){!this.config.enablePausedInactive&&this.paused||this.ended||this.config.closeInactive||(o.default.hasClass(this.root,"xgplayer-inactive")||this.emit("controlHide"),o.default.addClass(this.root,"xgplayer-inactive"))}},{key:"onPlay",value:function(){o.default.addClass(this.root,"xgplayer-isloading"),o.default.addClass(this.root,"xgplayer-playing"),o.default.removeClass(this.root,"xgplayer-pause")}},{key:"onPause",value:function(){o.default.addClass(this.root,"xgplayer-pause"),this.userTimer&&clearTimeout(this.userTimer),this.emit("focus")}},{key:"onEnded",value:function(){o.default.addClass(this.root,"xgplayer-ended"),o.default.removeClass(this.root,"xgplayer-playing")}},{key:"onSeeking",value:function(){this.isSeeking=!0,this.onWaiting()}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&clearTimeout(this.waitTimer),o.default.removeClass(this.root,"xgplayer-isloading")}},{key:"onWaiting",value:function(){var e=this;e.waitTimer&&clearTimeout(e.waitTimer),e.checkTimer&&(clearInterval(e.checkTimer),e.checkTimer=null);var t=e.currentTime;e.waitTimer=setTimeout((function(){o.default.addClass(e.root,"xgplayer-isloading"),e.checkTimer=setInterval((function(){e.currentTime!==t&&(o.default.removeClass(this.root,"xgplayer-isloading"),clearInterval(e.checkTimer),e.checkTimer=null)}),1e3)}),500)}},{key:"onPlaying",value:function(){this.paused||(this.isSeeking=!1,this.waitTimer&&clearTimeout(this.waitTimer),o.default.removeClass(this.root,"xgplayer-isloading xgplayer-nostart xgplayer-pause xgplayer-ended xgplayer-is-error xgplayer-replay"),o.default.addClass(this.root,"xgplayer-playing"))}},{key:"cumulateTime",get:function(){if(this.logParams&&this.logParams.played instanceof Array){var e=o.default.computeWatchDur(this.logParams.played)||0;return Number(e.toFixed(3))}return 0}}],[{key:"install",value:function(e,r){t.plugins||(t.plugins={}),t.plugins[e]||(t.plugins[e]=r)}},{key:"installAll",value:function(e){for(var r in e)t.install(e[r].name,e[r].method)}},{key:"use",value:function(e,r){t.plugins||(t.plugins={}),t.plugins[e]=r}},{key:"useAll",value:function(e){for(var r in e)t.use(e[r].name,e[r].method)}},{key:"controlsRun",value:function(e,t){e.forEach((function(e){e.method.call(t)}))}}]),t}(a.default);g.util=o.default,g.sniffer=s.default,g.Errors=u.default,g.XgplayerTimeRange=l.default,t.default=g,e.exports=t.default},function(e,t,r){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r=function(e,t){var r,n=e[1]||"",i=e[3];if(!i)return n;if(t&&"function"==typeof btoa){var a=(r=i,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */"),o=i.sources.map((function(e){return"/*# sourceURL="+i.sourceRoot+e+" */"}));return[n].concat(o).concat([a]).join("\n")}return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+r+"}":r})).join("")},t.i=function(e,r){"string"==typeof e&&(e=[[null,e,""]]);for(var n={},i=0;i<this.length;i++){var a=this[i][0];"number"==typeof a&&(n[a]=!0)}for(i=0;i<e.length;i++){var o=e[i];"number"==typeof o[0]&&n[o[0]]||(r&&!o[2]?o[2]=r:r&&(o[2]="("+o[2]+") and ("+r+")"),t.push(o))}},t}},function(e,t,r){var n,i,a={},o=(n=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===i&&(i=n.apply(this,arguments)),i}),s=function(e){return document.querySelector(e)},l=function(e){var t={};return function(e){if("function"==typeof e)return e();if(void 0===t[e]){var r=s.call(this,e);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}t[e]=r}return t[e]}}(),u=null,c=0,d=[],f=r(36);function p(e,t){for(var r=0;r<e.length;r++){var n=e[r],i=a[n.id];if(i){i.refs++;for(var o=0;o<i.parts.length;o++)i.parts[o](n.parts[o]);for(;o<n.parts.length;o++)i.parts.push(x(n.parts[o],t))}else{var s=[];for(o=0;o<n.parts.length;o++)s.push(x(n.parts[o],t));a[n.id]={id:n.id,refs:1,parts:s}}}}function h(e,t){for(var r=[],n={},i=0;i<e.length;i++){var a=e[i],o=t.base?a[0]+t.base:a[0],s={css:a[1],media:a[2],sourceMap:a[3]};n[o]?n[o].parts.push(s):r.push(n[o]={id:o,parts:[s]})}return r}function g(e,t){var r=l(e.insertInto);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var n=d[d.length-1];if("top"===e.insertAt)n?n.nextSibling?r.insertBefore(t,n.nextSibling):r.appendChild(t):r.insertBefore(t,r.firstChild),d.push(t);else if("bottom"===e.insertAt)r.appendChild(t);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var i=l(e.insertInto+" "+e.insertAt.before);r.insertBefore(t,i)}}function y(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=d.indexOf(e);t>=0&&d.splice(t,1)}function v(e){var t=document.createElement("style");return e.attrs.type="text/css",m(t,e.attrs),g(e,t),t}function m(e,t){Object.keys(t).forEach((function(r){e.setAttribute(r,t[r])}))}function x(e,t){var r,n,i,a;if(t.transform&&e.css){if(!(a=t.transform(e.css)))return function(){};e.css=a}if(t.singleton){var o=c++;r=u||(u=v(t)),n=_.bind(null,r,o,!1),i=_.bind(null,r,o,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(r=function(e){var t=document.createElement("link");return e.attrs.type="text/css",e.attrs.rel="stylesheet",m(t,e.attrs),g(e,t),t}(t),n=E.bind(null,r,t),i=function(){y(r),r.href&&URL.revokeObjectURL(r.href)}):(r=v(t),n=w.bind(null,r),i=function(){y(r)});return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else i()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=o()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var r=h(e,t);return p(r,t),function(e){for(var n=[],i=0;i<r.length;i++){var o=r[i];(s=a[o.id]).refs--,n.push(s)}for(e&&p(h(e,t),t),i=0;i<n.length;i++){var s;if(0===(s=n[i]).refs){for(var l=0;l<s.parts.length;l++)s.parts[l]();delete a[s.id]}}}};var b,k=(b=[],function(e,t){return b[e]=t,b.filter(Boolean).join("\n")});function _(e,t,r,n){var i=r?"":n.css;if(e.styleSheet)e.styleSheet.cssText=k(t,i);else{var a=document.createTextNode(i),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(a,o[t]):e.appendChild(a)}}function w(e,t){var r=t.css,n=t.media;if(n&&e.setAttribute("media",n),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}function E(e,t,r){var n=r.css,i=r.sourceMap,a=void 0===t.convertToAbsoluteUrls&&i;(t.convertToAbsoluteUrls||a)&&(n=f(n)),i&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var o=new Blob([n],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(o),s&&URL.revokeObjectURL(s)}},function(e,t,r){"use strict";var n=r(23)();e.exports=function(e){return e!==n&&null!==e}},function(e,t,r){"use strict";e.exports=function(e){return null!=e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(6),a=(n=i)&&n.__esModule?n:{default:n},o={createDom:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=document.createElement(e);return i.className=n,i.innerHTML=t,Object.keys(r).forEach((function(t){var n=t,a=r[t];"video"===e||"audio"===e?a&&i.setAttribute(n,a):i.setAttribute(n,a)})),i},hasClass:function(e,t){return!!e&&(e.classList?Array.prototype.some.call(e.classList,(function(e){return e===t})):!!e.className&&!!e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)")))},addClass:function(e,t){e&&(e.classList?t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)})):o.hasClass(e,t)||(e.className+=" "+t))},removeClass:function(e,t){e&&(e.classList?t.split(/\s+/g).forEach((function(t){e.classList.remove(t)})):o.hasClass(e,t)&&t.split(/\s+/g).forEach((function(t){var r=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(r," ")})))},toggleClass:function(e,t){e&&t.split(/\s+/g).forEach((function(t){o.hasClass(e,t)?o.removeClass(e,t):o.addClass(e,t)}))},findDom:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=arguments[1],r=void 0;try{r=e.querySelector(t)}catch(n){0===t.indexOf("#")&&(r=e.getElementById(t.slice(1)))}return r},padStart:function(e,t,r){for(var n=String(r),i=t>>0,a=Math.ceil(i/n.length),o=[],s=String(e);a--;)o.push(n);return o.join("").substring(0,i-s.length)+s},format:function(e){if(window.isNaN(e))return"";var t=o.padStart(Math.floor(e/3600),2,0),r=o.padStart(Math.floor((e-3600*t)/60),2,0),n=o.padStart(Math.floor(e-3600*t-60*r),2,0);return("00"===t?[r,n]:[t,r,n]).join(":")},event:function(e){if(e.touches){var t=e.touches[0]||e.changedTouches[0];e.clientX=t.clientX||0,e.clientY=t.clientY||0,e.offsetX=t.pageX-t.target.offsetLeft,e.offsetY=t.pageY-t.target.offsetTop}e._target=e.target||e.srcElement},typeOf:function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]},deepCopy:function(e,t){if("Object"===o.typeOf(t)&&"Object"===o.typeOf(e))return Object.keys(t).forEach((function(r){"Object"!==o.typeOf(t[r])||t[r]instanceof Node?"Array"===o.typeOf(t[r])?e[r]="Array"===o.typeOf(e[r])?e[r].concat(t[r]):t[r]:e[r]=t[r]:e[r]?o.deepCopy(e[r],t[r]):e[r]=t[r]})),e},getBgImage:function(e){var t=(e.currentStyle||window.getComputedStyle(e,null)).backgroundImage;if(!t||"none"===t)return"";var r=document.createElement("a");return r.href=t.replace(/url\("|"\)/g,""),r.href},copyDom:function(e){if(e&&1===e.nodeType){var t=document.createElement(e.tagName);return Array.prototype.forEach.call(e.attributes,(function(e){t.setAttribute(e.name,e.value)})),e.innerHTML&&(t.innerHTML=e.innerHTML),t}return""},setInterval:function(e,t,r,n){e._interval[t]||(e._interval[t]=setInterval(r.bind(e),n))},clearInterval:function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},createImgBtn:function(e,t,r,n){var i=o.createDom("xg-"+e,"",{},"xgplayer-"+e+"-img");if(i.style.backgroundImage='url("'+t+'")',r&&n){var a=void 0,s=void 0,l=void 0;["px","rem","em","pt","dp","vw","vh","vm","%"].every((function(e){return!(r.indexOf(e)>-1&&n.indexOf(e)>-1)||(a=Number(r.slice(0,r.indexOf(e)).trim()),s=Number(n.slice(0,n.indexOf(e)).trim()),l=e,!1)})),i.style.width=""+a+l,i.style.height=""+s+l,i.style.backgroundSize=""+a+l+" "+s+l,i.style.margin="start"===e?"-"+s/2+l+" auto auto -"+a/2+l:"auto 5px auto 5px"}return i},isWeiXin:function(){return window.navigator.userAgent.toLowerCase().indexOf("micromessenger")>-1},isUc:function(){return window.navigator.userAgent.toLowerCase().indexOf("ucbrowser")>-1},computeWatchDur:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],r=0;r<e.length;r++)if(!(!e[r].end||e[r].begin<0||e[r].end<0||e[r].end<e[r].begin))if(t.length<1)t.push({begin:e[r].begin,end:e[r].end});else for(var n=0;n<t.length;n++){var i=e[r].begin,a=e[r].end;if(a<t[n].begin){t.splice(n,0,{begin:i,end:a});break}if(!(i>t[n].end)){var o=t[n].begin,s=t[n].end;t[n].begin=Math.min(i,o),t[n].end=Math.max(a,s);break}if(n>t.length-2){t.push({begin:i,end:a});break}}for(var l=0,u=0;u<t.length;u++)l+=t[u].end-t[u].begin;return l},offInDestroy:function(e,t,r,n){e.once(n,(function i(){e.off(t,r),e.off(n,i)}))},on:function(e,t,r,n){n?(e.on(t,r),o.offInDestroy(e,t,r,n)):e.on(t,(function n(i){r(i),e.off(t,n)}))},once:function(e,t,r,n){n?(e.once(t,r),o.offInDestroy(e,t,r,n)):e.once(t,(function n(i){r(i),e.off(t,n)}))},getBuffered2:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,r=[],n=0;n<e.length;n++)r.push({start:e.start(n)<.5?0:e.start(n),end:e.end(n)});r.sort((function(e,t){var r=e.start-t.start;return r||t.end-e.end}));var i=[];if(t)for(var o=0;o<r.length;o++){var s=i.length;if(s){var l=i[s-1].end;r[o].start-l<t?r[o].end>l&&(i[s-1].end=r[o].end):i.push(r[o])}else i.push(r[o])}else i=r;return new a.default(i)}};t.default=o,e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.bufferedList=t}return n(e,[{key:"start",value:function(e){return this.bufferedList[e].start}},{key:"end",value:function(e){return this.bufferedList[e].end}},{key:"length",get:function(){return this.bufferedList.length}}]),e}();t.default=i,e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(8);function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a={network:{code:1,msg:"视频下载错误",remark:"只要视频下载错误就使用此类型,无论是video本身的超时还是xhr的分段请求超时或者资源不存在"},mse:{code:2,msg:"流追加错误",remark:"追加流的时候如果类型不对、无法被正确解码则会触发此类错误"},parse:{code:3,msg:"解析错误",remark:"mp4、hls、flv我们都是使用js进行格式解析,如果解析失败则会触发此类错误"},format:{code:4,msg:"格式错误",remark:"如果浏览器不支持的格式导致播放错误"},decoder:{code:5,msg:"解码错误",remark:"浏览器解码异常会抛出此类型错误"},runtime:{code:6,msg:"语法错误",remark:"播放器语法错误"},timeout:{code:7,msg:"播放超时",remark:"播放过程中无法正常请求下一个分段导致播放中断"},other:{code:8,msg:"其他错误",remark:"不可知的错误或被忽略的错误类型"}};t.default=function e(t,r,o,s,l,u,c,d){var f=arguments.length>8&&void 0!==arguments[8]?arguments[8]:{line:"",handle:"",msg:"",version:""},p=arguments[9],h=arguments[10];i(this,e);var g={};if(arguments.length>1)g.playerVersion=n.version,g.errorType=t,g.domain=document.domain,g.duration=o,g.currentTime=r,g.networkState=s,g.readyState=l,g.currentSrc=c,g.src=u,g.ended=d,g.errd=f,g.ex=(a[t]||{}).msg,g.errorCode=p,g.mediaError=h;else{var y=arguments[0];Object.keys(y).map((function(e){g[e]=y[e]})),g.ex=(y.type&&a[y.type]||{}).msg}return g},e.exports=t.default},function(e){e.exports=JSON.parse('{"version":"2.18.4"}')},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"s_i18n",method:function(){var e=this,t={},r=e.constructor.util;t.en={HAVE_NOTHING:"There is no information on whether audio/video is ready",HAVE_METADATA:"Audio/video metadata is ready ",HAVE_CURRENT_DATA:"Data about the current play location is available, but there is not enough data to play the next frame/millisecond",HAVE_FUTURE_DATA:"Current and at least one frame of data is available",HAVE_ENOUGH_DATA:"The available data is sufficient to start playing",NETWORK_EMPTY:"Audio/video has not been initialized",NETWORK_IDLE:"Audio/video is active and has been selected for resources, but no network is used",NETWORK_LOADING:"The browser is downloading the data",NETWORK_NO_SOURCE:"No audio/video source was found",MEDIA_ERR_ABORTED:"The fetch process is aborted by the user",MEDIA_ERR_NETWORK:"An error occurred while downloading",MEDIA_ERR_DECODE:"An error occurred while decoding",MEDIA_ERR_SRC_NOT_SUPPORTED:"Audio/video is not supported",REPLAY:"Replay",ERROR:"Network is offline",PLAY_TIPS:"Play",PAUSE_TIPS:"Pause",PLAYNEXT_TIPS:"Play next",DOWNLOAD_TIPS:"Download",ROTATE_TIPS:"Rotate",RELOAD_TIPS:"Reload",FULLSCREEN_TIPS:"Fullscreen",EXITFULLSCREEN_TIPS:"Exit fullscreen",CSSFULLSCREEN_TIPS:"Cssfullscreen",EXITCSSFULLSCREEN_TIPS:"Exit cssfullscreen",TEXTTRACK:"Caption",PIP:"Pip",MINIPLAYER:"Miniplayer",SCREENSHOT:"Screenshot",LIVE:"LIVE",OFF:"Off",MINIPLAYER_DRAG:"Click and hold to drag",AIRPLAY_TIPS:"Airplay"},t["zh-cn"]={HAVE_NOTHING:"没有关于音频/视频是否就绪的信息",HAVE_METADATA:"音频/视频的元数据已就绪",HAVE_CURRENT_DATA:"关于当前播放位置的数据是可用的,但没有足够的数据来播放下一帧/毫秒",HAVE_FUTURE_DATA:"当前及至少下一帧的数据是可用的",HAVE_ENOUGH_DATA:"可用数据足以开始播放",NETWORK_EMPTY:"音频/视频尚未初始化",NETWORK_IDLE:"音频/视频是活动的且已选取资源,但并未使用网络",NETWORK_LOADING:"浏览器正在下载数据",NETWORK_NO_SOURCE:"未找到音频/视频来源",MEDIA_ERR_ABORTED:"取回过程被用户中止",MEDIA_ERR_NETWORK:"当下载时发生错误",MEDIA_ERR_DECODE:"当解码时发生错误",MEDIA_ERR_SRC_NOT_SUPPORTED:"不支持的音频/视频格式",REPLAY:"重播",ERROR:"网络连接似乎出现了问题",PLAY_TIPS:"播放",PAUSE_TIPS:"暂停",PLAYNEXT_TIPS:"下一集",DOWNLOAD_TIPS:"下载",ROTATE_TIPS:"旋转",RELOAD_TIPS:"重新载入",FULLSCREEN_TIPS:"进入全屏",EXITFULLSCREEN_TIPS:"退出全屏",CSSFULLSCREEN_TIPS:"进入样式全屏",EXITCSSFULLSCREEN_TIPS:"退出样式全屏",TEXTTRACK:"字幕",PIP:"画中画",MINIPLAYER:"迷你播放器",SCREENSHOT:"截图",LIVE:"正在直播",OFF:"关闭",MINIPLAYER_DRAG:"点击按住可拖动视频",AIRPLAY_TIPS:"隔空播放"},t["zh-hk"]={HAVE_NOTHING:"沒有關於音頻/視頻是否就緒的信息",HAVE_METADATA:"音頻/視頻的元數據已就緒",HAVE_CURRENT_DATA:"關於當前播放位置的數據是可用的,但沒有足夠的數據來播放下壹幀/毫秒",HAVE_FUTURE_DATA:"當前及至少下壹幀的數據是可用的",HAVE_ENOUGH_DATA:"可用數據足以開始播放",NETWORK_EMPTY:"音頻/視頻尚未初始化",NETWORK_IDLE:"音頻/視頻是活動的且已選取資源,但並未使用網絡",NETWORK_LOADING:"瀏覽器正在下載數據",NETWORK_NO_SOURCE:"未找到音頻/視頻來源",MEDIA_ERR_ABORTED:"取回過程被用戶中止",MEDIA_ERR_NETWORK:"當下載時發生錯誤",MEDIA_ERR_DECODE:"當解碼時發生錯誤",MEDIA_ERR_SRC_NOT_SUPPORTED:"不支持的音頻/視頻格式",REPLAY:"重播",ERROR:"網絡連接似乎出現了問題",PLAY_TIPS:"播放",PAUSE_TIPS:"暫停",PLAYNEXT_TIPS:"下壹集",DOWNLOAD_TIPS:"下載",ROTATE_TIPS:"旋轉",RELOAD_TIPS:"重新載入",FULLSCREEN_TIPS:"進入全屏",EXITFULLSCREEN_TIPS:"退出全屏",CSSFULLSCREEN_TIPS:"進入樣式全屏",EXITCSSFULLSCREEN_TIPS:"退出樣式全屏",TEXTTRACK:"字幕",PIP:"畫中畫",MINIPLAYER:"迷妳播放器",SCREENSHOT:"截圖",LIVE:"正在直播",OFF:"關閉",MINIPLAYER_DRAG:"點擊按住可拖動視頻",AIRPLAY_TIPS:"隔空播放"},t.jp={HAVE_NOTHING:"オーディオ/ビデオが準備できているか情報がありません",HAVE_METADATA:"オーディオ/ビデオのメタデータは準備できています",HAVE_CURRENT_DATA:"現在の再生位置に関するデータは利用可能ですが、次のフレーム/ミリ秒を再生するのに十分なデータがありません",HAVE_FUTURE_DATA:"現在、少なくとも次のフレームのデータが利用可能です",HAVE_ENOUGH_DATA:"利用可能なデータは再生を開始するのに十分です",NETWORK_EMPTY:"オーディオ/ビデオが初期化されていません",NETWORK_IDLE:"オーディオ/ビデオはアクティブでリソースが選択されていますが、ネットワークが使用されていません",NETWORK_LOADING:"ブラウザーはデータをダウンロードしています",NETWORK_NO_SOURCE:"オーディオ/ビデオ のソースが見つかりません",MEDIA_ERR_ABORTED:"ユーザーによってフェッチプロセスが中止されました",MEDIA_ERR_NETWORK:"ダウンロード中にエラーが発生しました",MEDIA_ERR_DECODE:"デコード中にエラーが発生しました",MEDIA_ERR_SRC_NOT_SUPPORTED:"オーディオ/ビデオ の形式がサポートされていません",REPLAY:"リプレイ",ERROR:"ネットワークの接続に問題が発生しました",PLAY_TIPS:"プレイ",PAUSE_TIPS:"一時停止",PLAYNEXT_TIPS:"次をプレイ",DOWNLOAD_TIPS:"ダウンロード",ROTATE_TIPS:"回転",RELOAD_TIPS:"再読み込み",FULLSCREEN_TIPS:"フルスクリーン",EXITFULLSCREEN_TIPS:"フルスクリーンを終了",CSSFULLSCREEN_TIPS:"シアターモード",EXITCSSFULLSCREEN_TIPS:"シアターモードを終了",TEXTTRACK:"字幕",PIP:"ミニプレーヤー",MINIPLAYER:"ミニプレーヤー",SCREENSHOT:"スクリーンショット",LIVE:"生放送",OFF:"オフ",MINIPLAYER_DRAG:"ボタンを押して働画をドラッグする",AIRPLAY_TIPS:"隔空放送"},Object.defineProperty(e,"lang",{get:function(){return e.config&&t[e.config.lang]||t.en},set:function(e){"Object"===r.typeOf(e)&&Object.keys(e).forEach((function(r){t[r]=e[r]}))}})}},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=s(r(11)),a=s(r(5)),o=s(r(7));function s(e){return e&&e.__esModule?e:{default:e}}var l=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.logParams={bc:0,bu_acu_t:0,played:[]},this._hasStart=!1,this.videoConfig={controls:!!t.isShowControl,autoplay:t.autoplay,playsinline:t.playsinline,"webkit-playsinline":t.playsinline,"x5-playsinline":t.playsinline,"x5-video-player-type":t["x5-video-player-type"]||t.x5VideoPlayerType,"x5-video-player-fullscreen":t["x5-video-player-fullscreen"]||t.x5VideoPlayerFullscreen,"x5-video-orientation":t["x5-video-orientation"]||t.x5VideoOrientation,airplay:t.airplay,"webkit-airplay":t.airplay,tabindex:2,mediaType:t.mediaType||"video"},t.muted&&(this.videoConfig.muted="muted"),t.loop&&(this.videoConfig.loop="loop");var r=t.el?t.el:a.default.findDom(document,"#"+t.id);window.XgVideoProxy&&r.hasAttribute("data-xgmse")?this.video=new window.XgVideoProxy(r,t):this.video=a.default.createDom(this.videoConfig.mediaType,"",this.videoConfig,""),t.autoplay&&(this.video.autoplay=!0,t.autoplayMuted&&(this.video.muted=!0)),this.ev=["play","playing","pause","ended","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","volumechange","loadeddata","loadstart"].map((function(e){return t={},r=e,n="on"+e.charAt(0).toUpperCase()+e.slice(1),r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t;var t,r,n})),(0,i.default)(this),this._interval={};var n="0,0",o=this;this.ev.forEach((function(e){o.evItem=Object.keys(e)[0];var t=Object.keys(e)[0];o.video.addEventListener(Object.keys(e)[0],(function(){o&&o.logParams&&("play"===t?o.hasStart=!0:"canplay"===t?a.default.removeClass(o.root,"xgplayer-is-enter"):"waiting"===t?(o.logParams.bc++,o.inWaitingStart=(new Date).getTime()):"playing"===t?(a.default.removeClass(o.root,"xgplayer-is-enter"),o.inWaitingStart&&(o.logParams.bu_acu_t+=(new Date).getTime()-o.inWaitingStart,o.inWaitingStart=void 0)):"loadeddata"===t?o.logParams.played.push({begin:0,end:-1}):"seeking"===t?o.logParams.played.push({begin:o.video.currentTime,end:-1}):o&&o.logParams&&o.logParams.played&&"timeupdate"===t&&(o.logParams.played.length<1&&o.logParams.played.push({begin:o.video.currentTime,end:-1}),o.logParams.played[o.logParams.played.length-1].end=o.video.currentTime),"error"===t?o._onError(t):o.emit(t,o),o.hasOwnProperty("_interval")&&(["ended","error","timeupdate"].indexOf(t)<0?(a.default.clearInterval(o,"bufferedChange"),a.default.setInterval(o,"bufferedChange",(function(){if(o.video&&o.video.buffered){for(var e=[],t=0,r=o.video.buffered.length;t<r;t++)e.push([o.video.buffered.start(t),o.video.buffered.end(t)]);e.toString()!==n&&(n=e.toString(),o.emit("bufferedChange",e))}}),200)):"timeupdate"!==t&&a.default.clearInterval(o,"bufferedChange")))}),!1)}))}return n(e,[{key:"_onError",value:function(e){this.video&&this.video.error&&this.emit(e,new o.default("other",this.currentTime,this.duration,this.networkState,this.readyState,this.currentSrc,this.src,this.ended,{line:162,msg:this.error,handle:"Constructor"},this.video.error.code,this.video.error))}},{key:"destroy",value:function(){this.textTrackStyle&&this.textTrackStyle.parentNode.removeChild(this.textTrackStyle)}},{key:"play",value:function(){return this.video.play()}},{key:"pause",value:function(){this.video.pause()}},{key:"canPlayType",value:function(e){return this.video.canPlayType(e)}},{key:"getBufferedRange",value:function(e){var t=[0,0],r=this.video;e||(e=r.buffered);var n=r.currentTime;if(e)for(var i=0,a=e.length;i<a&&(t[0]=e.start(i),t[1]=e.end(i),!(t[0]<=n&&n<=t[1]));i++);return t[0]-n<=0&&n-t[1]<=0?t:[0,0]}},{key:"proxyOn",value:function(e,t){a.default.on(this,e,t,"destroy")}},{key:"proxyOnce",value:function(e,t){a.default.once(this,e,t,"destroy")}},{key:"hasStart",get:function(){return this._hasStart},set:function(e){"boolean"!=typeof e||!0!==e||this._hasStart||(this._hasStart=!0,this.emit("hasstart"))}},{key:"autoplay",set:function(e){this.video.autoplay=e},get:function(){return this.video.autoplay}},{key:"buffered",get:function(){return this.video.buffered}},{key:"buffered2",get:function(){return a.default.getBuffered2(this.video.buffered)}},{key:"crossOrigin",get:function(){return this.video.crossOrigin},set:function(e){this.video.crossOrigin=e}},{key:"currentSrc",get:function(){return this.video.currentSrc}},{key:"currentTime",get:function(){return this.video&&this.video.currentTime||0},set:function(e){var t=this;("function"!=typeof isFinite||isFinite(e))&&(a.default.hasClass(this.root,"xgplayer-ended")?(this.once("playing",(function(){t.video.currentTime=e})),this.replay()):this.video.currentTime=e,this.emit("currentTimeChange"))}},{key:"defaultMuted",get:function(){return this.video.defaultMuted},set:function(e){this.video.defaultMuted=e}},{key:"duration",get:function(){return this.video.duration}},{key:"ended",get:function(){return!this.video||this.video.ended||!1}},{key:"error",get:function(){var e=this.video.error;if(!e)return null;var t=[{en:"MEDIA_ERR_ABORTED",cn:"取回过程被用户中止"},{en:"MEDIA_ERR_NETWORK",cn:"当下载时发生错误"},{en:"MEDIA_ERR_DECODE",cn:"当解码时发生错误"},{en:"MEDIA_ERR_SRC_NOT_SUPPORTED",cn:"不支持音频/视频"}];return this.lang?this.lang[t[e.code-1].en]:t[e.code-1].en}},{key:"loop",get:function(){return this.video.loop},set:function(e){this.video.loop=e}},{key:"muted",get:function(){return this.video.muted},set:function(e){this.video.muted=e}},{key:"networkState",get:function(){var e=[{en:"NETWORK_EMPTY",cn:"音频/视频尚未初始化"},{en:"NETWORK_IDLE",cn:"音频/视频是活动的且已选取资源,但并未使用网络"},{en:"NETWORK_LOADING",cn:"浏览器正在下载数据"},{en:"NETWORK_NO_SOURCE",cn:"未找到音频/视频来源"}];return this.lang?this.lang[e[this.video.networkState].en]:e[this.video.networkState].en}},{key:"paused",get:function(){return this.video.paused}},{key:"playbackRate",get:function(){return this.video.playbackRate},set:function(e){this.video.playbackRate=e}},{key:"played",get:function(){return this.video.played}},{key:"preload",get:function(){return this.video.preload},set:function(e){this.video.preload=e}},{key:"readyState",get:function(){var e=[{en:"HAVE_NOTHING",cn:"没有关于音频/视频是否就绪的信息"},{en:"HAVE_METADATA",cn:"关于音频/视频就绪的元数据"},{en:"HAVE_CURRENT_DATA",cn:"关于当前播放位置的数据是可用的,但没有足够的数据来播放下一帧/毫秒"},{en:"HAVE_FUTURE_DATA",cn:"当前及至少下一帧的数据是可用的"},{en:"HAVE_ENOUGH_DATA",cn:"可用数据足以开始播放"}];return this.lang?this.lang[e[this.video.readyState].en]:e[this.video.readyState]}},{key:"seekable",get:function(){return this.video.seekable}},{key:"seeking",get:function(){return this.video.seeking}},{key:"src",get:function(){return this.video.src},set:function(e){var t=this;a.default.hasClass(this.root,"xgplayer-ended")||this.emit("urlchange",JSON.parse(JSON.stringify(t.logParams))),this.logParams={bc:0,bu_acu_t:0,played:[],pt:(new Date).getTime(),vt:(new Date).getTime(),vd:0},this.autoplay=!0,this.video.pause(),this.video.src=e,this.emit("srcChange"),this.logParams.playSrc=e,this.logParams.pt=(new Date).getTime(),this.logParams.vt=this.logParams.pt,this.once("loadeddata",(function e(){t.logParams.vt=(new Date).getTime(),t.logParams.pt>t.logParams.vt&&(t.logParams.pt=t.logParams.vt),t.logParams.vd=t.video.duration,t.off("loadeddata",e)}))}},{key:"poster",set:function(e){var t=a.default.findDom(this.root,".xgplayer-poster");t&&(t.style.backgroundImage="url("+e+")")}},{key:"volume",get:function(){return this.video.volume},set:function(e){this.video.volume=e}},{key:"fullscreen",get:function(){return a.default.hasClass(this.root,"xgplayer-is-fullscreen")||a.default.hasClass(this.root,"xgplayer-fullscreen-active")}},{key:"bullet",get:function(){return!!a.default.findDom(this.root,"xg-danmu")&&a.default.hasClass(a.default.findDom(this.root,"xg-danmu"),"xgplayer-has-danmu")}},{key:"textTrack",get:function(){return a.default.hasClass(this.root,"xgplayer-is-textTrack")}},{key:"pip",get:function(){return a.default.hasClass(this.root,"xgplayer-pip-active")}}]),e}();t.default=l,e.exports=t.default},function(e,t,r){"use strict";var n,i,a,o,s,l,u,c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d=r(12),f=r(29),p=Function.prototype.apply,h=Function.prototype.call,g=Object.create,y=Object.defineProperty,v=Object.defineProperties,m=Object.prototype.hasOwnProperty,x={configurable:!0,enumerable:!1,writable:!0};i=function(e,t){var r,i;return f(t),i=this,n.call(this,e,r=function(){a.call(i,e,r),p.call(t,this,arguments)}),r.__eeOnceListener__=t,this},s={on:n=function(e,t){var r;return f(t),m.call(this,"__ee__")?r=this.__ee__:(r=x.value=g(null),y(this,"__ee__",x),x.value=null),r[e]?"object"===c(r[e])?r[e].push(t):r[e]=[r[e],t]:r[e]=t,this},once:i,off:a=function(e,t){var r,n,i,a;if(f(t),!m.call(this,"__ee__"))return this;if(!(r=this.__ee__)[e])return this;if("object"===(void 0===(n=r[e])?"undefined":c(n)))for(a=0;i=n[a];++a)i!==t&&i.__eeOnceListener__!==t||(2===n.length?r[e]=n[a?0:1]:n.splice(a,1));else n!==t&&n.__eeOnceListener__!==t||delete r[e];return this},emit:o=function(e){var t,r,n,i,a;if(m.call(this,"__ee__")&&(i=this.__ee__[e]))if("object"===(void 0===i?"undefined":c(i))){for(r=arguments.length,a=new Array(r-1),t=1;t<r;++t)a[t-1]=arguments[t];for(i=i.slice(),t=0;n=i[t];++t)p.call(n,this,a)}else switch(arguments.length){case 1:h.call(i,this);break;case 2:h.call(i,this,arguments[1]);break;case 3:h.call(i,this,arguments[1],arguments[2]);break;default:for(r=arguments.length,a=new Array(r-1),t=1;t<r;++t)a[t-1]=arguments[t];p.call(i,this,a)}}},l={on:d(n),once:d(i),off:d(a),emit:d(o)},u=v({},l),e.exports=t=function(e){return null==e?g(u):v(Object(e),l)},t.methods=s},function(e,t,r){"use strict";var n=r(4),i=r(13),a=r(17),o=r(25),s=r(26);(e.exports=function(e,t){var r,i,l,u,c;return arguments.length<2||"string"!=typeof e?(u=t,t=e,e=null):u=arguments[2],n(e)?(r=s.call(e,"c"),i=s.call(e,"e"),l=s.call(e,"w")):(r=l=!0,i=!1),c={value:t,configurable:r,enumerable:i,writable:l},u?a(o(u),c):c}).gs=function(e,t,r){var l,u,c,d;return"string"!=typeof e?(c=r,r=t,t=e,e=null):c=arguments[3],n(t)?i(t)?n(r)?i(r)||(c=r,r=void 0):r=void 0:(c=t,t=r=void 0):t=void 0,n(e)?(l=s.call(e,"c"),u=s.call(e,"e")):(l=!0,u=!1),d={get:t,set:r,configurable:l,enumerable:u},c?a(o(c),d):d}},function(e,t,r){"use strict";var n=r(14),i=/^\s*class[\s{/}]/,a=Function.prototype.toString;e.exports=function(e){return!!n(e)&&!i.test(a.call(e))}},function(e,t,r){"use strict";var n=r(15);e.exports=function(e){if("function"!=typeof e)return!1;if(!hasOwnProperty.call(e,"length"))return!1;try{if("number"!=typeof e.length)return!1;if("function"!=typeof e.call)return!1;if("function"!=typeof e.apply)return!1}catch(e){return!1}return!n(e)}},function(e,t,r){"use strict";var n=r(16);e.exports=function(e){if(!n(e))return!1;try{return!!e.constructor&&e.constructor.prototype===e}catch(e){return!1}}},function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(4),a={object:!0,function:!0,undefined:!0};e.exports=function(e){return!!i(e)&&hasOwnProperty.call(a,void 0===e?"undefined":n(e))}},function(e,t,r){"use strict";e.exports=r(18)()?Object.assign:r(19)},function(e,t,r){"use strict";e.exports=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},function(e,t,r){"use strict";var n=r(20),i=r(24),a=Math.max;e.exports=function(e,t){var r,o,s,l=a(arguments.length,2);for(e=Object(i(e)),s=function(n){try{e[n]=t[n]}catch(e){r||(r=e)}},o=1;o<l;++o)n(t=arguments[o]).forEach(s);if(void 0!==r)throw r;return e}},function(e,t,r){"use strict";e.exports=r(21)()?Object.keys:r(22)},function(e,t,r){"use strict";e.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}},function(e,t,r){"use strict";var n=r(3),i=Object.keys;e.exports=function(e){return i(n(e)?Object(e):e)}},function(e,t,r){"use strict";e.exports=function(){}},function(e,t,r){"use strict";var n=r(3);e.exports=function(e){if(!n(e))throw new TypeError("Cannot use null or undefined");return e}},function(e,t,r){"use strict";var n=r(3),i=Array.prototype.forEach,a=Object.create,o=function(e,t){var r;for(r in e)t[r]=e[r]};e.exports=function(e){var t=a(null);return i.call(arguments,(function(e){n(e)&&o(Object(e),t)})),t}},function(e,t,r){"use strict";e.exports=r(27)()?String.prototype.contains:r(28)},function(e,t,r){"use strict";var n="razdwatrzy";e.exports=function(){return"function"==typeof n.contains&&!0===n.contains("dwa")&&!1===n.contains("foo")}},function(e,t,r){"use strict";var n=String.prototype.indexOf;e.exports=function(e){return n.call(this,e,arguments[1])>-1}},function(e,t,r){"use strict";e.exports=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={get device(){return n.os.isPc?"pc":"mobile"},get browser(){var e=navigator.userAgent.toLowerCase(),t={ie:/rv:([\d.]+)\) like gecko/,firfox:/firefox\/([\d.]+)/,chrome:/chrome\/([\d.]+)/,opera:/opera.([\d.]+)/,safari:/version\/([\d.]+).*safari/};return[].concat(Object.keys(t).filter((function(r){return t[r].test(e)})))[0]},get os(){var e=navigator.userAgent,t=/(?:Windows Phone)/.test(e),r=/(?:SymbianOS)/.test(e)||t,n=/(?:Android)/.test(e),i=/(?:Firefox)/.test(e),a=/(?:iPad|PlayBook)/.test(e)||n&&!/(?:Mobile)/.test(e)||i&&/(?:Tablet)/.test(e),o=/(?:iPhone)/.test(e)&&!a;return{isTablet:a,isPhone:o,isAndroid:n,isPc:!(o||n||r||a),isSymbian:r,isWindowsPhone:t,isFireFox:i}}};t.default=n,e.exports=t.default},function(e,t,r){"use strict";var n=r(32),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t,r=arguments[1];if(n(e),void 0===r)i.call(e,"__ee__")&&delete e.__ee__;else{if(!(t=i.call(e,"__ee__")&&e.__ee__))return;t[r]&&delete t[r]}}},function(e,t,r){"use strict";var n=r(33);e.exports=function(e){if(!n(e))throw new TypeError(e+" is not an Object");return e}},function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(3),a={function:!0,object:!0};e.exports=function(e){return i(e)&&a[void 0===e?"undefined":n(e)]||!1}},function(e,t,r){var n=r(35);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};r(2)(n,i),n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(1)(!1)).push([e.i,".xgplayer-skin-default{background:#000;width:100%;height:100%;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;-ms-user-select:none}.xgplayer-skin-default *{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}.xgplayer-skin-default.xgplayer-rotate-fullscreen{position:absolute;top:0;left:100%;bottom:0;right:0;height:100vw!important;width:100vh!important;-webkit-transform-origin:top left;-ms-transform-origin:top left;transform-origin:top left;-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.xgplayer-skin-default.xgplayer-is-fullscreen{width:100%!important;height:100%!important;padding-top:0!important;z-index:9999}.xgplayer-skin-default.xgplayer-is-fullscreen.xgplayer-inactive{cursor:none}.xgplayer-skin-default video{width:100%;height:100%;outline:none}.xgplayer-skin-default .xgplayer-none{display:none}@-webkit-keyframes loadingRotate{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes loadingRotate{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes loadingDashOffset{0%{stroke-dashoffset:236}to{stroke-dashoffset:0}}@keyframes loadingDashOffset{0%{stroke-dashoffset:236}to{stroke-dashoffset:0}}.xgplayer-skin-default .xgplayer-controls{display:-webkit-flex;display:-moz-box;display:flex;position:absolute;bottom:0;left:0;right:0;height:40px;background-image:linear-gradient(180deg,transparent,rgba(0,0,0,.37),rgba(0,0,0,.75),rgba(0,0,0,.75));z-index:10}.xgplayer-skin-default.xgplayer-inactive .xgplayer-controls,.xgplayer-skin-default.xgplayer-is-live .xgplayer-controls .xgplayer-progress,.xgplayer-skin-default.xgplayer-is-live .xgplayer-controls .xgplayer-time,.xgplayer-skin-default.xgplayer-no-controls .xgplayer-controls,.xgplayer-skin-default.xgplayer-nostart .xgplayer-controls{display:none}.xgplayer-skin-default.xgplayer-is-live .xgplayer-controls .xgplayer-live{display:block}.xgplayer-skin-default .xgplayer-live{display:block;font-size:12px;color:#fff;line-height:40px;-webkit-order:1;-moz-box-ordinal-group:2;order:1}.xgplayer-skin-default .xgplayer-icon{display:block;width:40px;height:40px;overflow:hidden;fill:#fff}.xgplayer-skin-default .xgplayer-icon svg{position:absolute}.xgplayer-skin-default .xgplayer-tips{background:rgba(0,0,0,.54);border-radius:1px;display:none;position:absolute;font-family:PingFangSC-Regular;font-size:11px;color:#fff;padding:2px 4px;text-align:center;top:-30px;left:50%;margin-left:-16px;width:auto;white-space:nowrap}.xgplayer-skin-default.xgplayer-mobile .xgplayer-tips{display:none!important}.xgplayer-skin-default .xgplayer-screen-container,.xgplayer-skin-default .xgplayer-screen-container .xgplayer-screen-canvas{width:100%;height:100%}",""])},function(e,t,r){"use strict";e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var r=t.protocol+"//"+t.host,n=r+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(e,t){var i,a=t.trim().replace(/^"(.*)"$/,(function(e,t){return t})).replace(/^'(.*)'$/,(function(e,t){return t}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(a)?e:(i=0===a.indexOf("//")?a:0===a.indexOf("/")?r+a:n+a.replace(/^\.\//,""),"url("+JSON.stringify(i)+")")}))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0),a=(n=i)&&n.__esModule?n:{default:n};t.default={name:"start",method:function(){var e=this,t=e.root,r=a.default.util;function n(){e.off("canplay",n);var t=e.play();void 0!==t&&t&&t.catch((function(e){}))}function i(){r.hasClass(t,"xgplayer-nostart")?(r.removeClass(t,"xgplayer-nostart"),r.addClass(t,"xgplayer-is-enter"),"function"==typeof t.contains?e.video&&1===e.video.nodeType&&!t.contains(e.video)||e.video&&1!==e.video.nodeType&&"ready"!==e.video.audioPlayer.status?(e.once("canplay",n),e.start()):n():e.video&&1===e.video.nodeType&&!t.querySelector(this.videoConfig.mediaType)||e.video&&1!==e.video.nodeType&&!t.querySelector("canvas")&&"ready"!==e.video.audioPlayer.status?(e.once("canplay",n),e.start()):n()):e.paused&&(r.removeClass(t,"xgplayer-nostart xgplayer-isloading"),setTimeout((function(){var t=e.play();void 0!==t&&t&&t.catch((function(e){}))}),10))}e.on("startBtnClick",i),e.once("destroy",(function t(){e.off("startBtnClick",i),e.off("canplay",n),e.off("destroy",t)}))}},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0),a=(n=i)&&n.__esModule?n:{default:n};t.default={name:"pc",method:function(){var e=this;if(e.controls&&e.video){var t=a.default.util,r=e.controls,n=e.root,i=0,o=void 0;e.onElementClick=function(e,r){this.config.closeVideoPreventDefault||e.preventDefault(),this.config.closeVideoStopPropagation||e.stopPropagation();var n=this;n.config.closeVideoClick||(i++,o&&clearTimeout(o),1===i?o=setTimeout((function(){if(t.hasClass(n.root,"xgplayer-nostart"))return!1;if(!n.ended)if(n.paused){var e=n.play();void 0!==e&&e&&e.catch((function(e){}))}else n.pause();i=0}),200):i=0)},e.video.addEventListener("click",(function(t){e.onElementClick(t,e.video)}),!1),e.onElementDblclick=function(e,t){if(this.config.closeVideoPreventDefault||e.preventDefault(),this.config.closeVideoStopPropagation||e.stopPropagation(),!this.config.closeVideoDblclick){var n=r.querySelector(".xgplayer-fullscreen");if(n){var i=void 0;document.createEvent?(i=document.createEvent("Event")).initEvent("click",!0,!0):i=new Event("click"),n.dispatchEvent(i)}}},e.video.addEventListener("dblclick",(function(t){e.onElementDblclick(t,e.video)}),!1),n.addEventListener("mouseenter",s),n.addEventListener("mouseleave",l),r.addEventListener("mouseenter",(function(t){e.userTimer&&clearTimeout(e.userTimer)})),r.addEventListener("mouseleave",(function(t){e.config.closeControlsBlur||e.emit("focus",e)})),r.addEventListener("click",(function(e){e.preventDefault(),e.stopPropagation()})),e.once("ready",u),e.once("destroy",(function t(){n.removeEventListener("mouseenter",s),n.removeEventListener("mouseleave",l),e.off("ready",u),e.off("destroy",t)}))}function s(){clearTimeout(e.leavePlayerTimer),e.emit("focus",e)}function l(){e.config.closePlayerBlur||(e.leavePlayerTimer=setTimeout((function(){e.emit("blur",e)}),e.config.leavePlayerTime||0))}function u(t){e.config.autoplay&&e.start()}}},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0),a=(n=i)&&n.__esModule?n:{default:n};t.default={name:"mobile",method:function(){var e=this,t=a.default.util,r=e.root,n=0,i=void 0,o={first:"",second:""};function s(t){e.video.addEventListener("touchend",(function(t){e.onElementTouchend(t,e.video)})),e.video.addEventListener("touchstart",(function(){e.isTouchMove=!1})),e.video.addEventListener("touchmove",(function(){e.isTouchMove=!0})),e.config.autoplay&&e.start()}e.onElementTouchend=function(e,a){this.config.closeVideoPreventDefault||e.preventDefault(),this.config.closeVideoStopPropagation||e.stopPropagation();var s=this;if(t.hasClass(r,"xgplayer-inactive")?s.emit("focus"):s.emit("blur"),!s.config.closeVideoTouch&&!s.isTouchMove){var l=function(){i=setTimeout((function(){if(t.hasClass(s.root,"xgplayer-nostart"))return!1;if(!s.ended)if(s.paused){var e=s.play();void 0!==e&&e&&e.catch((function(e){}))}else s.pause();n=0}),200)};s.config.closeVideoClick||(n++,i&&clearTimeout(i),1===n?s.config.enableVideoDbltouch?o.first=new Date:l():2===n&&s.config.enableVideoDbltouch?(o.second=new Date,Math.abs(o.first-o.second)<400?l():(o.first=new Date,n=1)):n=0)}},e.once("ready",s),e.once("destroy",(function t(){e.off("ready",s),e.off("destroy",t)}))}},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o(r(0)),i=o(r(41)),a=o(r(42));function o(e){return e&&e.__esModule?e:{default:e}}r(43),t.default={name:"s_start",method:function(){var e=this,t=e.root,r=n.default.util,o=r.createDom("xg-start",'<div class="xgplayer-icon-play">'+i.default+'</div>\n                                      <div class="xgplayer-icon-pause">'+a.default+"</div>",{},"xgplayer-start");function s(e){r.addClass(e.root,"xgplayer-skin-default"),e.config&&(e.config.autoplay&&!r.isWeiXin()&&!r.isUc()&&r.addClass(e.root,"xgplayer-is-enter"),e.config.lang&&"en"===e.config.lang?r.addClass(e.root,"xgplayer-lang-is-en"):"jp"===e.config.lang&&r.addClass(e.root,"xgplayer-lang-is-jp"),e.config.enableContextmenu||e.video.addEventListener("contextmenu",(function(e){e.preventDefault(),e.stopPropagation()})))}e.isReady?(t.appendChild(o),s(e)):e.once("ready",(function(){t.appendChild(o),s(e)})),e.once("autoplay was prevented",(function(){r.removeClass(e.root,"xgplayer-is-enter"),r.addClass(e.root,"xgplayer-nostart")})),e.once("canplay",(function(){r.removeClass(e.root,"xgplayer-is-enter")})),o.onclick=function(t){t.preventDefault(),t.stopPropagation(),e.emit("startBtnClick")}}},e.exports=t.default},function(e,t,r){"use strict";r.r(t),t.default='<svg xmlns="http://www.w3.org/2000/svg" width="70" height="70" viewBox="0 0 70 70">\n  <path transform="translate(15,15) scale(0.04,0.04)" d="M576,363L810,512L576,661zM342,214L576,363L576,661L342,810z"></path>\n</svg>\n'},function(e,t,r){"use strict";r.r(t),t.default='<svg xmlns="http://www.w3.org/2000/svg" width="70" height="70" viewBox="0 0 70 70">\n  <path transform="translate(15,15) scale(0.04 0.04)" d="M598,214h170v596h-170v-596zM256 810v-596h170v596h-170z"></path>\n</svg>\n'},function(e,t,r){var n=r(44);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};r(2)(n,i),n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(1)(!1)).push([e.i,".xgplayer-skin-default .xgplayer-start{border-radius:50%;display:inline-block;width:70px;height:70px;background:rgba(0,0,0,.38);overflow:hidden;text-align:center;line-height:70px;vertical-align:middle;position:absolute;left:50%;top:50%;z-index:115;margin:-35px auto auto -35px;cursor:pointer}.xgplayer-skin-default .xgplayer-start div{position:absolute}.xgplayer-skin-default .xgplayer-start div svg{fill:hsla(0,0%,100%,.7)}.xgplayer-skin-default .xgplayer-start .xgplayer-icon-play{display:block}.xgplayer-skin-default .xgplayer-start .xgplayer-icon-pause{display:none}.xgplayer-skin-default .xgplayer-start:hover{opacity:.85}.xgplayer-skin-default.xgplayer-playing .xgplayer-start,.xgplayer-skin-default.xgplayer-playing .xgplayer-start .xgplayer-icon-play{display:none}.xgplayer-skin-default.xgplayer-playing .xgplayer-start .xgplayer-icon-pause{display:block}.xgplayer-skin-default.xgplayer-pause .xgplayer-start{display:inline-block}.xgplayer-skin-default.xgplayer-pause .xgplayer-start .xgplayer-icon-play{display:block}.xgplayer-skin-default.xgplayer-is-replay .xgplayer-start,.xgplayer-skin-default.xgplayer-pause .xgplayer-start .xgplayer-icon-pause{display:none}.xgplayer-skin-default.xgplayer-is-replay .xgplayer-start .xgplayer-icon-play{display:block}.xgplayer-skin-default.xgplayer-is-replay .xgplayer-start .xgplayer-icon-pause{display:none}",""])},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0),a=(n=i)&&n.__esModule?n:{default:n};t.default={name:"replay",method:function(){var e=this,t=a.default.util,r=e.root;function n(){t.removeClass(r,"xgplayer-is-replay"),e.replay()}e.on("replayBtnClick",n),e.on("ended",(function(){e.config.loop||t.addClass(r,"xgplayer-is-replay")})),e.once("destroy",(function t(){e.off("replayBtnClick",n),e.off("destroy",t)}))}},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0);(n=i)&&n.__esModule,t.default={name:"play",method:function(){var e=this;function t(){if(e.config.allowPlayAfterEnded||!e.ended)if(e.paused){var t=e.play();void 0!==t&&t&&t.catch((function(e){}))}else e.pause()}e.on("playBtnClick",t),e.once("destroy",(function r(){e.off("playBtnClick",t),e.off("destroy",r)}))}},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0),a=(n=i)&&n.__esModule?n:{default:n};t.default={name:"fullscreen",method:function(){var e=this,t=e.root,r=a.default.util;function n(){e.config.rotateFullscreen?r.hasClass(t,"xgplayer-rotate-fullscreen")?e.exitRotateFullscreen():e.getRotateFullscreen():r.hasClass(t,"xgplayer-is-fullscreen")?e.exitFullscreen(t):e.getFullscreen(t)}function i(){var n=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement;n&&n===t?(r.addClass(t,"xgplayer-is-fullscreen"),e.emit("requestFullscreen")):r.hasClass(t,"xgplayer-is-fullscreen")&&(r.removeClass(t,"xgplayer-is-fullscreen"),e.emit("exitFullscreen")),e.danmu&&"function"==typeof e.danmu.resize&&e.danmu.resize()}e.on("fullscreenBtnClick",n),["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"].forEach((function(e){document.addEventListener(e,i)})),e.video.addEventListener("webkitbeginfullscreen",(function(){r.addClass(t,"xgplayer-is-fullscreen"),e.emit("requestFullscreen")})),e.video.addEventListener("webkitendfullscreen",(function(){r.removeClass(t,"xgplayer-is-fullscreen"),e.emit("exitFullscreen")})),e.once("destroy",(function t(){e.off("fullscreenBtnClick",n),["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"].forEach((function(e){document.removeEventListener(e,i)})),e.off("destroy",t)})),e.getFullscreen=function(e){var t=this;if(e.requestFullscreen){var n=e.requestFullscreen();n&&n.catch((function(){t.emit("fullscreen error")}))}else e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen(window.Element.ALLOW_KEYBOARD_INPUT):t.video.webkitSupportsFullscreen?t.video.webkitEnterFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():r.addClass(e,"xgplayer-is-cssfullscreen")},e.exitFullscreen=function(e){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen(),r.removeClass(e,"xgplayer-is-cssfullscreen")},e.getRotateFullscreen=function(){document.documentElement.style.width="100%",document.documentElement.style.height="100%",this.root&&!a.default.util.hasClass(this.root,"xgplayer-rotate-fullscreen")&&a.default.util.addClass(this.root,"xgplayer-rotate-fullscreen"),this.emit("getRotateFullscreen")},e.exitRotateFullscreen=function(){document.documentElement.style.width="unset",document.documentElement.style.height="unset",this.root&&a.default.util.hasClass(this.root,"xgplayer-rotate-fullscreen")&&a.default.util.removeClass(this.root,"xgplayer-rotate-fullscreen"),this.emit("exitRotateFullscreen")}}},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o(r(0)),i=o(r(49)),a=o(r(50));function o(e){return e&&e.__esModule?e:{default:e}}r(51),t.default={name:"s_play",method:function(){var e=this,t=n.default.util,r=e.config.playBtn?e.config.playBtn:{},o=void 0;o="img"===r.type?t.createImgBtn("play",r.url.play,r.width,r.height):t.createDom("xg-play",'<xg-icon class="xgplayer-icon">\n                                      <div class="xgplayer-icon-play">'+i.default+'</div>\n                                      <div class="xgplayer-icon-pause">'+a.default+"</div>\n                                     </xg-icon>",{},"xgplayer-play");var s={};s.play=e.lang.PLAY_TIPS,s.pause=e.lang.PAUSE_TIPS;var l=t.createDom("xg-tips",'<span class="xgplayer-tip-play">'+s.play+'</span>\n                                        <span class="xgplayer-tip-pause">'+s.pause+"</span>",{},"xgplayer-tips");o.appendChild(l),e.once("ready",(function(){e.controls&&e.controls.appendChild(o)})),["click","touchend"].forEach((function(t){o.addEventListener(t,(function(t){t.preventDefault(),t.stopPropagation(),e.emit("playBtnClick")}))}))}},e.exports=t.default},function(e,t,r){"use strict";r.r(t),t.default='<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40">\n  <path transform="translate(2,2) scale(0.0320625 0.0320625)" d="M576,363L810,512L576,661zM342,214L576,363L576,661L342,810z"></path>\n</svg>\n'},function(e,t,r){"use strict";r.r(t),t.default='<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40">\n  <path transform="translate(2,2) scale(0.0320625 0.0320625)" d="M598,214h170v596h-170v-596zM256 810v-596h170v596h-170z"></path>\n</svg>\n'},function(e,t,r){var n=r(52);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};r(2)(n,i),n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(1)(!1)).push([e.i,".xgplayer-skin-default .xgplayer-play,.xgplayer-skin-default .xgplayer-play-img{width:40px;position:relative;-webkit-order:0;-moz-box-ordinal-group:1;order:0;display:block;cursor:pointer;margin-left:3px}.xgplayer-skin-default .xgplayer-play-img .xgplayer-icon,.xgplayer-skin-default .xgplayer-play .xgplayer-icon{margin-top:3px;width:32px}.xgplayer-skin-default .xgplayer-play-img .xgplayer-icon div,.xgplayer-skin-default .xgplayer-play .xgplayer-icon div{position:absolute}.xgplayer-skin-default .xgplayer-play-img .xgplayer-icon .xgplayer-icon-play,.xgplayer-skin-default .xgplayer-play .xgplayer-icon .xgplayer-icon-play{display:block}.xgplayer-skin-default .xgplayer-play-img .xgplayer-icon .xgplayer-icon-pause,.xgplayer-skin-default .xgplayer-play .xgplayer-icon .xgplayer-icon-pause{display:none}.xgplayer-skin-default .xgplayer-play-img .xgplayer-tips .xgplayer-tip-play,.xgplayer-skin-default .xgplayer-play .xgplayer-tips .xgplayer-tip-play{display:block}.xgplayer-skin-default .xgplayer-play-img .xgplayer-tips .xgplayer-tip-pause,.xgplayer-skin-default .xgplayer-play .xgplayer-tips .xgplayer-tip-pause{display:none}.xgplayer-skin-default .xgplayer-play-img:hover,.xgplayer-skin-default .xgplayer-play:hover{opacity:.85}.xgplayer-skin-default .xgplayer-play-img:hover .xgplayer-tips,.xgplayer-skin-default .xgplayer-play:hover .xgplayer-tips{display:block}.xgplayer-skin-default.xgplayer-playing .xgplayer-play-img .xgplayer-icon .xgplayer-icon-play,.xgplayer-skin-default.xgplayer-playing .xgplayer-play .xgplayer-icon .xgplayer-icon-play{display:none}.xgplayer-skin-default.xgplayer-playing .xgplayer-play-img .xgplayer-icon .xgplayer-icon-pause,.xgplayer-skin-default.xgplayer-playing .xgplayer-play .xgplayer-icon .xgplayer-icon-pause{display:block}.xgplayer-skin-default.xgplayer-playing .xgplayer-play-img .xgplayer-tips .xgplayer-tip-play,.xgplayer-skin-default.xgplayer-playing .xgplayer-play .xgplayer-tips .xgplayer-tip-play{display:none}.xgplayer-skin-default.xgplayer-pause .xgplayer-play-img .xgplayer-icon .xgplayer-icon-play,.xgplayer-skin-default.xgplayer-pause .xgplayer-play .xgplayer-icon .xgplayer-icon-play,.xgplayer-skin-default.xgplayer-playing .xgplayer-play-img .xgplayer-tips .xgplayer-tip-pause,.xgplayer-skin-default.xgplayer-playing .xgplayer-play .xgplayer-tips .xgplayer-tip-pause{display:block}.xgplayer-skin-default.xgplayer-pause .xgplayer-play-img .xgplayer-icon .xgplayer-icon-pause,.xgplayer-skin-default.xgplayer-pause .xgplayer-play .xgplayer-icon .xgplayer-icon-pause{display:none}.xgplayer-skin-default.xgplayer-pause .xgplayer-play-img .xgplayer-tips .xgplayer-tip-play,.xgplayer-skin-default.xgplayer-pause .xgplayer-play .xgplayer-tips .xgplayer-tip-play{display:block}.xgplayer-skin-default.xgplayer-pause .xgplayer-play-img .xgplayer-tips .xgplayer-tip-pause,.xgplayer-skin-default.xgplayer-pause .xgplayer-play .xgplayer-tips .xgplayer-tip-pause{display:none}",""])},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0),a=(n=i)&&n.__esModule?n:{default:n};r(54),t.default={name:"s_poster",method:function(){var e=this.root,t=a.default.util;if(this.config.poster){var r=t.createDom("xg-poster","",{},"xgplayer-poster");r.style.backgroundImage="url("+this.config.poster+")",e.appendChild(r)}}},e.exports=t.default},function(e,t,r){var n=r(55);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};r(2)(n,i),n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(1)(!1)).push([e.i,".xgplayer-skin-default .xgplayer-poster{display:none;position:absolute;left:0;top:0;width:100%;height:100%;z-index:100;background-size:cover;background-position:50%}.xgplayer-skin-default.xgplayer-nostart .xgplayer-poster{display:block}",""])},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0),a=(n=i)&&n.__esModule?n:{default:n};r(57),t.default={name:"s_flex",method:function(){var e=a.default.util.createDom("xg-placeholder","",{},"xgplayer-placeholder");this.controls.appendChild(e)}},e.exports=t.default},function(e,t,r){var n=r(58);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};r(2)(n,i),n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(1)(!1)).push([e.i,".xgplayer-skin-default .xgplayer-placeholder{-webkit-flex:1;-moz-box-flex:1;flex:1;-webkit-order:3;-moz-box-ordinal-group:4;order:3;display:block}",""])},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o(r(0)),i=o(r(60)),a=o(r(61));function o(e){return e&&e.__esModule?e:{default:e}}r(62),t.default={name:"s_fullscreen",method:function(){var e=this,t=n.default.util,r=e.config.fullscreenBtn?e.config.fullscreenBtn:{},o=void 0;o="img"===r.type?t.createImgBtn("fullscreen",r.url.request,r.width,r.height):t.createDom("xg-fullscreen",'<xg-icon class="xgplayer-icon">\n                                             <div class="xgplayer-icon-requestfull">'+i.default+'</div>\n                                             <div class="xgplayer-icon-exitfull">'+a.default+"</div>\n                                           </xg-icon>",{},"xgplayer-fullscreen");var s={};s.requestfull=e.lang.FULLSCREEN_TIPS,s.exitfull=e.lang.EXITFULLSCREEN_TIPS;var l=t.createDom("xg-tips",'<span class="xgplayer-tip-requestfull">'+s.requestfull+'</span>\n                                        <span class="xgplayer-tip-exitfull">'+s.exitfull+"</span>",{},"xgplayer-tips");o.appendChild(l),e.once("ready",(function(){e.controls&&e.controls.appendChild(o)})),["click","touchend"].forEach((function(t){o.addEventListener(t,(function(t){t.preventDefault(),t.stopPropagation(),e.emit("fullscreenBtnClick")}))}))}},e.exports=t.default},function(e,t,r){"use strict";r.r(t),t.default='<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40">\n  <path transform="scale(0.0320625 0.0320625)" d="M598 214h212v212h-84v-128h-128v-84zM726 726v-128h84v212h-212v-84h128zM214 426v-212h212v84h-128v128h-84zM298 598v128h128v84h-212v-212h84z"></path>\n</svg>\n'},function(e,t,r){"use strict";r.r(t),t.default='<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40">\n  <path transform="scale(0.0320625 0.0320625)" d="M682 342h128v84h-212v-212h84v128zM598 810v-212h212v84h-128v128h-84zM342 342v-128h84v212h-212v-84h128zM214 682v-84h212v212h-84v-128h-128z"></path>\n</svg>\n'},function(e,t,r){var n=r(63);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};r(2)(n,i),n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(1)(!1)).push([e.i,".xgplayer-skin-default .xgplayer-fullscreen,.xgplayer-skin-default .xgplayer-fullscreen-img{position:relative;-webkit-order:13;-moz-box-ordinal-group:14;order:13;display:block;cursor:pointer;margin-left:5px;margin-right:3px}.xgplayer-skin-default .xgplayer-fullscreen-img .xgplayer-icon,.xgplayer-skin-default .xgplayer-fullscreen .xgplayer-icon{margin-top:3px}.xgplayer-skin-default .xgplayer-fullscreen-img .xgplayer-icon div,.xgplayer-skin-default .xgplayer-fullscreen .xgplayer-icon div{position:absolute}.xgplayer-skin-default .xgplayer-fullscreen-img .xgplayer-icon .xgplayer-icon-requestfull,.xgplayer-skin-default .xgplayer-fullscreen .xgplayer-icon .xgplayer-icon-requestfull{display:block}.xgplayer-skin-default .xgplayer-fullscreen-img .xgplayer-icon .xgplayer-icon-exitfull,.xgplayer-skin-default .xgplayer-fullscreen .xgplayer-icon .xgplayer-icon-exitfull{display:none}.xgplayer-skin-default .xgplayer-fullscreen-img .xgplayer-tips,.xgplayer-skin-default .xgplayer-fullscreen .xgplayer-tips{position:absolute;right:0;left:auto}.xgplayer-skin-default .xgplayer-fullscreen-img .xgplayer-tips .xgplayer-tip-requestfull,.xgplayer-skin-default .xgplayer-fullscreen .xgplayer-tips .xgplayer-tip-requestfull{display:block}.xgplayer-skin-default .xgplayer-fullscreen-img .xgplayer-tips .xgplayer-tip-exitfull,.xgplayer-skin-default .xgplayer-fullscreen .xgplayer-tips .xgplayer-tip-exitfull{display:none}.xgplayer-skin-default .xgplayer-fullscreen-img:hover,.xgplayer-skin-default .xgplayer-fullscreen:hover{opacity:.85}.xgplayer-skin-default .xgplayer-fullscreen-img:hover .xgplayer-tips,.xgplayer-skin-default .xgplayer-fullscreen:hover .xgplayer-tips{display:block}.xgplayer-skin-default.xgplayer-is-fullscreen .xgplayer-fullscreen-img .xgplayer-icon .xgplayer-icon-requestfull,.xgplayer-skin-default.xgplayer-is-fullscreen .xgplayer-fullscreen .xgplayer-icon .xgplayer-icon-requestfull,.xgplayer-skin-default.xgplayer-rotate-fullscreen .xgplayer-fullscreen-img .xgplayer-icon .xgplayer-icon-requestfull,.xgplayer-skin-default.xgplayer-rotate-fullscreen .xgplayer-fullscreen .xgplayer-icon .xgplayer-icon-requestfull{display:none}.xgplayer-skin-default.xgplayer-is-fullscreen .xgplayer-fullscreen-img .xgplayer-icon .xgplayer-icon-exitfull,.xgplayer-skin-default.xgplayer-is-fullscreen .xgplayer-fullscreen .xgplayer-icon .xgplayer-icon-exitfull,.xgplayer-skin-default.xgplayer-rotate-fullscreen .xgplayer-fullscreen-img .xgplayer-icon .xgplayer-icon-exitfull,.xgplayer-skin-default.xgplayer-rotate-fullscreen .xgplayer-fullscreen .xgplayer-icon .xgplayer-icon-exitfull{display:block}.xgplayer-skin-default.xgplayer-is-fullscreen .xgplayer-fullscreen-img .xgplayer-tips .xgplayer-tip-requestfull,.xgplayer-skin-default.xgplayer-is-fullscreen .xgplayer-fullscreen .xgplayer-tips .xgplayer-tip-requestfull,.xgplayer-skin-default.xgplayer-rotate-fullscreen .xgplayer-fullscreen-img .xgplayer-tips .xgplayer-tip-requestfull,.xgplayer-skin-default.xgplayer-rotate-fullscreen .xgplayer-fullscreen .xgplayer-tips .xgplayer-tip-requestfull{display:none}.xgplayer-skin-default.xgplayer-is-fullscreen .xgplayer-fullscreen-img .xgplayer-tips .xgplayer-tip-exitfull,.xgplayer-skin-default.xgplayer-is-fullscreen .xgplayer-fullscreen .xgplayer-tips .xgplayer-tip-exitfull,.xgplayer-skin-default.xgplayer-rotate-fullscreen .xgplayer-fullscreen-img .xgplayer-tips .xgplayer-tip-exitfull,.xgplayer-skin-default.xgplayer-rotate-fullscreen .xgplayer-fullscreen .xgplayer-tips .xgplayer-tip-exitfull{display:block}",""])},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a(r(0)),i=a(r(65));function a(e){return e&&e.__esModule?e:{default:e}}r(66),t.default={name:"s_loading",method:function(){var e=this.root,t=n.default.util.createDom("xg-loading",""+i.default,{},"xgplayer-loading");this.once("ready",(function(){e.appendChild(t)}))}},e.exports=t.default},function(e,t,r){"use strict";r.r(t),t.default='<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewbox="0 0 100 100">\n  <path d="M100,50A50,50,0,1,1,50,0"></path>\n</svg>\n'},function(e,t,r){var n=r(67);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};r(2)(n,i),n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(1)(!1)).push([e.i,".xgplayer-skin-default .xgplayer-loading{display:none;width:100px;height:100px;overflow:hidden;-webkit-transform:scale(.7);-ms-transform:scale(.7);transform:scale(.7);position:absolute;left:50%;top:50%;margin:-50px auto auto -50px}.xgplayer-skin-default .xgplayer-loading svg{border-radius:50%;-webkit-transform-origin:center;-ms-transform-origin:center;transform-origin:center;-webkit-animation:loadingRotate 1s linear infinite;animation:loadingRotate 1s linear infinite}.xgplayer-skin-default .xgplayer-loading svg path{stroke:#ddd;stroke-dasharray:236;-webkit-animation:loadingDashOffset 2s linear infinite;animation:loadingDashOffset 2s linear infinite;animation-direction:alternate-reverse;fill:none;stroke-width:12px}.xgplayer-skin-default.xgplayer-nostart .xgplayer-loading{display:none}.xgplayer-skin-default.xgplayer-pause .xgplayer-loading{display:none!important}.xgplayer-skin-default.xgplayer-isloading .xgplayer-loading{display:block}",""])},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0),a=(n=i)&&n.__esModule?n:{default:n};r(69);var o=function(e){return a.default.util.hasClass(e.root,"xgplayer-rotate-fullscreen")};t.default={name:"s_progress",method:function(){var e=this,t=a.default.util,r=t.createDom("xg-progress",'<xg-outer class="xgplayer-progress-outer">\n                                                   <xg-cache class="xgplayer-progress-cache"></xg-cache>\n                                                   <xg-played class="xgplayer-progress-played">\n                                                     <xg-progress-btn class="xgplayer-progress-btn"></xg-progress-btn>\n                                                     <xg-point class="xgplayer-progress-point xgplayer-tips"></xg-point>\n                                                     <xg-thumbnail class="xgplayer-progress-thumbnail xgplayer-tips"></xg-thumbnail>\n                                                   </xg-played>\n                                                 </xg-outer>',{tabindex:1},"xgplayer-progress"),n=void 0;e.controls.appendChild(r);var i=r.querySelector(".xgplayer-progress-played"),s=r.querySelector(".xgplayer-progress-outer"),l=r.querySelector(".xgplayer-progress-cache"),u=r.querySelector(".xgplayer-progress-point"),c=r.querySelector(".xgplayer-progress-thumbnail");function d(n,i){n.addEventListener("mouseenter",(function(e){i&&(t.addClass(n,"xgplayer-progress-dot-show"),t.addClass(r,"xgplayer-progress-dot-active"))})),n.addEventListener("mouseleave",(function(e){i&&(t.removeClass(n,"xgplayer-progress-dot-show"),t.removeClass(r,"xgplayer-progress-dot-active"))})),n.addEventListener("touchend",(function(a){a.stopPropagation(),i&&(t.hasClass(n,"xgplayer-progress-dot-show")||Object.keys(e.dotArr).forEach((function(r){e.dotArr[r]&&t.removeClass(e.dotArr[r],"xgplayer-progress-dot-show")})),t.toggleClass(n,"xgplayer-progress-dot-show"),t.toggleClass(r,"xgplayer-progress-dot-active"))}))}function f(){e.config.progressDot&&"Array"===t.typeOf(e.config.progressDot)&&e.config.progressDot.forEach((function(r){if(r.time>=0&&r.time<=e.duration){var n=t.createDom("xg-progress-dot",r.text?'<span class="xgplayer-progress-tip">'+r.text+"</span>":"",{},"xgplayer-progress-dot");if(n.style.left=r.time/e.duration*100+"%",r.duration>=0&&(n.style.width=Math.min(r.duration,e.duration-r.time)/e.duration*100+"%"),r.style)for(var i in r.style)n.style[i]=r.style[i];s.appendChild(n),e.dotArr[r.time]=n,d(n,r.text)}}))}e.dotArr={},e.once("canplay",f),e.addProgressDot=function(r,n,i,a){if(!e.dotArr[r]&&r>=0&&r<=e.duration){var o=t.createDom("xg-progress-dot",n?'<span class="xgplayer-progress-tip">'+n+"</span>":"",{},"xgplayer-progress-dot");if(o.style.left=r/e.duration*100+"%",i>=0&&(o.style.width=Math.min(i,e.duration-r)/e.duration*100+"%"),a)for(var l in a)o.style[l]=a[l];s.appendChild(o),e.dotArr[r]=o,d(o,n)}},e.removeProgressDot=function(t){if(t>=0&&t<=e.duration&&e.dotArr[t]){var r=e.dotArr[t];r.parentNode.removeChild(r),r=null,e.dotArr[t]=null}},e.removeAllProgressDot=function(){Object.keys(e.dotArr).forEach((function(t){if(e.dotArr[t]){var r=e.dotArr[t];r.parentNode.removeChild(r),r=null,e.dotArr[t]=null}}))};var p=0,h=0,g=0,y=0,v=0,m=0,x=[],b=void 0,k=void 0;e.config.thumbnail&&(e.config.thumbnail.isShowCoverPreview&&(i.removeChild(c),(b=t.createDom("xg-coverpreview",'<xg-outer class="xgplayer-coverpreview-outer">\n          <xg-thumbnail class="xgplayer-coverpreview-thumbnail"></xg-thumbnail>\n          <xg-point class="xgplayer-coverpreview-point"></xg-point>\n        </xg-outer>',{tabindex:1},"xgplayer-coverpreview")).querySelector(".xgplayer-coverpreview-outer"),k=b.querySelector(".xgplayer-coverpreview-point"),c=b.querySelector(".xgplayer-coverpreview-thumbnail"),e.root.appendChild(b)),p=e.config.thumbnail.pic_num,h=e.config.thumbnail.width,g=e.config.thumbnail.height,y=e.config.thumbnail.col,v=e.config.thumbnail.row,x=e.config.thumbnail.urls,c.style.width=h+"px",c.style.height=g+"px"),"function"==typeof e.config.disableSwipeHandler&&"function"==typeof e.config.enableSwipeHandler&&(e.root.addEventListener("touchmove",(function(t){t.preventDefault(),e.disableSwipe||(e.disableSwipe=!0,e.config.disableSwipeHandler.call(e))})),e.root.addEventListener("touchstart",(function(t){e.disableSwipe=!0,e.config.disableSwipeHandler.call(e)})),e.root.addEventListener("touchend",(function(t){e.disableSwipe=!1,e.config.enableSwipeHandler.call(e)}))),["touchstart","mousedown"].forEach((function(s){r.addEventListener(s,(function(s){if(!e.config.disableProgress){if(s.stopPropagation(),t.event(s),s._target===u||!e.config.allowSeekAfterEnded&&e.ended)return!0;r.focus();var l=i.getBoundingClientRect().left,d=o(e);d?(l=i.getBoundingClientRect().top,n=r.getBoundingClientRect().height):(n=r.getBoundingClientRect().width,l=i.getBoundingClientRect().left);var f=function(r){r.stopPropagation(),t.event(r),e.isProgressMoving=!0;var a=(d?r.clientY:r.clientX)-l;a>n&&(a=n);var o=a/n*e.duration;if(o<0&&(o=0),e.config.allowSeekPlayed&&Number(o).toFixed(1)>e.maxPlayedTime);else if(i.style.width=100*a/n+"%","video"!==e.videoConfig.mediaType||e.dash||e.config.closeMoveSeek){var s=t.findDom(e.controls,".xgplayer-time");s&&(s.innerHTML='<span class="xgplayer-time-current">'+t.format(o||0)+"</span><span>"+t.format(e.duration)+"</span>")}else e.currentTime=Number(o).toFixed(1);if(e.config.thumbnail&&e.config.thumbnail.isShowCoverPreview){k.innerHTML="<span>"+t.format(o)+"</span> / "+t.format(e.duration||0),m=e.duration/p;var u=Math.floor(o/m);c.style.backgroundImage="url("+x[Math.ceil((u+1)/(y*v))-1]+")";var f=u+1-y*v*(Math.ceil((u+1)/(y*v))-1),_=Math.ceil(f/v)-1,w=f-_*v-1;c.style["background-position"]="-"+w*h+"px -"+_*g+"px",b.style.display="block"}e.emit("focus")},_=function o(s){if(s.stopPropagation(),t.event(s),window.removeEventListener("mousemove",f),window.removeEventListener("touchmove",f,{passive:!1}),window.removeEventListener("mouseup",o),window.removeEventListener("touchend",o),a.default.sniffer.browser.indexOf("ie")<0&&r.blur(),!e.isProgressMoving||e.videoConfig&&"audio"===e.videoConfig.mediaType||e.dash||e.config.closeMoveSeek){var u=(d?s.clientY:s.clientX)-l;u>n&&(u=n);var c=u/n*e.duration;c<0&&(c=0),e.config.allowSeekPlayed&&Number(c).toFixed(1)>e.maxPlayedTime||(i.style.width=100*u/n+"%",e.currentTime=Number(c).toFixed(1))}e.config.thumbnail&&e.config.thumbnail.isShowCoverPreview&&(b.style.display="none"),e.emit("focus"),e.isProgressMoving=!1};return window.addEventListener("mousemove",f),window.addEventListener("touchmove",f,{passive:!1}),window.addEventListener("mouseup",_),window.addEventListener("touchend",_),!0}}))})),r.addEventListener("mouseenter",(function(n){if(!e.config.allowSeekAfterEnded&&e.ended)return!0;var i=o(e),a=i?r.getBoundingClientRect().top:r.getBoundingClientRect().left,s=i?r.getBoundingClientRect().height:r.getBoundingClientRect().width,l=function(n){var o=((i?n.clientY:n.clientX)-a)/s*e.duration;o=o<0?0:o,u.textContent=t.format(o);var l=u.getBoundingClientRect().width;if(e.config.thumbnail&&!e.config.thumbnail.isShowCoverPreview){m=e.duration/p;var d=Math.floor(o/m);c.style.backgroundImage="url("+x[Math.ceil((d+1)/(y*v))-1]+")";var f=d+1-y*v*(Math.ceil((d+1)/(y*v))-1),b=Math.ceil(f/v)-1,k=f-b*v-1;c.style["background-position"]="-"+k*h+"px -"+b*g+"px";var _=(i?n.clientY:n.clientX)-a-h/2;_=(_=_>0?_:0)<s-h?_:s-h,c.style.left=_+"px",c.style.top=-10-g+"px",c.style.display="block",u.style.left=_+h/2-l/2+"px"}else{var w=n.clientX-a-l/2;w=(w=w>0?w:0)>s-l?s-l:w,u.style.left=w+"px"}t.hasClass(r,"xgplayer-progress-dot-active")?u.style.display="none":u.style.display="block"},d=function(e){l(e)};r.addEventListener("mousemove",d,!1),r.addEventListener("mouseleave",(function t(n){r.removeEventListener("mousemove",d,!1),r.removeEventListener("mouseleave",t,!1),l(n),u.style.display="none",e.config.thumbnail&&!e.config.thumbnail.isShowCoverPreview&&(c.style.display="none")}),!1),l(n)}),!1);var _=function(){if(void 0===e.maxPlayedTime&&(e.maxPlayedTime=0),e.maxPlayedTime<e.currentTime&&(e.maxPlayedTime=e.currentTime),!n&&r&&(n=r.getBoundingClientRect().width),"audio"!==e.videoConfig.mediaType||!e.isProgressMoving||!e.dash){var t=e.currentTime/e.duration,a=Number(i.style.width.replace("%","")||"0")/Number(r.style.width||"100");Math.abs(t-a)<=1&&(i.style.width=100*e.currentTime/e.duration+"%")}};e.on("timeupdate",_);var w=function(){i.style.width=100*e.currentTime/e.duration+"%"};e.on("currentTimeChange",w);var E=function(){i.style.width="0%"};e.on("srcChange",E);var T=function(){var t=e.buffered;if(t&&t.length>0){for(var r=t.end(t.length-1),n=0,i=t.length;n<i;n++)if(e.currentTime>=t.start(n)&&e.currentTime<=t.end(n)){r=t.end(n);for(var a=n+1;a<t.length;a++)if(t.start(a)-t.end(a-1)>=2){r=t.end(a-1);break}break}l.style.width=r/e.duration*100+"%"}},S=["bufferedChange","cacheupdate","ended","timeupdate"];S.forEach((function(t){e.on(t,T)})),e.once("destroy",(function t(){e.removeAllProgressDot(),e.off("canplay",f),e.off("timeupdate",_),e.off("currentTimeChange",w),e.off("srcChange",E),S.forEach((function(t){e.off(t,T)})),e.off("destroy",t)}))}},e.exports=t.default},function(e,t,r){var n=r(70);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};r(2)(n,i),n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(1)(!1)).push([e.i,".xgplayer-skin-default .xgplayer-progress{display:block;position:absolute;height:20px;line-height:20px;left:12px;right:12px;outline:none;top:-15px;z-index:35}.xgplayer-skin-default .xgplayer-progress-outer{background:hsla(0,0%,100%,.3);display:block;height:3px;line-height:3px;margin-top:8.5px;width:100%;position:relative;cursor:pointer}.xgplayer-skin-default .xgplayer-progress-cache,.xgplayer-skin-default .xgplayer-progress-played{display:block;height:100%;line-height:1;position:absolute;left:0;top:0}.xgplayer-skin-default .xgplayer-progress-cache{width:0;background:hsla(0,0%,100%,.5)}.xgplayer-skin-default .xgplayer-progress-played{display:block;width:0;background-image:linear-gradient(-90deg,#fa1f41,#e31106);border-radius:0 1.5px 1.5px 0}.xgplayer-skin-default .xgplayer-progress-btn{display:none;position:absolute;left:0;top:-5px;width:13px;height:13px;border-radius:30px;background:#fff;box-shadow:0 0 2px 0 rgba(0,0,0,.26);left:100%;-webkit-transform:translate(-50%);-ms-transform:translate(-50%);transform:translate(-50%);z-index:36}.xgplayer-skin-default .xgplayer-progress-point{position:absolute}.xgplayer-skin-default .xgplayer-progress-point.xgplayer-tips{margin-left:0;top:-25px;display:none;z-index:100}.xgplayer-skin-default .xgplayer-progress-dot{display:inline-block;position:absolute;height:3px;width:5px;top:0;background:#fff;border-radius:6px;z-index:16}.xgplayer-skin-default .xgplayer-progress-dot .xgplayer-progress-tip{position:absolute;bottom:200%;right:50%;-webkit-transform:translateX(50%);-ms-transform:translateX(50%);transform:translateX(50%);height:auto;line-height:30px;width:auto;background:rgba(0,0,0,.3);border-radius:6px;border:1px solid rgba(0,0,0,.8);cursor:default;white-space:nowrap;display:none}.xgplayer-skin-default .xgplayer-progress-dot-show .xgplayer-progress-tip{display:block}.xgplayer-skin-default .xgplayer-progress-thumbnail{position:absolute;-moz-box-sizing:border-box;box-sizing:border-box}.xgplayer-skin-default .xgplayer-progress-thumbnail.xgplayer-tips{margin-left:0;display:none;z-index:99}.xgplayer-skin-default .xgplayer-coverpreview{position:absolute;width:100%;height:100%;top:0;left:0;display:none}.xgplayer-skin-default .xgplayer-coverpreview .xgplayer-coverpreview-outer{position:absolute;display:block;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.xgplayer-skin-default .xgplayer-coverpreview .xgplayer-coverpreview-outer .xgplayer-coverpreview-thumbnail{display:block}.xgplayer-skin-default .xgplayer-coverpreview .xgplayer-coverpreview-outer .xgplayer-coverpreview-point{display:block;text-align:center;font-family:PingFangSC-Regular;font-size:11px;color:#ccc;padding:2px 4px}.xgplayer-skin-default .xgplayer-coverpreview .xgplayer-coverpreview-outer .xgplayer-coverpreview-point span{color:#fff}.xgplayer-skin-default .xgplayer-progress:focus .xgplayer-progress-outer,.xgplayer-skin-default .xgplayer-progress:hover .xgplayer-progress-outer{height:6px;margin-top:7px}.xgplayer-skin-default .xgplayer-progress:focus .xgplayer-progress-dot,.xgplayer-skin-default .xgplayer-progress:hover .xgplayer-progress-dot{height:6px}.xgplayer-skin-default .xgplayer-progress:focus .xgplayer-progress-btn,.xgplayer-skin-default .xgplayer-progress:hover .xgplayer-progress-btn{display:block;top:-3px}.xgplayer-skin-default.xgplayer-definition-active .xgplayer-progress,.xgplayer-skin-default.xgplayer-playbackrate-active .xgplayer-progress,.xgplayer-skin-default.xgplayer-texttrack-active .xgplayer-progress,.xgplayer-skin-default.xgplayer-volume-active .xgplayer-progress{z-index:15}.xgplayer-skin-default.xgplayer-mobile .xgplayer-progress-btn{display:block!important}.xgplayer-skin-default.xgplayer-mobile .xgplayer-progress:focus .xgplayer-progress-outer,.xgplayer-skin-default.xgplayer-mobile .xgplayer-progress:hover .xgplayer-progress-outer{height:3px!important;margin-top:8.5px!important}.xgplayer-skin-default.xgplayer-mobile .xgplayer-progress:focus .xgplayer-progress-btn,.xgplayer-skin-default.xgplayer-mobile .xgplayer-progress:hover .xgplayer-progress-btn{display:block!important;top:-5px!important}",""])},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0),a=(n=i)&&n.__esModule?n:{default:n};r(72),t.default={name:"s_time",method:function(){var e=this,t=a.default.util,r=t.createDom("xg-time",'<span class="xgplayer-time-current">'+(e.currentTime||t.format(0))+"</span>\n                                           <span>"+(e.duration||t.format(0))+"</span>",{},"xgplayer-time");e.once("ready",(function(){e.controls&&e.controls.appendChild(r)}));var n=function(){"audio"===e.videoConfig.mediaType&&e.isProgressMoving&&e.dash||(r.innerHTML='<span class="xgplayer-time-current">'+t.format(e.currentTime||0)+"</span><span>"+t.format(e.duration)+"</span>")};e.on("durationchange",n),e.on("timeupdate",n),e.once("destroy",(function t(){e.off("durationchange",n),e.off("timeupdate",n),e.off("destroy",t)}))}},e.exports=t.default},function(e,t,r){var n=r(73);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};r(2)(n,i),n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(1)(!1)).push([e.i,'.xgplayer-skin-default .xgplayer-time{-webkit-order:2;-moz-box-ordinal-group:3;order:2;font-family:ArialMT;font-size:13px;color:#fff;line-height:40px;height:40px;text-align:center;display:inline-block;margin:auto 8px}.xgplayer-skin-default .xgplayer-time span{color:hsla(0,0%,100%,.5)}.xgplayer-skin-default .xgplayer-time .xgplayer-time-current{color:#fff}.xgplayer-skin-default .xgplayer-time .xgplayer-time-current:after{content:"/";display:inline-block;padding:0 3px}',""])},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a(r(0)),i=a(r(75));function a(e){return e&&e.__esModule?e:{default:e}}r(76),t.default={name:"s_replay",method:function(){var e=this,t=n.default.util,r=e.root,a=e.lang.REPLAY,o=t.createDom("xg-replay",i.default+'\n                                         <xg-replay-txt class="xgplayer-replay-txt">'+a+"</xg-replay-txt>\n                                        ",{},"xgplayer-replay");function s(){var e=o.querySelector("path");if(e){var t=window.getComputedStyle(e).getPropertyValue("transform");if("string"==typeof t&&t.indexOf("none")>-1)return;e.setAttribute("transform",t)}}e.once("ready",(function(){r.appendChild(o)})),e.on("ended",s),o.addEventListener("click",(function(e){e.preventDefault(),e.stopPropagation()}));var l=o.querySelector("svg");["click","touchend"].forEach((function(t){l.addEventListener(t,(function(t){t.preventDefault(),t.stopPropagation(),e.emit("replayBtnClick")}))})),e.once("destroy",(function t(){e.off("ended",s),e.off("destroy",t)}))}},e.exports=t.default},function(e,t,r){"use strict";r.r(t),t.default='<svg class="xgplayer-replay-svg" xmlns="http://www.w3.org/2000/svg" width="78" height="78" viewbox="0 0 78 78">\n  <path d="M8.22708362,13.8757234 L11.2677371,12.6472196 C11.7798067,12.4403301 12.3626381,12.6877273 12.5695276,13.1997969 L12.9441342,14.1269807 C13.1510237,14.6390502 12.9036264,15.2218816 12.3915569,15.4287712 L6.8284538,17.6764107 L5.90126995,18.0510173 C5.38920044,18.2579068 4.80636901,18.0105096 4.5994795,17.49844 L1.97723335,11.0081531 C1.77034384,10.4960836 2.0177411,9.91325213 2.52981061,9.70636262 L3.45699446,9.33175602 C3.96906396,9.12486652 4.5518954,9.37226378 4.75878491,9.88433329 L5.67885163,12.1615783 C7.99551726,6.6766934 13.3983951,3 19.5,3 C27.7842712,3 34.5,9.71572875 34.5,18 C34.5,26.2842712 27.7842712,33 19.5,33 C15.4573596,33 11.6658607,31.3912946 8.87004692,28.5831991 C8.28554571,27.9961303 8.28762719,27.0463851 8.87469603,26.4618839 C9.46176488,25.8773827 10.4115101,25.8794641 10.9960113,26.466533 C13.2344327,28.7147875 16.263503,30 19.5,30 C26.127417,30 31.5,24.627417 31.5,18 C31.5,11.372583 26.127417,6 19.5,6 C14.4183772,6 9.94214483,9.18783811 8.22708362,13.8757234 Z"></path>\n</svg>\n'},function(e,t,r){var n=r(77);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};r(2)(n,i),n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(1)(!1)).push([e.i,".xgplayer-skin-default .xgplayer-replay{position:absolute;left:0;top:0;width:100%;height:100%;z-index:105;display:none;-webkit-justify-content:center;-moz-box-pack:center;justify-content:center;-webkit-align-items:center;-moz-box-align:center;align-items:center;background:rgba(0,0,0,.54);-webkit-flex-direction:column;-moz-box-orient:vertical;-moz-box-direction:normal;flex-direction:column}.xgplayer-skin-default .xgplayer-replay svg{background:rgba(0,0,0,.58);border-radius:100%;cursor:pointer}.xgplayer-skin-default .xgplayer-replay svg path{-webkit-transform:translate(20px,21px);-ms-transform:translate(20px,21px);transform:translate(20px,21px);fill:#ddd}.xgplayer-skin-default .xgplayer-replay svg:hover{background:rgba(0,0,0,.38)}.xgplayer-skin-default .xgplayer-replay svg:hover path{fill:#fff}.xgplayer-skin-default .xgplayer-replay .xgplayer-replay-txt{display:inline-block;font-family:PingFangSC-Regular;font-size:14px;color:#fff;line-height:34px}.xgplayer-skin-default.xgplayer.xgplayer-ended .xgplayer-controls{display:none}.xgplayer-skin-default.xgplayer.xgplayer-ended .xgplayer-replay{display:-webkit-flex;display:-moz-box;display:flex}",""])},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0),a=(n=i)&&n.__esModule?n:{default:n};t.default={name:"volume",method:function(){var e=this,t=e.root,r=a.default.util,n=void 0,i=void 0,o=void 0,s=void 0;function l(){e.controls&&(e.volume=e.config.volume,(n=e.controls.querySelector(".xgplayer-volume"))&&(i=n.querySelector(".xgplayer-slider"),o=n.querySelector(".xgplayer-bar"),s=n.querySelector(".xgplayer-drag"),"mobile"===a.default.sniffer.device&&h()))}function u(t){if(i){e.video.muted=!1,i.focus(),r.event(t);var n=o.getBoundingClientRect(),a=(t.clientX,t.clientY),l=s.getBoundingClientRect().height,u=!1,c=function(t){t.preventDefault(),t.stopPropagation(),r.event(t),u=!0;var i=l-t.clientY+a,o=i/n.height;s.style.height=i+"px",e.volume=Math.max(Math.min(o,1),0)},d=function t(a){if(a.preventDefault(),a.stopPropagation(),r.event(a),window.removeEventListener("mousemove",c),window.removeEventListener("touchmove",c),window.removeEventListener("mouseup",t),window.removeEventListener("touchend",t),!u){var o=n.height-(a.clientY-n.top),l=o/n.height;s.style.height=o+"px",l<=0&&(e.volume>0?s.volume=e.video.volume:l=s.volume),e.volume=Math.max(Math.min(l,1),0)}i.volume=e.volume,u=!1};return window.addEventListener("mousemove",c),window.addEventListener("touchmove",c),window.addEventListener("mouseup",d),window.addEventListener("touchend",d),!1}}function c(){if("mobile"===a.default.sniffer.device)e.video.muted?(e.video.muted=!1,e.emit("unmute"),e.volume=1):(e.video.muted=!0,e.emit("mute"),e.volume=0);else{if(!i)return;e.video.muted=!1,e.volume<.1?(i.volume<.1?e.volume=.6:e.volume=i.volume,e.emit("unmute")):(e.volume=0,e.emit("mute"))}}function d(){r.addClass(t,"xgplayer-volume-active"),n&&n.focus()}function f(){r.removeClass(t,"xgplayer-volume-active")}e.once("canplay",l),e.on("volumeBarClick",u),e.on("volumeIconClick",c),e.on("volumeIconEnter",d),e.on("volumeIconLeave",f);var p=null;function h(){p&&clearTimeout(p),p=setTimeout((function(){if("mobile"===a.default.sniffer.device)r.removeClass(t,"xgplayer-volume-muted"),r.removeClass(t,"xgplayer-volume-large"),e.video.muted||e.video.defaultMuted?(e.video.muted||(e.video.muted=!0),e.video.defaultMuted=!1,r.addClass(t,"xgplayer-volume-muted")):r.addClass(t,"xgplayer-volume-large");else{if(r.removeClass(t,"xgplayer-volume-muted"),r.removeClass(t,"xgplayer-volume-small"),r.removeClass(t,"xgplayer-volume-large"),0===e.volume?r.addClass(t,"xgplayer-volume-muted"):e.volume<.5?r.addClass(t,"xgplayer-volume-small"):r.addClass(t,"xgplayer-volume-large"),!o)return;var n=o.getBoundingClientRect().height||76;s.style.height=e.volume*n+"px"}}),50)}e.on("volumechange",h),e.once("destroy",(function t(){e.off("canplay",l),e.off("volumeBarClick",u),e.off("volumeIconClick",c),e.off("volumeIconEnter",d),e.off("volumeIconLeave",f),e.off("volumechange",h),e.off("destroy",t),p&&(clearTimeout(p),p=null)}))}},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0);(n=i)&&n.__esModule,t.default={name:"screenShot",method:function(){var e=this,t=e.config.screenShot;if(t){e.video.setAttribute("crossOrigin","anonymous");var r=.92;(t.quality||0===t.quality)&&(r=t.quality);var n=void 0===t.type?"image/png":t.type,i=void 0===t.format?".png":t.format,a=document.createElement("canvas"),o=a.getContext("2d"),s=new Image;a.width=this.config.width||600,a.height=this.config.height||337.5;var l=function(e,t){var r=document.createElement("a");r.href=e,r.download=t;var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),r.dispatchEvent(n)};e.screenShot=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];a.width=e.video.videoWidth||600,a.height=e.video.videoHeight||337.5,s.onload=function(){o.drawImage(e.video,0,0,a.width,a.height),s.src=a.toDataURL(n,r).replace(n,"image/octet-stream");var u=s.src.replace(/^data:image\/[^;]+/,"data:application/octet-stream");e.emit("screenShot",u),t&&l(u,"截图"+i)}()},e.on("screenShotBtnClick",e.screenShot),e.once("destroy",(function t(){e.off("screenShotBtnClick",e.screenShot),e.off("destroy",t)}))}}},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0);(n=i)&&n.__esModule,t.default={name:"rotate",method:function(){var e=this,t=e.config.rotate;function r(){e.rotate(t.clockwise,t.innerRotate)}t&&(e.on("rotateBtnClick",r),e.once("destroy",(function t(){e.off("rotateBtnClick",r),e.off("destroy",t)})),e.updateRotateDeg=function(){this.rotateDeg||(this.rotateDeg=0);var e=this.root.offsetWidth,t=this.root.offsetHeight,r=this.video.videoWidth,n=this.video.videoHeight;!this.config.rotate.innerRotate&&this.config.rotate.controlsFix&&(this.root.style.width=t+"px",this.root.style.height=e+"px");var i=void 0;.25===this.rotateDeg||.75===this.rotateDeg?(i=this.config.rotate.innerRotate?r/n>t/e?t/(n/r>t/e?t*r/n:e):e/(n/r>t/e?t:e*n/r):e>=t?e/t:t/e,i=Number(i.toFixed(5))):i=1,this.config.rotate.innerRotate||this.config.rotate.controlsFix?(this.video.style.transformOrigin="center center",this.video.style.transform="rotate("+this.rotateDeg+"turn) scale("+i+")",this.video.style.webKitTransform="rotate("+this.rotateDeg+"turn) scale("+i+")"):(this.root.style.transformOrigin="center center",this.root.style.transform="rotate("+this.rotateDeg+"turn) scale(1)",this.root.style.webKitTransform="rotate("+this.rotateDeg+"turn) scale(1)")},e.rotate=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=this;r.rotateDeg||(r.rotateDeg=0);var n=e?1:-1;r.rotateDeg=(r.rotateDeg+1+.25*n*t)%1,this.updateRotateDeg(),r.emit("rotate",360*r.rotateDeg)})}},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0),a=(n=i)&&n.__esModule?n:{default:n};t.default={name:"reload",method:function(){var e=this;function t(){a.default.util.removeClass(e.root,"xgplayer-is-error"),e.src=e.config.url}e.config.reload&&(e.on("reloadBtnClick",t),e.once("destroy",(function r(){e.off("reloadBtnClick",t),e.off("destroy",r)})))}},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0);(n=i)&&n.__esModule,t.default={name:"playNext",method:function(){var e=this,t=e.config.playNext;function r(){e.currentVideoIndex+1<t.urlList.length&&(e.currentVideoIndex++,e.video.autoplay=!0,e.src=t.urlList[e.currentVideoIndex],e.emit("playerNext",e.currentVideoIndex+1),e.currentVideoIndex+1===t.urlList.length&&e.emit("urlListEnd"))}e.currentVideoIndex=-1,e.on("playNextBtnClick",r),e.once("destroy",(function t(){e.off("playNextBtnClick",r),e.off("destroy",t)}))}},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0);(n=i)&&n.__esModule,t.default={name:"pip",method:function(){var e=this;function t(){e.video!==document.pictureInPictureElement?e.video.requestPictureInPicture():document.exitPictureInPicture()}e.on("pipBtnClick",t),e.once("destroy",(function r(){e.off("pipBtnClick",t),e.off("destroy",r)}))}},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a(r(0)),i=a(r(85));function a(e){return e&&e.__esModule?e:{default:e}}t.default={name:"miniplayer",method:function(){var e=this,t=n.default.util,r=e.root;function a(){t.hasClass(r,"xgplayer-miniplayer-active")?e.exitMiniplayer():e.getMiniplayer()}e.on("miniplayerBtnClick",a),e.once("destroy",(function t(){e.off("miniplayerBtnClick",a),e.off("destroy",t)})),e.getMiniplayer=function(){var e=t.createDom("xg-miniplayer-lay","<div></div>",{},"xgplayer-miniplayer-lay");this.root.appendChild(e);var r=t.createDom("xg-miniplayer-drag",'<div class="drag-handle"><span>'+this.lang.MINIPLAYER_DRAG+"</span></div>",{tabindex:9},"xgplayer-miniplayer-drag");this.root.appendChild(r),new i.default(".xgplayer",{handle:".drag-handle"}),t.addClass(this.root,"xgplayer-miniplayer-active"),this.root.style.right=0,this.root.style.bottom="200px",this.root.style.top="",this.root.style.left="",this.root.style.width="320px",this.root.style.height="180px",this.config.miniplayerConfig&&(void 0!==this.config.miniplayerConfig.top&&(this.root.style.top=this.config.miniplayerConfig.top+"px",this.root.style.bottom=""),void 0!==this.config.miniplayerConfig.bottom&&(this.root.style.bottom=this.config.miniplayerConfig.bottom+"px"),void 0!==this.config.miniplayerConfig.left&&(this.root.style.left=this.config.miniplayerConfig.left+"px",this.root.style.right=""),void 0!==this.config.miniplayerConfig.right&&(this.root.style.right=this.config.miniplayerConfig.right+"px"),void 0!==this.config.miniplayerConfig.width&&(this.root.style.width=this.config.miniplayerConfig.width+"px"),void 0!==this.config.miniplayerConfig.height&&(this.root.style.height=this.config.miniplayerConfig.height+"px")),this.config.fluid&&(this.root.style["padding-top"]="");var n=this;["click","touchend"].forEach((function(t){e.addEventListener(t,(function(e){e.preventDefault(),e.stopPropagation(),n.exitMiniplayer()}))}))},e.exitMiniplayer=function(){t.removeClass(this.root,"xgplayer-miniplayer-active"),this.root.style.right="",this.root.style.bottom="",this.root.style.top="",this.root.style.left="",this.config.fluid?(this.root.style.width="100%",this.root.style.height="0",this.root.style["padding-top"]=100*this.config.height/this.config.width+"%"):(this.config.width&&("number"!=typeof this.config.width?this.root.style.width=this.config.width:this.root.style.width=this.config.width+"px"),this.config.height&&("number"!=typeof this.config.height?this.root.style.height=this.config.height:this.root.style.height=this.config.height+"px"));var e=t.findDom(this.root,".xgplayer-miniplayer-lay");e&&e.parentNode&&e.parentNode.removeChild(e);var r=t.findDom(this.root,".xgplayer-miniplayer-drag");r&&r.parentNode&&r.parentNode.removeChild(r)}}},e.exports=t.default},function(e,t,r){"use strict";var n,i;"function"==typeof Symbol&&Symbol.iterator,function(a,o){n=[r(86),r(87)],void 0===(i=function(e,t){return function(e,t,r){function n(e,t){for(var r in t)e[r]=t[r];return e}var i=e.jQuery;function a(e,t){this.element="string"==typeof e?document.querySelector(e):e,i&&(this.$element=i(this.element)),this.options=n({},this.constructor.defaults),this.option(t),this._create()}var o=a.prototype=Object.create(r.prototype);a.defaults={},o.option=function(e){n(this.options,e)};var s={relative:!0,absolute:!0,fixed:!0};function l(e,t,r){return r=r||"round",t?Math[r](e/t)*t:e}return o._create=function(){this.position={},this._getPosition(),this.startPoint={x:0,y:0},this.dragPoint={x:0,y:0},this.startPosition=n({},this.position);var e=getComputedStyle(this.element);s[e.position]||(this.element.style.position="relative"),this.on("pointerMove",this.onPointerMove),this.on("pointerUp",this.onPointerUp),this.enable(),this.setHandles()},o.setHandles=function(){this.handles=this.options.handle?this.element.querySelectorAll(this.options.handle):[this.element],this.bindHandles()},o.dispatchEvent=function(e,t,r){var n=[t].concat(r);this.emitEvent(e,n),this.dispatchJQueryEvent(e,t,r)},o.dispatchJQueryEvent=function(t,r,n){var i=e.jQuery;if(i&&this.$element){var a=i.Event(r);a.type=t,this.$element.trigger(a,n)}},o._getPosition=function(){var e=getComputedStyle(this.element),t=this._getPositionCoord(e.left,"width"),r=this._getPositionCoord(e.top,"height");this.position.x=isNaN(t)?0:t,this.position.y=isNaN(r)?0:r,this._addTransformPosition(e)},o._getPositionCoord=function(e,r){if(-1!=e.indexOf("%")){var n=t(this.element.parentNode);return n?parseFloat(e)/100*n[r]:0}return parseInt(e,10)},o._addTransformPosition=function(e){var t=e.transform;if(0===t.indexOf("matrix")){var r=t.split(","),n=0===t.indexOf("matrix3d")?12:4,i=parseInt(r[n],10),a=parseInt(r[n+1],10);this.position.x+=i,this.position.y+=a}},o.onPointerDown=function(e,t){this.element.classList.add("is-pointer-down"),this.dispatchJQueryEvent("pointerDown",e,[t])},o.pointerDown=function(e,t){this.okayPointerDown(e)&&this.isEnabled?(this.pointerDownPointer={pageX:t.pageX,pageY:t.pageY},e.preventDefault(),this.pointerDownBlur(),this._bindPostStartEvents(e),this.element.classList.add("is-pointer-down"),this.dispatchEvent("pointerDown",e,[t])):this._pointerReset()},o.dragStart=function(e,t){this.isEnabled&&(this._getPosition(),this.measureContainment(),this.startPosition.x=this.position.x,this.startPosition.y=this.position.y,this.setLeftTop(),this.dragPoint.x=0,this.dragPoint.y=0,this.element.classList.add("is-dragging"),this.dispatchEvent("dragStart",e,[t]),this.animate())},o.measureContainment=function(){var e=this.getContainer();if(e){var r=t(this.element),n=t(e),i=this.element.getBoundingClientRect(),a=e.getBoundingClientRect(),o=n.borderLeftWidth+n.borderRightWidth,s=n.borderTopWidth+n.borderBottomWidth,l=this.relativeStartPosition={x:i.left-(a.left+n.borderLeftWidth),y:i.top-(a.top+n.borderTopWidth)};this.containSize={width:n.width-o-l.x-r.width,height:n.height-s-l.y-r.height}}},o.getContainer=function(){var e=this.options.containment;if(e)return e instanceof HTMLElement?e:"string"==typeof e?document.querySelector(e):this.element.parentNode},o.onPointerMove=function(e,t,r){this.dispatchJQueryEvent("pointerMove",e,[t,r])},o.dragMove=function(e,t,r){if(this.isEnabled){var n=r.x,i=r.y,a=this.options.grid,o=a&&a[0],s=a&&a[1];n=l(n,o),i=l(i,s),n=this.containDrag("x",n,o),i=this.containDrag("y",i,s),n="y"==this.options.axis?0:n,i="x"==this.options.axis?0:i,this.position.x=this.startPosition.x+n,this.position.y=this.startPosition.y+i,this.dragPoint.x=n,this.dragPoint.y=i,this.dispatchEvent("dragMove",e,[t,r])}},o.containDrag=function(e,t,r){if(!this.options.containment)return t;var n="x"==e?"width":"height",i=l(-this.relativeStartPosition[e],r,"ceil"),a=this.containSize[n];return a=l(a,r,"floor"),Math.max(i,Math.min(a,t))},o.onPointerUp=function(e,t){this.element.classList.remove("is-pointer-down"),this.dispatchJQueryEvent("pointerUp",e,[t])},o.dragEnd=function(e,t){this.isEnabled&&(this.element.style.transform="",this.setLeftTop(),this.element.classList.remove("is-dragging"),this.dispatchEvent("dragEnd",e,[t]))},o.animate=function(){if(this.isDragging){this.positionDrag();var e=this;requestAnimationFrame((function(){e.animate()}))}},o.setLeftTop=function(){this.element.style.left=this.position.x+"px",this.element.style.top=this.position.y+"px"},o.positionDrag=function(){this.element.style.transform="translate3d( "+this.dragPoint.x+"px, "+this.dragPoint.y+"px, 0)"},o.staticClick=function(e,t){this.dispatchEvent("staticClick",e,[t])},o.setPosition=function(e,t){this.position.x=e,this.position.y=t,this.setLeftTop()},o.enable=function(){this.isEnabled=!0},o.disable=function(){this.isEnabled=!1,this.isDragging&&this.dragEnd()},o.destroy=function(){this.disable(),this.element.style.transform="",this.element.style.left="",this.element.style.top="",this.element.style.position="",this.unbindHandles(),this.$element&&this.$element.removeData("draggabilly")},o._init=function(){},i&&i.bridget&&i.bridget("draggabilly",a),a}(a,e,t)}.apply(t,n))||(e.exports=i)}(window)},function(e,t,r){"use strict";var n,i,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};window,void 0===(i="function"==typeof(n=function(){function e(e){var t=parseFloat(e);return-1==e.indexOf("%")&&!isNaN(t)&&t}var t="undefined"==typeof console?function(){}:function(e){console.error(e)},r=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],n=r.length;function i(e){var r=getComputedStyle(e);return r||t("Style returned "+r+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),r}var o,s=!1;function l(t){if(function(){if(!s){s=!0;var t=document.createElement("div");t.style.width="200px",t.style.padding="1px 2px 3px 4px",t.style.borderStyle="solid",t.style.borderWidth="1px 2px 3px 4px",t.style.boxSizing="border-box";var r=document.body||document.documentElement;r.appendChild(t);var n=i(t);o=200==Math.round(e(n.width)),l.isBoxSizeOuter=o,r.removeChild(t)}}(),"string"==typeof t&&(t=document.querySelector(t)),t&&"object"==(void 0===t?"undefined":a(t))&&t.nodeType){var u=i(t);if("none"==u.display)return function(){for(var e={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},t=0;t<n;t++)e[r[t]]=0;return e}();var c={};c.width=t.offsetWidth,c.height=t.offsetHeight;for(var d=c.isBorderBox="border-box"==u.boxSizing,f=0;f<n;f++){var p=r[f],h=u[p],g=parseFloat(h);c[p]=isNaN(g)?0:g}var y=c.paddingLeft+c.paddingRight,v=c.paddingTop+c.paddingBottom,m=c.marginLeft+c.marginRight,x=c.marginTop+c.marginBottom,b=c.borderLeftWidth+c.borderRightWidth,k=c.borderTopWidth+c.borderBottomWidth,_=d&&o,w=e(u.width);!1!==w&&(c.width=w+(_?0:y+b));var E=e(u.height);return!1!==E&&(c.height=E+(_?0:v+k)),c.innerWidth=c.width-(y+b),c.innerHeight=c.height-(v+k),c.outerWidth=c.width+m,c.outerHeight=c.height+x,c}}return l})?n.call(t,r,t,e):n)||(e.exports=i)},function(e,t,r){"use strict";var n,i;"function"==typeof Symbol&&Symbol.iterator,function(a,o){n=[r(88)],void 0===(i=function(e){return function(e,t){function r(){}var n=r.prototype=Object.create(t.prototype);n.bindHandles=function(){this._bindHandles(!0)},n.unbindHandles=function(){this._bindHandles(!1)},n._bindHandles=function(t){for(var r=(t=void 0===t||t)?"addEventListener":"removeEventListener",n=t?this._touchActionValue:"",i=0;i<this.handles.length;i++){var a=this.handles[i];this._bindStartEvent(a,t),a[r]("click",this),e.PointerEvent&&(a.style.touchAction=n)}},n._touchActionValue="none",n.pointerDown=function(e,t){this.okayPointerDown(e)&&(this.pointerDownPointer={pageX:t.pageX,pageY:t.pageY},e.preventDefault(),this.pointerDownBlur(),this._bindPostStartEvents(e),this.emitEvent("pointerDown",[e,t]))};var i={TEXTAREA:!0,INPUT:!0,SELECT:!0,OPTION:!0},a={radio:!0,checkbox:!0,button:!0,submit:!0,image:!0,file:!0};return n.okayPointerDown=function(e){var t=i[e.target.nodeName],r=a[e.target.type],n=!t||r;return n||this._pointerReset(),n},n.pointerDownBlur=function(){var e=document.activeElement;e&&e.blur&&e!=document.body&&e.blur()},n.pointerMove=function(e,t){var r=this._dragPointerMove(e,t);this.emitEvent("pointerMove",[e,t,r]),this._dragMove(e,t,r)},n._dragPointerMove=function(e,t){var r={x:t.pageX-this.pointerDownPointer.pageX,y:t.pageY-this.pointerDownPointer.pageY};return!this.isDragging&&this.hasDragStarted(r)&&this._dragStart(e,t),r},n.hasDragStarted=function(e){return Math.abs(e.x)>3||Math.abs(e.y)>3},n.pointerUp=function(e,t){this.emitEvent("pointerUp",[e,t]),this._dragPointerUp(e,t)},n._dragPointerUp=function(e,t){this.isDragging?this._dragEnd(e,t):this._staticClick(e,t)},n._dragStart=function(e,t){this.isDragging=!0,this.isPreventingClicks=!0,this.dragStart(e,t)},n.dragStart=function(e,t){this.emitEvent("dragStart",[e,t])},n._dragMove=function(e,t,r){this.isDragging&&this.dragMove(e,t,r)},n.dragMove=function(e,t,r){e.preventDefault(),this.emitEvent("dragMove",[e,t,r])},n._dragEnd=function(e,t){this.isDragging=!1,setTimeout(function(){delete this.isPreventingClicks}.bind(this)),this.dragEnd(e,t)},n.dragEnd=function(e,t){this.emitEvent("dragEnd",[e,t])},n.onclick=function(e){this.isPreventingClicks&&e.preventDefault()},n._staticClick=function(e,t){this.isIgnoringMouseUp&&"mouseup"==e.type||(this.staticClick(e,t),"mouseup"!=e.type&&(this.isIgnoringMouseUp=!0,setTimeout(function(){delete this.isIgnoringMouseUp}.bind(this),400)))},n.staticClick=function(e,t){this.emitEvent("staticClick",[e,t])},r.getPointerPoint=t.getPointerPoint,r}(a,e)}.apply(t,n))||(e.exports=i)}(window)},function(e,t,r){"use strict";var n,i;"function"==typeof Symbol&&Symbol.iterator,function(a,o){n=[r(89)],void 0===(i=function(e){return function(e,t){function r(){}var n=r.prototype=Object.create(t.prototype);n.bindStartEvent=function(e){this._bindStartEvent(e,!0)},n.unbindStartEvent=function(e){this._bindStartEvent(e,!1)},n._bindStartEvent=function(t,r){var n=(r=void 0===r||r)?"addEventListener":"removeEventListener",i="mousedown";e.PointerEvent?i="pointerdown":"ontouchstart"in e&&(i="touchstart"),t[n](i,this)},n.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},n.getTouch=function(e){for(var t=0;t<e.length;t++){var r=e[t];if(r.identifier==this.pointerIdentifier)return r}},n.onmousedown=function(e){var t=e.button;t&&0!==t&&1!==t||this._pointerDown(e,e)},n.ontouchstart=function(e){this._pointerDown(e,e.changedTouches[0])},n.onpointerdown=function(e){this._pointerDown(e,e)},n._pointerDown=function(e,t){e.button||this.isPointerDown||(this.isPointerDown=!0,this.pointerIdentifier=void 0!==t.pointerId?t.pointerId:t.identifier,this.pointerDown(e,t))},n.pointerDown=function(e,t){this._bindPostStartEvents(e),this.emitEvent("pointerDown",[e,t])};var i={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]};return n._bindPostStartEvents=function(t){if(t){var r=i[t.type];r.forEach((function(t){e.addEventListener(t,this)}),this),this._boundPointerEvents=r}},n._unbindPostStartEvents=function(){this._boundPointerEvents&&(this._boundPointerEvents.forEach((function(t){e.removeEventListener(t,this)}),this),delete this._boundPointerEvents)},n.onmousemove=function(e){this._pointerMove(e,e)},n.onpointermove=function(e){e.pointerId==this.pointerIdentifier&&this._pointerMove(e,e)},n.ontouchmove=function(e){var t=this.getTouch(e.changedTouches);t&&this._pointerMove(e,t)},n._pointerMove=function(e,t){this.pointerMove(e,t)},n.pointerMove=function(e,t){this.emitEvent("pointerMove",[e,t])},n.onmouseup=function(e){this._pointerUp(e,e)},n.onpointerup=function(e){e.pointerId==this.pointerIdentifier&&this._pointerUp(e,e)},n.ontouchend=function(e){var t=this.getTouch(e.changedTouches);t&&this._pointerUp(e,t)},n._pointerUp=function(e,t){this._pointerDone(),this.pointerUp(e,t)},n.pointerUp=function(e,t){this.emitEvent("pointerUp",[e,t])},n._pointerDone=function(){this._pointerReset(),this._unbindPostStartEvents(),this.pointerDone()},n._pointerReset=function(){this.isPointerDown=!1,delete this.pointerIdentifier},n.pointerDone=function(){},n.onpointercancel=function(e){e.pointerId==this.pointerIdentifier&&this._pointerCancel(e,e)},n.ontouchcancel=function(e){var t=this.getTouch(e.changedTouches);t&&this._pointerCancel(e,t)},n._pointerCancel=function(e,t){this._pointerDone(),this.pointerCancel(e,t)},n.pointerCancel=function(e,t){this.emitEvent("pointerCancel",[e,t])},r.getPointerPoint=function(e){return{x:e.pageX,y:e.pageY}},r}(a,e)}.apply(t,n))||(e.exports=i)}(window)},function(e,t,r){"use strict";var n,i;"function"==typeof Symbol&&Symbol.iterator,"undefined"!=typeof window&&window,void 0===(i="function"==typeof(n=function(){function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var r=this._events=this._events||{},n=r[e]=r[e]||[];return-1==n.indexOf(t)&&n.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var r=this._onceEvents=this._onceEvents||{};return(r[e]=r[e]||{})[t]=!0,this}},t.off=function(e,t){var r=this._events&&this._events[e];if(r&&r.length){var n=r.indexOf(t);return-1!=n&&r.splice(n,1),this}},t.emitEvent=function(e,t){var r=this._events&&this._events[e];if(r&&r.length){r=r.slice(0),t=t||[];for(var n=this._onceEvents&&this._onceEvents[e],i=0;i<r.length;i++){var a=r[i];n&&n[a]&&(this.off(e,a),delete n[a]),a.apply(this,t)}return this}},t.allOff=function(){delete this._events,delete this._onceEvents},e})?n.call(t,r,t,e):n)||(e.exports=i)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0);(n=i)&&n.__esModule,t.default={name:"memoryPlay",method:function(){var e=this;e.on("memoryPlayStart",(function(t){e.currentTime=t}))}},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0),a=(n=i)&&n.__esModule?n:{default:n};t.default={name:"localPreview",method:function(){var e=this,t=e.root;function r(r){e.uploadFile=r.files[0];var n=URL.createObjectURL(e.uploadFile);if(a.default.util.hasClass(t,"xgplayer-nostart"))e.config.url=n,e.start();else{e.src=n;var i=e.play();void 0!==i&&i&&i.catch((function(e){}))}}e.on("upload",r),e.once("destroy",(function t(){e.off("upload",r),e.off("destroy",t)}))}},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=r(0),o=(n=a)&&n.__esModule?n:{default:n},s=o.default.util,l=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.player=t,this.state={playbackRate:0,isRepeat:!1,keyCode:0,repeat:0,isBody:!1},this.timer=null,this.initEvents()}return i(e,[{key:"initEvents",value:function(){var e=this,t=this.player,r=t.root,n=t.config;this.player.onBodyKeydown=this.onBodyKeydown.bind(this),this.player.onKeydown=this.onKeydown.bind(this),this.player.onKeyup=this.onKeyup.bind(this),n.keyShortcut&&"on"!==n.keyShortcut||(document.addEventListener("keydown",this.player.onBodyKeydown),r.addEventListener("keydown",this.player.onKeydown),s.on(this.player,"destroy",(function(){document.removeEventListener("keydown",e.player.onBodyKeydown),r.removeEventListener("keydown",e.player.onKeydown),clearTimeout(e.timer),e.timer=null})))}},{key:"checkTarget",value:function(e){var t=this.player;return e.target===t.root||e.target===t.video||e.target===t.controls}},{key:"onBodyKeydown",value:function(e){var t=e||window.event,r=t.keyCode;if(t.target===document.body&&(37===r||39===r||32===r))return t.preventDefault(),t.cancelBubble=!0,t.returnValue=!1,t.repeat||document.addEventListener("keyup",this.player.onKeyup),this.handler(t),!1}},{key:"onKeydown",value:function(e){var t=e||window.event,r=t.keyCode;if(this.checkTarget(t)&&(37===r||38===r||39===r||40===r||32===r||27===r))return t.preventDefault(),t.cancelBubble=!0,t.returnValue=!1,this.player.emit("focus"),t.repeat||this.player.root.addEventListener("keyup",this.player.onKeyup),this.handler(t),!1}},{key:"onKeyup",value:function(){var e=this.state,t=this.player;document.removeEventListener("keyup",this.player.onKeyup),t.root.removeEventListener("keyup",this.player.onKeyup),e.keyCode&&(0!==e.playbackRate&&(t.playbackRate=e.playbackRate),e.isRepeat||this.handlerKeyCode(e.keyCode,!1),e.playbackRate=0,e.isRepeat=!1,e.keyCode=0,e.repeat=0,this.changeVolumeSlide())}},{key:"handler",value:function(e){var t=this.state,r=this.player;t.keyCode=e.keyCode,t.isRepeat=e.repeat,e.repeat&&(r.config.disableLongPress?this.handlerKeyCode(t.keyCode,!1):t.repeat%2==0&&this.handlerKeyCode(t.keyCode,!0),t.repeat++)}},{key:"handlerKeyCode",value:function(e,t){var r=this.player,n=this.state;switch(e){case 39:t?0===n.repeat&&this.changeRate():this.seek(!1,t);break;case 37:this.seek(!0,t);break;case 38:this.changeVolume(!0);break;case 40:this.changeVolume(!1);break;case 32:t||(r.paused?r.play():r.pause());break;case 27:o.default.util.hasClass(r.root,"xgplayer-is-cssfullscreen")&&r.exitCssFullscreen()}}},{key:"seek",value:function(e,t){var r=this.player,n=(r.config.keyShortcutStep||{}).currentTime||10;r.isLoading||r.isSeeking||t&&this.state.repeat%8>0||(e?r.currentTime-n>=0?r.currentTime-=n:r.currentTime=0:r.maxPlayedTime&&r.config.allowSeekPlayed&&r.currentTime+n>r.maxPlayedTime?r.currentTime=r.maxPlayedTime:r.currentTime+n<=r.duration?r.currentTime+=n:r.currentTime=r.duration-1)}},{key:"changeRate",value:function(){this.state.playbackRate=this.player.playbackRate,this.player.playbackRate=this.player.config.keyboardRate||5}},{key:"changeVolumeSlide",value:function(e){var t=this.player;t.controls&&(e?(t.emit("focus"),s.hasClass(t.root,"xgplayer-volume-active")||s.addClass(t.root,"xgplayer-volume-active")):(clearTimeout(this.timer),this.timer=setTimeout((function(){s.removeClass(t.root,"xgplayer-volume-active")}),1e3)))}},{key:"changeVolume",value:function(e){var t=this.player,r=(t.config.keyShortcutStep||{}).volume||.1;this.changeVolumeSlide(!0);var n=t.volume;e&&n+r<=1?t.volume=n+r:!e&&n-r>=0&&(t.volume=n-r)}}]),e}();t.default={name:"keyboard",method:function(){this.keyboard=new l(this)}},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0),a=(n=i)&&n.__esModule?n:{default:n},o={maxCount:3,backupUrl:"",isFetch:!0,fetchTimeout:100};t.default={name:"errorretry",method:function(){var e=this,t=this;if(t.config.errorConfig&&!(t.src.indexOf("blob:")>-1)){var r={},n=t.config.errorConfig;for(var i in o)void 0===n[i]?r[i]=o[i]:r[i]=n[i];t.retryData={count:0,errfTimer:null,isFetchReturn:!1,currentTime:0};var s=t._onError;t._onError=function(n){var i=e.retryData.count;if(i>r.maxCount)r.isFetch?function(e,t,r){var n=function(t,r){e.retryData.isFetchReturn||(e.retryData.isFetchReturn=!0,t(r))};return new Promise((function(i,a){try{var o=new window.XMLHttpRequest;o.open("get",t),o.onload=function(){n(i,{status:o.status,statusText:o.statusText,xhr:o})},o.onerror=function(){n(i,{status:o.status,statusText:o.statusText||"The network environment is disconnected or the address is invalid",xhr:o})},o.onabort=function(){},e.retryData.errfTimer=window.setTimeout((function(){var t=e.retryData.errfTimer;window.clearTimeout(t),e.retryData.errfTimer=null,n(i,{status:-1,statusText:"request timeout"})}),r),o.send()}catch(t){e.retryData.isFetchReturn=!0,n(i,{status:-2,statusText:"request error"})}}))}(e,e.currentSrc,r.fetchTimeout).then((function(t){e.emit("error",new a.default.Errors({type:"network",currentTime:e.currentTime,duration:e.duration||0,networkState:e.networkState,readyState:e.readyState,currentSrc:e.currentSrc,src:e.src,ended:e.ended,httpCode:t.status,httpMsg:t.statusText,errd:{line:101,msg:e.error,handle:"plugin errorRetry"},errorCode:e.video&&e.video.error.code,mediaError:e.video&&e.video.error})),s.call(e,t)})):s.call(e,n);else{0===i&&(e.retryData.currentTime=e.currentTime,e.once("canplay",l.bind(e)));var o="";o=r.count<2?r.backupUrl?r.backupUrl:t.currentSrc:r.backupUrl&&i>1?r.backupUrl:t.currentSrc,e.retryData.count++,e.src=o}}}function l(){this.currentTime=this.retryData.currentTime,this.play(),this.retryData.retryCode=0,this.retryData.isFetchReturn=!1,this.retryData.currentTime=0}}},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),a(r(0));var n=a(r(95)),i=r(96);function a(e){return e&&e.__esModule?e:{default:e}}t.default={name:"download",method:function(){var e=this;function t(){e.download()}e.on("downloadBtnClick",t),e.once("destroy",(function r(){e.off("downloadBtnClick",t),e.off("destroy",r)})),e.download=function(){var e=(0,i.getAbsoluteURL)(this.config.url);(0,n.default)(e)}}},e.exports=t.default},function(e,t,r){"use strict";var n,i,a;"function"==typeof Symbol&&Symbol.iterator,i=[],void 0===(a="function"==typeof(n=function(){return function e(t,r,n){var i,a,o=window,s="application/octet-stream",l=n||s,u=t,c=!r&&!n&&u,d=document.createElement("a"),f=function(e){return String(e)},p=o.Blob||o.MozBlob||o.WebKitBlob||f,h=r||"download";if(p=p.call?p.bind(o):Blob,"true"===String(this)&&(l=(u=[u,l])[0],u=u[1]),c&&c.length<2048&&(h=c.split("/").pop().split("?")[0],d.href=c,-1!==d.href.indexOf(c))){var g=new XMLHttpRequest;return g.open("GET",c,!0),g.responseType="blob",g.onload=function(t){e(t.target.response,h,s)},setTimeout((function(){g.send()}),0),g}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(u)){if(!(u.length>2096103.424&&p!==f))return navigator.msSaveBlob?navigator.msSaveBlob(x(u),h):b(u);l=(u=x(u)).type||s}else if(/([\x80-\xff])/.test(u)){for(var y=0,v=new Uint8Array(u.length),m=v.length;y<m;++y)v[y]=u.charCodeAt(y);u=new p([v],{type:l})}function x(e){for(var t=e.split(/[:;,]/),r=t[1],n=("base64"==t[2]?atob:decodeURIComponent)(t.pop()),i=n.length,a=0,o=new Uint8Array(i);a<i;++a)o[a]=n.charCodeAt(a);return new p([o],{type:r})}function b(e,t){if("download"in d)return d.href=e,d.setAttribute("download",h),d.className="download-js-link",d.innerHTML="downloading...",d.style.display="none",document.body.appendChild(d),setTimeout((function(){d.click(),document.body.removeChild(d),!0===t&&setTimeout((function(){o.URL.revokeObjectURL(d.href)}),250)}),66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,s)),window.open(e)||confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=e),!0;var r=document.createElement("iframe");document.body.appendChild(r),!t&&/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,s)),r.src=e,setTimeout((function(){document.body.removeChild(r)}),333)}if(i=u instanceof p?u:new p([u],{type:l}),navigator.msSaveBlob)return navigator.msSaveBlob(i,h);if(o.URL)b(o.URL.createObjectURL(i),!0);else{if("string"==typeof i||i.constructor===f)try{return b("data:"+l+";base64,"+o.btoa(i))}catch(e){return b("data:"+l+","+encodeURIComponent(i))}(a=new FileReader).onload=function(e){b(this.result)},a.readAsDataURL(i)}return!0}})?n.apply(t,i):n)||(e.exports=a)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getAbsoluteURL=function(e){if(!e.match(/^https?:\/\//)){var t=document.createElement("div");t.innerHTML='<a href="'+e+'">x</a>',e=t.firstChild.href}return e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0);(n=i)&&n.__esModule,t.default={name:"definition",method:function(){var e=this;e.once("destroy",(function t(){e.off("destroy",t)}))}},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0),a=(n=i)&&n.__esModule?n:{default:n};t.default={name:"danmu",method:function(){var e=this,t=a.default.util;e.on("initDefaultDanmu",(function(r){var n=e.root.querySelector("xg-danmu");if(t.addClass(n,"xgplayer-has-danmu"),!e.config.danmu.closeDefaultBtn){var i=function(){r.start()},a=function(){t.hasClass(e.danmuBtn,"danmu-switch-active")&&r.pause()},o=function(){t.hasClass(e.danmuBtn,"danmu-switch-active")&&r.play()},s=function(){t.hasClass(e.danmuBtn,"danmu-switch-active")&&(r.stop(),r.start())};e.danmuBtn=t.copyDom(r.bulletBtn.createSwitch(!0)),e.controls.appendChild(e.danmuBtn),["click","touchend"].forEach((function(a){e.danmuBtn.addEventListener(a,(function(a){a.preventDefault(),a.stopPropagation(),t.toggleClass(e.danmuBtn,"danmu-switch-active"),t.hasClass(e.danmuBtn,"danmu-switch-active")?(e.emit("danmuBtnOn"),t.addClass(n,"xgplayer-has-danmu"),e.once("timeupdate",i)):(e.emit("danmuBtnOff"),t.removeClass(n,"xgplayer-has-danmu"),r.stop())}))})),e.onElementClick&&n.addEventListener("click",(function(t){e.onElementClick(t,n)}),!1),e.onElementDblclick&&n.addEventListener("dblclick",(function(t){e.onElementDblclick(t,n)}),!1),e.on("pause",a),e.on("play",o),e.on("seeked",s),e.once("destroy",(function t(){e.off("timeupdate",i),e.off("pause",a),e.off("play",o),e.off("seeked",s),e.off("destroy",t)}))}}))}},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0),a=(n=i)&&n.__esModule?n:{default:n};t.default={name:"cssFullscreen",method:function(){var e=this,t=e.root,r=a.default.util;function n(){r.hasClass(t,"xgplayer-is-cssfullscreen")?e.exitCssFullscreen():e.getCssFullscreen()}e.on("cssFullscreenBtnClick",n),e.on("exitFullscreen",(function(){r.removeClass(t,"xgplayer-is-cssfullscreen")})),e.once("destroy",(function t(){e.off("cssFullscreenBtnClick",n),e.off("destroy",t)})),e.getCssFullscreen=function(){this.config.fluid&&(this.root.style["padding-top"]=""),r.addClass(this.root,"xgplayer-is-cssfullscreen"),this.emit("requestCssFullscreen")},e.exitCssFullscreen=function(){this.config.fluid&&(this.root.style.width="100%",this.root.style.height="0",this.root.style["padding-top"]=100*this.config.height/this.config.width+"%"),r.removeClass(this.root,"xgplayer-is-cssfullscreen"),this.emit("exitCssFullscreen")}}},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0);(n=i)&&n.__esModule,t.default={name:"airplay",method:function(){var e=this;function t(){e.video.webkitShowPlaybackTargetPicker()}e.config.airplay&&window.WebKitPlaybackTargetAvailabilityEvent&&(e.on("airplayBtnClick",t),e.once("destroy",(function r(){e.off("airplayBtnClick",t),e.off("destroy",r)})))}},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0),a=(n=i)&&n.__esModule?n:{default:n};r(102),t.default={name:"s_enter",method:function(){for(var e=this.root,t=a.default.util,r="",n=1;n<=12;n++)r+='<div class="xgplayer-enter-bar'+n+'"></div>';var i=t.createDom("xg-enter",'<div class="xgplayer-enter-spinner">\n                                                  '+r+"\n                                                </div>",{},"xgplayer-enter");e.appendChild(i)}},e.exports=t.default},function(e,t,r){var n=r(103);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};r(2)(n,i),n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(1)(!1)).push([e.i,".xgplayer-skin-default .xgplayer-enter{display:none;position:absolute;left:0;top:0;width:100%;height:100%;background:#000;z-index:120}.xgplayer-skin-default .xgplayer-enter .xgplayer-enter-spinner{display:block;position:absolute;left:50%;top:50%;height:100px;width:100px;position:relative;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.xgplayer-skin-default .xgplayer-enter .xgplayer-enter-spinner div{width:12%;height:26%;background-color:hsla(0,0%,100%,.7);position:absolute;left:44%;top:37%;opacity:0;border-radius:30px;-webkit-animation:fade 1s linear infinite;animation:fade 1s linear infinite}.xgplayer-skin-default .xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar1{-webkit-transform:rotate(0deg) translateY(-142%);-ms-transform:rotate(0deg) translateY(-142%);transform:rotate(0deg) translateY(-142%);-webkit-animation-delay:0s;animation-delay:0s}.xgplayer-skin-default .xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar2{-webkit-transform:rotate(30deg) translateY(-142%);-ms-transform:rotate(30deg) translateY(-142%);transform:rotate(30deg) translateY(-142%);-webkit-animation-delay:-.9163s;animation-delay:-.9163s}.xgplayer-skin-default .xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar3{-webkit-transform:rotate(60deg) translateY(-142%);-ms-transform:rotate(60deg) translateY(-142%);transform:rotate(60deg) translateY(-142%);-webkit-animation-delay:-.833s;animation-delay:-.833s}.xgplayer-skin-default .xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar4{-webkit-transform:rotate(90deg) translateY(-142%);-ms-transform:rotate(90deg) translateY(-142%);transform:rotate(90deg) translateY(-142%);-webkit-animation-delay:-.7497s;animation-delay:-.7497s}.xgplayer-skin-default .xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar5{-webkit-transform:rotate(120deg) translateY(-142%);-ms-transform:rotate(120deg) translateY(-142%);transform:rotate(120deg) translateY(-142%);-webkit-animation-delay:-.6664s;animation-delay:-.6664s}.xgplayer-skin-default .xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar6{-webkit-transform:rotate(150deg) translateY(-142%);-ms-transform:rotate(150deg) translateY(-142%);transform:rotate(150deg) translateY(-142%);-webkit-animation-delay:-.5831s;animation-delay:-.5831s}.xgplayer-skin-default .xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar7{-webkit-transform:rotate(180deg) translateY(-142%);-ms-transform:rotate(180deg) translateY(-142%);transform:rotate(180deg) translateY(-142%);-webkit-animation-delay:-.4998s;animation-delay:-.4998s}.xgplayer-skin-default .xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar8{-webkit-transform:rotate(210deg) translateY(-142%);-ms-transform:rotate(210deg) translateY(-142%);transform:rotate(210deg) translateY(-142%);-webkit-animation-delay:-.4165s;animation-delay:-.4165s}.xgplayer-skin-default .xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar9{-webkit-transform:rotate(240deg) translateY(-142%);-ms-transform:rotate(240deg) translateY(-142%);transform:rotate(240deg) translateY(-142%);-webkit-animation-delay:-.3332s;animation-delay:-.3332s}.xgplayer-skin-default .xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar10{-webkit-transform:rotate(270deg) translateY(-142%);-ms-transform:rotate(270deg) translateY(-142%);transform:rotate(270deg) translateY(-142%);-webkit-animation-delay:-.2499s;animation-delay:-.2499s}.xgplayer-skin-default .xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar11{-webkit-transform:rotate(300deg) translateY(-142%);-ms-transform:rotate(300deg) translateY(-142%);transform:rotate(300deg) translateY(-142%);-webkit-animation-delay:-.1666s;animation-delay:-.1666s}.xgplayer-skin-default .xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar12{-webkit-transform:rotate(330deg) translateY(-142%);-ms-transform:rotate(330deg) translateY(-142%);transform:rotate(330deg) translateY(-142%);-webkit-animation-delay:-.0833s;animation-delay:-.0833s}@-webkit-keyframes fade{0%{opacity:1}to{opacity:.25}}@keyframes fade{0%{opacity:1}to{opacity:.25}}.xgplayer-skin-default.xgplayer-is-enter .xgplayer-enter{display:block}",""])},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o(r(0)),i=o(r(105)),a=o(r(106));function o(e){return e&&e.__esModule?e:{default:e}}r(107),t.default={name:"s_cssFullscreen",method:function(){var e=this,t=n.default.util;if(e.config.cssFullscreen){var r=t.createDom("xg-cssfullscreen",'<xg-icon class="xgplayer-icon">\n                                             <div class="xgplayer-icon-requestfull">'+i.default+'</div>\n                                             <div class="xgplayer-icon-exitfull">'+a.default+"</div>\n                                           </xg-icon>",{},"xgplayer-cssfullscreen"),o={};o.requestfull=e.lang.CSSFULLSCREEN_TIPS,o.exitfull=e.lang.EXITCSSFULLSCREEN_TIPS;var s=t.createDom("xg-tips",'<span class="xgplayer-tip-requestfull">'+o.requestfull+'</span>\n                                        <span class="xgplayer-tip-exitfull">'+o.exitfull+"</span>",{},"xgplayer-tips");r.appendChild(s),e.once("ready",(function(){e.controls.appendChild(r)})),["click","touchend"].forEach((function(t){r.addEventListener(t,(function(t){t.preventDefault(),t.stopPropagation(),e.emit("cssFullscreenBtnClick")}))}))}}},e.exports=t.default},function(e,t,r){"use strict";r.r(t),t.default='<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40">\n  <path transform="scale(0.028 0.028)" d="M843.617212 67.898413 175.411567 67.898413c-61.502749 0-111.367437 49.856501-111.367437 111.367437l0 668.205645c0 61.510936 49.864688 111.367437 111.367437 111.367437L843.617212 958.838931c61.510936 0 111.367437-49.856501 111.367437-111.367437L954.984648 179.26585C954.984648 117.754914 905.12917 67.898413 843.617212 67.898413zM398.146441 736.104057c15.380292 0 27.842115 12.461823 27.842115 27.842115 0 15.379269-12.461823 27.841092-27.842115 27.841092L259.725858 791.787264c-7.785314 0-14.781658-3.217275-19.838837-8.365528-5.383614-4.577249-8.791224-11.228739-8.791224-19.475564L231.095797 624.736621c0-15.371082 12.471033-27.842115 27.842115-27.842115 15.380292 0 27.842115 12.471033 27.842115 27.842115l-0.61603 71.426773 133.036969-133.037992 39.378869 39.378869L324.962651 736.113267 398.146441 736.104057zM419.199942 463.611943 286.162974 330.565764l0.61603 71.435982c0 15.380292-12.461823 27.842115-27.842115 27.842115-15.371082 0-27.842115-12.461823-27.842115-27.842115L231.094774 262.791172c0-8.256034 3.40761-14.908548 8.791224-19.476587 5.057179-5.148253 12.053524-8.374738 19.838837-8.374738l138.420583 0.00921c15.380292 0 27.842115 12.461823 27.842115 27.842115s-12.461823 27.842115-27.842115 27.842115l-73.175603-0.00921 133.607974 133.607974L419.199942 463.611943zM787.932981 763.946172c0 8.247848-3.40761 14.899338-8.791224 19.475564-5.057179 5.148253-12.053524 8.365528-19.839861 8.365528L620.881314 791.787264c-15.379269 0-27.841092-12.461823-27.841092-27.841092 0-15.380292 12.461823-27.842115 27.841092-27.842115l73.185836 0.00921L560.449967 602.50427l39.378869-39.378869L732.875015 696.163393l-0.62524-71.426773c0-15.371082 12.462846-27.842115 27.842115-27.842115 15.380292 0 27.842115 12.471033 27.842115 27.842115L787.934005 763.946172zM787.932981 402.000724c0 15.380292-12.461823 27.842115-27.842115 27.842115-15.379269 0-27.842115-12.461823-27.842115-27.842115l0.62524-71.435982L599.828836 463.611943l-39.378869-39.378869 133.617184-133.607974-73.185836 0.00921c-15.379269 0-27.841092-12.461823-27.841092-27.842115s12.461823-27.842115 27.841092-27.842115l138.421606-0.00921c7.785314 0 14.781658 3.226484 19.839861 8.374738 5.383614 4.568039 8.791224 11.219529 8.791224 19.476587L787.934005 402.000724z"></path>\n</svg>\n'},function(e,t,r){"use strict";r.r(t),t.default='<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40">\n  <path transform="scale(0.028 0.028)" d="M834.56 81.92H189.44c-59.392 0-107.52 48.128-107.52 107.52v645.12c0 59.392 48.128 107.52 107.52 107.52h645.12c59.392 0 107.52-48.128 107.52-107.52V189.44c0-59.392-48.128-107.52-107.52-107.52zM458.24 727.04c0 14.848-12.288 26.624-26.624 26.624S404.48 741.888 404.48 727.04v-69.632L289.28 773.12c-10.752 10.24-27.648 10.24-37.888 0-10.24-10.752-10.24-27.648 0-37.888L366.592 619.52H296.96c-14.848 0-26.624-12.288-26.624-26.624s12.288-26.624 26.624-26.624h134.144c14.848 0 26.624 12.288 26.624 26.624V727.04z m0-295.936c0 14.848-12.288 26.624-26.624 26.624H296.96c-14.848 0-26.624-12.288-26.624-26.624S282.112 404.48 296.96 404.48h69.632L251.392 289.28c-10.24-10.752-10.24-27.648 0-37.888 5.12-5.12 12.288-7.68 18.944-7.68 6.656 0 13.824 2.56 18.944 7.68L404.48 366.592V296.96c0-14.848 12.288-26.624 26.624-26.624s26.624 12.288 26.624 26.624v134.144zM773.12 773.12c-10.752 10.24-27.648 10.24-37.888 0L619.52 657.408V727.04c0 14.848-12.288 26.624-26.624 26.624s-26.624-11.776-26.624-26.624v-134.144c0-14.848 12.288-26.624 26.624-26.624H727.04c14.848 0 26.624 12.288 26.624 26.624s-12.288 26.624-26.624 26.624h-69.632l115.2 115.2c10.752 10.752 10.752 27.648 0.512 38.4z m0-483.84L657.408 404.48H727.04c14.848 0 26.624 12.288 26.624 26.624 0 14.848-12.288 26.624-26.624 26.624h-134.144c-14.848 0-26.624-12.288-26.624-26.624V296.96c0-14.848 12.288-26.624 26.624-26.624s26.624 12.288 26.624 26.624v69.632L734.72 250.88c5.12-5.12 12.288-7.68 18.944-7.68s13.824 2.56 18.944 7.68c10.752 10.752 10.752 27.648 0.512 38.4z"></path>\n</svg>\n'},function(e,t,r){var n=r(108);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};r(2)(n,i),n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(1)(!1)).push([e.i,".xgplayer-skin-default .xgplayer-cssfullscreen,.xgplayer-skin-default .xgplayer-cssfullscreen-img{position:relative;-webkit-order:12;-moz-box-ordinal-group:13;order:12;display:block;cursor:pointer}.xgplayer-skin-default .xgplayer-cssfullscreen-img .xgplayer-icon,.xgplayer-skin-default .xgplayer-cssfullscreen .xgplayer-icon{width:32px;margin-top:5px}.xgplayer-skin-default .xgplayer-cssfullscreen-img .xgplayer-icon div,.xgplayer-skin-default .xgplayer-cssfullscreen .xgplayer-icon div{position:absolute}.xgplayer-skin-default .xgplayer-cssfullscreen-img .xgplayer-icon .xgplayer-icon-requestfull,.xgplayer-skin-default .xgplayer-cssfullscreen .xgplayer-icon .xgplayer-icon-requestfull{display:block}.xgplayer-skin-default .xgplayer-cssfullscreen-img .xgplayer-icon .xgplayer-icon-exitfull,.xgplayer-skin-default .xgplayer-cssfullscreen .xgplayer-icon .xgplayer-icon-exitfull{display:none}.xgplayer-skin-default .xgplayer-cssfullscreen-img .xgplayer-tips,.xgplayer-skin-default .xgplayer-cssfullscreen .xgplayer-tips{margin-left:-40px}.xgplayer-skin-default .xgplayer-cssfullscreen-img .xgplayer-tips .xgplayer-tip-requestfull,.xgplayer-skin-default .xgplayer-cssfullscreen .xgplayer-tips .xgplayer-tip-requestfull{display:block}.xgplayer-skin-default .xgplayer-cssfullscreen-img .xgplayer-tips .xgplayer-tip-exitfull,.xgplayer-skin-default .xgplayer-cssfullscreen .xgplayer-tips .xgplayer-tip-exitfull{display:none}.xgplayer-skin-default .xgplayer-cssfullscreen-img:hover,.xgplayer-skin-default .xgplayer-cssfullscreen:hover{opacity:.85}.xgplayer-skin-default .xgplayer-cssfullscreen-img:hover .xgplayer-tips,.xgplayer-skin-default .xgplayer-cssfullscreen:hover .xgplayer-tips{display:block}.xgplayer-skin-default.xgplayer-is-cssfullscreen .xgplayer-cssfullscreen-img .xgplayer-icon .xgplayer-icon-requestfull,.xgplayer-skin-default.xgplayer-is-cssfullscreen .xgplayer-cssfullscreen .xgplayer-icon .xgplayer-icon-requestfull{display:none}.xgplayer-skin-default.xgplayer-is-cssfullscreen .xgplayer-cssfullscreen-img .xgplayer-icon .xgplayer-icon-exitfull,.xgplayer-skin-default.xgplayer-is-cssfullscreen .xgplayer-cssfullscreen .xgplayer-icon .xgplayer-icon-exitfull{display:block}.xgplayer-skin-default.xgplayer-is-cssfullscreen .xgplayer-cssfullscreen-img .xgplayer-tips,.xgplayer-skin-default.xgplayer-is-cssfullscreen .xgplayer-cssfullscreen .xgplayer-tips{margin-left:-47px}.xgplayer-skin-default.xgplayer-is-cssfullscreen .xgplayer-cssfullscreen-img .xgplayer-tips .xgplayer-tip-requestfull,.xgplayer-skin-default.xgplayer-is-cssfullscreen .xgplayer-cssfullscreen .xgplayer-tips .xgplayer-tip-requestfull{display:none}.xgplayer-skin-default.xgplayer-is-cssfullscreen .xgplayer-cssfullscreen-img .xgplayer-tips .xgplayer-tip-exitfull,.xgplayer-skin-default.xgplayer-is-cssfullscreen .xgplayer-cssfullscreen .xgplayer-tips .xgplayer-tip-exitfull{display:block}.xgplayer-skin-default.xgplayer-is-fullscreen .xgplayer-cssfullscreen,.xgplayer-skin-default.xgplayer-is-fullscreen .xgplayer-cssfullscreen-img{display:none}.xgplayer-skin-default.xgplayer-is-cssfullscreen{position:fixed!important;left:0!important;top:0!important;width:100%!important;height:100%!important;z-index:99999!important}.xgplayer-lang-is-en .xgplayer-cssfullscreen-img .xgplayer-tips,.xgplayer-lang-is-en .xgplayer-cssfullscreen .xgplayer-tips,.xgplayer-lang-is-en.xgplayer-is-cssfullscreen .xgplayer-cssfullscreen-img .xgplayer-tips,.xgplayer-lang-is-en.xgplayer-is-cssfullscreen .xgplayer-cssfullscreen .xgplayer-tips{margin-left:-46px}.lang-is-jp .xgplayer-cssfullscreen-img .xgplayer-tips,.lang-is-jp .xgplayer-cssfullscreen .xgplayer-tips{margin-left:-120px}.lang-is-jp.xgplayer-is-cssfullscreen .xgplayer-cssfullscreen-img .xgplayer-tips,.lang-is-jp.xgplayer-is-cssfullscreen .xgplayer-cssfullscreen .xgplayer-tips{margin-left:-60px}",""])},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=s(r(0)),i=s(r(110)),a=s(r(111)),o=s(r(112));function s(e){return e&&e.__esModule?e:{default:e}}r(113),t.default={name:"s_volume",method:function(){var e=this,t=n.default.util.createDom("xg-volume",'<xg-icon class="xgplayer-icon">\n                                         <div class="xgplayer-icon-large">'+o.default+'</div>\n                                         <div class="xgplayer-icon-small">'+a.default+'</div>\n                                         <div class="xgplayer-icon-muted">'+i.default+'</div>\n                                       </xg-icon>\n                                       <xg-slider class="xgplayer-slider" tabindex="2">\n                                         <xg-bar class="xgplayer-bar">\n                                           <xg-drag class="xgplayer-drag"></xg-drag>\n                                         </xg-bar>\n                                       </xg-slider>',{},"xgplayer-volume");e.once("ready",(function(){e.controls&&e.controls.appendChild(t)}));var r=t.querySelector(".xgplayer-slider"),s=t.querySelector(".xgplayer-bar"),l=t.querySelector(".xgplayer-drag"),u=t.querySelector(".xgplayer-icon");l.style.height=100*e.config.volume+"%",r.volume=e.config.volume,s.addEventListener("mousedown",(function(t){t.preventDefault(),t.stopPropagation(),e.emit("volumeBarClick",t)})),["click","touchend"].forEach((function(t){u.addEventListener(t,(function(t){t.preventDefault(),t.stopPropagation(),e.emit("volumeIconClick")}))})),u.addEventListener("mouseenter",(function(t){t.preventDefault(),t.stopPropagation(),e.emit("volumeIconEnter")})),["blur","mouseleave"].forEach((function(r){t.addEventListener(r,(function(t){t.preventDefault(),t.stopPropagation(),e.emit("volumeIconLeave")}))}))}},e.exports=t.default},function(e,t,r){"use strict";r.r(t),t.default='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28">\n  <path transform="scale(0.0220625 0.0220625)" d="M358.4 358.4h-204.8v307.2h204.8l256 256v-819.2l-256 256z"></path>\n  <path transform="scale(0.0220625 0.0220625)" d="M920.4 439.808l-108.544-109.056-72.704 72.704 109.568 108.544-109.056 108.544 72.704 72.704 108.032-109.568 108.544 109.056 72.704-72.704-109.568-108.032 109.056-108.544-72.704-72.704-108.032 109.568z"></path>\n</svg>\n'},function(e,t,r){"use strict";r.r(t),t.default='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28">\n  <path transform="scale(0.0220625 0.0220625)" d="M358.4 358.4h-204.8v307.2h204.8l256 256v-819.2l-256 256z"></path>\n  <path transform="scale(0.0220625 0.0220625)" d="M795.648 693.248l-72.704-72.704c27.756-27.789 44.921-66.162 44.921-108.544s-17.165-80.755-44.922-108.546l0.002 0.002 72.704-72.704c46.713 46.235 75.639 110.363 75.639 181.248s-28.926 135.013-75.617 181.227l-0.021 0.021zM795.648 693.248l-72.704-72.704c27.756-27.789 44.921-66.162 44.921-108.544s-17.165-80.755-44.922-108.546l0.002 0.002 72.704-72.704c46.713 46.235 75.639 110.363 75.639 181.248s-28.926 135.013-75.617 181.227l-0.021 0.021z"></path>\n</svg>\n'},function(e,t,r){"use strict";r.r(t),t.default='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28">\n  <path transform="scale(0.0220625 0.0220625)" d="M358.4 358.4h-204.8v307.2h204.8l256 256v-819.2l-256 256z"></path>\n  <path transform="scale(0.0220625 0.0220625)" d="M940.632 837.632l-72.192-72.192c65.114-64.745 105.412-154.386 105.412-253.44s-40.299-188.695-105.396-253.424l-0.016-0.016 72.192-72.192c83.639 83.197 135.401 198.37 135.401 325.632s-51.762 242.434-135.381 325.612l-0.020 0.020zM795.648 693.248l-72.704-72.704c27.756-27.789 44.921-66.162 44.921-108.544s-17.165-80.755-44.922-108.546l0.002 0.002 72.704-72.704c46.713 46.235 75.639 110.363 75.639 181.248s-28.926 135.013-75.617 181.227l-0.021 0.021z"></path>\n</svg>\n'},function(e,t,r){var n=r(114);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};r(2)(n,i),n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(1)(!1)).push([e.i,'.xgplayer-skin-default .xgplayer-volume{outline:none;-webkit-order:4;-moz-box-ordinal-group:5;order:4;width:40px;height:40px;display:block;position:relative;z-index:18}.xgplayer-skin-default .xgplayer-volume .xgplayer-icon{margin-top:8px;cursor:pointer;position:absolute;bottom:-9px}.xgplayer-skin-default .xgplayer-volume .xgplayer-icon div{position:absolute}.xgplayer-skin-default .xgplayer-volume .xgplayer-icon .xgplayer-icon-large{display:block}.xgplayer-skin-default .xgplayer-volume .xgplayer-icon .xgplayer-icon-muted,.xgplayer-skin-default .xgplayer-volume .xgplayer-icon .xgplayer-icon-small{display:none}.xgplayer-skin-default .xgplayer-slider{display:none;position:absolute;width:28px;height:92px;background:rgba(0,0,0,.54);border-radius:1px;bottom:42px;outline:none}.xgplayer-skin-default .xgplayer-slider:after{content:" ";display:block;height:15px;width:28px;position:absolute;bottom:-15px;left:0;z-index:20}.xgplayer-skin-default .xgplayer-bar,.xgplayer-skin-default .xgplayer-drag{display:block;position:absolute;bottom:6px;left:12px;background:hsla(0,0%,100%,.3);border-radius:100px;width:4px;height:76px;outline:none;cursor:pointer}.xgplayer-skin-default .xgplayer-drag{bottom:0;left:0;background:#fa1f41;max-height:76px}.xgplayer-skin-default .xgplayer-drag:after{content:" ";display:inline-block;width:8px;height:8px;background:#fff;box-shadow:0 0 5px 0 rgba(0,0,0,.26);position:absolute;border-radius:50%;left:-2px;top:-6px}.xgplayer-skin-default.xgplayer-volume-active .xgplayer-slider,.xgplayer-skin-default.xgplayer-volume-large .xgplayer-volume .xgplayer-icon .xgplayer-icon-large{display:block}.xgplayer-skin-default.xgplayer-volume-large .xgplayer-volume .xgplayer-icon .xgplayer-icon-muted,.xgplayer-skin-default.xgplayer-volume-large .xgplayer-volume .xgplayer-icon .xgplayer-icon-small,.xgplayer-skin-default.xgplayer-volume-small .xgplayer-volume .xgplayer-icon .xgplayer-icon-large{display:none}.xgplayer-skin-default.xgplayer-volume-small .xgplayer-volume .xgplayer-icon .xgplayer-icon-small{display:block}.xgplayer-skin-default.xgplayer-volume-muted .xgplayer-volume .xgplayer-icon .xgplayer-icon-large,.xgplayer-skin-default.xgplayer-volume-muted .xgplayer-volume .xgplayer-icon .xgplayer-icon-small,.xgplayer-skin-default.xgplayer-volume-small .xgplayer-volume .xgplayer-icon .xgplayer-icon-muted{display:none}.xgplayer-skin-default.xgplayer-volume-muted .xgplayer-volume .xgplayer-icon .xgplayer-icon-muted{display:block}.xgplayer-skin-default.xgplayer-mobile .xgplayer-volume .xgplayer-slider{display:none}',""])},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0),a=(n=i)&&n.__esModule?n:{default:n};r(116),t.default={name:"s_definition",method:function(){var e=this,t=e.root,r=a.default.util,n=a.default.sniffer,i=void 0,o=r.createDom("xg-definition","",{tabindex:3},"xgplayer-definition");function s(){var n=e.definitionList,i=["<ul>"],a=e.config.url,s=document.createElement("a");e.switchURL?["mp4","hls","__flv__","dash"].every((function(t){return!e[t]||(e[t].url&&(s.href=e[t].url),"__flv__"===t&&(e[t]._options?s.href=e[t]._options.url:s.href=e[t]._mediaDataSource.url),"hls"===t&&(s.href=e[t].originUrl||e[t].url,a=s.href),a=s.href,!1)})):a=e.currentSrc||e.src,n.forEach((function(t){s.href=t.url,e.dash?i.push("<li url='"+t.url+"' cname='"+t.name+"' class='"+(t.selected?"selected":"")+"'>"+t.name+"</li>"):i.push("<li url='"+t.url+"' cname='"+t.name+"' class='"+(s.href===a?"selected":"")+"'>"+t.name+"</li>")}));var l=n.filter((function(t){return s.href=t.url,e.dash?!0===t.selected:s.href===a}));i.push("</ul><p class='name'>"+(l[0]||{name:""}).name+"</p>");var u=t.querySelector(".xgplayer-definition");if(u){u.innerHTML=i.join("");var c=u.querySelector(".name");e.config.definitionActive&&"hover"!==e.config.definitionActive||c.addEventListener("mouseenter",(function(t){t.preventDefault(),t.stopPropagation(),r.addClass(e.root,"xgplayer-definition-active"),u.focus()}))}else{o.innerHTML=i.join("");var d=o.querySelector(".name");e.config.definitionActive&&"hover"!==e.config.definitionActive||d.addEventListener("mouseenter",(function(t){t.preventDefault(),t.stopPropagation(),r.addClass(e.root,"xgplayer-definition-active"),o.focus()})),e.controls.appendChild(o)}}function l(n){e.definitionList=n,n&&n instanceof Array&&n.length>1&&(r.addClass(t,"xgplayer-is-definition"),e.once("canplay",s))}function u(){if(e.currentTime=e.curTime,!i){var t=e.play();void 0!==t&&t&&t.catch((function(e){}))}}function c(){e.once("timeupdate",u)}function d(){r.removeClass(t,"xgplayer-definition-active")}"mobile"===n.device&&(e.config.definitionActive="click"),e.on("resourceReady",l),["touchend","click"].forEach((function(t){o.addEventListener(t,(function(t){t.preventDefault(),t.stopPropagation();var a=e.definitionList,s=t.target||t.srcElement,l=document.createElement("a");if(s&&"li"===s.tagName.toLocaleLowerCase()){var d,f=void 0;if(Array.prototype.forEach.call(s.parentNode.childNodes,(function(t){r.hasClass(t,"selected")&&(f=t.getAttribute("cname"),r.removeClass(t,"selected"),e.emit("beforeDefinitionChange",t.getAttribute("url")))})),e.dash&&a.forEach((function(e){e.selected=!1,e.name===s.innerHTML&&(e.selected=!0)})),r.addClass(s,"selected"),d=s.getAttribute("cname"),s.parentNode.nextSibling.innerHTML=""+s.getAttribute("cname"),l.href=s.getAttribute("url"),e.switchURL){var p=document.createElement("a");["mp4","hls","__flv__","dash"].every((function(t){return!e[t]||(e[t].url&&(p.href=e[t].url),"__flv__"===t&&(e[t]._options?p.href=e[t]._options.url:p.href=e[t]._mediaDataSource.url),"hls"===t&&(p.href=e[t].originUrl||e[t].url),!1)})),p.href===l.href||e.ended||e.switchURL(l.href)}else e.hls&&(document.createElement("a"),e.hls.url),l.href!==e.currentSrc&&(e.curTime=e.currentTime,i=e.paused,e.ended||(e.src=l.href,navigator.userAgent.toLowerCase().indexOf("android")>-1?e.once("timeupdate",c):e.once("playing",u)));e.emit("definitionChange",{from:f,to:d}),"mobile"===n.device&&r.removeClass(e.root,"xgplayer-definition-active")}else"click"!==e.config.definitionActive||!s||"p"!==s.tagName.toLocaleLowerCase()&&"em"!==s.tagName.toLocaleLowerCase()||("mobile"===n.device?r.toggleClass(e.root,"xgplayer-definition-active"):r.addClass(e.root,"xgplayer-definition-active"),o.focus());e.emit("focus")}),!1)})),o.addEventListener("mouseleave",(function(e){e.preventDefault(),e.stopPropagation(),r.removeClass(t,"xgplayer-definition-active")})),e.on("blur",d),e.once("destroy",(function t(){e.off("resourceReady",l),e.off("canplay",s),navigator.userAgent.toLowerCase().indexOf("android")>-1?(e.off("timeupdate",c),e.off("timeupdate",u)):e.off("playing",u),e.off("blur",d),e.off("destroy",t)}))}},e.exports=t.default},function(e,t,r){var n=r(117);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};r(2)(n,i),n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(1)(!1)).push([e.i,".xgplayer-skin-default .xgplayer-definition{-webkit-order:5;-moz-box-ordinal-group:6;order:5;width:60px;height:150px;z-index:18;position:relative;outline:none;display:none;cursor:default;margin-left:10px;margin-top:-119px}.xgplayer-skin-default .xgplayer-definition ul{display:none;list-style:none;width:78px;background:rgba(0,0,0,.54);border-radius:1px;position:absolute;bottom:30px;left:0;text-align:center;white-space:nowrap;margin-left:-10px;z-index:26;cursor:pointer}.xgplayer-skin-default .xgplayer-definition ul li{opacity:.7;font-family:PingFangSC-Regular;font-size:11px;color:hsla(0,0%,100%,.8);padding:6px 13px}.xgplayer-skin-default .xgplayer-definition ul li.selected,.xgplayer-skin-default .xgplayer-definition ul li:hover{color:#fff;opacity:1}.xgplayer-skin-default .xgplayer-definition .name{text-align:center;font-family:PingFangSC-Regular;font-size:13px;cursor:pointer;color:hsla(0,0%,100%,.8);position:absolute;bottom:0;width:60px;height:20px;line-height:20px;background:rgba(0,0,0,.38);border-radius:10px;display:inline-block;vertical-align:middle}.xgplayer-skin-default.xgplayer-definition-active .xgplayer-definition ul,.xgplayer-skin-default.xgplayer-is-definition .xgplayer-definition{display:block}",""])},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0),a=(n=i)&&n.__esModule?n:{default:n};r(119),t.default={name:"s_playbackRate",method:function(){var e=this,t=a.default.sniffer,r=a.default.util,n=[];if(!e.config.playbackRate)return!1;(n=[].concat(e.config.playbackRate)).sort((function(e,t){return t-e}));var i=r.createDom("xg-playbackrate"," ",{},"xgplayer-playbackrate");"mobile"===t.device&&(e.config.playbackRateActive="click");var o=[];n.forEach((function(e){o.push({name:""+e,rate:e+"x",selected:!1})}));var s=1,l=["<ul>"];o.forEach((function(t){e.config.defaultPlaybackRate&&e.config.defaultPlaybackRate.toString()===t.name?(t.selected=!0,s=e.config.defaultPlaybackRate,e.once("playing",(function(){e.video.playbackRate=e.config.defaultPlaybackRate}))):"1.0"!==t.name&&"1"!==t.name||e.config.defaultPlaybackRate&&1!==e.config.defaultPlaybackRate||(t.selected=!0),l.push("<li cname='"+t.name+"' class='"+(t.selected?"selected":"")+"'>"+t.rate+"</li>")})),l.push("</ul><p class='name'>"+s+"x</p>");var u=e.root.querySelector(".xgplayer-playbackrate");if(u){u.innerHTML=l.join("");var c=u.querySelector(".name");e.config.playbackRateActive&&"hover"!==e.config.playbackRateActive||c.addEventListener("mouseenter",(function(t){t.preventDefault(),t.stopPropagation(),r.addClass(e.root,"xgplayer-playbackrate-active"),u.focus()}))}else{i.innerHTML=l.join("");var d=i.querySelector(".name");e.config.playbackRateActive&&"hover"!==e.config.playbackRateActive||d.addEventListener("mouseenter",(function(t){t.preventDefault(),t.stopPropagation(),r.addClass(e.root,"xgplayer-playbackrate-active"),i.focus()})),e.once("ready",(function(){e.controls.appendChild(i)}))}["touchend","click"].forEach((function(n){i.addEventListener(n,(function(n){n.stopPropagation(),n.preventDefault();var a=n.target;if(a&&"li"===a.tagName.toLocaleLowerCase()){var l,u=void 0;o.forEach((function(t){t.selected=!1,a.textContent.replace(/\s+/g,"")===t.rate&&(Array.prototype.forEach.call(a.parentNode.childNodes,(function(e){r.hasClass(e,"selected")&&(u=Number(e.getAttribute("cname")),r.removeClass(e,"selected"))})),t.selected=!0,e.video.playbackRate=1*t.name,s=1*t.name)})),r.addClass(a,"selected"),l=Number(a.getAttribute("cname")),a.parentNode.nextSibling.innerHTML=a.getAttribute("cname")+"x",e.emit("playbackrateChange",{from:u,to:l}),"mobile"===t.device&&r.removeClass(e.root,"xgplayer-playbackrate-active")}else"click"!==e.config.playbackRateActive||!a||"p"!==a.tagName.toLocaleLowerCase()&&"span"!==a.tagName.toLocaleLowerCase()||("mobile"===t.device?r.toggleClass(e.root,"xgplayer-playbackrate-active"):r.addClass(e.root,"xgplayer-playbackrate-active"),i.focus());e.emit("focus")}),!1)})),i.addEventListener("mouseleave",(function(t){t.preventDefault(),t.stopPropagation(),r.removeClass(e.root,"xgplayer-playbackrate-active")})),e.on("blur",(function(){r.removeClass(e.root,"xgplayer-playbackrate-active")})),e.on("play",(function(){e.video.playbackRate.toFixed(1)!==s.toFixed(1)&&(e.video.playbackRate=s)}))}},e.exports=t.default},function(e,t,r){var n=r(120);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};r(2)(n,i),n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(1)(!1)).push([e.i,".xgplayer-skin-default .xgplayer-playbackrate{-webkit-order:8;-moz-box-ordinal-group:9;order:8;width:60px;height:150px;z-index:18;position:relative;display:inline-block;cursor:default;margin-top:-119px}.xgplayer-skin-default .xgplayer-playbackrate ul{display:none;list-style:none;width:78px;background:rgba(0,0,0,.54);border-radius:1px;position:absolute;bottom:30px;left:50%;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);text-align:left;white-space:nowrap;z-index:26;cursor:pointer}.xgplayer-skin-default .xgplayer-playbackrate ul li{opacity:.7;font-family:PingFangSC-Regular;font-size:11px;color:hsla(0,0%,100%,.8);position:relative;padding:4px 0;text-align:center}.xgplayer-skin-default .xgplayer-playbackrate ul li.selected,.xgplayer-skin-default .xgplayer-playbackrate ul li:hover{color:#fff;opacity:1}.xgplayer-skin-default .xgplayer-playbackrate ul li:first-child{position:relative;margin-top:12px}.xgplayer-skin-default .xgplayer-playbackrate ul li:last-child{position:relative;margin-bottom:12px}.xgplayer-skin-default .xgplayer-playbackrate .name{width:60px;height:20px;position:absolute;bottom:0;text-align:center;font-family:PingFangSC-Regular;font-size:13px;background:rgba(0,0,0,.38);color:hsla(0,0%,100%,.8);border-radius:10px;line-height:20px}.xgplayer-skin-default .xgplayer-playbackrate span{position:relative;top:19px;font-weight:700;text-shadow:0 0 4px rgba(0,0,0,.6)}.xgplayer-skin-default .xgplayer-playbackrate:hover{opacity:1}.xgplayer-skin-default.xgplayer-playbackrate-active .xgplayer-playbackrate ul{display:block}",""])},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0),a=(n=i)&&n.__esModule?n:{default:n};t.default={name:"s_localPreview",method:function(){var e=this,t=a.default.util;if(e.config.preview&&e.config.preview.uploadEl){var r=t.createDom("xg-preview",'<input type="file">',{},"xgplayer-preview"),n=r.querySelector("input");e.config.preview.uploadEl.appendChild(r),n.onchange=function(){e.emit("upload",n)}}}},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a(r(0)),i=a(r(123));function a(e){return e&&e.__esModule?e:{default:e}}r(124),t.default={name:"s_download",method:function(){var e=this,t=n.default.util;if(e.config.download){var r=t.createDom("xg-download",'<xg-icon class="xgplayer-icon">'+i.default+"</xg-icon>",{},"xgplayer-download"),a=e.lang.DOWNLOAD_TIPS,o=t.createDom("xg-tips",'<span class="xgplayer-tip-download">'+a+"</span>",{},"xgplayer-tips");r.appendChild(o),e.once("ready",(function(){e.controls.appendChild(r)})),["click","touchend"].forEach((function(t){r.addEventListener(t,(function(t){t.preventDefault(),t.stopPropagation(),e.emit("downloadBtnClick")}))}))}}},e.exports=t.default},function(e,t,r){"use strict";r.r(t),t.default='<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24">\n  <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n    <g transform="translate(-488.000000, -340.000000)" fill="#FFFFFF">\n      <g id="Group-2">\n        <g id="volme_big-copy" transform="translate(488.000000, 340.000000)">\n          <rect id="Rectangle-18" x="11" y="4" width="2" height="12" rx="1"></rect>\n          <rect id="Rectangle-2" x="3" y="18" width="18" height="2" rx="1"></rect>\n          <rect id="Rectangle-2" transform="translate(4.000000, 17.500000) rotate(90.000000) translate(-4.000000, -17.500000) " x="1.5" y="16.5" width="5" height="2" rx="1"></rect><rect id="Rectangle-2-Copy-3" transform="translate(20.000000, 17.500000) rotate(90.000000) translate(-20.000000, -17.500000) " x="17.5" y="16.5" width="5" height="2" rx="1"></rect>\n          <path d="M9.48791171,8.26502656 L9.48791171,14.2650266 C9.48791171,14.8173113 9.04019646,15.2650266 8.48791171,15.2650266 C7.93562696,15.2650266 7.48791171,14.8173113 7.48791171,14.2650266 L7.48791171,7.26502656 C7.48791171,6.71274181 7.93562696,6.26502656 8.48791171,6.26502656 L15.4879117,6.26502656 C16.0401965,6.26502656 16.4879117,6.71274181 16.4879117,7.26502656 C16.4879117,7.81731131 16.0401965,8.26502656 15.4879117,8.26502656 L9.48791171,8.26502656 Z" id="Combined-Shape" transform="translate(11.987912, 10.765027) scale(1, -1) rotate(45.000000) translate(-11.987912, -10.765027) "></path>\n        </g>\n      </g>\n    </g>\n  </g>\n</svg>\n'},function(e,t,r){var n=r(125);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};r(2)(n,i),n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(1)(!1)).push([e.i,".xgplayer-skin-default .xgplayer-download{position:relative;-webkit-order:9;-moz-box-ordinal-group:10;order:9;display:block;cursor:pointer}.xgplayer-skin-default .xgplayer-download .xgplayer-icon{margin-top:3px}.xgplayer-skin-default .xgplayer-download .xgplayer-icon div{position:absolute}.xgplayer-skin-default .xgplayer-download .xgplayer-icon svg{position:relative;top:5px;left:5px}.xgplayer-skin-default .xgplayer-download .xgplayer-tips{margin-left:-20px}.xgplayer-skin-default .xgplayer-download .xgplayer-tips .xgplayer-tip-download{display:block}.xgplayer-skin-default .xgplayer-download:hover{opacity:.85}.xgplayer-skin-default .xgplayer-download:hover .xgplayer-tips{display:block}.xgplayer-lang-is-en .xgplayer-download .xgplayer-tips{margin-left:-32px}.xgplayer-lang-is-jp .xgplayer-download .xgplayer-tips{margin-left:-40px}",""])},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o(r(0)),i=o(r(127)),a=o(r(129));function o(e){return e&&e.__esModule?e:{default:e}}r(130),t.default={name:"s_danmu",method:function(){var e=this,t=e.root,r=n.default.util;if(e.config.danmu){var o=r.createDom("xg-danmu","",{},"xgplayer-danmu");e.once("ready",(function(){t.appendChild(o)}));var s=r.deepCopy({container:o,player:e.video,comments:[],area:{start:0,end:1}},e.config.danmu),l=void 0;e.config.danmu.panel&&(l=n.default.util.createDom("xg-panel",'<xg-panel-icon class="xgplayer-panel-icon">\n                                                '+a.default+'\n                                              </xg-panel-icon>\n                                              <xg-panel-slider class="xgplayer-panel-slider">\n                                                <xg-hidemode class="xgplayer-hidemode">\n                                                  <p class="xgplayer-hidemode-font">屏蔽类型</p>\n                                                  <ul class="xgplayer-hidemode-radio">\n                                                    <li class="xgplayer-hidemode-scroll" id="false">滚动</li><li class="xgplayer-hidemode-top" id="false">顶部</li><li class="xgplayer-hidemode-bottom" id="false">底部</li><li class="xgplayer-hidemode-color" id="false">色彩</li>\n                                                  </ul>\n                                                </xg-hidemode>\n                                                <xg-transparency class="xgplayer-transparency">\n                                                  <span>不透明度</span>\n                                                  <input class="xgplayer-transparency-line xgplayer-transparency-color xgplayer-transparency-bar xgplayer-transparency-gradient" type="range" min="0" max="100" step="0.1" value="50"></input>\n                                                </xg-transparency>\n                                                <xg-showarea class="xgplayer-showarea">\n                                                  <div class="xgplayer-showarea-name">显示区域</div>\n                                                  <div class="xgplayer-showarea-control">\n                                                    <div class="xgplayer-showarea-control-up">\n                                                      <span class="xgplayer-showarea-control-up-item xgplayer-showarea-onequarters">1/4</span>\n                                                      <span class="xgplayer-showarea-control-up-item xgplayer-showarea-twoquarters selected-color">1/2</span>\n                                                      <span class="xgplayer-showarea-control-up-item xgplayer-showarea-threequarters">3/4</span>\n                                                      <span class="xgplayer-showarea-control-up-item xgplayer-showarea-full">1</span>\n                                                    </div>\n                                                    <div class="xgplayer-showarea-control-down">\n                                                      <div class="xgplayer-showarea-control-down-dots">\n                                                        <span class="xgplayer-showarea-onequarters-dot"></span>\n                                                        <span class="xgplayer-showarea-twoquarters-dot"></span>\n                                                        <span class="xgplayer-showarea-threequarters-dot"></span>\n                                                        <span class="xgplayer-showarea-full-dot"></span>\n                                                      </div>\n                                                      <input class="xgplayer-showarea-line xgplayer-showarea-color xgplayer-showarea-bar xgplayer-gradient" type="range" min="1" max="4" step="1" value="1">\n                                                    </div>\n                                                  </div>\n                                                </xg-showarea>\n                                                <xg-danmuspeed class="xgplayer-danmuspeed">\n                                                  <div class="xgplayer-danmuspeed-name">弹幕速度</div>\n                                                  <div class="xgplayer-danmuspeed-control">\n                                                    <div class="xgplayer-danmuspeed-control-up">\n                                                      <span class="xgplayer-danmuspeed-control-up-item xgplayer-danmuspeed-small">慢</span>\n                                                      <span class="xgplayer-danmuspeed-control-up-item xgplayer-danmuspeed-middle selected-color">中</span>\n                                                      <span class="xgplayer-danmuspeed-control-up-item xgplayer-danmuspeed-large">快</span>\n                                                    </div>\n                                                    <div class="xgplayer-danmuspeed-control-down">\n                                                      <div class="xgplayer-danmuspeed-control-down-dots">\n                                                        <span class="xgplayer-danmuspeed-small-dot"></span>\n                                                        <span class="xgplayer-danmuspeed-middle-dot"></span>\n                                                        <span class="xgplayer-danmuspeed-large-dot"></span>\n                                                      </div>\n                                                      <input class="xgplayer-danmuspeed-line xgplayer-danmuspeed-color xgplayer-danmuspeed-bar xgplayer-gradient" type="range" min="50" max="150" step="50" value="100">\n                                                    </div>\n                                                  </div>\n                                                </xg-danmuspeed>\n                                                <xg-danmufont class="xgplayer-danmufont">\n                                                  <div class="xgplayer-danmufont-name">字体大小</div>\n                                                  <div class="xgplayer-danmufont-control">\n                                                    <div class="xgplayer-danmufont-control-up">\n                                                      <span class="xgplayer-danmufont-control-up-item xgplayer-danmufont-small">小</span>\n                                                      <span class="xgplayer-danmufont-control-up-item xgplayer-danmufont-middle">中</span>\n                                                      <span class="xgplayer-danmufont-control-up-item xgplayer-danmufont-large selected-color">大</span>\n                                                    </div>\n                                                    <div class="xgplayer-danmufont-control-down">\n                                                      <div class="xgplayer-danmufont-control-down-dots">\n                                                        <span class="xgplayer-danmufont-small-dot"></span>\n                                                        <span class="xgplayer-danmufont-middle-dot"></span>\n                                                        <span class="xgplayer-danmufont-large-dot"></span>\n                                                      </div>\n                                                      <input class="xgplayer-danmufont-line xgplayer-danmufont-color xgplayer-danmufont-bar xgplayer-gradient" type="range" min="20" max="30" step="5" value="25">\n                                                    </div>\n                                                  </div>\n                                                </xg-danmufont>\n                                              </xg-panel-slider>',{tabindex:7},"xgplayer-panel"),e.once("ready",(function(){e.controls.appendChild(l)}))),e.once("complete",(function(){var t=new i.default(s);if(e.emit("initDefaultDanmu",t),e.danmu=t,e.config.danmu.panel){var r=l.querySelector(".xgplayer-panel-slider"),a=void 0;["mouseenter","touchend","click"].forEach((function(e){l.addEventListener(e,(function(e){e.preventDefault(),e.stopPropagation(),n.default.util.addClass(r,"xgplayer-panel-active"),l.focus(),a=!0}))})),l.addEventListener("mouseleave",(function(e){e.preventDefault(),e.stopPropagation(),n.default.util.removeClass(r,"xgplayer-panel-active"),a=!1})),r.addEventListener("mouseleave",(function(e){e.preventDefault(),e.stopPropagation(),!1===a&&n.default.util.removeClass(r,"xgplayer-panel-active")}));var o=e.config.danmu,u={scroll:l.querySelector(".xgplayer-hidemode-scroll"),top:l.querySelector(".xgplayer-hidemode-top"),bottom:l.querySelector(".xgplayer-hidemode-bottom"),color:l.querySelector(".xgplayer-hidemode-color")},c=function(t){var r=t;["touchend","click"].forEach((function(t){u[r].addEventListener(t,(function(t){"true"!==u[r].getAttribute("id")?(u[r].style.color="#f85959",u[r].setAttribute("id","true"),e.danmu.hide(r)):(u[r].style.color="#aaa",u[r].setAttribute("id","false"),e.danmu.show(r))}))}))};for(var d in u)c(d);var f=l.querySelector(".xgplayer-transparency-line"),p=l.querySelector(".xgplayer-transparency-gradient"),h=50;if(p.style.background="linear-gradient(to right, #f85959 0%, #f85959 "+h+"%, #aaa "+h+"%, #aaa)",f.addEventListener("input",(function(e){e.preventDefault(),e.stopPropagation(),h=e.target.value,p.style.background="linear-gradient(to right, #f85959 0%, #f85959 "+h+"%, #aaa "+h+"%, #aaa)",o.comments.forEach((function(e){e.style.opacity=h/100}))})),l.querySelector(".xgplayer-showarea-line").addEventListener("input",(function(t){t.preventDefault(),t.stopPropagation();var r=t.target.value;e.danmu.config.area.end=r/100,e.config.danmu.area.end=r/100,e.danmu.bulletBtn.main.channel.resize()})),l.querySelector(".xgplayer-danmuspeed-line").addEventListener("input",(function(e){e.preventDefault(),e.stopPropagation();var t=e.target.value;o.comments.forEach((function(e){e.duration=100*(200-t)}))})),l.querySelector(".xgplayer-danmufont-line").addEventListener("input",(function(e){e.preventDefault(),e.stopPropagation();var t=e.target.value;o.comments.forEach((function(e){e.style.fontSize=t+"px"}))})),navigator.userAgent.indexOf("Firefox")>-1)for(var g=0;g<r.querySelectorAll("input").length;g++)r.querySelectorAll("input")[g].style.marginTop="10px"}}))}}},e.exports=t.default},function(e,t,r){"use strict";(function(e){var r,n,i,a,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};window,a=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==(void 0===e?"undefined":o(e))&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}([function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n,i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=(n=r(26))&&n.__esModule?n:{default:n},o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return i(e,[{key:"setLogger",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.logger=new a.default(e+".js")}}]),e}();t.default=o,e.exports=t.default},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n={createDom:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=document.createElement(e);return i.className=n,i.innerHTML=t,Object.keys(r).forEach((function(t){var n=t,a=r[t];"video"===e||"audio"===e?a&&i.setAttribute(n,a):i.setAttribute(n,a)})),i},hasClass:function(e,t){return e.classList?Array.prototype.some.call(e.classList,(function(e){return e===t})):!!e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))},addClass:function(e,t){e.classList?t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)})):n.hasClass(e,t)||(e.className+=" "+t)},removeClass:function(e,t){e.classList?t.split(/\s+/g).forEach((function(t){e.classList.remove(t)})):n.hasClass(e,t)&&t.split(/\s+/g).forEach((function(t){var r=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(r," ")}))},toggleClass:function(e,t){t.split(/\s+/g).forEach((function(t){n.hasClass(e,t)?n.removeClass(e,t):n.addClass(e,t)}))},findDom:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=arguments[1],r=void 0;try{r=e.querySelector(t)}catch(n){t.startsWith("#")&&(r=e.getElementById(t.slice(1)))}return r},deepCopy:function(e,t){if("Object"===n.typeOf(t)&&"Object"===n.typeOf(e))return Object.keys(t).forEach((function(r){"Object"!==n.typeOf(t[r])||t[r]instanceof Node?"Array"===n.typeOf(t[r])?e[r]="Array"===n.typeOf(e[r])?e[r].concat(t[r]):t[r]:e[r]=t[r]:e[r]?n.deepCopy(e[r],t[r]):e[r]=t[r]})),e},typeOf:function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]},copyDom:function(e){if(e&&1===e.nodeType){var t=document.createElement(e.tagName);return Array.prototype.forEach.call(e.attributes,(function(e){t.setAttribute(e.name,e.value)})),e.innerHTML&&(t.innerHTML=e.innerHTML),t}return""},formatTime:function(e){var t=Math.floor(e);return 1e3*t+(e-t)},offInDestroy:function(e,t,r,n){e.once(n,(function i(){e.off(t,r),e.off(n,i)}))},on:function(e,t,r,i){i?(e.on(t,r),n.offInDestroy(e,t,r,i)):e.on(t,(function n(i){r(i),e.off(t,n)}))}};t.default=n,e.exports=t.default},function(e,t,r){var n=r(19)();e.exports=function(e){return e!==n&&null!==e}},function(e,t,r){e.exports=function(e){return null!=e}},function(e,t,r){e.exports=r(5)},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n,i=(n=r(6))&&n.__esModule?n:{default:n};r(34),t.default=i.default,e.exports=t.default},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=f(r(7)),a=f(r(0)),s=f(r(27)),l=f(r(31)),u=f(r(1)),c=r(32),d=r(33);function f(e){return e&&e.__esModule?e:{default:e}}function p(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=(void 0===t?"undefined":o(t))&&"function"!=typeof t?e:t}var h=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=p(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));r.setLogger("danmu"),r.logger.info("danmu.js version: "+c.version);var n=r;if(n.config=u.default.deepCopy({overlap:!1,area:{start:0,end:1},live:!1,comments:[],direction:"r2l",needResizeObserver:!1},e),n.hideArr=[],n.domObj=new l.default,(0,i.default)(n),n.config.comments.forEach((function(e){e.duration=e.duration?e.duration:5e3,e.mode||(e.mode="scroll")})),!n.config.container||1!==n.config.container.nodeType)return n.emit("error","container id can't be empty"),p(r,!1);if(n.container=n.config.container,n.config.containerStyle){var a=n.config.containerStyle;Object.keys(a).forEach((function(e){n.container.style[e]=a[e]}))}return n.live=n.config.live,n.player=n.config.player,n.direction=n.config.direction,u.default.addClass(n.container,"danmu"),n.bulletBtn=new s.default(n),n.isReady=!0,n.emit("ready"),r.logger.info("ready"),r.addResizeObserver(),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":o(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"addResizeObserver",value:function(){var e=this;this.config.needResizeObserver&&(0,d.addObserver)(this.container,(function(){e.logger.info("needResizeObserver"),e.resize()}))}},{key:"start",value:function(){this.logger.info("start"),this.bulletBtn.main.start()}},{key:"pause",value:function(){this.logger.info("pause"),this.bulletBtn.main.pause()}},{key:"play",value:function(){this.logger.info("play"),this.bulletBtn.main.play()}},{key:"stop",value:function(){this.logger.info("stop"),this.bulletBtn.main.stop()}},{key:"destroy",value:function(){for(var e in(0,d.unObserver)(this.container),this.logger.info("destroy"),this.stop(),this.bulletBtn.destroy(),this.domObj.destroy(),this)delete this[e];this.emit("destroy")}},{key:"sendComment",value:function(e){this.logger.info("sendComment: "+(e.txt||"[DOM Element]")),e.duration||(e.duration=15e3),e&&e.id&&e.duration&&(e.el||e.txt)&&(e.duration=e.duration?e.duration:5e3,e.style&&(this.opacity&&this.opacity!==e.style.opacity&&(e.style.opacity=this.opacity),this.fontSize&&this.fontSize!==e.style.fontSize&&(e.style.fontSize=this.fontSize),this.like&&(e.like=e.like?e.like:this.like)),e.prior||e.realTime?(this.bulletBtn.main.data.unshift(e),e.realTime&&(this.bulletBtn.main.readData(),this.bulletBtn.main.dataHandle())):this.bulletBtn.main.data.push(e))}},{key:"setCommentID",value:function(e,t){var r=this;this.logger.info("setCommentID: oldID "+e+" newID "+t);var n=this.container.getBoundingClientRect();e&&t&&(this.bulletBtn.main.data.some((function(r){return r.id===e&&(r.id=t,!0)})),this.bulletBtn.main.queue.some((function(i){return i.id===e&&(i.id=t,i.pauseMove(n),"paused"!==r.bulletBtn.main.status&&i.startMove(n),!0)})))}},{key:"setCommentDuration",value:function(e,t){var r=this;this.logger.info("setCommentDuration: id "+e+" duration "+t);var n=this.container.getBoundingClientRect();e&&t&&(t=t||5e3,this.bulletBtn.main.data.some((function(r){return r.id===e&&(r.duration=t,!0)})),this.bulletBtn.main.queue.some((function(i){return i.id===e&&(i.duration=t,i.pauseMove(n),"paused"!==r.bulletBtn.main.status&&i.startMove(n),!0)})))}},{key:"setCommentLike",value:function(e,t){this.logger.info("setCommentLike: id "+e+" like "+t);var r=this.container.getBoundingClientRect();this.like=t,e&&t&&(this.bulletBtn.main.data.some((function(r){return r.id===e&&(r.like=t,!0)})),this.bulletBtn.main.queue.some((function(n){return n.id===e&&(n.pauseMove(r),n.setLikeDom(t.el,t.style),"paused"!==n.danmu.bulletBtn.main.status&&n.startMove(r),!0)})))}},{key:"restartComment",value:function(e){this.logger.info("restartComment: id "+e),this.mouseControl=!1;var t=this.container.getBoundingClientRect();e&&this.bulletBtn.main.queue.some((function(r){return r.id===e&&("paused"!==r.danmu.bulletBtn.main.status?r.startMove(t,!0):r.status="paused",!0)}))}},{key:"freezeComment",value:function(e){this.logger.info("freezeComment: id "+e),this.mouseControl=!0;var t=this.container.getBoundingClientRect();e&&this.bulletBtn.main.queue.some((function(r){return r.id===e&&(r.status="forcedPause",r.pauseMove(t),r.el&&r.el.style&&(r.el.style.zIndex=10),!0)}))}},{key:"removeComment",value:function(e){this.logger.info("removeComment: id "+e),e&&(this.bulletBtn.main.queue.some((function(t){return t.id===e&&(t.remove(),!0)})),this.bulletBtn.main.data=this.bulletBtn.main.data.filter((function(t){return t.id!==e})))}},{key:"setAllDuration",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scroll",t=arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.logger.info("setAllDuration: mode "+e+" duration "+t+" force "+r);var n=this.container.getBoundingClientRect();t&&(t=t||5e3,r&&(this.bulletBtn.main.forceDuration=t),this.bulletBtn.main.data.forEach((function(r){e===r.mode&&(r.duration=t)})),this.bulletBtn.main.queue.forEach((function(r){e===r.mode&&(r.duration=t,r.pauseMove(n),"paused"!==r.danmu.bulletBtn.main.status&&r.startMove(n))})))}},{key:"setOpacity",value:function(e){this.logger.info("setOpacity: opacity "+e),this.container.style.opacity=e}},{key:"setFontSize",value:function(e,t){var r=this;this.logger.info("setFontSize: size "+e+" channelSize "+t),this.fontSize=e+"px",e&&(this.bulletBtn.main.data.forEach((function(e){e.style&&(e.style.fontSize=r.fontSize)})),this.bulletBtn.main.queue.forEach((function(e){e.options.style||(e.options.style={}),e.options.style.fontSize=r.fontSize,e.setFontSize(r.fontSize),t&&(e.top=e.channel_id[0]*t,e.topInit())}))),t&&(this.config.channelSize=t,this.bulletBtn.main.channel.resize(!0))}},{key:"setArea",value:function(e){this.logger.info("setArea: area "+e),this.config.area=e,this.bulletBtn.main.channel.resize(!0)}},{key:"hide",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scroll";this.logger.info("hide: mode "+e),this.hideArr.indexOf(e)<0&&this.hideArr.push(e);var t=this.bulletBtn.main.queue.filter((function(t){return e===t.mode||"color"===e&&t.color}));t.forEach((function(e){return e.remove()}))}},{key:"show",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scroll";this.logger.info("show: mode "+e);var t=this.hideArr.indexOf(e);t>-1&&this.hideArr.splice(t,1)}},{key:"setDirection",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"r2l";this.logger.info("setDirection: direction "+e),this.emit("changeDirection",e)}},{key:"resize",value:function(){this.logger.info("resize"),this.emit("channel_resize")}}]),t}(a.default);t.default=h,e.exports=t.default},function(e,t,r){var n,i,a,s,l,u,c,d=r(8),f=r(25),p=Function.prototype.apply,h=Function.prototype.call,g=Object.create,y=Object.defineProperty,v=Object.defineProperties,m=Object.prototype.hasOwnProperty,x={configurable:!0,enumerable:!1,writable:!0};i=function(e,t){var r,i;return f(t),i=this,n.call(this,e,r=function(){a.call(i,e,r),p.call(t,this,arguments)}),r.__eeOnceListener__=t,this},l={on:n=function(e,t){var r;return f(t),m.call(this,"__ee__")?r=this.__ee__:(r=x.value=g(null),y(this,"__ee__",x),x.value=null),r[e]?"object"==o(r[e])?r[e].push(t):r[e]=[r[e],t]:r[e]=t,this},once:i,off:a=function(e,t){var r,n,i,a;if(f(t),!m.call(this,"__ee__"))return this;if(!(r=this.__ee__)[e])return this;if("object"==o(n=r[e]))for(a=0;i=n[a];++a)i!==t&&i.__eeOnceListener__!==t||(2===n.length?r[e]=n[a?0:1]:n.splice(a,1));else n!==t&&n.__eeOnceListener__!==t||delete r[e];return this},emit:s=function(e){var t,r,n,i,a;if(m.call(this,"__ee__")&&(i=this.__ee__[e]))if("object"==(void 0===i?"undefined":o(i))){for(r=arguments.length,a=new Array(r-1),t=1;t<r;++t)a[t-1]=arguments[t];for(i=i.slice(),t=0;n=i[t];++t)p.call(n,this,a)}else switch(arguments.length){case 1:h.call(i,this);break;case 2:h.call(i,this,arguments[1]);break;case 3:h.call(i,this,arguments[1],arguments[2]);break;default:for(r=arguments.length,a=new Array(r-1),t=1;t<r;++t)a[t-1]=arguments[t];p.call(i,this,a)}}},u={on:d(n),once:d(i),off:d(a),emit:d(s)},c=v({},u),e.exports=t=function(e){return null==e?g(c):v(Object(e),u)},t.methods=l},function(e,t,r){var n=r(3),i=r(9),a=r(13),o=r(21),s=r(22);(e.exports=function(e,t){var r,i,l,u,c;return arguments.length<2||"string"!=typeof e?(u=t,t=e,e=null):u=arguments[2],n(e)?(r=s.call(e,"c"),i=s.call(e,"e"),l=s.call(e,"w")):(r=l=!0,i=!1),c={value:t,configurable:r,enumerable:i,writable:l},u?a(o(u),c):c}).gs=function(e,t,r){var l,u,c,d;return"string"!=typeof e?(c=r,r=t,t=e,e=null):c=arguments[3],n(t)?i(t)?n(r)?i(r)||(c=r,r=void 0):r=void 0:(c=t,t=r=void 0):t=void 0,n(e)?(l=s.call(e,"c"),u=s.call(e,"e")):(l=!0,u=!1),d={get:t,set:r,configurable:l,enumerable:u},c?a(o(c),d):d}},function(e,t,r){var n=r(10),i=/^\s*class[\s{/}]/,a=Function.prototype.toString;e.exports=function(e){return!!n(e)&&!i.test(a.call(e))}},function(e,t,r){var n=r(11);e.exports=function(e){if("function"!=typeof e)return!1;if(!hasOwnProperty.call(e,"length"))return!1;try{if("number"!=typeof e.length)return!1;if("function"!=typeof e.call)return!1;if("function"!=typeof e.apply)return!1}catch(e){return!1}return!n(e)}},function(e,t,r){var n=r(12);e.exports=function(e){if(!n(e))return!1;try{return!!e.constructor&&e.constructor.prototype===e}catch(e){return!1}}},function(e,t,r){var n=r(3),i={object:!0,function:!0,undefined:!0};e.exports=function(e){return!!n(e)&&hasOwnProperty.call(i,void 0===e?"undefined":o(e))}},function(e,t,r){e.exports=r(14)()?Object.assign:r(15)},function(e,t,r){e.exports=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},function(e,t,r){var n=r(16),i=r(20),a=Math.max;e.exports=function(e,t){var r,o,s,l=a(arguments.length,2);for(e=Object(i(e)),s=function(n){try{e[n]=t[n]}catch(e){r||(r=e)}},o=1;o<l;++o)n(t=arguments[o]).forEach(s);if(void 0!==r)throw r;return e}},function(e,t,r){e.exports=r(17)()?Object.keys:r(18)},function(e,t,r){e.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}},function(e,t,r){var n=r(2),i=Object.keys;e.exports=function(e){return i(n(e)?Object(e):e)}},function(e,t,r){e.exports=function(){}},function(e,t,r){var n=r(2);e.exports=function(e){if(!n(e))throw new TypeError("Cannot use null or undefined");return e}},function(e,t,r){var n=r(2),i=Array.prototype.forEach,a=Object.create,o=function(e,t){var r;for(r in e)t[r]=e[r]};e.exports=function(e){var t=a(null);return i.call(arguments,(function(e){n(e)&&o(Object(e),t)})),t}},function(e,t,r){e.exports=r(23)()?String.prototype.contains:r(24)},function(e,t,r){var n="razdwatrzy";e.exports=function(){return"function"==typeof n.contains&&!0===n.contains("dwa")&&!1===n.contains("foo")}},function(e,t,r){var n=String.prototype.indexOf;e.exports=function(e){return n.call(this,e,arguments[1])>-1}},function(e,t,r){e.exports=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=window.location.href.indexOf("danmu-debug")>-1,a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.constructorName=t||""}return n(e,[{key:"info",value:function(e){for(var t,r=arguments.length,n=Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];i&&(t=console).log.apply(t,["[Danmu Log]["+this.constructorName+"]",e].concat(n))}}]),e}();t.default=a,e.exports=t.default},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=l(r(0)),a=l(r(1)),s=l(r(28));function l(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=(void 0===t?"undefined":o(t))&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.setLogger("control"),r.danmu=e,r.main=new s.default(e),e.config.defaultOff||r.main.start(),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":o(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"createSwitch",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.logger.info("createSwitch"),this.switchBtn=a.default.createDom("dk-switch",'<span class="txt">弹</span>',{},"danmu-switch "+(e?"danmu-switch-active":"")),this.switchBtn}},{key:"destroy",value:function(){for(var e in this.logger.info("destroy"),this.main.destroy(),this)delete this[e]}}]),t}(i.default);t.default=u,e.exports=t.default},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=u(r(0)),a=u(r(29)),s=u(r(30)),l=u(r(1));function u(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=(void 0===t?"undefined":o(t))&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));r.setLogger("main"),r.danmu=e,r.container=e.container,r.channel=new a.default(e),r.data=[].concat(e.config.comments),r.playedData=[],r.queue=[],r.timer=null,r.retryTimer=null,r.retryStatus="normal",r.interval=e.config.interval||2e3,r.status="idle",l.default.on(e,"bullet_remove",r.updateQueue.bind(r),"destroy");var n=r;return l.default.on(r.danmu,"changeDirection",(function(e){n.danmu.direction=e}),"destroy"),r.nums=0,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":o(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"destroy",value:function(){for(var e in this.logger.info("destroy"),clearTimeout(this.dataHandleTimer),this.channel.destroy(),this.data=[],this)delete this[e]}},{key:"updateQueue",value:function(e){this.logger.info("updateQueue");var t=this;t.queue.some((function(r,n){return r.id===e.bullet.id&&(t.queue.splice(n,1),!0)})),t.data.some((function(t,r){return t.id===e.bullet.id&&(t.hasAttached=!1,!0)}))}},{key:"init",value:function(e,t){t.logger.info("init"),t||(t=this),t.retryStatus="normal",t.data.sort((function(e,t){return e.start-t.start})),t.retryTimer||function e(){"closed"===t.status&&"stop"===t.retryStatus||("playing"===t.status&&(t.readData(),t.dataHandle()),"stop"===t.retryStatus&&"paused"!==t.status||(t.dataHandleTimer=setTimeout((function(){e()}),t.interval-1e3)))}()}},{key:"start",value:function(){this.logger.info("start"),this.status="playing",this.queue=[],this.container.innerHTML="",this.channel.resetWithCb(this.init,this)}},{key:"stop",value:function(){this.logger.info("stop"),this.status="closed",this.retryTimer=null,this.retryStatus="stop",this.channel.reset(),this.queue=[],this.container.innerHTML=""}},{key:"play",value:function(){var e=this;this.logger.info("play"),this.status="playing";var t=this.channel.channels,r=this.danmu.container.getBoundingClientRect();t&&t.length>0&&["scroll","top","bottom"].forEach((function(n){e.queue.forEach((function(e){e.startMove(r),e.resized=!0}));for(var i=0;i<t.length;i++)t[i].queue[n].forEach((function(e){e.resized=!1}))}))}},{key:"pause",value:function(){this.logger.info("pause"),this.status="paused";var e=this.channel.channels,t=this.danmu.container.getBoundingClientRect();e&&e.length>0&&this.queue.forEach((function(e){e.pauseMove(t)}))}},{key:"dataHandle",value:function(){var e=this;"paused"!==this.status&&"closed"!==this.status&&e.queue.length&&e.queue.forEach((function(t){"waiting"===t.status&&t.startMove(e.channel.containerPos)}))}},{key:"readData",value:function(){var e=this,t=this.danmu;if(t.isReady){var r=0;t.player&&t.player.currentTime&&(r=l.default.formatTime(t.player.currentTime));var n=void 0,i=e.interval,a=e.channel,o=void 0;t.player?(o=e.data.filter((function(t){return!t.start&&e.danmu.hideArr.indexOf(t.mode)<0&&(!t.color||e.danmu.hideArr.indexOf("color")<0)&&(t.start=r),e.danmu.hideArr.indexOf(t.mode)<0&&(!t.color||e.danmu.hideArr.indexOf("color")<0)&&t.start-i<=r&&r<=t.start+i})),t.live&&(e.data=e.data.filter((function(e){return e.start||(e.start=r),e.start>r-3*i})))):0===(o=e.data.splice(0,1)).length&&(o=e.playedData.splice(0,1)),o.length>0&&o.forEach((function(r){e.forceDuration&&e.forceDuration!=r.duration&&(r.duration=e.forceDuration),n=new s.default(t,r),r.hasAttached||(n.attach(),r.hasAttached=!0,a.addBullet(n).result?(e.queue.push(n),e.nums++,n.topInit()):(n.detach(),n=null,r.hasAttached=!1,r.noDiscard&&(r.prior?e.data.unshift(r):e.data.push(r))))}))}}}]),t}(i.default);t.default=c,e.exports=t.default},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=s(r(0)),a=s(r(1));function s(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=(void 0===t?"undefined":o(t))&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));r.setLogger("channel"),r.danmu=e,r.reset(!0);var n=r;return a.default.on(r.danmu,"bullet_remove",(function(e){n.removeBullet(e.bullet)}),"destroy"),r.direction=e.direction,a.default.on(r.danmu,"changeDirection",(function(e){n.direction=e}),"destroy"),r.containerPos=r.danmu.container.getBoundingClientRect(),r.containerWidth=r.containerPos.width,r.containerHeight=r.containerPos.height,r.containerLeft=r.containerPos.left,r.containerRight=r.containerPos.right,a.default.on(r.danmu,"channel_resize",(function(){n.containerPos=n.danmu.container.getBoundingClientRect(),n.resizing||(n.containerWidth=n.containerPos.width,n.containerHeight=n.containerPos.height,n.containerLeft=n.containerPos.left,n.containerRight=n.containerPos.right,n.resize(!0))}),"destroy"),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":o(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"destroy",value:function(){for(var e in this.logger.info("destroy"),clearTimeout(this.resizeTimer),this.channels=[],this)delete this[e]}},{key:"resize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.logger.info("resize");var t=this.danmu.container,r=this;r.resizing||(r.resizing=!0,this.resizeTimer=setTimeout((function(){r.danmu.bulletBtn.main.data&&r.danmu.bulletBtn.main.data.forEach((function(e){e.bookChannelId&&(delete e.bookChannelId,r.logger.info("resize导致"+e.id+"号优先弹幕预定取消"))})),r.logger.info("resize导致所有轨道恢复正常使用");var n=t.getBoundingClientRect();r.width=n.width,r.height=n.height,r.danmu.config.area&&r.danmu.config.area.start>=0&&r.danmu.config.area.end>=r.danmu.config.area.start&&("b2t"===r.direction?r.width=r.width*(r.danmu.config.area.end-r.danmu.config.area.start):r.height=r.height*(r.danmu.config.area.end-r.danmu.config.area.start)),r.container=t;var i,a=r.danmu.config.channelSize||(/mobile/gi.test(navigator.userAgent)?10:12);i="b2t"===r.direction?Math.floor(r.width/a):Math.floor(r.height/a);for(var o=[],s=0;s<i;s++)o[s]={id:s,queue:{scroll:[],top:[],bottom:[]},operating:{scroll:!1,top:!1,bottom:!1},bookId:{}};if(r.channels&&r.channels.length<=o.length){for(var l=function(t){o[t]={id:t,queue:{scroll:[],top:[],bottom:[]},operating:{scroll:!1,top:!1,bottom:!1},bookId:{}},["scroll","top"].forEach((function(n){r.channels[t].queue[n].forEach((function(i){i.el&&(o[t].queue[n].push(i),i.resized||(i.pauseMove(r.containerPos,e),"paused"!==i.danmu.bulletBtn.main.status&&i.startMove(r.containerPos),i.resized=!0))}))})),r.channels[t].queue.bottom.forEach((function(n){if(n.el){if(o[t+o.length-r.channels.length].queue.bottom.push(n),n.channel_id[0]+n.channel_id[1]-1===t){var i=[].concat(n.channel_id);n.channel_id=[i[0]-r.channels.length+o.length,i[1]],n.top=n.channel_id[0]*a,r.danmu.config.area&&r.danmu.config.area.start&&(n.top+=r.containerHeight*r.danmu.config.area.start),n.topInit()}n.resized||(n.pauseMove(r.containerPos,e),"paused"!==n.danmu.bulletBtn.main.status&&n.startMove(r.containerPos),n.resized=!0)}}))},u=0;u<r.channels.length;u++)l(u);for(var c=function(e){["scroll","top","bottom"].forEach((function(t){o[e].queue[t].forEach((function(e){e.resized=!1}))}))},d=0;d<o.length;d++)c(d);r.channels=o,"b2t"===r.direction?r.channelWidth=a:r.channelHeight=a}else if(r.channels&&r.channels.length>o.length){for(var f=function(t){o[t]={id:t,queue:{scroll:[],top:[],bottom:[]},operating:{scroll:!1,top:!1,bottom:!1},bookId:{}},["scroll","top","bottom"].forEach((function(n){if("top"===n&&t>Math.floor(o.length/2));else if("bottom"===n&&t<=Math.floor(o.length/2));else{var i="bottom"===n?t-o.length+r.channels.length:t;r.channels[i].queue[n].forEach((function(s,l){if(s.el){if(o[t].queue[n].push(s),"bottom"===n&&s.channel_id[0]+s.channel_id[1]-1===i){var u=[].concat(s.channel_id);s.channel_id=[u[0]-r.channels.length+o.length,u[1]],s.top=s.channel_id[0]*a,r.danmu.config.area&&r.danmu.config.area.start&&(s.top+=r.containerHeight*r.danmu.config.area.start),s.topInit()}s.pauseMove(r.containerPos,e),"paused"!==s.danmu.bulletBtn.main.status&&s.startMove(r.containerPos),s.resized||(s.resized=!0)}r.channels[i].queue[n].splice(l,1)}))}}))},p=0;p<o.length;p++)f(p);for(var h=function(e){["scroll","top","bottom"].forEach((function(t){o[e].queue[t].forEach((function(e){e.resized=!1}))}))},g=0;g<o.length;g++)h(g);r.channels=o,"b2t"===r.direction?r.channelWidth=a:r.channelHeight=a}r.resizing=!1}),10))}},{key:"addBullet",value:function(e){var t=this,r=this.danmu,n=this.channels,i=void 0,a=void 0,o=void 0;if("b2t"===t.direction?(a=this.channelWidth,o=Math.ceil(e.width/a)):(i=this.channelHeight,o=Math.ceil(e.height/i)),o>n.length)return{result:!1,message:"exceed channels.length, occupy="+o+",channelsSize="+n.length};for(var s=!0,l=void 0,u=-1,c=0,d=n.length;c<d;c++)if(n[c].queue[e.mode].some((function(t){return t.id===e.id})))return{result:!1,message:"exsited, channelOrder="+c+",danmu_id="+e.id};if("scroll"===e.mode)for(var f=0,p=n.length-o;f<=p;f++){s=!0;for(var h=f;h<f+o;h++){if((l=n[h]).operating.scroll){s=!1;break}if((l.bookId.scroll||e.prior)&&l.bookId.scroll!==e.id){s=!1;break}l.operating.scroll=!0;var g=l.queue.scroll[0];if(g){var y=g.el.getBoundingClientRect();if("b2t"===t.direction){if(y.bottom>t.containerPos.bottom){s=!1,l.operating.scroll=!1;break}}else if(y.right>t.containerPos.right){s=!1,l.operating.scroll=!1;break}var v,m=void 0,x=void 0,b=void 0,k=void 0;if("b2t"===t.direction?(x=(y.top-t.containerPos.top+y.height)/(m=(t.containerPos.height+y.height)/g.duration),b=t.containerPos.height,k=(t.containerPos.height+e.height)/e.duration):(x=(y.left-t.containerPos.left+y.width)/(m=(t.containerPos.width+y.width)/g.duration),b=t.containerPos.width,k=(t.containerPos.width+e.width)/e.duration),v=b/k,r.config.bOffset||(r.config.bOffset=0),m<k&&x+r.config.bOffset>v){s=!1,l.operating.scroll=!1;break}}l.operating.scroll=!1}if(s){u=f;break}}else if("top"===e.mode)for(var _=0,w=n.length-o;_<=w;_++){s=!0;for(var E=_;E<_+o;E++){if(E>Math.floor(n.length/2)){s=!1;break}if((l=n[E]).operating[e.mode]){s=!1;break}if((l.bookId[e.mode]||e.prior)&&l.bookId[e.mode]!==e.id){s=!1;break}if(l.operating[e.mode]=!0,l.queue[e.mode].length>0){s=!1,l.operating[e.mode]=!1;break}l.operating[e.mode]=!1}if(s){u=_;break}}else if("bottom"===e.mode)for(var T=n.length-o;T>=0;T--){s=!0;for(var S=T;S<T+o;S++){if(S<=Math.floor(n.length/2)){s=!1;break}if((l=n[S]).operating[e.mode]){s=!1;break}if((l.bookId[e.mode]||e.prior)&&l.bookId[e.mode]!==e.id){s=!1;break}if(l.operating[e.mode]=!0,l.queue[e.mode].length>0){s=!1,l.operating[e.mode]=!1;break}l.operating[e.mode]=!1}if(s){u=T;break}}if(-1!==u){for(var O=u,R=u+o;O<R;O++)(l=n[O]).operating[e.mode]=!0,l.queue[e.mode].unshift(e),e.prior&&(delete l.bookId[e.mode],t.logger.info(O+"号轨道恢复正常使用")),l.operating[e.mode]=!1;return e.prior&&(t.logger.info(e.id+"号优先弹幕运行完毕"),delete e.bookChannelId,r.player&&r.bulletBtn.main.data.some((function(t){return t.id===e.id&&(delete t.bookChannelId,!0)}))),e.channel_id=[u,o],"b2t"===t.direction?(e.top=u*a,t.danmu.config.area&&t.danmu.config.area.start&&(e.top+=t.containerWidth*t.danmu.config.area.start)):(e.top=u*i,t.danmu.config.area&&t.danmu.config.area.start&&(e.top+=t.containerHeight*t.danmu.config.area.start)),{result:e,message:"success"}}if(e.options.realTime){var A=0,P=-1,L=null;if(t.danmu.bulletBtn.main.queue.forEach((function(e,r){!e.prior&&!e.options.realTime&&e.el&&e.el.getBoundingClientRect().left>t.containerPos.right&&e.start>=A&&(A=e.start,P=r,L=e)})),L){L.remove(),t.removeBullet(L),t.danmu.bulletBtn.main.queue.splice(P,1),e.channel_id=L.channel_id;for(var C=L.channel_id[0],D=L.channel_id[0]+L.channel_id[1];C<D;C++)(l=n[C]).operating[e.mode]=!0,l.queue[e.mode].unshift(e),e.prior&&delete l.bookId[e.mode],l.operating[e.mode]=!1;return e.top=L.top,t.danmu.config.area&&t.danmu.config.area.start&&(e.top+=t.containerHeight*t.danmu.config.area.start),{result:e,message:"success"}}}if(e.prior)if(e.bookChannelId)r.player&&r.bulletBtn.main.data.some((function(r){return r.id===e.id&&(t.logger.info(e.id+"号优先弹幕将于2秒后再次请求注册"),r.start+=2e3,!0)}));else{u=-1;for(var I=0,M=n.length-o;I<=M;I++){s=!0;for(var F=I;F<I+o;F++)if(n[F].bookId[e.mode]){s=!1;break}if(s){u=I;break}}if(-1!==u){for(var N=u;N<u+o;N++)n[N].bookId[e.mode]=e.id,t.logger.info(N+"号轨道被"+e.id+"号优先弹幕预定");r.player&&r.bulletBtn.main.data.some((function(r){return r.id===e.id&&(t.logger.info(e.id+"号优先弹幕将于2秒后再次请求注册"),r.start+=2e3,r.bookChannelId=[u,o],t.logger.info(e.id+"号优先弹幕预定了"+u+"~"+(u+o-1)+"号轨道"),!0)}))}}return{result:!1,message:"no surplus will right"}}},{key:"removeBullet",value:function(e){this.logger.info("removeBullet "+(e.options.txt||"[DOM Element]"));for(var t=this.channels,r=e.channel_id,n=void 0,i=r[0],a=r[0]+r[1];i<a;i++)if(n=t[i]){n.operating[e.mode]=!0;var o=-1;n.queue[e.mode].some((function(t,r){return t.id===e.id&&(o=r,!0)})),o>-1&&n.queue[e.mode].splice(o,1),n.operating[e.mode]=!1}e.options.loop&&this.danmu.bulletBtn.main.playedData.push(e.options)}},{key:"resetArea",value:function(){this.logger.info("resetArea");var e=this.danmu.container,t=this,r=e.getBoundingClientRect();t.width=r.width,t.height=r.height,t.danmu.config.area&&t.danmu.config.area.start>=0&&t.danmu.config.area.end>=t.danmu.config.area.start&&("b2t"===t.direction?t.width=t.width*(t.danmu.config.area.end-t.danmu.config.area.start):t.height=t.height*(t.danmu.config.area.end-t.danmu.config.area.start)),t.container=e;var n,i=t.danmu.config.channelSize||(/mobile/gi.test(navigator.userAgent)?10:12);n="b2t"===t.direction?Math.floor(t.width/i):Math.floor(t.height/i);for(var a=[],o=0;o<n;o++)a[o]={id:o,queue:{scroll:[],top:[],bottom:[]},operating:{scroll:!1,top:!1,bottom:!1},bookId:{}};if(t.channels&&t.channels.length<=a.length){for(var s=function(e){a[e]={id:e,queue:{scroll:[],top:[],bottom:[]},operating:{scroll:!1,top:!1,bottom:!1},bookId:{}},["scroll","top"].forEach((function(r){t.channels[e].queue[r].forEach((function(n){n.el&&(a[e].queue[r].push(n),n.resized||(n.pauseMove(t.containerPos,!1),n.startMove(t.containerPos),n.resized=!0))}))})),t.channels[e].queue.bottom.forEach((function(r){if(r.el){if(a[e+a.length-t.channels.length].queue.bottom.push(r),r.channel_id[0]+r.channel_id[1]-1===e){var n=[].concat(r.channel_id);r.channel_id=[n[0]-t.channels.length+a.length,n[1]],r.top=r.channel_id[0]*i,t.danmu.config.area&&t.danmu.config.area.start&&(r.top+=t.containerHeight*t.danmu.config.area.start),r.topInit()}r.resized||(r.pauseMove(t.containerPos,!1),r.startMove(t.containerPos),r.resized=!0)}}))},l=0;l<t.channels.length;l++)s(l);for(var u=function(e){["scroll","top","bottom"].forEach((function(t){a[e].queue[t].forEach((function(e){e.resized=!1}))}))},c=0;c<a.length;c++)u(c);t.channels=a,"b2t"===t.direction?t.channelWidth=i:t.channelHeight=i}else if(t.channels&&t.channels.length>a.length){for(var d=function(e){a[e]={id:e,queue:{scroll:[],top:[],bottom:[]},operating:{scroll:!1,top:!1,bottom:!1},bookId:{}},["scroll","top","bottom"].forEach((function(r){if("top"===r&&e>Math.floor(a.length/2));else if("bottom"===r&&e<=Math.floor(a.length/2));else{var n="bottom"===r?e-a.length+t.channels.length:e;t.channels[n].queue[r].forEach((function(o,s){if(o.el){if(a[e].queue[r].push(o),"bottom"===r&&o.channel_id[0]+o.channel_id[1]-1===n){var l=[].concat(o.channel_id);o.channel_id=[l[0]-t.channels.length+a.length,l[1]],o.top=o.channel_id[0]*i,t.danmu.config.area&&t.danmu.config.area.start&&(o.top+=t.containerHeight*t.danmu.config.area.start),o.topInit()}o.resized||(o.pauseMove(t.containerPos,!1),o.startMove(t.containerPos),o.resized=!0)}t.channels[n].queue[r].splice(s,1)}))}}))},f=0;f<a.length;f++)d(f);for(var p=function(e){["scroll","top","bottom"].forEach((function(t){a[e].queue[t].forEach((function(e){e.resized=!1}))}))},h=0;h<a.length;h++)p(h);t.channels=a,"b2t"===t.direction?t.channelWidth=i:t.channelHeight=i}}},{key:"reset",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.logger.info("reset");var t=this.danmu.container,r=this;function n(){var e=t.getBoundingClientRect();r.width=e.width,r.height=e.height,r.danmu.config.area&&r.danmu.config.area.start>=0&&r.danmu.config.area.end>=r.danmu.config.area.start&&("b2t"===r.direction?r.width=r.width*(r.danmu.config.area.end-r.danmu.config.area.start):r.height=r.height*(r.danmu.config.area.end-r.danmu.config.area.start)),r.container=t;var n,i=r.danmu.config.channelSize||(/mobile/gi.test(navigator.userAgent)?10:12);n="b2t"===r.direction?Math.floor(r.width/i):Math.floor(r.height/i);for(var a=[],o=0;o<n;o++)a[o]={id:o,queue:{scroll:[],top:[],bottom:[]},operating:{scroll:!1,top:!1,bottom:!1},bookId:{}};r.channels=a,"b2t"===r.direction?r.channelWidth=i:r.channelHeight=i}r.danmu.bulletBtn&&r.danmu.bulletBtn.main&&r.danmu.bulletBtn.main.queue.forEach((function(e){e.pauseMove(r.containerPos),e.remove()})),r.channels&&r.channels.length>0&&["scroll","top","bottom"].forEach((function(e){for(var t=0;t<r.channels.length;t++)r.channels[t].queue[e].forEach((function(e){e.pauseMove(r.containerPos),e.remove()}))})),r.danmu.bulletBtn&&r.danmu.bulletBtn.main&&r.danmu.bulletBtn.main.data&&r.danmu.bulletBtn.main.data.forEach((function(e){e.hasAttached=!1})),e?this.resetTimer=setTimeout(n,200):n()}},{key:"resetWithCb",value:function(e,t){this.logger.info("resetWithCb");var r=this.danmu.container,n=this;n.channels&&n.channels.length>0&&["scroll","top","bottom"].forEach((function(e){for(var t=0;t<n.channels.length;t++)n.channels[t].queue[e].forEach((function(e){e.pauseMove(n.containerPos),e.remove()}))}));var i=r.getBoundingClientRect();n.width=i.width,n.height=i.height,n.danmu.config.area&&n.danmu.config.area.start>=0&&n.danmu.config.area.end>=n.danmu.config.area.start&&("b2t"===n.direction?n.width=n.width*(n.danmu.config.area.end-n.danmu.config.area.start):n.height=n.height*(n.danmu.config.area.end-n.danmu.config.area.start)),n.container=r;var a,o=n.danmu.config.channelSize||(/mobile/gi.test(navigator.userAgent)?10:12);a="b2t"===n.direction?Math.floor(n.width/o):Math.floor(n.height/o);for(var s=[],l=0;l<a;l++)s[l]={id:l,queue:{scroll:[],top:[],bottom:[]},operating:{scroll:!1,top:!1,bottom:!1},bookId:{}};n.channels=s,n.channelHeight=o,e&&e(!0,t)}}]),t}(i.default);t.default=l,e.exports=t.default},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=s(r(0)),a=s(r(1));function s(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(e,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=(void 0===t?"undefined":o(t))&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));n.setLogger("bullet"),n.danmu=e,n.options=r,n.duration=r.duration,n.moveV=r.moveV,n.id=r.id,n.container=e.container,n.start=r.start,n.prior=r.prior,n.color=r.color,n.bookChannelId=r.bookChannelId,n.direction=e.direction;var i=n;n.onChangeDirection=function(e){i.direction=e},n.danmu.on("changeDirection",n.onChangeDirection);var s=void 0;if(n.domObj=e.domObj,r.el&&1===r.el.nodeType){s=n.domObj.use();var l=a.default.copyDom(r.el);r.eventListeners&&r.eventListeners.length>0&&r.eventListeners.forEach((function(e){l.addEventListener(e.event,e.listener,e.useCapture||!1)})),s.appendChild(l)}else if((s=n.domObj.use()).textContent=r.txt,r.style){var u=r.style;Object.keys(u).forEach((function(e){s.style[e]=u[e]}))}"top"===r.mode||"bottom"===r.mode?n.mode=r.mode:n.mode="scroll",n.el=s,r.like&&r.like.el&&n.setLikeDom(r.like.el,r.like.style),n.status="waiting";var c=n.container.getBoundingClientRect(),d=Math.floor(Math.random()*(c.width/10>100?200:c.width/10));return r.realTime&&(d=0),n.el.style.left=c.width+d+"px",n.containerPos=c,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":o(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"attach",value:function(){if(this.container.appendChild(this.el),this.elPos=this.el.getBoundingClientRect(),"b2t"===this.direction?(this.width=this.elPos.height,this.height=this.elPos.width):(this.width=this.elPos.width,this.height=this.elPos.height),this.moveV){var e=this.containerPos;this.duration=(e.width+this.width)/this.moveV*1e3}this.danmu.config.mouseControl&&this.el.addEventListener("mouseover",this.mouseoverFun.bind(this))}},{key:"mouseoverFun",value:function(e){this.danmu.mouseControl&&this.danmu.config.mouseControlPause||"waiting"===this.status||"end"===this.status||this.danmu.emit("bullet_hover",{bullet:this,event:e})}},{key:"detach",value:function(){this.container&&this.el&&(this.el.parentNode&&this.el.parentNode.removeChild(this.el),this.domObj.unuse(this.el),this.el=null),this.danmu.off("changeDirection",this.onChangeDirection)}},{key:"topInit",value:function(){if(this.logger.info("topInit #"+(this.options.txt||"[DOM Element]")+"#"),"b2t"===this.direction){var e=this.containerPos;this.el.style.transformOrigin="left top",this.el.style.transform="translateX(-"+this.top+"px) translateY("+e.height+"px) translateZ(0px) rotate(90deg)",this.el.style.transition="transform 0s linear 0s"}else this.el.style.top=this.top+"px"}},{key:"pauseMove",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.logger.info("pauseMove #"+(this.options.txt||"[DOM Element]")+"#");var r=this;if("paused"!==this.status&&("forcedPause"!==r.status&&(this.status="paused"),clearTimeout(r.removeTimer),this.el))if(this.el.style.willChange="auto","scroll"===this.mode){if(t){var n=((new Date).getTime()-r.moveTime)/1e3,i=n*this.moveV,a=0;a=r.moveMoreS-i>=0?"b2t"===this.direction?(r.moveMoreS-i)/r.moveContainerHeight*e.height:(r.moveMoreS-i)/r.moveContainerWidth*e.width:r.moveMoreS-i,"b2t"===this.direction?this.el.style.transform="translateX(-"+this.top+"px) translateY("+a+"px) translateZ(0px) rotate(90deg)":this.el.style.left=a+"px"}else"b2t"===this.direction?this.el.style.transform="translateX(-"+this.top+"px) translateY("+(this.el.getBoundingClientRect().top-e.top)+"px) translateZ(0px) rotate(90deg)":this.el.style.left=this.el.getBoundingClientRect().left-e.left+"px";"b2t"===this.direction||(this.el.style.transform="translateX(0px) translateY(0px) translateZ(0px)"),this.el.style.transition="transform 0s linear 0s"}else this.pastDuration&&this.startTime?this.pastDuration=this.pastDuration+(new Date).getTime()-this.startTime:this.pastDuration=1}},{key:"startMove",value:function(e,t){this.logger.info("startMove #"+(this.options.txt||"[DOM Element]")+"#");var r=this;if(r.hasMove||(r.danmu.emit("bullet_start",r),r.hasMove=!0),("forcedPause"!==r.status||t)&&this.el&&"start"!==this.status)if(this.status="start",this.el.style.willChange="transform","scroll"===this.mode)if("b2t"===this.direction){this.moveV=(e.height+this.height)/this.duration*1e3;var n=(r.el.getBoundingClientRect().bottom-e.top)/this.moveV;this.el.style.transition="transform "+n+"s linear 0s",this.startMoveTimer=setTimeout((function(){r.el&&(r.el.style.transform="translateX(-"+r.top+"px) translateY(-"+r.height+"px) translateZ(0px) rotate(90deg)",r.moveTime=(new Date).getTime(),r.moveMoreS=r.el.getBoundingClientRect().top-e.top,r.moveContainerHeight=e.height,r.removeTimer=setTimeout(o,1e3*n))}),20)}else{this.moveV=(e.width+this.width)/this.duration*1e3;var i=(r.el.getBoundingClientRect().right-e.left)/this.moveV;this.el.style.transition="transform "+i+"s linear 0s",this.startMoveTimer=setTimeout((function(){r.el&&(r.el.style.transform="translateX(-"+(r.el.getBoundingClientRect().right-e.left)+"px) translateY(0px) translateZ(0px)",r.moveTime=(new Date).getTime(),r.moveMoreS=r.el.getBoundingClientRect().left-e.left,r.moveContainerWidth=e.width,r.removeTimer=setTimeout(o,1e3*i))}),20)}else{this.el.style.left="50%",this.el.style.margin="0 0 0 -"+this.width/2+"px",this.pastDuration||(this.pastDuration=1);var a=this.duration>=this.pastDuration?this.duration-this.pastDuration:0;this.removeTimer=setTimeout(o,a),this.startTime=(new Date).getTime()}function o(){if(r.el)if("scroll"===r.mode){var e=r.containerPos,t=r.el.getBoundingClientRect();"b2t"===r.direction?t&&t.bottom<=e.top+100?(r.status="end",r.remove()):(r.pauseMove(e),"paused"!==r.danmu.bulletBtn.main.status&&r.startMove(e)):t&&t.right<=e.left+100?(r.status="end",r.remove()):(r.pauseMove(e),"paused"!==r.danmu.bulletBtn.main.status&&r.startMove(e))}else r.status="end",r.remove()}}},{key:"remove",value:function(){this.logger.info("remove #"+(this.options.txt||"[DOM Element]")+"#"),this.removeTimer&&clearTimeout(this.removeTimer),this.startMoveTimer&&clearTimeout(this.startMoveTimer),this.el&&this.el.parentNode&&(this.el.style.willChange="auto",this.danmu.off("changeDirection",this.onChangeDirection),this.domObj.unuse(this.el),this.el.parentNode.removeChild(this.el),this.el=null,this.danmu.emit("bullet_remove",{bullet:this}))}},{key:"setFontSize",value:function(e){this.el&&(this.el.style.fontSize=e)}},{key:"setLikeDom",value:function(e,t){if(e&&(Object.keys(t).forEach((function(r){e.style[r]=t[r]})),e.className="danmu-like",this.el)){var r=this.el.querySelector(".danmu-like");r&&this.el.removeChild(r),this.el.innerHTML=""+this.el.innerHTML+e.outerHTML}return e}}]),t}(i.default);t.default=l,e.exports=t.default},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t={initDOM:function(){return document.createElement("div")},initSize:10},this.init(t)}return n(e,[{key:"init",value:function(e){this.idleList=[],this.usingList=[],this._id=0,this.options=e,this._expand(e.initSize)}},{key:"use",value:function(){this.idleList.length||this._expand(1);var e=this.idleList.shift();return this.usingList.push(e),e}},{key:"unuse",value:function(e){var t=this.usingList.indexOf(e);t<0||(this.usingList.splice(t,1),e.innerHTML="",e.textcontent="",e.style="",this.idleList.push(e))}},{key:"_expand",value:function(e){for(var t=0;t<e;t++)this.idleList.push(this.options.initDOM(this._id++))}},{key:"destroy",value:function(){for(var e=0;e<this.idleList.length;e++)this.idleList[e].innerHTML="",this.idleList[e].textcontent="",this.idleList[e].style="";for(var t=0;t<this.usingList.length;t++)this.usingList[t].innerHTML="",this.usingList[t].textcontent="",this.usingList[t].style="";for(var r in this)delete this[r]}}]),e}();t.default=i,e.exports=t.default},function(e){e.exports=JSON.parse('{"version":"0.3.3"}')},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=new(function(){function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.__handlers=[],window.ResizeObserver&&(this.observer=new window.ResizeObserver((function(e){var r=(new Date).getTime();r-t.timeStampe<200||(t.timeStampe=r,t.__trigger(e))})),this.timeStampe=(new Date).getTime())}return n(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer&&this.observer.observe(e);for(var r=this.__handlers,n=-1,i=0;i<r.length;i++)r[i]&&e===r[i].target&&(n=i);n>-1?this.__handlers[n].handler.push(t):this.__handlers.push({target:e,handler:[t]})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(r,n){e===r.target&&(t=n)})),this.observer&&this.observer.unobserve(e),t>-1&&this.__handlers.splice(t,1)}},{key:"destroyObserver",value:function(){this.observer&&this.observer.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(e){for(var t=this.__handlers,r=0;r<t.length;r++)if(t[r]&&e===t[r].target){t[r].handler&&t[r].handler.map((function(e){try{e()}catch(e){console.error(e)}}));break}}},{key:"__trigger",value:function(e){var t=this;e.map((function(e){t.__runHandler(e.target)}))}}]),e}());window.resizeObserver=i,t.addObserver=function(e,t){i.addObserver(e,t)},t.unObserver=function(e,t){i.unObserver(e,t)},t.destroyObserver=function(e,t){i.destroyObserver(e,t)}},function(e,t,r){var n=r(35);"string"==typeof n&&(n=[[e.i,n,""]]),r(37)(n,{hmr:!0,transform:void 0,insertInto:void 0}),n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(36)(!1)).push([e.i,".danmu{overflow:hidden;-webkit-user-select:none;-moz-user-select:none;user-select:none;-ms-user-select:none}.danmu>*{position:absolute;white-space:nowrap}.danmu-switch{width:32px;height:20px;border-radius:100px;background-color:#ccc;-webkit-box-sizing:border-box;box-sizing:border-box;outline:none;cursor:pointer;position:relative;text-align:center;margin:10px auto}.danmu-switch.danmu-switch-active{padding-left:12px;background-color:#f85959}.danmu-switch span.txt{width:20px;height:20px;line-height:20px;text-align:center;display:block;border-radius:100px;background-color:#ffffff;-webkit-box-shadow:-2px 0 0 0 rgba(0, 0, 0, .04);box-shadow:-2px 0 0 0 rgba(0, 0, 0, .04);font-family:PingFangSC;font-size:10px;font-weight:500;color:#f44336}\n",""])},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r=function(e,t){var r,n=e[1]||"",i=e[3];if(!i)return n;if(t&&"function"==typeof btoa){var a=(r=i,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */"),o=i.sources.map((function(e){return"/*# sourceURL="+i.sourceRoot+e+" */"}));return[n].concat(o).concat([a]).join("\n")}return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+r+"}":r})).join("")},t.i=function(e,r){"string"==typeof e&&(e=[[null,e,""]]);for(var n={},i=0;i<this.length;i++){var a=this[i][0];"number"==typeof a&&(n[a]=!0)}for(i=0;i<e.length;i++){var o=e[i];"number"==typeof o[0]&&n[o[0]]||(r&&!o[2]?o[2]=r:r&&(o[2]="("+o[2]+") and ("+r+")"),t.push(o))}},t}},function(e,t,r){var n,i,a={},s=(n=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===i&&(i=n.apply(this,arguments)),i}),l=function(e){return document.querySelector(e)},u=function(e){var t={};return function(e){if("function"==typeof e)return e();if(void 0===t[e]){var r=l.call(this,e);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}t[e]=r}return t[e]}}(),c=null,d=0,f=[],p=r(38);function h(e,t){for(var r=0;r<e.length;r++){var n=e[r],i=a[n.id];if(i){i.refs++;for(var o=0;o<i.parts.length;o++)i.parts[o](n.parts[o]);for(;o<n.parts.length;o++)i.parts.push(b(n.parts[o],t))}else{var s=[];for(o=0;o<n.parts.length;o++)s.push(b(n.parts[o],t));a[n.id]={id:n.id,refs:1,parts:s}}}}function g(e,t){for(var r=[],n={},i=0;i<e.length;i++){var a=e[i],o=t.base?a[0]+t.base:a[0],s={css:a[1],media:a[2],sourceMap:a[3]};n[o]?n[o].parts.push(s):r.push(n[o]={id:o,parts:[s]})}return r}function y(e,t){var r=u(e.insertInto);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var n=f[f.length-1];if("top"===e.insertAt)n?n.nextSibling?r.insertBefore(t,n.nextSibling):r.appendChild(t):r.insertBefore(t,r.firstChild),f.push(t);else if("bottom"===e.insertAt)r.appendChild(t);else{if("object"!=o(e.insertAt)||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var i=u(e.insertInto+" "+e.insertAt.before);r.insertBefore(t,i)}}function v(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=f.indexOf(e);t>=0&&f.splice(t,1)}function m(e){var t=document.createElement("style");return void 0===e.attrs.type&&(e.attrs.type="text/css"),x(t,e.attrs),y(e,t),t}function x(e,t){Object.keys(t).forEach((function(r){e.setAttribute(r,t[r])}))}function b(e,t){var r,n,i,a;if(t.transform&&e.css){if(!(a=t.transform(e.css)))return function(){};e.css=a}if(t.singleton){var o=d++;r=c||(c=m(t)),n=w.bind(null,r,o,!1),i=w.bind(null,r,o,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(r=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",x(t,e.attrs),y(e,t),t}(t),n=T.bind(null,r,t),i=function(){v(r),r.href&&URL.revokeObjectURL(r.href)}):(r=m(t),n=E.bind(null,r),i=function(){v(r)});return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else i()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=("undefined"==typeof document?"undefined":o(document)))throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==o(t.attrs)?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=s()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var r=g(e,t);return h(r,t),function(e){for(var n=[],i=0;i<r.length;i++){var o=r[i];(s=a[o.id]).refs--,n.push(s)}for(e&&h(g(e,t),t),i=0;i<n.length;i++){var s;if(0===(s=n[i]).refs){for(var l=0;l<s.parts.length;l++)s.parts[l]();delete a[s.id]}}}};var k,_=(k=[],function(e,t){return k[e]=t,k.filter(Boolean).join("\n")});function w(e,t,r,n){var i=r?"":n.css;if(e.styleSheet)e.styleSheet.cssText=_(t,i);else{var a=document.createTextNode(i),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(a,o[t]):e.appendChild(a)}}function E(e,t){var r=t.css,n=t.media;if(n&&e.setAttribute("media",n),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}function T(e,t,r){var n=r.css,i=r.sourceMap,a=void 0===t.convertToAbsoluteUrls&&i;(t.convertToAbsoluteUrls||a)&&(n=p(n)),i&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var o=new Blob([n],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(o),s&&URL.revokeObjectURL(s)}},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var r=t.protocol+"//"+t.host,n=r+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(e,t){var i,a=t.trim().replace(/^"(.*)"$/,(function(e,t){return t})).replace(/^'(.*)'$/,(function(e,t){return t}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(a)?e:(i=0===a.indexOf("//")?a:0===a.indexOf("/")?r+a:n+a.replace(/^\.\//,""),"url("+JSON.stringify(i)+")")}))}}])},"object"==o(t)&&"object"==o(e)?e.exports=a():(n=[],void 0===(i="function"==typeof(r=a)?r.apply(t,n):r)||(e.exports=i))}).call(this,r(128)(e))},function(e,t,r){"use strict";e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";r.r(t),t.default='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40">\n  <path fill="#f85959" transform="scale(0.8 0.8)" d="M36.5,18.73a1.19,1.19,0,0,0,1-1.14V16.33a1.2,1.2,0,0,0-1-1.13l-.61-.08a1.75,1.75,0,0,1-1.3-.86l-.21-.36-.2-.36A1.72,1.72,0,0,1,34,12l.23-.58a1.18,1.18,0,0,0-.5-1.42l-1.1-.62a1.18,1.18,0,0,0-1.47.3l-.39.51a1.82,1.82,0,0,1-1.41.72c-.44,0-1.88-.27-2.22-.7l-.39-.49a1.18,1.18,0,0,0-1.48-.28l-1.09.64a1.19,1.19,0,0,0-.47,1.43l.25.59a1.87,1.87,0,0,1-.08,1.58c-.26.37-1.17,1.5-1.71,1.58l-.63.09a1.19,1.19,0,0,0-1,1.14l0,1.27a1.17,1.17,0,0,0,1,1.12l.61.08a1.74,1.74,0,0,1,1.3.87l.21.36.2.35A1.69,1.69,0,0,1,24,22.08l-.23.59a1.19,1.19,0,0,0,.5,1.42l1.1.62a1.19,1.19,0,0,0,1.48-.31l.38-.5a1.83,1.83,0,0,1,1.41-.72c.44,0,1.88.25,2.22.69l.39.49a1.18,1.18,0,0,0,1.48.28L33.86,24a1.19,1.19,0,0,0,.47-1.43L34.09,22a1.84,1.84,0,0,1,.07-1.58c.26-.37,1.17-1.5,1.72-1.58ZM31,18.94a2.76,2.76,0,0,1-4.65-1.2A2.71,2.71,0,0,1,27,15.13a2.76,2.76,0,0,1,4.64,1.2A2.7,2.7,0,0,1,31,18.94Z"/>\n  <path fill="#f85959" transform="scale(0.8 0.8)" d="M32,0H3.59A3.59,3.59,0,0,0,0,3.59v17A3.59,3.59,0,0,0,3.59,24.2H19.72a12.59,12.59,0,0,1-.81-1.2A11.73,11.73,0,0,1,35.54,7.28V3.59A3.59,3.59,0,0,0,32,0ZM13,14.18H4.29a1.52,1.52,0,0,1,0-3H13a1.52,1.52,0,0,1,0,3ZM16.45,8H4.29a1.51,1.51,0,0,1,0-3H16.45a1.51,1.51,0,1,1,0,3Z"/>\n</svg>\n'},function(e,t,r){var n=r(131);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};r(2)(n,i),n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(1)(!1)).push([e.i,".xgplayer-skin-default .danmu-switch{-webkit-order:6;-moz-box-ordinal-group:7;order:6;z-index:26}.xgplayer-skin-default .xgplayer-danmu{display:none;position:absolute;top:0;left:0;right:0;height:100%;overflow:hidden;z-index:9;outline:none}.xgplayer-skin-default .xgplayer-danmu>*{position:absolute;white-space:nowrap;z-index:9}.xgplayer-skin-default .xgplayer-danmu.xgplayer-has-danmu{display:block}.xgplayer-skin-default .xgplayer-panel{outline:none;-webkit-order:7;-moz-box-ordinal-group:8;order:7;width:40px;height:40px;display:inline-block;position:relative;font-family:PingFangSC-Regular;font-size:13px;color:hsla(0,0%,100%,.8);z-index:36}.xgplayer-skin-default .xgplayer-panel .xgplayer-panel-icon{cursor:pointer;position:absolute;margin-left:5px;top:10px}.xgplayer-skin-default .xgplayer-panel-active{display:block!important;bottom:30px}.xgplayer-skin-default .xgplayer-panel-slider{z-index:36;display:none;position:absolute;width:230px;height:230px;background:rgba(0,0,0,.54);border-radius:1px;padding:10px 20px;outline:none;left:-115px;bottom:40px}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-hidemode{padding-bottom:10px}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-hidemode-radio li{display:inline;list-style:none;cursor:pointer}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-hidemode ul{display:-webkit-flex;display:-moz-box;display:flex;-webkit-justify-content:space-around;justify-content:space-around}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-hidemode li{margin:0 12px;font-size:11px;color:#aaa}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-hidemode-font{margin-bottom:10px}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-transparency{display:block;margin-top:10px}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-transparency .xgplayer-transparency-line{-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;outline:none;width:150px;height:4px;background:#aaa;border-radius:4px;border-style:none;margin-left:10px;margin-top:-2px}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-transparency .xgplayer-transparency-line::-moz-focus-outer{border:0!important}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-transparency .xgplayer-transparency-color::-webkit-slider-runnable-track{outline:none;width:150px;height:4px;border-radius:4px}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-transparency .xgplayer-transparency-color::-moz-range-track{outline:none;background-color:#aaa;border-color:transparent;cursor:pointer;width:150px;height:4px;border-radius:4px}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-transparency .xgplayer-transparency-color::-ms-track{outline:none;background-color:#aaa;color:transparent;border-color:transparent;width:150px;height:4px;border-radius:4px}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-transparency .xgplayer-transparency-bar::-webkit-slider-thumb{outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:6px solid #f85959;height:6px;width:6px;margin-top:-4px;border-radius:6px;cursor:pointer}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-transparency .xgplayer-transparency-bar::-moz-range-thumb{outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:6px solid #f85959;height:0;width:0;border-radius:6px;cursor:pointer}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-transparency .xgplayer-transparency-bar::-ms-thumb{outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:6px solid #f85959;height:6px;width:6px;border-radius:6px;cursor:pointer}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-transparency .xgplayer-transparency-bar::-moz-range-progress{outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;height:4px;border-radius:4px;background:linear-gradient(90deg,#f85959,#f85959 100%,#aaa)}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-showarea{display:block;margin-top:8px}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-showarea-name{display:inline-block;position:relative;top:-10px}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-showarea-control{display:inline-block}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-showarea-control-up{width:150px;margin-left:10px;display:-moz-box;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;-moz-box-pack:justify;justify-content:space-between;color:#aaa}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-showarea-control-down{position:relative;top:-10px}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-showarea-control-down-dots{display:-webkit-flex;display:-moz-box;display:flex;width:150px;margin-left:10px;-webkit-justify-content:space-between;-moz-box-pack:justify;justify-content:space-between}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-showarea-threequarters,.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-showarea-twoquarters{margin-left:-6px}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-showarea-full{margin-right:3px}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-showarea .xgplayer-showarea-line{-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;outline:none;width:150px;height:4px;background:#aaa;border-radius:4px;border-style:none;margin-left:10px;margin-top:-2px}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-showarea .xgplayer-showarea-line::-moz-focus-outer{border:0!important}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-showarea .xgplayer-showarea-color::-webkit-slider-runnable-track{outline:none;width:150px;height:4px;border-radius:4px}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-showarea .xgplayer-showarea-color::-moz-range-track{outline:none;background-color:#aaa;border-color:transparent;cursor:pointer;width:150px;height:4px;border-radius:4px}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-showarea .xgplayer-showarea-color::-ms-track{outline:none;background-color:#aaa;color:transparent;border-color:transparent;width:150px;height:4px;border-radius:4px}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-showarea .xgplayer-showarea-bar::-webkit-slider-thumb{outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:6px solid #f85959;height:6px;width:6px;margin-top:-4px;border-radius:6px;cursor:pointer}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-showarea .xgplayer-showarea-bar::-moz-range-thumb{outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:6px solid #f85959;height:0;width:0;border-radius:6px;cursor:pointer}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-showarea .xgplayer-showarea-bar::-ms-thumb{outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:6px solid #f85959;height:6px;width:6px;border-radius:6px;cursor:pointer}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-showarea .xgplayer-showarea-full-dot,.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-showarea .xgplayer-showarea-onequarters-dot,.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-showarea .xgplayer-showarea-threequarters-dot,.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-showarea .xgplayer-showarea-twoquarters-dot,.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-showarea .xgplayer-showarea-zero-dot{width:3px;height:3px;border:3px solid #aaa;border-radius:50%;background-color:#aaa;position:relative;top:16px;z-index:-1}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmuspeed{display:block}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmuspeed-name{display:inline-block;position:relative;top:-10px}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmuspeed-control{display:inline-block}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmuspeed-control-up{width:150px;margin-left:10px;display:-moz-box;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;-moz-box-pack:justify;justify-content:space-between;color:#aaa}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmuspeed-control-down{position:relative;top:-10px}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmuspeed-control-down-dots{display:-webkit-flex;display:-moz-box;display:flex;width:150px;margin-left:10px;-webkit-justify-content:space-between;-moz-box-pack:justify;justify-content:space-between}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmuspeed .xgplayer-danmuspeed-line{-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;outline:none;width:150px;height:4px;background:#aaa;border-radius:4px;border-style:none;margin-left:10px;margin-top:-2px}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmuspeed .xgplayer-danmuspeed-line::-moz-focus-outer{border:0!important}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmuspeed .xgplayer-danmuspeed-color::-webkit-slider-runnable-track{outline:none;width:150px;height:4px;border-radius:4px}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmuspeed .xgplayer-danmuspeed-color::-moz-range-track{outline:none;background-color:#aaa;border-color:transparent;cursor:pointer;width:150px;height:4px;border-radius:4px}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmuspeed .xgplayer-danmuspeed-color::-ms-track{outline:none;background-color:#aaa;color:transparent;border-color:transparent;width:150px;height:4px;border-radius:4px}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmuspeed .xgplayer-danmuspeed-bar::-webkit-slider-thumb{outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:6px solid #f85959;height:6px;width:6px;margin-top:-4px;border-radius:6px;cursor:pointer}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmuspeed .xgplayer-danmuspeed-bar::-moz-range-thumb{outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:6px solid #f85959;height:0;width:0;border-radius:6px;cursor:pointer}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmuspeed .xgplayer-danmuspeed-bar::-ms-thumb{outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:6px solid #f85959;height:6px;width:6px;border-radius:6px;cursor:pointer}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmuspeed .xgplayer-danmuspeed-large-dot,.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmuspeed .xgplayer-danmuspeed-middle-dot,.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmuspeed .xgplayer-danmuspeed-small-dot{width:3px;height:3px;border:3px solid #aaa;border-radius:50%;background-color:#aaa;position:relative;top:16px;z-index:-1}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmufont{display:block}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmufont-name{display:inline-block;position:relative;top:-10px}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmufont-control{display:inline-block}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmufont-control-up{width:150px;margin-left:10px;display:-moz-box;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;-moz-box-pack:justify;justify-content:space-between;color:#aaa}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmufont-control-down{position:relative;top:-10px}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmufont-control-down-dots{display:-webkit-flex;display:-moz-box;display:flex;width:150px;margin-left:10px;-webkit-justify-content:space-between;-moz-box-pack:justify;justify-content:space-between}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmufont .xgplayer-danmufont-line{-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;outline:none;width:150px;height:4px;background:#aaa;border-radius:4px;border-style:none;margin-left:10px;margin-top:-2px}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmufont .xgplayer-danmufont-line::-moz-focus-outer{border:0!important}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmufont .xgplayer-danmufont-color::-webkit-slider-runnable-track{outline:none;width:150px;height:4px;border-radius:4px}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmufont .xgplayer-danmufont-color::-moz-range-track{outline:none;background-color:#aaa;border-color:transparent;cursor:pointer;width:150px;height:4px;border-radius:4px}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmufont .xgplayer-danmufont-color::-ms-track{outline:none;background-color:#aaa;color:transparent;border-color:transparent;width:150px;height:4px;border-radius:4px}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmufont .xgplayer-danmufont-bar::-webkit-slider-thumb{outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:6px solid #f85959;height:6px;width:6px;margin-top:-4px;border-radius:6px;cursor:pointer}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmufont .xgplayer-danmufont-bar::-moz-range-thumb{outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:6px solid #f85959;height:0;width:0;border-radius:6px;cursor:pointer}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmufont .xgplayer-danmufont-bar::-ms-thumb{outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:6px solid #f85959;height:6px;width:6px;border-radius:6px;cursor:pointer}.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmufont .xgplayer-danmufont-large-dot,.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmufont .xgplayer-danmufont-middle-dot,.xgplayer-skin-default .xgplayer-panel-slider .xgplayer-danmufont .xgplayer-danmufont-small-dot{width:3px;height:3px;border:3px solid #aaa;border-radius:50%;background-color:#aaa;position:relative;top:16px;z-index:-1}",""])},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0),a=(n=i)&&n.__esModule?n:{default:n};r(133),t.default={name:"s_pip",method:function(){var e=this,t=a.default.util;if(e.config.pip){var r=e.lang.PIP,n=t.createDom("xg-pip",'<p class="name"><span>'+r+"</span></p>",{tabindex:9},"xgplayer-pip");e.once("ready",(function(){e.controls.appendChild(n)})),["click","touchend"].forEach((function(t){n.addEventListener(t,(function(t){t.preventDefault(),t.stopPropagation(),e.emit("pipBtnClick")}))}))}}},e.exports=t.default},function(e,t,r){var n=r(134);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};r(2)(n,i),n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(1)(!1)).push([e.i,".xgplayer-skin-default .xgplayer-pip{-webkit-order:9;-moz-box-ordinal-group:10;order:9;position:relative;outline:none;display:block;cursor:pointer;height:20px;top:10px}.xgplayer-skin-default .xgplayer-pip .name{text-align:center;font-family:PingFangSC-Regular;font-size:13px;line-height:20px;height:20px;color:hsla(0,0%,100%,.8)}.xgplayer-skin-default .xgplayer-pip .name span{width:60px;height:20px;line-height:20px;background:rgba(0,0,0,.38);border-radius:10px;display:inline-block;vertical-align:middle}.lang-is-jp .xgplayer-pip .name span{width:70px;height:20px}",""])},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0),a=(n=i)&&n.__esModule?n:{default:n};r(136),t.default={name:"s_miniplayer",method:function(){var e=this,t=a.default.util;if(e.config.miniplayer){var r=e.lang.MINIPLAYER,n=t.createDom("xg-miniplayer",'<p class="name"><span>'+r+"</span></p>",{tabindex:9},"xgplayer-miniplayer");e.once("ready",(function(){e.controls.appendChild(n)})),["click","touchend"].forEach((function(t){n.addEventListener(t,(function(t){t.preventDefault(),t.stopPropagation(),e.emit("miniplayerBtnClick")}))}))}}},e.exports=t.default},function(e,t,r){var n=r(137);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};r(2)(n,i),n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(1)(!1)).push([e.i,".xgplayer-skin-default .xgplayer-miniplayer{-webkit-order:9;-moz-box-ordinal-group:10;order:9;position:relative;outline:none;display:block;cursor:pointer;height:20px;top:10px}.xgplayer-skin-default .xgplayer-miniplayer .name{text-align:center;font-family:PingFangSC-Regular;font-size:13px;line-height:20px;height:20px;color:hsla(0,0%,100%,.8)}.xgplayer-skin-default .xgplayer-miniplayer .name span{width:80px;height:20px;line-height:20px;background:rgba(0,0,0,.38);border-radius:10px;display:inline-block;vertical-align:middle}.xgplayer-skin-default .xgplayer-miniplayer-lay{position:absolute;top:26px;left:0;width:100%;height:100%;z-index:130;cursor:pointer;background-color:transparent;display:none}.xgplayer-skin-default .xgplayer-miniplayer-lay div{width:100%;height:100%}.xgplayer-skin-default .xgplayer-miniplayer-drag{cursor:move;position:absolute;top:0;left:0;width:100%;height:26px;line-height:26px;background-image:linear-gradient(rgba(0,0,0,.3),transparent);z-index:130;display:none}.xgplayer-skin-default.xgplayer-miniplayer-active{position:fixed;right:0;bottom:200px;width:320px;height:180px;z-index:110}.xgplayer-skin-default.xgplayer-miniplayer-active .xgplayer-controls,.xgplayer-skin-default.xgplayer-miniplayer-active .xgplayer-danmu{display:none}.xgplayer-skin-default.xgplayer-miniplayer-active .xgplayer-miniplayer-lay{display:block}.xgplayer-skin-default.xgplayer-miniplayer-active .xgplayer-miniplayer-drag{display:-webkit-flex;display:-moz-box;display:flex}.xgplayer-skin-default.xgplayer-inactive .xgplayer-miniplayer-drag{display:none}.lang-is-jp .xgplayer-miniplayer .name span{width:70px;height:20px}",""])},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a(r(0)),i=a(r(139));function a(e){return e&&e.__esModule?e:{default:e}}r(140),t.default={name:"s_playNext",method:function(){var e=this,t=n.default.util,r=e.config.playNext;if(r&&r.urlList){var a=t.createDom("xg-playnext",'<xg-icon class="xgplayer-icon">'+i.default+"</xg-icon>",{},"xgplayer-playnext"),o=e.lang.PLAYNEXT_TIPS,s=t.createDom("xg-tips",'<span class="xgplayer-tip-playnext">'+o+"</span>",{},"xgplayer-tips");a.appendChild(s),e.once("ready",(function(){e.controls.appendChild(a)})),["click","touchend"].forEach((function(t){a.addEventListener(t,(function(t){t.preventDefault(),t.stopPropagation(),n.default.util.addClass(e.root,"xgplayer-is-enter"),e.emit("playNextBtnClick")}))}));var l=function(){n.default.util.addClass(e.root,"xgplayer-playnext-inactive")};e.on("urlListEnd",l),e.once("destroy",(function t(){e.off("urlListEnd",l),e.off("destroy",t)}))}}},e.exports=t.default},function(e,t,r){"use strict";r.r(t),t.default='<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40">\n  <path transform="scale(0.038 0.028)" d="M800 380v768h-128v-352l-320 320v-704l320 320v-352z"></path>\n</svg>\n'},function(e,t,r){var n=r(141);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};r(2)(n,i),n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(1)(!1)).push([e.i,".xgplayer-skin-default .xgplayer-playnext{position:relative;-webkit-order:1;-moz-box-ordinal-group:2;order:1;display:block;cursor:pointer;top:-2px}.xgplayer-skin-default .xgplayer-playnext .xgplayer-icon div{position:absolute}.xgplayer-skin-default .xgplayer-playnext .xgplayer-tips .xgplayer-tip-playnext{display:block}.xgplayer-skin-default .xgplayer-playnext:hover{opacity:.85}.xgplayer-skin-default .xgplayer-playnext:hover .xgplayer-tips{display:block}.xgplayer-lang-is-en .xgplayer-playnext .xgplayer-tips{margin-left:-25px}.xgplayer-lang-is-jp .xgplayer-playnext .xgplayer-tips{margin-left:-38px}.xgplayer-skin-default.xgplayer-playnext-inactive .xgplayer-playnext{display:none}",""])},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a(r(0)),i=a(r(143));function a(e){return e&&e.__esModule?e:{default:e}}r(144),t.default={name:"s_rotate",method:function(){var e=this,t=n.default.util;if(e.config.rotate){var r=t.createDom("xg-rotate",'<xg-icon class="xgplayer-icon">'+i.default+"</xg-icon>",{},"xgplayer-rotate"),a=e.lang.ROTATE_TIPS,o=t.createDom("xg-tips",'<span class="xgplayer-tip-rotate">'+a+"</span>",{},"xgplayer-tips");r.appendChild(o),e.once("ready",(function(){e.controls.appendChild(r)})),["click","touchend"].forEach((function(t){r.addEventListener(t,(function(t){t.preventDefault(),t.stopPropagation(),e.emit("rotateBtnClick")}))}))}}},e.exports=t.default},function(e,t,r){"use strict";r.r(t),t.default='<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 40 40" fill="none">\n  <g clip-path="url(#clip0)">\n    <path transform="scale(1.5 1.5)" d="M11.6665 9.16663H4.1665C2.78579 9.16663 1.6665 10.2859 1.6665 11.6666V15.8333C1.6665 17.214 2.78579 18.3333 4.1665 18.3333H11.6665C13.0472 18.3333 14.1665 17.214 14.1665 15.8333V11.6666C14.1665 10.2859 13.0472 9.16663 11.6665 9.16663Z" fill="white"/>\n    <path transform="scale(1.5 1.5)" fill-rule="evenodd" clip-rule="evenodd" d="M3.88148 4.06298C3.75371 4.21005 3.67667 4.40231 3.67749 4.61242C3.67847 4.87253 3.79852 5.10435 3.98581 5.25646L6.99111 8.05895C7.32771 8.37283 7.85502 8.35443 8.16891 8.01782C8.48279 7.68122 8.46437 7.15391 8.12778 6.84003L6.62061 5.43457L9.8198 5.4224C9.82848 5.42239 9.8372 5.42221 9.84591 5.4219C10.9714 5.38233 12.0885 5.6285 13.0931 6.13744C14.0976 6.64635 14.957 7.40148 15.5908 8.33234C16.2246 9.2632 16.6122 10.3394 16.7177 11.4606C16.823 12.5819 16.6427 13.7115 16.1934 14.7442C16.0098 15.1661 16.203 15.6571 16.6251 15.8408C17.0471 16.0243 17.5381 15.8311 17.7216 15.4091C18.2833 14.1183 18.5087 12.7063 18.3771 11.3047C18.2453 9.90318 17.7607 8.55792 16.9684 7.39433C16.1761 6.23073 15.1021 5.28683 13.8463 4.65065C12.5946 4.01651 11.203 3.70872 9.80072 3.75583L6.43415 3.76862L7.96326 2.12885C8.27715 1.79225 8.25872 1.26494 7.92213 0.951061C7.58553 0.63718 7.05822 0.655585 6.74433 0.99219L3.90268 4.0395C3.89545 4.04724 3.88841 4.05509 3.88154 4.06303L3.88148 4.06298Z" fill="white"/>\n  </g>\n  <defs>\n    <clipPath id="clip0">\n      <rect width="40" height="40" fill="white"/>\n    </clipPath>\n  </defs>\n</svg>\n'},function(e,t,r){var n=r(145);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};r(2)(n,i),n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(1)(!1)).push([e.i,".xgplayer-skin-default .xgplayer-rotate{position:relative;-webkit-order:10;-moz-box-ordinal-group:11;order:10;display:block;cursor:pointer}.xgplayer-skin-default .xgplayer-rotate .xgplayer-icon{margin-top:7px;width:26px}.xgplayer-skin-default .xgplayer-rotate .xgplayer-icon div{position:absolute}.xgplayer-skin-default .xgplayer-rotate .xgplayer-tips{margin-left:-22px}.xgplayer-skin-default .xgplayer-rotate .xgplayer-tips .xgplayer-tip-rotate{display:block}.xgplayer-skin-default .xgplayer-rotate:hover{opacity:.85}.xgplayer-skin-default .xgplayer-rotate:hover .xgplayer-tips{display:block}.xgplayer-lang-is-en .xgplayer-rotate .xgplayer-tips{margin-left:-26px}.xgplayer-lang-is-jp .xgplayer-rotate .xgplayer-tips{margin-left:-38px}",""])},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a(r(0)),i=a(r(147));function a(e){return e&&e.__esModule?e:{default:e}}r(148),t.default={name:"s_reload",method:function(){var e=this,t=n.default.util;if(e.config.reload){var r=t.createDom("xg-reload",'<xg-icon class="xgplayer-icon">'+i.default+"</xg-icon>",{},"xgplayer-reload"),a=e.lang.RELOAD_TIPS,o=t.createDom("xg-tips",'<span class="xgplayer-tip-reload">'+a+"</span>",{},"xgplayer-tips");r.appendChild(o),e.once("ready",(function(){e.controls.appendChild(r)})),["click","touchend"].forEach((function(t){r.addEventListener(t,(function(t){t.preventDefault(),t.stopPropagation(),e.emit("reloadBtnClick")}))}))}}},e.exports=t.default},function(e,t,r){"use strict";r.r(t),t.default='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28">\n    <path fill="#FFF" fill-opacity="1" fill-rule="nonzero" d="M18.17 19.988a7.182 7.182 0 0 1-4.256 1.318 7.806 7.806 0 0 1-.595-.03c-.08-.008-.16-.021-.242-.031a8.004 8.004 0 0 1-.458-.071c-.094-.018-.185-.042-.276-.063a7.743 7.743 0 0 1-.439-.113c-.068-.022-.136-.047-.205-.07a7.03 7.03 0 0 1-.492-.181c-.037-.015-.072-.032-.108-.049a7.295 7.295 0 0 1-.554-.269l-.025-.012a7.347 7.347 0 0 1-2.111-1.753c-.03-.036-.057-.074-.086-.11a7.305 7.305 0 0 1-1.594-4.557h1.686a.123.123 0 0 0 .108-.064.119.119 0 0 0-.006-.125L5.684 9.532a.123.123 0 0 0-.103-.056.123.123 0 0 0-.102.056l-2.834 4.276a.121.121 0 0 0-.005.125c.022.04.064.064.107.064h1.687c0 2.025.627 3.902 1.693 5.454.013.021.022.044.037.066.11.159.233.305.352.455.043.057.085.116.13.171.175.213.36.413.55.61.02.018.036.038.054.055a9.447 9.447 0 0 0 2.91 1.996c.058.026.115.054.175.079.202.084.41.158.619.228.098.034.196.069.296.1.183.054.37.1.558.145.125.029.249.06.376.085.052.01.102.027.155.035.177.032.355.05.533.071.064.007.128.018.19.026.32.03.639.052.956.052a9.46 9.46 0 0 0 5.47-1.746 1.16 1.16 0 0 0 .282-1.608 1.143 1.143 0 0 0-1.6-.283zm5.397-5.991a9.604 9.604 0 0 0-1.685-5.441c-.016-.027-.026-.054-.043-.078-.132-.19-.276-.366-.419-.543-.017-.022-.032-.044-.05-.065a9.467 9.467 0 0 0-3.571-2.7l-.114-.051a11.2 11.2 0 0 0-.673-.248c-.082-.027-.163-.057-.247-.082a9.188 9.188 0 0 0-.6-.156c-.113-.026-.224-.055-.337-.077-.057-.011-.109-.028-.164-.037-.151-.027-.304-.039-.455-.058-.104-.013-.208-.03-.313-.04a10.05 10.05 0 0 0-.759-.039c-.045 0-.09-.007-.136-.007l-.025.003a9.45 9.45 0 0 0-5.46 1.737 1.16 1.16 0 0 0-.284 1.608c.363.523 1.08.65 1.6.284a7.182 7.182 0 0 1 4.222-1.32c.217.002.429.013.639.033.065.007.129.017.193.025.173.021.344.046.513.08.075.014.149.033.221.05.166.037.331.077.494.127l.152.051c.185.061.366.127.545.201l.054.025a7.308 7.308 0 0 1 2.741 2.067l.013.018a7.302 7.302 0 0 1 1.652 4.633h-1.686a.123.123 0 0 0-.108.064.12.12 0 0 0 .006.124l2.834 4.277c.022.033.06.054.103.054.042 0 .08-.021.102-.054l2.833-4.277a.12.12 0 0 0 .005-.124.123.123 0 0 0-.108-.064h-1.685z"/>\n</svg>\n'},function(e,t,r){var n=r(149);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};r(2)(n,i),n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(1)(!1)).push([e.i,".xgplayer-skin-default .xgplayer-reload{position:relative;-webkit-order:1;-moz-box-ordinal-group:2;order:1;display:block;width:40px;height:40px;cursor:pointer}.xgplayer-skin-default .xgplayer-reload .xgplayer-icon{margin-top:7px;width:26px}.xgplayer-skin-default .xgplayer-reload .xgplayer-icon div{position:absolute}.xgplayer-skin-default .xgplayer-reload .xgplayer-tips{margin-left:-22px}.xgplayer-skin-default .xgplayer-reload .xgplayer-tips .xgplayer-tip-reload{display:block}.xgplayer-skin-default .xgplayer-reload:hover{opacity:.85}.xgplayer-skin-default .xgplayer-reload:hover .xgplayer-tips{display:block}.xgplayer-lang-is-en .xgplayer-reload .xgplayer-tips{margin-left:-26px}.xgplayer-lang-is-jp .xgplayer-reload .xgplayer-tips{margin-left:-38px}",""])},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0),a=(n=i)&&n.__esModule?n:{default:n};r(151),t.default={name:"s_screenShot",method:function(){var e=this,t=a.default.util;if(e.config.screenShot&&!e.config.screenShot.hideButton){var r=e.lang.SCREENSHOT,n=t.createDom("xg-screenshot",'<p class="name"><span>'+r+"</span></p>",{tabindex:11},"xgplayer-screenshot");e.once("ready",(function(){e.controls.appendChild(n)})),["click","touchend"].forEach((function(t){n.addEventListener(t,(function(t){t.preventDefault(),t.stopPropagation(),e.emit("screenShotBtnClick")}))}))}}},e.exports=t.default},function(e,t,r){var n=r(152);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};r(2)(n,i),n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(1)(!1)).push([e.i,".xgplayer-skin-default .xgplayer-screenshot{-webkit-order:11;-moz-box-ordinal-group:12;order:11;position:relative;outline:none;display:block;cursor:pointer;height:20px;top:10px}.xgplayer-skin-default .xgplayer-screenshot .name{text-align:center;font-family:PingFangSC-Regular;font-size:13px;line-height:20px;height:20px;color:hsla(0,0%,100%,.8)}.xgplayer-skin-default .xgplayer-screenshot .name span{width:60px;height:20px;line-height:20px;background:rgba(0,0,0,.38);border-radius:10px;display:inline-block;vertical-align:middle}.xgplayer-lang-is-en .xgplayer-screenshot .name span,.xgplayer-lang-is-jp .xgplayer-screenshot .name span{width:75px;height:20px}",""])},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a(r(0)),i=a(r(154));function a(e){return e&&e.__esModule?e:{default:e}}r(155);var o={follow:!0,mode:"stroke",followBottom:50,fitVideo:!0,offsetBottom:2,baseSizeX:49,baseSizeY:28,minSize:16,minMobileSize:13,line:"double",fontColor:"#fff"};t.default={name:"s_textTrack",method:function(){var e=this,t=e.root,r=n.default.util;if(this.config.textTrack){var a=this.config.textTrack,s=this.config.textTrackStyle||{};Object.keys(o).map((function(e){void 0===s[e]&&(s[e]=o[e])})),e.textTrackShowDefault=!1,a.map((function(t,r){t.id||t.language||(t.id=r),!t.url&&(t.url=t.src),!t.language&&(t.language=t.srclang),void 0===t.isDefault&&(t.isDefault=t.default),!e.textTrackShowDefault&&(e.textTrackShowDefault=t.isDefault||t.default)}));var l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n={subTitles:e,defaultOpen:r};return Object.keys(t).map((function(e){n[e]=t[e]})),new i.default(n)}(a,s,e.textTrackShowDefault);l.attachPlayer(e);var u={},c=r.createDom("xg-texttrack","",{tabindex:7},"xgplayer-texttrack");a&&Array.isArray(a)&&a.length>0&&(r.addClass(e.root,"xgplayer-is-texttrack"),e.once("canplay",(function(){var n=["<ul>"];n.push('<li data-type="off" class="'+(e.textTrackShowDefault?"":"selected")+'">'+e.lang.OFF+"</li>"),a.forEach((function(t){n.push("<li data-id="+t.id+" data-language="+t.language+' class="'+(t.isDefault&&e.textTrackShowDefault?"selected":"")+'">'+t.label+"</li>")}));var i=e.lang.TEXTTRACK;n.push('</ul><p class="name">'+i+"</p>");var o=t.querySelector(".xgplayer-texttrack");if(o){o.innerHTML=n.join("");var s=o.querySelector(".name");e.config.textTrackActive&&"hover"!==e.config.textTrackActive||s.addEventListener("mouseenter",(function(e){e.preventDefault(),e.stopPropagation(),r.addClass(t,"xgplayer-texttrack-active"),o.focus()}))}else{c.innerHTML=n.join("");var l=c.querySelector(".name");e.config.textTrackActive&&"hover"!==e.config.textTrackActive||l.addEventListener("mouseenter",(function(t){t.preventDefault(),t.stopPropagation(),r.addClass(e.root,"xgplayer-texttrack-active"),c.focus()})),e.controls.appendChild(c)}}))),["touchend","click"].forEach((function(t){c.addEventListener(t,(function(t){t.preventDefault(),t.stopPropagation();var n=t.target||t.srcElement;if(n&&"li"===n.tagName.toLocaleLowerCase()){var i=n.getAttribute("data-id"),a=n.getAttribute("data-type"),o=n.getAttribute("data-language");Array.prototype.forEach.call(n.parentNode.childNodes,(function(e){r.removeClass(e,"selected")})),r.addClass(n,"selected"),"off"===a?(l.switchOff(),r.removeClass(e.root,"xgplayer-texttrack-active")):(console.log({id:i,language:o}),l.switch({id:i,language:o}),r.addClass(e.root,"xgplayer-texttrack-active"),e.emit("textTrackChange",n.innerHTML))}else"click"!==e.config.textTrackActive||!n||"p"!==n.tagName.toLocaleLowerCase()&&"em"!==n.tagName.toLocaleLowerCase()||(r.addClass(e.root,"xgplayer-texttrack-active"),c.focus())}),!1)}));var d=!1,f=s.followBottom;e.controls&&s.follow&&(l.on("resize",g),e.on("focus",p),e.on("blur",h)),e.once("destroy",(function(){l.off("resize",g),e.off("focus",p),e.off("blur",h),l.destroy(),l=null})),c.addEventListener("mouseleave",(function(t){t.preventDefault(),t.stopPropagation(),r.removeClass(e.root,"xgplayer-texttrack-active")}))}function p(){var e=u.marginBottom,t=u.vBottom;if(!d&&e){d=!0;var r=e+t;f>r&&(r=f),l&&(l.root.style.bottom=r+"px")}}function h(){d=!1;var e=u.vBottom+u.marginBottom;l&&(l.root.style.bottom=e+"px")}function g(e){u.vBottom=e.vBottom,u.marginBottom=e.marginBottom}}},e.exports=t.default},function(e,t,r){"use strict";var n,i,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(o,s){"object"==a(t)&&void 0!==e?e.exports=s():void 0===(i="function"==typeof(n=s)?n.call(t,r,t,e):n)||(e.exports=i)}(0,(function(){function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function t(e,t){return e(t={exports:{}},t.exports),t.exports}function r(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n})),this.resolve=v(t),this.reject=v(r)}function n(e){var t=e.length;return 3===t?(60*(60*Number(e[0])+Number(e[1]))*1e3+1e3*Number(e[2]))/1e3:2===t?(60*Number(e[0])*1e3+1e3*Number(e[1]))/1e3:Number(e[0])}function i(e){return/^(\-|\+)?\d+(\.\d+)?$/.test(e)}function o(e){return null===e?"":e.replace(/\&/g,"&amp;").replace(/\</g,"&lt;").replace(/\>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function s(e,t){return e>=0&&e<t.length?t[e]:""}function l(e,t){if(!e)return!1;if(e.classList)return Array.prototype.some.call(e.classList,(function(e){return e===t}));var r=e.className&&"object"===Sn(e.className)?e.getAttribute("class"):e.className;return r&&!!r.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}function u(e,t){e&&(e.classList?t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)})):l(e,t)||(e.className&&"object"===Sn(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t))}function c(e,t,r){var n=t.length;if(n<1)return-1;if(t[r=r<0?0:r>=n?n-1:r].start<=e&&e<t[r].end)return r;for(var i=t[r].end<=e?r+1:0;i<n;i++){if(t[i].start<=e&&e<t[i].end)return i;if(e>t[i].end&&i+1<n&&e<t[i+1].start)return-1;if(e>t[i].end&&i+1>=n)return-1}return-1}function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={code:Rn[e].code,msg:Rn[e].msg};return Xt(t).map((function(e){r[e]=t[e]})),r}function f(e){return new Wt((function(t,r){e.list&&t(),new mr({url:e.url,type:"text"}).then((function(n){Ar.parse(n.res.response,(function(n,i){i?(console.error(i),r(d(2),{format:n.format})):n.format?(e.list=n.list,e.format=n.format,t()):r(d(3))}))})).catch((function(e){r(d(1,{statusText:e.statusText,status:e.status,type:e.type,message:"http load error"}))}))}))}function p(e,t){return!!(e.id&&e.id===t.id||e.language&&e.language===t.language)}var h=e(t((function(e,t){t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}}))),g=t((function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)})),y=t((function(e){var t=e.exports={version:"2.6.12"};"number"==typeof __e&&(__e=t)})),v=(y.version,function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}),m=function(e,t,r){if(v(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}},x=function(e){return"object"==(void 0===e?"undefined":a(e))?null!==e:"function"==typeof e},b=function(e){if(!x(e))throw TypeError(e+" is not an object!");return e},k=function(e){try{return!!e()}catch(e){return!0}},_=!k((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})),w=g.document,E=x(w)&&x(w.createElement),T=function(e){return E?w.createElement(e):{}},S=!_&&!k((function(){return 7!=Object.defineProperty(T("div"),"a",{get:function(){return 7}}).a})),O=function(e,t){if(!x(e))return e;var r,n;if(t&&"function"==typeof(r=e.toString)&&!x(n=r.call(e)))return n;if("function"==typeof(r=e.valueOf)&&!x(n=r.call(e)))return n;if(!t&&"function"==typeof(r=e.toString)&&!x(n=r.call(e)))return n;throw TypeError("Can't convert object to primitive value")},R=Object.defineProperty,A={f:_?Object.defineProperty:function(e,t,r){if(b(e),t=O(t,!0),b(r),S)try{return R(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[t]=r.value),e}},P=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},L=_?function(e,t,r){return A.f(e,t,P(1,r))}:function(e,t,r){return e[t]=r,e},C={}.hasOwnProperty,D=function(e,t){return C.call(e,t)},I=function e(t,r,n){var i,a,o,s=t&e.F,l=t&e.G,u=t&e.S,c=t&e.P,d=t&e.B,f=t&e.W,p=l?y:y[r]||(y[r]={}),h=p.prototype,v=l?g:u?g[r]:(g[r]||{}).prototype;for(i in l&&(n=r),n)(a=!s&&v&&void 0!==v[i])&&D(p,i)||(o=a?v[i]:n[i],p[i]=l&&"function"!=typeof v[i]?n[i]:d&&a?m(o,g):f&&v[i]==o?function(e){var t=function(t,r,n){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,r)}return new e(t,r,n)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(o):c&&"function"==typeof o?m(Function.call,o):o,c&&((p.virtual||(p.virtual={}))[i]=o,t&e.R&&h&&!h[i]&&L(h,i,o)))};I.F=1,I.G=2,I.S=4,I.P=8,I.B=16,I.W=32,I.U=64,I.R=128;var M=I;M(M.S+M.F*!_,"Object",{defineProperty:A.f});var F=y.Object,N=function(e,t,r){return F.defineProperty(e,t,r)},B=t((function(e){e.exports={default:N,__esModule:!0}}));e(B);var j=e(t((function(e,t){t.__esModule=!0;var r=function(e){return e&&e.__esModule?e:{default:e}}(B);t.default=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),(0,r.default)(e,i.key,i)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}()}))),U=Math.ceil,G=Math.floor,z=function(e){return isNaN(e=+e)?0:(e>0?G:U)(e)},H=function(e){if(null==e)throw TypeError("Can't call method on  "+e);return e},K=L,q={},V={}.toString,W=function(e){return V.call(e).slice(8,-1)},Y=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==W(e)?e.split(""):Object(e)},X=function(e){return Y(H(e))},$=Math.min,J=function(e){return e>0?$(z(e),9007199254740991):0},Q=Math.max,Z=Math.min,ee=t((function(e){var t=g["__core-js_shared__"]||(g["__core-js_shared__"]={});(e.exports=function(e,r){return t[e]||(t[e]=void 0!==r?r:{})})("versions",[]).push({version:y.version,mode:"pure",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),te=0,re=Math.random(),ne=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++te+re).toString(36))},ie=ee("keys"),ae=function(e){return ie[e]||(ie[e]=ne(e))},oe=function(e,t,r){for(var n=X(e),i=J(n.length),a=function(e,t){return(e=z(e))<0?Q(e+t,0):Z(e,t)}(r,i);i>a;a++)if(a in n&&n[a]===t)return a||0;return-1},se=ae("IE_PROTO"),le=function(e,t){var r,n=X(e),i=0,a=[];for(r in n)r!=se&&D(n,r)&&a.push(r);for(;t.length>i;)D(n,r=t[i++])&&(~oe(a,r)||a.push(r));return a},ue="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),ce=Object.keys||function(e){return le(e,ue)},de=_?Object.defineProperties:function(e,t){b(e);for(var r,n=ce(t),i=n.length,a=0;i>a;)A.f(e,r=n[a++],t[r]);return e},fe=g.document,pe=fe&&fe.documentElement,he=ae("IE_PROTO"),ge=function(){},ye=function(){var e,t=T("iframe"),r=ue.length;for(t.style.display="none",pe.appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),ye=e.F;r--;)delete ye.prototype[ue[r]];return ye()},ve=Object.create||function(e,t){var r;return null!==e?(ge.prototype=b(e),r=new ge,ge.prototype=null,r[he]=e):r=ye(),void 0===t?r:de(r,t)},me=t((function(e){var t=ee("wks"),r=g.Symbol,n="function"==typeof r;(e.exports=function(e){return t[e]||(t[e]=n&&r[e]||(n?r:ne)("Symbol."+e))}).store=t})),xe=A.f,be=me("toStringTag"),ke=function(e,t,r){e&&!D(e=r?e:e.prototype,be)&&xe(e,be,{configurable:!0,value:t})},_e={};L(_e,me("iterator"),(function(){return this}));var we=function(e){return Object(H(e))},Ee=ae("IE_PROTO"),Te=Object.prototype,Se=Object.getPrototypeOf||function(e){return e=we(e),D(e,Ee)?e[Ee]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?Te:null},Oe=me("iterator"),Re=!([].keys&&"next"in[].keys()),Ae=function(){return this},Pe=function(e,t,r,n,i,a,o){!function(e,t,r){e.prototype=ve(_e,{next:P(1,r)}),ke(e,t+" Iterator")}(r,t,n);var s,l,u,c=function(e){if(!Re&&e in h)return h[e];switch(e){case"keys":case"values":return function(){return new r(this,e)}}return function(){return new r(this,e)}},d=t+" Iterator",f="values"==i,p=!1,h=e.prototype,g=h[Oe]||h["@@iterator"]||i&&h[i],y=g||c(i),v=i?f?c("entries"):y:void 0,m="Array"==t&&h.entries||g;if(m&&(u=Se(m.call(new e)))!==Object.prototype&&u.next&&ke(u,d,!0),f&&g&&"values"!==g.name&&(p=!0,y=function(){return g.call(this)}),o&&(Re||p||!h[Oe])&&L(h,Oe,y),q[t]=y,q[d]=Ae,i)if(s={values:f?y:c("values"),keys:a?y:c("keys"),entries:v},o)for(l in s)l in h||K(h,l,s[l]);else M(M.P+M.F*(Re||p),t,s);return s},Le=function(e,t){var r,n,i=String(H(e)),a=z(t),o=i.length;return a<0||a>=o?"":(r=i.charCodeAt(a))<55296||r>56319||a+1===o||(n=i.charCodeAt(a+1))<56320||n>57343?i.charAt(a):i.slice(a,a+2)};Pe(String,"String",(function(e){this._t=String(e),this._i=0}),(function(){var e,t=this._t,r=this._i;return r>=t.length?{value:void 0,done:!0}:(e=Le(t,r),this._i+=e.length,{value:e,done:!1})}));var Ce=function(e,t){return{value:t,done:!!e}};Pe(Array,"Array",(function(e,t){this._t=X(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,r=this._i++;return!e||r>=e.length?(this._t=void 0,Ce(1)):Ce(0,"keys"==t?r:"values"==t?e[r]:[r,e[r]])}),"values"),q.Arguments=q.Array;for(var De=me("toStringTag"),Ie="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),Me=0;Me<Ie.length;Me++){var Fe=Ie[Me],Ne=g[Fe],Be=Ne&&Ne.prototype;Be&&!Be[De]&&L(Be,De,Fe),q[Fe]=q.Array}var je,Ue,Ge,ze=me("toStringTag"),He="Arguments"==W(function(){return arguments}()),Ke=function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),ze))?r:He?W(t):"Object"==(n=W(t))&&"function"==typeof t.callee?"Arguments":n},qe=function(e,t,r,n){try{return n?t(b(r)[0],r[1]):t(r)}catch(t){var i=e.return;throw void 0!==i&&b(i.call(e)),t}},Ve=me("iterator"),We=Array.prototype,Ye=me("iterator"),Xe=y.getIteratorMethod=function(e){if(null!=e)return e[Ye]||e["@@iterator"]||q[Ke(e)]},$e=t((function(e){var t={},r={},n=e.exports=function(e,n,i,a,o){var s,l,u,c,d=o?function(){return e}:Xe(e),f=m(i,a,n?2:1),p=0;if("function"!=typeof d)throw TypeError(e+" is not iterable!");if(function(e){return void 0!==e&&(q.Array===e||We[Ve]===e)}(d)){for(s=J(e.length);s>p;p++)if((c=n?f(b(l=e[p])[0],l[1]):f(e[p]))===t||c===r)return c}else for(u=d.call(e);!(l=u.next()).done;)if((c=qe(u,f,l.value,n))===t||c===r)return c};n.BREAK=t,n.RETURN=r})),Je=me("species"),Qe=function(e,t){var r,n=b(e).constructor;return void 0===n||null==(r=b(n)[Je])?t:v(r)},Ze=function(e,t,r){var n=void 0===r;switch(t.length){case 0:return n?e():e.call(r);case 1:return n?e(t[0]):e.call(r,t[0]);case 2:return n?e(t[0],t[1]):e.call(r,t[0],t[1]);case 3:return n?e(t[0],t[1],t[2]):e.call(r,t[0],t[1],t[2]);case 4:return n?e(t[0],t[1],t[2],t[3]):e.call(r,t[0],t[1],t[2],t[3])}return e.apply(r,t)},et=g.process,tt=g.setImmediate,rt=g.clearImmediate,nt=g.MessageChannel,it=g.Dispatch,at=0,ot={},st=function(){var e=+this;if(ot.hasOwnProperty(e)){var t=ot[e];delete ot[e],t()}},lt=function(e){st.call(e.data)};tt&&rt||(tt=function(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return ot[++at]=function(){Ze("function"==typeof e?e:Function(e),t)},je(at),at},rt=function(e){delete ot[e]},"process"==W(et)?je=function(e){et.nextTick(m(st,e,1))}:it&&it.now?je=function(e){it.now(m(st,e,1))}:nt?(Ge=(Ue=new nt).port2,Ue.port1.onmessage=lt,je=m(Ge.postMessage,Ge,1)):g.addEventListener&&"function"==typeof postMessage&&!g.importScripts?(je=function(e){g.postMessage(e+"","*")},g.addEventListener("message",lt,!1)):je="onreadystatechange"in T("script")?function(e){pe.appendChild(T("script")).onreadystatechange=function(){pe.removeChild(this),st.call(e)}}:function(e){setTimeout(m(st,e,1),0)});var ut={set:tt,clear:rt},ct=ut.set,dt=g.MutationObserver||g.WebKitMutationObserver,ft=g.process,pt=g.Promise,ht="process"==W(ft),gt={f:function(e){return new r(e)}},yt=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}},vt=g.navigator,mt=vt&&vt.userAgent||"",xt=function(e,t){if(b(e),x(t)&&t.constructor===e)return t;var r=gt.f(e);return(0,r.resolve)(t),r.promise},bt=me("species"),kt=me("iterator"),_t=!1;try{var wt=[7][kt]();wt.return=function(){_t=!0},Array.from(wt,(function(){throw 2}))}catch(e){}var Et,Tt,St,Ot,Rt=ut.set,At=function(){var e,t,r,n=function(){var n,i;for(ht&&(n=ft.domain)&&n.exit();e;){i=e.fn,e=e.next;try{i()}catch(n){throw e?r():t=void 0,n}}t=void 0,n&&n.enter()};if(ht)r=function(){ft.nextTick(n)};else if(!dt||g.navigator&&g.navigator.standalone)if(pt&&pt.resolve){var i=pt.resolve(void 0);r=function(){i.then(n)}}else r=function(){ct.call(g,n)};else{var a=!0,o=document.createTextNode("");new dt(n).observe(o,{characterData:!0}),r=function(){o.data=a=!a}}return function(n){var i={fn:n,next:void 0};t&&(t.next=i),e||(e=i,r()),t=i}}(),Pt=g.TypeError,Lt=g.process,Ct=Lt&&Lt.versions,Dt=Ct&&Ct.v8||"",It=g.Promise,Mt="process"==Ke(Lt),Ft=function(){},Nt=Tt=gt.f,Bt=!!function(){try{var e=It.resolve(1),t=(e.constructor={})[me("species")]=function(e){e(Ft,Ft)};return(Mt||"function"==typeof PromiseRejectionEvent)&&e.then(Ft)instanceof t&&0!==Dt.indexOf("6.6")&&-1===mt.indexOf("Chrome/66")}catch(e){}}(),jt=function(e){var t;return!(!x(e)||"function"!=typeof(t=e.then))&&t},Ut=function(e,t){if(!e._n){e._n=!0;var r=e._c;At((function(){for(var n=e._v,i=1==e._s,a=0;r.length>a;)!function(t){var r,a,o,s=i?t.ok:t.fail,l=t.resolve,u=t.reject,c=t.domain;try{s?(i||(2==e._h&&Ht(e),e._h=1),!0===s?r=n:(c&&c.enter(),r=s(n),c&&(c.exit(),o=!0)),r===t.promise?u(Pt("Promise-chain cycle")):(a=jt(r))?a.call(r,l,u):l(r)):u(n)}catch(e){c&&!o&&c.exit(),u(e)}}(r[a++]);e._c=[],e._n=!1,t&&!e._h&&Gt(e)}))}},Gt=function(e){Rt.call(g,(function(){var t,r,n,i=e._v,a=zt(e);if(a&&(t=yt((function(){Mt?Lt.emit("unhandledRejection",i,e):(r=g.onunhandledrejection)?r({promise:e,reason:i}):(n=g.console)&&n.error&&n.error("Unhandled promise rejection",i)})),e._h=Mt||zt(e)?2:1),e._a=void 0,a&&t.e)throw t.v}))},zt=function(e){return 1!==e._h&&0===(e._a||e._c).length},Ht=function(e){Rt.call(g,(function(){var t;Mt?Lt.emit("rejectionHandled",e):(t=g.onrejectionhandled)&&t({promise:e,reason:e._v})}))},Kt=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),Ut(t,!0))},qt=function e(t){var r,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw Pt("Promise can't be resolved itself");(r=jt(t))?At((function(){var i={_w:n,_d:!1};try{r.call(t,m(e,i,1),m(Kt,i,1))}catch(e){Kt.call(i,e)}})):(n._v=t,n._s=1,Ut(n,!1))}catch(t){Kt.call({_w:n,_d:!1},t)}}};Bt||(It=function(e){(function(e,t,r,n){if(!(e instanceof t)||void 0!==n&&n in e)throw TypeError(r+": incorrect invocation!")})(this,It,"Promise","_h"),v(e),Et.call(this);try{e(m(qt,this,1),m(Kt,this,1))}catch(e){Kt.call(this,e)}},(Et=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=function(e,t,r){for(var n in t)L(e,n,t[n]);return e}(It.prototype,{then:function(e,t){var r=Nt(Qe(this,It));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=Mt?Lt.domain:void 0,this._c.push(r),this._a&&this._a.push(r),this._s&&Ut(this,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),St=function(){var e=new Et;this.promise=e,this.resolve=m(qt,e,1),this.reject=m(Kt,e,1)},gt.f=Nt=function(e){return e===It||e===Ot?new St(e):Tt(e)}),M(M.G+M.W+M.F*!Bt,{Promise:It}),ke(It,"Promise"),function(e){var t="function"==typeof y[e]?y[e]:g[e];_&&t&&!t[bt]&&A.f(t,bt,{configurable:!0,get:function(){return this}})}("Promise"),Ot=y.Promise,M(M.S+M.F*!Bt,"Promise",{reject:function(e){var t=Nt(this);return(0,t.reject)(e),t.promise}}),M(M.S+!0*M.F,"Promise",{resolve:function(e){return xt(this===Ot?It:this,e)}}),M(M.S+M.F*!(Bt&&function(e,t){if(!_t)return!1;var r=!1;try{var n=[7],i=n[kt]();i.next=function(){return{done:r=!0}},n[kt]=function(){return i},function(e){It.all(e).catch(Ft)}(n)}catch(e){}return r}()),"Promise",{all:function(e){var t=this,r=Nt(t),n=r.resolve,i=r.reject,a=yt((function(){var r=[],a=0,o=1;$e(e,!1,(function(e){var s=a++,l=!1;r.push(void 0),o++,t.resolve(e).then((function(e){l||(l=!0,r[s]=e,--o||n(r))}),i)})),--o||n(r)}));return a.e&&i(a.v),r.promise},race:function(e){var t=this,r=Nt(t),n=r.reject,i=yt((function(){$e(e,!1,(function(e){t.resolve(e).then(r.resolve,n)}))}));return i.e&&n(i.v),r.promise}}),M(M.P+M.R,"Promise",{finally:function(e){var t=Qe(this,y.Promise||g.Promise),r="function"==typeof e;return this.then(r?function(r){return xt(t,e()).then((function(){return r}))}:e,r?function(r){return xt(t,e()).then((function(){throw r}))}:e)}}),M(M.S,"Promise",{try:function(e){var t=gt.f(this),r=yt(e);return(r.e?t.reject:t.resolve)(r.v),t.promise}});var Vt=y.Promise,Wt=e(t((function(e){e.exports={default:Vt,__esModule:!0}})));!function(e,t){var r=(y.Object||{})[e]||Object[e],n={keys:function(e){return ce(we(e))}};M(M.S+M.F*k((function(){r(1)})),"Object",n)}("keys");var Yt=y.Object.keys,Xt=e(t((function(e){e.exports={default:Yt,__esModule:!0}}))),$t=function(e){return null!=e},Jt={object:!0,function:!0,undefined:!0},Qt=function(e){if(!function(e){return!!$t(e)&&hasOwnProperty.call(Jt,void 0===e?"undefined":a(e))}(e))return!1;try{return!!e.constructor&&e.constructor.prototype===e}catch(e){return!1}},Zt=/^\s*class[\s{/}]/,er=Function.prototype.toString,tr=function(e){return!!function(e){if("function"!=typeof e)return!1;if(!hasOwnProperty.call(e,"length"))return!1;try{if("number"!=typeof e.length)return!1;if("function"!=typeof e.call)return!1;if("function"!=typeof e.apply)return!1}catch(e){return!1}return!Qt(e)}(e)&&!Zt.test(er.call(e))},rr=function(e){return null!=e},nr=Object.keys,ir=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}()?Object.keys:function(e){return nr(rr(e)?Object(e):e)},ar=function(e){if(!rr(e))throw new TypeError("Cannot use null or undefined");return e},or=Math.max,sr=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}()?Object.assign:function(e,t){var r,n,i,a=or(arguments.length,2);for(e=Object(ar(e)),i=function(n){try{e[n]=t[n]}catch(e){r||(r=e)}},n=1;n<a;++n)ir(t=arguments[n]).forEach(i);if(void 0!==r)throw r;return e},lr=Array.prototype.forEach,ur=Object.create,cr=function(e,t){var r;for(r in e)t[r]=e[r]},dr=function(e){var t=ur(null);return lr.call(arguments,(function(e){rr(e)&&cr(Object(e),t)})),t},fr="razdwatrzy",pr=String.prototype.indexOf,hr="function"==typeof fr.contains&&!0===fr.contains("dwa")&&!1===fr.contains("foo")?String.prototype.contains:function(e){return pr.call(this,e,arguments[1])>-1},gr=t((function(e){(e.exports=function(e,t){var r,n,i,a,o;return arguments.length<2||"string"!=typeof e?(a=t,t=e,e=null):a=arguments[2],$t(e)?(r=hr.call(e,"c"),n=hr.call(e,"e"),i=hr.call(e,"w")):(r=i=!0,n=!1),o={value:t,configurable:r,enumerable:n,writable:i},a?sr(dr(a),o):o}).gs=function(e,t,r){var n,i,a,o;return"string"!=typeof e?(a=r,r=t,t=e,e=null):a=arguments[3],$t(t)?tr(t)?$t(r)?tr(r)||(a=r,r=void 0):r=void 0:(a=t,t=r=void 0):t=void 0,$t(e)?(n=hr.call(e,"c"),i=hr.call(e,"e")):(n=!0,i=!1),o={get:t,set:r,configurable:n,enumerable:i},a?sr(dr(a),o):o}})),yr=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e},vr=t((function(e,t){var r,n,i,o,s,l,u,c=Function.prototype.apply,d=Function.prototype.call,f=Object.create,p=Object.defineProperty,h=Object.defineProperties,g=Object.prototype.hasOwnProperty,y={configurable:!0,enumerable:!1,writable:!0};s={on:r=function(e,t){var r;return yr(t),g.call(this,"__ee__")?r=this.__ee__:(r=y.value=f(null),p(this,"__ee__",y),y.value=null),r[e]?"object"==a(r[e])?r[e].push(t):r[e]=[r[e],t]:r[e]=t,this},once:n=function(e,t){var n,a;return yr(t),a=this,r.call(this,e,n=function(){i.call(a,e,n),c.call(t,this,arguments)}),n.__eeOnceListener__=t,this},off:i=function(e,t){var r,n,i,o;if(yr(t),!g.call(this,"__ee__"))return this;if(!(r=this.__ee__)[e])return this;if("object"==a(n=r[e]))for(o=0;i=n[o];++o)i!==t&&i.__eeOnceListener__!==t||(2===n.length?r[e]=n[o?0:1]:n.splice(o,1));else n!==t&&n.__eeOnceListener__!==t||delete r[e];return this},emit:o=function(e){var t,r,n,i,o;if(g.call(this,"__ee__")&&(i=this.__ee__[e]))if("object"==(void 0===i?"undefined":a(i))){for(r=arguments.length,o=new Array(r-1),t=1;t<r;++t)o[t-1]=arguments[t];for(i=i.slice(),t=0;n=i[t];++t)c.call(n,this,o)}else switch(arguments.length){case 1:d.call(i,this);break;case 2:d.call(i,this,arguments[1]);break;case 3:d.call(i,this,arguments[1],arguments[2]);break;default:for(r=arguments.length,o=new Array(r-1),t=1;t<r;++t)o[t-1]=arguments[t];c.call(i,this,o)}}},l={on:gr(r),once:gr(n),off:gr(i),emit:gr(o)},u=h({},l),e.exports=t=function(e){return null==e?f(u):h(Object(e),l)},t.methods=s})),mr=(vr.methods,function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.url,n=t.method,i=void 0===n?"GET":n,a=t.type,o=void 0===a?"arraybuffer":a,s=t.timeout,l=void 0===s?1e4:s,u=t.data,c=void 0===u?{}:u,d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h(this,e),new Wt((function(e,t){var n=new window.XMLHttpRequest,a=i.toUpperCase(),s=[];for(var u in o&&(n.responseType=o),l&&(n.timeout=l),c)s.push("k="+c[u]);if(n.onload=function(){200===n.status||206===n.status?e({context:d,res:n}):t({context:d,res:n,type:"error"})},n.onerror=function(e){t({context:d,res:n,type:"error"})},n.ontimeout=function(e){t({context:d,res:n,type:"error"})},n.onabort=function(){t({context:d,res:n,type:"error"})},"GET"===a)n.open(a,""+r),n.send();else{if("post"!==a)throw new Error("xhr "+a+" is not supported");n.open(a,r),n.setRequestHeader("Content-type","application/x-www-form-urlencoded"),n.send(s.join("&"))}}))}),xr=/^WEBVTT/,br=/^STYLE+$/,kr=/^\:\:cue/,_r=/^}+$/,wr=/^\[Script Info\].*/,Er=[/[0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{3}-->[0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{3}/,/[0-9]{2}:[0-9]{2}\.[0-9]{3}-->[0-9]{2}:[0-9]{2}\.[0-9]{3}/,/[0-9]{2}\.[0-9]{3}-->[0-9]{2}\.[0-9]{3}/],Tr=/<?.+?>(([\s\S])*?)<\/?.+?>/,Sr=/^Format:\s/,Or=/^Style:\s/,Rr=/^Dialogue:\s/,Ar=function(){function e(){h(this,e)}return j(e,null,[{key:"parse",value:function(t,r){var n=e.checkFormat(t);n||r({format:n});try{var i=[];"ass"===n?i=e.parseASS(t):"vtt"===n&&(i=e.parseVTT(t)),r({format:n,list:i.list,style:i.style})}catch(e){r({format:n},e)}}},{key:"parseASSItem",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=e.split(","),i={},a="";try{var s=r.length-t.length;return a=o(a=(a=s>0?r.splice(t.length-1,s+1).join(",")+"":r[r.length-1]+"").replace(/\\n+/g,"")),r[t.length-1]=a,t.map((function(e,t){"end"===e||"start"===e?i[e]=n(r[t].split(":")):"text"===e?i[e]=[r[t]]:"layer"===e?(i[e]=[r[t]],i.textTag=[r[t]]):i[e]="style"===e?[r[t]]:Number(r[t])?Number(r[t]):r[t]})),i}catch(e){return console.error(e),{}}}},{key:"parseASS",value:function(t){for(var r=t.split("\n"),n=[],i=0,a=0,o=[],s=[],l=null;i<r.length;){if(Sr.test(r[i]))s=(s=r[i].replace(Sr,"").replace(/\s+/g,"").split(",")).map((function(e){return e.toLocaleLowerCase()}));else if(Or.test(r[i]))o.push(r[i].replace(Or,"").replace(/\s+/g,""));else if(Rr.test(r[i])){var u=e.parseASSItem(r[i].replace(Rr,""),s);if(l&&u.start===l.start&&u.end===l.end)try{var c=l,d=c.text,f=c.textTag,p=c.style;d.push(u.text[0]),f.push(u.textTag[0]),p.push(u.style[0])}catch(e){console.error(e)}else{l=u;var h=null;a%50==0?((h={start:l.start,end:l.end,list:[]}).list.push(l),n.push(h)):((h=n[n.length-1]).end=l.end,h.list.push(l)),a++}}i++}return{list:n,style:{}}}},{key:"parseVTTStyle",value:function(e,t){var r=e.split(":");if(r.length>1){var n=r[0].trim().split("-"),i="";n.length>1?n.map((function(e,t){i+=0===t?e:e.charAt(0).toUpperCase()+e.slice(1)})):i=n[0],t[i]=r[1].trim().replace(/;$/,"")}return t}},{key:"parseVTT",value:function(e){for(var t=(e=e.replace(xr,"")).split("\n"),r=[],n=0,a=0,o=null,l=null,u=!1,c=!1,d={};n<t.length;){var f=s(n,t).trim();if(!f||u&&i(f))u=!f;else if(kr.test(f)&&br.test(s(n-1,t).trim()))c=!0;else if(c)_r.test(f)?c=!1:this.parseVTTStyle(f,d);else if(f){u=!1;var p=this.checkIsTime(t[n]);if(p){var h=this.parseVttTime(p);if(!o||h.start!==o.start||h.end!==o.end){(o=h).text=[],o.textTag=[];var g=null;a%50==0?((g={start:o.start,end:o.end,list:[]}).list.push(o),r.push(g)):((g=r[r.length-1]).end=o.end,g.list.push(o)),a++}}else if(o){var y=o,v=y.text,m=y.textTag,x=this.parseVttText(t[n]);0===m.length||l||x.tag&&x.tag!==m[m.length-1]?(v.push(x.text),m.push(x.tag)):v[m.length-1]+=x.text}l=p,u=!1}n++}return{list:r,style:d}}},{key:"checkIsTime",value:function(e){e=e.replace(/\s+/g,"");for(var t=0,r=null;t<Er.length&&!(r=Er[t].exec(e));)t++;return r?r[0]:null}},{key:"parseVttText",value:function(e){var t=Tr.exec(e);return t?{tag:/<?.+?>/gi.exec(e)[0].replace(/\<|\>|\&/g,""),text:o(t[1].replace(/\\n+/g,""))}:{tag:"default",text:o(e.replace(/\\n+/g,""))}}},{key:"parseVttTime",value:function(e){var t=e.split("--\x3e"),r=void 0,i=0;if(t.length=2){var a=t[0].split(":"),o=t[1].split(":");r=n(a),i=n(o)}return{start:r,end:i,time:e}}},{key:"isVTT",value:function(e){return xr.test(e)}},{key:"isASS",value:function(e){return wr.test(e)}},{key:"checkFormat",value:function(e){return e?xr.test(e)?"vtt":wr.test(e)?"ass":null:null}}]),e}(),Pr={f:me},Lr=Pr.f("iterator"),Cr=t((function(e){e.exports={default:Lr,__esModule:!0}}));e(Cr);var Dr=t((function(e){var t=ne("meta"),r=A.f,n=0,i=Object.isExtensible||function(){return!0},o=!k((function(){return i(Object.preventExtensions({}))})),s=function(e){r(e,t,{value:{i:"O"+ ++n,w:{}}})},l=e.exports={KEY:t,NEED:!1,fastKey:function(e,r){if(!x(e))return"symbol"==(void 0===e?"undefined":a(e))?e:("string"==typeof e?"S":"P")+e;if(!D(e,t)){if(!i(e))return"F";if(!r)return"E";s(e)}return e[t].i},getWeak:function(e,r){if(!D(e,t)){if(!i(e))return!0;if(!r)return!1;s(e)}return e[t].w},onFreeze:function(e){return o&&l.NEED&&i(e)&&!D(e,t)&&s(e),e}}})),Ir=(Dr.KEY,Dr.NEED,Dr.fastKey,Dr.getWeak,Dr.onFreeze,A.f),Mr=function(e){var t=y.Symbol||(y.Symbol={});"_"==e.charAt(0)||e in t||Ir(t,e,{value:Pr.f(e)})},Fr={f:Object.getOwnPropertySymbols},Nr={f:{}.propertyIsEnumerable},Br=Array.isArray||function(e){return"Array"==W(e)},jr=ue.concat("length","prototype"),Ur={f:Object.getOwnPropertyNames||function(e){return le(e,jr)}},Gr=Ur.f,zr={}.toString,Hr="object"==("undefined"==typeof window?"undefined":a(window))&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Kr={f:function(e){return Hr&&"[object Window]"==zr.call(e)?function(e){try{return Gr(e)}catch(e){return Hr.slice()}}(e):Gr(X(e))}},qr=Object.getOwnPropertyDescriptor,Vr={f:_?qr:function(e,t){if(e=X(e),t=O(t,!0),S)try{return qr(e,t)}catch(e){}if(D(e,t))return P(!Nr.f.call(e,t),e[t])}},Wr=Dr.KEY,Yr=Vr.f,Xr=A.f,$r=Kr.f,Jr=g.Symbol,Qr=g.JSON,Zr=Qr&&Qr.stringify,en=me("_hidden"),tn=me("toPrimitive"),rn={}.propertyIsEnumerable,nn=ee("symbol-registry"),an=ee("symbols"),on=ee("op-symbols"),sn=Object.prototype,ln="function"==typeof Jr&&!!Fr.f,un=g.QObject,cn=!un||!un.prototype||!un.prototype.findChild,dn=_&&k((function(){return 7!=ve(Xr({},"a",{get:function(){return Xr(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=Yr(sn,t);n&&delete sn[t],Xr(e,t,r),n&&e!==sn&&Xr(sn,t,n)}:Xr,fn=function(e){var t=an[e]=ve(Jr.prototype);return t._k=e,t},pn=ln&&"symbol"==a(Jr.iterator)?function(e){return"symbol"==(void 0===e?"undefined":a(e))}:function(e){return e instanceof Jr},hn=function e(t,r,n){return t===sn&&e(on,r,n),b(t),r=O(r,!0),b(n),D(an,r)?(n.enumerable?(D(t,en)&&t[en][r]&&(t[en][r]=!1),n=ve(n,{enumerable:P(0,!1)})):(D(t,en)||Xr(t,en,P(1,{})),t[en][r]=!0),dn(t,r,n)):Xr(t,r,n)},gn=function(e,t){b(e);for(var r,n=function(e){var t=ce(e),r=Fr.f;if(r)for(var n,i=r(e),a=Nr.f,o=0;i.length>o;)a.call(e,n=i[o++])&&t.push(n);return t}(t=X(t)),i=0,a=n.length;a>i;)hn(e,r=n[i++],t[r]);return e},yn=function(e,t){if(e=X(e),t=O(t,!0),e!==sn||!D(an,t)||D(on,t)){var r=Yr(e,t);return!r||!D(an,t)||D(e,en)&&e[en][t]||(r.enumerable=!0),r}},vn=function(e){for(var t,r=$r(X(e)),n=[],i=0;r.length>i;)D(an,t=r[i++])||t==en||t==Wr||n.push(t);return n},mn=function(e){for(var t,r=e===sn,n=$r(r?on:X(e)),i=[],a=0;n.length>a;)!D(an,t=n[a++])||r&&!D(sn,t)||i.push(an[t]);return i};ln||(K((Jr=function(){if(this instanceof Jr)throw TypeError("Symbol is not a constructor!");var e=ne(arguments.length>0?arguments[0]:void 0),t=function t(r){this===sn&&t.call(on,r),D(this,en)&&D(this[en],e)&&(this[en][e]=!1),dn(this,e,P(1,r))};return _&&cn&&dn(sn,e,{configurable:!0,set:t}),fn(e)}).prototype,"toString",(function(){return this._k})),Vr.f=yn,A.f=hn,Ur.f=Kr.f=vn,Nr.f=function(e){var t=rn.call(this,e=O(e,!0));return!(this===sn&&D(an,e)&&!D(on,e))&&(!(t||!D(this,e)||!D(an,e)||D(this,en)&&this[en][e])||t)},Fr.f=mn,Pr.f=function(e){return fn(me(e))}),M(M.G+M.W+M.F*!ln,{Symbol:Jr});for(var xn="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),bn=0;xn.length>bn;)me(xn[bn++]);for(var kn=ce(me.store),_n=0;kn.length>_n;)Mr(kn[_n++]);M(M.S+M.F*!ln,"Symbol",{for:function(e){return D(nn,e+="")?nn[e]:nn[e]=Jr(e)},keyFor:function(e){if(!pn(e))throw TypeError(e+" is not a symbol!");for(var t in nn)if(nn[t]===e)return t},useSetter:function(){cn=!0},useSimple:function(){cn=!1}}),M(M.S+M.F*!ln,"Object",{create:function(e,t){return void 0===t?ve(e):gn(ve(e),t)},defineProperty:hn,defineProperties:gn,getOwnPropertyDescriptor:yn,getOwnPropertyNames:vn,getOwnPropertySymbols:mn});var wn=k((function(){Fr.f(1)}));M(M.S+M.F*wn,"Object",{getOwnPropertySymbols:function(e){return Fr.f(we(e))}}),Qr&&M(M.S+M.F*(!ln||k((function(){var e=Jr();return"[null]"!=Zr([e])||"{}"!=Zr({a:e})||"{}"!=Zr(Object(e))}))),"JSON",{stringify:function(e){for(var t,r,n=[e],i=1;arguments.length>i;)n.push(arguments[i++]);if(r=t=n[1],(x(t)||void 0!==e)&&!pn(e))return Br(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!pn(t))return t}),n[1]=t,Zr.apply(Qr,n)}}),Jr.prototype[tn]||L(Jr.prototype,tn,Jr.prototype.valueOf),ke(Jr,"Symbol"),ke(Math,"Math",!0),ke(g.JSON,"JSON",!0),Mr("asyncIterator"),Mr("observable");var En=y.Symbol,Tn=t((function(e){e.exports={default:En,__esModule:!0}}));e(Tn);var Sn=e(t((function(e,t){function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var n=r(Cr),i=r(Tn),o="function"==typeof i.default&&"symbol"==a(n.default)?function(e){return void 0===e?"undefined":a(e)}:function(e){return e&&"function"==typeof i.default&&e.constructor===i.default&&e!==i.default.prototype?"symbol":void 0===e?"undefined":a(e)};t.default="function"==typeof i.default&&"symbol"===o(n.default)?function(e){return void 0===e?"undefined":o(e)}:function(e){return e&&"function"==typeof i.default&&e.constructor===i.default&&e!==i.default.prototype?"symbol":void 0===e?"undefined":o(e)}}))),On=new(function(){function e(){var t=this;h(this,e),this.__handlers=[],window.ResizeObserver&&(this.observer=new window.ResizeObserver((function(e){(new Date).getTime(),t.__trigger(e)})))}return j(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer&&this.observer.observe(e);for(var r=this.__handlers,n=-1,i=0;i<r.length;i++)r[i]&&e===r[i].target&&(n=i);n>-1?this.__handlers[n].handler.push(t):this.__handlers.push({target:e,handler:[t]})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(r,n){e===r.target&&(t=n)})),this.observer&&this.observer.unobserve(e),t>-1&&this.__handlers.splice(t,1)}},{key:"destroyObserver",value:function(){this.observer&&this.observer.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(e,t){for(var r=this.__handlers,n=0;n<r.length;n++)if(r[n]&&e===r[n].target){r[n].handler&&r[n].handler.map((function(r){try{r(e,t)}catch(e){console.error(e)}}));break}}},{key:"__trigger",value:function(e){var t=this;e.map((function(e){var r=e.contentRect;t.__runHandler(e.target,r)}))}}]),e}());!function(e,t){void 0===t&&(t={});var r=t.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===r&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}('.xgplayer xg-text-track {\n  font-family: "PingFang SC","SF Pro SC","SF Pro Text","SF Pro Icons","Helvetica Neue","Helvetica","Arial",sans-serif;\n  -webkit-font-smoothing: antialiased;\n  position: absolute;\n  bottom: 0;\n  color: #fff;\n  left: 0;\n  right: 0;\n  pointer-events: none; }\n  .xgplayer xg-text-track.text-track-no-fitvideo {\n    margin-bottom: 2%; }\n  .xgplayer xg-text-track.text-track-hide {\n    opacity: 0;\n    visibility: hidden; }\n  .xgplayer xg-text-track.text-track-show {\n    opacity: 1;\n    visibility: visible; }\n  .xgplayer xg-text-track xg-text-track-inner {\n    display: block;\n    position: relative;\n    left: 50%;\n    -webkit-transform: translateX(-50%);\n            transform: translateX(-50%);\n    max-width: 92%; }\n  .xgplayer xg-text-track xg-text-track-span {\n    display: -webkit-box;\n    text-align: center;\n    text-overflow: ellipsis;\n    -webkit-box-orient: vertical;\n    overflow: hidden;\n    padding: 1px 4px;\n    -webkit-line-clamp: 1;\n    line-height: 120%;\n    word-break: break-all; }\n    .xgplayer xg-text-track xg-text-track-span.text-track-deputy {\n      font-size: 76%; }\n    .xgplayer xg-text-track xg-text-track-span.text-track-single {\n      -webkit-line-clamp: 1; }\n    .xgplayer xg-text-track xg-text-track-span.text-track-double {\n      -webkit-line-clamp: 2; }\n    .xgplayer xg-text-track xg-text-track-span.text-track-three {\n      -webkit-line-clamp: 3; }\n  .xgplayer xg-text-track.text-track-bg xg-text-track-span {\n    background-color: rgba(0, 0, 0, .54);\n    border-radius: 2px; }\n  .xgplayer xg-text-track.text-track-stroke xg-text-track-inner {\n    background-color: none;\n    border-radius: 0;\n    text-shadow: -1px 1px 0 rgba(0, 0, 0, .7), 1px 1px 0 rgba(0, 0, 0, .7), 1px -1px 0 rgba(0, 0, 0, .7), -1px -1px 0 rgba(0, 0, 0, .7); }\n');var Rn=[{code:0,msg:"SUCCESS"},{code:1,msg:"LOAD_ERROR"},{code:2,msg:"PARSER_ERROR"},{code:3,msg:"FORMAT_NOT_SUPPORTED"},{code:4,msg:"ID_OR_LANGUAGE_NOT_EXIST"},{code:5,msg:"PARAMETERS_ERROR"},{code:6,msg:"ABORT"},{code:7,msg:"UNKNOWN"}],An="resize",Pn=function(){var e=navigator.userAgent,t=/(?:Windows Phone)/.test(e),r=/(?:SymbianOS)/.test(e)||t,n=/(?:Android)/.test(e),i=/(?:Firefox)/.test(e),a=/(?:iPad|PlayBook)/.test(e)||n&&!/(?:Mobile)/.test(e)||i&&/(?:Tablet)/.test(e);return/(?:iPhone)/.test(e)&&!a||n||r||a}();return function(){function e(t){var r=this;h(this,e),vr(this),this.currentText=null,this.textTrack=[],this._cid=-1,this._gid=-1,this._iId=null,this._iC=0,this.player=null,this.root=null,this.config={line:"double",bottom:0,mode:"stroke",defaultOpen:!1,baseSizeX:49,baseSizeY:28,minSize:16,minMobileSize:13,fitVideo:!0,offsetBottom:2,fontColor:"#fff"},this._loadingTrack={},Xt(this.config).map((function(e){void 0!==t[e]&&null!==t[e]&&(r.config[e]=t[e])})),this._isOpen=this.config.defaultOpen||!1,this._videoMeta={scale:0,videoHeight:0,videoWidth:0,lwidth:0,lheight:0,vWidth:0,vHeight:0,vBottom:0,vLeft:0,marginBottom:0},t.subTitles&&"Array"===function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]}(t.subTitles)&&(t.subTitles.map((function(e){var t={};Xt(e).map((function(r){t[r]=e[r]})),r.textTrack.push(t)})),1===this.textTrack.length?this.currentText=this.textTrack[0]:this.textTrack.map((function(e){e.isDefault&&(r.currentText=e)})),t.player&&this.attachPlayer(t.player),f(this.currentText).then((function(){})))}return j(e,[{key:"attachPlayer",value:function(e){var t=this;if(e){this.player&&this.detachPlayer();var r=this.config,n=r.fontColor,i=r.mode,a=r.fitVideo;this.player=e,this.root=document.createElement("xg-text-track"),!this._isOpen&&u(this.root,"text-track-hide"),!a&&u(this.root,"text-track-no-fitvideo"),i&&u(this.root,"text-track-"+i),this.innerRoot=document.createElement("xg-text-track-inner"),this.root.appendChild(this.innerRoot),n&&(this.root.style.color=n),["language","id","label"].map((function(e){t.root.setAttribute("data-"+e,t.currentText[e]||"")})),this.player.root.appendChild(this.root),["destroy","__onTimeupdate","_onResize"].map((function(e){t[e]=t[e].bind(t)})),this.player.on("destroy",this.destroy),this.player.on("timeupdate",this.__onTimeupdate),function(e,t){On.addObserver(e,t)}(e.root,this._onResize)}}},{key:"detachPlayer",value:function(){var e=this.player;e&&(e.off("destroy",this.destroy),e.off("timeupdate",this.__onTimeupdate),e.root&&(function(e,t){On.unObserver(e,t)}(e.root,this._onResize),e.root.removeChild(this.root)),this.innerRoot=null,this.root=null,this.player=null)}},{key:"switch",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:"",language:""};return this._loadingTrack=t,new Wt((function(r,n){if(t.id||t.language||(e.currentText?(e._loadingTrack={},e._updateCurrent(e.currentText),e._isOpen=!0,e.show(),r(d(0,{message:"switch default subtitle success"}))):n(d(5,{message:"no default subtitle"}))),p(t,e.currentText))e._loadingTrack={},e._updateCurrent(e.currentText),e._isOpen=!0,e.show(),r(d(0));else{for(var i=null,a=0;a<e.textTrack.length;a++)if(p(t,e.textTrack[a])){i=e.textTrack[a];break}i?i.list?(e._loadingTrack={},e._updateCurrent(i),e._isOpen=!0,e.show(),r(d(0))):f(i).then((function(){e._loadingTrack.id===i.id||e._loadingTrack.language===i.language?(e._loadingTrack={},e._updateCurrent(i),e._isOpen=!0,e.show(),r(d(0))):n(d(6,{message:"check _loadingTrack fail id: "+e._loadingTrack.id+"  nextSubtitle:"+i.id}))})).catch((function(e){n(e)})):n(d(4,new Error("The is no subtitle with id:[{"+t.id+"}] or language:["+t.language+"]")))}}))}},{key:"switchOff",value:function(){this._isOpen=!1,this.hide()}},{key:"_updateCurrent",value:function(e){var t=this;this.currentText=e,["language","id","label"].map((function(e){t.root.setAttribute("data-"+e,t.currentText[e]||"")}));var r=this.player.currentTime,n=c(r,this.currentText.list,this._gid),i=-1;n>-1&&(i=c(r,this.currentText.list[n].list,this._cid)),this._gid=n,this._cid=i,i<0?this.__render():this.__render(this.currentText.list[n].list[i])}},{key:"__loadAll",value:function(){this.textTrack.map((function(e){f(e)}))}},{key:"__onTimeupdate",value:function(){if(this._isOpen){var e=this.player.video,t=e.videoWidth,r=e.videoHeight;!this._videoMeta.scale&&t&&r&&this._onResize(this.player.root);var n=this.player.currentTime;if(this.currentText&&this.currentText.list){var i=c(n,this.currentText.list,this._gid),a=-1;if(i>-1&&(a=c(n,this.currentText.list[i].list,this._cid)),a<0)return void this.__render();a===this._cid&&i===this._gid||(this._cid=a,this._gid=i,this.__render(this.currentText.list[i].list[a]))}}}},{key:"_onResize",value:function(e){var t=this._videoMeta;if(e&&e instanceof window.Element||(e=this.player.root),this._iId&&(clearTimeout(this._iId),this._iId=null),!t.scale){if(!this.player.video)return;var r=this.player.video,n=r.videoWidth,i=r.videoHeight;if(!n||!i)return;t.videoWidth=n,t.videoHeight=i,t.scale=parseInt(i/n*100,10)}this.__startResize(e)}},{key:"resize",value:function(e,t){var r=this,n=this.config,i=n.baseSizeX,a=n.baseSizeY,o=n.minMobileSize,s=n.minSize,l=n.fitVideo,u=(n.offsetLeft,n.offsetBottom),c=this._videoMeta.scale;this._videoMeta.lwidth=e,this._videoMeta.lheight=t;var d=void 0,f=0;t/e*100>=c?(f=parseInt(c*e,10)/100,d=e):(f=t,d=parseInt(t/c*100,10)),console.log("height:"+t+" width:"+e+" vWidth:"+d+" vHeight:"+f+" this._videoMeta.vWidth:"+this._videoMeta.vWidth+" this._videoMeta.vHeight:"+this._videoMeta.vHeight),this._videoMeta.vWidth=d,this._videoMeta.vHeight=f;var p=0,h=0;c>120?(p=a,h=parseInt(p*f/1080,10)):(p=i,h=parseInt(p*d/1920,10));var g=Pn?o:s,y={fontSize:h=h<g?g:h>p?p:h},v=parseInt((t-f)/2,10),m=parseInt((e-d)/2,10),x=parseInt(f*u,10)/100;this._videoMeta.vBottom=v,this._videoMeta.vLeft=m,this._videoMeta.marginBottom=x,l&&(y.bottom=v+x,y.left=y.right=m),console.log("fitVideo vLeft:"+m+" vBottom:"+v+" marginBottom:"+x+" vWidth:"+d+" vHeight:"+f+" fontSize:"+h),Xt(y).map((function(e){r.root.style[e]=y[e]+"px"})),this.emit(An,{vLeft:m,vBottom:v,marginBottom:x,vWidth:d,vHeight:f,fontSize:h,scale:c})}},{key:"__startResize",value:function(e){var t=this,r=e.getBoundingClientRect(),n=this._videoMeta,i=r.width,a=r.height;if(this._iId&&(clearTimeout(this._iId),this._iId=null),console.log("__startResize width:"+i+" height:"+a+" lwidth:"+this._videoMeta.lwidth+" lheight:"+this._videoMeta.lheight),i>0&&a>0&&(i!==n.lwidth||a!==n.lheight))this._iC=0,this.resize(i,a);else{if(this._iC>=5)return void(this._iC=0);this._iC++,this._iId=setTimeout((function(){t.__startResize(e)}),50)}}},{key:"__render",value:function(e){if(e){var t="text-track-"+this.config.line;this.root.setAttribute("data-start",e.start),this.root.setAttribute("data-end",e.end);var r="";e.text.map((function(n,i){i>0&&(t+=" text-track-deputy"),r+='<xg-text-track-span class="'+t+'" data-tag="'+e.textTag[i]+'">'+n+"</xg-text-track-span>"})),this.innerRoot.innerHTML=r}else this.innerRoot.innerHTML=""}},{key:"show",value:function(){!function(e,t){e&&(e.classList?t.split(/\s+/g).forEach((function(t){e.classList.remove(t)})):l(e,t)&&t.split(/\s+/g).forEach((function(t){var r=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===Sn(e.className)?e.setAttribute("class",e.getAttribute("class").replace(r," ")):e.className=e.className.replace(r," ")})))}(this.root,"text-track-hide")}},{key:"hide",value:function(){u(this.root,"text-track-hide"),this.innerRoot.innerHTML=""}},{key:"destroy",value:function(){this.detachPlayer(),this.player=null,this.textTrack=null}},{key:"marginBottom",get:function(){var e=this._videoMeta,t=e.bottom,r=e.marginBottom;return this.config.fitVideo?t+r:r}}]),e}()}))},function(e,t,r){var n=r(156);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};r(2)(n,i),n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(1)(!1)).push([e.i,".xgplayer-skin-default .xgplayer-texttrack{-webkit-order:7;-moz-box-ordinal-group:8;order:7;width:60px;height:150px;z-index:18;position:relative;outline:none;display:none;cursor:default;margin-top:-119px}.xgplayer-skin-default .xgplayer-texttrack ul{display:none;list-style:none;min-width:78px;background:rgba(0,0,0,.54);border-radius:1px;position:absolute;bottom:30px;text-align:center;white-space:nowrap;left:50%;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;z-index:26;cursor:pointer}.xgplayer-skin-default .xgplayer-texttrack ul li{opacity:.7;font-family:PingFangSC-Regular;font-size:11px;color:hsla(0,0%,100%,.8);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;margin:auto;padding:6px 13px}.xgplayer-skin-default .xgplayer-texttrack ul li.selected,.xgplayer-skin-default .xgplayer-texttrack ul li:hover{color:#fff;opacity:1}.xgplayer-skin-default .xgplayer-texttrack .name{text-align:center;font-family:PingFangSC-Regular;font-size:13px;cursor:pointer;color:hsla(0,0%,100%,.8);position:absolute;bottom:0;width:60px;height:20px;line-height:20px;background:rgba(0,0,0,.38);border-radius:10px;display:inline-block;vertical-align:middle}xg-text-track{transition:bottom .3s ease}.xgplayer-skin-default.xgplayer-is-texttrack .xgplayer-texttrack,.xgplayer-skin-default.xgplayer-texttrack-active .xgplayer-texttrack ul{display:block}",""])},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0),a=(n=i)&&n.__esModule?n:{default:n};r(158),t.default={name:"s_error",method:function(){var e=this,t=e.root,r=a.default.util,n=r.createDom("xg-error",'<span class="xgplayer-error-text">请<span class="xgplayer-error-refresh">刷新</span>试试</span>',{},"xgplayer-error");e.once("ready",(function(){t.appendChild(n)}));var i=n.querySelector(".xgplayer-error-text"),o=null;function s(){e.config.lang&&"zh-cn"===e.config.lang?i.innerHTML=e.config.errorTips||'请<span class="xgplayer-error-refresh">刷新</span>试试':i.innerHTML=e.config.errorTips||'please try to <span class="xgplayer-error-refresh">refresh</span>',r.addClass(e.root,"xgplayer-is-error"),(o=n.querySelector(".xgplayer-error-refresh"))&&["touchend","click"].forEach((function(t){o.addEventListener(t,(function(t){t.preventDefault(),t.stopPropagation(),e.autoplay=!0,e.once("playing",(function(){r.removeClass(e.root,"xgplayer-is-error")})),e.src=e.config.url}))}))}e.on("error",s),e.once("destroy",(function t(){e.off("error",s),e.off("destroy",t)}))}},e.exports=t.default},function(e,t,r){var n=r(159);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};r(2)(n,i),n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(1)(!1)).push([e.i,".xgplayer-skin-default .xgplayer-error{background:#000;display:none;position:absolute;left:0;top:0;width:100%;height:100%;z-index:125;font-family:PingFangSC-Regular;font-size:14px;color:#fff;text-align:center;line-height:100%;-webkit-justify-content:center;-moz-box-pack:center;justify-content:center;-webkit-align-items:center;-moz-box-align:center;align-items:center}.xgplayer-skin-default .xgplayer-error .xgplayer-error-refresh{color:#fa1f41;padding:0 3px;cursor:pointer}.xgplayer-skin-default .xgplayer-error .xgplayer-error-text{line-height:18px;margin:auto 6px}.xgplayer-skin-default.xgplayer-is-error .xgplayer-error{display:-webkit-flex;display:-moz-box;display:flex}",""])},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0),a=(n=i)&&n.__esModule?n:{default:n};r(161),t.default={name:"s_memoryPlay",method:function(){var e=this,t=a.default.util,r=e.config.lastPlayTime||0,n=e.config.lastPlayTimeHideDelay||0,i=null;if(!(r<=0)){(i=t.createDom("xg-memoryplay",'<div class="xgplayer-memoryplay-spot"><div class="xgplayer-progress-tip">您上次观看到 <span class="xgplayer-lasttime">'+t.format(r)+'</span> ,为您自动续播 <span class="btn-close"><svg viewBox="64 64 896 896" focusable="false" class="" data-icon="close" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"></path></svg></span></div></div>',{},"xgplayer-memoryplay")).addEventListener("mouseover",(function(e){e.stopPropagation()}));var o=function(){i&&i.parentNode&&i.parentNode.removeChild(i),i=null};i.querySelector(".xgplayer-progress-tip .btn-close").addEventListener("click",o),e.once("play",(function(){n>0&&e.root.appendChild(i),e.emit("memoryPlayStart",r),n>0&&setTimeout((function(){o()}),1e3*n)})),e.once("ended",o)}}},e.exports=t.default},function(e,t,r){var n=r(162);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};r(2)(n,i),n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(1)(!1)).push([e.i,".xgplayer-skin-default .xgplayer-memoryplay-spot{position:absolute;height:32px;left:10px;bottom:46px;background:rgba(0,0,0,.5);border-radius:32px;line-height:32px;color:#ddd;z-index:15;padding:0 32px 0 16px}.xgplayer-skin-default .xgplayer-memoryplay-spot .xgplayer-lasttime{color:red;font-weight:700}.xgplayer-skin-default .xgplayer-memoryplay-spot .btn-close{position:absolute;width:16px;height:16px;right:10px;top:2px;cursor:pointer;color:#fff;font-size:16px}",""])},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a(r(0)),i=a(r(164));function a(e){return e&&e.__esModule?e:{default:e}}r(165),t.default={name:"s_airplay",method:function(){var e=this,t=n.default.util;if(e.config.airplay&&window.WebKitPlaybackTargetAvailabilityEvent){var r=t.createDom("xg-airplay",'<xg-icon class="xgplayer-icon">\n    <div class="xgplayer-icon-airplay">'+i.default+"</div>\n  </xg-icon>",{},"xgplayer-airplay"),a=t.createDom("xg-tips",'<span class="xgplayer-tip-airplay">'+e.lang.AIRPLAY_TIPS+"</span>",{},"xgplayer-tips");r.appendChild(a),e.once("ready",(function(){e.controls.appendChild(r),e.video.addEventListener("webkitplaybacktargetavailabilitychanged",(function(e){switch(e.availability){case"available":r.hidden=!1,r.disabled=!1;break;case"not-available":r.hidden=!0,r.disabled=!0}}))})),["click","touchend"].forEach((function(t){r.addEventListener(t,(function(t){t.preventDefault(),t.stopPropagation(),e.emit("airplayBtnClick")}))}))}}},e.exports=t.default},function(e,t,r){"use strict";r.r(t),t.default='<svg t="1600422191774" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3100" width="28" height="28"><path d="M256 938.666667h512L512 597.333333 256 938.666667z m170.666667-85.333334l85.333333-113.781333L597.333333 853.333333H426.666667zM853.333333 85.333333H170.666667C99.946667 85.333333 42.666667 142.613333 42.666667 213.333333v426.666667c0 70.72 57.28 128 128 128h106.666666l64-85.333333H170.666667c-23.573333 0-42.666667-19.093333-42.666667-42.666667V213.333333c0-23.573333 19.093333-42.666667 42.666667-42.666666h682.666666c23.573333 0 42.666667 19.093333 42.666667 42.666666v426.666667c0 23.573333-19.093333 42.666667-42.666667 42.666667H682.666667l64 85.333333h106.666666c70.72 0 128-57.28 128-128V213.333333c0-70.72-57.28-128-128-128z" p-id="3101" fill="#ffffff"></path></svg>'},function(e,t,r){var n=r(166);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};r(2)(n,i),n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(1)(!1)).push([e.i,".xgplayer-skin-default .xgplayer-airplay{position:relative;-webkit-order:11;-moz-box-ordinal-group:12;order:11;display:block;cursor:pointer;margin-left:5px;margin-right:3px}.xgplayer-skin-default .xgplayer-airplay .xgplayer-icon{margin-top:6px;margin-left:6px}.xgplayer-skin-default .xgplayer-airplay .xgplayer-icon div{position:absolute}.xgplayer-skin-default .xgplayer-airplay .xgplayer-icon .xgplayer-icon-airplay{display:block}.xgplayer-skin-default .xgplayer-airplay .xgplayer-tips{position:absolute;right:0;left:auto}.xgplayer-skin-default .xgplayer-airplay .xgplayer-tips .xgplayer-tip-airplay{display:block}.xgplayer-skin-default .xgplayer-airplay:hover{opacity:.85}.xgplayer-skin-default .xgplayer-airplay:hover .xgplayer-tips{display:block}",""])},function(e,t,r){e.exports=r(168)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=S(r(0)),i=S(r(78)),a=S(r(37)),o=S(r(79)),s=S(r(80)),l=S(r(45)),u=S(r(81)),c=S(r(82)),d=S(r(46)),f=S(r(83)),p=S(r(38)),h=S(r(39)),g=S(r(84)),y=S(r(90)),v=S(r(91)),m=S(r(92)),x=S(r(47)),b=S(r(93)),k=S(r(94)),_=S(r(97)),w=S(r(98)),E=S(r(99)),T=S(r(100));function S(e){return e&&e.__esModule?e:{default:e}}r(169);var O={};function R(e,t,r){var n=e;t.map((function(e,i){n[e]=i==t.length-1?r:n[e]||{},n=n[e]}))}R(O,["controls","airplay"],T.default),R(O,["controls","cssFullscreen"],E.default),R(O,["controls","danmu"],w.default),R(O,["controls","definition"],_.default),R(O,["controls","download"],k.default),R(O,["controls","errorRetry"],b.default),R(O,["controls","fullscreen"],x.default),R(O,["controls","keyboard"],m.default),R(O,["controls","localPreview"],v.default),R(O,["controls","memoryPlay"],y.default),R(O,["controls","miniplayer"],g.default),R(O,["controls","mobile"],h.default),R(O,["controls","pc"],p.default),R(O,["controls","pip"],f.default),R(O,["controls","play"],d.default),R(O,["controls","playNext"],c.default),R(O,["controls","reload"],u.default),R(O,["controls","replay"],l.default),R(O,["controls","rotate"],s.default),R(O,["controls","screenShot"],o.default),R(O,["controls","start"],a.default),R(O,["controls","volume"],i.default),n.default.installAll(O.controls),t.default=n.default,e.exports=t.default},function(e,t,r){"use strict";var n=C(r(0)),i=C(r(9)),a=C(r(101)),o=C(r(48)),s=C(r(40)),l=C(r(53)),u=C(r(56)),c=C(r(59)),d=C(r(104)),f=C(r(109)),p=C(r(115)),h=C(r(64)),g=C(r(68)),y=C(r(71)),v=C(r(74)),m=C(r(118)),x=C(r(121)),b=C(r(122)),k=C(r(126)),_=C(r(132)),w=C(r(135)),E=C(r(138)),T=C(r(142)),S=C(r(146)),O=C(r(150)),R=C(r(153)),A=C(r(157)),P=C(r(160)),L=C(r(163));function C(e){return e&&e.__esModule?e:{default:e}}n.default.installAll([i.default,a.default,o.default,s.default,l.default,u.default,c.default,d.default,f.default,p.default,h.default,g.default,y.default,v.default,m.default,x.default,b.default,k.default,_.default,w.default,E.default,T.default,S.default,O.default,R.default,A.default,P.default,L.default])}])}))},9e3:function(e,t,r){(function(t,n){e.exports=n(r("5392"))})(window,(function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=31)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logger=t.enableLogs=void 0;var n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(5);function a(){}var o={trace:a,debug:a,log:a,warn:a,info:a,error:a},s=o;function l(e,t){return t="["+e+"] > "+t,t}var u=(0,i.getSelfScope)();function c(e){var t=u.console[e];return t?function(){for(var r=arguments.length,n=Array(r),i=0;i<r;i++)n[i]=arguments[i];n[0]&&(n[0]=l(e,n[0])),t.apply(u.console,n)}:a}function d(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];r.forEach((function(t){s[t]=e[t]?e[t].bind(e):c(t)}))}t.enableLogs=function(e){if(!0===e||"object"===("undefined"===typeof e?"undefined":n(e))){d(e,"debug","log","info","warn","error");try{s.log()}catch(t){s=o}}else s=o},t.logger=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={MEDIA_ATTACHING:"hlsMediaAttaching",MEDIA_ATTACHED:"hlsMediaAttached",MEDIA_DETACHING:"hlsMediaDetaching",MEDIA_DETACHED:"hlsMediaDetached",BUFFER_RESET:"hlsBufferReset",BUFFER_CODECS:"hlsBufferCodecs",BUFFER_CREATED:"hlsBufferCreated",BUFFER_APPENDING:"hlsBufferAppending",BUFFER_APPENDED:"hlsBufferAppended",BUFFER_EOS:"hlsBufferEos",BUFFER_FLUSHING:"hlsBufferFlushing",BUFFER_FLUSHED:"hlsBufferFlushed",MANIFEST_LOADING:"hlsManifestLoading",MANIFEST_LOADED:"hlsManifestLoaded",MANIFEST_PARSED:"hlsManifestParsed",LEVEL_SWITCHING:"hlsLevelSwitching",LEVEL_SWITCHED:"hlsLevelSwitched",LEVEL_LOADING:"hlsLevelLoading",LEVEL_LOADED:"hlsLevelLoaded",LEVEL_UPDATED:"hlsLevelUpdated",LEVEL_PTS_UPDATED:"hlsLevelPtsUpdated",AUDIO_TRACKS_UPDATED:"hlsAudioTracksUpdated",AUDIO_TRACK_SWITCHING:"hlsAudioTrackSwitching",AUDIO_TRACK_SWITCHED:"hlsAudioTrackSwitched",AUDIO_TRACK_LOADING:"hlsAudioTrackLoading",AUDIO_TRACK_LOADED:"hlsAudioTrackLoaded",SUBTITLE_TRACKS_UPDATED:"hlsSubtitleTracksUpdated",SUBTITLE_TRACK_SWITCH:"hlsSubtitleTrackSwitch",SUBTITLE_TRACK_LOADING:"hlsSubtitleTrackLoading",SUBTITLE_TRACK_LOADED:"hlsSubtitleTrackLoaded",SUBTITLE_FRAG_PROCESSED:"hlsSubtitleFragProcessed",INIT_PTS_FOUND:"hlsInitPtsFound",FRAG_LOADING:"hlsFragLoading",FRAG_LOAD_PROGRESS:"hlsFragLoadProgress",FRAG_LOAD_EMERGENCY_ABORTED:"hlsFragLoadEmergencyAborted",FRAG_LOADED:"hlsFragLoaded",FRAG_DECRYPTED:"hlsFragDecrypted",FRAG_PARSING_INIT_SEGMENT:"hlsFragParsingInitSegment",FRAG_PARSING_USERDATA:"hlsFragParsingUserdata",FRAG_PARSING_METADATA:"hlsFragParsingMetadata",FRAG_PARSING_DATA:"hlsFragParsingData",FRAG_PARSED:"hlsFragParsed",FRAG_BUFFERED:"hlsFragBuffered",FRAG_CHANGED:"hlsFragChanged",FPS_DROP:"hlsFpsDrop",FPS_DROP_LEVEL_CAPPING:"hlsFpsDropLevelCapping",ERROR:"hlsError",DESTROYING:"hlsDestroying",KEY_LOADING:"hlsKeyLoading",KEY_LOADED:"hlsKeyLoaded",STREAM_STATE_TRANSITION:"hlsStreamStateTransition"};t.default=n,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.ErrorTypes={NETWORK_ERROR:"networkError",MEDIA_ERROR:"mediaError",KEY_SYSTEM_ERROR:"keySystemError",MUX_ERROR:"muxError",OTHER_ERROR:"otherError"},t.ErrorDetails={KEY_SYSTEM_NO_KEYS:"keySystemNoKeys",KEY_SYSTEM_NO_ACCESS:"keySystemNoAccess",KEY_SYSTEM_NO_SESSION:"keySystemNoSession",KEY_SYSTEM_LICENSE_REQUEST_FAILED:"keySystemLicenseRequestFailed",MANIFEST_LOAD_ERROR:"manifestLoadError",MANIFEST_LOAD_TIMEOUT:"manifestLoadTimeOut",MANIFEST_PARSING_ERROR:"manifestParsingError",MANIFEST_INCOMPATIBLE_CODECS_ERROR:"manifestIncompatibleCodecsError",LEVEL_LOAD_ERROR:"levelLoadError",LEVEL_LOAD_TIMEOUT:"levelLoadTimeOut",LEVEL_SWITCH_ERROR:"levelSwitchError",AUDIO_TRACK_LOAD_ERROR:"audioTrackLoadError",AUDIO_TRACK_LOAD_TIMEOUT:"audioTrackLoadTimeOut",FRAG_LOAD_ERROR:"fragLoadError",FRAG_LOAD_TIMEOUT:"fragLoadTimeOut",FRAG_DECRYPT_ERROR:"fragDecryptError",FRAG_PARSING_ERROR:"fragParsingError",REMUX_ALLOC_ERROR:"remuxAllocError",KEY_LOAD_ERROR:"keyLoadError",KEY_LOAD_TIMEOUT:"keyLoadTimeOut",BUFFER_ADD_CODEC_ERROR:"bufferAddCodecError",BUFFER_APPEND_ERROR:"bufferAppendError",BUFFER_APPENDING_ERROR:"bufferAppendingError",BUFFER_STALLED_ERROR:"bufferStalledError",BUFFER_FULL_ERROR:"bufferFullError",BUFFER_SEEK_OVER_HOLE:"bufferSeekOverHole",BUFFER_NUDGE_ON_STALL:"bufferNudgeOnStall",INTERNAL_EXCEPTION:"internalException"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=r(0),o=r(2),s=r(1),l=u(s);function u(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var d={hlsEventGeneric:!0,hlsHandlerDestroying:!0,hlsHandlerDestroyed:!0},f=function(){function e(t){c(this,e),this.hls=t,this.onEvent=this.onEvent.bind(this);for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];this.handledEvents=n,this.useGenericHandler=!0,this.registerListeners()}return i(e,[{key:"destroy",value:function(){this.onHandlerDestroying(),this.unregisterListeners(),this.onHandlerDestroyed()}},{key:"onHandlerDestroying",value:function(){}},{key:"onHandlerDestroyed",value:function(){}},{key:"isEventHandler",value:function(){return"object"===n(this.handledEvents)&&this.handledEvents.length&&"function"===typeof this.onEvent}},{key:"registerListeners",value:function(){this.isEventHandler()&&this.handledEvents.forEach((function(e){if(d[e])throw new Error("Forbidden event-name: "+e);this.hls.on(e,this.onEvent)}),this)}},{key:"unregisterListeners",value:function(){this.isEventHandler()&&this.handledEvents.forEach((function(e){this.hls.off(e,this.onEvent)}),this)}},{key:"onEvent",value:function(e,t){this.onEventGeneric(e,t)}},{key:"onEventGeneric",value:function(e,t){var r=function(e,t){var r="on"+e.replace("hls","");if("function"!==typeof this[r])throw new Error("Event "+e+" has no generic handler in this "+this.constructor.name+" class (tried "+r+")");return this[r].bind(this,t)};try{r.call(this,e,t).call()}catch(n){a.logger.error("An internal error happened while handling event "+e+'. Error message: "'+n.message+'". Here is a stacktrace:',n),this.hls.trigger(l.default.ERROR,{type:o.ErrorTypes.OTHER_ERROR,details:o.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:e,err:n})}}}]),e}();t.default=f,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.BufferHelper=function(){function e(){i(this,e)}return n(e,null,[{key:"isBuffered",value:function(e,t){try{if(e)for(var r=e.buffered,n=0;n<r.length;n++)if(t>=r.start(n)&&t<=r.end(n))return!0}catch(i){}return!1}},{key:"bufferInfo",value:function(e,t,r){try{if(e){var n=e.buffered,i=[],a=void 0;for(a=0;a<n.length;a++)i.push({start:n.start(a),end:n.end(a)});return this.bufferedInfo(i,t,r)}}catch(o){}return{len:0,start:t,end:t,nextStart:void 0}}},{key:"bufferedInfo",value:function(e,t,r){var n=[],i=void 0,a=void 0,o=void 0,s=void 0,l=void 0;for(e.sort((function(e,t){var r=e.start-t.start;return r||t.end-e.end})),l=0;l<e.length;l++){var u=n.length;if(u){var c=n[u-1].end;e[l].start-c<r?e[l].end>c&&(n[u-1].end=e[l].end):n.push(e[l])}else n.push(e[l])}for(l=0,i=0,a=o=t;l<n.length;l++){var d=n[l].start,f=n[l].end;if(t+r>=d&&t<f)a=d,o=f,i=o-t;else if(t+r<d){s=d;break}}return{len:i,start:a,end:o,nextStart:s}}}]),e}()},function(e,t,r){"use strict";function n(){return"undefined"===typeof window?self:window}Object.defineProperty(t,"__esModule",{value:!0}),t.getSelfScope=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FragmentTracker=t.FragmentState=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function e(t,r,n){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,r);if(void 0===i){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,r,n)}if("value"in i)return i.value;var o=i.get;return void 0!==o?o.call(n):void 0},a=r(3),o=u(a),s=r(1),l=u(s);function u(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function f(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var p=t.FragmentState={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};t.FragmentTracker=function(e){function t(e){c(this,t);var r=d(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,l.default.BUFFER_APPENDED,l.default.FRAG_BUFFERED,l.default.FRAG_LOADED));return r.bufferPadding=.2,r.fragments=Object.create(null),r.timeRanges=Object.create(null),r.config=e.config,r}return f(t,e),n(t,[{key:"destroy",value:function(){this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.config=null,o.default.prototype.destroy.call(this),i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}},{key:"getBufferedFrag",value:function(e,t){var r=this.fragments,n=Object.keys(r).filter((function(n){var i=r[n];if(i.body.type!==t)return!1;if(!i.buffered)return!1;var a=i.body;return a.startPTS<=e&&e<=a.endPTS}));if(0===n.length)return null;var i=n.pop();return r[i].body}},{key:"detectEvictedFragments",value:function(e,t){var r=this,n=void 0,i=void 0;Object.keys(this.fragments).forEach((function(a){var o=r.fragments[a];if(!0===o.buffered){var s=o.range[e];if(s){n=s.time;for(var l=0;l<n.length;l++)if(i=n[l],!1===r.isTimeBuffered(i.startPTS,i.endPTS,t)){r.removeFragment(o.body);break}}}}))}},{key:"detectPartialFragments",value:function(e){var t=this,r=this.getFragmentKey(e),n=this.fragments[r];n&&(n.buffered=!0,Object.keys(this.timeRanges).forEach((function(r){if(e.hasElementaryStream(r)){var i=t.timeRanges[r];n.range[r]=t.getBufferedTimes(e.startPTS,e.endPTS,i)}})))}},{key:"getBufferedTimes",value:function(e,t,r){for(var n=[],i=void 0,a=void 0,o=!1,s=0;s<r.length;s++){if(i=r.start(s)-this.bufferPadding,a=r.end(s)+this.bufferPadding,e>=i&&t<=a){n.push({startPTS:Math.max(e,r.start(s)),endPTS:Math.min(t,r.end(s))});break}if(e<a&&t>i)n.push({startPTS:Math.max(e,r.start(s)),endPTS:Math.min(t,r.end(s))}),o=!0;else if(t<=i)break}return{time:n,partial:o}}},{key:"getFragmentKey",value:function(e){return e.type+"_"+e.level+"_"+e.urlId+"_"+e.sn}},{key:"getPartialFragment",value:function(e){var t=this,r=void 0,n=void 0,i=void 0,a=null,o=0;return Object.keys(this.fragments).forEach((function(s){var l=t.fragments[s];t.isPartial(l)&&(n=l.body.startPTS-t.bufferPadding,i=l.body.endPTS+t.bufferPadding,e>=n&&e<=i&&(r=Math.min(e-n,i-e),o<=r&&(a=l.body,o=r)))})),a}},{key:"getState",value:function(e){var t=this.getFragmentKey(e),r=this.fragments[t],n=p.NOT_LOADED;return void 0!==r&&(n=r.buffered?!0===this.isPartial(r)?p.PARTIAL:p.OK:p.APPENDING),n}},{key:"isPartial",value:function(e){return!0===e.buffered&&(void 0!==e.range.video&&!0===e.range.video.partial||void 0!==e.range.audio&&!0===e.range.audio.partial)}},{key:"isTimeBuffered",value:function(e,t,r){for(var n=void 0,i=void 0,a=0;a<r.length;a++){if(n=r.start(a)-this.bufferPadding,i=r.end(a)+this.bufferPadding,e>=n&&t<=i)return!0;if(t<=n)return!1}return!1}},{key:"onFragLoaded",value:function(e){var t=e.frag;Number.isFinite(t.sn)&&!t.bitrateTest&&(this.fragments[this.getFragmentKey(t)]={body:t,range:Object.create(null),buffered:!1})}},{key:"onBufferAppended",value:function(e){var t=this;this.timeRanges=e.timeRanges,Object.keys(this.timeRanges).forEach((function(e){var r=t.timeRanges[e];t.detectEvictedFragments(e,r)}))}},{key:"onFragBuffered",value:function(e){this.detectPartialFragments(e.frag)}},{key:"hasFragment",value:function(e){var t=this.getFragmentKey(e);return void 0!==this.fragments[t]}},{key:"removeFragment",value:function(e){var t=this.getFragmentKey(e);delete this.fragments[t]}},{key:"removeAllFragments",value:function(){this.fragments=Object.create(null)}}]),t}(o.default)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addGroupId=i,t.updatePTS=a,t.updateFragPTSDTS=o,t.mergeDetails=s,t.mergeSubtitlePlaylists=l,t.mapFragmentIntersection=u,t.adjustSliding=c,t.computeReloadInterval=d;var n=r(0);function i(e,t,r){switch(t){case"audio":e.audioGroupIds||(e.audioGroupIds=[]),e.audioGroupIds.push(r);break;case"text":e.textGroupIds||(e.textGroupIds=[]),e.textGroupIds.push(r);break}}function a(e,t,r){var i=e[t],a=e[r],o=a.startPTS;Number.isFinite(o)?r>t?(i.duration=o-i.start,i.duration<0&&n.logger.warn("negative duration computed for frag "+i.sn+",level "+i.level+", there should be some duration drift between playlist and fragment!")):(a.duration=i.start-o,a.duration<0&&n.logger.warn("negative duration computed for frag "+a.sn+",level "+a.level+", there should be some duration drift between playlist and fragment!")):a.start=r>t?i.start+i.duration:Math.max(i.start-a.duration,0)}function o(e,t,r,n,i,o){var s=r;if(Number.isFinite(t.startPTS)){var l=Math.abs(t.startPTS-r);Number.isFinite(t.deltaPTS)?t.deltaPTS=Math.max(l,t.deltaPTS):t.deltaPTS=l,s=Math.max(r,t.startPTS),r=Math.min(r,t.startPTS),n=Math.max(n,t.endPTS),i=Math.min(i,t.startDTS),o=Math.max(o,t.endDTS)}var u=r-t.start;t.start=t.startPTS=r,t.maxStartPTS=s,t.endPTS=n,t.startDTS=i,t.endDTS=o,t.duration=n-r;var c=t.sn;if(!e||c<e.startSN||c>e.endSN)return 0;var d=void 0,f=void 0,p=void 0;for(d=c-e.startSN,f=e.fragments,f[d]=t,p=d;p>0;p--)a(f,p,p-1);for(p=d;p<f.length-1;p++)a(f,p,p+1);return e.PTSKnown=!0,u}function s(e,t){t.initSegment&&e.initSegment&&(t.initSegment=e.initSegment);var r=0,i=void 0;if(u(e,t,(function(e,n){r=e.cc-n.cc,Number.isFinite(e.startPTS)&&(n.start=n.startPTS=e.startPTS,n.endPTS=e.endPTS,n.duration=e.duration,n.backtracked=e.backtracked,n.dropped=e.dropped,i=n),t.PTSKnown=!0})),t.PTSKnown){if(r){n.logger.log("discontinuity sliding from playlist, take drift into account");for(var a=t.fragments,s=0;s<a.length;s++)a[s].cc+=r}i?o(t,i,i.startPTS,i.endPTS,i.startDTS,i.endDTS):c(e,t),t.PTSKnown=e.PTSKnown}}function l(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=-1;u(e,t,(function(e,t,r){t.start=e.start,n=r}));var i=t.fragments;if(n<0)i.forEach((function(e){e.start+=r}));else for(var a=n+1;a<i.length;a++)i[a].start=i[a-1].start+i[a-1].duration}function u(e,t,r){if(e&&t)for(var n=Math.max(e.startSN,t.startSN)-t.startSN,i=Math.min(e.endSN,t.endSN)-t.startSN,a=t.startSN-e.startSN,o=n;o<=i;o++){var s=e.fragments[a+o],l=t.fragments[o];if(!s||!l)break;r(s,l,o)}}function c(e,t){var r=t.startSN-e.startSN,n=e.fragments,i=t.fragments;if(!(r<0||r>n.length))for(var a=0;a<i.length;a++)i[a].start+=n[r].start}function d(e,t,r){var n=1e3*(t.averagetargetduration?t.averagetargetduration:t.targetduration),i=n/2;return e&&t.endSN===e.endSN&&(n=i),r&&(n=Math.max(i,n-(window.performance.now()-r))),Math.round(n)}},function(e,t,r){(function(t){var r=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#.*)?$/,n=/^([^\/?#]*)(.*)$/,i=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(e,t,r){if(r=r||{},e=e.trim(),t=t.trim(),!t){if(!r.alwaysNormalize)return e;var i=o.parseURL(e);if(!i)throw new Error("Error trying to parse base URL.");return i.path=o.normalizePath(i.path),o.buildURLFromParts(i)}var a=o.parseURL(t);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return r.alwaysNormalize?(a.path=o.normalizePath(a.path),o.buildURLFromParts(a)):t;var s=o.parseURL(e);if(!s)throw new Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&"/"!==s.path[0]){var l=n.exec(s.path);s.netLoc=l[1],s.path=l[2]}s.netLoc&&!s.path&&(s.path="/");var u={scheme:s.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(u.netLoc=s.netLoc,"/"!==a.path[0]))if(a.path){var c=s.path,d=c.substring(0,c.lastIndexOf("/")+1)+a.path;u.path=o.normalizePath(d)}else u.path=s.path,a.params||(u.params=s.params,a.query||(u.query=s.query));return null===u.path&&(u.path=r.alwaysNormalize?o.normalizePath(a.path):a.path),o.buildURLFromParts(u)},parseURL:function(e){var t=r.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){e=e.split("").reverse().join("").replace(i,"");while(e.length!==(e=e.replace(a,"")).length);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};e.exports=o})()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={search:function(e,t){var r=0,n=e.length-1,i=null,a=null;while(r<=n){i=(r+n)/2|0,a=e[i];var o=t(a);if(o>0)r=i+1;else{if(!(o<0))return a;n=i-1}}return null}};t.default=n,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=function(){function e(){i(this,e)}return n(e,null,[{key:"isHeader",value:function(e,t){return t+10<=e.length&&73===e[t]&&68===e[t+1]&&51===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128}},{key:"isFooter",value:function(e,t){return t+10<=e.length&&51===e[t]&&68===e[t+1]&&73===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128}},{key:"getID3Data",value:function(t,r){var n=r,i=0;while(e.isHeader(t,r)){i+=10;var a=e._readSize(t,r+6);i+=a,e.isFooter(t,r+10)&&(i+=10),r+=i}if(i>0)return t.subarray(n,n+i)}},{key:"_readSize",value:function(e,t){var r=0;return r=(127&e[t])<<21,r|=(127&e[t+1])<<14,r|=(127&e[t+2])<<7,r|=127&e[t+3],r}},{key:"getTimeStamp",value:function(t){for(var r=e.getID3Frames(t),n=0;n<r.length;n++){var i=r[n];if(e.isTimeStampFrame(i))return e._readTimeStamp(i)}}},{key:"isTimeStampFrame",value:function(e){return e&&"PRIV"===e.key&&"com.apple.streaming.transportStreamTimestamp"===e.info}},{key:"_getFrameData",value:function(t){var r=String.fromCharCode(t[0],t[1],t[2],t[3]),n=e._readSize(t,4),i=10;return{type:r,size:n,data:t.subarray(i,i+n)}}},{key:"getID3Frames",value:function(t){var r=0,n=[];while(e.isHeader(t,r)){var i=e._readSize(t,r+6);r+=10;var a=r+i;while(r+8<a){var o=e._getFrameData(t.subarray(r)),s=e._decodeFrame(o);s&&n.push(s),r+=o.size+10}e.isFooter(t,r)&&(r+=10)}return n}},{key:"_decodeFrame",value:function(t){return"PRIV"===t.type?e._decodePrivFrame(t):"T"===t.type[0]?e._decodeTextFrame(t):"W"===t.type[0]?e._decodeURLFrame(t):void 0}},{key:"_readTimeStamp",value:function(e){if(8===e.data.byteLength){var t=new Uint8Array(e.data),r=1&t[3],n=(t[4]<<23)+(t[5]<<15)+(t[6]<<7)+t[7];return n/=45,r&&(n+=47721858.84),Math.round(n)}}},{key:"_decodePrivFrame",value:function(t){if(!(t.size<2)){var r=e._utf8ArrayToStr(t.data,!0),n=new Uint8Array(t.data.subarray(r.length+1));return{key:t.type,info:r,data:n.buffer}}}},{key:"_decodeTextFrame",value:function(t){if(!(t.size<2)){if("TXXX"===t.type){var r=1,n=e._utf8ArrayToStr(t.data.subarray(r));r+=n.length+1;var i=e._utf8ArrayToStr(t.data.subarray(r));return{key:t.type,info:n,data:i}}var a=e._utf8ArrayToStr(t.data.subarray(1));return{key:t.type,data:a}}}},{key:"_decodeURLFrame",value:function(t){if("WXXX"===t.type){if(t.size<2)return;var r=1,n=e._utf8ArrayToStr(t.data.subarray(r));r+=n.length+1;var i=e._utf8ArrayToStr(t.data.subarray(r));return{key:t.type,info:n,data:i}}var a=e._utf8ArrayToStr(t.data);return{key:t.type,data:a}}},{key:"_utf8ArrayToStr",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e.length,n=void 0,i=void 0,a=void 0,o="",s=0;while(s<r){if(n=e[s++],0===n&&t)return o;if(0!==n&&3!==n)switch(n>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(n);break;case 12:case 13:i=e[s++],o+=String.fromCharCode((31&n)<<6|63&i);break;case 14:i=e[s++],a=e[s++],o+=String.fromCharCode((15&n)<<12|(63&i)<<6|(63&a)<<0);break;default:}}return o}}]),e}(),o=a._utf8ArrayToStr;t.default=a,t.utf8ArrayToStr=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(8),a=u(i),o=r(17),s=l(o);function l(e){return e&&e.__esModule?e:{default:e}}function u(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var f=function(){function e(){var t;d(this,e),this._url=null,this._byteRange=null,this._decryptdata=null,this.tagList=[],this.programDateTime=null,this.rawProgramDateTime=null,this._elementaryStreams=(t={},c(t,e.ElementaryStreamTypes.AUDIO,!1),c(t,e.ElementaryStreamTypes.VIDEO,!1),t)}return n(e,[{key:"addElementaryStream",value:function(e){this._elementaryStreams[e]=!0}},{key:"hasElementaryStream",value:function(e){return!0===this._elementaryStreams[e]}},{key:"createInitializationVector",value:function(e){for(var t=new Uint8Array(16),r=12;r<16;r++)t[r]=e>>8*(15-r)&255;return t}},{key:"fragmentDecryptdataFromLevelkey",value:function(e,t){var r=e;return e&&e.method&&e.uri&&!e.iv&&(r=new s.default,r.method=e.method,r.baseuri=e.baseuri,r.reluri=e.reluri,r.iv=this.createInitializationVector(t)),r}},{key:"url",get:function(){return!this._url&&this.relurl&&(this._url=a.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url},set:function(e){this._url=e}},{key:"byteRange",get:function(){if(!this._byteRange&&!this.rawByteRange)return[];if(this._byteRange)return this._byteRange;var e=[];if(this.rawByteRange){var t=this.rawByteRange.split("@",2);if(1===t.length){var r=this.lastByteRangeEndOffset;e[0]=r||0}else e[0]=parseInt(t[1]);e[1]=parseInt(t[0])+e[0],this._byteRange=e}return e}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"decryptdata",get:function(){return this._decryptdata||(this._decryptdata=this.fragmentDecryptdataFromLevelkey(this.levelkey,this.sn)),this._decryptdata}},{key:"endProgramDateTime",get:function(){if(!Number.isFinite(this.programDateTime))return null;var e=Number.isFinite(this.duration)?this.duration:0;return this.programDateTime+1e3*e}},{key:"encrypted",get:function(){return!(!this.decryptdata||null===this.decryptdata.uri||null!==this.decryptdata.key)}}],[{key:"ElementaryStreamTypes",get:function(){return{AUDIO:"audio",VIDEO:"video"}}}]),e}();t.default=f,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(42),a=g(i),o=r(43),s=g(o),l=r(44),u=g(l),c=r(2),d=r(0),f=r(1),p=g(f),h=r(5);function g(e){return e&&e.__esModule?e:{default:e}}function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var v=(0,h.getSelfScope)(),m=function(){function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.removePKCS7Padding,a=void 0===i||i;if(y(this,e),this.logEnabled=!0,this.observer=t,this.config=r,this.removePKCS7Padding=a,a)try{var o=v.crypto;o&&(this.subtle=o.subtle||o.webkitSubtle)}catch(s){}this.disableWebCrypto=!this.subtle}return n(e,[{key:"isSync",value:function(){return this.disableWebCrypto&&this.config.enableSoftwareAES}},{key:"decrypt",value:function(e,t,r,n){var i=this;if(this.disableWebCrypto&&this.config.enableSoftwareAES){this.logEnabled&&(d.logger.log("JS AES decrypt"),this.logEnabled=!1);var o=this.decryptor;o||(this.decryptor=o=new u.default),o.expandKey(t),n(o.decrypt(e,0,r,this.removePKCS7Padding))}else{this.logEnabled&&(d.logger.log("WebCrypto AES decrypt"),this.logEnabled=!1);var l=this.subtle;this.key!==t&&(this.key=t,this.fastAesKey=new s.default(l,t)),this.fastAesKey.expandKey().then((function(o){var s=new a.default(l,r);s.decrypt(e,o).catch((function(a){i.onWebCryptoError(a,e,t,r,n)})).then((function(e){n(e)}))})).catch((function(a){i.onWebCryptoError(a,e,t,r,n)}))}}},{key:"onWebCryptoError",value:function(e,t,r,n,i){this.config.enableSoftwareAES?(d.logger.log("WebCrypto Error, disable WebCrypto API"),this.disableWebCrypto=!0,this.logEnabled=!0,this.decrypt(t,r,n,i)):(d.logger.error("decrypting error : "+e.message),this.observer.trigger(p.default.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:c.ErrorDetails.FRAG_DECRYPT_ERROR,fatal:!0,reason:e.message}))}},{key:"destroy",value:function(){var e=this.decryptor;e&&(e.destroy(),this.decryptor=void 0)}}]),e}();t.default=m,e.exports=t["default"]},function(e,t,r){"use strict";function n(){if("undefined"!==typeof window)return window.MediaSource||window.WebKitMediaSource}Object.defineProperty(t,"__esModule",{value:!0}),t.getMediaSource=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.State=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function e(t,r,n){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,r);if(void 0===i){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,r,n)}if("value"in i)return i.value;var o=i.get;return void 0!==o?o.call(n):void 0},a=r(28),o=c(a),s=r(6),l=r(4),u=r(0);function c(e){return e&&e.__esModule?e:{default:e}}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function p(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var h=t.State={STOPPED:"STOPPED",STARTING:"STARTING",IDLE:"IDLE",PAUSED:"PAUSED",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BUFFER_FLUSHING:"BUFFER_FLUSHING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},g=function(e){function t(){return d(this,t),f(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return p(t,e),n(t,[{key:"doTick",value:function(){}},{key:"startLoad",value:function(){}},{key:"stopLoad",value:function(){var e=this.fragCurrent;e&&(e.loader&&e.loader.abort(),this.fragmentTracker.removeFragment(e)),this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=h.STOPPED}},{key:"_streamEnded",value:function(e,t){var r=this.fragCurrent,n=this.fragmentTracker;if(!t.live&&r&&!r.backtracked&&r.sn===t.endSN&&!e.nextStart){var i=n.getState(r);return i===s.FragmentState.PARTIAL||i===s.FragmentState.OK}return!1}},{key:"onMediaSeeking",value:function(){var e=this.config,t=this.media,r=this.mediaBuffer,n=this.state,i=t?t.currentTime:null,a=l.BufferHelper.bufferInfo(r||t,i,this.config.maxBufferHole);if(Number.isFinite(i)&&u.logger.log("media seeking to "+i.toFixed(3)),n===h.FRAG_LOADING){var o=this.fragCurrent;if(0===a.len&&o){var s=e.maxFragLookUpTolerance,c=o.start-s,d=o.start+o.duration+s;i<c||i>d?(o.loader&&(u.logger.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),o.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.state=h.IDLE):u.logger.log("seeking outside of buffer but within currently loaded fragment range")}}else n===h.ENDED&&(0===a.len&&(this.fragPrevious=null,this.fragCurrent=null),this.state=h.IDLE);t&&(this.lastCurrentTime=i),this.loadedmetadata||(this.nextLoadPosition=this.startPosition=i),this.tick()}},{key:"onMediaEnded",value:function(){this.startPosition=this.lastCurrentTime=0}},{key:"onHandlerDestroying",value:function(){this.stopLoad(),i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"onHandlerDestroying",this).call(this)}},{key:"onHandlerDestroyed",value:function(){this.state=h.STOPPED,this.fragmentTracker=null}}]),t}(o.default);t.default=g},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function e(t,r,n){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,r);if(void 0===i){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,r,n)}if("value"in i)return i.value;var o=i.get;return void 0!==o?o.call(n):void 0},a=r(1),o=g(a),s=r(3),l=g(s),u=r(2),c=r(0),d=r(16),f=g(d),p=r(35),h=g(p);function g(e){return e&&e.__esModule?e:{default:e}}function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function m(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var x=window,b=x.performance,k={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},_={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"},w=function(e){function t(e){y(this,t);var r=v(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,o.default.MANIFEST_LOADING,o.default.LEVEL_LOADING,o.default.AUDIO_TRACK_LOADING,o.default.SUBTITLE_TRACK_LOADING));return r.loaders={},r}return m(t,e),n(t,[{key:"createInternalLoader",value:function(e){var t=this.hls.config,r=t.pLoader,n=t.loader,i=r||n,a=new i(t);return e.loader=a,this.loaders[e.type]=a,a}},{key:"getInternalLoader",value:function(e){return this.loaders[e.type]}},{key:"resetInternalLoader",value:function(e){this.loaders[e]&&delete this.loaders[e]}},{key:"destroyInternalLoaders",value:function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}},{key:"destroy",value:function(){this.destroyInternalLoaders(),i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}},{key:"onManifestLoading",value:function(e){this.load(e.url,{type:k.MANIFEST,level:0,id:null})}},{key:"onLevelLoading",value:function(e){this.load(e.url,{type:k.LEVEL,level:e.level,id:e.id})}},{key:"onAudioTrackLoading",value:function(e){this.load(e.url,{type:k.AUDIO_TRACK,level:null,id:e.id})}},{key:"onSubtitleTrackLoading",value:function(e){this.load(e.url,{type:k.SUBTITLE_TRACK,level:null,id:e.id})}},{key:"load",value:function(e,t){var r=this.hls.config;c.logger.debug("Loading playlist of type "+t.type+", level: "+t.level+", id: "+t.id);var n=this.getInternalLoader(t);if(n){var i=n.context;if(i&&i.url===e)return c.logger.trace("playlist request ongoing"),!1;c.logger.warn("aborting previous loader for type: "+t.type),n.abort()}var a=void 0,o=void 0,s=void 0,l=void 0;switch(t.type){case k.MANIFEST:a=r.manifestLoadingMaxRetry,o=r.manifestLoadingTimeOut,s=r.manifestLoadingRetryDelay,l=r.manifestLoadingMaxRetryTimeout;break;case k.LEVEL:a=0,o=r.levelLoadingTimeOut;break;default:a=r.levelLoadingMaxRetry,o=r.levelLoadingTimeOut,s=r.levelLoadingRetryDelay,l=r.levelLoadingMaxRetryTimeout;break}n=this.createInternalLoader(t),t.url=e,t.responseType=t.responseType||"";var u={timeout:o,maxRetry:a,retryDelay:s,maxRetryDelay:l},d={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};return c.logger.debug("Calling internal loader delegate for URL: "+e),n.load(t,u,d),!0}},{key:"loadsuccess",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(r.isSidxRequest)return this._handleSidxRequest(e,r),void this._handlePlaylistLoaded(e,t,r,n);this.resetInternalLoader(r.type);var i=e.data;t.tload=b.now(),0===i.indexOf("#EXTM3U")?i.indexOf("#EXTINF:")>0||i.indexOf("#EXT-X-TARGETDURATION:")>0?this._handleTrackOrLevelPlaylist(e,t,r,n):this._handleMasterPlaylist(e,t,r,n):this._handleManifestParsingError(e,r,"no EXTM3U delimiter",n)}},{key:"loaderror",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._handleNetworkError(t,r,!1,e)}},{key:"loadtimeout",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._handleNetworkError(t,r,!0)}},{key:"_handleMasterPlaylist",value:function(e,r,n,i){var a=this.hls,s=e.data,l=t.getResponseUrl(e,n),u=h.default.parseMasterPlaylist(s,l);if(u.length){var d=u.map((function(e){return{id:e.attrs.AUDIO,codec:e.audioCodec}})),f=h.default.parseMasterPlaylistMedia(s,l,"AUDIO",d),p=h.default.parseMasterPlaylistMedia(s,l,"SUBTITLES");if(f.length){var g=!1;f.forEach((function(e){e.url||(g=!0)})),!1===g&&u[0].audioCodec&&!u[0].attrs.AUDIO&&(c.logger.log("audio codec signaled in quality level, but no embedded audio track signaled, create one"),f.unshift({type:"main",name:"main"}))}a.trigger(o.default.MANIFEST_LOADED,{levels:u,audioTracks:f,subtitles:p,url:l,stats:r,networkDetails:i})}else this._handleManifestParsingError(e,n,"no level found in manifest",i)}},{key:"_handleTrackOrLevelPlaylist",value:function(e,r,n,i){var a=this.hls,s=n.id,l=n.level,u=n.type,c=t.getResponseUrl(e,n),d=Number.isFinite(s)?s:0,f=Number.isFinite(l)?l:d,p=t.mapContextToLevelType(n),g=h.default.parseLevelPlaylist(e.data,c,f,p,d);if(g.tload=r.tload,u===k.MANIFEST){var y={url:c,details:g};a.trigger(o.default.MANIFEST_LOADED,{levels:[y],audioTracks:[],url:c,stats:r,networkDetails:i})}if(r.tparsed=b.now(),g.needSidxRanges){var v=g.initSegment.url;this.load(v,{isSidxRequest:!0,type:u,level:l,levelDetails:g,id:s,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer"})}else n.levelDetails=g,this._handlePlaylistLoaded(e,r,n,i)}},{key:"_handleSidxRequest",value:function(e,t){var r=f.default.parseSegmentIndex(new Uint8Array(e.data));if(r){var n=r.references,i=t.levelDetails;n.forEach((function(e,t){var r=e.info,n=i.fragments[t];0===n.byteRange.length&&(n.rawByteRange=String(1+r.end-r.start)+"@"+String(r.start))})),i.initSegment.rawByteRange=String(r.moovEndOffset)+"@0"}}},{key:"_handleManifestParsingError",value:function(e,t,r,n){this.hls.trigger(o.default.ERROR,{type:u.ErrorTypes.NETWORK_ERROR,details:u.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:e.url,reason:r,networkDetails:n})}},{key:"_handleNetworkError",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;c.logger.info("A network error occured while loading a "+e.type+"-type playlist");var i=void 0,a=void 0,s=this.getInternalLoader(e);switch(e.type){case k.MANIFEST:i=r?u.ErrorDetails.MANIFEST_LOAD_TIMEOUT:u.ErrorDetails.MANIFEST_LOAD_ERROR,a=!0;break;case k.LEVEL:i=r?u.ErrorDetails.LEVEL_LOAD_TIMEOUT:u.ErrorDetails.LEVEL_LOAD_ERROR,a=!1;break;case k.AUDIO_TRACK:i=r?u.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:u.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,a=!1;break;default:a=!1}s&&(s.abort(),this.resetInternalLoader(e.type));var l={type:u.ErrorTypes.NETWORK_ERROR,details:i,fatal:a,url:s.url,loader:s,context:e,networkDetails:t};n&&(l.response=n),this.hls.trigger(o.default.ERROR,l)}},{key:"_handlePlaylistLoaded",value:function(e,r,n,i){var a=n.type,s=n.level,l=n.id,u=n.levelDetails;if(u.targetduration){var c=t.canHaveQualityLevels(n.type);if(c)this.hls.trigger(o.default.LEVEL_LOADED,{details:u,level:s||0,id:l||0,stats:r,networkDetails:i});else switch(a){case k.AUDIO_TRACK:this.hls.trigger(o.default.AUDIO_TRACK_LOADED,{details:u,id:l,stats:r,networkDetails:i});break;case k.SUBTITLE_TRACK:this.hls.trigger(o.default.SUBTITLE_TRACK_LOADED,{details:u,id:l,stats:r,networkDetails:i});break}}else this._handleManifestParsingError(e,n,"invalid target duration",i)}}],[{key:"canHaveQualityLevels",value:function(e){return e!==k.AUDIO_TRACK&&e!==k.SUBTITLE_TRACK}},{key:"mapContextToLevelType",value:function(e){var t=e.type;switch(t){case k.AUDIO_TRACK:return _.AUDIO;case k.SUBTITLE_TRACK:return _.SUBTITLE;default:return _.MAIN}}},{key:"getResponseUrl",value:function(e,t){var r=e.url;return void 0!==r&&0!==r.indexOf("data:")||(r=t.url),r}},{key:"ContextType",get:function(){return k}},{key:"LevelType",get:function(){return _}}]),t}(l.default);t.default=w,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0),a=r(1),o=s(a);function s(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var u=Math.pow(2,32)-1,c=function(){function e(t,r){l(this,e),this.observer=t,this.remuxer=r}return n(e,[{key:"resetTimeStamp",value:function(e){this.initPTS=e}},{key:"resetInitSegment",value:function(t,r,n,i){if(t&&t.byteLength){var a=this.initData=e.parseInitSegment(t);null==r&&(r="mp4a.40.5"),null==n&&(n="avc1.42e01e");var s={};a.audio&&a.video?s.audiovideo={container:"video/mp4",codec:r+","+n,initSegment:i?t:null}:(a.audio&&(s.audio={container:"audio/mp4",codec:r,initSegment:i?t:null}),a.video&&(s.video={container:"video/mp4",codec:n,initSegment:i?t:null})),this.observer.trigger(o.default.FRAG_PARSING_INIT_SEGMENT,{tracks:s})}else r&&(this.audioCodec=r),n&&(this.videoCodec=n)}},{key:"append",value:function(t,r,n,i){var a=this.initData;a||(this.resetInitSegment(t,this.audioCodec,this.videoCodec,!1),a=this.initData);var s=void 0,l=this.initPTS;if(void 0===l){var u=e.getStartDTS(a,t);this.initPTS=l=u-r,this.observer.trigger(o.default.INIT_PTS_FOUND,{initPTS:l})}e.offsetStartDTS(a,t,l),s=e.getStartDTS(a,t),this.remuxer.remux(a.audio,a.video,null,null,s,n,i,t)}},{key:"destroy",value:function(){}}],[{key:"probe",value:function(t){return e.findBox({data:t,start:0,end:Math.min(t.length,16384)},["moof"]).length>0}},{key:"bin2str",value:function(e){return String.fromCharCode.apply(null,e)}},{key:"readUint16",value:function(e,t){e.data&&(t+=e.start,e=e.data);var r=e[t]<<8|e[t+1];return r<0?65536+r:r}},{key:"readUint32",value:function(e,t){e.data&&(t+=e.start,e=e.data);var r=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];return r<0?4294967296+r:r}},{key:"writeUint32",value:function(e,t,r){e.data&&(t+=e.start,e=e.data),e[t]=r>>24,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r}},{key:"findBox",value:function(t,r){var n=[],i=void 0,a=void 0,o=void 0,s=void 0,l=void 0,u=void 0,c=void 0;if(t.data?(u=t.start,s=t.end,t=t.data):(u=0,s=t.byteLength),!r.length)return null;for(i=u;i<s;)a=e.readUint32(t,i),o=e.bin2str(t.subarray(i+4,i+8)),c=a>1?i+a:s,o===r[0]&&(1===r.length?n.push({data:t,start:i+8,end:c}):(l=e.findBox({data:t,start:i+8,end:c},r.slice(1)),l.length&&(n=n.concat(l)))),i=c;return n}},{key:"parseSegmentIndex",value:function(t){var r=e.findBox(t,["moov"])[0],n=r?r.end:null,i=0,a=e.findBox(t,["sidx"]),o=void 0;if(!a||!a[0])return null;o=[],a=a[0];var s=a.data[0];i=0===s?8:16;var l=e.readUint32(a,i);i+=4;var u=0,c=0;i+=0===s?8:16,i+=2;var d=a.end+c,f=e.readUint16(a,i);i+=2;for(var p=0;p<f;p++){var h=i,g=e.readUint32(a,h);h+=4;var y=2147483647&g,v=(2147483648&g)>>>31;if(1===v)return void console.warn("SIDX has hierarchical references (not supported)");var m=e.readUint32(a,h);h+=4,o.push({referenceSize:y,subsegmentDuration:m,info:{duration:m/l,start:d,end:d+y-1}}),d+=y,h+=4,i=h}return{earliestPresentationTime:u,timescale:l,version:s,referencesCount:f,references:o,moovEndOffset:n}}},{key:"parseInitSegment",value:function(t){var r=[],n=e.findBox(t,["moov","trak"]);return n.forEach((function(t){var n=e.findBox(t,["tkhd"])[0];if(n){var a=n.data[n.start],o=0===a?12:20,s=e.readUint32(n,o),l=e.findBox(t,["mdia","mdhd"])[0];if(l){a=l.data[l.start],o=0===a?12:20;var u=e.readUint32(l,o),c=e.findBox(t,["mdia","hdlr"])[0];if(c){var d=e.bin2str(c.data.subarray(c.start+8,c.start+12)),f={soun:"audio",vide:"video"}[d];if(f){var p=e.findBox(t,["mdia","minf","stbl","stsd"]);if(p.length){p=p[0];var h=e.bin2str(p.data.subarray(p.start+12,p.start+16));i.logger.log("MP4Demuxer:"+f+":"+h+" found")}r[s]={timescale:u,type:f},r[f]={timescale:u,id:s}}}}}})),r}},{key:"getStartDTS",value:function(t,r){var n=void 0,i=void 0,a=void 0;return n=e.findBox(r,["moof","traf"]),i=[].concat.apply([],n.map((function(r){return e.findBox(r,["tfhd"]).map((function(n){var i=void 0,a=void 0,o=void 0;return i=e.readUint32(n,4),a=t[i].timescale||9e4,o=e.findBox(r,["tfdt"]).map((function(t){var r=void 0,n=void 0;return r=t.data[t.start],n=e.readUint32(t,4),1===r&&(n*=Math.pow(2,32),n+=e.readUint32(t,8)),n}))[0],o/a}))}))),a=Math.min.apply(null,i),isFinite(a)?a:0}},{key:"offsetStartDTS",value:function(t,r,n){e.findBox(r,["moof","traf"]).map((function(r){return e.findBox(r,["tfhd"]).map((function(i){var a=e.readUint32(i,4),o=t[a].timescale||9e4;e.findBox(r,["tfdt"]).map((function(t){var r=t.data[t.start],i=e.readUint32(t,4);if(0===r)e.writeUint32(t,4,i-n*o);else{i*=Math.pow(2,32),i+=e.readUint32(t,8),i-=n*o,i=Math.max(i,0);var a=Math.floor(i/(u+1)),s=Math.floor(i%(u+1));e.writeUint32(t,4,a),e.writeUint32(t,8,s)}}))}))}))}}]),e}();t.default=c,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(8),a=o(i);function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var l=function(){function e(){s(this,e),this.method=null,this.key=null,this.iv=null,this._uri=null}return n(e,[{key:"uri",get:function(){return!this._uri&&this.reluri&&(this._uri=a.buildAbsoluteURL(this.baseuri,this.reluri,{alwaysNormalize:!0})),this._uri}}]),e}();t.default=l,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0}};function i(e,t){var r=n[t];return!!r&&!0===r[e.slice(0,4)]}function a(e,t){return window.MediaSource.isTypeSupported((t||"video")+'/mp4;codecs="'+e+'"')}t.isCodecType=i,t.isCodecSupportedInMp4=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=(r(20),r(41)),a=y(i),o=r(1),s=g(o),l=r(21),u=g(l),c=r(0),d=r(2),f=r(13),p=r(5),h=r(24);function g(e){return e&&e.__esModule?e:{default:e}}function y(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var m=(0,p.getSelfScope)(),x=(0,f.getMediaSource)(),b=function(){function e(t,r){var n=this;v(this,e),this.hls=t,this.id=r;var i=this.observer=new h.Observer,o=t.config,l=function(e,r){r=r||{},r.frag=n.frag,r.id=n.id,t.trigger(e,r)};i.on(s.default.FRAG_DECRYPTED,l),i.on(s.default.FRAG_PARSING_INIT_SEGMENT,l),i.on(s.default.FRAG_PARSING_DATA,l),i.on(s.default.FRAG_PARSED,l),i.on(s.default.ERROR,l),i.on(s.default.FRAG_PARSING_METADATA,l),i.on(s.default.FRAG_PARSING_USERDATA,l),i.on(s.default.INIT_PTS_FOUND,l);var f={mp4:x.isTypeSupported("video/mp4"),mpeg:x.isTypeSupported("audio/mpeg"),mp3:x.isTypeSupported('audio/mp4; codecs="mp3"')},p=navigator.vendor;if(o.enableWorker&&"undefined"!==typeof Worker){c.logger.log("demuxing in webworker");var g=void 0;try{g=this.w=a(55),this.onwmsg=this.onWorkerMessage.bind(this),g.addEventListener("message",this.onwmsg),g.onerror=function(e){t.trigger(s.default.ERROR,{type:d.ErrorTypes.OTHER_ERROR,details:d.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",err:{message:e.message+" ("+e.filename+":"+e.lineno+")"}})},g.postMessage({cmd:"init",typeSupported:f,vendor:p,id:r,config:JSON.stringify(o)})}catch(y){c.logger.warn("Error in worker:",y),c.logger.error("Error while initializing DemuxerWorker, fallback on DemuxerInline"),g&&m.URL.revokeObjectURL(g.objectURL),this.demuxer=new u.default(i,f,o,p),this.w=void 0}}else this.demuxer=new u.default(i,f,o,p)}return n(e,[{key:"destroy",value:function(){var e=this.w;if(e)e.removeEventListener("message",this.onwmsg),e.terminate(),this.w=null;else{var t=this.demuxer;t&&(t.destroy(),this.demuxer=null)}var r=this.observer;r&&(r.removeAllListeners(),this.observer=null)}},{key:"push",value:function(e,t,r,n,i,a,o,s){var l=this.w,u=Number.isFinite(i.startPTS)?i.startPTS:i.start,d=i.decryptdata,f=this.frag,p=!(f&&i.cc===f.cc),h=!(f&&i.level===f.level),g=f&&i.sn===f.sn+1,y=!h&&g;if(p&&c.logger.log(this.id+":discontinuity detected"),h&&c.logger.log(this.id+":switch detected"),this.frag=i,l)l.postMessage({cmd:"demux",data:e,decryptdata:d,initSegment:t,audioCodec:r,videoCodec:n,timeOffset:u,discontinuity:p,trackSwitch:h,contiguous:y,duration:a,accurateTimeOffset:o,defaultInitPTS:s},e instanceof ArrayBuffer?[e]:[]);else{var v=this.demuxer;v&&v.push(e,d,t,r,n,u,p,h,y,a,o,s)}}},{key:"onWorkerMessage",value:function(e){var t=e.data,r=this.hls;switch(t.event){case"init":m.URL.revokeObjectURL(this.w.objectURL);break;case s.default.FRAG_PARSING_DATA:t.data.data1=new Uint8Array(t.data1),t.data2&&(t.data.data2=new Uint8Array(t.data2));default:t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,r.trigger(t.event,t.data);break}}}]),e}();t.default=b,e.exports=t["default"]},function(e,t,r){"use strict";var n,i="object"===typeof Reflect?Reflect:null,a=i&&"function"===typeof i.apply?i.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};function o(e){console&&console.warn&&console.warn(e)}n=i&&"function"===typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!==e};function l(){l.init.call(this)}e.exports=l,e.exports.once=b,l.EventEmitter=l,l.prototype._events=void 0,l.prototype._eventsCount=0,l.prototype._maxListeners=void 0;var u=10;function c(e){if("function"!==typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function d(e){return void 0===e._maxListeners?l.defaultMaxListeners:e._maxListeners}function f(e,t,r,n){var i,a,s;if(c(r),a=e._events,void 0===a?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),s=a[t]),void 0===s)s=a[t]=r,++e._eventsCount;else if("function"===typeof s?s=a[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),i=d(e),i>0&&s.length>i&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=s.length,o(l)}return e}function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=p.bind(n);return i.listener=r,n.wrapFn=i,i}function g(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"===typeof i?r?[i.listener||i]:[i]:r?x(i):v(i,i.length)}function y(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"===typeof r)return 1;if(void 0!==r)return r.length}return 0}function v(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function m(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function x(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}function b(e,t){return new Promise((function(r,n){function i(){void 0!==a&&e.removeListener("error",a),r([].slice.call(arguments))}var a;"error"!==t&&(a=function(r){e.removeListener(t,i),n(r)},e.once("error",a)),e.once(t,i)}))}Object.defineProperty(l,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!==typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}}),l.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},l.prototype.setMaxListeners=function(e){if("number"!==typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},l.prototype.getMaxListeners=function(){return d(this)},l.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=i[e];if(void 0===l)return!1;if("function"===typeof l)a(l,this,t);else{var u=l.length,c=v(l,u);for(r=0;r<u;++r)a(c[r],this,t)}return!0},l.prototype.addListener=function(e,t){return f(this,e,t,!1)},l.prototype.on=l.prototype.addListener,l.prototype.prependListener=function(e,t){return f(this,e,t,!0)},l.prototype.once=function(e,t){return c(t),this.on(e,h(this,e,t)),this},l.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,h(this,e,t)),this},l.prototype.removeListener=function(e,t){var r,n,i,a,o;if(c(t),n=this._events,void 0===n)return this;if(r=n[e],void 0===r)return this;if(r===t||r.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!==typeof r){for(i=-1,a=r.length-1;a>=0;a--)if(r[a]===t||r[a].listener===t){o=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():m(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,o||t)}return this},l.prototype.off=l.prototype.removeListener,l.prototype.removeAllListeners=function(e){var t,r,n;if(r=this._events,void 0===r)return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,a=Object.keys(r);for(n=0;n<a.length;++n)i=a[n],"removeListener"!==i&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=r[e],"function"===typeof t)this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},l.prototype.listeners=function(e){return g(this,e,!0)},l.prototype.rawListeners=function(e){return g(this,e,!1)},l.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):y.call(e,t)},l.prototype.listenerCount=y,l.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(1),a=w(i),o=r(2),s=r(12),l=w(s),u=r(45),c=w(u),d=r(16),f=w(d),p=r(46),h=w(p),g=r(49),y=w(g),v=r(50),m=w(v),x=r(53),b=w(x),k=r(5),_=r(0);function w(e){return e&&e.__esModule?e:{default:e}}function E(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var T=(0,k.getSelfScope)(),S=void 0;try{S=T.performance.now.bind(T.performance)}catch(R){_.logger.debug("Unable to use Performance API on this environment"),S=T.Date.now}var O=function(){function e(t,r,n,i){E(this,e),this.observer=t,this.typeSupported=r,this.config=n,this.vendor=i}return n(e,[{key:"destroy",value:function(){var e=this.demuxer;e&&e.destroy()}},{key:"push",value:function(e,t,r,n,i,o,s,u,c,d,f,p){var h=this;if(e.byteLength>0&&null!=t&&null!=t.key&&"AES-128"===t.method){var g=this.decrypter;null==g&&(g=this.decrypter=new l.default(this.observer,this.config));var y=S();g.decrypt(e,t.key.buffer,t.iv.buffer,(function(e){var l=S();h.observer.trigger(a.default.FRAG_DECRYPTED,{stats:{tstart:y,tdecrypt:l}}),h.pushDecrypted(new Uint8Array(e),t,new Uint8Array(r),n,i,o,s,u,c,d,f,p)}))}else this.pushDecrypted(new Uint8Array(e),t,new Uint8Array(r),n,i,o,s,u,c,d,f,p)}},{key:"pushDecrypted",value:function(e,t,r,n,i,s,l,u,d,p,g,v){var x=this.demuxer;if(!x||(l||u)&&!this.probe(e)){for(var k=this.observer,_=this.typeSupported,w=this.config,E=[{demux:h.default,remux:m.default},{demux:f.default,remux:b.default},{demux:c.default,remux:m.default},{demux:y.default,remux:m.default}],T=0,S=E.length;T<S;T++){var O=E[T],R=O.demux.probe;if(R(e)){var A=this.remuxer=new O.remux(k,w,_,this.vendor);x=new O.demux(k,A,w,_),this.probe=R;break}}if(!x)return void k.trigger(a.default.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"});this.demuxer=x}var P=this.remuxer;(l||u)&&(x.resetInitSegment(r,n,i,p),P.resetInitSegment()),l&&(x.resetTimeStamp(v),P.resetTimeStamp(v)),"function"===typeof x.setDecryptData&&x.setDecryptData(t),x.append(e,s,d,g)}}]),e}();t.default=O,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getAudioConfig=l,t.isHeaderPattern=u,t.getHeaderLength=c,t.getFullFrameLength=d,t.isHeader=f,t.probe=p,t.initTrackConfig=h,t.getFrameDuration=g,t.parseFrameHeader=y,t.appendFrame=v;var n=r(0),i=r(2),a=r(1),o=s(a);r(5);function s(e){return e&&e.__esModule?e:{default:e}}function l(e,t,r,a){var s=void 0,l=void 0,u=void 0,c=void 0,d=void 0,f=navigator.userAgent.toLowerCase(),p=a,h=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];if(s=1+((192&t[r+2])>>>6),l=(60&t[r+2])>>>2,!(l>h.length-1))return c=(1&t[r+2])<<2,c|=(192&t[r+3])>>>6,n.logger.log("manifest codec:"+a+",ADTS data:type:"+s+",sampleingIndex:"+l+"["+h[l]+"Hz],channelConfig:"+c),/firefox/i.test(f)?l>=6?(s=5,d=new Array(4),u=l-3):(s=2,d=new Array(2),u=l):-1!==f.indexOf("android")?(s=2,d=new Array(2),u=l):(s=5,d=new Array(4),a&&(-1!==a.indexOf("mp4a.40.29")||-1!==a.indexOf("mp4a.40.5"))||!a&&l>=6?u=l-3:((a&&-1!==a.indexOf("mp4a.40.2")&&(l>=6&&1===c||/vivaldi/i.test(f))||!a&&1===c)&&(s=2,d=new Array(2)),u=l)),d[0]=s<<3,d[0]|=(14&l)>>1,d[1]|=(1&l)<<7,d[1]|=c<<3,5===s&&(d[1]|=(14&u)>>1,d[2]=(1&u)<<7,d[2]|=8,d[3]=0),{config:d,samplerate:h[l],channelCount:c,codec:"mp4a.40."+s,manifestCodec:p};e.trigger(o.default.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+l})}function u(e,t){return 255===e[t]&&240===(246&e[t+1])}function c(e,t){return 1&e[t+1]?7:9}function d(e,t){return(3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5}function f(e,t){return!!(t+1<e.length&&u(e,t))}function p(e,t){if(t+1<e.length&&u(e,t)){var r=c(e,t),n=r;t+5<e.length&&(n=d(e,t));var i=t+n;if(i===e.length||i+1<e.length&&u(e,i))return!0}return!1}function h(e,t,r,i,a){if(!e.samplerate){var o=l(t,r,i,a);e.config=o.config,e.samplerate=o.samplerate,e.channelCount=o.channelCount,e.codec=o.codec,e.manifestCodec=o.manifestCodec,n.logger.log("parsed codec:"+e.codec+",rate:"+o.samplerate+",nb channel:"+o.channelCount)}}function g(e){return 9216e4/e}function y(e,t,r,n,i){var a=void 0,o=void 0,s=void 0,l=e.length;if(a=c(e,t),o=d(e,t),o-=a,o>0&&t+a+o<=l)return s=r+n*i,{headerLength:a,frameLength:o,stamp:s}}function v(e,t,r,n,i){var a=g(e.samplerate),o=y(t,r,n,i,a);if(o){var s=o.stamp,l=o.headerLength,u=o.frameLength,c={unit:t.subarray(r+l,r+l+u),pts:s,dts:s};return e.samples.push(c),e.len+=u,{sample:c,length:u+l}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={BitratesMap:[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],SamplingRateMap:[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],SamplesCoefficients:[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],BytesInSlot:[0,1,1,4],appendFrame:function(e,t,r,n,i){if(!(r+24>t.length)){var a=this.parseHeader(t,r);if(a&&r+a.frameLength<=t.length){var o=9e4*a.samplesPerFrame/a.sampleRate,s=n+i*o,l={unit:t.subarray(r,r+a.frameLength),pts:s,dts:s};return e.config=[],e.channelCount=a.channelCount,e.samplerate=a.sampleRate,e.samples.push(l),e.len+=a.frameLength,{sample:l,length:a.frameLength}}}},parseHeader:function(e,t){var r=e[t+1]>>3&3,i=e[t+1]>>1&3,a=e[t+2]>>4&15,o=e[t+2]>>2&3,s=e[t+2]>>1&1;if(1!==r&&0!==a&&15!==a&&3!==o){var l=3===r?3-i:3===i?3:4,u=1e3*n.BitratesMap[14*l+a-1],c=3===r?0:2===r?1:2,d=n.SamplingRateMap[3*c+o],f=e[t+3]>>6===3?1:2,p=n.SamplesCoefficients[r][i],h=n.BytesInSlot[i],g=8*p*h,y=parseInt(p*u/d+s,10)*h;return{sampleRate:d,channelCount:f,frameLength:y,samplesPerFrame:g}}},isHeaderPattern:function(e,t){return 255===e[t]&&224===(224&e[t+1])&&0!==(6&e[t+1])},isHeader:function(e,t){return!!(t+1<e.length&&this.isHeaderPattern(e,t))},probe:function(e,t){if(t+1<e.length&&this.isHeaderPattern(e,t)){var r=4,n=this.parseHeader(e,t),i=r;n&&n.frameLength&&(i=n.frameLength);var a=t+i;if(a===e.length||a+1<e.length&&this.isHeaderPattern(e,a))return!0}return!1}};t.default=n,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Observer=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(54);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function s(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.Observer=function(e){function t(){return a(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return s(t,e),n(t,[{key:"trigger",value:function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.emit.apply(this,[e,e].concat(r))}}]),t}(i.EventEmitter)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={toString:function(e){for(var t="",r=e.length,n=0;n<r;n++)t+="["+e.start(n).toFixed(3)+","+e.end(n).toFixed(3)+"]";return t}};t.default=n,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findFirstFragWithCC=s,t.findFragWithCC=l,t.shouldAlignOnDiscontinuities=u,t.findDiscontinuousReferenceFrag=c,t.adjustPts=d,t.alignStream=f,t.alignDiscontinuities=p,t.alignPDT=h;var n=r(9),i=o(n),a=r(0);function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){for(var r=null,n=0;n<e.length;n+=1){var i=e[n];if(i&&i.cc===t){r=i;break}}return r}function l(e,t){return i.default.search(e,(function(e){return e.cc<t?1:e.cc>t?-1:0}))}function u(e,t,r){var n=!1;return t&&t.details&&r&&(r.endCC>r.startCC||e&&e.cc<r.startCC)&&(n=!0),n}function c(e,t){var r=e.fragments,n=t.fragments;if(n.length&&r.length){var i=s(r,n[0].cc);if(i&&(!i||i.startPTS))return i;a.logger.log("No frag in previous level to align on")}else a.logger.log("No fragments to align")}function d(e,t){t.fragments.forEach((function(t){if(t){var r=t.start+e;t.start=t.startPTS=r,t.endPTS=r+t.duration}})),t.PTSKnown=!0}function f(e,t,r){p(e,r,t),!r.PTSKnown&&t&&h(r,t.details)}function p(e,t,r){if(u(e,r,t)){var n=c(r.details,t);n&&(a.logger.log("Adjusting PTS using last level due to CC increase within current level"),d(n.start,t))}}function h(e,t){if(t&&t.fragments.length){if(!e.hasProgramDateTime||!t.hasProgramDateTime)return;var r=t.fragments[0].programDateTime,n=e.fragments[0].programDateTime,i=(n-r)/1e3+t.fragments[0].start;Number.isFinite(i)&&(a.logger.log("adjusting PTS using programDateTime delta, sliding:"+i.toFixed(3)),d(i,e))}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findFragmentByPDT=o,t.findFragmentByPTS=s,t.fragmentWithinToleranceTest=l,t.pdtWithinToleranceTest=u;var n=r(9),i=a(n);function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t,r){if(!Array.isArray(e)||!e.length||!Number.isFinite(t))return null;if(t<e[0].programDateTime)return null;if(t>=e[e.length-1].endProgramDateTime)return null;r=r||0;for(var n=0;n<e.length;++n){var i=e[n];if(u(t,r,i))return i}return null}function s(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=e?t[e.sn-t[0].sn+1]:null;return a&&!l(r,n,a)?a:i.default.search(t,l.bind(null,r,n))}function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments[2],n=Math.min(t,r.duration+(r.deltaPTS?r.deltaPTS:0));return r.start+r.duration-n<=e?1:r.start-n>e&&r.start?-1:0}function u(e,t,r){var n=1e3*Math.min(t,r.duration+(r.deltaPTS?r.deltaPTS:0));return r.endProgramDateTime-n>e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(3),a=o(i);function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function u(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var c=function(e){function t(e){var r;s(this,t);for(var n=arguments.length,i=Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];var o=l(this,(r=t.__proto__||Object.getPrototypeOf(t)).call.apply(r,[this,e].concat(i)));return o._tickInterval=null,o._tickTimer=null,o._tickCallCount=0,o._boundTick=o.tick.bind(o),o}return u(t,e),n(t,[{key:"onHandlerDestroying",value:function(){this.clearNextTick(),this.clearInterval()}},{key:"hasInterval",value:function(){return!!this._tickInterval}},{key:"hasNextTick",value:function(){return!!this._tickTimer}},{key:"setInterval",value:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return!this._tickInterval&&(this._tickInterval=setInterval(this._boundTick,e),!0)}))},{key:"clearInterval",value:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(){return!!this._tickInterval&&(clearInterval(this._tickInterval),this._tickInterval=null,!0)}))},{key:"clearNextTick",value:function(){return!!this._tickTimer&&(clearTimeout(this._tickTimer),this._tickTimer=null,!0)}},{key:"tick",value:function(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&(this.clearNextTick(),this._tickTimer=setTimeout(this._boundTick,0)),this._tickCallCount=0)}},{key:"doTick",value:function(){}}]),t}(a.default);t.default=c,e.exports=t["default"]},function(e,t,r){"use strict";function n(e,t){var r=null;try{r=new window.Event("addtrack")}catch(n){r=document.createEvent("Event"),r.initEvent("addtrack",!1,!1)}r.track=e,t.dispatchEvent(r)}function i(e){if(e&&e.cues)while(e.cues.length>0)e.removeCue(e.cues[0])}Object.defineProperty(t,"__esModule",{value:!0}),t.sendAddTrackEvent=n,t.clearCurrentCues=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fixLineBreaks=void 0;var n=r(71),i=a(n);function a(e){return e&&e.__esModule?e:{default:e}}var o=function(){return{decode:function(e){if(!e)return"";if("string"!==typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}};function s(){this.window=window,this.state="INITIAL",this.buffer="",this.decoder=new o,this.regionList=[]}function l(e){function t(e,t,r,n){return 3600*(0|e)+60*(0|t)+(0|r)+(0|n)/1e3}var r=e.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return r?r[3]?t(r[1],r[2],r[3].replace(":",""),r[4]):r[1]>59?t(r[1],r[2],0,r[4]):t(0,r[1],r[2],r[4]):null}function u(){this.values=Object.create(null)}function c(e,t,r,n){var i=n?e.split(n):[e];for(var a in i)if("string"===typeof i[a]){var o=i[a].split(r);if(2===o.length){var s=o[0],l=o[1];t(s,l)}}}u.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,r){return r?this.has(e)?this.values[e]:t[r]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,r){for(var n=0;n<r.length;++n)if(t===r[n]){this.set(e,t);break}},integer:function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},percent:function(e,t){return!!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(t=parseFloat(t),t>=0&&t<=100))&&(this.set(e,t),!0)}};var d=new i.default(0,0,0),f="middle"===d.align?"middle":"center";function p(e,t,r){var n=e;function i(){var t=l(e);if(null===t)throw new Error("Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function a(e,t){var n=new u;c(e,(function(e,t){switch(e){case"region":for(var i=r.length-1;i>=0;i--)if(r[i].id===t){n.set(e,r[i].region);break}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":var a=t.split(","),o=a[0];n.integer(e,o),n.percent(e,o)&&n.set("snapToLines",!1),n.alt(e,o,["auto"]),2===a.length&&n.alt("lineAlign",a[1],["start",f,"end"]);break;case"position":a=t.split(","),n.percent(e,a[0]),2===a.length&&n.alt("positionAlign",a[1],["start",f,"end","line-left","line-right","auto"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start",f,"end","left","right"]);break}}),/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical","");var i=n.get("line","auto");"auto"===i&&-1===d.line&&(i=-1),t.line=i,t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100),t.align=n.get("align",f);var a=n.get("position","auto");"auto"===a&&50===d.position&&(a="start"===t.align||"left"===t.align?0:"end"===t.align||"right"===t.align?100:50),t.position=a}function o(){e=e.replace(/^\s+/,"")}if(o(),t.startTime=i(),o(),"--\x3e"!==e.substr(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);e=e.substr(3),o(),t.endTime=i(),o(),a(e,t)}function h(e){return e.replace(/<br(?: \/)?>/gi,"\n")}s.prototype={parse:function(e){var t=this;function r(){var e=t.buffer,r=0;e=h(e);while(r<e.length&&"\r"!==e[r]&&"\n"!==e[r])++r;var n=e.substr(0,r);return"\r"===e[r]&&++r,"\n"===e[r]&&++r,t.buffer=e.substr(r),n}function n(e){c(e,(function(e,t){switch(e){case"Region":break}}),/:/)}e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));try{var a=void 0;if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;a=r();var o=a.match(/^()?WEBVTT([ \t].*)?$/);if(!o||!o[0])throw new Error("Malformed WebVTT signature.");t.state="HEADER"}var s=!1;while(t.buffer){if(!/\r\n|\n/.test(t.buffer))return this;switch(s?s=!1:a=r(),t.state){case"HEADER":/:/.test(a)?n(a):a||(t.state="ID");continue;case"NOTE":a||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(a)){t.state="NOTE";break}if(!a)continue;if(t.cue=new i.default(0,0,""),t.state="CUE",-1===a.indexOf("--\x3e")){t.cue.id=a;continue}case"CUE":try{p(a,t.cue,t.regionList)}catch(u){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":var l=-1!==a.indexOf("--\x3e");if(!a||l&&(s=!0)){t.oncue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}t.cue.text&&(t.cue.text+="\n"),t.cue.text+=a;continue;case"BADCUE":a||(t.state="ID");continue}}}catch(u){"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var e=this;try{if(e.buffer+=e.decoder.decode(),(e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state)throw new Error("Malformed WebVTT signature.")}catch(t){throw t}return e.onflush&&e.onflush(),this}},t.fixLineBreaks=h,t.default=s},function(e,t,r){e.exports=r(32)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function e(t,r,n){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,r);if(void 0===i){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,r,n)}if("value"in i)return i.value;var o=i.get;return void 0!==o?o.call(n):void 0},o=r(33),s=f(o),l=r(34),u=f(l),c=r(80),d=f(c);function f(e){return e&&e.__esModule?e:{default:e}}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function g(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var y=function(e){function t(e){p(this,t);var r=h(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));r.hlsOpts=e.hlsOpts||{};var n=s.default.util,i=r;if(i.once("complete",(function(){if(i.config.isLive&&(n.addClass(i.root,"xgplayer-is-live"),!n.findDom(i.controls,".xgplayer-live"))){var e=n.createDom("xg-live",i.lang.LIVE||"正在直播",{},"xgplayer-live");i.controls.appendChild(e)}})),r.browser=d.default.getBrowserVersion(),void 0===i.config.useHls){if("mobile"===s.default.sniffer.device&&"MacIntel"!==navigator.platform&&"Win32"!==navigator.platform||r.browser.indexOf("Safari")>-1)return h(r)}else if(!i.config.useHls)return h(r);r._start=r.start,r.start=function(){window.XgVideoProxy||r.root.insertBefore(r.video,r.root.firstChild),setTimeout((function(){r.emit("complete"),r.danmu&&"function"===typeof r.danmu.resize&&r.danmu.resize()}),1)},Number.isFinite=Number.isFinite||function(e){return"number"===typeof e&&isFinite(e)};var a=void 0;return a=new u.default(r.hlsOpts),r.hls=a,Object.defineProperty(i,"src",{get:function(){return i.currentSrc},set:function(e){n.removeClass(i.root,"xgplayer-is-live");var t=document.querySelector(".xgplayer-live");t&&t.parentNode.removeChild(t),i.autoplay=!0;var r=i.paused;r||i.pause(),i.hls.stopLoad(),i.hls.detachMedia(),i.hls.destroy(),i.hls=new u.default(i.hlsOpts),i.register(e),i.once("canplay",(function(){i.play().catch((function(e){}))})),i.hls.loadSource(e),i.hls.attachMedia(i.video)},configurable:!0}),r.register(r.config.url),r.once("complete",(function(){a.attachMedia(i.video),i.once("canplay",(function(){i.play().catch((function(e){}))}))})),r.once("destroy",(function(){a.stopLoad()})),r}return g(t,e),i(t,[{key:"switchURL",value:function(e){var t=this;t.url=e,t.config.url=e;var r=t.currentTime;s.default.util.addClass(t.root,"xgplayer-is-enter"),t.once("playing",(function(){s.default.util.removeClass(t.root,"xgplayer-is-enter")})),t.once("canplay",(function(){t.currentTime=r,t.play()})),"object"===n(t.hls)&&(t.hls.originUrl=e),t.src=e}},{key:"register",value:function(e){var t=this.hls,r=s.default.util,n=this;t.on(u.default.Events.MEDIA_ATTACHED,(function(){t.loadSource(e)})),t.on(u.default.Events.LEVEL_LOADED,(function(e,i){if(!t.inited&&(t.inited=!0,i&&i.details&&i.details.live&&(r.addClass(n.root,"xgplayer-is-live"),!r.findDom(n.root,".xgplayer-live")))){var a=r.createDom("xg-live","正在直播",{},"xgplayer-live");n.controls.appendChild(a)}})),t.on(u.default.Events.ERROR,(function(e,r){if(n.emit("HLS_ERROR",{errorType:r.type,errorDetails:r.details,errorFatal:r.fatal}),r.fatal)switch(r.type){case u.default.ErrorTypes.NETWORK_ERROR:t.startLoad();break;case u.default.ErrorTypes.MEDIA_ERROR:t.recoverMediaError();break;default:n.emit("error",r)}})),this._statistics()}},{key:"_statistics",value:function(){var e={speed:0,playerType:"HlsPlayer"},t={videoDataRate:0,audioDataRate:0},r=this.hls,n=this;r.on(u.default.Events.FRAG_LOAD_PROGRESS,(function(t,r){e.speed=r.stats.loaded/1e3})),r.on(u.default.Events.FRAG_PARSING_DATA,(function(e,r){"video"===r.type&&(t.fps=parseInt(r.nb/(r.endPTS-r.startPTS)))})),r.on(u.default.Events.FRAG_PARSING_INIT_SEGMENT,(function(e,r){if(t.hasAudio=!!(r&&r.tracks&&r.tracks.audio),t.hasVideo=!!(r&&r.tracks&&r.tracks.video),t.hasAudio&&r.tracks.audio){var i=r.tracks.audio;t.audioChannelCount=i.metadata&&i.metadata.channelCount?i.metadata.channelCount:0,t.audioCodec=i.codec}if(t.hasVideo&&r.tracks.video){var a=r.tracks.video;t.videoCodec=a.codec,t.width=a.metadata&&a.metadata.width?a.metadata.width:0,t.height=a.metadata&&a.metadata.height?a.metadata.height:0}t.duration=r.frag&&r.frag.duration?r.frag.duration:0,t.level=r.frag&&r.frag.level?r.frag.level:0,(t.videoCodec||t.audioCodec)&&(t.mimeType='video/hls; codecs="'+t.videoCodec+";"+t.audioCodec+'"'),n.mediainfo=t,n.emit("media_info",t)})),this._statisticsTimmer=setInterval((function(){n.emit("statistics_info",e),e.speed=0}),1e3)}},{key:"destroy",value:function(){a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this),clearInterval(this._statisticsTimmer)}}]),t}(s.default);y.isSupported=u.default.isSupported,y.HlsJs=u.default,t.default=y,e.exports=t["default"]},function(t,r){t.exports=e},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(8),a=O(i),o=r(2),s=r(15),l=S(s),u=r(38),c=S(u),d=r(39),f=S(d),p=r(6),h=r(40),g=S(h),y=r(57),v=S(y),m=r(58),x=S(m),b=r(59),k=r(0),_=r(60),w=r(1),E=S(w),T=r(24);function S(e){return e&&e.__esModule?e:{default:e}}function O(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function R(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function A(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function P(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var L=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};R(this,t);var r=A(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),n=t.DefaultConfig;if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");for(var i in n)i in e||(e[i]=n[i]);if(void 0!==e.liveMaxLatencyDurationCount&&e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount)throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be gt "liveSyncDurationCount"');if(void 0!==e.liveMaxLatencyDuration&&(e.liveMaxLatencyDuration<=e.liveSyncDuration||void 0===e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be gt "liveSyncDuration"');(0,k.enableLogs)(e.debug),r.config=e,r._autoLevelCapping=-1;var a=r.abrController=new e.abrController(r),o=new e.bufferController(r),s=new e.capLevelController(r),u=new e.fpsController(r),d=new l.default(r),h=new c.default(r),y=new f.default(r),m=new x.default(r),b=r.levelController=new v.default(r),_=new p.FragmentTracker(r),w=r.streamController=new g.default(r,_),E=[b,w],T=e.audioStreamController;T&&E.push(new T(r,_)),r.networkControllers=E;var S=[d,h,y,a,o,s,u,m,_];if(T=e.audioTrackController,T){var O=new T(r);r.audioTrackController=O,S.push(O)}if(T=e.subtitleTrackController,T){var P=new T(r);r.subtitleTrackController=P,E.push(P)}if(T=e.emeController,T){var L=new T(r);r.emeController=L,S.push(L)}return T=e.subtitleStreamController,T&&E.push(new T(r,_)),T=e.timelineController,T&&S.push(new T(r)),r.coreComponents=S,r}return P(t,e),n(t,null,[{key:"isSupported",value:function(){return(0,b.isSupported)()}},{key:"version",get:function(){return __VERSION__}},{key:"Events",get:function(){return E.default}},{key:"ErrorTypes",get:function(){return o.ErrorTypes}},{key:"ErrorDetails",get:function(){return o.ErrorDetails}},{key:"DefaultConfig",get:function(){return t.defaultConfig?t.defaultConfig:_.hlsDefaultConfig},set:function(e){t.defaultConfig=e}}]),n(t,[{key:"destroy",value:function(){k.logger.log("destroy"),this.trigger(E.default.DESTROYING),this.detachMedia(),this.coreComponents.concat(this.networkControllers).forEach((function(e){e.destroy()})),this.url=null,this.removeAllListeners(),this._autoLevelCapping=-1}},{key:"attachMedia",value:function(e){k.logger.log("attachMedia"),this.media=e,this.trigger(E.default.MEDIA_ATTACHING,{media:e})}},{key:"detachMedia",value:function(){k.logger.log("detachMedia"),this.trigger(E.default.MEDIA_DETACHING),this.media=null}},{key:"loadSource",value:function(e){e=a.buildAbsoluteURL(window.location.href,e,{alwaysNormalize:!0}),k.logger.log("loadSource:"+e),this.url=e,this.trigger(E.default.MANIFEST_LOADING,{url:e})}},{key:"startLoad",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;k.logger.log("startLoad("+e+")"),this.networkControllers.forEach((function(t){t.startLoad(e)}))}},{key:"stopLoad",value:function(){k.logger.log("stopLoad"),this.networkControllers.forEach((function(e){e.stopLoad()}))}},{key:"swapAudioCodec",value:function(){k.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}},{key:"recoverMediaError",value:function(){k.logger.log("recoverMediaError");var e=this.media;this.detachMedia(),this.attachMedia(e)}},{key:"levels",get:function(){return this.levelController.levels}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(e){k.logger.log("set currentLevel:"+e),this.loadLevel=e,this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(e){k.logger.log("set nextLevel:"+e),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(e){k.logger.log("set loadLevel:"+e),this.levelController.manualLevel=e}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(e){this.levelController.nextLoadLevel=e}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(e){k.logger.log("set firstLevel:"+e),this.levelController.firstLevel=e}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(e){k.logger.log("set startLevel:"+e);var t=this;-1!==e&&(e=Math.max(e,t.minAutoLevel)),t.levelController.startLevel=e}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(e){k.logger.log("set autoLevelCapping:"+e),this._autoLevelCapping=e}},{key:"autoLevelEnabled",get:function(){return-1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){for(var e=this,t=e.levels,r=e.config.minAutoBitrate,n=t?t.length:0,i=0;i<n;i++){var a=t[i].realBitrate?Math.max(t[i].realBitrate,t[i].bitrate):t[i].bitrate;if(a>r)return i}return 0}},{key:"maxAutoLevel",get:function(){var e=this,t=e.levels,r=e.autoLevelCapping,n=void 0;return n=-1===r&&t&&t.length?t.length-1:r,n}},{key:"nextAutoLevel",get:function(){var e=this;return Math.min(Math.max(e.abrController.nextAutoLevel,e.minAutoLevel),e.maxAutoLevel)},set:function(e){var t=this;t.abrController.nextAutoLevel=Math.max(t.minAutoLevel,e)}},{key:"audioTracks",get:function(){var e=this.audioTrackController;return e?e.audioTracks:[]}},{key:"audioTrack",get:function(){var e=this.audioTrackController;return e?e.audioTrack:-1},set:function(e){var t=this.audioTrackController;t&&(t.audioTrack=e)}},{key:"liveSyncPosition",get:function(){return this.streamController.liveSyncPosition}},{key:"subtitleTracks",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTrack:-1},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}},{key:"subtitleDisplay",get:function(){var e=this.subtitleTrackController;return!!e&&e.subtitleDisplay},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}}]),t}(T.Observer);t.default=L,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(8),a=v(i),o=r(11),s=y(o),l=r(36),u=y(l),c=r(17),d=y(c),f=r(37),p=y(f),h=r(0),g=r(18);function y(e){return e&&e.__esModule?e:{default:e}}function v(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var x=/#EXT-X-STREAM-INF:([^\n\r]*)[\r\n]+([^\r\n]+)/g,b=/#EXT-X-MEDIA:(.*)/g,k=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/|(?!#)([\S+ ?]+)/.source,/|#EXT-X-BYTERANGE:*(.+)/.source,/|#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/|#.*/.source].join(""),"g"),_=/(?:(?:#(EXTM3U))|(?:#EXT-X-(PLAYLIST-TYPE):(.+))|(?:#EXT-X-(MEDIA-SEQUENCE): *(\d+))|(?:#EXT-X-(TARGETDURATION): *(\d+))|(?:#EXT-X-(KEY):(.+))|(?:#EXT-X-(START):(.+))|(?:#EXT-X-(ENDLIST))|(?:#EXT-X-(DISCONTINUITY-SEQ)UENCE:(\d+))|(?:#EXT-X-(DIS)CONTINUITY))|(?:#EXT-X-(VERSION):(\d+))|(?:#EXT-X-(MAP):(.+))|(?:(#)([^:]*):(.*))|(?:(#)(.*))(?:.*)\r?\n?/,w=/\.(mp4|m4s|m4v|m4a)$/i,E=function(){function e(){m(this,e)}return n(e,null,[{key:"findGroup",value:function(e,t){if(!e)return null;for(var r=null,n=0;n<e.length;n++){var i=e[n];i.id===t&&(r=i)}return r}},{key:"convertAVC1ToAVCOTI",value:function(e){var t=void 0,r=e.split(".");return r.length>2?(t=r.shift()+".",t+=parseInt(r.shift()).toString(16),t+=("000"+parseInt(r.shift()).toString(16)).substr(-4)):t=e,t}},{key:"resolve",value:function(e,t){return a.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}},{key:"parseMasterPlaylist",value:function(t,r){var n=[],i=void 0;function a(e,t){["video","audio"].forEach((function(r){var n=e.filter((function(e){return(0,g.isCodecType)(e,r)}));if(n.length){var i=n.filter((function(e){return 0===e.lastIndexOf("avc1",0)||0===e.lastIndexOf("mp4a",0)}));t[r+"Codec"]=i.length>0?i[0]:n[0],e=e.filter((function(e){return-1===n.indexOf(e)}))}})),t.unknownCodecs=e}x.lastIndex=0;while(null!=(i=x.exec(t))){var o={},s=o.attrs=new p.default(i[1]);o.url=e.resolve(i[2],r);var l=s.decimalResolution("RESOLUTION");l&&(o.width=l.width,o.height=l.height),o.bitrate=s.decimalInteger("AVERAGE-BANDWIDTH")||s.decimalInteger("BANDWIDTH"),o.name=s.NAME,a([].concat((s.CODECS||"").split(/[ ,]+/)),o),o.videoCodec&&-1!==o.videoCodec.indexOf("avc1")&&(o.videoCodec=e.convertAVC1ToAVCOTI(o.videoCodec)),n.push(o)}return n}},{key:"parseMasterPlaylistMedia",value:function(t,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],a=void 0,o=[],s=0;b.lastIndex=0;while(null!==(a=b.exec(t))){var l={},u=new p.default(a[1]);if(u.TYPE===n){if(l.groupId=u["GROUP-ID"],l.name=u.NAME,l.type=n,l.default="YES"===u.DEFAULT,l.autoselect="YES"===u.AUTOSELECT,l.forced="YES"===u.FORCED,u.URI&&(l.url=e.resolve(u.URI,r)),l.lang=u.LANGUAGE,l.name||(l.name=l.lang),i.length){var c=e.findGroup(i,l.groupId);l.audioCodec=c?c.codec:i[0].codec}l.id=s++,o.push(l)}}return o}},{key:"parseLevelPlaylist",value:function(e,t,r,n,i){var a=0,o=0,l=new u.default(t),c=new d.default,f=0,g=null,y=new s.default,v=void 0,m=void 0,x=null;k.lastIndex=0;while(null!==(v=k.exec(e))){var b=v[1];if(b){y.duration=parseFloat(b);var E=(" "+v[2]).slice(1);y.title=E||null,y.tagList.push(E?["INF",b,E]:["INF",b])}else if(v[3]){if(Number.isFinite(y.duration)){var O=a++;y.type=n,y.start=o,y.levelkey=c,y.sn=O,y.level=r,y.cc=f,y.urlId=i,y.baseurl=t,y.relurl=(" "+v[3]).slice(1),S(y,g),l.fragments.push(y),g=y,o+=y.duration,y=new s.default}}else if(v[4]){if(y.rawByteRange=(" "+v[4]).slice(1),g){var R=g.byteRangeEndOffset;R&&(y.lastByteRangeEndOffset=R)}}else if(v[5])y.rawProgramDateTime=(" "+v[5]).slice(1),y.tagList.push(["PROGRAM-DATE-TIME",y.rawProgramDateTime]),null===x&&(x=l.fragments.length);else{for(v=v[0].match(_),m=1;m<v.length;m++)if(void 0!==v[m])break;var A=(" "+v[m+1]).slice(1),P=(" "+v[m+2]).slice(1);switch(v[m]){case"#":y.tagList.push(P?[A,P]:[A]);break;case"PLAYLIST-TYPE":l.type=A.toUpperCase();break;case"MEDIA-SEQUENCE":a=l.startSN=parseInt(A);break;case"TARGETDURATION":l.targetduration=parseFloat(A);break;case"VERSION":l.version=parseInt(A);break;case"EXTM3U":break;case"ENDLIST":l.live=!1;break;case"DIS":f++,y.tagList.push(["DIS"]);break;case"DISCONTINUITY-SEQ":f=parseInt(A);break;case"KEY":var L=A,C=new p.default(L),D=C.enumeratedString("METHOD"),I=C.URI,M=C.hexadecimalInteger("IV");D&&(c=new d.default,I&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(D)>=0&&(c.method=D,c.baseuri=t,c.reluri=I,c.key=null,c.iv=M));break;case"START":var F=A,N=new p.default(F),B=N.decimalFloatingPoint("TIME-OFFSET");Number.isFinite(B)&&(l.startTimeOffset=B);break;case"MAP":var j=new p.default(A);y.relurl=j.URI,y.rawByteRange=j.BYTERANGE,y.baseurl=t,y.level=r,y.type=n,y.sn="initSegment",l.initSegment=y,y=new s.default,y.rawProgramDateTime=l.initSegment.rawProgramDateTime;break;default:h.logger.warn("line parsed but not handled: "+v);break}}}return y=g,y&&!y.relurl&&(l.fragments.pop(),o-=y.duration),l.totalduration=o,l.averagetargetduration=o/l.fragments.length,l.endSN=a-1,l.startCC=l.fragments[0]?l.fragments[0].cc:0,l.endCC=f,!l.initSegment&&l.fragments.length&&l.fragments.every((function(e){return w.test(e.relurl)}))&&(h.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),y=new s.default,y.relurl=l.fragments[0].relurl,y.baseurl=t,y.level=r,y.type=n,y.sn="initSegment",l.initSegment=y,l.needSidxRanges=!0),x&&T(l.fragments,x),l}}]),e}();function T(e,t){for(var r=e[t],n=t-1;n>=0;n--){var i=e[n];i.programDateTime=r.programDateTime-1e3*i.duration,r=i}}function S(e,t){e.rawProgramDateTime?e.programDateTime=Date.parse(e.rawProgramDateTime):t&&t.programDateTime&&(e.programDateTime=t.endProgramDateTime),Number.isFinite(e.programDateTime)||(e.programDateTime=null,e.rawProgramDateTime=null)}t.default=E,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=function(){function e(t){i(this,e),this.endCC=0,this.endSN=0,this.fragments=[],this.initSegment=null,this.live=!0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=t,this.version=null}return n(e,[{key:"hasProgramDateTime",get:function(){return!(!this.fragments[0]||!Number.isFinite(this.fragments[0].programDateTime))}}]),e}();t.default=a,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=/^(\d+)x(\d+)$/,o=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,s=function(){function e(t){for(var r in i(this,e),"string"===typeof t&&(t=e.parseAttrList(t)),t)t.hasOwnProperty(r)&&(this[r]=t[r])}return n(e,[{key:"decimalInteger",value:function(e){var t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}},{key:"hexadecimalInteger",value:function(e){if(this[e]){var t=(this[e]||"0x").slice(2);t=(1&t.length?"0":"")+t;for(var r=new Uint8Array(t.length/2),n=0;n<t.length/2;n++)r[n]=parseInt(t.slice(2*n,2*n+2),16);return r}return null}},{key:"hexadecimalIntegerAsNumber",value:function(e){var t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t}},{key:"decimalFloatingPoint",value:function(e){return parseFloat(this[e])}},{key:"enumeratedString",value:function(e){return this[e]}},{key:"decimalResolution",value:function(e){var t=a.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}}],[{key:"parseAttrList",value:function(e){var t=void 0,r={};o.lastIndex=0;while(null!==(t=o.exec(e))){var n=t[2],i='"';0===n.indexOf(i)&&n.lastIndexOf(i)===n.length-1&&(n=n.slice(1,-1)),r[t[1]]=n}return r}}]),e}();t.default=s,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function e(t,r,n){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,r);if(void 0===i){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,r,n)}if("value"in i)return i.value;var o=i.get;return void 0!==o?o.call(n):void 0},a=r(1),o=d(a),s=r(3),l=d(s),u=r(2),c=r(0);function d(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function h(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var g=function(e){function t(e){f(this,t);var r=p(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,o.default.FRAG_LOADING));return r.loaders={},r}return h(t,e),n(t,[{key:"destroy",value:function(){var e=this.loaders;for(var r in e){var n=e[r];n&&n.destroy()}this.loaders={},i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}},{key:"onFragLoading",value:function(e){var t=e.frag,r=t.type,n=this.loaders,i=this.hls.config,a=i.fLoader,o=i.loader;t.loaded=0;var s=n[r];s&&(c.logger.warn("abort previous fragment loader for type: "+r),s.abort()),s=n[r]=t.loader=i.fLoader?new a(i):new o(i);var l=void 0,u=void 0,d=void 0;l={url:t.url,frag:t,responseType:"arraybuffer",progressData:!1};var f=t.byteRangeStartOffset,p=t.byteRangeEndOffset;Number.isFinite(f)&&Number.isFinite(p)&&(l.rangeStart=f,l.rangeEnd=p),u={timeout:i.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:i.fragLoadingMaxRetryTimeout},d={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this),onProgress:this.loadprogress.bind(this)},s.load(l,u,d)}},{key:"loadsuccess",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=e.data,a=r.frag;a.loader=void 0,this.loaders[a.type]=void 0,this.hls.trigger(o.default.FRAG_LOADED,{payload:i,frag:a,stats:t,networkDetails:n})}},{key:"loaderror",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=t.frag,i=n.loader;i&&i.abort(),this.loaders[n.type]=void 0,this.hls.trigger(o.default.ERROR,{type:u.ErrorTypes.NETWORK_ERROR,details:u.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t.frag,response:e,networkDetails:r})}},{key:"loadtimeout",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=t.frag,i=n.loader;i&&i.abort(),this.loaders[n.type]=void 0,this.hls.trigger(o.default.ERROR,{type:u.ErrorTypes.NETWORK_ERROR,details:u.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t.frag,networkDetails:r})}},{key:"loadprogress",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=t.frag;i.loaded=e.loaded,this.hls.trigger(o.default.FRAG_LOAD_PROGRESS,{frag:i,stats:e,networkDetails:n})}}]),t}(l.default);t.default=g,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(1),a=c(i),o=r(3),s=c(o),l=r(2),u=r(0);function c(e){return e&&e.__esModule?e:{default:e}}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function p(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var h=function(e){function t(e){d(this,t);var r=f(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,a.default.KEY_LOADING));return r.loaders={},r.decryptkey=null,r.decrypturl=null,r}return p(t,e),n(t,[{key:"destroy",value:function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy()}this.loaders={},s.default.prototype.destroy.call(this)}},{key:"onKeyLoading",value:function(e){var t=e.frag,r=t.type,n=this.loaders[r],i=t.decryptdata,o=i.uri;if(o!==this.decrypturl||null===this.decryptkey){var s=this.hls.config;n&&(u.logger.warn("abort previous key loader for type:"+r),n.abort()),t.loader=this.loaders[r]=new s.loader(s),this.decrypturl=o,this.decryptkey=null;var l=void 0,c=void 0,d=void 0;l={url:o,frag:t,responseType:"arraybuffer"},c={timeout:s.fragLoadingTimeOut,maxRetry:0,retryDelay:s.fragLoadingRetryDelay,maxRetryDelay:s.fragLoadingMaxRetryTimeout},d={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)},t.loader.load(l,c,d)}else this.decryptkey&&(i.key=this.decryptkey,this.hls.trigger(a.default.KEY_LOADED,{frag:t}))}},{key:"loadsuccess",value:function(e,t,r){var n=r.frag;this.decryptkey=n.decryptdata.key=new Uint8Array(e.data),n.loader=void 0,this.loaders[n.type]=void 0,this.hls.trigger(a.default.KEY_LOADED,{frag:n})}},{key:"loaderror",value:function(e,t){var r=t.frag,n=r.loader;n&&n.abort(),this.loaders[t.type]=void 0,this.hls.trigger(a.default.ERROR,{type:l.ErrorTypes.NETWORK_ERROR,details:l.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:r,response:e})}},{key:"loadtimeout",value:function(e,t){var r=t.frag,n=r.loader;n&&n.abort(),this.loaders[t.type]=void 0,this.hls.trigger(a.default.ERROR,{type:l.ErrorTypes.NETWORK_ERROR,details:l.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:r})}}]),t}(s.default);t.default=h,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function e(t,r,n){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,r);if(void 0===i){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,r,n)}if("value"in i)return i.value;var o=i.get;return void 0!==o?o.call(n):void 0},a=r(9),o=P(a),s=r(4),l=r(19),u=P(l),c=r(1),d=P(c),f=r(6),p=r(11),h=P(p),g=r(15),y=P(g),v=r(7),m=A(v),x=r(25),b=P(x),k=r(2),_=r(0),w=r(26),E=r(27),T=r(56),S=P(T),O=r(14),R=P(O);function A(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function P(e){return e&&e.__esModule?e:{default:e}}function L(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function C(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function D(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var I=100,M=function(e){function t(e,r){L(this,t);var n=C(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,d.default.MEDIA_ATTACHED,d.default.MEDIA_DETACHING,d.default.MANIFEST_LOADING,d.default.MANIFEST_PARSED,d.default.LEVEL_LOADED,d.default.KEY_LOADED,d.default.FRAG_LOADED,d.default.FRAG_LOAD_EMERGENCY_ABORTED,d.default.FRAG_PARSING_INIT_SEGMENT,d.default.FRAG_PARSING_DATA,d.default.FRAG_PARSED,d.default.ERROR,d.default.AUDIO_TRACK_SWITCHING,d.default.AUDIO_TRACK_SWITCHED,d.default.BUFFER_CREATED,d.default.BUFFER_APPENDED,d.default.BUFFER_FLUSHED));return n.fragmentTracker=r,n.config=e.config,n.audioCodecSwap=!1,n._state=O.State.STOPPED,n.stallReported=!1,n.gapController=null,n}return D(t,e),n(t,[{key:"startLoad",value:function(e){if(this.levels){var t=this.lastCurrentTime,r=this.hls;if(this.stopLoad(),this.setInterval(I),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var n=r.startLevel;-1===n&&(n=0,this.bitrateTest=!0),this.level=r.nextLoadLevel=n,this.loadedmetadata=!1}t>0&&-1===e&&(_.logger.log("override startPosition with lastCurrentTime @"+t.toFixed(3)),e=t),this.state=O.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this.forceStartLoad=!0,this.state=O.State.STOPPED}},{key:"stopLoad",value:function(){this.forceStartLoad=!1,i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"stopLoad",this).call(this)}},{key:"doTick",value:function(){switch(this.state){case O.State.BUFFER_FLUSHING:this.fragLoadError=0;break;case O.State.IDLE:this._doTickIdle();break;case O.State.WAITING_LEVEL:var e=this.levels[this.level];e&&e.details&&(this.state=O.State.IDLE);break;case O.State.FRAG_LOADING_WAITING_RETRY:var t=window.performance.now(),r=this.retryDate;(!r||t>=r||this.media&&this.media.seeking)&&(_.logger.log("mediaController: retryDate reached, switch back to IDLE state"),this.state=O.State.IDLE);break;case O.State.ERROR:case O.State.STOPPED:case O.State.FRAG_LOADING:case O.State.PARSING:case O.State.PARSED:case O.State.ENDED:break;default:break}this._checkBuffer(),this._checkFragmentChanged()}},{key:"_doTickIdle",value:function(){var e=this.hls,t=e.config,r=this.media;if(void 0!==this.levelLastLoaded&&(r||!this.startFragRequested&&t.startFragPrefetch)){var n=void 0;n=this.loadedmetadata?r.currentTime:this.nextLoadPosition;var i=e.nextLoadLevel,a=this.levels[i];if(a){var o=a.bitrate,l=void 0;l=o?Math.max(8*t.maxBufferSize/o,t.maxBufferLength):t.maxBufferLength,l=Math.min(l,t.maxMaxBufferLength);var u=s.BufferHelper.bufferInfo(this.mediaBuffer?this.mediaBuffer:r,n,t.maxBufferHole),c=u.len;if(!(c>=l)){_.logger.trace("buffer length of "+c.toFixed(3)+" is below max of "+l.toFixed(3)+". checking for more payload ..."),this.level=e.nextLoadLevel=i;var f=a.details;if(!f||f.live&&this.levelLastLoaded!==i)this.state=O.State.WAITING_LEVEL;else{if(this._streamEnded(u,f)){var p={};return this.altAudio&&(p.type="video"),this.hls.trigger(d.default.BUFFER_EOS,p),void(this.state=O.State.ENDED)}this._fetchPayloadOrEos(n,u,f)}}}}}},{key:"_fetchPayloadOrEos",value:function(e,t,r){var n=this.fragPrevious,i=this.level,a=r.fragments,o=a.length;if(0!==o){var s=a[0].start,l=a[o-1].start+a[o-1].duration,u=t.end,c=void 0;if(r.initSegment&&!r.initSegment.data)c=r.initSegment;else if(r.live){var d=this.config.initialLiveManifestSize;if(o<d)return void _.logger.warn("Can not start playback of a level, reason: not enough fragments "+o+" < "+d);if(c=this._ensureFragmentAtLivePoint(r,u,s,l,n,a,o),null===c)return}else u<s&&(c=a[0]);c||(c=this._findFragment(s,n,o,a,u,l,r)),c&&(c.encrypted?(_.logger.log("Loading key for "+c.sn+" of ["+r.startSN+" ,"+r.endSN+"],level "+i),this._loadKey(c)):(_.logger.log("Loading "+c.sn+" of ["+r.startSN+" ,"+r.endSN+"],level "+i+", currentTime:"+e.toFixed(3)+",bufferEnd:"+u.toFixed(3)),this._loadFragment(c)))}}},{key:"_ensureFragmentAtLivePoint",value:function(e,t,r,n,i,a,s){var l=this.hls.config,u=this.media,c=void 0,d=void 0!==l.liveMaxLatencyDuration?l.liveMaxLatencyDuration:l.liveMaxLatencyDurationCount*e.targetduration;if(t<Math.max(r-l.maxFragLookUpTolerance,n-d)){var f=this.liveSyncPosition=this.computeLivePosition(r,e);_.logger.log("buffer end: "+t.toFixed(3)+" is located too far from the end of live sliding playlist, reset currentTime to : "+f.toFixed(3)),t=f,u&&u.readyState&&u.duration>f&&(u.currentTime=f),this.nextLoadPosition=f}if(e.PTSKnown&&t>n&&u&&u.readyState)return null;if(this.startFragRequested&&!e.PTSKnown){if(i)if(e.hasProgramDateTime)_.logger.log("live playlist, switching playlist, load frag with same PDT: "+i.programDateTime),c=(0,E.findFragmentByPDT)(a,i.endProgramDateTime,l.maxFragLookUpTolerance);else{var p=i.sn+1;if(p>=e.startSN&&p<=e.endSN){var h=a[p-e.startSN];i.cc===h.cc&&(c=h,_.logger.log("live playlist, switching playlist, load frag with next SN: "+c.sn))}c||(c=o.default.search(a,(function(e){return i.cc-e.cc})),c&&_.logger.log("live playlist, switching playlist, load frag with same CC: "+c.sn))}c||(c=a[Math.min(s-1,Math.round(s/2))],_.logger.log("live playlist, switching playlist, unknown, load middle frag : "+c.sn))}return c}},{key:"_findFragment",value:function(e,t,r,n,i,a,o){var s=this.hls.config,l=void 0;if(i<a){var u=i>a-s.maxFragLookUpTolerance?0:s.maxFragLookUpTolerance;l=(0,E.findFragmentByPTS)(t,n,i,u)}else l=n[r-1];if(l){var c=l.sn-o.startSN,d=t&&l.level===t.level,f=n[c-1],p=n[c+1];if(t&&l.sn===t.sn)if(d&&!l.backtracked)if(l.sn<o.endSN){var h=t.deltaPTS;h&&h>s.maxBufferHole&&t.dropped&&c?(l=f,_.logger.warn("SN just loaded, with large PTS gap between audio and video, maybe frag is not starting with a keyframe ? load previous one to try to overcome this")):(l=p,_.logger.log("SN just loaded, load next one: "+l.sn,l))}else l=null;else l.backtracked&&(p&&p.backtracked?(_.logger.warn("Already backtracked from fragment "+p.sn+", will not backtrack to fragment "+l.sn+". Loading fragment "+p.sn),l=p):(_.logger.warn("Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe"),l.dropped=0,f?(l=f,l.backtracked=!0):c&&(l=null)))}return l}},{key:"_loadKey",value:function(e){this.state=O.State.KEY_LOADING,this.hls.trigger(d.default.KEY_LOADING,{frag:e})}},{key:"_loadFragment",value:function(e){var t=this.fragmentTracker.getState(e);this.fragCurrent=e,this.startFragRequested=!0,Number.isFinite(e.sn)&&!e.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),e.backtracked||t===f.FragmentState.NOT_LOADED||t===f.FragmentState.PARTIAL?(e.autoLevel=this.hls.autoLevelEnabled,e.bitrateTest=this.bitrateTest,this.hls.trigger(d.default.FRAG_LOADING,{frag:e}),this.demuxer||(this.demuxer=new u.default(this.hls,"main")),this.state=O.State.FRAG_LOADING):t===f.FragmentState.APPENDING&&this._reduceMaxBufferLength(e.duration)&&this.fragmentTracker.removeFragment(e)}},{key:"getBufferedFrag",value:function(e){return this.fragmentTracker.getBufferedFrag(e,y.default.LevelType.MAIN)}},{key:"followingBufferedFrag",value:function(e){return e?this.getBufferedFrag(e.endPTS+.5):null}},{key:"_checkFragmentChanged",value:function(){var e=void 0,t=void 0,r=this.media;if(r&&r.readyState&&!1===r.seeking&&(t=r.currentTime,t>this.lastCurrentTime&&(this.lastCurrentTime=t),s.BufferHelper.isBuffered(r,t)?e=this.getBufferedFrag(t):s.BufferHelper.isBuffered(r,t+.1)&&(e=this.getBufferedFrag(t+.1)),e)){var n=e;if(n!==this.fragPlaying){this.hls.trigger(d.default.FRAG_CHANGED,{frag:n});var i=n.level;this.fragPlaying&&this.fragPlaying.level===i||this.hls.trigger(d.default.LEVEL_SWITCHED,{level:i}),this.fragPlaying=n}}}},{key:"immediateLevelSwitch",value:function(){if(_.logger.log("immediateLevelSwitch"),!this.immediateSwitch){this.immediateSwitch=!0;var e=this.media,t=void 0;e?(t=e.paused,e.pause()):t=!0,this.previouslyPaused=t}var r=this.fragCurrent;r&&r.loader&&r.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}},{key:"immediateLevelSwitchEnd",value:function(){var e=this.media;e&&e.buffered.length&&(this.immediateSwitch=!1,s.BufferHelper.isBuffered(e,e.currentTime)&&(e.currentTime-=1e-4),this.previouslyPaused||e.play())}},{key:"nextLevelSwitch",value:function(){var e=this.media;if(e&&e.readyState){var t=void 0,r=void 0,n=void 0;if(r=this.getBufferedFrag(e.currentTime),r&&r.startPTS>1&&this.flushMainBuffer(0,r.startPTS-1),e.paused)t=0;else{var i=this.hls.nextLoadLevel,a=this.levels[i],o=this.fragLastKbps;t=o&&this.fragCurrent?this.fragCurrent.duration*a.bitrate/(1e3*o)+1:0}if(n=this.getBufferedFrag(e.currentTime+t),n&&(n=this.followingBufferedFrag(n),n)){var s=this.fragCurrent;s&&s.loader&&s.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(n.maxStartPTS,Number.POSITIVE_INFINITY)}}}},{key:"flushMainBuffer",value:function(e,t){this.state=O.State.BUFFER_FLUSHING;var r={startOffset:e,endOffset:t};this.altAudio&&(r.type="video"),this.hls.trigger(d.default.BUFFER_FLUSHING,r)}},{key:"onMediaAttached",value:function(e){var t=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),this.onvended=this.onMediaEnded.bind(this),t.addEventListener("seeking",this.onvseeking),t.addEventListener("seeked",this.onvseeked),t.addEventListener("ended",this.onvended);var r=this.config;this.levels&&r.autoStartLoad&&this.hls.startLoad(r.startPosition),this.gapController=new S.default(r,t,this.fragmentTracker,this.hls)}},{key:"onMediaDetaching",value:function(){var e=this.media;e&&e.ended&&(_.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var t=this.levels;t&&t.forEach((function(e){e.details&&e.details.fragments.forEach((function(e){e.backtracked=void 0}))})),e&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("seeked",this.onvseeked),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()}},{key:"onMediaSeeked",value:function(){var e=this.media,t=e?e.currentTime:void 0;Number.isFinite(t)&&_.logger.log("media seeked to "+t.toFixed(3)),this.tick()}},{key:"onManifestLoading",value:function(){_.logger.log("trigger BUFFER_RESET"),this.hls.trigger(d.default.BUFFER_RESET),this.fragmentTracker.removeAllFragments(),this.stalled=!1,this.startPosition=this.lastCurrentTime=0}},{key:"onManifestParsed",value:function(e){var t=!1,r=!1,n=void 0;e.levels.forEach((function(e){n=e.audioCodec,n&&(-1!==n.indexOf("mp4a.40.2")&&(t=!0),-1!==n.indexOf("mp4a.40.5")&&(r=!0))})),this.audioCodecSwitch=t&&r,this.audioCodecSwitch&&_.logger.log("both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=e.levels,this.startFragRequested=!1;var i=this.config;(i.autoStartLoad||this.forceStartLoad)&&this.hls.startLoad(i.startPosition)}},{key:"onLevelLoaded",value:function(e){var t=e.details,r=e.level,n=this.levels[this.levelLastLoaded],i=this.levels[r],a=t.totalduration,o=0;if(_.logger.log("level "+r+" loaded ["+t.startSN+","+t.endSN+"],duration:"+a),t.live){var s=i.details;s&&t.fragments.length>0?(m.mergeDetails(s,t),o=t.fragments[0].start,this.liveSyncPosition=this.computeLivePosition(o,s),t.PTSKnown&&Number.isFinite(o)?_.logger.log("live playlist sliding:"+o.toFixed(3)):(_.logger.log("live playlist - outdated PTS, unknown sliding"),(0,w.alignStream)(this.fragPrevious,n,t))):(_.logger.log("live playlist - first load, unknown sliding"),t.PTSKnown=!1,(0,w.alignStream)(this.fragPrevious,n,t))}else t.PTSKnown=!1;if(i.details=t,this.levelLastLoaded=r,this.hls.trigger(d.default.LEVEL_UPDATED,{details:t,level:r}),!1===this.startFragRequested){if(-1===this.startPosition||-1===this.lastCurrentTime){var l=t.startTimeOffset;Number.isFinite(l)?(l<0&&(_.logger.log("negative start time offset "+l+", count from end of last fragment"),l=o+a+l),_.logger.log("start time offset found in playlist, adjust startPosition to "+l),this.startPosition=l):t.live?(this.startPosition=this.computeLivePosition(o,t),_.logger.log("configure startPosition to "+this.startPosition)):this.startPosition=0,this.lastCurrentTime=this.startPosition}this.nextLoadPosition=this.startPosition}this.state===O.State.WAITING_LEVEL&&(this.state=O.State.IDLE),this.tick()}},{key:"onKeyLoaded",value:function(){this.state===O.State.KEY_LOADING&&(this.state=O.State.IDLE,this.tick())}},{key:"onFragLoaded",value:function(e){var t=this.fragCurrent,r=this.hls,n=this.levels,i=this.media,a=e.frag;if(this.state===O.State.FRAG_LOADING&&t&&"main"===a.type&&a.level===t.level&&a.sn===t.sn){var o=e.stats,s=n[t.level],l=s.details;if(this.bitrateTest=!1,this.stats=o,_.logger.log("Loaded "+t.sn+" of ["+l.startSN+" ,"+l.endSN+"],level "+t.level),a.bitrateTest&&r.nextLoadLevel)this.state=O.State.IDLE,this.startFragRequested=!1,o.tparsed=o.tbuffered=window.performance.now(),r.trigger(d.default.FRAG_BUFFERED,{stats:o,frag:t,id:"main"}),this.tick();else if("initSegment"===a.sn)this.state=O.State.IDLE,o.tparsed=o.tbuffered=window.performance.now(),l.initSegment.data=e.payload,r.trigger(d.default.FRAG_BUFFERED,{stats:o,frag:t,id:"main"}),this.tick();else{_.logger.log("Parsing "+t.sn+" of ["+l.startSN+" ,"+l.endSN+"],level "+t.level+", cc "+t.cc),this.state=O.State.PARSING,this.pendingBuffering=!0,this.appended=!1,a.bitrateTest&&(a.bitrateTest=!1,this.fragmentTracker.onFragLoaded({frag:a}));var c=!(i&&i.seeking)&&(l.PTSKnown||!l.live),f=l.initSegment?l.initSegment.data:[],p=this._getAudioCodec(s),h=this.demuxer=this.demuxer||new u.default(this.hls,"main");h.push(e.payload,f,p,s.videoCodec,t,l.totalduration,c)}}this.fragLoadError=0}},{key:"onFragParsingInitSegment",value:function(e){var t=this.fragCurrent,r=e.frag;if(t&&"main"===e.id&&r.sn===t.sn&&r.level===t.level&&this.state===O.State.PARSING){var n=e.tracks,i=void 0,a=void 0;if(n.audio&&this.altAudio&&delete n.audio,a=n.audio,a){var o=this.levels[this.level].audioCodec,s=navigator.userAgent.toLowerCase();o&&this.audioCodecSwap&&(_.logger.log("swapping playlist audio codec"),o=-1!==o.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),this.audioCodecSwitch&&1!==a.metadata.channelCount&&-1===s.indexOf("firefox")&&(o="mp4a.40.5"),-1!==s.indexOf("android")&&"audio/mpeg"!==a.container&&(o="mp4a.40.2",_.logger.log("Android: force audio codec to "+o)),a.levelCodec=o,a.id=e.id}for(i in a=n.video,a&&(a.levelCodec=this.levels[this.level].videoCodec,a.id=e.id),this.hls.trigger(d.default.BUFFER_CODECS,n),n){a=n[i],_.logger.log("main track:"+i+",container:"+a.container+",codecs[level/parsed]=["+a.levelCodec+"/"+a.codec+"]");var l=a.initSegment;l&&(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(d.default.BUFFER_APPENDING,{type:i,data:l,parent:"main",content:"initSegment"}))}this.tick()}}},{key:"onFragParsingData",value:function(e){var t=this,r=this.fragCurrent,n=e.frag;if(r&&"main"===e.id&&n.sn===r.sn&&n.level===r.level&&("audio"!==e.type||!this.altAudio)&&this.state===O.State.PARSING){var i=this.levels[this.level],a=r;if(Number.isFinite(e.endPTS)||(e.endPTS=e.startPTS+r.duration,e.endDTS=e.startDTS+r.duration),!0===e.hasAudio&&a.addElementaryStream(h.default.ElementaryStreamTypes.AUDIO),!0===e.hasVideo&&a.addElementaryStream(h.default.ElementaryStreamTypes.VIDEO),_.logger.log("Parsed "+e.type+",PTS:["+e.startPTS.toFixed(3)+","+e.endPTS.toFixed(3)+"],DTS:["+e.startDTS.toFixed(3)+"/"+e.endDTS.toFixed(3)+"],nb:"+e.nb+",dropped:"+(e.dropped||0)),"video"===e.type)if(a.dropped=e.dropped,a.dropped)if(a.backtracked)_.logger.warn("Already backtracked on this fragment, appending with the gap",a.sn);else{var o=i.details;if(!o||a.sn!==o.startSN)return _.logger.warn("missing video frame(s), backtracking fragment",a.sn),this.fragmentTracker.removeFragment(a),a.backtracked=!0,this.nextLoadPosition=e.startPTS,this.state=O.State.IDLE,this.fragPrevious=a,void this.tick();_.logger.warn("missing video frame(s) on first frag, appending with gap",a.sn)}else a.backtracked=!1;var s=m.updateFragPTSDTS(i.details,a,e.startPTS,e.endPTS,e.startDTS,e.endDTS),l=this.hls;l.trigger(d.default.LEVEL_PTS_UPDATED,{details:i.details,level:this.level,drift:s,type:e.type,start:e.startPTS,end:e.endPTS}),[e.data1,e.data2].forEach((function(r){r&&r.length&&t.state===O.State.PARSING&&(t.appended=!0,t.pendingBuffering=!0,l.trigger(d.default.BUFFER_APPENDING,{type:e.type,data:r,parent:"main",content:"data"}))})),this.tick()}}},{key:"onFragParsed",value:function(e){var t=this.fragCurrent,r=e.frag;t&&"main"===e.id&&r.sn===t.sn&&r.level===t.level&&this.state===O.State.PARSING&&(this.stats.tparsed=window.performance.now(),this.state=O.State.PARSED,this._checkAppendedParsed())}},{key:"onAudioTrackSwitching",value:function(e){var t=!!e.url,r=e.id;if(!t){if(this.mediaBuffer!==this.media){_.logger.log("switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var n=this.fragCurrent;n.loader&&(_.logger.log("switching to main audio track, cancel main fragment load"),n.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=O.State.IDLE}var i=this.hls;i.trigger(d.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),i.trigger(d.default.AUDIO_TRACK_SWITCHED,{id:r}),this.altAudio=!1}}},{key:"onAudioTrackSwitched",value:function(e){var t=e.id,r=!!this.hls.audioTracks[t].url;if(r){var n=this.videoBuffer;n&&this.mediaBuffer!==n&&(_.logger.log("switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=n)}this.altAudio=r,this.tick()}},{key:"onBufferCreated",value:function(e){var t=e.tracks,r=void 0,n=void 0,i=!1;for(var a in t){var o=t[a];"main"===o.id?(n=a,r=o,"video"===a&&(this.videoBuffer=t[a].buffer)):i=!0}i&&r?(_.logger.log("alternate track found, use "+n+".buffered to schedule main fragment loading"),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media}},{key:"onBufferAppended",value:function(e){if("main"===e.parent){var t=this.state;t!==O.State.PARSING&&t!==O.State.PARSED||(this.pendingBuffering=e.pending>0,this._checkAppendedParsed())}}},{key:"_checkAppendedParsed",value:function(){if(this.state===O.State.PARSED&&(!this.appended||!this.pendingBuffering)){var e=this.fragCurrent;if(e){var t=this.mediaBuffer?this.mediaBuffer:this.media;_.logger.log("main buffered : "+b.default.toString(t.buffered)),this.fragPrevious=e;var r=this.stats;r.tbuffered=window.performance.now(),this.fragLastKbps=Math.round(8*r.total/(r.tbuffered-r.tfirst)),this.hls.trigger(d.default.FRAG_BUFFERED,{stats:r,frag:e,id:"main"}),this.state=O.State.IDLE}this.tick()}}},{key:"onError",value:function(e){var t=e.frag||this.fragCurrent;if(!t||"main"===t.type){var r=!!this.media&&s.BufferHelper.isBuffered(this.media,this.media.currentTime)&&s.BufferHelper.isBuffered(this.media,this.media.currentTime+.5);switch(e.details){case k.ErrorDetails.FRAG_LOAD_ERROR:case k.ErrorDetails.FRAG_LOAD_TIMEOUT:case k.ErrorDetails.KEY_LOAD_ERROR:case k.ErrorDetails.KEY_LOAD_TIMEOUT:if(!e.fatal)if(this.fragLoadError+1<=this.config.fragLoadingMaxRetry){var n=Math.min(Math.pow(2,this.fragLoadError)*this.config.fragLoadingRetryDelay,this.config.fragLoadingMaxRetryTimeout);_.logger.warn("mediaController: frag loading failed, retry in "+n+" ms"),this.retryDate=window.performance.now()+n,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.fragLoadError++,this.state=O.State.FRAG_LOADING_WAITING_RETRY}else _.logger.error("mediaController: "+e.details+" reaches max retry, redispatch as fatal ..."),e.fatal=!0,this.state=O.State.ERROR;break;case k.ErrorDetails.LEVEL_LOAD_ERROR:case k.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==O.State.ERROR&&(e.fatal?(this.state=O.State.ERROR,_.logger.warn("streamController: "+e.details+",switch to "+this.state+" state ...")):e.levelRetry||this.state!==O.State.WAITING_LEVEL||(this.state=O.State.IDLE));break;case k.ErrorDetails.BUFFER_FULL_ERROR:"main"!==e.parent||this.state!==O.State.PARSING&&this.state!==O.State.PARSED||(r?(this._reduceMaxBufferLength(this.config.maxBufferLength),this.state=O.State.IDLE):(_.logger.warn("buffer full error also media.currentTime is not buffered, flush everything"),this.fragCurrent=null,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)));break;default:break}}}},{key:"_reduceMaxBufferLength",value:function(e){var t=this.config;return t.maxMaxBufferLength>=e&&(t.maxMaxBufferLength/=2,_.logger.warn("main:reduce max buffer length to "+t.maxMaxBufferLength+"s"),!0)}},{key:"_checkBuffer",value:function(){var e=this.media;if(e&&0!==e.readyState){var t=this.mediaBuffer?this.mediaBuffer:e,r=t.buffered;!this.loadedmetadata&&r.length?(this.loadedmetadata=!0,this._seekToStartPos()):this.immediateSwitch?this.immediateLevelSwitchEnd():this.gapController.poll(this.lastCurrentTime,r)}}},{key:"onFragLoadEmergencyAborted",value:function(){this.state=O.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tick()}},{key:"onBufferFlushed",value:function(){var e=this.mediaBuffer?this.mediaBuffer:this.media;e&&this.fragmentTracker.detectEvictedFragments(h.default.ElementaryStreamTypes.VIDEO,e.buffered),this.state=O.State.IDLE,this.fragPrevious=null}},{key:"swapAudioCodec",value:function(){this.audioCodecSwap=!this.audioCodecSwap}},{key:"computeLivePosition",value:function(e,t){var r=void 0!==this.config.liveSyncDuration?this.config.liveSyncDuration:this.config.liveSyncDurationCount*t.targetduration;return e+Math.max(0,t.totalduration-r)}},{key:"_seekToStartPos",value:function(){var e=this.media,t=e.currentTime,r=e.seeking?t:this.startPosition;t!==r&&(_.logger.log("target start position not buffered, seek to buffered.start(0) "+r+" from current time "+t+" "),e.currentTime=r)}},{key:"_getAudioCodec",value:function(e){var t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&(_.logger.log("swapping playlist audio codec"),t&&(t=-1!==t.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5")),t}},{key:"state",set:function(e){if(this.state!==e){var t=this.state;this._state=e,_.logger.log("main stream:"+t+"->"+e),this.hls.trigger(d.default.STREAM_STATE_TRANSITION,{previousState:t,nextState:e})}},get:function(){return this._state}},{key:"currentLevel",get:function(){var e=this.media;if(e){var t=this.getBufferedFrag(e.currentTime);if(t)return t.level}return-1}},{key:"nextBufferedFrag",get:function(){var e=this.media;return e?this.followingBufferedFrag(this.getBufferedFrag(e.currentTime)):null}},{key:"nextLevel",get:function(){var e=this.nextBufferedFrag;return e?e.level:-1}},{key:"liveSyncPosition",get:function(){return this._liveSyncPosition},set:function(e){this._liveSyncPosition=e}}]),t}(R.default);t.default=M,e.exports=t["default"]},function(e,t,r){function n(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r.oe=function(e){throw console.error(e),e};var n=r(r.s=ENTRY_MODULE);return n.default||n}var i="[\\.|\\-|\\+|\\w|/|@]+",a="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+i+").*?\\)";function o(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function s(e){return!isNaN(1*e)}function l(e,t,n){var l={};l[n]=[];var u=t.toString(),c=u.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!c)return l;var d,f=c[1],p=new RegExp("(\\\\n|\\W)"+o(f)+a,"g");while(d=p.exec(u))"dll-reference"!==d[3]&&l[n].push(d[3]);p=new RegExp("\\("+o(f)+'\\("(dll-reference\\s('+i+'))"\\)\\)'+a,"g");while(d=p.exec(u))e[d[2]]||(l[n].push(d[1]),e[d[2]]=r(d[1]).m),l[d[2]]=l[d[2]]||[],l[d[2]].push(d[4]);for(var h=Object.keys(l),g=0;g<h.length;g++)for(var y=0;y<l[h[g]].length;y++)s(l[h[g]][y])&&(l[h[g]][y]=1*l[h[g]][y]);return l}function u(e){var t=Object.keys(e);return t.reduce((function(t,r){return t||e[r].length>0}),!1)}function c(e,t){var r={main:[t]},n={main:[]},i={main:{}};while(u(r))for(var a=Object.keys(r),o=0;o<a.length;o++){var s=a[o],c=r[s],d=c.pop();if(i[s]=i[s]||{},!i[s][d]&&e[s][d]){i[s][d]=!0,n[s]=n[s]||[],n[s].push(d);for(var f=l(e,e[s][d],s),p=Object.keys(f),h=0;h<p.length;h++)r[p[h]]=r[p[h]]||[],r[p[h]]=r[p[h]].concat(f[p[h]])}}return n}e.exports=function(e,t){t=t||{};var i={main:r.m},a=t.all?{main:Object.keys(i.main)}:c(i,e),o="";Object.keys(a).filter((function(e){return"main"!==e})).forEach((function(e){var t=0;while(a[e][t])t++;a[e].push(t),i[e][t]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",o=o+"var "+e+" = ("+n.toString().replace("ENTRY_MODULE",JSON.stringify(t))+")({"+a[e].map((function(t){return JSON.stringify(t)+": "+i[e][t].toString()})).join(",")+"});\n"})),o=o+"new (("+n.toString().replace("ENTRY_MODULE",JSON.stringify(e))+")({"+a.main.map((function(e){return JSON.stringify(e)+": "+i.main[e].toString()})).join(",")+"}))(self);";var s=new window.Blob([o],{type:"text/javascript"});if(t.bare)return s;var l=window.URL||window.webkitURL||window.mozURL||window.msURL,u=l.createObjectURL(s),d=new window.Worker(u);return d.objectURL=u,d}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=function(){function e(t,r){i(this,e),this.subtle=t,this.aesIV=r}return n(e,[{key:"decrypt",value:function(e,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)}}]),e}();t.default=a,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=function(){function e(t,r){i(this,e),this.subtle=t,this.key=r}return n(e,[{key:"expandKey",value:function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])}}]),e}();t.default=a,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){var t=e.byteLength,r=t&&new DataView(e).getUint8(t-1);return r?e.slice(0,t-r):e}t.removePadding=a;var o=function(){function e(){i(this,e),this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.initTable()}return n(e,[{key:"uint8ArrayToUint32Array_",value:function(e){for(var t=new DataView(e),r=new Uint32Array(4),n=0;n<4;n++)r[n]=t.getUint32(4*n);return r}},{key:"initTable",value:function(){var e=this.sBox,t=this.invSBox,r=this.subMix,n=r[0],i=r[1],a=r[2],o=r[3],s=this.invSubMix,l=s[0],u=s[1],c=s[2],d=s[3],f=new Uint32Array(256),p=0,h=0,g=0;for(g=0;g<256;g++)f[g]=g<128?g<<1:g<<1^283;for(g=0;g<256;g++){var y=h^h<<1^h<<2^h<<3^h<<4;y=y>>>8^255&y^99,e[p]=y,t[y]=p;var v=f[p],m=f[v],x=f[m],b=257*f[y]^16843008*y;n[p]=b<<24|b>>>8,i[p]=b<<16|b>>>16,a[p]=b<<8|b>>>24,o[p]=b,b=16843009*x^65537*m^257*v^16843008*p,l[y]=b<<24|b>>>8,u[y]=b<<16|b>>>16,c[y]=b<<8|b>>>24,d[y]=b,p?(p=v^f[f[f[x^v]]],h^=f[f[h]]):p=h=1}}},{key:"expandKey",value:function(e){var t=this.uint8ArrayToUint32Array_(e),r=!0,n=0;while(n<t.length&&r)r=t[n]===this.key[n],n++;if(!r){this.key=t;var i=this.keySize=t.length;if(4!==i&&6!==i&&8!==i)throw new Error("Invalid aes key size="+i);var a=this.ksRows=4*(i+6+1),o=void 0,s=void 0,l=this.keySchedule=new Uint32Array(a),u=this.invKeySchedule=new Uint32Array(a),c=this.sBox,d=this.rcon,f=this.invSubMix,p=f[0],h=f[1],g=f[2],y=f[3],v=void 0,m=void 0;for(o=0;o<a;o++)o<i?v=l[o]=t[o]:(m=v,o%i===0?(m=m<<8|m>>>24,m=c[m>>>24]<<24|c[m>>>16&255]<<16|c[m>>>8&255]<<8|c[255&m],m^=d[o/i|0]<<24):i>6&&o%i===4&&(m=c[m>>>24]<<24|c[m>>>16&255]<<16|c[m>>>8&255]<<8|c[255&m]),l[o]=v=(l[o-i]^m)>>>0);for(s=0;s<a;s++)o=a-s,m=3&s?l[o]:l[o-4],u[s]=s<4||o<=4?m:p[c[m>>>24]]^h[c[m>>>16&255]]^g[c[m>>>8&255]]^y[c[255&m]],u[s]=u[s]>>>0}}},{key:"networkToHostOrderSwap",value:function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24}},{key:"decrypt",value:function(e,t,r,n){var i=this.keySize+6,o=this.invKeySchedule,s=this.invSBox,l=this.invSubMix,u=l[0],c=l[1],d=l[2],f=l[3],p=this.uint8ArrayToUint32Array_(r),h=p[0],g=p[1],y=p[2],v=p[3],m=new Int32Array(e),x=new Int32Array(m.length),b=void 0,k=void 0,_=void 0,w=void 0,E=void 0,T=void 0,S=void 0,O=void 0,R=void 0,A=void 0,P=void 0,L=void 0,C=void 0,D=void 0,I=this.networkToHostOrderSwap;while(t<m.length){for(R=I(m[t]),A=I(m[t+1]),P=I(m[t+2]),L=I(m[t+3]),E=R^o[0],T=L^o[1],S=P^o[2],O=A^o[3],C=4,D=1;D<i;D++)b=u[E>>>24]^c[T>>16&255]^d[S>>8&255]^f[255&O]^o[C],k=u[T>>>24]^c[S>>16&255]^d[O>>8&255]^f[255&E]^o[C+1],_=u[S>>>24]^c[O>>16&255]^d[E>>8&255]^f[255&T]^o[C+2],w=u[O>>>24]^c[E>>16&255]^d[T>>8&255]^f[255&S]^o[C+3],E=b,T=k,S=_,O=w,C+=4;b=s[E>>>24]<<24^s[T>>16&255]<<16^s[S>>8&255]<<8^s[255&O]^o[C],k=s[T>>>24]<<24^s[S>>16&255]<<16^s[O>>8&255]<<8^s[255&E]^o[C+1],_=s[S>>>24]<<24^s[O>>16&255]<<16^s[E>>8&255]<<8^s[255&T]^o[C+2],w=s[O>>>24]<<24^s[E>>16&255]<<16^s[T>>8&255]<<8^s[255&S]^o[C+3],C+=3,x[t]=I(b^h),x[t+1]=I(w^g),x[t+2]=I(_^y),x[t+3]=I(k^v),h=R,g=A,y=P,v=L,t+=4}return n?a(x.buffer):x.buffer}},{key:"destroy",value:function(){this.key=void 0,this.keySize=void 0,this.ksRows=void 0,this.sBox=void 0,this.invSBox=void 0,this.subMix=void 0,this.invSubMix=void 0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.rcon=void 0}}]),e}();t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(22),a=c(i),o=r(0),s=r(10),l=u(s);function u(e){return e&&e.__esModule?e:{default:e}}function c(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var f=function(){function e(t,r,n){d(this,e),this.observer=t,this.config=n,this.remuxer=r}return n(e,[{key:"resetInitSegment",value:function(e,t,r,n){this._audioTrack={container:"audio/adts",type:"audio",id:0,sequenceNumber:0,isAAC:!0,samples:[],len:0,manifestCodec:t,duration:n,inputTimeScale:9e4}}},{key:"resetTimeStamp",value:function(){}},{key:"append",value:function(e,t,r,n){var i=this._audioTrack,s=l.default.getID3Data(e,0)||[],u=l.default.getTimeStamp(s),c=Number.isFinite(u)?90*u:9e4*t,d=0,f=c,p=e.length,h=s.length,g=[{pts:f,dts:f,data:s}];while(h<p-1)if(a.isHeader(e,h)&&h+5<p){a.initTrackConfig(i,this.observer,e,h,i.manifestCodec);var y=a.appendFrame(i,e,h,c,d);if(!y){o.logger.log("Unable to parse AAC frame");break}h+=y.length,f=y.sample.pts,d++}else l.default.isHeader(e,h)?(s=l.default.getID3Data(e,h),g.push({pts:f,dts:f,data:s}),h+=s.length):h++;this.remuxer.remux(i,{samples:[]},{samples:g,inputTimeScale:9e4},{samples:[]},t,r,n)}},{key:"destroy",value:function(){}}],[{key:"probe",value:function(e){if(!e)return!1;for(var t=l.default.getID3Data(e,0)||[],r=t.length,n=e.length;r<n;r++)if(a.probe(e,r))return o.logger.log("ADTS sync word found !"),!0;return!1}}]),e}();t.default=f,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(22),a=v(i),o=r(23),s=y(o),l=r(1),u=y(l),c=r(47),d=y(c),f=r(48),p=y(f),h=r(0),g=r(2);function y(e){return e&&e.__esModule?e:{default:e}}function v(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var x={video:1,audio:2,id3:3,text:4},b=function(){function e(t,r,n,i){m(this,e),this.observer=t,this.config=n,this.typeSupported=i,this.remuxer=r,this.sampleAes=null}return n(e,[{key:"setDecryptData",value:function(e){null!=e&&null!=e.key&&"SAMPLE-AES"===e.method?this.sampleAes=new p.default(this.observer,this.config,e,this.discardEPB):this.sampleAes=null}},{key:"resetInitSegment",value:function(t,r,n,i){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=e.createTrack("video",i),this._audioTrack=e.createTrack("audio",i),this._id3Track=e.createTrack("id3",i),this._txtTrack=e.createTrack("text",i),this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=r,this.videoCodec=n,this._duration=i}},{key:"resetTimeStamp",value:function(){}},{key:"append",value:function(t,r,n,i){var a=void 0,o=t.length,s=void 0,l=void 0,c=void 0,d=void 0,f=void 0,p=!1;this.contiguous=n;var y=this.pmtParsed,v=this._avcTrack,m=this._audioTrack,x=this._id3Track,b=v.pid,k=m.pid,_=x.pid,w=this._pmtId,E=v.pesData,T=m.pesData,S=x.pesData,O=this._parsePAT,R=this._parsePMT,A=this._parsePES,P=this._parseAVCPES.bind(this),L=this._parseAACPES.bind(this),C=this._parseMPEGPES.bind(this),D=this._parseID3PES.bind(this),I=e._syncOffset(t);for(o-=(o+I)%188,a=I;a<o;a+=188)if(71===t[a]){if(s=!!(64&t[a+1]),l=((31&t[a+1])<<8)+t[a+2],c=(48&t[a+3])>>4,c>1){if(d=a+5+t[a+4],d===a+188)continue}else d=a+4;switch(l){case b:s&&(E&&(f=A(E))&&void 0!==f.pts&&P(f,!1),E={data:[],size:0}),E&&(E.data.push(t.subarray(d,a+188)),E.size+=a+188-d);break;case k:s&&(T&&(f=A(T))&&void 0!==f.pts&&(m.isAAC?L(f):C(f)),T={data:[],size:0}),T&&(T.data.push(t.subarray(d,a+188)),T.size+=a+188-d);break;case _:s&&(S&&(f=A(S))&&void 0!==f.pts&&D(f),S={data:[],size:0}),S&&(S.data.push(t.subarray(d,a+188)),S.size+=a+188-d);break;case 0:s&&(d+=t[d]+1),w=this._pmtId=O(t,d);break;case w:s&&(d+=t[d]+1);var M=R(t,d,!0===this.typeSupported.mpeg||!0===this.typeSupported.mp3,null!=this.sampleAes);b=M.avc,b>0&&(v.pid=b),k=M.audio,k>0&&(m.pid=k,m.isAAC=M.isAAC),_=M.id3,_>0&&(x.pid=_),p&&!y&&(h.logger.log("reparse from beginning"),p=!1,a=I-188),y=this.pmtParsed=!0;break;case 17:case 8191:break;default:p=!0;break}}else this.observer.trigger(u.default.ERROR,{type:g.ErrorTypes.MEDIA_ERROR,details:g.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});E&&(f=A(E))&&void 0!==f.pts?(P(f,!0),v.pesData=null):v.pesData=E,T&&(f=A(T))&&void 0!==f.pts?(m.isAAC?L(f):C(f),m.pesData=null):(T&&T.size&&h.logger.log("last AAC PES packet truncated,might overlap between fragments"),m.pesData=T),S&&(f=A(S))&&void 0!==f.pts?(D(f),x.pesData=null):x.pesData=S,null==this.sampleAes?this.remuxer.remux(m,v,x,this._txtTrack,r,n,i):this.decryptAndRemux(m,v,x,this._txtTrack,r,n,i)}},{key:"decryptAndRemux",value:function(e,t,r,n,i,a,o){if(e.samples&&e.isAAC){var s=this;this.sampleAes.decryptAacSamples(e.samples,0,(function(){s.decryptAndRemuxAvc(e,t,r,n,i,a,o)}))}else this.decryptAndRemuxAvc(e,t,r,n,i,a,o)}},{key:"decryptAndRemuxAvc",value:function(e,t,r,n,i,a,o){if(t.samples){var s=this;this.sampleAes.decryptAvcSamples(t.samples,0,0,(function(){s.remuxer.remux(e,t,r,n,i,a,o)}))}else this.remuxer.remux(e,t,r,n,i,a,o)}},{key:"destroy",value:function(){this._initPTS=this._initDTS=void 0,this._duration=0}},{key:"_parsePAT",value:function(e,t){return(31&e[t+10])<<8|e[t+11]}},{key:"_parsePMT",value:function(e,t,r,n){var i=void 0,a=void 0,o=void 0,s=void 0,l={audio:-1,avc:-1,id3:-1,isAAC:!0};i=(15&e[t+1])<<8|e[t+2],a=t+3+i-4,o=(15&e[t+10])<<8|e[t+11],t+=12+o;while(t<a){switch(s=(31&e[t+1])<<8|e[t+2],e[t]){case 207:if(!n){h.logger.log("unkown stream type:"+e[t]);break}case 15:-1===l.audio&&(l.audio=s);break;case 21:-1===l.id3&&(l.id3=s);break;case 219:if(!n){h.logger.log("unkown stream type:"+e[t]);break}case 27:-1===l.avc&&(l.avc=s);break;case 3:case 4:r?-1===l.audio&&(l.audio=s,l.isAAC=!1):h.logger.log("MPEG audio found, not supported in this browser for now");break;case 36:h.logger.warn("HEVC stream type found, not supported for now");break;default:h.logger.log("unkown stream type:"+e[t]);break}t+=5+((15&e[t+3])<<8|e[t+4])}return l}},{key:"_parsePES",value:function(e){var t=0,r=void 0,n=void 0,i=void 0,a=void 0,o=void 0,s=void 0,l=void 0,u=void 0,c=void 0,d=e.data;if(!e||0===e.size)return null;while(d[0].length<19&&d.length>1){var f=new Uint8Array(d[0].length+d[1].length);f.set(d[0]),f.set(d[1],d[0].length),d[0]=f,d.splice(1,1)}if(r=d[0],i=(r[0]<<16)+(r[1]<<8)+r[2],1===i){if(a=(r[4]<<8)+r[5],a&&a>e.size-6)return null;n=r[7],192&n&&(l=536870912*(14&r[9])+4194304*(255&r[10])+16384*(254&r[11])+128*(255&r[12])+(254&r[13])/2,l>4294967295&&(l-=8589934592),64&n?(u=536870912*(14&r[14])+4194304*(255&r[15])+16384*(254&r[16])+128*(255&r[17])+(254&r[18])/2,u>4294967295&&(u-=8589934592),l-u>54e5&&(h.logger.warn(Math.round((l-u)/9e4)+"s delta between PTS and DTS, align them"),l=u)):u=l),o=r[8],c=o+9,e.size-=c,s=new Uint8Array(e.size);for(var p=0,g=d.length;p<g;p++){r=d[p];var y=r.byteLength;if(c){if(c>y){c-=y;continue}r=r.subarray(c),y-=c,c=0}s.set(r,t),t+=y}return a&&(a-=o+3),{data:s,pts:l,dts:u,len:a}}return null}},{key:"pushAccesUnit",value:function(e,t){if(e.units.length&&e.frame){var r=t.samples,n=r.length;!this.config.forceKeyFrameOnDiscontinuity||!0===e.key||t.sps&&(n||this.contiguous)?(e.id=n,r.push(e)):t.dropped++}e.debug.length&&h.logger.log(e.pts+"/"+e.dts+":"+e.debug)}},{key:"_parseAVCPES",value:function(e,t){var r=this,n=this._avcTrack,i=this._parseAVCNALu(e.data),a=!1,o=void 0,s=this.avcSample,l=void 0,u=!1,c=void 0,f=this.pushAccesUnit.bind(this),p=function(e,t,r,n){return{key:e,pts:t,dts:r,units:[],debug:n}};e.data=null,s&&i.length&&!n.audFound&&(f(s,n),s=this.avcSample=p(!1,e.pts,e.dts,"")),i.forEach((function(t){switch(t.type){case 1:l=!0,s||(s=r.avcSample=p(!0,e.pts,e.dts,"")),a&&(s.debug+="NDR "),s.frame=!0;var i=t.data;if(u&&i.length>4){var h=new d.default(i).readSliceType();2!==h&&4!==h&&7!==h&&9!==h||(s.key=!0)}break;case 5:l=!0,s||(s=r.avcSample=p(!0,e.pts,e.dts,"")),a&&(s.debug+="IDR "),s.key=!0,s.frame=!0;break;case 6:l=!0,a&&s&&(s.debug+="SEI "),o=new d.default(r.discardEPB(t.data)),o.readUByte();var g=0,y=0,v=!1,m=0;while(!v&&o.bytesAvailable>1){g=0;do{m=o.readUByte(),g+=m}while(255===m);y=0;do{m=o.readUByte(),y+=m}while(255===m);if(4===g&&0!==o.bytesAvailable){v=!0;var x=o.readUByte();if(181===x){var b=o.readUShort();if(49===b){var k=o.readUInt();if(1195456820===k){var _=o.readUByte();if(3===_){var w=o.readUByte(),E=o.readUByte(),T=31&w,S=[w,E];for(c=0;c<T;c++)S.push(o.readUByte()),S.push(o.readUByte()),S.push(o.readUByte());r._insertSampleInOrder(r._txtTrack.samples,{type:3,pts:e.pts,bytes:S})}}}}}else if(y<o.bytesAvailable)for(c=0;c<y;c++)o.readUByte()}break;case 7:if(l=!0,u=!0,a&&s&&(s.debug+="SPS "),!n.sps){o=new d.default(t.data);var O=o.readSPS();n.width=O.width,n.height=O.height,n.pixelRatio=O.pixelRatio,n.sps=[t.data],n.duration=r._duration;var R=t.data.subarray(1,4),A="avc1.";for(c=0;c<3;c++){var P=R[c].toString(16);P.length<2&&(P="0"+P),A+=P}n.codec=A}break;case 8:l=!0,a&&s&&(s.debug+="PPS "),n.pps||(n.pps=[t.data]);break;case 9:l=!1,n.audFound=!0,s&&f(s,n),s=r.avcSample=p(!1,e.pts,e.dts,a?"AUD ":"");break;case 12:l=!1;break;default:l=!1,s&&(s.debug+="unknown NAL "+t.type+" ");break}if(s&&l){var L=s.units;L.push(t)}})),t&&s&&(f(s,n),this.avcSample=null)}},{key:"_insertSampleInOrder",value:function(e,t){var r=e.length;if(r>0){if(t.pts>=e[r-1].pts)e.push(t);else for(var n=r-1;n>=0;n--)if(t.pts<e[n].pts){e.splice(n,0,t);break}}else e.push(t)}},{key:"_getLastNalUnit",value:function(){var e=this.avcSample,t=void 0;if(!e||0===e.units.length){var r=this._avcTrack,n=r.samples;e=n[n.length-1]}if(e){var i=e.units;t=i[i.length-1]}return t}},{key:"_parseAVCNALu",value:function(e){var t=0,r=e.byteLength,n=void 0,i=void 0,a=this._avcTrack,o=a.naluState||0,s=o,l=[],u=void 0,c=void 0,d=-1,f=void 0;-1===o&&(d=0,f=31&e[0],o=0,t=1);while(t<r)if(n=e[t++],o)if(1!==o)if(n)if(1===n){if(d>=0)u={data:e.subarray(d,t-o-1),type:f},l.push(u);else{var p=this._getLastNalUnit();if(p&&(s&&t<=4-s&&p.state&&(p.data=p.data.subarray(0,p.data.byteLength-s)),i=t-o-1,i>0)){var h=new Uint8Array(p.data.byteLength+i);h.set(p.data,0),h.set(e.subarray(0,i),p.data.byteLength),p.data=h}}t<r?(c=31&e[t],d=t,f=c,o=0):o=-1}else o=0;else o=3;else o=n?0:2;else o=n?0:1;if(d>=0&&o>=0&&(u={data:e.subarray(d,r),type:f,state:o},l.push(u)),0===l.length){var g=this._getLastNalUnit();if(g){var y=new Uint8Array(g.data.byteLength+e.byteLength);y.set(g.data,0),y.set(e,g.data.byteLength),g.data=y}}return a.naluState=o,l}},{key:"discardEPB",value:function(e){var t=e.byteLength,r=[],n=1,i=void 0,a=void 0;while(n<t-2)0===e[n]&&0===e[n+1]&&3===e[n+2]?(r.push(n+2),n+=2):n++;if(0===r.length)return e;i=t-r.length,a=new Uint8Array(i);var o=0;for(n=0;n<i;o++,n++)o===r[0]&&(o++,r.shift()),a[n]=e[o];return a}},{key:"_parseAACPES",value:function(e){var t=this._audioTrack,r=e.data,n=e.pts,i=0,o=this.aacOverFlow,s=this.aacLastPTS,l=void 0,c=void 0,d=void 0,f=void 0,p=void 0;if(o){var y=new Uint8Array(o.byteLength+r.byteLength);y.set(o,0),y.set(r,o.byteLength),r=y}for(d=i,p=r.length;d<p-1;d++)if(a.isHeader(r,d))break;if(d){var v=void 0,m=void 0;if(d<p-1?(v="AAC PES did not start with ADTS header,offset:"+d,m=!1):(v="no ADTS header found in AAC PES",m=!0),h.logger.warn("parsing error:"+v),this.observer.trigger(u.default.ERROR,{type:g.ErrorTypes.MEDIA_ERROR,details:g.ErrorDetails.FRAG_PARSING_ERROR,fatal:m,reason:v}),m)return}if(a.initTrackConfig(t,this.observer,r,d,this.audioCodec),c=0,l=a.getFrameDuration(t.samplerate),o&&s){var x=s+l;Math.abs(x-n)>1&&(h.logger.log("AAC: align PTS for overlapping frames by "+Math.round((x-n)/90)),n=x)}while(d<p)if(a.isHeader(r,d)&&d+5<p){var b=a.appendFrame(t,r,d,n,c);if(!b)break;d+=b.length,f=b.sample.pts,c++}else d++;o=d<p?r.subarray(d,p):null,this.aacOverFlow=o,this.aacLastPTS=f}},{key:"_parseMPEGPES",value:function(e){var t=e.data,r=t.length,n=0,i=0,a=e.pts;while(i<r)if(s.default.isHeader(t,i)){var o=s.default.appendFrame(this._audioTrack,t,i,a,n);if(!o)break;i+=o.length,n++}else i++}},{key:"_parseID3PES",value:function(e){this._id3Track.samples.push(e)}}],[{key:"probe",value:function(t){var r=e._syncOffset(t);return!(r<0)&&(r&&h.logger.warn("MPEG2-TS detected but first sync word found @ offset "+r+", junk ahead ?"),!0)}},{key:"_syncOffset",value:function(e){var t=Math.min(1e3,e.length-564),r=0;while(r<t){if(71===e[r]&&71===e[r+188]&&71===e[r+376])return r;r++}return-1}},{key:"createTrack",value:function(e,t){return{container:"video"===e||"audio"===e?"video/mp2t":void 0,type:e,id:x[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],len:0,dropped:"video"===e?0:void 0,isAAC:"audio"===e||void 0,duration:"audio"===e?t:void 0}}}]),e}();t.default=b,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(t){a(this,e),this.data=t,this.bytesAvailable=t.byteLength,this.word=0,this.bitsAvailable=0}return n(e,[{key:"loadWord",value:function(){var e=this.data,t=this.bytesAvailable,r=e.byteLength-t,n=new Uint8Array(4),i=Math.min(4,t);if(0===i)throw new Error("no bytes available");n.set(e.subarray(r,r+i)),this.word=new DataView(n.buffer).getUint32(0),this.bitsAvailable=8*i,this.bytesAvailable-=i}},{key:"skipBits",value:function(e){var t=void 0;this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t>>3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}},{key:"readBits",value:function(e){var t=Math.min(this.bitsAvailable,e),r=this.word>>>32-t;return e>32&&i.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0?this.word<<=t:this.bytesAvailable>0&&this.loadWord(),t=e-t,t>0&&this.bitsAvailable?r<<t|this.readBits(t):r}},{key:"skipLZ",value:function(){var e=void 0;for(e=0;e<this.bitsAvailable;++e)if(0!==(this.word&2147483648>>>e))return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}},{key:"skipUEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"skipEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"readUEG",value:function(){var e=this.skipLZ();return this.readBits(e+1)-1}},{key:"readEG",value:function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}},{key:"readBoolean",value:function(){return 1===this.readBits(1)}},{key:"readUByte",value:function(){return this.readBits(8)}},{key:"readUShort",value:function(){return this.readBits(16)}},{key:"readUInt",value:function(){return this.readBits(32)}},{key:"skipScalingList",value:function(e){var t=8,r=8,n=void 0,i=void 0;for(n=0;n<e;n++)0!==r&&(i=this.readEG(),r=(t+i+256)%256),t=0===r?t:r}},{key:"readSPS",value:function(){var e=0,t=0,r=0,n=0,i=void 0,a=void 0,o=void 0,s=void 0,l=void 0,u=void 0,c=void 0,d=this.readUByte.bind(this),f=this.readBits.bind(this),p=this.readUEG.bind(this),h=this.readBoolean.bind(this),g=this.skipBits.bind(this),y=this.skipEG.bind(this),v=this.skipUEG.bind(this),m=this.skipScalingList.bind(this);if(d(),i=d(),f(5),g(3),d(),v(),100===i||110===i||122===i||244===i||44===i||83===i||86===i||118===i||128===i){var x=p();if(3===x&&g(1),v(),v(),g(1),h())for(u=3!==x?8:12,c=0;c<u;c++)h()&&m(c<6?16:64)}v();var b=p();if(0===b)p();else if(1===b)for(g(1),y(),y(),a=p(),c=0;c<a;c++)y();v(),g(1),o=p(),s=p(),l=f(1),0===l&&g(1),g(1),h()&&(e=p(),t=p(),r=p(),n=p());var k=[1,1];if(h()&&h()){var _=d();switch(_){case 1:k=[1,1];break;case 2:k=[12,11];break;case 3:k=[10,11];break;case 4:k=[16,11];break;case 5:k=[40,33];break;case 6:k=[24,11];break;case 7:k=[20,11];break;case 8:k=[32,11];break;case 9:k=[80,33];break;case 10:k=[18,11];break;case 11:k=[15,11];break;case 12:k=[64,33];break;case 13:k=[160,99];break;case 14:k=[4,3];break;case 15:k=[3,2];break;case 16:k=[2,1];break;case 255:k=[d()<<8|d(),d()<<8|d()];break}}return{width:Math.ceil(16*(o+1)-2*e-2*t),height:(2-l)*(s+1)*16-(l?2:4)*(r+n),pixelRatio:k}}},{key:"readSliceType",value:function(){return this.readUByte(),this.readUEG(),this.readUEG()}}]),e}();t.default=o,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(12),a=o(i);function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var l=function(){function e(t,r,n,i){s(this,e),this.decryptdata=n,this.discardEPB=i,this.decrypter=new a.default(t,r,{removePKCS7Padding:!1})}return n(e,[{key:"decryptBuffer",value:function(e,t){this.decrypter.decrypt(e,this.decryptdata.key.buffer,this.decryptdata.iv.buffer,t)}},{key:"decryptAacSample",value:function(e,t,r,n){var i=e[t].unit,a=i.subarray(16,i.length-i.length%16),o=a.buffer.slice(a.byteOffset,a.byteOffset+a.length),s=this;this.decryptBuffer(o,(function(a){a=new Uint8Array(a),i.set(a,16),n||s.decryptAacSamples(e,t+1,r)}))}},{key:"decryptAacSamples",value:function(e,t,r){for(;;t++){if(t>=e.length)return void r();if(!(e[t].unit.length<32)){var n=this.decrypter.isSync();if(this.decryptAacSample(e,t,r,n),!n)return}}}},{key:"getAvcEncryptedData",value:function(e){for(var t=16*Math.floor((e.length-48)/160)+16,r=new Int8Array(t),n=0,i=32;i<=e.length-16;i+=160,n+=16)r.set(e.subarray(i,i+16),n);return r}},{key:"getAvcDecryptedUnit",value:function(e,t){t=new Uint8Array(t);for(var r=0,n=32;n<=e.length-16;n+=160,r+=16)e.set(t.subarray(r,r+16),n);return e}},{key:"decryptAvcSample",value:function(e,t,r,n,i,a){var o=this.discardEPB(i.data),s=this.getAvcEncryptedData(o),l=this;this.decryptBuffer(s.buffer,(function(s){i.data=l.getAvcDecryptedUnit(o,s),a||l.decryptAvcSamples(e,t,r+1,n)}))}},{key:"decryptAvcSamples",value:function(e,t,r,n){for(;;t++,r=0){if(t>=e.length)return void n();for(var i=e[t].units;;r++){if(r>=i.length)break;var a=i[r];if(!(a.length<=48||1!==a.type&&5!==a.type)){var o=this.decrypter.isSync();if(this.decryptAvcSample(e,t,r,n,a,o),!o)return}}}}}]),e}();t.default=l,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(10),a=u(i),o=r(0),s=r(23),l=u(s);function u(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var d=function(){function e(t,r,n){c(this,e),this.observer=t,this.config=n,this.remuxer=r}return n(e,[{key:"resetInitSegment",value:function(e,t,r,n){this._audioTrack={container:"audio/mpeg",type:"audio",id:-1,sequenceNumber:0,isAAC:!1,samples:[],len:0,manifestCodec:t,duration:n,inputTimeScale:9e4}}},{key:"resetTimeStamp",value:function(){}},{key:"append",value:function(e,t,r,n){var i=a.default.getID3Data(e,0),o=a.default.getTimeStamp(i),s=o?90*o:9e4*t,u=i.length,c=e.length,d=0,f=0,p=this._audioTrack,h=[{pts:s,dts:s,data:i}];while(u<c)if(l.default.isHeader(e,u)){var g=l.default.appendFrame(p,e,u,s,d);if(!g)break;u+=g.length,f=g.sample.pts,d++}else a.default.isHeader(e,u)?(i=a.default.getID3Data(e,u),h.push({pts:f,dts:f,data:i}),u+=i.length):u++;this.remuxer.remux(p,{samples:[]},{samples:h,inputTimeScale:9e4},{samples:[]},t,r,n)}},{key:"destroy",value:function(){}}],[{key:"probe",value:function(e){var t=void 0,r=void 0,n=a.default.getID3Data(e,0);if(n&&void 0!==a.default.getTimeStamp(n))for(t=n.length,r=Math.min(e.length-1,t+100);t<r;t++)if(l.default.probe(e,t))return o.logger.log("MPEG Audio sync word found !"),!0;return!1}}]),e}();t.default=d,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(51),a=f(i),o=r(52),s=f(o),l=r(1),u=f(l),c=r(2),d=r(0);function f(e){return e&&e.__esModule?e:{default:e}}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var h=1e4,g=function(){function e(t,r,n,i){p(this,e),this.observer=t,this.config=r,this.typeSupported=n;var a=navigator.userAgent;this.isSafari=i&&i.indexOf("Apple")>-1&&a&&!a.match("CriOS"),this.ISGenerated=!1}return n(e,[{key:"destroy",value:function(){}},{key:"resetTimeStamp",value:function(e){this._initPTS=this._initDTS=e}},{key:"resetInitSegment",value:function(){this.ISGenerated=!1}},{key:"remux",value:function(e,t,r,n,i,a,o){if(this.ISGenerated||this.generateIS(e,t,i),this.ISGenerated){var s=e.samples.length,l=t.samples.length,c=i,f=i;if(s&&l){var p=(e.samples[0].pts-t.samples[0].pts)/t.inputTimeScale;c+=Math.max(0,p),f+=Math.max(0,-p)}if(s){e.timescale||(d.logger.warn("regenerate InitSegment as audio detected"),this.generateIS(e,t,i));var h=this.remuxAudio(e,c,a,o);if(l){var g=void 0;h&&(g=h.endPTS-h.startPTS),t.timescale||(d.logger.warn("regenerate InitSegment as video detected"),this.generateIS(e,t,i)),this.remuxVideo(t,f,a,g,o)}}else if(l){var y=this.remuxVideo(t,f,a,0,o);y&&e.codec&&this.remuxEmptyAudio(e,c,a,y)}}r.samples.length&&this.remuxID3(r,i),n.samples.length&&this.remuxText(n,i),this.observer.trigger(u.default.FRAG_PARSED)}},{key:"generateIS",value:function(e,t,r){var n=this.observer,i=e.samples,a=t.samples,o=this.typeSupported,l="audio/mp4",f={},p={tracks:f},h=void 0===this._initPTS,g=void 0,y=void 0;if(h&&(g=y=1/0),e.config&&i.length&&(e.timescale=e.samplerate,d.logger.log("audio sampling rate : "+e.samplerate),e.isAAC||(o.mpeg?(l="audio/mpeg",e.codec=""):o.mp3&&(e.codec="mp3")),f.audio={container:l,codec:e.codec,initSegment:!e.isAAC&&o.mpeg?new Uint8Array:s.default.initSegment([e]),metadata:{channelCount:e.channelCount}},h&&(g=y=i[0].pts-e.inputTimeScale*r)),t.sps&&t.pps&&a.length){var v=t.inputTimeScale;t.timescale=v,f.video={container:"video/mp4",codec:t.codec,initSegment:s.default.initSegment([t]),metadata:{width:t.width,height:t.height}},h&&(g=Math.min(g,a[0].pts-v*r),y=Math.min(y,a[0].dts-v*r),this.observer.trigger(u.default.INIT_PTS_FOUND,{initPTS:g}))}Object.keys(f).length?(n.trigger(u.default.FRAG_PARSING_INIT_SEGMENT,p),this.ISGenerated=!0,h&&(this._initPTS=g,this._initDTS=y)):n.trigger(u.default.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:c.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"no audio/video samples found"})}},{key:"remuxVideo",value:function(e,t,r,n,i){var a=8,o=void 0,l=void 0,f=void 0,p=void 0,h=void 0,g=void 0,y=void 0,v=e.timescale,m=e.samples,x=[],b=m.length,k=this._PTSNormalize,_=this._initPTS,w=this.nextAvcDts,E=this.isSafari;if(0!==b){E&&(r|=m.length&&w&&(i&&Math.abs(t-w/v)<.1||Math.abs(m[0].pts-w-_)<v/5)),r||(w=t*v),m.forEach((function(e){e.pts=k(e.pts-_,w),e.dts=k(e.dts-_,w)})),m.sort((function(e,t){var r=e.dts-t.dts,n=e.pts-t.pts;return r||n||e.id-t.id}));var T=m.reduce((function(e,t){return Math.max(Math.min(e,t.pts-t.dts),-18e3)}),0);if(T<0){d.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Math.round(T/90)+" ms to overcome this issue");for(var S=0;S<m.length;S++)m[S].dts+=T}var O=m[0];h=Math.max(O.dts,0),p=Math.max(O.pts,0);var R=Math.round((h-w)/90);r&&R&&(R>1?d.logger.log("AVC:"+R+" ms hole between fragments detected,filling it"):R<-1&&d.logger.log("AVC:"+-R+" ms overlapping between fragments detected"),h=w,m[0].dts=h,p=Math.max(p-R,w),m[0].pts=p,d.logger.log("Video/PTS/DTS adjusted: "+Math.round(p/90)+"/"+Math.round(h/90)+",delta:"+R+" ms")),O=m[m.length-1],y=Math.max(O.dts,0),g=Math.max(O.pts,0,y),E&&(o=Math.round((y-h)/(m.length-1)));for(var A=0,P=0,L=0;L<b;L++){for(var C=m[L],D=C.units,I=D.length,M=0,F=0;F<I;F++)M+=D[F].data.length;P+=M,A+=I,C.length=M,C.dts=E?h+L*o:Math.max(C.dts,h),C.pts=Math.max(C.pts,C.dts)}var N=P+4*A+8;try{l=new Uint8Array(N)}catch(ne){return void this.observer.trigger(u.default.ERROR,{type:c.ErrorTypes.MUX_ERROR,details:c.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:N,reason:"fail allocating video mdat "+N})}var B=new DataView(l.buffer);B.setUint32(0,N),l.set(s.default.types.mdat,4);for(var j=0;j<b;j++){for(var U=m[j],G=U.units,z=0,H=void 0,K=0,q=G.length;K<q;K++){var V=G[K],W=V.data,Y=V.data.byteLength;B.setUint32(a,Y),a+=4,l.set(W,a),a+=Y,z+=4+Y}if(E)H=Math.max(0,o*Math.round((U.pts-U.dts)/o));else{if(j<b-1)o=m[j+1].dts-U.dts;else{var X=this.config,$=U.dts-m[j>0?j-1:j].dts;if(X.stretchShortVideoTrack){var J=X.maxBufferHole,Q=Math.floor(J*v),Z=(n?p+n*v:this.nextAudioPts)-U.pts;Z>Q?(o=Z-$,o<0&&(o=$),d.logger.log("It is approximately "+Z/90+" ms to the next segment; using duration "+o/90+" ms for the last video frame.")):o=$}else o=$}H=Math.round(U.pts-U.dts)}x.push({size:z,duration:o,cts:H,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:U.key?2:1,isNonSync:U.key?0:1}})}this.nextAvcDts=y+o;var ee=e.dropped;if(e.len=0,e.nbNalu=0,e.dropped=0,x.length&&navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var te=x[0].flags;te.dependsOn=2,te.isNonSync=0}e.samples=x,f=s.default.moof(e.sequenceNumber++,h,e),e.samples=[];var re={data1:f,data2:l,startPTS:p/v,endPTS:(g+o)/v,startDTS:h/v,endDTS:this.nextAvcDts/v,type:"video",hasAudio:!1,hasVideo:!0,nb:x.length,dropped:ee};return this.observer.trigger(u.default.FRAG_PARSING_DATA,re),re}}},{key:"remuxAudio",value:function(e,t,r,n){var i=e.inputTimeScale,o=e.timescale,l=i/o,f=e.isAAC?1024:1152,p=f*l,g=this._PTSNormalize,y=this._initPTS,v=!e.isAAC&&this.typeSupported.mpeg,m=void 0,x=void 0,b=void 0,k=void 0,_=void 0,w=void 0,E=void 0,T=e.samples,S=[],O=this.nextAudioPts;if(r|=T.length&&O&&(n&&Math.abs(t-O/i)<.1||Math.abs(T[0].pts-O-y)<20*p),T.forEach((function(e){e.pts=e.dts=g(e.pts-y,t*i)})),T=T.filter((function(e){return e.pts>=0})),0!==T.length){if(r||(O=n?t*i:T[0].pts),e.isAAC)for(var R=this.config.maxAudioFramesDrift,A=0,P=O;A<T.length;){var L,C=T[A],D=C.pts;L=D-P;var I=Math.abs(1e3*L/i);if(L<=-R*p)d.logger.warn("Dropping 1 audio frame @ "+(P/i).toFixed(3)+"s due to "+Math.round(I)+" ms overlap."),T.splice(A,1),e.len-=C.unit.length;else if(L>=R*p&&I<h&&P){var M=Math.round(L/p);d.logger.warn("Injecting "+M+" audio frame @ "+(P/i).toFixed(3)+"s due to "+Math.round(1e3*L/i)+" ms gap.");for(var F=0;F<M;F++){var N=Math.max(P,0);b=a.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount),b||(d.logger.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),b=C.unit.subarray()),T.splice(A,0,{unit:b,pts:N,dts:N}),e.len+=b.length,P+=p,A++}C.pts=C.dts=P,P+=p,A++}else Math.abs(L),C.pts=C.dts=P,P+=p,A++}for(var B=0,j=T.length;B<j;B++){var U=T[B],G=U.unit,z=U.pts;if(void 0!==E)x.duration=Math.round((z-E)/l);else{var H=Math.round(1e3*(z-O)/i),K=0;if(r&&e.isAAC&&H){if(H>0&&H<h)K=Math.round((z-O)/p),d.logger.log(H+" ms hole between AAC samples detected,filling it"),K>0&&(b=a.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount),b||(b=G.subarray()),e.len+=K*b.length);else if(H<-12){d.logger.log("drop overlapping AAC sample, expected/parsed/delta:"+(O/i).toFixed(3)+"s/"+(z/i).toFixed(3)+"s/"+-H+"ms"),e.len-=G.byteLength;continue}z=O}if(w=z,!(e.len>0))return;var q=v?e.len:e.len+8;m=v?0:8;try{k=new Uint8Array(q)}catch(ee){return void this.observer.trigger(u.default.ERROR,{type:c.ErrorTypes.MUX_ERROR,details:c.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:q,reason:"fail allocating audio mdat "+q})}if(!v){var V=new DataView(k.buffer);V.setUint32(0,q),k.set(s.default.types.mdat,4)}for(var W=0;W<K;W++)b=a.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount),b||(d.logger.log("Unable to get silent frame for given audio codec; duplicating this frame instead."),b=G.subarray()),k.set(b,m),m+=b.byteLength,x={size:b.byteLength,cts:0,duration:1024,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},S.push(x)}k.set(G,m);var Y=G.byteLength;m+=Y,x={size:Y,cts:0,duration:0,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},S.push(x),E=z}var X=0,$=S.length;if($>=2&&(X=S[$-2].duration,x.duration=X),$){this.nextAudioPts=O=E+l*X,e.len=0,e.samples=S,_=v?new Uint8Array:s.default.moof(e.sequenceNumber++,w/l,e),e.samples=[];var J=w/i,Q=O/i,Z={data1:_,data2:k,startPTS:J,endPTS:Q,startDTS:J,endDTS:Q,type:"audio",hasAudio:!0,hasVideo:!1,nb:$};return this.observer.trigger(u.default.FRAG_PARSING_DATA,Z),Z}return null}}},{key:"remuxEmptyAudio",value:function(e,t,r,n){var i=e.inputTimeScale,o=e.samplerate?e.samplerate:i,s=i/o,l=this.nextAudioPts,u=(void 0!==l?l:n.startDTS*i)+this._initDTS,c=n.endDTS*i+this._initDTS,f=1024,p=s*f,h=Math.ceil((c-u)/p),g=a.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(d.logger.warn("remux empty Audio"),g){for(var y=[],v=0;v<h;v++){var m=u+v*p;y.push({unit:g,pts:m,dts:m}),e.len+=g.length}e.samples=y,this.remuxAudio(e,t,r)}else d.logger.trace("Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!")}},{key:"remuxID3",value:function(e){var t=e.samples.length,r=void 0,n=e.inputTimeScale,i=this._initPTS,a=this._initDTS;if(t){for(var o=0;o<t;o++)r=e.samples[o],r.pts=(r.pts-i)/n,r.dts=(r.dts-a)/n;this.observer.trigger(u.default.FRAG_PARSING_METADATA,{samples:e.samples})}e.samples=[]}},{key:"remuxText",value:function(e){e.samples.sort((function(e,t){return e.pts-t.pts}));var t=e.samples.length,r=void 0,n=e.inputTimeScale,i=this._initPTS;if(t){for(var a=0;a<t;a++)r=e.samples[a],r.pts=(r.pts-i)/n;this.observer.trigger(u.default.FRAG_PARSING_USERDATA,{samples:e.samples})}e.samples=[]}},{key:"_PTSNormalize",value:function(e,t){var r=void 0;if(void 0===t)return e;r=t<e?-8589934592:8589934592;while(Math.abs(e-t)>4294967296)e+=r;return e}}]),e}();t.default=g,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=function(){function e(){i(this,e)}return n(e,null,[{key:"getSilentFrame",value:function(e,t){switch(e){case"mp4a.40.2":if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return null}}]),e}();t.default=a,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=Math.pow(2,32)-1,o=function(){function e(){i(this,e)}return n(e,null,[{key:"init",value:function(){e.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var t=void 0;for(t in e.types)e.types.hasOwnProperty(t)&&(e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);var r=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),n=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);e.HDLR_TYPES={video:r,audio:n};var i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),a=new Uint8Array([0,0,0,0,0,0,0,0]);e.STTS=e.STSC=e.STCO=a,e.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),e.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),e.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),e.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var o=new Uint8Array([105,115,111,109]),s=new Uint8Array([97,118,99,49]),l=new Uint8Array([0,0,0,1]);e.FTYP=e.box(e.types.ftyp,o,l,o,s),e.DINF=e.box(e.types.dinf,e.box(e.types.dref,i))}},{key:"box",value:function(e){var t=Array.prototype.slice.call(arguments,1),r=8,n=t.length,i=n,a=void 0;while(n--)r+=t[n].byteLength;for(a=new Uint8Array(r),a[0]=r>>24&255,a[1]=r>>16&255,a[2]=r>>8&255,a[3]=255&r,a.set(e,4),n=0,r=8;n<i;n++)a.set(t[n],r),r+=t[n].byteLength;return a}},{key:"hdlr",value:function(t){return e.box(e.types.hdlr,e.HDLR_TYPES[t])}},{key:"mdat",value:function(t){return e.box(e.types.mdat,t)}},{key:"mdhd",value:function(t,r){r*=t;var n=Math.floor(r/(a+1)),i=Math.floor(r%(a+1));return e.box(e.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,n>>24,n>>16&255,n>>8&255,255&n,i>>24,i>>16&255,i>>8&255,255&i,85,196,0,0]))}},{key:"mdia",value:function(t){return e.box(e.types.mdia,e.mdhd(t.timescale,t.duration),e.hdlr(t.type),e.minf(t))}},{key:"mfhd",value:function(t){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))}},{key:"minf",value:function(t){return"audio"===t.type?e.box(e.types.minf,e.box(e.types.smhd,e.SMHD),e.DINF,e.stbl(t)):e.box(e.types.minf,e.box(e.types.vmhd,e.VMHD),e.DINF,e.stbl(t))}},{key:"moof",value:function(t,r,n){return e.box(e.types.moof,e.mfhd(t),e.traf(n,r))}},{key:"moov",value:function(t){var r=t.length,n=[];while(r--)n[r]=e.trak(t[r]);return e.box.apply(null,[e.types.moov,e.mvhd(t[0].timescale,t[0].duration)].concat(n).concat(e.mvex(t)))}},{key:"mvex",value:function(t){var r=t.length,n=[];while(r--)n[r]=e.trex(t[r]);return e.box.apply(null,[e.types.mvex].concat(n))}},{key:"mvhd",value:function(t,r){r*=t;var n=Math.floor(r/(a+1)),i=Math.floor(r%(a+1)),o=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,n>>24,n>>16&255,n>>8&255,255&n,i>>24,i>>16&255,i>>8&255,255&i,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return e.box(e.types.mvhd,o)}},{key:"sdtp",value:function(t){var r=t.samples||[],n=new Uint8Array(4+r.length),i=void 0,a=void 0;for(a=0;a<r.length;a++)i=r[a].flags,n[a+4]=i.dependsOn<<4|i.isDependedOn<<2|i.hasRedundancy;return e.box(e.types.sdtp,n)}},{key:"stbl",value:function(t){return e.box(e.types.stbl,e.stsd(t),e.box(e.types.stts,e.STTS),e.box(e.types.stsc,e.STSC),e.box(e.types.stsz,e.STSZ),e.box(e.types.stco,e.STCO))}},{key:"avc1",value:function(t){var r=[],n=[],i=void 0,a=void 0,o=void 0;for(i=0;i<t.sps.length;i++)a=t.sps[i],o=a.byteLength,r.push(o>>>8&255),r.push(255&o),r=r.concat(Array.prototype.slice.call(a));for(i=0;i<t.pps.length;i++)a=t.pps[i],o=a.byteLength,n.push(o>>>8&255),n.push(255&o),n=n.concat(Array.prototype.slice.call(a));var s=e.box(e.types.avcC,new Uint8Array([1,r[3],r[4],r[5],255,224|t.sps.length].concat(r).concat([t.pps.length]).concat(n))),l=t.width,u=t.height,c=t.pixelRatio[0],d=t.pixelRatio[1];return e.box(e.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255,255&l,u>>8&255,255&u,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),s,e.box(e.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),e.box(e.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,255&c,d>>24,d>>16&255,d>>8&255,255&d])))}},{key:"esds",value:function(e){var t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))}},{key:"mp4a",value:function(t){var r=t.samplerate;return e.box(e.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]),e.box(e.types.esds,e.esds(t)))}},{key:"mp3",value:function(t){var r=t.samplerate;return e.box(e.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]))}},{key:"stsd",value:function(t){return"audio"===t.type?t.isAAC||"mp3"!==t.codec?e.box(e.types.stsd,e.STSD,e.mp4a(t)):e.box(e.types.stsd,e.STSD,e.mp3(t)):e.box(e.types.stsd,e.STSD,e.avc1(t))}},{key:"tkhd",value:function(t){var r=t.id,n=t.duration*t.timescale,i=t.width,o=t.height,s=Math.floor(n/(a+1)),l=Math.floor(n%(a+1));return e.box(e.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,l>>24,l>>16&255,l>>8&255,255&l,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>8&255,255&i,0,0,o>>8&255,255&o,0,0]))}},{key:"traf",value:function(t,r){var n=e.sdtp(t),i=t.id,o=Math.floor(r/(a+1)),s=Math.floor(r%(a+1));return e.box(e.types.traf,e.box(e.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i])),e.box(e.types.tfdt,new Uint8Array([1,0,0,0,o>>24,o>>16&255,o>>8&255,255&o,s>>24,s>>16&255,s>>8&255,255&s])),e.trun(t,n.length+16+20+8+16+8+8),n)}},{key:"trak",value:function(t){return t.duration=t.duration||4294967295,e.box(e.types.trak,e.tkhd(t),e.mdia(t))}},{key:"trex",value:function(t){var r=t.id;return e.box(e.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}},{key:"trun",value:function(t,r){var n=t.samples||[],i=n.length,a=12+16*i,o=new Uint8Array(a),s=void 0,l=void 0,u=void 0,c=void 0,d=void 0,f=void 0;for(r+=8+a,o.set([0,0,15,1,i>>>24&255,i>>>16&255,i>>>8&255,255&i,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0),s=0;s<i;s++)l=n[s],u=l.duration,c=l.size,d=l.flags,f=l.cts,o.set([u>>>24&255,u>>>16&255,u>>>8&255,255&u,c>>>24&255,c>>>16&255,c>>>8&255,255&c,d.isLeading<<2|d.dependsOn,d.isDependedOn<<6|d.hasRedundancy<<4|d.paddingValue<<1|d.isNonSync,61440&d.degradPrio,15&d.degradPrio,f>>>24&255,f>>>16&255,f>>>8&255,255&f],12+16*s);return e.box(e.types.trun,o)}},{key:"initSegment",value:function(t){e.types||e.init();var r=e.moov(t),n=void 0;return n=new Uint8Array(e.FTYP.byteLength+r.byteLength),n.set(e.FTYP),n.set(r,e.FTYP.byteLength),n}}]),e}();t.default=o,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(1),a=o(i);function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var l=function(){function e(t){s(this,e),this.observer=t}return n(e,[{key:"destroy",value:function(){}},{key:"resetTimeStamp",value:function(){}},{key:"resetInitSegment",value:function(){}},{key:"remux",value:function(e,t,r,n,i,o,s,l){var u=this.observer,c="";e&&(c+="audio"),t&&(c+="video"),u.trigger(a.default.FRAG_PARSING_DATA,{data1:l,startPTS:i,startDTS:i,type:c,hasAudio:!!e,hasVideo:!!t,nb:1,dropped:0}),u.trigger(a.default.FRAG_PARSED)}}]),e}();t.default=l,e.exports=t["default"]},function(e,t,r){"use strict";var n=Object.prototype.hasOwnProperty,i="~";function a(){}function o(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function s(e,t,r,n,a){if("function"!==typeof r)throw new TypeError("The listener must be a function");var s=new o(r,n||e,a),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function l(e,t){0===--e._eventsCount?e._events=new a:delete e._events[t]}function u(){this._events=new a,this._eventsCount=0}Object.create&&(a.prototype=Object.create(null),(new a).__proto__||(i=!1)),u.prototype.eventNames=function(){var e,t,r=[];if(0===this._eventsCount)return r;for(t in e=this._events)n.call(e,t)&&r.push(i?t.slice(1):t);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},u.prototype.listeners=function(e){var t=i?i+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,a=r.length,o=new Array(a);n<a;n++)o[n]=r[n].fn;return o},u.prototype.listenerCount=function(e){var t=i?i+e:e,r=this._events[t];return r?r.fn?1:r.length:0},u.prototype.emit=function(e,t,r,n,a,o){var s=i?i+e:e;if(!this._events[s])return!1;var l,u,c=this._events[s],d=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),d){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,r),!0;case 4:return c.fn.call(c.context,t,r,n),!0;case 5:return c.fn.call(c.context,t,r,n,a),!0;case 6:return c.fn.call(c.context,t,r,n,a,o),!0}for(u=1,l=new Array(d-1);u<d;u++)l[u-1]=arguments[u];c.fn.apply(c.context,l)}else{var f,p=c.length;for(u=0;u<p;u++)switch(c[u].once&&this.removeListener(e,c[u].fn,void 0,!0),d){case 1:c[u].fn.call(c[u].context);break;case 2:c[u].fn.call(c[u].context,t);break;case 3:c[u].fn.call(c[u].context,t,r);break;case 4:c[u].fn.call(c[u].context,t,r,n);break;default:if(!l)for(f=1,l=new Array(d-1);f<d;f++)l[f-1]=arguments[f];c[u].fn.apply(c[u].context,l)}}return!0},u.prototype.on=function(e,t,r){return s(this,e,t,r,!1)},u.prototype.once=function(e,t,r){return s(this,e,t,r,!0)},u.prototype.removeListener=function(e,t,r,n){var a=i?i+e:e;if(!this._events[a])return this;if(!t)return l(this,a),this;var o=this._events[a];if(o.fn)o.fn!==t||n&&!o.once||r&&o.context!==r||l(this,a);else{for(var s=0,u=[],c=o.length;s<c;s++)(o[s].fn!==t||n&&!o[s].once||r&&o[s].context!==r)&&u.push(o[s]);u.length?this._events[a]=1===u.length?u[0]:u:l(this,a)}return this},u.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&l(this,t)):(this._events=new a,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=i,u.EventEmitter=u,e.exports=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(21),i=u(n),a=r(1),o=u(a),s=r(0),l=r(20);function u(e){return e&&e.__esModule?e:{default:e}}var c=function(e){var t=new l.EventEmitter;t.trigger=function(e){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];t.emit.apply(t,[e,e].concat(n))},t.off=function(e){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];t.removeListener.apply(t,[e].concat(n))};var r=function(t,r){e.postMessage({event:t,data:r})};e.addEventListener("message",(function(n){var a=n.data;switch(a.cmd){case"init":var o=JSON.parse(a.config);e.demuxer=new i.default(t,a.typeSupported,o,a.vendor),(0,s.enableLogs)(o.debug),r("init",null);break;case"demux":e.demuxer.push(a.data,a.decryptdata,a.initSegment,a.audioCodec,a.videoCodec,a.timeOffset,a.discontinuity,a.trackSwitch,a.contiguous,a.duration,a.accurateTimeOffset,a.defaultInitPTS);break;default:break}})),t.on(o.default.FRAG_DECRYPTED,r),t.on(o.default.FRAG_PARSING_INIT_SEGMENT,r),t.on(o.default.FRAG_PARSED,r),t.on(o.default.ERROR,r),t.on(o.default.FRAG_PARSING_METADATA,r),t.on(o.default.FRAG_PARSING_USERDATA,r),t.on(o.default.INIT_PTS_FOUND,r),t.on(o.default.FRAG_PARSING_DATA,(function(t,r){var n=[],i={event:t,data:r};r.data1&&(i.data1=r.data1.buffer,n.push(r.data1.buffer),delete r.data1),r.data2&&(i.data2=r.data2.buffer,n.push(r.data2.buffer),delete r.data2),e.postMessage(i,n)}))};t.default=c,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(4),a=r(2),o=r(1),s=u(o),l=r(0);function u(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var d=1e3,f=.5,p=function(){function e(t,r,n,i){c(this,e),this.config=t,this.media=r,this.fragmentTracker=n,this.hls=i,this.stallReported=!1}return n(e,[{key:"poll",value:function(e,t){var r=this.config,n=this.media,a=n.currentTime,o=window.performance.now();if(a!==e)return this.stallReported&&(l.logger.warn("playback not stuck anymore @"+a+", after "+Math.round(o-this.stalled)+"ms"),this.stallReported=!1),this.stalled=null,void(this.nudgeRetry=0);if(!(n.ended||!n.buffered.length||n.readyState>2)&&(!n.seeking||!i.BufferHelper.isBuffered(n,a))){var s=o-this.stalled,u=i.BufferHelper.bufferInfo(n,a,r.maxBufferHole);this.stalled?(s>=d&&this._reportStall(u.len),this._tryFixBufferStall(u,s)):this.stalled=o}}},{key:"_tryFixBufferStall",value:function(e,t){var r=this.config,n=this.fragmentTracker,i=this.media,a=i.currentTime,o=n.getPartialFragment(a);o&&this._trySkipBufferHole(o),e.len>f&&t>1e3*r.highBufferWatchdogPeriod&&(this.stalled=null,this._tryNudgeBuffer())}},{key:"_reportStall",value:function(e){var t=this.hls,r=this.media,n=this.stallReported;n||(this.stallReported=!0,l.logger.warn("Playback stalling at @"+r.currentTime+" due to low buffer"),t.trigger(s.default.ERROR,{type:a.ErrorTypes.MEDIA_ERROR,details:a.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:e}))}},{key:"_trySkipBufferHole",value:function(e){for(var t=this.hls,r=this.media,n=r.currentTime,i=0,o=0;o<r.buffered.length;o++){var u=r.buffered.start(o);if(n>=i&&n<u)return r.currentTime=Math.max(u,r.currentTime+.1),l.logger.warn("skipping hole, adjusting currentTime from "+n+" to "+r.currentTime),this.stalled=null,void t.trigger(s.default.ERROR,{type:a.ErrorTypes.MEDIA_ERROR,details:a.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+n+" to "+r.currentTime,frag:e});i=r.buffered.end(o)}}},{key:"_tryNudgeBuffer",value:function(){var e=this.config,t=this.hls,r=this.media,n=r.currentTime,i=(this.nudgeRetry||0)+1;if(this.nudgeRetry=i,i<e.nudgeMaxRetry){var o=n+i*e.nudgeOffset;l.logger.log("adjust currentTime from "+n+" to "+o),r.currentTime=o,t.trigger(s.default.ERROR,{type:a.ErrorTypes.MEDIA_ERROR,details:a.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else l.logger.error("still stuck in high buffer @"+n+" after "+e.nudgeMaxRetry+", raise fatal error"),t.trigger(s.default.ERROR,{type:a.ErrorTypes.MEDIA_ERROR,details:a.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})}}]),e}();t.default=p,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=r(1),o=p(a),s=r(3),l=p(s),u=r(0),c=r(2),d=r(18),f=r(7);function p(e){return e&&e.__esModule?e:{default:e}}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function y(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var v=window,m=(v.performance,void 0),x=function(e){function t(e){h(this,t);var r=g(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,o.default.MANIFEST_LOADED,o.default.LEVEL_LOADED,o.default.AUDIO_TRACK_SWITCHED,o.default.FRAG_LOADED,o.default.ERROR));return r.canload=!1,r.currentLevelIndex=null,r.manualLevelIndex=-1,r.timer=null,m=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),r}return y(t,e),i(t,[{key:"onHandlerDestroying",value:function(){this.clearTimer(),this.manualLevelIndex=-1}},{key:"clearTimer",value:function(){null!==this.timer&&(clearTimeout(this.timer),this.timer=null)}},{key:"startLoad",value:function(){var e=this._levels;this.canload=!0,this.levelRetryCount=0,e&&e.forEach((function(e){e.loadError=0;var t=e.details;t&&t.live&&(e.details=void 0)})),null!==this.timer&&this.loadLevel()}},{key:"stopLoad",value:function(){this.canload=!1}},{key:"onManifestLoaded",value:function(e){var t=[],r=[],n=void 0,i={},a=null,s=!1,l=!1;if(e.levels.forEach((function(e){var r=e.attrs;e.loadError=0,e.fragmentError=!1,s=s||!!e.videoCodec,l=l||!!e.audioCodec,m&&e.audioCodec&&-1!==e.audioCodec.indexOf("mp4a.40.34")&&(e.audioCodec=void 0),a=i[e.bitrate],a?a.url.push(e.url):(e.url=[e.url],e.urlId=0,i[e.bitrate]=e,t.push(e)),r&&(r.AUDIO&&(l=!0,(0,f.addGroupId)(a||e,"audio",r.AUDIO)),r.SUBTITLES&&(0,f.addGroupId)(a||e,"text",r.SUBTITLES))})),s&&l&&(t=t.filter((function(e){var t=e.videoCodec;return!!t}))),t=t.filter((function(e){var t=e.audioCodec,r=e.videoCodec;return(!t||(0,d.isCodecSupportedInMp4)(t,"audio"))&&(!r||(0,d.isCodecSupportedInMp4)(r,"video"))})),e.audioTracks&&(r=e.audioTracks.filter((function(e){return!e.audioCodec||(0,d.isCodecSupportedInMp4)(e.audioCodec,"audio")})),r.forEach((function(e,t){e.id=t}))),t.length>0){n=t[0].bitrate,t.sort((function(e,t){return e.bitrate-t.bitrate})),this._levels=t;for(var p=0;p<t.length;p++)if(t[p].bitrate===n){this._firstLevel=p,u.logger.log("manifest loaded,"+t.length+" level(s) found, first bitrate:"+n);break}this.hls.trigger(o.default.MANIFEST_PARSED,{levels:t,audioTracks:r,firstLevel:this._firstLevel,stats:e.stats,audio:l,video:s,altAudio:r.some((function(e){return!!e.url}))})}else this.hls.trigger(o.default.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:c.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:this.hls.url,reason:"no level with compatible codecs found in manifest"})}},{key:"setLevelInternal",value:function(e){var t=this._levels,r=this.hls;if(e>=0&&e<t.length){if(this.clearTimer(),this.currentLevelIndex!==e){u.logger.log("switching to level "+e),this.currentLevelIndex=e;var n=t[e];n.level=e,r.trigger(o.default.LEVEL_SWITCHING,n)}var i=t[e],a=i.details;if(!a||a.live){var s=i.urlId;r.trigger(o.default.LEVEL_LOADING,{url:i.url[s],level:e,id:s})}}else r.trigger(o.default.ERROR,{type:c.ErrorTypes.OTHER_ERROR,details:c.ErrorDetails.LEVEL_SWITCH_ERROR,level:e,fatal:!1,reason:"invalid level idx"})}},{key:"onError",value:function(e){if(e.fatal)e.type===c.ErrorTypes.NETWORK_ERROR&&this.clearTimer();else{var t=!1,r=!1,n=void 0;switch(e.details){case c.ErrorDetails.FRAG_LOAD_ERROR:case c.ErrorDetails.FRAG_LOAD_TIMEOUT:case c.ErrorDetails.KEY_LOAD_ERROR:case c.ErrorDetails.KEY_LOAD_TIMEOUT:n=e.frag.level,r=!0;break;case c.ErrorDetails.LEVEL_LOAD_ERROR:case c.ErrorDetails.LEVEL_LOAD_TIMEOUT:n=e.context.level,t=!0;break;case c.ErrorDetails.REMUX_ALLOC_ERROR:n=e.level,t=!0;break}void 0!==n&&this.recoverLevel(e,n,t,r)}}},{key:"recoverLevel",value:function(e,t,r,n){var i=this,a=this.hls.config,o=e.details,s=this._levels[t],l=void 0,c=void 0,d=void 0;if(s.loadError++,s.fragmentError=n,r){if(!(this.levelRetryCount+1<=a.levelLoadingMaxRetry))return u.logger.error("level controller, cannot recover from "+o+" error"),this.currentLevelIndex=null,this.clearTimer(),void(e.fatal=!0);c=Math.min(Math.pow(2,this.levelRetryCount)*a.levelLoadingRetryDelay,a.levelLoadingMaxRetryTimeout),this.timer=setTimeout((function(){return i.loadLevel()}),c),e.levelRetry=!0,this.levelRetryCount++,u.logger.warn("level controller, "+o+", retry in "+c+" ms, current retry count is "+this.levelRetryCount)}(r||n)&&(l=s.url.length,l>1&&s.loadError<l?(s.urlId=(s.urlId+1)%l,s.details=void 0,u.logger.warn("level controller, "+o+" for level "+t+": switching to redundant URL-id "+s.urlId)):-1===this.manualLevelIndex?(d=0===t?this._levels.length-1:t-1,u.logger.warn("level controller, "+o+": switch to "+d),this.hls.nextAutoLevel=this.currentLevelIndex=d):n&&(u.logger.warn("level controller, "+o+": reload a fragment"),this.currentLevelIndex=null))}},{key:"onFragLoaded",value:function(e){var t=e.frag;if(void 0!==t&&"main"===t.type){var r=this._levels[t.level];void 0!==r&&(r.fragmentError=!1,r.loadError=0,this.levelRetryCount=0)}}},{key:"onLevelLoaded",value:function(e){var t=this,r=e.level,n=e.details;if(r===this.currentLevelIndex){var i=this._levels[r];if(i.fragmentError||(i.loadError=0,this.levelRetryCount=0),n.live){var a=(0,f.computeReloadInterval)(i.details,n,e.stats.trequest);u.logger.log("live playlist, reload in "+Math.round(a)+" ms"),this.timer=setTimeout((function(){return t.loadLevel()}),a)}else this.clearTimer()}}},{key:"onAudioTrackSwitched",value:function(e){var t=this.hls.audioTracks[e.id].groupId,r=this.hls.levels[this.currentLevelIndex];if(r&&r.audioGroupIds){for(var n=-1,i=0;i<r.audioGroupIds.length;i++)if(r.audioGroupIds[i]===t){n=i;break}n!==r.urlId&&(r.urlId=n,this.startLoad())}}},{key:"loadLevel",value:function(){if(u.logger.debug("call to loadLevel"),null!==this.currentLevelIndex&&this.canload){var e=this._levels[this.currentLevelIndex];if("object"===("undefined"===typeof e?"undefined":n(e))&&e.url.length>0){var t=this.currentLevelIndex,r=e.urlId,i=e.url[r];u.logger.log("Attempt loading level index "+t+" with URL-id "+r),this.hls.trigger(o.default.LEVEL_LOADING,{url:i,level:t,id:r})}}}},{key:"levels",get:function(){return this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(e){var t=this._levels;t&&(e=Math.min(e,t.length-1),this.currentLevelIndex===e&&t[e].details||this.setLevelInternal(e))}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(e){this.manualLevelIndex=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(e){this._firstLevel=e}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var e=this.hls.config.startLevel;return void 0!==e?e:this._firstLevel}return this._startLevel},set:function(e){this._startLevel=e}},{key:"nextLoadLevel",get:function(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(e){this.level=e,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=e)}}]),t}(l.default);t.default=x,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(1),a=d(i),o=r(3),s=d(o),l=r(10),u=d(l),c=r(29);function d(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function h(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var g=function(e){function t(e){f(this,t);var r=p(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,a.default.MEDIA_ATTACHED,a.default.MEDIA_DETACHING,a.default.FRAG_PARSING_METADATA));return r.id3Track=void 0,r.media=void 0,r}return h(t,e),n(t,[{key:"destroy",value:function(){s.default.prototype.destroy.call(this)}},{key:"onMediaAttached",value:function(e){this.media=e.media,this.media}},{key:"onMediaDetaching",value:function(){(0,c.clearCurrentCues)(this.id3Track),this.id3Track=void 0,this.media=void 0}},{key:"getID3Track",value:function(e){for(var t=0;t<e.length;t++){var r=e[t];if("metadata"===r.kind&&"id3"===r.label)return(0,c.sendAddTrackEvent)(r,this.media),r}return this.media.addTextTrack("metadata","id3")}},{key:"onFragParsingMetadata",value:function(e){var t=e.frag,r=e.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var n=window.WebKitDataCue||window.VTTCue||window.TextTrackCue,i=0;i<r.length;i++){var a=u.default.getID3Frames(r[i].data);if(a){var o=r[i].pts,s=i<r.length-1?r[i+1].pts:t.endPTS;o===s&&(s+=1e-4);for(var l=0;l<a.length;l++){var c=a[l];if(!u.default.isTimeStampFrame(c)){var d=new n(o,s,"");d.value=c,this.id3Track.addCue(d)}}}}}}]),t}(s.default);t.default=g,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSupported=i;var n=r(13);function i(){var e=(0,n.getMediaSource)(),t=window.SourceBuffer||window.WebKitSourceBuffer,r=e&&"function"===typeof e.isTypeSupported&&e.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),i=!t||t.prototype&&"function"===typeof t.prototype.appendBuffer&&"function"===typeof t.prototype.remove;return!!r&&!!i}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hlsDefaultConfig=void 0;var n=r(61),i=R(n),a=r(64),o=R(a),s=r(65),l=R(s),u=r(66),c=R(u),d=r(67),f=R(d),p=r(68),h=R(p),g=r(69),y=R(g),v=r(70),m=O(v),x=r(72),b=R(x),k=r(76),_=R(k),w=r(77),E=r(78),T=R(E),S=r(79);function O(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function R(e){return e&&e.__esModule?e:{default:e}}var A=t.hlsDefaultConfig={autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,maxBufferSize:6e7,maxBufferHole:.5,lowBufferWatchdogPeriod:.5,highBufferWatchdogPeriod:3,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,liveDurationInfinity:!1,liveBackBufferLength:1/0,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:f.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,abrController:i.default,bufferController:o.default,capLevelController:l.default,fpsController:c.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,requestMediaKeySystemAccessFunc:S.requestMediaKeySystemAccess};A.subtitleStreamController=w.SubtitleStreamController,A.subtitleTrackController=_.default,A.timelineController=b.default,A.cueHandler=m,A.enableCEA708Captions=!0,A.enableWebVTT=!0,A.captionsTextTrack1Label="English",A.captionsTextTrack1LanguageCode="en",A.captionsTextTrack2Label="Spanish",A.captionsTextTrack2LanguageCode="es",A.audioStreamController=y.default,A.audioTrackController=h.default,A.emeController=T.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(1),a=p(i),o=r(3),s=p(o),l=r(4),u=r(2),c=r(0),d=r(62),f=p(d);function p(e){return e&&e.__esModule?e:{default:e}}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function y(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var v=window,m=v.performance,x=function(e){function t(e){h(this,t);var r=g(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,a.default.FRAG_LOADING,a.default.FRAG_LOADED,a.default.FRAG_BUFFERED,a.default.ERROR));return r.lastLoadedFragLevel=0,r._nextAutoLevel=-1,r.hls=e,r.timer=null,r._bwEstimator=null,r.onCheck=r._abandonRulesCheck.bind(r),r}return y(t,e),n(t,[{key:"destroy",value:function(){this.clearTimer(),s.default.prototype.destroy.call(this)}},{key:"onFragLoading",value:function(e){var t=e.frag;if("main"===t.type&&(this.timer||(this.fragCurrent=t,this.timer=setInterval(this.onCheck,100)),!this._bwEstimator)){var r=this.hls,n=r.config,i=t.level,a=r.levels[i].details.live,o=void 0,s=void 0;a?(o=n.abrEwmaFastLive,s=n.abrEwmaSlowLive):(o=n.abrEwmaFastVoD,s=n.abrEwmaSlowVoD),this._bwEstimator=new f.default(r,s,o,n.abrEwmaDefaultEstimate)}}},{key:"_abandonRulesCheck",value:function(){var e=this.hls,t=e.media,r=this.fragCurrent;if(r){var n=r.loader,i=e.minAutoLevel;if(!n||n.stats&&n.stats.aborted)return c.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),void(this._nextAutoLevel=-1);var o=n.stats;if(t&&o&&(!t.paused&&0!==t.playbackRate||!t.readyState)&&r.autoLevel&&r.level){var s=m.now()-o.trequest,u=Math.abs(t.playbackRate);if(s>500*r.duration/u){var d=e.levels,f=Math.max(1,o.bw?o.bw/8:1e3*o.loaded/s),p=d[r.level],h=p.realBitrate?Math.max(p.realBitrate,p.bitrate):p.bitrate,g=o.total?o.total:Math.max(o.loaded,Math.round(r.duration*h/8)),y=t.currentTime,v=(g-o.loaded)/f,x=(l.BufferHelper.bufferInfo(t,y,e.config.maxBufferHole).end-y)/u;if(x<2*r.duration/u&&v>x){var b=void 0,k=void 0;for(k=r.level-1;k>i;k--){var _=d[k].realBitrate?Math.max(d[k].realBitrate,d[k].bitrate):d[k].bitrate;if(b=r.duration*_/(6.4*f),b<x)break}b<v&&(c.logger.warn("loading too slow, abort fragment loading and switch to level "+k+":fragLoadedDelay["+k+"]<fragLoadedDelay["+(r.level-1)+"];bufferStarvationDelay:"+b.toFixed(1)+"<"+v.toFixed(1)+":"+x.toFixed(1)),e.nextLoadLevel=k,this._bwEstimator.sample(s,o.loaded),n.abort(),this.clearTimer(),e.trigger(a.default.FRAG_LOAD_EMERGENCY_ABORTED,{frag:r,stats:o}))}}}}}},{key:"onFragLoaded",value:function(e){var t=e.frag;if("main"===t.type&&Number.isFinite(t.sn)){if(this.clearTimer(),this.lastLoadedFragLevel=t.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var r=this.hls.levels[t.level],n=(r.loaded?r.loaded.bytes:0)+e.stats.loaded,i=(r.loaded?r.loaded.duration:0)+e.frag.duration;r.loaded={bytes:n,duration:i},r.realBitrate=Math.round(8*n/i)}if(e.frag.bitrateTest){var a=e.stats;a.tparsed=a.tbuffered=a.tload,this.onFragBuffered(e)}}}},{key:"onFragBuffered",value:function(e){var t=e.stats,r=e.frag;if(!0!==t.aborted&&"main"===r.type&&Number.isFinite(r.sn)&&(!r.bitrateTest||t.tload===t.tbuffered)){var n=t.tparsed-t.trequest;c.logger.log("latency/loading/parsing/append/kbps:"+Math.round(t.tfirst-t.trequest)+"/"+Math.round(t.tload-t.tfirst)+"/"+Math.round(t.tparsed-t.tload)+"/"+Math.round(t.tbuffered-t.tparsed)+"/"+Math.round(8*t.loaded/(t.tbuffered-t.trequest))),this._bwEstimator.sample(n,t.loaded),t.bwEstimate=this._bwEstimator.getEstimate(),r.bitrateTest?this.bitrateTestDelay=n/1e3:this.bitrateTestDelay=0}}},{key:"onError",value:function(e){switch(e.details){case u.ErrorDetails.FRAG_LOAD_ERROR:case u.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}}},{key:"clearTimer",value:function(){clearInterval(this.timer),this.timer=null}},{key:"_findBestLevel",value:function(e,t,r,n,i,a,o,s,l){for(var u=i;u>=n;u--){var d=l[u];if(d){var f=d.details,p=f?f.totalduration/f.fragments.length:t,h=!!f&&f.live,g=void 0;g=u<=e?o*r:s*r;var y=l[u].realBitrate?Math.max(l[u].realBitrate,l[u].bitrate):l[u].bitrate,v=y*p/g;if(c.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+u+"/"+Math.round(g)+"/"+y+"/"+p+"/"+a+"/"+v),g>y&&(!v||h&&!this.bitrateTestDelay||v<a))return u}}return-1}},{key:"nextAutoLevel",get:function(){var e=this._nextAutoLevel,t=this._bwEstimator;if(-1!==e&&(!t||!t.canEstimate()))return e;var r=this._nextABRAutoLevel;return-1!==e&&(r=Math.min(e,r)),r},set:function(e){this._nextAutoLevel=e}},{key:"_nextABRAutoLevel",get:function(){var e=this.hls,t=e.maxAutoLevel,r=e.levels,n=e.config,i=e.minAutoLevel,a=e.media,o=this.lastLoadedFragLevel,s=this.fragCurrent?this.fragCurrent.duration:0,u=a?a.currentTime:0,d=a&&0!==a.playbackRate?Math.abs(a.playbackRate):1,f=this._bwEstimator?this._bwEstimator.getEstimate():n.abrEwmaDefaultEstimate,p=(l.BufferHelper.bufferInfo(a,u,n.maxBufferHole).end-u)/d,h=this._findBestLevel(o,s,f,i,t,p,n.abrBandWidthFactor,n.abrBandWidthUpFactor,r);if(h>=0)return h;c.logger.trace("rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering");var g=s?Math.min(s,n.maxStarvationDelay):n.maxStarvationDelay,y=n.abrBandWidthFactor,v=n.abrBandWidthUpFactor;if(0===p){var m=this.bitrateTestDelay;if(m){var x=s?Math.min(s,n.maxLoadingDelay):n.maxLoadingDelay;g=x-m,c.logger.trace("bitrate test took "+Math.round(1e3*m)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*g)+" ms"),y=v=1}}return h=this._findBestLevel(o,s,f,i,t,p+g,y,v,r),Math.max(h,0)}}]),t}(s.default);t.default=x,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(63),a=o(i);function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var l=function(){function e(t,r,n,i){s(this,e),this.hls=t,this.defaultEstimate_=i,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new a.default(r),this.fast_=new a.default(n)}return n(e,[{key:"sample",value:function(e,t){e=Math.max(e,this.minDelayMs_);var r=8e3*t/e,n=e/1e3;this.fast_.sample(n,r),this.slow_.sample(n,r)}},{key:"canEstimate",value:function(){var e=this.fast_;return e&&e.getTotalWeight()>=this.minWeight_}},{key:"getEstimate",value:function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}},{key:"destroy",value:function(){}}]),e}();t.default=l,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=function(){function e(t){i(this,e),this.alpha_=t?Math.exp(Math.log(.5)/t):0,this.estimate_=0,this.totalWeight_=0}return n(e,[{key:"sample",value:function(e,t){var r=Math.pow(this.alpha_,e);this.estimate_=t*(1-r)+r*this.estimate_,this.totalWeight_+=e}},{key:"getTotalWeight",value:function(){return this.totalWeight_}},{key:"getEstimate",value:function(){if(this.alpha_){var e=1-Math.pow(this.alpha_,this.totalWeight_);return this.estimate_/e}return this.estimate_}}]),e}();t.default=a,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(1),a=d(i),o=r(3),s=d(o),l=r(0),u=r(2),c=r(13);function d(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function h(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var g=(0,c.getMediaSource)(),y=function(e){function t(e){f(this,t);var r=p(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,a.default.MEDIA_ATTACHING,a.default.MEDIA_DETACHING,a.default.MANIFEST_PARSED,a.default.BUFFER_RESET,a.default.BUFFER_APPENDING,a.default.BUFFER_CODECS,a.default.BUFFER_EOS,a.default.BUFFER_FLUSHING,a.default.LEVEL_PTS_UPDATED,a.default.LEVEL_UPDATED));return r._msDuration=null,r._levelDuration=null,r._levelTargetDuration=10,r._live=null,r._objectUrl=null,r.bufferCodecEventsExpected=0,r.onsbue=r.onSBUpdateEnd.bind(r),r.onsbe=r.onSBUpdateError.bind(r),r.pendingTracks={},r.tracks={},r}return h(t,e),n(t,[{key:"destroy",value:function(){s.default.prototype.destroy.call(this)}},{key:"onLevelPtsUpdated",value:function(e){var t=e.type,r=this.tracks.audio;if("audio"===t&&r&&"audio/mpeg"===r.container){var n=this.sourceBuffer.audio,i=Math.abs(n.timestampOffset-e.start);if(i>.1){var a=n.updating;try{n.abort()}catch(o){l.logger.warn("can not abort audio buffer: "+o)}a?this.audioTimestampOffset=e.start:(l.logger.warn("change mpeg audio timestamp offset from "+n.timestampOffset+" to "+e.start),n.timestampOffset=e.start)}}}},{key:"onManifestParsed",value:function(e){this.bufferCodecEventsExpected=e.altAudio?2:1,l.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")}},{key:"onMediaAttaching",value:function(e){var t=this.media=e.media;if(t){var r=this.mediaSource=new g;this.onmso=this.onMediaSourceOpen.bind(this),this.onmse=this.onMediaSourceEnded.bind(this),this.onmsc=this.onMediaSourceClose.bind(this),r.addEventListener("sourceopen",this.onmso),r.addEventListener("sourceended",this.onmse),r.addEventListener("sourceclose",this.onmsc),t.src=window.URL.createObjectURL(r),this._objectUrl=t.src}}},{key:"onMediaDetaching",value:function(){l.logger.log("media source detaching");var e=this.mediaSource;if(e){if("open"===e.readyState)try{e.endOfStream()}catch(t){l.logger.warn("onMediaDetaching:"+t.message+" while calling endOfStream")}e.removeEventListener("sourceopen",this.onmso),e.removeEventListener("sourceended",this.onmse),e.removeEventListener("sourceclose",this.onmsc),this.media&&(window.URL.revokeObjectURL(this._objectUrl),this.media.src===this._objectUrl?(this.media.removeAttribute("src"),this.media.load()):l.logger.warn("media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.pendingTracks={},this.tracks={},this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}this.onmso=this.onmse=this.onmsc=null,this.hls.trigger(a.default.MEDIA_DETACHED)}},{key:"onMediaSourceOpen",value:function(){l.logger.log("media source opened"),this.hls.trigger(a.default.MEDIA_ATTACHED,{media:this.media});var e=this.mediaSource;e&&e.removeEventListener("sourceopen",this.onmso),this.checkPendingTracks()}},{key:"checkPendingTracks",value:function(){var e=this.bufferCodecEventsExpected,t=this.pendingTracks,r=Object.keys(t).length;(r&&!e||2===r)&&(this.createSourceBuffers(t),this.pendingTracks={},this.doAppending())}},{key:"onMediaSourceClose",value:function(){l.logger.log("media source closed")}},{key:"onMediaSourceEnded",value:function(){l.logger.log("media source ended")}},{key:"onSBUpdateEnd",value:function(){if(this.audioTimestampOffset){var e=this.sourceBuffer.audio;l.logger.warn("change mpeg audio timestamp offset from "+e.timestampOffset+" to "+this.audioTimestampOffset),e.timestampOffset=this.audioTimestampOffset,delete this.audioTimestampOffset}this._needsFlush&&this.doFlush(),this._needsEos&&this.checkEos(),this.appending=!1;var t=this.parent,r=this.segments.reduce((function(e,r){return r.parent===t?e+1:e}),0),n={},i=this.sourceBuffer;for(var o in i)n[o]=i[o].buffered;if(!1===this._paused&&n["video"]&&n["video"].length>0&&n["audio"]&&n["audio"].length>0)if(n["video"].end(0)-n["video"].start(0)>1&&n["audio"].end(0)-n["audio"].start(0)>1){var s=Math.max(n["video"].start(0),n["audio"].start(0));this.media.currentTime=s,this.media.play(),delete this["_paused"]}else{var u=Math.max(n["video"].end(0),n["audio"].end(0));this.media.currentTime=u,this.media.play()}this.hls.trigger(a.default.BUFFER_APPENDED,{parent:t,pending:r,timeRanges:n}),this._needsFlush||this.doAppending(),this.updateMediaElementDuration(),0===r&&this.flushLiveBackBuffer()}},{key:"onSBUpdateError",value:function(e){l.logger.error("sourceBuffer error:",e),this.hls.trigger(a.default.ERROR,{type:u.ErrorTypes.MEDIA_ERROR,details:u.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})}},{key:"onBufferReset",value:function(){var e=this.sourceBuffer;for(var t in e){var r=e[t];try{this.mediaSource.removeSourceBuffer(r),r.removeEventListener("updateend",this.onsbue),r.removeEventListener("error",this.onsbe)}catch(n){}}this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}},{key:"onBufferCodecs",value:function(e){var t=this;Object.keys(e).forEach((function(r){t.pendingTracks[r]=e[r]}));var r=this.mediaSource;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),r&&"open"===r.readyState&&this.checkPendingTracks()}},{key:"createSourceBuffers",value:function(e){var t=this.sourceBuffer,r=this.mediaSource;for(var n in e)if(!t[n]){var i=e[n],o=i.levelCodec||i.codec,s=i.container+";codecs="+o;l.logger.log("creating sourceBuffer("+s+")");try{var c=t[n]=r.addSourceBuffer(s);c.addEventListener("updateend",this.onsbue),c.addEventListener("error",this.onsbe),this.tracks[n]={codec:o,container:i.container},i.buffer=c}catch(h){if(22==h.code){l.logger.log("Found new track, try to rebuild"),this._paused=!1;var d=this.mediaSource=new g;this.onmso=this.onMediaSourceOpen.bind(this),this.onmse=this.onMediaSourceEnded.bind(this),this.onmsc=this.onMediaSourceClose.bind(this);for(var f=0;f<Object.keys(this.tracks).length;f++){var p=this.tracks[Object.keys(this.tracks)[f]];this.pendingTracks[Object.keys(this.tracks)[f]]=p}this.tracks={},this.sourceBuffer={},d.addEventListener("sourceopen",this.onmso),d.addEventListener("sourceended",this.onmse),d.addEventListener("sourceclose",this.onmsc),this.media.src=window.URL.createObjectURL(d),this._objectUrl=media.src}else l.logger.error("error while trying to add sourceBuffer:"+h.message),this.hls.trigger(a.default.ERROR,{type:u.ErrorTypes.MEDIA_ERROR,details:u.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,err:h,mimeType:s})}}this.hls.trigger(a.default.BUFFER_CREATED,{tracks:e})}},{key:"onBufferAppending",value:function(e){this._needsFlush||(this.segments?this.segments.push(e):this.segments=[e],this.doAppending())}},{key:"onBufferAppendFail",value:function(e){l.logger.error("sourceBuffer error:",e.event),this.hls.trigger(a.default.ERROR,{type:u.ErrorTypes.MEDIA_ERROR,details:u.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})}},{key:"onBufferEos",value:function(e){var t=this.sourceBuffer,r=e.type;for(var n in t)r&&n!==r||t[n].ended||(t[n].ended=!0,l.logger.log(n+" sourceBuffer now EOS"));this.checkEos()}},{key:"checkEos",value:function(){var e=this.sourceBuffer,t=this.mediaSource;if(t&&"open"===t.readyState){for(var r in e){var n=e[r];if(!n.ended)return;if(n.updating)return void(this._needsEos=!0)}l.logger.log("all media data are available, signal endOfStream() to MediaSource and stop loading fragment");try{t.endOfStream()}catch(i){l.logger.warn("exception while calling mediaSource.endOfStream()")}this._needsEos=!1}else this._needsEos=!1}},{key:"onBufferFlushing",value:function(e){this.flushRange.push({start:e.startOffset,end:e.endOffset,type:e.type}),this.flushBufferCounter=0,this.doFlush()}},{key:"flushLiveBackBuffer",value:function(){if(this._live){var e=this.hls.config.liveBackBufferLength;if(isFinite(e)&&!(e<0))for(var t=this.media.currentTime,r=this.sourceBuffer,n=Object.keys(r),i=t-Math.max(e,this._levelTargetDuration),a=n.length-1;a>=0;a--){var o=n[a],s=r[o].buffered;s.length>0&&i>s.start(0)&&this.removeBufferRange(o,r[o],0,i)}}}},{key:"onLevelUpdated",value:function(e){var t=e.details;t.fragments.length>0&&(this._levelDuration=t.totalduration+t.fragments[0].start,this._levelTargetDuration=t.averagetargetduration||t.targetduration||10,this._live=t.live,this.updateMediaElementDuration())}},{key:"updateMediaElementDuration",value:function(){var e=this.hls.config,t=void 0;if(null!==this._levelDuration&&this.media&&this.mediaSource&&this.sourceBuffer&&0!==this.media.readyState&&"open"===this.mediaSource.readyState){for(var r in this.sourceBuffer)if(!0===this.sourceBuffer[r].updating)return;t=this.media.duration,null===this._msDuration&&(this._msDuration=this.mediaSource.duration),!0===this._live&&!0===e.liveDurationInfinity?(l.logger.log("Media Source duration is set to Infinity"),this._msDuration=this.mediaSource.duration=1/0):(this._levelDuration>this._msDuration&&this._levelDuration>t||!Number.isFinite(t))&&(l.logger.log("Updating Media Source duration to "+this._levelDuration.toFixed(3)),this._msDuration=this.mediaSource.duration=this._levelDuration)}}},{key:"doFlush",value:function(){while(this.flushRange.length){var e=this.flushRange[0];if(!this.flushBuffer(e.start,e.end,e.type))return void(this._needsFlush=!0);this.flushRange.shift(),this.flushBufferCounter=0}if(0===this.flushRange.length){this._needsFlush=!1;var t=0,r=this.sourceBuffer;try{for(var n in r)t+=r[n].buffered.length}catch(i){l.logger.error("error while accessing sourceBuffer.buffered")}this.appended=t,this.hls.trigger(a.default.BUFFER_FLUSHED)}}},{key:"doAppending",value:function(){var e=this.hls,t=this.segments,r=this.sourceBuffer;if(Object.keys(r).length){if(this.media.error)return this.segments=[],void l.logger.error("trying to append although a media error occured, flush segment and abort");if(this.appending)return;if(t&&t.length){var n=t.shift();try{var i=n.type,o=r[i];o?o.updating?t.unshift(n):(o.ended=!1,this.parent=n.parent,o.appendBuffer(n.data),this.appendError=0,this.appended++,this.appending=!0):this.onSBUpdateEnd()}catch(c){l.logger.error("error while trying to append buffer:"+c.message),t.unshift(n);var s={type:u.ErrorTypes.MEDIA_ERROR,parent:n.parent};22!==c.code?(this.appendError?this.appendError++:this.appendError=1,s.details=u.ErrorDetails.BUFFER_APPEND_ERROR,this.appendError>e.config.appendErrorMaxRetry?(l.logger.log("fail "+e.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),this.segments=[],s.fatal=!0,e.trigger(a.default.ERROR,s)):(s.fatal=!1,e.trigger(a.default.ERROR,s))):(this.segments=[],s.details=u.ErrorDetails.BUFFER_FULL_ERROR,s.fatal=!1,e.trigger(a.default.ERROR,s))}}}}},{key:"flushBuffer",value:function(e,t,r){var n=void 0,i=this.sourceBuffer;if(Object.keys(i).length){if(l.logger.log("flushBuffer,pos/start/end: "+this.media.currentTime.toFixed(3)+"/"+e+"/"+t),this.flushBufferCounter<this.appended){for(var a in i)if(!r||a===r){if(n=i[a],n.ended=!1,n.updating)return l.logger.warn("cannot flush, sb updating in progress"),!1;if(this.removeBufferRange(a,n,e,t))return this.flushBufferCounter++,!1}}else l.logger.warn("abort flushing too many retries");l.logger.log("buffer flushed")}return!0}},{key:"removeBufferRange",value:function(e,t,r,n){try{for(var i=0;i<t.buffered.length;i++){var a=t.buffered.start(i),o=t.buffered.end(i),s=Math.max(a,r),u=Math.min(o,n);if(Math.min(u,o)-s>.5)return l.logger.log("sb remove "+e+" ["+s+","+u+"], of ["+a+","+o+"], pos:"+this.media.currentTime),t.remove(s,u),!0}}catch(c){l.logger.warn("removeBufferRange failed",c)}return!1}}]),t}(s.default);t.default=y,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(1),a=l(i),o=r(3),s=l(o);function l(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function d(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var f=function(e){function t(e){u(this,t);var r=c(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,a.default.FPS_DROP_LEVEL_CAPPING,a.default.MEDIA_ATTACHING,a.default.MANIFEST_PARSED,a.default.BUFFER_CODECS,a.default.MEDIA_DETACHING));return r.autoLevelCapping=Number.POSITIVE_INFINITY,r.firstLevel=null,r.levels=[],r.media=null,r.restrictedLevels=[],r.timer=null,r}return d(t,e),n(t,[{key:"destroy",value:function(){this.hls.config.capLevelToPlayerSize&&(this.media=null,this._stopCapping())}},{key:"onFpsDropLevelCapping",value:function(e){t.isLevelAllowed(e.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(e.droppedLevel)}},{key:"onMediaAttaching",value:function(e){this.media=e.media instanceof window.HTMLVideoElement?e.media:null}},{key:"onManifestParsed",value:function(e){var t=this.hls;this.restrictedLevels=[],this.levels=e.levels,this.firstLevel=e.firstLevel,t.config.capLevelToPlayerSize&&e.video&&this._startCapping()}},{key:"onBufferCodecs",value:function(e){var t=this.hls;t.config.capLevelToPlayerSize&&e.video&&this._startCapping()}},{key:"onLevelsUpdated",value:function(e){this.levels=e.levels}},{key:"onMediaDetaching",value:function(){this._stopCapping()}},{key:"detectPlayerSize",value:function(){if(this.media){var e=this.levels?this.levels.length:0;if(e){var t=this.hls;t.autoLevelCapping=this.getMaxLevel(e-1),t.autoLevelCapping>this.autoLevelCapping&&t.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}},{key:"getMaxLevel",value:function(e){var r=this;if(!this.levels)return-1;var n=this.levels.filter((function(n,i){return t.isLevelAllowed(i,r.restrictedLevels)&&i<=e}));return t.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)}},{key:"_startCapping",value:function(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),clearInterval(this.timer),this.timer=setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}},{key:"_stopCapping",value:function(){this.restrictedLevels=[],this.firstLevel=null,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(this.timer=clearInterval(this.timer),this.timer=null)}},{key:"mediaWidth",get:function(){var e=void 0,r=this.media;return r&&(e=r.width||r.clientWidth||r.offsetWidth,e*=t.contentScaleFactor),e}},{key:"mediaHeight",get:function(){var e=void 0,r=this.media;return r&&(e=r.height||r.clientHeight||r.offsetHeight,e*=t.contentScaleFactor),e}}],[{key:"isLevelAllowed",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return-1===t.indexOf(e)}},{key:"getMaxLevelByMediaSize",value:function(e,t,r){if(!e||e&&!e.length)return-1;for(var n=function(e,t){return!t||(e.width!==t.width||e.height!==t.height)},i=e.length-1,a=0;a<e.length;a+=1){var o=e[a];if((o.width>=t||o.height>=r)&&n(o,e[a+1])){i=a;break}}return i}},{key:"contentScaleFactor",get:function(){var e=1;try{e=window.devicePixelRatio}catch(t){}return e}}]),t}(s.default);t.default=f,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(1),a=u(i),o=r(3),s=u(o),l=r(0);function u(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function f(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var p=window,h=p.performance,g=function(e){function t(e){return c(this,t),d(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,a.default.MEDIA_ATTACHING))}return f(t,e),n(t,[{key:"destroy",value:function(){this.timer&&clearInterval(this.timer),this.isVideoPlaybackQualityAvailable=!1}},{key:"onMediaAttaching",value:function(e){var t=this.hls.config;if(t.capLevelOnFPSDrop){var r=this.video=e.media instanceof window.HTMLVideoElement?e.media:null;"function"===typeof r.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),clearInterval(this.timer),this.timer=setInterval(this.checkFPSInterval.bind(this),t.fpsDroppedMonitoringPeriod)}}},{key:"checkFPS",value:function(e,t,r){var n=h.now();if(t){if(this.lastTime){var i=n-this.lastTime,o=r-this.lastDroppedFrames,s=t-this.lastDecodedFrames,u=1e3*o/i,c=this.hls;if(c.trigger(a.default.FPS_DROP,{currentDropped:o,currentDecoded:s,totalDroppedFrames:r}),u>0&&o>c.config.fpsDroppedMonitoringThreshold*s){var d=c.currentLevel;l.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+d),d>0&&(-1===c.autoLevelCapping||c.autoLevelCapping>=d)&&(d-=1,c.trigger(a.default.FPS_DROP_LEVEL_CAPPING,{level:d,droppedLevel:c.currentLevel}),c.autoLevelCapping=d,c.streamController.nextLevelSwitch())}}this.lastTime=n,this.lastDroppedFrames=r,this.lastDecodedFrames=t}}},{key:"checkFPSInterval",value:function(){var e=this.video;if(e)if(this.isVideoPlaybackQualityAvailable){var t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}]),t}(s.default);t.default=g,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=window,s=o.performance,l=o.XMLHttpRequest,u=function(){function e(t){a(this,e),t&&t.xhrSetup&&(this.xhrSetup=t.xhrSetup)}return n(e,[{key:"destroy",value:function(){this.abort(),this.loader=null}},{key:"abort",value:function(){var e=this.loader;e&&4!==e.readyState&&(this.stats.aborted=!0,e.abort()),window.clearTimeout(this.requestTimeout),this.requestTimeout=null,window.clearTimeout(this.retryTimeout),this.retryTimeout=null}},{key:"load",value:function(e,t,r){this.context=e,this.config=t,this.callbacks=r,this.stats={trequest:s.now(),retry:0},this.retryDelay=t.retryDelay,this.loadInternal()}},{key:"loadInternal",value:function(){var e=void 0,t=this.context;e=this.loader=new l;var r=this.stats;r.tfirst=0,r.loaded=0;var n=this.xhrSetup;try{if(n)try{n(e,t.url)}catch(i){e.open("GET",t.url,!0),n(e,t.url)}e.readyState||e.open("GET",t.url,!0)}catch(i){return void this.callbacks.onError({code:e.status,text:i.message},t,e)}t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),this.config.timeout),e.send()}},{key:"readystatechange",value:function(e){var t=e.currentTarget,r=t.readyState,n=this.stats,a=this.context,o=this.config;if(!n.aborted&&r>=2)if(window.clearTimeout(this.requestTimeout),0===n.tfirst&&(n.tfirst=Math.max(s.now(),n.trequest)),4===r){var l=t.status;if(l>=200&&l<300){n.tload=Math.max(n.tfirst,s.now());var u=void 0,c=void 0;"arraybuffer"===a.responseType?(u=t.response,c=u.byteLength):(u=t.responseText,c=u.length),n.loaded=n.total=c;var d={url:t.responseURL,data:u};this.callbacks.onSuccess(d,n,a,t)}else n.retry>=o.maxRetry||l>=400&&l<499?(i.logger.error(l+" while loading "+a.url),this.callbacks.onError({code:l,text:t.statusText},a,t)):(i.logger.warn(l+" while loading "+a.url+", retrying in "+this.retryDelay+"..."),this.destroy(),this.retryTimeout=window.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,o.maxRetryDelay),n.retry++)}else this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),o.timeout)}},{key:"loadtimeout",value:function(){i.logger.warn("timeout while loading "+this.context.url),this.callbacks.onTimeout(this.stats,this.context,null)}},{key:"loadprogress",value:function(e){var t=e.currentTarget,r=this.stats;r.loaded=e.loaded,e.lengthComputable&&(r.total=e.total);var n=this.callbacks.onProgress;n&&n(r,this.context,null,t)}}]),e}();t.default=u,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(1),a=c(i),o=r(28),s=c(o),l=r(0),u=r(2);function c(e){return e&&e.__esModule?e:{default:e}}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function p(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var h=function(e){function t(e){d(this,t);var r=f(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,a.default.MANIFEST_LOADING,a.default.MANIFEST_PARSED,a.default.AUDIO_TRACK_LOADED,a.default.AUDIO_TRACK_SWITCHED,a.default.LEVEL_LOADED,a.default.ERROR));return r._trackId=-1,r._selectDefaultTrack=!0,r.tracks=[],r.trackIdBlacklist=Object.create(null),r.audioGroupId=null,r}return p(t,e),n(t,[{key:"onManifestLoading",value:function(){this.tracks=[],this._trackId=-1,this._selectDefaultTrack=!0}},{key:"onManifestParsed",value:function(e){var t=this.tracks=e.audioTracks||[];this.hls.trigger(a.default.AUDIO_TRACKS_UPDATED,{audioTracks:t})}},{key:"onAudioTrackLoaded",value:function(e){if(e.id>=this.tracks.length)l.logger.warn("Invalid audio track id:",e.id);else{if(l.logger.log("audioTrack "+e.id+" loaded"),this.tracks[e.id].details=e.details,e.details.live&&!this.hasInterval()){var t=1e3*e.details.targetduration;this.setInterval(t)}!e.details.live&&this.hasInterval()&&this.clearInterval()}}},{key:"onAudioTrackSwitched",value:function(e){var t=this.tracks[e.id].groupId;t&&this.audioGroupId!==t&&(this.audioGroupId=t)}},{key:"onLevelLoaded",value:function(e){var t=this.hls.levels[e.level];if(t.audioGroupIds){var r=t.audioGroupIds[t.urlId];this.audioGroupId!==r&&(this.audioGroupId=r,this._selectInitialAudioTrack())}}},{key:"onError",value:function(e){e.type===u.ErrorTypes.NETWORK_ERROR&&(e.fatal&&this.clearInterval(),e.details===u.ErrorDetails.AUDIO_TRACK_LOAD_ERROR&&(l.logger.warn("Network failure on audio-track id:",e.context.id),this._handleLoadError()))}},{key:"_setAudioTrack",value:function(e){if(this._trackId===e&&this.tracks[this._trackId].details)l.logger.debug("Same id as current audio-track passed, and track details available -> no-op");else if(e<0||e>=this.tracks.length)l.logger.warn("Invalid id passed to audio-track controller");else{var t=this.tracks[e];l.logger.log("Now switching to audio-track index "+e),this.clearInterval(),this._trackId=e;var r=t.url,n=t.type,i=t.id;this.hls.trigger(a.default.AUDIO_TRACK_SWITCHING,{id:i,type:n,url:r}),this._loadTrackDetailsIfNeeded(t)}}},{key:"doTick",value:function(){this._updateTrack(this._trackId)}},{key:"_selectInitialAudioTrack",value:function(){var e=this,t=this.tracks;if(t.length){var r=this.tracks[this._trackId],n=null;if(r&&(n=r.name),this._selectDefaultTrack){var i=t.filter((function(e){return e.default}));i.length?t=i:l.logger.warn("No default audio tracks defined")}var o=!1,s=function(){t.forEach((function(t){o||e.audioGroupId&&t.groupId!==e.audioGroupId||n&&n!==t.name||(e._setAudioTrack(t.id),o=!0)}))};s(),o||(n=null,s()),o||(l.logger.error("No track found for running audio group-ID: "+this.audioGroupId),this.hls.trigger(a.default.ERROR,{type:u.ErrorTypes.MEDIA_ERROR,details:u.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))}}},{key:"_needsTrackLoading",value:function(e){var t=e.details,r=e.url;return!(t&&!t.live)&&!!r}},{key:"_loadTrackDetailsIfNeeded",value:function(e){if(this._needsTrackLoading(e)){var t=e.url,r=e.id;l.logger.log("loading audio-track playlist for id: "+r),this.hls.trigger(a.default.AUDIO_TRACK_LOADING,{url:t,id:r})}}},{key:"_updateTrack",value:function(e){if(!(e<0||e>=this.tracks.length)){this.clearInterval(),this._trackId=e,l.logger.log("trying to update audio-track "+e);var t=this.tracks[e];this._loadTrackDetailsIfNeeded(t)}}},{key:"_handleLoadError",value:function(){this.trackIdBlacklist[this._trackId]=!0;var e=this._trackId,t=this.tracks[e],r=t.name,n=t.language,i=t.groupId;l.logger.warn("Loading failed on audio track id: "+e+", group-id: "+i+', name/language: "'+r+'" / "'+n+'"');for(var a=e,o=0;o<this.tracks.length;o++)if(!this.trackIdBlacklist[o]){var s=this.tracks[o];if(s.name===r){a=o;break}}a!==e?(l.logger.log("Attempting audio-track fallback id:",a,"group-id:",this.tracks[a].groupId),this._setAudioTrack(a)):l.logger.warn('No fallback audio-track found for name/language: "'+r+'" / "'+n+'"')}},{key:"audioTracks",get:function(){return this.tracks}},{key:"audioTrack",get:function(){return this._trackId},set:function(e){this._setAudioTrack(e),this._selectDefaultTrack=!1}}]),t}(s.default);t.default=h,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(9),a=E(i),o=r(4),s=r(19),l=E(s),u=r(1),c=E(u),d=r(7),f=w(d),p=r(25),h=E(p),g=r(2),y=r(0),v=r(26),m=r(6),x=r(11),b=E(x),k=r(14),_=E(k);function w(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function E(e){return e&&e.__esModule?e:{default:e}}function T(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function S(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function O(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var R=window,A=R.performance,P=100,L=function(e){function t(e,r){T(this,t);var n=S(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,c.default.MEDIA_ATTACHED,c.default.MEDIA_DETACHING,c.default.AUDIO_TRACKS_UPDATED,c.default.AUDIO_TRACK_SWITCHING,c.default.AUDIO_TRACK_LOADED,c.default.KEY_LOADED,c.default.FRAG_LOADED,c.default.FRAG_PARSING_INIT_SEGMENT,c.default.FRAG_PARSING_DATA,c.default.FRAG_PARSED,c.default.ERROR,c.default.BUFFER_RESET,c.default.BUFFER_CREATED,c.default.BUFFER_APPENDED,c.default.BUFFER_FLUSHED,c.default.INIT_PTS_FOUND));return n.fragmentTracker=r,n.config=e.config,n.audioCodecSwap=!1,n._state=k.State.STOPPED,n.initPTS=[],n.waitingFragment=null,n.videoTrackCC=null,n}return O(t,e),n(t,[{key:"onInitPtsFound",value:function(e){var t=e.id,r=e.frag.cc,n=e.initPTS;"main"===t&&(this.initPTS[r]=n,this.videoTrackCC=r,y.logger.log("InitPTS for cc: "+r+" found from video track: "+n),this.state===k.State.WAITING_INIT_PTS&&this.tick())}},{key:"startLoad",value:function(e){if(this.tracks){var t=this.lastCurrentTime;this.stopLoad(),this.setInterval(P),this.fragLoadError=0,t>0&&-1===e?(y.logger.log("audio:override startPosition with lastCurrentTime @"+t.toFixed(3)),this.state=k.State.IDLE):(this.lastCurrentTime=this.startPosition?this.startPosition:e,this.state=k.State.STARTING),this.nextLoadPosition=this.startPosition=this.lastCurrentTime,this.tick()}else this.startPosition=e,this.state=k.State.STOPPED}},{key:"doTick",value:function(){var e=void 0,t=void 0,r=void 0,n=this.hls,i=n.config;switch(this.state){case k.State.ERROR:case k.State.PAUSED:case k.State.BUFFER_FLUSHING:break;case k.State.STARTING:this.state=k.State.WAITING_TRACK,this.loadedmetadata=!1;break;case k.State.IDLE:var s=this.tracks;if(!s)break;if(!this.media&&(this.startFragRequested||!i.startFragPrefetch))break;if(this.loadedmetadata)e=this.media.currentTime;else if(e=this.nextLoadPosition,void 0===e)break;var l=this.mediaBuffer?this.mediaBuffer:this.media,u=this.videoBuffer?this.videoBuffer:this.media,d=o.BufferHelper.bufferInfo(l,e,i.maxBufferHole),f=o.BufferHelper.bufferInfo(u,e,i.maxBufferHole),p=d.len,h=d.end,g=this.fragPrevious,x=Math.min(i.maxBufferLength,i.maxMaxBufferLength),b=Math.max(x,f.len),_=this.audioSwitch,w=this.trackId;if((p<b||_)&&w<s.length){if(r=s[w].details,"undefined"===typeof r){this.state=k.State.WAITING_TRACK;break}if(!_&&this._streamEnded(d,r))return this.hls.trigger(c.default.BUFFER_EOS,{type:"audio"}),void(this.state=k.State.ENDED);var E=r.fragments,T=E.length,S=E[0].start,O=E[T-1].start+E[T-1].duration,R=void 0;if(_)if(r.live&&!r.PTSKnown)y.logger.log("switching audiotrack, live stream, unknown PTS,load first fragment"),h=0;else if(h=e,r.PTSKnown&&e<S){if(!(d.end>S||d.nextStart))return;y.logger.log("alt audio track ahead of main track, seek to start of alt audio track"),this.media.currentTime=S+.05}if(r.initSegment&&!r.initSegment.data)R=r.initSegment;else if(h<=S){if(R=E[0],null!==this.videoTrackCC&&R.cc!==this.videoTrackCC&&(R=(0,v.findFragWithCC)(E,this.videoTrackCC)),r.live&&R.loadIdx&&R.loadIdx===this.fragLoadIdx){var P=d.nextStart?d.nextStart:S;return y.logger.log("no alt audio available @currentTime:"+this.media.currentTime+", seeking @"+(P+.05)),void(this.media.currentTime=P+.05)}}else{var L=void 0,C=i.maxFragLookUpTolerance,D=g?E[g.sn-E[0].sn+1]:void 0,I=function(e){var t=Math.min(C,e.duration);return e.start+e.duration-t<=h?1:e.start-t>h&&e.start?-1:0};h<O?(h>O-C&&(C=0),L=D&&!I(D)?D:a.default.search(E,I)):L=E[T-1],L&&(R=L,S=L.start,g&&R.level===g.level&&R.sn===g.sn&&(R.sn<r.endSN?(R=E[R.sn+1-r.startSN],y.logger.log("SN just loaded, load next one: "+R.sn)):R=null))}R&&(R.encrypted?(y.logger.log("Loading key for "+R.sn+" of ["+r.startSN+" ,"+r.endSN+"],track "+w),this.state=k.State.KEY_LOADING,n.trigger(c.default.KEY_LOADING,{frag:R})):(y.logger.log("Loading "+R.sn+", cc: "+R.cc+" of ["+r.startSN+" ,"+r.endSN+"],track "+w+", currentTime:"+e+",bufferEnd:"+h.toFixed(3)),this.fragCurrent=R,(_||this.fragmentTracker.getState(R)===m.FragmentState.NOT_LOADED)&&(this.startFragRequested=!0,Number.isFinite(R.sn)&&(this.nextLoadPosition=R.start+R.duration),n.trigger(c.default.FRAG_LOADING,{frag:R}),this.state=k.State.FRAG_LOADING)))}break;case k.State.WAITING_TRACK:t=this.tracks[this.trackId],t&&t.details&&(this.state=k.State.IDLE);break;case k.State.FRAG_LOADING_WAITING_RETRY:var M=A.now(),F=this.retryDate;l=this.media;var N=l&&l.seeking;(!F||M>=F||N)&&(y.logger.log("audioStreamController: retryDate reached, switch back to IDLE state"),this.state=k.State.IDLE);break;case k.State.WAITING_INIT_PTS:var B=this.videoTrackCC;if(void 0===this.initPTS[B])break;var j=this.waitingFragment;if(j){var U=j.frag.cc;B!==U?(t=this.tracks[this.trackId],t.details&&t.details.live&&(y.logger.warn("Waiting fragment CC ("+U+") does not match video track CC ("+B+")"),this.waitingFragment=null,this.state=k.State.IDLE)):(this.state=k.State.FRAG_LOADING,this.onFragLoaded(this.waitingFragment),this.waitingFragment=null)}else this.state=k.State.IDLE;break;case k.State.STOPPED:case k.State.FRAG_LOADING:case k.State.PARSING:case k.State.PARSED:case k.State.ENDED:break;default:break}}},{key:"onMediaAttached",value:function(e){var t=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),t.addEventListener("seeking",this.onvseeking),t.addEventListener("ended",this.onvended);var r=this.config;this.tracks&&r.autoStartLoad&&this.startLoad(r.startPosition)}},{key:"onMediaDetaching",value:function(){var e=this.media;e&&e.ended&&(y.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),e&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1,this.stopLoad()}},{key:"onAudioTracksUpdated",value:function(e){y.logger.log("audio tracks updated"),this.tracks=e.audioTracks}},{key:"onAudioTrackSwitching",value:function(e){var t=!!e.url;this.trackId=e.id,this.fragCurrent=null,this.state=k.State.PAUSED,this.waitingFragment=null,t?this.setInterval(P):this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),t&&(this.audioSwitch=!0,this.state=k.State.IDLE),this.tick()}},{key:"onAudioTrackLoaded",value:function(e){var t=e.details,r=e.id,n=this.tracks[r],i=t.totalduration,a=0;if(y.logger.log("track "+r+" loaded ["+t.startSN+","+t.endSN+"],duration:"+i),t.live){var o=n.details;o&&t.fragments.length>0?(f.mergeDetails(o,t),a=t.fragments[0].start,t.PTSKnown?y.logger.log("live audio playlist sliding:"+a.toFixed(3)):y.logger.log("live audio playlist - outdated PTS, unknown sliding")):(t.PTSKnown=!1,y.logger.log("live audio playlist - first load, unknown sliding"))}else t.PTSKnown=!1;if(n.details=t,!this.startFragRequested){if(-1===this.startPosition){var s=t.startTimeOffset;Number.isFinite(s)?(y.logger.log("start time offset found in playlist, adjust startPosition to "+s),this.startPosition=s):this.startPosition=0}this.nextLoadPosition=this.startPosition}this.state===k.State.WAITING_TRACK&&(this.state=k.State.IDLE),this.tick()}},{key:"onKeyLoaded",value:function(){this.state===k.State.KEY_LOADING&&(this.state=k.State.IDLE,this.tick())}},{key:"onFragLoaded",value:function(e){var t=this.fragCurrent,r=e.frag;if(this.state===k.State.FRAG_LOADING&&t&&"audio"===r.type&&r.level===t.level&&r.sn===t.sn){var n=this.tracks[this.trackId],i=n.details,a=i.totalduration,o=t.level,s=t.sn,u=t.cc,d=this.config.defaultAudioCodec||n.audioCodec||"mp4a.40.2",f=this.stats=e.stats;if("initSegment"===s)this.state=k.State.IDLE,f.tparsed=f.tbuffered=A.now(),i.initSegment.data=e.payload,this.hls.trigger(c.default.FRAG_BUFFERED,{stats:f,frag:t,id:"audio"}),this.tick();else{this.state=k.State.PARSING,this.appended=!1,this.demuxer||(this.demuxer=new l.default(this.hls,"audio"));var p=this.initPTS[u],h=i.initSegment?i.initSegment.data:[];if(i.initSegment||void 0!==p){this.pendingBuffering=!0,y.logger.log("Demuxing "+s+" of ["+i.startSN+" ,"+i.endSN+"],track "+o);var g=!1;this.demuxer.push(e.payload,h,d,null,t,a,g,p)}else y.logger.log("unknown video PTS for continuity counter "+u+", waiting for video PTS before demuxing audio frag "+s+" of ["+i.startSN+" ,"+i.endSN+"],track "+o),this.waitingFragment=e,this.state=k.State.WAITING_INIT_PTS}}this.fragLoadError=0}},{key:"onFragParsingInitSegment",value:function(e){var t=this.fragCurrent,r=e.frag;if(t&&"audio"===e.id&&r.sn===t.sn&&r.level===t.level&&this.state===k.State.PARSING){var n=e.tracks,i=void 0;if(n.video&&delete n.video,i=n.audio,i){i.levelCodec=i.codec,i.id=e.id,this.hls.trigger(c.default.BUFFER_CODECS,n),y.logger.log("audio track:audio,container:"+i.container+",codecs[level/parsed]=["+i.levelCodec+"/"+i.codec+"]");var a=i.initSegment;if(a){var o={type:"audio",data:a,parent:"audio",content:"initSegment"};this.audioSwitch?this.pendingData=[o]:(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(c.default.BUFFER_APPENDING,o))}this.tick()}}}},{key:"onFragParsingData",value:function(e){var t=this,r=this.fragCurrent,n=e.frag;if(r&&"audio"===e.id&&"audio"===e.type&&n.sn===r.sn&&n.level===r.level&&this.state===k.State.PARSING){var i=this.trackId,a=this.tracks[i],o=this.hls;Number.isFinite(e.endPTS)||(e.endPTS=e.startPTS+r.duration,e.endDTS=e.startDTS+r.duration),r.addElementaryStream(b.default.ElementaryStreamTypes.AUDIO),y.logger.log("parsed "+e.type+",PTS:["+e.startPTS.toFixed(3)+","+e.endPTS.toFixed(3)+"],DTS:["+e.startDTS.toFixed(3)+"/"+e.endDTS.toFixed(3)+"],nb:"+e.nb),f.updateFragPTSDTS(a.details,r,e.startPTS,e.endPTS);var s=this.audioSwitch,l=this.media,u=!1;if(s&&l)if(l.readyState){var d=l.currentTime;y.logger.log("switching audio track : currentTime:"+d),d>=e.startPTS&&(y.logger.log("switching audio track : flushing all audio"),this.state=k.State.BUFFER_FLUSHING,o.trigger(c.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),u=!0,this.audioSwitch=!1,o.trigger(c.default.AUDIO_TRACK_SWITCHED,{id:i}))}else this.audioSwitch=!1,o.trigger(c.default.AUDIO_TRACK_SWITCHED,{id:i});var p=this.pendingData;if(!p)return y.logger.warn("Apparently attempt to enqueue media payload without codec initialization data upfront"),void o.trigger(c.default.ERROR,{type:g.ErrorTypes.MEDIA_ERROR,details:null,fatal:!0});this.audioSwitch||([e.data1,e.data2].forEach((function(t){t&&t.length&&p.push({type:e.type,data:t,parent:"audio",content:"data"})})),!u&&p.length&&(p.forEach((function(e){t.state===k.State.PARSING&&(t.pendingBuffering=!0,t.hls.trigger(c.default.BUFFER_APPENDING,e))})),this.pendingData=[],this.appended=!0)),this.tick()}}},{key:"onFragParsed",value:function(e){var t=this.fragCurrent,r=e.frag;t&&"audio"===e.id&&r.sn===t.sn&&r.level===t.level&&this.state===k.State.PARSING&&(this.stats.tparsed=A.now(),this.state=k.State.PARSED,this._checkAppendedParsed())}},{key:"onBufferReset",value:function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1}},{key:"onBufferCreated",value:function(e){var t=e.tracks.audio;t&&(this.mediaBuffer=t.buffer,this.loadedmetadata=!0),e.tracks.video&&(this.videoBuffer=e.tracks.video.buffer)}},{key:"onBufferAppended",value:function(e){if("audio"===e.parent){var t=this.state;t!==k.State.PARSING&&t!==k.State.PARSED||(this.pendingBuffering=e.pending>0,this._checkAppendedParsed())}}},{key:"_checkAppendedParsed",value:function(){if(this.state===k.State.PARSED&&(!this.appended||!this.pendingBuffering)){var e=this.fragCurrent,t=this.stats,r=this.hls;if(e){this.fragPrevious=e,t.tbuffered=A.now(),r.trigger(c.default.FRAG_BUFFERED,{stats:t,frag:e,id:"audio"});var n=this.mediaBuffer?this.mediaBuffer:this.media;y.logger.log("audio buffered : "+h.default.toString(n.buffered)),this.audioSwitch&&this.appended&&(this.audioSwitch=!1,r.trigger(c.default.AUDIO_TRACK_SWITCHED,{id:this.trackId})),this.state=k.State.IDLE}this.tick()}}},{key:"onError",value:function(e){var t=e.frag;if(!t||"audio"===t.type)switch(e.details){case g.ErrorDetails.FRAG_LOAD_ERROR:case g.ErrorDetails.FRAG_LOAD_TIMEOUT:var r=e.frag;if(r&&"audio"!==r.type)break;if(!e.fatal){var n=this.fragLoadError;n?n++:n=1;var i=this.config;if(n<=i.fragLoadingMaxRetry){this.fragLoadError=n;var a=Math.min(Math.pow(2,n-1)*i.fragLoadingRetryDelay,i.fragLoadingMaxRetryTimeout);y.logger.warn("AudioStreamController: frag loading failed, retry in "+a+" ms"),this.retryDate=A.now()+a,this.state=k.State.FRAG_LOADING_WAITING_RETRY}else y.logger.error("AudioStreamController: "+e.details+" reaches max retry, redispatch as fatal ..."),e.fatal=!0,this.state=k.State.ERROR}break;case g.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case g.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:case g.ErrorDetails.KEY_LOAD_ERROR:case g.ErrorDetails.KEY_LOAD_TIMEOUT:this.state!==k.State.ERROR&&(this.state=e.fatal?k.State.ERROR:k.State.IDLE,y.logger.warn("AudioStreamController: "+e.details+" while loading frag, now switching to "+this.state+" state ..."));break;case g.ErrorDetails.BUFFER_FULL_ERROR:if("audio"===e.parent&&(this.state===k.State.PARSING||this.state===k.State.PARSED)){var s=this.mediaBuffer,l=this.media.currentTime,u=s&&o.BufferHelper.isBuffered(s,l)&&o.BufferHelper.isBuffered(s,l+.5);if(u){var d=this.config;d.maxMaxBufferLength>=d.maxBufferLength&&(d.maxMaxBufferLength/=2,y.logger.warn("AudioStreamController: reduce max buffer length to "+d.maxMaxBufferLength+"s")),this.state=k.State.IDLE}else y.logger.warn("AudioStreamController: buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,this.state=k.State.BUFFER_FLUSHING,this.hls.trigger(c.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"})}break;default:break}}},{key:"onBufferFlushed",value:function(){var e=this,t=this.pendingData;t&&t.length?(y.logger.log("AudioStreamController: appending pending audio data after buffer flushed"),t.forEach((function(t){e.hls.trigger(c.default.BUFFER_APPENDING,t)})),this.appended=!0,this.pendingData=[],this.state=k.State.PARSED):(this.state=k.State.IDLE,this.fragPrevious=null,this.tick())}},{key:"state",set:function(e){if(this.state!==e){var t=this.state;this._state=e,y.logger.log("audio stream:"+t+"->"+e)}},get:function(){return this._state}}]),t}(_.default);t.default=L,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.newCue=i;var n=r(30);function i(e,t,r,i){for(var a=void 0,o=void 0,s=void 0,l=void 0,u=void 0,c=window.VTTCue||window.TextTrackCue,d=0;d<i.rows.length;d++)if(a=i.rows[d],s=!0,l=0,u="",!a.isEmpty()){for(var f=0;f<a.chars.length;f++)a.chars[f].uchar.match(/\s/)&&s?l++:(u+=a.chars[f].uchar,s=!1);a.cueStartTime=t,t===r&&(r+=1e-4),o=new c(t,r,(0,n.fixLineBreaks)(u.trim())),l>=16?l--:l++,navigator.userAgent.match(/Firefox\//)?o.line=d+1:o.line=d>7?d-2:d+1,o.align="left",o.position=Math.max(0,Math.min(100,l/32*100+(navigator.userAgent.match(/Firefox\//)?50:0))),e.addCue(o)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){if("undefined"!==typeof window&&window.VTTCue)return window.VTTCue;var e="auto",t={"":!0,lr:!0,rl:!0},r={start:!0,middle:!0,end:!0,left:!0,right:!0};function n(e){if("string"!==typeof e)return!1;var r=t[e.toLowerCase()];return!!r&&e.toLowerCase()}function i(e){if("string"!==typeof e)return!1;var t=r[e.toLowerCase()];return!!t&&e.toLowerCase()}function a(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}function o(t,r,o){var s=this,l=function(){if("undefined"!==typeof navigator)return/MSIE\s8\.0/.test(navigator.userAgent)}(),u={};l?s=document.createElement("custom"):u.enumerable=!0,s.hasBeenReset=!1;var c="",d=!1,f=t,p=r,h=o,g=null,y="",v=!0,m="auto",x="start",b=50,k="middle",_=50,w="middle";if(Object.defineProperty(s,"id",a({},u,{get:function(){return c},set:function(e){c=""+e}})),Object.defineProperty(s,"pauseOnExit",a({},u,{get:function(){return d},set:function(e){d=!!e}})),Object.defineProperty(s,"startTime",a({},u,{get:function(){return f},set:function(e){if("number"!==typeof e)throw new TypeError("Start time must be set to a number.");f=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"endTime",a({},u,{get:function(){return p},set:function(e){if("number"!==typeof e)throw new TypeError("End time must be set to a number.");p=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"text",a({},u,{get:function(){return h},set:function(e){h=""+e,this.hasBeenReset=!0}})),Object.defineProperty(s,"region",a({},u,{get:function(){return g},set:function(e){g=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"vertical",a({},u,{get:function(){return y},set:function(e){var t=n(e);if(!1===t)throw new SyntaxError("An invalid or illegal string was specified.");y=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"snapToLines",a({},u,{get:function(){return v},set:function(e){v=!!e,this.hasBeenReset=!0}})),Object.defineProperty(s,"line",a({},u,{get:function(){return m},set:function(t){if("number"!==typeof t&&t!==e)throw new SyntaxError("An invalid number or illegal string was specified.");m=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"lineAlign",a({},u,{get:function(){return x},set:function(e){var t=i(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");x=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"position",a({},u,{get:function(){return b},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");b=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"positionAlign",a({},u,{get:function(){return k},set:function(e){var t=i(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");k=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"size",a({},u,{get:function(){return _},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");_=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"align",a({},u,{get:function(){return w},set:function(e){var t=i(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");w=t,this.hasBeenReset=!0}})),s.displayState=void 0,l)return s}return o.prototype.getCueAsHTML=function(){var e=window.WebVTT;return e.convertCueToDOMTree(window,this.text)},o}(),e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(1),a=y(i),o=r(3),s=y(o),l=r(73),u=y(l),c=r(74),d=y(c),f=r(75),p=y(f),h=r(0),g=r(29);function y(e){return e&&e.__esModule?e:{default:e}}function v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function x(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function b(e,t){return e&&e.label===t.name&&!(e.textTrack1||e.textTrack2)}function k(e,t,r,n){return Math.min(t,n)-Math.max(e,r)}var _=function(e){function t(e){v(this,t);var r=m(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,a.default.MEDIA_ATTACHING,a.default.MEDIA_DETACHING,a.default.FRAG_PARSING_USERDATA,a.default.FRAG_DECRYPTED,a.default.MANIFEST_LOADING,a.default.MANIFEST_LOADED,a.default.FRAG_LOADED,a.default.LEVEL_SWITCHING,a.default.INIT_PTS_FOUND));if(r.hls=e,r.config=e.config,r.enabled=!0,r.Cues=e.config.cueHandler,r.textTracks=[],r.tracks=[],r.unparsedVttFrags=[],r.initPTS=[],r.cueRanges=[],r.captionsTracks={},r.captionsProperties={textTrack1:{label:r.config.captionsTextTrack1Label,languageCode:r.config.captionsTextTrack1LanguageCode},textTrack2:{label:r.config.captionsTextTrack2Label,languageCode:r.config.captionsTextTrack2LanguageCode}},r.config.enableCEA708Captions){var n=new d.default(r,"textTrack1"),i=new d.default(r,"textTrack2");r.cea608Parser=new u.default(0,n,i)}return r}return x(t,e),n(t,[{key:"addCues",value:function(e,t,r,n){for(var i=this.cueRanges,a=!1,o=i.length;o--;){var s=i[o],l=k(s[0],s[1],t,r);if(l>=0&&(s[0]=Math.min(s[0],t),s[1]=Math.max(s[1],r),a=!0,l/(r-t)>.5))return}a||i.push([t,r]),this.Cues.newCue(this.captionsTracks[e],t,r,n)}},{key:"onInitPtsFound",value:function(e){var t=this;if("main"===e.id&&(this.initPTS[e.frag.cc]=e.initPTS),this.unparsedVttFrags.length){var r=this.unparsedVttFrags;this.unparsedVttFrags=[],r.forEach((function(e){t.onFragLoaded(e)}))}}},{key:"getExistingTrack",value:function(e){var t=this.media;if(t)for(var r=0;r<t.textTracks.length;r++){var n=t.textTracks[r];if(n[e])return n}return null}},{key:"createCaptionsTrack",value:function(e){var t=this.captionsProperties[e],r=t.label,n=t.languageCode,i=this.captionsTracks;if(!i[e]){var a=this.getExistingTrack(e);if(a)i[e]=a,(0,g.clearCurrentCues)(i[e]),(0,g.sendAddTrackEvent)(i[e],this.media);else{var o=this.createTextTrack("captions",r,n);o&&(o[e]=!0,i[e]=o)}}}},{key:"createTextTrack",value:function(e,t,r){var n=this.media;if(n)return n.addTextTrack(e,t,r)}},{key:"destroy",value:function(){s.default.prototype.destroy.call(this)}},{key:"onMediaAttaching",value:function(e){this.media=e.media,this._cleanTracks()}},{key:"onMediaDetaching",value:function(){var e=this.captionsTracks;Object.keys(e).forEach((function(t){(0,g.clearCurrentCues)(e[t]),delete e[t]}))}},{key:"onManifestLoading",value:function(){this.lastSn=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}},this._cleanTracks()}},{key:"_cleanTracks",value:function(){var e=this.media;if(e){var t=e.textTracks;if(t)for(var r=0;r<t.length;r++)(0,g.clearCurrentCues)(t[r])}}},{key:"onManifestLoaded",value:function(e){var t=this;if(this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.cueRanges=[],this.config.enableWebVTT){this.tracks=e.subtitles||[];var r=this.media?this.media.textTracks:[];this.tracks.forEach((function(e,n){var i=void 0;if(n<r.length){for(var a=null,o=0;o<r.length;o++)if(b(r[o],e)){a=r[o];break}a&&(i=a)}i||(i=t.createTextTrack("subtitles",e.name,e.lang)),e.default?i.mode=t.hls.subtitleDisplay?"showing":"hidden":i.mode="disabled",t.textTracks.push(i)}))}}},{key:"onLevelSwitching",value:function(){this.enabled="NONE"!==this.hls.currentLevel.closedCaptions}},{key:"onFragLoaded",value:function(e){var t=e.frag,r=e.payload;if("main"===t.type){var n=t.sn;if(n!==this.lastSn+1){var i=this.cea608Parser;i&&i.reset()}this.lastSn=n}else if("subtitle"===t.type)if(r.byteLength){if(!Number.isFinite(this.initPTS[t.cc]))return this.unparsedVttFrags.push(e),void(this.initPTS.length&&this.hls.trigger(a.default.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t}));var o=t.decryptdata;null!=o&&null!=o.key&&"AES-128"===o.method||this._parseVTTs(t,r)}else this.hls.trigger(a.default.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t})}},{key:"_parseVTTs",value:function(e,t){var r=this.vttCCs;r[e.cc]||(r[e.cc]={start:e.start,prevCC:this.prevCC,new:!0},this.prevCC=e.cc);var n=this.textTracks,i=this.hls;p.default.parse(t,this.initPTS[e.cc],r,e.cc,(function(t){var r=n[e.level];"disabled"!==r.mode?(t.forEach((function(e){if(!r.cues.getCueById(e.id))try{r.addCue(e)}catch(n){var t=new window.TextTrackCue(e.startTime,e.endTime,e.text);t.id=e.id,r.addCue(t)}})),i.trigger(a.default.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})):i.trigger(a.default.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e})}),(function(t){h.logger.log("Failed to parse VTT cue: "+t),i.trigger(a.default.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e})}))}},{key:"onFragDecrypted",value:function(e){var t=e.payload,r=e.frag;if("subtitle"===r.type){if(!Number.isFinite(this.initPTS[r.cc]))return void this.unparsedVttFrags.push(e);this._parseVTTs(r,t)}}},{key:"onFragParsingUserdata",value:function(e){if(this.enabled&&this.config.enableCEA708Captions)for(var t=0;t<e.samples.length;t++){var r=this.extractCea608Data(e.samples[t].bytes);this.cea608Parser.addData(e.samples[t].pts,r)}}},{key:"extractCea608Data",value:function(e){for(var t=31&e[0],r=2,n=void 0,i=void 0,a=void 0,o=void 0,s=void 0,l=[],u=0;u<t;u++)n=e[r++],i=127&e[r++],a=127&e[r++],o=0!==(4&n),s=3&n,0===i&&0===a||o&&0===s&&(l.push(i),l.push(a));return l}}]),t}(s.default);t.default=_,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},o=function(e){var t=e;return a.hasOwnProperty(e)&&(t=a[e]),String.fromCharCode(t)},s=15,l=100,u={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},c={17:2,18:4,21:6,22:8,23:10,19:13,20:15},d={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},f={25:2,26:4,29:6,30:8,31:10,27:13,28:15},p=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],h={verboseFilter:{DATA:3,DEBUG:3,INFO:2,WARNING:2,TEXT:1,ERROR:0},time:null,verboseLevel:0,setTime:function(e){this.time=e},log:function(e,t){this.verboseFilter[e];this.verboseLevel}},g=function(e){for(var t=[],r=0;r<e.length;r++)t.push(e[r].toString(16));return t},y=function(){function e(t,r,n,a,o){i(this,e),this.foreground=t||"white",this.underline=r||!1,this.italics=n||!1,this.background=a||"black",this.flash=o||!1}return n(e,[{key:"reset",value:function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}},{key:"setStyles",value:function(e){for(var t=["foreground","underline","italics","background","flash"],r=0;r<t.length;r++){var n=t[r];e.hasOwnProperty(n)&&(this[n]=e[n])}}},{key:"isDefault",value:function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash}},{key:"equals",value:function(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash}},{key:"copy",value:function(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash}},{key:"toString",value:function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}]),e}(),v=function(){function e(t,r,n,a,o,s){i(this,e),this.uchar=t||" ",this.penState=new y(r,n,a,o,s)}return n(e,[{key:"reset",value:function(){this.uchar=" ",this.penState.reset()}},{key:"setChar",value:function(e,t){this.uchar=e,this.penState.copy(t)}},{key:"setPenState",value:function(e){this.penState.copy(e)}},{key:"equals",value:function(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)}},{key:"copy",value:function(e){this.uchar=e.uchar,this.penState.copy(e.penState)}},{key:"isEmpty",value:function(){return" "===this.uchar&&this.penState.isDefault()}}]),e}(),m=function(){function e(){i(this,e),this.chars=[];for(var t=0;t<l;t++)this.chars.push(new v);this.pos=0,this.currPenState=new y}return n(e,[{key:"equals",value:function(e){for(var t=!0,r=0;r<l;r++)if(!this.chars[r].equals(e.chars[r])){t=!1;break}return t}},{key:"copy",value:function(e){for(var t=0;t<l;t++)this.chars[t].copy(e.chars[t])}},{key:"isEmpty",value:function(){for(var e=!0,t=0;t<l;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e}},{key:"setCursor",value:function(e){this.pos!==e&&(this.pos=e),this.pos<0?(h.log("ERROR","Negative cursor position "+this.pos),this.pos=0):this.pos>l&&(h.log("ERROR","Too large cursor position "+this.pos),this.pos=l)}},{key:"moveCursor",value:function(e){var t=this.pos+e;if(e>1)for(var r=this.pos+1;r<t+1;r++)this.chars[r].setPenState(this.currPenState);this.setCursor(t)}},{key:"backSpace",value:function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}},{key:"insertChar",value:function(e){e>=144&&this.backSpace();var t=o(e);this.pos>=l?h.log("ERROR","Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))}},{key:"clearFromPos",value:function(e){var t=void 0;for(t=e;t<l;t++)this.chars[t].reset()}},{key:"clear",value:function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}},{key:"clearToEndOfRow",value:function(){this.clearFromPos(this.pos)}},{key:"getTextString",value:function(){for(var e=[],t=!0,r=0;r<l;r++){var n=this.chars[r].uchar;" "!==n&&(t=!1),e.push(n)}return t?"":e.join("")}},{key:"setPenStyles",value:function(e){this.currPenState.setStyles(e);var t=this.chars[this.pos];t.setPenState(this.currPenState)}}]),e}(),x=function(){function e(){i(this,e),this.rows=[];for(var t=0;t<s;t++)this.rows.push(new m);this.currRow=s-1,this.nrRollUpRows=null,this.reset()}return n(e,[{key:"reset",value:function(){for(var e=0;e<s;e++)this.rows[e].clear();this.currRow=s-1}},{key:"equals",value:function(e){for(var t=!0,r=0;r<s;r++)if(!this.rows[r].equals(e.rows[r])){t=!1;break}return t}},{key:"copy",value:function(e){for(var t=0;t<s;t++)this.rows[t].copy(e.rows[t])}},{key:"isEmpty",value:function(){for(var e=!0,t=0;t<s;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e}},{key:"backSpace",value:function(){var e=this.rows[this.currRow];e.backSpace()}},{key:"clearToEndOfRow",value:function(){var e=this.rows[this.currRow];e.clearToEndOfRow()}},{key:"insertChar",value:function(e){var t=this.rows[this.currRow];t.insertChar(e)}},{key:"setPen",value:function(e){var t=this.rows[this.currRow];t.setPenStyles(e)}},{key:"moveCursor",value:function(e){var t=this.rows[this.currRow];t.moveCursor(e)}},{key:"setCursor",value:function(e){h.log("INFO","setCursor: "+e);var t=this.rows[this.currRow];t.setCursor(e)}},{key:"setPAC",value:function(e){h.log("INFO","pacData = "+JSON.stringify(e));var t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(var r=0;r<s;r++)this.rows[r].clear();var n=this.currRow+1-this.nrRollUpRows,i=this.lastOutputScreen;if(i){var a=i.rows[n].cueStartTime;if(a&&a<h.time)for(var o=0;o<this.nrRollUpRows;o++)this.rows[t-this.nrRollUpRows+o+1].copy(i.rows[n+o])}}this.currRow=t;var l=this.rows[this.currRow];if(null!==e.indent){var u=e.indent,c=Math.max(u-1,0);l.setCursor(e.indent),e.color=l.chars[c].penState.foreground}var d={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(d)}},{key:"setBkgData",value:function(e){h.log("INFO","bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)}},{key:"setRollUpRows",value:function(e){this.nrRollUpRows=e}},{key:"rollUp",value:function(){if(null!==this.nrRollUpRows){h.log("TEXT",this.getDisplayText());var e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),h.log("INFO","Rolling up")}else h.log("DEBUG","roll_up but nrRollUpRows not set yet")}},{key:"getDisplayText",value:function(e){e=e||!1;for(var t=[],r="",n=-1,i=0;i<s;i++){var a=this.rows[i].getTextString();a&&(n=i+1,e?t.push("Row "+n+": '"+a+"'"):t.push(a.trim()))}return t.length>0&&(r=e?"["+t.join(" | ")+"]":t.join("\n")),r}},{key:"getTextAndFormat",value:function(){return this.rows}}]),e}(),b=function(){function e(t,r){i(this,e),this.chNr=t,this.outputFilter=r,this.mode=null,this.verbose=0,this.displayedMemory=new x,this.nonDisplayedMemory=new x,this.lastOutputScreen=new x,this.currRollUpRow=this.displayedMemory.rows[s-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}return n(e,[{key:"reset",value:function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[s-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null}},{key:"getHandler",value:function(){return this.outputFilter}},{key:"setHandler",value:function(e){this.outputFilter=e}},{key:"setPAC",value:function(e){this.writeScreen.setPAC(e)}},{key:"setBkgData",value:function(e){this.writeScreen.setBkgData(e)}},{key:"setMode",value:function(e){e!==this.mode&&(this.mode=e,h.log("INFO","MODE="+e),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}},{key:"insertChars",value:function(e){for(var t=0;t<e.length;t++)this.writeScreen.insertChar(e[t]);var r=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";h.log("INFO",r+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(h.log("TEXT","DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}},{key:"ccRCL",value:function(){h.log("INFO","RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}},{key:"ccBS",value:function(){h.log("INFO","BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}},{key:"ccAOF",value:function(){}},{key:"ccAON",value:function(){}},{key:"ccDER",value:function(){h.log("INFO","DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}},{key:"ccRU",value:function(e){h.log("INFO","RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}},{key:"ccFON",value:function(){h.log("INFO","FON - Flash On"),this.writeScreen.setPen({flash:!0})}},{key:"ccRDC",value:function(){h.log("INFO","RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}},{key:"ccTR",value:function(){h.log("INFO","TR"),this.setMode("MODE_TEXT")}},{key:"ccRTD",value:function(){h.log("INFO","RTD"),this.setMode("MODE_TEXT")}},{key:"ccEDM",value:function(){h.log("INFO","EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}},{key:"ccCR",value:function(){h.log("CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}},{key:"ccENM",value:function(){h.log("INFO","ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}},{key:"ccEOC",value:function(){if(h.log("INFO","EOC - End Of Caption"),"MODE_POP-ON"===this.mode){var e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,h.log("TEXT","DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}},{key:"ccTO",value:function(e){h.log("INFO","TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}},{key:"ccMIDROW",value:function(e){var t={flash:!1};if(t.underline=e%2===1,t.italics=e>=46,t.italics)t.foreground="white";else{var r=Math.floor(e/2)-16,n=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=n[r]}h.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)}},{key:"outputDataUpdate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=h.time;null!==t&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),!0===e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue()),this.cueStartTime=this.displayedMemory.isEmpty()?null:t):this.cueStartTime=t,this.lastOutputScreen.copy(this.displayedMemory))}},{key:"cueSplitAtTime",value:function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}]),e}(),k=function(){function e(t,r,n){i(this,e),this.field=t||1,this.outputs=[r,n],this.channels=[new b(1,r),new b(2,n)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.bufferedData=[],this.startTime=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}}return n(e,[{key:"getHandler",value:function(e){return this.channels[e].getHandler()}},{key:"setHandler",value:function(e,t){this.channels[e].setHandler(t)}},{key:"addData",value:function(e,t){var r=void 0,n=void 0,i=void 0,a=!1;this.lastTime=e,h.setTime(e);for(var o=0;o<t.length;o+=2)if(n=127&t[o],i=127&t[o+1],0!==n||0!==i){if(h.log("DATA","["+g([t[o],t[o+1]])+"] -> ("+g([n,i])+")"),r=this.parseCmd(n,i),r||(r=this.parseMidrow(n,i)),r||(r=this.parsePAC(n,i)),r||(r=this.parseBackgroundAttributes(n,i)),!r&&(a=this.parseChars(n,i),a))if(this.currChNr&&this.currChNr>=0){var s=this.channels[this.currChNr-1];s.insertChars(a)}else h.log("WARNING","No channel found yet. TEXT-MODE?");r?this.dataCounters.cmd+=2:a?this.dataCounters.char+=2:(this.dataCounters.other+=2,h.log("WARNING","Couldn't parse cleaned data "+g([n,i])+" orig: "+g([t[o],t[o+1]])))}else this.dataCounters.padding+=2}},{key:"parseCmd",value:function(e,t){var r=null,n=(20===e||28===e)&&t>=32&&t<=47,i=(23===e||31===e)&&t>=33&&t<=35;if(!n&&!i)return!1;if(e===this.lastCmdA&&t===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,h.log("DEBUG","Repeated command ("+g([e,t])+") is dropped"),!0;r=20===e||23===e?1:2;var a=this.channels[r-1];return 20===e||28===e?32===t?a.ccRCL():33===t?a.ccBS():34===t?a.ccAOF():35===t?a.ccAON():36===t?a.ccDER():37===t?a.ccRU(2):38===t?a.ccRU(3):39===t?a.ccRU(4):40===t?a.ccFON():41===t?a.ccRDC():42===t?a.ccTR():43===t?a.ccRTD():44===t?a.ccEDM():45===t?a.ccCR():46===t?a.ccENM():47===t&&a.ccEOC():a.ccTO(t-32),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=r,!0}},{key:"parseMidrow",value:function(e,t){var r=null;if((17===e||25===e)&&t>=32&&t<=47){if(r=17===e?1:2,r!==this.currChNr)return h.log("ERROR","Mismatch channel in midrow parsing"),!1;var n=this.channels[r-1];return n.ccMIDROW(t),h.log("DEBUG","MIDROW ("+g([e,t])+")"),!0}return!1}},{key:"parsePAC",value:function(e,t){var r=null,n=null,i=(e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127,a=(16===e||24===e)&&t>=64&&t<=95;if(!i&&!a)return!1;if(e===this.lastCmdA&&t===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,!0;r=e<=23?1:2,n=t>=64&&t<=95?1===r?u[e]:d[e]:1===r?c[e]:f[e];var o=this.interpretPAC(n,t),s=this.channels[r-1];return s.setPAC(o),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=r,!0}},{key:"interpretPAC",value:function(e,t){var r=t,n={color:null,italics:!1,indent:null,underline:!1,row:e};return r=t>95?t-96:t-64,n.underline=1===(1&r),r<=13?n.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(n.italics=!0,n.color="white"):n.indent=4*Math.floor((r-16)/2),n}},{key:"parseChars",value:function(e,t){var r=null,n=null,i=null;if(e>=25?(r=2,i=e-8):(r=1,i=e),i>=17&&i<=19){var a=t;a=17===i?t+80:18===i?t+112:t+144,h.log("INFO","Special char '"+o(a)+"' in channel "+r),n=[a]}else e>=32&&e<=127&&(n=0===t?[e]:[e,t]);if(n){var s=g(n);h.log("DEBUG","Char codes =  "+s.join(",")),this.lastCmdA=null,this.lastCmdB=null}return n}},{key:"parseBackgroundAttributes",value:function(e,t){var r=void 0,n=void 0,i=void 0,a=void 0,o=(16===e||24===e)&&t>=32&&t<=47,s=(23===e||31===e)&&t>=45&&t<=47;return!(!o&&!s)&&(r={},16===e||24===e?(n=Math.floor((t-32)/2),r.background=p[n],t%2===1&&(r.background=r.background+"_semi")):45===t?r.background="transparent":(r.foreground="black",47===t&&(r.underline=!0)),i=e<24?1:2,a=this.channels[i-1],a.setBkgData(r),this.lastCmdA=null,this.lastCmdB=null,!0)}},{key:"reset",value:function(){for(var e=0;e<this.channels.length;e++)this.channels[e]&&this.channels[e].reset();this.lastCmdA=null,this.lastCmdB=null}},{key:"cueSplitAtTime",value:function(e){for(var t=0;t<this.channels.length;t++)this.channels[t]&&this.channels[t].cueSplitAtTime(e)}}]),e}();t.default=k,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=function(){function e(t,r){i(this,e),this.timelineController=t,this.trackName=r,this.startTime=null,this.endTime=null,this.screen=null}return n(e,[{key:"dispatchCue",value:function(){null!==this.startTime&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen),this.startTime=null)}},{key:"newCue",value:function(e,t,r){(null===this.startTime||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=r,this.timelineController.createCaptionsTrack(this.trackName)}}]),e}();t.default=a,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(30),i=o(n),a=r(10);function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t,r){return e.substr(r||0,t.length)===t},l=function(e){var t=parseInt(e.substr(-3)),r=parseInt(e.substr(-6,2)),n=parseInt(e.substr(-9,2)),i=e.length>9?parseInt(e.substr(0,e.indexOf(":"))):0;return Number.isFinite(t)&&Number.isFinite(r)&&Number.isFinite(n)&&Number.isFinite(i)?(t+=1e3*r,t+=6e4*n,t+=36e5*i,t):-1},u=function(e){var t=5381,r=e.length;while(r)t=33*t^e.charCodeAt(--r);return(t>>>0).toString()},c=function(e,t,r){var n=e[t],i=e[n.prevCC];if(!i||!i.new&&n.new)return e.ccOffset=e.presentationOffset=n.start,void(n.new=!1);while(i&&i.new)e.ccOffset+=n.start-i.start,n.new=!1,n=i,i=e[n.prevCC];e.presentationOffset=r},d={parse:function(e,t,r,n,o,d){var f=/\r\n|\n\r|\n|\r/g,p=(0,a.utf8ArrayToStr)(new Uint8Array(e)).trim().replace(f,"\n").split("\n"),h="00:00.000",g=0,y=0,v=0,m=[],x=void 0,b=!0,k=new i.default;k.oncue=function(e){var t=r[n],i=r.ccOffset;t&&t.new&&(void 0!==y?i=r.ccOffset=t.start:c(r,n,v)),v&&(i=v-r.presentationOffset),e.startTime+=i-y,e.endTime+=i-y,e.id=u(e.startTime.toString())+u(e.endTime.toString())+u(e.text),e.text=decodeURIComponent(encodeURIComponent(e.text)),e.endTime>0&&m.push(e)},k.onparsingerror=function(e){x=e},k.onflush=function(){x&&d?d(x):o(m)},p.forEach((function(e){if(b){if(s(e,"X-TIMESTAMP-MAP=")){b=!1,e.substr(16).split(",").forEach((function(e){s(e,"LOCAL:")?h=e.substr(6):s(e,"MPEGTS:")&&(g=parseInt(e.substr(7)))}));try{t+(9e4*r[n].start||0)<0&&(t+=8589934592),g-=t,y=l(h)/1e3,v=g/9e4,-1===y&&(x=new Error("Malformed X-TIMESTAMP-MAP: "+e))}catch(i){x=new Error("Malformed X-TIMESTAMP-MAP: "+e)}return}""===e&&(b=!1)}k.parse(e+"\n")})),k.flush()}};t.default=d,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(1),a=c(i),o=r(3),s=c(o),l=r(0),u=r(7);function c(e){return e&&e.__esModule?e:{default:e}}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function p(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var h=function(e){function t(e){d(this,t);var r=f(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,a.default.MEDIA_ATTACHED,a.default.MEDIA_DETACHING,a.default.MANIFEST_LOADED,a.default.SUBTITLE_TRACK_LOADED));return r.tracks=[],r.trackId=-1,r.media=null,r.stopped=!0,r.subtitleDisplay=!0,r}return p(t,e),n(t,[{key:"destroy",value:function(){s.default.prototype.destroy.call(this)}},{key:"onMediaAttached",value:function(e){var t=this;this.media=e.media,this.media&&(this.queuedDefaultTrack&&(this.subtitleTrack=this.queuedDefaultTrack,delete this.queuedDefaultTrack),this.trackChangeListener=this._onTextTracksChanged.bind(this),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.subtitlePollingInterval=setInterval((function(){t.trackChangeListener()}),500):this.media.textTracks.addEventListener("change",this.trackChangeListener))}},{key:"onMediaDetaching",value:function(){this.media&&(this.useTextTrackPolling?clearInterval(this.subtitlePollingInterval):this.media.textTracks.removeEventListener("change",this.trackChangeListener),this.media=null)}},{key:"onManifestLoaded",value:function(e){var t=this,r=e.subtitles||[];this.tracks=r,this.hls.trigger(a.default.SUBTITLE_TRACKS_UPDATED,{subtitleTracks:r}),r.forEach((function(e){e.default&&(t.media?t.subtitleTrack=e.id:t.queuedDefaultTrack=e.id)}))}},{key:"onSubtitleTrackLoaded",value:function(e){var t=this,r=e.id,n=e.details,i=this.trackId,a=this.tracks,o=a[i];if(r>=a.length||r!==i||!o||this.stopped)this._clearReloadTimer();else if(l.logger.log("subtitle track "+r+" loaded"),n.live){var s=(0,u.computeReloadInterval)(o.details,n,e.stats.trequest);l.logger.log("Reloading live subtitle playlist in "+s+"ms"),this.timer=setTimeout((function(){t._loadCurrentTrack()}),s)}else this._clearReloadTimer()}},{key:"startLoad",value:function(){this.stopped=!1,this._loadCurrentTrack()}},{key:"stopLoad",value:function(){this.stopped=!0,this._clearReloadTimer()}},{key:"_clearReloadTimer",value:function(){this.timer&&(clearTimeout(this.timer),this.timer=null)}},{key:"_loadCurrentTrack",value:function(){var e=this.trackId,t=this.tracks,r=this.hls,n=t[e];e<0||!n||n.details&&!n.details.live||(l.logger.log("Loading subtitle track "+e),r.trigger(a.default.SUBTITLE_TRACK_LOADING,{url:n.url,id:e}))}},{key:"_toggleTrackModes",value:function(e){var t=this.media,r=this.subtitleDisplay,n=this.trackId;if(t){var i=g(t.textTracks);if(-1===e)[].slice.call(i).forEach((function(e){e.mode="disabled"}));else{var a=i[n];a&&(a.mode="disabled")}var o=i[e];o&&(o.mode=r?"showing":"hidden")}}},{key:"_setSubtitleTrackInternal",value:function(e){var t=this.hls,r=this.tracks;!Number.isFinite(e)||e<-1||e>=r.length||(this.trackId=e,l.logger.log("Switching to subtitle track "+e),t.trigger(a.default.SUBTITLE_TRACK_SWITCH,{id:e}),this._loadCurrentTrack())}},{key:"_onTextTracksChanged",value:function(){if(this.media){for(var e=-1,t=g(this.media.textTracks),r=0;r<t.length;r++)if("hidden"===t[r].mode)e=r;else if("showing"===t[r].mode){e=r;break}this.subtitleTrack=e}}},{key:"subtitleTracks",get:function(){return this.tracks}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(e){this.trackId!==e&&(this._toggleTrackModes(e),this._setSubtitleTrackInternal(e))}}]),t}(s.default);function g(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];"subtitles"===n.kind&&n.label&&t.push(e[r])}return t}t.default=h,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SubtitleStreamController=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function e(t,r,n){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,r);if(void 0===i){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,r,n)}if("value"in i)return i.value;var o=i.get;return void 0!==o?o.call(n):void 0},a=r(1),o=y(a),s=r(0),l=r(12),u=y(l),c=r(4),d=r(27),f=r(6),p=r(14),h=y(p),g=r(7);function y(e){return e&&e.__esModule?e:{default:e}}function v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function x(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var b=window,k=b.performance,_=500;t.SubtitleStreamController=function(e){function t(e,r){v(this,t);var n=m(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,o.default.MEDIA_ATTACHED,o.default.MEDIA_DETACHING,o.default.ERROR,o.default.KEY_LOADED,o.default.FRAG_LOADED,o.default.SUBTITLE_TRACKS_UPDATED,o.default.SUBTITLE_TRACK_SWITCH,o.default.SUBTITLE_TRACK_LOADED,o.default.SUBTITLE_FRAG_PROCESSED,o.default.LEVEL_UPDATED));return n.fragmentTracker=r,n.config=e.config,n.state=p.State.STOPPED,n.tracks=[],n.tracksBuffered=[],n.currentTrackId=-1,n.decrypter=new u.default(e,e.config),n.lastAVStart=0,n._onMediaSeeking=n.onMediaSeeking.bind(n),n}return x(t,e),n(t,[{key:"onSubtitleFragProcessed",value:function(e){var t=e.frag,r=e.success;if(this.fragPrevious=t,this.state=p.State.IDLE,r){var n=this.tracksBuffered[this.currentTrackId];if(n){for(var i=void 0,a=t.start,o=0;o<n.length;o++)if(a>=n[o].start&&a<=n[o].end){i=n[o];break}var s=t.start+t.duration;i?i.end=s:(i={start:a,end:s},n.push(i))}}}},{key:"onMediaAttached",value:function(e){var t=e.media;this.media=t,t.addEventListener("seeking",this._onMediaSeeking),this.state=p.State.IDLE}},{key:"onMediaDetaching",value:function(){this.media.removeEventListener("seeking",this._onMediaSeeking),this.media=null,this.state=p.State.STOPPED}},{key:"onError",value:function(e){var t=e.frag;t&&"subtitle"===t.type&&(this.state=p.State.IDLE)}},{key:"onSubtitleTracksUpdated",value:function(e){var t=this;s.logger.log("subtitle tracks updated"),this.tracksBuffered=[],this.tracks=e.subtitleTracks,this.tracks.forEach((function(e){t.tracksBuffered[e.id]=[]}))}},{key:"onSubtitleTrackSwitch",value:function(e){if(this.currentTrackId=e.id,this.tracks&&-1!==this.currentTrackId){var t=this.tracks[this.currentTrackId];t&&t.details&&this.setInterval(_)}else this.clearInterval()}},{key:"onSubtitleTrackLoaded",value:function(e){var t=e.id,r=e.details,n=this.currentTrackId,i=this.tracks,a=i[n];t>=i.length||t!==n||!a||(r.live&&(0,g.mergeSubtitlePlaylists)(a.details,r,this.lastAVStart),a.details=r,this.setInterval(_))}},{key:"onKeyLoaded",value:function(){this.state===p.State.KEY_LOADING&&(this.state=p.State.IDLE)}},{key:"onFragLoaded",value:function(e){var t=this.fragCurrent,r=e.frag.decryptdata,n=e.frag,i=this.hls;if(this.state===p.State.FRAG_LOADING&&t&&"subtitle"===e.frag.type&&t.sn===e.frag.sn&&e.payload.byteLength>0&&r&&r.key&&"AES-128"===r.method){var a=k.now();this.decrypter.decrypt(e.payload,r.key.buffer,r.iv.buffer,(function(e){var t=k.now();i.trigger(o.default.FRAG_DECRYPTED,{frag:n,payload:e,stats:{tstart:a,tdecrypt:t}})}))}}},{key:"onLevelUpdated",value:function(e){var t=e.details,r=t.fragments;this.lastAVStart=r.length?r[0].start:0}},{key:"doTick",value:function(){if(this.media)switch(this.state){case p.State.IDLE:var e=this.config,t=this.currentTrackId,r=this.fragmentTracker,n=this.media,i=this.tracks;if(!i||!i[t]||!i[t].details)break;var a=e.maxBufferHole,l=e.maxFragLookUpTolerance,u=Math.min(e.maxBufferLength,e.maxMaxBufferLength),h=c.BufferHelper.bufferedInfo(this._getBuffered(),n.currentTime,a),g=h.end,y=h.len,v=i[t].details,m=v.fragments,x=m.length,b=m[x-1].start+m[x-1].duration;if(y>u)return;var k=void 0,_=this.fragPrevious;g<b?(_&&v.hasProgramDateTime&&(k=(0,d.findFragmentByPDT)(m,_.endProgramDateTime,l)),k||(k=(0,d.findFragmentByPTS)(_,m,g,l))):k=m[x-1],k&&k.encrypted?(s.logger.log("Loading key for "+k.sn),this.state=p.State.KEY_LOADING,this.hls.trigger(o.default.KEY_LOADING,{frag:k})):k&&r.getState(k)===f.FragmentState.NOT_LOADED&&(this.fragCurrent=k,this.state=p.State.FRAG_LOADING,this.hls.trigger(o.default.FRAG_LOADING,{frag:k}))}else this.state=p.State.IDLE}},{key:"stopLoad",value:function(){this.lastAVStart=0,i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"stopLoad",this).call(this)}},{key:"_getBuffered",value:function(){return this.tracksBuffered[this.currentTrackId]||[]}},{key:"onMediaSeeking",value:function(){this.fragPrevious=null}}]),t}(h.default)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(3),a=c(i),o=r(1),s=c(o),l=r(2),u=r(0);function c(e){return e&&e.__esModule?e:{default:e}}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function p(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var h=window,g=h.XMLHttpRequest,y=3,v={WIDEVINE:"com.widevine.alpha",PLAYREADY:"com.microsoft.playready"},m=function(e,t,r){var n={videoCapabilities:[]};return t.forEach((function(e){n.videoCapabilities.push({contentType:'video/mp4; codecs="'+e+'"'})})),[n]},x=function(e,t,r){switch(e){case v.WIDEVINE:return m(t,r);default:throw Error("Unknown key-system: "+e)}},b=function(e){function t(e){d(this,t);var r=f(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,s.default.MEDIA_ATTACHED,s.default.MANIFEST_PARSED));return r._widevineLicenseUrl=e.config.widevineLicenseUrl,r._licenseXhrSetup=e.config.licenseXhrSetup,r._emeEnabled=e.config.emeEnabled,r._requestMediaKeySystemAccess=e.config.requestMediaKeySystemAccessFunc,r._mediaKeysList=[],r._media=null,r._hasSetMediaKeys=!1,r._isMediaEncrypted=!1,r._requestLicenseFailureCount=0,r}return p(t,e),n(t,[{key:"getLicenseServerUrl",value:function(e){var t=void 0;switch(e){case v.WIDEVINE:t=this._widevineLicenseUrl;break;default:t=null;break}return t||(u.logger.error('No license server URL configured for key-system "'+e+'"'),this.hls.trigger(s.default.ERROR,{type:l.ErrorTypes.KEY_SYSTEM_ERROR,details:l.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})),t}},{key:"_attemptKeySystemAccess",value:function(e,t,r){var n=this,i=x(e,t,r);i?(u.logger.log("Requesting encrypted media key-system access"),this.requestMediaKeySystemAccess(e,i).then((function(t){n._onMediaKeySystemAccessObtained(e,t)})).catch((function(t){u.logger.error('Failed to obtain key-system "'+e+'" access:',t)}))):u.logger.warn("Can not create config for key-system (maybe because platform is not supported):",e)}},{key:"_onMediaKeySystemAccessObtained",value:function(e,t){var r=this;u.logger.log('Access for key-system "'+e+'" obtained');var n={mediaKeys:null,mediaKeysSession:null,mediaKeysSessionInitialized:!1,mediaKeySystemAccess:t,mediaKeySystemDomain:e};this._mediaKeysList.push(n),t.createMediaKeys().then((function(t){n.mediaKeys=t,u.logger.log('Media-keys created for key-system "'+e+'"'),r._onMediaKeysCreated()})).catch((function(e){u.logger.error("Failed to create media-keys:",e)}))}},{key:"_onMediaKeysCreated",value:function(){var e=this;this._mediaKeysList.forEach((function(t){t.mediaKeysSession||(t.mediaKeysSession=t.mediaKeys.createSession(),e._onNewMediaKeySession(t.mediaKeysSession))}))}},{key:"_onNewMediaKeySession",value:function(e){var t=this;u.logger.log("New key-system session "+e.sessionId),e.addEventListener("message",(function(r){t._onKeySessionMessage(e,r.message)}),!1)}},{key:"_onKeySessionMessage",value:function(e,t){u.logger.log("Got EME message event, creating license request"),this._requestLicense(t,(function(t){u.logger.log("Received license data, updating key-session"),e.update(t)}))}},{key:"_onMediaEncrypted",value:function(e,t){u.logger.log('Media is encrypted using "'+e+'" init data type'),this._isMediaEncrypted=!0,this._mediaEncryptionInitDataType=e,this._mediaEncryptionInitData=t,this._attemptSetMediaKeys(),this._generateRequestWithPreferredKeySession()}},{key:"_attemptSetMediaKeys",value:function(){if(!this._hasSetMediaKeys){var e=this._mediaKeysList[0];if(!e||!e.mediaKeys)return u.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),void this.hls.trigger(s.default.ERROR,{type:l.ErrorTypes.KEY_SYSTEM_ERROR,details:l.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});u.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(e.mediaKeys),this._hasSetMediaKeys=!0}}},{key:"_generateRequestWithPreferredKeySession",value:function(){var e=this,t=this._mediaKeysList[0];if(!t)return u.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),void this.hls.trigger(s.default.ERROR,{type:l.ErrorTypes.KEY_SYSTEM_ERROR,details:l.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});if(t.mediaKeysSessionInitialized)u.logger.warn("Key-Session already initialized but requested again");else{var r=t.mediaKeysSession;r||(u.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(s.default.ERROR,{type:l.ErrorTypes.KEY_SYSTEM_ERROR,details:l.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0}));var n=this._mediaEncryptionInitDataType,i=this._mediaEncryptionInitData;u.logger.log('Generating key-session request for "'+n+'" init data type'),t.mediaKeysSessionInitialized=!0,r.generateRequest(n,i).then((function(){u.logger.debug("Key-session generation succeeded")})).catch((function(t){u.logger.error("Error generating key-session request:",t),e.hls.trigger(s.default.ERROR,{type:l.ErrorTypes.KEY_SYSTEM_ERROR,details:l.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})}))}}},{key:"_createLicenseXhr",value:function(e,t,r){var n=new g,i=this._licenseXhrSetup;try{if(i)try{i(n,e)}catch(a){n.open("POST",e,!0),i(n,e)}n.readyState||n.open("POST",e,!0)}catch(a){return u.logger.error("Error setting up key-system license XHR",a),void this.hls.trigger(s.default.ERROR,{type:l.ErrorTypes.KEY_SYSTEM_ERROR,details:l.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}return n.responseType="arraybuffer",n.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,n,e,t,r),n}},{key:"_onLicenseRequestReadyStageChange",value:function(e,t,r,n){switch(e.readyState){case 4:if(200===e.status)this._requestLicenseFailureCount=0,u.logger.log("License request succeeded"),n(e.response);else{if(u.logger.error("License Request XHR failed ("+t+"). Status: "+e.status+" ("+e.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount<=y){var i=y-this._requestLicenseFailureCount+1;return u.logger.warn("Retrying license request, "+i+" attempts left"),void this._requestLicense(r,n)}this.hls.trigger(s.default.ERROR,{type:l.ErrorTypes.KEY_SYSTEM_ERROR,details:l.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}break}}},{key:"_generateLicenseRequestChallenge",value:function(e,t){var r=void 0;return e.mediaKeySystemDomain===v.PLAYREADY?u.logger.error("PlayReady is not supported (yet)"):e.mediaKeySystemDomain===v.WIDEVINE?r=t:u.logger.error("Unsupported key-system:",e.mediaKeySystemDomain),r}},{key:"_requestLicense",value:function(e,t){u.logger.log("Requesting content license for key-system");var r=this._mediaKeysList[0];if(!r)return u.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),void this.hls.trigger(s.default.ERROR,{type:l.ErrorTypes.KEY_SYSTEM_ERROR,details:l.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});var n=this.getLicenseServerUrl(r.mediaKeySystemDomain),i=this._createLicenseXhr(n,e,t);u.logger.log("Sending license request to URL: "+n),i.send(this._generateLicenseRequestChallenge(r,e))}},{key:"onMediaAttached",value:function(e){var t=this;if(this._emeEnabled){var r=e.media;this._media=r,r.addEventListener("encrypted",(function(e){t._onMediaEncrypted(e.initDataType,e.initData)}))}}},{key:"onManifestParsed",value:function(e){if(this._emeEnabled){var t=e.levels.map((function(e){return e.audioCodec})),r=e.levels.map((function(e){return e.videoCodec}));this._attemptKeySystemAccess(v.WIDEVINE,t,r)}}},{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),t}(a.default);t.default=b,e.exports=t["default"]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){return"undefined"!==typeof window&&window.navigator&&window.navigator.requestMediaKeySystemAccess?window.navigator.requestMediaKeySystemAccess.bind(window.navigator):null}();t.requestMediaKeySystemAccess=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={getBrowserVersion:function(){var e=navigator.userAgent;if(e.toLowerCase().indexOf("mobile")>-1)return"Unknown";if(e.indexOf("Firefox")>-1){var t=e.match(/firefox\/[\d.]+/gi)[0].match(/[\d]+/)[0];return"Firefox "+t}if(e.indexOf("Edge")>-1){var r=e.match(/edge\/[\d.]+/gi)[0].match(/[\d]+/)[0];return"Edge "+r}if(e.indexOf("rv:11")>-1)return"IE 11";if(e.indexOf("Opera")>-1||e.indexOf("OPR")>-1){if(e.indexOf("Opera")>-1){var n=e.match(/opera\/[\d.]+/gi)[0].match(/[\d]+/)[0];return"Opera "+n}if(e.indexOf("OPR")>-1){var i=e.match(/opr\/[\d.]+/gi)[0].match(/[\d]+/)[0];return"Opera "+i}}else{if(e.indexOf("Chrome")>-1){var a=e.match(/chrome\/[\d.]+/gi)[0].match(/[\d]+/)[0];return"Chrome "+a}if(e.indexOf("Safari")>-1){var o=e.match(/safari\/[\d.]+/gi)[0].match(/[\d]+/)[0];return"Safari "+o}if(!(e.indexOf("MSIE")>-1||e.indexOf("Trident")>-1))return"Unknown";if(e.indexOf("MSIE")>-1){var s=e.match(/msie [\d.]+/gi)[0].match(/[\d]+/)[0];return"IE "+s}if(e.indexOf("Trident")>-1){var l=e.match(/trident\/[\d.]+/gi)[0].match(/[\d]+/)[0],u=parseInt(l)+4;return"IE "+u}}}};t.default=n,e.exports=t["default"]}])}))}}]);