forked from kaltura/playkit-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaykit.js
7 lines (7 loc) · 139 KB
/
playkit.js
1
2
3
4
5
6
7
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("core",[],t):"object"==typeof exports?exports.core=t():(e.playkit=e.playkit||{},e.playkit.core=t())}(this,function(){return function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=30)}([function(e,t,n){"use strict";function i(e){return e?s.get(e):s}function r(e){return i(e).getLevel()}function a(e,t){i(t).setLevel(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.setLogLevel=t.getLogLevel=t.LogLevelType=t.LogLevel=void 0;var o=n(35),s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(o),u={DEBUG:s.DEBUG,INFO:s.INFO,TIME:s.TIME,WARN:s.WARN,ERROR:s.ERROR,OFF:s.OFF},l={};Object.keys(u).forEach(function(e){l[e]=e}),s.useDefaults({defaultLevel:s.ERROR}),t.default=i,t.LogLevel=u,t.LogLevelType=l,t.getLogLevel=r,t.setLogLevel=a},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=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),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=function(){function e(t,n){i(this,e),this.bubbles=!1,this.cancelable=!1,this.defaultPrevented=!1,this.timeStamp=window.performance?window.performance.now():Date.now(),this.type=t,this.isTrusted=!1,this.currentTarget=null,this.target=null,this.stopped=!1,this.payload=n}return r(e,[{key:"preventDefault",value:function(){}},{key:"stopImmediatePropagation",value:function(){this.stopped=!0}},{key:"stopPropagation",value:function(){}}]),e}();t.default=a},function(e,t,n){"use strict";function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0});var 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},o={isNumber:function(e){return Number(e)===e},isInt:function(e){return this.isNumber(e)&&e%1==0},isFloat:function(e){return this.isNumber(e)&&e%1!=0}},s={capitlize:function(e){return"string"!=typeof e?e:e.charAt(0).toUpperCase()+e.slice(1)},endsWith:function(e,t){return"string"==typeof e&&"string"==typeof t&&-1!=e.indexOf(t,e.length-t.length)}},u={merge:function(e){var t={},n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;Object.assign(t,s)}}catch(e){i=!0,r=e}finally{try{!n&&o.return&&o.return()}finally{if(i)throw r}}return t},isObject:function(e){return e&&"object"===(void 0===e?"undefined":a(e))&&!Array.isArray(e)},mergeDeep:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];if(!n.length)return e;var o=n.shift();if(this.isObject(e)&&this.isObject(o))for(var s in o)this.isObject(o[s])?(e[s]||Object.assign(e,r({},s,{})),this.mergeDeep(e[s],o[s])):Object.assign(e,r({},s,o[s]));return this.mergeDeep.apply(this,[e].concat(i(n)))},copyDeep:function(e){var t=this,n=void 0;return Array.isArray(e)?(n=e.length>0?e.slice(0):[],n.forEach(function(e,i){("object"===(void 0===e?"undefined":a(e))&&e!=={}||Array.isArray(e)&&e.length>0)&&(n[i]=t.copyDeep(e))})):"object"===(void 0===e?"undefined":a(e))?(n=Object.assign({},e),Object.keys(n).forEach(function(e){("object"===a(n[e])&&n[e]!=={}||Array.isArray(n[e])&&n[e].length>0)&&(n[e]=t.copyDeep(n[e]))})):n=e,n},isEmptyObject:function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},getPropertyPath:function(e,t){return t.split(".").reduce(function(e,t){return void 0===e||null===e?e:e[t]},e)},hasPropertyPath:function(e,t){if(!t)return!1;for(var n=t.split("."),i=0;i<n.length;i++){var r=n[i];if(!e||!e.hasOwnProperty(r))return!1;e=e[r]}return!0},defer:function(){var e=void 0,t=void 0,n=new Promise(function(n,i){e=n,t=i});return n.resolve=e,n.reject=t,n},bind:function(e,t){return function(){t.apply(e,arguments)}}},l={uniqueId:function(e){var t=2+(!e||e<0?0:e-2);return"_"+Math.random().toString(36).substr(2,t)},guid:function(){var e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}},c={addClassName:function(e,t){e.classList?e.classList.add(t):c.hasClassName(e,t)||(e.className+=t)},removeClassName:function(e,t){e.classList?e.classList.remove(t):c.hasClassName(e,t)&&(e.className=e.className.replace(new RegExp("(\\s|^)"+t+"(\\s|$)")," ").replace(/^\s+|\s+$/g,""))},hasClassName:function(e,t){return e.className&&new RegExp("(^|\\s)"+t+"(\\s|$)").test(e.className)},setAttribute:function(e,t,n){e.setAttribute(t,n)},removeAttribute:function(e,t){e.removeAttribute(t)},setStyle:function(e,t,n){void 0!==e.style.getPropertyValue(t)&&e.style.setProperty(t,n)},appendChild:function(e,t){e&&t&&e.appendChild&&e.appendChild(t)},removeChild:function(e,t){e&&t&&e.removeChild&&e.removeChild(t)},prependTo:function(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)},getElementById:function(e){return document.getElementById(e)},createElement:function(e){return document.createElement(e)},loadScriptAsync:function(e){var t=this;return new Promise(function(n,i){var r=!1,a=document.getElementsByTagName("script")[0],o=t.createElement("script");o.type="text/javascript",o.src=e,o.async=!0,o.onload=o.onreadystatechange=function(){r||this.readyState&&"complete"!==this.readyState||(r=!0,n(this))},o.onerror=o.onabort=i,a&&a.parentNode&&a.parentNode.insertBefore(o,a)})}},d={execute:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"POST",i=arguments[3],r=new XMLHttpRequest;return new Promise(function(a,o){r.onreadystatechange=function(){if(4===r.readyState)if(200===r.status){var e=JSON.parse(r.responseText);a(e)}else o(r.responseText)},r.open(n,e),i&&i.forEach(function(e,t){r.setRequestHeader(t,e)}),r.send(t)})}};t.Number=o,t.String=s,t.Object=u,t.Generator=l,t.Dom=c,t.Http=d},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=function(e){return e&&e.__esModule?e:{default:e}}(r),o=n(38),s=n(39),u=n(40),l=function e(t,n,a){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};i(this,e),this.severity=t,this.category=n,this.code=a,this.data=o,(0,r.getLogLevel)("Error")!==r.LogLevel.OFF&&e._logger.error("Category:"+n+" | Code:"+a+" |",o)};l.Severity=o.Severity,l.Category=u.Category,l.Code=s.Code,l._logger=(0,a.default)("Error"),t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CustomEventType=t.Html5EventType=t.EventType=void 0;var i=n(2),r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(i),a={ABORT:"abort",CAN_PLAY:"canplay",CAN_PLAY_THROUGH:"canplaythrough",DURATION_CHANGE:"durationchange",EMPTIED:"emptied",ENDED:"ended",ERROR:"error",LOADED_DATA:"loadeddata",LOADED_METADATA:"loadedmetadata",LOAD_START:"loadstart",PAUSE:"pause",PLAY:"play",PLAYING:"playing",PROGRESS:"progress",RATE_CHANGE:"ratechange",SEEKED:"seeked",SEEKING:"seeking",STALLED:"stalled",SUSPEND:"suspend",TIME_UPDATE:"timeupdate",VOLUME_CHANGE:"volumechange",WAITING:"waiting"},o={ENTER_FULLSCREEN:"enterfullscreen",EXIT_FULLSCREEN:"exitfullscreen",REQUESTED_ENTER_FULLSCREEN:"requestedenterfullscreen",REQUESTED_EXIT_FULLSCREEN:"requestedexitfullscreen",AUTOPLAY_FAILED:"autoplayfailed",FALLBACK_TO_MUTED_AUTOPLAY:"fallbacktomutedautoplay",CHANGE_SOURCE_STARTED:"changesourcestarted",CHANGE_SOURCE_ENDED:"changesourceended",MUTE_CHANGE:"mutechange",VIDEO_TRACK_CHANGED:"videotrackchanged",AUDIO_TRACK_CHANGED:"audiotrackchanged",TEXT_TRACK_CHANGED:"texttrackchanged",TEXT_CUE_CHANGED:"textcuechanged",TRACKS_CHANGED:"trackschanged",ABR_MODE_CHANGED:"abrmodechanged",PLAYER_STATE_CHANGED:"playerstatechanged",FIRST_PLAY:"firstplay",SOURCE_SELECTED:"sourceselected",TEXT_STYLE_CHANGED:"textstylechanged",AD_LOADED:"adloaded",AD_STARTED:"adstarted",AD_RESUMED:"adresumed",AD_PAUSED:"adpaused",AD_CLICKED:"adclicked",AD_SKIPPED:"adskipped",AD_COMPLETED:"adcompleted",AD_ERROR:"aderror",ALL_ADS_COMPLETED:"alladscompleted",AD_BREAK_START:"adbreakstart",AD_BREAK_END:"adbreakend",AD_FIRST_QUARTILE:"adfirstquartile",AD_MIDPOINT:"admidpoint",AD_THIRD_QUARTILE:"adthirdquartile",USER_CLOSED_AD:"userclosedad",AD_VOLUME_CHANGED:"advolumechanged",AD_MUTED:"admuted",AD_PROGRESS:"adprogress"},s=r.Object.merge([a,o]);t.EventType=s,t.Html5EventType=a,t.CustomEventType=o},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=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),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e),this._id=t.id,this._active=t.active,this._label=t.label,this._language=t.language,this._index=t.index}return r(e,[{key:"id",get:function(){return this._id}},{key:"active",get:function(){return this._active},set:function(e){this._active=e}},{key:"label",get:function(){return this._label}},{key:"language",get:function(){return this._language}},{key:"index",get:function(){return this._index}}],[{key:"langComparer",value:function(e,t){try{return e=e.toLowerCase(),t=t.toLowerCase(),!!e&&(e.startsWith(t)||t.startsWith(e))}catch(e){return!1}}}]),e}();t.default=a},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=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),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(13),s=i(o),u=n(1),l=(i(u),function(){function e(){r(this,e),this._bindingMap=new s.default}return a(e,[{key:"destroy",value:function(){return this.removeAll(),this._bindingMap=null,Promise.resolve()}},{key:"listenOnce",value:function(e,t,n){var i=this,r=function r(a){i.unlisten(e,t,r),n.call(i,a)};this.listen(e,t,r)}},{key:"listen",value:function(e,t,n){var i=new c(e,t,n);this._bindingMap&&this._bindingMap.push(t,i)}},{key:"unlisten",value:function(e,t,n){if(this._bindingMap)for(var i=this._bindingMap.get(t),r=0;r<i.length;++r){var a=i[r];a.target!==e||a.listener!==n&&n||(a.unlisten(),this._bindingMap&&this._bindingMap.remove(t,a))}}},{key:"removeAll",value:function(){if(this._bindingMap){var e=this._bindingMap.getAll(),t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.unlisten()}}catch(e){n=!0,i=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw i}}this._bindingMap&&this._bindingMap.clear()}}}]),e}()),c=function(){function e(t,n,i){r(this,e),this.target=t,this.type=n,this.listener=i,this.target.addEventListener(n,i,!1)}return a(e,[{key:"unlisten",value:function(){this.target&&(this.target.removeEventListener(this.type,this.listener,!1),this.target=null,this.listener=null)}}]),e}();t.default=l},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(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 a(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)}Object.defineProperty(t,"__esModule",{value:!0});var o=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),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=n(5),u=function(e){return e&&e.__esModule?e:{default:e}}(s),l=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,t);var n=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n._bandwidth=e.bandwidth,n._width=e.width,n._height=e.height,n}return a(t,e),o(t,[{key:"bandwidth",get:function(){return this._bandwidth}},{key:"width",get:function(){return this._width}},{key:"height",get:function(){return this._height}}]),t}(u.default);t.default=l},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(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 a(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)}Object.defineProperty(t,"__esModule",{value:!0});var o=n(5),s=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(e){function t(){return i(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),t}(s.default);t.default=u},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(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 a(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)}Object.defineProperty(t,"__esModule",{value:!0}),t.TextTrack=void 0;var o=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),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=n(5),u=function(e){return e&&e.__esModule?e:{default:e}}(s),l=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,t);var n=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n._kind=e.kind,n}return a(t,e),o(t,[{key:"kind",get:function(){return this._kind}}]),t}(u.default);t.default=l,t.TextTrack=l},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}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 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)}Object.defineProperty(t,"__esModule",{value:!0});var s="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},u=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),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),l=n(11),c=i(l),d=n(6),f=i(d),A=n(33),h=i(A),_=n(1),p=i(_),v=n(12),y=i(v),g=n(4),E=n(2),m=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(E),T=n(34),b=i(T),k=n(0),w=i(k),S=n(36),O=i(S),C=n(23),R=i(C),D=n(14),L=(i(D),n(47)),P=i(L),N=n(5),M=i(N),I=n(7),x=i(I),U=n(8),j=i(U),H=n(9),G=i(H),B=n(24),F=i(B),V=(n(21),n(22)),Y=n(15),W=n(25),K=n(26),X=n(27),z=n(28),Q=n(29),q=n(49),Z=i(q),J=n(51),$=i(J);n(52);var ee=n(3),te=i(ee),ne=[.5,1,2,4],ie="off",re=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n._activeTextCues=[],n._textDisplaySettings={},n._playbackAttributesState={muted:void 0,volume:void 0,rate:void 0,audioLanguage:"",textLanguage:""},n._env=c.default,n._tracks=[],n._firstPlay=!0,n._fullscreen=!1,n._firstPlayInCurrentSession=!0,n._config=t._defaultConfig,n._eventManager=new f.default,n._posterManager=new h.default,n._stateManager=new P.default(n),n._pluginManager=new R.default,n._playbackMiddleware=new Z.default,n._textStyle=new F.default,n._createReadyPromise(),n._createPlayerContainer(),n._appendPosterEl(),n.configure(e),n._repositionCuesTimeout=!1,n._loadingMedia=!1,n._loading=!1,n}return o(t,e),u(t,null,[{key:"runCapabilities",value:function(){t._logger.debug("Running player capabilities"),t._engines.forEach(function(e){return e.runCapabilities()})}},{key:"getCapabilities",value:function(e){if(t._logger.debug("Get player capabilities",e),t._playerCapabilities)return e?Promise.resolve(t._playerCapabilities[e]):Promise.resolve(t._playerCapabilities);var n=[];return t._engines.forEach(function(e){return n.push(e.getCapabilities())}),Promise.all(n).then(function(n){return t._playerCapabilities={},n.forEach(function(e){return Object.assign(t._playerCapabilities,e)}),e?Promise.resolve(t._playerCapabilities[e]):Promise.resolve(t._playerCapabilities)})}},{key:"_prepareVideoElement",value:function(){t._engines.forEach(function(e){e.prepareVideoElement()})}}]),u(t,[{key:"configure",value:function(e){if(e.logLevel&&k.LogLevel[e.logLevel]&&(0,k.setLogLevel)(k.LogLevel[e.logLevel]),m.Object.mergeDeep(this._config,e),this._configureOrLoadPlugins(e.plugins),this._hasSources(e.sources)){var n=!!this._engine;n&&(this._reset(),t._logger.debug("Change source started"),this.dispatchEvent(new p.default(g.CustomEventType.CHANGE_SOURCE_STARTED))),this._selectEngineByPriority()&&(this._appendEngineEl(),this._attachMedia(),this._handlePlaybackOptions(),this._posterManager.setSrc(this._config.metadata.poster),this._handleAutoPlay(),n&&(t._logger.debug("Change source ended"),this.dispatchEvent(new p.default(g.CustomEventType.CHANGE_SOURCE_ENDED))))}}},{key:"ready",value:function(){return this._readyPromise?this._readyPromise:Promise.resolve()}},{key:"load",value:function(){var e=this;if(this._engine&&!this.src&&!this._loading){this._loading=!0;var t=this._config.playback.startTime;this._engine.load(t).then(function(t){e._updateTracks(t.tracks),e._setDefaultTracks(),e.dispatchEvent(new p.default(g.CustomEventType.TRACKS_CHANGED,{tracks:e._tracks}))}).catch(function(t){e.dispatchEvent(new p.default(g.Html5EventType.ERROR,t))}).finally(function(){e._loading=!1})}}},{key:"play",value:function(){var e=this;this._engine?this._playbackMiddleware.play(function(){return e._play()}):this._loadingMedia?(t._prepareVideoElement(),this._playbackMiddleware.play(function(){return e._playAfterAsyncMiddleware()})):this.dispatchEvent(new p.default(g.Html5EventType.ERROR,new te.default(te.default.Severity.CRITICAL,te.default.Category.PLAYER,te.default.Code.NO_SOURCE_PROVIDED,"No Source Provided")))}},{key:"pause",value:function(){this._engine&&this._playbackMiddleware.pause(this._pause.bind(this))}},{key:"getView",value:function(){return this._el}},{key:"getVideoElement",value:function(){if(this._engine)return this._engine.getVideoElement()}},{key:"destroy",value:function(){this._engine&&this._engine.destroy(),this._posterManager.destroy(),this._eventManager.destroy(),this._pluginManager.destroy(),this._stateManager.destroy(),this._activeTextCues=[],this._textDisplaySettings={},this._config={},this._tracks=[],this._engineType="",this._streamType="",this._readyPromise=null,this._firstPlay=!0,this._playbackAttributesState={},this._el&&m.Dom.removeChild(this._el.parentNode,this._el)}},{key:"isLive",value:function(){return!!(this._config.type===z.MediaType.LIVE||this._engine&&this._engine.isLive())}},{key:"isDvr",value:function(){return this.isLive()&&this._config.dvr}},{key:"seekToLiveEdge",value:function(){this._engine&&this.isLive()&&this._engine.seekToLiveEdge()}},{key:"getStartTimeOfDvrWindow",value:function(){return this._engine?this._engine.getStartTimeOfDvrWindow():0}},{key:"getTracks",value:function(e){return this._getTracksByType(e)}},{key:"getActiveTracks",value:function(){return{video:this._getTracksByType(W.TrackType.VIDEO).find(function(e){return e.active}),audio:this._getTracksByType(W.TrackType.AUDIO).find(function(e){return e.active}),text:this._getTracksByType(W.TrackType.TEXT).find(function(e){return e.active})}}},{key:"selectTrack",value:function(e){this._engine&&(e instanceof x.default?this._engine.selectVideoTrack(e):e instanceof j.default?this._engine.selectAudioTrack(e):e instanceof G.default&&(e.language===ie?(this.hideTextTrack(),this._playbackAttributesState.textLanguage=ie):this._engine.selectTextTrack(e)))}},{key:"hideTextTrack",value:function(){if(this._engine){this._engine.hideTextTrack(),this._updateTextDisplay([]);var e=this._getTracksByType(W.TrackType.TEXT);e.map(function(e){return e.active=!1});var t=e.find(function(e){return e.language===ie});t&&(t.active=!0,this.dispatchEvent(new p.default(g.CustomEventType.TEXT_TRACK_CHANGED,{selectedTextTrack:t})))}}},{key:"enableAdaptiveBitrate",value:function(){this._engine&&this._engine.enableAdaptiveBitrate()}},{key:"isAdaptiveBitrateEnabled",value:function(){return!!this._engine&&this._engine.isAdaptiveBitrateEnabled()}},{key:"setTextDisplaySettings",value:function(e){this._textDisplaySettings=e,this._updateCueDisplaySettings();for(var t=0;t<this._activeTextCues.length;t++)this._activeTextCues[t].hasBeenReset=!0;this._updateTextDisplay(this._activeTextCues)}},{key:"skipAd",value:function(){var e=this._pluginManager.get("ima");e&&"function"==typeof e.skipAd&&e.skipAd()}},{key:"playAdNow",value:function(e){var t=this._pluginManager.get("ima");t&&"function"==typeof t.playAdNow&&t.playAdNow(e)}},{key:"isFullscreen",value:function(){return this._fullscreen}},{key:"notifyEnterFullscreen",value:function(){this._fullscreen||(this._fullscreen=!0,this.dispatchEvent(new p.default(g.CustomEventType.ENTER_FULLSCREEN)))}},{key:"notifyExitFullscreen",value:function(){this._fullscreen&&(this._fullscreen=!1,this.dispatchEvent(new p.default(g.CustomEventType.EXIT_FULLSCREEN)))}},{key:"enterFullscreen",value:function(){this._fullscreen||this.dispatchEvent(new p.default(g.CustomEventType.REQUESTED_ENTER_FULLSCREEN))}},{key:"exitFullscreen",value:function(){this._fullscreen&&this.dispatchEvent(new p.default(g.CustomEventType.REQUESTED_EXIT_FULLSCREEN))}},{key:"getLogLevel",value:function(e){return(0,k.getLogLevel)(e)}},{key:"setLogLevel",value:function(e,t){(0,k.setLogLevel)(e,t)}},{key:"_hasSources",value:function(e){return!!e&&!!Object.keys(e).find(function(t){return e[t].length>0})}},{key:"_createPlayerContainer",value:function(){var e=this._el=m.Dom.createElement("div");m.Dom.addClassName(e,"playkit-container"),this._playerId=m.Generator.uniqueId(5),m.Dom.setAttribute(e,"id",this._playerId),m.Dom.setAttribute(e,"tabindex","-1")}},{key:"_appendPosterEl",value:function(){if(this._el){var e=this._posterManager.getElement();m.Dom.addClassName(e,"playkit-poster"),m.Dom.appendChild(this._el,e)}}},{key:"_appendEngineEl",value:function(){if(this._el&&this._engine){var e=this._engine.getVideoElement();m.Dom.addClassName(e,"playkit-engine");var t="playkit-engine-"+this._engine.id;m.Dom.addClassName(e,t),m.Dom.prependTo(e,this._el)}}},{key:"_configureOrLoadPlugins",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t&&Object.keys(t).forEach(function(n){var i=e._pluginManager.get(n);if(i)i.updateConfig(t[n]),e._config.plugins[n]=i.getConfig();else if(e._engine)delete e._config.plugins[n];else{e._pluginManager.load(n,e,t[n]);var r=e._pluginManager.get(n);r&&(e._config.plugins[n]=r.getConfig(),"function"==typeof r.getMiddlewareImpl&&e._playbackMiddleware.use(r.getMiddlewareImpl()))}})}},{key:"_createReadyPromise",value:function(){var e=this;this._readyPromise=new Promise(function(t,n){e._eventManager.listenOnce(e,g.CustomEventType.TRACKS_CHANGED,t),e._eventManager.listen(e,g.Html5EventType.ERROR,n)}).catch(function(){})}},{key:"_selectEngineByPriority",value:function(){var e=this,n=this._config.playback.streamPriority,i=this._config.playback.preferNative,r=this._config.sources,a=!0,o=!1,u=void 0;try{for(var l,c=n[Symbol.iterator]();!(a=(l=c.next()).done);a=!0){var d=function(){var n=l.value,a="string"==typeof n.engine?n.engine.toLowerCase():"",o="string"==typeof n.format?n.format.toLowerCase():"",s=t._engines.find(function(e){return e.id===a});if(s){var u=r[o];if(u&&u.length>0){var c=u[0];if(s.canPlaySource(c,i[o]))return t._logger.debug("Source selected: ",u),e._loadEngine(s,c),e._engineType=a,e._streamType=o,e.dispatchEvent(new p.default(g.CustomEventType.SOURCE_SELECTED,{selectedSource:u})),{v:!0}}}}();if("object"===(void 0===d?"undefined":s(d)))return d.v}}catch(e){o=!0,u=e}finally{try{!a&&c.return&&c.return()}finally{if(o)throw u}}return t._logger.warn("No playable engines was found to play the given sources"),!1}},{key:"_loadEngine",value:function(e,t){this._engine?this._engine.id===e.id?this._engine.restore(t,this._config):(this._engine.destroy(),this._engine=e.createEngine(t,this._config)):this._engine=e.createEngine(t,this._config)}},{key:"_attachMedia",value:function(){var e=this;this._engine&&(Object.keys(g.Html5EventType).forEach(function(t){e._eventManager.listen(e._engine,g.Html5EventType[t],function(t){return e.dispatchEvent(t)})}),this._eventManager.listen(this._engine,g.Html5EventType.SEEKED,function(){var t=e._env.browser.name;"Edge"!==t&&"IE"!==t||e._removeTextCuePatch()}),this._eventManager.listen(this._engine,g.CustomEventType.VIDEO_TRACK_CHANGED,function(t){return e._markActiveTrack(t.payload.selectedVideoTrack),e.dispatchEvent(t)}),this._eventManager.listen(this._engine,g.CustomEventType.AUDIO_TRACK_CHANGED,function(t){return e.ready().then(function(){return e._playbackAttributesState.audioLanguage=t.payload.selectedAudioTrack.language}),e._markActiveTrack(t.payload.selectedAudioTrack),e.dispatchEvent(t)}),this._eventManager.listen(this._engine,g.CustomEventType.TEXT_TRACK_CHANGED,function(t){return e.ready().then(function(){return e._playbackAttributesState.textLanguage=t.payload.selectedTextTrack.language}),e._markActiveTrack(t.payload.selectedTextTrack),e.dispatchEvent(t)}),this._eventManager.listen(this._engine,g.CustomEventType.TRACKS_CHANGED,function(t){return e._onTracksChanged(t)}),this._eventManager.listen(this._engine,g.CustomEventType.TEXT_CUE_CHANGED,function(t){return e._onCueChange(t)}),this._eventManager.listen(this._engine,g.CustomEventType.ABR_MODE_CHANGED,function(t){return e.dispatchEvent(t)}),this._eventManager.listen(this._engine,g.CustomEventType.AUTOPLAY_FAILED,function(t){e.pause(),e.dispatchEvent(t)}),this._eventManager.listen(this,g.Html5EventType.PLAY,this._onPlay.bind(this)),this._eventManager.listen(this,g.Html5EventType.ENDED,this._onEnded.bind(this)),this._eventManager.listen(this,g.CustomEventType.MUTE_CHANGE,function(){e._playbackAttributesState.muted=e.muted}),this._eventManager.listen(this,g.Html5EventType.VOLUME_CHANGE,function(){e._playbackAttributesState.volume=e.volume}),this._eventManager.listen(this,g.Html5EventType.RATE_CHANGE,function(){e._playbackAttributesState.rate=e.playbackRate}),this._eventManager.listen(this,g.CustomEventType.ENTER_FULLSCREEN,function(){e._resetTextCuesAndReposition()}),this._eventManager.listen(this,g.CustomEventType.EXIT_FULLSCREEN,function(){e._resetTextCuesAndReposition()}))}},{key:"_resetTextCuesAndReposition",value:function(){var e=this;this._updateTextDisplay([]);for(var t=0;t<this._activeTextCues.length;t++)this._activeTextCues[t].hasBeenReset=!0;this._repositionCuesTimeout&&clearTimeout(this._repositionCuesTimeout),this._repositionCuesTimeout=setTimeout(function(){(0,V.processCues)(window,e._activeTextCues,e._textDisplayEl),e._repositionCuesTimeout=!1},1e3)}},{key:"_removeTextCuePatch",value:function(){var e=this,t=this._activeTextCues.filter(function(t){var n=t._endTime,i=t._startTime,r=e.currentTime;if(r<n&&r>i)return t});this._updateTextDisplay(t)}},{key:"_handlePlaybackOptions",value:function(){this._config.playback=this._config.playback||{},"boolean"==typeof this._playbackAttributesState.muted?this.muted=this._playbackAttributesState.muted:"boolean"==typeof this._config.playback.muted&&(this.muted=this._config.playback.muted),"number"==typeof this._playbackAttributesState.volume?this.volume=this._playbackAttributesState.volume:"number"==typeof this._config.playback.volume&&(this.volume=this._config.playback.volume),"boolean"==typeof this._config.playback.playsinline&&(this.playsinline=this._config.playback.playsinline),this._canPreload()&&this.load()}},{key:"_canPreload",value:function(){return!this._config.playback.autoplay&&"auto"===this._config.playback.preload&&(!this._config.plugins||this._config.plugins&&!this._config.plugins.ima)}},{key:"_handleAutoPlay",value:function(){var e=this;if(!0===this._config.playback.autoplay)if(this.muted||!this._firstPlayInCurrentSession)this.play();else{var n=this._config.playback.allowMutedAutoPlay;t.getCapabilities(this.engineType).then(function(i){i.autoplay?(t._logger.debug("Start autoplay"),e.play()):n&&i.mutedAutoPlay?(t._logger.debug("Fallback to muted autoplay"),e.muted=!0,e.play(),e.dispatchEvent(new p.default(g.CustomEventType.FALLBACK_TO_MUTED_AUTOPLAY))):(t._logger.warn("Autoplay failed, pause player"),e._posterManager.show(),e.load(),e.ready().then(function(){return e.pause()}),e.dispatchEvent(new p.default(g.CustomEventType.AUTOPLAY_FAILED)))})}else this._posterManager.show()}},{key:"_playAfterAsyncMiddleware",value:function(){var e=this;this._engine?this._play():this._eventManager.listenOnce(this,g.CustomEventType.SOURCE_SELECTED,function(){return e._play()})}},{key:"_play",value:function(){var e=this;this._engine.src?(this.isLive()&&!this.isDvr()&&this.seekToLiveEdge(),this._engine.play()):(this.load(),this.ready().then(function(){e._engine.play()}).catch(function(t){e.dispatchEvent(new p.default(g.Html5EventType.ERROR,t))}))}},{key:"_pause",value:function(){this._engine.pause()}},{key:"_onPlay",value:function(){this._firstPlay&&(this._firstPlay=!1,this.dispatchEvent(new p.default(g.CustomEventType.FIRST_PLAY)),this._posterManager.hide(),"number"==typeof this._playbackAttributesState.rate&&(this.playbackRate=this._playbackAttributesState.rate))}},{key:"_onEnded",value:function(){this.paused||this._pause()}},{key:"_reset",value:function(){this.pause(),this._eventManager.removeAll(),this._createReadyPromise(),this._activeTextCues=[],this._updateTextDisplay([]),this._tracks=[],this._loading=!1,this._firstPlay=!0,this._firstPlayInCurrentSession=!1,this._loadingMedia=!1,this._engineType="",this._streamType="",this._posterManager.reset(),this._stateManager.reset(),this._pluginManager.reset()}},{key:"_onTracksChanged",value:function(e){this._updateTracks(e.payload.tracks),this.dispatchEvent(e)}},{key:"_updateTracks",value:function(e){t._logger.debug("Tracks changed",e),this._tracks=e,this._addTextTrackOffOption()}},{key:"_getTracksByType",value:function(e){return e?this._tracks.filter(function(t){return e===W.TrackType.VIDEO?t instanceof x.default:e===W.TrackType.AUDIO?t instanceof j.default:e!==W.TrackType.TEXT||t instanceof G.default}):this._tracks}},{key:"_markActiveTrack",value:function(e){var t=void 0;if(e instanceof x.default?t=W.TrackType.VIDEO:e instanceof j.default?t=W.TrackType.AUDIO:e instanceof G.default&&(t=W.TrackType.TEXT),t)for(var n=this.getTracks(t),i=0;i<n.length;i++)n[i].active=e.index===i}},{key:"_onCueChange",value:function(e){t._logger.debug("Text cue changed",e.payload.cues),this._activeTextCues=e.payload.cues,this._updateCueDisplaySettings(),this._updateTextDisplay(this._activeTextCues)}},{key:"_updateCueDisplaySettings",value:function(){for(var e=this._activeTextCues,t=this._textDisplaySettings,n=0;n<e.length;n++){var i=e[n];for(var r in t)i[r]=t[r]}}},{key:"_updateTextDisplay",value:function(e){void 0===this._textDisplayEl&&(this._textDisplayEl=m.Dom.createElement("div"),m.Dom.addClassName(this._textDisplayEl,"playkit-subtitles"),m.Dom.appendChild(this._el,this._textDisplayEl)),(0,V.processCues)(window,e,this._textDisplayEl)}},{key:"_addTextTrackOffOption",value:function(){var e=this.getTracks(W.TrackType.TEXT);e&&e.length&&this._tracks.push(new G.default({active:!1,index:e.length,kind:"subtitles",label:"Off",language:ie}))}},{key:"_setDefaultTracks",value:function(){var e=this.getActiveTracks(),t=this.config.playback,n=this._getTracksByType(W.TrackType.TEXT).find(function(e){return G.default.langComparer(ie,e.language)});this.hideTextTrack();var i=this._playbackAttributesState.textLanguage||this._getLanguage(t.textLanguage,e.text,W.TrackType.TEXT),r=this._playbackAttributesState.audioLanguage||t.audioLanguage;this._setDefaultTrack(W.TrackType.TEXT,i,n),this._setDefaultTrack(W.TrackType.AUDIO,r,e.audio)}},{key:"_getLanguage",value:function(e,t,n){var i=e;if("auto"===i){var r=this._getTracksByType(n),a=r.find(function(e){return M.default.langComparer(b.default.language,e.language)});a?i=a.language:t&&t.language!==ie?i=t.language:r&&r.length>0&&(i=r[0].language)}return i}},{key:"_setDefaultTrack",value:function(e,t,n){var i=this._getTracksByType(e).find(function(e){return M.default.langComparer(t,e.language)});i?this.selectTrack(i):this.selectTrack(n)}},{key:"buffered",get:function(){if(this._engine)return this._engine.buffered}},{key:"currentTime",set:function(e){if(this._engine&&m.Number.isNumber(e)){var t=e;e<0&&(t=0),t>this._engine.duration-.1&&(t=this._engine.duration-.1),this._engine.currentTime=t}},get:function(){if(this._engine)return this._engine.currentTime}},{key:"duration",get:function(){if(this._engine)return this._engine.duration}},{key:"volume",set:function(e){if(this._engine&&(m.Number.isFloat(e)||0===e||1===e)){var t=e;t<0&&(t=0),t>1&&(t=1),this._engine.volume=t}},get:function(){if(this._engine)return this._engine.volume}},{key:"paused",get:function(){if(this._engine)return this._engine.paused}},{key:"seeking",get:function(){if(this._engine)return this._engine.seeking}},{key:"playsinline",set:function(e){this._engine&&(this._engine.playsinline=e)},get:function(){if(this._engine)return this._engine.playsinline}},{key:"muted",set:function(e){this._engine&&(this._engine.muted=e,this.dispatchEvent(new p.default(g.CustomEventType.MUTE_CHANGE,{mute:e})))},get:function(){if(this._engine)return this._engine.muted}},{key:"src",get:function(){if(this._engine)return this._engine.src}},{key:"dimensions",get:function(){return{width:this._el.clientWidth,height:this._el.clientHeight}}},{key:"poster",get:function(){return this._posterManager.src}},{key:"playbackRate",set:function(e){this._engine&&(this._engine.playbackRate=e)},get:function(){if(this._engine)return this._engine.playbackRate}},{key:"playbackRates",get:function(){return ne}},{key:"defaultPlaybackRate",get:function(){return 1}},{key:"engineType",get:function(){return this._engineType}},{key:"streamType",get:function(){return this._streamType}},{key:"env",get:function(){return this._env}},{key:"config",get:function(){return m.Object.mergeDeep({},this._config)}},{key:"sessionId",set:function(e){this._config.session=this._config.session||{},this._config.session.id=e}},{key:"loadingMedia",set:function(e){this._loadingMedia=e}},{key:"textStyle",set:function(e){if(!(e instanceof F.default))throw new Error("Style must be instance of TextStyle");var n=m.Dom.getElementById("playkit-subtitles-style");n||(n=m.Dom.createElement("style"),m.Dom.setAttribute(n,"id","playkit-subtitles-style"),m.Dom.appendChild(document.head,n));for(var i=n.sheet;i.cssRules.length;)i.deleteRule(0);try{this._config.playback.useNativeTextTrack?i.insertRule("video.playkit-engine::cue { "+e.toCSS()+" }",0):i.insertRule("#"+this._playerId+" .playkit-subtitles > div > div > div { "+e.toCSS()+" }",0),this._textStyle=e,this.dispatchEvent(new p.default(g.CustomEventType.TEXT_STYLE_CHANGED))}catch(e){t._logger.error(e.message)}},get:function(){return this._textStyle.clone()}},{key:"Event",get:function(){return g.EventType}},{key:"TextStyle",get:function(){return F.default}},{key:"State",get:function(){return Y.StateType}},{key:"Track",get:function(){return W.TrackType}},{key:"LogLevelType",get:function(){return k.LogLevelType}},{key:"LogLevel",get:function(){return k.LogLevel}},{key:"AbrMode",get:function(){return Q.AbrMode}},{key:"MediaType",get:function(){return z.MediaType}},{key:"StreamType",get:function(){return K.StreamType}},{key:"EngineType",get:function(){return X.EngineType}}],[{key:"_defaultConfig",get:function(){return m.Object.copyDeep($.default)}}]),t}(y.default);re._logger=(0,w.default)("Player"),re._engines=[O.default],t.default=re},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(31),r=function(e){return e&&e.__esModule?e:{default:e}}(i),a=(new r.default).getResult();t.default=a},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=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),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(1),s=(i(o),n(13)),u=i(s),l=function(){function e(){r(this,e),this._listeners=new u.default,this.dispatchTarget=this}return a(e,[{key:"addEventListener",value:function(e,t){this._listeners.push(e,t)}},{key:"removeEventListener",value:function(e,t){this._listeners.remove(e,t)}},{key:"dispatchEvent",value:function(e){for(var t=this._listeners.get(e.type)||[],n=0;n<t.length;++n){e.target=this.dispatchTarget,e.currentTarget=this.dispatchTarget;var i=t[n];try{i.handleEvent?i.handleEvent(e):i.call(this,e)}catch(e){}if(e.stopped)break}return e.defaultPrevented}}]),e}();t.default=l},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=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),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=function(){function e(){i(this,e),this._map=new Map}return r(e,[{key:"push",value:function(e,t){if(this._map.has(e)){var n=this._map.get(e);Array.isArray(n)&&(n.push(t),this._map.set(e,n))}else this._map.set(e,[t])}},{key:"set",value:function(e,t){this._map.set(e,t)}},{key:"has",value:function(e){return this._map.has(e)}},{key:"get",value:function(e){var t=this._map.get(e);return t?t.slice():[]}},{key:"getAll",value:function(){var e=[],t=!0,n=!1,i=void 0;try{for(var r,a=this._map.values()[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var o=r.value;e=e.concat(o)}}catch(e){n=!0,i=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw i}}return e}},{key:"remove",value:function(e,t){if(this._map.has(e)){var n=this._map.get(e);if(Array.isArray(n))for(var i=0;i<n.length;++i)n[i]==t&&(n.splice(i,1),--i)}}},{key:"keys",value:function(){return this._map.keys()}},{key:"clear",value:function(){this._map.clear()}}]),e}();t.default=a},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=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),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(10),s=(i(o),n(0)),u=i(s),l=n(2),c=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(l),d=n(6),f=i(d),A=n(3),h=i(A),_=n(1),p=i(_),v=function(){function e(t,n,i){r(this,e),this.name=t,this.player=n,this.eventManager=new f.default,this.logger=(0,u.default)(c.String.capitlize(this.name)),this.config={},c.Object.mergeDeep(this.config,this.constructor.defaultConfig,i)}return a(e,null,[{key:"createPlugin",value:function(e,t){return new this(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}},{key:"isValid",value:function(){throw new h.default(h.default.Severity.CRITICAL,h.default.Category.PLAYER,h.default.Code.RUNTIME_ERROR_METHOD_NOT_IMPLEMENTED,"isValid()")}}]),a(e,[{key:"getConfig",value:function(e){return e?c.Object.copyDeep(this.config[e]):c.Object.copyDeep(this.config)}},{key:"updateConfig",value:function(e){c.Object.mergeDeep(this.config,e)}},{key:"destroy",value:function(){}},{key:"reset",value:function(){}},{key:"getName",value:function(){return this.name}},{key:"dispatchEvent",value:function(e,t){this.logger.debug("Fire event: "+e,t),this.player.dispatchEvent(new p.default(e,t))}}]),e}();v.defaultConfig={},t.default=v},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={IDLE:"idle",LOADING:"loading",PLAYING:"playing",PAUSED:"paused",BUFFERING:"buffering"};t.StateType=i},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=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),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=function(){function e(){i(this,e)}return r(e,[{key:"callNext",value:function(e){e&&e()}}]),e}();t.default=a},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.registerMediaSourceAdapter=void 0;var a=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),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(37),s=i(o),u=n(0),l=i(u),c=function(){function e(){r(this,e)}return a(e,null,[{key:"register",value:function(t){t&&(e._mediaSourceAdapters.includes(t)?e._logger.debug("Adapter <"+t.id+"> is already registered, do not register again"):(e._logger.debug("Adapter <"+t.id+"> has been registered successfully"),e._mediaSourceAdapters.push(t)))}},{key:"unRegister",value:function(t){var n=e._mediaSourceAdapters.indexOf(t);n>-1&&(e._logger.debug("Unregistered <"+t.id+"> adapter"),e._mediaSourceAdapters.splice(n,1))}},{key:"canPlaySource",value:function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e._orderMediaSourceAdapters(n);var i=e._mediaSourceAdapters;if(t&&t.mimetype)for(var r=0;r<i.length;r++)if(i[r].canPlayType(t.mimetype)&&(!t.drmData||i[r].canPlayDrm(t.drmData)))return e._selectedAdapter=i[r],e._logger.debug("Selected adapter is <"+e._selectedAdapter.id+">"),!0;return!1}},{key:"_orderMediaSourceAdapters",value:function(t){e._mediaSourceAdapters=e._mediaSourceAdapters.filter(function(e){return"NativeAdapter"!==e.id}),t?e._mediaSourceAdapters.unshift(s.default):e._mediaSourceAdapters.push(s.default)}},{key:"getMediaSourceAdapter",value:function(t,n,i){return t&&n&&i?(e._selectedAdapter||e.canPlaySource(n,!0),e._selectedAdapter?e._selectedAdapter.createAdapter(t,n,i):null):null}},{key:"destroy",value:function(){e._selectedAdapter=null}}]),e}();c._logger=(0,l.default)("MediaSourceProvider"),c._mediaSourceAdapters=[s.default],c._selectedAdapter=null,t.default=c;var d=c.register;t.registerMediaSourceAdapter=d},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}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 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)}Object.defineProperty(t,"__esModule",{value:!0});var s=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),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),u=n(1),l=i(u),c=n(12),d=i(c),f=n(3),A=i(f),h=n(4),_=n(0),p=i(_),v=n(5),y=(i(v),n(7)),g=i(y),E=n(8),m=i(E),T=n(9),b=i(T),k=function(e){function t(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r(this,t);var o=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return o._videoElement=e,o._sourceObj=n,o._config=i,o._handleLiveTimeUpdate(),o}return o(t,e),s(t,null,[{key:"isSupported",value:function(){return!0}}]),s(t,[{key:"destroy",value:function(){return this._sourceObj=null,this._config=null,Promise.resolve()}},{key:"_onTrackChanged",value:function(e){e instanceof g.default?this._trigger(h.CustomEventType.VIDEO_TRACK_CHANGED,{selectedVideoTrack:e}):e instanceof m.default?this._trigger(h.CustomEventType.AUDIO_TRACK_CHANGED,{selectedAudioTrack:e}):e instanceof b.default&&this._trigger(h.CustomEventType.TEXT_TRACK_CHANGED,{selectedTextTrack:e})}},{key:"_trigger",value:function(e,t){this.dispatchEvent(new l.default(e,t))}},{key:"load",value:function(){return t._throwNotImplementedError("load")}},{key:"selectVideoTrack",value:function(e){return t._throwNotImplementedError("selectVideoTrack")}},{key:"selectAudioTrack",value:function(e){t._throwNotImplementedError("selectAudioTrack")}},{key:"selectTextTrack",value:function(e){t._throwNotImplementedError("selectTextTrack")}},{key:"hideTextTrack",value:function(){t._throwNotImplementedError("hideTextTrack")}},{key:"enableAdaptiveBitrate",value:function(){t._throwNotImplementedError("enableAdaptiveBitrate")}},{key:"isAdaptiveBitrateEnabled",value:function(){return t._throwNotImplementedError("isAdaptiveBitrateEnabled")}},{key:"_getLiveEdge",value:function(){return t._throwNotImplementedError("_getLiveEdge")}},{key:"seekToLiveEdge",value:function(){t._throwNotImplementedError("seekToLiveEdge")}},{key:"isLive",value:function(){return t._throwNotImplementedError("isLive")}},{key:"_handleLiveTimeUpdate",value:function(){var e=this;this._videoElement.addEventListener(h.Html5EventType.DURATION_CHANGE,function(){e.isLive()&&e._videoElement.paused&&e._trigger(h.Html5EventType.TIME_UPDATE)})}},{key:"getStartTimeOfDvrWindow",value:function(){return t._throwNotImplementedError("getStartTimeOfDvrWindow")}},{key:"src",get:function(){return t._throwNotImplementedError("get src")}},{key:"currentTime",get:function(){return this.isLive()?this._videoElement.currentTime-this.getStartTimeOfDvrWindow():this._videoElement.currentTime},set:function(e){this.isLive()&&(e+=this.getStartTimeOfDvrWindow()),this._videoElement.currentTime=e}},{key:"duration",get:function(){return this.isLive()?this._getLiveEdge()-this.getStartTimeOfDvrWindow():this._videoElement.duration}}],[{key:"canPlayType",value:function(e,n){return t._throwNotImplementedError("static canPlayType")}},{key:"_throwNotImplementedError",value:function(e){throw new A.default(A.default.Severity.CRITICAL,A.default.Category.PLAYER,A.default.Code.RUNTIME_ERROR_METHOD_NOT_IMPLEMENTED,e)}}]),t}(d.default);k.getLogger=p.default,t.default=k},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=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),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(0),s=i(o),u=n(3),l=i(u),c=n(43),d=i(c),f=n(20),A=function(){function e(){r(this,e)}return a(e,null,[{key:"canPlayDrm",value:function(e){throw new l.default(l.default.Severity.CRITICAL,l.default.Category.PLAYER,l.default.Code.RUNTIME_ERROR_METHOD_NOT_IMPLEMENTED,"static canPlayDrm")}},{key:"setDrmPlayback",value:function(){throw new l.default(l.default.Severity.CRITICAL,l.default.Category.PLAYER,l.default.Code.RUNTIME_ERROR_METHOD_NOT_IMPLEMENTED,"static setDrmPlayback")}},{key:"destroy",value:function(){}}]),e}();A.getLogger=s.default,A.DrmSupport=d.default,A.DrmScheme=f.DrmScheme,t.default=A},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.DrmScheme={WIDEVINE:"com.widevine.alpha",PLAYREADY:"com.microsoft.playready",FAIRPLAY:"com.apple.fairplay"}},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e){return"string"==typeof e&&(!!u[e.toLowerCase()]&&e.toLowerCase())}function a(e){return"string"==typeof e&&(!!l[e.toLowerCase()]&&e.toLowerCase())}Object.defineProperty(t,"__esModule",{value:!0}),t.Cue=void 0;var o=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),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=n(22),u={"":!0,lr:!0,rl:!0},l={start:!0,middle:!0,end:!0,left:!0,right:!0},c=function(){function e(t,n,r){i(this,e),this.hasBeenReset=!1,this.displayState=void 0,this._id="",this._pauseOnExit=!1,this._region=null,this._vertical="",this._snapToLines=!0,this._line="auto",this._lineAlign="start",this._position=50,this._positionAlign="middle",this._size=50,this._align="middle",this._startTime=t,this._endTime=n,this._text=r}return o(e,[{key:"resetCue",value:function(){this.hasBeenReset=!0}},{key:"getCueAsHTML",value:function(){return(0,s.convertCueToDOMTree)(window,this.text)}},{key:"id",get:function(){return this._id},set:function(e){this._id=""+e}},{key:"pauseOnExit",get:function(){return this._pauseOnExit},set:function(e){this._pauseOnExit=e}},{key:"startTime",get:function(){return this._endTime},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");this._endTime=e,this.resetCue()}},{key:"endTime",get:function(){return this._endTime},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");this._endTime=e,this.resetCue()}},{key:"text",get:function(){return this._text},set:function(e){this._text=""+e,this.resetCue()}},{key:"region",get:function(){return this._region},set:function(e){this._region=e,this.resetCue()}},{key:"vertical",get:function(){return this._vertical},set:function(e){var t=r(e);if(!1===t)throw new SyntaxError("An invalid or illegal string was specified.");"string"==typeof t&&(this._vertical=t,this.resetCue())}},{key:"snapToLines",get:function(){return this._snapToLines},set:function(e){this._snapToLines=e,this.resetCue()}},{key:"line",get:function(){return this._line},set:function(e){if("number"!=typeof e&&"auto"!==e)throw new SyntaxError("An invalid number or illegal string was specified.");this._line=e,this.resetCue()}},{key:"lineAlign",get:function(){return this._lineAlign},set:function(e){var t=a(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");"string"==typeof t&&(this._lineAlign=t,this.resetCue())}},{key:"position",get:function(){return this._position},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");this._position=e,this.resetCue()}},{key:"positionAlign",get:function(){return this._positionAlign},set:function(e){var t=a(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");"string"==typeof t&&(this._positionAlign=t,this.resetCue())}},{key:"size",get:function(){return this._size},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");this._size=e,this.resetCue()}},{key:"align",get:function(){return this._align},set:function(e){var t=a(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");"string"==typeof t&&(this._align=t,this.resetCue())}}]),e}(),d=void 0;"undefined"!=typeof window&&window.VTTCue?t.Cue=d=window.VTTCue:t.Cue=d=c,t.Cue=d},function(e,t,n){"use strict";function i(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 r(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 a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){function t(e,t,n,i){return 3600*(0|e)+60*(0|t)+(0|n)+(0|i)/1e3}var n=e.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return n?n[3]?t(n[1],n[2],n[3].replace(":",""),n[4]):n[1]>59?t(n[1],n[2],0,n[4]):t(0,n[1],n[2],n[4]):null}function s(e,t){function n(e){return p[e]}for(var i=e.document.createElement("div"),r=i,a=void 0,s=[];null!==(a=function(){if(!t)return null;var e=t.match(/^([^<]*)(<[^>]+>?)?/);return function(e){return t=t.substr(e.length),e}(e[1]?e[1]:e[2])}());)if("<"!==a[0])r.appendChild(e.document.createTextNode(function(e){for(var t=void 0;t=e.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)e=e.replace(t[0],n);return e}(a)));else{if("/"===a[1]){s.length&&s[s.length-1]===a.substr(2).replace(">","")&&(s.pop(),r=r.parentNode);continue}var u=o(a.substr(1,a.length-2)),l=void 0;if(u){l=e.document.createProcessingInstruction("timestamp",u),r.appendChild(l);continue}var c=a.match(/^<([^.\s\/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!c)continue;if(!(l=function(t,n){var i=v[t];if(!i)return null;var r=e.document.createElement(i);r.localName=i;var a=y[t];return a&&n&&(r[a]=n.trim()),r}(c[1],c[3])))continue;if(!function(e,t){return!g[t.localName]||g[t.localName]===e.localName}(r,l))continue;c[2]&&(l.className=c[2].substr(1).replace("."," ")),s.push(c[1]),r.appendChild(l),r=l}return i}function u(e){for(var t=0;t<E.length;t++){var n=E[t];if(e>=n[0]&&e<=n[1])return!0}return!1}function l(e){function t(e,t){for(var n=t.childNodes.length-1;n>=0;n--)e.push(t.childNodes[n])}function n(e){if(!e||!e.length)return null;var i=e.pop(),r=i.textContent||i.innerText;if(r){var a=r.match(/^.*(\n|\r)/);return a?(e.length=0,a[0]):r}return"ruby"===i.tagName?n(e):i.childNodes?(t(e,i),n(e)):void 0}var i=[],r="",a=void 0;if(!e||!e.childNodes)return"ltr";for(t(i,e);r=n(i);)for(var o=0;o<r.length;o++)if(a=r.charCodeAt(o),u(a))return"rtl";return"ltr"}function c(e){if("number"==typeof e.line&&(e.snapToLines||e.line>=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,n=t.textTrackList,i=0,r=0;r<n.length&&n[r]!==t;r++)"showing"===n[r].mode&&i++;return-1*++i}function d(e,t,n){var i=new b(e),r=e.cue,a=c(r),o=[];if(r.snapToLines){var s=void 0;switch(r.vertical){case"":o=["+y","-y"],s="height";break;case"rl":o=["+x","-x"],s="width";break;case"lr":o=["-x","+x"],s="width"}var u=i.lineHeight,l=u*Math.round(a),d=t[s]+u,f=o[0];Math.abs(l)>d&&(l=l<0?-1:1,l*=Math.ceil(d/u)*u),a<0&&(l+=""===r.vertical?t.height:t.width,o=o.reverse()),i.move(f,l)}else{var A=i.lineHeight/t.height*100;switch(r.lineAlign){case"middle":a-=A/2;break;case"end":a-=A}switch(r.vertical){case"":e.applyStyles({top:e.formatStyle(a,"%")});break;case"rl":e.applyStyles({left:e.formatStyle(a,"%")});break;case"lr":e.applyStyles({right:e.formatStyle(a,"%")})}o=["+y","-x","+x","-y"],i=new b(e)}var h=function(e,i){for(var r=void 0,a=new b(e),o=1,s=0;s<i.length;s++){for(;e.overlapsOppositeAxis(t,i[s])||e.within(t)&&e.overlapsAny(n);)e.move(i[s]);if(e.within(t))return e;var u=e.intersectPercentage(t);o>u&&(r=new b(e),o=u),e=new b(a)}return r||a}(i,o);e.move(h.toCSSCompatValues(t))}function f(e,t){return e&&t?s(e,t):null}function A(e,t,n){if(!e||!t||!n)return null;for(;n.firstChild;)n.removeChild(n.firstChild);var i=e.document.createElement("div");if(i.style.position="absolute",i.style.left="0",i.style.right="0",i.style.top="0",i.style.bottom="0",i.style.margin=S,n.appendChild(i),function(e){for(var t=0;t<e.length;t++)if(e[t].hasBeenReset||!e[t].displayState)return!0;return!1}(t)){var r=[],a=b.getSimpleBoxPosition(i),o=Math.round(a.height*k*100)/100,s={font:o*_+"px "+w};!function(){for(var n=void 0,o=void 0,u=0;u<t.length;u++)o=t[u],n=new T(e,o,s),i.appendChild(n.div),d(n,a,r),o.displayState=n.div,r.push(b.getSimpleBoxPosition(n))}()}else for(var u=0;u<t.length;u++)i.appendChild(t[u].displayState)}Object.defineProperty(t,"__esModule",{value:!0});var h=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),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),_=1,p={"&":"&","<":"<",">":">","‎":"","‏":""," ":" "},v={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},y={v:"title",lang:"lang"},g={rt:"ruby"},E=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]],m=function(){function e(){a(this,e)}return h(e,[{key:"applyStyles",value:function(e,t){t=t||this.div;for(var n in e)e.hasOwnProperty(n)&&(t.style[n]=e[n])}},{key:"formatStyle",value:function(e,t){return 0===e?0:e+t}}]),e}(),T=function(e){function t(e,n,r){a(this,t);var o=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),u="undefined"!=typeof navigator&&/MSIE\s8\.0/.test(navigator.userAgent),c="rgba(255, 255, 255, 1)",d="rgba(0, 0, 0, 0.8)",f="";"undefined"!=typeof WebVTTSet&&(c=WebVTTSet.fontSet,d=WebVTTSet.backgroundSet,f=WebVTTSet.edgeSet),u&&(c="rgb(255, 255, 255)",d="rgb(0, 0, 0)"),o.cue=n,o.cueDiv=s(e,n.text);var A={color:c,backgroundColor:d,textShadow:f,position:"relative",left:0,right:0,top:0,bottom:0,display:"inline"};u||(A.writingMode=""===n.vertical?"horizontal-tb":"lr"===n.vertical?"vertical-lr":"vertical-rl",A.unicodeBidi="plaintext"),o.applyStyles(A,o.cueDiv),o.div=e.document.createElement("div"),A={textAlign:"middle"===n.align?"center":n.align,font:r.font,whiteSpace:"pre-line",position:"absolute"},u||(A.direction=l(o.cueDiv),A.writingMode=""===n.vertical?"horizontal-tb":"lr"===n.vertical?"vertical-lr":"vertical-rl".stylesunicodeBidi="plaintext"),o.applyStyles(A),o.div.appendChild(o.cueDiv);var h=0;switch(n.positionAlign){case"start":h=n.position;break;case"middle":h=n.position-n.size/2;break;case"end":h=n.position-n.size}return""===n.vertical?o.applyStyles({left:o.formatStyle(h,"%"),width:o.formatStyle(n.size,"%")}):o.applyStyles({top:o.formatStyle(h,"%"),height:o.formatStyle(n.size,"%")}),o.move=function(e){this.applyStyles({top:this.formatStyle(e.top,"px"),bottom:this.formatStyle(e.bottom,"px"),left:this.formatStyle(e.left,"px"),right:this.formatStyle(e.right,"px"),height:this.formatStyle(e.height,"px"),width:this.formatStyle(e.width,"px")})},o}return r(t,e),t}(m),b=function(){function e(t){a(this,e),this.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top};var n="undefined"!=typeof navigator&&/MSIE\s8\.0/.test(navigator.userAgent),i=void 0,r=void 0,o=void 0,s=void 0;if(t.div){r=t.div.offsetHeight,o=t.div.offsetWidth,s=t.div.offsetTop;var u=(u=t.div.childNodes)&&(u=u[0])&&u.getClientRects&&u.getClientRects();t=t.div.getBoundingClientRect(),i=u?Math.max(u[0]&&u[0].height||0,t.height/u.length):0}this.left=t.left,this.right=t.right,this.top=t.top||s,this.height=t.height||r,this.bottom=t.bottom||s+(t.height||r),this.width=t.width||o,this.lineHeight=void 0!==i?i:t.lineHeight,n&&!this.lineHeight&&(this.lineHeight=13)}return h(e,[{key:"move",value:function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}}},{key:"overlapsAny",value:function(e){for(var t=0;t<e.length;t++)if(this.overlaps(e[t]))return!0;return!1}},{key:"within",value:function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right}},{key:"overlapsOppositeAxis",value:function(e,t){switch(t){case"+x":return this.left<e.left;case"-x":return this.right>e.right;case"+y":return this.top<e.top;case"-y":return this.bottom>e.bottom}}},{key:"intersectPercentage",value:function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)}},{key:"toCSSCompatValues",value:function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}}}],[{key:"getSimpleBoxPosition",value:function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,n=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,i=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e,{left:e.left,right:e.right,top:e.top||i,height:e.height||t,bottom:e.bottom||i+(e.height||t),width:e.width||n}}}]),e}(),k=.05,w="sans-serif",S="1.5%";t.processCues=A,t.convertCueToDOMTree=f},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.registerPlugin=void 0;var a=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),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(14),s=i(o),u=n(3),l=i(u),c=n(10),d=(i(c),n(0)),f=i(d),A=(0,f.default)("PluginManager"),h=function(){function e(){r(this,e),this._plugins=new Map}return a(e,[{key:"load",value:function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e._registry.has(t))throw new l.default(l.default.Severity.CRITICAL,l.default.Category.PLAYER,l.default.Code.RUNTIME_ERROR_NOT_REGISTERED_PLUGIN,t);var r=e._registry.get(t);return r&&r.isValid()?(this._plugins.set(t,r.createPlugin(t,n,i)),A.debug("Plugin <"+t+"> has been loaded"),!0):(A.debug("Plugin <"+t+"> isn't loaded, isValid()=false"),!1)}},{key:"destroy",value:function(){this._plugins.forEach(this._destroy.bind(this))}},{key:"reset",value:function(){this._plugins.forEach(function(e){e.reset()})}},{key:"_destroy",value:function(e,t){e.destroy(),this._plugins.delete(t)}},{key:"get",value:function(e){return this._plugins.get(e)}}],[{key:"register",value:function(t,n){if("function"!=typeof n||n.prototype instanceof s.default==!1)throw new l.default(l.default.Severity.CRITICAL,l.default.Category.PLAYER,l.default.Code.RUNTIME_ERROR_NOT_VALID_HANDLER,t);return e._registry.has(t)?(A.debug("Plugin <"+t+"> is already registered, do not register again"),!1):(e._registry.set(t,n),A.debug("Plugin <"+t+"> has been registered successfully"),!0)}},{key:"unRegister",value:function(t){e._registry.has(t)&&(e._registry.delete(t),A.debug("Unregistered <"+t+"> plugin."))}}]),e}();h._registry=new Map,t.default=h;var _=h.register;t.registerPlugin=_},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=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),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=function(){function e(){i(this,e),this.fontSize="100%",this.fontFamily=e.FontFamily.SANS_SERIF,this.fontColor=e.StandardColors.WHITE,this.fontOpacity=e.StandardOpacities.OPAQUE,this.backgroundColor=e.StandardColors.BLACK,this.backgroundOpacity=e.StandardOpacities.OPAQUE,this.fontEdge=e.EdgeStyles.NONE}return r(e,[{key:"toCSS",value:function(){var t=[];t.push("font-family: "+this.fontFamily),t.push("font-size: "+this.fontSize),t.push("color: "+e._toRGBA(this.fontColor,this.fontOpacity)),t.push("background-color: "+e._toRGBA(this.backgroundColor,this.backgroundOpacity));for(var n=[],i=0;i<this.fontEdge.length;i++){var r=this.fontEdge[i].slice(0,3),a=this.fontEdge[i].slice(3,6);n.push(e._toRGBA(r,this.fontOpacity)+" "+a.join("px ")+"px")}return t.push("text-shadow: "+n.join(",")),t.join("!important; ")}},{key:"clone",value:function(){var t=new e;return t.fontEdge=this.fontEdge,t.fontSize=this.fontSize,t.fontColor=this.fontColor,t.fontOpacity=this.fontOpacity,t.backgroundColor=this.backgroundColor,t.backgroundOpacity=this.backgroundOpacity,t}}],[{key:"_toRGBA",value:function(e,t){return"rgba("+e.concat(t).join(",")+")"}}]),e}();a.FontFamily={ARIAL:"Arial",HELVETICA:"Helvetica",VERDANA:"Verdana",SANS_SERIF:"sans-serif"},a.StandardColors={WHITE:[255,255,255],BLACK:[0,0,0],RED:[255,0,0],GREEN:[0,255,0],BLUE:[0,0,255],YELLOW:[255,255,0],MAGENTA:[255,0,255],CYAN:[0,255,255]},a.StandardOpacities={OPAQUE:1,SEMI_HIGH:.75,SEMI_LOW:.25,TRANSPARENT:0},a.EdgeStyles={NONE:[],RAISED:[[34,34,34,1,1,0],[34,34,34,2,2,0],[34,34,34,3,3,0]],DEPRESSED:[[204,204,204,1,1,0],[204,204,204,0,1,0],[34,34,34,-1,-1,0],[34,34,34,0,-1,0]],UNIFORM:[[34,34,34,0,0,4],[34,34,34,0,0,4],[34,34,34,0,0,4],[34,34,34,0,0,4]],DROP:[[34,34,34,2,2,3],[34,34,34,2,2,4],[34,34,34,2,2,5]]},a.FontSizes=["50%","75%","100%","200%","300%","400%"],t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={VIDEO:"video",AUDIO:"audio",TEXT:"text"};t.TrackType=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={DASH:"dash",HLS:"hls",PROGRESSIVE:"progressive"};t.StreamType=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={HTML5:"html5",FLASH:"flash",SILVERLIGHT:"silverlight"};t.EngineType=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={VOD:"Vod",LIVE:"Live",AUDIO:"Audio",UNKNOWN:"Unknown"};t.MediaType=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={MANUAL:"manual",AUTO:"auto"};t.AbrMode=i},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){return new o.default(e||{})}Object.defineProperty(t,"__esModule",{value:!0}),t.LogLevelType=t.AbrMode=t.StreamType=t.MediaType=t.EngineType=t.TrackType=t.StateType=t.EventType=t.getCapabilities=t.BaseDrmProtocol=t.Env=t.PLAYER_NAME=t.VERSION=t.EventManager=t.FakeEventTarget=t.FakeEvent=t.Error=t.Utils=t.TextStyle=t.TextTrack=t.AudioTrack=t.VideoTrack=t.Track=t.BaseMiddleware=t.BasePlugin=t.registerPlugin=t.BaseMediaSourceAdapter=t.registerMediaSourceAdapter=void 0,t.loadPlayer=r;var a=n(10),o=i(a),s=n(18),u=i(s),l=n(17),c=n(23),d=n(19),f=i(d),A=n(16),h=i(A),_=n(14),p=i(_),v=n(5),y=i(v),g=n(7),E=i(g),m=n(8),T=i(m),b=n(9),k=i(b),w=n(24),S=i(w),O=n(11),C=i(O),R=n(2),D=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(R),L=n(3),P=i(L),N=n(1),M=i(N),I=n(12),x=i(I),U=n(6),j=i(U),H=n(15),G=n(25),B=n(26),F=n(27),V=n(28),Y=n(4),W=n(29),K=n(0);o.default.runCapabilities(),t.registerMediaSourceAdapter=l.registerMediaSourceAdapter,t.BaseMediaSourceAdapter=u.default,t.registerPlugin=c.registerPlugin,t.BasePlugin=p.default,t.BaseMiddleware=h.default,t.Track=y.default,t.VideoTrack=E.default,t.AudioTrack=T.default,t.TextTrack=k.default,t.TextStyle=S.default,t.Utils=D,t.Error=P.default,t.FakeEvent=M.default,t.FakeEventTarget=x.default,t.EventManager=j.default,t.VERSION="0.21.4",t.PLAYER_NAME="playkit-js",t.Env=C.default,t.BaseDrmProtocol=f.default;var X=o.default.getCapabilities;t.getCapabilities=X,t.EventType=Y.EventType,t.StateType=H.StateType,t.TrackType=G.TrackType,t.EngineType=F.EngineType,t.MediaType=V.MediaType,t.StreamType=B.StreamType,t.AbrMode=W.AbrMode,t.LogLevelType=K.LogLevelType,t.default=r},function(e,t,n){var i;!function(r,a){"use strict";var o="model",s="name",u="type",l="vendor",c="version",d="mobile",f="tablet",A={extend:function(e,t){var n={};for(var i in e)t[i]&&t[i].length%2==0?n[i]=t[i].concat(e[i]):n[i]=e[i];return n},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},h={rgx:function(e,t){for(var n,i,r,a,o,s,u=0;u<t.length&&!o;){var l=t[u],c=t[u+1];for(n=i=0;n<l.length&&!o;)if(o=l[n++].exec(e))for(r=0;r<c.length;r++)s=o[++i],a=c[r],"object"==typeof a&&a.length>0?2==a.length?"function"==typeof a[1]?this[a[0]]=a[1].call(this,s):this[a[0]]=a[1]:3==a.length?"function"!=typeof a[1]||a[1].exec&&a[1].test?this[a[0]]=s?s.replace(a[1],a[2]):void 0:this[a[0]]=s?a[1].call(this,s,a[2]):void 0:4==a.length&&(this[a[0]]=s?a[3].call(this,s.replace(a[1],a[2])):void 0):this[a]=s||void 0;u+=2}},str:function(e,t){for(var n in t)if("object"==typeof t[n]&&t[n].length>0){for(var i=0;i<t[n].length;i++)if(A.has(t[n][i],e))return"?"===n?void 0:n}else if(A.has(t[n],e))return"?"===n?void 0:n;return e}},_={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2000:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},p={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[s,c],[/(opios)[\/\s]+([\w\.]+)/i],[[s,"Opera Mini"],c],[/\s(opr)\/([\w\.]+)/i],[[s,"Opera"],c],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]+)*/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]+)*/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser)\/([\w\.-]+)/i],[s,c],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[s,"IE"],c],[/(edge)\/((\d+)?[\w\.]+)/i],[s,c],[/(yabrowser)\/([\w\.]+)/i],[[s,"Yandex"],c],[/(puffin)\/([\w\.]+)/i],[[s,"Puffin"],c],[/(uc\s?browser)[\/\s]?([\w\.]+)/i,/ucweb.+(ucbrowser)[\/\s]?([\w\.]+)/i,/juc.+(ucweb)[\/\s]?([\w\.]+)/i,/(ucbrowser)\/([\w\.]+)/i],[[s,"UCBrowser"],c],[/(comodo_dragon)\/([\w\.]+)/i],[[s,/_/g," "],c],[/(micromessenger)\/([\w\.]+)/i],[[s,"WeChat"],c],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[s,c],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[c,[s,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[c,[s,"Facebook"]],[/(headlesschrome) ([\w\.]+)/i],[c,[s,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[s,/(.+)/,"$1 WebView"],c],[/android.+samsungbrowser\/([\w\.]+)/i,/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[c,[s,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[s,c],[/(dolfin)\/([\w\.]+)/i],[[s,"Dolphin"],c],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[s,"Chrome"],c],[/(coast)\/([\w\.]+)/i],[[s,"Opera Coast"],c],[/fxios\/([\w\.-]+)/i],[c,[s,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[c,[s,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[c,s],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[s,[c,h.str,_.browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[s,c],[/(navigator|netscape)\/([\w\.-]+)/i],[[s,"Netscape"],c],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/([\w\.-]+)/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]+)*/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[s,c]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[["architecture","amd64"]],[/(ia32(?=;))/i],[["architecture",A.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[["architecture","ia32"]],[/windows\s(ce|mobile);\sppc;/i],[["architecture","arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[["architecture",/ower/,"",A.lowerize]],[/(sun4\w)[;\)]/i],[["architecture","sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[["architecture",A.lowerize]]],device:[[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],[o,l,[u,f]],[/applecoremedia\/[\w\.]+ \((ipad)/],[o,[l,"Apple"],[u,f]],[/(apple\s{0,1}tv)/i],[[o,"Apple TV"],[l,"Apple"]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[l,o,[u,f]],[/(kf[A-z]+)\sbuild\/[\w\.]+.*silk\//i],[o,[l,"Amazon"],[u,f]],[/(sd|kf)[0349hijorstuw]+\sbuild\/[\w\.]+.*silk\//i],[[o,h.str,_.device.amazon.model],[l,"Amazon"],[u,d]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[o,l,[u,d]],[/\((ip[honed|\s\w*]+);/i],[o,[l,"Apple"],[u,d]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola|polytron)[\s_-]?([\w-]+)*/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[l,o,[u,d]],[/\(bb10;\s(\w+)/i],[o,[l,"BlackBerry"],[u,d]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone)/i],[o,[l,"Asus"],[u,f]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[l,"Sony"],[o,"Xperia Tablet"],[u,f]],[/(?:sony)?(?:(?:(?:c|d)\d{4})|(?:so[-l].+))\sbuild\//i],[[l,"Sony"],[o,"Xperia Phone"],[u,d]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[l,o,[u,"console"]],[/android.+;\s(shield)\sbuild/i],[o,[l,"Nvidia"],[u,"console"]],[/(playstation\s[34portablevi]+)/i],[o,[l,"Sony"],[u,"console"]],[/(sprint\s(\w+))/i],[[l,h.str,_.device.sprint.vendor],[o,h.str,_.device.sprint.model],[u,d]],[/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i],[l,o,[u,f]],[/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,/(zte)-(\w+)*/i,/(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i],[l,[o,/_/g," "],[u,d]],[/(nexus\s9)/i],[o,[l,"HTC"],[u,f]],[/(nexus\s6p)/i],[o,[l,"Huawei"],[u,d]],[/(microsoft);\s(lumia[\s\w]+)/i],[l,o,[u,d]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[o,[l,"Microsoft"],[u,"console"]],[/(kin\.[onetw]{3})/i],[[o,/\./g," "],[l,"Microsoft"],[u,d]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w+)*/i,/(XT\d{3,4}) build\//i,/(nexus\s6)/i],[o,[l,"Motorola"],[u,d]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[o,[l,"Motorola"],[u,f]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[l,A.trim],[o,A.trim],[u,"smarttv"]],[/hbbtv.+maple;(\d+)/i],[[o,/^/,"SmartTV"],[l,"Samsung"],[u,"smarttv"]],[/\(dtv[\);].+(aquos)/i],[o,[l,"Sharp"],[u,"smarttv"]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[l,"Samsung"],o,[u,f]],[/smart-tv.+(samsung)/i],[l,[u,"smarttv"],o],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i,/sec-((sgh\w+))/i],[[l,"Samsung"],o,[u,d]],[/sie-(\w+)*/i],[o,[l,"Siemens"],[u,d]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]+)*/i],[[l,"Nokia"],o,[u,d]],[/android\s3\.[\s\w;-]{10}(a\d{3})/i],[o,[l,"Acer"],[u,f]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[l,"LG"],o,[u,f]],[/(lg) netcast\.tv/i],[l,o,[u,"smarttv"]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w+)*/i],[o,[l,"LG"],[u,d]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[o,[l,"Lenovo"],[u,f]],[/linux;.+((jolla));/i],[l,o,[u,d]],[/((pebble))app\/[\d\.]+\s/i],[l,o,[u,"wearable"]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[l,o,[u,d]],[/crkey/i],[[o,"Chromecast"],[l,"Google"]],[/android.+;\s(glass)\s\d/i],[o,[l,"Google"],[u,"wearable"]],[/android.+;\s(pixel c)\s/i],[o,[l,"Google"],[u,f]],[/android.+;\s(pixel xl|pixel)\s/i],[o,[l,"Google"],[u,d]],[/android.+(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:one|one[\s_]plus|note lte)?[\s_]*(?:\d\w)?)\s+build/i],[[o,/_/g," "],[l,"Xiaomi"],[u,d]],[/android.+a000(1)\s+build/i],[o,[l,"OnePlus"],[u,d]],[/\s(tablet)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[u,A.lowerize],l,o]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[c,[s,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[s,c],[/rv\:([\w\.]+).*(gecko)/i],[c,s]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[s,c],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s]+\w)*/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[s,[c,h.str,_.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[s,"Windows"],[c,h.str,_.os.windows.version]],[/\((bb)(10);/i],[[s,"BlackBerry"],c],[/(blackberry)\w*\/?([\w\.]+)*/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i,/linux;.+(sailfish);/i],[s,c],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],[[s,"Symbian"],c],[/\((series40);/i],[s],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[s,"Firefox OS"],c],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w+)*/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]+)*/i,/(hurd|linux)\s?([\w\.]+)*/i,/(gnu)\s?([\w\.]+)*/i],[s,c],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[s,"Chromium OS"],c],[/(sunos)\s?([\w\.]+\d)*/i],[[s,"Solaris"],c],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],[s,c],[/(haiku)\s(\w+)/i],[s,c],[/(ip[honead]+)(?:.*os\s([\w]+)*\slike\smac|;\sopera)/i],[[s,"iOS"],[c,/_/g,"."]],[/(mac\sos\sx)\s?([\w\s\.]+\w)*/i,/(macintosh|mac(?=_powerpc)\s)/i],[[s,"Mac OS"],[c,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]+)*/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]+)*/i],[s,c]]},v=function(e,t){this[s]=e,this[c]=t},y=function(e){this.architecture=e},g=function(e,t,n){this[l]=e,this[o]=t,this[u]=n},E=v,m=v,T=function(e,t){if(!(this instanceof T))return new T(e,t).getResult();var n=e||(r&&r.navigator&&r.navigator.userAgent?r.navigator.userAgent:""),i=t?A.extend(p,t):p,a=new v,o=new y,s=new g,u=new E,l=new m;return this.getBrowser=function(){return h.rgx.call(a,n,i.browser),a.major=A.major(a.version),a},this.getCPU=function(){return h.rgx.call(o,n,i.cpu),o},this.getDevice=function(){return h.rgx.call(s,n,i.device),s},this.getEngine=function(){return h.rgx.call(u,n,i.engine),u},this.getOS=function(){return h.rgx.call(l,n,i.os),l},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(e){return n=e,a=new v,o=new y,s=new g,u=new E,l=new m,this},this};T.VERSION="0.7.13",T.BROWSER={NAME:s,MAJOR:"major",VERSION:c},T.CPU={ARCHITECTURE:"architecture"},T.DEVICE={MODEL:o,VENDOR:l,TYPE:u,CONSOLE:"console",MOBILE:d,SMARTTV:"smarttv",TABLET:f,WEARABLE:"wearable",EMBEDDED:"embedded"},T.ENGINE={NAME:s,VERSION:c},T.OS={NAME:s,VERSION:c},void 0!==t?(void 0!==e&&e.exports&&(t=e.exports=T),t.UAParser=T):n(32)?void 0!==(i=function(){return T}.call(t,n,t,e))&&(e.exports=i):r.UAParser=T;var b=r.jQuery||r.Zepto;if(void 0!==b){var k=new T;b.ua=k.getResult(),b.ua.get=function(){return k.getUA()},b.ua.set=function(e){k.setUA(e);var t=k.getResult();for(var n in t)b.ua[n]=t[n]}}}("object"==typeof window?window:this)},function(e,t){(function(t){e.exports=t}).call(t,{})},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=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),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=n(2),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(a),s=function(){function e(){i(this,e),this._createEl()}return r(e,[{key:"setSrc",value:function(e){e&&(this._posterUrl=e,o.Dom.setStyle(this._el,"background-image",'url("'+this._posterUrl+'")'),this.hide())}},{key:"getElement",value:function(){return this._el}},{key:"_createEl",value:function(){if(!this._el){var e=this._el=o.Dom.createElement("div");o.Dom.setAttribute(e,"id",o.Generator.uniqueId(5)),o.Dom.setAttribute(e,"tabindex","-1")}}},{key:"_removeEl",value:function(){this._el&&o.Dom.removeChild(this._el.parentNode,this._el)}},{key:"show",value:function(){o.Dom.setStyle(this._el,"display","")}},{key:"hide",value:function(){o.Dom.setStyle(this._el,"display","none")}},{key:"reset",value:function(){this._posterUrl="",o.Dom.setStyle(this._el,"background-image","")}},{key:"destroy",value:function(){this.reset(),this._removeEl()}},{key:"src",get:function(){return this._posterUrl}}]),e}();t.default=s},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=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),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=function(){function e(){i(this,e)}return r(e,null,[{key:"language",get:function(){var e=void 0;return e=navigator.languages&&navigator.languages.length?navigator.languages[0]:navigator.userLanguage?navigator.userLanguage:navigator.language,e&&e.match("-")&&(e=e.split("-")[0]),e}}]),e}();t.default=a},function(e,t,n){var i,r;/*!
* js-logger - http://github.com/jonnyreeves/js-logger
* Jonny Reeves, http://jonnyreeves.co.uk/
* js-logger may be freely distributed under the MIT license.
*/
!function(a){"use strict";var o={};o.VERSION="1.4.1";var s,u={},l=function(e,t){return function(){return t.apply(e,arguments)}},c=function(){var e,t,n=arguments,i=n[0];for(t=1;t<n.length;t++)for(e in n[t])e in i||!n[t].hasOwnProperty(e)||(i[e]=n[t][e]);return i},d=function(e,t){return{value:e,name:t}};o.DEBUG=d(1,"DEBUG"),o.INFO=d(2,"INFO"),o.TIME=d(3,"TIME"),o.WARN=d(4,"WARN"),o.ERROR=d(8,"ERROR"),o.OFF=d(99,"OFF");var f=function(e){this.context=e,this.setLevel(e.filterLevel),this.log=this.info};f.prototype={setLevel:function(e){e&&"value"in e&&(this.context.filterLevel=e)},getLevel:function(){return this.context.filterLevel},enabledFor:function(e){var t=this.context.filterLevel;return e.value>=t.value},debug:function(){this.invoke(o.DEBUG,arguments)},info:function(){this.invoke(o.INFO,arguments)},warn:function(){this.invoke(o.WARN,arguments)},error:function(){this.invoke(o.ERROR,arguments)},time:function(e){"string"==typeof e&&e.length>0&&this.invoke(o.TIME,[e,"start"])},timeEnd:function(e){"string"==typeof e&&e.length>0&&this.invoke(o.TIME,[e,"end"])},invoke:function(e,t){s&&this.enabledFor(e)&&s(t,c({level:e},this.context))}};var A=new f({filterLevel:o.OFF});!function(){var e=o;e.enabledFor=l(A,A.enabledFor),e.debug=l(A,A.debug),e.time=l(A,A.time),e.timeEnd=l(A,A.timeEnd),e.info=l(A,A.info),e.warn=l(A,A.warn),e.error=l(A,A.error),e.log=e.info}(),o.setHandler=function(e){s=e},o.setLevel=function(e){A.setLevel(e);for(var t in u)u.hasOwnProperty(t)&&u[t].setLevel(e)},o.getLevel=function(){return A.getLevel()},o.get=function(e){return u[e]||(u[e]=new f(c({name:e},A.context)))},o.createDefaultHandler=function(e){e=e||{},e.formatter=e.formatter||function(e,t){t.name&&e.unshift("["+t.name+"]")};var t={},n=function(e,t){Function.prototype.apply.call(e,console,t)};return"undefined"==typeof console?function(){}:function(i,r){i=Array.prototype.slice.call(i);var a,s=console.log;r.level===o.TIME?(a=(r.name?"["+r.name+"] ":"")+i[0],"start"===i[1]?console.time?console.time(a):t[a]=(new Date).getTime():console.timeEnd?console.timeEnd(a):n(s,[a+": "+((new Date).getTime()-t[a])+"ms"])):(r.level===o.WARN&&console.warn?s=console.warn:r.level===o.ERROR&&console.error?s=console.error:r.level===o.INFO&&console.info?s=console.info:r.level===o.DEBUG&&console.debug&&(s=console.debug),e.formatter(i,r),n(s,i))}},o.useDefaults=function(e){o.setLevel(e&&e.defaultLevel||o.DEBUG),o.setHandler(o.createDefaultHandler(e))},i=o,void 0!==(r="function"==typeof i?i.call(t,n,t,e):i)&&(e.exports=r)}()},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}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)}Object.defineProperty(t,"__esModule",{value:!0});var u=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),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),l=n(12),c=i(l),d=n(1),f=i(d),A=n(6),h=i(A),_=n(4),p=n(17),v=i(p),y=n(7),g=(i(y),n(8)),E=(i(g),n(9),n(21)),m=n(2),T=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(m),b=n(44),k=i(b),w=n(46),S=i(w),O=n(3),C=i(O),R=n(0),D=i(R),L=function(e){function t(e,n){a(this,t);var i=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return i._showTextTrackFirstTime={},i._eventManager=new h.default,i._createVideoElement(),i._init(e,n),i}return s(t,e),u(t,null,[{key:"createEngine",value:function(e,t){return new this(e,t)}},{key:"canPlaySource",value:function(e,t){return v.default.canPlaySource(e,t)}},{key:"runCapabilities",value:function(){t._capabilities.forEach(function(e){return e.runCapability()})}},{key:"getCapabilities",value:function(){var e=[];return t._capabilities.forEach(function(t){return e.push(t.getCapability())}),Promise.all(e).then(function(e){var n={};return e.forEach(function(e){return Object.assign(n,e)}),r({},t.id,n)})}},{key:"prepareVideoElement",value:function(){t._logger.debug("Prepare the video element for playing"),t._el=T.Dom.createElement("video"),t._el.load()}}]),u(t,[{key:"restore",value:function(e,t){this.detach(),this._eventManager.removeAll(),this._el&&T.Dom.removeAttribute(this._el,"src"),this._init(e,t)}},{key:"destroy",value:function(){this.detach(),this._el&&(this.pause(),T.Dom.removeAttribute(this._el,"src"),T.Dom.removeChild(this._el.parentNode,this._el)),this._showTextTrackFirstTime={},this._eventManager.destroy(),v.default.destroy(),this._mediaSourceAdapter=null}},{key:"attach",value:function(){var e=this;Object.keys(_.Html5EventType).forEach(function(t){e._eventManager.listen(e._el,_.Html5EventType[t],function(){_.Html5EventType[t]===_.Html5EventType.ERROR?e._handleVideoError():e.dispatchEvent(new f.default(_.Html5EventType[t]))})}),this._mediaSourceAdapter&&(this._eventManager.listen(this._mediaSourceAdapter,_.CustomEventType.VIDEO_TRACK_CHANGED,function(t){return e.dispatchEvent(t)}),this._eventManager.listen(this._mediaSourceAdapter,_.CustomEventType.AUDIO_TRACK_CHANGED,function(t){return e.dispatchEvent(t)}),this._eventManager.listen(this._mediaSourceAdapter,_.CustomEventType.TEXT_TRACK_CHANGED,function(t){return e.dispatchEvent(t)}),this._eventManager.listen(this._mediaSourceAdapter,_.CustomEventType.ABR_MODE_CHANGED,function(t){return e.dispatchEvent(t)}),this._eventManager.listen(this._mediaSourceAdapter,_.CustomEventType.TEXT_CUE_CHANGED,function(t){return e.dispatchEvent(t)}),this._eventManager.listen(this._mediaSourceAdapter,_.CustomEventType.TRACKS_CHANGED,function(t){return e.dispatchEvent(t)}),this._eventManager.listen(this._mediaSourceAdapter,_.Html5EventType.ERROR,function(t){return e.dispatchEvent(t)}),this._eventManager.listen(this._mediaSourceAdapter,_.Html5EventType.TIME_UPDATE,function(t){return e.dispatchEvent(t)}),this._eventManager.listen(this._mediaSourceAdapter,_.Html5EventType.PLAYING,function(t){return e.dispatchEvent(t)}))}},{key:"_handleVideoError",value:function(){if(this._el.error){var e=this._el.error.code;if(1!=e){var t=this._getMsExtendedError(),n=this._el.error.message,i=new C.default(C.default.Severity.CRITICAL,C.default.Category.MEDIA,C.default.Code.VIDEO_ERROR,{code:e,extended:t,message:n});this.dispatchEvent(new f.default(_.Html5EventType.ERROR,i))}}}},{key:"_getMsExtendedError",value:function(){var e=this._el.error.msExtendedCode;return e&&(e<0&&(e+=Math.pow(2,32)),e=e.toString(16)),e}},{key:"detach",value:function(){var e=this;Object.keys(_.Html5EventType).forEach(function(t){e._eventManager.unlisten(e._el,_.Html5EventType[t])}),this._mediaSourceAdapter&&(this._eventManager.unlisten(this._mediaSourceAdapter,_.CustomEventType.VIDEO_TRACK_CHANGED),this._eventManager.unlisten(this._mediaSourceAdapter,_.CustomEventType.AUDIO_TRACK_CHANGED),this._eventManager.unlisten(this._mediaSourceAdapter,_.CustomEventType.TEXT_TRACK_CHANGED),this._eventManager.unlisten(this._mediaSourceAdapter,_.CustomEventType.TEXT_CUE_CHANGED))}},{key:"getVideoElement",value:function(){return this._el}},{key:"selectVideoTrack",value:function(e){this._mediaSourceAdapter&&this._mediaSourceAdapter.selectVideoTrack(e)}},{key:"selectAudioTrack",value:function(e){this._mediaSourceAdapter&&this._mediaSourceAdapter.selectAudioTrack(e)}},{key:"selectTextTrack",value:function(e){this._removeCueChangeListener(),this._mediaSourceAdapter&&this._mediaSourceAdapter.selectTextTrack(e),this._addCueChangeListener(e)}},{key:"hideTextTrack",value:function(){this._mediaSourceAdapter&&this._mediaSourceAdapter.hideTextTrack(),this._removeCueChangeListener()}},{key:"enableAdaptiveBitrate",value:function(){this._mediaSourceAdapter&&this._mediaSourceAdapter.enableAdaptiveBitrate()}},{key:"isAdaptiveBitrateEnabled",value:function(){return!!this._mediaSourceAdapter&&this._mediaSourceAdapter.isAdaptiveBitrateEnabled()}},{key:"seekToLiveEdge",value:function(){this._mediaSourceAdapter&&this._mediaSourceAdapter.seekToLiveEdge()}},{key:"getStartTimeOfDvrWindow",value:function(){return this._mediaSourceAdapter?this._mediaSourceAdapter.getStartTimeOfDvrWindow():0}},{key:"isLive",value:function(){return!!this._mediaSourceAdapter&&this._mediaSourceAdapter.isLive()}},{key:"play",value:function(){var e=this,t=this._el.play();t&&t.catch(function(){return e.dispatchEvent(new f.default(_.CustomEventType.AUTOPLAY_FAILED))})}},{key:"pause",value:function(){return this._el.pause()}},{key:"load",value:function(e){var t=this;return this._el.load(),this._canLoadMediaSourceAdapterPromise.then(function(){return t._mediaSourceAdapter?t._mediaSourceAdapter.load(e).catch(function(e){return Promise.reject(e)}):Promise.resolve({})}).catch(function(e){return Promise.reject(e)})}},{key:"ready",value:function(){}},{key:"_init",value:function(e,t){this._config=t,this._canLoadMediaSourceAdapterPromise=this._mediaSourceAdapter?this._mediaSourceAdapter.destroy():Promise.resolve(),this._mediaSourceAdapter=null,this._loadMediaSourceAdapter(e),this.attach()}},{key:"_createVideoElement",value:function(){this._el=t._el||T.Dom.createElement("video"),this._el.id=T.Generator.uniqueId(5),this._el.controls=!1}},{key:"_loadMediaSourceAdapter",value:function(e){this._mediaSourceAdapter=v.default.getMediaSourceAdapter(this.getVideoElement(),e,this._config)}},{key:"_addCueChangeListener",value:function(e){var t=this,n=this._getSelectedTextTrackElement();n&&(this._config.playback.useNativeTextTrack?n.mode="showing":(n.oncuechange=function(e){return t._onCueChange(e)},n.mode=this._showTextTrackFirstTime[e.index]?"hidden":"showing",this._showTextTrackFirstTime[e.index]=!0))}},{key:"_removeCueChangeListener",value:function(){var e=this._getSelectedTextTrackElement();e&&(e.oncuechange=null)}},{key:"_onCueChange",value:function(e){var t=e.currentTarget,n=[];t.mode="hidden";var i=!0,r=!1,a=void 0;try{for(var o,s=t.activeCues[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;if(window.VTTCue&&u instanceof window.VTTCue)n.push(u);else if(window.TextTrackCue&&u instanceof window.TextTrackCue)try{n.push(new E.Cue(u.startTime,u.endTime,u.text))}catch(e){new C.default(C.default.Severity.RECOVERABLE,C.default.Category.TEXT,C.default.Code.UNABLE_TO_CREATE_TEXT_CUE,e)}}}catch(e){r=!0,a=e}finally{try{!i&&s.return&&s.return()}finally{if(r)throw a}}this.dispatchEvent(new f.default(_.CustomEventType.TEXT_CUE_CHANGED,{cues:n}))}},{key:"_getSelectedTextTrackElement",value:function(){var e=this._el.textTracks;for(var t in e)if(e.hasOwnProperty(t)){var n=e[parseInt(t)];if(n&&"disabled"!==n.mode)return n}return null}},{key:"id",get:function(){return t.id}},{key:"src",set:function(e){this._el.src=e},get:function(){return this._mediaSourceAdapter?this._mediaSourceAdapter.src:""}},{key:"currentTime",get:function(){return this._mediaSourceAdapter?this._mediaSourceAdapter.currentTime:0},set:function(e){this._mediaSourceAdapter&&(this._mediaSourceAdapter.currentTime=e)}},{key:"duration",get:function(){return this._mediaSourceAdapter?this._mediaSourceAdapter.duration:NaN}},{key:"volume",set:function(e){this._el.volume=e},get:function(){return this._el.volume}},{key:"paused",get:function(){return this._el.paused}},{key:"seeking",get:function(){return this._el.seeking}},{key:"seekable",get:function(){return this._el.seekable}},{key:"played",get:function(){return this._el.played}},{key:"buffered",get:function(){return this._el.buffered}},{key:"muted",set:function(e){this._el.muted=e},get:function(){return this._el.muted}},{key:"defaultMuted",get:function(){return this._el.defaultMuted}},{key:"poster",set:function(e){this._el.poster=e},get:function(){return this._el.poster}},{key:"preload",set:function(e){this._el.preload=e},get:function(){return this._el.preload}},{key:"autoplay",set:function(e){this._el.autoplay=e},get:function(){return this._el.autoplay}},{key:"loop",set:function(e){this._el.loop=e},get:function(){return this._el.loop}},{key:"controls",set:function(e){this._el.controls=e},get:function(){return this._el.controls}},{key:"playbackRate",set:function(e){this._el.playbackRate=e},get:function(){return this._el.playbackRate}},{key:"defaultPlaybackRate",set:function(e){this._el.defaultPlaybackRate=e},get:function(){return this._el.defaultPlaybackRate}},{key:"ended",get:function(){return this._el.ended}},{key:"error",get:function(){return this._el.error}},{key:"networkState",get:function(){return this._el.networkState}},{key:"readyState",get:function(){return this._el.readyState}},{key:"videoHeight",get:function(){return this._el.videoHeight}},{key:"videoWidth",get:function(){return this._el.videoWidth}},{key:"playsinline",set:function(e){e?this._el.setAttribute("playsinline",""):this._el.removeAttribute("playsinline")},get:function(){return""===this._el.getAttribute("playsinline")}}]),t}(c.default);L._logger=(0,D.default)("Html5"),L._capabilities=[k.default,S.default],L.id="html5",t.default=L},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}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 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)}Object.defineProperty(t,"__esModule",{value:!0});var s=function e(t,n,i){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,i)}if("value"in r)return r.value;var o=r.get;if(void 0!==o)return o.call(i)},u=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),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),l=n(6),c=i(l),d=n(4),f=n(5),A=(i(f),n(7)),h=i(A),_=n(8),p=i(_),v=n(9),y=n(18),g=i(y),E=n(41),m=n(2),T=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(m),b=n(42),k=i(b),w=n(11),S=i(w),O=n(1),C=(i(O),n(3)),R=i(C),D=function(e){function t(e,n,i){r(this,t),t._logger.debug("Creating adapter");var o=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return o._eventManager=new c.default,o._maybeSetDrmPlayback(),o._progressiveSources=i.sources.progressive,o._liveEdge=0,o}return o(t,e),u(t,null,[{key:"canPlayType",value:function(e){var n=!1;return"string"==typeof e&&(n=!!t.TEST_VIDEO.canPlayType(e.toLowerCase())),t._logger.debug("canPlayType result for mimeType:"+e+" is "+n.toString()),n}},{key:"canPlayDrm",value:function(e){var n=!1,i=!0,r=!1,a=void 0;try{for(var o,s=t._drmProtocols[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;if(u.canPlayDrm(e)){t._drmProtocol=u,n=!0;break}}}catch(e){r=!0,a=e}finally{try{!i&&s.return&&s.return()}finally{if(r)throw a}}return t._logger.debug("canPlayDrm result is "+n.toString(),e),n}},{key:"createAdapter",value:function(e,t,n){return new this(e,t,n)}}]),u(t,[{key:"_dispatchErrorCallback",value:function(e){this._trigger(d.Html5EventType.ERROR,e)}},{key:"_maybeSetDrmPlayback",value:function(){var e=this;t._drmProtocol&&this._sourceObj&&this._sourceObj.drmData&&t._drmProtocol.setDrmPlayback(this._videoElement,this._sourceObj.drmData,function(t){return e._dispatchErrorCallback(t)})}},{key:"_setProgressiveSource",value:function(){var e=(0,E.getSuitableSourceForResolution)(this._progressiveSources,this._videoElement.offsetWidth,this._videoElement.offsetHeight);e&&(this._sourceObj=e)}},{key:"_isProgressivePlayback",value:function(){return!!this._sourceObj&&"video/mp4"===this._sourceObj.mimetype}},{key:"load",value:function(e){var t=this;return this._loadPromise||(this._loadPromise=new Promise(function(n,i){t._eventManager.listenOnce(t._videoElement,d.Html5EventType.LOADED_DATA,t._onLoadedData.bind(t,n)),t._eventManager.listenOnce(t._videoElement,d.Html5EventType.ERROR,t._onError.bind(t,i)),t._isProgressivePlayback()&&t._setProgressiveSource(),t._sourceObj&&t._sourceObj.url&&(t._videoElement.src=t._sourceObj.url,t._trigger(d.CustomEventType.ABR_MODE_CHANGED,{mode:t._isProgressivePlayback()?"manual":"auto"})),e&&(t._videoElement.currentTime=e),t._videoElement.load()})),this._loadPromise}},{key:"_onLoadedData",value:function(e){var n=this,i=function(){n._playerTracks=n._getParsedTracks(),n._addNativeAudioTrackChangeListener(),n._addNativeTextTrackChangeListener(),n._addNativeTextTrackAddedListener(),t._logger.debug("The source has been loaded successfully"),e({tracks:n._playerTracks}),n.isLive()&&n._handleLiveDurationChange()};this._videoElement.textTracks.length>0?i():this._eventManager.listenOnce(this._videoElement,d.Html5EventType.CAN_PLAY,i.bind(this))}},{key:"_onError",value:function(e,t){e(new R.default(R.default.Severity.CRITICAL,R.default.Category.MEDIA,R.default.Code.NATIVE_ADAPTER_LOAD_FAILED,t.payload))}},{key:"destroy",value:function(){var e=this;return t._logger.debug("destroy"),s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this).then(function(){e._eventManager.destroy(),e._progressiveSources=[],e._loadPromise=null,e._liveEdge=0,e._liveDurationChangeInterval&&(clearInterval(e._liveDurationChangeInterval),e._liveDurationChangeInterval=null),t._drmProtocol&&(t._drmProtocol.destroy(),t._drmProtocol=null)})}},{key:"_getParsedTracks",value:function(){var e=this._getParsedVideoTracks(),t=this._getParsedAudioTracks(),n=this._getParsedTextTracks();return e.concat(t).concat(n)}},{key:"_getParsedVideoTracks",value:function(){return this._isProgressivePlayback()?this._getParsedProgressiveVideoTracks():this._getParsedAdaptiveVideoTracks()}},{key:"_getParsedProgressiveVideoTracks",value:function(){var e=this._progressiveSources,t=[];if(e)for(var n=0;n<e.length;n++){var i={id:e[n].id,bandwidth:e[n].bandwidth,width:e[n].width,height:e[n].height,active:!!this._sourceObj&&e[n].id===this._sourceObj.id,index:n};t.push(new h.default(i))}return t}},{key:"_getParsedAdaptiveVideoTracks",value:function(){var e=this._videoElement.videoTracks,t=[];if(e)for(var n=0;n<e.length;n++){var i={id:e[n].id,active:e[n].selected,label:e[n].label,language:e[n].language,index:n};t.push(new h.default(i))}return t}},{key:"_getParsedAudioTracks",value:function(){var e=this._videoElement.audioTracks,t=[];if(e)for(var n=0;n<e.length;n++){var i={id:e[n].id,active:e[n].enabled,label:e[n].label,language:e[n].language,index:n};t.push(new p.default(i))}return t}},{key:"_getParsedTextTracks",value:function(){var e=this._videoElement.textTracks,t=[];if(e)for(var n=0;n<e.length;n++){var i={kind:e[n].kind,active:"showing"===e[n].mode,label:e[n].label,language:e[n].language,index:n};(i.language||i.label)&&t.push(new v.TextTrack(i))}return t}},{key:"selectVideoTrack",value:function(e){this._isProgressivePlayback()?this._selectProgressiveVideoTrack(e):this.selectAdaptiveVideoTrack(e)}},{key:"_selectProgressiveVideoTrack",value:function(e){var t=this,n=this._progressiveSources;if(e instanceof h.default&&n&&n[e.index]){var i=this._videoElement.currentTime,r=this._videoElement.paused;this._sourceObj=n[e.index],this._eventManager.listenOnce(this._videoElement,d.Html5EventType.LOADED_DATA,function(){"Android Browser"===S.default.browser.name?(t._eventManager.listenOnce(t._videoElement,d.Html5EventType.DURATION_CHANGE,function(){t._videoElement.currentTime=i}),t._eventManager.listenOnce(t._videoElement,d.Html5EventType.SEEKED,function(){t._onTrackChanged(e),r&&t._videoElement.pause()}),t._videoElement.play()):(t._eventManager.listenOnce(t._videoElement,d.Html5EventType.SEEKED,function(){t._onTrackChanged(e)}),t._videoElement.currentTime=i,r||t._videoElement.play())}),this._videoElement.src=this._sourceObj?this._sourceObj.url:""}}},{key:"selectAdaptiveVideoTrack",value:function(e){var t=this._videoElement.videoTracks;e instanceof h.default&&t&&t[e.index]&&(this._disableVideoTracks(),t[e.index].selected=!0,this._onTrackChanged(e))}},{key:"selectAudioTrack",value:function(e){var t=this._videoElement.audioTracks;e instanceof p.default&&t&&t[e.index]&&(this._removeNativeAudioTrackChangeListener(),this._disableAudioTracks(),t[e.index].enabled=!0,this._onTrackChanged(e),this._addNativeAudioTrackChangeListener())}},{key:"_removeNativeAudioTrackChangeListener",value:function(){this._videoElement.audioTracks&&this._eventManager.unlisten(this._videoElement.audioTracks,"change")}},{key:"_addNativeAudioTrackChangeListener",value:function(){var e=this;this._videoElement.audioTracks&&this._eventManager.listen(this._videoElement.audioTracks,"change",function(){return e._onNativeAudioTrackChange()})}},{key:"_onNativeAudioTrackChange",value:function(){var e=this,n=this._playerTracks.filter(function(e){return e instanceof p.default});t._logger.debug("Video element audio track change");var i=function(){for(var t=0;t<e._videoElement.audioTracks.length;t++){if(e._videoElement.audioTracks[t].enabled)return t}return-1}(),r=function(){var e=n.find(function(e){return!0===e.active});return e?e.index:-1}();if(i!==r){var a=n.find(function(e){return e.index===i});a&&(t._logger.debug("Native selection of track, update the player audio track ("+r+" -> "+i+")"),this._onTrackChanged(a))}}},{key:"selectTextTrack",value:function(e){var n=this._videoElement.textTracks;e instanceof v.TextTrack&&("subtitles"===e.kind||"captions"===e.kind)&&n&&n[e.index]&&(this._removeNativeTextTrackChangeListener(),this._disableTextTracks(),n[e.index].mode="hidden",t._logger.debug("Text track changed",e),this._onTrackChanged(e),this._addNativeTextTrackChangeListener())}},{key:"_removeNativeTextTrackChangeListener",value:function(){this._videoElement.textTracks&&this._eventManager.unlisten(this._videoElement.textTracks,"change")}},{key:"_addNativeTextTrackChangeListener",value:function(){var e=this;this._videoElement.textTracks&&this._eventManager.listen(this._videoElement.textTracks,"change",function(){return e._onNativeTextTrackChange()})}},{key:"_onNativeTextTrackChange",value:function(){var e=this,n=this._playerTracks.filter(function(e){return e instanceof v.TextTrack}),i=n.find(function(e){return"off"===e.language});t._logger.debug("Video element text track change");var r=function(){for(var t=0;t<e._videoElement.textTracks.length;t++){if("showing"===e._videoElement.textTracks[t].mode)return t}return-1}(),a=function(){var e=n.find(function(e){return!0===e.active});return e?e.index:-1}();if(r!==a)if(-1==r)i&&(t._logger.debug("Native selection of track, update the player text track ("+a+" -> off)"),this._onTrackChanged(i));else{var o=n.find(function(e){return e.index===r});o&&(t._logger.debug("Native selection of track, update the player text track ("+a+" -> "+r+")"),this._onTrackChanged(o))}}},{key:"_addNativeTextTrackAddedListener",value:function(){var e=this;this._videoElement.textTracks&&this._eventManager.listen(this._videoElement.textTracks,"addtrack",function(){return e._onNativeTextTrackAdded()})}},{key:"_onNativeTextTrackAdded",value:function(){this._playerTracks=this._getParsedTracks(),this._trigger(d.CustomEventType.TRACKS_CHANGED,{tracks:this._playerTracks})}},{key:"hideTextTrack",value:function(){this._disableTextTracks()}},{key:"enableAdaptiveBitrate",value:function(){t._logger.warn("Enabling adaptive bitrate is not supported for native playback")}},{key:"isAdaptiveBitrateEnabled",value:function(){return!this._isProgressivePlayback()}},{key:"_disableVideoTracks",value:function(){var e=this._videoElement.videoTracks;if(e)for(var t=0;t<e.length;t++)e[t].selected=!1}},{key:"_disableAudioTracks",value:function(){var e=this._videoElement.audioTracks;if(e)for(var t=0;t<e.length;t++)e[t].enabled=!1}},{key:"_disableTextTracks",value:function(){var e=this._videoElement.textTracks;if(e)for(var t=0;t<e.length;t++)e[t].mode="disabled"}},{key:"_getLiveEdge",value:function(){return this._videoElement.seekable.length?this._videoElement.seekable.end(this._videoElement.seekable.length-1):this._videoElement.buffered.length?this._videoElement.buffered.end(this._videoElement.buffered.length-1):this._videoElement.duration}},{key:"seekToLiveEdge",value:function(){try{this._videoElement.currentTime=this._getLiveEdge()}catch(e){return}}},{key:"isLive",value:function(){return this._videoElement.duration===1/0}},{key:"_handleLiveDurationChange",value:function(){var e=this;this._liveDurationChangeInterval=setInterval(function(){var t=e._getLiveEdge();e._liveEdge!==t&&(e._liveEdge=t,e._videoElement.dispatchEvent(new window.Event(d.Html5EventType.DURATION_CHANGE)))},2e3)}},{key:"getStartTimeOfDvrWindow",value:function(){return this.isLive()&&this._videoElement.seekable.length?this._videoElement.seekable.start(0):0}},{key:"src",get:function(){return this._videoElement.src}}]),t}(g.default);D.id="NativeAdapter",D._logger=g.default.getLogger(D.id),D.TEST_VIDEO=T.Dom.createElement("video"),D._drmProtocols=[k.default],D._drmProtocol=null,t.default=D},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={RECOVERABLE:1,CRITICAL:2};t.Severity=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={UNSUPPORTED_SCHEME:1e3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,UNKNOWN_DATA_URI_ENCODING:1005,REQUEST_FILTER_ERROR:1006,RESPONSE_FILTER_ERROR:1007,INVALID_TEXT_HEADER:2e3,INVALID_TEXT_CUE:2001,UNABLE_TO_DETECT_ENCODING:2003,BAD_ENCODING:2004,INVALID_XML:2005,INVALID_MP4_TTML:2007,INVALID_MP4_VTT:2008,UNABLE_TO_CREATE_TEXT_CUE:2009,DASH_ADAPTER_ERROR_PARSE_ISSUE:2010,BUFFER_READ_OUT_OF_BOUNDS:3e3,JS_INTEGER_OVERFLOW:3001,EBML_OVERFLOW:3002,EBML_BAD_FLOATING_POINT_SIZE:3003,MP4_SIDX_WRONG_BOX_TYPE:3004,MP4_SIDX_INVALID_TIMESCALE:3005,MP4_SIDX_TYPE_NOT_SUPPORTED:3006,WEBM_CUES_ELEMENT_MISSING:3007,WEBM_EBML_HEADER_ELEMENT_MISSING:3008,WEBM_SEGMENT_ELEMENT_MISSING:3009,WEBM_INFO_ELEMENT_MISSING:3010,WEBM_DURATION_ELEMENT_MISSING:3011,WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING:3012,WEBM_CUE_TIME_ELEMENT_MISSING:3013,MEDIA_SOURCE_OPERATION_FAILED:3014,MEDIA_SOURCE_OPERATION_THREW:3015,VIDEO_ERROR:3016,QUOTA_EXCEEDED_ERROR:3017,HLS_FATAL_MEDIA_ERROR:3018,HLS_FRAG_PARSING_ERROR:3019,HLS_BUFFER_APPEND_ISSUE:3020,HLS_BUFFER_APPENDING_ISSUE:3021,NATIVE_ADAPTER_LOAD_FAILED:3022,HLS_BUFFER_STALLED_ERROR:3023,UNABLE_TO_GUESS_MANIFEST_TYPE:4e3,DASH_INVALID_XML:4001,DASH_NO_SEGMENT_INFO:4002,DASH_EMPTY_ADAPTATION_SET:4003,DASH_EMPTY_PERIOD:4004,DASH_WEBM_MISSING_INIT:4005,DASH_UNSUPPORTED_CONTAINER:4006,DASH_PSSH_BAD_ENCODING:4007,DASH_NO_COMMON_KEY_SYSTEM:4008,DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED:4009,DASH_CONFLICTING_KEY_IDS:4010,UNPLAYABLE_PERIOD:4011,RESTRICTIONS_CANNOT_BE_MET:4012,NO_PERIODS:4014,HLS_PLAYLIST_HEADER_MISSING:4015,INVALID_HLS_TAG:4016,HLS_INVALID_PLAYLIST_HIERARCHY:4017,DASH_DUPLICATE_REPRESENTATION_ID:4018,HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND:4020,HLS_COULD_NOT_GUESS_MIME_TYPE:4021,HLS_MASTER_PLAYLIST_NOT_PROVIDED:4022,HLS_REQUIRED_ATTRIBUTE_MISSING:4023,HLS_REQUIRED_TAG_MISSING:4024,HLS_COULD_NOT_GUESS_CODECS:4025,HLS_KEYFORMATS_NOT_SUPPORTED:4026,DASH_UNSUPPORTED_XLINK_ACTUATE:4027,DASH_XLINK_DEPTH_LIMIT:4028,HLS_LIVE_CONTENT_NOT_SUPPORTED:4029,HLSJS_CANNOT_PARSE:4030,INVALID_STREAMS_CHOSEN:5005,NO_RECOGNIZED_KEY_SYSTEMS:6e3,REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE:6001,FAILED_TO_CREATE_CDM:6002,FAILED_TO_ATTACH_TO_VIDEO:6003,INVALID_SERVER_CERTIFICATE:6004,FAILED_TO_CREATE_SESSION:6005,FAILED_TO_GENERATE_LICENSE_REQUEST:6006,LICENSE_REQUEST_FAILED:6007,LICENSE_RESPONSE_REJECTED:6008,ENCRYPTED_CONTENT_WITHOUT_DRM_INFO:6010,NO_LICENSE_SERVER_GIVEN:6012,OFFLINE_SESSION_REMOVED:6013,EXPIRED:6014,BAD_FAIRPLAY_RESPONSE:6015,COULD_NOT_CREATE_MEDIA_KEYS:6016,COULD_NOT_CREATE_KEY_SESSION:6017,LOAD_INTERRUPTED:7e3,BITRATE_SWITCH_ISSUE:7001,LOAD_FAILED:7002,RUNTIME_ERROR_NOT_REGISTERED_PLUGIN:7003,RUNTIME_ERROR_METHOD_NOT_IMPLEMENTED:7004,RUNTIME_ERROR_NOT_VALID_HANDLER:7005,NO_SOURCE_PROVIDED:7006,CAST_API_UNAVAILABLE:8e3,NO_CAST_RECEIVERS:8001,ALREADY_CASTING:8002,UNEXPECTED_CAST_ERROR:8003,CAST_CANCELED_BY_USER:8004,CAST_CONNECTION_TIMED_OUT:8005,CAST_RECEIVER_APP_UNAVAILABLE:8006,STORAGE_NOT_SUPPORTED:9e3,INDEXED_DB_ERROR:9001,OPERATION_ABORTED:9002,REQUESTED_ITEM_NOT_FOUND:9003,MALFORMED_OFFLINE_URI:9004,CANNOT_STORE_LIVE_OFFLINE:9005,STORE_ALREADY_IN_PROGRESS:9006,NO_INIT_DATA_FOR_OFFLINE:9007,LOCAL_PLAYER_INSTANCE_REQUIRED:9008,CONTENT_UNSUPPORTED_BY_BROWSER:9009};t.Code=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,ADS:8,STORAGE:9};t.Category=i},function(e,t,n){"use strict";function i(e,t,n){var i=null;if(n&&e){var r=[],a=1/0,o=!0,s=!1,u=void 0;try{for(var l,c=e[Symbol.iterator]();!(o=(l=c.next()).done);o=!0){var d=l.value,f=Math.abs(d.width-t);f<a?(a=f,r=[d]):f===a&&r.push(d)}}catch(e){s=!0,u=e}finally{try{!o&&c.return&&c.return()}finally{if(s)throw u}}var A=t/n,h=r,_=1/0,p=!0,v=!1,y=void 0;try{for(var g,E=r[Symbol.iterator]();!(p=(g=E.next()).done);p=!0){var m=g.value;if(m.height){var T=Math.abs(m.width/m.height-A);T<_?(_=T,h=[m]):T===_&&h.push(m)}}}catch(e){v=!0,y=e}finally{try{!p&&E.return&&E.return()}finally{if(v)throw y}}var b=0,k=!0,w=!1,S=void 0;try{for(var O,C=h[Symbol.iterator]();!(k=(O=C.next()).done);k=!0){var R=O.value;(R.bandwidth>b||!R.bandwidth)&&(b=R.bandwidth||b,i=R)}}catch(e){w=!0,S=e}finally{try{!k&&C.return&&C.return()}finally{if(w)throw S}}}return i}Object.defineProperty(t,"__esModule",{value:!0}),t.getSuitableSourceForResolution=i},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}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 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)}Object.defineProperty(t,"__esModule",{value:!0});var s=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),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),u=n(19),l=i(u),c=n(3),d=i(c),f=function(e){function t(){return r(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),s(t,null,[{key:"canPlayDrm",value:function(e){return t._logger.debug("Can play DRM scheme of: "+l.default.DrmScheme.FAIRPLAY),l.default.DrmSupport.isProtocolSupported(l.default.DrmScheme.FAIRPLAY,e)}},{key:"setDrmPlayback",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments[2];t._logger.debug("Sets DRM playback"),e.addEventListener(t._WebkitEvents.NEED_KEY,t._onWebkitNeedKey.bind(null,n),!1),t._errorCallback=i}},{key:"_onWebkitNeedKey",value:function(e,n){t._logger.debug("Webkit need key triggered");var i=e.find(function(e){return e.scheme===l.default.DrmScheme.FAIRPLAY});if(i&&!t._keySession){var r=i.certificate,a=n.target,o=n.initData,s=t._extractContentId(o),u=t._base64DecodeUint8Array(r);if(o=t._concatInitDataIdAndCertificate(o,s,u),!a.webkitKeys){var c=t._selectKeySystem();t._logger.debug("Sets media keys"),a.webkitSetMediaKeys(new window.WebKitMediaKeys(c))}a.webkitKeys||t._onError(d.default.Code.COULD_NOT_CREATE_MEDIA_KEYS),t._logger.debug("Creates session"),t._keySession=a.webkitKeys.createSession("video/mp4",o),t._keySession||t._onError(d.default.Code.COULD_NOT_CREATE_KEY_SESSION),t._keySession.contentId=s,t._keySession.addEventListener(t._WebkitEvents.KEY_MESSAGE,t._onWebkitKeyMessage.bind(null,i),!1),t._keySession.addEventListener(t._WebkitEvents.KEY_ADDED,t._onWebkitKeyAdded,!1),t._keySession.addEventListener(t._WebkitEvents.KEY_ERROR,t._onWebkitKeyError,!1)}}},{key:"destroy",value:function(){t._keySession=null}},{key:"_onWebkitKeyMessage",value:function(e,n){t._logger.debug("Webkit key message triggered");var i=n.message,r=new XMLHttpRequest;r.responseType="text",r.addEventListener("load",t._licenseRequestLoaded,!1),r.addEventListener("error",function(){return t._onError(d.default.Code.LICENSE_REQUEST_FAILED)},!1);var a=t._base64EncodeUint8Array(i);r.open("POST",e.licenseUrl,!0),r.setRequestHeader("Content-type","application/json"),t._logger.debug("Ready for license request"),r.send(a)}},{key:"_onWebkitKeyAdded",value:function(){t._logger.debug("Decryption key was added to session")}},{key:"_onWebkitKeyError",value:function(){t._logger.error("A decryption key error was encountered")}},{key:"_licenseRequestLoaded",value:function(e){t._logger.debug("License request loaded");var n=e.target,i=n.responseText.trim(),r={};try{r=JSON.parse(i)}catch(e){t._onError(d.default.Code.BAD_FAIRPLAY_RESPONSE,e)}var a=t._validateResponse(r);if(a.valid){var o=t._base64DecodeUint8Array(r.ckc);t._keySession.update(o)}else t._onError(d.default.Code.BAD_FAIRPLAY_RESPONSE,a)}},{key:"_onError",value:function(e,n){t._errorCallback(new d.default(d.default.Severity.CRITICAL,d.default.Category.DRM,e,n))}},{key:"_validateResponse",value:function(e){return e.message&&e.message.indexOf("error")>0||null===e.reference||500===e.status_code?{valid:!1,details:"internal server error"}:""===e.ckc?{valid:!1,details:"ckc is missing"}:{valid:!0}}},{key:"_extractContentId",value:function(e){var n=document.createElement("a");return n.href=t._arrayToString(e),n.hostname}},{key:"_selectKeySystem",value:function(){var e=null;return window.WebKitMediaKeys.isTypeSupported(t._KeySystem,"video/mp4")?e=t._KeySystem:t._logger.warn("Key System not supported"),e}},{key:"_arrayToString",value:function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))}},{key:"_base64DecodeUint8Array",value:function(e){for(var t=window.atob(e),n=t.length,i=new Uint8Array(new ArrayBuffer(n)),r=0;r<n;r++)i[r]=t.charCodeAt(r);return i}},{key:"_concatInitDataIdAndCertificate",value:function(e,n,i){"string"==typeof n&&(n=t._stringToArray(n));var r=0,a=new ArrayBuffer(e.byteLength+4+n.byteLength+4+i.byteLength),o=new DataView(a);new Uint8Array(a,r,e.byteLength).set(e),r+=e.byteLength,o.setUint32(r,n.byteLength,!0),r+=4;var s=new Uint8Array(a,r,n.byteLength);return s.set(n),r+=s.byteLength,o.setUint32(r,i.byteLength,!0),r+=4,new Uint8Array(a,r,i.byteLength).set(i),new Uint8Array(a,0,a.byteLength)}},{key:"_stringToArray",value:function(e){for(var t=new ArrayBuffer(2*e.length),n=new Uint16Array(t),i=0,r=e.length;i<r;i++)n[i]=e.charCodeAt(i);return n}},{key:"_base64EncodeUint8Array",value:function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="",i=void 0,r=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,c=0;c<e.length;)i=e[c++],r=c<e.length?e[c++]:Number.NaN,a=c<e.length?e[c++]:Number.NaN,o=i>>2,s=(3&i)<<4|r>>4,u=(15&r)<<2|a>>6,l=63&a,isNaN(r)?u=l=64:isNaN(a)&&(l=64),n+=t.charAt(o)+t.charAt(s)+t.charAt(u)+t.charAt(l);return n}}]),t}(l.default);f._logger=l.default.getLogger("FairPlay"),f._KeySystem="com.apple.fps.1_0",f._WebkitEvents={NEED_KEY:"webkitneedkey",KEY_MESSAGE:"webkitkeymessage",KEY_ADDED:"webkitkeyadded",KEY_ERROR:"webkitkeyerror"},t.default=f},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=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),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(11),s=i(o),u=n(0),l=i(u),c=n(20),d="not_supported_drm_playback",f=function(){function e(){r(this,e)}return a(e,null,[{key:"isProtocolSupported",value:function(t,n){var i=s.default.browser.name;if("function"==typeof e._Browsers[i]){var r=e._Browsers[i]();return e._logger.debug("Supported DRM scheme for current environment is: "+r),r===t&&!!n.find(function(e){return e.scheme===t})}return!1}}]),e}();f._logger=(0,l.default)("DrmSupport"),f._Browsers={Safari:function(){var e=s.default.device.type,t=s.default.os.name;return e||"Mac OS"!==t?d:c.DrmScheme.FAIRPLAY},Chrome:function(){var e=s.default.device.type,t=s.default.os.name;return e&&"Android"!==t?d:c.DrmScheme.WIDEVINE},Firefox:function(){return s.default.device.type?d:c.DrmScheme.WIDEVINE},Edge:function(){return s.default.device.type?d:c.DrmScheme.PLAYREADY},IE:function(){var e=s.default.device.type,t=s.default.os.name,n=s.default.os.version;return!e&&"Windows"===t&&Number.parseFloat(n)>=8.1?c.DrmScheme.PLAYREADY:d}},t.default=f},function(e,t,n){"use strict";function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=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),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(2),s=i(o),u=n(45),l=i(u),c=n(4),d=s.Dom.createElement("video");d.src=l.Base64Mp4Source,d.setAttribute("playsinline","");var f=function(){function e(){r(this,e)}return a(e,null,[{key:"runCapability",value:function(){e._playPromiseResult=new Promise(function(t){e._getPlayPromise().then(function(){return t({autoplay:!0,mutedAutoPlay:!0})}).catch(function(){d.muted=!0,d.setAttribute("muted",""),e._getPlayPromise().then(function(){return t({autoplay:!1,mutedAutoPlay:!0})}).catch(function(){return t({autoplay:!1,mutedAutoPlay:!1})})})})}},{key:"getCapability",value:function(){return e._playPromiseResult}},{key:"_getPlayPromise",value:function(){return d.play()||e._forcePromiseReturnValue()}},{key:"_forcePromiseReturnValue",value:function(){return new Promise(function(e,t){var n=setTimeout(function(){t()},500);d.addEventListener(c.Html5EventType.PLAYING,function(){clearTimeout(n),e()}),d.addEventListener(c.Html5EventType.ERROR,function(){clearTimeout(n),t()})})}}]),e}();t.default=f},function(e,t){e.exports={Base64Mp4Source:"data:video/mp4;base64,AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAAAhmcmVlAAAC721kYXQhEAUgpBv/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3pwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcCEQBSCkG//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADengAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAAsJtb292AAAAbG12aGQAAAAAAAAAAAAAAAAAAAPoAAAALwABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAB7HRyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAIAAAAAAAAALwAAAAAAAAAAAAAAAQEAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAAC8AAAAAAAEAAAAAAWRtZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAAKxEAAAIAFXEAAAAAAAtaGRscgAAAAAAAAAAc291bgAAAAAAAAAAAAAAAFNvdW5kSGFuZGxlcgAAAAEPbWluZgAAABBzbWhkAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAADTc3RibAAAAGdzdHNkAAAAAAAAAAEAAABXbXA0YQAAAAAAAAABAAAAAAAAAAAAAgAQAAAAAKxEAAAAAAAzZXNkcwAAAAADgICAIgACAASAgIAUQBUAAAAAAfQAAAHz+QWAgIACEhAGgICAAQIAAAAYc3R0cwAAAAAAAAABAAAAAgAABAAAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAIAAAABAAAAHHN0c3oAAAAAAAAAAAAAAAIAAAFzAAABdAAAABRzdGNvAAAAAAAAAAEAAAAsAAAAYnVkdGEAAABabWV0YQAAAAAAAAAhaGRscgAAAAAAAAAAbWRpcmFwcGwAAAAAAAAAAAAAAAAtaWxzdAAAACWpdG9vAAAAHWRhdGEAAAABAAAAAExhdmY1Ni40MC4xMDE="}},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=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),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=n(2),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(a),s=function(){function e(){i(this,e)}return r(e,null,[{key:"runCapability",value:function(){try{e._vid.volume=.5,e._result=!!e._vid.canPlayType}catch(t){e._result=!1}}},{key:"getCapability",value:function(){return Promise.resolve({isSupported:e._result})}}]),e}();s._vid=o.Dom.createElement("video"),t.default=s},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=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),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=n(10),u=(i(s),n(6)),l=i(u),c=n(48),d=i(c),f=n(15),A=n(4),h=n(1),_=i(h),p=n(0),v=i(p),y=function(){function e(t){var n,i,o,s,u,c,h=this;a(this,e),this._transitions=(c={},r(c,f.StateType.IDLE,(n={},r(n,A.Html5EventType.LOAD_START,function(){h._updateState(f.StateType.LOADING),h._dispatchEvent()}),r(n,A.Html5EventType.PLAY,function(){h._updateState(f.StateType.BUFFERING),h._dispatchEvent()}),n)),r(c,f.StateType.LOADING,(i={},r(i,A.Html5EventType.LOADED_METADATA,function(){h._updateState(f.StateType.PAUSED),h._dispatchEvent()}),r(i,A.Html5EventType.ERROR,function(){h._updateState(f.StateType.IDLE),h._dispatchEvent()}),i)),r(c,f.StateType.PAUSED,(o={},r(o,A.Html5EventType.PLAY,function(){h._updateState(f.StateType.PLAYING),h._dispatchEvent()}),r(o,A.Html5EventType.PLAYING,function(){h._updateState(f.StateType.PLAYING),h._dispatchEvent()}),r(o,A.Html5EventType.ENDED,function(){h._updateState(f.StateType.IDLE),h._dispatchEvent()}),o)),r(c,f.StateType.PLAYING,(s={},r(s,A.Html5EventType.PAUSE,function(){h._updateState(f.StateType.PAUSED),h._dispatchEvent()}),r(s,A.Html5EventType.WAITING,function(){h._updateState(f.StateType.BUFFERING),h._dispatchEvent()}),r(s,A.Html5EventType.ENDED,function(){h._updateState(f.StateType.IDLE),h._dispatchEvent()}),r(s,A.Html5EventType.ERROR,function(){h._updateState(f.StateType.IDLE),h._dispatchEvent()}),s)),r(c,f.StateType.BUFFERING,(u={},r(u,A.Html5EventType.PLAYING,function(){h._updateState(f.StateType.PLAYING),h._dispatchEvent()}),r(u,A.Html5EventType.PAUSE,function(){h._updateState(f.StateType.PAUSED),h._dispatchEvent()}),r(u,A.Html5EventType.SEEKED,function(){h._prevState&&h._prevState.type===f.StateType.PLAYING&&(h._updateState(f.StateType.PLAYING),h._dispatchEvent())}),u)),c),this._player=t,this._logger=(0,v.default)("StateManager"),this._eventManager=new l.default,this._history=[],this._prevState=null,this._curState=new d.default(f.StateType.IDLE),this._attachListeners()}return o(e,[{key:"_attachListeners",value:function(){this._eventManager.listen(this._player,A.Html5EventType.ERROR,this._doTransition.bind(this)),this._eventManager.listen(this._player,A.Html5EventType.ENDED,this._doTransition.bind(this)),this._eventManager.listen(this._player,A.Html5EventType.PLAY,this._doTransition.bind(this)),this._eventManager.listen(this._player,A.Html5EventType.LOAD_START,this._doTransition.bind(this)),this._eventManager.listen(this._player,A.Html5EventType.PLAYING,this._doTransition.bind(this)),this._eventManager.listen(this._player,A.Html5EventType.LOADED_METADATA,this._doTransition.bind(this)),this._eventManager.listen(this._player,A.Html5EventType.PAUSE,this._doTransition.bind(this)),this._eventManager.listen(this._player,A.Html5EventType.WAITING,this._doTransition.bind(this)),this._eventManager.listen(this._player,A.Html5EventType.SEEKED,this._doTransition.bind(this))}},{key:"_doTransition",value:function(e){this._logger.debug("Do transition request",e.type);var t=this._transitions[this._curState.type];"function"==typeof t[e.type]&&t[e.type]()}},{key:"_updateState",value:function(e){this._curState.type!==e&&(this._curState.duration=Date.now()/1e3,this._history.push(this._curState),this._prevState=this._curState,this._curState=new d.default(e),this._logger.debug("Switch player state: from "+this._prevState.type+" to "+this._curState.type))}},{key:"_dispatchEvent",value:function(){var e=new _.default(A.CustomEventType.PLAYER_STATE_CHANGED,{oldState:this._prevState,newState:this._curState});this._player.dispatchEvent(e)}},{key:"destroy",value:function(){this._history=[],this._eventManager.destroy()}},{key:"reset",value:function(){this._history=[]}},{key:"currentState",get:function(){return this._curState}},{key:"previousState",get:function(){return this._prevState}},{key:"history",get:function(){return this._history}}]),e}();t.default=y},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=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),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=function(){function e(t){i(this,e),this.type=t,this._duration=0,this._timestamp=Date.now()/1e3}return r(e,[{key:"duration",get:function(){return this._duration},set:function(e){this._duration=e-this._timestamp}}]),e}();t.default=a},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=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),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(50),s=i(o),u=n(16),l=(i(u),function(){function e(){r(this,e),this._middleware=new s.default(e.Actions)}return a(e,[{key:"use",value:function(e){this._middleware.use(e)}},{key:"play",value:function(t){this._middleware.run(e.Actions.PLAY,t)}},{key:"pause",value:function(t){this._middleware.run(e.Actions.PAUSE,t)}}]),e}());l.Actions={PLAY:"play",PAUSE:"pause"},t.default=l},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=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),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(13),s=i(o),u=n(16),l=(i(u),n(0)),c=i(l),d=function(){function e(t){r(this,e),this._actions=t,this._middlewares=new s.default,this._logger=(0,c.default)("Middleware")}return a(e,[{key:"use",value:function(e){for(var t in this._actions){var n=this._actions[t];"function"==typeof e[n]&&(this._logger.debug("Register <"+e.id+"> for action "+n),this._middlewares.push(n,e[n].bind(e)))}}},{key:"run",value:function(e,t){var n=this;this._logger.debug("Start middleware chain for action "+e);var i=this._middlewares.get(e);this._executeMiddleware(i,function(){n._logger.debug("Finish middleware chain for action "+e),t()})}},{key:"_executeMiddleware",value:function(e,t){e.reduceRight(function(e,t){return function(n){t(e)}},t)()}}]),e}();t.default=d},function(e,t){e.exports={logLevel:"ERROR",type:"Unknown",sources:{hls:[],dash:[],progressive:[]},plugins:{},metadata:{poster:"",description:""},playback:{audioLanguage:"",textLanguage:"",useNativeTextTrack:!1,volume:1,startTime:0,playsinline:!0,preload:"none",autoplay:!1,allowMutedAutoPlay:!0,muted:!1,options:{html5:{hls:{},dash:{}}},preferNative:{hls:!1,dash:!1},streamPriority:[{engine:"html5",format:"hls"},{engine:"html5",format:"dash"},{engine:"html5",format:"progressive"}]}}},function(e,t,n){var i=n(53);"string"==typeof i&&(i=[[e.i,i,""]]);var r={};r.transform=void 0;n(55)(i,r);i.locals&&(e.exports=i.locals)},function(e,t,n){t=e.exports=n(54)(void 0),t.push([e.i,".playkit-container {\n position: relative;\n width: 100%;\n height: 100%;\n color: #fff;\n outline: none;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n\n.playkit-engine {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n object-fit: contain;\n}\n\n.playkit-engine video::-webkit-media-controls-panel,\n.playkit-engine video::-webkit-media-controls-panel-container,\n.playkit-engine video::-webkit-media-controls-start-playback-button,\n.playkit-engine video::-webkit-media-controls-play-button {\n display: none;\n -webkit-appearance: none\n}\n\n.playkit-poster {\n position: absolute;\n display: block;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-size: contain;\n background-position: center center;\n background-repeat: no-repeat;\n background-color: #000;\n}\n\n.playkit-subtitles {\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n}\n\n",""])},function(e,t){function n(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var a=i(r);return[n].concat(r.sources.map(function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"})).concat([a]).join("\n")}return[n].join("\n")}function i(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var i=n(t,e);return t[2]?"@media "+t[2]+"{"+i+"}":i}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var i={},r=0;r<this.length;r++){var a=this[r][0];"number"==typeof a&&(i[a]=!0)}for(r=0;r<e.length;r++){var o=e[r];"number"==typeof o[0]&&i[o[0]]||(n&&!o[2]?o[2]=n:n&&(o[2]="("+o[2]+") and ("+n+")"),t.push(o))}},t}},function(e,t,n){function i(e,t){for(var n=0;n<e.length;n++){var i=e[n],r=h[i.id];if(r){r.refs++;for(var a=0;a<r.parts.length;a++)r.parts[a](i.parts[a]);for(;a<i.parts.length;a++)r.parts.push(c(i.parts[a],t))}else{for(var o=[],a=0;a<i.parts.length;a++)o.push(c(i.parts[a],t));h[i.id]={id:i.id,refs:1,parts:o}}}}function r(e,t){for(var n=[],i={},r=0;r<e.length;r++){var a=e[r],o=t.base?a[0]+t.base:a[0],s=a[1],u=a[2],l=a[3],c={css:s,media:u,sourceMap:l};i[o]?i[o].parts.push(c):n.push(i[o]={id:o,parts:[c]})}return n}function a(e,t){var n=p(e.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var i=g[g.length-1];if("top"===e.insertAt)i?i.nextSibling?n.insertBefore(t,i.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),g.push(t);else{if("bottom"!==e.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");n.appendChild(t)}}function o(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=g.indexOf(e);t>=0&&g.splice(t,1)}function s(e){var t=document.createElement("style");return e.attrs.type="text/css",l(t,e.attrs),a(e,t),t}function u(e){var t=document.createElement("link");return e.attrs.type="text/css",e.attrs.rel="stylesheet",l(t,e.attrs),a(e,t),t}function l(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function c(e,t){var n,i,r,a;if(t.transform&&e.css){if(!(a=t.transform(e.css)))return function(){};e.css=a}if(t.singleton){var l=y++;n=v||(v=s(t)),i=d.bind(null,n,l,!1),r=d.bind(null,n,l,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=u(t),i=A.bind(null,n,t),r=function(){o(n),n.href&&URL.revokeObjectURL(n.href)}):(n=s(t),i=f.bind(null,n),r=function(){o(n)});return i(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;i(e=t)}else r()}}function d(e,t,n,i){var r=n?"":i.css;if(e.styleSheet)e.styleSheet.cssText=m(t,r);else{var a=document.createTextNode(r),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(a,o[t]):e.appendChild(a)}}function f(e,t){var n=t.css,i=t.media;if(i&&e.setAttribute("media",i),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function A(e,t,n){var i=n.css,r=n.sourceMap,a=void 0===t.convertToAbsoluteUrls&&r;(t.convertToAbsoluteUrls||a)&&(i=E(i)),r&&(i+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var o=new Blob([i],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(o),s&&URL.revokeObjectURL(s)}var h={},_=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}}(function(){return window&&document&&document.all&&!window.atob}),p=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e.call(this,n)),t[n]}}(function(e){return document.querySelector(e)}),v=null,y=0,g=[],E=n(56);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||{},t.attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||(t.singleton=_()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=r(e,t);return i(n,t),function(e){for(var a=[],o=0;o<n.length;o++){var s=n[o],u=h[s.id];u.refs--,a.push(u)}if(e){i(r(e,t),t)}for(var o=0;o<a.length;o++){var u=a[o];if(0===u.refs){for(var l=0;l<u.parts.length;l++)u.parts[l]();delete h[u.id]}}}};var m=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}()},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 n=t.protocol+"//"+t.host,i=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,t){var r=t.trim().replace(/^"(.*)"$/,function(e,t){return t}).replace(/^'(.*)'$/,function(e,t){return t});if(/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(r))return e;var a;return a=0===r.indexOf("//")?r:0===r.indexOf("/")?n+r:i+r.replace(/^\.\//,""),"url("+JSON.stringify(a)+")"})}}])});
//# sourceMappingURL=playkit.js.map