shaka-player 4.9.35 → 4.9.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AUTHORS +1 -0
- package/CONTRIBUTORS +1 -0
- package/README.md +9 -3
- package/dist/controls.css +1 -1
- package/dist/controls.css.map +1 -1
- package/dist/deps.js +5 -5
- package/dist/locales.js +36 -36
- package/dist/shaka-player.compiled.d.ts +1 -0
- package/dist/shaka-player.compiled.debug.d.ts +1 -0
- package/dist/shaka-player.compiled.debug.externs.js +4 -3
- package/dist/shaka-player.compiled.debug.js +436 -421
- package/dist/shaka-player.compiled.debug.map +3 -3
- package/dist/shaka-player.compiled.externs.js +4 -3
- package/dist/shaka-player.compiled.js +1263 -1251
- package/dist/shaka-player.compiled.map +3 -3
- package/dist/shaka-player.dash.d.ts +4099 -0
- package/dist/shaka-player.dash.debug.d.ts +4099 -0
- package/dist/shaka-player.dash.debug.externs.js +4188 -0
- package/dist/shaka-player.dash.debug.js +2161 -0
- package/dist/shaka-player.dash.debug.map +8 -0
- package/dist/shaka-player.dash.externs.js +4188 -0
- package/dist/shaka-player.dash.js +1007 -0
- package/dist/shaka-player.dash.map +8 -0
- package/dist/shaka-player.hls.d.ts +4196 -0
- package/dist/shaka-player.hls.debug.d.ts +4196 -0
- package/dist/shaka-player.hls.debug.externs.js +4403 -0
- package/dist/shaka-player.hls.debug.js +2243 -0
- package/dist/shaka-player.hls.debug.map +8 -0
- package/dist/shaka-player.hls.externs.js +4403 -0
- package/dist/shaka-player.hls.js +1076 -0
- package/dist/shaka-player.hls.map +8 -0
- package/dist/shaka-player.ui.d.ts +1 -0
- package/dist/shaka-player.ui.debug.d.ts +1 -0
- package/dist/shaka-player.ui.debug.externs.js +4 -3
- package/dist/shaka-player.ui.debug.js +460 -445
- package/dist/shaka-player.ui.debug.map +3 -3
- package/dist/shaka-player.ui.externs.js +4 -3
- package/dist/shaka-player.ui.js +1462 -1453
- package/dist/shaka-player.ui.map +3 -3
- package/externs/shaka/player.js +8 -4
- package/lib/cast/cast_proxy.js +48 -10
- package/lib/cea/cea708_service.js +9 -16
- package/lib/dash/dash_parser.js +23 -16
- package/lib/dash/segment_template.js +41 -40
- package/lib/hls/hls_parser.js +2 -2
- package/lib/media/content_workarounds.js +110 -72
- package/lib/media/drm_engine.js +72 -11
- package/lib/media/gap_jumping_controller.js +14 -1
- package/lib/media/media_source_engine.js +29 -11
- package/lib/media/region_timeline.js +4 -3
- package/lib/media/streaming_engine.js +37 -11
- package/lib/net/http_plugin_utils.js +1 -1
- package/lib/net/networking_engine.js +8 -0
- package/lib/net/networking_utils.js +1 -0
- package/lib/player.js +109 -37
- package/lib/polyfill/patchedmediakeys_apple.js +21 -0
- package/lib/text/cue.js +6 -2
- package/lib/text/mp4_ttml_parser.js +94 -6
- package/lib/text/ui_text_displayer.js +35 -4
- package/lib/transmuxer/ac3_transmuxer.js +6 -1
- package/lib/util/config_utils.js +13 -3
- package/lib/util/drm_utils.js +8 -0
- package/lib/util/error.js +6 -0
- package/lib/util/mp4_generator.js +19 -4
- package/lib/util/periods.js +4 -2
- package/lib/util/platform.js +60 -12
- package/lib/util/player_configuration.js +6 -1
- package/lib/util/stream_utils.js +18 -0
- package/lib/util/tXml.js +3 -2
- package/package.json +3 -3
- package/ui/controls.js +2 -6
- package/ui/less/thumbnails.less +1 -0
- package/ui/statistics_button.js +3 -1
- package/ui/ui.js +44 -35
|
@@ -0,0 +1,1076 @@
|
|
|
1
|
+
/*
|
|
2
|
+
@license
|
|
3
|
+
Shaka Player
|
|
4
|
+
Copyright 2016 Google LLC
|
|
5
|
+
SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
(function(){var innerGlobal=typeof window!="undefined"?window:global;var exportTo={};(function(window,global,module){/*
|
|
8
|
+
|
|
9
|
+
Copyright The Closure Library Authors.
|
|
10
|
+
SPDX-License-Identifier: Apache-2.0
|
|
11
|
+
*/
|
|
12
|
+
var r;function ca(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}var da="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};
|
|
13
|
+
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&&da(c,a,{configurable:!0,writable:!0,value:b})}}
|
|
14
|
+
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;da(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});
|
|
15
|
+
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]&&da(d.prototype,a,{configurable:!0,writable:!0,value:function(){return ia(ca(this))}})}return a});function ia(a){a={next:a};a[Symbol.iterator]=function(){return this};return a}
|
|
16
|
+
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:ca(a)};throw Error(String(a)+" is not an iterable or ArrayLike");}function y(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;
|
|
17
|
+
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 ra=ka;
|
|
18
|
+
function sa(a,b){a.prototype=ja(b.prototype);a.prototype.constructor=a;if(ra)ra(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.Kh=b.prototype}function ta(){this.o=!1;this.m=null;this.h=void 0;this.g=1;this.j=this.l=0;this.A=this.i=null}function ua(a){if(a.o)throw new TypeError("Generator is already running");a.o=!0}ta.prototype.u=function(a){this.h=a};
|
|
19
|
+
function va(a,b){a.i={Re:b,$e:!0};a.g=a.l||a.j}ta.prototype.return=function(a){this.i={return:a};this.g=this.j};function J(a,b,c){a.g=c;return{value:b}}ta.prototype.s=function(a){this.g=a};function K(a){a.g=0}function wa(a,b,c){a.l=b;void 0!=c&&(a.j=c)}function xa(a,b,c){a.g=b;a.l=c||0}function ya(a,b){a.l=b||0;b=a.i.Re;a.i=null;return b}function za(a){a.A=[a.i];a.l=0;a.j=0}
|
|
20
|
+
function Ba(a,b){var c=a.A.splice(0)[0];(c=a.i=a.i||c)?c.$e?a.g=a.l||a.j:void 0!=c.s&&a.j<c.s?(a.g=c.s,a.i=null):a.g=a.j:a.g=b}function Ca(a){this.g=new ta;this.h=a}function Ea(a,b){ua(a.g);var c=a.g.m;if(c)return Fa(a,"return"in c?c["return"]:function(d){return{value:d,done:!0}},b,a.g.return);a.g.return(b);return Ga(a)}
|
|
21
|
+
function Fa(a,b,c,d){try{var e=b.call(a.g.m,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.m=null,va(a.g,g),Ga(a)}a.g.m=null;d.call(a.g,f);return Ga(a)}function Ga(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.$e)throw b.Re;return{value:b.return,done:!0}}return{value:void 0,done:!0}}
|
|
22
|
+
function Ja(a){this.next=function(b){ua(a.g);a.g.m?b=Fa(a,a.g.m.next,b,a.g.u):(a.g.u(b),b=Ga(a));return b};this.throw=function(b){ua(a.g);a.g.m?b=Fa(a,a.g.m["throw"],b,a.g.u):(va(a.g,b),b=Ga(a));return b};this.return=function(b){return Ea(a,b)};this[Symbol.iterator]=function(){return this}}function Ka(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())})}
|
|
23
|
+
function L(a){return Ka(new Ja(new Ca(a)))}function La(){for(var a=Number(this),b=[],c=a;c<arguments.length;c++)b[c-a]=arguments[c];return b}
|
|
24
|
+
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=
|
|
25
|
+
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.D),reject:g(this.l)}};b.prototype.D=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)}};
|
|
26
|
+
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.u(2,g)};b.prototype.m=function(g){this.u(1,g)};b.prototype.u=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.F();this.A()};b.prototype.F=function(){var g=this;e(function(){if(g.B()){var h=fa.console;"undefined"!==typeof h&&h.error(g.i)}},1)};b.prototype.B=
|
|
27
|
+
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;
|
|
28
|
+
b.prototype.H=function(g){var h=this.j();g.Ec(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,p){return"function"==typeof q?function(u){try{l(q(u))}catch(x){m(x)}}:p}var l,m,n=new b(function(q,p){l=q;m=p});this.Ec(k(g,l),k(h,m));return n};b.prototype.catch=function(g){return this.then(void 0,g)};b.prototype.Ec=function(g,h){function k(){switch(l.h){case 1:g(l.i);break;case 2:h(l.i);
|
|
29
|
+
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).Ec(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(x){q[u]=x;p--;0==p&&l(q)}}var q=[],p=0;do q.push(void 0),p++,d(k.value).Ec(n(q.length-1),m),k=h.next();
|
|
30
|
+
while(!k.done)})};return b});function Ma(a,b){return Object.prototype.hasOwnProperty.call(a,b)}
|
|
31
|
+
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(!Ma(k,g)){var l=new c;da(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({}),
|
|
32
|
+
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(!Ma(k,g))throw Error("WeakMap key fail: "+k);k[g][this.g]=l;return this};b.prototype.get=function(k){return d(k)&&Ma(k,g)?k[g][this.g]:void 0};b.prototype.has=function(k){return d(k)&&Ma(k,
|
|
33
|
+
g)&&Ma(k[g],this.g)};b.prototype.delete=function(k){return d(k)&&Ma(k,g)&&Ma(k[g],this.g)?delete k[g][this.g]:!1};return b});
|
|
34
|
+
ha("Map",function(a){function b(){var h={};return h.ob=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.ob;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&&Ma(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,
|
|
35
|
+
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!=
|
|
36
|
+
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],ob:this[1].ob,head:this[1],key:h,value:k},l.list.push(l.entry),this[1].ob.next=l.entry,this[1].ob=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.ob.next=
|
|
37
|
+
h.entry.next,h.entry.next.ob=h.entry.ob,h.entry.head=null,this.size--,!0):!1};e.prototype.clear=function(){this[0]={};this[1]=this[1].ob=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=
|
|
38
|
+
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});
|
|
39
|
+
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||
|
|
40
|
+
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]=
|
|
41
|
+
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 Na(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.keys",function(a){return a?a:function(){return Na(this,function(b){return b})}});
|
|
42
|
+
function Oa(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{Xe:e,v:f}}return{Xe:-1,v:void 0}}ha("Array.prototype.findIndex",function(a){return a?a:function(b,c){return Oa(this,b,c).Xe}});
|
|
43
|
+
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.values",function(a){return a?a:function(){return Na(this,function(b,c){return c})}});
|
|
44
|
+
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}});
|
|
45
|
+
function Pa(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!==Pa(this,b,"includes").indexOf(b,c||0)}});
|
|
46
|
+
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}});ha("Array.prototype.find",function(a){return a?a:function(b,c){return Oa(this,b,c).v}});
|
|
47
|
+
ha("String.prototype.startsWith",function(a){return a?a:function(b,c){var d=Pa(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}});
|
|
48
|
+
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});
|
|
49
|
+
var Qa="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)Ma(d,e)&&(a[e]=d[e])}return a};ha("Object.assign",function(a){return a||Qa});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("Number.EPSILON",function(){return Math.pow(2,-52)});
|
|
50
|
+
ha("Number.MAX_SAFE_INTEGER",function(){return 9007199254740991});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}});ha("Array.prototype.entries",function(a){return a?a:function(){return Na(this,function(b,c){return[b,c]})}});ha("Number.isNaN",function(a){return a?a:function(b){return"number"===typeof b&&isNaN(b)}});
|
|
51
|
+
ha("String.prototype.repeat",function(a){return a?a:function(b){var c=Pa(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.isFinite",function(a){return a?a:function(b){return"number"!==typeof b?!1:!isNaN(b)&&Infinity!==b&&-Infinity!==b}});ha("Object.entries",function(a){return a?a:function(b){var c=[],d;for(d in b)Ma(b,d)&&c.push([d,b[d]]);return c}});
|
|
52
|
+
ha("String.prototype.endsWith",function(a){return a?a:function(b,c){var d=Pa(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}});var Ra=this||self;function O(a,b){a=a.split(".");var c=Ra;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};/*
|
|
53
|
+
@license
|
|
54
|
+
Shaka Player
|
|
55
|
+
Copyright 2016 Google LLC
|
|
56
|
+
SPDX-License-Identifier: Apache-2.0
|
|
57
|
+
*/
|
|
58
|
+
function Sa(){}function Ta(){};function Ua(a){this.g=Math.exp(Math.log(.5)/a);this.i=this.h=0}Ua.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 Va(a){return a.h/(1-Math.pow(a.g,a.i))};function Wa(){this.h=new Ua(2);this.j=new Ua(5);this.g=0;this.i=128E3;this.l=16E3}Wa.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)};Wa.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)}};Wa.prototype.getBandwidthEstimate=function(a){return this.g<this.i?a:Math.min(Va(this.h),Va(this.j))};function Xa(){}function Ya(){}function Za(){}function $a(a){var b=La.apply(1,arguments);ab.has(a)||(ab.add(a),Za.apply(Xa,y(b)))}function bb(){}function cb(){}var ab=new Set;window.console&&(Za=function(){return console.warn.apply(console,y(La.apply(0,arguments)))},Ya=function(){console.error.apply(console,y(La.apply(0,arguments)))});function db(){this.g={}}r=db.prototype;r.push=function(a,b){this.g.hasOwnProperty(a)?this.g[a].push(b):this.g[a]=[b]};r.get=function(a){return(a=this.g[a])?a.slice():null};r.remove=function(a,b){a in this.g&&(this.g[a]=this.g[a].filter(function(c){return c!=b}),0==this.g[a].length&&delete this.g[a])};r.forEach=function(a){for(var b in this.g)a(b,this.g[b])};r.size=function(){return Object.keys(this.g).length};r.keys=function(){return Object.keys(this.g)};function fb(){this.g=new db}r=fb.prototype;r.release=function(){this.Za();this.g=null};r.G=function(a,b,c,d){this.g&&(a=new gb(a,b,c,d),this.g.push(b,a))};r.Aa=function(a,b,c,d){function e(g){f.Kb(a,b,e);c(g)}var f=this;this.G(a,b,e,d)};r.Kb=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.Kb(),this.g.remove(b,e))}};
|
|
59
|
+
r.Za=function(){if(this.g){var a=this.g,b=[],c;for(c in a.g)b.push.apply(b,y(a.g[c]));a=t(b);for(b=a.next();!b.done;b=a.next())b.value.Kb();this.g.g={}}};O("shaka.util.EventManager",fb);fb.prototype.removeAll=fb.prototype.Za;fb.prototype.unlisten=fb.prototype.Kb;fb.prototype.listenOnce=fb.prototype.Aa;fb.prototype.listen=fb.prototype.G;fb.prototype.release=fb.prototype.release;function gb(a,b,c,d){this.target=a;this.type=b;this.listener=c;this.g=ib(a,d);this.target.addEventListener(b,c,this.g)}
|
|
60
|
+
gb.prototype.Kb=function(){this.target.removeEventListener(this.type,this.listener,this.g);this.listener=this.target=null;this.g=!1};function ib(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 jb(a)?b:b.capture||!1}
|
|
61
|
+
function jb(a){var b=kb;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}kb=b}return b||!1}var kb=void 0;function lb(a){if(mb.has(a))return mb.get(a);if(window.ManagedMediaSource){var b=ManagedMediaSource.isTypeSupported(a);mb.set(a,b);return b}return window.MediaSource?(b=MediaSource.isTypeSupported(a),mb.set(a,b),b):!1}function nb(){var a=window.ManagedSourceBuffer||window.SourceBuffer;return!!a&&!!a.prototype&&!!a.prototype.changeType}var mb=new Map;function ob(a,b){this.g=a;this.h=b}ob.prototype.toString=function(){return"v"+this.g+"."+this.h};function pb(a,b){var c=new ob(5,0),d=qb,e=d.g,f=c.h-e.h;(0<(c.g-e.g||f)?d.i:d.h)(d.g,c,a,b)}function rb(a,b,c,d){Za([c,"has been deprecated and will be removed in",b,". We are currently at version",a,". Additional information:",d].join(" "))}function sb(a,b,c,d){Ya([c,"has been deprecated and has been removed in",b,". We are now at version",a,". Additional information:",d].join(" "))}var qb=null;function tb(){}tb.prototype.extract=function(){};tb.prototype.decode=function(){return[]};tb.prototype.clear=function(){};tb.prototype.getStreams=function(){return[]};function ub(){}ub.prototype.init=function(){};ub.prototype.parse=function(){return[]};function vb(){}function wb(a,b){if(!a&&!b)return!0;if(!a||!b||a.byteLength!=b.byteLength)return!1;if(xb(a)==xb(b)&&(a.byteOffset||0)==(b.byteOffset||0))return!0;var c=yb(a);b=yb(b);for(var d=0;d<a.byteLength;d++)if(c[d]!=b[d])return!1;return!0}function xb(a){return a instanceof ArrayBuffer?a:a.buffer}function zb(a){return a instanceof ArrayBuffer?a:0==a.byteOffset&&a.byteLength==a.buffer.byteLength?a.buffer:(new Uint8Array(a)).buffer}
|
|
62
|
+
function yb(a,b,c){c=void 0===c?Infinity:c;return Ab(a,void 0===b?0:b,c,Uint8Array)}function Bb(a,b,c){c=void 0===c?Infinity:c;return Ab(a,void 0===b?0:b,c,Uint16Array)}function Cb(a,b,c){c=void 0===c?Infinity:c;return Ab(a,void 0===b?0:b,c,DataView)}function Ab(a,b,c,d){var e=xb(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)}
|
|
63
|
+
O("shaka.util.BufferUtils",vb);vb.toDataView=Cb;vb.toUint16=Bb;vb.toUint8=yb;vb.toArrayBuffer=zb;vb.equal=wb;function Db(){}Db.prototype.init=function(){};Db.prototype.i=function(){};Db.prototype.g=function(){};Db.prototype.j=function(){};O("shaka.media.IClosedCaptionParser",Db);function Eb(a){this.l=new ub;if(a=Fb[a.toLowerCase()])this.l=a();this.h=new tb;if(a=Gb)this.h=a()}Eb.prototype.init=function(a,b){(void 0===b?0:b)||this.g();this.l.init(a)};Eb.prototype.i=function(a){a=this.l.parse(a);a=t(a);for(var b=a.next();!b.done;b=a.next()){b=b.value;var c=yb(b.packet);0<c.length&&this.h.extract(c,b.pts)}return this.h.decode()};
|
|
64
|
+
Eb.prototype.g=function(){this.h.clear()};Eb.prototype.j=function(){return this.h.getStreams()};O("shaka.media.ClosedCaptionParser",Eb);Eb.findDecoder=function(){return Gb};Eb.unregisterDecoder=function(){Gb=null};Eb.registerDecoder=function(a){Gb=a};Eb.findParser=function(a){return Fb[a]};Eb.unregisterParser=function(a){delete Fb[a]};Eb.registerParser=function(a,b){Fb[a]=b};var Fb={},Gb=null;function Hb(){this.id="";this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0;this.height=this.width=100;this.viewportAnchorUnits=this.widthUnits=this.heightUnits=Ib;this.scroll=Jb}O("shaka.text.CueRegion",Hb);var Ib=1;Hb.units={PX:0,PERCENTAGE:Ib,LINES:2};var Jb="";Hb.scrollMode={NONE:Jb,UP:"up"};function Kb(a,b){return"number"===typeof a&&"number"===typeof b&&isNaN(a)&&isNaN(b)?!0:a===b}function Lb(a,b){b=a.indexOf(b);-1<b&&a.splice(b,1)}function Mb(a,b){var c;c||(c=Kb);if(a.length!=b.length)return!1;b=b.slice();a=t(a);for(var d=a.next(),e={};!d.done;e={af:void 0},d=a.next()){e.af=d.value;d=b.findIndex(function(f){return function(g){return c(f.af,g)}}(e));if(-1==d)return!1;b[d]=b[b.length-1];b.pop()}return 0==b.length}
|
|
65
|
+
function Nb(a,b,c){c||(c=Kb);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 Pb(a,b,c){this.startTime=a;this.endTime=b;this.payload=c;this.region=new Hb;this.position=null;this.positionAlign=Qb;this.size=0;this.textAlign=Rb;this.direction=Sb;this.writingMode=Tb;this.lineInterpretation=Ub;this.line=null;this.lineHeight="";this.lineAlign=Wb;this.displayAlign=Xb;this.fontSize=this.border=this.backgroundImage=this.backgroundColor=this.color="";this.fontWeight=Yb;this.fontStyle=Zb;this.linePadding=this.letterSpacing=this.fontFamily="";this.opacity=1;this.textCombineUpright=
|
|
66
|
+
"";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={wb:32,rows:15}}function $b(a,b){a=new Pb(a,b,"");a.lineBreak=!0;return a}Pb.prototype.clone=function(){var a=new Pb(0,0,""),b;for(b in this)a[b]=this[b],a[b]&&a[b].constructor==Array&&(a[b]=a[b].slice());return a};
|
|
67
|
+
function ac(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(!Nb(a.nestedCues,b.nestedCues,ac))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(!Nb(a[c],b[c]))return!1}else if(a[c]!=b[c])return!1;return!0}O("shaka.text.Cue",Pb);Pb.equal=ac;Pb.prototype.clone=Pb.prototype.clone;
|
|
68
|
+
var Qb="auto";Pb.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:Qb};var Rb="center",bc={LEFT:"left",RIGHT:"right",CENTER:Rb,START:"start",END:"end"};Pb.textAlign=bc;var Xb="after",cc={BEFORE:"before",CENTER:"center",AFTER:Xb};Pb.displayAlign=cc;var Sb="ltr";Pb.direction={HORIZONTAL_LEFT_TO_RIGHT:Sb,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};var Tb="horizontal-tb";Pb.writingMode={HORIZONTAL_TOP_TO_BOTTOM:Tb,VERTICAL_LEFT_TO_RIGHT:"vertical-lr",VERTICAL_RIGHT_TO_LEFT:"vertical-rl"};
|
|
69
|
+
var Ub=0;Pb.lineInterpretation={LINE_NUMBER:Ub,PERCENTAGE:1};var Wb="start",dc={CENTER:"center",START:Wb,END:"end"};Pb.lineAlign=dc;var ec={white:"white",lime:"lime",cyan:"cyan",red:"red",yellow:"yellow",magenta:"magenta",blue:"blue",black:"black"};Pb.defaultTextColor=ec;var fc={bg_white:"white",bg_lime:"lime",bg_cyan:"cyan",bg_red:"red",bg_yellow:"yellow",bg_magenta:"magenta",bg_blue:"blue",bg_black:"black"};Pb.defaultTextBackgroundColor=fc;var Yb=400;Pb.fontWeight={NORMAL:Yb,BOLD:700};
|
|
70
|
+
var Zb="normal",gc={NORMAL:Zb,ITALIC:"italic",OBLIQUE:"oblique"};Pb.fontStyle=gc;Pb.textDecoration={UNDERLINE:"underline",LINE_THROUGH:"lineThrough",OVERLINE:"overline"};function hc(){}hc.prototype.destroy=function(){};function kc(a,b,c){lc[a.toLowerCase().split(";")[0]+"-"+c]={priority:c,gd:b}}function mc(a,b){for(var c=a.toLowerCase().split(";")[0],d=t([nc,oc,pc,qc]),e=d.next();!e.done;e=d.next())if(e=lc[c+"-"+e.value]){var f=e.gd(),g=f.isSupported(a,b);f.destroy();if(g)return e.gd}return null}O("shaka.transmuxer.TransmuxerEngine",hc);hc.findTransmuxer=mc;hc.unregisterTransmuxer=function(a,b){delete lc[a.toLowerCase().split(";")[0]+"-"+b]};
|
|
71
|
+
hc.registerTransmuxer=kc;hc.prototype.destroy=hc.prototype.destroy;var lc={},qc=1,pc=2,oc=3,nc=4;hc.PluginPriority={FALLBACK:qc,PREFERRED_SECONDARY:pc,PREFERRED:oc,APPLICATION:nc};/*
|
|
72
|
+
@license
|
|
73
|
+
Copyright 2008 The Closure Library Authors
|
|
74
|
+
SPDX-License-Identifier: Apache-2.0
|
|
75
|
+
*/
|
|
76
|
+
var rc=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");/*
|
|
77
|
+
@license
|
|
78
|
+
Copyright 2006 The Closure Library Authors
|
|
79
|
+
SPDX-License-Identifier: Apache-2.0
|
|
80
|
+
*/
|
|
81
|
+
function sc(a){var b;a instanceof sc?(tc(this,a.ib),this.Lb=a.Lb,uc(this,a.lb),wc(this,a.$b),this.Ha=a.Ha,xc(this,a.g.clone()),this.xb=a.xb):a&&(b=String(a).match(rc))?(tc(this,b[1]||"",!0),this.Lb=yc(b[2]||""),uc(this,b[3]||"",!0),wc(this,b[4]),this.Ha=yc(b[5]||"",!0),xc(this,b[6]||"",!0),this.xb=yc(b[7]||"")):this.g=new zc(null)}r=sc.prototype;r.ib="";r.Lb="";r.lb="";r.$b=null;r.Ha="";r.xb="";
|
|
82
|
+
r.toString=function(){var a=[],b=this.ib;b&&a.push(Ac(b,Bc,!0),":");if(b=this.lb){a.push("//");var c=this.Lb;c&&a.push(Ac(c,Bc,!0),"@");a.push(encodeURIComponent(b).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));b=this.$b;null!=b&&a.push(":",String(b))}if(b=this.Ha)this.lb&&"/"!=b.charAt(0)&&a.push("/"),a.push(Ac(b,"/"==b.charAt(0)?Cc:Dc,!0));(b=this.g.toString())&&a.push("?",b);(b=this.xb)&&a.push("#",Ac(b,Ec));return a.join("")};
|
|
83
|
+
r.resolve=function(a){var b=this.clone();"data"===b.ib&&(b=new sc);var c=!!a.ib;c?tc(b,a.ib):c=!!a.Lb;c?b.Lb=a.Lb:c=!!a.lb;c?uc(b,a.lb):c=null!=a.$b;var d=a.Ha;if(c)wc(b,a.$b);else if(c=!!a.Ha){if("/"!=d.charAt(0))if(this.lb&&!this.Ha)d="/"+d;else{var e=b.Ha.lastIndexOf("/");-1!=e&&(d=b.Ha.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(""):".."==
|
|
84
|
+
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.Ha=d:c=""!==a.g.toString();c?xc(b,a.g.clone()):c=!!a.xb;c&&(b.xb=a.xb);return b};r.clone=function(){return new sc(this)};function tc(a,b,c){a.ib=c?yc(b,!0):b;a.ib&&(a.ib=a.ib.replace(/:$/,""))}function uc(a,b,c){a.lb=c?yc(b,!0):b}function wc(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error("Bad port number "+b);a.$b=b}else a.$b=null}
|
|
85
|
+
function xc(a,b,c){b instanceof zc?a.g=b:(c||(b=Ac(b,Fc)),a.g=new zc(b))}function yc(a,b){return a?b?decodeURI(a):decodeURIComponent(a):""}function Ac(a,b,c){return null!=a?(a=encodeURI(a).replace(b,Gc),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null}function Gc(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)}var Bc=/[#\/\?@]/g,Dc=/[#\?:]/g,Cc=/[#\?]/g,Fc=/[#\?@]/g,Ec=/#/g;function zc(a){this.g=a||null}
|
|
86
|
+
function Hc(a){if(!a.za&&(a.za={},a.ec=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," ")))}}r=zc.prototype;r.za=null;r.ec=null;function Ic(a){Hc(a);return a.ec}r.add=function(a,b){Hc(this);this.g=null;var c=this.za.hasOwnProperty(a)?this.za[a]:null;c||(this.za[a]=c=[]);c.push(b);this.ec++;return this};
|
|
87
|
+
r.set=function(a,b){Hc(this);this.g=null;this.za.hasOwnProperty(a)?this.za[a]=[b]:this.add(a,b);return this};r.get=function(a){Hc(this);return this.za[a]||[]};r.toString=function(){if(this.g)return this.g;if(!this.za)return"";var a=[],b;for(b in this.za)for(var c=encodeURIComponent(b),d=this.za[b],e=0;e<d.length;e++){var f=c;""!==d[e]&&(f+="="+encodeURIComponent(d[e]));a.push(f)}return this.g=a.join("&")};
|
|
88
|
+
r.clone=function(){var a=new zc;a.g=this.g;if(this.za){var b={},c;for(c in this.za)b[c]=this.za[c].concat();a.za=b;a.ec=this.ec}return a};function S(a,b,c){var d=La.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(Jc)try{throw Error(this.message||"Shaka Error");}catch(e){this.stack=e.stack}}S.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")};O("shaka.util.Error",S);var Jc=!0;S.Severity={RECOVERABLE:1,CRITICAL:2};S.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9,ADS:10};
|
|
89
|
+
S.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,
|
|
90
|
+
CANNOT_ADD_EXTERNAL_TEXT_TO_SRC_EQUALS:2012,TEXT_ONLY_WEBVTT_SRC_EQUALS:2013,MISSING_TEXT_PLUGIN:2014,CHAPTERS_TRACK_FAILED:2015,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,
|
|
91
|
+
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,UNABLE_TO_GUESS_MANIFEST_TYPE:4E3,DASH_INVALID_XML:4001,DASH_NO_SEGMENT_INFO:4002,DASH_EMPTY_ADAPTATION_SET:4003,DASH_EMPTY_PERIOD:4004,
|
|
92
|
+
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,
|
|
93
|
+
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,
|
|
94
|
+
AES_128_INVALID_KEY_LENGTH:4049,DASH_CONFLICTING_AES_128:4050,DASH_UNSUPPORTED_AES_128:4051,DASH_INVALID_PATCH:4052,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,
|
|
95
|
+
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,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,CAST_API_UNAVAILABLE:8E3,NO_CAST_RECEIVERS:8001,ALREADY_CASTING:8002,UNEXPECTED_CAST_ERROR:8003,CAST_CANCELED_BY_USER:8004,
|
|
96
|
+
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,
|
|
97
|
+
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};function Kc(a){this.h=a;this.g=void 0}Kc.prototype.value=function(){void 0==this.g&&(this.g=this.h());return this.g};function Lc(a,b){return a.length&&b.length&&a!==b?0<Mc(a,b).length:!0}
|
|
98
|
+
function Mc(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(y(d.keyIds),y(f.keyIds))):d.keyIds||f.keyIds;c.push({keySystem:d.keySystem,licenseServerUri:d.licenseServerUri||
|
|
99
|
+
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}}return c}
|
|
100
|
+
function Pc(a){return a?!!a.match(/^com\.(microsoft|chromecast)\.playready/):!1}var Qc=new Kc(function(){return zb(new Uint8Array([0]))}),Rc=new Map;function Sc(a){this.h=a;this.g=null}Sc.prototype.Z=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};Sc.prototype.stop=function(){this.g&&(this.g(),this.g=null)};function Tc(a){this.h=a;this.g=null}Tc.prototype.Ce=function(){this.stop();this.h();return this};Tc.prototype.Z=function(a){var b=this;this.stop();this.g=(new Sc(function(){b.h()})).Z(a);return this};Tc.prototype.Sa=function(a){var b=this;this.stop();this.g=(new Sc(function(){b.g.Z(a);b.h()})).Z(a);return this};Tc.prototype.stop=function(){this.g&&(this.g.stop(),this.g=null)};O("shaka.util.Timer",Tc);Tc.prototype.stop=Tc.prototype.stop;Tc.prototype.tickEvery=Tc.prototype.Sa;
|
|
101
|
+
Tc.prototype.tickAfter=Tc.prototype.Z;Tc.prototype.tickNow=Tc.prototype.Ce;function Uc(){var a=window.ManagedMediaSource||window.MediaSource;return a&&a.isTypeSupported?!0:!1}function Vc(a){return""!=Wc().canPlayType(a)}function Xc(){return navigator.userAgent.match(/Edge?\//)?!0:!1}function Yc(){return Zc("Xbox One")}function $c(){return Zc("Tizen")}function ad(){return Zc("Tizen 3")}function bd(){return Zc("Web0S")}function cd(){return Zc("CrKey")}
|
|
102
|
+
function dd(){if(!Zc("Chrome")||navigator.userAgent.match(/Edge\//))return null;var a=navigator.userAgent.match(/Chrome\/(\d+)/);return a?parseInt(a[1],10):null}function ed(){return!!navigator.vendor&&navigator.vendor.includes("Apple")&&!$c()&&!Zc("PC=EOS")&&!Zc("PC=APL")&&!Zc("PC=APPSTB")&&!Zc("VirginMedia")&&!fd()&&!gd()&&!Zc("AFT")&&!Zc("WPE")&&!Zc("DT_STB_BCM")&&!Zc("Sky_STB")&&!hd()}function id(){return Zc("PlayStation 5")}function gd(){return Zc("PlayStation 4")}
|
|
103
|
+
function jd(){return Zc("Hisense")||Zc("VIDAA")}function fd(){return Zc("SOPOpenBrowser")}function hd(){return Zc("MDMP1001S")||Zc("PS5525IMC")}function kd(){if(!ed())return null;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}
|
|
104
|
+
function nd(){return navigator.userAgentData&&navigator.userAgentData.platform?"macos"==navigator.userAgentData.platform.toLowerCase():navigator.platform?navigator.platform.toLowerCase().includes("mac"):!1}function od(){return navigator.userAgentData&&navigator.userAgentData.platform?"windows"==navigator.userAgentData.platform.toLowerCase():navigator.platform?navigator.platform.toLowerCase().includes("win32"):!1}
|
|
105
|
+
function pd(){return navigator.userAgentData&&navigator.userAgentData.platform?"android"==navigator.userAgentData.platform.toLowerCase():Zc("Android")}function qd(){return navigator.userAgentData&&navigator.userAgentData.platform?"fuchsia"==navigator.userAgentData.platform.toLowerCase():Zc("Fuchsia")}function Zc(a){return(navigator.userAgent||"").includes(a)}
|
|
106
|
+
function Wc(){if(rd)return rd;sd||(sd=new Tc(function(){rd=null}));(rd=document.getElementsByTagName("video")[0]||document.getElementsByTagName("audio")[0])||(rd=document.createElement("video"));sd.Z(1);return rd}
|
|
107
|
+
function td(){var a,b,c,d,e,f,g,h,k,l,m,n,q,p,u,x;return L(function(v){switch(v.g){case 1:a={width:Infinity,height:Infinity};if(cd()){q=window.cast&&cast.__platform__&&cast.__platform__.canDisplayType;a.width=1280;a.height=720;wa(v,14);if(!(p=q)){v.s(16);break}return J(v,cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160'),17)}if($c()){a.width=1920;a.height=1080;try{webapis.systeminfo&&webapis.systeminfo.getMaxVideoResolution?(b=webapis.systeminfo.getMaxVideoResolution(),
|
|
108
|
+
a.width=b.width,a.height=b.height):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(z){Za("Tizen: Error detecting screen size, default screen size 1920x1080.")}v.s(3);break}if(bd()){try{c=JSON.parse(window.PalmSystem.deviceInfo),a.width=Math.max(1920,c.screenWidth),a.height=Math.max(1080,c.screenHeight)}catch(z){Za("WebOS: Error detecting screen size, default screen size 1920x1080."),
|
|
109
|
+
a.width=1920,a.height=1080}v.s(3);break}if(jd()){d=null;if(window.Hisense_Get4KSupportState)try{d=window.Hisense_Get4KSupportState()}catch(z){}null==d&&(d=Zc("UHD"));d?(a.width=3840,a.height=2160):(a.width=1920,a.height=1080);v.s(3);break}if(!gd()&&!id()){e=void 0;try{e="undefined"!==typeof Windows?Windows:chrome.webview.hostObjects.sync.Windows}catch(z){}if(e){a.width=1920;a.height=1080;try{f=new e.Media.Protection.ProtectionCapabilities;g=e.Media.Protection.ProtectionCapabilityResult;h=null;do h=
|
|
110
|
+
f.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(h===g.maybe);h===g.probably&&(a.width=3840,a.height=2160)}catch(z){Za("Xbox: Error detecting screen size, default screen size 1920x1080.")}}else Yc()&&(a.width=1920,a.height=1080,Za("Xbox: Error detecting screen size, default screen size 1920x1080."));v.s(3);
|
|
111
|
+
break}k=!1;wa(v,8);return J(v,window.msdk.device.getDisplayInfo(),10);case 10:l=v.h;k="4K"===l.resolution;xa(v,9);break;case 8:return ya(v),wa(v,11),J(v,window.msdk.device.getDisplayInfoImmediate(),13);case 13:m=v.h;k="4K"===m.resolution;xa(v,9);break;case 11:n=ya(v),Za("PlayStation: Failed to get the display info:",n);case 9:k?(a.width=3840,a.height=2160):(a.width=1920,a.height=1080);v.s(3);break;case 17:p=v.h;case 16:if(p){a.width=3840;a.height=2160;v.s(18);break}if(!(u=q)){v.s(19);break}return J(v,
|
|
112
|
+
cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=1920; height=1080'),20);case 20:u=v.h;case 19:u&&(a.width=1920,a.height=1080);case 18:xa(v,3);break;case 14:x=ya(v),Ya("Failed to check canDisplayType:",x);case 3:return v.return(a)}})}var sd=null,rd=null;function ud(){}
|
|
113
|
+
function vd(a){if(!a)return"";a=yb(a);239==a[0]&&187==a[1]&&191==a[2]&&(a=a.subarray(3));if(window.TextDecoder&&!gd())return a=(new TextDecoder).decode(a),a.includes("\ufffd")&&Ya('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==
|
|
114
|
+
(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}
|
|
115
|
+
function wd(a,b,c){if(!a)return"";if(!c&&0!=a.byteLength%2)throw new S(2,2,2004);c=Math.floor(a.byteLength/2);var d=new Uint16Array(c);a=Cb(a);for(var e=0;e<c;e++)d[e]=a.getUint16(2*e,b);return xd(d)}
|
|
116
|
+
function yd(a){function b(d){return c.byteLength<=d||32<=c[d]&&126>=c[d]}if(!a)return"";var c=yb(a);if(239==c[0]&&187==c[1]&&191==c[2])return vd(c);if(254==c[0]&&255==c[1])return wd(c.subarray(2),!1);if(255==c[0]&&254==c[1])return wd(c.subarray(2),!0);if(0==c[0]&&0==c[2])return wd(a,!1);if(0==c[1]&&0==c[3])return wd(a,!0);if(b(0)&&b(1)&&b(2)&&b(3))return vd(a);throw new S(2,2,2003);}
|
|
117
|
+
function zd(a){if(window.TextEncoder&&!gd()){var b=new TextEncoder;return zb(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 zb(b)}function Ad(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 xd(a){return Bd.value()(a)}
|
|
118
|
+
function Cd(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||""}O("shaka.util.StringUtils",ud);ud.resetFromCharCode=function(){Bd.g=void 0};
|
|
119
|
+
ud.toUTF16=Ad;ud.toUTF8=zd;ud.fromBytesAutoDetect=yd;ud.fromUTF16=wd;ud.fromUTF8=vd;var Bd=new Kc(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={sb:65536};0<b.sb;b={sb:b.sb},b.sb/=2)if(a(b.sb))return function(c){return function(d){for(var e="",f=0;f<d.length;f+=c.sb)e+=String.fromCharCode.apply(null,d.subarray(f,f+c.sb));return e}}(b);return null});function Dd(){}function Ed(a){a=xd(yb(a));return btoa(a)}function Fd(a,b){b=void 0==b?!0:b;a=Ed(a).replace(/\+/g,"-").replace(/\//g,"_");return b?a:a.replace(/[=]*$/,"")}function Gd(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 Hd(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}
|
|
120
|
+
function Id(a){var b=yb(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 Jd(){for(var a=La.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];e instanceof Uint8Array?b.set(e,c):b.set(yb(e),c);c+=e.byteLength}return b}O("shaka.util.Uint8ArrayUtils",Dd);Dd.concat=Jd;Dd.toHex=Id;Dd.fromHex=Hd;Dd.fromBase64=Gd;Dd.toBase64=Fd;Dd.toStandardBase64=Ed;function Kd(a,b){if(0==b.length)return a;if(1==a.length&&1==b.length){var c=new sc(a[0]);b=new sc(b[0]);return[c.resolve(b).toString()]}b=b.map(function(g){return new sc(g)});c=[];a=t(a);for(var d=a.next();!d.done;d=a.next()){d=new sc(d.value);for(var e=t(b),f=e.next();!f.done;f=e.next())c.push(d.resolve(f.value).toString())}return c}
|
|
121
|
+
function Ld(a,b,c){return{keySystem:a,encryptionScheme:b,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:c||[],keyIds:new Set}}
|
|
122
|
+
function Md(a,b){b=void 0===b?"cenc":b;var c=[],d=[],e=[];a.forEach(function(g,h){var k=h;22!=k.length&&(k=Fd(Hd(h),!1));var l=g;22!=l.length&&(l=Fd(Hd(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:yb(zd(f)),initDataType:"keyids"}];return{keySystem:"org.w3.clearkey",encryptionScheme:b,licenseServerUri:"data:application/json;base64,"+window.btoa(a),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,
|
|
123
|
+
audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:f,keyIds:new Set(e)}}function Nd(a,b){if(1==b.length)return b[0];a=Od(a,b);if(null!=a)return a;throw new S(2,4,4025,b);}function Od(a,b){for(var c=t(Pd[a]),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==Qd?"":null}
|
|
124
|
+
function Rd(a,b){var c=[];a=t(Pd[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 Qd="text",Sd={da:"video",S:"audio",pa:Qd,Nf:"image",xh:"application"},Pd={audio:[/^vorbis$/,/^Opus$/,/^opus$/,/^fLaC$/,/^flac$/,/^mp4a/,/^[ae]c-3$/,/^ac-4/,/^dts[cex]$/,/^iamf/,/^mhm[12]/],video:[/^avc/,/^hev/,/^hvc/,/^vvc/,/^vvi/,/^vp0?[89]/,/^av01/,/^dvh/,/^dva/,/^dav/],text:[/^vtt$/,/^wvtt/,/^stpp/]};function Td(){}function Ud(a,b){var c=a;b&&!Vd.includes(a)&&(c+='; codecs="'+b+'"');return c}function Wd(a,b){b&&(a+='; codecs="'+b+'"');return a}function Xd(a,b,c){var d=Ud(a,b);b=Wd(a,b);mc(b)?(a=mc(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}
|
|
125
|
+
function Yd(a,b,c){var d=[b];Zd.forEach(function(e,f){var g=a[f];"codecs"==f?Vd.includes(a.mimeType)||d.push('codecs="'+c+'"'):g&&d.push(e+'="'+g+'"')});"PQ"==a.hdr&&d.push('eotf="smpte2084"');return d.join(";")}function $d(a){return a.split(";")[0].split("/")[1]}
|
|
126
|
+
function ae(a){var b=be(a);a=b[0];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:return"ac-3";case "mp4a"===a&&"a6"===b:return"ec-3";case "mp4a"===
|
|
127
|
+
a&&"b2"===b:return"dtsx";case "mp4a"===a&&"a9"===b:return"dtsc";case "vp09"===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"dovi-hevc";case "dvav"===a:case "dva1"===a:return"dovi-avc";case "dav1"===a:return"dovi-av1"}return a}function ce(a){var b=[];a=t(a.split(","));for(var c=a.next();!c.done;c=a.next())c=be(c.value),b.push(c[0]);return b.sort().join(",")}
|
|
128
|
+
function ie(a){return a.split(";")[0]}function je(a){a=a.split(/ *; */);a.shift();return(a=a.find(function(b){return b.startsWith("codecs=")}))?a.split("=")[1].replace(/^"|"$/g,""):""}function ke(a){return"application/x-mpegurl"===a||"application/vnd.apple.mpegurl"===a}function be(a){a=a.split(".");var b=a[0];a.shift();return[b,a.join(".")]}O("shaka.util.MimeUtils",Td);Td.getFullTypeWithAllCodecs=Wd;Td.getFullType=Ud;
|
|
129
|
+
var Zd=(new Map).set("codecs","codecs").set("frameRate","framerate").set("bandwidth","bitrate").set("width","width").set("height","height").set("channelsCount","channels"),Vd=["audio/aac","audio/ac3","audio/ec3","audio/mpeg"];function le(a){this.i=null;this.j=a;this.B=!1;this.l=this.u=0;this.m=Infinity;this.h=this.g=null;this.C="";this.A=function(){};this.o=new Map}function me(a){return ne[a]?!0:"application/cea-608"==a||"application/cea-708"==a?!!Gb:!1}le.prototype.destroy=function(){this.j=this.i=null;this.o.clear();return Promise.resolve()};
|
|
130
|
+
function oe(a,b,c,d,e){var f,g,h,k,l,m,n;return L(function(q){if(1==q.g)return J(q,Promise.resolve(),2);if(!a.i||!a.j)return q.return();if(null==c||null==d)return a.i.parseInit(yb(b)),q.return();f=a.B?c:a.u;g={periodStart:a.u,segmentStart:c,segmentEnd:d,vttOffset:f};h=a.i.parseMedia(yb(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(p){return p.startTime>=a.l&&p.startTime<a.m});a.j.append(n);null==a.g&&(a.g=Math.max(c,a.l));a.h=Math.min(d,a.m);K(q)})}
|
|
131
|
+
le.prototype.remove=function(a,b){var c=this;return L(function(d){if(1==d.g)return J(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));K(d)})};function pe(a,b,c){a.l=b;a.m=c}function qe(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)}
|
|
132
|
+
function re(a,b,c){b.startTime+=c;b.endTime+=c;b=t(b.nestedCues);for(var d=b.next();!d.done;d=b.next())re(a,d.value,c)}
|
|
133
|
+
function se(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,[]);re(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,
|
|
134
|
+
a.l):Math.min(a.g,Math.max(c,a.l));a.h=Math.max(a.h,Math.min(d,a.m))}O("shaka.text.TextEngine",le);le.prototype.destroy=le.prototype.destroy;le.findParser=function(a){return ne[a]};le.unregisterParser=function(a){delete ne[a]};le.registerParser=function(a,b){ne[a]=b};var ne={};function te(a,b){return a.concat(b)}function ue(){}function ve(a){return null!=a}function we(a){return Promise.race([a,new Promise(function(b,c){(new Tc(c)).Z(1)})])};function xe(){}function ye(a,b){a=ze(a);b=ze(b);return a.split("-")[0]==b.split("-")[0]}function Ae(a,b){a=ze(a);b=ze(b);a=a.split("-");b=b.split("-");return a[0]==b[0]&&1==a.length&&2==b.length}function Be(a,b){a=ze(a);b=ze(b);a=a.split("-");b=b.split("-");return 2==a.length&&2==b.length&&a[0]==b[0]}
|
|
135
|
+
function ze(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=Ce.get(b)||b;c=c.toUpperCase();return(c?b+"-"+c:b)+(a?"-"+a:"")}function De(a,b){a=ze(a);b=ze(b);return b==a?4:Ae(b,a)?3:Be(b,a)?2:Ae(a,b)?1:0}function Ee(a){var b=a.indexOf("-");a=0<=b?a.substring(0,b):a;a=a.toLowerCase();return a=Ce.get(a)||a}
|
|
136
|
+
function Fe(a){return a.language?ze(a.language):a.audio&&a.audio.language?ze(a.audio.language):a.video&&a.video.language?ze(a.video.language):"und"}
|
|
137
|
+
function Ge(a,b){a=ze(a);var c=new Set;b=t(b);for(var d=b.next();!d.done;d=b.next())c.add(ze(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,Ae(d,a))return d;b=t(c);for(d=b.next();!d.done;d=b.next())if(d=d.value,Be(d,a))return d;c=t(c);for(b=c.next();!b.done;b=c.next())if(b=b.value,Ae(a,b))return b;return null}O("shaka.util.LanguageUtils",xe);xe.findClosestLocale=Ge;xe.getLocaleForVariant=Fe;
|
|
138
|
+
xe.getLocaleForText=function(a){return ze(a.language||"und")};xe.getBase=Ee;xe.relatedness=De;xe.areSiblings=function(a,b){var c=Ee(a),d=Ee(b);return a!=c&&b!=d&&c==d};xe.normalize=ze;xe.isSiblingOf=Be;xe.isParentOf=Ae;xe.areLanguageCompatible=ye;xe.areLocaleCompatible=function(a,b){a=ze(a);b=ze(b);return a==b};
|
|
139
|
+
var Ce=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",
|
|
140
|
+
"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",
|
|
141
|
+
"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",
|
|
142
|
+
"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",
|
|
143
|
+
"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",
|
|
144
|
+
"vi"],["vol","vo"],["wel","cy"],["wln","wa"],["wol","wo"],["xho","xh"],["yid","yi"],["yor","yo"],["zha","za"],["zho","zh"],["zul","zu"]]);function He(a){function b(d){switch(typeof d){case "undefined":case "boolean":case "number":case "string":case "symbol":case "function":return d;default:if(!d||d.buffer instanceof ArrayBuffer)return d;if(c.has(d))return null;var e=d.constructor==Array;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)}
|
|
145
|
+
function Ie(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=Ie(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=Ie(e))&&b.push(d+":"+e);a="{"+b.join(",")+"}"}else a=JSON.stringify(a);return a};function Je(){}
|
|
146
|
+
function Ke(a,b,c,d){var e=a.variants;if(b.length||c.length)e=Le(e,b,c);if(d.length){b=new db;e=t(e);for(c=e.next();!c.done;c=e.next())c=c.value,b.push(String(c.video.width||0),c);var f=[];b.forEach(function(u,x){u=0;var v=[];x=t(x);for(var z=x.next(),w={};!z.done;w={nd:void 0},z=x.next())w.nd=z.value,z=d.filter(function(E){return function(F){return E.nd.decodingInfos[0][F]}}(w)).length,z>u?(u=z,v=[w.nd]):z==u&&v.push(w.nd);f.push.apply(f,y(v))});e=f}c=new Set;b=new Set;e=t(e);for(var g=e.next();!g.done;g=
|
|
147
|
+
e.next())g=g.value,g.audio&&c.add(g.audio),g.video&&b.add(g.video);c=Array.from(c).sort(function(u,x){return u.bandwidth-x.bandwidth});var h=[];e=new Map;c=t(c);for(g=c.next();!g.done;g=c.next()){g=g.value;var k=g.language+(g.channelsCount||0)+(g.audioSamplingRate||0)+g.roles.join(",")+g.label+g.groupId+g.fastSwitching,l=e.get(k)||[];if(l.length){var m=l[l.length-1],n=ae(m.codecs),q=ae(g.codecs);n!=q||g.bandwidth&&m.bandwidth&&!(g.bandwidth>m.bandwidth)||(l.push(g),h.push(g.id))}else l.push(g),h.push(g.id);
|
|
148
|
+
e.set(k,l)}c=Array.from(b).sort(function(u,x){return u.bandwidth&&x.bandwidth?u.bandwidth-x.bandwidth:u.width-x.width});b=nb();var p=[];e=new Map;c=t(c);for(g=c.next();!g.done;g=c.next()){g=g.value;k=Math.round(g.frameRate||0)+(g.hdr||"")+g.fastSwitching;l=e.get(k)||[];if(l.length){m=l[l.length-1];if(!b&&(n=ae(m.codecs),q=ae(g.codecs),n!==q))continue;g.width>m.width||g.height>m.height?(l.push(g),p.push(g.id)):g.width==m.width&&g.height==m.height&&(n=ae(m.codecs),q=ae(g.codecs),n!=q||g.bandwidth&&
|
|
149
|
+
m.bandwidth&&!(g.bandwidth>m.bandwidth)||(l.push(g),p.push(g.id)))}else l.push(g),p.push(g.id);e.set(k,l)}a.variants=a.variants.filter(function(u){var x=u.audio;u=u.video;return x&&!h.includes(x.id)||u&&!p.includes(u.id)?!1:!0})}
|
|
150
|
+
function Le(a,b,c){b=t(b);for(var d=b.next(),e={};!d.done;e={Hf:void 0},d=b.next())if(e.Hf=d.value,d=a.filter(function(f){return function(g){return g.video&&g.video.codecs.startsWith(f.Hf)}}(e)),d.length){a=d;break}c=t(c);b=c.next();for(d={};!b.done;d={Ke:void 0},b=c.next())if(d.Ke=b.value,b=a.filter(function(f){return function(g){return g.audio&&g.audio.codecs.startsWith(f.Ke)}}(d)),b.length){a=b;break}return a}
|
|
151
|
+
function Me(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)||
|
|
152
|
+
!d(a.bandwidth,b.minBandwidth,b.maxBandwidth)?!1:!0}function Ne(a,b,c){var d=!1;a=t(a);for(var e=a.next();!e.done;e=a.next()){e=e.value;var f=e.allowedByApplication;e.allowedByApplication=Me(e,b,c);f!=e.allowedByApplication&&(d=!0)}return d}function Oe(a,b,c){c=void 0===c?[]:c;return L(function(d){if(1==d.g)return J(d,Pe(a,b,0<b.offlineSessionIds.length,c),2);Qe(b);return J(d,Re(b),0)})}
|
|
153
|
+
function Pe(a,b,c,d){var e,f;return L(function(g){if(1==g.g)return Yc()&&Se(b.variants),J(g,Te(b.variants,c,!1,d),2);e=null;a&&(f=a.g)&&(e=f.keySystem);b.variants=b.variants.filter(function(h){var k=Ue(h,e);if(!k){var l=[];h.audio&&l.push(Ve(h.audio));h.video&&l.push(Ve(h.video))}return k});K(g)})}
|
|
154
|
+
function Se(a){var b={dvav:"avc3",dva1:"avc1",dvhe:"hev1",dvh1:"hvc1"},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(Object.keys(b));for(var e=d.next();!e.done;e=d.next())if(e=e.value,a.codecs.includes(e)){a.codecs=a.codecs.replace(e,b[e]);break}}}
|
|
155
|
+
function Ue(a,b){if(!a.decodingInfos.some(function(h){return!h.supported||b&&(h=h.keySystemAccess)&&h.keySystem!=b?!1:!0}))return!1;var c=Yc(),d=Zc("Firefox")&&pd(),e=a.video,f=e&&e.width||0,g=e&&e.height||0;if(c&&e&&(1920<f||1080<g)&&(e.codecs.includes("avc1.")||e.codecs.includes("avc3.")))return!1;a=a.audio;return d&&a&&a.encrypted&&a.codecs.toLowerCase().includes("opus")?!1:!0}
|
|
156
|
+
function We(a,b){var c,d,e,f,g,h,k;return L(function(l){if(1==l.g){c=function(m,n){if(m){var q={},p;for(p in m)q[p]=m[p];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,Dc:void 0},g=f.next())k=g.value,h.Dc=Ie(k),h.cache=Xe,h.cache[h.Dc]?d=c(d,h.cache[h.Dc]):e.push(Ye(k).then(function(m){return function(n){var q=
|
|
157
|
+
null;n=t(n||[]);for(var p=n.next();!p.done;p=n.next())q=c(q,p.value);q&&(m.cache[m.Dc]=q,d=c(d,q))}}(h)));return J(l,Promise.all(e),2)}d&&a.decodingInfos.push(d);K(l)})}
|
|
158
|
+
function Ye(a){var b=[""];a.video&&(b=je(a.video.contentType).split(","));var c=[""];a.audio&&(c=je(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={Pb:void 0},g=f.next())g=g.value,h.Pb=He(a),a.video&&(h.Pb.video.contentType=Ud(ie(h.Pb.video.contentType),e)),a.audio&&(h.Pb.audio.contentType=Ud(ie(h.Pb.audio.contentType),g)),d.push(new Promise(function(k){return function(l,m){we(navigator.mediaCapabilities.decodingInfo(k.Pb)).then(function(n){l(n)}).catch(m)}}(h)))}return Promise.all(d).catch(function(){JSON.stringify(a);
|
|
159
|
+
return null})}
|
|
160
|
+
function Te(a,b,c,d){var e,f,g,h,k,l,m,n,q,p,u,x,v,z,w,E,F,D,I;return L(function(A){switch(A.g){case 1:if(e=a.some(function(C){return C.decodingInfos.length}))return A.return();f=t(d);g=f.next();h={};case 2:if(g.done){A.s(4);break}h.pf=g.value;k=!1;l=t(a);m=l.next();case 5:if(m.done){A.s(7);break}n=m.value;q=Ze(n,b,c).filter(function(C){return function(B){B=B[0];return(B.keySystemConfiguration&&B.keySystemConfiguration.keySystem)===C.pf}}(h));p=t(q);u=p.next();case 8:if(u.done){A.s(10);break}x=u.value;
|
|
161
|
+
return J(A,We(n,x),9);case 9:u=p.next();A.s(8);break;case 10:n.decodingInfos.length&&(k=!0);m=l.next();A.s(5);break;case 7:if(k)return A.return();h={pf:void 0};g=f.next();A.s(2);break;case 4:v=t(a),z=v.next();case 12:if(z.done){A.s(0);break}w=z.value;E=Ze(w,b,c).filter(function(C){C=C[0];C=C.keySystemConfiguration&&C.keySystemConfiguration.keySystem;return!C||!d.includes(C)});F=t(E);D=F.next();case 15:if(D.done){z=v.next();A.s(12);break}I=D.value;return J(A,We(w,I),16);case 16:D=F.next(),A.s(15)}})}
|
|
162
|
+
function Ze(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=je(k);if(l.includes(",")&&!d){var m=l.split(","),n=ie(k);l=Nd("video",m);m=Nd("audio",m);m=$e(m,n);n=Xd(n,m,"audio");g.push({contentType:n,channels:2,bitrate:a.bandwidth||1,samplerate:1,spatialRendering:!1})}l=af(l);k={contentType:Xd(ie(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=
|
|
163
|
+
"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=ie(l),l=$e(je(l),k),k=Xd(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=
|
|
164
|
+
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;l=[];n=t(h);for(m=n.next();!m.done;m=
|
|
165
|
+
n.next()){m=Object.assign({},m.value);var q=c.get(k),p={keySystem:k,initDataType:"cenc",persistentState:g,distinctiveIdentifier:"optional",sessionTypes:b};q=t(q);for(var u=q.next();!u.done;u=q.next()){u=u.value;if(u.initData&&u.initData.length){for(var x=new Set,v=t(u.initData),z=v.next();!z.done;z=v.next())x.add(z.value.initDataType);p.initDataType=u.initData[0].initDataType}u.distinctiveIdentifierRequired&&(p.distinctiveIdentifier="required");u.persistentStateRequired&&(p.persistentState="required");
|
|
166
|
+
u.sessionType&&(p.sessionTypes=[u.sessionType]);d&&(p.audio?(u.encryptionScheme&&(p.audio.encryptionScheme=p.audio.encryptionScheme||u.encryptionScheme),p.audio.robustness=p.audio.robustness||u.audioRobustness):(p.audio={robustness:u.audioRobustness},u.encryptionScheme&&(p.audio.encryptionScheme=u.encryptionScheme)),""==p.audio.robustness&&delete p.audio.robustness);e&&(p.video?(u.encryptionScheme&&(p.video.encryptionScheme=p.video.encryptionScheme||u.encryptionScheme),p.video.robustness=p.video.robustness||
|
|
167
|
+
u.videoRobustness):(p.video={robustness:u.videoRobustness},u.encryptionScheme&&(p.video.encryptionScheme=u.encryptionScheme)),""==p.video.robustness&&delete p.video.robustness)}m.keySystemConfiguration=p;l.push(m)}a.push(l)}return a}function $e(a,b){return"flac"==a.toLowerCase()?kd()?"fLaC":"flac":"opus"===a.toLowerCase()?kd()?"mp4"==$d(b)?"Opus":"opus":"opus":"ac-3"==a.toLowerCase()&&ad()?"ec-3":a}
|
|
168
|
+
function af(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 Qe(a){a.textStreams=a.textStreams.filter(function(b){b=Ud(b.mimeType,b.codecs);return me(b)})}
|
|
169
|
+
function Re(a){var b,c,d,e,f,g,h,k;return L(function(l){switch(l.g){case 1:b=[],c=t(a.imageStreams),d=c.next();case 2:if(d.done){l.s(4);break}e=d.value;f=e.mimeType;"application/mp4"==f&&"mjpg"==e.codecs&&(f="image/jpg");if(bf.has(f)){l.s(5);break}g=cf.get(f);if(!g){bf.set(f,!1);l.s(5);break}return J(l,df(g),7);case 7:h=l.h,bf.set(f,h);case 5:(k=bf.get(f))&&b.push(e);d=c.next();l.s(2);break;case 4:a.imageStreams=b,K(l)}})}
|
|
170
|
+
function df(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)}})}
|
|
171
|
+
function ef(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=[];g&&h.push(g);f&&h.push(f);var 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,
|
|
172
|
+
kind:l,width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,colorGamut:null,videoLayout:null,mimeType:k,audioMimeType:d,videoMimeType:e,codecs:h.join(", "),audioCodec:f,videoCodec:g,primary:a.primary,roles:Array.from(m),audioRoles:null,forced:!1,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null,originalImageId:null,accessibilityPurpose:null,
|
|
173
|
+
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,g.includes(","))){a.channelsCount=c.channelsCount;a.audioSamplingRate=c.audioSamplingRate;a.spatialAudio=c.spatialAudio;a.originalLanguage=c.originalLanguage;a.audioMimeType=e;c=g.split(",");
|
|
174
|
+
try{a.videoCodec=Nd("video",c),a.audioCodec=Nd("audio",c)}catch(p){}}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);return a}
|
|
175
|
+
function ff(a){return{id:a.id,active:!1,type:Qd,bandwidth:0,language:a.language,label:a.label,kind:a.kind||null,width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,colorGamut:null,videoLayout:null,mimeType:a.mimeType,audioMimeType:null,videoMimeType:null,codecs:a.codecs||null,audioCodec:null,videoCodec:null,primary:a.primary,roles:a.roles,audioRoles:null,forced:a.forced,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,
|
|
176
|
+
videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:a.originalId,originalImageId:null,accessibilityPurpose:a.accessibilityPurpose,originalLanguage:a.originalLanguage}}
|
|
177
|
+
function gf(a){var b=a.width||null,c=a.height||null,d=null;a.segmentIndex&&(d=a.segmentIndex.get(0));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,active:!1,type:"image",bandwidth:a.bandwidth||0,language:"",label:null,kind:null,width:b,height:c,frameRate:null,pixelAspectRatio:null,hdr:null,colorGamut:null,videoLayout:null,mimeType:a.mimeType,audioMimeType:null,videoMimeType:null,codecs:a.codecs||null,audioCodec:null,
|
|
178
|
+
videoCodec:null,primary:!1,roles:[],audioRoles:null,forced:!1,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:e||null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null,originalImageId:a.originalId,accessibilityPurpose:null,originalLanguage:null}}function hf(a){a.__shaka_id||(a.__shaka_id=jf++);return a.__shaka_id}
|
|
179
|
+
function kf(a){var b=lf(a);b.active="disabled"!=a.mode;b.type="text";b.originalTextId=a.id;"captions"==a.kind&&(b.mimeType="unknown");"subtitles"==a.kind&&(b.mimeType="text/vtt");a.kind&&(b.roles=[a.kind]);"forced"==a.kind&&(b.forced=!0);return b}function mf(a){var b=lf(a);b.active=a.enabled;b.type="variant";b.originalAudioId=a.id;"main"==a.kind&&(b.primary=!0);a.kind&&(b.roles=[a.kind],b.audioRoles=[a.kind],b.label=a.label);return b}
|
|
180
|
+
function lf(a){var b=a.language;return{id:hf(a),active:!1,type:"",bandwidth:0,language:ze(b||"und"),label:a.label,kind:a.kind,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:!1,roles:[],forced:!1,audioRoles:null,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,
|
|
181
|
+
originalVideoId:null,originalAudioId:null,originalTextId:null,originalImageId:null,accessibilityPurpose:null,originalLanguage:b}}function rf(a){return a.allowedByApplication&&a.allowedByKeySystem&&0==a.disabledUntilTime}function sf(a){return a.filter(function(b){return rf(b)})}
|
|
182
|
+
function tf(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=Ge(ze(b),a.map(function(k){return k.language}));h&&(e=a.filter(function(k){return ze(k.language)==h}))}e=e.filter(function(k){return k.forced==d});if(c){if(a=uf(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(te,[]);return a.length?
|
|
183
|
+
uf(e,a[0]):e}function uf(a,b){return a.filter(function(c){return c.roles.includes(b)})}function Ve(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"}O("shaka.util.StreamUtils",Je);Je.meetsRestrictions=Me;
|
|
184
|
+
var Xe={},jf=0,bf=(new Map).set("image/svg+xml",!0).set("image/png",!0).set("image/jpeg",!0).set("image/jpg",!0),cf=(new Map).set("image/webp","data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA").set("image/avif","data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=");function vf(){var a=this;this.A=null;this.j=!1;this.i=new Wa;this.D=new fb;navigator.connection&&navigator.connection.addEventListener&&this.D.G(navigator.connection,"change",function(){if(a.j&&a.g.useNetworkInformation){a.i=new Wa;a.g&&a.i.configure(a.g.advanced);var b=a.chooseVariant();b&&navigator.onLine&&a.A(b,a.g.clearBufferSwitch,a.g.safeMarginSwitch)}});this.u=[];this.B=1;this.F=!1;this.h=this.o=this.g=this.l=null;this.C=new Tc(function(){if(a.j&&a.g.restrictToElementSize){var b=a.chooseVariant();
|
|
185
|
+
b&&a.A(b,a.g.clearBufferSwitch,a.g.safeMarginSwitch)}});this.m=null}r=vf.prototype;r.stop=function(){this.A=null;this.j=!1;this.u=[];this.B=1;this.o=this.l=null;this.h&&(this.h.disconnect(),this.h=null);this.C.stop();this.m=null};r.release=function(){this.D.release();this.C=null};r.init=function(a){this.A=a};
|
|
186
|
+
r.chooseVariant=function(a){a=void 0===a?!1:a;var b=Infinity,c=Infinity;this.g.restrictToScreenSize&&(c=this.g.ignoreDevicePixelRatio?1:window.devicePixelRatio,b=window.screen.height*c,c*=window.screen.width);if(this.h&&this.g.restrictToElementSize){var d=this.g.ignoreDevicePixelRatio?1:window.devicePixelRatio;b=Math.min(b,this.o.clientHeight*d);c=Math.min(c,this.o.clientWidth*d)}var e=this.u.filter(function(l){return l&&!(l.audio&&l.audio.fastSwitching||l.video&&l.video.fastSwitching)});e.length||
|
|
187
|
+
(e=this.u);d=e;a&&e.length!=this.u.length&&(d=this.u.filter(function(l){return l&&(l.audio&&l.audio.fastSwitching||l.video&&l.video.fastSwitching?!0:!1)}));a=wf(this,this.g.restrictions,d,Infinity,Infinity);if(Infinity!=b||Infinity!=c){a=xf(a);a=t(a);for(e=a.next();!e.done;e=a.next())if(e=e.value,e.height>=b&&e.width>=c){b=e.height;c=e.width;break}a=wf(this,this.g.restrictions,d,b,c)}b=this.getBandwidthEstimate();d.length&&!a.length&&(a=wf(this,null,d,Infinity,Infinity),a=[a[0]]);c=a[0]||null;for(d=
|
|
188
|
+
0;d<a.length;d++){e=a[d];for(var f=isNaN(this.B)?1:Math.abs(this.B),g=f*e.bandwidth/this.g.bandwidthDowngradeTarget,h={bandwidth:Infinity},k=d+1;k<a.length;k++)if(e.bandwidth!=a[k].bandwidth){h=a[k];break}f=f*h.bandwidth/this.g.bandwidthUpgradeTarget;b>=g&&b<=f&&(c.bandwidth!=e.bandwidth||c.bandwidth==e.bandwidth&&c.video&&e.video&&(c.video.width<e.video.width||c.video.height<e.video.height))&&(c=e)}this.l=Date.now();return c};r.enable=function(){this.j=!0};r.disable=function(){this.j=!1};
|
|
189
|
+
r.segmentDownloaded=function(a,b,c){a<this.g.cacheLoadThreshold||(this.i.sample(a,b),c&&null!=this.l&&this.j&&yf(this))};r.trySuggestStreams=function(){null!=this.l&&this.j&&yf(this)};r.getBandwidthEstimate=function(){var a=this.g.defaultBandwidthEstimate;navigator.connection&&navigator.connection.downlink&&this.g.useNetworkInformation&&(a=1E6*navigator.connection.downlink);a=this.i.getBandwidthEstimate(a);return this.m?this.m.getBandwidthEstimate(a):a};r.setVariants=function(a){this.u=a};
|
|
190
|
+
r.playbackRateChanged=function(a){this.B=a};r.setMediaElement=function(a){var b=this;this.o=a;this.h&&(this.h.disconnect(),this.h=null);this.o&&"ResizeObserver"in window&&(this.h=new ResizeObserver(function(){b.C.Z(zf)}),this.h.observe(this.o))};r.setCmsdManager=function(a){this.m=a};r.configure=function(a){this.g=a;this.i&&this.g&&this.i.configure(this.g.advanced)};
|
|
191
|
+
function yf(a){if(!a.F){var b=a.i;if(!(b.g>=b.i))return;a.F=!0;a.l-=1E3*(a.g.switchInterval-a.g.minTimeToSwitch)}Date.now()-a.l<1E3*a.g.switchInterval||(b=a.chooseVariant(),a.getBandwidthEstimate(),b&&a.A(b,a.g.clearBufferSwitch,a.g.safeMarginSwitch))}function wf(a,b,c,d,e){if(a.m){var f=a.m.Ve();f&&(c=c.filter(function(g){return g.bandwidth&&f?g.bandwidth<=f:!0}))}b&&(c=c.filter(function(g){return Me(g,b,{width:e,height:d})}));return c.sort(function(g,h){return g.bandwidth-h.bandwidth})}
|
|
192
|
+
function xf(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})}O("shaka.abr.SimpleAbrManager",vf);vf.prototype.configure=vf.prototype.configure;vf.prototype.setCmsdManager=vf.prototype.setCmsdManager;vf.prototype.setMediaElement=vf.prototype.setMediaElement;vf.prototype.playbackRateChanged=vf.prototype.playbackRateChanged;vf.prototype.setVariants=vf.prototype.setVariants;
|
|
193
|
+
vf.prototype.getBandwidthEstimate=vf.prototype.getBandwidthEstimate;vf.prototype.trySuggestStreams=vf.prototype.trySuggestStreams;vf.prototype.segmentDownloaded=vf.prototype.segmentDownloaded;vf.prototype.disable=vf.prototype.disable;vf.prototype.enable=vf.prototype.enable;vf.prototype.chooseVariant=vf.prototype.chooseVariant;vf.prototype.init=vf.prototype.init;vf.prototype.release=vf.prototype.release;vf.prototype.stop=vf.prototype.stop;var zf=1;function Af(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(F){return null!=F&&""!=F.g.trim()})){f=h;break}for(h=c.length-1;0<=h;h--)if(c[h].some(function(F){return null!=F&&""!=F.g.trim()})){g=h;break}if(-1===f||-1===g)return null;for(var k=h=!1,l="white",m="black",n=Bf(d,e,h,k,l,m);f<=g;f++){for(var q=c[f],p=-1,u=-1,x=0;x<q.length;x++)if(null!=q[x]&&""!==q[x].g.trim()){p=x;break}for(x=q.length-1;0<=x;x--)if(null!=q[x]&&""!==q[x].g.trim()){u=x;break}if(-1===
|
|
194
|
+
p||-1===u)q=Cf(d,e),a.nestedCues.push(q);else{for(;p<=u;p++)if(x=q[p]){var v=x.l,z=x.i,w=x.j,E=x.h;if(v!=h||z!=k||w!=l||E!=m)n.payload&&a.nestedCues.push(n),n=Bf(d,e,v,z,w,E),h=v,k=z,l=w,m=E;n.payload+=x.g}else n.payload+=" ";n.payload&&a.nestedCues.push(n);f!==g&&(n=Cf(d,e),a.nestedCues.push(n));n=Bf(d,e,h,k,l,m)}}return a.nestedCues.length?{cue:a,stream:b}:null}
|
|
195
|
+
function Bf(a,b,c,d,e,f){a=new Pb(a,b,"");c&&a.textDecoration.push("underline");d&&(a.fontStyle="italic");a.color=e;a.backgroundColor=f;return a}function Cf(a,b){a=new Pb(a,b,"");a.lineBreak=!0;return a}function Df(a,b,c,d,e){this.g=a;this.l=b;this.i=c;this.h=d;this.j=e};function Ef(a,b){this.i=[];this.g=1;this.h=0;this.A=a;this.u=b;this.j=this.m=!1;this.l="white";this.o="black";Ff(this)}function Gf(a,b,c){var d="CC"+((a.A<<1|a.u)+1),e=new Pb(b,c,"");e.lineInterpretation=1;var f=Hf.get(a.g);f&&(e.line=f);(b=Af(e,d,a.i,b,c))&&15<a.g+b.cue.nestedCues.length-3&&(f=Hf.get(a.g+3-b.cue.nestedCues.length))&&(e.line=f);return b}function Ff(a){If(a,0,15);a.g=1}
|
|
196
|
+
function Jf(a,b,c){if(!(32>c||127<c)){var d="";switch(b){case 0:d=Kf.has(c)?Kf.get(c):String.fromCharCode(c);break;case 1:d=Lf.get(c);break;case 2:a.i[a.g].pop();d=Mf.get(c);break;case 3:a.i[a.g].pop(),d=Nf.get(c)}d&&a.i[a.g].push(new Df(d,a.m,a.j,a.o,a.l))}}function Of(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 If(a,b,c){for(var d=0;d<=c;d++)a.i[b+d]=[]}
|
|
197
|
+
var Kf=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"]]),Lf=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"]]),Mf=new Map([[32,"\u00c1"],[33,"\u00c9"],[34,"\u00d3"],[35,"\u00da"],[36,"\u00dc"],
|
|
198
|
+
[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"]]),Nf=new Map([[32,"\u00c3"],[33,"\u00e3"],[34,"\u00cd"],[35,"\u00cc"],[36,"\u00ec"],[37,"\u00d2"],[38,"\u00f2"],[39,"\u00d5"],[40,"\u00f5"],
|
|
199
|
+
[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"]]),Hf=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 Pf(a,b){this.h=0;this.o=new Ef(a,b);this.i=new Ef(a,b);this.g=this.j=new Ef(a,b);this.l=0;this.m=null}function Qf(a,b,c){a.g=a.i;var d=a.g,e=null;3!==a.h&&4!==a.h&&(e=Gf(d,a.l,c),c=a.i,c.g=0<c.h?c.h:0,If(c,0,15),c=a.j,c.g=0<c.h?c.h:0,If(c,0,15),d.g=15);a.h=3;d.h=b;return e}function Rf(a){a.h=1;a.g=a.j;a.g.h=0}function Sf(a){$a("Cea608DataChannel","CEA-608 text mode entered, but is unsupported");a.g=a.o;a.h=4}var Tf="black green blue cyan red yellow magenta black".split(" "),Uf="white green blue cyan red yellow magenta white_italics".split(" ");function Vf(a,b){this.I=b;this.O=a;this.L=this.l=!1;this.m=this.o=this.F=this.M=this.H=0;this.D=2;this.i=[];this.g=this.h=this.j=0;this.C=this.A=!1;this.B="white";this.u="black";Wf(this)}function Wf(a){a.i=[];for(var b=0;16>b;b++)a.i.push(Xf())}function Xf(){for(var a=[],b=0;42>b;b++)a.push(null);return a}function Yf(a,b){Zf(a)&&(a.i[a.h][a.g]=new Df(b,a.C,a.A,a.u,a.B),a.g++)}function Zf(a){var b=a.g<a.m&&0<=a.g;return a.h<a.o&&0<=a.h&&b}Vf.prototype.isVisible=function(){return this.l};
|
|
200
|
+
function $f(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]=Xf()}
|
|
201
|
+
function ag(a,b,c){var d=new Pb(a.j,b,"");d.textAlign=0===a.D?"left":1===a.D?"right":Rb;var e=d.region;a.I&&(e.id+="svc"+a.I);e.id+="win"+a.O;e.height=a.o;e.width=a.m;e.heightUnits=2;e.widthUnits=2;e.viewportAnchorX=a.H;e.viewportAnchorY=a.M;e.viewportAnchorUnits=a.L?Ib:2;switch(a.F){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=
|
|
202
|
+
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=Af(d,"svc"+c,a.i,a.j,b))a.j=b;return c};function bg(){this.i=[];this.h=null;this.g=0}function cg(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 dg(a.h)),a.h=null,a.g=0))}function dg(a){this.g=0;this.h=a}dg.prototype.ya=function(){return this.g<this.h.length};dg.prototype.Ea=function(){return this.g};function eg(a){if(!a.ya())throw new S(2,2,3E3);return a.h[a.g++]}dg.prototype.skip=function(a){if(this.g+a>this.h.length)throw new S(2,2,3E3);this.g+=a};
|
|
203
|
+
dg.prototype.vf=function(a){if(0>this.g-a)throw new S(2,2,3E3);this.g-=a};function fg(a){this.i=a;this.h=[null,null,null,null,null,null,null,null];this.g=null}
|
|
204
|
+
function gg(a,b,c,d){if(!a.g)return null;if(24==c)return c=eg(b).value,d=eg(b).value,c=function(f){return f.map(function(g){return("0"+(g&255).toString(16)).slice(-2)}).join("")}([c,d]),Yf(a.g,String.fromCharCode(parseInt(c,16))),null;b=a.g;var e=null;switch(c){case 8:!Zf(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=ag(b,d,a.i));b.h+1>=b.o?$f(b):b.h++;b.g=0;break;case 14:b.isVisible()&&(e=ag(b,d,a.i));b.i[b.h]=Xf();b.g=0;break;case 12:b.isVisible()&&
|
|
205
|
+
(e=ag(b,d,a.i)),Wf(b),b.h=0,b.g=0}return e}
|
|
206
|
+
function hg(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=eg(b).value;b=null;c=t(ig(a,c));for(var e=c.next();!e.done;e=c.next())e=a.h[e.value],e.isVisible()&&(b=ag(e,d,a.i)),Wf(e);return b}if(137===c)for(b=eg(b).value,b=t(ig(a,b)),c=b.next();!c.done;c=b.next())c=a.h[c.value],c.isVisible()||(c.j=d),c.l=!0;else{if(138===c){c=eg(b).value;b=null;c=t(ig(a,c));for(e=c.next();!e.done;e=c.next())e=a.h[e.value],e.isVisible()&&(b=ag(e,d,a.i)),e.l=!1;return b}if(139===c){c=eg(b).value;
|
|
207
|
+
b=null;c=t(ig(a,c));for(e=c.next();!e.done;e=c.next())e=a.h[e.value],e.isVisible()?b=ag(e,d,a.i):e.j=d,e.l=!e.l;return b}if(140===c)return b=eg(b).value,jg(a,b,d);if(143===c)return d=jg(a,255,d),kg(a),d;if(144===c)b.skip(1),d=eg(b).value,a.g&&(a.g.A=0<(d&128),a.g.C=0<(d&64));else if(145===c)d=eg(b).value,c=eg(b).value,b.skip(1),a.g&&(b=lg((c&48)>>4,(c&12)>>2,c&3),a.g.B=lg((d&48)>>4,(d&12)>>2,d&3),a.g.u=b);else if(146===c)d=eg(b).value,b=eg(b).value,a.g&&(a=a.g,a.h=d&15,a.g=b&63);else if(151===c)b.skip(1),
|
|
208
|
+
b.skip(1),d=eg(b).value,b.skip(1),a.g&&(a.g.D=d&3);else if(152<=c&&159>=c){c=(c&15)-8;e=null!==a.h[c];if(!e){var f=new Vf(c,a.i);f.j=d;a.h[c]=f}d=eg(b).value;f=eg(b).value;var g=eg(b).value,h=eg(b).value,k=eg(b).value;b=eg(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.u="black");b=a.h[c];b.l=0<(d&32);b.M=f&127;b.H=g;b.F=(h&240)>>4;b.L=0<(f&128);b.o=(h&15)+1;b.m=(k&63)+1;a.g=a.h[c]}}}return null}
|
|
209
|
+
function ig(a,b){for(var c=[],d=0;8>d;d++)1===(b&1)&&a.h[d]&&c.push(d),b>>=1;return c}function jg(a,b,c){var d=null;b=t(ig(a,b));for(var e=b.next();!e.done;e=b.next()){e=e.value;var f=a.h[e];f.isVisible()&&(d=ag(f,c,a.i));a.h[e]=null}return d}function kg(a){a.g=null;a.h=[null,null,null,null,null,null,null,null]}function lg(a,b,c){var d={0:0,1:0,2:1,3:1};a=d[a];b=d[b];c=d[c];return mg[a<<2|b<<1|c]}
|
|
210
|
+
var ng=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"]]),mg="black blue green cyan red magenta yellow white".split(" ");function og(a,b){this.h=Cb(a);this.i=b==pg;this.g=0}r=og.prototype;r.ya=function(){return this.g<this.h.byteLength};r.Ea=function(){return this.g};r.getLength=function(){return this.h.byteLength};r.P=function(){try{var a=this.h.getUint8(this.g);this.g+=1;return a}catch(b){throw qg();}};r.ca=function(){try{var a=this.h.getUint16(this.g,this.i);this.g+=2;return a}catch(b){throw qg();}};r.N=function(){try{var a=this.h.getUint32(this.g,this.i);this.g+=4;return a}catch(b){throw qg();}};
|
|
211
|
+
r.rf=function(){try{var a=this.h.getInt32(this.g,this.i);this.g+=4;return a}catch(b){throw qg();}};r.hd=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 qg();}if(2097151<b)throw new S(2,3,3001);this.g+=8;return b*Math.pow(2,32)+a};r.Ya=function(a){if(this.g+a>this.h.byteLength)throw qg();var b=yb(this.h,this.g,a);this.g+=a;return b};
|
|
212
|
+
r.skip=function(a){if(this.g+a>this.h.byteLength)throw qg();this.g+=a};r.vf=function(a){if(this.g<a)throw qg();this.g-=a};r.seek=function(a){if(0>a||a>this.h.byteLength)throw qg();this.g=a};r.Hb=function(){for(var a=this.g;this.ya()&&0!=this.h.getUint8(this.g);)this.g+=1;a=yb(this.h,a,this.g-a);this.g+=1;return vd(a)};function qg(){return new S(2,3,3E3)}O("shaka.util.DataViewReader",og);og.prototype.readTerminatedString=og.prototype.Hb;og.prototype.seek=og.prototype.seek;og.prototype.rewind=og.prototype.vf;
|
|
213
|
+
og.prototype.skip=og.prototype.skip;og.prototype.readBytes=og.prototype.Ya;og.prototype.readUint64=og.prototype.hd;og.prototype.readInt32=og.prototype.rf;og.prototype.readUint32=og.prototype.N;og.prototype.readUint16=og.prototype.ca;og.prototype.readUint8=og.prototype.P;og.prototype.getLength=og.prototype.getLength;og.prototype.getPosition=og.prototype.Ea;og.prototype.hasMoreData=og.prototype.ya;var pg=1;og.Endianness={BIG_ENDIAN:0,LITTLE_ENDIAN:pg};function rg(){this.h=[];this.g=[];this.i=new bg;this.l=0;this.m=new Map([["CC1",new Pf(0,0)],["CC2",new Pf(0,1)],["CC3",new Pf(1,0)],["CC4",new Pf(1,1)]]);this.u=this.o=0;this.j=new Map;this.B=!0;this.A=new Set;sg(this)}rg.prototype.clear=function(){this.l=0;this.h=[];this.g=[];var a=this.i;a.i=[];a.h=[];a.g=0;sg(this);a=t(this.j.values());for(var b=a.next();!b.done;b=a.next())kg(b.value)};
|
|
214
|
+
function sg(a){a.o=0;a.u=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,Ff(c.i),Ff(c.j),Ff(c.o);a.B=!0}
|
|
215
|
+
rg.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 og(a,0);if(!(8>a.getLength())&&181===a.P()&&49===a.ca()&&1195456820===a.N()&&3===a.P()&&(c=a.P(),0!==(c&64)))for(c&=31,a.skip(1),d=0;d<c;d++){var e=a.P(),f=(e&4)>>2,g=a.P(),h=a.P();f&&(e&=3,0===e||1===e?this.h.push({pts:b,type:e,Qa:g,kb: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})))}};
|
|
216
|
+
rg.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=tg(this,d.value))&&b.push(d);c=t(this.g);for(d=c.next();!d.done;d=c.next())cg(this.i,d.value);c=t(this.i.i);for(d=c.next();!d.done;d=c.next())d=ug(this,d.value),b.push.apply(b,y(d));this.i.i=[];this.h=[];this.g=[];return b};
|
|
217
|
+
function tg(a,b){var c=b.type;if(16===(b.Qa&112)){var d=b.Qa>>3&1;0===c?a.o=d:a.u=d}d="CC"+((c<<1|(c?a.u:a.o))+1);c=a.m.get(d);if(255===b.Qa&&255===b.kb||!b.Qa&&!b.kb||!vg(b.Qa)||!vg(b.kb))return 45<=++a.l&&sg(a),null;a.l=0;b.Qa&=127;b.kb&=127;var e=b.Qa;if(1<=e&&15>=e||!b.Qa&&!b.kb)return null;e=null;if(16===(b.Qa&112))a:{a.A.add(d),d=b.Qa;a=b.kb;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];var f=(a&30)>>1;d=
|
|
218
|
+
"white";e=!1;7>f?d=Uf[f]:7===f&&(e=!0);a=1===(a&1);4!==c.h&&(f=c.g,3===c.h&&b!==f.g&&(c=1+b-f.h,Of(f,c,1+f.g-f.h,f.h),If(f,0,c-1),If(f,b+1,15-b)),f.g=b,f.m=a,f.j=e,f.l=d,f.o="black")}else if(17===(d&247)&&32===(a&240))c.g.m=!1,c.g.j=!1,c.g.l="white",Jf(c.g,0,32),d=!1,b=Uf[(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=Tf[(a&14)>>1]),c.g.o=b;else if(17===(d&247)&&48===(a&240))Jf(c.g,
|
|
219
|
+
1,a);else if(18===(d&246)&&32===(a&224))Jf(c.g,d&1?3:2,a);else if(20===(d&246)&&32===(a&240)){a=b.pts;d=null;switch(b.kb){case 32:Rf(c);break;case 33:c=c.g;c.i[c.g].pop();break;case 37:d=Qf(c,2,a);break;case 38:d=Qf(c,3,a);break;case 39:d=Qf(c,4,a);break;case 40:Jf(c.g,0,32);break;case 41:c.h=2;c.g=c.i;c.g.h=0;c.l=a;break;case 42:Ff(c.o);Sf(c);break;case 43:Sf(c);break;case 44:b=c.i;d=null;4!==c.h&&(d=Gf(b,c.l,a));If(b,0,15);break;case 45:b=c.g;3!==c.h?d=null:(d=Gf(b,c.l,a),e=b.g-b.h+1,Of(b,e-1,e,
|
|
220
|
+
b.h),If(b,0,e-1),If(b,b.g,15-b.g),c.l=a);break;case 46:If(c.j,0,15);break;case 47:b=null,4!==c.h&&(b=Gf(c.i,c.l,a)),d=c.j,c.j=c.i,c.i=d,Rf(c),c.l=a,d=b}e=d;break a}e=null}else a=b.kb,Jf(c.g,0,b.Qa),Jf(c.g,0,a);return e}
|
|
221
|
+
function ug(a,b){var c=[];try{for(;b.ya();){var d=eg(b).value,e=(d&224)>>5,f=d&31;7===e&&0!=f&&(e=eg(b).value&63);if(0!=e){a.A.add("svc"+e);a.j.has(e)||a.j.set(e,new fg(e));for(var g=a.j.get(e),h=b.Ea();b.Ea()-h<f;){e=g;var k=b,l=eg(k),m=l.value,n=l.pts;if(16===m){var q=eg(k);m=m<<16|q.value}if(0<=m&&31>=m)var p=gg(e,k,m,n);else if(128<=m&&159>=m)p=hg(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&
|
|
222
|
+
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?Yf(e.g,"\u266a"):Yf(e.g,String.fromCharCode(k)));else if(160<=m&&255>=m)e.g&&Yf(e.g,String.fromCharCode(m));else if(4128<=m&&4223>=m){if(k=m&255,e.g)if(ng.has(k)){var u=ng.get(k);Yf(e.g,u)}else Yf(e.g,"_")}else 4256<=m&&4351>=m&&e.g&&(160!=(m&255)?Yf(e.g,"_"):Yf(e.g,"[CC]"));p=null}(e=p)&&c.push(e)}}}}catch(x){if(x instanceof S&&3E3===x.code)$a("CEA708_INVALID_DATA","Buffer read out of bounds / invalid CEA-708 Data.");
|
|
223
|
+
else throw x;}return c}function vg(a){for(var b=0;a;)b^=a&1,a>>=1;return 1===b}rg.prototype.getStreams=function(){return Array.from(this.A)};O("shaka.cea.CeaDecoder",rg);Gb=function(){return new rg};function wg(a){for(var b=[],c=a,d=a=0;d<c.length;)2==a&&3==c[d]?(a=0,c=[].concat(y(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 xg(){this.i=[];this.h=[];this.g=!1}r=xg.prototype;r.box=function(a,b){a=yg(a);this.i[a]=zg;this.h[a]=b;return this};r.K=function(a,b){a=yg(a);this.i[a]=Ag;this.h[a]=b;return this};r.stop=function(){this.g=!0};r.parse=function(a,b,c){a=new og(a,0);for(this.g=!1;a.ya()&&!this.g;)this.Xb(0,a,b,c)};
|
|
224
|
+
r.Xb=function(a,b,c,d){var e=b.Ea();if(d&&e+8>b.getLength())this.g=!0;else{var f=b.N(),g=b.N(),h=Bg(g),k=!1;switch(f){case 0:f=b.getLength()-e;break;case 1:if(d&&b.Ea()+8>b.getLength()){this.g=!0;return}f=b.hd();k=!0}var l=this.h[g];if(l){var m=null,n=null;if(this.i[g]==Ag){if(d&&b.Ea()+4>b.getLength()){this.g=!0;return}n=b.N();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.Ea(),b=0<d?b.Ya(d):new Uint8Array(0),b=new og(b,0),l({name:h,parser:this,
|
|
225
|
+
partialOkay:c||!1,version:m,flags:n,reader:b,size:f,start:e+a,has64BitSize:k}))}else b.skip(Math.min(e+f-b.Ea(),b.getLength()-b.Ea()))}};function Cg(a){for(var b=Dg(a);a.reader.ya()&&!a.parser.g;)a.parser.Xb(a.start+b,a.reader,a.partialOkay)}function Eg(a){for(var b=Dg(a),c=a.reader.N(),d=0;d<c&&(a.parser.Xb(a.start+b,a.reader,a.partialOkay),!a.parser.g);d++);}function Fg(a){var b=Dg(a);for(a.reader.skip(78);a.reader.ya()&&!a.parser.g;)a.parser.Xb(a.start+b,a.reader,a.partialOkay)}
|
|
226
|
+
function Gg(a){var b=Dg(a);a.reader.skip(8);var c=a.reader.ca();a.reader.skip(6);2==c?a.reader.skip(48):a.reader.skip(12);for(1==c&&a.reader.skip(16);a.reader.ya()&&!a.parser.g;)a.parser.Xb(a.start+b,a.reader,a.partialOkay)}function Hg(a){return function(b){a(b.reader.Ya(b.reader.getLength()-b.reader.Ea()))}}function yg(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 Bg(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}
|
|
227
|
+
function Dg(a){return 8+(a.has64BitSize?8:0)+(null!=a.flags?4:0)}O("shaka.util.Mp4Parser",xg);xg.headerSize=Dg;xg.typeToString=Bg;xg.allData=Hg;xg.audioSampleEntry=Gg;xg.visualSampleEntry=Fg;xg.sampleDescription=Eg;xg.children=Cg;xg.prototype.parseNext=xg.prototype.Xb;xg.prototype.parse=xg.prototype.parse;xg.prototype.stop=xg.prototype.stop;xg.prototype.fullBox=xg.prototype.K;xg.prototype.box=xg.prototype.box;var zg=0,Ag=1;function Ig(a,b){var c=null,d=null,e=null,f=a.N();b&1&&(e=a.hd());b&2&&a.skip(4);b&8&&(c=a.N());b&16&&(d=a.N());return{trackId:f,fc:c,hc:d,Hh:e}}function Jg(a,b){return 1==b?(b=a.N(),a=a.N(),{baseMediaDecodeTime:b*Math.pow(2,32)+a}):{baseMediaDecodeTime:a.N()}}function Kg(a,b){1==b?(a.skip(8),a.skip(8)):(a.skip(4),a.skip(4));b=a.N();a.skip(4);a=a.ca();return{timescale:b,language:String.fromCharCode((a>>10)+96)+String.fromCharCode(((a&960)>>5)+96)+String.fromCharCode((a&31)+96)}}
|
|
228
|
+
function Lg(a,b,c){var d=a.N(),e=[],f=null;c&1&&(f=a.N());c&4&&a.skip(4);for(var g=0;g<d;g++){var h={se:null,sampleSize:null,jd:null};c&256&&(h.se=a.N());c&512&&(h.sampleSize=a.N());c&1024&&a.skip(4);c&2048&&(h.jd=0==b?a.N():a.rf());e.push(h)}return{Jh:d,re:e,ag:f}}function Mg(a){a.skip(6);a.skip(2);a.skip(8);var b=a.ca();a.skip(2);a.skip(2);a.skip(2);a=a.ca()+a.ca()/65536;return{channelCount:b,sampleRate:a}}function Ng(a){a=a.N();return{codec:Bg(a)}}
|
|
229
|
+
function Og(a){var b=null,c=null,d=a.Ya(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.ca()){case 1:case 5:case 6:case 7:b="srgb";break;case 9:b="rec2020";break;case 11:case 12:b="p3"}d=a.ca();a.ca();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,zc:c}}
|
|
230
|
+
function Pg(a,b){b=void 0===b?!1:b;a=a.toString(16).toUpperCase();return b?a:("0"+a).slice(-2)}function Qg(a){return(10>a?"0":"")+a};function Rg(){this.j=new Map;this.i=this.h=0;this.g=Sg}
|
|
231
|
+
Rg.prototype.init=function(a){function b(f){f=f.name;f in Tg&&(c.g=Tg[f])}var c=this,d=[],e=[];(new xg).box("moov",Cg).box("mvex",Cg).K("trex",function(f){var g=f.reader;g.skip(4);g.skip(4);f=g.N();g=g.N();c.h=f;c.i=g}).box("trak",Cg).K("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.N();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.ca();g.ca();g.ca();g.ca();d.push(h)}).box("mdia",Cg).K("mdhd",
|
|
232
|
+
function(f){f=Kg(f.reader,f.version);e.push(f.timescale)}).box("minf",Cg).box("stbl",Cg).K("stsd",Eg).box("avc1",b).box("avc3",b).box("hev1",b).box("hvc1",b).box("dvav",b).box("dva1",b).box("dvh1",b).box("dvhe",b).box("encv",Fg).box("sinf",Cg).box("frma",function(f){f=Ng(f.reader).codec;f in Tg&&(c.g=Tg[f])}).parse(a,!0);if(!d.length||!e.length||d.length!=e.length)throw new S(2,2,2010);this.g==Sg&&Za("Unable to determine bitstream format for CEA parsing!");d.forEach(function(f,g){c.j.set(f,e[g])})};
|
|
233
|
+
Rg.prototype.parse=function(a){var b=this;if(this.g==Sg)return[];var c=[],d=0,e=[];(new xg).box("moof",function(f){d=f.start;e=[];Cg(f)}).box("traf",function(f){e.push({baseMediaDecodeTime:null,fc:b.h,hc:b.i,nf:[],timescale:9E4});Cg(f)}).K("trun",function(f){var g=e[e.length-1];f=Lg(f.reader,f.version,f.flags);g.nf.push(f)}).K("tfhd",function(f){var g=e[e.length-1];f=Ig(f.reader,f.flags);g.fc=f.fc||b.h;g.hc=f.hc||b.i;f=f.trackId;b.j.has(f)&&(g.timescale=b.j.get(f))}).K("tfdt",function(f){var g=e[e.length-
|
|
234
|
+
1];f=Jg(f.reader,f.version);g.baseMediaDecodeTime=f.baseMediaDecodeTime}).box("mdat",function(f){for(var g=d-f.start-8,h=f.reader.Ea(),k=t(e),l=k.next();!l.done;l=k.next()){l=l.value;if(null===l.baseMediaDecodeTime)throw Za("Unable to find base media decode time for CEA captions!"),new S(2,2,2010);f.reader.seek(h);Ug(b,f.reader,l.baseMediaDecodeTime,l.timescale,l.fc,l.hc,g,l.nf,c)}}).parse(a,!1);return c};
|
|
235
|
+
function Ug(a,b,c,d,e,f,g,h,k){var l=0,m=f,n=h.map(function(u){return u.re});n=[].concat.apply([],y(n));n.length&&(m=n[0].sampleSize||f);for(b.skip(g+h[0].ag);b.ya();){g=b.N();var q=b.P(),p=null;p=!1;h=1;switch(a.g){case Vg:p=q&31;p=6==p;break;case Wg:h=2;b.skip(1);p=q>>1&63;p=39==p||40==p;break;default:return}if(p)for(q=0,l<n.length&&(q=n[l].jd||0),q=(c+q)/d,h=t(wg(b.Ya(g-h))),p=h.next();!p.done;p=h.next())k.push({packet:p.value,pts:q});else try{b.skip(g-h)}catch(u){break}m-=g+4;0==m&&(c=l<n.length?
|
|
236
|
+
c+(n[l].se||e):c+e,l++,l<n.length?m=n[l].sampleSize||f:m=f)}}O("shaka.cea.Mp4CeaParser",Rg);var Sg=0,Vg=1,Wg=2,Tg={avc1:Vg,avc3:Vg,hev1:Wg,hvc1:Wg,dvav:Vg,dva1:Vg,dvh1:Wg,dvhe:Wg};Fb["video/mp4"]=function(){return new Rg};/*
|
|
237
|
+
|
|
238
|
+
Copyright Brightcove, Inc.
|
|
239
|
+
|
|
240
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
241
|
+
you may not use this file except in compliance with the License.
|
|
242
|
+
You may obtain a copy of the License at
|
|
243
|
+
|
|
244
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
245
|
+
|
|
246
|
+
Unless required by applicable law or agreed to in writing, software
|
|
247
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
248
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
249
|
+
See the License for the specific language governing permissions and
|
|
250
|
+
limitations under the License.
|
|
251
|
+
*/
|
|
252
|
+
function Xg(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=yb(b,0,c)}this.i=this.j.byteLength;this.g=this.h=0}function Yg(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 og(c,0)).N(),a.g=8*d,a.i-=d)}function Zg(a,b){if(a.g<=b){b-=a.g;var c=Math.floor(b/8);b-=8*c;a.g-=c;Yg(a)}a.h<<=b;a.g-=b}
|
|
253
|
+
function $g(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&&Yg(a);c=b-c;return 0<c?d<<c|$g(a,c):d}function ah(a){var b;for(b=0;b<a.g;++b)if(0!==(a.h&2147483648>>>b))return a.h<<=b,a.g-=b,b;Yg(a);return b+ah(a)}function bh(a){Zg(a,1+ah(a))}function T(a){var b=ah(a);return $g(a,b+1)-1}function ch(a){a=T(a);return 1&a?1+a>>>1:-1*(a>>>1)}function V(a){return 1===$g(a,1)}function dh(a){return $g(a,8)}
|
|
254
|
+
function eh(a,b){for(var c=8,d=8,e=0;e<b;e++)0!==d&&(d=ch(a),d=(c+d+256)%256),c=0===d?c:d}function fh(a){dh(a);T(a);return T(a)}O("shaka.util.ExpGolomb",Xg);/*
|
|
255
|
+
@license
|
|
256
|
+
Shaka Player
|
|
257
|
+
Copyright 2022 Google LLC
|
|
258
|
+
SPDX-License-Identifier: Apache-2.0
|
|
259
|
+
*/
|
|
260
|
+
function gh(){}function hh(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 rh(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 sh(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}
|
|
261
|
+
function th(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=vd(yb(a.data,1,c)),e=a.data[2+c],f=a.data.subarray(3+c).indexOf(0);if(-1===f)return null;var g=vd(yb(a.data,3+c,f)),h;"--\x3e"===d?h=vd(yb(a.data,4+c+f)):h=zb(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;
|
|
262
|
+
d=a.data.subarray(1).indexOf(0);if(-1===d)return null;c=vd(yb(a.data,1,d));a=vd(yb(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=vd(yb(a.data,1,d));a=vd(yb(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=vd(yb(a.data,0,c));b.description=c;"com.apple.streaming.transportStreamTimestamp"==
|
|
263
|
+
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=zb(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=vd(a.data.subarray(1)).replace(/\0*$/,"");b.data=a;return b}return"W"===a.type[0]?(a=vd(a.data).replace(/\0*$/,""),b.data=a,b):a.data?(b.data=zb(a.data),b):null}
|
|
264
|
+
function uh(a){for(var b=0,c=[];hh(a,b);){var d=sh(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=sh(e,4);e={type:String.fromCharCode(e[0],e[1],e[2],e[3]),size:f,data:e.subarray(10,10+f)};(f=th(e))&&c.push(f);b+=e.size+10}rh(a,b)&&(b+=10)}return c}function vh(a,b){for(var c=b=void 0===b?0:b,d=0;hh(a,b);)a[b+5]>>6&1&&(d+=10),d+=10,d+=sh(a,b+6),rh(a,b+10)&&(d+=10),b+=d;return 0<d?a.subarray(c,c+d):new Uint8Array([])}O("shaka.util.Id3Utils",gh);gh.getID3Data=vh;
|
|
265
|
+
gh.getID3Frames=uh;function wh(){this.F=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.D=this.o=this.u=null}r=wh.prototype;r.clearData=function(){this.j=[];this.g=[];this.i=[];this.h=[];this.l=[]};
|
|
266
|
+
r.parse=function(a){if(564>a.length)return this;for(var b=Math.max(0,xh(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.F=(a[h+10]&31)<<8|a[h+11];break;case 17:case 8191:break;case this.F:f&&(h+=a[h]+1);f=a;g={audio:-1,video:-1,Tc:-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<
|
|
267
|
+
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 p=f[n+1]+2;switch(f[n]){case 5:var u=xd(f.subarray(n+2,n+p));-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=
|
|
268
|
+
null,128===f[n+2]&&(u=f[n+3]),null!=u&&(this.D={channelCount:0===(u&15)?2:u&15,Wf:u,sampleRate:48E3}))}n+=p;q-=p}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.Tc&&(g.Tc=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");
|
|
269
|
+
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.Tc&&(this.C=f.Tc);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);
|
|
270
|
+
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};
|
|
271
|
+
function yh(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.u&&(a.u=e);c.pts=zh(e,a.u);a.u=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=zh(d,
|
|
272
|
+
a.o));a.o=c.dts}a=b[8]+9;if(b.byteLength<=a)return null;c.data=b.subarray(a);return c}r.Wg=function(a){pb("TsParser.parseAvcNalus","Please use parseNalus function instead.");return this.je(a,{vc:null,state:null})};
|
|
273
|
+
r.je=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.vc)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-
|
|
274
|
+
g)),0<n&&(n=a.subarray(0,n),f.data=Jd(f.data,n),f.fullData=Jd(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.vc&&(c=k.length?k[k.length-1]:b.vc)&&(c.data=Jd(c.data,a),c.fullData=Jd(c.fullData,a));b.state=f;return k};
|
|
275
|
+
r.getMetadata=function(){for(var a=[],b=t(this.l),c=b.next();!c.done;c=b.next())c=Jd.apply(Dd,y(c.value)),(c=yh(this,c))&&a.push({cueTime:c.pts?c.pts/9E4:null,data:c.data,frames:uh(c.data),dts:c.dts,pts:c.pts});return a};
|
|
276
|
+
r.Ja=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=Jd.apply(Dd,y(c.value)),e=yh(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=Jd(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};
|
|
277
|
+
r.Tb=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=Jd.apply(Dd,y(d.value)),f=yh(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=Jd(d.data,e),this.g.push(d))}if(a){c={vc:null,state:null};d=[];e=t(this.g);for(f=e.next();!f.done;f=e.next())f=f.value,
|
|
278
|
+
f.nalus=this.je(f,c),f.nalus.length&&(d.push(f),c.vc=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)};r.getStartTime=function(a){if("audio"==a){a=null;var b=this.Ja();b.length&&(a=b[0],a=Math.min(a.dts,a.pts)/9E4);return a}return"video"==a?(a=null,b=this.Tb(!1),b.length&&(a=b[0],a=Math.min(a.dts,a.pts)/9E4),a):null};r.lc=function(){return{audio:this.A,video:this.m}};
|
|
279
|
+
r.Sc=function(){for(var a=[],b=t(this.Tb()),c=b.next();!c.done;c=b.next())a.push.apply(a,y(c.value.nalus));return a};r.Eg=function(){pb("TsParser.getVideoResolution","Please use getVideoInfo function instead.");var a=this.Sd();return{height:a.height,width:a.width}};r.Sd=function(){return"hvc"==this.m?Ah(this):Bh(this)};
|
|
280
|
+
function Bh(a){var b={height:null,width:null,codec:null};a=a.Sc();if(!a.length)return b;a=a.find(function(q){return 7==q.type});if(!a)return b;a=new Xg(a.data);var c=dh(a),d=dh(a),e=dh(a);bh(a);if(Ch.includes(c)){var f=T(a);3===f&&Zg(a,1);bh(a);bh(a);Zg(a,1);if(V(a)){f=3!==f?8:12;for(var g=0;g<f;g++)V(a)&&(6>g?eh(a,16):eh(a,64))}}bh(a);f=T(a);if(0===f)T(a);else if(1===f)for(Zg(a,1),bh(a),bh(a),f=T(a),g=0;g<f;g++)bh(a);bh(a);Zg(a,1);f=T(a);g=T(a);var h=$g(a,1);0===h&&Zg(a,1);Zg(a,1);var k=0,l=0,m=
|
|
281
|
+
0,n=0;V(a)&&(k=T(a),l=T(a),m=T(a),n=T(a));b.height=String((2-h)*(g+1)*16-2*m-2*n);b.width=String(16*(f+1)-2*k-2*l);b.codec="avc1."+("0"+c.toString(16).toUpperCase()).slice(-2)+("0"+d.toString(16).toUpperCase()).slice(-2)+("0"+e.toString(16).toUpperCase()).slice(-2);return b}
|
|
282
|
+
function Ah(a){var b={height:null,width:null,codec:null};a=a.Sc();if(!a.length)return b;a=a.find(function(F){return 33==F.type});if(!a)return b;var c=new Xg(a.fullData,!0);dh(c);dh(c);$g(c,4);var d=$g(c,3);V(c);var e=$g(c,2),f=$g(c,1),g=$g(c,5),h=$g(c,32);a=dh(c);for(var k=dh(c),l=dh(c),m=dh(c),n=dh(c),q=dh(c),p=dh(c),u=[],x=[],v=0;v<d;v++)u.push(V(c)),x.push(V(c));if(0<d)for(v=d;8>v;v++)$g(c,2);for(v=0;v<d;v++)u[v]&&$g(c,88),x[v]&&dh(c);T(c);d=T(c);3==d&&$g(c,1);u=T(c);x=T(c);var z=v=0,w=0,E=0;V(c)&&
|
|
283
|
+
(v+=T(c),z+=T(c),w+=T(c),E+=T(c));b.width=String(u-(v+z)*(1===d||2===d?2:1));b.height=String(x-(w+E)*(1===d?2:1));c=function(F){for(var D=0,I=0;32>I;I++)D|=(F>>I&1)<<31-I;return D>>>0}(h);f=1==f?"H":"L";e="hvc1"+("."+["","A","B","C"][e]+g);e+="."+c.toString(16).toUpperCase();e+="."+f+p;q&&(e+="."+q.toString(16).toUpperCase());n&&(e+="."+n.toString(16).toUpperCase());m&&(e+="."+m.toString(16).toUpperCase());l&&(e+="."+l.toString(16).toUpperCase());k&&(e+="."+k.toString(16).toUpperCase());a&&(e+="."+
|
|
284
|
+
a.toString(16).toUpperCase());b.codec=e;return b}function zh(a,b){var c=1;for(a>b&&(c=-1);4294967296<Math.abs(b-a);)a+=8589934592*c;return a}function Dh(a){return 0>xh(a)?!1:!0}function xh(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}O("shaka.util.TsParser",wh);wh.syncOffset=xh;wh.probe=Dh;wh.prototype.getVideoInfo=wh.prototype.Sd;wh.prototype.getVideoResolution=wh.prototype.Eg;wh.prototype.getVideoNalus=wh.prototype.Sc;
|
|
285
|
+
wh.prototype.getCodecs=wh.prototype.lc;wh.prototype.getStartTime=wh.prototype.getStartTime;wh.prototype.getVideoData=wh.prototype.Tb;wh.prototype.getAudioData=wh.prototype.Ja;wh.prototype.getMetadata=wh.prototype.getMetadata;wh.prototype.parseNalus=wh.prototype.je;wh.prototype.parseAvcNalus=wh.prototype.Wg;wh.prototype.parse=wh.prototype.parse;wh.prototype.clearData=wh.prototype.clearData;wh.Timescale=9E4;var Ch=[100,110,122,244,44,83,86,118,128,138,139,134];function Eh(){this.g=null}Eh.prototype.init=function(){};Eh.prototype.parse=function(a){this.g?this.g.clearData():this.g=new wh;var b=[];a=yb(a);if(!Dh(a))return b;a=this.g.parse(a);var c=a.lc(),d=a.Sc();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(wg(d.data)),f=e.next();!f.done;f=e.next())b.push({packet:f.value,pts:d.time});return b};
|
|
286
|
+
O("shaka.cea.TsCeaParser",Eh);Fb["video/mp2t"]=function(){return new Eh};O("shaka.config.AutoShowText",{NEVER:0,ALWAYS:1,IF_PREFERRED_TEXT_LANGUAGE:2,IF_SUBTITLES_MAY_BE_NEEDED:3});O("shaka.config.CodecSwitchingStrategy",{RELOAD:"reload",SMOOTH:"smooth"});function Fh(){}O("shaka.dependencies",Fh);Fh.has=function(a){return Gh.has(a)};Fh.add=function(a,b){if(!Hh[a])throw Error(a+" is not supported");a==Ih?pb("mux.js","mux.js is no longer used in Shaka Player."):Gh.set(a,function(){return b})};var Ih="muxjs",Hh={Ih:Ih,ISOBoxer:"ISOBoxer"};Fh.Allowed=Hh;var Gh=new Map([["ISOBoxer",function(){return window.ISOBoxer}]]);function Jh(a,b,c){this.type=a;this.g=b;this.segments=c||null}function Kh(a,b,c,d){this.id=a;this.name=b;this.attributes=c;this.value=void 0===d?null:d}Kh.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};
|
|
287
|
+
function Lh(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 Mh(a,b){a=a.attributes.filter(function(c){return c.name==b});return a.length?a[0]:null}function X(a,b,c){return(a=Mh(a,b))?a.value:c||null}function Nh(a,b){a=Mh(a,b);if(!a)throw new S(2,4,4023,b);return a.value}function Oh(a,b,c){c=void 0===c?[]:c;this.g=b;this.i=a;this.h=c}function Ph(a,b){this.name=a;this.value=b};function Qh(a,b){return a.filter(function(c){return c.name==b})}function Rh(a,b){return a.filter(function(c){return Nh(c,"TYPE")==b})}function Sh(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 Th(a,b,c){c=void 0===c?0:c;return(a=Sh(a,b))?Number(a.value):c}function Uh(a,b,c){return b?Vh(a,[b],c):[]}
|
|
288
|
+
function Vh(a,b,c){if(!b.length)return[];b=Kd(a,b);a=[];b=t(b);for(var d=b.next();!d.done;d=b.next()){var e=a,f=e.push;var g=d.value;if((d=c)&&d.size){g=String(g).replace(/%7B/g,"{").replace(/%7D/g,"}");var h=g.match(/{\$\w*}/g);if(h){h=t(h);for(var k=h.next();!k.done;k=h.next()){k=k.value;var l=k.slice(2,k.length-1),m=d.get(l);if(m)g=g.replace(k,m);else throw new S(2,4,4039,l);}}d=g}else d=g;f.call(e,d)}return a};function Wh(a){this.h=a||"";this.g=0}function Xh(a){Yh(a,/[ \t]+/gm)}function Yh(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 Zh(a){return a.g==a.h.length?null:(a=Yh(a,/[^ \t\n]*/gm))?a[0]:null};function $h(){this.g=0}
|
|
289
|
+
function ai(a,b){b=vd(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 S(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=bi(a,f),--a.g,ci.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=bi(a,g);if(di.includes(g.name)){if(1!=b)throw new S(2,4,4017);g=
|
|
290
|
+
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=bi(a,k),ci.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"==X(k,"TYPE")?f.push(k):"MAP"==X(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 Oh(k,d,f)),d=[],f=[]);f.length&&(h&&d.push(h),c.push(new Oh("",d,f)));return new Jh(b,e,c)}e.push(g);"EXT-X-STREAM-INF"==
|
|
291
|
+
g.name&&(g.attributes.push(new Ph("URI",h)),d=!0)}}return new Jh(b,e)}function bi(a,b){a=a.g++;var c=b.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!c)throw new S(2,4,4016,b);b=c[1];var d=c[2];c=[];var e;if(d){d=new Wh(d);var f;(f=Yh(d,/^([^,=]+)(?:,|$)/g))&&(e=f[1]);for(var g=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;f=Yh(d,g);)c.push(new Ph(f[1],f[2]||f[3])),Xh(d)}return new Kh(a,b,c,e)}
|
|
292
|
+
var ci="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".split(" "),di="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 ei(a,b,c,d,e,f,g){this.J=a;this.Pa=b;this.qa=c;this.be=void 0===d?null:d;this.timescale=void 0===e?null:e;this.g=void 0===f?null:f;this.aesKey=void 0===g?null:g;this.mimeType=this.codecs=null}ei.prototype.Bb=function(){return this.Pa};ei.prototype.zb=function(){return this.qa};ei.prototype.Ab=function(){return this.g};function fi(a,b){return a===b?!0:a&&b?a.Bb()==b.Bb()&&a.zb()==b.zb()&&Nb(a.J().sort(),b.J().sort())&&wb(a.Ab(),b.Ab()):a==b}O("shaka.media.InitSegmentReference",ei);
|
|
293
|
+
ei.prototype.getEndByte=ei.prototype.zb;ei.prototype.getStartByte=ei.prototype.Bb;
|
|
294
|
+
function gi(a,b,c,d,e,f,g,h,k,l,m,n,q,p,u,x){l=void 0===l?[]:l;p=void 0===p?hi:p;this.startTime=a;this.l=this.endTime=b;this.C=c;this.Pa=d;this.qa=e;this.ea=f;this.timestampOffset=g;this.appendWindowStart=h;this.appendWindowEnd=k;this.g=l;this.tilesLayout=void 0===m?"":m;this.A=void 0===n?null:n;this.h=void 0===q?null:q;this.status=p;this.preload=!1;this.j=!0;this.m=!1;this.aesKey=void 0===u?null:u;this.u=null;this.i=-1;this.o=void 0===x?!1:x;this.Xc=this.Yb=!1;a=t(this.g);for(b=a.next();!b.done;b=
|
|
295
|
+
a.next())b.value.gf();this.o&&this.g.length&&this.g[this.g.length-1].ef();this.B=this.mimeType=this.codecs=null}r=gi.prototype;r.J=function(){return this.C()};r.getStartTime=function(){return this.startTime};r.ig=function(){return this.endTime};r.Bb=function(){return this.Pa};r.zb=function(){return this.qa};r.Cg=function(){return this.tilesLayout};r.Bg=function(){return this.A};r.Cb=function(){return this.status};r.Qg=function(){this.status=ii};r.ae=function(){this.preload=!0};r.Mg=function(){return this.preload};
|
|
296
|
+
r.ff=function(){this.j=!1};r.Jg=function(){return this.j};r.gf=function(){this.Yb=!0};r.Lg=function(){return this.Yb};r.ef=function(){this.Xc=!0};r.Kg=function(){return this.Xc};r.df=function(){this.m=!0};r.Hg=function(){return this.m};r.Df=function(a){this.u=a};r.zg=function(){return this.u};r.offset=function(a){this.startTime+=a;this.endTime+=a;this.l+=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.l+=a};
|
|
297
|
+
r.ze=function(a){null==this.h?Ya("Sync attempted without sync time!"):(a=this.h-a-this.startTime,.001<=Math.abs(a)&&this.offset(a))};r.mh=function(a){this.B=a};r.Ab=function(){return this.B};O("shaka.media.SegmentReference",gi);gi.prototype.getSegmentData=gi.prototype.Ab;gi.prototype.setSegmentData=gi.prototype.mh;gi.prototype.syncAgainst=gi.prototype.ze;gi.prototype.offset=gi.prototype.offset;gi.prototype.getThumbnailSprite=gi.prototype.zg;gi.prototype.setThumbnailSprite=gi.prototype.Df;
|
|
298
|
+
gi.prototype.hasByterangeOptimization=gi.prototype.Hg;gi.prototype.markAsByterangeOptimization=gi.prototype.df;gi.prototype.isLastPartial=gi.prototype.Kg;gi.prototype.markAsLastPartial=gi.prototype.ef;gi.prototype.isPartial=gi.prototype.Lg;gi.prototype.markAsPartial=gi.prototype.gf;gi.prototype.isIndependent=gi.prototype.Jg;gi.prototype.markAsNonIndependent=gi.prototype.ff;gi.prototype.isPreload=gi.prototype.Mg;gi.prototype.markAsPreload=gi.prototype.ae;gi.prototype.markAsUnavailable=gi.prototype.Qg;
|
|
299
|
+
gi.prototype.getStatus=gi.prototype.Cb;gi.prototype.getTileDuration=gi.prototype.Bg;gi.prototype.getTilesLayout=gi.prototype.Cg;gi.prototype.getEndByte=gi.prototype.zb;gi.prototype.getStartByte=gi.prototype.Bb;gi.prototype.getEndTime=gi.prototype.ig;gi.prototype.getStartTime=gi.prototype.getStartTime;gi.prototype.getUris=gi.prototype.J;var hi=0,ii=1;gi.Status={yh:hi,Fh:ii,Dh:2};function ji(){}O("shaka.media.ManifestParser",ji);ji.unregisterParserByMime=function(a){delete ki[a]};ji.registerParserByMime=function(a,b){ki[a]=b};ji.registerParserByExtension=function(){pb("ManifestParser.registerParserByExtension","Please use an ManifestParser with registerParserByMime function.")};ji.AccessibilityPurpose={Gh:"visually impaired",Ah:"hard of hearing"};var ki={};function Y(a,b,c){this.i=a;this.u=b;this.m=this.l=Infinity;this.g=1;this.h=this.j=null;this.A=0;this.C=!0;this.I=!1;this.F=0;this.D=void 0===c?!0:c;this.H=0;this.o=!1;this.B=a}r=Y.prototype;r.getDuration=function(){return this.l};r.pg=function(){return this.g};r.Bf=function(a){this.i=a};r.rb=function(a){this.l=a};r.tg=function(){return this.i};r.kh=function(a){this.A=a};r.kd=function(a){a&&!this.C&&(this.I=!0);this.C=a};r.Cf=function(a){this.m=a};r.Qc=function(){return this.m};
|
|
300
|
+
r.zf=function(a){this.u=a};r.hg=function(){return this.u};r.Tg=function(a,b){if(0!=a.length){var c=a[a.length-1].end+b;this.de(a[0].start+b);this.g=a.reduce(function(d,e){return Math.max(d,e.end-e.start)},this.g);this.h=Math.max(this.h,c);null!=this.i&&this.D&&!this.o&&(this.i=(Date.now()+this.A)/1E3-this.h-this.g)}};
|
|
301
|
+
r.lf=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.g=Math.max(this.g,e.endTime-e.startTime));this.de(b);this.h=Math.max(this.h,c);null!=this.i&&this.D&&!this.o&&(this.i=d-this.h-this.g)}};r.cf=function(){this.o=!0};r.Ng=function(){return this.o};r.Af=function(a){this.B=a};r.lg=function(){return this.B};
|
|
302
|
+
r.de=function(a){null==this.j?this.j=a:this.I||(this.j=Math.min(this.j,a))};r.Sg=function(a){this.g=Math.max(this.g,a)};r.offset=function(a){null!=this.j&&(this.j+=a);null!=this.h&&(this.h+=a)};r.X=function(){return Infinity==this.l&&!this.C};r.Vb=function(){return Infinity!=this.l&&!this.C};r.Rc=function(){return Math.max(this.F,this.oc()-this.m)};r.Ef=function(a){this.F=a};
|
|
303
|
+
r.oc=function(){return this.X()||this.Vb()?Math.min(Math.max(0,(Date.now()+this.A)/1E3-this.g-this.i)+this.H,this.l):this.h?Math.min(this.h,this.l):this.l};r.nc=function(a){var b=Math.max(this.j,this.F);return Infinity==this.m?Math.ceil(1E3*b)/1E3:Math.max(b,Math.min(this.oc()-this.m+a,this.Va()))};r.pb=function(){return this.nc(0)};r.Va=function(){return Math.max(0,this.oc()-(this.X()||this.Vb()?this.u:0))};r.vh=function(){return null==this.i||null!=this.h&&this.D?!1:!0};
|
|
304
|
+
r.jh=function(a){this.H=a};O("shaka.media.PresentationTimeline",Y);Y.prototype.setAvailabilityTimeOffset=Y.prototype.jh;Y.prototype.usingPresentationStartTime=Y.prototype.vh;Y.prototype.getSeekRangeEnd=Y.prototype.Va;Y.prototype.getSeekRangeStart=Y.prototype.pb;Y.prototype.getSafeSeekRangeStart=Y.prototype.nc;Y.prototype.getSegmentAvailabilityEnd=Y.prototype.oc;Y.prototype.setUserSeekStart=Y.prototype.Ef;Y.prototype.getSegmentAvailabilityStart=Y.prototype.Rc;Y.prototype.isInProgress=Y.prototype.Vb;
|
|
305
|
+
Y.prototype.isLive=Y.prototype.X;Y.prototype.offset=Y.prototype.offset;Y.prototype.notifyMaxSegmentDuration=Y.prototype.Sg;Y.prototype.notifyMinSegmentStartTime=Y.prototype.de;Y.prototype.getInitialProgramDateTime=Y.prototype.lg;Y.prototype.setInitialProgramDateTime=Y.prototype.Af;Y.prototype.isStartTimeLocked=Y.prototype.Ng;Y.prototype.lockStartTime=Y.prototype.cf;Y.prototype.notifySegments=Y.prototype.lf;Y.prototype.notifyTimeRange=Y.prototype.Tg;Y.prototype.getDelay=Y.prototype.hg;
|
|
306
|
+
Y.prototype.setDelay=Y.prototype.zf;Y.prototype.getSegmentAvailabilityDuration=Y.prototype.Qc;Y.prototype.setSegmentAvailabilityDuration=Y.prototype.Cf;Y.prototype.setStatic=Y.prototype.kd;Y.prototype.setClockOffset=Y.prototype.kh;Y.prototype.getPresentationStartTime=Y.prototype.tg;Y.prototype.setDuration=Y.prototype.rb;Y.prototype.setPresentationStartTime=Y.prototype.Bf;Y.prototype.getMaxSegmentDuration=Y.prototype.pg;Y.prototype.getDuration=Y.prototype.getDuration;function li(a){this.g=a;this.j=null;this.i=0;this.l=!1}r=li.prototype;r.getNumReferences=function(){return this.g.length};r.getNumEvicted=function(){return this.i};r.release=function(){this.l||(this.g=[],this.j&&this.j.stop(),this.j=null)};r.Rg=function(){this.l=!0};r.Rb=function(a){for(var b=t(this.g),c=b.next();!c.done;c=b.next())a(c.value)};
|
|
307
|
+
r.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};r.get=function(a){if(0==this.g.length)return null;a-=this.i;return 0>a||a>=this.g.length?null:this.g[a]};r.offset=function(a){if(!this.l)for(var b=t(this.g),c=b.next();!c.done;c=b.next())c.value.offset(a)};
|
|
308
|
+
r.ce=function(a){if(!this.l&&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,y(a))}};r.$c=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.ce(a);this.gb(b)};r.gb=function(a){if(!this.l){var b=this.g.length;this.g=this.g.filter(function(c){return c.endTime>a});this.i+=b-this.g.length}};
|
|
309
|
+
r.Kc=function(a,b,c){c=void 0===c?!1:c;if(!this.l){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 gi(a.startTime,b,a.C,a.Pa,a.qa,a.ea,a.timestampOffset,a.appendWindowStart,a.appendWindowEnd,a.g,a.tilesLayout,a.A,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)}};
|
|
310
|
+
r.Fe=function(a,b){var c=this;this.l||(this.j&&this.j.stop(),this.j=new Tc(function(){var d=b();d?c.g.push.apply(c.g,y(d)):(c.j.stop(),c.j=null)}),this.j.Sa(a))};li.prototype[Symbol.iterator]=function(){return this.mb(0)};
|
|
311
|
+
li.prototype.mb=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.j;)g--,h=e.g[g];if(!h.j)return Ya("No independent partial segment found!"),null}c?d--:d++;f=g-1;break}}return new mi(this,d,f,c)};function ni(a,b,c){a=new gi(a,a+b,function(){return c},0,null,null,a,a,a+b);return new li([a])}
|
|
312
|
+
O("shaka.media.SegmentIndex",li);li.forSingleSegment=ni;li.prototype.getIteratorForTime=li.prototype.mb;li.prototype.updateEvery=li.prototype.Fe;li.prototype.fit=li.prototype.Kc;li.prototype.evict=li.prototype.gb;li.prototype.mergeAndEvict=li.prototype.$c;li.prototype.offset=li.prototype.offset;li.prototype.get=li.prototype.get;li.prototype.find=li.prototype.find;li.prototype.markImmutable=li.prototype.Rg;li.prototype.release=li.prototype.release;li.prototype.getNumEvicted=li.prototype.getNumEvicted;
|
|
313
|
+
li.prototype.getNumReferences=li.prototype.getNumReferences;function mi(a,b,c,d){this.i=a;this.h=b;this.g=c;this.reverse=d}r=mi.prototype;r.bc=function(a){this.reverse=a};r.$f=function(){return this.h};r.current=function(){var a=this.i.get(this.h);a&&0<a.g.length&&a.o&&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};
|
|
314
|
+
r.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.o&&this.g==a.g.length&&(this.h++,this.g=0)):(this.h++,this.g=0);a=this.current();return{value:a,done:!a}};r.oe=function(){var a=this.current();if(a.Yb&&!a.j&&(a=this.i.get(this.h))&&0<a.g.length)for(var b=a.g[this.g];b.j&&!(0>=this.g);)this.g--,b=a.g[this.g]};
|
|
315
|
+
O("shaka.media.SegmentIterator",mi);mi.prototype.resetToLastIndependent=mi.prototype.oe;mi.prototype.next=mi.prototype.next;mi.prototype.current=mi.prototype.current;mi.prototype.currentPosition=mi.prototype.$f;mi.prototype.setReverse=mi.prototype.bc;function oi(){li.call(this,[]);this.h=[]}sa(oi,li);r=oi.prototype;r.clone=function(){var a=new oi;a.h=this.h.slice();a.i=this.i;return a};r.release=function(){for(var a=t(this.h),b=a.next();!b.done;b=a.next())b.value.release();this.h=[]};
|
|
316
|
+
r.Rb=function(a){for(var b=t(this.h),c=b.next();!c.done;c=b.next())c.value.Rb(a)};r.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};r.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};r.offset=function(){};r.ce=function(){};
|
|
317
|
+
r.gb=function(a){for(var b=t(this.h),c=b.next();!c.done;c=b.next())c.value.gb(a);for(;1<this.h.length&&0==this.h[0].getNumReferences();)a=this.h.shift(),this.i+=a.getNumEvicted(),a.release()};r.$c=function(){};r.Kc=function(){};r.Fe=function(){};O("shaka.media.MetaSegmentIndex",oi);oi.prototype.updateEvery=oi.prototype.Fe;oi.prototype.fit=oi.prototype.Kc;oi.prototype.mergeAndEvict=oi.prototype.$c;oi.prototype.evict=oi.prototype.gb;oi.prototype.merge=oi.prototype.ce;oi.prototype.offset=oi.prototype.offset;
|
|
318
|
+
oi.prototype.get=oi.prototype.get;oi.prototype.find=oi.prototype.find;oi.prototype.forEachTopLevelReference=oi.prototype.Rb;oi.prototype.release=oi.prototype.release;function pi(a,b){var c=qi();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}
|
|
319
|
+
function ri(a){var b,c;return L(function(d){if(1==d.g){if(a.g>=a.l)if(a.i)a.g=1,a.h=a.j;else throw new S(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 J(d,new Promise(function(e){(new Tc(e)).Z(c/1E3)}),2)}a.h*=a.m;K(d)})}function qi(){return{maxAttempts:2,baseDelay:1E3,backoffFactor:2,fuzzFactor:.5,timeout:3E4,stallTimeout:5E3,connectionTimeout:1E4}};function si(){var a,b,c=new Promise(function(d,e){a=d;b=e});c.resolve=a;c.reject=b;return c}si.prototype.resolve=function(){};si.prototype.reject=function(){};function ti(a,b){this.promise=a;this.i=b;this.g=null}function ui(a){return new ti(Promise.reject(a),function(){return Promise.resolve()})}function vi(){var a=Promise.reject(new S(2,7,7001));a.catch(function(){});return new ti(a,function(){return Promise.resolve()})}function wi(a){return new ti(Promise.resolve(a),function(){return Promise.resolve()})}function xi(a){return new ti(a,function(){return a.catch(function(){})})}ti.prototype.abort=function(){this.g||(this.g=this.i());return this.g};
|
|
320
|
+
ti.prototype.finally=function(a){this.promise.then(function(){return a(!0)},function(){return a(!1)});return this};ti.prototype.eb=function(a,b){function c(h){return function(k){if(e.g&&h)f.reject(g);else{var l=h?a:b;l?d=yi(l,k,f):(h?f.resolve:f.reject)(k)}}}function d(){f.reject(g);return e.abort()}var e=this,f=new si;f.catch(function(){});var g=new S(2,7,7001);this.promise.then(c(!0),c(!1));return new ti(f,function(){return d()})};
|
|
321
|
+
function yi(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()}}}O("shaka.util.AbortableOperation",ti);ti.prototype.chain=ti.prototype.eb;ti.prototype["finally"]=ti.prototype.finally;ti.all=function(a){return new ti(Promise.all(a.map(function(b){return b.promise})),function(){return Promise.all(a.map(function(b){return b.abort()}))})};
|
|
322
|
+
ti.prototype.abort=ti.prototype.abort;ti.notAbortable=xi;ti.completed=wi;ti.aborted=vi;ti.failed=ui;function zi(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}
|
|
323
|
+
zi.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)};zi.prototype.stopImmediatePropagation=function(){this.g=!0};zi.prototype.stopPropagation=function(){};O("shaka.util.FakeEvent",zi);function Ai(){this.ka=new db;this.Jf=this}Ai.prototype.addEventListener=function(a,b){this.ka&&this.ka.push(a,b)};Ai.prototype.removeEventListener=function(a,b){this.ka&&this.ka.remove(a,b)};Ai.prototype.dispatchEvent=function(a){if(!this.ka)return!0;var b=this.ka.get(a.type)||[],c=this.ka.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.Jf;a.currentTarget=this.Jf;try{c.handleEvent?c.handleEvent(a):c.call(this,a)}catch(d){}if(a.g)break}return a.defaultPrevented};
|
|
324
|
+
Ai.prototype.release=function(){this.ka=null};function Bi(){this.g=[]}function Ci(a,b){a.g.push(b.finally(function(){Lb(a.g,b)}))}Bi.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 Di(a,b,c,d,e,f){Ai.call(this);this.i=!1;this.m=new Bi;this.g=new Set;this.h=new Set;this.l=a||null;this.j=b||null;this.A=c||null;this.B=d||null;this.D=e||null;this.C=f||null;this.o=this.u=!1}sa(Di,Ai);r=Di.prototype;r.ue=function(a){this.u=a};r.ve=function(a){this.o=a};function Ei(a,b,c,d){c=c||Fi;var e=Gi[a];if(!e||c>=e.priority)Gi[a]={priority:c,gd:b,Xg:void 0===d?!1:d}}
|
|
325
|
+
function Hi(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)}r.$g=function(a){this.g.add(a)};r.sh=function(a){this.g.delete(a)};r.Xf=function(){this.g.clear()};r.ah=function(a){this.h.add(a)};r.th=function(a){this.h.delete(a)};r.Yf=function(){this.h.clear()};
|
|
326
|
+
function Ii(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}}r.destroy=function(){this.i=!0;this.g.clear();this.h.clear();Ai.prototype.release.call(this);return this.m.destroy()};
|
|
327
|
+
r.request=function(a,b,c){var d=this,e=new Ji;if(this.i){var f=Promise.reject(new S(2,7,7001));f.catch(function(){});return new Ki(f,function(){return Promise.resolve()},e)}b.method=b.method||"GET";b.headers=b.headers||{};b.retryParameters=b.retryParameters?He(b.retryParameters):qi();b.uris=He(b.uris);f=Li(this,a,b,c);var g=f.eb(function(){return Mi(d,a,b,c,new pi(b.retryParameters,!1),0,null,e)}),h=g.eb(function(q){return Ni(d,a,q,c)}),k=Date.now(),l=0;f.promise.then(function(){l=Date.now()-k},function(){});
|
|
328
|
+
var m=0;g.promise.then(function(){m=Date.now()},function(){});var n=h.eb(function(q){var p=Date.now()-m,u=q.response;u.timeMs+=l;u.timeMs+=p;q.Gg||!d.l||u.fromCache||"HEAD"==b.method||a!=Oi||d.l(u.timeMs,u.data.byteLength,Pi(c));d.C&&d.C(a,u,c);return u},function(q){q&&(q.severity=2);throw q;});f=new Ki(n.promise,function(){return n.abort()},e);Ci(this.m,f);return f};
|
|
329
|
+
function Li(a,b,c,d){function e(h){f=f.eb(function(){c.body&&(c.body=zb(c.body));return h(b,c,d)})}var f=wi(void 0);a.B&&e(a.B);a=t(a.g);for(var g=a.next();!g.done;g=a.next())e(g.value);return f.eb(void 0,function(h){if(h instanceof S&&7001==h.code)throw h;throw new S(2,1,1006,h);})}
|
|
330
|
+
function Mi(a,b,c,d,e,f,g,h){a.u&&(c.uris[f]=c.uris[f].replace("https://","http://"));a.o&&(c.uris[f]=c.uris[f].replace("http://","https://"));0<f&&a.D&&a.D(b,d,c.uris[f],c.uris[f-1]);var k=new sc(c.uris[f]),l=k.ib,m=!1;l||(l=location.protocol,l=l.slice(0,-1),tc(k,l),c.uris[f]=k.toString());l=l.toLowerCase();var n=(l=Gi[l])?l.gd:null;if(!n)return ui(new S(2,1,1E3,k));var q=l.Xg,p=null,u=null,x=!1,v=!1,z;return xi(ri(e)).eb(function(){if(a.i)return vi();z=Date.now();var w=0;c.requestStartTime=Date.now();
|
|
331
|
+
var E=n(c.uris[f],c,b,function(I,A,C){p&&p.stop();u&&u.Z(D/1E3);a.l&&b==Oi&&(w++,c.packetNumber=w,a.l(I,A,Pi(d),c),m=!0,h.g=C)},function(I){v=!0;c.timeToFirstByte=Date.now()-c.requestStartTime;a.j&&a.j(I,c,b)});if(!q)return E;var F=c.retryParameters.connectionTimeout;F&&(p=new Tc(function(){x=!0;E.abort()}),p.Z(F/1E3));var D=c.retryParameters.stallTimeout;D&&(u=new Tc(function(){x=!0;E.abort()}));return E}).eb(function(w){p&&p.stop();u&&u.stop();void 0==w.timeMs&&(w.timeMs=Date.now()-z);var E={response:w,
|
|
332
|
+
Gg:m};!v&&a.j&&a.j(w.headers,c,b);return E},function(w){p&&p.stop();u&&u.stop();if(a.A){var E=null,F=0;w instanceof S&&(E=w,1001==w.code&&(F=w.data[1]));a.A(c,E,F,x)}if(a.i)return vi();x&&(w=new S(1,1,1003,c.uris[f],b));if(w instanceof S){if(7001==w.code)throw w;if(1010==w.code)throw g;if(1==w.severity){E=(new Map).set("error",w);E=new zi("retry",E);E.cancelable=!0;a.dispatchEvent(E);if(E.defaultPrevented)throw w;f=(f+1)%c.uris.length;return Mi(a,b,c,d,e,f,w,h)}}throw w;})}
|
|
333
|
+
function Ni(a,b,c,d){var e=wi(void 0);a=t(a.h);for(var f=a.next(),g={};!f.done;g={uf:void 0},f=a.next())g.uf=f.value,e=e.eb(function(h){return function(){var k=c.response;k.data&&(k.data=zb(k.data));return(0,h.uf)(b,k,d)}}(g));return e.eb(function(){return c},function(h){var k=2;if(h instanceof S){if(7001==h.code)throw h;k=h.severity}throw new S(k,1,1007,h);})}function Pi(a){if(a){var b=a.segment;a=a.stream;if(b&&a&&a.fastSwitching&&b.Yb)return!1}return!0}O("shaka.net.NetworkingEngine",Di);
|
|
334
|
+
Di.prototype.request=Di.prototype.request;Di.prototype.destroy=Di.prototype.destroy;Di.makeRequest=Ii;Di.defaultRetryParameters=function(){return qi()};Di.prototype.clearAllResponseFilters=Di.prototype.Yf;Di.prototype.unregisterResponseFilter=Di.prototype.th;Di.prototype.registerResponseFilter=Di.prototype.ah;Di.prototype.clearAllRequestFilters=Di.prototype.Xf;Di.prototype.unregisterRequestFilter=Di.prototype.sh;Di.prototype.registerRequestFilter=Di.prototype.$g;Di.unregisterScheme=function(a){delete Gi[a]};
|
|
335
|
+
Di.registerScheme=Ei;Di.prototype.setForceHTTPS=Di.prototype.ve;Di.prototype.setForceHTTP=Di.prototype.ue;function Ji(){this.g=0}Di.NumBytesRemainingClass=Ji;function Ki(a,b,c){ti.call(this,a,b);this.h=c}sa(Ki,ti);Di.PendingRequest=Ki;var Oi=1;Di.RequestType={MANIFEST:0,SEGMENT:Oi,LICENSE:2,APP:3,TIMING:4,SERVER_CERTIFICATE:5,KEY:6,ADS:7,CONTENT_STEERING:8};Di.AdvancedRequestType={INIT_SEGMENT:0,MEDIA_SEGMENT:1,MEDIA_PLAYLIST:2,MASTER_PLAYLIST:3,MPD:4,MSS:5};var Fi=3;
|
|
336
|
+
Di.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:Fi};var Gi={};function Qi(){}function Ri(a){try{var b=Si(a);return wi({uri:a,originalUri:a,data:b.data,headers:{"content-type":b.contentType}})}catch(c){return ui(c)}}
|
|
337
|
+
function Si(a){var b=a.split(":");if(2>b.length||"data"!=b[0])throw new S(2,1,1004,a);b=b.slice(1).join(":").split(",");if(2>b.length)throw new S(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=Gd(a):e=zd(a);return{data:e,contentType:c}}O("shaka.net.DataUriPlugin",Qi);Qi.parse=Ri;Ei("data",Ri);function Ti(a){this.o=null;this.A=a;this.F=new Bi;this.l=[];this.i=null;this.j=[];this.B=null;this.D=[];this.C=300;this.m=new Map;this.h=new Map;this.g=null;this.u="UNKNOWN"}Ti.prototype.configure=function(a){this.o=a};Ti.prototype.destroy=function(){this.A=this.o=null;this.l=[];this.i=null;this.j=[];this.D=[];this.m.clear();null!=this.g&&(this.g.stop(),this.g=null);return this.F.destroy()};Ti.prototype.setManifestType=function(a){this.u=a};
|
|
338
|
+
function Ui(a,b){var c,d,e,f,g,h,k;return L(function(l){if(1==l.g)return c=Kd(a.l,[Vi(a,b)]),d=Ii(c,a.o.retryParameters),e=a.A.networkingEngine.request(8,d),Ci(a.F,e),wa(l,2),J(l,e.promise,4);if(2!=l.g)return f=l.h,g=vd(f.data),h=JSON.parse(g),1==h.VERSION&&Wi(a,h,f.uri),xa(l,0);if((k=ya(l))&&7001==k.code)return l.return();null!=a.g&&(a.g.stop(),a.g=null);a.g=new Tc(function(){Ui(a,b)});a.g.Z(a.C);K(l)})}
|
|
339
|
+
function Vi(a,b){if(!a.j.length)return b;b=new sc(b);var c=a.B||a.j[0],d=Math.round(a.A.getBandwidthEstimate()),e=b.g;"DASH"==a.u?(e.add("_DASH_pathway",c),e.add("_DASH_throughput",String(d))):"HLS"==a.u&&(e.add("_HLS_pathway",c),e.add("_HLS_throughput",String(d)));Ic(e)&&xc(b,e);return b.toString()}function Wi(a,b,c){null!=a.g&&(a.g.stop(),a.g=null);var d=b["RELOAD-URI"]||c;a.g=new Tc(function(){Ui(a,d)});if(c=b.TTL)a.C=c;a.g.Z(a.C);a.j=b["PATHWAY-PRIORITY"]||[];a.D=b["PATHWAY-CLONES"]||[]}
|
|
340
|
+
function Xi(a,b,c,d){var e=a.m.get(b);e||(e=new Map);e.set(c,d);a.m.set(b,e)}Ti.prototype.banLocation=function(a){this.h.set(a,Date.now()+6E4)};
|
|
341
|
+
function Yi(a,b){var c=void 0===c?!1:c;b=a.m.get(b)||new Map;for(var d=[],e=t(a.j),f=e.next(),g={};!f.done;g={Zb:void 0},f=e.next())if(g.Zb=f.value,f=b.get(g.Zb))d.push({ke:g.Zb,location:f});else if(f=a.D.find(function(k){return function(l){return l.Bh==k.Zb}}(g))){var h=b.get(f["BASE-ID"]);h&&(f["URI-REPLACEMENT"].Mf?(h=new sc(h),uc(h,f["URI-REPLACEMENT"].Mf),d.push({ke:g.Zb,location:h.toString()})):d.push({ke:g.Zb,location:h}))}e=Date.now();g=t(a.h.keys());for(f=g.next();!f.done;f=g.next())f=f.value,
|
|
342
|
+
h=a.h.get(f),e>h&&a.h.delete(f);d=d.filter(function(k){for(var l=t(a.h.keys()),m=l.next();!m.done;m=l.next())if(m.value.includes((new sc(k.location)).lb))return!1;return!0});d.length&&(a.B=d[0].ke);d=d.map(function(k){return k.location});if(!d.length&&a.i)for(e=t(a.i.split(",")),g=e.next();!g.done;g=e.next())if(g=b.get(g.value))a.B=a.i,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:Kd(a.l,d)};function Zi(a,b,c,d,e){a=Ii(a,d,e);if(0!=b||null!=c)a.headers.Range=c?"bytes="+b+"-"+c:"bytes="+b+"-";return a};function $i(a){var b=this;this.h=[];this.g=[];this.data=[];(new xg).box("moov",Cg).box("moof",Cg).K("pssh",function(c){if(!(1<c.version)){var d=yb(c.reader.h,-12,c.size);b.data.push(d);b.h.push(Id(c.reader.Ya(16)));if(0<c.version){d=c.reader.N();for(var e=0;e<d;e++){var f=Id(c.reader.Ya(16));b.g.push(f)}}}}).parse(a)};function aj(a){var b=ie(a),c=b.split("/")[0];a=je(a);return{type:c,mimeType:b,codecs:a,language:null,height:null,width:null,channelCount:null,sampleRate:null,closedCaptions:new Map,zc:null,colorGamut:null}}
|
|
343
|
+
function bj(a,b,c){function d(A){z=A.name;var C=A.reader;C.skip(24);var B=C.ca(),H=C.ca();C.skip(50);q=String(B);n=String(H);A.reader.ya()&&Cg(A)}function e(A){var C=Mg(A.reader);p=C.channelCount;u=C.sampleRate;f(A.name)}function f(A){A=A.toLowerCase();switch(A){case "avc1":case "avc3":h.push(A+".42E01E");l=!0;break;case "hev1":case "hvc1":h.push(A+".1.6.L93.90");l=!0;break;case "dvh1":case "dvhe":h.push(A+".05.04");l=!0;break;case "vp09":h.push(A+".00.10.08");l=!0;break;case "av01":h.push(A+".0.01M.08");
|
|
344
|
+
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(A),k=!0}}var g=[],h=[],k=!1,l=!1,m=null,n=null,q=null,p=null,u=null,x=null,v=null,z;(new xg).box("moov",Cg).box("trak",Cg).box("mdia",Cg).K("mdhd",function(A){m=Kg(A.reader,A.version).language}).box("minf",Cg).box("stbl",Cg).K("stsd",Eg).box("mp4a",function(A){var C=Mg(A.reader);p=C.channelCount;u=C.sampleRate;A.reader.ya()?Cg(A):f(A.name)}).box("esds",function(A){A=A.reader;for(var C=
|
|
345
|
+
"mp4a",B,H;A.ya();){B=A.P();for(var G=A.P();G&128;)G=A.P();if(3==B)A.ca(),G=A.P(),G&128&&A.ca(),G&64&&A.skip(A.P()),G&32&&A.ca();else if(4==B)H=A.P(),A.skip(12);else if(5==B)break}H&&(C+="."+Pg(H),5==B&&A.ya()&&(B=A.P(),H=(B&248)>>3,31===H&&A.ya()&&(H=32+((B&7)<<3)+((A.P()&224)>>5)),C+="."+H));g.push(C);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",
|
|
346
|
+
d).box("av01",d).box("avcC",function(A){var C=z||"";switch(z){case "dvav":C="avc3";break;case "dva1":C="avc1"}A=A.reader;A.skip(1);A=C+"."+Pg(A.P())+Pg(A.P())+Pg(A.P());h.push(A);l=!0}).box("hvcC",function(A){var C=z||"";switch(z){case "dvh1":C="hvc1";break;case "dvhe":C="hev1"}var B=A.reader;B.skip(1);A=B.P();var H=["","A","B","C"][A>>6],G=A&31,N=B.N(),Q=(A&32)>>5?"H":"L";A=[B.P(),B.P(),B.P(),B.P(),B.P(),B.P()];B=B.P();for(var M=0,P=0;32>P;P++){M|=N&1;if(31==P)break;M<<=1;N>>=1}C=C+("."+H+G)+("."+
|
|
347
|
+
Pg(M,!0));C+="."+Q+B;H="";for(G=A.length;G--;)if((Q=A[G])||H)H="."+Q.toString(16).toUpperCase()+H;C+=H;h.push(C);l=!0}).box("dvcC",function(A){var C=z||"";switch(z){case "hvc1":C="dvh1";break;case "hev1":C="dvhe";break;case "avc1":C="dva1";break;case "avc3":C="dvav"}var B=A.reader;B.skip(2);A=B.P();B=B.P();h.push(C+"."+Qg(A>>1&127)+"."+Qg(A<<5&32|B>>3&31));l=!0}).K("vpcC",function(A){var C=z||"",B=A.reader;A=B.P();var H=B.P();B=B.P()>>4&15;h.push(C+"."+Qg(A)+"."+Qg(H)+"."+Qg(B));l=!0}).box("av1C",
|
|
348
|
+
function(A){var C=z||"",B=A.reader;B.skip(1);A=B.P();B=B.P();var H=A>>>5,G=(B&64)>>6;h.push(C+"."+H+"."+Qg(A&31)+(B>>>7?"H":"M")+"."+Qg(2===H&&G?(B&32)>>5?12:10:G?10:8)+"."+((B&16)>>4)+"."+((B&8)>>3)+((B&4)>>2)+(B&3)+"."+Qg(1)+"."+Qg(1)+"."+Qg(1)+".0");l=!0}).box("enca",Gg).box("encv",Fg).box("sinf",Cg).box("frma",function(A){A=Ng(A.reader).codec;f(A)}).box("colr",function(A){h=h.map(function(H){if(H.startsWith("av01.")){var G=A.reader,N=G.Ea(),Q=G.Ya(4);var M=String.fromCharCode(Q[0]);M+=String.fromCharCode(Q[1]);
|
|
349
|
+
M+=String.fromCharCode(Q[2]);M+=String.fromCharCode(Q[3]);if("nclx"===M){Q=G.ca();M=G.ca();var P=G.ca(),aa=G.P()>>7,R=H.split(".");10==R.length&&(R[6]=Qg(Q),R[7]=Qg(M),R[8]=Qg(P),R[9]=String(aa),H=R.join("."))}G.seek(N)}return H});var C=Og(A.reader),B=C.colorGamut;x=C.zc;v=B}).parse(a||b,!0);if(!g.length&&!h.length)return null;var w=k&&!l,E=new Map;if(l&&!c){c=new Eb("video/mp4");a&&c.init(a);try{c.i(b);for(var F=t(c.j()),D=F.next();!D.done;D=F.next()){var I=D.value;E.set(I,I)}}catch(A){}c.g()}return{type:w?
|
|
350
|
+
"audio":"video",mimeType:w?"audio/mp4":"video/mp4",codecs:cj(g.concat(h)).join(", "),language:m,height:n,width:q,channelCount:p,sampleRate:u,closedCaptions:E,zc:x,colorGamut:v}}function cj(a){var b=new Set,c=[];a=t(a);for(var d=a.next();!d.done;d=a.next()){d=d.value;var e=ce(d);b.has(e)||(c.push(d),b.add(e))}b=Rd("audio",c);d=Rd("video",c);a=Rd(Qd,c);d=dj(d);b=b.concat(d).concat(a);return c.length&&!b.length?c:b}
|
|
351
|
+
function dj(a){if(1>=a.length)return a;var b=a.find(function(c){return c.startsWith("dvh1.")||c.startsWith("dvhe.")||c.startsWith("dav1.")});return b?lb('video/mp4; codecs="'+b+'"')?[b]:a.filter(function(c){return c!=b}):a}function ej(a){var b=null;(new xg).box("moov",Cg).box("trak",Cg).box("mdia",Cg).box("minf",Cg).box("stbl",Cg).K("stsd",Eg).box("encv",Fg).box("enca",Gg).box("sinf",Cg).box("schi",Cg).K("tenc",function(c){c=c.reader;c.P();c.P();c.P();c.P();b=Id(c.Ya(16))}).parse(a,!0);return b};/*
|
|
352
|
+
@license
|
|
353
|
+
tXml
|
|
354
|
+
Copyright 2015 Tobias Nickel
|
|
355
|
+
SPDX-License-Identifier: MIT
|
|
356
|
+
*/
|
|
357
|
+
function fj(a,b,c){a=gj(a,void 0===c?!1:c);return!b&&a.length?a[0]:(a=a.find(function(d){return d.tagName===b}))?a:null}
|
|
358
|
+
function gj(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)||
|
|
359
|
+
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 p=a.charCodeAt(e);p&&39!==p&&34!==p&&!(64<p&&91>p||96<p&&123>
|
|
360
|
+
p)&&62!==p;)e++,p=a.charCodeAt(e);var u=e+1;e=a.indexOf(a[e],u);u=a.slice(u,e);if(39===p||34===p){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:")){p=u;var x=q.split(":")[1];hj.set(p,x);ij.set(x,p)}"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=
|
|
361
|
+
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,y(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("")}
|
|
362
|
+
function jj(a){return"string"===typeof a}function kj(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 lj(a){if("string"===typeof a)return Cd(a);a=a.children.reduce(function(b,c){return"string"===typeof c?b+c:b},"");return""===a?null:Cd(a)}function mj(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())mj(d.value,b,c)}return c}
|
|
363
|
+
function nj(a,b,c){b=hj.has(b)?hj.get(b):"";return a.attributes[b+":"+c]||null}function oj(a,b,c){b=t(b);for(var d=b.next();!d.done;d=b.next())if(d=nj(a,d.value,c))return d;return null}function pj(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}var hj=new Map,ij=new Map;function qj(){var a=this;this.g=this.i=null;this.B=1;this.u=new Map;this.F=new Map;this.O=new Map;this.O.set("video",new Map);this.O.set("audio",new Map);this.O.set(Qd,new Map);this.O.set("image",new Map);this.xa=new Set;this.h=new Map;this.l=null;this.M="";this.ra=new $h;this.I=-1;this.aa=Infinity;this.$=this.fb=this.va=!1;this.A=new Tc(function(){rj(a)});this.ja=sj;this.o=null;this.wa=0;this.m=Infinity;this.ma=this.la=this.T=0;this.W=new Bi;this.C=new Map;this.D=new Map;this.ba=new Map;this.ka=
|
|
364
|
+
new Map;this.L=new Map;this.ga=new Map;this.ha=new Map;this.cb=this.H=!1;this.bb=new Ua(5);this.j=null;this.fa=!0}r=qj.prototype;r.configure=function(a){this.g=a;this.j&&this.j.configure(this.g)};r.start=function(a,b){var c=this,d;return L(function(e){return 1==e.g?(c.i=b,c.H=b.isLowLatencyMode(),J(e,tj(c,[a]),2)):3!=e.g?(d=e.h,c.M=d.uri,J(e,uj(c,d.data,a),3)):e.return(c.o)})};
|
|
365
|
+
r.stop=function(){this.A&&(this.A.stop(),this.A=null);var a=[];this.W&&(a.push(this.W.destroy()),this.W=null);this.g=this.i=null;this.xa.clear();this.o=null;this.h.clear();this.F.clear();this.D.clear();this.u.clear();this.ba.clear();this.ka.clear();this.L.clear();this.ga.clear();this.ha.clear();this.j&&this.j.destroy();return Promise.all(a)};
|
|
366
|
+
r.update=function(){var a=this,b,c,d,e,f,g,h,k,l;return L(function(m){if(1==m.g){if(!vj(a))return m.return();b=[];c=Array.from(a.h.values());a.m=Infinity;d=c.filter(function(n){return n.stream.segmentIndex});e=t(d);for(f=e.next();!f.done;f=e.next())g=f.value,b.push(wj(a,g));return J(m,Promise.all(b),2)}xj(a,d.map(function(n){return n.stream}));h=d.some(function(n){return 0==n.qc});d.length&&!h&&(k=yj,zj(a,k.Of),l=d.map(function(n){return n.nb}),a.l.rb(Math.min.apply(Math,y(l))),a.i.updateDuration());
|
|
367
|
+
h&&Aj(a);K(m)})};function Bj(a,b){return vj(a)?a.O.get(b.type):b.Zc}
|
|
368
|
+
function wj(a,b){var c,d,e,f,g,h,k,l,m,n,q,p,u,x,v,z,w,E,F,D,I,A,C,B,H,G,N,Q,M,P;return L(function(aa){if(1==aa.g){c=[];d=t(b.J());for(e=d.next();!e.done;e=d.next())f=e.value,g=new sc(f),h=g.g,b.Fc&&(0<=b.Wa&&h.add("_HLS_msn",String(b.Wa)),0<=b.Xa&&h.add("_HLS_part",String(b.Xa))),b.Gc&&h.add("_HLS_skip","YES"),Ic(h)&&xc(g,h),c.push(g.toString());return J(aa,tj(a,c,!0),2)}if(3!=aa.g){k=aa.h;if(!b.stream.segmentIndex)return aa.return();l=ai(a.ra,k.data);if(1!=l.type)throw new S(2,4,4017);m=k.uri;m==
|
|
369
|
+
k.originalUri||b.J().includes(m)||b.tf.push(m);n=Qh(l.g,"EXT-X-DEFINE");q=Cj(a,n,m);p=b.stream;u=Bj(a,b);return J(aa,Dj(a,l,p.mimeType,b.J,q),3)}x=aa.h;v=x.keyIds;z=x.drmInfos;w=function(R,W){return R.size===W.size&&[].concat(y(R)).every(function(U){return W.has(U)})};w(p.keyIds,v)||(p.keyIds=v,p.drmInfos=z,a.i.newDrmInfo(p));E=Ej(a,l,u,q,b.J,b.type);F=E.segments;if(D=E.bandwidth)p.bandwidth=D;p.segmentIndex.$c(F,a.l.Rc());F.length&&(I=Th(l.g,"EXT-X-MEDIA-SEQUENCE",0),C=(A=Sh(l.g,"EXT-X-SKIP"))?Number(X(A,
|
|
370
|
+
"SKIPPED-SEGMENTS")):0,B=Fj(I,F),H=B.Wa,G=B.Xa,b.Wa=H+C,b.Xa=G,N=u.get(I),p.segmentIndex.gb(N));Q=p.segmentIndex.g[0]||null;b.Fb=Q.startTime;M=F[F.length-1];b.nb=M.endTime;if(P=Sh(l.g,"EXT-X-ENDLIST"))b.qc=!0;Gj(a,l);K(aa)})}r.onExpirationUpdated=function(){};r.onInitialVariantChosen=function(){};r.banLocation=function(a){this.j&&this.j.banLocation(a)};
|
|
371
|
+
function Hj(a,b,c){c=void 0===c?!1:c;for(var d=-1==a.I,e=t(b),f=e.next();!f.done;f=e.next()){f=f.value;var g=f.stream.segmentIndex,h=Bj(a,f);if(g=g.g[0]||null){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.I=Math.max(a.I,l));f.xd=l;break}}}}if(!(0>a.I))for(b=t(b),d=b.next();!d.done;d=b.next())if(d=d.value,Ij(a,d.type)||c)if(e=d.stream.segmentIndex)if(f=a.I-d.xd,0<f&&(e.g.splice(0,f),e=e.g[0]||null))e=-e.startTime,d.stream.segmentIndex.offset(e),
|
|
372
|
+
Jj(a,d,e)}
|
|
373
|
+
function Kj(a,b){if(Infinity==a.aa){b=t(b);for(var c=b.next();!c.done;c=b.next())c=c.value.stream.segmentIndex.g[0]||null,null!=c&&null!=c.h&&(a.aa=Math.min(a.aa,c.h))}b=a.aa;if(Infinity!=b){c=t(a.h.values());for(var d=c.next();!d.done;d=c.next())if(d=d.value,!Ij(a,d.type)){var e=d.stream.segmentIndex;if(null!=e){var f=e.g[0]||null;if(f)if(null==f.h)Ya("Missing EXT-X-PROGRAM-DATE-TIME for stream",d.J(),"Expect AV sync issues!");else for(Jj(a,d,f.h-b-f.startTime),d=t(e),e=d.next();!e.done;e=d.next())e.value.ze(b)}}}}
|
|
374
|
+
function Jj(a,b,c){b.Fb+=c;b.nb+=c;a=Bj(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.J()}
|
|
375
|
+
function uj(a,b,c){var d,e,f,g,h,k,l,m,n,q,p,u,x,v,z,w,E,F,D,I,A,C,B,H,G,N,Q,M,P,aa,R,W,U,ba,pa,oa,qa,Aa,Ha;return L(function(Da){switch(Da.g){case 1:d=ai(a.ra,b);e=Qh(d.g,"EXT-X-DEFINE");f=[];g=[];h=[];a.l=new Y(null,0);a.l.kd(!0);k=function(){return[c]};if(1==d.type)return a.fa=!1,v=Qh(d.g,"EXT-X-DEFINE"),z=Cj(a,v,a.M),J(Da,Lj(a,d,k,z),7);Mj(a,e);l=Qh(d.g,"EXT-X-MEDIA");m=Qh(d.g,"EXT-X-STREAM-INF");n=Qh(d.g,"EXT-X-IMAGE-STREAM-INF");q=Qh(d.g,"EXT-X-I-FRAME-STREAM-INF");p=Qh(d.g,"EXT-X-SESSION-KEY");
|
|
376
|
+
u=Qh(d.g,"EXT-X-SESSION-DATA");x=Qh(d.g,"EXT-X-CONTENT-STEERING");Nj(a,u);return J(Da,Oj(a,x),4);case 4:return Pj(a,m),Qj(a,l),J(Da,Rj(a,m,p,l,k,a.u),5);case 5:return f=Da.h,g=Sj(a,l),J(Da,Tj(a,n,q),6);case 6:h=Da.h;Da.s(3);break;case 7:return w=Da.h,E=w.type,F=w.mimeType,D=w.codecs,I=w.language,A=w.height,C=w.width,B=w.channelCount,H=w.sampleRate,G=w.closedCaptions,N=w.zc,Q=w.colorGamut,J(Da,Uj(a,a.B++,z,d,k,D,E,I,!0,"Media Playlist",B,G,null,!1,H,!1,F),8);case 8:M=Da.h,a.h.set(c,M),"video"==E&&
|
|
377
|
+
Vj(M.stream,C,A,null,N,null,Q),f.push({id:0,language:ze(I||"und"),disabledUntilTime:0,primary:!0,audio:"audio"==E?M.stream:null,video:"video"==E?M.stream:null,bandwidth:M.stream.bandwidth||0,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]});case 3:if(!a.i)throw new S(2,7,7001);1==d.type&&(vj(a)&&(Wj(a,d),P=a.m,a.A.Z(P)),aa=Array.from(a.h.values()),Xj(a,aa),Aj(a));a.o={presentationTimeline:a.l,variants:f,textStreams:g,imageStreams:h,offlineSessionIds:[],minBufferTime:0,sequenceMode:a.g.hls.sequenceMode,
|
|
378
|
+
ignoreManifestTimestampsInSegmentsMode:a.g.hls.ignoreManifestTimestampsInSegmentsMode,type:"HLS",serviceDescription:null,nextUrl:null};if(a.$||!a.g.hls.disableCodecGuessing){Da.s(9);break}R=[];W=t(a.o.variants);for(U=W.next();!U.done;U=W.next())ba=U.value,ba.audio&&""===ba.audio.codecs&&R.push(ba.audio.createSegmentIndex()),ba.video&&""===ba.video.codecs&&R.push(ba.video.createSegmentIndex());return J(Da,Promise.all(R),9);case 9:a.i.makeTextStreamsForClosedCaptions(a.o);if(1==f.length){pa=[];oa=f[0];
|
|
379
|
+
qa=t([oa.video,oa.audio]);for(Aa=qa.next();!Aa.done;Aa=qa.next())(Ha=Aa.value)&&!Ha.segmentIndex&&pa.push(Ha.createSegmentIndex());if(0<pa.length)return J(Da,Promise.all(pa),0)}Da.s(0)}})}
|
|
380
|
+
function Lj(a,b,c,d){var e,f,g,h,k,l,m,n,q,p,u,x,v,z,w,E,F,D,I,A,C;return L(function(B){switch(B.g){case 1:e=aj(a.g.hls.mediaPlaylistFullMimeType);if(!b.segments.length)return B.return(e);f=b.segments[0];g=Uh(c(),f.i,d);h=g[0];k=new sc(h);l=k.Ha.split(".").pop();if(m=Yj[l])return B.return(aj(m));n=Oi;q=null;p=Zj(a,b,f.g,c,d);a.ba.clear();if(!p){B.s(2);break}u=Zi(p.J(),p.Bb(),p.zb(),a.g.retryParameters);return J(B,ak(a,u,n,{type:0}),3);case 3:x=B.h,q=x.data;case 2:v=0;z=null;if(w=Sh(f.g,"EXT-X-BYTERANGE"))E=
|
|
381
|
+
t(bk(null,w.value)),v=E.next().value,z=E.next().value;F=Zi(g,v,z,a.g.retryParameters);return J(B,ak(a,F,n,{type:1}),4);case 4:D=B.h;(I=D.headers["content-type"])&&(I=I.split(";")[0].toLowerCase());if("ts"==l||"video/mp2t"==I){var H=D.data,G=a.g.disableAudio,N=a.g.disableVideo,Q=a.g.disableText;var M=yb(H);var P=(new wh).parse(M),aa=P.lc();M=P.Sd();var R=[],W=!1,U=!1;if(!G)switch(aa.audio){case "aac":case "aac-loas":P.Ja().length&&(R.push("mp4a.40.2"),W=!0);break;case "mp3":P.Ja().length&&(R.push("mp4a.40.34"),
|
|
382
|
+
W=!0);break;case "ac3":P.Ja().length&&(R.push("ac-3"),W=!0);break;case "ec3":P.Ja().length&&(R.push("ec-3"),W=!0);break;case "opus":P.Ja().length&&(R.push("opus"),W=!0)}if(!N)switch(aa.video){case "avc":M.codec?R.push(M.codec):R.push("avc1.42E01E");U=!0;break;case "hvc":M.codec?R.push(M.codec):R.push("hvc1.1.6.L93.90");U=!0;break;case "av1":R.push("av01.0.01M.08"),U=!0}if(R.length){G=W&&!U;N=new Map;if(U&&!Q){Q=new Eb("video/mp2t");Q.i(H);H=t(Q.j());for(U=H.next();!U.done;U=H.next())U=U.value,N.set(U,
|
|
383
|
+
U);Q.g()}M={type:G?"audio":"video",mimeType:"video/mp2t",codecs:R.join(", "),language:null,height:M.height,width:M.width,channelCount:null,sampleRate:null,closedCaptions:N,zc:null,colorGamut:null}}else M=null;if(A=M)return B.return(A)}else if("mp4"==l||"cmfv"==l||"m4s"==l||"fmp4"==l||"video/mp4"==I||"audio/mp4"==I||"video/iso.segment"==I)if(C=bj(q,D.data,a.g.disableText))return B.return(C);return B.return(e)}})}
|
|
384
|
+
function Aj(a){if(vj(a)){if(a.ja==ck){for(var b,c=b=Infinity,d=t(a.h.values()),e=d.next();!e.done;e=d.next())e=e.value,e.stream.segmentIndex&&"text"!=e.stream.type&&(b=Math.min(b,e.nb),c=Math.min(c,e.Fb));b-=c;a.g.hls.useSafariBehaviorForLive&&(b=a.l.u);isNaN(a.g.availabilityWindowOverride)||(b=a.g.availabilityWindowOverride);a.l.Cf(b)}}else a.l.rb(dk(a));if(!a.l.o)for(b=t(a.h.values()),c=b.next();!c.done;c=b.next())c=c.value,!c.stream.segmentIndex||"audio"!=c.type&&"video"!=c.type||(c=c.stream.segmentIndex.get(0))&&
|
|
385
|
+
c.h&&a.l.Af(c.h);a.l.cf()}function Mj(a,b){var c=(new sc(a.M)).g;b=t(b);for(var d=b.next();!d.done;d=b.next()){var e=d.value;d=X(e,"NAME");var f=X(e,"VALUE");e=X(e,"QUERYPARAM");d&&f&&(a.u.has(d)||a.u.set(d,f));e&&(d=c.get(e)[0])&&!a.u.has(d)&&a.u.set(e,d)}}
|
|
386
|
+
function Cj(a,b,c){c=(new sc(c)).g;var d=new Map;b=t(b);for(var e=b.next();!e.done;e=b.next()){var f=e.value,g=X(f,"NAME"),h=X(f,"VALUE");e=X(f,"QUERYPARAM");f=X(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.u.get(f))&&d.set(f,e)}return d}
|
|
387
|
+
function Pj(a,b){b=t(b);for(var c=b.next();!c.done;c=b.next()){var d=c.value,e=X(d,"AUDIO");c=X(d,"VIDEO");var f=X(d,"SUBTITLES");d=ek(a,d);if(f){var g=Od(Qd,d);a.D.set(f,g);Lb(d,g)}e&&(f=Od("audio",d),f||(f=a.g.hls.defaultAudioCodec),a.D.set(e,f));c&&(e=Od("video",d),e||(e=a.g.hls.defaultVideoCodec),a.D.set(c,e))}}
|
|
388
|
+
function Nj(a,b){b=t(b);for(var c=b.next();!c.done;c=b.next()){var d=c.value,e=X(d,"DATA-ID");c=X(d,"URI");var f=X(d,"LANGUAGE");d=X(d,"VALUE");e=(new Map).set("id",e);c&&e.set("uri",Uh([a.M],c,a.u)[0]);f&&e.set("language",f);d&&e.set("value",d);c=new zi("sessiondata",e);if(a.i)a.i.onEvent(c)}}
|
|
389
|
+
function Oj(a,b){var c,d,e,f,g,h;return L(function(k){if(!a.i||!a.g)return k.return();d=t(b);for(e=d.next();!e.done;e=d.next())if(f=e.value,g=X(f,"PATHWAY-ID"),h=X(f,"SERVER-URI"),g&&h){a.j=new Ti(a.i);a.j.configure(a.g);a.j.l=[a.M];a.j.setManifestType("HLS");a.j.i=g;c=Ui(a.j,h);break}return J(k,c,0)})}
|
|
390
|
+
function Sj(a,b){var c=Rh(b,"SUBTITLES");b=c.map(function(g){if(a.g.disableText)return null;try{return fk(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=Nh(d.value,"GROUP-ID");if(d=a.D.get(e))if(e=a.F.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=gk(Qd,d)||hk(Qd),ik(f.stream)}}return b.filter(function(g){return g})}
|
|
391
|
+
function ik(a){var b=new Set([Ud(a.mimeType,a.codecs)]);a.segmentIndex&&a.segmentIndex.Rb(function(c){c.mimeType&&b.add(Ud(c.mimeType,a.codecs))});a.fullMimeTypes=b}
|
|
392
|
+
function Tj(a,b,c){var d,e;return L(function(f){if(1==f.g)return d=b.map(function(g){var h,k,l;return L(function(m){if(1==m.g){if(h=a.g.disableThumbnails)return m.return(null);wa(m,2);return J(m,jk(a,g),4)}if(2!=m.g)return k=m.h,m.return(k.stream);l=ya(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=Nh(g,"URI"),k=X(g,"CODECS")||"";if(a.h.has(h))var l=a.h.get(h);else{var m=X(g,"LANGUAGE"),n=X(g,"NAME"),
|
|
393
|
+
q=X(g,"CHARACTERISTICS"),p=kk(a,a.B++,[h],k,"image",m,!1,n,null,null,q,!1,null,!1),u=X(g,"RESOLUTION"),x=t(u?u.split("x"):[null,null]),v=x.next().value,z=x.next().value;p.stream.width=Number(v)||void 0;p.stream.height=Number(z)||void 0;var w=X(g,"BANDWIDTH");w&&(p.stream.bandwidth=Number(w));a.h.set(h,p);l=p}g=l;return"mjpg"!==g.stream.codecs?null:g.stream}catch(E){if(a.g.hls.ignoreImageStreamFailures)return null;throw E;}})),J(f,Promise.all(d),2);e=f.h;return f.return(e.filter(function(g){return g}))})}
|
|
394
|
+
function lk(a,b,c){b=b.filter(function(h){var k=X(h,"URI")||"";return"SUBTITLES"!=X(h,"TYPE")&&""!=k});var d={};b=t(b);for(var e=b.next();!e.done;e=b.next()){e=e.value;var f=Lh(e,!a.j);d[f]?d[f].push(e):d[f]=[e]}for(var g in d)fk(a,d[g],c)}
|
|
395
|
+
function Rj(a,b,c,d,e,f){var g,h,k,l,m,n,q,p,u,x,v,z,w,E,F,D,I,A,C,B,H,G,N,Q,M,P,aa,R,W,U,ba,pa,oa,qa,Aa;return L(function(Ha){switch(Ha.g){case 1:g=[];h=new Set;if(!(0<c.length)){Ha.s(2);break}k=t(c);l=k.next();case 3:if(l.done){Ha.s(2);break}m=l.value;n=Nh(m,"METHOD");q=X(m,"KEYFORMAT")||"identity";p=null;if("NONE"==n){Ha.s(4);break}if(mk(n)){u=Uh(e(),Nh(m,"URI"),f);x=u.sort().join("");a.L.has(x)||(v=Ii(u,a.g.retryParameters),z=ak(a,v,6),a.L.set(x,z));Ha.s(4);break}if("identity"!=q){p=(w=nk[q])?
|
|
396
|
+
w(m,""):null;Ha.s(6);break}return J(Ha,ok(a,m,"",e,null,f),9);case 9:p=Ha.h;case 6:if(p){if(p.keyIds)for(E=t(p.keyIds),F=E.next();!F.done;F=E.next())D=F.value,h.add(D);g.push(p)}case 4:l=k.next();Ha.s(3);break;case 2:I={};A=t(b);for(C=A.next();!C.done;C=A.next())B=C.value,H=Lh(B,!a.j),I[H]?I[H].push(B):I[H]=[B];G=[];for(N in I)Q=I[N],M=Q[0],P=X(M,"FRAME-RATE"),aa=Number(X(M,"AVERAGE-BANDWIDTH"))||Number(Nh(M,"BANDWIDTH")),R=X(M,"RESOLUTION"),W=t(R?R.split("x"):[null,null]),U=W.next().value,ba=W.next().value,
|
|
397
|
+
pa=X(M,"VIDEO-RANGE"),(oa=X(M,"REQ-VIDEO-LAYOUT"))&&oa.includes(",")&&(qa=oa.split(",").filter(function(Da){return"CH-STEREO"==Da||"CH-MONO"==Da}),oa=qa[0]),oa=oa||"CH-MONO",Aa=pk(a,Q,d),G.push.apply(G,y(Hk(a,Aa.audio,Aa.video,aa,U,ba,P,pa,oa,g,h)));return Ha.return(G.filter(function(Da){return null!=Da}))}})}
|
|
398
|
+
function pk(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=X(m,"AUDIO");var n=X(m,"VIDEO"),q=l||n;q&&(f.includes(q)||f.push(q),(m=X(m,"PATHWAY-ID"))&&e.set(q,m),l?g=!0:n&&(h=!0))}f.length&&c.length&&(k=c.filter(function(x){return f.includes(Nh(x,"GROUP-ID"))}),lk(a,k,e));k=(e=f.sort().join(","))&&a.F.has(e)?a.F.get(e):[];g?d.audio.push.apply(d.audio,y(k)):h&&d.video.push.apply(d.video,y(k));l=!1;var p=b.map(function(x){return Nh(x,
|
|
399
|
+
"URI")});h=d.audio.find(function(x){return x&&x.J().find(function(v){return p.includes(v)})});g=ek(a,b[0]);n=Od("video",g);(q=Od("audio",g))&&!n?(h="audio",l=0<d.audio.length):!d.audio.length&&!d.video.length&&q&&n?(h="video",g=[[n,q].join()]):d.audio.length&&h?(h="audio",l=!0):h=d.video.length&&!d.audio.length?"audio":"video";if(!l){var u=m=q=n=l=null;!k.length&&(c=c.find(function(x){var v=X(x,"URI")||"",z=X(x,"TYPE");x=Nh(x,"GROUP-ID");return"SUBTITLES"!=z&&""==v&&f.includes(x)}))&&(l=X(c,"LANGUAGE"),
|
|
400
|
+
n=X(c,"NAME"),q=Ik(c),Jk(c),m=X(c,"CHARACTERISTICS"),u=Kk(c));a=Lk(a,b,g,h,l,n,q,m,u);e&&(a.stream.groupId=e);d[a.stream.type]=[a]}return d}
|
|
401
|
+
function ek(a,b){var c=X(b,"CODECS")||"";b=X(b,"SUPPLEMENTAL-CODECS");a.$=0<c.length;a.$||a.g.hls.disableCodecGuessing||(c=[],a.g.disableVideo||c.push(a.g.hls.defaultVideoCodec),a.g.disableAudio||c.push(a.g.hls.defaultAudioCodec),c=c.join(","));a=c.split(/\s*,\s*/);b&&(b=b.split(/\s*,\s*/).map(function(d){return d.split("/")[0]}),a.push.apply(a,y(b)));return cj(a)}function Ik(a){return(a=X(a,"CHANNELS"))?parseInt(a.split("/")[0],10):null}
|
|
402
|
+
function Kk(a){return(a=X(a,"SAMPLE-RATE"))?parseInt(a,10):null}function Jk(a){return(a=X(a,"CHANNELS"))?a.includes("/JOC"):!1}
|
|
403
|
+
function Hk(a,b,c,d,e,f,g,h,k,l,m){for(var n=t(c),q=n.next();!q.done;q=n.next())Vj(q.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 p=h.value;if(h=f?f.stream:null)h.drmInfos=l,h.keyIds=m;if(k=p?p.stream:null)k.drmInfos=l,k.keyIds=m;k&&!h&&(k.bandwidth=d);!k&&h&&(h.bandwidth=d);n=f?f.stream.drmInfos:null;q=p?p.stream.drmInfos:null;
|
|
404
|
+
p=p?p.J().sort().join(","):"";var u=f?f.J().sort().join(","):"";p=p+" - "+u;h&&k&&!Lc(n,q)||a.xa.has(p)||(h={id:a.B++,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.xa.add(p))}return e}
|
|
405
|
+
function Qj(a,b){b=Rh(b,"CLOSED-CAPTIONS");a.fa=0==b.length;b=t(b);for(var c=b.next();!c.done;c=b.next()){var d=c.value,e=X(d,"LANGUAGE");c=ze(e||"und");e||(e=X(d,"NAME"))&&(c=e);e=Nh(d,"GROUP-ID");d=Nh(d,"INSTREAM-ID").replace("SERVICE","svc");a.C.get(e)||a.C.set(e,new Map);a.C.get(e).set(d,c)}}
|
|
406
|
+
function fk(a,b,c){for(var d=[],e=[],f=new Map,g=t(b),h=g.next();!h.done;h=g.next()){var k=h.value;h=Nh(k,"URI");k=Nh(k,"GROUP-ID");d.push(h);e.push(k);f.set(k,h)}g=e.sort().join(",");h=b[0];b="";k=Nh(h,"TYPE").toLowerCase();"subtitles"==k&&(k=Qd);if(k==Qd)b=X(h,"CODECS")||"";else{e=t(e);for(var l=e.next();!l.done;l=e.next())if(l=l.value,a.D.has(l)){b=a.D.get(l);break}}e=d.sort().join(",");if(a.h.has(e))return a.h.get(e);l=a.B++;if(a.j){f=t(f);for(var m=f.next();!m.done;m=f.next()){var n=t(m.value);
|
|
407
|
+
m=n.next().value;n=n.next().value;(m=c.get(m))&&Xi(a.j,l,m,n)}}c=X(h,"LANGUAGE");f=X(h,"NAME");m="YES"==X(h,"DEFAULT");n="audio"==k?Ik(h):null;var q="audio"==k?Jk(h):!1,p=X(h,"CHARACTERISTICS"),u="YES"==X(h,"FORCED");h="audio"==k?Kk(h):null;d=kk(a,l,d,b,k,c,m,f,n,null,p,u,h,q);d.stream&&(d.stream.groupId=g);a.F.has(g)?a.F.get(g).push(d):a.F.set(g,[d]);a.h.set(e,d);return d}
|
|
408
|
+
function jk(a,b){var c,d,e,f,g,h,k,l,m,n;return L(function(q){if(1==q.g){c=Nh(b,"URI");d=X(b,"CODECS","jpeg")||"";if(a.h.has(c))return q.return(a.h.get(c));e=X(b,"LANGUAGE");f=X(b,"NAME");g=X(b,"CHARACTERISTICS");h=kk(a,a.B++,[c],d,"image",e,!1,f,null,null,g,!1,null,!1);return(k=X(b,"RESOLUTION"))?J(q,h.stream.createSegmentIndex(),3):q.s(2)}2!=q.g&&(l=h.stream.segmentIndex.get(0),m=l.tilesLayout)&&(h.stream.width=Number(k.split("x")[0])*Number(m.split("x")[0]),h.stream.height=Number(k.split("x")[1])*
|
|
409
|
+
Number(m.split("x")[1]));if(n=X(b,"BANDWIDTH"))h.stream.bandwidth=Number(n);a.h.set(c,h);return q.return(h)})}
|
|
410
|
+
function Lk(a,b,c,d,e,f,g,h,k){for(var l=a.B++,m=[],n=t(b),q=n.next();!q.done;q=n.next()){var p=q.value;q=Nh(p,"URI");p=X(p,"PATHWAY-ID");a.j&&p&&Xi(a.j,l,p,q);m.push(q)}n=m.sort().join(",");if(a.h.has(n))return a.h.get(n);a:{b=X(b[0],"CLOSED-CAPTIONS");if("video"==d)if(b){if("NONE"!=b){b=a.C.get(b);break a}a.fa=!1}else if(!b&&a.C.size)for(b=t(a.C.keys()).next();!b.done;){b=a.C.get(b.value);break a}b=null}c=Nd(d,c);d=kk(a,l,m,c,d,e,!1,f,g,b,h,!1,k,!1);a.h.set(n,d);return d}
|
|
411
|
+
function kk(a,b,c,d,e,f,g,h,k,l,m,n,q,p){function u(D){var I,A,C,B,H,G,N,Q,M,P,aa,R,W,U,ba,pa,oa,qa,Aa,Ha,Da,hb;return L(function(Ia){switch(Ia.g){case 1:return I=Sd,A=w.J(),J(Ia,tj(a,w.J(),!0),2);case 2:C=Ia.h;if(D.aborted)return Ia.return();B=C.uri;B==C.originalUri||A.includes(B)||z.push(B);H=ai(a.ra,C.data);if(1!=H.type)throw new S(2,4,4017);G=Qh(H.g,"EXT-X-DEFINE");N=Cj(a,G,B);Q=void 0;M=!1;if(!(!a.$&&a.g.hls.disableCodecGuessing||a.fa&&e==I.da&&!a.g.hls.disableClosedCaptionsDetection)){Ia.s(3);
|
|
412
|
+
break}if(P=0<H.segments.length)aa=H.segments[0],Sh(aa.g,"EXT-X-GAP")&&(P=!1);if(!P){Ia.s(3);break}a.fa=!1;return J(Ia,Lj(a,H,x,N),5);case 5:R=Ia.h,!R.closedCaptions.size||l&&l.size==R.closedCaptions.size||(l=R.closedCaptions,M=!0),!a.$&&a.g.hls.disableCodecGuessing&&(Q=R.mimeType,d=R.codecs);case 3:return W=vj(a),J(Ia,Uj(a,0,N,H,x,d,e,f,g,h,k,l,m,n,q,p,Q),6);case 6:U=Ia.h;if(D.aborted)return Ia.return();ba=U.stream;vj(a)&&!W&&Wj(a,H);w.Fb=U.Fb;w.nb=U.nb;w.Gc=U.Gc;w.Fc=U.Fc;w.qc=U.qc;w.Zc=U.Zc;w.Wa=
|
|
413
|
+
U.Wa;w.Xa=U.Xa;w.$d=!0;v.segmentIndex=ba.segmentIndex;v.encrypted=ba.encrypted;v.drmInfos=ba.drmInfos;v.keyIds=ba.keyIds;v.mimeType=ba.mimeType;v.bandwidth=v.bandwidth||ba.bandwidth;v.codecs=v.codecs||ba.codecs;v.closedCaptions=v.closedCaptions||ba.closedCaptions;ik(v);v.drmInfos.length&&a.i.newDrmInfo(v);a.o&&M&&a.i.makeTextStreamsForClosedCaptions(a.o);if(e==I.da||e==I.S)for(pa=t(a.h.values()),oa=pa.next();!oa.done;oa=pa.next())qa=oa.value,qa.$d||qa.type!=e||(qa.stream.mimeType=ba.mimeType,ik(qa.stream));
|
|
414
|
+
e==I.pa&&(Aa=ba.segmentIndex.get(0))&&Aa.ea&&(v.mimeType="application/mp4",ik(v));Mk(a)&&(a.fb?Xj(a,[w]):(a.fb=!0,Ha=Array.from(a.h.values()),Da=Ha.filter(function(ic){return ic.stream.segmentIndex}),Xj(a,Da),Aj(a),hb=a.m,0<hb&&a.A.Z(hb)));K(Ia)}})}function x(){return a.j&&1<c.length?Yi(a.j,b):z.concat(Vh([a.M],c,a.u))}var v=Nk(a,d,e,f,g,h,k,l,m,n,q,p),z=[],w={stream:v,type:e,tf:z,J:x,Fb:0,nb:0,Zc:new Map,Gc:!1,Fc:!1,qc:!1,xd:-1,Wa:-1,Xa:-1,$d:!1},E=null,F=new AbortController;v.createSegmentIndex=
|
|
415
|
+
function(){if(E)return E;F=new AbortController;return E=new Promise(function(D){D(u(F.signal))})};v.closeSegmentIndex=function(){E&&!v.segmentIndex&&F.abort();v.segmentIndex&&(v.segmentIndex.release(),v.segmentIndex=null);E=null};return w}function dk(a){var b=Infinity;a=t(a.h.values());for(var c=a.next();!c.done;c=a.next())c=c.value,c.stream.segmentIndex&&"text"!=c.stream.type&&(b=Math.min(b,c.nb));return b}
|
|
416
|
+
function xj(a,b){var c=[];b=t(b);for(var d=b.next();!d.done;d=b.next())d=d.value,d.segmentIndex&&d.segmentIndex.Rb(function(e){c.push(e)});a.l.lf(c)}
|
|
417
|
+
function Xj(a,b){if(!vj(a))for(var c=dk(a),d=t(b),e=d.next();!e.done;e=d.next())e.value.stream.segmentIndex.Kc(0,c);xj(a,b.map(function(f){return f.stream}));d=Array.from(a.h.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=vj(a)&&!a.va;c=!vj(a)&&a.va&&!(c&&e);a.g.hls.ignoreManifestProgramDateTime||d||c?Hj(a,b,d):(Kj(a,b),0<a.g.hls.ignoreManifestProgramDateTimeForTypes.length&&Hj(a,
|
|
418
|
+
b))}function Ij(a,b){return a.g.hls.ignoreManifestProgramDateTime?!0:a.g.hls.ignoreManifestProgramDateTimeForTypes.includes(b)}function Mk(a){if(!a.o)return!1;var b=[],c=[];a=t(a.o.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}
|
|
419
|
+
function Uj(a,b,c,d,e,f,g,h,k,l,m,n,q,p,u,x,v){var z,w,E,F,D,I,A,C,B,H,G,N,Q,M,P,aa,R,W,U,ba,pa;return L(function(oa){switch(oa.g){case 1:var qa=Sh(d.g,"EXT-X-PLAYLIST-TYPE"),Aa=Sh(d.g,"EXT-X-ENDLIST");Aa=qa&&"VOD"==qa.value||Aa;qa=qa&&"EVENT"==qa.value&&!Aa;qa=!Aa&&!qa;Aa?zj(a,sj):qa?zj(a,ck):zj(a,Ok);vj(a)&&Gj(a,d);z=vj(a)?a.O.get(g):new Map;w=Ej(a,d,z,c,e,g);E=w.segments;F=w.bandwidth;if(v){oa.s(2);break}return J(oa,Pk(a,g,f,E),3);case 3:v=oa.h,g!=Qd||f||"application/mp4"!=v||!E[0]||E[0].ea||(v=
|
|
420
|
+
"text/vtt");case 2:return J(oa,Dj(a,d,v,e,c),4);case 4:D=oa.h;I=D.drmInfos;A=D.keyIds;C=D.encrypted;B=D.Sf;if(C&&!I.length&&!B)throw new S(2,4,4026);H=Nk(a,f,g,h,k,l,m,n,q,p,u,x);H.encrypted=C;H.drmInfos=I;H.keyIds=A;H.mimeType=v;F&&(H.bandwidth=F);ik(H);vj(a)&&Gj(a,d);G=E[0].startTime;N=E[E.length-1];Q=N.endTime;M=new li(E);H.segmentIndex=M;aa=(P=Sh(d.g,"EXT-X-SERVER-CONTROL"))?null!=Mh(P,"CAN-SKIP-UNTIL"):!1;R=P?null!=Mh(P,"CAN-BLOCK-RELOAD"):!1;W=Th(d.g,"EXT-X-MEDIA-SEQUENCE",0);U=Fj(W,E);ba=U.Wa;
|
|
421
|
+
pa=U.Xa;return oa.return({stream:H,type:g,tf:[],J:e,Fb:G,nb:Q,Gc:aa,Fc:R,qc:!1,xd:-1,Wa:ba,Xa:pa,Zc:z,$d:!1})}})}function Fj(a,b){a=a+b.length-1;var c=-1;if(!b.length)return a++,{Wa:a,Xa:c};b=b[b.length-1];var d=b.g;if(!b.g.length)return a++,b.m&&(c=0),{Wa:a,Xa:c};c=d.length-1;d[d.length-1].preload||(a++,c=0);return{Wa:a,Xa:c}}
|
|
422
|
+
function Nk(a,b,c,d,e,f,g,h,k,l,m,n){var q=gk(c,b)||hk(c),p=[];if(k){k=t(k.split(","));for(var u=k.next();!u.done;u=k.next())p.push(u.value)}k=void 0;u=null;c==Qd?k=p.includes("public.accessibility.transcribes-spoken-dialog")&&p.includes("public.accessibility.describes-music-and-sound")?"caption":"subtitle":p.includes("public.accessibility.describes-video")&&(u="visually impaired");p.length||"subtitle"!==k||p.push("subtitle");a={id:a.B++,originalId:f,groupId:null,createSegmentIndex:function(){return Promise.resolve()},
|
|
423
|
+
segmentIndex:null,mimeType:q,codecs:b,kind:c==Qd?"subtitle":void 0,encrypted:!1,drmInfos:[],keyIds:new Set,language:ze(d||"und"),originalLanguage:d,label:f,type:c,primary:e,trickModeVideo:null,emsgSchemeIdUris:null,frameRate:void 0,pixelAspectRatio:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:p,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,
|
|
424
|
+
fullMimeTypes:new Set};ik(a);return a}
|
|
425
|
+
function Dj(a,b,c,d,e){var f,g,h,k,l,m,n,q,p,u,x,v,z,w,E,F,D,I,A,C,B,H,G,N,Q,M,P,aa;return L(function(R){switch(R.g){case 1:f=new Map;if(b.segments)for(g=t(b.segments),h=g.next();!h.done;h=g.next())if(k=h.value,l=Qh(k.g,"EXT-X-KEY"),m=null,l.length)for(m=Zj(a,b,k.g,d,e),n=t(l),q=n.next();!q.done;q=n.next())p=q.value,f.set(p,m);x=u=!1;v=[];z=new Set;w=t(f);E=w.next();case 2:if(E.done){R.s(4);break}F=E.value;D=t(F);I=D.next().value;A=D.next().value;C=I;B=A;H=Nh(C,"METHOD");if("NONE"==H){R.s(3);break}u=
|
|
426
|
+
!0;G=X(C,"KEYFORMAT")||"identity";N=null;if(mk(H)){x=!0;R.s(3);break}if("identity"!=G){N=(Q=nk[G])?Q(C,c):null;R.s(6);break}return J(R,ok(a,C,c,d,B,e),8);case 8:N=R.h;case 6:if(N){if(N.keyIds)for(M=t(N.keyIds),P=M.next();!P.done;P=M.next())aa=P.value,z.add(aa);v.push(N)}case 3:E=w.next();R.s(2);break;case 4:return R.return({drmInfos:v,keyIds:z,encrypted:u,Sf:x})}})}
|
|
427
|
+
function Qk(a,b,c,d,e){if(!window.crypto||!window.crypto.subtle)throw Za("Web Crypto API is not available to decrypt AES. (Web Crypto only exists in secure origins like https)"),new S(2,4,4042);var f=0,g=X(b,"IV","");if(g){var h=Hd(g.substr(2));if(16!=h.byteLength)throw new S(2,4,4048);}else f=Th(c.g,"EXT-X-MEDIA-SEQUENCE",0);c=b.toString()+"-"+f;if(!a.ka.has(c)){var k={bitsKey:128,blockCipherMode:"CBC",iv:h,firstMediaSequenceNumber:f};switch(Nh(b,"METHOD")){case "AES-256":k.bitsKey=256;break;case "AES-256-CTR":k.bitsKey=
|
|
428
|
+
256,k.blockCipherMode="CTR"}k.fetchKey=function(){var l,m,n,q,p,u;return L(function(x){if(1==x.g)return l=Uh(d(),Nh(b,"URI"),e),m=l.sort().join(""),a.L.has(m)||(n=Ii(l,a.g.retryParameters),q=ak(a,n,6),a.L.set(m,q)),J(x,a.L.get(m),2);if(3!=x.g){p=x.h;if(!p.data||p.data.byteLength!=k.bitsKey/8)throw new S(2,4,4049);u={name:"CTR"==k.blockCipherMode?"AES-CTR":"AES-CBC",length:k.bitsKey};return J(x,window.crypto.subtle.importKey("raw",p.data,u,!0,["decrypt"]),3)}k.cryptoKey=x.h;k.fetchKey=void 0;K(x)})};
|
|
429
|
+
a.ka.set(c,k)}return a.ka.get(c)}
|
|
430
|
+
function Gj(a,b){var c=Infinity,d=b.segments;if(d.length)for(var e=d.length-1;0<=e;){var f=Sh(d[e].g,"EXTINF");if(f){c=Number(f.value.split(",")[0]);break}e--}d=Sh(b.g,"EXT-X-TARGETDURATION");if(!d)throw new S(2,4,4024,"EXT-X-TARGETDURATION");d=Number(d.value);if(e=Sh(b.g,"EXT-X-PART-INF"))a.T=Number(Nh(e,"PART-TARGET"));b=Sh(b.g,"EXT-X-SERVER-CONTROL");a.H&&a.T?(a.m=a.cb?5*a.T<=c?Math.min(a.T,a.m):Math.min(c,a.m):Math.min(a.T,a.m),a.ma=b?Number(Nh(b,"PART-HOLD-BACK")):0):(a.m=Math.min(c,a.m),c=b?
|
|
431
|
+
Mh(b,"HOLD-BACK"):null,a.la=c?Number(c.value):0);a.wa=Math.max(d,a.wa)}function Wj(a,b){if(a.g.defaultPresentationDelay)b=a.g.defaultPresentationDelay;else if(a.ma)b=a.ma;else if(a.la)b=a.la;else{b=b.segments.length;var c=a.g.hls.liveSegmentsDelay;c>b-2&&(c=Math.max(1,b-2));b=a.wa*c}a.l.Bf(0);a.l.zf(b);a.l.kd(!1)}
|
|
432
|
+
function Zj(a,b,c,d,e){var f=Sh(c,"EXT-X-MAP");if(!f)return null;var g=Nh(f,"URI"),h=Uh(d(),g,e);g=[h.toString(),X(f,"BYTERANGE","")].join("-");if(!a.ba.has(g)){var k=void 0,l=null;c=t(c);for(var m=c.next();!m.done;m=c.next())m=m.value,"EXT-X-KEY"==m.name?mk(Nh(m,"METHOD"))&&m.id<f.id&&(k=Qk(a,m,b,d,e)):"EXT-X-BYTERANGE"==m.name&&m.id<f.id&&(l=m);b=Rk(h,f,l,k);a.ba.set(g,b)}return a.ba.get(g)}
|
|
433
|
+
function Rk(a,b,c,d){var e=0,f=null;b=X(b,"BYTERANGE");!b&&c&&(b=c.value);b&&(e=b.split("@"),f=Number(e[0]),e=Number(e[1]),f=e+f-1,d&&(c=f+1-e,c%16&&(f+=16-c%16)));return new ei(function(){return a},e,f,null,null,null,d)}
|
|
434
|
+
function Sk(a,b,c,d,e,f,g,h,k){function l(W){W=(new sc(W)).Ha.split(".").pop();var U=Tk[g][W];U||(U=Yj[W]);return U}var m=d.g,n=Sh(m,"EXTINF"),q=0,p=0,u=null;d.h.length&&!a.H&&Za("Low-latency HLS 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.");var x=null;if(!a.g.hls.ignoreManifestProgramDateTime){var v=Sh(m,"EXT-X-PROGRAM-DATE-TIME");v&&v.value&&(x=pj(v.value),a.va=
|
|
435
|
+
!0)}var z=hi;Sh(m,"EXT-X-GAP")&&(z=2);if(!n){if(0==d.h.length)throw new S(2,4,4024,"EXTINF");if(!a.H)return null}var w=[];v=!1;var E=null,F=!1,D=!1;if(a.H&&d.h.length){q=b&&window.ReadableStream&&a.g.hls.allowLowLatencyByteRangeOptimization;for(var I=x,A={},C=0;C<d.h.length;A={md:void 0,fd:void 0},C++){var B=d.h[C],H=0==C?c:w[w.length-1],G=0==C?e:H.endTime,N=Number(X(B,"DURATION"))||a.T;if(N){var Q=G+N,M=0,P=null;"EXT-X-PRELOAD-HINT"==B.name?(M=(M=X(B,"BYTERANGE-START"))?Number(M):0,(H=X(B,"BYTERANGE-LENGTH"))?
|
|
436
|
+
P=M+Number(H)-1:M&&(P=Number.MAX_SAFE_INTEGER)):(M=X(B,"BYTERANGE"),P=t(bk(H,M)),M=P.next().value,P=P.next().value);A.fd=X(B,"URI");if(A.fd){H=hi;"YES"==X(B,"GAP")&&(H=2,F=!0);A.md=null;var aa=function(W){return function(){null==W.md&&(W.md=Uh(h(),W.fd,f));return W.md}}(A);q&&0<=M&&null!=P&&(E=aa,v=!0);G=new gi(G,Q,aa,M,P,b,0,0,Infinity,[],"",null,I,H,k);"EXT-X-PRELOAD-HINT"==B.name&&(G.ae(),D=!0);"YES"!=X(B,"INDEPENDENT")&&0<C&&G.ff();if(A=l(A.fd))G.mimeType=A,Uk.has(A)&&(G.ea=null);w.push(G);I&&
|
|
437
|
+
(I+=N)}}}}if(n){n=Number(n.value.split(",")[0]);if(0==n)return null;q=e+n}else if(w.length)q=w[w.length-1].endTime;else return null;v&&(F||0!=w[0].Pa?(v=!1,E=null):w=[]);(n=Sh(m,"EXT-X-BYTERANGE"))?(u=t(bk(c,n.value)),p=u.next().value,u=u.next().value):w.length&&(p=w[0].Pa,u=w[w.length-1].qa);c="";n=null;"image"==g&&(c="1x1",m=Sh(m,"EXT-X-TILES"))&&(c=Nh(m,"LAYOUT"),(m=X(m,"DURATION"))&&(n=Number(m)));var R=null;b=new gi(e,q,function(){if(E)return E();null==R&&(R=Uh(h(),d.i,f));return R||[]},p,u,
|
|
438
|
+
b,0,0,Infinity,w,c,n,x,z,k,0<w.length&&!!d.i);if(e=l(d.i))b.mimeType=e,Uk.has(e)&&(b.ea=null);v&&(a.cb=!0,b.df(),D&&b.ae());return b}function bk(a,b){var c=0,d=null;b&&(c=b.split("@"),b=Number(c[0]),c=c[1]?Number(c[1]):a.qa+1,d=c+b-1);return[c,d]}
|
|
439
|
+
function Ej(a,b,c,d,e,f){var g=b.segments,h=void 0,k=Th(b.g,"EXT-X-DISCONTINUITY-SEQUENCE",-1),l=Th(b.g,"EXT-X-MEDIA-SEQUENCE",0),m=Sh(b.g,"EXT-X-SKIP"),n=m?Number(X(m,"SKIPPED-SEGMENTS")):0,q=l+n,p=0;vj(a)&&c.has(q)&&(p=c.get(q));0===p&&a.ja==ck&&0<c.size&&!c.has(q)&&(p=a.l.Rc());var u=[],x=null;m=[];for(var v=0;v<g.length;v++){var z=g[v],w=0==v?p:x.endTime;q=l+n+v;Sh(z.g,"EXT-X-DISCONTINUITY")&&k++;var E=t(z.g);for(var F=E.next();!F.done;F=E.next())F=F.value,"EXT-X-KEY"==F.name&&(mk(Nh(F,"METHOD"))?
|
|
440
|
+
h=Qk(a,F,b,e,d):h=void 0);c.set(q,w);E=Zj(a,b,z.g,e,d);!a.H&&a.i.isAutoLowLatencyMode()&&(a.i.enableLowLatencyMode(),a.H=a.i.isLowLatencyMode());if(w=Sk(a,E,x,z,w,d,f,e,h))(x=Th(z.g,"EXT-X-BITRATE"))?m.push({bitrate:x,duration:w.endTime-w.startTime}):m.length&&(x=m.pop(),x.duration+=w.endTime-w.startTime,m.push(x)),x=w,w.i=k,Ij(a,f)&&null!=a.I&&q<a.I||u.push(w)}b=void 0;m.length&&(b=m.reduce(function(D,I){return D+I.duration},0),b=Math.round(m.reduce(function(D,I){return D+I.bitrate*I.duration},0)/
|
|
441
|
+
b*1E3));if(m=u.some(function(D){return null!=D.h}))for(c={},d=0;d<u.length;c={Mc:void 0,Lc:void 0,Cc:void 0,Ib:void 0,Bc:void 0},d++)if(c.Ib=u[d],null==c.Ib.h)for(c.Lc=0,c.Mc=d,e=function(D){return function(){var I=u[D.Mc];if(I){if(null!=I.h)return I.h+D.Lc;D.Lc-=I.endTime-I.startTime;D.Mc+=1}return null}}(c),c.Bc=0,c.Cc=d,g=function(D){return function(){var I=u[D.Cc];if(I){I!=D.Ib&&(D.Bc+=I.endTime-I.startTime);if(null!=I.h)return I.h+D.Bc;--D.Cc}return null}}(c);null==c.Ib.h;)c.Ib.h=g(),null==c.Ib.h&&
|
|
442
|
+
(c.Ib.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.aa;if(m&&Infinity!=c&&!Ij(a,f))for(a=t(u),f=a.next();!f.done;f=a.next())f.value.ze(c);return{segments:u,bandwidth:b}}
|
|
443
|
+
function gk(a,b){if(a==Qd){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 hk(a){return a==Qd?"text/vtt":Tk[a].mp4}
|
|
444
|
+
function Pk(a,b,c,d){var e,f,g,h,k,l,m,n,q,p,u,x,v,z;return L(function(w){switch(w.g){case 1:e=Oi;f=Math.trunc((d.length-1)/2);for(g=d[f];2==g.status&&f<d.length;)f++,g=d[f];if(2==g.status)return w.return(hk(b));h=g.J();k=new sc(h[0]);l=k.Ha.split(".").pop();m=Tk[b];if((n=m[l])||(n=Yj[l])||(n=gk(b,c)))return w.return(n);p=1;u=Ii(h,a.g.retryParameters);wa(w,2);u.method="HEAD";return J(w,ak(a,u,e,{type:p}),4);case 4:x=w.h;q=x.headers["content-type"];xa(w,3);break;case 2:v=ya(w);if(!v||1002!=v.code&&
|
|
445
|
+
1001!=v.code){w.s(3);break}u.method="GET";return J(w,ak(a,u,e,{type:p}),6);case 6:z=w.h,q=z.headers["content-type"];case 3:return q?w.return(q.toLowerCase().split(";")[0]):w.return(hk(b))}})}function Vj(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 tj(a,b,c){return ak(a,Ii(b,a.g.retryParameters),0,{type:c?2:3})}
|
|
446
|
+
function rj(a){var b,c,d,e,f,g;L(function(h){switch(h.g){case 1:if(!a.i)return h.return();wa(h,2);b=Date.now();return J(h,a.update(),4);case 4:c=Date.now();vj(a)&&(d=(c-b)/1E3,a.bb.sample(1,d),e=a.m,f=Math.max(0,e-Va(a.bb)),a.A.Z(f));xa(h,3);break;case 2:g=ya(h);if(!a.i)return h.return();if(a.g.raiseFatalErrorOnManifestUpdateRequestFailure)return a.i.onError(g),h.return();g.severity=1;a.i.onError(g);a.A.Z(.1);case 3:if(!a.i)return h.return();a.i.onManifestUpdated();K(h)}})}
|
|
447
|
+
function vj(a){return a.ja!=sj}function zj(a,b){a.ja=b;a.l&&a.l.kd(!vj(a));vj(a)||a.A.stop()}function ak(a,b,c,d){if(!a.W)throw new S(2,7,7001);b=a.i.networkingEngine.request(c,b,d);Ci(a.W,b);return b.promise}function mk(a){return"AES-128"==a||"AES-256"==a||"AES-256-CTR"==a}
|
|
448
|
+
function ok(a,b,c,d,e,f){var g,h,k,l,m,n,q,p,u,x,v,z,w,E,F;return L(function(D){switch(D.g){case 1:if("video/mp2t"==c)throw new S(2,4,4040);if("apple"===window.shakaMediaKeysPolyfill)throw new S(2,4,4041);g=Nh(b,"METHOD");h=["SAMPLE-AES","SAMPLE-AES-CTR"];if(!h.includes(g))return D.return(null);k=Uh(d(),Nh(b,"URI"),f);if(k[0].startsWith("data:text/plain;base64,")){l=Id(Gd(k[0].split("data:text/plain;base64,").pop()));D.s(2);break}m=k.sort().join("");a.ga.has(m)||(n=Ii(k,a.g.retryParameters),q=ak(a,
|
|
449
|
+
n,6),a.ga.set(m,q));return J(D,a.ga.get(m),3);case 3:p=D.h,l=Id(p.data);case 2:u="00000000000000000000000000000000";if(!e){D.s(4);break}if(a.ha.has(e)){x=a.ha.get(e);D.s(5);break}v=Zi(e.J(),e.Bb(),e.zb(),a.g.retryParameters);z=Oi;return J(D,ak(a,v,z,{type:0}),6);case 6:w=D.h,x=ej(w.data),a.ha.set(e,x);case 5:x&&(u=x);case 4:return E=new Map,E.set(u,l),F="cenc","SAMPLE-AES"==g&&(F="cbcs"),D.return(Md(E,F))}})}O("shaka.hls.HlsParser",qj);
|
|
450
|
+
var Yj={aac:"audio/aac",ac3:"audio/ac3",ec3:"audio/ec3",mp3:"audio/mpeg"},Tk={audio:{mp4:"audio/mp4",mp4a:"audio/mp4",m4s:"audio/mp4",m4i:"audio/mp4",m4a:"audio/mp4",m4f:"audio/mp4",cmfa:"audio/mp4",ts:"video/mp2t",tsa:"video/mp2t"},video:{mp4:"video/mp4",mp4v:"video/mp4",m4s:"video/mp4",m4i:"video/mp4",m4v:"video/mp4",m4f:"video/mp4",cmfv:"video/mp4",ts:"video/mp2t",tsv:"video/mp2t"},text:{mp4:"application/mp4",m4s:"application/mp4",m4i:"application/mp4",m4f:"application/mp4",cmft:"application/mp4",
|
|
451
|
+
vtt:"text/vtt",webvtt:"text/vtt",ttml:"application/ttml+xml"},image:{jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml",webp:"image/webp",avif:"image/avif"}},Uk=new Set(["video/mp2t"].concat(y(Vd))),nk={"com.apple.streamingkeydelivery":function(a,b){if("video/mp2t"==b)throw new S(2,4,4040);if("apple"===window.shakaMediaKeysPolyfill)throw new S(2,4,4041);a=Nh(a,"METHOD");if(!["SAMPLE-AES","SAMPLE-AES-CTR"].includes(a))return null;b="cenc";"SAMPLE-AES"==a&&(b="cbcs");return Ld("com.apple.fps",b,[{initDataType:"sinf",
|
|
452
|
+
initData:new Uint8Array(0),keyId:null}])},"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(a){var b=Nh(a,"METHOD");if(!["SAMPLE-AES","SAMPLE-AES-CTR"].includes(b))return null;var c="cenc";"SAMPLE-AES"==b&&(c="cbcs");b=Nh(a,"URI");b=Si(b.split("?")[0]);b=yb(b.data);c=Ld("com.widevine.alpha",c,[{initDataType:"cenc",initData:b}]);if(a=X(a,"KEYID"))c.keyIds=new Set([a.toLowerCase().substr(2)]);return c},"com.microsoft.playready":function(a){var b=Nh(a,"METHOD");if(!["SAMPLE-AES","SAMPLE-AES-CTR"].includes(b))return null;
|
|
453
|
+
var c="cenc";"SAMPLE-AES"==b&&(c="cbcs");a=Nh(a,"URI");a=Si(a.split("?")[0]);a=yb(a.data);b=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);var d=a.length,e=b.length+16+d,f=new Uint8Array(e),g=Cb(f),h=0;g.setUint32(h,e);h+=4;g.setUint32(h,1886614376);h+=4;g.setUint32(h,0);h+=4;f.set(b,h);h+=b.length;g.setUint32(h,d);f.set(a,h+4);return Ld("com.microsoft.playready",c,[{initDataType:"cenc",initData:f}])}},sj="VOD",Ok="EVENT",ck="LIVE",yj={Of:sj,zh:Ok,Ch:ck};
|
|
454
|
+
ki["application/x-mpegurl"]=function(){return new qj};ki["application/vnd.apple.mpegurl"]=function(){return new qj};function Vk(a,b,c){this.g=null;this.o=-1;this.l=a;this.i=b;this.m=c;this.j=!1;a:{"undefined"===typeof libDPIModule&&Za("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,pb("LcevcDil","lcevc_dil.js is deprecated, please use lcevc_dec.js instead");else{Za("Could not find LCEVC Library on this page");a=!1;break a}"undefined"===typeof this.h.SupportObject?(Za("Could not find LCEVC Library on this page"),
|
|
455
|
+
a=!1):(this.h.SupportObject.SupportStatus||Za(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 Wk(a){a.g&&a.i.classList.add("shaka-hidden")}
|
|
456
|
+
Vk.prototype.release=function(){this.g&&(this.g.close(),this.g=null)};function Xk(a,b,c){var d=0,e=-1;switch(b.mimeType){case "video/webm":d=1;break;case "video/mp4":d=2}switch(c){case "DASH":e=1;break;case "HLS":e=0}a.g&&(a.o=b.id,a.g.setLevelSwitching(b.id,!0),a.g.setContainerFormat(d),a.j||a.g.setStreamingFormat(e))}O("shaka.lcevc.Dec",Vk);Vk.prototype.release=Vk.prototype.release;function Yk(a,b,c,d){c=void 0===c?!0:c;d=void 0===d?!1:d;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,d)}Yk.prototype.add=function(a,b,c){return Zk(this.h,a,void 0===b?!0:b,void 0===c?!1:c)?(this.g.add(a),!0):!1};
|
|
457
|
+
function Zk(a,b,c,d){var e;if(!(e=!!a.audio!=!!b.audio||!!a.video!=!!b.video||a.language!=b.language)&&(e=a.audio&&b.audio)){e=a.audio;var f=b.audio;e=!!((!e.channelsCount||!f.channelsCount||2<e.channelsCount||2<f.channelsCount)&&e.channelsCount!=f.channelsCount||e.spatialAudio!==f.spatialAudio||c&&!$k(e,f)||!al(e.roles,f.roles)||d&&e.groupId!==f.groupId)}!(d=e)&&(d=a.video&&b.video)&&(a=a.video,b=b.video,d=!((!c||$k(a,b))&&al(a.roles,b.roles)));return d?!1:!0}Yk.prototype.values=function(){return this.g.values()};
|
|
458
|
+
function $k(a,b){if(a.mimeType!=b.mimeType)return!1;a=a.codecs.split(",").map(function(d){return ce(d)});b=b.codecs.split(",").map(function(d){return ce(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 al(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};function bl(a,b,c){b=void 0===b?"reload":b;c=void 0===c?!1:c;this.i=a;this.h=b;this.g=c;this.j=new cl(a.language,"",a.audio&&a.audio.channelsCount?a.audio.channelsCount:0,"",!1,"","","",b,c)}bl.prototype.create=function(a){var b=this,c="smooth"==this.h&&nb(),d=a.filter(function(e){return Zk(b.i,e,!c,b.g)});return d.length?new Yk(d[0],d,!c,this.g):this.j.create(a)};
|
|
459
|
+
function cl(a,b,c,d,e,f,g,h,k,l){this.u=a;this.A=b;this.h=c;this.i=d;this.B=e;this.l=f;this.g=void 0===g?"":g;this.j=void 0===h?"":h;this.m=void 0===k?"reload":k;this.o=void 0===l?!1:l}
|
|
460
|
+
cl.prototype.create=function(a){var b=[];b=dl(a,this.u);var c=a.filter(function(d){return d.primary});b=b.length?b:c.length?c:a;a=el(b,this.A);a.length&&(b=a);this.l&&(a=fl(b,this.l),a.length&&(b=a));this.i&&(a=gl(b,this.i),a.length&&(b=a));this.h&&(a=hl(b,this.h),a.length&&(b=a));this.g&&(a=il(b,this.g),a.length&&(b=a));this.j&&(a=jl(b,this.j),a.length&&(b=a));a=kl(b,this.B);a.length&&(b=a);return new Yk(b[0],b,!("smooth"==this.m&&nb()),this.o)};
|
|
461
|
+
function dl(a,b){b=ze(b);var c=Ge(b,a.map(function(d){return Fe(d)}));return c?a.filter(function(d){return c==Fe(d)}):[]}function el(a,b){return a.filter(function(c){return c.audio?b?c.audio.roles.includes(b):0==c.audio.roles.length:!1})}function il(a,b){return a.filter(function(c){return c.audio&&c.audio.label?c.audio.label.toLowerCase()==b.toLowerCase():!1})}function jl(a,b){return a.filter(function(c){return c.video&&c.video.label?c.video.label.toLowerCase()==b.toLowerCase():!1})}
|
|
462
|
+
function hl(a,b){return a.filter(function(c){return c.audio&&c.audio.channelsCount&&c.audio.channelsCount!=b?!1:!0})}function gl(a,b){"AUTO"==b&&(b=window.matchMedia("(color-gamut: p3)").matches?a.some(function(c){return c.video&&c.video.hdr&&"HLG"==c.video.hdr?!0:!1})?"HLG":"PQ":"SDR");return a.filter(function(c){return c.video&&c.video.hdr&&c.video.hdr!=b?!1:!0})}function fl(a,b){return a.filter(function(c){return c.video&&c.video.videoLayout&&c.video.videoLayout!=b?!1:!0})}
|
|
463
|
+
function kl(a,b){return a.filter(function(c){return c.audio&&c.audio.spatialAudio!=b?!1:!0})};function ll(){this.g=ml;this.i=(new Map).set(ml,2).set(nl,1);this.h=0}function ol(a,b,c){a.i.set(ml,c).set(nl,b)}var nl=0,ml=1;function pl(a,b){function c(q){m.push({box:q,jf:1701733217})}function d(q){m.push({box:q,jf:1701733238})}function e(){h=!0}function f(q){l.push(q);Cg(q)}var g=a=yb(a),h=!1,k,l=[],m=[];(new xg).box("moov",f).box("trak",f).box("mdia",f).box("minf",f).box("stbl",f).K("stsd",function(q){k=q;l.push(q);Eg(q)}).K("encv",e).K("enca",e).K("dvav",d).K("dva1",d).K("dvh1",d).K("dvhe",d).K("dvc1",d).K("dvi1",d).K("hev1",d).K("hvc1",d).K("avc1",d).K("avc3",d).K("ac-3",c).K("ec-3",c).K("ac-4",c).K("Opus",c).K("fLaC",
|
|
464
|
+
c).K("mp4a",c).parse(a);if(h)return a;if(0==m.length||!k)throw cb(Id(a)),new S(2,3,3019,b);m.reverse();b=t(m);for(var n=b.next();!n.done;n=b.next())n=n.value,g=ql(g,k,n.box,l,n.jf);return Xc()&&od()&&!Yc()?(b=new Uint8Array(a.byteLength+g.byteLength),b.set(g),b.set(a,g.byteLength),b):g}
|
|
465
|
+
function ql(a,b,c,d,e){var f=rl.value(),g=a.subarray(c.start,c.start+c.size),h=Cb(g),k=new Uint8Array(c.size+f.byteLength);k.set(g,0);g=Cb(k);g.setUint32(4,e);k.set(f,c.size);e=h.getUint32(4);g.setUint32(c.size+16,e);sl(k,0,k.byteLength);e=new Uint8Array(a.byteLength+k.byteLength);c=Yc()||Xc()?c.start:c.start+c.size;f=a.subarray(c);e.set(a.subarray(0,c));e.set(k,c);e.set(f,c+k.byteLength);a=t(d);for(d=a.next();!d.done;d=a.next())d=d.value,sl(e,d.start,d.size+k.byteLength);k=Cb(e,b.start);b=Dg(b);
|
|
466
|
+
a=k.getUint32(b);k.setUint32(b,a+1);return e}function sl(a,b,c){a=Cb(a,b);b=a.getUint32(0);0!=b&&(1==b?(a.setUint32(8,c>>32),a.setUint32(12,c&4294967295)):a.setUint32(0,c))}
|
|
467
|
+
function tl(a){function b(e){d.push({start:e.start,size:e.size});Cg(e)}var c=yb(a),d=[];(new xg).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=Cb(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}
|
|
468
|
+
var rl=new Kc(function(){return new Uint8Array([0,0,0,80,115,105,110,102,0,0,0,12,102,114,109,97,0,0,0,0,0,0,0,20,115,99,104,109,0,0,0,0,99,101,110,99,0,1,0,0,0,0,0,40,115,99,104,105,0,0,0,32,116,101,110,99,0,0,0,0,0,0,1,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])});function ul(a){this.g=!1;this.h=new si;this.i=a}ul.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 vl(a,b){if(a.g){if(b instanceof S&&7003==b.code)throw b;throw new S(2,7,7003,b);}};function wl(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 xl(a,b){a=t(a);for(var c=a.next();!c.done;c=a.next())if(!b(c.value))return!1;return!0};function yl(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 zl(a){var b={};a.forEach(function(c,d){b[d]=c});return b};function Al(a){var b=this;this.C=a;this.l=this.A=null;this.aa=!1;this.H=0;this.g=null;this.o=new fb;this.i=new Map;this.B=new Map;this.m=new si;this.h=null;this.u=function(c){2==c.severity&&b.m.reject(c);a.onError(c)};this.T=new Map;this.ba=new Map;this.L=new Tc(function(){return Bl(b)});this.$=!1;this.M=[];this.O=!1;this.I=new Tc(function(){Cl(b)});this.m.catch(function(){});this.j=new ul(function(){return Dl(b)});this.W=!1;this.D=this.F=null}r=Al.prototype;r.destroy=function(){return this.j.destroy()};
|
|
469
|
+
function Dl(a){return L(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,J(b,El(a),2);case 2:if(!a.l){b.s(3);break}wa(b,4);return J(b,a.l.setMediaKeys(null),6);case 6:xa(b,5);break;case 4:ya(b);case 5:a.l=null;case 3:a.g=null,a.A=null,a.B=new Map,a.h=null,a.u=function(){},a.C=null,a.W=!1,a.F=null,K(b)}})}r.configure=function(a){this.h=a;this.I&&this.I.Sa(this.h.updateExpirationTime)};
|
|
470
|
+
function Fl(a,b,c){a.B=new Map;c=t(c);for(var d=c.next();!d.done;d=c.next())a.B.set(d.value,{initData:null,initDataType:null});c=t(a.h.persistentSessionsMetadata);for(d=c.next();!d.done;d=c.next())d=d.value,a.B.set(d.sessionId,{initData:d.initData,initDataType:d.initDataType});a.$=0<a.B.size;return Gl(a,b)}
|
|
471
|
+
function Gl(a,b){var c,d,e,f,g,h,k,l,m,n,q,p,u,x,v,z,w,E,F;return L(function(D){if(1==D.g){if(c=Hl(a))for(d=t(b),e=d.next();!e.done;e=d.next())f=e.value,f.video&&(f.video.drmInfos=[c]),f.audio&&(f.audio.drmInfos=[c]);g=b.some(function(I){return I.video&&I.video.drmInfos.length||I.audio&&I.audio.drmInfos.length?!0:!1});g||(h=yl(a.h.servers),Il(b,h));k=new Set;l=t(b);for(m=l.next();!m.done;m=l.next())for(n=m.value,q=Jl(n),p=t(q),u=p.next();!u.done;u=p.next())x=u.value,k.add(x);v=t(k);for(z=v.next();!z.done;z=
|
|
472
|
+
v.next())w=z.value,Kl(w,yl(a.h.servers),yl(a.h.advanced||{}),a.h.keySystemsMapping);return J(D,Te(b,a.$,a.W,a.h.preferredKeySystems),2)}vl(a.j);E=g||Object.keys(a.h.servers).length;if(!E)return a.aa=!0,D.return(Promise.resolve());F=Ll(a,b);return D.return(g?F:F.catch(function(){}))})}
|
|
473
|
+
function Ml(a){var b;return L(function(c){switch(c.g){case 1:if(a.l.mediaKeys)return c.return();if(!a.F){c.s(2);break}return J(c,a.F,3);case 3:return vl(a.j),c.return();case 2:return wa(c,4),a.F=a.l.setMediaKeys(a.A),J(c,a.F,6);case 6:xa(c,5);break;case 4:b=ya(c),a.u(new S(2,6,6003,b.message));case 5:vl(a.j),K(c)}})}function Nl(a,b){return L(function(c){if(1==c.g)return J(c,Ml(a),2);Ol(a,b.initDataType,yb(b.initData));K(c)})}
|
|
474
|
+
r.Ob=function(a){var b=this;return L(function(c){if(1==c.g){if(!b.A)return b.o.Aa(a,"encrypted",function(){b.u(new S(2,6,6010))}),c.return();b.l=a;b.o.Aa(b.l,"play",function(){for(var d=t(b.M),e=d.next();!e.done;e=d.next())Pl(b,e.value);b.O=!0;b.M=[]});b.l.remote?(b.o.G(b.l.remote,"connect",function(){return El(b)}),b.o.G(b.l.remote,"connecting",function(){return El(b)}),b.o.G(b.l.remote,"disconnect",function(){return El(b)})):"webkitCurrentPlaybackTargetIsWireless"in b.l&&b.o.G(b.l,"webkitcurrentplaybacktargetiswirelesschanged",
|
|
475
|
+
function(){return El(b)});b.D=b.g?b.g.initData.find(function(d){return 0<d.initData.length})||null:null;return b.D||"com.apple.fps"!==b.g.keySystem||b.B.size?J(c,Ml(b),2):c.s(2)}Ql(b).catch(function(){});b.D||b.B.size||b.h.parseInbandPsshEnabled||b.o.G(b.l,"encrypted",function(d){return Nl(b,d)});K(c)})};
|
|
476
|
+
function Rl(a){var b,c,d,e,f;return L(function(g){switch(g.g){case 1:if(!a.A||!a.g)return g.return();if(!a.g.serverCertificateUri||a.g.serverCertificate&&a.g.serverCertificate.length){g.s(2);break}b=Ii([a.g.serverCertificateUri],a.h.retryParameters);wa(g,3);c=a.C.Gb.request(5,b);return J(g,c.promise,5);case 5:d=g.h;a.g.serverCertificate=yb(d.data);xa(g,4);break;case 3:throw e=ya(g),new S(2,6,6017,e);case 4:if(a.j.g)return g.return();case 2:if(!a.g.serverCertificate||!a.g.serverCertificate.length)return g.return();
|
|
477
|
+
wa(g,6);return J(g,a.A.setServerCertificate(a.g.serverCertificate),8);case 8:xa(g,0);break;case 6:throw f=ya(g),new S(2,6,6004,f.message);}})}
|
|
478
|
+
function Ql(a){var b,c,d,e,f;return L(function(g){if(1==g.g){if(!a.B.size)return g.s(2);a.B.forEach(function(h,k){Sl(a,k,h)});return J(g,a.m,3)}if(2!=g.g){b=a.g&&a.g.keyIds||new Set([]);if(0<b.size&&Tl(a))return g.return(a.m);a.m=new si;a.m.catch(function(){})}c=(a.g?a.g.initData:[])||[];d=t(c);for(e=d.next();!e.done;e=d.next())f=e.value,Ol(a,f.initDataType,f.initData);Ul(a)&&a.m.resolve();return g.return(a.m)})}
|
|
479
|
+
function Ol(a,b,c){if(c.length){if(a.h.ignoreDuplicateInitData){var d=a.i.values();d=t(d);for(var e=d.next();!e.done;e=d.next())if(wb(c,e.value.initData))return;var f=!1;a.B.forEach(function(g){!f&&wb(c,g.initData)&&(f=!0)});if(f)return}0<a.i.size&&Ul(a)&&(a.m.resolve(),a.m=new si,a.m.catch(function(){}));Vl(a,b,c,a.g.sessionType)}}
|
|
480
|
+
r.Nd=function(){var a=this,b=this.i.keys();b=wl(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)};r.Od=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};r.Oc=function(){return zl(this.ba)};
|
|
481
|
+
function Ll(a,b){var c,d,e,f,g,h,k;return L(function(l){switch(l.g){case 1:c=new Map;if(b.length){d=Wl(a,b,c);l.s(2);break}return J(l,Xl(a),3);case 3:d=l.h;case 2:e=d;if(!e)throw new S(2,6,6001);vl(a.j);wa(l,4);e.getConfiguration();if(b.length){var m=e.keySystem;var n=c.get(e.keySystem);var q=[],p=[],u=[],x=[],v=[],z=new Set;Yl(n,q,p,x,u,v,z);var w=a.$?"persistent-license":"temporary";m={keySystem:m,encryptionScheme:q[0],licenseServerUri:p[0],distinctiveIdentifierRequired:n[0].distinctiveIdentifierRequired,
|
|
482
|
+
persistentStateRequired:n[0].persistentStateRequired,sessionType:n[0].sessionType||w,audioRobustness:n[0].audioRobustness||"",videoRobustness:n[0].videoRobustness||"",serverCertificate:x[0],serverCertificateUri:u[0],initData:v,keyIds:z};n=t(n);for(q=n.next();!q.done;q=n.next())q=q.value,q.distinctiveIdentifierRequired&&(m.distinctiveIdentifierRequired=q.distinctiveIdentifierRequired),q.persistentStateRequired&&(m.persistentStateRequired=q.persistentStateRequired);n=m}else n=e.keySystem,m=(void 0).get(e.keySystem),
|
|
483
|
+
q=[],p=[],u=[],x=[],v=[],z=new Set,Yl(m.drmInfos,q,p,x,u,v,z),n={keySystem:n,encryptionScheme:q[0],licenseServerUri:p[0],distinctiveIdentifierRequired:"required"==m.distinctiveIdentifier,persistentStateRequired:"required"==m.persistentState,sessionType:m.sessionTypes[0]||"temporary",audioRobustness:(m.audioCapabilities?m.audioCapabilities[0].robustness:"")||"",videoRobustness:(m.videoCapabilities?m.videoCapabilities[0].robustness:"")||"",serverCertificate:x[0],serverCertificateUri:u[0],initData:v,
|
|
484
|
+
keyIds:z};a.g=n;if(!a.g.licenseServerUri)throw new S(2,6,6012,a.g.keySystem);return J(l,e.createMediaKeys(),6);case 6:f=l.h;vl(a.j);a.A=f;if(!(""!=a.h.minHdcpVersion&&"getStatusForPolicy"in a.A)){l.s(7);break}wa(l,8);return J(l,a.A.getStatusForPolicy({minHdcpVersion:a.h.minHdcpVersion}),10);case 10:g=l.h;if("usable"!=g)throw new S(2,6,6018);vl(a.j);xa(l,7,4);break;case 8:h=ya(l,4);if(h instanceof S)throw h;throw new S(2,6,6019,h.message);case 7:return a.aa=!0,J(l,Rl(a),11);case 11:vl(a.j);xa(l,0);
|
|
485
|
+
break;case 4:k=ya(l);vl(a.j,k);a.g=null;if(k instanceof S)throw k;throw new S(2,6,6002,k.message);}})}
|
|
486
|
+
function Wl(a,b,c){for(var d=t(b),e=d.next();!e.done;e=d.next()){e=t(Jl(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 S(2,6,6E3);d=a.h.preferredKeySystems;d.length||(e=yl(a.h.servers),1==e.size&&(d=Array.from(e.keys())));e=t(d);var g=e.next();for(f={};!g.done;f={qf:void 0},g=e.next()){f.qf=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&&
|
|
487
|
+
null!=q.keySystemAccess&&q.keySystemAccess.keySystem==n.qf}}(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.h.keySystemsMapping[l]&&(m=c.get(a.h.keySystemsMapping[l]));l=t(m);for(m=l.next();!m.done;m=l.next())if(!!m.value.licenseServerUri==
|
|
488
|
+
f)return k.keySystemAccess}}}return null}
|
|
489
|
+
function Xl(a){var b,c,d,e,f,g,h,k,l,m,n,q,p,u,x,v;return L(function(z){switch(z.g){case 1:if(1==(void 0).size&&(void 0).has(""))throw new S(2,6,6E3);c=t((void 0).values());for(d=c.next();!d.done;d=c.next())e=d.value,0==e.audioCapabilities.length&&delete e.audioCapabilities,0==e.videoCapabilities.length&&delete e.videoCapabilities;f=t(a.h.preferredKeySystems);g=f.next();case 2:if(g.done){z.s(4);break}h=g.value;if(!(void 0).has(h)){z.s(3);break}k=(void 0).get(h);wa(z,6);return J(z,navigator.requestMediaKeySystemAccess(h,
|
|
490
|
+
[k]),8);case 8:return b=z.h,z.return(b);case 6:ya(z);case 7:vl(a.j);case 3:g=f.next();z.s(2);break;case 4:l=t([!0,!1]),m=l.next();case 9:if(m.done){z.s(11);break}n=m.value;q=t((void 0).keys());p=q.next();case 12:if(p.done){m=l.next();z.s(9);break}u=p.value;x=(void 0).get(u);v=x.drmInfos.some(function(w){return!!w.licenseServerUri});if(v!=n){z.s(13);break}wa(z,15);return J(z,navigator.requestMediaKeySystemAccess(u,[x]),17);case 17:return b=z.h,z.return(b);case 15:ya(z);case 16:vl(a.j);case 13:p=q.next();
|
|
491
|
+
z.s(12);break;case 11:return z.return(b)}})}function Hl(a){a=yl(a.h.clearKeys);return 0==a.size?null:Md(a)}function Zl(a){Ul(a)&&a.m.resolve()}function $l(a,b){(new Tc(function(){b.loaded=!0;Zl(a)})).Z(am)}
|
|
492
|
+
function Sl(a,b,c){var d,e,f,g,h,k,l;L(function(m){switch(m.g){case 1:try{d=a.A.createSession("persistent-license")}catch(n){return e=new S(2,6,6005,n.message),a.u(e),m.return(Promise.reject(e))}a.o.G(d,"message",function(n){a.l&&a.h.delayLicenseRequestUntilPlayed&&a.l.paused&&!a.O?a.M.push(n):Pl(a,n)});a.o.G(d,"keystatuseschange",function(n){return bm(a,n)});f={initData:c.initData,initDataType:c.initDataType,loaded:!1,fe:Infinity,jb:null,type:"persistent-license"};a.i.set(d,f);wa(m,2);return J(m,
|
|
493
|
+
d.load(b),4);case 4:return g=m.h,vl(a.j),g||(a.i.delete(d),h=a.h.persistentSessionOnlinePlayback?1:2,a.u(new S(h,6,6013)),f.loaded=!0),$l(a,f),Zl(a),m.return(d);case 2:k=ya(m),vl(a.j,k),a.i.delete(d),l=a.h.persistentSessionOnlinePlayback?1:2,a.u(new S(l,6,6005,k.message)),f.loaded=!0,Zl(a);case 3:return m.return(Promise.resolve())}})}
|
|
494
|
+
function Vl(a,b,c,d){try{var e=a.A.createSession(d)}catch(f){a.u(new S(2,6,6005,f.message));return}a.o.G(e,"message",function(f){a.l&&a.h.delayLicenseRequestUntilPlayed&&a.l.paused&&!a.O?a.M.push(f):Pl(a,f)});a.o.G(e,"keystatuseschange",function(f){return bm(a,f)});a.i.set(e,{initData:c,initDataType:b,loaded:!1,fe:Infinity,jb:null,type:d});try{c=a.h.initDataTransform(c,b,a.g)}catch(f){b=f;f instanceof S||(b=new S(2,6,6016,f));a.u(b);return}a.h.logLicenseExchange&&Fd(c);e.generateRequest(b,c).catch(function(f){if(!a.j.g){a.i.delete(e);
|
|
495
|
+
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.u(new S(2,6,6006,f.message,f,h))}})}
|
|
496
|
+
function Pl(a,b){var c,d,e,f,g,h,k,l,m,n,q,p,u,x;L(function(v){switch(v.g){case 1:c=b.target;a.h.logLicenseExchange&&Fd(b.message);d=a.i.get(c);e=a.g.licenseServerUri;f=a.h.advanced[a.g.keySystem];"individualization-request"==b.messageType&&f&&f.individualizationServer&&(e=f.individualizationServer);g=Ii([e],a.h.retryParameters);g.body=b.message;g.method="POST";g.licenseRequestType=b.messageType;g.sessionId=c.sessionId;g.drmInfo=a.g;d&&(g.initData=d.initData,g.initDataType=d.initDataType);if(f&&f.headers)for(h in f.headers)g.headers[h]=
|
|
497
|
+
f.headers[h];if("org.w3.clearkey"===a.g.keySystem){var z=g,w=a.g;try{var E=yd(z.body);if(E){var F=JSON.parse(E);F.type||(F.type=w.sessionType,z.body=zd(JSON.stringify(F)))}}catch(D){}}if(Pc(a.g.keySystem))if(z=wd(g.body,!0,!0),z.includes("PlayReadyKeyMessage")){z=fj(z,"PlayReadyKeyMessage");w=mj(z,"HttpHeader");w=t(w);for(E=w.next();!E.done;E=w.next())F=E.value,E=mj(F,"name")[0],F=mj(F,"value")[0],g.headers[lj(E)]=lj(F);z=mj(z,"Challenge")[0];g.body=Gd(lj(z))}else g.headers["Content-Type"]="text/xml; charset=utf-8";
|
|
498
|
+
k=Date.now();wa(v,2);m=a.C.Gb.request(2,g);return J(v,m.promise,4);case 4:l=v.h;xa(v,3);break;case 2:n=ya(v);if(a.j.g)return v.return();q=new S(2,6,6007,n);1==a.i.size?(a.u(q),d&&d.jb&&d.jb.reject(q)):(d&&d.jb&&d.jb.reject(q),a.i.delete(c),Ul(a)&&(a.m.resolve(),a.L.Z(.1)));return v.return();case 3:if(a.j.g)return v.return();a.H+=(Date.now()-k)/1E3;a.h.logLicenseExchange&&Fd(l.data);wa(v,5);return J(v,c.update(l.data),7);case 7:xa(v,6);break;case 5:return p=ya(v),u=new S(2,6,6008,p.message),a.u(u),
|
|
499
|
+
d&&d.jb&&d.jb.reject(u),v.return();case 6:if(a.j.g)return v.return();x=new zi("drmsessionupdate");a.C.onEvent(x);d&&(d.jb&&d.jb.resolve(),$l(a,d));K(v)}})}
|
|
500
|
+
function bm(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}if(Pc(a.g.keySystem)&&16==g.byteLength&&(Xc()||gd())){h=Cb(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=Id(g).slice(0,32);a.T.set(g,f)});var e=b.expiration-Date.now();(0>e||d&&1E3>e)&&c&&!c.jb&&(a.i.delete(b),b.close().catch(function(){}));
|
|
501
|
+
Ul(a)&&(a.m.resolve(),a.L.Z(cm))}function Bl(a){var b=a.T,c=a.ba;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.u(new S(2,6,6014));a.C.mf(zl(c))}
|
|
502
|
+
function dm(){var a,b,c,d,e,f,g,h,k,l,m,n,q,p,u,x,v,z,w,E,F,D,I,A,C,B,H,G,N;return L(function(Q){if(1==Q.g){a="org.w3.clearkey com.widevine.alpha com.widevine.alpha.experiment com.microsoft.playready com.microsoft.playready.hardware com.microsoft.playready.recommendation com.chromecast.playready com.apple.fps.1_0 com.apple.fps".split(" ");b=["SW_SECURE_CRYPTO","SW_SECURE_DECODE","HW_SECURE_CRYPTO","HW_SECURE_DECODE","HW_SECURE_ALL"];c=["150","2000","3000"];d={"com.widevine.alpha":b,"com.widevine.alpha.experiment":b,
|
|
503
|
+
"com.microsoft.playready.recommendation":c};e=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}];f=[{contentType:'audio/mp4; codecs="mp4a.40.2"'},{contentType:'audio/webm; codecs="opus"'}];g={videoCapabilities:e,audioCapabilities:f,initDataTypes:["cenc","sinf","skd","keyids"]};h=[null,"cenc","cbcs","cbcs-1-9"];k=new Map;l=function(M,P){var aa,R,W,U,ba,pa,oa,qa;return L(function(Aa){switch(Aa.g){case 1:return wa(Aa,2),J(Aa,P.createMediaKeys(),4);case 4:xa(Aa,
|
|
504
|
+
3);break;case 2:return ya(Aa),Aa.return();case 3:R=(aa=P.getConfiguration().sessionTypes)?aa.includes("persistent-license"):!1,ad()&&(R=!1),W=P.getConfiguration().videoCapabilities,U=P.getConfiguration().audioCapabilities,ba={persistentState:R,encryptionSchemes:[],videoRobustnessLevels:[],audioRobustnessLevels:[]},k.has(M)&&k.get(M)?ba=k.get(M):k.set(M,ba),(pa=W[0].encryptionScheme)&&!ba.encryptionSchemes.includes(pa)&&ba.encryptionSchemes.push(pa),(oa=W[0].robustness)&&!ba.videoRobustnessLevels.includes(oa)&&
|
|
505
|
+
ba.videoRobustnessLevels.push(oa),(qa=U[0].robustness)&&!ba.audioRobustnessLevels.includes(qa)&&ba.audioRobustnessLevels.push(qa),K(Aa)}})};m=function(M,P,aa,R){var W,U,ba,pa,oa,qa,Aa,Ha,Da,hb;return L(function(Ia){switch(Ia.g){case 1:wa(Ia,2);W=He(g);U=t(W.videoCapabilities);for(ba=U.next();!ba.done;ba=U.next())pa=ba.value,pa.encryptionScheme=P,pa.robustness=aa;oa=t(W.audioCapabilities);for(qa=oa.next();!qa.done;qa=oa.next())Aa=qa.value,Aa.encryptionScheme=P,Aa.robustness=R;Ha=He(W);Ha.persistentState=
|
|
506
|
+
"required";Ha.sessionTypes=["persistent-license"];Da=[Ha,W];return J(Ia,we(navigator.requestMediaKeySystemAccess(M,Da)),4);case 4:return hb=Ia.h,J(Ia,l(M,hb),5);case 5:xa(Ia,0);break;case 2:ya(Ia),K(Ia)}})};n=function(M,P,aa,R){var W,U,ba;return L(function(pa){switch(pa.g){case 1:return wa(pa,2),W={type:"media-source",video:{contentType:e[0].contentType,width:640,height:480,bitrate:1,framerate:1},audio:{contentType:f[0].contentType,channels:2,bitrate:1,samplerate:1},keySystemConfiguration:{keySystem:M,
|
|
507
|
+
video:{encryptionScheme:P,robustness:aa},audio:{encryptionScheme:P,robustness:R}}},J(pa,we(navigator.mediaCapabilities.decodingInfo(W)),4);case 4:return U=pa.h,ba=U.keySystemAccess,J(pa,l(M,ba),5);case 5:xa(pa,0);break;case 2:ya(pa),K(pa)}})};q=t(a);for(p=q.next();!p.done;p=q.next())u=p.value,k.set(u,null);x=function(M){return"org.w3.clearkey"===M&&kd()||M&&M.match(/^com\.apple\.fps/)&&od()||Pc(M)&&(nd()||ed())||Pc(M)&&Zc("Firefox")||"com.huawei.wiseplay"===M&&(od()||nd())?!1:!0};v=[];z=t(h);for(w=
|
|
508
|
+
z.next();!w.done;w=z.next())for(E=w.value,F=t(a),D=F.next();!D.done;D=F.next())I=D.value,x(I)&&(v.push(m(I,E,"","")),v.push(n(I,E,"","")));A=t(a);for(C=A.next();!C.done;C=A.next())for(B=C.value,H=t(d[B]||[]),G=H.next();!G.done;G=H.next())N=G.value,x(B)&&(v.push(m(B,null,N,"")),v.push(m(B,null,"",N)),v.push(n(B,null,N,"")),v.push(n(B,null,"",N)));return J(Q,Promise.all(v),2)}return Q.return(zl(k))})}
|
|
509
|
+
function em(a){var b;return L(function(c){if(1==c.g)return b=new Promise(function(d,e){(new Tc(e)).Z(fm)}),wa(c,2),J(c,Promise.race([Promise.all([a.close(),a.closed]),b]),4);if(2!=c.g)return xa(c,0);ya(c);K(c)})}
|
|
510
|
+
function El(a){var b;return L(function(c){b=Array.from(a.i.entries());a.i.clear();return J(c,Promise.all(b.map(function(d){d=t(d);var e=d.next().value,f=d.next().value;return L(function(g){if(1==g.g)return wa(g,2),a.B.has(e.sessionId)||"persistent-license"!==f.type||a.h.persistentSessionOnlinePlayback?J(g,em(e),5):J(g,e.remove(),5);if(2!=g.g)return xa(g,0);ya(g);K(g)})})),0)})}function Jl(a){return(a.video?a.video.drmInfos:[]).concat(a.audio?a.audio.drmInfos:[])}
|
|
511
|
+
function Cl(a){a.i.forEach(function(b,c){var d=b.fe,e=c.expiration;isNaN(e)&&(e=Infinity);e!=d&&(a.C.onExpirationUpdated(c.sessionId,e),b.fe=e)})}function Ul(a){a=a.i.values();return xl(a,function(b){return b.loaded})}function Tl(a){for(var b=t(a.g&&a.g.keyIds||new Set([])),c=b.next();!c.done;c=b.next())if("usable"!==a.T.get(c.value))return!1;return!0}
|
|
512
|
+
function Il(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)}
|
|
513
|
+
function Yl(a,b,c,d,e,f,g){var h=[];a=t(a);for(var k=a.next(),l={};!k.done;l={na:void 0},k=a.next()){l.na=k.value;b.includes(l.na.encryptionScheme)||b.push(l.na.encryptionScheme);"org.w3.clearkey"==l.na.keySystem&&l.na.licenseServerUri.startsWith("data:application/json;base64,")?h.includes(l.na.licenseServerUri)||h.push(l.na.licenseServerUri):c.includes(l.na.licenseServerUri)||c.push(l.na.licenseServerUri);e.includes(l.na.serverCertificateUri)||e.push(l.na.serverCertificateUri);l.na.serverCertificate&&
|
|
514
|
+
(d.some(function(q){return function(p){return wb(p,q.na.serverCertificate)}}(l))||d.push(l.na.serverCertificate));if(l.na.initData){k=t(l.na.initData);for(var m=k.next(),n={};!m.done;n={Td:void 0},m=k.next())n.Td=m.value,f.some(function(q){return function(p){var u=q.Td;return p.keyId&&p.keyId==u.keyId?!0:p.initDataType==u.initDataType&&wb(p.initData,u.initData)}}(n))||f.push(n.Td)}if(l.na.keyIds)for(l=t(l.na.keyIds),k=l.next();!k.done;k=l.next())g.add(k.value)}if(1==h.length)c.push(h[0]);else if(0<
|
|
515
|
+
h.length){b=[];h=t(h);for(d=h.next();!d.done;d=h.next())d=window.atob(d.value.split("data:application/json;base64,").pop()),d=JSON.parse(d),b.push.apply(b,y(d.keys));h=JSON.stringify({keys:b});c.push("data:application/json;base64,"+window.btoa(h))}}
|
|
516
|
+
function Kl(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.videoRobustness||(a.videoRobustness=c.videoRobustness),a.audioRobustness||(a.audioRobustness=c.audioRobustness),a.serverCertificate||(a.serverCertificate=
|
|
517
|
+
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")}}var fm=1,am=5,cm=.5;function gm(a){return 1==a.length&&1E-4>a.end(0)-a.start(0)}function hm(a){return!a||gm(a)?null:a.length?a.end(a.length-1):null}function im(a,b){return!a||!a.length||gm(a)||b>a.end(a.length-1)?!1:b>=a.start(0)}function jm(a,b){if(!a||!a.length||gm(a))return 0;var c=0;a=t(km(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}
|
|
518
|
+
function lm(a,b,c){if(!a||!a.length||gm(a))return null;a=km(a).findIndex(function(d,e,f){return d.start>b&&(0==e||f[e-1].end-b<=c)});return 0<=a?a:null}function km(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 mm(a,b,c){this.j=c;this.l=a;this.u=nm(a);this.g=a.g.currentTime;this.m=Date.now()/1E3;this.h=!1;this.o=0;this.A=b;this.i=function(){}}mm.prototype.release=function(){this.j=this.l=null;this.i=function(){}};function om(a,b){a.i=b}function pm(a){this.g=a}function nm(a){if(a.g.paused||0==a.g.playbackRate||0==a.g.buffered.length)var b=!1;else a:{b=a.g.currentTime;a=t(km(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};function qm(a,b,c,d,e){var f=this;this.A=e;this.g=a;this.C=b;this.o=c;this.m=new fb;this.l=this.B=!1;this.F=a.readyState;this.D=this.i=0;this.h=d;this.u=!1;this.m.G(a,"waiting",function(){return rm(f)});this.j=new Tc(function(){rm(f)})}qm.prototype.release=function(){this.m&&(this.m.release(),this.m=null);null!=this.j&&(this.j.stop(),this.j=null);this.h&&(this.h.release(),this.h=null);this.g=this.C=this.A=null};qm.prototype.ge=function(){this.u=!0;rm(this)};
|
|
519
|
+
function rm(a){if(0!=a.g.readyState&&a.B){if(a.g.seeking){if(!a.l)return}else a.l=!1;if(!a.g.paused||a.g.currentTime==a.i&&(a.g.autoplay||a.g.currentTime!=a.i)){a.g.readyState!=a.F&&(a.F=a.g.readyState);var b;if(!(b=!a.h)){b=a.h;var c=b.l,d=nm(c),e=c.g.currentTime,f=Date.now()/1E3;if(b.g!=e||b.u!=d)b.m=f,b.g=e,b.u=d,b.h=!1;e=f-b.m;if(d=e>=b.A&&d&&!b.h)b.i(b.g,e),b.h=!0,b.g=c.g.currentTime,b.o++,b.j(new zi("stalldetected"));b=!d}if(b&&(b=a.g.currentTime,c=a.g.buffered,d=lm(c,b,a.o.gapDetectionThreshold),
|
|
520
|
+
null!=d&&(0!=d||a.u))){e=c.start(d);if(navigator.userAgent.match(/Edge\//)||Yc()||$c())e=Math.ceil(100*(e+a.o.gapPadding))/100;e>=a.C.Va()||.001>e-b||(0!=d&&c.end(d-1),a.g.currentTime=e,b==a.i&&(a.i=e),a.D++,a.A(new zi("gapjumped")))}}}};/*
|
|
521
|
+
@license
|
|
522
|
+
Shaka Player
|
|
523
|
+
Copyright 2023 Google LLC
|
|
524
|
+
SPDX-License-Identifier: Apache-2.0
|
|
525
|
+
*/
|
|
526
|
+
function sm(a,b,c){this.h=a;this.i=b;this.g=c}function tm(a,b){return L(function(c){if(1==c.g)return J(c,Oe(a.g,b,a.h.drm.preferredKeySystems),2);Ke(b,a.h.preferredVideoCodecs,a.h.preferredAudioCodecs,a.h.preferredDecodingAttributes);if(!b.variants.some(rf))throw new S(2,4,4032);return c.return(um(a,b))})}
|
|
527
|
+
function um(a,b){var c=Ne(b.variants,a.h.restrictions,a.i);if(b){var d=a.g?a.g.g:null;if(d&&a.g.A)for(var e=t(b.variants),f=e.next();!f.done;f=e.next())f=f.value,vm(a,d.keySystem,f.video),vm(a,d.keySystem,f.audio);wm(a,b)}return c}function vm(a,b,c){if(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,Ol(a.g,e.initDataType,e.initData)}}}
|
|
528
|
+
function wm(a,b){a=a.g?a.g.Oc():{};var c=Object.keys(a);c=c.length&&"00"==c[0];var d=!1,e=!1,f=new Set,g=new Set;b=t(b.variants);for(var h=b.next();!h.done;h=b.next()){h=h.value;var k=[];h.audio&&k.push(h.audio);h.video&&k.push(h.video);k=t(k);for(var l=k.next();!l.done;l=k.next())if(l=l.value,l.keyIds.size){l=t(l.keyIds);for(var m=l.next();!m.done;m=l.next()){m=m.value;var n=a[c?"00":m];n?xm.includes(n)&&g.add(n):f.add(m)}}h.allowedByApplication?h.allowedByKeySystem&&(d=!0):e=!0}if(!d)throw a={hasAppRestrictions:e,
|
|
529
|
+
missingKeys:Array.from(f),restrictedKeyStatuses:Array.from(g)},new S(2,4,4012,a);}var xm=["output-restricted","internal-error"];function ym(a,b,c,d){var e=this;this.j=a;this.aa=c;this.B=null;this.D=b;this.g={};this.A={};this.wa={};this.h=null;this.ja=!1;this.$=d||null;this.m={};this.u=new fb;this.i={};this.I=null;this.F=new si;this.ma="";this.xa=!1;this.l=zm(this,this.F);this.H=!1;this.L=new ul(function(){return Am(e)});this.C=!1;this.W="UNKNOWN";this.ra=this.va=!1;this.la=new si;this.o=!1;this.ha=!0;this.ga=null;this.T={};this.fa=this.M=this.ka=this.O=null;this.ba=new si}
|
|
530
|
+
function zm(a,b){a.ha=!0;if(window.ManagedMediaSource){a.j.disableRemotePlayback=!0;var c=new ManagedMediaSource;a.u.G(c,"startstreaming",function(){a.ha=!0});a.u.G(c,"endstreaming",function(){a.ha=!1})}else c=new MediaSource;a.u.Aa(c,"sourceopen",function(){URL.revokeObjectURL(a.ma);b.resolve()});a.u.Aa(a.j,"playing",function(){a.xa=!0});a.ma=Bm(c);a.j.src=a.ma;return c}
|
|
531
|
+
function Cm(a,b){var c,d,e,f,g,h,k,l,m,n,q;return L(function(p){if(1==p.g)return a.createSegmentIndex?J(p,a.createSegmentIndex(),2):p.s(2);if(!a.segmentIndex)return p.return(!1);if(0==a.segmentIndex.getNumReferences())return p.return(!0);c=Sd;d=new Set;e=t(a.segmentIndex);for(f=e.next();!f.done;f=e.next())if(g=f.value,h=g.mimeType||a.mimeType||"",k=g.codecs||a.codecs||"",h!=a.mimeType||k!=a.codecs)if(l=h+":"+k,!d.has(l))if(d.add(l),b==c.pa){if(m=Ud(h,k),!me(m))return p.return(!1)}else if(b==c.da?
|
|
532
|
+
k=af(k):b==c.S&&(k=$e(k,h)),n=Yd(a,h,k),q=Wd(h,k),!lb(n)&&!mc(q))return p.return(!1);return p.return(!0)})}r=ym.prototype;r.destroy=function(){return this.L.destroy()};
|
|
533
|
+
function Am(a){var b,c,d,e,f,g,h,k;return L(function(l){if(1==l.g){b=[];for(c in a.m)for(d=a.m[c],e=d[0],a.m[c]=d.slice(0,1),e&&b.push(e.p.catch(ue)),f=t(d.slice(1)),g=f.next();!g.done;g=f.next())h=g.value,h.p.reject(new S(2,7,7003,void 0));a.h&&b.push(a.h.destroy());a.D&&b.push(a.D.destroy());for(k in a.i)b.push(a.i[k].destroy());return J(l,Promise.all(b),2)}a.u&&(a.u.release(),a.u=null);a.j&&(a.j.removeAttribute("src"),a.j.load(),a.j=null);a.B=null;a.l=null;a.h=null;a.D=null;a.g={};a.i={};a.I=null;
|
|
534
|
+
a.m={};a.$=null;a.T={};a.aa=null;K(l)})}
|
|
535
|
+
r.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;return L(function(m){switch(m.g){case 1:return f=Sd,J(m,e.F,2);case 2:if(!Dm(e)&&(e.H||e.l&&"closed"!=e.l.readyState)){m.s(3);break}Ya("Expected MediaSource to be open during init(); reopening the media source.");e.F=new si;e.l=zm(e,e.F);return J(m,e.F,3);case 3:e.C=b,e.W=c,e.va=d,e.ra=!e.C&&"HLS"==e.W&&!e.va,e.T={},e.O=null,e.ka=null,e.M=null,e.fa=null,e.ba=new si,g=t(a.keys()),h=g.next();case 5:if(h.done){m.s(0);
|
|
536
|
+
break}k=h.value;l=a.get(k);return J(m,Em(e,k,l,l.codecs),8);case 8:e.o?(e.m[f.S]=[],e.m[f.da]=[]):e.m[k]=[],h=g.next(),m.s(5)}})};
|
|
537
|
+
function Em(a,b,c,d){var e,f,g,h,k,l,m,n,q,p,u,x;return L(function(v){switch(v.g){case 1:return e=Sd,f=Sa,g=Ta,J(v,Cm(c,b),2);case 2:g.call(f,v.h,"Type negotiation should happen before MediaSourceEngine.init!");b==e.S&&d&&(d=$e(d,c.mimeType));h=Ud(c.mimeType,d);if(b==e.pa){Fm(a,h,a.C,c.external);v.s(0);break}k=a.B.forceTransmux;if(!lb(h)||!a.C&&Vd.includes(h))k=!0;l=Wd(c.mimeType,d);if(!k){v.s(4);break}m=Od(e.S,(d||"").split(","));n=Od(e.da,(d||"").split(","));if(!m||!n){v.s(5);break}a.o=!0;return J(v,
|
|
538
|
+
Em(a,e.S,c,m),6);case 6:return J(v,Em(a,e.da,c,n),7);case 7:return v.return();case 5:if(q=mc(l))p=q(),a.i[b]=p,h=p.convertCodecs(b,l);case 4:u=h+a.B.addExtraFeaturesToSourceBuffer(h);vl(a.L);try{x=a.l.addSourceBuffer(u)}catch(z){throw new S(2,3,3015,z,"The mediaSource_ status was "+a.l.readyState+" expected 'open'",null);}a.C&&(x.mode=Gm);a.u.G(x,"error",function(){var z=a.m[b][0];z.p.reject(new S(2,3,3014,a.j.error?a.j.error.code:0,z.uri))});a.u.G(x,"updateend",function(){return Hm(a,b)});a.g[b]=
|
|
539
|
+
x;a.A[b]=h;a.wa[b]=!!c.drmInfos.length;K(v)}})}r.configure=function(a){this.B=a;this.h&&(this.h.A=a.modifyCueCallback)};
|
|
540
|
+
function Fm(a,b,c,d){a.h||(a.h=new le(a.D),a.h&&(a.h.A=a.B.modifyCueCallback));var e=a.h;d=d||a.ja;a=a.W;"application/cea-608"==b||"application/cea-708"==b?e.i=null:(e.i=(0,ne[b])(),e.i.setSequenceMode?e.i.setSequenceMode(c):pb("Text parsers w/ setSequenceMode",'Text parsers should have a "setSequenceMode" method!'),e.i.setManifestType?e.i.setManifestType(a):pb("Text parsers w/ setManifestType",'Text parsers should have a "setManifestType" method!'),e.B=d)}
|
|
541
|
+
function Dm(a){return a.H?!1:a.l?"ended"==a.l.readyState:!0}function Im(a,b){Object.keys(a.g).length?b==Qd?a=a.h.g:(a=Jm(a,b),a=!a||gm(a)?null:1==a.length&&0>a.start(0)?0:a.length?a.start(0):null):a=null;return a}function Km(a,b){return Object.keys(a.g).length?b==Qd?a.h.h:hm(Jm(a,b)):null}function Lm(a,b,c){if(b==Qd)return a=a.h,null==a.h||a.h<c?0:a.h-Math.max(c,a.g);a=Jm(a,b);return jm(a,c)}
|
|
542
|
+
r.hb=function(){var a={total:this.H?[]:km(this.j.buffered),audio:km(Jm(this,"audio")),video:km(Jm(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 Jm(a,b){if(a.H)return null;try{return a.g[b].buffered}catch(c){return null}}
|
|
543
|
+
function Mm(a,b,c,d,e){var f=null,g=[],h=yb(c);if(Vd.includes(e))b=uh(h),b.length&&d&&((c=b.find(function(n){return"com.apple.streaming.transportStreamTimestamp"===n.description}))&&(f=Math.round(c.data)/1E3),a.aa.dd([{cueTime:d.startTime,data:h,frames:b,dts:d.startTime,pts:d.startTime}],0,d.endTime));else if(e.includes("/mp4")&&d&&0==d.timestampOffset&&d.ea&&d.ea.timescale){var k=d.ea.timescale;if(!isNaN(k)){var l=0,m=!1;(new xg).box("moof",Cg).box("traf",Cg).K("tfdt",function(n){l=Jg(n.reader,n.version).baseMediaDecodeTime/
|
|
544
|
+
k;m=!0;n.parser.stop()}).parse(c,!0);m&&(f=l)}}else e.includes("/mp4")||e.includes("/webm")||!Dh(h)||(a.T[b]?a.T[b].clearData():a.T[b]=new wh,a=a.T[b].parse(h),d=a.getStartTime(b),null!=d&&(f=d),g=a.getMetadata());return{timestamp:f,metadata:g}}
|
|
545
|
+
function Nm(a,b,c,d,e,f,g,h,k,l){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 m,n,q,p,u,x,v,z,w,E,F,D,I,A,C,B,H,G;return L(function(N){switch(N.g){case 1:m=Sd;if(b!=m.pa){N.s(2);break}if("HLS"!=a.W){N.s(3);break}return J(N,a.la,4);case 4:n=N.h,a.h.u=n;case 3:return J(N,oe(a.h,c,d?d.startTime:null,d?d.endTime:null,d?d.J()[0]:null),5);case 5:return N.return();case 2:if(l||!a.o){N.s(6);break}return J(N,Nm(a,m.S,c,d,e,f,g,h,k,!0),7);case 7:return J(N,Nm(a,m.da,c,d,e,f,g,
|
|
546
|
+
h,k,!0),8);case 8:return N.return();case 6:if(!a.g[b])return N.return();q=a.g[b].timestampOffset;p=a.A[b];a.i[b]&&(p=a.i[b].getOriginalMimeType());d&&(u=Mm(a,b,c,d,p),x=u.timestamp,v=u.metadata,null!=x&&(null==a.O&&b==m.da&&(a.O=x,a.ka=d.startTime,null!=a.M&&(z=0,a.ka==a.fa&&(z=a.O-a.M),a.ba.resolve(z))),null==a.M&&b==m.S&&(a.M=x,a.fa=d.startTime,null!=a.O&&(w=0,a.ka==a.fa&&(w=a.O-a.M),a.ba.resolve(w))),E=x,F=Vd,!a.C&&F.includes(a.A[b])&&(E=0),D=d.startTime-E,I=Math.abs(q-D),(.001<=I||g||h)&&(!k||
|
|
547
|
+
0<D||!q)&&(q=D,a.ra&&(Om(a,b,function(){return Pm(a,b)},null),Om(a,b,function(){return Qm(a,b,q)},null))),(A=b==m.da||!(m.da in a.g))&&a.la.resolve(q)),v.length&&a.aa.dd(v,q,d?d.endTime:null));f&&b==m.da&&(a.h||Fm(a,"application/cea-608",a.C,!1),a.I||(C=p.split(";",1)[0],a.I=new Eb(C)),d?(B=a.I.i(c),B.length&&se(a.h,B,d.startTime,d.endTime,q)):a.I.init(c,h));if(!a.i[b]){N.s(9);break}return J(N,a.i[b].transmux(c,e,d,a.l.duration,b),10);case 10:c=N.h;case 9:c=Rm(a,c,d?d.startTime:null,b,d?d.J()[0]:
|
|
548
|
+
null);if(!d||!a.C||b==m.pa){N.s(11);break}if(!g&&!h){N.s(11);break}H=d.startTime;if("HLS"!=a.W||a.o||b!=m.S||!a.g[m.da]){N.s(13);break}return J(N,a.ba,14);case 14:G=N.h,.1<Math.abs(G)&&(H-=G);case 13:Om(a,b,function(){return Pm(a,b)},null),Om(a,b,function(){return Qm(a,b,H)},null);case 11:return J(N,Om(a,b,function(){var Q=c;if("video"==b&&a.$){var M=a.$;M.g&&M.g.appendBuffer(Q,"video",M.o,-q)}a.g[b].appendBuffer(Q)},d?d.J()[0]:null),15);case 15:K(N)}})}
|
|
549
|
+
function Sm(a,b){var c=Km(a,"video")||0;qe(a.h,b,c)}function Tm(a){a.h&&qe(a.h,"",0)}r.remove=function(a,b,c){var d=this,e;return L(function(f){return 1==f.g?(e=Sd,a==e.pa?J(f,d.h.remove(b,c),0):c>b?J(f,Om(d,a,function(){return Um(d,a,b,c)},null),5):f.s(0)):d.o?J(f,Om(d,e.S,function(){return Um(d,e.S,b,c)},null),0):f.s(0)})};
|
|
550
|
+
function Vm(a,b){var c;return L(function(d){return 1==d.g?(c=Sd,b==c.pa?a.h?J(d,a.h.remove(0,Infinity),0):d.return():J(d,Om(a,b,function(){return Um(a,b,0,a.l.duration)},null),4)):a.o?J(d,Om(a,c.S,function(){return Um(a,c.S,0,a.l.duration)},null),0):d.s(0)})}r.flush=function(a){var b=this,c;return L(function(d){return 1==d.g?(c=Sd,a==c.pa?d.return():J(d,Om(b,a,function(){b.j.currentTime-=.001;Hm(b,a)},null),2)):b.o?J(d,Om(b,c.S,function(){var e=c.S;b.j.currentTime-=.001;Hm(b,e)},null),0):d.s(0)})};
|
|
551
|
+
function Wm(a,b,c,d,e,f,g,h,k){var l,m,n;return L(function(q){if(1==q.g){l=Sd;if(b==l.pa)return f||(a.h.u=c),pe(a.h,d,e),q.return();m=[];return J(q,Xm(a,b,g,h,k),2)}n=q.h;n||(m.push(Om(a,b,function(){return Pm(a,b)},null)),a.o&&m.push(Om(a,l.S,function(){return Pm(a,l.S)},null)));f||(m.push(Om(a,b,function(){return Qm(a,b,c)},null)),a.o&&m.push(Om(a,l.S,function(){return Qm(a,l.S,c)},null)));if(0!=d||Infinity!=e)m.push(Om(a,b,function(){a.g[b].appendWindowStart=0;a.g[b].appendWindowEnd=e;a.g[b].appendWindowStart=
|
|
552
|
+
d;Hm(a,b)},null)),a.o&&m.push(Om(a,l.S,function(){var p=l.S;a.g[p].appendWindowStart=0;a.g[p].appendWindowEnd=e;a.g[p].appendWindowStart=d;Hm(a,p)},null));return m.length?J(q,Promise.all(m),0):q.s(0)})}
|
|
553
|
+
function Ym(a,b,c){var d,e;return L(function(f){if(1==f.g){d=Sd;if(b==d.pa)return f.return();b==d.da&&(a.la=new si);if(!a.C||(e=Km(a,b))&&.1>Math.abs(e-c))return f.return();Om(a,b,function(){return Pm(a,b)},null);a.o&&Om(a,d.S,function(){return Pm(a,d.S)},null);return J(f,Om(a,b,function(){return Qm(a,b,c)},null),2)}return a.o?J(f,Om(a,d.S,function(){return Qm(a,d.S,c)},null),0):f.s(0)})}
|
|
554
|
+
r.endOfStream=function(a){var b=this;return L(function(c){return J(c,Zm(b,function(){Dm(b)||(b.H?0:b.l?"closed"==b.l.readyState:1)||(a?b.l.endOfStream(a):b.l.endOfStream())}),0)})};r.rb=function(a){var b=this;return L(function(c){return J(c,Zm(b,function(){if(a<b.l.duration)for(var d in b.g){var e={start:function(){},p:new si,uri:null};b.m[d].unshift(e)}b.l.duration=a;b.ga=a}),0)})};r.getDuration=function(){return this.l.duration};function Um(a,b,c,d){d<=c?Hm(a,b):a.g[b].remove(c,d)}
|
|
555
|
+
function Pm(a,b){var c=a.g[b].appendWindowStart,d=a.g[b].appendWindowEnd;a.g[b].abort();a.g[b].appendWindowStart=c;a.g[b].appendWindowEnd=d;Hm(a,b)}function Qm(a,b,c){0>c&&(c+=.001);a.g[b].timestampOffset=c;Hm(a,b)}function Hm(a,b){if(!a.H){var c=a.m[b][0];c&&(c.p.resolve(),$m(a,b))}}function Om(a,b,c,d){vl(a.L);c={start:c,p:new si,uri:d};a.m[b].push(c);1==a.m[b].length&&an(a,b);return c.p}
|
|
556
|
+
function Zm(a,b){var c,d,e,f,g,h,k;return L(function(l){switch(l.g){case 1:vl(a.L);c=[];d={};for(e in a.g)d={ready:void 0},d.ready=new si,f={start:function(m){return function(){return m.ready.resolve()}}(d),p:d.ready,uri:null},a.m[e].push(f),c.push(d.ready),1==a.m[e].length&&f.start();wa(l,2);return J(l,Promise.all(c),4);case 4:xa(l,3);break;case 2:throw g=ya(l),g;case 3:return wa(l,5,6),J(l,b(),6);case 6:za(l);for(h in a.g)$m(a,h);Ba(l,0);break;case 5:throw k=ya(l),new S(2,3,3015,k,a.j.error||"No error in the media element",
|
|
557
|
+
null);}})}function $m(a,b){a.m[b].shift();an(a,b)}function an(a,b){var c=a.m[b][0];if(c)try{c.start()}catch(d){"QuotaExceededError"==d.name?c.p.reject(new S(2,3,3017,b)):c.p.reject(new S(2,3,3015,d,a.j.error||"No error in the media element",c.uri)),$m(a,b)}}function Rm(a,b,c,d,e){c=null==c;var f=a.wa[d],g=a.aa.mg();if(f=a.B.insertFakeEncryptionInInit&&c&&f)g=Pc(g),f=$c()||Yc()||fd()||Xc()&&od()&&g;f&&"mp4"==$d(a.A[d])&&(b=pl(b,e));c&&ad()&&"mp4"==$d(a.A[d])&&(b=tl(b));return b}
|
|
558
|
+
function bn(a,b,c,d){return Om(a,b,function(){b!==Qd&&(nb()&&(a.i[b]&&(a.i[b].destroy(),delete a.i[b]),d&&(a.i[b]=d),a.g[b].changeType(c+a.B.addExtraFeaturesToSourceBuffer(c)),a.A[b]=c),Hm(a,b))},null)}
|
|
559
|
+
function cn(a,b){var c,d,e,f,g,h,k,l,m,n,q,p,u,x,v,z,w,E,F,D,I,A,C,B,H;return L(function(G){switch(G.g){case 1:c=Sd;a.H=!0;a.o=!1;d=a.j.currentTime;e=a.j.autoplay;f=a.j.paused;a.xa&&(a.j.autoplay=!1);G.l=0;G.j=2;a.u.Za();g=[];for(h in a.i)g.push(a.i[h].destroy());for(k in a.m)for(l=a.m[k],m=l[0],a.m[k]=l.slice(0,1),m&&g.push(m.p.catch(ue)),n=t(l.slice(1)),q=n.next();!q.done;q=n.next())p=q.value,p.p.reject(new S(2,7,7003,void 0));for(u in a.g){x=a.g[u];try{a.l.removeSourceBuffer(x)}catch(N){}}return J(G,
|
|
560
|
+
Promise.all(g),4);case 4:return a.i={},v=a.l.duration,a.F=new si,a.l=zm(a,a.F),J(G,a.F,5);case 5:!isNaN(v)&&v?a.l.duration=v:!isNaN(a.ga)&&a.ga&&(a.l.duration=a.ga),z=new si,w=a.l.sourceBuffers,E=b.size,F=0,D=function(){F++;F===E&&(z.resolve(),a.u.Kb(w,"addsourcebuffer",D))},a.u.G(w,"addsourcebuffer",D),I=t(b.keys()),A=I.next();case 6:if(A.done)return a.j.currentTime=d,J(G,z,2);C=A.value;B=a.g[C]?{timestampOffset:a.g[C].timestampOffset,appendWindowStart:a.g[C].appendWindowStart,appendWindowEnd:a.g[C].appendWindowEnd}:
|
|
561
|
+
null;H=b.get(C);return J(G,Em(a,C,H,H.codecs),9);case 9:a.o?(a.m[c.S]=[],a.m[c.da]=[]):a.m[C]=[];B&&a.g[C]&&(a.g[C].timestampOffset=B.timestampOffset,a.g[C].appendWindowEnd=B.appendWindowEnd,a.g[C].appendWindowStart=B.appendWindowStart);A=I.next();G.s(6);break;case 2:za(G),a.H=!1,vl(a.L),a.u.Aa(a.j,"canplaythrough",function(){a.L.g||(a.j.autoplay=e,f||a.j.play())}),Ba(G,0)}})}function dn(a,b){return Zm(a,function(){return cn(a,b)})}
|
|
562
|
+
function en(a,b,c,d){var e=!1,f=Od("audio",(d||"").split(",")),g=Od("video",(d||"").split(",")),h=g;"audio"==b&&(h=f);h||(h=d);d=Ud(c,h);var k=a.B.forceTransmux;if(!lb(d)||!a.C&&Vd.includes(d))k=!0;if(k&&(a=Wd(c,h),c=mc(a))){var l=c();f&&g&&(e=!0);d=l.convertCodecs(b,a)}b=ae(je(d));return{De:l,qh:e,Me:ie(d),codec:b,mimeType:d}}
|
|
563
|
+
function Xm(a,b,c,d,e){var f,g,h,k,l,m,n,q,p,u,x,v,z,w;return L(function(E){if(1==E.g){f=Sd;if(b==f.pa)return E.return(!1);g=ae(je(a.A[b]));h=ie(a.A[b]);k=en(a,b,c,d);l=k.De;m=k.qh;n=k.Me;q=k.codec;p=k.mimeType;u=!0;m&&f.S in a.A&&(x=en(a,f.S,c,d),v=ae(je(a.A[f.S])),z=ie(a.A[f.S]),u=v==x.codec&&z==x.Me,x.De&&x.De.destroy());if(g===q&&h===n&&u)return a.i[b]&&!l?(a.i[b].destroy(),delete a.i[b]):!a.i[b]&&l?a.i[b]=l:l&&(a.i[b]&&a.i[b].transmux!=l.transmux?(a.i[b].destroy(),delete a.i[b],a.i[b]=l):l.destroy()),
|
|
564
|
+
E.return(!1);w=!0;if(a.o||m&&l&&!a.i[b])w=!1;if(w&&"smooth"===a.B.codecSwitchingStrategy&&nb())return J(E,bn(a,b,p,l),3);l&&l.destroy();return J(E,dn(a,e),3)}return E.return(!0)})}function fn(a,b,c,d){if(b==Qd)var e=!1;else{e=ae(je(a.A[b]));var f=ie(a.A[b]),g=Ud(c,d),h=a.B.forceTransmux;if(!lb(g)||!a.C&&Vd.includes(g))h=!0;c=Wd(c,d);h&&(h=mc(c))&&(h=h(),g=h.convertCodecs(b,c),h.destroy());b=ae(je(g));g=ie(g);e=e!==b||f!==g}return e?"smooth"!==a.B.codecSwitchingStrategy||!nb()||a.o:!1}
|
|
565
|
+
var Bm=window.URL.createObjectURL,Gm="sequence";function gn(a){var b=this;this.g=a;this.j=!1;this.i=this.g.Pc();this.h=new Tc(function(){b.g.hf(.25*b.i)})}gn.prototype.release=function(){this.set(this.yb());this.h&&(this.h.stop(),this.h=null);this.g=null};gn.prototype.set=function(a){this.i=a;hn(this)};gn.prototype.yb=function(){return this.g.yb()};function hn(a){a.h.stop();var b=a.j?0:a.i;if(0<=b)try{a.g.Pc()!=b&&a.g.we(b);return}catch(c){}a.h.Sa(.25);0!=a.g.Pc()&&a.g.we(0)};function jn(a,b,c,d){b==HTMLMediaElement.HAVE_NOTHING||a.readyState>=b?d():(b=kn.value().get(b),c.Aa(a,b,d))}var kn=new Kc(function(){return new Map([[HTMLMediaElement.HAVE_METADATA,"loadedmetadata"],[HTMLMediaElement.HAVE_CURRENT_DATA,"loadeddata"],[HTMLMediaElement.HAVE_FUTURE_DATA,"canplay"],[HTMLMediaElement.HAVE_ENOUGH_DATA,"canplaythrough"]])});function ln(a,b,c,d){var e=this;this.g=a;this.m=b;this.u=c;this.l=null;this.j=function(){null==e.l&&(e.l=d());return e.l};this.o=!1;this.h=new fb;this.i=new mn(a);jn(this.g,HTMLMediaElement.HAVE_METADATA,this.h,function(){nn(e,e.j())})}ln.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 on(a){return a.o?a.g.currentTime:a.j()}
|
|
566
|
+
function pn(a,b){0<a.g.readyState?qn(a.i,b):jn(a.g,HTMLMediaElement.HAVE_METADATA,a.h,function(){nn(a,a.j())})}function nn(a,b){.001>Math.abs(a.g.currentTime-b)?rn(a):(a.h.Aa(a.g,"seeking",function(){rn(a)}),qn(a.i,a.g.currentTime&&0!=a.g.currentTime?a.g.currentTime:b))}function rn(a){a.o=!0;a.h.G(a.g,"seeking",function(){return a.m()});a.u(a.g.currentTime)}
|
|
567
|
+
function mn(a){var b=this;this.g=a;this.m=10;this.j=this.l=this.i=0;this.h=new Tc(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--)})}mn.prototype.release=function(){this.h&&(this.h.stop(),this.h=null);this.g=null};function qn(a,b){a.l=a.g.currentTime;a.j=b;a.i=a.m;a.g.currentTime=b;a.h.Sa(.1)};function sn(a){this.h=a;this.j=!1;this.g=null;this.i=new fb}r=sn.prototype;r.ready=function(){function a(){if(null==b.g||0==b.g&&Infinity!=b.h.duration)b.j=!0;else{var c=b.h.currentTime,d=b.g;0>b.g&&(d=Math.max(0,c+b.g));c!=d?(b.i.Aa(b.h,"seeking",function(){b.j=!0}),b.h.currentTime=d):b.j=!0}}var b=this;jn(this.h,HTMLMediaElement.HAVE_CURRENT_DATA,this.i,function(){a()})};r.release=function(){this.i&&(this.i.release(),this.i=null);this.h=null};r.pd=function(a){this.g=this.j?this.g:a};
|
|
568
|
+
r.Ac=function(){return(this.j?this.h.currentTime:this.g)||0};r.Ie=function(){return 0};r.He=function(){return 0};r.kf=function(){};
|
|
569
|
+
function tn(a,b,c,d,e,f){var g=this;this.i=a;this.g=b.presentationTimeline;this.B=b.minBufferTime||0;this.l=c;this.A=e;this.u=null;this.o=un(a,c,f);this.j=new qm(a,b.presentationTimeline,c,this.o,f);this.h=new ln(a,function(){a:{var h=g.j;h.l=!0;h.u=!1;rm(h);var k=on(g.h);h=vn(g,k);if(.001<Math.abs(h-k)){k=!1;if(!cd()||cd()&&pd())k=!0;else{var l=Date.now()/1E3,m=cd()&&qd()?3:1;if(!g.u||g.u<l-m)g.u=l,k=!0}if(k){pn(g.h,h);h=void 0;break a}}g.A();h=void 0}return h},function(h){var k=g.j;k.B=!0;k.g.seeking&&
|
|
570
|
+
!k.l&&(k.l=!0,k.i=h);k.j&&k.j.Sa(k.o.gapJumpTimerTime);rm(k)},function(){var h=d;null==h?h=Infinity>g.g.getDuration()?g.g.pb():g.g.Va():0>h&&(h=g.g.Va()+h);return wn(g,xn(g,h))});this.m=new Tc(function(){if(0!=g.i.readyState&&!g.i.paused){var h=on(g.h),k=g.g.pb(),l=g.g.Va();3>l-k&&(k=l-3);h<k&&(h=vn(g,h),g.i.currentTime=h)}})}r=tn.prototype;r.ready=function(){this.m.Sa(.25)};
|
|
571
|
+
r.release=function(){this.h&&(this.h.release(),this.h=null);this.j&&(this.j.release(),this.j=null);this.m&&(this.m.stop(),this.m=null);this.i=this.h=this.g=this.l=null;this.A=function(){}};r.pd=function(a){pn(this.h,a)};r.Ac=function(){var a=on(this.h);return 0<this.i.readyState&&!this.i.paused?xn(this,a):a};r.Ie=function(){return this.o?this.o.o:0};r.He=function(){return this.j.D};r.kf=function(){this.j.ge()};function wn(a,b){var c=a.g.getDuration();return b>=c?c-a.l.durationBackoff:b}
|
|
572
|
+
function vn(a,b){var c=Math.max(a.B,a.l.rebufferingGoal),d=a.l.safeSeekOffset,e=a.g.pb(),f=a.g.Va(),g=a.g.getDuration();3>f-e&&(e=f-3);var h=a.g.nc(c),k=a.g.nc(d);c=a.g.nc(c+d);return b>=g?wn(a,b):b>f?f:b<e?im(a.i.buffered,k)?k:c:b>=h||im(a.i.buffered,b)?b:c}function xn(a,b){var c=a.g.pb();if(b<c)return c;a=a.g.Va();return b>a?a:b}
|
|
573
|
+
function un(a,b,c){if(!b.stallEnabled)return null;var d=b.stallSkip;b=new mm(new pm(a),b.stallThreshold,c);om(b,function(){d?a.currentTime+=d:(a.pause(),a.play())});return b};function yn(a){var b=this;this.h=a;this.g=new Set;this.i=(new Tc(function(){zn(b,!1)})).Sa(.25)}yn.prototype.release=function(){this.i.stop();for(var a=t(this.g),b=a.next();!b.done;b=a.next())b.value.release();this.g.clear()};function zn(a,b){for(var c=t(a.g),d=c.next();!d.done;d=c.next())d.value.j(a.h.currentTime,b)};function An(){this.g=null;this.h=[]}function Bn(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 Cn(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 Dn(){this.i=this.h=null;this.g=[]}function En(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 Fn(){this.vb=this.A=this.B=this.F=this.C=this.u=this.j=this.D=this.m=this.i=this.M=this.O=this.H=this.I=this.L=this.l=this.o=NaN;this.g=new An;this.h=new Dn};function Gn(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 Hn(a,b){a.l=b;a=t(a.h.values());for(var c=a.next();!c.done;c=a.next())c.value.g=b}
|
|
574
|
+
function In(a,b,c){c=void 0===c?!1:c;if(a.i.segmentIndex&&(a.g||(a.g=a.i.segmentIndex.mb(b,!0,a.o)),a.g)){for(c&&a.g.next();a.h.size<a.m;){b=a.g.next().value;if(!b)break;c=!0;b.preload&&null!=b.qa&&(c=!1);2==b.Cb()&&(c=!1);b.Ab()&&(c=!1);c&&b.ea&&Jn(a,b.ea);c&&!a.h.has(b)&&(c=new Kn(a.l),Ln(c,b,a.i),a.h.set(b,c));if(a.i.fastSwitching&&b.Yb&&b.Xc)break}Mn(a)}}
|
|
575
|
+
function Jn(a,b){if(a.i.segmentIndex&&!b.Ab()&&!Array.from(a.j.keys()).some(function(d){return fi(d,b)})){var c=new Kn(a.l);Ln(c,b,a.i);a.j.set(b,c)}}function Nn(a,b){b=t(b.keys());for(var c=b.next();!c.done;c=b.next())(c=c.value)&&On(a,c)}function Pn(a){Nn(a,a.h);Nn(a,a.j);a.g=null}Gn.prototype.gb=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&&On(this,d);b&&Mn(this)};Gn.prototype.bc=function(a){this.o=a;this.g&&this.g.bc(a)};
|
|
576
|
+
function Mn(a){for(var b=Array.from(a.h.keys()),c=t(a.j.keys()),d=c.next(),e={};!d.done;e={Ud:void 0},d=c.next())e.Ud=d.value,b.some(function(f){return function(g){return fi(g.ea,f.Ud)}}(e))||On(a,e.Ud)}function Qn(a,b){a.m=b;for(var c=Array.from(a.h.keys());c.length>b;){var d=c.pop();d&&On(a,d)}Mn(a)}function Rn(a,b){b&&b!==a.i&&(Pn(a),a.i=b)}function On(a,b){var c=a.h;b instanceof ei&&(c=a.j);a=c.get(b);c.delete(b);a&&a.abort()}function Kn(a){this.g=a;this.ed=this.ye=null}
|
|
577
|
+
function Ln(a,b,c){var d=new Uint8Array(0);a.ed=a.g(b,c,function(e){return L(function(f){if(1==f.g)return 0<d.byteLength?d=Jd(d,e):d=e,a.ye?J(f,a.ye(d),3):f.s(0);d=new Uint8Array(0);K(f)})})}Kn.prototype.abort=function(){this.ed&&this.ed.abort()};function Sn(a){Ai.call(this);var b=this;this.g=new Set;this.i=a;this.h=(new Tc(function(){for(var c=b.i(),d=t(b.g),e=d.next();!e.done;e=d.next())e=e.value,e.endTime<c.start&&(b.g.delete(e),e=new zi("regionremove",new Map([["region",e]])),b.dispatchEvent(e))})).Sa(2)}sa(Sn,Ai);Sn.prototype.release=function(){this.g.clear();this.h.stop();Ai.prototype.release.call(this)};function Tn(a){Ai.call(this);this.g=new Map;this.h=a}sa(Tn,Ai);Tn.prototype.release=function(){this.g.clear();Ai.prototype.release.call(this)};function Un(a,b){var c=a.g.get(b);c||(c={wc:[],Pe:null,contentType:b},a.g.set(b,c));return c}function Vn(a,b,c){var d=Un(a,b.contentType);Wn(a,d);a={be:b,position:c};d=d.wc;b=d.findIndex(function(e){return e.position>=c});0<=b?d.splice(b,d[b].position==c?1:0,a):d.push(a)}
|
|
578
|
+
Tn.prototype.j=function(a){for(var b=t(this.g.values()),c=b.next();!c.done;c=b.next()){c=c.value;a:{var d=c.wc;for(var e=d.length-1;0<=e;e--){var f=d[e];if(f.position<=a){d=f.be;break a}}d=null}if(e=d)e=c.Pe,e=!(e===d||e&&d&&e.bandwidth==d.bandwidth&&e.audioSamplingRate==d.audioSamplingRate&&e.codecs==d.codecs&&e.contentType==d.contentType&&e.frameRate==d.frameRate&&e.height==d.height&&e.mimeType==d.mimeType&&e.channelsCount==d.channelsCount&&e.pixelAspectRatio==d.pixelAspectRatio&&e.width==d.width);
|
|
579
|
+
if(e)a:{e=a;f=d.contentType;if((f=this.h()[f])&&0<f.length){var g=f[f.length-1].end;if(e>=f[0].start&&e<g){e=!0;break a}}e=!1}e&&(c.Pe=d,JSON.stringify(d),c=new zi("qualitychange",new Map([["quality",d],["position",a]])),this.dispatchEvent(c))}};function Wn(a,b){if((a=a.h()[b.contentType])&&0<a.length){var c=a[0].start,d=a[a.length-1].end,e=b.wc;b.wc=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.wc=[]};function Xn(a,b){var c=this;this.g=b;this.l=a;this.h=null;this.F=new Map;this.B=1;this.u=this.j=null;this.L=0;this.H=!1;this.i=new Map;this.D=!1;this.M=null;this.A=!1;this.m=new ul(function(){return Yn(c)});this.O=Date.now()/1E3;this.o=new Map;this.I={projection:null,hfov:null};this.W=0;this.T=Infinity;this.C=null}r=Xn.prototype;r.destroy=function(){return this.m.destroy()};
|
|
580
|
+
function Yn(a){var b,c,d,e,f,g,h;return L(function(k){if(1==k.g){b=[];c=t(a.i.values());for(d=c.next();!d.done;d=c.next())e=d.value,Zn(e),b.push($n(e)),e.R&&(Pn(e.R),e.R=null);f=t(a.o.values());for(g=f.next();!g.done;g=f.next())h=g.value,Pn(h);return J(k,Promise.all(b),2)}a.i.clear();a.o.clear();a.g=null;a.l=null;a.h=null;K(k)})}
|
|
581
|
+
r.configure=function(a){this.h=a;this.M=new pi({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.R&&(Pn(b.R),b.R=null);b=t(this.o.keys());for(var c=b.next();!c.done;c=b.next())c=c.value,Pn(this.o.get(c)),this.o.delete(c)}a.disableTextPrefetch&&(b=this.i.get(Qd))&&
|
|
582
|
+
b.R&&(Pn(b.R),b.R=null);a.disableVideoPrefetch&&(b=this.i.get("video"))&&b.R&&(Pn(b.R),b.R=null);b=t(this.i.keys());for(c=b.next();!c.done;c=b.next())c=this.i.get(c.value),c.R?(Qn(c.R,a.segmentPrefetchLimit),0<a.segmentPrefetchLimit||(Pn(c.R),c.R=null)):0<a.segmentPrefetchLimit&&(c.R=ao(this,c.stream));a.disableAudioPrefetch||bo(this)};function co(a,b,c){a.l.presentationTimeline.X()||(a.W=b,a.T=c)}
|
|
583
|
+
r.start=function(a){var b=this;return L(function(c){if(1==c.g)return J(c,eo(b,a||new Map),2);vl(b.m);b.D=!0;K(c)})};function fo(a,b){var c,d,e,f,g,h,k;L(function(l){switch(l.g){case 1:return c=Sd,a.L++,d=a.L,wa(l,2),J(l,Vm(a.g.U,c.pa),4);case 4:xa(l,3);break;case 2:if(e=ya(l),a.g)a.g.onError(e);case 3:f=Ud(b.mimeType,b.codecs),Fm(a.g.U,f,a.l.sequenceMode,b.external),g=a.g.U.D,(h=g.isTextVisible()||a.h.alwaysStreamText)&&a.L==d&&(k=go(a,b),a.i.set(c.pa,k),ho(a,k,0)),K(l)}})}
|
|
584
|
+
function io(a){var b=a.i.get(Qd);b&&(Zn(b),$n(b).catch(function(){}),a.C=a.i.get(Qd),a.i.delete(Qd));a.u=null}function jo(a,b){for(var c=0>a.g.Ka(),d=t(a.i.values()),e=d.next();!e.done;e=d.next())e=e.value,e.Y&&e.Y.bc(c),e.R&&e.R.bc(c);d=t(a.o.values());for(e=d.next();!e.done;e=d.next())e.value.bc(c);if(c=a.i.get("video"))if(d=c.stream)if(b)(b=d.trickModeVideo)&&!c.qb&&(ko(a,b,!1,0,!1),c.qb=d);else if(b=c.qb)c.qb=null,ko(a,b,!0,0,!1)}
|
|
585
|
+
function lo(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.j=b;a.D&&(b.video&&ko(a,b.video,c,d,e,f),b.audio&&ko(a,b.audio,c,d,e,f))}function mo(a,b){L(function(c){if(1==c.g)return a.C=null,a.u=b,a.D?b.segmentIndex?c.s(2):J(c,b.createSegmentIndex(),2):c.return();ko(a,b,!0,0,!1);K(c)})}function no(a,b){for(var c=t(a.F.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.F.delete(d))}}
|
|
586
|
+
function ko(a,b,c,d,e,f){var g=a.i.get(b.type);g||b.type!=Qd?g&&(g.qb&&(b.trickModeVideo?(g.qb=b,b=b.trickModeVideo):g.qb=null),g.stream!=b||e)&&(a.o.has(b)?g.R=a.o.get(b):g.R&&Rn(g.R,b),b.type==Qd&&(e=Ud(b.mimeType,b.codecs),Fm(a.g.U,e,a.l.sequenceMode,b.external)),!a.o.has(g.stream)&&g.stream.closeSegmentIndex&&(g.Ba?(e="("+g.type+":"+g.stream.id+")",a.F.has(e)||a.F.set(e,g.stream.closeSegmentIndex)):g.stream.closeSegmentIndex()),g.stream=b,g.Y=null,g.Je=!!f,c?g.dc?g.od=!0:g.Ba?(g.ub=!0,g.Hc=d,
|
|
587
|
+
g.od=!0):(Zn(g),oo(a,g,!0,d).catch(function(h){if(a.g)a.g.onError(h)})):g.Ba||g.ab||ho(a,g,0),po(a,g).catch(function(h){if(a.g)a.g.onError(h)})):fo(a,b)}
|
|
588
|
+
function po(a,b){var c,d;return L(function(e){if(1==e.g){if(!b.Ra)return e.return();c=b.stream;d=b.Ra;return c.segmentIndex?e.s(2):J(e,c.createSegmentIndex(),2)}if(b.Ra!=d||b.stream!=c)return e.return();var f=a.g.mc();var g=Km(a.g.U,b.type),h=b.stream.segmentIndex.find(b.ta?b.ta.endTime:f),k=null==h?null:b.stream.segmentIndex.get(h);h=k?k.qa?k.qa-k.Pa:null:null;k&&!h&&(h=(k.endTime-k.getStartTime())*(b.stream.bandwidth||0)/8);h?((k=k.ea)&&(h+=(k.qa?k.qa-k.Pa:null)||0),k=a.g.getBandwidthEstimate(),
|
|
589
|
+
f=8*h/k<(g||0)-f-Math.max(a.l.minBufferTime||0,a.h.rebufferingGoal)||b.Ra.h.g>h?!0:!1):f=!1;f&&b.Ra.abort();K(e)})}
|
|
590
|
+
r.ac=function(){if(this.g)for(var a=this.g.mc(),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.U;d==Qd?(e=e.h,e=null==e.g||null==e.h?!1:a>=e.g&&a<e.h):(e=Jm(e,d),e=im(e,a));if(!e){c.R&&(c.R.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.Y=null;(null!=Km(this.g.U,d)||c.Ba)&&qo(this,c);c.Ra&&(c.Ra.abort(),c.Ra=null);d===Qd&&(d=this.g.U,d.I&&d.I.g());c.ac=!0}}};
|
|
591
|
+
function qo(a,b){b.dc||b.ub||(b.Ba?(b.ub=!0,b.Hc=0):null==Im(a.g.U,b.type)?null==b.ab&&ho(a,b,0):(Zn(b),oo(a,b,!1,0).catch(function(c){if(a.g)a.g.onError(c)})))}
|
|
592
|
+
function eo(a,b){var c,d,e,f,g,h,k,l,m,n;return L(function(q){if(1==q.g){c=Sd;if(!a.j)throw new S(2,5,5006);d=new Map;e=new Set;a.j.audio&&(d.set(c.S,a.j.audio),e.add(a.j.audio));a.j.video&&(d.set(c.da,a.j.video),e.add(a.j.video));a.u&&(d.set(c.pa,a.u),e.add(a.u));f=a.g.U;return J(q,f.init(d,a.l.sequenceMode,a.l.type,a.l.ignoreManifestTimestampsInSegmentsMode),2)}vl(a.m);a.updateDuration();g=t(d.keys());for(h=g.next();!h.done;h=g.next())k=h.value,l=d.get(k),a.i.has(k)||(m=go(a,l),b.has(l.id)&&(n=
|
|
593
|
+
b.get(l.id),Hn(n,function(p,u,x){return ro(p,u,x||null,a.h.retryParameters,a.g.Gb)}),m.R=n),a.i.set(k,m),ho(a,m,0));K(q)})}function go(a,b){return{stream:b,type:b.type,Y:null,R:ao(a,b),ta:null,Wb:null,Zd:null,Xd:null,Wd:null,qb:null,endOfStream:!1,Ba:!1,ab:null,ub:!1,Hc:0,od:!1,dc:!1,ac:!0,ne:!1,rc:!1,Ra:null}}
|
|
594
|
+
function ao(a,b){if("video"===b.type&&a.h.disableVideoPrefetch||"audio"===b.type&&a.h.disableAudioPrefetch||b.type===Qd&&("application/cea-608"==b.mimeType||"application/cea-708"==b.mimeType)||b.type===Qd&&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.R)&&b===c.i?c:0<a.h.segmentPrefetchLimit?new Gn(a.h.segmentPrefetchLimit,b,function(d,e,f){return ro(d,e,f||null,a.h.retryParameters,a.g.Gb)},0>a.g.Ka()):null}
|
|
595
|
+
function bo(a){for(var b=a.h.segmentPrefetchLimit,c=a.h.prefetchAudioLanguages,d=t(a.l.variants),e=d.next(),f={};!e.done;f={Ta:void 0},e=d.next())if(f.Ta=e.value,f.Ta.audio)if(a.o.has(f.Ta.audio)){if(e=a.o.get(f.Ta.audio),Qn(e,b),!(0<b&&c.some(function(h){return function(k){return ye(h.Ta.audio.language,k)}}(f)))){var g=a.i.get(f.Ta.audio.type);e!==(g&&g.R)&&Pn(e);a.o.delete(f.Ta.audio)}}else 0>=b||!c.some(function(h){return function(k){return ye(h.Ta.audio.language,k)}}(f))||!(e=ao(a,f.Ta.audio))||
|
|
596
|
+
(f.Ta.audio.segmentIndex||f.Ta.audio.createSegmentIndex(),a.o.set(f.Ta.audio,e))}r.updateDuration=function(){var a=this.l.presentationTimeline.getDuration();Infinity>a?this.g.U.rb(a):this.g.U.rb(this.h.infiniteLiveStreamDuration?Infinity:Math.pow(2,32))};
|
|
597
|
+
function so(a,b){var c,d,e,f,g;return L(function(h){switch(h.g){case 1:vl(a.m);if(b.Ba||null==b.ab||b.dc)return h.return();b.ab=null;if(!b.ub){h.s(2);break}return J(h,oo(a,b,b.od,b.Hc),3);case 3:return h.return();case 2:no(a,b);if(b.stream.segmentIndex){h.s(4);break}c=b.stream;return J(h,b.stream.createSegmentIndex(),5);case 5:if(c!=b.stream)return c.closeSegmentIndex&&c.closeSegmentIndex(),b.Ba||b.ab||ho(a,b,0),h.return();case 4:wa(h,6);d=to(a,b);null!=d&&(ho(a,b,d),b.rc=!1);xa(h,7);break;case 6:return e=
|
|
598
|
+
ya(h),J(h,uo(a,b,e),8);case 8:return h.return();case 7:f=Array.from(a.i.values());if(!a.D||!f.every(function(k){return k.endOfStream})){h.s(0);break}return J(h,a.g.U.endOfStream(),10);case 10:vl(a.m),g=a.g.U.getDuration(),0!=g&&g<a.l.presentationTimeline.getDuration()&&a.l.presentationTimeline.rb(g),K(h)}})}
|
|
599
|
+
function to(a,b){if(vo(b))return Sm(a.g.U,b.stream.originalId||""),null;b.type==Qd&&Tm(a.g.U);var c=a.h.updateIntervalSeconds/Math.max(1,Math.abs(a.g.Ka()));if(!a.g.U.ha&&b.type!=Qd)return c/2;var d=a.g.mc();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.gb(d,!0),In(f,d);e=b.ta?b.ta.endTime:d;var g=Lm(a.g.U,b.type,d),h=Math.max(1,Math.max(a.l.minBufferTime||0,a.h.rebufferingGoal,a.h.bufferingGoal)*a.B),k=a.l.presentationTimeline.getDuration()-e;f=Km(a.g.U,
|
|
600
|
+
b.type);if(1E-6>k&&f)return b.endOfStream=!0,"video"==b.type&&(a=a.i.get(Qd))&&vo(a)&&(a.endOfStream=!0),null;b.endOfStream=!1;if(g>=h)return c/2;h=!b.Y;f=wo(a,b,d,f);if(!f)return c;g=!1;h&&b.Je&&(g=!0,b.Je=!1);h=Infinity;k=Array.from(a.i.values());k=t(k);for(var l=k.next();!l.done;l=k.next())l=l.value,vo(l)||l.Y&&!l.Y.current()||(h=Math.min(h,l.ta?l.ta.endTime:d));if(e>=h+a.l.presentationTimeline.g)return c;b.R&&b.Y&&!a.o.has(b.stream)&&(b.R.gb(f.startTime),In(b.R,f.startTime));xo(a,b,d,f,g).catch(function(){});
|
|
601
|
+
return null}
|
|
602
|
+
function wo(a,b,c,d){if(b.Y)return(c=b.Y.current())&&b.ta&&.001>Math.abs(b.ta.startTime-c.startTime)&&(c=b.Y.next().value),c;if(b.ta||d)return c=b.ta?b.ta.endTime:d,a=0>a.g.Ka(),b.stream.segmentIndex&&(b.Y=b.stream.segmentIndex.mb(c,!1,a)),b.Y&&b.Y.next().value;d=a.l.sequenceMode?0:a.h.inaccurateManifestTolerance;var e=Math.max(c-d,0);a=0>a.g.Ka();var f=null;d&&(b.stream.segmentIndex&&(b.Y=b.stream.segmentIndex.mb(e,!1,a)),f=b.Y&&b.Y.next().value);f||(b.stream.segmentIndex&&(b.Y=b.stream.segmentIndex.mb(c,!1,
|
|
603
|
+
a)),f=b.Y&&b.Y.next().value);return f}
|
|
604
|
+
function xo(a,b,c,d,e){var f,g,h,k,l,m,n,q,p,u,x,v,z,w,E,F;return L(function(D){switch(D.g){case 1:f=Sd;g=b.stream;h=b.Y;b.Ba=!0;wa(D,2);if(2==d.Cb())throw new S(1,1,1011);return J(D,yo(a,b,d,e),4);case 4:vl(a.m);if(a.A)return D.return();k="video/mp4"==g.mimeType||"audio/mp4"==g.mimeType;l=window.ReadableStream;if(a.h.lowLatencyMode&&l&&k&&("HLS"!=a.l.type||d.m))return q=new Uint8Array(0),u=p=!1,v=function(I){var A,C,B,H;return L(function(G){switch(G.g){case 1:if(p)return G.return();u=!0;vl(a.m);
|
|
605
|
+
if(a.A)return G.return();wa(G,2);q=zo(q,I);A=!1;C=0;(new xg).box("mdat",function(N){C=N.size+N.start;A=!0}).parse(q,!1,!0);if(!A){G.s(4);break}B=q.subarray(0,C);q=q.subarray(C);return J(G,Ao(a,b,c,g,d,B,!0,e),5);case 5:b.R&&b.Y&&In(b.R,d.startTime,!0);case 4:xa(G,0);break;case 2:x=H=ya(G),K(G)}})},J(D,Bo(a,b,d,v),9);m=Bo(a,b,d);return J(D,m,7);case 7:n=D.h;vl(a.m);if(a.A)return D.return();vl(a.m);return b.ub?(b.Ba=!1,ho(a,b,0),D.return()):J(D,Ao(a,b,c,g,d,n,!1,e),6);case 9:z=D.h;if(x)throw x;if(u){D.s(10);
|
|
606
|
+
break}p=!0;vl(a.m);return a.A?D.return():b.ub?(b.Ba=!1,ho(a,b,0),D.return()):J(D,Ao(a,b,c,g,d,z,!1,e),10);case 10:b.R&&b.Y&&In(b.R,d.startTime,!0);case 6:vl(a.m);if(a.A)return D.return();b.ta=d;h.next();b.Ba=!1;b.ne=!1;w=a.g.U.hb();E=w[b.type];bb(JSON.stringify(E));b.ub||a.g.ge(d,b.stream);ho(a,b,0);xa(D,0);break;case 2:F=ya(D);vl(a.m,F);if(a.A)return D.return();b.Ba=!1;if(7001==F.code)b.Ba=!1,Zn(b),ho(a,b,0),D.s(0);else if(b.type==f.pa&&a.h.ignoreTextStreamFailures)a.i.delete(f.pa),D.s(0);else{if(3017==
|
|
607
|
+
F.code)return J(D,Co(a,b,F),0);b.rc=!0;1==F.category&&b.R&&On(b.R,d);F.severity=2;return J(D,uo(a,b,F),0)}}})}function Do(a,b,c){var d,e,f,g,h;return L(function(k){if(1==k.g)return d=b,d.cryptoKey?k.s(2):J(k,d.fetchKey(),3);e=d.iv;if(!e)for(e=yb(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))})}
|
|
608
|
+
function zo(a,b){var c=new Uint8Array(a.length+b.length);c.set(a);c.set(b,a.length);return c}
|
|
609
|
+
function Co(a,b,c){var d,e,f,g,h,k;return L(function(l){if(1==l.g){d=Array.from(a.i.values());if(e=d.some(function(m){return m!=b&&m.ne}))return l.s(2);f=0===a.h.maxDisabledTime&&1011==c.code?1:a.h.maxDisabledTime;if(g=a.g.Jc(b.stream,f))return l.return();h=Math.round(100*a.B);if(20<h)a.B-=.2;else if(4<h)a.B-=.04;else return b.rc=!0,a.A=!0,a.g.onError(c),l.return();b.ne=!0;k=a.g.mc();return J(l,Eo(a,b,k),2)}ho(a,b,4);K(l)})}
|
|
610
|
+
function yo(a,b,c,d){var e,f,g,h,k,l,m,n,q,p,u,x,v,z,w,E,F;return L(function(D){switch(D.g){case 1:e=Sd;f=null==b.ta;g=[];h=Math.max(0,Math.max(c.appendWindowStart,a.W)-.1);k=Math.min(c.appendWindowEnd,a.T)+.01;l=c.codecs||b.stream.codecs;m=ce(l);n=ie(c.mimeType||b.stream.mimeType);q=c.timestampOffset;if(q==b.Zd&&h==b.Xd&&k==b.Wd&&m==b.Yd&&n==b.bf){D.s(2);break}p=b.Yd&&b.bf&&fn(a.g.U,b.type,n,l);if(!p){D.s(3);break}u=null;b.type===e.da?u=a.i.get(e.S):b.type===e.S&&(u=a.i.get(e.da));if(!u){D.s(3);
|
|
611
|
+
break}return J(D,$n(u).catch(function(){}),5);case 5:u.Wb=null,qo(a,u);case 3:return x=function(){var I,A,C;return L(function(B){if(1==B.g)return I=new Map,a.j.audio&&I.set(e.S,a.j.audio),a.j.video&&I.set(e.da,a.j.video),wa(B,2),b.Xd=h,b.Wd=k,b.Yd=m,b.bf=n,b.Zd=q,A=a.l.sequenceMode||"HLS"==a.l.type,J(B,Wm(a.g.U,b.type,q,h,k,A,c.mimeType||b.stream.mimeType,c.codecs||b.stream.codecs,I),4);if(2!=B.g)return xa(B,0);C=ya(B);b.Xd=null;b.Wd=null;b.Yd=null;b.Zd=null;throw C;})},J(D,x(),2);case 2:return fi(c.ea,
|
|
612
|
+
b.Wb)||(b.Wb=c.ea,c.j&&c.ea&&(v=Bo(a,b,c.ea),z=function(){var I,A,C,B,H,G,N;return L(function(Q){switch(Q.g){case 1:return wa(Q,2),J(Q,v,4);case 4:return I=Q.h,vl(a.m),A=null,C=new Map,B={projection:null,hfov:null},H=new xg,H.box("moov",Cg).box("trak",Cg).box("mdia",Cg).K("mdhd",function(M){A=Kg(M.reader,M.version).timescale}).box("hdlr",function(M){M=M.reader;M.skip(8);switch(M.Hb()){case "soun":C.set(e.S,A);break;case "vide":C.set(e.da,A)}A=null}).box("minf",Cg).box("stbl",Cg).K("stsd",Eg).box("encv",
|
|
613
|
+
Fg).box("avc1",Fg).box("avc3",Fg).box("hev1",Fg).box("hvc1",Fg).box("dvav",Fg).box("dva1",Fg).box("dvh1",Fg).box("dvhe",Fg).box("vexu",Cg).box("proj",Cg).K("prji",function(M){M=M.reader.Hb();B.projection=M}).box("hfov",function(M){M=M.reader.N()/1E3;B.hfov=M}).parse(I),Fo(a,B),C.has(b.type)?c.ea.timescale=C.get(b.type):null!=A&&(c.ea.timescale=A),G=b.stream.closedCaptions&&0<b.stream.closedCaptions.size,J(Q,a.g.Ne(b.type,I),5);case 5:return J(Q,Nm(a.g.U,b.type,I,null,b.stream,G,b.ac,d),6);case 6:xa(Q,
|
|
614
|
+
0);break;case 2:throw N=ya(Q),b.Wb=null,N;}})},w=c.startTime,f&&(E=Km(a.g.U,b.type),null!=E&&(w=E)),a.g.Ug(w,c.ea),g.push(z()))),F=b.ta?b.ta.i:null,c.i!=F&&g.push(Ym(a.g.U,b.type,c.startTime)),J(D,Promise.all(g),0)}})}
|
|
615
|
+
function Ao(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;return L(function(p){switch(p.g){case 1:k=d.closedCaptions&&0<d.closedCaptions.size;m=null!=d.emsgSchemeIdUris&&0<d.emsgSchemeIdUris.length||a.h.dispatchAllEmsgBoxes;n=a.h.parsePrftBox&&!a.H;if(m||n)l=new xg;m&&l.K("emsg",function(u){var x=d.emsgSchemeIdUris;if(0===u.version){var v=u.reader.Hb();var z=u.reader.Hb();var w=u.reader.N();var E=u.reader.N();var F=u.reader.N();var D=u.reader.N();var I=e.startTime+E/w}else w=
|
|
616
|
+
u.reader.N(),I=u.reader.hd()/w+e.timestampOffset,E=I-e.startTime,F=u.reader.N(),D=u.reader.N(),v=u.reader.Hb(),z=u.reader.Hb();u=u.reader.Ya(u.reader.getLength()-u.reader.Ea());if(x&&x.includes(v)||a.h.dispatchAllEmsgBoxes)"urn:mpeg:dash:event:2012"==v?a.g.Vg():(x=I+F/w,w=(new Map).set("detail",{startTime:I,endTime:x,schemeIdUri:v,value:z,timescale:w,presentationTimeDelta:E,eventDuration:F,id:D,messageData:u}),w=new zi("emsg",w),w.cancelable=!0,a.g.onEvent(w),w.defaultPrevented||"https://aomedia.org/emsg/ID3"!=
|
|
617
|
+
v&&"https://developer.apple.com/streaming/emsg-id3"!=v||(v=uh(u),v.length&&a.g.dd([{cueTime:I,data:u,frames:v,dts:I,pts:I}],0,x)))});n&&l.K("prft",function(u){if(!a.H&&e.ea.timescale){var x=u.reader,v=u.version;x.N();u=x.N();var z=x.N();u=1E3*u+z/Math.pow(2,32)*1E3;0===v?x=x.N():(v=x.N(),x=x.N(),x=v*Math.pow(2,32)+x);u=(new Date((new Date(Date.UTC(1900,0,1,0,0,0))).getTime()+u)).getTime();x=(new Map).set("detail",{wallClockTime:u,programStartDate:new Date(u-x/e.ea.timescale*1E3)});x=new zi("prft",
|
|
618
|
+
x);a.g.onEvent(x);a.H=!0}});(m||n)&&l.parse(f);return J(p,Eo(a,b,c),2);case 2:return vl(a.m),q=b.ac,b.ac=!1,J(p,a.g.Ne(b.type,f),3);case 3:return J(p,Nm(a.g.U,b.type,f,e,d,k,q,h,g),4);case 4:vl(a.m),K(p)}})}
|
|
619
|
+
function Eo(a,b,c){var d,e,f,g,h,k,l,m;return L(function(n){if(1==n.g){d=b.stream.segmentIndex;d instanceof oi&&d.gb(a.l.presentationTimeline.Rc());e=Math.max(a.h.bufferBehind*a.B,a.l.presentationTimeline.g);f=Im(a.g.U,b.type);if(null==f)return a.C==b&&(a.C=null),n.return();g=c-f;h=a.h.evictionGoal;k=a.l.presentationTimeline.pb();l=a.l.presentationTimeline.Va();m=g-e;l-k>h&&(m=Math.max(g-e,k-h-f));return m<=h?n.return():J(n,a.g.U.remove(b.type,f,f+m),2)}if(4!=n.g)return vl(a.m),a.C?J(n,Eo(a,a.C,c),
|
|
620
|
+
4):n.s(0);vl(a.m);K(n)})}function vo(a){return a&&a.type==Qd&&("application/cea-608"==a.stream.mimeType||"application/cea-708"==a.stream.mimeType)}
|
|
621
|
+
function Bo(a,b,c,d){var e,f,g,h,k;return L(function(l){switch(l.g){case 1:if(e=c.Ab())return l.return(e);f=null;if(b.R){var m=b.R,n=m.h;c instanceof ei&&(n=m.j);n.has(c)?(m=n.get(c),d&&(m.ye=d),f=m.ed):f=null}f||(f=ro(c,b.stream,d||null,a.h.retryParameters,a.g.Gb));g=0;b.Y&&(g=b.Y.h);b.Ra=f;return J(l,f.promise,2);case 2:h=l.h;b.Ra=null;k=h.data;if(!c.aesKey){l.s(3);break}return J(l,Do(k,c.aesKey,g),4);case 4:k=l.h;case 3:return l.return(k)}})}
|
|
622
|
+
function ro(a,b,c,d,e){var f=a instanceof gi?a:void 0,g=f?1:0;a=Zi(a.J(),a.Pa,a.qa,d,c);a.contentType=b.type;return e.request(Oi,a,{type:g,stream:b,segment:f})}
|
|
623
|
+
function oo(a,b,c,d){var e,f;return L(function(g){if(1==g.g)return b.ub=!1,b.od=!1,b.Hc=0,b.dc=!0,b.ta=null,b.Y=null,b.R&&!a.o.has(b.stream)&&Pn(b.R),d?(e=a.g.mc(),f=a.g.U.getDuration(),J(g,a.g.U.remove(b.type,e+d,f),3)):J(g,Vm(a.g.U,b.type),4);if(3!=g.g)return vl(a.m),c?J(g,a.g.U.flush(b.type),3):g.s(3);vl(a.m);b.dc=!1;b.endOfStream=!1;b.Ba||b.ab||ho(a,b,0);K(g)})}
|
|
624
|
+
function ho(a,b,c){var d=b.type;if(d!=Qd||a.i.has(d))b.ab=(new Sc(function(){var e;return L(function(f){if(1==f.g)return wa(f,2),J(f,so(a,b),4);if(2!=f.g)return xa(f,0);e=ya(f);if(a.g)a.g.onError(e);K(f)})})).Z(c)}function Zn(a){null!=a.ab&&(a.ab.stop(),a.ab=null)}function $n(a){return L(function(b){return a.Ra?J(b,a.Ra.abort(),0):b.s(0)})}
|
|
625
|
+
function uo(a,b,c){var d;return L(function(e){if(1==e.g)return J(e,ri(a.M),2);vl(a.m);if(1===c.category&&1003!=c.code){if(b.qb)return jo(a,!1),e.return();d=0===a.h.maxDisabledTime&&1011==c.code?1:a.h.maxDisabledTime;c.handled=a.g.Jc(b.stream,d);c.handled&&(c.severity=1)}if(!c.handled||1011!=c.code)a.g.onError(c);c.handled||a.h.failureCallback(c);K(e)})}
|
|
626
|
+
function Go(a){var b,c,d,e,f,g;return L(function(h){if(1==h.g){b=Date.now()/1E3;c=a.h.minTimeBetweenRecoveries;if(!a.h.allowMediaSourceRecoveries||b-a.O<c)return h.return(!1);a.O=b;d=Sd;if(e=a.i.get(d.S))e.Wb=null,qo(a,e),$n(e).catch(function(){}),e.Y&&e.Y.oe();if(f=a.i.get(d.da))f.Wb=null,qo(a,f),$n(f).catch(function(){}),f.Y&&f.Y.oe();g=new Map;a.j.audio&&g.set(d.S,a.j.audio);a.j.video&&g.set(d.da,a.j.video);return J(h,dn(a.g.U,g),2)}return h.return(!0)})}
|
|
627
|
+
function Fo(a,b){if(a.I.projection!=b.projection||a.I.hfov!=b.hfov){if(null!=b.projection||null!=b.hfov){var c=(new Map).set("detail",b);c=new zi("spatialvideoinfo",c)}else c=new zi("nospatialvideoinfo");c.cancelable=!0;a.g.onEvent(c);a.I=b}};function Ho(){}
|
|
628
|
+
function Io(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]=He(n):g?a[l]=b[l]:n.constructor==Object&&b[l]&&b[l].constructor==Object?(a[l]||(a[l]=He(n)),m=Io(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?(Ya("Invalid config, wrong type for "+m),
|
|
629
|
+
k=!1):("function"==typeof c[l]&&c[l].length!=b[l].length&&Za("Unexpected number of arguments for "+m),a[l]=b[l]):(Ya("Invalid config, unrecognized key "+m),k=!1)}return k}function Jo(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 Ko(a,b){return a&&b}
|
|
630
|
+
function Lo(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])||
|
|
631
|
+
(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])?Mb(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}O("shaka.util.ConfigUtils",Ho);Ho.getDifferenceFromConfigObjects=Lo;Ho.convertToConfigObject=Jo;Ho.mergeConfigObjects=Io;function Mo(){}function No(a){a=yd(a);return(new sc(a)).lb}function Oo(a,b,c){function d(h){Cb(f).setUint32(g,h.byteLength,!0);g+=4;f.set(yb(h),g);g+=h.byteLength}if(!c||!c.byteLength)throw new S(2,6,6015);var e;"string"==typeof b?e=Ad(b,!0):e=b;a=yd(a);a=Ad(a,!0);var f=new Uint8Array(12+a.byteLength+e.byteLength+c.byteLength),g=0;d(a);d(e);d(c);return f}function Po(a,b,c){if("skd"!==b)return a;b=c.serverCertificate;c=yd(a).split("skd://").pop();return Oo(a,c,b)}
|
|
632
|
+
function Qo(a,b){2===a&&(b.headers["Content-Type"]="application/octet-stream")}O("shaka.util.FairPlayUtils",Mo);Mo.commonFairPlayResponse=function(a,b){if(2===a){try{var c=vd(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);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=zb(Gd(c)))}};Mo.expressplayFairPlayRequest=function(a,b){Qo(a,b)};
|
|
633
|
+
Mo.conaxFairPlayRequest=function(a,b){Qo(a,b)};Mo.ezdrmFairPlayRequest=function(a,b){Qo(a,b)};Mo.verimatrixFairPlayRequest=function(a,b){2===a&&(a=yb(b.body),a=Fd(a),b.headers["Content-Type"]="application/x-www-form-urlencoded",b.body=zd("spc="+a))};Mo.expressplayInitDataTransform=function(a,b,c){return Po(a,b,c)};
|
|
634
|
+
Mo.conaxInitDataTransform=function(a,b,c){if("skd"!==b)return a;b=c.serverCertificate;c=yd(a).split("skd://").pop().split("?").shift();c=window.atob(c);var d=new ArrayBuffer(2*c.length);d=Bb(d);for(var e=0,f=c.length;e<f;e++)d[e]=c.charCodeAt(e);return Oo(a,d,b)};Mo.ezdrmInitDataTransform=function(a,b,c){if("skd"!==b)return a;b=c.serverCertificate;c=yd(a).split(";").pop();return Oo(a,c,b)};Mo.verimatrixInitDataTransform=function(a,b,c){return Po(a,b,c)};Mo.initDataTransform=Oo;
|
|
635
|
+
Mo.defaultGetContentId=No;Mo.isFairPlaySupported=function(){var a;return L(function(b){if(1==b.g)return a={initDataTypes:["cenc","sinf","skd"],videoCapabilities:[{contentType:'video/mp4; codecs="avc1.42E01E"'}]},wa(b,2),J(b,navigator.requestMediaKeySystemAccess("com.apple.fps",[a]),4);if(2!=b.g)return b.return(!0);ya(b);return b.return(!1)})};function Ro(){}
|
|
636
|
+
function So(){var a=Infinity;navigator.connection&&navigator.connection.saveData&&(a=360);var b={retryParameters:qi(),servers:{},clearKeys:{},advanced:{},delayLicenseRequestUntilPlayed:!1,persistentSessionOnlinePlayback:!1,persistentSessionsMetadata:[],initDataTransform:function(m,n,q){"apple"===window.shakaMediaKeysPolyfill&&"skd"==n&&(n=q.serverCertificate,q=No(m),m=Oo(m,q,n));return m},logLicenseExchange:!1,updateExpirationTime:1,preferredKeySystems:[],keySystemsMapping:{},parseInbandPsshEnabled:Yc(),minHdcpVersion:"",
|
|
637
|
+
ignoreDuplicateInitData:!Zc("Tizen 2")};(Yc()||gd())&&b.preferredKeySystems.push("com.microsoft.playready");var c="reload",d=!1;!nb()||$c()||gd()||id()||bd()&&79===dd()||!(!cd()||cd()&&pd()||cd()&&qd())||od()&&Xc()||(c="smooth",d=!0);d={retryParameters:qi(),availabilityWindowOverride:NaN,disableAudio:!1,disableVideo:!1,disableText:!1,disableThumbnails:!1,defaultPresentationDelay:0,segmentRelativeVttTiming:!1,raiseFatalErrorOnManifestUpdateRequestFailure:!1,dash:{clockSyncUri:"",ignoreDrmInfo:!1,disableXlinkProcessing:!1,
|
|
638
|
+
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"},
|
|
639
|
+
manifestPreprocessor:To,manifestPreprocessorTXml:Uo,sequenceMode:!1,enableAudioGroups:!1,multiTypeVariantsAllowed:d,useStreamOnceInPeriodFlattening:!1,updatePeriod:-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"',useSafariBehaviorForLive:!0,liveSegmentsDelay:3,
|
|
640
|
+
sequenceMode:ad()||Zc("Tizen 2")||bd()&&38===dd()||gd()||id()?!1:!0,ignoreManifestTimestampsInSegmentsMode:!1,disableCodecGuessing:!1,disableClosedCaptionsDetection:!1,allowLowLatencyByteRangeOptimization:!0},mss:{manifestPreprocessor:To,manifestPreprocessorTXml:Uo,sequenceMode:!1,keySystemsBySystemId:{"9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","79f0049a-4098-8642-ab92-e65be0885f95":"com.microsoft.playready"}}};var e={retryParameters:qi(),failureCallback:function(m){return Ko([m])},
|
|
641
|
+
rebufferingGoal:2,bufferingGoal:10,bufferBehind:30,evictionGoal:1,ignoreTextStreamFailures:!1,alwaysStreamText:!1,startAtSegmentBoundary:!1,gapDetectionThreshold:.5,gapPadding:.01,gapJumpTimerTime:.25,durationBackoff:1,safeSeekOffset:5,stallEnabled:!0,stallThreshold:1,stallSkip:.1,useNativeHlsOnSafari:!0,useNativeHlsForFairPlay:!0,inaccurateManifestTolerance:2,lowLatencyMode:!1,autoLowLatencyMode:!1,forceHTTP:!1,forceHTTPS:!1,preferNativeHls:!1,updateIntervalSeconds:1,dispatchAllEmsgBoxes:!1,observeQualityChanges:!1,
|
|
642
|
+
maxDisabledTime:30,parsePrftBox:!1,segmentPrefetchLimit:0,prefetchAudioLanguages:[],disableAudioPrefetch:!1,disableTextPrefetch:!1,disableVideoPrefetch:!1,liveSync:!1,liveSyncTargetLatencyTolerance:.5,liveSyncMaxLatency:1,liveSyncPlaybackRate:1.1,liveSyncMinLatency:0,liveSyncMinPlaybackRate:.95,liveSyncPanicMode:!1,liveSyncPanicThreshold:60,allowMediaSourceRecoveries:!0,minTimeBetweenRecoveries:5,vodDynamicPlaybackRate:!1,vodDynamicPlaybackRateLowBufferRate:.95,vodDynamicPlaybackRateBufferRatio:.5,
|
|
643
|
+
infiniteLiveStreamDuration:!1,preloadNextUrlWindow:30,loadTimeout:30,clearDecodingCache:gd()||id()},f=kd();f&&17<=f&&(e.infiniteLiveStreamDuration=!0);if(bd()||$c()||cd()||jd())e.stallSkip=0;$c()&&(e.gapPadding=2);f={trackSelectionCallback:function(m){return L(function(n){return n.return(m)})},downloadSizeCallback:function(m){var n;return L(function(q){if(1==q.g)return navigator.storage&&navigator.storage.estimate?J(q,navigator.storage.estimate(),3):q.return(!0);n=q.h;return q.return(n.usage+m<.95*
|
|
644
|
+
n.quota)})},progressCallback:function(m,n){return Ko([m,n])},usePersistentLicense:!0,numberOfParallelDownloads:5};a={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,
|
|
645
|
+
minBytes:16E3,fastHalfLife:2,slowHalfLife:5},restrictToElementSize:!1,restrictToScreenSize:!1,ignoreDevicePixelRatio:!1,clearBufferSwitch:!1,safeMarginSwitch:0,cacheLoadThreshold:20,minTimeToSwitch:ed()?.5:0};c={codecSwitchingStrategy:c,addExtraFeaturesToSourceBuffer:function(m){return Ko([m],"")},forceTransmux:!1,insertFakeEncryptionInInit:!0,modifyCueCallback:function(m,n){return Ko([m,n])}};var g=!1,h=!1,k=!0;if($c()||bd()||Yc()||gd()||id()||Zc("AFT")||Zc("PC=EOS")||Zc("PC=APL")||Zc("VirginMedia")||
|
|
646
|
+
fd()||Zc("WPE")||cd()||jd()||Zc("DT_STB_BCM")||Zc("PC=APPSTB")||hd())h=g=!0,k=!1;var l={drm:b,manifest:d,streaming:e,mediaSource:c,offline:f,abrFactory:function(){return new vf},abr:a,autoShowText:3,preferredAudioLanguage:"",preferredAudioLabel:"",preferredTextLanguage:"",preferredVariantRole:"",preferredTextRole:"",preferredAudioChannelCount:2,preferredVideoHdrLevel:"AUTO",preferredVideoLayout:"",preferredVideoLabel:"",preferredVideoCodecs:[],preferredAudioCodecs:[],preferForcedSubs:!1,preferSpatialAudio:!1,
|
|
647
|
+
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},textDisplayFactory:function(){return null},cmcd:{enabled:!1,sessionId:"",contentId:"",rtpSafetyFactor:5,useHeaders:!1,includeKeys:[]},cmsd:{enabled:!0,applyMaximumSuggestedBitrate:!0,
|
|
648
|
+
estimatedThroughputWeightRatio:.5},lcevc:{enabled:!1,dynamicPerformanceScaling:!0,logLevel:0,drawLogo:!1},ads:{customPlayheadTracker:g,skipPlayDetection:h,supportsMultipleMediaElements:k}};f.trackSelectionCallback=function(m){return L(function(n){return n.return(Vo(m,l.preferredAudioLanguage,l.preferredVideoHdrLevel))})};return l}
|
|
649
|
+
function Wo(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 Io(a,b,c||So(),d,"")}
|
|
650
|
+
function Vo(a,b,c){var d=c;"AUTO"==d&&(d=window.matchMedia("(color-gamut: p3)").matches?a.some(function(h){return h.hdr&&"HLG"==h.hdr?!0:!1})?"HLG":"PQ":"SDR");var e=a.filter(function(h){return"variant"!=h.type||h.hdr&&h.hdr!=d?!1:!0});c=[];var f=Ge(b,e.map(function(h){return h.language}));f&&(c=e.filter(function(h){return ze(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&&
|
|
651
|
+
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!=Qd&&"image"!=c.type||b.push(c);return b}function To(a){return Ko([a],a)}function Uo(a){return Ko([a],a)}O("shaka.util.PlayerConfiguration",Ro);Ro.mergeConfigObjects=Wo;Ro.createDefault=So;function Xo(a,b,c,d,e){Ai.call(this);this.L=a;this.T=b;this.ra=e.networkingEngine;this.W=d;this.u=null;this.fb=c;this.ma=0;this.bb=e.Ic;this.B=e.Og;this.cb=e.Pg;this.g=e.config;this.j=this.C=this.h=null;this.ga=!1;this.D=e.Zg;this.ja=!1;this.l=null;this.ba=!1;this.i=this.A=null;this.aa=!1;this.I=new Map;this.la=!1;this.wa=e.Yg;this.$=new Fn;this.fa=new si;this.m=new si;this.M=null;this.o=!1;this.xa=e.Uf;this.ha=null;this.va=e.Tf;this.O=!1;this.H=[];this.F=[]}sa(Xo,Ai);
|
|
652
|
+
function Yo(a,b,c){(a=b?a.F:a.H)?a.push(c):c()}function Zo(a){if(a.F)for(var b=t(a.F),c=b.next();!c.done;c=b.next())c=c.value,c();a.F=null}function $o(a,b){a.M=b;a.O=!0;if(a.H){b=t(a.H);for(var c=b.next();!c.done;c=b.next())c=c.value,c()}a.H=null}r=Xo.prototype;r.getStartTime=function(){return this.W};r.Nc=function(){return this.L};r.Pd=function(){return this.h};function ap(a){a.aa=!0;return a.i}function bp(a){a.ga=!0;return a.j}function cp(a){a.ja=!0;return a.D}r.getStats=function(){return this.$};
|
|
653
|
+
function dp(a){a.ba=!0;return a.l}function ep(a){a.la=!0;return a.I}
|
|
654
|
+
r.start=function(){var a=this;(function(){var b;return L(function(c){switch(c.g){case 1:return J(c,Promise.resolve(),2);case 2:return wa(c,3),J(c,fp(a),5);case 5:return gp(a),a.fa.resolve(),J(c,hp(a),6);case 6:gp(a);a.u||(a.u=new cl(a.g.preferredAudioLanguage,a.g.preferredVariantRole,a.g.preferredAudioChannelCount,a.g.preferredVideoHdrLevel,a.g.preferSpatialAudio,a.g.preferredVideoLayout,a.g.preferredAudioLabel,a.g.preferredVideoLabel,a.g.mediaSource.codecSwitchingStrategy,a.g.manifest.dash.enableAudioGroups));
|
|
655
|
+
if(a.va){var d=a.g.abrFactory;a.A=d;a.i=d();a.i.configure(a.g.abr)}if(a.xa){d=a.h.presentationTimeline.X();var e=sf(a.h.variants);e=a.u.create(e);a.i.configure(a.g.abr);a.i.setVariants(Array.from(e.values()));if(e=a.i.chooseVariant(!0))a.ha=e,e.video&&ip(a,e.video,d),e.audio&&ip(a,e.audio,d)}return J(c,void 0,7);case 7:gp(a);a.m.resolve();xa(c,0);break;case 3:b=ya(c),b instanceof S&&(7001==b.code||7003==b.code)||a.m.reject(b),K(c)}})})()};
|
|
656
|
+
r.dispatchEvent=function(a){return this.M?this.M.dispatchEvent(a):Ai.prototype.dispatchEvent.call(this,a)};r.onError=function(a){2===a.severity&&(this.m.reject(a),this.destroy());var b=(new Map).set("detail",a);b=new zi("error",b);this.dispatchEvent(b);b.defaultPrevented&&(a.handled=!0)};function gp(a){if(a.o)throw new S(2,7,7003);}function jp(a,b){a.dispatchEvent(new zi("onstatechange",(new Map).set("state",b)))}
|
|
657
|
+
function fp(a){var b,c,d,e;return L(function(f){if(1==f.g){jp(a,"manifest-parser");if(!a.j){a:{var g=a.L,h=a.T;if(h){var k=ki[h.toLowerCase()];if(k)break a}throw new S(2,4,4E3,g,h);}a.C=k;a.j=a.C();a.j.configure(a.g.manifest)}b=Date.now()/1E3;jp(a,"manifest");return a.h?f.s(2):J(f,a.j.start(a.L,a.cb),3)}2!=f.g&&(a.h=f.h);c=new zi("manifestparsed",void 0);a.dispatchEvent(c);if(0==a.h.variants.length)throw new S(2,4,4036);kp(a.h);d=Date.now()/1E3;e=d-b;a.$.D=e;K(f)})}
|
|
658
|
+
function hp(a){var b,c,d,e,f;return L(function(g){switch(g.g){case 1:jp(a,"drm-engine");a.ma=Date.now()/1E3;a.l=a.bb();a.B.g=a.l;a.l.configure(a.g.drm);var h=a.B;b=Ne(a.h.variants,h.h.restrictions,h.i);if(!b){g.s(2);break}c=new zi("trackschanged",void 0);return J(g,Promise.resolve(),3);case 3:gp(a),a.dispatchEvent(c);case 2:return d=sf(a.h.variants),J(g,Fl(a.l,d,a.h.offlineSessionIds),4);case 4:return gp(a),J(g,tm(a.B,a.h),5);case 5:e=g.h;if(!e){g.s(0);break}f=new zi("trackschanged",void 0);return J(g,
|
|
659
|
+
Promise.resolve(),7);case 7:a.dispatchEvent(f),K(g)}})}r.configure=function(a,b){a=Jo(a,b);Wo(this.g,a)};r.getConfiguration=function(){return He(this.g)};
|
|
660
|
+
function ip(a,b,c){var d,e,f,g,h;L(function(k){if(1==k.g)return d=a.g.streaming.segmentPrefetchLimit||2,e=new Gn(d,b,function(l,m,n){return ro(l,m,n||null,a.g.streaming.retryParameters,a.ra)},!1),a.I.set(b.id,e),J(k,b.createSegmentIndex(),2);f=a.W||0;(h=(g=b.segmentIndex.mb(f))?g.current():null)||(h=b.segmentIndex.get(0));h&&(c?h.ea&&Jn(e,h.ea):In(e,h.startTime));K(k)})}r.wh=function(){return this.m};
|
|
661
|
+
r.destroy=function(){var a=this,b,c,d;return L(function(e){switch(e.g){case 1:a.o=!0;if(!a.j||a.ga){e.s(2);break}return J(e,a.j.stop(),2);case 2:if(!a.i||a.aa){e.s(4);break}return J(e,a.i.stop(),4);case 4:a.D&&!a.ja&&a.D.release();if(!a.l||a.ba){e.s(6);break}return J(e,a.l.destroy(),6);case 6:if(0<a.I.size&&!a.la)for(b=t(a.I.values()),c=b.next();!c.done;c=b.next())d=c.value,Pn(d);K(e)}})};
|
|
662
|
+
function kp(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))}O("shaka.media.PreloadManager",Xo);Xo.prototype.destroy=Xo.prototype.destroy;Xo.prototype.waitForFinish=Xo.prototype.wh;function lp(a,b){Ai.call(this);var c=this;this.i=a;this.l=b;this.g=new Map;this.m=[{Nb:null,Mb:mp,Eb:function(d,e){return np(c,"enter",d,e)}},{Nb:op,Mb:mp,Eb:function(d,e){return np(c,"enter",d,e)}},{Nb:pp,Mb:mp,Eb:function(d,e){return np(c,"enter",d,e)}},{Nb:mp,Mb:op,Eb:function(d,e){return np(c,"exit",d,e)}},{Nb:mp,Mb:pp,Eb:function(d,e){return np(c,"exit",d,e)}},{Nb:op,Mb:pp,Eb:function(d,e){return np(c,"skip",d,e)}},{Nb:pp,Mb:op,Eb:function(d,e){return np(c,"skip",d,e)}}];this.h=new fb;this.h.G(this.i,
|
|
663
|
+
"regionremove",function(d){c.g.delete(d.region)})}sa(lp,Ai);lp.prototype.release=function(){this.i=null;this.g.clear();this.h.release();this.h=null;Ai.prototype.release.call(this)};lp.prototype.j=function(a,b){if(!this.l||0!=a){this.l=!1;for(var c=t(this.i.g),d=c.next();!d.done;d=c.next()){d=d.value;var e=this.g.get(d),f=a<d.startTime?op:a>d.endTime?pp:mp;this.g.set(d,f);for(var g=t(this.m),h=g.next();!h.done;h=g.next())h=h.value,h.Nb==e&&h.Mb==f&&h.Eb(d,b)}}};
|
|
664
|
+
function np(a,b,c,d){b=new zi(b,new Map([["region",c],["seeking",d]]));a.dispatchEvent(b)}var op=1,mp=2,pp=3;function qp(a,b,c,d,e,f){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"]};var g=null;try{g=yd(b)}catch(h){}throw new S(401==c||403==c?2:1,1,1001,d,c,g,a,f,e||d);};function rp(){}function sp(a,b,c,d,e){var f=new tp;yl(b.headers).forEach(function(l,m){f.append(m,l)});var g=new up,h={Oe:!1,Gf:!1};a=vp(a,c,{body:b.body||void 0,headers:f,method:b.method,signal:g.signal,credentials:b.allowCrossSiteCredentials?"include":void 0},h,d,e,b.streamDataCallback);a=new ti(a,function(){h.Oe=!0;g.abort();return Promise.resolve()});if(b=b.retryParameters.timeout){var k=new Tc(function(){h.Gf=!0;g.abort()});k.Z(b/1E3);a.finally(function(){k.stop()})}return a}
|
|
665
|
+
function vp(a,b,c,d,e,f,g){var h,k,l,m,n,q,p,u,x,v,z,w,E;return L(function(F){switch(F.g){case 1:return h=wp,k=xp,m=new ArrayBuffer(0),q=n=0,p=Date.now(),wa(F,2),J(F,h(a,c),4);case 4:l=F.h;f(yp(l.headers));if("HEAD"==c.method){F.s(5);break}u=l.clone().body.getReader();v=(x=l.headers.get("Content-Length"))?parseInt(x,10):0;z=function(D){function I(){var A,C,B;return L(function(H){switch(H.g){case 1:return wa(H,2),J(H,u.read(),4);case 4:A=H.h;xa(H,3);break;case 2:return ya(H),H.return();case 3:if(A.done){H.s(5);
|
|
666
|
+
break}n+=A.value.byteLength;if(!g){H.s(5);break}return J(H,g(A.value),5);case 5:C=Date.now();if(100<C-p||A.done)B=A.done?0:v-n,e(C-p,n-q,B),q=n,p=C;A.done?D.close():(D.enqueue(A.value),I());K(H)}})}I()};new k({start:z});return J(F,l.arrayBuffer(),6);case 6:m=F.h;case 5:xa(F,3);break;case 2:w=ya(F);if(d.Oe)throw new S(1,1,7001,a,b);if(d.Gf)throw new S(1,1,1003,a,b);throw new S(1,1,1002,a,w,b);case 3:return E=yp(l.headers),F.return(qp(E,m,l.status,a,l.url,b))}})}
|
|
667
|
+
function yp(a){var b={};a.forEach(function(c,d){b[d.trim()]=c});return b}function zp(){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)}O("shaka.net.HttpFetchPlugin",rp);rp.isSupported=zp;rp.parse=sp;var wp=window.fetch,up=window.AbortController,xp=window.ReadableStream,tp=window.Headers;
|
|
668
|
+
zp()&&(Ei("http",sp,2,!0),Ei("https",sp,2,!0),Ei("blob",sp,2,!0));function Ap(){}
|
|
669
|
+
function Bp(a,b,c,d,e){var f=new Cp,g=Date.now(),h=0,k=new Promise(function(l,m){f.open(b.method,a,!0);f.responseType="arraybuffer";f.timeout=b.retryParameters.timeout;f.withCredentials=b.allowCrossSiteCredentials;f.onabort=function(){m(new S(1,1,7001,a,c))};var n=!1;f.onreadystatechange=function(){if(2==f.readyState&&!n){var p=Dp(f);e(p);n=!0}};f.onload=function(p){var u=Dp(f),x=f.response;try{d(Date.now()-g,p.loaded-h,0);var v=qp(u,x,f.status,a,f.responseURL,c);l(v)}catch(z){m(z)}};f.onerror=function(p){m(new S(1,
|
|
670
|
+
1,1002,a,p,c))};f.ontimeout=function(){m(new S(1,1,1003,a,c))};f.onprogress=function(p){var u=Date.now();if(100<u-g||p.lengthComputable&&p.loaded==p.total)d(u-g,p.loaded-h,4==f.readyState?0:p.total-p.loaded),h=p.loaded,g=u};for(var q in b.headers)f.setRequestHeader(q.toLowerCase(),b.headers[q]);f.send(b.body)});return new ti(k,function(){f.abort();return Promise.resolve()})}
|
|
671
|
+
function Dp(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}O("shaka.net.HttpXHRPlugin",Ap);Ap.parse=Bp;var Cp=window.XMLHttpRequest;Ei("http",Bp,1,!0);Ei("https",Bp,1,!0);Ei("blob",Bp,1,!0);function Ep(a,b,c){var d,e,f,g,h,k,l;return L(function(m){switch(m.g){case 1:var n=(new sc(a)).Ha.split("/").pop().split(".");d=1==n.length?"":n.pop().toLowerCase();if(e=Fp[d])return m.return(e);f=0;g=Ii([a],c);wa(m,2);g.method="HEAD";return J(m,b.request(f,g).promise,4);case 4:h=m.h;e=h.headers["content-type"];xa(m,3);break;case 2:k=ya(m);if(!k||1002!=k.code&&1001!=k.code){m.s(3);break}g.method="GET";return J(m,b.request(f,g).promise,6);case 6:l=m.h,e=l.headers["content-type"];case 3:return m.return(e?
|
|
672
|
+
e.toLowerCase().split(";").shift():"")}})}
|
|
673
|
+
var Fp={mp4:"video/mp4",m4v:"video/mp4",m4a:"audio/mp4",webm:"video/webm",weba:"audio/webm",mkv:"video/webm",ts:"video/mp2t",ogv:"video/ogg",ogg:"audio/ogg",mpg:"video/mpeg",mpeg:"video/mpeg",mov:"video/quicktime",m3u8:"application/x-mpegurl",mpd:"application/dash+xml",ism:"application/vnd.ms-sstr+xml",mp3:"audio/mpeg",aac:"audio/aac",flac:"audio/flac",wav:"audio/wav",sbv:"text/x-subviewer",srt:"text/srt",vtt:"text/vtt",webvtt:"text/vtt",ttml:"application/ttml+xml",lrc:"application/x-subtitle-lrc",
|
|
674
|
+
ssa:"text/x-ssa",ass:"text/x-ssa",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml",webp:"image/webp",avif:"image/avif"};function Gp(a,b){if(a.lineBreak)return"\n";if(a.nestedCues.length)return a.nestedCues.map(function(g){return Gp(g,a)}).join("");if(!a.payload)return a.payload;var c=[],d=700<=a.fontWeight,e="italic"==a.fontStyle,f=a.textDecoration.includes("underline");d&&c.push(["b"]);e&&c.push(["i"]);f&&c.push(["u"]);e=a.color;""==e&&b&&(e=b.color);d="";(e=Hp(e))&&(d+="."+e);e=a.backgroundColor;""==e&&b&&(e=b.backgroundColor);(b=Hp(e))&&(d+=".bg_"+b);d&&c.push(["c",d]);return c.reduceRight(function(g,h){var k=t(h);
|
|
675
|
+
h=k.next().value;k=k.next().value;return"<"+h+(void 0===k?"":k)+">"+g+"</"+h+">"},a.payload)}
|
|
676
|
+
function Hp(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";
|
|
677
|
+
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 Ip(a,b){var c=[];a=t(Jp(a));for(var d=a.next();!d.done;d=a.next())if(d=d.value,d.isContainer)c.push.apply(c,y(Ip(d.nestedCues,d)));else{var e=d.clone();e.nestedCues=[];e.payload=Gp(d,b);c.push(e)}return c}
|
|
678
|
+
function Jp(a){var b=[];a=t(a);for(var c=a.next(),d={};!c.done;d={ud:void 0},c=a.next())d.ud=c.value,b.some(function(e){return function(f){return ac(e.ud,f)}}(d))||b.push(d.ud);return b}
|
|
679
|
+
function Kp(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&&
|
|
680
|
+
(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 Lp(a,b){this.g=null;for(var c=t(Array.from(a.textTracks)),d=c.next();!d.done;d=c.next())d=d.value,"metadata"!==d.kind&&"chapters"!==d.kind&&(d.mode="disabled",d.label==b&&(this.g=d));this.g||(this.g=a.addTextTrack("subtitles",b));this.g.mode="hidden"}r=Lp.prototype;r.configure=function(){};r.remove=function(a,b){if(!this.g)return!1;Mp(this.g,function(c){return c.startTime<b&&c.endTime>a});return!0};
|
|
681
|
+
r.append=function(a){if(this.g){var b=Ip(a),c=[];a=this.g.cues?Array.from(this.g.cues):[];b=t(b);for(var d=b.next(),e={};!d.done;e={Ub:void 0},d=b.next())e.Ub=d.value,!a.some(function(f){return function(g){return g.startTime==f.Ub.startTime&&g.endTime==f.Ub.endTime&&g.text==f.Ub.payload?!0:!1}}(e))&&e.Ub.payload&&(d=Kp(e.Ub))&&c.push(d);a=c.slice().sort(function(f,g){return f.startTime!=g.startTime?f.startTime-g.startTime:f.endTime!=g.endTime?f.endTime-g.startTime:"line"in VTTCue.prototype?c.indexOf(g)-
|
|
682
|
+
c.indexOf(f):c.indexOf(f)-c.indexOf(g)});a=t(a);for(b=a.next();!b.done;b=a.next())this.g.addCue(b.value)}};r.destroy=function(){this.g&&(Mp(this.g,function(){return!0}),this.g.mode="disabled");this.g=null;return Promise.resolve()};r.isTextVisible=function(){return this.g?"showing"==this.g.mode:!1};r.setTextVisibility=function(a){this.g&&(this.g.mode=a?"showing":"hidden")};
|
|
683
|
+
function Mp(a,b){var c=a.mode;a.mode="showing"==c?"showing":"hidden";for(var d=t(Array.from(a.cues)),e=d.next();!e.done;e=d.next())(e=e.value)&&b(e)&&a.removeCue(e);a.mode=c}O("shaka.text.SimpleTextDisplayer",Lp);Lp.prototype.setTextVisibility=Lp.prototype.setTextVisibility;Lp.prototype.isTextVisible=Lp.prototype.isTextVisible;Lp.prototype.destroy=Lp.prototype.destroy;Lp.prototype.append=Lp.prototype.append;Lp.prototype.remove=Lp.prototype.remove;Lp.prototype.configure=Lp.prototype.configure;function Np(){}r=Np.prototype;r.configure=function(){};r.remove=function(){};r.append=function(){};r.destroy=function(){};r.isTextVisible=function(){return!1};r.setTextVisibility=function(){};O("shaka.text.StubTextDisplayer",Np);Np.prototype.setTextVisibility=Np.prototype.setTextVisibility;Np.prototype.isTextVisible=Np.prototype.isTextVisible;Np.prototype.destroy=Np.prototype.destroy;Np.prototype.append=Np.prototype.append;Np.prototype.remove=Np.prototype.remove;Np.prototype.configure=Np.prototype.configure;function Op(){}function Pp(a){for(;a.firstChild;)a.removeChild(a.firstChild)}O("shaka.util.Dom",Op);Op.removeAllChildren=Pp;function Qp(a,b){var c=this;document.fullscreenEnabled||Za("Using UITextDisplayer in a browser without Fullscreen API support causes subtitles to not be rendered in fullscreen");this.u=!1;this.h=[];this.j=a;this.B=b;this.D=this.m=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.B.appendChild(this.g);
|
|
684
|
+
this.o=new Tc(function(){c.j.paused||Rp(c)});Sp(this);this.l=new Map;this.i=new fb;this.i.G(document,"fullscreenchange",function(){Rp(c,!0)});this.i.G(this.j,"seeking",function(){Rp(c,!0)});this.i.G(this.j,"ratechange",function(){Sp(c)});this.i.G(this.j,"resize",function(){var d=c.j,e=d.videoWidth;d=d.videoHeight;e&&d?c.m=e/d:c.m=null});this.A=null;"ResizeObserver"in window&&(this.A=new ResizeObserver(function(){Rp(c,!0)}),this.A.observe(this.g));this.C=new Map}r=Qp.prototype;
|
|
685
|
+
r.configure=function(a){this.D=a;Sp(this)};r.append=function(a){var b=[].concat(y(this.h));a=t(Jp(a));for(var c=a.next(),d={};!c.done;d={vd:void 0},c=a.next())d.vd=c.value,b.some(function(e){return function(f){return ac(f,e.vd)}}(d))||this.h.push(d.vd);this.h.length&&Sp(this);Rp(this)};
|
|
686
|
+
r.destroy=function(){if(!this.g)return Promise.resolve();this.B.removeChild(this.g);this.g=null;this.u=!1;this.h=[];this.o&&(this.o.stop(),this.o=null);this.l.clear();this.i&&(this.i.release(),this.i=null);this.A&&(this.A.disconnect(),this.A=null);return Promise.resolve()};r.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});Rp(this,c>this.h.length);this.h.length||Sp(this);return!0};r.isTextVisible=function(){return this.u};
|
|
687
|
+
r.setTextVisibility=function(a){this.u=a;Rp(this,!0)};function Sp(a){a.o&&(a.h.length?a.o.Sa((a.D?a.D.captionsUpdatePeriod:.25)/Math.max(1,Math.abs(a.j.playbackRate))):a.o.stop())}function Tp(a,b){for(;null!=b;){if(b==a.g)return!0;b=b.parentElement}return!1}
|
|
688
|
+
function Up(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.Kf:null;l&&(g.push(l.wd),l.Jb&&g.push(l.Jb),m||(f=!0,a.l.delete(k),l=null));m&&(h.push(k),l?Tp(a,n)||(f=!0):(Vp(a,k,e),l=a.l.get(k),n=l.Kf,f=!0));0<k.nestedCues.length&&n&&Up(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,p){return q.startTime!=
|
|
689
|
+
p.startTime?q.startTime-p.startTime:q.endTime-p.endTime});h=t(h);for(d=h.next();!d.done;d=h.next())d=a.l.get(d.value),d.Jb?(d.Jb.contains(c)&&d.Jb.removeChild(c),c.appendChild(d.Jb),d.Jb.appendChild(d.wd)):c.appendChild(d.wd)}}function Rp(a,b){if(a.g){var c=a.j.currentTime;if(!a.u||(void 0===b?0:b)){b=t(a.C.values());for(var d=b.next();!d.done;d=b.next())Pp(d.value);Pp(a.g);a.l.clear();a.C.clear()}a.u&&Up(a,a.h,a.g,c,[])}}
|
|
690
|
+
function Vp(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&&Wp(a,f,b,c,d);c=null;if(b.region&&b.region.id){var g=b.region,h=a.m===4/3?2.5:1.9;c=g.id+"_"+g.width+"x"+g.height+(g.heightUnits==Ib?"%":"px")+"-"+g.viewportAnchorX+"x"+g.viewportAnchorY+(g.viewportAnchorUnits==Ib?"%":"px");if(a.C.has(c))c=a.C.get(c);else{e=document.createElement("span");var k=g.heightUnits==Ib?"%":"px",l=g.widthUnits==
|
|
691
|
+
Ib?"%":"px",m=g.viewportAnchorUnits==Ib?"%":"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.m===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-
|
|
692
|
+
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=
|
|
693
|
+
"before"==b.displayAlign?"flex-start":"center"==b.displayAlign?"center":"flex-end";a.C.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,{wd:f,Kf:e,Jb:c})}
|
|
694
|
+
function Xp(a){var b=a.direction,c=a.positionAlign;a=a.textAlign;return c!==Qb?c:"left"===a||"start"===a&&b===Sb||"end"===a&&"rtl"===b?"line-left":"right"===a||"start"===a&&"rtl"===b||"end"===a&&b===Sb?"line-right":"center"}
|
|
695
|
+
function Wp(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=Yp(c.linePadding,c,a.B);f.paddingRight=Yp(c.linePadding,c,a.B);f.textCombineUpright=c.textCombineUpright;f.textShadow=c.textShadow;if(c.backgroundImage)f.backgroundImage=
|
|
696
|
+
"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=Zp(d,function(m){return m.backgroundColor}))?l.style.backgroundColor=b:k&&(l.style.backgroundColor="rgba(0, 0, 0, 0.8)"));k&&(l.textContent=k)}if(h&&!d[d.length-
|
|
697
|
+
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;
|
|
698
|
+
f.fontSize=Yp(c.fontSize,c,a.B);d=c.line;null!=d&&(g=c.lineInterpretation,g==Ub&&(g=1,h=16,a.m&&1>a.m&&(h=32),d=0>d?100+d/h*100:d/h*100),1==g&&(f.position="absolute",c.writingMode==Tb?(f.width="100%",c.lineAlign==Wb?f.top=d+"%":"end"==c.lineAlign&&(f.bottom=100-d+"%")):"vertical-lr"==c.writingMode?(f.height="100%",c.lineAlign==Wb?f.left=d+"%":"end"==c.lineAlign&&(f.right=100-d+"%")):(f.height="100%",c.lineAlign==Wb?f.right=d+"%":"end"==c.lineAlign&&(f.left=100-d+"%"))));f.lineHeight=c.lineHeight;
|
|
699
|
+
a=Xp(c);"line-left"==a?(f.cssFloat="left",null!==c.position&&(f.position="absolute",c.writingMode==Tb?(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==Tb?(f.right=100-c.position+"%",f.width="auto"):f.bottom=c.position+"%")):null!==c.position&&50!=c.position&&(f.position="absolute",c.writingMode==Tb?(f.left=c.position+"%",f.width="auto"):f.top=c.position+"%");f.textAlign=c.textAlign;f.textDecoration=
|
|
700
|
+
c.textDecoration.join(" ");f.writingMode=c.writingMode;"writingMode"in document.documentElement.style&&f.writingMode==c.writingMode||(f.webkitWritingMode=c.writingMode);c.size&&(c.writingMode==Tb?f.width=c.size+"%":f.height=c.size+"%")}
|
|
701
|
+
function Yp(a,b,c){var d=(d=(new RegExp(/(\d*\.?\d+)([a-z]+|%+)/)).exec(a))?{value:Number(d[1]),unit:d[2]}:null;if(!d)return a;var e=d.value;switch(d.unit){case "%":return e/100*c.clientHeight/b.cellResolution.rows+"px";case "c":return c.clientHeight*e/b.cellResolution.rows+"px";default:return a}}function Zp(a,b){for(var c=a.length-1;0<=c;c--){var d=b(a[c]);if(d||0===d)return d}return null}O("shaka.text.UITextDisplayer",Qp);Qp.prototype.setTextVisibility=Qp.prototype.setTextVisibility;
|
|
702
|
+
Qp.prototype.isTextVisible=Qp.prototype.isTextVisible;Qp.prototype.remove=Qp.prototype.remove;Qp.prototype.destroy=Qp.prototype.destroy;Qp.prototype.append=Qp.prototype.append;Qp.prototype.configure=Qp.prototype.configure;function $p(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=Ip(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");
|
|
703
|
+
break;case "right":g.push("align:right");break;case Rb: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}O("shaka.text.WebVttGenerator",function(){});function aq(a,b){this.h=a;this.g=b;this.m=void 0;this.i=!1;this.l=!0;this.j=!1}aq.prototype.configure=function(a){this.g=a};function bq(a){a.i=!1;a.l=!0;a.j=!1}
|
|
704
|
+
function cq(a,b,c){try{if(!a.g.enabled)return b;var d=dq(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=eq;break a;case "video/webm":case "video/mp4":case "video/mpeg":case "video/mp2t":e=fq;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=gq;break a}e=void 0}d.ot=e;d.su=
|
|
705
|
+
!0;var f=hq(d);return iq(b,f)}catch(g){return $a("CMCD_SRC_ERROR","Could not generate src CMCD data.",g),b}}function dq(a){a.g.sessionId||(a.g.sessionId=window.crypto.randomUUID());return{v:1,sf:a.m,sid:a.g.sessionId,cid:a.g.contentId,mtp:a.h.getBandwidthEstimate()/1E3}}
|
|
706
|
+
function Bq(a,b,c){c=void 0===c?{}:c;var d=void 0===d?a.g.useHeaders:d;if(a.g.enabled){Object.assign(c,dq(a));c.pr=a.h.Ka();var e=c.ot===Cq||c.ot===fq;a.j&&e&&(c.bs=!0,c.su=!0,a.j=!1);null==c.su&&(c.su=a.l);a=Dq(a,c);if(d)d=Eq(a),Object.keys(d).length&&Object.assign(b.headers,d);else{var f=hq(a);f&&(b.uris=b.uris.map(function(g){return iq(g,f)}))}}}function Dq(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}
|
|
707
|
+
function Fq(a){if(0===a.type)return Gq;if(a=a.stream){var b=a.type;if("video"==b)return a.codecs&&a.codecs.includes(",")?fq:Cq;if("audio"==b)return eq;if("text"==b)return"application/mp4"===a.mimeType?Hq:Iq}}function Jq(a,b){b=a.h.hb()[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}
|
|
708
|
+
function Kq(a,b){b=a.h.hb()[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 Lq(a,b){var c=a.h.Db();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 Cq:return a.videoBandwidth||NaN;case eq:return a.audioBandwidth||NaN;default:return a.bandwidth}}
|
|
709
|
+
function hq(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"===
|
|
710
|
+
l?h:"symbol"===l?h+"="+k.description:h+"="+k;e.push(m)}}return e.join(",")}function Eq(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,cid:2,pr:2,sf:2,sid:2,st:2,v: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=hq(e[a]))&&(c["CMCD-"+d[a]]=f);return c}
|
|
711
|
+
function iq(a,b){if(!b||a.includes("offline:"))return a;a=new sc(a);a.g.set("CMCD",b);return a.toString()}var gq="m",eq="a",Cq="v",fq="av",Gq="i",Iq="c",Hq="tt";O("shaka.util.CmcdManager.StreamingFormat",{DASH:"d",HLS:"h",Eh:"s",OTHER:"o"});function Mq(a){this.h=a;this.g=null}r=Mq.prototype;r.configure=function(a){this.h=a};r.Ve=function(){return this.h.enabled&&this.h.applyMaximumSuggestedBitrate&&this.g&&this.g.has(Nq)?1E3*this.g.get(Nq):null};r.Ue=function(){return this.h.enabled&&this.g&&this.g.has(Oq)?1E3*this.g.get(Oq):null};r.ug=function(){return this.h.enabled&&this.g&&this.g.has(Pq)?this.g.get(Pq):null};r.vg=function(){return this.h.enabled&&this.g&&this.g.has(Qq)?this.g.get(Qq):null};
|
|
712
|
+
r.getBandwidthEstimate=function(a){var b=this.Ue();if(!b)return a;var c=this.h.estimatedThroughputWeightRatio;return 0<c&&1>=c?a*(1-c)+b*c:a};function Rq(a){return a?"false"===a.toLowerCase()?!1:/^[-0-9]/.test(a)?parseInt(a,10):a.replace(/["]+/g,""):!0}O("shaka.util.CmsdManager",Mq);Mq.prototype.getBandwidthEstimate=Mq.prototype.getBandwidthEstimate;Mq.prototype.getRoundTripTime=Mq.prototype.vg;Mq.prototype.getResponseDelay=Mq.prototype.ug;Mq.prototype.getEstimatedThroughput=Mq.prototype.Ue;
|
|
713
|
+
Mq.prototype.getMaxBitrate=Mq.prototype.Ve;var Oq="etp",Nq="mb",Pq="rd",Qq="rtt";function Sq(){this.g=null;this.h=[]}function Tq(a,b){return L(function(c){if(1==c.g)return a.g?J(c,new Promise(function(d){return a.h.push(d)}),2):c.s(2);a.g=b;K(c)})}Sq.prototype.release=function(){0<this.h.length?this.h.shift()():this.g=null};function Z(a,b){Ai.call(this);var c=this;this.l=Uq;this.Vc=this.h=null;this.ba=!1;this.bd=new fb;this.ic=new fb;this.m=new fb;this.ra=new fb;this.fb=new fb;this.D=this.C=this.A=this.F=null;this.cd=0;this.T=new Sq;this.fa=this.le=this.W=this.i=this.wa=this.I=this.j=this.bb=this.L=this.Lf=this.$=this.O=this.cb=this.M=this.Wc=this.H=this.xa=null;this.ma=!1;this.ja=this.o=null;this.Ae=1E9;this.tc=[];this.he=-1;this.g=Vq(this);this.aa={width:Infinity,height:Infinity};this.Uc=new sm(this.g,this.aa,null);
|
|
714
|
+
this.me=[];this.u=null;this.la=new cl(this.g.preferredAudioLanguage,this.g.preferredVariantRole,this.g.preferredAudioChannelCount,this.g.preferredVideoHdrLevel,this.g.preferSpatialAudio,this.g.preferredVideoLayout,this.g.preferredAudioLabel,this.g.preferredVideoLabel,this.g.mediaSource.codecSwitchingStrategy,this.g.manifest.dash.enableAudioGroups);this.va=this.g.preferredTextLanguage;this.pc=this.g.preferredTextRole;this.kc=this.g.preferForcedSubs;this.jc=[];b&&b(this);this.O=Wq(this);this.$=new Mq(this.g.cmsd);
|
|
715
|
+
this.F=Xq(this);this.F.ue(this.g.streaming.forceHTTP);this.F.ve(this.g.streaming.forceHTTPS);this.Ge=this.ga=this.B=null;this.Ee=new Tc(function(){return L(function(d){if(1==d.g)return c.ga?J(d,c.Ob(c.Ge,!0),3):d.s(0);if(4!=d.g)return J(d,c.load(c.ga),4);c.Ge.play();c.ga=null;K(d)})});Yq&&(this.B=Yq(),this.B.configure(this.g.ads),this.fb.G(this.B,"ad-started",function(d){var e,f;return L(function(g){if(1==g.g){if(c.g.ads.supportsMultipleMediaElements)return g.return();e=d.originalEvent;if(!e)return g.return();
|
|
716
|
+
f=google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED;if(e.type!=f)return g.return();c.Ee.stop();if(c.ga)return g.s(0);c.Ge=c.h;return J(g,c.Qe(!0),3)}c.ga=g.h;K(g)})}),this.fb.G(this.B,"ad-stopped",function(d){c.g.ads.supportsMultipleMediaElements||(d=d.originalEvent)&&d.type==google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED&&c.Ee.Z(.1)}));this.bd.G(window,"online",function(){Zq(c);c.pe()});this.Yc=new Tc(function(){return $q(c)});this.ha=null;a&&(pb("Player w/ mediaElement","Please migrate from initializing Player with a mediaElement; use the attach method instead."),
|
|
717
|
+
this.Ob(a,!0))}sa(Z,Ai);function ar(a){null!=a.L&&(Wk(a.L),a.L.release(),a.L=null)}function br(a,b){b.lcevc.enabled?(ar(a),null==a.L&&(a.L=new Vk(a.h,a.Lf,b.lcevc),a.C&&(a.C.$=a.L))):ar(a)}function cr(a,b){return new zi(a,b)}r=Z.prototype;
|
|
718
|
+
r.destroy=function(){var a=this,b,c,d,e,f;return L(function(g){switch(g.g){case 1:if(a.l==dr)return g.return();ar(a);b=a.detach();a.l=dr;return J(g,b,2);case 2:c=[];d=t(a.me);for(e=d.next();!e.done;e=d.next())f=e.value,f.o||c.push(f.destroy());a.me=[];return J(g,Promise.all(c),3);case 3:a.bd&&(a.bd.release(),a.bd=null);a.ic&&(a.ic.release(),a.ic=null);a.m&&(a.m.release(),a.m=null);a.ra&&(a.ra.release(),a.ra=null);a.fb&&(a.fb.release(),a.fb=null);a.ja=null;a.g=null;a.u=null;a.Vc=null;a.O=null;a.$=
|
|
719
|
+
null;if(!a.F){g.s(4);break}return J(g,a.F.destroy(),5);case 5:a.F=null;case 4:a.o&&(a.o.release(),a.o=null),Ai.prototype.release.call(a),K(g)}})};function er(a,b){a.dispatchEvent(cr("onstatechange",(new Map).set("state",b)))}
|
|
720
|
+
r.Ob=function(a,b){b=void 0===b?!0:b;var c=this,d,e,f;return L(function(g){switch(g.g){case 1:if(c.l==dr)throw new S(2,7,7E3);d=c.h&&c.h==a;if(!c.h||c.h==a){g.s(2);break}return J(g,c.detach(),2);case 2:return J(g,fr(c,"attach"),4);case 4:if(g.h)return g.return();wa(g,5,6);d||(er(c,"attach"),e=function(){var h=gr(c,!1);h&&hr(c,h)},c.ic.G(a,"error",e),c.h=a);if(!b||!Uc()||c.C){g.s(6);break}return J(g,ir(c),6);case 6:za(g);c.T.release();Ba(g,0);break;case 5:return f=ya(g),J(g,c.detach(),10);case 10:throw f;
|
|
721
|
+
}})};r.Vf=function(a){this.Lf=a};r.detach=function(a){a=void 0===a?!1:a;var b=this;return L(function(c){if(1==c.g){if(b.l==dr)throw new S(2,7,7E3);return J(c,b.yc(!1,a),2)}if(3!=c.g)return J(c,fr(b,"detach"),3);if(c.h)return c.return();try{b.h&&(b.ic.Za(),b.h=null),er(b,"detach"),b.B&&!a&&b.B.release()}finally{b.T.release()}K(c)})};function fr(a,b){var c;return L(function(d){return 1==d.g?(c=++a.cd,J(d,Tq(a.T,b),2)):c!=a.cd?(a.T.release(),d.return(!0)):d.return(!1)})}
|
|
722
|
+
r.yc=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;return L(function(p){switch(p.g){case 1:return c.l!=dr&&(c.l=Uq),J(p,fr(c,"unload"),2);case 2:if(p.h)return p.return();p.l=0;p.j=3;c.ma=!1;er(c,"unload");a&&!Uc()&&(a=!1);ar(c);d=c.jc.map(function(u){return u()});c.jc=[];return J(p,Promise.all(d),5);case 5:c.dispatchEvent(cr("unloading"));c.cb&&(c.cb.release(),c.cb=null);c.h&&(c.m.Za(),c.ra.Za());c.Yc.stop();c.xa&&(c.xa.release(),c.xa=null);c.Wc&&(c.Wc.stop(),c.Wc=
|
|
723
|
+
null);if(!c.I){p.s(6);break}return J(p,c.I.stop(),7);case 7:c.I=null,c.wa=null;case 6:if(!c.o){p.s(8);break}return J(p,c.o.stop(),8);case 8:if(!c.j){p.s(10);break}return J(p,c.j.destroy(),11);case 11:c.j=null;case 10:c.H&&(c.H.release(),c.H=null);c.D&&(c.D.release(),c.D=null);if("webkit"!==window.shakaMediaKeysPolyfill||!c.A){p.s(12);break}return J(p,c.A.destroy(),13);case 13:c.A=null;case 12:if(!c.C){p.s(14);break}return J(p,c.C.destroy(),15);case 15:c.C=null;case 14:if(c.B&&!b)c.B.onAssetUnload();
|
|
724
|
+
c.ga&&!b&&(c.ga.destroy(),c.ga=null);b||c.Ee.stop();c.O&&bq(c.O);c.$&&(c.$.g=null);c.h&&Pp(c.h);c.h&&c.h.src&&(c.h.removeAttribute("src"),c.h.load());if(!c.A){p.s(16);break}return J(p,c.A.destroy(),17);case 17:c.A=null;case 16:c.ha&&c.W!=c.ha.Nc()&&(c.ha.o||c.ha.destroy(),c.ha=null);c.W=null;c.le=null;c.M=null;if(c.i){e=t(c.i.variants);for(f=e.next();!f.done;f=e.next())for(g=f.value,h=t([g.audio,g.video]),k=h.next();!k.done;k=h.next())(l=k.value)&&l.segmentIndex&&l.segmentIndex.release();m=t(c.i.textStreams);
|
|
725
|
+
for(n=m.next();!n.done;n=m.next())q=n.value,q.segmentIndex&&q.segmentIndex.release()}c.g&&c.g.streaming.clearDecodingCache&&(Xe={},Rc.clear());c.i=null;c.u=new Fn;c.qe=null;c.tc=[];c.he=-1;jr(c);case 3:za(p);c.T.release();Ba(p,4);break;case 4:if(a&&Uc()&&!c.C)return J(p,ir(c),0);p.s(0)}})};r.uh=function(a){this.fa=a};
|
|
726
|
+
r.load=function(a,b,c){b=void 0===b?null:b;var d=this,e,f,g,h,k,l,m,n,q,p,u,x,v;return L(function(z){switch(z.g){case 1:if(d.l==dr)throw new S(2,7,7E3);e=null;f="";if(a instanceof Xo){if(a.o)throw new S(2,7,7006);e=a;f=e.Nc()||""}else f=a||"";return J(z,Tq(d.T,"load"),2);case 2:d.T.release();if(!d.h)throw new S(2,7,7002);if(!d.W){z.s(3);break}d.W=f;return J(z,d.yc(!1),3);case 3:g=++d.cd;h=function(){return L(function(w){if(1==w.g)return d.cd==g?w.s(0):e?J(w,e.destroy(),3):w.s(3);throw new S(2,7,7E3);
|
|
727
|
+
})};k=function(w,E){return L(function(F){switch(F.g){case 1:return F.l=0,F.j=2,J(F,Tq(d.T,E),4);case 4:return J(F,h(),5);case 5:return J(F,w(),6);case 6:return J(F,h(),7);case 7:e&&d.g&&(e.g=d.g);case 2:za(F),d.T.release(),Ba(F,0)}})};wa(z,5,6);null==b&&e&&(b=e.getStartTime());d.fa=b;d.ma=!1;d.dispatchEvent(cr("loading"));if(e){c=e.T;z.s(8);break}if(c){z.s(8);break}return J(z,k(function(){return L(function(w){if(1==w.g)return J(w,kr(d,f),2);c=w.h;K(w)})},"guessMimeType_"),8);case 8:l=!!e;if(e){$o(e,
|
|
728
|
+
d);d.u=e.getStats();z.s(11);break}return J(z,lr(d,f,b,c,!0),12);case 12:(e=z.h)?($o(e,d),d.u=e.getStats(),e.start(),e.m.catch(function(){})):d.u=new Fn;case 11:return m=!e,n=e?e.fb:Date.now()/1E3,d.u=e?e.getStats():new Fn,d.W=f,d.le=c||null,m?J(z,k(function(){return L(function(w){return J(w,mr(d,c),0)})},"initializeSrcEqualsDrmInner_"),21):J(z,k(function(){return L(function(w){return J(w,Promise.race([e.fa,e.m]),0)})},"waitForFinish"),15);case 15:d.wa=e.C;d.I=bp(e);d.i=e.Pd();if(d.C){z.s(16);break}return J(z,
|
|
729
|
+
k(function(){return L(function(w){return J(w,ir(d),0)})},"initializeMediaSourceEngineInner_"),16);case 16:return J(z,k(function(){return L(function(w){return J(w,e.m,0)})},"waitForFinish"),18);case 18:d.g=e.getConfiguration();d.Uc=e.B;d.cb=cp(e);d.bb=e.wa;if(q=e.u)d.la=q;l&&d.h&&"AUDIO"===d.h.nodeName&&(nr(d),d.configure("manifest.disableVideo",!0));d.A=dp(e);return J(z,k(function(){return L(function(w){return J(w,d.A.Ob(d.h),0)})},"drmEngine_.attach"),19);case 19:return!(p=e.A)||d.ja&&d.ja==p||(d.o=
|
|
730
|
+
ap(e),d.ja=e.A,"function"!=typeof d.o.setMediaElement&&(pb("AbrManager w/o setMediaElement","Please use an AbrManager with setMediaElement function."),d.o.setMediaElement=function(){}),"function"!=typeof d.o.setCmsdManager&&(pb("AbrManager w/o setCmsdManager","Please use an AbrManager with setCmsdManager function."),d.o.setCmsdManager=function(){}),"function"!=typeof d.o.trySuggestStreams&&(pb("AbrManager w/o trySuggestStreams","Please use an AbrManager with trySuggestStreams function."),d.o.trySuggestStreams=
|
|
731
|
+
function(){})),u=ep(e),x=e.ha,J(z,k(function(){return L(function(w){return J(w,or(d,n,x,u),0)})},"loadInner_"),20);case 20:Zo(e);z.s(14);break;case 21:return J(z,k(function(){return L(function(w){return J(w,pr(d,n,c),0)})},"srcEqualsInner_"),14);case 14:d.dispatchEvent(cr("loaded"));case 6:za(z);if(!e){z.s(23);break}return J(z,e.destroy(),23);case 23:d.ha=null;Ba(z,0);break;case 5:v=ya(z);if(!v||7E3==v.code){z.s(25);break}return J(z,d.yc(!1),25);case 25:throw v;}})};
|
|
732
|
+
function nr(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})}r.rh=function(a,b){a=void 0===a?!0:a;b=void 0===b?!1:b;var c=this,d;return L(function(e){return 1==e.g?J(e,qr(c),2):3!=e.g?(d=e.h,J(e,c.yc(a,b),3)):e.return(d)})};
|
|
733
|
+
r.Qe=function(a){a=void 0===a?!1:a;var b=this,c;return L(function(d){return 1==d.g?J(d,qr(b),2):3!=d.g?(c=d.h,J(d,b.detach(a),3)):d.return(c)})};
|
|
734
|
+
function qr(a){var b,c,d;return L(function(e){if(1==e.g){b=null;if(!(a.i&&a.I&&a.wa&&a.W))return e.s(2);c=a.h.currentTime;a.X()&&(c=null);d=Date.now()/1E3;return J(e,rr(a,a.W,c,a.le,d,!0,!1,!1),3)}if(2!=e.g){var f=b=e.h,g=a.I,h=a.wa;f.h=a.i;f.j=g;f.C=h;f=b;g=a.ja;f.i=a.o;f.A=g;b.u=a.la;b.start();a.i=null;a.I=null;a.wa=null;a.o=null;a.ja=null}return e.return(b)})}
|
|
735
|
+
r.preload=function(a,b,c){b=void 0===b?null:b;var d=this,e;return L(function(f){if(1==f.g)return J(f,lr(d,a,b,c),2);(e=f.h)?e.start():hr(d,new S(2,7,7005));return f.return(e)})};function lr(a,b,c,d,e){e=void 0===e?!1:e;var f,g,h,k;return L(function(l){if(1==l.g)return f=Date.now()/1E3,d?l.s(2):J(l,kr(a,b),3);2!=l.g&&(d=l.h);if(g=sr(a,d))return l.return(null);h=!1;k=!0;e&&(a.o&&a.ja==a.g.abrFactory&&(k=!1),a.h&&"AUDIO"===a.h.nodeName&&(h=!0));return l.return(rr(a,b,c,d||null,f,!e,h,k))})}
|
|
736
|
+
function rr(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,p,u,x,v,z,w,E,F,D,I;return L(function(A){if(1==A.g)return k=null,l=He(a.g),g&&(l.manifest.disableVideo=!0),m=function(){return k.O&&k.o?null:k},n=function(){return m()?m().getConfiguration():a.g},q=function(C,B){m()?k.configure(C,B):a.configure(C,B)},Infinity!=a.aa.width||Infinity!=a.aa.height?A.s(2):J(A,td(),3);2!=A.g&&(p=A.h,a.aa.width=p.width,a.aa.height=p.height);u=new sm(l,a.aa,null);x={networkingEngine:a.F,
|
|
737
|
+
filter:function(C){var B,H;return L(function(G){if(1==G.g)return J(G,tm(u,C),2);if(4!=G.g){B=G.h;if(!B)return G.s(0);H=cr("trackschanged");return J(G,Promise.resolve(),4)}k.dispatchEvent(H);K(G)})},makeTextStreamsForClosedCaptions:function(C){return tr(a,C)},onTimelineRegionAdded:function(C){var B=k.D;a:{var H=t(B.g);for(var G=H.next();!G.done;G=H.next())if(G=G.value,G.schemeIdUri==C.schemeIdUri&&G.id==C.id&&.1>Math.abs(G.startTime-C.startTime)&&.1>Math.abs(G.endTime-C.endTime)){H=G;break a}H=null}null==
|
|
738
|
+
H&&(B.g.add(C),C=new zi("regionadd",new Map([["region",C]])),B.dispatchEvent(C))},onEvent:function(C){return k.dispatchEvent(C)},onError:function(C){return k.onError(C)},isLowLatencyMode:function(){return n().streaming.lowLatencyMode},isAutoLowLatencyMode:function(){return n().streaming.autoLowLatencyMode},enableLowLatencyMode:function(){q("streaming.lowLatencyMode",!0)},updateDuration:function(){a.j&&k.O&&a.j.updateDuration()},newDrmInfo:function(C){var B=k.l,H=B?B.g:null;H&&B.A&&vm(u,H.keySystem,
|
|
739
|
+
C)},onManifestUpdated:function(){var C=(new Map).set("isLive",a.X());k.dispatchEvent(cr("manifestupdated",C));Yo(k,!1,function(){if(a.B)a.B.onManifestUpdated(a.X())})},getBandwidthEstimate:function(){return a.o.getBandwidthEstimate()}};v=new Sn(function(){return a.Oa()});v.addEventListener("regionadd",function(C){var B=C.region;ur(a,"timelineregionadded",B,k);Yo(k,!1,function(){if(a.B)a.B.onDashTimedMetadata(B)})});z=null;l.streaming.observeQualityChanges&&(z=new Tn(function(){return a.hb()}),z.addEventListener("qualitychange",
|
|
740
|
+
function(C){var B=C.quality;C=C.position;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}).set("position",C);a.dispatchEvent(cr("mediaqualitychanged",B))}));w=!0;E={Gb:a.F,onError:function(C){return k.onError(C)},mf:function(C){Yo(k,!0,function(){a:{var B=C,H=cr("keystatuschanged");
|
|
741
|
+
a.dispatchEvent(H);var G=Object.keys(B);1==G.length&&""==G[0]&&(G=["00"],B={"00":B[""]});H=1==G.length&&"00"==G[0];var N=!1;if(G.length){G=a.keySystem();for(var Q=yl(a.g.drm.clearKeys),M=t(a.i.variants),P=M.next();!P.done;P=M.next()){P=P.value;var aa=[];P.audio&&aa.push(P.audio);P.video&&aa.push(P.video);aa=t(aa);for(var R=aa.next();!R.done;R=aa.next()){var W=R.value;R=P.allowedByKeySystem;if(W.keyIds.size)if(W.drmInfos.length&&!Q.size){W=t(W.drmInfos);for(var U=W.next();!U.done;U=W.next())if(U=U.value,
|
|
742
|
+
U.keyIds.size&&U.keySystem==G){P.allowedByKeySystem=!0;U=t(U.keyIds);for(var ba=U.next();!ba.done;ba=U.next())if(ba=ba.value,(ba=B[H?"00":ba])||a.A.D)P.allowedByKeySystem=P.allowedByKeySystem&&!!ba&&!xm.includes(ba)}}else for(P.allowedByKeySystem=!0,W=t(W.keyIds),U=W.next();!U.done;U=W.next())if(U=U.value,(U=B[H?"00":U])||a.A.D)P.allowedByKeySystem=P.allowedByKeySystem&&!!U&&!xm.includes(U);R!=P.allowedByKeySystem&&(N=!0)}}}if(N&&(vr(a),!wr(a)))break a;(B=a.j.j)&&!B.allowedByKeySystem&&xr(a)}})},
|
|
743
|
+
onExpirationUpdated:function(C,B){var H=cr("expirationupdated");k.dispatchEvent(H);if((H=k.j)&&H.onExpirationUpdated)H.onExpirationUpdated(C,B)},onEvent:function(C){k.dispatchEvent(C);"drmsessionupdate"==C.type&&w&&(w=!1,C=Date.now()/1E3-k.ma,(a.u||k.getStats()).j=C,a.L&&Wk(a.L))}};F=Xq(a,m);Hi(a.F,F);D=function(){return a.Ic(E)};I={config:l,Pg:x,Zg:v,Yg:z,Ic:D,Og:u,networkingEngine:F,Uf:f,Tf:h};k=new Xo(b,d,e,c,I);a.me.push(k);return A.return(k)})}
|
|
744
|
+
function kr(a,b){var c,d;return L(function(e){if(1==e.g)return c=a.g.manifest.retryParameters,J(e,Ep(b,a.F,c),2);d=e.h;"application/x-mpegurl"==d&&ed()&&(d="application/vnd.apple.mpegurl");return e.return(d)})}
|
|
745
|
+
function sr(a,b){if(!Uc())return!0;if(b){if(""==(a.h||Wc()).canPlayType(b))return!1;if(!(Uc()&&b in ki))return!0;if(ke(b)){if(a.g.streaming.preferNativeHls)return!0;if(ed()&&(a.g.drm.servers["com.apple.fps"]||a.g.drm.servers["com.apple.fps.1_0"]))return a.g.streaming.useNativeHlsForFairPlay;if(ed())return a.g.streaming.useNativeHlsOnSafari}}return!1}
|
|
746
|
+
function ir(a){var b,c,d,e,f;return L(function(g){if(1==g.g)return er(a,"media-source"),b=a.g.textDisplayFactory,c=b(),c.configure?c.configure(a.g.textDisplayer):pb("Text displayer w/ configure",'Text displayer should have a "configure" method!'),a.qe=b,d=yr(a.h,c,{mg:function(){return a.keySystem()},dd:function(h,k,l){zr(a,h,k,l)}},a.L),d.configure(a.g.mediaSource),e=a.g.manifest,f=e.segmentRelativeVttTiming,d.ja=f,J(g,d.F,2);a.C=d;K(g)})}
|
|
747
|
+
function or(a,b,c,d){var e,f,g,h,k,l,m,n,q,p,u,x,v,z,w,E,F,D,I,A,C,B;return L(function(H){switch(H.g){case 1:er(a,"load");e=a.h;a.H=new gn({Pc:function(){return e.playbackRate},yb:function(){return e.defaultPlaybackRate},we:function(G){e.playbackRate=G},hf:function(G){e.currentTime+=G}});f=function(){return Ar(a)};g=function(){return Br(a)};a.m.G(e,"playing",f);a.m.G(e,"pause",f);a.m.G(e,"ended",f);a.m.G(e,"ratechange",g);br(a,a.g);a.va=a.g.preferredTextLanguage;a.pc=a.g.preferredTextRole;a.kc=a.g.preferForcedSubs;
|
|
748
|
+
Cr(a.i.presentationTimeline,a.g.playRangeStart,a.g.playRangeEnd);a.o.init(function(G,N,Q){a.i&&a.j&&G!=a.j.j&&Dr(a,G,!0,void 0===N?!1:N,void 0===Q?0:Q)});a.o.setMediaElement(e);a.o.setCmsdManager(a.$);a.j=Er(a);a.j.configure(a.g.streaming);a.l=Fr;e.textTracks&&a.m.G(e.textTracks,"addtrack",function(G){if(G.track)switch(G=G.track,G.kind){case "chapters":Gr(a,G)}});a.dispatchEvent(cr("streaming"));h=c;(k=a.j.j)||h||(h=Hr(a,!0));l=[];m=k||h;n=t([m.video,m.audio]);for(q=n.next();!q.done;q=n.next())(p=
|
|
749
|
+
q.value)&&!p.segmentIndex&&l.push(p.createSegmentIndex());if(!(0<l.length)){H.s(2);break}return J(H,Promise.all(l),2);case 2:if(a.I&&a.I.onInitialVariantChosen)a.I.onInitialVariantChosen(m);Cr(a.i.presentationTimeline,a.g.playRangeStart,a.g.playRangeEnd);co(a.j,a.g.playRangeStart,a.g.playRangeEnd);u=function(G){a.D=Ir(a,G);a.xa=Jr(a,G);Kr(a,e,Math.max(a.i.minBufferTime,a.g.streaming.rebufferingGoal))};a.g.streaming.startAtSegmentBoundary||u(a.fa);if(k){H.s(4);break}if(!a.g.streaming.startAtSegmentBoundary){H.s(5);
|
|
750
|
+
break}x=a.i.presentationTimeline;v=a.fa||a.h.currentTime;z=x.pb();w=x.Va();v<z?v=z:v>w&&(v=w);return J(H,Lr(h,v),6);case 6:E=H.h,u(E);case 5:Dr(a,h,!0,!1,0);case 4:return a.D.ready(),F=a.Sb().find(function(G){return G.active}),F||((D=tf(a.i.textStreams,a.va,a.pc,a.kc)[0]||null)&&En(a.u.h,D,!0),h&&(D?(Mr(a,h.audio,D)&&(a.ba=!0),a.ba&&a.C.D.setTextVisibility(!0),Nr(a)):a.ba=!1),D&&(a.g.streaming.alwaysStreamText||a.Vd())&&mo(a.j,D)),J(H,a.j.start(d),7);case 7:a.g.abr.enabled&&(a.o.enable(),Or(a));vr(a);
|
|
751
|
+
wr(a);a.i.variants.some(function(G){return G.primary});if((I=a.X())&&(a.g.streaming.liveSync||a.i.serviceDescription||a.g.streaming.liveSyncPanicMode)||a.g.streaming.vodDynamicPlaybackRate)A=function(){return Pr(a)},a.m.G(e,"timeupdate",A);I||(C=function(){return Qr(a)},a.m.G(e,"timeupdate",C),Qr(a),a.i.nextUrl&&(0<a.g.streaming.preloadNextUrlWindow&&(B=function(){var G;return L(function(N){if(1==N.g){G=a.Oa().end-a.h.currentTime;if(isNaN(G)||!(G<=a.g.streaming.preloadNextUrlWindow))return N.s(0);
|
|
752
|
+
a.m.Kb(e,"timeupdate",B);return J(N,a.preload(a.i.nextUrl),4)}a.ha=N.h;K(N)})},a.m.G(e,"timeupdate",B)),a.m.G(e,"ended",function(){a.load(a.ha||a.i.nextUrl)})));if(a.B)a.B.onManifestUpdated(I);a.ma=!0;a.m.Aa(e,"loadedmetadata",function(){a.u.m=Date.now()/1E3-b});K(H)}})}
|
|
753
|
+
function mr(a,b){var c,d,e,f,g;return L(function(h){return 1==h.g?(c=Sd,d=Date.now()/1E3,e=!0,a.A=a.Ic({Gb:a.F,onError:function(k){hr(a,k)},mf:function(){},onExpirationUpdated:function(){var k=cr("expirationupdated");a.dispatchEvent(k)},onEvent:function(k){a.dispatchEvent(k);"drmsessionupdate"==k.type&&e&&(e=!1,a.u.j=Date.now()/1E3-d)}}),a.A.configure(a.g.drm),f={id:0,language:"und",disabledUntilTime:0,primary:!1,audio:null,video:null,bandwidth:100,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]},
|
|
754
|
+
g={id:0,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:b?ie(b):"",codecs:b?je(b):"",encrypted:!0,drmInfos:[],keyIds:new Set,language:"und",originalLanguage:null,label:null,type:c.da,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!1,fastSwitching:!1,fullMimeTypes:new Set},g.fullMimeTypes.add(Ud(g.mimeType,
|
|
755
|
+
g.codecs)),b.startsWith("audio/")?(g.type=c.S,f.audio=g):f.video=g,a.A.W=!0,J(h,Fl(a.A,[f],[]),2)):J(h,a.A.Ob(a.h),0)})}
|
|
756
|
+
function pr(a,b,c){var d,e,f,g,h,k,l,m,n,q,p,u;return L(function(x){if(1==x.g)return er(a,"src-equals"),d=a.h,a.D=new sn(d),e=!1,a.jc.push(function(){e=!0}),null!=a.fa&&a.D.pd(a.fa),a.H=new gn({Pc:function(){return d.playbackRate},yb:function(){return d.defaultPlaybackRate},we:function(v){d.playbackRate=v},hf:function(v){d.currentTime+=v}}),f=a.g.streaming.rebufferingGoal,Kr(a,d,f),g=function(){return Ar(a)},h=function(){return Br(a)},a.m.G(d,"playing",g),a.m.G(d,"pause",g),a.m.G(d,"ended",g),a.m.G(d,
|
|
757
|
+
"ratechange",h),"none"!=d.preload&&a.m.Aa(d,"loadedmetadata",function(){a.u.m=Date.now()/1E3-b}),d.audioTracks&&(a.m.G(d.audioTracks,"addtrack",function(){return vr(a)}),a.m.G(d.audioTracks,"removetrack",function(){return vr(a)}),a.m.G(d.audioTracks,"change",function(){return vr(a)})),d.textTracks&&(a.m.G(d.textTracks,"addtrack",function(v){if(v.track)switch(v=v.track,v.kind){case "metadata":Rr(a,v);break;case "chapters":Gr(a,v);break;default:vr(a)}}),a.m.G(d.textTracks,"removetrack",function(){return vr(a)}),
|
|
758
|
+
a.m.G(d.textTracks,"change",function(){return vr(a)})),k=cq(a.O,a.W,c),!k.includes("#t=")&&(0<a.g.playRangeStart||isFinite(a.g.playRangeEnd))&&(k+="#t=",0<a.g.playRangeStart&&(k+=a.g.playRangeStart),isFinite(a.g.playRangeEnd)&&(k+=","+a.g.playRangeEnd)),d.src=k,a.C&&window.ManagedMediaSource&&(d.disableRemotePlayback=!1),($c()||bd())&&d.load(),"none"!=d.preload&&!d.autoplay&&ke(c)&&kd()&&d.load(),a.l=Sr,a.dispatchEvent(cr("streaming")),l=new si,jn(d,HTMLMediaElement.HAVE_METADATA,a.m,function(){a.D.ready();
|
|
759
|
+
l.resolve()}),jn(d,HTMLMediaElement.HAVE_CURRENT_DATA,a.m,function(){var v;return L(function(z){if(1==z.g)return Tr(a),v=Ur(a),v.find(function(w){return"disabled"!=w.mode})?(0<v.length&&(a.ba=!0),z.s(2)):J(z,new Promise(function(w){a.m.Aa(d.textTracks,"change",w);(new Tc(w)).Z(1)}),2);if(e)return z.return();Vr(a);K(z)})}),d.error?l.reject(gr(a)):"none"==d.preload&&(Za('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.'),
|
|
760
|
+
l.resolve()),a.m.Aa(d,"error",function(){l.reject(gr(a))}),m=new Promise(function(v,z){(new Tc(z)).Z(a.g.streaming.loadTimeout)}),J(x,Promise.race([l,m]),2);if((n=a.X())&&(a.g.streaming.liveSync||a.g.streaming.liveSyncPanicMode)||a.g.streaming.vodDynamicPlaybackRate)q=function(){return Pr(a)},a.m.G(d,"timeupdate",q);n||(p=function(){return Qr(a)},a.m.G(d,"timeupdate",p),Qr(a));a.B&&(a.B.onManifestUpdated(n),n&&(u=a.Oa().end,a.m.G(d,"progress",function(){var v=a.Oa().end;u!=v&&(a.B.onManifestUpdated(a.X()),
|
|
761
|
+
u=v)})));a.ma=!0;K(x)})}function Tr(a){var b=a.g.preferredAudioLanguage;""!=b&&a.wf(b,a.g.preferredVariantRole)}function Vr(a){var b=a.g.preferredTextLanguage;""!=b&&a.xf(b,a.g.preferredTextRole,a.g.preferForcedSubs)}
|
|
762
|
+
function Rr(a,b){if("metadata"==b.kind){b.mode="hidden";a.m.G(b,"cuechange",function(){if(b.activeCues)for(var d=t(b.activeCues),e=d.next();!e.done;e=d.next())if(e=e.value,Wr(a,e.startTime,e.endTime,e.type,e.value),a.B)a.B.onCueMetadataChange(e.value)});var c=(new Tc(function(){var d=Xr(a);d=t(d);for(var e=d.next();!e.done;e=d.next())e.value.mode="hidden"})).Ce().Z(.5);a.jc.push(function(){c.stop()})}}
|
|
763
|
+
function zr(a,b,c,d){b=t(b);for(var e=b.next();!e.done;e=b.next())if(e=e.value,e.data&&"number"==typeof e.cueTime&&e.frames){var f=e.cueTime+c,g=d;g&&f>g&&(g=f);for(var h=t(e.frames),k=h.next();!k.done;k=h.next())Wr(a,f,g,"org.id3",k.value);if(a.B)a.B.onHlsTimedMetadata(e,f)}}function Wr(a,b,c,d,e){b=(new Map).set("startTime",b).set("endTime",c).set("metadataType",d).set("payload",e);a.dispatchEvent(cr("metadata",b))}
|
|
764
|
+
function Gr(a,b){if(b&&"chapters"==b.kind){b.mode="hidden";var c=(new Tc(function(){b.mode="hidden"})).Ce().Z(.5);a.jc.push(function(){c.stop()})}}r.bh=function(){for(var a=this.T;a.g;)a.release()};r.Ic=function(a){return new Al(a)};
|
|
765
|
+
function Xq(a,b){function c(e){b()?b().dispatchEvent(e):a.dispatchEvent(e)}function d(e){b()?Yo(b(),!0,e):e()}b||(b=function(){return null});return new Di(function(e,f,g,h){var k=b()?b().i:a.o;k&&k.segmentDownloaded(e,f,g,h)},function(e,f,g){f=(new Map).set("headers",e).set("request",f).set("requestType",g);c(cr("downloadheadersreceived",f));d(function(){if(a.$){var h=a.$;if(h.h.enabled){var k=e["cmsd-static"];if(k)try{var l=new Map,m=k.split(",");for(k=0;k<m.length;k++){var n=m[k].split("=");l.set(n[0],
|
|
766
|
+
Rq(n[1]))}}catch(v){}if(l=e["cmsd-dynamic"]){try{var q=new Map,p=l.split(";");for(l=1;l<p.length;l++){var u=p[l].split("=");q.set(u[0],Rq(u[1]))}var x=q}catch(v){x=null}x&&(h.g=x)}}}})},function(e,f,g,h){e=(new Map).set("request",e).set("error",f).set("httpResponseCode",g).set("aborted",h);c(cr("downloadfailed",e))},function(e,f,g){d(function(){var h=a.O,k=g;k=void 0===k?{}:k;if(h.g.enabled)if("HEAD"===f.method)Bq(h,f);else switch(e){case 0:try{if(h.g.enabled){if(k.type){a:{switch(k.type){case 4:var l=
|
|
767
|
+
"d";break a;case 3:case 2:l="h";break a;case 5:l="s";break a}l=void 0}h.m=l}Bq(h,f,{ot:gq,su:!h.i})}}catch(M){$a("CMCD_MANIFEST_ERROR","Could not generate manifest CMCD data.",M)}break;case Oi:try{if(h.g.enabled){var m=k.segment;l=0;m&&(l=m.endTime-m.startTime);var n={d:1E3*l,st:h.h.X()?"l":"v"};n.ot=Fq(k);var q=n.ot===Cq||n.ot===eq||n.ot===fq||n.ot===Hq,p=k.stream;if(p){var u=h.h.Ka();if(q&&(n.bl=Jq(h,p.type),n.ot!==Hq)){var x=Kq(h,p.type);n.dl=u?x/Math.abs(u):x}p.bandwidth&&(n.br=p.bandwidth/1E3);
|
|
768
|
+
if(p.segmentIndex&&m){var v=p.segmentIndex.mb(m.endTime,!0,0>u);if(v){var z=v.next().value;if(z&&z!=m){if(!Nb(m.J(),z.J())){var w=z.J()[0],E=f.uris[0],F=new URL(w),D=new URL(E);if(F.origin!==D.origin)var I=w;else{for(var A=F.pathname.split("/").slice(1),C=D.pathname.split("/").slice(1,-1);A[0]===C[0];)A.shift(),C.shift();for(;C.length;)C.shift(),A.unshift("..");I=A.join("/")}n.nor=I}if((z.Pa||z.qa)&&(m.Pa!=z.Pa||m.qa!=z.qa)){var B=z.Pa+"-";z.qa&&(B+=z.qa);n.nrr=B}}}var H=h.h.Ka()||1,G=Kq(h,p.type)||
|
|
769
|
+
500,N=p.bandwidth;var Q=N?N*(m.endTime-m.startTime)/1E3/(G/H/1E3)*h.g.rtpSafetyFactor:NaN;isNaN(Q)||(n.rtp=Q)}}q&&n.ot!==Hq&&(n.tb=Lq(h,n.ot)/1E3);Bq(h,f,n)}}catch(M){$a("CMCD_SEGMENT_ERROR","Could not generate segment CMCD data.",M)}break;case 2:case 5:case 6:Bq(h,f,{ot:"k"});break;case 4:Bq(h,f,{ot:"o"})}})},function(e,f,g,h){(e=b()?b().j:a.I)&&e.banLocation&&e.banLocation(h)},function(e,f){f.data&&(e=f.data.byteLength,f=b()?b().getStats():a.u)&&(f.vb=isNaN(f.vb)?e:f.vb+e)})}
|
|
770
|
+
function Ir(a,b){return new tn(a.h,a.i,a.g.streaming,b,function(){a.xa&&zn(a.xa,!0);a.j&&a.j.ac();a.M&&Yr(a)},function(c){return a.dispatchEvent(c)})}
|
|
771
|
+
function Jr(a,b){b=new lp(a.cb,a.X()||0<b);b.addEventListener("enter",function(d){ur(a,"timelineregionenter",d.region)});b.addEventListener("exit",function(d){ur(a,"timelineregionexit",d.region)});b.addEventListener("skip",function(d){var e=d.region;d.seeking||(ur(a,"timelineregionenter",e),ur(a,"timelineregionexit",e))});var c=new yn(a.h);c.g.add(b);a.bb&&c.g.add(a.bb);return c}
|
|
772
|
+
function Kr(a,b,c){a.M=new ll;a.M.g=nl;ol(a.M,c,Math.min(.5,c/2));jr(a);a.Wc=(new Tc(function(){Yr(a)})).Sa(.25);a.m.G(b,"waiting",function(){return Yr(a)});a.m.G(b,"stalled",function(){return Yr(a)});a.m.G(b,"canplaythrough",function(){return Yr(a)});a.m.G(b,"progress",function(){return Yr(a)})}
|
|
773
|
+
function Yr(a){switch(a.l){case Sr:if(a.uc())var b=!0;else{var c=hm(a.h.buffered);b=null!=c&&c>=a.h.duration-1}break;case Fr:a:if(a.uc()||Dm(a.C))b=!0;else{if(a.i.presentationTimeline.X()){c=a.i.presentationTimeline.oc();var d=hm(a.h.buffered);if(null!=d&&d>=c){b=!0;break a}}b=!1}break;default:b=!1}d=jm(a.h.buffered,a.h.currentTime);c=a.M;var e=b,f=c.i.get(c.g);b=c.g;d=e||d>=f?ml:nl;c.g=d;(b=b!=d)&&d===ml&&(c.h=Date.now());b&&jr(a)}function yr(a,b,c,d){return new ym(a,b,c,d)}
|
|
774
|
+
function Wq(a){return new aq({getBandwidthEstimate:function(){return a.o?a.o.getBandwidthEstimate():NaN},hb:function(){return a.hb()},getCurrentTime:function(){return a.h?a.h.currentTime:0},Ka:function(){return a.Ka()},Rd:function(){return a.Rd()},Db:function(){return a.Db()},X:function(){return a.X()}},a.g.cmcd)}
|
|
775
|
+
function Er(a){return new Xn(a.i,{mc:function(){return a.D?a.D.Ac():0},getBandwidthEstimate:function(){return a.o.getBandwidthEstimate()},Ka:function(){return a.Ka()},U:a.C,Gb:a.F,onError:function(b){return hr(a,b)},onEvent:function(b){return a.dispatchEvent(b)},Vg:function(){a.I&&a.I.update&&a.I.update()},ge:function(b,c){var d=b.startTime,e=b.endTime,f=c.type,g=c.codecs.includes(",");if(f!=Qd){if(a.D){a.D.kf();var h=Im(a.C,f);!a.X()&&a.h.paused&&null!=h&&0<h&&a.D.Ac()<h&&a.D.pd(h)}Yr(a)}d=(new Map).set("start",
|
|
776
|
+
d).set("end",e).set("contentType",f).set("isMuxed",g);a.dispatchEvent(cr("segmentappended",d));a.o&&c.fastSwitching&&b.Yb&&b.Xc&&a.o.trySuggestStreams()},Ug:function(b,c){(c=c.be)&&a.bb&&Vn(a.bb,c,b)},Ne:function(b,c){var d=a.A;if(d.h.parseInbandPsshEnabled&&!d.D&&["audio","video"].includes(b)){b=new $i(yb(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,
|
|
777
|
+
e),e+=f.length;Ol(d,"cenc",c);d=d.m}}else d=Promise.resolve();return d},dd:function(b,c,d){zr(a,b,c,d)},Jc:function(b,c){return a.Jc(b,c)}})}
|
|
778
|
+
r.configure=function(a,b){2==arguments.length&&"string"==typeof a&&(a=Jo(a,b));a.streaming&&"forceTransmuxTS"in a.streaming&&(pb("streaming.forceTransmuxTS configuration","Please Use mediaSource.forceTransmux instead."),a.mediaSource.mediaSource=a.streaming.forceTransmuxTS,delete a.streaming.forceTransmuxTS);a.streaming&&"forceTransmux"in a.streaming&&(pb("streaming.forceTransmux configuration","Please Use mediaSource.forceTransmux instead."),a.mediaSource.mediaSource=a.streaming.forceTransmux,delete a.streaming.forceTransmux);
|
|
779
|
+
a.streaming&&"useNativeHlsOnSafari"in a.streaming&&pb("streaming.useNativeHlsOnSafari configuration","Please Use streaming.useNativeHlsForFairPlay or streaming.preferNativeHls instead.");if(a.mediaSource&&"sourceBufferExtraFeatures"in a.mediaSource){pb("mediaSource.sourceBufferExtraFeatures configuration","Please Use mediaSource.addExtraFeaturesToSourceBuffer() instead.");var c=a.mediaSource.sourceBufferExtraFeatures;a.mediaSource.addExtraFeaturesToSourceBuffer=function(){return c};delete a.mediaSource.sourceBufferExtraFeatures}a.streaming&&
|
|
780
|
+
a.streaming.lowLatencyMode&&(void 0==a.streaming.inaccurateManifestTolerance&&(a.streaming.inaccurateManifestTolerance=0),void 0==a.streaming.rebufferingGoal&&(a.streaming.rebufferingGoal=.01),void 0==a.streaming.segmentPrefetchLimit&&(a.streaming.segmentPrefetchLimit=2),void 0==a.streaming.updateIntervalSeconds&&(a.streaming.updateIntervalSeconds=.1),void 0==a.streaming.maxDisabledTime&&(a.streaming.maxDisabledTime=1),void 0==a.streaming.retryParameters&&(a.streaming.retryParameters={}),void 0==
|
|
781
|
+
a.streaming.retryParameters.baseDelay&&(a.streaming.retryParameters.baseDelay=100),void 0==a.manifest&&(a.manifest={}),void 0==a.manifest.dash&&(a.manifest.dash={}),void 0==a.manifest.dash.autoCorrectDrift&&(a.manifest.dash.autoCorrectDrift=!1),void 0==a.manifest.retryParameters&&(a.manifest.retryParameters={}),void 0==a.manifest.retryParameters.baseDelay&&(a.manifest.retryParameters.baseDelay=100),void 0==a.drm&&(a.drm={}),void 0==a.drm.retryParameters&&(a.drm.retryParameters={}),void 0==a.drm.retryParameters.baseDelay&&
|
|
782
|
+
(a.drm.retryParameters.baseDelay=100));var d=Wo(this.g,a,Vq(this));Zr(this);return d};
|
|
783
|
+
function Zr(a){a.Uc=new sm(a.g,a.aa,a.A);if(a.I){var b=He(a.g.manifest);a.h&&"AUDIO"===a.h.nodeName&&(b.disableVideo=!0);a.I.configure(b)}a.A&&a.A.configure(a.g.drm);if(a.j){a.j.configure(a.g.streaming);try{a.l!=dr&&um(a.Uc,a.i)&&vr(a)}catch(f){hr(a,f)}a.o&&wr(a);b=a.j.j;!b||b.allowedByApplication&&b.allowedByKeySystem||xr(a)}a.F&&(a.F.ue(a.g.streaming.forceHTTP),a.F.ve(a.g.streaming.forceHTTPS));if(a.C)if(a.C.configure(a.g.mediaSource),a.C.ja=a.g.manifest.segmentRelativeVttTiming,b=a.g.textDisplayFactory,
|
|
784
|
+
a.qe!=b){var c=b();c.configure?c.configure(a.g.textDisplayer):pb("Text displayer w/ configure",'Text displayer should have a "configure" method!');var d=a.C,e=d.D;d.D=c;e&&(c.setTextVisibility(e.isTextVisible()),e.destroy());d.h&&(d.h.j=c);a.qe=b;a.j&&(b=a.j,(c=b.i.get(Qd))&&ko(b,c.stream,!0,0,!0))}else b=a.C.D,b.configure&&b.configure(a.g.textDisplayer);a.o&&(a.o.configure(a.g.abr),a.g.abr.enabled?a.o.enable():a.o.disable(),Or(a));a.M&&(b=a.g.streaming.rebufferingGoal,a.i&&(b=Math.max(b,a.i.minBufferTime)),
|
|
785
|
+
ol(a.M,b,Math.min(.5,b/2)));a.i&&Cr(a.i.presentationTimeline,a.g.playRangeStart,a.g.playRangeEnd);a.B&&a.B.configure(a.g.ads);a.O&&a.O.configure(a.g.cmcd);a.$&&a.$.configure(a.g.cmsd)}r.getConfiguration=function(){var a=Vq(this);Wo(a,this.g,Vq(this));return a};r.rg=function(){var a=Vq(this);Wo(a,this.g,Vq(this));return Lo(this.g,Vq(this))};
|
|
786
|
+
r.Se=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.Oa().end);if(a>=b)return 1;if(!(a<=this.h.currentTime)&&a<b)return(a-this.h.currentTime)/(b-this.h.currentTime)}return 0};r.dh=function(){for(var a in this.g)delete this.g[a];Wo(this.g,Vq(this),Vq(this));Zr(this)};r.ng=function(){return this.l};r.Qd=function(){return this.i?this.i.type:null};r.qg=function(){return this.h};
|
|
787
|
+
r.Rd=function(){return this.F};r.Nc=function(){return this.W};r.cg=function(){return this.B?this.B:null};r.X=function(){return this.i?this.i.presentationTimeline.X():this.h&&this.h.src?Infinity==this.h.duration:!1};r.Vb=function(){return this.i?this.i.presentationTimeline.Vb():!1};r.Ig=function(){if(this.i){var a=this.i.variants;return a.length?!a[0].video:!1}return this.h&&this.h.src?this.h.videoTracks?0==this.h.videoTracks.length:0==this.h.videoHeight:!1};
|
|
788
|
+
r.Oa=function(){if(this.i){if(!this.ma&&"HLS"==this.i.type)return{start:0,end:0};var a=this.i.presentationTimeline;return{start:a.pb(),end:a.Va()}}if(this.h&&this.h.src&&(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}};r.Fg=function(){this.X()&&(this.h.currentTime=this.Oa().end)};
|
|
789
|
+
r.keySystem=function(){var a=this.drmInfo();return a?a.keySystem:""};r.drmInfo=function(){return this.A?this.A.g:null};r.Od=function(){return this.A?this.A.Od():Infinity};r.Nd=function(){return this.A?this.A.Nd():[]};r.Oc=function(){return this.A?this.A.Oc():{}};r.Ze=function(){return this.M?this.M.g==nl:!1};r.Ka=function(){return this.h?this.H?this.H.i:1:0};
|
|
790
|
+
r.xc=function(a){0==a?Za("A trick play rate of 0 is unsupported!"):(this.H.set(a),this.l==Fr&&(this.o.playbackRateChanged(a),jo(this.j,1<Math.abs(a))),$r(this,a))};r.cc=function(){var a=this.H.yb();this.l==Sr&&this.H.set(a);this.l==Fr&&(this.H.set(a),this.o.playbackRateChanged(a),jo(this.j,!1));this.ra.Za()};
|
|
791
|
+
r.Db=function(){if(this.i){for(var a=this.j?this.j.j:null,b=[],c=0,d=t(this.i.variants),e=d.next();!e.done;e=d.next())if(e=e.value,rf(e)){var f=ef(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}return this.h&&this.h.audioTracks?Array.from(this.h.audioTracks).map(function(g){return mf(g)}):[]};
|
|
792
|
+
r.Sb=function(){if(this.i){for(var a=this.j?this.j.u:null,b=[],c=t(this.i.textStreams),d=c.next();!d.done;d=c.next()){d=d.value;var e=ff(d);e.active=d==a;b.push(e)}return b}return this.h&&this.h.src&&this.h.textTracks?Ur(this).map(function(f){return kf(f)}):[]};r.kg=function(){var a=this.tc;this.i&&(a=this.i.imageStreams);return a.map(function(b){return gf(b)})};
|
|
793
|
+
r.dg=function(a){var b=this,c,d,e;return L(function(f){if(1==f.g){if(b.l!=Fr&&b.l!=Sr)return f.return(null);c=b.tc;b.i&&(c=b.i.imageStreams);return(d=c.find(function(g){return g.id==a}))?d.segmentIndex?f.s(2):J(f,d.createSegmentIndex(),2):f.return(null)}e=[];d.segmentIndex.Rb(function(g){var h=as(g.tilesLayout||d.tilesLayout);if(h){h=h.rows*h.wb;for(var k=g.l-g.startTime,l=0;l<h;l++){var m=bs(d,g.startTime+k*l/h);m&&e.push(m)}}});d.closeSegmentIndex&&d.closeSegmentIndex();return f.return(e)})};
|
|
794
|
+
function as(a){return a?(a=/(\d+)x(\d+)/.exec(a))?{wb:parseInt(a[1],10),rows:parseInt(a[2],10)}:null:null}r.Ag=function(a,b){var c=this,d,e;return L(function(f){if(1==f.g){if(c.l!=Fr&&c.l!=Sr)return f.return(null);d=c.tc;c.i&&(d=c.i.imageStreams);return(e=d.find(function(g){return g.id==a}))?e.segmentIndex?f.s(2):J(f,e.createSegmentIndex(),2):f.return(null)}return f.return(bs(e,b))})};
|
|
795
|
+
function bs(a,b){var c=a.segmentIndex.find(b);if(null==c)return null;c=a.segmentIndex.get(c);var d=as(c.tilesLayout||a.tilesLayout);if(!d)return null;var e=a.width||0;a=a.height||0;var f=e/d.wb,g=a/d.rows,h=d.wb*d.rows,k=c.l-c.startTime;k=c.A||k/h;var l=c.startTime,m=0,n=0;1<h&&(b=Math.floor((b-c.startTime)/k),l=c.startTime+b*k,m=b%d.wb*f,n=Math.floor(b/d.wb)*g);b=!1;if(d=c.u)b=!0,g=d.height,m=d.positionX,n=d.positionY,f=d.width;return{segment:c,imageHeight:a,imageWidth:e,height:g,positionX:m,positionY:n,
|
|
796
|
+
startTime:l,duration:k,uris:c.J(),width:f,sprite:b}}r.yf=function(a){if(this.i&&this.j){var b=this.i.textStreams.find(function(d){return d.id==a.id});b&&b!=this.j.u&&(En(this.u.h,b,!1),mo(this.j,b),cs(this),this.va=b.language)}else if(this.h&&this.h.src&&this.h.textTracks){b=Ur(this);b=t(b);for(var c=b.next();!c.done;c=b.next())c=c.value,hf(c)==a.id?c.mode=this.ba?"showing":"hidden":c.mode="disabled";cs(this)}};
|
|
797
|
+
r.te=function(a,b,c){b=void 0===b?!1:b;c=void 0===c?0:c;if(this.i&&this.j){var d=this.i.variants.find(function(f){return f.id==a.id});if(d&&rf(d)){var e=this.j.j;this.g.abr.enabled&&(e.video!=d.video||e.audio&&d.audio&&e.audio.language==d.audio.language&&e.audio.channelsCount==d.audio.channelsCount)&&Za("Changing tracks while abr manager is enabled will likely result in the selected track being overriden. Consider disabling abr before calling selectVariantTrack().");Dr(this,d,!1,b,c);this.la=new bl(d,
|
|
798
|
+
this.g.mediaSource.codecSwitchingStrategy,this.g.manifest.dash.enableAudioGroups);wr(this)}}else if(this.h&&this.h.audioTracks)for(b=Array.from(this.h.audioTracks),b=t(b),c=b.next();!c.done;c=b.next())if(c=c.value,hf(c)==a.id){ds(this,c);break}};r.fg=function(){return es(this.Db())};r.xg=function(){return es(this.Sb())};r.eg=function(){return Array.from(fs(this.Db()))};r.wg=function(){return Array.from(fs(this.Sb()))};
|
|
799
|
+
r.wf=function(a,b,c,d){c=void 0===c?0:c;d=void 0===d?0:d;if(this.i&&this.D){this.la=new cl(a,b||"",c,"",!1,"","","",this.g.mediaSource.codecSwitchingStrategy,this.g.manifest.dash.enableAudioGroups);a=function(g,h){return g.video||h.video?g.video&&h.video?Math.abs((g.video.height||0)-(h.video.height||0))+Math.abs((g.video.width||0)-(h.video.width||0)):Infinity:0};b=this.j.j;var e=this.la.create(this.i.variants);c=null;e=t(e.values());for(var f=e.next();!f.done;f=e.next())if(f=f.value,!c||a(c,b)>a(f,
|
|
800
|
+
b))c=f;c!=b&&(c?(a=ef(c),this.te(a,!0,d)):xr(this))}else this.h&&this.h.audioTracks&&(d=tf(this.Db(),a,b||"",!1)[0])&&this.te(d)};r.xf=function(a,b,c){c=void 0===c?!1:c;if(this.i&&this.D){if(this.va=a,this.pc=b||"",this.kc=c,(a=tf(this.i.textStreams,this.va,this.pc,this.kc)[0]||null)&&a!=this.j.u&&(En(this.u.h,a,!1),this.g.streaming.alwaysStreamText||this.Vd()))mo(this.j,a),cs(this)}else(a=tf(this.Sb(),a,b||"",c)[0])&&this.yf(a)};
|
|
801
|
+
r.hh=function(a,b,c){b=void 0===b?!0:b;c=void 0===c?0:c;if(this.i&&this.D){for(var d=null,e=t(this.i.variants),f=e.next();!f.done;f=e.next())if(f=f.value,f.audio.label==a){d=f;break}null!=d&&(this.la=new cl(d.language,"",0,"",!1,"",a,"",this.g.mediaSource.codecSwitchingStrategy,this.g.manifest.dash.enableAudioGroups),xr(this,b,c))}else if(this.h&&this.h.audioTracks){c=Array.from(this.h.audioTracks);b=null;c=t(c);for(d=c.next();!d.done;d=c.next())d=d.value,d.label==a&&(b=d);b&&ds(this,b)}};
|
|
802
|
+
r.Vd=function(){var a=this.ba;return this.C&&this.l==Fr?this.C.D.isTextVisible():this.h&&this.h.src&&this.h.textTracks?Ur(this).some(function(b){return"showing"==b.mode}):a};r.Te=function(){return this.h&&this.h.src&&this.h.textTracks?gs(this).map(function(a){return kf(a)}):[]};
|
|
803
|
+
r.gg=function(a){if(!this.h||!this.h.src||!this.h.textTracks)return[];var b=ze(a),c=gs(this).filter(function(h){return ze(h.language)==b});if(!c||!c.length)return[];a=[];var d=new Set;c=t(c);for(var e=c.next();!e.done;e=c.next())if((e=e.value)&&e.cues){e=t(e.cues);for(var f=e.next();!f.done;f=e.next()){var g=f.value;(f=g.id)&&""!=f||(f=g.startTime+"-"+g.endTime+"-"+g.text);g={id:f,title:g.text,startTime:g.startTime,endTime:g.endTime};d.has(f)||(a.push(g),d.add(f))}}return a};
|
|
804
|
+
function Ur(a){return Array.from(a.h.textTracks).filter(function(b){return"metadata"!=b.kind&&"chapters"!=b.kind&&"Shaka Player TextTrack"!=b.label})}function Xr(a){return Array.from(a.h.textTracks).filter(function(b){return"metadata"==b.kind})}function gs(a){return Array.from(a.h.textTracks).filter(function(b){return"chapters"==b.kind})}
|
|
805
|
+
r.nh=function(a){a=!!a;if(this.ba!=a){this.ba=a;if(this.l==Fr)this.C.D.setTextVisibility(a),this.g.streaming.alwaysStreamText||(a?this.j.u||(a=tf(this.i.textStreams,this.va,this.pc,this.kc),0<a.length&&(mo(this.j,a[0]),cs(this))):io(this.j));else if(this.h&&this.h.src&&this.h.textTracks){var b=Ur(this);b=t(b);for(var c=b.next();!c.done;c=b.next())c=c.value,"disabled"!=c.mode&&(c.mode=a?"showing":"hidden")}Nr(this)}};
|
|
806
|
+
r.sg=function(){if(this.D)var a=this.D.Ac();else{if(null==this.fa)return new Date;a=this.fa}if(this.i){var b=this.i.presentationTimeline;return new Date(1E3*((b.B||b.i)+a))}return this.h&&this.h.getStartDate?(b=this.h.getStartDate(),isNaN(b.getTime())?null:new Date(b.getTime()+1E3*a)):null};r.We=function(){if(this.i){var a=this.i.presentationTimeline;return new Date(1E3*(a.B||a.i))}return this.h&&this.h.getStartDate?(a=this.h.getStartDate(),isNaN(a.getTime())?null:a):null};
|
|
807
|
+
r.Qc=function(){return this.X()?this.i?this.i.presentationTimeline.Qc():null:null};r.hb=function(){if(this.l==Fr)return this.C.hb();var a={total:[],audio:[],video:[],text:[]};this.l==Sr&&(a.total=km(this.h.buffered));return a};
|
|
808
|
+
r.getStats=function(){if(this.l!=Fr&&this.l!=Sr)return{width:NaN,height:NaN,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,bytesDownloaded:NaN,switchHistory:[],stateHistory:[]};Ar(this);var a=this.h,b=a.currentTime/a.duration;if(!isNaN(b)&&
|
|
809
|
+
!this.X()){var c=this.u;b=Math.round(100*b);c.i=isNaN(c.i)?b:Math.max(c.i,b)}this.D&&(this.u.M=this.D.He(),this.u.O=this.D.Ie());if(a.getVideoPlaybackQuality){c=a.getVideoPlaybackQuality();b=this.u;var d=Number(c.totalVideoFrames);b.L=Number(c.droppedVideoFrames);b.I=d;this.u.H=Number(c.corruptedVideoFrames)}this.A?(c=this.A,c=c.H?c.H:NaN):c=NaN;this.u.u=c;if(this.l==Fr){c=this.j.j;b=this.j.u;if(c){d=this.H?this.H.i:1;var e=d*c.bandwidth;b&&b.bandwidth&&(e+=d*b.bandwidth);this.u.B=e}c&&c.video&&(b=
|
|
810
|
+
this.u,d=c.video.height||NaN,b.o=c.video.width||NaN,b.l=d);this.X()&&(c=this.We().valueOf()+1E3*a.currentTime,this.u.C=(Date.now()-c)/1E3);this.i&&this.i.presentationTimeline&&(this.u.F=this.i.presentationTimeline.g);c=this.o.getBandwidthEstimate();this.u.A=c}this.l==Sr&&(c=this.u,c.vb=isNaN(c.vb)?NaN:c.vb+NaN,c=this.u,b=a.videoHeight||NaN,c.o=a.videoWidth||NaN,c.l=b);var f=this.u;a=f.o;c=f.l;b=f.B;d=f.I;e=f.L;var g=f.H,h=f.O,k=f.M,l=f.A,m=f.i,n=f.m,q=f.D,p=f.j,u=Bn(f.g,"playing"),x=Bn(f.g,"paused"),
|
|
811
|
+
v=Bn(f.g,"buffering"),z=f.u,w=f.C,E=f.F,F=f.vb,D=Cn(f.g),I=[];f=t(f.h.g);for(var A=f.next();!A.done;A=f.next())A=A.value,I.push({timestamp:A.timestamp,id:A.id,type:A.type,fromAdaptation:A.fromAdaptation,bandwidth:A.bandwidth});return{width:a,height:c,streamBandwidth:b,decodedFrames:d,droppedFrames:e,corruptedFrames:g,stallsDetected:h,gapsJumped:k,estimatedBandwidth:l,completionPercent:m,loadLatency:n,manifestTimeSeconds:q,drmTimeSeconds:p,playTime:u,pauseTime:x,bufferingTime:v,licenseTime:z,liveLatency:w,
|
|
812
|
+
maxSegmentDuration:E,bytesDownloaded:F,stateHistory:D,switchHistory:I}};
|
|
813
|
+
r.Qf=function(a,b,c,d,e,f,g){g=void 0===g?!1:g;var h=this,k,l,m,n,q,p,u,x,v,z,w,E,F;return L(function(D){switch(D.g){case 1:if(h.l!=Fr&&h.l!=Sr)throw new S(1,7,7004);"subtitles"!=c&&"captions"!=c&&Za("Using a kind value different of `subtitles` or `captions` can cause unwanted issues.");if(d){D.s(2);break}return J(D,hs(h,a),3);case 3:d=D.h;case 2:k=[];h.B&&(k=h.B.getCuePoints());if(h.l!=Sr){D.s(4);break}g&&(c="forced");return J(D,is(h,a,b,c,d,f||"",k),5);case 5:l=ze(b);m=h.Sb();if(n=m.find(function(I){return ze(I.language)==
|
|
814
|
+
l&&I.label==(f||"")&&I.kind==c}))return vr(h),D.return(n);throw new S(1,2,2012);case 4:q=Sd;p=h.Oa();u=p.end-p.start;h.i&&(u=h.i.presentationTimeline.getDuration());if(Infinity==u)throw new S(1,4,4033);if(!k.length){D.s(6);break}return J(D,js(h,a,h.F,h.g.streaming.retryParameters),7);case 7:x=D.h,v=ks(h,x,d,k),z=new Blob([v],{type:"text/vtt"}),a=Bm(z),d="text/vtt";case 6:w={id:h.Ae++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:ni(0,u,[a]),mimeType:d||
|
|
815
|
+
"",codecs:e||"",kind:c,encrypted:!1,drmInfos:[],keyIds:new Set,language:b,originalLanguage:b,label:f||null,type:q.pa,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!!g,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([Ud(d||"",e||"")])};E=Ud(w.mimeType,w.codecs);F=me(E);if(!F)throw new S(2,2,2014,d);h.i.textStreams.push(w);vr(h);return D.return(ff(w))}})};
|
|
816
|
+
r.Rf=function(a,b){var c=this,d,e,f,g,h,k,l,m,n,q,p,u,x,v,z,w,E,F;return L(function(D){switch(D.g){case 1:if(c.l!=Fr&&c.l!=Sr)throw new S(1,7,7004);if(b){D.s(2);break}return J(D,hs(c,a),3);case 3:b=D.h;case 2:if("text/vtt"!=b)throw new S(1,2,2017,a);d=Sd;e=c.Oa();f=e.end-e.start;c.i&&(f=c.i.presentationTimeline.getDuration());if(Infinity==f)throw new S(1,4,4045);return J(D,js(c,a,c.F,c.g.streaming.retryParameters),4);case 4:g=D.h;h=ne[b];if(!h)throw new S(2,2,2014,b);k=h();l={periodStart:0,segmentStart:0,
|
|
817
|
+
segmentEnd:f,vttOffset:0};m=yb(g);n=k.parseMedia(m,l,a);q=[];p=t(n);u=p.next();for(x={};!u.done;x={ld:void 0,Qb:void 0},u=p.next())x.Qb=u.value,x.ld=null,v=function(I){return function(){null==I.ld&&(I.ld=Kd([a],[I.Qb.payload]));return I.ld||[]}}(x),z=new gi(x.Qb.startTime,x.Qb.endTime,v,0,null,null,0,0,Infinity),x.Qb.payload.includes("#xywh")&&(w=x.Qb.payload.split("#xywh=")[1].split(","),4===w.length&&z.Df({height:parseInt(w[3],10),positionX:parseInt(w[0],10),positionY:parseInt(w[1],10),width:parseInt(w[2],
|
|
818
|
+
10)})),q.push(z);E=b;if(!q.length){D.s(5);break}return J(D,Ep(q[0].J()[0],c.F,c.g.manifest.retryParameters),6);case 6:E=D.h;case 5:return F={id:c.Ae++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new li(q),mimeType:E||"",codecs:"",kind:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"und",originalLanguage:null,label:null,type:d.Nf,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,
|
|
819
|
+
spatialAudio:!1,closedCaptions:null,tilesLayout:"1x1",accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([Ud(E||"","")])},c.l==Sr?c.tc.push(F):c.i.imageStreams.push(F),vr(c),D.return(gf(F))}})};
|
|
820
|
+
r.Pf=function(a,b,c){var d=this,e,f,g,h;return L(function(k){switch(k.g){case 1:if(d.l!=Fr&&d.l!=Sr)throw new S(1,7,7004);if(c){k.s(2);break}return J(k,hs(d,a),3);case 3:c=k.h;case 2:return e=[],d.B&&(e=d.B.getCuePoints()),J(k,is(d,a,b,"chapters",c,"",e),4);case 4:f=k.h;g=d.Te();h=g.find(function(l){return l.language==b});if(!h){k.s(5);break}return J(k,new Promise(function(l,m){d.m.Aa(f,"load",l);d.m.Aa(f,"error",function(){m(new S(1,2,2015))})}),6);case 6:return vr(d),k.return(h);case 5:throw new S(1,
|
|
821
|
+
2,2012);}})};function hs(a,b){var c;return L(function(d){switch(d.g){case 1:return wa(d,2),J(d,Ep(b,a.F,a.g.streaming.retryParameters),4);case 4:c=d.h;xa(d,3);break;case 2:ya(d);case 3:if(c)return d.return(c);throw new S(1,2,2011,b);}})}
|
|
822
|
+
function is(a,b,c,d,e,f,g){var h,k,l,m;return L(function(n){if(1==n.g)return"text/vtt"!=e||g.length?J(n,js(a,b,a.F,a.g.streaming.retryParameters),3):n.s(2);2!=n.g&&(h=n.h,k=ks(a,h,e,g),l=new Blob([k],{type:"text/vtt"}),b=Bm(l),e="text/vtt");m=document.createElement("track");var q=a.O,p=b;try{if(q.g.enabled){var u=dq(q);u.ot=Iq;u.su=!0;var x=hq(u);var v=iq(p,x)}else v=p}catch(z){$a("CMCD_TEXT_TRACK_ERROR","Could not generate text track CMCD data.",z),v=p}m.src=v;m.label=f;m.kind=d;m.srclang=c;a.h.getAttribute("crossorigin")||
|
|
823
|
+
a.h.setAttribute("crossorigin","anonymous");a.h.appendChild(m);return n.return(m)})}function js(a,b,c,d){var e,f,g;return L(function(h){if(1==h.g){e=Oi;f=Ii([b],d);f.method="GET";var k=a.O;try{k.g.enabled&&Bq(k,f,{ot:Iq,su:!0})}catch(l){$a("CMCD_TEXT_ERROR","Could not generate text CMCD data.",l)}return J(h,c.request(e,f).promise,2)}g=h.h;return h.return(g.data)})}
|
|
824
|
+
function ks(a,b,c,d){var e=ne[c];if(e)return c=e(),a={periodStart:0,segmentStart:0,segmentEnd:a.h.duration,vttOffset:0},b=yb(b),b=c.parseMedia(b,a,null),$p(b,d);throw new S(2,2,2014,c);}r.lh=function(a,b){this.aa.width=a;this.aa.height=b};r.pe=function(a){if(this.l==Fr){var b=this.j;a=void 0===a?.1:a;if(b.m.g)b=!1;else if(b.A)b=!1;else{for(var c=t(b.i.values()),d=c.next();!d.done;d=c.next())d=d.value,!d.rc||d.Ba||d.ab||(d.rc=!1,ho(b,d,a));b=!0}}else b=!1;return b};
|
|
825
|
+
r.Pd=function(){Za("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};r.og=function(){return this.wa};
|
|
826
|
+
function Vq(a){var b=So();b.streaming.failureCallback=function(c){if(a.X()){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.pe(d))}};b.textDisplayFactory=function(){return!a.Vc||kd()&&!document.fullscreenEnabled?HTMLMediaElement.prototype.addTextTrack?new Lp(a.h,"Shaka Player TextTrack"):new Np:new Qp(a.h,a.Vc)};return b}r.ph=function(a){this.Vc=a};
|
|
827
|
+
function tr(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 oi,l=e.closedCaptions.get(g);h={id:a.Ae++,originalId:g,groupId:null,
|
|
828
|
+
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:Qd,primary:!1,trickModeVideo: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([Ud(h,"")])};b.textStreams.push(h);c.add(g)}}
|
|
829
|
+
function Lr(a,b){var c,d,e,f,g;return L(function(h){if(1==h.g)return c=a.audio,d=a.video,e=function(k,l){var m,n,q;return L(function(p){if(1==p.g)return k?J(p,k.createSegmentIndex(),2):p.return(null);n=(m=k.segmentIndex.mb(l))?m.next().value:null;if(!n)return p.return(null);q=n.startTime;return p.return(q)})},J(h,e(c,b),2);if(3!=h.g)return f=h.h,J(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)})}
|
|
830
|
+
function jr(a){var b=a.Ze();if(a.u&&a.M&&a.D){var c=a.H;c.j=b;hn(c);a.O&&(c=a.O,b||c.i||(c.i=!0),c.i&&b&&(c.j=!0),c.l=b);Ar(a)}b=(new Map).set("buffering",b);a.dispatchEvent(cr("buffering",b))}function Br(a){var b=a.h.playbackRate;0!=b&&(a.H&&(a.H.set(b),a.l==Fr&&a.o.playbackRateChanged(b),$r(a,b)),b=cr("ratechange"),a.dispatchEvent(b))}
|
|
831
|
+
function $r(a,b){a.ra.Za();a.X()&&a.ra.G(a.h,"timeupdate",function(){var c=a.h.currentTime,d=a.Oa(),e=a.g.streaming.safeSeekOffset;0<b?Math.floor(c)>=Math.floor(d.end)&&a.cc():Math.floor(c)<=Math.floor(d.start+e)&&a.cc()})}
|
|
832
|
+
function Ar(a){if(a.u&&a.M){var b=a.u.g,c="playing";a.M.g==nl?c="buffering":a.uc()?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(cr("statechanged",c)))}}
|
|
833
|
+
function Pr(a){var b=a.h.playbackRate,c=a.X();if(a.g.streaming.vodDynamicPlaybackRate&&!c){var d=a.g.streaming.vodDynamicPlaybackRateLowBufferRate,e=a.Se();e<=a.g.streaming.vodDynamicPlaybackRateBufferRatio?b!=d&&a.xc(d):1==e&&b!==a.H.yb()&&a.cc()}if(c&&(e=a.Oa(),Number.isFinite(e.end)&&!(a.h.currentTime<e.start||a.h.paused))){if(a.g.streaming.liveSync){var f=a.g.streaming.liveSyncMaxLatency;var g=a.g.streaming.liveSyncPlaybackRate}else a.i&&a.i.serviceDescription&&(f=a.g.streaming.liveSyncMaxLatency,
|
|
834
|
+
null!=a.i.serviceDescription.targetLatency?f=a.i.serviceDescription.targetLatency+a.g.streaming.liveSyncTargetLatencyTolerance:null!=a.i.serviceDescription.maxLatency&&(f=a.i.serviceDescription.maxLatency),g=a.i.serviceDescription.maxPlaybackRate||a.g.streaming.liveSyncPlaybackRate);if(a.g.streaming.liveSync){var h=a.g.streaming.liveSyncMinLatency;var k=a.g.streaming.liveSyncMinPlaybackRate}else a.i&&a.i.serviceDescription&&(h=a.g.streaming.liveSyncMinLatency,null!=a.i.serviceDescription.targetLatency?
|
|
835
|
+
h=a.i.serviceDescription.targetLatency-a.g.streaming.liveSyncTargetLatencyTolerance:null!=a.i.serviceDescription.minLatency&&(h=a.i.serviceDescription.minLatency),k=a.i.serviceDescription.minPlaybackRate||a.g.streaming.liveSyncMinPlaybackRate);c=e.end-a.h.currentTime;d=0;if(a.l==Sr){var l=a.h.buffered;0<l.length&&(d=l.end(l.length-1),d=Math.max(g,d-e.end))}e=a.g.streaming.liveSyncPanicMode;l=1E3*a.g.streaming.liveSyncPanicThreshold;var m=Date.now()-a.M.h;e&&!k&&(k=a.g.streaming.liveSyncMinPlaybackRate);
|
|
836
|
+
e&&k&&m<=l?b!=k&&a.xc(k):f&&g&&c-d>f?b!=g&&a.xc(g):h&&k&&c-d<h?b!=k&&a.xc(k):b!==a.H.yb()&&a.cc()}}
|
|
837
|
+
function Qr(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.he<e?(a.he=e,!0):!1},c=a.Oa();c=c.end-c.start;c=0<c?a.h.currentTime/c:0;if(!isNaN(c)){c*=100;if(b(0,c))var d=cr("started");else b(25,c)?d=cr("firstquartile"):b(50,c)?d=cr("midpoint"):b(75,c)?d=cr("thirdquartile"):(b(100,c)&&(d=cr("complete")),a.g&&Infinity!=a.g.playRangeEnd&&a.uc()&&a.h.pause());d&&a.dispatchEvent(d)}}}
|
|
838
|
+
function wr(a){try{wm(a.Uc,a.i)}catch(c){return hr(a,c),!1}var b=sf(a.i.variants);b=a.la.create(b);a.o.setVariants(Array.from(b.values()));return!0}function Hr(a,b){b=void 0===b?!1:b;return wr(a)?a.o.chooseVariant(b):null}
|
|
839
|
+
function $q(a){function b(g){var h="";g.video&&(h+="video:"+g.video.id);g.audio&&(h=h+(h?"&":"")+("audio:"+g.audio.id));return h}for(var c=Date.now()/1E3,d=!1,e=t(a.i.variants),f=e.next();!f.done;f=e.next())f=f.value,0<f.disabledUntilTime&&f.disabledUntilTime<=c&&(f.disabledUntilTime=0,d=!0,cb("Re-enabled variant with "+b(f)));a.i.variants.every(function(g){return 0===g.disabledUntilTime})&&a.Yc.stop();d&&xr(a,!1,void 0,!1,!1)}
|
|
840
|
+
function xr(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=Hr(a);f&&Dr(a,f,e,b,c,d)}
|
|
841
|
+
function Dr(a,b,c,d,e,f){f=void 0===f?!1:f;var g=a.j.j;if(b==g)d&&lo(a.j,b,d,e,!0);else{var h=a.u.h;h.h!=b&&(h.h=b,h.g.push({timestamp:Date.now()/1E3,id:b.id,type:"variant",fromAdaptation:c,bandwidth:b.bandwidth}));lo(a.j,b,d,e,f,c);d=null;g&&(d=ef(g));b=ef(b);b.active=!0;c?(c=(new Map).set("oldTrack",d).set("newTrack",b),a.L&&Xk(a.L,b,a.Qd()),c=cr("adaptation",c),ls(a,c)):ms(a,d,b)}}
|
|
842
|
+
function ds(a,b){var c=Array.from(a.h.audioTracks).find(function(d){return d.enabled});b.enabled=!0;c&&(b.id!==c.id&&(c.enabled=!1),c=mf(c),b=mf(b),ms(a,c,b))}function Mr(a,b,c){if(0==a.g.autoShowText)return!1;if(1==a.g.autoShowText)return!0;var d=ze(a.g.preferredTextLanguage);c=ze(c.language);if(2==a.g.autoShowText)return ye(c,d);if(3==a.g.autoShowText){if(!b)return!1;a=ze(b.language);return ye(c,d)&&!ye(a,c)}Za("Invalid autoShowText setting!");return!1}
|
|
843
|
+
function vr(a){var b=cr("trackschanged");ls(a,b)}function ms(a,b,c){b=(new Map).set("oldTrack",b).set("newTrack",c);a.L&&Xk(a.L,c,a.Qd());c=cr("variantchanged",b);ls(a,c)}function cs(a){var b=cr("textchanged");ls(a,b)}function Nr(a){var b=cr("texttrackvisibility");ls(a,b)}function Or(a){a.g.abr.enabled||Zq(a);var b=(new Map).set("newStatus",a.g.abr.enabled);ls(a,cr("abrstatuschanged",b))}
|
|
844
|
+
function Zq(a,b){b=void 0===b?!0:b;if(a.l==Fr){a.Yc.stop();for(var c=t(a.i.variants),d=c.next();!d.done;d=c.next())d.value.disabledUntilTime=0;b&&wr(a)}}
|
|
845
|
+
r.Jc=function(a,b){if(!this.g.abr.enabled||this.l===dr||!navigator.onLine||0==b||!this.i)return!1;if(this.i.variants.some(function(h){return(h=h[a.type])&&h.id!==a.id?"audio"==a.type?a.language===h.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.Yc.Sa(1);b=this.hb().video.reduce(function(h,k){return h+
|
|
846
|
+
k.end-k.start},0);xr(this,!1,b,!0,!1);return!0}return!1};function hr(a,b){var c,d,e;return L(function(f){switch(f.g){case 1:if(a.l==dr)return f.return();c=!0;if(!(a.ma&&a.i&&a.j)||3016!=b.code&&3014!=b.code&&3015!=b.code&&3018!=b.code){f.s(2);break}wa(f,3);return J(f,Go(a.j),5);case 5:d=f.h;c=!d;xa(f,2);break;case 3:ya(f),c=!0;case 2:if(!c)return f.return();2===b.severity&&Zq(a,!1);e=cr("error",(new Map).set("detail",b));a.dispatchEvent(e);e.defaultPrevented&&(b.handled=!0);K(f)}})}
|
|
847
|
+
function ur(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,eventElement:c.eventElement,eventNode:c.eventNode});d.dispatchEvent(cr(b,a))}function gr(a,b){b=void 0===b?!0:b;if(!a.h.error)return b?new S(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 S(2,3,3016,c,b,a.h.error.message)}
|
|
848
|
+
function Cr(a,b,c){0<b&&(a.X()||a.Ef(b));b=a.getDuration();c<b&&(a.X()||a.rb(c))}function ls(a,b){L(function(c){if(1==c.g)return J(c,Promise.resolve(),2);a.l!=dr&&a.dispatchEvent(b);K(c)})}function fs(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(ze(c.language)):b.add("und");return b}
|
|
849
|
+
function es(a){var b=new Map,c=new Map;a=t(a);for(var d=a.next();!d.done;d=a.next()){d=d.value;var e="und",f=[];d.language&&(e=ze(d.language));"variant"==d.type?f=d.audioRoles:f=d.roles;f&&f.length||(f=[""]);b.has(e)||b.set(e,new Set);f=t(f);for(var g=f.next();!g.done;g=f.next())g=g.value,b.get(e).add(g),d.label&&(c.has(e)||c.set(e,new Map),c.get(e).set(g,d.label))}var h=[];b.forEach(function(k,l){k=t(k);for(var m=k.next();!m.done;m=k.next()){m=m.value;var n=null;c.has(l)&&c.get(l).has(m)&&(n=c.get(l).get(m));
|
|
850
|
+
h.push({language:l,role:m,label:n})}});return h}r.uc=function(){return!this.h||this.h.ended?!0:this.ma&&!this.X()&&this.h.currentTime>=this.Oa().end};O("shaka.Player",Z);Z.prototype.isEnded=Z.prototype.uc;Z.prototype.setVideoContainer=Z.prototype.ph;Z.prototype.getManifestParserFactory=Z.prototype.og;Z.prototype.getManifest=Z.prototype.Pd;Z.prototype.retryStreaming=Z.prototype.pe;Z.prototype.setMaxHardwareResolution=Z.prototype.lh;Z.prototype.addChaptersTrack=Z.prototype.Pf;
|
|
851
|
+
Z.prototype.addThumbnailsTrack=Z.prototype.Rf;Z.prototype.addTextTrackAsync=Z.prototype.Qf;Z.prototype.getStats=Z.prototype.getStats;Z.prototype.getBufferedInfo=Z.prototype.hb;Z.prototype.getSegmentAvailabilityDuration=Z.prototype.Qc;Z.prototype.getPresentationStartTimeAsDate=Z.prototype.We;Z.prototype.getPlayheadTimeAsDate=Z.prototype.sg;Z.prototype.setTextTrackVisibility=Z.prototype.nh;Z.prototype.getChapters=Z.prototype.gg;Z.prototype.getChaptersTracks=Z.prototype.Te;
|
|
852
|
+
Z.prototype.isTextTrackVisible=Z.prototype.Vd;Z.prototype.selectVariantsByLabel=Z.prototype.hh;Z.prototype.selectTextLanguage=Z.prototype.xf;Z.prototype.selectAudioLanguage=Z.prototype.wf;Z.prototype.getTextLanguages=Z.prototype.wg;Z.prototype.getAudioLanguages=Z.prototype.eg;Z.prototype.getTextLanguagesAndRoles=Z.prototype.xg;Z.prototype.getAudioLanguagesAndRoles=Z.prototype.fg;Z.prototype.selectVariantTrack=Z.prototype.te;Z.prototype.selectTextTrack=Z.prototype.yf;Z.prototype.getThumbnails=Z.prototype.Ag;
|
|
853
|
+
Z.prototype.getAllThumbnails=Z.prototype.dg;Z.prototype.getImageTracks=Z.prototype.kg;Z.prototype.getTextTracks=Z.prototype.Sb;Z.prototype.getVariantTracks=Z.prototype.Db;Z.prototype.cancelTrickPlay=Z.prototype.cc;Z.prototype.trickPlay=Z.prototype.xc;Z.prototype.getPlaybackRate=Z.prototype.Ka;Z.prototype.isBuffering=Z.prototype.Ze;Z.prototype.getKeyStatuses=Z.prototype.Oc;Z.prototype.getActiveSessionsMetadata=Z.prototype.Nd;Z.prototype.getExpiration=Z.prototype.Od;Z.prototype.drmInfo=Z.prototype.drmInfo;
|
|
854
|
+
Z.prototype.keySystem=Z.prototype.keySystem;Z.prototype.goToLive=Z.prototype.Fg;Z.prototype.seekRange=Z.prototype.Oa;Z.prototype.isAudioOnly=Z.prototype.Ig;Z.prototype.isInProgress=Z.prototype.Vb;Z.prototype.isLive=Z.prototype.X;Z.prototype.getAdManager=Z.prototype.cg;Z.prototype.getAssetUri=Z.prototype.Nc;Z.prototype.getNetworkingEngine=Z.prototype.Rd;Z.prototype.getMediaElement=Z.prototype.qg;Z.prototype.getManifestType=Z.prototype.Qd;Z.prototype.getLoadMode=Z.prototype.ng;
|
|
855
|
+
Z.prototype.resetConfiguration=Z.prototype.dh;Z.prototype.getBufferFullness=Z.prototype.Se;Z.prototype.getNonDefaultConfiguration=Z.prototype.rg;Z.prototype.getConfiguration=Z.prototype.getConfiguration;Z.prototype.configure=Z.prototype.configure;Z.prototype.releaseAllMutexes=Z.prototype.bh;Z.prototype.preload=Z.prototype.preload;Z.prototype.detachAndSavePreload=Z.prototype.Qe;Z.prototype.unloadAndSavePreload=Z.prototype.rh;Z.prototype.load=Z.prototype.load;Z.prototype.updateStartTime=Z.prototype.uh;
|
|
856
|
+
Z.prototype.unload=Z.prototype.yc;Z.prototype.detach=Z.prototype.detach;Z.prototype.attachCanvas=Z.prototype.Vf;Z.prototype.attach=Z.prototype.Ob;
|
|
857
|
+
Z.probeSupport=function(a){a=void 0===a?!0:a;var b,c,d,e,f,g,h;return L(function(k){switch(k.g){case 1:b={};if(!a){k.s(2);break}return J(k,dm(),3);case 3:b=k.h;case 2:var l={};if(Uc())for(var m in ki)l[m]=!0;m=t(["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","application/vnd.ms-sstr+xml"]);for(var n=m.next();!n.done;n=m.next())n=n.value,l[n]=Uc()?!!ki[n]:Vc(n);c=l;m='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.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(y(Vd));
|
|
858
|
+
l={};m=t(m);for(n=m.next();!n.done;n=m.next()){n=n.value;l[n]=me(n)?!0:Uc()?lb(n)||(mc(n)?!0:!1):Vc(n);var q=n.split(";")[0];l[q]=l[q]||l[n]}d=l;return J(k,td(),4);case 4:e=k.h;f={manifest:c,media:d,drm:b,hardwareResolution:e};g=ns;for(h in g)f[h]=g[h]();return k.return(f)}})};
|
|
859
|
+
Z.isBrowserSupported=function(){window.Promise||Za("A Promise implementation or polyfill is required");if(!(window.Promise&&window.Uint8Array&&Array.prototype.forEach)||Zc("Trident/"))return!1;var a=kd();return a&&9>a||!(window.MediaKeys&&window.navigator&&window.navigator.requestMediaKeySystemAccess&&window.MediaKeySystemAccess&&window.MediaKeySystemAccess.prototype.getConfiguration)?!1:Uc()?!0:Vc("application/x-mpegurl")};Z.setAdManagerFactory=function(a){Yq=a};
|
|
860
|
+
Z.registerSupportPlugin=function(a,b){ns[a]=b};Z.prototype.destroy=Z.prototype.destroy;var dr=0,Uq=1,Fr=2,Sr=3;Z.LoadMode={DESTROYED:dr,NOT_LOADED:Uq,MEDIA_SOURCE:Fr,SRC_EQUALS:Sr};Z.version="v4.9.36";var os=["4","9"];qb=new function(a){this.g=a;this.i=rb;this.h=sb}(new ob(Number(os[0]),Number(os[1])));var ns={},Yq=null;function ps(){}function qs(a,b){a={priority:b||0,callback:a};for(b=0;b<rs.length;b++)if(rs[b].priority<a.priority){rs.splice(b,0,a);return}rs.push(a)}O("shaka.polyfill",ps);ps.register=qs;ps.installAll=function(){for(var a=t(rs),b=a.next();!b.done;b=a.next()){b=b.value;try{b.callback()}catch(c){Za("Error installing polyfill!",c)}}};var rs=[];function ss(){this.g=new ts}function us(){window.AbortController||(window.AbortController=ss,window.AbortSignal=ts)}ss.prototype.abort=function(a){var b=this.g;if(!b.h){b.h=!0;b.g=a;void 0===b.g&&(b.g=new DOMException("signal is aborted without reason","AbortError"));a=new zi("abort");if(b.onabort)b.onabort(a);b.dispatchEvent(a)}};fa.Object.defineProperties(ss.prototype,{signal:{configurable:!0,enumerable:!0,get:function(){return this.g}}});ps.AbortController=ss;ss.install=us;
|
|
861
|
+
function ts(){this.h=!1;this.g=void 0;this.onabort=null;this.i=new Ai}ts.prototype.addEventListener=function(a,b,c){return this.i.addEventListener(a,b,c)};ts.prototype.removeEventListener=function(a,b,c){return this.i.removeEventListener(a,b,c)};ts.prototype.dispatchEvent=function(a){return this.i.dispatchEvent(a)};ts.prototype.throwIfAborted=function(){if(this.h)throw this.g;};
|
|
862
|
+
fa.Object.defineProperties(ts.prototype,{aborted:{configurable:!0,enumerable:!0,get:function(){return this.h}},reason:{configurable:!0,enumerable:!0,get:function(){return this.g}}});qs(us);function vs(){}function ws(){gd()||Zc("Sky_STB")||xs()}ps.EncryptionScheme=vs;vs.install=ws;qs(ws,-2);function ys(){}function zs(){var a=!0;!cd()||cd()&&pd()||cd()&&qd()||(a=!1);if(ed()||id()||gd()||bd()||$c()||Zc("PC=EOS")||jd()||Zc("WPE"))a=!1;a&&navigator.mediaCapabilities||(navigator.mediaCapabilities||(navigator.mediaCapabilities={}),As=navigator.mediaCapabilities,navigator.mediaCapabilities.decodingInfo=Bs)}
|
|
863
|
+
function Bs(a){var b,c,d,e,f,g,h,k,l,m,n;return L(function(q){switch(q.g){case 1:b={supported:!1,powerEfficient:!0,smooth:!0,keySystemAccess:null,configuration:a};c=a.video;d=a.audio;if("media-source"!=a.type){if("file"==a.type){if(c&&(e=c.contentType,f=Vc(e),!f)||d&&(g=d.contentType,h=Vc(g),!h))return q.return(b)}else return q.return(b);q.s(2);break}if(!Uc())return q.return(b);if(!c){q.s(3);break}return J(q,Cs(c),4);case 4:if(k=q.h,!k)return q.return(b);case 3:if(d){var p=d.contentType;cd()&&d.spatialRendering&&
|
|
864
|
+
(p+="; spatialRendering=true");l=lb(p);if(!l)return q.return(b)}case 2:if(!a.keySystemConfiguration)return b.supported=!0,q.return(b);m=a.keySystemConfiguration;return J(q,Ds(c,d,m),6);case 6:if(n=q.h)b.supported=!0,b.keySystemAccess=n;case 5:return q.return(b)}})}
|
|
865
|
+
function Cs(a){var b,c;return L(function(d){return 1==d.g?cd()?J(d,Es(a),3):$c()?(b=a.contentType,a.width&&a.height&&(b+="; width="+a.width,b+="; height="+a.height),a.framerate&&(b+="; framerate="+a.framerate),a.bitrate&&(b+="; bitrate="+a.bitrate),d.return(lb(b))):d.s(2):2!=d.g?(c=d.h,d.return(c)):d.return(lb(a.contentType))})}
|
|
866
|
+
function Ds(a,b,c){var d,e,f,g,h,k,l,m,n,q,p;return L(function(u){switch(u.g){case 1:d=[];e=[];c.audio&&(f={robustness:c.audio.robustness||"",contentType:b.contentType},$c()&&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=
|
|
867
|
+
{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=ie(k)+";"+ce(k);n=ie(l)+";"+ce(l);q=c.keySystem;p=null;wa(u,2);if(Rc.has(m+"#"+n+"#"+q)){p=Rc.get(m+"#"+n+"#"+q)||null;u.s(4);break}return J(u,navigator.requestMediaKeySystemAccess(c.keySystem,[h]),5);case 5:p=u.h,Rc.set(m+"#"+n+"#"+q,p);case 4:xa(u,
|
|
868
|
+
3);break;case 2:ya(u);case 3:return u.return(p)}})}
|
|
869
|
+
function Es(a){var b,c,d,e;return L(function(f){if(1==f.g){if(!(window.cast&&cast.__platform__&&cast.__platform__.canDisplayType))return f.return(lb(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 f.return(!1)}e=
|
|
870
|
+
!1;return b in Fs?(e=Fs[b],f.s(2)):J(f,cast.__platform__.canDisplayType(b),3)}2!=f.g&&(e=f.h,Fs[b]=e);return f.return(e)})}ps.MediaCapabilities=ys;ys.install=zs;var As=null;ys.originalMcap=As;var Fs={};ys.memoizedCanDisplayTypeRequests_=Fs;qs(zs,-1);function Gs(){}function Hs(){var a=kd();if(window.MediaSource||window.ManagedMediaSource)a&&window.MediaSource?10>=a?window.MediaSource=null:12>=a?(Is(),Js()):15>=a&&Is():Zc("DT_STB_BCM")?(Is(),Js()):Zc("Tizen 2")||ad()||Zc("Tizen 4")?Ks():Zc("WPE")&&(Is(),Js());(window.MediaSource||window.ManagedMediaSource)&&Ls();window.MediaSource&&MediaSource.isTypeSupported('video/webm; codecs="vp9"')&&!MediaSource.isTypeSupported('video/webm; codecs="vp09.00.10.08"')&&Ms()}
|
|
871
|
+
function Is(){var a=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var b=a.apply(this,La.apply(0,arguments));b.abort=function(){};return b}}function Js(){var a=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(b,c){return a.call(this,b,c-.001)}}
|
|
872
|
+
function Ls(){if(window.MediaSource){var a=MediaSource.isTypeSupported.bind(MediaSource);MediaSource.isTypeSupported=function(c){return"mp2t"!=$d(c)&&a(c)}}if(window.ManagedMediaSource){var b=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);window.ManagedMediaSource.isTypeSupported=function(c){return"mp2t"!=$d(c)&&b(c)}}}
|
|
873
|
+
function Ks(){var a=MediaSource.isTypeSupported.bind(MediaSource);MediaSource.isTypeSupported=function(c){return"opus"!=ce(c)&&a(c)};if(window.ManagedMediaSource){var b=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);window.ManagedMediaSource.isTypeSupported=function(c){return"opus"!=ce(c)&&b(c)}}}
|
|
874
|
+
function Ms(){var a=MediaSource.isTypeSupported;bd()||(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)})}ps.MediaSource=Gs;Gs.install=Hs;qs(Hs);function Ns(){}var Os,Ps,Qs,Rs,Ss,Ts;
|
|
875
|
+
function Us(a){if(window.HTMLVideoElement&&window.WebKitMediaKeys){if(void 0===a?0:a)Os=!0,Ps=Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype,"mediaKeys"),Qs=HTMLMediaElement.prototype.setMediaKeys,Rs=window.MediaKeys,Ss=window.MediaKeySystemAccess,Ts=navigator.requestMediaKeySystemAccess;delete HTMLMediaElement.prototype.mediaKeys;HTMLMediaElement.prototype.mediaKeys=null;HTMLMediaElement.prototype.setMediaKeys=Vs;window.MediaKeys=Ws;window.MediaKeySystemAccess=Xs;navigator.requestMediaKeySystemAccess=
|
|
876
|
+
Ys;window.shakaMediaKeysPolyfill=Zs}}function Ys(a,b){try{var c=new Xs(a,b);return Promise.resolve(c)}catch(d){return Promise.reject(d)}}function Vs(a){var b=this.mediaKeys;b&&b!=a&&$s(b,null);delete this.mediaKeys;return(this.mediaKeys=a)?$s(a,this):Promise.resolve()}
|
|
877
|
+
function at(a){a=yb(a.initData);if(Cb(a).getUint32(0,!0)+4!=a.byteLength)throw new RangeError("Malformed FairPlay init data");a=wd(a.subarray(4),!0);a=zd(a);var b=new Event("encrypted");b.initDataType="skd";b.initData=zb(a);this.dispatchEvent(b)}ps.PatchedMediaKeysApple=Ns;
|
|
878
|
+
Ns.uninstall=function(){Os&&(Os=!1,Object.defineProperty(HTMLMediaElement.prototype,"mediaKeys",Ps),HTMLMediaElement.prototype.setMediaKeys=Qs,window.MediaKeys=Rs,window.MediaKeySystemAccess=Ss,navigator.requestMediaKeySystemAccess=Ts,Ps=Ts=Qs=Ss=Rs=null,window.shakaMediaKeysPolyfill="")};Ns.install=Us;
|
|
879
|
+
function Xs(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,
|
|
880
|
+
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;}
|
|
881
|
+
Xs.prototype.createMediaKeys=function(){var a=new Ws(this.keySystem);return Promise.resolve(a)};Xs.prototype.getConfiguration=function(){return this.g};function Ws(a){this.h=new WebKitMediaKeys(a);this.g=new fb}Ws.prototype.createSession=function(a){a=a||"temporary";if("temporary"!=a)throw new TypeError("Session type "+a+" is unsupported on this platform.");return new bt(this.h,a)};Ws.prototype.setServerCertificate=function(){return Promise.resolve(!1)};
|
|
882
|
+
function $s(a,b){a.g.Za();if(!b)return Promise.resolve();a.g.G(b,"webkitneedkey",at);try{return jn(b,HTMLMediaElement.HAVE_METADATA,a.g,function(){b.webkitSetMediaKeys(a.h)}),Promise.resolve()}catch(c){return Promise.reject(c)}}Ws.prototype.getStatusForPolicy=function(){return Promise.resolve("usable")};function bt(a){Ai.call(this);this.i=null;this.l=a;this.g=this.h=null;this.j=new fb;this.sessionId="";this.expiration=NaN;this.closed=new si;this.keyStatuses=new ct}sa(bt,Ai);r=bt.prototype;
|
|
883
|
+
r.generateRequest=function(a,b){var c=this;this.h=new si;try{var d=this.l.createSession("video/mp4",yb(b));this.i=d;this.sessionId=d.sessionId||"";this.j.G(this.i,"webkitkeymessage",function(e){c.h&&(c.h.resolve(),c.h=null);e=(new Map).set("messageType",void 0==c.keyStatuses.Cb()?"license-request":"license-renewal").set("message",zb(e.message));e=new zi("message",e);c.dispatchEvent(e)});this.j.G(d,"webkitkeyadded",function(){c.g&&(dt(c,"usable"),c.g.resolve(),c.g=null)});this.j.G(d,"webkitkeyerror",
|
|
884
|
+
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:dt(c,"output-not-allowed");break;default:dt(c,"internal-error")}});dt(this,"status-pending")}catch(e){this.h.reject(e)}return this.h};r.load=function(){return Promise.reject(Error("MediaKeySession.load not yet supported"))};
|
|
885
|
+
r.update=function(a){this.g=new si;try{this.i.update(yb(a))}catch(b){this.g.reject(b)}return this.g};r.close=function(){try{this.i.close(),this.closed.resolve(),this.j.Za()}catch(a){this.closed.reject(a)}return this.closed};r.remove=function(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))};function dt(a,b){var c=a.keyStatuses;c.size=void 0==b?0:1;c.g=b;b=new zi("keystatuseschange");a.dispatchEvent(b)}
|
|
886
|
+
function ct(){this.size=0;this.g=void 0}r=ct.prototype;r.Cb=function(){return this.g};r.forEach=function(a){this.g&&a(this.g,Qc.value())};r.get=function(a){if(this.has(a))return this.g};r.has=function(a){var b=Qc.value();return this.g&&wb(a,b)?!0:!1};r.entries=function(){};r.keys=function(){};r.values=function(){};var Zs="apple";qs(function(){window.HTMLVideoElement&&window.WebKitMediaKeys&&(navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||Us())});function et(){}function ft(){window.MediaKeys&&(!MediaKeys.prototype.setServerCertificate||ad()||Zc("Tizen 4")||Zc("Tizen 5.0")||bd()&&38===dd())&&(MediaKeys.prototype.setServerCertificate=gt)}function gt(){return Promise.resolve(!1)}ps.PatchedMediaKeysCert=et;et.install=ft;qs(ft);function ht(){}function it(){!window.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(navigator.requestMediaKeySystemAccess=jt,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=kt,window.MediaKeys=lt,window.MediaKeySystemAccess=mt,window.shakaMediaKeysPolyfill=nt)}function jt(){return Promise.reject(Error("The key system specified is not supported."))}
|
|
887
|
+
function kt(a){return null==a?Promise.resolve():Promise.reject(Error("MediaKeys not supported."))}ps.PatchedMediaKeysNop=ht;ht.install=it;function lt(){throw new TypeError("Illegal constructor.");}lt.prototype.createSession=function(){};lt.prototype.setServerCertificate=function(){};lt.prototype.getStatusForPolicy=function(){return Promise.resolve("usable")};function mt(){this.keySystem="";throw new TypeError("Illegal constructor.");}mt.prototype.getConfiguration=function(){};
|
|
888
|
+
mt.prototype.createMediaKeys=function(){};var nt="nop";qs(it,-10);function ot(){}
|
|
889
|
+
function pt(){if(!(!window.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)){if(HTMLMediaElement.prototype.webkitGenerateKeyRequest)qt="webkit";else if(!HTMLMediaElement.prototype.generateKeyRequest)return;navigator.requestMediaKeySystemAccess=rt;delete HTMLMediaElement.prototype.mediaKeys;HTMLMediaElement.prototype.mediaKeys=null;HTMLMediaElement.prototype.setMediaKeys=st;window.MediaKeys=tt;window.MediaKeySystemAccess=ut;window.shakaMediaKeysPolyfill=vt}}
|
|
890
|
+
function wt(a){var b=qt;return b?b+a.charAt(0).toUpperCase()+a.slice(1):a}function rt(a,b){try{var c=new ut(a,b);return Promise.resolve(c)}catch(d){return Promise.reject(d)}}function st(a){var b=this.mediaKeys;b&&b!=a&&xt(b,null);delete this.mediaKeys;(this.mediaKeys=a)&&xt(a,this);return Promise.resolve()}ps.PatchedMediaKeysWebkit=ot;ot.install=pt;
|
|
891
|
+
function ut(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),
|
|
892
|
+
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"]):
|
|
893
|
+
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;}ut.prototype.createMediaKeys=function(){var a=new tt(this.g);return Promise.resolve(a)};ut.prototype.getConfiguration=function(){return this.h};function tt(a){this.l=a;this.h=null;this.g=new fb;this.i=[];this.j=new Map}
|
|
894
|
+
function xt(a,b){a.h=b;a.g.Za();var c=qt;b&&(a.g.G(b,c+"needkey",function(d){var e=new CustomEvent("encrypted");e.initDataType="cenc";e.initData=zb(d.initData);a.h.dispatchEvent(e)}),a.g.G(b,c+"keymessage",function(d){var e=yt(a,d.sessionId);e&&(d=(new Map).set("messageType",void 0==e.keyStatuses.Cb()?"licenserequest":"licenserenewal").set("message",d.message),d=new zi("message",d),e.h&&(e.h.resolve(),e.h=null),e.dispatchEvent(d))}),a.g.G(b,c+"keyadded",function(d){(d=yt(a,d.sessionId))&&d.ready()}),
|
|
895
|
+
a.g.G(b,c+"keyerror",function(d){var e=yt(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?zt(e,"output-restricted"):1==f?zt(e,"expired"):zt(e,"internal-error"))}}))}
|
|
896
|
+
tt.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 At(b,this.l,a);this.i.push(a);return a};tt.prototype.setServerCertificate=function(){return Promise.resolve(!1)};tt.prototype.getStatusForPolicy=function(){return Promise.resolve("usable")};
|
|
897
|
+
function yt(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 At(a,b,c){Ai.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 si;this.keyStatuses=new Bt}sa(At,Ai);r=At.prototype;r.ready=function(){zt(this,"usable");this.g&&this.g.resolve();this.g=null};
|
|
898
|
+
function Ct(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=yb(zd("LOAD_SESSION|"+c));else{var e=zd("PERSISTENT|");d=Jd(e,b)}else d=yb(b)}catch(g){return Promise.reject(g)}a.h=new si;var f=wt("generateKeyRequest");try{a.j[f](a.i,d)}catch(g){if("InvalidStateError"!=g.name)return a.h=null,Promise.reject(g);(new Tc(function(){try{a.j[f](a.i,d)}catch(h){a.h.reject(h),a.h=null}})).Z(.01)}return a.h}
|
|
899
|
+
function Dt(a,b,c){if(a.g)a.g.then(function(){return Dt(a,b,c)}).catch(function(){return Dt(a,b,c)});else{a.g=b;if("webkit-org.w3.clearkey"==a.i){var d=vd(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=Gd(e.keys[0].k);e=Gd(e.keys[0].kid)}else d=yb(c),e=null;var f=wt("addKey");try{a.j[f](a.i,d,e,a.sessionId)}catch(g){a.g.reject(g),a.g=null}}}
|
|
900
|
+
function zt(a,b){var c=a.keyStatuses;c.size=void 0==b?0:1;c.g=b;b=new zi("keystatuseschange");a.dispatchEvent(b)}r.generateRequest=function(a,b){return Ct(this,b,null)};r.load=function(a){return"persistent-license"==this.l?Ct(this,null,a):Promise.reject(Error("Not a persistent session."))};r.update=function(a){var b=new si;Dt(this,b,a);return b};
|
|
901
|
+
r.close=function(){if("persistent-license"!=this.l){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;var a=wt("cancelKeyRequest");try{this.j[a](this.i,this.sessionId)}catch(b){}}this.closed.resolve();return this.closed};r.remove=function(){return"persistent-license"!=this.l?Promise.reject(Error("Not a persistent session.")):this.close()};function Bt(){this.size=0;this.g=void 0}r=Bt.prototype;r.Cb=function(){return this.g};
|
|
902
|
+
r.forEach=function(a){this.g&&a(this.g,Qc.value())};r.get=function(a){if(this.has(a))return this.g};r.has=function(a){var b=Qc.value();return this.g&&wb(a,b)?!0:!1};r.entries=function(){};r.keys=function(){};r.values=function(){};var qt="",vt="webkit";qs(pt);function Et(){}function Ft(){window.crypto&&("randomUUID"in window.crypto||(window.crypto.randomUUID=Gt))}function Gt(){var a=URL.createObjectURL(new Blob),b=a.toString();URL.revokeObjectURL(a);return b.substr(b.lastIndexOf("/")+1)}ps.RandomUUID=Et;Et.install=Ft;qs(Ft);function Ht(){}function It(){var a=Symbol.prototype;"description"in a||Object.defineProperty(a,"description",{get:Jt})}function Jt(){var a=/\((.*)\)/.exec(this.toString());return a?a[1]:void 0}ps.Symbol=Ht;Ht.install=It;qs(It);function Kt(){}function Lt(){if(window.HTMLMediaElement){var a=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){var b=a.apply(this);b&&b.catch(function(){});return b}}}ps.VideoPlayPromise=Kt;Kt.install=Lt;qs(Lt);function Mt(){}function Nt(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;!a.getVideoPlaybackQuality&&("webkitDroppedFrameCount"in a||bd()&&38===dd())&&(a.getVideoPlaybackQuality=Ot)}}function Ot(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}ps.VideoPlaybackQuality=Mt;Mt.install=Nt;qs(Nt);function Pt(){}function Qt(){if(!window.VTTCue&&window.TextTrackCue){var a=null,b=TextTrackCue.length;if(3==b)a=Rt;else if(6==b)a=St;else{try{var c=!!Rt(1,2,"")}catch(d){c=!1}c&&(a=Rt)}a&&(window.VTTCue=function(d,e,f){return a(d,e,f)})}}function Rt(a,b,c){return new window.TextTrackCue(a,b,c)}function St(a,b,c){return new window.TextTrackCue(a+"-"+b+"-"+c,a,b,c)}ps.VTTCue=Pt;Pt.install=Qt;qs(Qt);function Tt(){}Tt.prototype.parseInit=function(){};Tt.prototype.setSequenceMode=function(){};Tt.prototype.setManifestType=function(){};
|
|
903
|
+
Tt.prototype.parseMedia=function(a,b,c){var d=vd(a);a=[];if(""==d)return a;var e=fj(d,"tt",!0);if(!e)throw new S(2,2,2005,"Failed to parse TTML.");d=mj(e,"body")[0];if(!d)return[];var f=oj(e,Ut,"frameRate"),g=oj(e,Ut,"subFrameRate"),h=oj(e,Ut,"frameRateMultiplier"),k=oj(e,Ut,"tickRate"),l=oj(e,Ut,"cellResolution"),m=e.attributes["xml:space"]||"default",n=oj(e,Vt,"extent");if("default"!=m&&"preserve"!=m)throw new S(2,2,2005,"Invalid xml:space value: "+m);m="default"==m;f=new Wt(f,g,h,k);l=Xt(l);g=
|
|
904
|
+
mj(e,"metadata")[0];g=(g?g.children:[]).filter(function(u){return"\n"!=u});h=mj(e,"style");e=mj(e,"region");k=[];for(var q=t(e),p=q.next();!p.done;p=q.next())(p=Yt(p.value,h,n))&&k.push(p);if(kj(d,"p").length)throw new S(2,2,2001,"<p> can only be inside <div> in TTML");n=t(kj(d,"div"));for(q=n.next();!q.done;q=n.next())if(kj(q.value,"span").length)throw new S(2,2,2001,"<span> can only be inside <p> in TTML");if(b=Zt(d,b,f,g,h,e,k,m,l,null,!1,c))b.backgroundColor||(b.backgroundColor="transparent"),
|
|
905
|
+
a.push(b);return a};
|
|
906
|
+
function Zt(a,b,c,d,e,f,g,h,k,l,m,n){var q=l;if(jj(a)){if(!m)return null;var p={tagName:"span",children:[lj(a)],attributes:{},parent:null}}else p=a;for(var u=null,x=t($t),v=x.next();!v.done&&!(u=au(p,"backgroundImage",d,"#",v.value)[0]);v=x.next());x=null;var z=oj(p,$t,"backgroundImage");n&&z&&!z.startsWith("#")&&(v=new sc(n),z=new sc(z),(v=v.resolve(z).toString())&&(x=v));if("p"==a.tagName||u||x)m=!0;a=m;v="default"==(p.attributes["xml:space"]||(h?"default":"preserve"));z=p.children.every(jj);h=
|
|
907
|
+
[];if(!z)for(var w=t(p.children),E=w.next();!E.done;E=w.next())(E=Zt(E.value,b,c,d,e,f,g,v,k,p,m,n))&&h.push(E);d=null!=l;n=lj(p);n=p.children.length&&n&&/\S/.test(n);E=p.attributes.begin||p.attributes.end||p.attributes.dur;if(!(E||n||"br"==p.tagName||0!=h.length||d&&!v))return null;w=bu(p,c);n=w.start;for(w=w.end;q&&q.tagName&&"tt"!=q.tagName;)w=cu(q,c,n,w),n=w.start,w=w.end,q=q.parent;null==n&&(n=0);n+=b.periodStart;w=null==w?Infinity:w+b.periodStart;n=Math.max(n,b.segmentStart);w=Math.min(w,b.segmentEnd);
|
|
908
|
+
if(!E&&0<h.length)for(n=Infinity,w=0,b=t(h),c=b.next();!c.done;c=b.next())c=c.value,n=Math.min(n,c.startTime),w=Math.max(w,c.endTime);if("br"==p.tagName)return e=new Pb(n,w,""),e.lineBreak=!0,e;b="";z&&(b=Cd(lj(p)||""),v&&(b=b.replace(/\s+/g," ")));b=new Pb(n,w,b);b.nestedCues=h;m||(b.isContainer=!0);k&&(b.cellResolution=k);k=au(p,"region",f,"")[0];if(p.attributes.region&&k&&k.attributes["xml:id"]){var F=k.attributes["xml:id"];b.region=g.filter(function(D){return D.id==F})[0]}g=k;l&&d&&!p.attributes.region&&
|
|
909
|
+
!p.attributes.style&&(g=au(l,"region",f,"")[0]);du(b,p,g,u,x,e,a,0==h.length);return b}
|
|
910
|
+
function Yt(a,b,c){var d=new Hb,e=a.attributes["xml:id"];if(!e)return null;d.id=e;e=null;c&&(e=eu.exec(c)||fu.exec(c));c=e?Number(e[1]):null;e=e?Number(e[2]):null;var f,g=gu(a,b,"extent");if(g){var h=(f=eu.exec(g))||fu.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?Ib:0,d.heightUnits=f||null!=e?Ib:0)}if(a=gu(a,b,"origin"))if(h=(f=eu.exec(a))||fu.exec(a),null!=h)d.viewportAnchorX=Number(h[1]),
|
|
911
|
+
d.viewportAnchorY=Number(h[2]),f?g||(d.width=100-d.viewportAnchorX,d.widthUnits=Ib,d.height=100-d.viewportAnchorY,d.heightUnits=Ib):(null!=e&&(d.viewportAnchorY=100*d.viewportAnchorY/e),null!=c&&(d.viewportAnchorX=100*d.viewportAnchorX/c)),d.viewportAnchorUnits=f||null!=c?Ib:0;return d}function hu(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}
|
|
912
|
+
function du(a,b,c,d,e,f,g,h){g=g||h;"rtl"==iu(b,c,f,"direction",g)&&(a.direction="rtl");h=iu(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=Sb);(h=iu(b,c,f,"textAlign",!0))?(a.positionAlign=ju[h],a.lineAlign=ku[h],a.textAlign=bc[h.toUpperCase()]):a.textAlign=Rb;if(h=iu(b,c,f,"displayAlign",!0))a.displayAlign=cc[h.toUpperCase()];if(h=iu(b,c,f,"color",g))a.color=hu(h);if(h=iu(b,c,f,"backgroundColor",
|
|
913
|
+
g))a.backgroundColor=hu(h);if(h=iu(b,c,f,"border",g))a.border=h;if(h=iu(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"!=
|
|
914
|
+
k}).join(",")}(h=iu(b,c,f,"fontWeight",g))&&"bold"==h&&(a.fontWeight=700);h=iu(b,c,f,"wrapOption",g);a.wrapLine=h&&"noWrap"==h?!1:!0;(h=iu(b,c,f,"lineHeight",g))&&h.match(lu)&&(a.lineHeight=h);(h=iu(b,c,f,"fontSize",g))&&(h.match(lu)||h.match(mu))&&(a.fontSize=h);if(h=iu(b,c,f,"fontStyle",g))a.fontStyle=gc[h.toUpperCase()];d?(e=d.attributes.imageType||d.attributes.imagetype,h=d.attributes.encoding,d=lj(d).trim(),"PNG"==e&&"Base64"==h&&d&&(a.backgroundImage="data:image/png;base64,"+d)):e&&(a.backgroundImage=
|
|
915
|
+
e);if(d=iu(b,c,f,"textOutline",g))d=d.split(" "),d[0].match(lu)?a.textStrokeColor=a.color:(a.textStrokeColor=hu(d[0]),d.shift()),d[0]&&d[0].match(lu)?a.textStrokeWidth=d[0]:a.textStrokeColor="";(d=iu(b,c,f,"letterSpacing",g))&&d.match(lu)&&(a.letterSpacing=d);(d=iu(b,c,f,"linePadding",g))&&d.match(lu)&&(a.linePadding=d);if(d=iu(b,c,f,"opacity",g))a.opacity=parseFloat(d);(d=gu(c,f,"textDecoration"))&&nu(a,d);(d=ou(b,f,"textDecoration"))&&nu(a,d);if(d=iu(b,c,f,"textCombine",g))a.textCombineUpright=
|
|
916
|
+
d;switch(iu(b,c,f,"ruby",g)){case "container":a.rubyTag="ruby";break;case "text":a.rubyTag="rt"}}
|
|
917
|
+
function nu(a,b){b=t(b.split(" "));for(var c=b.next();!c.done;c=b.next())switch(c.value){case "underline":a.textDecoration.includes("underline")||a.textDecoration.push("underline");break;case "noUnderline":a.textDecoration.includes("underline")&&Lb(a.textDecoration,"underline");break;case "lineThrough":a.textDecoration.includes("lineThrough")||a.textDecoration.push("lineThrough");break;case "noLineThrough":a.textDecoration.includes("lineThrough")&&Lb(a.textDecoration,"lineThrough");break;case "overline":a.textDecoration.includes("overline")||
|
|
918
|
+
a.textDecoration.push("overline");break;case "noOverline":a.textDecoration.includes("overline")&&Lb(a.textDecoration,"overline")}}function iu(a,b,c,d,e){e=void 0===e?!0:e;return(a=ou(a,c,d))?a:e?gu(b,c,d):null}function gu(a,b,c){if(!a)return null;var d=oj(a,Vt,c);return d?d:pu(a,b,c)}function ou(a,b,c){var d=oj(a,Vt,c);return d?d:pu(a,b,c)}
|
|
919
|
+
function pu(a,b,c){a=au(a,"style",b,"");for(var d=null,e=0;e<a.length;e++){var f=nj(a[e],"urn:ebu:tt:style",c);f||(f=oj(a[e],Vt,c));f||(f=ou(a[e],b,c));f&&(d=f)}return d}function au(a,b,c,d,e){var f=[];if(!a||1>c.length)return f;var g=a;for(a=null;!a&&!(a=e?nj(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}
|
|
920
|
+
function cu(a,b,c,d){a=bu(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 bu(a,b){var c=qu(a.attributes.begin,b),d=qu(a.attributes.end,b);a=qu(a.attributes.dur,b);null==d&&null!=a&&(d=c+a);return{start:c,end:d}}
|
|
921
|
+
function qu(a,b){var c=null;if(ru.test(a)){a=ru.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(su.test(a))c=tu(su,a);else if(uu.test(a))c=tu(uu,a);else if(vu.test(a))a=vu.exec(a),c=Number(a[1])/b.frameRate;else if(wu.test(a))a=wu.exec(a),c=Number(a[1])/b.g;else if(xu.test(a))c=tu(xu,a);else if(a)throw new S(2,2,2001,"Could not parse cue time range in TTML");return c}
|
|
922
|
+
function tu(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 Xt(a){return a?(a=/^(\d+) (\d+)$/.exec(a))?{wb:parseInt(a[1],10),rows:parseInt(a[2],10)}:null:null}O("shaka.text.TtmlTextParser",Tt);Tt.prototype.parseMedia=Tt.prototype.parseMedia;Tt.prototype.setManifestType=Tt.prototype.setManifestType;Tt.prototype.setSequenceMode=Tt.prototype.setSequenceMode;Tt.prototype.parseInit=Tt.prototype.parseInit;
|
|
923
|
+
function Wt(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]))}
|
|
924
|
+
var eu=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,mu=/^(\d{1,4}(?:\.\d+)?|100)%$/,lu=/^(\d+px|\d+em|\d*\.?\d+c)$/,fu=/^(\d+)px (\d+)px$/,ru=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,su=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,uu=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/,vu=/^(\d*(?:\.\d*)?)f$/,wu=/^(\d*(?:\.\d*)?)t$/,xu=RegExp("^(?:(\\d*(?:\\.\\d*)?)h)?(?:(\\d*(?:\\.\\d*)?)m)?(?:(\\d*(?:\\.\\d*)?)s)?(?:(\\d*(?:\\.\\d*)?)ms)?$"),ku={left:Wb,center:"center",right:"end",start:Wb,
|
|
925
|
+
end:"end"},ju={left:"line-left",center:"center",right:"line-right"},Ut=["http://www.w3.org/ns/ttml#parameter","http://www.w3.org/2006/10/ttaf1#parameter"],Vt=["http://www.w3.org/ns/ttml#styling","http://www.w3.org/2006/10/ttaf1#styling"],$t=["http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt","http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"];ne["application/ttml+xml"]=function(){return new Tt};function yu(){this.g=new Tt}yu.prototype.parseInit=function(a){var b=!1;(new xg).box("moov",Cg).box("trak",Cg).box("mdia",Cg).box("minf",Cg).box("stbl",Cg).K("stsd",Eg).box("stpp",function(c){b=!0;c.parser.stop()}).parse(a);if(!b)throw new S(2,2,2007);};yu.prototype.setSequenceMode=function(){};yu.prototype.setManifestType=function(){};
|
|
926
|
+
yu.prototype.parseMedia=function(a,b,c){var d=[],e=null,f=[],g=new Map,h=[];(new xg).box("moof",Cg).box("traf",Cg).K("tfhd",function(p){e=Ig(p.reader,p.flags).hc}).K("trun",function(p){p=Lg(p.reader,p.version,p.flags);p=t(p.re);for(var u=p.next();!u.done;u=p.next())h.push(u.value.sampleSize||e||0)}).K("subs",function(p){for(var u=p.reader,x=u.N(),v=-1,z=0;z<x;z++){var w=u.N();v+=w;w=u.ca();for(var E=[],F=0;F<w;F++)1==p.version?E.push(u.N()):E.push(u.ca()),u.P(),u.P(),u.N();g.set(v,E)}}).box("mdat",
|
|
927
|
+
Hg(function(p){f.push(p)})).parse(a,!1);if(0==f.length)throw new S(2,2,2007);a=Jd.apply(Dd,y(f));for(var k=0,l=0;l<h.length;l++){var m=yb(a,k,h[l]);k+=h[l];var n=g.get(l);if(n&&n.length){m=yb(m,0,n[0]);for(var q=1;q<n.length;q++);d=d.concat(this.g.parseMedia(m,b,c))}else d=d.concat(this.g.parseMedia(m,b,c))}return d};O("shaka.text.Mp4TtmlParser",yu);yu.prototype.parseMedia=yu.prototype.parseMedia;yu.prototype.setManifestType=yu.prototype.setManifestType;yu.prototype.setSequenceMode=yu.prototype.setSequenceMode;
|
|
928
|
+
yu.prototype.parseInit=yu.prototype.parseInit;ne['application/mp4; codecs="stpp"']=function(){return new yu};ne['application/mp4; codecs="stpp.ttml"']=function(){return new yu};ne['application/mp4; codecs="stpp.ttml.im1t"']=function(){return new yu};ne['application/mp4; codecs="stpp.ttml.im2t"']=function(){return new yu};ne['application/mp4; codecs="stpp.ttml.etd1"']=function(){return new yu};ne['application/mp4; codecs="stpp.ttml.etd1|im1t"']=function(){return new yu};
|
|
929
|
+
ne['application/mp4; codecs="stpp.ttml.im1t|etd1"']=function(){return new yu};ne['application/mp4; codecs="stpp.TTML.im1t"']=function(){return new yu};function zu(){this.g="UNKNOWN"}zu.prototype.parseInit=function(){};zu.prototype.setSequenceMode=function(){};zu.prototype.setManifestType=function(a){this.g=a};
|
|
930
|
+
zu.prototype.parseMedia=function(a,b){a=vd(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 S(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 S(2,2,2E3);a=Au(new Wh(a[1]));if(null==a)throw new S(2,2,2E3);d=Number(d[1]);for(var e=b.segmentStart-b.periodStart;95443.7176888889<=e;)e-=95443.7176888889,
|
|
931
|
+
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 Wh(e);var f=new Hb;Zh(e);Xh(e);for(var g=Zh(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]),
|
|
932
|
+
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");Xh(e);g=Zh(e)}b.push(f)}d=new Map;Bu(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("}")&&
|
|
933
|
+
(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 Pb(0,0,""));for(var m=!1,n=0;n<k.length;n++){var q=/^\s*([^:]+):\s*(.*)/.exec(k[n]);if(q){var p=q[2].trim().replace(";","");switch(q[1].trim()){case "background-color":case "background":m=!0;l.backgroundColor=p;break;case "color":m=!0;l.color=p;break;case "font-family":m=!0;l.fontFamily=
|
|
934
|
+
p;break;case "font-size":m=!0;l.fontSize=p;break;case "font-weight":if(700<=parseInt(p,10)||"bold"==p)m=!0,l.fontWeight=700;break;case "font-style":switch(p){case "normal":m=!0;l.fontStyle=Zb;break;case "italic":m=!0;l.fontStyle="italic";break;case "oblique":m=!0,l.fontStyle="oblique"}break;case "opacity":m=!0;l.opacity=parseFloat(p);break;case "text-combine-upright":m=!0;l.textCombineUpright=p;break;case "text-shadow":m=!0;l.textShadow=p;break;case "white-space":m=!0,l.wrapLine="noWrap"!=p}}}m&&
|
|
935
|
+
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 Wh(l[0]),g=Au(h),n=Yh(h,/[ \t]+--\x3e[ \t]+/g),k=Au(h),null==g||null==n||null==k)Za("Failed to parse VTT time code. Cue skipped:",f,l),f=null;else{g+=m;k+=m;l=l.slice(1).join("\n").trim();d.has("global")?(m=d.get("global").clone(),m.startTime=g,m.endTime=k,m.payload=""):m=new Pb(g,k,"");Xh(h);for(g=Zh(h);g;)Cu(m,g,b),Xh(h),
|
|
936
|
+
g=Zh(h);Du(l,m,d);null!=f&&(m.id=f);f=m}f&&e.push(f)}return e};function Bu(a){for(var b=t(Object.entries(ec)),c=b.next();!c.done;c=b.next()){var d=t(c.value);c=d.next().value;d=d.next().value;var e=new Pb(0,0,"");e.color=d;a.set("."+c,e)}b=t(Object.entries(fc));for(c=b.next();!c.done;c=b.next())d=t(c.value),c=d.next().value,d=d.next().value,e=new Pb(0,0,""),e.backgroundColor=d,a.set("."+c,e)}
|
|
937
|
+
function Du(a,b,c){if(a.includes("<")){0===c.size&&Bu(c);var d=a;a=[];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(Eu)&&a.push(e),e=-1);a=t(a);for(f=a.next();!f.done;f=a.next())f=f.value,d=d.replace("<"+f+">",'<div time="'+f+'">'),d+="</div>";a=d;a:{f=a;e=[];var g=-1;a="";d=!1;for(var h=0;h<f.length;h++)if("/"===f[h]){var k=f.indexOf(">",h);if(-1===k){a=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===
|
|
938
|
+
k)a+="/"+k+">";else{if(!l.startsWith("v")){a+=f[h];continue}a+="/"+l+">"}h+=k.length+1}else a+=f[h]}else a+=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),a+=f[h];f=t(e);for(e=f.next();!e.done;e=f.next())e=e.value,g=e.replace(" ",".voice-"),a=a.replace("<"+e+">","<"+g+">"),a=a.replace("</"+e+">","</"+g+">"),d||(a+="</"+g+">")}a=Fu(a);try{var m=fj("<span>"+a+"</span>","span")}catch(n){}if(m)if(m=m.children,1!=m.length||m[0].tagName)for(m=t(m),a=m.next();!a.done;a=
|
|
939
|
+
m.next())Gu(a.value,b,c);else b.payload=Cd(a);else b.payload=Cd(a)}else b.payload=Cd(a)}function Fu(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 Hu(a,b){return a&&0<a.length?a:b}
|
|
940
|
+
function Gu(a,b,c){var d=b.clone();d.nestedCues=[];d.payload="";d.rubyTag="";d.line=null;d.region=new Hb;d.position=null;d.size=0;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=Hu(g.backgroundColor,h.backgroundColor),h.color=Hu(g.color,h.color),h.fontFamily=Hu(g.fontFamily,h.fontFamily),h.fontSize=
|
|
941
|
+
Hu(g.fontSize,h.fontSize),h.textShadow=Hu(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=$b(d.startTime,d.endTime);b.nestedCues.push(d);return;case "b":d.fontWeight=700;break;case "i":d.fontStyle="italic";break;case "u":d.textDecoration.push("underline");break;case "font":if(f=a.attributes.color)d.color=f;break;case "div":f=a.attributes.time;
|
|
942
|
+
if(!f)break;if(f=Au(new Wh(f)))d.startTime=f;break;case "ruby":case "rp":case "rt":d.rubyTag=f}}e=a.children;if(jj(a)||1==e.length&&jj(e[0]))for(c=lj(a).split("\n"),a=!0,c=t(c),e=c.next();!e.done;e=c.next())e=e.value,a||(a=$b(d.startTime,d.endTime),b.nestedCues.push(a)),0<e.length&&(a=d.clone(),a.payload=Cd(e),b.nestedCues.push(a)),a=!1;else for(b.nestedCues.push(d),b=t(e),a=b.next();!a.done;a=b.next())Gu(a.value,d,c)}
|
|
943
|
+
function Cu(a,b,c){var d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"==b?a.textAlign=Rb:a.textAlign=bc[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"==
|
|
944
|
+
b||"end"==b?"line-right":"center"==b||"middle"==b?"center":Qb);else if(d=/^region:(.*)$/.exec(b)){if(b=Iu(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=dc[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=Ub,a.line=Number(c[1]),c[2]&&(a.lineAlign=dc[c[2].toUpperCase()])}
|
|
945
|
+
function Iu(a,b){a=a.filter(function(c){return c.id==b});return a.length?a[0]:null}function Au(a){a=Yh(a,Eu);if(null==a)return null;var b=Number(a[2]),c=Number(a[3]);return 59<b||59<c?null:Number(a[4])/1E3+c+60*b+3600*(Number(a[1])||0)}O("shaka.text.VttTextParser",zu);zu.prototype.parseMedia=zu.prototype.parseMedia;zu.prototype.setManifestType=zu.prototype.setManifestType;zu.prototype.setSequenceMode=zu.prototype.setSequenceMode;zu.prototype.parseInit=zu.prototype.parseInit;var Eu=/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g;
|
|
946
|
+
ne["text/vtt"]=function(){return new zu};ne['text/vtt; codecs="vtt"']=function(){return new zu};ne['text/vtt; codecs="wvtt"']=function(){return new zu};function Ju(){this.g=null}Ju.prototype.parseInit=function(a){var b=this,c=!1;(new xg).box("moov",Cg).box("trak",Cg).box("mdia",Cg).K("mdhd",function(d){d=Kg(d.reader,d.version);b.g=d.timescale}).box("minf",Cg).box("stbl",Cg).K("stsd",Eg).box("wvtt",function(){c=!0}).parse(a);if(!this.g)throw new S(2,2,2008);if(!c)throw new S(2,2,2008);};Ju.prototype.setSequenceMode=function(){};Ju.prototype.setManifestType=function(){};
|
|
947
|
+
Ju.prototype.parseMedia=function(a,b){if(!a.length)return[];if(!this.g)throw new S(2,2,2008);var c=0,d=[],e,f=[],g=!1,h=!1,k=!1,l=null;(new xg).box("moof",Cg).box("traf",Cg).K("tfdt",function(E){g=!0;c=Jg(E.reader,E.version).baseMediaDecodeTime}).K("tfhd",function(E){l=Ig(E.reader,E.flags).fc}).K("trun",function(E){h=!0;d=Lg(E.reader,E.version,E.flags).re}).box("mdat",Hg(function(E){k=!0;e=E})).parse(a,!1);if(!k&&!g&&!h)throw new S(2,2,2008);a=c;for(var m=new og(e,0),n=t(d),q=n.next();!q.done;q=n.next()){q=
|
|
948
|
+
q.value;var p=q.se||l,u=q.jd?c+q.jd:a;a=u+(p||0);var x=0;do{var v=m.N();x+=v;var z=m.N(),w=null;"vttc"==Bg(z)?8<v&&(w=m.Ya(v-8)):m.skip(v-8);p&&w&&(v=Ku(w,b.periodStart+u/this.g,b.periodStart+a/this.g),f.push(v))}while(q.sampleSize&&x<q.sampleSize)}return f.filter(ve)};function Ku(a,b,c){var d,e,f;(new xg).box("payl",Hg(function(g){d=vd(g)})).box("iden",Hg(function(g){e=vd(g)})).box("sttg",Hg(function(g){f=vd(g)})).parse(a);return d?Lu(d,e,f,b,c):null}
|
|
949
|
+
function Lu(a,b,c,d,e){d=new Pb(d,e,"");Du(a,d,new Map);b&&(d.id=b);if(c)for(a=new Wh(c),b=Zh(a);b;)Cu(d,b,[]),Xh(a),b=Zh(a);return d}O("shaka.text.Mp4VttParser",Ju);Ju.prototype.parseMedia=Ju.prototype.parseMedia;Ju.prototype.setManifestType=Ju.prototype.setManifestType;Ju.prototype.setSequenceMode=Ju.prototype.setSequenceMode;Ju.prototype.parseInit=Ju.prototype.parseInit;ne['application/mp4; codecs="wvtt"']=function(){return new Ju};function Mu(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)?{sc:c,V:a}:null}function Nu(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}}
|
|
950
|
+
function Ou(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}
|
|
951
|
+
function Pu(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,
|
|
952
|
+
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 Qu(a){if(!Ru){Ru=!0;var b=new Uint8Array([105,115,111,109]),c=new Uint8Array([97,118,99,49]),d=new Uint8Array([0,0,0,1]);Su=Tu("ftyp",b,d,b,c);b=Tu("dref",Uu);Vu=Tu("dinf",b)}this.g=a}
|
|
953
|
+
function Wu(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=Tu;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/(Xu+1));m=Math.floor(m%(Xu+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(y(Yu(h,4)),[0,0,0,0],y(Yu(n,4)),y(Yu(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],y(Yu(k,2)),[0,0],y(Yu(l,
|
|
954
|
+
2)),[0,0]));h=Tu("tkhd",h);k=Tu;n=g.duration*g.timescale;l=Math.floor(n/(Xu+1));n=Math.floor(n%(Xu+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(y(Yu(g.timescale,4)),y(Yu(l,4)),y(Yu(n,4)),y(Yu(m,2)),[0,0]));l=Tu("mdhd",l);n=g;m=new Uint8Array([]);switch(n.type){case "video":m=Zu;break;case "audio":m=$u}n=Tu("hdlr",m);a:{switch(g.type){case "video":g=Tu("minf",Tu("vmhd",av),Vu,bv(g));break a;
|
|
955
|
+
case "audio":g=Tu("minf",Tu("smhd",cv),Vu,bv(g));break a}g=new Uint8Array([])}g=k("mdia",l,n,g);d=d("trak",h,g);f.call(e,d)}b=Jd.apply(Dd,y(b));f=a.g[0];c=Tu;d=f.duration*f.timescale;e=Math.floor(d/(Xu+1));d=Math.floor(d%(Xu+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(y(Yu(f.timescale,4)),y(Yu(e,4)),y(Yu(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,
|
|
956
|
+
255]));e=Tu("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(y(Yu(k.value.id+1,4)),[0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),k=Tu("trex",k),h.call(g,k);a=Jd.apply(Dd,y(d));a=Tu("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=Jd.apply(Dd,y(d))}else f=new Uint8Array([]);a=c("moov",e,b,a,f);b=new Uint8Array(Su.byteLength+
|
|
957
|
+
a.byteLength);b.set(Su);b.set(a,Su.byteLength);return b}
|
|
958
|
+
function bv(a){var b=Tu,c="aac";a.codecs.includes("mp3")?c="mp3":a.codecs.includes("ac-3")?c=ad()?"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.oa.byteLength)var e=Tu("avcC",a.oa);else{e=Tu;for(var f=7,g=[],h=[],k=0,l=0,m=0,n=0;n<a.Ua.length;n++){var q=dv(a.Ua[n]);switch(q[0]&31){case 7:g.push(q);f+=q.length+2;break;case 8:h.push(q),
|
|
959
|
+
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(y(Yu(c,2)),y(Yu(d,2)),[0,72,0,0,0,72,
|
|
960
|
+
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=ev(a);g=new Uint8Array([]);a.encrypted&&(g=fv(a),d="encv");d=Tu(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.oa.byteLength&&(c=Tu("hvcC",a.oa)),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(y(Yu(d,2)),y(Yu(e,2)),[0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,
|
|
961
|
+
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=ev(a),g=new Uint8Array([]),a.encrypted&&(g=fv(a),e="encv"),d=Tu(e,d,c,h,g));break;case "audio":if("mp3"==c)a=Tu(".mp3",gv(a));else if("ac-3"==c)c=Tu("dac3",a.ia),d="ac-3",e=new Uint8Array([]),a.encrypted&&(e=fv(a),d="enca"),a=Tu(d,gv(a),c,e);else if("ec-3"==c)c=Tu("dec3",a.ia),d="ec-3",e=new Uint8Array([]),a.encrypted&&(e=fv(a),d="enca"),a=Tu(d,gv(a),c,e);else if("opus"==c)c=Tu("dOps",a.ia),d="Opus",e=
|
|
962
|
+
new Uint8Array([]),a.encrypted&&(e=fv(a),d="enca"),a=Tu(d,gv(a),c,e);else{if(0<a.ia.byteLength)c=Tu("esds",a.ia);else{c=Tu;d=a.id+1;e=a.stream.channelsCount||2;g=a.stream.audioSamplingRate||44100;k=Nd("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(y(Yu(d,2)),[0,4,17,64,21,0,0,0,0,0,0,0,0,0,0,
|
|
963
|
+
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=fv(a),d="enca");a=Tu(d,gv(a),c,e)}d=a}a=Tu("stsd",hv,d);return b("stbl",a,Tu("stts",iv),Tu("stsc",jv),Tu("stsz",kv),Tu("stco",lv))}function ev(a){if(!a.sa&&!a.ua)return new Uint8Array([]);var b=a.ua;a=new Uint8Array([].concat(y(Yu(a.sa,4)),y(Yu(b,4))));return Tu("pasp",a)}
|
|
964
|
+
function gv(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(y(Yu(a.stream.audioSamplingRate||44100,2)),[0,0]))}
|
|
965
|
+
function fv(a){var b=Tu;var c=a.codecs.substring(0,a.codecs.indexOf("."));for(var d=0,e=0;e<c.length;e+=1)d|=c.charCodeAt(e)<<8*(c.length-e-1);c=new Uint8Array([].concat(y(Yu(d,4))));c=Tu("frma",c);d=new Uint8Array([0,0,0,0,99,101,110,99,0,1,0,0]);d=Tu("schm",d);e=Tu;var f=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);a=t(a.stream.drmInfos);for(var g=a.next();!g.done;g=a.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=dv(h.value)}a=new Uint8Array([0,
|
|
966
|
+
0,0,0,0,0,1,8]);f=Tu("tenc",a,f);return b("sinf",c,d,e("schi",f))}
|
|
967
|
+
function mv(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=Tu;var g=new Uint8Array([0,0,0,0].concat(y(Yu(c.data?c.data.$a:0,4))));g=Tu("mfhd",g);var h;var k=c.data?c.data.Na:[];var l=new Uint8Array(4+k.length);for(h=0;h<k.length;h++){var m=k[h].flags;l[h+4]=m.Da<<4|m.Ga<<2|m.Fa}k=Tu("sdtp",l);var n=k.length+92;l=Tu;h=new Uint8Array([0,0,0,58].concat(y(Yu(c.id+1,4)),[0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0]));h=Tu("tfhd",h);m=c.data?c.data.baseMediaDecodeTime:
|
|
968
|
+
0;var q=Math.floor(m%(Xu+1));m=new Uint8Array([1,0,0,0].concat(y(Yu(Math.floor(m/(Xu+1)),4)),y(Yu(q,4))));m=Tu("tfdt",m);var p=n;n=c.data?c.data.Na:[];q=n.length;var u=12+16*q,x=new Uint8Array(u);p+=8+u;x.set(["video"===c.type?1:0,0,15,1].concat(y(Yu(q,4)),y(Yu(p,4))),0);for(p=0;p<q;p++){var v=n[p];u=Yu(v.duration,4);var z=Yu(v.size,4),w=v.flags;v=Yu(v.Ia,4);x.set([].concat(y(u),y(z),[w.La<<2|w.Da,w.Ga<<6|w.Fa<<4|w.Ma,w.Ca&61440,w.Ca&15],y(v)),12+16*p)}n=Tu("trun",x);k=l("traf",h,m,n,k);f=f("moof",
|
|
969
|
+
g,k);e.call(d,b,[f,nv(c)])}return Jd.apply(Dd,y(b))}function nv(a){a=(a.data?a.data.Na:[]).map(function(b){return b.data});a=Jd.apply(Dd,y(a));return Tu("mdat",a)}function Yu(a,b){var c=[];for(--b;0<=b;b--)c.push(a>>8*b&255);return c}function dv(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}
|
|
970
|
+
function Tu(a){var b=La.apply(1,arguments),c=ov[a];c||(c=[a.charCodeAt(0),a.charCodeAt(1),a.charCodeAt(2),a.charCodeAt(3)],ov[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}
|
|
971
|
+
var Ru=!1,Xu=Math.pow(2,32)-1,ov={},Zu=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]),$u=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]),iv=new Uint8Array([0,0,0,0,0,0,0,0]),jv=new Uint8Array([0,0,0,0,0,0,0,0]),lv=new Uint8Array([0,0,0,0,0,0,0,0]),kv=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),av=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),cv=new Uint8Array([0,
|
|
972
|
+
0,0,0,0,0,0,0]),hv=new Uint8Array([0,0,0,0,0,0,0,1]),Su=new Uint8Array([]),Uu=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),Vu=new Uint8Array([]);function pv(a){this.j=a;this.h=0;this.g=new Map;this.i=null}r=pv.prototype;r.destroy=function(){this.g.clear()};r.isSupported=function(a){return"audio/aac"==a.toLowerCase().split(";")[0]?lb(this.convertCodecs("audio",a)):!1};r.convertCodecs=function(a,b){return"audio/aac"==b.toLowerCase().split(";")[0]?'audio/mp4; codecs="'+(je(b)||"mp4a.40.2")+'"':b};r.getOriginalMimeType=function(){return this.j};
|
|
973
|
+
r.transmux=function(a,b,c,d){for(var e=yb(a),f=vh(e),g=f.length;g<e.length&&!Ou(e,g);g++);a=1E3*c.endTime;f=uh(f);f.length&&c&&(f=f.find(function(m){return"com.apple.streaming.transportStreamTimestamp"===m.description}))&&(a=f.data);f=Nu(e,g);if(!f)return Promise.reject(new S(2,3,3018,c?c.J()[0]:null));b.audioSamplingRate=f.sampleRate;b.channelsCount=f.channelCount;for(var h=[];g<e.length;){var k=Mu(e,g);if(!k)return Promise.reject(new S(2,3,3018,c?c.J()[0]:null));var l=k.sc+k.V;g+l<=e.length&&h.push({data:e.subarray(g+
|
|
974
|
+
k.sc,g+l),size:k.V,duration:1024,Ia:0,flags:{La:0,Ga:0,Fa:0,Ca:0,Da:2,Ma: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,Ua:[],ia:new Uint8Array([]),oa:new Uint8Array([]),sa:0,ua:0,data:{$a:this.h,baseMediaDecodeTime:a,Na:h},stream:b};d=new Qu([d]);c=b.id+"_"+c.i;this.g.has(c)?b=this.g.get(c):(b=Wu(d),this.g.set(c,b));c=this.i!==b;d=mv(d);this.i=b;this.h++;return c?(b=Jd(b,d),Promise.resolve(b)):
|
|
975
|
+
Promise.resolve(d)};O("shaka.transmuxer.AacTransmuxer",pv);pv.prototype.transmux=pv.prototype.transmux;pv.prototype.getOriginalMimeType=pv.prototype.getOriginalMimeType;pv.prototype.convertCodecs=pv.prototype.convertCodecs;pv.prototype.isSupported=pv.prototype.isSupported;pv.prototype.destroy=pv.prototype.destroy;kc("audio/aac",function(){return new pv("audio/aac")},qc);function qv(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,
|
|
976
|
+
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,ia:a,V:e}}
|
|
977
|
+
function rv(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 sv(a){this.j=a;this.h=0;this.g=new Map;this.i=null}r=sv.prototype;r.destroy=function(){this.g.clear()};r.isSupported=function(a){return"audio/ac3"==a.toLowerCase().split(";")[0]?lb(this.convertCodecs("audio",a)):!1};r.convertCodecs=function(a,b){return"audio/ac3"==b.toLowerCase().split(";")[0]?ad()?'audio/mp4; codecs="ec-3"':'audio/mp4; codecs="ac-3"':b};r.getOriginalMimeType=function(){return this.j};
|
|
978
|
+
r.transmux=function(a,b,c,d){a=yb(a);for(var e=vh(a),f=e.length;f<a.length&&!rv(a,f);f++);var g=1E3*c.endTime;e=uh(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=qv(a,f);if(!l)return Promise.reject(new S(2,3,3018,c?c.J()[0]:null));b.audioSamplingRate=l.sampleRate;b.channelsCount=l.channelCount;e=l.sampleRate;h=l.ia;k.push({data:a.subarray(f,f+l.V),size:l.V,duration:1536,
|
|
979
|
+
Ia:0,flags:{La:0,Ga:0,Fa:0,Ca:0,Da:2,Ma:0}});f+=l.V}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,Ua:[],ia:h,oa:new Uint8Array([]),sa:0,ua:0,data:{$a:this.h,baseMediaDecodeTime:a,Na:k},stream:b};d=new Qu([d]);c=b.id+"_"+c.i;this.g.has(c)?b=this.g.get(c):(b=Wu(d),this.g.set(c,b));c=this.i!==b;d=mv(d);this.i=b;this.h++;return c?(b=Jd(b,d),Promise.resolve(b)):Promise.resolve(d)};O("shaka.transmuxer.Ac3Transmuxer",sv);
|
|
980
|
+
sv.prototype.transmux=sv.prototype.transmux;sv.prototype.getOriginalMimeType=sv.prototype.getOriginalMimeType;sv.prototype.convertCodecs=sv.prototype.convertCodecs;sv.prototype.isSupported=sv.prototype.isSupported;sv.prototype.destroy=sv.prototype.destroy;kc("audio/ac3",function(){return new sv("audio/ac3")},qc);function tv(a,b){if(b+8>a.length||2935!==(a[b]<<8|a[b+1]<<0))return null;var c=new Xg(a.subarray(b+2));Zg(c,2);Zg(c,3);var d=$g(c,11)+1<<1,e=$g(c,2);if(3==e){e=$g(c,2);e=[24E3,22060,16E3][e];var f=3}else e=[48E3,44100,32E3][e],f=$g(c,2);var g=$g(c,3),h=$g(c,1);c=$g(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,ia:a,V:d}};function uv(a){this.j=a;this.h=0;this.g=new Map;this.i=null}r=uv.prototype;r.destroy=function(){this.g.clear()};r.isSupported=function(a){return"audio/ec3"==a.toLowerCase().split(";")[0]?lb(this.convertCodecs("audio",a)):!1};r.convertCodecs=function(a,b){return"audio/ec3"==b.toLowerCase().split(";")[0]?'audio/mp4; codecs="ec-3"':b};r.getOriginalMimeType=function(){return this.j};
|
|
981
|
+
r.transmux=function(a,b,c,d){a=yb(a);for(var e=vh(a),f=e.length;f<a.length&&2935!==(a[f]<<8|a[f+1]<<0);f++);var g=1E3*c.endTime;e=uh(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=tv(a,f);if(!l)return Promise.reject(new S(2,3,3018,c?c.J()[0]:null));b.audioSamplingRate=l.sampleRate;b.channelsCount=l.channelCount;e=l.sampleRate;h=l.ia;k.push({data:a.subarray(f,f+l.V),size:l.V,
|
|
982
|
+
duration:1536,Ia:0,flags:{La:0,Ga:0,Fa:0,Ca:0,Da:2,Ma:0}});f+=l.V}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,Ua:[],ia:h,oa:new Uint8Array([]),sa:0,ua:0,data:{$a:this.h,baseMediaDecodeTime:a,Na:k},stream:b};d=new Qu([d]);c=b.id+"_"+c.i;this.g.has(c)?b=this.g.get(c):(b=Wu(d),this.g.set(c,b));c=this.i!==b;d=mv(d);this.i=b;this.h++;return c?(b=Jd(b,d),Promise.resolve(b)):Promise.resolve(d)};
|
|
983
|
+
O("shaka.transmuxer.Ec3Transmuxer",uv);uv.prototype.transmux=uv.prototype.transmux;uv.prototype.getOriginalMimeType=uv.prototype.getOriginalMimeType;uv.prototype.convertCodecs=uv.prototype.convertCodecs;uv.prototype.isSupported=uv.prototype.isSupported;uv.prototype.destroy=uv.prototype.destroy;kc("audio/ec3",function(){return new uv("audio/ec3")},qc);function vv(a){if(!a.length)return null;var b=a.find(function(x){return 7==x.type});a=a.find(function(x){return 8==x.type});if(!b||!a)return null;var c=new Xg(b.data),d=dh(c);dh(c);dh(c);bh(c);if(wv.includes(d)&&(d=T(c),3===d&&Zg(c,1),bh(c),bh(c),Zg(c,1),V(c))){d=3!==d?8:12;for(var e=0;e<d;e++)V(c)&&(6>e?eh(c,16):eh(c,64))}bh(c);d=T(c);if(0===d)T(c);else if(1===d)for(Zg(c,1),bh(c),bh(c),d=T(c),e=0;e<d;e++)bh(c);bh(c);Zg(c,1);var f=T(c),g=T(c),h=$g(c,1);0===h&&Zg(c,1);Zg(c,1);var k=0,l=0,m=0,n=0;V(c)&&
|
|
984
|
+
(k=T(c),l=T(c),m=T(c),n=T(c));e=d=1;if(V(c)&&V(c)){var q=dh(c),p=[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=p[q-1],e=u[q-1]):255===q&&(d=$g(c,16),e=$g(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,y(b));b=[];a=a.fullData;b.push(a.byteLength>>>8&255);b.push(a.byteLength&255);b=b.concat.apply(b,y(a));a=new Uint8Array([1,k[3],k[4],k[5],255,
|
|
985
|
+
225].concat(k,[1],b));return{height:c,width:f,oa:a,sa:d,ua:e}}
|
|
986
|
+
function xv(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=[],x=t(e.nalus),v=x.next();!v.done;v=x.next()){v=v.value;var z=v.fullData.byteLength,w=new Uint8Array(4);w[0]=z>>24&255;w[1]=z>>16&255;w[2]=z>>8&255;w[3]=z&255;u.push(w);u.push(v.fullData)}e.data=Jd.apply(Dd,y(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=
|
|
987
|
+
k.next();!m.done;m=k.next()){m=m.value;var n=!1;switch(m.type){case 1:var q=!1;n=!0;var p=m.data;l&&4<p.length&&(p=fh(new Xg(p)),2===p||4===p||7===p||9===p)&&(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();
|
|
988
|
+
return d}var wv=[100,110,122,244,44,83,86,118,128,138,139,134];function yv(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=zv(b.fullData);a=Av(c.fullData);var f=Bv(d.fullData);b=Cv(b.fullData,c.fullData,d.fullData,{ee:e.ee,Be:e.Be,Ld:a.Ld,Md:a.Md,Fd:a.Fd,Kd:a.Kd,Gd:a.Gd,Hd:a.Hd,Id:a.Id,Jd:a.Jd,yd:a.yd,zd:a.zd,Bd:a.Bd,Cd:a.Cd,Dd:a.Dd,Ed:a.Ed,td:a.td,ad:a.ad,sd:a.sd,rd:a.rd,qd:a.qd,ie:f.ie});return{height:a.height,width:a.width,
|
|
989
|
+
oa:b,sa:a.gh,ua:a.fh}}function zv(a){var b=new Xg(a,!0);dh(b);dh(b);$g(b,4);$g(b,2);$g(b,6);a=$g(b,3);b=V(b);return{ee:a+1,Be:b}}
|
|
990
|
+
function Av(a){a=new Xg(a,!0);dh(a);dh(a);var b=0,c=0,d=0,e=0;$g(a,4);var f=$g(a,3);V(a);for(var g=$g(a,2),h=$g(a,1),k=$g(a,5),l=dh(a),m=dh(a),n=dh(a),q=dh(a),p=dh(a),u=dh(a),x=dh(a),v=dh(a),z=dh(a),w=dh(a),E=dh(a),F=[],D=[],I=0;I<f;I++)F.push(V(a)),D.push(V(a));if(0<f)for(I=f;8>I;I++)$g(a,2);for(I=0;I<f;I++)F[I]&&$g(a,88),D[I]&&dh(a);T(a);F=T(a);3==F&&$g(a,1);D=T(a);I=T(a);V(a)&&(b+=T(a),c+=T(a),d+=T(a),e+=T(a));var A=T(a),C=T(a),B=T(a);if(V(a))for(var H=0;H<=f;H++)T(a),T(a),T(a);else T(a),T(a),
|
|
991
|
+
T(a);T(a);T(a);T(a);T(a);T(a);T(a);if(V(a)&&V(a))for(H=0;4>H;H++)for(var G=0;G<(3===H?2:6);G++)if(V(a)){var N=Math.min(64,1<<4+(H<<1));1<H&&ch(a);for(var Q=0;Q<N;Q++)ch(a)}else T(a);V(a);V(a);V(a)&&(dh(a),T(a),T(a),V(a));H=T(a);for(N=G=0;N<H;N++)if(Q=!1,0!==N&&(Q=V(a)),Q){N===H&&T(a);V(a);T(a);for(var M=Q=0;M<=G;M++){var P=V(a),aa=!1;P||(aa=V(a));(P||aa)&&Q++}G=Q}else{M=T(a);Q=T(a);G=M+Q;for(P=0;P<M;P++)T(a),V(a);for(M=0;M<Q;M++)T(a),V(a)}if(V(a))for(H=T(a),G=0;G<H;G++){for(N=0;N<B+4;N++)$g(a,1);
|
|
992
|
+
$g(a,1)}H=B=1;G=0;V(a);V(a);if(V(a)){V(a)&&(N=dh(a),Q=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],M=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1],0<N&&16>=N?(B=Q[N-1],H=M[N-1]):255===N&&(B=$g(a,16),H=$g(a,16)));V(a)&&V(a);V(a)&&($g(a,3),V(a),V(a)&&(dh(a),dh(a),dh(a)));V(a)&&(T(a),T(a));V(a);V(a);V(a);if(N=V(a))T(a),T(a),T(a),T(a);if(V(a)&&($g(a,32),$g(a,32),V(a)&&T(a),V(a))){M=!1;N=V(a);Q=V(a);if(N||Q){if(M=V(a))dh(a),$g(a,5),V(a),$g(a,5);$g(a,4);$g(a,4);M&&$g(a,4);$g(a,5);$g(a,5);$g(a,5)}for(P=
|
|
993
|
+
0;P<=f;P++){var R=!0;aa=1;V(a)||(R=V(a));var W=!1;R?T(a):W=V(a);W||(aa=T(a)+1);if(N){for(R=0;R<aa;R++)T(a),T(a),M&&(T(a),T(a));V(a)}if(Q){for(R=0;R<aa;R++)T(a),T(a),M&&(T(a),T(a));V(a)}}}V(a)&&(V(a),V(a),V(a),G=T(a),T(a),T(a),T(a),T(a))}return{Fd:E,Ld:g,Md:h,Kd:k,Gd:l,Hd:m,Id:n,Jd:q,yd:p,zd:u,Bd:x,Cd:v,Dd:z,Ed:w,ad:G,td:0,sd:F,rd:A,qd:C,width:D-(b+c)*(1===F||2===F?2:1),height:I-(d+e)*(1===F?2:1),gh:B,fh:H}}
|
|
994
|
+
function Bv(a){var b=new Xg(a,!0);dh(b);dh(b);T(b);T(b);V(b);V(b);$g(b,3);V(b);V(b);T(b);T(b);ch(b);V(b);V(b);V(b)&&T(b);ch(b);ch(b);V(b);V(b);V(b);V(b);a=V(b);b=V(b);var c=1;b&&a?c=0:b?c=3:a&&(c=2);return{ie:c}}
|
|
995
|
+
function Cv(a,b,c,d){var e=new Uint8Array(23+(5+a.byteLength)+(5+b.byteLength)+(5+c.byteLength));e[0]=1;e[1]=(d.Ld&3)<<6|(d.Md?1:0)<<5|d.Kd&31;e[2]=d.Gd;e[3]=d.Hd;e[4]=d.Id;e[5]=d.Jd;e[6]=d.yd;e[7]=d.zd;e[8]=d.Bd;e[9]=d.Cd;e[10]=d.Dd;e[11]=d.Ed;e[12]=d.Fd;e[13]=240|(d.ad&3840)>>8;e[14]=d.ad&255;e[15]=252|d.ie&3;e[16]=252|d.sd&3;e[17]=248|d.rd&7;e[18]=248|d.qd&7;e[19]=0;e[20]=0;e[21]=(d.td&3)<<6|(d.ee&7)<<3|(d.Be?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&
|
|
996
|
+
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 Dv(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*Ev[14*(3===c?3-d:3===d?3:4)+e-1];f=Fv[3*(3===c?0:2===c?1:2)+f];c=Gv[c][d];var h=Hv[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,V:k,eh:8*c*h}}return null}
|
|
997
|
+
function Iv(a,b){return 255===a[b]&&224===(a[b+1]&224)&&0!==(a[b+1]&6)}function Jv(a,b){if(b+1<a.length&&Iv(a,b)){var c=Dv(a,b),d=4;c&&c.V&&(d=c.V);b+=d;return b===a.length||b+1<a.length&&Iv(a,b)}return!1}
|
|
998
|
+
var Ev=[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],Fv=[44100,48E3,32E3,22050,24E3,16E3,11025,12E3,8E3],Gv=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Hv=[0,1,1,4];function Kv(a){this.j=a;this.h=0;this.g=new Map;this.i=null}r=Kv.prototype;r.destroy=function(){this.g.clear()};r.isSupported=function(a){return"audio/mpeg"==a.toLowerCase().split(";")[0]?lb(this.convertCodecs("audio",a)):!1};r.convertCodecs=function(a,b){return"audio/mpeg"==b.toLowerCase().split(";")[0]?'audio/mp4; codecs="mp3"':b};r.getOriginalMimeType=function(){return this.j};
|
|
999
|
+
r.transmux=function(a,b,c,d){for(var e=yb(a),f=vh(e).length;f<e.length&&!Jv(e,f);f++);var g;for(a=[];f<e.length;){var h=Dv(e,f);if(!h)return Promise.reject(new S(2,3,3018,c?c.J()[0]:null));g||(g=h);f+h.V<=e.length&&a.push({data:e.subarray(f,f+h.V),size:h.V,duration:1152,Ia:0,flags:{La:0,Ga:0,Fa:0,Ca:0,Da:2,Ma:0}});f+=h.V}if(!g)return Promise.reject(new S(2,3,3018,c?c.J()[0]:null));e=9E4*g.eh/g.sampleRate*this.h;d={id:b.id,type:"audio",codecs:"mp3",encrypted:b.encrypted&&0<b.drmInfos.length,timescale:g.sampleRate,
|
|
1000
|
+
duration:d,Ua:[],ia:new Uint8Array([]),oa:new Uint8Array([]),sa:0,ua:0,data:{$a:this.h,baseMediaDecodeTime:e,Na:a},stream:b};d=new Qu([d]);c=b.id+"_"+c.i;this.g.has(c)?b=this.g.get(c):(b=Wu(d),this.g.set(c,b));c=this.i!==b;d=mv(d);this.i=b;this.h++;return c?(b=Jd(b,d),Promise.resolve(b)):Promise.resolve(d)};O("shaka.transmuxer.Mp3Transmuxer",Kv);Kv.prototype.transmux=Kv.prototype.transmux;Kv.prototype.getOriginalMimeType=Kv.prototype.getOriginalMimeType;Kv.prototype.convertCodecs=Kv.prototype.convertCodecs;
|
|
1001
|
+
Kv.prototype.isSupported=Kv.prototype.isSupported;Kv.prototype.destroy=Kv.prototype.destroy;kc("audio/mpeg",function(){return new Kv("audio/mpeg")},qc);function Lv(a){this.h=a;this.g=null}r=Lv.prototype;r.destroy=function(){};r.isSupported=function(a){if("video/mp2t"!=a.toLowerCase().split(";")[0])return!1;var b=je(a).split(","),c=Od("audio",b);b=Od("video",b);return!c||b||"mp3"!=ae(c)?!1:lb(this.convertCodecs("audio",a))};r.convertCodecs=function(a,b){return"video/mp2t"==b.toLowerCase().split(";")[0]?"audio/mpeg":b};r.getOriginalMimeType=function(){return this.h};
|
|
1002
|
+
r.transmux=function(a,b,c,d,e){this.g?this.g.clearData():this.g=new wh;a=yb(a);a=this.g.parse(a);if("mp3"!=a.lc().audio||"audio"!=e)return Promise.reject(new S(2,3,3018,c?c.J()[0]:null));c=new Uint8Array([]);e=t(a.Ja());for(a=e.next();!a.done;a=e.next())if(a=a.value.data)for(b=0;b<a.length;)(d=Dv(a,b))?(b+d.V<=a.length&&(c=Jd(c,a.subarray(b,b+d.V))),b+=d.V):b++;return Promise.resolve(c)};O("shaka.transmuxer.MpegTsTransmuxer",Lv);Lv.prototype.transmux=Lv.prototype.transmux;
|
|
1003
|
+
Lv.prototype.getOriginalMimeType=Lv.prototype.getOriginalMimeType;Lv.prototype.convertCodecs=Lv.prototype.convertCodecs;Lv.prototype.isSupported=Lv.prototype.isSupported;Lv.prototype.destroy=Lv.prototype.destroy;kc("video/mp2t",function(){return new Lv("video/mp2t")},pc);function Mv(a){this.m=a;this.g=0;this.i=new Map;this.l=this.h=this.j=null}r=Mv.prototype;r.destroy=function(){this.i.clear();this.h&&this.h.destroy()};
|
|
1004
|
+
r.isSupported=function(a,b){if("video/mp2t"!=a.toLowerCase().split(";")[0])return!1;var c=a;b&&(c=this.convertCodecs(b,a));var d=je(c).split(",");c=Od("audio",d);d=Od("video",d);if(c&&(c=ae(c),!Nv.includes(c))||d&&(c=ae(d),!Ov.includes(c)))return!1;if(b)return lb(this.convertCodecs(b,a));b=this.convertCodecs("audio",a);a=this.convertCodecs("video",a);return lb(b)||lb(a)};
|
|
1005
|
+
r.convertCodecs=function(a,b){return"video/mp2t"==b.toLowerCase().split(";")[0]?(b=je(b).replace("mp4a.40.34","mp3").split(",").map(function(c){return $e(c,"audio/mp4")}).map(af).join(","),"audio"==a?'audio/mp4; codecs="'+b+'"':'video/mp4; codecs="'+b+'"'):b};r.getOriginalMimeType=function(){return this.m};
|
|
1006
|
+
r.transmux=function(a,b,c,d,e){var f=yb(a);if("audio"==e&&!Dh(f)){for(var g=vh(f),h=g.length;h<f.length;h++)if(Jv(f,h))return Promise.reject(new S(2,3,3018,c?c.J()[0]:null));for(h=g.length;h<f.length;h++)if(Ou(f,h))return this.h||(this.h=new pv("audio/aac")),this.h.transmux(a,b,c,d,e);return Promise.reject(new S(2,3,3018,c?c.J()[0]:null))}this.j?this.j.clearData():this.j=new wh;var k=this.j.parse(f),l=[],m=k.lc();try{var n=null;if("video"==e){switch(m.video){case "avc":var q=[],p=null,u=k.Tb(),x=
|
|
1007
|
+
xv(u);if(!x.length)throw new S(2,3,3023,c?c.J()[0]:null);for(var v=0;v<x.length;v++){var z=x[v];null==p&&(p=z.dts);var w=void 0;w=v+1<x.length?(x[v+1].dts||0)-(z.dts||0):1<x.length?(z.dts||0)-(x[v-1].dts||0):9E4*(c.endTime-c.startTime);q.push({data:z.data,size:z.data.byteLength,duration:w,Ia:Math.round((z.pts||0)-(z.dts||0)),flags:{La:0,Ga:0,Fa:0,Ca:0,Da:z.isKeyframe?2:1,Ma:z.isKeyframe?0:1}})}for(var E=[],F=t(u),D=F.next();!D.done;D=F.next())E.push.apply(E,y(D.value.nalus));var I=vv(E);if(!I||null==
|
|
1008
|
+
p)throw new S(2,3,3018,c?c.J()[0]:null);b.height=I.height;b.width=I.width;n={id:b.id,type:"video",codecs:"avc1",encrypted:b.encrypted&&0<b.drmInfos.length,timescale:9E4,duration:d,Ua:[],ia:new Uint8Array([]),oa:I.oa,sa:I.sa,ua:I.ua,data:{$a:this.g,baseMediaDecodeTime:p,Na:q},stream:b};break;case "hvc":var A=[],C=null,B=[],H=k.Tb();if(!H.length)throw new S(2,3,3023,c?c.J()[0]:null);for(var G=0;G<H.length;G++){var N=H[G],Q=N.nalus;B.push.apply(B,y(Q));for(var M=!1,P=[],aa=!1,R=t(Q),W=R.next();!W.done;W=
|
|
1009
|
+
R.next()){var U=W.value;switch(U.type){case 1:case 0:var ba=aa=!0;break;case 19:case 20:case 21:M=ba=aa=!0;break;case 32:ba=!0;break;case 33:ba=!0;break;case 34:ba=!0;break;case 35:aa=ba=!0;break;case 39:case 40:ba=!0;break;default:ba=!1}if(aa&&ba){var pa=U.fullData.byteLength,oa=new Uint8Array(4);oa[0]=pa>>24&255;oa[1]=pa>>16&255;oa[2]=pa>>8&255;oa[3]=pa&255;P.push(oa);P.push(U.fullData)}}var qa=P.length?{data:Jd.apply(Dd,y(P)),isKeyframe:M}:null;if(qa){null==C&&null!=N.dts&&(C=N.dts);var Aa=void 0;
|
|
1010
|
+
Aa=G+1<H.length?(H[G+1].dts||0)-(N.dts||0):1<H.length?(N.dts||0)-(H[G-1].dts||0):9E4*(c.endTime-c.startTime);A.push({data:qa.data,size:qa.data.byteLength,duration:Aa,Ia:Math.round((N.pts||0)-(N.dts||0)),flags:{La:0,Ga:0,Fa:0,Ca:0,Da:qa.isKeyframe?2:1,Ma:qa.isKeyframe?0:1}})}}var Ha=yv(B);if(!Ha||null==C)throw new S(2,3,3018,c?c.J()[0]:null);b.height=Ha.height;b.width=Ha.width;n={id:b.id,type:"video",codecs:"hvc1",encrypted:b.encrypted&&0<b.drmInfos.length,timescale:9E4,duration:d,Ua:[],ia:new Uint8Array([]),
|
|
1011
|
+
oa:Ha.oa,sa:Ha.sa,ua:Ha.ua,data:{$a:this.g,baseMediaDecodeTime:C,Na:A},stream:b}}n&&(l.push(n),n=null)}if("audio"==e){switch(m.audio){case "aac":for(var Da=[],hb,Ia=null,ic=null,ld=null,jq=t(k.Ja()),qk=jq.next();!qk.done;qk=jq.next()){var ih=qk.value,Vb=ih.data;if(Vb){var Ob=0;if(-1==ic&&ld)Vb=Jd(ld,ih.data),ic=null;else if(null!=ic&&ld){Ob=Math.max(0,ic);var kq=Jd(ld,Vb.subarray(0,Ob));Da.push({data:kq,size:kq.byteLength,duration:1024,Ia:0,flags:{La:0,Ga:0,Fa:0,Ca:0,Da:2,Ma:0}});ic=ld=null}hb=Nu(Vb,
|
|
1012
|
+
Ob);if(!hb)throw new S(2,3,3018,c?c.J()[0]:null);b.audioSamplingRate=hb.sampleRate;b.channelsCount=hb.channelCount;null==Ia&&null!==ih.pts&&(Ia=ih.pts);for(;Ob<Vb.length;){var de=Mu(Vb,Ob);if(!de){ld=Vb.subarray(Ob,Vb.length);ic=-1;break}var nf=de.sc+de.V;ic=Math.max(0,Ob+nf-Vb.length);0!=ic?ld=Vb.subarray(Ob+de.sc,Ob+nf):Ob+nf<=Vb.length&&Da.push({data:Vb.subarray(Ob+de.sc,Ob+nf),size:de.V,duration:1024,Ia:0,flags:{La:0,Ga:0,Fa:0,Ca:0,Da:2,Ma:0}});Ob+=nf}}}if(!hb||null==Ia){if(!k.Tb().length)throw new S(2,
|
|
1013
|
+
3,3018,c?c.J()[0]:null);Ia=9E4*c.startTime;var rk=Od("audio",b.codecs.split(","));if(!rk||!b.channelsCount||!b.audioSamplingRate)throw new S(2,3,3018,c?c.J()[0]:null);hb={sampleRate:b.audioSamplingRate,channelCount:b.channelsCount,codec:rk};var sk=Pu(rk,b.channelsCount);if(!sk)throw new S(2,3,3018,c?c.J()[0]:null);for(var Dw=Ia+9E4*(c.endTime-c.startTime),lq=Ia;lq<Dw;)Da.push({data:sk,size:sk.byteLength,duration:1024,Ia:0,flags:{La:0,Ga:0,Fa:0,Ca:0,Da:2,Ma:0}}),lq+=1024/hb.sampleRate*9E4}var mq=hb.sampleRate,
|
|
1014
|
+
Ew=Ia/9E4*mq;n={id:b.id,type:"audio",codecs:hb.codec,encrypted:b.encrypted&&0<b.drmInfos.length,timescale:mq,duration:d,Ua:[],ia:new Uint8Array([]),oa:new Uint8Array([]),sa:0,ua:0,data:{$a:this.g,baseMediaDecodeTime:Ew,Na:Da},stream:b};break;case "ac3":for(var nq=[],jh=0,tk=new Uint8Array([]),kh=null,oq=t(k.Ja()),uk=oq.next();!uk.done;uk=oq.next()){var vk=uk.value,wk=vk.data;null==kh&&null!==vk.pts&&(kh=vk.pts);for(var ee=0;ee<wk.length;){var Nc=qv(wk,ee);Nc?(b.audioSamplingRate=Nc.sampleRate,b.channelsCount=
|
|
1015
|
+
Nc.channelCount,jh=Nc.sampleRate,tk=Nc.ia,nq.push({data:wk.subarray(ee,ee+Nc.V),size:Nc.V,duration:1536,Ia:0,flags:{La:0,Ga:0,Fa:0,Ca:0,Da:2,Ma:0}}),ee+=Nc.V):ee++}}if(0==jh||0==tk.byteLength||null==kh)throw new S(2,3,3018,c?c.J()[0]:null);var Fw=kh/9E4*jh;n={id:b.id,type:"audio",codecs:"ac-3",encrypted:b.encrypted&&0<b.drmInfos.length,timescale:jh,duration:d,Ua:[],ia:tk,oa:new Uint8Array([]),sa:0,ua:0,data:{$a:this.g,baseMediaDecodeTime:Fw,Na:nq},stream:b};break;case "ec3":for(var pq=[],lh=0,xk=
|
|
1016
|
+
new Uint8Array([]),mh=null,qq=t(k.Ja()),yk=qq.next();!yk.done;yk=qq.next()){var zk=yk.value,Ak=zk.data;null==mh&&null!==zk.pts&&(mh=zk.pts);for(var fe=0;fe<Ak.length;){var Oc=tv(Ak,fe);Oc?(b.audioSamplingRate=Oc.sampleRate,b.channelsCount=Oc.channelCount,lh=Oc.sampleRate,xk=Oc.ia,pq.push({data:Ak.subarray(fe,fe+Oc.V),size:Oc.V,duration:1536,Ia:0,flags:{La:0,Ga:0,Fa:0,Ca:0,Da:2,Ma:0}}),fe+=Oc.V):fe++}}if(0==lh||0==xk.byteLength||null==mh)throw new S(2,3,3018,c?c.J()[0]:null);var Gw=mh/9E4*lh;n={id:b.id,
|
|
1017
|
+
type:"audio",codecs:"ec-3",encrypted:b.encrypted&&0<b.drmInfos.length,timescale:lh,duration:d,Ua:[],ia:xk,oa:new Uint8Array([]),sa:0,ua:0,data:{$a:this.g,baseMediaDecodeTime:Gw,Na:pq},stream:b};break;case "mp3":for(var rq=[],nh,oh=null,sq=t(k.Ja()),Bk=sq.next();!Bk.done;Bk=sq.next()){var Ck=Bk.value,of=Ck.data;if(of){null==oh&&null!==Ck.pts&&(oh=Ck.pts);for(var md=0;md<of.length;){var ge=Dv(of,md);ge?(nh||(nh=ge),md+ge.V<=of.length&&rq.push({data:of.subarray(md,md+ge.V),size:ge.V,duration:1152,Ia:0,
|
|
1018
|
+
flags:{La:0,Ga:0,Fa:0,Ca:0,Da:2,Ma:0}}),md+=ge.V):md++}}}if(!nh||null==oh)throw new S(2,3,3018,c?c.J()[0]:null);var tq=nh.sampleRate,Hw=oh/9E4*tq;n={id:b.id,type:"audio",codecs:"mp3",encrypted:b.encrypted&&0<b.drmInfos.length,timescale:tq,duration:d,Ua:[],ia:new Uint8Array([]),oa:new Uint8Array([]),sa:0,ua:0,data:{$a:this.g,baseMediaDecodeTime:Hw,Na:rq},stream:b};break;case "opus":var uq=[],ph=null,jc=k.D;if(!jc)throw new S(2,3,3018,c?c.J()[0]:null);var eb=[];switch(jc.Wf){case 1:case 2:eb=[0];break;
|
|
1019
|
+
case 0:eb=[255,1,1,0,1];break;case 128:eb=[255,2,0,0,1];break;case 3:eb=[1,2,1,0,2,1];break;case 4:eb=[1,2,2,0,1,2,3];break;case 5:eb=[1,3,2,0,4,1,2,3];break;case 6:eb=[1,4,2,0,4,1,2,3,5];break;case 7:eb=[1,4,2,0,4,1,2,3,5,6];break;case 8:eb=[1,5,3,0,6,1,2,3,4,5,7];break;case 130:eb=[1,1,2,0,1];break;case 131:eb=[1,1,3,0,1,2];break;case 132:eb=[1,1,4,0,1,2,3];break;case 133:eb=[1,1,5,0,1,2,3,4];break;case 134:eb=[1,1,6,0,1,2,3,4,5];break;case 135:eb=[1,1,7,0,1,2,3,4,5,6];break;case 136:eb=[1,1,8,
|
|
1020
|
+
0,1,2,3,4,5,6,7]}var vq=new Uint8Array([0,jc.channelCount,0,0,jc.sampleRate>>>24&255,jc.sampleRate>>>17&255,jc.sampleRate>>>8&255,jc.sampleRate>>>0&255,0,0].concat(y(eb)));for(var wq=jc.sampleRate,xq=t(k.Ja()),Dk=xq.next();!Dk.done;Dk=xq.next()){var Ek=Dk.value,he=Ek.data;null==ph&&null!==Ek.pts&&(ph=Ek.pts);for(var pf=0;pf<he.length;){for(var Iw=0!==(he[pf+1]&16),Jw=0!==(he[pf+1]&8),vc=pf+2,qh=0;255===he[vc];)qh+=255,vc+=1;qh+=he[vc];vc+=1;vc+=Iw?2:0;vc+=Jw?2:0;var yq=he.slice(vc,vc+qh);uq.push({data:yq,
|
|
1021
|
+
size:yq.byteLength,duration:960,Ia:0,flags:{La:0,Ga:0,Fa:0,Ca:0,Da:2,Ma:0}});pf=vc+qh}}if(0==vq.byteLength||null==ph)throw new S(2,3,3018,c?c.J()[0]:null);b.audioSamplingRate=jc.sampleRate;b.channelsCount=jc.channelCount;var Kw=ph/9E4*wq;n={id:b.id,type:"audio",codecs:"opus",encrypted:b.encrypted&&0<b.drmInfos.length,timescale:wq,duration:d,Ua:[],ia:vq,oa:new Uint8Array([]),sa:0,ua:0,data:{$a:this.g,baseMediaDecodeTime:Kw,Na:uq},stream:b}}n&&(l.push(n),n=null)}}catch(Fk){return Fk&&3023==Fk.code?
|
|
1022
|
+
Promise.resolve(new Uint8Array([])):Promise.reject(Fk)}if(!l.length)return Promise.reject(new S(2,3,3018,c?c.J()[0]:null));var zq=new Qu(l),Gk=b.id+"_"+c.i;if(this.i.has(Gk))var qf=this.i.get(Gk);else qf=Wu(zq),this.i.set(Gk,qf);var Lw=this.l!==qf,Aq=mv(zq);this.l=qf;this.g++;if(Lw){var Mw=Jd(qf,Aq);return Promise.resolve(Mw)}return Promise.resolve(Aq)};O("shaka.transmuxer.TsTransmuxer",Mv);Mv.prototype.transmux=Mv.prototype.transmux;Mv.prototype.getOriginalMimeType=Mv.prototype.getOriginalMimeType;
|
|
1023
|
+
Mv.prototype.convertCodecs=Mv.prototype.convertCodecs;Mv.prototype.isSupported=Mv.prototype.isSupported;Mv.prototype.destroy=Mv.prototype.destroy;var Nv=["aac","ac-3","ec-3","mp3","opus"],Ov=["avc","hevc"];kc("video/mp2t",function(){return new Mv("video/mp2t")},oc);function Pv(){this.m=[];this.h=[];this.g=[];this.j=[];this.i=[];this.u=this.o=!1;this.l=new Set}r=Pv.prototype;r.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.m=[];this.u=this.o=!1;this.l.clear()};r.Dg=function(){return this.m};r.yg=function(){return this.j.slice()};r.jg=function(){return this.i};
|
|
1024
|
+
r.bg=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}));else if(a.type==Qd)for(c=t(this.j),d=c.next();!d.done;d=c.next())d=
|
|
1025
|
+
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.l.delete(b)}};
|
|
1026
|
+
function Qv(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[Rv(n),n]}));var k=new Map(h.videoStreams.map(function(n){return[Sv(n),n]})),l=new Map(h.textStreams.map(function(n){return[Tv(n),n]}));h=new Map(h.imageStreams.map(function(n){return[Uv(n),n]}));if(b){var m=Vv(Qd);l.set(Tv(m),m);m=Vv("image");h.set(Uv(m),m)}c.push(g);d.push(k);e.push(l);f.push(h)}return{Le:c,If:d,Ff:e,Ye:f}}
|
|
1027
|
+
r.Zf=function(a,b,c){c=void 0===c?!1:c;var d=this,e,f,g,h,k,l,m,n,q,p,u,x,v,z,w,E,F,D,I,A,C,B,H,G,N,Q,M,P,aa,R;return L(function(W){if(1==W.g){e=Sd;if(!b&&1==a.length)return f=Qv(a,!1),g=f.Le,h=f.If,k=f.Ff,l=f.Ye,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.s(2);m=c?d.l.size:0;n=-1;for(q=0;q<a.length;q++)p=a[q],d.l.has(p.id)||(d.l.add(p.id),-1==n&&(n=q));if(-1==n)return W.return();u=Qv(a,!0);x=u.Le;v=u.If;z=u.Ff;w=u.Ye;return J(W,
|
|
1028
|
+
Promise.all([Wv(d,d.h,x,n,m),Wv(d,d.g,v,n,m),Wv(d,d.j,z,n,m),Wv(d,d.i,w,n,m)]),2)}E=0;F=[];if(d.g.length&&d.h.length)for(H=t(d.h),G=H.next();!G.done;G=H.next())for(N=G.value,Q=t(d.g),M=Q.next();!M.done;M=Q.next())P=M.value,aa=Mc(N.drmInfos,P.drmInfos),N.drmInfos.length&&P.drmInfos.length&&!aa.length||(R=E++,F.push({id:R,language:N.language,disabledUntilTime:0,primary:N.primary,audio:N,video:P,bandwidth:(N.bandwidth||0)+(P.bandwidth||0),drmInfos:aa,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]}));
|
|
1029
|
+
else for(D=d.g.length?d.g:d.h,I=t(D),A=I.next();!A.done;A=I.next())C=A.value,B=E++,F.push({id:B,language:C.language,disabledUntilTime:0,primary:C.primary,audio:C.type==e.S?C:null,video:C.type==e.da?C:null,bandwidth:C.bandwidth||0,drmInfos:C.drmInfos,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]});d.m=F;K(W)})};
|
|
1030
|
+
function Wv(a,b,c,d,e){var f=Xv,g=Yv,h,k,l,m,n,q,p,u,x,v,z,w,E,F,D,I,A,C,B,H;return L(function(G){switch(G.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){G.s(4);break}n=m.value;return J(G,Zv(a,n,c,d,g,h,e),5);case 5:q=G.h;if(!q)throw new S(2,4,4037);m=l.next();G.s(2);break;case 4:p=t(h);for(u=p.next();!u.done;u=p.next())for(x=u.value,v=t(x),z=v.next();!z.done;z=v.next())w=z.value,(E=$v(a,w,c,f,g,h))&&b.push(E);F=t(h);for(D=
|
|
1031
|
+
F.next();!D.done;D=F.next())for(I=D.value,A=t(I),C=A.next(),B={};!C.done;B={xe:void 0},C=A.next())if(B.xe=C.value,!aw(B.xe)&&(H=b.some(function(N){return function(Q){return bw(a,N.xe,Q)}}(B))))throw new S(2,4,4037);return G.return(b)}})}function Zv(a,b,c,d,e,f,g){return L(function(h){if(1==h.g)return cw(a,c,b,0<g),b.matchedStreams?b.segmentIndex?J(h,dw(b,d+g),2):h.s(2):h.return(!1);ew(b,d,e,f,g);return h.return(!0)})}
|
|
1032
|
+
function dw(a,b){var c,d,e,f,g,h;return L(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());return J(k,Promise.all(c),2)}if(a.segmentIndex instanceof oi)for(g=b;g<d.length;g++)h=d[g],h.segmentIndex&&a.segmentIndex.h.push(h.segmentIndex);K(k)})}
|
|
1033
|
+
function $v(a,b,c,d,e,f){if(aw(b))return null;var g=d(b);cw(a,c,g);g.createSegmentIndex&&(g.createSegmentIndex=function(){return L(function(h){if(g.segmentIndex)return h.s(0);g.segmentIndex=new oi;return J(h,dw(g,0),0)})});if(!g.matchedStreams||!g.matchedStreams.length)return null;ew(g,0,e,f,0);return g}
|
|
1034
|
+
function ew(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==De(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)}}
|
|
1035
|
+
function Xv(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):
|
|
1036
|
+
null;b.trickModeVideo=null;return b}
|
|
1037
|
+
function Yv(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=Mc(a.drmInfos,b.drmInfos);if(b.drmInfos.length&&a.drmInfos.length&&!d.length)throw new S(2,
|
|
1038
|
+
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=Xv(b.trickModeVideo),a.trickModeVideo.matchedStreams=[],a.trickModeVideo.createSegmentIndex=function(){if(a.trickModeVideo.segmentIndex)return Promise.resolve();
|
|
1039
|
+
for(var g=new oi,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),Yv(a.trickModeVideo,b.trickModeVideo)):a.trickModeVideo&&(a.trickModeVideo.matchedStreams.push(b),Yv(a.trickModeVideo,b))}
|
|
1040
|
+
function cw(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=fw(a,e.value,c);if(!e)return;d.push(e)}c.matchedStreams=d}
|
|
1041
|
+
function fw(a,b,c){var d={audio:Rv,video:Sv,text:Tv,image:Uv}[c.type],e=null,f=d(c);if(b.has(f))e=b.get(f);else{f={audio:function(l,m){return bw(a,l,m)},video:function(l,m){return bw(a,l,m)},text:gw,image:hw}[c.type];for(var g={audio:iw,video:jw,text:kw,image:lw}[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.u&&!aw(e)&&b.delete(d(e));return e}
|
|
1042
|
+
function mw(a,b){return a.mimeType!=b.mimeType?!1:nw(a.codecs)===nw(b.codecs)}r.ih=function(a){this.o=a};r.oh=function(a){this.u=a};function bw(a,b,c){return!mw(b,c)&&!a.o||b.drmInfos&&!Lc(b.drmInfos,c.drmInfos)?!1:!0}function gw(a,b){return b.language?a.forced!==b.forced||0==De(a.language,b.language)||b.kind!=a.kind?!1:!0:!0}function hw(){return!0}
|
|
1043
|
+
function iw(a,b,c){var d=mw(a,b),e=mw(a,c);if(d&&!e)return!1;if(!d&&e)return!0;d=De(a.language,b.language);e=De(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<
|
|
1044
|
+
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=ow(a.channelsCount,b.channelsCount,c.channelsCount);if(d==pw)return!0;if(d==qw)return!1;d=ow(a.audioSamplingRate,b.audioSamplingRate,c.audioSamplingRate);return d==pw?!0:d==qw?!1:a.bandwidth&&rw(a.bandwidth,b.bandwidth,c.bandwidth)==pw?!0:!1}
|
|
1045
|
+
function jw(a,b,c){var d=mw(a,b),e=mw(a,c);if(d&&!e)return!1;if(!d&&e)return!0;d=ow(a.width*a.height,b.width*b.height,c.width*c.height);if(d==pw)return!0;if(d==qw)return!1;if(a.frameRate){d=ow(a.frameRate,b.frameRate,c.frameRate);if(d==pw)return!0;if(d==qw)return!1}return a.bandwidth&&rw(a.bandwidth,b.bandwidth,c.bandwidth)==pw?!0:!1}
|
|
1046
|
+
function kw(a,b,c){var d=De(a.language,b.language),e=De(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;
|
|
1047
|
+
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 lw(a,b,c){return ow(a.width*a.height,b.width*b.height,c.width*c.height)==pw?!0:!1}
|
|
1048
|
+
function Vv(a){return{id:0,originalId:"",groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new li([]),mimeType:"",codecs:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"",originalLanguage:null,label:null,type:a,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!1,fastSwitching:!1,fullMimeTypes:new Set}}
|
|
1049
|
+
function ow(a,b,c){if(b==a&&a!=c)return qw;if(c==a&&a!=b)return pw;if(b>a){if(c<=a||c-a<b-a)return pw;if(c-a>b-a)return qw}else{if(c>a)return qw;if(a-c<a-b)return pw;if(a-c>a-b)return qw}return sw}function rw(a,b,c){b=Math.abs(a-b);a=Math.abs(a-c);return a<b?pw:b<a?qw:sw}function aw(a){switch(a.type){case Qd:return!a.language;case "image":return!a.tilesLayout;default:return!1}}
|
|
1050
|
+
function Sv(a){return JSON.stringify([a.fastSwitching,a.width,a.frameRate,nw(a.codecs),a.mimeType,a.label,a.roles,a.closedCaptions?Array.from(a.closedCaptions.entries()):null,a.bandwidth,Array.from(a.keyIds)])}function Rv(a){return JSON.stringify([a.fastSwitching,a.channelsCount,a.language,a.bandwidth,a.label,nw(a.codecs),a.mimeType,a.roles,a.audioSamplingRate,a.primary,Array.from(a.keyIds)])}function Tv(a){return JSON.stringify([a.language,a.label,a.codecs,a.mimeType,a.bandwidth,a.roles])}
|
|
1051
|
+
function Uv(a){return JSON.stringify([a.width,a.codecs,a.mimeType])}function nw(a){if(!tw.has(a)){var b=ae(a);tw.set(a,b)}return tw.get(a)}O("shaka.util.PeriodCombiner",Pv);Pv.prototype.setUseStreamOnce=Pv.prototype.oh;Pv.prototype.setAllowMultiTypeVariants=Pv.prototype.ih;Pv.prototype.combinePeriods=Pv.prototype.Zf;Pv.prototype.deleteStream=Pv.prototype.bg;Pv.prototype.getImageStreams=Pv.prototype.jg;Pv.prototype.getTextStreams=Pv.prototype.yg;Pv.prototype.getVariants=Pv.prototype.Dg;
|
|
1052
|
+
var pw=1,sw=0,qw=-1,tw=new Map;/*
|
|
1053
|
+
@license
|
|
1054
|
+
EME Encryption Scheme Polyfill
|
|
1055
|
+
Copyright 2019 Google LLC
|
|
1056
|
+
SPDX-License-Identifier: Apache-2.0
|
|
1057
|
+
*/
|
|
1058
|
+
function uw(){}var vw;
|
|
1059
|
+
function ww(){vw||navigator.emeEncryptionSchemePolyfilled?console.debug("EmeEncryptionSchemePolyfill: Already installed."):navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration?(vw=navigator.requestMediaKeySystemAccess,console.debug("EmeEncryptionSchemePolyfill: Waiting to detect encryptionScheme support."),navigator.requestMediaKeySystemAccess=xw,navigator.emeEncryptionSchemePolyfilled=!0):console.debug("EmeEncryptionSchemePolyfill: EME not found")}
|
|
1060
|
+
function xw(a,b){var c=this,d;return L(function(e){if(1==e.g)return console.assert(c==navigator,'bad "this" for requestMediaKeySystemAccess'),J(e,vw.call(c,a,b),2);d=e.h;if(yw(d))return console.debug("EmeEncryptionSchemePolyfill: Native encryptionScheme support found."),navigator.requestMediaKeySystemAccess=vw,e.return(d);console.debug("EmeEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support.");navigator.requestMediaKeySystemAccess=zw;return e.return(zw.call(c,
|
|
1061
|
+
a,b))})}
|
|
1062
|
+
function zw(a,b){var c=this,d,e,f,g,h,k,l,m,n,q,p,u;return L(function(x){if(1==x.g){console.assert(c==navigator,'bad "this" for requestMediaKeySystemAccess');d=Aw(a);e=[];f=t(b);for(g=f.next();!g.done;g=f.next())h=g.value,k=Bw(h.videoCapabilities,d),l=Bw(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."),
|
|
1063
|
+
n.name="NotSupportedError",n.code=DOMException.NOT_SUPPORTED_ERR,n;return J(x,vw.call(c,a,e),2)}q=x.h;u=p=null;e[0]&&(e[0].videoCapabilities&&(p=e[0].videoCapabilities[0].encryptionScheme),e[0].audioCapabilities&&(u=e[0].audioCapabilities[0].encryptionScheme));return x.return(new Cw(q,p,u))})}function Bw(a,b){return a?a.filter(function(c){return Nw(c.encryptionScheme,b)}):a}O("EmeEncryptionSchemePolyfill",uw);uw.install=ww;function Ow(){}var Pw;
|
|
1064
|
+
function Qw(){Pw||navigator.mediaCapabilitiesEncryptionSchemePolyfilled?console.debug("McEncryptionSchemePolyfill: Already installed."):navigator.mediaCapabilities?(Pw=navigator.mediaCapabilities.decodingInfo,console.debug("McEncryptionSchemePolyfill: Waiting to detect encryptionScheme support."),navigator.mediaCapabilities.decodingInfo=Rw,navigator.mediaCapabilitiesEncryptionSchemePolyfilled=!0):console.debug("McEncryptionSchemePolyfill: MediaCapabilities not found")}
|
|
1065
|
+
function Rw(a){var b=this,c,d;return L(function(e){switch(e.g){case 1:return console.assert(b==navigator.mediaCapabilities,'bad "this" for decodingInfo'),J(e,Pw.call(b,a),2);case 2:c=e.h;if(!c.supported||!a.keySystemConfiguration)return e.return(c);if((d=c.keySystemAccess)&&yw(d))return console.debug("McEncryptionSchemePolyfill: Native encryptionScheme support found."),navigator.mediaCapabilities.decodingInfo=Pw,e.return(c);console.debug("McEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support.");
|
|
1066
|
+
navigator.mediaCapabilities.decodingInfo=Sw;if(d){e.s(3);break}return J(e,Tw(a),4);case 4:return c.keySystemAccess=e.h,e.return(c);case 3:return e.return(Sw.call(b,a))}})}
|
|
1067
|
+
function Sw(a){var b=this,c,d,e,f,g,h,k;return L(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=Aw(f),h={powerEfficient:!1,smooth:!1,supported:!1,keySystemAccess:null,configuration:a},Nw(d,g)&&Nw(c,g))?J(l,Pw.call(b,a),2):l.return(h);case 2:k=l.h;if(k.keySystemAccess){k.keySystemAccess=
|
|
1068
|
+
new Cw(k.keySystemAccess,c,d);l.s(3);break}if(!a.keySystemConfiguration){l.s(3);break}return J(l,Tw(a),5);case 5:k.keySystemAccess=l.h;case 3:return l.return(k)}})}
|
|
1069
|
+
function Tw(a){var b,c;return L(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};
|
|
1070
|
+
f.length&&(e.audioCapabilities=f);g.length&&(e.videoCapabilities=g);b=e;return J(d,navigator.requestMediaKeySystemAccess(a.keySystemConfiguration.keySystem,[b]),2)}c=d.h;return d.return(c)})}O("McEncryptionSchemePolyfill",Ow);Ow.install=Qw;function Cw(a,b,c){this.g=a;this.i=b||null;this.h=c||null;this.keySystem=a.keySystem}
|
|
1071
|
+
Cw.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};Cw.prototype.createMediaKeys=function(){return this.g.createMediaKeys()};
|
|
1072
|
+
function Aw(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}
|
|
1073
|
+
function yw(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 Nw(a,b){if(!a||a==b)return!0;if("cbcs"==a||"cbcs-1-9"==a)if(Uw||Vw||Ww)return!0;return!1}function Xw(){}function xs(){ww();Qw()}O("EncryptionSchemePolyfills",Xw);Xw.install=xs;var Ww=navigator.userAgent.includes("CrKey"),Uw=100<=parseInt(navigator.userAgent.split("Firefox/").pop(),10),Yw;
|
|
1074
|
+
var Zw=navigator.userAgent||"";if(Zw.includes("Web0S")){var $w=Zw.match(/Chrome\/(\d+)/);Yw=$w?79<=parseInt($w[1],10):!1}else Yw=!1;var Vw=Yw;"undefined"!==typeof module&&module.exports&&(module.exports=Xw);}).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})();
|
|
1075
|
+
|
|
1076
|
+
//# sourceMappingURL=shaka-player.hls.map
|