UNPKG

@playkit-js/info

Version:

[![Build Status](https://github.com/kaltura/playkit-js-info/actions/workflows/run_canary_full_flow.yaml/badge.svg)](https://github.com/kaltura/playkit-js-info/actions/workflows/run_canary_full_flow.yaml) [![code style: prettier](https://img.shields.io/bad

13 lines 2.65 MB
/** * Bundle builder 2.2.4/5c718c1 * Created at Thu Dec 19 2024 13:52:27 GMT+0000 (Coordinated Universal Time) * ------------------- * Kaltura Player lib * kaltura-ovp-player v3.17.32-canary.0-eb5c085 * playkit-kaltura-cuepoints v3.0.15-canary.0-e770541 * playkit-kava v1.8.4-canary.0-2d7a6e8 * playkit-timeline v3.0.21-canary.0-42fe274 * playkit-ui-managers v1.6.4-canary.0-69b8931 */ /*! For license information please see kaltura-ovp-player.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.KalturaPlayer=t():e.KalturaPlayer=t()}(self,(()=>(()=>{var e={129:(module,e,t)=>{"use strict";t.d(e,{Z:()=>o});var n=t(864),r=t.n(n),i=t(352),a=t.n(i)()(r());a.push([module.id,".kaltura-player-container {\n width: 100%;\n height: 100%;\n position: relative;\n background-color: #000;\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","",{version:3,sources:["webpack://./assets/style.css"],names:[],mappings:"AAAA;EACE,WAAW;EACX,YAAY;EACZ,kBAAkB;EAClB,sBAAsB;EACtB,aAAa;EACb,2BAA2B;EAC3B,yBAAyB;EACzB,sBAAsB;EACtB,qBAAqB;EACrB,iBAAiB;EACjB,wCAAwC;AAC1C",sourcesContent:[".kaltura-player-container {\n width: 100%;\n height: 100%;\n position: relative;\n background-color: #000;\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"],sourceRoot:""}]);const o=a},644:(module,e,t)=>{var n,r;self,module.exports=(n=t(75),r=t(150),function(){var e={774:function(e,t,n){"use strict";var r=n(537),i=n.n(r),a=n(645),o=n.n(a)()(i());o.push([e.id,".shaka-text-container {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n pointer-events: none;\n width: 100%;\n min-width: 48px;\n transition: bottom cubic-bezier(0.4, 0, 0.6, 1) 0.1s;\n transition-delay: 0s;\n font-size: 20px;\n line-height: 1.4;\n color: #fff;\n font-family: Roboto-Regular, Roboto, sans-serif, TengwarTelcontar;\n}\n.shaka-text-container span.shaka-text-wrapper {\n display: inline;\n background: 0 0;\n text-align: center;\n}\n\n:fullscreen .shaka-text-container {\n font-size: 4.4vmin;\n}\n\n:-webkit-full-screen .shaka-text-container {\n font-size: 4.4vmin;\n}\n\n:-moz-full-screen .shaka-text-container {\n font-size: 4.4vmin;\n}\n\n:-ms-fullscreen .shaka-text-container {\n font-size: 4.4vmin;\n}\n","",{version:3,sources:["webpack://./src/assets/style.css"],names:[],mappings:"AAAA;EACE,kBAAkB;EAClB,OAAO;EACP,QAAQ;EACR,MAAM;EACN,SAAS;EACT,oBAAoB;EACpB,WAAW;EACX,eAAe;EACf,oDAAoD;EACpD,oBAAoB;EACpB,eAAe;EACf,gBAAgB;EAChB,WAAW;EACX,iEAAiE;AACnE;AACA;EACE,eAAe;EACf,eAAe;EACf,kBAAkB;AACpB;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,kBAAkB;AACpB",sourcesContent:[".shaka-text-container {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n pointer-events: none;\n width: 100%;\n min-width: 48px;\n transition: bottom cubic-bezier(0.4, 0, 0.6, 1) 0.1s;\n transition-delay: 0s;\n font-size: 20px;\n line-height: 1.4;\n color: #fff;\n font-family: Roboto-Regular, Roboto, sans-serif, TengwarTelcontar;\n}\n.shaka-text-container span.shaka-text-wrapper {\n display: inline;\n background: 0 0;\n text-align: center;\n}\n\n:fullscreen .shaka-text-container {\n font-size: 4.4vmin;\n}\n\n:-webkit-full-screen .shaka-text-container {\n font-size: 4.4vmin;\n}\n\n:-moz-full-screen .shaka-text-container {\n font-size: 4.4vmin;\n}\n\n:-ms-fullscreen .shaka-text-container {\n font-size: 4.4vmin;\n}\n"],sourceRoot:""}]),t.Z=o},645:function(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,i,a){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(r)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(o[l]=!0)}for(var u=0;u<e.length;u++){var c=[].concat(e[u]);r&&o[c[0]]||(void 0!==a&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=a),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),t.push(c))}},t}},537:function(e){"use strict";e.exports=function(e){var t=e[1],n=e[3];if(!n)return t;if("function"==typeof btoa){var r=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),i="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),a="/*# ".concat(i," */");return[t].concat([a]).join("\n")}return[t].join("\n")}},379:function(e){"use strict";var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var a={},o=[],s=0;s<e.length;s++){var l=e[s],u=r.base?l[0]+r.base:l[0],c=a[u]||0,d="".concat(u," ").concat(c);a[u]=c+1;var p=n(d),f={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==p)t[p].references++,t[p].updater(f);else{var h=i(f,r);r.byIndex=s,t.splice(s,0,{identifier:d,updater:h,references:1})}o.push(d)}return o}function i(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,i){var a=r(e=e||[],i=i||{});return function(e){e=e||[];for(var o=0;o<a.length;o++){var s=n(a[o]);t[s].references--}for(var l=r(e,i),u=0;u<a.length;u++){var c=n(a[u]);0===t[c].references&&(t[c].updater(),t.splice(c,1))}a=l}}},569:function(e){"use strict";var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},216:function(e){"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},565:function(e,t,n){"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},795:function(e){"use strict";e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var a=n.sourceMap;a&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},589:function(e){"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},952:function(e){"use strict";e.exports=n},475:function(e){"use strict";e.exports=r},61:function(e,t,n){var r=n(698).default;function i(){"use strict";e.exports=i=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var t,n={},a=Object.prototype,o=a.hasOwnProperty,s=Object.defineProperty||function(e,t,n){e[t]=n.value},l="function"==typeof Symbol?Symbol:{},u=l.iterator||"@@iterator",c=l.asyncIterator||"@@asyncIterator",d=l.toStringTag||"@@toStringTag";function p(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(t){p=function(e,t,n){return e[t]=n}}function f(e,t,n,r){var i=t&&t.prototype instanceof k?t:k,a=Object.create(i.prototype),o=new O(r||[]);return s(a,"_invoke",{value:P(e,n,o)}),a}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=f;var y="suspendedStart",g="suspendedYield",v="executing",m="completed",b={};function k(){}function E(){}function _(){}var T={};p(T,u,(function(){return this}));var A=Object.getPrototypeOf,S=A&&A(A(L([])));S&&S!==a&&o.call(S,u)&&(T=S);var w=_.prototype=k.prototype=Object.create(T);function C(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function n(i,a,s,l){var u=h(e[i],e,a);if("throw"!==u.type){var c=u.arg,d=c.value;return d&&"object"==r(d)&&o.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,s,l)}),(function(e){n("throw",e,s,l)})):t.resolve(d).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,l)}))}l(u.arg)}var i;s(this,"_invoke",{value:function(e,r){function a(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(a,a):a()}})}function P(e,n,r){var i=y;return function(a,o){if(i===v)throw new Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(r.method=a,r.arg=o;;){var s=r.delegate;if(s){var l=R(s,r);if(l){if(l===b)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===y)throw i=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=v;var u=h(e,n,r);if("normal"===u.type){if(i=r.done?m:g,u.arg===b)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=m,r.method="throw",r.arg=u.arg)}}}function R(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,R(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),b;var a=h(i,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,b;var o=a.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,b):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,b)}function I(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(I,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[u];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i<e.length;)if(o.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}throw new TypeError(r(e)+" is not iterable")}return E.prototype=_,s(w,"constructor",{value:_,configurable:!0}),s(_,"constructor",{value:E,configurable:!0}),E.displayName=p(_,d,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===E||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,p(e,d,"GeneratorFunction")),e.prototype=Object.create(w),e},n.awrap=function(e){return{__await:e}},C(x.prototype),p(x.prototype,c,(function(){return this})),n.AsyncIterator=x,n.async=function(e,t,r,i,a){void 0===a&&(a=Promise);var o=new x(f(e,t,r,i),a);return n.isGeneratorFunction(t)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},C(w),p(w,d,"Generator"),p(w,u,(function(){return this})),p(w,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=L,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(D),!e)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var l=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(l&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,b):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),D(n),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;D(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),b}},n}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},698:function(e){function t(n){return e.exports=t="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},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},687:function(e,t,n){var r=n(61)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},t={};function i(n){var r=t[n];if(void 0!==r)return r.exports;var a=t[n]={id:n,exports:{}};return e[n](a,a.exports,i),a.exports}i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nc=void 0;var a={};return function(){"use strict";i.r(a),i.d(a,{NAME:function(){return se},VERSION:function(){return oe},default:function(){return le}});var e=i(952);function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function n(e,n){if(e){if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}function r(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||n(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t,n,r,i,a,o){try{var s=e[a](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function s(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function s(e){o(a,r,i,s,l,"next",e)}function l(e){o(a,r,i,s,l,"throw",e)}s(void 0)}))}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e){return u="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(e)}function c(e){var t=function(e,t){if("object"!=u(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=u(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==u(t)?t:String(t)}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function p(e,t,n){return t&&d(e.prototype,t),n&&d(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function y(){return y="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=h(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},y.apply(this,arguments)}function g(e,t){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},g(e,t)}function v(e,t,n){return(t=c(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var m,b,k=i(687),E=i.n(k),_=i(475),T=i.n(_),A=(m=function(){function t(){l(this,t)}return p(t,null,[{key:"isConfigured",value:function(t,n){return e.DrmScheme.WIDEVINE===n.keySystem&&!!t.find((function(e){return e.scheme===n.keySystem}))}},{key:"canPlayDrm",value:function(n){return t._logger.debug("Can play DRM scheme of: "+e.DrmScheme.WIDEVINE),!!n.find((function(t){return t.scheme===e.DrmScheme.WIDEVINE}))}},{key:"setDrmPlayback",value:function(n,r){t._logger.debug("Sets drm playback");var i=e.Env.browser.name,a=r.find((function(t){return t.scheme===e.DrmScheme.WIDEVINE}));a&&(n.drm={servers:v({},e.DrmScheme.WIDEVINE,a.licenseUrl),advanced:{}},"Chrome"===i&&(n.drm.advanced=v({},e.DrmScheme.WIDEVINE,{videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"})))}}]),t}(),v(m,"_logger",(0,e.getLogger)("Widevine")),m),S=(b=function(){function t(){l(this,t)}return p(t,null,[{key:"isConfigured",value:function(t,n){return e.DrmScheme.PLAYREADY===n.keySystem&&!!t.find((function(e){return e.scheme===n.keySystem}))}},{key:"canPlayDrm",value:function(n){return t._logger.debug("Can play DRM scheme of: "+e.DrmScheme.PLAYREADY),!!n.find((function(t){return t.scheme===e.DrmScheme.PLAYREADY}))}},{key:"setDrmPlayback",value:function(n,r){t._logger.debug("Sets drm playback");var i=r.find((function(t){return t.scheme===e.DrmScheme.PLAYREADY}));i&&(n.drm={servers:v({},e.DrmScheme.PLAYREADY,i.licenseUrl)})}}]),t}(),v(b,"_logger",(0,e.getLogger)("PlayReady")),b),w=JSON.parse('{"shakaConfig":{"streaming":{"ignoreTextStreamFailures":true,"bufferingGoal":60,"alwaysStreamText":true},"abr":{"enabled":true,"restrictions":{}}},"forceRedirectExternalStreams":false,"trackEmsgEvents":true,"switchDynamicToStatic":false,"stallDetectionThreshold":3}'),C=i(379),x=i.n(C),P=i(795),R=i.n(P),I=i(569),D=i.n(I),O=i(565),L=i.n(O),M=i(216),N=i.n(M),U=i(589),B=i.n(U),F=i(774),j={};j.styleTagTransform=B(),j.setAttributes=L(),j.insert=D().bind(null,"head"),j.domAPI=R(),j.insertStyleElement=N(),x()(F.Z,j),F.Z&&F.Z.locals&&F.Z.locals;var H=function(){function e(t){l(this,e),this._media=K.parseAttr(t,G.AttributeTypes.MEDIA),this._startNumber=K.parseAttr(t,G.AttributeTypes.START_NUMBER,K.parseInt,1),this._duration=K.parseAttr(t,G.AttributeTypes.DURATION,K.parseFloat),this._timescale=K.parseAttr(t,G.AttributeTypes.TIMESCALE,K.parsePositiveInt,1),this._presentationTimeOffset=K.parseAttr(t,G.AttributeTypes.PRESENTATION_TIME_OFFSET,K.parseInt,0),this._endNumber=K.parseAttr(t,G.AttributeTypes.END_NUMBER,K.parsePositiveInt)}return p(e,[{key:"media",get:function(){return this._media}},{key:"startNumber",get:function(){return this._startNumber}},{key:"duration",get:function(){return this._duration}},{key:"timescale",get:function(){return this._timescale}},{key:"presentationTimeOffset",get:function(){return this._presentationTimeOffset}},{key:"endNumber",get:function(){return this._endNumber}}]),e}();v(H,"MediaTemplateType",{REPRESENTATION:"$RepresentationID$",NUMBER:"$Number$",BANDWIDTH:"$Bandwidth$",TIME:"$Time$"});var V=function(e,t){var n=t.id,r=t.index,i=t.bitrate,a=t.time,o=e.match(/\$([a-zA-Z]+)\$/g),s=function(e,t,n){return n?e.replace(t,n):e};return o&&o.forEach((function(t){switch(t){case H.MediaTemplateType.REPRESENTATION:e=s(e,t,n);break;case H.MediaTemplateType.NUMBER:e=s(e,t,r);break;case H.MediaTemplateType.BANDWIDTH:e=s(e,t,i);break;case H.MediaTemplateType.TIME:e=s(e,t,a)}})),e},G={TagTypes:{BASE_URL:"BaseURL",SEGMENT_TEMPLATE:"SegmentTemplate",REPRESENTATION:"Representation",ESSENTIAL_PROPERTY:"EssentialProperty",ADAPTATION_SET:"AdaptationSet"},AttributeTypes:{BASE_URL:"BaseURL",ID:"id",CONTENT_TYPE:"contentType",MIME_TYPE:"mimeType",MEDIA:"media",DURATION:"duration",START_NUMBER:"startNumber",TIMESCALE:"timescale",PRESENTATION_TIME_OFFSET:"presentationTimeOffset",END_NUMBER:"endNumber",BANDWIDTH:"bandwidth",WIDTH:"width",HEIGHT:"height",SCHEME_ID_URI:"schemeIdUri",VALUE:"value"}},K={parseXml:function(e){return(new DOMParser).parseFromString(e,"text/xml")},parseAttr:function(e,t,n,r){var i=null,a=e.getAttribute(t);return null!==a&&(i=n?n(a):a),null===i?r:i},findElements:function(e,t){return e.getElementsByTagName(t)},findChild:function(e,t){var n=this.findChildren(e,t);return 1!==n.length?null:n[0]},findChildren:function(e,t){return Array.from(e.childNodes).filter((function(e){return e instanceof Element&&e.tagName===t}))},parseInt:function(e){var t=Number(e);return t%1==0?t:null},parsePositiveInt:function(e){var t=Number(e);return t%1==0&&t>0?t:null},parseFloat:function(e){var t=Number(e);return isNaN(t)?null:t}},z=function(){function e(t){l(this,e),this._schemeIdUri=K.parseAttr(t,G.AttributeTypes.SCHEME_ID_URI),this._value=K.parseAttr(t,G.AttributeTypes.VALUE)}return p(e,[{key:"schemeIdUri",get:function(){return this._schemeIdUri}},{key:"value",get:function(){return this._value}}]),e}(),W=function(){function e(t){l(this,e),this._id=K.parseAttr(t,G.AttributeTypes.ID),this._bandwidth=K.parseAttr(t,G.AttributeTypes.BANDWIDTH,parseInt),this._width=K.parseAttr(t,G.AttributeTypes.WIDTH,parseInt),this._height=K.parseAttr(t,G.AttributeTypes.HEIGHT,parseInt);var n=K.findChild(t,G.TagTypes.ESSENTIAL_PROPERTY);n&&(this._essentialProperty=new z(n))}return p(e,[{key:"bandwidth",get:function(){return this._bandwidth}},{key:"id",get:function(){return this._id}},{key:"width",get:function(){return this._width}},{key:"height",get:function(){return this._height}},{key:"essentialProperty",get:function(){return this._essentialProperty}}]),e}(),Y=function(){function e(t){l(this,e),this._id=K.parseAttr(t,G.AttributeTypes.ID),this._mimeType=K.parseAttr(t,G.AttributeTypes.MIME_TYPE),this._contentType=K.parseAttr(t,G.AttributeTypes.CONTENT_TYPE),this._representations=Array.from(K.findChildren(t,G.TagTypes.REPRESENTATION)).map((function(e){return new W(e)}));var n=K.findChild(t,G.TagTypes.SEGMENT_TEMPLATE);n&&(this._segmentTemplate=new H(n));var r=K.findChild(t,G.TagTypes.ESSENTIAL_PROPERTY);r&&(this._essentialProperty=new z(r))}return p(e,[{key:"id",get:function(){return this._id}},{key:"mimeType",get:function(){return this._mimeType}},{key:"contentType",get:function(){return this._contentType}},{key:"segmentTemplate",get:function(){return this._segmentTemplate}},{key:"essentialProperty",get:function(){return this._essentialProperty}},{key:"representations",get:function(){return this._representations}}]),e}();v(Y,"ContentType",{VIDEO:"video",AUDIO:"audio",TEXT:"text",IMAGE:"image"});var Z,q=function(){function t(n){var r,i,a=this;l(this,t),v(this,"_logger",(0,e.getLogger)("DashManifestParser")),v(this,"_parseAdaptionSets",(function(){var e=K.findElements(a._xmlDoc,G.TagTypes.BASE_URL);e&&e.length>0&&e[0].innerHTML&&(a._baseURL=e[0].textContent);var t=K.findElements(a._xmlDoc,G.TagTypes.ADAPTATION_SET),n=Array.from(t).filter((function(e){return K.parseAttr(e,G.AttributeTypes.CONTENT_TYPE)===Y.ContentType.IMAGE}));n.length>0?(a._adaptationSets=n.map((function(e){return new Y(e)})),a._logger.debug("Found image adaptation set",a._adaptationSets)):a._logger.debug("No image adaptations were found in manifest")})),this._logger.debug("Initialize manifest parser"),this._adaptationSets=[],(r=n instanceof ArrayBuffer?(i=n,TextDecoder?(new TextDecoder).decode(new Uint8Array(i)):null):n)&&(this._xmlDoc=K.parseXml(r))}return p(t,[{key:"parseManifest",value:function(){try{this._logger.debug("Start parsing dash manifest"),this._parseAdaptionSets(),this._logger.debug("Manifest parsing finished successfully")}catch(e){this._logger.warn("Manifest parsing failed",e)}}},{key:"getBaseUrl",value:function(){return this._baseURL||""}},{key:"getImageSet",value:function(){return this._adaptationSets.find((function(e){return e.contentType===Y.ContentType.IMAGE}))}},{key:"hasImageSet",value:function(){return!!this.getImageSet()}},{key:"adaptationSets",get:function(){return this._adaptationSets}}],[{key:"isValid",value:function(){return!(!window.TextEncoder||!window.TextDecoder)}}]),t}(),X=function(){function t(r,i,a){var o=this;l(this,t),v(this,"_tracks",[]),v(this,"_parseTracks",(function(t,r,i){var a=t.representations,s=t.segmentTemplate,l=t.essentialProperty;a.forEach((function(t,a){var u,c,d=t.id,p=t.bandwidth,f=t.width,h=t.height,y=s,g=y.startNumber,v=y.duration,m=y.media,b=y.timescale,k=y.presentationTimeOffset,E=o._getEssentialValue(l,t),_=(c=2,function(e){if(Array.isArray(e))return e}(u=o._getDimensions(E))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,o,s=[],l=!0,u=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}(u,c)||n(u,c)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),T=_[0],A=_[1];o._tracks.push(new e.ImageTrack({id:d,index:a,active:!1,width:f,height:h,duration:v,rows:T,cols:A,url:o._buildTemplateUrl(m,d,r,i),customData:{bitrate:p,startNumber:g,timescale:b,presentationTimeOffset:k}}))}))})),v(this,"_getDimensions",(function(e){var t=1,n=1;if(e.includes("x")){var r=e.split("x");n=parseInt(r[0]),t=parseInt(r[1])}return[t,n]})),v(this,"_getEssentialValue",(function(e,t){return e?e.value:t.essentialProperty?t.essentialProperty.value:""})),v(this,"_buildTemplateUrl",(function(e,t,n,r){var i=n.split("/").pop(),a=n.replace(i,"");(r=r.replace(/^\.\/|^\./,"")).length>0&&!r.endsWith("/")&&(r+="/");var o="".concat(a).concat(r).concat(e);return V(o,{id:t})})),v(this,"_buildUrlFromTemplate",(function(e,t){return V(e.url,{index:t,time:(t-1)*e.duration*e.customData.timescale,bitrate:e.customData.bitrate})})),this._parseTracks(r,i,a),this._tracks.length>0&&(this._tracks.sort((function(e,t){return e.customData.bitrate-t.customData.bitrate})),this.selectTrack(this._tracks[this._tracks.length-1]))}return p(t,[{key:"selectTrack",value:function(e){this._tracks.forEach((function(t){return t.index===e.index?t.active=!0:t.active=!1}))}},{key:"getTracks",value:function(){return this._tracks}},{key:"getActiveTrack",value:function(){return this._tracks.find((function(e){return e.active}))}},{key:"getThumbnail",value:function(t){var n=this.getActiveTrack(),r=n.duration,i=n.rows,a=n.cols,o=n.sliceWidth,s=n.sliceHeight,l=n.customData,u=Math.floor(t/r)+l.startNumber,c=t%r,d=Math.floor(c*i*a/r);return new e.ThumbnailInfo({width:Math.floor(o),height:Math.floor(s),x:Math.floor(d%a)*o,y:Math.floor(d/a)*s,url:this._buildUrlFromTemplate(n,u)})}}]),t}(),Q=["startTime","endTime","id"];function $(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return J(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?J(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function J(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ee="error",te="adaptation",ne="buffering",re="drmsessionupdate",ie="emsg",ae=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g(e,t)}(m,t);var n,i,a,o,c,d=(o=m,c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=h(o);if(c){var n=h(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===u(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return f(e)}(this,e)});function m(t,n){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return l(this,m),v(f(r=d.call(this,t,n,i)),"_shakaLib",T()),v(f(r),"_adapterEventsBindings",v(v(v(v(v(v(v({},ee,(function(e){return r._onError(e)})),te,(function(){return r._onAdaptation()})),ne,(function(e){return r._onBuffering(e)})),re,(function(){return r._onDrmSessionUpdate()})),ie,(function(e){return r._onEmsg(e)})),e.EventType.WAITING,(function(){return r._onWaiting()})),e.EventType.PLAYING,(function(){return r._onPlaying()}))),v(f(r),"_buffering",!1),v(f(r),"_waitingSent",!1),v(f(r),"_playingSent",!1),v(f(r),"_videoSizeUpdateTimer",null),v(f(r),"_stallInterval",null),v(f(r),"VIDEO_ERROR_CODE",3016),v(f(r),"_lastTimeDetach",NaN),v(f(r),"_requestFilterError",!1),v(f(r),"_responseFilterError",!1),v(f(r),"_isDestroyInProgress",!1),v(f(r),"_errorCounter",{}),v(f(r),"_isStartOver",!0),v(f(r),"_seekRangeStart",0),v(f(r),"_isLive",!1),v(f(r),"_isStaticLive",!1),v(f(r),"_selectedVideoTrack",null),m._logger.debug("Creating adapter. Shaka version: "+T().Player.version),r._config=e.Utils.Object.mergeDeep({},w,r._config),r._init(),r}return p(m,[{key:"applyTextTrackStyles",value:function(e,t,n){e.insertRule("#".concat(n," .").concat(m.textContainerClass," { align-items: ").concat({left:"flex-start",center:"center",right:"flex-end"}[t.textAlign],"!important; }"),0),e.insertRule("#".concat(n," .").concat(m.textContainerClass," > * { ").concat(t.toCSS()," }"),0)}},{key:"setMaxBitrate",value:function(e){this._hasLowerOrEqualBitrate(e)&&this._shaka.configure({abr:{restrictions:{maxBandwidth:e}}})}},{key:"_getSortedTracks",value:function(){return this._shaka.getVariantTracks().map((function(e){return{id:e.id,bandwidth:e.bandwidth,active:e.active}})).sort((function(e,t){return e.bandwidth-t.bandwidth}))}},{key:"_hasLowerOrEqualBitrate",value:function(e){return this._getSortedTracks()[0].bandwidth<=e}},{key:"_init",value:function(){T().polyfill.installAll(),this._shaka=new(T().Player),this._config.useShakaTextTrackDisplay&&this._shaka.setVideoContainer(e.Utils.Dom.getElementBySelector(".playkit-subtitles")),this._maybeSetFilters(),this._maybeSetDrmConfig(),this._maybeBreakStalls(),this._shaka.configure(this._config.shakaConfig),this._addBindings()}},{key:"_clearStallInterval",value:function(){this._stallInterval&&(clearInterval(this._stallInterval),this._stallInterval=null)}},{key:"_stallHandler",value:function(){var e=this;this._clearStallInterval();var t=function(){return Date.now()/1e3},n=t(),r=this._videoElement.currentTime;this._stallInterval=window.setInterval((function(){t()-n>e._config.stallDetectionThreshold&&!e._videoElement.paused&&(r===e._videoElement.currentTime&&(m._logger.debug("stall found, break the stall"),e._videoElement.currentTime=parseFloat(e._videoElement.currentTime.toFixed(1))+.1),e._clearStallInterval()),r=e._videoElement.currentTime}),500)}},{key:"_maybeBreakStalls",value:function(){var t=this;this._config.forceBreakStall&&this._eventManager.listen(this._videoElement,e.EventType.SEEKING,(function(){return t._stallHandler()}))}},{key:"_maybeGetRedirectedUrl",value:function(t){var n=this._config.forceRedirectExternalStreams,r=this._config.redirectExternalStreamsTimeout,i=this._config.redirectExternalStreamsHandler;return new Promise((function(a){if(!n)return a(t);e.Utils.Http.jsonp(t,i,{timeout:r}).then((function(e){a(e)})).catch((function(){return a(t)}))}))}},{key:"_maybeSetFilters",value:function(){var t,n,r=this;"function"==typeof e.Utils.Object.getPropertyPath(this._config,"network.requestFilter")&&(m._logger.debug("Register request filter"),null===(t=this._shaka.getNetworkingEngine())||void 0===t||t.registerRequestFilter((function(t,n){if(Object.values(e.RequestType).includes(t)){var i,a={url:n.uris[0],body:n.body,headers:n.headers};try{i=r._config.network.requestFilter(t,a)}catch(e){i=Promise.reject(e)}return(i=i||Promise.resolve(a)).then((function(e){n.uris=[e.url],n.headers=e.headers,"boolean"==typeof e.withCredentials&&(n.allowCrossSiteCredentials=e.withCredentials),"POST"===n.method?n.body=e.body:e.body&&m._logger.warn("Request with ".concat(n.method," method cannot have body"))})).catch((function(e){throw r._requestFilterError=!0,e}))}}))),"function"==typeof e.Utils.Object.getPropertyPath(this._config,"network.responseFilter")&&(m._logger.debug("Register response filter"),null===(n=this._shaka.getNetworkingEngine())||void 0===n||n.registerResponseFilter((function(t,n){if(Object.values(e.RequestType).includes(t)){var i,a=n.uri,o=n.data,s=n.headers,l={url:a,originalUrl:r._sourceObj.url,data:o,headers:s};try{i=r._config.network.responseFilter(t,l)}catch(e){i=Promise.reject(e)}return(i=i||Promise.resolve(l)).then((function(e){n.data=e.data})).catch((function(e){throw r._responseFilterError=!0,e}))}})))}},{key:"_maybeSetDrmConfig",value:function(){if(this._sourceObj&&this._sourceObj.drmData){var t,n={},r=$(m._availableDrmProtocol);try{for(r.s();!(t=r.n()).done;)t.value.setDrmPlayback(n,this._sourceObj.drmData),this._config.shakaConfig.drm&&e.Utils.Object.mergeDeep(n.drm,this._config.shakaConfig.drm),e.Utils.Object.mergeDeep(this._config.shakaConfig,n)}catch(e){r.e(e)}finally{r.f()}}}},{key:"_maybeCapLevelToPlayerSize",value:function(){var e=this;if(this._config.capLevelToPlayerSize){var t=function(){return{minHeight:0,maxHeight:e._videoHeight,minWidth:0,maxWidth:e._videoWidth,minBitrate:0,maxBitrate:1/0}};this._clearVideoUpdateTimer(),this._videoSizeUpdateTimer=window.setInterval((function(){return e._updateRestriction(t())}),1e3),this._updateRestriction(t())}}},{key:"_maybeApplyAbrRestrictions",value:function(){this._config.capLevelToPlayerSize||(this._clearVideoUpdateTimer(),e.Utils.Object.hasPropertyPath(this._config,"abr.restrictions")&&this._updateRestriction(this._config.abr.restrictions))}},{key:"_updateRestriction",value:function(e){var t=this._getRestrictionShakaConfig(e);this._shaka.configure({abr:{restrictions:t}})}},{key:"_getRestrictionShakaConfig",value:function(e){var t=this,n=function(e){var n=t._getVideoTracks();return Math.min.apply(null,n.map((function(t){return t[e]})))},r={};if(e){var i=e.maxHeight,a=e.maxWidth,o=e.maxBitrate,s=e.minHeight,l=e.minWidth,u=e.minBitrate,c=Math.max(s,0),d=Math.max(i,n("height"));d>=c?(r.minHeight=c,r.maxHeight=d):m._logger.warn("Invalid maxHeight restriction, maxHeight must be greater than minHeight",s,i);var p=Math.max(l,0),f=Math.max(a,n("width"));f>=p?(r.minWidth=p,r.maxWidth=f):m._logger.warn("Invalid maxWidth restriction, maxWidth must be greater than minWidth",l,a);var h=Math.max(u,0),y=Math.max(o,n("bandwidth"));y>=h?(r.minBandwidth=h,r.maxBandwidth=y):m._logger.warn("Invalid maxBitrate restriction, maxBitrate must be greater than minBitrate",u,o)}return r}},{key:"attachMediaSource",value:function(){this._shaka||(this._videoElement&&this._videoElement.src&&(e.Utils.Dom.setAttribute(this._videoElement,"src",""),e.Utils.Dom.removeAttribute(this._videoElement,"src")),this._init())}},{key:"detachMediaSource",value:function(){var e=this;return this._shaka?(0===Math.floor(this.duration-this.currentTime)?this._lastTimeDetach=0:this.currentTime>0&&(this._lastTimeDetach=this.currentTime),this._reset().then((function(){e._shaka=null,e._loadPromise=void 0}))):Promise.resolve()}},{key:"_clearVideoUpdateTimer",value:function(){this._videoSizeUpdateTimer&&(clearInterval(this._videoSizeUpdateTimer),this._videoSizeUpdateTimer=null)}},{key:"_videoWidth",get:function(){var e,t=this._videoElement;return t&&(e=t.width||t.clientWidth||t.offsetWidth,e*=this._contentScaleFactor),e}},{key:"_videoHeight",get:function(){var e,t=this._videoElement;return t&&(e=t.height||t.clientHeight||t.offsetHeight,e*=this._contentScaleFactor),e}},{key:"_contentScaleFactor",get:function(){var e=1;try{e=window.devicePixelRatio}catch(e){m._logger.debug("failed reading devicePixelRatio, assume 1")}return e}},{key:"_addBindings",value:function(){var t,n=this;this._eventManager.listen(this._shaka,te,this._adapterEventsBindings.adaptation),this._eventManager.listen(this._shaka,ee,this._adapterEventsBindings.error),this._eventManager.listen(this._shaka,re,this._adapterEventsBindings.drmsessionupdate),this._eventManager.listen(this._videoElement,e.EventType.WAITING,this._adapterEventsBindings.waiting),this._eventManager.listen(this._videoElement,e.EventType.PLAYING,this._adapterEventsBindings.playing),this._eventManager.listen(this._videoElement,e.EventType.LOADED_DATA,(function(){return n._onLoadedData()})),this._eventManager.listenOnce(this._videoElement,e.EventType.PLAYING,(function(){n._eventManager.listen(n._shaka,ne,n._adapterEventsBindings.buffering)})),this._config.trackEmsgEvents&&this._eventManager.listen(this._shaka,ie,this._adapterEventsBindings.emsg),null===(t=this._shaka.getNetworkingEngine())||void 0===t||t.registerResponseFilter((function(t,r){switch(t){case T().net.NetworkingEngine.RequestType.SEGMENT:n._trigger(e.EventType.FRAG_LOADED,{miliSeconds:r.timeMs,bytes:r.data.byteLength,url:r.uri}),n.isLive()&&n._dispatchNativeEvent(e.EventType.DURATION_CHANGE);break;case T().net.NetworkingEngine.RequestType.MANIFEST:n._parseManifest(r.data),n._playbackActualUri=r.uri,n._trigger(e.EventType.MANIFEST_LOADED,{miliSeconds:r.timeMs}),setTimeout((function(){var e,t;n._isLive=n._isLive||(null===(e=n._shaka)||void 0===e?void 0:e.isLive()),!n._isLive||null!==(t=n._shaka)&&void 0!==t&&t.isLive()||n._isStaticLive||!n._config.switchDynamicToStatic||(n._sourceObj.url=r.uri,n._switchFromDynamicToStatic())}))}}))}},{key:"_onLoadedData",value:function(){var e=this;this._setLowLatencyMode();var t=this.getSegmentDuration();this._seekRangeStart=this._shaka.seekRange().start,this._startOverTimeout=window.setTimeout((function(){e._shaka.seekRange().start-e._seekRangeStart>=t&&(e._isStartOver=!1)}),1e3*(t+1))}},{key:"_switchFromDynamicToStatic",value:(a=s(E().mark((function t(){var n,r,i;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return m._logger.info("Switching from dynamic manifest to static"),this._dispatchNativeEvent(e.EventType.WAITING),n=this._videoElement.currentTime-this._seekRangeStart,r=this.isAdaptiveBitrateEnabled(),i=this._videoElement.paused,t.next=7,this.detachMediaSource();case 7:return this._isStaticLive=!0,this._isLive=!0,this.attachMediaSource(),t.next=12,this.load();case 12:this._videoElement.currentTime=n,i||this._videoElement.play(),r?this._onAdaptation():this._selectedVideoTrack&&this.selectVideoTrack(this._selectedVideoTrack);case 15:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"_setLowLatencyMode",value:function(){this._shaka.configure({streaming:{lowLatencyMode:"boolean"==typeof this._config.lowLatencyMode?this._config.lowLatencyMode:this.isLive()}})}},{key:"_parseManifest",value:function(e){!this._manifestParser&&q.isValid()&&(m._logger.debug("Creating parser for the first time"),this._manifestParser=new q(e),this._manifestParser.parseManifest())}},{key:"load",value:(i=s(E().mark((function t(n){var r=this;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._loadPromise){t.next=5;break}return t.next=3,this._removeMediaKeys();case 3:this._shaka.attach(this._videoElement),this._loadPromise=new Promise((function(t,i){if(r._sourceObj&&r._sourceObj.url){r._trigger(e.EventType.ABR_MODE_CHANGED,{mode:r.isAdaptiveBitrateEnabled()?"auto":"manual"});var a="number"==typeof n&&n>-1?n:void 0;a=isNaN(r._lastTimeDetach)?a:r._lastTimeDetach,r._lastTimeDetach=NaN,r._maybeGetRedirectedUrl(r._sourceObj.url).then((function(e){return r._shaka.load(e,a)})).then((function(){var e={tracks:r._getParsedTracks()};r._maybeCapLevelToPlayerSize(),m._logger.debug("The source has been loaded successfully"),t(e)})).catch((function(t){i(new e.Error(r._isDestroyInProgress?e.Error.Severity.RECOVERABLE:t.severity,t.category,t.code,t.data))}))}}));case 5:return t.abrupt("return",this._loadPromise);case 6:case"end":return t.stop()}}),t,this)}))),function(e){return i.apply(this,arguments)})},{key:"destroy",value:function(){var e=this;return this._isDestroyInProgress=!0,new Promise((function(t,n){y(h(m.prototype),"destroy",e).call(e).then((function(){m._logger.debug("destroy"),e._loadPromise=void 0,e._adapterEventsBindings={},e._reset().then((function(n){e._isDestroyInProgress=!1,t(n)})).catch((function(t){e._isDestroyInProgress=!1,n(t)}))}))}))}},{key:"getThumbnail",value:function(e){return this._thumbnailController?this._thumbnailController.getThumbnail(e):null}},{key:"_reset",value:function(){return this._buffering=!1,this._waitingSent=!1,this._playingSent=!1,this._isLive=!1,this._isStaticLive=!1,this._requestFilterError=!1,this._responseFilterError=!1,this._manifestParser=null,this._thumbnailController=null,this._errorCounter={},this._clearStallInterval(),this._clearVideoUpdateTimer(),clearTimeout(this._startOverTimeout),this._eventManager&&this._eventManager.removeAll(),this._shaka?this._shaka.destroy():Promise.resolve()}},{key:"_removeMediaKeys",value:(n=s(E().mark((function e(){return E().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._videoElement||!this._videoElement.mediaKeys){e.next=16;break}return e.prev=1,m._logger.debug("Removing mediaKeys from the video element"),e.next=5,this._videoElement.setMediaKeys(null);case 5:m._logger.debug("mediaKeys removed"),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),m._logger.warn("mediaKeys not cleared");case 11:return e.prev=11,e.abrupt("return",Promise.resolve());case 14:e.next=17;break;case 16:return e.abrupt("return",Promise.resolve());case 17:case"end":return e.stop()}}),e,this,[[1,8,11,14]])}))),function(){return n.apply(this,arguments)})},{key:"_getVideoTracks",value:function(){var e=this._shaka.getVariantTracks(),t=this._getActiveTrack();return e.filter((function(e){return e.audioId===t.audioId}))}},{key:"_getActiveTrack",value:function(){return this._shaka.getVariantTracks().find((function(e){return e.active}))}},{key:"_getAudioTracks",value:function(){var e=this._shaka.getVariantTracks(),t=this._shaka.getAudioLanguagesAndRoles();return t.forEach((function(t){var n=e.filter((function(e){return e.language===t.language})),r=n.map((function(e){return e.id})).join("_"),i=n.some((function(e){return e.active}));t.id=r,t.label=n[0].label,t.active=i})),t}},{key:"_getParsedTracks",value:function(){if(this._shaka){var e=this._getParsedVideoTracks(),t=this._getParsedAudioTracks(),n=this._getParsedTextTracks(),i=this._getParsedImageTracks();return[].concat(r(e),r(t),r(n),r(i))}return[]}},{key:"_getParsedVideoTracks",value:function(){var t=this._getVideoTracks(),n=[];if(t)for(var r=0;r<t.length;r++){var i={id:t[r].id,bandwidth:t[r].videoBandwidth||t[r].bandwidth,width:t[r].width,height:t[r].height,active:t[r].active,index:r};n.push(new e.VideoTrack(i))}return n}},{key:"_getParsedAudioTracks",value:function(){var t=this._getAudioTracks(),n=[];if(t)for(var r=0;r<t.length;r++){var i={id:t[r].id,active:t[r].active,label:t[r].label,language:t[r].language,index:r};n.push(new e.AudioTrack(i))}return n}},{key:"_getParsedTextTracks",value:function(){var t,n=[],r=$(this._shaka.getTextTracks());try{for(r.s();!(t=r.n()).done;){var i=t.value,a=i.kind?i.kind+"s":"";a=""===a&&this._config.useShakaTextTrackDisplay?"captions":a;var o={id:i.id,kind:a,active:!1,default:i.primary,label:i.label,language:i.language};n.push(new e.TextTrack(o))}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"_getParsedImageTracks",value:function(){var e,t,n=null===(e=this._manifestParser)||void 0===e?void 0:e.getImageSet(),r=(null===(t=this._manifestParser)||void 0===t?void 0:t.getBaseUrl())||"";return n?(this._thumbnailController=new X(n,this._playbackActualUri,r),this._thumbnailController.getTracks()):[]}},{key:"selectVideoTrack",value:function(t){if(this._shaka){var n=this._getVideoTracks();if(t instanceof e.VideoTrack&&n){var r=n[t.index];r&&(this.isAdaptiveBitrateEnabled()&&(this._shaka.configure({abr:{enabled:!1}}),this._trigger(e.EventType.ABR_MODE_CHANGED,{mode:"manual"})),r.active||(this._selectedVideoTrack=t,this._shaka.selectVariantTrack(n[t.index],!0),this._onTrackChanged(t)))}}}},{key:"selectAudioTrack",value:function(t){this._shaka&&t instanceof e.AudioTrack&&!t.active&&(this._shaka.selectAudioLanguage(t.language),this._onTrackChanged(t))}},{key:"selectTextTrack",value:function(t){this._shaka&&t instanceof e.TextTrack&&!t.active&&("subtitles"===t.kind||"captions"===t.kind)&&(this._shaka.setTextTrackVisibility(this._config.textTrackVisibile),this._shaka.selectTextLanguage(t.language),this._onTrackChanged(t))}},{key:"selectImageTrack",value:function(t){this._shaka&&this._thumbnailController&&t instanceof e.ImageTrack&&!t.active&&(this._thumbnailController.selectTrack(t),this._onTrackChanged(t))}},{key:"hideTextTrack",value:function(){this._shaka&&this._shaka.setTextTrackVisibility(!1)}},{key:"enableAdaptiveBitrate",value:function(){this._shaka&&!this.isAdaptiveBitrateEnabled()&&(this._trigger(e.EventType.ABR_MODE_CHANGED,{mode:"auto"}),this._shaka.configure({abr:{enabled:!0}}))}},{key:"isAdaptiveBitrateEnabled",value:function(){return!!this._shaka&&this._shaka.getConfiguration().abr.enabled}},{key:"applyABRRestriction",value:function(t){if(e.Utils.Object.createPropertyPath(this._config,"abr.restrictions",t),this._maybeApplyAbrRestrictions(),!this.isAdaptiveBitrateEnabled()){var n=this._getParsedVideoTracks(),r=(0,e.filterTracksByRestriction)(n,this._config.abr.restrictions);r.length&&(r.find((function(e){return e.active}))||this.selectVideoTrack(r[0]))}}},{key:"_getLiveEdge",value:function(){return this._shaka?this._shaka.seekRange().end:NaN}},{key:"seekToLiveEdge",value:function(){this._shaka&&this._videoElement.readyState>0&&(this._videoElement.currentTime=this._getLiveEdge())}},{key:"isLive",value:function(){var e;return(null===(e=this._shaka)||void 0===e?void 0:e.isLive())||this._isLive}},{key:"liveDuration",get:function(){return this._getLiveEdge()}},{key:"getSegmentDuration",value:function(){return this._shaka?this._shaka.getStats().maxSegmentDuration:0}},{key:"_onAdaptation",value:function(){var e=this._getParsedVideoTracks().find((function(e){return e.active}));this._onTrackChanged(e)}},{key:"_onError",value:function(t){if(t&&t.detail){var n=t.detail;if(n.code===this.VIDEO_ERROR_CODE)return;(this._requestFilterError||this._responseFilterError)&&n.data[0]instanceof T().util.Error&&(n=n.data[0],this._requestFilterError?this._requestFilterError=!1:this._responseFilterError=!1),n.severity=this._shouldErrorChangeSeverity(n.code)?e.Error.Severity.CRITICAL:n.severity,this._trigger(e.EventType.ERROR,new e.Error(n.severity,n.category,n.code,n.data)),m._logger.error(n),n.severity===e.Error.Severity.CRITICAL&&this.destroy()}}},{key:"_shouldErrorChangeSeverity",value:function(e){var t=function(){return Date.now()/1e3};return