1738 lines
742 KiB
JavaScript
1738 lines
742 KiB
JavaScript
/*
|
|
@license
|
|
Shaka Player
|
|
Copyright 2016 Google LLC
|
|
SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
(function(){var innerGlobal=typeof window!="undefined"?window:global;var exportTo={};(function(window,global,module){/*
|
|
|
|
Copyright The Closure Library Authors.
|
|
SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
var p;function ba(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}var ca="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a};
|
|
function ea(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");}var fa=ea(this);function ha(a,b){if(b)a:{var c=fa;a=a.split(".");for(var d=0;d<a.length-1;d++){var e=a[d];if(!(e in c))break a;c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&ca(c,a,{configurable:!0,writable:!0,value:b})}}
|
|
ha("Symbol",function(a){function b(f){if(this instanceof b)throw new TypeError("Symbol is not a constructor");return new c(d+(f||"")+"_"+e++,f)}function c(f,g){this.g=f;ca(this,"description",{configurable:!0,writable:!0,value:g})}if(a)return a;c.prototype.toString=function(){return this.g};var d="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",e=0;return b});
|
|
ha("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");for(var b="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),c=0;c<b.length;c++){var d=fa[b[c]];"function"===typeof d&&"function"!=typeof d.prototype[a]&&ca(d.prototype,a,{configurable:!0,writable:!0,value:function(){return ia(ba(this))}})}return a});function ia(a){a={next:a};a[Symbol.iterator]=function(){return this};return a}
|
|
function t(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];if(b)return b.call(a);if("number"==typeof a.length)return{next:ba(a)};throw Error(String(a)+" is not an iterable or ArrayLike");}function x(a){if(!(a instanceof Array)){a=t(a);for(var b,c=[];!(b=a.next()).done;)c.push(b.value);a=c}return a}var ja="function"==typeof Object.create?Object.create:function(a){function b(){}b.prototype=a;return new b},ka;
|
|
if("function"==typeof Object.setPrototypeOf)ka=Object.setPrototypeOf;else{var la;a:{var ma={a:!0},na={};try{na.__proto__=ma;la=na.a;break a}catch(a){}la=!1}ka=la?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var oa=ka;
|
|
function pa(a,b){a.prototype=ja(b.prototype);a.prototype.constructor=a;if(oa)oa(a,b);else for(var c in b)if("prototype"!=c)if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)}else a[c]=b[c];a.wm=b.prototype}function ta(){this.o=!1;this.l=null;this.h=void 0;this.g=1;this.j=this.m=0;this.A=this.i=null}function ua(a){if(a.o)throw new TypeError("Generator is already running");a.o=!0}ta.prototype.s=function(a){this.h=a};
|
|
function va(a,b){a.i={Oh:b,$h:!0};a.g=a.m||a.j}ta.prototype.return=function(a){this.i={return:a};this.g=this.j};function F(a,b,c){a.g=c;return{value:b}}ta.prototype.u=function(a){this.g=a};function G(a){a.g=0}function wa(a,b,c){a.m=b;void 0!=c&&(a.j=c)}function ya(a,b){a.m=0;a.j=b||0}function za(a,b,c){a.g=b;a.m=c||0}function Aa(a,b){a.m=b||0;b=a.i.Oh;a.i=null;return b}function Ba(a){a.A=[a.i];a.m=0;a.j=0}
|
|
function Ca(a,b){var c=a.A.splice(0)[0];(c=a.i=a.i||c)?c.$h?a.g=a.m||a.j:void 0!=c.u&&a.j<c.u?(a.g=c.u,a.i=null):a.g=a.j:a.g=b}function Ea(a){this.g=new ta;this.h=a}function Ha(a,b){ua(a.g);var c=a.g.l;if(c)return Ia(a,"return"in c?c["return"]:function(d){return{value:d,done:!0}},b,a.g.return);a.g.return(b);return Ka(a)}
|
|
function Ia(a,b,c,d){try{var e=b.call(a.g.l,c);if(!(e instanceof Object))throw new TypeError("Iterator result "+e+" is not an object");if(!e.done)return a.g.o=!1,e;var f=e.value}catch(g){return a.g.l=null,va(a.g,g),Ka(a)}a.g.l=null;d.call(a.g,f);return Ka(a)}function Ka(a){for(;a.g.g;)try{var b=a.h(a.g);if(b)return a.g.o=!1,{value:b.value,done:!1}}catch(c){a.g.h=void 0,va(a.g,c)}a.g.o=!1;if(a.g.i){b=a.g.i;a.g.i=null;if(b.$h)throw b.Oh;return{value:b.return,done:!0}}return{value:void 0,done:!0}}
|
|
function La(a){this.next=function(b){ua(a.g);a.g.l?b=Ia(a,a.g.l.next,b,a.g.s):(a.g.s(b),b=Ka(a));return b};this.throw=function(b){ua(a.g);a.g.l?b=Ia(a,a.g.l["throw"],b,a.g.s):(va(a.g,b),b=Ka(a));return b};this.return=function(b){return Ha(a,b)};this[Symbol.iterator]=function(){return this}}function Na(a){function b(d){return a.next(d)}function c(d){return a.throw(d)}return new Promise(function(d,e){function f(g){g.done?d(g.value):Promise.resolve(g.value).then(b,c).then(f,e)}f(a.next())})}
|
|
function Q(a){return Na(new La(new Ea(a)))}function Oa(){for(var a=Number(this),b=[],c=a;c<arguments.length;c++)b[c-a]=arguments[c];return b}
|
|
ha("Promise",function(a){function b(g){this.h=0;this.i=void 0;this.g=[];this.o=!1;var h=this.j();try{g(h.resolve,h.reject)}catch(k){h.reject(k)}}function c(){this.g=null}function d(g){return g instanceof b?g:new b(function(h){h(g)})}if(a)return a;c.prototype.h=function(g){if(null==this.g){this.g=[];var h=this;this.i(function(){h.l()})}this.g.push(g)};var e=fa.setTimeout;c.prototype.i=function(g){e(g,0)};c.prototype.l=function(){for(;this.g&&this.g.length;){var g=this.g;this.g=[];for(var h=0;h<g.length;++h){var k=
|
|
g[h];g[h]=null;try{k()}catch(l){this.j(l)}}}this.g=null};c.prototype.j=function(g){this.i(function(){throw g;})};b.prototype.j=function(){function g(l){return function(m){k||(k=!0,l.call(h,m))}}var h=this,k=!1;return{resolve:g(this.F),reject:g(this.l)}};b.prototype.F=function(g){if(g===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(g instanceof b)this.H(g);else{a:switch(typeof g){case "object":var h=null!=g;break a;case "function":h=!0;break a;default:h=!1}h?this.C(g):this.m(g)}};
|
|
b.prototype.C=function(g){var h=void 0;try{h=g.then}catch(k){this.l(k);return}"function"==typeof h?this.I(h,g):this.m(g)};b.prototype.l=function(g){this.s(2,g)};b.prototype.m=function(g){this.s(1,g)};b.prototype.s=function(g,h){if(0!=this.h)throw Error("Cannot settle("+g+", "+h+"): Promise already settled in state"+this.h);this.h=g;this.i=h;2===this.h&&this.G();this.A()};b.prototype.G=function(){var g=this;e(function(){if(g.B()){var h=fa.console;"undefined"!==typeof h&&h.error(g.i)}},1)};b.prototype.B=
|
|
function(){if(this.o)return!1;var g=fa.CustomEvent,h=fa.Event,k=fa.dispatchEvent;if("undefined"===typeof k)return!0;"function"===typeof g?g=new g("unhandledrejection",{cancelable:!0}):"function"===typeof h?g=new h("unhandledrejection",{cancelable:!0}):(g=fa.document.createEvent("CustomEvent"),g.initCustomEvent("unhandledrejection",!1,!0,g));g.promise=this;g.reason=this.i;return k(g)};b.prototype.A=function(){if(null!=this.g){for(var g=0;g<this.g.length;++g)f.h(this.g[g]);this.g=null}};var f=new c;
|
|
b.prototype.H=function(g){var h=this.j();g.Ke(h.resolve,h.reject)};b.prototype.I=function(g,h){var k=this.j();try{g.call(h,k.resolve,k.reject)}catch(l){k.reject(l)}};b.prototype.then=function(g,h){function k(q,r){return"function"==typeof q?function(u){try{l(q(u))}catch(w){m(w)}}:r}var l,m,n=new b(function(q,r){l=q;m=r});this.Ke(k(g,l),k(h,m));return n};b.prototype.catch=function(g){return this.then(void 0,g)};b.prototype.Ke=function(g,h){function k(){switch(l.h){case 1:g(l.i);break;case 2:h(l.i);
|
|
break;default:throw Error("Unexpected state: "+l.h);}}var l=this;null==this.g?f.h(k):this.g.push(k);this.o=!0};b.resolve=d;b.reject=function(g){return new b(function(h,k){k(g)})};b.race=function(g){return new b(function(h,k){for(var l=t(g),m=l.next();!m.done;m=l.next())d(m.value).Ke(h,k)})};b.all=function(g){var h=t(g),k=h.next();return k.done?d([]):new b(function(l,m){function n(u){return function(w){q[u]=w;r--;0==r&&l(q)}}var q=[],r=0;do q.push(void 0),r++,d(k.value).Ke(n(q.length-1),m),k=h.next();
|
|
while(!k.done)})};return b});function Pa(a,b){return Object.prototype.hasOwnProperty.call(a,b)}
|
|
ha("WeakMap",function(a){function b(k){this.g=(h+=Math.random()+1).toString();if(k){k=t(k);for(var l;!(l=k.next()).done;)l=l.value,this.set(l[0],l[1])}}function c(){}function d(k){var l=typeof k;return"object"===l&&null!==k||"function"===l}function e(k){if(!Pa(k,g)){var l=new c;ca(k,g,{value:l})}}function f(k){var l=Object[k];l&&(Object[k]=function(m){if(m instanceof c)return m;Object.isExtensible(m)&&e(m);return l(m)})}if(function(){if(!a||!Object.seal)return!1;try{var k=Object.seal({}),l=Object.seal({}),
|
|
m=new a([[k,2],[l,3]]);if(2!=m.get(k)||3!=m.get(l))return!1;m.delete(k);m.set(l,4);return!m.has(k)&&4==m.get(l)}catch(n){return!1}}())return a;var g="$jscomp_hidden_"+Math.random();f("freeze");f("preventExtensions");f("seal");var h=0;b.prototype.set=function(k,l){if(!d(k))throw Error("Invalid WeakMap key");e(k);if(!Pa(k,g))throw Error("WeakMap key fail: "+k);k[g][this.g]=l;return this};b.prototype.get=function(k){return d(k)&&Pa(k,g)?k[g][this.g]:void 0};b.prototype.has=function(k){return d(k)&&Pa(k,
|
|
g)&&Pa(k[g],this.g)};b.prototype.delete=function(k){return d(k)&&Pa(k,g)&&Pa(k[g],this.g)?delete k[g][this.g]:!1};return b});
|
|
ha("Map",function(a){function b(){var h={};return h.nc=h.next=h.head=h}function c(h,k){var l=h[1];return ia(function(){if(l){for(;l.head!=h[1];)l=l.nc;for(;l.next!=l.head;)return l=l.next,{done:!1,value:k(l)};l=null}return{done:!0,value:void 0}})}function d(h,k){var l=k&&typeof k;"object"==l||"function"==l?f.has(k)?l=f.get(k):(l=""+ ++g,f.set(k,l)):l="p_"+k;var m=h[0][l];if(m&&Pa(h[0],l))for(h=0;h<m.length;h++){var n=m[h];if(k!==k&&n.key!==n.key||k===n.key)return{id:l,list:m,index:h,entry:n}}return{id:l,
|
|
list:m,index:-1,entry:void 0}}function e(h){this[0]={};this[1]=b();this.size=0;if(h){h=t(h);for(var k;!(k=h.next()).done;)k=k.value,this.set(k[0],k[1])}}if(function(){if(!a||"function"!=typeof a||!a.prototype.entries||"function"!=typeof Object.seal)return!1;try{var h=Object.seal({x:4}),k=new a(t([[h,"s"]]));if("s"!=k.get(h)||1!=k.size||k.get({x:4})||k.set({x:4},"t")!=k||2!=k.size)return!1;var l=k.entries(),m=l.next();if(m.done||m.value[0]!=h||"s"!=m.value[1])return!1;m=l.next();return m.done||4!=
|
|
m.value[0].x||"t"!=m.value[1]||!l.next().done?!1:!0}catch(n){return!1}}())return a;var f=new WeakMap;e.prototype.set=function(h,k){h=0===h?0:h;var l=d(this,h);l.list||(l.list=this[0][l.id]=[]);l.entry?l.entry.value=k:(l.entry={next:this[1],nc:this[1].nc,head:this[1],key:h,value:k},l.list.push(l.entry),this[1].nc.next=l.entry,this[1].nc=l.entry,this.size++);return this};e.prototype.delete=function(h){h=d(this,h);return h.entry&&h.list?(h.list.splice(h.index,1),h.list.length||delete this[0][h.id],h.entry.nc.next=
|
|
h.entry.next,h.entry.next.nc=h.entry.nc,h.entry.head=null,this.size--,!0):!1};e.prototype.clear=function(){this[0]={};this[1]=this[1].nc=b();this.size=0};e.prototype.has=function(h){return!!d(this,h).entry};e.prototype.get=function(h){return(h=d(this,h).entry)&&h.value};e.prototype.entries=function(){return c(this,function(h){return[h.key,h.value]})};e.prototype.keys=function(){return c(this,function(h){return h.key})};e.prototype.values=function(){return c(this,function(h){return h.value})};e.prototype.forEach=
|
|
function(h,k){for(var l=this.entries(),m;!(m=l.next()).done;)m=m.value,h.call(k,m[1],m[0],this)};e.prototype[Symbol.iterator]=e.prototype.entries;var g=0;return e});
|
|
ha("Set",function(a){function b(c){this.g=new Map;if(c){c=t(c);for(var d;!(d=c.next()).done;)this.add(d.value)}this.size=this.g.size}if(function(){if(!a||"function"!=typeof a||!a.prototype.entries||"function"!=typeof Object.seal)return!1;try{var c=Object.seal({x:4}),d=new a(t([c]));if(!d.has(c)||1!=d.size||d.add(c)!=d||1!=d.size||d.add({x:4})!=d||2!=d.size)return!1;var e=d.entries(),f=e.next();if(f.done||f.value[0]!=c||f.value[1]!=c)return!1;f=e.next();return f.done||f.value[0]==c||4!=f.value[0].x||
|
|
f.value[1]!=f.value[0]?!1:e.next().done}catch(g){return!1}}())return a;b.prototype.add=function(c){c=0===c?0:c;this.g.set(c,c);this.size=this.g.size;return this};b.prototype.delete=function(c){c=this.g.delete(c);this.size=this.g.size;return c};b.prototype.clear=function(){this.g.clear();this.size=0};b.prototype.has=function(c){return this.g.has(c)};b.prototype.entries=function(){return this.g.entries()};b.prototype.values=function(){return this.g.values()};b.prototype.keys=b.prototype.values;b.prototype[Symbol.iterator]=
|
|
b.prototype.values;b.prototype.forEach=function(c,d){var e=this;this.g.forEach(function(f){return c.call(d,f,f,e)})};return b});function Qa(a,b){a instanceof String&&(a+="");var c=0,d=!1,e={next:function(){if(!d&&c<a.length){var f=c++;return{value:b(f,a[f]),done:!1}}d=!0;return{done:!0,value:void 0}}};e[Symbol.iterator]=function(){return e};return e}ha("Array.prototype.values",function(a){return a?a:function(){return Qa(this,function(b,c){return c})}});
|
|
ha("Array.from",function(a){return a?a:function(b,c,d){c=null!=c?c:function(h){return h};var e=[],f="undefined"!=typeof Symbol&&Symbol.iterator&&b[Symbol.iterator];if("function"==typeof f){b=f.call(b);for(var g=0;!(f=b.next()).done;)e.push(c.call(d,f.value,g++))}else for(f=b.length,g=0;g<f;g++)e.push(c.call(d,b[g],g));return e}});ha("Array.prototype.keys",function(a){return a?a:function(){return Qa(this,function(b){return b})}});
|
|
ha("Object.is",function(a){return a?a:function(b,c){return b===c?0!==b||1/b===1/c:b!==b&&c!==c}});ha("Array.prototype.includes",function(a){return a?a:function(b,c){var d=this;d instanceof String&&(d=String(d));var e=d.length;c=c||0;for(0>c&&(c=Math.max(c+e,0));c<e;c++){var f=d[c];if(f===b||Object.is(f,b))return!0}return!1}});
|
|
function Ra(a,b,c){if(null==a)throw new TypeError("The 'this' value for String.prototype."+c+" must not be null or undefined");if(b instanceof RegExp)throw new TypeError("First argument to String.prototype."+c+" must not be a regular expression");return a+""}ha("String.prototype.includes",function(a){return a?a:function(b,c){return-1!==Ra(this,b,"includes").indexOf(b,c||0)}});
|
|
ha("String.fromCodePoint",function(a){return a?a:function(b){for(var c="",d=0;d<arguments.length;d++){var e=Number(arguments[d]);if(0>e||1114111<e||e!==Math.floor(e))throw new RangeError("invalid_code_point "+e);65535>=e?c+=String.fromCharCode(e):(e-=65536,c+=String.fromCharCode(e>>>10&1023|55296),c+=String.fromCharCode(e&1023|56320))}return c}});
|
|
function Sa(a,b,c){a instanceof String&&(a=String(a));for(var d=a.length,e=0;e<d;e++){var f=a[e];if(b.call(c,f,e,a))return{Xh:e,v:f}}return{Xh:-1,v:void 0}}ha("Array.prototype.findIndex",function(a){return a?a:function(b,c){return Sa(this,b,c).Xh}});
|
|
ha("WeakSet",function(a){function b(c){this.g=new WeakMap;if(c){c=t(c);for(var d;!(d=c.next()).done;)this.add(d.value)}}if(function(){if(!a||!Object.seal)return!1;try{var c=Object.seal({}),d=Object.seal({}),e=new a([c]);if(!e.has(c)||e.has(d))return!1;e.delete(c);e.add(d);return!e.has(c)&&e.has(d)}catch(f){return!1}}())return a;b.prototype.add=function(c){this.g.set(c,!0);return this};b.prototype.has=function(c){return this.g.has(c)};b.prototype.delete=function(c){return this.g.delete(c)};return b});
|
|
ha("Array.prototype.find",function(a){return a?a:function(b,c){return Sa(this,b,c).v}});ha("String.prototype.startsWith",function(a){return a?a:function(b,c){var d=Ra(this,b,"startsWith"),e=d.length,f=b.length;c=Math.max(0,Math.min(c|0,d.length));for(var g=0;g<f&&c<e;)if(d[c++]!=b[g++])return!1;return g>=f}});ha("Object.entries",function(a){return a?a:function(b){var c=[],d;for(d in b)Pa(b,d)&&c.push([d,b[d]]);return c}});
|
|
var Ta="function"==typeof Object.assign?Object.assign:function(a,b){for(var c=1;c<arguments.length;c++){var d=arguments[c];if(d)for(var e in d)Pa(d,e)&&(a[e]=d[e])}return a};ha("Object.assign",function(a){return a||Ta});ha("Promise.prototype.finally",function(a){return a?a:function(b){return this.then(function(c){return Promise.resolve(b()).then(function(){return c})},function(c){return Promise.resolve(b()).then(function(){throw c;})})}});
|
|
ha("Array.prototype.entries",function(a){return a?a:function(){return Qa(this,function(b,c){return[b,c]})}});ha("Number.isNaN",function(a){return a?a:function(b){return"number"===typeof b&&isNaN(b)}});ha("String.prototype.repeat",function(a){return a?a:function(b){var c=Ra(this,null,"repeat");if(0>b||1342177279<b)throw new RangeError("Invalid count value");b|=0;for(var d="";b;)if(b&1&&(d+=c),b>>>=1)c+=c;return d}});ha("Number.EPSILON",function(){return Math.pow(2,-52)});
|
|
ha("Number.MAX_SAFE_INTEGER",function(){return 9007199254740991});ha("Number.isFinite",function(a){return a?a:function(b){return"number"!==typeof b?!1:!isNaN(b)&&Infinity!==b&&-Infinity!==b}});ha("Object.values",function(a){return a?a:function(b){var c=[],d;for(d in b)Pa(b,d)&&c.push(b[d]);return c}});ha("Math.log2",function(a){return a?a:function(b){return Math.log(b)/Math.LN2}});
|
|
ha("String.prototype.endsWith",function(a){return a?a:function(b,c){var d=Ra(this,b,"endsWith");void 0===c&&(c=d.length);c=Math.max(0,Math.min(c|0,d.length));for(var e=b.length;0<e&&0<c;)if(d[--c]!=b[--e])return!1;return 0>=e}});ha("Math.trunc",function(a){return a?a:function(b){b=Number(b);if(isNaN(b)||Infinity===b||-Infinity===b||0===b)return b;var c=Math.floor(Math.abs(b));return 0>b?-c:c}});var Ua=this||self;
|
|
function T(a,b){a=a.split(".");var c=Ua;a[0]in c||"undefined"==typeof c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)a.length||void 0===b?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b};/*
|
|
@license
|
|
Shaka Player
|
|
Copyright 2016 Google LLC
|
|
SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
function Va(a){this.g=Math.exp(Math.log(.5)/a);this.i=this.h=0}Va.prototype.sample=function(a,b){var c=Math.pow(this.g,a);b=b*(1-c)+c*this.h;isNaN(b)||(this.h=b,this.i+=a)};function Wa(a){return a.h/(1-Math.pow(a.g,a.i))};function Xa(){this.h=new Va(2);this.j=new Va(5);this.g=0;this.i=128E3;this.l=16E3}Xa.prototype.configure=function(a){this.i=a.minTotalBytes;this.l=a.minBytes;this.h.g=Math.exp(Math.log(.5)/a.fastHalfLife);this.j.g=Math.exp(Math.log(.5)/a.slowHalfLife)};Xa.prototype.sample=function(a,b){if(!(b<this.l)){var c=8E3*b/a;a/=1E3;this.g+=b;this.h.sample(a,c);this.j.sample(a,c)}};Xa.prototype.getBandwidthEstimate=function(a){return this.g<this.i?a:Math.min(Wa(this.h),Wa(this.j))};function Ya(){}function ab(){}function bb(){}function cb(a){var b=Oa.apply(1,arguments);db.has(a)||(db.add(a),bb.apply(Ya,x(b)))}function eb(){}function fb(){}function gb(){}var db=new Set;
|
|
window.console&&((new Map).set(1,function(){return console.error.apply(console,x(Oa.apply(0,arguments)))}).set(2,function(){return console.warn.apply(console,x(Oa.apply(0,arguments)))}).set(3,function(){return console.info.apply(console,x(Oa.apply(0,arguments)))}).set(4,function(){return console.log.apply(console,x(Oa.apply(0,arguments)))}).set(5,function(){return console.debug.apply(console,x(Oa.apply(0,arguments)))}).set(6,function(){return console.debug.apply(console,x(Oa.apply(0,arguments)))}),
|
|
bb=function(){return console.warn.apply(console,x(Oa.apply(0,arguments)))},ab=function(){console.error.apply(console,x(Oa.apply(0,arguments)))});function ib(){this.g=new Map}p=ib.prototype;p.push=function(a,b){this.g.has(a)?this.g.get(a).push(b):this.g.set(a,[b])};p.get=function(a){return this.g.has(a)?this.g.get(a).slice():null};p.remove=function(a,b){if(this.g.has(a)){var c=this.g.get(a).filter(function(d){return d!=b});this.g.set(a,c);c.length||this.g.delete(a)}};p.forEach=function(a){this.g.forEach(function(b,c){a(c,b)})};p.size=function(){return this.g.size};p.keys=function(){return Array.from(this.g.keys())};function jb(){this.g=new ib}p=jb.prototype;p.release=function(){this.Ra();this.g=null};p.D=function(a,b,c,d){this.g&&(a=new kb(a,b,c,d),this.g.push(b,a))};p.za=function(a,b,c,d){function e(g){f.Ja(a,b,e);c(g)}var f=this;this.D(a,b,e,d)};p.Ja=function(a,b,c){if(this.g){var d=this.g.get(b)||[];d=t(d);for(var e=d.next();!e.done;e=d.next())e=e.value,e.target!=a||c!=e.listener&&c||(e.Ja(),this.g.remove(b,e))}};
|
|
p.Ra=function(){if(this.g){for(var a=[],b=t(this.g.g.values()),c=b.next();!c.done;c=b.next())a.push.apply(a,x(c.value));a=t(a);for(b=a.next();!b.done;b=a.next())b.value.Ja();this.g.g.clear()}};T("shaka.util.EventManager",jb);jb.prototype.removeAll=jb.prototype.Ra;jb.prototype.unlisten=jb.prototype.Ja;jb.prototype.listenOnce=jb.prototype.za;jb.prototype.listen=jb.prototype.D;jb.prototype.release=jb.prototype.release;
|
|
function kb(a,b,c,d){this.target=a;this.type=b;this.listener=c;this.g=lb(a,d);this.target.addEventListener(b,c,this.g)}kb.prototype.Ja=function(){this.target.removeEventListener(this.type,this.listener,this.g);this.listener=this.target=null;this.g=!1};function lb(a,b){if(void 0==b)return!1;if("boolean"==typeof b)return b;var c=new Set(["passive","capture"]);Object.keys(b).filter(function(d){return!c.has(d)});return nb(a)?b:b.capture||!1}
|
|
function nb(a){var b=ob;if(void 0==b){b=!1;try{var c={},d={get:function(){b=!0;return!1}};Object.defineProperty(c,"passive",d);Object.defineProperty(c,"capture",d);d=function(){};a.addEventListener("test",d,c);a.removeEventListener("test",d,c)}catch(e){b=!1}ob=b}return b||!1}var ob=void 0;T("shaka.config.AutoShowText",{NEVER:0,ALWAYS:1,IF_PREFERRED_TEXT_LANGUAGE:2,IF_SUBTITLES_MAY_BE_NEEDED:3});function pb(a){this.h=a;this.g=void 0}pb.prototype.value=function(){void 0===this.g&&(this.g=this.h());return this.g};/*
|
|
@license
|
|
Shaka Player
|
|
Copyright 2025 Google LLC
|
|
SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
function qb(){return sb.value()}var tb=null,ub=null,sb=new pb(function(){var a=void 0;tb&&(a=tb());!a&&ub&&(a=ub());return a});function vb(a,b){this.g=a;this.h=b}vb.prototype.toString=function(){return"v"+this.g+"."+this.h};function wb(a,b){var c=new vb(5,0),d=xb,e=d.g,f=c.h-e.h;(0<(c.g-e.g||f)?d.i:d.h)(d.g,c,a,b)}function yb(a,b,c,d){bb([c,"has been deprecated and will be removed in",b,". We are currently at version",a,". Additional information:",d].join(" "))}function zb(a,b,c,d){ab([c,"has been deprecated and has been removed in",b,". We are now at version",a,". Additional information:",d].join(" "))}var xb=null;/*
|
|
@license
|
|
Copyright 2008 The Closure Library Authors
|
|
SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
var Ab=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");/*
|
|
@license
|
|
Copyright 2006 The Closure Library Authors
|
|
SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
function Bb(a){var b;a instanceof Bb?(Cb(this,a.ac),this.Zc=a.Zc,Db(this,a.Bb),Eb(this,a.rd),this.mb=a.mb,Fb(this,a.g.clone()),this.Ic=a.Ic):a&&(b=String(a).match(Ab))?(Cb(this,b[1]||"",!0),this.Zc=Gb(b[2]||""),Db(this,b[3]||"",!0),Eb(this,b[4]),this.mb=Gb(b[5]||"",!0),Fb(this,b[6]||"",!0),this.Ic=Gb(b[7]||"")):this.g=new Hb(null)}p=Bb.prototype;p.ac="";p.Zc="";p.Bb="";p.rd=null;p.mb="";p.Ic="";
|
|
p.toString=function(){var a=[],b=this.ac;b&&a.push(Ib(b,Jb,!0),":");if(b=this.Bb){a.push("//");var c=this.Zc;c&&a.push(Ib(c,Jb,!0),"@");a.push(encodeURIComponent(b).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));b=this.rd;null!=b&&a.push(":",String(b))}if(b=this.mb)this.Bb&&"/"!=b.charAt(0)&&a.push("/"),a.push(Ib(b,"/"==b.charAt(0)?Kb:Lb,!0));(b=this.g.toString())&&a.push("?",b);(b=this.Ic)&&a.push("#",Ib(b,Mb));return a.join("")};
|
|
p.resolve=function(a){var b=this.clone();"data"===b.ac&&(b=new Bb);var c=!!a.ac;c?Cb(b,a.ac):c=!!a.Zc;c?b.Zc=a.Zc:c=!!a.Bb;c?Db(b,a.Bb):c=null!=a.rd;var d=a.mb;if(c)Eb(b,a.rd);else if(c=!!a.mb){if("/"!=d.charAt(0))if(this.Bb&&!this.mb)d="/"+d;else{var e=b.mb.lastIndexOf("/");-1!=e&&(d=b.mb.substr(0,e+1)+d)}if(".."==d||"."==d)d="";else if(-1!=d.indexOf("./")||-1!=d.indexOf("/.")){e=0==d.lastIndexOf("/",0);d=d.split("/");for(var f=[],g=0;g<d.length;){var h=d[g++];"."==h?e&&g==d.length&&f.push(""):".."==
|
|
h?((1<f.length||1==f.length&&""!=f[0])&&f.pop(),e&&g==d.length&&f.push("")):(f.push(h),e=!0)}d=f.join("/")}}c?b.mb=d:c=""!==a.g.toString();c?Fb(b,a.g.clone()):c=!!a.Ic;c&&(b.Ic=a.Ic);return b};p.clone=function(){return new Bb(this)};function Cb(a,b,c){a.ac=c?Gb(b,!0):b;a.ac&&(a.ac=a.ac.replace(/:$/,""))}function Db(a,b,c){a.Bb=c?Gb(b,!0):b}function Eb(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error("Bad port number "+b);a.rd=b}else a.rd=null}
|
|
function Fb(a,b,c){b instanceof Hb?a.g=b:(c||(b=Ib(b,Nb)),a.g=new Hb(b))}function Gb(a,b){return a?b?decodeURI(a):decodeURIComponent(a):""}function Ib(a,b,c){return null!=a?(a=encodeURI(a).replace(b,Ob),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null}function Ob(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)}var Jb=/[#\/\?@]/g,Lb=/[#\?:]/g,Kb=/[#\?]/g,Nb=/[#\?@]/g,Mb=/#/g;function Hb(a){this.g=a||null}
|
|
function Pb(a){if(!a.fb&&(a.fb=new Map,a.Hd=0,a.g))for(var b=a.g.split("&"),c=0;c<b.length;c++){var d=b[c].indexOf("="),e=null;if(0<=d){var f=b[c].substring(0,d);e=b[c].substring(d+1)}else f=b[c];f=decodeURIComponent(f.replace(/\+/g," "));e=e||"";a.add(f,decodeURIComponent(e.replace(/\+/g," ")))}}p=Hb.prototype;p.fb=null;p.Hd=null;function Qb(a){Pb(a);return a.Hd}p.add=function(a,b){Pb(this);this.g=null;var c=this.fb.has(a)?this.fb.get(a):null;c||this.fb.set(a,c=[]);c.push(b);this.Hd++;return this};
|
|
p.set=function(a,b){Pb(this);this.g=null;this.fb.has(a)?this.fb.set(a,[b]):this.add(a,b);return this};p.get=function(a){Pb(this);return this.fb.get(a)||[]};p.toString=function(){if(this.g)return this.g;if(!this.fb||!this.fb.size)return"";for(var a=[],b=t(this.fb.keys()),c=b.next();!c.done;c=b.next()){var d=c.value;c=encodeURIComponent(d);d=this.fb.get(d);for(var e=0;e<d.length;e++){var f=c;""!==d[e]&&(f+="="+encodeURIComponent(d[e]));a.push(f)}}return this.g=a.join("&")};
|
|
p.clone=function(){var a=new Hb;a.g=this.g;if(this.fb){for(var b=new Map,c=t(this.fb),d=c.next();!d.done;d=c.next()){var e=t(d.value);d=e.next().value;e=e.next().value;b.set(d,e.concat())}a.fb=b;a.Hd=this.Hd}return a};function Rb(){}function Sb(a,b){if(!a&&!b)return!0;if(!a||!b||a.byteLength!=b.byteLength)return!1;if((ArrayBuffer.isView(a)?a.buffer:a)==(ArrayBuffer.isView(b)?b.buffer:b)&&(a.byteOffset||0)==(b.byteOffset||0))return!0;var c=Tb(a);b=Tb(b);for(var d=0;d<a.byteLength;d++)if(c[d]!=b[d])return!1;return!0}function Ub(a){return ArrayBuffer.isView(a)?0==a.byteOffset&&a.byteLength==a.buffer.byteLength?a.buffer:(new Uint8Array(a)).buffer:a}
|
|
function Tb(a,b,c){c=void 0===c?Infinity:c;return Vb(a,void 0===b?0:b,c,Uint8Array)}function Xb(a,b,c){c=void 0===c?Infinity:c;return Vb(a,void 0===b?0:b,c,Uint16Array)}function Yb(a,b,c){c=void 0===c?Infinity:c;return Vb(a,void 0===b?0:b,c,DataView)}
|
|
function Vb(a,b,c,d){var e=ArrayBuffer.isView(a)?a.buffer:a,f=1;"BYTES_PER_ELEMENT"in d&&(f=d.BYTES_PER_ELEMENT);var g=((a.byteOffset||0)+a.byteLength)/f;a=Math.floor(Math.max(0,Math.min(((a.byteOffset||0)+b)/f,g)));return new d(e,a,Math.floor(Math.min(a+Math.max(c,0),g))-a)}T("shaka.util.BufferUtils",Rb);Rb.toDataView=Yb;Rb.toUint16=Xb;Rb.toUint8=Tb;Rb.toArrayBuffer=Ub;Rb.equal=Sb;function U(a,b,c){var d=Oa.apply(3,arguments);this.severity=a;this.category=b;this.code=c;this.data=d;this.handled=!1;this.message="Shaka Error "+this.code;if(Zb)try{throw Error(this.message||"Shaka Error");}catch(e){this.stack=e.stack}}U.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")};T("shaka.util.Error",U);var Zb=!0;U.Severity={RECOVERABLE:1,CRITICAL:2};U.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9,ADS:10};
|
|
U.Code={UNSUPPORTED_SCHEME:1E3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,REQUEST_FILTER_ERROR:1006,RESPONSE_FILTER_ERROR:1007,MALFORMED_TEST_URI:1008,UNEXPECTED_TEST_REQUEST:1009,ATTEMPTS_EXHAUSTED:1010,SEGMENT_MISSING:1011,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_EXTRACT_CUE_START_TIME:2009,INVALID_MP4_CEA:2010,TEXT_COULD_NOT_GUESS_MIME_TYPE:2011,
|
|
CANNOT_ADD_EXTERNAL_TEXT_TO_SRC_EQUALS:2012,TEXT_ONLY_WEBVTT_SRC_EQUALS:2013,MISSING_TEXT_PLUGIN:2014,UNSUPPORTED_EXTERNAL_THUMBNAILS_URI:2017,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,TRANSMUXING_FAILED:3018,CONTENT_TRANSFORMATION_FAILED:3019,MSS_MISSING_DATA_FOR_TRANSMUXING:3020,MSS_TRANSMUXING_FAILED:3022,TRANSMUXING_NO_VIDEO_DATA:3023,STREAMING_NOT_ALLOWED:3024,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,RESTRICTIONS_CANNOT_BE_MET:4012,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_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,CONTENT_UNSUPPORTED_BY_BROWSER:4032,CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM:4033,NO_VARIANTS:4036,PERIOD_FLATTENING_FAILED:4037,INCONSISTENT_DRM_ACROSS_PERIODS:4038,HLS_VARIABLE_NOT_FOUND:4039,HLS_MSE_ENCRYPTED_MP2T_NOT_SUPPORTED:4040,HLS_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED:4041,NO_WEB_CRYPTO_API:4042,CANNOT_ADD_EXTERNAL_THUMBNAILS_TO_LIVE_STREAM:4045,MSS_INVALID_XML:4046,MSS_LIVE_CONTENT_NOT_SUPPORTED:4047,AES_128_INVALID_IV_LENGTH:4048,
|
|
AES_128_INVALID_KEY_LENGTH:4049,DASH_CONFLICTING_AES_128:4050,DASH_UNSUPPORTED_AES_128:4051,DASH_INVALID_PATCH:4052,HLS_EMPTY_MEDIA_PLAYLIST:4053,DASH_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED:4054,CANNOT_ADD_EXTERNAL_CHAPTERS_TO_LIVE_STREAM:4054,STREAMING_ENGINE_STARTUP_INVALID_STATE:5006,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,SERVER_CERTIFICATE_REQUIRED:6015,INIT_DATA_TRANSFORM_ERROR:6016,SERVER_CERTIFICATE_REQUEST_FAILED:6017,MIN_HDCP_VERSION_NOT_MATCH:6018,ERROR_CHECKING_HDCP_VERSION:6019,MISSING_EME_SUPPORT:6020,LOAD_INTERRUPTED:7E3,OPERATION_ABORTED:7001,NO_VIDEO_ELEMENT:7002,OBJECT_DESTROYED:7003,CONTENT_NOT_LOADED:7004,SRC_EQUALS_PRELOAD_NOT_SUPPORTED:7005,
|
|
PRELOAD_DESTROYED:7006,QUEUE_INDEX_OUT_OF_BOUNDS:7007,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,DEPRECATED_OPERATION_ABORTED:9002,REQUESTED_ITEM_NOT_FOUND:9003,MALFORMED_OFFLINE_URI:9004,CANNOT_STORE_LIVE_OFFLINE:9005,NO_INIT_DATA_FOR_OFFLINE:9007,LOCAL_PLAYER_INSTANCE_REQUIRED:9008,NEW_KEY_OPERATION_NOT_SUPPORTED:9011,
|
|
KEY_NOT_FOUND:9012,MISSING_STORAGE_CELL:9013,STORAGE_LIMIT_REACHED:9014,DOWNLOAD_SIZE_CALLBACK_ERROR:9015,MODIFY_OPERATION_NOT_SUPPORTED:9016,INDEXED_DB_INIT_TIMED_OUT:9017,CS_IMA_SDK_MISSING:1E4,CS_AD_MANAGER_NOT_INITIALIZED:10001,SS_IMA_SDK_MISSING:10002,SS_AD_MANAGER_NOT_INITIALIZED:10003,CURRENT_DAI_REQUEST_NOT_FINISHED:10004,MT_AD_MANAGER_NOT_INITIALIZED:10005,INTERSTITIAL_AD_MANAGER_NOT_INITIALIZED:10006,VAST_INVALID_XML:10007};function $b(){}
|
|
function ac(a){if(!a)return"";a=Tb(a);239==a[0]&&187==a[1]&&191==a[2]&&(a=a.subarray(3));if(window.TextDecoder&&!qb().jh())return a=(new TextDecoder).decode(a),a.includes("\ufffd")&&ab('Decoded string contains an "unknown character" codepoint. That probably means the UTF8 encoding was incorrect!'),a;for(var b="",c=0;c<a.length;++c){var d=65533;0==(a[c]&128)?d=a[c]:a.length>=c+2&&192==(a[c]&224)&&128==(a[c+1]&192)?(d=(a[c]&31)<<6|a[c+1]&63,c+=1):a.length>=c+3&&224==(a[c]&240)&&128==(a[c+1]&192)&&
|
|
128==(a[c+2]&192)?(d=(a[c]&15)<<12|(a[c+1]&63)<<6|a[c+2]&63,c+=2):a.length>=c+4&&240==(a[c]&241)&&128==(a[c+1]&192)&&128==(a[c+2]&192)&&128==(a[c+3]&192)&&(d=(a[c]&7)<<18|(a[c+1]&63)<<12|(a[c+2]&63)<<6|a[c+3]&63,c+=3);if(65535>=d)b+=String.fromCharCode(d);else{d-=65536;var e=d&1023;b+=String.fromCharCode(55296+(d>>10));b+=String.fromCharCode(56320+e)}}return b}
|
|
function bc(a,b,c){if(!a)return"";if(!c&&0!=a.byteLength%2)throw new U(2,2,2004);c=Math.floor(a.byteLength/2);var d=new Uint16Array(c);a=Yb(a);for(var e=0;e<c;e++)d[e]=a.getUint16(2*e,b);return cc(d)}
|
|
function dc(a){function b(d){return c.byteLength<=d||9<=c[d]&&126>=c[d]}if(!a)return"";var c=Tb(a);if(239==c[0]&&187==c[1]&&191==c[2])return ac(c);if(254==c[0]&&255==c[1])return bc(c.subarray(2),!1);if(255==c[0]&&254==c[1])return bc(c.subarray(2),!0);if(0==c[0]&&0==c[2])return bc(a,!1);if(0==c[1]&&0==c[3])return bc(a,!0);if(b(0)&&b(1)&&b(2)&&b(3))return ac(a);throw new U(2,2,2003);}
|
|
function ec(a){if(window.TextEncoder&&!qb().jh()){var b=new TextEncoder;return Ub(b.encode(a))}a=encodeURIComponent(a);a=unescape(a);b=new Uint8Array(a.length);for(var c=0;c<a.length;c++)b[c]=a[c].charCodeAt(0);return Ub(b)}function fc(a,b){for(var c=new ArrayBuffer(2*a.length),d=new DataView(c),e=0;e<a.length;++e)d.setUint16(2*e,a.charCodeAt(e),b);return c}function cc(a){return gc.value()(a)}
|
|
function hc(a){var b={"&":"&","<":"<",">":">",""":'"',"'":"'"," ":"\u00a0","‎":"\u200e","‏":"\u200f"},c=/&(?:amp|lt|gt|quot|apos|nbsp|lrm|rlm|#[xX]?[0-9a-fA-F]+);/g,d=RegExp(c.source);return a&&d.test(a)?a.replace(c,function(e){return"#"==e[1]?(e="x"==e[2]||"X"==e[2]?parseInt(e.substring(3),16):parseInt(e.substring(2),10),0<=e&&1114111>=e?String.fromCodePoint(e):""):b[e]||"'"}):a||""}T("shaka.util.StringUtils",$b);$b.resetFromCharCode=function(){gc.g=void 0};
|
|
$b.toUTF16=fc;$b.toUTF8=ec;$b.fromBytesAutoDetect=dc;$b.fromUTF16=bc;$b.fromUTF8=ac;var gc=new pb(function(){function a(c){try{var d=new Uint8Array(c);return 0<String.fromCharCode.apply(null,d).length}catch(e){return!1}}for(var b={Dc:65536};0<b.Dc;b={Dc:b.Dc},b.Dc/=2)if(a(b.Dc))return function(c){return function(d){for(var e="",f=0;f<d.length;f+=c.Dc)e+=String.fromCharCode.apply(null,d.subarray(f,f+c.Dc));return e}}(b);return null});function jc(){}function kc(a){a=cc(Tb(a));return btoa(a)}function lc(a,b){b=void 0==b?!0:b;a=kc(a).replace(/\+/g,"-").replace(/\//g,"_");return b?a:a.replace(/[=]*$/,"")}function mc(a){a=window.atob(a.replace(/-/g,"+").replace(/_/g,"/"));for(var b=new Uint8Array(a.length),c=0;c<a.length;++c)b[c]=a.charCodeAt(c);return b}function nc(a){for(var b=a.length/2,c=new Uint8Array(b),d=0;d<b;d++)c[d]=window.parseInt(a.substr(2*d,2),16);return c}
|
|
function oc(a){var b=Tb(a);a="";b=t(b);for(var c=b.next();!c.done;c=b.next())c=c.value,c=c.toString(16),1==c.length&&(c="0"+c),a+=c;return a}function pc(){for(var a=Oa.apply(0,arguments),b=0,c=0;c<a.length;++c)b+=a[c].byteLength;b=new Uint8Array(b);for(var d=c=0;d<a.length;++d){var e=a[d];ArrayBuffer.isView(e)&&1===e.BYTES_PER_ELEMENT?b.set(e,c):b.set(Tb(e),c);c+=e.byteLength}return b}T("shaka.util.Uint8ArrayUtils",jc);jc.concat=pc;jc.toHex=oc;jc.fromHex=nc;jc.fromBase64=mc;jc.toBase64=lc;
|
|
jc.toStandardBase64=kc;function qc(a,b,c){c=void 0===c?"":c;if(0==b.length)return a;if(1==a.length&&1==b.length){var d=new Bb(a[0]);b=new Bb(b[0]);b=d.resolve(b);c&&Fb(b,c);return[b.toString()]}b=b.map(function(h){return new Bb(h)});d=[];a=t(a);for(var e=a.next();!e.done;e=a.next()){e=new Bb(e.value);for(var f=t(b),g=f.next();!g.done;g=f.next())g=e.resolve(g.value),c&&Fb(g,c),d.push(g.toString())}return d}
|
|
function rc(a,b,c,d){a={keySystem:a,encryptionScheme:b,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:c||[],keyIds:new Set};d&&(a.keySystemUris=new Set([d]));return a}
|
|
function sc(a,b){b=void 0===b?"cenc":b;var c=[],d=[],e=[];a.forEach(function(g,h){var k=h;22!=k.length&&(k=lc(nc(h),!1));var l=g;22!=l.length&&(l=lc(nc(g),!1));g={kty:"oct",kid:k,k:l};c.push(g);d.push(g.kid);e.push(h)});a=JSON.stringify({keys:c});var f=JSON.stringify({kids:d});f=[{initData:Tb(ec(f)),initDataType:"keyids"}];return{keySystem:"org.w3.clearkey",encryptionScheme:b,licenseServerUri:"data:application/json;base64,"+window.btoa(a),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,
|
|
audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:f,keyIds:new Set(e)}}function tc(a,b){if(1==b.length)return b[0];a=uc(a,b);if(null!=a)return a;throw new U(2,4,4025,b);}function uc(a,b){var c=vc.get(a);c=t(c);for(var d=c.next();!d.done;d=c.next()){d=d.value;for(var e=t(b),f=e.next();!f.done;f=e.next())if(f=f.value,d.test(f.trim()))return f.trim()}return a==wc?"":null}
|
|
function xc(a,b){var c=[];a=vc.get(a);a=t(a);for(var d=a.next();!d.done;d=a.next()){d=d.value;for(var e=t(b),f=e.next();!f.done;f=e.next())f=f.value,d.test(f.trim())&&c.push(f.trim())}return c}
|
|
var wc="text",yc={wa:"video",Y:"audio",Oa:wc,Nf:"image",al:"application"},zc=1/15,vc=(new Map).set("audio",[/^vorbis$/,/^Opus$/,/^opus$/,/^fLaC$/,/^flac$/,/^mp4a/,/^[ae]c-3$/,/^ac-4/,/^dts[cex]$/,/^iamf/,/^mhm[12]/,/^ac3$/,/^eac3$/]).set("video",[/^avc/,/^hev/,/^hvc/,/^vvc/,/^vvi/,/^vp0?[89]/,/^av01/,/^dvh/,/^dva/,/^dav/]).set("text",[/^vtt$/,/^wvtt/,/^stpp/]);function Ac(a,b,c,d){this.g=null;this.l=a;this.i=b;this.m=c;this.o=d;this.j=!1;a:{"undefined"===typeof libDPIModule&&bb("Could not find LCEVC Library dependencies on this page");if("undefined"!==typeof LCEVCdec)this.h=LCEVCdec;else if("undefined"!==typeof LcevcDil)this.h=LcevcDil,this.j=!0,wb("LcevcDil","lcevc_dil.js is deprecated, please use lcevc_dec.js instead");else{bb("Could not find LCEVC Library on this page");a=!1;break a}"undefined"===typeof this.h.SupportObject?(bb("Could not find LCEVC Library on this page"),
|
|
a=!1):(this.h.SupportObject.SupportStatus||bb(this.h.SupportObject.SupportError),a="undefined"!==typeof this.h&&"undefined"!==typeof libDPIModule&&this.i instanceof HTMLCanvasElement&&this.h.SupportObject.SupportStatus)}a&&!this.g&&this.h.SupportObject.webGLSupport(this.i)&&(this.i.classList.remove("shaka-hidden"),this.g=this.j?new this.h.LcevcDil(this.l,this.i,this.m):new this.h.LCEVCdec(this.l,this.i,this.m))}
|
|
function Bc(a,b,c,d){"video"!==d.type||a.o&&!d.baseOriginalId||a.g&&a.g.appendBuffer(b,"video",d.id,-c,!a.o)}function Cc(a){a.g&&a.i.classList.add("shaka-hidden")}Ac.prototype.release=function(){this.g&&(this.g.close(),this.g=null)};function Dc(a){return a&&"undefined"!==typeof LCEVCdec?"lvc1"==a.codecs:!1}T("shaka.lcevc.Dec",Ac);Ac.prototype.release=Ac.prototype.release;function Ec(a){if(Fc.has(a))return Fc.get(a);var b=window.ManagedMediaSource||window.MediaSource;return b?(b=b.isTypeSupported(a),Fc.set(a,b),b):!1}function Gc(){var a=window.ManagedSourceBuffer||window.SourceBuffer;return!!a&&!!a.prototype&&!!a.prototype.changeType}function Hc(){var a=window.ManagedMediaSource||window.MediaSource;return a&&a.prototype?!!a.prototype.setLiveSeekableRange&&!!a.prototype.clearLiveSeekableRange:!1}var Fc=new Map;function Ic(){}Ic.prototype.extract=function(){};Ic.prototype.decode=function(){return[]};Ic.prototype.clear=function(){};Ic.prototype.getStreams=function(){return[]};function Jc(){}Jc.prototype.init=function(){};Jc.prototype.parse=function(){return[]};function Kc(){}p=Kc.prototype;p.init=function(){};p.rf=function(){};p.Bd=function(){};p.remove=function(){};p.Of=function(){};T("shaka.media.IClosedCaptionParser",Kc);function Lc(a){this.h=new Map;this.i=0;this.j=new Jc;if(a=Mc(a.toLowerCase()))this.j=a();this.g=new Ic;if(a=Nc)this.g=a(),this.h.set(this.i,this.g)}p=Lc.prototype;
|
|
p.init=function(a,b,c){b=void 0===b?!1:b;c=void 0===c?-1:c;if(-1!=c&&this.i!=c){b=c;var d=this.h.get(b);this.h.set(this.i,this.g);if(d)this.g=d;else{if(d=Nc)this.g=d();this.h.set(b,this.g)}}else b||this.Bd();this.j.init(a);-1!=c&&(this.i=c)};p.rf=function(a){a=this.j.parse(a);a=t(a);for(var b=a.next();!b.done;b=a.next()){b=b.value;var c=Tb(b.packet);0<c.length&&this.g.extract(c,b.pts)}return this.g.decode()};p.Bd=function(){this.g.clear()};
|
|
p.remove=function(a){a=void 0===a?[]:a;a=new Set(a);for(var b=t(this.h.keys()),c=b.next();!c.done;c=b.next())if(c=c.value,!a.has(c)){var d=this.h.get(c);d&&d.clear();this.h.delete(c)}};p.Of=function(){return this.g.getStreams()};function Oc(a,b){Pc.set(a,b)}function Mc(a){return Pc.get(a)}T("shaka.media.ClosedCaptionParser",Lc);Lc.findDecoder=function(){return Nc};Lc.unregisterDecoder=function(){Nc=null};Lc.registerDecoder=function(a){Nc=a};Lc.findParser=Mc;Lc.unregisterParser=function(a){Pc.delete(a)};
|
|
Lc.registerParser=Oc;var Pc=new Map,Nc=null;function Qc(){this.id="";this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0;this.height=this.width=100;this.viewportAnchorUnits=this.widthUnits=this.heightUnits=Rc;this.scroll=Sc}T("shaka.text.CueRegion",Qc);var Rc=1;Qc.units={PX:0,PERCENTAGE:Rc,LINES:2};var Sc="";Qc.scrollMode={NONE:Sc,UP:"up"};function Tc(a,b){return"number"===typeof a&&"number"===typeof b&&isNaN(a)&&isNaN(b)?!0:a===b}function Uc(a,b){b=a.indexOf(b);-1<b&&a.splice(b,1)}function Vc(a,b,c){c||(c=Tc);if(a.length!=b.length)return!1;b=b.slice();a=t(a);for(var d=a.next(),e={};!d.done;e={bi:void 0},d=a.next()){e.bi=d.value;d=b.findIndex(function(f){return function(g){return c(f.bi,g)}}(e));if(-1==d)return!1;b[d]=b[b.length-1];b.pop()}return 0==b.length}
|
|
function Wc(a,b,c){if(a===b)return!0;if(!a||!b)return a==b;c||(c=Tc);if(a.length!=b.length)return!1;for(var d=0;d<a.length;d++)if(!c(a[d],b[d]))return!1;return!0};function Xc(a){this.h=a||"";this.g=0}function Yc(a){Zc(a,/[ \t]+/gm)}function Zc(a,b){b.lastIndex=a.g;b=b.exec(a.h);b=null==b?null:{position:b.index,length:b[0].length,results:b};if(a.g==a.h.length||null==b||b.position!=a.g)return null;a.g+=b.length;return b.results}function ad(a){return a.g==a.h.length?null:(a=Zc(a,/[^ \t\n]*/gm))?a[0]:null}
|
|
function bd(a){a=Zc(a,cd);if(null==a)return null;var b=Number(a[2]),c=Number(a[3]);return 59<b||59<c?null:(Number(a[6])||0)/1E3+c+60*b+3600*(Number(a[1])||0)}function dd(a){return a?bd(new Xc(a)):null}var cd=/(?:(\d{1,}):)?(\d{2}):(\d{2})((\.(\d{1,3})))?/g;function ed(a){function b(d){switch(typeof d){case "undefined":case "boolean":case "number":case "string":case "symbol":case "function":return d;default:if(!d||ArrayBuffer.isView(d))return d;if(c.has(d))return null;var e=Array.isArray(d);if(d.constructor!=Object&&!e)return null;c.add(d);var f=e?[]:{},g;for(g in d)f[g]=b(d[g]);e&&(f.length=d.length);return f}}var c=new WeakSet;return b(a)}function fd(a){var b={},c;for(c in a)b[c]=a[c];return b}
|
|
function gd(a){if(Array.isArray(a)){for(var b=[],c=0;c<a.length;c++){var d=c.toString(),e=a[c];void 0!==e&&(e=gd(e))&&b.push(d+":"+e)}a="["+b.join(",")+"]"}else if("function"==typeof a)a="";else if(a instanceof Object){c=Object.keys(a);c.sort();b=[];c=t(c);for(d=c.next();!d.done;d=c.next())e=d.value,d=JSON.stringify(e),e=a[e],void 0!==e&&(e=gd(e))&&b.push(d+":"+e);a="{"+b.join(",")+"}"}else a=JSON.stringify(a);return a};/*
|
|
@license
|
|
tXml
|
|
Copyright 2015 Tobias Nickel
|
|
SPDX-License-Identifier: MIT
|
|
*/
|
|
function hd(a,b){var c=void 0===c?!1:c;a=dc(a);return jd(a,b,c)}function jd(a,b,c){a=kd(a,void 0===c?!1:c);return!b&&a.length?a[0]:(a=a.find(function(d){return b.split(",").includes(d.tagName)}))?a:null}function ld(a){return md.has(a)?md.get(a):""}
|
|
function kd(a,b){function c(f,g){g=void 0===g?!1:g;for(var h=[];a[e];)if(60==a.charCodeAt(e)){if(47===a.charCodeAt(e+1)){g=e+2;e=a.indexOf(">",e);g=a.substring(g,e);var k=g.indexOf(f);if(-1==k){var l=f.indexOf(".");0<l&&(k=g.indexOf(f.substring(0,l)))}if(-1==k)throw f=a.substring(0,e).split("\n"),Error("Unexpected close tag\nLine: "+(f.length-1)+"\nColumn: "+(f[f.length-1].length+1)+"\nChar: "+a[e]);e+1&&(e+=1);break}else if(33===a.charCodeAt(e+1)){if(45==a.charCodeAt(e+2)){for(;-1!==e&&(62!==a.charCodeAt(e)||
|
|
45!=a.charCodeAt(e-1)||45!=a.charCodeAt(e-2)||-1==e);)e=a.indexOf(">",e+1);-1===e&&(e=a.length)}else if(91===a.charCodeAt(e+2)&&91===a.charCodeAt(e+8)&&"cdata"===a.substr(e+3,5).toLowerCase()){k=a.indexOf("]]\x3e",e);-1==k?(h.push(a.substr(e+9)),e=a.length):(h.push(a.substring(e+9,k)),e=k+3);continue}e++;continue}a:{l=g;e++;var m=d(),n={};for(k=[];62!==a.charCodeAt(e)&&a[e];){var q=a.charCodeAt(e);if(64<q&&91>q||96<q&&123>q){q=d();for(var r=a.charCodeAt(e);r&&39!==r&&34!==r&&!(64<r&&91>r||96<r&&123>
|
|
r)&&62!==r;)e++,r=a.charCodeAt(e);var u=e+1;e=a.indexOf(a[e],u);u=a.slice(u,e);if(39===r||34===r){if(-1===e){l={tagName:m,attributes:n,children:k,parent:null};if(b)for(m=0;m<k.length;m++)"string"!==typeof k[m]&&(k[m].parent=l);k=l;break a}}else u=null,e--;if(q.startsWith("xmlns:")){r=u;var w=q.split(":")[1];md.set(r,w);nd.set(w,r)}"tt"===m&&"xml:space"===q&&"preserve"===u&&(l=!0);n[q]=u}e++}47!==a.charCodeAt(e-1)?(e++,k=c(m,l)):e++;l={tagName:m,attributes:n,children:k,parent:null};m=k.length;for(n=
|
|
0;n<m;n++)q=k[n],"string"!==typeof q?b&&(q.parent=l):n==m-1&&"\n"==q&&k.pop();k=l}h.push(k);if("string"===typeof k)break;"?"===k.tagName[0]&&k.children&&(h.push.apply(h,x(k.children)),k.children=[])}else k=e,e=a.indexOf("<",e)-1,-2===e&&(e=a.length),k=a.slice(k,e+1),g?0<k.length&&h.push(k):h.length&&1==k.length&&"\n"==k[0]?h.push(k):0<k.trim().length&&h.push(k),e++;return h}function d(){for(var f=e;-1==="\r\n\t>/= ".indexOf(a[e])&&a[e];)e++;return a.slice(f,e)}var e=0;return c("")}
|
|
function od(a){return"string"===typeof a}function pd(a){var b=[];if(!a.children)return[];a=t(a.children);for(var c=a.next();!c.done;c=a.next())c=c.value,"string"!==typeof c&&b.push(c);return b}function qd(a,b){var c=[];if(!a.children)return[];a=t(a.children);for(var d=a.next();!d.done;d=a.next())d=d.value,d.tagName===b&&c.push(d);return c}function rd(a){if("string"===typeof a)return hc(a);a=a.children.reduce(function(b,c){return"string"===typeof c?b+c:b},"");return""===a?null:hc(a)}
|
|
function sd(a){if(!Array.from(a.children).every(function(b){return"string"===typeof b}))return null;(a=rd(a))&&(a=a.trim());return a}function td(a,b,c){c=void 0===c?[]:c;a.tagName===b&&c.push(a);if(a.children){a=t(a.children);for(var d=a.next();!d.done;d=a.next())td(d.value,b,c)}return c}function ud(a,b){a=qd(a,b);return 1!=a.length?null:a[0]}function vd(a,b,c){a=wd(a,b,c);return 1!=a.length?null:a[0]}
|
|
function xd(a,b,c,d){d=void 0===d?null:d;var e=null;a=a.attributes[b];null!=a&&(e=c(a));return null==e?d:e}function yd(a,b,c){b=ld(b);return a.attributes[b+":"+c]||null}function wd(a,b,c){var d=ld(b);b=[];if(a.children)for(c=d?d+":"+c:c,a=t(a.children),d=a.next();!d.done;d=a.next())(d=d.value)&&d.tagName===c&&b.push(d);return b}function zd(a,b,c){b=t(b);for(var d=b.next();!d.done;d=b.next())if(d=yd(a,d.value,c))return d;return null}
|
|
function Ad(a){if(!a)return null;/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(a)&&(a+="Z");a=Date.parse(a);return isNaN(a)?null:a/1E3}function Bd(a){if(!a)return null;a=RegExp("^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$","i").exec(a);if(!a)return null;a=31536E3*Number(a[1]||null)+2592E3*Number(a[2]||null)+86400*Number(a[3]||null)+3600*Number(a[4]||null)+60*Number(a[5]||null)+Number(a[6]||null);return isFinite(a)?a:null}
|
|
function Cd(a){var b=/([0-9]+)-([0-9]+)/.exec(a);if(!b)return null;a=Number(b[1]);if(!isFinite(a))return null;b=Number(b[2]);return isFinite(b)?{start:a,end:b}:null}function Dd(a){a=Number(a);return 0===a%1?a:null}function Ed(a){a=Number(a);return 0===a%1&&0<a?a:null}function Fd(a){a=Number(a);return 0===a%1&&0<=a?a:null}function Gd(a){a=Number(a);return isNaN(a)?null:a}function Hd(a){return a?"true"===a.toLowerCase():!1}
|
|
function Id(a){var b;var c=(b=a.match(/^(\d+)\/(\d+)$/))?Number(b[1])/Number(b[2]):Number(a);return isNaN(c)?null:c}
|
|
function Jd(a){var b=[];a=hc(a).split(/\/+(?=(?:[^'"]*['"][^'"]*['"])*[^'"]*$)/);a=t(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=c.match(/^([\w]+)/);if(d){var e=c.match(/(@id='(.*?)')/),f=c.match(/(@t='(\d+)')/),g=c.match(/(@n='(\d+)')/),h=c.match(/\[(\d+)\]/);b.push({name:d[0],id:e?e[0].match(/'(.*?)'/)[0].replace(/'/gm,""):null,t:f?Number(f[0].match(/'(.*?)'/)[0].replace(/'/gm,"")):null,n:g?Number(g[0].match(/'(.*?)'/)[0].replace(/'/gm,"")):null,position:h?Number(h[1])-1:null,sc:c.split("/@")[1]||
|
|
null})}else c.startsWith("@")&&b.length&&(b[b.length-1].sc=c.slice(1))}return b}
|
|
function Ld(a,b){var c=Jd(b.attributes.sel||"");if(c.length){var d=c[c.length-1],e=b.attributes.pos||null;c=d.position;null==c&&(null!==d.t&&(c=Md(a,"t",d.t)),null!==d.n&&(c=Md(a,"n",d.n)));null===c?c="prepend"===e?0:a.length:"prepend"===e?--c:"after"===e&&++c;e=b.tagName;(d=d.sc)&&a[c]?Nd(a[c],e,d,sd(b)||""):("remove"!==e&&"replace"!==e||a.splice(c,1),"add"!==e&&"replace"!==e||a.splice.apply(a,[c,0].concat(x(b.children))))}}
|
|
function Md(a,b,c){var d=0;a=t(a);for(var e=a.next();!e.done;e=a.next()){if(Number(e.value.attributes[b])===c)return d;d++}return null}function Nd(a,b,c,d){if("remove"===b)delete a.attributes[c];else if("add"===b||"replace"===b)a.attributes[c]=d}
|
|
function Od(a){var b="",c=a.tagName.split(":");0<c.length&&(b=c[0],b=nd.has(b)?nd.get(b):"");b=document.createElementNS(b,a.tagName);for(var d in a.attributes)b.setAttribute(d,a.attributes[d]);a=t(a.children);for(d=a.next();!d.done;d=a.next())d=d.value,c=void 0,"string"==typeof d?c=new Text(d):c=Od(d),b.appendChild(c);return b}
|
|
function Pd(a){if(!a)return null;var b={tagName:a.tagName,attributes:fd(a.attributes),children:[],parent:null};a=t(a.children);for(var c=a.next();!c.done;c=a.next())c=c.value,"string"===typeof c?b.children.push(c):(c=Pd(c),c.parent=b,b.children.push(c));return b}var md=new Map,nd=new Map;function Qd(a,b,c){this.startTime=a;this.endTime=b;this.payload=c;this.region=new Qc;this.position=null;this.positionAlign=Rd;this.size=0;this.textAlign=Sd;this.direction=Ud;this.writingMode=Vd;this.lineInterpretation=Wd;this.line=null;this.lineHeight="";this.lineAlign=Xd;this.displayAlign=Yd;this.fontSize=this.border=this.backgroundImage=this.backgroundColor=this.color="";this.fontWeight=Zd;this.fontStyle=$d;this.linePadding=this.letterSpacing=this.fontFamily="";this.opacity=1;this.textCombineUpright=
|
|
"";this.textDecoration=[];this.textStrokeWidth=this.textStrokeColor=this.textShadow="";this.wrapLine=!0;this.id="";this.nestedCues=[];this.lineBreak=this.isContainer=!1;this.rubyTag=null;this.cellResolution={Gc:32,rows:15}}function ae(a,b){a=new Qd(a,b,"");a.lineBreak=!0;return a}Qd.prototype.clone=function(){var a=new Qd(0,0,""),b;for(b in this)a[b]=this[b],Array.isArray(a[b])&&(a[b]=a[b].slice());return a};
|
|
function ce(a,b){if(a.payload!=b.payload||!(.001>Math.abs(a.startTime-b.startTime)&&.001>Math.abs(a.endTime-b.endTime)))return!1;for(var c in a)if("startTime"!=c&&"endTime"!=c&&"payload"!=c)if("nestedCues"==c){if(!Wc(a.nestedCues,b.nestedCues,ce))return!1}else if("region"==c||"cellResolution"==c)for(var d in a[c]){if(a[c][d]!=b[c][d])return!1}else if(Array.isArray(a[c])){if(!Wc(a[c],b[c]))return!1}else if(a[c]!=b[c])return!1;return!0}
|
|
function fe(a,b){b=void 0===b?new Map:b;var c=a.payload;if(c.includes("<")){0===b.size&&ge(b);var d=c;c=[];for(var e=-1,f=0;f<d.length;f++)"<"===d[f]?e=f+1:">"===d[f]&&0<e&&(e=d.substr(e,f-e),e.match(he)&&c.push(e),e=-1);c=t(c);for(f=c.next();!f.done;f=c.next())f=f.value,d=d.replace("<"+f+">",'<div time="'+f+'">'),d+="</div>";a:{f=d;e=[];var g=-1;c="";d=!1;for(var h=0;h<f.length;h++)if("/"===f[h]){var k=f.indexOf(">",h);if(-1===k){c=f;break a}if((k=f.substring(h+1,k))&&"v"==k){d=!0;var l=null;e.length&&
|
|
(l=e[e.length-1]);if(l){if(l===k)c+="/"+k+">";else{if(!l.startsWith("v")){c+=f[h];continue}c+="/"+l+">"}h+=k.length+1}else c+=f[h]}else c+=f[h]}else"<"===f[h]?(g=h+1,"v"!=f[g]&&(g=-1)):">"===f[h]&&0<g&&(e.push(f.substr(g,h-g)),g=-1),c+=f[h];f=t(e);for(e=f.next();!e.done;e=f.next())e=e.value,g=e.replace(" ",".voice-"),c=c.replace("<"+e+">","<"+g+">"),c=c.replace("</"+e+">","</"+g+">"),d||(c+="</"+g+">")}c=ie(c);a.payload="";try{var m=jd("<span>"+c+"</span>","span")}catch(n){}if(m)if(m=m.children,1!=
|
|
m.length||m[0].tagName)for(m=t(m),c=m.next();!c.done;c=m.next())je(c.value,a,b);else a.payload=hc(c);else a.payload=hc(c)}else a.payload=hc(c)}function ge(a){for(var b=t(Object.entries(ke)),c=b.next();!c.done;c=b.next()){var d=t(c.value);c=d.next().value;d=d.next().value;var e=new Qd(0,0,"");e.color=d;a.set("."+c,e)}b=t(Object.entries(le));for(c=b.next();!c.done;c=b.next())d=t(c.value),c=d.next().value,d=d.next().value,e=new Qd(0,0,""),e.backgroundColor=d,a.set("."+c,e)}
|
|
function ie(a){var b={"< ":""," >":" >"},c=/(< +>|<\s|\s>)/g,d=RegExp(c.source);return a&&d.test(a)?a.replace(c,function(e){return b[e]||""}):a||""}
|
|
function je(a,b,c){var d=b.clone();d.nestedCues=[];d.payload="";d.rubyTag="";d.line=null;d.region=new Qc;d.position=null;d.size=0;d.textAlign=Sd;if(a.tagName)for(var e=t(a.tagName.split(/(?=[ .])+/g)),f=e.next();!f.done;f=e.next()){var g=f=f.value;if(g.startsWith(".voice-")){var h=g.split("-").pop();g='v[voice="'+h+'"]';c.has(g)||(g="v[voice="+h+"]")}c.has(g)&&(h=d,g=c.get(g))&&(h.backgroundColor=me(g.backgroundColor,h.backgroundColor),h.color=me(g.color,h.color),h.fontFamily=me(g.fontFamily,h.fontFamily),
|
|
h.fontSize=me(g.fontSize,h.fontSize),h.textShadow=me(g.textShadow,h.textShadow),h.fontWeight=g.fontWeight,h.fontStyle=g.fontStyle,h.opacity=g.opacity,h.rubyTag=g.rubyTag,h.textCombineUpright=g.textCombineUpright,h.wrapLine=g.wrapLine);switch(f){case "br":d=ae(d.startTime,d.endTime);b.nestedCues.push(d);return;case "b":d.fontWeight=ne;break;case "i":d.fontStyle=oe;break;case "u":d.textDecoration.push(pe);break;case "font":if(f=a.attributes.color)d.color=f;break;case "div":f=a.attributes.time;if(!f)break;
|
|
if(f=dd(f))d.startTime=f;break;case "ruby":case "rp":case "rt":d.rubyTag=f}}e=a.children;if(od(a)||1==e.length&&od(e[0]))for(c=rd(a).split("\n"),a=!0,c=t(c),e=c.next();!e.done;e=c.next())e=e.value,a||(a=ae(d.startTime,d.endTime),b.nestedCues.push(a)),0<e.length&&(a=d.clone(),a.payload=hc(e),b.nestedCues.push(a)),a=!1;else for(b.nestedCues.push(d),b=t(e),a=b.next();!a.done;a=b.next())je(a.value,d,c)}function me(a,b){return a&&0<a.length?a:b}T("shaka.text.Cue",Qd);Qd.parseCuePayload=fe;Qd.equal=ce;
|
|
Qd.prototype.clone=Qd.prototype.clone;var Rd="auto";Qd.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:Rd};var Sd="center",qe={LEFT:"left",RIGHT:"right",CENTER:Sd,START:"start",END:"end"};Qd.textAlign=qe;var Yd="after",re={BEFORE:"before",CENTER:"center",AFTER:Yd};Qd.displayAlign=re;var Ud="ltr";Qd.direction={HORIZONTAL_LEFT_TO_RIGHT:Ud,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};var Vd="horizontal-tb";Qd.writingMode={HORIZONTAL_TOP_TO_BOTTOM:Vd,VERTICAL_LEFT_TO_RIGHT:"vertical-lr",VERTICAL_RIGHT_TO_LEFT:"vertical-rl"};
|
|
var Wd=0;Qd.lineInterpretation={LINE_NUMBER:Wd,PERCENTAGE:1};var Xd="start",se={CENTER:"center",START:Xd,END:"end"};Qd.lineAlign=se;var ke={white:"white",lime:"lime",cyan:"cyan",red:"red",yellow:"yellow",magenta:"magenta",blue:"blue",black:"black"};Qd.defaultTextColor=ke;var le={bg_white:"white",bg_lime:"lime",bg_cyan:"cyan",bg_red:"red",bg_yellow:"yellow",bg_magenta:"magenta",bg_blue:"blue",bg_black:"black"};Qd.defaultTextBackgroundColor=le;var Zd=400,ne=700;Qd.fontWeight={NORMAL:Zd,BOLD:ne};
|
|
var $d="normal",oe="italic",te={NORMAL:$d,ITALIC:oe,OBLIQUE:"oblique"};Qd.fontStyle=te;var pe="underline";Qd.textDecoration={UNDERLINE:pe,LINE_THROUGH:"lineThrough",OVERLINE:"overline"};var he=/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g;function ue(){}ue.prototype.destroy=function(){};function ve(a,b,c){we.set(a.toLowerCase().split(";")[0]+"-"+c,{priority:c,tf:b})}function xe(a,b){for(var c=a.toLowerCase().split(";")[0],d=t([ye,ze,Ae,Be]),e=d.next();!e.done;e=d.next())if(e=we.get(c+"-"+e.value)){var f=e.tf(),g=f.isSupported(a,b);f.destroy();if(g)return e.tf}return null}T("shaka.transmuxer.TransmuxerEngine",ue);ue.findTransmuxer=xe;ue.unregisterTransmuxer=function(a,b){we.delete(a.toLowerCase().split(";")[0]+"-"+b)};
|
|
ue.registerTransmuxer=ve;ue.prototype.destroy=ue.prototype.destroy;var we=new Map,Be=1,Ae=2,ze=3,ye=4;ue.PluginPriority={FALLBACK:Be,PREFERRED_SECONDARY:Ae,PREFERRED:ze,APPLICATION:ye};function Ce(){}function De(a,b){var c=a;b&&!Ee.includes(a)&&(c+='; codecs="'+b+'"');return c}function Fe(a,b){b&&(a+='; codecs="'+b+'"');return a}function Ge(a,b,c){var d=De(a,b);b=Fe(a,b);xe(b)?(a=xe(b))?(a=a(),c=a.convertCodecs(c,b),a.destroy()):c=b:c="video/mp2t"!=a&&"audio"==c?d.replace("video","audio"):d;return c}function He(a){return a.split(";")[0].split("/")[1]}
|
|
function Ie(a){var b=Je(a);a=b[0].toLowerCase();b=b[1].toLowerCase();switch(!0){case "mp4a"===a&&"69"===b:case "mp4a"===a&&"6b"===b:case "mp4a"===a&&"40.34"===b:return"mp3";case "mp4a"===a&&"66"===b:case "mp4a"===a&&"67"===b:case "mp4a"===a&&"68"===b:case "mp4a"===a&&"40.2"===b:case "mp4a"===a&&"40.02"===b:case "mp4a"===a&&"40.5"===b:case "mp4a"===a&&"40.05"===b:case "mp4a"===a&&"40.29"===b:case "mp4a"===a&&"40.42"===b:return"aac";case "mp4a"===a&&"a5"===b:case "ac3"===a:case "ac-3"===a:return"ac-3";
|
|
case "mp4a"===a&&"a6"===b:case "eac3"===a:case "ec-3"===a:return"ec-3";case "ac-4"===a:return"ac-4";case "mp4a"===a&&"b2"===b:return"dtsx";case "mp4a"===a&&"a9"===b:return"dtsc";case "vp09"===a:case "vp9"===a:return"vp9";case "avc1"===a:case "avc3"===a:return"avc";case "hvc1"===a:case "hev1"===a:return"hevc";case "vvc1"===a:case "vvi1"===a:return"vvc";case "dvh1"===a:case "dvhe"===a:return b&&b.startsWith("05")?"dovi-p5":"dovi-hevc";case "dvav"===a:case "dva1"===a:return"dovi-avc";case "dav1"===a:return"dovi-av1";
|
|
case "dvc1"===a:case "dvi1"===a:return"dovi-vvc"}return a}function Ke(a){var b=[];a=t(a.split(","));for(var c=a.next();!c.done;c=a.next())c=Je(c.value),b.push(c[0]);return b.sort().join(",")}function Le(a){return a.split(";")[0]}function Me(a){a=a.split(/ *; */);a.shift();return(a=a.find(function(b){return b.startsWith("codecs=")}))?a.split("=")[1].replace(/^"|"$/g,""):""}function Ne(a){return"application/x-mpegurl"===a||"application/vnd.apple.mpegurl"===a}
|
|
function Je(a){a=a.split(".");var b=a[0];a.shift();return[b,a.join(".")]}T("shaka.util.MimeUtils",Ce);Ce.getFullTypeWithAllCodecs=Fe;Ce.getFullType=De;(new Map).set("codecs","codecs").set("frameRate","framerate").set("bandwidth","bitrate").set("width","width").set("height","height").set("channelsCount","channels");var Ee=["audio/aac","audio/ac3","audio/ec3","audio/mpeg"];function Pe(a){this.i=null;this.j=a;this.B=!1;this.l=this.s=0;this.m=Infinity;this.h=this.g=null;this.C="";this.A=function(){};this.o=new Map}function Qe(a,b){Re.set(a,b)}function Se(a){return Re.get(a)}function Te(a){return Re.has(a)?!0:"application/cea-608"==a||"application/cea-708"==a?!!Nc:!1}Pe.prototype.destroy=function(){this.j=this.i=null;this.o.clear();return Promise.resolve()};
|
|
function Ue(a,b,c,d,e){var f,g,h,k,l,m,n;return Q(function(q){if(1==q.g)return F(q,Promise.resolve(),2);if(!a.i||!a.j)return q.return();if(null==c||null==d)return a.i.parseInit(Tb(b)),q.return();f=a.B?c:a.s;g={periodStart:a.s,segmentStart:c,segmentEnd:d,vttOffset:f};h=a.i.parseMedia(Tb(b),g,e,[]);k=t(h);for(l=k.next();!l.done;l=k.next())m=l.value,a.A(m,e||null,g);n=h.filter(function(r){return r.startTime>=a.l&&r.startTime<a.m});a.j.append(n);null==a.g&&(a.g=Math.max(c,a.l));a.h=Math.min(d,a.m);G(q)})}
|
|
Pe.prototype.remove=function(a,b){var c=this;return Q(function(d){if(1==d.g)return F(d,Promise.resolve(),2);!c.j||!c.j.remove(a,b)||null==c.g||b<=c.g||a>=c.h||(a<=c.g&&b>=c.h?c.g=c.h=null:a<=c.g&&b<c.h?c.g=b:a>c.g&&b>=c.h&&(c.h=a));G(d)})};function Ve(a,b,c){a.l=b;a.m=c}function We(a,b,c){a.C=b;if(b=a.o.get(b))for(var d=t(b.keys()),e=d.next();!e.done;e=d.next())(e=b.get(e.value).filter(function(f){return f.endTime<=c}))&&a.j.append(e)}
|
|
function Xe(a,b,c){b.startTime+=c;b.endTime+=c;b=t(b.nestedCues);for(var d=b.next();!d.done;d=b.next())Xe(a,d.value,c)}
|
|
function Ye(a,b,c,d,e){var f=c+" "+d,g=new Map;b=t(b);for(var h=b.next();!h.done;h=b.next()){var k=h.value;h=k.stream;k=k.cue;g.has(h)||g.set(h,new Map);g.get(h).has(f)||g.get(h).set(f,[]);Xe(a,k,e);k.startTime>=a.l&&k.startTime<a.m&&(g.get(h).get(f).push(k),h==a.C&&a.j.append([k]))}e=t(g.keys());for(f=e.next();!f.done;f=e.next())for(f=f.value,a.o.has(f)||a.o.set(f,new Map),b=t(g.get(f).keys()),h=b.next();!h.done;h=b.next())h=h.value,k=g.get(f).get(h),a.o.get(f).set(h,k);a.g=null==a.g?Math.max(c,
|
|
a.l):Math.min(a.g,Math.max(c,a.l));a.h=Math.max(a.h,Math.min(d,a.m))}T("shaka.text.TextEngine",Pe);Pe.prototype.destroy=Pe.prototype.destroy;Pe.findParser=Se;Pe.unregisterParser=function(a){Re.delete(a)};Pe.registerParser=Qe;var Re=new Map;function Ze(a){this.h=a;this.g=null}Ze.prototype.ha=function(a){var b=this;this.stop();var c=!0,d=null;this.g=function(){window.clearTimeout(d);c=!1};d=window.setTimeout(function(){c&&b.h()},1E3*a);return this};Ze.prototype.stop=function(){this.g&&(this.g(),this.g=null)};function $e(a){this.h=a;this.g=null}$e.prototype.Hb=function(){this.stop();this.h();return this};$e.prototype.ha=function(a){var b=this;this.stop();this.g=(new Ze(function(){b.h()})).ha(a);return this};$e.prototype.Ga=function(a){var b=this;this.stop();this.g=(new Ze(function(){b.g.ha(a);b.h()})).ha(a);return this};$e.prototype.stop=function(){this.g&&(this.g.stop(),this.g=null)};T("shaka.util.Timer",$e);$e.prototype.stop=$e.prototype.stop;$e.prototype.tickEvery=$e.prototype.Ga;
|
|
$e.prototype.tickAfter=$e.prototype.ha;$e.prototype.tickNow=$e.prototype.Hb;function af(a,b){return a.concat(b)}function bf(){}function cf(a){return null!=a}function df(a,b){return Promise.race([b,new Promise(function(c,d){(new $e(d)).ha(a)})])};function ef(){}function ff(a,b){a=gf(a);b=gf(b);return a.split("-")[0]==b.split("-")[0]}function hf(a,b){a=gf(a);b=gf(b);a=a.split("-");b=b.split("-");return a[0]==b[0]&&1==a.length&&2==b.length}function jf(a,b){a=gf(a);b=gf(b);a=a.split("-");b=b.split("-");return 2==a.length&&2==b.length&&a[0]==b[0]}
|
|
function gf(a){a=t(a.split("-x-"));var b=a.next().value;b=void 0===b?"":b;a=a.next().value;a=void 0===a?"":a;var c=t(b.split("-"));b=c.next().value;b=void 0===b?"":b;c=c.next().value;c=void 0===c?"":c;a=a?"x-"+a:"";b=b.toLowerCase();b=kf.get(b)||b;c=c.toUpperCase();return(c?b+"-"+c:b)+(a?"-"+a:"")}function lf(a,b){a=gf(a);b=gf(b);return b==a?4:hf(b,a)?3:jf(b,a)?2:hf(a,b)?1:0}function mf(a){var b=a.indexOf("-");a=0<=b?a.substring(0,b):a;a=a.toLowerCase();return a=kf.get(a)||a}
|
|
function nf(a){return a.language?gf(a.language):a.audio&&a.audio.language?gf(a.audio.language):a.video&&a.video.language?gf(a.video.language):"und"}
|
|
function of(a,b){a=gf(a);var c=new Set;b=t(b);for(var d=b.next();!d.done;d=b.next())c.add(gf(d.value));b=t(c);for(d=b.next();!d.done;d=b.next())if(d=d.value,d==a)return d;b=t(c);for(d=b.next();!d.done;d=b.next())if(d=d.value,hf(d,a))return d;b=t(c);for(d=b.next();!d.done;d=b.next())if(d=d.value,jf(d,a))return d;c=t(c);for(b=c.next();!b.done;b=c.next())if(b=b.value,hf(a,b))return b;return null}T("shaka.util.LanguageUtils",ef);ef.findClosestLocale=of;ef.getLocaleForVariant=nf;
|
|
ef.getLocaleForText=function(a){return gf(a.language||"und")};ef.getBase=mf;ef.relatedness=lf;ef.areSiblings=function(a,b){var c=mf(a),d=mf(b);return a!=c&&b!=d&&c==d};ef.normalize=gf;ef.isSiblingOf=jf;ef.isParentOf=hf;ef.areLanguageCompatible=ff;ef.areLocaleCompatible=function(a,b){a=gf(a);b=gf(b);return a==b};
|
|
var kf=new Map([["aar","aa"],["abk","ab"],["afr","af"],["aka","ak"],["alb","sq"],["amh","am"],["ara","ar"],["arg","an"],["arm","hy"],["asm","as"],["ava","av"],["ave","ae"],["aym","ay"],["aze","az"],["bak","ba"],["bam","bm"],["baq","eu"],["bel","be"],["ben","bn"],["bih","bh"],["bis","bi"],["bod","bo"],["bos","bs"],["bre","br"],["bul","bg"],["bur","my"],["cat","ca"],["ces","cs"],["cha","ch"],["che","ce"],["chi","zh"],["chu","cu"],["chv","cv"],["cor","kw"],["cos","co"],["cre","cr"],["cym","cy"],["cze",
|
|
"cs"],["dan","da"],["deu","de"],["div","dv"],["dut","nl"],["dzo","dz"],["ell","el"],["eng","en"],["epo","eo"],["est","et"],["eus","eu"],["ewe","ee"],["fao","fo"],["fas","fa"],["fij","fj"],["fin","fi"],["fra","fr"],["fre","fr"],["fry","fy"],["ful","ff"],["geo","ka"],["ger","de"],["gla","gd"],["gle","ga"],["glg","gl"],["glv","gv"],["gre","el"],["grn","gn"],["guj","gu"],["hat","ht"],["hau","ha"],["heb","he"],["her","hz"],["hin","hi"],["hmo","ho"],["hrv","hr"],["hun","hu"],["hye","hy"],["ibo","ig"],["ice",
|
|
"is"],["ido","io"],["iii","ii"],["iku","iu"],["ile","ie"],["ina","ia"],["ind","id"],["ipk","ik"],["isl","is"],["ita","it"],["jav","jv"],["jpn","ja"],["kal","kl"],["kan","kn"],["kas","ks"],["kat","ka"],["kau","kr"],["kaz","kk"],["khm","km"],["kik","ki"],["kin","rw"],["kir","ky"],["kom","kv"],["kon","kg"],["kor","ko"],["kua","kj"],["kur","ku"],["lao","lo"],["lat","la"],["lav","lv"],["lim","li"],["lin","ln"],["lit","lt"],["ltz","lb"],["lub","lu"],["lug","lg"],["mac","mk"],["mah","mh"],["mal","ml"],["mao",
|
|
"mi"],["mar","mr"],["may","ms"],["mkd","mk"],["mlg","mg"],["mlt","mt"],["mon","mn"],["mri","mi"],["msa","ms"],["mya","my"],["nau","na"],["nav","nv"],["nbl","nr"],["nde","nd"],["ndo","ng"],["nep","ne"],["nld","nl"],["nno","nn"],["nob","nb"],["nor","no"],["nya","ny"],["oci","oc"],["oji","oj"],["ori","or"],["orm","om"],["oss","os"],["pan","pa"],["per","fa"],["pli","pi"],["pol","pl"],["por","pt"],["pus","ps"],["que","qu"],["roh","rm"],["ron","ro"],["rum","ro"],["run","rn"],["rus","ru"],["sag","sg"],["san",
|
|
"sa"],["sin","si"],["slk","sk"],["slo","sk"],["slv","sl"],["sme","se"],["smo","sm"],["sna","sn"],["snd","sd"],["som","so"],["sot","st"],["spa","es"],["sqi","sq"],["srd","sc"],["srp","sr"],["ssw","ss"],["sun","su"],["swa","sw"],["swe","sv"],["tah","ty"],["tam","ta"],["tat","tt"],["tel","te"],["tgk","tg"],["tgl","tl"],["tha","th"],["tib","bo"],["tir","ti"],["ton","to"],["tsn","tn"],["tso","ts"],["tuk","tk"],["tur","tr"],["twi","tw"],["uig","ug"],["ukr","uk"],["urd","ur"],["uzb","uz"],["ven","ve"],["vie",
|
|
"vi"],["vol","vo"],["wel","cy"],["wln","wa"],["wol","wo"],["xho","xh"],["yid","yi"],["yor","yo"],["zha","za"],["zho","zh"],["zul","zu"]]);function pf(){}
|
|
function qf(a,b,c,d,e){function f(y){var z=String(y.width||"")+String(y.height||"")+String(Math.round(y.frameRate||0))+(y.hdr||"")+y.fastSwitching;y.dependencyStream&&(z+=y.dependencyStream.baseOriginalId||"");return z}function g(y){var z=y.language+(y.channelsCount||0)+(y.audioSamplingRate||0)+y.roles.join(",")+y.label+y.groupId+y.fastSwitching;y.dependencyStream&&(z+=y.dependencyStream.baseOriginalId||"");return z}if(e.length){var h=a.textStreams;e=t(e);for(var k=e.next(),l={};!k.done;l={rh:void 0},
|
|
k=e.next())if(l.rh=k.value,k=h.filter(function(y){return function(z){return z.codecs.startsWith(y.rh)||z.mimeType.startsWith(y.rh)?!0:!1}}(l)),k.length){h=k;break}a.textStreams=h}h=a.variants;if(b.length||c.length)h=rf(h,b,c);if(d.length){b=new ib;c=t(h);for(h=c.next();!h.done;h=c.next())h=h.value,b.push(String(h.video.width||0),h);var m=[];b.forEach(function(y,z){y=0;var A=[];z=t(z);for(var B=z.next(),E={};!B.done;E={Lf:void 0},B=z.next())E.Lf=B.value,B=d.filter(function(H){return function(C){return H.Lf.decodingInfos[0][C]}}(E)).length,
|
|
B>y?(y=B,A=[E.Lf]):B==y&&A.push(E.Lf);m.push.apply(m,x(A))});h=m}c=new Set;b=new Set;h=t(h);for(e=h.next();!e.done;e=h.next())e=e.value,e.audio&&c.add(e.audio),e.video&&b.add(e.video);h=Array.from(c).sort(function(y,z){return y.bandwidth-z.bandwidth});var n=[];c=new Map;h=t(h);for(e=h.next();!e.done;e=h.next()){e=e.value;k=g(e);l=c.get(k)||[];if(l.length){var q=l[l.length-1],r=Ie(q.codecs),u=Ie(e.codecs);r!=u||e.bandwidth&&q.bandwidth&&!(e.bandwidth>q.bandwidth)||(l.push(e),n.push(e.id))}else l.push(e),
|
|
n.push(e.id);c.set(k,l)}var w={vp8:1,avc:1,"dovi-avc":.95,vp9:.9,vp09:.9,hevc:.85,"dovi-hevc":.8,"dovi-p5":.75,av01:.7,"dovi-av1":.65,vvc:.6};h=Array.from(b).sort(function(y,z){if(!y.bandwidth||!z.bandwidth||y.bandwidth==z.bandwidth){if(y.codecs&&z.codecs&&y.codecs!=z.codecs&&y.width==z.width){var A=Ie(y.codecs),B=Ie(z.codecs);if(A!=B)return(w[A]||1)-(w[B]||1)}return y.width-z.width}return y.bandwidth-z.bandwidth});b=Gc();var v=[];c=new Map;h=t(h);for(e=h.next();!e.done;e=h.next()){e=e.value;k=f(e);
|
|
l=c.get(k)||[];if(l.length){q=l[l.length-1];if(!b&&(r=Ie(q.codecs),u=Ie(e.codecs),r!==u))continue;r=Ie(q.codecs);u=Ie(e.codecs);r!=u||e.bandwidth&&q.bandwidth&&!(e.bandwidth>q.bandwidth)||(l.push(e),v.push(e.id))}else l.push(e),v.push(e.id);c.set(k,l)}a.variants=a.variants.filter(function(y){var z=y.audio;y=y.video;return z&&!n.includes(z.id)||y&&!v.includes(y.id)?!1:!0})}
|
|
function rf(a,b,c){b=t(b);for(var d=b.next(),e={};!d.done;e={videoCodec:void 0},d=b.next())if(e.videoCodec=d.value,d=a.filter(function(f){return function(g){return g.video&&g.video.codecs.startsWith(f.videoCodec)}}(e)),d.length){a=d;break}c=t(c);b=c.next();for(d={};!b.done;d={audioCodec:void 0},b=c.next())if(d.audioCodec=b.value,b=a.filter(function(f){return function(g){return g.audio&&g.audio.codecs.startsWith(f.audioCodec)}}(d)),b.length){a=b;break}return a}
|
|
function sf(a,b,c){a.variants=a.variants.filter(function(d){return tf(d,b,c)})}
|
|
function tf(a,b,c){function d(h,k,l){return h>=k&&h<=l}var e=a.video;if(e&&e.width&&e.height){var f=e.width,g=e.height;g>f&&(g=t([g,f]),f=g.next().value,g=g.next().value);if(!d(f,b.minWidth,Math.min(b.maxWidth,c.width))||!d(g,b.minHeight,Math.min(b.maxHeight,c.height))||!d(e.width*e.height,b.minPixels,b.maxPixels))return!1}return a&&a.video&&a.video.frameRate&&!d(a.video.frameRate,b.minFrameRate,b.maxFrameRate)||a&&a.audio&&a.audio.channelsCount&&!d(a.audio.channelsCount,b.minChannelsCount,b.maxChannelsCount)||
|
|
!d(a.bandwidth,b.minBandwidth,b.maxBandwidth)?!1:!0}function uf(a,b,c,d){c=void 0===c?[]:c;d=void 0===d?{}:d;return Q(function(e){if(1==e.g)return F(e,vf(a,b,0<b.offlineSessionIds.length,c,d),2);wf(b);return F(e,xf(b),0)})}
|
|
function vf(a,b,c,d,e){var f,g;return Q(function(h){if(1==h.g)return qb().Mi()&&yf(b.variants),F(h,zf(b.variants,c,!1,d),2);f=null;a&&(g=a.h)&&(f=g.keySystem);b.variants=b.variants.filter(function(k){var l=Af(k,f,e);if(!l){var m=[];k.audio&&m.push(Bf(k.audio));k.video&&m.push(Bf(k.video))}return l});G(h)})}
|
|
function yf(a){var b=(new Map).set("dvav","avc3").set("dva1","avc1").set("dvhe","hev1").set("dvh1","hvc1").set("dvc1","vvc1").set("dvi1","vvi1"),c=new Set;a=t(a);for(var d=a.next();!d.done;d=a.next())d=d.value,d.video&&c.add(d.video);c=t(c);for(a=c.next();!a.done;a=c.next()){a=a.value;d=t(b);for(var e=d.next();!e.done;e=d.next()){var f=t(e.value);e=f.next().value;f=f.next().value;if(a.codecs.includes(e)){a.codecs=a.codecs.replace(e,f);break}}}}
|
|
function Af(a,b,c){if(!a.decodingInfos.some(function(k){return!k.supported||b&&(k=k.keySystemAccess)&&(c[k.keySystem]||k.keySystem)!=b?!1:!0}))return!1;var d=qb(),e="Xbox"===d.Mb();d="MOBILE"===d.La()&&"GECKO"===d.Ea();var f=a.video,g=f&&f.width||0,h=f&&f.height||0;if(e&&f&&(1920<g||1080<h)&&(f.codecs.includes("avc1.")||f.codecs.includes("avc3."))||(e=f&&f.dependencyStream)&&!Dc(e))return!1;a=a.audio;return d&&a&&a.encrypted&&a.codecs.toLowerCase().includes("opus")||a&&a.dependencyStream?!1:!0}
|
|
function Cf(a,b){var c,d,e,f,g,h,k;return Q(function(l){if(1==l.g){c=function(m,n){if(m){var q=fd(m);q.supported=m.supported&&n.supported;q.powerEfficient=m.powerEfficient&&n.powerEfficient;q.smooth=m.smooth&&n.smooth;n.keySystemAccess&&!q.keySystemAccess&&(q.keySystemAccess=n.keySystemAccess);return q}return n};d=null;e=[];f=t(b);g=f.next();for(h={};!g.done;h={cache:void 0,Je:void 0},g=f.next())k=g.value,h.Je=gd(k),h.cache=Df,h.cache.has(h.Je)?d=c(d,h.cache.get(h.Je)):e.push(Ef(k).then(function(m){return function(n){var q=
|
|
null;n=t(n||[]);for(var r=n.next();!r.done;r=n.next())q=c(q,r.value);q&&(m.cache.set(m.Je,q),d=c(d,q))}}(h)));return F(l,Promise.all(e),2)}d&&a.decodingInfos.push(d);G(l)})}
|
|
function Ef(a){var b=[""];a.video&&(b=Me(a.video.contentType).split(","));var c=[""];a.audio&&(c=Me(a.audio.contentType).split(","));var d=[];b=t(b);for(var e=b.next();!e.done;e=b.next()){e=e.value;for(var f=t(c),g=f.next(),h={};!g.done;h={Hc:void 0},g=f.next())g=g.value,h.Hc=ed(a),a.video&&(h.Hc.video.contentType=De(Le(h.Hc.video.contentType),e)),a.audio&&(h.Hc.audio.contentType=De(Le(h.Hc.audio.contentType),g)),d.push(new Promise(function(k){return function(l,m){("MOBILE"==qb().La()?df(5,navigator.mediaCapabilities.decodingInfo(k.Hc)):
|
|
navigator.mediaCapabilities.decodingInfo(k.Hc)).then(function(n){l(n)}).catch(m)}}(h)))}return Promise.all(d).catch(function(){JSON.stringify(a);return null})}
|
|
function zf(a,b,c,d){var e,f,g,h,k,l,m,n,q,r,u,w,v,y,z,A,B,E,H;return Q(function(C){switch(C.g){case 1:if(e=a.some(function(D){return D.decodingInfos.length}))return C.return();f=t(d);g=f.next();h={};case 2:if(g.done){C.u(4);break}h.ri=g.value;k=!1;l=t(a);m=l.next();case 5:if(m.done){C.u(7);break}n=m.value;q=Ff(n,b,c).filter(function(D){return function(I){I=I[0];return(I.keySystemConfiguration&&I.keySystemConfiguration.keySystem)===D.ri}}(h));r=t(q);u=r.next();case 8:if(u.done){C.u(10);break}w=u.value;
|
|
return F(C,Cf(n,w),9);case 9:u=r.next();C.u(8);break;case 10:n.decodingInfos.length&&(k=!0);m=l.next();C.u(5);break;case 7:if(k)return C.return();h={ri:void 0};g=f.next();C.u(2);break;case 4:v=t(a),y=v.next();case 12:if(y.done){C.u(0);break}z=y.value;A=Ff(z,b,c).filter(function(D){D=D[0];D=D.keySystemConfiguration&&D.keySystemConfiguration.keySystem;return!D||!d.includes(D)});B=t(A);E=B.next();case 15:if(E.done){y=v.next();C.u(12);break}H=E.value;return F(C,Cf(z,H),16);case 16:E=B.next(),C.u(15)}})}
|
|
function Ff(a,b,c){var d=a.audio,e=a.video,f=[],g=[];if(e)for(var h=t(e.fullMimeTypes),k=h.next();!k.done;k=h.next()){k=k.value;var l=Me(k);if(l.includes(",")&&!d){var m=l.split(","),n=Le(k);l=tc("video",m);m=tc("audio",m);m=Gf(m,n);n=Ge(n,m,"audio");g.push({contentType:n,channels:2,bitrate:a.bandwidth||1,samplerate:1,spatialRendering:!1})}l=Hf(l);k={contentType:Ge(Le(k),l,"video"),width:e.width||64,height:e.height||64,bitrate:e.bandwidth||a.bandwidth||1,framerate:e.frameRate||1};if(e.hdr)switch(e.hdr){case "SDR":k.transferFunction=
|
|
"srgb";break;case "PQ":k.transferFunction="pq";break;case "HLG":k.transferFunction="hlg"}e.colorGamut&&(k.colorGamut=e.colorGamut);f.push(k)}if(d)for(h=t(d.fullMimeTypes),k=h.next();!k.done;k=h.next())l=k.value,k=Le(l),l=Gf(Me(l),k),k=Ge(k,l,"audio"),g.push({contentType:k,channels:d.channelsCount||2,bitrate:d.bandwidth||a.bandwidth||1,samplerate:d.audioSamplingRate||1,spatialRendering:d.spatialAudio});h=[];0==f.length&&f.push(null);0==g.length&&g.push(null);f=t(f);for(k=f.next();!k.done;k=f.next())for(k=
|
|
k.value,l=t(g),n=l.next();!n.done;n=l.next())n=n.value,m={type:c?"file":"media-source"},k&&(m.video=k),n&&(m.audio=n),h.push(m);g=(a.video?a.video.drmInfos:[]).concat(a.audio?a.audio.drmInfos:[]);if(!g.length)return[h];a=[];c=new Map;g=t(g);for(f=g.next();!f.done;f=g.next())f=f.value,c.get(f.keySystem)||c.set(f.keySystem,[]),c.get(f.keySystem).push(f);g=b?"required":"optional";b=b?["persistent-license"]:["temporary"];f=t(c.keys());for(k=f.next();!k.done;k=f.next()){k=k.value;n=c.get(k);l=new Map;
|
|
n=t(n);for(m=n.next();!m.done;m=n.next()){m=m.value;var q=m.videoRobustness+","+m.audioRobustness;l.get(q)||l.set(q,[]);l.get(q).push(m)}l=t(l.values());for(n=l.next();!n.done;n=l.next()){n=n.value;m=[];q=t(h);for(var r=q.next();!r.done;r=q.next()){r=Object.assign({},r.value);for(var u={keySystem:k,initDataType:"cenc",persistentState:g,distinctiveIdentifier:"optional",sessionTypes:b},w=t(n),v=w.next();!v.done;v=w.next()){v=v.value;if(v.initData&&v.initData.length){for(var y=new Set,z=t(v.initData),
|
|
A=z.next();!A.done;A=z.next())y.add(A.value.initDataType);u.initDataType=v.initData[0].initDataType}v.distinctiveIdentifierRequired&&(u.distinctiveIdentifier="required");v.persistentStateRequired&&(u.persistentState="required");v.sessionType&&(u.sessionTypes=[v.sessionType]);d&&(u.audio?(v.encryptionScheme&&(u.audio.encryptionScheme=u.audio.encryptionScheme||v.encryptionScheme),u.audio.robustness=u.audio.robustness||v.audioRobustness):(u.audio={robustness:v.audioRobustness},v.encryptionScheme&&(u.audio.encryptionScheme=
|
|
v.encryptionScheme)),""==u.audio.robustness&&delete u.audio.robustness);e&&(u.video?(v.encryptionScheme&&(u.video.encryptionScheme=u.video.encryptionScheme||v.encryptionScheme),u.video.robustness=u.video.robustness||v.videoRobustness):(u.video={robustness:v.videoRobustness},v.encryptionScheme&&(u.video.encryptionScheme=v.encryptionScheme)),""==u.video.robustness&&delete u.video.robustness)}r.keySystemConfiguration=u;m.push(r)}a.push(m)}}return a}
|
|
function Gf(a,b){var c=qb();return"flac"==a.toLowerCase()?"WEBKIT"!=c.Ea()?"flac":"fLaC":"opus"===a.toLowerCase()?"WEBKIT"!=c.Ea()?"opus":"mp4"==He(b)?"Opus":"opus":"ac-3"==a.toLowerCase()&&c.ae()?"ec-3":a}function Hf(a){if(a.includes("avc1")){var b=a.split(".");if(3==b.length)return a=b.shift()+".",a+=parseInt(b.shift(),10).toString(16),a+=("000"+parseInt(b.shift(),10).toString(16)).slice(-4)}else if("vp9"==a)return"vp09.00.41.08";return a}
|
|
function wf(a){a.textStreams=a.textStreams.filter(function(b){b=De(b.mimeType,b.codecs);return Te(b)})}
|
|
function xf(a){var b,c,d,e,f,g,h,k;return Q(function(l){switch(l.g){case 1:b=[],c=t(a.imageStreams),d=c.next();case 2:if(d.done){l.u(4);break}e=d.value;f=e.mimeType;"application/mp4"==f&&"mjpg"==e.codecs&&(f="image/jpg");if(If.has(f)){l.u(5);break}g=Jf.get(f);if(!g){If.set(f,!1);l.u(5);break}return F(l,Kf(g),7);case 7:h=l.h,If.set(f,h);case 5:(k=If.get(f))&&b.push(e);d=c.next();l.u(2);break;case 4:a.imageStreams=b,G(l)}})}
|
|
function Kf(a){return new Promise(function(b){var c=new Image;c.src=a;"decode"in c?c.decode().then(function(){b(!0)}).catch(function(){b(!1)}):c.onload=c.onerror=function(){b(2===c.height)}})}
|
|
function Lf(a){var b=a.audio,c=a.video,d=b?b.mimeType:null,e=c?c.mimeType:null,f=b?b.codecs:null,g=c?c.codecs:null,h=b?b.groupId:null,k=[];c&&k.push(c.mimeType);b&&k.push(b.mimeType);k=k[0]||null;var l=[];b&&l.push(b.kind);c&&l.push(c.kind);l=l[0]||null;var m=new Set;if(b)for(var n=t(b.roles),q=n.next();!q.done;q=n.next())m.add(q.value);if(c)for(n=t(c.roles),q=n.next();!q.done;q=n.next())m.add(q.value);a={id:a.id,active:!1,type:"variant",bandwidth:a.bandwidth,language:a.language,label:null,kind:l,
|
|
width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,colorGamut:null,videoLayout:null,mimeType:k,audioMimeType:d,videoMimeType:e,codecs:"",audioCodec:f,videoCodec:g,primary:a.primary,roles:Array.from(m),audioRoles:null,forced:!1,videoId:null,audioId:null,audioGroupId:h,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null,originalImageId:null,accessibilityPurpose:null,
|
|
originalLanguage:null};if(c){a.videoId=c.id;a.originalVideoId=c.originalId;a.width=c.width||null;a.height=c.height||null;a.frameRate=c.frameRate||null;a.pixelAspectRatio=c.pixelAspectRatio||null;a.videoBandwidth=c.bandwidth||null;a.hdr=c.hdr||null;a.colorGamut=c.colorGamut||null;a.videoLayout=c.videoLayout||null;if(d=c.dependencyStream)a.width=d.width||a.width,a.height=d.height||a.height,a.videoCodec=d.codecs||a.videoCodec;if(g.includes(",")){a.channelsCount=c.channelsCount;a.audioSamplingRate=c.audioSamplingRate;
|
|
a.spatialAudio=c.spatialAudio;a.originalLanguage=c.originalLanguage;a.audioMimeType=e;c=g.split(",");try{a.videoCodec=tc("video",c),a.audioCodec=tc("audio",c)}catch(r){}}}b&&(a.audioId=b.id,a.originalAudioId=b.originalId,a.channelsCount=b.channelsCount,a.audioSamplingRate=b.audioSamplingRate,a.audioBandwidth=b.bandwidth||null,a.spatialAudio=b.spatialAudio,a.label=b.label,a.audioRoles=b.roles,a.accessibilityPurpose=b.accessibilityPurpose,a.originalLanguage=b.originalLanguage,b=b.dependencyStream)&&
|
|
(a.audioCodec=b.codecs||a.audioCodec);b=[];a.videoCodec&&b.push(a.videoCodec);a.audioCodec&&b.push(a.audioCodec);a.codecs=b.join(", ");return a}function Of(a){return{id:a.id,active:!1,type:wc,bandwidth:a.bandwidth||0,language:a.language,label:a.label,kind:a.kind||null,mimeType:a.mimeType,codecs:a.codecs||null,primary:a.primary,roles:a.roles,accessibilityPurpose:a.accessibilityPurpose,forced:a.forced,originalTextId:a.originalId,originalLanguage:a.originalLanguage}}
|
|
function Pf(a){var b=a.width||null,c=a.height||null,d=null;a.segmentIndex&&(d=Qf(a.segmentIndex));var e=a.tilesLayout;d&&(e=d.tilesLayout||e);e&&null!=b&&(b/=Number(e.split("x")[0]));e&&null!=c&&(c/=Number(e.split("x")[1]));return{id:a.id,type:"image",bandwidth:a.bandwidth||0,width:b,height:c,mimeType:a.mimeType,codecs:a.codecs||null,tilesLayout:e||null,originalImageId:a.originalId}}function Rf(a){a.__shaka_id||(a.__shaka_id=Sf++);return a.__shaka_id}
|
|
function Xf(a){var b={id:Rf(a),active:"disabled"!=a.mode,type:wc,bandwidth:0,language:gf(a.language||"und"),label:a.label,kind:a.kind,mimeType:null,codecs:null,primary:!1,roles:[],accessibilityPurpose:null,forced:"forced"==a.kind,originalTextId:a.id,originalLanguage:a.language};"captions"==a.kind&&(b.mimeType="unknown");"subtitles"==a.kind&&(b.mimeType="text/vtt");a.kind&&(b.roles=[a.kind]);return b}
|
|
function Yf(a,b){var c=a?a.language:null;c={id:Rf(a||b),active:a?a.enabled:b.selected,type:"variant",bandwidth:0,language:gf(c||"und"),label:a?a.label:null,kind:a?a.kind:null,width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,colorGamut:null,videoLayout:null,mimeType:null,audioMimeType:null,videoMimeType:null,codecs:null,audioCodec:null,videoCodec:null,primary:a?"main"==a.kind:!1,roles:[],forced:!1,audioRoles:null,videoId:null,audioId:null,audioGroupId:null,channelsCount:null,audioSamplingRate:null,
|
|
spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:b?b.id:null,originalAudioId:a?a.id:null,originalTextId:null,originalImageId:null,accessibilityPurpose:null,originalLanguage:c};a&&a.kind&&(c.roles=[a.kind],c.audioRoles=[a.kind]);a&&a.configuration&&(a.configuration.codec&&(c.audioCodec=a.configuration.codec,c.codecs=c.audioCodec),a.configuration.bitrate&&(c.audioBandwidth=a.configuration.bitrate,c.bandwidth+=c.audioBandwidth),a.configuration.sampleRate&&(c.audioSamplingRate=
|
|
a.configuration.sampleRate),a.configuration.numberOfChannels&&(c.channelsCount=a.configuration.numberOfChannels));if(b&&b.configuration&&(b.configuration.codec&&(c.videoCodec=b.configuration.codec,c.codecs=c.codecs?c.codecs+(","+c.videoCodec):c.videoCodec),b.configuration.bitrate&&(c.videoBandwidth=b.configuration.bitrate,c.bandwidth+=c.videoBandwidth),b.configuration.framerate&&(c.frameRate=b.configuration.framerate),b.configuration.width&&(c.width=b.configuration.width),b.configuration.height&&
|
|
(c.height=b.configuration.height),b.configuration.colorSpace&&b.configuration.colorSpace.transfer))switch(b.configuration.colorSpace.transfer){case "pq":c.hdr="PQ";break;case "hlg":c.hdr="HLG";break;case "bt709":c.hdr="SDR"}return c}function Zf(a){return a.allowedByApplication&&a.allowedByKeySystem&&0==a.disabledUntilTime}function $f(a){return a.filter(function(b){return Zf(b)})}
|
|
function ag(a,b,c,d){var e=a,f=a.filter(function(k){return k.primary});f.length&&(e=f);var g=e.length?e[0].language:"";e=e.filter(function(k){return k.language==g});if(b){var h=of(gf(b),a.map(function(k){return k.language}));h&&(e=a.filter(function(k){return gf(k.language)==h}))}e=e.filter(function(k){return k.forced==d});if(c){if(a=bg(e,c),a.length)return a}else if(a=e.filter(function(k){return 0==k.roles.length}),a.length)return a;a=e.map(function(k){return k.roles}).reduce(af,[]);return a.length?
|
|
bg(e,a[0]):e}function bg(a,b){return a.filter(function(c){return c.roles.includes(b)})}function cg(a,b){b.length&&(b=b.filter(function(c){return Ie(a.codecs)==Ie(c.codecs)}).sort(function(c,d){return c.bandwidth&&d.bandwidth&&c.bandwidth!=d.bandwidth?c.bandwidth-d.bandwidth:(c.width||0)-(d.width||0)}),a.trickModeVideo=b[0],1<b.length&&(b=b.find(function(c){return a.width==c.width&&a.height==c.height})))&&(a.trickModeVideo=b)}
|
|
function Bf(a){return"audio"==a.type?"type=audio codecs="+a.codecs+" bandwidth="+a.bandwidth+" channelsCount="+a.channelsCount+" audioSamplingRate="+a.audioSamplingRate:"video"==a.type?"type=video codecs="+a.codecs+" bandwidth="+a.bandwidth+" frameRate="+a.frameRate+" width="+a.width+" height="+a.height:"unexpected stream type"}
|
|
function dg(a,b,c){if(0==c.autoShowText)return!1;if(1==c.autoShowText)return!0;var d=gf(c.preferredTextLanguage);b=gf(b.language);if(2==c.autoShowText)return ff(b,d);if(3==c.autoShowText){if(!a)return!1;a=gf(a.language);return ff(b,d)&&!ff(a,b)}bb("Invalid autoShowText setting!");return!1}T("shaka.util.StreamUtils",pf);pf.meetsRestrictions=tf;
|
|
var Df=new Map,Sf=0,If=(new Map).set("image/svg+xml",!0).set("image/png",!0).set("image/jpeg",!0).set("image/jpg",!0),Jf=(new Map).set("image/webp","data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA").set("image/avif","data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=");function eg(){var a=this;this.G=null;this.o=!1;this.m=new Xa;this.j=new jb;navigator.connection&&navigator.connection.addEventListener&&this.j.D(navigator.connection,"change",function(){if(a.o&&a.g.useNetworkInformation){a.m=new Xa;a.g&&a.m.configure(a.g.advanced);var b=a.chooseVariant();b&&navigator.onLine&&a.G(b,a.g.clearBufferSwitch,a.g.safeMarginSwitch)}});this.F=[];this.H=1;this.I=!1;this.h=this.l=this.g=this.s=null;this.A=new $e(function(){if(a.o&&(a.g.restrictToElementSize||a.g.restrictToScreenSize)){var b=
|
|
a.chooseVariant();b&&a.G(b,a.g.clearBufferSwitch,a.g.safeMarginSwitch)}});this.B=window;"documentPictureInPicture"in window&&this.j.D(window.documentPictureInPicture,"enter",function(){a.B=window.documentPictureInPicture.window;a.A&&a.A.Hb();a.j.za(a.B,"pagehide",function(){a.B=window;a.A&&a.A.Hb()})});this.C=this.i=null}p=eg.prototype;p.stop=function(){this.G=null;this.o=!1;this.F=[];this.H=1;this.l=this.s=null;this.h&&(this.h.disconnect(),this.h=null);this.A.stop();this.C=this.i=null};
|
|
p.release=function(){this.j.release();this.A=null};p.init=function(a){this.G=a};
|
|
p.chooseVariant=function(){var a=Infinity,b=Infinity;if(this.g.restrictToScreenSize){var c=this.g.ignoreDevicePixelRatio?1:this.B.devicePixelRatio;a=this.B.screen.height*c;b=this.B.screen.width*c}if(this.h&&this.g.restrictToElementSize){c=this.g.ignoreDevicePixelRatio?1:this.B.devicePixelRatio;var d=this.l.clientHeight,e=this.l.clientWidth;this.i&&document.pictureInPictureElement&&document.pictureInPictureElement==this.l&&(d=this.i.height,e=this.i.width);a=Math.min(a,d*c);b=Math.min(b,e*c)}c=this.F.filter(function(l){return l&&
|
|
!(l.audio&&l.audio.fastSwitching||l.video&&l.video.fastSwitching)});c.length||(c=this.F);d=c;c.length!=this.F.length&&(d=this.F.filter(function(l){return l&&(l.audio&&l.audio.fastSwitching||l.video&&l.video.fastSwitching?!0:!1)}));c=fg(this,this.g.restrictions,d,Infinity,Infinity);if(Infinity!=a||Infinity!=b){c=gg(c);c=t(c);for(e=c.next();!e.done;e=c.next())if(e=e.value,e.height>=a&&e.width>=b){a=e.height;b=e.width;break}c=fg(this,this.g.restrictions,d,a,b)}a=this.getBandwidthEstimate();d.length&&
|
|
!c.length&&(c=fg(this,null,d,Infinity,Infinity),c=[c[0]]);b=c[0]||null;for(d=0;d<c.length;d++){e=c[d];for(var f=isNaN(this.H)?1:Math.abs(this.H),g=f*e.bandwidth/this.g.bandwidthDowngradeTarget,h={bandwidth:Infinity},k=d+1;k<c.length;k++)if(e.bandwidth!=c[k].bandwidth){h=c[k];break}f=f*h.bandwidth/this.g.bandwidthUpgradeTarget;a>=g&&a<=f&&(b.bandwidth!=e.bandwidth||b.bandwidth==e.bandwidth&&b.video&&e.video&&(b.video.width<e.video.width||b.video.height<e.video.height))&&(b=e)}this.s=Date.now();return b};
|
|
p.enable=function(){this.o=!0};p.disable=function(){this.o=!1};p.segmentDownloaded=function(a,b,c,d){var e=a;this.g.removeLatencyFromFirstPacketTime&&d&&1===d.packetNumber&&d.timeToFirstByte&&(e=a-d.timeToFirstByte);e<this.g.cacheLoadThreshold||(this.m.sample(e,b),c&&null!=this.s&&this.o&&hg(this))};p.trySuggestStreams=function(){null!=this.s&&this.o&&hg(this)};
|
|
p.getBandwidthEstimate=function(){var a=this.g.defaultBandwidthEstimate;navigator.connection&&navigator.connection.downlink&&this.g.useNetworkInformation&&(a=1E6*navigator.connection.downlink);if(navigator.connection&&navigator.connection.downlink&&this.g.useNetworkInformation&&this.g.preferNetworkInformationBandwidth)return a;a=this.m.getBandwidthEstimate(a);return this.C?this.C.getBandwidthEstimate(a):a};p.setVariants=function(a){this.F=a};p.playbackRateChanged=function(a){this.H=a};
|
|
p.setMediaElement=function(a){function b(){c.A.ha(ig)}var c=this;this.l=a;this.h&&(this.h.disconnect(),this.h=null);this.l&&"ResizeObserver"in window&&(this.h=new ResizeObserver(b),this.h.observe(this.l));this.j.D(a,"enterpictureinpicture",function(d){d.pictureInPictureWindow&&(c.i=d.pictureInPictureWindow,c.j.D(c.i,"resize",b))});this.j.D(a,"leavepictureinpicture",function(){c.i&&c.j.Ja(c.i,"resize",b);c.i=null})};p.setCmsdManager=function(a){this.C=a};
|
|
p.configure=function(a){this.g=a;this.m&&this.g&&this.m.configure(this.g.advanced)};function hg(a){if(!a.I){var b=a.m;if(!(b.g>=b.i))return;a.I=!0;a.s-=1E3*(a.g.switchInterval-a.g.minTimeToSwitch)}Date.now()-a.s<1E3*a.g.switchInterval||(b=a.chooseVariant(),a.getBandwidthEstimate(),b&&a.G(b,a.g.clearBufferSwitch,a.g.safeMarginSwitch))}
|
|
function fg(a,b,c,d,e){if(a.C){var f=a.C.Uh();f&&(c=c.filter(function(g){return g.bandwidth&&f?g.bandwidth<=f:!0}))}b&&(c=c.filter(function(g){return tf(g,b,{width:e,height:d})}));return c.sort(function(g,h){return g.bandwidth-h.bandwidth})}function gg(a){var b=[];a=t(a);for(var c=a.next();!c.done;c=a.next())(c=c.value.video)&&c.height&&c.width&&b.push({height:c.height,width:c.width});return b.sort(function(d,e){return d.width-e.width})}T("shaka.abr.SimpleAbrManager",eg);eg.prototype.configure=eg.prototype.configure;
|
|
eg.prototype.setCmsdManager=eg.prototype.setCmsdManager;eg.prototype.setMediaElement=eg.prototype.setMediaElement;eg.prototype.playbackRateChanged=eg.prototype.playbackRateChanged;eg.prototype.setVariants=eg.prototype.setVariants;eg.prototype.getBandwidthEstimate=eg.prototype.getBandwidthEstimate;eg.prototype.trySuggestStreams=eg.prototype.trySuggestStreams;eg.prototype.segmentDownloaded=eg.prototype.segmentDownloaded;eg.prototype.disable=eg.prototype.disable;eg.prototype.enable=eg.prototype.enable;
|
|
eg.prototype.chooseVariant=eg.prototype.chooseVariant;eg.prototype.init=eg.prototype.init;eg.prototype.release=eg.prototype.release;eg.prototype.stop=eg.prototype.stop;var ig=1;T("shaka.config.CrossBoundaryStrategy",{KEEP:"keep",RESET:"reset",RESET_TO_ENCRYPTED:"reset_to_encrypted",RESET_ON_ENCRYPTION_CHANGE:"RESET_ON_ENCRYPTION_CHANGE"});function jg(a,b){if(a===b||!a.length||!b.length)return!0;a=t(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;if(kg(c))return!0;for(var d=t(b),e=d.next();!e.done;e=d.next())if(e=e.value,c.keySystem===e.keySystem||kg(e))return!0}return!1}
|
|
function lg(a,b){if(!a.length)return b;if(!b.length)return a;var c=[];a=t(a);for(var d=a.next();!d.done;d=a.next()){d=d.value;for(var e=t(b),f=e.next();!f.done;f=e.next())if(f=f.value,d.keySystem==f.keySystem){e=new Map;for(var g=t((d.initData||[]).concat(f.initData||[])),h=g.next();!h.done;h=g.next())h=h.value,e.set(h.keyId,h);e=Array.from(e.values());g=d.keyIds&&f.keyIds?new Set([].concat(x(d.keyIds),x(f.keyIds))):d.keyIds||f.keyIds;c.push({keySystem:d.keySystem,licenseServerUri:d.licenseServerUri||
|
|
f.licenseServerUri,distinctiveIdentifierRequired:d.distinctiveIdentifierRequired||f.distinctiveIdentifierRequired,persistentStateRequired:d.persistentStateRequired||f.persistentStateRequired,videoRobustness:d.videoRobustness||f.videoRobustness,audioRobustness:d.audioRobustness||f.audioRobustness,serverCertificate:d.serverCertificate||f.serverCertificate,serverCertificateUri:d.serverCertificateUri||f.serverCertificateUri,initData:e,keyIds:g});break}else kg(d)?c.push(d):kg(f)&&c.push(f)}return c}
|
|
function mg(a){return a?!!a.match(/^com\.(microsoft|chromecast)\.playready/):!1}function ng(a){return a?!!a.match(/^com\.apple\.fps/):!1}function kg(a){return(a=a.licenseServerUri)?a.startsWith("data:application/json;base64,"):!1}var og=new pb(function(){return Ub(new Uint8Array([0]))}),pg=new Map;function qg(a,b){var c=rg();this.l=null==a.maxAttempts?c.maxAttempts:a.maxAttempts;this.j=null==a.baseDelay?c.baseDelay:a.baseDelay;this.o=null==a.fuzzFactor?c.fuzzFactor:a.fuzzFactor;this.m=null==a.backoffFactor?c.backoffFactor:a.backoffFactor;this.g=0;this.h=this.j;if(this.i=void 0===b?!1:b)this.g=1}
|
|
function sg(a){var b,c;return Q(function(d){if(1==d.g){if(a.g>=a.l)if(a.i)a.g=1,a.h=a.j;else throw new U(2,7,1010);b=a.g;a.g++;if(0==b)return d.return();c=a.h*(1+(2*Math.random()-1)*a.o);return F(d,new Promise(function(e){(new $e(e)).ha(c/1E3)}),2)}a.h*=a.m;G(d)})}function rg(){return{maxAttempts:2,baseDelay:1E3,backoffFactor:2,fuzzFactor:.5,timeout:3E4,stallTimeout:5E3,connectionTimeout:1E4}};function tg(){var a,b,c=new Promise(function(d,e){a=d;b=e});c.resolve=a;c.reject=b;return c}tg.prototype.resolve=function(){};tg.prototype.reject=function(){};function ug(a,b){this.promise=a;this.i=b;this.g=null}function vg(a){return new ug(Promise.reject(a),function(){return Promise.resolve()})}function wg(){var a=Promise.reject(new U(2,7,7001));a.catch(function(){});return new ug(a,function(){return Promise.resolve()})}function xg(a){return new ug(Promise.resolve(a),function(){return Promise.resolve()})}function yg(a){return new ug(a,function(){return a.catch(function(){})})}ug.prototype.abort=function(){this.g||(this.g=this.i());return this.g};
|
|
function zg(a){return new ug(Promise.all(a.map(function(b){return b.promise})),function(){return Promise.all(a.map(function(b){return b.abort()}))})}ug.prototype.finally=function(a){this.promise.then(function(){return a(!0)},function(){return a(!1)});return this};
|
|
ug.prototype.Va=function(a,b){function c(h){return function(k){if(e.g&&h)f.reject(g);else{var l=h?a:b;l?d=Ag(l,k,f):(h?f.resolve:f.reject)(k)}}}function d(){f.reject(g);return e.abort()}var e=this,f=new tg;f.catch(function(){});var g=new U(2,7,7001);this.promise.then(c(!0),c(!1));return new ug(f,function(){return d()})};
|
|
function Ag(a,b,c){try{var d=a(b);if(d&&d.promise&&d.abort)return c.resolve(d.promise),function(){return d.abort()};c.resolve(d);return function(){return Promise.resolve(d).then(function(){},function(){})}}catch(e){return c.reject(e),function(){return Promise.resolve()}}}fa.Object.defineProperties(ug.prototype,{aborted:{configurable:!0,enumerable:!0,get:function(){return null!==this.g}}});T("shaka.util.AbortableOperation",ug);ug.prototype.chain=ug.prototype.Va;ug.prototype["finally"]=ug.prototype.finally;
|
|
ug.all=zg;ug.prototype.abort=ug.prototype.abort;ug.notAbortable=yg;ug.completed=xg;ug.aborted=wg;ug.failed=vg;function V(a,b){if(b)if(b instanceof Map)for(var c=t(b.keys()),d=c.next();!d.done;d=c.next())d=d.value,Object.defineProperty(this,d,{value:b.get(d),writable:!0,enumerable:!0});else for(c in b)Object.defineProperty(this,c,{value:b[c],writable:!0,enumerable:!0});this.defaultPrevented=this.cancelable=this.bubbles=!1;this.timeStamp=window.performance&&window.performance.now?window.performance.now():Date.now();this.type=a;this.isTrusted=!1;this.target=this.currentTarget=null;this.g=!1}
|
|
function Bg(a){var b=new V(a.type),c;for(c in a)Object.defineProperty(b,c,{value:a[c],writable:!0,enumerable:!0});return b}V.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)};V.prototype.stopImmediatePropagation=function(){this.g=!0};V.prototype.stopPropagation=function(){};T("shaka.util.FakeEvent",V);
|
|
var Cg={fl:"abrstatuschanged",hl:"adaptation",il:"audiotrackchanged",jl:"audiotrackschanged",kl:"boundarycrossed",ll:"buffering",ol:"canupdatestarttime",ql:"complete",rl:"currentitemchanged",ul:"downloadcompleted",vl:"downloadfailed",wl:"downloadheadersreceived",xl:"drmsessionupdate",zl:"emsg",Fl:"itemsinserted",Gl:"itemsremoved",Wl:"prft",Error:"error",Al:"expirationupdated",Bl:"firstquartile",Cl:"gapjumped",Hl:"keystatuschanged",Ll:"loaded",Ml:"loading",Ol:"manifestparsed",Pl:"manifestupdated",
|
|
Ql:"mediaqualitychanged",Rl:"mediasourcerecovered",Sl:"metadataadded",Metadata:"metadata",Tl:"midpoint",Ul:"nospatialvideoinfo",Vl:"onstatechange",Xl:"ratechange",$l:"segmentappended",am:"sessiondata",bm:"spatialvideoinfo",cm:"stalldetected",dm:"started",em:"statechanged",fm:"streaming",gm:"textchanged",hm:"texttrackvisibility",im:"thirdquartile",jm:"timelineregionadded",lm:"timelineregionenter",mm:"timelineregionexit",nm:"trackschanged",pm:"unloading",rm:"variantchanged"};function Dg(){this.Ya=new ib;this.xe=this}Dg.prototype.addEventListener=function(a,b){this.Ya&&this.Ya.push(a,b)};Dg.prototype.removeEventListener=function(a,b){this.Ya&&this.Ya.remove(a,b)};Dg.prototype.dispatchEvent=function(a){if(!this.Ya)return!0;var b=this.Ya.get(a.type)||[],c=this.Ya.get("All");c&&(b=b.concat(c));b=t(b);for(c=b.next();!c.done;c=b.next()){c=c.value;a.target=this.xe;a.currentTarget=this.xe;try{c.handleEvent?c.handleEvent(a):c.call(this,a)}catch(d){}if(a.g)break}return a.defaultPrevented};
|
|
Dg.prototype.release=function(){this.Ya=null};function Eg(){this.g=[]}function Fg(a,b){a.g.push(b.finally(function(){Uc(a.g,b)}))}Eg.prototype.destroy=function(){for(var a=[],b=t(this.g),c=b.next();!c.done;c=b.next())c=c.value,c.promise.catch(function(){}),a.push(c.abort());this.g=[];return Promise.all(a)};function Gg(a,b,c,d,e,f,g){Dg.call(this);this.i=null;this.j=!1;this.s=new Eg;this.g=new Set;this.h=new Set;this.o=a||null;this.m=b||null;this.A=c||null;this.B=d||null;this.C=e||null;this.G=f||null;this.F=g||null;this.l=new Map}pa(Gg,Dg);p=Gg.prototype;p.configure=function(a){this.i=a};function Hg(a,b,c,d){d=void 0===d?!1:d;c=c||Ig;var e=Jg.get(a);(!e||c>=e.priority)&&Jg.set(a,{priority:c,tf:b,xk:d})}
|
|
function Kg(a,b){for(var c=t(a.g),d=c.next();!d.done;d=c.next())b.g.add(d.value);a=t(a.h);for(c=a.next();!c.done;c=a.next())b.h.add(c.value)}p.Ak=function(a){this.g.add(a)};p.Wk=function(a){this.g.delete(a)};p.hj=function(){this.g.clear()};p.Bk=function(a){this.h.add(a)};p.Xk=function(a){this.h.delete(a)};p.ij=function(){this.h.clear()};p.Ih=function(){this.l.clear()};
|
|
function Lg(a,b,c){return{uris:a,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:b,licenseRequestType:null,sessionId:null,drmInfo:null,initData:null,initDataType:null,streamDataCallback:void 0===c?null:c}}p.destroy=function(){this.j=!0;this.g.clear();this.h.clear();this.l.clear();Dg.prototype.release.call(this);return this.s.destroy()};
|
|
p.request=function(a,b,c){var d=this,e=new Mg;if(this.j){var f=Promise.reject(new U(2,7,7001));f.catch(function(){});return new Ng(f,function(){return Promise.resolve()},e)}b.method=b.method||"GET";b.headers=b.headers||{};b.retryParameters=b.retryParameters?ed(b.retryParameters):rg();b.uris=ed(b.uris);f=Og(this,a,b,c);var g=f.Va(function(){return Pg(d,a,b,c,new qg(b.retryParameters,!1),0,null,e)}),h=g.Va(function(q){return Qg(d,a,q,c)}),k=Date.now(),l=0;f.promise.then(function(){l=Date.now()-k},function(){});
|
|
var m=0;g.promise.then(function(){m=Date.now()},function(){});var n=h.Va(function(q){var r=Date.now()-m,u=q.response;u.timeMs+=l;u.timeMs+=r;q.Xj||!d.o||u.fromCache||"HEAD"==b.method||a!=Rg||d.o(u.timeMs,u.data.byteLength,Sg(c),b,c);d.F&&d.F(a,u,c);return u},function(q){q&&(q.severity=2);throw q;});f=new Ng(n.promise,function(){return n.abort()},e);Fg(this.s,f);return f};
|
|
function Og(a,b,c,d){function e(h){f=f.Va(function(){c.body&&(c.body=Ub(c.body));return h(b,c,d)})}var f=xg(void 0);a.C&&e(a.C);a=t(a.g);for(var g=a.next();!g.done;g=a.next())e(g.value);return f.Va(void 0,function(h){if(h instanceof U&&7001==h.code)throw h;throw new U(2,1,1006,h);})}
|
|
function Pg(a,b,c,d,e,f,g,h){a.i.forceHTTP&&(c.uris[f]=c.uris[f].replace("https://","http://"));a.i.forceHTTPS&&(c.uris[f]=c.uris[f].replace("http://","https://"));0<f&&a.G&&a.G(b,d,c.uris[f],c.uris[f-1]);var k=new Bb(c.uris[f]),l=k.ac,m=!1;l||(l=location.protocol,l=l.slice(0,-1),Cb(k,l),c.uris[f]=k.toString());l=l.toLowerCase();var n=(l=Jg.get(l))?l.tf:null;if(!n)return vg(new U(2,1,1E3,k));var q=l.xk;(k=a.l.get(k.Bb))&&(c.headers["common-access-token"]=k);var r=null,u=null,w=!1,v=!1,y;return yg(sg(e)).Va(function(){if(a.j)return wg();
|
|
y=Date.now();var z=0;c.requestStartTime=Date.now();var A=n(c.uris[f],c,b,function(H,C,D){r&&r.stop();u&&u.ha(E/1E3);a.o&&b==Rg&&(z++,c.packetNumber=z,a.o(H,C,Sg(d),c,d),m=!0,h.g=D)},function(H){v=!0;c.timeToFirstByte=Date.now()-c.requestStartTime;a.m&&a.m(H,c,b)},{minBytesForProgressEvents:a.i.minBytesForProgressEvents});if(!q)return A;var B=c.retryParameters.connectionTimeout;B&&(r=new $e(function(){w=!0;A.abort()}),r.ha(B/1E3));var E=c.retryParameters.stallTimeout;E&&(u=new $e(function(){w=!0;A.abort()}));
|
|
return A}).Va(function(z){r&&r.stop();u&&u.stop();void 0==z.timeMs&&(z.timeMs=Date.now()-y);var A=z.headers["common-access-token"];if(A){var B=new Bb(z.uri);a.l.set(B.Bb,A)}A={response:z,Xj:m};!v&&a.m&&a.m(z.headers,c,b);a.A&&a.A(c,z);return A},function(z){r&&r.stop();u&&u.stop();if(a.B){var A=null,B=0;z instanceof U&&(A=z,1001==z.code&&(B=z.data[1]));a.B(c,A,B,w)}if(a.j)return wg();w&&(z=new U(1,1,1003,c.uris[f],b));if(z instanceof U){if(7001==z.code)throw z;if(1010==z.code)throw g;if(1==z.severity){A=
|
|
(new Map).set("error",z);A=new V("retry",A);A.cancelable=!0;a.dispatchEvent(A);if(A.defaultPrevented)throw z;f=(f+1)%c.uris.length;return Pg(a,b,c,d,e,f,z,h)}}throw z;})}
|
|
function Qg(a,b,c,d){var e=xg(void 0);a=t(a.h);for(var f=a.next(),g={};!f.done;g={Ai:void 0},f=a.next())g.Ai=f.value,e=e.Va(function(h){return function(){var k=c.response;k.data&&(k.data=Ub(k.data));return(0,h.Ai)(b,k,d)}}(g));return e.Va(function(){return c},function(h){var k=2;if(h instanceof U){if(7001==h.code)throw h;k=h.severity}throw new U(k,1,1007,h);})}function Sg(a){if(a){var b=a.segment;a=a.stream;if(b&&a&&a.fastSwitching&&b.o)return!1}return!0}T("shaka.net.NetworkingEngine",Gg);
|
|
Gg.prototype.request=Gg.prototype.request;Gg.prototype.destroy=Gg.prototype.destroy;Gg.makeRequest=Lg;Gg.defaultRetryParameters=function(){return rg()};Gg.prototype.clearCommonAccessTokenMap=Gg.prototype.Ih;Gg.prototype.clearAllResponseFilters=Gg.prototype.ij;Gg.prototype.unregisterResponseFilter=Gg.prototype.Xk;Gg.prototype.registerResponseFilter=Gg.prototype.Bk;Gg.prototype.clearAllRequestFilters=Gg.prototype.hj;Gg.prototype.unregisterRequestFilter=Gg.prototype.Wk;
|
|
Gg.prototype.registerRequestFilter=Gg.prototype.Ak;Gg.unregisterScheme=function(a){Jg.delete(a)};Gg.registerScheme=Hg;Gg.prototype.configure=Gg.prototype.configure;function Mg(){this.g=0}Gg.NumBytesRemainingClass=Mg;function Ng(a,b,c){ug.call(this,a,b);this.h=c}pa(Ng,ug);Gg.PendingRequest=Ng;var Rg=1;Gg.RequestType={MANIFEST:0,SEGMENT:Rg,LICENSE:2,APP:3,TIMING:4,SERVER_CERTIFICATE:5,KEY:6,ADS:7,CONTENT_STEERING:8};
|
|
Gg.AdvancedRequestType={INIT_SEGMENT:0,MEDIA_SEGMENT:1,MEDIA_PLAYLIST:2,MASTER_PLAYLIST:3,MPD:4,MSS:5,MPD_PATCH:6,MEDIATAILOR_SESSION_INFO:7,MEDIATAILOR_TRACKING_INFO:8,MEDIATAILOR_STATIC_RESOURCE:9,MEDIATAILOR_TRACKING_EVENT:10,INTERSTITIAL_ASSET_LIST:11,INTERSTITIAL_AD_URL:12};var Ig=3;Gg.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:Ig};var Jg=new Map;function Tg(a){this.g=!1;this.h=new tg;this.i=a}Tg.prototype.destroy=function(){var a=this;if(this.g)return this.h;this.g=!0;return this.i().then(function(){a.h.resolve()},function(){a.h.resolve()})};function Ug(a,b){if(a.g){if(b instanceof U&&7003==b.code)throw b;throw new U(2,7,7003,b);}};function Vg(a,b){var c=[];a=t(a);for(var d=a.next();!d.done;d=a.next())c.push(b(d.value));return c}function Wg(a,b){a=t(a);for(var c=a.next();!c.done;c=a.next())if(!b(c.value))return!1;return!0};function Xg(a){for(var b=new Map,c=t(Object.keys(a)),d=c.next();!d.done;d=c.next())d=d.value,b.set(d,a[d]);return b}function Yg(a){var b={};a.forEach(function(c,d){b[d]=c});return b};function Zg(a,b){this.h=Yb(a);this.i=b==$g;this.g=0}p=Zg.prototype;p.Fa=function(){return this.g<this.h.byteLength};p.Ma=function(){return this.g};p.getLength=function(){return this.h.byteLength};p.X=function(){try{var a=this.h.getUint8(this.g);this.g+=1;return a}catch(b){throw ah();}};p.Aa=function(){try{var a=this.h.getUint16(this.g,this.i);this.g+=2;return a}catch(b){throw ah();}};p.T=function(){try{var a=this.h.getUint32(this.g,this.i);this.g+=4;return a}catch(b){throw ah();}};
|
|
p.Sg=function(){try{var a=this.h.getInt32(this.g,this.i);this.g+=4;return a}catch(b){throw ah();}};p.ud=function(){try{if(this.i){var a=this.h.getUint32(this.g,!0);var b=this.h.getUint32(this.g+4,!0)}else b=this.h.getUint32(this.g,!1),a=this.h.getUint32(this.g+4,!1)}catch(c){throw ah();}if(2097151<b)throw new U(2,3,3001);this.g+=8;return b*Math.pow(2,32)+a};p.Sb=function(a){if(this.g+a>this.h.byteLength)throw ah();var b=Tb(this.h,this.g,a);this.g+=a;return b};
|
|
p.skip=function(a){if(this.g+a>this.h.byteLength)throw ah();this.g+=a};p.Bi=function(a){if(this.g<a)throw ah();this.g-=a};p.seek=function(a){if(0>a||a>this.h.byteLength)throw ah();this.g=a};p.Sc=function(){for(var a=this.g;this.Fa()&&0!=this.h.getUint8(this.g);)this.g+=1;a=Tb(this.h,a,this.g-a);this.g+=1;return ac(a)};function ah(){return new U(2,3,3E3)}T("shaka.util.DataViewReader",Zg);Zg.prototype.readTerminatedString=Zg.prototype.Sc;Zg.prototype.seek=Zg.prototype.seek;Zg.prototype.rewind=Zg.prototype.Bi;
|
|
Zg.prototype.skip=Zg.prototype.skip;Zg.prototype.readBytes=Zg.prototype.Sb;Zg.prototype.readUint64=Zg.prototype.ud;Zg.prototype.readInt32=Zg.prototype.Sg;Zg.prototype.readUint32=Zg.prototype.T;Zg.prototype.readUint16=Zg.prototype.Aa;Zg.prototype.readUint8=Zg.prototype.X;Zg.prototype.getLength=Zg.prototype.getLength;Zg.prototype.getPosition=Zg.prototype.Ma;Zg.prototype.hasMoreData=Zg.prototype.Fa;var $g=1;Zg.Endianness={BIG_ENDIAN:0,LITTLE_ENDIAN:$g};function bh(){this.i=new Map;this.h=new Map;this.g=!1}p=bh.prototype;p.box=function(a,b){a=ch(a);this.i.set(a,dh);this.h.set(a,b);return this};p.R=function(a,b){a=ch(a);this.i.set(a,eh);this.h.set(a,b);return this};p.stop=function(){this.g=!0};p.parse=function(a,b,c){a=new Zg(a,0);for(this.g=!1;a.Fa()&&!this.g;)this.pd(0,a,b,c)};
|
|
p.pd=function(a,b,c,d){var e=b.Ma();if(d&&e+8>b.getLength())this.g=!0;else{var f=b.T(),g=b.T(),h=fh(g),k=!1;switch(f){case 0:f=b.getLength()-e;break;case 1:if(d&&b.Ma()+8>b.getLength()){this.g=!0;return}f=b.ud();k=!0}var l=this.h.get(g);if(l){var m=null,n=null;if(this.i.get(g)==eh){if(d&&b.Ma()+4>b.getLength()){this.g=!0;return}n=b.T();m=n>>>24;n&=16777215}g=e+f;c&&g>b.getLength()&&(g=b.getLength());d&&g>b.getLength()?this.g=!0:(d=g-b.Ma(),b=0<d?b.Sb(d):new Uint8Array(0),b=new Zg(b,0),l({name:h,parser:this,
|
|
partialOkay:c||!1,version:m,flags:n,reader:b,size:f,start:e+a,has64BitSize:k}))}else b.skip(Math.min(e+f-b.Ma(),b.getLength()-b.Ma()))}};function gh(a){for(var b=hh(a);a.reader.Fa()&&!a.parser.g;)a.parser.pd(a.start+b,a.reader,a.partialOkay)}function ih(a){for(var b=hh(a),c=a.reader.T(),d=0;d<c&&(a.parser.pd(a.start+b,a.reader,a.partialOkay),!a.parser.g);d++);}function jh(a){var b=hh(a);for(a.reader.skip(78);a.reader.Fa()&&!a.parser.g;)a.parser.pd(a.start+b,a.reader,a.partialOkay)}
|
|
function kh(a){var b=hh(a);a.reader.skip(8);var c=a.reader.Aa();a.reader.skip(6);2==c?a.reader.skip(48):a.reader.skip(12);for(1==c&&a.reader.skip(16);a.reader.Fa()&&!a.parser.g;)a.parser.pd(a.start+b,a.reader,a.partialOkay)}function lh(a){return function(b){a(b.reader.Sb(b.reader.getLength()-b.reader.Ma()))}}function ch(a){var b=0;a=t(a);for(var c=a.next();!c.done;c=a.next())b=b<<8|c.value.charCodeAt(0);return b}function fh(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}
|
|
function hh(a){return 8+(a.has64BitSize?8:0)+(null!=a.flags?4:0)}T("shaka.util.Mp4Parser",bh);bh.headerSize=hh;bh.typeToString=fh;bh.allData=lh;bh.audioSampleEntry=kh;bh.visualSampleEntry=jh;bh.sampleDescription=ih;bh.children=gh;bh.prototype.parseNext=bh.prototype.pd;bh.prototype.parse=bh.prototype.parse;bh.prototype.stop=bh.prototype.stop;bh.prototype.fullBox=bh.prototype.R;bh.prototype.box=bh.prototype.box;var dh=0,eh=1;function mh(a){var b=this;this.g=[];this.h=[];this.data=[];(new bh).box("moov",gh).box("moof",gh).R("pssh",function(c){if(!(1<c.version)){var d=Tb(c.reader.h,-12,c.size);b.data.push(d);b.g.push(oc(c.reader.Sb(16)));if(0<c.version){d=c.reader.T();for(var e=0;e<d;e++){var f=oc(c.reader.Sb(16));b.h.push(f)}}}}).parse(a)}
|
|
function nh(a,b,c,d){var e=a.length,f=b.length+16+e;0<d&&(f+=4+16*c.size);var g=new Uint8Array(f),h=Yb(g),k=0;h.setUint32(k,f);k+=4;h.setUint32(k,1886614376);k+=4;1>d?h.setUint32(k,0):h.setUint32(k,16777216);k+=4;g.set(b,k);k+=b.length;if(0<d)for(h.setUint32(k,c.size),k+=4,b=t(c),c=b.next();!c.done;c=b.next())c=nc(c.value),g.set(c,k),k+=c.length;h.setUint32(k,e);g.set(a,k+4);return g};function oh(a){var b=this;this.C=a;this.j=this.A=null;this.oa=this.ia=!1;this.H=0;this.h=null;this.o=new jb;this.i=new Map;this.S=[];this.B=new Map;this.K=!1;this.m=new tg;this.g=null;this.s=function(c){2==c.severity&&b.m.reject(c);a.onError(c)};this.W=new Map;this.ka=new Map;this.L=new $e(function(){return ph(b)});this.N=!1;this.M=[];this.U=!1;this.I=new $e(function(){qh(b)});this.m.catch(function(){});this.l=new Tg(function(){return uh(b)});this.$=!1;this.F=this.G=null;this.P=function(){return!1}}
|
|
p=oh.prototype;p.destroy=function(){return this.l.destroy()};function uh(a){return Q(function(b){switch(b.g){case 1:return a.o.release(),a.o=null,a.m.reject(),a.I.stop(),a.I=null,a.L.stop(),a.L=null,F(b,vh(a),2);case 2:if(!a.j){b.u(3);break}wa(b,4);return F(b,a.j.setMediaKeys(null),6);case 6:za(b,5);break;case 4:Aa(b);case 5:a.j=null;case 3:a.h=null,a.A=null,a.B=new Map,a.g=null,a.s=function(){},a.C=null,a.$=!1,a.G=null,G(b)}})}p.configure=function(a,b){this.g=a;b&&(this.P=b);this.I&&this.I.Ga(this.g.updateExpirationTime)};
|
|
function wh(a,b,c){a.oa=!0;a.B=new Map;a.N=c;return xh(a,b,!1)}function yh(a,b,c,d){d=void 0===d?!0:d;a.B=new Map;c=t(c);for(var e=c.next();!e.done;e=c.next())a.B.set(e.value,{initData:null,initDataType:null});c=t(a.g.persistentSessionsMetadata);for(e=c.next();!e.done;e=c.next())e=e.value,a.B.set(e.sessionId,{initData:e.initData,initDataType:e.initDataType});a.N=0<a.B.size;return xh(a,b,d)}
|
|
function zh(a,b,c,d,e,f){var g=new Map;e={audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:"optional",persistentState:"required",sessionTypes:["persistent-license"],label:b};e.drmInfos=[{keySystem:b,licenseServerUri:c,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:d,serverCertificateUri:"",initData:null,keyIds:null}];g.set(b,e);return Ah(a,g,[])}
|
|
function xh(a,b,c){var d,e,f,g,h,k,l,m,n,q,r,u,w,v,y,z,A,B,E,H;return Q(function(C){if(1==C.g){Bh(a.g.clearKeys,b);d=b.some(function(D){return D.video&&D.video.drmInfos.length||D.audio&&D.audio.drmInfos.length?!0:!1});!d&&c&&(e=Xg(a.g.servers),Ch(b,e));f=new Set;g=t(b);for(h=g.next();!h.done;h=g.next())for(k=h.value,l=Dh(k),m=t(l),n=m.next();!n.done;n=m.next())q=n.value,f.add(q);r=t(f);for(u=r.next();!u.done;u=r.next())w=u.value,Eh(w,Xg(a.g.servers),Xg(a.g.advanced||{}),a.g.keySystemsMapping);v=function(D,
|
|
I){var L=[];D=t(D);for(var K=D.next();!K.done;K=D.next()){K=K.value;var J=K[I]||a.g.advanced&&a.g.advanced[K.keySystem]&&a.g.advanced[K.keySystem][I]||"",M;if(M=""==J)M=(M=K.keySystem)?!!M.match(/^com\.widevine\.alpha/):!1;M&&("audioRobustness"==I?J=[a.g.defaultAudioRobustnessForWidevine]:"videoRobustness"==I&&(J=[a.g.defaultVideoRobustnessForWidevine]));if("string"===typeof J)L.push(K);else if(Array.isArray(J))for(0===J.length&&(J=[""]),J=t(J),M=J.next();!M.done;M=J.next()){var O={};L.push(Object.assign({},
|
|
K,(O[I]=M.value,O)))}}return L};y=new Set;z=t(b);for(A=z.next();!A.done;A=z.next())B=A.value,B.video&&!y.has(B.video)&&(B.video.drmInfos=v(B.video.drmInfos,"videoRobustness"),B.video.drmInfos=v(B.video.drmInfos,"audioRobustness"),y.add(B.video)),B.audio&&!y.has(B.audio)&&(B.audio.drmInfos=v(B.audio.drmInfos,"videoRobustness"),B.audio.drmInfos=v(B.audio.drmInfos,"audioRobustness"),y.add(B.audio));y.clear();return F(C,zf(b,a.N,a.$,a.g.preferredKeySystems),2)}Ug(a.l);E=d||Object.keys(a.g.servers).length;
|
|
if(!E)return a.ia=!0,C.return(Promise.resolve());H=Ah(a,void 0,b);return C.return(d?H:H.catch(function(){}))})}function Fh(a){var b;return Q(function(c){switch(c.g){case 1:if(a.j.mediaKeys)return c.return();if(!a.G){c.u(2);break}return F(c,a.G,3);case 3:return Ug(a.l),c.return();case 2:return wa(c,4),a.G=a.j.setMediaKeys(a.A),F(c,a.G,6);case 6:za(c,5);break;case 4:b=Aa(c),a.s(new U(2,6,6003,b.message));case 5:Ug(a.l),G(c)}})}
|
|
function Gh(a,b){return Q(function(c){if(1==c.g)return F(c,Fh(a),2);Hh(a,b.initDataType,Tb(b.initData));G(c)})}
|
|
p.cc=function(a){var b=this,c,d;return Q(function(e){if(1==e.g){if(b.j===a)return e.return();if(!b.A)return b.o.za(a,"encrypted",function(){b.s(new U(2,6,6010))}),e.return();b.j=a;b.o.za(b.j,"play",function(){for(var f=t(b.M),g=f.next();!g.done;g=f.next())Ih(b,g.value);b.U=!0;b.M=[]});b.j.remote?(b.o.D(b.j.remote,"connect",function(){return vh(b)}),b.o.D(b.j.remote,"connecting",function(){return vh(b)}),b.o.D(b.j.remote,"disconnect",function(){return vh(b)})):"webkitCurrentPlaybackTargetIsWireless"in
|
|
b.j&&b.o.D(b.j,"webkitcurrentplaybacktargetiswirelesschanged",function(){return vh(b)});b.F=b.h?b.h.initData.find(function(f){return 0<f.initData.length})||null:null;c=b.h.keySystem;return(d=c.startsWith("com.microsoft.playready.recommendation")||"com.apple.fps"==c)||!(b.F||b.B.size||b.g.parseInbandPsshEnabled)?(b.o.D(b.j,"encrypted",function(f){return Gh(b,f)}),e.u(2)):F(e,Fh(b),2)}Jh(b).catch(function(){});G(e)})};
|
|
function Kh(a){var b,c,d,e,f;return Q(function(g){switch(g.g){case 1:if(!a.A||!a.h)return g.return();if(!a.h.serverCertificateUri||a.h.serverCertificate&&a.h.serverCertificate.length){g.u(2);break}b=Lg([a.h.serverCertificateUri],a.g.retryParameters);wa(g,3);c=a.C.lc.request(5,b,{isPreload:a.P()});return F(g,c.promise,5);case 5:d=g.h;a.h.serverCertificate=Tb(d.data);za(g,4);break;case 3:throw e=Aa(g),new U(2,6,6017,e);case 4:if(a.l.g)return g.return();case 2:if(!a.h.serverCertificate||!a.h.serverCertificate.length)return g.return();
|
|
wa(g,6);return F(g,a.A.setServerCertificate(a.h.serverCertificate),8);case 8:za(g,0);break;case 6:throw f=Aa(g),new U(2,6,6004,f.message);}})}function Lh(a,b){var c,d,e;return Q(function(f){if(1==f.g)return F(f,Mh(a,b,{initData:null,initDataType:null}),2);if(3!=f.g){c=f.h;if(!c)return f.return();d=[];if(e=a.i.get(c))e.Ib=new tg,d.push(e.Ib);d.push(c.remove());return F(f,Promise.all(d),3)}a.i.delete(c);G(f)})}
|
|
function Jh(a){var b,c,d,e,f;return Q(function(g){if(1==g.g){if(!a.B.size)return g.u(2);a.B.forEach(function(h,k){Mh(a,k,h)});return F(g,a.m,3)}if(2!=g.g){b=a.h&&a.h.keyIds||new Set([]);if(0<b.size&&Nh(a))return g.return(a.m);a.K=!1;a.m=new tg;a.m.catch(function(){})}c=(a.h?a.h.initData:[])||[];d=t(c);for(e=d.next();!e.done;e=d.next())f=e.value,Hh(a,f.initDataType,f.initData);Oh(a)&&a.m.resolve();return g.return(a.m)})}
|
|
function Hh(a,b,c){if(c.length){if(a.g.ignoreDuplicateInitData){var d=a.i.values();d=t(d);for(var e=d.next();!e.done;e=d.next())if(Sb(c,e.value.initData))return;var f=!1;a.B.forEach(function(g){!f&&Sb(c,g.initData)&&(f=!0)});if(f)return}a.K=!0;0<a.i.size&&Oh(a)&&(a.m.resolve(),a.K=!1,a.m=new tg,a.m.catch(function(){}));Ph(a,b,c,a.h.sessionType)}}function Qh(a){a=a.i.keys();a=Vg(a,function(b){return b.sessionId});return Array.from(a)}
|
|
p.yg=function(){var a=this,b=this.i.keys();b=Vg(b,function(c){var d=a.i.get(c);return{sessionId:c.sessionId,sessionType:d.type,initData:d.initData,initDataType:d.initDataType}});return Array.from(b)};p.Md=function(){var a=Infinity,b=this.i.keys();b=t(b);for(var c=b.next();!c.done;c=b.next())c=c.value,isNaN(c.expiration)||(a=Math.min(a,c.expiration));return a};function Rh(a){return a.H?a.H:NaN}p.Se=function(){return Yg(this.ka)};
|
|
function Ah(a,b,c){var d,e,f,g,h,k,l,m;return Q(function(n){switch(n.g){case 1:d=new Map;if(c.length){e=Sh(a,c,d);n.u(2);break}return F(n,Th(a,b),3);case 3:e=n.h;case 2:f=e;if(!f){if(!navigator.requestMediaKeySystemAccess)throw new U(2,6,6020);throw new U(2,6,6001);}Ug(a.l);wa(n,4);f.getConfiguration();g=a.g.keySystemsMapping[f.keySystem]||f.keySystem;if(c.length){var q=g;var r=d.get(g);var u=[],w=[],v=[],y=[],z=[],A=new Set,B=new Set;Uh(r,u,w,y,v,z,A,B);var E=a.N?"persistent-license":"temporary";
|
|
q={keySystem:q,encryptionScheme:u[0],licenseServerUri:w[0],distinctiveIdentifierRequired:r[0].distinctiveIdentifierRequired,persistentStateRequired:r[0].persistentStateRequired,sessionType:r[0].sessionType||E,audioRobustness:r[0].audioRobustness||"",videoRobustness:r[0].videoRobustness||"",serverCertificate:y[0],serverCertificateUri:v[0],initData:z,keyIds:A};0<B.size&&(q.keySystemUris=B);r=t(r);for(B=r.next();!B.done;B=r.next())B=B.value,B.distinctiveIdentifierRequired&&(q.distinctiveIdentifierRequired=
|
|
B.distinctiveIdentifierRequired),B.persistentStateRequired&&(q.persistentStateRequired=B.persistentStateRequired);r=q}else r=g,B=b.get(g),q=[],u=[],w=[],v=[],y=[],z=new Set,Uh(B.drmInfos,q,u,v,w,y,z),r={keySystem:r,encryptionScheme:q[0],licenseServerUri:u[0],distinctiveIdentifierRequired:"required"==B.distinctiveIdentifier,persistentStateRequired:"required"==B.persistentState,sessionType:B.sessionTypes[0]||"temporary",audioRobustness:(B.audioCapabilities?B.audioCapabilities[0].robustness:"")||"",
|
|
videoRobustness:(B.videoCapabilities?B.videoCapabilities[0].robustness:"")||"",serverCertificate:v[0],serverCertificateUri:w[0],initData:y,keyIds:z};a.h=r;if(!a.h.licenseServerUri)throw new U(2,6,6012,a.h.keySystem);return F(n,f.createMediaKeys(),6);case 6:h=n.h;Ug(a.l);a.A=h;if(!(""!=a.g.minHdcpVersion&&"getStatusForPolicy"in a.A)){n.u(7);break}wa(n,8);return F(n,a.A.getStatusForPolicy({minHdcpVersion:a.g.minHdcpVersion}),10);case 10:k=n.h;if("usable"!=k)throw new U(2,6,6018);Ug(a.l);za(n,7,4);break;
|
|
case 8:l=Aa(n,4);if(l instanceof U)throw l;throw new U(2,6,6019,l.message);case 7:return a.ia=!0,F(n,Kh(a),11);case 11:Ug(a.l);za(n,0);break;case 4:m=Aa(n);Ug(a.l,m);a.h=null;if(m instanceof U)throw m;throw new U(2,6,6002,m.message);}})}
|
|
function Sh(a,b,c){for(var d=t(b),e=d.next();!e.done;e=d.next()){e=t(Dh(e.value));for(var f=e.next();!f.done;f=e.next())f=f.value,c.has(f.keySystem)||c.set(f.keySystem,[]),c.get(f.keySystem).push(f)}if(1==c.size&&c.has(""))throw new U(2,6,6E3);d=a.g.preferredKeySystems;d.length||(e=Xg(a.g.servers),1==e.size&&(d=Array.from(e.keys())));e=t(d);var g=e.next();for(f={};!g.done;f={si:void 0},g=e.next()){f.si=g.value;g=t(b);for(var h=g.next();!h.done;h=g.next())if(h=h.value.decodingInfos.find(function(n){return function(q){return q.supported&&
|
|
null!=q.keySystemAccess&&q.keySystemAccess.keySystem==n.si}}(f)))return h.keySystemAccess}e=t([!0,!1]);for(f=e.next();!f.done;f=e.next())for(f=f.value,g=t(b),h=g.next();!h.done;h=g.next()){h=t(h.value.decodingInfos);for(var k=h.next();!k.done;k=h.next())if(k=k.value,k.supported&&k.keySystemAccess){var l=k.keySystemAccess.keySystem;if(!d.includes(l)){var m=c.get(l);!m&&a.g.keySystemsMapping[l]&&(m=c.get(a.g.keySystemsMapping[l]));l=t(m);for(m=l.next();!m.done;m=l.next())if(!!m.value.licenseServerUri==
|
|
f)return k.keySystemAccess}}}return null}
|
|
function Th(a,b){var c,d,e,f,g,h,k,l,m,n,q,r,u,w,v,y;return Q(function(z){switch(z.g){case 1:if(1==b.size&&b.has(""))throw new U(2,6,6E3);d=t(b.values());for(e=d.next();!e.done;e=d.next())f=e.value,0==f.audioCapabilities.length&&delete f.audioCapabilities,0==f.videoCapabilities.length&&delete f.videoCapabilities;g=t(a.g.preferredKeySystems);h=g.next();case 2:if(h.done){z.u(4);break}k=h.value;if(!b.has(k)){z.u(3);break}l=b.get(k);wa(z,6);return F(z,navigator.requestMediaKeySystemAccess(k,[l]),8);case 8:return c=
|
|
z.h,z.return(c);case 6:Aa(z);case 7:Ug(a.l);case 3:h=g.next();z.u(2);break;case 4:m=t([!0,!1]),n=m.next();case 9:if(n.done){z.u(11);break}q=n.value;r=t(b.keys());u=r.next();case 12:if(u.done){n=m.next();z.u(9);break}w=u.value;v=b.get(w);y=v.drmInfos.some(function(A){return!!A.licenseServerUri});if(y!=q){z.u(13);break}wa(z,15);return F(z,navigator.requestMediaKeySystemAccess(w,[v]),17);case 17:return c=z.h,z.return(c);case 15:Aa(z);case 16:Ug(a.l);case 13:u=r.next();z.u(12);break;case 11:return z.return(c)}})}
|
|
function Vh(a){Oh(a)&&a.m.resolve()}function Wh(a,b){(new $e(function(){b.loaded=!0;Vh(a)})).ha(Xh)}
|
|
function Mh(a,b,c){var d,e,f,g,h,k,l;return Q(function(m){switch(m.g){case 1:try{d=a.A.createSession("persistent-license")}catch(n){return e=new U(2,6,6005,n.message),a.s(e),m.return(Promise.reject(e))}a.o.D(d,"message",function(n){a.j&&a.g.delayLicenseRequestUntilPlayed&&a.j.paused&&!a.U?a.M.push(n):Ih(a,n)});a.o.D(d,"keystatuseschange",function(n){return Yh(a,n)});f={initData:c.initData,initDataType:c.initDataType,loaded:!1,Ng:Infinity,Ib:null,type:"persistent-license"};a.i.set(d,f);wa(m,2);return F(m,
|
|
d.load(b),4);case 4:return g=m.h,Ug(a.l),g||(a.i.delete(d),h=a.g.persistentSessionOnlinePlayback?1:2,a.s(new U(h,6,6013)),f.loaded=!0),Wh(a,f),Vh(a),m.return(d);case 2:k=Aa(m),Ug(a.l,k),a.i.delete(d),l=a.g.persistentSessionOnlinePlayback?1:2,a.s(new U(l,6,6005,k.message)),f.loaded=!0,Vh(a);case 3:return m.return(Promise.resolve())}})}
|
|
function Ph(a,b,c,d){try{var e=a.A.createSession(d)}catch(f){a.s(new U(2,6,6005,f.message));return}a.o.D(e,"message",function(f){a.j&&a.g.delayLicenseRequestUntilPlayed&&a.j.paused&&!a.U?a.M.push(f):Ih(a,f)});a.o.D(e,"keystatuseschange",function(f){return Yh(a,f)});a.i.set(e,{initData:c,initDataType:b,loaded:!1,Ng:Infinity,Ib:null,type:d});try{c=a.g.initDataTransform(c,b,a.h)}catch(f){b=f;f instanceof U||(b=new U(2,6,6016,f));a.s(b);return}a.g.logLicenseExchange&&lc(c);e.generateRequest(b,c).catch(function(f){if(!a.l.g){a.i.delete(e);
|
|
var g=f.errorCode;if(g&&g.systemCode){var h=g.systemCode;0>h&&(h+=Math.pow(2,32));h="0x"+h.toString(16)}a.s(new U(2,6,6006,f.message,f,h))}})}function Zh(a){return Q(function(b){return 1==b.g?a.K?F(b,a.m,3):b.u(0):F(b,Promise.all(a.S.map(function(c){return c.promise})),0)})}
|
|
function Ih(a,b){var c,d,e,f,g,h,k,l,m,n,q,r,u,w;Q(function(v){switch(v.g){case 1:c=b.target;a.g.logLicenseExchange&&lc(b.message);d=a.i.get(c);e=a.h.licenseServerUri;f=a.g.advanced[a.h.keySystem];"individualization-request"==b.messageType&&f&&f.individualizationServer&&(e=f.individualizationServer);g=Lg([e],a.g.retryParameters);g.body=b.message;g.method="POST";g.licenseRequestType=b.messageType;g.sessionId=c.sessionId;g.drmInfo=a.h;d&&(g.initData=d.initData,g.initDataType=d.initDataType);if(f&&f.headers)for(h in f.headers)g.headers[h]=
|
|
f.headers[h];if("org.w3.clearkey"===a.h.keySystem){var y=g,z=a.h;try{var A=dc(y.body);if(A){var B=JSON.parse(A);B.type||(B.type=z.sessionType,y.body=ec(JSON.stringify(B)))}}catch(E){}}if(mg(a.h.keySystem))if(y=bc(g.body,!0,!0),y.includes("PlayReadyKeyMessage")){y=jd(y,"PlayReadyKeyMessage");z=td(y,"HttpHeader");z=t(z);for(A=z.next();!A.done;A=z.next())B=A.value,A=td(B,"name")[0],B=td(B,"value")[0],g.headers[rd(A)]=rd(B);y=td(y,"Challenge")[0];g.body=mc(rd(y))}else g.headers["Content-Type"]="text/xml; charset=utf-8";
|
|
k=Date.now();wa(v,2);m=a.C.lc.request(2,g,{isPreload:a.P()});a.S.push(m);return F(v,m.promise,4);case 4:l=v.h;Uc(a.S,m);za(v,3);break;case 2:n=Aa(v);if(a.l.g)return v.return();q=new U(2,6,6007,n);1==a.i.size?(a.s(q),d&&d.Ib&&d.Ib.reject(q)):(d&&d.Ib&&d.Ib.reject(q),a.i.delete(c),Oh(a)&&(a.m.resolve(),a.L.ha(.1)));return v.return();case 3:if(a.l.g)return v.return();a.H+=(Date.now()-k)/1E3;a.g.logLicenseExchange&&lc(l.data);wa(v,5);return F(v,c.update(l.data),7);case 7:za(v,6);break;case 5:return r=
|
|
Aa(v),u=new U(2,6,6008,r.message),a.s(u),d&&d.Ib&&d.Ib.reject(u),v.return();case 6:if(a.l.g)return v.return();w=new V("drmsessionupdate");a.C.onEvent(w);d&&(d.Ib&&d.Ib.resolve(),Wh(a,d));G(v)}})}
|
|
function Yh(a,b){b=b.target;var c=a.i.get(b),d=!1;b.keyStatuses.forEach(function(f,g){if("string"==typeof g){var h=g;g=f;f=h}h=qb();if(mg(a.h.keySystem)&&16==g.byteLength&&h.Zg()){h=Yb(g);var k=h.getUint32(0,!0),l=h.getUint16(4,!0),m=h.getUint16(6,!0);h.setUint32(0,k,!1);h.setUint16(4,l,!1);h.setUint16(6,m,!1)}"status-pending"!=f&&(c.loaded=!0);"expired"==f&&(d=!0);g=oc(g).slice(0,32);a.W.set(g,f)});var e=b.expiration-Date.now();(0>e||d&&1E3>e)&&c&&!c.Ib&&(a.i.delete(b),$h(b));Oh(a)&&(a.m.resolve(),
|
|
a.L.ha(ai))}function ph(a){var b=a.W,c=a.ka;c.clear();b.forEach(function(d,e){return c.set(e,d)});b=Array.from(c.values());b.length&&b.every(function(d){return"expired"==d})&&a.s(new U(2,6,6014));a.C.nf(Yg(c))}
|
|
function bi(){var a,b,c,d,e,f,g,h,k,l,m,n,q,r,u,w,v,y,z,A,B,E,H,C,D,I,L,K,J,M,O,N,P,R,S;return Q(function(aa){if(1==aa.g){a="org.w3.clearkey com.widevine.alpha com.widevine.alpha.experiment com.microsoft.playready com.microsoft.playready.hardware com.microsoft.playready.recommendation com.microsoft.playready.recommendation.3000 com.microsoft.playready.recommendation.3000.clearlead com.chromecast.playready com.apple.fps.1_0 com.apple.fps com.huawei.wiseplay".split(" ");if(!(window.MediaKeys&&window.navigator&&
|
|
window.navigator.requestMediaKeySystemAccess&&window.MediaKeySystemAccess&&window.MediaKeySystemAccess.prototype.getConfiguration)){b={};c=t(a);for(d=c.next();!d.done;d=c.next())e=d.value,b[e]=null;return aa.return(b)}f="1.0 1.1 1.2 1.3 1.4 2.0 2.1 2.2 2.3".split(" ");g=["SW_SECURE_CRYPTO","SW_SECURE_DECODE","HW_SECURE_CRYPTO","HW_SECURE_DECODE","HW_SECURE_ALL"];h=["150","2000","3000"];k={"com.widevine.alpha":g,"com.widevine.alpha.experiment":g,"com.microsoft.playready.recommendation":h};l=[{contentType:'video/mp4; codecs="avc1.42E01E"'},
|
|
{contentType:'video/webm; codecs="vp8"'}];m=[{contentType:'audio/mp4; codecs="mp4a.40.2"'},{contentType:'audio/webm; codecs="opus"'}];n={videoCapabilities:l,audioCapabilities:m,initDataTypes:["cenc","sinf","skd","keyids"]};q=[null,"cenc","cbcs","cbcs-1-9"];r=new Map;u=qb();w=function(W,Fa){var Ga,xa,qa,Da,Ja,ra,da,sa,Za,$a,hb,rb,mb;return Q(function(Ma){switch(Ma.g){case 1:return wa(Ma,2),F(Ma,Fa.createMediaKeys(),5);case 5:Ga=Ma.h;case 4:za(Ma,3);break;case 2:return Aa(Ma),Ma.return();case 3:qa=
|
|
(xa=Fa.getConfiguration().sessionTypes)?xa.includes("persistent-license"):!1;u.ji()&&(qa=!1);Da=Fa.getConfiguration().videoCapabilities;Ja=Fa.getConfiguration().audioCapabilities;ra={persistentState:qa,encryptionSchemes:[],videoRobustnessLevels:[],audioRobustnessLevels:[],minHdcpVersions:[]};r.has(W)&&r.get(W)?ra=r.get(W):r.set(W,ra);(da=Da[0].encryptionScheme)&&!ra.encryptionSchemes.includes(da)&&ra.encryptionSchemes.push(da);(sa=Da[0].robustness)&&!ra.videoRobustnessLevels.includes(sa)&&ra.videoRobustnessLevels.push(sa);
|
|
(Za=Ja[0].robustness)&&!ra.audioRobustnessLevels.includes(Za)&&ra.audioRobustnessLevels.push(Za);if("getStatusForPolicy"in Ga){$a=[];hb=t(f);rb=hb.next();for(mb={};!rb.done;mb={Qd:void 0},rb=hb.next())mb.Qd=rb.value,ra.minHdcpVersions.includes(mb.Qd)||$a.push(Ga.getStatusForPolicy({minHdcpVersion:mb.Qd}).then(function(Td){return function(ic){"usable"!=ic||ra.minHdcpVersions.includes(Td.Qd)||ra.minHdcpVersions.push(Td.Qd)}}(mb)));return F(Ma,Promise.all($a),0)}Ma.u(0)}})};v=function(W,Fa,Ga,xa){var qa,
|
|
Da,Ja,ra,da,sa,Za,$a,hb,rb,mb;return Q(function(Ma){switch(Ma.g){case 1:wa(Ma,2);qa=ed(n);Da=t(qa.videoCapabilities);for(Ja=Da.next();!Ja.done;Ja=Da.next())ra=Ja.value,ra.encryptionScheme=Fa,ra.robustness=Ga;da=t(qa.audioCapabilities);for(sa=da.next();!sa.done;sa=da.next())Za=sa.value,Za.encryptionScheme=Fa,Za.robustness=xa;$a=ed(qa);$a.persistentState="required";$a.sessionTypes=["persistent-license"];hb=[$a,qa];mb=qb();return"MOBILE"==mb.La()?F(Ma,df(5,navigator.requestMediaKeySystemAccess(W,hb)),
|
|
7):F(Ma,navigator.requestMediaKeySystemAccess(W,hb),6);case 6:rb=Ma.h;Ma.u(5);break;case 7:rb=Ma.h;case 5:return F(Ma,w(W,rb),8);case 8:za(Ma,0);break;case 2:Aa(Ma),G(Ma)}})};y=function(W,Fa,Ga,xa){var qa,Da,Ja,ra;return Q(function(da){switch(da.g){case 1:return wa(da,2),qa={type:"media-source",video:{contentType:l[0].contentType,width:640,height:480,bitrate:1,framerate:1},audio:{contentType:m[0].contentType,channels:2,bitrate:1,samplerate:1},keySystemConfiguration:{keySystem:W,video:{encryptionScheme:Fa,
|
|
robustness:Ga},audio:{encryptionScheme:Fa,robustness:xa}}},Ja=qb(),"MOBILE"==Ja.La()?F(da,df(5,navigator.mediaCapabilities.decodingInfo(qa)),7):F(da,navigator.mediaCapabilities.decodingInfo(qa),6);case 6:Da=da.h;da.u(5);break;case 7:Da=da.h;case 5:return ra=Da.keySystemAccess,F(da,w(W,ra),8);case 8:za(da,0);break;case 2:Aa(da),G(da)}})};z=t(a);for(A=z.next();!A.done;A=z.next())B=A.value,r.set(B,null);E=function(W){return"WEBKIT"===qb().Ea()&&"org.w3.clearkey"===W?!1:!0};H=[];C=t(q);for(D=C.next();!D.done;D=
|
|
C.next())for(I=D.value,L=t(a),K=L.next();!K.done;K=L.next())J=K.value,E(J)&&(H.push(v(J,I,"","")),H.push(y(J,I,"","")));M=t(a);for(O=M.next();!O.done;O=M.next())for(N=O.value,P=t(k[N]||[]),R=P.next();!R.done;R=P.next())S=R.value,E(N)&&(H.push(v(N,null,S,"")),H.push(v(N,null,"",S)),H.push(y(N,null,S,"")),H.push(y(N,null,"",S)));return F(aa,Promise.all(H),2)}return aa.return(Yg(r))})}
|
|
function $h(a){return Q(function(b){if(1==b.g)return wa(b,2),F(b,df(ci,Promise.all([a.close().catch(function(){}),a.closed])),4);if(2!=b.g)return za(b,0);Aa(b);G(b)})}
|
|
function vh(a){var b;return Q(function(c){b=Array.from(a.i.entries());a.i.clear();return F(c,Promise.all(b.map(function(d){d=t(d);var e=d.next().value,f=d.next().value;return Q(function(g){if(1==g.g)return wa(g,2),a.oa||a.B.has(e.sessionId)||"persistent-license"!==f.type||a.g.persistentSessionOnlinePlayback?F(g,$h(e),5):F(g,e.remove(),5);if(2!=g.g)return za(g,0);Aa(g);G(g)})})),0)})}function Dh(a){return(a.video?a.video.drmInfos:[]).concat(a.audio?a.audio.drmInfos:[])}
|
|
function qh(a){a.i.forEach(function(b,c){var d=b.Ng,e=c.expiration;isNaN(e)&&(e=Infinity);e!=d&&(a.C.onExpirationUpdated(c.sessionId,e),b.Ng=e)})}function Oh(a){a=a.i.values();return Wg(a,function(b){return b.loaded})}function Nh(a){for(var b=t(a.h&&a.h.keyIds||new Set([])),c=b.next();!c.done;c=b.next())if("usable"!==a.W.get(c.value))return!1;return!0}
|
|
function Ch(a,b){var c=[];b.forEach(function(d,e){c.push({keySystem:e,licenseServerUri:d,distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",initData:[],keyIds:new Set})});a=t(a);for(b=a.next();!b.done;b=a.next())b=b.value,b.video&&(b.video.drmInfos=c),b.audio&&(b.audio.drmInfos=c)}
|
|
function Uh(a,b,c,d,e,f,g,h){var k=[];a=t(a);for(var l=a.next(),m={};!l.done;m={Ha:void 0},l=a.next()){m.Ha=l.value;b.includes(m.Ha.encryptionScheme)||b.push(m.Ha.encryptionScheme);"org.w3.clearkey"==m.Ha.keySystem&&m.Ha.licenseServerUri.startsWith("data:application/json;base64,")?k.includes(m.Ha.licenseServerUri)||k.push(m.Ha.licenseServerUri):c.includes(m.Ha.licenseServerUri)||c.push(m.Ha.licenseServerUri);e.includes(m.Ha.serverCertificateUri)||e.push(m.Ha.serverCertificateUri);m.Ha.serverCertificate&&
|
|
(d.some(function(r){return function(u){return Sb(u,r.Ha.serverCertificate)}}(m))||d.push(m.Ha.serverCertificate));if(m.Ha.initData){l=t(m.Ha.initData);for(var n=l.next(),q={};!n.done;q={Eg:void 0},n=l.next())q.Eg=n.value,f.some(function(r){return function(u){var w=r.Eg;return u.keyId&&u.keyId==w.keyId?!0:u.initDataType==w.initDataType&&Sb(u.initData,w.initData)}}(q))||f.push(q.Eg)}if(m.Ha.keyIds)for(l=t(m.Ha.keyIds),n=l.next();!n.done;n=l.next())g.add(n.value);if(m.Ha.keySystemUris&&h)for(m=t(m.Ha.keySystemUris),
|
|
l=m.next();!l.done;l=m.next())h.add(l.value)}if(1==k.length)c.push(k[0]);else if(0<k.length){b=[];k=t(k);for(d=k.next();!d.done;d=k.next())d=window.atob(d.value.split("data:application/json;base64,").pop()),d=JSON.parse(d),b.push.apply(b,x(d.keys));k=JSON.stringify({keys:b});c.push("data:application/json;base64,"+window.btoa(k))}}
|
|
function Eh(a,b,c,d){var e=a.keySystem;if(e&&("org.w3.clearkey"!=e||!a.licenseServerUri)){b.size&&b.get(e)&&(b=b.get(e),a.licenseServerUri=b);a.keyIds||(a.keyIds=new Set);if(c=c.get(e))a.distinctiveIdentifierRequired||(a.distinctiveIdentifierRequired=c.distinctiveIdentifierRequired),a.persistentStateRequired||(a.persistentStateRequired=c.persistentStateRequired),a.serverCertificate||(a.serverCertificate=c.serverCertificate),c.sessionType&&(a.sessionType=c.sessionType),a.serverCertificateUri||(a.serverCertificateUri=
|
|
c.serverCertificateUri);d[e]&&(a.keySystem=d[e]);window.cast&&window.cast.__platform__&&"com.microsoft.playready"==e&&(a.keySystem="com.chromecast.playready")}}function Bh(a,b){a=Xg(a);if(0!=a.size){a=sc(a);b=t(b);for(var c=b.next();!c.done;c=b.next())c=c.value,c.video&&(c.video.drmInfos=[a]),c.audio&&(c.audio.drmInfos=[a])}}var ci=1,Xh=5,ai=.5;function di(a,b,c){c=void 0===c?!0:c;this.h=a;this.g=new Set([a]);b=b||[];a=t(b);for(b=a.next();!b.done;b=a.next())this.add(b.value,c)}
|
|
di.prototype.add=function(a,b){var c=this.h;b=void 0===b?!0:b;var d;if(!(d=!!c.audio!=!!a.audio||!!c.video!=!!a.video||c.language!=a.language)&&(d=c.audio&&a.audio)){d=c.audio;var e=a.audio;d=!(!((!d.channelsCount||!e.channelsCount||2<d.channelsCount||2<e.channelsCount)&&d.channelsCount!=e.channelsCount||d.spatialAudio!==e.spatialAudio||b&&!ei(d,e))&&fi(d.roles,e.roles)&&d.groupId===e.groupId)}!d&&(d=c.video&&a.video)&&(c=c.video,d=a.video,d=!((!b||ei(c,d))&&fi(c.roles,d.roles)));return d?!1:(this.g.add(a),
|
|
!0)};di.prototype.values=function(){return this.g.values()};function ei(a,b){if(a.mimeType!=b.mimeType)return!1;a=a.codecs.split(",").map(function(d){return Ke(d)});b=b.codecs.split(",").map(function(d){return Ke(d)});if(a.length!=b.length)return!1;a.sort();b.sort();for(var c=0;c<a.length;c++)if(a[c]!=b[c])return!1;return!0}
|
|
function fi(a,b){a=new Set(a);b=new Set(b);a.delete("main");b.delete("main");if(a.size!=b.size)return!1;a=t(a);for(var c=a.next();!c.done;c=a.next())if(!b.has(c.value))return!1;return!0}T("shaka.media.AdaptationSet",di);T("shaka.config.CodecSwitchingStrategy",{RELOAD:"reload",SMOOTH:"smooth"});function gi(){}gi.prototype.create=function(){};gi.prototype.configure=function(){};gi.prototype.getConfiguration=function(){};T("shaka.media.AdaptationSetCriteria",gi);function hi(){this.g=ii;this.i=(new Map).set(ii,2).set(ji,1);this.h=0}var ji=0,ii=1;/*
|
|
@license
|
|
Shaka Player
|
|
Copyright 2023 Google LLC
|
|
SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
function ki(a,b,c){this.g=a;this.i=b;this.h=c}function li(a,b){return Q(function(c){if(1==c.g)return F(c,uf(a.h,b,a.g.drm.preferredKeySystems,a.g.drm.keySystemsMapping),2);a.g.streaming.dontChooseCodecs||qf(b,a.g.preferredVideoCodecs,a.g.preferredAudioCodecs,a.g.preferredDecodingAttributes,a.g.preferredTextFormats);if(!b.variants.some(Zf))throw new U(2,4,4032);return c.return(mi(a,b))})}
|
|
function ni(a,b){var c=a.g.restrictions;a=a.i;var d=!1;b=t(b.variants);for(var e=b.next();!e.done;e=b.next()){e=e.value;var f=e.allowedByApplication;e.allowedByApplication=tf(e,c,a);f!=e.allowedByApplication&&(d=!0)}return d}
|
|
function mi(a,b){var c=ni(a,b);if(b){var d=a.h?a.h.h:null;if(d&&a.h.A){for(var e=new Set,f=t(b.variants),g=f.next();!g.done;g=f.next())g=g.value,g.audio&&e.add(g.audio),g.video&&e.add(g.video);e=t(e);for(f=e.next();!f.done;f=e.next())oi(a,d.keySystem,f.value)}pi(a,b)}return c}function oi(a,b,c){c=t(c.drmInfos);for(var d=c.next();!d.done;d=c.next())if(d=d.value,d.keySystem==b){d=t(d.initData||[]);for(var e=d.next();!e.done;e=d.next())e=e.value,Hh(a.h,e.initDataType,e.initData)}}
|
|
function pi(a,b){a=a.h?a.h.Se():{};var c=Object.keys(a);c=c.length&&"00"==c[0];var d=!1,e=!1,f=new Set,g=new Set,h=new Set;b=t(b.variants);for(var k=b.next();!k.done;k=b.next())k=k.value,k.audio&&h.add(k.audio),k.video&&h.add(k.video),k.allowedByApplication?k.allowedByKeySystem&&(d=!0):e=!0;h=t(h);for(b=h.next();!b.done;b=h.next())if(b=b.value,b.keyIds.size)for(b=t(b.keyIds),k=b.next();!k.done;k=b.next()){k=k.value;var l=a[c?"00":k];l?qi.includes(l)&&g.add(l):f.add(k)}if(!d)throw a={hasAppRestrictions:e,
|
|
missingKeys:Array.from(f),restrictedKeyStatuses:Array.from(g)},new U(2,4,4012,a);}var qi=["output-restricted","internal-error"];function ri(){}function si(a,b){ti.set(a,b)}function ui(){var a={};qb();if(vi())for(var b=t(ti.keys()),c=b.next();!c.done;c=b.next())a[c.value]=!0;b=t(["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","application/vnd.ms-sstr+xml"]);for(c=b.next();!c.done;c=b.next())c=c.value,a[c]=vi()?ti.has(c):""!=wi().canPlayType(c);return a}function xi(a,b){if(b){var c=ti.get(b.toLowerCase());if(c)return c}throw new U(2,4,4E3,a,b);}T("shaka.media.ManifestParser",ri);
|
|
ri.unregisterParserByMime=function(a){ti.delete(a)};ri.registerParserByMime=si;ri.registerParserByExtension=function(){wb("ManifestParser.registerParserByExtension","Please use an ManifestParser with registerParserByMime function.")};ri.AccessibilityPurpose={qm:"visually impaired",Dl:"hard of hearing",Zl:"spoken subtitles"};var ti=new Map;function yi(a,b){var c=null,d=null,e=null,f=null,g=a.T();b&1&&(e=a.ud());b&2&&(f=a.T());b&8&&(c=a.T());b&16&&(d=a.T());return{trackId:g,Id:c,Jd:d,dj:e,Ci:f}}function zi(a,b){return 1==b?(b=a.T(),a=a.T(),{baseMediaDecodeTime:b*Math.pow(2,32)+a}):{baseMediaDecodeTime:a.T()}}function Ai(a,b){1==b?(a.skip(8),a.skip(8)):(a.skip(4),a.skip(4));b=a.T();a.skip(4);a=a.Aa();return{timescale:b,language:String.fromCharCode((a>>10)+96)+String.fromCharCode(((a&960)>>5)+96)+String.fromCharCode((a&31)+96)}}
|
|
function Bi(a,b,c){var d=a.T(),e=[],f=null;c&1&&(f=a.Sg());c&4&&a.skip(4);for(var g=0;g<d;g++){var h={ah:null,sampleSize:null,yf:null};c&256&&(h.ah=a.T());c&512&&(h.sampleSize=a.T());c&1024&&a.skip(4);c&2048&&(h.yf=0==b?a.T():a.Sg());e.push(h)}return{vm:d,$g:e,gg:f}}function Ci(a){a.skip(6);a.skip(2);a.skip(8);var b=a.Aa();a.skip(2);a.skip(2);a.skip(2);a=a.Aa()+a.Aa()/65536;return{channelCount:b,sampleRate:a}}function Di(a){a=a.T();return{codec:fh(a)}}
|
|
function Ei(a){var b=null,c=null,d=a.Sb(4);var e=String.fromCharCode(d[0]);e+=String.fromCharCode(d[1]);e+=String.fromCharCode(d[2]);e+=String.fromCharCode(d[3]);if("nclx"===e){switch(a.Aa()){case 1:case 5:case 6:case 7:b="srgb";break;case 9:b="rec2020";break;case 11:case 12:b="p3"}d=a.Aa();a.Aa();switch(d){case 1:case 6:case 13:case 14:case 15:c="SDR";break;case 16:c="PQ";break;case 18:c="HLG"}}return{colorGamut:b,le:c}}
|
|
function Fi(a,b){b=void 0===b?!1:b;a=a.toString(16).toUpperCase();return b?a:("0"+a).slice(-2)}function Gi(a){return(10>a?"0":"")+a};function Hi(a){if(!Ii){Ii=!0;var b=new Uint8Array([105,115,111,109]),c=new Uint8Array([97,118,99,49]),d=new Uint8Array([0,0,0,1]);Ji=Ki("ftyp",b,d,b,c);b=Ki("dref",Li);Mi=Ki("dinf",b)}this.g=a}
|
|
function Ni(a){for(var b=[],c=t(a.g),d=c.next();!d.done;d=c.next()){var e=b,f=e.push;var g=d.value;d=Ki;var h=g.id+1;var k=g.stream.width||0,l=g.stream.height||0;"audio"==g.type&&(l=k=0);var m=g.duration*g.timescale,n=Math.floor(m/(Oi+1));m=Math.floor(m%(Oi+1));h=new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3].concat(x(Pi(h,4)),[0,0,0,0],x(Pi(n,4)),x(Pi(m,4)),[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0],x(Pi(k,2)),[0,0],x(Pi(l,
|
|
2)),[0,0]));h=Ki("tkhd",h);k=Ki;n=g.duration*g.timescale;l=Math.floor(n/(Oi+1));n=Math.floor(n%(Oi+1));m=g.stream.language;m=m.charCodeAt(0)-96<<10|m.charCodeAt(1)-96<<5|m.charCodeAt(2)-96;l=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3].concat(x(Pi(g.timescale,4)),x(Pi(l,4)),x(Pi(n,4)),x(Pi(m,2)),[0,0]));l=Ki("mdhd",l);n=g;m=new Uint8Array([]);switch(n.type){case "video":m=Qi;break;case "audio":m=Ri}n=Ki("hdlr",m);a:{switch(g.type){case "video":g=Ki("minf",Ki("vmhd",Si),Mi,Ti(g));break a;
|
|
case "audio":g=Ki("minf",Ki("smhd",Ui),Mi,Ti(g));break a}g=new Uint8Array([])}g=k("mdia",l,n,g);d=d("trak",h,g);f.call(e,d)}b=pc.apply(jc,x(b));f=a.g[0];c=Ki;d=f.duration*f.timescale;e=Math.floor(d/(Oi+1));d=Math.floor(d%(Oi+1));e=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3].concat(x(Pi(f.timescale,4)),x(Pi(e,4)),x(Pi(d,4)),[0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,
|
|
255]));e=Ki("mvhd",e);d=[];a=t(a.g);for(k=a.next();!k.done;k=a.next())g=d,h=g.push,k=new Uint8Array([0,0,0,0].concat(x(Pi(k.value.id+1,4)),[0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),k=Ki("trex",k),h.call(g,k);a=pc.apply(jc,x(d));a=Ki("mvex",a);d=[];if(f.encrypted){f=t(f.stream.drmInfos);for(g=f.next();!g.done;g=f.next())if(g=g.value,g.initData)for(g=t(g.initData),h=g.next();!h.done;h=g.next())d.push(h.value.initData);f=pc.apply(jc,x(d))}else f=new Uint8Array([]);a=c("moov",e,b,a,f);b=new Uint8Array(Ji.byteLength+
|
|
a.byteLength);b.set(Ji);b.set(a,Ji.byteLength);return b}
|
|
function Ti(a){var b=Ki,c="aac";a.codecs.includes("mp3")?c="mp3":a.codecs.includes("ac-3")?c=qb().ae()?"ec-3":"ac-3":a.codecs.includes("ec-3")?c="ec-3":a.codecs.includes("opus")&&(c="opus");var d=new Uint8Array([]);switch(a.type){case "video":if(a.codecs.includes("avc1")){c=a.stream.width||0;d=a.stream.height||0;if(0<a.Na.byteLength)var e=Ki("avcC",a.Na);else{e=Ki;for(var f=7,g=[],h=[],k=0,l=0,m=0,n=0;n<a.zb.length;n++){var q=Vi(a.zb[n]);switch(q[0]&31){case 7:g.push(q);f+=q.length+2;break;case 8:h.push(q),
|
|
f+=q.length+2}}0<g.length&&(k=g[0][1],m=g[0][2],l=g[0][3]);f=new Uint8Array(f);n=0;f[n++]=1;f[n++]=k;f[n++]=m;f[n++]=l;f[n++]=255;f[n++]=224|g.length;for(k=0;k<g.length;k++)f[n++]=(g[k].length&65280)>>8,f[n++]=g[k].length&255,f.set(g[k],n),n+=g[k].length;f[n++]=h.length;for(g=0;g<h.length;g++)f[n++]=(h[g].length&65280)>>8,f[n++]=h[g].length&255,f.set(h[g],n),n+=h[g].length;e=e("avcC",f)}c=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].concat(x(Pi(c,2)),x(Pi(d,2)),[0,72,0,0,0,72,
|
|
0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]));d="avc1";h=Wi(a);g=new Uint8Array([]);a.encrypted&&(g=Xi(0,a.stream,a.codecs),d="encv");d=Ki(d,c,e,h,g)}else a.codecs.includes("hvc1")&&(d=a.stream.width||0,e=a.stream.height||0,c=new Uint8Array([]),0<a.Na.byteLength&&(c=Ki("hvcC",a.Na)),d=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].concat(x(Pi(d,2)),x(Pi(e,2)),[0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,
|
|
105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17])),e="hvc1",h=Wi(a),g=new Uint8Array([]),a.encrypted&&(g=Xi(0,a.stream,a.codecs),e="encv"),d=Ki(e,d,c,h,g));break;case "audio":if("mp3"==c)a=Ki(".mp3",Yi(a));else if("ac-3"==c)c=Ki("dac3",a.Da),d="ac-3",e=new Uint8Array([]),a.encrypted&&(e=Xi(0,a.stream,a.codecs),d="enca"),a=Ki(d,Yi(a),c,e);else if("ec-3"==c)c=Ki("dec3",a.Da),d="ec-3",e=new Uint8Array([]),a.encrypted&&(e=Xi(0,a.stream,a.codecs),
|
|
d="enca"),a=Ki(d,Yi(a),c,e);else if("opus"==c)c=Ki("dOps",a.Da),d="Opus",e=new Uint8Array([]),a.encrypted&&(e=Xi(0,a.stream,a.codecs),d="enca"),a=Ki(d,Yi(a),c,e);else{if(0<a.Da.byteLength)c=Ki("esds",a.Da);else{c=Ki;d=a.id+1;e=a.stream.channelsCount||2;g=a.stream.audioSamplingRate||44100;k=tc("audio",a.codecs.split(","));l={96E3:0,88200:1,64E3:2,48E3:3,44100:4,32E3:5,24E3:6,22050:7,16E3:8,12E3:9,11025:10,8E3:11,7350:12};h=l[g];if("mp4a.40.5"===k||"mp4a.40.29"===k)h=l[2*g];g=parseInt(k.split(".").pop(),
|
|
10);d=new Uint8Array([0,0,0,0,3,25].concat(x(Pi(d,2)),[0,4,17,64,21,0,0,0,0,0,0,0,0,0,0,0,5,2,g<<3|h>>>1,h<<7|e<<3,6,1,2]));c=c("esds",d)}d="mp4a";e=new Uint8Array([]);a.encrypted&&(e=Xi(0,a.stream,a.codecs),d="enca");a=Ki(d,Yi(a),c,e)}d=a}a=Ki("stsd",Zi,d);return b("stbl",a,Ki("stts",$i),Ki("stsc",aj),Ki("stsz",bj),Ki("stco",cj))}function Wi(a){if(!a.Wa&&!a.Xa)return new Uint8Array([]);var b=a.Xa;a=new Uint8Array([].concat(x(Pi(a.Wa,4)),x(Pi(b,4))));return Ki("pasp",a)}
|
|
function Yi(a){return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,a.stream.channelsCount||2,0,16,0,0,0,0].concat(x(Pi(a.stream.audioSamplingRate||44100,2)),[0,0]))}
|
|
function Xi(a,b,c){a=Ki;c=new Uint8Array([].concat(x(Pi(dj(c.split(".")[0]),4))));c=Ki("frma",c);var d="cenc";var e=b.drmInfos[0];e&&e.encryptionScheme&&(d=e.encryptionScheme);d=new Uint8Array([0,0,0,0].concat(x(Pi(dj(d),4)),[0,1,0,0]));d=Ki("schm",d);e=Ki;var f=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);b=t(b.drmInfos);for(var g=b.next();!g.done;g=b.next())if((g=g.value)&&g.keyIds&&g.keyIds.size){g=t(g.keyIds);for(var h=g.next();!h.done;h=g.next())f=Vi(h.value)}b=new Uint8Array([0,0,0,0,0,
|
|
0,1,8]);b=Ki("tenc",b,f);return a("sinf",c,d,e("schi",b))}
|
|
function ej(a){var b=[];a=t(a.g);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=b.push,e=d.apply;var f=Ki;var g=new Uint8Array([0,0,0,0].concat(x(Pi(c.data?c.data.Tb:0,4))));g=Ki("mfhd",g);var h;var k=c.data?c.data.xb:[];var l=new Uint8Array(4+k.length);for(h=0;h<k.length;h++){var m=k[h].flags;l[h+4]=m.ib<<4|m.kb<<2|m.jb}k=Ki("sdtp",l);var n=k.length+92;l=Ki;h=new Uint8Array([0,0,0,58].concat(x(Pi(c.id+1,4)),[0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0]));h=Ki("tfhd",h);m=c.data?c.data.baseMediaDecodeTime:
|
|
0;var q=Math.floor(m%(Oi+1));m=new Uint8Array([1,0,0,0].concat(x(Pi(Math.floor(m/(Oi+1)),4)),x(Pi(q,4))));m=Ki("tfdt",m);var r=n;n=c.data?c.data.xb:[];q=n.length;var u=12+16*q,w=new Uint8Array(u);r+=8+u;w.set(["video"===c.type?1:0,0,15,1].concat(x(Pi(q,4)),x(Pi(r,4))),0);for(r=0;r<q;r++){var v=n[r];u=Pi(v.duration,4);var y=Pi(v.size,4),z=v.flags;v=Pi(v.qb,4);w.set([].concat(x(u),x(y),[z.vb<<2|z.ib,z.kb<<6|z.jb<<4|z.wb,z.hb&61440,z.hb&15],x(v)),12+16*r)}n=Ki("trun",w);k=l("traf",h,m,n,k);f=f("moof",
|
|
g,k);e.call(d,b,[f,fj(c)])}return pc.apply(jc,x(b))}function fj(a){a=(a.data?a.data.xb:[]).map(function(b){return b.data});a=pc.apply(jc,x(a));return Ki("mdat",a)}function Pi(a,b){var c=[];for(--b;0<=b;b--)c.push(a>>8*b&255);return c}function Vi(a){for(var b=new Uint8Array(a.length/2),c=0;c<a.length/2;c+=1)b[c]=parseInt(String(a[2*c]+a[2*c+1]),16);return b}function dj(a){for(var b=0,c=0;c<a.length;c+=1)b|=a.charCodeAt(c)<<8*(a.length-c-1);return b}
|
|
function Ki(a){var b=Oa.apply(1,arguments),c=gj.get(a);c||(c=[a.charCodeAt(0),a.charCodeAt(1),a.charCodeAt(2),a.charCodeAt(3)],gj.set(a,c));for(var d=8,e=b.length-1;0<=e;e--)d+=b[e].byteLength;e=new Uint8Array(d);e[0]=d>>24&255;e[1]=d>>16&255;e[2]=d>>8&255;e[3]=d&255;e.set(c,4);c=0;for(d=8;c<b.length;c++)e.set(b[c],d),d+=b[c].byteLength;return e}
|
|
var Ii=!1,Oi=Math.pow(2,32)-1,gj=new Map,Qi=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),Ri=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),$i=new Uint8Array([0,0,0,0,0,0,0,0]),aj=new Uint8Array([0,0,0,0,0,0,0,0]),cj=new Uint8Array([0,0,0,0,0,0,0,0]),bj=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Si=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),Ui=new Uint8Array([0,
|
|
0,0,0,0,0,0,0]),Zi=new Uint8Array([0,0,0,0,0,0,0,1]),Ji=new Uint8Array([]),Li=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),Mi=new Uint8Array([]);function hj(a){a=Tb(a);var b=null;(new bh).box("moov",gh).box("trak",gh).box("mdia",gh).box("minf",gh).box("stbl",gh).R("stsd",ih).box("enca",function(c){b=c.reader.h;return kh(c)}).box("sinf",gh).box("frma",function(c){c.parser.stop();"ec-3"===Di(c.reader).codec&&b&&2!==b.getUint16(16)&&b.setUint16(16,2)}).parse(a);return a}
|
|
function ij(a,b,c){function d(r){n.push({box:r,li:1701733217})}function e(r){n.push({box:r,li:1701733238})}function f(r){k=!0;r.parser.stop()}function g(r){m.push(r);gh(r)}var h=b=Tb(b),k=!1,l,m=[],n=[];(new bh).box("moov",g).box("trak",g).box("mdia",g).box("minf",g).box("stbl",g).R("stsd",function(r){l=r;m.push(r);ih(r)}).R("encv",f).R("enca",f).R("dvav",e).R("dva1",e).R("dvh1",e).R("dvhe",e).R("dvc1",e).R("dvi1",e).R("hev1",e).R("hvc1",e).R("avc1",e).R("avc3",e).R("ac-3",d).R("ec-3",d).R("ac-4",
|
|
d).R("Opus",d).R("fLaC",d).R("mp4a",d).parse(b);if(k)return b;if(0==n.length||!l)throw gb(oc(b)),new U(2,3,3019,c);n.reverse();c=t(n);for(var q=c.next();!q.done;q=c.next())q=q.value,h=jj(a,h,l,q.box,m,q.li);return qb().wi()?(a=new Uint8Array(b.byteLength+h.byteLength),a.set(h),a.set(b,h.byteLength),a):h}
|
|
function kj(a){a=Tb(a);var b=[];(new bh).box("mdat",function(g){b.push(g)}).parse(a);for(var c=[],d=0;d<b.length;d++){var e=b[d-1],f=b[d];c.push(lj(a.subarray(e?e.start+e.size:0,f.start+f.size)))}return pc.apply(jc,x(c))}
|
|
function lj(a){function b(n){g.push(n);gh(n)}var c,d,e,f,g=[];(new bh).box("moof",b).box("traf",b).R("tfhd",function(n){c=n;e=yi(n.reader,n.flags)}).R("trun",function(n){d=n;f=Bi(n.reader,n.version,n.flags)}).parse(a);if(e&&2!==e.Ci){var h=c.start+hh(c)+4+(null!==e.dj?8:0),k=Yb(a);if(null!==e.Ci)k.setUint32(h,2);else{mj(a,c.start,c.size+4);var l=k.getUint32(c.start+8);k.setUint32(c.start+8,l|2);f&&null!==f.gg&&k.setInt32(d.start+hh(d)+4,f.gg+4);l=a.subarray(0,h);k=a.subarray(h);a=new Uint8Array(a.byteLength+
|
|
4);a.set(l);l=[];for(var m=3;0<=m;m--)l.push(2>>8*m&255);a.set(new Uint8Array(l),h);a.set(k,h+4);h=t(g);for(k=h.next();!k.done;k=h.next())k=k.value,mj(a,k.start,k.size+4)}}return a}
|
|
function jj(a,b,c,d,e,f){var g=Xi(new Hi([]),a,d.name),h=b.subarray(d.start,d.start+d.size);a=new Uint8Array(d.size+g.byteLength);a.set(h,0);Yb(a).setUint32(4,f);a.set(g,d.size);mj(a,0,a.byteLength);f=new Uint8Array(b.byteLength+a.byteLength);d=qb().Ze()?d.start:d.start+d.size;g=b.subarray(d);f.set(b.subarray(0,d));f.set(a,d);f.set(g,d+a.byteLength);b=t(e);for(e=b.next();!e.done;e=b.next())e=e.value,mj(f,e.start,e.size+a.byteLength);a=Yb(f,c.start);c=hh(c);b=a.getUint32(c);a.setUint32(c,b+1);return f}
|
|
function mj(a,b,c){a=Yb(a,b);b=a.getUint32(0);0!=b&&(1==b?(a.setUint32(8,c>>32),a.setUint32(12,c&4294967295)):a.setUint32(0,c))}
|
|
function nj(a){function b(e){d.push({start:e.start,size:e.size});gh(e)}var c=Tb(a),d=[];(new bh).box("moov",b).box("trak",b).box("mdia",b).box("minf",b).box("stbl",b).box("stsd",function(e){d.push({start:e.start,size:e.size});for(var f=Yb(c,e.start),g=0;g<e.size-3;g++){var h=f.getUint32(g);1633889587==h?f.setUint32(g,1700998451):1684103987==h&&f.setUint32(g,1684366131)}}).parse(c);return c};function oj(a,b,c,d,e,f,g,h){this.O=a;this.startByte=b;this.endByte=c;this.nd=void 0===d?null:d;this.timescale=void 0===e?null:e;this.h=void 0===f?null:f;this.aesKey=void 0===g?null:g;this.g=this.mimeType=this.codecs=null;this.encrypted=void 0===h?!1:h}oj.prototype.wc=function(){return this.startByte};oj.prototype.uc=function(){return this.endByte};oj.prototype.ee=function(a){this.h=a};oj.prototype.Wb=function(){return this.h};
|
|
function pj(a,b){return a===b?!0:a&&b?a.wc()==b.wc()&&a.uc()==b.uc()&&Wc(a.O().sort(),b.O().sort())&&Sb(a.Wb(),b.Wb()):a==b}T("shaka.media.InitSegmentReference",oj);oj.prototype.getEndByte=oj.prototype.uc;oj.prototype.getStartByte=oj.prototype.wc;
|
|
function qj(a,b,c,d,e,f,g,h,k,l,m,n,q,r,u,w){l=void 0===l?[]:l;r=void 0===r?rj:r;this.startTime=a;this.j=this.endTime=b;this.C=c;this.startByte=d;this.endByte=e;this.Z=f;this.timestampOffset=g;this.appendWindowStart=h;this.appendWindowEnd=k;this.g=l;this.tilesLayout=void 0===m?"":m;this.B=void 0===n?null:n;this.h=void 0===q?null:q;this.status=r;this.preload=!1;this.l=!0;this.m=!1;this.aesKey=void 0===u?null:u;this.thumbnailSprite=null;this.i=-1;this.A=void 0===w?!1:w;this.F=this.o=!1;a=t(this.g);
|
|
for(b=a.next();!b.done;b=a.next())b.value.gi();this.A&&this.g.length&&this.g[this.g.length-1].ei();this.s=this.bandwidth=this.mimeType=this.codecs=null;this.G=!1}p=qj.prototype;p.O=function(){return this.C()};p.getStartTime=function(){return this.startTime};p.wj=function(){return this.endTime};p.wc=function(){return this.startByte};p.uc=function(){return this.endByte};p.Sj=function(){return this.tilesLayout};p.Rj=function(){return this.B};p.xc=function(){return this.status};
|
|
p.lk=function(){this.status=sj};p.Kg=function(){this.preload=!0};p.isPreload=function(){return this.preload};p.md=function(){this.l=!1};p.ck=function(){return this.l};p.gi=function(){this.o=!0};p.ek=function(){return this.o};p.ei=function(){this.F=!0};p.dk=function(){return this.F};p.di=function(){this.m=!0};p.Yj=function(){return this.m};p.Cf=function(a){this.thumbnailSprite=a};p.Pj=function(){return this.thumbnailSprite};
|
|
p.offset=function(a){this.startTime+=a;this.endTime+=a;this.j+=a;for(var b=t(this.g),c=b.next();!c.done;c=b.next())c=c.value,c.startTime+=a,c.endTime+=a,c.j+=a};p.ph=function(a){null==this.h?ab("Sync attempted without sync time!"):(a=this.h-a-this.startTime,.001<=Math.abs(a)&&this.offset(a))};p.ee=function(a,b){this.s=a;this.G=void 0===b?!1:b};p.Wb=function(a){var b=this.s;(void 0===a||a)&&this.G&&(this.s=null);return b};
|
|
function tj(a,b){a.Z=b;a=t(a.g);for(var c=a.next();!c.done;c=a.next())tj(c.value,b)}T("shaka.media.SegmentReference",qj);qj.prototype.getSegmentData=qj.prototype.Wb;qj.prototype.setSegmentData=qj.prototype.ee;qj.prototype.syncAgainst=qj.prototype.ph;qj.prototype.offset=qj.prototype.offset;qj.prototype.getThumbnailSprite=qj.prototype.Pj;qj.prototype.setThumbnailSprite=qj.prototype.Cf;qj.prototype.hasByterangeOptimization=qj.prototype.Yj;qj.prototype.markAsByterangeOptimization=qj.prototype.di;
|
|
qj.prototype.isLastPartial=qj.prototype.dk;qj.prototype.markAsLastPartial=qj.prototype.ei;qj.prototype.isPartial=qj.prototype.ek;qj.prototype.markAsPartial=qj.prototype.gi;qj.prototype.isIndependent=qj.prototype.ck;qj.prototype.markAsNonIndependent=qj.prototype.md;qj.prototype.isPreload=qj.prototype.isPreload;qj.prototype.markAsPreload=qj.prototype.Kg;qj.prototype.markAsUnavailable=qj.prototype.lk;qj.prototype.getStatus=qj.prototype.xc;qj.prototype.getTileDuration=qj.prototype.Rj;
|
|
qj.prototype.getTilesLayout=qj.prototype.Sj;qj.prototype.getEndByte=qj.prototype.uc;qj.prototype.getStartByte=qj.prototype.wc;qj.prototype.getEndTime=qj.prototype.wj;qj.prototype.getStartTime=qj.prototype.getStartTime;qj.prototype.getUris=qj.prototype.O;var rj=0,sj=1;qj.Status={cl:rj,om:sj,Nl:2};function uj(a){return 1==a.length&&1E-4>a.end(0)-a.start(0)}function vj(a){return!a||uj(a)?null:a.length?a.end(a.length-1):null}function wj(a,b){return!a||!a.length||uj(a)||b>a.end(a.length-1)?!1:b>=a.start(0)}function xj(a,b){if(!a||!a.length||uj(a))return 0;var c=0;a=t(yj(a));for(var d=a.next();!d.done;d=a.next()){var e=d.value;d=e.start;e=e.end;e>b&&(c+=e-Math.max(d,b))}return c}
|
|
function zj(a,b,c){if(!a||!a.length||uj(a))return null;a=yj(a).findIndex(function(d,e,f){return d.start>b&&(0==e||f[e-1].end-b<=c)});return 0<=a?a:null}function yj(a){if(!a)return[];for(var b=[],c=0;c<a.length;c++)b.push({start:a.start(c),end:a.end(c)});return b};function Aj(){}function Bj(a,b){var c=document.createElement("source");c.src=a;c.type=void 0===b?"":b;return c}function Cj(a){for(var b=!1,c=a.getElementsByTagName("source"),d=c.length-1;0<=d;--d)a.removeChild(c[d]),b=!0;a.src&&(a.removeAttribute("src"),b=!0);return b}function Dj(a){for(;a.firstChild;)a.removeChild(a.firstChild)}
|
|
function wi(){if(Ej)return Ej;Fj||(Fj=new $e(function(){Ej=null}));(Ej=document.getElementsByTagName("video")[0]||document.getElementsByTagName("audio")[0])||(Ej=document.createElement("video"));Fj.ha(1);return Ej}
|
|
function Gj(a,b){var c,d,e,f,g;return Q(function(h){if(1==h.g)return"fonts"in document&&"FontFace"in window?F(h,document.fonts.ready,2):h.return();if(!("entries"in document.fonts))return h.return();c=function(k){k=k.entries();for(var l=[],m=k.next();!1===m.done;)l.push(m.value),m=k.next();return l};d=t(c(document.fonts));for(e=d.next();!e.done;e=d.next())if(f=e.value,f.family===a&&"swap"===f.display)return h.return();g=new FontFace(a,"url("+b+")",{display:"swap"});document.fonts.add(g);G(h)})}
|
|
T("shaka.util.Dom",Aj);Aj.removeAllChildren=Dj;Aj.clearSourceFromVideo=Cj;var Fj=null,Ej=null;/*
|
|
@license
|
|
Shaka Player
|
|
Copyright 2022 Google LLC
|
|
SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
function Hj(){}function Ij(a,b){return b+10<=a.length&&73===a[b]&&68===a[b+1]&&51===a[b+2]&&255>a[b+3]&&255>a[b+4]&&128>a[b+6]&&128>a[b+7]&&128>a[b+8]&&128>a[b+9]?!0:!1}function Jj(a,b){return b+10<=a.length&&51===a[b]&&68===a[b+1]&&73===a[b+2]&&255>a[b+3]&&255>a[b+4]&&128>a[b+6]&&128>a[b+7]&&128>a[b+8]&&128>a[b+9]?!0:!1}function Kj(a,b){var c=(a[b]&127)<<21;c|=(a[b+1]&127)<<14;c|=(a[b+2]&127)<<7;return c|=a[b+3]&127}
|
|
function Lj(a){var b={key:a.type,description:"",data:"",mimeType:null,pictureType:null};if("APIC"===a.type){if(2>a.size||3!==a.data[0])return null;var c=a.data.subarray(1).indexOf(0);if(-1===c)return null;var d=ac(Tb(a.data,1,c)),e=a.data[2+c],f=a.data.subarray(3+c).indexOf(0);if(-1===f)return null;var g=ac(Tb(a.data,3+c,f)),h;"--\x3e"===d?h=ac(Tb(a.data,4+c+f)):h=Ub(a.data.subarray(4+c+f));b.mimeType=d;b.pictureType=e;b.description=g;b.data=h;return b}if("TXXX"===a.type){if(2>a.size||3!==a.data[0])return null;
|
|
d=a.data.subarray(1).indexOf(0);if(-1===d)return null;c=ac(Tb(a.data,1,d));a=ac(Tb(a.data,2+d)).replace(/\0*$/,"");b.description=c;b.data=a;return b}if("WXXX"===a.type){if(2>a.size||3!==a.data[0])return null;d=a.data.subarray(1).indexOf(0);if(-1===d)return null;c=ac(Tb(a.data,1,d));a=ac(Tb(a.data,2+d)).replace(/\0*$/,"");b.description=c;b.data=a;return b}if("PRIV"===a.type){if(2>a.size)return null;c=a.data.indexOf(0);if(-1===c)return null;c=ac(Tb(a.data,0,c));b.description=c;"com.apple.streaming.transportStreamTimestamp"==
|
|
c?(c=a.data.subarray(c.length+1),a=c[3]&1,c=(c[4]<<23)+(c[5]<<15)+(c[6]<<7)+c[7],c/=45,a&&(c+=4.772185884E7),b.data=c):(a=Ub(a.data.subarray(c.length+1)),b.data=a);return b}if("T"===a.type[0]){if(2>a.size||3!==a.data[0])return null;a=ac(a.data.subarray(1)).replace(/\0*$/,"");b.data=a;return b}return"W"===a.type[0]?(a=ac(a.data).replace(/\0*$/,""),b.data=a,b):a.data?(b.data=Ub(a.data),b):null}
|
|
function Mj(a){for(var b=0,c=[];Ij(a,b);){var d=Kj(a,b+6);a[b+5]>>6&1&&(b+=10);b+=10;for(d=b+d;b+10<d;){var e=a.subarray(b),f=Kj(e,4);e={type:String.fromCharCode(e[0],e[1],e[2],e[3]),size:f,data:e.subarray(10,10+f)};(f=Lj(e))&&c.push(f);b+=e.size+10}Jj(a,b)&&(b+=10)}return c}function Nj(a,b){for(var c=b=void 0===b?0:b,d=0;Ij(a,b);)a[b+5]>>6&1&&(d+=10),d+=10,d+=Kj(a,b+6),Jj(a,b+10)&&(d+=10),b+=d;return 0<d?a.subarray(c,c+d):new Uint8Array([])}T("shaka.util.Id3Utils",Hj);Hj.getID3Data=Nj;
|
|
Hj.getID3Frames=Mj;function Oj(a){return(new Date(Date.UTC(1900,0,1,0,0,0,0)+a)).getTime()};/*
|
|
|
|
Copyright Brightcove, Inc.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/
|
|
function Pj(a,b){this.j=a;if(void 0===b?0:b){b=new Uint8Array(a.byteLength);for(var c=0,d=0;d<a.byteLength;d++)2<=d&&3==a[d]&&0==a[d-1]&&0==a[d-2]||(b[c]=a[d],c++);this.j=Tb(b,0,c)}this.i=this.j.byteLength;this.g=this.h=0}function Qj(a){var b=a.j.byteLength-a.i,c=new Uint8Array(4),d=Math.min(4,a.i);0!==d&&(c.set(a.j.subarray(b,b+d)),a.h=(new Zg(c,0)).T(),a.g=8*d,a.i-=d)}function Rj(a,b){if(a.g<=b){b-=a.g;var c=Math.floor(b/8);b-=8*c;a.g-=c;Qj(a)}a.h<<=b;a.g-=b}
|
|
function Sj(a,b){var c=Math.min(a.g,b),d=a.h>>>32-c;a.g-=c;0<a.g?a.h<<=c:0<a.i&&Qj(a);c=b-c;return 0<c?d<<c|Sj(a,c):d}function Tj(a){var b;for(b=0;b<a.g;++b)if(0!==(a.h&2147483648>>>b))return a.h<<=b,a.g-=b,b;Qj(a);return b+Tj(a)}function Uj(a){Rj(a,1+Tj(a))}function X(a){var b=Tj(a);return Sj(a,b+1)-1}function Vj(a){a=X(a);return 1&a?1+a>>>1:-1*(a>>>1)}function Wj(a){return 1===Sj(a,1)}function Xj(a){return Sj(a,8)}
|
|
function Yj(a,b){for(var c=8,d=8,e=0;e<b;e++)0!==d&&(d=Vj(a),d=(c+d+256)%256),c=0===d?c:d}function Zj(a){Xj(a);X(a);return X(a)}T("shaka.util.ExpGolomb",Pj);function ak(){this.G=null;this.H=!1;this.m=this.I=null;this.j=[];this.g=[];this.A=this.B=null;this.i=[];this.h=[];this.C=null;this.l=[];this.F=this.o=this.s=null}p=ak.prototype;p.clearData=function(){this.j=[];this.g=[];this.i=[];this.h=[];this.l=[]};
|
|
p.parse=function(a){if(564>a.length)return this;for(var b=Math.max(0,bk(a)),c=a.length-(a.length+b)%188,d=!1,e=b;e<c;e+=188)if(71==a[e]){var f=!!(a[e+1]&64),g=((a[e+1]&31)<<8)+a[e+2];if(1<(a[e+3]&48)>>4){var h=e+5+a[e+4];if(h==e+188)continue}else h=e+4;switch(g){case 0:f&&(h+=a[h]+1);this.G=(a[h+10]&31)<<8|a[h+11];break;case 17:case 8191:break;case this.G:f&&(h+=a[h]+1);f=a;g={audio:-1,video:-1,Xe:-1,audioCodec:"",videoCodec:""};var k=h+3+((f[h+1]&15)<<8|f[h+2])-4;for(h+=12+((f[h+10]&15)<<8|f[h+11]);h<
|
|
k;){var l=(f[h+1]&31)<<8|f[h+2],m=(f[h+3]&15)<<8|f[h+4];switch(f[h]){case 6:if(0<m)for(var n=h+5,q=m;2<q;){var r=f[n+1]+2;switch(f[n]){case 5:var u=cc(f.subarray(n+2,n+r));-1==g.audio&&"Opus"===u?(g.audio=l,g.audioCodec="opus"):-1==g.video&&"AV01"===u&&(g.video=l,g.videoCodec="av1");break;case 106:-1==g.audio&&(g.audio=l,g.audioCodec="ac3");break;case 122:-1==g.audio&&(g.audio=l,g.audioCodec="ec3");break;case 124:-1==g.audio&&(g.audio=l,g.audioCodec="aac");break;case 127:"opus"==g.audioCodec&&(u=
|
|
null,128===f[n+2]&&(u=f[n+3]),null!=u&&(this.F={channelCount:0===(u&15)?2:u&15,gj:u,sampleRate:48E3}))}n+=r;q-=r}break;case 15:-1==g.audio&&(g.audio=l,g.audioCodec="aac");break;case 17:-1==g.audio&&(g.audio=l,g.audioCodec="aac-loas");break;case 21:-1==g.Xe&&(g.Xe=l);break;case 27:-1==g.video&&(g.video=l,g.videoCodec="avc");break;case 3:case 4:-1==g.audio&&(g.audio=l,g.audioCodec="mp3");break;case 36:-1==g.video&&(g.video=l,g.videoCodec="hvc");break;case 129:-1==g.audio&&(g.audio=l,g.audioCodec="ac3");
|
|
break;case 132:case 135:-1==g.audio&&(g.audio=l,g.audioCodec="ec3")}h+=m+5}f=g;-1!=f.video&&(this.I=f.video,this.m=f.videoCodec);-1!=f.audio&&(this.B=f.audio,this.A=f.audioCodec);-1!=f.Xe&&(this.C=f.Xe);d&&!this.H&&(d=!1,e=b-188);this.H=!0;break;case this.I:h=a.subarray(h,e+188);f?this.j.push([h]):this.j.length&&this.j[this.j.length-1]&&this.j[this.j.length-1].push(h);break;case this.B:h=a.subarray(h,e+188);f?this.i.push([h]):this.i.length&&this.i[this.i.length-1]&&this.i[this.i.length-1].push(h);
|
|
break;case this.C:h=a.subarray(h,e+188);f?this.l.push([h]):this.l.length&&this.l[this.l.length-1]&&this.l[this.l.length-1].push(h);break;default:d=!0}}return this};
|
|
function ck(a,b){if(1!==(b[0]<<16|b[1]<<8|b[2]))return null;var c={data:new Uint8Array(0),packetLength:b[4]<<8|b[5],pts:null,dts:null,nalus:[]};if(c.packetLength&&c.packetLength>b.byteLength-6)return null;var d=b[7];if(d&192){var e=536870912*(b[9]&14)+4194304*(b[10]&255)+16384*(b[11]&254)+128*(b[12]&255)+(b[13]&254)/2;null==a.s&&(a.s=e);c.pts=dk(e,a.s);a.s=c.pts;c.dts=c.pts;d&64&&(d=536870912*(b[14]&14)+4194304*(b[15]&255)+16384*(b[16]&254)+128*(b[17]&255)+(b[18]&254)/2,null==a.o&&(a.o=d),c.dts=dk(d,
|
|
a.o));a.o=c.dts}a=b[8]+9;if(b.byteLength<=a)return null;c.data=b.subarray(a);return c}p.wk=function(a){wb("TsParser.parseAvcNalus","Please use parseNalus function instead.");return this.Pg(a,{Wd:null,state:null})};
|
|
p.Pg=function(a,b){var c=a.pts?a.pts/9E4:null;a=a.data;var d=a.byteLength,e=1;"hvc"==this.m&&(e=2);var f=b.state||0,g=f,h=0,k=[],l=-1,m=0;-1==f&&(l=0,m="hvc"==this.m?a[0]>>1&63:a[0]&31,f=0,h=1);for(;h<d;){var n=a[h++];if(f)if(1===f)f=n?0:2;else if(n)if(1==n){n=h-f-1;if(0<=l)k.push({data:a.subarray(l+e,n),fullData:a.subarray(l,n),type:m,time:c,state:null});else if(f=k.length?k[k.length-1]:b.Wd)g&&h<=4-g&&f.state&&(f.data=f.data.subarray(0,f.data.byteLength-g),f.fullData=f.fullData.subarray(0,f.fullData.byteLength-
|
|
g)),0<n&&(n=a.subarray(0,n),f.data=pc(f.data,n),f.fullData=pc(f.fullData,n),f.state=0);h<d?(m="hvc"==this.m?a[h]>>1&63:a[h]&31,l=h,f=0):f=-1}else f=0;else f=3;else f=n?0:1}0<=l&&0<=f&&k.push({data:a.subarray(l+e,d),fullData:a.subarray(l,d),type:m,time:c,state:f});!k.length&&b.Wd&&(c=k.length?k[k.length-1]:b.Wd)&&(c.data=pc(c.data,a),c.fullData=pc(c.fullData,a));b.state=f;return k};
|
|
p.getMetadata=function(){for(var a=[],b=t(this.l),c=b.next();!c.done;c=b.next())c=pc.apply(jc,x(c.value)),(c=ck(this,c))&&a.push({cueTime:c.pts?c.pts/9E4:null,data:c.data,frames:Mj(c.data),dts:c.dts,pts:c.pts});return a};
|
|
p.rb=function(){if(this.i.length&&!this.h.length){for(var a=!1,b=t(this.i),c=b.next();!c.done;c=b.next()){var d=pc.apply(jc,x(c.value)),e=ck(this,d);c=this.h.length?this.h[this.h.length-1]:null;e&&null!=e.pts&&null!=e.dts&&(!c||c.pts!=e.pts&&c.dts!=e.dts)?(this.h.length&&e.dts<(c.dts||0)&&(a=!0),this.h.push(e)):this.h.length&&(d=e?e.data:d)&&(c=this.h.pop(),c.data=pc(c.data,d),this.h.push(c))}a&&(this.h=this.h.sort(function(f,g){var h=(f.pts||0)-(g.pts||0);return(f.dts||0)-(g.dts||0)||h}))}return this.h};
|
|
p.Mc=function(a){a=void 0===a?!0:a;if(this.j.length&&!this.g.length){for(var b=!1,c=t(this.j),d=c.next();!d.done;d=c.next()){var e=pc.apply(jc,x(d.value)),f=ck(this,e);d=this.g.length?this.g[this.g.length-1]:null;f&&null!=f.pts&&null!=f.dts&&(!d||d.pts!=f.pts&&d.dts!=f.dts)?(this.g.length&&f.dts<(d.dts||0)&&(b=!0),this.g.push(f)):this.g.length&&(e=f?f.data:e)&&(d=this.g.pop(),d.data=pc(d.data,e),this.g.push(d))}if(a){c={Wd:null,state:null};d=[];e=t(this.g);for(f=e.next();!f.done;f=e.next())f=f.value,
|
|
f.nalus=this.Pg(f,c),f.nalus.length&&(d.push(f),c.Wd=f.nalus[f.nalus.length-1]);this.g=d}b&&(this.g=this.g.sort(function(g,h){var k=(g.pts||0)-(h.pts||0);return(g.dts||0)-(h.dts||0)||k}))}return a?this.g:(a=this.g,this.g=[],a)};p.getStartTime=function(a){if("audio"==a){a=null;var b=this.rb();b.length&&(a=b[0],a=Math.min(a.dts,a.pts)/9E4);return a}return"video"==a?(a=null,b=this.Mc(!1),b.length&&(a=b[0],a=Math.min(a.dts,a.pts)/9E4),a):null};p.Ld=function(){return{audio:this.A,video:this.m}};
|
|
p.We=function(){for(var a=[],b=t(this.Mc()),c=b.next();!c.done;c=b.next())a.push.apply(a,x(c.value.nalus));return a};p.Vj=function(){wb("TsParser.getVideoResolution","Please use getVideoInfo function instead.");var a=this.Cg();return{height:a.height,width:a.width}};p.Cg=function(){return"hvc"==this.m?mk(this):nk(this)};function ok(a){var b=a.Mc();return 1<b.length&&(a=b[0].pts,b=b[1].pts,!isNaN(b-a))?String(1/(b-a)*9E4):null}
|
|
function nk(a){var b={height:null,width:null,codec:null,frameRate:null},c=a.We();if(!c.length)return b;c=c.find(function(r){return 7==r.type});if(!c)return b;c=new Pj(c.data);var d=Xj(c),e=Xj(c),f=Xj(c);Uj(c);if(pk.includes(d)){var g=X(c);3===g&&Rj(c,1);Uj(c);Uj(c);Rj(c,1);if(Wj(c)){g=3!==g?8:12;for(var h=0;h<g;h++)Wj(c)&&(6>h?Yj(c,16):Yj(c,64))}}Uj(c);g=X(c);if(0===g)X(c);else if(1===g)for(Rj(c,1),Uj(c),Uj(c),g=X(c),h=0;h<g;h++)Uj(c);Uj(c);Rj(c,1);g=X(c);h=X(c);var k=Sj(c,1);0===k&&Rj(c,1);Rj(c,
|
|
1);var l=0,m=0,n=0,q=0;Wj(c)&&(l=X(c),m=X(c),n=X(c),q=X(c));b.height=String((2-k)*(h+1)*16-2*n-2*q);b.width=String(16*(g+1)-2*l-2*m);b.codec="avc1."+("0"+d.toString(16).toUpperCase()).slice(-2)+("0"+e.toString(16).toUpperCase()).slice(-2)+("0"+f.toString(16).toUpperCase()).slice(-2);b.frameRate=ok(a);return b}
|
|
function mk(a){var b={height:null,width:null,codec:null,frameRate:null},c=a.We();if(!c.length)return b;c=c.find(function(E){return 33==E.type});if(!c)return b;var d=new Pj(c.fullData,!0);Xj(d);Xj(d);Sj(d,4);var e=Sj(d,3);Wj(d);var f=Sj(d,2),g=Sj(d,1),h=Sj(d,5),k=Sj(d,32);c=Xj(d);for(var l=Xj(d),m=Xj(d),n=Xj(d),q=Xj(d),r=Xj(d),u=Xj(d),w=[],v=[],y=0;y<e;y++)w.push(Wj(d)),v.push(Wj(d));if(0<e)for(y=e;8>y;y++)Sj(d,2);for(y=0;y<e;y++)w[y]&&Sj(d,88),v[y]&&Xj(d);X(d);e=X(d);3==e&&Sj(d,1);w=X(d);v=X(d);var z=
|
|
y=0,A=0,B=0;Wj(d)&&(y+=X(d),z+=X(d),A+=X(d),B+=X(d));b.width=String(w-(y+z)*(1===e||2===e?2:1));b.height=String(v-(A+B)*(1===e?2:1));d=function(E){for(var H=0,C=0;32>C;C++)H|=(E>>C&1)<<31-C;return H>>>0}(k);g=1==g?"H":"L";f="hvc1"+("."+["","A","B","C"][f]+h);f+="."+d.toString(16).toUpperCase();f+="."+g+u;r&&(f+="."+r.toString(16).toUpperCase());q&&(f+="."+q.toString(16).toUpperCase());n&&(f+="."+n.toString(16).toUpperCase());m&&(f+="."+m.toString(16).toUpperCase());l&&(f+="."+l.toString(16).toUpperCase());
|
|
c&&(f+="."+c.toString(16).toUpperCase());b.codec=f;b.frameRate=ok(a);return b}function dk(a,b){var c=1;for(a>b&&(c=-1);4294967296<Math.abs(b-a);)a+=8589934592*c;return a}function qk(a){return 0>bk(a)?!1:!0}function bk(a){for(var b=Math.min(1E3,a.length-564),c=0;c<b;){if(71==a[c]&&71==a[c+188]&&71==a[c+376])return c;c++}return-1}T("shaka.util.TsParser",ak);ak.syncOffset=bk;ak.probe=qk;ak.prototype.getVideoInfo=ak.prototype.Cg;ak.prototype.getVideoResolution=ak.prototype.Vj;
|
|
ak.prototype.getVideoNalus=ak.prototype.We;ak.prototype.getCodecs=ak.prototype.Ld;ak.prototype.getStartTime=ak.prototype.getStartTime;ak.prototype.getVideoData=ak.prototype.Mc;ak.prototype.getAudioData=ak.prototype.rb;ak.prototype.getMetadata=ak.prototype.getMetadata;ak.prototype.parseNalus=ak.prototype.Pg;ak.prototype.parseAvcNalus=ak.prototype.wk;ak.prototype.parse=ak.prototype.parse;ak.prototype.clearData=ak.prototype.clearData;ak.Timescale=9E4;
|
|
var pk=[100,110,122,244,44,83,86,118,128,138,139,134];function rk(a,b,c,d,e){var f=this;this.g=a;this.N=c;this.s=d;this.ia=b;this.l=new Map;this.B=new Map;this.Ya=new Map;this.h=null;this.Ka=!1;this.M=e||null;this.o=new Map;this.A=new jb;this.j=new Map;this.I=null;this.K=new tg;this.Ba="";this.eb=!1;this.xa=!0;this.L=!1;this.C=this.P=null;this.i=sk(this,this.K);this.Pa=this.G=!1;this.H=new Tg(function(){return tk(f)});this.F=!1;this.S="UNKNOWN";this.Za=this.ab=!1;this.Ua=new tg;this.m=!1;this.va=null;this.$=new Map;this.oa=this.U=this.ua=this.W=null;
|
|
this.ka=new tg;this.g.remote&&(this.L="disconnected"!=this.g.remote.state,this.A.D(this.g.remote,"connect",function(){f.L="disconnected"!=f.g.remote.state}),this.A.D(this.g.remote,"connecting",function(){f.L="disconnected"!=f.g.remote.state}),this.A.D(this.g.remote,"disconnect",function(){f.L="disconnected"!=f.g.remote.state}))}
|
|
function sk(a,b){a.xa=!0;if(window.ManagedMediaSource){a.C||(a.g.disableRemotePlayback=!0);var c=new ManagedMediaSource;a.A.D(c,"startstreaming",function(){a.xa=!0});a.A.D(c,"endstreaming",function(){a.xa=!1})}else c=new MediaSource;a.A.za(c,"sourceopen",function(){URL.revokeObjectURL(a.Ba);b.resolve()});a.A.za(a.g,"playing",function(){a.eb=!0});a.Ba=uk(c);a.s.useSourceElements?(a.g.removeAttribute("src"),a.P&&a.g.removeChild(a.P),a.C&&a.g.removeChild(a.C),a.P=Bj(a.Ba),a.g.appendChild(a.P),a.C&&a.g.appendChild(a.C),
|
|
a.g.load()):a.g.src=a.Ba;return c}function vk(a,b,c){a.g&&window.ManagedMediaSource&&a.i&&a.s.useSourceElements&&(a.C&&a.g.removeChild(a.C),a.C=Bj(b,c),a.g.appendChild(a.C),a.g.disableRemotePlayback=!1)}
|
|
function wk(){var a='video/mp4; codecs="avc1.42E01E",video/mp4; codecs="avc3.42E01E",video/mp4; codecs="hev1.1.6.L93.90",video/mp4; codecs="hvc1.1.6.L93.90",video/mp4; codecs="hev1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="hvc1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="vp9",video/mp4; codecs="vp09.00.10.08",video/mp4; codecs="av01.0.01M.08",video/mp4; codecs="dvh1.05.01",video/mp4; codecs="dvh1.20.01",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",audio/mp4; codecs="ac-4.02.01.01",audio/mp4; codecs="opus",audio/mp4; codecs="flac",audio/mp4; codecs="dtsc",audio/mp4; codecs="dtse",audio/mp4; codecs="dtsx",video/webm; codecs="vp8",video/webm; codecs="vp9",video/webm; codecs="vp09.00.10.08",audio/webm; codecs="vorbis",audio/webm; codecs="opus",video/mp2t; codecs="avc1.42E01E",video/mp2t; codecs="avc3.42E01E",video/mp2t; codecs="hvc1.1.6.L93.90",video/mp2t; codecs="mp4a.40.2",video/mp2t; codecs="ac-3",video/mp2t; codecs="ec-3",text/vtt,application/mp4; codecs="wvtt",application/ttml+xml,application/mp4; codecs="stpp"'.split(",").concat(x(Ee)),b=
|
|
{};qb();a=t(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;Te(c)?b[c]=!0:b[c]=vi()?Ec(c)||(xe(c)?!0:!1):""!=wi().canPlayType(c);var d=c.split(";")[0];b[d]=b[d]||b[c]}return b}p=rk.prototype;p.destroy=function(){return this.H.destroy()};
|
|
function tk(a){var b,c,d,e,f,g,h,k,l,m,n,q,r,u,w;return Q(function(v){if(1==v.g){b=[];c=t(a.o);for(d=c.next();!d.done;d=c.next())for(e=d.value,f=t(e),g=f.next().value,h=f.next().value,k=h[0],l=g,a.o.set(l,h.slice(0,1)),k&&b.push(k.p.catch(bf)),m=t(h.slice(1)),n=m.next();!n.done;n=m.next())q=n.value,q.p.reject(new U(2,7,7003,void 0));a.h&&b.push(a.h.destroy());return F(v,Promise.all(b),2)}r=t(a.j.values());for(u=r.next();!u.done;u=r.next())w=u.value,w.destroy();a.A&&(a.A.release(),a.A=null);a.g&&a.C&&
|
|
a.g.removeChild(a.C);a.g&&a.P&&(a.g.removeChild(a.P),a.g.load(),a.g.disableRemotePlayback=!1);a.g=null;a.P=null;a.C=null;a.s=null;a.i=null;a.h=null;a.ia=null;a.l.clear();a.Ya.clear();a.j.clear();a.I=null;a.o.clear();a.M=null;a.$.clear();a.N=null;G(v)})}
|
|
p.init=function(a,b,c,d){b=void 0===b?!1:b;c=void 0===c?"UNKNOWN":c;d=void 0===d?!1:d;var e=this,f,g,h,k,l,m;return Q(function(n){if(1==n.g)return f=yc,F(n,e.K,2);if(3!=n.g){if(!xk(e)&&!yk(e))return n.u(3);ab("Expected MediaSource to be open during init(); reopening the media source.");e.K=new tg;e.i=sk(e,e.K);return F(n,e.K,3)}e.F=b;e.S=c;e.ab=d;e.Za=!e.F&&"HLS"==e.S&&!e.ab;e.$.clear();e.W=null;e.ua=null;e.U=null;e.oa=null;e.ka=new tg;g=t(a.keys());for(h=g.next();!h.done;h=g.next())k=h.value,l=a.get(k),
|
|
zk(e,k,l,l.codecs),e.m?(e.o.set(f.Y,[]),e.o.set(f.wa,[])):e.o.set(k,[]);(m=a.get(f.Y))&&m.isAudioMuxedInVideo&&(e.m=!0);G(n)})};
|
|
function zk(a,b,c,d){"audio"==b&&d&&(d=Gf(d,c.mimeType));var e=De(c.mimeType,d);if(b==wc)Ak(a,e,a.F,c.external);else{var f=a.s.forceTransmux;if(!Ec(e)||!a.F&&Ee.includes(e))f=!0;var g=Fe(c.mimeType,d);if(f){f=uc("audio",(d||"").split(","));d=uc("video",(d||"").split(","));if(f&&d){a.m=!0;zk(a,"audio",c,f);zk(a,"video",c,d);return}if(d=xe(g))e=d(),a.j.set(b,e),e=e.convertCodecs(b,g)}g=e+a.s.addExtraFeaturesToSourceBuffer(e);Ug(a.H);try{var h=a.i.addSourceBuffer(g)}catch(k){throw new U(2,3,3015,k,"The mediaSource_ status was "+
|
|
a.i.readyState+" expected 'open'",null);}a.F&&(h.mode=Bk);a.A.D(h,"error",function(){var k=a.o.get(b)[0];k.p.reject(new U(2,3,3014,a.g.error?a.g.error.code:0,k.uri))});a.A.D(h,"updateend",function(){return Ck(a,b)});a.l.set(b,h);a.B.set(b,e);a.Ya.set(b,!!c.drmInfos.length)}}p.configure=function(a){this.s=a;this.h&&(this.h.A=a.modifyCueCallback)};function Dk(a){return a.xa&&!a.L&&!a.G}
|
|
function Ak(a,b,c,d){a.h||(a.h=new Pe(a.ia),a.h&&(a.h.A=a.s.modifyCueCallback));var e=a.h;d=d||a.Ka;a=a.S;"application/cea-608"==b||"application/cea-708"==b?e.i=null:(e.i=Re.get(b)(),e.i.setSequenceMode?e.i.setSequenceMode(c):wb("Text parsers w/ setSequenceMode",'Text parsers should have a "setSequenceMode" method!'),e.i.setManifestType?e.i.setManifestType(a):wb("Text parsers w/ setManifestType",'Text parsers should have a "setManifestType" method!'),e.B=d)}
|
|
function xk(a){return a.G?!1:a.i?"ended"==a.i.readyState:!0}function yk(a){return a.G?!1:a.i?"closed"==a.i.readyState:!0}function Ek(a,b){a.l.size?b==wc?a=a.h.g:(a=Fk(a,b),a=!a||uj(a)?null:1==a.length&&0>a.start(0)?0:a.length?a.start(0):null):a=null;return a}function Gk(a,b){return a.l.size?b==wc?a.h.h:vj(Fk(a,b)):null}function Hk(a,b,c){if(b==wc)return a=a.h,null==a.h||a.h<c?0:a.h-Math.max(c,a.g);a=Fk(a,b);return xj(a,c)}
|
|
p.Lb=function(){var a={total:this.G?[]:yj(this.g.buffered),audio:yj(Fk(this,"audio")),video:yj(Fk(this,"video")),text:[]};if(this.h){var b=this.h.g,c=this.h.h;null!=b&&null!=c&&a.text.push({start:b,end:c})}return a};function Fk(a,b){if(a.G||a.L)return null;try{return a.l.get(b).buffered}catch(c){return a.l.has(b),null}}
|
|
function Ik(a,b,c,d,e,f){var g=null,h=[],k=Tb(c);if(Ee.includes(f))b=Mj(k),b.length&&d&&((c=b.find(function(r){return"com.apple.streaming.transportStreamTimestamp"===r.description}))&&"number"==typeof c.data&&(g=Math.round(c.data)/1E3),a.N.onMetadata([{cueTime:d.startTime,data:k,frames:b,dts:d.startTime,pts:d.startTime}],0,d.endTime));else if(f.includes("/mp4")&&d&&d.Z&&d.Z.timescale){var l=d.Z.timescale;if(!isNaN(l)){var m=null!=e.emsgSchemeIdUris&&0<e.emsgSchemeIdUris.length||a.s.dispatchAllEmsgBoxes,
|
|
n=0,q=!1;k=new bh;m&&k.R("emsg",function(r){var u=e.emsgSchemeIdUris;if(0===r.version){var w=r.reader.Sc();var v=r.reader.Sc();var y=r.reader.T();var z=r.reader.T();var A=r.reader.T();var B=r.reader.T();var E=d.startTime+z/y}else y=r.reader.T(),E=r.reader.ud()/y+d.timestampOffset,z=E-d.startTime,A=r.reader.T(),B=r.reader.T(),w=r.reader.Sc(),v=r.reader.Sc();r=r.reader.Sb(r.reader.getLength()-r.reader.Ma());if(u&&u.includes(w)||a.s.dispatchAllEmsgBoxes)if("urn:mpeg:dash:event:2012"==w)a.N.vk();else if(u=
|
|
E+A/y,y={startTime:E,endTime:u,schemeIdUri:w,value:v,timescale:y,presentationTimeDelta:z,eventDuration:A,id:B,messageData:r},B=(new Map).set("detail",y),(new V("emsg",B)).cancelable=!0,a.N.rk(y),"https://aomedia.org/emsg/ID3"==w||"https://developer.apple.com/streaming/emsg-id3"==w)if(w=Mj(r),w.length)a.N.onMetadata([{cueTime:E,data:r,frames:w,dts:E,pts:E}],0,u)});k.R("prft",function(r){var u=r.reader,w=r.version;u.T();r=u.T();var v=u.T();r=1E3*r+v/Math.pow(2,32)*1E3;0===w?u=u.T():(w=u.T(),u=u.T(),
|
|
u=w*Math.pow(2,32)+u);r=Oj(r);u=(new Map).set("detail",{wallClockTime:r,programStartDate:new Date(r-u/l*1E3)});u=new V("prft",u);a.N.onEvent(u)}).box("moof",gh).box("traf",gh).R("tfdt",function(r){q||(n=zi(r.reader,r.version).baseMediaDecodeTime/l,q=!0,m||r.parser.stop())}).parse(c,!0);q&&0==d.timestampOffset&&(g=n)}}else f.includes("/mp4")||f.includes("/webm")||!qk(k)||(a.$.has(b)?a.$.get(b).clearData():a.$.set(b,new ak),h=a.$.get(b).parse(k),k=h.getStartTime(b),null!=k&&(g=k),h=h.getMetadata());
|
|
return{timestamp:g,metadata:h}}
|
|
function Jk(a,b,c,d,e,f,g,h,k,l,m){g=void 0===g?!1:g;h=void 0===h?!1:h;k=void 0===k?!1:k;l=void 0===l?!1:l;var n,q,r,u,w,v,y,z,A,B,E,H,C,D,I,L,K,J;return Q(function(M){switch(M.g){case 1:n=yc;if(b!=n.Oa){M.u(2);break}if("HLS"!=a.S){M.u(3);break}return F(M,a.Ua,4);case 4:q=M.h,a.h.s=q;case 3:return F(M,Ue(a.h,c,d?d.startTime:null,d?d.endTime:null,d?d.O()[0]:null),5);case 5:return M.return();case 2:if(l||!a.m){M.u(6);break}return F(M,Jk(a,n.Y,c,d,e,f,g,h,k,!0),7);case 7:return F(M,Jk(a,n.wa,c,d,e,f,
|
|
g,h,k,!0),8);case 8:return M.return();case 6:if(!a.l.has(b))return M.return();r=a.l.get(b).timestampOffset;u=a.B.get(b);a.j.has(b)&&(u=a.j.get(b).getOriginalMimeType());if(d&&(w=Ik(a,b,c,d,e,u),v=w.timestamp,y=w.metadata,null!=v&&(null==a.W&&b==n.wa&&(a.W=v,a.ua=d.startTime,null!=a.U&&(z=0,a.ua==a.oa&&(z=a.W-a.U),a.ka.resolve(z))),null==a.U&&b==n.Y&&(a.U=v,a.oa=d.startTime,null!=a.W&&(A=0,a.ua==a.oa&&(A=a.W-a.U),a.ka.resolve(A))),B=v,E=Ee,!a.F&&E.includes(a.B.get(b))&&(B=0),H=d.startTime-B,C=Math.abs(r-
|
|
H),(.001<=C||g||h)&&(!k||0<H||!r)&&(r=H,a.Za&&(Kk(a,b,function(){return Lk(a,b)},null),Kk(a,b,function(){return Mk(a,b,r)},null))),(D=b==n.wa||!a.l.has(n.wa))&&a.Ua.resolve(r)),y.length))a.N.onMetadata(y,r,d?d.endTime:null);f&&b==n.wa&&(a.h||Ak(a,"application/cea-608",a.F,!1),a.I||(I=u.split(";",1)[0],a.I=new Lc(I)),d?(L=a.I.rf(c),L.length&&Ye(a.h,L,d.startTime,d.endTime,r)):a.I.init(c,h,m));if(!a.j.has(b)){M.u(9);break}return F(M,a.j.get(b).transmux(c,e,d,a.i.duration,b),10);case 10:c=M.h;case 9:c=
|
|
Nk(a,e,c,d,b);if(!d||!a.F||b==n.Oa){M.u(11);break}if(!g&&!h){M.u(11);break}K=d.startTime;if("HLS"!=a.S||a.m||b!=n.Y||!a.l.has(n.wa)){M.u(13);break}return F(M,a.ka,14);case 14:J=M.h,.15<Math.abs(J)&&(K-=J);case 13:Kk(a,b,function(){return Lk(a,b)},null),Kk(a,b,function(){return Mk(a,b,K)},null);case 11:return F(M,Kk(a,b,function(){var O=c;a.M&&Bc(a.M,O,r,e);a.l.get(b).appendBuffer(O)},d?d.O()[0]:null),15);case 15:G(M)}})}function Ok(a,b){var c=Gk(a,"video")||0;We(a.h,b,c)}
|
|
function Pk(a){a.h&&We(a.h,"",0)}p.remove=function(a,b,c,d){var e=this,f;return Q(function(g){return 1==g.g?(f=yc,a==f.wa&&e.I&&e.I.remove(d),a==f.Oa?F(g,e.h.remove(b,c),0):c>b?F(g,Kk(e,a,function(){return Qk(e,a,b,c)},null),5):g.u(0)):e.m?F(g,Kk(e,f.Y,function(){return Qk(e,f.Y,b,c)},null),0):g.u(0)})};
|
|
function Rk(a,b){var c;return Q(function(d){return 1==d.g?(c=yc,b==c.Oa?a.h?F(d,a.h.remove(0,Infinity),0):d.return():F(d,Kk(a,b,function(){return Qk(a,b,0,a.i.duration)},null),4)):a.m?F(d,Kk(a,c.Y,function(){return Qk(a,c.Y,0,a.i.duration)},null),0):d.u(0)})}p.flush=function(a){var b=this,c;return Q(function(d){return 1==d.g?(c=yc,a==c.Oa?d.return():F(d,Kk(b,a,function(){b.g.currentTime-=.001;Ck(b,a)},null),2)):b.m?F(d,Kk(b,c.Y,function(){var e=c.Y;b.g.currentTime-=.001;Ck(b,e)},null),0):d.u(0)})};
|
|
function Sk(a,b,c,d,e,f,g,h,k){var l,m,n;return Q(function(q){if(1==q.g){l=yc;if(b==l.Oa)return f||(a.h.s=c),Ve(a.h,d,e),q.return();m=[];return F(q,Tk(a,b,g,h,k),2)}n=q.h;n||(m.push(Kk(a,b,function(){return Lk(a,b)},null)),a.m&&m.push(Kk(a,l.Y,function(){return Lk(a,l.Y)},null)));f||(m.push(Kk(a,b,function(){return Mk(a,b,c)},null)),a.m&&m.push(Kk(a,l.Y,function(){return Mk(a,l.Y,c)},null)));if(0!=d||Infinity!=e)m.push(Kk(a,b,function(){var r=a.l.get(b);r.appendWindowStart=0;r.appendWindowEnd=e;r.appendWindowStart=
|
|
d;Ck(a,b)},null)),a.m&&m.push(Kk(a,l.Y,function(){var r=l.Y,u=a.l.get(r);u.appendWindowStart=0;u.appendWindowEnd=e;u.appendWindowStart=d;Ck(a,r)},null));return m.length?F(q,Promise.all(m),0):q.u(0)})}
|
|
function Uk(a,b,c){var d,e;return Q(function(f){if(1==f.g){d=yc;if(b==d.Oa)return f.return();b==d.wa&&(a.Ua=new tg);if(!a.F||(e=Gk(a,b))&&.1>Math.abs(e-c))return f.return();Kk(a,b,function(){return Lk(a,b)},null);a.m&&Kk(a,d.Y,function(){return Lk(a,d.Y)},null);return F(f,Kk(a,b,function(){return Mk(a,b,c)},null),2)}return a.m?F(f,Kk(a,d.Y,function(){return Mk(a,d.Y,c)},null),0):f.u(0)})}
|
|
p.endOfStream=function(a){var b=this;return Q(function(c){return F(c,Vk(b,function(){xk(b)||yk(b)||(a?b.i.endOfStream(a):b.i.endOfStream())}),0)})};p.ob=function(a){var b=this;return Q(function(c){return F(c,Vk(b,function(){if(b.s.durationReductionEmitsUpdateEnd&&a<b.i.duration)for(var d=t(b.l.keys()),e=d.next();!e.done;e=d.next()){e=e.value;var f={start:function(){},p:new tg,uri:null};b.o.get(e).unshift(f)}b.i.duration=a;b.va=a}),0)})};p.getDuration=function(){return this.i.duration};
|
|
function Wk(a,b,c){Q(function(d){return a.H.g||a.g.error||a.L||a.G||xk(a)||yk(a)?d.return():F(d,Vk(a,function(){xk(a)||yk(a)||a.i.setLiveSeekableRange(b,c)}),0)})}function Xk(a){Q(function(b){return a.H.g||a.g.error||a.L||a.G||xk(a)||yk(a)?b.return():F(b,Vk(a,function(){xk(a)||yk(a)||a.i.clearLiveSeekableRange()}),0)})}function Qk(a,b,c,d){d<=c?Ck(a,b):a.l.get(b).remove(c,d)}
|
|
function Lk(a,b){var c=a.l.get(b),d=c.appendWindowStart,e=c.appendWindowEnd;c.abort();c.appendWindowStart=d;c.appendWindowEnd=e;Ck(a,b)}function Mk(a,b,c){0>c&&(c+=.001);var d=!0;"HLS"==a.S&&(d=Gk(a,b),d=!d||.15<Math.abs(d-c)?!0:!1);d&&(a.l.get(b).timestampOffset=c);Ck(a,b)}function Ck(a,b){if(a.G||a.H.g){var c=a.o.get(b);c&&c.length&&((c=c[0])&&c.p&&c.p.resolve(),a.o.set(b,[]))}else if(c=a.o.get(b)[0])c.p.resolve(),Yk(a,b)}
|
|
function Kk(a,b,c,d){Ug(a.H);c={start:c,p:new tg,uri:d};a.o.get(b).push(c);1==a.o.get(b).length&&Zk(a,b);return c.p}
|
|
function Vk(a,b){var c,d,e,f,g,h,k,l,m,n,q,r,u;return Q(function(w){switch(w.g){case 1:Ug(a.H);c=[];d=Array.from(a.l.keys());e=t(d);f=e.next();for(g={};!f.done;g={ready:void 0},f=e.next())h=f.value,g.ready=new tg,k={start:function(v){return function(){return v.ready.resolve()}}(g),p:g.ready,uri:null},l=a.o.get(h),l.push(k),c.push(g.ready),1==l.length&&k.start();wa(w,2);return F(w,Promise.all(c),4);case 4:za(w,3);break;case 2:throw m=Aa(w),m;case 3:return wa(w,5,6),F(w,b(),6);case 6:Ba(w);n=t(d);for(q=
|
|
n.next();!q.done;q=n.next())r=q.value,Yk(a,r);Ca(w,0);break;case 5:throw u=Aa(w),new U(2,3,3015,u,a.g.error||"No error in the media element",null);}})}function Yk(a,b){a.o.get(b).shift();Zk(a,b)}function Zk(a,b){var c=a.o.get(b)[0];if(c)try{c.start()}catch(d){"QuotaExceededError"==d.name?c.p.reject(new U(2,3,3017,b)):Dk(a)?c.p.reject(new U(2,3,3015,d,a.g.error||"No error in the media element",c.uri)):c.p.reject(new U(2,3,3024,b)),Yk(a,b)}}
|
|
function Nk(a,b,c,d,e){if("mp4"!=He(a.B.get(e)))return c;var f=null===d,g=a.Ya.get(e),h=a.N.Bj(),k=!1;d&&d.Z&&(k=d.Z.encrypted);d=d?d.O()[0]:null;var l=qb();a.s.correctEc3Enca&&f&&"audio"===e&&(c=hj(c));a.s.insertFakeEncryptionInInit&&g&&l.be(h,e)&&(f?c=ij(b,c,d):!k&&l.xi(e)&&(c=kj(c)));f&&l.ae()&&(c=nj(c));return c}
|
|
function $k(a,b,c,d){return Kk(a,b,function(){if(b!==wc){a.B.get(b);if(Gc()){a.j.has(b)&&(a.j.get(b).destroy(),a.j.delete(b));d&&a.j.set(b,d);var e=c+a.s.addExtraFeaturesToSourceBuffer(c);a.l.get(b).changeType(e);a.B.set(b,c)}Ck(a,b)}},null)}
|
|
function al(a,b){var c,d,e,f,g,h,k,l,m,n,q,r,u,w,v,y,z,A,B,E;return Q(function(H){if(1==H.g){if(a.G||a.L)return H.return();c=yc;a.G=!0;a.m=!1;d=a.g.currentTime;e=a.g.autoplay;a.g.paused||(a.Pa=!0);a.eb&&(a.g.autoplay=!1);ya(H,2);a.A.Ra();f=t(a.j.values());for(g=f.next();!g.done;g=f.next())h=g.value,h.destroy();k=t(a.l.values());for(l=k.next();!l.done;l=k.next()){m=l.value;try{a.i.removeSourceBuffer(m)}catch(C){}}a.j.clear();a.l.clear();n=a.i.duration;a.K=new tg;a.i=sk(a,a.K);return F(H,a.K,4)}if(2!=
|
|
H.g){!isNaN(n)&&n?a.i.duration=n:!isNaN(a.va)&&a.va&&(a.i.duration=a.va);q=new tg;r=a.i.sourceBuffers;u=b.size;w=0;v=function(){w++;w===u&&(q.resolve(),a.A.Ja(r,"addsourcebuffer",v))};a.A.D(r,"addsourcebuffer",v);y=t(b.keys());for(z=y.next();!z.done;z=y.next())A=z.value,B=b.get(A),zk(a,A,B,B.codecs);(E=b.get(c.Y))&&E.isAudioMuxedInVideo&&(a.m=!0);a.m&&!a.o.has(c.Y)&&a.o.set(c.Y,[]);a.g.currentTime=d;return F(H,q,2)}Ba(H);a.G=!1;Ug(a.H);a.A.za(a.g,"canplaythrough",function(){a.H.g||(a.g.autoplay=e,
|
|
a.Pa&&(a.Pa=!1,a.g.play()))});return Ca(H,0)})}function bl(a,b){return Vk(a,function(){return al(a,b)})}function cl(a,b,c,d){var e=!1,f=uc("audio",(d||"").split(",")),g=uc("video",(d||"").split(",")),h=g;"audio"==b&&(h=f);h||(h=d);d=De(c,h);var k=a.s.forceTransmux;if(!Ec(d)||!a.F&&Ee.includes(d))k=!0;if(k&&(a=Fe(c,h),c=xe(a))){var l=c();f&&g&&(e=!0);d=l.convertCodecs(b,a)}b=Ie(Me(d));return{uh:l,Uk:e,Fh:Le(d),codec:b,mimeType:d}}
|
|
function Tk(a,b,c,d,e){var f,g,h,k,l,m,n,q,r,u,w,v,y,z;return Q(function(A){if(1==A.g){f=yc;if(b==f.Oa)return A.return(!1);g=Ie(Me(a.B.get(b)));h=Le(a.B.get(b));k=cl(a,b,c,d);l=k.uh;m=k.Uk;n=k.Fh;q=k.codec;r=k.mimeType;u=!0;m&&a.B.has(f.Y)&&(w=cl(a,f.Y,c,d),v=Ie(Me(a.B.get(f.Y))),y=Le(a.B.get(f.Y)),u=v==w.codec&&y==w.Fh,w.uh&&w.uh.destroy());if(g===q&&h===n&&u)return a.j.has(b)&&!l?(a.j.get(b).destroy(),a.j.delete(b)):!a.j.has(b)&&l?a.j.set(b,l):l&&(a.j.has(b)&&a.j.get(b).transmux!=l.transmux?(a.j.get(b).destroy(),
|
|
a.j.delete(b),a.j.set(b,l)):l.destroy()),A.return(!1);z=!0;if(a.m||m&&l&&!a.j.has(b))z=!1;if(z&&"smooth"===a.s.codecSwitchingStrategy&&Gc())return F(A,$k(a,b,r,l),3);l&&l.destroy();return F(A,bl(a,e),3)}return A.return(!0)})}
|
|
function dl(a,b,c,d){if(b==wc)var e=!1;else{e=Ie(Me(a.B.get(b)));var f=Le(a.B.get(b)),g=De(c,d),h=a.s.forceTransmux;if(!Ec(g)||!a.F&&Ee.includes(g))h=!0;c=Fe(c,d);h&&(h=xe(c))&&(h=h(),g=h.convertCodecs(b,c),h.destroy());b=Ie(Me(g));g=Le(g);e=e!==b||f!==g}return e?"smooth"!==a.s.codecSwitchingStrategy||!Gc()||a.m:!1}var uk=window.URL.createObjectURL,Bk="sequence";function el(a,b,c){this.i=a;this.C=b;this.s=this.l=Infinity;this.h=1;this.g=this.j=null;this.A=0;this.B=!0;this.I=!1;this.H=0;this.F=void 0===c?!0:c;this.G=0;this.o=!1;this.m=a}p=el.prototype;p.getDuration=function(){return this.l};p.Ej=function(){return this.h};p.Ii=function(a){this.i=a};p.ob=function(a){this.l=a};p.Kj=function(){return this.i};p.Hi=function(a){this.A=a};p.Wc=function(a){a&&!this.B&&(this.I=!0);this.B=a};p.Bf=function(a){this.s=a};p.Ve=function(){return this.s};
|
|
p.fh=function(a){this.C=a};p.vj=function(){return this.C};p.oi=function(a,b){if(0!=a.length){var c=(Date.now()+this.A)/1E3;a=a.filter(function(e){return e.start+b<c});if(0!=a.length){var d=a[a.length-1].end+b;this.lf(a[0].start+b);this.h=a.reduce(function(e,f){return Math.max(e,f.end-f.start)},this.h);this.g=Math.max(this.g,d);null!=this.i&&this.F&&!this.o&&(this.i=c-this.g-this.h)}}};
|
|
p.Xd=function(a){if(0!=a.length){var b=a[0].startTime,c=a[0].endTime,d=(Date.now()+this.A)/1E3;a=t(a);for(var e=a.next();!e.done;e=a.next())e=e.value,d<e.startTime||(b=Math.min(b,e.startTime),c=Math.max(c,e.endTime),this.h=Math.max(this.h,e.endTime-e.startTime));this.lf(b);this.g=Math.max(this.g,c);null!=this.i&&this.F&&!this.o&&(this.i=d-this.g-this.h)}};p.ni=function(a,b){this.lf(a);Infinity==b||this.V()||(this.g=Math.max(this.g,b))};p.Fj=function(){return this.g};p.ef=function(){this.o=!0};
|
|
p.fk=function(){return this.o};p.gh=function(a){this.m=a};p.Aj=function(){return this.m};p.lf=function(a){null==this.j?this.j=a:this.I||(this.j=Math.min(this.j,a))};p.Lg=function(a){this.h=Math.max(this.h,a)};p.offset=function(a){null!=this.j&&(this.j+=a);null!=this.g&&(this.g+=a)};p.V=function(){return Infinity==this.l&&!this.B};p.Oc=function(){return Infinity!=this.l&&!this.B};p.Eb=function(){return Math.max(this.H,this.vc()-this.s)};p.Ki=function(a){this.H=a};
|
|
p.vc=function(){return this.V()||this.Oc()?Math.min(Math.max(0,(Date.now()+this.A)/1E3-this.h-this.i)+this.G,this.l):this.g?Math.min(this.g,this.l):this.l};p.Nd=function(a){var b=Math.max(this.j,this.H);return Infinity==this.s?Math.ceil(1E3*b)/1E3:Math.max(b,Math.min(this.vc()-this.s+a,this.Db()))};p.Vb=function(){return this.Nd(0)};p.Db=function(){return Math.max(0,this.vc()-(this.V()||this.Oc()?this.C:0))};p.Wi=function(){return null==this.i||null!=this.g&&this.F?!1:!0};
|
|
p.Gi=function(a){this.G=a};p.qj=function(){return this.G};T("shaka.media.PresentationTimeline",el);el.prototype.getAvailabilityTimeOffset=el.prototype.qj;el.prototype.setAvailabilityTimeOffset=el.prototype.Gi;el.prototype.usingPresentationStartTime=el.prototype.Wi;el.prototype.getSeekRangeEnd=el.prototype.Db;el.prototype.getSeekRangeStart=el.prototype.Vb;el.prototype.getSafeSeekRangeStart=el.prototype.Nd;el.prototype.getSegmentAvailabilityEnd=el.prototype.vc;el.prototype.setUserSeekStart=el.prototype.Ki;
|
|
el.prototype.getSegmentAvailabilityStart=el.prototype.Eb;el.prototype.isInProgress=el.prototype.Oc;el.prototype.isLive=el.prototype.V;el.prototype.offset=el.prototype.offset;el.prototype.notifyMaxSegmentDuration=el.prototype.Lg;el.prototype.notifyMinSegmentStartTime=el.prototype.lf;el.prototype.getInitialProgramDateTime=el.prototype.Aj;el.prototype.setInitialProgramDateTime=el.prototype.gh;el.prototype.isStartTimeLocked=el.prototype.fk;el.prototype.lockStartTime=el.prototype.ef;
|
|
el.prototype.getMaxSegmentEndTime=el.prototype.Fj;el.prototype.notifyPeriodDuration=el.prototype.ni;el.prototype.notifySegments=el.prototype.Xd;el.prototype.notifyTimeRange=el.prototype.oi;el.prototype.getDelay=el.prototype.vj;el.prototype.setDelay=el.prototype.fh;el.prototype.getSegmentAvailabilityDuration=el.prototype.Ve;el.prototype.setSegmentAvailabilityDuration=el.prototype.Bf;el.prototype.setStatic=el.prototype.Wc;el.prototype.setClockOffset=el.prototype.Hi;
|
|
el.prototype.getPresentationStartTime=el.prototype.Kj;el.prototype.setDuration=el.prototype.ob;el.prototype.setPresentationStartTime=el.prototype.Ii;el.prototype.getMaxSegmentDuration=el.prototype.Ej;el.prototype.getDuration=el.prototype.getDuration;function fl(a,b,c,d){var e=this;this.s=d;this.g=a;this.B=b;this.h=c;this.o=new jb;this.l=!1;this.F=a.readyState;this.G=this.C=this.j=0;this.m=gl(this);this.A=!1;this.o.D(a,"waiting",function(){return hl(e)});this.i=(new $e(function(){hl(e)})).Ga(this.h.gapJumpTimerTime)}fl.prototype.release=function(){this.o&&(this.o.release(),this.o=null);null!=this.i&&(this.i.stop(),this.i=null);this.m&&(this.m.release(),this.m=null);this.g=this.B=this.s=null};
|
|
fl.prototype.pf=function(){this.A=!0;this.i&&this.i.Ga(this.h.gapJumpTimerTime);hl(this)};
|
|
function hl(a){if(0!=a.g.readyState){if(a.g.seeking){if(!a.l)return}else a.l=!1;if(!a.g.paused||a.g.currentTime==a.j&&(a.g.autoplay||a.g.currentTime!=a.j)){a.g.readyState!=a.F&&(a.F=a.g.readyState);var b;if(!(b=!a.m)){b=a.m;var c=b.h,d=il(c),e=c.g.currentTime,f=Date.now()/1E3;if(b.g!=e||b.m!=d)b.l=f,b.g=e,b.m=d,b.i=!1;e=f-b.l;if(d=e>=b.o&&d&&!b.i)b.j&&b.j(b.g,e),b.i=!0,b.g=c.g.currentTime;b=!d}b&&(b=a.g.currentTime,c=a.g.buffered,d=zj(c,b,a.h.gapDetectionThreshold),null==d||0==d&&!a.A||(e=c.start(d),
|
|
(f=a.h.gapPadding)&&(e=Math.ceil(100*(e+f))/100),e>=a.B.Db()||.001>e-b||(0!=d&&c.end(d-1),a.g.currentTime=e,b==a.j&&(a.j=e),a.C++,a.s(new V("gapjumped")))))}}}
|
|
function gl(a){if(!a.h.stallEnabled)return null;var b=a.h.stallThreshold,c=a.h.stallSkip;return new jl(new kl(a.g),b,function(){var d;return Q(function(e){if(1==e.g)return d=yj(a.g.buffered),d.length?c?(a.g.currentTime+=c,e.u(2)):F(e,a.g.play(),3):e.return();if(2!=e.g){if(!a.g)return e.return();a.g.pause();a.g.play()}a.G++;a.s(new V("stalldetected"));G(e)})})}function jl(a,b,c){this.h=a;this.m=il(a);this.g=a.g.currentTime;this.l=Date.now()/1E3;this.i=!1;this.o=b;this.j=c}
|
|
jl.prototype.release=function(){this.h&&this.h.release();this.j=this.h=null};function kl(a){var b=this;this.g=a;this.h=new jb;this.i=!1;this.h.D(this.g,"audiofocuspaused",function(){b.i=!0});this.h.D(this.g,"audiofocusgranted",function(){b.i=!1});this.h.D(this.g,"audiofocuslost",function(){b.i=!0})}
|
|
function il(a){if(a.g.paused||0==a.g.playbackRate||a.i||0==a.g.buffered.length)var b=!1;else a:{b=a.g.currentTime;a=t(yj(a.g.buffered));for(var c=a.next();!c.done;c=a.next())if(c=c.value,!(b<c.start-.1||b>c.end-.5)){b=!0;break a}b=!1}return b}kl.prototype.release=function(){this.h&&this.h.release();this.h=null};function ll(a,b,c,d){b==HTMLMediaElement.HAVE_NOTHING||a.readyState>=b?d():(b=ml.value().get(b),c.za(a,b,d))}var ml=new pb(function(){return new Map([[HTMLMediaElement.HAVE_METADATA,"loadedmetadata"],[HTMLMediaElement.HAVE_CURRENT_DATA,"loadeddata"],[HTMLMediaElement.HAVE_FUTURE_DATA,"canplay"],[HTMLMediaElement.HAVE_ENOUGH_DATA,"canplaythrough"]])});function nl(a,b,c,d){var e=this;this.g=a;this.m=b;this.s=c;this.l=null;this.j=function(){null==e.l&&(e.l=d());return e.l};this.o=!1;this.h=new jb;this.i=new ol(a);ll(this.g,HTMLMediaElement.HAVE_METADATA,this.h,function(){pl(e,e.j())})}nl.prototype.release=function(){this.h&&(this.h.release(),this.h=null);null!=this.i&&(this.i.release(),this.i=null);this.m=function(){};this.g=null};function ql(a){return a.o?a.g.currentTime:a.j()}
|
|
function rl(a,b){0<a.g.readyState?sl(a.i,b):ll(a.g,HTMLMediaElement.HAVE_METADATA,a.h,function(){pl(a,a.j())})}function pl(a,b){.001>Math.abs(a.g.currentTime-b)?tl(a):(a.h.za(a.g,"seeking",function(){tl(a)}),sl(a.i,a.g.currentTime&&0!=a.g.currentTime?a.g.currentTime:b))}function tl(a){a.o=!0;a.h.D(a.g,"seeking",function(){return a.m()});a.s(a.g.currentTime)}
|
|
function ol(a){var b=this;this.g=a;this.m=10;this.j=this.l=this.i=0;this.h=new $e(function(){0>=b.i?b.h.stop():b.g.currentTime!=b.l||b.g.currentTime===b.j?b.h.stop():(b.g.currentTime=b.j,b.i--)})}ol.prototype.release=function(){this.h&&(this.h.stop(),this.h=null);this.g=null};function sl(a,b){a.l=a.g.currentTime;a.j=b;a.i=a.m;a.g.currentTime=b;a.h.Ga(.1)};function ul(a){this.g=a;this.i=!1;this.h=null;this.j=new jb}p=ul.prototype;p.ready=function(){function a(){if(null==b.h||0==b.h&&Infinity!=b.g.duration)b.i=!0;else{var c=b.g.currentTime,d=null;if("number"===typeof b.h)d=b.h;else if(b.h instanceof Date){var e=vl(b);null!==e&&(d=b.h.getTime()/1E3-e,d=wl(b,d))}null==d?b.i=!0:(0>d&&(d=Math.max(0,c+d)),c!=d?(b.j.za(b.g,"seeking",function(){b.i=!0}),b.g.currentTime=d):b.i=!0)}}var b=this;ll(this.g,HTMLMediaElement.HAVE_FUTURE_DATA,this.j,function(){a()})};
|
|
p.release=function(){this.j&&(this.j.release(),this.j=null);this.g=null};p.Pf=function(a){this.h=this.i?this.h:a};p.Be=function(){var a=this.i?this.g.currentTime:this.h;a instanceof Date&&(a=a.getTime()/1E3-(vl(this)||0),a=wl(this,a));return a||0};p.Bh=function(){return 0};p.Ah=function(){return 0};p.mi=function(){};p.Zh=function(){var a=vj(this.g.buffered);return null!=a&&a>=this.g.duration-1};function vl(a){return a.g.getStartDate&&(a=a.g.getStartDate().getTime(),!isNaN(a))?a/1E3:null}
|
|
function wl(a,b){a=a.g.seekable;0<a.length&&(b=Math.max(a.start(0),b),b=Math.min(a.end(a.length-1),b));return b}
|
|
function xl(a,b,c,d,e,f){var g=this;this.h=a;this.g=b.presentationTimeline;this.l=c;this.s=e;this.o=null;this.j=new fl(a,b.presentationTimeline,c,f);this.i=new nl(a,function(){a:{var h=g.j;h.l=!0;h.A=!1;h.i&&h.i.Ga(h.h.gapJumpTimerTime);hl(h);var k=ql(g.i);h=yl(g,k);if(!Hc()&&.001<Math.abs(h-k)){k=!1;var l=qb().Di();if(l){var m=Date.now()/1E3;if(!g.o||g.o<m-l)g.o=m,k=!0}else k=!0;if(k){rl(g.i,h);h=void 0;break a}}g.s();h=void 0}return h},function(h){var k=g.j;k.g.seeking&&!k.l&&(k.l=!0,k.j=h);k.i&&
|
|
k.i.Ga(k.h.gapJumpTimerTime);hl(k)},function(){return zl(g,d)});this.m=new $e(function(){if(0!=g.h.readyState&&!g.h.paused){var h=ql(g.i),k=g.g.Vb(),l=g.g.Db();3>l-k&&(k=l-3);h<k&&(h=yl(g,h),g.h.currentTime=h)}})}p=xl.prototype;p.ready=function(){this.m.Ga(.25)};p.release=function(){this.i&&(this.i.release(),this.i=null);this.j&&(this.j.release(),this.j=null);this.m&&(this.m.stop(),this.m=null);this.h=this.i=this.g=this.l=null;this.s=function(){}};p.Pf=function(a){rl(this.i,zl(this,a))};
|
|
p.Be=function(){var a=ql(this.i);return 0<this.h.readyState&&!this.h.paused?Al(this,a):a};p.Bh=function(){return this.j.G};p.Ah=function(){return this.j.C};function zl(a,b){null==b?b=Infinity>a.g.getDuration()?a.g.Vb():a.g.Db():b instanceof Date?b=b.getTime()/1E3-(a.g.m||a.g.i):0>b&&(b=a.g.Db()+b);return Bl(a,Al(a,b))}p.mi=function(){this.j.pf()};p.Zh=function(){if(this.g.V()){var a=this.g.vc(),b=vj(this.h.buffered);if(null!=b&&b>=a)return!0}return!1};
|
|
function Bl(a,b){var c=a.g.getDuration();return b>=c?c-a.l.durationBackoff:b}function yl(a,b){var c=a.l.rebufferingGoal,d=a.l.safeSeekOffset,e=a.g.Vb(),f=a.g.Db(),g=a.g.getDuration();3>f-e&&(e=f-3);var h=a.g.Nd(c),k=a.g.Nd(d);c=a.g.Nd(c+d);return b>=g?Bl(a,b):b>f?f-a.l.safeSeekEndOffset:b<e?a.g.V()&&a.l.returnToEndOfLiveWindowWhenOutside?f-a.l.safeSeekEndOffset:wj(a.h.buffered,k)?k:c:b>=h||wj(a.h.buffered,b)?b:c}function Al(a,b){var c=a.g.Vb();if(b<c)return c;a=a.g.Db();return b>a?a:b};function Cl(a){this.g=a;this.m=null;this.i=0;this.o=!1}p=Cl.prototype;p.getNumReferences=function(){return this.g.length};p.getNumEvicted=function(){return this.i};p.release=function(){this.o||(this.g=[],this.m&&this.m.stop(),this.m=null)};p.nk=function(){this.o=!0};p.Cb=function(a){for(var b=t(this.g),c=b.next();!c.done;c=b.next())a(c.value)};function Qf(a){return a.g[0]||null}
|
|
p.find=function(a){for(var b=this.g.length-1,c=b;0<=c;--c){var d=this.g[c],e=c<b?this.g[c+1].startTime:d.endTime;if(a>=d.startTime&&a<e)return c+this.i}return this.g.length&&a<this.g[0].startTime?this.i:null};p.get=function(a){if(0==this.g.length)return null;a-=this.i;return 0>a||a>=this.g.length?null:this.g[a]};p.offset=function(a){if(!this.o)for(var b=t(this.g),c=b.next();!c.done;c=b.next())c.value.offset(a)};
|
|
p.hf=function(a){if(!this.o&&a.length){var b=Math.round(1E3*a[0].startTime)/1E3;this.g=this.g.filter(function(c){return Math.round(1E3*c.startTime)/1E3<b});this.g.push.apply(this.g,x(a))}};p.Vd=function(a,b){var c=this;a=a.filter(function(d){return d.endTime>b&&(0==c.g.length||d.endTime>c.g[0].startTime)});this.hf(a);this.$a(b)};p.$a=function(a){if(!this.o){var b=this.g.length;this.g=this.g.filter(function(c){return c.endTime>a});this.i+=b-this.g.length}};
|
|
p.gd=function(a,b,c){c=void 0===c?!1:c;if(!this.o){for(;this.g.length;)if(this.g[this.g.length-1].startTime>=b)this.g.pop();else break;for(;this.g.length;)if(this.g[0].endTime<=a)this.g.shift(),c||this.i++;else break;0!=this.g.length&&(a=this.g[this.g.length-1],b=new qj(a.startTime,b,a.C,a.startByte,a.endByte,a.Z,a.timestampOffset,a.appendWindowStart,a.appendWindowEnd,a.g,a.tilesLayout,a.B,a.h,a.status,a.aesKey),b.mimeType=a.mimeType,b.codecs=a.codecs,b.i=a.i,this.g[this.g.length-1]=b)}};
|
|
p.Ff=function(a,b){var c=this;this.o||(this.m&&this.m.stop(),this.m=new $e(function(){var d=b();d?c.g.push.apply(c.g,x(d)):(c.m.stop(),c.m=null)}),this.m.Ga(a))};Cl.prototype[Symbol.iterator]=function(){return this.Ub(0)};
|
|
Cl.prototype.Ub=function(a,b,c){b=void 0===b?!1:b;c=void 0===c?!1:c;var d=this.find(a);if(null==d)return null;var e=this.get(d);c?d++:d--;var f=-1;if(e&&0<e.g.length)for(var g=e.g.length-1;0<=g;--g){var h=e.g[g];if(a>=h.startTime&&a<h.endTime){if(!b){for(;g&&!h.l;)g--,h=e.g[g];if(!h.l)return ab("No independent partial segment found!"),null}c?d--:d++;f=g-1;break}}return new Dl(this,d,f,c)};Cl.prototype.Oe=function(){return-1};
|
|
function El(a,b,c){a=new qj(a,a+b,function(){return c},0,null,null,a,a,a+b);return new Cl([a])}T("shaka.media.SegmentIndex",Cl);Cl.forSingleSegment=El;Cl.prototype.getIteratorForTime=Cl.prototype.Ub;Cl.prototype.updateEvery=Cl.prototype.Ff;Cl.prototype.fit=Cl.prototype.gd;Cl.prototype.evict=Cl.prototype.$a;Cl.prototype.mergeAndEvict=Cl.prototype.Vd;Cl.prototype.offset=Cl.prototype.offset;Cl.prototype.get=Cl.prototype.get;Cl.prototype.find=Cl.prototype.find;Cl.prototype.markImmutable=Cl.prototype.nk;
|
|
Cl.prototype.release=Cl.prototype.release;Cl.prototype.getNumEvicted=Cl.prototype.getNumEvicted;Cl.prototype.getNumReferences=Cl.prototype.getNumReferences;function Dl(a,b,c,d){this.i=a;this.h=b;this.g=c;this.reverse=d}p=Dl.prototype;p.yd=function(a){this.reverse=a};p.lj=function(){return this.h};p.current=function(){var a=this.i.get(this.h);a&&0<a.g.length&&a.A&&this.g>=a.g.length&&(this.h++,this.g=0,a=this.i.get(this.h));return a&&0<a.g.length?a.g[this.g]:a};
|
|
p.next=function(){var a=this.i.get(this.h);this.reverse?a&&0<a.g.length?(this.g--,0>this.g&&(this.h--,this.g=(a=this.i.get(this.h))&&0<a.g.length?a.g.length-1:0)):(this.h--,this.g=0):a&&0<a.g.length?(this.g++,a.A&&this.g==a.g.length&&(this.h++,this.g=0)):(this.h++,this.g=0);a=this.current();return{value:a,done:!a}};p.Xg=function(){var a=this.current();if(a.o&&!a.l&&(a=this.i.get(this.h))&&0<a.g.length)for(var b=a.g[this.g];b.l&&!(0>=this.g);)this.g--,b=a.g[this.g]};
|
|
T("shaka.media.SegmentIterator",Dl);Dl.prototype.resetToLastIndependent=Dl.prototype.Xg;Dl.prototype.next=Dl.prototype.next;Dl.prototype.current=Dl.prototype.current;Dl.prototype.currentPosition=Dl.prototype.lj;Dl.prototype.setReverse=Dl.prototype.yd;function Fl(){Cl.call(this,[]);this.h=[]}pa(Fl,Cl);p=Fl.prototype;p.clone=function(){var a=new Fl;a.h=this.h.slice();a.i=this.i;return a};p.release=function(){for(var a=t(this.h),b=a.next();!b.done;b=a.next())b.value.release();this.h=[]};
|
|
p.Cb=function(a){for(var b=t(this.h),c=b.next();!c.done;c=b.next())c.value.Cb(a)};function Gl(a,b){a=t(a.h);for(var c=a.next();!c.done;c=a.next())b(c.value)}p.find=function(a){for(var b=this.i,c=t(this.h),d=c.next();!d.done;d=c.next()){d=d.value;var e=d.find(a);if(null!=e)return e+b;b+=d.getNumEvicted()+d.getNumReferences()}return null};function Hl(a,b){a=t(a.h);for(var c=a.next();!c.done;c=a.next())if(c=c.value,null!=c.find(b))return c.Oe();return-1}
|
|
p.get=function(a){for(var b=this.i,c=t(this.h),d=c.next();!d.done;d=c.next()){d=d.value;var e=d.get(a-b);if(e)return e;e=d.getNumReferences();b+=d.getNumEvicted()+e}return null};p.offset=function(){};p.hf=function(){};p.$a=function(a){for(var b=t(this.h),c=b.next();!c.done;c=b.next())c.value.$a(a);for(;1<this.h.length&&0==this.h[0].getNumReferences();)a=this.h.shift(),this.i+=a.getNumEvicted(),a.release()};p.Vd=function(){};p.gd=function(){};p.Ff=function(){};T("shaka.media.MetaSegmentIndex",Fl);
|
|
Fl.prototype.updateEvery=Fl.prototype.Ff;Fl.prototype.fit=Fl.prototype.gd;Fl.prototype.mergeAndEvict=Fl.prototype.Vd;Fl.prototype.evict=Fl.prototype.$a;Fl.prototype.merge=Fl.prototype.hf;Fl.prototype.offset=Fl.prototype.offset;Fl.prototype.get=Fl.prototype.get;Fl.prototype.find=Fl.prototype.find;Fl.prototype.forEachTopLevelReference=Fl.prototype.Cb;Fl.prototype.release=Fl.prototype.release;function Il(a){var b=this;this.g=a;this.j=!1;this.i=this.g.Ue();this.h=new $e(function(){b.g.ki(.25*b.i)})}Il.prototype.release=function(){this.set(this.Kc());this.h&&(this.h.stop(),this.h=null);this.g=null};Il.prototype.set=function(a){this.i=a;Jl(this)};Il.prototype.Kc=function(){return this.g.Kc()};function Jl(a){a.h.stop();var b=a.j?0:a.i;if(0<=b)try{a.g.Ue()!=b&&a.g.hh(b);return}catch(c){}a.h.Ga(.25);0!=a.g.Ue()&&a.g.hh(0)};function Kl(a){var b=this;this.j=a;this.h=new jb;this.g=new Set;this.i=(new $e(function(){Ll(b,!1)})).Hb();a.paused||this.i.Ga(.25);this.h.D(a,"playing",function(){b.i.Hb().Ga(.25)});this.h.D(a,"pause",function(){b.i.stop()})}Kl.prototype.release=function(){this.h&&(this.h.release(),this.h=null);this.i.stop();for(var a=t(this.g),b=a.next();!b.done;b=a.next())b.value.release();this.g.clear()};function Ll(a,b){var c=a.j.currentTime;a=t(a.g);for(var d=a.next();!d.done;d=a.next())d.value.j(c,b)};function Ml(a){Dg.call(this);this.g=new Map;this.h=a}pa(Ml,Dg);Ml.prototype.release=function(){this.g.clear();Dg.prototype.release.call(this)};function Nl(a,b){var c=a.g.get(b);c||(c={$d:[],fg:null,contentType:b},a.g.set(b,c));return c}function Ol(a,b,c){var d=Nl(a,b.contentType);Pl(a,d);a={nd:b,position:c};d=d.$d;b=d.findIndex(function(e){return e.position>=c});0<=b?d.splice(b,d[b].position==c?1:0,a):d.push(a)}
|
|
Ml.prototype.j=function(a){for(var b=t(this.g.values()),c=b.next();!c.done;c=b.next()){c=c.value;var d=c.fg;a:{var e=c.$d;for(var f=e.length-1;0<=f;f--){var g=e[f];if(g.position<=a){e=g.nd;break a}}e=null}f=e&&!(d===e||d&&e&&d.bandwidth==e.bandwidth&&d.audioSamplingRate==e.audioSamplingRate&&d.codecs==e.codecs&&d.contentType==e.contentType&&d.frameRate==e.frameRate&&d.height==e.height&&d.mimeType==e.mimeType&&d.channelsCount==e.channelsCount&&d.pixelAspectRatio==e.pixelAspectRatio&&d.width==e.width);
|
|
g=e&&d&&e.label&&d.label&&d.label!==e.label;var h=e&&d&&e.language&&d.language&&d.language!==e.language;d=e&&d&&e.roles&&d.roles&&!Wc(d.roles,e.roles);(g||h||d)&&Ql(this,a,e.contentType)&&(c.fg=e,d=new V("audiotrackchange",new Map([["quality",e],["position",a]])),this.dispatchEvent(d));f&&Ql(this,a,e.contentType)&&(c.fg=e,JSON.stringify(e),c=new V("qualitychange",new Map([["quality",e],["position",a]])),this.dispatchEvent(c))}};
|
|
function Ql(a,b,c){return(a=a.h()[c])&&0<a.length&&(c=a[a.length-1].end,b>=a[0].start&&b<c)?!0:!1}function Pl(a,b){if((a=a.h()[b.contentType])&&0<a.length){var c=a[0].start,d=a[a.length-1].end,e=b.$d;b.$d=e.filter(function(f,g){return f.position<=c&&g+1<e.length&&e[g+1].position<=c||f.position>=d?!1:!0})}else b.$d=[]}
|
|
function Rl(a){var b={bandwidth:a.bandwidth||0,audioSamplingRate:null,codecs:a.codecs,contentType:a.type,frameRate:null,height:null,mimeType:a.mimeType,channelsCount:null,pixelAspectRatio:null,width:null,label:null,roles:a.roles,language:null};"video"==a.type&&(b.frameRate=a.frameRate||null,b.height=a.height||null,b.pixelAspectRatio=a.pixelAspectRatio||null,b.width=a.width||null);"audio"==a.type&&(b.audioSamplingRate=a.audioSamplingRate,b.channelsCount=a.channelsCount,b.label=a.label||null,b.language=
|
|
a.language);return b};function Sl(a){Dg.call(this);this.h=new Map;this.i=a;this.g=null}pa(Sl,Dg);Sl.prototype.release=function(){this.h.clear();this.g&&(this.g.stop(),this.g=null);Dg.prototype.release.call(this)};function Tl(a,b){var c=b.schemeIdUri+"_"+b.id+"_"+(b.startTime.toFixed(1)+"_"+b.endTime.toFixed(1));a.h.has(c)||(a.h.set(c,b),b=new V("regionadd",new Map([["region",b]])),a.dispatchEvent(b),Ul(a))}
|
|
function Ul(a){a.g||(a.g=(new $e(function(){for(var b=a.i(),c=t(a.h),d=c.next();!d.done;d=c.next()){var e=t(d.value);d=e.next().value;e=e.next().value;e.endTime<b.start&&(a.h.delete(d),d=new V("regionremove",new Map([["region",e]])),a.dispatchEvent(d))}!a.h.size&&a.g&&(a.g.stop(),a.g=null)})).Ga(2))};function Vl(a,b,c,d){this.m=a;this.i=b;this.l=c;this.h=new Map;this.j=new Map;this.g=null;this.o=d}function Wl(a,b){a.l=b;a=t(a.h.values());for(var c=a.next();!c.done;c=a.next())c.value.g=b}
|
|
function Xl(a,b,c){c=void 0===c?!1:c;if(!a.i.segmentIndex)return Promise.resolve();a.g||(a.g=a.i.segmentIndex.Ub(b,!0,a.o));if(!a.g)return Promise.resolve();c&&a.g.next();for(b=[];a.h.size<a.m;){c=a.g.next().value;if(!c)break;var d=!0;c.isPreload()&&null!=c.endByte&&(d=!1);2==c.xc()&&(d=!1);c.Wb(!1)&&(d=!1);d&&c.Z&&b.push(Yl(a,c.Z));d&&!a.h.has(c)&&(d=new Zl(a.l),b.push($l(d,c,a.i)),a.h.set(c,d))}am(a);return Promise.all(b)}
|
|
function Yl(a,b){if(!a.i.segmentIndex||b.Wb()||Array.from(a.j.keys()).some(function(e){return pj(e,b)}))return Promise.resolve();var c=new Zl(a.l),d=$l(c,b,a.i);a.j.set(b,c);return d}function bm(a,b){b=t(b.keys());for(var c=b.next();!c.done;c=b.next())(c=c.value)&&cm(a,c)}function dm(a){bm(a,a.h);bm(a,a.j);a.g=null}Vl.prototype.$a=function(a,b){b=void 0===b?!1:b;for(var c=t(this.h.keys()),d=c.next();!d.done;d=c.next())d=d.value,a>d.endTime&&cm(this,d);b&&am(this)};
|
|
Vl.prototype.yd=function(a){this.o=a;this.g&&this.g.yd(a)};function am(a){for(var b=Array.from(a.h.keys()),c=t(a.j.keys()),d=c.next(),e={};!d.done;e={Fg:void 0},d=c.next())e.Fg=d.value,b.some(function(f){return function(g){return pj(g.Z,f.Fg)}}(e))||cm(a,e.Fg)}function em(a,b){a.m=b;for(var c=Array.from(a.h.keys());c.length>b;){var d=c.pop();d&&cm(a,d)}am(a)}function fm(a,b){b&&b!==a.i&&(dm(a),a.i=b)}function cm(a,b){var c=a.h;b instanceof oj&&(c=a.j);a=c.get(b);c.delete(b);a&&a.abort()}
|
|
function Zl(a){this.g=a;this.Yd=this.mh=null}function $l(a,b,c){var d=new Uint8Array(0);a.Yd=a.g(b,c,function(e){return Q(function(f){if(1==f.g)return 0<d.byteLength?d=pc(d,e):d=e,a.mh?F(f,a.mh(d),3):f.u(0);d=new Uint8Array(0);G(f)})});return a.Yd.promise.catch(function(e){return e instanceof U&&7001==e.code?Promise.resolve():Promise.reject(e)})}Zl.prototype.abort=function(){this.Yd&&this.Yd.abort()};function gm(a){var b=Le(a),c=b.split("/")[0];a=Me(a);return{type:c,mimeType:b,codecs:a,language:null,height:null,width:null,channelCount:null,sampleRate:null,closedCaptions:new Map,le:null,colorGamut:null,frameRate:null}}
|
|
function hm(a,b,c){function d(C){y=C.name;var D=C.reader;D.skip(24);var I=D.Aa(),L=D.Aa();D.skip(50);q=String(I);n=String(L);C.reader.Fa()&&gh(C)}function e(C){var D=Ci(C.reader);r=D.channelCount;u=D.sampleRate;f(C.name)}function f(C){C=C.toLowerCase();switch(C){case "avc1":case "avc3":h.push(C+".42E01E");l=!0;break;case "hev1":case "hvc1":h.push(C+".1.6.L93.90");l=!0;break;case "dvh1":case "dvhe":h.push(C+".05.04");l=!0;break;case "vp09":h.push(C+".00.10.08");l=!0;break;case "av01":h.push(C+".0.01M.08");
|
|
l=!0;break;case "mp4a":g.push("mp4a.40.2");k=!0;break;case "ac-3":case "ec-3":case "ac-4":case "opus":case "flac":g.push(C),k=!0}}var g=[],h=[],k=!1,l=!1,m=null,n=null,q=null,r=null,u=null,w=null,v=null,y;(new bh).box("moov",gh).box("trak",gh).box("mdia",gh).R("mdhd",function(C){m=Ai(C.reader,C.version).language}).box("minf",gh).box("stbl",gh).R("stsd",ih).box("mp4a",function(C){var D=Ci(C.reader);r=D.channelCount;u=D.sampleRate;C.reader.Fa()?gh(C):f(C.name)}).box("esds",function(C){C=C.reader;for(var D=
|
|
"mp4a",I,L;C.Fa();){I=C.X();for(var K=C.X();K&128;)K=C.X();if(3==I)C.Aa(),K=C.X(),K&128&&C.Aa(),K&64&&C.skip(C.X()),K&32&&C.Aa();else if(4==I)L=C.X(),C.skip(12);else if(5==I)break}L&&(D+="."+Fi(L),5==I&&C.Fa()&&(I=C.X(),L=(I&248)>>3,31===L&&C.Fa()&&(L=32+((I&7)<<3)+((C.X()&224)>>5)),D+="."+L));g.push(D);k=!0}).box("ac-3",e).box("ec-3",e).box("ac-4",e).box("Opus",e).box("fLaC",e).box("avc1",d).box("avc3",d).box("hev1",d).box("hvc1",d).box("dva1",d).box("dvav",d).box("dvh1",d).box("dvhe",d).box("vp09",
|
|
d).box("av01",d).box("avcC",function(C){var D=y||"";switch(y){case "dvav":D="avc3";break;case "dva1":D="avc1"}C=C.reader;C.skip(1);C=D+"."+Fi(C.X())+Fi(C.X())+Fi(C.X());h.push(C);l=!0}).box("hvcC",function(C){var D=y||"";switch(y){case "dvh1":D="hvc1";break;case "dvhe":D="hev1"}var I=C.reader;I.skip(1);C=I.X();var L=["","A","B","C"][C>>6],K=C&31,J=I.T(),M=(C&32)>>5?"H":"L";C=[I.X(),I.X(),I.X(),I.X(),I.X(),I.X()];I=I.X();for(var O=0,N=0;32>N;N++){O|=J&1;if(31==N)break;O<<=1;J>>=1}D=D+("."+L+K)+("."+
|
|
Fi(O,!0));D+="."+M+I;L="";for(K=C.length;K--;)if((M=C[K])||L)L="."+M.toString(16).toUpperCase()+L;D+=L;h.push(D);l=!0}).box("dvcC",function(C){var D=y||"";switch(y){case "hvc1":D="dvh1";break;case "hev1":D="dvhe";break;case "avc1":D="dva1";break;case "avc3":D="dvav";break;case "av01":D="dav1"}var I=C.reader;I.skip(2);C=I.X();I=I.X();h.push(D+"."+Gi(C>>1&127)+"."+Gi(C<<5&32|I>>3&31));l=!0}).box("dvvC",function(C){var D=y||"";switch(y){case "hvc1":D="dvh1";break;case "hev1":D="dvhe";break;case "avc1":D=
|
|
"dva1";break;case "avc3":D="dvav";break;case "av01":D="dav1"}var I=C.reader;I.skip(2);C=I.X();I=I.X();h.push(D+"."+Gi(C>>1&127)+"."+Gi(C<<5&32|I>>3&31));l=!0}).R("vpcC",function(C){var D=y||"",I=C.reader;C=I.X();var L=I.X();I=I.X()>>4&15;h.push(D+"."+Gi(C)+"."+Gi(L)+"."+Gi(I));l=!0}).box("av1C",function(C){var D=y||"";switch(y){case "dav1":D="av01"}var I=C.reader;I.skip(1);C=I.X();I=I.X();var L=C>>>5,K=(I&64)>>6;h.push(D+"."+L+"."+Gi(C&31)+(I>>>7?"H":"M")+"."+Gi(2===L&&K?(I&32)>>5?12:10:K?10:8)+"."+
|
|
((I&16)>>4)+"."+((I&8)>>3)+((I&4)>>2)+(I&3)+"."+Gi(1)+"."+Gi(1)+"."+Gi(1)+".0");l=!0}).box("enca",kh).box("encv",jh).box("sinf",gh).box("frma",function(C){C=Di(C.reader).codec;f(C)}).box("colr",function(C){h=h.map(function(L){if(L.startsWith("av01.")){var K=C.reader,J=K.Ma(),M=K.Sb(4);var O=String.fromCharCode(M[0]);O+=String.fromCharCode(M[1]);O+=String.fromCharCode(M[2]);O+=String.fromCharCode(M[3]);if("nclx"===O){M=K.Aa();O=K.Aa();var N=K.Aa(),P=K.X()>>7,R=L.split(".");10==R.length&&(R[6]=Gi(M),
|
|
R[7]=Gi(O),R[8]=Gi(N),R[9]=String(P),L=R.join("."))}K.seek(J)}return L});var D=Ei(C.reader),I=D.colorGamut;w=D.le;v=I}).parse(a||b,!0);if(!g.length&&!h.length)return null;var z=k&&!l,A=new Map;if(l&&!c){c=new Lc("video/mp4");a&&c.init(a);try{c.rf(b);for(var B=t(c.Of()),E=B.next();!E.done;E=B.next()){var H=E.value;A.set(H,H)}}catch(C){}c.Bd()}return{type:z?"audio":"video",mimeType:z?"audio/mp4":"video/mp4",codecs:im(g.concat(h)).join(", "),language:m,height:n,width:q,channelCount:r,sampleRate:u,closedCaptions:A,
|
|
le:w,colorGamut:v,frameRate:null}}function im(a){var b=new Set,c=[];a=t(a);for(var d=a.next();!d.done;d=a.next()){d=d.value;var e=Ke(d);b.has(e)||(c.push(d),b.add(e))}b=xc("audio",c);d=xc("video",c);a=xc(wc,c);d=jm(d);b=b.concat(d).concat(a);return c.length&&!b.length?c:b}
|
|
function jm(a){if(1>=a.length)return a;var b=a.find(function(c){return c.startsWith("dvav.")||c.startsWith("dva1.")||c.startsWith("dvh1.")||c.startsWith("dvhe.")||c.startsWith("dav1.")||c.startsWith("dvc1.")||c.startsWith("dvi1.")});return b?Ec('video/mp4; codecs="'+b+'"')?[b]:a.filter(function(c){return c!=b}):a}
|
|
function km(a){var b=null;(new bh).box("moov",gh).box("trak",gh).box("mdia",gh).box("minf",gh).box("stbl",gh).R("stsd",ih).box("encv",jh).box("enca",kh).box("sinf",gh).box("schi",gh).R("tenc",function(c){c=c.reader;c.X();c.X();c.X();c.X();b=oc(c.Sb(16))}).parse(a,!0);return b}
|
|
function lm(a,b,c){var d,e,f,g,h;return Q(function(k){if(1==k.g)return d=b,d.cryptoKey?k.u(2):F(k,d.fetchKey(),3);e=d.iv;if(!e)for(e=Tb(new ArrayBuffer(16)),f=d.firstMediaSequenceNumber+c,g=e.byteLength-1;0<=g;g--)e[g]=f&255,f>>=8;"CBC"==b.blockCipherMode?h={name:"AES-CBC",iv:e}:h={name:"AES-CTR",counter:e,length:64};return k.return(window.crypto.subtle.decrypt(h,d.cryptoKey,a))})};function mm(a,b,c,d,e){a=Lg(a,d,e);if(0!=b||null!=c)a.headers.Range=c?"bytes="+b+"-"+c:"bytes="+b+"-";return a};function nm(a,b){var c=this;this.g=b;this.j=a;this.h=null;this.K=new Map;this.C=1;this.A=this.l=null;this.P=0;this.i=new Map;this.I=!1;this.S=null;this.B=!1;this.m=new Tg(function(){return om(c)});this.M=Date.now()/1E3;this.o=new Map;this.N={projection:null,hfov:null};this.W=0;this.U=Infinity;this.F=null;this.L=[];this.s=new $e(function(){if(c.j&&c.g)if(c.j.presentationTimeline.V()){var d=c.j.presentationTimeline.Vb(),e=c.j.presentationTimeline.Db();1<e-d?Wk(c.g.aa,d,e):Xk(c.g.aa)}else Xk(c.g.aa),
|
|
c.s&&c.s.stop();else c.s&&c.s.stop()});this.G=null;this.H=new $e(function(){var d=c.g.video;!d.ended&&c.G&&(d.currentTime=c.G,c.G=null)})}p=nm.prototype;p.destroy=function(){return this.m.destroy()};
|
|
function om(a){var b,c,d,e,f,g,h;return Q(function(k){if(1==k.g){a.s&&a.s.stop();a.s=null;a.H&&a.H.stop();a.H=null;b=[];c=t(a.i.values());for(d=c.next();!d.done;d=c.next())e=d.value,pm(e),b.push(qm(e)),e.ba&&(dm(e.ba),e.ba=null);f=t(a.o.values());for(g=f.next();!g.done;g=f.next())h=g.value,dm(h);return F(k,Promise.all(b),2)}a.i.clear();a.o.clear();a.g=null;a.j=null;a.h=null;a.G=null;G(k)})}
|
|
p.configure=function(a){this.h=a;this.S=new qg({maxAttempts:Math.max(a.retryParameters.maxAttempts,2),baseDelay:a.retryParameters.baseDelay,backoffFactor:a.retryParameters.backoffFactor,fuzzFactor:a.retryParameters.fuzzFactor,timeout:0,stallTimeout:0,connectionTimeout:0},!0);if(a.disableAudioPrefetch){var b=this.i.get("audio");b&&b.ba&&(dm(b.ba),b.ba=null);b=t(this.o.keys());for(var c=b.next();!c.done;c=b.next())c=c.value,dm(this.o.get(c)),this.o.delete(c)}a.disableTextPrefetch&&(b=this.i.get(wc))&&
|
|
b.ba&&(dm(b.ba),b.ba=null);a.disableVideoPrefetch&&(b=this.i.get("video"))&&b.ba&&(dm(b.ba),b.ba=null);b=t(this.i.keys());for(c=b.next();!c.done;c=b.next())c=this.i.get(c.value),c.ba?(em(c.ba,a.segmentPrefetchLimit),0<a.segmentPrefetchLimit||(dm(c.ba),c.ba=null)):0<a.segmentPrefetchLimit&&(c.ba=rm(this,c.stream));a.disableAudioPrefetch||sm(this)};function tm(a,b,c){a.j.presentationTimeline.V()||(a.W=b,a.U=c)}
|
|
p.start=function(a){var b=this;return Q(function(c){if(1==c.g)return F(c,um(b,a||new Map),2);Ug(b.m);b.I=!0;G(c)})};function vm(a,b){var c,d,e,f,g,h,k;Q(function(l){switch(l.g){case 1:return c=yc,a.P++,d=a.P,wa(l,2),F(l,Rk(a.g.aa,c.Oa),4);case 4:za(l,3);break;case 2:if(e=Aa(l),a.g)a.g.onError(e);case 3:f=De(b.mimeType,b.codecs),Ak(a.g.aa,f,a.j.sequenceMode,b.external),g=a.g.aa.ia,(h=g.isTextVisible()||a.h.alwaysStreamText)&&a.P==d&&(k=wm(a,b),a.i.set(c.Oa,k),xm(a,k,0)),G(l)}})}
|
|
function ym(a){var b=a.i.get(wc);b&&(pm(b),qm(b).catch(function(){}),a.F=a.i.get(wc),a.i.delete(wc));a.A=null}function zm(a,b){for(var c=0>a.g.sb(),d=t(a.i.values()),e=d.next();!e.done;e=d.next())e=e.value,e.sa&&e.sa.yd(c),e.ba&&e.ba.yd(c);d=t(a.o.values());for(e=d.next();!e.done;e=d.next())e.value.yd(c);if(c=a.i.get("video"))if(d=c.stream)if(b)(b=d.trickModeVideo)&&!c.Bc&&(Am(a,b,!1,0,!1),c.Bc=d);else if(b=c.Bc)c.Bc=null,Am(a,b,!0,0,!1)}
|
|
function Bm(a,b,c,d,e,f){c=void 0===c?!1:c;d=void 0===d?0:d;e=void 0===e?!1:e;f=void 0===f?!1:f;a.l=b;a.I&&(b.video&&Am(a,b.video,c,d,e,f),b.audio&&Am(a,b.audio,c,d,e,f))}function Cm(a,b){Q(function(c){if(1==c.g)return a.F=null,a.A=b,a.I?b.segmentIndex?c.u(2):F(c,b.createSegmentIndex(),2):c.return();Am(a,b,!0,0,!1);G(c)})}function Dm(a,b){for(var c=t(a.K.entries()),d=c.next();!d.done;d=c.next()){var e=t(d.value);d=e.next().value;e=e.next().value;d.includes(b.type)&&(e(),a.K.delete(d))}}
|
|
function Am(a,b,c,d,e,f){var g=a.i.get(b.type);g||b.type!=wc?g&&(g.Bc&&(b.trickModeVideo?(g.Bc=b,b=b.trickModeVideo):g.Bc=null),g.stream!=b||e)&&(a.o.has(b)?g.ba=a.o.get(b):g.ba&&fm(g.ba,b),b.type==wc&&(e=De(b.mimeType,b.codecs),Ak(a.g.aa,e,a.j.sequenceMode,b.external)),!a.o.has(g.stream)&&g.stream.closeSegmentIndex&&(g.Qa?(e="("+g.type+":"+g.stream.id+")",a.K.has(e)||a.K.set(e,g.stream.closeSegmentIndex)):g.stream.closeSegmentIndex()),e=g.stream.isAudioMuxedInVideo!=b.isAudioMuxedInVideo,g.stream=
|
|
b,g.sa=null,g.Vf=!!f,b.dependencyStream?g.Kd=wm(a,b.dependencyStream):g.Kd=null,e?Em(a,!0,!1):(c?g.Fc?g.Mf=!0:g.Qa?(g.Ec=!0,g.Ne=d,g.Mf=!0):(pm(g),Fm(a,g,!0,d).catch(function(h){if(a.g)a.g.onError(h)})):g.Qa||g.yb||xm(a,g,0),Gm(a,g).catch(function(h){if(a.g)a.g.onError(h)}))):vm(a,b)}
|
|
function Gm(a,b){var c,d;return Q(function(e){if(1==e.g){if(!b.Gb)return e.return();c=b.stream;d=b.Gb;return c.segmentIndex?e.u(2):F(e,c.createSegmentIndex(),2)}if(b.Gb!=d||b.stream!=c)return e.return();var f=a.g.Lc();var g=Gk(a.g.aa,b.type),h=b.stream.segmentIndex.find(b.Ia?b.Ia.endTime:f),k=null==h?null:b.stream.segmentIndex.get(h);h=k?k.endByte?k.endByte-k.startByte:null:null;k&&!h&&(h=(k.endTime-k.getStartTime())*(b.stream.bandwidth||0)/8);h?((k=k.Z)&&(h+=(k.endByte?k.endByte-k.startByte:null)||
|
|
0),k=a.g.getBandwidthEstimate(),f=8*h/k<(g||0)-f-a.h.rebufferingGoal||b.Gb.h.g>h?!0:!1):f=!1;f&&b.Gb.abort();G(e)})}
|
|
p.Vc=function(){if(this.g){for(var a=this.g.Lc(),b=t(this.i.keys()),c=b.next();!c.done;c=b.next()){var d=c.value;c=this.i.get(d);var e=this.g.aa;d==wc?(e=e.h,e=null==e.g||null==e.h?!1:a>=e.g&&a<e.h):(e=Fk(e,d),e=wj(e,a));if(!e){this.M=0;c.ba&&(c.ba.g=null);if("audio"===c.type){e=t(this.o.values());for(var f=e.next();!f.done;f=e.next())f.value.g=null}c.sa=null;(null!=Gk(this.g.aa,d)||c.Qa)&&Hm(this,c);c.Gb&&(c.Gb.abort(),c.Gb=null);d===wc&&(d=this.g.aa,d.I&&d.I.Bd());c.Vc=!0}}"keep"!==this.h.crossBoundaryStrategy&&
|
|
Im(this)}};function Hm(a,b){b.Fc||b.Ec||(b.Qa?(b.Ec=!0,b.Ne=0):null==Ek(a.g.aa,b.type)?null==b.yb&&xm(a,b,0):(pm(b),Fm(a,b,!1,0).catch(function(c){if(a.g)a.g.onError(c)})))}
|
|
function um(a,b){var c,d,e,f,g,h,k,l,m;return Q(function(n){if(1==n.g){c=yc;if(!a.l)throw new U(2,5,5006);d=new Map;a.l.audio&&d.set(c.Y,a.l.audio);a.l.video&&d.set(c.wa,a.l.video);a.A&&d.set(c.Oa,a.A);e=a.g.aa;return F(n,e.init(d,a.j.sequenceMode,a.j.type,a.j.ignoreManifestTimestampsInSegmentsMode),2)}Ug(a.m);a.updateDuration();f=t(d.keys());for(g=f.next();!g.done;g=f.next())h=g.value,k=d.get(h),a.i.has(h)||(l=wm(a,k),b.has(k.id)&&(m=b.get(k.id),Wl(m,function(q,r,u){return Jm(q,r,u||null,a.h.retryParameters,
|
|
a.g.lc)}),l.ba=m),a.i.set(h,l),xm(a,l,0));G(n)})}function wm(a,b){var c={stream:b,type:b.type,sa:null,ba:rm(a,b),Ia:null,Ob:null,df:null,Qc:null,Pc:null,bf:null,cf:null,Bc:null,endOfStream:!1,Qa:!1,yb:null,Ec:!1,Ne:0,Mf:!1,Fc:!1,Vc:!0,Vf:!1,Ug:!1,Pd:!1,Gb:null,Kd:null};b.dependencyStream&&(c.Kd=wm(a,b.dependencyStream));return c}
|
|
function rm(a,b){if("video"===b.type&&a.h.disableVideoPrefetch||"audio"===b.type&&a.h.disableAudioPrefetch||b.type===wc&&("application/cea-608"==b.mimeType||"application/cea-708"==b.mimeType)||b.type===wc&&a.h.disableTextPrefetch)return null;if(a.o.has(b))return a.o.get(b);var c=a.i.get(b.type);return(c=c&&c.ba)&&b===c.i?c:0<a.h.segmentPrefetchLimit?new Vl(a.h.segmentPrefetchLimit,b,function(d,e,f){return Jm(d,e,f||null,a.h.retryParameters,a.g.lc)},0>a.g.sb()):null}
|
|
function sm(a){for(var b=a.h.segmentPrefetchLimit,c=a.h.prefetchAudioLanguages,d=t(a.j.variants),e=d.next(),f={};!e.done;f={Kb:void 0},e=d.next())if(f.Kb=e.value,f.Kb.audio)if(a.o.has(f.Kb.audio)){if(e=a.o.get(f.Kb.audio),em(e,b),!(0<b&&c.some(function(h){return function(k){return ff(h.Kb.audio.language,k)}}(f)))){var g=a.i.get(f.Kb.audio.type);e!==(g&&g.ba)&&dm(e);a.o.delete(f.Kb.audio)}}else 0>=b||!c.some(function(h){return function(k){return ff(h.Kb.audio.language,k)}}(f))||!(e=rm(a,f.Kb.audio))||
|
|
(f.Kb.audio.segmentIndex||f.Kb.audio.createSegmentIndex(),a.o.set(f.Kb.audio,e))}p.updateDuration=function(){var a=Hc(),b=this.j.presentationTimeline.getDuration();Infinity>b?(a&&(this.s&&this.s.stop(),Xk(this.g.aa)),this.g.aa.ob(b)):a?(this.s&&this.s.Ga(.5),this.g.aa.ob(Infinity)):this.g.aa.ob(Math.pow(2,32))};
|
|
function Km(a,b){var c,d,e,f,g,h;return Q(function(k){switch(k.g){case 1:Ug(a.m);if(b.Qa||null==b.yb||b.Fc)return k.return();b.yb=null;if(!b.Ec){k.u(2);break}return F(k,Fm(a,b,b.Mf,b.Ne),3);case 3:return k.return();case 2:Dm(a,b);if(b.stream.segmentIndex){k.u(4);break}c=b.stream;wa(k,5);return F(k,b.stream.createSegmentIndex(),7);case 7:za(k,6);break;case 5:return d=Aa(k),F(k,Lm(a,b,d),8);case 8:return k.return();case 6:if(c!=b.stream)return c.closeSegmentIndex&&c.closeSegmentIndex(),b.Qa||b.yb||
|
|
xm(a,b,0),k.return();case 4:wa(k,9);e=Mm(a,b);null!=e&&(xm(a,b,e),b.Pd=!1);za(k,10);break;case 9:return f=Aa(k),F(k,Lm(a,b,f),11);case 11:return k.return();case 10:g=Array.from(a.i.values());if(!a.I||!g.every(function(l){return l.endOfStream})){k.u(0);break}return F(k,a.g.aa.endOfStream(),13);case 13:Ug(a.m),h=a.g.aa.getDuration(),0!=h&&h<a.j.presentationTimeline.getDuration()&&a.j.presentationTimeline.ob(h),G(k)}})}
|
|
function Mm(a,b){if(Nm(b))return Ok(a.g.aa,b.stream.originalId||""),null;b.type==wc&&Pk(a.g.aa);if(b.stream.isAudioMuxedInVideo)return null;var c=a.h.updateIntervalSeconds/Math.max(1,Math.abs(a.g.sb()));if(!Dk(a.g.aa)&&b.type!=wc)return c/2;var d=a.g.Lc();if("audio"===b.type)for(var e=t(a.o.keys()),f=e.next();!f.done;f=e.next())f=a.o.get(f.value),f.$a(d,!0),Xl(f,d);e=b.Ia?b.Ia.endTime:d;var g=Hk(a.g.aa,b.type,d);f=Math.max(1,Math.max(a.h.rebufferingGoal,a.h.bufferingGoal)*a.C);var h=a.j.presentationTimeline.getDuration()-
|
|
e,k=Gk(a.g.aa,b.type);if(1E-6>h&&k)return b.endOfStream=!0,"video"==b.type&&(a=a.i.get(wc))&&Nm(a)&&(a.endOfStream=!0),null;b.endOfStream=!1;if(g>=f)return c/2;h=!b.sa;k=Om(a,b,d,k);if(!k)return c;g=!1;h&&b.Vf&&(g=!0,b.Vf=!1);h=Infinity;var l=Array.from(a.i.values());l=t(l);for(var m=l.next();!m.done;m=l.next())m=m.value,Nm(m)||m.sa&&!m.sa.current()||(h=Math.min(h,m.Ia?m.Ia.endTime:d));if(e>=h+a.j.presentationTimeline.h)return c;if("keep"!==a.h.crossBoundaryStrategy&&Pm(a,b,k))return null;b.ba&&b.sa&&
|
|
!a.o.has(b.stream)&&(b.ba.$a(k.startTime+.001),Xl(b.ba,k.startTime).catch(function(){}));Qm(a,b,d,k,g).catch(function(){});b.Kd&&Rm(a,b.Kd,d,f);return null}
|
|
function Om(a,b,c,d){if(b.sa)return(c=b.sa.current())&&b.Ia&&.001>Math.abs(b.Ia.startTime-c.startTime)&&(c=b.sa.next().value),c;if(b.Ia||d)return c=b.Ia?b.Ia.endTime:d,a=0>a.g.sb(),b.stream.segmentIndex&&(b.sa=b.stream.segmentIndex.Ub(c,!1,a)),b.sa&&b.sa.next().value;d=a.j.sequenceMode?0:a.h.inaccurateManifestTolerance;var e=Math.max(c-d,0);a=0>a.g.sb();var f=null;d&&(b.stream.segmentIndex&&(b.sa=b.stream.segmentIndex.Ub(e,!1,a)),f=b.sa&&b.sa.next().value);f||(b.stream.segmentIndex&&(b.sa=b.stream.segmentIndex.Ub(c,
|
|
!1,a)),f=b.sa&&b.sa.next().value);return f}
|
|
function Qm(a,b,c,d,e){var f,g,h,k,l,m,n,q,r,u,w,v,y,z,A,B,E,H;return Q(function(C){switch(C.g){case 1:f=yc;g=b.stream;h=b.sa;b.Qa=!0;wa(C,2);if(2==d.xc())throw new U(1,1,1011);return F(C,Sm(a,b,d,e),4);case 4:Ug(a.m);if(a.B)return C.return();k="video/mp4"==g.mimeType||"audio/mp4"==g.mimeType;l=window.ReadableStream;if((m=a.h.lowLatencyMode&&a.j.isLowLatency)&&l&&k&&("HLS"!=a.j.type||d.m))return r=new Uint8Array(0),w=u=!1,y=function(D){var I,L,K,J;return Q(function(M){switch(M.g){case 1:if(u)return M.return();w=
|
|
!0;Ug(a.m);if(a.B)return M.return();wa(M,2);r=Tm(r,D);I=!1;L=0;(new bh).box("mdat",function(O){L=O.size+O.start;I=!0}).parse(r,!1,!0);if(!I){M.u(4);break}K=r.subarray(0,L);r=r.subarray(L);return F(M,Um(a,b,c,g,d,K,!0,e),5);case 5:b.ba&&b.sa&&Xl(b.ba,d.startTime,!0);case 4:za(M,0);break;case 2:v=J=Aa(M),G(M)}})},F(C,Vm(a,b,d,y),9);n=Vm(a,b,d);return F(C,n,7);case 7:q=C.h;Ug(a.m);if(a.B)return C.return();Ug(a.m);return b.Ec?(b.Qa=!1,xm(a,b,0),C.return()):F(C,Um(a,b,c,g,d,q,!1,e),6);case 9:z=C.h;if(v)throw v;
|
|
if(w){C.u(10);break}u=!0;Ug(a.m);return a.B?C.return():b.Ec?(b.Qa=!1,xm(a,b,0),C.return()):F(C,Um(a,b,c,g,d,z,!1,e),10);case 10:b.ba&&b.sa&&Xl(b.ba,d.startTime,!0);case 6:Ug(a.m);if(a.B)return C.return();b.Ia=d;h.next();b.Qa=!1;b.Ug=!1;A=a.g.aa.Lb();B=A[b.type];fb(JSON.stringify(B));b.Ec||(E=null,b.type===f.wa?E=a.i.get(f.Y):b.type===f.Y&&(E=a.i.get(f.wa)),E&&E.type==f.Y?a.g.pf(d,b.stream,E.stream.isAudioMuxedInVideo):a.g.pf(d,b.stream,b.stream.codecs.includes(",")));xm(a,b,0);za(C,0);break;case 2:H=
|
|
Aa(C);Ug(a.m,H);if(a.B)return C.return();b.Qa=!1;if(7001==H.code)b.Qa=!1,pm(b),xm(a,b,0),C.u(0);else if(b.type==f.Oa&&a.h.ignoreTextStreamFailures)a.i.delete(f.Oa),C.u(0);else{if(3017==H.code)return F(C,Wm(a,b,H),0);b.Pd=!0;1==H.category&&b.ba&&cm(b.ba,d);H.severity=2;return F(C,Lm(a,b,H),0)}}})}
|
|
function Rm(a,b,c,d){var e,f,g,h,k,l,m,n,q,r,u;return Q(function(w){switch(w.g){case 1:e=b.stream;for(h=(g=(f=e.segmentIndex)&&f.Ub(c))&&g.next().value;h&&a.L.includes(h.startTime);)h=g&&g.next().value;if(!h){w.u(0);break}k=h.Z;if(!k||pj(k,b.Ob)){w.u(3);break}b.Ob=k;wa(w,4);return F(w,Vm(a,b,k),6);case 6:l=w.h;var v=a.g.aa;v.M&&Bc(v.M,l,0,e);a.L=[];za(w,3);break;case 4:throw m=Aa(w),b.Ob=null,m;case 3:if(b.Ia&&b.Ia==h){w.u(0);break}b.Ia=h;wa(w,8);return F(w,Vm(a,b,h),10);case 10:n=w.h;v=a.g.aa;v.M&&
|
|
Bc(v.M,n,0,e);a.L.push(h.startTime);za(w,9);break;case 8:throw q=Aa(w),b.Ia=null,q;case 9:r=Math.max.apply(Math,[0].concat(x(a.L)));u=a.g.Lc();if(u+d>r)return F(w,Rm(a,b,h.startTime,d),0);w.u(0)}})}function Tm(a,b){var c=new Uint8Array(a.length+b.length);c.set(a);c.set(b,a.length);return c}
|
|
function Wm(a,b,c){var d,e,f,g,h,k;return Q(function(l){if(1==l.g){d=Array.from(a.i.values());if(e=d.some(function(m){return m!=b&&m.Ug}))return l.u(2);f=0===a.h.maxDisabledTime&&1011==c.code?1:a.h.maxDisabledTime;if(g=a.g.disableStream(b.stream,f))return l.return();if(a.h.avoidEvictionOnQuotaExceededError)return xm(a,b,4),l.return();h=Math.round(100*a.C);if(20<h)a.C-=.2;else if(4<h)a.C-=.04;else return b.Pd=!0,a.B=!0,a.g.onError(c),l.return();b.Ug=!0;k=a.g.Lc();return F(l,Xm(a,b,k),2)}xm(a,b,4);
|
|
G(l)})}
|
|
function Sm(a,b,c,d){var e,f,g,h,k,l,m,n,q,r,u,w,v,y,z,A;return Q(function(B){switch(B.g){case 1:e=yc;f=null==b.Ia;g=[];h=Math.max(0,Math.max(c.appendWindowStart,a.W)-.1);k=Math.min(c.appendWindowEnd,a.U)+.01;l=c.codecs||b.stream.codecs;m=Ke(l);n=Le(c.mimeType||b.stream.mimeType);q=c.timestampOffset;if(q==b.df&&h==b.Qc&&k==b.Pc&&m==b.bf&&n==b.cf){B.u(2);break}r=b.bf&&b.cf&&dl(a.g.aa,b.type,n,l);if(!r){B.u(3);break}u=null;b.type===e.wa?u=a.i.get(e.Y):b.type===e.Y&&(u=a.i.get(e.wa));if(!u){B.u(3);break}return F(B,
|
|
qm(u).catch(function(){}),5);case 5:u.Ob=null,u.Qc=null,u.Pc=null,Hm(a,u);case 3:return F(B,Ym(a,b,q,h,k,c,m,n),2);case 2:return pj(c.Z,b.Ob)||(b.Ob=c.Z,c.l&&c.Z&&(w=Vm(a,b,c.Z),v=function(){var E,H,C,D,I,L,K,J,M;return Q(function(O){switch(O.g){case 1:return wa(O,2),F(O,w,4);case 4:return E=O.h,Ug(a.m),H=null,C=new Map,D={projection:null,hfov:null},I=new bh,I.box("moov",gh).box("trak",gh).box("mdia",gh).R("mdhd",function(N){H=Ai(N.reader,N.version).timescale}).box("hdlr",function(N){N=N.reader;N.skip(8);
|
|
switch(N.Sc()){case "soun":C.set(e.Y,H);break;case "vide":C.set(e.wa,H)}H=null}).box("minf",gh).box("stbl",gh).R("stsd",ih).box("encv",jh).box("avc1",jh).box("avc3",jh).box("hev1",jh).box("hvc1",jh).box("dvav",jh).box("dva1",jh).box("dvh1",jh).box("dvhe",jh).box("dvc1",jh).box("dvi1",jh).box("vexu",gh).box("proj",gh).R("prji",function(N){N=N.reader.Sc();D.projection=N}).box("hfov",function(N){N=N.reader.T()/1E3;D.hfov=N}).parse(E),b.type===e.wa&&Zm(a,D),C.has(b.type)?c.Z.timescale=C.get(b.type):null!=
|
|
H&&(c.Z.timescale=H),L=b.stream.segmentIndex,L instanceof Fl&&(K=Hl(L,c.startTime)),J=b.stream.closedCaptions&&0<b.stream.closedCaptions.size,F(O,a.g.Gh(b.type,E),5);case 5:return F(O,Jk(a.g.aa,b.type,E,null,b.stream,J,b.Vc,d,!1,!1,K),6);case 6:za(O,0);break;case 2:throw M=Aa(O),b.Ob=null,M;}})},y=c.startTime,f&&(z=Gk(a.g.aa,b.type),null!=z&&(y=z)),a.g.tk(y,c.Z),g.push(v()))),A=b.Ia?b.Ia.i:-1,c.i!=A&&g.push(Uk(a.g.aa,b.type,c.startTime)),F(B,Promise.all(g),0)}})}
|
|
function Ym(a,b,c,d,e,f,g,h){var k,l,m,n;return Q(function(q){if(1==q.g)return k=yc,l=new Map,a.l.audio&&l.set(k.Y,a.l.audio),a.l.video&&l.set(k.wa,a.l.video),wa(q,2),b.Qc=d,b.Pc=e,g&&(b.bf=g),h&&(b.cf=h),b.df=c,m=a.j.sequenceMode||"HLS"==a.j.type,F(q,Sk(a.g.aa,b.type,c,d,e,m,f.mimeType||b.stream.mimeType,f.codecs||b.stream.codecs,l),4);if(2!=q.g)return za(q,0);n=Aa(q);b.Qc=null;b.Pc=null;b.bf=null;b.cf=null;b.df=null;throw n;})}
|
|
function Um(a,b,c,d,e,f,g,h){g=void 0===g?!1:g;h=void 0===h?!1:h;var k,l,m,n,q,r;return Q(function(u){switch(u.g){case 1:return k=d.closedCaptions&&0<d.closedCaptions.size,a.h.shouldFixTimestampOffset&&(m="video/mp4"==d.mimeType||"audio/mp4"==d.mimeType,n=null,e.Z&&(n=e.Z.timescale),(q=m&&n&&"video"===d.type&&"DASH"==a.j.type)&&(l=new bh),q&&l.box("moof",gh).box("traf",gh).R("tfdt",function(w){var v,y,z,A,B,E;return Q(function(H){v=zi(w.reader,w.version);y=v.baseMediaDecodeTime;if(!y)return H.return();
|
|
z=-y/n;A=Number(b.df)||0;if(!(A<z))return H.u(0);B=b.Qc;E=b.Pc;return F(H,Ym(a,b,z,B,E,e),0)})}),q&&l.parse(f,!1,g)),F(u,Xm(a,b,c),2);case 2:return Ug(a.m),r=b.Vc,b.Vc=!1,F(u,a.g.Gh(b.type,f),3);case 3:return F(u,Jk(a.g.aa,b.type,f,e,d,k,r,h,g),4);case 4:Ug(a.m),G(u)}})}
|
|
function Xm(a,b,c){var d,e,f,g,h,k,l,m,n;return Q(function(q){if(1==q.g){d=b.stream.segmentIndex;d instanceof Fl&&(d.$a(a.j.presentationTimeline.Eb()),e=[],Gl(d,function(r){e.push(r.Oe())}));f=Math.max(a.h.bufferBehind*a.C,a.j.presentationTimeline.h);g=Ek(a.g.aa,b.type);if(null==g)return a.F==b&&(a.F=null),q.return();h=c-g;k=a.h.evictionGoal;l=a.j.presentationTimeline.Vb();m=a.j.presentationTimeline.Db();n=h-f;m-l>k&&(n=Math.max(h-f,l-k-g));return n<=k?q.return():F(q,a.g.aa.remove(b.type,g,g+n,e),
|
|
2)}if(4!=q.g)return Ug(a.m),a.F?F(q,Xm(a,a.F,c),4):q.u(0);Ug(a.m);G(q)})}function Nm(a){return a&&a.type==wc&&("application/cea-608"==a.stream.mimeType||"application/cea-708"==a.stream.mimeType)}
|
|
function Vm(a,b,c,d){var e,f,g,h,k;return Q(function(l){switch(l.g){case 1:if(e=c.Wb())return l.return(e);f=null;if(b.ba){var m=b.ba,n=m.h;c instanceof oj&&(n=m.j);n.has(c)?(m=n.get(c),d&&(m.mh=d),f=m.Yd):f=null}f||(f=Jm(c,b.stream,d||null,a.h.retryParameters,a.g.lc));g=0;b.sa&&(g=b.sa.h);b.Gb=f;return F(l,f.promise,2);case 2:h=l.h;b.Gb=null;k=h.data;if(!c.aesKey){l.u(3);break}return F(l,lm(k,c.aesKey,g),4);case 4:k=l.h;case 3:return l.return(k)}})}
|
|
function Jm(a,b,c,d,e,f){f=void 0===f?!1:f;var g=a instanceof qj?a:void 0,h=g?1:0;a=mm(a.O(),a.startByte,a.endByte,d,c);a.contentType=b.type;return e.request(Rg,a,{type:h,stream:b,segment:g,isPreload:f})}
|
|
function Fm(a,b,c,d){var e,f;return Q(function(g){if(1==g.g)return b.Ec=!1,b.Mf=!1,b.Ne=0,b.Fc=!0,b.Ia=null,b.sa=null,b.ba&&!a.o.has(b.stream)&&dm(b.ba),d?(e=a.g.Lc(),f=a.g.aa.getDuration(),F(g,a.g.aa.remove(b.type,e+d,f),3)):F(g,Rk(a.g.aa,b.type),4);if(3!=g.g)return Ug(a.m),c?F(g,a.g.aa.flush(b.type),3):g.u(3);Ug(a.m);b.Fc=!1;b.endOfStream=!1;b.Qa||b.yb||xm(a,b,0);G(g)})}
|
|
function xm(a,b,c){var d=b.type;if(d!=wc||a.i.has(d))b.yb=(new Ze(function(){var e;return Q(function(f){if(1==f.g)return wa(f,2),F(f,Km(a,b),4);if(2!=f.g)return za(f,0);e=Aa(f);if(a.g)a.g.onError(e);G(f)})})).ha(c)}function pm(a){null!=a.yb&&(a.yb.stop(),a.yb=null)}function qm(a){return Q(function(b){return a.Gb?F(b,a.Gb.abort(),0):b.u(0)})}
|
|
function Lm(a,b,c){var d;return Q(function(e){if(1==e.g)return 3024==c.code?(b.Qa=!1,pm(b),xm(a,b,0),e.return()):F(e,sg(a.S),2);Ug(a.m);if(1===c.category&&1003!=c.code){if(b.Bc)return zm(a,!1),e.return();d=0===a.h.maxDisabledTime&&1011==c.code?1:a.h.maxDisabledTime;c.handled=a.g.disableStream(b.stream,d);c.handled&&(c.severity=1)}if(!c.handled||1011!=c.code)a.g.onError(c);c.handled||a.h.failureCallback(c);G(e)})}
|
|
function Em(a,b,c){b=void 0===b?!1:b;c=void 0===c?!0:c;var d,e,f,g,h,k;return Q(function(l){if(1==l.g){d=Date.now()/1E3;e=a.h.minTimeBetweenRecoveries;if(!b){if(!a.h.allowMediaSourceRecoveries||d-a.M<e)return l.return(!1);a.M=d}f=yc;if(g=a.i.get(f.Y))g.Ob=null,g.Qc=null,g.Pc=null,c&&Hm(a,g),qm(g).catch(function(){}),g.sa&&g.sa.Xg();if(h=a.i.get(f.wa))h.Ob=null,h.Qc=null,h.Pc=null,c&&Hm(a,h),qm(h).catch(function(){}),h.sa&&h.sa.Xg();k=new Map;a.l.audio&&k.set(f.Y,a.l.audio);a.l.video&&k.set(f.wa,a.l.video);
|
|
return F(l,bl(a.g.aa,k),2)}!h||h.Fc||h.Qa||h.yb||xm(a,h,0);!g||g.Fc||g.Qa||g.yb||xm(a,g,0);return l.return(!0)})}function Zm(a,b){if(a.N.projection!=b.projection||a.N.hfov!=b.hfov){if(null!=b.projection||null!=b.hfov){var c=(new Map).set("detail",b);c=new V("spatialvideoinfo",c)}else c=new V("nospatialvideoinfo");c.cancelable=!0;a.g.onEvent(c);a.N=b}}
|
|
function Im(a){if("keep"!==a.h.crossBoundaryStrategy){a.H.stop();var b=a.g.Lc(),c=a.i.get("video")||a.i.get("audio");c&&(c=c.Ob)&&null!==c.g&&(b=c.g-b,0>b||1<b||(a.G=c.g+.01,a.H.ha(b)))}}
|
|
function Pm(a,b,c){if(b.type===wc)return!1;var d=b.Ob;if(!d)return!1;var e=c.Z;c=d.g!==e.g;"reset_to_encrypted"===a.h.crossBoundaryStrategy&&(d.encrypted||e.encrypted||(c=!1),d.encrypted&&(a.h.crossBoundaryStrategy="keep"));"RESET_ON_ENCRYPTION_CHANGE"===a.h.crossBoundaryStrategy&&d.encrypted==e.encrypted&&(c=!1);if(c&&b.Vc){var f=a.g.video,g=f.paused;Em(a,!0).then(function(){var h=(new Map).set("oldEncrypted",d.encrypted).set("newEncrypted",e.encrypted);a.g.onEvent(new V("boundarycrossed",h));g||
|
|
f.play()})}return c};function $m(){}
|
|
function an(a,b,c,d,e){var f=e in d;var g=f?c.constructor==Object&&0==Object.keys(d).length:c.constructor==Object&&0==Object.keys(c).length;var h=f||g,k=!0,l;for(l in b){var m=e+"."+l,n=f?d[e]:c[l];h||l in c?void 0===b[l]?void 0===n||h?delete a[l]:a[l]=ed(n):g?a[l]=b[l]:n.constructor==Object&&b[l]&&b[l].constructor==Object?(a[l]||(a[l]=ed(n)),m=an(a[l],b[l],n,d,m),k=k&&m):typeof b[l]!=typeof n||null==b[l]||"function"!=typeof b[l]&&b[l].constructor!=n.constructor?(ab("Invalid config, wrong type for "+m),
|
|
k=!1):"function"==typeof c[l]&&c[l].length!=b[l].length?(bb("Unexpected number of arguments for "+m),a[l]=b[l]):a[l]=Array.isArray(a[l])?b[l].slice():b[l]:(ab("Invalid config, unrecognized key "+m),k=!1)}return k}function bn(a,b){for(var c={},d=c,e=0,f=0;;){e=a.indexOf(".",e);if(0>e)break;if(0==e||"\\"!=a[e-1])f=a.substring(f,e).replace(/\\\./g,"."),d[f]={},d=d[f],f=e+1;e+=1}d[a.substring(f).replace(/\\\./g,".")]=b;return c}function cn(a,b){return a&&b}
|
|
function dn(a,b){function c(f){for(var g=t(Object.keys(f)),h=g.next();!h.done;h=g.next())if(h=h.value,!(f[h]instanceof HTMLElement))if(e(f[h])&&0===Object.keys(f[h]).length)delete f[h];else{var k=f[h];Array.isArray(k)&&0===k.length?delete f[h]:"function"==typeof f[h]?delete f[h]:e(f[h])&&(c(f[h]),0===Object.keys(f[h]).length&&delete f[h])}}function d(f,g){return Object.keys(f).reduce(function(h,k){var l=f[k];if(g.hasOwnProperty(k))if(l instanceof HTMLElement&&g[k]instanceof HTMLElement)l.isEqualNode(g[k])||
|
|
(h[k]=l);else if(e(l)&&e(g[k])){if(l=d(l,g[k]),0<Object.keys(l).length||!e(l))h[k]=l}else Array.isArray(l)&&Array.isArray(g[k])?Vc(l,g[k])||(h[k]=l):Number.isNaN(l)&&Number.isNaN(g[k])||l!==g[k]&&(h[k]=l);else h[k]=l;return h},{})}function e(f){return f&&"object"===typeof f&&!Array.isArray(f)}a=d(a,b);c(a);return a}T("shaka.util.ConfigUtils",$m);$m.getDifferenceFromConfigObjects=dn;$m.convertToConfigObject=bn;$m.mergeConfigObjects=an;T("shaka.config.RepeatMode",{OFF:0,ALL:1,SINGLE:2});function en(){}function fn(a){a=dc(a);return(new Bb(a)).Bb}function gn(a,b,c){function d(h){Yb(f).setUint32(g,h.byteLength,!0);g+=4;f.set(Tb(h),g);g+=h.byteLength}if(!c||!c.byteLength)throw new U(2,6,6015);var e;"string"==typeof b?e=fc(b,!0):e=b;a=dc(a);a=fc(a,!0);var f=new Uint8Array(12+a.byteLength+e.byteLength+c.byteLength),g=0;d(a);d(e);d(c);return f}function hn(a,b,c){if("skd"!==b)return a;b=c.serverCertificate;c=dc(a).split("skd://").pop();return gn(a,c,b)}
|
|
function jn(a,b){2===a&&(a=b.drmInfo)&&ng(a.keySystem)&&(b.headers["Content-Type"]="application/octet-stream")}T("shaka.drm.FairPlay",en);
|
|
en.commonFairPlayResponse=function(a,b){if(2===a&&(a=b.originalRequest.drmInfo)&&ng(a.keySystem)){try{var c=ac(b.data)}catch(e){return}a=!1;c=c.trim();"<ckc>"===c.substr(0,5)&&"</ckc>"===c.substr(-6)&&(c=c.slice(5,-6),a=!0);if(!a)try{var d=JSON.parse(c);d.ckc&&(c=d.ckc,a=!0);d.CkcMessage&&(c=d.CkcMessage,a=!0);d.License&&(c=d.License,a=!0)}catch(e){}a&&(b.data=Ub(mc(c)))}};en.muxFairPlayRequest=function(a,b){jn(a,b)};
|
|
en.expressplayFairPlayRequest=function(a,b){if(2===a){var c=b.drmInfo;c&&ng(c.keySystem)&&jn(a,b)}};en.conaxFairPlayRequest=function(a,b){jn(a,b)};en.ezdrmFairPlayRequest=function(a,b){jn(a,b)};en.verimatrixFairPlayRequest=function(a,b){2===a&&(a=b.drmInfo)&&ng(a.keySystem)&&(a=Tb(b.body),a=lc(a),b.headers["Content-Type"]="application/x-www-form-urlencoded",b.body=ec("spc="+a))};en.muxInitDataTransform=function(a,b,c){return hn(a,b,c)};
|
|
en.expressplayInitDataTransform=function(a,b,c){return hn(a,b,c)};en.conaxInitDataTransform=function(a,b,c){if("skd"!==b)return a;b=c.serverCertificate;c=dc(a).split("skd://").pop().split("?").shift();c=window.atob(c);var d=new ArrayBuffer(2*c.length);d=Xb(d);for(var e=0,f=c.length;e<f;e++)d[e]=c.charCodeAt(e);return gn(a,d,b)};en.ezdrmInitDataTransform=function(a,b,c){if("skd"!==b)return a;b=c.serverCertificate;c=dc(a).split(";").pop();return gn(a,c,b)};
|
|
en.verimatrixInitDataTransform=function(a,b,c){return hn(a,b,c)};en.initDataTransform=gn;en.defaultGetContentId=fn;en.isFairPlaySupported=function(){var a;return Q(function(b){if(1==b.g)return a={initDataTypes:["cenc","sinf","skd"],videoCapabilities:[{contentType:'video/mp4; codecs="avc1.42E01E"'}]},wa(b,2),F(b,navigator.requestMediaKeySystemAccess("com.apple.fps",[a]),4);if(2!=b.g)return b.return(!0);Aa(b);return b.return(!1)})};function kn(){this.g=null}kn.prototype.configure=function(a){this.g=a};kn.prototype.getConfiguration=function(){return this.g};
|
|
kn.prototype.create=function(a){var b;if(this.g.language){var c=ln(a,this.g.language);c.length&&(b=c)}b||(b=a.filter(function(f){return f.primary}),b=b.length?b:a);a=mn(b,this.g.role);a.length&&(b=a);this.g.videoLayout&&(a=nn(b,this.g.videoLayout),a.length&&(b=a));this.g.zc&&(a=on(b,this.g.zc),a.length&&(b=a));var d=[this.g.channelCount,this.g.preferredAudioChannelCount];a=d.filter(function(f,g){return f&&d.indexOf(f)===g});if(a.length)for(a=t(a),c=a.next();!c.done;c=a.next())if(c=pn(b,c.value),c.length){b=
|
|
c;break}this.g.cd&&(a=qn(b,this.g.cd),a.length&&(b=a));this.g.zd&&(a=rn(b,this.g.zd),a.length&&(b=a));a=sn(b,this.g.spatialAudio);a.length&&(b=a);var e=[this.g.audioCodec,this.g.Cd].concat(x(this.g.preferredAudioCodecs));a=e.filter(function(f,g){return f&&e.indexOf(f)===g});if(a.length)for(a=t(a),c=a.next();!c.done;c=a.next())if(c=tn(b,c.value),c.length){b=c;break}return new di(b[0],b,!("smooth"==this.g.codecSwitchingStrategy&&Gc()))};
|
|
function ln(a,b){b=gf(b);var c=of(b,a.map(function(d){return nf(d)}));return c?a.filter(function(d){return c==nf(d)}):[]}function mn(a,b){return a.filter(function(c){return c.audio?b?c.audio.roles.includes(b):0==c.audio.roles.length:!1})}function qn(a,b){return a.filter(function(c){return c.audio&&c.audio.label?c.audio.label.toLowerCase()==b.toLowerCase():!1})}function rn(a,b){return a.filter(function(c){return c.video&&c.video.label?c.video.label.toLowerCase()==b.toLowerCase():!1})}
|
|
function pn(a,b){return a.filter(function(c){return c.audio&&c.audio.channelsCount&&c.audio.channelsCount>b?!1:!0}).sort(function(c,d){return c.audio||d.audio?c.audio?d.audio?(d.audio.channelsCount||0)-(c.audio.channelsCount||0):1:-1:0})}function on(a,b){if("AUTO"==b){var c=a.some(function(d){return d.video&&d.video.hdr&&"HLG"==d.video.hdr?!0:!1});b=un(c)}return a.filter(function(d){return d.video&&d.video.hdr&&d.video.hdr!=b?!1:!0})}
|
|
function nn(a,b){return a.filter(function(c){return c.video&&c.video.videoLayout&&c.video.videoLayout!=b?!1:!0})}function sn(a,b){return a.filter(function(c){return c.audio&&c.audio.spatialAudio!=b?!1:!0})}function tn(a,b){return a.filter(function(c){return c.audio&&c.audio.codecs!=b?!1:!0})};function vn(){}
|
|
function wn(){var a=Infinity,b=qb();navigator.connection&&navigator.connection.saveData&&(a=360);var c={retryParameters:rg(),servers:{},clearKeys:{},advanced:{},delayLicenseRequestUntilPlayed:!1,persistentSessionOnlinePlayback:!1,persistentSessionsMetadata:[],initDataTransform:function(h,k,l){"apple"===window.shakaMediaKeysPolyfill&&"skd"==k&&(k=l.serverCertificate,l=fn(h),h=gn(h,l,k));return h},logLicenseExchange:!1,updateExpirationTime:1,preferredKeySystems:[],keySystemsMapping:{},parseInbandPsshEnabled:!1,
|
|
minHdcpVersion:"",ignoreDuplicateInitData:!0,defaultAudioRobustnessForWidevine:"SW_SECURE_CRYPTO",defaultVideoRobustnessForWidevine:"SW_SECURE_DECODE"},d="reload",e=!1;Gc()&&b.Yc()&&(d="smooth",e=!0);e={retryParameters:rg(),availabilityWindowOverride:NaN,disableAudio:!1,disableVideo:!1,disableText:!1,disableThumbnails:!1,disableIFrames:!1,defaultPresentationDelay:0,segmentRelativeVttTiming:!1,raiseFatalErrorOnManifestUpdateRequestFailure:!1,continueLoadingWhenPaused:!0,ignoreSupplementalCodecs:!1,
|
|
updatePeriod:-1,ignoreDrmInfo:!1,dash:{clockSyncUri:"",disableXlinkProcessing:!0,xlinkFailGracefully:!1,ignoreMinBufferTime:!1,autoCorrectDrift:!0,initialSegmentLimit:1E3,ignoreSuggestedPresentationDelay:!1,ignoreEmptyAdaptationSet:!1,ignoreMaxSegmentDuration:!1,keySystemsByURI:{"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready",
|
|
"urn:uuid:79f0049a-4098-8642-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:94ce86fb-07ff-4f43-adb8-93d2fa968ca2":"com.apple.fps","urn:uuid:3d5e6d35-9b9a-41e8-b843-dd3c6e72c42c":"com.huawei.wiseplay"},manifestPreprocessor:xn,manifestPreprocessorTXml:yn,sequenceMode:!1,multiTypeVariantsAllowed:e,useStreamOnceInPeriodFlattening:!1,enableFastSwitching:!0},hls:{ignoreTextStreamFailures:!1,ignoreImageStreamFailures:!1,defaultAudioCodec:"mp4a.40.2",defaultVideoCodec:"avc1.42E01E",ignoreManifestProgramDateTime:!1,
|
|
ignoreManifestProgramDateTimeForTypes:[],mediaPlaylistFullMimeType:'video/mp2t; codecs="avc1.42E01E, mp4a.40.2"',liveSegmentsDelay:3,sequenceMode:b.Xc(),ignoreManifestTimestampsInSegmentsMode:!1,disableCodecGuessing:!1,disableClosedCaptionsDetection:!1,allowLowLatencyByteRangeOptimization:!0,allowRangeRequestsToGuessMimeType:!1},mss:{manifestPreprocessor:xn,manifestPreprocessorTXml:yn,sequenceMode:!1,keySystemsBySystemId:{"9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","79f0049a-4098-8642-ab92-e65be0885f95":"com.microsoft.playready"}}};
|
|
var f={trackSelectionCallback:function(h){return Q(function(k){return k.return(h)})},downloadSizeCallback:function(h){var k;return Q(function(l){if(1==l.g)return navigator.storage&&navigator.storage.estimate?F(l,navigator.storage.estimate(),3):l.return(!0);k=l.h;return l.return(k.usage+h<.95*k.quota)})},progressCallback:function(h,k){return cn([h,k])},usePersistentLicense:!0,numberOfParallelDownloads:5},g={drm:c,manifest:e,streaming:{retryParameters:rg(),failureCallback:function(h){return cn([h])},
|
|
rebufferingGoal:0,bufferingGoal:10,bufferBehind:30,evictionGoal:1,ignoreTextStreamFailures:!1,alwaysStreamText:!1,startAtSegmentBoundary:!1,gapDetectionThreshold:.5,gapPadding:0,gapJumpTimerTime:.25,durationBackoff:1,safeSeekOffset:5,safeSeekEndOffset:0,stallEnabled:!0,stallThreshold:1,stallSkip:.1,useNativeHlsForFairPlay:!0,inaccurateManifestTolerance:2,lowLatencyMode:!1,preferNativeDash:!1,preferNativeHls:!1,updateIntervalSeconds:1,observeQualityChanges:!1,maxDisabledTime:30,segmentPrefetchLimit:1,
|
|
prefetchAudioLanguages:[],disableAudioPrefetch:!1,disableTextPrefetch:!1,disableVideoPrefetch:!1,liveSync:{enabled:!1,targetLatency:.5,targetLatencyTolerance:.5,maxPlaybackRate:1.1,minPlaybackRate:.95,panicMode:!1,panicThreshold:60,dynamicTargetLatency:{enabled:!1,stabilityThreshold:60,rebufferIncrement:.5,maxAttempts:10,maxLatency:4,minLatency:1}},allowMediaSourceRecoveries:!0,minTimeBetweenRecoveries:5,vodDynamicPlaybackRate:!1,vodDynamicPlaybackRateLowBufferRate:.95,vodDynamicPlaybackRateBufferRatio:.5,
|
|
preloadNextUrlWindow:30,loadTimeout:30,clearDecodingCache:!1,dontChooseCodecs:!1,shouldFixTimestampOffset:!1,avoidEvictionOnQuotaExceededError:!1,crossBoundaryStrategy:"keep",returnToEndOfLiveWindowWhenOutside:!1},networking:{forceHTTP:!1,forceHTTPS:!1,minBytesForProgressEvents:16E3},mediaSource:{codecSwitchingStrategy:d,addExtraFeaturesToSourceBuffer:function(h){return cn([h],"")},forceTransmux:!1,insertFakeEncryptionInInit:!0,correctEc3Enca:!1,modifyCueCallback:function(h,k){return cn([h,k])},dispatchAllEmsgBoxes:!1,
|
|
useSourceElements:!0,durationReductionEmitsUpdateEnd:!0},offline:f,abrFactory:function(){return new eg},adaptationSetCriteriaFactory:function(){return new (Function.prototype.bind.apply(kn,[null].concat(x(Oa.apply(0,arguments)))))},abr:{enabled:!0,useNetworkInformation:!0,defaultBandwidthEstimate:1E6,switchInterval:8,bandwidthUpgradeTarget:.85,bandwidthDowngradeTarget:.95,restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:a,minPixels:0,maxPixels:Infinity,minFrameRate:0,maxFrameRate:Infinity,
|
|
minBandwidth:0,maxBandwidth:Infinity,minChannelsCount:0,maxChannelsCount:Infinity},advanced:{minTotalBytes:128E3,minBytes:16E3,fastHalfLife:2,slowHalfLife:5},restrictToElementSize:!1,restrictToScreenSize:!1,ignoreDevicePixelRatio:!1,clearBufferSwitch:!1,safeMarginSwitch:0,cacheLoadThreshold:20,minTimeToSwitch:0,preferNetworkInformationBandwidth:!1,removeLatencyFromFirstPacketTime:!0},autoShowText:3,preferredAudioLanguage:"",preferredAudioLabel:"",preferredTextLanguage:"",preferredVariantRole:"",preferredTextRole:"",
|
|
preferredAudioChannelCount:2,preferredVideoHdrLevel:"AUTO",preferredVideoLayout:"",preferredVideoLabel:"",preferredVideoCodecs:[],preferredAudioCodecs:[],preferredTextFormats:[],preferForcedSubs:!1,preferSpatialAudio:!1,preferredDecodingAttributes:[],restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:Infinity,minPixels:0,maxPixels:Infinity,minFrameRate:0,maxFrameRate:Infinity,minBandwidth:0,maxBandwidth:Infinity,minChannelsCount:0,maxChannelsCount:Infinity},playRangeStart:0,playRangeEnd:Infinity,
|
|
textDisplayer:{captionsUpdatePeriod:.25,fontScaleFactor:1},textDisplayFactory:function(){return null},cmcd:{enabled:!1,sessionId:"",contentId:"",rtpSafetyFactor:5,useHeaders:!1,includeKeys:[],version:1},cmsd:{enabled:!0,applyMaximumSuggestedBitrate:!0,estimatedThroughputWeightRatio:.5},lcevc:{enabled:!1,dynamicPerformanceScaling:!0,logLevel:0,drawLogo:!1,poster:!0},ads:{customPlayheadTracker:!1,skipPlayDetection:!1,supportsMultipleMediaElements:!0,disableHLSInterstitial:!1,disableDASHInterstitial:!1,
|
|
allowPreloadOnDomElements:!0,allowStartInMiddleOfInterstitial:!0},ignoreHardwareResolution:!1,queue:{preloadNextUrlWindow:30,repeatMode:0}};f.trackSelectionCallback=function(h){return Q(function(k){return k.return(zn(h,g.preferredAudioLanguage,g.preferredVideoHdrLevel))})};return b.Ta(g)}
|
|
function An(){return{streaming:{inaccurateManifestTolerance:0,segmentPrefetchLimit:2,updateIntervalSeconds:.1,maxDisabledTime:1,retryParameters:{baseDelay:100}},manifest:{dash:{autoCorrectDrift:!1},retryParameters:{baseDelay:100}},drm:{retryParameters:{baseDelay:100}}}}
|
|
function Bn(a,b,c){var d={".drm.keySystemsMapping":"",".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:[],audioRobustness:[],sessionType:"",serverCertificate:new Uint8Array(0),serverCertificateUri:"",individualizationServer:"",headers:{}}};return an(a,b,c||wn(),d,"")}
|
|
function zn(a,b,c){var d=c;"AUTO"==d&&(c=a.some(function(h){return h.hdr&&"HLG"==h.hdr?!0:!1}),d=un(c));var e=a.filter(function(h){return"variant"!=h.type||h.hdr&&h.hdr!=d?!1:!0});c=[];var f=of(b,e.map(function(h){return h.language}));f&&(c=e.filter(function(h){return gf(h.language)==f}));0==c.length&&(c=e.filter(function(h){return h.primary}));0==c.length&&(e.map(function(h){return h.language}),c=e);var g=c.filter(function(h){return h.height&&480>=h.height});g.length&&(g.sort(function(h,k){return k.height-
|
|
h.height}),c=g.filter(function(h){return h.height==g[0].height}));b=[];c.length&&(e=Math.floor(c.length/2),c.sort(function(h,k){return h.bandwidth-k.bandwidth}),b.push(c[e]));a=t(a);for(c=a.next();!c.done;c=a.next())c=c.value,c.type!=wc&&"image"!=c.type||b.push(c);return b}function xn(a){return cn([a],a)}function yn(a){return cn([a],a)}T("shaka.util.PlayerConfiguration",vn);vn.mergeConfigObjects=Bn;vn.createDefaultForLL=An;vn.createDefault=wn;function Cn(){this.g=null;this.h=[]}function Dn(a,b){var c=0;a.g&&a.g.state==b&&(c+=a.g.duration);a=t(a.h);for(var d=a.next();!d.done;d=a.next())d=d.value,c+=d.state==b?d.duration:0;return c}function En(a){function b(f){return{timestamp:f.timestamp,state:f.state,duration:f.duration}}for(var c=[],d=t(a.h),e=d.next();!e.done;e=d.next())c.push(b(e.value));a.g&&c.push(b(a.g));return c};function Fn(){this.i=this.h=null;this.g=[]}function Gn(a,b,c){a.i!=b&&(a.i=b,a.g.push({timestamp:Date.now()/1E3,id:b.id,type:"text",fromAdaptation:c,bandwidth:null}))};function Hn(){this.B=this.W=NaN;this.l="";this.j=this.ci=this.s=this.A=this.K=this.C=this.o=this.m=this.I=this.F=this.i=this.S=this.U=this.M=this.N=this.P=NaN;this.L=0;this.G=this.H=NaN;this.g=new Cn;this.h=new Fn}function In(a,b,c){a.P=b;a.N=c}function Jn(a,b,c){a.W=b;a.B=c}function Kn(a,b){a.i=isNaN(a.i)?b:Math.max(a.i,b)}function Ln(a,b){a.j=isNaN(a.j)?b:a.j+b}
|
|
function Mn(a){var b=a.W,c=a.B,d=a.l,e=a.A,f=a.N,g=a.P,h=a.M,k=a.U,l=a.S,m=a.s,n=a.i,q=a.F,r=a.I,u=a.m,w=Dn(a.g,"playing"),v=Dn(a.g,"paused"),y=Dn(a.g,"buffering"),z=a.o,A=a.C,B=a.K,E=a.ci,H=a.j,C=a.L,D=a.H,I=a.G,L=En(a.g),K=[];a=t(a.h.g);for(var J=a.next();!J.done;J=a.next())J=J.value,K.push({timestamp:J.timestamp,id:J.id,type:J.type,fromAdaptation:J.fromAdaptation,bandwidth:J.bandwidth});return{width:b,height:c,currentCodecs:d,streamBandwidth:e,decodedFrames:f,droppedFrames:g,corruptedFrames:h,
|
|
stallsDetected:k,gapsJumped:l,estimatedBandwidth:m,completionPercent:n,loadLatency:q,manifestTimeSeconds:r,drmTimeSeconds:u,playTime:w,pauseTime:v,bufferingTime:y,licenseTime:z,liveLatency:A,maxSegmentDuration:B,manifestSizeBytes:E,bytesDownloaded:H,nonFatalErrorCount:C,manifestPeriodCount:D,manifestGapCount:I,stateHistory:L,switchHistory:K}};function Nn(a,b,c,d){Dg.call(this);this.N=a;this.W=b;this.Pa=d.networkingEngine;this.m=c;this.A=null;this.Ka=0;this.ab=d.dd;this.F=d.jk;this.eb=d.kk;this.g=d.config;this.l=this.G=this.h=null;this.va=!1;this.H=d.zk;this.xa=!1;this.i=null;this.oa=!1;this.j=this.C=null;this.ia=!1;this.M=new Map;this.Ba=!1;this.Ua=d.yk;this.$=new Hn;this.ua=new tg;this.s=new tg;this.P=null;this.o=!1;this.ka=d.bj;this.U=this.K=null;this.Za=d.aj;this.S=!1;this.L=[];this.I=[];this.B=!0}pa(Nn,Dg);
|
|
function On(a,b,c){(a=b?a.I:a.L)?a.push(c):c()}function Pn(a){if(a.I)for(var b=t(a.I),c=b.next();!c.done;c=b.next())c=c.value,c();a.I=null}function Qn(a,b){a.P=b;a.S=!0;if(a.L){b=t(a.L);for(var c=b.next();!c.done;c=b.next())c=c.value,c()}a.L=null}p=Nn.prototype;p.getStartTime=function(){return this.m};p.jd=function(){return this.N};p.zg=function(){return this.h};function Rn(a){a.ia=!0;return a.j}function Sn(a){a.xa=!0;return a.H}p.getStats=function(){return this.$};
|
|
function Tn(a){a.oa=!0;return a.i}p.Jj=function(){return this.K?Lf(this.K):null};p.Ij=function(){return this.U?Of(this.U):null};function Un(a){a.Ba=!0;return a.M}
|
|
p.start=function(){var a=this;(function(){var b;return Q(function(c){switch(c.g){case 1:return F(c,Promise.resolve(),2);case 2:return wa(c,3),F(c,Vn(a),5);case 5:Wn(a);if("webkit"===window.shakaMediaKeysPolyfill){c.u(6);break}return F(c,Xn(a),7);case 7:Wn(a);case 6:return F(c,Yn(a),8);case 8:Wn(a);if(!a.ka||!a.i){c.u(9);break}return F(c,Zh(a.i),10);case 10:Wn(a);case 9:a.s.resolve();za(c,0);break;case 3:b=Aa(c),b instanceof U&&(7001==b.code||7003==b.code)||a.s.reject(b),G(c)}})})()};
|
|
p.dispatchEvent=function(a){return this.P?this.P.dispatchEvent(a):Dg.prototype.dispatchEvent.call(this,a)};p.onError=function(a){2===a.severity&&(this.s.reject(a),this.destroy());var b=(new Map).set("detail",a);b=new V("error",b);this.dispatchEvent(b);b.defaultPrevented&&(a.handled=!0)};function Wn(a){if(a.o)throw new U(2,7,7003);}function no(a,b){a.dispatchEvent(new V("onstatechange",(new Map).set("state",b)))}
|
|
function Vn(a){var b,c,d,e,f,g,h,k,l;return Q(function(m){switch(m.g){case 1:no(a,"manifest-parser");a.l||(a.G=xi(a.N,a.W),a.l=a.G(),a.l.configure(a.g.manifest,function(){return a.B}));b=Date.now()/1E3;no(a,"manifest");if(a.h){m.u(2);break}return F(m,a.l.start(a.N,a.eb),3);case 3:a.h=m.h;if(1!=a.h.variants.length){m.u(2);break}c=[];d=a.h.variants[0];e=t([d.video,d.audio]);for(f=e.next();!f.done;f=e.next())(g=f.value)&&!g.segmentIndex&&c.push(g.createSegmentIndex());if(!(0<c.length)){m.u(2);break}return F(m,
|
|
Promise.all(c),2);case 2:return a.ua.resolve(),h=new V("manifestparsed",void 0),F(m,Promise.resolve(),7);case 7:a.dispatchEvent(h);if(0==a.h.variants.length)throw new U(2,4,4036);oo(a.h);k=Date.now()/1E3;l=k-b;a.$.I=l;G(m)}})}
|
|
function Xn(a,b){var c,d,e,f,g,h;return Q(function(k){switch(k.g){case 1:if(!a.h||a.i)return k.return();no(a,"drm-engine");a.Ka=Date.now()/1E3;a.i=a.ab();a.F.h=a.i;a.i.configure(a.g.drm,function(){return a.B});c=ni(a.F,a.h);if(!c){k.u(2);break}d=new V("trackschanged",void 0);return F(k,Promise.resolve(),3);case 3:Wn(a),a.dispatchEvent(d);case 2:return e=$f(a.h.variants),f=!0,a.h&&a.h.presentationTimeline&&"HLS"!=a.h.type&&(f=a.h.presentationTimeline.V()),F(k,yh(a.i,e,a.h.offlineSessionIds,f),4);case 4:Wn(a);
|
|
if(!b){k.u(5);break}return F(k,a.i.cc(b),6);case 6:Wn(a);case 5:return F(k,li(a.F,a.h),7);case 7:g=k.h;if(!g){k.u(0);break}h=new V("trackschanged",void 0);return F(k,Promise.resolve(),9);case 9:a.dispatchEvent(h),G(k)}})}p.configure=function(a,b){a=bn(a,b);Bn(this.g,a)};p.getConfiguration=function(){return ed(this.g)};
|
|
function Yn(a){var b,c,d,e,f,g,h;return Q(function(k){a.A||(a.A=a.g.adaptationSetCriteriaFactory(),a.A.configure({language:a.g.preferredAudioLanguage,role:a.g.preferredVariantRole,channelCount:a.g.preferredAudioChannelCount,zc:a.g.preferredVideoHdrLevel,spatialAudio:a.g.preferSpatialAudio,videoLayout:a.g.preferredVideoLayout,cd:a.g.preferredAudioLabel,zd:a.g.preferredVideoLabel,codecSwitchingStrategy:a.g.mediaSource.codecSwitchingStrategy,audioCodec:"",Cd:"",Ee:0,preferredAudioCodecs:a.g.preferredAudioCodecs,
|
|
preferredAudioChannelCount:a.g.preferredAudioChannelCount}));a.Za&&(b=a.g.abrFactory,a.C=b,a.j=b(),a.j.configure(a.g.abr));if(!a.ka)return k.u(0);c=a.h.presentationTimeline.V();d=$f(a.h.variants);e=a.A.create(d);a.j.configure(a.g.abr);a.j.setVariants(Array.from(e.values()));f=a.j.chooseVariant();if(!f)return k.u(0);g=[];a.K=f;f.video&&g.push(po(a,f.video,c));f.audio&&g.push(po(a,f.audio,c));(h=ag(a.h.textStreams,a.g.preferredTextLanguage,a.g.preferredTextRole,a.g.preferForcedSubs)[0]||null)&&dg(f.audio,
|
|
h,a.g)&&(g.push(po(a,h,c)),a.U=h);return F(k,Promise.all(g),0)})}
|
|
function po(a,b,c){var d,e,f,g,h;return Q(function(k){if(1==k.g)return d=a.g.streaming.segmentPrefetchLimit||2,e=new Vl(d,b,function(l,m,n){return Jm(l,m,n||null,a.g.streaming.retryParameters,a.Pa,a.B)},!1),a.M.set(b.id,e),b.segmentIndex?k.u(2):F(k,b.createSegmentIndex(),2);f="number"===typeof a.m?a.m:0;g=b.segmentIndex.Ub(f);h=null;g&&(h=g.current(),h||(h=g.next().value));h||(h=Qf(b.segmentIndex));return h?c?h.Z?F(k,Yl(e,h.Z),0):k.u(0):F(k,Xl(e,h.startTime),0):k.u(0)})}p.$k=function(){return this.s};
|
|
p.destroy=function(){var a=this,b,c,d;return Q(function(e){switch(e.g){case 1:a.o=!0;if(!a.l||a.va){e.u(2);break}return F(e,a.l.stop(),2);case 2:if(!a.j||a.ia){e.u(4);break}return F(e,a.j.stop(),4);case 4:a.H&&!a.xa&&a.H.release();if(!a.i||a.oa){e.u(6);break}return F(e,a.i.destroy(),6);case 6:if(0<a.M.size&&!a.Ba)for(b=t(a.M.values()),c=b.next();!c.done;c=b.next())d=c.value,dm(d);G(e)}})};
|
|
function oo(a){function b(c){return c.video&&c.audio||c.video&&c.video.codecs.includes(",")}a.variants.some(b)&&(a.variants=a.variants.filter(b))}T("shaka.media.PreloadManager",Nn);Nn.prototype.destroy=Nn.prototype.destroy;Nn.prototype.waitForFinish=Nn.prototype.$k;Nn.prototype.getPrefetchedTextTrack=Nn.prototype.Ij;Nn.prototype.getPrefetchedVariantTrack=Nn.prototype.Jj;function qo(a,b){Dg.call(this);var c=this;this.i=a;this.l=b;this.g=new Map;this.m=[{bd:null,$c:ro,Nc:function(d,e){return so(c,"enter",d,e)}},{bd:to,$c:ro,Nc:function(d,e){return so(c,"enter",d,e)}},{bd:uo,$c:ro,Nc:function(d,e){return so(c,"enter",d,e)}},{bd:ro,$c:to,Nc:function(d,e){return so(c,"exit",d,e)}},{bd:ro,$c:uo,Nc:function(d,e){return so(c,"exit",d,e)}},{bd:to,$c:uo,Nc:function(d,e){e?so(c,"skip",d,e):(so(c,"enter",d,e),so(c,"exit",d,e))}},{bd:uo,$c:to,Nc:function(d,e){return so(c,"skip",
|
|
d,e)}}];this.h=new jb;this.h.D(this.i,"regionremove",function(d){c.g.delete(d.region)})}pa(qo,Dg);qo.prototype.release=function(){this.i=null;this.g.clear();this.h.release();this.h=null;Dg.prototype.release.call(this)};
|
|
qo.prototype.j=function(a,b){if(!this.l||0!=a){this.l=!1;for(var c=t(this.i.h.values()),d=c.next();!d.done;d=c.next()){d=d.value;var e=this.g.get(d),f=a<d.startTime?to:a>d.endTime?uo:ro;this.g.set(d,f);for(var g=t(this.m),h=g.next();!h.done;h=g.next())h=h.value,h.bd==e&&h.$c==f&&h.Nc(d,b)}}};function so(a,b,c,d){b=new V(b,new Map([["region",c],["seeking",d]]));a.dispatchEvent(b)}var to=1,ro=2,uo=3;function vo(a,b,c){var d,e,f,g,h,k,l;return Q(function(m){switch(m.g){case 1:var n=(new Bb(a)).mb.split("/").pop().split(".");d=1==n.length?"":n.pop().toLowerCase();if(e=wo.get(d))return m.return(e);f=0;g=Lg([a],c);wa(m,2);g.method="HEAD";return F(m,b.request(f,g).promise,4);case 4:h=m.h;e=h.headers["content-type"];za(m,3);break;case 2:k=Aa(m);if(!k||1002!=k.code&&1001!=k.code){m.u(3);break}g.method="GET";return F(m,b.request(f,g).promise,6);case 6:l=m.h,e=l.headers["content-type"];case 3:return m.return(e?
|
|
e.toLowerCase().split(";").shift():"")}})}
|
|
var wo=(new Map).set("mp4","video/mp4").set("m4v","video/mp4").set("m4a","audio/mp4").set("webm","video/webm").set("weba","audio/webm").set("mkv","video/webm").set("ts","video/mp2t").set("ogv","video/ogg").set("ogg","audio/ogg").set("mpg","video/mpeg").set("mpeg","video/mpeg").set("mov","video/quicktime").set("m3u8","application/x-mpegurl").set("mpd","application/dash+xml").set("ism","application/vnd.ms-sstr+xml").set("mp3","audio/mpeg").set("aac","audio/aac").set("flac","audio/flac").set("wav","audio/wav").set("sbv",
|
|
"text/x-subviewer").set("srt","text/srt").set("vtt","text/vtt").set("webvtt","text/vtt").set("ttml","application/ttml+xml").set("lrc","application/x-subtitle-lrc").set("ssa","text/x-ssa").set("ass","text/x-ssa").set("jpeg","image/jpeg").set("jpg","image/jpeg").set("png","image/png").set("svg","image/svg+xml").set("webp","image/webp").set("avif","image/avif").set("html","text/html").set("htm","text/html");/*
|
|
@license
|
|
Copyright 2013 Ali Al Dallal
|
|
|
|
Licensed under the MIT license.
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
in the Software without restriction, including without limitation the rights
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
all copies or substantial portions of the Software.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
SOFTWARE.
|
|
*/
|
|
for(var xo={ach:"Lwo",ady:"\u0410\u0434\u044b\u0433\u044d\u0431\u0437\u044d",af:"Afrikaans","af-NA":"Afrikaans (Namibia)","af-ZA":"Afrikaans (South Africa)",ak:"T\u0255\u0265i",ar:"\u0627\u0644\u0639\u0631\u0628\u064a\u0629","ar-AR":"\u0627\u0644\u0639\u0631\u0628\u064a\u0629","ar-MA":"\u0627\u0644\u0639\u0631\u0628\u064a\u0629","ar-SA":"\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (\u0627\u0644\u0633\u0639\u0648\u062f\u064a\u0629)","ay-BO":"Aymar aru",az:"Az\u0259rbaycan dili","az-AZ":"Az\u0259rbaycan dili",
|
|
"be-BY":"\u0411\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0430\u044f",bg:"\u0411\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438","bg-BG":"\u0411\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438",bn:"\u09ac\u09be\u0982\u09b2\u09be","bn-IN":"\u09ac\u09be\u0982\u09b2\u09be (\u09ad\u09be\u09b0\u09a4)","bn-BD":"\u09ac\u09be\u0982\u09b2\u09be(\u09ac\u09be\u0982\u09b2\u09be\u09a6\u09c7\u09b6)","bs-BA":"Bosanski",ca:"Catal\u00e0","ca-ES":"Catal\u00e0",cak:"Maya Kaqchikel","ck-US":"\u13e3\u13b3\u13a9 (tsalagi)",
|
|
cs:"\u010ce\u0161tina","cs-CZ":"\u010ce\u0161tina",cy:"Cymraeg","cy-GB":"Cymraeg",da:"Dansk","da-DK":"Dansk",de:"Deutsch","de-AT":"Deutsch (\u00d6sterreich)","de-DE":"Deutsch (Deutschland)","de-CH":"Deutsch (Schweiz)",dsb:"Dolnoserb\u0161\u0107ina",el:"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac","el-GR":"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac",en:"English","en-GB":"English (UK)","en-AU":"English (Australia)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-IN":"English (India)",
|
|
"en-PI":"English (Pirate)","en-UD":"English (Upside Down)","en-US":"English (US)","en-ZA":"English (South Africa)","en@pirate":"English (Pirate)",eo:"Esperanto","eo-EO":"Esperanto",es:"Espa\u00f1ol","es-AR":"Espa\u00f1ol (Argentine)","es-419":"Espa\u00f1ol (Latinoam\u00e9rica)","es-CL":"Espa\u00f1ol (Chile)","es-CO":"Espa\u00f1ol (Colombia)","es-EC":"Espa\u00f1ol (Ecuador)","es-ES":"Espa\u00f1ol (Espa\u00f1a)","es-LA":"Espa\u00f1ol (Latinoam\u00e9rica)","es-NI":"Espa\u00f1ol (Nicaragua)","es-MX":"Espa\u00f1ol (M\u00e9xico)",
|
|
"es-US":"Espa\u00f1ol (Estados Unidos)","es-VE":"Espa\u00f1ol (Venezuela)",et:"eesti keel","et-EE":"Eesti (Estonia)",eu:"Euskara","eu-ES":"Euskara",fa:"\u0641\u0627\u0631\u0633\u06cc","fa-IR":"\u0641\u0627\u0631\u0633\u06cc","fb-LT":"Leet Speak",ff:"Fulah",fi:"Suomi","fi-FI":"Suomi","fo-FO":"F\u00f8royskt",fr:"Fran\u00e7ais","fr-CA":"Fran\u00e7ais (Canada)","fr-FR":"Fran\u00e7ais (France)","fr-BE":"Fran\u00e7ais (Belgique)","fr-CH":"Fran\u00e7ais (Suisse)","fy-NL":"Frysk",ga:"Gaeilge","ga-IE":"Gaeilge (Gaelic)",
|
|
gl:"Galego","gl-ES":"Galego","gn-PY":"Ava\u00f1e'\u1ebd","gu-IN":"\u0a97\u0ac1\u0a9c\u0ab0\u0abe\u0aa4\u0ac0","gx-GR":"\u1f19\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ae \u1f00\u03c1\u03c7\u03b1\u03af\u03b1",he:"\u05e2\u05d1\u05e8\u05d9\u05ea\u200f","he-IL":"\u05e2\u05d1\u05e8\u05d9\u05ea\u200f",hi:"\u0939\u093f\u0928\u094d\u0926\u0940","hi-IN":"\u0939\u093f\u0928\u094d\u0926\u0940",hr:"Hrvatski","hr-HR":"Hrvatski",hsb:"Hornjoserb\u0161\u0107ina",ht:"Krey\u00f2l",hu:"Magyar","hu-HU":"Magyar","hy-AM":"\u0540\u0561\u0575\u0565\u0580\u0565\u0576",
|
|
id:"Bahasa Indonesia","id-ID":"Bahasa Indonesia",is:"\u00cdslenska","is-IS":"\u00cdslenska (Iceland)",it:"Italiano","it-IT":"Italiano",ja:"\u65e5\u672c\u8a9e","ja-JP":"\u65e5\u672c\u8a9e","jv-ID":"Basa Jawa","ka-GE":"\u10e5\u10d0\u10e0\u10d7\u10e3\u10da\u10d8","kk-KZ":"\u049a\u0430\u0437\u0430\u049b\u0448\u0430",km:"\u1797\u17b6\u179f\u17b6\u1781\u17d2\u1798\u17c2\u179a","km-KH":"\u1797\u17b6\u179f\u17b6\u1781\u17d2\u1798\u17c2\u179a",kab:"Taqbaylit",kn:"\u0c95\u0ca8\u0ccd\u0ca8\u0ca1","kn-IN":"\u0c95\u0ca8\u0ccd\u0ca8\u0ca1 (India)",
|
|
ko:"\ud55c\uad6d\uc5b4","ko-KR":"\ud55c\uad6d\uc5b4 (\u97e9\u56fd)",ku:"Kurd\u00ee","ku-TR":"Kurd\u00ee",la:"Latin","la-VA":"Latin",lb:"L\u00ebtzebuergesch","li-NL":"L\u00e8mb\u00f6rgs",lt:"Lietuvi\u0173","lt-LT":"Lietuvi\u0173",lv:"Latvie\u0161u","lv-LV":"Latvie\u0161u",mai:"\u092e\u0948\u0925\u093f\u0932\u0940, \u09ae\u09c8\u09a5\u09bf\u09b2\u09c0","mg-MG":"Malagasy",mk:"\u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438","mk-MK":"\u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438 (\u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438)",
|
|
ml:"\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02","ml-IN":"\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02","mn-MN":"\u041c\u043e\u043d\u0433\u043e\u043b",mr:"\u092e\u0930\u093e\u0920\u0940","mr-IN":"\u092e\u0930\u093e\u0920\u0940",ms:"Bahasa Melayu","ms-MY":"Bahasa Melayu",mt:"Malti","mt-MT":"Malti",my:"\u1017\u1019\u102c\u1005\u1000\u102c",nb:"Norsk (bokm\u00e5l)","nb-NO":"Norsk (bokm\u00e5l)",ne:"\u0928\u0947\u092a\u093e\u0932\u0940","ne-NP":"\u0928\u0947\u092a\u093e\u0932\u0940",nl:"Nederlands","nl-BE":"Nederlands (Belgi\u00eb)",
|
|
"nl-NL":"Nederlands (Nederland)","nn-NO":"Norsk (nynorsk)",no:"Norsk",oc:"Occitan","or-IN":"\u0b13\u0b21\u0b3c\u0b3f\u0b06",pa:"\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40","pa-IN":"\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40 (\u0a2d\u0a3e\u0a30\u0a24 \u0a28\u0a42\u0a70)",pl:"Polski","pl-PL":"Polski","ps-AF":"\u067e\u069a\u062a\u0648",pt:"Portugu\u00eas","pt-BR":"Portugu\u00eas (Brasil)","pt-PT":"Portugu\u00eas (Portugal)","qu-PE":"Qhichwa","rm-CH":"Rumantsch",ro:"Rom\u00e2n\u0103","ro-RO":"Rom\u00e2n\u0103",ru:"\u0420\u0443\u0441\u0441\u043a\u0438\u0439",
|
|
"ru-RU":"\u0420\u0443\u0441\u0441\u043a\u0438\u0439","sa-IN":"\u0938\u0902\u0938\u094d\u0915\u0943\u0924\u092e\u094d","se-NO":"Davvis\u00e1megiella","si-LK":"\u0db4\u0dc5\u0dcf\u0dad",sk:"Sloven\u010dina","sk-SK":"Sloven\u010dina (Slovakia)",sl:"Sloven\u0161\u010dina","sl-SI":"Sloven\u0161\u010dina","so-SO":"Soomaaliga",sq:"Shqip","sq-AL":"Shqip",sr:"\u0421\u0440\u043f\u0441\u043a\u0438","sr-RS":"\u0421\u0440\u043f\u0441\u043a\u0438 (Serbia)",su:"Basa Sunda",sv:"Svenska","sv-SE":"Svenska",sw:"Kiswahili",
|
|
"sw-KE":"Kiswahili",ta:"\u0ba4\u0bae\u0bbf\u0bb4\u0bcd","ta-IN":"\u0ba4\u0bae\u0bbf\u0bb4\u0bcd",te:"\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41","te-IN":"\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41",tg:"\u0437\u0430\u0431\u043e\u0301\u043d\u0438 \u0442\u043e\u04b7\u0438\u043a\u04e3\u0301","tg-TJ":"\u0442\u043e\u04b7\u0438\u043a\u04e3",th:"\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22","th-TH":"\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22 (\u0e1b\u0e23\u0e30\u0e40\u0e17\u0e28\u0e44\u0e17\u0e22)",tl:"Filipino","tl-PH":"Filipino",
|
|
tlh:"tlhIngan-Hol",tr:"T\u00fcrk\u00e7e","tr-TR":"T\u00fcrk\u00e7e","tt-RU":"\u0442\u0430\u0442\u0430\u0440\u0447\u0430",uk:"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430","uk-UA":"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430",ur:"\u0627\u0631\u062f\u0648","ur-PK":"\u0627\u0631\u062f\u0648",uz:"O'zbek","uz-UZ":"O'zbek",vi:"Ti\u1ebfng Vi\u1ec7t","vi-VN":"Ti\u1ebfng Vi\u1ec7t","xh-ZA":"isiXhosa",yi:"\u05d9\u05d9\u05b4\u05d3\u05d9\u05e9","yi-DE":"\u05d9\u05d9\u05b4\u05d3\u05d9\u05e9 (German)",
|
|
zh:"\u4e2d\u6587","zh-HANS":"\u4e2d\u6587\u7b80\u4f53","zh-HANT":"\u4e2d\u6587\u7e41\u9ad4","zh-CN":"\u4e2d\u6587\uff08\u4e2d\u56fd\uff09","zh-HK":"\u4e2d\u6587\uff08\u9999\u6e2f\uff09","zh-SG":"\u4e2d\u6587\uff08\u65b0\u52a0\u5761\uff09","zh-TW":"\u4e2d\u6587\uff08\u53f0\u7063\uff09","zu-ZA":"isiZulu"},yo=t(Object.keys(xo)),zo=yo.next();!zo.done;zo=yo.next()){var Ao=zo.value;xo[Ao.toLowerCase()]=xo[Ao]};function Bo(a,b){if(a.lineBreak)return"\n";if(a.nestedCues.length)return a.nestedCues.map(function(g){return Bo(g,a)}).join("");if(!a.payload)return a.payload;var c=[],d=a.fontWeight>=ne,e=a.fontStyle==oe,f=a.textDecoration.includes(pe);d&&c.push(["b"]);e&&c.push(["i"]);f&&c.push(["u"]);e=a.color;""==e&&b&&(e=b.color);d="";(e=Co(e))&&(d+="."+e);e=a.backgroundColor;""==e&&b&&(e=b.backgroundColor);(b=Co(e))&&(d+=".bg_"+b);d&&c.push(["c",d]);return c.reduceRight(function(g,h){var k=t(h);h=k.next().value;
|
|
k=k.next().value;return"<"+h+(void 0===k?"":k)+">"+g+"</"+h+">"},a.payload)}
|
|
function Co(a){a=a.toLowerCase();var b=a.replace(/\s/g,"").match(/^rgba?\((\d+),(\d+),(\d+),?([^,\s)]+)?/i);b?a="#"+(parseInt(b[1],10)|256).toString(16).slice(1)+(parseInt(b[2],10)|256).toString(16).slice(1)+(parseInt(b[3],10)|256).toString(16).slice(1):a.startsWith("#")&&7<a.length&&(a=a.slice(0,7));switch(a){case "white":case "#fff":case "#ffffff":return"white";case "lime":case "#0f0":case "#00ff00":return"lime";case "cyan":case "#0ff":case "#00ffff":return"cyan";case "red":case "#f00":case "#ff0000":return"red";
|
|
case "yellow":case "#ff0":case "#ffff00":return"yellow";case "magenta":case "#f0f":case "#ff00ff":return"magenta";case "blue":case "#00f":case "#0000ff":return"blue";case "black":case "#000":case "#000000":return"black"}return null}function Do(a,b){var c=[];a=t(Eo(a));for(var d=a.next();!d.done;d=a.next())if(d=d.value,d.isContainer)c.push.apply(c,x(Do(d.nestedCues,d)));else{var e=d.clone();e.nestedCues=[];e.payload=Bo(d,b);c.push(e)}return c}
|
|
function Eo(a){var b=[];a=t(a);for(var c=a.next(),d={};!c.done;d={cg:void 0},c=a.next())d.cg=c.value,b.some(function(e){return function(f){return ce(e.cg,f)}}(d))||b.push(d.cg);return b}
|
|
function Fo(a){function b(d){for(var e=5381,f=d.length;f;)e=33*e^d.charCodeAt(--f);return(e>>>0).toString()}if(a.startTime>=a.endTime)return null;var c=new VTTCue(a.startTime,a.endTime,a.payload);c.id=b(a.startTime.toString())+b(a.endTime.toString())+b(a.payload);c.lineAlign=a.lineAlign;c.positionAlign=a.positionAlign;a.size&&(c.size=a.size);try{c.align=a.textAlign}catch(d){}"center"==a.textAlign&&"center"!=c.align&&(c.align="middle");"vertical-lr"==a.writingMode?c.vertical="lr":"vertical-rl"==a.writingMode&&
|
|
(c.vertical="rl");1==a.lineInterpretation&&(c.snapToLines=!1);null!=a.line&&(c.line=a.line);null!=a.position&&(c.position=a.position);return c}
|
|
function Go(a,b){var c=Do(b),d=[];b=a.cues?Array.from(a.cues):[];c=t(c);for(var e=c.next(),f={};!e.done;f={ld:void 0},e=c.next())f.ld=e.value,!b.some(function(g){return function(h){return h.startTime==g.ld.startTime&&h.endTime==g.ld.endTime&&h.text==g.ld.payload?!0:!1}}(f))&&f.ld.payload&&(e=Fo(f.ld))&&d.push(e);b=d.slice().sort(function(g,h){return g.startTime!=h.startTime?g.startTime-h.startTime:g.endTime!=h.endTime?g.endTime-h.startTime:"line"in VTTCue.prototype?d.indexOf(h)-d.indexOf(g):d.indexOf(g)-
|
|
d.indexOf(h)});b=t(b);for(c=b.next();!c.done;c=b.next())a.addCue(c.value)}function Ho(a,b){var c=!1;"disabled"===a.mode&&(c=!0,a.mode="hidden");for(var d=0;d<a.cues.length;){var e=a.cues[d];b(e)?a.removeCue(e):d++}c&&(a.mode="disabled")};function Io(a){var b=this;this.h=a;this.l=new jb;this.j=null;this.i=new Map;this.g=-1;this.s=!1;this.o=null;this.B=function(){b.l.Ja(b.h,"textchanged",b.m);b.l.Ja(b.j.textTracks,"change",b.A);for(var c=t(b.i.values()),d=c.next();!d.done;d=c.next())d.value.remove();b.i.clear();b.g=-1;b.j=null};this.m=function(){var c=new Map,d=b.h.yc();d=t(d);for(var e=d.next();!e.done;e=d.next()){e=e.value;if(b.i.has(e.id)){var f=b.i.get(e.id);e.active||"disabled"===f.track.mode||(f.track.mode="disabled");b.i.delete(e.id)}else{f=
|
|
b.j.ownerDocument.createElement("track");f.kind=Jo(e);var g=f,h=void 0;if(e.label)h=e.label;else if(e.language)if(e.language in xo)h=xo[e.language];else{var k=mf(e.language);k in xo&&(h=xo[k]+" ("+e.language+")")}h||(h=e.originalTextId,e.language&&e.language!==e.originalTextId&&(h+=" ("+e.language+")"));g.label=h;e.language in xo&&(f.srclang=e.language);"CHROMIUM"===qb().Ea()&&(f.src="data:,WEBVTT");f.track.mode="disabled";b.j.appendChild(f)}c.set(e.id,f);e.active&&(b.g=e.id)}d=t(b.i.values());for(e=
|
|
d.next();!e.done;e=d.next())e.value.remove();-1<b.g&&(c.has(b.g)?(d=c.get(b.g).track,"disabled"===d.mode&&(d.mode=b.s?"showing":"hidden")):b.g=-1);b.i=c};this.A=function(){if(!b.o){var c=b.j;b.o=(new $e(function(){b.o=null;if(b.j===c){var d=-1,e=!1;if(-1<b.g){var f=b.i.get(b.g);"showing"===f.track.mode?(d=b.g,e=!0):"hidden"===f.track.mode&&(d=b.g)}if(!e)for(e=t(b.i),f=e.next();!f.done;f=e.next()){var g=t(f.value);f=g.next().value;g=g.next().value;if("showing"===g.track.mode){d=f;break}else 0>d&&"hidden"===
|
|
g.track.mode&&(d=f)}e=t(b.i);for(f=e.next();!f.done;f=e.next())g=t(f.value),f=g.next().value,g=g.next().value,f!==d&&"disabled"!==g.track.mode&&(g.track.mode="disabled");b.g!==d&&(b.g=d,-1<d&&b.h.dh({id:d}));b.h.ih(-1<d&&"showing"===b.i.get(d).track.mode)}})).ha(0)}};this.l.D(a,"loaded",function(){return b.enableTextDisplayer()})}p=Io.prototype;p.configure=function(){};
|
|
p.remove=function(a,b){if(!this.j||0>this.g)return!1;Ho(this.i.get(this.g).track,function(c){return c.startTime<b&&c.endTime>a});return!0};p.append=function(a){!this.j||0>this.g||Go(this.i.get(this.g).track,a)};p.destroy=function(){this.h&&(this.j&&this.B(),this.h=null);this.l&&(this.l.release(),this.l=null);return Promise.resolve()};p.isTextVisible=function(){return this.s};
|
|
p.setTextVisibility=function(a){this.s=a;if(-1<this.g){var b=this.i.get(this.g).track;"disabled"!==b.mode&&(a=a?"showing":"hidden",b.mode!==a&&(b.mode=a))}else if(this.h&&3===this.h.m)if(b=Array.from(this.h.h.textTracks).filter(function(d){return["captions","subtitles","forced"].includes(d.kind)}),a){a=null;b=t(b);for(var c=b.next();!c.done;c=b.next())if(c=c.value,"showing"===c.mode){a=null;break}else a||"hidden"!==c.mode||(a=c);a&&(a.mode="showing")}else for(a=t(b),b=a.next();!b.done;b=a.next())b=
|
|
b.value,"showing"===b.mode&&(b.mode="hidden")};p.setTextLanguage=function(){};p.enableTextDisplayer=function(){!this.j&&this.h&&2===this.h.m&&(this.j=this.h.h,this.l.za(this.h,"unloading",this.B),this.l.D(this.h,"textchanged",this.m),this.l.D(this.j.textTracks,"change",this.A),this.m())};
|
|
function Jo(a){var b=qb();return a.forced&&"WEBKIT"===b.Ea()?"forced":"caption"===a.kind||a.roles&&a.roles.some(function(c){return c.includes("transcribes-spoken-dialog")})&&a.roles.some(function(c){return c.includes("describes-music-and-sound")})?"captions":"subtitles"}T("shaka.text.NativeTextDisplayer",Io);Io.prototype.enableTextDisplayer=Io.prototype.enableTextDisplayer;Io.prototype.setTextLanguage=Io.prototype.setTextLanguage;Io.prototype.setTextVisibility=Io.prototype.setTextVisibility;
|
|
Io.prototype.isTextVisible=Io.prototype.isTextVisible;Io.prototype.destroy=Io.prototype.destroy;Io.prototype.append=Io.prototype.append;Io.prototype.remove=Io.prototype.remove;Io.prototype.configure=Io.prototype.configure;function Ko(a,b){wb("SimpleTextDisplayer","Please migrate to NativeTextDisplayer");this.h=a;this.i=b;this.g=null;a=t(Array.from(this.h.textTracks));for(b=a.next();!b.done;b=a.next())b=b.value,"metadata"!==b.kind&&"chapters"!==b.kind&&(b.mode="disabled",b.label==this.i&&(this.g=b));this.g&&(this.g.mode="hidden")}p=Ko.prototype;p.configure=function(){};p.remove=function(a,b){if(!this.g)return!1;Ho(this.g,function(c){return c.startTime<b&&c.endTime>a});return!0};
|
|
p.append=function(a){this.g&&Go(this.g,a)};p.destroy=function(){this.g&&(Ho(this.g,function(){return!0}),this.g.mode="disabled");this.g=this.h=null;return Promise.resolve()};p.isTextVisible=function(){return this.g?"showing"==this.g.mode:!1};p.setTextVisibility=function(a){a&&!this.g&&Lo(this);this.g&&(this.g.mode=a?"showing":"hidden")};p.setTextLanguage=function(){};p.enableTextDisplayer=function(){Lo(this)};function Lo(a){a.h&&!a.g&&(a.g=a.h.addTextTrack("subtitles",a.i),a.g.mode="hidden")}
|
|
T("shaka.text.SimpleTextDisplayer",Ko);Ko.prototype.enableTextDisplayer=Ko.prototype.enableTextDisplayer;Ko.prototype.setTextLanguage=Ko.prototype.setTextLanguage;Ko.prototype.setTextVisibility=Ko.prototype.setTextVisibility;Ko.prototype.isTextVisible=Ko.prototype.isTextVisible;Ko.prototype.destroy=Ko.prototype.destroy;Ko.prototype.append=Ko.prototype.append;Ko.prototype.remove=Ko.prototype.remove;Ko.prototype.configure=Ko.prototype.configure;function Mo(){}p=Mo.prototype;p.configure=function(){};p.remove=function(){};p.append=function(){};p.destroy=function(){};p.isTextVisible=function(){return!1};p.setTextVisibility=function(){};p.setTextLanguage=function(){};p.enableTextDisplayer=function(){};T("shaka.text.StubTextDisplayer",Mo);Mo.prototype.enableTextDisplayer=Mo.prototype.enableTextDisplayer;Mo.prototype.setTextLanguage=Mo.prototype.setTextLanguage;Mo.prototype.setTextVisibility=Mo.prototype.setTextVisibility;
|
|
Mo.prototype.isTextVisible=Mo.prototype.isTextVisible;Mo.prototype.destroy=Mo.prototype.destroy;Mo.prototype.append=Mo.prototype.append;Mo.prototype.remove=Mo.prototype.remove;Mo.prototype.configure=Mo.prototype.configure;function No(a,b){var c=this;this.m=!1;this.h=[];this.j=a;this.o=b;this.B=this.s=null;this.g=document.createElement("div");this.g.classList.add("shaka-text-container");this.g.style.textAlign="center";this.g.style.display="flex";this.g.style.flexDirection="column";this.g.style.alignItems="center";this.g.style.justifyContent="flex-end";this.A=new $e(function(){c.j.paused||Oo(c)});Po(this);this.l=new Map;this.i=new jb;this.i.D(document,"fullscreenchange",function(){Oo(c,!0)});this.i.D(this.j,"seeking",
|
|
function(){Oo(c,!0)});this.i.D(this.j,"ratechange",function(){Po(c)});this.i.D(this.j,"resize",function(){var d=c.j,e=d.videoWidth;d=d.videoHeight;e&&d?c.s=e/d:c.s=null});this.C=null;"ResizeObserver"in window&&(this.C=new ResizeObserver(function(){Oo(c,!0)}),this.C.observe(this.g));this.F=new Map}p=No.prototype;p.configure=function(a){this.B=a;Po(this);Oo(this,!0)};
|
|
p.append=function(a){var b=[].concat(x(this.h));a=t(Eo(a));for(var c=a.next(),d={};!c.done;d={dg:void 0},c=a.next())d.dg=c.value,b.some(function(e){return function(f){return ce(f,e.dg)}}(d))||this.h.push(d.dg);this.h.length&&Po(this);Oo(this)};
|
|
p.destroy=function(){if(!this.g)return Promise.resolve();this.g.parentElement&&this.o.removeChild(this.g);this.g=null;this.m=!1;this.h=[];this.A&&(this.A.stop(),this.A=null);this.l.clear();this.i&&(this.i.release(),this.i=null);this.C&&(this.C.disconnect(),this.C=null);return Promise.resolve()};p.remove=function(a,b){if(!this.g)return!1;var c=this.h.length;this.h=this.h.filter(function(d){return d.startTime<a||d.endTime>=b});Oo(this,c>this.h.length);this.h.length||Po(this);return!0};
|
|
p.isTextVisible=function(){return this.m};p.setTextVisibility=function(a){(this.m=a)?(this.g.parentElement||this.o.appendChild(this.g),Oo(this,!0)):this.g.parentElement&&this.o.removeChild(this.g)};p.setTextLanguage=function(a){a&&"und"!=a?this.g.setAttribute("lang",a):this.g.setAttribute("lang","")};p.enableTextDisplayer=function(){};function Po(a){a.A&&(a.h.length?a.A.Ga((a.B?a.B.captionsUpdatePeriod:.25)/Math.max(1,Math.abs(a.j.playbackRate))):a.A.stop())}
|
|
function Qo(a,b){for(;null!=b;){if(b==a.g)return!0;b=b.parentElement}return!1}
|
|
function Ro(a,b,c,d,e){var f=!1,g=[],h=[];b=t(b);for(var k=b.next();!k.done;k=b.next()){k=k.value;e.push(k);var l=a.l.get(k),m=k.startTime<=d&&k.endTime>d,n=l?l.Yi:null;l&&(g.push(l.eg),l.Uc&&g.push(l.Uc),m||(f=!0,a.l.delete(k),l=null));m&&(h.push(k),l?Qo(a,n)||(f=!0):(So(a,k,e),l=a.l.get(k),n=l.Yi,f=!0));0<k.nestedCues.length&&n&&Ro(a,k.nestedCues,n,d,e);e.pop()}if(f){d=t(g);for(e=d.next();!e.done;e=d.next())e=e.value,e.parentElement&&e.parentElement.removeChild(e);h.sort(function(q,r){return q.startTime!=
|
|
r.startTime?q.startTime-r.startTime:q.endTime-r.endTime});h=t(h);for(d=h.next();!d.done;d=h.next())d=a.l.get(d.value),d.Uc?(d.Uc.contains(c)&&d.Uc.removeChild(c),c.appendChild(d.Uc),d.Uc.appendChild(d.eg)):c.appendChild(d.eg)}}function Oo(a,b){if(a.g){var c=a.j.currentTime;if(!a.m||(void 0===b?0:b)){b=t(a.F.values());for(var d=b.next();!d.done;d=b.next())Dj(d.value);Dj(a.g);a.l.clear();a.F.clear()}a.m&&Ro(a,a.h,a.g,c,[])}}
|
|
function So(a,b,c){var d=1<c.length,e=d?"span":"div";b.lineBreak&&(e="br");b.rubyTag&&(e=b.rubyTag);d=!d&&0<b.nestedCues.length;var f=document.createElement(e);"br"!=e&&To(a,f,b,c,d);c=null;if(b.region&&b.region.id){var g=b.region,h=a.s===4/3?2.5:1.9;c=g.id+"_"+g.width+"x"+g.height+(g.heightUnits==Rc?"%":"px")+"-"+g.viewportAnchorX+"x"+g.viewportAnchorY+(g.viewportAnchorUnits==Rc?"%":"px");if(a.F.has(c))c=a.F.get(c);else{e=document.createElement("span");var k=g.heightUnits==Rc?"%":"px",l=g.widthUnits==
|
|
Rc?"%":"px",m=g.viewportAnchorUnits==Rc?"%":"px";e.id="shaka-text-region---"+c;e.classList.add("shaka-text-region");e.style.position="absolute";var n=g.height,q=g.width;2===g.heightUnits&&(n=5.33*g.height,k="%");2===g.widthUnits&&(q=g.width*h,l="%");e.style.height=n+k;e.style.width=q+l;2===g.viewportAnchorUnits?(h=g.viewportAnchorY/75*100,k=g.viewportAnchorX/(a.s===4/3?160:210)*100,h-=g.regionAnchorY*n/100,k-=g.regionAnchorX*q/100,e.style.top=h+"%",e.style.left=k+"%"):(e.style.top=g.viewportAnchorY-
|
|
g.regionAnchorY*n/100+m,e.style.left=g.viewportAnchorX-g.regionAnchorX*q/100+m);0!==g.heightUnits&&0!==g.widthUnits&&0!==g.viewportAnchorUnits&&(g=Math.max(0,Math.min(100-(parseInt(e.style.width.slice(0,-1),10)||0),parseInt(e.style.left.slice(0,-1),10)||0)),e.style.top=Math.max(0,Math.min(100-(parseInt(e.style.height.slice(0,-1),10)||0),parseInt(e.style.top.slice(0,-1),10)||0))+"%",e.style.left=g+"%");e.style.display="flex";e.style.flexDirection="column";e.style.alignItems="center";e.style.justifyContent=
|
|
"before"==b.displayAlign?"flex-start":"center"==b.displayAlign?"center":"flex-end";a.F.set(c,e);c=e}}e=f;d&&(e=document.createElement("span"),e.classList.add("shaka-text-wrapper"),e.style.backgroundColor=b.backgroundColor,e.style.lineHeight="normal",f.appendChild(e));a.l.set(b,{eg:f,Yi:e,Uc:c})}
|
|
function Uo(a){var b=a.direction,c=a.positionAlign;a=a.textAlign;return c!==Rd?c:"left"===a||"start"===a&&b===Ud||"end"===a&&"rtl"===b?"line-left":"right"===a||"start"===a&&"rtl"===b||"end"===a&&b===Ud?"line-right":"center"}
|
|
function To(a,b,c,d,e){var f=b.style,g=0==c.nestedCues.length,h=1<d.length;f.whiteSpace="pre-wrap";var k=c.payload.replace(/\s+$/g,function(m){return"\u00a0".repeat(m.length)});f.webkitTextStrokeColor=c.textStrokeColor;f.webkitTextStrokeWidth=c.textStrokeWidth;f.color=c.color;f.direction=c.direction;f.opacity=c.opacity;f.paddingLeft=Vo(c.linePadding,c,a.o);f.paddingRight=Vo(c.linePadding,c,a.o);f.textCombineUpright=c.textCombineUpright;f.textShadow=c.textShadow;if(c.backgroundImage)f.backgroundImage=
|
|
"url('"+c.backgroundImage+"')",f.backgroundRepeat="no-repeat",f.backgroundSize="contain",f.backgroundPosition="center",c.backgroundColor&&(f.backgroundColor=c.backgroundColor),f.width="100%",f.height="100%";else{if(c.nestedCues.length)var l=b;else l=document.createElement("span"),b.appendChild(l);c.border&&(l.style.border=c.border);e||((b=Wo(d,function(m){return m.backgroundColor}))?l.style.backgroundColor=b:k&&(l.style.backgroundColor="rgba(0, 0, 0, 0.8)"));k&&(l.setAttribute("translate","no"),l.textContent=
|
|
k)}if(h&&!d[d.length-1].isContainer)f.display="inline";else{f.display="flex";f.flexDirection="column";f.alignItems="center";if("left"==c.textAlign||"start"==c.textAlign)f.width="100%",f.alignItems="start";else if("right"==c.textAlign||"end"==c.textAlign)f.width="100%",f.alignItems="end";f.justifyContent="before"==c.displayAlign?"flex-start":"center"==c.displayAlign?"center":"flex-end"}g||(f.margin="0");f.fontFamily=c.fontFamily;f.fontWeight=c.fontWeight.toString();f.fontStyle=c.fontStyle;f.letterSpacing=
|
|
c.letterSpacing;f.fontSize=Vo(c.fontSize,c,a.o,a.B?a.B.fontScaleFactor:1);d=c.line;null!=d&&(g=c.lineInterpretation,g==Wd&&(g=1,h=16,a.s&&1>a.s&&(h=32),d=0>d?100+d/h*100:d/h*100),1==g&&(f.position="absolute",c.writingMode==Vd?(f.width="100%",c.lineAlign==Xd?f.top=d+"%":"end"==c.lineAlign&&(f.bottom=100-d+"%")):"vertical-lr"==c.writingMode?(f.height="100%",c.lineAlign==Xd?f.left=d+"%":"end"==c.lineAlign&&(f.right=100-d+"%")):(f.height="100%",c.lineAlign==Xd?f.right=d+"%":"end"==c.lineAlign&&(f.left=
|
|
100-d+"%"))));f.lineHeight=c.lineHeight;a=Uo(c);"line-left"==a?(f.cssFloat="left",null!==c.position&&(f.position="absolute",c.writingMode==Vd?(f.left=c.position+"%",f.width="auto"):f.top=c.position+"%")):"line-right"==a?(f.cssFloat="right",null!==c.position&&(f.position="absolute",c.writingMode==Vd?(f.right=100-c.position+"%",f.width="auto"):f.bottom=c.position+"%")):null!==c.position&&50!=c.position&&(f.position="absolute",c.writingMode==Vd?(f.left=c.position+"%",f.width="auto"):f.top=c.position+
|
|
"%");f.textAlign=c.textAlign;f.textDecoration=c.textDecoration.join(" ");f.writingMode=c.writingMode;"writingMode"in document.documentElement.style&&f.writingMode==c.writingMode||(f.webkitWritingMode=c.writingMode);c.size&&(c.writingMode==Vd?f.width=c.size+"%":f.height=c.size+"%")}
|
|
function Vo(a,b,c,d){d=void 0===d?1:d;var e=(e=(new RegExp(/(\d*\.?\d+)([a-z]+|%+)/)).exec(a))?{value:Number(e[1]),unit:e[2]}:null;if(!e)return a;a=e.unit;d*=e.value;switch(a){case "%":return d/100*c.clientHeight/b.cellResolution.rows+"px";case "c":return c.clientHeight*d/b.cellResolution.rows+"px";default:return d+a}}function Wo(a,b){for(var c=a.length-1;0<=c;c--){var d=b(a[c]);if(d||0===d)return d}return null}T("shaka.text.UITextDisplayer",No);No.prototype.enableTextDisplayer=No.prototype.enableTextDisplayer;
|
|
No.prototype.setTextLanguage=No.prototype.setTextLanguage;No.prototype.setTextVisibility=No.prototype.setTextVisibility;No.prototype.isTextVisible=No.prototype.isTextVisible;No.prototype.remove=No.prototype.remove;No.prototype.destroy=No.prototype.destroy;No.prototype.append=No.prototype.append;No.prototype.configure=No.prototype.configure;function Xo(a,b){function c(f){for(var g=f,h=t(b),k=h.next();!k.done;k=h.next())k=k.value,k.end&&k.start<f&&(g+=k.end-k.start);f=Math.floor(g/3600);h=Math.floor(g/60%60);k=Math.floor(g%60);g=Math.floor(1E3*g%1E3);return(10>f?"0":"")+f+":"+(10>h?"0":"")+h+":"+(10>k?"0":"")+k+"."+(100>g?10>g?"00":"0":"")+g}var d=Do(a);a="WEBVTT\n\n";d=t(d);for(var e=d.next();!e.done;e=d.next())e=e.value,a+=c(e.startTime)+" --\x3e "+c(e.endTime)+function(f){var g=[];switch(f.textAlign){case "left":g.push("align:left");
|
|
break;case "right":g.push("align:right");break;case Sd:g.push("align:middle");break;case "start":g.push("align:start");break;case "end":g.push("align:end")}switch(f.writingMode){case "vertical-lr":g.push("vertical:lr");break;case "vertical-rl":g.push("vertical:rl")}return g.length?" "+g.join(" "):""}(e)+"\n",a+=e.payload+"\n\n";return a}T("shaka.text.WebVttGenerator",function(){});function Yo(a,b){this.h=a;this.g=b;this.i=void 0;this.s=!1;this.F=!0;this.l=this.B=!1;this.o=this.m=void 0;this.A=0;this.G=!1;this.C=new jb;this.j=null}Yo.prototype.setMediaElement=function(a){this.j=a;Zo(this)};Yo.prototype.configure=function(a){this.g=a};function $o(a){a.s=!1;a.F=!0;a.B=!1;a.l=!1;a.m=0;a.o=0;a.A=0;a.G=!1;a.j=null;a.C.Ra()}function ap(a,b){a.l=b;a.l?a.i==bp?a.i=cp:a.i==dp&&(a.i=ep):a.i==cp?a.i=bp:a.i==ep&&(a.i=dp)}
|
|
function fp(a,b){if(a.g&&a.g.enabled&&a.g.version==gp&&a.j&&a.j.autoplay){var c=a.j.play();c&&c.then(function(){a.A=b}).catch(function(){a.A=0})}}
|
|
function hp(a,b,c){try{if(!a.g.enabled)return b;var d=ip(a);a:{switch(c.toLowerCase()){case "audio/mp4":case "audio/webm":case "audio/ogg":case "audio/mpeg":case "audio/aac":case "audio/flac":case "audio/wav":var e=jp;break a;case "video/webm":case "video/mp4":case "video/mpeg":case "video/mp2t":e=kp;break a;case "application/x-mpegurl":case "application/vnd.apple.mpegurl":case "application/dash+xml":case "video/vnd.mpeg.dash.mpd":case "application/vnd.ms-sstr+xml":e=lp;break a}e=void 0}d.ot=e;d.su=
|
|
!0;var f=mp(d);return np(b,f)}catch(g){return cb("CMCD_SRC_ERROR","Could not generate src CMCD data.",g),b}}function Zo(a){a.C.za(a.j,"play",function(){a.m||(a.m=Date.now())});a.C.za(a.j,"playing",function(){a.o||(a.o=Date.now())})}function ip(a){a.g.sessionId||(a.g.sessionId=window.crypto.randomUUID());return{v:a.g.version,sf:a.i,sid:a.g.sessionId,cid:a.g.contentId,mtp:a.h.getBandwidthEstimate()/1E3}}
|
|
function op(a,b,c){c=void 0===c?{}:c;var d=void 0===d?a.g.useHeaders:d;if(a.g.enabled)if(a=pp(a,c),d)d=qp(a),Object.keys(d).length&&Object.assign(b.headers,d);else{var e=mp(a);e&&(b.uris=b.uris.map(function(f){return np(f,e)}))}}function rp(a,b){var c=a.g.includeKeys;return c.length?Object.keys(b).reduce(function(d,e){c.includes(e)&&(d[e]=b[e]);return d},{}):b}
|
|
function sp(a){if(0===a.type)return tp;if(a=a.stream){var b=a.type;if("video"==b)return a.codecs&&a.codecs.includes(",")?kp:up;if("audio"==b)return jp;if("text"==b)return"application/mp4"===a.mimeType?vp:wp}}function xp(a,b){b=a.h.Lb()[b];if(!b.length)return NaN;var c=a.h.getCurrentTime();return(a=b.find(function(d){return d.start<=c&&d.end>=c}))?1E3*(a.end-c):NaN}
|
|
function yp(a,b){b=a.h.Lb()[b];if(!b.length)return 0;var c=a.h.getCurrentTime();return(a=b.find(function(d){return d.start<=c&&d.end>=c}))?1E3*(a.end-c):0}function zp(a,b){var c=a.h.Fb();if(!c.length)return NaN;a=c[0];c=t(c);for(var d=c.next();!d.done;d=c.next())d=d.value,"variant"===d.type&&d.bandwidth>a.bandwidth&&(a=d);switch(b){case up:return a.videoBandwidth||NaN;case jp:return a.audioBandwidth||NaN;default:return a.bandwidth}}
|
|
function pp(a,b){b=void 0===b?{}:b;Object.assign(b,ip(a));b.pr=a.h.sb();var c=b.ot===up||b.ot===kp;a.B&&c&&(b.bs=!0,b.su=!0,a.B=!1);null==b.su&&(b.su=a.F);b.v===gp&&(a.h.V()&&(b.ltc=a.h.Te()),c=!a.G&&a.o&&a.m?a.o-(a.A||a.m):void 0,void 0!=c&&(b.msd=c,a.G=!0));return rp(a,b)}
|
|
function mp(a){function b(n){return 100*c(n/100)}function c(n){return Math.round(n)}function d(n){return!Number.isNaN(n)&&null!=n&&""!==n&&!1!==n}var e=[],f={br:c,d:c,bl:b,dl:b,mtp:b,nor:function(n){return encodeURIComponent(n)},rtp:b,tb:c},g=Object.keys(a||{}).sort();g=t(g);for(var h=g.next();!h.done;h=g.next()){h=h.value;var k=a[h];if(d(k)&&("v"!==h||1!==k)&&("pr"!=h||1!==k)){var l=f[h];l&&(k=l(k));l=typeof k;var m=void 0;m="string"===l&&"ot"!==h&&"sf"!==h&&"st"!==h?h+"="+JSON.stringify(k):"boolean"===
|
|
l?h:"symbol"===l?h+"="+k.description:h+"="+k;e.push(m)}}return e.join(",")}function qp(a){var b=Object.keys(a),c={},d=["Object","Request","Session","Status"],e=[{},{},{},{}],f={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,ltc:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,msd:2,bs:3,rtp:3};b=t(b);for(var g=b.next();!g.done;g=b.next())g=g.value,e[null!=f[g]?f[g]:1][g]=a[g];for(a=0;a<e.length;a++)(f=mp(e[a]))&&(c["CMCD-"+d[a]]=f);return c}
|
|
function np(a,b){if(!b||a.includes("offline:"))return a;a=new Bb(a);a.g.set("CMCD",b);return a.toString()}var lp="m",jp="a",up="v",kp="av",tp="i",wp="c",vp="tt",gp=2,bp="d",cp="ld",dp="h",ep="lh";T("shaka.util.CmcdManager.StreamingFormat",{DASH:bp,Jl:cp,HLS:dp,Kl:ep,Yl:"s",OTHER:"o"});function Ap(a){this.h=a;this.g=null}p=Ap.prototype;p.configure=function(a){this.h=a};p.Uh=function(){return this.h.enabled&&this.h.applyMaximumSuggestedBitrate&&this.g&&this.g.has(Bp)?1E3*this.g.get(Bp):null};p.Sh=function(){return this.h.enabled&&this.g&&this.g.has(Cp)?1E3*this.g.get(Cp):null};p.Lj=function(){return this.h.enabled&&this.g&&this.g.has(Dp)?this.g.get(Dp):null};p.Mj=function(){return this.h.enabled&&this.g&&this.g.has(Ep)?this.g.get(Ep):null};
|
|
p.getBandwidthEstimate=function(a){var b=this.Sh();if(!b)return a;var c=this.h.estimatedThroughputWeightRatio;return 0<c&&1>=c?a*(1-c)+b*c:a};function Fp(a){return a?"false"===a.toLowerCase()?!1:/^[-0-9]/.test(a)?parseInt(a,10):a.replace(/["]+/g,""):!0}T("shaka.util.CmsdManager",Ap);Ap.prototype.getBandwidthEstimate=Ap.prototype.getBandwidthEstimate;Ap.prototype.getRoundTripTime=Ap.prototype.Mj;Ap.prototype.getResponseDelay=Ap.prototype.Lj;Ap.prototype.getEstimatedThroughput=Ap.prototype.Sh;
|
|
Ap.prototype.getMaxBitrate=Ap.prototype.Uh;var Cp="etp",Bp="mb",Dp="rd",Ep="rtt";function Gp(){this.g=null;this.h=[]}function Hp(a,b){return Q(function(c){if(1==c.g)return a.g?F(c,new Promise(function(d){return a.h.push(d)}),2):c.u(2);a.g=b;G(c)})}Gp.prototype.release=function(){0<this.h.length?this.h.shift()():this.g=null};function Y(a,b,c){b=void 0===b?null:b;Dg.call(this);var d=this;this.m=Ip;this.h=null;this.ue=b;this.oa=!1;this.ze=new jb;this.me=new jb;this.j=new jb;this.Yb=new jb;this.sd=new jb;this.F=this.I=this.C=this.H=null;this.Ce=0;this.$=new Gp;this.M=this.kc=this.W=this.i=this.mc=this.G=this.l=this.je=this.S=this.Ch=this.ka=this.L=this.Za=this.va=this.ke=this.P=this.Ba=this.K=this.eb=null;this.Ka=!1;this.Ua=this.s=null;this.se=1E9;this.ye=[];this.ab=[];this.Qf=-1;this.g=Jp(this);this.Sf=An();this.U=null;
|
|
this.De=-1;this.Xb=null;this.ua={width:Infinity,height:Infinity};this.re=new ki(this.g,this.ua,null);this.we=[];this.A=null;this.N=this.g.adaptationSetCriteriaFactory();this.N.configure({language:this.g.preferredAudioLanguage,role:this.g.preferredVariantRole,channelCount:0,zc:this.g.preferredVideoHdrLevel,spatialAudio:this.g.preferSpatialAudio,videoLayout:this.g.preferredVideoLayout,cd:this.g.preferredAudioLabel,zd:this.g.preferredVideoLabel,codecSwitchingStrategy:this.g.mediaSource.codecSwitchingStrategy,
|
|
audioCodec:"",Cd:"",Ee:0,preferredAudioCodecs:this.g.preferredAudioCodecs,preferredAudioChannelCount:this.g.preferredAudioChannelCount});this.td=this.g.preferredTextLanguage;this.qe=this.g.preferredTextRole;this.pe=this.g.preferForcedSubs;this.oe=[];c&&c(this);this.L=Kp(this);this.ka=new Ap(this.g.cmsd);this.H=Lp(this);this.vd=this.ia=this.xa=this.B=null;this.Uf=!1;this.Rf=[];this.Tf=new $e(function(){return Q(function(e){if(1==e.g)return d.ia?F(e,d.cc(d.vd,!0),3):e.u(0);if(4!=e.g)return F(e,d.load(d.ia),
|
|
4);d.Uf?d.vd.pause():d.vd.play();d.ia=null;d.Uf=!1;G(e)})});Mp&&(this.B=Mp(),this.B.configure(this.g.ads),this.sd.D(this.B,"ad-content-pause-requested",function(e){var f;return Q(function(g){if(1==g.g){d.Tf.stop();if(d.ia)return g.u(0);d.vd=d.h;d.Uf=d.Td();f=e.saveLivePosition||!1;return F(g,d.Mh(!0,f),3)}d.ia=g.h;G(g)})}),this.sd.D(this.B,"ad-content-resume-requested",function(e){e=e.offset||0;if(d.ia){var f=d.ia;f.m&&e&&("number"===typeof f.m?f.m+=e:f.m.setTime(f.m.getTime()+1E3*e))}d.Tf.ha(.1)}),
|
|
this.sd.D(this.B,"ad-content-attach-requested",function(){return Q(function(e){return d.h||!d.vd?e.u(0):F(e,d.cc(d.vd,!0),0)})}));Np&&(this.xa=Np(this),this.xa.configure(this.g.queue));this.ze.D(window,"online",function(){Op(d);d.Yg()});this.ve=new $e(function(){for(var e=Date.now()/1E3,f=!1,g=!0,h=t(d.i.variants),k=h.next();!k.done;k=h.next())k=k.value,0<k.disabledUntilTime&&k.disabledUntilTime<=e&&(k.disabledUntilTime=0,f=!0),0<k.disabledUntilTime&&(g=!1);g&&d.ve.stop();f&&Pp(d,!1,void 0,!1,!1)});
|
|
this.Pa=null;a&&(wb("Player w/ mediaElement","Please migrate from initializing Player with a mediaElement; use the attach method instead."),this.cc(a,!0));this.o=null}pa(Y,Dg);function Qp(a){null!=a.S&&(Cc(a.S),a.S.release(),a.S=null)}function Rp(a,b,c){c||b.lcevc.enabled?(Qp(a),null==a.S&&(a.S=new Ac(a.h,a.Ch,b.lcevc,c),a.I&&(a.I.M=a.S))):Qp(a)}function Sp(a,b){return new V(a,b)}p=Y.prototype;
|
|
p.destroy=function(){var a=this,b;return Q(function(c){switch(c.g){case 1:if(a.m==Tp)return c.return();Qp(a);b=a.detach();a.m=Tp;return F(c,b,2);case 2:return F(c,a.hg(),3);case 3:a.ze&&(a.ze.release(),a.ze=null);a.me&&(a.me.release(),a.me=null);a.j&&(a.j.release(),a.j=null);a.Yb&&(a.Yb.release(),a.Yb=null);a.sd&&(a.sd.release(),a.sd=null);a.Ua=null;a.g=null;a.A=null;a.ue=null;a.L=null;a.ka=null;if(!a.H){c.u(4);break}return F(c,a.H.destroy(),5);case 5:a.H=null;case 4:a.s&&(a.s.release(),a.s=null),
|
|
a.xa&&(a.xa.destroy(),a.xa=null),Dg.prototype.release.call(a),G(c)}})};function Up(a,b){Vp.set(a,b)}function Wp(a,b){a.dispatchEvent(Sp("onstatechange",(new Map).set("state",b)))}
|
|
p.cc=function(a,b){b=void 0===b?!0:b;var c=this,d,e,f;return Q(function(g){switch(g.g){case 1:if(c.m==Tp)throw new U(2,7,7E3);d=c.h&&c.h==a;if(!c.h||c.h==a){g.u(2);break}return F(g,c.detach(),2);case 2:return F(g,Xp(c,"attach"),4);case 4:if(g.h)return g.return();wa(g,5,6);d||(Wp(c,"attach"),e=function(){var h=Yp(c,!1);h&&Zp(c,h)},c.me.D(a,"error",e),c.h=a,c.L&&c.L.setMediaElement(a));qb();if(!b||!vi()||c.I){g.u(6);break}return F(g,$p(c),6);case 6:Ba(g);c.$.release();Ca(g,0);break;case 5:return f=
|
|
Aa(g),F(g,c.detach(),10);case 10:throw f;}})};p.cj=function(a){this.Ch=a};p.detach=function(a){a=void 0===a?!1:a;var b=this;return Q(function(c){if(1==c.g){if(b.m==Tp)throw new U(2,7,7E3);return F(c,b.rc(!1,a),2)}if(3!=c.g)return F(c,Xp(b,"detach"),3);if(c.h)return c.return();try{b.h&&(b.me.Ra(),b.h=null),Wp(b,"detach"),b.B&&!a&&b.B.release()}finally{b.$.release()}G(c)})};
|
|
function Xp(a,b){var c;return Q(function(d){return 1==d.g?(c=++a.Ce,F(d,Hp(a.$,b),2)):c!=a.Ce?(a.$.release(),d.return(!0)):d.return(!1)})}
|
|
p.rc=function(a,b){a=void 0===a?!0:a;b=void 0===b?!1:b;var c=this,d,e,f,g,h,k,l,m,n,q,r,u,w;return Q(function(v){switch(v.g){case 1:return c.m!=Tp&&(c.m=Ip),F(v,Xp(c,"unload"),2);case 2:if(v.h)return v.return();ya(v,3);c.Ka=!1;Wp(c,"unload");Qp(c);d=c.oe.map(function(y){return y()});c.oe=[];return F(v,Promise.all(d),5);case 5:c.dispatchEvent(Sp("unloading"));c.ke&&(c.ke.release(),c.ke=null);c.va&&(c.va.release(),c.va=null);c.Za&&(c.Za.release(),c.Za=null);c.h&&(c.j.Ra(),c.Yb.Ra());c.ve.stop();c.eb&&
|
|
(c.eb.release(),c.eb=null);c.Ba&&(c.Ba.stop(),c.Ba=null);if(!c.G){v.u(6);break}return F(v,c.G.stop(),7);case 7:c.G=null,c.mc=null;case 6:if(!c.s){v.u(8);break}return F(v,c.s.stop(),8);case 8:if(!c.l){v.u(10);break}return F(v,c.l.destroy(),11);case 11:c.l=null;case 10:c.K&&(c.K.release(),c.K=null);c.F&&(c.F.release(),c.F=null);if("webkit"!==window.shakaMediaKeysPolyfill||!c.C){v.u(12);break}return F(v,c.C.destroy(),13);case 13:c.C=null;case 12:if(!c.I){v.u(14);break}return F(v,c.I.destroy(),15);case 15:c.I=
|
|
null;case 14:if(c.B&&!b)c.B.onAssetUnload();c.ia&&!b&&(c.ia.destroy(),c.ia=null);b||c.Tf.stop();c.L&&$o(c.L);c.ka&&(c.ka.g=null);if(!c.o){v.u(16);break}return F(v,c.o.destroy(),17);case 17:c.o=null;case 16:if(c.h){e=t(c.Rf);for(f=e.next();!f.done;f=e.next())g=f.value,g.src.startsWith("blob:")&&URL.revokeObjectURL(g.src),g.remove();c.Rf=[];Cj(c.h)&&c.h.load()}if(!c.C){v.u(18);break}return F(v,c.C.destroy(),19);case 19:c.C=null;case 18:c.Pa&&c.W!=c.Pa.jd()&&(c.Pa.o||c.Pa.destroy(),c.Pa=null);c.W=null;
|
|
c.kc=null;c.P=null;if(c.i){h=t(c.i.variants);for(k=h.next();!k.done;k=h.next())for(l=k.value,m=t([l.audio,l.video]),n=m.next();!n.done;n=m.next())(q=n.value)&&q.segmentIndex&&q.segmentIndex.release();r=t(c.i.textStreams);for(u=r.next();!u.done;u=r.next())w=u.value,w.segmentIndex&&w.segmentIndex.release()}c.g&&c.g.streaming.clearDecodingCache&&(Df.clear(),pg.clear());c.i=null;c.A=new Hn;c.Ae=null;c.Xb=null;c.U=null;c.De=-1;c.ye=[];c.ab=[];c.Qf=-1;c.H&&c.H.Ih();aq(c);case 3:Ba(v);c.$.release();Ca(v,
|
|
4);break;case 4:qb();if(a&&vi()&&!c.I&&c.h)return F(v,$p(c),0);v.u(0)}})};p.Zk=function(a){this.M=a};
|
|
p.load=function(a,b,c){b=void 0===b?null:b;var d=this,e,f,g,h,k,l,m,n,q,r,u,w,v,y;return Q(function(z){switch(z.g){case 1:if(d.m==Tp)throw new U(2,7,7E3);e=null;f="";if(a instanceof Nn){if(a.o)throw new U(2,7,7006);e=a;f=e.jd()||""}else f=a||"";return F(z,Hp(d.$,"load"),2);case 2:d.$.release();if(!d.h)throw new U(2,7,7002);if(!d.W){z.u(3);break}d.W=f;return F(z,d.rc(!1),3);case 3:g=++d.Ce;h=function(){return Q(function(A){if(1==A.g)return d.Ce==g?A.u(0):e?F(A,e.destroy(),3):A.u(3);throw new U(2,7,
|
|
7E3);})};k=function(A,B){return Q(function(E){switch(E.g){case 1:return ya(E,2),F(E,Hp(d.$,B),4);case 4:return F(E,h(),5);case 5:return F(E,A(),6);case 6:return F(E,h(),7);case 7:e&&d.g&&(e.g=d.g);case 2:Ba(E),d.$.release(),Ca(E,0)}})};wa(z,5,6);null==b&&e&&(b=e.getStartTime());d.M=b;d.Ka=!1;d.dispatchEvent(Sp("loading"));if(e){c=e.W;z.u(8);break}if(c){z.u(8);break}return F(z,k(function(){return Q(function(A){if(1==A.g)return F(A,bq(d,f),2);c=A.h;G(A)})},"guessMimeType_"),8);case 8:l=!!e;if(e){Qn(e,
|
|
d);d.A=e.getStats();z.u(11);break}return F(z,cq(d,f,b,c,!0,d.g),12);case 12:(e=z.h)?(e.B=!1,Qn(e,d),d.A=e.getStats(),e.start(),e.s.catch(function(){})):d.A=new Hn;case 11:m=!e;n=Date.now()/1E3;d.A=e?e.getStats():new Hn;d.W=f;d.kc=c||null;aq(d);q=function(){var A=d.Lb(),B={start:0,end:0};if(A.total.length){B.start=Infinity;A=t(A.total);for(var E=A.next();!E.done;E=A.next())E=E.value,E.start<B.start&&(B.start=E.start),E.end>B.end&&(B.end=E.end)}return B};d.va=new Sl(q);d.va.addEventListener("regionadd",
|
|
function(A){dq(d,A.region,"metadataadded")});if(m)return F(z,k(function(){return Q(function(A){return F(A,eq(d,c),0)})},"initializeSrcEqualsDrmInner_"),23);d.Za=new Sl(q);return F(z,k(function(){return Q(function(A){if(1==A.g)return F(A,Promise.race([e.ua,e.s]),2);d.mc=e.G;var B=e;B.va=!0;d.G=B.l;d.i=e.zg();G(A)})},"waitForFinish"),15);case 15:if(d.I){z.u(16);break}return F(z,k(function(){return Q(function(A){return F(A,$p(d),0)})},"initializeMediaSourceEngineInner_"),16);case 16:return d.i&&d.i.textStreams.length&&
|
|
(d.o.enableTextDisplayer?d.o.enableTextDisplayer():wb("Text displayer w/ enableTextDisplayer",'Text displayer should have a "enableTextDisplayer" method!')),F(z,k(function(){return Q(function(A){return F(A,e.s,0)})},"waitForFinish"),18);case 18:d.g=e.getConfiguration();d.re=e.F;d.G&&d.G.setMediaElement&&d.h&&d.G.setMediaElement(d.h);d.ke=Sn(e);d.je=e.Ua;if(r=e.A)d.N=r;l&&d.h&&"AUDIO"===d.h.nodeName&&(fq(d),d.configure("manifest.disableVideo",!0));if(e.i){z.u(19);break}return F(z,k(function(){return Q(function(A){return F(A,
|
|
Xn(e,d.h),0)})},"drmEngine_.init"),19);case 19:return d.C=Tn(e),F(z,k(function(){return Q(function(A){return F(A,d.C.cc(d.h),0)})},"drmEngine_.attach"),21);case 21:return!(u=e.C)||d.Ua&&d.Ua==u||(d.s=Rn(e),d.Ua=e.C,"function"!=typeof d.s.setMediaElement&&(wb("AbrManager w/o setMediaElement","Please use an AbrManager with setMediaElement function."),d.s.setMediaElement=function(){}),"function"!=typeof d.s.setCmsdManager&&(wb("AbrManager w/o setCmsdManager","Please use an AbrManager with setCmsdManager function."),
|
|
d.s.setCmsdManager=function(){}),"function"!=typeof d.s.trySuggestStreams&&(wb("AbrManager w/o trySuggestStreams","Please use an AbrManager with trySuggestStreams function."),d.s.trySuggestStreams=function(){})),w=Un(e),v=e.K,F(z,k(function(){return Q(function(A){return F(A,gq(d,n,v,w),0)})},"loadInner_"),22);case 22:Pn(e);d.kc&&qb().Ti()&&Ne(d.kc)&&vk(d.I,d.W,d.kc);z.u(14);break;case 23:return F(z,k(function(){return Q(function(A){return F(A,hq(d,n,c),0)})},"srcEqualsInner_"),14);case 14:d.dispatchEvent(Sp("loaded"));
|
|
case 6:Ba(z);if(!e){z.u(25);break}return F(z,e.destroy(),25);case 25:d.Pa=null;Ca(z,0);break;case 5:y=Aa(z);if(!y||7E3==y.code){z.u(27);break}return F(z,d.rc(!1),27);case 27:throw y;}})};function fq(a){for(var b=t(a.i.variants),c=b.next();!c.done;c=b.next())c=c.value,c.video&&(c.video.closeSegmentIndex(),c.video=null),c.bandwidth=c.audio&&c.audio.bandwidth?c.audio.bandwidth:0;a.i.variants=a.i.variants.filter(function(d){return d.audio})}
|
|
p.Vk=function(a,b){a=void 0===a?!0:a;b=void 0===b?!1:b;var c=this,d;return Q(function(e){return 1==e.g?F(e,iq(c),2):3!=e.g?(d=e.h,F(e,c.rc(a,b),3)):e.return(d)})};p.Mh=function(a,b){a=void 0===a?!1:a;b=void 0===b?!1:b;var c=this,d;return Q(function(e){return 1==e.g?F(e,iq(c,b),2):3!=e.g?(d=e.h,F(e,c.detach(a),3)):e.return(d)})};
|
|
function iq(a,b){b=void 0===b?!1:b;var c,d;return Q(function(e){if(1==e.g){c=null;if(!(a.i&&a.G&&a.mc&&a.W&&a.g))return e.u(2);d=a.h.currentTime;a.V()&&!b&&(d=null);return F(e,jq(a,a.W,d,a.kc,a.g,!0,!1,!1),3)}if(2!=e.g){c=e.h;a.we.push(c);a.G&&a.G.setMediaElement&&a.G.setMediaElement(null);var f=c,g=a.G,h=a.mc;f.h=a.i;f.l=g;f.G=h;f=c;g=a.Ua;f.j=a.s;f.C=g;c.A=a.N;c.start();a.i=null;a.G=null;a.mc=null;a.s=null;a.Ua=null}return e.return(c)})}
|
|
p.preload=function(a,b,c,d){b=void 0===b?null:b;var e=this,f,g;return Q(function(h){if(1==h.g)return f=Jp(e),Bn(f,d||e.g,Jp(e)),F(h,cq(e,a,b,c,!1,f),2);(g=h.h)?g.start():Zp(e,new U(2,7,7005));return h.return(g)})};p.hg=function(){var a=this,b,c,d,e;return Q(function(f){b=[];c=t(a.we);for(d=c.next();!d.done;d=c.next())e=d.value,e.o||b.push(e.destroy());a.we=[];return F(f,Promise.all(b),0)})};
|
|
function cq(a,b,c,d,e,f){e=void 0===e?!1:e;var g,h,k,l,m;return Q(function(n){if(1==n.g)return d?n.u(2):F(n,bq(a,b),3);2!=n.g&&(d=n.h);if(g=kq(a,d))return n.return(null);h=f||a.g;k=!1;l=!0;e&&(a.s&&a.Ua==h.abrFactory&&(l=!1),a.h&&"AUDIO"===a.h.nodeName&&(k=!0));m=jq(a,b,c,d||null,h,!e,k,l);m=e?m.then(function(q){q.B=!1;return q}):m.then(function(q){a.we.push(q);return q});return n.return(m)})}
|
|
function jq(a,b,c,d,e,f,g,h){f=void 0===f?!0:f;g=void 0===g?!1:g;h=void 0===h?!0:h;var k,l,m,n,q,r,u,w,v,y,z,A,B,E,H;return Q(function(C){if(1==C.g){k=null;l=ed(e);g&&(l.manifest.disableVideo=!0);m=function(){return k.S&&k.o?null:k};n=function(){return m()?m().getConfiguration():a.g};if(Infinity!=a.ua.width||Infinity!=a.ua.height||a.g.ignoreHardwareResolution)return C.u(2);q=qb();return F(C,q.ec(),3)}2!=C.g&&(r=C.h,a.ua.width=r.width,a.ua.height=r.height);u=new ki(l,a.ua,null);w={networkingEngine:a.H,
|
|
filter:function(D){var I,L;return Q(function(K){if(1==K.g)return F(K,li(u,D),2);if(4!=K.g){I=K.h;if(!I)return K.u(0);L=Sp("trackschanged");return F(K,Promise.resolve(),4)}k.dispatchEvent(L);G(K)})},makeTextStreamsForClosedCaptions:function(D){return lq(a,D)},onTimelineRegionAdded:function(D){Tl(k.H,D)},onEvent:function(D){return k.dispatchEvent(D)},onError:function(D){return k.onError(D)},isLowLatencyMode:function(){return n().streaming.lowLatencyMode},updateDuration:function(){a.l&&k.S&&a.l.updateDuration()},
|
|
newDrmInfo:function(D){var I=k.i,L=I?I.h:null;L&&I.A&&oi(u,L.keySystem,D)},onManifestUpdated:function(){var D=(new Map).set("isLive",a.V());k.dispatchEvent(Sp("manifestupdated",D));On(k,!1,function(){if(a.B)a.B.onManifestUpdated(a.V())})},getBandwidthEstimate:function(){return a.s.getBandwidthEstimate()},onMetadata:function(D,I,L,K){var J=D;if("com.apple.hls.interstitial"==D&&(J="com.apple.quicktime.HLS",D={startTime:I,endTime:L,values:K},a.B))a.B.onHLSInterstitialMetadata(a,a.h,D);K=t(K);D=K.next();
|
|
for(var M={};!D.done;M={Rg:void 0},D=K.next())M.Rg=D.value,"ID"!=M.Rg.name&&On(k,!1,function(O){return function(){mq(a,I,L,J,O.Rg)}}(M))},disableStream:function(D){return a.disableStream(D,a.g.streaming.maxDisabledTime)},addFont:function(D,I){return a.addFont(D,I)}};v=new Sl(function(){return a.Sa()});v.addEventListener("regionadd",function(D){var I=D.region;nq(a,"timelineregionadded",I,k);On(k,!1,function(){a.B&&(a.B.onDashTimedMetadata(I),a.B.onDASHInterstitialMetadata(a,a.h,I))})});y=null;l.streaming.observeQualityChanges&&
|
|
(y=new Ml(function(){return a.Lb()}),y.addEventListener("qualitychange",function(D){oq(a,D.quality,D.position)}),y.addEventListener("audiotrackchange",function(D){oq(a,D.quality,D.position,!0)}));z=!0;A={lc:a.H,onError:function(D){return k.onError(D)},nf:function(D){On(k,!0,function(){if(a.C)a:{var I=D,L=Sp("keystatuschanged");a.dispatchEvent(L);var K=Object.keys(I);1==K.length&&""==K[0]&&(K=["00"],I={"00":I[""]});L=1==K.length&&"00"==K[0];var J=!1;if(K.length){K=a.keySystem();for(var M=Xg(a.g.drm.clearKeys),
|
|
O=t(a.i.variants),N=O.next();!N.done;N=O.next()){N=N.value;var P=[];N.audio&&P.push(N.audio);N.video&&P.push(N.video);P=t(P);for(var R=P.next();!R.done;R=P.next()){var S=R.value;R=N.allowedByKeySystem;if(S.keyIds.size)if(S.drmInfos.length&&!M.size){S=t(S.drmInfos);for(var aa=S.next();!aa.done;aa=S.next())if(aa=aa.value,aa.keyIds.size&&aa.keySystem==K){N.allowedByKeySystem=!0;aa=t(aa.keyIds);for(var W=aa.next();!W.done;W=aa.next())if(W=W.value,(W=I[L?"00":W])||a.C.F)N.allowedByKeySystem=N.allowedByKeySystem&&
|
|
!!W&&!qi.includes(W)}}else for(N.allowedByKeySystem=!0,S=t(S.keyIds),aa=S.next();!aa.done;aa=S.next())if(aa=aa.value,(aa=I[L?"00":aa])||a.C.F)N.allowedByKeySystem=N.allowedByKeySystem&&!!aa&&!qi.includes(aa);R!=N.allowedByKeySystem&&(J=!0)}}}if(J&&(pq(a),!qq(a)))break a;(I=a.l.l)&&!I.allowedByKeySystem&&Pp(a)}})},onExpirationUpdated:function(D,I){var L=Sp("expirationupdated");k.dispatchEvent(L);if((L=k.l)&&L.onExpirationUpdated)L.onExpirationUpdated(D,I)},onEvent:function(D){k.dispatchEvent(D);"drmsessionupdate"==
|
|
D.type&&z&&(z=!1,D=Date.now()/1E3-k.Ka,(a.A||k.getStats()).m=D,a.S&&Cc(a.S))}};B=Lp(a,m);Kg(a.H,B);E=function(){return a.dd(A)};H={config:l,kk:w,zk:v,yk:y,dd:E,jk:u,networkingEngine:B,bj:f,aj:h};k=new Nn(b,d,c,H);return C.return(k)})}function bq(a,b){var c,d,e;return Q(function(f){if(1==f.g)return c=a.g.manifest.retryParameters,F(f,vo(b,a.H,c),2);d=f.h;"application/x-mpegurl"==d&&(e=qb(),"WEBKIT"===e.Ea()&&(d="application/vnd.apple.mpegurl"));return f.return(d)})}
|
|
function kq(a,b){if(!vi(qb()))return!0;if(b){if(""==(a.h||wi()).canPlayType(b))return!1;if(!vi(qb())||!ti.has(b))return!0;if(Ne(b))return"WEBKIT"===qb().Ea()&&(a.g.drm.servers["com.apple.fps"]||a.g.drm.servers["com.apple.fps.1_0"])?a.g.streaming.useNativeHlsForFairPlay:a.g.streaming.preferNativeHls;if("application/dash+xml"===b||"video/vnd.mpeg.dash.mpd"===b)return a.g.streaming.preferNativeDash}return!1}
|
|
function rq(a){var b=a.g.textDisplayFactory;b!==a.Ae&&(a.o=b(),a.o.configure?a.o.configure(a.g.textDisplayer):wb("Text displayer w/ configure",'Text displayer should have a "configure" method!'),a.Ae=b,a.o.setTextVisibility(a.oa))}
|
|
function $p(a){var b,c,d;return Q(function(e){if(1==e.g)return qb(),Wp(a,"media-source"),a.g.mediaSource.useSourceElements&&Cj(a.h),rq(a),b=sq(a.h,a.o,{Bj:function(){return a.keySystem()},onMetadata:function(f,g,h){f=t(f);for(var k=f.next();!k.done;k=f.next())if(k=k.value,k.data&&"number"==typeof k.cueTime&&k.frames){var l=k.cueTime+g,m=h;m&&l>m&&(m=l);for(var n=t(k.frames),q=n.next();!q.done;q=n.next())mq(a,l,m,"org.id3",q.value);if(a.B)a.B.onHlsTimedMetadata(k,l)}},rk:function(f){a.Za&&Tl(a.Za,
|
|
{schemeIdUri:f.schemeIdUri,startTime:f.startTime,endTime:f.endTime,id:String(f.id),emsg:f})},onEvent:function(f){return a.dispatchEvent(f)},vk:function(){a.G&&a.G.update&&a.G.update()}},a.S,a.g.mediaSource),c=a.g.manifest,d=c.segmentRelativeVttTiming,b.Ka=d,F(e,b.K,2);a.I=b;G(e)})}
|
|
function tq(a,b,c){function d(){return uq(a)}a.j.D(b,"playing",d);a.j.D(b,"pause",d);a.j.D(b,"ended",d);a.j.D(b,"ratechange",function(){var f=a.h.playbackRate;0!=f&&(a.K&&(a.K.set(f),a.m==vq&&a.s.playbackRateChanged(f),wq(a,f)),f=Sp("ratechange"),a.dispatchEvent(f))});b.remote&&(a.j.D(b.remote,"connect",function(){a.l&&"connected"==b.remote.state&&xq(a);pq(a)}),a.j.D(b.remote,"connecting",function(){return pq(a)}),a.j.D(b.remote,"disconnect",function(){return Q(function(f){if(1==f.g)return a.l&&"disconnected"==
|
|
b.remote.state?F(f,Em(a.l),3):f.u(2);2!=f.g&&xq(a);pq(a);G(f)})}));b.audioTracks&&(a.j.D(b.audioTracks,"addtrack",function(){return pq(a)}),a.j.D(b.audioTracks,"removetrack",function(){return pq(a)}),a.j.D(b.audioTracks,"change",function(){return pq(a)}));b.videoTracks&&(a.j.D(b.videoTracks,"addtrack",function(){return pq(a)}),a.j.D(b.videoTracks,"removetrack",function(){return pq(a)}),a.j.D(b.videoTracks,"change",function(){return pq(a)}));if(b.textTracks){var e=function(){a.m===yq&&a.o instanceof
|
|
Io&&xq(a);pq(a)};a.j.D(b.textTracks,"addtrack",function(f){if(f.track)switch(f=f.track,f.kind){case "metadata":zq(a,f);break;case "chapters":Aq(a,f);break;default:e()}});a.j.D(b.textTracks,"removetrack",e);a.j.D(b.textTracks,"change",e);"keep"!==a.g.streaming.crossBoundaryStrategy&&(a.j.D(b,"waiting",function(){a.l&&Im(a.l)}),a.j.D(b,"timeupdate",function(){a.l&&Im(a.l)}))}"none"!=b.preload&&a.j.za(b,"loadedmetadata",function(){a.A.F=Date.now()/1E3-c})}
|
|
function gq(a,b,c,d){var e,f,g,h,k,l,m,n,q,r,u,w,v,y,z,A,B,E,H,C,D,I,L,K,J,M,O,N;return Q(function(P){switch(P.g){case 1:Wp(a,"load");e=a.h;a.K=new Il({Ue:function(){return e.playbackRate},Kc:function(){return e.defaultPlaybackRate},hh:function(R){e.playbackRate=R},ki:function(R){e.currentTime+=R}});tq(a,e,b);"onchange"in window.screen&&a.j.D(window.screen,"change",function(){if(a.N.getConfiguration){var R=a.N.getConfiguration();"AUTO"==R.zc?qq(a):"AUTO"==a.g.preferredVideoHdrLevel&&a.g.abr.enabled&&
|
|
(R.zc="AUTO",a.N.configure(R),qq(a))}});f=!1;g=t(a.i.variants);for(h=g.next();!h.done;h=g.next())k=h.value,(l=k.video&&k.video.dependencyStream)&&(f=Dc(l));Rp(a,a.g,f);a.td=a.g.preferredTextLanguage;a.qe=a.g.preferredTextRole;a.pe=a.g.preferForcedSubs;Bq(a.i.presentationTimeline,a.g.playRangeStart,a.g.playRangeEnd);a.s.init(function(R,S,aa){a.i&&a.l&&R!=a.l.l&&Cq(a,R,!0,void 0===S?!1:S,void 0===aa?0:aa)});a.s.setMediaElement(e);a.s.setCmsdManager(a.ka);a.l=Dq(a);a.l.configure(a.g.streaming);a.m=vq;
|
|
a.dispatchEvent(Sp("streaming"));m=c;case 2:(q=a.l.l)||m||(m=qq(a)?a.s.chooseVariant():null);r=[];n=q||m;u=t([n.video,n.audio]);for(w=u.next();!w.done;w=u.next())(v=w.value)&&!v.segmentIndex&&(r.push(v.createSegmentIndex()),v.dependencyStream&&r.push(v.dependencyStream.createSegmentIndex()));if(!(0<r.length)){P.u(4);break}return F(P,Promise.all(r),4);case 4:if(!n||0!=n.disabledUntilTime){P.u(2);break}if(a.G&&a.G.onInitialVariantChosen)a.G.onInitialVariantChosen(n);a.i.isLowLatency&&(a.g.streaming.lowLatencyMode?
|
|
a.configure(a.Sf):bb("Low-latency live stream detected, but low-latency streaming mode is not enabled in Shaka Player. Set streaming.lowLatencyMode configuration to true, and see https://bit.ly/3clctcj for details."));a.L&&(ap(a.L,a.i.isLowLatency&&a.g.streaming.lowLatencyMode),fp(a.L,1E3*b));Bq(a.i.presentationTimeline,a.g.playRangeStart,a.g.playRangeEnd);tm(a.l,a.g.playRangeStart,a.g.playRangeEnd);a.Ka=!0;a.dispatchEvent(Sp("canupdatestarttime"));y=function(R){a.F=Eq(a,R);a.eb=Fq(a,R);Gq(a,e,!1)};
|
|
a.g.streaming.startAtSegmentBoundary||(z=a.M,null==z&&a.i.startTime&&(z=a.i.startTime),y(z));if(q){P.u(7);break}if(!a.g.streaming.startAtSegmentBoundary){P.u(8);break}A=a.i.presentationTimeline;a.M instanceof Date&&(E=A.m||A.i,H=a.M.getTime()/1E3-E,null!=H&&(B=H));null==B&&(B="number"===typeof a.M?a.M:a.h.currentTime);null==a.M&&a.i.startTime&&(B=a.i.startTime);C=A.Vb();D=A.Db();B<C?B=C:B>D&&(B=D);return F(P,Hq(m,B),9);case 9:I=P.h,y(I);case 8:Cq(a,m,!0,!1,0);case 7:return a.F.ready(),L=a.yc().find(function(R){return R.active}),
|
|
L||((K=ag(a.i.textStreams,a.td,a.qe,a.pe)[0]||null)&&Gn(a.A.h,K,!0),m&&(K?(dg(m.audio,K,a.g)&&(a.oa=!0),a.oa&&a.o.setTextVisibility(!0)):(a.oa=!1,a.o.setTextVisibility(!1)),Iq(a)),K&&(a.g.streaming.alwaysStreamText||a.Hg())&&(Cm(a.l,K),Jq(a))),F(P,a.l.start(d),10);case 10:a.g.abr.enabled&&(a.s.enable(),Kq(a));pq(a);qq(a);a.i.variants.some(function(R){return R.primary});if((J=a.V())&&(a.g.streaming.liveSync&&a.g.streaming.liveSync.enabled||a.i.serviceDescription||a.g.streaming.liveSync.panicMode)||
|
|
a.g.streaming.vodDynamicPlaybackRate)M=function(){return Lq(a)},a.j.D(e,"timeupdate",M);J||(O=function(){return Mq(a)},a.j.D(e,"timeupdate",O),Mq(a),a.i.nextUrl&&(0<a.g.streaming.preloadNextUrlWindow&&(N=function(){var R;return Q(function(S){if(1==S.g){R=a.Sa().end-a.h.currentTime;if(isNaN(R)||!(R<=a.g.streaming.preloadNextUrlWindow))return S.u(0);a.j.Ja(e,"timeupdate",N);return F(S,a.preload(a.i.nextUrl),4)}a.Pa=S.h;G(S)})},a.j.D(e,"timeupdate",N)),a.j.D(e,"ended",function(){a.load(a.Pa||a.i.nextUrl)})));
|
|
if(a.B)a.B.onManifestUpdated(J);G(P)}})}
|
|
function eq(a,b){var c,d,e,f,g;return Q(function(h){return 1==h.g?(c=yc,d=Date.now()/1E3,e=!0,a.C=a.dd({lc:a.H,onError:function(k){Zp(a,k)},nf:function(){},onExpirationUpdated:function(){var k=Sp("expirationupdated");a.dispatchEvent(k)},onEvent:function(k){a.dispatchEvent(k);"drmsessionupdate"==k.type&&e&&(e=!1,a.A.m=Date.now()/1E3-d)}}),a.C.configure(a.g.drm),f={id:0,language:"und",disabledUntilTime:0,primary:!1,audio:null,video:null,bandwidth:100,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]},
|
|
g={id:0,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:b?Le(b):"",codecs:b?Me(b):"",encrypted:!0,drmInfos:[],keyIds:new Set,language:"und",originalLanguage:null,label:null,type:c.wa,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!1,fastSwitching:!1,fullMimeTypes:new Set,isAudioMuxedInVideo:!1,
|
|
baseOriginalId:null},g.fullMimeTypes.add(De(g.mimeType,g.codecs)),b.startsWith("audio/")?(g.type=c.Y,f.audio=g):f.video=g,a.C.$=!0,F(h,yh(a.C,[f],[]),2)):F(h,a.C.cc(a.h),0)})}
|
|
function hq(a,b,c){var d,e,f,g,h,k,l,m,n,q,r,u;return Q(function(w){switch(w.g){case 1:Wp(a,"src-equals");d=a.h;a.F=new ul(d);e=!1;a.oe.push(function(){e=!0});a.dispatchEvent(Sp("canupdatestarttime"));null!=a.M&&a.F.Pf(a.M);a.eb=Nq(a,a.M||0);a.K=new Il({Ue:function(){return d.playbackRate},Kc:function(){return d.defaultPlaybackRate},hh:function(v){d.playbackRate=v},ki:function(v){d.currentTime+=v}});Gq(a,d,!0);d.textTracks&&(rq(a),f=function(v){if(!(a.o instanceof Io)){var y=Oq(a).find(function(z){return"disabled"!==
|
|
z.mode});y&&(y.mode=v?"showing":"hidden");a.o instanceof Ko&&(y=Pq(a))&&(y.mode=!v&&a.o.isTextVisible()?"showing":"hidden")}},a.j.D(d,"enterpictureinpicture",function(){return f(!0)}),a.j.D(d,"leavepictureinpicture",function(){return f(!1)}),d.remote?(a.j.D(d.remote,"connect",function(){return f(!1)}),a.j.D(d.remote,"connecting",function(){return f(!1)}),a.j.D(d.remote,"disconnect",function(){return f(!1)})):"webkitCurrentPlaybackTargetIsWireless"in d&&a.j.D(d,"webkitcurrentplaybacktargetiswirelesschanged",
|
|
function(){return f(!1)}),g=d,g.webkitSupportsFullscreen&&a.j.D(g,"webkitpresentationmodechanged",function(){return f("inline"!==g.webkitPresentationMode)}));tq(a,d,b);h=hp(a.L,a.W,c);!h.includes("#t=")&&(0<a.g.playRangeStart||isFinite(a.g.playRangeEnd))&&(h+="#t=",0<a.g.playRangeStart&&(h+=a.g.playRangeStart),isFinite(a.g.playRangeEnd)&&(h+=","+a.g.playRangeEnd));if(!a.I){w.u(2);break}return F(w,a.I.destroy(),3);case 3:a.I=null;case 2:return Cj(d),d.src=h,k=qb(),"TV"==k.La()&&d.load(),"none"!=d.preload&&
|
|
!d.autoplay&&Ne(c)&&"WEBKIT"===k.Ea()&&d.load(),a.m=yq,a.dispatchEvent(Sp("streaming")),l=new tg,ll(d,HTMLMediaElement.HAVE_METADATA,a.j,function(){a.F.ready();l.resolve()}),m=function(){return new Promise(function(v){var y=new $e(v);a.j.D(d.textTracks,"change",function(){return y.ha(.5)});y.ha(.5)})},ll(d,HTMLMediaElement.HAVE_CURRENT_DATA,a.j,function(){var v,y,z,A,B;return Q(function(E){if(1==E.g)return F(E,m(),2);if(e)return E.return();Qq(a);v=Oq(a);v.some(function(H){return"showing"===H.mode})&&
|
|
(a.oa=!0,a.o.setTextVisibility(!0));if(!(a.o instanceof Io))for(v.length&&(a.o.enableTextDisplayer?a.o.enableTextDisplayer():wb("Text displayer w/ enableTextDisplayer",'Text displayer should have a "enableTextDisplayer" method')),y=!1,z=t(v),A=z.next();!A.done;A=z.next())B=A.value,"disabled"!==B.mode&&(y?(B.mode="disabled",bb("Found more than one enabled text track, disabling it",B)):(Rq(a,B),y=!0));Sq(a);G(E)})}),d.error?l.reject(Yp(a)):"none"==d.preload&&(bb('With <video preload="none">, the browser will not load anything until play() is called. We are unable to measure load latency in a meaningful way, and we cannot provide track info yet. Please do not use preload="none" with Shaka Player.'),
|
|
l.resolve()),a.j.za(d,"error",function(){l.reject(Yp(a))}),F(w,df(a.g.streaming.loadTimeout,l),4);case 4:if((n=a.V())&&(a.g.streaming.liveSync&&a.g.streaming.liveSync.enabled||a.g.streaming.liveSync.panicMode)||a.g.streaming.vodDynamicPlaybackRate)q=function(){return Lq(a)},a.j.D(d,"timeupdate",q);n||(r=function(){return Mq(a)},a.j.D(d,"timeupdate",r),Mq(a));a.B&&(a.B.onManifestUpdated(n),n&&(u=a.Sa().end,a.j.D(d,"progress",function(){var v=a.Sa().end;u!=v&&(a.B.onManifestUpdated(a.V()),u=v)})));
|
|
a.Ka=!0;G(w)}})}function Qq(a){var b=a.g.preferredAudioLanguage;""!=b&&a.Ei(b,a.g.preferredVariantRole)}function Sq(a){var b=a.g.preferredTextLanguage;""!=b&&a.bh(b,a.g.preferredTextRole,a.g.preferForcedSubs)}
|
|
function zq(a,b){if("metadata"==b.kind){b.mode="hidden";a.j.D(b,"cuechange",function(){if(b.activeCues)for(var d=t(b.activeCues),e=d.next();!e.done;e=d.next())if(e=e.value,mq(a,e.startTime,e.endTime,e.type,e.value),a.B)a.B.onCueMetadataChange(e.value);if(b.cues){d=[];e=t(b.cues);for(var f=e.next(),g={};!f.done;g={tc:void 0},f=e.next())g.tc=f.value,"com.apple.quicktime.HLS"==g.tc.type&&null!=g.tc.startTime&&(f=d.find(function(h){return function(k){return k.startTime==h.tc.startTime&&k.endTime==h.tc.endTime}}(g)),
|
|
f||(f={startTime:g.tc.startTime,endTime:g.tc.endTime,values:[]},d.push(f)),f.values.push(g.tc.value));d=t(d);for(e=d.next();!e.done;e=d.next())e=e.value,e.values.some(function(h){return"X-ASSET-URI"==h.key||"X-ASSET-LIST"==h.key})&&a.B&&(e.values.push({key:"CUE",description:"",data:0!=e.startTime||a.V()?"ONCE":"ONCE,PRE",mimeType:null,pictureType:null}),a.B.onHLSInterstitialMetadata(a,a.h,e))}});var c=(new $e(function(){var d=Tq(a);d=t(d);for(var e=d.next();!e.done;e=d.next())e.value.mode="hidden"})).Hb().ha(.5);
|
|
a.oe.push(function(){c.stop()})}}function dq(a,b,c){b=(new Map).set("startTime",b.startTime).set("endTime",b.endTime).set("metadataType",b.schemeIdUri).set("payload",b.payload);a.dispatchEvent(Sp(c,b))}function mq(a,b,c,d,e){a.va&&(b={schemeIdUri:d,startTime:b,endTime:c||Infinity,id:"",payload:e},b.id=JSON.stringify(b),Tl(a.va,b))}function Aq(a,b){if(b&&"chapters"==b.kind){b.mode="hidden";var c=(new $e(function(){b.mode="hidden"})).Hb().ha(.5);a.oe.push(function(){c.stop()})}}
|
|
p.Dk=function(){for(var a=this.$;a.g;)a.release()};p.dd=function(a){return new oh(a)};
|
|
function Lp(a,b){function c(f){b()?b().dispatchEvent(f):a.dispatchEvent(f)}function d(f){b()?On(b(),!0,f):f()}b||(b=function(){return null});var e=new Gg(function(f,g,h,k,l){var m=b()?b().j:a.s;m&&m.segmentDownloaded(f,g,h,k,l)},function(f,g,h){g=(new Map).set("headers",f).set("request",g).set("requestType",h);c(Sp("downloadheadersreceived",g));d(function(){if(a.ka){var k=a.ka;if(k.h.enabled){var l=f["cmsd-static"];if(l)try{var m=new Map,n=l.split(",");for(l=0;l<n.length;l++){var q=n[l].split("=");
|
|
m.set(q[0],Fp(q[1]))}}catch(y){}if(m=f["cmsd-dynamic"]){try{var r=new Map,u=m.split(";");for(m=1;m<u.length;m++){var w=u[m].split("=");r.set(w[0],Fp(w[1]))}var v=r}catch(y){v=null}v&&(k.g=v)}}}})},function(f,g){f=(new Map).set("request",f).set("response",g);c(Sp("downloadcompleted",f))},function(f,g,h,k){f=(new Map).set("request",f).set("error",g).set("httpResponseCode",h).set("aborted",k);c(Sp("downloadfailed",f))},function(f,g,h){d(function(){var k=a.L,l=h;l=void 0===l?{}:l;if(k.g.enabled)if("HEAD"===
|
|
g.method)op(k,g);else switch(f){case 0:try{if(k.g.enabled){if(l.type){a:{switch(l.type){case 4:var m=k.l?cp:bp;break a;case 3:case 2:m=k.l?ep:dp;break a;case 5:m="s";break a}m=void 0}k.i=m}op(k,g,{ot:lp,su:!k.s})}}catch(N){cb("CMCD_MANIFEST_ERROR","Could not generate manifest CMCD data.",N)}break;case Rg:try{if(k.g.enabled){var n=g.uris[0],q=l.segment;m=0;q&&(m=q.endTime-q.startTime);var r={d:1E3*m,st:k.h.V()?"l":"v"};r.ot=sp(l);var u=r.ot===up||r.ot===jp||r.ot===kp||r.ot===vp,w=l.stream;if(w){var v=
|
|
k.h.sb();if(u&&(r.bl=xp(k,w.type),r.ot!==vp)){var y=yp(k,w.type);r.dl=v?y/Math.abs(v):y}w.bandwidth&&(r.br=w.bandwidth/1E3);if(w.segmentIndex&&q){var z=w.segmentIndex.Ub(q.endTime,!0,0>v);if(z){var A=z.next().value;if(A&&A!=q){if(n&&!Wc(q.O(),A.O())){var B=A.O()[0],E=new URL(B),H=new URL(n);if(E.origin!==H.origin)var C=B;else{for(var D=E.pathname.split("/").slice(1),I=H.pathname.split("/").slice(1,-1);D[0]===I[0];)D.shift(),I.shift();for(;I.length;)I.shift(),D.unshift("..");C=D.join("/")}r.nor=C}if((A.startByte||
|
|
A.endByte)&&(q.startByte!=A.startByte||q.endByte!=A.endByte)){var L=A.startByte+"-";A.endByte&&(L+=A.endByte);r.nrr=L}}}var K=k.h.sb()||1,J=yp(k,w.type)||500,M=w.bandwidth;var O=M?M*(q.endTime-q.startTime)/1E3/(J/K/1E3)*k.g.rtpSafetyFactor:NaN;isNaN(O)||(r.rtp=O)}}u&&r.ot!==vp&&(r.tb=zp(k,r.ot)/1E3);op(k,g,r)}}catch(N){cb("CMCD_SEGMENT_ERROR","Could not generate segment CMCD data.",N)}break;case 2:case 5:case 6:op(k,g,{ot:"k"});break;case 4:op(k,g,{ot:"o"})}})},function(f,g,h,k){(f=b()?b().l:a.G)&&
|
|
f.banLocation&&f.banLocation(k)},function(f,g){if(g.data){g=g.data.byteLength;var h=b()?b().getStats():a.A;h&&(Ln(h,g),0===f&&(h.ci=g))}});e.configure(a.g.networking);return e}function Eq(a,b){return new xl(a.h,a.i,a.g.streaming,b,function(){a.eb&&Ll(a.eb,!0);a.l&&a.l.Vc();a.P&&Uq(a)},function(c){return a.dispatchEvent(c)})}
|
|
function Fq(a,b){var c=a.V()||"number"===typeof b&&0<b;b=new qo(a.ke,c);b.addEventListener("enter",function(f){nq(a,"timelineregionenter",f.region)});b.addEventListener("exit",function(f){nq(a,"timelineregionexit",f.region)});b.addEventListener("skip",function(f){var g=f.region;f.seeking||(nq(a,"timelineregionenter",g),nq(a,"timelineregionexit",g))});var d=new qo(a.va,c);d.addEventListener("enter",function(f){dq(a,f.region,"metadata")});c=new qo(a.Za,c);c.addEventListener("enter",function(f){f=(new Map).set("detail",
|
|
f.region.emsg);a.dispatchEvent(Sp("emsg",f))});var e=new Kl(a.h);e.g.add(b);e.g.add(d);e.g.add(c);a.je&&e.g.add(a.je);return e}function Nq(a,b){b=new qo(a.va,b instanceof Date||0<b);b.addEventListener("enter",function(d){dq(a,d.region,"metadata")});var c=new Kl(a.h);c.g.add(b);return c}
|
|
function Gq(a,b,c){a.P=new hi;a.P.g=ji;Vq(a);aq(a);a.Ba=new $e(function(){Uq(a)});a.g.streaming.rebufferingGoal&&a.Ba.Ga(.25);a.j.D(b,"waiting",function(){return Uq(a)});a.j.D(b,"canplaythrough",function(){return Uq(a)});a.j.D(b,"playing",function(){return Uq(a)});a.j.D(b,"seeked",function(){return Uq(a)});c&&(a.j.D(b,"stalled",function(){return Uq(a)}),a.j.D(b,"progress",function(){return Uq(a)}),a.j.D(b,"timeupdate",function(){return Uq(a)}))}
|
|
function Vq(a){var b=a.g.streaming.rebufferingGoal;a.P.i.set(ii,Math.min(.5,b/2)).set(ji,b)}function Uq(a){var b=a.Td()||a.F.Zh(),c=xj(a.h.buffered,a.h.currentTime),d=a.P,e=d.i.get(d.g),f=d.g;b=b||c>=e&&0<c?ii:ji;d.g=b;(f=f!=b)&&b===ii&&(d.h=Date.now());f&&aq(a)}function sq(a,b,c,d,e){return new rk(a,b,c,e,d)}
|
|
function Kp(a){return new Yo({getBandwidthEstimate:function(){return a.s?a.s.getBandwidthEstimate():NaN},Lb:function(){return a.Lb()},getCurrentTime:function(){return a.h?a.h.currentTime:0},sb:function(){return a.sb()},Nb:function(){return a.Nb()},Fb:function(){return a.Fb()},V:function(){return a.V()},Te:function(){return a.Te()}},a.g.cmcd)}
|
|
function Dq(a){return new nm(a.i,{Lc:function(){return a.F?a.F.Be():0},getBandwidthEstimate:function(){return a.s.getBandwidthEstimate()},sb:function(){return a.sb()},video:a.h,aa:a.I,lc:a.H,onError:function(b){return Zp(a,b)},onEvent:function(b){return a.dispatchEvent(b)},pf:function(b,c,d){var e=b.startTime;b=b.endTime;c=c.type;if(c!=wc){if(a.F){a.F.mi();var f=Ek(a.I,c);!a.V()&&a.h.paused&&!a.h.seeking&&null!=f&&0<f&&a.F.Be()<f&&a.F.Pf(f)}Uq(a)}d=(new Map).set("start",e).set("end",b).set("contentType",
|
|
c).set("isMuxed",d);a.dispatchEvent(Sp("segmentappended",d))},tk:function(b,c){(c=c.nd)&&a.je&&Ol(a.je,c,b)},Gh:function(b,c){var d=a.C;if(d.g.parseInbandPsshEnabled&&!d.F&&["audio","video"].includes(b)){b=new mh(Tb(c));c=0;for(var e=t(b.data),f=e.next();!f.done;f=e.next())c+=f.value.length;if(0==c)d=Promise.resolve();else{c=new Uint8Array(c);e=0;b=t(b.data);for(f=b.next();!f.done;f=b.next())f=f.value,c.set(f,e),e+=f.length;Hh(d,"cenc",c);d=d.m}}else d=Promise.resolve();return d},disableStream:function(b,
|
|
c){return a.disableStream(b,c)}})}
|
|
p.configure=function(a,b){2==arguments.length&&"string"==typeof a&&(a=bn(a,b));a.streaming&&"forceTransmuxTS"in a.streaming&&(wb("streaming.forceTransmuxTS configuration","Please Use mediaSource.forceTransmux instead."),a.mediaSource=a.mediaSource||{},a.mediaSource.mediaSource=a.streaming.forceTransmuxTS,delete a.streaming.forceTransmuxTS);a.streaming&&"forceTransmux"in a.streaming&&(wb("streaming.forceTransmux configuration","Please Use mediaSource.forceTransmux instead."),a.mediaSource=a.mediaSource||
|
|
{},a.mediaSource.mediaSource=a.streaming.forceTransmux,delete a.streaming.forceTransmux);if(a.streaming&&"useNativeHlsOnSafari"in a.streaming){wb("streaming.useNativeHlsOnSafari configuration","Please Use streaming.useNativeHlsForFairPlay or streaming.preferNativeHls instead.");var c=qb();a.streaming.preferNativeHls=a.streaming.useNativeHlsOnSafari&&"WEBKIT"===c.Ea();delete a.streaming.useNativeHlsOnSafari}a.streaming&&"boolean"==typeof a.streaming.liveSync&&(wb("streaming.liveSync","Please Use streaming.liveSync.enabled instead."),
|
|
c=a.streaming.liveSync,a.streaming.liveSync={},a.streaming.liveSync.enabled=c);if(a.streaming&&!(a.streaming.liveSync&&"targetLatency"in a.streaming.liveSync)&&("liveSyncMinLatency"in a.streaming||"liveSyncMaxLatency"in a.streaming)){c=a.streaming.liveSyncMinLatency||0;var d=Math.abs((a.streaming.liveSyncMaxLatency||1)-c)/2;a.streaming.liveSync=a.streaming.liveSync||{};a.streaming.liveSync.targetLatency=c+d;a.streaming.liveSync.targetLatencyTolerance=d}a.streaming&&"liveSyncMaxLatency"in a.streaming&&
|
|
(wb("streaming.liveSyncMaxLatency","Please Use streaming.liveSync.targetLatency and streaming.liveSync.targetLatencyTolerance instead. Or, set the values in your DASH manifest"),delete a.streaming.liveSyncMaxLatency);a.streaming&&"liveSyncMinLatency"in a.streaming&&(wb("streaming.liveSyncMinLatency","Please Use streaming.liveSync.targetLatency and streaming.liveSync.targetLatencyTolerance instead. Or, set the values in your DASH manifest"),delete a.streaming.liveSyncMinLatency);a.streaming&&"liveSyncTargetLatency"in
|
|
a.streaming&&(wb("streaming.liveSyncTargetLatency","Please Use streaming.liveSync.targetLatency instead."),a.streaming.liveSync=a.streaming.liveSync||{},a.streaming.liveSync.targetLatency=a.streaming.liveSyncTargetLatency,delete a.streaming.liveSyncTargetLatency);a.streaming&&"liveSyncTargetLatencyTolerance"in a.streaming&&(wb("streaming.liveSyncTargetLatencyTolerance","Please Use streaming.liveSync.targetLatencyTolerance instead."),a.streaming.liveSync=a.streaming.liveSync||{},a.streaming.liveSync.targetLatencyTolerance=
|
|
a.streaming.liveSyncTargetLatencyTolerance,delete a.streaming.liveSyncTargetLatencyTolerance);a.streaming&&"liveSyncPlaybackRate"in a.streaming&&(wb("streaming.liveSyncPlaybackRate","Please Use streaming.liveSync.maxPlaybackRate instead."),a.streaming.liveSync=a.streaming.liveSync||{},a.streaming.liveSync.maxPlaybackRate=a.streaming.liveSyncPlaybackRate,delete a.streaming.liveSyncPlaybackRate);a.streaming&&"liveSyncMinPlaybackRate"in a.streaming&&(wb("streaming.liveSyncMinPlaybackRate","Please Use streaming.liveSync.minPlaybackRate instead."),
|
|
a.streaming.liveSync=a.streaming.liveSync||{},a.streaming.liveSync.minPlaybackRate=a.streaming.liveSyncMinPlaybackRate,delete a.streaming.liveSyncMinPlaybackRate);a.streaming&&"liveSyncPanicMode"in a.streaming&&(wb("streaming.liveSyncPanicMode","Please Use streaming.liveSync.panicMode instead."),a.streaming.liveSync=a.streaming.liveSync||{},a.streaming.liveSync.panicMode=a.streaming.liveSyncPanicMode,delete a.streaming.liveSyncPanicMode);a.streaming&&"liveSyncPanicThreshold"in a.streaming&&(wb("streaming.liveSyncPanicThreshold",
|
|
"Please Use streaming.liveSync.panicThreshold instead."),a.streaming.liveSync=a.streaming.liveSync||{},a.streaming.liveSync.panicThreshold=a.streaming.liveSyncPanicThreshold,delete a.streaming.liveSyncPanicThreshold);if(a.mediaSource&&"sourceBufferExtraFeatures"in a.mediaSource){wb("mediaSource.sourceBufferExtraFeatures configuration","Please Use mediaSource.addExtraFeaturesToSourceBuffer() instead.");var e=a.mediaSource.sourceBufferExtraFeatures;a.mediaSource.addExtraFeaturesToSourceBuffer=function(){return e};
|
|
delete a.mediaSource.sourceBufferExtraFeatures}a.manifest&&a.manifest.hls&&"useSafariBehaviorForLive"in a.manifest.hls&&(wb("manifest.hls.useSafariBehaviorForLive configuration","Please Use liveSync config to keep on live Edge instead."),delete a.manifest.hls.useSafariBehaviorForLive);a.streaming&&"parsePrftBox"in a.streaming&&(wb("streaming.parsePrftBox configuration","Now fired without needing a configuration."),delete a.streaming.parsePrftBox);a.manifest&&a.manifest.dash&&"enableAudioGroups"in
|
|
a.manifest.dash&&(wb("manifest.dash.enableAudioGroups configuration","It is now enabled by default and cannot be disabled."),delete a.manifest.dash.enableAudioGroups);a.streaming&&"dispatchAllEmsgBoxes"in a.streaming&&(wb("streaming.dispatchAllEmsgBoxes configuration","Please Use mediaSource.dispatchAllEmsgBoxes instead."),a.mediaSource=a.mediaSource||{},a.mediaSource.dispatchAllEmsgBoxes=a.streaming.dispatchAllEmsgBoxes,delete a.streaming.dispatchAllEmsgBoxes);a.streaming&&"autoLowLatencyMode"in
|
|
a.streaming&&(wb("streaming.autoLowLatencyMode configuration","Please Use streaming.lowLatencyMode instead."),a.streaming.lowLatencyMode=a.streaming.autoLowLatencyMode,delete a.streaming.autoLowLatencyMode);a.manifest&&a.manifest.dash&&"ignoreSupplementalCodecs"in a.manifest.dash&&(wb("manifest.dash.ignoreSupplementalCodecs configuration","Please Use manifest.ignoreSupplementalCodecs instead."),a.manifest.ignoreSupplementalCodecs=a.manifest.dash.ignoreSupplementalCodecs,delete a.manifest.dash.ignoreSupplementalCodecs);
|
|
a.manifest&&a.manifest.hls&&"ignoreSupplementalCodecs"in a.manifest.hls&&(wb("manifest.hls.ignoreSupplementalCodecs configuration","Please Use manifest.ignoreSupplementalCodecs instead."),a.manifest.ignoreSupplementalCodecs=a.manifest.hls.ignoreSupplementalCodecs,delete a.manifest.hls.ignoreSupplementalCodecs);a.manifest&&a.manifest.dash&&"updatePeriod"in a.manifest.dash&&(wb("manifest.dash.updatePeriod configuration","Please Use manifest.updatePeriod instead."),a.manifest.updatePeriod=a.manifest.dash.updatePeriod,
|
|
delete a.manifest.dash.updatePeriod);a.manifest&&a.manifest.hls&&"updatePeriod"in a.manifest.hls&&(wb("manifest.hls.updatePeriod configuration","Please Use manifest.updatePeriod instead."),a.manifest.updatePeriod=a.manifest.hls.updatePeriod,delete a.manifest.hls.updatePeriod);a.manifest&&a.manifest.dash&&"ignoreDrmInfo"in a.manifest.dash&&(wb("manifest.dash.ignoreDrmInfo configuration","Please Use manifest.ignoreDrmInfo instead."),a.manifest.ignoreDrmInfo=a.manifest.dash.ignoreDrmInfo,delete a.manifest.dash.ignoreDrmInfo);
|
|
if(a.drm&&a.drm.advanced){c=!1;for(var f in a.drm.advanced){var g=a.drm.advanced[f];d=g.videoRobustness;g=g.audioRobustness;"videoRobustness"in a.drm.advanced[f]&&!Array.isArray(a.drm.advanced[f].videoRobustness)&&(a.drm.advanced[f].videoRobustness=[d],c=!0);"audioRobustness"in a.drm.advanced[f]&&!Array.isArray(a.drm.advanced[f].audioRobustness)&&(a.drm.advanced[f].audioRobustness=[g],c=!0)}c&&wb("AdvancedDrmConfiguration's videoRobustness and audioRobustness","These properties are no longer strings but array of strings, please update your usage of these properties.")}a.streaming&&
|
|
"forceHTTP"in a.streaming&&(wb("streaming.forceHTTP configuration","Please Use networking.forceHTTP instead."),a.networking=a.networking||{},a.networking.forceHTTP=a.streaming.forceHTTP,delete a.streaming.forceHTTP);a.streaming&&"forceHTTPS"in a.streaming&&(wb("streaming.forceHTTPS configuration","Please Use networking.forceHTTP instead."),a.networking=a.networking||{},a.networking.forceHTTPS=a.streaming.forceHTTPS,delete a.streaming.forceHTTPS);a.streaming&&"minBytesForProgressEvents"in a.streaming&&
|
|
(wb("streaming.minBytesForProgressEvents configuration","Please Use networking.minBytesForProgressEvents instead."),a.networking=a.networking||{},a.networking.minBytesForProgressEvents=a.streaming.minBytesForProgressEvents,delete a.streaming.minBytesForProgressEvents);a.streaming&&"crossBoundaryStrategy"in a.streaming&&"keep"!=a.streaming.crossBoundaryStrategy&&(a.streaming.inaccurateManifestTolerance=0);f=Bn(this.g,a,Jp(this));Wq(this);return f};p.kj=function(a){this.Sf=a};
|
|
function Wq(a){a.re=new ki(a.g,a.ua,a.C);if(a.G){var b=ed(a.g.manifest);a.h&&"AUDIO"===a.h.nodeName&&(b.disableVideo=!0);a.G.configure(b)}a.C&&a.C.configure(a.g.drm);if(a.l){a.l.configure(a.g.streaming);try{a.m!=Tp&&mi(a.re,a.i)&&pq(a)}catch(e){Zp(a,e)}a.s&&qq(a);b=a.l.l;!b||b.allowedByApplication&&b.allowedByKeySystem||Pp(a)}a.H&&a.H.configure(a.g.networking);a.I&&(a.I.configure(a.g.mediaSource),a.I.Ka=a.g.manifest.segmentRelativeVttTiming);if(a.o)if(b=a.g.textDisplayFactory,a.Ae!=b){var c=a.o;a.o=
|
|
b();a.o.configure?a.o.configure(a.g.textDisplayer):wb("Text displayer w/ configure",'Text displayer should have a "configure" method!');a.o.setTextLanguage||wb("Text displayer w/ setTextLanguage",'Text displayer should have a "setTextLanguage" method!');a.o.setTextVisibility(c.isTextVisible());c.destroy();if(a.I){c=a.I;var d=a.o;c.ia=d;c.h&&(c.h.j=d)}a.Ae=b;a.l&&(b=a.l,(c=b.i.get(wc))&&Am(b,c.stream,!0,0,!0))}else a.o.configure&&a.o.configure(a.g.textDisplayer);a.s&&(a.s.configure(a.g.abr),a.g.abr.enabled?
|
|
a.s.enable():a.s.disable(),Kq(a));a.P&&Vq(a);a.Ba&&(a.g.streaming.rebufferingGoal?a.Ba.Ga(.25):a.Ba.stop());a.i&&Bq(a.i.presentationTimeline,a.g.playRangeStart,a.g.playRangeEnd);a.B&&a.B.configure(a.g.ads);a.L&&a.L.configure(a.g.cmcd);a.ka&&a.ka.configure(a.g.cmsd);a.xa&&a.xa.configure(a.g.queue)}p.getConfiguration=function(){var a=Jp(this);Bn(a,this.g,Jp(this));return a};p.uj=function(){return this.Sf};p.Vh=function(){var a=Jp(this);Bn(a,this.g,Jp(this));return dn(this.g,Jp(this))};
|
|
p.Rh=function(){if(this.h){var a=this.h.buffered.length;a=a?this.h.buffered.end(a-1):0;var b=this.getConfiguration().streaming.bufferingGoal;b=Math.min(this.h.currentTime+b,this.Sa().end);if(a>=b)return 1;if(!(a<=this.h.currentTime)&&a<b)return(a-this.h.currentTime)/(b-this.h.currentTime)}return 0};p.zi=function(){for(var a in this.g)delete this.g[a];Bn(this.g,Jp(this),Jp(this));Wq(this)};p.Cj=function(){return this.m};p.Th=function(){return this.i?this.i.type:null};p.Gj=function(){return this.h};
|
|
p.Nb=function(){return this.H};p.jd=function(){return this.W};p.Qh=function(){return this.B?this.B:null};p.Wh=function(){return this.xa?this.xa:null};p.V=function(){return this.i&&!this.ya()?this.i.presentationTimeline.V():this.h&&(this.h.src||this.ya())?Infinity==this.h.duration:!1};p.Oc=function(){return this.i?this.i.presentationTimeline.Oc():!1};
|
|
p.Zj=function(){if(this.i&&!this.ya()){var a=this.i.variants;return a.length?!a[0].video:!1}return this.h&&(this.h.src||this.ya())?this.h.videoTracks?0==this.h.videoTracks.length:0==this.h.videoHeight:!1};p.gk=function(){if(this.i&&!this.ya()){var a=this.i.variants;if(!a.length)return!1;a=a[0];return a.audio||!a.video?!1:!a.video.codecs.includes(",")}return this.h&&(this.h.src||this.ya())&&this.h.audioTracks?0==this.h.audioTracks.length:!1};
|
|
p.Sa=function(){if(this.i&&!this.ya()){if(!this.Ka&&"HLS"==this.i.type)return{start:0,end:0};var a=this.i.presentationTimeline;return{start:a.Vb(),end:a.Db()}}if(this.h&&(this.h.src||this.ya())&&(a=this.h.seekable)&&a.length){var b=this.g?this.g.playRangeStart:0;b=Math.max(a.start(0),b);var c=this.g?this.g.playRangeEnd:Infinity;a=Math.min(a.end(a.length-1),c);return{start:b,end:a}}return{start:0,end:0}};p.Wj=function(){this.V()&&(this.h.currentTime=this.Sa().end)};p.$j=function(){return this.Ka};
|
|
p.keySystem=function(){var a=this.drmInfo();return a?a.keySystem:""};p.drmInfo=function(){return this.C?this.C.h:null};p.Md=function(){return this.C?this.C.Md():Infinity};p.yg=function(){return this.C?this.C.yg():[]};p.Se=function(){return this.C?this.C.Se():{}};p.Gg=function(){return this.P?this.P.g==ji:!!this.W};p.sb=function(){return this.h?this.K?this.K.i:1:0};p.yh=function(a){this.m==vq&&this.l&&zm(this.l,a)};
|
|
p.ie=function(a,b){b=void 0===b?!0:b;0==a?bb("A trick play rate of 0 is unsupported!"):(this.K.set(a),this.m==vq&&(this.s.playbackRateChanged(a),this.yh(b&&1!=a)),wq(this,a))};p.Ed=function(){var a=this.K.Kc();this.m==yq&&this.K.set(a);this.m==vq&&(this.K.set(a),this.s.playbackRateChanged(a),this.yh(!1));this.Yb.Ra()};
|
|
p.Fb=function(){if(this.i&&!this.ya()){for(var a=this.l?this.l.l:null,b=[],c=0,d=t(this.i.variants),e=d.next();!e.done;e=d.next())if(e=e.value,Zf(e)){var f=Lf(e);f.active=e==a;f.active||1==c||null==a||e.video!=a.video||e.audio!=a.audio||(f.active=!0);f.active&&c++;b.push(f)}return b}if(this.h&&this.h.audioTracks){var g=Xq(this);a=Array.from(this.h.audioTracks);return a.length?a.map(function(h){return Yf(h,g)}):g?[Yf(null,g)]:[]}return[]};
|
|
p.yc=function(){if(this.i){if(this.ya())return[];for(var a=this.l?this.l.A:null,b=[],c=t(this.i.textStreams),d=c.next();!d.done;d=c.next()){d=d.value;var e=Of(d);e.active=d==a;b.push(e)}return b}return this.h&&this.h.src&&this.h.textTracks?Oq(this).map(function(f){return Xf(f)}):[]};p.zj=function(){var a=this.ye;this.i&&(a=this.i.imageStreams);return a.map(function(b){return Pf(b)})};
|
|
p.nj=function(a){var b=this,c,d;return Q(function(e){if(1==e.g)return F(e,Yq(b,a),2);c=e.h;if(!c)return e.return(null);d=[];c.segmentIndex.Cb(function(f){var g=Zq(f.tilesLayout||c.tilesLayout);if(g)for(var h=g.rows*g.Gc,k=f.j-f.startTime,l=0;l<h;l++){var m=$q(f,c,f.startTime+k*l/h,g);d.push(m)}});c.closeSegmentIndex&&c.closeSegmentIndex();return e.return(d)})};function Zq(a){return a?(a=/(\d+)x(\d+)/.exec(a))?{Gc:parseInt(a[1],10),rows:parseInt(a[2],10)}:null:null}
|
|
p.Qj=function(a,b){var c=this,d,e,f,g;return Q(function(h){if(1==h.g)return F(h,Yq(c,a),2);d=h.h;if(!d)return h.return(null);e=d.segmentIndex.find(b);if(null==e)return h.return(null);f=d.segmentIndex.get(e);return(g=Zq(f.tilesLayout||d.tilesLayout))?h.return($q(f,d,b,g)):h.return(null)})};
|
|
function Yq(a,b){var c,d;return Q(function(e){if(1==e.g){if(a.m!=vq&&a.m!=yq)return e.return(null);c=a.ye;a.i&&(c=a.i.imageStreams);d=c[0];if(!d)return e.return(null);null!=b&&(d=c.find(function(f){return f.id==b}));return d?d.segmentIndex?e.u(2):F(e,d.createSegmentIndex(),2):e.return(null)}return e.return(d)})}
|
|
function $q(a,b,c,d){var e=b.width||0,f=b.height||0,g=e/d.Gc,h=f/d.rows,k=d.Gc*d.rows,l=a.j-a.startTime;l=a.B||l/k;var m=a.startTime,n=0,q=0;1<k&&(q=Math.floor((c-a.startTime)/l),m=a.startTime+q*l,n=q%d.Gc*g,q=Math.floor(q/d.Gc)*h);d=!1;if(c=a.thumbnailSprite)d=!0,h=c.height,n=c.positionX,q=c.positionY,g=c.width;return{segment:a,imageHeight:f,imageWidth:e,height:h,positionX:n,positionY:q,startTime:m,duration:l,uris:a.O(),startByte:a.wc(),endByte:a.uc(),width:g,sprite:d,mimeType:a.mimeType||b.mimeType,
|
|
codecs:a.codecs||b.codecs}}
|
|
p.dh=function(a){function b(){var d=c.i.textStreams.find(function(e){return e.id==a.id});d&&d!=c.l.A&&(Gn(c.A.h,d,!1),Cm(c.l,d),xq(c),Jq(c),c.td=d.language)}var c=this;if(this.i&&this.F&&(b(),!this.ya()))return;(function(){if(c.h&&c.h.textTracks){var d=Oq(c),e=d.find(function(h){return Rf(h)===a.id});if(e){if(c.o instanceof Io){d=t(d);for(var f=d.next();!f.done;f=d.next()){f=f.value;var g=f===e?c.oa?"showing":"hidden":"disabled";f.mode!==g&&(f.mode=g)}}else d=d.find(function(h){return"disabled"!==h.mode}),
|
|
d!==e&&(d&&(d.mode="disabled",c.j.Ja(d,"cuechange"),c.o.remove(0,Infinity)),e&&Rq(c,e));xq(c);Jq(c)}}})()};
|
|
function Rq(a,b){a.j.D(b,"cuechange",function(){a.o.remove(0,Math.max(0,a.h.currentTime-a.g.streaming.bufferBehind));var c={periodStart:0,segmentStart:0,segmentEnd:a.h.duration,vttOffset:0},d=[],e=Array.from(b.activeCues||[]);e=t(e);for(var f=e.next();!f.done;f=e.next()){f=f.value;if(Infinity===f.endTime||f.endTime<f.startTime)f=null;else{var g=new Qd(f.startTime,f.endTime,f.text);g.line="number"===typeof f.line?f.line:null;f.lineAlign&&(g.lineAlign=f.lineAlign);g.lineInterpretation=f.snapToLines?
|
|
Wd:1;g.position="number"===typeof f.position?f.position:null;f.positionAlign&&(g.positionAlign=f.positionAlign);g.size=f.size;g.textAlign=f.align;"lr"===f.vertical?g.writingMode="vertical-lr":"rl"===f.vertical&&(g.writingMode="vertical-rl");f.region&&(g.region.id=f.region.id,g.region.height=f.region.lines,g.region.heightUnits=2,g.region.regionAnchorX=f.region.regionAnchorX,g.region.regionAnchorY=f.region.regionAnchorY,g.region.scroll=f.region.scroll,g.region.viewportAnchorX=f.region.viewportAnchorX,
|
|
g.region.viewportAnchorY=f.region.viewportAnchorY,g.region.viewportAnchorUnits=Rc,g.region.width=f.region.width,g.region.widthUnits=Rc);fe(g);f=g}f&&((g=a.g.mediaSource.modifyCueCallback)&&g(f,null,c),d.push(f))}a.o.append(d)});b.mode=document.pictureInPictureElement?"showing":"hidden"}
|
|
p.ce=function(a,b,c){function d(){var f=e.i.variants.find(function(h){return h.id==a.id});if(f&&Zf(f)){var g=e.l.l;e.g.abr.enabled&&(g.video!=f.video||g.audio&&f.audio&&g.audio.language==f.audio.language&&g.audio.channelsCount==f.audio.channelsCount&&g.audio.label==f.audio.label)&&bb("Changing tracks while abr manager is enabled will likely result in the selected track being overridden. Consider disabling abr before calling selectVariantTrack().");e.ya()?Cq(e,f,!1,!1,0):Cq(e,f,!1,b||!1,c||0);e.N.configure({language:f.language,
|
|
role:f.audio&&f.audio.roles&&f.audio.roles[0]||"",channelCount:f.audio&&f.audio.channelsCount?f.audio.channelsCount:0,zc:f.video&&f.video.hdr?f.video.hdr:"",spatialAudio:f.audio&&f.audio.spatialAudio?f.audio.spatialAudio:!1,videoLayout:f.video&&f.video.videoLayout?f.video.videoLayout:"",cd:f.audio&&f.audio.label?f.audio.label:"",zd:"",codecSwitchingStrategy:e.g.mediaSource.codecSwitchingStrategy,audioCodec:f.audio&&f.audio.codecs?f.audio.codecs:"",Cd:g.audio&&g.audio.codecs?g.audio.codecs:"",Ee:g.audio&&
|
|
g.audio.channelsCount?g.audio.channelsCount:0,preferredAudioCodecs:e.g.preferredAudioCodecs,preferredAudioChannelCount:e.g.preferredAudioChannelCount});qq(e)}}var e=this;b=void 0===b?!1:b;c=void 0===c?0:c;if(this.i&&this.F&&(d(),!this.ya()))return;(function(){if(a.originalAudioId&&e.h&&e.h.audioTracks){var f=Array.from(e.h.audioTracks);f=t(f);for(var g=f.next();!g.done;g=f.next())if(g=g.value,Rf(g)==a.id){ar(e,g);break}}})()};
|
|
p.Lk=function(a,b){b=void 0===b?0:b;var c=this.Fb();if(c.length){var d=c.find(function(e){return e.active});d&&(c=c.find(function(e){return e.videoId===d.videoId&&e.language==a.language&&e.label==a.label&&e.audioMimeType==a.mimeType&&e.audioCodec==a.codecs&&e.primary==a.primary&&Wc(e.audioRoles,a.roles)&&e.accessibilityPurpose==a.accessibilityPurpose&&e.channelsCount==a.channelsCount&&e.audioSamplingRate==a.audioSamplingRate&&e.spatialAudio==a.spatialAudio}))&&!c.active&&this.ce(c,!0,b)}};
|
|
p.getAudioTracks=function(){var a=this.Fb();if(!a.length)return[];var b=a.find(function(f){return f.active});if(!b)return[];var c=a;this.m!=vq||this.ya()||(c=a.filter(function(f){return f.originalVideoId===b.originalVideoId&&f.audioCodec}));if(!c.length)return[];a=new Map;c=t(c);for(var d=c.next();!d.done;d=c.next()){d=d.value;var e=d.originalAudioId;e||null==d.audioId||(e=String(d.audioId));e&&a.set(e,{active:d.active,language:d.language,label:d.label,mimeType:d.audioMimeType,codecs:d.audioCodec,
|
|
primary:d.primary,roles:d.audioRoles||[],accessibilityPurpose:d.accessibilityPurpose,channelsCount:d.channelsCount,audioSamplingRate:d.audioSamplingRate,spatialAudio:d.spatialAudio,originalLanguage:d.originalLanguage})}return Array.from(a.values())};
|
|
p.Nk=function(a,b,c){b=void 0===b?!1:b;c=void 0===c?0:c;var d=this.Fb();if(d.length){var e=d.find(function(f){return f.active});e&&(d=d.find(function(f){return f.audioId===e.audioId&&(f.videoBandwidth||f.bandwidth)==a.bandwidth&&f.width==a.width&&f.height==a.height&&f.frameRate==a.frameRate&&f.pixelAspectRatio==a.pixelAspectRatio&&f.hdr==a.hdr&&f.colorGamut==a.colorGamut&&f.videoLayout==a.videoLayout&&f.videoMimeType==a.mimeType&&f.videoCodec==a.codecs}))&&!d.active&&this.ce(d,b,c)}};
|
|
p.getVideoTracks=function(){if(this.m==yq||this.ya())return[];var a=this.Fb();if(!a.length)return[];var b=a.find(function(f){return f.active});if(!b)return[];var c=a.filter(function(f){return f.originalAudioId===b.originalAudioId&&f.audioId===b.audioId&&f.audioGroupId===b.audioGroupId&&f.videoCodec});if(!c.length)return[];a=new Map;c=t(c);for(var d=c.next();!d.done;d=c.next()){d=d.value;var e=d.originalVideoId;e||null==d.videoId||(e=String(d.videoId));e&&a.set(e,{active:d.active,bandwidth:d.videoBandwidth||
|
|
d.bandwidth,width:d.width,height:d.height,frameRate:d.frameRate,pixelAspectRatio:d.pixelAspectRatio,hdr:d.hdr,colorGamut:d.colorGamut,videoLayout:d.videoLayout,mimeType:d.videoMimeType,codecs:d.videoCodec})}return Array.from(a.values())};p.pj=function(){return br(this.Fb())};p.Oj=function(){return br(this.yc())};p.oj=function(){return Array.from(cr(this.Fb()))};p.Nj=function(){return Array.from(cr(this.yc()))};
|
|
p.Ei=function(a,b,c,d,e,f,g){function h(){function l(u,w){return u.video||w.video?u.video&&w.video?Math.abs((u.video.height||0)-(w.video.height||0))+Math.abs((u.video.width||0)-(w.video.width||0)):Infinity:0}var m=k.l.l;k.N=k.g.adaptationSetCriteriaFactory();k.N.configure({language:a,role:b||"",channelCount:c||0,zc:"",spatialAudio:f||!1,videoLayout:"",cd:g||"",zd:"",codecSwitchingStrategy:k.g.mediaSource.codecSwitchingStrategy,audioCodec:e||"",Cd:m.audio&&m.audio.codecs?m.audio.codecs:"",Ee:m.audio&&
|
|
m.audio.channelsCount?m.audio.channelsCount:0,preferredAudioCodecs:k.g.preferredAudioCodecs,preferredAudioChannelCount:k.g.preferredAudioChannelCount});var n=k.N.create(k.i.variants),q=null;n=t(n.values());for(var r=n.next();!r.done;r=n.next())r=r.value,Zf(r)&&(!q||l(q,m)>l(r,m))&&(q=r);q!=m&&(q?(m=Lf(q),k.ce(m,!0,d||0)):Pp(k))}var k=this;c=void 0===c?0:c;d=void 0===d?0:d;e=void 0===e?"":e;f=void 0===f?!1:f;g=void 0===g?"":g;if(this.i&&this.F&&(h(),!this.ya()))return;(function(){if(k.h&&k.h.audioTracks){var l=
|
|
ag(k.Fb(),a,b||"",!1)[0];l&&k.ce(l)}})()};p.bh=function(a,b,c){function d(){e.td=a;e.qe=b||"";e.pe=c||!1;var f=ag(e.i.textStreams,e.td,e.qe,e.pe)[0]||null;f&&f!=e.l.A&&(Gn(e.A.h,f,!1),e.g.streaming.alwaysStreamText||e.Hg())&&(Cm(e.l,f),xq(e),Jq(e))}var e=this;c=void 0===c?!1:c;if(this.i&&this.F&&(d(),!this.ya()))return;(function(){var f=ag(e.yc(),a,b||"",c||!1)[0];f&&e.dh(f)})()};
|
|
p.Mk=function(a,b,c){function d(){for(var f=null,g=t(e.i.variants),h=g.next();!h.done;h=g.next())if(h=h.value,h.audio.label==a){f=h;break}null!=f&&(e.N=e.g.adaptationSetCriteriaFactory(),e.N.configure({language:f.language,role:"",channelCount:0,zc:"",spatialAudio:!1,videoLayout:"",zd:"",cd:a,codecSwitchingStrategy:e.g.mediaSource.codecSwitchingStrategy,audioCodec:"",Cd:"",Ee:0,preferredAudioCodecs:e.g.preferredAudioCodecs,preferredAudioChannelCount:e.g.preferredAudioChannelCount}),Pp(e,b,c))}var e=
|
|
this;b=void 0===b?!0:b;c=void 0===c?0:c;if(this.i&&this.F&&(d(),!this.ya()))return;(function(){if(e.h&&e.h.audioTracks){var f=Array.from(e.h.audioTracks),g=null;f=t(f);for(var h=f.next();!h.done;h=f.next())h=h.value,h.label==a&&(g=h);g&&ar(e,g)}})()};p.Hg=function(){var a=this.oa;return this.o?this.o.isTextVisible():a};p.tj=function(){return this.ab.map(function(a){return Of(a)})};
|
|
p.rj=function(a){wb("getChapters","Please use an getChaptersAsync.");if(!this.ab.length)return[];var b=gf(a);a=this.ab.filter(function(f){return gf(f.language)==b});if(!a.length)return[];var c=[],d=new Set;a=t(a);for(var e=a.next();!e.done;e=a.next())e=e.value,e.segmentIndex&&e.segmentIndex.Cb(function(f){var g=f.O()[0],h=f.startTime+"-"+f.endTime+"-"+g;f={id:h,title:g,startTime:f.startTime,endTime:f.endTime};d.has(h)||(c.push(f),d.add(h))});return c};
|
|
p.sj=function(a){var b=this,c,d,e,f,g,h,k;return Q(function(l){switch(l.g){case 1:if(!b.ab.length)return l.return([]);c=gf(a);d=b.ab.filter(function(m){return gf(m.language)==c});if(!d.length)return l.return([]);e=[];f=new Set;g=t(d);h=g.next();case 2:if(h.done){l.u(4);break}k=h.value;if(k.segmentIndex){l.u(5);break}return F(l,k.createSegmentIndex(),5);case 5:k.segmentIndex.Cb(function(m){var n=m.O()[0],q=m.startTime+"-"+m.endTime+"-"+n;m={id:q,title:n,startTime:m.startTime,endTime:m.endTime};f.has(q)||
|
|
(e.push(m),f.add(q))});h=g.next();l.u(2);break;case 4:return l.return(e)}})};function Oq(a){return Array.from(a.h.textTracks).filter(function(b){return"metadata"!=b.kind&&"chapters"!=b.kind&&"Shaka Player TextTrack"!=b.label})}function Pq(a){return Array.from(a.h.textTracks).find(function(b){return"Shaka Player TextTrack"==b.label})}function Tq(a){return Array.from(a.h.textTracks).filter(function(b){return"metadata"==b.kind})}
|
|
p.ih=function(a){a=!!a;this.oa!=a&&(this.oa=a,this.m==vq?(this.o.setTextVisibility(a),this.g.streaming.alwaysStreamText||(a?this.l.A||(a=ag(this.i.textStreams,this.td,this.qe,this.pe),0<a.length&&(Cm(this.l,a[0]),xq(this),Jq(this))):ym(this.l))):this.h&&this.h.src&&this.h.textTracks&&this.o.setTextVisibility(a),Iq(this))};
|
|
p.Hj=function(){if(this.F)var a=this.F.Be();else{if(null==this.M)return new Date;if(this.M instanceof Date)return this.M;a=this.M}if(this.i&&!this.ya()){var b=this.i.presentationTimeline;return new Date(1E3*((b.m||b.i)+a))}return this.h&&this.h.getStartDate?(b=this.h.getStartDate(),isNaN(b.getTime())?null:new Date(b.getTime()+1E3*a)):null};
|
|
p.Ag=function(){if(this.i&&!this.ya()){var a=this.i.presentationTimeline;return new Date(1E3*(a.m||a.i))}return this.h&&this.h.getStartDate?(a=this.h.getStartDate(),isNaN(a.getTime())?null:a):null};p.Ve=function(){return this.V()?this.i?this.i.presentationTimeline.Ve():null:null};p.Lb=function(){if(this.m==vq)return this.I.Lb();var a={total:[],audio:[],video:[],text:[]};this.m==yq&&(a.total=yj(this.h.buffered));return a};
|
|
p.Te=function(){if(!this.h||!this.h.currentTime)return null;var a=this.Ag().getTime()+1E3*this.h.currentTime;return Math.floor(Date.now()-a)};
|
|
p.getStats=function(){if(this.m!=vq&&this.m!=yq)return{width:NaN,height:NaN,currentCodecs:"",streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,corruptedFrames:NaN,stallsDetected:NaN,gapsJumped:NaN,estimatedBandwidth:NaN,completionPercent:NaN,loadLatency:NaN,manifestTimeSeconds:NaN,drmTimeSeconds:NaN,playTime:NaN,pauseTime:NaN,bufferingTime:NaN,licenseTime:NaN,liveLatency:NaN,maxSegmentDuration:NaN,manifestSizeBytes:NaN,bytesDownloaded:NaN,nonFatalErrorCount:NaN,manifestPeriodCount:NaN,manifestGapCount:NaN,
|
|
switchHistory:[],stateHistory:[]};uq(this);var a=this.h,b=a.currentTime/a.duration;isNaN(b)||this.V()||Kn(this.A,Math.round(100*b));this.F&&(this.A.S=this.F.Ah(),this.A.U=this.F.Bh());a.getVideoPlaybackQuality&&(b=a.getVideoPlaybackQuality(),In(this.A,Number(b.droppedVideoFrames),Number(b.totalVideoFrames)),this.A.M=Number(b.corruptedVideoFrames));this.A.o=this.C?Rh(this.C):NaN;Jn(this.A,a.videoWidth||NaN,a.videoHeight||NaN);this.A.l="";this.V()&&null!=this.Ag()&&(a=this.Te()||0,this.A.C=a/1E3);b=
|
|
this.Fb().find(function(e){return e.active});a=this.yc().find(function(e){return e.active});if(b){if(b.bandwidth){var c=this.K?this.K.i:1,d=c*b.bandwidth;a&&a.bandwidth&&(d+=c*a.bandwidth);this.A.A=d}b.width&&b.height&&Jn(this.A,b.width||NaN,b.height||NaN);b=b.codecs;a&&(b+=","+(a.codecs||a.mimeType));b&&(this.A.l=b)}this.m!=vq||this.ya()||(this.i&&(this.A.H=this.i.periodCount,this.A.G=this.i.gapCount,this.i.presentationTimeline&&(this.A.K=this.i.presentationTimeline.h)),a=this.s.getBandwidthEstimate(),
|
|
this.A.s=a);this.m==yq&&Ln(this.A,NaN);return Mn(this.A)};
|
|
p.Dd=function(a,b,c,d,e,f,g){g=void 0===g?!1:g;var h=this,k,l,m,n,q,r,u,w,v,y,z,A;return Q(function(B){switch(B.g){case 1:if(h.m!=vq&&h.m!=yq)throw new U(1,7,7004);"subtitles"!=c&&"captions"!=c&&bb("Using a kind value different of `subtitles` or `captions` can cause unwanted issues.");if(d){B.u(2);break}return F(B,dr(h,a),3);case 3:d=B.h;case 2:k=[];h.B&&(k=h.B.getCuePoints());if(h.m!=yq){B.u(4);break}l=qb();g&&"WEBKIT"===l.Ea()&&(c="forced");return F(B,er(h,a,b,c,d,f||"",k),5);case 5:m=B.h;if(m.track)return pq(h),
|
|
B.return(Xf(m.track));throw new U(1,2,2012);case 4:n=yc;q=h.Sa();r=q.end-q.start;h.i&&(r=h.i.presentationTimeline.getDuration());if(Infinity==r)throw new U(1,4,4033);if(!k.length){B.u(6);break}return F(B,fr(h,a,h.H,h.g.streaming.retryParameters),7);case 7:u=B.h,w=gr(h,u,d,k),v=new Blob([w],{type:"text/vtt"}),a=uk(v),d="text/vtt";case 6:y={id:h.se++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:El(0,r,[a]),mimeType:d||"",codecs:e||"",kind:c,encrypted:!1,
|
|
drmInfos:[],keyIds:new Set,language:b,originalLanguage:b,label:f||null,type:n.Oa,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!!g,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([De(d||"",e||"")]),isAudioMuxedInVideo:!1,baseOriginalId:null};z=De(y.mimeType,y.codecs);A=Te(z);if(!A)throw new U(2,2,2014,d);h.i.textStreams.push(y);pq(h);return B.return(Of(y))}})};
|
|
p.Ge=function(a,b){var c=this,d,e,f,g,h,k,l,m,n,q,r,u,w,v,y,z,A,B;return Q(function(E){switch(E.g){case 1:if(c.m!=vq&&c.m!=yq)throw new U(1,7,7004);if(b){E.u(2);break}return F(E,dr(c,a),3);case 3:b=E.h;case 2:if("text/vtt"!=b)throw new U(1,2,2017,a);d=yc;e=c.Sa();f=e.end-e.start;c.i&&(f=c.i.presentationTimeline.getDuration());if(Infinity==f)throw new U(1,4,4045);return F(E,fr(c,a,c.H,c.g.streaming.retryParameters),4);case 4:g=E.h;h=Se(b);if(!h)throw new U(2,2,2014,b);k=h();l={periodStart:0,segmentStart:0,
|
|
segmentEnd:f,vttOffset:0};m=Tb(g);n=k.parseMedia(m,l,a,[]);q=[];r=t(n);u=r.next();for(w={};!u.done;w={Kf:void 0,ed:void 0},u=r.next())w.ed=u.value,w.Kf=null,v=function(H){return function(){null==H.Kf&&(H.Kf=qc([a],[H.ed.payload]));return H.Kf||[]}}(w),y=new qj(w.ed.startTime,w.ed.endTime,v,0,null,null,0,0,Infinity),w.ed.payload.includes("#xywh")&&(z=w.ed.payload.split("#xywh=")[1].split(","),4===z.length&&y.Cf({height:parseInt(z[3],10),positionX:parseInt(z[0],10),positionY:parseInt(z[1],10),width:parseInt(z[2],
|
|
10)})),q.push(y);A=b;if(!q.length){E.u(5);break}return F(E,vo(q[0].O()[0],c.H,c.g.manifest.retryParameters),6);case 6:A=E.h;case 5:return B={id:c.se++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new Cl(q),mimeType:A||"",codecs:"",kind:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"und",originalLanguage:null,label:null,type:d.Nf,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,
|
|
audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,tilesLayout:"1x1",accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([De(A||"","")]),isAudioMuxedInVideo:!1,baseOriginalId:null},c.m==yq?c.ye.push(B):c.i.imageStreams.push(B),pq(c),E.return(Pf(B))}})};
|
|
p.Fe=function(a,b,c){var d=this,e,f,g,h,k,l,m,n,q,r,u,w,v,y,z;return Q(function(A){switch(A.g){case 1:if(d.m!=vq&&d.m!=yq)throw new U(1,7,7004);if(c){A.u(2);break}return F(A,dr(d,a),3);case 3:c=A.h;case 2:e=yc;f=d.Sa();g=f.end-f.start;d.i&&(g=d.i.presentationTimeline.getDuration());if(Infinity==g)throw new U(1,4,4054);return F(A,fr(d,a,d.H,d.g.streaming.retryParameters),4);case 4:h=A.h;k=Se(c);if(!k)throw new U(2,2,2014,c);l=k();m={periodStart:0,segmentStart:0,segmentEnd:g,vttOffset:0};n=Tb(h);q=
|
|
l.parseMedia(n,m,a,[]);r=[];u=t(q);w=u.next();for(v={};!w.done;v={Pe:void 0},w=u.next())v.Pe=w.value,y=new qj(v.Pe.startTime,v.Pe.endTime,function(B){return function(){return[B.Pe.payload]}}(v),0,null,null,0,0,Infinity),r.push(y);z={id:d.se++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new Cl(r),mimeType:"text/plain",codecs:"",kind:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:b,originalLanguage:b,label:null,type:e.Oa,primary:!1,trickModeVideo:null,
|
|
dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([De("text/plain","")]),isAudioMuxedInVideo:!1,baseOriginalId:null};d.ab.push(z);pq(d);return A.return(Of(z))}})};
|
|
function dr(a,b){var c;return Q(function(d){switch(d.g){case 1:return wa(d,2),F(d,vo(b,a.H,a.g.streaming.retryParameters),4);case 4:c=d.h;za(d,3);break;case 2:Aa(d);case 3:if(c)return d.return(c);throw new U(1,2,2011,b);}})}
|
|
function er(a,b,c,d,e,f,g){var h,k,l,m;return Q(function(n){if(1==n.g)return"text/vtt"!=e||g.length?F(n,fr(a,b,a.H,a.g.streaming.retryParameters),3):n.u(2);2!=n.g&&(h=n.h,k=gr(a,h,e,g),l=new Blob([k],{type:"text/vtt"}),b=uk(l),e="text/vtt");m=document.createElement("track");var q=a.L,r=b;try{if(q.g.enabled){var u=ip(q);u.ot=wp;u.su=!0;var w=mp(u);var v=np(r,w)}else v=r}catch(y){cb("CMCD_TEXT_TRACK_ERROR","Could not generate text track CMCD data.",y),v=r}m.src=v;m.label=f;m.kind=d;m.srclang=c;a.h.getAttribute("crossorigin")||
|
|
a.h.setAttribute("crossorigin","anonymous");a.h.appendChild(m);a.Rf.push(m);return n.return(m)})}function fr(a,b,c,d){var e,f,g;return Q(function(h){if(1==h.g){e=Rg;f=Lg([b],d);f.method="GET";var k=a.L;try{k.g.enabled&&op(k,f,{ot:wp,su:!0})}catch(l){cb("CMCD_TEXT_ERROR","Could not generate text CMCD data.",l)}return F(h,c.request(e,f).promise,2)}g=h.h;return h.return(g.data)})}
|
|
function gr(a,b,c,d){var e=Se(c);if(e)return c=e(),a={periodStart:0,segmentStart:0,segmentEnd:a.h.duration,vttOffset:0},b=Tb(b),b=c.parseMedia(b,a,null,[]),Xo(b,d);throw new U(2,2,2014,c);}p.Sk=function(a,b){this.ua.width=a;this.ua.height=b};p.Yg=function(a){if(this.m==vq){var b=this.l;a=void 0===a?.1:a;if(b.m.g)b=!1;else if(b.B)b=!1;else{for(var c=t(b.i.values()),d=c.next();!d.done;d=c.next())d=d.value,!d.Pd||d.Qa||d.yb||(d.Pd=!1,xm(b,d,a));b=!0}}else b=!1;return b};
|
|
p.zg=function(){bb("Shaka Player's internal Manifest structure is NOT covered by semantic versioning compatibility guarantees. It may change at any time! Please consider filing a feature request for whatever you use getManifest() for.");return this.i};p.Dj=function(){return this.mc};
|
|
p.xj=function(){var a={video:null,audio:null,text:null};if(this.m!=vq)return a;var b=this.l.l,c=this.h.currentTime;b=t([b.video,b.audio,this.l.A]);for(var d=b.next();!d.done;d=b.next())if((d=d.value)&&d.segmentIndex){var e=d.segmentIndex.find(c);e=d.segmentIndex.get(e);e={codecs:e.codecs||d.codecs,mimeType:e.mimeType||d.mimeType,bandwidth:e.bandwidth||d.bandwidth};"video"==d.type?(e.width=d.width,e.height=d.height,a.video=e):"audio"==d.type?a.audio=e:d.type==wc&&(a.text=e)}return a};
|
|
function Jp(a){var b=wn();b.streaming.failureCallback=function(c){if(a.V()){var d=null;1001==c.code||1002==c.code?(d=1,a.g.streaming.lowLatencyMode&&(d=.1)):1003==c.code&&(d=.1);null!=d&&(c.severity=1,a.Yg(d))}};b.textDisplayFactory=function(){var c=qb();return a.ue&&(document.fullscreenEnabled||"WEBKIT"!==c.Ea())?new No(a.h,a.ue):"track"in document.createElement("track")?new Io(a):new Mo};return b}p.Li=function(a){this.ue=a};
|
|
function lq(a,b){for(var c=new Set,d=t(b.textStreams),e=d.next();!e.done;e=d.next())e=e.value,"application/cea-608"!=e.mimeType&&"application/cea-708"!=e.mimeType||c.add(e.originalId);d=t(b.variants);for(e=d.next();!e.done;e=d.next())if((e=e.value.video)&&e.closedCaptions)for(var f=t(e.closedCaptions.keys()),g=f.next();!g.done;g=f.next())if(g=g.value,!c.has(g)){var h=g.startsWith("CC")?"application/cea-608":"application/cea-708",k=new Fl,l=e.closedCaptions.get(g);h={id:a.se++,originalId:g,groupId:null,
|
|
createSegmentIndex:function(){return Promise.resolve()},segmentIndex:k,mimeType:h,codecs:"",kind:"caption",encrypted:!1,drmInfos:[],keyIds:new Set,language:l,originalLanguage:l,label:null,type:wc,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:e.roles,forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!1,fastSwitching:!1,fullMimeTypes:new Set([De(h,"")]),isAudioMuxedInVideo:!1,baseOriginalId:null};
|
|
b.textStreams.push(h);c.add(g)}}
|
|
function Hq(a,b){var c,d,e,f,g;return Q(function(h){if(1==h.g)return c=a.audio,d=a.video,e=function(k,l){var m,n,q;return Q(function(r){if(1==r.g)return k?k.segmentIndex?r.u(2):F(r,k.createSegmentIndex(),2):r.return(null);n=(m=k.segmentIndex.Ub(l))?m.next().value:null;if(!n)return r.return(null);q=n.startTime;return r.return(q)})},F(h,e(c,b),2);if(3!=h.g)return f=h.h,F(h,e(d,b),3);g=h.h;return null!=g&&null!=f?h.return(Math.max(g,f)):null!=g?h.return(g):null!=f?h.return(f):h.return(b)})}
|
|
function aq(a){var b=a.Gg();if(a.A&&a.P&&a.F){if(0==a.g.streaming.rebufferingGoal){var c=a.K;c.j=!1;Jl(c)}else c=a.K,c.j=b,Jl(c);a.L&&(c=a.L,b||c.s||(c.s=!0),c.s&&b&&(c.B=!0),c.F=b);uq(a);c=a.g.streaming.liveSync.dynamicTargetLatency.maxAttempts;if(a.g.streaming.liveSync.dynamicTargetLatency.enabled&&b&&a.De<c){c=a.g.streaming.liveSync.dynamicTargetLatency.maxLatency;var d=a.g.streaming.liveSync.targetLatencyTolerance,e=a.g.streaming.liveSync.dynamicTargetLatency.rebufferIncrement;a.U&&(a.U=Math.min(a.U+
|
|
++a.De*e,c-d))}}b=(new Map).set("buffering",b);a.dispatchEvent(Sp("buffering",b))}function wq(a,b){a.Yb.Ra();a.Yb.D(a.h,"timeupdate",function(){var c=a.h.currentTime,d=a.Sa(),e=a.V()?a.g.streaming.safeSeekOffset:0;0<b?Math.floor(c)>=Math.floor(d.end)&&a.Ed():Math.floor(c)<=Math.floor(d.start+e)&&a.Ed()})}
|
|
function uq(a){if(a.A&&a.P){var b=a.A.g,c="playing";a.P.g==ji?c="buffering":a.Td()?c="ended":a.h.paused&&(c="paused");var d=c;if(null==b.g)b.g={timestamp:Date.now()/1E3,state:d,duration:0},b=!0;else{var e=Date.now()/1E3;b.g.duration=e-b.g.timestamp;b.g.state==d?b=!1:(b.h.push(b.g),b.g={timestamp:e,state:d,duration:0},b=!0)}b&&(c=(new Map).set("newstate",c),a.dispatchEvent(Sp("statechanged",c)))}}
|
|
function Lq(a){var b=a.h.playbackRate,c=a.V();if(a.g.streaming.vodDynamicPlaybackRate&&!c){var d=a.g.streaming.vodDynamicPlaybackRateLowBufferRate,e=a.Rh();e<=a.g.streaming.vodDynamicPlaybackRateBufferRatio?b!=d&&a.ie(d,!1):1==e&&b!==a.K.Kc()&&a.Ed()}if(c&&(c=a.Sa(),Number.isFinite(c.end)&&!(a.h.currentTime<c.start||a.h.paused))){d=a.g.streaming.liveSync.targetLatencyTolerance;e=a.g.streaming.liveSync.dynamicTargetLatency.enabled;var f=a.g.streaming.liveSync.dynamicTargetLatency.stabilityThreshold;
|
|
if(a.g.streaming.liveSync&&a.g.streaming.liveSync.enabled){var g=a.g.streaming.liveSync.targetLatency;var h=g+d;var k=Math.max(0,g-d);var l=a.g.streaming.liveSync.maxPlaybackRate;var m=a.g.streaming.liveSync.minPlaybackRate}else a.i&&a.i.serviceDescription&&(g=a.i.serviceDescription.targetLatency,null!=a.i.serviceDescription.targetLatency?h=a.i.serviceDescription.targetLatency+d:null!=a.i.serviceDescription.maxLatency&&(h=a.i.serviceDescription.maxLatency),null!=a.i.serviceDescription.targetLatency?
|
|
k=Math.max(0,a.i.serviceDescription.targetLatency-d):null!=a.i.serviceDescription.minLatency&&(k=a.i.serviceDescription.minLatency),l=a.i.serviceDescription.maxPlaybackRate||a.g.streaming.liveSync.maxPlaybackRate,m=a.i.serviceDescription.minPlaybackRate||a.g.streaming.liveSync.minPlaybackRate);a.U||"number"!==typeof g||(a.U=g);var n=a.g.streaming.liveSync.dynamicTargetLatency.maxAttempts;e&&a.Xb&&null!==a.U&&"number"===typeof g&&a.De<n&&Date.now()-a.Xb>1E3*f&&(f=a.g.streaming.liveSync.dynamicTargetLatency.minLatency,
|
|
a.U=Math.max(a.U-(g-f)/2,f+d),a.Xb=Date.now());e&&null!==a.U&&(h=a.U+d,k=a.U-d);g=c.end-a.h.currentTime;d=0;a.m==yq&&(e=a.h.buffered,0<e.length&&(d=e.end(e.length-1),d=Math.max(l,d-c.end)));c=a.g.streaming.liveSync.panicMode;e=1E3*a.g.streaming.liveSync.panicThreshold;f=Date.now()-a.P.h;c&&!m&&(m=a.g.streaming.liveSync.minPlaybackRate);c&&m&&f<=e?b!=m&&a.ie(m,!1):void 0!=h&&l&&g-d>h?(b!=l&&a.ie(l,!1),a.Xb=null):void 0!=k&&m&&g-d<k?(b!=m&&a.ie(m,!1),a.Xb=null):b!==a.K.Kc()&&(a.Ed(),a.Xb=Date.now())}}
|
|
function Mq(a){if(a.h){var b=function(e,f){var g=void 0===g?Number.EPSILON:g;if(e===f)g=!0;else{var h=Math.abs(e-f);g=h<=g?!0:g!==Number.EPSILON?Math.abs(h-g)<=Number.EPSILON:!1}return(g||f>e)&&a.Qf<e?(a.Qf=e,!0):!1},c=a.Sa();c=c.end-c.start;c=0<c?a.h.currentTime/c:0;if(!isNaN(c)){c*=100;if(b(0,c))var d=Sp("started");else if(b(25,c))d=Sp("firstquartile");else if(b(50,c))d=Sp("midpoint");else if(b(75,c))d=Sp("thirdquartile");else{if(b(100,c)||100<c)d=Sp("complete");a.g&&Infinity!=a.g.playRangeEnd&&
|
|
a.Td()&&a.h.pause()}d&&a.dispatchEvent(d)}}}function qq(a){try{pi(a.re,a.i)}catch(c){return Zp(a,c),!1}var b=$f(a.i.variants);b=a.N.create(b);a.s.setVariants(Array.from(b.values()));return!0}function Pp(a,b,c,d,e){b=void 0===b?!0:b;c=void 0===c?0:c;d=void 0===d?!1:d;e=void 0===e?!0:e;var f;(f=qq(a)?a.s.chooseVariant():null)&&Cq(a,f,e,b,c,d)}
|
|
function Cq(a,b,c,d,e,f){f=void 0===f?!1:f;var g=a.l.l;if(b==g)d&&Bm(a.l,b,d,e,!0);else{var h=a.A.h;h.h!=b&&(h.h=b,h.g.push({timestamp:Date.now()/1E3,id:b.id,type:"variant",fromAdaptation:c,bandwidth:b.bandwidth}));Bm(a.l,b,d,e,f,c);d=null;g&&(d=Lf(g));g=Lf(b);g.active=!0;if(a.S&&(e=a.S,b=b.video)){b.dependencyStream&&(b=b.dependencyStream);f=0;h=-1;switch(b.mimeType){case "video/webm":f=1;break;case "video/mp4":f=2}switch(a.Th()){case "DASH":h=1;break;case "HLS":h=0}e.g&&(e.g.setLevelSwitching(b.id,
|
|
!0),e.g.setContainerFormat(f),e.j||e.g.setStreamingFormat(h))}c?(c=(new Map).set("oldTrack",d).set("newTrack",g),c=Sp("adaptation",c),hr(a,c)):ir(a,d,g);jr(a,d,g)}}function ar(a,b){var c=Array.from(a.h.audioTracks).find(function(e){return e.enabled});b.enabled=!0;if(c){b.id!==c.id&&(c.enabled=!1);var d=Xq(a);c=Yf(c,d);b=Yf(b,d);ir(a,c,b);jr(a,c,b)}}function Xq(a){return a.h&&a.h.videoTracks?Array.from(a.h.videoTracks).find(function(b){return b.selected}):null}
|
|
function pq(a){var b=Sp("trackschanged");hr(a,b);kr(a)}function ir(a,b,c){b=(new Map).set("oldTrack",b).set("newTrack",c);b=Sp("variantchanged",b);hr(a,b)}function jr(a,b,c){var d=!1;b&&b.audioId==c.audioId&&b.audioGroupId==c.audioGroupId||(d=!0);d&&kr(a)}function kr(a){var b=Sp("audiotrackschanged");hr(a,b)}function xq(a){var b=Sp("textchanged");hr(a,b)}function Iq(a){var b=Sp("texttrackvisibility");hr(a,b)}
|
|
function Kq(a){a.g.abr.enabled||Op(a);var b=(new Map).set("newStatus",a.g.abr.enabled);hr(a,Sp("abrstatuschanged",b))}function Jq(a){var b=a.yc().find(function(c){return c.active});b&&a.o&&a.o.setTextLanguage&&a.o.setTextLanguage(b.language)}function Op(a,b){b=void 0===b?!0:b;if(a.m==vq){a.ve.stop();for(var c=t(a.i.variants),d=c.next();!d.done;d=c.next())d.value.disabledUntilTime=0;b&&qq(a)}}
|
|
p.disableStream=function(a,b){if(!this.g.abr.enabled||this.m===Tp||!navigator.onLine||0==b||!this.i)return!1;if(this.i.variants.some(function(h){var k=h[a.type];return k&&k.id!==a.id&&!h.disabledUntilTime?"audio"==a.type?a.language===k.language:!0:!1})){for(var c=!1,d=!1,e=t(this.i.variants),f=e.next();!f.done;f=e.next()){f=f.value;var g=f[a.type];g&&(g.id===a.id?(f.disabledUntilTime=Date.now()/1E3+b,c=!0):g.trickModeVideo&&g.trickModeVideo.id==a.id&&(d=!0))}if(!c&&d)return!1;this.ve.Ga(1);b=this.Lb().video.reduce(function(h,
|
|
k){return h+k.end-k.start},0);Pp(this,!1,b,!0,!1);return!0}return!1};
|
|
function Zp(a,b){var c,d,e,f,g;return Q(function(h){switch(h.g){case 1:if(a.m==Tp)return h.return();1===b.severity&&a.A.L++;c=!0;if(!(a.Ka&&a.i&&a.l)||3016!=b.code&&3014!=b.code&&3015!=b.code&&3024!=b.code&&3018!=b.code){h.u(2);break}d=qb();if("WEBKIT"===d.Ea()&&3016==b.code)return h.return();wa(h,3);return F(h,Em(a.l),5);case 5:e=h.h;c=!e;e&&(f=Sp("mediasourcerecovered"),a.dispatchEvent(f));za(h,2);break;case 3:Aa(h),c=!0;case 2:if(!c)return h.return();2===b.severity&&Op(a,!1);g=Sp("error",(new Map).set("detail",
|
|
b));a.dispatchEvent(g);g.defaultPrevented&&(b.handled=!0);G(h)}})}p.addFont=function(a,b){return Gj(a,b)};function nq(a,b,c,d){d=void 0===d?a:d;a=(new Map).set("detail",{schemeIdUri:c.schemeIdUri,value:c.value,startTime:c.startTime,endTime:c.endTime,id:c.id,timescale:c.timescale,eventElement:c.eventElement,eventNode:c.eventNode});d.dispatchEvent(Sp(b,a))}
|
|
function oq(a,b,c,d){d=void 0===d?!1:d;b=(new Map).set("mediaQuality",{bandwidth:b.bandwidth,audioSamplingRate:b.audioSamplingRate,codecs:b.codecs,contentType:b.contentType,frameRate:b.frameRate,height:b.height,mimeType:b.mimeType,channelsCount:b.channelsCount,pixelAspectRatio:b.pixelAspectRatio,width:b.width,label:b.label,roles:b.roles,language:b.language}).set("position",c);a.dispatchEvent(Sp(d?"audiotrackchanged":"mediaqualitychanged",b))}
|
|
function Yp(a,b){b=void 0===b?!0:b;if(!a.h.error)return b?new U(2,3,3016):null;var c=a.h.error.code;if(!b&&1==c)return null;if(b=a.h.error.msExtendedCode)0>b&&(b+=Math.pow(2,32)),b=b.toString(16);return new U(2,3,3016,c,b,a.h.error.message)}function Bq(a,b,c){0<b&&(a.V()||a.Ki(b));b=a.getDuration();c<b&&(a.V()||a.ob(c))}function hr(a,b){Q(function(c){if(1==c.g)return F(c,Promise.resolve(),2);a.m!=Tp&&a.dispatchEvent(b);G(c)})}
|
|
function cr(a){var b=new Set;a=t(a);for(var c=a.next();!c.done;c=a.next())c=c.value,c.language?b.add(gf(c.language)):b.add("und");return b}
|
|
function br(a){for(var b=new Map,c=new Map,d=0;d<a.length;d++){var e=a[d],f="und",g=[];e.language&&(f=gf(e.language));"variant"==e.type?g=e.audioRoles:g=e.roles;g&&g.length||(g=[""]);b.has(f)||b.set(f,new Set);g=t(g);for(var h=g.next();!h.done;h=g.next())h=h.value,b.get(f).add(h),e.label&&(c.has(f)||c.set(f,new Map),c.get(f).set(h,e.label))}var k=[];b.forEach(function(l,m){l=t(l);for(var n=l.next();!n.done;n=l.next()){n=n.value;var q=null;c.has(m)&&c.get(m).has(n)&&(q=c.get(m).get(n));k.push({language:m,
|
|
role:n,label:q})}});return k}p.ya=function(){return this.h&&this.h.remote?"disconnected"!=this.h.remote.state:!1};p.Td=function(){return!this.h||this.h.ended?!0:this.Ka&&!this.V()&&this.h.currentTime>=this.Sa().end};T("shaka.Player",Y);Y.prototype.isEnded=Y.prototype.Td;Y.prototype.isRemotePlayback=Y.prototype.ya;Y.prototype.addFont=Y.prototype.addFont;Y.prototype.setVideoContainer=Y.prototype.Li;Y.prototype.getFetchedPlaybackInfo=Y.prototype.xj;Y.prototype.getManifestParserFactory=Y.prototype.Dj;
|
|
Y.prototype.getManifest=Y.prototype.zg;Y.prototype.retryStreaming=Y.prototype.Yg;Y.prototype.setMaxHardwareResolution=Y.prototype.Sk;Y.prototype.addChaptersTrack=Y.prototype.Fe;Y.prototype.addThumbnailsTrack=Y.prototype.Ge;Y.prototype.addTextTrackAsync=Y.prototype.Dd;Y.prototype.getStats=Y.prototype.getStats;Y.prototype.getBufferedInfo=Y.prototype.Lb;Y.prototype.getSegmentAvailabilityDuration=Y.prototype.Ve;Y.prototype.getPresentationStartTimeAsDate=Y.prototype.Ag;
|
|
Y.prototype.getPlayheadTimeAsDate=Y.prototype.Hj;Y.prototype.setTextTrackVisibility=Y.prototype.ih;Y.prototype.getChaptersAsync=Y.prototype.sj;Y.prototype.getChapters=Y.prototype.rj;Y.prototype.getChaptersTracks=Y.prototype.tj;Y.prototype.isTextTrackVisible=Y.prototype.Hg;Y.prototype.selectVariantsByLabel=Y.prototype.Mk;Y.prototype.selectTextLanguage=Y.prototype.bh;Y.prototype.selectAudioLanguage=Y.prototype.Ei;Y.prototype.getTextLanguages=Y.prototype.Nj;Y.prototype.getAudioLanguages=Y.prototype.oj;
|
|
Y.prototype.getTextLanguagesAndRoles=Y.prototype.Oj;Y.prototype.getAudioLanguagesAndRoles=Y.prototype.pj;Y.prototype.getVideoTracks=Y.prototype.getVideoTracks;Y.prototype.selectVideoTrack=Y.prototype.Nk;Y.prototype.getAudioTracks=Y.prototype.getAudioTracks;Y.prototype.selectAudioTrack=Y.prototype.Lk;Y.prototype.selectVariantTrack=Y.prototype.ce;Y.prototype.selectTextTrack=Y.prototype.dh;Y.prototype.getThumbnails=Y.prototype.Qj;Y.prototype.getAllThumbnails=Y.prototype.nj;
|
|
Y.prototype.getImageTracks=Y.prototype.zj;Y.prototype.getTextTracks=Y.prototype.yc;Y.prototype.getVariantTracks=Y.prototype.Fb;Y.prototype.cancelTrickPlay=Y.prototype.Ed;Y.prototype.trickPlay=Y.prototype.ie;Y.prototype.useTrickPlayTrackIfAvailable=Y.prototype.yh;Y.prototype.getPlaybackRate=Y.prototype.sb;Y.prototype.isBuffering=Y.prototype.Gg;Y.prototype.getKeyStatuses=Y.prototype.Se;Y.prototype.getActiveSessionsMetadata=Y.prototype.yg;Y.prototype.getExpiration=Y.prototype.Md;
|
|
Y.prototype.drmInfo=Y.prototype.drmInfo;Y.prototype.keySystem=Y.prototype.keySystem;Y.prototype.isFullyLoaded=Y.prototype.$j;Y.prototype.goToLive=Y.prototype.Wj;Y.prototype.seekRange=Y.prototype.Sa;Y.prototype.isVideoOnly=Y.prototype.gk;Y.prototype.isAudioOnly=Y.prototype.Zj;Y.prototype.isInProgress=Y.prototype.Oc;Y.prototype.isLive=Y.prototype.V;Y.prototype.getQueueManager=Y.prototype.Wh;Y.prototype.getAdManager=Y.prototype.Qh;Y.prototype.getAssetUri=Y.prototype.jd;
|
|
Y.prototype.getNetworkingEngine=Y.prototype.Nb;Y.prototype.getMediaElement=Y.prototype.Gj;Y.prototype.getManifestType=Y.prototype.Th;Y.prototype.getLoadMode=Y.prototype.Cj;Y.prototype.resetConfiguration=Y.prototype.zi;Y.prototype.getBufferFullness=Y.prototype.Rh;Y.prototype.getNonDefaultConfiguration=Y.prototype.Vh;Y.prototype.getConfigurationForLowLatency=Y.prototype.uj;Y.prototype.getConfiguration=Y.prototype.getConfiguration;Y.prototype.configurationForLowLatency=Y.prototype.kj;
|
|
Y.prototype.configure=Y.prototype.configure;Y.prototype.releaseAllMutexes=Y.prototype.Dk;Y.prototype.destroyAllPreloads=Y.prototype.hg;Y.prototype.preload=Y.prototype.preload;Y.prototype.detachAndSavePreload=Y.prototype.Mh;Y.prototype.unloadAndSavePreload=Y.prototype.Vk;Y.prototype.load=Y.prototype.load;Y.prototype.updateStartTime=Y.prototype.Zk;Y.prototype.unload=Y.prototype.rc;Y.prototype.detach=Y.prototype.detach;Y.prototype.attachCanvas=Y.prototype.cj;Y.prototype.attach=Y.prototype.cc;
|
|
Y.probeSupport=function(a){a=void 0===a?!0:a;var b,c,d,e,f,g,h;return Q(function(k){switch(k.g){case 1:b={};if(!a){k.u(2);break}return F(k,bi(),3);case 3:b=k.h;case 2:return c=ui(),d=wk(),e=qb(),F(k,e.ec(),4);case 4:return f=k.h,g={manifest:c,media:d,drm:b,hardwareResolution:f},h=Vp,h.forEach(function(l,m){g[m]=l()}),k.return(g)}})};
|
|
Y.isBrowserSupported=function(){window.Promise||bb("A Promise implementation or polyfill is required");if(!(window.Promise&&window.Uint8Array&&Array.prototype.forEach)||(navigator.userAgent||"").includes("Trident/"))return!1;qb();return vi()?!0:""!=wi().canPlayType("application/x-mpegurl")};Y.setQueueManagerFactory=function(a){Np=a};Y.setAdManagerFactory=function(a){Mp=a};Y.registerSupportPlugin=Up;Y.prototype.destroy=Y.prototype.destroy;var Tp=0,Ip=1,vq=2,yq=3;
|
|
Y.LoadMode={DESTROYED:Tp,NOT_LOADED:Ip,MEDIA_SOURCE:vq,SRC_EQUALS:yq};Y.version="v4.15.0";var lr=["4","15"];xb=new function(a){this.g=a;this.i=yb;this.h=zb}(new vb(Number(lr[0]),Number(lr[1])));var Vp=new Map,Mp=null,Np=null;function mr(){this.g=[];this.i=this.m=this.l=this.j=this.h=0}function nr(a){return a.g.length?a.g.reduce(function(b,c){return b+c},0)/a.g.length:0};function or(a,b,c){var d=this;this.g=a;this.h=b;this.m=c;this.i=!1;this.j=this.h.getVolume();this.l=new jb;this.l.D(this.h,google.ima.AdEvent.Type.PAUSED,function(){d.i=!0});this.l.D(this.h,google.ima.AdEvent.Type.RESUMED,function(){d.i=!1})}p=or.prototype;p.needsSkipUI=function(){return!1};p.isClientRendering=function(){return!0};p.hasCustomClick=function(){return!0};p.isUsingAnotherMediaElement=function(){return!0};p.getDuration=function(){return this.g.getDuration()};
|
|
p.getMinSuggestedDuration=function(){return this.g.getMinSuggestedDuration()};p.getRemainingTime=function(){return this.h.getRemainingTime()};p.isPaused=function(){return this.i};p.isSkippable=function(){return 0<=this.g.getSkipTimeOffset()};p.getTimeUntilSkippable=function(){var a=this.g.getSkipTimeOffset();a=this.getRemainingTime()-a;return Math.max(a,0)};p.canSkipNow=function(){return this.h.getAdSkippableState()};p.skip=function(){return this.h.skip()};p.pause=function(){return this.h.pause()};
|
|
p.play=function(){return this.h.resume()};p.getVolume=function(){return this.h.getVolume()};p.setVolume=function(a){this.m.volume=a;return this.h.setVolume(a)};p.isMuted=function(){return 0==this.h.getVolume()};p.isLinear=function(){return this.g.isLinear()};p.resize=function(a,b){this.h.resize(a,b)};p.setMuted=function(a){(this.m.muted=a)?(this.j=this.getVolume(),this.h.setVolume(0)):this.h.setVolume(this.j)};p.getSequenceLength=function(){var a=this.g.getAdPodInfo();return null==a?1:a.getTotalAds()};
|
|
p.getPositionInSequence=function(){var a=this.g.getAdPodInfo();return null==a?1:a.getAdPosition()};p.getTitle=function(){return this.g.getTitle()};p.getDescription=function(){return this.g.getDescription()};p.getVastMediaBitrate=function(){return this.g.getVastMediaBitrate()};p.getVastMediaHeight=function(){return this.g.getVastMediaHeight()};p.getVastMediaWidth=function(){return this.g.getVastMediaWidth()};p.getVastAdId=function(){return""};p.getAdId=function(){return this.g.getAdId()};
|
|
p.getCreativeAdId=function(){return this.g.getCreativeAdId()};p.getAdvertiserName=function(){return this.g.getAdvertiserName()};p.getMediaUrl=function(){return this.g.getMediaUrl()};p.getTimeOffset=function(){var a=this.g.getAdPodInfo();return null==a?0:a.getTimeOffset()};p.getPodIndex=function(){var a=this.g.getAdPodInfo();return null==a?0:a.getPodIndex()};p.release=function(){this.h=this.g=null};T("shaka.ads.ClientSideAd",or);or.prototype.release=or.prototype.release;or.prototype.getPodIndex=or.prototype.getPodIndex;
|
|
or.prototype.getTimeOffset=or.prototype.getTimeOffset;or.prototype.getMediaUrl=or.prototype.getMediaUrl;or.prototype.getAdvertiserName=or.prototype.getAdvertiserName;or.prototype.getCreativeAdId=or.prototype.getCreativeAdId;or.prototype.getAdId=or.prototype.getAdId;or.prototype.getVastAdId=or.prototype.getVastAdId;or.prototype.getVastMediaWidth=or.prototype.getVastMediaWidth;or.prototype.getVastMediaHeight=or.prototype.getVastMediaHeight;or.prototype.getVastMediaBitrate=or.prototype.getVastMediaBitrate;
|
|
or.prototype.getDescription=or.prototype.getDescription;or.prototype.getTitle=or.prototype.getTitle;or.prototype.getPositionInSequence=or.prototype.getPositionInSequence;or.prototype.getSequenceLength=or.prototype.getSequenceLength;or.prototype.setMuted=or.prototype.setMuted;or.prototype.resize=or.prototype.resize;or.prototype.isLinear=or.prototype.isLinear;or.prototype.isMuted=or.prototype.isMuted;or.prototype.setVolume=or.prototype.setVolume;or.prototype.getVolume=or.prototype.getVolume;
|
|
or.prototype.play=or.prototype.play;or.prototype.pause=or.prototype.pause;or.prototype.skip=or.prototype.skip;or.prototype.canSkipNow=or.prototype.canSkipNow;or.prototype.getTimeUntilSkippable=or.prototype.getTimeUntilSkippable;or.prototype.isSkippable=or.prototype.isSkippable;or.prototype.isPaused=or.prototype.isPaused;or.prototype.getRemainingTime=or.prototype.getRemainingTime;or.prototype.getMinSuggestedDuration=or.prototype.getMinSuggestedDuration;or.prototype.getDuration=or.prototype.getDuration;
|
|
or.prototype.isUsingAnotherMediaElement=or.prototype.isUsingAnotherMediaElement;or.prototype.hasCustomClick=or.prototype.hasCustomClick;or.prototype.isClientRendering=or.prototype.isClientRendering;or.prototype.needsSkipUI=or.prototype.needsSkipUI;function pr(){}
|
|
function qr(a,b){var c=[];a=t(qd(a,"Ad"));for(var d=a.next();!d.done;d=a.next())if(d=ud(d.value,"InLine"))if(d=ud(d,"Creatives")){d=t(qd(d,"Creative"));for(var e=d.next();!e.done;e=d.next()){e=e.value;var f=ud(e,"Linear");f&&rr(c,b,f);if(e=ud(e,"NonLinearAds")){e=qd(e,"NonLinear");e=t(e);for(var g=e.next();!g.done;g=e.next())a:{f=c;var h=b,k=g.value,l=ud(k,"StaticResource");if(l)g=l.attributes.creativeType;else{l=ud(k,"HTMLResource");if(!l)break a;g="text/html"}if(l=sd(l)){"text/html"===g&&(l="data:text/html;charset=UTF-8,"+
|
|
encodeURIComponent(l));var m=xd(k,"width",Dd)||xd(k,"expandedWidth",Dd),n=xd(k,"height",Dd)||xd(k,"expandedHeight",Dd);if(m||n){var q=null;(k=k.attributes.minSuggestedDuration)&&(q=dd(k));k=0;null!=h&&(k=h);f.push({id:null,groupId:null,startTime:k,endTime:null,uri:l,mimeType:g,isSkippable:!1,skipOffset:null,skipFor:null,canJump:!1,resumeOffset:0,playoutLimit:q,once:!0,pre:null==h,post:Infinity==h,timelineRange:!1,loop:!1,overlay:{viewport:{x:0,y:0},topLeft:{x:0,y:0},size:{x:m||0,y:n||0}},displayOnBackground:!1,
|
|
currentVideo:null,background:null})}}}}}}return c}
|
|
function rr(a,b,c){var d=0;null!=b&&(d=b);var e=null;c.attributes.skipoffset&&(e=dd(c.attributes.skipoffset),isNaN(e)&&(e=null));if(c=ud(c,"MediaFiles")){var f=qd(c,"MediaFile");c=f;f=f.filter(function(h){return"streaming"==h.attributes.delivery});f.length&&(c=f);c=c.sort(function(h,k){return(parseInt(k.attributes.height,10)||0)-(parseInt(h.attributes.height,10)||0)});c=t(c);for(f=c.next();!f.done;f=c.next())if(f=f.value,!f.attributes.apiFramework){var g=sd(f);if(g){a.push({id:null,groupId:null,startTime:d,
|
|
endTime:null,uri:g,mimeType:f.attributes.type||null,isSkippable:null!=e,skipOffset:e,skipFor:null,canJump:!1,resumeOffset:0,playoutLimit:null,once:!0,pre:null==b,post:Infinity==b,timelineRange:!1,loop:!1,overlay:null,displayOnBackground:!1,currentVideo:null,background:null});break}}}}T("shaka.ads.Utils",pr);pr.ADS_LOADED="ads-loaded";pr.AD_STARTED="ad-started";pr.AD_FIRST_QUARTILE="ad-first-quartile";pr.AD_MIDPOINT="ad-midpoint";pr.AD_THIRD_QUARTILE="ad-third-quartile";pr.AD_COMPLETE="ad-complete";
|
|
pr.AD_STOPPED="ad-stopped";pr.AD_SKIPPED="ad-skipped";pr.AD_VOLUME_CHANGED="ad-volume-changed";pr.AD_MUTED="ad-muted";pr.AD_PAUSED="ad-paused";pr.AD_RESUMED="ad-resumed";pr.AD_SKIP_STATE_CHANGED="ad-skip-state-changed";pr.CUEPOINTS_CHANGED="ad-cue-points-changed";pr.IMA_AD_MANAGER_LOADED="ima-ad-manager-loaded";pr.IMA_STREAM_MANAGER_LOADED="ima-stream-manager-loaded";pr.AD_CLICKED="ad-clicked";pr.AD_PROGRESS="ad-progress";pr.AD_BUFFERING="ad-buffering";pr.AD_IMPRESSION="ad-impression";
|
|
pr.AD_DURATION_CHANGED="ad-duration-changed";pr.AD_CLOSED="ad-closed";pr.AD_LOADED="ad-loaded";pr.ALL_ADS_COMPLETED="all-ads-completed";pr.AD_LINEAR_CHANGED="ad-linear-changed";pr.AD_METADATA="ad-metadata";pr.AD_RECOVERABLE_ERROR="ad-recoverable-error";pr.AD_ERROR="ad-error";pr.AD_BREAK_READY="ad-break-ready";pr.AD_INTERACTION="ad-interaction";pr.AD_CONTENT_PAUSE_REQUESTED="ad-content-pause-requested";pr.AD_CONTENT_RESUME_REQUESTED="ad-content-resume-requested";pr.AD_CONTENT_ATTACH_REQUESTED="ad-content-attach-requested";function sr(a,b,c,d,e){var f=this;this.s=a;this.i=b;this.F=!1;this.A=this.o=null;this.G=NaN;this.l=e;this.j=null;this.h=new jb;google.ima.settings.setLocale(c);google.ima.settings.setDisableCustomPlaybackForIOS10Plus(!0);this.C=new google.ima.AdDisplayContainer(this.s,this.i);this.C.initialize();this.m=new google.ima.AdsLoader(this.C);this.m.getSettings().setPlayerType("shaka-player");this.m.getSettings().setPlayerVersion("v4.15.0");this.g=null;this.B=d||new google.ima.AdsRenderingSettings;this.h.D(this.m,
|
|
google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,function(g){tr(f,g)});this.h.D(this.m,google.ima.AdErrorEvent.Type.AD_ERROR,function(g){ur(f,g)});this.h.D(this.i,"ended",function(){f.m.contentComplete()});this.h.za(this.i,"play",function(){f.F=!0})}sr.prototype.configure=function(a){this.o=a};sr.prototype.stop=function(){this.g&&this.g.stop();this.s&&Dj(this.s)};
|
|
sr.prototype.release=function(){this.stop();this.A&&this.A.disconnect();this.h&&this.h.release();this.g&&this.g.destroy();this.m.destroy();this.C.destroy()};function ur(a,b){b.getError();b=(new Map).set("originalEvent",b);a.l(new V("ad-error",b));vr(a,null);a.l(new V("ad-cue-points-changed",(new Map).set("cuepoints",[])))}
|
|
function tr(a,b){a.l(new V("ads-loaded",(new Map).set("loadTime",Date.now()/1E3-a.G)));if(a.o.customPlayheadTracker){var c={currentTime:a.i.currentTime};a.g=b.getAdsManager(c,a.B);a.i.muted?a.g.setVolume(0):a.g.setVolume(a.i.volume);a.h.D(a.i,"timeupdate",function(){a.i.duration&&(c.currentTime=a.i.currentTime)});a.h.D(a.i,"volumechange",function(){a.j&&(a.j.setVolume(a.i.volume),a.i.muted&&a.j.setMuted(!0))})}else a.g=b.getAdsManager(a.i,a.B);a.l(new V("ima-ad-manager-loaded",(new Map).set("imaAdManager",
|
|
a.g)));var d=a.g.getCuePoints();if(d.length){b=[];d=t(d);for(var e=d.next();!e.done;e=d.next())b.push({start:e.value,end:null});a.l(new V("ad-cue-points-changed",(new Map).set("cuepoints",b)))}wr(a);try{a.g.init(a.i.offsetWidth,a.i.offsetHeight),a.h.D(a.i,"loadeddata",function(){a.g.resize(a.i.offsetWidth,a.i.offsetHeight)}),"ResizeObserver"in window?(a.A=new ResizeObserver(function(){a.g.resize(a.i.offsetWidth,a.i.offsetHeight)}),a.A.observe(a.i)):a.h.D(document,"fullscreenchange",function(){a.g.resize(a.i.offsetWidth,
|
|
a.i.offsetHeight)}),a.F||a.o.skipPlayDetection?a.g.start():a.h.za(a.i,"play",function(){a.F=!0;a.g.start()})}catch(f){vr(a,null)}}
|
|
function wr(a){function b(c,d){c=(new Map).set("originalEvent",c);a.l(new V(d,c))}a.h.D(a.g,google.ima.AdErrorEvent.Type.AD_ERROR,function(c){ur(a,c)});a.h.D(a.g,google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,function(c){xr(a,c)});a.h.D(a.g,google.ima.AdEvent.Type.STARTED,function(c){xr(a,c)});a.h.D(a.g,google.ima.AdEvent.Type.FIRST_QUARTILE,function(c){b(c,"ad-first-quartile")});a.h.D(a.g,google.ima.AdEvent.Type.MIDPOINT,function(c){b(c,"ad-midpoint")});a.h.D(a.g,google.ima.AdEvent.Type.THIRD_QUARTILE,
|
|
function(c){b(c,"ad-third-quartile")});a.h.D(a.g,google.ima.AdEvent.Type.COMPLETE,function(c){b(c,"ad-complete")});a.h.D(a.g,google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,function(c){vr(a,c)});a.h.D(a.g,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,function(c){vr(a,c)});a.h.D(a.g,google.ima.AdEvent.Type.SKIPPED,function(c){b(c,"ad-skipped")});a.h.D(a.g,google.ima.AdEvent.Type.VOLUME_CHANGED,function(c){b(c,"ad-volume-changed")});a.h.D(a.g,google.ima.AdEvent.Type.VOLUME_MUTED,function(c){b(c,"ad-muted")});
|
|
a.h.D(a.g,google.ima.AdEvent.Type.PAUSED,function(c){a.j&&(a.j.i=!0,b(c,"ad-paused"))});a.h.D(a.g,google.ima.AdEvent.Type.RESUMED,function(c){a.j&&(a.j.i=!1,b(c,"ad-resumed"))});a.h.D(a.g,google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED,function(c){a.j&&b(c,"ad-skip-state-changed")});a.h.D(a.g,google.ima.AdEvent.Type.CLICK,function(c){b(c,"ad-clicked")});a.h.D(a.g,google.ima.AdEvent.Type.AD_PROGRESS,function(c){b(c,"ad-progress")});a.h.D(a.g,google.ima.AdEvent.Type.AD_BUFFERING,function(c){b(c,"ad-buffering")});
|
|
a.h.D(a.g,google.ima.AdEvent.Type.IMPRESSION,function(c){b(c,"ad-impression")});a.h.D(a.g,google.ima.AdEvent.Type.DURATION_CHANGE,function(c){b(c,"ad-duration-changed")});a.h.D(a.g,google.ima.AdEvent.Type.USER_CLOSE,function(c){b(c,"ad-closed")});a.h.D(a.g,google.ima.AdEvent.Type.LOADED,function(c){b(c,"ad-loaded")});a.h.D(a.g,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,function(c){b(c,"all-ads-completed")});a.h.D(a.g,google.ima.AdEvent.Type.LINEAR_CHANGED,function(c){b(c,"ad-linear-changed")});a.h.D(a.g,
|
|
google.ima.AdEvent.Type.AD_METADATA,function(c){b(c,"ad-metadata")});a.h.D(a.g,google.ima.AdEvent.Type.LOG,function(c){b(c,"ad-recoverable-error")});a.h.D(a.g,google.ima.AdEvent.Type.AD_BREAK_READY,function(c){b(c,"ad-break-ready")});a.h.D(a.g,google.ima.AdEvent.Type.INTERACTION,function(c){b(c,"ad-interaction")})}
|
|
function xr(a,b){var c=b.getAd();c?(a.j=new or(c,a.g,a.i),b.type!=google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED||a.o.supportsMultipleMediaElements||a.l(new V("ad-content-pause-requested")),b=(new Map).set("ad",a.j).set("sdkAdObject",c).set("originalEvent",b),a.l(new V("ad-started",b)),a.j.isLinear()&&(a.s.setAttribute("ad-active","true"),a.o.customPlayheadTracker||a.i.pause(),a.i.muted?(b=a.j,b.j=a.i.volume,b.h.setVolume(0)):a.j.setVolume(a.i.volume))):bb("The IMA SDK fired a "+b.type+" event with no associated ad. Unable to play ad!")}
|
|
function vr(a,b){b&&b.type==google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED&&!a.o.supportsMultipleMediaElements&&a.l(new V("ad-content-resume-requested"));a.l(new V("ad-stopped",(new Map).set("originalEvent",b)));a.j&&a.j.isLinear()&&(a.s.removeAttribute("ad-active"),a.o.customPlayheadTracker||a.i.ended||a.i.play())};function yr(a,b,c,d,e,f){this.g=a;this.i=b;this.j=(this.h=b.isSkippable)?b.skipOffset||0:b.skipOffset;this.l=b.skipFor;this.A=c;this.o=d;this.m=e;this.s=f;this.B=b.overlay}p=yr.prototype;p.needsSkipUI=function(){return!0};p.isClientRendering=function(){return!0};p.hasCustomClick=function(){return!1};p.isUsingAnotherMediaElement=function(){return this.s};p.getDuration=function(){var a=this.g.duration;return isNaN(a)?-1:a};p.getMinSuggestedDuration=function(){return this.getDuration()};
|
|
p.getRemainingTime=function(){var a=this.g.duration;return isNaN(a)?-1:a-this.g.currentTime};p.isPaused=function(){return this.g.paused};p.isSkippable=function(){return this.h&&null!=this.l?this.getDuration()-this.getRemainingTime()<this.j+this.l:this.h};p.getTimeUntilSkippable=function(){if(this.isSkippable()){var a=this.getRemainingTime()+this.j-this.getDuration();return Math.max(a,0)}return Math.max(this.getRemainingTime(),0)};p.canSkipNow=function(){return this.h&&0==this.getTimeUntilSkippable()};
|
|
p.skip=function(){this.canSkipNow()&&this.A()};p.pause=function(){return this.g.pause()};p.play=function(){return this.g.play()};p.getVolume=function(){return this.g.volume};p.setVolume=function(a){this.g.volume=a};p.isMuted=function(){return this.g.muted};p.isLinear=function(){return null==this.B};p.resize=function(){};p.setMuted=function(a){this.g.muted=a};p.getSequenceLength=function(){return this.o};p.getPositionInSequence=function(){return this.m};p.getTitle=function(){return""};
|
|
p.getDescription=function(){return""};p.getVastMediaBitrate=function(){return 0};p.getVastMediaHeight=function(){return 0};p.getVastMediaWidth=function(){return 0};p.getVastAdId=function(){return""};p.getAdId=function(){return this.i.id||""};p.getCreativeAdId=function(){return""};p.getAdvertiserName=function(){return""};p.getMediaUrl=function(){return this.i.uri};p.getTimeOffset=function(){return 0};p.getPodIndex=function(){return 0};p.release=function(){this.g=null};
|
|
T("shaka.ads.InterstitialAd",yr);yr.prototype.release=yr.prototype.release;yr.prototype.getPodIndex=yr.prototype.getPodIndex;yr.prototype.getTimeOffset=yr.prototype.getTimeOffset;yr.prototype.getMediaUrl=yr.prototype.getMediaUrl;yr.prototype.getAdvertiserName=yr.prototype.getAdvertiserName;yr.prototype.getCreativeAdId=yr.prototype.getCreativeAdId;yr.prototype.getAdId=yr.prototype.getAdId;yr.prototype.getVastAdId=yr.prototype.getVastAdId;yr.prototype.getVastMediaWidth=yr.prototype.getVastMediaWidth;
|
|
yr.prototype.getVastMediaHeight=yr.prototype.getVastMediaHeight;yr.prototype.getVastMediaBitrate=yr.prototype.getVastMediaBitrate;yr.prototype.getDescription=yr.prototype.getDescription;yr.prototype.getTitle=yr.prototype.getTitle;yr.prototype.getPositionInSequence=yr.prototype.getPositionInSequence;yr.prototype.getSequenceLength=yr.prototype.getSequenceLength;yr.prototype.setMuted=yr.prototype.setMuted;yr.prototype.resize=yr.prototype.resize;yr.prototype.isLinear=yr.prototype.isLinear;
|
|
yr.prototype.isMuted=yr.prototype.isMuted;yr.prototype.setVolume=yr.prototype.setVolume;yr.prototype.getVolume=yr.prototype.getVolume;yr.prototype.play=yr.prototype.play;yr.prototype.pause=yr.prototype.pause;yr.prototype.skip=yr.prototype.skip;yr.prototype.canSkipNow=yr.prototype.canSkipNow;yr.prototype.getTimeUntilSkippable=yr.prototype.getTimeUntilSkippable;yr.prototype.isSkippable=yr.prototype.isSkippable;yr.prototype.isPaused=yr.prototype.isPaused;yr.prototype.getRemainingTime=yr.prototype.getRemainingTime;
|
|
yr.prototype.getMinSuggestedDuration=yr.prototype.getMinSuggestedDuration;yr.prototype.getDuration=yr.prototype.getDuration;yr.prototype.isUsingAnotherMediaElement=yr.prototype.isUsingAnotherMediaElement;yr.prototype.hasCustomClick=yr.prototype.hasCustomClick;yr.prototype.isClientRendering=yr.prototype.isClientRendering;yr.prototype.needsSkipUI=yr.prototype.needsSkipUI;function zr(a,b,c){this.g=a;this.j=b;this.h=c;this.i=null==a.overlay}p=zr.prototype;p.needsSkipUI=function(){return!0};p.isClientRendering=function(){return!0};p.hasCustomClick=function(){return!1};p.isUsingAnotherMediaElement=function(){return!1};p.getDuration=function(){return-1};p.getMinSuggestedDuration=function(){return this.getDuration()};p.getRemainingTime=function(){return-1};p.isPaused=function(){return!1};p.isSkippable=function(){return!1};p.getTimeUntilSkippable=function(){return 0};
|
|
p.canSkipNow=function(){return!1};p.skip=function(){};p.pause=function(){};p.play=function(){};p.getVolume=function(){return 1};p.setVolume=function(){};p.isMuted=function(){return!1};p.isLinear=function(){return this.i};p.resize=function(){};p.setMuted=function(){};p.getSequenceLength=function(){return this.j};p.getPositionInSequence=function(){return this.h};p.getTitle=function(){return""};p.getDescription=function(){return""};p.getVastMediaBitrate=function(){return 0};p.getVastMediaHeight=function(){return 0};
|
|
p.getVastMediaWidth=function(){return 0};p.getVastAdId=function(){return""};p.getAdId=function(){return this.g.id||""};p.getCreativeAdId=function(){return""};p.getAdvertiserName=function(){return""};p.getMediaUrl=function(){return this.g.uri};p.getTimeOffset=function(){return 0};p.getPodIndex=function(){return 0};p.release=function(){};T("shaka.ads.InterstitialStaticAd",zr);zr.prototype.release=zr.prototype.release;zr.prototype.getPodIndex=zr.prototype.getPodIndex;zr.prototype.getTimeOffset=zr.prototype.getTimeOffset;
|
|
zr.prototype.getMediaUrl=zr.prototype.getMediaUrl;zr.prototype.getAdvertiserName=zr.prototype.getAdvertiserName;zr.prototype.getCreativeAdId=zr.prototype.getCreativeAdId;zr.prototype.getAdId=zr.prototype.getAdId;zr.prototype.getVastAdId=zr.prototype.getVastAdId;zr.prototype.getVastMediaWidth=zr.prototype.getVastMediaWidth;zr.prototype.getVastMediaHeight=zr.prototype.getVastMediaHeight;zr.prototype.getVastMediaBitrate=zr.prototype.getVastMediaBitrate;zr.prototype.getDescription=zr.prototype.getDescription;
|
|
zr.prototype.getTitle=zr.prototype.getTitle;zr.prototype.getPositionInSequence=zr.prototype.getPositionInSequence;zr.prototype.getSequenceLength=zr.prototype.getSequenceLength;zr.prototype.setMuted=zr.prototype.setMuted;zr.prototype.resize=zr.prototype.resize;zr.prototype.isLinear=zr.prototype.isLinear;zr.prototype.isMuted=zr.prototype.isMuted;zr.prototype.setVolume=zr.prototype.setVolume;zr.prototype.getVolume=zr.prototype.getVolume;zr.prototype.play=zr.prototype.play;zr.prototype.pause=zr.prototype.pause;
|
|
zr.prototype.skip=zr.prototype.skip;zr.prototype.canSkipNow=zr.prototype.canSkipNow;zr.prototype.getTimeUntilSkippable=zr.prototype.getTimeUntilSkippable;zr.prototype.isSkippable=zr.prototype.isSkippable;zr.prototype.isPaused=zr.prototype.isPaused;zr.prototype.getRemainingTime=zr.prototype.getRemainingTime;zr.prototype.getMinSuggestedDuration=zr.prototype.getMinSuggestedDuration;zr.prototype.getDuration=zr.prototype.getDuration;zr.prototype.isUsingAnotherMediaElement=zr.prototype.isUsingAnotherMediaElement;
|
|
zr.prototype.hasCustomClick=zr.prototype.hasCustomClick;zr.prototype.isClientRendering=zr.prototype.isClientRendering;zr.prototype.needsSkipUI=zr.prototype.needsSkipUI;function Ar(a,b,c,d){var e=this;this.M=null;this.A=a;this.G=b;this.g=c;this.F=null;this.B=!0;this.h=this.g;this.i=d;this.U=new Set;this.H=new Set;this.C=new Map;this.L=new Map;this.j=new Y;Br(this);this.I=new jb;this.l=new jb;this.K=!1;this.ia=this.o=this.s=this.m=null;this.ka=!1;this.P=-1;this.$=function(){if(!e.K&&e.m&&!e.G.ya()){e.m=e.g.currentTime;var f=Cr(e);f&&Dr(e,f,1,1,Date.now())}};this.W=function(){if(!(e.K||e.m||e.G.ya())){e.m=e.g.currentTime;var f=Cr(e,!0);f&&Dr(e,f,1,1,Date.now())}};
|
|
this.oa=function(){if(!e.K&&e.m&&!e.G.ya()){var f=e.g.currentTime;e.s&&!e.s.pre&&!e.s.post&&f<(e.s.endTime||e.s.startTime)&&(e.s=null)}};this.S=new $e(this.$);this.N=new $e(function(){var f,g,h,k,l,m,n,q,r,u,w;return Q(function(v){switch(v.g){case 1:if(!e.H.size||null==e.m){v.u(0);break}f=e.G.m;if(f==Tp||f==Ip)return v.return();g=!1;h=Array.from(e.H);k=e.G.Sa();l=t(h);m=l.next();case 3:if(m.done){v.u(5);break}n=m.value;if(n==e.s){v.u(4);break}q=n.endTime||n.startTime;if(!(1<=k.start-q)){r=n.startTime-
|
|
e.m;0<r&&10>=r&&(!e.C.has(n)&&Er(n)&&e.C.set(n,e.j.preload(n.uri,null,n.mimeType||void 0)),Fr(e,n));v.u(4);break}if(!e.C.has(n)){v.u(7);break}return F(v,e.C.get(n),8);case 8:(u=v.h)&&u.destroy(),e.C.delete(n);case 7:Gr(e,n),w=JSON.stringify(n),e.U.has(w)&&e.U.delete(w),e.H.delete(n),Hr(e),n.overlay||(g=!0);case 4:m=l.next();v.u(3);break;case 5:g&&Ir(e),G(v)}})})}p=Ar.prototype;p.configure=function(a){this.M=a;Jr(this)};
|
|
function Kr(a){if(!a.ka&&a.H.size){a.I.D(a.g,"playing",a.W);a.I.D(a.g,"timeupdate",a.W);a.I.D(a.g,"seeked",a.oa);a.I.D(a.g,"ended",a.$);if("requestVideoFrameCallback"in a.g&&!Lr()){var b=a.g,c=function(){-1!=a.P&&(a.$(),-1!=a.P&&(a.P=b.requestVideoFrameCallback(c)))};a.P=b.requestVideoFrameCallback(c)}else a.S.Ga(.025);a.N&&a.N.Ga(1);a.ka=!0}}
|
|
function Hr(a){a.ka&&!a.H.size&&(a.I.Ja(a.g,"playing",a.W),a.I.Ja(a.g,"timeupdate",a.W),a.I.Ja(a.g,"seeked",a.oa),a.I.Ja(a.g,"ended",a.$),-1!=a.P&&(a.g.cancelVideoFrameCallback(a.P),a.P=-1),a.S&&a.S.stop(),a.N&&a.N.stop(),a.ka=!1)}
|
|
function Jr(a){if(a.A&&a.M&&!a.K){var b=a.M.supportsMultipleMediaElements,c=a.g;c.webkitSupportsFullscreen&&c.webkitDisplayingFullscreen&&(b=!1);a.B==b&&(a.B=!b,a.B?(a.h=a.g,a.F&&(a.F.parentElement&&a.A.removeChild(a.F),a.F=null)):(a.F||(b=document.createElement(a.g.tagName),b.autoplay=!0,b.style.position="absolute",b.style.top="0",b.style.left="0",b.style.width="100%",b.style.height="100%",b.style.display="none",b.setAttribute("playsinline",""),a.F=b),a.h=a.F))}}
|
|
p.stop=function(){this.l&&this.l.Ra();this.U.clear();this.H.clear();this.j.hg();if(this.C.size){var a=Array.from(this.C.values());a=t(a);for(var b=a.next();!b.done;b=a.next())(b=b.value)&&b.then(function(c){c&&c.destroy()})}this.C.clear();if(this.L.size)for(a=Array.from(this.L.keys()),a=t(a),b=a.next();!b.done;b=a.next())Gr(this,b.value);this.L.clear();this.j.detach();this.K=!1;this.s=this.m=null;this.B=!0;this.h=this.g;this.F=null;Mr(this);Hr(this);this.A&&Dj(this.A);this.o&&(this.o.stop(),this.o=
|
|
null)};p.release=function(){this.stop();this.I&&this.I.release();this.l&&this.l.release();this.S&&(this.S.stop(),this.S=null);this.N&&(this.N.stop(),this.N=null);this.j.destroy()};p.kd=function(){return this.j};function Nr(a,b){var c;Q(function(d){if(1==d.g)return Br(a),F(d,Or(a,b),2);c=d.h;c.length?Pr(a,c):bb("Unsupported HLS interstitial",b);G(d)})}
|
|
function Qr(a,b){var c=ud(b.eventNode,"OverlayEvent"),d=c.attributes.uri,e=c.attributes.mimeType,f="true"==c.attributes.loop,g=xd(c,"z",Dd);if(d&&0!=g){var h=null,k=ud(c,"Background");if(k){var l=k.attributes.uri;l?h="center / contain no-repeat url('"+l+"')":h=sd(k)}k=1920;l=1080;var m=ud(c,"Viewport");if(m){k=xd(m,"x",Dd);if(null==k)return;l=xd(m,"y",Dd);if(null==l)return}var n={viewport:{x:k,y:l},topLeft:{x:0,y:0},size:{x:k,y:l}},q=ud(c,"Overlay");if(m&&q){var r=ud(q,"TopLeft"),u=ud(q,"Size");if(r&&
|
|
u){q=xd(r,"x",Dd);if(null==q)return;r=xd(r,"y",Dd);if(null==r)return;var w=xd(u,"x",Dd);if(null==w)return;u=xd(u,"y",Dd);if(null==u)return;n.topLeft.x=q;n.topLeft.y=r;n.size.x=w;n.size.y=u}}q=null;c=ud(c,"Squeeze");if(m&&c&&(u=ud(c,"TopLeft"),c=ud(c,"Size"),u&&c)){m=xd(u,"x",Dd);if(null==m)return;q=xd(u,"y",Dd);if(null==q)return;u=xd(c,"x",Dd);if(null==u)return;c=xd(c,"y",Dd);if(null==c)return;q={viewport:{x:k,y:l},topLeft:{x:m,y:q},size:{x:u,y:c}}}Pr(a,[{id:b.id,groupId:null,startTime:b.startTime,
|
|
endTime:b.endTime,uri:d,mimeType:e,isSkippable:!1,skipOffset:null,skipFor:null,canJump:!0,resumeOffset:null,playoutLimit:null,once:!1,pre:!1,post:!1,timelineRange:!0,loop:f,overlay:n,displayOnBackground:-1==g,currentVideo:q,background:h}])}}
|
|
p.addAdUrlInterstitial=function(a){var b=this,c,d,e,f,g,h,k,l,m;return Q(function(n){switch(n.g){case 1:return c={type:12},F(n,Rr(b,a,c),2);case 2:d=n.h;e=hd(d,"VAST,vmap:VMAP");if(!e)throw new U(2,10,10007);f=[];if("VAST"==e.tagName){f=qr(e,b.m);n.u(3);break}if("vmap:VMAP"!=e.tagName){n.u(3);break}for(var q=[],r=t(qd(e,"vmap:AdBreak")),u=r.next();!u.done;u=r.next()){var w=u.value,v=w.attributes.timeOffset;v&&(u=null,"start"==v?u=0:"end"==v?u=Infinity:u=dd(v),(w=ud(w,"vmap:AdSource"))&&(w=ud(w,"vmap:AdTagURI"))&&
|
|
(w=rd(w))&&q.push({time:u,uri:w}))}g=t(q);h=g.next();case 5:if(h.done){n.u(3);break}k=h.value;return F(n,Rr(b,k.uri,c),8);case 8:l=n.h;m=hd(l,"VAST");if(!m)throw new U(2,10,10007);f.push.apply(f,x(qr(m,k.time)));h=g.next();n.u(5);break;case 3:Pr(b,f),G(n)}})};
|
|
function Pr(a,b){var c,d,e,f,g,h,k,l;Q(function(m){switch(m.g){case 1:c=!1,d=t(b),e=d.next();case 2:if(e.done){m.u(4);break}f=e.value;if(!f.uri){bb("Missing URL in interstitial",f);m.u(3);break}if(f.mimeType){m.u(5);break}wa(m,6);g=a.j.Nb();return F(m,vo(f.uri,g,a.G.getConfiguration().streaming.retryParameters),8);case 8:f.mimeType=m.h;za(m,5);break;case 6:Aa(m);case 5:h=f.id||JSON.stringify(f);if(a.U.has(h)){m.u(3);break}f.loop&&!f.overlay&&bb("Loop is only supported in overlay interstitials",f);
|
|
f.overlay||(c=!0);a.U.add(h);a.H.add(f);k=!1;f.pre&&null==a.m?k=!0:0!=f.startTime||f.canJump?null!=a.m&&(l=f.startTime-a.m,0<l&&10>=l&&(k=!0)):k=!0;k&&(!a.C.has(f)&&Er(f)&&a.C.set(f,a.j.preload(f.uri,null,f.mimeType||void 0)),Fr(a,f));case 3:e=d.next();m.u(2);break;case 4:c&&Ir(a),Kr(a),G(m)}})}
|
|
function Cr(a,b,c){b=void 0===b?!1:b;c=void 0===c?null:c;var d=0,e=null;if(a.H.size&&null!=a.m){var f=a.g.ended,g=Array.from(a.H).sort(function(n,q){return q.startTime-n.startTime}),h=g;h=b?g.filter(function(n){return n.pre}):f?g.filter(function(n){return n.post}):g.filter(function(n){return!n.pre&&!n.post});g=t(h);for(h=g.next();!h.done;h=g.next()){h=h.value;var k=!1;if(b)k=h.pre;else if(f)k=h.post;else if(!h.pre&&!h.post){var l=a.m-Math.round(1E3*h.startTime)/1E3,m=1;a.M.allowStartInMiddleOfInterstitial&&
|
|
h.endTime&&Infinity!=h.endTime&&(m=h.endTime-h.startTime);0<l&&(l<=m||!h.canJump)&&(k=null==c&&a.s&&!a.s.pre&&!a.s.post&&a.s.startTime>=h.startTime?!1:!0)}k&&(!a.s||h.startTime>=a.s.startTime)&&(d==(c||0)?e=h:e&&!h.canJump&&.001<Math.round(1E3*h.startTime)/1E3-Math.round(1E3*e.startTime)/1E3&&(e=h,d=0),d++)}}return e}
|
|
function Dr(a,b,c,d,e,f){f=void 0===f?0:f;a.s=b;Jr(a);!a.h.parentElement&&a.A&&a.A.appendChild(a.h);1==d&&1==c&&(c=Array.from(a.H).filter(function(g){return b.pre?g.pre==b.pre:b.post?g.post==b.post:.001>Math.abs(g.startTime-b.startTime)}).length);b.once&&(f++,a.H.delete(b),Hr(a),b.overlay||Ir(a));b.mimeType&&(b.mimeType.startsWith("image/")||"text/html"===b.mimeType)?b.overlay?Sr(a,b,c,d,f):bb("Unsupported interstitial",b):a.B&&b.overlay?bb("Unsupported interstitial",b):Tr(a,b,c,d,e,f)}
|
|
function Sr(a,b,c,d,e){function f(){a.o&&(a.o.stop(),a.o=null);a.A.removeChild(k);Mr(a,b);a.i(new V("ad-stopped"));a.l.Ra();var q=Cr(a,b.pre,d-e);q?Dr(a,q,c,++d,Date.now(),e):a.K=!1}a.K=!0;var g=b.overlay,h="text/html"==b.mimeType?"iframe":"img",k=document.createElement(h);k.style.objectFit="contain";k.style.position="absolute";k.style.border="none";Ur(a,b);a.i(new V("ad-started",(new Map).set("ad",new zr(b,c,d))));"iframe"==h?k.src=b.uri:(k.src=b.uri,k.onerror=function(q){a.i(new V("ad-error",(new Map).set("originalEvent",
|
|
q)));f()});var l=g.viewport,m=g.topLeft;g=g.size;0==l.x&&0==l.y?(k.width=b.overlay.size.x,k.height=b.overlay.size.y,k.style.bottom="10%",k.style.left="0",k.style.right="0",k.style.width="100%",b.overlay.size.y||"iframe"!=h||(k.style.height="auto")):(k.style.height=g.y/l.y*100+"%",k.style.left=m.x/l.x*100+"%",k.style.top=m.y/l.y*100+"%",k.style.width=g.x/l.x*100+"%");a.A.appendChild(k);var n=Date.now();a.o&&a.o.stop();a.o=new $e(function(){b.playoutLimit&&(Date.now()-n)/1E3>b.playoutLimit?(a.i(new V("ad-complete")),
|
|
f()):b.endTime&&a.g.currentTime>b.endTime?(a.i(new V("ad-complete")),f()):a.g.currentTime<b.startTime&&(a.i(new V("ad-skipped")),f())});b.playoutLimit&&!b.endTime?a.o.ha(b.playoutLimit):b.endTime&&a.o.Ga(.025);a.l.D(a.g,"seeked",function(){var q=a.g.currentTime;if(q<b.startTime||b.endTime&&q>b.endTime)a.o&&a.o.stop(),a.i(new V("ad-skipped")),f()})}
|
|
function Tr(a,b,c,d,e,f){var g,h,k,l,m,n,q,r,u,w,v,y,z,A,B,E,H,C,D,I;Q(function(L){switch(L.g){case 1:g=Date.now();a.K=!0;if(!a.B||1!=d){L.u(2);break}a.i(new V("ad-content-pause-requested",(new Map).set("saveLivePosition",!0)));h=new tg;k=function(K){return Q(function(J){if(1==J.g)return"detach"!=K.state?J.u(0):Lr()?F(J,new Promise(function(M){return(new $e(M)).ha(.1)}),3):J.u(3);h.resolve();a.l.Ja(a.G,"onstatechange",k);G(J)})};a.l.D(a.G,"onstatechange",k);return F(L,h,2);case 2:return Ur(a,b),a.B||
|
|
(a.h.style.display="",b.overlay?(a.h.loop=b.loop,l=b.overlay.viewport,m=b.overlay.topLeft,n=b.overlay.size,a.h.style.height=n.y/l.y*100+"%",a.h.style.left=m.x/l.x*100+"%",a.h.style.top=m.y/l.y*100+"%",a.h.style.width=n.x/l.x*100+"%"):(a.g.pause(),null!=b.resumeOffset&&0!=b.resumeOffset&&(a.g.currentTime+=b.resumeOffset),a.h.loop=!1,a.h.style.height="100%",a.h.style.left="0",a.h.style.top="0",a.h.style.width="100%")),q=!1,r=function(){if(!a.B&&!b.overlay&&null==b.resumeOffset)if(b.timelineRange&&b.endTime&&
|
|
Infinity!=b.endTime)a.g.currentTime!=b.endTime&&(a.g.currentTime=b.endTime);else{var K=Date.now();a.g.currentTime+=(K-e)/1E3;e=K}},u=function(K){var J,M;return Q(function(O){if(1==O.g){r();J=Cr(a,b.pre,d-f);if(K&&b.groupId)for(;J&&J.groupId==b.groupId;)d++,J=Cr(a,b.pre,d-f);a.o&&(!b.groupId||J&&J.groupId!=b.groupId)&&(a.o.stop(),a.o=null);Mr(a,b);if(J&&!J.overlay)return O.u(2);b.post&&(a.m=null,a.s=null);return a.B?F(O,a.j.detach(),4):F(O,a.j.rc(),4)}2!=O.g&&(a.B&&(M=b.resumeOffset,null==M&&(M=b.timelineRange&&
|
|
b.endTime&&Infinity!=b.endTime?b.endTime-(a.m||0):(Date.now()-e)/1E3),a.i(new V("ad-content-resume-requested",(new Map).set("offset",M)))),a.i(new V("ad-stopped")),a.l.Ra(),a.K=!1,a.B?Ir(a):(a.h.style.display="none",r(),a.g.ended||a.g.play()));Jr(a);J&&(a.i(new V("ad-stopped")),a.l.Ra(),Dr(a,J,c,++d,e,f));G(O)})},w=function(K){return Q(function(J){if(q)return J.return();q=!0;a.i(new V("ad-error",(new Map).set("originalEvent",K)));return F(J,u(!1),0)})},v=function(){return Q(function(K){if(1==K.g){if(q)return K.return();
|
|
q=!0;return F(K,u(!1),2)}a.i(new V("ad-complete"));G(K)})},a.ia=function(){return Q(function(K){if(q)return K.return();q=!0;a.i(new V("ad-skipped"));return F(K,u(!0),0)})},y=new yr(a.h,b,a.ia,c,d,!a.B),a.B||(y.setMuted(a.g.muted),y.setVolume(a.g.volume)),a.i(new V("ad-started",(new Map).set("ad",y))),(z=y.canSkipNow())&&a.i(new V("ad-skip-state-changed")),a.l.za(a.j,"error",w),a.l.D(a.h,"timeupdate",function(){if(a.h.duration){var K=y.canSkipNow();z!=K&&0<y.getRemainingTime()&&0<y.getDuration()&&
|
|
a.i(new V("ad-skip-state-changed"));z=K}}),a.l.za(a.j,"firstquartile",function(){r();a.i(new V("ad-first-quartile"))}),a.l.za(a.j,"midpoint",function(){r();a.i(new V("ad-midpoint"))}),a.l.za(a.j,"thirdquartile",function(){r();a.i(new V("ad-third-quartile"))}),a.l.za(a.j,"complete",v),a.l.D(a.h,"play",function(){a.i(new V("ad-resumed"))}),a.l.D(a.h,"pause",function(){var K=a.j.getConfiguration();a.h.currentTime>=K.playRangeEnd?v():a.i(new V("ad-paused"))}),a.l.D(a.h,"volumechange",function(){a.h.muted?
|
|
a.i(new V("ad-muted")):a.i(new V("ad-volume-changed"))}),wa(L,4),Br(a),b.startTime&&b.endTime&&Infinity!=b.endTime&&b.startTime!=b.endTime&&(A=b.endTime-b.startTime,0<A&&a.j.configure("playRangeEnd",A)),b.playoutLimit&&!a.o&&(a.o=(new $e(function(){a.ia()})).ha(b.playoutLimit),a.j.configure("playRangeEnd",b.playoutLimit)),F(L,a.j.cc(a.h),6);case 6:return B=null,a.M.allowStartInMiddleOfInterstitial&&null!=a.m&&(E=a.m-b.startTime,.25<Math.abs(E)&&(B=E)),a.C.has(b)?F(L,a.C.get(b),10):F(L,a.j.load(b.uri,
|
|
B,b.mimeType||void 0),8);case 10:return H=L.h,a.C.delete(b),H?F(L,a.j.load(H),8):F(L,a.j.load(b.uri,B,b.mimeType||void 0),8);case 8:a.h.play();C=(Date.now()-g)/1E3;a.i(new V("ads-loaded",(new Map).set("loadTime",C)));a.B&&a.g.play();b.overlay&&(D=function(){var K=a.g.currentTime-b.startTime;.1<Math.abs(K-a.h.currentTime)&&(a.h.currentTime=K)},a.l.za(a.h,"playing",D),a.l.D(a.g,"seeking",D),a.l.D(a.g,"seeked",function(){var K=a.g.currentTime;(K<b.startTime||b.endTime&&K>b.endTime)&&a.ia()}));za(L,0);
|
|
break;case 4:I=Aa(L);if(!a.K)return L.return();w(I);G(L)}})}
|
|
function Ur(a,b){b.displayOnBackground&&(a.g.style.zIndex="1");if(null!=b.currentVideo){var c=b.currentVideo;a.g.style.transformOrigin="top left";var d=!0,e=[],f=c.topLeft.x/c.viewport.x*100;0<f&&100>=f&&(e.push("translateX("+f+"%)"),d=!1);f=c.topLeft.y/c.viewport.y*100;0<f&&100>=f&&(e.push("translateY("+f+"%)"),d=!1);f=c.size.x/c.viewport.x;1>f&&e.push("scaleX("+f+")");c=c.size.y/c.viewport.y;1>f&&e.push("scaleY("+c+")");e.length&&(a.g.style.transform=e.join(" "));d&&(a.g.style.transition="transform 250ms")}a.A&&
|
|
(a.A.style.pointerEvents="none",b.background&&(a.A.style.background=b.background));a.F&&(a.F.style.background=b.overlay?"":"rgb(0, 0, 0)")}function Mr(a,b){if(!b||b.displayOnBackground)a.g.style.zIndex="";b&&null==b.currentVideo||(a.g.style.transformOrigin="",a.g.style.transition="",a.g.style.transform="");a.A&&(a.A.style.pointerEvents="",!b||b.background)&&(a.A.style.background="");a.F&&(a.F.style.background="")}
|
|
function Or(a,b){var c,d,e,f,g,h,k,l,m,n,q,r,u,w,v,y,z,A,B,E,H,C,D,I,L,K,J,M,O,N,P,R,S,aa,W,Fa,Ga,xa,qa,Da,Ja,ra;return Q(function(da){switch(da.g){case 1:c=[];if(!b)return da.return(c);d=b.values.find(function(sa){return"X-ASSET-URI"==sa.key});e=b.values.find(function(sa){return"X-ASSET-LIST"==sa.key});if(!d&&!e)return da.return(c);f=null;if(g=b.values.find(function(sa){return"ID"==sa.key}))f=g.data;h=null==f?Math.floor(10*b.startTime)/10:b.startTime;(k=b.endTime)&&Infinity!=b.endTime&&"number"==
|
|
typeof b.endTime&&(k=null==f?Math.floor(10*b.endTime)/10:b.endTime);l=b.values.find(function(sa){return"X-RESTRICT"==sa.key});n=m=!0;l&&l.data&&(q=l.data,m=!q.includes("SKIP"),n=!q.includes("JUMP"));r=m?0:null;if(u=b.values.find(function(sa){return"X-ENABLE-SKIP-AFTER"==sa.key}))w=u.data,r=parseFloat(w),isNaN(r)&&(r=m?0:null);v=null;if(y=b.values.find(function(sa){return"X-ENABLE-SKIP-FOR"==sa.key}))z=y.data,v=parseFloat(z),isNaN(r)&&(v=null);A=null;if(B=b.values.find(function(sa){return"X-RESUME-OFFSET"==
|
|
sa.key}))E=B.data,A=parseFloat(E),isNaN(A)&&(A=null);H=null;if(C=b.values.find(function(sa){return"X-PLAYOUT-LIMIT"==sa.key}))D=C.data,H=parseFloat(D),isNaN(H)&&(H=null);K=L=I=!1;if(J=b.values.find(function(sa){return"CUE"==sa.key}))M=J.data,I=M.includes("ONCE"),L=M.includes("PRE"),K=M.includes("POST");O=!1;(N=b.values.find(function(sa){return"X-TIMELINE-OCCUPIES"==sa.key}))?(P=N.data,O=P.includes("RANGE")):!B&&a.G.V()&&(O=!L&&!K);if(d){R=d.data;if(!R)return da.return(c);c.push({id:f,groupId:null,
|
|
startTime:h,endTime:k,uri:R,mimeType:null,isSkippable:m,skipOffset:r,skipFor:v,canJump:n,resumeOffset:A,playoutLimit:H,once:I,pre:L,post:K,timelineRange:O,loop:!1,overlay:null,displayOnBackground:!1,currentVideo:null,background:null});da.u(2);break}if(!e){da.u(2);break}S=e.data;if(!S)return da.return(c);wa(da,4);aa={type:11};return F(da,Rr(a,S,aa),6);case 6:W=da.h;Fa=ac(W);Ga=JSON.parse(Fa);if(xa=Ga["SKIP-CONTROL"])qa=xa["ENABLE-SKIP-AFTER"],"number"==typeof qa&&(r=parseFloat(qa),isNaN(qa)&&(r=m?
|
|
0:null)),Da=xa["ENABLE-SKIP-FOR"],"number"==typeof Da&&(v=parseFloat(Da),isNaN(Da)&&(v=null));for(Ja=0;Ja<Ga.ASSETS.length;Ja++)ra=Ga.ASSETS[Ja],ra.URI&&c.push({id:f+"_shaka_asset_"+Ja,groupId:f,startTime:h,endTime:k,uri:ra.URI,mimeType:null,isSkippable:m,skipOffset:r,skipFor:v,canJump:n,resumeOffset:A,playoutLimit:H,once:I,pre:L,post:K,timelineRange:O,loop:!1,overlay:null,displayOnBackground:!1,currentVideo:null,background:null});za(da,2);break;case 4:Aa(da);case 2:return da.return(c)}})}
|
|
function Ir(a){for(var b=[],c=t(a.H),d=c.next(),e={};!d.done;e={qc:void 0},d=c.next())d=d.value,d.overlay||(e.qc={start:d.startTime,end:null},d.pre?(e.qc.start=0,e.qc.end=null):d.post?(e.qc.start=-1,e.qc.end=null):d.timelineRange&&(e.qc.end=d.endTime),b.find(function(f){return function(g){return f.qc.start==g.start&&f.qc.end==g.end}}(e))||b.push(e.qc));a.i(new V("ad-cue-points-changed",(new Map).set("cuepoints",b)))}
|
|
function Br(a){a.j.configure(a.G.Vh());a.j.configure("ads.disableHLSInterstitial",!0);a.j.configure("ads.disableDASHInterstitial",!0);a.j.configure("playRangeEnd",Infinity);Kg(a.G.Nb(),a.j.Nb())}function Rr(a,b,c){var d,e,f;return Q(function(g){if(1==g.g)return d=Lg([b],rg()),e=a.G.Nb().request(7,d,c),F(g,e.promise,2);f=g.h;return g.return(f.data)})}function Er(a){return(a=a.mimeType)?!a.startsWith("image/")&&"text/html"!==a:!0}
|
|
function Lr(){var a=qb().La();return"TV"==a||"CONSOLE"==a||"CAST"==a?!0:!1}function Fr(a,b){if(!(a.L.has(b)||a.M&&!a.M.allowPreloadOnDomElements)){var c=function(f){var g=document.createElement("link");g.rel="preload";g.href=f;g.as="image";document.head.appendChild(g);return g},d=[];if(b.background){var e=b.background.match(/url\(('|")?([^'"()]+)('|")\)?/);e&&d.push(c(e[2]))}b.mimeType.startsWith("image/")&&d.push(c(b.uri));a.L.set(b,d)}}
|
|
function Gr(a,b){if(a.L.has(b)){var c=a.L.get(b);c=t(c);for(var d=c.next();!d.done;d=c.next())d=d.value,d.parentNode.removeChild(d);a.L.delete(b)}};function Vr(a,b,c,d,e){this.h=a;this.j=dd(this.h.skipOffset);this.g=e;this.i=b;this.l=c;this.o=d;this.m=!1}p=Vr.prototype;p.needsSkipUI=function(){return!0};p.isClientRendering=function(){return!1};p.hasCustomClick=function(){return!1};p.isUsingAnotherMediaElement=function(){return!1};p.getDuration=function(){return this.h.durationInSeconds};p.getMinSuggestedDuration=function(){return this.getDuration()};p.getRemainingTime=function(){return this.h.startTimeInSeconds+this.h.durationInSeconds-this.g.currentTime};
|
|
p.isPaused=function(){return this.g.paused};p.isSkippable=function(){return"number"==typeof this.j?!0:!1};p.getTimeUntilSkippable=function(){if("number"!=typeof this.j)return this.getRemainingTime();var a=this.getRemainingTime()+this.j-this.getDuration();return Math.max(a,0)};p.canSkipNow=function(){return 0==this.getTimeUntilSkippable()};p.skip=function(){this.m=!0;this.g.currentTime+=this.getRemainingTime()};p.pause=function(){return this.g.pause()};p.play=function(){return this.g.play()};
|
|
p.getVolume=function(){return this.g.volume};p.setVolume=function(a){this.g.volume=a};p.isMuted=function(){return this.g.muted};p.isLinear=function(){return this.o};p.resize=function(){};p.setMuted=function(a){this.g.muted=a};p.getSequenceLength=function(){return this.l?this.l:1};p.getPositionInSequence=function(){return this.i?this.i:1};p.getTitle=function(){return this.h.adTitle};p.getDescription=function(){return""};p.getVastMediaBitrate=function(){return 0};p.getVastMediaHeight=function(){return 0};
|
|
p.getVastMediaWidth=function(){return 0};p.getVastAdId=function(){return this.h.vastAdId||""};p.getAdId=function(){return this.h.adId};p.getCreativeAdId=function(){return this.h.creativeId};p.getAdvertiserName=function(){return""};p.getMediaUrl=function(){return null};p.getTimeOffset=function(){return 0};p.getPodIndex=function(){return 0};p.release=function(){this.l=this.i=this.g=this.h=null};T("shaka.ads.MediaTailorAd",Vr);Vr.prototype.release=Vr.prototype.release;Vr.prototype.getPodIndex=Vr.prototype.getPodIndex;
|
|
Vr.prototype.getTimeOffset=Vr.prototype.getTimeOffset;Vr.prototype.getMediaUrl=Vr.prototype.getMediaUrl;Vr.prototype.getAdvertiserName=Vr.prototype.getAdvertiserName;Vr.prototype.getCreativeAdId=Vr.prototype.getCreativeAdId;Vr.prototype.getAdId=Vr.prototype.getAdId;Vr.prototype.getVastAdId=Vr.prototype.getVastAdId;Vr.prototype.getVastMediaWidth=Vr.prototype.getVastMediaWidth;Vr.prototype.getVastMediaHeight=Vr.prototype.getVastMediaHeight;Vr.prototype.getVastMediaBitrate=Vr.prototype.getVastMediaBitrate;
|
|
Vr.prototype.getDescription=Vr.prototype.getDescription;Vr.prototype.getTitle=Vr.prototype.getTitle;Vr.prototype.getPositionInSequence=Vr.prototype.getPositionInSequence;Vr.prototype.getSequenceLength=Vr.prototype.getSequenceLength;Vr.prototype.setMuted=Vr.prototype.setMuted;Vr.prototype.resize=Vr.prototype.resize;Vr.prototype.isLinear=Vr.prototype.isLinear;Vr.prototype.isMuted=Vr.prototype.isMuted;Vr.prototype.setVolume=Vr.prototype.setVolume;Vr.prototype.getVolume=Vr.prototype.getVolume;
|
|
Vr.prototype.play=Vr.prototype.play;Vr.prototype.pause=Vr.prototype.pause;Vr.prototype.skip=Vr.prototype.skip;Vr.prototype.canSkipNow=Vr.prototype.canSkipNow;Vr.prototype.getTimeUntilSkippable=Vr.prototype.getTimeUntilSkippable;Vr.prototype.isSkippable=Vr.prototype.isSkippable;Vr.prototype.isPaused=Vr.prototype.isPaused;Vr.prototype.getRemainingTime=Vr.prototype.getRemainingTime;Vr.prototype.getMinSuggestedDuration=Vr.prototype.getMinSuggestedDuration;Vr.prototype.getDuration=Vr.prototype.getDuration;
|
|
Vr.prototype.isUsingAnotherMediaElement=Vr.prototype.isUsingAnotherMediaElement;Vr.prototype.hasCustomClick=Vr.prototype.hasCustomClick;Vr.prototype.isClientRendering=Vr.prototype.isClientRendering;Vr.prototype.needsSkipUI=Vr.prototype.needsSkipUI;function Wr(a,b,c,d){this.B=a;this.K=b;this.h=c;this.l=null;this.P=NaN;this.i=d;this.I=!1;this.A=null;this.j=[];this.M=[];this.L=this.C=this.g=null;this.F=new Map;this.m=[];this.s=[];this.G="";this.N=!0;this.H="";this.o=new jb}Wr.prototype.stop=function(){for(var a=t(this.m),b=a.next();!b.done;b=a.next())b=b.value,this.o.Ja(b.target,b.type,b.listener);Xr(this);this.m=[];this.s=[];this.G="";this.N=!0;this.H="";this.A=null;this.j=[];this.M=[];this.F.clear()};
|
|
Wr.prototype.release=function(){this.stop();this.o&&this.o.release()};Wr.prototype.onManifestUpdated=function(a){this.I=a;""!=this.G&&(Yr(this,this.G,this.N),this.N=!1)};Wr.prototype.getCuePoints=function(){for(var a=[],b=t(this.j),c=b.next();!c.done;c=b.next()){c=t(c.value.ads);for(var d=c.next();!d.done;d=c.next())d=d.value,a.push({start:d.startTimeInSeconds,end:d.startTimeInSeconds+d.durationInSeconds})}return a};
|
|
function Zr(a,b,c){var d,e,f,g,h,k,l,m,n,q,r,u;Q(function(w){if(1==w.g)return d={type:7},e=Lg([b],rg()),e.method="POST",c&&(f=JSON.stringify(c),e.body=ec(f)),g=a.K.request(7,e,d),wa(w,2),F(w,g.promise,4);if(2!=w.g){h=w.h;k=ac(h.data);l=JSON.parse(k);if(l.manifestUrl&&l.trackingUrl)m=new Bb(b),n=new Bb(l.trackingUrl),a.G=m.resolve(n).toString(),q=Date.now()/1E3,r=q-a.P,a.i(new V("ads-loaded",(new Map).set("loadTime",r))),u=new Bb(l.manifestUrl),a.l.resolve(m.resolve(u).toString()),a.l=null;else throw Error("Insufficient data from MediaTailor.");
|
|
return za(w,0)}Aa(w);if(!a.H.length)return a.l.reject("MediaTailor request returned an error and there was no backup asset uri provided."),a.l=null,w.return();a.l.resolve(a.H);a.l=null;G(w)})}
|
|
function Yr(a,b,c){var d,e,f,g,h,k,l,m,n,q,r,u,w,v,y,z;Q(function(A){if(1==A.g)return d={type:8},e=Lg([b],rg()),f=a.K.request(7,e,d),wa(A,2),F(A,f.promise,4);if(2!=A.g){g=A.h;h=[];k=ac(g.data);l=JSON.parse(k);if(0<l.avails.length){if(JSON.stringify(a.j)!=JSON.stringify(l.avails)){a.j=l.avails;m=t(a.j);for(n=m.next();!n.done;n=m.next())for(q=n.value,r=t(q.nonLinearAdsList),u=r.next();!u.done;u=r.next())for(w=u.value,v=t(w.nonLinearAdList),y=v.next();!y.done;y=v.next())z=y.value,$r(a,z);h=a.getCuePoints();
|
|
a.i(new V("ad-cue-points-changed",(new Map).set("cuepoints",h)))}}else a.j.length&&a.i(new V("ad-cue-points-changed",(new Map).set("cuepoints",h))),Xr(a),a.j=[];c&&(a.I||0<h.length)&&as(a);return za(A,0)}Aa(A);G(A)})}
|
|
function $r(a,b){var c,d,e,f,g,h,k,l,m;Q(function(n){if(1==n.g){if(!b.staticResource)return n.return();c=bs(b);if(d=a.F.get(c))return n.return();e={type:9};f=Lg([b.staticResource],rg());g=a.K.request(7,f,e);wa(n,2);a.F.set(c,[]);return F(n,g.promise,4)}if(2!=n.g)return h=n.h,k=ac(h.data),l=JSON.parse(k),m=l.apps,a.F.set(c,m),za(n,0);Aa(n);a.F.delete(c);G(n)})}
|
|
function bs(a){return[a.adId,a.adParameters,a.adSystem,a.adTitle,a.creativeAdId,a.creativeId,a.creativeSequence,a.height,a.width,a.staticResource].join("")}function as(a){cs(a);a.I||(ds(a),a.o.D(a.h,"seeked",function(){ds(a)}),a.o.D(a.h,"ended",function(){Xr(a)}));a.o.D(a.h,"timeupdate",function(){cs(a)})}
|
|
function ds(a){var b=a.h.currentTime;if(0!=b&&null==a.A){for(var c,d,e=t(a.j),f=e.next();!f.done;f=e.next()){f=f.value;for(var g=t(f.ads),h=g.next();!h.done;h=g.next())if(h=h.value,!d)h.startTimeInSeconds<b&&(d=h,c=f);else if(h.startTimeInSeconds<b&&h.startTimeInSeconds>d.startTimeInSeconds+d.durationInSeconds){d=h;c=f;break}}c&&d&&!a.M.includes(d.adId)&&(a.A=b,a.h.currentTime=c.startTimeInSeconds)}}
|
|
function cs(a){if(a.h.duration&&(a.g||a.j.length)){var b=a.h.currentTime,c=!1;if(a.g){c=!0;var d=a.C,e=d.startTimeInSeconds+.5*d.durationInSeconds,f=d.startTimeInSeconds+.75*d.durationInSeconds;b>=d.startTimeInSeconds+.25*d.durationInSeconds&&!a.s.includes("firstQuartile")?(a.s.push("firstQuartile"),es(a,"firstQuartile")):b>=e&&!a.s.includes("midpoint")?(a.s.push("midpoint"),es(a,"midpoint")):b>=f&&!a.s.includes("thirdQuartile")&&(a.s.push("thirdQuartile"),es(a,"thirdQuartile"));d=a.g.getRemainingTime();
|
|
e=a.g.getDuration();a.g.canSkipNow()&&0<d&&0<e&&es(a,"skipStateChanged");0<e&&(0>=d||d>e)&&Xr(a)}if(!a.g||!a.g.isLinear()){a:for(d=t(a.j),e=d.next();!e.done;e=d.next()){e=e.value;if(a.g&&a.g.isLinear())break;for(f=0;f<e.ads.length;f++){var g=e.ads[f],h=g.startTimeInSeconds+g.durationInSeconds;if(g.startTimeInSeconds<=b&&h>b){if(a.M.includes(g.adId)){if(a.h.ended)continue;a.h.currentTime=h;break a}Xr(a);a.L=e;a.g=new Vr(g,f+1,e.ads.length,!0,a.h);a.C=g;0===f&&es(a,"breakStart");fs(a);break}}}if(!a.g)for(d=
|
|
t(a.j),e=d.next();!e.done;e=d.next()){e=e.value;if(a.g)break;for(f=0;f<e.nonLinearAdsList.length;f++)if(g=e.nonLinearAdsList[f],g.nonLinearAdList.length){h=e.startTimeInSeconds;var k=a.F.get(bs(g.nonLinearAdList[0]));if(h<=b&&k&&k.length){Xr(a);h=a;k=t(k);for(var l=k.next();!l.done;l=k.next())if(l=l.value,l.data.source.length){var m=document.createElement("img");m.src=l.data.source[0].url;m.style.top=(l.placeholder.top||0)+"%";m.style.height=100-(l.placeholder.top||0)+"%";m.style.left=(l.placeholder.left||
|
|
0)+"%";m.style.maxWidth=100-(l.placeholder.left||0)+"%";m.style.objectFit="contain";m.style.position="absolute";h.B.appendChild(m)}a.L=e;a.g=new Vr(g,f+1,e.ads.length,!1,a.h);a.C=g;0===f&&es(a,"breakStart");fs(a);break}}}c&&!a.g&&(b=a.h.currentTime,a.A&&a.A>b&&(a.h.currentTime=a.A),a.A=null)}}}
|
|
function Xr(a){if(a.g){for(;a.B.lastChild;)a.B.removeChild(a.B.firstChild);a.I||a.M.push(a.C.adId);var b=a.g.m;(void 0===b?0:b)?es(a,"skip"):es(a,"complete");b=t(a.m);for(var c=b.next();!c.done;c=b.next())c=c.value,a.o.Ja(c.target,c.type,c.listener);a.m=[];a.s=[];b=a.g.getPositionInSequence();c=a.g.getSequenceLength();b===c&&es(a,"breakEnd");a.g=null;a.C=null;a.L=null}}
|
|
function fs(a){var b=!1;a.h.paused?b=!0:(es(a,"impression"),es(a,"start"));a.m.push({target:a.h,type:"volumechange",listener:function(){a.h.muted&&es(a,"mute")}});a.m.push({target:a.h,type:"volumechange",listener:function(){a.h.muted||es(a,"unmute")}});a.m.push({target:a.h,type:"play",listener:function(){b?(es(a,"impression"),es(a,"start"),b=!1):es(a,"resume")}});a.m.push({target:a.h,type:"pause",listener:function(){es(a,"pause")}});for(var c=t(a.m),d=c.next();!d.done;d=c.next())d=d.value,a.o.D(d.target,
|
|
d.type,d.listener)}
|
|
function es(a,b){var c=a.C.trackingEvents.find(function(f){return f.eventType==b});c||(c=a.L.adBreakTrackingEvents.find(function(f){return f.eventType==b}));if(c){var d={type:10};c=t(c.beaconUrls);for(var e=c.next();!e.done;e=c.next())(e=e.value)&&""!=e&&(e=Lg([e],rg()),e.method="POST",a.K.request(7,e,d))}switch(b){case "impression":a.i(new V("ad-impression"));break;case "start":a.i(new V("ad-started",(new Map).set("ad",a.g)));break;case "mute":a.i(new V("ad-muted"));break;case "unmute":a.i(new V("ad-volume-changed"));break;
|
|
case "resume":a.i(new V("ad-resumed"));break;case "pause":a.i(new V("ad-paused"));break;case "firstQuartile":a.i(new V("ad-first-quartile"));break;case "midpoint":a.i(new V("ad-midpoint"));break;case "thirdQuartile":a.i(new V("ad-third-quartile"));break;case "complete":a.i(new V("ad-complete"));a.i(new V("ad-stopped"));break;case "skip":a.i(new V("ad-skipped"));a.i(new V("ad-stopped"));break;case "breakStart":a.B.setAttribute("ad-active","true");break;case "breakEnd":a.B.removeAttribute("ad-active");
|
|
break;case "skipStateChanged":a.i(new V("ad-skip-state-changed"))}};function gs(a,b){this.g=a;this.i=null;this.h=b}p=gs.prototype;p.needsSkipUI=function(){return!0};p.isClientRendering=function(){return!1};p.hasCustomClick=function(){return!0};p.isUsingAnotherMediaElement=function(){return!1};p.getDuration=function(){return this.i?this.i.duration:-1};p.getMinSuggestedDuration=function(){return this.getDuration()};p.getRemainingTime=function(){return this.i?this.i.duration-this.i.currentTime:-1};p.isPaused=function(){return this.h.paused};p.isSkippable=function(){return this.g.isSkippable()};
|
|
p.getTimeUntilSkippable=function(){var a=this.g.getSkipTimeOffset();a=this.getRemainingTime()-a;return Math.max(a,0)};p.canSkipNow=function(){return 0==this.getTimeUntilSkippable()};p.skip=function(){this.h.currentTime+=this.getRemainingTime()};p.pause=function(){return this.h.pause()};p.play=function(){return this.h.play()};p.getVolume=function(){return this.h.volume};p.setVolume=function(a){this.h.volume=a};p.isMuted=function(){return this.h.muted};p.isLinear=function(){return!0};p.resize=function(){};
|
|
p.setMuted=function(a){this.h.muted=a};p.getSequenceLength=function(){var a=this.g.getAdPodInfo();return null==a?1:a.getTotalAds()};p.getPositionInSequence=function(){var a=this.g.getAdPodInfo();return null==a?1:a.getAdPosition()};p.getTitle=function(){return this.g.getTitle()};p.getDescription=function(){return this.g.getDescription()};p.getVastMediaBitrate=function(){return 0};p.getVastMediaHeight=function(){return this.g.getVastMediaHeight()};p.getVastMediaWidth=function(){return this.g.getVastMediaWidth()};
|
|
p.getVastAdId=function(){return""};p.getAdId=function(){return this.g.getAdId()};p.getCreativeAdId=function(){return this.g.getCreativeAdId()};p.getAdvertiserName=function(){return this.g.getAdvertiserName()};p.getMediaUrl=function(){return null};p.getTimeOffset=function(){var a=this.g.getAdPodInfo();return null==a?0:a.getTimeOffset()};p.getPodIndex=function(){var a=this.g.getAdPodInfo();return null==a?0:a.getPodIndex()};p.release=function(){this.h=this.i=this.g=null};T("shaka.ads.ServerSideAd",gs);
|
|
gs.prototype.release=gs.prototype.release;gs.prototype.getPodIndex=gs.prototype.getPodIndex;gs.prototype.getTimeOffset=gs.prototype.getTimeOffset;gs.prototype.getMediaUrl=gs.prototype.getMediaUrl;gs.prototype.getAdvertiserName=gs.prototype.getAdvertiserName;gs.prototype.getCreativeAdId=gs.prototype.getCreativeAdId;gs.prototype.getAdId=gs.prototype.getAdId;gs.prototype.getVastAdId=gs.prototype.getVastAdId;gs.prototype.getVastMediaWidth=gs.prototype.getVastMediaWidth;
|
|
gs.prototype.getVastMediaHeight=gs.prototype.getVastMediaHeight;gs.prototype.getVastMediaBitrate=gs.prototype.getVastMediaBitrate;gs.prototype.getDescription=gs.prototype.getDescription;gs.prototype.getTitle=gs.prototype.getTitle;gs.prototype.getPositionInSequence=gs.prototype.getPositionInSequence;gs.prototype.getSequenceLength=gs.prototype.getSequenceLength;gs.prototype.setMuted=gs.prototype.setMuted;gs.prototype.resize=gs.prototype.resize;gs.prototype.isLinear=gs.prototype.isLinear;
|
|
gs.prototype.isMuted=gs.prototype.isMuted;gs.prototype.setVolume=gs.prototype.setVolume;gs.prototype.getVolume=gs.prototype.getVolume;gs.prototype.play=gs.prototype.play;gs.prototype.pause=gs.prototype.pause;gs.prototype.skip=gs.prototype.skip;gs.prototype.canSkipNow=gs.prototype.canSkipNow;gs.prototype.getTimeUntilSkippable=gs.prototype.getTimeUntilSkippable;gs.prototype.isSkippable=gs.prototype.isSkippable;gs.prototype.isPaused=gs.prototype.isPaused;gs.prototype.getRemainingTime=gs.prototype.getRemainingTime;
|
|
gs.prototype.getMinSuggestedDuration=gs.prototype.getMinSuggestedDuration;gs.prototype.getDuration=gs.prototype.getDuration;gs.prototype.isUsingAnotherMediaElement=gs.prototype.isUsingAnotherMediaElement;gs.prototype.hasCustomClick=gs.prototype.hasCustomClick;gs.prototype.isClientRendering=gs.prototype.isClientRendering;gs.prototype.needsSkipUI=gs.prototype.needsSkipUI;function hs(a,b,c,d){var e=this;this.s=a;this.l=b;this.j=null;this.F=NaN;this.i=d;this.G=!1;this.A=this.m=this.o=null;this.B="";this.C=[];this.h=new jb;a=new google.ima.dai.api.UiSettings;a.setLocale(c);this.g=new google.ima.dai.api.StreamManager(this.l,this.s,a);this.i(new V("ima-stream-manager-loaded",(new Map).set("imaStreamManager",this.g)));this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.LOADED,function(f){is(e,f)});this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.ERROR,function(){e.B.length?
|
|
e.j.resolve(e.B):e.j.reject("IMA Stream request returned an error and there was no backup asset uri provided.");e.j=null});this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED,function(){});this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.STARTED,function(f){f=f.getAd();e.m=new gs(f,e.l);e.A&&(e.m.i=e.A);e.i(new V("ad-started",(new Map).set("ad",e.m)));e.s.setAttribute("ad-active","true")});this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED,function(){e.s.removeAttribute("ad-active");
|
|
var f=e.l.currentTime;e.o&&e.o>f&&(e.l.currentTime=e.o,e.o=null)});this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.AD_PROGRESS,function(f){e.A=f.getStreamData().adProgressData;e.m&&(e.m.i=e.A)});this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.FIRST_QUARTILE,function(){e.i(new V("ad-first-quartile"))});this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.MIDPOINT,function(){e.i(new V("ad-midpoint"))});this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.THIRD_QUARTILE,function(){e.i(new V("ad-third-quartile"))});
|
|
this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.COMPLETE,function(){e.i(new V("ad-complete"));e.i(new V("ad-stopped"));e.s.removeAttribute("ad-active");e.m=null});this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.SKIPPED,function(){e.i(new V("ad-skipped"));e.i(new V("ad-stopped"))});this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.CUEPOINTS_CHANGED,function(f){var g=f.getStreamData();f=[];g=t(g.cuepoints);for(var h=g.next();!h.done;h=g.next())h=h.value,f.push({start:h.start,end:h.end});e.C=
|
|
f;e.i(new V("ad-cue-points-changed",(new Map).set("cuepoints",f)))})}p=hs.prototype;p.configure=function(){};p.stop=function(){this.B="";this.o=null;this.C=[]};p.release=function(){this.stop();this.h&&this.h.release()};p.onCueMetadataChange=function(a){if(a.key&&a.data){var b={};b[a.key]=a.data;this.g.onTimedMetadata(b)}};p.getCuePoints=function(){return this.C};
|
|
function is(a,b){a.i(new V("ads-loaded",(new Map).set("loadTime",Date.now()/1E3-a.F)));b=b.getStreamData().url;a.j.resolve(b);a.j=null;a.G||a.h.D(a.l,"seeked",function(){var c=a.l.currentTime;if(0!=c){a.g.streamTimeForContentTime(c);var d=a.g.previousCuePointForStreamTime(c);d&&!d.played&&(a.o=c,a.l.currentTime=d.start)}})};function Z(){Dg.call(this);this.h=this.i=this.j=this.g=null;this.m=new mr;this.o=navigator.language;this.l=null}pa(Z,Dg);p=Z.prototype;p.setLocale=function(a){this.o=a};p.configure=function(a){this.l=a;this.g&&this.g.configure(this.l);this.j&&this.j.configure(this.l);this.h&&this.h.configure(this.l)};p.initInterstitial=function(a,b,c){var d=this;this.g&&this.g.release();this.g=new Ar(a,b,c,function(e){return js(d,e)});this.g.configure(this.l)};
|
|
p.initClientSide=function(a,b,c){var d=this;if(!window.google||!google.ima||!google.ima.AdsLoader)throw new U(2,10,1E4);this.j&&this.j.release();this.j=new sr(a,b,this.o,c,function(e){return js(d,e)});this.j.configure(this.l)};p.release=function(){this.g&&(this.g.release(),this.g=null);this.j&&(this.j.release(),this.j=null);this.i&&(this.i.release(),this.i=null);this.h&&(this.h.release(),this.h=null);Dg.prototype.release.call(this)};
|
|
p.onAssetUnload=function(){this.g&&this.g.stop();this.j&&this.j.stop();this.i&&this.i.stop();this.h&&this.h.stop();this.dispatchEvent(new V("ad-stopped"));this.dispatchEvent(new V("ad-content-attach-requested"));this.m=new mr};p.requestClientSideAds=function(a){if(!this.j)throw new U(1,10,10001);var b=this.j;b.g&&b.g.destroy();b.m&&b.m.contentComplete();b.G=Date.now()/1E3;b.m.requestAds(a)};
|
|
p.updateClientSideAdsRenderingSettings=function(a){if(!this.j)throw new U(1,10,10001);var b=this.j;b.B=a;b.g&&b.g.updateAdsRenderingSettings(b.B)};p.initMediaTailor=function(a,b,c){var d=this;this.i&&this.i.release();this.i=new Wr(a,b,c,function(e){return js(d,e)})};p.requestMediaTailorStream=function(a,b,c){if(!this.i)throw new U(1,10,10005);var d=this.i;c=void 0===c?"":c;d.l?a=Promise.reject(new U(1,10,10004)):(d.l=new tg,Zr(d,a,b),d.H=c||"",d.P=Date.now()/1E3,a=d.l);return a};
|
|
p.addMediaTailorTrackingUrl=function(a){if(!this.i)throw new U(1,10,10005);var b=this.i;b.G=a;b.i(new V("ads-loaded",(new Map).set("loadTime",0)))};p.initServerSide=function(a,b){var c=this;if(!window.google||!google.ima||!google.ima.dai)throw new U(2,10,10002);this.h&&this.h.release();this.h=new hs(a,b,this.o,function(d){return js(c,d)});this.h.configure(this.l)};
|
|
p.requestServerSideStream=function(a,b){b=void 0===b?"":b;if(!this.h)throw new U(1,10,10003);a.adTagParameters||(a.adTagParameters={});var c=a.adTagParameters;(c.mpt||c.mpv)&&bb('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overridden.');a.adTagParameters.mpt="shaka-player";a.adTagParameters.mpv="v4.15.0";c=this.h;c.j?a=Promise.reject(new U(1,10,10004)):(a instanceof google.ima.dai.api.LiveStreamRequest&&
|
|
(c.G=!0),c.j=new tg,c.g.requestStream(a),c.B=b||"",c.F=Date.now()/1E3,a=c.j);return a};p.replaceServerSideAdTagParameters=function(a){if(!this.h)throw new U(1,10,10003);(a.mpt||a.mpv)&&bb('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overridden.');a.mpt="Shaka Player";a.mpv="v4.15.0";this.h.g.replaceAdTagParameters(a)};
|
|
p.getServerSideCuePoints=function(){wb("AdManager.getServerSideCuePoints","Please use getCuePoints function.");return this.getCuePoints()};p.getCuePoints=function(){var a=[];this.h&&(a=a.concat(this.h.getCuePoints()));this.i&&(a=a.concat(this.i.getCuePoints()));return a};p.getStats=function(){var a=this.m;return{loadTimes:a.g,averageLoadTime:nr(a),started:a.h,overlayAds:a.j,playedCompletely:a.l,skipped:a.m,errors:a.i}};p.onManifestUpdated=function(a){if(this.i)this.i.onManifestUpdated(a)};
|
|
p.onDashTimedMetadata=function(a){this.h&&"urn:google:dai:2018"==a.schemeIdUri&&this.h.g.processMetadata(a.schemeIdUri,a.eventNode?a.eventNode.attributes.messageData:null,a.startTime)};p.onHlsTimedMetadata=function(a,b){this.h&&this.h.g.processMetadata("ID3",a.data,b)};p.onCueMetadataChange=function(a){if(this.h)this.h.onCueMetadataChange(a)};p.onHLSInterstitialMetadata=function(a,b,c){this.l&&this.l.disableHLSInterstitial||(this.g||this.initInterstitial(null,a,b),this.g&&Nr(this.g,c))};
|
|
p.onDASHInterstitialMetadata=function(a,b,c){if(!this.l||!this.l.disableDASHInterstitial){var d=c.schemeIdUri;if("urn:mpeg:dash:event:alternativeMPD:insert:2025"==d||"urn:mpeg:dash:event:alternativeMPD:replace:2025"==d){if(this.g||this.initInterstitial(null,a,b),this.g&&(a=this.g,b="urn:mpeg:dash:event:alternativeMPD:replace:2025"==c.schemeIdUri,d="urn:mpeg:dash:event:alternativeMPD:insert:2025"==c.schemeIdUri,b||d)){for(var e=c.startTime,f=c.endTime,g=null,h=0,k,l=t(c.eventNode.children),m=l.next();!m.done;m=
|
|
l.next())if(m=m.value,"AlternativeMPD"==m.tagName){if(m=m.attributes.uri){k=m;break}}else if("InsertPresentation"==m.tagName||"ReplacePresentation"==m.tagName){var n=m.attributes.url;if(n){k=n;(l=xd(m,"maxDuration",Dd))&&(g=l/c.timescale);(l=xd(m,"returnOffset",Dd))&&(h=l/c.timescale);b&&h&&(f=e+h);break}}k&&Pr(a,[{id:c.id,groupId:null,startTime:e,endTime:f,uri:k,mimeType:null,isSkippable:!1,skipOffset:null,skipFor:null,canJump:!0,resumeOffset:d?h:null,playoutLimit:g,once:!1,pre:!1,post:!1,timelineRange:b&&
|
|
!d,loop:!1,overlay:null,displayOnBackground:!1,currentVideo:null,background:null}])}}else("urn:mpeg:dash:event:2012"==d||"urn:scte:dash:scte214-events"==d)&&c.eventNode&&ud(c.eventNode,"OverlayEvent")&&(this.g||this.initInterstitial(null,a,b),this.g&&Qr(this.g,c))}};p.addCustomInterstitial=function(a){if(!this.g)throw new U(1,10,10006);Pr(this.g,[a])};p.addAdUrlInterstitial=function(a){if(!this.g)throw new U(1,10,10006);return this.g.addAdUrlInterstitial(a)};
|
|
p.getInterstitialPlayer=function(){if(!this.g)throw new U(1,10,10006);return this.g.kd()};function js(a,b){if(b&&b.type)switch(b.type){case "ads-loaded":a.m.g.push(b.loadTime);break;case "ad-started":a.m.h++;var c=b.ad;c&&!c.isLinear()&&a.m.j++;break;case "ad-complete":a.m.l++;break;case "ad-skipped":a.m.m++;break;case "ad-error":a.m.i++}a.dispatchEvent(b)}T("shaka.ads.AdManager",Z);Z.prototype.getInterstitialPlayer=Z.prototype.getInterstitialPlayer;Z.prototype.addAdUrlInterstitial=Z.prototype.addAdUrlInterstitial;
|
|
Z.prototype.addCustomInterstitial=Z.prototype.addCustomInterstitial;Z.prototype.onDASHInterstitialMetadata=Z.prototype.onDASHInterstitialMetadata;Z.prototype.onHLSInterstitialMetadata=Z.prototype.onHLSInterstitialMetadata;Z.prototype.onCueMetadataChange=Z.prototype.onCueMetadataChange;Z.prototype.onHlsTimedMetadata=Z.prototype.onHlsTimedMetadata;Z.prototype.onDashTimedMetadata=Z.prototype.onDashTimedMetadata;Z.prototype.onManifestUpdated=Z.prototype.onManifestUpdated;Z.prototype.getStats=Z.prototype.getStats;
|
|
Z.prototype.getCuePoints=Z.prototype.getCuePoints;Z.prototype.getServerSideCuePoints=Z.prototype.getServerSideCuePoints;Z.prototype.replaceServerSideAdTagParameters=Z.prototype.replaceServerSideAdTagParameters;Z.prototype.requestServerSideStream=Z.prototype.requestServerSideStream;Z.prototype.initServerSide=Z.prototype.initServerSide;Z.prototype.addMediaTailorTrackingUrl=Z.prototype.addMediaTailorTrackingUrl;Z.prototype.requestMediaTailorStream=Z.prototype.requestMediaTailorStream;
|
|
Z.prototype.initMediaTailor=Z.prototype.initMediaTailor;Z.prototype.updateClientSideAdsRenderingSettings=Z.prototype.updateClientSideAdsRenderingSettings;Z.prototype.requestClientSideAds=Z.prototype.requestClientSideAds;Z.prototype.onAssetUnload=Z.prototype.onAssetUnload;Z.prototype.release=Z.prototype.release;Z.prototype.initClientSide=Z.prototype.initClientSide;Z.prototype.initInterstitial=Z.prototype.initInterstitial;Z.prototype.configure=Z.prototype.configure;Z.prototype.setLocale=Z.prototype.setLocale;
|
|
Z.ADS_LOADED="ads-loaded";Z.AD_STARTED="ad-started";Z.AD_FIRST_QUARTILE="ad-first-quartile";Z.AD_MIDPOINT="ad-midpoint";Z.AD_THIRD_QUARTILE="ad-third-quartile";Z.AD_COMPLETE="ad-complete";Z.AD_STOPPED="ad-stopped";Z.AD_SKIPPED="ad-skipped";Z.AD_VOLUME_CHANGED="ad-volume-changed";Z.AD_MUTED="ad-muted";Z.AD_PAUSED="ad-paused";Z.AD_RESUMED="ad-resumed";Z.AD_SKIP_STATE_CHANGED="ad-skip-state-changed";Z.CUEPOINTS_CHANGED="ad-cue-points-changed";Z.IMA_AD_MANAGER_LOADED="ima-ad-manager-loaded";
|
|
Z.IMA_STREAM_MANAGER_LOADED="ima-stream-manager-loaded";Z.AD_CLICKED="ad-clicked";Z.AD_PROGRESS="ad-progress";Z.AD_BUFFERING="ad-buffering";Z.AD_IMPRESSION="ad-impression";Z.AD_DURATION_CHANGED="ad-duration-changed";Z.AD_CLOSED="ad-closed";Z.AD_LOADED="ad-loaded";Z.ALL_ADS_COMPLETED="all-ads-completed";Z.AD_LINEAR_CHANGED="ad-linear-changed";Z.AD_METADATA="ad-metadata";Z.AD_RECOVERABLE_ERROR="ad-recoverable-error";Z.AD_ERROR="ad-error";Z.AD_BREAK_READY="ad-break-ready";Z.AD_INTERACTION="ad-interaction";
|
|
Z.AD_CONTENT_PAUSE_REQUESTED="ad-content-pause-requested";Z.AD_CONTENT_RESUME_REQUESTED="ad-content-resume-requested";Z.AD_CONTENT_ATTACH_REQUESTED="ad-content-attach-requested";Mp=function(){return new Z};function ks(a){return JSON.stringify(a,function(b,c){if("function"!=typeof c){if(c instanceof Event||c instanceof V){var d={};for(e in c)(b=c[e])&&"object"==typeof b?"detail"==e&&(d[e]=b):e in Event||(d[e]=b);return d}if(c instanceof Error){var e=new Set(["name","message","stack"]);for(d in c)e.add(d);d=t(Object.getOwnPropertyNames(c));for(b=d.next();!b.done;b=d.next())e.add(b.value);d={};e=t(e);for(b=e.next();!b.done;b=e.next())b=b.value,d[b]=c[b];c={__type__:"Error",contents:d}}else if(c instanceof
|
|
TimeRanges){e={__type__:"TimeRanges",length:c.length,start:[],end:[]};c=t(yj(c));for(d=c.next();!d.done;d=c.next())d=d.value,b=d.end,e.start.push(d.start),e.end.push(b);c=e}else c=ArrayBuffer.isView(c)&&1===c.BYTES_PER_ELEMENT?{__type__:"Uint8Array",entries:Array.from(c)}:"number"==typeof c?isNaN(c)?"NaN":isFinite(c)?c:0>c?"-Infinity":"Infinity":c;return c}})}
|
|
function ls(a){return JSON.parse(a,function(b,c){if("NaN"==c)var d=NaN;else if("-Infinity"==c)d=-Infinity;else if("Infinity"==c)d=Infinity;else if(c&&"object"==typeof c&&"TimeRanges"==c.__type__)d=ms(c);else if(c&&"object"==typeof c&&"Uint8Array"==c.__type__)d=new Uint8Array(c.entries);else if(c&&"object"==typeof c&&"Error"==c.__type__){b=c.contents;c=Error(b.message);for(d in b)c[d]=b[d];d=c}else d=c;return d})}
|
|
function ms(a){return{length:a.length,start:function(b){return a.start[b]},end:function(b){return a.end[b]}}}
|
|
var ns="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),os="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),ps=["loop","playbackRate"],qs=["pause","play"],rs=(new Map).set("getAssetUri",2).set("getAudioLanguages",4).set("getAudioLanguagesAndRoles",4).set("getBufferFullness",1).set("getBufferedInfo",2).set("getExpiration",2).set("getKeyStatuses",2).set("getPlaybackRate",2).set("getTextLanguages",
|
|
4).set("getTextLanguagesAndRoles",4).set("isAudioOnly",10).set("isBuffering",1).set("isInProgress",1).set("isLive",10).set("isTextTrackVisible",1).set("isVideoOnly",10).set("keySystem",10).set("seekRange",1).set("getLoadMode",10).set("getManifestType",10).set("isFullyLoaded",1).set("isEnded",1),ss=(new Map).set("getConfiguration",4).set("getConfigurationForLowLatency",4).set("getStats",5).set("getAudioTracks",2).set("getChaptersTracks",2).set("getImageTracks",2).set("getVideoTracks",2).set("getTextTracks",
|
|
2).set("getVariantTracks",2),ts=(new Map).set("getPlayheadTimeAsDate",1).set("getPresentationStartTimeAsDate",20).set("getSegmentAvailabilityDuration",20),us=[["getConfiguration","configure","getConfigurationForLowLatency","configurationForLowLatency"]],vs=[["isTextTrackVisible","setTextTrackVisibility"]],ws="cancelTrickPlay configure configurationForLowLatency getChapters resetConfiguration retryStreaming selectAudioLanguage selectAudioTrack selectTextLanguage selectTextTrack selectVariantTrack selectVariantsByLabel selectVideoTrack setTextTrackVisibility trickPlay updateStartTime goToLive useTrickPlayTrackIfAvailable".split(" "),
|
|
xs="addChaptersTrack addTextTrackAsync addThumbnailsTrack getAllThumbnails getChaptersAsync getThumbnails attach attachCanvas detach load unload".split(" ");function ys(a,b,c,d,e,f,g){var h=this;this.G=a;this.K=g;this.l=new $e(b);this.L=c;this.s=!1;this.A=d;this.F=e;this.M=f;this.i=this.m=!1;this.I="";this.o=null;this.B=function(){return zs(h)};this.C=function(k,l){k=ls(l);switch(k.type){case "event":var m=k.targetName,n=Bg(k.event);h.A(m,n);break;case "update":m=k.update;for(n in m){k=h.g[n]||{};for(var q in m[n])k[q]=m[n][q]}h.s&&(h.L(),h.s=!1);break;case "asyncComplete":if(q=k.id,n=k.error,l=k.res,k=h.h.get(q),h.h.delete(q),k)if(n){q=new U(n.severity,
|
|
n.category,n.code);for(m in n)q[m]=n[m];k.reject(q)}else k.resolve(l)}};this.g={video:{},player:{}};this.H=0;this.h=new Map;this.j=null;As.add(this)}p=ys.prototype;p.destroy=function(){As.delete(this);Bs(this);Cs&&Ds(this);this.l&&(this.l.stop(),this.l=null);this.F=this.A=null;this.i=this.m=!1;this.C=this.B=this.j=this.h=this.g=this.o=null;return Promise.resolve()};p.ub=function(){return this.i};p.Tg=function(){return this.I};
|
|
p.init=function(){if(this.G.length)if(window.chrome&&chrome.cast&&chrome.cast.isAvailable){this.m=!0;this.l.Hb();var a=new chrome.cast.SessionRequest(this.G,[],null,this.K,null);a=new chrome.cast.ApiConfig(a,function(b){for(var c=t(As),d=c.next();!d.done;d=c.next()){d=d.value;var e=b;d.j=new tg;d.s=!0;Es(d,e)}},function(b){for(var c=t(As),d=c.next();!d.done;d=c.next())d=d.value,Fs="available"==b,d.l.Hb()},"origin_scoped");chrome.cast.initialize(a,function(){},function(){});Fs&&this.l.ha(Gs);(a=Cs)&&
|
|
a.status!=chrome.cast.SessionStatus.STOPPED?(this.j=new tg,this.s=!0,Es(this,a)):Cs=null}else window.__onGCastApiAvailable!==Hs&&(Is=window.__onGCastApiAvailable||null,window.__onGCastApiAvailable=Hs)};p.eh=function(a){this.o=a;this.i&&Js(this,{type:"appData",appData:this.o})};
|
|
p.cast=function(){var a=this;return Q(function(b){if(!a.m)throw new U(1,8,8E3);if(!Fs)throw new U(1,8,8001);if(a.i)throw new U(1,8,8002);a.j=new tg;chrome.cast.requestSession(function(c){return Es(a,c)},function(c){return Ks(a,c)});return F(b,a.j,0)})};function Ls(a){a.i&&chrome.cast.requestSession(function(b){return Es(a,b)},function(b){return Ks(a,b)})}p.hd=function(){if(this.i){Bs(this);if(Cs){Ds(this);try{Cs.stop(function(){},function(){})}catch(a){}Cs=null}zs(this)}};
|
|
p.get=function(a,b){var c=this;if("video"==a){if(qs.includes(b))return function(){return c.ui.apply(c,[a,b].concat(x(Oa.apply(0,arguments))))}}else if("player"==a){if(ts.has(b)&&!this.get("player","isLive")())return function(){};if(ws.includes(b))return function(){return c.ui.apply(c,[a,b].concat(x(Oa.apply(0,arguments))))};if(xs.includes(b))return function(){return c.Ek.apply(c,[a,b].concat(x(Oa.apply(0,arguments))))};if(rs.has(b)||ss.has(b))return function(){return c.g[a][b]}}return this.g[a][b]};
|
|
p.set=function(a,b,c){this.g[a][b]=c;Js(this,{type:"set",targetName:a,property:b,value:c})};function Es(a,b){var c=a.M();Cs=b;b.addUpdateListener(a.B);b.addMessageListener("urn:x-cast:com.google.shaka.v2",a.C);zs(a);Js(a,{type:"init",initState:c,appData:a.o});a.j.resolve()}function Ks(a,b){var c=8003;switch(b.code){case "cancel":c=8004;break;case "timeout":c=8005;break;case "receiver_unavailable":c=8006}a.j.reject(new U(2,8,c,b))}
|
|
p.ui=function(a,b){Js(this,{type:"call",targetName:a,methodName:b,args:Oa.apply(2,arguments)})};p.Ek=function(a,b){var c=Oa.apply(2,arguments),d=new tg,e=this.H.toString();this.H++;this.h.set(e,d);try{Js(this,{type:"asyncCall",targetName:a,methodName:b,args:c,id:e})}catch(f){d.reject(f)}return d};function Ds(a){var b=Cs;b.removeUpdateListener(a.B);b.removeMessageListener("urn:x-cast:com.google.shaka.v2",a.C)}
|
|
function zs(a){var b=Cs?"connected"==Cs.status:!1;if(a.i&&!b){a.F();for(var c in a.g)a.g[c]={};Bs(a)}a.i=b;a.I=b?Cs.receiver.friendlyName:"";a.l.Hb()}function Bs(a){if(a.h)for(var b=t(a.h.keys()),c=b.next();!c.done;c=b.next()){c=c.value;var d=a.h.get(c);a.h.delete(c);d.reject(new U(1,7,7E3))}}
|
|
function Js(a,b){b=ks(b);var c=Cs;try{c.sendMessage("urn:x-cast:com.google.shaka.v2",b,function(){},eb)}catch(d){throw b=new U(2,8,8005,d),c=new V("error",(new Map).set("detail",b)),a.A("player",c),a.hd(),b;}}var Gs=.02,Fs=!1,Cs=null,Is=null,As=new Set;function Hs(a){Is?window.__onGCastApiAvailable=Is:delete window.__onGCastApiAvailable;Is=null;if(a)for(var b=t(As),c=b.next();!c.done;c=b.next())c.value.init();"function"===typeof window.__onGCastApiAvailable&&window.__onGCastApiAvailable(a)};function Ms(a,b,c,d){d=void 0===d?!1:d;Dg.call(this);var e=this;this.i=a;this.h=b;this.l=this.o=this.m=this.s=this.j=null;this.H=c;this.G=d;this.C=[];this.B=[];this.A=[];this.F=new Map;this.g=null;window.chrome?(this.g=new ys(c,function(){return Ns(e)},function(){return Os(e)},function(f,g){return Ps(e,f,g)},function(){return Qs(e)},function(){return Rs(e)},d),Ss(this)):(this.j=this.i,this.s=this.h)}pa(Ms,Dg);p=Ms.prototype;
|
|
p.destroy=function(a){this.g&&(void 0===a?0:a)&&this.g.hd();this.l&&(this.l.release(),this.l=null);a=[];this.h&&(a.push(this.h.destroy()),this.h=null);this.g&&(a.push(this.g.destroy()),this.g=null);this.s=this.j=this.i=null;Dg.prototype.release.call(this);return Promise.all(a)};p.Uj=function(){return this.j};p.kd=function(){return this.s};p.ej=function(){return this.g?this.g.m&&Fs:!1};p.ub=function(){return this.g?this.g.ub():!1};p.Tg=function(){return this.g?this.g.Tg():""};
|
|
p.cast=function(){var a=this;return Q(function(b){return 1==b.g?a.g?F(b,a.g.cast(),2):b.return():a.h?F(b,a.h.rc(),0):b.return()})};p.eh=function(a){this.g&&this.g.eh(a)};p.Tk=function(){this.g&&Ls(this.g)};p.hd=function(){this.g&&this.g.hd()};
|
|
p.fj=function(a,b){b=void 0===b?!1:b;var c=this;return Q(function(d){if(1==d.g){if(a==c.H&&b==c.G)return d.return();c.H=a;c.G=b;if(!c.g)return d.return();c.g.hd();return F(d,c.g.destroy(),2)}c.g=null;c.g=new ys(a,function(){return Ns(c)},function(){return Os(c)},function(e,f){return Ps(c,e,f)},function(){return Qs(c)},function(){return Rs(c)},b);c.g.init();G(d)})};
|
|
function Ss(a){a.g.init();a.l=new jb;for(var b=t(ns),c=b.next();!c.done;c=b.next())a.l.D(a.i,c.value,function(f){a.g.ub()||(f=Bg(f),a.m.dispatchEvent(f))});for(var d in Cg)a.l.D(a.h,Cg[d],function(f){a.g.ub()||a.o.dispatchEvent(f)});a.j={};b={};for(var e in a.i)b={Ud:b.Ud},b.Ud=e,Object.defineProperty(a.j,b.Ud,{configurable:!1,enumerable:!0,get:function(f){return function(){return Ts(a,f.Ud)}}(b),set:function(f){return function(g){var h=f.Ud;a.g.ub()?a.g.set("video",h,g):a.i[h]=g}}(b)});a.s={};Us(a,
|
|
function(f){Object.defineProperty(a.s,f,{configurable:!1,enumerable:!0,get:function(){return Vs(a,f)}})});Ws(a);a.m=new Dg;a.m.xe=a.j;a.o=new Dg;a.o.xe=a.s;a.l.D(a.h,"unloading",function(){a.g&&a.g.ub()||Xs(a)})}function Ws(a){var b=new Map;Us(a,function(c,d){b.has(d)?(d=b.get(d),c.length<d.length?a.F.set(c,d):a.F.set(d,c)):b.set(d,c)})}
|
|
function Us(a,b){function c(k){return"constructor"==k||"function"!=typeof d[k]?!1:!e.has(k)}var d=a.h,e=new Set,f;for(f in d)c(f)&&(e.add(f),b(f,d[f]));a=Object.getPrototypeOf(d);for(f=Object.getPrototypeOf({});a&&a!=f;){for(var g=t(Object.getOwnPropertyNames(a)),h=g.next();!h.done;h=g.next())h=h.value,c(h)&&(e.add(h),b(h,d[h]));a=Object.getPrototypeOf(a)}}
|
|
function Rs(a){var b={video:{},player:{},playerAfterLoad:{},manifest:a.h.jd(),startTime:null,addThumbnailsTrackCalls:a.C,addTextTrackAsyncCalls:a.B,addChaptersTrackCalls:a.A};a.i.pause();for(var c=t(ps),d=c.next();!d.done;d=c.next())d=d.value,b.video[d]=a.i[d];a.i.ended||(b.startTime=a.i.currentTime);c=t(us);for(d=c.next();!d.done;d=c.next()){var e=d.value;d=e[1];e=a.h[e[0]]();b.player[d]=e}c=t(vs);for(d=c.next();!d.done;d=c.next())e=d.value,d=e[1],e=a.h[e[0]](),b.playerAfterLoad[d]=e;return b}
|
|
function Ns(a){var b=new V("caststatuschanged");a.dispatchEvent(b)}function Os(a){var b=new V(a.j.paused?"pause":"play");a.m.dispatchEvent(b)}
|
|
function Qs(a){for(var b=t(us),c=b.next();!c.done;c=b.next()){var d=c.value;c=d[1];d=a.g.get("player",d[0])();a.h[c](d)}var e=a.C,f=a.B,g=a.A;Xs(a);var h=a.g.get("player","getAssetUri")();d=a.g.get("video","ended");b=Promise.resolve();var k=a.i.autoplay;c=null;d||(c=a.g.get("video","currentTime"));var l;(d=a.g.get("player","getTextTracks")())&&d.length&&(l=d.find(function(q){return q.active}));var m=a.g.get("player","isTextTrackVisible")();h&&(a.i.autoplay=!1,b=a.h.load(h,c));var n={};c=t(ps);for(d=
|
|
c.next();!d.done;d=c.next())d=d.value,n[d]=a.g.get("video",d);b.then(function(){if(a.i){for(var q=t(e),r=q.next();!r.done;r=q.next()){r=r.value;var u;(u=a.kd()).Ge.apply(u,x(r))}q=t(f);for(u=q.next();!u.done;u=q.next()){u=u.value;var w;(w=a.kd()).Dd.apply(w,x(u))}w=t(g);for(q=w.next();!q.done;q=w.next()){q=q.value;var v;(v=a.kd()).Fe.apply(v,x(q))}v=t(ps);for(w=v.next();!w.done;w=v.next())w=w.value,a.i[w]=n[w];v=t(vs);for(w=v.next();!w.done;w=v.next())q=w.value,w=q[1],q=a.g.get("player",q[0])(),a.h[w](q);
|
|
a.h.ih(m);l&&a.h.bh(l.language,l.roles,l.forced);a.i.autoplay=k;h&&a.i.play()}},function(q){q=(new Map).set("detail",q);q=new V("error",q);a.h.dispatchEvent(q)})}
|
|
function Ts(a,b){if("addEventListener"==b)return function(d,e,f){return a.m.addEventListener(d,e,f)};if("removeEventListener"==b)return function(d,e,f){return a.m.removeEventListener(d,e,f)};if(a.g.ub()&&0==Object.keys(a.g.g.video).length){var c=a.i[b];if("function"!=typeof c)return c}return a.g.ub()?a.g.get("video",b):(b=a.i[b],"function"==typeof b&&(b=b.bind(a.i)),b)}
|
|
function Vs(a,b,c){c=void 0===c?!1:c;a.F.has(b)&&(b=a.F.get(b));if("addEventListener"==b)return function(d,e,f){return a.o.addEventListener(d,e,f)};if("removeEventListener"==b)return function(d,e,f){return a.o.removeEventListener(d,e,f)};if("getMediaElement"==b)return function(){return a.j};if("getSharedConfiguration"==b)return a.g.get("player","getConfiguration");if("getNetworkingEngine"==b)return function(){return a.h.Nb()};if("getDrmEngine"==b)return function(){return a.h.C};if("getAdManager"==
|
|
b)return function(){return a.h.Qh()};if("getQueueManager"==b)return function(){return a.h.Wh()};if("setVideoContainer"==b)return function(d){return a.h.Li(d)};if(!c){if("addThumbnailsTrack"==b)return function(){var d=Oa.apply(0,arguments);a.C.push(d);return Vs(a,b,!0).apply(null,x(d))};if("addTextTrackAsync"==b)return function(){var d=Oa.apply(0,arguments);a.B.push(d);return Vs(a,b,!0).apply(null,x(d))};if("addChaptersTrack"==b)return function(){var d=Oa.apply(0,arguments);a.A.push(d);return Vs(a,
|
|
b,!0).apply(null,x(d))}}if(a.g.ub()){if("getManifest"==b||"drmInfo"==b)return function(){bb(b+"() does not work while casting!");return null};if("attach"==b||"detach"==b)return function(){bb(b+"() does not work while casting!");return Promise.resolve()};if("getChapters"==b)return function(){bb(b+"() does not work while casting!");return[]}}return a.g.ub()&&0==Object.keys(a.g.g.video).length&&(rs.has(b)||ss.has(b))||!a.g.ub()?a.h[b].bind(a.h):a.g.get("player",b)}
|
|
function Ps(a,b,c){a.g.ub()&&("video"==b?a.m.dispatchEvent(c):"player"==b&&("unloading"==c.type&&Xs(a),a.o.dispatchEvent(c)))}function Xs(a){a.C=[];a.B=[];a.A=[]}T("shaka.cast.CastProxy",Ms);Ms.prototype.changeReceiverId=Ms.prototype.fj;Ms.prototype.forceDisconnect=Ms.prototype.hd;Ms.prototype.suggestDisconnect=Ms.prototype.Tk;Ms.prototype.setAppData=Ms.prototype.eh;Ms.prototype.cast=Ms.prototype.cast;Ms.prototype.receiverName=Ms.prototype.Tg;Ms.prototype.isCasting=Ms.prototype.ub;
|
|
Ms.prototype.canCast=Ms.prototype.ej;Ms.prototype.getPlayer=Ms.prototype.kd;Ms.prototype.getVideo=Ms.prototype.Uj;Ms.prototype.destroy=Ms.prototype.destroy;function Ys(a,b,c,d){Dg.call(this);var e=this;this.h=a;this.g=b;this.j=new jb;this.H={video:a,player:b};this.F=c||function(){};this.I=d||function(f){return f};this.i=null;this.G=!1;this.o=!0;this.m=0;this.B=!1;this.A=!0;this.s=this.l=null;this.C=new $e(function(){Zs(e)});$s(this)}pa(Ys,Dg);p=Ys.prototype;p.isConnected=function(){return this.G};p.bk=function(){return this.o};p.Qk=function(a){this.i=a};p.jj=function(){this.i=null};
|
|
p.Rk=function(a){this.i||(this.i={metadataType:cast.receiver.media.MetadataType.GENERIC});this.i.title=a};p.Pk=function(a){this.i||(this.i={metadataType:cast.receiver.media.MetadataType.GENERIC});this.i.images=[{url:a}]};p.Ok=function(a){this.i||(this.i={});this.i.artist=a;this.i.metadataType=cast.receiver.media.MetadataType.MUSIC_TRACK};
|
|
p.destroy=function(){var a=this,b,c;return Q(function(d){if(1==d.g)return a.j&&(a.j.release(),a.j=null),b=[],a.g&&(b.push(a.g.destroy()),a.g=null),a.C&&(a.C.stop(),a.C=null),a.h=null,a.H=null,a.F=null,a.G=!1,a.o=!0,a.l=null,a.s=null,Dg.prototype.release.call(a),F(d,Promise.all(b),2);c=cast.receiver.CastReceiverManager.getInstance();c.stop();G(d)})};
|
|
function $s(a){var b=cast.receiver.CastReceiverManager.getInstance();b.onSenderConnected=function(){return at(a)};b.onSenderDisconnected=function(){return at(a)};b.onSystemVolumeChanged=function(){var e=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();e&&bt(a,{type:"update",update:{video:{volume:e.level,muted:e.muted}}},a.l);bt(a,{type:"event",targetName:"video",event:{type:"volumechange"}},a.l)};a.s=b.getCastMessageBus("urn:x-cast:com.google.cast.media");a.s.onMessage=function(e){return ct(a,
|
|
e)};a.l=b.getCastMessageBus("urn:x-cast:com.google.shaka.v2");a.l.onMessage=function(e){return dt(a,e)};b.start();b=t(ns);for(var c=b.next();!c.done;c=b.next())a.j.D(a.h,c.value,function(e){return et(a,"video",e)});for(var d in Cg)a.j.D(a.g,Cg[d],function(e){return et(a,"player",e)});a.j.D(a.h,"loadeddata",function(){a.B=!0});a.j.D(a.g,"loading",function(){a.o=!1;ft(a)});a.j.D(a.h,"playing",function(){a.o=!1;ft(a)});a.j.D(a.h,"pause",function(){ft(a)});a.j.D(a.g,"unloading",function(){a.o=!0;ft(a)});
|
|
a.j.D(a.h,"ended",function(){(new $e(function(){a.h&&a.h.ended&&(a.o=!0,ft(a))})).ha(gt)})}function at(a){a.m=0;a.A=!0;a.G=0!=cast.receiver.CastReceiverManager.getInstance().getSenders().length;ft(a)}function ft(a){var b;Q(function(c){if(1==c.g)return F(c,Promise.resolve(),2);if(!a.g)return c.return();b=new V("caststatuschanged");a.dispatchEvent(b);ht(a)||it(a);G(c)})}
|
|
function jt(a,b,c){var d,e,f,g,h,k,l,m,n,q,r,u,w,v,y,z,A,B,E;Q(function(H){switch(H.g){case 1:for(d in b.player)e=b.player[d],a.g[d](e);a.F(c);f=a.h.autoplay;return b.manifest?(a.h.autoplay=!1,wa(H,5),F(H,a.g.load(b.manifest,b.startTime),7)):F(H,Promise.resolve(),3);case 7:if(b.addThumbnailsTrackCalls)for(g=t(b.addThumbnailsTrackCalls),h=g.next();!h.done;h=g.next())k=h.value,a.g.Ge.apply(a.g,x(k));if(b.addTextTrackAsyncCalls)for(l=t(b.addTextTrackAsyncCalls),m=l.next();!m.done;m=l.next())n=m.value,
|
|
a.g.Dd.apply(a.g,x(n));if(b.addChaptersTrackCalls)for(q=t(b.addChaptersTrackCalls),r=q.next();!r.done;r=q.next())u=r.value,a.g.Fe.apply(a.g,x(u));za(H,3);break;case 5:return w=Aa(H),v=(new Map).set("detail",w),y=new V("error",v),a.g&&a.g.dispatchEvent(y),H.return();case 3:if(!a.g)return H.return();for(z in b.video)A=b.video[z],a.h[z]=A;for(B in b.playerAfterLoad)E=b.playerAfterLoad[B],a.g[B](E);a.h.autoplay=f;b.manifest&&(a.h.play(),it(a));G(H)}})}
|
|
function et(a,b,c){a.g&&(Zs(a),bt(a,{type:"event",targetName:b,event:c},a.l))}
|
|
function Zs(a){a.C.ha(kt);for(var b={video:{},player:{}},c=t(os),d=c.next();!d.done;d=c.next())d=d.value,b.video[d]=a.h[d];a.g.V()&&ts.forEach(function(e,f){0==a.m%e&&(b.player[f]=a.g[f]())});rs.forEach(function(e,f){0==a.m%e&&(b.player[f]=a.g[f]())});if(c=cast.receiver.CastReceiverManager.getInstance().getSystemVolume())b.video.volume=c.level,b.video.muted=c.muted;bt(a,{type:"update",update:b},a.l);ss.forEach(function(e,f){0==a.m%e&&(e={player:{}},e.player[f]=a.g[f](),bt(a,{type:"update",update:e},
|
|
a.l))});a.B&&(a.m+=1);ht(a)}function ht(a){return a.A&&(a.h.duration||a.g.V())?(lt(a),a.A=!1,!0):!1}function lt(a,b){var c={contentId:a.g.jd(),streamType:a.g.V()?"LIVE":"BUFFERED",contentType:""};a.g.V()||(c.duration=a.h.duration);a.i&&(c.metadata=a.i);it(a,void 0===b?0:b,c)}
|
|
function dt(a,b){var c=ls(b.data);switch(c.type){case "init":a.m=0;a.B=!1;a.A=!0;jt(a,c.initState,c.appData);Zs(a);break;case "appData":a.F(c.appData);break;case "set":var d=c.targetName,e=c.property;c=c.value;if("video"==d)if(b=cast.receiver.CastReceiverManager.getInstance(),"volume"==e){b.setSystemVolumeLevel(c);break}else if("muted"==e){b.setSystemVolumeMuted(c);break}a.H[d][e]=c;break;case "call":d=a.H[c.targetName];d[c.methodName].apply(d,c.args);break;case "asyncCall":d=c.targetName;e=c.methodName;
|
|
"player"==d&&"load"==e&&(a.m=0,a.B=!1);var f=c.id,g=b.senderId;b=a.H[d];c=b[e].apply(b,c.args);"player"==d&&"load"==e&&(c=c.then(function(){a.A=!0}));c.then(function(h){return mt(a,g,f,null,h)},function(h){return mt(a,g,f,h,null)})}}
|
|
function ct(a,b){var c=ls(b.data);switch(c.type){case "PLAY":a.h.play();it(a);break;case "PAUSE":a.h.pause();it(a);break;case "SEEK":b=c.currentTime;var d=c.resumeState;null!=b&&(a.h.currentTime=Number(b));d&&"PLAYBACK_START"==d?(a.h.play(),it(a)):d&&"PLAYBACK_PAUSE"==d&&(a.h.pause(),it(a));break;case "STOP":a.g.rc().then(function(){a.g&&it(a)});break;case "GET_STATUS":lt(a,Number(c.requestId));break;case "VOLUME":d=c.volume;b=d.level;d=d.muted;var e=a.h.volume,f=a.h.muted;null!=b&&(a.h.volume=Number(b));
|
|
null!=d&&(a.h.muted=d);e==a.h.volume&&f==a.h.muted||it(a);break;case "LOAD":a.m=0;a.B=!1;a.A=!1;b=c.media;d=c.currentTime;e=a.I(b.contentId);f=c.autoplay||!0;a.F(b.customData);f&&(a.h.autoplay=!0);a.g.load(e,d).then(function(){a.g&<(a)}).catch(function(g){var h="LOAD_FAILED";7==g.category&&7E3==g.code&&(h="LOAD_CANCELLED");bt(a,{requestId:Number(c.requestId),type:h},a.s)});break;default:bt(a,{requestId:Number(c.requestId),type:"INVALID_REQUEST",reason:"INVALID_COMMAND"},a.s)}}
|
|
function mt(a,b,c,d,e){a.g&&bt(a,{type:"asyncComplete",id:c,error:d,res:e},a.l,b)}function bt(a,b,c,d){a.G&&(a=ks(b),d?c.getCastChannel(d).send(a):c.broadcast(a))}function it(a,b,c){c=void 0===c?null:c;var d={mediaSessionId:0,playbackRate:a.h.playbackRate,playerState:a.o?nt:a.g.Gg()?ot:a.h.paused?pt:qt,currentTime:a.h.currentTime,supportedMediaCommands:63,volume:{level:a.h.volume,muted:a.h.muted}};c&&(d.media=c);bt(a,{requestId:void 0===b?0:b,type:"MEDIA_STATUS",status:[d]},a.s)}
|
|
T("shaka.cast.CastReceiver",Ys);Ys.prototype.destroy=Ys.prototype.destroy;Ys.prototype.setContentArtist=Ys.prototype.Ok;Ys.prototype.setContentImage=Ys.prototype.Pk;Ys.prototype.setContentTitle=Ys.prototype.Rk;Ys.prototype.clearContentMetadata=Ys.prototype.jj;Ys.prototype.setContentMetadata=Ys.prototype.Qk;Ys.prototype.isIdle=Ys.prototype.bk;Ys.prototype.isConnected=Ys.prototype.isConnected;var kt=.5,gt=5,nt="IDLE",qt="PLAYING",ot="BUFFERING",pt="PAUSED";function rt(a,b,c,d,e){if(d>=e)return null;for(var f=-1,g=-1,h=0;h<c.length;h++)if(c[h].some(function(B){return null!=B&&""!=B.g.trim()})){f=h;break}for(h=c.length-1;0<=h;h--)if(c[h].some(function(B){return null!=B&&""!=B.g.trim()})){g=h;break}if(-1===f||-1===g)return null;for(var k=h=!1,l="white",m="black",n=st(d,e,h,k,l,m);f<=g;f++){for(var q=c[f],r=-1,u=-1,w=0;w<q.length;w++)if(null!=q[w]&&""!==q[w].g.trim()){r=w;break}for(w=q.length-1;0<=w;w--)if(null!=q[w]&&""!==q[w].g.trim()){u=w;break}if(-1===
|
|
r||-1===u)q=tt(d,e),a.nestedCues.push(q);else{for(;r<=u;r++)if(w=q[r]){var v=w.l,y=w.i,z=w.j,A=w.h;if(v!=h||y!=k||z!=l||A!=m)n.payload&&a.nestedCues.push(n),n=st(d,e,v,y,z,A),h=v,k=y,l=z,m=A;n.payload+=w.g}else n.payload+=" ";n.payload&&a.nestedCues.push(n);f!==g&&(n=tt(d,e),a.nestedCues.push(n));n=st(d,e,h,k,l,m)}}return a.nestedCues.length?{cue:a,stream:b}:null}function st(a,b,c,d,e,f){a=new Qd(a,b,"");c&&a.textDecoration.push(pe);d&&(a.fontStyle=oe);a.color=e;a.backgroundColor=f;return a}
|
|
function tt(a,b){a=new Qd(a,b,"");a.lineBreak=!0;return a}function ut(a,b,c,d,e){this.g=a;this.l=b;this.i=c;this.h=d;this.j=e};function vt(a,b){this.i=[];this.g=1;this.h=0;this.C=a;this.B=b;this.j=this.m=!1;this.l="white";this.o="black";this.s=this.A=null;wt(this)}function xt(a,b,c){var d="CC"+((a.C<<1|a.B)+1),e=new Qd(b,c,"");e.lineInterpretation=1;var f=yt.get(a.g);f&&(e.line=f);null!=a.s&&null!=a.A&&(e.position=10+Math.min(70,10*a.s)+2.5*a.A);(b=rt(e,d,a.i,b,c))&&15<a.g+b.cue.nestedCues.length-3&&(f=yt.get(a.g+3-b.cue.nestedCues.length))&&(e.line=f);return b}function wt(a){zt(a,0,15);a.g=1}
|
|
function At(a,b,c){if(!(32>c||127<c)){var d="";switch(b){case 0:d=Bt.has(c)?Bt.get(c):String.fromCharCode(c);break;case 1:d=Ct.get(c);break;case 2:a.i[a.g].pop();d=Dt.get(c);break;case 3:a.i[a.g].pop(),d=Et.get(c)}d&&a.i[a.g].push(new ut(d,a.m,a.j,a.o,a.l))}}function Ft(a,b,c,d){if(!(0>c||0>b))if(b>=c)for(--d;0<=d;d--)a.i[b+d]=a.i[c+d].map(function(f){return f});else for(var e=0;e<d;e++)a.i[b+e]=a.i[c+e].map(function(f){return f})}function zt(a,b,c){for(var d=0;d<=c;d++)a.i[b+d]=[]}
|
|
var Bt=new Map([[39,"\u2019"],[42,"\u00e1"],[92,"\u00e9"],[92,"\u00e9"],[94,"\u00ed"],[95,"\u00f3"],[96,"\u00fa"],[123,"\u00e7"],[124,"\u00f7"],[125,"\u00d1"],[126,"\u00f1"],[127,"\u2588"]]),Ct=new Map([[48,"\u00ae"],[49,"\u00b0"],[50,"\u00bd"],[51,"\u00bf"],[52,"\u2122"],[53,"\u00a2"],[54,"\u00a3"],[55,"\u266a"],[56,"\u00e0"],[57," "],[58,"\u00e8"],[59,"\u00e2"],[60,"\u00ea"],[61,"\u00ee"],[62,"\u00f4"],[63,"\u00fb"]]),Dt=new Map([[32,"\u00c1"],[33,"\u00c9"],[34,"\u00d3"],[35,"\u00da"],[36,"\u00dc"],
|
|
[37,"\u00fc"],[38,"\u2018"],[39,"\u00a1"],[40,"*"],[41,"'"],[42,"\u2500"],[43,"\u00a9"],[44,"\u2120"],[45,"\u00b7"],[46,"\u201c"],[47,"\u201d"],[48,"\u00c0"],[49,"\u00c2"],[50,"\u00c7"],[51,"\u00c8"],[52,"\u00ca"],[53,"\u00cb"],[54,"\u00eb"],[55,"\u00ce"],[56,"\u00cf"],[57,"\u00ef"],[58,"\u00d4"],[59,"\u00d9"],[60,"\u00f9"],[61,"\u00db"],[62,"\u00ab"],[63,"\u00bb"]]),Et=new Map([[32,"\u00c3"],[33,"\u00e3"],[34,"\u00cd"],[35,"\u00cc"],[36,"\u00ec"],[37,"\u00d2"],[38,"\u00f2"],[39,"\u00d5"],[40,"\u00f5"],
|
|
[41,"{"],[42,"}"],[43,"\\"],[44,"^"],[45,"_"],[46,"|"],[47,"~"],[48,"\u00c4"],[49,"\u00e4"],[50,"\u00d6"],[51,"\u00f6"],[52,"\u00df"],[53,"\u00a5"],[54,"\u00a4"],[55,"\u2502"],[56,"\u00c5"],[57,"\u00e5"],[58,"\u00d8"],[59,"\u00f8"],[60,"\u250c"],[61,"\u2510"],[62,"\u2514"],[63,"\u2518"]]),yt=new Map([[1,10],[2,15.33],[3,20.66],[4,26],[5,31.33],[6,36.66],[7,42],[8,47.33],[9,52.66],[10,58],[11,63.33],[12,68.66],[13,74],[14,79.33],[15,84.66]]);function Gt(a,b){this.h=0;this.o=new vt(a,b);this.i=new vt(a,b);this.g=this.j=new vt(a,b);this.l=0;this.m=null}function Ht(a,b,c){a.g=a.i;var d=a.g,e=null;3!==a.h&&4!==a.h&&(e=xt(d,a.l,c),c=a.i,c.g=0<c.h?c.h:0,zt(c,0,15),c=a.j,c.g=0<c.h?c.h:0,zt(c,0,15),d.g=15);a.h=3;d.h=b;return e}function It(a){a.h=1;a.g=a.j;a.g.h=0}function Jt(a){cb("Cea608DataChannel","CEA-608 text mode entered, but is unsupported");a.g=a.o;a.h=4}var Kt="black green blue cyan red yellow magenta black".split(" "),Lt="white green blue cyan red yellow magenta white_italics".split(" ");function Mt(a,b){this.I=b;this.M=a;this.K=this.l=!1;this.m=this.o=this.G=this.L=this.H=0;this.F=2;this.i=[];this.g=this.h=this.j=0;this.C=this.A=!1;this.B="white";this.s="black";Nt(this)}function Nt(a){a.i=[];for(var b=0;16>b;b++)a.i.push(Ot())}function Ot(){for(var a=[],b=0;42>b;b++)a.push(null);return a}function Pt(a,b){Qt(a)&&(a.i[a.h][a.g]=new ut(b,a.C,a.A,a.s,a.B),a.g++)}function Qt(a){var b=a.g<a.m&&0<=a.g;return a.h<a.o&&0<=a.h&&b}Mt.prototype.isVisible=function(){return this.l};
|
|
function Rt(a){for(var b=0,c=1;16>c;c++,b++)a.i[b]=a.i[c];for(c=0;1>c;c++,b++)a.i[b]=Ot()}
|
|
function St(a,b,c){var d=new Qd(a.j,b,"");d.textAlign=0===a.F?"left":1===a.F?"right":Sd;var e=d.region;a.I&&(e.id+="svc"+a.I);e.id+="win"+a.M;e.height=a.o;e.width=a.m;e.heightUnits=2;e.widthUnits=2;e.viewportAnchorX=a.H;e.viewportAnchorY=a.L;e.viewportAnchorUnits=a.K?Rc:2;switch(a.G){case 0:e.regionAnchorX=0;e.regionAnchorY=0;break;case 1:e.regionAnchorX=50;e.regionAnchorY=0;break;case 2:e.regionAnchorX=100;e.regionAnchorY=0;break;case 3:e.regionAnchorX=0;e.regionAnchorY=50;break;case 4:e.regionAnchorX=
|
|
50;e.regionAnchorY=50;break;case 5:e.regionAnchorX=100;e.regionAnchorY=50;break;case 6:e.regionAnchorX=0;e.regionAnchorY=100;break;case 7:e.regionAnchorX=50;e.regionAnchorY=100;break;case 8:e.regionAnchorX=100,e.regionAnchorY=100}if(c=rt(d,"svc"+c,a.i,a.j,b))a.j=b;return c}Mt.prototype.display=function(){this.l=!0};function Tt(){this.i=[];this.h=null;this.g=0}function Ut(a,b){3===b.type?(a.g=2*(b.value&63)-1,a.h=[]):a.h&&(0<a.g&&(a.h.push(b),a.g--),0===a.g&&(a.i.push(new Vt(a.h)),a.h=null,a.g=0))}function Vt(a){this.g=0;this.h=a}Vt.prototype.Fa=function(){return this.g<this.h.length};Vt.prototype.Ma=function(){return this.g};function Wt(a){if(!a.Fa())throw new U(2,2,3E3);return a.h[a.g++]}Vt.prototype.skip=function(a){if(this.g+a>this.h.length)throw new U(2,2,3E3);this.g+=a};
|
|
Vt.prototype.Bi=function(a){if(0>this.g-a)throw new U(2,2,3E3);this.g-=a};function Xt(a){this.i=a;this.h=[null,null,null,null,null,null,null,null];this.g=null}
|
|
function Yt(a,b,c,d){if(!a.g)return[];if(24==c)return c=Wt(b).value,d=Wt(b).value,c=function(f){return f.map(function(g){return("0"+(g&255).toString(16)).slice(-2)}).join("")}([c,d]),Pt(a.g,String.fromCharCode(parseInt(c,16))),[];b=a.g;var e=null;switch(c){case 8:!Qt(b)||0>=b.g&&0>=b.h||(0>=b.g?(b.g=b.m-1,b.h--):b.g--,b.i[b.h][b.g]=null);break;case 13:b.isVisible()&&(e=St(b,d,a.i));b.h+1>=b.o?Rt(b):b.h++;b.g=0;break;case 14:b.isVisible()&&(e=St(b,d,a.i));b.i[b.h]=Ot();b.g=0;break;case 12:b.isVisible()&&
|
|
(e=St(b,d,a.i)),Nt(b),b.h=0,b.g=0}return e?[e]:[]}
|
|
function Zt(a,b,c,d){if(128<=c&&135>=c)d=c&7,a.h[d]&&(a.g=a.h[d]);else{if(136===c){c=Wt(b).value;b=[];c=t($t(a,c));for(var e=c.next();!e.done;e=c.next()){e=a.h[e.value];if(e.isVisible()){var f=St(e,d,a.i);f&&b.push(f)}Nt(e)}return b}if(137===c)for(b=Wt(b).value,b=t($t(a,b)),c=b.next();!c.done;c=b.next())c=a.h[c.value],c.isVisible()||(c.j=d),c.display();else{if(138===c){c=Wt(b).value;b=null;c=t($t(a,c));for(e=c.next();!e.done;e=c.next())e=a.h[e.value],e.isVisible()&&(b=St(e,d,a.i)),e.l=!1;return b?
|
|
[b]:[]}if(139===c){c=Wt(b).value;b=null;c=t($t(a,c));for(e=c.next();!e.done;e=c.next())e=a.h[e.value],e.isVisible()?b=St(e,d,a.i):e.j=d,e.l=!e.l;return b?[b]:[]}if(140===c)return b=Wt(b).value,au(a,b,d);if(143===c)return d=au(a,255,d),bu(a),d;if(144===c)b.skip(1),d=Wt(b).value,a.g&&(a.g.A=0<(d&128),a.g.C=0<(d&64));else if(145===c)d=Wt(b).value,c=Wt(b).value,b.skip(1),a.g&&(b=cu((c&48)>>4,(c&12)>>2,c&3),a.g.B=cu((d&48)>>4,(d&12)>>2,d&3),a.g.s=b);else if(146===c)d=Wt(b).value,b=Wt(b).value,a.g&&(a=
|
|
a.g,a.h=d&15,a.g=b&63);else if(151===c)b.skip(1),b.skip(1),d=Wt(b).value,b.skip(1),a.g&&(a.g.F=d&3);else if(152<=c&&159>=c){c=(c&15)-8;e=null!==a.h[c];e||(f=new Mt(c,a.i),f.j=d,a.h[c]=f);d=Wt(b).value;f=Wt(b).value;var g=Wt(b).value,h=Wt(b).value,k=Wt(b).value;b=Wt(b).value;e&&0===(b&7)||(b=a.h[c],b.h=0,b.g=0,b.C=!1,b.A=!1,b.B="white",b.s="black");b=a.h[c];b.l=0<(d&32);b.L=f&127;b.H=g;b.G=(h&240)>>4;b.K=0<(f&128);b.o=(h&15)+1;b.m=(k&63)+1;a.g=a.h[c]}}}return[]}
|
|
function $t(a,b){for(var c=[],d=0;8>d;d++)1===(b&1)&&a.h[d]&&c.push(d),b>>=1;return c}function au(a,b,c){var d=[];b=t($t(a,b));for(var e=b.next();!e.done;e=b.next()){e=e.value;var f=a.h[e];f.isVisible()&&(f=St(f,c,a.i))&&d.push(f);a.h[e]=null}return d}function bu(a){a.g=null;a.h=[null,null,null,null,null,null,null,null]}function cu(a,b,c){var d={0:0,1:0,2:1,3:1};a=d[a];b=d[b];c=d[c];return du[a<<2|b<<1|c]}
|
|
var eu=new Map([[32," "],[33,"\u00a0"],[37,"\u2026"],[42,"\u0160"],[44,"\u0152"],[48,"\u2588"],[49,"\u2018"],[50,"\u2019"],[51,"\u201c"],[52,"\u201d"],[53,"\u2022"],[57,"\u2122"],[58,"\u0161"],[60,"\u0153"],[61,"\u2120"],[63,"\u0178"],[118,"\u215b"],[119,"\u215c"],[120,"\u215d"],[121,"\u215e"],[122,"\u2502"],[123,"\u2510"],[124,"\u2514"],[125,"\u2500"],[126,"\u2518"],[127,"\u250c"]]),du="black blue green cyan red magenta yellow white".split(" ");function fu(){this.h=[];this.g=[];this.i=new Tt;this.l=0;this.m=new Map([["CC1",new Gt(0,0)],["CC2",new Gt(0,1)],["CC3",new Gt(1,0)],["CC4",new Gt(1,1)]]);this.s=this.o=0;this.j=new Map;this.B=!0;this.A=new Set;gu(this)}fu.prototype.clear=function(){this.l=0;this.h=[];this.g=[];var a=this.i;a.i=[];a.h=[];a.g=0;gu(this);a=t(this.j.values());for(var b=a.next();!b.done;b=a.next())bu(b.value)};
|
|
function gu(a){a.o=0;a.s=0;for(var b=t(a.m.values()),c=b.next();!c.done;c=b.next())c=c.value,c.h=0,c.g=c.j,c.m=null,wt(c.i),wt(c.j),wt(c.o);a.B=!0}
|
|
fu.prototype.extract=function(a,b){if(this.B){for(var c=t(this.m.values()),d=c.next();!d.done;d=c.next())d.value.l=b;this.B=!1}a=new Zg(a,0);if(!(8>a.getLength())&&181===a.X()&&49===a.Aa()&&1195456820===a.T()&&3===a.X()&&(c=a.X(),0!==(c&64)))for(c&=31,a.skip(1),d=0;d<c;d++){var e=a.X(),f=(e&4)>>2,g=a.X(),h=a.X();f&&(e&=3,0===e||1===e?this.h.push({pts:b,type:e,Ab:g,dc:h,order:this.h.length}):(this.g.push({pts:b,type:e,value:g,order:this.g.length}),this.g.push({pts:b,type:2,value:h,order:this.g.length})))}};
|
|
fu.prototype.decode=function(){function a(e,f){return e.pts-f.pts||e.order-f.order}var b=[];this.h.sort(a);this.g.sort(a);for(var c=t(this.h),d=c.next();!d.done;d=c.next())(d=hu(this,d.value))&&b.push(d);c=t(this.g);for(d=c.next();!d.done;d=c.next())Ut(this.i,d.value);c=t(this.i.i);for(d=c.next();!d.done;d=c.next())d=iu(this,d.value),b.push.apply(b,x(d));this.i.i=[];this.h=[];this.g=[];return b};
|
|
function hu(a,b){var c=b.type;if(16===(b.Ab&112)){var d=b.Ab>>3&1;0===c?a.o=d:a.s=d}d="CC"+((c<<1|(c?a.s:a.o))+1);c=a.m.get(d);if(255===b.Ab&&255===b.dc||!b.Ab&&!b.dc||!ju(b.Ab)||!ju(b.dc))return 45<=++a.l&&gu(a),null;a.l=0;b.Ab&=127;b.dc&=127;var e=b.Ab;if(1<=e&&15>=e||!b.Ab&&!b.dc)return null;e=null;if(16===(b.Ab&112))a:{a.A.add(d),d=b.Ab;a=b.dc;if(c.m===(d<<8|a))c.m=null;else if(c.m=d<<8|a,16===(d&240)&&64===(a&192)){b=[11,11,1,2,3,4,12,13,14,15,5,6,7,8,9,10][(d&7)<<1|a>>5&1];d="white";e=!1;var f=
|
|
null;var g=95<a?a-96:a-64;13>=g?d=Lt[Math.floor(g/2)]:15>=g?e=!0:f=Math.floor((g-16)/2);a=1===(a&1);4!==c.h&&(g=c.g,3===c.h&&b!==g.g&&(c=1+b-g.h,Ft(g,c,1+g.g-g.h,g.h),zt(g,0,c-1),zt(g,b+1,15-b)),g.g=b,g.m=a,g.j=e,g.l=d,g.s=f,g.o="black")}else if(17===(d&247)&&32===(a&240))c.g.m=!1,c.g.j=!1,c.g.l="white",At(c.g,0,32),d=!1,b=Lt[(a&14)>>1],"white_italics"===b&&(b="white",d=!0),c.g.m=1===(a&1),c.g.j=d,c.g.l=b;else if(16===(d&247)&&32===(a&240)||23===(d&247)&&45===(a&255))b="black",0===(d&7)&&(b=Kt[(a&
|
|
14)>>1]),c.g.o=b;else if(17===(d&247)&&48===(a&240))At(c.g,1,a);else if(18===(d&246)&&32===(a&224))At(c.g,d&1?3:2,a);else{if(20===(d&246)&&32===(a&240)){a=b.pts;d=null;switch(b.dc){case 32:It(c);break;case 33:c=c.g;c.i[c.g].pop();break;case 37:d=Ht(c,2,a);break;case 38:d=Ht(c,3,a);break;case 39:d=Ht(c,4,a);break;case 40:At(c.g,0,32);break;case 41:c.h=2;c.g=c.i;c.g.h=0;c.l=a;break;case 42:wt(c.o);Jt(c);break;case 43:Jt(c);break;case 44:b=c.i;d=null;4!==c.h&&(d=xt(b,c.l,a));zt(b,0,15);break;case 45:b=
|
|
c.g;3!==c.h?d=null:(d=xt(b,c.l,a),e=b.g-b.h+1,Ft(b,e-1,e,b.h),zt(b,0,e-1),zt(b,b.g,15-b.g),c.l=a);break;case 46:zt(c.j,0,15);break;case 47:b=null,4!==c.h&&(b=xt(c.i,c.l,a)),d=c.j,c.j=c.i,c.i=d,It(c),c.l=a,d=b}e=d;break a}(23==d||31==d)&&33<=a&&35>=a&&(c.g.A=a-32)}e=null}else a=b.dc,At(c.g,0,b.Ab),At(c.g,0,a);return e}
|
|
function iu(a,b){var c=[];try{for(;b.Fa();){var d=Wt(b).value,e=(d&224)>>5,f=d&31;7===e&&0!=f&&(e=Wt(b).value&63);if(0!=e){a.A.add("svc"+e);a.j.has(e)||a.j.set(e,new Xt(e));for(var g=a.j.get(e),h=b.Ma();b.Ma()-h<f;){e=g;var k=b,l=Wt(k),m=l.value,n=l.pts;if(16===m){var q=Wt(k);m=m<<16|q.value}if(0<=m&&31>=m)var r=Yt(e,k,m,n);else if(128<=m&&159>=m)r=Zt(e,k,m,n);else{if(4096<=m&&4127>=m)e=k,k=m&255,8<=k&&15>=k?e.skip(1):16<=k&&23>=k?e.skip(2):24<=k&&31>=k&&e.skip(3);else if(4224<=m&&4255>=m)e=k,k=m&
|
|
255,128<=k&&135>=k?e.skip(4):136<=k&&143>=k&&e.skip(5);else if(32<=m&&127>=m)k=m,e.g&&(127===k?Pt(e.g,"\u266a"):Pt(e.g,String.fromCharCode(k)));else if(160<=m&&255>=m)e.g&&Pt(e.g,String.fromCharCode(m));else if(4128<=m&&4223>=m){if(k=m&255,e.g)if(eu.has(k)){var u=eu.get(k);Pt(e.g,u)}else Pt(e.g,"_")}else 4256<=m&&4351>=m&&e.g&&(160!=(m&255)?Pt(e.g,"_"):Pt(e.g,"[CC]"));r=[]}c.push.apply(c,x(r))}}}}catch(w){if(w instanceof U&&3E3===w.code)cb("CEA708_INVALID_DATA","Buffer read out of bounds / invalid CEA-708 Data.");
|
|
else throw w;}return c}function ju(a){for(var b=0;a;)b^=a&1,a>>=1;return 1===b}fu.prototype.getStreams=function(){return Array.from(this.A)};T("shaka.cea.CeaDecoder",fu);Nc=function(){return new fu};function ku(a){for(var b=[],c=a,d=a=0;d<c.length;)2==a&&3==c[d]?(a=0,c=[].concat(x(c)),c.splice(d,1),c=new Uint8Array(c)):0==c[d]?a++:a=0,d++;a=c;for(d=0;d<a.length;){for(c=0;255==a[d];)c+=255,d++;c+=a[d++];for(var e=0;255==a[d];)e+=255,d++;e+=a[d++];4==c&&b.push(a.subarray(d,d+e));d+=e}return b};function lu(){this.j=new Map;this.i=this.h=0;this.g=mu}
|
|
lu.prototype.init=function(a){function b(f){f=f.name;nu.has(f)&&(c.g=nu.get(f))}var c=this,d=[],e=[];(new bh).box("moov",gh).box("mvex",gh).R("trex",function(f){var g=f.reader;g.skip(4);g.skip(4);f=g.T();g=g.T();c.h=f;c.i=g}).box("trak",gh).R("tkhd",function(f){var g=f.reader;f=f.version;1==f?(g.skip(8),g.skip(8)):(g.skip(4),g.skip(4));var h=g.T();1==f?g.skip(8):g.skip(4);g.skip(4);g.skip(8);g.skip(2);g.skip(2);g.skip(2);g.skip(2);g.skip(36);g.Aa();g.Aa();g.Aa();g.Aa();d.push(h)}).box("mdia",gh).R("mdhd",
|
|
function(f){f=Ai(f.reader,f.version);e.push(f.timescale)}).box("minf",gh).box("stbl",gh).R("stsd",ih).box("avc1",b).box("avc3",b).box("dvav",b).box("dva1",b).box("hev1",b).box("hvc1",b).box("dvh1",b).box("dvhe",b).box("vvc1",b).box("vvi1",b).box("dvc1",b).box("dvi1",b).box("encv",jh).box("sinf",gh).box("frma",function(f){f=Di(f.reader).codec;nu.has(f)&&(c.g=nu.get(f))}).parse(a,!0);if(!d.length||!e.length||d.length!=e.length)throw new U(2,2,2010);this.g==mu&&bb("Unable to determine bitstream format for CEA parsing!");
|
|
d.forEach(function(f,g){c.j.set(f,e[g])})};
|
|
lu.prototype.parse=function(a){var b=this;if(this.g==mu)return[];var c=[],d=0,e=[];(new bh).box("moof",function(f){d=f.start;e=[];gh(f)}).box("traf",function(f){e.push({baseMediaDecodeTime:null,Id:b.h,Jd:b.i,pi:[],timescale:9E4});gh(f)}).R("trun",function(f){var g=e[e.length-1];f=Bi(f.reader,f.version,f.flags);g.pi.push(f)}).R("tfhd",function(f){var g=e[e.length-1];f=yi(f.reader,f.flags);g.Id=f.Id||b.h;g.Jd=f.Jd||b.i;f=f.trackId;b.j.has(f)&&(g.timescale=b.j.get(f))}).R("tfdt",function(f){var g=e[e.length-
|
|
1];f=zi(f.reader,f.version);g.baseMediaDecodeTime=f.baseMediaDecodeTime}).box("mdat",function(f){for(var g=d-f.start-8,h=f.reader.Ma(),k=t(e),l=k.next();!l.done;l=k.next()){l=l.value;if(null===l.baseMediaDecodeTime)throw bb("Unable to find base media decode time for CEA captions!"),new U(2,2,2010);f.reader.seek(h);ou(b,f.reader,l.baseMediaDecodeTime,l.timescale,l.Id,l.Jd,g,l.pi,c)}}).parse(a,!1);return c};
|
|
function ou(a,b,c,d,e,f,g,h,k){var l=0,m=f,n=h.map(function(u){return u.$g});n=[].concat.apply([],x(n));n.length&&(m=n[0].sampleSize||f);for(b.skip(g+h[0].gg);b.Fa();){g=b.T();var q=b.X(),r=null;r=!1;h=1;switch(a.g){case pu:r=q&31;r=6==r;break;case qu:h=2;b.skip(1);r=q>>1&63;r=39==r||40==r;break;case ru:h=2;b.skip(1);r=q>>1&63;r=23==r||24==r;break;default:return}if(r)for(q=0,l<n.length&&(q=n[l].yf||0),q=(c+q)/d,h=t(ku(b.Sb(g-h))),r=h.next();!r.done;r=h.next())k.push({packet:r.value,pts:q});else try{b.skip(g-
|
|
h)}catch(u){break}m-=g+4;0==m&&(c=l<n.length?c+(n[l].ah||e):c+e,l++,l<n.length?m=n[l].sampleSize||f:m=f)}}T("shaka.cea.Mp4CeaParser",lu);var mu=0,pu=1,qu=2,ru=3,nu=(new Map).set("avc1",pu).set("avc3",pu).set("dvav",pu).set("dva1",pu).set("hev1",qu).set("hvc1",qu).set("dvh1",qu).set("dvhe",qu).set("vvc1",ru).set("vvi1",ru).set("dvc1",ru).set("dvi1",ru);Oc("video/mp4",function(){return new lu});function su(){this.g=null}su.prototype.init=function(){};su.prototype.parse=function(a){this.g?this.g.clearData():this.g=new ak;var b=[];a=Tb(a);if(!qk(a))return b;a=this.g.parse(a);var c=a.Ld(),d=a.We();a=[];switch(c.video){case "avc":a.push(6);break;case "hvc":a.push(39),a.push(40)}if(!a.length)return b;c=t(d);for(d=c.next();!d.done;d=c.next())if(d=d.value,a.includes(d.type)&&null!=d.time)for(var e=t(ku(d.data)),f=e.next();!f.done;f=e.next())b.push({packet:f.value,pts:d.time});return b};
|
|
T("shaka.cea.TsCeaParser",su);Oc("video/mp2t",function(){return new su});function tu(a){var b=0,c=Yb(a),d=c.getUint32(b,!0);if(d!=a.byteLength)return[];a:{a=b+6;for(b=[];a<c.byteLength-1;){d=c.getUint16(a,!0);a+=2;var e=c.getUint16(a,!0);a+=2;if(0!=(e&1)||e+a>c.byteLength){c=[];break a}var f=Tb(c,a,e);b.push({type:d,value:f});a+=e}c=b}return c}function uu(a){a=mc(rd(a));a=tu(a).filter(function(b){return b.type===vu})[0];if(!a)return null;a=bc(a.value,!0);return(a=jd(a,"WRMHEADER"))?a:null}
|
|
function wu(a){try{var b=uu(a);if(b)a:{for(var c=t(td(b,"DATA")),d=c.next();!d.done;d=c.next()){var e=d.value;if(e.children)for(var f=t(e.children),g=f.next();!g.done;g=f.next()){var h=g.value;if("LA_URL"==h.tagName){var k=rd(h);break a}}}k=""}else k="";return k}catch(l){return""}}var vu=1;function xu(a,b,c){var d=yu(a),e=null;a=[];var f=[],g=null,h=new Set(d.map(function(l){return l.keyId}));h.delete(null);var k="cenc";if(1<h.size)throw new U(2,4,4010);if(!b){f=d.filter(function(l){return"urn:mpeg:dash:sea:2012"==l.wd});if(1<f.length)throw new U(2,4,4050);f.length&&(g=zu(f[0]));(f=d.find(function(l){return"urn:mpeg:dash:mp4protection:2011"==l.wd}))&&f.encryptionScheme&&(k=f.encryptionScheme);f=d.filter(function(l){return"urn:mpeg:dash:mp4protection:2011"==l.wd?(e=l.init||e,!1):"urn:mpeg:dash:sea:2012"!=
|
|
l.wd});f.length&&(a=Au(e,k,f,c,h),0==a.length&&(a=[rc("",k,e)]))}if(d.length&&!g&&(b||!f.length))for(a=[],b=t(Object.values(c)),c=b.next();!c.done;c=b.next())c=c.value,"org.w3.clearkey"!=c&&a.push(rc(c,k,e));if(h=Array.from(h)[0]||null)for(k=t(a),b=k.next();!b.done;b=k.next())for(b=t(b.value.initData),c=b.next();!c.done;c=b.next())c.value.keyId=h;return{Kh:h,sm:e,drmInfos:a,Wf:g,Ph:!0}}
|
|
function Bu(a,b,c,d){var e=xu(a,c,d);if(b.Ph){a=1==b.drmInfos.length&&!b.drmInfos[0].keySystem;c=0==e.drmInfos.length;if(0==b.drmInfos.length||a&&!c)b.drmInfos=e.drmInfos;b.Ph=!1}else if(0<e.drmInfos.length&&(b.drmInfos=b.drmInfos.filter(function(f){return e.drmInfos.some(function(g){return g.keySystem==f.keySystem})}),0==b.drmInfos.length))throw new U(2,4,4008);return e.Kh||b.Kh}
|
|
function Cu(a){var b=vd(a.node,"https://dashif.org/CPS","Laurl");if(b&&(b=rd(b)))return b;if((b=vd(a.node,"urn:microsoft:playready","pro"))&&rd(b))return wu(b);if(a=vd(a.node,"urn:mpeg:cenc:2013","pssh"))if(a=rd(a)){b=mc(a);a=8;b=Yb(b);var c=b.getUint8(a);a+=20;0<c&&(a+=4+16*b.getUint32(a));a=Tb(b,a+4);a=kc(a);a=jd("<pro>"+a+"</pro>");return wu(a)}return""}
|
|
function Au(a,b,c,d,e){var f=[];c=t(c);for(var g=c.next();!g.done;g=c.next()){g=g.value;var h=d[g.wd];if(h){var k;if((k=vd(g.node,"urn:microsoft:playready","pro"))&&rd(k)){k=rd(k);k=mc(k);var l=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);k=[{initData:nh(k,l,new Set,0),initDataType:"cenc",keyId:g.keyId}]}else k=null;l=null;if("urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e"===g.wd){l=g;var m=e;if(0==m.size)l=null;else{var n=new Uint8Array([16,119,239,236,192,178,77,2,
|
|
172,227,60,30,82,226,251,75]),q=new Uint8Array([]);l=[{initData:nh(q,n,m,1),initDataType:"cenc",keyId:l.keyId}]}}k=rc(h,b,g.init||a||k||l);if(h=Du.get(h))k.licenseServerUri=h(g);f.push(k)}}return f}function yu(a){var b=[];a=t(a);for(var c=a.next();!c.done;c=a.next())(c=Eu(c.value))&&b.push(c);return b}
|
|
function Eu(a){var b=a.attributes.schemeIdUri,c=yd(a,"urn:mpeg:cenc:2013","default_KID"),d=wd(a,"urn:mpeg:cenc:2013","pssh").map(sd),e=a.attributes.value;if(!b)return null;b=b.toLowerCase();if(c&&(c=c.replace(/-/g,"").toLowerCase(),c.includes(" ")))throw new U(2,4,4009);var f=[];try{f=d.map(function(g){return{initDataType:"cenc",initData:mc(g),keyId:null}})}catch(g){throw new U(2,4,4007);}return{node:a,wd:b,keyId:c,init:0<f.length?f:null,encryptionScheme:e}}
|
|
function zu(a){if(!window.crypto||!window.crypto.subtle)throw bb("Web Crypto API is not available to decrypt AES-128. (Web Crypto only exists in secure origins like https)"),new U(2,4,4042);var b=vd(a.node,"urn:mpeg:dash:schema:sea:2012","SegmentEncryption");if(!b)throw new U(2,4,4051);if("urn:mpeg:dash:sea:aes128-cbc:2013"!=b.attributes.schemeIdUri)throw new U(2,4,4051);b=vd(a.node,"urn:mpeg:dash:schema:sea:2012","CryptoPeriod");if(!b)throw new U(2,4,4051);a=b.attributes.IV;b=hc(b.attributes.keyUriTemplate);
|
|
if(!a||!b)throw new U(2,4,4051);a=nc(a.substr(2));if(16!=a.byteLength)throw new U(2,4,4048);return{hk:b,iv:a}}
|
|
var Du=(new Map).set("com.apple.fps",function(a){if("apple"===window.shakaMediaKeysPolyfill)throw new U(2,4,4054);if(a=vd(a.node,"https://dashif.org/CPS","Laurl"))if(a=rd(a))return a;return""}).set("com.widevine.alpha",function(a){var b=vd(a.node,"https://dashif.org/CPS","Laurl");return b&&(b=rd(b))?b:(a=vd(a.node,"urn:microsoft","laurl"))?hc(a.attributes.licenseUrl)||"":""}).set("com.microsoft.playready",Cu).set("com.microsoft.playready.recommendation",Cu).set("com.microsoft.playready.software",
|
|
Cu).set("com.microsoft.playready.hardware",Cu).set("org.w3.clearkey",function(a){var b=vd(a.node,"https://dashif.org/CPS","Laurl");return b&&(b=rd(b))?b:(a=vd(a.node,"http://dashif.org/guidelines/clearKey","Laurl"))&&"EME-1.0"===a.attributes.Lic_type&&a&&(a=rd(a))?a:""});function Fu(a,b,c,d,e,f){var g=(new Map).set("RepresentationID",b).set("Number",c).set("SubNumber",d).set("Bandwidth",e).set("Time",f);return a.replace(/\$(RepresentationID|Number|SubNumber|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g,function(h,k,l,m){if("$$"==h)return"$";var n=g.get(k);if(null==n)return h;"RepresentationID"==k&&l&&(l=void 0);"Time"==k&&"bigint"!=typeof n&&(.2<=Math.abs(n-Math.round(n))&&bb("Calculated $Time$ values must be close to integers"),n=Math.round(n));switch(m){case void 0:case "d":case "i":case "u":h=
|
|
n.toString();break;case "o":h=n.toString(8);break;case "x":h=n.toString(16);break;case "X":h=n.toString(16).toUpperCase();break;default:h=n.toString()}l=window.parseInt(l,10)||1;return Array(Math.max(0,l-h.length)+1).join("0")+h})}
|
|
function Gu(a,b){var c=Hu(a,b,"timescale"),d=1;c&&(d=Ed(c)||1);c=Hu(a,b,"duration");var e=(c=Ed(c||""))?c/d:null,f=Hu(a,b,"startNumber"),g=Number(Hu(a,b,"presentationTimeOffset"))||0,h=Fd(f||"");if(null==f||null==h)h=1;f=null;if(b=Iu(a,b,"SegmentTimeline")){b=qd(b,"S");f=d;a=a.na.duration||Infinity;for(var k=h,l=[],m=-g,n=0;n<b.length;++n){var q=b[n],r=b[n+1],u=xd(q,"t",Fd),w=xd(q,"d",Fd),v=xd(q,"r",Dd);q=xd(q,"k",Dd)||0;null!=u&&(u-=g);if(w){u=null!=u?u:m;v=v||0;if(0>v)if(r){r=xd(r,"t",Fd);if(null==
|
|
r)break;else if(u>=r)break;v=Math.ceil((r-u)/w)-1}else{if(Infinity==a)break;else if(u/f>=a)break;v=Math.ceil((a*f-u)/w)-1}0<l.length&&u!=m&&(l[l.length-1].end=u/f);for(r=0;r<=v;++r)m=u+w,l.push({start:u/f,end:m/f,xh:u,Zb:q,Kk:l.length+k}),u=m}}f=l}return{timescale:d,Ef:c,gb:e,fe:h,$b:g/d||0,wh:g,timeline:f}}function Ju(a,b){return[b(a.J),b(a.ma),b(a.ra)].filter(cf)}function Hu(a,b,c){b=Ju(a,b);a=null;b=t(b);for(var d=b.next();!d.done&&!(a=d.value.attributes[c]);d=b.next());return a}
|
|
function Iu(a,b,c){b=Ju(a,b);a=null;b=t(b);for(var d=b.next();!d.done&&!(a=ud(d.value,c));d=b.next());return a}
|
|
function Ku(a,b,c,d,e,f){for(var g=yd(a,"http://www.w3.org/1999/xlink","href"),h=yd(a,"http://www.w3.org/1999/xlink","actuate")||"onRequest",k=t(Object.keys(a.attributes)),l=k.next();!l.done;l=k.next()){l=l.value;var m=l.split(":"),n=ld("http://www.w3.org/1999/xlink");m[0]==n&&delete a.attributes[l]}if(5<=f)return vg(new U(2,4,4028));if("onLoad"!=h)return vg(new U(2,4,4027));var q=qc([d],[g]);return e.request(0,Lg(q,b)).Va(function(r){r=hd(r.data,a.tagName);if(!r)return vg(new U(2,4,4001,g));for(a.children=
|
|
[];r.children.length;){var u=r.children.shift();a.children.push(u)}u=t(Object.keys(r.attributes));for(var w=u.next();!w.done;w=u.next())w=w.value,a.attributes[w]=r.attributes[w];return Lu(a,b,c,q[0],e,f+1)})}
|
|
function Lu(a,b,c,d,e,f){f=void 0===f?0:f;if(yd(a,"http://www.w3.org/1999/xlink","href")){var g=Ku(a,b,c,d,e,f);c&&(g=g.Va(void 0,function(){return Lu(a,b,c,d,e,f)}));return g}g=[];for(var h=t(pd(a)),k=h.next(),l={};!k.done;l={Fd:void 0},k=h.next())l.Fd=k.value,"urn:mpeg:dash:resolve-to-zero:2013"==yd(l.Fd,"http://www.w3.org/1999/xlink","href")?a.children=a.children.filter(function(m){return function(n){return n!==m.Fd}}(l)):"SegmentTimeline"!=l.Fd.tagName&&g.push(Lu(l.Fd,b,c,d,e,f));return zg(g).Va(function(){return a})}
|
|
;function Mu(a,b,c,d,e,f,g){var h,k=(new bh).R("sidx",function(l){h=Nu(b,d,e,f,g,c,l)});a&&k.parse(a);if(h)return h;throw new U(2,3,3004);}
|
|
function Nu(a,b,c,d,e,f,g){var h=[];g.reader.skip(4);var k=g.reader.T();if(0==k)throw new U(2,3,3005);if(0==g.version){var l=g.reader.T();var m=g.reader.T()}else l=g.reader.ud(),m=g.reader.ud();g.reader.skip(2);var n=g.reader.Aa();a=a+g.size+m;for(m=0;m<n;m++){var q=g.reader.T(),r=(q&2147483648)>>>31;q&=2147483647;var u=g.reader.T();g.reader.skip(4);if(1==r)throw new U(2,3,3006);h.push(new qj(l/k+c,(l+u)/k+c,function(){return f},a,a+q-1,b,c,d,e));l+=u;a+=q}g.parser.stop();return h};function Ou(a){this.h=Yb(a);this.g=new Zg(this.h,0)}Ou.prototype.Fa=function(){return this.g.Fa()};
|
|
function Pu(a){var b=Qu(a);if(7<b.length)throw new U(2,3,3002);var c=0;b=t(b);for(var d=b.next();!d.done;d=b.next())c=256*c+d.value;b=Qu(a);a:{d=t(Ru);for(var e=d.next();!e.done;e=d.next())if(Sb(b,new Uint8Array(e.value))){d=!0;break a}d=!1}if(d)b=a.h.byteLength-a.g.Ma();else{if(8==b.length&&b[1]&224)throw new U(2,3,3001);for(e=d=0;e<b.length;e++){var f=b[e];d=0==e?f&(1<<8-b.length)-1:256*d+f}b=d}b=a.g.Ma()+b<=a.h.byteLength?b:a.h.byteLength-a.g.Ma();d=Yb(a.h,a.g.Ma(),b);a.g.skip(b);return new Su(c,
|
|
d)}function Qu(a){var b=a.g.Ma(),c=a.g.X();if(0==c)throw new U(2,3,3002);c=8-Math.floor(Math.log2(c));a.g.skip(c-1);return Tb(a.h,b,c)}var Ru=[[255],[127,255],[63,255,255],[31,255,255,255],[15,255,255,255,255],[7,255,255,255,255,255],[3,255,255,255,255,255,255],[1,255,255,255,255,255,255,255]];function Su(a,b){this.id=a;this.g=b}
|
|
function Tu(a){if(8<a.g.byteLength)throw new U(2,3,3002);if(8==a.g.byteLength&&a.g.getUint8(0)&224)throw new U(2,3,3001);for(var b=0,c=0;c<a.g.byteLength;c++){var d=a.g.getUint8(c);b=256*b+d}return b};function Uu(a,b,c,d,e,f,g,h,k){function l(){return e}var m=[];a=new Ou(a.g);for(var n=null,q=null;a.Fa();){var r=Pu(a);if(187==r.id){var u=Vu(r);u&&(r=c*u.Yk,u=b+u.Ck,null!=n&&m.push(new qj(n+g,r+g,l,q,u-1,f,g,h,k)),n=r,q=u)}}null!=n&&m.push(new qj(n+g,d+g,l,q,null,f,g,h,k));return m}
|
|
function Vu(a){var b=new Ou(a.g);a=Pu(b);if(179!=a.id)throw new U(2,3,3013);a=Tu(a);b=Pu(b);if(183!=b.id)throw new U(2,3,3012);b=new Ou(b.g);for(var c=0;b.Fa();){var d=Pu(b);if(241==d.id){c=Tu(d);break}}return{Yk:a,Ck:c}};function Wu(a,b,c){b=Iu(a,b,"Initialization");if(!b)return null;var d=a.J.cb(),e=b.attributes.sourceURL;e&&(d=qc(d,[hc(e)],a.Jb()));e=0;var f=null;if(b=xd(b,"range",Cd))e=b.start,f=b.end;c=new oj(function(){return d},e,f,Xu(a),null,null,c,a.ma.encrypted);c.codecs=a.J.codecs;c.mimeType=a.J.mimeType;a.na&&(c.g=a.na.start+a.na.duration);return c}
|
|
function Yu(a,b,c){var d=Number(Hu(a,Zu,"presentationTimeOffset"))||0,e=Hu(a,Zu,"timescale"),f=1;e&&(f=Ed(e)||1);var g=d/f||0,h=Wu(a,Zu,c);$u(a,h);var k=fd(a);return{endTime:-1,timeline:-1,Jc:function(){var l=Iu(k,Zu,"RepresentationIndex");var m=k.J.cb();l&&(l=hc(l.attributes.sourceURL))&&(m=qc(m,[l],k.Jb()));l=av(k);return bv(k,b,h,m,l.start,l.end,g)},timescale:f}}
|
|
function bv(a,b,c,d,e,f,g){var h,k,l,m,n,q,r,u,w,v,y,z,A,B,E,H,C,D;return Q(function(I){if(1==I.g)return h=a.presentationTimeline,k=!a.hc||!a.na.ai,l=a.na.start,m=a.na.duration,n=a.J.mimeType.split("/")[1],q=b,r=null,u=[q(d,e,f,!1),"webm"==n?q(c.O(),c.startByte,c.endByte,!0):null],q=null,F(I,Promise.all(u),2);w=I.h;v=w[0];y=w[1]||null;z=null;A=l-g;B=l;E=m?l+m:Infinity;if("mp4"==n)var L=Mu(v,e,d,c,A,B,E);else{L=v;var K=new Ou(y);if(440786851!=Pu(K).id)throw new U(2,3,3008);var J=Pu(K);if(408125543!=
|
|
J.id)throw new U(2,3,3009);K=J.g.byteOffset;J=new Ou(J.g);for(var M=null;J.Fa();){var O=Pu(J);if(357149030==O.id){M=O;break}}if(!M)throw new U(2,3,3010);M=new Ou(M.g);O=1E6;for(J=null;M.Fa();){var N=Pu(M);if(2807729==N.id)O=Tu(N);else if(17545==N.id)if(4==N.g.byteLength)J=N.g.getFloat32(0);else if(8==N.g.byteLength)J=N.g.getFloat64(0);else throw new U(2,3,3003);}if(null==J)throw new U(2,3,3011);M=O/1E9;J*=M;L=Pu(new Ou(L));if(475249515!=L.id)throw new U(2,3,3007);L=Uu(L,K,M,J,d,c,A,B,E)}z=L;H=t(z);
|
|
for(C=H.next();!C.done;C=H.next())D=C.value,D.codecs=a.J.codecs,D.mimeType=a.J.mimeType,D.bandwidth=a.bandwidth;h.Xd(z);r=new Cl(z);k&&r.gd(B,E,!0);return I.return(r)})}function Zu(a){return a.xd}function av(a){var b=Iu(a,Zu,"RepresentationIndex");a=Hu(a,Zu,"indexRange");a=Cd(a||"");b&&(a=xd(b,"range",Cd,a));return a}function $u(a,b){cv(a,b);if(!av(a))throw new U(2,4,4002);}
|
|
function cv(a,b){var c=a.J.mimeType.split("/")[1];if(a.J.contentType!=wc&&"mp4"!=c&&"webm"!=c)throw new U(2,4,4006);if("webm"==c&&!b)throw new U(2,4,4005);}
|
|
function Xu(a){var b=a.J;return{bandwidth:a.bandwidth,audioSamplingRate:b.audioSamplingRate,codecs:b.codecs,contentType:b.contentType,frameRate:b.frameRate||null,height:b.height||null,mimeType:b.mimeType,channelsCount:b.mf,pixelAspectRatio:b.pixelAspectRatio||null,width:b.width||null,label:a.ma.label||null,roles:a.roles||null,language:a.ma.language||null}};function dv(a,b,c){var d=Wu(a,ev,c),e=fv(a);if(!e.gb&&!e.timeline&&1<e.od.length)throw new U(2,4,4002);if(!e.gb&&!a.na.duration&&!e.timeline&&1==e.od.length)throw new U(2,4,4002);if(e.timeline&&0==e.timeline.length)throw new U(2,4,4002);var f=null,g=null;a.ra.id&&a.J.id&&(g=b.get(a.ra.id+","+a.J.id))&&(f=g.segmentIndex);var h=gv(a.na.start,a.na.duration,a.J.cb,e,d,c,a.J.mimeType,a.J.codecs,a.bandwidth,a.Jb);b=!f;f?f.Vd(h,a.presentationTimeline.Eb()):f=new Cl(h);a.presentationTimeline.Xd(h);a.hc&&
|
|
a.na.ai||f.gd(a.na.start,a.na.duration?a.na.start+a.na.duration:Infinity,b);g&&(g.segmentIndex=f);return{endTime:-1,timeline:-1,Jc:function(){f&&0!=f.getNumReferences()||f.hf(h);return Promise.resolve(f)},timescale:e.timescale}}function ev(a){return a.pc}function fv(a){var b=hv(a);a=Gu(a,ev);var c=a.fe;0==c&&(c=1);var d=0;a.gb?d=a.gb*(c-1):a.timeline&&0<a.timeline.length&&(d=a.timeline[0].start);return{gb:a.gb,startTime:d,fe:c,$b:a.$b,timescale:a.timescale,timeline:a.timeline,od:b}}
|
|
function gv(a,b,c,d,e,f,g,h,k,l){var m=d.od.length;d.timeline&&d.timeline.length!=d.od.length&&(m=Math.min(d.timeline.length,d.od.length));for(var n=a-d.$b,q=b?a+b:Infinity,r=[],u=d.startTime,w={},v=0;v<m;w={Gf:void 0,zf:void 0},v++){w.zf=d.od[v];var y=u;u=void 0;u=null!=d.gb?y+d.gb:d.timeline?d.timeline[v].end:y+b;w.Gf=null;w=new qj(a+y,a+u,function(z){return function(){null==z.Gf&&(z.Gf=qc(c(),[z.zf.pk],l()));return z.Gf}}(w),w.zf.start,w.zf.end,e,n,a,q,[],"",null,null,rj,f);w.codecs=h;w.mimeType=
|
|
g;w.bandwidth=k;r.push(w)}return r}function hv(a){return[a.J.pc,a.ma.pc,a.ra.pc].filter(cf).map(function(b){return qd(b,"SegmentURL")}).reduce(function(b,c){return 0<b.length?b:c}).map(function(b){b.attributes.indexRange&&!a.Dg&&(a.Dg=!0);var c=hc(b.attributes.media);b=xd(b,"mediaRange",Cd,{start:0,end:null});return{pk:c,start:b.start,end:b.end}})};function iv(a,b,c,d,e,f,g,h,k,l){k||a.J.Ye||(a.J.Ye=Hu(a,jv,"initialization"));var m=a.J.Ye?kv(a,g):null,n=lv(a);mv(n);var q=fd(a);if(n.Sd)return cv(a,m),{endTime:-1,timeline:-1,Jc:function(){var y=Fu(n.Sd,q.J.originalId,null,null,q.bandwidth||null,null);y=qc(q.J.cb(),[y]);return bv(q,b,m,y,0,null,n.$b)},timescale:n.timescale};if(n.gb)return d||"image"===a.ma.contentType||"text"===a.ma.contentType||(d=a.na.start,l=a.ra.id,c=a.na.duration,l=(l=null!=l&&f.get(l)||c)?d+l:Infinity,a.presentationTimeline.Lg(n.gb),
|
|
a.presentationTimeline.ni(d,l)),{endTime:-1,timeline:-1,Jc:function(){return nv(q,n,e,m,f,g,h,a.J.Af)},timescale:n.timescale};var r=null;d=d=null;a.ra.id&&a.J.id&&(d=a.ra.id+","+a.J.id,d=c.get(d))&&(r=d.segmentIndex);var u=a.na.start,w=a.na.duration?u+a.na.duration:Infinity;if(r)l=r,ov(l,n,u,w,m),l.$a(a.presentationTimeline.Eb());else{c=0;k=-1;if(null!=a.ra.id&&null!=a.J.id){var v=l.get(a.ra.id);if(v)k=v.timeline;else for(l=t(l.values()),v=l.next();!v.done;v=l.next())if(v=v.value,Math.abs(n.$b-v.endTime)<=
|
|
zc&&v.Vg.includes(a.J.id)){k=v.timeline;break}else v.timeline>=c&&(c=v.timeline+1)}-1==k&&(k=c);r=new pv(n,a.J.originalId,a.bandwidth,a.J.cb,a.Jb,u,w,m,g,a.J.Af,k)}n.timeline&&"image"!==a.ma.contentType&&"text"!==a.ma.contentType&&a.presentationTimeline.oi(r.h?r.h.timeline:[],u);d&&a.hc&&(d.segmentIndex=r);d=(d=(d=n.timeline)&&d[d.length-1])?d.end+n.$b:-1;l=-1;r instanceof pv&&(l=r.Oe());return{endTime:d,timeline:l,Jc:function(){r instanceof pv&&0==r.getNumReferences()&&ov(r,n,u,w,m);return Promise.resolve(r)},
|
|
timescale:n.timescale}}function jv(a){return a.Cc}function lv(a){var b=Gu(a,jv),c=Hu(a,jv,"media"),d=Hu(a,jv,"index"),e=Hu(a,jv,"k"),f=0;e&&(f=parseInt(e,10));return{Ef:b.Ef,gb:b.gb,timescale:b.timescale,fe:b.fe,$b:b.$b,wh:b.wh,timeline:b.timeline,Ac:c&&hc(c),Sd:d,mimeType:a.J.mimeType,codecs:a.J.codecs,bandwidth:a.bandwidth,qk:f}}
|
|
function mv(a){var b=a.Sd?1:0;b+=a.timeline?1:0;b+=a.gb?1:0;if(0==b)throw new U(2,4,4002);1!=b&&(a.Sd&&(a.timeline=null),a.Ef=null,a.gb=null);if(!a.Sd&&!a.Ac)throw new U(2,4,4002);}
|
|
function nv(a,b,c,d,e,f,g,h){function k(J){var M=J-v,O=M*w,N=b.Ef,P=M*N;"BigInt"in window&&P>Number.MAX_SAFE_INTEGER&&(P=BigInt(M)*BigInt(N));O+=q;M=O+w;N=Math.min(M,m());var R=[],S=b.qk;if(S)for(var aa=(N-O)/S,W={},Fa=0;Fa<S;W={Oi:void 0},Fa++){var Ga=O+aa*Fa,xa=Ga+aa;W.Oi=Fa+1;W=new qj(Ga,xa,function(qa){return function(){var Da=Fu(y,A,J,qa.Oi,z,P);return qc(B(),[Da],E())}}(W),0,null,d,H,q,m(),[],"",null,null,rj,f);W.codecs=a.J.codecs;W.mimeType=a.J.mimeType;0==h?0<Fa&&W.md():0!=Fa%h&&W.md();R.push(W)}O=
|
|
new qj(O,N,function(){if(S)return[];var qa=Fu(y,A,J,null,z,P);return qc(B(),[qa],E())},0,null,d,H,q,m(),R,"",null,null,rj,f,0<R.length);O.codecs=a.J.codecs;O.mimeType=a.J.mimeType;O.bandwidth=a.bandwidth;O.j=M;return O}function l(){var J=[Math.max(n.Eb(),q),Math.min(n.vc(),m())].map(function(M){return M-q});J=[Math.ceil(J[0]/w),Math.ceil(J[1]/w)-1];a.J.pb&&J[1]++;return J.map(function(M){return M+v})}function m(){var J=null!=r&&e.get(r)||u;return J?q+J:Infinity}var n=a.presentationTimeline,q=a.na.start,
|
|
r=a.ra.id,u=a.na.duration,w=b.gb,v=b.fe,y=b.Ac,z=a.bandwidth||null,A=a.J.id,B=a.J.cb,E=a.Jb,H=q-b.$b,C=l();c=a.hc?Math.max(C[0],C[1]-c+1):C[0];g=g||C[1];C=[];for(var D=c;D<=g;++D){var I=k(D);C.push(I)}var L=new Cl(C);C=n.vc()<m();D=n.V();if(C||D){var K=Math.max(c,g+1);c=w;a.J.pb&&(c=.1);L.Ff(c,function(){var J=n.Eb();L.$a(J);var M=t(l());M.next();M=M.next().value;for(var O=[];K<=M;){var N=k(K);O.push(N);K++}return J>m()&&!O.length?null:O})}return Promise.resolve(L)}
|
|
function kv(a,b){var c=a.J.Ye;c||(c=Hu(a,jv,"initialization"));if(!c)return null;c=hc(c);var d=a.J.originalId,e=a.bandwidth||null,f=a.J.cb,g=a.Jb;b=new oj(function(){var h=Fu(c,d,null,null,e,null);return qc(f(),[h],g())},0,null,Xu(a),null,null,b,a.ma.encrypted);b.codecs=a.J.codecs;b.mimeType=a.J.mimeType;a.na&&(b.g=a.na.start+a.na.duration);return b}
|
|
function pv(a,b,c,d,e,f,g,h,k,l,m){Cl.call(this,[]);this.h=a;this.F=b;this.B=c;this.C=d;this.H=e;this.j=f;this.l=g;this.s=h;this.A=k;this.G=l;this.I=m;qv(this)}pa(pv,Cl);p=pv.prototype;p.getNumReferences=function(){return this.h?this.h.timeline.length:0};p.release=function(){Cl.prototype.release.call(this);this.h=null};
|
|
p.$a=function(a){if(this.h){for(var b=0,c=this.h.timeline,d=0;d<c.length;d+=1)if(c[d].end+this.j<=a)b+=1;else break;0<b&&(this.h.timeline=c.slice(b),this.g.length>=b&&(this.g=this.g.slice(b)),this.i+=b,0===this.getNumReferences()&&this.release())}};
|
|
function ov(a,b,c,d,e){rv(a,e);if(a.h){c=a.h.timeline;a.h.Ac!==b.Ac&&(a.h.Ac=b.Ac);if(c.length){var f=c[c.length-1];b=b.timeline.filter(function(g){return g.end>f.end})}else b=b.timeline.slice();0<b.length&&a.h.timeline.push.apply(a.h.timeline,x(b));a.l!==d&&(a.l=d)}else a.h=b,a.j=c,a.l=d;qv(a)}function rv(a,b){if(a.s!==b){a.s=b;a=t(a.g);for(var c=a.next();!c.done;c=a.next())(c=c.value)&&tj(c,b)}}
|
|
function qv(a){if(a.h&&!a.o){for(var b=[],c=t(a.h.timeline),d=c.next();!d.done;d=c.next())d=d.value,d.start>=a.l||0>=d.end||b.push(d);a.h.timeline=b;a.$a(a.j)}}
|
|
p.find=function(a){if(this.h&&this.h.timeline&&this.h.timeline.length&&a<this.h.timeline[0].start+this.j)return this.i;if(!this.h)return null;var b=this.h.timeline;if(a<this.j||a>=this.l)return null;for(var c=b.length-1,d=0;d<b.length;d++){var e=b[d],f=e.start+this.j;e=d<c?b[d+1].start+this.j:Infinity===this.l?e.end+this.j:this.l;if(a>=f&&a<e)return d+this.i}return null};
|
|
p.get=function(a){var b=this;a-=this.i;if(0>a||a>=this.getNumReferences()||!this.h)return null;var c=this.g[a];if(!c){var d=this.h.timeline[a],e=d.Kk,f=d.xh+this.h.wh;c=this.j-this.h.$b;var g=this.j+d.end,h=g;a===this.getNumReferences()-1&&Infinity!==this.l&&(h=.1<Math.abs(h-this.l)?Math.min(h,this.l):this.l);for(var k=this.h.codecs,l=this.h.mimeType,m=this.h.bandwidth,n=[],q=(d.end-d.start)/d.Zb,r={},u=0;u<d.Zb;r={Hf:void 0,Pi:void 0},u++){var w=d.start+q*u,v=w+q;r.Pi=u+1;r.Hf=null;r=new qj(this.j+
|
|
w,this.j+v,function(y){return function(){if(!b.h)return[];null==y.Hf&&(y.Hf=sv(b.h.Ac,b.F,e,b.B,f,y.Pi,b.C,b.H));return y.Hf}}(r),0,null,this.s,c,this.j,this.l,[],"",null,null,rj,this.A);r.codecs=k;r.mimeType=l;r.bandwidth=m;0==this.G?0<u&&r.md():0!=u%this.G&&r.md();n.push(r)}c=new qj(this.j+d.start,h,function(){return 0<d.Zb||!b.h?[]:sv(b.h.Ac,b.F,e,b.B,f,null,b.C,b.H)},0,null,this.s,c,this.j,this.l,n,"",null,null,rj,this.A,0<d.Zb);c.codecs=k;c.mimeType=l;c.j=g;c.bandwidth=m;this.g[a]=c}return c};
|
|
p.Cb=function(a){qv(this);for(var b=0;b<this.getNumReferences();b++){var c=this.get(b+this.i);c&&a(c)}};function sv(a,b,c,d,e,f,g,h){a=Fu(a,b,c,f,d||null,e);return qc(g(),[a],h()).map(function(k){return k.toString()})}p.Oe=function(){return this.I};function tv(a){this.o=null;this.A=a;this.G=new Eg;this.i=[];this.h=null;this.m=[];this.B=null;this.F=[];this.C=300;this.l=new Map;this.j=new Map;this.g=null;this.s="UNKNOWN"}tv.prototype.configure=function(a){this.o=a};tv.prototype.destroy=function(){this.A=this.o=null;this.i=[];this.h=null;this.m=[];this.F=[];this.l.clear();null!=this.g&&(this.g.stop(),this.g=null);return this.G.destroy()};tv.prototype.setManifestType=function(a){this.s=a};
|
|
function uv(a,b){var c,d,e,f,g,h,k;return Q(function(l){if(1==l.g)return c=qc(a.i,[vv(a,b)]),d=Lg(c,a.o.retryParameters),e=a.A.networkingEngine.request(8,d),Fg(a.G,e),wa(l,2),F(l,e.promise,4);if(2!=l.g)return f=l.h,g=ac(f.data),h=JSON.parse(g),1==h.VERSION&&wv(a,h,f.uri),za(l,0);if((k=Aa(l))&&7001==k.code)return l.return();null!=a.g&&(a.g.stop(),a.g=null);a.g=new $e(function(){uv(a,b)});a.g.ha(a.C);G(l)})}
|
|
function vv(a,b){if(!a.m.length)return b;b=new Bb(b);var c=a.B||a.m[0],d=Math.round(a.A.getBandwidthEstimate()),e=b.g;"DASH"==a.s?(e.add("_DASH_pathway",c),e.add("_DASH_throughput",String(d))):"HLS"==a.s&&(e.add("_HLS_pathway",c),e.add("_HLS_throughput",String(d)));Qb(e)&&Fb(b,e);return b.toString()}function wv(a,b,c){null!=a.g&&(a.g.stop(),a.g=null);var d=b["RELOAD-URI"]||c;a.g=new $e(function(){uv(a,d)});if(c=b.TTL)a.C=c;a.g.ha(a.C);a.m=b["PATHWAY-PRIORITY"]||[];a.F=b["PATHWAY-CLONES"]||[]}
|
|
function xv(a,b,c,d){var e=a.l.get(b);e||(e=new Map);e.set(c,d);a.l.set(b,e)}tv.prototype.banLocation=function(a){this.j.set(a,Date.now()+6E4)};
|
|
function yv(a,b,c){c=void 0===c?!1:c;b=a.l.get(b)||new Map;for(var d=[],e=t(a.m),f=e.next(),g={};!f.done;g={qd:void 0},f=e.next())if(g.qd=f.value,f=b.get(g.qd))d.push({Qg:g.qd,location:f});else if(f=a.F.find(function(k){return function(l){return l.El==k.qd}}(g))){var h=b.get(f["BASE-ID"]);h&&(f["URI-REPLACEMENT"].Zi?(h=new Bb(h),Db(h,f["URI-REPLACEMENT"].Zi),d.push({Qg:g.qd,location:h.toString()})):d.push({Qg:g.qd,location:h}))}e=Date.now();g=t(a.j.keys());for(f=g.next();!f.done;f=g.next())f=f.value,
|
|
h=a.j.get(f),e>h&&a.j.delete(f);d=d.filter(function(k){for(var l=t(a.j.keys()),m=l.next();!m.done;m=l.next())if(m.value.includes((new Bb(k.location)).Bb))return!1;return!0});d.length&&(a.B=d[0].Qg);d=d.map(function(k){return k.location});if(!d.length&&a.h)for(e=t(a.h.split(",")),g=e.next();!g.done;g=e.next())if(g=b.get(g.value))a.B=a.h,d.push(g);if(!d.length)for(b=t(b.values()),e=b.next();!e.done;e=b.next())d.push(e.value);return c?d:qc(a.i,d)};function zv(){this.l=[];this.h=[];this.g=[];this.j=[];this.i=[];this.s=this.o=!1;this.m=new Set}p=zv.prototype;p.release=function(){for(var a=t(this.h.concat(this.g,this.j,this.i)),b=a.next();!b.done;b=a.next())b=b.value,b.segmentIndex&&b.segmentIndex.release();this.h=[];this.g=[];this.j=[];this.i=[];this.l=[];this.s=this.o=!1;this.m.clear()};p.Tj=function(){return this.l};p.Bg=function(){return this.j.slice()};p.yj=function(){return this.i};
|
|
p.Lh=function(a,b){if(a){if("audio"==a.type)for(var c=t(this.h),d=c.next();!d.done;d=c.next())d=d.value,d.matchedStreams=d.matchedStreams.filter(function(e){return e!==a});else if("video"==a.type)for(c=t(this.g),d=c.next();!d.done;d=c.next())d=d.value,d.matchedStreams=d.matchedStreams.filter(function(e){return e!==a}),d.trickModeVideo&&(d.trickModeVideo.matchedStreams=d.trickModeVideo.matchedStreams.filter(function(e){return e!==a})),d.dependencyStream&&(d.dependencyStream.matchedStreams=d.dependencyStream.matchedStreams.filter(function(e){return e!==
|
|
a}));else if(a.type==wc)for(c=t(this.j),d=c.next();!d.done;d=c.next())d=d.value,d.matchedStreams=d.matchedStreams.filter(function(e){return e!==a});else if("image"==a.type)for(c=t(this.i),d=c.next();!d.done;d=c.next())d=d.value,d.matchedStreams=d.matchedStreams.filter(function(e){return e!==a});a.segmentIndex&&a.closeSegmentIndex();this.m.delete(b)}};
|
|
function Av(a,b){var c=[],d=[],e=[],f=[];a=t(a);for(var g=a.next();!g.done;g=a.next()){var h=g.value;g=new Map(h.audioStreams.map(function(n){return[Bv(n),n]}));var k=new Map(h.videoStreams.map(function(n){return[Cv(n),n]})),l=new Map(h.textStreams.map(function(n){return[Dv(n),n]}));h=new Map(h.imageStreams.map(function(n){return[Ev(n),n]}));if(b){var m=Fv(wc);l.set(Dv(m),m);m=Fv("image");h.set(Ev(m),m)}c.push(g);d.push(k);e.push(l);f.push(h)}return{Eh:c,Xi:d,Ui:e,Yh:f}}
|
|
p.$f=function(a,b,c){c=void 0===c?!1:c;var d=this,e,f,g,h,k,l,m,n,q,r,u,w,v,y,z,A,B,E,H,C,D,I,L,K,J,M,O,N,P,R,S,aa;return Q(function(W){if(1==W.g){e=yc;if(!b&&1==a.length)return f=Av(a,!1),g=f.Eh,h=f.Xi,k=f.Ui,l=f.Yh,d.h=Array.from(g[0].values()),d.g=Array.from(h[0].values()),d.j=Array.from(k[0].values()),d.i=Array.from(l[0].values()),W.u(2);m=c?d.m.size:0;n=-1;for(q=0;q<a.length;q++)r=a[q],d.m.has(r.id)||(d.m.add(r.id),-1==n&&(n=q));if(-1==n)return W.return();u=Av(a,!0);w=u.Eh;v=u.Xi;y=u.Ui;z=u.Yh;
|
|
return F(W,Promise.all([Gv(d,d.h,w,n,Hv,Iv,m),Gv(d,d.g,v,n,Hv,Iv,m),Gv(d,d.j,y,n,Hv,Iv,m),Gv(d,d.i,z,n,Hv,Iv,m)]),2)}A=0;B=[];if(d.g.length&&d.h.length)for(K=t(d.h),J=K.next();!J.done;J=K.next())for(M=J.value,O=t(d.g),N=O.next();!N.done;N=O.next())P=N.value,R=lg(M.drmInfos,P.drmInfos),M.drmInfos.length&&P.drmInfos.length&&!R.length||(S=(M.bandwidth||0)+(P.bandwidth||0),M.dependencyStream&&(S+=M.dependencyStream.bandwidth||0),P.dependencyStream&&(S+=P.dependencyStream.bandwidth||0),aa=A++,B.push({id:aa,
|
|
language:M.language,disabledUntilTime:0,primary:M.primary,audio:M,video:P,bandwidth:S,drmInfos:R,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]}));else for(E=d.g.length?d.g:d.h,H=t(E),C=H.next();!C.done;C=H.next())D=C.value,I=A++,L=D.bandwidth||0,D.dependencyStream&&(L+=D.dependencyStream.bandwidth||0),B.push({id:I,language:D.language,disabledUntilTime:0,primary:D.primary,audio:D.type==e.Y?D:null,video:D.type==e.wa?D:null,bandwidth:L,drmInfos:D.drmInfos,allowedByApplication:!0,allowedByKeySystem:!0,
|
|
decodingInfos:[]});d.l=B;G(W)})};
|
|
function Jv(a){var b,c,d,e,f,g,h,k,l,m,n,q,r,u,w,v,y,z,A,B,E,H,C,D,I,L,K,J,M,O;return Q(function(N){switch(N.g){case 1:b=yc;if(1==a.length)return N.return(a[0]);c=a.map(function(P){return new Map(P.filter(function(R){return R.type===b.Y}).map(function(R){return[Bv(R),R]}))});d=a.map(function(P){return new Map(P.filter(function(R){return R.type===b.wa}).map(function(R){return[Cv(R),R]}))});e=a.map(function(P){return new Map(P.filter(function(R){return R.type===b.Oa}).map(function(R){return[Dv(R),R]}))});
|
|
f=a.map(function(P){return new Map(P.filter(function(R){return R.type===b.Nf}).map(function(R){return[Ev(R),R]}))});g=t(e);for(h=g.next();!h.done;h=g.next())k=h.value,l=Kv(b.Oa),k.set(Dv(l),l);m=t(f);for(n=m.next();!n.done;n=m.next())q=n.value,r=Kv(b.Nf),q.set(Ev(r),r);u=new zv;return F(N,Gv(u,[],c,0,Lv,Mv,0),2);case 2:return w=N.h,F(N,Gv(u,[],d,0,Lv,Mv,0),3);case 3:return v=N.h,F(N,Gv(u,[],e,0,Lv,Mv,0),4);case 4:return y=N.h,F(N,Gv(u,[],f,0,Lv,Mv,0),5);case 5:z=N.h;A=0;if(v.length&&w.length)for(D=
|
|
t(w),I=D.next();!I.done;I=D.next())for(L=I.value,K=t(v),J=K.next();!J.done;J=K.next())M=J.value,O=A++,M.variantIds.push(O),L.variantIds.push(O);else for(B=v.concat(w),E=t(B),H=E.next();!H.done;H=E.next())C=H.value,C.variantIds=[A++];return N.return(v.concat(w).concat(y).concat(z))}})}
|
|
function Gv(a,b,c,d,e,f,g){var h,k,l,m,n,q,r,u,w,v,y,z,A,B,E,H,C,D,I,L;return Q(function(K){switch(K.g){case 1:h=[];for(k=0;k<c.length;k++)k>=d?h.push(new Set(c[k].values())):h.push(new Set);l=t(b);m=l.next();case 2:if(m.done){K.u(4);break}n=m.value;return F(K,Nv(a,n,c,d,f,h,g),5);case 5:q=K.h;if(!q)throw new U(2,4,4037);m=l.next();K.u(2);break;case 4:r=t(h);for(u=r.next();!u.done;u=r.next())for(w=u.value,v=t(w),y=v.next();!y.done;y=v.next())z=y.value,(A=Ov(a,z,c,e,f,h))&&b.push(A);B=t(h);for(E=B.next();!E.done;E=
|
|
B.next())for(H=E.value,C=t(H),D=C.next(),I={};!D.done;I={kh:void 0},D=C.next())if(I.kh=D.value,!Pv(I.kh)&&(L=b.some(function(J){return function(M){return Qv(a,J.kh,M)}}(I))))throw new U(2,4,4037);return K.return(b)}})}function Nv(a,b,c,d,e,f,g){return Q(function(h){if(1==h.g)return Rv(a,c,b,0<g),b.matchedStreams?b.segmentIndex?F(h,Sv(b,d+g),2):h.u(2):h.return(!1);Tv(b,d,e,f,g);return h.return(!0)})}
|
|
function Sv(a,b){var c,d,e,f,g,h;return Q(function(k){if(1==k.g){c=[];d=a.matchedStreams;for(e=b;e<d.length;e++)f=d[e],c.push(f.createSegmentIndex()),f.trickModeVideo&&!f.trickModeVideo.segmentIndex&&c.push(f.trickModeVideo.createSegmentIndex()),f.dependencyStream&&!f.dependencyStream.segmentIndex&&c.push(f.dependencyStream.createSegmentIndex());return F(k,Promise.all(c),2)}if(a.segmentIndex instanceof Fl)for(g=b;g<d.length;g++)h=d[g],h.segmentIndex&&a.segmentIndex.h.push(h.segmentIndex);G(k)})}
|
|
function Ov(a,b,c,d,e,f){if(Pv(b))return null;var g=d(b);Rv(a,c,g);g.createSegmentIndex&&(g.createSegmentIndex=function(){return Q(function(h){if(g.segmentIndex)return h.u(0);g.segmentIndex=new Fl;return F(h,Sv(g,0),0)})});if(!g.matchedStreams||!g.matchedStreams.length)return null;Tv(g,0,e,f,0);return g}
|
|
function Tv(a,b,c,d,e){var f=a.matchedStreams;for(b+=e;b<f.length;b++){var g=f[b];c(a,g);var h=!0;"audio"==a.type&&0==lf(a.language,g.language)&&(h=!1);if(h&&(d[b-e].delete(g),g.fullMimeTypes))for(g=t(g.fullMimeTypes.values()),h=g.next();!h.done;h=g.next())a.fullMimeTypes.add(h.value)}}
|
|
function Hv(a){var b=Object.assign({},a);b.originalId=null;b.createSegmentIndex=function(){return Promise.resolve()};b.closeSegmentIndex=function(){b.segmentIndex&&(b.segmentIndex.release(),b.segmentIndex=null);if(b.matchedStreams)for(var c=t(b.matchedStreams),d=c.next();!d.done;d=c.next())d=d.value,d.segmentIndex&&(d.segmentIndex.release(),d.segmentIndex=null)};b.roles=b.roles.slice();b.segmentIndex=null;b.emsgSchemeIdUris=[];b.keyIds=new Set(a.keyIds);b.closedCaptions=a.closedCaptions?new Map(a.closedCaptions):
|
|
null;b.trickModeVideo=null;b.dependencyStream=null;return b}function Lv(a){var b=Object.assign({},a);b.roles=b.roles.slice();b.keyIds=new Set(a.keyIds);b.segments=[];b.variantIds=[];b.closedCaptions=a.closedCaptions?new Map(a.closedCaptions):null;return b}
|
|
function Iv(a,b){function c(g,h){g||(g=[]);h=t(h);for(var k=h.next();!k.done;k=h.next())k=k.value,g.includes(k)||g.push(k);return g}a.roles=c(a.roles,b.roles);b.emsgSchemeIdUris&&(a.emsgSchemeIdUris=c(a.emsgSchemeIdUris,b.emsgSchemeIdUris));for(var d=t(b.keyIds),e=d.next();!e.done;e=d.next())a.keyIds.add(e.value);null==a.originalId?a.originalId=b.originalId:(d=b.originalId||"")&&!a.originalId.endsWith(d)&&(a.originalId+=","+d);d=lg(a.drmInfos,b.drmInfos);if(b.drmInfos.length&&a.drmInfos.length&&!d.length)throw new U(2,
|
|
4,4038);a.drmInfos=d;a.encrypted=a.encrypted||b.encrypted;if(b.closedCaptions)for(a.closedCaptions||(a.closedCaptions=new Map),d=t(b.closedCaptions),e=d.next();!e.done;e=d.next()){var f=t(e.value);e=f.next().value;f=f.next().value;a.closedCaptions.set(e,f)}a.bandwidth&&b.bandwidth&&(a.bandwidth=Math.max(a.bandwidth,b.bandwidth));b.trickModeVideo?(a.trickModeVideo||(a.trickModeVideo=Hv(b.trickModeVideo),a.trickModeVideo.matchedStreams=[],a.trickModeVideo.createSegmentIndex=function(){if(a.trickModeVideo.segmentIndex)return Promise.resolve();
|
|
for(var g=new Fl,h=t(a.trickModeVideo.matchedStreams),k=h.next();!k.done;k=h.next())g.h.push(k.value.segmentIndex);a.trickModeVideo.segmentIndex=g;return Promise.resolve()}),a.trickModeVideo.matchedStreams.push(b.trickModeVideo),Iv(a.trickModeVideo,b.trickModeVideo)):a.trickModeVideo&&(a.trickModeVideo.matchedStreams.push(b),Iv(a.trickModeVideo,b));b.dependencyStream?(a.dependencyStream||(a.dependencyStream=Hv(b.dependencyStream),a.dependencyStream.matchedStreams=[],a.dependencyStream.createSegmentIndex=
|
|
function(){if(a.dependencyStream.segmentIndex)return Promise.resolve();for(var g=new Fl,h=t(a.dependencyStream.matchedStreams),k=h.next();!k.done;k=h.next())g.h.push(k.value.segmentIndex);a.dependencyStream.segmentIndex=g;return Promise.resolve()}),a.dependencyStream.matchedStreams.push(b.dependencyStream),Iv(a.dependencyStream,b.dependencyStream)):a.dependencyStream&&(a.dependencyStream.matchedStreams.push(b),Iv(a.dependencyStream,b))}
|
|
function Mv(a,b){var c=a.roles;c||(c=[]);for(var d=t(b.roles),e=d.next();!e.done;e=d.next())e=e.value,c.includes(e)||c.push(e);a.roles=c;c=t(b.keyIds);for(d=c.next();!d.done;d=c.next())a.keyIds.add(d.value);a.encrypted=a.encrypted&&b.encrypted;a.segments.push.apply(a.segments,x(b.segments));if(b.closedCaptions)for(a.closedCaptions||(a.closedCaptions=new Map),b=t(b.closedCaptions),c=b.next();!c.done;c=b.next())d=t(c.value),c=d.next().value,d=d.next().value,a.closedCaptions.set(c,d)}
|
|
function Rv(a,b,c,d){d=(void 0===d?0:d)?c.matchedStreams:[];b=t(b);for(var e=b.next();!e.done;e=b.next()){e=Uv(a,e.value,c);if(!e)return;d.push(e)}c.matchedStreams=d}
|
|
function Uv(a,b,c){var d={audio:Bv,video:Cv,text:Dv,image:Ev}[c.type],e=null,f=d(c);if(b.has(f))e=b.get(f);else{f={audio:function(l,m){return Qv(a,l,m)},video:function(l,m){return Qv(a,l,m)},text:Vv,image:Wv}[c.type];for(var g={audio:Xv,video:Yv,text:Zv,image:$v}[c.type],h=t(b.values()),k=h.next();!k.done;k=h.next())k=k.value,!f(c,k)||c.fastSwitching!=k.fastSwitching||e&&!g(c,e,k)||(e=k)}a.s&&!Pv(e)&&b.delete(d(e));return e}
|
|
function aw(a,b){return a.mimeType!=b.mimeType?!1:bw(a.codecs)===bw(b.codecs)}p.Fi=function(a){this.o=a};p.Ji=function(a){this.s=a};function Qv(a,b,c){return!aw(b,c)&&!a.o||b.drmInfos&&!jg(b.drmInfos,c.drmInfos)?!1:!0}function Vv(a,b){return b.language?a.forced!==b.forced||0==lf(a.language,b.language)||b.kind!=a.kind?!1:!0:!0}function Wv(){return!0}
|
|
function Xv(a,b,c){var d=aw(a,b),e=aw(a,c);if(d&&!e)return!1;if(!d&&e)return!0;d=lf(a.language,b.language);e=lf(a.language,c.language);if(e>d)return!0;if(e<d)return!1;if(b.label!==c.label){if(a.label===b.label)return!1;if(a.label===c.label)return!0}if(a.roles.length){d=b.roles.filter(function(f){return a.roles.includes(f)});e=c.roles.filter(function(f){return a.roles.includes(f)});if(e.length>d.length)return!0;if(e.length<d.length)return!1;if(c.roles.length!==b.roles.length)return c.roles.length<
|
|
b.roles.length}else{if(!c.roles.length&&b.roles.length)return!0;if(c.roles.length&&!b.roles.length)return!1}if(!b.primary&&c.primary)return!0;if(b.primary&&!c.primary)return!1;d=sw(a.channelsCount,b.channelsCount,c.channelsCount);if(d==tw)return!0;if(d==uw)return!1;d=sw(a.audioSamplingRate,b.audioSamplingRate,c.audioSamplingRate);return d==tw?!0:d==uw?!1:a.bandwidth&&vw(a.bandwidth,b.bandwidth,c.bandwidth)==tw?!0:!1}
|
|
function Yv(a,b,c){var d=aw(a,b),e=aw(a,c);if(d&&!e)return!1;if(!d&&e)return!0;d=sw(a.width*a.height,b.width*b.height,c.width*c.height);if(d==tw)return!0;if(d==uw)return!1;if(a.frameRate){d=sw(a.frameRate,b.frameRate,c.frameRate);if(d==tw)return!0;if(d==uw)return!1}return a.bandwidth&&vw(a.bandwidth,b.bandwidth,c.bandwidth)==tw?!0:!1}
|
|
function Zv(a,b,c){var d=lf(a.language,b.language),e=lf(a.language,c.language);if(e>d)return!0;if(e<d)return!1;if(!b.primary&&c.primary)return!0;if(b.primary&&!c.primary)return!1;if(b.label!==c.label){if(a.label===b.label)return!1;if(a.label===c.label)return!0}if(a.roles.length){d=b.roles.filter(function(f){return a.roles.includes(f)});e=c.roles.filter(function(f){return a.roles.includes(f)});if(e.length>d.length)return!0;if(e.length<d.length)return!1}else{if(!c.roles.length&&b.roles.length)return!0;
|
|
if(c.roles.length&&!b.roles.length)return!1}return c.mimeType!=a.mimeType||c.codecs!=a.codecs||b.mimeType==a.mimeType&&b.codecs==a.codecs?!1:!0}function $v(a,b,c){return sw(a.width*a.height,b.width*b.height,c.width*c.height)==tw?!0:!1}
|
|
function Kv(a){return{id:0,originalId:"",groupId:null,primary:!1,type:a,mimeType:"",codecs:"",language:"",originalLanguage:null,label:null,width:null,height:null,encrypted:!1,keyIds:new Set,segments:[],variantIds:[],roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,external:!1,fastSwitching:!1,isAudioMuxedInVideo:!1,baseOriginalId:null}}
|
|
function Fv(a){return{id:0,originalId:"",groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new Cl([]),mimeType:"",codecs:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"",originalLanguage:null,label:null,type:a,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!1,fastSwitching:!1,fullMimeTypes:new Set,isAudioMuxedInVideo:!1,
|
|
baseOriginalId:null}}function sw(a,b,c){if(b==a&&a!=c)return uw;if(c==a&&a!=b)return tw;if(b>a){if(c<=a||c-a<b-a)return tw;if(c-a>b-a)return uw}else{if(c>a)return uw;if(a-c<a-b)return tw;if(a-c>a-b)return uw}return ww}function vw(a,b,c){b=Math.abs(a-b);a=Math.abs(a-c);return a<b?tw:b<a?uw:ww}function Pv(a){switch(a.type){case wc:return!a.language;case "image":return!a.tilesLayout;default:return!1}}
|
|
function Cv(a){return JSON.stringify([a.fastSwitching,a.width,a.frameRate,bw(a.codecs),a.mimeType,a.label,a.roles,a.closedCaptions?Array.from(a.closedCaptions.entries()):null,a.bandwidth,a.dependencyStream?a.dependencyStream.baseOriginalId:null,Array.from(a.keyIds)])}
|
|
function Bv(a){return JSON.stringify([a.fastSwitching,a.channelsCount,a.language,a.bandwidth,a.label,bw(a.codecs),a.mimeType,a.roles,a.audioSamplingRate,a.primary,a.dependencyStream?a.dependencyStream.baseOriginalId:null,Array.from(a.keyIds)])}function Dv(a){return JSON.stringify([a.language,a.label,a.codecs,a.mimeType,a.bandwidth,a.roles])}function Ev(a){return JSON.stringify([a.width,a.codecs,a.mimeType])}function bw(a){if(!xw.has(a)){var b=Ie(a);xw.set(a,b)}return xw.get(a)}
|
|
T("shaka.util.PeriodCombiner",zv);zv.prototype.setUseStreamOnce=zv.prototype.Ji;zv.prototype.setAllowMultiTypeVariants=zv.prototype.Fi;zv.prototype.combinePeriods=zv.prototype.$f;zv.prototype.deleteStream=zv.prototype.Lh;zv.prototype.getImageStreams=zv.prototype.yj;zv.prototype.getTextStreams=zv.prototype.Bg;zv.prototype.getVariants=zv.prototype.Tj;var tw=1,ww=0,uw=-1,xw=new Map;function yw(a,b){var c=new DOMParser,d=zw.value()(a);a=null;try{a=c.parseFromString(d,"text/xml")}catch(e){return null}c=a.documentElement;if(!c||c.getElementsByTagName("parsererror").length||c.tagName!=b)return null;if(!("createNodeIterator"in document))return c;for(b=document.createNodeIterator(a,NodeFilter.SHOW_ALL);a=b.nextNode();)if(a instanceof HTMLElement||a instanceof SVGElement)return null;return c}function Aw(a,b){try{var c=dc(a);return yw(c,b)}catch(d){return null}}
|
|
var zw=new pb(function(){if("undefined"!==typeof trustedTypes){var a=trustedTypes.createPolicy("shaka-player#xml",{createHTML:function(b){return b}});return function(b){return a.createHTML(b)}}return function(b){return b}});function Bw(){var a=this;this.j=this.g=null;this.A=[];this.i=null;this.Ba=1;this.G=[];this.l={kf:"",type:"",profiles:[],jc:null,pb:0,cb:null,Zd:0};this.s=new Map;this.B=new Map;this.o=new Map;this.C=new Map;this.va=new Map;this.m=new zv;this.K=0;this.xa=new Va(5);this.L=new $e(function(){if(a.I&&!a.g.continueLoadingWhenPaused&&(a.H.Ja(a.I,"timeupdate"),a.I.paused)){a.H.za(a.I,"timeupdate",function(){return Cw(a)});return}Cw(a)});this.P=new Eg;this.N=null;this.F=[];this.ia=Infinity;this.ua=!1;this.h=
|
|
null;this.M=0;this.S=!1;this.H=new jb;this.I=null;this.U=!1;this.$="";this.oa=function(){return!1};this.W=[];this.ka=new Set}p=Bw.prototype;p.configure=function(a,b){var c=this.j&&a.updatePeriod!=this.g.updatePeriod&&0<=a.updatePeriod;this.g=a;b&&(this.oa=b);c&&this.i&&this.i.presentationTimeline.V()&&this.L.Hb();this.h&&this.h.configure(this.g);this.m&&(this.m.Fi(this.g.dash.multiTypeVariantsAllowed&&Gc()),this.m.Ji(this.g.dash.useStreamOnceInPeriodFlattening))};
|
|
p.start=function(a,b){var c=this,d;return Q(function(e){if(1==e.g)return c.ua=b.isLowLatencyMode(),c.A=[a],c.j=b,F(e,Dw(c),2);d=e.h;c.j&&Ew(c,d);if(!c.j)throw new U(2,7,7001);return e.return(c.i)})};
|
|
p.stop=function(){for(var a=t(this.o.values()),b=a.next();!b.done;b=a.next())b=b.value,b.segmentIndex&&b.segmentIndex.release();this.m&&this.m.release();this.g=this.j=null;this.A=[];this.i=null;this.o.clear();this.C.clear();this.s.clear();this.B.clear();this.l={kf:"",type:"",profiles:[],jc:null,pb:0,cb:null,Zd:0};this.m=null;null!=this.L&&(this.L.stop(),this.L=null);this.h&&this.h.destroy();this.H&&(this.H.release(),this.H=null);this.ka.clear();return this.P.destroy()};
|
|
p.update=function(){var a=this,b;return Q(function(c){if(1==c.g)return wa(c,2),F(c,Dw(a),4);if(2!=c.g)return za(c,0);b=Aa(c);if(!a.j||!b)return c.return();a.j.onError(b);G(c)})};p.onExpirationUpdated=function(){};p.onInitialVariantChosen=function(a){if(this.i&&this.i.presentationTimeline.V()){var b=a.video||a.audio;if(b&&b.segmentIndex){a=this.i.presentationTimeline.vc();var c=b.segmentIndex.find(a);null!=c&&(b=b.segmentIndex.get(c))&&(this.K=b.endTime-a,Ew(this,0))}}};
|
|
p.banLocation=function(a){this.h&&this.h.banLocation(a)};p.setMediaElement=function(a){this.I=a};
|
|
function Dw(a){var b,c,d,e,f,g,h,k,l,m,n;return Q(function(q){if(1==q.g)return b=4,c="MPD",d=Fw(a),e=a.A,d.length?(e=d,c="Patch",b=6):1<a.A.length&&a.h&&(f=yv(a.h,"Location",!0),f.length&&(e=f)),g=Lg(e,a.g.retryParameters),h=Date.now(),F(q,Gw(a,g,0,{type:b}),2);if(3!=q.g){k=q.h;if(!a.j)return q.return(0);k.uri&&k.uri!=k.originalUri&&!a.A.includes(k.uri)&&a.A.unshift(k.uri);l=new Bb(k.uri);a.$=l.g.toString();return F(q,Hw(a,k.data,k.uri,c),3)}m=Date.now();n=(m-h)/1E3;a.xa.sample(1,n);a.ka.clear();
|
|
return q.return(n)})}
|
|
function Hw(a,b,c,d){var e,f,g,h,k,l,m,n,q,r,u;return Q(function(w){if(1==w.g){e=b;f=a.g.dash.manifestPreprocessor;g=xn;if(f!=g){wb("manifest.dash.manifestPreprocessor configuration","Please Use manifest.dash.manifestPreprocessorTXml instead.");h=Aw(e,d);if(!h)throw new U(2,4,4001,c);f(h);e=ec(h.outerHTML)}k=hd(e,d);if(!k)throw new U(2,4,4001,c);l=a.g.dash.manifestPreprocessorTXml;m=yn;l!=m&&l(k);if("Patch"===d)return w.return(Iw(a,k));if(n=a.g.dash.disableXlinkProcessing)return w.return(Jw(a,k,c));
|
|
q=a.g.dash.xlinkFailGracefully;r=Lu(k,a.g.retryParameters,q,c,a.j.networkingEngine);Fg(a.P,r);return F(w,r.promise,2)}u=w.h;return w.return(Jw(a,u,c))})}
|
|
function Jw(a,b,c){var d,e,f,g,h,k,l,m,n,q,r,u,w,v,y,z,A,B,E,H,C,D,I,L,K,J,M,O,N,P,R,S,aa,W,Fa,Ga,xa,qa,Da,Ja,ra,da,sa,Za,$a,hb,rb,mb,Ma,Td,ic,be,Mf,Nf;return Q(function($c){switch($c.g){case 1:a.h&&a.h.l.clear();d=[c];e=[];f=new Map;g=qd(b,"Location");h=t(g);for(k=h.next();!k.done;k=h.next())if(l=k.value,m=l.attributes.serviceLocation,n=sd(l))q=qc(d,[n])[0],m&&(a.h?xv(a.h,"Location",m,q):f.set(m,q)),e.push(q);a.h?(r=yv(a.h,"Location",!0),0<r.length&&(d=a.A=r)):e.length&&(d=a.A=e);a.l.kf=b.attributes.id||
|
|
"";a.l.Zd=xd(b,"publishTime",Ad)||0;a.G=qd(b,"PatchLocation");u=Promise.resolve();if((w=ud(b,"ContentSteering"))&&a.j){v=w.attributes.defaultServiceLocation;if(a.h)a.h.i=d,a.h.h=v;else if(a.h=new tv(a.j),a.h.configure(a.g),a.h.setManifestType("DASH"),a.h.i=d,a.h.h=v,y=sd(w))(z=xd(w,"queryBeforeStart",Hd,!1))?u=uv(a.h,y):uv(a.h,y);A=t(f.keys());for(B=A.next();!B.done;B=A.next())E=B.value,H=f.get(E),xv(a.h,"Location",E,H)}C=qd(b,"BaseURL");D=!1;if(a.h)for(I=t(C),L=I.next();!L.done;L=I.next())K=L.value,
|
|
J=K.attributes.serviceLocation,M=sd(K),J&&M&&(xv(a.h,"BaseURL",J,M),D=!0);a.W=null;D&&a.h||(O=C.map(sd),a.W=qc(d,O));N=function(){return a.h&&D?yv(a.h,"BaseURL"):a.W?a.W:[]};a.l.cb=N;P=0;C&&C.length&&(P=xd(C[0],"availabilityTimeOffset",Gd)||0);a.l.pb=P;a.K=xd(b,"minimumUpdatePeriod",Bd,-1);R=xd(b,"availabilityStartTime",Ad);S=xd(b,"timeShiftBufferDepth",Bd);aa=a.g.dash.ignoreSuggestedPresentationDelay;W=null;aa||(W=xd(b,"suggestedPresentationDelay",Bd));Fa=a.g.dash.ignoreMaxSegmentDuration;Ga=null;
|
|
Fa||(Ga=xd(b,"maxSegmentDuration",Bd));xa=b.attributes.type||"static";a.i&&a.i.presentationTimeline&&(a.U=a.i.presentationTimeline.V()&&"static"==xa);a.l.type=xa;if(a.i)for(qa=a.i.presentationTimeline,Da=qa.Eb(),Ja=t(a.o.values()),ra=Ja.next();!ra.done;ra=Ja.next())da=ra.value,da.segmentIndex&&da.segmentIndex.$a(Da);else sa=a.g.dash.ignoreMinBufferTime,Za=0,sa||(Za=xd(b,"minBufferTime",Bd)||0),$a=0,$a=null!=W?Math.min(W,S||Infinity):0<a.g.defaultPresentationDelay?a.g.defaultPresentationDelay:Math.min(1.5*
|
|
Za,S||Infinity),qa=new el(R,$a,a.g.dash.autoCorrectDrift);qa.Wc("static"==xa);(hb=qa.V())&&!isNaN(a.g.availabilityWindowOverride)&&(S=a.g.availabilityWindowOverride);null==S&&(S=Infinity);qa.Bf(S);rb=b.attributes.profiles||"";a.l.profiles=rb.split(",");mb={hc:"static"!=xa,presentationTimeline:qa,ra:null,na:null,ma:null,J:null,bandwidth:0,Dg:!1,pb:P,jc:null,profiles:rb.split(","),roles:null,Jb:function(){return""}};return F($c,u,2);case 2:a.M=0;Ma=Kw(a,mb,N,b,!1);Td=Ma.duration;ic=Ma.periods;("static"!=
|
|
xa||a.U)&&Ma.Nh||qa.ob(Td||Infinity);a.S&&a.ua&&qa.Gi(a.ia);qa.Lg(Ga||1);a.S&&a.ua&&(be=null!=W?W:a.g.defaultPresentationDelay,qa.fh(be));if(!a.i)return F($c,a.m.$f(ic,mb.hc),6);a.i.periodCount=ic.length;a.i.gapCount=a.M;return F($c,Lw(a,ic,!1),4);case 6:a.i={presentationTimeline:qa,variants:a.m.l,textStreams:a.m.Bg(),imageStreams:a.m.i,offlineSessionIds:[],sequenceMode:a.g.dash.sequenceMode,ignoreManifestTimestampsInSegmentsMode:!1,type:"DASH",serviceDescription:Mw(b),nextUrl:Nw(b),periodCount:ic.length,
|
|
gapCount:a.M,isLowLatency:a.S,startTime:null};if(!qa.Wi()){$c.u(7);break}Mf=qd(b,"UTCTiming");return F($c,Ow(a,N,Mf),8);case 8:Nf=$c.h;if(!a.j)return $c.return();qa.Hi(Nf);case 7:qa.ef(),a.m&&!a.i.presentationTimeline.V()&&a.m.release();case 4:a.j.makeTextStreamsForClosedCaptions(a.i),Pw(a),Qw(a,ic),G($c)}})}
|
|
function Lw(a,b,c){var d;return Q(function(e){if(1==e.g)return F(e,a.m.$f(b,!0,c),2);a.i.variants=a.m.l;d=a.m.Bg();0<d.length&&(a.i.textStreams=d);a.i.imageStreams=a.m.i;a.j.filter(a.i);G(e)})}
|
|
function Iw(a,b){var c,d,e,f,g,h,k,l,m,n,q,r,u,w,v,y,z,A,B,E,H,C,D,I,L,K,J;return Q(function(M){if(1==M.g){c=b.attributes.mpdId;d=xd(b,"originalPublishTime",Ad);if(!c||c!==a.l.kf||d!==a.l.Zd)throw a.G=[],new U(1,4,4052);e=[];f=[];g=new Set;h=t(pd(b));for(k=h.next();!k.done;k=h.next())if(l=k.value,m=Jd(l.attributes.sel||""),n=m[m.length-1],q=sd(l)||"","MPD"===n.name)if("mediaPresentationDuration"===n.sc){r=sd(l)||"";var O=Bd(r);if(null!=O){a.l.jc=O;for(var N=t(a.s.values()),P=N.next();!P.done;P=N.next())P.value.jc=
|
|
O}}else if("type"===n.sc){a.i.presentationTimeline.Wc("static"==q);a.l.type=q;O=t(a.s.values());for(N=O.next();!N.done;N=O.next())N.value.hc="dynamic"==q;"static"==q&&(a.K=-1)}else"publishTime"===n.sc?a.l.Zd=Ad(q)||0:null===n.sc&&"add"===l.tagName&&f.push(l);else if("PatchLocation"===n.name)Ld(a.G,l);else if("Period"===n.name)"add"===l.tagName?f.push(l):"remove"===l.tagName&&n.id&&Rw(a,n.id);else if("SegmentTemplate"===n.name){N=Jd(l.attributes.sel||"");O=N[N.length-1];if(O.sc){N=Sw(a,N);P=sd(l)||
|
|
"";for(var R=t(N),S=R.next();!S.done;S=R.next())S=a.s.get(S.value),Nd(S.J.Cc,l.tagName,O.sc,P);O=N}else O=[];u=O;w=t(u);for(v=w.next();!v.done;v=w.next())y=v.value,g.add(y)}else if("SegmentTimeline"===n.name||"S"===n.name){O=Jd(l.attributes.sel||"");O=Sw(a,O);N=t(O);for(P=N.next();!P.done;P=N.next())P=a.s.get(P.value),P=Iu(P,jv,"SegmentTimeline"),R=qd(P,"S"),Ld(R,l),P.children=R;z=O;A=t(z);for(B=A.next();!B.done;B=A.next())E=B.value,g.add(E)}H=t(g);for(C=H.next();!C.done;C=H.next())D=C.value,Tw(a,
|
|
D);I=t(f);for(L=I.next();!L.done;L=I.next())K=L.value,e.push.apply(e,x(Uw(a,K)));if(!e.length)return M.u(2);a.i.periodCount+=e.length;a.i.gapCount=a.M;return F(M,Lw(a,e,!0),2)}"static"==a.l.type&&(J=a.l.jc,a.i.presentationTimeline.ob(J||Infinity));G(M)})}
|
|
function Uw(a,b){return Kw(a,{hc:"dynamic"==a.l.type,presentationTimeline:a.i.presentationTimeline,ra:null,na:null,ma:null,J:null,bandwidth:0,Dg:!1,pb:a.l.pb,profiles:a.l.profiles,jc:a.l.jc,roles:null,Jb:function(){return""}},a.l.cb,b,!0).periods}function Rw(a,b){a.i.periodCount--;for(var c=t(a.s.keys()),d=c.next();!d.done;d=c.next())if(d=d.value,d.startsWith(b)){var e=a.s.get(d);Iu(e,jv,"SegmentTimeline").children=[];Tw(a,d);a.s.delete(d)}a.F=a.F.filter(function(f){return f!==b})}
|
|
function Sw(a,b){var c="",d="",e=-1,f="";b=t(b);for(var g=b.next();!g.done;g=b.next())g=g.value,"Period"===g.name?c=g.id:"AdaptationSet"===g.name?(d=g.id,null!==g.position&&(e=g.position)):"Representation"===g.name&&(f=g.id);b=[];if(f)b.push(c+","+f);else if(d)for(e=t(a.s.values()),a=e.next();!a.done;a=e.next())a=a.value,a.ra.id===c&&a.ma.id===d&&a.J.id&&b.push(c+","+a.J.id);else if(-1<e)for(d=t(a.s.values()),a=d.next();!a.done;a=d.next())a=a.value,a.ra.id===c&&a.ma.position===e&&a.J.id&&b.push(c+
|
|
","+a.J.id);return b}function Tw(a,b){var c=a.s.get(b),d=a.o.get(b);d.segmentIndex&&d.segmentIndex.$a(a.i.presentationTimeline.Eb());try{var e=iv(c,function(f,g,h,k){return Vw(a,f,g,h,k)},a.o,!0,a.g.dash.initialSegmentLimit,a.va,c.J.aesKey,null,!0,a.B);d.createSegmentIndex=function(){return Q(function(f){if(1==f.g)return d.segmentIndex?f.u(0):F(f,e.Jc(),3);d.segmentIndex=f.h;G(f)})}}catch(f){if(b=c.J.contentType,b!=wc&&"application"!=b&&"image"!=b||4002!=f.code)throw f;}}
|
|
function Mw(a){var b=ud(a,"ServiceDescription");if(!b)return null;a=ud(b,"Latency");b=ud(b,"PlaybackRate");if(!a&&!b)return null;var c={};a&&("target"in a.attributes&&(c.targetLatency=parseInt(a.attributes.target,10)/1E3),"max"in a.attributes&&(c.maxLatency=parseInt(a.attributes.max,10)/1E3),"min"in a.attributes&&(c.minLatency=parseInt(a.attributes.min,10)/1E3));b&&("max"in b.attributes&&(c.maxPlaybackRate=parseFloat(b.attributes.max)),"min"in b.attributes&&(c.minPlaybackRate=parseFloat(b.attributes.min)));
|
|
return c}function Nw(a){a=qd(a,"SupplementalProperty");if(!a.length)return null;a=t(a);for(var b=a.next();!b.done;b=a.next())if(b=b.value,"urn:mpeg:dash:chaining:2016"==b.attributes.schemeIdUri)return b.attributes.value;return null}
|
|
function Kw(a,b,c,d,e){var f=b.jc;f||(f=xd(d,"mediaPresentationDuration",Bd),a.l.jc=f);var g=0;a.i&&a.i.presentationTimeline&&a.U&&(g=a.i.presentationTimeline.Vb());var h=[],k=g;d=qd(d,"Period");for(var l=0;l<d.length;l++){var m=d[l],n=d[l+1],q=xd(m,"start",Bd,k),r=m.attributes.id,u=xd(m,"duration",Bd);q=0==l&&0==q&&a.U?g:q;var w=null;if(n){var v=xd(n,"start",Bd);null!=v&&(w=v-q+g)}else null!=f&&(w=f-q+g);v=zc;w&&u&&Math.abs(w-u)>v&&w>u&&a.M++;null==w&&(w=u);if(!(null!==a.N&&null!==r&&null!==q&&q<
|
|
a.N)||a.F.includes(r)||l+1==d.length){null!==q&&(null===a.N||q>a.N)&&(a.N=q);k=Ww(a,b,c,{start:q,duration:w,node:m,ai:null==w||!n});h.push(k);b.ra.id&&w&&a.va.set(b.ra.id,w);if(null==w){k=null;break}k=q+w}}if(e)for(b=t(h),c=b.next();!c.done;c=b.next())c=c.value.id,a.F.includes(c)||a.F.push(c);else a.F=h.map(function(y){return y.id});return null!=f?{periods:h,duration:f+g,Nh:!1}:{periods:h,duration:k,Nh:!0}}
|
|
function Pw(a){var b=Array.from(a.C.keys()).filter(function(h){return!a.F.includes(h)});b=t(b);for(var c=b.next();!c.done;c=b.next()){c=c.value;for(var d=!0,e=t(a.C.get(c)),f=e.next();!f.done;f=e.next()){f=f.value;var g=a.o.get(f);g&&(g.segmentIndex&&0!=g.segmentIndex.getNumReferences()?d=!1:(a.m&&a.m.Lh(g,c),a.o.delete(f)))}d&&a.C.delete(c)}}function Qw(a,b){b=new Set(b.map(function(e){return e.id}));for(var c=t(a.B.keys()),d=c.next();!d.done;d=c.next())d=d.value,b.has(d)||a.B.delete(d)}
|
|
function Ww(a,b,c,d){b.ra=Xw(a,d.node,null,c);b.na=d;b.ra.pb=b.pb;b.ra.id||(b.ra.id="__shaka_period_"+d.start);var e=qd(d.node,"EventStream");c=b.presentationTimeline.Eb();e=t(e);for(var f=e.next();!f.done;f=e.next())Yw(a,d.start,d.duration,f.value,c);c=qd(d.node,"SupplementalProperty");c=t(c);for(e=c.next();!e.done;e=c.next())if(e=e.value,"urn:mpeg:dash:urlparam:2014"==e.attributes.schemeIdUri&&(e=Zw(a,e)))b.Jb=e;c=qd(d.node,"AdaptationSet").map(function(r,u){return $w(a,b,u,r)}).filter(cf);if(b.hc){e=
|
|
[];f=t(c);for(var g=f.next();!g.done;g=f.next()){g=t(g.value.Gk);for(var h=g.next();!h.done;h=g.next())e.push(h.value)}if(e.length!=(new Set(e)).size)throw new U(2,4,4018);}e=new Map;f=t(c);for(g=f.next();!g.done;g=f.next())for(g=t(g.value.mj),h=g.next();!h.done;h=g.next()){var k=t(h.value);h=k.next().value;k=k.next().value;e.set(h,k)}if(e.size)for(f=null,g=t(c),h=g.next();!h.done;h=g.next()){h=h.value;k=[];for(var l=t(h.streams),m=l.next(),n={};!m.done;n={lh:void 0},m=l.next())if(n.lh=m.value,e.has(n.lh.originalId)){f||
|
|
(f=qd(d.node,"AdaptationSet").map(function(r,u){return $w(a,b,u,r)}).filter(cf));m=t(f);for(var q=m.next();!q.done;q=m.next())if(q=q.value.streams.find(function(r){return function(u){return u.originalId==r.lh.originalId}}(n)))q.dependencyStream=e.get(q.originalId),q.originalId+=q.dependencyStream.originalId,k.push(q)}k.length&&h.streams.push.apply(h.streams,x(k))}d=c.filter(function(r){return!r.vh});c=c.filter(function(r){return r.vh});if(!a.g.disableIFrames)for(c=t(c),e=c.next();!e.done;e=c.next())for(e=
|
|
e.value,f=e.vh.split(" "),g=t(d),h=g.next();!h.done;h=g.next())if(h=h.value,f.includes(h.id))for(h=t(h.streams),k=h.next();!k.done;k=h.next())cg(k.value,e.streams);c=ax(a.g.disableAudio,d,"audio");e=ax(a.g.disableVideo,d,"video");f=ax(a.g.disableText,d,wc);d=ax(a.g.disableThumbnails,d,"image");if(0===e.length&&0===c.length)throw new U(2,4,4004);return{id:b.ra.id,audioStreams:c,videoStreams:e,textStreams:f,imageStreams:d}}
|
|
function ax(a,b,c){return a||!b.length?[]:b.reduce(function(d,e){if(e.contentType!=c)return d;d.push.apply(d,x(e.streams));return d},[])}
|
|
function $w(a,b,c,d){function e(J){var M=J.attributes["dvb:fontFamily"];J=J.attributes["dvb:url"];M&&J&&(J=qc(b.ma.cb(),[J],b.Jb()),a.j.addFont(M,J[0]))}function f(J){switch(J){case 1:case 5:case 6:case 7:return"srgb";case 9:return"rec2020";case 11:case 12:return"p3"}}function g(J){switch(J){case 1:case 6:case 13:case 14:case 15:return"SDR";case 16:return"PQ";case 18:return"HLG"}}b.ma=Xw(a,d,b.ra,null);b.ma.position=c;var h=!1;c=qd(d,"Role");var k=c.map(function(J){return J.attributes.value}).filter(cf),
|
|
l=void 0,m=b.ma.contentType==wc;m&&(l="subtitle");c=t(c);for(var n=c.next();!n.done;n=c.next()){n=n.value;var q=n.attributes.schemeIdUri;if(null==q||"urn:mpeg:dash:role:2011"==q)switch(n=n.attributes.value,n){case "main":h=!0;break;case "caption":case "subtitle":l=n}}var r=qd(d,"EssentialProperty");c=null;var u=!1;n=null;q=!1;r=t(r);for(var w=r.next();!w.done;w=r.next()){w=w.value;var v=w.attributes.schemeIdUri;if("http://dashif.org/guidelines/trickmode"==v)c=w.attributes.value;else if("urn:mpeg:mpegB:cicp:TransferCharacteristics"==
|
|
v)var y=g(parseInt(w.attributes.value,10));else if("urn:mpeg:mpegB:cicp:ColourPrimaries"==v)var z=f(parseInt(w.attributes.value,10));else"urn:mpeg:mpegB:cicp:MatrixCoefficients"!=v&&("urn:mpeg:dash:ssr:2023"==v&&a.g.dash.enableFastSwitching?u=!0:"urn:dvb:dash:fontdownload:2014"==v?e(w):"urn:mpeg:dash:urlparam:2014"==v?(n=Zw(a,w))||(q=!0):q=!0)}if(q)return null;var A=null;q=qd(d,"SupplementalProperty");q=t(q);for(r=q.next();!r.done;r=q.next())r=r.value,w=r.attributes.schemeIdUri,"http://dashif.org/guidelines/last-segment-number"==
|
|
w?A=parseInt(r.attributes.value,10)-1:"urn:mpeg:mpegB:cicp:TransferCharacteristics"==w?y=g(parseInt(r.attributes.value,10)):"urn:mpeg:mpegB:cicp:ColourPrimaries"==w?z=f(parseInt(r.attributes.value,10)):"urn:dvb:dash:fontdownload:2014"==w?e(r):"urn:mpeg:dash:urlparam:2014"==w&&(n=Zw(a,r));n&&(b.Jb=n);n=qd(d,"Accessibility");var B=new Map,E;n=t(n);for(q=n.next();!q.done;q=n.next())if(r=q.value,q=r.attributes.schemeIdUri,r=r.attributes.value,"urn:scte:dash:cc:cea-608:2015"!=q||a.g.disableText)if("urn:scte:dash:cc:cea-708:2015"!=
|
|
q||a.g.disableText)"urn:mpeg:dash:role:2011"==q?null!=r&&(k.push(r),"captions"==r&&(l="caption")):"urn:tva:metadata:cs:AudioPurposeCS:2007"==q&&("1"==r?E="visually impaired":"2"==r?E="hard of hearing":"9"==r&&(E="spoken subtitles"));else if(q=1,null!=r)for(r=t(r.split(";")),w=r.next();!w.done;w=r.next()){v=w.value;var H=w=void 0;v.includes("=")?(v=v.split("="),w="svc"+v[0],H=v[1].split(",")[0].split(":").pop()):(w="svc"+q,q++,H=v);B.set(w,gf(H))}else B.set("svc1","und");else if(q=1,null!=r)for(r=
|
|
r.split(";"),w=t(r),v=w.next();!v.done;v=w.next()){H=v.value;var C=v=void 0;H.includes("=")?(H=H.split("="),v=H[0].startsWith("CC")?H[0]:"CC"+H[0],C=H[1]||"und"):(v="CC"+q,2==r.length?q+=2:q++,C=H);B.set(v,gf(C))}else B.set("CC1","und");n=qd(d,"ContentProtection");var D=xu(n,a.g.ignoreDrmInfo,a.g.dash.keySystemsByURI);b.ma.encrypted=0<n.length;var I=gf(b.ma.language||"und"),L=b.ma.label,K=new Map;d=qd(d,"Representation");if(!a.g.ignoreSupplementalCodecs){n=[];q=t(d);for(r=q.next();!r.done;r=q.next())if(w=
|
|
r.value,r=yd(w,"urn:scte:dash:scte214-extensions","supplementalCodecs"))w=ed(w),w.attributes.codecs=r.split(" ").join(","),w.attributes.id&&(w.attributes.supplementalId=w.attributes.id+"_supplementalCodecs"),n.push(w);d.push.apply(d,x(n))}n=d.map(function(J){var M=bx(a,b,D,l,I,L,h,k,B,J,E,A);return M&&(M.hdr=M.hdr||y,M.colorGamut=M.colorGamut||z,M.fastSwitching=u,J=J.attributes.dependencyId)?(M.baseOriginalId=J,K.set(J,M),null):M}).filter(function(J){return!!J});if(0==n.length&&0==K.size){c="image"==
|
|
b.ma.contentType;if(a.g.dash.ignoreEmptyAdaptationSet||m||c)return null;throw new U(2,4,4003);}if(!b.ma.contentType||"application"==b.ma.contentType)for(b.ma.contentType=cx(n[0].mimeType,n[0].codecs),m=t(n),q=m.next();!q.done;q=m.next())q.value.type=b.ma.contentType;m=b.ma.id||"__fake__"+a.Ba++;q=t(n);for(r=q.next();!r.done;r=q.next()){r=r.value;w=t(D.drmInfos);for(v=w.next();!v.done;v=w.next())v=v.value,v.keyIds=v.keyIds&&r.keyIds?new Set([].concat(x(v.keyIds),x(r.keyIds))):v.keyIds||r.keyIds;r.groupId=
|
|
m}d=d.map(function(J){return J.attributes.supplementalId||J.attributes.id}).filter(cf);return{id:m,contentType:b.ma.contentType,language:I,tm:h,streams:n,drmInfos:D.drmInfos,vh:c,Gk:d,mj:K}}
|
|
function Zw(a,b){if((b=vd(b,"urn:mpeg:dash:schema:urlparam:2014","UrlQueryInfo"))&&xd(b,"useMPDUrlQuery",Hd,!1)){var c=b.attributes.queryTemplate;if(c)return function(){return"$querypart$"==c?a.$:c.split("&").map(function(d){if("$querypart$"==d)return a.$;var e=/\$query:(.*?)\$/g.exec(d);if(e&&2==e.length){e=e[1];var f=(new Hb(a.$)).get(e);if(f.length)return e+"="+f[0]}return d}).join("&")}}return null}
|
|
function bx(a,b,c,d,e,f,g,h,k,l,m,n){b.J=Xw(a,l,b.ma,null);var q=b.J.id;a.ia=Math.min(a.ia,b.J.pb);a.S=0<a.ia;if(!dx(b.J))return null;var r=b.na.start;b.bandwidth=xd(l,"bandwidth",Ed)||0;b.roles=h;var u=qd(l,"SupplementalProperty"),w=qd(l,"EssentialProperty"),v=qd(l,"ContentProtection");l=null;var y=w.find(function(N){return"urn:mpeg:dash:urlparam:2014"==N.attributes.schemeIdUri});y?l=Zw(a,y):(y=u.find(function(N){return"urn:mpeg:dash:urlparam:2014"==N.attributes.schemeIdUri}))&&(l=Zw(a,y));l&&(b.Jb=
|
|
l);y=b.J.contentType;l=y==wc||"application"==y;y="image"==y;v.length&&(b.ma.encrypted=!0);try{var z=void 0;if(c.Wf){var A=b.J.cb,B=b.Jb,E=qc(A(),[c.Wf.hk],B()),H=Lg(E,a.g.retryParameters);z={bitsKey:128,blockCipherMode:"CBC",iv:c.Wf.iv,firstMediaSequenceNumber:0,fetchKey:function(){var N,P,R;return Q(function(S){if(1==S.g)return F(S,Gw(a,H,6),2);if(3!=S.g){N=S.h;if(!N.data||16!=N.data.byteLength)throw new U(2,4,4049);P={name:"AES-CBC"};R=z;return F(S,window.crypto.subtle.importKey("raw",N.data,P,
|
|
!0,["decrypt"]),3)}R.cryptoKey=S.h;z.fetchKey=void 0;G(S)})}}}b.J.aesKey=z;A=function(N,P,R,S){return Vw(a,N,P,R,S)};if(b.J.xd)var C=Yu(b,A,z);else if(b.J.pc)C=dv(b,a.o,z);else if(b.J.Cc)C=iv(b,A,a.o,!!a.i,a.g.dash.initialSegmentLimit,a.va,z,n,!1,a.B);else{var D=b.na.duration||0,I=b.J.cb,L=b.J.mimeType,K=b.J.codecs;C={endTime:-1,timeline:-1,Jc:function(){var N=El(r,D,I());N.Cb(function(P){P.mimeType=L;P.codecs=K});return Promise.resolve(N)},timescale:1}}}catch(N){if((l||y)&&4002==N.code)return null;
|
|
throw N;}n=Bu(v,c,a.g.ignoreDrmInfo,a.g.dash.keySystemsByURI);n=new Set(n?[n]:[]);v=!1;u.some(function(N){return"tag:dolby.com,2018:dash:EC3_ExtensionType:2018"==N.attributes.schemeIdUri&&"JOC"==N.attributes.value})&&(v=!0);u=!1;l&&(u=h.includes("forced_subtitle")||h.includes("forced-subtitle"));var J;if(y&&((w=w.find(function(N){return["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"].includes(N.attributes.schemeIdUri)}))&&(J=w.attributes.value),!J))return null;var M;
|
|
l=b.J.codecs;b.profiles.includes("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")&&(l.includes("hvc1.2.4.L153.B0")||l.includes("hev1.2.4.L153.B0"))&&(M="PQ");w=b.J.id?b.ra.id+","+b.J.id:"";a.G.length&&q&&a.s.set(b.ra.id+","+q,ex(b));b.J.vf&&fx(a,b.J.vf,C,b.presentationTimeline);-1!=C.endTime&&null!=b.ra.id&&null!=b.J.id&&((q=a.B.get(b.ra.id))?(q.endTime=C.endTime,q.Vg.includes(b.J.id)||q.Vg.push(b.J.id),a.B.set(b.ra.id,q)):a.B.set(b.ra.id,{endTime:C.endTime,timeline:C.timeline,Vg:[b.J.id]}));
|
|
var O=w&&a.o.has(w)?a.o.get(w):{id:a.Ba++,originalId:b.J.id,groupId:null,createSegmentIndex:function(){return Promise.resolve()},closeSegmentIndex:function(){O.segmentIndex&&(O.segmentIndex.release(),O.segmentIndex=null)},segmentIndex:null,mimeType:b.J.mimeType,codecs:l,frameRate:b.J.frameRate,pixelAspectRatio:b.J.pixelAspectRatio,bandwidth:b.bandwidth,width:b.J.width,height:b.J.height,kind:d,encrypted:0<c.drmInfos.length,drmInfos:c.drmInfos,keyIds:n,language:e,originalLanguage:b.ma.language,label:f,
|
|
type:b.ma.contentType,primary:g,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:b.J.emsgSchemeIdUris,roles:h,forced:u,channelsCount:b.J.mf,audioSamplingRate:b.J.audioSamplingRate,spatialAudio:v,closedCaptions:k,hdr:M,colorGamut:void 0,videoLayout:void 0,tilesLayout:J,accessibilityPurpose:m,external:!1,fastSwitching:!1,fullMimeTypes:new Set([De(b.J.mimeType,b.J.codecs)]),isAudioMuxedInVideo:!1,baseOriginalId:null};O.createSegmentIndex=function(){var N;return Q(function(P){if(1==P.g){if(O.segmentIndex)return P.u(0);
|
|
N=O;return F(P,C.Jc(),3)}N.segmentIndex=P.h;G(P)})};w&&b.hc&&!a.o.has(w)&&(b=b.ra.id||"",a.C.has(b)||a.C.set(b,[]),a.o.set(w,O),a.C.get(b).push(w));return O}
|
|
function fx(a,b,c,d){if(!a.ka.has(b)){a.ka.add(b);var e=xd(b,"presentationTime",Fd)||0,f=ud(b,"UTCTiming"),g;if(g=f&&f.attributes.schemeIdUri)f=f.attributes.schemeIdUri,g=!("urn:mpeg:dash:utc:http-ntp:2014"===f||"urn:mpeg:dash:utc:ntp:2014"===f||"urn:mpeg:dash:utc:sntp:2014"===f);g?b=1E3*(xd(b,"wallClockTime",Ad)||0):(b=xd(b,"wallClockTime",Fd)||0,b=Oj(b));c=new Date(b-e/c.timescale*1E3);e=c.getTime()/1E3;isNaN(e)||(d.o||d.gh(e),d=(new Map).set("detail",{wallClockTime:b,programStartDate:c}),d=new V("prft",
|
|
d),a.j.onEvent(d))}}function ex(a){function b(c){if(!c)return null;c=fd(c);c.xd=null;c.pc=null;c.Cc=Pd(c.Cc);c.vf=null;return c}a=fd(a);a.ra=b(a.ra);a.ma=b(a.ma);a.J=b(a.J);a.na&&(a.na=fd(a.na),a.na.node=null);return a}
|
|
function Cw(a){var b,c;return Q(function(d){switch(d.g){case 1:return b=0,wa(d,2),F(d,Dw(a),4);case 4:b=d.h;za(d,3);break;case 2:if(c=Aa(d),a.j){if(a.g.raiseFatalErrorOnManifestUpdateRequestFailure)return a.j.onError(c),d.return();c.severity=1;a.j.onError(c)}case 3:if(!a.j)return d.return();a.j.onManifestUpdated();Ew(a,b);G(d)}})}function Ew(a,b){if(!(0>a.K)){var c=a.K;0<=a.g.updatePeriod&&(c=a.g.updatePeriod);a.L.ha(Math.max(c-b,Wa(a.xa)))}}
|
|
function Xw(a,b,c,d){c=c||{contentType:"",mimeType:"",codecs:"",emsgSchemeIdUris:[],frameRate:void 0,pixelAspectRatio:void 0,mf:null,audioSamplingRate:null,pb:0,Af:0,encrypted:!1};d=d||c.cb;var e=b.attributes.id,f=b.attributes.supplementalId,g=qd(b,"BaseURL"),h,k=!1;if(a.h)for(var l=t(g),m=l.next();!m.done;m=l.next()){var n=m.value;m=n.attributes.serviceLocation;n=sd(n);m&&n&&(xv(a.h,e,m,n),k=!0)}k&&a.h||(h=g.map(sd));l=b.attributes.contentType||c.contentType;m=b.attributes.mimeType||c.mimeType;n=
|
|
im([b.attributes.codecs||c.codecs]).join(",");var q=xd(b,"frameRate",Id)||c.frameRate,r=b.attributes.sar||c.pixelAspectRatio,u=gx(qd(b,"InbandEventStream"),c.emsgSchemeIdUris),w=qd(b,"AudioChannelConfiguration");w=hx(w)||c.mf;var v=xd(b,"audioSamplingRate",Fd)||c.audioSamplingRate;l||(l=cx(m,n));var y=ud(b,"SegmentBase"),z=ud(b,"SegmentTemplate"),A=y?xd(y,"availabilityTimeOffset",Gd)||0:0,B=z?xd(z,"availabilityTimeOffset",Gd)||0:0,E=g&&g.length?xd(g[0],"availabilityTimeOffset",Gd)||0:0;A=c.pb+E+A+
|
|
B;B=null;(E=ud(b,"SegmentSequenceProperties"))&&(E=ud(E,"SAP"))&&(B=xd(E,"cadence",Dd));E=b.attributes.label;var H=qd(b,"Label");H&&H.length&&(H=H[0],rd(H)&&(E=rd(H)));return{cb:function(){return qc(d(),g.length?a.h&&k?yv(a.h,e):h?h:[]:[])},xd:y||c.xd,pc:ud(b,"SegmentList")||c.pc,Cc:z||c.Cc,vf:ud(b,"ProducerReferenceTime")||c.vf,width:xd(b,"width",Fd)||c.width,height:xd(b,"height",Fd)||c.height,contentType:l,mimeType:m,codecs:n,frameRate:q,pixelAspectRatio:r,emsgSchemeIdUris:u,id:f||e,originalId:e,
|
|
language:b.attributes.lang,mf:w,audioSamplingRate:v,pb:A,Ye:null,Af:B||c.Af,label:E||null,encrypted:!1}}function gx(a,b){b=b.slice();a=t(a);for(var c=a.next();!c.done;c=a.next())c=c.value.attributes.schemeIdUri,b.includes(c)||b.push(c);return b}
|
|
function hx(a){a=t(a);for(var b=a.next();!b.done;b=a.next()){b=b.value;var c=b.attributes.schemeIdUri;if(c&&(b=b.attributes.value))switch(c){case "urn:mpeg:dash:outputChannelPositionList:2012":return b.trim().split(/ +/).length;case "urn:mpeg:dash:23003:3:audio_channel_configuration:2011":case "urn:dts:dash:audio_channel_configuration:2012":b=parseInt(b,10);if(!b)continue;return b;case "tag:dolby.com,2015:dash:audio_channel_configuration:2015":c=[2,1,2,2,2,2,1,2,2,1,1,1,1,2,1,1,2,2];b=parseInt(b,
|
|
16);if(!b)continue;for(var d=0,e=0;e<c.length;e++)b&1<<e&&(d+=c[e]);if(d)return d;continue;case "tag:dolby.com,2014:dash:audio_channel_configuration:2011":case "urn:dolby:dash:audio_channel_configuration:2011":c=[1,1,1,1,1,2,2,1,1,2,2,2,1,2,1,1].reverse();b=parseInt(b,16);if(!b)continue;for(e=d=0;e<c.length;e++)b&1<<e&&(d+=c[e]);if(d)return d;continue;case "urn:mpeg:mpegB:cicp:ChannelConfiguration":if(c=[0,1,2,3,4,5,6,8,2,3,4,7,8,24,8,12,10,12,14,12,14],(b=parseInt(b,10))&&0<b&&b<c.length)return c[b]}}return null}
|
|
function dx(a){var b=a.xd?1:0;b+=a.pc?1:0;b+=a.Cc?1:0;if(0==b)return a.contentType==wc||"application"==a.contentType?!0:!1;1!=b&&(a.xd&&(a.pc=null),a.Cc=null);return!0}
|
|
function ix(a,b,c,d){var e,f,g,h,k,l,m;return Q(function(n){if(1==n.g)return e=[hc(c)],f=qc(b(),e),g=Lg(f,a.g.retryParameters),g.method=d,h=a.j.networkingEngine.request(4,g,{isPreload:a.oa()}),Fg(a.P,h),F(n,h.promise,2);k=n.h;if("HEAD"==d){if(!k.headers||!k.headers.date)return n.return(0);l=k.headers.date}else l=ac(k.data);m=Date.parse(l);return isNaN(m)?n.return(0):n.return(m-Date.now())})}
|
|
function Ow(a,b,c){var d,e,f,g,h,k,l,m;return Q(function(n){switch(n.g){case 1:d=c.map(function(q){return{scheme:q.attributes.schemeIdUri,value:q.attributes.value}}),e=a.g.dash.clockSyncUri,!d.length&&e&&d.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:e}),f=t(d),g=f.next();case 2:if(g.done){n.u(4);break}h=g.value;wa(n,5);k=h.scheme;l=h.value;switch(k){case "urn:mpeg:dash:utc:http-head:2014":case "urn:mpeg:dash:utc:http-head:2012":return n.u(7);case "urn:mpeg:dash:utc:http-xsdate:2014":case "urn:mpeg:dash:utc:http-iso:2014":case "urn:mpeg:dash:utc:http-xsdate:2012":case "urn:mpeg:dash:utc:http-iso:2012":return n.u(8);
|
|
case "urn:mpeg:dash:utc:direct:2014":case "urn:mpeg:dash:utc:direct:2012":return m=Date.parse(l),n.return(isNaN(m)?0:m-Date.now());case "urn:mpeg:dash:utc:http-ntp:2014":case "urn:mpeg:dash:utc:ntp:2014":case "urn:mpeg:dash:utc:sntp:2014":bb("NTP UTCTiming scheme is not supported");break;default:bb("Unrecognized scheme in UTCTiming element",k)}n.u(9);break;case 7:return F(n,ix(a,b,l,"HEAD"),10);case 10:return n.return(n.h);case 8:return F(n,ix(a,b,l,"GET"),11);case 11:return n.return(n.h);case 9:za(n,
|
|
3);break;case 5:Aa(n);case 3:g=f.next();n.u(2);break;case 4:return bb("A UTCTiming element should always be given in live manifests! This content may not play on clients with bad clocks!"),n.return(0)}})}
|
|
function Yw(a,b,c,d,e){var f=d.attributes.schemeIdUri||"",g=d.attributes.value||"",h=xd(d,"timescale",Fd)||1,k=xd(d,"presentationTimeOffset",Fd)||0;d=t(qd(d,"Event"));for(var l=d.next();!l.done;l=d.next()){l=l.value;var m=xd(l,"presentationTime",Fd)||0,n=xd(l,"duration",Fd)||0;m=Math.max((m-k)/h+b,b);n=m+n/h;null!=c&&(m=Math.min(m,b+c),n=Math.min(n,b+c));n<e||(l={schemeIdUri:f,value:g,startTime:m,endTime:n,id:l.attributes.id||"",timescale:h,eventElement:Od(l),eventNode:Pd(l)},a.j.onTimelineRegionAdded(l))}}
|
|
function Vw(a,b,c,d,e){var f,g,h,k;return Q(function(l){if(1==l.g)return f=Rg,g=e?0:1,h=mm(b,c,d,a.g.retryParameters),F(l,Gw(a,h,f,{type:g}),2);k=l.h;return l.return(k.data)})}function cx(a,b){b=De(a,b);return Te(b)?wc:a.split("/")[0]}function Gw(a,b,c,d){d||(d={});d.isPreload=a.oa();b=a.j.networkingEngine.request(c,b,d);Fg(a.P,b);return b.promise}
|
|
function Fw(a){var b=a.l.Zd;if(!a.l.kf||!b||!a.G.length)return[];var c=Date.now()/1E3,d=a.G.filter(function(e){e=Fd(e.attributes.ttl);return!e||b+e>c}).map(sd).filter(cf);return d.length?qc(a.A,d):[]}T("shaka.dash.DashParser",Bw);si("application/dash+xml",function(){return new Bw});si("video/vnd.mpeg.dash.mpd",function(){return new Bw});function jx(){}T("shaka.dependencies",jx);jx.has=function(a){return kx.has(a)};jx.add=function(a,b){if(!lx[a])throw Error(a+" is not supported");a==mx?wb("mux.js","mux.js is no longer used in Shaka Player."):kx.set(a,function(){return b})};var mx="muxjs",lx={um:mx,ISOBoxer:"ISOBoxer"};jx.Allowed=lx;var kx=new Map([["ISOBoxer",function(){return window.ISOBoxer}]]);function nx(){this.j=new pb(function(){return navigator.userAgent.match(/Smart( ?|_)TV/i)||navigator.userAgent.match(/Android ?TV/i)?"TV":navigator.userAgentData?navigator.userAgentData.mobile?"MOBILE":"DESKTOP":/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)?"MOBILE":navigator.userAgentData&&navigator.userAgentData.platform?"android"==navigator.userAgentData.platform.toLowerCase()?"MOBILE":"DESKTOP":navigator.userAgent.includes("Android")?"MOBILE":"DESKTOP"});this.l=new pb(function(){return navigator.vendor.includes("Apple")&&
|
|
(navigator.userAgent.includes("Version/")||navigator.userAgent.includes("OS/"))?"WEBKIT":navigator.userAgent.includes("Edge/")?"EDGE":navigator.userAgent.includes("Chrome/")?"CHROMIUM":navigator.userAgent.includes("Firefox/")?"GECKO":"UNKNOWN"})}function vi(){var a=window.ManagedMediaSource||window.MediaSource;return a&&a.isTypeSupported?!0:!1}p=nx.prototype;p.bc=function(){return!!navigator.mediaCapabilities};p.La=function(){return this.j.value()};p.Ea=function(){return this.l.value()};p.be=function(){return!1};
|
|
p.wi=function(){return!1};p.Ze=function(){return!1};p.xi=function(){return!1};p.ae=function(){return!1};p.Xc=function(){return!0};p.Yc=function(){return!0};p.ge=function(){return!0};p.Di=function(){return 0};p.ec=function(){return Promise.resolve({width:Infinity,height:Infinity})};p.Mi=function(){return!1};p.jh=function(){return!1};
|
|
p.Ta=function(a){var b=this.La();if("TV"===b||"CONSOLE"===b||"CAST"===b)a.ads.customPlayheadTracker=!0,a.ads.skipPlayDetection=!0,a.ads.supportsMultipleMediaElements=!1;return a};p.oh=function(){return!!window.indexedDB};p.ti=function(){return[]};function un(a){qb();return void 0!==window.matchMedia&&window.matchMedia("(color-gamut: p3)").matches?a?"HLG":"PQ":"SDR"}p.Ti=function(){return!1};p.ii=function(){return!1};p.Zg=function(){return!1};p.nh=function(){return!0};p.ji=function(){return!1};
|
|
p.Si=function(){return!0};p.toString=function(){return"Device: "+this.Mb()+" v"+this.Ca()+"; Type: "+this.La()};function ox(){nx.call(this);this.g=new pb(function(){var a=navigator.userAgent.match(/Version\/(\d+)/);return a?parseInt(a[1],10):(a=navigator.userAgent.match(/OS (\d+)(?:_\d+)?/))?parseInt(a[1],10):null});this.h=new pb(function(){return/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||1<navigator.maxTouchPoints?"MOBILE":"xr"in navigator?"VR":"DESKTOP"})}pa(ox,nx);p=ox.prototype;p.Ca=function(){return this.g.value()};p.Mb=function(){return"Apple Browser"};p.La=function(){return this.h.value()};
|
|
p.Ea=function(){return"WEBKIT"};p.bc=function(){return!1};p.be=function(a,b){return"audio"===b};p.Ze=function(){return!0};p.xi=function(a){return"audio"===a};p.Ta=function(a){nx.prototype.Ta.call(this,a);a.abr.minTimeToSwitch=.5;return a};p.Ti=function(){return!0};
|
|
(navigator.vendor||"").includes("Apple")&&(/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||1<navigator.maxTouchPoints||navigator.userAgentData&&navigator.userAgentData.platform&&"macos"==navigator.userAgentData.platform.toLowerCase()||navigator.platform&&navigator.platform.toLowerCase().includes("mac"))&&(tb=function(){return new ox});function px(){if(!qx())throw Error("Not a Chromecast device!");nx.call(this);this.h=new pb(function(){var a=navigator.userAgent.match(/Chrome\/(\d+)/);return a?parseInt(a[1],10):null});this.g=new pb(function(){var a=navigator.userAgentData&&navigator.userAgentData.platform||navigator.userAgent;a=a.toLowerCase();return a.includes("android")?rx:a.includes("fuchsia")?sx:tx})}pa(px,nx);p=px.prototype;p.Ca=function(){return this.h.value()};p.Mb=function(){return"Chromecast with "+this.g.value()};
|
|
p.La=function(){return"CAST"};p.Ea=function(){return"CHROMIUM"};p.bc=function(){return nx.prototype.bc.call(this)&&this.g.value()!==tx};p.Yc=function(){return this.g.value()!==tx};p.Di=function(){switch(this.g.value()){case rx:return 0;case sx:return 3;default:return 1}};
|
|
p.ec=function(){var a,b,c,d,e;return Q(function(f){switch(f.g){case 1:a=window.cast&&cast.__platform__&&cast.__platform__.canDisplayType;b={width:1280,height:720};wa(f,2);if(!(c=a)){f.u(4);break}return F(f,cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160'),5);case 5:c=f.h;case 4:if(c){b.width=3840;b.height=2160;f.u(6);break}if(!(d=a)){f.u(7);break}return F(f,cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=1920; height=1080'),8);case 8:d=
|
|
f.h;case 7:d&&(b.width=1920,b.height=1080);case 6:za(f,3);break;case 2:e=Aa(f),ab("Failed to check canDisplayType:",e);case 3:return f.return(b)}})};p.Ta=function(a){nx.prototype.Ta.call(this,a);a.streaming.stallSkip=0;return a};p.oh=function(){return!1};function qx(){return navigator.userAgent.includes("CrKey")&&!navigator.userAgent.includes("VIZIO SmartCast")}var rx="Android",sx="Fuchsia",tx="Linux";qx()&&(tb=function(){return new px});function ux(){nx.call(this);var a=this;this.i=new pb(function(){var b=navigator.userAgent.match(/(Chrome|Firefox)\/(\d+)/);return b?parseInt(b[2],10):null});this.g=new pb(function(){return navigator.userAgent.match(/Edge?\//)?"Edge":navigator.userAgent.includes("Chrome")?"Chrome":navigator.userAgent.includes("Firefox")?"Firefox":"Unknown"});this.h=new pb(function(){return navigator.userAgentData&&navigator.userAgentData.platform?"windows"==navigator.userAgentData.platform.toLowerCase():navigator.platform?
|
|
navigator.platform.toLowerCase().includes("win32"):!1});this.o=new pb(function(){return navigator.userAgent.match(/Edge?\//)?!a.h.value():!0});this.m=new pb(function(){return navigator.userAgent.includes("sony.hbbtv.tv.G5")})}pa(ux,nx);p=ux.prototype;p.Ca=function(){return this.i.value()};p.Mb=function(){return this.g.value()};p.be=function(a){return mg(a)?"Edge"===this.g.value()&&this.h.value():!1};p.wi=function(){return"Edge"===this.g.value()&&this.h.value()};
|
|
p.Ze=function(){return"Edge"===this.g.value()&&this.h.value()};p.Yc=function(){return this.o.value()};p.Ta=function(a){nx.prototype.Ta.call(this,a);this.h.value()&&"Edge"!==this.g.value()&&(a.drm.keySystemsMapping={"com.microsoft.playready":"com.microsoft.playready.recommendation"});return a};p.Zg=function(){return"Edge"===this.g.value()||this.m.value()};ub=function(){return new ux};function vx(){nx.apply(this,arguments)}pa(vx,nx);p=vx.prototype;p.Ca=function(){return null};p.Mb=function(){return"Hisense"};p.La=function(){return"TV"};p.bc=function(){return!1};p.ec=function(){var a={width:1920,height:1080},b=null;if(window.Hisense_Get4KSupportState)try{b=window.Hisense_Get4KSupportState()}catch(c){}null==b&&(b=navigator.userAgent.includes("UHD"));b&&(a.width=3840,a.height=2160);return Promise.resolve(a)};p.Ta=function(a){nx.prototype.Ta.call(this,a);a.streaming.stallSkip=0;return a};
|
|
if(navigator.userAgent.includes("Hisense")||navigator.userAgent.includes("VIDAA"))tb=function(){return new vx};function wx(){nx.call(this);this.g=new pb(function(){var a=navigator.userAgent.match(/PlayStation (\d+)/);return a?parseInt(a[1],10):null})}pa(wx,nx);p=wx.prototype;p.Mb=function(){return"PlayStation"};p.La=function(){return"CONSOLE"};p.Ea=function(){return"WEBKIT"};p.Ca=function(){return this.g.value()};p.bc=function(){return!1};p.Xc=function(){return!1};p.Yc=function(){return!1};p.jh=function(){return 4===this.Ca()};
|
|
p.ec=function(){var a,b,c,d,e;return Q(function(f){switch(f.g){case 1:return a={width:1920,height:1080},b=!1,wa(f,2),F(f,window.msdk.device.getDisplayInfo(),4);case 4:c=f.h;b="4K"===c.resolution;za(f,3);break;case 2:return Aa(f),wa(f,5),F(f,window.msdk.device.getDisplayInfoImmediate(),7);case 7:d=f.h;b="4K"===d.resolution;za(f,3);break;case 5:e=Aa(f),bb("PlayStation: Failed to get the display info:",e);case 3:return b&&(a.width=3840,a.height=2160),f.return(a)}})};
|
|
p.Ta=function(a){nx.prototype.Ta.call(this,a);4===this.Ca()&&a.drm.preferredKeySystems.push("com.microsoft.playready");a.streaming.clearDecodingCache=!0;return a};p.Zg=function(){return 4===this.Ca()};p.nh=function(){return 4!==this.Ca()};navigator.userAgent.includes("PlayStation")&&(tb=function(){return new wx});function xx(){nx.call(this);var a=navigator.userAgent.match(/Tizen (\d+).(\d+)/);this.g=a?parseInt(a[1],10):null;this.h=a?parseInt(a[2],10):null}pa(xx,nx);p=xx.prototype;p.Ca=function(){return this.g};p.Mb=function(){return"Tizen"};p.Ea=function(){return"CHROMIUM"};p.La=function(){return"TV"};p.be=function(){return!0};p.ae=function(){return 3===this.Ca()};p.bc=function(){return!1};p.Xc=function(){var a=this.Ca();return null!==a?4<=a:nx.prototype.Xc.call(this)};p.Yc=function(){return!1};
|
|
p.ge=function(){return this.g&&this.h?5===this.g?5<=this.h:5<this.g:nx.prototype.ge.call(this)};
|
|
p.ec=function(){var a={width:1920,height:1080};try{if(webapis.systeminfo&&webapis.systeminfo.getMaxVideoResolution){var b=webapis.systeminfo.getMaxVideoResolution();a.width=b.width;a.height=b.height}else webapis.productinfo.is8KPanelSupported&&webapis.productinfo.is8KPanelSupported()?(a.width=7680,a.height=4320):webapis.productinfo.isUdPanelSupported&&webapis.productinfo.isUdPanelSupported()&&(a.width=3840,a.height=2160)}catch(c){bb("Tizen: Error detecting screen size, default screen size 1920x1080.")}return Promise.resolve(a)};
|
|
p.Ta=function(a){nx.prototype.Ta.call(this,a);a.drm.ignoreDuplicateInitData=2!==this.Ca();3===this.Ca()&&(a.streaming.crossBoundaryStrategy="reset");a.streaming.shouldFixTimestampOffset=!0;a.streaming.stallSkip=0;a.streaming.gapPadding=2;return a};p.ti=function(){var a=[];null!==this.g&&5>this.g&&a.push("opus");return a};p.ii=function(){return!0};p.ji=function(){return 3===this.Ca()};navigator.userAgent.includes("Tizen")&&(tb=function(){return new xx});function yx(){nx.apply(this,arguments)}pa(yx,nx);yx.prototype.Ca=function(){return null};yx.prototype.Mb=function(){return"Vizio"};yx.prototype.La=function(){return"TV"};yx.prototype.bc=function(){return!1};navigator.userAgent.includes("VIZIO SmartCast")&&(tb=function(){return new yx});function zx(){nx.call(this);this.h=new pb(function(){return navigator.userAgent.includes("DT_STB_BCM")});this.g=new pb(function(){if(navigator.userAgent.includes("DT_STB_BCM"))return 11;var a=navigator.userAgent.match(/Version\/(\d+)/);return a?parseInt(a[1],10):(a=navigator.userAgent.match(/OS (\d+)(?:_\d+)?/))?parseInt(a[1],10):null})}pa(zx,nx);p=zx.prototype;p.Ca=function(){return this.g.value()};p.Mb=function(){return"WebKit STB"};p.La=function(){return"TV"};p.Ea=function(){return"WEBKIT"};
|
|
p.bc=function(){return!1};p.Xc=function(){var a=this.g.value();return null!==a?15<=a:!0};p.ec=function(){return Promise.resolve({width:window.screen.width*window.devicePixelRatio,height:window.screen.height*window.devicePixelRatio})};p.nh=function(){return!this.h.value()};
|
|
if(navigator.userAgent.includes("DT_STB_BCM")||navigator.userAgent.includes("DT_STB_BCM")||!(!(navigator.vendor||"").includes("Apple")||/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||1<navigator.maxTouchPoints||navigator.userAgentData&&navigator.userAgentData.platform&&"macos"==navigator.userAgentData.platform.toLowerCase()||navigator.platform&&navigator.platform.toLowerCase().includes("mac")))tb=function(){return new zx};function Ax(){nx.call(this);this.g=Bx()}pa(Ax,nx);p=Ax.prototype;p.Ca=function(){return this.g};p.Mb=function(){return"WebOS"};p.La=function(){return"TV"};p.Ea=function(){return"CHROMIUM"};p.bc=function(){return!1};p.Xc=function(){var a=this.Ca();return null!==a?3<a:nx.prototype.Xc.call(this)};p.Yc=function(){var a=this.Ca();return null!==a?6<a:nx.prototype.Yc.call(this)};p.ge=function(){var a=this.Ca();return null!==a?3<a:nx.prototype.ge.call(this)};
|
|
p.ec=function(){var a={width:1920,height:1080};try{var b=JSON.parse(window.PalmSystem.deviceInfo);a.width=Math.max(1920,b.screenWidth);a.height=Math.max(1080,b.screenHeight)}catch(c){bb("WebOS: Error detecting screen size, default screen size 1920x1080.")}return Promise.resolve(a)};p.Ta=function(a){nx.prototype.Ta.call(this,a);3===this.Ca()&&(a.streaming.crossBoundaryStrategy="reset");a.streaming.shouldFixTimestampOffset=!0;a.streaming.stallSkip=0;return a};
|
|
function Bx(){var a=null,b=navigator.userAgent.match(/Chrome\/(\d+)/);b&&(a=parseInt(b[1],10));switch(a){case 38:return 3;case 53:return 4;case 68:return 5;case 79:return 6;case 87:return 22;case 94:return 23;case 108:return 24;case 120:return 25;default:return null}}p.Si=function(){return!1};navigator.userAgent.includes("Web0S")&&(tb=function(){return new Ax});function Cx(){nx.call(this);this.g=navigator.userAgent.includes("Edge/");var a=navigator.userAgent.match(/Edge?\/(\d+)/);this.h=a?parseInt(a[1],10):null}pa(Cx,nx);p=Cx.prototype;p.Ca=function(){return this.h};p.Mb=function(){return"Xbox"};p.La=function(){return"CONSOLE"};p.Ea=function(){return this.g?"EDGE":"CHROMIUM"};p.be=function(){return!0};p.Ze=function(){return!0};p.Mi=function(){return this.g};
|
|
p.ec=function(){var a={width:1920,height:1080},b=Dx();if(b)try{var c=new b.Media.Protection.ProtectionCapabilities,d=b.Media.Protection.ProtectionCapabilityResult;b=null;do b=c.isTypeSupported('video/mp4;codecs="hvc1,mp4a";features="decode-res-x=3840,decode-res-y=2160,decode-bitrate=20000,decode-fps=30,decode-bpc=10,display-res-x=3840,display-res-y=2160,display-bpc=8"',"com.microsoft.playready.recommendation");while(b===d.maybe);b===d.probably&&(a.width=3840,a.height=2160)}catch(e){bb("Xbox: Error detecting screen size, default screen size 1920x1080.")}return Promise.resolve(a)};
|
|
p.Ta=function(a){nx.prototype.Ta.call(this,a);a.drm.parseInbandPsshEnabled=this.g;a.drm.preferredKeySystems.push("com.microsoft.playready");this.g&&(a.streaming.gapPadding=.01);return a};p.oh=function(){return!1};function Dx(){var a=null;try{a="undefined"!==typeof Windows?Windows:chrome.webview.hostObjects.sync.Windows}catch(b){}return a}if(navigator.userAgent.includes("Xbox One")||null!==Dx())tb=function(){return new Cx};function Ex(a,b,c){this.type=a;this.ea=b;this.segments=c||null}function Fx(a,b,c,d){this.id=a;this.name=b;this.attributes=c;this.value=void 0===d?null:d}Fx.prototype.toString=function(a){function b(e){return e.name+"="+(isNaN(Number(e.value))?'"'+e.value+'"':e.value)}var c="#"+this.name,d=this.attributes?this.attributes.filter(function(e){return a?!a.has(e.name):!0}).map(b):[];this.value&&d.unshift(this.value);0<d.length&&(c+=":"+d.join(","));return c};
|
|
function Gx(a,b){if(b)return a.toString();b=(new Set).add("AUDIO").add("VIDEO").add("SUBTITLES").add("PATHWAY-ID").add("GROUP-ID").add("URI");return a.toString(b)}function Hx(a,b){a=a.attributes.filter(function(c){return c.name==b});return a.length?a[0]:null}function Ix(a,b,c){return(a=Hx(a,b))?a.value:c||null}function Jx(a,b){a=Hx(a,b);if(!a)throw new U(2,4,4023,b);return a.value}function Kx(a,b,c){c=void 0===c?[]:c;this.ea=b;this.g=a;this.Zb=c}function Lx(a,b){this.name=a;this.value=b};function Mx(a,b){return a.filter(function(c){return c.name==b})}function Nx(a,b){return a.filter(function(c){return Jx(c,"TYPE")==b})}function Ox(a,b){a=t(a);for(var c=a.next();!c.done;c=a.next())if(c=c.value,c.name===b)return c;return null}function Px(a,b,c){c=void 0===c?0:c;return(a=Ox(a,b))?Number(a.value):c}function Qx(a,b,c){return b?Rx(a,[b],c):[]}function Rx(a,b,c){if(!b.length)return[];var d=b;c&&c.size&&(d=b.map(function(e){return Sx(e,c)}));return qc(a,d)}
|
|
function Sx(a,b){if(!b||!b.size)return a;a=String(a).replace(/%7B/g,"{").replace(/%7D/g,"}");var c=a.match(/{\$\w*}/g);if(c){c=t(c);for(var d=c.next();!d.done;d=c.next()){d=d.value;var e=d.slice(2,d.length-1),f=b.get(e);if(f)a=a.replace(d,f);else throw new U(2,4,4039,e);}}return a};function Tx(){this.g=0}
|
|
function Ux(a,b){b=ac(b);b=b.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n").trim();var c=b.split(/\n+/m);if(!/^#EXTM3U($|[ \t\n])/m.test(c[0]))throw new U(2,4,4015);b=0;for(var d=!0,e=t(c),f=e.next();!f.done;f=e.next())if(f=f.value,/^#(?!EXT)/m.test(f)||d)d=!1;else if(f=Vx(a,f),--a.g,Wx.includes(f.name)){b=1;break}else"EXT-X-STREAM-INF"==f.name&&(d=!0);e=[];d=!0;for(f=0;f<c.length;f++){var g=c[f],h=c[f+1];if(/^#(?!EXT)/m.test(g)||d)d=!1;else{g=Vx(a,g);if(Xx.includes(g.name)){if(1!=b)throw new U(2,4,4017);g=
|
|
c.splice(f,c.length-f);c=[];d=[];f=[];h=null;g=t(g);for(var k=g.next();!k.done;k=g.next())k=k.value,/^(#EXT)/.test(k)?(k=Vx(a,k),Wx.includes(k.name)?e.push(k):"EXT-X-MAP"==k.name?h=k:"EXT-X-PART"==k.name?f.push(k):"EXT-X-PRELOAD-HINT"==k.name?"PART"==Ix(k,"TYPE")?f.push(k):"MAP"==Ix(k,"TYPE")&&(k.name="EXT-X-MAP",h=k):d.push(k)):/^#(?!EXT)/m.test(k)||(k=k.trim(),h&&d.push(h),c.push(new Kx(k,d,f)),d=[],f=[]);f.length&&(h&&d.push(h),c.push(new Kx("",d,f)));return new Ex(b,e,c)}e.push(g);"EXT-X-STREAM-INF"==
|
|
g.name&&(g.attributes.push(new Lx("URI",h)),d=!0)}}return new Ex(b,e)}function Vx(a,b){a=a.g++;var c=b.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!c)throw new U(2,4,4016,b);b=c[1];var d=c[2];c=[];var e;if(d){d=new Xc(d);var f;(f=Zc(d,/^([^,=]+)(?:,|$)/g))&&(e=f[1]);for(var g=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;f=Zc(d,g);)c.push(new Lx(f[1],f[2]||f[3])),Yc(d)}return new Fx(a,b,c,e)}
|
|
var Wx="EXT-X-TARGETDURATION EXT-X-MEDIA-SEQUENCE EXT-X-DISCONTINUITY-SEQUENCE EXT-X-PLAYLIST-TYPE EXT-X-I-FRAMES-ONLY EXT-X-ENDLIST EXT-X-SERVER-CONTROL EXT-X-SKIP EXT-X-PART-INF EXT-X-DATERANGE".split(" "),Xx="EXTINF EXT-X-BYTERANGE EXT-X-DISCONTINUITY EXT-X-PROGRAM-DATE-TIME EXT-X-KEY EXT-X-DATERANGE EXT-X-MAP EXT-X-GAP EXT-X-TILES".split(" ");function Yx(){}function Zx(a,b){try{var c=$x(a);return xg({uri:a,originalUri:a,data:c.data,headers:{"content-type":c.contentType},originalRequest:b})}catch(d){return vg(d)}}
|
|
function $x(a){var b=a.split(":");if(2>b.length||"data"!=b[0])throw new U(2,1,1004,a);b=b.slice(1).join(":").split(",");if(2>b.length)throw new U(2,1,1004,a);var c=b[0];a=window.decodeURIComponent(b.slice(1).join(","));b=c.split(";");c=b[0];var d=!1;1<b.length&&"base64"==b[b.length-1]&&(d=!0,b.pop());var e;d?e=mc(a):e=ec(a);return{data:e,contentType:c}}T("shaka.net.DataUriPlugin",Yx);Yx.parse=Zx;Hg("data",Zx);function ay(){var a=this;this.g=this.h=null;this.F=1;this.A=new Map;this.I=new Map;this.M=new Map;this.M.set("video",new Map);this.M.set("audio",new Map);this.M.set(wc,new Map);this.M.set("image",new Map);this.Yb=(new Map).set("com.apple.streamingkeydelivery",function(b,c,d){return by(a,b,c,d)}).set("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",function(b){var c=Jx(b,"METHOD");if(["SAMPLE-AES","SAMPLE-AES-CTR"].includes(c)){var d="cenc";"SAMPLE-AES"==c&&(d="cbcs");c=Jx(b,"URI");c=$x(c.split("?")[0]);
|
|
c=Tb(c.data);d=rc("com.widevine.alpha",d,[{initDataType:"cenc",initData:c}]);(b=Ix(b,"KEYID"))&&d.keyIds.add(b.toLowerCase().substr(2));b=Promise.resolve(d)}else b=Promise.resolve(null);return b}).set("com.microsoft.playready",function(b){var c=Jx(b,"METHOD");if(["SAMPLE-AES","SAMPLE-AES-CTR"].includes(c)){var d="cenc";"SAMPLE-AES"==c&&(d="cbcs");b=Jx(b,"URI");b=$x(b.split("?")[0]);b=Tb(b.data);c=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);c=nh(b,c,new Set,0);d=rc("com.microsoft.playready",
|
|
d,[{initDataType:"cenc",initData:c}]);if(b=jd(["<PLAYREADY>",lc(b),"</PLAYREADY>"].join("\n")))d.licenseServerUri=wu(b);d=Promise.resolve(d)}else d=Promise.resolve(null);return d}).set("urn:uuid:3d5e6d35-9b9a-41e8-b843-dd3c6e72c42c",function(b){var c=Jx(b,"METHOD");if(["SAMPLE-AES","SAMPLE-AES-CTR"].includes(c)){var d="cenc";"SAMPLE-AES"==c&&(d="cbcs");c=Jx(b,"URI");c=$x(c.split("?")[0]);c=Tb(c.data);d=rc("com.huawei.wiseplay",d,[{initDataType:"cenc",initData:c}]);(b=Ix(b,"KEYID"))&&d.keyIds.add(b.toLowerCase().substr(2));
|
|
b=Promise.resolve(d)}else b=Promise.resolve(null);return b});this.ab=new Set;this.i=new Map;this.l=null;this.C="";this.Pa=new Tx;this.K=-1;this.ia=Infinity;this.$=this.mc=this.Za=!1;this.B=new $e(function(){if(a.U&&!a.g.continueLoadingWhenPaused&&(a.S.Ja(a.U,"timeupdate"),a.U.paused)){a.S.za(a.U,"timeupdate",function(){return cy(a)});return}cy(a)});this.Ba=dy;this.m=null;this.Ua=0;this.o=Infinity;this.Ya=this.Ka=this.P=0;this.W=new Eg;this.G=new Map;this.H=new Map;this.xa=new Map;this.oa=new Map;
|
|
this.L=new Map;this.ua=new Map;this.va=new Map;this.kc=this.ka=!1;this.eb=new Va(5);this.j=null;this.N=!0;this.S=new jb;this.s=this.U=null;this.Xb=function(){return!1}}p=ay.prototype;p.configure=function(a,b){var c=this.h&&a.updatePeriod!=this.g.updatePeriod&&0<=a.updatePeriod;this.g=a;b&&(this.Xb=b);this.j&&this.j.configure(this.g);c&&this.m&&this.m.presentationTimeline.V()&&this.B.Hb()};
|
|
p.start=function(a,b){var c=this,d;return Q(function(e){return 1==e.g?(c.h=b,c.ka=b.isLowLatencyMode(),F(e,ey(c,[a]).promise,2)):3!=e.g?(d=e.h,c.C=d.uri,F(e,fy(c,d.data),3)):e.return(c.m)})};
|
|
p.stop=function(){this.B&&(this.B.stop(),this.B=null);var a=[];this.W&&(a.push(this.W.destroy()),this.W=null);this.g=this.h=null;this.ab.clear();this.m=null;this.i.clear();this.I.clear();this.H.clear();this.A.clear();this.xa.clear();this.oa.clear();this.L.clear();this.ua.clear();this.va.clear();this.j&&this.j.destroy();this.S&&(this.S.release(),this.S=null);return Promise.all(a)};
|
|
p.update=function(){var a=this,b,c,d,e,f,g,h,k,l,m,n,q;return Q(function(r){if(1==r.g){if(!gy(a))return r.return();b=[];c=Array.from(a.i.values());a.o=Infinity;a.m.gapCount=0;d=c.filter(function(u){return u.stream.segmentIndex});e=t(d);for(f=e.next();!f.done;f=e.next())g=f.value,b.push(hy(a,g));return F(r,Promise.all(b),2)}iy(a,d.map(function(u){return u.stream}));h=d.some(function(u){return 0==u.Od});d.length&&!h&&(k=jy,ky(a,k.$i),l=d.map(function(u){return u.ic}),a.l.ob(Math.min.apply(Math,x(l))),
|
|
a.h.updateDuration());h&&ly(a);m=t(d);for(n=m.next();!n.done;n=m.next())q=n.value,q.stream.isAudioMuxedInVideo||!q.stream.segmentIndex||Qf(q.stream.segmentIndex)||a.h.disableStream(q.stream);G(r)})};function my(a,b){return gy(a)?a.M.get(b.type):b.gf}
|
|
function hy(a,b){var c,d,e,f,g,h,k,l,m,n,q,r,u,w,v,y,z,A,B,E,H,C,D,I,L,K,J,M,O,N,P,R,S,aa,W,Fa,Ga;return Q(function(xa){switch(xa.g){case 1:if(b.stream.isAudioMuxedInVideo)return xa.return();c=[];d=t(b.O());for(e=d.next();!e.done;e=d.next())f=e.value,g=new Bb(f),h=g.g,b.Le&&(0<=b.Qb&&h.add("_HLS_msn",String(b.Qb)),0<=b.Rb&&h.add("_HLS_part",String(b.Rb))),b.Me&&h.add("_HLS_skip","YES"),Qb(h)&&Fb(g,Gb(h.toString())),c.push(g.toString());wa(xa,2);return F(xa,ey(a,c,!0).promise,4);case 4:k=xa.h;za(xa,
|
|
3);break;case 2:throw l=Aa(xa),a.h&&a.h.disableStream(b.stream),l;case 3:if(!b.stream.segmentIndex)return xa.return();m=Ux(a.Pa,k.data);if(1!=m.type)throw new U(2,4,4017);n=k.uri;n==k.originalUri||b.O().includes(n)||b.wf.push(n);q=Mx(m.ea,"EXT-X-DEFINE");r=ny(a,q,n);u=b.stream;w=my(a,b);return F(xa,oy(a,m,u.mimeType,b.O,r),5);case 5:v=xa.h;y=v.keyIds;z=v.drmInfos;A=v.encrypted;B=v.Dh;u.encrypted||!A||B||(u.encrypted=!0);E=function(qa,Da){return qa.size===Da.size&&[].concat(x(qa)).every(function(Ja){return Da.has(Ja)})};
|
|
E(u.keyIds,y)||(u.keyIds=y,u.drmInfos=z,a.h.newDrmInfo(u));H=py(a,m,w,r,b.O,b.type);C=H.segments;if(D=H.bandwidth)u.bandwidth=D;I=Rl(u);L=t(C);for(K=L.next();!K.done;K=L.next())J=K.value,J.Z&&(J.Z.nd=I);u.segmentIndex.Vd(C,a.l.Eb());C.length&&(M=Px(m.ea,"EXT-X-MEDIA-SEQUENCE",0),N=(O=Ox(m.ea,"EXT-X-SKIP"))?Number(Ix(O,"SKIPPED-SEGMENTS")):0,P=qy(M,C),R=P.Qb,S=P.Rb,b.Qb=R+N,b.Rb=S,aa=w.get(M),u.segmentIndex.$a(aa));if(W=Qf(u.segmentIndex))b.Rc=W.startTime,Fa=C[C.length-1],b.ic=Fa.endTime;if(Ga=Ox(m.ea,
|
|
"EXT-X-ENDLIST"))b.Od=!0;ry(a,m);sy(a,m.ea,u.type,r,b.O);G(xa)}})}p.onExpirationUpdated=function(){};p.onInitialVariantChosen=function(){};p.banLocation=function(a){this.j&&this.j.banLocation(a)};p.setMediaElement=function(a){this.U=a};
|
|
function ty(a,b,c){c=void 0===c?!1:c;for(var d=-1==a.K,e=t(b),f=e.next();!f.done;f=e.next()){f=f.value;var g=f.stream.segmentIndex,h=my(a,f);if(g=Qf(g)){h=t(h);for(var k=h.next();!k.done;k=h.next()){k=t(k.value);var l=k.next().value;if(k.next().value==g.startTime){d&&(a.K=Math.max(a.K,l));f.ig=l;break}}}}if(!(0>a.K))for(b=t(b),d=b.next();!d.done;d=b.next())if(d=d.value,uy(a,d.type)||c)if(e=d.stream.segmentIndex)if(f=a.K-d.ig,0<f&&(e.g.splice(0,f),e=Qf(e)))e=-e.startTime,d.stream.segmentIndex.offset(e),
|
|
vy(a,d,e)}
|
|
function wy(a,b){if(Infinity==a.ia){b=t(b);for(var c=b.next();!c.done;c=b.next())c=Qf(c.value.stream.segmentIndex),null!=c&&null!=c.h&&(a.ia=Math.min(a.ia,c.h))}b=a.ia;if(Infinity!=b){c=t(a.i.values());for(var d=c.next();!d.done;d=c.next())if(d=d.value,!uy(a,d.type)){var e=d.stream.segmentIndex;if(null!=e){var f=Qf(e);if(f)if(null==f.h)ab("Missing EXT-X-PROGRAM-DATE-TIME for stream",d.O(),"Expect AV sync issues!");else for(vy(a,d,f.h-b-f.startTime),d=t(e),e=d.next();!e.done;e=d.next())e.value.ph(b)}}}}
|
|
function vy(a,b,c){if(!(.001>Math.abs(c))){b.Rc+=c;b.ic+=c;a=my(a,b);for(var d=t(a),e=d.next();!e.done;e=d.next()){var f=t(e.value);e=f.next().value;f=f.next().value;a.set(e,f+c)}b.O()}}
|
|
function fy(a,b){var c,d,e,f,g,h,k,l,m,n,q,r,u,w,v,y,z,A,B,E,H,C,D,I,L,K,J,M,O,N,P,R,S,aa,W,Fa,Ga,xa,qa,Da,Ja,ra,da;return Q(function(sa){switch(sa.g){case 1:c=yc;d=Ux(a.Pa,b);e=Mx(d.ea,"EXT-X-DEFINE");f=[];g=[];h=[];a.l=new el(null,0);a.l.Wc(!0);k=function(){return[a.C]};l=null;m=new Map;if(1==d.type)return a.N=!1,R=Mx(d.ea,"EXT-X-DEFINE"),m=ny(a,R,a.C),l=c.wa,S="",aa=new Map,F(sa,xy(a,a.F++,m,d,k,"",l,S,!0,"Media Playlist",null,aa,null,!1,null,!1),7);yy(a,e);n=Mx(d.ea,"EXT-X-MEDIA");q=Mx(d.ea,"EXT-X-STREAM-INF");
|
|
r=Mx(d.ea,"EXT-X-IMAGE-STREAM-INF");u=Mx(d.ea,"EXT-X-I-FRAME-STREAM-INF");w=Mx(d.ea,"EXT-X-SESSION-KEY");v=Mx(d.ea,"EXT-X-SESSION-DATA");y=Mx(d.ea,"EXT-X-CONTENT-STEERING");zy(a,v);return F(sa,Ay(a,y),4);case 4:if(!a.g.ignoreSupplementalCodecs){z=[];A=t(q);B=A.next();for(E={};!B.done;E={Qi:void 0},B=A.next())if(H=B.value,C=Ix(H,"SUPPLEMENTAL-CODECS"))E.Qi=C.split(/\s*,\s*/).map(function(Za){return Za.split("/")[0]}),D=H.attributes.map(function(Za){return function($a){var hb=$a.name,rb=$a.value;"CODECS"==
|
|
hb&&(rb=Za.Qi.join(","),$a=$a.value.split(","),1<$a.length&&($a=uc("audio",$a))&&(rb+=","+$a));return new Lx(hb,rb)}}(E)),z.push(new Fx(H.id,H.name,D,null));q.push.apply(q,x(z));I=[];L=t(u);K=L.next();for(J={};!K.done;J={Ri:void 0},K=L.next())if(M=K.value,O=Ix(M,"SUPPLEMENTAL-CODECS"))J.Ri=O.split(/\s*,\s*/).map(function(Za){return Za.split("/")[0]}),N=M.attributes.map(function(Za){return function($a){var hb=$a.name;$a=$a.value;"CODECS"==hb&&($a=Za.Ri.join(","));return new Lx(hb,$a)}}(J)),I.push(new Fx(M.id,
|
|
M.name,N,null));u.push.apply(u,x(I))}By(a,q);Cy(a,n);P=Dy(a,u);return F(sa,Ey(a,q,w,n,k,a.A,P),5);case 5:return f=sa.h,g=Fy(a,n),F(sa,Gy(a,r,u),6);case 6:h=sa.h;sa.u(3);break;case 7:W=sa.h,a.i.set(a.C,W),W.stream&&(Fa=Rl(W.stream),W.stream.segmentIndex.Cb(function(Za){Za.Z&&(Za.Z.nd=Fa)})),l=W.stream.type,Ga=!0,a.g.disableAudio&&"audio"==W.type?Ga=!1:a.g.disableVideo&&"video"==W.type&&!W.stream.codecs.includes(",")&&(Ga=!1),Ga&&f.push({id:0,language:gf(S||"und"),disabledUntilTime:0,primary:!0,audio:"audio"==
|
|
W.type?W.stream:null,video:"video"==W.type?W.stream:null,bandwidth:W.stream.bandwidth||0,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]});case 3:if(!a.h)throw new U(2,7,7001);Hy(a,d);1==d.type&&(gy(a)&&(Iy(a,d),xa=a.o,a.B.ha(xa)),qa=Array.from(a.i.values()),Jy(a,qa),ly(a),sy(a,d.ea,l,m,k));a.m={presentationTimeline:a.l,variants:f,textStreams:g,imageStreams:h,offlineSessionIds:[],sequenceMode:a.g.hls.sequenceMode,ignoreManifestTimestampsInSegmentsMode:a.g.hls.ignoreManifestTimestampsInSegmentsMode,
|
|
type:"HLS",serviceDescription:null,nextUrl:null,periodCount:1,gapCount:0,isLowLatency:!1,startTime:a.s};if(a.$||!a.g.hls.disableCodecGuessing){sa.u(8);break}Da=[];Ja=t(a.m.variants);for(ra=Ja.next();!ra.done;ra=Ja.next())da=ra.value,da.audio&&""===da.audio.codecs&&Da.push(da.audio.createSegmentIndex()),da.video&&""===da.video.codecs&&Da.push(da.video.createSegmentIndex());return F(sa,Promise.all(Da),8);case 8:a.h.makeTextStreamsForClosedCaptions(a.m),G(sa)}})}
|
|
function Ky(a,b){var c,d,e,f,g,h,k,l,m,n,q,r,u,w,v,y,z,A;return Q(function(B){if(1==B.g){c=gm(a.g.hls.mediaPlaylistFullMimeType);if(!b.length)return B.return(c);d=Ly(a,b);e=d.segment;f=d.segmentIndex;g=e.O();h=g[0];k=new Bb(h);l=k.mb.split(".").pop();return(m=My.get(l))?B.return(gm(m)):F(B,Promise.all([Ny(a,e.Z,0),Ny(a,e,f)]),2)}n=B.h;q=n[1].mimeType;r=n[0].data;u=n[1].data;w="mp4 mp4a m4s m4i m4a m4f cmfa mp4v m4v cmfv fmp4".split(" ");v=["audio/mp4","video/mp4","video/iso.segment"];y=e.Z||v.includes(q);
|
|
if(!y&&qk(Tb(u))){var E=u,H=a.g.disableAudio,C=a.g.disableVideo,D=a.g.disableText;var I=Tb(E);var L=(new ak).parse(I),K=L.Ld();I=L.Cg();var J=[],M=!1,O=!1;if(!H)switch(K.audio){case "aac":case "aac-loas":L.rb().length&&(J.push("mp4a.40.2"),M=!0);break;case "mp3":L.rb().length&&(J.push("mp4a.40.34"),M=!0);break;case "ac3":L.rb().length&&(J.push("ac-3"),M=!0);break;case "ec3":L.rb().length&&(J.push("ec-3"),M=!0);break;case "opus":L.rb().length&&(J.push("opus"),M=!0)}if(!C)switch(K.video){case "avc":I.codec?
|
|
J.push(I.codec):J.push("avc1.42E01E");O=!0;break;case "hvc":I.codec?J.push(I.codec):J.push("hvc1.1.6.L93.90");O=!0;break;case "av1":J.push("av01.0.01M.08"),O=!0}if(J.length){H=M&&!O;C=new Map;if(O&&!D){D=new Lc("video/mp2t");D.rf(E);E=t(D.Of());for(O=E.next();!O.done;O=E.next())O=O.value,C.set(O,O);D.Bd()}I={type:H?"audio":"video",mimeType:"video/mp2t",codecs:J.join(", "),language:null,height:I.height,width:I.width,channelCount:null,sampleRate:null,closedCaptions:C,le:null,colorGamut:null,frameRate:I.frameRate}}else I=
|
|
null;if(z=I)return B.return(z)}else if(y||w.includes(l))if(A=hm(r,u,a.g.disableText))return B.return(A);return q?B.return(gm(q)):B.return(c)})}
|
|
function Ny(a,b,c){var d,e,f,g,h,k;return Q(function(l){switch(l.g){case 1:if(!b)return l.return({mimeType:null,data:null});d=Rg;e=mm(b.O(),b.wc(),b.uc(),a.g.retryParameters);f=b instanceof qj?1:0;return F(l,Oy(a,e,d,{type:f}).promise,2);case 2:g=l.h;h=g.data;if(!b.aesKey){l.u(3);break}return F(l,lm(h,b.aesKey,c),4);case 4:h=l.h;case 3:return b instanceof qj?b.ee(h,!0):b.ee(h),(k=g.headers["content-type"])&&(k=k.split(";")[0].toLowerCase()),l.return({mimeType:k,data:h})}})}
|
|
function ly(a){if(gy(a)){if(a.Ba==Py){for(var b=Infinity,c=Infinity,d=t(a.i.values()),e=d.next();!e.done;e=d.next())e=e.value,e.stream.segmentIndex&&"text"!=e.stream.type&&!e.stream.isAudioMuxedInVideo&&(b=Math.min(b,e.ic),c=Math.min(c,e.Rc));b=b-c||0;isNaN(a.g.availabilityWindowOverride)||(b=a.g.availabilityWindowOverride);a.l.Bf(b)}}else a.l.ob(Qy(a));if(!a.l.o)for(b=t(a.i.values()),c=b.next();!c.done;c=b.next())c=c.value,!c.stream.segmentIndex||"audio"!=c.type&&"video"!=c.type||(c=Qf(c.stream.segmentIndex))&&
|
|
c.h&&a.l.gh(c.h);a.l.ef()}function yy(a,b){var c=(new Bb(a.C)).g;b=t(b);for(var d=b.next();!d.done;d=b.next()){var e=d.value;d=Ix(e,"NAME");var f=Ix(e,"VALUE");e=Ix(e,"QUERYPARAM");d&&f&&(a.A.has(d)||a.A.set(d,f));e&&(d=c.get(e)[0])&&!a.A.has(d)&&a.A.set(e,d)}}
|
|
function ny(a,b,c){c=(new Bb(c)).g;var d=new Map;b=t(b);for(var e=b.next();!e.done;e=b.next()){var f=e.value,g=Ix(f,"NAME"),h=Ix(f,"VALUE");e=Ix(f,"QUERYPARAM");f=Ix(f,"IMPORT");g&&h&&(d.has(g)||d.set(g,h));e&&(g=c.get(e)[0])&&!d.has(g)&&d.set(e,g);f&&(e=a.A.get(f))&&d.set(f,e)}return d}
|
|
function By(a,b){b=t(b);for(var c=b.next();!c.done;c=b.next()){var d=c.value,e=Ix(d,"AUDIO");c=Ix(d,"VIDEO");var f=Ix(d,"SUBTITLES");d=Ry(a,d);if(f){var g=uc(wc,d);a.H.set(f,g);Uc(d,g)}e&&(f=uc("audio",d),f||(f=a.g.hls.defaultAudioCodec),a.H.set(e,f));c&&(e=uc("video",d),e||(e=a.g.hls.defaultVideoCodec),a.H.set(c,e))}}
|
|
function zy(a,b){b=t(b);for(var c=b.next();!c.done;c=b.next()){var d=c.value,e=Ix(d,"DATA-ID");c=Ix(d,"URI");var f=Ix(d,"LANGUAGE");d=Ix(d,"VALUE");e=(new Map).set("id",e);c&&e.set("uri",Qx([a.C],c,a.A)[0]);f&&e.set("language",f);d&&e.set("value",d);c=new V("sessiondata",e);if(a.h)a.h.onEvent(c)}}
|
|
function Ay(a,b){var c,d,e,f,g,h;return Q(function(k){if(!a.h||!a.g)return k.return();d=t(b);for(e=d.next();!e.done;e=d.next())if(f=e.value,g=Ix(f,"PATHWAY-ID"),h=Ix(f,"SERVER-URI"),g&&h){a.j=new tv(a.h);a.j.configure(a.g);a.j.i=[a.C];a.j.setManifestType("HLS");a.j.h=g;c=uv(a.j,h);break}return F(k,c,0)})}
|
|
function Fy(a,b){var c=Nx(b,"SUBTITLES");b=c.map(function(g){if(a.g.disableText)return null;try{return Sy(a,[g],new Map).stream}catch(h){if(a.g.hls.ignoreTextStreamFailures)return null;throw h;}});c=t(c);for(var d=c.next();!d.done;d=c.next()){var e=Jx(d.value,"GROUP-ID");if(d=a.H.get(e))if(e=a.I.get(e)){e=t(e);for(var f=e.next();!f.done;f=e.next())f=f.value,f.stream.codecs=d,f.stream.mimeType=Ty(wc,d)||Uy(wc),Vy(f.stream)}}return b.filter(function(g){return g})}
|
|
function Vy(a){var b=new Set([De(a.mimeType,a.codecs)]);a.segmentIndex&&a.segmentIndex.Cb(function(c){c.mimeType&&b.add(De(c.mimeType,a.codecs))});a.fullMimeTypes=b}
|
|
function Gy(a,b,c){var d,e;return Q(function(f){if(1==f.g)return d=b.map(function(g){var h,k,l;return Q(function(m){if(1==m.g){if(h=a.g.disableThumbnails)return m.return(null);wa(m,2);return F(m,Wy(a,g),4)}if(2!=m.g)return k=m.h,m.return(k.stream);l=Aa(m);if(a.g.hls.ignoreImageStreamFailures)return m.return(null);throw l;})}).concat(c.map(function(g){if(a.g.disableThumbnails)return null;try{var h=Xy(a,g);return"image"!==h.stream.type?null:h.stream}catch(k){if(a.g.hls.ignoreImageStreamFailures)return null;
|
|
throw k;}})),F(f,Promise.all(d),2);e=f.h;return f.return(e.filter(function(g){return g}))})}function Yy(a,b,c){b=b.filter(function(h){var k=Ix(h,"URI")||"";h=Ix(h,"TYPE");return"SUBTITLES"!=h&&(""!=k||"AUDIO"==h)});var d={};b=t(b);for(var e=b.next();!e.done;e=b.next()){e=e.value;var f=Gx(e,!a.j);d[f]?d[f].push(e):d[f]=[e]}for(var g in d)Sy(a,d[g],c,!1)}function Dy(a,b){return b.map(function(c){c=Xy(a,c);return"video"!==c.stream.type?null:c.stream}).filter(function(c){return c})}
|
|
function Ey(a,b,c,d,e,f,g){var h,k,l,m,n,q,r,u,w,v,y,z,A,B,E,H,C,D,I,L,K,J,M,O,N,P,R,S,aa,W,Fa,Ga,xa,qa,Da,Ja;return Q(function(ra){switch(ra.g){case 1:h=[];k=new Set;if(a.g.ignoreDrmInfo||!(0<c.length)){ra.u(2);break}l=t(c);m=l.next();case 3:if(m.done){ra.u(2);break}n=m.value;q=Jx(n,"METHOD");r=Ix(n,"KEYFORMAT")||"identity";u=null;if("NONE"==q){ra.u(4);break}if(Zy(q)){w=Qx(e(),Jx(n,"URI"),f);v=w.sort().join("");a.L.has(v)||(y=Lg(w,a.g.retryParameters),z=Oy(a,y,6).promise,a.L.set(v,z));ra.u(4);break}if("identity"==
|
|
r)return F(ra,$y(a,n,"",e,null,f),12);A=a.Yb.get(r);if(!A){B=null;ra.u(10);break}return F(ra,A(n,"",null),11);case 11:B=ra.h;case 10:u=B;ra.u(6);break;case 12:u=ra.h;case 6:if(u){if(u.keyIds)for(E=t(u.keyIds),H=E.next();!H.done;H=E.next())C=H.value,k.add(C);h.push(u)}case 4:m=l.next();ra.u(3);break;case 2:D={};I=t(b);for(L=I.next();!L.done;L=I.next())K=L.value,J=Gx(K,!a.j),D[J]?D[J].push(K):D[J]=[K];M=[];for(O in D)N=D[O],P=N[0],R=Ix(P,"FRAME-RATE"),S=Number(Ix(P,"AVERAGE-BANDWIDTH"))||Number(Jx(P,
|
|
"BANDWIDTH")),aa=Ix(P,"RESOLUTION"),W=t(aa?aa.split("x"):[null,null]),Fa=W.next().value,Ga=W.next().value,xa=Ix(P,"VIDEO-RANGE"),(qa=Ix(P,"REQ-VIDEO-LAYOUT"))&&qa.includes(",")&&(Da=qa.split(",").filter(function(da){return"CH-STEREO"==da||"CH-MONO"==da}),qa=Da[0]),qa=qa||"CH-MONO",Ja=az(a,N,d),M.push.apply(M,x(bz(a,Ja.audio,Ja.video,S,Fa,Ga,R,xa,qa,h,k,g)));return ra.return(M.filter(function(da){return null!=da}))}})}
|
|
function az(a,b,c){for(var d={audio:[],video:[]},e=new Map,f=[],g=!1,h=!1,k=t(b),l=k.next();!l.done;l=k.next()){var m=l.value;l=Ix(m,"AUDIO");var n=Ix(m,"VIDEO"),q=l||n;q&&(f.includes(q)||f.push(q),(m=Ix(m,"PATHWAY-ID"))&&e.set(q,m),l?g=!0:n&&(h=!0))}f.length&&c.length&&(c=c.filter(function(u){return f.includes(Jx(u,"GROUP-ID"))}),Yy(a,c,e));c=(e=f.sort().join(","))&&a.I.has(e)?a.I.get(e):[];g?d.audio.push.apply(d.audio,x(c)):h&&d.video.push.apply(d.video,x(c));g=!1;var r=b.map(function(u){return Jx(u,
|
|
"URI")});l=d.audio.find(function(u){return u&&u.O().find(function(w){return r.includes(w)})});h=Ry(a,b[0]);c=uc("video",h);(k=uc("audio",h))&&!c?(l="audio",g=0<d.audio.length):!d.audio.length&&!d.video.length&&k&&c?(l="video",h=[[c,k].join()]):d.audio.length&&l?(l="audio",g=!0):l=d.video.length&&!d.audio.length?"audio":"video";g||(a=cz(a,b,h,l),e&&(a.stream.groupId=e),d[a.stream.type]=[a]);return d}
|
|
function Ry(a,b){b=Ix(b,"CODECS")||"";a.$=0<b.length;a.$||a.g.hls.disableCodecGuessing||(b=[],a.g.disableVideo||b.push(a.g.hls.defaultVideoCodec),a.g.disableAudio||b.push(a.g.hls.defaultAudioCodec),b=b.join(","));return im(b.split(/\s*,\s*/))}
|
|
function bz(a,b,c,d,e,f,g,h,k,l,m,n){for(var q=t(c),r=q.next();!r.done;r=q.next())dz(r.value.stream,e,f,g,h,k,null);e=a.g.disableAudio;if(!b.length||e)b=[null];e=a.g.disableVideo;if(!c.length||e)c=[null];e=[];b=t(b);for(f=b.next();!f.done;f=b.next())for(f=f.value,g=t(c),h=g.next();!h.done;h=g.next()){var u=h.value;if(h=f?f.stream:null)h.drmInfos=l,h.keyIds=m;if(k=u?u.stream:null)k.drmInfos=l,k.keyIds=m,a.g.disableIFrames||cg(k,n);k&&!h&&(k.bandwidth=d);!k&&h&&(h.bandwidth=d);q=f?f.stream.drmInfos:
|
|
null;r=u?u.stream.drmInfos:null;u=u?u.O().sort().join(","):"";var w=f?f.O().sort().join(","):"",v=[];h&&h.codecs&&v.push(h.codecs);k&&k.codecs&&v.push(k.codecs);u=[u,w,v.sort()].join("-");h&&k&&!jg(q,r)||a.ab.has(u)||(h={id:a.F++,language:h?h.language:"und",disabledUntilTime:0,primary:!!h&&h.primary||!!k&&k.primary,audio:h,video:k,bandwidth:d,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]},e.push(h),a.ab.add(u))}return e}
|
|
function Cy(a,b){b=Nx(b,"CLOSED-CAPTIONS");a.N=0==b.length;b=t(b);for(var c=b.next();!c.done;c=b.next()){var d=c.value,e=Ix(d,"LANGUAGE");c=gf(e||"und");e||(e=Ix(d,"NAME"))&&(c=e);e=Jx(d,"GROUP-ID");d=Jx(d,"INSTREAM-ID").replace("SERVICE","svc");a.G.get(e)||a.G.set(e,new Map);a.G.get(e).set(d,c)}}
|
|
function Sy(a,b,c,d){d=void 0===d?!0:d;for(var e=[],f=[],g=new Map,h=t(b),k=h.next();!k.done;k=h.next()){var l=k.value;k=d?Jx(l,"URI"):Ix(l,"URI")||"shaka://hls-muxed";l=Jx(l,"GROUP-ID");e.push(k);f.push(l);g.set(l,k)}d=f.sort().join(",");k=b[0];b="";h=Jx(k,"TYPE").toLowerCase();"subtitles"==h&&(h=wc);if(h==wc)b=Ix(k,"CODECS")||"";else for(f=t(f),l=f.next();!l.done;l=f.next())if(l=l.value,a.H.has(l)){b=a.H.get(l);break}f=e.sort().join(",");if(a.i.has(f))return a.i.get(f);l=a.F++;if(a.j){g=t(g);for(var m=
|
|
g.next();!m.done;m=g.next()){var n=t(m.value);m=n.next().value;n=n.next().value;(m=c.get(m))&&xv(a.j,l,m,n)}}c=Ix(k,"LANGUAGE");g=Ix(k,"NAME");m="YES"==Ix(k,"DEFAULT");"audio"==h?n=(n=Ix(k,"CHANNELS"))?parseInt(n.split("/")[0],10):null:n=null;var q;"audio"==h?(q=Ix(k,"CHANNELS"))?(q=q.split("/"),q=2!=q.length?!1:"JOC"===q[1]||q[1].includes("ATMOS")):q=!1:q=!1;var r=Ix(k,"CHARACTERISTICS"),u="YES"==Ix(k,"FORCED");"audio"==h?k=(k=Ix(k,"SAMPLE-RATE"))?parseInt(k,10):null:k=null;e=ez(a,l,e,b,h,c,m,g,
|
|
n,null,r,u,k,q);e.stream&&(e.stream.groupId=d);a.I.has(d)?a.I.get(d).push(e):a.I.set(d,[e]);a.i.set(f,e);return e}
|
|
function Wy(a,b){var c,d,e,f,g,h,k,l,m,n;return Q(function(q){if(1==q.g){c=Jx(b,"URI");d=Ix(b,"CODECS","jpeg")||"";if(a.i.has(c))return q.return(a.i.get(c));e=Ix(b,"LANGUAGE");f=Ix(b,"NAME");g=Ix(b,"CHARACTERISTICS");h=ez(a,a.F++,[c],d,"image",e,!1,f,null,null,g,!1,null,!1);return(k=Ix(b,"RESOLUTION"))?F(q,h.stream.createSegmentIndex(),3):q.u(2)}2!=q.g&&(l=Qf(h.stream.segmentIndex),m=l.tilesLayout)&&(h.stream.width=Number(k.split("x")[0])*Number(m.split("x")[0]),h.stream.height=Number(k.split("x")[1])*
|
|
Number(m.split("x")[1]));if(n=Ix(b,"BANDWIDTH"))h.stream.bandwidth=Number(n);a.i.set(c,h);return q.return(h)})}
|
|
function Xy(a,b){var c="video",d=Jx(b,"URI"),e=Ix(b,"CODECS")||"";"mjpg"==e&&(c="image");if(a.i.has(d))return a.i.get(d);var f=Ix(b,"LANGUAGE"),g=Ix(b,"NAME"),h=Ix(b,"CHARACTERISTICS");c=ez(a,a.F++,[d],e,c,f,!1,g,null,null,h,!1,null,!1);e=Ix(b,"RESOLUTION");f=t(e?e.split("x"):[null,null]);e=f.next().value;f=f.next().value;c.stream.width=Number(e)||void 0;c.stream.height=Number(f)||void 0;if(b=Ix(b,"BANDWIDTH"))c.stream.bandwidth=Number(b);a.i.set(d,c);return c}
|
|
function cz(a,b,c,d){for(var e=a.F++,f=[],g=t(b),h=g.next();!h.done;h=g.next()){var k=h.value;h=Jx(k,"URI");k=Ix(k,"PATHWAY-ID");a.j&&k&&xv(a.j,e,k,h);f.push(h)}g=f.sort().join(",")+c.sort().join(",");if(a.i.has(g))return a.i.get(g);h=f.join(",");a:{b=Ix(b[0],"CLOSED-CAPTIONS");if("video"==d){if(a.g.disableText){a.N=!1;b=null;break a}if(b){if("NONE"!=b){b=a.G.get(b);break a}a.N=!1}else if(!b&&a.G.size)for(b=t(a.G.keys()).next();!b.done;){b=a.G.get(b.value);break a}}b=null}c=tc(d,c);d=ez(a,e,f,c,d,
|
|
null,!1,h,null,b,null,!1,null,!1);a.i.set(g,d);return d}
|
|
function ez(a,b,c,d,e,f,g,h,k,l,m,n,q,r){function u(B){var E,H,C,D,I,L,K,J,M,O,N,P,R,S,aa,W,Fa,Ga,xa,qa,Da,Ja,ra;return Q(function(da){switch(da.g){case 1:return E=yc,wa(da,2),F(da,B.promise,4);case 4:H=da.h;if(B.aborted)return da.return();C=H.uri;C!=H.originalUri&&(D=y.O(),D.includes(C)||y.wf.push(C));I=Ux(a.Pa,H.data);if(1!=I.type)throw new U(2,4,4017);L=Mx(I.ea,"EXT-X-DEFINE");K=ny(a,L,C);J=!1;(!a.$&&a.g.hls.disableCodecGuessing||a.N&&e==E.wa&&!a.g.hls.disableClosedCaptionsDetection)&&0<I.segments.length&&
|
|
(a.N=!1,J=!0);M=!a.$&&a.g.hls.disableCodecGuessing;O=gy(a);return F(da,xy(a,0,K,I,w,d,e,f,g,h,k,l,m,n,q,r,void 0,J,M),5);case 5:N=da.h;if(B.aborted)return da.return();P=N.stream;Hy(a,I);gy(a)&&!O&&Iy(a,I);y.Rc=N.Rc;y.ic=N.ic;y.Me=N.Me;y.Le=N.Le;y.Od=N.Od;y.gf=N.gf;y.Qb=N.Qb;y.Rb=N.Rb;y.Jg=!0;v.segmentIndex=P.segmentIndex;v.encrypted=P.encrypted;v.drmInfos=P.drmInfos;v.keyIds=P.keyIds;v.mimeType=P.mimeType;v.bandwidth=v.bandwidth||P.bandwidth;v.codecs=v.codecs||P.codecs;v.closedCaptions=v.closedCaptions||
|
|
P.closedCaptions;v.width=v.width||P.width;v.height=v.height||P.height;v.hdr=v.hdr||P.hdr;v.colorGamut=v.colorGamut||P.colorGamut;v.frameRate=v.frameRate||P.frameRate;"und"==v.language&&"und"!=P.language&&(v.language=P.language);v.language=v.language||P.language;v.channelsCount=v.channelsCount||P.channelsCount;v.audioSamplingRate=v.audioSamplingRate||P.audioSamplingRate;Vy(v);v.drmInfos.length&&a.h.newDrmInfo(v);R=!1;if(!l&&v.closedCaptions||l&&v.closedCaptions&&l.size!=v.closedCaptions.size)R=!0;
|
|
a.m&&R&&a.h.makeTextStreamsForClosedCaptions(a.m);if(e==E.wa||e==E.Y)for(S=t(a.i.values()),aa=S.next();!aa.done;aa=S.next())W=aa.value,W.Jg||W.type!=e||(W.stream.mimeType=P.mimeType,Vy(W.stream));e==E.Oa&&(Fa=Qf(P.segmentIndex))&&Fa.Z&&(v.mimeType="application/mp4",Vy(v));Ga=Rl(v);v.segmentIndex.Cb(function(sa){sa.Z&&(sa.Z.nd=Ga)});fz(a)&&(a.mc?Jy(a,[y]):(a.mc=!0,xa=Array.from(a.i.values()),qa=xa.filter(function(sa){return sa.stream.segmentIndex}),Jy(a,qa),ly(a),Da=a.o,0<Da&&a.B.ha(Da)));sy(a,I.ea,
|
|
v.type,K,w);a.m&&(a.m.startTime=a.s);za(da,0);break;case 2:Ja=Aa(da);v.closeSegmentIndex();if(7001===Ja.code)return da.return();ra=a.h.disableStream(v);if(!ra)throw Ja;G(da)}})}function w(){return a.j&&1<c.length?yv(a.j,b):y.wf.concat(Rx([a.C],c,a.A))}var v=gz(a,d,e,f,g,h,k,l,m,n,q,r);c.includes("shaka://hls-muxed")&&(v.isAudioMuxedInVideo=!0,v.mimeType="video/mp2t",Vy(v));var y={stream:v,type:e,wf:[],Rc:0,ic:0,gf:new Map,Me:!1,Le:!1,Od:!1,ig:-1,Qb:-1,Rb:-1,Jg:!1,O:w},z=null,A;v.createSegmentIndex=
|
|
function(){if(z)return z;if(v.isAudioMuxedInVideo)return v.segmentIndex=new Cl([]),Promise.resolve();A=ey(a,y.O(),!0);return z=new Promise(function(B){B(u(A))})};v.closeSegmentIndex=function(){z&&!v.segmentIndex&&A.abort();v.segmentIndex&&(v.segmentIndex.release(),v.segmentIndex=null);z=null};return y}
|
|
function Qy(a){var b=Infinity;a=t(a.i.values());for(var c=a.next();!c.done;c=a.next())c=c.value,c.stream.segmentIndex&&"text"!=c.stream.type&&!c.stream.isAudioMuxedInVideo&&(b=Math.min(b,c.ic));return b}function iy(a,b){var c=[];b=t(b);for(var d=b.next();!d.done;d=b.next())d=d.value,d.segmentIndex&&d.segmentIndex.Cb(function(e){c.push(e)});a.l.Xd(c)}
|
|
function Jy(a,b){if(!gy(a))for(var c=Qy(a),d=t(b),e=d.next();!e.done;e=d.next())e.value.stream.segmentIndex.gd(0,c);iy(a,b.map(function(f){return f.stream}));d=Array.from(a.i.values()).filter(function(f){return f.stream.segmentIndex});c=d.some(function(f){return"audio"==f.stream.type});e=d.some(function(f){return"video"==f.stream.type});d=gy(a)&&!a.Za;c=!gy(a)&&a.Za&&!(c&&e);a.g.hls.ignoreManifestProgramDateTime||d||c?ty(a,b,d):(wy(a,b),0<a.g.hls.ignoreManifestProgramDateTimeForTypes.length&&ty(a,
|
|
b))}function uy(a,b){return a.g.hls.ignoreManifestProgramDateTime?!0:a.g.hls.ignoreManifestProgramDateTimeForTypes.includes(b)}function fz(a){if(!a.m)return!1;var b=[],c=[];a=t(a.m.variants);for(var d=a.next();!d.done;d=a.next())d=d.value,d.video&&b.push(d.video),d.audio&&c.push(d.audio);return 0<b.length&&!b.some(function(e){return e.segmentIndex})||0<c.length&&!c.some(function(e){return e.segmentIndex})?!1:!0}
|
|
function xy(a,b,c,d,e,f,g,h,k,l,m,n,q,r,u,w,v,y,z){y=void 0===y?!0:y;z=void 0===z?!0:z;var A,B,E,H,C,D,I,L,K,J,M,O,N,P,R,S,aa,W,Fa,Ga,xa,qa,Da,Ja,ra,da,sa,Za,$a;return Q(function(hb){switch(hb.g){case 1:A=d.segments||[];B=A.every(function(rb){return Ox(rb.ea,"EXT-X-GAP")?!0:!1});if(!A.length||B)throw new U(2,4,4053);hz(a,d);gy(a)&&ry(a,d);E=gy(a)?a.M.get(g):new Map;H=py(a,d,E,c,e,g);C=H.segments;D=H.bandwidth;M=J=K=L=I=null;if(!(0<C.length&&y)){hb.u(2);break}return F(hb,Ky(a,C),3);case 3:O=hb.h,g=
|
|
O.type,h=O.language,m=O.channelCount,u=O.sampleRate,a.g.disableText||(n=O.closedCaptions),L=O.height,I=O.width,K=O.le,J=O.colorGamut,M=O.frameRate,z&&(v=O.mimeType,f=O.codecs);case 2:if(v){hb.u(4);break}return F(hb,iz(a,g,f,C),5);case 5:v=hb.h,g!=wc||f||"application/mp4"!=v||!C[0]||C[0].Z||(v="text/vtt");case 4:return F(hb,oy(a,d,v,e,c),6);case 6:N=hb.h;P=N.drmInfos;R=N.keyIds;S=N.encrypted;aa=N.Dh;if(S&&!P.length&&!aa)throw new U(2,4,4026);W=gz(a,f,g,h,k,l,m,n,q,r,u,w);W.encrypted=S&&!aa;W.drmInfos=
|
|
P;W.keyIds=R;W.mimeType=v;D&&(W.bandwidth=D);Vy(W);"video"==g&&(I||L||K||J)&&dz(W,I,L,M,K,null,J);gy(a)&&ry(a,d);Fa=C[0].startTime;Ga=C[C.length-1];xa=Ga.endTime;qa=new Cl(C);W.segmentIndex=qa;Ja=(Da=Ox(d.ea,"EXT-X-SERVER-CONTROL"))?null!=Hx(Da,"CAN-SKIP-UNTIL"):!1;ra=Da?null!=Hx(Da,"CAN-BLOCK-RELOAD"):!1;da=Px(d.ea,"EXT-X-MEDIA-SEQUENCE",0);sa=qy(da,C);Za=sa.Qb;$a=sa.Rb;return hb.return({stream:W,type:g,wf:[],O:e,Rc:Fa,ic:xa,Me:Ja,Le:ra,Od:!1,ig:-1,Qb:Za,Rb:$a,gf:E,Jg:!1})}})}
|
|
function qy(a,b){a=a+b.length-1;var c=-1;if(!b.length)return a++,{Qb:a,Rb:c};b=b[b.length-1];var d=b.g;if(!b.g.length)return a++,b.m&&(c=0),{Qb:a,Rb:c};c=d.length-1;d[d.length-1].isPreload()||(a++,c=0);return{Qb:a,Rb:c}}
|
|
function gz(a,b,c,d,e,f,g,h,k,l,m,n){var q=Ty(c,b)||Uy(c),r=[];if(k){k=t(k.split(","));for(var u=k.next();!u.done;u=k.next())r.push(u.value)}k=void 0;u=null;c==wc?k=r.includes("public.accessibility.transcribes-spoken-dialog")&&r.includes("public.accessibility.describes-music-and-sound")?"caption":"subtitle":r.includes("public.accessibility.describes-video")&&(u="visually impaired");r.length||"subtitle"!==k||r.push("subtitle");a={id:a.F++,originalId:f,groupId:null,createSegmentIndex:function(){return Promise.resolve()},
|
|
segmentIndex:null,mimeType:q,codecs:b,kind:c==wc?"subtitle":void 0,encrypted:!1,drmInfos:[],keyIds:new Set,language:gf(d||"und"),originalLanguage:d,label:f,type:c,primary:e,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,frameRate:void 0,pixelAspectRatio:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:r,forced:l,channelsCount:g,audioSamplingRate:m,spatialAudio:n,closedCaptions:h,hdr:void 0,colorGamut:void 0,videoLayout:void 0,tilesLayout:void 0,accessibilityPurpose:u,external:!1,
|
|
fastSwitching:!1,fullMimeTypes:new Set,isAudioMuxedInVideo:!1,baseOriginalId:null};Vy(a);return a}
|
|
function oy(a,b,c,d,e){var f,g,h,k,l,m,n,q,r,u,w,v,y,z,A,B,E,H,C,D,I,L,K,J,M,O,N,P,R;return Q(function(S){switch(S.g){case 1:f=new Map;if(!a.g.ignoreDrmInfo&&b.segments)for(g=t(b.segments),h=g.next();!h.done;h=g.next())if(k=h.value,l=Mx(k.ea,"EXT-X-KEY"),m=null,l.length)for(m=jz(a,b,k.ea,d,e),n=t(l),q=n.next();!q.done;q=n.next())r=q.value,f.set(r,m);w=u=!1;v=[];y=new Set;z=t(f);A=z.next();case 2:if(A.done){S.u(4);break}B=A.value;E=t(B);H=E.next().value;C=E.next().value;D=H;I=C;L=Jx(D,"METHOD");if("NONE"==
|
|
L){S.u(3);break}u=!0;K=Ix(D,"KEYFORMAT")||"identity";J=null;if(Zy(L)){w=!0;S.u(3);break}if("identity"==K)return F(S,$y(a,D,c,d,I,e),11);M=a.Yb.get(K);if(!M){O=null;S.u(9);break}return F(S,M(D,c,I),10);case 10:O=S.h;case 9:J=O;S.u(6);break;case 11:J=S.h;case 6:if(J){if(J.keyIds)for(N=t(J.keyIds),P=N.next();!P.done;P=N.next())R=P.value,y.add(R);v.push(J)}case 3:A=z.next();S.u(2);break;case 4:return S.return({drmInfos:v,keyIds:y,encrypted:u,Dh:w})}})}
|
|
function kz(a,b,c,d,e){if(!window.crypto||!window.crypto.subtle)throw bb("Web Crypto API is not available to decrypt AES. (Web Crypto only exists in secure origins like https)"),new U(2,4,4042);var f=0,g=Ix(b,"IV","");if(g){var h=nc(g.substr(2));if(16!=h.byteLength)throw new U(2,4,4048);}else f=Px(c.ea,"EXT-X-MEDIA-SEQUENCE",0);var k=Qx(d(),Jx(b,"URI"),e),l=k.sort().join("");c=b.toString()+"-"+f+"-"+l;if(!a.oa.has(c)){var m={bitsKey:128,blockCipherMode:"CBC",iv:h,firstMediaSequenceNumber:f};switch(Jx(b,
|
|
"METHOD")){case "AES-256":m.bitsKey=256;break;case "AES-256-CTR":m.bitsKey=256,m.blockCipherMode="CTR"}m.fetchKey=function(){var n,q,r,u;return Q(function(w){if(1==w.g)return a.L.has(l)||(n=Lg(k,a.g.retryParameters),q=Oy(a,n,6).promise,a.L.set(l,q)),F(w,a.L.get(l),2);if(3!=w.g){r=w.h;if(!r.data||r.data.byteLength!=m.bitsKey/8)throw new U(2,4,4049);u={name:"CTR"==m.blockCipherMode?"AES-CTR":"AES-CBC",length:m.bitsKey};return F(w,window.crypto.subtle.importKey("raw",r.data,u,!0,["decrypt"]),3)}m.cryptoKey=
|
|
w.h;m.fetchKey=void 0;G(w)})};a.oa.set(c,m)}return a.oa.get(c)}function Hy(a,b){null==a.s&&(b=Ox(b.ea,"EXT-X-START"))&&(a.s=Number(Jx(b,"TIME-OFFSET")))}function hz(a,b){var c=Ox(b.ea,"EXT-X-PLAYLIST-TYPE");b=Ox(b.ea,"EXT-X-ENDLIST");b=c&&"VOD"==c.value||b;c=c&&"EVENT"==c.value&&!b;c=!b&&!c;b?ky(a,dy):c?ky(a,Py):ky(a,lz)}
|
|
function ry(a,b){var c=Infinity,d=b.segments;if(d.length)for(var e=d.length-1;0<=e;){var f=Ox(d[e].ea,"EXTINF");if(f){c=Number(f.value.split(",")[0]);break}e--}d=Ox(b.ea,"EXT-X-TARGETDURATION");if(!d)throw new U(2,4,4024,"EXT-X-TARGETDURATION");d=Number(d.value);if(e=Ox(b.ea,"EXT-X-PART-INF"))a.P=Number(Jx(e,"PART-TARGET"));b=Ox(b.ea,"EXT-X-SERVER-CONTROL");a.ka&&a.P?(a.o=a.kc?5*a.P<=c?Math.min(a.P,a.o):Math.min(c,a.o):Math.min(a.P,a.o),a.Ya=b?Number(Jx(b,"PART-HOLD-BACK")):0):(a.o=Math.min(c,a.o),
|
|
c=b?Hx(b,"HOLD-BACK"):null,a.Ka=c?Number(c.value):0);a.Ua=Math.max(d,a.Ua)}function Iy(a,b){var c=0;if(a.g.defaultPresentationDelay)c=a.g.defaultPresentationDelay;else if(a.Ya)c=a.Ya;else if(a.Ka)c=a.Ka;else{var d=b.segments.length,e=a.g.hls.liveSegmentsDelay;e>d-2&&(e=Math.max(1,d-2));for(e=d-e;e<d;e++){var f=Ox(b.segments[e].ea,"EXTINF");c=f?c+Math.ceil(Number(f.value.split(",")[0])):c+a.Ua}}a.s&&0>a.s&&(c=Math.min(-a.s,c),a.s+=c);a.l.Ii(0);a.l.fh(c);a.l.Wc(!1)}
|
|
function jz(a,b,c,d,e){var f=Ox(c,"EXT-X-MAP");if(!f)return null;var g=Jx(f,"URI"),h=Qx(d(),g,e);g=[h.toString(),Ix(f,"BYTERANGE","")].join("-");if(!a.xa.has(g)){var k=void 0,l=null,m=!1;c=t(c);for(var n=c.next();!n.done;n=c.next())n=n.value,"EXT-X-KEY"==n.name?(m=Jx(n,"METHOD"),Zy(m)&&n.id<f.id?(m=!1,k=kz(a,n,b,d,e)):m="NONE"!=m):"EXT-X-BYTERANGE"==n.name&&n.id<f.id&&(l=n);b=mz(h,f,l,k,m);a.xa.set(g,b)}return a.xa.get(g)}
|
|
function mz(a,b,c,d,e){var f=0,g=null;b=Ix(b,"BYTERANGE");!b&&c&&(b=c.value);b&&(f=b.split("@"),g=Number(f[0]),f=Number(f[1]),g=f+g-1,d&&(c=g+1-f,c%16&&(g+=16-c%16)));return new oj(function(){return a},f,g,null,null,null,d,e)}
|
|
function nz(a,b,c,d,e,f,g,h,k){function l(S){S=(new Bb(S)).mb.split(".").pop();var aa=oz.get(g).get(S);aa||(aa=My.get(S));return aa}var m=d.ea,n=Ox(m,"EXTINF"),q=0,r=0,u=null;d.Zb.length&&(a.m.isLowLatency=!0);var w=null;if(!a.g.hls.ignoreManifestProgramDateTime){var v=Ox(m,"EXT-X-PROGRAM-DATE-TIME");v&&v.value&&(w=Ad(v.value),a.Za=!0)}var y=rj;Ox(m,"EXT-X-GAP")&&(a.m.gapCount++,y=2);if(!n){if(0==d.Zb.length)throw new U(2,4,4024,"EXTINF");if(!a.ka)return null}var z=[];v=!1;var A=null,B=!1,E=!1;if(a.ka&&
|
|
d.Zb.length){q=b&&window.ReadableStream&&a.g.hls.allowLowLatencyByteRangeOptimization;for(var H=w,C={},D=0;D<d.Zb.length;C={If:void 0,qf:void 0},D++){var I=d.Zb[D],L=0==D?c:z[z.length-1],K=0==D?e:L.endTime,J=Number(Ix(I,"DURATION"))||a.P;if(J){var M=K+J,O=0,N=null;"EXT-X-PRELOAD-HINT"==I.name?(O=(O=Ix(I,"BYTERANGE-START"))?Number(O):0,(L=Ix(I,"BYTERANGE-LENGTH"))?N=O+Number(L)-1:O&&(N=Number.MAX_SAFE_INTEGER)):(O=Ix(I,"BYTERANGE"),N=t(pz(L,O)),O=N.next().value,N=N.next().value);C.qf=Ix(I,"URI");if(C.qf){L=
|
|
rj;"YES"==Ix(I,"GAP")&&(a.m.gapCount++,L=2,B=!0);C.If=null;var P=function(S){return function(){null==S.If&&(S.If=Qx(h(),S.qf,f));return S.If}}(C);q&&0<=O&&null!=N&&(A=P,v=!0);K=new qj(K,M,P,O,N,b,0,0,Infinity,[],"",null,H,L,k);"EXT-X-PRELOAD-HINT"==I.name&&(K.Kg(),E=!0);"YES"!=Ix(I,"INDEPENDENT")&&0<D&&K.md();if(C=l(C.qf))K.mimeType=C,qz.has(C)&&(K.Z=null);z.push(K);H&&(H+=J)}}}}if(n){n=Number(n.value.split(",")[0]);if(0==n)return null;q=e+n}else if(z.length)q=z[z.length-1].endTime;else return null;
|
|
v&&(B||0!=z[0].startByte?(v=!1,A=null):z=[]);(n=Ox(m,"EXT-X-BYTERANGE"))?(u=t(pz(c,n.value)),r=u.next().value,u=u.next().value):z.length&&(r=z[0].startByte,u=z[z.length-1].endByte);c="";n=null;"image"==g&&(c="1x1",m=Ox(m,"EXT-X-TILES"))&&(c=Jx(m,"LAYOUT"),(m=Ix(m,"DURATION"))&&(n=Number(m)));var R=null;b=new qj(e,q,function(){if(A)return A();null==R&&(R=Qx(h(),d.g,f));return R||[]},r,u,b,0,0,Infinity,z,c,n,w,y,k,0<z.length&&!!d.g);if(e=l(d.g))b.mimeType=e,qz.has(e)&&(b.Z=null);v&&(a.kc=!0,b.di(),
|
|
E&&b.Kg());return b}function pz(a,b){var c=0,d=null;b&&(c=b.split("@"),b=Number(c[0]),c=c[1]?Number(c[1]):a.endByte+1,d=c+b-1);return[c,d]}
|
|
function sy(a,b,c,d,e){if("video"==c||"audio"==c){var f=a.l.m;if(f&&!uy(a,c))for(b=Mx(b,"EXT-X-DATERANGE"),b=b.filter(function(L){return null!=Hx(L,"START-DATE")}).sort(function(L,K){L=Jx(L,"START-DATE");K=Jx(K,"START-DATE");return L<K?-1:L>K?1:0}),c=0;c<b.length;c++){var g=b[c];try{var h=Jx(g,"START-DATE"),k=Ad(h);if(!isNaN(k)){var l=Math.max(0,k-f),m=null,n=Ix(g,"END-DATE");if(n){var q=Ad(n);if(!isNaN(q)&&(m=q-f,0>m))continue}if(null==m){var r=Ix(g,"DURATION")||Ix(g,"PLANNED-DURATION");if(r){var u=
|
|
parseFloat(r);isNaN(u)||(m=l+u);if(0>k-f+u)continue}}var w=Ix(g,"CLASS")||"com.apple.quicktime.HLS",v="YES"==Ix(g,"END-ON-NEXT");if(null==m&&v){for(var y=c+1;y<b.length;y++){var z=Ix(b[y],"CLASS")||"com.apple.quicktime.HLS";if(w==z){var A=Jx(b[y],"START-DATE"),B=Ad(A);if(!isNaN(B)&&B&&B>k){m=Math.max(0,B-f);break}}}if(null==m)continue}y=["CLASS","START-DATE","END-DATE","DURATION","END-ON-NEXT"];for(var E=[],H=t(g.attributes),C=H.next();!C.done;C=H.next()){var D=C.value;if(!y.includes(D.name)){var I=
|
|
Sx(D.value,d);if("X-ASSET-URI"==D.name||"X-ASSET-LIST"==D.name)I=Qx(e(),D.value,d)[0];E.push({key:D.name,description:"",data:I,mimeType:null,pictureType:null})}}if(1<E.length)a.h.onMetadata(w,l,m,E)}}catch(L){}}}}
|
|
function py(a,b,c,d,e,f){var g=b.segments,h=void 0,k=Px(b.ea,"EXT-X-DISCONTINUITY-SEQUENCE",-1),l=Px(b.ea,"EXT-X-MEDIA-SEQUENCE",0),m=Ox(b.ea,"EXT-X-SKIP"),n=m?Number(Ix(m,"SKIPPED-SEGMENTS")):0,q=l+n,r=0;gy(a)&&c.has(q)&&(r=c.get(q));0===r&&a.Ba==Py&&0<c.size&&!c.has(q)&&null!=a.l.i&&(r=a.l.Eb());var u=[],w=null;m=[];for(var v=0;v<g.length;v++){var y=g[v],z=0==v?r:w.endTime;q=l+n+v;Ox(y.ea,"EXT-X-DISCONTINUITY")&&(k++,w&&w.Z&&(w.Z.g=z));var A=t(y.ea);for(var B=A.next();!B.done;B=A.next())B=B.value,
|
|
"EXT-X-KEY"==B.name&&(Zy(Jx(B,"METHOD"))?h=kz(a,B,b,e,d):h=void 0);c.set(q,z);A=jz(a,b,y.ea,e,d);if(z=nz(a,A,w,y,z,d,f,e,h))(w=Px(y.ea,"EXT-X-BITRATE"))?m.push({bitrate:w,duration:z.endTime-z.startTime}):m.length&&(w=m.pop(),w.duration+=z.endTime-z.startTime,m.push(w)),w=z,z.i=k,uy(a,f)&&null!=a.K&&q<a.K||u.push(z)}b=void 0;m.length&&(b=m.reduce(function(E,H){return E+H.duration},0),b=Math.round(m.reduce(function(E,H){return E+H.bitrate*H.duration},0)/b*1E3));if(m=u.some(function(E){return null!=
|
|
E.h}))for(c={},d=0;d<u.length;c={Re:void 0,Qe:void 0,Ie:void 0,Tc:void 0,He:void 0},d++)if(c.Tc=u[d],null==c.Tc.h)for(c.Qe=0,c.Re=d,e=function(E){return function(){var H=u[E.Re];if(H){if(null!=H.h)return H.h+E.Qe;E.Qe-=H.endTime-H.startTime;E.Re+=1}return null}}(c),c.He=0,c.Ie=d,g=function(E){return function(){var H=u[E.Ie];if(H){H!=E.Tc&&(E.He+=H.endTime-H.startTime);if(null!=H.h)return H.h+E.He;--E.Ie}return null}}(c);null==c.Tc.h;)c.Tc.h=g(),null==c.Tc.h&&(c.Tc.h=e());if(m)for(c=t(u),d=c.next();!d.done;d=
|
|
c.next())for(e=d.value,d=e.h,e=t(e.g),g=e.next();!g.done;g=e.next())g=g.value,g.h=d,d+=g.endTime-g.startTime;c=a.ia;if(m&&Infinity!=c&&!uy(a,f))for(a=t(u),f=a.next();!f.done;f=a.next())f.value.ph(c);return{segments:u,bandwidth:b}}function Ty(a,b){if(a==wc){if("vtt"==b||"wvtt"==b)return"text/vtt";if(b&&""!==b)return"application/mp4"}return"image"!=a||b&&"jpeg"!=b?"audio"==a&&"mp4a.40.34"==b?"audio/mpeg":"mjpg"==b?"application/mp4":null:"image/jpeg"}
|
|
function Uy(a){return a==wc?"text/vtt":oz.get(a).get("mp4")}function Ly(a,b){a=gy(a)?Math.trunc((b.length-1)/2):0;for(var c=b[a];2==c.xc()&&a+1<b.length;)a++,c=b[a];return{segment:c,segmentIndex:a}}
|
|
function iz(a,b,c,d){var e,f,g,h,k,l,m,n,q,r,u,w,v;return Q(function(y){switch(y.g){case 1:e=Rg;f=Ly(a,d);g=f.segment;if(2==g.status)return y.return(Uy(b));h=g.O();k=new Bb(h[0]);l=k.mb.split(".").pop();m=oz.get(b);if((n=m.get(l))||(n=My.get(l))||(n=Ty(b,c)))return y.return(n);r=1;u=Lg(h,a.g.retryParameters);wa(y,2);u.method="HEAD";return F(y,Oy(a,u,e,{type:r}).promise,4);case 4:w=y.h;q=w.headers["content-type"];za(y,3);break;case 2:v=Aa(y);if(!v||1002!=v.code&&1001!=v.code){y.u(3);break}u.method=
|
|
"GET";a.g.hls.allowRangeRequestsToGuessMimeType&&(u.headers.Range="bytes=0-0");return F(y,Oy(a,u,e,{type:r}).promise,6);case 6:w=y.h,q=w.headers["content-type"];case 3:if(!q){y.u(7);break}n=q.toLowerCase().split(";")[0];if("application/octet-stream"!=n){y.u(8);break}if(w.data.byteLength){y.u(9);break}u.method="GET";return F(y,Oy(a,u,e,{type:r}).promise,10);case 10:w=y.h;case 9:qk(Tb(w.data))&&(n="video/mp2t");case 8:if("application/octet-stream"!=n)return y.return(n);case 7:return y.return(Uy(b))}})}
|
|
function dz(a,b,c,d,e,f,g){a&&(a.width=Number(b)||void 0,a.height=Number(c)||void 0,a.frameRate=Number(d)||void 0,a.hdr=e||void 0,a.videoLayout=f||void 0,a.colorGamut=g||void 0)}function ey(a,b,c){return Oy(a,Lg(b,a.g.retryParameters),0,{type:c?2:3})}
|
|
function cy(a){var b,c,d,e,f,g;return Q(function(h){switch(h.g){case 1:if(!a.h)return h.return();wa(h,2);b=Date.now();return F(h,a.update(),4);case 4:c=Date.now();gy(a)&&(d=(c-b)/1E3,a.eb.sample(1,d),e=0<a.g.updatePeriod?a.g.updatePeriod:a.o,f=Math.max(0,e-Wa(a.eb)),a.B.ha(f));za(h,3);break;case 2:g=Aa(h);if(!a.h)return h.return();if(a.g.raiseFatalErrorOnManifestUpdateRequestFailure)return a.h.onError(g),h.return();g.severity=1;a.h.onError(g);a.B.ha(.1);case 3:if(!a.h)return h.return();a.h.onManifestUpdated();
|
|
G(h)}})}function gy(a){return a.Ba!=dy}function ky(a,b){a.Ba=b;a.l&&a.l.Wc(!gy(a));gy(a)||a.B.stop()}function Oy(a,b,c,d){if(!a.W)throw new U(2,7,7001);d||(d={});d.isPreload=a.Xb();b=a.h.networkingEngine.request(c,b,d);Fg(a.W,b);return b}function Zy(a){return"AES-128"==a||"AES-256"==a||"AES-256-CTR"==a}
|
|
function by(a,b,c,d){var e,f,g,h,k,l;return Q(function(m){if(1==m.g){if("video/mp2t"==c)throw new U(2,4,4040);if("apple"===window.shakaMediaKeysPolyfill)throw new U(2,4,4041);e=Jx(b,"METHOD");f=["SAMPLE-AES","SAMPLE-AES-CTR"];if(!f.includes(e))return m.return(null);g="cenc";"SAMPLE-AES"==e&&(g="cbcs");h=Jx(b,"URI");k=rc("com.apple.fps",g,[{initDataType:"sinf",initData:new Uint8Array(0),keyId:null}],h);var n=(new Bb(h)).Bb.replace(/-/g,"").toLowerCase();return(l=32===n.length&&/^[0-9a-f]+$/.test(n)?
|
|
n:null)||!d?m.u(2):F(m,rz(a,d),3)}2!=m.g&&(l=m.h);l&&k.keyIds.add(l);return m.return(k)})}
|
|
function $y(a,b,c,d,e,f){var g,h,k,l,m,n,q,r,u,w,v,y;return Q(function(z){switch(z.g){case 1:if("video/mp2t"==c)throw new U(2,4,4040);if("apple"===window.shakaMediaKeysPolyfill)throw new U(2,4,4041);g=Jx(b,"METHOD");h=["SAMPLE-AES","SAMPLE-AES-CTR"];if(!h.includes(g))return z.return(null);k=Qx(d(),Jx(b,"URI"),f);if(k[0].startsWith("data:text/plain;base64,")){l=oc(mc(k[0].split("data:text/plain;base64,").pop()));z.u(2);break}m=k.sort().join("");a.ua.has(m)||(n=Lg(k,a.g.retryParameters),q=Oy(a,n,6).promise,
|
|
a.ua.set(m,q));return F(z,a.ua.get(m),3);case 3:r=z.h,l=oc(r.data);case 2:u="00000000000000000000000000000000";if(!e){z.u(4);break}return F(z,rz(a,e),5);case 5:(w=z.h)&&(u=w);case 4:return v=new Map,v.set(u,l),y="cenc","SAMPLE-AES"==g&&(y="cbcs"),z.return(sc(v,y))}})}
|
|
function rz(a,b){var c,d,e,f;return Q(function(g){if(1==g.g){c=null;if(a.va.has(b))return c=a.va.get(b),g.u(2);d=mm(b.O(),b.wc(),b.uc(),a.g.retryParameters);e=Rg;return F(g,Oy(a,d,e,{type:0}).promise,3)}2!=g.g&&(f=g.h,b.ee(f.data),c=km(f.data),a.va.set(b,c));return g.return(c)})}T("shaka.hls.HlsParser",ay);
|
|
var My=(new Map).set("aac","audio/aac").set("ac3","audio/ac3").set("ec3","audio/ec3").set("mp3","audio/mpeg"),sz=(new Map).set("mp4","audio/mp4").set("mp4a","audio/mp4").set("m4s","audio/mp4").set("m4i","audio/mp4").set("m4a","audio/mp4").set("m4f","audio/mp4").set("cmfa","audio/mp4").set("ts","video/mp2t").set("tsa","video/mp2t"),tz=(new Map).set("mp4","video/mp4").set("mp4v","video/mp4").set("m4s","video/mp4").set("m4i","video/mp4").set("m4v","video/mp4").set("m4f","video/mp4").set("cmfv","video/mp4").set("ts",
|
|
"video/mp2t").set("tsv","video/mp2t"),uz=(new Map).set("mp4","application/mp4").set("m4s","application/mp4").set("m4i","application/mp4").set("m4f","application/mp4").set("cmft","application/mp4").set("vtt","text/vtt").set("webvtt","text/vtt").set("ttml","application/ttml+xml"),vz=(new Map).set("jpg","image/jpeg").set("png","image/png").set("svg","image/svg+xml").set("webp","image/webp").set("avif","image/avif"),oz=(new Map).set("audio",sz).set("video",tz).set("text",uz).set("image",vz),qz=new Set(["video/mp2t"].concat(x(Ee))),
|
|
dy="VOD",lz="EVENT",Py="LIVE",jy={$i:dy,yl:lz,Il:Py};si("application/x-mpegurl",function(){return new ay});si("application/vnd.apple.mpegurl",function(){return new ay});function wz(a){return wu(a)}var xz=(new Map).set("com.microsoft.playready",wz).set("com.microsoft.playready.recommendation",wz).set("com.microsoft.playready.software",wz).set("com.microsoft.playready.hardware",wz);function yz(){var a=this;this.h=this.g=null;this.l=[];this.j=null;this.s=1;this.i=null;this.C=new Va(5);this.o=new $e(function(){zz(a)});this.B=new Eg;this.m=new Map;this.A=function(){return!1}}p=yz.prototype;p.configure=function(a,b){this.g=a;b&&(this.A=b)};p.start=function(a,b){var c=this;return Q(function(d){if(1==d.g)return c.l=[a],c.h=b,F(d,Az(c),2);if(!c.h)throw new U(2,7,7001);return d.return(c.j)})};
|
|
function zz(a){var b;Q(function(c){switch(c.g){case 1:return wa(c,2),F(c,Az(a),4);case 4:za(c,3);break;case 2:b=Aa(c),a.h&&(b.severity=1,a.h.onError(b));case 3:if(!a.h)return c.return();G(c)}})}p.stop=function(){this.g=this.h=null;this.l=[];this.j=null;null!=this.o&&(this.o.stop(),this.o=null);this.m.clear();return this.B.destroy()};
|
|
p.update=function(){var a=this,b;return Q(function(c){if(1==c.g)return wa(c,2),F(c,Az(a),4);if(2!=c.g)return za(c,0);b=Aa(c);if(!a.h||!b)return c.return();a.h.onError(b);G(c)})};p.onExpirationUpdated=function(){};p.onInitialVariantChosen=function(){};p.banLocation=function(){};p.setMediaElement=function(){};
|
|
function Az(a){var b,c,d,e,f,g,h;return Q(function(k){if(1==k.g)return b=Lg(a.l,a.g.retryParameters),c=a.h.networkingEngine,d=Date.now(),e=c.request(0,b,{type:5,isPreload:a.A()}),Fg(a.B,e),F(k,e.promise,2);f=k.h;if(!a.h)return k.return();f.uri&&!a.l.includes(f.uri)&&a.l.unshift(f.uri);var l=f.uri,m=f.data,n=a.g.mss.manifestPreprocessor;if(n!=xn){wb("manifest.mss.manifestPreprocessor configuration","Please Use manifest.mss.manifestPreprocessorTXml instead.");m=Aw(m,"SmoothStreamingMedia");if(!m)throw new U(2,
|
|
4,4046,l);n(m);m=ec(m.outerHTML)}var q=hd(m,"SmoothStreamingMedia");if(!q)throw new U(2,4,4046,l);l=a.g.mss.manifestPreprocessorTXml;l!=yn&&l(q);a.i||(a.i=new el(null,0));if(l=xd(q,"IsLive",Hd,!1))throw new U(2,4,4047);a.i.Wc(!l);n=xd(q,"TimeScale",Fd,1E7);m=xd(q,"DVRWindowLength",Fd);l&&(0===m||isNaN(m))&&(m=Infinity);var r=xd(q,"CanSeek",Hd,!1);0===m&&r&&(m=Infinity);r=null;m&&0<m&&(r=m/n);l&&!isNaN(a.g.availabilityWindowOverride)&&(r=a.g.availabilityWindowOverride);null==r&&(r=Infinity);a.i.Bf(r);
|
|
m=xd(q,"Duration",Fd,Infinity);l||a.i.ob(m/n);l={variants:[],textStreams:[],timescale:n,duration:m/n};var u;r=qd(q,"Protection");n=a.g.mss.keySystemsBySystemId;m=[];r=t(r);for(u=r.next();!u.done;u=r.next())m=m.concat(qd(u.value,"ProtectionHeader"));if(m.length){r=[];for(u=0;u<m.length;u++){var w=m[u],v=w.attributes.SystemID.toLowerCase(),y=n[v];if(y){var z;a:{if(z=uu(w)){z=t(td(z,"DATA"));for(var A=z.next();!A.done;A=z.next())if(A=ud(A.value,"KID")){z=mc(rd(A));z=new Uint8Array([z[3],z[2],z[1],z[0],
|
|
z[5],z[4],z[7],z[6]].concat(x(z.slice(8))));z=oc(z);break a}}z=null}A=mc(rd(w));v=nc(v.replace(/-/g,""));v=[{initData:nh(A,v,new Set,0),initDataType:"cenc",keyId:z}];v=rc(y,"cenc",v);z&&v.keyIds.add(z);if(y=xz.get(y))v.licenseServerUri=y(w);r.push(v)}}n=r}else n=[];u=n;r=[];n=[];m=[];q=qd(q,"StreamIndex");q=t(q);for(w=q.next();!w.done;w=q.next()){w=w.value;y=qd(w,"QualityLevel");v=l.timescale;z=l.duration;A=qd(w,"c");for(var B=[],E=0,H=0;H<A.length;++H){var C=A[H],D=A[H+1],I=xd(C,"t",Fd),L=xd(C,"d",
|
|
Fd);C=xd(C,"r",Dd);if(!L)break;I=null!=I?I:E;(C=C||0)&&C--;if(0>C)if(D){D=xd(D,"t",Fd);if(null==D)break;else if(I>=D)break;C=Math.ceil((D-I)/L)-1}else{if(Infinity==z)break;else if(I/v>=z)break;C=Math.ceil((z*v-I)/L)-1}for(D=0;D<=C;++D)E=I+L,B.push({start:I/v,end:E/v,xh:I}),I=E}v=B;y=t(y);for(z=y.next();!z.done;z=y.next())(z=Bz(a,w,z.value,v,u,l))&&("audio"!=z.type||a.g.disableAudio?"video"!=z.type||a.g.disableVideo?z.type!=wc||a.g.disableText||m.push(z):n.push(z):r.push(z))}q=[];r=t(0<r.length?r:
|
|
[null]);for(u=r.next();!u.done;u=r.next())for(u=u.value,w=t(0<n.length?n:[null]),B=w.next();!B.done;B=w.next())y=q,v=y.push,z=a,A=u,B=B.value,H=0,A&&A.bandwidth&&0<A.bandwidth&&(H+=A.bandwidth),B&&B.bandwidth&&0<B.bandwidth&&(H+=B.bandwidth),z={id:z.s++,language:A?A.language:"und",disabledUntilTime:0,primary:!!A&&A.primary||!!B&&B.primary,audio:A,video:B,bandwidth:H,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]},v.call(y,z);l.variants=q;l.textStreams=m;a.j?(a.j.variants=l.variants,
|
|
a.j.textStreams=l.textStreams,a.h.filter(a.j)):(a.j={presentationTimeline:a.i,variants:l.variants,textStreams:l.textStreams,imageStreams:[],offlineSessionIds:[],sequenceMode:a.g.mss.sequenceMode,ignoreManifestTimestampsInSegmentsMode:!1,type:"MSS",serviceDescription:null,nextUrl:null,periodCount:1,gapCount:0,isLowLatency:!1,startTime:null},a.i.ef());Promise.resolve();g=Date.now();h=(g-d)/1E3;a.C.sample(1,h);G(k)})}
|
|
function Bz(a,b,c,d,e,f){var g=b.attributes.Type;if("audio"!==g&&"video"!==g&&"text"!==g)return bb("Ignoring unrecognized type:",g),null;var h=b.attributes.Language,k=a.s++,l=xd(c,"Bitrate",Ed),m=xd(c,"MaxWidth",Ed),n=xd(c,"MaxHeight",Ed),q=xd(c,"Channels",Ed),r=xd(c,"SamplingRate",Ed),u=f.duration;d.length&&(u=d[d.length-1].end-d[0].start);var w=a.i.getDuration();a.i.ob(Math.min(u,w));var v={id:k,originalId:b.attributes.Name||String(k),groupId:null,createSegmentIndex:function(){return Promise.resolve()},
|
|
closeSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:"",codecs:"",frameRate:void 0,pixelAspectRatio:void 0,bandwidth:l||0,width:m||void 0,height:n||void 0,kind:"",encrypted:0<e.length,drmInfos:e,keyIds:new Set,language:gf(h||"und"),originalLanguage:h,label:"",type:"",primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:[],roles:[],forced:!1,channelsCount:q,audioSamplingRate:r,spatialAudio:!1,closedCaptions:null,hdr:void 0,colorGamut:void 0,videoLayout:void 0,
|
|
tilesLayout:void 0,matchedStreams:[],mssPrivateData:{duration:u,timescale:f.timescale,codecPrivateData:null},accessibilityPurpose:null,external:!1,fastSwitching:!1,fullMimeTypes:new Set,isAudioMuxedInVideo:!1,baseOriginalId:null};if(e=b.attributes.Subtype)(e=Cz.get(e))&&v.roles.push(e),"main"===e&&(v.primary=!0);e=c.attributes.FourCC;if(null===e||""===e)e=b.attributes.FourCC;if(!e)if("audio"===g)e="AAC";else if("video"===g)return bb('FourCC is not defined whereas it is required for a QualityLevel element for a StreamIndex of type "video"'),
|
|
null;if(!Dz.includes(e.toUpperCase()))return bb("Codec not supported:",e),null;c=Ez(c,g,e,v);v.mssPrivateData.codecPrivateData=c;switch(g){case "audio":if(!c)return bb("Quality unsupported without CodecPrivateData",g),null;v.type="audio";v.mimeType="mss/audio/mp4";v.codecs=Fz(e,c);break;case "video":if(!c)return bb("Quality unsupported without CodecPrivateData",g),null;v.type="video";v.mimeType="mss/video/mp4";v.codecs=Gz(c);break;case "text":if(v.type=wc,v.mimeType="application/mp4","TTML"===e||
|
|
"DFXP"===e)v.codecs="stpp"}v.fullMimeTypes.add(De(v.mimeType,v.codecs));v.createSegmentIndex=function(){if(v.segmentIndex)return Promise.resolve();if(a.m.has(v.id))var y=a.m.get(v.id);else y=[],"video"==v.type&&(y=v.mssPrivateData.codecPrivateData.split("00000001").slice(1)),y={id:v.id,type:v.type,codecs:v.codecs,encrypted:v.encrypted,timescale:v.mssPrivateData.timescale,duration:v.mssPrivateData.duration,zb:y,Da:new Uint8Array([]),Na:new Uint8Array([]),Wa:0,Xa:0,data:null,stream:v},y=Ni(new Hi([y])),
|
|
a.m.set(v.id,y);y=Hz(a,new oj(function(){return[]},0,null,Rl(v),v.mssPrivateData.timescale,y,null,v.encrypted),v,b,d);v.segmentIndex=new Cl(y);return Promise.resolve()};v.closeSegmentIndex=function(){v.segmentIndex&&(v.segmentIndex.release(),v.segmentIndex=null)};return v}
|
|
function Ez(a,b,c,d){if(a=a.attributes.CodecPrivateData)return a;if("audio"!==b)return null;b=d.channelsCount||2;a=d.audioSamplingRate||44100;var e={96E3:0,88200:1,64E3:2,48E3:3,44100:4,32E3:5,24E3:6,22050:7,16E3:8,12E3:9,11025:10,8E3:11,7350:12};d=e[a];if("AACH"===c)return c=new Uint8Array(4),a=e[2*a],c[0]=40|d>>1,c[1]=d<<7|b<<3|a>>1,c[2]=a<<7|8,c[3]=0,b=new Uint16Array(2),b[0]=(c[0]<<8)+c[1],b[1]=(c[2]<<8)+c[3],b[0].toString(16)+b[1].toString(16);c=new Uint8Array(2);c[0]=16|d>>1;c[1]=d<<7|b<<3;
|
|
b=new Uint16Array(1);b[0]=(c[0]<<8)+c[1];return b[0].toString(16)}function Fz(a,b){var c=0;"AACH"===a&&(c=5);b?0===c&&(c=(parseInt(b.substr(0,2),16)&248)>>3):(c=2,"AACH"===a&&(c=5));return"mp4a.40."+c}function Gz(a){var b=/00000001[0-9]7/.exec(a);return b.length&&a?"avc1."+a.substr(a.indexOf(b[0])+10,6):""}
|
|
function Hz(a,b,c,d,e){var f=d.attributes.Url.replace("{bitrate}",String(c.bandwidth));d=[];e=t(e);for(var g=e.next(),h={};!g.done;h={Df:void 0},g=e.next())h.Df=g.value,d.push(new qj(h.Df.start,h.Df.end,function(k){return function(){return qc(a.l,[f.replace("{start time}",String(k.Df.xh))])}}(h),0,null,b,0,0,c.mssPrivateData.duration));return d}T("shaka.mss.MssParser",yz);
|
|
var Dz="AAC AACL AACH AACP AVC1 H264 TTML DFXP".split(" "),Cz=(new Map).set("CAPT","main").set("SUBT","alternate").set("DESC","main");si("application/vnd.ms-sstr+xml",function(){return new yz});function Iz(a,b,c,d,e,f,g){if(200<=c&&299>=c&&202!=c||304==c)return{uri:e||d,originalUri:d,data:b,status:c,headers:a,fromCache:!!a["x-shaka-from-cache"],originalRequest:f};f=null;try{f=dc(b)}catch(h){}throw new U(401==c||403==c?2:1,1,1001,d,c,f,a,g,e||d);};function Jz(){}
|
|
function Kz(a,b,c,d,e,f){var g=new Lz;Xg(b.headers).forEach(function(m,n){g.append(n,m)});var h=new Mz,k={Hh:!1,Vi:!1};a=Nz(a,b,c,{body:b.body||void 0,headers:g,method:b.method,signal:h.signal,credentials:b.allowCrossSiteCredentials?"include":void 0},k,d,e,b.streamDataCallback,f.minBytesForProgressEvents||0);a=new ug(a,function(){k.Hh=!0;h.abort();return Promise.resolve()});if(b=b.retryParameters.timeout){var l=new $e(function(){k.Vi=!0;h.abort()});l.ha(b/1E3);a.finally(function(){l.stop()})}return a}
|
|
function Nz(a,b,c,d,e,f,g,h,k){var l,m,n,q,r,u,w,v,y,z,A,B,E,H,C;return Q(function(D){switch(D.g){case 1:return l=Oz,m=Pz,q=new ArrayBuffer(0),u=r=0,w={},v=Date.now(),wa(D,2),F(D,l(a,d),4);case 4:n=D.h;w=Qz(n.headers);g(w);if("HEAD"==d.method){D.u(5);break}z=(y=n.headers.get("Content-Length"))?parseInt(y,10):0;if(!n.body)return F(D,n.arrayBuffer(),9);A=n.clone().body.getReader();B=function(I){function L(){var K,J,M,O;return Q(function(N){switch(N.g){case 1:return wa(N,2),F(N,A.read(),4);case 4:K=
|
|
N.h;za(N,3);break;case 2:return Aa(N),N.return();case 3:if(K.done){N.u(5);break}r+=K.value.byteLength;if(!h){N.u(5);break}return F(N,h(K.value),5);case 5:J=Date.now();M=r-u;if(100<J-v&&M>=k||K.done)O=K.done?0:z-r,f(J-v,M,O),u=r,v=J;K.done?I.close():(I.enqueue(K.value),L());G(N)}})}L()};new m({start:B});return F(D,n.arrayBuffer(),8);case 8:q=D.h;D.u(5);break;case 9:q=D.h,E=Date.now(),f(E-v,q.byteLength,0);case 5:b.headers.Range&&(H=b.headers.Range.replace("bytes=","").split("-").filter(function(I){return I}).map(function(I){return parseInt(I,
|
|
10)}),2==H.length&&q.byteLength!=H[1]-H[0]+1&&bb("Payload length does not match range requested bytes",b,n));za(D,3);break;case 2:C=Aa(D);if(e.Hh)throw new U(1,1,7001,a,c);if(e.Vi)throw new U(1,1,1003,a,c);throw new U(1,1,1002,a,C,c);case 3:return D.return(Iz(w,q,n.status,a,n.url,b,c))}})}function Qz(a){var b={};a.forEach(function(c,d){b[d.trim()]=c});return b}
|
|
function Rz(){if(window.ReadableStream)try{new ReadableStream({})}catch(a){return!1}else return!1;if(window.Response){if(!(new Response("")).body)return!1}else return!1;return!(!window.fetch||"polyfill"in window.fetch||!window.AbortController)}T("shaka.net.HttpFetchPlugin",Jz);Jz.isSupported=Rz;Jz.parse=Kz;var Oz=window.fetch,Mz=window.AbortController,Pz=window.ReadableStream,Lz=window.Headers;Rz()&&(Hg("http",Kz,2,!0),Hg("https",Kz,2,!0),Hg("blob",Kz,2,!0));function Sz(){}
|
|
function Tz(a,b,c,d,e,f){var g=new Uz,h=Date.now(),k=0,l=new Promise(function(m,n){g.open(b.method,a,!0);g.responseType="arraybuffer";g.timeout=b.retryParameters.timeout;g.withCredentials=b.allowCrossSiteCredentials;g.onabort=function(){n(new U(1,1,7001,a,c))};var q=!1;g.onreadystatechange=function(){if(2==g.readyState&&!q){var u=Vz(g);e(u);q=!0}};g.onload=function(u){var w=Vz(g),v=g.response;try{d(Date.now()-h,u.loaded-k,0);var y=Iz(w,v,g.status,a,g.responseURL,b,c);m(y)}catch(z){n(z)}};g.onerror=
|
|
function(u){n(new U(1,1,1002,a,u,c))};g.ontimeout=function(){n(new U(1,1,1003,a,c))};g.onprogress=function(u){var w=Date.now(),v=f.minBytesForProgressEvents||0,y=u.loaded-k;if(100<w-h&&y>=v||u.lengthComputable&&u.loaded==u.total)d(w-h,y,4==g.readyState?0:u.total-u.loaded),k=u.loaded,h=w};for(var r in b.headers)g.setRequestHeader(r.toLowerCase(),b.headers[r]);g.send(b.body)});return new ug(l,function(){g.abort();return Promise.resolve()})}
|
|
function Vz(a){var b=a.getAllResponseHeaders().trim().split("\r\n");a={};b=t(b);for(var c=b.next();!c.done;c=b.next())c=c.value.split(": "),a[c[0].toLowerCase()]=c.slice(1).join(": ");return a}T("shaka.net.HttpXHRPlugin",Sz);Sz.parse=Tz;var Uz=window.XMLHttpRequest;Hg("http",Tz,1,!0);Hg("https",Tz,1,!0);Hg("blob",Tz,1,!0);function Wz(a,b,c,d,e){this.g=a;this.i=b;this.groupId=c;this.h=d;this.j=e}function Xz(a){var b=a.Wb(!1);return b?lc(b):a.O().map(function(c){return"{"+encodeURI(c.split("#xywh=")[0])+"}"}).join("")+":"+a.startByte+":"+a.endByte}function Yz(a,b){return mm(a.g.O(),a.g.startByte,a.g.endByte,b.streaming.retryParameters)};function Zz(){this.g=this.j=this.i=0;this.h=new Map;this.l=0}function $z(a,b){a.i+=b;var c=a.l;a.l++;a.h.set(c,b);return c}Zz.prototype.close=function(a,b){if(this.h.has(a)){var c=this.h.get(a);this.h.delete(a);this.j+=c;this.g+=b}};function aA(a){return 0==a.i?0:a.j/a.i};function bA(a){var b=this;this.s=a;this.i=new Map;this.h=new Tg(function(){return cA(b).catch(function(){})});this.j=[];this.o=function(){};this.m=function(){};this.g=new Zz;this.l=!1}bA.prototype.destroy=function(){return this.h.destroy()};function dA(a,b,c){a.o=b;a.m=c}function cA(a){a.l=!0;var b=a.j.map(function(c){return c()});a.j=[];return Promise.all(b)}
|
|
bA.prototype.queue=function(a,b,c,d,e){var f=this;Ug(this.h);var g=(this.i.get(a)||Promise.resolve()).then(function(){var h,k,l,m,n,q,r;return Q(function(u){if(1==u.g)return F(u,eA(f,b),2);h=u.h;if(f.h.g)throw new U(2,9,7001);if(d)for(m in k=Tb(h),l=new mh(k),l.data)n=Number(m),q=l.data[n],r=l.g[n],f.m(q,r);f.g.close(c,h.byteLength);f.o(aA(f.g),f.g.g);return u.return(e(h))})});this.i.set(a,g);return g};
|
|
function fA(a,b,c,d,e,f){Ug(a.h);var g=(a.i.get(b)||Promise.resolve()).then(function(){if(a.h.g)throw new U(2,9,7001);if(e){var h=Tb(c);h=new mh(h);for(var k in h.data){var l=Number(k);a.m(h.data[l],h.g[l])}}a.g.close(d,c.byteLength);a.o(aA(a.g),a.g.g);return f(c)});a.i.set(b,g)}function gA(a){return Q(function(b){return 1==b.g?F(b,Promise.all(a.i.values()),2):b.return(a.g.g)})}
|
|
function eA(a,b){var c,d,e,f;return Q(function(g){if(1==g.g)return c=Rg,d=a.s.request(c,b),e=function(){return d.abort()},a.j.push(e),F(g,d.promise,2);f=g.h;Uc(a.j,e);return g.return(f.data)})};function hA(a,b){var c=this;this.i=a;this.h=a.objectStore(b);this.g=new tg;a.onabort=function(d){d.preventDefault();c.g.reject()};a.onerror=function(d){d.preventDefault();c.g.reject()};a.oncomplete=function(){c.g.resolve()}}hA.prototype.abort=function(){var a=this;return Q(function(b){if(1==b.g){try{a.i.abort()}catch(c){}wa(b,2);return F(b,a.g,4)}if(2!=b.g)return za(b,0);Aa(b);G(b)})};
|
|
function iA(a,b){return new Promise(function(c,d){var e=a.h.openCursor();e.onerror=d;e.onsuccess=function(){var f;return Q(function(g){if(1==g.g){if(null==e.result)return c(),g.return();f=e.result;return F(g,b(f.key,f.value,f),2)}f.continue();G(g)})}})}hA.prototype.store=function(){return this.h};hA.prototype.promise=function(){return this.g};function jA(a){this.h=a;this.g=[]}jA.prototype.destroy=function(){return Promise.all(this.g.map(function(a){return a.abort()}))};function kA(a,b){return lA(a,b,"readwrite")}function lA(a,b,c){c=a.h.transaction([b],c);var d=new hA(c,b);a.g.push(d);d.promise().then(function(){Uc(a.g,d)},function(){Uc(a.g,d)});return d};function mA(a,b,c){this.h=new jA(a);this.i=b;this.g=c}p=mA.prototype;p.destroy=function(){return this.h.destroy()};p.hasFixedKeySpace=function(){return!0};p.addSegments=function(){return nA(this.i)};p.removeSegments=function(a,b){return oA(this,this.i,a,b)};p.getSegments=function(a){var b=this,c;return Q(function(d){if(1==d.g)return F(d,pA(b,b.i,a),2);c=d.h;return d.return(c.map(function(e){return b.Jh(e)}))})};p.addManifests=function(){return nA(this.g)};
|
|
p.updateManifest=function(){return Promise.reject(new U(2,9,9016,"Cannot modify values in "+this.g))};function qA(a,b,c){a=kA(a.h,a.g);var d=a.store();d.get(b).onsuccess=function(){d.put(c,b)};return a.promise()}p.updateManifestExpiration=function(a,b){var c=kA(this.h,this.g),d=c.store();d.get(a).onsuccess=function(e){if(e=e.target.result)e.expiration=b,d.put(e,a)};return c.promise()};p.removeManifests=function(a,b){return oA(this,this.g,a,b)};
|
|
p.getManifests=function(a){var b=this,c;return Q(function(d){if(1==d.g)return F(d,pA(b,b.g,a),2);c=d.h;return d.return(Promise.all(c.map(function(e){return b.Gd(e)})))})};p.getAllManifests=function(){var a=this,b,c;return Q(function(d){return 1==d.g?(b=lA(a.h,a.g,"readonly"),c=new Map,F(d,iA(b,function(e,f){var g;return Q(function(h){if(1==h.g)return F(h,a.Gd(f),2);g=h.h;c.set(e,g);G(h)})}),2)):3!=d.g?F(d,b.promise(),3):d.return(c)})};p.Jh=function(a){return a};p.Gd=function(a){return Promise.resolve(a)};
|
|
function nA(a){return Promise.reject(new U(2,9,9011,"Cannot add new value to "+a))}p.add=function(a,b){var c=this,d,e,f,g,h,k,l;return Q(function(m){if(1==m.g){d=kA(c.h,a);e=d.store();f=[];g=t(b);h=g.next();for(k={};!h.done;k={Wg:void 0},h=g.next())l=h.value,k.Wg=e.add(l),k.Wg.onsuccess=function(n){return function(){f.push(n.Wg.result)}}(k);return F(m,d.promise(),2)}return m.return(f)})};
|
|
function oA(a,b,c,d){a=kA(a.h,b);b=a.store();c=t(c);for(var e=c.next(),f={};!e.done;f={Ig:void 0},e=c.next())f.Ig=e.value,b.delete(f.Ig).onsuccess=function(g){return function(){return d(g.Ig)}}(f);return a.promise()}
|
|
function pA(a,b,c){var d,e,f,g,h,k,l;return Q(function(m){if(1==m.g){d=lA(a.h,b,"readonly");e=d.store();f={};g=[];h=t(c);k=h.next();for(l={};!k.done;l={xf:void 0,$e:void 0},k=h.next())l.$e=k.value,l.xf=e.get(l.$e),l.xf.onsuccess=function(n){return function(){void 0==n.xf.result&&g.push(n.$e);f[n.$e]=n.xf.result}}(l);return F(m,d.promise(),2)}if(g.length)throw new U(2,9,9012,"Could not find values for "+g);return m.return(c.map(function(n){return f[n]}))})};function rA(a){this.g=new jA(a)}rA.prototype.destroy=function(){return this.g.destroy()};rA.prototype.getAll=function(){var a=this,b,c;return Q(function(d){return 1==d.g?(b=lA(a.g,"session-ids","readonly"),c=[],F(d,iA(b,function(e,f){c.push(f)}),2)):3!=d.g?F(d,b.promise(),3):d.return(c)})};rA.prototype.add=function(a){var b=kA(this.g,"session-ids"),c=b.store();a=t(a);for(var d=a.next();!d.done;d=a.next())c.add(d.value);return b.promise()};
|
|
rA.prototype.remove=function(a){var b=this,c;return Q(function(d){return 1==d.g?(c=kA(b.g,"session-ids"),F(d,iA(c,function(e,f,g){a.includes(f.sessionId)&&g.delete()}),2)):F(d,c.promise(),0)})};function sA(){this.g=new Map}sA.prototype.destroy=function(){for(var a=[],b=t(this.g.values()),c=b.next();!c.done;c=b.next())a.push(c.value.destroy());this.g.clear();return Promise.all(a)};sA.prototype.init=function(){var a=this;tA.forEach(function(e,f){(e=e())&&a.g.set(f,e)});for(var b=[],c=t(this.g.values()),d=c.next();!d.done;d=c.next())b.push(d.value.init());return Promise.all(b)};
|
|
function uA(a){var b=null;a.g.forEach(function(c,d){c.getCells().forEach(function(e,f){e.hasFixedKeySpace()||b||(b={path:{Pb:d,bb:f},bb:e})})});if(b)return b;throw new U(2,9,9013,"Could not find a cell that supports add-operations");}function vA(a,b){a.g.forEach(function(c,d){c.getCells().forEach(function(e,f){b({Pb:d,bb:f},e)})})}
|
|
function wA(a,b,c){a=a.g.get(b);if(!a)throw new U(2,9,9013,"Could not find mechanism with name "+b);b=a.getCells().get(c);if(!b)throw new U(2,9,9013,"Could not find cell with name "+c);return b}function xA(a,b){a.g.forEach(function(c){b(c.getEmeSessionCell())})}function yA(a){var b=Array.from(a.g.keys());if(!b.length)throw new U(2,9,9E3,"No supported storage mechanisms found");return a.g.get(b[0]).getEmeSessionCell()}
|
|
function zA(a){var b,c,d;return Q(function(e){return 1==e.g?(b=Array.from(a.g.values()),c=0<b.length,c||(d=tA,d.forEach(function(f){(f=f())&&b.push(f)})),F(e,Promise.all(b.map(function(f){return f.erase()})),2)):c?e.u(0):F(e,Promise.all(b.map(function(f){return f.destroy()})),0)})}function AA(a,b){tA.set(a,b)}T("shaka.offline.StorageMuxer",sA);sA.unregister=function(a){tA.delete(a)};sA.register=AA;sA.prototype.destroy=sA.prototype.destroy;var tA=new Map;function BA(){mA.apply(this,arguments)}pa(BA,mA);BA.prototype.updateManifestExpiration=function(a,b){var c=this,d,e,f;return Q(function(g){d=kA(c.h,c.g);e=d.store();f=new tg;e.get(a).onsuccess=function(h){(h=h.target.result)?(h.expiration=b,e.put(h),f.resolve()):f.reject(new U(2,9,9012,"Could not find values for "+a))};return F(g,Promise.all([d.promise(),f]),0)})};
|
|
BA.prototype.Gd=function(a){var b,c,d,e,f,g;return Q(function(h){if(1==h.g){b=[];for(c=0;c<a.periods.length;++c)d=c==a.periods.length-1?a.duration:a.periods[c+1].startTime,e=d-a.periods[c].startTime,f=CA(a.periods[c],e),b.push(f);return F(h,Jv(b),2)}g=h.h;return h.return({creationTime:0,originalManifestUri:a.originalManifestUri,duration:a.duration,size:a.size,expiration:null==a.expiration?Infinity:a.expiration,streams:g,sessionIds:a.sessionIds,drmInfo:a.drmInfo,appMetadata:a.appMetadata,sequenceMode:!1})})};
|
|
function CA(a,b){DA(a);for(var c=t(a.streams),d=c.next();!d.done;d=c.next());return a.streams.map(function(e){return EA(e,a.startTime,b)})}
|
|
function EA(a,b,c){var d=a.initSegmentUri?FA(a.initSegmentUri):null,e=b+a.presentationTimeOffset,f=b+c;return{id:a.id,originalId:null,groupId:null,primary:a.primary,type:a.contentType,mimeType:a.mimeType,codecs:a.codecs,frameRate:a.frameRate,pixelAspectRatio:void 0,hdr:void 0,colorGamut:void 0,videoLayout:void 0,kind:a.kind,language:a.language,originalLanguage:a.language||null,label:a.label,width:a.width,height:a.height,initSegmentKey:d,encrypted:a.encrypted,keyIds:new Set([a.keyId]),segments:a.segments.map(function(g){var h=
|
|
FA(g.uri);return{startTime:b+g.startTime,endTime:b+g.endTime,dataKey:h,initSegmentKey:d,appendWindowStart:b,appendWindowEnd:f,timestampOffset:e,tilesLayout:"",mimeType:null,codecs:null,thumbnailSprite:null}}),variantIds:a.variantIds,roles:[],forced:!1,audioSamplingRate:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,tilesLayout:void 0,external:!1,fastSwitching:!1,isAudioMuxedInVideo:!1}}BA.prototype.Jh=function(a){return{data:a.data}};
|
|
function FA(a){var b;if((b=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(a))||(b=/^offline:segment\/([0-9]+)$/.exec(a)))return Number(b[1]);throw new U(2,9,9004,"Could not parse uri "+a);}
|
|
function DA(a){var b=a.streams.filter(function(h){return"audio"==h.contentType});a=a.streams.filter(function(h){return"video"==h.contentType});if(!b.every(function(h){return h.variantIds})||!a.every(function(h){return h.variantIds})){for(var c=t(b),d=c.next();!d.done;d=c.next())d.value.variantIds=[];c=t(a);for(d=c.next();!d.done;d=c.next())d.value.variantIds=[];c=0;if(a.length&&!b.length){d=c++;for(var e=t(a),f=e.next();!f.done;f=e.next())f.value.variantIds.push(d)}if(!a.length&&b.length)for(d=c++,
|
|
e=t(b),f=e.next();!f.done;f=e.next())f.value.variantIds.push(d);if(a.length&&b.length)for(b=t(b),d=b.next();!d.done;d=b.next())for(d=d.value,e=t(a),f=e.next();!f.done;f=e.next()){f=f.value;var g=c++;d.variantIds.push(g);f.variantIds.push(g)}}};function GA(){mA.apply(this,arguments)}pa(GA,mA);
|
|
GA.prototype.Gd=function(a){var b,c,d,e,f,g;return Q(function(h){if(1==h.g){b=[];for(c=0;c<a.periods.length;++c){d=c==a.periods.length-1?a.duration:a.periods[c+1].startTime;e=d-a.periods[c].startTime;for(var k=a.periods[c],l=[],m=t(k.streams),n=m.next();!n.done;n=m.next())n=n.value,0!=n.variantIds.length&&l.push(HA(n,k.startTime,k.startTime+e));f=l;b.push(f)}return F(h,Jv(b),2)}g=h.h;return h.return({appMetadata:a.appMetadata,creationTime:0,drmInfo:a.drmInfo,duration:a.duration,expiration:null==a.expiration?
|
|
Infinity:a.expiration,originalManifestUri:a.originalManifestUri,sessionIds:a.sessionIds,size:a.size,streams:g,sequenceMode:!1})})};
|
|
function HA(a,b,c){return{id:a.id,originalId:a.originalId,groupId:null,primary:a.primary,type:a.contentType,mimeType:a.mimeType,codecs:a.codecs,frameRate:a.frameRate,pixelAspectRatio:a.pixelAspectRatio,hdr:void 0,colorGamut:void 0,videoLayout:void 0,kind:a.kind,language:a.language,originalLanguage:a.language||null,label:a.label,width:a.width,height:a.height,encrypted:a.encrypted,keyIds:new Set([a.keyId]),segments:a.segments.map(function(d){return{startTime:b+d.startTime,endTime:b+d.endTime,initSegmentKey:a.initSegmentKey,
|
|
appendWindowStart:b,appendWindowEnd:c,timestampOffset:b-a.presentationTimeOffset,dataKey:d.dataKey,tilesLayout:"",mimeType:null,codecs:null,thumbnailSprite:null}}),variantIds:a.variantIds,roles:[],forced:!1,audioSamplingRate:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,tilesLayout:void 0,external:!1,fastSwitching:!1,isAudioMuxedInVideo:!1}};function IA(){mA.apply(this,arguments)}pa(IA,mA);p=IA.prototype;p.hasFixedKeySpace=function(){return!1};p.addSegments=function(a){return this.add(this.i,a)};p.addManifests=function(a){return this.add(this.g,a)};p.updateManifest=function(a,b){return qA(this,a,b)};p.Gd=function(a){null==a.expiration&&(a.expiration=Infinity);return Promise.resolve(a)};function JA(){this.m=this.j=this.i=this.h=this.g=this.l=null}p=JA.prototype;
|
|
p.init=function(){var a=this,b=new tg,c=!1,d=new $e(function(){c=!0;b.reject(new U(2,9,9017))});"number"===typeof KA&&0<KA&&d.ha(KA);var e=window.indexedDB.open("shaka_offline_db",5);e.onsuccess=function(){if(!c){d.stop();var f=e.result;a.l=f;var g=f.objectStoreNames;g=g.contains("manifest")&&g.contains("segment")?new BA(f,"segment","manifest"):null;a.g=g;g=f.objectStoreNames;g=g.contains("manifest-v2")&&g.contains("segment-v2")?new GA(f,"segment-v2","manifest-v2"):null;a.h=g;g=f.objectStoreNames;
|
|
g=g.contains("manifest-v3")&&g.contains("segment-v3")?new GA(f,"segment-v3","manifest-v3"):null;a.i=g;g=f.objectStoreNames;g=g.contains("manifest-v5")&&g.contains("segment-v5")?new IA(f,"segment-v5","manifest-v5"):null;a.j=g;f=f.objectStoreNames.contains("session-ids")?new rA(f):null;a.m=f;b.resolve()}};e.onupgradeneeded=function(){for(var f=e.result,g=t(["segment-v5","manifest-v5","session-ids"]),h=g.next();!h.done;h=g.next())h=h.value,f.objectStoreNames.contains(h)||f.createObjectStore(h,{autoIncrement:!0})};
|
|
e.onerror=function(f){c||(d.stop(),b.reject(new U(2,9,9001,e.error)),f.preventDefault())};return b};p.destroy=function(){var a=this;return Q(function(b){switch(b.g){case 1:if(!a.g){b.u(2);break}return F(b,a.g.destroy(),2);case 2:if(!a.h){b.u(4);break}return F(b,a.h.destroy(),4);case 4:if(!a.i){b.u(6);break}return F(b,a.i.destroy(),6);case 6:if(!a.j){b.u(8);break}return F(b,a.j.destroy(),8);case 8:if(!a.m){b.u(10);break}return F(b,a.m.destroy(),10);case 10:a.l&&a.l.close(),G(b)}})};
|
|
p.getCells=function(){var a=new Map;this.g&&a.set("v1",this.g);this.h&&a.set("v2",this.h);this.i&&a.set("v3",this.i);this.j&&a.set("v5",this.j);return a};p.getEmeSessionCell=function(){return this.m};
|
|
p.erase=function(){var a=this;return Q(function(b){switch(b.g){case 1:if(!a.g){b.u(2);break}return F(b,a.g.destroy(),2);case 2:if(!a.h){b.u(4);break}return F(b,a.h.destroy(),4);case 4:if(!a.i){b.u(6);break}return F(b,a.i.destroy(),6);case 6:if(!a.j){b.u(8);break}return F(b,a.j.destroy(),8);case 8:return a.l&&a.l.close(),F(b,LA(),10);case 10:return a.l=null,a.g=null,a.h=null,a.i=null,a.j=null,F(b,a.init(),0)}})};
|
|
function LA(){var a=new tg,b=window.indexedDB.deleteDatabase("shaka_offline_db");b.onblocked=function(){};b.onsuccess=function(){a.resolve()};b.onerror=function(c){a.reject(new U(2,9,9001,b.error));c.preventDefault()};return a}var KA=5;T("shaka.offline.indexeddb.StorageMechanismOpenTimeout",KA);AA("idb",function(){return qb().oh()?new JA:null});function MA(a,b,c,d){this.g=a;this.i=b;this.h=c;this.l=d;this.j=["offline:",a,"/",b,"/",c,"/",d].join("")}MA.prototype.Pb=function(){return this.i};MA.prototype.bb=function(){return this.h};MA.prototype.key=function(){return this.l};MA.prototype.toString=function(){return this.j};
|
|
function NA(a){a=/^offline:([a-z]+)\/([^/]+)\/([^/]+)\/([0-9]+)$/.exec(a);if(null==a)return null;var b=a[1];if("manifest"!=b&&"segment"!=b)return null;var c=a[2];if(!c)return null;var d=a[3];return d&&null!=b?new MA(b,c,d,Number(a[4])):null};function OA(a,b){this.h=a;this.g=b}
|
|
function PA(a,b){var c=new el(null,0);c.ob(b.duration);var d=b.streams.filter(function(l){return"audio"==l.type}),e=b.streams.filter(function(l){return"video"==l.type});d=QA(a,d,e,c);e=b.streams.filter(function(l){return l.type==wc}).map(function(l){return RA(a,l,c)});var f=b.streams.filter(function(l){return"image"==l.type}).map(function(l){return RA(a,l,c)}),g=b.drmInfo?[b.drmInfo]:[];if(b.drmInfo)for(var h=t(d.values()),k=h.next();!k.done;k=h.next())k=k.value,k.audio&&k.audio.encrypted&&(k.audio.drmInfos=
|
|
g),k.video&&k.video.encrypted&&(k.video.drmInfos=g);return{presentationTimeline:c,offlineSessionIds:b.sessionIds,variants:Array.from(d.values()),textStreams:e,imageStreams:f,sequenceMode:b.sequenceMode||!1,ignoreManifestTimestampsInSegmentsMode:!1,type:b.type||"UNKNOWN",serviceDescription:null,nextUrl:null,periodCount:1,gapCount:0,isLowLatency:!1,startTime:null}}
|
|
function QA(a,b,c,d){for(var e=new Set,f=t(b),g=f.next();!g.done;g=f.next()){g=t(g.value.variantIds);for(var h=g.next();!h.done;h=g.next())e.add(h.value)}f=t(c);for(g=f.next();!g.done;g=f.next())for(g=t(g.value.variantIds),h=g.next();!h.done;h=g.next())e.add(h.value);f=new Map;e=t(e);for(g=e.next();!g.done;g=e.next())g=g.value,f.set(g,{id:g,language:"",disabledUntilTime:0,primary:!1,audio:null,video:null,bandwidth:0,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]});b=t(b);for(e=b.next();!e.done;e=
|
|
b.next())for(g=e.value,e=RA(a,g,d),g=t(g.variantIds),h=g.next();!h.done;h=g.next())h=f.get(h.value),h.language=e.language,h.primary=h.primary||e.primary,h.audio=e;c=t(c);for(b=c.next();!b.done;b=c.next())for(e=b.value,b=RA(a,e,d),e=t(e.variantIds),g=e.next();!g.done;g=e.next())g=f.get(g.value),g.primary=g.primary||b.primary,g.video=b;return f}
|
|
function RA(a,b,c){var d=b.segments.map(function(e){return SA(a,e,b)});c.Xd(d);return{id:b.id,originalId:b.originalId,groupId:b.groupId,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new Cl(d),mimeType:b.mimeType,codecs:b.codecs,width:b.width||void 0,height:b.height||void 0,frameRate:b.frameRate,pixelAspectRatio:b.pixelAspectRatio,hdr:b.hdr,colorGamut:b.colorGamut,videoLayout:b.videoLayout,kind:b.kind,encrypted:b.encrypted,drmInfos:[],keyIds:b.keyIds,language:b.language,originalLanguage:b.originalLanguage||
|
|
null,label:b.label,type:b.type,primary:b.primary,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:b.roles,forced:b.forced,channelsCount:b.channelsCount,audioSamplingRate:b.audioSamplingRate,spatialAudio:b.spatialAudio,closedCaptions:b.closedCaptions,tilesLayout:b.tilesLayout,mssPrivateData:b.mssPrivateData,accessibilityPurpose:null,external:b.external,fastSwitching:b.fastSwitching,fullMimeTypes:new Set([De(b.mimeType,b.codecs)]),isAudioMuxedInVideo:!1,baseOriginalId:null}}
|
|
function SA(a,b,c){var d=new MA("segment",a.h,a.g,b.dataKey);a=new qj(b.startTime,b.endTime,function(){return[d.toString()]},0,null,null!=b.initSegmentKey?TA(a,b.initSegmentKey):null,b.timestampOffset,b.appendWindowStart,b.appendWindowEnd,[],b.tilesLayout||"");a.mimeType=b.mimeType||c.mimeType||"";a.codecs=b.codecs||c.codecs||"";b.thumbnailSprite&&a.Cf(b.thumbnailSprite);return a}function TA(a,b){var c=new MA("segment",a.h,a.g,b);return new oj(function(){return[c.toString()]},0,null)};function UA(){this.g=null}p=UA.prototype;p.configure=function(){};
|
|
p.start=function(a,b){var c=this,d,e,f,g,h,k,l;return Q(function(m){switch(m.g){case 1:d=NA(a);c.g=d;if(null==d||"manifest"!=d.g)throw new U(2,1,9004,a);e=new sA;ya(m,2);return F(m,e.init(),4);case 4:return F(m,wA(e,d.Pb(),d.bb()),5);case 5:return f=m.h,F(m,f.getManifests([d.key()]),6);case 6:return g=m.h,h=g[0],k=new OA(d.Pb(),d.bb()),l=PA(k,h),b.makeTextStreamsForClosedCaptions(l),m.return(l);case 2:return Ba(m),F(m,e.destroy(),7);case 7:Ca(m,0)}})};p.stop=function(){return Promise.resolve()};
|
|
p.update=function(){};
|
|
p.onExpirationUpdated=function(a,b){var c=this,d,e,f,g,h,k,l;return Q(function(m){switch(m.g){case 1:return d=c.g,e=new sA,wa(m,2,3),F(m,e.init(),5);case 5:return F(m,wA(e,d.Pb(),d.bb()),6);case 6:return f=m.h,F(m,f.getManifests([d.key()]),7);case 7:g=m.h;h=g[0];k=h.sessionIds.includes(a);l=void 0==h.expiration||h.expiration>b;if(!k||!l){m.u(3);break}return F(m,f.updateManifestExpiration(d.key(),b),3);case 3:return Ba(m),F(m,e.destroy(),10);case 10:Ca(m,0);break;case 2:Aa(m),m.u(3)}})};
|
|
p.onInitialVariantChosen=function(){};p.banLocation=function(){};p.setMediaElement=function(){};si("application/x-offline-manifest",function(){return new UA});function VA(){}function WA(a,b){var c=NA(a);c&&"manifest"==c.g?(a={uri:a,originalUri:a,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"},originalRequest:b},a=xg(a)):a=c&&"segment"==c.g?XA(c.key(),c,b):vg(new U(2,1,9004,a));return a}
|
|
function XA(a,b,c){var d=new sA;return xg(void 0).Va(function(){return d.init()}).Va(function(){return wA(d,b.Pb(),b.bb())}).Va(function(e){return e.getSegments([b.key()])}).Va(function(e){return{uri:b,data:e[0].data,headers:{},originalRequest:c}}).finally(function(){return d.destroy()})}T("shaka.offline.OfflineScheme",VA);VA.plugin=WA;Hg("offline",WA);function YA(a,b,c){var d,e,f,g,h,k;return Q(function(l){switch(l.g){case 1:d=[];for(var m=[],n=t(c),q=n.next();!q.done;q=n.next()){q=q.value;for(var r=!1,u=t(m),w=u.next();!w.done;w=u.next())if(w=w.value,ZA(w.info,q)){w.sessionIds.push(q.sessionId);r=!0;break}r||m.push({info:q,sessionIds:[q.sessionId]})}e=t(m);f=e.next();case 2:if(f.done){l.u(4);break}g=f.value;h=$A(a,b,g);return F(l,h,5);case 5:k=l.h;d=d.concat(k);f=e.next();l.u(2);break;case 4:return l.return(d)}})}
|
|
function $A(a,b,c){var d,e;return Q(function(f){switch(f.g){case 1:return d=new oh({lc:b,onError:function(){},nf:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),wa(f,2),d.configure(a),F(f,zh(d,c.info.keySystem,c.info.licenseUri,c.info.serverCertificate,c.info.audioCapabilities,c.info.videoCapabilities),4);case 4:za(f,3);break;case 2:return Aa(f),F(f,d.destroy(),5);case 5:return f.return([]);case 3:return e=[],F(f,Promise.all(c.sessionIds.map(function(g){return Q(function(h){if(1==
|
|
h.g)return wa(h,2),F(h,Lh(d,g),4);if(2!=h.g)return e.push(g),za(h,0);Aa(h);G(h)})})),6);case 6:return F(f,d.destroy(),7);case 7:return f.return(e)}})}function ZA(a,b){function c(d,e){return d.robustness==e.robustness&&d.contentType==e.contentType}return a.keySystem==b.keySystem&&a.licenseUri==b.licenseUri&&Vc(a.audioCapabilities,b.audioCapabilities,c)&&Vc(a.videoCapabilities,b.videoCapabilities,c)};function aB(a,b,c){var d=b.presentationTimeline.getDuration();b=bB(b);return{offlineUri:null,originalManifestUri:a,duration:d,size:0,expiration:Infinity,tracks:b,appMetadata:c,isIncomplete:!1}}function cB(a,b){var c=PA(new OA(a.Pb(),a.bb()),b),d=b.appMetadata||{};c=bB(c);return{offlineUri:a.toString(),originalManifestUri:b.originalManifestUri,duration:b.duration,size:b.size,expiration:b.expiration,tracks:c,appMetadata:d,isIncomplete:b.isIncomplete||!1}}
|
|
function bB(a){var b=[],c=$f(a.variants);c=t(c);for(var d=c.next();!d.done;d=c.next())b.push(Lf(d.value));a=t(a.textStreams);for(c=a.next();!c.done;c=a.next())b.push(Of(c.value));return b};function dB(){this.g=new Map}function eB(a,b){var c=b.audio,d=b.video;c&&!d&&a.g.set(c.id,c.bandwidth||b.bandwidth);!c&&d&&a.g.set(d.id,d.bandwidth||b.bandwidth);if(c&&d){var e=c.bandwidth||393216,f=d.bandwidth||b.bandwidth-e;0>=f&&(f=b.bandwidth);a.g.set(c.id,e);a.g.set(d.id,f)}}function fB(a,b){a.g.set(b.id,b.bandwidth||2048)}function gB(a,b){a=a.g.get(b);null==a&&(a=0);return a};function hB(a){var b=this;if(a&&a.constructor!=Y)throw new U(2,9,9008);this.g=this.h=null;a?(this.h=a.g,this.g=a.Nb()):(this.h=wn(),this.g=new Gg,this.g.configure(this.h.networking));this.i=[];this.l=[];var c=!a;this.j=new Tg(function(){var d,e,f,g,h;return Q(function(k){switch(k.g){case 1:return F(k,Promise.all(b.l.map(function(l){return cA(l)})),2);case 2:d=function(){};e=[];f=t(b.i);for(g=f.next();!g.done;g=f.next())h=g.value,e.push(h.then(d,d));return F(k,Promise.all(e),3);case 3:if(!c){k.u(4);
|
|
break}return F(k,b.g.destroy(),4);case 4:b.h=null,b.g=null,G(k)}})});this.m=1E9}function iB(){if(vi(qb()))a:{var a=t(tA.values());for(var b=a.next();!b.done;b=a.next())if(b=b.value,b=b()){b.destroy();a=!0;break a}a=!1}else a=!1;return a}p=hB.prototype;p.destroy=function(){return this.j.destroy()};p.configure=function(a,b){2==arguments.length&&"string"==typeof a&&(a=bn(a,b));return Bn(this.h,a)};p.getConfiguration=function(){var a=wn();Bn(a,this.h,wn());return a};p.Nb=function(){return this.g};
|
|
p.store=function(a,b,c,d,e){var f=this,g=this.getConfiguration(),h=new bA(this.g);this.l.push(h);b=jB(this,a,b||{},d||[],e||[],function(){var k;return Q(function(l){if(1==l.g)return c?l.u(2):F(l,vo(a,f.g,g.manifest.retryParameters),3);2!=l.g&&(c=l.h);k=xi(a,c||null);return l.return(k())})},g,h);b=new ug(b,function(){return cA(h)});b.finally(function(){Uc(f.l,h)});return kB(this,b)};
|
|
function jB(a,b,c,d,e,f,g,h){var k,l,m,n,q,r,u,w,v,y,z,A,B,E,H,C,D,I,L,K,J,M,O,N;return Q(function(P){switch(P.g){case 1:return lB(),l=k=null,m=new sA,r=q=n=null,wa(P,2,3),F(P,f(),5);case 5:return k=P.h,F(P,mB(a,b,k,g),6);case 6:u=P.h;nB(a);w=!u.presentationTimeline.V()&&!u.presentationTimeline.Oc();if(!w)throw new U(2,9,9005,b);v=t(d);y=v.next();case 7:if(y.done){P.u(9);break}z=y.value;return F(P,oB(a,z,u),10);case 10:A=P.h;u.imageStreams.push(A);nB(a);y=v.next();P.u(7);break;case 9:B=t(e),E=B.next();
|
|
case 11:if(E.done)return Bh(g.drm.clearKeys,u.variants),D=u.variants.some(function(R){if(R.audio)for(var S=t(R.audio.drmInfos),aa=S.next();!aa.done;aa=S.next())if(aa.value.licenseServerUri.startsWith("data:"))return!0;if(R.video)for(R=t(R.video.drmInfos),S=R.next();!S.done;S=R.next())if(S.value.licenseServerUri.startsWith("data:"))return!0;return!1}),I=g.offline.usePersistentLicense,D&&(I=!1),F(P,a.dd(u,function(R){r=r||R},g,I),15);H=E.value;return F(P,pB(a,u,H.uri,H.language,H.kind,H.mime,H.codecs),
|
|
14);case 14:C=P.h;u.textStreams.push(C);nB(a);E=B.next();P.u(11);break;case 15:l=P.h;nB(a);if(r)throw r;return F(P,qB(u,l,g,I),16);case 16:return F(P,m.init(),17);case 17:return nB(a),F(P,uA(m),18);case 18:return n=P.h,nB(a),L=rB(l,u,b,c,g,h,I),K=L.ik,J=L.sh,F(P,n.bb.addManifests([K]),19);case 19:M=P.h;nB(a);q=M[0];nB(a);if(r)throw r;return F(P,sB(a,J,q,K,h,g,n.bb,u,l,I),20);case 20:return nB(a),tB(u,K,l,I),F(P,n.bb.updateManifest(q,K),21);case 21:return nB(a),O=new MA("manifest",n.path.Pb,n.path.bb,
|
|
q),P.return(cB(O,K));case 3:return Ba(P),F(P,m.destroy(),22);case 22:if(!k){P.u(23);break}return F(P,k.stop(),23);case 23:if(!l){P.u(25);break}return F(P,l.destroy(),25);case 25:Ca(P,0);break;case 2:N=Aa(P);if(null==q){P.u(27);break}return F(P,uB(q),27);case 27:throw r||N;}})}
|
|
function sB(a,b,c,d,e,f,g,h,k,l){var m,n,q,r,u,w,v,y,z,A,B;return Q(function(E){switch(E.g){case 1:m={};n=0;q=function(){if(a.j.g||e.l)throw new U(2,9,7001);};r=function(H,C){var D,I,L,K,J,M,O,N,P;return Q(function(R){if(1==R.g){D=t(H);I=D.next();for(L={};!I.done;L={fc:void 0},I=D.next())L.fc=I.value,q(),K=Yz(L.fc,f),J=L.fc.i,M=L.fc.h,O=function(S){return function(aa){var W,Fa,Ga,xa;return Q(function(qa){switch(qa.g){case 1:W=S.fc.g;Fa=W.Wb(!1);if(!W.aesKey||Fa){qa.u(2);break}return F(qa,lm(aa,W.aesKey,
|
|
S.fc.j),3);case 3:aa=qa.h;case 2:return Ga=Xz(W),F(qa,g.addSegments([{data:aa}]),4);case 4:xa=qa.h,q(),m[Ga]=xa[0],n+=aa.byteLength,G(qa)}})}}(L),N=L.fc.g,(P=N.Wb(!1))?fA(e,L.fc.groupId,P,J,M,O):e.queue(L.fc.groupId,K,J,M,O);return F(R,gA(e),2)}q();if(!C||e.l)return R.u(0);tB(h,d,k,l);return F(R,g.updateManifest(c,d),0)})};u=!1;wa(E,2);if(!vB(h)||!u||wB(h)){E.u(4);break}return F(E,r(b.filter(function(H){return H.h}),!0),5);case 5:return q(),b=b.filter(function(H){return!H.h}),w=m,v=n,m={},n=0,F(E,
|
|
xB(g,c,d,w,v,function(){return nB(a)}),6);case 6:q();case 4:if(u){E.u(7);break}return F(E,r(b,!1),8);case 8:return q(),y=m,z=n,m={},n=0,F(E,xB(g,c,d,y,z,function(){return q()}),9);case 9:q();case 7:za(E,0);break;case 2:return A=Aa(E),B=Object.values(m),F(E,g.removeSegments(B,function(){}),10);case 10:throw A;}})}
|
|
function uB(a){var b,c,d,e;return Q(function(f){switch(f.g){case 1:return b=new sA,F(f,b.init(),2);case 2:return F(f,uA(b),3);case 3:return c=f.h,d=new MA("manifest",c.path.Pb,c.path.bb,a),F(f,b.destroy(),4);case 4:return e=new hB,F(f,e.remove(d.toString()),0)}})}
|
|
function xB(a,b,c,d,e,f){var g,h,k,l,m,n,q,r,u,w,v;return Q(function(y){switch(y.g){case 1:g=!1;wa(y,2);h=!0;k=t(c.streams);for(l=k.next();!l.done;l=k.next())for(m=l.value,n=t(m.segments),q=n.next();!q.done;q=n.next())r=q.value,u=r.pendingSegmentRefId?d[r.pendingSegmentRefId]:null,null!=u&&(r.dataKey=u,r.pendingSegmentRefId=void 0),u=r.pendingInitSegmentRefId?d[r.pendingInitSegmentRefId]:null,null!=u&&(r.initSegmentKey=u,r.pendingInitSegmentRefId=void 0),r.pendingSegmentRefId&&(h=!1),r.pendingInitSegmentRefId&&
|
|
(h=!1);c.size+=e;h&&(c.isIncomplete=!1);return F(y,a.updateManifest(b,c),4);case 4:g=!0;f();za(y,0);break;case 2:return w=Aa(y),F(y,uB(b),5);case 5:if(g){y.u(6);break}v=Object.values(d);return F(y,a.removeSegments(v,function(){}),6);case 6:throw w;}})}
|
|
function qB(a,b,c,d){var e,f,g,h,k,l,m,n,q,r,u,w,v,y,z,A,B,E,H,C,D,I,L,K,J,M,O,N,P,R;return Q(function(S){switch(S.g){case 1:return e={width:Infinity,height:Infinity},sf(a,c.restrictions,e),F(S,vf(b,a,d,c.drm.preferredKeySystems,c.drm.keySystemsMapping),2);case 2:f=[];g=c.preferredDecodingAttributes;h=c.preferredVideoCodecs;k=c.preferredAudioCodecs;l=c.preferredTextFormats;qf(a,h,k,g,l);m=t(a.variants);for(n=m.next();!n.done;n=m.next())q=n.value,f.push(Lf(q));r=t(a.textStreams);for(u=r.next();!u.done;u=
|
|
r.next())w=u.value,f.push(Of(w));v=t(a.imageStreams);for(y=v.next();!y.done;y=v.next())z=y.value,f.push(Pf(z));return F(S,c.offline.trackSelectionCallback(f),3);case 3:A=S.h;B=a.presentationTimeline.getDuration();E=0;H=t(A);for(C=H.next();!C.done;C=H.next())D=C.value,I=D.bandwidth*B/8,E+=I;wa(S,4);return F(S,c.offline.downloadSizeCallback(E),6);case 6:L=S.h;if(!L)throw new U(2,9,9014);za(S,5);break;case 4:K=Aa(S);if(K instanceof U)throw K;throw new U(2,9,9015);case 5:J=new Set;M=new Set;O=new Set;
|
|
N=t(A);for(P=N.next();!P.done;P=N.next())R=P.value,"variant"==R.type&&J.add(R.id),"text"==R.type&&M.add(R.id),"image"==R.type&&O.add(R.id);a.variants=a.variants.filter(function(aa){return J.has(aa.id)});a.textStreams=a.textStreams.filter(function(aa){return M.has(aa.id)});a.imageStreams=a.imageStreams.filter(function(aa){return O.has(aa.id)});yB(a);G(S)}})}
|
|
function rB(a,b,c,d,e,f,g){var h=aB(c,b,d),k=e.offline.progressCallback;dA(f,function(u,w){h.size=w;k(h,u)},function(u,w){l&&g&&m==w&&Hh(a,"cenc",u)});var l=vB(b)&&!wB(b),m=null;l&&(m=zB.get(a.h.keySystem));for(var n=new dB,q=t(b.textStreams),r=q.next();!r.done;r=q.next())n.g.set(r.value.id,52);q=t(b.imageStreams);for(r=q.next();!r.done;r=q.next())fB(n,r.value);q=t(b.variants);for(r=q.next();!r.done;r=q.next())eB(n,r.value);f=AB(f,n,b,e);e=f.streams;f=f.sh;(n=a.h)&&g&&(n.initData=[]);return{ik:{creationTime:Date.now(),
|
|
originalManifestUri:c,duration:b.presentationTimeline.getDuration(),size:0,expiration:a.Md(),streams:e,sessionIds:g?Qh(a):[],drmInfo:n,appMetadata:d,isIncomplete:!0,sequenceMode:b.sequenceMode,type:b.type},sh:f}}function vB(a){return a.variants.some(function(b){var c=b.audio&&b.audio.encrypted;return b.video&&b.video.encrypted||c})}
|
|
function wB(a){return a.variants.some(function(b){return(b.video?b.video.drmInfos:[]).concat(b.audio?b.audio.drmInfos:[]).some(function(c){return c.initData&&c.initData.length})})}function tB(a,b,c,d){b.expiration=c.Md();c=Qh(c);b.sessionIds=d?c:[];if(vB(a)&&d&&!c.length)throw new U(2,9,9007);}p.remove=function(a){return BB(this,CB(this,a))};
|
|
function CB(a,b){var c,d,e,f,g,h;return Q(function(k){switch(k.g){case 1:lB();c=NA(b);if(null==c||"manifest"!=c.g)throw new U(2,9,9004,b);d=c;e=new sA;ya(k,2);return F(k,e.init(),4);case 4:return F(k,wA(e,d.Pb(),d.bb()),5);case 5:return f=k.h,F(k,f.getManifests([d.key()]),6);case 6:return g=k.h,h=g[0],F(k,Promise.all([DB(a,h,e),EB(f,d,h)]),2);case 2:return Ba(k),F(k,e.destroy(),8);case 8:Ca(k,0)}})}
|
|
function FB(a,b){for(var c=[],d=t(a.streams),e=d.next();!e.done;e=d.next())e=e.value,b&&"video"==e.type?c.push({contentType:De(e.mimeType,e.codecs),robustness:a.drmInfo.videoRobustness}):b||"audio"!=e.type||c.push({contentType:De(e.mimeType,e.codecs),robustness:a.drmInfo.audioRobustness});return c}function DB(a,b,c){return Q(function(d){return F(d,GB(a.g,a.h.drm,c,b),0)})}
|
|
function EB(a,b,c){function d(){}var e=HB(c);cB(b,c);return Promise.all([a.removeSegments(e,d),a.removeManifests([b.key()],d)])}p.Fk=function(){return BB(this,IB(this))};
|
|
function IB(a){var b,c,d,e,f,g,h,k,l,m;return Q(function(n){switch(n.g){case 1:return lB(),b=a.g,c=a.h.drm,d=new sA,e=!1,ya(n,2),F(n,d.init(),4);case 4:f=[],xA(d,function(q){return f.push(q)}),g=t(f),h=g.next();case 5:if(h.done){n.u(2);break}k=h.value;return F(n,k.getAll(),8);case 8:return l=n.h,F(n,YA(c,b,l),9);case 9:return m=n.h,F(n,k.remove(m),10);case 10:m.length!=l.length&&(e=!0);h=g.next();n.u(5);break;case 2:return Ba(n),F(n,d.destroy(),11);case 11:Ca(n,3);break;case 3:return n.return(!e)}})}
|
|
p.list=function(){return BB(this,JB())};function JB(){var a,b,c;return Q(function(d){switch(d.g){case 1:return lB(),a=[],b=new sA,ya(d,2),F(d,b.init(),4);case 4:return c=Promise.resolve(),vA(b,function(e,f){c=c.then(function(){var g;return Q(function(h){if(1==h.g)return F(h,f.getAllManifests(),2);g=h.h;g.forEach(function(k,l){k=cB(new MA("manifest",e.Pb,e.bb,l),k);a.push(k)});G(h)})})}),F(d,c,2);case 2:return Ba(d),F(d,b.destroy(),6);case 6:Ca(d,3);break;case 3:return d.return(a)}})}
|
|
function mB(a,b,c,d){var e,f,g,h,k;return Q(function(l){if(1==l.g)return e=null,f=a.g,g={networkingEngine:f,filter:function(){return Promise.resolve()},makeTextStreamsForClosedCaptions:function(){},onTimelineRegionAdded:function(){},onEvent:function(){},onError:function(m){e=m},isLowLatencyMode:function(){return!1},updateDuration:function(){},newDrmInfo:function(){},onManifestUpdated:function(){},getBandwidthEstimate:function(){return d.abr.defaultBandwidthEstimate},onMetadata:function(){},disableStream:function(){},
|
|
addFont:function(){}},c.configure(d.manifest),nB(a),F(l,c.start(b,g),2);if(3!=l.g)return h=l.h,nB(a),k=KB(h),F(l,Promise.all(Vg(k,function(m){return m.createSegmentIndex()})),3);nB(a);if(e)throw e;return l.return(h)})}
|
|
function oB(a,b,c){var d,e,f,g,h,k,l,m,n,q,r,u,w,v,y;return Q(function(z){switch(z.g){case 1:return F(z,LB(a,b),2);case 2:d=z.h;if("text/vtt"!=d)throw new U(1,2,2017,b);return F(z,MB(b,a.g,a.h.streaming.retryParameters),3);case 3:e=z.h;f=Se(d);if(!f)throw new U(2,2,2014,d);g=f();h={periodStart:0,segmentStart:0,segmentEnd:c.presentationTimeline.getDuration(),vttOffset:0};k=Tb(e);l=g.parseMedia(k,h,b,[]);m=[];n=t(l);q=n.next();for(r={};!q.done;r={Jf:void 0,fd:void 0},q=n.next())r.fd=q.value,r.Jf=null,
|
|
u=function(A){return function(){null==A.Jf&&(A.Jf=qc([b],[A.fd.payload]));return A.Jf||[]}}(r),w=new qj(r.fd.startTime,r.fd.endTime,u,0,null,null,0,0,Infinity),r.fd.payload.includes("#xywh")&&(v=r.fd.payload.split("#xywh=")[1].split(","),4===v.length&&w.Cf({height:parseInt(v[3],10),positionX:parseInt(v[0],10),positionY:parseInt(v[1],10),width:parseInt(v[2],10)})),m.push(w);y=d;if(!m.length){z.u(4);break}return F(z,vo(m[0].O()[0],a.g,a.h.manifest.retryParameters),5);case 5:y=z.h;case 4:return z.return({id:a.m++,
|
|
originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new Cl(m),mimeType:y||"",codecs:"",kind:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"und",originalLanguage:null,label:null,type:"image",primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,tilesLayout:"1x1",accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([De(y||
|
|
"","")]),isAudioMuxedInVideo:!1,baseOriginalId:null})}})}
|
|
function pB(a,b,c,d,e,f,g){var h,k,l;return Q(function(m){if(1==m.g)return f?m.u(2):F(m,LB(a,c),3);2!=m.g&&(f=m.h);h={id:a.m++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:El(0,b.presentationTimeline.getDuration(),[c]),mimeType:f||"",codecs:g||"",kind:e,encrypted:!1,drmInfos:[],keyIds:new Set,language:d,originalLanguage:d,label:null,type:wc,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,
|
|
audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([De(f||"",g||"")]),isAudioMuxedInVideo:!1,baseOriginalId:null};k=De(h.mimeType,h.codecs);l=Te(k);if(!l)throw new U(2,2,2014,f);return m.return(h)})}
|
|
function LB(a,b){var c;return Q(function(d){switch(d.g){case 1:return wa(d,2),F(d,vo(b,a.g,a.h.streaming.retryParameters),4);case 4:c=d.h;za(d,3);break;case 2:Aa(d);case 3:if(c)return d.return(c);throw new U(1,2,2011,b);}})}function MB(a,b,c){var d,e,f;return Q(function(g){if(1==g.g)return d=Rg,e=Lg([a],c),e.method="GET",F(g,b.request(d,e).promise,2);f=g.h;return g.return(f.data)})}
|
|
p.dd=function(a,b,c,d){var e=this,f;return Q(function(g){return 1==g.g?(f=new oh({lc:e.g,onError:b,nf:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),f.configure(c.drm),F(g,wh(f,a.variants,d),2)):3!=g.g?F(g,Jh(f),3):g.return(f)})};
|
|
function AB(a,b,c,d){var e=new Map,f=KB(c),g=new Map;f=t(f);for(var h=f.next();!h.done;h=f.next()){h=h.value;var k=NB(a,b,c,h,d,e);g.set(h.id,k)}a=t(c.variants);for(b=a.next();!b.done;b=a.next())b=b.value,b.audio&&g.get(b.audio.id).variantIds.push(b.id),b.video&&g.get(b.video.id).variantIds.push(b.id);return{streams:Array.from(g.values()),sh:Array.from(e.values())}}
|
|
function NB(a,b,c,d,e,f){var g={id:d.id,originalId:d.originalId,groupId:d.groupId,primary:d.primary,type:d.type,mimeType:d.mimeType,codecs:d.codecs,frameRate:d.frameRate,pixelAspectRatio:d.pixelAspectRatio,hdr:d.hdr,colorGamut:d.colorGamut,videoLayout:d.videoLayout,kind:d.kind,language:d.language,originalLanguage:d.originalLanguage,label:d.label,width:d.width||null,height:d.height||null,encrypted:d.encrypted,keyIds:d.keyIds,segments:[],variantIds:[],roles:d.roles,forced:d.forced,channelsCount:d.channelsCount,
|
|
audioSamplingRate:d.audioSamplingRate,spatialAudio:d.spatialAudio,closedCaptions:d.closedCaptions,tilesLayout:d.tilesLayout,mssPrivateData:d.mssPrivateData,external:d.external,fastSwitching:d.fastSwitching,isAudioMuxedInVideo:d.isAudioMuxedInVideo},h=e.offline.numberOfParallelDownloads,k=0===h?d.id:0;OB(d,c.presentationTimeline.Eb(),function(l,m){var n=Xz(l),q=void 0;if(!f.has(n)){var r=l.endTime-l.startTime;r=gB(b,d.id)*r;r=$z(a.g,r);f.set(n,new Wz(l,r,k,!1,m))}l.Z&&(q=Xz(l.Z),f.has(q)||(r=.5*gB(b,
|
|
d.id),r=$z(a.g,r),f.set(q,new Wz(l.Z,r,k,!0,m))));g.segments.push({pendingInitSegmentRefId:q,initSegmentKey:q?0:null,startTime:l.startTime,endTime:l.endTime,appendWindowStart:l.appendWindowStart,appendWindowEnd:l.appendWindowEnd,timestampOffset:l.timestampOffset,tilesLayout:l.tilesLayout,pendingSegmentRefId:n,dataKey:0,mimeType:l.mimeType,codecs:l.codecs,thumbnailSprite:l.thumbnailSprite});0!==h&&(k=(k+1)%h)});return g}
|
|
function OB(a,b,c){b=a.segmentIndex.find(b);if(null!=b)for(var d=a.segmentIndex.get(b);d;)c(d,b),d=a.segmentIndex.get(++b)}function nB(a){if(a.j.g)throw new U(2,9,7001);}function lB(){if(!iB())throw new U(2,9,9E3);}function BB(a,b){return Q(function(c){if(1==c.g)return a.i.push(b),ya(c,2),F(c,b,4);if(2!=c.g)return c.return(c.h);Ba(c);Uc(a.i,b);return Ca(c,0)})}function kB(a,b){var c=b.promise;a.i.push(c);return b.finally(function(){Uc(a.i,c)})}
|
|
function HB(a){var b=new Set;a=t(a.streams);for(var c=a.next();!c.done;c=a.next()){c=t(c.value.segments);for(var d=c.next();!d.done;d=c.next())d=d.value,null!=d.initSegmentKey&&b.add(d.initSegmentKey),b.add(d.dataKey)}return Array.from(b)}
|
|
function GB(a,b,c,d){var e,f,g;return Q(function(h){if(1==h.g){if(!d.drmInfo)return h.return();e=yA(c);f=d.sessionIds.map(function(k){return{sessionId:k,keySystem:d.drmInfo.keySystem,licenseUri:d.drmInfo.licenseServerUri,serverCertificate:d.drmInfo.serverCertificate,audioCapabilities:FB(d,!1),videoCapabilities:FB(d,!0)}});return F(h,YA(b,a,f),2)}return 3!=h.g?(g=h.h,F(h,e.remove(g),3)):F(h,e.add(f.filter(function(k){return!g.includes(k.sessionId)})),0)})}
|
|
function KB(a){for(var b=new Set,c=t(a.variants),d=c.next();!d.done;d=c.next())d=d.value,d.audio&&b.add(d.audio),d.video&&b.add(d.video);c=t(a.textStreams);for(d=c.next();!d.done;d=c.next())b.add(d.value);a=t(a.imageStreams);for(c=a.next();!c.done;c=a.next())b.add(c.value);return b}
|
|
function yB(a){a.variants.map(function(f){return f.video});var b=new Set(a.variants.map(function(f){return f.audio}));a=a.textStreams;for(var c=t(b),d=c.next();!d.done;d=c.next()){d=t(b);for(var e=d.next();!e.done;e=d.next());}b=t(a);for(c=b.next();!c.done;c=b.next())for(c=t(a),d=c.next();!d.done;d=c.next());}T("shaka.offline.Storage",hB);hB.deleteAll=function(){var a;return Q(function(b){return 1==b.g?(a=new sA,ya(b,2),F(b,zA(a),2)):5!=b.g?(Ba(b),F(b,a.destroy(),5)):Ca(b,0)})};
|
|
hB.prototype.list=hB.prototype.list;hB.prototype.removeEmeSessions=hB.prototype.Fk;hB.prototype.remove=hB.prototype.remove;hB.prototype.store=hB.prototype.store;hB.prototype.getNetworkingEngine=hB.prototype.Nb;hB.prototype.getConfiguration=hB.prototype.getConfiguration;hB.prototype.configure=hB.prototype.configure;hB.prototype.destroy=hB.prototype.destroy;hB.support=iB;
|
|
var zB=(new Map).set("org.w3.clearkey","1077efecc0b24d02ace33c1e52e2fb4b").set("com.widevine.alpha","edef8ba979d64acea3c827dcd51d21ed").set("com.microsoft.playready","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.recommendation","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.software","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.hardware","9a04f07998404286ab92e65be0885f95").set("com.huawei.wiseplay","3d5e6d359b9a41e8b843dd3c6e72c42c");
|
|
Up("offline",iB);function PB(){}function QB(a,b){a={priority:b||0,callback:a};for(b=0;b<RB.length;b++)if(RB[b].priority<a.priority){RB.splice(b,0,a);return}RB.push(a)}T("shaka.polyfill",PB);PB.register=QB;PB.installAll=function(){for(var a=t(RB),b=a.next();!b.done;b=a.next()){b=b.value;try{b.callback()}catch(c){bb("Error installing polyfill!",c)}}};var RB=[];function SB(){}function TB(){if(!Object.getOwnPropertyDescriptor(Element.prototype,"ariaHidden"))for(var a=t(["ariaHidden","ariaLabel","ariaPressed","ariaSelected"]),b=a.next();!b.done;b=a.next())UB(b.value)}function UB(a){var b="aria-"+a.toLowerCase().replace(/^aria/,"");Object.defineProperty(Element.prototype,a,{get:function(){return this.getAttribute(b)},set:function(c){null==c||void 0==c?this.removeAttribute(b):this.setAttribute(b,c)}})}PB.Aria=SB;SB.install=TB;QB(TB);function VB(){}function WB(){qb().nh()&&XB()}PB.EncryptionScheme=VB;VB.install=WB;QB(WB,-2);function YB(){}
|
|
function ZB(){if(window.Document){var a=Element.prototype;a.requestFullscreen=a.requestFullscreen||a.mozRequestFullScreen||a.msRequestFullscreen||a.webkitRequestFullscreen;a=Document.prototype;a.exitFullscreen=a.exitFullscreen||a.mozCancelFullScreen||a.msExitFullscreen||a.webkitCancelFullScreen;"fullscreenElement"in document||(Object.defineProperty(document,"fullscreenElement",{get:function(){return document.mozFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement||document.webkitFullscreenElement}}),
|
|
Object.defineProperty(document,"fullscreenEnabled",{get:function(){return document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitFullscreenEnabled}}));document.addEventListener("webkitfullscreenchange",$B);document.addEventListener("webkitfullscreenerror",$B);document.addEventListener("mozfullscreenchange",$B);document.addEventListener("mozfullscreenerror",$B);document.addEventListener("MSFullscreenChange",$B);document.addEventListener("MSFullscreenError",$B)}}
|
|
function $B(a){var b=a.type.replace(/^(webkit|moz|MS)/,"").toLowerCase(),c=document.createEvent("Event");c.initEvent(b,a.bubbles,a.cancelable);a.target.dispatchEvent(c)}PB.Fullscreen=YB;YB.install=ZB;QB(ZB);function aC(){}function bC(){qb().bc()||(navigator.mediaCapabilities||(navigator.mediaCapabilities={}),aC.originalMcap=navigator.mediaCapabilities,navigator.mediaCapabilities.decodingInfo=cC)}
|
|
function cC(a){var b,c,d,e,f,g,h,k,l,m,n;return Q(function(q){switch(q.g){case 1:b={supported:!1,powerEfficient:!0,smooth:!0,keySystemAccess:null,configuration:a};qb();c=a.video;d=a.audio;if("media-source"!=a.type){if("file"==a.type){if(c&&(e=c.contentType,f=""!=wi().canPlayType(e),!f)||d&&(g=d.contentType,h=""!=wi().canPlayType(g),!h))return q.return(b)}else return q.return(b);q.u(2);break}if(!vi())return q.return(b);if(!c){q.u(3);break}return F(q,dC(c),4);case 4:if(k=q.h,!k)return q.return(b);case 3:if(d){var r=
|
|
qb().La(),u=d.contentType;"CAST"===r&&d.spatialRendering&&(u+="; spatialRendering=true");l=Ec(u);if(!l)return q.return(b)}case 2:if(!a.keySystemConfiguration)return b.supported=!0,q.return(b);m=a.keySystemConfiguration;return F(q,eC(c,d,m),6);case 6:if(n=q.h)b.supported=!0,b.keySystemAccess=n;case 5:return q.return(b)}})}function dC(a){var b,c,d;return Q(function(e){return 1==e.g?(b=qb(),c=b.La(),"CAST"!==c?e.u(2):F(e,fC(a),3)):2!=e.g?(d=e.h,e.return(d)):e.return(Ec(a.contentType))})}
|
|
function eC(a,b,c){var d,e,f,g,h,k,l,m,n,q,r;return Q(function(u){switch(u.g){case 1:d=[];e=[];c.audio&&(f={robustness:c.audio.robustness||"",contentType:b.contentType},qb().ii()&&b.contentType.includes('codecs="ac-3"')&&(f.contentType='audio/mp4; codecs="ec-3"'),c.audio.encryptionScheme&&(f.encryptionScheme=c.audio.encryptionScheme),d.push(f));c.video&&(g={robustness:c.video.robustness||"",contentType:a.contentType},c.video.encryptionScheme&&(g.encryptionScheme=c.video.encryptionScheme),e.push(g));
|
|
h={initDataTypes:[c.initDataType],distinctiveIdentifier:c.distinctiveIdentifier,persistentState:c.persistentState,sessionTypes:c.sessionTypes};d.length&&(h.audioCapabilities=d);e.length&&(h.videoCapabilities=e);k=a?a.contentType:"";l=b?b.contentType:"";m=Le(k)+";"+Ke(k);n=Le(l)+";"+Ke(l);q=c.keySystem;r=null;wa(u,2);if(pg.has(m+"#"+n+"#"+q)){r=pg.get(m+"#"+n+"#"+q)||null;u.u(4);break}return F(u,navigator.requestMediaKeySystemAccess(c.keySystem,[h]),5);case 5:r=u.h,pg.set(m+"#"+n+"#"+q,r);case 4:za(u,
|
|
3);break;case 2:Aa(u);case 3:return u.return(r)}})}
|
|
function fC(a){var b,c,d,e,f;return Q(function(g){if(1==g.g){if(!(window.cast&&cast.__platform__&&cast.__platform__.canDisplayType))return g.return(Ec(a.contentType));b=a.contentType;a.width&&a.height&&1280<a.width&&720<a.height&&(b+="; width="+a.width+"; height="+a.height);a.framerate&&(c=Math.round(a.framerate),24>c||30<c)&&(b+="; framerate="+a.framerate);d=a.transferFunction||"";switch(d){case "":case "srgb":break;case "pq":b+="; eotf=smpte2084";break;case "hlg":b+="; eotf=arib-std-b67";break;
|
|
default:return g.return(!1)}e=!1;f=gC;return f.has(b)?(e=f.get(b),g.u(2)):F(g,cast.__platform__.canDisplayType(b),3)}2!=g.g&&(e=g.h,f.set(b,e));return g.return(e)})}PB.MediaCapabilities=aC;aC.install=bC;aC.originalMcap=null;var gC=new Map;QB(bC,-1);function hC(){}function iC(){var a=qb(),b="WEBKIT"===a.Ea()?a.Ca():null;(window.MediaSource||window.ManagedMediaSource)&&b&&window.MediaSource&&(12>=b?(jC(),kC()):15>=b&&jC());a=t(a.ti());for(b=a.next();!b.done;b=a.next())lC(b.value);(window.MediaSource||window.ManagedMediaSource)&&mC();window.MediaSource&&MediaSource.isTypeSupported('video/webm; codecs="vp9"')&&!MediaSource.isTypeSupported('video/webm; codecs="vp09.00.10.08"')&&nC()}
|
|
function jC(){var a=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var b=a.apply(this,Oa.apply(0,arguments));b.abort=function(){};return b}}function kC(){var a=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(b,c){return a.call(this,b,c-.001)}}
|
|
function mC(){if(window.MediaSource){var a=MediaSource.isTypeSupported.bind(MediaSource);MediaSource.isTypeSupported=function(c){return"mp2t"!=He(c)&&a(c)}}if(window.ManagedMediaSource){var b=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);window.ManagedMediaSource.isTypeSupported=function(c){return"mp2t"!=He(c)&&b(c)}}}
|
|
function lC(a){var b=MediaSource.isTypeSupported.bind(MediaSource);MediaSource.isTypeSupported=function(d){return Ke(d)!=a&&b(d)};if(window.ManagedMediaSource){var c=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);window.ManagedMediaSource.isTypeSupported=function(d){return Ke(d)!=a&&c(d)}}}
|
|
function nC(){var a=MediaSource.isTypeSupported;qb().Si()&&(MediaSource.isTypeSupported=function(b){var c=b.split(/ *; */),d=c.findIndex(function(g){return g.startsWith("codecs=")});if(0>d)return a(b);var e=c[d].replace("codecs=","").replace(/"/g,"").split(/\s*,\s*/),f=e.findIndex(function(g){return g.startsWith("vp09")});0<=f&&(e[f]="vp9",c[d]='codecs="'+e.join(",")+'"',b=c.join("; "));return a(b)})}PB.MediaSource=hC;hC.install=iC;QB(iC);function oC(){}function pC(){screen.orientation&&screen.orientation.unlock||(void 0!=screen.orientation?qC():void 0!=window.orientation&&rC())}function qC(){void 0===screen.orientation.lock&&(screen.orientation.lock=function(){return Promise.resolve()});void 0===screen.orientation.unlock&&(screen.orientation.unlock=function(){})}
|
|
function rC(){function a(){switch(window.orientation){case -90:b.type="landscape-secondary";b.angle=270;break;case 0:b.type="portrait-primary";b.angle=0;break;case 90:b.type="landscape-primary";b.angle=90;break;case 180:b.type="portrait-secondary",b.angle=180}}var b=new sC;screen.orientation=b;a();window.addEventListener("orientationchange",function(){a();var c=new V("change");b.dispatchEvent(c)})}PB.Orientation=oC;oC.install=pC;function sC(){Dg.call(this);this.type="";this.angle=0}pa(sC,Dg);
|
|
sC.prototype.lock=function(a){function b(d){return screen.lockOrientation?screen.lockOrientation(d):screen.mozLockOrientation?screen.mozLockOrientation(d):screen.msLockOrientation?screen.msLockOrientation(d):!1}var c=!1;switch(a){case "natural":c=b("default");break;case "any":c=!0;this.unlock();break;default:c=b(a)}if(c)return Promise.resolve();a=Error("screen.orientation.lock() is not available on this device");a.name="NotSupportedError";a.code=DOMException.NOT_SUPPORTED_ERR;return Promise.reject(a)};
|
|
sC.prototype.unlock=function(){screen.unlockOrientation?screen.unlockOrientation():screen.mozUnlockOrientation?screen.mozUnlockOrientation():screen.msUnlockOrientation&&screen.msUnlockOrientation()};QB(pC);function tC(){}var uC,vC,wC,xC,yC,zC;
|
|
function AC(a){if(window.HTMLVideoElement&&window.WebKitMediaKeys&&window.shakaMediaKeysPolyfill!=BC){if(void 0===a?0:a)uC=!0,vC=Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype,"mediaKeys"),wC=HTMLMediaElement.prototype.setMediaKeys,xC=window.MediaKeys,yC=window.MediaKeySystemAccess,zC=navigator.requestMediaKeySystemAccess;delete HTMLMediaElement.prototype.mediaKeys;HTMLMediaElement.prototype.mediaKeys=null;HTMLMediaElement.prototype.setMediaKeys=CC;window.MediaKeys=DC;window.MediaKeySystemAccess=
|
|
EC;navigator.requestMediaKeySystemAccess=FC;window.shakaMediaKeysPolyfill=BC;Df.clear();pg.clear()}}function FC(a,b){try{var c=new EC(a,b);return Promise.resolve(c)}catch(d){return Promise.reject(d)}}function CC(a){var b=this.mediaKeys;b&&b!=a&&GC(b,null);delete this.mediaKeys;return(this.mediaKeys=a)?GC(a,this):Promise.resolve()}
|
|
function HC(a){a=Tb(a.initData);if(Yb(a).getUint32(0,!0)+4!=a.byteLength)throw new RangeError("Malformed FairPlay init data");a=bc(a.subarray(4),!0);a=ec(a);var b=new Event("encrypted");b.initDataType="skd";b.initData=Ub(a);this.dispatchEvent(b)}PB.PatchedMediaKeysApple=tC;
|
|
tC.uninstall=function(){window.shakaMediaKeysPolyfill==BC&&uC&&(uC=!1,Object.defineProperty(HTMLMediaElement.prototype,"mediaKeys",vC),HTMLMediaElement.prototype.setMediaKeys=wC,window.MediaKeys=xC,window.MediaKeySystemAccess=yC,navigator.requestMediaKeySystemAccess=zC,vC=zC=wC=yC=xC=null,window.shakaMediaKeysPolyfill="",Df.clear(),pg.clear())};tC.install=AC;
|
|
function EC(a,b){this.keySystem=a;if(a.startsWith("com.apple.fps"))for(a=t(b),b=a.next();!b.done;b=a.next()){var c=b.value;if("required"==c.persistentState)b=null;else{b={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:c.initDataTypes,sessionTypes:["temporary"],label:c.label};var d=!1,e=!1;if(c.audioCapabilities)for(var f=t(c.audioCapabilities),g=f.next();!g.done;g=f.next())g=g.value,g.contentType&&(d=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,
|
|
g.contentType.split(";")[0])&&(b.audioCapabilities.push(g),e=!0));if(c.videoCapabilities)for(c=t(c.videoCapabilities),f=c.next();!f.done;f=c.next())f=f.value,f.contentType&&(d=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,f.contentType.split(";")[0])&&(b.videoCapabilities.push(f),e=!0));d||(e=WebKitMediaKeys.isTypeSupported(this.keySystem,"video/mp4"));b=e?b:null}if(b){this.g=b;return}}a=Error("Unsupported keySystem");a.name="NotSupportedError";a.code=DOMException.NOT_SUPPORTED_ERR;throw a;}
|
|
EC.prototype.createMediaKeys=function(){var a=new DC(this.keySystem);return Promise.resolve(a)};EC.prototype.getConfiguration=function(){return this.g};function DC(a){this.h=new WebKitMediaKeys(a);this.g=new jb}DC.prototype.createSession=function(a){a=a||"temporary";if("temporary"!=a)throw new TypeError("Session type "+a+" is unsupported on this platform.");return new IC(this.h,a)};DC.prototype.setServerCertificate=function(){return Promise.resolve(!1)};
|
|
function GC(a,b){a.g.Ra();if(!b)return Promise.resolve();a.g.D(b,"webkitneedkey",HC);try{return ll(b,HTMLMediaElement.HAVE_METADATA,a.g,function(){b.webkitSetMediaKeys(a.h)}),Promise.resolve()}catch(c){return Promise.reject(c)}}DC.prototype.getStatusForPolicy=function(){return Promise.resolve("usable")};function IC(a){Dg.call(this);this.i=null;this.l=a;this.g=this.h=null;this.j=new jb;this.sessionId="";this.expiration=NaN;this.closed=new tg;this.keyStatuses=new JC}pa(IC,Dg);p=IC.prototype;
|
|
p.generateRequest=function(a,b){var c=this;this.h=new tg;try{var d=this.l.createSession("video/mp4",Tb(b));this.i=d;this.sessionId=d.sessionId||"";this.j.D(this.i,"webkitkeymessage",function(e){c.h&&(c.h.resolve(),c.h=null);e=(new Map).set("messageType",void 0==c.keyStatuses.xc()?"license-request":"license-renewal").set("message",Ub(e.message));e=new V("message",e);c.dispatchEvent(e)});this.j.D(d,"webkitkeyadded",function(){c.g&&(KC(c,"usable"),c.g.resolve(),c.g=null)});this.j.D(d,"webkitkeyerror",
|
|
function(){var e=Error("EME PatchedMediaKeysApple key error");e.errorCode=c.i.error;if(null!=c.h)c.h.reject(e),c.h=null;else if(null!=c.g)c.g.reject(e),c.g=null;else switch(c.i.error.code){case WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT:case WebKitMediaKeyError.MEDIA_KEYERR_HARDWARECHANGE:KC(c,"output-not-allowed");break;default:KC(c,"internal-error")}});KC(this,"status-pending")}catch(e){this.h.reject(e)}return this.h};p.load=function(){return Promise.reject(Error("MediaKeySession.load not yet supported"))};
|
|
p.update=function(a){this.g=new tg;try{this.i.update(Tb(a))}catch(b){this.g.reject(b)}return this.g};p.close=function(){try{this.i.close(),this.closed.resolve(),this.j.Ra()}catch(a){this.closed.reject(a)}return this.closed};p.remove=function(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))};function KC(a,b){var c=a.keyStatuses;c.size=void 0==b?0:1;c.g=b;b=new V("keystatuseschange");a.dispatchEvent(b)}
|
|
function JC(){this.size=0;this.g=void 0}p=JC.prototype;p.xc=function(){return this.g};p.forEach=function(a){this.g&&a(this.g,og.value())};p.get=function(a){if(this.has(a))return this.g};p.has=function(a){var b=og.value();return this.g&&Sb(a,b)?!0:!1};p.entries=function(){};p.keys=function(){};p.values=function(){};var BC="apple";QB(function(){window.HTMLVideoElement&&window.WebKitMediaKeys&&(navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||AC())});function LC(){}function MC(){if(window.MediaKeys){var a=qb();MediaKeys.prototype.setServerCertificate&&a.ge()||(MediaKeys.prototype.setServerCertificate=NC)}}function NC(){return Promise.resolve(!1)}PB.PatchedMediaKeysCert=LC;LC.install=MC;QB(MC);function OC(){}
|
|
function PC(){if(!(!window.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)){if(HTMLMediaElement.prototype.webkitGenerateKeyRequest)QC="webkit";else if(!HTMLMediaElement.prototype.generateKeyRequest)return;navigator.requestMediaKeySystemAccess=RC;delete HTMLMediaElement.prototype.mediaKeys;HTMLMediaElement.prototype.mediaKeys=null;HTMLMediaElement.prototype.setMediaKeys=SC;window.MediaKeys=TC;window.MediaKeySystemAccess=UC;window.shakaMediaKeysPolyfill=VC}}
|
|
function WC(a){var b=QC;return b?b+a.charAt(0).toUpperCase()+a.slice(1):a}function RC(a,b){try{var c=new UC(a,b);return Promise.resolve(c)}catch(d){return Promise.reject(d)}}function SC(a){var b=this.mediaKeys;b&&b!=a&&XC(b,null);delete this.mediaKeys;(this.mediaKeys=a)&&XC(a,this);return Promise.resolve()}PB.PatchedMediaKeysWebkit=OC;OC.install=PC;
|
|
function UC(a,b){this.g=this.keySystem=a;var c=!1;"org.w3.clearkey"==a&&(this.g="webkit-org.w3.clearkey",c=!1);var d=!1;var e=document.getElementsByTagName("video");e=e.length?e[0]:document.createElement("video");b=t(b);for(var f=b.next();!f.done;f=b.next()){f=f.value;var g={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:f.initDataTypes,sessionTypes:["temporary"],label:f.label},h=!1;if(f.audioCapabilities)for(var k=t(f.audioCapabilities),
|
|
l=k.next();!l.done;l=k.next())l=l.value,l.contentType&&(h=!0,e.canPlayType(l.contentType.split(";")[0],this.g)&&(g.audioCapabilities.push(l),d=!0));if(f.videoCapabilities)for(k=t(f.videoCapabilities),l=k.next();!l.done;l=k.next())l=l.value,l.contentType&&(h=!0,e.canPlayType(l.contentType,this.g)&&(g.videoCapabilities.push(l),d=!0));h||(d=e.canPlayType("video/mp4",this.g)||e.canPlayType("video/webm",this.g));"required"==f.persistentState&&(c?(g.persistentState="required",g.sessionTypes=["persistent-license"]):
|
|
d=!1);if(d){this.h=g;return}}c="Unsupported keySystem";if("org.w3.clearkey"==a||"com.widevine.alpha"==a)c="None of the requested configurations were supported.";a=Error(c);a.name="NotSupportedError";a.code=DOMException.NOT_SUPPORTED_ERR;throw a;}UC.prototype.createMediaKeys=function(){var a=new TC(this.g);return Promise.resolve(a)};UC.prototype.getConfiguration=function(){return this.h};function TC(a){this.l=a;this.h=null;this.g=new jb;this.i=[];this.j=new Map}
|
|
function XC(a,b){a.h=b;a.g.Ra();var c=QC;b&&(a.g.D(b,c+"needkey",function(d){var e=new CustomEvent("encrypted");e.initDataType="cenc";e.initData=Ub(d.initData);a.h.dispatchEvent(e)}),a.g.D(b,c+"keymessage",function(d){var e=YC(a,d.sessionId);e&&(d=(new Map).set("messageType",void 0==e.keyStatuses.xc()?"licenserequest":"licenserenewal").set("message",d.message),d=new V("message",d),e.h&&(e.h.resolve(),e.h=null),e.dispatchEvent(d))}),a.g.D(b,c+"keyadded",function(d){(d=YC(a,d.sessionId))&&d.ready()}),
|
|
a.g.D(b,c+"keyerror",function(d){var e=YC(a,d.sessionId);if(e){var f=Error("EME v0.1b key error"),g=d.errorCode;g.systemCode=d.systemCode;f.errorCode=g;!d.sessionId&&e.h?(45==d.systemCode&&(f.message="Unsupported session type."),e.h.reject(f),e.h=null):d.sessionId&&e.g?(e.g.reject(f),e.g=null):(f=d.systemCode,d.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?ZC(e,"output-restricted"):1==f?ZC(e,"expired"):ZC(e,"internal-error"))}}))}
|
|
TC.prototype.createSession=function(a){a=a||"temporary";if("temporary"!=a&&"persistent-license"!=a)throw new TypeError("Session type "+a+" is unsupported on this platform.");var b=this.h||document.createElement("video");b.src||(b.src="about:blank");a=new $C(b,this.l,a);this.i.push(a);return a};TC.prototype.setServerCertificate=function(){return Promise.resolve(!1)};TC.prototype.getStatusForPolicy=function(){return Promise.resolve("usable")};
|
|
function YC(a,b){var c=a.j.get(b);return c?c:(c=a.i.shift())?(c.sessionId=b,a.j.set(b,c),c):null}function $C(a,b,c){Dg.call(this);this.j=a;this.m=!1;this.g=this.h=null;this.i=b;this.l=c;this.sessionId="";this.expiration=NaN;this.closed=new tg;this.keyStatuses=new aD}pa($C,Dg);p=$C.prototype;p.ready=function(){ZC(this,"usable");this.g&&this.g.resolve();this.g=null};
|
|
function bD(a,b,c){if(a.m)return Promise.reject(Error("The session is already initialized."));a.m=!0;try{if("persistent-license"==a.l)if(c)var d=Tb(ec("LOAD_SESSION|"+c));else{var e=ec("PERSISTENT|");d=pc(e,b)}else d=Tb(b)}catch(g){return Promise.reject(g)}a.h=new tg;var f=WC("generateKeyRequest");try{a.j[f](a.i,d)}catch(g){if("InvalidStateError"!=g.name)return a.h=null,Promise.reject(g);(new $e(function(){try{a.j[f](a.i,d)}catch(h){a.h.reject(h),a.h=null}})).ha(.01)}return a.h}
|
|
function cD(a,b,c){if(a.g)a.g.then(function(){return cD(a,b,c)}).catch(function(){return cD(a,b,c)});else{a.g=b;if("webkit-org.w3.clearkey"==a.i){var d=ac(c);var e=JSON.parse(d);"oct"!=e.keys[0].kty&&(a.g.reject(Error("Response is not a valid JSON Web Key Set.")),a.g=null);d=mc(e.keys[0].k);e=mc(e.keys[0].kid)}else d=Tb(c),e=null;var f=WC("addKey");try{a.j[f](a.i,d,e,a.sessionId)}catch(g){a.g.reject(g),a.g=null}}}
|
|
function ZC(a,b){var c=a.keyStatuses;c.size=void 0==b?0:1;c.g=b;b=new V("keystatuseschange");a.dispatchEvent(b)}p.generateRequest=function(a,b){return bD(this,b,null)};p.load=function(a){return"persistent-license"==this.l?bD(this,null,a):Promise.reject(Error("Not a persistent session."))};p.update=function(a){var b=new tg;cD(this,b,a);return b};
|
|
p.close=function(){if("persistent-license"!=this.l){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;var a=WC("cancelKeyRequest");try{this.j[a](this.i,this.sessionId)}catch(b){}}this.closed.resolve();return this.closed};p.remove=function(){return"persistent-license"!=this.l?Promise.reject(Error("Not a persistent session.")):this.close()};function aD(){this.size=0;this.g=void 0}p=aD.prototype;p.xc=function(){return this.g};
|
|
p.forEach=function(a){this.g&&a(this.g,og.value())};p.get=function(a){if(this.has(a))return this.g};p.has=function(a){var b=og.value();return this.g&&Sb(a,b)?!0:!1};p.entries=function(){};p.keys=function(){};p.values=function(){};var QC="",VC="webkit";QB(PC);function dD(){}function eD(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;a.requestPictureInPicture&&document.exitPictureInPicture||!a.webkitSupportsPresentationMode||(document.pictureInPictureEnabled=!0,document.pictureInPictureElement=null,a.requestPictureInPicture=fD,Object.defineProperty(a,"disablePictureInPicture",{get:gD,set:hD,enumerable:!0,configurable:!0}),document.exitPictureInPicture=iD,document.addEventListener("webkitpresentationmodechanged",jD,!0))}}
|
|
function jD(a){a=a.target;if("picture-in-picture"==a.webkitPresentationMode){document.pictureInPictureElement=a;var b=new Event("enterpictureinpicture");a.dispatchEvent(b)}else document.pictureInPictureElement==a&&(document.pictureInPictureElement=null),b=new Event("leavepictureinpicture"),a.dispatchEvent(b)}
|
|
function fD(){return this.webkitSupportsPresentationMode("picture-in-picture")?(this.webkitSetPresentationMode("picture-in-picture"),document.pictureInPictureElement=this,Promise.resolve()):Promise.reject(Error("PiP not allowed by video element"))}function iD(){var a=document.pictureInPictureElement;return a?(a.webkitSetPresentationMode("inline"),document.pictureInPictureElement=null,Promise.resolve()):Promise.reject(Error("No picture in picture element found"))}
|
|
function gD(){return this.hasAttribute("disablePictureInPicture")?!0:!this.webkitSupportsPresentationMode("picture-in-picture")}function hD(a){a?this.setAttribute("disablePictureInPicture",""):this.removeAttribute("disablePictureInPicture")}PB.PiPWebkit=dD;dD.install=eD;QB(eD);function kD(){}function lD(){window.crypto&&("randomUUID"in window.crypto||(window.crypto.randomUUID=mD))}function mD(){var a=URL.createObjectURL(new Blob),b=a.toString();URL.revokeObjectURL(a);return b.substr(b.lastIndexOf("/")+1)}PB.RandomUUID=kD;kD.install=lD;QB(lD);function nD(){}function oD(){var a=Symbol.prototype;"description"in a||Object.defineProperty(a,"description",{get:pD})}function pD(){var a=/\((.*)\)/.exec(this.toString());return a?a[1]:void 0}PB.Symbol=nD;nD.install=oD;QB(oD);function qD(){}function rD(){for(var a=t([Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,Int8Array,Int16Array,Int32Array,Float32Array,Float64Array]),b=a.next();!b.done;b=a.next())b=b.value,b.prototype.indexOf||(b.prototype.indexOf=sD),b.prototype.lastIndexOf||(b.prototype.lastIndexOf=tD),b.prototype.includes||(b.prototype.includes=uD)}function sD(a,b){return Array.prototype.indexOf.call(this,a,b)}function tD(a,b){return Array.prototype.lastIndexOf.call(this,a,b)}
|
|
function uD(a,b){return-1!==this.indexOf(a,b)}PB.TypedArray=qD;qD.install=rD;QB(rD);function vD(){}function wD(){if(window.HTMLMediaElement){var a=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){var b=a.apply(this);b&&b.catch(function(){});return b}}}PB.VideoPlayPromise=vD;vD.install=wD;QB(wD);function xD(){}function yD(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;!a.getVideoPlaybackQuality&&("webkitDroppedFrameCount"in a||"number"===typeof wi().webkitDroppedFrameCount)&&(a.getVideoPlaybackQuality=zD)}}function zD(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}PB.VideoPlaybackQuality=xD;xD.install=yD;QB(yD);function AD(){}function BD(){if(!window.VTTCue&&window.TextTrackCue){var a=null,b=TextTrackCue.length;if(3==b)a=CD;else if(6==b)a=DD;else{try{var c=!!CD(1,2,"")}catch(d){c=!1}c&&(a=CD)}a&&(window.VTTCue=function(d,e,f){return a(d,e,f)})}}function CD(a,b,c){return new window.TextTrackCue(a,b,c)}function DD(a,b,c){return new window.TextTrackCue(a+"-"+b+"-"+c,a,b,c)}PB.VTTCue=AD;AD.install=BD;QB(BD);function ED(a){Dg.call(this);this.h=a;this.l=null;this.g=[];this.i=-1;this.j=null;this.m=new jb}pa(ED,Dg);p=ED.prototype;p.destroy=function(){var a=this;return Q(function(b){if(1==b.g)return F(b,a.removeAllItems(),2);a.h=null;a.m&&(a.m.release(),a.m=null);Dg.prototype.release.call(a);G(b)})};p.configure=function(a){this.l=a};p.getConfiguration=function(){return this.l};p.getCurrentItem=function(){return this.g.length&&0<=this.i&&this.i<this.g.length?this.g[this.i]:null};p.getCurrentItemIndex=function(){return this.i};
|
|
p.getItems=function(){return this.g.slice()};p.insertItems=function(a){this.g.push.apply(this.g,x(a));this.dispatchEvent(new V("itemsinserted"))};p.removeAllItems=function(){var a=this;return Q(function(b){switch(b.g){case 1:a.m.Ra();if(!(a.g.length&&0<=a.i)){b.u(2);break}return F(b,a.h.rc(),2);case 2:if(!a.j){b.u(4);break}if(a.j.uf.o){b.u(5);break}return F(b,a.j.uf.destroy(),5);case 5:a.j=null;case 4:a.g=[],a.i=-1,a.dispatchEvent(new V("itemsremoved")),G(b)}})};
|
|
p.playItem=function(a){var b=this,c,d,e,f,g,h,k,l,m,n,q,r,u,w;return Q(function(v){if(1==v.g){b.m.Ra();if(!b.g.length||a>=b.g.length)throw new U(2,7,7007);c=b.g[a];b.i!=a&&(b.i=a,b.dispatchEvent(new V("currentitemchanged")));d=b.h.h;e=b.l?b.l.preloadNextUrlWindow:0;0<e&&(f=!1,b.m.D(d,"timeupdate",function(){var y,z,A,B;return Q(function(E){switch(E.g){case 1:if(b.j||1>=b.g.length||f||b.h.V()||!d.duration)return E.return();y=b.h.Sa().end-d.currentTime;if(isNaN(y)){E.u(0);break}if(!(y<=e)){E.u(0);break}z=
|
|
b.l&&b.l.repeatMode;A=null;b.i+1<b.g.length?A=b.g[b.i+1]:1==z&&(A=b.g[0]);if(!A){E.u(0);break}f=!0;B=null;wa(E,5);return F(E,b.h.preload(A.manifestUri,A.startTime,A.mimeType,A.config),7);case 7:B=E.h;za(E,6);break;case 5:Aa(E),B=null;case 6:b.j={item:A,uf:B},f=!1,G(E)}})}));b.m.D(b.h,"complete",function(){var y=b.l&&b.l.repeatMode,z=!1;if(2==y)z=!0;else{var A=b.i+1;A<b.g.length?b.playItem(A):1==y&&(1==b.g.length?z=!0:b.playItem(0))}z&&(d.paused?(d.currentTime=b.h.Sa().start,d.play()):b.m.D(d,"paused",
|
|
function(){d.currentTime=b.h.Sa().start;d.play()}))});c.config&&(b.h.zi(),b.h.configure(c.config));g=c.manifestUri;b.j&&b.j.item==c&&b.j.uf&&(g=b.j.uf);return F(v,b.h.load(g,c.startTime,c.mimeType),2)}b.j=null;if(c.extraText)for(h=t(c.extraText),k=h.next();!k.done;k=h.next())l=k.value,l.mime?b.h.Dd(l.uri,l.language,l.kind,l.mime,l.codecs):b.h.Dd(l.uri,l.language,l.kind);if(c.extraThumbnail)for(m=t(c.extraThumbnail),n=m.next();!n.done;n=m.next())q=n.value,b.h.Ge(q);if(c.extraChapter)for(r=t(c.extraChapter),
|
|
u=r.next();!u.done;u=r.next())w=u.value,b.h.Fe(w.uri,w.language,w.mime);G(v)})};T("shaka.queue.QueueManager",ED);ED.prototype.playItem=ED.prototype.playItem;ED.prototype.removeAllItems=ED.prototype.removeAllItems;ED.prototype.insertItems=ED.prototype.insertItems;ED.prototype.getItems=ED.prototype.getItems;ED.prototype.getCurrentItemIndex=ED.prototype.getCurrentItemIndex;ED.prototype.getCurrentItem=ED.prototype.getCurrentItem;ED.prototype.getConfiguration=ED.prototype.getConfiguration;
|
|
ED.prototype.configure=ED.prototype.configure;ED.prototype.destroy=ED.prototype.destroy;Np=function(a){return new ED(a)};function FD(){}FD.prototype.parseInit=function(){};FD.prototype.setSequenceMode=function(){};FD.prototype.setManifestType=function(){};FD.prototype.parseMedia=function(a,b){var c=null,d=[];a=ac(a).split(/\r?\n/);a=t(a);for(var e=a.next();!e.done;e=a.next())if((e=e.value)&&!/^\s+$/.test(e)&&(e=GD.exec(e))){var f=HD.exec(e[1]);f=60*parseInt(f[1],10)+parseFloat(f[2].replace(",","."));e=new Qd(f,b.segmentEnd?b.segmentEnd:f+2,e[2]);c&&(c.endTime=f,d.push(c));c=e}c&&d.push(c);return d};
|
|
T("shaka.text.LrcTextParser",FD);FD.prototype.parseMedia=FD.prototype.parseMedia;FD.prototype.setManifestType=FD.prototype.setManifestType;FD.prototype.setSequenceMode=FD.prototype.setSequenceMode;FD.prototype.parseInit=FD.prototype.parseInit;var GD=/^\[(\d{1,2}:\d{1,2}(?:[.,]\d{1,3})?)\](.*)/,HD=/^(\d+):(\d{1,2}(?:[.,]\d{1,3})?)$/;Qe("application/x-subtitle-lrc",function(){return new FD});function ID(){}ID.prototype.parseInit=function(){};ID.prototype.setSequenceMode=function(){};ID.prototype.setManifestType=function(){};
|
|
ID.prototype.parseMedia=function(a,b,c,d){var e=ac(a);a=[];if(""==e)return a;var f=jd(e,"tt",!0);if(!f)throw new U(2,2,2005,"Failed to parse TTML.");e=td(f,"body")[0];if(!e)return[];var g=zd(f,JD,"frameRate"),h=zd(f,JD,"subFrameRate"),k=zd(f,JD,"frameRateMultiplier"),l=zd(f,JD,"tickRate"),m=zd(f,JD,"cellResolution"),n=f.attributes["xml:space"]||"default",q=zd(f,KD,"extent");if("default"!=n&&"preserve"!=n)throw new U(2,2,2005,"Invalid xml:space value: "+n);n="default"==n;g=new LD(g,h,k,l);m=MD(m);
|
|
h=td(f,"metadata")[0];h=(h?h.children:[]).filter(function(w){return"\n"!=w});k=td(f,"style");f=td(f,"region");l=[];for(var r=t(f),u=r.next();!u.done;u=r.next())(u=ND(u.value,k,q))&&l.push(u);if(qd(e,"p").length)throw new U(2,2,2001,"<p> can only be inside <div> in TTML");q=t(qd(e,"div"));for(r=q.next();!r.done;r=q.next())if(qd(r.value,"span").length)throw new U(2,2,2001,"<span> can only be inside <p> in TTML");if(b=OD(e,b,g,h,k,f,l,n,m,null,!1,c,d))b.backgroundColor||(b.backgroundColor="transparent"),
|
|
a.push(b);return a};
|
|
function OD(a,b,c,d,e,f,g,h,k,l,m,n,q){var r=l;if(od(a)){if(!m)return null;var u={tagName:"span",children:[rd(a)],attributes:{},parent:null}}else u=a;for(var w=null,v=t(PD),y=v.next();!y.done&&!(w=QD(u,"backgroundImage",d,"#",y.value)[0]);y=v.next());v=null;y=zd(u,PD,"backgroundImage");var z=/^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/;if(y&&z.test(y)){v=parseInt(y.split(":").pop(),10)-1;if(v>=q.length)return null;v=q[v]}else n&&y&&!y.startsWith("#")&&(z=new Bb(n),y=new Bb(y),(y=z.resolve(y).toString())&&
|
|
(v=y));if("p"==a.tagName||w||v)m=!0;a=m;y="default"==(u.attributes["xml:space"]||(h?"default":"preserve"));z=u.children.every(od);h=[];if(!z)for(var A=t(u.children),B=A.next();!B.done;B=A.next())(B=OD(B.value,b,c,d,e,f,g,y,k,u,m,n,q))&&h.push(B);d=null!=l;n=rd(u);n=u.children.length&&n&&/\S/.test(n);A=u.attributes.begin||u.attributes.end||u.attributes.dur;if(!(A||n||"br"==u.tagName||0!=h.length||d&&!y))return null;q=RD(u,c);n=q.start;for(q=q.end;r&&r.tagName&&"tt"!=r.tagName;)q=SD(r,c,n,q),n=q.start,
|
|
q=q.end,r=r.parent;null==n&&(n=0);n+=b.periodStart;q=null==q?Infinity:q+b.periodStart;n=Math.max(n,b.segmentStart);q=Math.min(q,b.segmentEnd);if(!A&&0<h.length)for(n=Infinity,q=0,b=t(h),c=b.next();!c.done;c=b.next())c=c.value,n=Math.min(n,c.startTime),q=Math.max(q,c.endTime);if("br"==u.tagName)return e=new Qd(n,q,""),e.lineBreak=!0,e;b="";z&&(b=hc(rd(u)||""),y&&(b=b.replace(/\s+/g," ")));b=new Qd(n,q,b);b.nestedCues=h;m||(b.isContainer=!0);k&&(b.cellResolution=k);k=QD(u,"region",f,"")[0];if(u.attributes.region&&
|
|
k&&k.attributes["xml:id"]){var E=k.attributes["xml:id"];b.region=g.filter(function(H){return H.id==E})[0]}g=k;l&&d&&!u.attributes.region&&!u.attributes.style&&(g=QD(l,"region",f,"")[0]);TD(b,u,g,w,v,e,a,0==h.length);return b}
|
|
function ND(a,b,c){var d=new Qc,e=a.attributes["xml:id"];if(!e)return null;d.id=e;e=null;c&&(e=UD.exec(c)||VD.exec(c));c=e?Number(e[1]):null;e=e?Number(e[2]):null;var f,g=WD(a,b,"extent");if(g){var h=(f=UD.exec(g))||VD.exec(g);null!=h&&(d.width=Number(h[1]),d.height=Number(h[2]),f||(null!=c&&(d.width=100*d.width/c),null!=e&&(d.height=100*d.height/e)),d.widthUnits=f||null!=c?Rc:0,d.heightUnits=f||null!=e?Rc:0)}if(a=WD(a,b,"origin"))if(h=(f=UD.exec(a))||VD.exec(a),null!=h)d.viewportAnchorX=Number(h[1]),
|
|
d.viewportAnchorY=Number(h[2]),f?g||(d.width=100-d.viewportAnchorX,d.widthUnits=Rc,d.height=100-d.viewportAnchorY,d.heightUnits=Rc):(null!=e&&(d.viewportAnchorY=100*d.viewportAnchorY/e),null!=c&&(d.viewportAnchorX=100*d.viewportAnchorX/c)),d.viewportAnchorUnits=f||null!=c?Rc:0;return d}function XD(a){var b=a.match(/rgba\(([^)]+)\)/);return b&&(b=b[1].split(","),4==b.length)?(b[3]=String(Number(b[3])/255),"rgba("+b.join(",")+")"):a}
|
|
function TD(a,b,c,d,e,f,g,h){g=g||h;"rtl"==YD(b,c,f,"direction",g)&&(a.direction="rtl");h=YD(b,c,f,"writingMode",g);"tb"==h||"tblr"==h?a.writingMode="vertical-lr":"tbrl"==h?a.writingMode="vertical-rl":"rltb"==h||"rl"==h?a.direction="rtl":h&&(a.direction=Ud);(h=YD(b,c,f,"textAlign",!0))?(a.positionAlign=ZD.get(h),a.lineAlign=$D.get(h),a.textAlign=qe[h.toUpperCase()]):a.textAlign=Sd;if(h=YD(b,c,f,"displayAlign",!0))a.displayAlign=re[h.toUpperCase()];if(h=YD(b,c,f,"color",g))a.color=XD(h);if(h=YD(b,
|
|
c,f,"backgroundColor",g))a.backgroundColor=XD(h);if(h=YD(b,c,f,"border",g))a.border=h;if(h=YD(b,c,f,"fontFamily",g))switch(h){case "monospaceSerif":a.fontFamily="Courier New,Liberation Mono,Courier,monospace";break;case "proportionalSansSerif":a.fontFamily="Arial,Helvetica,Liberation Sans,sans-serif";break;case "sansSerif":a.fontFamily="sans-serif";break;case "monospaceSansSerif":a.fontFamily="Consolas,monospace";break;case "proportionalSerif":a.fontFamily="serif";break;default:a.fontFamily=h.split(",").filter(function(k){return"default"!=
|
|
k}).join(",")}(h=YD(b,c,f,"fontWeight",g))&&"bold"==h&&(a.fontWeight=ne);h=YD(b,c,f,"wrapOption",g);a.wrapLine=h&&"noWrap"==h?!1:!0;(h=YD(b,c,f,"lineHeight",g))&&h.match(aE)&&(a.lineHeight=h);(h=YD(b,c,f,"fontSize",g))&&(h.match(aE)||h.match(bE))&&(a.fontSize=h);if(h=YD(b,c,f,"fontStyle",g))a.fontStyle=te[h.toUpperCase()];d?(e=d.attributes.imageType||d.attributes.imagetype,h=d.attributes.encoding,d=rd(d).trim(),"PNG"==e&&"Base64"==h&&d&&(a.backgroundImage="data:image/png;base64,"+d)):e&&(a.backgroundImage=
|
|
e);if(d=YD(b,c,f,"textOutline",g))d=d.split(" "),d[0].match(aE)?a.textStrokeColor=a.color:(a.textStrokeColor=XD(d[0]),d.shift()),d[0]&&d[0].match(aE)?a.textStrokeWidth=d[0]:a.textStrokeColor="";(d=YD(b,c,f,"letterSpacing",g))&&d.match(aE)&&(a.letterSpacing=d);(d=YD(b,c,f,"linePadding",g))&&d.match(aE)&&(a.linePadding=d);if(d=YD(b,c,f,"opacity",g))a.opacity=parseFloat(d);(d=WD(c,f,"textDecoration"))&&cE(a,d);(d=dE(b,f,"textDecoration"))&&cE(a,d);if(d=YD(b,c,f,"textCombine",g))a.textCombineUpright=
|
|
d;switch(YD(b,c,f,"ruby",g)){case "container":a.rubyTag="ruby";break;case "text":a.rubyTag="rt"}}
|
|
function cE(a,b){b=t(b.split(" "));for(var c=b.next();!c.done;c=b.next())switch(c.value){case "underline":a.textDecoration.includes(pe)||a.textDecoration.push(pe);break;case "noUnderline":a.textDecoration.includes(pe)&&Uc(a.textDecoration,pe);break;case "lineThrough":a.textDecoration.includes("lineThrough")||a.textDecoration.push("lineThrough");break;case "noLineThrough":a.textDecoration.includes("lineThrough")&&Uc(a.textDecoration,"lineThrough");break;case "overline":a.textDecoration.includes("overline")||
|
|
a.textDecoration.push("overline");break;case "noOverline":a.textDecoration.includes("overline")&&Uc(a.textDecoration,"overline")}}function YD(a,b,c,d,e){e=void 0===e?!0:e;return(a=dE(a,c,d))?a:e?WD(b,c,d):null}function WD(a,b,c){if(!a)return null;var d=zd(a,KD,c);return d?d:eE(a,b,c)}function dE(a,b,c){var d=zd(a,KD,c);return d?d:eE(a,b,c)}
|
|
function eE(a,b,c){a=QD(a,"style",b,"");for(var d=null,e=0;e<a.length;e++){var f=yd(a[e],"urn:ebu:tt:style",c);f||(f=zd(a[e],KD,c));f||(f=dE(a[e],b,c));f&&(d=f)}return d}function QD(a,b,c,d,e){var f=[];if(!a||1>c.length)return f;var g=a;for(a=null;!a&&!(a=e?yd(g,e,b):g.attributes[b])&&(g=g.parent,g););if(b=a)for(b=t(b.split(" ")),e=b.next();!e.done;e=b.next())for(e=e.value,a=t(c),g=a.next();!g.done;g=a.next())if(g=g.value,d+g.attributes["xml:id"]==e){f.push(g);break}return f}
|
|
function SD(a,b,c,d){a=RD(a,b);null==c?c=a.start:null!=a.start&&(c+=a.start);null==d?d=a.end:null!=a.start&&(d+=a.start);return{start:c,end:d}}function RD(a,b){var c=fE(a.attributes.begin,b),d=fE(a.attributes.end,b);a=fE(a.attributes.dur,b);null==d&&null!=a&&(d=c+a);return{start:c,end:d}}
|
|
function fE(a,b){var c=null;if(gE.test(a)){a=gE.exec(a);c=Number(a[1]);var d=Number(a[2]),e=Number(a[3]),f=Number(a[4]);f+=(Number(a[5])||0)/b.h;e+=f/b.frameRate;c=e+60*d+3600*c}else if(hE.test(a))c=iE(hE,a);else if(jE.test(a))c=iE(jE,a);else if(kE.test(a))a=kE.exec(a),c=Number(a[1])/b.frameRate;else if(lE.test(a))a=lE.exec(a),c=Number(a[1])/b.g;else if(mE.test(a))c=iE(mE,a);else if(a)throw new U(2,2,2001,"Could not parse cue time range in TTML");return c}
|
|
function iE(a,b){a=a.exec(b);return null==a||""==a[0]?null:(Number(a[4])||0)/1E3+(Number(a[3])||0)+60*(Number(a[2])||0)+3600*(Number(a[1])||0)}function MD(a){return a?(a=/^(\d+) (\d+)$/.exec(a))?{Gc:parseInt(a[1],10),rows:parseInt(a[2],10)}:null:null}T("shaka.text.TtmlTextParser",ID);ID.prototype.parseMedia=ID.prototype.parseMedia;ID.prototype.setManifestType=ID.prototype.setManifestType;ID.prototype.setSequenceMode=ID.prototype.setSequenceMode;ID.prototype.parseInit=ID.prototype.parseInit;
|
|
function LD(a,b,c,d){this.frameRate=Number(a)||30;this.h=Number(b)||1;this.g=Number(d);0==this.g&&(this.g=a?this.frameRate*this.h:1);c&&(a=/^(\d+) (\d+)$/g.exec(c))&&(this.frameRate*=Number(a[1])/Number(a[2]))}
|
|
var UD=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,bE=/^(\d{1,4}(?:\.\d+)?|100)%$/,aE=/^(\d+px|\d+em|\d*\.?\d+c)$/,VD=/^(\d+)px (\d+)px$/,gE=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,hE=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,jE=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/,kE=/^(\d*(?:\.\d*)?)f$/,lE=/^(\d*(?:\.\d*)?)t$/,mE=RegExp("^(?:(\\d*(?:\\.\\d*)?)h)?(?:(\\d*(?:\\.\\d*)?)m)?(?:(\\d*(?:\\.\\d*)?)s)?(?:(\\d*(?:\\.\\d*)?)ms)?$"),$D=(new Map).set("left",Xd).set("center","center").set("right",
|
|
"end").set("start",Xd).set("end","end"),ZD=(new Map).set("left","line-left").set("center","center").set("right","line-right"),JD=["http://www.w3.org/ns/ttml#parameter","http://www.w3.org/2006/10/ttaf1#parameter"],KD=["http://www.w3.org/ns/ttml#styling","http://www.w3.org/2006/10/ttaf1#styling"],PD=["http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt","http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"];Qe("application/ttml+xml",function(){return new ID});function nE(){this.g=new ID}nE.prototype.parseInit=function(a){var b=!1;(new bh).box("moov",gh).box("trak",gh).box("mdia",gh).box("minf",gh).box("stbl",gh).R("stsd",ih).box("stpp",function(c){b=!0;c.parser.stop()}).parse(a);if(!b)throw new U(2,2,2007);};nE.prototype.setSequenceMode=function(){};nE.prototype.setManifestType=function(){};
|
|
nE.prototype.parseMedia=function(a,b,c){var d=[],e=null,f=[],g=new Map,h=[];(new bh).box("moof",gh).box("traf",gh).R("tfhd",function(y){e=yi(y.reader,y.flags).Jd}).R("trun",function(y){y=Bi(y.reader,y.version,y.flags);y=t(y.$g);for(var z=y.next();!z.done;z=y.next())h.push(z.value.sampleSize||e||0)}).R("subs",function(y){for(var z=y.reader,A=z.T(),B=-1,E=0;E<A;E++){var H=z.T();B+=H;H=z.Aa();for(var C=[],D=0;D<H;D++)1==y.version?C.push(z.T()):C.push(z.Aa()),z.X(),z.X(),z.T();g.set(B,C)}}).box("mdat",
|
|
lh(function(y){f.push(y)})).parse(a,!1);if(0==f.length)throw new U(2,2,2007);for(var k=pc.apply(jc,x(f)),l=0,m=0;m<h.length;m++){var n=Tb(k,l,h[m]);l+=h[m];var q=g.get(m);if(q&&q.length){n=Tb(n,0,q[0]);for(var r=[],u=q[0],w=1;w<q.length;w++){var v=Tb(a,u,q[w]);v=kc(v);r.push("data:image/png;base64,"+v);u+=q[w]}d=d.concat(this.g.parseMedia(n,b,c,r))}else d=d.concat(this.g.parseMedia(n,b,c,[]))}return d};T("shaka.text.Mp4TtmlParser",nE);nE.prototype.parseMedia=nE.prototype.parseMedia;
|
|
nE.prototype.setManifestType=nE.prototype.setManifestType;nE.prototype.setSequenceMode=nE.prototype.setSequenceMode;nE.prototype.parseInit=nE.prototype.parseInit;Qe('application/mp4; codecs="stpp"',function(){return new nE});Qe('application/mp4; codecs="stpp.ttml"',function(){return new nE});Qe('application/mp4; codecs="stpp.ttml.im1i"',function(){return new nE});Qe('application/mp4; codecs="stpp.ttml.im1t"',function(){return new nE});Qe('application/mp4; codecs="stpp.ttml.im2i"',function(){return new nE});
|
|
Qe('application/mp4; codecs="stpp.ttml.im2t"',function(){return new nE});Qe('application/mp4; codecs="stpp.ttml.etd1"',function(){return new nE});Qe('application/mp4; codecs="stpp.ttml.etd1|im1t"',function(){return new nE});Qe('application/mp4; codecs="stpp.ttml.im1t|etd1"',function(){return new nE});Qe('application/mp4; codecs="stpp.TTML.im1t"',function(){return new nE});function oE(){this.g="UNKNOWN"}oE.prototype.parseInit=function(){};oE.prototype.setSequenceMode=function(){};oE.prototype.setManifestType=function(a){this.g=a};
|
|
oE.prototype.parseMedia=function(a,b){a=ac(a);a=a.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");var c=a.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(c[0]))throw new U(2,2,2E3);a=b.vttOffset;if("HLS"==this.g)if(c[0].includes("X-TIMESTAMP-MAP")){var d=c[0];a=d.match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m);d=d.match(/MPEGTS:(\d+)/m);if(!a||!d)throw new U(2,2,2E3);a=dd(a[1]);if(null==a)throw new U(2,2,2E3);d=Number(d[1]);for(var e=b.segmentStart-b.periodStart;95443.7176888889<=e;)e-=95443.7176888889,
|
|
d+=8589934592;a=b.periodStart+d/9E4-a}else b.periodStart&&b.vttOffset==b.periodStart&&(a=0);b=[];d=t(c[0].split("\n"));for(e=d.next();!e.done;e=d.next())if(e=e.value,/^Region:/.test(e)){e=new Xc(e);var f=new Qc;ad(e);Yc(e);for(var g=ad(e);g;){var h=f,k=g;(g=/^id=(.*)$/.exec(k))?h.id=g[1]:(g=/^width=(\d{1,2}|100)%$/.exec(k))?h.width=Number(g[1]):(g=/^lines=(\d+)$/.exec(k))?(h.height=Number(g[1]),h.heightUnits=2):(g=/^regionanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(k))?(h.regionAnchorX=Number(g[1]),
|
|
h.regionAnchorY=Number(g[2])):(g=/^viewportanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(k))?(h.viewportAnchorX=Number(g[1]),h.viewportAnchorY=Number(g[2])):/^scroll=up$/.exec(k)&&(h.scroll="up");Yc(e);g=ad(e)}b.push(f)}d=new Map;ge(d);e=[];c=t(c.slice(1));for(f=c.next();!f.done;f=c.next()){f=f.value.split("\n");if((1!=f.length||f[0])&&!/^NOTE($|[ \t])/.test(f[0])&&"STYLE"==f[0]){h=[];g=-1;for(k=1;k<f.length;k++)f[k].includes("::cue")&&(h.push([]),g=h.length-1),-1!=g&&(h[g].push(f[k]),f[k].includes("}")&&
|
|
(g=-1));h=t(h);for(g=h.next();!g.done;g=h.next()){var l=g.value;g="global";(k=l[0].match(/\((.*)\)/))&&(g=k.pop());k=l.slice(1,-1);l[0].includes("}")&&(l=/\{(.*?)\}/.exec(l[0]))&&(k=l[1].split(";"));(l=d.get(g))||(l=new Qd(0,0,""));for(var m=!1,n=0;n<k.length;n++){var q=/^\s*([^:]+):\s*(.*)/.exec(k[n]);if(q){var r=q[2].trim().replace(";","");switch(q[1].trim()){case "background-color":case "background":m=!0;l.backgroundColor=r;break;case "color":m=!0;l.color=r;break;case "font-family":m=!0;l.fontFamily=
|
|
r;break;case "font-size":m=!0;l.fontSize=r;break;case "font-weight":if(700<=parseInt(r,10)||"bold"==r)m=!0,l.fontWeight=ne;break;case "font-style":switch(r){case "normal":m=!0;l.fontStyle=$d;break;case "italic":m=!0;l.fontStyle=oe;break;case "oblique":m=!0,l.fontStyle="oblique"}break;case "opacity":m=!0;l.opacity=parseFloat(r);break;case "text-combine-upright":m=!0;l.textCombineUpright=r;break;case "text-shadow":m=!0;l.textShadow=r;break;case "white-space":m=!0,l.wrapLine="noWrap"!=r}}}m&&d.set(g,
|
|
l)}}l=f;m=a;if(1==l.length&&!l[0]||/^NOTE($|[ \t])/.test(l[0])||"STYLE"==l[0]||"REGION"==l[0])f=null;else if(f=null,l[0].includes("--\x3e")||(f=l[0],l.splice(0,1)),h=new Xc(l[0]),g=bd(h),n=Zc(h,/[ \t]+--\x3e[ \t]+/g),k=bd(h),null==g||null==n||null==k)bb("Failed to parse VTT time code. Cue skipped:",f,l),f=null;else{g+=m;k+=m;m=l.slice(1).join("\n").trim();d.has("global")?(l=d.get("global").clone(),l.startTime=g,l.endTime=k,l.payload=m):l=new Qd(g,k,m);Yc(h);for(g=ad(h);g;)pE(l,g,b),Yc(h),g=ad(h);
|
|
fe(l,d);null!=f&&(l.id=f);f=l}f&&e.push(f)}return e};
|
|
function pE(a,b,c){var d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"==b?a.textAlign=Sd:a.textAlign=qe[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"==d[1]?"vertical-lr":"vertical-rl";else if(d=/^size:([\d.]+)%$/.exec(b))a.size=Number(d[1]);else if(d=/^position:([\d.]+)%(?:,(line-left|line-right|middle|center|start|end|auto))?$/.exec(b))a.position=Number(d[1]),d[2]&&(b=d[2],a.positionAlign="line-left"==b||"start"==b?"line-left":"line-right"==
|
|
b||"end"==b?"line-right":"center"==b||"middle"==b?"center":Rd);else if(d=/^region:(.*)$/.exec(b)){if(b=qE(c,d[1]))a.region=b}else if(c=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=1,a.line=Number(c[1]),c[2]&&(a.lineAlign=se[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=Wd,a.line=Number(c[1]),c[2]&&(a.lineAlign=se[c[2].toUpperCase()])}
|
|
function qE(a,b){a=a.filter(function(c){return c.id==b});return a.length?a[0]:null}T("shaka.text.VttTextParser",oE);oE.prototype.parseMedia=oE.prototype.parseMedia;oE.prototype.setManifestType=oE.prototype.setManifestType;oE.prototype.setSequenceMode=oE.prototype.setSequenceMode;oE.prototype.parseInit=oE.prototype.parseInit;Qe("text/vtt",function(){return new oE});Qe('text/vtt; codecs="vtt"',function(){return new oE});Qe('text/vtt; codecs="wvtt"',function(){return new oE});function rE(){this.g=null}rE.prototype.parseInit=function(a){var b=this,c=!1;(new bh).box("moov",gh).box("trak",gh).box("mdia",gh).R("mdhd",function(d){d=Ai(d.reader,d.version);b.g=d.timescale}).box("minf",gh).box("stbl",gh).R("stsd",ih).box("wvtt",function(){c=!0}).parse(a);if(!this.g)throw new U(2,2,2008);if(!c)throw new U(2,2,2008);};rE.prototype.setSequenceMode=function(){};rE.prototype.setManifestType=function(){};
|
|
rE.prototype.parseMedia=function(a,b){if(!a.length)return[];if(!this.g)throw new U(2,2,2008);var c=0,d=[],e,f=[],g=!1,h=!1,k=!1,l=null;(new bh).box("moof",gh).box("traf",gh).R("tfdt",function(A){g=!0;c=zi(A.reader,A.version).baseMediaDecodeTime}).R("tfhd",function(A){l=yi(A.reader,A.flags).Id}).R("trun",function(A){h=!0;d=Bi(A.reader,A.version,A.flags).$g}).box("mdat",lh(function(A){k=!0;e=A})).parse(a,!1);if(!k&&!g&&!h)throw new U(2,2,2008);a=c;for(var m=new Zg(e,0),n=t(d),q=n.next();!q.done;q=n.next()){q=
|
|
q.value;var r=q.ah||l,u=q.yf?c+q.yf:a;a=u+(r||0);var w=0;do{var v=m.T();w+=v;var y=m.T(),z=null;"vttc"==fh(y)?8<v&&(z=m.Sb(v-8)):m.skip(v-8);r&&z&&(v=sE(z,b.periodStart+u/this.g,b.periodStart+a/this.g),f.push(v))}while(q.sampleSize&&w<q.sampleSize)}return f.filter(cf)};function sE(a,b,c){var d,e,f;(new bh).box("payl",lh(function(g){d=ac(g)})).box("iden",lh(function(g){e=ac(g)})).box("sttg",lh(function(g){f=ac(g)})).parse(a);return d?tE(d,e,f,b,c):null}
|
|
function tE(a,b,c,d,e){a=new Qd(d,e,a);fe(a);b&&(a.id=b);if(c)for(b=new Xc(c),c=ad(b);c;)pE(a,c,[]),Yc(b),c=ad(b);return a}T("shaka.text.Mp4VttParser",rE);rE.prototype.parseMedia=rE.prototype.parseMedia;rE.prototype.setManifestType=rE.prototype.setManifestType;rE.prototype.setSequenceMode=rE.prototype.setSequenceMode;rE.prototype.parseInit=rE.prototype.parseInit;Qe('application/mp4; codecs="wvtt"',function(){return new rE});function uE(){}uE.prototype.parseInit=function(){};uE.prototype.setSequenceMode=function(){};uE.prototype.setManifestType=function(){};uE.prototype.parseMedia=function(a){var b=ac(a).replace(/\r+/g,"");b=b.trim();a=[];if(""==b)return a;b=t(b.split("\n\n"));for(var c=b.next();!c.done;c=b.next()){c=c.value.split("\n");var d=new Xc(c[0]),e=bd(d),f=Zc(d,/,/g);d=bd(d);if(null==e||null==f||null==d)throw new U(2,2,2001,"Could not parse cue time range in SubViewer");a.push(new Qd(e,d,c.slice(1).join("\n").trim()))}return a};
|
|
T("shaka.text.SbvTextParser",uE);uE.prototype.parseMedia=uE.prototype.parseMedia;uE.prototype.setManifestType=uE.prototype.setManifestType;uE.prototype.setSequenceMode=uE.prototype.setSequenceMode;uE.prototype.parseInit=uE.prototype.parseInit;Qe("text/x-subviewer",function(){return new uE});function vE(){this.g=new oE}vE.prototype.parseInit=function(){};vE.prototype.setSequenceMode=function(){};vE.prototype.setManifestType=function(){};vE.prototype.parseMedia=function(a,b,c){a=ac(a);a=wE(a);a=Tb(ec(a));return this.g.parseMedia(a,b,c,[])};
|
|
function wE(a){var b="WEBVTT\n\n";if(""==a)return b;a=a.replace(/\r+/g,"");a=a.trim();a=t(a.split("\n\n"));for(var c=a.next();!c.done;c=a.next())c=c.value.split(/\n/),c[0].match(/\d+/)&&c.shift(),c[0]=c[0].replace(/,/g,"."),b+=c.join("\n").replace(/{b}/g,"<b>").replace(/{\/b}/g,"</b>").replace(/{i}/g,"<i>").replace(/{\/i}/g,"</i>").replace(/{u}/g,"<u>").replace(/{\/u}/g,"</u>")+"\n\n";return b}T("shaka.text.SrtTextParser",vE);vE.srt2webvtt=wE;vE.prototype.parseMedia=vE.prototype.parseMedia;
|
|
vE.prototype.setManifestType=vE.prototype.setManifestType;vE.prototype.setSequenceMode=vE.prototype.setSequenceMode;vE.prototype.parseInit=vE.prototype.parseInit;Qe("text/srt",function(){return new vE});function xE(){}xE.prototype.parseInit=function(){};xE.prototype.setSequenceMode=function(){};xE.prototype.setManifestType=function(){};
|
|
xE.prototype.parseMedia=function(a){var b="",c="",d=null,e=null;e=ac(a).split(/\r?\n\s*\r?\n/);a=t(e);for(e=a.next();!e.done;e=a.next()){var f=e.value;e=f;if(f=yE.exec(f))d=f[1],e=f[2];"V4 Styles"==d||"V4+ Styles"==d?(b=e,b=c?b+("\n"+e):e):"Events"==d&&(c=c?c+("\n"+e):e)}d=[];e=null;b=t(b.split(/\r?\n/));for(a=b.next();!a.done;a=b.next())if(a=a.value,!/^\s*;/.test(a)&&(f=zE.exec(a)))if(a=f[1].trim(),f=f[2].trim(),"Format"==a)e=f.split(AE);else if("Style"==a){a=f.split(AE);f={};for(var g=0;g<e.length&&
|
|
g<a.length;g++)f[e[g]]=a[g];d.push(f)}e=[];b=null;c=t(c.split(/\r?\n/));f=c.next();for(a={};!f.done;a={Ni:void 0},f=c.next())if(f=f.value,!/^\s*;/.test(f)&&(g=zE.exec(f)))if(f=g[1].trim(),g=g[2].trim(),"Format"==f)b=g.split(AE);else if("Dialogue"==f){g=g.split(AE);f={};for(var h=0;h<b.length&&h<g.length;h++)f[b[h]]=g[h];h=BE(f.Start);var k=BE(f.End);g=new Qd(h,k,g.slice(b.length-1).join(",").replace(/\\N/g,"\n").replace(/\{[^}]+\}/g,""));a.Ni=f.Style;(a=d.find(function(l){return function(m){return m.Name==
|
|
l.Ni}}(a)))&&CE(g,a);e.push(g)}return e};
|
|
function CE(a,b){var c=b.Fontname;c&&(a.fontFamily=c);if(c=b.Fontsize)a.fontSize=c+"px";if(c=b.PrimaryColour)if(c=DE(c))a.color=c;if(c=b.BackColour)if(c=DE(c))a.backgroundColor=c;b.Bold&&(a.fontWeight=ne);b.Italic&&(a.fontStyle=oe);b.Underline&&a.textDecoration.push(pe);if(c=b.Spacing)a.letterSpacing=c+"px";if(c=b.Alignment)switch(parseInt(c,10)){case 1:a.displayAlign=Yd;a.textAlign="start";break;case 2:a.displayAlign=Yd;a.textAlign=Sd;break;case 3:a.displayAlign=Yd;a.textAlign="end";break;case 5:a.displayAlign=
|
|
"before";a.textAlign="start";break;case 6:a.displayAlign="before";a.textAlign=Sd;break;case 7:a.displayAlign="before";a.textAlign="end";break;case 9:a.displayAlign="center";a.textAlign="start";break;case 10:a.displayAlign="center";a.textAlign=Sd;break;case 11:a.displayAlign="center",a.textAlign="end"}if(b=b.AlphaLevel)a.opacity=parseFloat(b)}function DE(a){a=parseInt(a.replace("&H",""),16);return 0<=a?"rgba("+(a&255)+","+(a>>8&255)+","+(a>>16&255)+","+(a>>24&255^255)/255+")":null}
|
|
function BE(a){a=EE.exec(a);return 3600*(a[1]?parseInt(a[1].replace(":",""),10):0)+60*parseInt(a[2],10)+parseFloat(a[3])}T("shaka.text.SsaTextParser",xE);xE.prototype.parseMedia=xE.prototype.parseMedia;xE.prototype.setManifestType=xE.prototype.setManifestType;xE.prototype.setSequenceMode=xE.prototype.setSequenceMode;xE.prototype.parseInit=xE.prototype.parseInit;var yE=/^\s*\[([^\]]+)\]\r?\n([\s\S]*)/,zE=/^\s*([^:]+):\s*(.*)/,AE=/\s*,\s*/,EE=/^(\d+:)?(\d{1,2}):(\d{1,2}(?:[.]\d{1,3})?)?$/;
|
|
Qe("text/x-ssa",function(){return new xE});function FE(a,b){var c=a[b+1]&1?7:9;return b+c<=a.length&&(a=((a[b+3]&3)<<11|a[b+4]<<3|(a[b+5]&224)>>>5)-c,0<a)?{Rd:c,qa:a}:null}function GE(a,b){var c=[96E3,88200,64E3,48E3,44100,32E3,24E3,22050,16E3,12E3,11025,8E3,7350],d=(a[b+2]&60)>>>2;if(d>c.length-1)return null;var e=((a[b+2]&192)>>>6)+1,f=(a[b+2]&1)<<2;f|=(a[b+3]&192)>>>6;return{sampleRate:c[d],channelCount:f,codec:"mp4a.40."+e}}
|
|
function HE(a,b){if(b+1<a.length&&255===a[b]&&240===(a[b+1]&246)){var c=a[b+1]&1?7:9;if(b+c>=a.length)return!1;var d=(a[b+3]&3)<<11|a[b+4]<<3|(a[b+5]&224)>>>5;if(d<=c)return!1;b+=d;return b===a.length||b+1<a.length&&255===a[b]&&240===(a[b+1]&246)}return!1}
|
|
function IE(a,b){switch(a){case "mp4a.40.2":if(1===b)return new Uint8Array([0,200,0,128,35,128]);if(2===b)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===b)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===b)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===b)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===b)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,
|
|
2,0,178,0,32,8,224]);break;default:if(1===b)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===b||3===b)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null};function JE(a){this.j=a;this.h=0;this.g=new Map;this.i=null}p=JE.prototype;p.destroy=function(){this.g.clear()};p.isSupported=function(a){return"audio/aac"==a.toLowerCase().split(";")[0]?Ec(this.convertCodecs("audio",a)):!1};p.convertCodecs=function(a,b){return"audio/aac"==b.toLowerCase().split(";")[0]?'audio/mp4; codecs="'+(Me(b)||"mp4a.40.2")+'"':b};p.getOriginalMimeType=function(){return this.j};
|
|
p.transmux=function(a,b,c,d){for(var e=Tb(a),f=Nj(e),g=f.length;g<e.length&&!HE(e,g);g++);a=1E3*c.endTime;f=Mj(f);f.length&&c&&(f=f.find(function(m){return"com.apple.streaming.transportStreamTimestamp"===m.description}))&&(a=f.data);f=GE(e,g);if(!f)return Promise.reject(new U(2,3,3018,c?c.O()[0]:null));b.audioSamplingRate=f.sampleRate;b.channelsCount=f.channelCount;for(var h=[];g<e.length;){var k=FE(e,g);if(!k)return Promise.reject(new U(2,3,3018,c?c.O()[0]:null));var l=k.Rd+k.qa;g+l<=e.length&&h.push({data:e.subarray(g+
|
|
k.Rd,g+l),size:k.qa,duration:1024,qb:0,flags:{vb:0,kb:0,jb:0,hb:0,ib:2,wb:0}});g+=l}e=f.sampleRate;a=Math.floor(a*e/1E3);d={id:b.id,type:"audio",codecs:f.codec,encrypted:b.encrypted&&0<b.drmInfos.length,timescale:e,duration:d,zb:[],Da:new Uint8Array([]),Na:new Uint8Array([]),Wa:0,Xa:0,data:{Tb:this.h,baseMediaDecodeTime:a,xb:h},stream:b};d=new Hi([d]);c=b.id+"_"+c.i;this.g.has(c)?b=this.g.get(c):(b=Ni(d),this.g.set(c,b));c=this.i!==b;d=ej(d);this.i=b;this.h++;return c?(b=pc(b,d),Promise.resolve(b)):
|
|
Promise.resolve(d)};T("shaka.transmuxer.AacTransmuxer",JE);JE.prototype.transmux=JE.prototype.transmux;JE.prototype.getOriginalMimeType=JE.prototype.getOriginalMimeType;JE.prototype.convertCodecs=JE.prototype.convertCodecs;JE.prototype.isSupported=JE.prototype.isSupported;JE.prototype.destroy=JE.prototype.destroy;ve("audio/aac",function(){return new JE("audio/aac")},Be);function KE(a,b){if(b+8>a.length||11!==a[b]||119!==a[b+1])return null;var c=a[b+4]>>6;if(3<=c)return null;var d=a[b+4]&63,e=2*[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,
|
|
1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][3*d+c];if(b+e>a.length)return null;var f=a[b+6]>>5,g=0;2===f?g+=2:(f&1&&1!==f&&(g+=2),f&4&&(g+=2));g=(a[b+6]<<8|a[b+7])>>12-g&1;var h=a[b+5]&7;a=new Uint8Array([c<<6|a[b+5]>>3<<1|h>>2,(h&3)<<6|f<<3|g<<2|d>>4,d<<4&224]);return{sampleRate:[48E3,44100,32E3][c],channelCount:[2,1,2,3,3,4,4,5][f]+g,Da:a,qa:e}}
|
|
function LE(a,b){if(11===a[b]&&119===a[b+1]){var c=0,d=5;b+=d;for(var e,f;0<d;){f=a[b];var g=Math.min(d,8),h=8-g;e=4278190080>>>24+h<<h;e=(f&e)>>h;c=c?c<<g|e:e;b+=1;d-=g}if(16>c)return!0}return!1};function ME(a){this.j=a;this.h=0;this.g=new Map;this.i=null}p=ME.prototype;p.destroy=function(){this.g.clear()};p.isSupported=function(a){return"audio/ac3"==a.toLowerCase().split(";")[0]?Ec(this.convertCodecs("audio",a)):!1};p.convertCodecs=function(a,b){return"audio/ac3"==b.toLowerCase().split(";")[0]?qb().ae()?'audio/mp4; codecs="ec-3"':'audio/mp4; codecs="ac-3"':b};p.getOriginalMimeType=function(){return this.j};
|
|
p.transmux=function(a,b,c,d){a=Tb(a);for(var e=Nj(a),f=e.length;f<a.length&&!LE(a,f);f++);var g=1E3*c.endTime;e=Mj(e);e.length&&c&&(e=e.find(function(m){return"com.apple.streaming.transportStreamTimestamp"===m.description}))&&(g=e.data);e=0;for(var h=new Uint8Array([]),k=[];f<a.length;){var l=KE(a,f);if(!l)return Promise.reject(new U(2,3,3018,c?c.O()[0]:null));b.audioSamplingRate=l.sampleRate;b.channelsCount=l.channelCount;e=l.sampleRate;h=l.Da;k.push({data:a.subarray(f,f+l.qa),size:l.qa,duration:1536,
|
|
qb:0,flags:{vb:0,kb:0,jb:0,hb:0,ib:2,wb:0}});f+=l.qa}a=Math.floor(g*e/1E3);d={id:b.id,type:"audio",codecs:"ac-3",encrypted:b.encrypted&&0<b.drmInfos.length,timescale:e,duration:d,zb:[],Da:h,Na:new Uint8Array([]),Wa:0,Xa:0,data:{Tb:this.h,baseMediaDecodeTime:a,xb:k},stream:b};d=new Hi([d]);c=b.id+"_"+c.i;this.g.has(c)?b=this.g.get(c):(b=Ni(d),this.g.set(c,b));c=this.i!==b;d=ej(d);this.i=b;this.h++;return c?(b=pc(b,d),Promise.resolve(b)):Promise.resolve(d)};T("shaka.transmuxer.Ac3Transmuxer",ME);
|
|
ME.prototype.transmux=ME.prototype.transmux;ME.prototype.getOriginalMimeType=ME.prototype.getOriginalMimeType;ME.prototype.convertCodecs=ME.prototype.convertCodecs;ME.prototype.isSupported=ME.prototype.isSupported;ME.prototype.destroy=ME.prototype.destroy;ve("audio/ac3",function(){return new ME("audio/ac3")},Be);function NE(a,b){if(b+8>a.length||2935!==(a[b]<<8|a[b+1]<<0))return null;var c=new Pj(a.subarray(b+2));Rj(c,2);Rj(c,3);var d=Sj(c,11)+1<<1,e=Sj(c,2);if(3==e){e=Sj(c,2);e=[24E3,22060,16E3][e];var f=3}else e=[48E3,44100,32E3][e],f=Sj(c,2);var g=Sj(c,3),h=Sj(c,1);c=Sj(c,5);if(b+d>a.byteLength)return null;a=Math.floor(d*e/(16*[1,2,3,6][f]));a=new Uint8Array([(a&8160)>>5,(a&31)<<3,e<<6|c<<1|0,0|g<<1|h<<0,0]);return{sampleRate:e,channelCount:[2,1,2,3,3,4,4,5][g]+h,Da:a,qa:d}};function OE(a){this.j=a;this.h=0;this.g=new Map;this.i=null}p=OE.prototype;p.destroy=function(){this.g.clear()};p.isSupported=function(a){return"audio/ec3"==a.toLowerCase().split(";")[0]?Ec(this.convertCodecs("audio",a)):!1};p.convertCodecs=function(a,b){return"audio/ec3"==b.toLowerCase().split(";")[0]?'audio/mp4; codecs="ec-3"':b};p.getOriginalMimeType=function(){return this.j};
|
|
p.transmux=function(a,b,c,d){a=Tb(a);for(var e=Nj(a),f=e.length;f<a.length&&2935!==(a[f]<<8|a[f+1]<<0);f++);var g=1E3*c.endTime;e=Mj(e);e.length&&c&&(e=e.find(function(m){return"com.apple.streaming.transportStreamTimestamp"===m.description}))&&(g=e.data);e=0;for(var h=new Uint8Array([]),k=[];f<a.length;){var l=NE(a,f);if(!l)return Promise.reject(new U(2,3,3018,c?c.O()[0]:null));b.audioSamplingRate=l.sampleRate;b.channelsCount=l.channelCount;e=l.sampleRate;h=l.Da;k.push({data:a.subarray(f,f+l.qa),
|
|
size:l.qa,duration:1536,qb:0,flags:{vb:0,kb:0,jb:0,hb:0,ib:2,wb:0}});f+=l.qa}a=Math.floor(g*e/1E3);d={id:b.id,type:"audio",codecs:"ec-3",encrypted:b.encrypted&&0<b.drmInfos.length,timescale:e,duration:d,zb:[],Da:h,Na:new Uint8Array([]),Wa:0,Xa:0,data:{Tb:this.h,baseMediaDecodeTime:a,xb:k},stream:b};d=new Hi([d]);c=b.id+"_"+c.i;this.g.has(c)?b=this.g.get(c):(b=Ni(d),this.g.set(c,b));c=this.i!==b;d=ej(d);this.i=b;this.h++;return c?(b=pc(b,d),Promise.resolve(b)):Promise.resolve(d)};
|
|
T("shaka.transmuxer.Ec3Transmuxer",OE);OE.prototype.transmux=OE.prototype.transmux;OE.prototype.getOriginalMimeType=OE.prototype.getOriginalMimeType;OE.prototype.convertCodecs=OE.prototype.convertCodecs;OE.prototype.isSupported=OE.prototype.isSupported;OE.prototype.destroy=OE.prototype.destroy;ve("audio/ec3",function(){return new OE("audio/ec3")},Be);function PE(a){if(!a.length)return null;var b=a.find(function(w){return 7==w.type});a=a.find(function(w){return 8==w.type});if(!b||!a)return null;var c=new Pj(b.data),d=Xj(c);Xj(c);Xj(c);Uj(c);if(QE.includes(d)&&(d=X(c),3===d&&Rj(c,1),Uj(c),Uj(c),Rj(c,1),Wj(c))){d=3!==d?8:12;for(var e=0;e<d;e++)Wj(c)&&(6>e?Yj(c,16):Yj(c,64))}Uj(c);d=X(c);if(0===d)X(c);else if(1===d)for(Rj(c,1),Uj(c),Uj(c),d=X(c),e=0;e<d;e++)Uj(c);Uj(c);Rj(c,1);var f=X(c),g=X(c),h=Sj(c,1);0===h&&Rj(c,1);Rj(c,1);var k=0,l=0,m=0,n=0;
|
|
Wj(c)&&(k=X(c),l=X(c),m=X(c),n=X(c));e=d=1;if(Wj(c)&&Wj(c)){var q=Xj(c),r=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],u=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];0<q&&16>=q?(d=r[q-1],e=u[q-1]):255===q&&(d=Sj(c,16),e=Sj(c,16))}c=(2-h)*(g+1)*16-2*m-2*n;f=16*(f+1)-2*k-2*l;k=[];b=b.fullData;k.push(b.byteLength>>>8&255);k.push(b.byteLength&255);k=k.concat.apply(k,x(b));b=[];a=a.fullData;b.push(a.byteLength>>>8&255);b.push(a.byteLength&255);b=b.concat.apply(b,x(a));a=new Uint8Array([1,k[3],k[4],
|
|
k[5],255,225].concat(k,[1],b));return{height:c,width:f,Na:a,Wa:d,Xa:e}}
|
|
function RE(a){function b(u){e={data:new Uint8Array([]),frame:!1,isKeyframe:!1,pts:u.pts,dts:u.dts,nalus:[]}}function c(){if(e&&e.nalus.length&&e.frame){for(var u=[],w=t(e.nalus),v=w.next();!v.done;v=w.next()){v=v.value;var y=v.fullData.byteLength,z=new Uint8Array(4);z[0]=y>>24&255;z[1]=y>>16&255;z[2]=y>>8&255;z[3]=y&255;u.push(z);u.push(v.fullData)}e.data=pc.apply(jc,x(u));d.push(e)}}for(var d=[],e=null,f=!1,g=0;g<a.length;g++){var h=a[g],k=h.nalus,l=!1;e&&k.length&&!f&&(c(),b(h));k=t(h.nalus);for(var m=
|
|
k.next();!m.done;m=k.next()){m=m.value;var n=!1;switch(m.type){case 1:var q=!1;n=!0;var r=m.data;l&&4<r.length&&(r=Zj(new Pj(r)),2===r||4===r||7===r||9===r)&&(q=!0);q&&e&&e.frame&&!e.isKeyframe&&(c(),e=null);e||b(h);e.frame=!0;e.isKeyframe=q;break;case 5:n=!0;e&&e.frame&&!e.isKeyframe&&(c(),e=null);e||b(h);e.frame=!0;e.isKeyframe=!0;break;case 6:n=!0;break;case 7:l=n=!0;break;case 8:n=!0;break;case 9:f=n=!0;e&&e.frame&&(c(),e=null);e||b(h);break;case 12:n=!0;break;default:n=!1}e&&n&&e.nalus.push(m)}}c();
|
|
return d}var QE=[100,110,122,244,44,83,86,118,128,138,139,134];function SE(a){if(!a.length)return null;var b=a.find(function(g){return 32==g.type}),c=a.find(function(g){return 33==g.type}),d=a.find(function(g){return 34==g.type});if(!b||!c||!d)return null;var e=TE(b.fullData);a=UE(c.fullData);var f=VE(d.fullData);b=WE(b.fullData,c.fullData,d.fullData,{Mg:e.Mg,qh:e.qh,wg:a.wg,xg:a.xg,pg:a.pg,vg:a.vg,qg:a.qg,rg:a.rg,sg:a.sg,ug:a.ug,jg:a.jg,kg:a.kg,lg:a.lg,mg:a.mg,ng:a.ng,og:a.og,ag:a.ag,jf:a.jf,Zf:a.Zf,Yf:a.Yf,Xf:a.Xf,Og:f.Og});return{height:a.height,width:a.width,
|
|
Na:b,Wa:a.Jk,Xa:a.Ik}}function TE(a){var b=new Pj(a,!0);Xj(b);Xj(b);Sj(b,4);Sj(b,2);Sj(b,6);a=Sj(b,3);b=Wj(b);return{Mg:a+1,qh:b}}
|
|
function UE(a){a=new Pj(a,!0);Xj(a);Xj(a);var b=0,c=0,d=0,e=0;Sj(a,4);var f=Sj(a,3);Wj(a);for(var g=Sj(a,2),h=Sj(a,1),k=Sj(a,5),l=Xj(a),m=Xj(a),n=Xj(a),q=Xj(a),r=Xj(a),u=Xj(a),w=Xj(a),v=Xj(a),y=Xj(a),z=Xj(a),A=Xj(a),B=[],E=[],H=0;H<f;H++)B.push(Wj(a)),E.push(Wj(a));if(0<f)for(H=f;8>H;H++)Sj(a,2);for(H=0;H<f;H++)B[H]&&Sj(a,88),E[H]&&Xj(a);X(a);B=X(a);3==B&&Sj(a,1);E=X(a);H=X(a);Wj(a)&&(b+=X(a),c+=X(a),d+=X(a),e+=X(a));var C=X(a),D=X(a),I=X(a);if(Wj(a))for(var L=0;L<=f;L++)X(a),X(a),X(a);else X(a),
|
|
X(a),X(a);X(a);X(a);X(a);X(a);X(a);X(a);if(Wj(a)&&Wj(a))for(L=0;4>L;L++)for(var K=0;K<(3===L?2:6);K++)if(Wj(a)){var J=Math.min(64,1<<4+(L<<1));1<L&&Vj(a);for(var M=0;M<J;M++)Vj(a)}else X(a);Wj(a);Wj(a);Wj(a)&&(Xj(a),X(a),X(a),Wj(a));L=X(a);for(J=K=0;J<L;J++)if(M=!1,0!==J&&(M=Wj(a)),M){J===L&&X(a);Wj(a);X(a);for(var O=M=0;O<=K;O++){var N=Wj(a),P=!1;N||(P=Wj(a));(N||P)&&M++}K=M}else{O=X(a);M=X(a);K=O+M;for(N=0;N<O;N++)X(a),Wj(a);for(O=0;O<M;O++)X(a),Wj(a)}if(Wj(a))for(L=X(a),K=0;K<L;K++){for(J=0;J<
|
|
I+4;J++)Sj(a,1);Sj(a,1)}L=I=1;K=0;Wj(a);Wj(a);if(Wj(a)){Wj(a)&&(J=Xj(a),M=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],O=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1],0<J&&16>=J?(I=M[J-1],L=O[J-1]):255===J&&(I=Sj(a,16),L=Sj(a,16)));Wj(a)&&Wj(a);Wj(a)&&(Sj(a,3),Wj(a),Wj(a)&&(Xj(a),Xj(a),Xj(a)));Wj(a)&&(X(a),X(a));Wj(a);Wj(a);Wj(a);if(J=Wj(a))X(a),X(a),X(a),X(a);if(Wj(a)&&(Sj(a,32),Sj(a,32),Wj(a)&&X(a),Wj(a))){O=!1;J=Wj(a);M=Wj(a);if(J||M){if(O=Wj(a))Xj(a),Sj(a,5),Wj(a),Sj(a,5);Sj(a,4);Sj(a,4);O&&
|
|
Sj(a,4);Sj(a,5);Sj(a,5);Sj(a,5)}for(N=0;N<=f;N++){var R=!0;P=1;Wj(a)||(R=Wj(a));var S=!1;R?X(a):S=Wj(a);S||(P=X(a)+1);if(J){for(R=0;R<P;R++)X(a),X(a),O&&(X(a),X(a));Wj(a)}if(M){for(R=0;R<P;R++)X(a),X(a),O&&(X(a),X(a));Wj(a)}}}Wj(a)&&(Wj(a),Wj(a),Wj(a),K=X(a),X(a),X(a),X(a),X(a))}return{pg:A,wg:g,xg:h,vg:k,qg:l,rg:m,sg:n,ug:q,jg:r,kg:u,lg:w,mg:v,ng:y,og:z,jf:K,ag:0,Zf:B,Yf:C,Xf:D,width:E-(b+c)*(1===B||2===B?2:1),height:H-(d+e)*(1===B?2:1),Jk:I,Ik:L}}
|
|
function VE(a){var b=new Pj(a,!0);Xj(b);Xj(b);X(b);X(b);Wj(b);Wj(b);Sj(b,3);Wj(b);Wj(b);X(b);X(b);Vj(b);Wj(b);Wj(b);Wj(b)&&X(b);Vj(b);Vj(b);Wj(b);Wj(b);Wj(b);Wj(b);a=Wj(b);b=Wj(b);var c=1;b&&a?c=0:b?c=3:a&&(c=2);return{Og:c}}
|
|
function WE(a,b,c,d){var e=new Uint8Array(23+(5+a.byteLength)+(5+b.byteLength)+(5+c.byteLength));e[0]=1;e[1]=(d.wg&3)<<6|(d.xg?1:0)<<5|d.vg&31;e[2]=d.qg;e[3]=d.rg;e[4]=d.sg;e[5]=d.ug;e[6]=d.jg;e[7]=d.kg;e[8]=d.lg;e[9]=d.mg;e[10]=d.ng;e[11]=d.og;e[12]=d.pg;e[13]=240|(d.jf&3840)>>8;e[14]=d.jf&255;e[15]=252|d.Og&3;e[16]=252|d.Zf&3;e[17]=248|d.Yf&7;e[18]=248|d.Xf&7;e[19]=0;e[20]=0;e[21]=(d.ag&3)<<6|(d.Mg&7)<<3|(d.qh?1:0)<<2|3;e[22]=3;e[23]=160;e[24]=0;e[25]=1;e[26]=(a.byteLength&65280)>>8;e[27]=(a.byteLength&
|
|
255)>>0;e.set(a,28);e[23+(5+a.byteLength)]=161;e[a.byteLength+29]=0;e[a.byteLength+30]=1;e[a.byteLength+31]=(b.byteLength&65280)>>8;e[a.byteLength+32]=(b.byteLength&255)>>0;e.set(b,a.byteLength+33);e[23+(a.byteLength+10+b.byteLength)]=162;e[a.byteLength+10+b.byteLength+24]=0;e[a.byteLength+10+b.byteLength+25]=1;e[a.byteLength+10+b.byteLength+26]=(c.byteLength&65280)>>8;e[a.byteLength+10+b.byteLength+27]=(c.byteLength&255)>>0;e.set(c,a.byteLength+10+b.byteLength+28);return e};function XE(a,b){var c=a[b+1]>>3&3,d=a[b+1]>>1&3,e=a[b+2]>>4&15,f=a[b+2]>>2&3;if(1!==c&&0!==e&&15!==e&&3!==f){var g=a[b+3]>>6;e=1E3*YE[14*(3===c?3-d:3===d?3:4)+e-1];f=ZE[3*(3===c?0:2===c?1:2)+f];c=$E[c][d];var h=aF[d],k=Math.floor(c*e/f+(a[b+2]>>1&1))*h,l=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);(l=l?parseInt(l[1],10):0)&&87>=l&&2===d&&224E3<=e&&0===g&&(a[b+3]|=128);return{sampleRate:f,channelCount:3===g?1:2,qa:k,Hk:8*c*h}}return null}
|
|
function bF(a,b){return 255===a[b]&&224===(a[b+1]&224)&&0!==(a[b+1]&6)}function cF(a,b){if(b+1<a.length&&bF(a,b)){var c=XE(a,b),d=4;c&&c.qa&&(d=c.qa);b+=d;return b===a.length||b+1<a.length&&bF(a,b)}return!1}
|
|
var YE=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],ZE=[44100,48E3,32E3,22050,24E3,16E3,11025,12E3,8E3],$E=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],aF=[0,1,1,4];function dF(a){this.j=a;this.h=0;this.g=new Map;this.i=null}p=dF.prototype;p.destroy=function(){this.g.clear()};p.isSupported=function(a){return"audio/mpeg"==a.toLowerCase().split(";")[0]?Ec(this.convertCodecs("audio",a)):!1};p.convertCodecs=function(a,b){return"audio/mpeg"==b.toLowerCase().split(";")[0]?'audio/mp4; codecs="mp3"':b};p.getOriginalMimeType=function(){return this.j};
|
|
p.transmux=function(a,b,c,d){for(var e=Tb(a),f=Nj(e).length;f<e.length&&!cF(e,f);f++);var g;for(a=[];f<e.length;){var h=XE(e,f);if(!h)return Promise.reject(new U(2,3,3018,c?c.O()[0]:null));g||(g=h);f+h.qa<=e.length&&a.push({data:e.subarray(f,f+h.qa),size:h.qa,duration:1152,qb:0,flags:{vb:0,kb:0,jb:0,hb:0,ib:2,wb:0}});f+=h.qa}if(!g)return Promise.reject(new U(2,3,3018,c?c.O()[0]:null));e=9E4*g.Hk/g.sampleRate*this.h;d={id:b.id,type:"audio",codecs:"mp3",encrypted:b.encrypted&&0<b.drmInfos.length,timescale:g.sampleRate,
|
|
duration:d,zb:[],Da:new Uint8Array([]),Na:new Uint8Array([]),Wa:0,Xa:0,data:{Tb:this.h,baseMediaDecodeTime:e,xb:a},stream:b};d=new Hi([d]);c=b.id+"_"+c.i;this.g.has(c)?b=this.g.get(c):(b=Ni(d),this.g.set(c,b));c=this.i!==b;d=ej(d);this.i=b;this.h++;return c?(b=pc(b,d),Promise.resolve(b)):Promise.resolve(d)};T("shaka.transmuxer.Mp3Transmuxer",dF);dF.prototype.transmux=dF.prototype.transmux;dF.prototype.getOriginalMimeType=dF.prototype.getOriginalMimeType;dF.prototype.convertCodecs=dF.prototype.convertCodecs;
|
|
dF.prototype.isSupported=dF.prototype.isSupported;dF.prototype.destroy=dF.prototype.destroy;ve("audio/mpeg",function(){return new dF("audio/mpeg")},Be);function eF(a){this.h=a;this.g=null}p=eF.prototype;p.destroy=function(){};p.isSupported=function(a){if("video/mp2t"!=a.toLowerCase().split(";")[0])return!1;var b=Me(a).split(","),c=uc("audio",b);b=uc("video",b);return!c||b||"mp3"!=Ie(c)?!1:Ec(this.convertCodecs("audio",a))};p.convertCodecs=function(a,b){return"video/mp2t"==b.toLowerCase().split(";")[0]?"audio/mpeg":b};p.getOriginalMimeType=function(){return this.h};
|
|
p.transmux=function(a,b,c,d,e){this.g?this.g.clearData():this.g=new ak;a=Tb(a);a=this.g.parse(a);if("mp3"!=a.Ld().audio||"audio"!=e)return Promise.reject(new U(2,3,3018,c?c.O()[0]:null));c=new Uint8Array([]);e=t(a.rb());for(a=e.next();!a.done;a=e.next())if(a=a.value.data)for(b=0;b<a.length;)(d=XE(a,b))?(b+d.qa<=a.length&&(c=pc(c,a.subarray(b,b+d.qa))),b+=d.qa):b++;return Promise.resolve(c)};T("shaka.transmuxer.MpegTsTransmuxer",eF);eF.prototype.transmux=eF.prototype.transmux;
|
|
eF.prototype.getOriginalMimeType=eF.prototype.getOriginalMimeType;eF.prototype.convertCodecs=eF.prototype.convertCodecs;eF.prototype.isSupported=eF.prototype.isSupported;eF.prototype.destroy=eF.prototype.destroy;ve("video/mp2t",function(){return new eF("video/mp2t")},Ae);/*
|
|
@license
|
|
MSS Transmuxer
|
|
Copyright 2015 Dash Industry Forum
|
|
SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
function fF(a){this.h=a;(this.g=kx.get("ISOBoxer")())&&gF(this)}
|
|
function gF(a){function b(){this._procFullBox();this.flags&1&&(this._procField("AlgorithmID","uint",24),this._procField("IV_size","uint",8),this._procFieldArray("KID",16,"uint",8));this._procField("sample_count","uint",32);this._procEntries("entry",this.sample_count,function(c){this._procEntryField(c,"InitializationVector","data",8);this.flags&2&&(this._procEntryField(c,"NumberOfEntries","uint",16),this._procSubEntries(c,"clearAndCryptedData",c.NumberOfEntries,function(d){this._procEntryField(d,"BytesOfClearData",
|
|
"uint",16);this._procEntryField(d,"BytesOfEncryptedData","uint",32)}))})}a.g.addBoxProcessor("saio",function(){this._procFullBox();this.flags&1&&(this._procField("aux_info_type","uint",32),this._procField("aux_info_type_parameter","uint",32));this._procField("entry_count","uint",32);this._procFieldArray("offset",this.entry_count,"uint",1===this.version?64:32)});a.g.addBoxProcessor("saiz",function(){this._procFullBox();this.flags&1&&(this._procField("aux_info_type","uint",32),this._procField("aux_info_type_parameter",
|
|
"uint",32));this._procField("default_sample_info_size","uint",8);this._procField("sample_count","uint",32);0===this.default_sample_info_size&&this._procFieldArray("sample_info_size",this.sample_count,"uint",8)});a.g.addBoxProcessor("senc",b);a.g.addBoxProcessor("uuid",function(){for(var c=!0,d=0;16>d;d++)this.usertype[d]!==hF[d]&&(c=!1);c&&(this._parsing&&(this.type="sepiff"),b.call(this))})}p=fF.prototype;p.destroy=function(){};
|
|
p.isSupported=function(a,b){var c=a.startsWith("mss/");if(!this.g||!c)return!1;if(b)return Ec(this.convertCodecs(b,a));b=this.convertCodecs("audio",a);a=this.convertCodecs("video",a);return Ec(b)||Ec(a)};p.convertCodecs=function(a,b){return b.replace("mss/","")};p.getOriginalMimeType=function(){return this.h};
|
|
p.transmux=function(a,b,c){if(!c)return Promise.resolve(Tb(a));if(!b.mssPrivateData)return Promise.reject(new U(2,3,3020,c?c.O()[0]:null));try{var d,e=this.g.parseBuffer(a),f=e.fetch("tfhd");f.track_ID=b.id+1;var g=e.fetch("tfdt"),h=e.fetch("traf");null===g&&(g=this.g.createFullBox("tfdt",h,f),g.version=1,g.flags=0,g.baseMediaDecodeTime=Math.floor(c.startTime*b.mssPrivateData.timescale));var k=e.fetch("trun"),l=e.fetch("tfxd");l&&l._parent.boxes.splice(l._parent.boxes.indexOf(l),1);var m=e.fetch("tfrf");
|
|
m&&m._parent.boxes.splice(m._parent.boxes.indexOf(m),1);var n=e.fetch("sepiff");if(null!==n){n.type="senc";n.usertype=void 0;var q=e.fetch("saio");if(null===q){q=this.g.createFullBox("saio",h);q.version=0;q.flags=0;q.entry_count=1;q.offset=[0];var r=this.g.createFullBox("saiz",h);r.version=0;r.flags=0;r.sample_count=n.sample_count;r.default_sample_info_size=0;r.sample_info_size=[];if(n.flags&2)for(d=0;d<n.sample_count;d+=1)r.sample_info_size[d]=10+6*n.entry[d].NumberOfEntries;else r.default_sample_info_size=
|
|
8}}f.flags&=16777214;f.flags|=131072;k.flags|=1;var u=e.fetch("moof");k.data_offset=u.getLength()+8;var w=e.fetch("saio");null!==w&&(w.offset[0]=iF(u,"traf")+iF(h,"senc")+16);var v=Tb(e.write());return Promise.resolve(v)}catch(y){return y instanceof U?Promise.reject(y):Promise.reject(new U(2,3,3022,c?c.O()[0]:null))}};function iF(a,b){for(var c=8,d=0;d<a.boxes.length&&a.boxes[d].type!==b;d++)c+=a.boxes[d].size;return c}T("shaka.transmuxer.MssTransmuxer",fF);fF.prototype.transmux=fF.prototype.transmux;
|
|
fF.prototype.getOriginalMimeType=fF.prototype.getOriginalMimeType;fF.prototype.convertCodecs=fF.prototype.convertCodecs;fF.prototype.isSupported=fF.prototype.isSupported;fF.prototype.destroy=fF.prototype.destroy;var hF=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);ve("mss/audio/mp4",function(){return new fF("mss/audio/mp4")},Be);ve("mss/video/mp4",function(){return new fF("mss/video/mp4")},Be);function jF(a){this.m=a;this.g=0;this.i=new Map;this.l=this.h=this.j=null}p=jF.prototype;p.destroy=function(){this.i.clear();this.h&&this.h.destroy()};
|
|
p.isSupported=function(a,b){if("video/mp2t"!=a.toLowerCase().split(";")[0])return!1;var c=a;b&&(c=this.convertCodecs(b,a));var d=Me(c).split(",");c=uc("audio",d);d=uc("video",d);if(c&&(c=Ie(c),!kF.includes(c))||d&&(c=Ie(d),!lF.includes(c)))return!1;if(b)return Ec(this.convertCodecs(b,a));b=this.convertCodecs("audio",a);a=this.convertCodecs("video",a);return Ec(b)||Ec(a)};
|
|
p.convertCodecs=function(a,b){return"video/mp2t"==b.toLowerCase().split(";")[0]?(b=Me(b).replace("mp4a.40.34","mp3").split(",").map(function(c){return Gf(c,"audio/mp4")}).map(Hf).join(","),"audio"==a?'audio/mp4; codecs="'+b+'"':'video/mp4; codecs="'+b+'"'):b};p.getOriginalMimeType=function(){return this.m};
|
|
p.transmux=function(a,b,c,d,e){var f=Tb(a);if("audio"==e&&!qk(f)){for(var g=Nj(f),h=g.length;h<f.length;h++)if(cF(f,h))return Promise.reject(new U(2,3,3018,c?c.O()[0]:null));for(h=g.length;h<f.length;h++)if(HE(f,h))return this.h||(this.h=new JE("audio/aac")),this.h.transmux(a,b,c,d,e);return Promise.reject(new U(2,3,3018,c?c.O()[0]:null))}this.j?this.j.clearData():this.j=new ak;var k=this.j.parse(f),l=[],m=k.Ld();try{var n=null;if("video"==e){switch(m.video){case "avc":var q=[],r=null,u=k.Mc(),w=
|
|
RE(u);if(!w.length)throw new U(2,3,3023,c?c.O()[0]:null);for(var v=0;v<w.length;v++){var y=w[v];null==r&&(r=y.dts);var z=void 0;z=v+1<w.length?(w[v+1].dts||0)-(y.dts||0):1<w.length?(y.dts||0)-(w[v-1].dts||0):9E4*(c.endTime-c.startTime);q.push({data:y.data,size:y.data.byteLength,duration:z,qb:Math.round((y.pts||0)-(y.dts||0)),flags:{vb:0,kb:0,jb:0,hb:0,ib:y.isKeyframe?2:1,wb:y.isKeyframe?0:1}})}for(var A=[],B=t(u),E=B.next();!E.done;E=B.next())A.push.apply(A,x(E.value.nalus));var H=PE(A);if(!H||null==
|
|
r)throw new U(2,3,3018,c?c.O()[0]:null);b.height=H.height;b.width=H.width;n={id:b.id,type:"video",codecs:"avc1",encrypted:b.encrypted&&0<b.drmInfos.length,timescale:9E4,duration:d,zb:[],Da:new Uint8Array([]),Na:H.Na,Wa:H.Wa,Xa:H.Xa,data:{Tb:this.g,baseMediaDecodeTime:r,xb:q},stream:b};break;case "hvc":var C=[],D=null,I=[],L=k.Mc();if(!L.length)throw new U(2,3,3023,c?c.O()[0]:null);for(var K=0;K<L.length;K++){var J=L[K],M=J.nalus;I.push.apply(I,x(M));for(var O=!1,N=[],P=!1,R=t(M),S=R.next();!S.done;S=
|
|
R.next()){var aa=S.value;switch(aa.type){case 1:case 0:var W=P=!0;break;case 19:case 20:case 21:O=W=P=!0;break;case 32:W=!0;break;case 33:W=!0;break;case 34:W=!0;break;case 35:P=W=!0;break;case 39:case 40:W=!0;break;default:W=!1}if(P&&W){var Fa=aa.fullData.byteLength,Ga=new Uint8Array(4);Ga[0]=Fa>>24&255;Ga[1]=Fa>>16&255;Ga[2]=Fa>>8&255;Ga[3]=Fa&255;N.push(Ga);N.push(aa.fullData)}}var xa=N.length?{data:pc.apply(jc,x(N)),isKeyframe:O}:null;if(xa){null==D&&null!=J.dts&&(D=J.dts);var qa=void 0;qa=K+
|
|
1<L.length?(L[K+1].dts||0)-(J.dts||0):1<L.length?(J.dts||0)-(L[K-1].dts||0):9E4*(c.endTime-c.startTime);C.push({data:xa.data,size:xa.data.byteLength,duration:qa,qb:Math.round((J.pts||0)-(J.dts||0)),flags:{vb:0,kb:0,jb:0,hb:0,ib:xa.isKeyframe?2:1,wb:xa.isKeyframe?0:1}})}}var Da=SE(I);if(!Da||null==D)throw new U(2,3,3018,c?c.O()[0]:null);b.height=Da.height;b.width=Da.width;n={id:b.id,type:"video",codecs:"hvc1",encrypted:b.encrypted&&0<b.drmInfos.length,timescale:9E4,duration:d,zb:[],Da:new Uint8Array([]),
|
|
Na:Da.Na,Wa:Da.Wa,Xa:Da.Xa,data:{Tb:this.g,baseMediaDecodeTime:D,xb:C},stream:b}}n&&(l.push(n),n=null)}if("audio"==e){switch(m.audio){case "aac":for(var Ja=[],ra,da=null,sa=null,Za=null,$a=t(k.rb()),hb=$a.next();!hb.done;hb=$a.next()){var rb=hb.value,mb=rb.data;if(mb){var Ma=0;if(-1==sa&&Za)mb=pc(Za,rb.data),sa=null;else if(null!=sa&&Za){Ma=Math.max(0,sa);var Td=pc(Za,mb.subarray(0,Ma));Ja.push({data:Td,size:Td.byteLength,duration:1024,qb:0,flags:{vb:0,kb:0,jb:0,hb:0,ib:2,wb:0}});sa=Za=null}ra=GE(mb,
|
|
Ma);if(!ra)throw new U(2,3,3018,c?c.O()[0]:null);b.audioSamplingRate=ra.sampleRate;b.channelsCount=ra.channelCount;null==da&&null!==rb.pts&&(da=rb.pts);for(;Ma<mb.length;){var ic=FE(mb,Ma);if(!ic){Za=mb.subarray(Ma,mb.length);sa=-1;break}var be=ic.Rd+ic.qa;sa=Math.max(0,Ma+be-mb.length);0!=sa?Za=mb.subarray(Ma+ic.Rd,Ma+be):Ma+be<=mb.length&&Ja.push({data:mb.subarray(Ma+ic.Rd,Ma+be),size:ic.qa,duration:1024,qb:0,flags:{vb:0,kb:0,jb:0,hb:0,ib:2,wb:0}});Ma+=be}}}if(!ra||null==da){if(!k.Mc().length)throw new U(2,
|
|
3,3018,c?c.O()[0]:null);da=9E4*c.startTime;var Mf=uc("audio",b.codecs.split(","));if(!Mf||!b.channelsCount||!b.audioSamplingRate)throw new U(2,3,3018,c?c.O()[0]:null);ra={sampleRate:b.audioSamplingRate,channelCount:b.channelsCount,codec:Mf};var Nf=IE(Mf,b.channelsCount);if(!Nf)throw new U(2,3,3018,c?c.O()[0]:null);for(var $c=da+9E4*(c.endTime-c.startTime),cw=da;cw<$c;)Ja.push({data:Nf,size:Nf.byteLength,duration:1024,qb:0,flags:{vb:0,kb:0,jb:0,hb:0,ib:2,wb:0}}),cw+=1024/ra.sampleRate*9E4}var dw=ra.sampleRate,
|
|
FF=da/9E4*dw;n={id:b.id,type:"audio",codecs:ra.codec,encrypted:b.encrypted&&0<b.drmInfos.length,timescale:dw,duration:d,zb:[],Da:new Uint8Array([]),Na:new Uint8Array([]),Wa:0,Xa:0,data:{Tb:this.g,baseMediaDecodeTime:FF,xb:Ja},stream:b};break;case "ac3":for(var ew=[],ek=0,Zn=new Uint8Array([]),fk=null,fw=t(k.rb()),$n=fw.next();!$n.done;$n=fw.next()){var ao=$n.value,bo=ao.data;null==fk&&null!==ao.pts&&(fk=ao.pts);for(var Tf=0;Tf<bo.length;){var de=KE(bo,Tf);de?(b.audioSamplingRate=de.sampleRate,b.channelsCount=
|
|
de.channelCount,ek=de.sampleRate,Zn=de.Da,ew.push({data:bo.subarray(Tf,Tf+de.qa),size:de.qa,duration:1536,qb:0,flags:{vb:0,kb:0,jb:0,hb:0,ib:2,wb:0}}),Tf+=de.qa):Tf++}}if(0==ek||0==Zn.byteLength||null==fk)throw new U(2,3,3018,c?c.O()[0]:null);var GF=fk/9E4*ek;n={id:b.id,type:"audio",codecs:"ac-3",encrypted:b.encrypted&&0<b.drmInfos.length,timescale:ek,duration:d,zb:[],Da:Zn,Na:new Uint8Array([]),Wa:0,Xa:0,data:{Tb:this.g,baseMediaDecodeTime:GF,xb:ew},stream:b};break;case "ec3":for(var gw=[],gk=0,
|
|
co=new Uint8Array([]),hk=null,hw=t(k.rb()),eo=hw.next();!eo.done;eo=hw.next()){var fo=eo.value,go=fo.data;null==hk&&null!==fo.pts&&(hk=fo.pts);for(var Uf=0;Uf<go.length;){var ee=NE(go,Uf);ee?(b.audioSamplingRate=ee.sampleRate,b.channelsCount=ee.channelCount,gk=ee.sampleRate,co=ee.Da,gw.push({data:go.subarray(Uf,Uf+ee.qa),size:ee.qa,duration:1536,qb:0,flags:{vb:0,kb:0,jb:0,hb:0,ib:2,wb:0}}),Uf+=ee.qa):Uf++}}if(0==gk||0==co.byteLength||null==hk)throw new U(2,3,3018,c?c.O()[0]:null);var HF=hk/9E4*gk;
|
|
n={id:b.id,type:"audio",codecs:"ec-3",encrypted:b.encrypted&&0<b.drmInfos.length,timescale:gk,duration:d,zb:[],Da:co,Na:new Uint8Array([]),Wa:0,Xa:0,data:{Tb:this.g,baseMediaDecodeTime:HF,xb:gw},stream:b};break;case "mp3":for(var iw=[],ik,jk=null,jw=t(k.rb()),ho=jw.next();!ho.done;ho=jw.next()){var io=ho.value,rh=io.data;if(rh){null==jk&&null!==io.pts&&(jk=io.pts);for(var Oe=0;Oe<rh.length;){var Vf=XE(rh,Oe);Vf?(ik||(ik=Vf),Oe+Vf.qa<=rh.length&&iw.push({data:rh.subarray(Oe,Oe+Vf.qa),size:Vf.qa,duration:1152,
|
|
qb:0,flags:{vb:0,kb:0,jb:0,hb:0,ib:2,wb:0}}),Oe+=Vf.qa):Oe++}}}if(!ik||null==jk)throw new U(2,3,3018,c?c.O()[0]:null);var kw=ik.sampleRate,IF=jk/9E4*kw;n={id:b.id,type:"audio",codecs:"mp3",encrypted:b.encrypted&&0<b.drmInfos.length,timescale:kw,duration:d,zb:[],Da:new Uint8Array([]),Na:new Uint8Array([]),Wa:0,Xa:0,data:{Tb:this.g,baseMediaDecodeTime:IF,xb:iw},stream:b};break;case "opus":var lw=[],kk=null,id=k.F;if(!id)throw new U(2,3,3018,c?c.O()[0]:null);var Wb=[];switch(id.gj){case 1:case 2:Wb=
|
|
[0];break;case 0:Wb=[255,1,1,0,1];break;case 128:Wb=[255,2,0,0,1];break;case 3:Wb=[1,2,1,0,2,1];break;case 4:Wb=[1,2,2,0,1,2,3];break;case 5:Wb=[1,3,2,0,4,1,2,3];break;case 6:Wb=[1,4,2,0,4,1,2,3,5];break;case 7:Wb=[1,4,2,0,4,1,2,3,5,6];break;case 8:Wb=[1,5,3,0,6,1,2,3,4,5,7];break;case 130:Wb=[1,1,2,0,1];break;case 131:Wb=[1,1,3,0,1,2];break;case 132:Wb=[1,1,4,0,1,2,3];break;case 133:Wb=[1,1,5,0,1,2,3,4];break;case 134:Wb=[1,1,6,0,1,2,3,4,5];break;case 135:Wb=[1,1,7,0,1,2,3,4,5,6];break;case 136:Wb=
|
|
[1,1,8,0,1,2,3,4,5,6,7]}var mw=new Uint8Array([0,id.channelCount,0,0,id.sampleRate>>>24&255,id.sampleRate>>>17&255,id.sampleRate>>>8&255,id.sampleRate>>>0&255,0,0].concat(x(Wb)));for(var nw=id.sampleRate,ow=t(k.rb()),jo=ow.next();!jo.done;jo=ow.next()){var ko=jo.value,Wf=ko.data;null==kk&&null!==ko.pts&&(kk=ko.pts);for(var sh=0;sh<Wf.length;){for(var JF=0!==(Wf[sh+1]&16),KF=0!==(Wf[sh+1]&8),Kd=sh+2,lk=0;255===Wf[Kd];)lk+=255,Kd+=1;lk+=Wf[Kd];Kd+=1;Kd+=JF?2:0;Kd+=KF?2:0;var pw=Wf.slice(Kd,Kd+lk);lw.push({data:pw,
|
|
size:pw.byteLength,duration:960,qb:0,flags:{vb:0,kb:0,jb:0,hb:0,ib:2,wb:0}});sh=Kd+lk}}if(0==mw.byteLength||null==kk)throw new U(2,3,3018,c?c.O()[0]:null);b.audioSamplingRate=id.sampleRate;b.channelsCount=id.channelCount;var LF=kk/9E4*nw;n={id:b.id,type:"audio",codecs:"opus",encrypted:b.encrypted&&0<b.drmInfos.length,timescale:nw,duration:d,zb:[],Da:mw,Na:new Uint8Array([]),Wa:0,Xa:0,data:{Tb:this.g,baseMediaDecodeTime:LF,xb:lw},stream:b}}n&&(l.push(n),n=null)}}catch(lo){return lo&&3023==lo.code?
|
|
Promise.resolve(new Uint8Array([])):Promise.reject(lo)}if(!l.length)return Promise.reject(new U(2,3,3018,c?c.O()[0]:null));var qw=new Hi(l),mo=b.id+"_"+c.i;if(this.i.has(mo))var th=this.i.get(mo);else th=Ni(qw),this.i.set(mo,th);var MF=this.l!==th,rw=ej(qw);this.l=th;this.g++;if(MF){var NF=pc(th,rw);return Promise.resolve(NF)}return Promise.resolve(rw)};T("shaka.transmuxer.TsTransmuxer",jF);jF.prototype.transmux=jF.prototype.transmux;jF.prototype.getOriginalMimeType=jF.prototype.getOriginalMimeType;
|
|
jF.prototype.convertCodecs=jF.prototype.convertCodecs;jF.prototype.isSupported=jF.prototype.isSupported;jF.prototype.destroy=jF.prototype.destroy;var kF=["aac","ac-3","ec-3","mp3","opus"],lF=["avc","hevc"];ve("video/mp2t",function(){return new jF("video/mp2t")},ze);function mF(){}pa(mF,en);T("shaka.util.FairPlayUtils",mF);/*
|
|
@license
|
|
EME Encryption Scheme Polyfill
|
|
Copyright 2019 Google LLC
|
|
SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
function nF(){}var oF;
|
|
function pF(){oF||navigator.emeEncryptionSchemePolyfilled?console.debug("EmeEncryptionSchemePolyfill: Already installed."):navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration?(oF=navigator.requestMediaKeySystemAccess,console.debug("EmeEncryptionSchemePolyfill: Waiting to detect encryptionScheme support."),navigator.requestMediaKeySystemAccess=qF,navigator.emeEncryptionSchemePolyfilled=!0):console.debug("EmeEncryptionSchemePolyfill: EME not found")}
|
|
function qF(a,b){var c=this,d;return Q(function(e){if(1==e.g)return console.assert(c==navigator,'bad "this" for requestMediaKeySystemAccess'),F(e,oF.call(c,a,b),2);d=e.h;if(rF(d))return console.debug("EmeEncryptionSchemePolyfill: Native encryptionScheme support found."),navigator.requestMediaKeySystemAccess=oF,e.return(d);console.debug("EmeEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support.");navigator.requestMediaKeySystemAccess=sF;return e.return(sF.call(c,
|
|
a,b))})}
|
|
function sF(a,b){var c=this,d,e,f,g,h,k,l,m,n,q,r,u;return Q(function(w){if(1==w.g){console.assert(c==navigator,'bad "this" for requestMediaKeySystemAccess');d=tF(a);e=[];f=t(b);for(g=f.next();!g.done;g=f.next())h=g.value,k=uF(h.videoCapabilities,d),l=uF(h.audioCapabilities,d),h.videoCapabilities&&h.videoCapabilities.length&&!k.length||h.audioCapabilities&&h.audioCapabilities.length&&!l.length||(m=Object.assign({},h),m.videoCapabilities=k,m.audioCapabilities=l,e.push(m));if(!e.length)throw n=Error("Unsupported keySystem or supportedConfigurations."),
|
|
n.name="NotSupportedError",n.code=DOMException.NOT_SUPPORTED_ERR,n;return F(w,oF.call(c,a,e),2)}q=w.h;u=r=null;e[0]&&(e[0].videoCapabilities&&(r=e[0].videoCapabilities[0].encryptionScheme),e[0].audioCapabilities&&(u=e[0].audioCapabilities[0].encryptionScheme));return w.return(new vF(q,r,u))})}function uF(a,b){return a?a.filter(function(c){return wF(c.encryptionScheme,b)}):a}T("EmeEncryptionSchemePolyfill",nF);nF.install=pF;function xF(){}var yF;
|
|
function zF(){yF||navigator.mediaCapabilitiesEncryptionSchemePolyfilled?console.debug("McEncryptionSchemePolyfill: Already installed."):navigator.mediaCapabilities?(yF=navigator.mediaCapabilities.decodingInfo,console.debug("McEncryptionSchemePolyfill: Waiting to detect encryptionScheme support."),navigator.mediaCapabilities.decodingInfo=AF,navigator.mediaCapabilitiesEncryptionSchemePolyfilled=!0):console.debug("McEncryptionSchemePolyfill: MediaCapabilities not found")}
|
|
function AF(a){var b=this,c,d;return Q(function(e){switch(e.g){case 1:return console.assert(b==navigator.mediaCapabilities,'bad "this" for decodingInfo'),F(e,yF.call(b,a),2);case 2:c=e.h;if(!c.supported||!a.keySystemConfiguration)return e.return(c);if((d=c.keySystemAccess)&&rF(d))return console.debug("McEncryptionSchemePolyfill: Native encryptionScheme support found."),navigator.mediaCapabilities.decodingInfo=yF,e.return(c);console.debug("McEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support.");
|
|
navigator.mediaCapabilities.decodingInfo=BF;if(d){e.u(3);break}return F(e,CF(a),4);case 4:return c.keySystemAccess=e.h,e.return(c);case 3:return e.return(BF.call(b,a))}})}
|
|
function BF(a){var b=this,c,d,e,f,g,h,k;return Q(function(l){switch(l.g){case 1:return console.assert(b==navigator.mediaCapabilities,'bad "this" for decodingInfo'),d=c=null,!a.keySystemConfiguration||(e=a.keySystemConfiguration,f=e.keySystem,d=e.audio&&e.audio.encryptionScheme,c=e.video&&e.video.encryptionScheme,g=tF(f),h={powerEfficient:!1,smooth:!1,supported:!1,keySystemAccess:null,configuration:a},wF(d,g)&&wF(c,g))?F(l,yF.call(b,a),2):l.return(h);case 2:k=l.h;if(k.keySystemAccess){k.keySystemAccess=
|
|
new vF(k.keySystemAccess,c,d);l.u(3);break}if(!a.keySystemConfiguration){l.u(3);break}return F(l,CF(a),5);case 5:k.keySystemAccess=l.h;case 3:return l.return(k)}})}
|
|
function CF(a){var b,c;return Q(function(d){if(1==d.g){var e=a.keySystemConfiguration,f=[],g=[];e.audio&&f.push({robustness:e.audio.robustness||"",contentType:a.audio.contentType,encryptionScheme:e.audio.encryptionScheme});e.video&&g.push({robustness:e.video.robustness||"",contentType:a.video.contentType,encryptionScheme:e.video.encryptionScheme});e={initDataTypes:e.initDataType?[e.initDataType]:[],distinctiveIdentifier:e.distinctiveIdentifier,persistentState:e.persistentState,sessionTypes:e.sessionTypes};
|
|
f.length&&(e.audioCapabilities=f);g.length&&(e.videoCapabilities=g);b=e;return F(d,navigator.requestMediaKeySystemAccess(a.keySystemConfiguration.keySystem,[b]),2)}c=d.h;return d.return(c)})}T("McEncryptionSchemePolyfill",xF);xF.install=zF;function vF(a,b,c){this.g=a;this.i=b||null;this.h=c||null;this.keySystem=a.keySystem}
|
|
vF.prototype.getConfiguration=function(){var a=this.g.getConfiguration();if(a.videoCapabilities)for(var b=t(a.videoCapabilities),c=b.next();!c.done;c=b.next())c.value.encryptionScheme=this.i;if(a.audioCapabilities)for(b=t(a.audioCapabilities),c=b.next();!c.done;c=b.next())c.value.encryptionScheme=this.h;return a};vF.prototype.createMediaKeys=function(){return this.g.createMediaKeys()};
|
|
function tF(a){if(a.startsWith("com.widevine")||a.startsWith("com.microsoft")||a.startsWith("com.chromecast")||a.startsWith("com.adobe")||a.startsWith("org.w3"))return"cenc";if(a.startsWith("com.apple"))return"cbcs";if(a.startsWith("com.huawei"))return"cenc";console.warn("EmeEncryptionSchemePolyfill: Unknown key system:",a,"Please contribute!");return null}
|
|
function rF(a){a=a.getConfiguration();var b=a.audioCapabilities&&a.audioCapabilities[0];return(a=a.videoCapabilities&&a.videoCapabilities[0]||b)&&void 0!==a.encryptionScheme?!0:!1}function wF(a,b){if(!a||a==b)return!0;if("cbcs"==a||"cbcs-1-9"==a)if(DF||EF||OF)return!0;return!1}function PF(){}function XB(){pF();zF()}T("EncryptionSchemePolyfills",PF);PF.install=XB;var OF=navigator.userAgent.includes("CrKey"),DF=100<=parseInt(navigator.userAgent.split("Firefox/").pop(),10),QF;
|
|
var RF=navigator.userAgent||"";if(RF.includes("Web0S")){var SF=RF.match(/Chrome\/(\d+)/);QF=SF?79<=parseInt(SF[1],10):!1}else QF=!1;var EF=QF;"undefined"!==typeof module&&module.exports&&(module.exports=PF);}).call(exportTo,innerGlobal,innerGlobal,undefined);if(typeof exports!="undefined")for(var k in exportTo.shaka)exports[k]=exportTo.shaka[k];else if(typeof define=="function"&&define.amd)define(function(){return exportTo.shaka});else innerGlobal.shaka=exportTo.shaka})();
|
|
|
|
//# sourceMappingURL=shaka-player.compiled.map
|