shaka-player 3.3.14 → 3.3.15
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/.github/workflows/build-and-test.yaml +13 -0
- package/AUTHORS +1 -0
- package/CHANGELOG.md +9 -0
- package/CONTRIBUTORS +1 -0
- package/dist/locales.js +29 -29
- package/dist/shaka-player.compiled.debug.js +14 -14
- package/dist/shaka-player.compiled.debug.map +2 -2
- package/dist/shaka-player.compiled.js +138 -138
- package/dist/shaka-player.compiled.map +2 -2
- package/dist/shaka-player.ui.debug.js +16 -16
- package/dist/shaka-player.ui.debug.map +2 -2
- package/dist/shaka-player.ui.js +154 -154
- package/dist/shaka-player.ui.map +2 -2
- package/lib/ads/ad_manager.js +2 -2
- package/lib/media/streaming_engine.js +20 -8
- package/lib/player.js +11 -2
- package/package.json +1 -1
- package/test/player_integration.js +10 -3
- package/test/test/boot.js +29 -11
- package/test/test/util/test_scheme.js +2 -2
|
@@ -32,10 +32,10 @@ while(!k.done)})};return b});function Ja(a,b){return Object.prototype.hasOwnProp
|
|
|
32
32
|
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(!Ja(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({}),
|
|
33
33
|
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(!Ja(k,g))throw Error("WeakMap key fail: "+k);k[g][this.g]=l;return this};b.prototype.get=function(k){return d(k)&&Ja(k,g)?k[g][this.g]:void 0};b.prototype.has=function(k){return d(k)&&
|
|
34
34
|
Ja(k,g)&&Ja(k[g],this.g)};b.prototype["delete"]=function(k){return d(k)&&Ja(k,g)&&Ja(k[g],this.g)?delete k[g][this.g]:!1};return b});
|
|
35
|
-
ha("Map",function(a){function b(){var h={};return h.
|
|
35
|
+
ha("Map",function(a){function b(){var h={};return h.Ra=h.next=h.head=h}function c(h,k){var l=h.g;return ia(function(){if(l){for(;l.head!=h.g;)l=l.Ra;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.h[l];if(m&&Ja(h.h,l))for(var n=0;n<m.length;n++){var p=m[n];if(k!==k&&p.key!==p.key||k===p.key)return{id:l,list:m,index:n,ia:p}}return{id:l,
|
|
36
36
|
list:m,index:-1,ia:void 0}}function e(h){this.h={};this.g=b();this.size=0;if(h){h=t(h);for(var k;!(k=h.next()).done;)k=k.value,this.set(k[0],k[1])}}if(function(){if(!a||"function"!=typeof a||!a.prototype.entries||"function"!=typeof Object.seal)return!1;try{var h=Object.seal({x:4}),k=new a(t([[h,"s"]]));if("s"!=k.get(h)||1!=k.size||k.get({x:4})||k.set({x:4},"t")!=k||2!=k.size)return!1;var l=k.entries(),m=l.next();if(m.done||m.value[0]!=h||"s"!=m.value[1])return!1;m=l.next();return m.done||4!=m.value[0].x||
|
|
37
|
-
"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.h[l.id]=[]);l.ia?l.ia.value=k:(l.ia={next:this.g,
|
|
38
|
-
h.ia.head=null,this.size--,!0):!1};e.prototype.clear=function(){this.h={};this.g=this.g.
|
|
37
|
+
"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.h[l.id]=[]);l.ia?l.ia.value=k:(l.ia={next:this.g,Ra:this.g.Ra,head:this.g,key:h,value:k},l.list.push(l.ia),this.g.Ra.next=l.ia,this.g.Ra=l.ia,this.size++);return this};e.prototype["delete"]=function(h){h=d(this,h);return h.ia&&h.list?(h.list.splice(h.index,1),h.list.length||delete this.h[h.id],h.ia.Ra.next=h.ia.next,h.ia.next.Ra=h.ia.Ra,
|
|
38
|
+
h.ia.head=null,this.size--,!0):!1};e.prototype.clear=function(){this.h={};this.g=this.g.Ra=b();this.size=0};e.prototype.has=function(h){return!!d(this,h).ia};e.prototype.get=function(h){return(h=d(this,h).ia)&&h.value};e.prototype.entries=function(){return c(this,function(h){return[h.key,h.value]})};e.prototype.keys=function(){return c(this,function(h){return h.key})};e.prototype.values=function(){return c(this,function(h){return h.value})};e.prototype.forEach=function(h,k){for(var l=this.entries(),
|
|
39
39
|
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});
|
|
40
40
|
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||
|
|
41
41
|
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;
|
|
@@ -77,15 +77,15 @@ var Wb=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=
|
|
|
77
77
|
Copyright 2006 The Closure Library Authors
|
|
78
78
|
SPDX-License-Identifier: Apache-2.0
|
|
79
79
|
*/
|
|
80
|
-
function Xb(a){var b;a instanceof Xb?(Yb(this,a.
|
|
81
|
-
r.toString=function(){var a=[],b=this.
|
|
82
|
-
r.resolve=function(a){var b=this.clone();"data"===b.
|
|
83
|
-
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.
|
|
80
|
+
function Xb(a){var b;a instanceof Xb?(Yb(this,a.Fa),this.rb=a.rb,this.Ga=a.Ga,Zb(this,a.Ib),this.wa=a.wa,$b(this,a.g.clone()),this.fb=a.fb):a&&(b=String(a).match(Wb))?(Yb(this,b[1]||"",!0),this.rb=ac(b[2]||""),this.Ga=ac(b[3]||"",!0),Zb(this,b[4]),this.wa=ac(b[5]||"",!0),$b(this,b[6]||"",!0),this.fb=ac(b[7]||"")):this.g=new bc(null)}r=Xb.prototype;r.Fa="";r.rb="";r.Ga="";r.Ib=null;r.wa="";r.fb="";
|
|
81
|
+
r.toString=function(){var a=[],b=this.Fa;b&&a.push(cc(b,dc,!0),":");if(b=this.Ga){a.push("//");var c=this.rb;c&&a.push(cc(c,dc,!0),"@");a.push(encodeURIComponent(b).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));b=this.Ib;null!=b&&a.push(":",String(b))}if(b=this.wa)this.Ga&&"/"!=b.charAt(0)&&a.push("/"),a.push(cc(b,"/"==b.charAt(0)?ec:fc,!0));(b=this.g.toString())&&a.push("?",b);(b=this.fb)&&a.push("#",cc(b,gc));return a.join("")};
|
|
82
|
+
r.resolve=function(a){var b=this.clone();"data"===b.Fa&&(b=new Xb);var c=!!a.Fa;c?Yb(b,a.Fa):c=!!a.rb;c?b.rb=a.rb:c=!!a.Ga;c?b.Ga=a.Ga:c=null!=a.Ib;var d=a.wa;if(c)Zb(b,a.Ib);else if(c=!!a.wa){if("/"!=d.charAt(0))if(this.Ga&&!this.wa)d="/"+d;else{var e=b.wa.lastIndexOf("/");-1!=e&&(d=b.wa.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(""):".."==
|
|
83
|
+
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.wa=d:c=""!==a.g.toString();c?$b(b,a.g.clone()):c=!!a.fb;c&&(b.fb=a.fb);return b};r.clone=function(){return new Xb(this)};function Yb(a,b,c){a.Fa=c?ac(b,!0):b;a.Fa&&(a.Fa=a.Fa.replace(/:$/,""))}function Zb(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error("Bad port number "+b);a.Ib=b}else a.Ib=null}function $b(a,b,c){b instanceof bc?a.g=b:(c||(b=cc(b,hc)),a.g=new bc(b))}
|
|
84
84
|
function ac(a,b){return a?b?decodeURI(a):decodeURIComponent(a):""}function cc(a,b,c){return null!=a?(a=encodeURI(a).replace(b,ic),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null}function ic(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)}var dc=/[#\/\?@]/g,fc=/[#\?:]/g,ec=/[#\?]/g,hc=/[#\?@]/g,gc=/#/g;function bc(a){this.g=a||null}
|
|
85
85
|
function jc(a){if(!a.na&&(a.na={},a.Ac=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=bc.prototype;r.na=null;r.Ac=null;r.add=function(a,b){jc(this);this.g=null;var c=this.na.hasOwnProperty(a)&&this.na[a];c||(this.na[a]=c=[]);c.push(b);this.Ac++;return this};
|
|
86
86
|
r.set=function(a,b){jc(this);this.g=null;this.na.hasOwnProperty(a)?this.na[a]=[b]:this.add(a,b);return this};r.toString=function(){if(this.g)return this.g;if(!this.na)return"";var a=[],b;for(b in this.na)for(var c=encodeURIComponent(b),d=this.na[b],e=0;e<d.length;e++){var f=c;""!==d[e]&&(f+="="+encodeURIComponent(d[e]));a.push(f)}return this.g=a.join("&")};r.clone=function(){var a=new bc;a.g=this.g;if(this.na){var b={},c;for(c in this.na)b[c]=this.na[c].concat();a.na=b;a.Ac=this.Ac}return a};function kc(a,b){if(0==b.length)return a;var c=b.map(function(d){return new Xb(d)});return a.map(function(d){return new Xb(d)}).map(function(d){return c.map(function(e){return d.resolve(e)})}).reduce(Ob,[]).map(function(d){return d.toString()})}function lc(a,b){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:b||[],keyIds:new Set}}
|
|
87
87
|
function mc(a,b){if(1==b.length)return b[0];var c=nc(a,b);if(null!=c)return c;throw new N(2,4,4025,b);}function nc(a,b){for(var c=t(oc[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==pc?"":null}
|
|
88
|
-
var pc="text",qc={
|
|
88
|
+
var pc="text",qc={Na:"video",cb:"audio",Z:pc,Sb:"image",ig:"application"},oc={audio:[/^vorbis$/,/^opus$/,/^flac$/,/^mp4a/,/^[ae]c-3$/,/^ac-4$/,/^dts[cx]$/,/^[du]dts$/],video:[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av01/,/^dvhe/],text:[/^vtt$/,/^wvtt/,/^stpp/]};function rc(){var a,b,c=new Promise(function(d,e){a=d;b=e});c.resolve=a;c.reject=b;return c}rc.prototype.resolve=function(){};rc.prototype.reject=function(){};function sc(a){this.h=a;this.g=void 0}sc.prototype.value=function(){void 0==this.g&&(this.g=this.h());return this.g};function tc(a){this.h=a;this.g=null}tc.prototype.S=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};tc.prototype.stop=function(){this.g&&(this.g(),this.g=null)};function O(a){this.h=a;this.g=null}O.prototype.Mb=function(){this.stop();this.h();return this};O.prototype.S=function(a){var b=this;this.stop();this.g=(new tc(function(){b.h()})).S(a);return this};O.prototype.Da=function(a){var b=this;this.stop();this.g=(new tc(function(){b.g.S(a);b.h()})).S(a);return this};O.prototype.stop=function(){this.g&&(this.g.stop(),this.g=null)};M("shaka.util.Timer",O);O.prototype.stop=O.prototype.stop;O.prototype.tickEvery=O.prototype.Da;O.prototype.tickAfter=O.prototype.S;
|
|
89
89
|
O.prototype.tickNow=O.prototype.Mb;function uc(){return window.MediaSource&&MediaSource.isTypeSupported?!0:!1}function vc(a){return""!=wc().canPlayType(a)}function xc(){return yc("Xbox One")}function zc(){return yc("Tizen")}function Ac(){return yc("Web0S")}function Bc(){return yc("CrKey")}function Cc(){return!!navigator.vendor&&navigator.vendor.includes("Apple")&&!zc()&&!yc("PC=EOS")&&!yc("VirginMedia")&&!Dc()&&!yc("AFT")}function Dc(){return yc("PlayStation 4")}
|
|
90
90
|
function Fc(){if(!Cc())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}function yc(a){return(navigator.userAgent||"").includes(a)}function wc(){if(Gc)return Gc;Hc||(Hc=new O(function(){Gc=null}));(Gc=document.getElementsByTagName("video")[0]||document.getElementsByTagName("audio")[0])||(Gc=document.createElement("video"));Hc.S(1);return Gc}var Hc=null,Gc=null;function Ic(){}
|
|
91
91
|
function Jc(a){if(!a)return"";a=Fb(a);239==a[0]&&187==a[1]&&191==a[2]&&(a=a.subarray(3));if(window.TextDecoder&&!Dc())return a=(new TextDecoder).decode(a),a.includes("\ufffd")&&Ta('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==
|
|
@@ -163,21 +163,21 @@ function We(a,b,c){return{uris:a,method:"GET",body:null,headers:{},allowCrossSit
|
|
|
163
163
|
r.request=function(a,b){var c=this,d=new Xe;if(this.i){var e=Promise.reject(new N(2,7,7001));e["catch"](function(){});return new Ye(e,function(){return Promise.resolve()},d)}b.method=b.method||"GET";b.headers=b.headers||{};b.retryParameters=b.retryParameters?Oe(b.retryParameters):De();b.uris=Oe(b.uris);e=Ze(this,a,b);var f=e.$(function(){return $e(c,a,b,new Ce(b.retryParameters,!1),0,null,d)}),g=f.$(function(n){return af(c,a,n)}),h=Date.now(),k=0;e.promise.then(function(){k=Date.now()-h},function(){});
|
|
164
164
|
var l=0;f.promise.then(function(){l=Date.now()},function(){});var m=g.$(function(n){var p=Date.now()-l,q=n.response;q.timeMs+=k;q.timeMs+=p;n.Bf||!c.l||q.fromCache||a!=bf||c.l(q.timeMs,q.data.byteLength);return q},function(n){n&&(n.severity=2);throw n;});e=new Ye(m.promise,function(){return m.abort()},d);Re(this.m,e);return e};
|
|
165
165
|
function Ze(a,b,c){var d=Ie(void 0),e={};a=t(a.g);for(var f=a.next();!f.done;e={gd:e.gd},f=a.next())e.gd=f.value,d=d.$(function(g){return function(){c.body&&(c.body=Gb(c.body));return g.gd(b,c)}}(e));return d.$(void 0,function(g){if(g instanceof N&&7001==g.code)throw g;throw new N(2,1,1006,g);})}
|
|
166
|
-
function $e(a,b,c,d,e,f,g){a.o&&(c.uris[e]=c.uris[e].replace("http://","https://"));var h=new Xb(c.uris[e]),k=h.
|
|
166
|
+
function $e(a,b,c,d,e,f,g){a.o&&(c.uris[e]=c.uris[e].replace("http://","https://"));var h=new Xb(c.uris[e]),k=h.Fa,l=!1;k||(k=location.protocol,k=k.slice(0,-1),Yb(h,k),c.uris[e]=h.toString());k=k.toLowerCase();var m=(k=Ve[k])?k.Mf:null;if(!m)return Ge(new N(2,1,1E3,h));var n=k.Nf,p=null,q=null,v=!1,y=!1,w;return Je(Ee(d)).$(function(){if(a.i)return He();w=Date.now();var x=m(c.uris[e],c,b,function(B,F,G){p&&p.stop();q&&q.S(z/1E3);a.l&&b==bf&&(a.l(B,F),l=!0,g.g=G)},function(B){a.j&&a.j(B,c,b);y=!0});
|
|
167
167
|
if(!n)return x;var D=c.retryParameters.connectionTimeout;D&&(p=new O(function(){v=!0;x.abort()}),p.S(D/1E3));var z=c.retryParameters.stallTimeout;z&&(q=new O(function(){v=!0;x.abort()}));return x}).$(function(x){p&&p.stop();q&&q.stop();void 0==x.timeMs&&(x.timeMs=Date.now()-w);var D={response:x,Bf:l};!y&&a.j&&a.j(x.headers,c,b);return D},function(x){p&&p.stop();q&&q.stop();if(a.s){var D=null,z=0;x instanceof N&&(D=x,1001==x.code&&(z=x.data[1]));a.s(c,D,z,v)}if(a.i)return He();v&&(x=new N(1,1,1003,
|
|
168
168
|
c.uris[e],b));if(x instanceof N){if(7001==x.code)throw x;if(1010==x.code)throw f;if(1==x.severity)return D=(new Map).set("error",x),D=new Q("retry",D),a.dispatchEvent(D),e=(e+1)%c.uris.length,$e(a,b,c,d,e,x,g)}throw x;})}
|
|
169
169
|
function af(a,b,c){var d=Ie(void 0),e={};a=t(a.h);for(var f=a.next();!f.done;e={hd:e.hd},f=a.next())e.hd=f.value,d=d.$(function(g){return function(){var h=c.response;h.data&&(h.data=Gb(h.data));return g.hd(b,h)}}(e));return d.$(function(){return c},function(g){var h=2;if(g instanceof N){if(7001==g.code)throw g;h=g.severity}throw new N(h,1,1007,g);})}M("shaka.net.NetworkingEngine",Se);Se.prototype.request=Se.prototype.request;Se.prototype.destroy=Se.prototype.destroy;Se.makeRequest=We;
|
|
170
170
|
Se.defaultRetryParameters=function(){return De()};Se.prototype.clearAllResponseFilters=Se.prototype.Ve;Se.prototype.unregisterResponseFilter=Se.prototype.eg;Se.prototype.registerResponseFilter=Se.prototype.Pf;Se.prototype.clearAllRequestFilters=Se.prototype.Ue;Se.prototype.unregisterRequestFilter=Se.prototype.dg;Se.prototype.registerRequestFilter=Se.prototype.Of;Se.unregisterScheme=function(a){delete Ve[a]};Se.registerScheme=Te;Se.prototype.setForceHTTPS=Se.prototype.Vd;function Xe(){this.g=0}
|
|
171
|
-
Se.NumBytesRemainingClass=Xe;function Ye(a,b,c){Fe.call(this,a,b);this.h=c}qa(Ye,Fe);Se.PendingRequest=Ye;var bf=1;Se.RequestType={MANIFEST:0,SEGMENT:bf,LICENSE:2,APP:3,TIMING:4,SERVER_CERTIFICATE:5};var Ue=3;Se.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:Ue};var Ve={};function cf(a){this.g=!1;this.h=new rc;this.i=a}cf.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 df(a,b){if(a.g){if(b instanceof N&&7003==b.code)throw b;throw new N(2,7,7003,b);}};function ef(){this.g=new zd}r=ef.prototype;r.release=function(){this.
|
|
172
|
-
r.
|
|
171
|
+
Se.NumBytesRemainingClass=Xe;function Ye(a,b,c){Fe.call(this,a,b);this.h=c}qa(Ye,Fe);Se.PendingRequest=Ye;var bf=1;Se.RequestType={MANIFEST:0,SEGMENT:bf,LICENSE:2,APP:3,TIMING:4,SERVER_CERTIFICATE:5};var Ue=3;Se.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:Ue};var Ve={};function cf(a){this.g=!1;this.h=new rc;this.i=a}cf.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 df(a,b){if(a.g){if(b instanceof N&&7003==b.code)throw b;throw new N(2,7,7003,b);}};function ef(){this.g=new zd}r=ef.prototype;r.release=function(){this.Sa();this.g=null};r.A=function(a,b,c,d){this.g&&(a=new ff(a,b,c,d),this.g.push(b,a))};r.oa=function(a,b,c,d){function e(g){f.pc(a,b,e);c(g)}var f=this;this.A(a,b,e,d)};r.pc=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.pc(),this.g.remove(b,e))}};
|
|
172
|
+
r.Sa=function(){if(this.g){var a=this.g,b=[],c;for(c in a.g)b.push.apply(b,ja(a.g[c]));a=t(b);for(b=a.next();!b.done;b=a.next())b.value.pc();this.g.g={}}};M("shaka.util.EventManager",ef);ef.prototype.removeAll=ef.prototype.Sa;ef.prototype.unlisten=ef.prototype.pc;ef.prototype.listenOnce=ef.prototype.oa;ef.prototype.listen=ef.prototype.A;ef.prototype.release=ef.prototype.release;function ff(a,b,c,d){this.target=a;this.type=b;this.listener=c;this.g=gf(a,d);this.target.addEventListener(b,c,this.g)}
|
|
173
173
|
ff.prototype.pc=function(){this.target.removeEventListener(this.type,this.listener,this.g);this.listener=this.target=null;this.g=!1};function gf(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 hf(a)?b:b.capture||!1}
|
|
174
|
-
function hf(a){var b=jf;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}jf=b}return b||!1}var jf=void 0;function kf(){}function lf(a){a=Mc(a);return(new Xb(a)).
|
|
174
|
+
function hf(a){var b=jf;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}jf=b}return b||!1}var jf=void 0;function kf(){}function lf(a){a=Mc(a);return(new Xb(a)).Ga}function mf(a,b,c){function d(h){Ib(f).setUint32(g,h.byteLength,!0);g+=4;f.set(Fb(h),g);g+=h.byteLength}if(!c||!c.byteLength)throw new N(2,6,6015);var e;"string"==typeof b?e=Oc(b,!0):e=b;a=Mc(a);a=Oc(a,!0);var f=new Uint8Array(12+a.byteLength+e.byteLength+c.byteLength),g=0;d(a);d(e);d(c);return f}M("shaka.util.FairPlayUtils",kf);kf.initDataTransform=mf;kf.defaultGetContentId=lf;function nf(a,b){for(var c=[],d=t(a),e=d.next();!e.done;e=d.next())c.push(b(e.value));return c}function of(a,b){for(var c=t(a),d=c.next();!d.done;d=c.next())if(!b(d.value))return!1;return!0};function pf(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 qf(a){var b={};a.forEach(function(c,d){b[d]=c});return b}function rf(a,b){if(a||b){if(a&&!b||b&&!a)return!1}else return!0;if(a.size!=b.size)return!1;for(var c=t(a),d=c.next();!d.done;d=c.next()){var e=t(d.value);d=e.next().value;e=e.next().value;if(!b.has(d))return!1;d=b.get(d);if(d!=e||void 0==d)return!1}return!0};function sf(a,b){var c=tf(a,b);return 1!=c.length?null:c[0]}function uf(a,b,c){a=vf(a,b,c);return 1!=a.length?null:a[0]}function tf(a,b){for(var c=[],d=t(a.childNodes),e=d.next();!e.done;e=d.next())e=e.value,e instanceof Element&&e.tagName==b&&c.push(e);return c}function wf(a){return Array.from(a.childNodes).filter(function(b){return b instanceof Element})}
|
|
175
175
|
function vf(a,b,c){var d=[];a=t(a.childNodes);for(var e=a.next();!e.done;e=a.next())e=e.value,e instanceof Element&&e.localName==c&&e.namespaceURI==b&&d.push(e);return d}function xf(a,b,c){return a.hasAttributeNS(b,c)?a.getAttributeNS(b,c):null}function yf(a,b,c){b=t(b);for(var d=b.next();!d.done;d=b.next())if(d=d.value,a.hasAttributeNS(d,c))return a.getAttributeNS(d,c);return null}function zf(a){return Array.from(a.childNodes).every(Af)?a.textContent.trim():null}
|
|
176
176
|
function Af(a){return a.nodeType==Node.TEXT_NODE||a.nodeType==Node.CDATA_SECTION_NODE}function Bf(a,b,c,d){d=void 0===d?null:d;var e=null;a=a.getAttribute(b);null!=a&&(e=c(a));return null==e?d:e}function Cf(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:Math.floor(a/1E3)}
|
|
177
177
|
function Df(a){if(!a)return null;a=RegExp("^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$").exec(a);if(!a)return null;a=31536E3*Number(a[1]||null)+2592E3*Number(a[2]||null)+86400*Number(a[3]||null)+3600*Number(a[4]||null)+60*Number(a[5]||null)+Number(a[6]||null);return isFinite(a)?a:null}
|
|
178
178
|
function Ef(a){var b=/([0-9]+)-([0-9]+)/.exec(a);if(!b)return null;a=Number(b[1]);if(!isFinite(a))return null;b=Number(b[2]);return isFinite(b)?{start:a,end:b}:null}function Ff(a){a=Number(a);return 0===a%1?a:null}function If(a){a=Number(a);return 0===a%1&&0<a?a:null}function Jf(a){a=Number(a);return 0===a%1&&0<=a?a:null}function Kf(a){a=Number(a);return isNaN(a)?null:a}function Lf(a){var b;var c=(b=a.match(/^(\d+)\/(\d+)$/))?Number(b[1])/Number(b[2]):Number(a);return isNaN(c)?null:c}
|
|
179
179
|
function Mf(a,b){var c=new DOMParser,d=Nf.value()(a),e=null;try{e=c.parseFromString(d,"text/xml")}catch(f){return null}c=e.documentElement;if(!c||c.getElementsByTagName("parsererror").length||c.tagName!=b)return null;for(e=document.createNodeIterator(e,NodeFilter.SHOW_ALL);d=e.nextNode();)if(d instanceof HTMLElement||d instanceof SVGElement)return null;return c}function Of(a,b){try{var c=Jc(a);return Mf(c,b)}catch(d){return null}}
|
|
180
|
-
var Nf=new sc(function(){if("undefined"!==typeof trustedTypes){var a=trustedTypes.createPolicy("shaka-player#xml",{createHTML:function(b){return b}});return function(b){return a.createHTML(b)}}return function(b){return b}});function Pf(a,b){var c=this;b=void 0===b?1:b;this.D=a;this.F=new Set;this.l=this.s=null;this.fa=this.ca=!1;this.G=0;this.g=null;this.o=new ef;this.i=new Map;this.C=[];this.u=new rc;this.h=null;this.m=function(d){c.u.reject(d);a.onError(d)};this.ka=new Map;this.da=new Map;this.V=new O(function(){return Qf(c)});this.L=!1;this.I=[];this.N=!1;this.ea=(new O(function(){Rf(c)})).
|
|
180
|
+
var Nf=new sc(function(){if("undefined"!==typeof trustedTypes){var a=trustedTypes.createPolicy("shaka-player#xml",{createHTML:function(b){return b}});return function(b){return a.createHTML(b)}}return function(b){return b}});function Pf(a,b){var c=this;b=void 0===b?1:b;this.D=a;this.F=new Set;this.l=this.s=null;this.fa=this.ca=!1;this.G=0;this.g=null;this.o=new ef;this.i=new Map;this.C=[];this.u=new rc;this.h=null;this.m=function(d){c.u.reject(d);a.onError(d)};this.ka=new Map;this.da=new Map;this.V=new O(function(){return Qf(c)});this.L=!1;this.I=[];this.N=!1;this.ea=(new O(function(){Rf(c)})).Da(b);this.u["catch"](function(){});this.j=new cf(function(){return Sf(c)});this.W=!1}r=Pf.prototype;r.destroy=function(){return this.j.destroy()};
|
|
181
181
|
function Sf(a){return L(function(b){switch(b.g){case 1:return a.o.release(),a.o=null,a.u.reject(),a.ea.stop(),a.ea=null,a.V.stop(),a.V=null,u(b,Tf(a),2);case 2:if(!a.l){b.B(3);break}C(b,4);return u(b,a.l.setMediaKeys(null),6);case 6:va(b,5);break;case 4:E(b);case 5:a.l=null;case 3:a.g=null,a.F.clear(),a.s=null,a.C=[],a.h=null,a.m=function(){},a.D=null,a.W=!1,A(b)}})}r.configure=function(a){this.h=a};function Uf(a,b,c){a.fa=!0;a.C=[];a.L=c;return Vf(a,b)}
|
|
182
182
|
function Wf(a,b,c){a.C=c;a.L=0<c.length;return Vf(a,b)}function Xf(a,b,c,d,e,f){var g=new Map;e={audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:"optional",persistentState:"required",sessionTypes:["persistent-license"],label:b};e.drmInfos=[{keySystem:b,licenseServerUri:c,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:d,serverCertificateUri:"",initData:null,keyIds:null}];g.set(b,e);return Yf(a,g,[])}
|
|
183
183
|
function Vf(a,b){var c,d,e,f,g,h,k,l,m,n,p,q,v,y;return L(function(w){if(1==w.g){if(c=Zf(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(x){return x.video&&x.video.drmInfos.length||x.audio&&x.audio.drmInfos.length?!0:!1});g||(h=pf(a.h.servers),$f(b,h));k=t(b);for(e=k.next();!e.done;e=k.next())for(l=e.value,m=ag(l),n=t(m),p=n.next();!p.done;p=n.next())q=p.value,bg(q,pf(a.h.servers),pf(a.h.advanced||{}));return u(w,
|
|
@@ -211,15 +211,15 @@ function ug(){var a,b,c,d,e,f,g,h;return L(function(k){return 1==k.g?(a="org.w3.
|
|
|
211
211
|
c],f=new Map,g=function(l){var m,n,p;return L(function(q){switch(q.g){case 1:return C(q,2),u(q,navigator.requestMediaKeySystemAccess(l,e),4);case 4:return m=q.h,p=(n=m.getConfiguration().sessionTypes)?n.includes("persistent-license"):!1,yc("Tizen 3")&&(p=!1),f.set(l,{persistentState:p}),u(q,m.createMediaKeys(),5);case 5:va(q,0);break;case 2:E(q),f.set(l,null),A(q)}})},h=a.map(function(l){return g(l)}),u(k,Promise.all(h),2)):k["return"](qf(f))})}
|
|
212
212
|
function vg(a){var b;return L(function(c){if(1==c.g)return b=new Promise(function(d,e){(new O(e)).S(wg)}),C(c,2),u(c,Promise.race([Promise.all([a.close(),a.closed]),b]),4);if(2!=c.g)return va(c,0);E(c);A(c)})}
|
|
213
213
|
function Tf(a){var b;return L(function(c){b=Array.from(a.i.entries());a.i.clear();return u(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 C(g,2),a.fa||a.C.includes(e.sessionId)||"persistent-license"!==f.type?u(g,vg(e),5):u(g,e.remove(),5);if(2!=g.g)return va(g,0);E(g);A(g)})})),0)})}
|
|
214
|
-
function xg(a,b){if(!a.length)return b;if(!b.length)return a;for(var c=[],d=t(a),e=d.next();!e.done;e=d.next()){e=e.value;for(var f={},g=t(b),h=g.next();!h.done;f={
|
|
214
|
+
function xg(a,b){if(!a.length)return b;if(!b.length)return a;for(var c=[],d=t(a),e=d.next();!e.done;e=d.next()){e=e.value;for(var f={},g=t(b),h=g.next();!h.done;f={Ea:f.Ea},h=g.next())if(h=h.value,e.keySystem==h.keySystem){f.Ea=[];f.Ea=f.Ea.concat(e.initData||[]);f.Ea=f.Ea.concat(h.initData||[]);f.Ea=f.Ea.filter(function(k){return function(l,m){return void 0===l.keyId||m===k.Ea.findIndex(function(n){return n.keyId===l.keyId})}}(f));g=e.keyIds&&h.keyIds?new Set([].concat(ja(e.keyIds),ja(h.keyIds))):
|
|
215
215
|
e.keyIds||h.keyIds;c.push({keySystem:e.keySystem,licenseServerUri:e.licenseServerUri||h.licenseServerUri,distinctiveIdentifierRequired:e.distinctiveIdentifierRequired||h.distinctiveIdentifierRequired,persistentStateRequired:e.persistentStateRequired||h.persistentStateRequired,videoRobustness:e.videoRobustness||h.videoRobustness,audioRobustness:e.audioRobustness||h.audioRobustness,serverCertificate:e.serverCertificate||h.serverCertificate,serverCertificateUri:e.serverCertificateUri||h.serverCertificateUri,
|
|
216
|
-
initData:f.
|
|
216
|
+
initData:f.Ea,keyIds:g});break}}return c}function ag(a){return(a.video?a.video.drmInfos:[]).concat(a.audio?a.audio.drmInfos:[])}function Rf(a){a.i.forEach(function(b,c){var d=b.Kd,e=c.expiration;isNaN(e)&&(e=Infinity);e!=d&&(a.D.onExpirationUpdated(c.sessionId,e),b.Kd=e)})}function pg(a){a=a.i.values();return of(a,function(b){return b.loaded})}
|
|
217
217
|
function $f(a,b){var c=[];b.forEach(function(f,g){c.push({keySystem:g,licenseServerUri:f,distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",initData:[],keyIds:new Set})});for(var d=t(a),e=d.next();!e.done;e=d.next())e=e.value,e.video&&(e.video.drmInfos=c),e.audio&&(e.audio.drmInfos=c)}
|
|
218
218
|
function ng(a,b,c,d,e,f){var g={};a=t(a);for(var h=a.next();!h.done;g={ra:g.ra},h=a.next()){g.ra=h.value;b.includes(g.ra.licenseServerUri)||b.push(g.ra.licenseServerUri);d.includes(g.ra.serverCertificateUri)||d.push(g.ra.serverCertificateUri);g.ra.serverCertificate&&(c.some(function(m){return function(n){return Db(n,m.ra.serverCertificate)}}(g))||c.push(g.ra.serverCertificate));if(g.ra.initData){h={};for(var k=t(g.ra.initData),l=k.next();!l.done;h={sc:h.sc},l=k.next())h.sc=l.value,e.some(function(m){return function(n){var p=
|
|
219
219
|
m.sc;return n.keyId&&n.keyId==p.keyId?!0:n.initDataType==p.initDataType&&Db(n.initData,p.initData)}}(h))||e.push(h.sc)}if(g.ra.keyIds)for(h=t(g.ra.keyIds),k=h.next();!k.done;k=h.next())f.add(k.value)}}
|
|
220
220
|
function bg(a,b,c){if(a.keySystem&&("org.w3.clearkey"!=a.keySystem||!a.licenseServerUri)){b.size&&(b=b.get(a.keySystem)||"",a.licenseServerUri=b);a.keyIds||(a.keyIds=new Set);if(c=c.get(a.keySystem))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||
|
|
221
221
|
(a.serverCertificate=c.serverCertificate),c.sessionType&&(a.sessionType=c.sessionType),a.serverCertificateUri||(a.serverCertificateUri=c.serverCertificateUri);window.cast&&window.cast.__platform__&&"com.microsoft.playready"==a.keySystem&&(a.keySystem="com.chromecast.playready")}}var wg=1,sg=5,tg=.5,yg=new sc(function(){return Gb(new Uint8Array([0]))});function zg(){}function Ag(a,b,c,d){var e,f,g,h;return L(function(k){if(1==k.g){if(d&&(e=Bg[d.toLowerCase()]))return k["return"](e);if(f=Cg(a))if(g=Dg[f])return k["return"](g);return d?k.B(2):u(k,Eg(a,b,c),3)}if(2!=k.g&&(d=k.h)&&(h=Bg[d]))return k["return"](h);throw new N(2,4,4E3,a);})}
|
|
222
|
-
function Eg(a,b,c){var d,e,f;return L(function(g){if(1==g.g)return d=We([a],c),d.method="HEAD",u(g,b.request(0,d).promise,2);e=g.h;f=e.headers["content-type"];return g["return"](f?f.toLowerCase().split(";").shift():"")})}function Cg(a){a=(new Xb(a)).
|
|
222
|
+
function Eg(a,b,c){var d,e,f;return L(function(g){if(1==g.g)return d=We([a],c),d.method="HEAD",u(g,b.request(0,d).promise,2);e=g.h;f=e.headers["content-type"];return g["return"](f?f.toLowerCase().split(";").shift():"")})}function Cg(a){a=(new Xb(a)).wa.split("/").pop().split(".");return 1==a.length?"":a.pop().toLowerCase()}M("shaka.media.ManifestParser",zg);zg.unregisterParserByMime=function(a){delete Bg[a]};zg.registerParserByMime=function(a,b){Bg[a]=b};
|
|
223
223
|
zg.registerParserByExtension=function(a,b){Dg[a]=b};var Bg={},Dg={};function Fg(a,b){this.O=Ib(a);this.h=b==Gg;this.g=0}r=Fg.prototype;r.ma=function(){return this.g<this.O.byteLength};r.X=function(){return this.g};r.gf=function(){return this.O.byteLength};r.Y=function(){try{var a=this.O.getUint8(this.g);this.g+=1;return a}catch(b){throw Hg();}};r.Jb=function(){try{var a=this.O.getUint16(this.g,this.h);this.g+=2;return a}catch(b){throw Hg();}};r.M=function(){try{var a=this.O.getUint32(this.g,this.h);this.g+=4;return a}catch(b){throw Hg();}};
|
|
224
224
|
r.we=function(){try{var a=this.O.getInt32(this.g,this.h);this.g+=4;return a}catch(b){throw Hg();}};r.Kb=function(){try{if(this.h){var a=this.O.getUint32(this.g,!0);var b=this.O.getUint32(this.g+4,!0)}else b=this.O.getUint32(this.g,!1),a=this.O.getUint32(this.g+4,!1)}catch(c){throw Hg();}if(2097151<b)throw new N(2,3,3001);this.g+=8;return b*Math.pow(2,32)+a};r.Za=function(a){if(this.g+a>this.O.byteLength)throw Hg();var b=Fb(this.O,this.g,a);this.g+=a;return b};
|
|
225
225
|
r.skip=function(a){if(this.g+a>this.O.byteLength)throw Hg();this.g+=a};r.ye=function(a){if(this.g<a)throw Hg();this.g-=a};r.seek=function(a){if(0>a||a>this.O.byteLength)throw Hg();this.g=a};r.jc=function(){for(var a=this.g;this.ma()&&0!=this.O.getUint8(this.g);)this.g+=1;a=Fb(this.O,a,this.g-a);this.g+=1;return Jc(a)};function Hg(){return new N(2,3,3E3)}M("shaka.util.DataViewReader",Fg);Fg.prototype.readTerminatedString=Fg.prototype.jc;Fg.prototype.seek=Fg.prototype.seek;Fg.prototype.rewind=Fg.prototype.ye;
|
|
@@ -245,10 +245,10 @@ b.skip(1),d=Ih(b).value,b.skip(1),a.g&&(a.g.D=d&3);else if(152<=c&&159>=c){c=(c&
|
|
|
245
245
|
function Mh(a,b,c){var d=null;b=t(Lh(a,b));for(var e=b.next();!e.done;e=b.next()){e=e.value;var f=a.h[e];f.isVisible()&&(d=Ch(f,c,a.i));a.h[e]=null}return d}function Nh(a){a.g=null;a.h=[null,null,null,null,null,null,null,null]}function Oh(a,b,c){var d={0:0,1:0,2:1,3:1};a=d[a];b=d[b];c=d[c];return Ph[a<<2|b<<1|c]}
|
|
246
246
|
var Qh=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"]]),Ph="black blue green cyan red magenta yellow white".split(" ");function Rh(){this.h=[];this.g=[];this.i=new Fh;this.l=0;this.s=new Map([["CC1",new mh(0,0)],["CC2",new mh(0,1)],["CC3",new mh(1,0)],["CC4",new mh(1,1)]]);this.o=this.m=0;this.j=new Map;Sh(this)}function Sh(a){a.m=0;a.o=0;a=t(a.s.values());for(var b=a.next();!b.done;b=a.next())b=b.value,b.h=2,b.g=b.i,b.m=null,$g(b.i),$g(b.l),$g(b.o)}
|
|
247
247
|
function Th(a){function b(f,g){return f.pts-g.pts||f.order-g.order}var c=[];a.h.sort(b);a.g.sort(b);for(var d=t(a.h),e=d.next();!e.done;e=d.next())(e=Uh(a,e.value))&&c.push(e);d=t(a.g);for(e=d.next();!e.done;e=d.next())Gh(a.i,e.value);d=t(a.i.i);for(e=d.next();!e.done;e=d.next())e=Vh(a,e.value),c.push.apply(c,ja(e));a.i.i=[];a.h=[];a.g=[];return c}
|
|
248
|
-
function Uh(a,b){var c=b.type;if(16===(b.
|
|
248
|
+
function Uh(a,b){var c=b.type;if(16===(b.Aa&112)){var d=b.Aa>>3&1;0===c?a.m=d:a.o=d}c=a.s.get("CC"+(c<<1|(c?a.o:a.m)+1));if(255===b.Aa&&255===b.Oa||!b.Aa&&!b.Oa||!Wh(b.Aa)||!Wh(b.Oa))return 45<=++a.l&&Sh(a),null;a.l=0;b.Aa&=127;b.Oa&=127;if(!b.Aa&&!b.Oa)return null;d=null;if(16===(b.Aa&112))a:{var e=b.Aa;d=b.Oa;if(c.m===(e<<8|d))c.m=null;else if(c.m=e<<8|d,16===(e&240)&&64===(d&192)){e=[11,11,1,2,3,4,12,13,14,15,5,6,7,8,9,10][(e&7)<<1|d>>5&1];var f=(d&30)>>1,g="white",h=!1;7>f?g=vh[f]:7===f&&(h=!0);
|
|
249
249
|
d=1===(d&1);if(c.h!==qh){f=c.g;if(c.h===ph&&e!==f.g){var k=1+e-f.h;lh(f,k,1+f.g-f.h,f.h);bh(f,0,k-1);bh(f,e+1,15-e)}f.g=e;c.g.m=d;c.g.j=h;c.g.l=g;c.g.o="black"}}else if(17===(e&247)&&32===(d&240))c.g.m=!1,c.g.j=!1,c.g.l="white",ch(c.g,dh,32),g=!1,e=vh[(d&14)>>1],"white_italics"===e&&(e="white",g=!0),c.g.m=1===(d&1),c.g.j=g,c.g.l=e;else if(16===(e&247)&&32===(d&240)||23===(e&247)&&45===(d&255))g="black",0===(e&7)&&(g=uh[(d&14)>>1]),c.g.o=g;else if(17===(e&247)&&48===(d&240))ch(c.g,fh,d);else if(18===
|
|
250
|
-
(e&246)&&32===(d&224))ch(c.g,e&1?jh:hh,d);else if(20===(e&246)&&32===(d&240)){d=b.pts;e=null;switch(b.
|
|
251
|
-
0,h-1),bh(e,e.g,15-e.g),c.j=d,e=g);break;case 46:bh(c.l,0,15);break;case 47:e=null,c.h!==qh&&(e=ah(c.i,c.j,d)),g=c.l,c.l=c.i,c.i=g,rh(c),c.j=d}d=e;break a}d=null}else e=b.
|
|
250
|
+
(e&246)&&32===(d&224))ch(c.g,e&1?jh:hh,d);else if(20===(e&246)&&32===(d&240)){d=b.pts;e=null;switch(b.Oa){case 32:rh(c);break;case 33:c=c.g;c.i[c.g].pop();break;case 37:e=oh(c,2,d);break;case 38:e=oh(c,3,d);break;case 39:e=oh(c,4,d);break;case 40:ch(c.g,dh,32);break;case 41:c.h=2;c.g=c.i;c.g.h=0;c.j=d;break;case 42:$g(c.o);th(c);break;case 43:th(c);break;case 44:e=c.i;g=null;c.h!==qh&&(g=ah(e,c.j,d));bh(e,0,15);e=g;break;case 45:e=c.g;c.h!==ph?e=null:(g=ah(e,c.j,d),h=e.g-e.h+1,lh(e,h-1,h,e.h),bh(e,
|
|
251
|
+
0,h-1),bh(e,e.g,15-e.g),c.j=d,e=g);break;case 46:bh(c.l,0,15);break;case 47:e=null,c.h!==qh&&(e=ah(c.i,c.j,d)),g=c.l,c.l=c.i,c.i=g,rh(c),c.j=d}d=e;break a}d=null}else e=b.Oa,ch(c.g,dh,b.Aa),ch(c.g,dh,e);return d}
|
|
252
252
|
function Vh(a,b){var c=[];try{for(;b.ma();){var d=Ih(b).value,e=(d&224)>>5,f=d&31;7===e&&0!=f&&(e=Ih(b).value&63);if(0!=e){a.j.has(e)||a.j.set(e,new Jh(e));for(var g=a.j.get(e),h=b.X();b.X()-h<f;){e=b;var k=Ih(e),l=k.value,m=k.pts;if(16===l){var n=Ih(e);l=l<<16|n.value}if(0<=l&&31>=l){var p=m;if(g.g){var q=g.g;e=null;switch(l){case 8:!Bh(q)||0>=q.g&&0>=q.h||(0>=q.g?(q.g=q.C-1,q.h--):q.g--,q.i[q.h][q.g]=null);break;case 13:q.isVisible()&&(e=Ch(q,p,g.i));if(q.h+1>=q.F){p=q;for(var v=0,y=1;16>y;y++,
|
|
253
253
|
v++)p.i[v]=p.i[y];for(y=0;1>y;y++,v++)p.i[v]=zh()}else q.h++;q.g=0;break;case 14:q.isVisible()&&(e=Ch(q,p,g.i));q.i[q.h]=zh();q.g=0;break;case 12:q.isVisible()&&(e=Ch(q,p,g.i)),yh(q),p=q,p.h=0,p.g=0}var w=e}else w=null}else if(128<=l&&159>=l)w=Kh(g,e,l,m);else{if(4096<=l&&4127>=l)p=l&255,8<=p&&15>=p?e.skip(1):16<=p&&23>=p?e.skip(2):24<=p&&31>=p&&e.skip(3);else if(4224<=l&&4255>=l)p=l&255,128<=p&&135>=p?e.skip(4):136<=p&&143>=p&&e.skip(5);else if(32<=l&&127>=l)e=l,g.g&&(127===e?Ah(g.g,"\u266a"):Ah(g.g,
|
|
254
254
|
String.fromCharCode(e)));else if(160<=l&&255>=l)g.g&&Ah(g.g,String.fromCharCode(l));else if(4128<=l&&4223>=l){if(e=l&255,g.g)if(Qh.has(e)){var x=Qh.get(e);Ah(g.g,x)}else Ah(g.g,"_")}else 4256<=l&&4351>=l&&g.g&&(160!=(l&255)?Ah(g.g,"_"):Ah(g.g,"[CC]"));w=null}(e=w)&&c.push(e)}}}}catch(D){if(D instanceof N&&3E3===D.code)Va("CEA708_INVALID_DATA","Buffer read out of bounds / invalid CEA-708 Data.");else throw D;}return c}function Wh(a){for(var b=0;a;)b^=a&1,a>>=1;return 1===b};function Xh(a,b){var c=null,d=null,e=a.M();b&1&&a.skip(8);b&2&&a.skip(4);b&8&&(c=a.M());b&16&&(d=a.M());return{trackId:e,he:c,Xe:d}}function Yh(a,b){return{pd:1==b?a.Kb():a.M()}}function Zh(a,b){1==b?(a.skip(8),a.skip(8)):(a.skip(4),a.skip(4));return{timescale:a.M()}}
|
|
@@ -257,7 +257,7 @@ ai.prototype.init=function(a){var b=this,c=[],d=[];(new Ig).box("moov",Mg).box("
|
|
|
257
257
|
ai.prototype.parse=function(a){var b=this,c=[],d=this.g,e=this.h,f=[],g=null,h=9E4;(new Ig).box("moof",Mg).box("traf",Mg).P("trun",function(k){f=$h(k.reader,k.version,k.flags).ze}).P("tfhd",function(k){k=Xh(k.reader,k.flags);d=k.he||b.g;e=k.Xe||b.h;k=k.trackId;b.i.has(k)&&(h=b.i.get(k))}).P("tfdt",function(k){g=Yh(k.reader,k.version).pd}).box("mdat",function(k){if(null===g)throw new N(2,2,2010);k=k.reader;var l=g,m=h,n=d,p=e,q=f,v=0,y=p;for(q.length&&(y=q[0].sampleSize||p);k.ma();){var w=k.M();if(6==
|
|
258
258
|
(k.Y()&31)){var x=0;q.length>v&&(x=q[v].Tc||0);x=(l+x)/m;for(var D=[],z,B=k.Za(w-1),F=z=0;F<B.length;)2==z&&3==B[F]?(z=0,B=[].concat(ja(B)),B.splice(F,1),B=new Uint8Array(B)):0==B[F]?z++:z=0,F++;z=B;for(F=0;F<z.length;){for(B=0;255==z[F];)B+=255,F++;B+=z[F++];for(var G=0;255==z[F];)G+=255,F++;G+=z[F++];4==B&&D.push(z.subarray(F,F+G));F+=G}D=t(D);for(z=D.next();!z.done;z=D.next())c.push({Lf:z.value,pts:x})}else try{k.skip(w-1)}catch(H){break}y-=w+4;0==y&&(l=q.length>v?l+(q[v].Rd||n):l+n,v++,y=q.length>
|
|
259
259
|
v?q[v].sampleSize||p:p)}}).parse(a,!1);return c};function bi(){this.h=new ai;this.g=new Rh}bi.prototype.init=function(a){this.h.init(a)};
|
|
260
|
-
function ci(a,b){var c=a.h.parse(b);c=t(c);for(var d=c.next();!d.done;d=c.next()){var e=d.value,f=Fb(e.Lf);if(0<f.length&&(d=a.g,e=e.pts,f=new Fg(f,0),181===f.Y()&&49===f.Jb()&&1195456820===f.M()&&3===f.Y())){var g=f.Y();if(0!==(g&64)){g&=31;f.skip(1);for(var h=0;h<g;h++){var k=f.Y(),l=(k&4)>>2,m=f.Y(),n=f.Y();l&&(k&=3,0===k||1===k?d.h.push({pts:e,type:k,
|
|
260
|
+
function ci(a,b){var c=a.h.parse(b);c=t(c);for(var d=c.next();!d.done;d=c.next()){var e=d.value,f=Fb(e.Lf);if(0<f.length&&(d=a.g,e=e.pts,f=new Fg(f,0),181===f.Y()&&49===f.Jb()&&1195456820===f.M()&&3===f.Y())){var g=f.Y();if(0!==(g&64)){g&=31;f.skip(1);for(var h=0;h<g;h++){var k=f.Y(),l=(k&4)>>2,m=f.Y(),n=f.Y();l&&(k&=3,0===k||1===k?d.h.push({pts:e,type:k,Aa:m,Oa:n,order:d.h.length}):(d.g.push({pts:e,type:k,value:m,order:d.g.length}),d.g.push({pts:e,type:2,value:n,order:d.g.length})))}}}}return Th(a.g)}
|
|
261
261
|
;function di(a){return!a||1==a.length&&1E-6>a.end(0)-a.start(0)?null:a.length?a.end(a.length-1):null}function ei(a,b,c){c=void 0===c?0:c;return!a||!a.length||1==a.length&&1E-6>a.end(0)-a.start(0)||b>a.end(a.length-1)?!1:b+c>=a.start(0)}function fi(a,b){if(!a||!a.length||1==a.length&&1E-6>a.end(0)-a.start(0))return 0;for(var c=0,d=t(gi(a)),e=d.next();!e.done;e=d.next()){var f=e.value;e=f.start;f=f.end;f>b&&(c+=f-Math.max(e,b))}return c}
|
|
262
262
|
function hi(a,b,c){if(!a||!a.length||1==a.length&&1E-6>a.end(0)-a.start(0))return null;a=gi(a).findIndex(function(d,e,f){return d.start>b&&(0==e||f[e-1].end-b<=c)});return 0<=a?a:null}function gi(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 ii(a,b,c,d){var e=this;this.j=a;this.l=c;this.h={};this.I={};this.G={};this.g=null;this.L=d||function(){};this.i={};this.o=new ef;this.s={};this.u=b;this.D=new rc;this.m=mi(this,this.D);this.C=new cf(function(){return ni(e)});this.F=""}function mi(a,b){var c=new MediaSource;a.o.oa(c,"sourceopen",function(){URL.revokeObjectURL(a.F);b.resolve()});a.F=oi(c);a.j.src=a.F;return c}r=ii.prototype;r.destroy=function(){return this.C.destroy()};
|
|
263
263
|
function ni(a){var b,c,d,e,f,g,h,k;return L(function(l){if(1==l.g){b=[];for(c in a.i)for(d=a.i[c],e=d[0],a.i[c]=d.slice(0,1),e&&b.push(e.p["catch"](Pb)),f=t(d.slice(1)),g=f.next();!g.done;g=f.next())h=g.value,h.p.reject(new N(2,7,7003,void 0));a.g&&b.push(a.g.destroy());a.l&&b.push(a.l.destroy());for(k in a.s)b.push(a.s[k].destroy());return u(l,Promise.all(b),2)}a.o&&(a.o.release(),a.o=null);a.j&&(a.j.removeAttribute("src"),a.j.load(),a.j=null);a.m=null;a.g=null;a.l=null;a.h={};a.s={};a.u=null;a.i=
|
|
@@ -265,8 +265,8 @@ function ni(a){var b,c,d,e,f,g,h,k;return L(function(l){if(1==l.g){b=[];for(c in
|
|
|
265
265
|
r.init=function(a,b){var c=this,d,e,f,g,h,k,l;return L(function(m){if(1==m.g)return d=qc,u(m,c.D,2);e={};f=t(a.keys());for(g=f.next();!g.done;e={qa:e.qa},g=f.next())e.qa=g.value,h=a.get(e.qa),k=ad(h.mimeType,h.codecs),e.qa==d.Z?pi(c,k):(!b&&MediaSource.isTypeSupported(k)||!Xc(k,e.qa)||(c.s[e.qa]=new Wc,k=Zc(e.qa,k)),l=c.m.addSourceBuffer(k),c.o.A(l,"error",function(n){return function(){c.i[n.qa][0].p.reject(new N(2,3,3014,c.j.error?c.j.error.code:0))}}(e)),c.o.A(l,"updateend",function(n){return function(){return qi(c,n.qa)}}(e)),
|
|
266
266
|
c.h[e.qa]=l,c.I[e.qa]=k,c.i[e.qa]=[],c.G[e.qa]=!!h.drmInfos.length);A(m)})};function pi(a,b){a.g||(a.g=new fd(a.l));"application/cea-608"!=b&&"application/cea-708"!=b&&(a.g.l=Sb(hd[b]))}function ri(a){return a.m?"ended"==a.m.readyState:!0}function si(a,b){if(b==pc)var c=a.g.g;else c=ti(a,b),c=!c||1==c.length&&1E-6>c.end(0)-c.start(0)?null:1==c.length&&0>c.start(0)?0:c.length?c.start(0):null;return c}function ui(a,b){return b==pc?a.g.h:di(ti(a,b))}
|
|
267
267
|
function vi(a,b,c){if(b==pc)return a=a.g,null==a.h||a.h<c?0:a.h-Math.max(c,a.g);a=ti(a,b);return fi(a,c)}r.Ya=function(){var a={total:gi(this.j.buffered),audio:gi(ti(this,"audio")),video:gi(ti(this,"video")),text:[]};if(this.g){var b=this.g.g,c=this.g.h;null!=b&&null!=c&&a.text.push({start:b,end:c})}return a};function ti(a,b){try{return a.h[b].buffered}catch(c){return null}}
|
|
268
|
-
function wi(a,b,c,d,e,f){var g,h,k,l,m,n,p,q;return L(function(v){if(1==v.g){g=qc;if(b==g.Z)return u(v,id(a.g,c,d,e),0);if(a.s[b])return u(v,$c(a.s[b],c),10);if(f)return a.g||pi(a,"text/vtt"),null==d&&null==e?a.u.init(c):(h=ci(a.u,c),h.length&&(k=a.h[g.
|
|
269
|
-
m,e));l.captions&&l.captions.length&&(n=a.h[g.
|
|
268
|
+
function wi(a,b,c,d,e,f){var g,h,k,l,m,n,p,q;return L(function(v){if(1==v.g){g=qc;if(b==g.Z)return u(v,id(a.g,c,d,e),0);if(a.s[b])return u(v,$c(a.s[b],c),10);if(f)return a.g||pi(a,"text/vtt"),null==d&&null==e?a.u.init(c):(h=ci(a.u,c),h.length&&(k=a.h[g.Na].timestampOffset,od(a.g,h,d,e,k))),c=xi(a,c,d,b),u(v,yi(a,b,function(){a.h[b].appendBuffer(c)}),0);c=xi(a,c,d,b);return u(v,yi(a,b,function(){a.h[b].appendBuffer(c)}),0)}l=v.h;a.g||pi(a,"text/vtt");l.metadata&&(m=a.h[b].timestampOffset,a.L(l.metadata,
|
|
269
|
+
m,e));l.captions&&l.captions.length&&(n=a.h[g.Na].timestampOffset,p=ld(l.captions),od(a.g,p,d,e,n));q=l.data;q=xi(a,q,d,b);return u(v,yi(a,b,function(){a.h[b].appendBuffer(q)}),0)})}function zi(a,b){var c=ui(a,"video")||0;kd(a.g,b,c)}function Ai(a){a.g&&kd(a.g,"",0)}r.remove=function(a,b,c){var d=this,e;return L(function(f){e=qc;return a==e.Z?u(f,d.g.remove(b,c),0):u(f,yi(d,a,function(){c<=b?qi(d,a):d.h[a].remove(b,c)}),0)})};
|
|
270
270
|
function Bi(a,b){var c;return L(function(d){c=qc;return b==c.Z?a.g?u(d,a.g.remove(0,Infinity),0):d["return"]():u(d,yi(a,b,function(){var e=a.m.duration;0>=e?qi(a,b):a.h[b].remove(0,e)}),0)})}r.flush=function(a){var b=this,c;return L(function(d){c=qc;return a==c.Z?d["return"]():u(d,yi(b,a,function(){b.j.currentTime-=.001;qi(b,a)}),0)})};
|
|
271
271
|
function Ci(a,b,c,d,e){var f;return L(function(g){f=qc;return b==f.Z?(a.g.u=c,jd(a.g,d,e),g["return"]()):u(g,Promise.all([yi(a,b,function(){var h=a.h[b].appendWindowStart,k=a.h[b].appendWindowEnd;a.h[b].abort();a.h[b].appendWindowStart=h;a.h[b].appendWindowEnd=k;qi(a,b)}),yi(a,b,function(){var h=c;0>h&&(h+=.001);a.h[b].timestampOffset=h;qi(a,b)}),yi(a,b,function(){a.h[b].appendWindowStart=0;a.h[b].appendWindowEnd=e;a.h[b].appendWindowStart=d;qi(a,b)})]),0)})}
|
|
272
272
|
r.endOfStream=function(a){var b=this;return L(function(c){return u(c,Di(b,function(){ri(b)||(a?b.m.endOfStream(a):b.m.endOfStream())}),0)})};r.Ia=function(a){var b=this;return L(function(c){return u(c,Di(b,function(){b.m.duration=a}),0)})};r.getDuration=function(){return this.m.duration};function qi(a,b){var c=a.i[b][0];c&&(c.p.resolve(),Ei(a,b))}function yi(a,b,c){df(a.C);c={start:c,p:new rc};a.i[b].push(c);1==a.i[b].length&&Fi(a,b);return c.p}
|
|
@@ -275,65 +275,65 @@ function Fi(a,b){var c=a.i[b][0];if(c)try{c.start()}catch(d){"QuotaExceededError
|
|
|
275
275
|
function Ii(a,b,c,d,e,f,g,h,k,l,m,n){l=void 0===l?[]:l;this.startTime=a;this.l=this.endTime=b;this.j=c;this.pa=d;this.ha=e;this.g=f;this.timestampOffset=g;this.appendWindowStart=h;this.appendWindowEnd=k;this.h=l;this.tilesLayout=void 0===m?"":m;this.i=void 0===n?null:n}r=Ii.prototype;r.sa=function(){return this.j()};r.getStartTime=function(){return this.startTime};r.ef=function(){return this.endTime};r.ec=function(){return this.pa};r.ac=function(){return this.ha};r.yf=function(){return this.tilesLayout};
|
|
276
276
|
r.xf=function(){return this.i};M("shaka.media.SegmentReference",Ii);Ii.prototype.getTileDuration=Ii.prototype.xf;Ii.prototype.getTilesLayout=Ii.prototype.yf;Ii.prototype.getEndByte=Ii.prototype.ac;Ii.prototype.getStartByte=Ii.prototype.ec;Ii.prototype.getEndTime=Ii.prototype.ef;Ii.prototype.getStartTime=Ii.prototype.getStartTime;Ii.prototype.getUris=Ii.prototype.sa;function S(a,b,c){this.l=a;this.Sc=b;this.m=this.i=Infinity;this.g=1;this.h=this.j=null;this.o=0;this.s=!0;this.u=0;this.C=void 0===c?!0:c;this.D=0;this.F=!1}r=S.prototype;r.getDuration=function(){return this.i};r.lf=function(){return this.g};r.Ia=function(a){this.i=a};r.rf=function(){return this.l};r.Ee=function(a){this.o=a};r.oc=function(a){this.s=a};r.Yd=function(a){this.m=a};r.$f=function(a){this.Sc=a};r.df=function(){return this.Sc};
|
|
277
277
|
r.Gb=function(a){if(0!=a.length){var b=a[a.length-1].endTime;this.Id(a[0].startTime);this.g=a.reduce(function(c,d){return Math.max(c,d.endTime-d.startTime)},this.g);this.h=Math.max(this.h,b);null!=this.l&&this.C&&!this.F&&(this.l=(Date.now()+this.o)/1E3-this.h-this.g)}};r.Bd=function(){this.F=!0};r.Id=function(a){this.j=null==this.j?a:Math.min(this.j,a)};r.Hd=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)};
|
|
278
|
-
r.T=function(){return Infinity==this.i&&!this.s};r.mb=function(){return Infinity!=this.i&&!this.s};r.
|
|
279
|
-
r.
|
|
280
|
-
S.prototype.setUserSeekStart=S.prototype.Fe;S.prototype.getSegmentAvailabilityStart=S.prototype.
|
|
281
|
-
S.prototype.setSegmentAvailabilityDuration=S.prototype.Yd;S.prototype.setStatic=S.prototype.oc;S.prototype.setClockOffset=S.prototype.Ee;S.prototype.getPresentationStartTime=S.prototype.rf;S.prototype.setDuration=S.prototype.Ia;S.prototype.getMaxSegmentDuration=S.prototype.lf;S.prototype.getDuration=S.prototype.getDuration;function Ji(a,b){this.j=a;this.m=Ki(a);this.g=a.g.currentTime;this.l=Date.now()/1E3;this.h=!1;this.o=b;this.i=function(){}}Ji.prototype.release=function(){this.j=null;this.i=function(){}};function Li(a,b){a.i=b}function Mi(a){this.g=a}function Ki(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(gi(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 Ni(a,b,c,d,e){var f=this;this.g=a;this.C=b;this.l=c;this.u=e;this.i=new ef;this.s=!1;this.D=a.readyState;this.j=!1;this.h=d;this.o=!1;this.i.A(a,"waiting",function(){return Oi(f)});this.m=(new O(function(){Oi(f)})).
|
|
278
|
+
r.T=function(){return Infinity==this.i&&!this.s};r.mb=function(){return Infinity!=this.i&&!this.s};r.Qa=function(){return Math.max(this.u,this.hb()-this.m)};r.Fe=function(a){this.u=a};r.hb=function(){return this.T()||this.mb()?Math.min(Math.max(0,(Date.now()+this.o)/1E3-this.g-this.l)+this.D,this.i):this.h?Math.min(this.h,this.i):this.i};r.dc=function(a){var b=Math.max(this.j,this.u);return Infinity==this.m?Math.ceil(1E3*b)/1E3:Math.max(b,Math.min(this.hb()-this.m+a,this.Pa()))};r.Cb=function(){return this.dc(0)};
|
|
279
|
+
r.Pa=function(){return Math.max(0,this.hb()-(this.T()||this.mb()?this.Sc:0))};r.Ie=function(){return null==this.l||null!=this.h&&this.C?!1:!0};r.De=function(a){this.D=a};M("shaka.media.PresentationTimeline",S);S.prototype.setAvailabilityTimeOffset=S.prototype.De;S.prototype.usingPresentationStartTime=S.prototype.Ie;S.prototype.getSeekRangeEnd=S.prototype.Pa;S.prototype.getSeekRangeStart=S.prototype.Cb;S.prototype.getSafeSeekRangeStart=S.prototype.dc;S.prototype.getSegmentAvailabilityEnd=S.prototype.hb;
|
|
280
|
+
S.prototype.setUserSeekStart=S.prototype.Fe;S.prototype.getSegmentAvailabilityStart=S.prototype.Qa;S.prototype.isInProgress=S.prototype.mb;S.prototype.isLive=S.prototype.T;S.prototype.offset=S.prototype.offset;S.prototype.notifyMaxSegmentDuration=S.prototype.Hd;S.prototype.notifyMinSegmentStartTime=S.prototype.Id;S.prototype.lockStartTime=S.prototype.Bd;S.prototype.notifySegments=S.prototype.Gb;S.prototype.getDelay=S.prototype.df;S.prototype.setDelay=S.prototype.$f;
|
|
281
|
+
S.prototype.setSegmentAvailabilityDuration=S.prototype.Yd;S.prototype.setStatic=S.prototype.oc;S.prototype.setClockOffset=S.prototype.Ee;S.prototype.getPresentationStartTime=S.prototype.rf;S.prototype.setDuration=S.prototype.Ia;S.prototype.getMaxSegmentDuration=S.prototype.lf;S.prototype.getDuration=S.prototype.getDuration;function Ji(a,b){this.j=a;this.m=Ki(a);this.g=a.g.currentTime;this.l=Date.now()/1E3;this.h=!1;this.o=b;this.i=function(){}}Ji.prototype.release=function(){this.j=null;this.i=function(){}};function Li(a,b){a.i=b}function Mi(a){this.g=a}function Ki(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(gi(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 Ni(a,b,c,d,e){var f=this;this.g=a;this.C=b;this.l=c;this.u=e;this.i=new ef;this.s=!1;this.D=a.readyState;this.j=!1;this.h=d;this.o=!1;this.i.A(a,"waiting",function(){return Oi(f)});this.m=(new O(function(){Oi(f)})).Da(.25)}Ni.prototype.release=function(){this.i&&(this.i.release(),this.i=null);null!=this.m&&(this.m.stop(),this.m=null);this.h&&(this.h.release(),this.h=null);this.g=this.C=this.u=null};Ni.prototype.Ld=function(){this.o=!0;Oi(this)};
|
|
282
282
|
function Oi(a){if(0!=a.g.readyState){if(a.g.seeking){if(!a.s)return}else a.s=!1;if(!a.g.paused||0==a.g.currentTime&&(a.g.autoplay||0!=a.g.currentTime)){a.g.readyState!=a.D&&(a.j=!1,a.D=a.g.readyState);var b;if(!(b=!a.h)){b=a.h;var c=b.j,d=Ki(c),e=c.g.currentTime,f=Date.now()/1E3;if(b.g!=e||b.m!=d)b.l=f,b.g=e,b.m=d,b.h=!1;e=f-b.l;if(d=e>=b.o&&d&&!b.h)b.i(b.g,e),b.h=!0,b.g=c.g.currentTime;b=!d}if(b){e=a.l.smallGapLimit;var g=a.g.currentTime;b=a.g.buffered;c=hi(b,g,a.l.gapDetectionThreshold);if(!(null==
|
|
283
|
-
c||0==c&&!a.o||(d=b.start(c),d>=a.C.
|
|
283
|
+
c||0==c&&!a.o||(d=b.start(c),d>=a.C.Pa()))){var h=d-g;e=h<=e;f=!1;.001>h||(e||a.j||(a.j=!0,g=(new Map).set("currentTime",g).set("gapSize",h),g=new Q("largegap",g),g.cancelable=!0,a.u(g),a.l.jumpLargeGaps&&!g.defaultPrevented&&(f=!0)),!e&&!f)||(0!=c&&b.end(c-1),a.g.currentTime=d)}}}}};function Pi(a,b,c,d){b==HTMLMediaElement.HAVE_NOTHING||a.readyState>=b?d():(b=Qi.value().get(b),c.oa(a,b,d))}var Qi=new sc(function(){return new Map([[HTMLMediaElement.HAVE_METADATA,"loadedmetadata"],[HTMLMediaElement.HAVE_CURRENT_DATA,"loadeddata"],[HTMLMediaElement.HAVE_FUTURE_DATA,"canplay"],[HTMLMediaElement.HAVE_ENOUGH_DATA,"canplaythrough"]])});function Ri(a,b,c){var d=this;this.g=a;this.l=b;this.j=c;this.m=!1;this.h=new ef;this.i=new Si(a);Pi(this.g,HTMLMediaElement.HAVE_METADATA,this.h,function(){Ti(d,d.j)})}Ri.prototype.release=function(){this.h&&(this.h.release(),this.h=null);null!=this.i&&(this.i.release(),this.i=null);this.l=function(){};this.g=null};function Ui(a){return a.m?a.g.currentTime:a.j}function Vi(a,b){0<a.g.readyState?Wi(a.i,b):Pi(a.g,HTMLMediaElement.HAVE_METADATA,a.h,function(){Ti(a,a.j)})}
|
|
284
284
|
function Ti(a,b){.001>Math.abs(a.g.currentTime-b)?Xi(a):(a.h.oa(a.g,"seeking",function(){Xi(a)}),Wi(a.i,0==a.g.currentTime?b:a.g.currentTime))}function Xi(a){a.m=!0;a.h.A(a.g,"seeking",function(){return a.l()})}function Si(a){var b=this;this.h=a;this.m=10;this.l=this.j=this.i=0;this.g=new O(function(){0>=b.i?b.g.stop():b.h.currentTime!=b.j?b.g.stop():(b.h.currentTime=b.l,b.i--)})}Si.prototype.release=function(){this.g&&(this.g.stop(),this.g=null);this.h=null};
|
|
285
|
-
function Wi(a,b){a.j=a.h.currentTime;a.l=b;a.i=a.m;a.h.currentTime=b;a.g.
|
|
286
|
-
function Zi(a,b,c,d,e,f){var g=this;this.i=a;this.g=b.presentationTimeline;this.u=b.minBufferTime||0;this.l=c;this.s=e;this.o=null;this.j=new Ni(a,b.presentationTimeline,c,$i(a,c),f);this.h=new Ri(a,function(){a:{var h=g.j;h.s=!0;h.o=!1;h.j=!1;var k=Ui(g.h);h=aj(g,k);if(.001<Math.abs(h-k)&&(k=Date.now()/1E3,!g.o||g.o<k-1)){g.o=k;Vi(g.h,h);h=void 0;break a}g.s();h=void 0}return h},bj(this,d));this.m=new O(function(){if(0!=g.i.readyState&&!g.i.paused){var h=Ui(g.h),k=g.g.Cb(),l=g.g.
|
|
287
|
-
3);h<k&&(h=aj(g,h),g.i.currentTime=h)}})}r=Zi.prototype;r.nd=function(){this.m.
|
|
288
|
-
function bj(a,b){null==b?b=Infinity>a.g.getDuration()?a.g.Cb():a.g.
|
|
289
|
-
function cj(a,b){var c=a.g.Cb();if(b<c)return c;c=a.g.
|
|
285
|
+
function Wi(a,b){a.j=a.h.currentTime;a.l=b;a.i=a.m;a.h.currentTime=b;a.g.Da(.1)};function Yi(a){this.g=a;this.j=!1;this.h=null;this.i=new ef}r=Yi.prototype;r.nd=function(){function a(){null==b.h||0==b.h?b.j=!0:(b.i.oa(b.g,"seeking",function(){b.j=!0}),b.g.currentTime=Math.max(0,b.g.currentTime+b.h))}var b=this;Pi(this.g,HTMLMediaElement.HAVE_CURRENT_DATA,this.i,function(){a()})};r.release=function(){this.i&&(this.i.release(),this.i=null);this.g=null};r.od=function(a){this.h=this.j?this.h:a};r.wc=function(){return(this.j?this.g.currentTime:this.h)||0};r.ue=function(){};
|
|
286
|
+
function Zi(a,b,c,d,e,f){var g=this;this.i=a;this.g=b.presentationTimeline;this.u=b.minBufferTime||0;this.l=c;this.s=e;this.o=null;this.j=new Ni(a,b.presentationTimeline,c,$i(a,c),f);this.h=new Ri(a,function(){a:{var h=g.j;h.s=!0;h.o=!1;h.j=!1;var k=Ui(g.h);h=aj(g,k);if(.001<Math.abs(h-k)&&(k=Date.now()/1E3,!g.o||g.o<k-1)){g.o=k;Vi(g.h,h);h=void 0;break a}g.s();h=void 0}return h},bj(this,d));this.m=new O(function(){if(0!=g.i.readyState&&!g.i.paused){var h=Ui(g.h),k=g.g.Cb(),l=g.g.Pa();3>l-k&&(k=l-
|
|
287
|
+
3);h<k&&(h=aj(g,h),g.i.currentTime=h)}})}r=Zi.prototype;r.nd=function(){this.m.Da(.25)};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.s=function(){}};r.od=function(a){Vi(this.h,a)};r.wc=function(){var a=Ui(this.h);return 0<this.i.readyState&&!this.i.paused?cj(this,a):a};
|
|
288
|
+
function bj(a,b){null==b?b=Infinity>a.g.getDuration()?a.g.Cb():a.g.Pa():0>b&&(b=a.g.Pa()+b);return dj(a,cj(a,b))}r.ue=function(){this.j.Ld()};function dj(a,b){var c=a.g.getDuration();return b>=c?c-a.l.durationBackoff:b}function aj(a,b){var c=Math.max(a.u,a.l.rebufferingGoal),d=a.l.safeSeekOffset,e=a.g.Cb(),f=a.g.Pa(),g=a.g.getDuration();3>f-e&&(e=f-3);var h=a.g.dc(c),k=a.g.dc(d);c=a.g.dc(c+d);return b>=g?dj(a,b):b>f?f:b<e?ei(a.i.buffered,k)?k:c:b>=h||ei(a.i.buffered,b)?b:c}
|
|
289
|
+
function cj(a,b){var c=a.g.Cb();if(b<c)return c;c=a.g.Pa();return b>c?c:b}function $i(a,b){if(!b.stallEnabled)return null;var c=b.stallSkip,d=new Ji(new Mi(a),b.stallThreshold);Li(d,function(){c?a.currentTime+=c:(a.pause(),a.play())});return d};function T(a){this.K=a;this.g=null;this.h=0;this.i=!1}r=T.prototype;r.destroy=function(){Kb("shaka.media.SegmentIndex","Please use release() instead of destroy().");this.release();return Promise.resolve()};r.release=function(){this.i||(this.K=[],this.g&&this.g.stop(),this.g=null)};r.Ff=function(){this.i=!0};
|
|
290
290
|
r.find=function(a){for(var b=this.K.length-1,c=b;0<=c;--c){var d=this.K[c],e=c<b?this.K[c+1].startTime:d.endTime;if(a>=d.startTime&&a<e)return c+this.h}return this.K.length&&a<this.K[0].startTime?this.h:null};r.get=function(a){if(0==this.K.length)return null;a-=this.h;return 0>a||a>=this.K.length?null:this.K[a]};r.offset=function(a){if(!this.i)for(var b=t(this.K),c=b.next();!c.done;c=b.next())c=c.value,c.startTime+=a,c.endTime+=a,c.timestampOffset+=a};
|
|
291
291
|
r.Eb=function(a){!this.i&&a.length&&(this.K=this.K.filter(function(b){return b.startTime<a[0].startTime}),this.K.push.apply(this.K,ja(a)))};r.Fb=function(a,b){var c=this;a=a.filter(function(d){return d.endTime>b&&(0==c.K.length||d.endTime>c.K[0].startTime)});this.Eb(a);this.eb(b)};r.eb=function(a){if(!this.i){var b=this.K.length;this.K=this.K.filter(function(c){return c.endTime>a});this.h+=b-this.K.length}};
|
|
292
292
|
r.Xa=function(a,b,c){c=void 0===c?!1:c;if(!this.i){for(;this.K.length;)if(this.K[this.K.length-1].startTime>=b)this.K.pop();else break;for(;this.K.length;)if(this.K[0].endTime<=a)this.K.shift(),c||this.h++;else break;0!=this.K.length&&(a=this.K[this.K.length-1],this.K[this.K.length-1]=new Ii(a.startTime,b,a.j,a.pa,a.ha,a.g,a.timestampOffset,a.appendWindowStart,a.appendWindowEnd,a.h,a.tilesLayout,a.i))}};
|
|
293
|
-
r.Uc=function(a,b){var c=this;this.i||(this.g&&this.g.stop(),this.g=new O(function(){var d=b();d?c.K.push.apply(c.K,ja(d)):(c.g.stop(),c.g=null)}),this.g.
|
|
293
|
+
r.Uc=function(a,b){var c=this;this.i||(this.g&&this.g.stop(),this.g=new O(function(){var d=b();d?c.K.push.apply(c.K,ja(d)):(c.g.stop(),c.g=null)}),this.g.Da(a))};T.prototype[Symbol.iterator]=function(){return this.gb(0)};T.prototype.gb=function(a){var b=this.find(a);if(null==b)return null;b--;var c=this.get(b+1),d=-1;if(c&&0<c.h.length)for(var e=c.h.length-1;0<=e;--e){var f=c.h[e];if(a>=f.startTime&&a<f.endTime){b++;d=e-1;break}}return new ej(this,b,d)};
|
|
294
294
|
function fj(a,b,c){return new T([new Ii(a,a+b,function(){return c},0,null,null,a,a,a+b)])}M("shaka.media.SegmentIndex",T);T.forSingleSegment=fj;T.prototype.getIteratorForTime=T.prototype.gb;T.prototype.updateEvery=T.prototype.Uc;T.prototype.fit=T.prototype.Xa;T.prototype.evict=T.prototype.eb;T.prototype.mergeAndEvict=T.prototype.Fb;T.prototype.merge=T.prototype.Eb;T.prototype.offset=T.prototype.offset;T.prototype.get=T.prototype.get;T.prototype.find=T.prototype.find;T.prototype.markImmutable=T.prototype.Ff;
|
|
295
295
|
T.prototype.release=T.prototype.release;T.prototype.destroy=T.prototype.destroy;function ej(a,b,c){this.i=a;this.h=b;this.g=c}ej.prototype.seek=function(a){Kb("shaka.media.SegmentIterator","Please use SegmentIndex.getIteratorForTime instead of seek().");(a=this.i.gb(a))?(this.h=a.h,this.g=a.g):(this.h=Number.MAX_VALUE,this.g=0);return this.next().value};
|
|
296
296
|
ej.prototype.current=function(){var a=this.i.get(this.h);a&&0<a.h.length&&a.sa().length&&this.g>=a.h.length&&(this.h++,this.g=0,a=this.i.get(this.h));return a&&0<a.h.length?a.h[this.g]:a};ej.prototype.next=function(){var a=this.i.get(this.h);a&&0<a.h.length?(this.g++,a.sa().length&&this.g==a.h.length&&(this.h++,this.g=0)):(this.h++,this.g=0);a=this.current();return{value:a,done:!a}};M("shaka.media.SegmentIterator",ej);ej.prototype.next=ej.prototype.next;ej.prototype.current=ej.prototype.current;
|
|
297
297
|
ej.prototype.seek=ej.prototype.seek;function gj(){T.call(this,[]);this.j=[]}qa(gj,T);r=gj.prototype;r.clone=function(){var a=new gj;a.j=this.j.slice();return a};r.release=function(){for(var a=t(this.j),b=a.next();!b.done;b=a.next())b.value.release();this.j=[]};r.find=function(a){for(var b=0,c=t(this.j),d=c.next();!d.done;d=c.next()){d=d.value;var e=d.find(a);if(null!=e)return e+b;b+=d.h+d.K.length}return null};
|
|
298
298
|
r.get=function(a){for(var b=0,c=t(this.j),d=c.next();!d.done;d=c.next()){d=d.value;var e=d.get(a-b);if(e)return e;b+=d.h+d.K.length}return null};r.offset=function(){};r.Eb=function(){};r.eb=function(){};r.Fb=function(){};r.Xa=function(){};r.Uc=function(){};M("shaka.media.MetaSegmentIndex",gj);gj.prototype.updateEvery=gj.prototype.Uc;gj.prototype.fit=gj.prototype.Xa;gj.prototype.mergeAndEvict=gj.prototype.Fb;gj.prototype.evict=gj.prototype.eb;gj.prototype.merge=gj.prototype.Eb;
|
|
299
|
-
gj.prototype.offset=gj.prototype.offset;gj.prototype.get=gj.prototype.get;gj.prototype.find=gj.prototype.find;gj.prototype.release=gj.prototype.release;function hj(a){var b=this;this.g=a;this.j=!1;this.i=this.g.Jc();this.h=new O(function(){b.g.te(.25*b.i)})}hj.prototype.release=function(){this.h&&(this.h.stop(),this.h=null);this.g=null};hj.prototype.set=function(a){this.i=a;ij(this)};hj.prototype.Fc=function(){return this.g.Fc()};function ij(a){a.h.stop();var b=a.j?0:a.i;if(0<=b)try{a.g.Jc()!=b&&a.g.Xd(b);return}catch(c){}a.h.
|
|
299
|
+
gj.prototype.offset=gj.prototype.offset;gj.prototype.get=gj.prototype.get;gj.prototype.find=gj.prototype.find;gj.prototype.release=gj.prototype.release;function hj(a){var b=this;this.g=a;this.j=!1;this.i=this.g.Jc();this.h=new O(function(){b.g.te(.25*b.i)})}hj.prototype.release=function(){this.h&&(this.h.stop(),this.h=null);this.g=null};hj.prototype.set=function(a){this.i=a;ij(this)};hj.prototype.Fc=function(){return this.g.Fc()};function ij(a){a.h.stop();var b=a.j?0:a.i;if(0<=b)try{a.g.Jc()!=b&&a.g.Xd(b);return}catch(c){}a.h.Da(.25);0!=a.g.Jc()&&a.g.Xd(0)};function jj(a){var b=this;this.h=a;this.g=new Set;this.i=(new O(function(){kj(b,!1)})).Da(.25)}jj.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 kj(a,b){for(var c=t(a.g),d=c.next();!d.done;d=c.next())d.value.j(a.h.currentTime,b)};function lj(a){Ne.call(this);this.g=new Map;this.h=a}qa(lj,Ne);lj.prototype.release=function(){this.g.clear();Ne.prototype.release.call(this)};function mj(a,b){var c=a.g.get(b);c||(c={ic:[],fe:null,contentType:b},a.g.set(b,c));return c}function nj(a,b,c){var d=mj(a,b.contentType);oj(a,d);a={Dd:b,position:c};d=d.ic;b=d.findIndex(function(e){return e.position>=c});0<=b?d.splice(b,d[b].position==c?1:0,a):d.push(a)}
|
|
300
300
|
lj.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.ic;for(var e=d.length-1;0<=e;e--){var f=d[e];if(f.position<=a){d=f.Dd;break a}}d=null}if(e=d)e=c.fe,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);
|
|
301
|
-
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.fe=d,JSON.stringify(d),c=new Q("qualitychange",new Map([["quality",d],["position",a]])),this.dispatchEvent(c))}};function oj(a,b){var c=a.h()[b.contentType];if(c&&0<c.length){var d=c[0].start,e=c[c.length-1].end,f=b.ic;b.ic=f.filter(function(g,h){return g.position<=d&&h+1<f.length&&f[h+1].position<=d||g.position>=e?!1:!0})}else b.ic=[]};function pj(a){Ne.call(this);var b=this;this.g=new Set;this.i=a;this.h=(new O(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 Q("regionremove",new Map([["region",e]])),b.dispatchEvent(e))})).
|
|
301
|
+
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.fe=d,JSON.stringify(d),c=new Q("qualitychange",new Map([["quality",d],["position",a]])),this.dispatchEvent(c))}};function oj(a,b){var c=a.h()[b.contentType];if(c&&0<c.length){var d=c[0].start,e=c[c.length-1].end,f=b.ic;b.ic=f.filter(function(g,h){return g.position<=d&&h+1<f.length&&f[h+1].position<=d||g.position>=e?!1:!0})}else b.ic=[]};function pj(a){Ne.call(this);var b=this;this.g=new Set;this.i=a;this.h=(new O(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 Q("regionremove",new Map([["region",e]])),b.dispatchEvent(e))})).Da(2)}qa(pj,Ne);pj.prototype.release=function(){this.g.clear();this.h.stop();Ne.prototype.release.call(this)};function qj(a){Ne.call(this);var b=this;this.i=a;this.g=new Map;this.l=[{ub:null,sb:rj,lb:function(c,d){return sj(b,"enter",c,d)}},{ub:tj,sb:rj,lb:function(c,d){return sj(b,"enter",c,d)}},{ub:uj,sb:rj,lb:function(c,d){return sj(b,"enter",c,d)}},{ub:rj,sb:tj,lb:function(c,d){return sj(b,"exit",c,d)}},{ub:rj,sb:uj,lb:function(c,d){return sj(b,"exit",c,d)}},{ub:tj,sb:uj,lb:function(c,d){return sj(b,"skip",c,d)}},{ub:uj,sb:tj,lb:function(c,d){return sj(b,"skip",c,d)}}];this.h=new ef;this.h.A(this.i,"regionremove",
|
|
302
302
|
function(c){b.g["delete"](c.region)})}qa(qj,Ne);qj.prototype.release=function(){this.i=null;this.g.clear();this.h.release();this.h=null;Ne.prototype.release.call(this)};qj.prototype.j=function(a,b){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?tj:a>d.endTime?uj:rj;this.g.set(d,f);for(var g=t(this.l),h=g.next();!h.done;h=g.next())h=h.value,h.ub==e&&h.sb==f&&h.lb(d,b)}};
|
|
303
303
|
function sj(a,b,c,d){b=new Q(b,new Map([["region",c],["seeking",d]]));a.dispatchEvent(b)}var tj=1,rj=2,uj=3;function vj(a,b,c,d,e){a=We(a,d,e);if(0!=b||null!=c)a.headers.Range=c?"bytes="+b+"-"+c:"bytes="+b+"-";return a};function wj(a,b){var c=this;this.g=b;this.m=a;this.h=null;this.u=1;this.o=this.l=null;this.j=new Map;this.C=!1;this.D=null;this.s=!1;this.i=new cf(function(){return xj(c)})}wj.prototype.destroy=function(){return this.i.destroy()};function xj(a){var b,c,d,e;return L(function(f){if(1==f.g){b=[];c=t(a.j.values());for(d=c.next();!d.done;d=c.next())e=d.value,yj(e),b.push(zj(e));return u(f,Promise.all(b),2)}a.j.clear();a.g=null;a.m=null;a.h=null;A(f)})}
|
|
304
304
|
wj.prototype.configure=function(a){this.h=a;this.D=new Ce({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)};wj.prototype.start=function(){var a=this;return L(function(b){if(1==b.g)return u(b,Aj(a),2);df(a.i);a.C=!0;A(b)})};
|
|
305
305
|
function Bj(a,b){var c,d,e,f,g,h;L(function(k){switch(k.g){case 1:return c=qc,C(k,2),u(k,Bi(a.g.R,c.Z),4);case 4:va(k,3);break;case 2:if(d=E(k),a.g)a.g.onError(d);case 3:e=ad(b.mimeType,b.codecs);pi(a.g.R,e);f=a.g.R.l;if(g=f.isTextVisible()||a.h.alwaysStreamText)h=Cj(b),a.j.set(c.Z,h),Dj(a,h,0);A(k)}})}function Ej(a){var b=a.j.get(pc);b&&(yj(b),zj(b)["catch"](function(){}),a.j["delete"](pc));a.o=null}
|
|
306
306
|
function Fj(a,b){var c=a.j.get("video");if(c){var d=c.stream;if(d)if(b){var e=d.trickModeVideo;e&&!c.qb&&(Gj(a,e,!1,0,!1),c.qb=d)}else if(d=c.qb)c.qb=null,Gj(a,d,!0,0,!1)}}function Hj(a,b,c,d,e){c=void 0===c?!1:c;d=void 0===d?0:d;e=void 0===e?!1:e;a.l=b;a.C&&(b.video&&Gj(a,b.video,c,d,e),b.audio&&Gj(a,b.audio,c,d,e))}function Ij(a,b){a.o=b;a.C&&Gj(a,b,!0,0,!1)}
|
|
307
|
-
function Gj(a,b,c,d,e){var f=a.j.get(b.type);f||b.type!=pc?f&&(f.qb&&(b.trickModeVideo?(f.qb=b,b=b.trickModeVideo):f.qb=null),f.stream!=b||e)&&(b.type==pc&&pi(a.g.R,ad(b.mimeType,b.codecs)),f.stream.closeSegmentIndex&&f.stream.closeSegmentIndex(),f.stream=b,f.ba=null,c&&(f.Zb?f.Xc=!0:f.
|
|
308
|
-
function Kj(a,b){var c,d;return L(function(e){if(1==e.g){if(!b.
|
|
309
|
-
f=8*h/k<(g||0)-f-Math.max(a.m.minBufferTime||0,a.h.rebufferingGoal)||b.
|
|
310
|
-
function Aj(a){var b,c,d,e,f,g,h,k,l,m;return L(function(n){if(1==n.g){b=qc;if(!a.l)throw new N(2,5,5006);c=new Map;d=new Set;a.l.audio&&(c.set(b.cb,a.l.audio),d.add(a.l.audio));a.l.video&&(c.set(b.
|
|
311
|
-
(m=Cj(l),a.j.set(k,m),Dj(a,m,0));A(n)})}function Cj(a){return{stream:a,type:a.type,ba:null,
|
|
312
|
-
function Mj(a,b){var c,d,e,f,g;return L(function(h){switch(h.g){case 1:df(a.i);if(b.
|
|
307
|
+
function Gj(a,b,c,d,e){var f=a.j.get(b.type);f||b.type!=pc?f&&(f.qb&&(b.trickModeVideo?(f.qb=b,b=b.trickModeVideo):f.qb=null),f.stream!=b||e)&&(b.type==pc&&pi(a.g.R,ad(b.mimeType,b.codecs)),f.stream.closeSegmentIndex&&f.stream.closeSegmentIndex(),f.stream=b,f.ba=null,c&&(f.Zb?f.Xc=!0:f.ta?(f.ab=!0,f.zc=d,f.Xc=!0):(yj(f),Jj(a,f,!0,d)["catch"](function(g){if(a.g)a.g.onError(g)}))),Kj(a,f)["catch"](function(g){if(a.g)a.g.onError(g)})):Bj(a,b)}
|
|
308
|
+
function Kj(a,b){var c,d;return L(function(e){if(1==e.g){if(!b.va)return e["return"]();c=b.stream;d=b.va;return c.segmentIndex?e.B(2):u(e,c.createSegmentIndex(),2)}if(b.va!=d||b.stream!=c)return e["return"]();var f=a.g.Ic();var g=ui(a.g.R,b.type),h=b.stream.segmentIndex.find(b.Ba?b.Ba.endTime:f),k=null==h?null:b.stream.segmentIndex.get(h);h=k?k.ha?k.ha-k.pa:null:null;k&&!h&&(h=(k.endTime-k.getStartTime())*(b.stream.bandwidth||0)/8);h?((k=k.g)&&(h+=(k.ha?k.ha-k.pa:null)||0),k=a.g.getBandwidthEstimate(),
|
|
309
|
+
f=8*h/k<(g||0)-f-Math.max(a.m.minBufferTime||0,a.h.rebufferingGoal)||b.va.h.g>h?!0:!1):f=!1;f&&b.va.abort();A(e)})}function Lj(a,b){b.Zb||b.ab||(b.ta?(b.ab=!0,b.zc=0):null==si(a.g.R,b.type)?null==b.Ka&&Dj(a,b,0):(yj(b),Jj(a,b,!1,0)["catch"](function(c){if(a.g)a.g.onError(c)})))}
|
|
310
|
+
function Aj(a){var b,c,d,e,f,g,h,k,l,m;return L(function(n){if(1==n.g){b=qc;if(!a.l)throw new N(2,5,5006);c=new Map;d=new Set;a.l.audio&&(c.set(b.cb,a.l.audio),d.add(a.l.audio));a.l.video&&(c.set(b.Na,a.l.video),d.add(a.l.video));a.o&&(c.set(b.Z,a.o),d.add(a.o));e=a.g.R;f=a.h.forceTransmuxTS;return u(n,e.init(c,f),2)}df(a.i);var p=a.m.presentationTimeline.getDuration();Infinity>p?a.g.R.Ia(p):a.g.R.Ia(Math.pow(2,32));g=t(c.keys());for(h=g.next();!h.done;h=g.next())k=h.value,l=c.get(k),a.j.has(k)||
|
|
311
|
+
(m=Cj(l),a.j.set(k,m),Dj(a,m,0));A(n)})}function Cj(a){return{stream:a,type:a.type,ba:null,Ba:null,Mc:null,zd:null,yd:null,xd:null,qb:null,endOfStream:!1,ta:!1,Ka:null,ab:!1,zc:0,Xc:!1,Zb:!1,Pd:!1,fc:!1,va:null}}
|
|
312
|
+
function Mj(a,b){var c,d,e,f,g;return L(function(h){switch(h.g){case 1:df(a.i);if(b.ta||null==b.Ka||b.Zb)return h["return"]();b.Ka=null;if(!b.ab){h.B(2);break}return u(h,Jj(a,b,b.Xc,b.zc),3);case 3:return h["return"]();case 2:if(b.stream.segmentIndex){h.B(4);break}c=b.stream;return u(h,b.stream.createSegmentIndex(),5);case 5:if(c!=b.stream)return c.closeSegmentIndex&&c.closeSegmentIndex(),b.ta||b.Ka||Dj(a,b,0),h["return"]();case 4:C(h,6);d=Nj(a,b);null!=d&&(Dj(a,b,d),b.fc=!1);va(h,7);break;case 6:return e=
|
|
313
313
|
E(h),u(h,Oj(a,e),8);case 8:return h["return"]();case 7:f=Array.from(a.j.values());if(!a.C||!f.every(function(k){return k.endOfStream})){h.B(0);break}return u(h,a.g.R.endOfStream(),10);case 10:df(a.i),g=a.g.R.getDuration(),0!=g&&g<a.m.presentationTimeline.getDuration()&&a.m.presentationTimeline.Ia(g),A(h)}})}
|
|
314
|
-
function Nj(a,b){if(Pj(b))return zi(a.g.R,b.stream.originalId||""),null;b.type==pc&&Ai(a.g.R);var c=a.g.Ic(),d=b.
|
|
315
|
-
f=Infinity;g=Array.from(a.j.values());g=t(g);for(h=g.next();!h.done;h=g.next())h=h.value,Pj(h)||h.ba&&!h.ba.current()||(f=Math.min(f,h.
|
|
316
|
-
function Qj(a,b,c,d){if(b.ba)return b.ba.current();if(b.
|
|
317
|
-
function Rj(a,b,c,d){var e,f,g,h,k,l,m,n,p,q,v,y,w,x,D;return L(function(z){switch(z.g){case 1:return e=qc,f=b.stream,g=b.ba,b.
|
|
318
|
-
J.size+J.start;F=!0}).parse(n,!1,!0);if(!F)return I.B(0);H=n.subarray(0,G);n=n.subarray(G);return u(I,Uj(a,b,c,f,d,H),0)})},u(z,Vj(a,b,d,v),9);l=Vj(a,b,d);return u(z,l,7);case 7:return m=z.h,df(a.i),a.s?z["return"]():b.ab?(b.
|
|
319
|
-
w[b.type];$a(JSON.stringify(x));b.ab||a.g.Ld();Dj(a,b,0);va(z,0);break;case 2:D=E(z);df(a.i,D);if(a.s)return z["return"]();b.
|
|
314
|
+
function Nj(a,b){if(Pj(b))return zi(a.g.R,b.stream.originalId||""),null;b.type==pc&&Ai(a.g.R);var c=a.g.Ic(),d=b.Ba?b.Ba.endTime:c,e=vi(a.g.R,b.type,c),f=Math.max(a.m.minBufferTime||0,a.h.rebufferingGoal,a.h.bufferingGoal)*a.u,g=a.m.presentationTimeline.getDuration()-d,h=ui(a.g.R,b.type);if(1E-6>g&&h)return b.endOfStream=!0,"video"==b.type&&(c=a.j.get(pc))&&Pj(c)&&(c.endOfStream=!0),null;b.endOfStream=!1;if(e>=f)return a.h.updateIntervalSeconds/2;e=Qj(a,b,c,h);if(!e)return a.h.updateIntervalSeconds;
|
|
315
|
+
f=Infinity;g=Array.from(a.j.values());g=t(g);for(h=g.next();!h.done;h=g.next())h=h.value,Pj(h)||h.ba&&!h.ba.current()||(f=Math.min(f,h.Ba?h.Ba.endTime:c));if(d>=f+a.m.presentationTimeline.g)return a.h.updateIntervalSeconds;Rj(a,b,c,e)["catch"](function(){});return null}
|
|
316
|
+
function Qj(a,b,c,d){if(b.ba)return b.ba.current();if(b.Ba||d)return b.ba=b.stream.segmentIndex.gb(b.Ba?b.Ba.endTime:d),b.ba&&b.ba.next().value;a=a.h.inaccurateManifestTolerance;d=Math.max(c-a,0);var e=null;a&&(b.ba=b.stream.segmentIndex.gb(d),e=b.ba&&b.ba.next().value);e||(b.ba=b.stream.segmentIndex.gb(c),e=b.ba&&b.ba.next().value);return e}
|
|
317
|
+
function Rj(a,b,c,d){var e,f,g,h,k,l,m,n,p,q,v,y,w,x,D;return L(function(z){switch(z.g){case 1:return e=qc,f=b.stream,g=b.ba,b.ta=!0,C(z,2),u(z,Sj(a,b,d),4);case 4:df(a.i);if(a.s)return z["return"]();h="video/mp4"==f.mimeType||"audio/mp4"==f.mimeType;k=window.ReadableStream;if(a.h.lowLatencyMode&&k&&h)return n=new Uint8Array(0),q=p=!1,v=function(B){var F,G,H;return L(function(I){if(p)return I["return"]();q=!0;df(a.i);if(a.s)return I["return"]();n=Tj(n,B);F=!1;G=0;(new Ig).box("mdat",function(J){G=
|
|
318
|
+
J.size+J.start;F=!0}).parse(n,!1,!0);if(!F)return I.B(0);H=n.subarray(0,G);n=n.subarray(G);return u(I,Uj(a,b,c,f,d,H),0)})},u(z,Vj(a,b,d,v),9);l=Vj(a,b,d);return u(z,l,7);case 7:return m=z.h,df(a.i),a.s?z["return"]():b.ab?(b.ta=!1,Dj(a,b,0),z["return"]()):u(z,Uj(a,b,c,f,d,m),6);case 9:y=z.h;if(q){z.B(6);break}p=!0;df(a.i);return a.s?z["return"]():b.ab?(b.ta=!1,Dj(a,b,0),z["return"]()):u(z,Uj(a,b,c,f,d,y),6);case 6:df(a.i);if(a.s)return z["return"]();b.Ba=d;g.next();b.ta=!1;b.Pd=!1;w=a.g.R.Ya();x=
|
|
319
|
+
w[b.type];$a(JSON.stringify(x));b.ab||a.g.Ld();Dj(a,b,0);va(z,0);break;case 2:D=E(z);df(a.i,D);if(a.s)return z["return"]();b.ta=!1;if(7001==D.code)b.ta=!1,yj(b),Dj(a,b,0),z.B(0);else if(b.type==e.Z&&a.h.ignoreTextStreamFailures)a.j["delete"](e.Z),z.B(0);else if(3017==D.code)Wj(a,b,D),z.B(0);else return b.fc=!0,D.severity=2,u(z,Oj(a,D),0)}})}function Tj(a,b){var c=new Uint8Array(a.length+b.length);c.set(a);c.set(b,a.length);return c}
|
|
320
320
|
function Wj(a,b,c){if(!Array.from(a.j.values()).some(function(e){return e!=b&&e.Pd})){var d=Math.round(100*a.u);if(20<d)a.u-=.2;else if(4<d)a.u-=.04;else{b.fc=!0;a.s=!0;a.g.onError(c);return}b.Pd=!0}Dj(a,b,4)}
|
|
321
321
|
function Sj(a,b,c){var d,e,f,g,h,k,l;return L(function(m){d=[];e=Math.max(0,c.appendWindowStart-.1);f=c.appendWindowEnd+.01;g=c.timestampOffset;if(g!=b.zd||e!=b.yd||f!=b.xd)h=function(){var n;return L(function(p){if(1==p.g)return C(p,2),b.yd=e,b.xd=f,b.zd=g,u(p,Ci(a.g.R,b.type,g,e,f),4);if(2!=p.g)return va(p,0);n=E(p);b.yd=null;b.xd=null;b.zd=null;throw n;})},d.push(h());!Hi(c.g,b.Mc)&&(b.Mc=c.g)&&(k=Vj(a,b,c.g),l=function(){var n,p,q;return L(function(v){switch(v.g){case 1:return C(v,2),u(v,k,4);
|
|
322
322
|
case 4:return n=v.h,df(a.i),p=b.stream.closedCaptions&&0<b.stream.closedCaptions.size,u(v,wi(a.g.R,b.type,n,null,null,p),5);case 5:va(v,0);break;case 2:throw q=E(v),b.Mc=null,q;}})},a.g.Jf(c.startTime,c.g),d.push(l()));return u(m,Promise.all(d),0)})}
|
|
323
323
|
function Uj(a,b,c,d,e,f){var g;return L(function(h){if(1==h.g)return g=d.closedCaptions&&0<d.closedCaptions.size,(null!=d.emsgSchemeIdUris&&0<d.emsgSchemeIdUris.length||a.h.dispatchAllEmsgBoxes)&&(new Ig).P("emsg",function(k){var l=d.emsgSchemeIdUris;if(0===k.version){var m=k.reader.jc();var n=k.reader.jc();var p=k.reader.M();var q=k.reader.M();var v=k.reader.M();var y=k.reader.M();var w=e.startTime+q/p}else p=k.reader.M(),w=k.reader.Kb()/p+e.timestampOffset,q=w-e.startTime,v=k.reader.M(),y=k.reader.M(),
|
|
324
324
|
m=k.reader.jc(),n=k.reader.jc();k=k.reader.Za(k.reader.O.byteLength-k.reader.X());if(l&&l.includes(m)||a.h.dispatchAllEmsgBoxes)"urn:mpeg:dash:event:2012"==m?a.g.Kf():(l=(new Map).set("detail",{startTime:w,endTime:w+v/p,schemeIdUri:m,value:n,timescale:p,presentationTimeDelta:q,eventDuration:v,id:y,messageData:k}),l=new Q(Xj,l),a.g.onEvent(l))}).parse(f),u(h,Yj(a,b,c),2);if(3!=h.g)return df(a.i),u(h,wi(a.g.R,b.type,f,e.startTime,e.endTime,g),3);df(a.i);A(h)})}
|
|
325
325
|
function Yj(a,b,c){var d,e,f,g;return L(function(h){if(1==h.g){d=Math.max(a.h.bufferBehind,a.m.presentationTimeline.g);e=si(a.g.R,b.type);if(null==e)return h["return"]();f=c-e;g=f-d;return.01>=g?h["return"]():u(h,a.g.R.remove(b.type,e,e+g),2)}df(a.i);A(h)})}function Pj(a){return a&&a.type==pc&&("application/cea-608"==a.stream.mimeType||"application/cea-708"==a.stream.mimeType)}
|
|
326
|
-
function Vj(a,b,c,d){var e,f,g,h,k;return L(function(l){if(1==l.g)return e=bf,f=vj(c.sa(),c.pa,c.ha,a.h.retryParameters,d),g=b.stream,a.g.modifySegmentRequest(f,{type:g.type,init:c instanceof Gi,duration:c.endTime-c.startTime,mimeType:g.mimeType,codecs:g.codecs,bandwidth:g.bandwidth}),h=a.g.nb.request(e,f),b.
|
|
327
|
-
function Jj(a,b,c,d){var e,f;return L(function(g){if(1==g.g)return b.ab=!1,b.Xc=!1,b.zc=0,b.Zb=!0,b.
|
|
328
|
-
function Dj(a,b,c){var d=b.type;if(d!=pc||a.j.has(d))b.
|
|
329
|
-
function ek(a,b){var c={Hb:function(){},Oc:function(){},pb:function(){},onError:function(){},Qc:function(){},Qg:function(){}};a.m.push({create:b,
|
|
330
|
-
function bk(a){return L(function(b){if(a.s.g)b=b.B(0);else{if(0==a.m.length||a.g&&!a.g.kb)var c=!1;else{a.g&&(a.g.
|
|
331
|
-
function fk(a){var b,c;return L(function(d){switch(d.g){case 1:return a.i=a.j.nf(a.i,a.l,a.g.node,a.g.payload),C(d,2),a.h=a.j.Ze(a.i,a.l,a.g.payload),u(d,a.h.promise,4);case 4:a.h=null;a.i==a.g.node&&(a.g.
|
|
326
|
+
function Vj(a,b,c,d){var e,f,g,h,k;return L(function(l){if(1==l.g)return e=bf,f=vj(c.sa(),c.pa,c.ha,a.h.retryParameters,d),g=b.stream,a.g.modifySegmentRequest(f,{type:g.type,init:c instanceof Gi,duration:c.endTime-c.startTime,mimeType:g.mimeType,codecs:g.codecs,bandwidth:g.bandwidth}),h=a.g.nb.request(e,f),b.va=h,u(l,h.promise,2);k=l.h;b.va=null;return l["return"](k.data)})}
|
|
327
|
+
function Jj(a,b,c,d){var e,f;return L(function(g){if(1==g.g)return b.ab=!1,b.Xc=!1,b.zc=0,b.Zb=!0,b.Ba=null,b.Mc=null,b.ba=null,d?(e=a.g.Ic(),f=a.g.R.getDuration(),u(g,a.g.R.remove(b.type,e+d,f),3)):u(g,Bi(a.g.R,b.type),4);if(3!=g.g)return df(a.i),c?u(g,a.g.R.flush(b.type),3):g.B(3);df(a.i);b.Zb=!1;b.endOfStream=!1;b.ta||b.Ka||Dj(a,b,0);A(g)})}
|
|
328
|
+
function Dj(a,b,c){var d=b.type;if(d!=pc||a.j.has(d))b.Ka=(new tc(function(){var e;return L(function(f){if(1==f.g)return C(f,2),u(f,Mj(a,b),4);if(2!=f.g)return va(f,0);e=E(f);if(a.g)a.g.onError(e);A(f)})})).S(c)}function yj(a){null!=a.Ka&&(a.Ka.stop(),a.Ka=null)}function zj(a){return L(function(b){return a.va?u(b,a.va.abort(),0):b.B(0)})}function Oj(a,b){return L(function(c){if(1==c.g)return u(c,Ee(a.D),2);df(a.i);a.g.onError(b);b.handled||a.h.failureCallback(b);A(c)})};function Zj(a,b){var c=ak(),d=this;this.j=b;this.i=a;this.l=c;this.o=null;this.m=[];this.h=this.g=null;this.u=Promise.resolve().then(function(){return bk(d)});this.s=new cf(function(){return ck(d)})}Zj.prototype.destroy=function(){return this.s.destroy()};function ck(a){var b,c,d;return L(function(e){if(1==e.g)return a.h&&a.h.abort(),dk(a),u(e,a.u,2);a.g&&a.g.Ha.pb();b=t(a.m);for(c=b.next();!c.done;c=b.next())d=c.value,d.Ha.pb();a.g=null;a.m=[];a.j=null;A(e)})}
|
|
329
|
+
function ek(a,b){var c={Hb:function(){},Oc:function(){},pb:function(){},onError:function(){},Qc:function(){},Qg:function(){}};a.m.push({create:b,Ha:c});a.h&&a.h.abort();dk(a);return c}
|
|
330
|
+
function bk(a){return L(function(b){if(a.s.g)b=b.B(0);else{if(0==a.m.length||a.g&&!a.g.kb)var c=!1;else{a.g&&(a.g.Ha.pb(),a.g=null);c=a.m.shift();var d=c.create(a.l);d?(c.Ha.Hb(),a.g={node:d.node,payload:d.payload,kb:d.kb,Ha:c.Ha}):c.Ha.Qc();c=!0}c?c=Promise.resolve():a.g?c=fk(a):(a.j.If(a.i),a.o=new rc,c=a.o);b=u(b,c,1)}return b})}
|
|
331
|
+
function fk(a){var b,c;return L(function(d){switch(d.g){case 1:return a.i=a.j.nf(a.i,a.l,a.g.node,a.g.payload),C(d,2),a.h=a.j.Ze(a.i,a.l,a.g.payload),u(d,a.h.promise,4);case 4:a.h=null;a.i==a.g.node&&(a.g.Ha.Oc(),a.g=null);va(d,0);break;case 2:b=E(d);if(7001==b.code)a.g.Ha.pb();else a.g.Ha.onError(b);a.g=null;a.h=null;c=a;return u(d,a.j.handleError(a.l,b),5);case 5:c.i=d.h,A(d)}})}function dk(a){a.o&&(a.o.resolve(),a.o=null)};function gk(a){this.g=null;for(var b=t(Array.from(a.textTracks)),c=b.next();!c.done;c=b.next())c=c.value,c.mode="disabled","Shaka Player TextTrack"==c.label&&(this.g=c);this.g||(this.g=a.addTextTrack("subtitles","Shaka Player TextTrack"));this.g.mode="hidden"}r=gk.prototype;r.remove=function(a,b){if(!this.g)return!1;hk(this.g,function(c){return c.startTime<b&&c.endTime>a});return!0};
|
|
332
332
|
r.append=function(a){function b(h,k){for(var l=t(h),m=l.next();!m.done;m=l.next())if(m=m.value,m.isContainer)b(m.nestedCues,k);else{var n=m.clone();n.nestedCues=[];n.payload=c(m);k.push(n)}return k}function c(h){var k=[],l=700<=h.fontWeight,m="italic"==h.fontStyle,n=h.textDecoration.includes("underline");l&&k.push("b");m&&k.push("i");n&&k.push("u");l=k.reduce(function(p,q){return p+"<"+q+">"},"");k=k.reduceRight(function(p,q){return p+"</"+q+">"},"");return h.lineBreak||h.spacer?(h.spacer&&Kb("shaka.extern.Cue",
|
|
333
333
|
"Please use lineBreak instead of spacer."),"\n"):h.nestedCues.length?h.nestedCues.map(c).join(""):l+h.payload+k}var d=b(a,[]),e=[];a=this.g.cues?Array.from(this.g.cues):[];var f={};d=t(d);for(var g=d.next();!g.done;f={vb:f.vb},g=d.next())f.vb=g.value,a.some(function(h){return function(k){return k.startTime==h.vb.startTime&&k.endTime==h.vb.endTime&&k.text==h.vb.payload?!0:!1}}(f))||(g=ik(f.vb))&&e.push(g);a=e.slice().sort(function(h,k){return h.startTime!=k.startTime?h.startTime-k.startTime:h.endTime!=
|
|
334
334
|
k.endTime?h.endTime-k.startTime:"line"in VTTCue.prototype?e.indexOf(k)-e.indexOf(h):e.indexOf(h)-e.indexOf(k)});a=t(a);for(f=a.next();!f.done;f=a.next())this.g.addCue(f.value)};r.destroy=function(){this.g&&(hk(this.g,function(){return!0}),this.g.mode="disabled");this.g=null;return Promise.resolve()};r.isTextVisible=function(){return"showing"==this.g.mode};r.setTextVisibility=function(a){this.g.mode=a?"showing":"hidden"};
|
|
335
335
|
function ik(a){if(a.startTime>=a.endTime)return null;var b=new VTTCue(a.startTime,a.endTime,a.payload);b.lineAlign=a.lineAlign;b.positionAlign=a.positionAlign;a.size&&(b.size=a.size);try{b.align=a.textAlign}catch(c){}"center"==a.textAlign&&"center"!=b.align&&(b.align="middle");"vertical-lr"==a.writingMode?b.vertical="lr":"vertical-rl"==a.writingMode&&(b.vertical="rl");1==a.lineInterpretation&&(b.snapToLines=!1);null!=a.line&&(b.line=a.line);null!=a.position&&(b.position=a.position);return b}
|
|
336
|
-
function hk(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}M("shaka.text.SimpleTextDisplayer",gk);gk.prototype.setTextVisibility=gk.prototype.setTextVisibility;gk.prototype.isTextVisible=gk.prototype.isTextVisible;gk.prototype.destroy=gk.prototype.destroy;gk.prototype.append=gk.prototype.append;gk.prototype.remove=gk.prototype.remove;function jk(){}function kk(a){for(;a.firstChild;)a.removeChild(a.firstChild)}M("shaka.util.Dom",jk);jk.removeAllChildren=kk;function lk(a,b){var c=this;this.j=!1;this.i=[];this.C=a;this.m=b;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.m.appendChild(this.g);this.u=(new O(function(){mk(c)})).
|
|
336
|
+
function hk(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}M("shaka.text.SimpleTextDisplayer",gk);gk.prototype.setTextVisibility=gk.prototype.setTextVisibility;gk.prototype.isTextVisible=gk.prototype.isTextVisible;gk.prototype.destroy=gk.prototype.destroy;gk.prototype.append=gk.prototype.append;gk.prototype.remove=gk.prototype.remove;function jk(){}function kk(a){for(;a.firstChild;)a.removeChild(a.firstChild)}M("shaka.util.Dom",jk);jk.removeAllChildren=kk;function lk(a,b){var c=this;this.j=!1;this.i=[];this.C=a;this.m=b;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.m.appendChild(this.g);this.u=(new O(function(){mk(c)})).Da(.25);this.h=new Map;this.s=new ef;this.s.A(document,"fullscreenchange",function(){mk(c,!0)});this.l=null;"ResizeObserver"in
|
|
337
337
|
window&&(this.l=new ResizeObserver(function(){mk(c,!0)}),this.l.observe(this.g));this.o=new Map}r=lk.prototype;r.append=function(a){var b=[].concat(ja(this.i)),c={};a=t(a);for(var d=a.next();!d.done;c={qc:c.qc},d=a.next())c.qc=d.value,b.some(function(e){return function(f){return tb(f,e.qc)}}(c))||this.i.push(c.qc);mk(this)};
|
|
338
338
|
r.destroy=function(){this.m.removeChild(this.g);this.g=null;this.j=!1;this.i=[];this.u&&this.u.stop();this.h.clear();this.s&&(this.s.release(),this.s=null);this.l&&(this.l.disconnect(),this.l=null)};r.remove=function(a,b){if(!this.g)return!1;var c=this.i.length;this.i=this.i.filter(function(d){return d.startTime<a||d.endTime>=b});mk(this,c>this.i.length);return!0};r.isTextVisible=function(){return this.j};r.setTextVisibility=function(a){this.j=a};
|
|
339
339
|
function nk(a,b){for(;null!=b;){if(b==a.g)return!0;b=b.parentElement}return!1}
|
|
@@ -369,33 +369,33 @@ maxHeight:Infinity,minPixels:0,maxPixels:Infinity,minFrameRate:0,maxFrameRate:In
|
|
|
369
369
|
function Wk(a,b,c){var d={".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:"",audioRobustness:"",sessionType:"",serverCertificate:new Uint8Array(0),serverCertificateUri:"",individualizationServer:""}};return Qk(a,b,c||Uk(),d,"")}
|
|
370
370
|
function Vk(a,b){var c=a.filter(function(h){return"variant"==h.type}),d=[],e=yd(b,c.map(function(h){return h.language}));e&&(d=c.filter(function(h){return rd(h.language)==e}));0==d.length&&(d=c.filter(function(h){return h.primary}));0==d.length&&(c.map(function(h){return h.language}),d=c);var f=d.filter(function(h){return h.height&&480>=h.height});f.length&&(f.sort(function(h,k){return k.height-h.height}),d=f.filter(function(h){return h.height==f[0].height}));c=[];if(d.length){var g=Math.floor(d.length/
|
|
371
371
|
2);d.sort(function(h,k){return h.bandwidth-k.bandwidth});c.push(d[g])}d=t(a);for(g=d.next();!g.done;g=d.next())g=g.value,g.type!=pc&&"image"!=g.type||c.push(g);return c}M("shaka.util.PlayerConfiguration",Tk);Tk.mergeConfigObjects=Wk;function Xk(){this.g=null;this.h=[]}function Yk(a,b){if(null==a.g)a.g={timestamp:Date.now()/1E3,state:b,duration:0};else{var c=Date.now()/1E3;a.g.duration=c-a.g.timestamp;a.g.state!=b&&(a.h.push(a.g),a.g={timestamp:c,state:b,duration:0})}}function Zk(a,b){var c=0;a.g&&a.g.state==b&&(c+=a.g.duration);for(var d=t(a.h),e=d.next();!e.done;e=d.next())e=e.value,c+=e.state==b?e.duration:0;return c}
|
|
372
|
-
function $k(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 al(){this.i=this.h=null;this.g=[]}function bl(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 cl(){this.u=this.C=this.G=this.D=this.s=this.j=this.F=this.m=this.i=this.I=this.L=this.N=this.l=this.o=NaN;this.g=new Xk;this.h=new al};function U(a,b){Ne.call(this);var c=this;this.l=dl;this.Bc=this.g=null;this.ka=!1;this.Ec=new ef;this.Ub=new ef;this.o=new ef;this.ud=this.u=this.Tb=this.i=this.Kc=this.I=this.j=this.
|
|
372
|
+
function $k(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 al(){this.i=this.h=null;this.g=[]}function bl(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 cl(){this.u=this.C=this.G=this.D=this.s=this.j=this.F=this.m=this.i=this.I=this.L=this.N=this.l=this.o=NaN;this.g=new Xk;this.h=new al};function U(a,b){Ne.call(this);var c=this;this.l=dl;this.Bc=this.g=null;this.ka=!1;this.Ec=new ef;this.Ub=new ef;this.o=new ef;this.ud=this.u=this.Tb=this.i=this.Kc=this.I=this.j=this.xa=this.W=this.Lc=this.L=this.Cc=this.G=this.xb=this.C=this.N=this.m=this.F=null;this.Jd=1E9;this.h=el(this);this.Gd={width:Infinity,height:Infinity};this.s=null;this.La=new ue(this.h.preferredAudioLanguage,this.h.preferredVariantRole,this.h.preferredAudioChannelCount);this.Ma=this.h.preferredTextLanguage;this.Xb=this.h.preferredTextRole;
|
|
373
373
|
this.Vb=this.h.preferForcedSubs;this.Nb=[];this.Yb=null;b&&b(this);this.F=fl(this);this.F.Vd(this.h.streaming.forceHTTPS);this.D=null;gl&&(this.D=Sb(gl));this.Ec.A(window,"online",function(){c.Qd()});this.V={name:"detach"};this.ca={name:"attach"};this.fa={name:"unload"};this.Md={name:"manifest-parser"};this.Cd={name:"manifest"};this.wb={name:"media-source"};this.vd={name:"drm-engine"};this.da={name:"load"};this.Nd={name:"src-equals-drm-engine"};this.yb={name:"src-equals"};var d=new Map;d.set(this.ca,
|
|
374
|
-
function(e,f){return Je(hl(c,e,f))});d.set(this.V,function(e){e.J&&(c.Ub.
|
|
375
|
-
d.set(this.yb,function(e,f){return pl(c,e,f)});this.
|
|
374
|
+
function(e,f){return Je(hl(c,e,f))});d.set(this.V,function(e){e.J&&(c.Ub.Sa(),e.J=null);c.D&&c.D.release();c.g=null;e=Promise.resolve();return Je(e)});d.set(this.fa,function(e){return Je(il(c,e))});d.set(this.wb,function(e){e=jl(c,e);return Je(e)});d.set(this.Md,function(e,f){var g=kl(c,e,f);return Je(g)});d.set(this.Cd,function(e){return ll(c,e)});d.set(this.vd,function(e){e=ml(c,e);return Je(e)});d.set(this.da,function(e,f){return Je(nl(c,e,f))});d.set(this.Nd,function(e,f){var g=ol(c,e,f);return Je(g)});
|
|
375
|
+
d.set(this.yb,function(e,f){return pl(c,e,f)});this.ya=new Zj(this.V,{nf:function(e,f,g,h){var k=null;e==c.V&&(k=g==c.V?c.V:c.ca);e==c.ca&&(k=g==c.V||f.J!=h.J?c.V:g==c.ca?c.ca:g==c.wb||g==c.da?c.wb:g==c.yb?c.Nd:null);e==c.wb&&(k=g==c.da&&f.J==h.J?c.Md:c.fa);e==c.Md&&(k=ql(c.da,c.Cd,c.fa,g,f,h));e==c.Cd&&(k=ql(c.da,c.vd,c.fa,g,f,h));e==c.vd&&(k=ql(c.da,c.da,c.fa,g,f,h));e==c.Nd&&(k=g==c.yb&&f.J==h.J?c.yb:c.fa);if(e==c.da||e==c.yb)k=c.fa;e==c.fa&&(k=h.J&&f.J==h.J?c.ca:c.V);return k},Ze:function(e,f,
|
|
376
376
|
g){c.dispatchEvent(rl(sl,(new Map).set("state",e.name)));return d.get(e)(f,g)},handleError:function(e){return L(function(f){return 1==f.g?u(f,il(c,e),2):f["return"](e.J?c.ca:c.V)})},If:function(e){c.dispatchEvent(rl(tl,(new Map).set("state",e.name)))}});a&&this.Wb(a,!0)}qa(U,Ne);function rl(a,b){return new Q(a,b)}r=U.prototype;
|
|
377
|
-
r.destroy=function(){var a=this,b;return L(function(c){switch(c.g){case 1:if(a.l==ul)return c["return"]();a.l=ul;b=ek(a.
|
|
378
|
-
a.W=null;if(!a.F){c.B(4);break}return u(c,a.F.destroy(),5);case 5:a.F=null;case 4:Ne.prototype.release.call(a),A(c)}})};r.Wb=function(a,b){b=void 0===b?!0:b;if(this.l==ul)return Promise.reject(vl());var c=ak();c.J=a;uc()||(b=!1);var d=b?this.wb:this.ca,e=ek(this.
|
|
379
|
-
r.be=function(a){var b=this;a=void 0===a?!0:a;if(this.l==ul)return Promise.reject(vl());uc()||(a=!1);var c=ak(),d=ek(this.
|
|
380
|
-
r.load=function(a,b,c){var d=this;this.Yb=null;if(this.l==ul)return Promise.reject(vl());this.dispatchEvent(rl(xl));var e=ak();e.uri=a;e.Zd=Date.now()/1E3;c&&(e.mimeType=c);void 0!==b&&(e.startTime=b);var f=yl(this,e)?this.yb:this.da,g=ek(this.
|
|
377
|
+
r.destroy=function(){var a=this,b;return L(function(c){switch(c.g){case 1:if(a.l==ul)return c["return"]();a.l=ul;b=ek(a.ya,function(){return{node:a.V,payload:ak(),kb:!1}});return u(c,new Promise(function(d){b.Hb=function(){};b.Oc=function(){d()};b.pb=function(){d()};b.onError=function(){d()};b.Qc=function(){d()}}),2);case 2:return u(c,a.ya.destroy(),3);case 3:a.Ec&&(a.Ec.release(),a.Ec=null);a.Ub&&(a.Ub.release(),a.Ub=null);a.o&&(a.o.release(),a.o=null);a.ud=null;a.u=null;a.h=null;a.s=null;a.Bc=null;
|
|
378
|
+
a.W=null;if(!a.F){c.B(4);break}return u(c,a.F.destroy(),5);case 5:a.F=null;case 4:Ne.prototype.release.call(a),A(c)}})};r.Wb=function(a,b){b=void 0===b?!0:b;if(this.l==ul)return Promise.reject(vl());var c=ak();c.J=a;uc()||(b=!1);var d=b?this.wb:this.ca,e=ek(this.ya,function(){return{node:d,payload:c,kb:!1}});e.Hb=function(){};return wl(e)};r.detach=function(){var a=this;if(this.l==ul)return Promise.reject(vl());var b=ek(this.ya,function(){return{node:a.V,payload:ak(),kb:!1}});b.Hb=function(){};return wl(b)};
|
|
379
|
+
r.be=function(a){var b=this;a=void 0===a?!0:a;if(this.l==ul)return Promise.reject(vl());uc()||(a=!1);var c=ak(),d=ek(this.ya,function(e){var f=e.J&&a?b.wb:e.J?b.ca:b.V;c.J=e.J;return{node:f,payload:c,kb:!1}});d.Hb=function(){};return wl(d)};r.hg=function(a){this.Yb=a};
|
|
380
|
+
r.load=function(a,b,c){var d=this;this.Yb=null;if(this.l==ul)return Promise.reject(vl());this.dispatchEvent(rl(xl));var e=ak();e.uri=a;e.Zd=Date.now()/1E3;c&&(e.mimeType=c);void 0!==b&&(e.startTime=b);var f=yl(this,e)?this.yb:this.da,g=ek(this.ya,function(h){if(null==h.J)return null;e.J=h.J;return{node:f,payload:e,kb:!0}});this.s=new cl;this.W=zl(this);g.Hb=function(){};return new Promise(function(h,k){g.Qc=function(){return k(new N(2,7,7002))};g.Oc=function(){h();d.dispatchEvent(rl(Al))};g.pb=function(){return k(vl())};
|
|
381
381
|
g.onError=function(l){return k(l)}})};function yl(a,b){if(!uc())return!0;var c=b.mimeType,d=b.uri||"";c||(c=Cg(d),c=Bl[c]);if(c){if(""==(b.J||wc()).canPlayType(c))return!1;if(!uc()||!(c in Bg||Cg(d)in Dg)||a.h.streaming.preferNativeHls)return!0;if(Cc())return a.h.streaming.useNativeHlsOnSafari}return!1}function hl(a,b,c){null==b.J&&(b.J=c.J,a.Ub.A(b.J,"error",function(){var d=Cl(a);d&&Dl(a,d)}));a.g=b.J;return Promise.resolve()}
|
|
382
|
-
function il(a,b){var c,d,e,f,g,h,k,l,m;return L(function(n){switch(n.g){case 1:return a.l!=ul&&(a.l=dl),c=a.Nb.map(function(p){return p()}),a.Nb=[],u(n,Promise.all(c),2);case 2:a.dispatchEvent(rl(El));b.mimeType=null;b.startTime=null;b.uri=null;b.J&&a.o.
|
|
382
|
+
function il(a,b){var c,d,e,f,g,h,k,l,m;return L(function(n){switch(n.g){case 1:return a.l!=ul&&(a.l=dl),c=a.Nb.map(function(p){return p()}),a.Nb=[],u(n,Promise.all(c),2);case 2:a.dispatchEvent(rl(El));b.mimeType=null;b.startTime=null;b.uri=null;b.J&&a.o.Sa();a.xb&&(a.xb.release(),a.xb=null);a.Cc&&(a.Cc.stop(),a.Cc=null);if(!a.I){n.B(3);break}return u(n,a.I.stop(),4);case 4:a.I=null,a.Kc=null;case 3:if(!a.u){n.B(5);break}return u(n,a.u.stop(),5);case 5:if(!a.j){n.B(7);break}return u(n,a.j.destroy(),
|
|
383
383
|
8);case 8:a.j=null;case 7:a.G&&(a.G.release(),a.G=null);a.C&&(a.C.release(),a.C=null);if(!a.N){n.B(9);break}return u(n,a.N.destroy(),10);case 10:a.N=null;case 9:if(a.D)a.D.onAssetUnload();if(!b.J||!b.J.src){n.B(11);break}return u(n,new Promise(function(p){return(new O(p)).S(.1)}),12);case 12:for(b.J.removeAttribute("src"),b.J.load();b.J.lastChild;)b.J.removeChild(b.J.firstChild);case 11:if(!a.m){n.B(13);break}return u(n,a.m.destroy(),14);case 14:a.m=null;case 13:a.Tb=null;a.L=null;if(a.i){d=t(a.i.variants);
|
|
384
384
|
for(e=d.next();!e.done;e=d.next())for(f=e.value,g=t([f.audio,f.video]),h=g.next();!h.done;h=g.next())(k=h.value)&&k.segmentIndex&&k.segmentIndex.release();l=t(a.i.textStreams);for(h=l.next();!h.done;h=l.next())m=h.value,m.segmentIndex&&m.segmentIndex.release()}a.i=null;a.s=new cl;a.wd=null;Fl(a);A(n)}})}
|
|
385
385
|
function jl(a,b){var c,d,e,f;return L(function(g){if(1==g.g)return c=new bi,d=a.h.textDisplayFactory,e=Sb(d),a.wd=d,f=Gl(b.J,c,e,function(h,k,l){h=t(h);for(var m=h.next();!m.done;m=h.next())if(m=m.value,m.data&&m.cueTime&&m.frames){for(var n=m.cueTime+k,p=l,q=t(m.frames),v=q.next();!v.done;v=q.next())Hl(a,n,p,"ID3",v.value);if(a.D)a.D.onHlsTimedMetadata(m,n)}}),u(g,f.D,2);a.N=f;A(g)})}
|
|
386
386
|
function kl(a,b,c){var d,e,f,g;return L(function(h){if(1==h.g)return b.mimeType=c.mimeType,b.uri=c.uri,d=b.uri,e=a.F,a.Tb=d,f=a,u(h,Ag(d,e,a.h.manifest.retryParameters,b.mimeType),2);f.Kc=h.h;a.I=Sb(a.Kc);g=Oe(a.h.manifest);c.J&&"AUDIO"===c.J.nodeName&&(g.disableVideo=!0);a.I.configure(g);A(h)})}
|
|
387
|
-
function ll(a,b){var c=b.uri,d=a.F;a.Lc=new pj(function(){return a.lc()});a.Lc.addEventListener("regionadd",function(g){g=g.region;Il(a,Jl,g);if(a.D)a.D.onDashTimedMetadata(g)});a.
|
|
387
|
+
function ll(a,b){var c=b.uri,d=a.F;a.Lc=new pj(function(){return a.lc()});a.Lc.addEventListener("regionadd",function(g){g=g.region;Il(a,Jl,g);if(a.D)a.D.onDashTimedMetadata(g)});a.xa=null;a.h.streaming.observeQualityChanges&&(a.xa=new lj(function(){return a.Ya()}),a.xa.addEventListener("qualitychange",function(g){var h=g.quality;g=g.position;h=(new Map).set("mediaQuality",{bandwidth:h.bandwidth,audioSamplingRate:h.audioSamplingRate,codecs:h.codecs,contentType:h.contentType,frameRate:h.frameRate,height:h.height,
|
|
388
388
|
mimeType:h.mimeType,channelsCount:h.channelsCount,pixelAspectRatio:h.pixelAspectRatio,width:h.width}).set("position",g);a.dispatchEvent(rl(Kl,h))}));var e={networkingEngine:d,modifyManifestRequest:function(g,h){var k=a.W;try{k.g.enabled&&(k.o=h.format,Fk(k,g,{ot:Ik,su:!k.i}))}catch(l){Va("CMCD_MANIFEST_ERROR","Could not generate manifest CMCD data.",l)}},modifySegmentRequest:function(g,h){vk(a.W,g,h)},filter:function(g){return Ll(a,g)},makeTextStreamsForClosedCaptions:function(g){return Ml(a,g)},
|
|
389
389
|
onTimelineRegionAdded:function(g){var h=a.Lc;a:{var k=t(h.g);for(var l=k.next();!l.done;l=k.next())if(l=l.value,l.schemeIdUri==g.schemeIdUri&&l.id==g.id&&l.startTime==g.startTime&&l.endTime==g.endTime){k=l;break a}k=null}null==k&&(h.g.add(g),g=new Q("regionadd",new Map([["region",g]])),h.dispatchEvent(g))},onEvent:function(g){return a.dispatchEvent(g)},onError:function(g){return Dl(a,g)},isLowLatencyMode:function(){return a.h.streaming.lowLatencyMode},isAutoLowLatencyMode:function(){return a.h.streaming.autoLowLatencyMode},
|
|
390
390
|
enableLowLatencyMode:function(){a.configure("streaming.lowLatencyMode",!0)}},f=Date.now()/1E3;return new Fe(function(){var g,h,k,l;return L(function(m){if(1==m.g)return g=a,u(m,a.I.start(c,e),2);g.i=m.h;h=rl(Nl);a.dispatchEvent(h);if(0==a.i.variants.length)throw new N(2,4,4036);Ol(a.i);k=Date.now()/1E3;l=k-f;a.s.F=l;A(m)})}(),function(){return a.I.stop()})}
|
|
391
391
|
function ml(a,b){var c,d;return L(function(e){return 1==e.g?(c=Date.now()/1E3,d=!0,a.m=Pl(a,{nb:a.F,onError:function(f){Dl(a,f)},Pc:function(f){Ql(a,f)},onExpirationUpdated:function(f,g){Rl(a,f,g)},onEvent:function(f){a.dispatchEvent(f);f.type==Sl&&d&&(d=!1,a.s.j=Date.now()/1E3-c)}}),a.m.configure(a.h.drm),u(e,Wf(a.m,a.i.variants,a.i.offlineSessionIds),2)):3!=e.g?u(e,a.m.Wb(b.J),3):u(e,Ll(a,a.i),0)})}
|
|
392
392
|
function nl(a,b,c){var d,e,f,g,h,k,l,m,n,p,q,v;return L(function(y){switch(y.g){case 1:b.startTime=c.startTime;null!=a.Yb&&(b.startTime=a.Yb,a.Yb=null);d=b.J;e=b.uri;a.Tb=e;a.G=new hj({Jc:function(){return d.playbackRate},Fc:function(){return d.defaultPlaybackRate},Xd:function(w){d.playbackRate=w},te:function(w){d.currentTime+=w}});f=function(){return Tl(a)};g=function(){return Ul(a)};a.o.A(d,"playing",f);a.o.A(d,"pause",f);a.o.A(d,"ended",f);a.o.A(d,"ratechange",g);h=a.h.abrFactory;a.u&&a.ud==h||
|
|
393
|
-
(a.ud=h,a.u=Sb(h),"function"!=typeof a.u.playbackRateChanged&&(Kb("AbrManager","Please use an AbrManager with playbackRateChanged function."),a.u.playbackRateChanged=function(){}),a.u.configure(a.h.abr));a.
|
|
393
|
+
(a.ud=h,a.u=Sb(h),"function"!=typeof a.u.playbackRateChanged&&(Kb("AbrManager","Please use an AbrManager with playbackRateChanged function."),a.u.playbackRateChanged=function(){}),a.u.configure(a.h.abr));a.La=new ue(a.h.preferredAudioLanguage,a.h.preferredVariantRole,a.h.preferredAudioChannelCount);a.Ma=a.h.preferredTextLanguage;a.Xb=a.h.preferredTextRole;a.Vb=a.h.preferForcedSubs;Vl(a.i.presentationTimeline,a.h.playRangeStart,a.h.playRangeEnd);a.u.init(function(w,x,D){a.j&&w!=a.j.l&&Wl(a,w,!0,void 0===
|
|
394
394
|
x?!1:x,void 0===D?0:D)});a.C=Xl(a,b.startTime);a.xb=Yl(a);k=Math.max(a.i.minBufferTime,a.h.streaming.rebufferingGoal);Zl(a,k);Bd(a.i,a.h.preferredVideoCodecs,a.h.preferredAudioCodecs,a.h.preferredAudioChannelCount,a.h.preferredDecodingAttributes);a.j=$l(a);a.j.configure(a.h.streaming);a.l=am;d.textTracks&&a.o.A(d.textTracks,"addtrack",function(w){if(w.track)switch(w=w.track,w.kind){case "chapters":bm(a,w)}});a.dispatchEvent(rl(cm));l=null;if(m=a.jb().find(function(w){return w.active})){y.B(2);break}l=
|
|
395
|
-
dm(a)?a.u.chooseVariant():null;Wl(a,l,!0,!1,0);if(!a.h.streaming.startAtSegmentBoundary){y.B(3);break}n=a.C.wc();return u(y,em(l,n),4);case 4:p=y.h,a.C.od(p);case 3:fm(a,null,$d(l));case 2:return a.C.nd(),q=a.ib().find(function(w){return w.active}),q||((v=je(a.i.textStreams,a.
|
|
395
|
+
dm(a)?a.u.chooseVariant():null;Wl(a,l,!0,!1,0);if(!a.h.streaming.startAtSegmentBoundary){y.B(3);break}n=a.C.wc();return u(y,em(l,n),4);case 4:p=y.h,a.C.od(p);case 3:fm(a,null,$d(l));case 2:return a.C.nd(),q=a.ib().find(function(w){return w.active}),q||((v=je(a.i.textStreams,a.Ma,a.Xb,a.Vb)[0]||null)&&bl(a.s.h,v,!0),l&&(v?(l.audio&&gm(a,l.audio,v)&&(a.ka=!0),a.ka&&a.N.l.setTextVisibility(!0),hm(a)):a.ka=!1),v&&(a.h.streaming.alwaysStreamText||a.td())&&Ij(a.j,v)),u(y,a.j.start(),5);case 5:a.h.abr.enabled&&
|
|
396
396
|
(a.u.enable(),im(a)),Rd(a.j?a.j.l:null,a.i),jm(a.i),km(a),dm(a),a.i.variants.some(function(w){return w.primary}),a.o.oa(d,"loadedmetadata",function(){a.s.m=Date.now()/1E3-c.Zd}),A(y)}})}
|
|
397
397
|
function ol(a,b,c){var d,e,f,g,h,k,l;return L(function(m){return 1==m.g?(d=qc,e=Date.now()/1E3,f=!0,a.m=Pl(a,{nb:a.F,onError:function(n){Dl(a,n)},Pc:function(n){Ql(a,n)},onExpirationUpdated:function(n,p){Rl(a,n,p)},onEvent:function(n){a.dispatchEvent(n);n.type==Sl&&f&&(f=!1,a.s.j=Date.now()/1E3-e)}}),a.m.configure(a.h.drm),g=c.uri||"",h=Cg(g),k=Bl[h],"application/x-mpegurl"==k&&Cc()&&(k="application/vnd.apple.mpegurl"),k||(k="video/mp4"),l={id:0,language:"und",primary:!1,audio:null,video:{id:0,originalId:null,
|
|
398
|
-
createSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:c.mimeType?c.mimeType.split(";")[0]:k,codecs:c.mimeType?ed(c.mimeType):"",encrypted:!0,drmInfos:[],keyIds:new Set,language:"und",label:null,type:d.
|
|
398
|
+
createSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:c.mimeType?c.mimeType.split(";")[0]:k,codecs:c.mimeType?ed(c.mimeType):"",encrypted:!0,drmInfos:[],keyIds:new Set,language:"und",label:null,type:d.Na,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null},bandwidth:100,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]},a.m.W=!0,u(m,Wf(a.m,[l],[]),2)):u(m,a.m.Wb(b.J),
|
|
399
399
|
0)})}
|
|
400
400
|
function pl(a,b,c){function d(){return Tl(a)}b.uri=c.uri;b.startTime=c.startTime;a.Tb=b.uri;var e=b.J;a.C=new Yi(e);var f=!1;a.Nb.push(function(){f=!0});null!=b.startTime&&a.C.od(b.startTime);a.G=new hj({Jc:function(){return e.playbackRate},Fc:function(){return e.defaultPlaybackRate},Xd:function(k){e.playbackRate=k},te:function(k){e.currentTime+=k}});Zl(a,a.h.streaming.rebufferingGoal);a.o.A(e,"playing",d);a.o.A(e,"pause",d);a.o.A(e,"ended",d);a.o.A(e,"ratechange",function(){return Ul(a)});"none"!=e.preload&&
|
|
401
401
|
a.o.oa(e,"loadedmetadata",function(){a.s.m=Date.now()/1E3-c.Zd});e.audioTracks&&(a.o.A(e.audioTracks,"addtrack",function(){return km(a)}),a.o.A(e.audioTracks,"removetrack",function(){return km(a)}),a.o.A(e.audioTracks,"change",function(){return km(a)}));e.textTracks&&(a.o.A(e.textTracks,"addtrack",function(k){if(k.track)switch(k=k.track,k.kind){case "metadata":lm(a,k);break;case "chapters":bm(a,k);break;default:km(a)}}),a.o.A(e.textTracks,"removetrack",function(){return km(a)}),a.o.A(e.textTracks,
|
|
@@ -405,34 +405,34 @@ function nm(a){var b=a.h.preferredAudioLanguage;if(""!=b){a.Sd(b);var c=a.h.pref
|
|
|
405
405
|
function lm(a,b){if("metadata"==b.kind){b.mode="hidden";a.o.A(b,"cuechange",function(){if(b.activeCues)for(var d=t(b.activeCues),e=d.next();!e.done;e=d.next())if(e=e.value,Hl(a,e.startTime,e.endTime,e.type,e.value),a.D)a.D.onCueMetadataChange(e.value)});var c=(new O(function(){var d=qm(a);d=t(d);for(var e=d.next();!e.done;e=d.next())e.value.mode="hidden"})).Mb().S(.5);a.Nb.push(function(){c.stop()})}}
|
|
406
406
|
function Hl(a,b,c,d,e){b=(new Map).set("startTime",b).set("endTime",c).set("metadataType",d).set("payload",e);a.dispatchEvent(rl(rm,b))}function bm(a,b){if(b&&"chapters"==b.kind){b.mode="hidden";var c=(new O(function(){b.mode="hidden"})).Mb().S(.5);a.Nb.push(function(){c.stop()})}}function Ol(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))}function Pl(a,b){return new Pf(b,a.h.drm.updateExpirationTime)}
|
|
407
407
|
function fl(a){return new Se(function(b,c){a.u&&a.u.segmentDownloaded(b,c)},function(b,c,d){b=(new Map).set("headers",b).set("request",c).set("requestType",d);a.dispatchEvent(rl(sm,b))},function(b,c,d,e){b=(new Map).set("request",b).set("error",c).set("httpResponseCode",d).set("aborted",e);a.dispatchEvent(rl(tm,b))})}
|
|
408
|
-
function Xl(a,b){return new Zi(a.g,a.i,a.h.streaming,b,function(){a.xb&&kj(a.xb,!0);if(a.j)
|
|
409
|
-
um(a)},function(c){return a.dispatchEvent(c)})}function Yl(a){var b=new qj(a.Lc);b.addEventListener("enter",function(d){Il(a,vm,d.region)});b.addEventListener("exit",function(d){Il(a,wm,d.region)});b.addEventListener("skip",function(d){var e=d.region;d.seeking||(Il(a,vm,e),Il(a,wm,e))});var c=new jj(a.g);c.g.add(b);a.
|
|
408
|
+
function Xl(a,b){return new Zi(a.g,a.i,a.h.streaming,b,function(){a.xb&&kj(a.xb,!0);if(a.j){var c=a.j;if(c.g)for(var d=c.g.Ic(),e=c.h.smallGapLimit,f=t(c.j.keys()),g=f.next();!g.done;g=f.next()){g=g.value;var h=c.j.get(g);h.ba=null;var k=c.g.R;g==pc?(k=k.g,k=null==k.g||null==k.h?!1:d>=k.g&&d<k.h):(k=ti(k,g),k=ei(k,d,e));if(!k&&((null!=ui(c.g.R,g)||h.ta)&&Lj(c,h),h.va&&(h.va.abort(),h.va=null),g===pc))for(g=c.g.R.u.g,g.l=0,g.h=[],g.g=[],h=g.i,h.i=[],h.h=[],h.g=0,Sh(g),g=t(g.j.values()),h=g.next();!h.done;h=
|
|
409
|
+
g.next())Nh(h.value)}}a.L&&um(a)},function(c){return a.dispatchEvent(c)})}function Yl(a){var b=new qj(a.Lc);b.addEventListener("enter",function(d){Il(a,vm,d.region)});b.addEventListener("exit",function(d){Il(a,wm,d.region)});b.addEventListener("skip",function(d){var e=d.region;d.seeking||(Il(a,vm,e),Il(a,wm,e))});var c=new jj(a.g);c.g.add(b);a.xa&&c.g.add(a.xa);return c}function Zl(a,b){a.L=new ye;a.L.g=Ae;Be(a.L,b,Math.min(.5,b/2));Fl(a);a.Cc=(new O(function(){um(a)})).Da(.25)}
|
|
410
410
|
function um(a){switch(a.l){case mm:if(a.g.ended)var b=!0;else{var c=di(a.g.buffered);b=null!=c&&c>=a.g.duration-1}break;case am:a:if(a.g.ended||ri(a.N))b=!0;else{if(a.i.presentationTimeline.T()){c=a.i.presentationTimeline.hb();var d=di(a.g.buffered);if(null!=d&&d>=c){b=!0;break a}}b=!1}break;default:b=!1}d=fi(a.g.buffered,a.g.currentTime);c=a.L;var e=b,f=c.h.get(c.g);b=c.g;d=e||d>=f?ze:Ae;c.g=d;b!=d&&Fl(a)}function Gl(a,b,c,d){return new ii(a,b,c,d)}
|
|
411
411
|
function zl(a){return new uk({getBandwidthEstimate:function(){return a.u?a.u.getBandwidthEstimate():NaN},Ya:function(){return a.Ya()},getCurrentTime:function(){return a.g?a.g.currentTime:0},jb:function(){return a.jb()},Hc:function(){return a.Hc()},T:function(){return a.T()}},a.h.cmcd)}
|
|
412
|
-
function $l(a){return new wj(a.i,{Ic:function(){return a.C.wc()},getBandwidthEstimate:function(){return a.u.getBandwidthEstimate()},modifySegmentRequest:function(b,c){vk(a.W,b,c)},R:a.N,nb:a.F,onError:function(b){return Dl(a,b)},onEvent:function(b){return a.dispatchEvent(b)},Kf:function(){a.I&&a.I.update&&a.I.update()},Ld:function(){a.C&&a.C.ue();um(a)},Jf:function(b,c){var d=c.Dd;d&&a.
|
|
412
|
+
function $l(a){return new wj(a.i,{Ic:function(){return a.C.wc()},getBandwidthEstimate:function(){return a.u.getBandwidthEstimate()},modifySegmentRequest:function(b,c){vk(a.W,b,c)},R:a.N,nb:a.F,onError:function(b){return Dl(a,b)},onEvent:function(b){return a.dispatchEvent(b)},Kf:function(){a.I&&a.I.update&&a.I.update()},Ld:function(){a.C&&a.C.ue();um(a)},Jf:function(b,c){var d=c.Dd;d&&a.xa&&nj(a.xa,d,b)}})}
|
|
413
413
|
r.configure=function(a,b){2==arguments.length&&"string"==typeof a&&(a=Rk(a,b));a.manifest&&a.manifest.dash&&"defaultPresentationDelay"in a.manifest.dash&&(Kb("manifest.dash.defaultPresentationDelay configuration","Please Use manifest.defaultPresentationDelay instead."),a.manifest.defaultPresentationDelay=a.manifest.dash.defaultPresentationDelay,delete a.manifest.dash.defaultPresentationDelay);a.streaming&&a.streaming.lowLatencyMode&&(void 0==a.streaming.inaccurateManifestTolerance&&(a.streaming.inaccurateManifestTolerance=
|
|
414
414
|
0),void 0==a.streaming.rebufferingGoal&&(a.streaming.rebufferingGoal=.01));var c=Wk(this.h,a,el(this));xm(this);return c};
|
|
415
415
|
function xm(a){if(a.I){var b=Oe(a.h.manifest);a.g&&"AUDIO"===a.g.nodeName&&(b.disableVideo=!0);a.I.configure(b)}a.m&&a.m.configure(a.h.drm);if(a.j){a.j.configure(a.h.streaming);try{ym(a,a.i)}catch(f){Dl(a,f)}a.u&&dm(a);b=a.j.l;!b||b.allowedByApplication&&b.allowedByKeySystem||zm(a)}a.F&&a.F.Vd(a.h.streaming.forceHTTPS);if(a.N&&(b=a.h.textDisplayFactory,a.wd!=b)){var c=Sb(b),d=a.N,e=d.l;d.l=c;e&&(c.setTextVisibility(e.isTextVisible()),e.destroy());d.g&&(d.g.i=c);a.wd=b;a.j&&(b=a.j,(c=b.j.get(pc))&&
|
|
416
416
|
Gj(b,c.stream,!0,0,!0))}a.u&&(a.u.configure(a.h.abr),a.h.abr.enabled?a.u.enable():a.u.disable(),im(a));a.L&&(b=a.h.streaming.rebufferingGoal,a.i&&(b=Math.max(b,a.i.minBufferTime)),Be(a.L,b,Math.min(.5,b/2)));a.i&&Vl(a.i.presentationTimeline,a.h.playRangeStart,a.h.playRangeEnd)}r.getConfiguration=function(){var a=el(this);Wk(a,this.h,el(this));return a};
|
|
417
417
|
r.bf=function(){if(this.g){var a=this.g.buffered.length;a=a?this.g.buffered.end(a-1):0;var b=this.getConfiguration().streaming.bufferingGoal;b=Math.min(this.g.currentTime+b,this.lc().end);if(a>=b)return 1;if(!(a<=this.g.currentTime)&&a<b)return(a-this.g.currentTime)/(b-this.g.currentTime)}return 0};r.Uf=function(){for(var a in this.h)delete this.h[a];Wk(this.h,el(this),el(this));xm(this)};r.hf=function(){return this.l};r.mf=function(){return this.g};r.cc=function(){return this.F};r.rd=function(){return this.Tb};
|
|
418
418
|
r.le=function(){return this.D?this.D:null};r.T=function(){return this.i?this.i.presentationTimeline.T():this.g&&this.g.src?Infinity==this.g.duration:!1};r.mb=function(){return this.i?this.i.presentationTimeline.mb():!1};r.Cf=function(){if(this.i){var a=this.i.variants;return a.length?!a[0].video:!1}return this.g&&this.g.src?this.g.videoTracks?0==this.g.videoTracks.length:0==this.g.videoHeight:!1};
|
|
419
|
-
r.lc=function(){if(this.i){var a=this.i.presentationTimeline;return{start:a.Cb(),end:a.
|
|
419
|
+
r.lc=function(){if(this.i){var a=this.i.presentationTimeline;return{start:a.Cb(),end:a.Pa()}}return this.g&&this.g.src&&(a=this.g.seekable,a.length)?{start:a.start(0),end:a.end(a.length-1)}:{start:0,end:0}};r.Af=function(){this.T()&&(this.g.currentTime=this.lc().end)};r.keySystem=function(){var a=this.drmInfo();return a?a.keySystem:""};r.drmInfo=function(){return this.m?this.m.g:null};r.bc=function(){return this.m?this.m.bc():Infinity};r.Gc=function(){return this.m?this.m.Gc():{}};
|
|
420
420
|
r.sd=function(){return this.L?this.L.g==Ae:!1};r.Hc=function(){return this.g?this.G?this.G.i:1:0};r.cg=function(a){0==a?Ua("A trick play rate of 0 is unsupported!"):(this.g.paused&&this.g.play(),this.G.set(a),this.l==am&&(this.u.playbackRateChanged(a),Fj(this.j,1<Math.abs(a))))};r.Se=function(){var a=this.G.Fc();this.l==mm&&this.G.set(a);this.l==am&&(this.G.set(a),this.u.playbackRateChanged(a),Fj(this.j,!1))};
|
|
421
421
|
r.jb=function(){if(this.i){for(var a=this.j?this.j.l:null,b=[],c=0,d=t(this.i.variants),e=d.next();!e.done;e=d.next())if(e=e.value,he(e)){var f=$d(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.g&&this.g.audioTracks?Array.from(this.g.audioTracks).map(function(g){return ge(g)}):[]};
|
|
422
422
|
r.ib=function(){if(this.i){for(var a=this.j?this.j.o:null,b=[],c=t(this.i.textStreams),d=c.next();!d.done;d=c.next()){d=d.value;var e=ae(d);e.active=d==a;b.push(e)}return b}return this.g&&this.g.src&&this.g.textTracks?om(this).map(function(f){return ee(f)}):[]};r.ff=function(){return this.i?this.i.imageStreams.map(function(a){return be(a)}):[]};
|
|
423
423
|
r.wf=function(a,b){var c=this,d,e,f,g,h,k,l,m,n,p,q,v,y,w,x,D,z,B;return L(function(F){if(1==F.g)return c.i?(d=c.i.imageStreams.find(function(G){return G.id==a}))?d.segmentIndex?F.B(3):u(F,d.createSegmentIndex(),3):F["return"](null):F.B(2);if(2!=F.g){e=d.segmentIndex.find(b);if(null==e)return F["return"](null);f=d.segmentIndex.get(e);g=f.tilesLayout||d.tilesLayout;h=/(\d+)x(\d+)/.exec(g);if(!h)return F["return"](null);k=d.width||0;l=d.height||0;m=parseInt(h[1],10);n=parseInt(h[2],10);p=k/m;q=l/n;
|
|
424
424
|
v=m*n;y=f.l-f.startTime;w=f.i||y/v;x=f.startTime;z=D=0;1<v&&(B=Math.floor((b-f.startTime)/w),x=f.startTime+B*w,D=B%m*p,z=Math.floor(B/m)*q);return F["return"]({imageHeight:l,imageWidth:k,height:q,positionX:D,positionY:z,startTime:x,duration:w,uris:f.sa(),width:p})}return F["return"](null)})};
|
|
425
|
-
r.Be=function(a){if(this.i&&this.j){var b=this.i.textStreams.find(function(d){return d.id==a.id});b&&b!=this.j.o&&(bl(this.s.h,b,!1),Ij(this.j,b),Am(this),this.
|
|
426
|
-
r.Ce=function(a,b,c){b=void 0===b?!1:b;c=void 0===c?0:c;if(this.i&&this.j){this.h.abr.enabled&&Ua("Changing tracks while abr manager is enabled will likely result in the selected track being overriden. Consider disabling abr before calling selectVariantTrack().");var d=this.i.variants.find(function(e){return e.id==a.id});d&&he(d)&&(Wl(this,d,!1,b,c),this.
|
|
425
|
+
r.Be=function(a){if(this.i&&this.j){var b=this.i.textStreams.find(function(d){return d.id==a.id});b&&b!=this.j.o&&(bl(this.s.h,b,!1),Ij(this.j,b),Am(this),this.Ma=b.language)}else if(this.g&&this.g.src&&this.g.textTracks){b=om(this);b=t(b);for(var c=b.next();!c.done;c=b.next())c=c.value,ce(c)==a.id?c.mode=this.ka?"showing":"hidden":c.mode="disabled";Am(this)}};
|
|
426
|
+
r.Ce=function(a,b,c){b=void 0===b?!1:b;c=void 0===c?0:c;if(this.i&&this.j){this.h.abr.enabled&&Ua("Changing tracks while abr manager is enabled will likely result in the selected track being overriden. Consider disabling abr before calling selectVariantTrack().");var d=this.i.variants.find(function(e){return e.id==a.id});d&&he(d)&&(Wl(this,d,!1,b,c),this.La=new te(d),dm(this))}else if(this.g&&this.g.audioTracks)for(b=Array.from(this.g.audioTracks),b=t(b),c=b.next();!c.done;c=b.next())if(c=c.value,
|
|
427
427
|
ce(c)==a.id){Bm(this,c);break}};r.af=function(){return Cm(this.jb())};r.vf=function(){return Cm(this.ib())};r.$e=function(){return Array.from(Dm(this.jb()))};r.uf=function(){return Array.from(Dm(this.ib()))};
|
|
428
|
-
r.Sd=function(a,b){if(this.i&&this.C){this.
|
|
428
|
+
r.Sd=function(a,b){if(this.i&&this.C){this.La=new ue(a,b||"",0,"");var c=function(k,l){return k.video||l.video?k.video&&l.video?Math.abs((k.video.height||0)-(l.video.height||0))+Math.abs((k.video.width||0)-(l.video.width||0)):Infinity:0},d=this.j.l,e=this.La.create(this.i.variants),f=null;e=t(e.values());for(var g=e.next();!g.done;g=e.next())if(g=g.value,!f||c(f,d)>c(g,d))f=g;f?(c=$d(f),this.Ce(c,!0)):zm(this)}else if(this.g&&this.g.audioTracks){e=Array.from(this.g.audioTracks);c=rd(a);f=d=null;e=
|
|
429
429
|
t(e);for(g=e.next();!g.done;g=e.next()){g=g.value;var h=ge(g);rd(h.language)==c&&(d=g,b?h.roles.includes(b)&&(f=g):0==h.roles.length&&(f=g))}f?Bm(this,f):d&&Bm(this,d)}};
|
|
430
|
-
r.Td=function(a,b,c){c=void 0===c?!1:c;if(this.i&&this.C){if(this.
|
|
431
|
-
r.Vf=function(a){if(this.i&&this.C){for(var b=null,c=t(this.i.variants),d=c.next();!d.done;d=c.next())if(d=d.value,d.audio.label==a){b=d;break}null!=b&&(this.
|
|
432
|
-
r.cf=function(a){var b=rd(a),c=Em(this).filter(function(
|
|
433
|
-
function qm(a){return Array.from(a.g.textTracks).filter(function(b){return"metadata"==b.kind})}function Em(a){return Array.from(a.g.textTracks).filter(function(b){return"chapters"==b.kind})}
|
|
434
|
-
r.ag=function(a){a=!!a;if(this.ka!=a){this.ka=a;if(this.l==am)this.N.l.setTextVisibility(a),this.h.streaming.alwaysStreamText||(a?this.j.o||(a=je(this.i.textStreams,this.
|
|
435
|
-
r.qf=function(){if(!this.T())return null;var a=this.
|
|
430
|
+
r.Td=function(a,b,c){c=void 0===c?!1:c;if(this.i&&this.C){if(this.Ma=a,this.Xb=b||"",this.Vb=c,(a=je(this.i.textStreams,this.Ma,this.Xb,this.Vb)[0]||null)&&a!=this.j.o&&(bl(this.s.h,a,!1),this.h.streaming.alwaysStreamText||this.td()))Ij(this.j,a),Am(this)}else{var d=rd(a);(a=this.ib().find(function(e){return rd(e.language)==d&&(!b||e.roles.includes(b))&&e.forced==c}))&&this.Be(a)}};
|
|
431
|
+
r.Vf=function(a){if(this.i&&this.C){for(var b=null,c=t(this.i.variants),d=c.next();!d.done;d=c.next())if(d=d.value,d.audio.label==a){b=d;break}null!=b&&(this.La=new ue(b.language,"",0,a),zm(this))}};r.td=function(){var a=this.ka;return this.N?this.N.l.isTextVisible():this.g&&this.g.src&&this.g.textTracks?om(this).some(function(b){return"showing"==b.mode}):a};r.me=function(){return this.g&&this.g.src&&this.g.textTracks?Em(this).map(function(a){return ee(a)}):[]};
|
|
432
|
+
r.cf=function(a){var b=rd(a),c=Em(this).filter(function(h){return rd(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};
|
|
433
|
+
function om(a){return Array.from(a.g.textTracks).filter(function(b){return"metadata"!=b.kind&&"chapters"!=b.kind&&"Shaka Player TextTrack"!=b.label})}function qm(a){return Array.from(a.g.textTracks).filter(function(b){return"metadata"==b.kind})}function Em(a){return Array.from(a.g.textTracks).filter(function(b){return"chapters"==b.kind})}
|
|
434
|
+
r.ag=function(a){a=!!a;if(this.ka!=a){this.ka=a;if(this.l==am)this.N.l.setTextVisibility(a),this.h.streaming.alwaysStreamText||(a?this.j.o||(a=je(this.i.textStreams,this.Ma,this.Xb,this.Vb),0<a.length&&(Ij(this.j,a[0]),Am(this))):Ej(this.j));else if(this.g&&this.g.src&&this.g.textTracks){var b=om(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")}hm(this)}};
|
|
435
|
+
r.qf=function(){if(!this.T())return null;var a=this.ya.l,b=0;if(this.C)b=this.C.wc();else if(a){if(null==a.startTime)return new Date;b=a.startTime}return this.i?new Date(1E3*(this.i.presentationTimeline.l+b)):this.g&&this.g.getStartDate?(a=this.g.getStartDate(),isNaN(a.getTime())?null:new Date(a.getTime()+1E3*b)):null};
|
|
436
436
|
r.ne=function(){if(!this.T())return null;if(this.i)return new Date(1E3*this.i.presentationTimeline.l);if(this.g&&this.g.getStartDate){var a=this.g.getStartDate();return isNaN(a.getTime())?null:a}return null};r.Ya=function(){if(this.l==am)return this.N.Ya();var a={total:[],audio:[],video:[],text:[]};this.l==mm&&(a.total=gi(this.g.buffered));return a};
|
|
437
437
|
r.getStats=function(){if(this.l!=am&&this.l!=mm)return{width:NaN,height:NaN,streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,corruptedFrames:NaN,estimatedBandwidth:NaN,completionPercent:NaN,loadLatency:NaN,manifestTimeSeconds:NaN,drmTimeSeconds:NaN,playTime:NaN,pauseTime:NaN,bufferingTime:NaN,licenseTime:NaN,liveLatency:NaN,maxSegmentDuration:NaN,switchHistory:[],stateHistory:[]};Tl(this);var a=this.g,b=a.currentTime/a.duration;if(!isNaN(b)){var c=this.s;b=Math.round(100*b);c.i=isNaN(c.i)?
|
|
438
438
|
b:Math.max(c.i,b)}if(a.getVideoPlaybackQuality){c=a.getVideoPlaybackQuality();b=this.s;var d=Number(c.totalVideoFrames);b.N=Number(c.droppedVideoFrames);b.L=d;this.s.I=Number(c.corruptedVideoFrames)}this.m?(c=this.m,c=c.G?c.G:NaN):c=NaN;this.s.s=c;if(this.l==am){if(c=this.j.l)this.s.C=(this.G?this.G.i:1)*c.bandwidth;c&&c.video&&(b=this.s,d=c.video.height||NaN,b.o=c.video.width||NaN,b.l=d);this.T()&&(c=this.ne().valueOf()+1E3*this.lc().end,this.s.D=(Date.now()-c)/1E3);this.i&&this.i.presentationTimeline&&
|
|
@@ -448,7 +448,7 @@ r.Ne=function(a,b,c){var d=this,e,f,g,h;return L(function(k){switch(k.g){case 1:
|
|
|
448
448
|
case 5:throw new N(1,2,2012);}})};function Gm(a,b){var c,d;return L(function(e){switch(e.g){case 1:c=Cg(b);if(d=Fm[c])return e["return"](d);C(e,2);return u(e,Eg(b,a.F,a.h.streaming.retryParameters),4);case 4:d=e.h;va(e,3);break;case 2:E(e);case 3:if(d)return e["return"](d);throw new N(1,2,2011,c);}})}
|
|
449
449
|
function Hm(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?u(n,Im(a,b,a.F,a.h.streaming.retryParameters),3):n.B(2);2!=n.g&&(h=n.h,k=Jm(a,h,e,g),l=new Blob([k],{type:"text/vtt"}),b=oi(l),e="text/vtt");m=document.createElement("track");m.src=Lk(a.W,b);m.label=f;m.kind=d;m.srclang=c;a.g.getAttribute("crossorigin")||a.g.setAttribute("crossorigin","anonymous");a.g.appendChild(m);return n["return"](m)})}
|
|
450
450
|
function Im(a,b,c,d){var e,f,g;return L(function(h){if(1==h.g){e=bf;f=We([b],d);f.method="GET";var k=a.W;try{k.g.enabled&&Fk(k,f,{ot:Mk,su:!0})}catch(l){Va("CMCD_TEXT_ERROR","Could not generate text CMCD data.",l)}return u(h,c.request(e,f).promise,2)}g=h.h;return h["return"](g.data)})}function Jm(a,b,c,d){var e=hd[c];if(e)return c=e(),a={periodStart:0,segmentStart:0,segmentEnd:a.g.duration},b=Fb(b),b=c.parseMedia(b,a),tk(b,d);throw new N(2,2,2014,c);}
|
|
451
|
-
r.Wd=function(a,b){this.Gd.width=a;this.Gd.height=b};r.Qd=function(a){if(this.l==am){var b=this.j;a=void 0===a?.1:a;if(b.i.g)b=!1;else if(b.s)b=!1;else{for(var c=t(b.j.values()),d=c.next();!d.done;d=c.next())d=d.value
|
|
451
|
+
r.Wd=function(a,b){this.Gd.width=a;this.Gd.height=b};r.Qd=function(a){if(this.l==am){var b=this.j;a=void 0===a?.1:a;if(b.i.g)b=!1;else if(b.s)b=!1;else{for(var c=t(b.j.values()),d=c.next();!d.done;d=c.next())d=d.value,!d.fc||d.ta||d.Ka||(d.fc=!1,Dj(b,d,a));b=!0}}else b=!1;return b};
|
|
452
452
|
r.jf=function(){Ua("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.kf=function(){return this.Kc};
|
|
453
453
|
function el(a){var b=Uk();b.streaming.failureCallback=function(c){if(a.T()){var d=null;1001==c.code||1002==c.code?d=1:1003==c.code&&(d=.1);null!=d&&(c.severity=1,a.Qd(d))}};b.textDisplayFactory=function(){return a.Bc?new lk(a.g,a.Bc):new gk(a.g)};return b}r.Ge=function(a){this.Bc=a};
|
|
454
454
|
function Ml(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 gj;h={id:a.Jd++,originalId:g,createSegmentIndex:function(){return Promise.resolve()},
|
|
@@ -458,7 +458,7 @@ function ym(a,b){if(a.l!=ul){for(var c=a.h.restrictions,d=a.Gd,e=!1,f=t(b.varian
|
|
|
458
458
|
f.next())g=g.value,eg(a.m,g.initDataType,g.initData);Lm(a,b)}}
|
|
459
459
|
function em(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,p;return L(function(q){if(1==q.g)return k?u(q,k.createSegmentIndex(),2):q["return"](null);n=(m=k.segmentIndex.gb(l))?m.next().value:null;if(!n)return q["return"](null);p=n.startTime;return q["return"](p)})},u(h,e(c,b),2);if(3!=h.g)return f=h.h,u(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)})}
|
|
460
460
|
function Fl(a){var b=a.sd();if(a.s&&a.L&&a.C){var c=a.G;c.j=b;ij(c);a.W&&(c=a.W,b||c.i||(c.i=!0),c.i&&b&&(c.l=!0),c.m=b);Tl(a)}b=(new Map).set("buffering",b);a.dispatchEvent(rl(Mm,b))}function Ul(a){var b=a.g.playbackRate;0!=b&&(a.G&&a.G.set(b),b=rl(Nm),a.dispatchEvent(b))}function Tl(a){if(a.s&&a.L){var b=a.s.g;a.L.g==Ae?Yk(b,"buffering"):a.g.paused?Yk(b,"paused"):a.g.ended?Yk(b,"ended"):Yk(b,"playing")}}
|
|
461
|
-
function dm(a){try{Lm(a,a.i)}catch(c){return Dl(a,c),!1}var b=a.i.variants.filter(function(c){return he(c)});b=a.
|
|
461
|
+
function dm(a){try{Lm(a,a.i)}catch(c){return Dl(a,c),!1}var b=a.i.variants.filter(function(c){return he(c)});b=a.La.create(b);a.u.setVariants(Array.from(b.values()));return!0}function zm(a){var b;(b=dm(a)?a.u.chooseVariant():null)&&Wl(a,b,!0,!0,0)}
|
|
462
462
|
function Wl(a,b,c,d,e){var f=a.j.l;if(b==f)d&&Hj(a.j,b,d,e,!0);else{var g=a.s.h;g.h!=b&&(g.h=b,g.g.push({timestamp:Date.now()/1E3,id:b.id,type:"variant",fromAdaptation:c,bandwidth:b.bandwidth}));Hj(a.j,b,d,e);d=null;f&&(d=$d(f));b=$d(b);c?fm(a,d,b):Om(a,d,b)}}function Bm(a,b){var c=Array.from(a.g.audioTracks).find(function(e){return e.enabled});b.enabled=!0;b.id!==c.id&&(c.enabled=!1);c=ge(c);var d=ge(b);Om(a,c,d)}
|
|
463
463
|
function gm(a,b,c){a=rd(a.h.preferredTextLanguage);b=rd(b.language);c=rd(c.language);return qd(c,a)&&!qd(b,c)}function fm(a,b,c){b=(new Map).set("oldTrack",b).set("newTrack",c);b=rl(Pm,b);Qm(a,b)}function km(a){var b=rl(Rm);Qm(a,b)}function Om(a,b,c){b=(new Map).set("oldTrack",b).set("newTrack",c);b=rl(Sm,b);Qm(a,b)}function Am(a){var b=rl(Tm);Qm(a,b)}function hm(a){var b=rl(Um);Qm(a,b)}function im(a){var b=(new Map).set("newStatus",a.h.abr.enabled);Qm(a,rl(Vm,b))}
|
|
464
464
|
function Dl(a,b){if(a.l!=ul){var c=rl(Wm,(new Map).set("detail",b));a.dispatchEvent(c);c.defaultPrevented&&(b.handled=!0)}}function Il(a,b,c){c=(new Map).set("detail",{schemeIdUri:c.schemeIdUri,value:c.value,startTime:c.startTime,endTime:c.endTime,id:c.id,eventElement:c.eventElement});a.dispatchEvent(rl(b,c))}
|
|
@@ -480,13 +480,13 @@ for(l=p.next();!l.done;l=p.next())l=l.value,k[l]=uc()?gd(l)?!0:MediaSource.isTyp
|
|
|
480
480
|
U.isBrowserSupported=function(){window.Promise||Ua("A Promise implementation or polyfill is required");if(!(window.Promise&&window.Uint8Array&&Array.prototype.forEach)||yc("Trident/"))return!1;var a=Fc();return a&&12>a||!(window.MediaKeys&&window.navigator&&window.navigator.requestMediaKeySystemAccess&&window.MediaKeySystemAccess&&window.MediaKeySystemAccess.prototype.getConfiguration)?!1:uc()?!0:vc("application/x-mpegurl")};U.setAdManagerFactory=function(a){gl=a};
|
|
481
481
|
U.registerSupportPlugin=function(a,b){Zm[a]=b};U.prototype.destroy=U.prototype.destroy;
|
|
482
482
|
var Vm="abrstatuschanged",Pm="adaptation",Mm="buffering",tm="downloadfailed",sm="downloadheadersreceived",Sl="drmsessionupdate",Xj="emsg",Wm="error",Ym="expirationupdated",Al="loaded",xl="loading",Nl="manifestparsed",Kl="mediaqualitychanged",rm="metadata",sl="onstatechange",tl="onstateidle",Nm="ratechange",cm="streaming",Tm="textchanged",Um="texttrackvisibility",Jl="timelineregionadded",vm="timelineregionenter",wm="timelineregionexit",Rm="trackschanged",El="unloading",Sm="variantchanged",$m={jg:Vm,
|
|
483
|
-
kg:Pm,lg:Mm,ng:tm,og:sm,pg:Sl,rg:Xj,Error:Wm,sg:Ym,ug:"largegap",vg:Al,wg:xl,xg:Nl,yg:Kl,Metadata:rm,Ag:sl,Bg:tl,Cg:Nm,Eg:"sessiondata",Fg:cm,Gg:Tm,Hg:Um,Ig:Jl,Jg:vm,Kg:wm,Lg:Rm,Mg:El,Ng:Sm},ul=0,dl=1,am=2,mm=3;U.LoadMode={DESTROYED:ul,NOT_LOADED:dl,MEDIA_SOURCE:am,SRC_EQUALS:mm};U.version="v3.3.
|
|
483
|
+
kg:Pm,lg:Mm,ng:tm,og:sm,pg:Sl,rg:Xj,Error:Wm,sg:Ym,ug:"largegap",vg:Al,wg:xl,xg:Nl,yg:Kl,Metadata:rm,Ag:sl,Bg:tl,Cg:Nm,Eg:"sessiondata",Fg:cm,Gg:Tm,Hg:Um,Ig:Jl,Jg:vm,Kg:wm,Lg:Rm,Mg:El,Ng:Sm},ul=0,dl=1,am=2,mm=3;U.LoadMode={DESTROYED:ul,NOT_LOADED:dl,MEDIA_SOURCE:am,SRC_EQUALS:mm};U.version="v3.3.15";var an=["3","3"];Lb=new function(a){this.g=a;this.i=Mb;this.h=Nb}(new Jb(Number(an[0]),Number(an[1])));
|
|
484
484
|
var Xm=["output-restricted","internal-error"],Zm={},gl=null,Bl={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",m3u8:"application/x-mpegurl",mpd:"application/dash+xml",mp3:"audio/mpeg",aac:"audio/aac",flac:"audio/flac",wav:"audio/wav"},Fm={sbv:"text/x-subviewer",srt:"text/srt",vtt:"text/vtt",webvtt:"text/vtt",ttml:"application/ttml+xml",lrc:"application/x-subtitle-lrc",
|
|
485
485
|
ssa:"text/x-ssa",ass:"text/x-ssa"};function bn(){this.h=[];this.j=this.i=this.g=0};function V(a,b){var c=this;this.h=a;this.g=b;this.i=!1;this.l=this.g.getVolume();this.j=new ef;this.j.A(this.g,google.ima.AdEvent.Type.PAUSED,function(){c.i=!0});this.j.A(this.g,google.ima.AdEvent.Type.RESUMED,function(){c.i=!1})}r=V.prototype;r.getDuration=function(){return this.h.getDuration()};r.getMinSuggestedDuration=function(){return this.h.getMinSuggestedDuration()};r.getRemainingTime=function(){return this.g.getRemainingTime()};r.isPaused=function(){return this.i};
|
|
486
486
|
r.isSkippable=function(){return 0<=this.h.getSkipTimeOffset()};r.getTimeUntilSkippable=function(){var a=this.h.getSkipTimeOffset();a=this.getRemainingTime()-a;return Math.max(a,0)};r.canSkipNow=function(){return this.g.getAdSkippableState()};r.skip=function(){return this.g.skip()};r.pause=function(){return this.g.pause()};r.play=function(){return this.g.resume()};r.getVolume=function(){return this.g.getVolume()};r.setVolume=function(a){return this.g.setVolume(a)};r.isMuted=function(){return 0==this.g.getVolume()};
|
|
487
487
|
r.isLinear=function(){return this.h.isLinear()};r.resize=function(a,b){this.g.resize(a,b,document.fullscreenElement?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)};r.setMuted=function(a){a?(this.l=this.getVolume(),this.setVolume(0)):this.setVolume(this.l)};r.getSequenceLength=function(){var a=this.h.getAdPodInfo();return null==a?1:a.getTotalAds()};r.getPositionInSequence=function(){var a=this.h.getAdPodInfo();return null==a?1:a.getAdPosition()};r.release=function(){this.g=this.h=null};
|
|
488
488
|
M("shaka.ads.ClientSideAd",V);V.prototype.release=V.prototype.release;V.prototype.getPositionInSequence=V.prototype.getPositionInSequence;V.prototype.getSequenceLength=V.prototype.getSequenceLength;V.prototype.setMuted=V.prototype.setMuted;V.prototype.resize=V.prototype.resize;V.prototype.isLinear=V.prototype.isLinear;V.prototype.isMuted=V.prototype.isMuted;V.prototype.setVolume=V.prototype.setVolume;V.prototype.getVolume=V.prototype.getVolume;V.prototype.play=V.prototype.play;V.prototype.pause=V.prototype.pause;
|
|
489
|
-
V.prototype.skip=V.prototype.skip;V.prototype.canSkipNow=V.prototype.canSkipNow;V.prototype.getTimeUntilSkippable=V.prototype.getTimeUntilSkippable;V.prototype.isSkippable=V.prototype.isSkippable;V.prototype.isPaused=V.prototype.isPaused;V.prototype.getRemainingTime=V.prototype.getRemainingTime;V.prototype.getMinSuggestedDuration=V.prototype.getMinSuggestedDuration;V.prototype.getDuration=V.prototype.getDuration;function cn(a,b,c,d){var e=this;this.o=a;this.i=b;this.s=null;this.u=NaN;this.l=d;this.j=null;this.h=new ef;google.ima.settings.setLocale(c);a=new google.ima.AdDisplayContainer(this.o,this.i);a.initialize();this.m=new google.ima.AdsLoader(a);this.m.getSettings().setPlayerType("shaka-player");this.m.getSettings().setPlayerVersion("v3.3.
|
|
489
|
+
V.prototype.skip=V.prototype.skip;V.prototype.canSkipNow=V.prototype.canSkipNow;V.prototype.getTimeUntilSkippable=V.prototype.getTimeUntilSkippable;V.prototype.isSkippable=V.prototype.isSkippable;V.prototype.isPaused=V.prototype.isPaused;V.prototype.getRemainingTime=V.prototype.getRemainingTime;V.prototype.getMinSuggestedDuration=V.prototype.getMinSuggestedDuration;V.prototype.getDuration=V.prototype.getDuration;function cn(a,b,c,d){var e=this;this.o=a;this.i=b;this.s=null;this.u=NaN;this.l=d;this.j=null;this.h=new ef;google.ima.settings.setLocale(c);a=new google.ima.AdDisplayContainer(this.o,this.i);a.initialize();this.m=new google.ima.AdsLoader(a);this.m.getSettings().setPlayerType("shaka-player");this.m.getSettings().setPlayerVersion("v3.3.15");this.g=null;this.h.oa(this.m,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,function(f){dn(e,f)});this.h.A(this.m,google.ima.AdErrorEvent.Type.AD_ERROR,
|
|
490
490
|
function(f){en(e,f)});this.i.onended=function(){e.m.contentComplete()}}cn.prototype.stop=function(){this.g&&this.g.stop();this.o&&kk(this.o)};cn.prototype.release=function(){this.stop();this.s&&this.s.disconnect();this.h&&this.h.release();this.g&&this.g.destroy();this.m.destroy()};function en(a,b){b.getError();fn(a,null);a.l(new Q("ad-cue-points-changed",(new Map).set("cuepoints",[])))}
|
|
491
491
|
function dn(a,b){a.l(new Q("ads-loaded",(new Map).set("loadTime",Date.now()/1E3-a.u)));a.g=b.getAdsManager(a.i);a.l(new Q("ima-ad-manager-loaded",(new Map).set("imaAdManager",a.g)));var c=a.g.getCuePoints();if(c.length){var d=[];c=t(c);for(var e=c.next();!e.done;e=c.next())d.push({start:e.value,end:null});a.l(new Q("ad-cue-points-changed",(new Map).set("cuepoints",d)))}gn(a);try{a.g.init(a.i.offsetWidth,a.i.offsetHeight,document.fullscreenElement?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL),
|
|
492
492
|
a.h.A(a.i,"loadeddata",function(){a.g.resize(a.i.offsetWidth,a.i.offsetHeight,document.fullscreenElement?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),"ResizeObserver"in window&&(a.s=new ResizeObserver(function(){a.g.resize(a.i.offsetWidth,a.i.offsetHeight,document.fullscreenElement?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a.s.observe(a.i)),a.i.addEventListener("play",function(){a.g.start()},{once:!0})}catch(f){fn(a,null)}}
|
|
@@ -507,8 +507,8 @@ f;e.i(new Q("ad-cue-points-changed",(new Map).set("cuepoints",f)))})}jn.prototyp
|
|
|
507
507
|
function kn(a,b){a.i(new Q("ads-loaded",(new Map).set("loadTime",Date.now()/1E3-a.G)));var c=b.getStreamData().url;a.j.resolve(c);a.j=null;a.F||a.h.A(a.l,"seeked",function(){var d=a.l.currentTime;if(0!=d){a.g.streamTimeForContentTime(d);var e=a.g.previousCuePointForStreamTime(d);e&&!e.played&&(a.o=d,a.l.currentTime=e.start)}})};function X(){Ne.call(this);this.g=this.i=null;this.h=new bn;this.j=navigator.language}qa(X,Ne);r=X.prototype;r.setLocale=function(a){this.j=a};r.initClientSide=function(a,b){var c=this;if(!window.google||!google.ima||!google.ima.AdsLoader)throw new N(2,10,1E4);this.i&&this.i.release();this.i=new cn(a,b,this.j,function(d){if(d&&d.type)switch(d.type){case "ads-loaded":c.h.h.push(d.loadTime);break;case "ad-started":c.h.g++;break;case "ad-complete":c.h.i++;break;case "ad-skipped":c.h.j++}c.dispatchEvent(d)})};
|
|
508
508
|
r.release=function(){this.i&&(this.i.release(),this.i=null);this.g&&(this.g.release(),this.g=null);Ne.prototype.release.call(this)};r.onAssetUnload=function(){this.i&&this.i.stop();this.g&&this.g.stop();this.dispatchEvent(new Q("ad-stopped"));this.h=new bn};r.requestClientSideAds=function(a){if(!this.i)throw new N(1,10,10001);var b=this.i;b.u=Date.now()/1E3;b.m.requestAds(a)};
|
|
509
509
|
r.initServerSide=function(a,b){var c=this;if(!window.google||!google.ima||!google.ima.dai)throw new N(2,10,10002);this.g&&this.g.release();this.g=new jn(a,b,this.j,function(d){if(d&&d.type)switch(d.type){case "ads-loaded":c.h.h.push(d.loadTime);break;case "ad-started":c.h.g++;break;case "ad-complete":c.h.i++;break;case "ad-skipped":c.h.j++}c.dispatchEvent(d)})};
|
|
510
|
-
r.requestServerSideStream=function(a,b){b=void 0===b?"":b;if(!this.g)throw new N(1,10,10003);a.adTagParameters||(a.adTagParameters={});var c=a.adTagParameters;(c.mpt||c.mpv)&&Ua('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overriden.');a.adTagParameters.mpt="shaka-player";a.adTagParameters.mpv="v3.3.
|
|
511
|
-
(c.F=!0),c.j=new rc,c.g.requestStream(a),c.C=d||"",c.G=Date.now()/1E3,c=c.j);return c};r.replaceServerSideAdTagParameters=function(a){if(!this.g)throw new N(1,10,10003);(a.mpt||a.mpv)&&Ua('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overriden.');a.mpt="Shaka Player";a.mpv="v3.3.
|
|
510
|
+
r.requestServerSideStream=function(a,b){b=void 0===b?"":b;if(!this.g)throw new N(1,10,10003);a.adTagParameters||(a.adTagParameters={});var c=a.adTagParameters;(c.mpt||c.mpv)&&Ua('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overriden.');a.adTagParameters.mpt="shaka-player";a.adTagParameters.mpv="v3.3.15";c=this.g;var d=b;c.j?c=Promise.reject(new N(1,10,10004)):(a instanceof google.ima.dai.api.LiveStreamRequest&&
|
|
511
|
+
(c.F=!0),c.j=new rc,c.g.requestStream(a),c.C=d||"",c.G=Date.now()/1E3,c=c.j);return c};r.replaceServerSideAdTagParameters=function(a){if(!this.g)throw new N(1,10,10003);(a.mpt||a.mpv)&&Ua('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overriden.');a.mpt="Shaka Player";a.mpv="v3.3.15";this.g.g.replaceAdTagParameters(a)};r.getServerSideCuePoints=function(){if(!this.g)throw new N(1,10,10003);return this.g.D};
|
|
512
512
|
r.getStats=function(){var a=this.h;return{loadTimes:a.h,started:a.g,playedCompletely:a.i,skipped:a.j}};r.onDashTimedMetadata=function(a){if(this.g&&"urn:google:dai:2018"==a.schemeIdUri){var b=a.schemeIdUri,c=a.eventElement?a.eventElement.getAttribute("messageData"):null;this.g.g.processMetadata(b,c,a.startTime)}};r.onHlsTimedMetadata=function(a,b){this.g&&this.g.g.processMetadata("ID3",a.data,b)};r.onCueMetadataChange=function(a){if(this.g)this.g.onCueMetadataChange(a)};M("shaka.ads.AdManager",X);
|
|
513
513
|
X.prototype.onCueMetadataChange=X.prototype.onCueMetadataChange;X.prototype.onHlsTimedMetadata=X.prototype.onHlsTimedMetadata;X.prototype.onDashTimedMetadata=X.prototype.onDashTimedMetadata;X.prototype.getStats=X.prototype.getStats;X.prototype.getServerSideCuePoints=X.prototype.getServerSideCuePoints;X.prototype.replaceServerSideAdTagParameters=X.prototype.replaceServerSideAdTagParameters;X.prototype.requestServerSideStream=X.prototype.requestServerSideStream;X.prototype.initServerSide=X.prototype.initServerSide;
|
|
514
514
|
X.prototype.requestClientSideAds=X.prototype.requestClientSideAds;X.prototype.onAssetUnload=X.prototype.onAssetUnload;X.prototype.release=X.prototype.release;X.prototype.initClientSide=X.prototype.initClientSide;X.prototype.setLocale=X.prototype.setLocale;X.ADS_LOADED="ads-loaded";X.AD_STARTED="ad-started";X.AD_FIRST_QUARTILE="ad-first-quartile";X.AD_MIDPOINT="ad-midpoint";X.AD_THIRD_QUARTILE="ad-third-quartile";X.AD_COMPLETE="ad-complete";X.AD_STOPPED="ad-stopped";X.AD_SKIPPED="ad-skipped";
|
|
@@ -520,7 +520,7 @@ function nn(a){return{length:a.length,start:function(b){return a.start[b]},end:f
|
|
|
520
520
|
var on="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),pn="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),qn=["loop","playbackRate"],rn=["pause","play"],sn={getAssetUri:2,getAudioLanguages:4,getAudioLanguagesAndRoles:4,getBufferFullness:1,getBufferedInfo:2,getExpiration:2,getKeyStatuses:2,getPlaybackRate:2,getTextLanguages:4,getTextLanguagesAndRoles:4,getImageTracks:2,getThumbnails:2,
|
|
521
521
|
isAudioOnly:10,isBuffering:1,isInProgress:1,isLive:10,isTextTrackVisible:1,keySystem:10,seekRange:1,getLoadMode:10},tn={getConfiguration:4,getStats:5,getTextTracks:2,getVariantTracks:2},un={getPlayheadTimeAsDate:1,getPresentationStartTimeAsDate:20},vn=[["getConfiguration","configure"]],wn=[["isTextTrackVisible","setTextTrackVisibility"]],xn="addChaptersTrack addTextTrack addTextTrackAsync cancelTrickPlay configure getChapters getChaptersTracks resetConfiguration retryStreaming selectAudioLanguage selectTextLanguage selectTextTrack selectVariantTrack selectVariantsByLabel setTextTrackVisibility trickPlay updateStartTime goToLive".split(" "),
|
|
522
522
|
yn=["attach","detach","load","unload"];function zn(a,b,c,d,e,f){var g=this;this.G=a;this.j=new O(b);this.V=c;this.u=!1;this.s=d;this.F=e;this.L=f;this.h=this.m=!1;this.N="";this.o=null;this.C=function(){return An(g)};this.D=function(h,k){var l=mn(k);switch(l.type){case "event":var m=l.targetName;l=Me(l.event);g.s(m,l);break;case "update":m=l.update;for(var n in m){l=g.g[n]||{};for(var p in m[n])l[p]=m[n][p]}g.u&&(g.V(),g.u=!1);break;case "asyncComplete":if(n=l.id,l=l.error,p=g.i[n],delete g.i[n],p)if(l){n=new N(l.severity,l.category,l.code);
|
|
523
|
-
for(m in l)n[m]=l[m];p.reject(n)}else p.resolve()}};this.g={video:{},player:{}};this.I=0;this.i={};this.l=null;Bn.add(this)}r=zn.prototype;r.destroy=function(){Bn["delete"](this);Cn(this);Ln&&Mn(this);this.j&&(this.j.stop(),this.j=null);this.F=this.s=null;this.h=this.m=!1;this.D=this.C=this.l=this.i=this.g=this.o=null;return Promise.resolve()};r.
|
|
523
|
+
for(m in l)n[m]=l[m];p.reject(n)}else p.resolve()}};this.g={video:{},player:{}};this.I=0;this.i={};this.l=null;Bn.add(this)}r=zn.prototype;r.destroy=function(){Bn["delete"](this);Cn(this);Ln&&Mn(this);this.j&&(this.j.stop(),this.j=null);this.F=this.s=null;this.h=this.m=!1;this.D=this.C=this.l=this.i=this.g=this.o=null;return Promise.resolve()};r.ua=function(){return this.h};r.Od=function(){return this.N};
|
|
524
524
|
r.init=function(){if(this.G.length)if(window.chrome&&chrome.cast&&chrome.cast.isAvailable){this.m=!0;this.j.Mb();var a=new chrome.cast.SessionRequest(this.G);a=new chrome.cast.ApiConfig(a,function(b){for(var c=t(Bn),d=c.next();!d.done;d=c.next())Nn(d.value,b)},function(b){for(var c=t(Bn),d=c.next();!d.done;d=c.next())d=d.value,On="available"==b,d.j.Mb()},"origin_scoped");chrome.cast.initialize(a,function(){},function(){});On&&this.j.S(Pn);(a=Ln)&&a.status!=chrome.cast.SessionStatus.STOPPED?Nn(this,
|
|
525
525
|
a):Ln=null}else window.__onGCastApiAvailable!==Qn&&(Rn=window.__onGCastApiAvailable||null,window.__onGCastApiAvailable=Qn)};r.Ud=function(a){this.o=a;this.h&&Sn(this,{type:"appData",appData:this.o})};r.cast=function(a){var b=this;return L(function(c){if(!b.m)throw new N(1,8,8E3);if(!On)throw new N(1,8,8001);if(b.h)throw new N(1,8,8002);b.l=new rc;chrome.cast.requestSession(function(d){return Tn(b,a,d)},function(d){return Un(b,d)});return u(c,b.l,0)})};
|
|
526
526
|
function Vn(a){if(a.h){var b=a.L();chrome.cast.requestSession(function(c){return Tn(a,b,c)},function(c){return Un(a,c)})}}r.Ab=function(){if(this.h){Cn(this);if(Ln){Mn(this);try{Ln.stop(function(){},function(){})}catch(a){}Ln=null}An(this)}};
|
|
@@ -529,20 +529,20 @@ r.set=function(a,b,c){this.g[a][b]=c;Sn(this,{type:"set",targetName:a,property:b
|
|
|
529
529
|
r.xe=function(a,b){Sn(this,{type:"call",targetName:a,methodName:b,args:Ha.apply(2,arguments)})};r.Rf=function(a,b){var c=Ha.apply(2,arguments),d=new rc,e=this.I.toString();this.I++;this.i[e]=d;try{Sn(this,{type:"asyncCall",targetName:a,methodName:b,args:c,id:e})}catch(f){d.reject(f)}return d};function Nn(a,b){var c=a.L();a.l=new rc;a.u=!0;Tn(a,c,b)}function Mn(a){var b=Ln;b.removeUpdateListener(a.C);b.removeMessageListener("urn:x-cast:com.google.shaka.v2",a.D)}
|
|
530
530
|
function An(a){var b=Ln?"connected"==Ln.status:!1;if(a.h&&!b){a.F();for(var c in a.g)a.g[c]={};Cn(a)}a.h=b;a.N=b?Ln.receiver.friendlyName:"";a.j.Mb()}function Cn(a){for(var b in a.i){var c=a.i[b];delete a.i[b];c.reject(new N(1,7,7E3))}}function Sn(a,b){var c=ln(b),d=Ln;try{d.sendMessage("urn:x-cast:com.google.shaka.v2",c,function(){},Xa)}catch(e){throw c=new N(2,8,8005,e),d=new Q("error",(new Map).set("detail",c)),a.s("player",d),a.Ab(),c;}}var Pn=.02,On=!1,Ln=null,Rn=null,Bn=new Set;
|
|
531
531
|
function Qn(a){Rn?window.__onGCastApiAvailable=Rn:delete window.__onGCastApiAvailable;Rn=null;if(a)for(var b=t(Bn),c=b.next();!c.done;c=b.next())c.value.init();"function"===typeof window.__onGCastApiAvailable&&window.__onGCastApiAvailable(a)};function Wn(a,b,c){Ne.call(this);var d=this;this.i=a;this.h=b;this.m=this.o=this.j=this.s=this.l=null;this.C=c;this.u=new Map;this.g=new zn(c,function(){return Xn(d)},function(){return Yn(d)},function(e,f){return Zn(d,e,f)},function(){return $n(d)},function(){return ao(d)});bo(this)}qa(Wn,Ne);r=Wn.prototype;
|
|
532
|
-
r.destroy=function(a){a&&this.g.Ab();this.m&&(this.m.release(),this.m=null);a=[];this.h&&(a.push(this.h.destroy()),this.h=null);this.g&&(a.push(this.g.destroy()),this.g=null);this.s=this.l=this.i=null;Ne.prototype.release.call(this);return Promise.all(a)};r.zf=function(){return this.l};r.pf=function(){return this.s};r.Qe=function(){return this.g.m&&On};r.
|
|
532
|
+
r.destroy=function(a){a&&this.g.Ab();this.m&&(this.m.release(),this.m=null);a=[];this.h&&(a.push(this.h.destroy()),this.h=null);this.g&&(a.push(this.g.destroy()),this.g=null);this.s=this.l=this.i=null;Ne.prototype.release.call(this);return Promise.all(a)};r.zf=function(){return this.l};r.pf=function(){return this.s};r.Qe=function(){return this.g.m&&On};r.ua=function(){return this.g.ua()};r.Od=function(){return this.g.Od()};
|
|
533
533
|
r.cast=function(){var a=this,b;return L(function(c){return 1==c.g?(b=ao(a),u(c,a.g.cast(b),2)):a.h?u(c,a.h.be(),0):c["return"]()})};r.Ud=function(a){this.g.Ud(a)};r.bg=function(){Vn(this.g)};r.Ab=function(){this.g.Ab()};
|
|
534
534
|
r.Te=function(a){var b=this;return L(function(c){if(1==c.g){if(a==b.C)return c["return"]();b.C=a;b.g.Ab();return u(c,b.g.destroy(),2)}b.g=null;b.g=new zn(a,function(){return Xn(b)},function(){return Yn(b)},function(d,e){return Zn(b,d,e)},function(){return $n(b)},function(){return ao(b)});b.g.init();A(c)})};
|
|
535
|
-
function bo(a){a.g.init();a.m=new ef;for(var b=t(on),c=b.next();!c.done;c=b.next())a.m.A(a.i,c.value,function(f){a.g.
|
|
535
|
+
function bo(a){a.g.init();a.m=new ef;for(var b=t(on),c=b.next();!c.done;c=b.next())a.m.A(a.i,c.value,function(f){a.g.ua()||(f=Me(f),a.j.dispatchEvent(f))});for(var d in $m)a.m.A(a.h,$m[d],function(f){a.g.ua()||a.o.dispatchEvent(f)});a.l={};b={};for(var e in a.i)b.Ob=e,Object.defineProperty(a.l,b.Ob,{configurable:!1,enumerable:!0,get:function(f){return function(){return co(a,f.Ob)}}(b),set:function(f){return function(g){var h=f.Ob;a.g.ua()?a.g.set("video",h,g):a.i[h]=g}}(b)}),b={Ob:b.Ob};a.s={};eo(a,
|
|
536
536
|
function(f){Object.defineProperty(a.s,f,{configurable:!1,enumerable:!0,get:function(){return fo(a,f)}})});go(a);a.j=new Ne;a.j.Dc=a.l;a.o=new Ne;a.o.Dc=a.s}function go(a){var b=new Map;eo(a,function(c,d){if(b.has(d)){var e=b.get(d);c.length<e.length?a.u.set(c,e):a.u.set(e,c)}else b.set(d,c)})}
|
|
537
537
|
function eo(a,b){function c(l){return"constructor"==l||"function"!=typeof d[l]?!1:!e.has(l)}var d=a.h,e=new Set;for(f in d)c(f)&&(e.add(f),b(f,d[f]));var f=Object.getPrototypeOf(d);for(var g=Object.getPrototypeOf({});f&&f!=g;){for(var h=t(Object.getOwnPropertyNames(f)),k=h.next();!k.done;k=h.next())k=k.value,c(k)&&(e.add(k),b(k,d[k]));f=Object.getPrototypeOf(f)}}
|
|
538
538
|
function ao(a){var b={video:{},player:{},playerAfterLoad:{},manifest:a.h.rd(),startTime:null};a.i.pause();for(var c=t(qn),d=c.next();!d.done;d=c.next())d=d.value,b.video[d]=a.i[d];a.i.ended||(b.startTime=a.i.currentTime);c=t(vn);for(d=c.next();!d.done;d=c.next()){var e=d.value;d=e[1];e=a.h[e[0]]();b.player[d]=e}c=t(wn);for(d=c.next();!d.done;d=c.next())e=d.value,d=e[1],e=a.h[e[0]](),b.playerAfterLoad[d]=e;return b}function Xn(a){var b=new Q("caststatuschanged");a.dispatchEvent(b)}
|
|
539
539
|
function Yn(a){var b=new Q(a.l.paused?"pause":"play");a.j.dispatchEvent(b)}
|
|
540
540
|
function $n(a){for(var b=t(vn),c=b.next();!c.done;c=b.next()){var d=c.value;c=d[1];d=a.g.get("player",d[0])();a.h[c](d)}var e=a.g.get("player","getAssetUri")();c=a.g.get("video","ended");b=Promise.resolve();var f=a.i.autoplay;d=null;c||(d=a.g.get("video","currentTime"));e&&(a.i.autoplay=!1,b=a.h.load(e,d));var g={};c=t(qn);for(d=c.next();!d.done;d=c.next())d=d.value,g[d]=a.g.get("video",d);b.then(function(){if(a.i){for(var h=t(qn),k=h.next();!k.done;k=h.next())k=k.value,a.i[k]=g[k];h=t(wn);for(k=
|
|
541
541
|
h.next();!k.done;k=h.next()){var l=k.value;k=l[1];l=a.g.get("player",l[0])();a.h[k](l)}a.i.autoplay=f;e&&a.i.play()}},function(h){h=(new Map).set("detail",h);h=new Q(Wm,h);a.h.dispatchEvent(h)})}
|
|
542
|
-
function co(a,b){if("addEventListener"==b)return function(d,e,f){return a.j.addEventListener(d,e,f)};if("removeEventListener"==b)return function(d,e,f){return a.j.removeEventListener(d,e,f)};if(a.g.
|
|
542
|
+
function co(a,b){if("addEventListener"==b)return function(d,e,f){return a.j.addEventListener(d,e,f)};if("removeEventListener"==b)return function(d,e,f){return a.j.removeEventListener(d,e,f)};if(a.g.ua()&&0==Object.keys(a.g.g.video).length){var c=a.i[b];if("function"!=typeof c)return c}return a.g.ua()?a.g.get("video",b):(c=a.i[b],"function"==typeof c&&(c=c.bind(a.i)),c)}
|
|
543
543
|
function fo(a,b){a.u.has(b)&&(b=a.u.get(b));if("addEventListener"==b)return function(c,d,e){return a.o.addEventListener(c,d,e)};if("removeEventListener"==b)return function(c,d,e){return a.o.removeEventListener(c,d,e)};if("getMediaElement"==b)return function(){return a.l};if("getSharedConfiguration"==b)return a.g.get("player","getConfiguration");if("getNetworkingEngine"==b)return function(){return a.h.cc()};if("getDrmEngine"==b)return function(){return a.h.m};if("getAdManager"==b)return function(){return a.h.le()};
|
|
544
|
-
if("setVideoContainer"==b)return function(c){return a.h.Ge(c)};if(a.g.
|
|
545
|
-
function Zn(a,b,c){a.g.
|
|
544
|
+
if("setVideoContainer"==b)return function(c){return a.h.Ge(c)};if(a.g.ua()){if("getManifest"==b||"drmInfo"==b)return function(){Ua(b+"() does not work while casting!");return null};if("attach"==b||"detach"==b)return function(){Ua(b+"() does not work while casting!");return Promise.resolve()}}return a.g.ua()&&0==Object.keys(a.g.g.video).length&&(sn[b]||tn[b])||!a.g.ua()?a.h[b].bind(a.h):a.g.get("player",b)}
|
|
545
|
+
function Zn(a,b,c){a.g.ua()&&("video"==b?a.j.dispatchEvent(c):"player"==b&&a.o.dispatchEvent(c))}M("shaka.cast.CastProxy",Wn);Wn.prototype.changeReceiverId=Wn.prototype.Te;Wn.prototype.forceDisconnect=Wn.prototype.Ab;Wn.prototype.suggestDisconnect=Wn.prototype.bg;Wn.prototype.setAppData=Wn.prototype.Ud;Wn.prototype.cast=Wn.prototype.cast;Wn.prototype.receiverName=Wn.prototype.Od;Wn.prototype.isCasting=Wn.prototype.ua;Wn.prototype.canCast=Wn.prototype.Qe;Wn.prototype.getPlayer=Wn.prototype.pf;
|
|
546
546
|
Wn.prototype.getVideo=Wn.prototype.zf;Wn.prototype.destroy=Wn.prototype.destroy;function ho(a,b,c,d){Ne.call(this);var e=this;this.g=a;this.h=b;this.j=new ef;this.I={video:a,player:b};this.D=c||function(){};this.L=d||function(f){return f};this.i=null;this.F=!1;this.o=!0;this.m=0;this.C=!1;this.u=!0;this.s=this.l=null;this.G=new O(function(){io(e)});jo(this)}qa(ho,Ne);r=ho.prototype;r.isConnected=function(){return this.F};r.Df=function(){return this.o};r.Yf=function(a){this.i=a};r.We=function(){this.i=null};
|
|
547
547
|
r.Zf=function(a){this.i||(this.i={metadataType:cast.receiver.media.MetadataType.GENERIC});this.i.title=a};r.Xf=function(a){this.i||(this.i={metadataType:cast.receiver.media.MetadataType.GENERIC});this.i.images=[{url:a}]};r.Wf=function(a){this.i||(this.i={});this.i.artist=a;this.i.metadataType=cast.receiver.media.MetadataType.MUSIC_TRACK};
|
|
548
548
|
r.destroy=function(){var a=this,b,c;return L(function(d){if(1==d.g)return a.j&&(a.j.release(),a.j=null),b=[],a.h&&(b.push(a.h.destroy()),a.h=null),a.G&&(a.G.stop(),a.G=null),a.g=null,a.I=null,a.D=null,a.F=!1,a.o=!0,a.l=null,a.s=null,Ne.prototype.release.call(a),u(d,Promise.all(b),2);c=cast.receiver.CastReceiverManager.getInstance();c.stop();A(d)})};
|
|
@@ -570,7 +570,7 @@ function No(a){var b=a.getAttribute("schemeIdUri"),c=xf(a,"urn:mpeg:cenc:2013","
|
|
|
570
570
|
var Lo=1,Mo=(new Map).set("com.widevine.alpha",function(a){return(a=uf(a.node,"urn:microsoft","laurl"))?a.getAttribute("licenseUrl")||"":""}).set("com.microsoft.playready",Ko).set("com.microsoft.playready.recommendation",Ko).set("com.microsoft.playready.software",Ko).set("com.microsoft.playready.hardware",Ko);function Oo(a,b,c,d,e){var f={RepresentationID:b,Number:c,Bandwidth:d,Time:e};return a.replace(/\$(RepresentationID|Number|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g,function(g,h,k,l){if("$$"==g)return"$";var m=f[h];if(null==m)return g;"RepresentationID"==h&&k&&(k=void 0);"Time"==h&&(m=Math.round(m));switch(l){case void 0:case "d":case "i":case "u":g=m.toString();break;case "o":g=m.toString(8);break;case "x":g=m.toString(16);break;case "X":g=m.toString(16).toUpperCase();break;default:g=m.toString()}k=
|
|
571
571
|
window.parseInt(k,10)||1;return Array(Math.max(0,k-g.length)+1).join("0")+g})}
|
|
572
572
|
function Po(a,b){var c=Qo(a,b,"timescale"),d=1;c&&(d=If(c)||1);var e=Qo(a,b,"duration");c=If(e||"");"image"==a.H.contentType&&(c=Kf(e||""));c&&(c/=d);var f=Qo(a,b,"startNumber");e=Number(Qo(a,b,"presentationTimeOffset"))||0;var g=Jf(f||"");if(null==f||null==g)g=1;var h=Ro(a,b,"SegmentTimeline");f=null;if(h){f=d;var k=a.U.duration||Infinity;h=tf(h,"S");for(var l=[],m=-e,n=0;n<h.length;++n){var p=h[n],q=h[n+1],v=Bf(p,"t",Jf),y=Bf(p,"d",Jf);p=Bf(p,"r",Ff);null!=v&&(v-=e);if(!y)break;v=null!=v?v:m;p=
|
|
573
|
-
p||0;if(0>p)if(q){q=Bf(q,"t",Jf);if(null==q)break;else if(v>=q)break;p=Math.ceil((q-v)/y)-1}else{if(Infinity==k)break;else if(v/f>=k)break;p=Math.ceil((k*f-v)/y)-1}0<l.length&&v!=m&&(l[l.length-1].end=v/f);for(q=0;q<=p;++q)m=v+y,l.push({start:v/f,end:m/f,fg:v}),v=m}f=l}return{timescale:d,ja:c,Lb:g,
|
|
573
|
+
p||0;if(0>p)if(q){q=Bf(q,"t",Jf);if(null==q)break;else if(v>=q)break;p=Math.ceil((q-v)/y)-1}else{if(Infinity==k)break;else if(v/f>=k)break;p=Math.ceil((k*f-v)/y)-1}0<l.length&&v!=m&&(l[l.length-1].end=v/f);for(q=0;q<=p;++q)m=v+y,l.push({start:v/f,end:m/f,fg:v}),v=m}f=l}return{timescale:d,ja:c,Lb:g,Ta:e/d||0,ce:e,timeline:f}}function Qo(a,b,c){return[b(a.H),b(a.ga),b(a.aa)].filter(Rb).map(function(d){return d.getAttribute(c)}).reduce(function(d,e){return d||e})}
|
|
574
574
|
function Ro(a,b,c){return[b(a.H),b(a.ga),b(a.aa)].filter(Rb).map(function(d){return sf(d,c)}).reduce(function(d,e){return d||e})}
|
|
575
575
|
function So(a,b,c,d,e,f){for(var g=xf(a,"http://www.w3.org/1999/xlink","href"),h=xf(a,"http://www.w3.org/1999/xlink","actuate")||"onRequest",k=t(Array.from(a.attributes)),l=k.next();!l.done;l=k.next())l=l.value,"http://www.w3.org/1999/xlink"==l.namespaceURI&&a.removeAttributeNS(l.namespaceURI,l.localName);if(5<=f)return Ge(new N(2,4,4028));if("onLoad"!=h)return Ge(new N(2,4,4027));var m=kc([d],[g]);return e.request(0,We(m,b)).$(function(n){n=Of(n.data,a.tagName);if(!n)return Ge(new N(2,4,4001,g));
|
|
576
576
|
for(;a.childNodes.length;)a.removeChild(a.childNodes[0]);for(;n.childNodes.length;){var p=n.childNodes[0];n.removeChild(p);a.appendChild(p)}n=t(Array.from(n.attributes));for(p=n.next();!p.done;p=n.next())a.setAttributeNode(p.value.cloneNode(!1));return To(a,b,c,m[0],e,f+1)})}
|
|
@@ -579,29 +579,29 @@ function Vo(a,b,c,d,e,f,g){var h=[];g.reader.skip(4);var k=g.reader.M();if(0==k)
|
|
|
579
579
|
function Xo(a){var b=Yo(a);if(7<b.length)throw new N(2,3,3002);var c=0;b=t(b);for(var d=b.next();!d.done;d=b.next())c=256*c+d.value;b=Yo(a);a:{d=t(Zo);for(var e=d.next();!e.done;e=d.next())if(Db(b,new Uint8Array(e.value))){d=!0;break a}d=!1}if(d)b=a.h.byteLength-a.g.X();else{if(8==b.length&&b[1]&224)throw new N(2,3,3001);for(e=d=0;e<b.length;e++){var f=b[e];d=0==e?f&(1<<8-b.length)-1:256*d+f}b=d}b=a.g.X()+b<=a.h.byteLength?b:a.h.byteLength-a.g.X();d=Ib(a.h,a.g.X(),b);a.g.skip(b);return new $o(c,d)}
|
|
580
580
|
function Yo(a){var b=a.g.X(),c=a.g.Y();if(0==c)throw new N(2,3,3002);c=8-Math.floor(Math.log2(c));a.g.skip(c-1);return Fb(a.h,b,c)}var Zo=[[255],[127,255],[63,255,255],[31,255,255,255],[15,255,255,255,255],[7,255,255,255,255,255],[3,255,255,255,255,255,255],[1,255,255,255,255,255,255,255]];function $o(a,b){this.id=a;this.g=b}
|
|
581
581
|
function ap(a){if(8<a.g.byteLength)throw new N(2,3,3002);if(8==a.g.byteLength&&a.g.getUint8(0)&224)throw new N(2,3,3001);for(var b=0,c=0;c<a.g.byteLength;c++){var d=a.g.getUint8(c);b=256*b+d}return b};function bp(a,b,c,d,e,f,g,h,k){function l(){return e}var m=[];a=new Wo(a.g);for(var n=null,p=null;a.ma();){var q=Xo(a);if(187==q.id){var v=cp(q);v&&(q=c*v.gg,v=b+v.Qf,null!=n&&m.push(new Ii(n+g,q+g,l,p,v-1,f,g,h,k)),n=q,p=v)}}null!=n&&m.push(new Ii(n+g,d+g,l,p,null,f,g,h,k));return m}
|
|
582
|
-
function cp(a){var b=new Wo(a.g);a=Xo(b);if(179!=a.id)throw new N(2,3,3013);a=ap(a);b=Xo(b);if(183!=b.id)throw new N(2,3,3012);b=new Wo(b.g);for(var c=0;b.ma();){var d=Xo(b);if(241==d.id){c=ap(d);break}}return{gg:a,Qf:c}};function dp(a,b){var c=Ro(a,b,"Initialization");if(!c)return null;var d=a.H.
|
|
583
|
-
function fp(a,b){var c=Number(Qo(a,gp,"presentationTimeOffset"))||0,d=Qo(a,gp,"timescale"),e=1;d&&(e=If(d)||1);var f=c/e||0,g=dp(a,gp);hp(a,g);var h=Pe(a);return{Bb:function(){var k=Ro(h,gp,"RepresentationIndex"),l=h.H.
|
|
582
|
+
function cp(a){var b=new Wo(a.g);a=Xo(b);if(179!=a.id)throw new N(2,3,3013);a=ap(a);b=Xo(b);if(183!=b.id)throw new N(2,3,3012);b=new Wo(b.g);for(var c=0;b.ma();){var d=Xo(b);if(241==d.id){c=ap(d);break}}return{gg:a,Qf:c}};function dp(a,b){var c=Ro(a,b,"Initialization");if(!c)return null;var d=a.H.za,e=c.getAttribute("sourceURL");e&&(d=kc(a.H.za,[e]));e=0;var f=null;if(c=Bf(c,"range",Ef))e=c.start,f=c.end;return new Gi(function(){return d},e,f,ep(a))}
|
|
583
|
+
function fp(a,b){var c=Number(Qo(a,gp,"presentationTimeOffset"))||0,d=Qo(a,gp,"timescale"),e=1;d&&(e=If(d)||1);var f=c/e||0,g=dp(a,gp);hp(a,g);var h=Pe(a);return{Bb:function(){var k=Ro(h,gp,"RepresentationIndex"),l=h.H.za;k&&(k=k.getAttribute("sourceURL"))&&(l=kc(h.H.za,[k]));k=ip(h);return jp(h,b,g,l,k.start,k.end,f)}}}
|
|
584
584
|
function jp(a,b,c,d,e,f,g){var h,k,l,m,n,p,q,v,y,w,x,D,z,B,F;return L(function(G){if(1==G.g)return h=a.presentationTimeline,k=!a.Wa||!a.U.re,l=a.U.start,m=a.U.duration,n=a.H.mimeType.split("/")[1],p=b,q=null,v=[p(d,e,f),"webm"==n?p(c.sa(),c.pa,c.ha):null],p=null,u(G,Promise.all(v),2);y=G.h;w=y[0];x=y[1]||null;D=null;z=l-g;B=l;F=m?l+m:Infinity;if("mp4"==n)var H=Uo(w,e,d,c,z,B,F);else{H=new Wo(x);if(440786851!=Xo(H).id)throw new N(2,3,3008);var I=Xo(H);if(408125543!=I.id)throw new N(2,3,3009);H=I.g.byteOffset;
|
|
585
585
|
I=new Wo(I.g);for(var J=null;I.ma();){var K=Xo(I);if(357149030==K.id){J=K;break}}if(!J)throw new N(2,3,3010);J=new Wo(J.g);K=1E6;for(I=null;J.ma();){var P=Xo(J);if(2807729==P.id)K=ap(P);else if(17545==P.id)if(4==P.g.byteLength)I=P.g.getFloat32(0);else if(8==P.g.byteLength)I=P.g.getFloat64(0);else throw new N(2,3,3003);}if(null==I)throw new N(2,3,3011);J=K/1E9;I*=J;K=Xo(new Wo(w));if(475249515!=K.id)throw new N(2,3,3007);H=bp(K,H,J,I,d,c,z,B,F)}D=H;h.Gb(D);q=new T(D);k&&q.Xa(B,F,!0);return G["return"](q)})}
|
|
586
586
|
function gp(a){return a.mc}function ip(a){var b=Ro(a,gp,"RepresentationIndex");a=Qo(a,gp,"indexRange");a=Ef(a||"");b&&(a=Bf(b,"range",Ef,a));return a}function hp(a,b){kp(a,b);if(!ip(a))throw new N(2,4,4002);}function kp(a,b){var c=a.H.mimeType.split("/")[1];if(a.H.contentType!=pc&&"mp4"!=c&&"webm"!=c)throw new N(2,4,4006);if("webm"==c&&!b)throw new N(2,4,4005);}
|
|
587
|
-
function ep(a){var b=a.H;return{bandwidth:a.bandwidth,audioSamplingRate:b.audioSamplingRate,codecs:b.codecs,contentType:b.contentType,frameRate:b.frameRate||null,height:b.height||null,mimeType:b.mimeType,channelsCount:b.Nc,pixelAspectRatio:b.pixelAspectRatio||null,width:b.width||null}};function lp(a,b){var c=dp(a,mp),d=np(a);if(!d.ja&&!d.timeline&&1<d.Db.length)throw new N(2,4,4002);if(!d.ja&&!a.U.duration&&!d.timeline&&1==d.Db.length)throw new N(2,4,4002);if(d.timeline&&0==d.timeline.length)throw new N(2,4,4002);var e=null,f=null;a.aa.id&&a.H.id&&(f=b[a.aa.id+","+a.H.id])&&(e=f.segmentIndex);var g=op(a.U.start,a.U.duration,a.H.
|
|
588
|
-
Infinity,c);f&&(f.segmentIndex=e);return{Bb:function(){e&&0!=e.K.length||e.Eb(g);return Promise.resolve(e)}}}function mp(a){return a.$a}function np(a){var b=pp(a);a=Po(a,mp);var c=a.Lb;0==c&&(c=1);var d=0;a.ja?d=a.ja*(c-1):a.timeline&&0<a.timeline.length&&(d=a.timeline[0].start);return{ja:a.ja,startTime:d,Lb:c,
|
|
589
|
-
function op(a,b,c,d,e){var f=d.Db.length;d.timeline&&d.timeline.length!=d.Db.length&&(f=Math.min(d.timeline.length,d.Db.length));for(var g=a-d.
|
|
590
|
-
function pp(a){return[a.H.$a,a.ga.$a,a.aa.$a].filter(Rb).map(function(b){return tf(b,"SegmentURL")}).reduce(function(b,c){return 0<b.length?b:c}).map(function(b){b.getAttribute("indexRange")&&!a.pe&&(a.pe=!0);var c=b.getAttribute("media");b=Bf(b,"mediaRange",Ef,{start:0,end:null});return{Hf:c,start:b.start,end:b.end}})};function qp(a,b,c,d,e,f){var g=rp(a),h=sp(a);tp(h);var k=Pe(a);if(h.hc)return kp(a,g),{Bb:function(){var q=Oo(h.hc,k.H.id,null,k.bandwidth||null,null);q=kc(k.H.
|
|
591
|
-
Infinity,p=Infinity!=n;l?(p&&(new T(m)).Xa(c,n,!0),l.Fb(m,a.presentationTimeline.
|
|
587
|
+
function ep(a){var b=a.H;return{bandwidth:a.bandwidth,audioSamplingRate:b.audioSamplingRate,codecs:b.codecs,contentType:b.contentType,frameRate:b.frameRate||null,height:b.height||null,mimeType:b.mimeType,channelsCount:b.Nc,pixelAspectRatio:b.pixelAspectRatio||null,width:b.width||null}};function lp(a,b){var c=dp(a,mp),d=np(a);if(!d.ja&&!d.timeline&&1<d.Db.length)throw new N(2,4,4002);if(!d.ja&&!a.U.duration&&!d.timeline&&1==d.Db.length)throw new N(2,4,4002);if(d.timeline&&0==d.timeline.length)throw new N(2,4,4002);var e=null,f=null;a.aa.id&&a.H.id&&(f=b[a.aa.id+","+a.H.id])&&(e=f.segmentIndex);var g=op(a.U.start,a.U.duration,a.H.za,d,c);c=!e;e?e.Fb(g,a.presentationTimeline.Qa()):e=new T(g);a.presentationTimeline.Gb(g);a.Wa&&a.U.re||e.Xa(a.U.start,a.U.duration?a.U.start+a.U.duration:
|
|
588
|
+
Infinity,c);f&&(f.segmentIndex=e);return{Bb:function(){e&&0!=e.K.length||e.Eb(g);return Promise.resolve(e)}}}function mp(a){return a.$a}function np(a){var b=pp(a);a=Po(a,mp);var c=a.Lb;0==c&&(c=1);var d=0;a.ja?d=a.ja*(c-1):a.timeline&&0<a.timeline.length&&(d=a.timeline[0].start);return{ja:a.ja,startTime:d,Lb:c,Ta:a.Ta,timeline:a.timeline,Db:b}}
|
|
589
|
+
function op(a,b,c,d,e){var f=d.Db.length;d.timeline&&d.timeline.length!=d.Db.length&&(f=Math.min(d.timeline.length,d.Db.length));for(var g=a-d.Ta,h=b?a+b:Infinity,k=[],l=d.startTime,m={},n=0;n<f;m={cd:m.cd},n++){var p=d.Db[n];m.cd=kc(c,[p.Hf]);var q=void 0;q=null!=d.ja?l+d.ja:d.timeline?d.timeline[n].end:l+b;k.push(new Ii(a+l,a+q,function(v){return function(){return v.cd}}(m),p.start,p.end,e,g,a,h));l=q}return k}
|
|
590
|
+
function pp(a){return[a.H.$a,a.ga.$a,a.aa.$a].filter(Rb).map(function(b){return tf(b,"SegmentURL")}).reduce(function(b,c){return 0<b.length?b:c}).map(function(b){b.getAttribute("indexRange")&&!a.pe&&(a.pe=!0);var c=b.getAttribute("media");b=Bf(b,"mediaRange",Ef,{start:0,end:null});return{Hf:c,start:b.start,end:b.end}})};function qp(a,b,c,d,e,f){var g=rp(a),h=sp(a);tp(h);var k=Pe(a);if(h.hc)return kp(a,g),{Bb:function(){var q=Oo(h.hc,k.H.id,null,k.bandwidth||null,null);q=kc(k.H.za,[q]);return jp(k,b,g,q,0,null,h.Ta)}};if(h.ja)return d||"image"===a.ga.contentType||(a.presentationTimeline.Hd(h.ja),a.presentationTimeline.Id(a.U.start)),{Bb:function(){return up(k,h,e,g,f)}};var l=null;d=d=null;a.aa.id&&a.H.id&&(d=a.aa.id+","+a.H.id,d=c[d])&&(l=d.segmentIndex);var m=vp(k,h,g);c=a.U.start;var n=a.U.duration?a.U.start+a.U.duration:
|
|
591
|
+
Infinity,p=Infinity!=n;l?(p&&(new T(m)).Xa(c,n,!0),l.Fb(m,a.presentationTimeline.Qa())):l=new T(m);a.presentationTimeline.Gb(m);p&&l.Xa(c,n);d&&a.Wa&&(d.segmentIndex=l);return{Bb:function(){l&&0!=l.K.length||l.Eb(m);return Promise.resolve(l)}}}function wp(a){return a.nc}function sp(a){var b=Po(a,wp),c=Qo(a,wp,"media");a=Qo(a,wp,"index");return{ja:b.ja,timescale:b.timescale,Lb:b.Lb,Ta:b.Ta,ce:b.ce,timeline:b.timeline,Fd:c,hc:a}}
|
|
592
592
|
function tp(a){var b=a.hc?1:0;b+=a.timeline?1:0;b+=a.ja?1:0;if(0==b)throw new N(2,4,4002);1!=b&&(a.hc&&(a.timeline=null),a.ja=null);if(!a.hc&&!a.Fd)throw new N(2,4,4002);}
|
|
593
|
-
function up(a,b,c,d,e){function f(J){var K=(J-q)*p,P=K+b.
|
|
594
|
-
y=b.Fd,w=a.bandwidth||null,x=a.H.id,D=a.H.
|
|
595
|
-
function vp(a,b,c){var d=a.U.start,e=a.U.duration,f=d-b.
|
|
596
|
-
function rp(a){var b=Qo(a,wp,"initialization");if(!b)return null;var c=a.H.id,d=a.bandwidth||null,e=a.H.
|
|
593
|
+
function up(a,b,c,d,e){function f(J){var K=(J-q)*p,P=K+b.Ta,R=K+l;K=R+p;var ba=Math.min(K,h());R=new Ii(R,ba,function(){var aa=Oo(y,x,J,w,P*v);return kc(D,[aa])},0,null,d,z,l,h());R.l=K;return R}function g(){var J=[Math.max(k.Qa(),l),Math.min(k.hb(),h())].map(function(K){return K-l});return[Math.ceil(J[0]/p),Math.ceil(J[1]/p)-1].map(function(K){return K+q})}function h(){var J=null!=m&&e[m]||n;return J?l+J:Infinity}var k=a.presentationTimeline,l=a.U.start,m=a.aa.id,n=a.U.duration,p=b.ja,q=b.Lb,v=b.timescale,
|
|
594
|
+
y=b.Fd,w=a.bandwidth||null,x=a.H.id,D=a.H.za,z=l-b.Ta,B=g();a=a.Wa?Math.max(B[0],B[1]-c+1):B[0];B=B[1];c=[];for(var F=a;F<=B;++F){var G=f(F);c.push(G)}var H=new T(c);c=k.hb()<h();F=k.T();if(c||F){var I=Math.max(a,B+1);H.Uc(p,function(){var J=k.Qa();H.eb(J);var K=t(g());K.next();K=K.next().value;for(var P=[];I<=K;){var R=f(I);P.push(R);I++}return J>h()&&!P.length?null:P})}return Promise.resolve(H)}
|
|
595
|
+
function vp(a,b,c){var d=a.U.start,e=a.U.duration,f=d-b.Ta;e=e?d+e:Infinity;for(var g=[],h={},k=0;k<b.timeline.length;h={bd:h.bd,fd:h.fd,jd:h.jd,Zc:h.Zc,ld:h.ld,$c:h.$c},k++){var l=b.timeline[k],m=l.start,n=l.fg;l=l.end;h.jd=k+b.Lb;h.ld=n+b.ce;h.fd=a.H.id;h.Zc=a.bandwidth||null;h.bd=b.Fd;h.$c=a.H.za;g.push(new Ii(d+m,d+l,function(p){return function(){var q=Oo(p.bd,p.fd,p.jd,p.Zc||null,p.ld);return kc(p.$c,[q]).map(function(v){return v.toString()})}}(h),0,null,c,f,d,e))}return g}
|
|
596
|
+
function rp(a){var b=Qo(a,wp,"initialization");if(!b)return null;var c=a.H.id,d=a.bandwidth||null,e=a.H.za;return new Gi(function(){var f=Oo(b,c,null,d,null);return kc(e,[f])},0,null,ep(a))};function xp(){this.l=[];this.g=[];this.h=[];this.j=[];this.i=[];this.m=new Set}xp.prototype.release=function(){for(var a=t(this.g.concat(this.h,this.j,this.i)),b=a.next();!b.done;b=a.next())b=b.value,b.segmentIndex&&b.segmentIndex.release();this.g=[];this.h=[];this.j=[];this.i=[];this.l=[]};
|
|
597
597
|
function yp(a,b,c){var d,e,f,g,h,k,l,m,n,p,q,v,y,w,x,D,z,B,F,G,H,I,J,K,P,R,ba,aa,Y,Da;return L(function(Fa){switch(Fa.g){case 1:d=qc;zp(b);Ap(b);Bp(b);Cp(b);if(!c&&1==b.length){e=b[0];a.g=e.xc;a.h=e.Wc;a.j=e.textStreams;a.i=e.imageStreams;Fa.B(2);break}f=-1;for(g=0;g<b.length;g++)h=b[g],a.m.has(h.id)||(a.m.add(h.id),-1==f&&(f=g));if(-1==f)return Fa["return"]();k=b.map(function(xa){return xa.xc});l=b.map(function(xa){return xa.Wc});m=b.map(function(xa){return xa.textStreams});n=b.map(function(xa){return xa.imageStreams});
|
|
598
598
|
p=t(m);for(q=p.next();!q.done;q=p.next())v=q.value,v.push(Dp(d.Z));y=t(n);for(w=y.next();!w.done;w=y.next())x=w.value,x.push(Dp(d.Sb));return u(Fa,Ep(a.g,k,f,Fp,Gp),3);case 3:return u(Fa,Ep(a.h,l,f,Fp,Gp),4);case 4:return u(Fa,Ep(a.j,m,f,Fp,Gp),5);case 5:return u(Fa,Ep(a.i,n,f,Fp,Gp),2);case 2:D=0;z=[];if(a.h.length&&a.g.length)for(J=t(a.g),K=J.next();!K.done;K=J.next())for(P=K.value,R=t(a.h),ba=R.next();!ba.done;ba=R.next())aa=ba.value,Y=xg(P.drmInfos,aa.drmInfos),P.drmInfos.length&&aa.drmInfos.length&&
|
|
599
|
-
!Y.length||(Da=D++,z.push({id:Da,language:P.language,primary:P.primary,audio:P,video:aa,bandwidth:(P.bandwidth||0)+(aa.bandwidth||0),drmInfos:Y,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]}));else for(B=a.h.concat(a.g),F=t(B),G=F.next();!G.done;G=F.next())H=G.value,I=D++,z.push({id:I,language:H.language,primary:H.primary,audio:H.type==d.cb?H:null,video:H.type==d.
|
|
599
|
+
!Y.length||(Da=D++,z.push({id:Da,language:P.language,primary:P.primary,audio:P,video:aa,bandwidth:(P.bandwidth||0)+(aa.bandwidth||0),drmInfos:Y,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]}));else for(B=a.h.concat(a.g),F=t(B),G=F.next();!G.done;G=F.next())H=G.value,I=D++,z.push({id:I,language:H.language,primary:H.primary,audio:H.type==d.cb?H:null,video:H.type==d.Na?H:null,bandwidth:H.bandwidth||0,drmInfos:H.drmInfos,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]});
|
|
600
600
|
a.l=z;A(Fa)}})}function zp(a){a=t(a);for(var b=a.next();!b.done;b=a.next()){b=b.value;for(var c=[],d=t(b.xc),e=d.next();!e.done;e=d.next()){e=e.value;for(var f=!1,g=t(c),h=g.next();!h.done;h=g.next())h=h.value,e.id!=h.id&&e.channelsCount==h.channelsCount&&e.language==h.language&&e.bandwidth==h.bandwidth&&e.label==h.label&&e.codecs==h.codecs&&e.mimeType==h.mimeType&&gb(e.roles,h.roles)&&e.audioSamplingRate==h.audioSamplingRate&&e.primary==h.primary&&(f=!0);f||c.push(e)}b.xc=c}}
|
|
601
601
|
function Bp(a){a=t(a);for(var b=a.next();!b.done;b=a.next()){b=b.value;for(var c=[],d=t(b.textStreams),e=d.next();!e.done;e=d.next()){e=e.value;for(var f=!1,g=t(c),h=g.next();!h.done;h=g.next())h=h.value,e.id!=h.id&&e.language==h.language&&e.label==h.label&&e.codecs==h.codecs&&e.mimeType==h.mimeType&&e.bandwidth==h.bandwidth&&gb(e.roles,h.roles)&&(f=!0);f||c.push(e)}b.textStreams=c}}
|
|
602
602
|
function Ap(a){a=t(a);for(var b=a.next();!b.done;b=a.next()){b=b.value;for(var c=[],d=t(b.Wc),e=d.next();!e.done;e=d.next()){e=e.value;for(var f=!1,g=t(c),h=g.next();!h.done;h=g.next())h=h.value,e.id!=h.id&&e.width==h.width&&e.frameRate==h.frameRate&&e.codecs==h.codecs&&e.mimeType==h.mimeType&&e.label==h.label&&gb(e.roles,h.roles)&&rf(e.closedCaptions,h.closedCaptions)&&e.bandwidth==h.bandwidth&&(f=!0);f||c.push(e)}b.Wc=c}}
|
|
603
603
|
function Cp(a){a=t(a);for(var b=a.next();!b.done;b=a.next()){b=b.value;for(var c=[],d=t(b.imageStreams),e=d.next();!e.done;e=d.next()){e=e.value;for(var f=!1,g=t(c),h=g.next();!h.done;h=g.next())h=h.value,e.id!=h.id&&e.width==h.width&&e.codecs==h.codecs&&e.mimeType==h.mimeType&&(f=!0);f||c.push(e)}b.imageStreams=c}}
|
|
604
|
-
function Hp(a){var b,c,d,e,f,g,h,k,l,m,n,p,q,v,y,w,x,D,z,B,F,G,H,I,J,K,P;return L(function(R){switch(R.g){case 1:b=qc;if(1==a.length)return R["return"](a[0]);c=a.map(function(ba){return ba.filter(function(aa){return aa.type==b.cb})});d=a.map(function(ba){return ba.filter(function(aa){return aa.type==b.
|
|
604
|
+
function Hp(a){var b,c,d,e,f,g,h,k,l,m,n,p,q,v,y,w,x,D,z,B,F,G,H,I,J,K,P;return L(function(R){switch(R.g){case 1:b=qc;if(1==a.length)return R["return"](a[0]);c=a.map(function(ba){return ba.filter(function(aa){return aa.type==b.cb})});d=a.map(function(ba){return ba.filter(function(aa){return aa.type==b.Na})});e=a.map(function(ba){return ba.filter(function(aa){return aa.type==b.Z})});f=a.map(function(ba){return ba.filter(function(aa){return aa.type==b.Sb})});g=t(e);for(h=g.next();!h.done;h=g.next())k=
|
|
605
605
|
h.value,k.push(Ip(b.Z));l=t(f);for(m=l.next();!m.done;m=l.next())n=m.value,n.push(Ip(b.Sb));return u(R,Ep([],c,0,Jp,Kp),2);case 2:return p=R.h,u(R,Ep([],d,0,Jp,Kp),3);case 3:return q=R.h,u(R,Ep([],e,0,Jp,Kp),4);case 4:return v=R.h,u(R,Ep([],f,0,Jp,Kp),5);case 5:y=R.h;w=0;if(q.length&&p.length)for(F=t(p),G=F.next();!G.done;G=F.next())for(H=G.value,I=t(q),J=I.next();!J.done;J=I.next())K=J.value,P=w++,K.variantIds.push(P),H.variantIds.push(P);else for(x=q.concat(p),D=t(x),z=D.next();!z.done;z=D.next())B=
|
|
606
606
|
z.value,B.variantIds=[w++];return R["return"](q.concat(p).concat(v).concat(y))}})}
|
|
607
607
|
function Ep(a,b,c,d,e){var f,g,h,k,l,m,n,p,q,v,y,w,x,D,z,B,F,G,H,I,J;return L(function(K){switch(K.g){case 1:f=qc;g=[];for(h=0;h<b.length;h++)h>=c?g.push(new Set(b[h])):g.push(new Set);k=t(a);l=k.next();case 2:if(l.done){K.B(4);break}m=l.value;return u(K,Lp(m,b,c,e,g),5);case 5:n=K.h;if(!n)throw new N(2,4,4037);l=k.next();K.B(2);break;case 4:p=t(g);for(q=p.next();!q.done;q=p.next())for(v=q.value,y=t(v),w=y.next();!w.done;w=y.next())x=w.value,(D=Mp(x,b,d,e,g))&&a.push(D);z=t(g);for(q=z.next();!q.done;q=
|
|
@@ -627,12 +627,12 @@ r.stop=function(){for(var a=t(Object.values(this.l)),b=a.next();!b.done;b=a.next
|
|
|
627
627
|
function dq(a){var b,c,d,e,f,g,h;return L(function(k){if(1==k.g)return b=We(a.m,a.g.retryParameters),c=a.h.networkingEngine,a.h.modifyManifestRequest(b,{format:"d"}),d=Date.now(),e=c.request(0,b),Re(a.o,e),u(k,e.promise,2);if(3!=k.g){f=k.h;if(!a.h)return k["return"](0);f.uri&&!a.m.includes(f.uri)&&a.m.unshift(f.uri);return u(k,fq(a,f.data,f.uri),3)}g=Date.now();h=(g-d)/1E3;a.I.sample(1,h);return k["return"](h)})}
|
|
628
628
|
function fq(a,b,c){var d,e,f,g,h;return L(function(k){if(1==k.g){d=Of(b,"MPD");if(!d)throw new N(2,4,4001,c);if(e=a.g.dash.disableXlinkProcessing)return k["return"](gq(a,d,c));f=a.g.dash.xlinkFailGracefully;g=To(d,a.g.retryParameters,f,c,a.h.networkingEngine);Re(a.o,g);return u(k,g.promise,2)}h=k.h;return k["return"](gq(a,h,c))})}
|
|
629
629
|
function gq(a,b,c){var d,e,f,g,h,k,l,m,n,p,q,v,y,w,x,D,z,B,F,G,H,I,J,K,P,R,ba,aa,Y,Da,Fa,xa;return L(function(Ia){switch(Ia.g){case 1:(d=a.g.dash.manifestPreprocessor)&&d(b);e=[c];f=tf(b,"Location").map(zf).filter(Rb);0<f.length&&(g=kc(e,f),e=a.m=g);h=tf(b,"BaseURL");k=h.map(zf);l=kc(e,k);m=0;h&&h.length&&(m=Bf(h[0],"availabilityTimeOffset",Kf)||0);n=a.g.dash.ignoreMinBufferTime;p=0;n||(p=Bf(b,"minBufferTime",Df)||0);a.F=Bf(b,"minimumUpdatePeriod",Df,-1);q=Bf(b,"availabilityStartTime",Cf);v=Bf(b,
|
|
630
|
-
"timeShiftBufferDepth",Df);y=a.g.dash.ignoreSuggestedPresentationDelay;w=null;y||(w=Bf(b,"suggestedPresentationDelay",Df));x=a.g.dash.ignoreMaxSegmentDuration;D=null;x||(D=Bf(b,"maxSegmentDuration",Df));z=b.getAttribute("type")||"static";if(a.i)for(B=a.i.presentationTimeline,F=t(Object.values(a.l)),G=F.next();!G.done;G=F.next())H=G.value,H.segmentIndex&&H.segmentIndex.eb(B.
|
|
630
|
+
"timeShiftBufferDepth",Df);y=a.g.dash.ignoreSuggestedPresentationDelay;w=null;y||(w=Bf(b,"suggestedPresentationDelay",Df));x=a.g.dash.ignoreMaxSegmentDuration;D=null;x||(D=Bf(b,"maxSegmentDuration",Df));z=b.getAttribute("type")||"static";if(a.i)for(B=a.i.presentationTimeline,F=t(Object.values(a.l)),G=F.next();!G.done;G=F.next())H=G.value,H.segmentIndex&&H.segmentIndex.eb(B.Qa());else I=a.g.defaultPresentationDelay||1.5*p,J=null!=w?w:I,B=new S(q,J,a.g.dash.autoCorrectDrift);B.oc("static"==z);(K=B.T())&&
|
|
631
631
|
!isNaN(a.g.availabilityWindowOverride)&&(v=a.g.availabilityWindowOverride);null==v&&(v=Infinity);B.Yd(v);P=b.getAttribute("profiles")||"";R={Wa:"static"!=z,presentationTimeline:B,aa:null,U:null,ga:null,H:null,bandwidth:0,pe:!1,zb:m,profiles:P.split(",")};ba=hq(a,R,l,b);aa=ba.duration;Y=ba.periods;"static"!=z&&ba.ie||B.Ia(aa||Infinity);a.u&&!a.C&&(Da=a.h.isAutoLowLatencyMode())&&(a.h.enableLowLatencyMode(),a.C=a.h.isLowLatencyMode());a.C?B.De(a.u):a.u&&Ua("Low-latency DASH 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.");
|
|
632
632
|
B.Hd(D||1);return u(Ia,yp(a.j,Y,R.Wa),2);case 2:if(a.i){a.i.variants=a.j.l;a.i.textStreams=a.j.j.slice();a.i.imageStreams=a.j.i;a.h.filter(a.i);Ia.B(3);break}a.i={presentationTimeline:B,variants:a.j.l,textStreams:a.j.j.slice(),imageStreams:a.j.i,offlineSessionIds:[],minBufferTime:p||0};if(!B.Ie()){Ia.B(4);break}Fa=tf(b,"UTCTiming");return u(Ia,iq(a,l,Fa),5);case 5:xa=Ia.h;if(!a.h)return Ia["return"]();B.Ee(xa);case 4:B.Bd();case 3:a.h.makeTextStreamsForClosedCaptions(a.i),A(Ia)}})}
|
|
633
633
|
function hq(a,b,c,d){var e=Bf(d,"mediaPresentationDuration",Df),f=[],g=0;d=tf(d,"Period");for(var h=0;h<d.length;h++){var k=d[h],l=d[h+1],m=Bf(k,"start",Df,g),n=k.id,p=Bf(k,"duration",Df),q=null;if(l){var v=Bf(l,"start",Df);null!=v&&(q=v-m)}else null!=e&&(q=e-m);null==q&&(q=p);if(!(null!==a.s&&null!==n&&null!==m&&m<a.s)||a.L.includes(n)||h+1==d.length){null!==m&&(null===a.s||m>a.s)&&(a.s=m);g=jq(a,b,c,{start:m,duration:q,node:k,re:null==q||!l});f.push(g);b.aa.id&&q&&(a.N[b.aa.id]=q);if(null==q){g=
|
|
634
634
|
null;break}g=m+q}}a.L=f.map(function(y){return y.id});return null!=e?{periods:f,duration:e,ie:!1}:{periods:f,duration:g,ie:!0}}
|
|
635
|
-
function jq(a,b,c,d){b.aa=kq(d.node,null,c);b.U=d;b.aa.zb=b.zb;b.aa.id||(b.aa.id="__shaka_period_"+d.start);var e=tf(d.node,"EventStream");c=b.presentationTimeline.
|
|
635
|
+
function jq(a,b,c,d){b.aa=kq(d.node,null,c);b.U=d;b.aa.zb=b.zb;b.aa.id||(b.aa.id="__shaka_period_"+d.start);var e=tf(d.node,"EventStream");c=b.presentationTimeline.Qa();e=t(e);for(var f=e.next();!f.done;f=e.next())lq(a,d.start,d.duration,f.value,c);c=tf(d.node,"AdaptationSet").map(function(m){return mq(a,b,m)}).filter(Rb);if(b.Wa){d=[];e=t(c);for(f=e.next();!f.done;f=e.next()){f=t(f.value.Tf);for(var g=f.next();!g.done;g=f.next())d.push(g.value)}if(d.length!=(new Set(d)).size)throw new N(2,4,4018);
|
|
636
636
|
}d=c.filter(function(m){return!m.ae});c=c.filter(function(m){return m.ae});c=t(c);for(e=c.next();!e.done;e=c.next()){e=e.value;f=e.ae.split(" ");g=t(d);for(var h=g.next();!h.done;h=g.next()){var k=h.value;if(f.includes(k.id)){h={};k=t(k.streams);for(var l=k.next();!l.done;h={vc:h.vc},l=k.next())h.vc=l.value,h.vc.trickModeVideo=e.streams.find(function(m){return function(n){return cd(m.vc.codecs)==cd(n.codecs)}}(h))}}}e=a.g.disableAudio?[]:nq(d,"audio");g=a.g.disableVideo?[]:nq(d,"video");f=a.g.disableText?
|
|
637
637
|
[]:nq(d,pc);c=a.g.disableThumbnails?[]:nq(d,"image");if(!g.length&&!e.length)throw new N(2,4,4004);d=[];e=t(e);for(h=e.next();!h.done;h=e.next())d.push.apply(d,ja(h.value.streams));e=[];g=t(g);for(h=g.next();!h.done;h=g.next())e.push.apply(e,ja(h.value.streams));g=[];f=t(f);for(h=f.next();!h.done;h=f.next())g.push.apply(g,ja(h.value.streams));f=[];c=t(c);for(h=c.next();!h.done;h=c.next())f.push.apply(f,ja(h.value.streams));return{id:b.aa.id,xc:d,Wc:e,textStreams:g,imageStreams:f}}
|
|
638
638
|
function nq(a,b){return a.filter(function(c){return c.contentType==b})}
|
|
@@ -642,13 +642,13 @@ l}}var n;m=tf(c,"EssentialProperty");f=null;l=!1;m=t(m);for(var p=m.next();!p.do
|
|
|
642
642
|
1,null!=q)for(q=t(q.split(";")),w=q.next();!w.done;w=q.next())w=w.value,x=y=void 0,w.includes("=")?(w=w.split("="),y="svc"+w[0],x=w[1].split(",")[0].split(":").pop()):(y="svc"+p,p++,x=w),v.set(y,rd(x));else v.set("svc1","und");else"urn:mpeg:dash:role:2011"==p&&null!=q&&(g.push(q),"captions"==q&&(h="caption"));if(l)return null;l=tf(c,"ContentProtection");var z=Eo(l,a.g.dash.ignoreDrmInfo,a.g.dash.keySystemsByURI),B=rd(c.getAttribute("lang")||"und"),F=c.getAttribute("label");(l=tf(c,"Label"))&&l.length&&
|
|
643
643
|
(l=l[0],l.textContent&&(F=l.textContent));l=tf(c,"Representation");c=l.map(function(G){if(G=oq(a,b,z,h,B,F,e,g,v,G))G.hdr=G.hdr||n;return G}).filter(function(G){return!!G});if(0==c.length){f="image"==b.ga.contentType;if(a.g.dash.ignoreEmptyAdaptationSet||k||f)return null;throw new N(2,4,4003);}if(!b.ga.contentType||"application"==b.ga.contentType)for(b.ga.contentType=pq(c[0].mimeType,c[0].codecs),k=t(c),m=k.next();!m.done;m=k.next())m.value.type=b.ga.contentType;k=t(c);for(m=k.next();!m.done;m=k.next())for(m=
|
|
644
644
|
m.value,p=t(z.drmInfos),q=p.next();!q.done;q=p.next())q=q.value,q.keyIds=q.keyIds&&m.keyIds?new Set([].concat(ja(q.keyIds),ja(m.keyIds))):q.keyIds||m.keyIds;k=l.map(function(G){return G.getAttribute("id")}).filter(Rb);return{id:b.ga.id||"__fake__"+a.G++,contentType:b.ga.contentType,language:B,Pg:e,streams:c,drmInfos:z.drmInfos,ae:f,Tf:k}}
|
|
645
|
-
function oq(a,b,c,d,e,f,g,h,k,l){b.H=kq(l,b.ga,null);a.u=Math.min(a.u,b.H.zb);if(!qq(b.H))return null;var m=b.U.start;b.bandwidth=Bf(l,"bandwidth",If)||0;var n=b.H.contentType,p=n==pc||"application"==n;n="image"==n;try{var q=function(H,I,J){return rq(a,H,I,J)};if(b.H.mc)var v=fp(b,q);else if(b.H.$a)v=lp(b,a.l);else if(b.H.nc)v=qp(b,q,a.l,!!a.i,a.g.dash.initialSegmentLimit,a.N);else{var y=b.H.
|
|
645
|
+
function oq(a,b,c,d,e,f,g,h,k,l){b.H=kq(l,b.ga,null);a.u=Math.min(a.u,b.H.zb);if(!qq(b.H))return null;var m=b.U.start;b.bandwidth=Bf(l,"bandwidth",If)||0;var n=b.H.contentType,p=n==pc||"application"==n;n="image"==n;try{var q=function(H,I,J){return rq(a,H,I,J)};if(b.H.mc)var v=fp(b,q);else if(b.H.$a)v=lp(b,a.l);else if(b.H.nc)v=qp(b,q,a.l,!!a.i,a.g.dash.initialSegmentLimit,a.N);else{var y=b.H.za,w=b.U.duration||0;v={Bb:function(){return Promise.resolve(fj(m,w,y))}}}}catch(H){if((p||n)&&4002==H.code)return null;
|
|
646
646
|
throw H;}q=tf(l,"ContentProtection");q=Ho(q,c,a.g.dash.ignoreDrmInfo,a.g.dash.keySystemsByURI);q=new Set(q?[q]:[]);var x=!1;tf(l,"SupplementalProperty").some(function(H){return"tag:dolby.com,2018:dash:EC3_ExtensionType:2018"==H.getAttribute("schemeIdUri")&&"JOC"==H.getAttribute("value")})&&(x=!0);var D=!1;p&&(D=h.includes("forced_subtitle")||h.includes("forced-subtitle"));var z;if(n&&((l=tf(l,"EssentialProperty").find(function(H){return["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"].includes(H.getAttribute("schemeIdUri"))}))&&
|
|
647
647
|
(z=l.getAttribute("value")),!z))return null;var B;l=b.H.codecs;b.profiles.includes("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")&&(l.includes("hvc1.2.4.L153.B0")||l.includes("hev1.2.4.L153.B0"))&&(B="PQ");var F=b.H.id?b.aa.id+","+b.H.id:"",G={id:a.G++,originalId:b.H.id,createSegmentIndex:function(){var H,I,J;return L(function(K){if(1==K.g){I=(H=F&&b.Wa&&a.l[F])?a.l[F]:G;if(I.segmentIndex)return K.B(0);J=I;return u(K,v.Bb(),3)}J.segmentIndex=K.h;A(K)})},closeSegmentIndex:function(){G.segmentIndex&&
|
|
648
648
|
(G.segmentIndex.release(),G.segmentIndex=null)},segmentIndex:null,mimeType:b.H.mimeType,codecs:b.H.codecs,frameRate:b.H.frameRate,pixelAspectRatio:b.H.pixelAspectRatio,bandwidth:b.bandwidth,width:b.H.width,height:b.H.height,kind:d,encrypted:0<c.drmInfos.length,drmInfos:c.drmInfos,keyIds:q,language:e,label:f,type:b.ga.contentType,primary:g,trickModeVideo:null,emsgSchemeIdUris:b.H.emsgSchemeIdUris,roles:h,forced:D,channelsCount:b.H.Nc,audioSamplingRate:b.H.audioSamplingRate,spatialAudio:x,closedCaptions:k,
|
|
649
649
|
hdr:B,tilesLayout:z,matchedStreams:[]};F&&b.Wa&&!a.l[F]&&(a.l[F]=G);return G}function cq(a){var b,c;L(function(d){switch(d.g){case 1:return b=0,C(d,2),u(d,dq(a),4);case 4:b=d.h;va(d,3);break;case 2:c=E(d),a.h&&(c.severity=1,a.h.onError(c));case 3:if(!a.h)return d["return"]();eq(a,b);A(d)}})}function eq(a,b){0>a.F||a.D.S(Math.max(3,a.F-b,Qa(a.I)))}
|
|
650
|
-
function kq(a,b,c){b=b||{contentType:"",mimeType:"",codecs:"",emsgSchemeIdUris:[],frameRate:void 0,pixelAspectRatio:void 0,Nc:null,audioSamplingRate:null,zb:0};c=c||b.
|
|
651
|
-
m.next())p=p.value.getAttribute("schemeIdUri"),n.includes(p)||n.push(p);m=tf(a,"AudioChannelConfiguration");m=sq(m)||b.Nc;p=Bf(a,"audioSamplingRate",Jf)||b.audioSamplingRate;f||(f=pq(g,h));var q=sf(a,"SegmentBase"),v=sf(a,"SegmentTemplate"),y=q?Bf(q,"availabilityTimeOffset",Kf)||0:0,w=v?Bf(v,"availabilityTimeOffset",Kf)||0:0;d=d&&d.length?Bf(d[0],"availabilityTimeOffset",Kf)||0:0;d=b.zb+d+y+w;return{
|
|
650
|
+
function kq(a,b,c){b=b||{contentType:"",mimeType:"",codecs:"",emsgSchemeIdUris:[],frameRate:void 0,pixelAspectRatio:void 0,Nc:null,audioSamplingRate:null,zb:0};c=c||b.za;var d=tf(a,"BaseURL"),e=d.map(zf),f=a.getAttribute("contentType")||b.contentType,g=a.getAttribute("mimeType")||b.mimeType,h=a.getAttribute("codecs")||b.codecs,k=Bf(a,"frameRate",Lf)||b.frameRate,l=a.getAttribute("sar")||b.pixelAspectRatio,m=tf(a,"InbandEventStream"),n=b.emsgSchemeIdUris.slice();m=t(m);for(var p=m.next();!p.done;p=
|
|
651
|
+
m.next())p=p.value.getAttribute("schemeIdUri"),n.includes(p)||n.push(p);m=tf(a,"AudioChannelConfiguration");m=sq(m)||b.Nc;p=Bf(a,"audioSamplingRate",Jf)||b.audioSamplingRate;f||(f=pq(g,h));var q=sf(a,"SegmentBase"),v=sf(a,"SegmentTemplate"),y=q?Bf(q,"availabilityTimeOffset",Kf)||0:0,w=v?Bf(v,"availabilityTimeOffset",Kf)||0:0;d=d&&d.length?Bf(d[0],"availabilityTimeOffset",Kf)||0:0;d=b.zb+d+y+w;return{za:kc(c,e),mc:q||b.mc,$a:sf(a,"SegmentList")||b.$a,nc:v||b.nc,width:Bf(a,"width",Jf)||b.width,height:Bf(a,
|
|
652
652
|
"height",Jf)||b.height,contentType:f,mimeType:g,codecs:h,frameRate:k,pixelAspectRatio:l,emsgSchemeIdUris:n,id:a.getAttribute("id"),Nc:m,audioSamplingRate:p,zb:d}}
|
|
653
653
|
function sq(a){a=t(a);for(var b=a.next();!b.done;b=a.next()){var c=b.value;if(b=c.getAttribute("schemeIdUri"))if(c=c.getAttribute("value"))switch(b){case "urn:mpeg:dash:outputChannelPositionList:2012":return c.trim().split(/ +/).length;case "urn:mpeg:dash:23003:3:audio_channel_configuration:2011":case "urn:dts:dash:audio_channel_configuration:2012":b=parseInt(c,10);if(!b)continue;return b;case "tag:dolby.com,2014:dash:audio_channel_configuration:2011":case "urn:dolby:dash:audio_channel_configuration:2011":b=
|
|
654
654
|
parseInt(c,16);if(!b)continue;for(a=0;b;)b&1&&++a,b>>=1;return a;case "urn:mpeg:mpegB:cicp:ChannelConfiguration":if(b=[0,1,2,3,4,5,6,8,2,3,4,7,8,24,8,12,10,12,14,12,14],(c=parseInt(c,10))&&0<c&&c<b.length)return b[c]}}return null}function qq(a){var b=a.mc?1:0;b+=a.$a?1:0;b+=a.nc?1:0;if(0==b)return a.contentType==pc||"application"==a.contentType?!0:!1;1!=b&&(a.mc&&(a.$a=null),a.nc=null);return!0}
|
|
@@ -663,14 +663,14 @@ function Iq(a,b,c){b=Jc(b);b=b.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n").trim();var d
|
|
|
663
663
|
var l=d.splice(g,d.length-g);d=c;e=[];g=[];k=[];h=null;l=t(l);for(var m=l.next();!m.done;m=l.next())m=m.value,/^(#EXT)/.test(m)?(m=Jq(a,m),Kq.includes(m.name)?f.push(m):"EXT-X-MAP"==m.name?h=m:"EXT-X-PART"==m.name?k.push(m):"EXT-X-PRELOAD-HINT"==m.name?"PART"==Z(m,"TYPE")?k.push(m):"MAP"==Z(m,"TYPE")&&(m.name="EXT-X-MAP",h=m):g.push(m)):/^#(?!EXT)/m.test(m)||(m=kc([d],[m.trim()])[0],h&&g.push(h),e.push(new xq(m,g,k)),g=[],k=[]);k.length&&(h&&g.push(h),e.push(new xq("",g,k)));return new uq(c,b,f,e)}f.push(h);
|
|
664
664
|
"EXT-X-STREAM-INF"==h.name&&(h.g.push(new yq("URI",k)),e=!0)}}return new uq(c,b,f)}function Jq(a,b){var c=a.g++,d=b.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!d)throw new N(2,4,4016,b);var e=d[1],f=d[2];d=[];var g;if(f){f=new Dq(f);var h;(h=Fq(f,/^([^,=]+)(?:,|$)/g))&&(g=h[1]);for(var k=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;h=Fq(f,k);)d.push(new yq(h[1],h[2]||h[3])),Eq(f)}return new vq(c,e,d,g)}
|
|
665
665
|
var Kq="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".split(" "),Lq="EXTINF EXT-X-BYTERANGE EXT-X-DISCONTINUITY EXT-X-PROGRAM-DATE-TIME EXT-X-KEY EXT-X-DATERANGE EXT-X-MAP".split(" ");function Mq(){}function Nq(a){try{var b=Oq(a);return Ie({uri:a,ve:a,data:b.data,headers:{"content-type":b.contentType}})}catch(c){return Ge(c)}}function Oq(a){var b=a.split(":");if(2>b.length||"data"!=b[0])throw new N(2,1,1004,a);b=b.slice(1).join(":").split(",");if(2>b.length)throw new N(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=Sc(a):e=Nc(a);return{data:e,contentType:c}}
|
|
666
|
-
M("shaka.net.DataUriPlugin",Mq);Mq.parse=Nq;Te("data",Nq);function Pq(){var a=this;this.g=this.i=null;this.
|
|
667
|
-
r.start=function(a,b){var c=this,d,e;return L(function(f){if(1==f.g)return c.i=b,c.l=b.isLowLatencyMode(),u(f,Sq(c,a),2);if(3!=f.g)return d=f.h,c.N=d.uri,u(f,Tq(c,d.data),3);e=c.
|
|
666
|
+
M("shaka.net.DataUriPlugin",Mq);Mq.parse=Nq;Te("data",Nq);function Pq(){var a=this;this.g=this.i=null;this.La=1;this.o=new Map;this.u=new Map;this.ya=new Set;this.h=new Map;this.j=null;this.N="";this.da=new Hq;this.xa=0;this.C=new O(function(){Qq(a)});this.m=Rq;this.D=null;this.fa=0;this.G=Infinity;this.ca=this.ka=0;this.F=new Qe;this.W=[];this.L=new Map;this.Ma=!1;this.s=new Map;this.V=null;this.ea=new Map;this.I=new Map;this.l=!1}r=Pq.prototype;r.configure=function(a){this.g=a};
|
|
667
|
+
r.start=function(a,b){var c=this,d,e;return L(function(f){if(1==f.g)return c.i=b,c.l=b.isLowLatencyMode(),u(f,Sq(c,a),2);if(3!=f.g)return d=f.h,c.N=d.uri,u(f,Tq(c,d.data),3);e=c.xa;0<e&&c.C.S(e);return f["return"](c.D)})};r.stop=function(){this.C&&(this.C.stop(),this.C=null);var a=[];this.F&&(a.push(this.F.destroy()),this.F=null);this.g=this.i=null;this.ya.clear();this.D=null;this.h.clear();this.u.clear();this.s.clear();this.o.clear();return Promise.all(a)};
|
|
668
668
|
r.update=function(){var a=this,b,c,d;return L(function(e){if(1==e.g){if(a.m==Rq)return e["return"]();b=[];a.V=null;c=Array.from(a.h.values());return c.length?u(e,Uq(a,c[0]),2):e.B(2)}for(d=1;d<c.length;d++)b.push(Uq(a,c[d]));return u(e,Promise.all(b),0)})};
|
|
669
|
-
function Uq(a,b){var c,d,e,f,g,h,k,l,m,n,p,q,v;return L(function(y){if(1==y.g)return c=Vq,d=b.Me,e=new Xb(d),a.l&&b.Re&&$b(e,new bc("_HLS_skip=YES")),u(y,Sq(a,e.toString()),2);if(3!=y.g){f=y.h;g=Iq(a.da,f.data,f.uri);if(1!=g.type)throw new N(2,4,4017);h=zq(g.g,"EXT-X-DEFINE");k=Wq(a,h);l=b.stream;return u(y,Xq(a,b.Vc,g,l.type,l.mimeType,b.Ed,k,b.Ye,l.codecs,l.bandwidth),3)}m=y.h;l.segmentIndex.Fb(m,a.j.
|
|
669
|
+
function Uq(a,b){var c,d,e,f,g,h,k,l,m,n,p,q,v;return L(function(y){if(1==y.g)return c=Vq,d=b.Me,e=new Xb(d),a.l&&b.Re&&$b(e,new bc("_HLS_skip=YES")),u(y,Sq(a,e.toString()),2);if(3!=y.g){f=y.h;g=Iq(a.da,f.data,f.uri);if(1!=g.type)throw new N(2,4,4017);h=zq(g.g,"EXT-X-DEFINE");k=Wq(a,h);l=b.stream;return u(y,Xq(a,b.Vc,g,l.type,l.mimeType,b.Ed,k,b.Ye,l.codecs,l.bandwidth),3)}m=y.h;l.segmentIndex.Fb(m,a.j.Qa());m.length&&(n=Cq(g.g,"EXT-X-MEDIA-SEQUENCE",0),p=b.Ed.get(n),l.segmentIndex.eb(p));q=m[m.length-
|
|
670
670
|
1];if(v=Bq(g.g,"EXT-X-ENDLIST"))Yq(a,c.Le),a.j.Ia(q.endTime);A(y)})}r.onExpirationUpdated=function(){};
|
|
671
671
|
function Tq(a,b){var c,d,e,f,g,h,k,l,m,n,p,q,v,y,w,x,D,z,B,F,G,H,I,J,K,P,R,ba,aa,Y,Da,Fa,xa,Ia,Qb,nd;return L(function(Ya){switch(Ya.g){case 1:c=Iq(a.da,b,a.N);if(0!=c.type)throw new N(2,4,4022);d=zq(c.g,"EXT-X-DEFINE");Zq(a,d);e=zq(c.g,"EXT-X-MEDIA");f=zq(c.g,"EXT-X-STREAM-INF");g=zq(c.g,"EXT-X-IMAGE-STREAM-INF");$q(a,f);h=zq(c.g,"EXT-X-SESSION-DATA");k=t(h);for(l=k.next();!l.done;l=k.next())if(m=l.value,n=Z(m,"DATA-ID"),p=Z(m,"URI"),q=Z(m,"LANGUAGE"),v=Z(m,"VALUE"),y=(new Map).set("id",n),p&&y.set("uri",
|
|
672
|
-
kc([a.N],[p])[0]),q&&y.set("language",q),v&&y.set("value",v),w=new Q("sessiondata",y),a.i)a.i.onEvent(w);return u(Ya,ar(a,e),2);case 2:return br(a,e),u(Ya,cr(a,f),3);case 3:return x=Ya.h,u(Ya,dr(a,e),4);case 4:return D=Ya.h,u(Ya,er(a,g),5);case 5:z=Ya.h;if(!a.i)throw new N(2,7,7001);if(a.
|
|
673
|
-
a.g.defaultPresentationDelay:a.ca?a.ca:3*a.fa),a.j.oc(!1)):(a.j=new S(null,0),a.j.oc(!0));if(a.m!=Rq)a.
|
|
672
|
+
kc([a.N],[p])[0]),q&&y.set("language",q),v&&y.set("value",v),w=new Q("sessiondata",y),a.i)a.i.onEvent(w);return u(Ya,ar(a,e),2);case 2:return br(a,e),u(Ya,cr(a,f),3);case 3:return x=Ya.h,u(Ya,dr(a,e),4);case 4:return D=Ya.h,u(Ya,er(a,g),5);case 5:z=Ya.h;if(!a.i)throw new N(2,7,7001);if(a.Ma&&0==x.length)throw new N(2,4,4034);F=B=Infinity;G=t(a.h.values());for(H=G.next();!H.done;H=G.next())I=H.value,B=Math.min(B,I.se),"text"!=I.stream.type&&(F=Math.min(F,I.Gf-I.se));a.m!=Rq?(a.j=new S(0,a.g.defaultPresentationDelay?
|
|
673
|
+
a.g.defaultPresentationDelay:a.ca?a.ca:3*a.fa),a.j.oc(!1)):(a.j=new S(null,0),a.j.oc(!0));if(a.m!=Rq)a.xa=a.G,J=Vq,a.m==J.Ke&&(K=a.j.Sc,isNaN(a.g.availabilityWindowOverride)||(K=a.g.availabilityWindowOverride),a.j.Yd(K));else for(a.j.Ia(F),a.j.offset(-B),P=t(a.h.values()),H=P.next();!H.done;H=P.next())R=H.value,R.stream.segmentIndex.offset(-B),R.stream.segmentIndex.Xa(0,F);a.W=[];ba=[];aa=t(x);for(Y=aa.next();!Y.done;Y=aa.next())for(Da=Y.value,Fa=t([Da.video,Da.audio]),xa=Fa.next();!xa.done;xa=Fa.next())(Ia=
|
|
674
674
|
xa.value)&&ba.push(Ia);return u(Ya,Promise.all(ba.map(function(Gf){return L(function(Ec){return u(Ec,Gf.createSegmentIndex(),0)})})),6);case 6:Qb=t(ba);for(xa=Qb.next();!xa.done;xa=Qb.next())nd=xa.value,a.W.push(nd.segmentIndex.K);fr(a);a.j.Bd();a.D={presentationTimeline:a.j,variants:x,textStreams:D,imageStreams:z,offlineSessionIds:[],minBufferTime:0};a.i.makeTextStreamsForClosedCaptions(a.D);A(Ya)}})}
|
|
675
675
|
function Zq(a,b){for(var c=t(b),d=c.next();!d.done;d=c.next()){var e=d.value;d=Z(e,"NAME");e=Z(e,"VALUE");d&&e&&(a.o.has(d)||a.o.set(d,e))}}function Wq(a,b){for(var c=new Map,d=t(b),e=d.next();!e.done;e=d.next()){var f=e.value;e=Z(f,"NAME");var g=Z(f,"VALUE");f=Z(f,"IMPORT");e&&g&&c.set(e,g);f&&(e=a.o.get(f))&&c.set(f,e)}return c}
|
|
676
676
|
function $q(a,b){for(var c=t(b),d=c.next();!d.done;d=c.next()){var e=d.value,f=Z(e,"AUDIO");d=Z(e,"VIDEO");var g=Z(e,"SUBTITLES");e=gr(a,e);if(g){var h=nc(pc,e);a.s.set(g,h);fb(e,h)}f&&(g=nc("audio",e),g||(g=a.g.hls.defaultAudioCodec),a.s.set(f,g));d&&(f=nc("video",e),f||(f=a.g.hls.defaultVideoCodec),a.s.set(d,f))}}
|
|
@@ -679,9 +679,9 @@ t(m),p=n.next();!p.done;p=n.next())q=p.value,q.stream.codecs=l;return v["return"
|
|
|
679
679
|
function er(a,b){var c,d;return L(function(e){if(1==e.g)return c=b.map(function(f){var g,h,k;return L(function(l){if(1==l.g){if(g=a.g.disableThumbnails)return l["return"](null);C(l,2);return u(l,ir(a,f),4)}if(2!=l.g)return h=l.h,l["return"](h.stream);k=E(l);if(a.g.hls.ignoreImageStreamFailures)return l["return"](null);throw k;})}),u(e,Promise.all(c),2);d=e.h;return e["return"](d.filter(function(f){return f}))})}
|
|
680
680
|
function ar(a,b){var c;return L(function(d){if(1==d.g)return b=b.filter(function(e){var f=Z(e,"URI")||"";return"SUBTITLES"!=Z(e,"TYPE")&&""!=f}),b.length?u(d,hr(a,b[0]),2):d.B(2);c=b.slice(1).map(function(e){return hr(a,e)});return u(d,Promise.all(c),0)})}
|
|
681
681
|
function cr(a,b){var c,d,e;return L(function(f){if(1==f.g)return c=b.map(function(g){var h,k,l,m,n,p,q,v;return L(function(y){if(1==y.g)return h=Z(g,"FRAME-RATE"),k=Number(Z(g,"AVERAGE-BANDWIDTH"))||Number(wq(g,"BANDWIDTH")),l=Z(g,"RESOLUTION"),m=t(l?l.split("x"):[null,null]),n=m.next().value,p=m.next().value,q=Z(g,"VIDEO-RANGE"),u(y,jr(a,g,k),2);if(v=y.h){for(var w=y["return"],x=v.audio,D=v.video,z=t(D),B=z.next();!B.done;B=z.next())if(B=B.value.stream)B.width=Number(n)||void 0,B.height=Number(p)||
|
|
682
|
-
void 0,B.frameRate=Number(h)||void 0,B.hdr=q||void 0;z=a.g.disableAudio;if(!x.length||z)x=[null];z=a.g.disableVideo;if(!D.length||z)D=[null];z=[];x=t(x);for(B=x.next();!B.done;B=x.next()){B=B.value;for(var F=t(D),G=F.next();!G.done;G=F.next()){var H=G.value;G=B?B.stream:null;var I=H?H.stream:null,J=B?B.stream.drmInfos:null,K=H?H.stream.drmInfos:null;H=(H?H.Vc:"")+" - "+(B?B.Vc:"");G&&I&&J.length&&K.length&&!(0<xg(J,K).length)||a.
|
|
683
|
-
!!I&&I.primary,audio:G,video:I,bandwidth:k,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]},z.push(G),a.
|
|
684
|
-
function jr(a,b,c){var d,e,f,g,h,k,l,m,n,p,q,v,y,w;return L(function(x){if(1==x.g)return d=qc,e=gr(a,b),f=Z(b,"AUDIO"),g=Z(b,"VIDEO"),k=(h=f||g)&&a.u.has(h)?a.u.get(h):[],l={audio:f?k:[],video:g?k:[]},n=!1,p=wq(b,"URI"),q=l.audio.find(function(D){return D&&D.Vc==p}),v=nc(d.
|
|
682
|
+
void 0,B.frameRate=Number(h)||void 0,B.hdr=q||void 0;z=a.g.disableAudio;if(!x.length||z)x=[null];z=a.g.disableVideo;if(!D.length||z)D=[null];z=[];x=t(x);for(B=x.next();!B.done;B=x.next()){B=B.value;for(var F=t(D),G=F.next();!G.done;G=F.next()){var H=G.value;G=B?B.stream:null;var I=H?H.stream:null,J=B?B.stream.drmInfos:null,K=H?H.stream.drmInfos:null;H=(H?H.Vc:"")+" - "+(B?B.Vc:"");G&&I&&J.length&&K.length&&!(0<xg(J,K).length)||a.ya.has(H)||(G={id:a.La++,language:G?G.language:"und",primary:!!G&&G.primary||
|
|
683
|
+
!!I&&I.primary,audio:G,video:I,bandwidth:k,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]},z.push(G),a.ya.add(H))}}y=w.call(y,z)}else y=y["return"]([]);return y})}),u(f,Promise.all(c),2);d=f.h;e=d.reduce(Ob,[]);e=e.filter(function(g){return null!=g});return f["return"](e)})}
|
|
684
|
+
function jr(a,b,c){var d,e,f,g,h,k,l,m,n,p,q,v,y,w;return L(function(x){if(1==x.g)return d=qc,e=gr(a,b),f=Z(b,"AUDIO"),g=Z(b,"VIDEO"),k=(h=f||g)&&a.u.has(h)?a.u.get(h):[],l={audio:f?k:[],video:g?k:[]},n=!1,p=wq(b,"URI"),q=l.audio.find(function(D){return D&&D.Vc==p}),v=nc(d.Na,e),(y=nc(d.cb,e))&&!v?m=d.cb:!k.length&&y&&v?(m=d.Na,e=[[v,y].join()]):l.audio.length&&q?(m=d.cb,n=!0):m=l.video.length&&!l.audio.length?d.cb:d.Na,n?x.B(2):u(x,kr(a,b,e,m,c),3);2!=x.g&&(w=x.h);if(w)l[w.stream.type]=[w];else if(null===
|
|
685
685
|
w)return x["return"](null);lr(l);return x["return"](l)})}function gr(a,b){var c=[];a.g.disableVideo||c.push(a.g.hls.defaultVideoCodec);a.g.disableAudio||c.push(a.g.hls.defaultAudioCodec);var d=Z(b,"CODECS",c.join(",")).split(/\s*,\s*/);c=new Set;var e=[];d=t(d);for(var f=d.next();!f.done;f=d.next()){f=f.value;var g=dd(f)[0];c.has(g)||(e.push(f),c.add(g))}return e}function mr(a){a=Z(a,"LANGUAGE")||"und";return rd(a)}
|
|
686
686
|
function lr(a){a=t(a.audio.concat(a.video));for(var b=a.next();!b.done;b=a.next())if(b=b.value){var c=b.stream.codecs.split(",");c=c.filter(function(d){return"mp4a.40.34"!=d});b.stream.codecs=c.join(",")}}function br(a,b){var c=Aq(b,"CLOSED-CAPTIONS");c=t(c);for(var d=c.next();!d.done;d=c.next()){var e=d.value;d=mr(e);var f=wq(e,"GROUP-ID");e=wq(e,"INSTREAM-ID");a.L.get(f)||a.L.set(f,new Map);a.L.get(f).set(e,d)}}
|
|
687
687
|
function hr(a,b){var c,d,e,f,g,h,k,l,m,n,p,q,v,y;return L(function(w){if(1==w.g){c=wq(b,"GROUP-ID");d="";var x=wq(b,"TYPE").toLowerCase();"subtitles"==x&&(x=pc);e=x;e!=pc&&c&&a.s.has(c)&&(d=a.s.get(c));f=nr(wq(b,"URI"),a.o);if(a.h.has(f))return w["return"](a.h.get(f));g=mr(b);h=Z(b,"NAME");k=Z(b,"DEFAULT");l="YES"==k;"audio"==e?x=(x=Z(b,"CHANNELS"))?parseInt(x.split("/")[0],10):null:x=null;m=x;"audio"==e?x=(x=Z(b,"CHANNELS"))?x.includes("/JOC"):!1:x=!1;n=x;p=Z(b,"CHARACTERISTICS");q=Z(b,"FORCED");
|
|
@@ -690,8 +690,8 @@ function ir(a,b){var c,d,e,f,g,h,k,l,m,n;return L(function(p){if(1==p.g){c=nr(wq
|
|
|
690
690
|
Number(k.split("x")[1])*Number(m.split("x")[1]);if(n=Z(b,"BANDWIDTH"))h.stream.bandwidth=Number(n);a.h.set(c,h);return p["return"](h)})}
|
|
691
691
|
function kr(a,b,c,d,e){var f,g,h,k;return L(function(l){if(1==l.g){f=nr(wq(b,"URI"),a.o);if(a.h.has(f))return l["return"](a.h.get(f));var m=Z(b,"CLOSED-CAPTIONS");g="video"==d&&m&&"NONE"!=m?a.L.get(m):null;h=mc(d,c);return u(l,or(a,f,h,d,"und",!1,null,null,g,null,!1,!1,e),2)}k=l.h;if(null==k)return l["return"](null);if(a.h.has(f))return l["return"](a.h.get(f));a.h.set(f,k);return l["return"](k)})}
|
|
692
692
|
function or(a,b,c,d,e,f,g,h,k,l,m,n,p){var q,v,y,w,x,D,z,B,F,G,H,I,J,K,P,R,ba,aa,Y,Da,Fa,xa,Ia,Qb,nd,Ya,Gf,Ec,ji,Dn,En,Fn,Gn,ki,li,Hf,Hn,In,Jn,Kn;return L(function(cb){switch(cb.g){case 1:return q=kc([a.N],[b])[0],u(cb,Sq(a,q),2);case 2:v=cb.h;q=v.uri;y=Iq(a.da,v.data,q);if(1!=y.type)throw new N(2,4,4017);w=[];if(y.segments)for(x=t(y.segments),D=x.next();!D.done;D=x.next())z=D.value,B=zq(z.g,"EXT-X-KEY"),w.push.apply(w,ja(B));F=!1;G=[];H=new Set;I=t(w);for(J=I.next();!J.done;J=I.next())if(K=J.value,
|
|
693
|
-
P=wq(K,"METHOD"),"NONE"!=P){F=!0;if("AES-128"==P)return a.
|
|
694
|
-
E(cb);if(4035==ji.code)return Ua("Skipping unsupported HLS stream",Qb,b),cb["return"](null);throw ji;case 5:Gf!=a.l&&qr(a,y);Dn=Ec[0].startTime;En=Ec[Ec.length-1].endTime;Fn=new T(Ec);Gn=d==pc?"subtitle":void 0;ki=[];if(l)for(li=t(l.split(",")),Hf=li.next();!Hf.done;Hf=li.next())Hn=Hf.value,ki.push(Hn);Jn=(In=Bq(y.g,"EXT-X-SERVER-CONTROL"))?null!=In.getAttribute("CAN-SKIP-UNTIL"):!1;Kn={id:a.
|
|
693
|
+
P=wq(K,"METHOD"),"NONE"!=P){F=!0;if("AES-128"==P)return a.Ma=!0,cb["return"](null);R=wq(K,"KEYFORMAT");if(aa=(ba=pr[R])?ba(K):null){if(aa.keyIds)for(Y=t(aa.keyIds),Da=Y.next();!Da.done;Da=Y.next())Fa=Da.value,H.add(Fa);G.push(aa)}}if(F&&!G.length)throw new N(2,4,4026);xa=zq(y.g,"EXT-X-DEFINE");Ia=Wq(a,xa);qr(a,y);return u(cb,rr(a,d,c,y,Ia),3);case 3:return Qb=cb.h,sr.includes(Qb)&&(c=""),nd=new Map,Ya=new Map,Gf=a.l,C(cb,4),u(cb,Xq(a,b,y,d,Qb,nd,Ia,Ya,c,p),6);case 6:Ec=cb.h;va(cb,5);break;case 4:ji=
|
|
694
|
+
E(cb);if(4035==ji.code)return Ua("Skipping unsupported HLS stream",Qb,b),cb["return"](null);throw ji;case 5:Gf!=a.l&&qr(a,y);Dn=Ec[0].startTime;En=Ec[Ec.length-1].endTime;Fn=new T(Ec);Gn=d==pc?"subtitle":void 0;ki=[];if(l)for(li=t(l.split(",")),Hf=li.next();!Hf.done;Hf=li.next())Hn=Hf.value,ki.push(Hn);Jn=(In=Bq(y.g,"EXT-X-SERVER-CONTROL"))?null!=In.getAttribute("CAN-SKIP-UNTIL"):!1;Kn={id:a.La++,originalId:g,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:Fn,mimeType:Qb,codecs:c,
|
|
695
695
|
kind:Gn,encrypted:F,drmInfos:G,keyIds:H,language:e,label:g,type:d,primary:f,trickModeVideo:null,emsgSchemeIdUris:null,frameRate:void 0,pixelAspectRatio:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:ki,forced:m,channelsCount:h,audioSamplingRate:null,spatialAudio:n,closedCaptions:k,hdr:void 0,tilesLayout:void 0};return cb["return"]({stream:Kn,Vc:b,Me:q,se:Dn,Gf:En,Ed:nd,Ye:Ya,Re:Jn})}})}
|
|
696
696
|
function qr(a,b){var c=Bq(b.g,"EXT-X-PLAYLIST-TYPE"),d=Bq(b.g,"EXT-X-ENDLIST");d=c&&"VOD"==c.value||d;c=c&&"EVENT"==c.value&&!d;c=!d&&!c;if(d)Yq(a,Rq);else{c?Yq(a,tr):Yq(a,ur);d=Bq(b.g,"EXT-X-TARGETDURATION");if(!d)throw new N(2,4,4024,"EXT-X-TARGETDURATION");d=Number(d.value);c=Bq(b.g,"EXT-X-PART-INF");a.l&&c?(a.ka=Number(wq(c,"PART-TARGET")),a.G=Math.min(a.ka,a.G),c=Bq(b.g,"EXT-X-SERVER-CONTROL"),a.ca=c?Number(wq(c,"PART-HOLD-BACK")):0):a.G=Math.min(d,a.G);a.fa=Math.max(d,a.fa)}}
|
|
697
697
|
function vr(a,b,c,d){c=Bq(c,"EXT-X-MAP");if(!c)return null;var e=wq(c,"URI");d=nr(kc([b],[e])[0],d);b=[d,Z(c,"BYTERANGE","")].join("-");a.ea.has(b)||(c=wr(d,c),a.ea.set(b,c));return a.ea.get(b)}function wr(a,b){var c=0,d=null,e=Z(b,"BYTERANGE");e&&(c=e.split("@"),d=Number(c[0]),c=Number(c[1]),d=c+d-1);return new Gi(function(){return[a]},c,d)}
|
|
@@ -708,8 +708,8 @@ Promise.all(v),3);case 3:return y=z.h,w=y[0],x=y[1]||y[0],z["return"](Dr(b,w.uri
|
|
|
708
708
|
function Dr(a,b,c,d){var e=0;(new Ig).box("moov",Mg).box("trak",Mg).box("mdia",Mg).P("mdhd",function(h){e=Zh(h.reader,h.version).timescale;h.parser.stop()}).parse(d,!0);if(!e)throw new N(2,4,4030,a,b);var f=0,g=!1;(new Ig).box("moof",Mg).box("traf",Mg).P("tfdt",function(h){f=Yh(h.reader,h.version).pd/e;g=!0;h.parser.stop()}).parse(c,!0);if(!g)throw new N(2,4,4030,a,b);return f}
|
|
709
709
|
function Er(a,b,c){function d(){f.seek(g+188);h=f.Y();71!=h&&(f.seek(g+192),h=f.Y());71!=h&&(f.seek(g+204),h=f.Y());71!=h&&e();f.ye(1)}function e(){throw new N(2,4,4030,a,b);}var f=new Fg(c,0),g=0,h=0;for(c=Math.min(f.O.byteLength-188,940);;){g=f.X();h=f.Y();if(71!=h){if(0<c){--c;continue}e()}c=0;var k=f.Jb();if(8191==(k&8191))d();else if(k&16384)if(k=(f.Y()&48)>>4,0!=k&&2!=k||e(),3==k&&(k=f.Y(),f.skip(k)),1!=f.M()>>8)d();else{f.skip(3);c=f.Y()>>6;0!=c&&1!=c||e();0==f.Y()&&e();c=f.Y();k=f.Jb();var l=
|
|
710
710
|
f.Jb();return(1073741824*((c&14)>>1)+((k&65534)<<14|(l&65534)>>1))/9E4}else d()}}function nr(a,b){var c=String(a).replace(/%7B/g,"{").replace(/%7D/g,"}"),d=c.match(/{\$\w*}/g);if(d){d=t(d);for(var e=d.next();!e.done;e=d.next()){e=e.value;var f=e.slice(2,e.length-1),g=b.get(f);if(g)c=c.replace(e,g);else throw new N(2,4,4039,f);}}return c}
|
|
711
|
-
function rr(a,b,c,d,e){var f,g,h,k,l,m,n,p,q,v,y;return L(function(w){if(1==w.g){f=qc;g=bf;h=nr(d.segments[0].h,e);k=new Xb(h);l=k.
|
|
712
|
-
function Sq(a,b){var c=We([b],a.g.retryParameters);a.i.modifyManifestRequest(c,{format:"h"});return Cr(a,c,0)}function Qq(a){var b,c;L(function(d){if(1==d.g){if(!a.i)return d["return"]();C(d,2);return u(d,a.update(),4)}if(2!=d.g)return b=a.
|
|
711
|
+
function rr(a,b,c,d,e){var f,g,h,k,l,m,n,p,q,v,y;return L(function(w){if(1==w.g){f=qc;g=bf;h=nr(d.segments[0].h,e);k=new Xb(h);l=k.wa.split(".").pop();m=Fr[b];if(n=m[l])return w["return"](n);if(b==f.Z)return c&&"vtt"!=c&&"wvtt"!=c?w["return"]("application/mp4"):w["return"]("text/vtt");if(b==f.Sb&&(!c||"jpeg"==c))return w["return"]("image/jpeg");p=We([h],a.g.retryParameters);p.method="HEAD";return u(w,Cr(a,p,g),2)}q=w.h;v=q.headers["content-type"];return v?w["return"](v.split(";")[0]):(y=m.mp4,w["return"](y))})}
|
|
712
|
+
function Sq(a,b){var c=We([b],a.g.retryParameters);a.i.modifyManifestRequest(c,{format:"h"});return Cr(a,c,0)}function Qq(a){var b,c;L(function(d){if(1==d.g){if(!a.i)return d["return"]();C(d,2);return u(d,a.update(),4)}if(2!=d.g)return b=a.xa,a.C.S(b),va(d,0);c=E(d);if(!a.i)return d["return"]();c.severity=1;a.i.onError(c);a.C.S(.1);A(d)})}function Yq(a,b){a.m=b;a.j&&a.j.oc(a.m==Rq);a.m!=Rq||a.C.stop()}
|
|
713
713
|
function Cr(a,b,c){if(!a.F)throw new N(2,7,7001);b=a.i.networkingEngine.request(c,b);Re(a.F,b);return b.promise}M("shaka.hls.HlsParser",Pq);
|
|
714
714
|
var sr=["audio/aac","audio/ac3","audio/ec3","audio/mpeg"],Fr={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",aac:"audio/aac",ac3:"audio/ac3",ec3:"audio/ec3",mp3:"audio/mpeg"},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"},text:{mp4:"application/mp4",m4s:"application/mp4",m4i:"application/mp4",m4f:"application/mp4",cmft:"application/mp4",
|
|
715
715
|
vtt:"text/vtt",webvtt:"txt/vtt",ttml:"application/ttml+xml"},image:{jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml",webp:"image/webp",avif:"image/avif"}},pr={"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(a){var b=wq(a,"METHOD");if(!["SAMPLE-AES","SAMPLE-AES-CTR"].includes(b))return null;b=wq(a,"URI");b=Oq(b);b=Fb(b.data);b=lc("com.widevine.alpha",[{initDataType:"cenc",initData:b}]);if(a=Z(a,"KEYID"))b.keyIds=new Set([a.toLowerCase().substr(2)]);return b},"com.microsoft.playready":function(a){var b=
|
|
@@ -729,7 +729,7 @@ function ks(a){return Promise.reject(new N(2,9,9011,"Cannot add new value to "+a
|
|
|
729
729
|
function ls(a,b,c,d){a=hs(a.h,b);b=a.store();var e={};c=t(c);for(var f=c.next();!f.done;e={tc:e.tc},f=c.next())e.tc=f.value,b["delete"](e.tc).onsuccess=function(g){return function(){return d(g.tc)}}(e);return a.promise()}
|
|
730
730
|
function ms(a,b,c){var d,e,f,g,h,k,l;return L(function(m){if(1==m.g){d=is(a.h,b,"readonly");e=d.store();f={};g=[];h={};k=t(c);for(l=k.next();!l.done;h={Rb:h.Rb,Pb:h.Pb},l=k.next())h.Pb=l.value,h.Rb=e.get(h.Pb),h.Rb.onsuccess=function(n){return function(){void 0==n.Rb.result&&g.push(n.Pb);f[n.Pb]=n.Rb.result}}(h);return u(m,d.promise(),2)}if(g.length)throw new N(2,9,9012,"Could not find values for "+g);return m["return"](c.map(function(n){return f[n]}))})};function os(a){this.g=new gs(a)}os.prototype.destroy=function(){return this.g.destroy()};os.prototype.getAll=function(){var a=this,b,c;return L(function(d){return 1==d.g?(b=is(a.g,"session-ids","readonly"),c=[],u(d,fs(b,function(e,f){c.push(f)}),2)):3!=d.g?u(d,b.promise(),3):d["return"](c)})};os.prototype.add=function(a){var b=hs(this.g,"session-ids"),c=b.store();a=t(a);for(var d=a.next();!d.done;d=a.next())c.add(d.value);return b.promise()};
|
|
731
731
|
os.prototype.remove=function(a){var b=this,c;return L(function(d){return 1==d.g?(c=hs(b.g,"session-ids"),u(d,fs(c,function(e,f,g){a.includes(f.sessionId)&&g["delete"]()}),2)):u(d,c.promise(),0)})};function ps(){this.g=new Map}ps.prototype.destroy=function(){for(var a=[],b=t(this.g.values()),c=b.next();!c.done;c=b.next())a.push(c.value.destroy());this.g.clear();return Promise.all(a)};ps.prototype.init=function(){var a=this;qs.forEach(function(e,f){var g=e();g&&a.g.set(f,g)});for(var b=[],c=t(this.g.values()),d=c.next();!d.done;d=c.next())b.push(d.value.init());return Promise.all(b)};
|
|
732
|
-
function rs(a){var b=null;a.g.forEach(function(c,d){c.getCells().forEach(function(e,f){e.hasFixedKeySpace()||b||(b={path:{
|
|
732
|
+
function rs(a){var b=null;a.g.forEach(function(c,d){c.getCells().forEach(function(e,f){e.hasFixedKeySpace()||b||(b={path:{Ca:d,la:f},la:e})})});if(b)return b;throw new N(2,9,9013,"Could not find a cell that supports add-operations");}function ss(a,b){a.g.forEach(function(c,d){c.getCells().forEach(function(e,f){b({Ca:d,la:f},e)})})}
|
|
733
733
|
function ts(a,b,c){a=a.g.get(b);if(!a)throw new N(2,9,9013,"Could not find mechanism with name "+b);b=a.getCells().get(c);if(!b)throw new N(2,9,9013,"Could not find cell with name "+c);return b}function us(a,b){a.g.forEach(function(c){b(c.getEmeSessionCell())})}function vs(a){var b=Array.from(a.g.keys());if(!b.length)throw new N(2,9,9E3,"No supported storage mechanisms found");return a.g.get(b[0]).getEmeSessionCell()}
|
|
734
734
|
function ws(a){var b,c,d;return L(function(e){return 1==e.g?(b=Array.from(a.g.values()),c=0<b.length,c||(d=qs,d.forEach(function(f){(f=f())&&b.push(f)})),u(e,Promise.all(b.map(function(f){return f.erase()})),2)):c?e.B(0):u(e,Promise.all(b.map(function(f){return f.destroy()})),0)})}function xs(a,b){qs.set(a,b)}M("shaka.offline.StorageMuxer",ps);ps.unregister=function(a){qs["delete"](a)};ps.register=xs;ps.prototype.destroy=ps.prototype.destroy;var qs=new Map;function ys(){js.apply(this,arguments)}qa(ys,js);ys.prototype.updateManifestExpiration=function(a,b){var c=this,d,e,f;return L(function(g){d=hs(c.h,c.g);e=d.store();f=new rc;e.get(a).onsuccess=function(h){(h=h.target.result)?(h.expiration=b,e.put(h),f.resolve()):f.reject(new N(2,9,9012,"Could not find values for "+a))};return u(g,Promise.all([d.promise(),f]),0)})};
|
|
735
735
|
ys.prototype.$b=function(a){var b,c,d,e,f,g;return L(function(h){if(1==h.g){b=[];for(c=0;c<a.periods.length;++c)d=c==a.periods.length-1?a.duration:a.periods[c+1].startTime,e=d-a.periods[c].startTime,f=zs(a.periods[c],e),b.push(f);return u(h,Hp(b),2)}g=h.h;return h["return"]({creationTime:0,originalManifestUri:a.originalManifestUri,duration:a.duration,size:a.size,expiration:null==a.expiration?Infinity:a.expiration,streams:g,sessionIds:a.sessionIds,drmInfo:a.drmInfo,appMetadata:a.appMetadata})})};
|
|
@@ -747,7 +747,7 @@ new Ds(f,"segment-v3","manifest-v3"):null;a.i=g;g=f.objectStoreNames;g=g.contain
|
|
|
747
747
|
9,9001,e.error)),d.stop(),f.preventDefault())};return b};r.destroy=function(){var a=this;return L(function(b){switch(b.g){case 1:if(!a.g){b.B(2);break}return u(b,a.g.destroy(),2);case 2:if(!a.h){b.B(4);break}return u(b,a.h.destroy(),4);case 4:if(!a.i){b.B(6);break}return u(b,a.i.destroy(),6);case 6:if(!a.j){b.B(8);break}return u(b,a.j.destroy(),8);case 8:if(!a.m){b.B(10);break}return u(b,a.m.destroy(),10);case 10:a.l&&a.l.close(),A(b)}})};
|
|
748
748
|
r.getCells=function(){var a=new Map;this.g&&a.set("v1",this.g);this.h&&a.set("v2",this.h);this.i&&a.set("v3",this.i);this.j&&a.set("v5",this.j);return a};r.getEmeSessionCell=function(){return this.m};
|
|
749
749
|
r.erase=function(){var a=this;return L(function(b){switch(b.g){case 1:if(!a.g){b.B(2);break}return u(b,a.g.destroy(),2);case 2:if(!a.h){b.B(4);break}return u(b,a.h.destroy(),4);case 4:if(!a.i){b.B(6);break}return u(b,a.i.destroy(),6);case 6:if(!a.j){b.B(8);break}return u(b,a.j.destroy(),8);case 8:return a.l&&a.l.close(),u(b,Hs(),10);case 10:return a.l=null,a.g=null,a.h=null,a.i=null,a.j=null,u(b,a.init(),0)}})};
|
|
750
|
-
function Hs(){var a=new rc,b=window.indexedDB.deleteDatabase("shaka_offline_db");b.onblocked=function(){};b.onsuccess=function(){a.resolve()};b.onerror=function(c){a.reject(new N(2,9,9001,b.error));c.preventDefault()};return a}xs("idb",function(){return Bc()||xc()||!window.indexedDB?null:new Gs});function Is(a,b,c,d){this.g=a;this.i=b;this.h=c;this.l=d;this.j=["offline:",a,"/",b,"/",c,"/",d].join("")}Is.prototype.
|
|
750
|
+
function Hs(){var a=new rc,b=window.indexedDB.deleteDatabase("shaka_offline_db");b.onblocked=function(){};b.onsuccess=function(){a.resolve()};b.onerror=function(c){a.reject(new N(2,9,9001,b.error));c.preventDefault()};return a}xs("idb",function(){return Bc()||xc()||!window.indexedDB?null:new Gs});function Is(a,b,c,d){this.g=a;this.i=b;this.h=c;this.l=d;this.j=["offline:",a,"/",b,"/",c,"/",d].join("")}Is.prototype.Ca=function(){return this.i};Is.prototype.la=function(){return this.h};Is.prototype.key=function(){return this.l};Is.prototype.toString=function(){return this.j};
|
|
751
751
|
function Js(a){a=/^offline:([a-z]+)\/([^/]+)\/([^/]+)\/([0-9]+)$/.exec(a);if(null==a)return null;var b=a[1];if("manifest"!=b&&"segment"!=b)return null;var c=a[2];if(!c)return null;var d=a[3];return d&&null!=b?new Is(b,c,d,Number(a[4])):null};function Ks(a,b){this.h=a;this.g=b}
|
|
752
752
|
function Ls(a,b){var c=new S(null,0);c.Ia(b.duration);var d=b.streams.filter(function(l){return"audio"==l.type}),e=b.streams.filter(function(l){return"video"==l.type});d=Ms(a,d,e,c);e=b.streams.filter(function(l){return l.type==pc}).map(function(l){return Ns(a,l,c)});var f=b.streams.filter(function(l){return"image"==l.type}).map(function(l){return Ns(a,l,c)}),g=b.drmInfo?[b.drmInfo]:[];if(b.drmInfo)for(var h=t(d.values()),k=h.next();!k.done;k=h.next())k=k.value,k.audio&&k.audio.encrypted&&(k.audio.drmInfos=
|
|
753
753
|
g),k.video&&k.video.encrypted&&(k.video.drmInfos=g);return{presentationTimeline:c,minBufferTime:2,offlineSessionIds:b.sessionIds,variants:Array.from(d.values()),textStreams:e,imageStreams:f}}
|
|
@@ -756,23 +756,23 @@ e.value,g=Ns(a,e,d),h=t(e.variantIds),e=h.next();!e.done;e=h.next())e=f.get(e.va
|
|
|
756
756
|
function Ns(a,b,c){var d=b.segments.map(function(e){return Os(a,e)});c.Gb(d);return{id:b.id,originalId:b.originalId,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new T(d),mimeType:b.mimeType,codecs:b.codecs,width:b.width||void 0,height:b.height||void 0,frameRate:b.frameRate,pixelAspectRatio:b.pixelAspectRatio,hdr:b.hdr,kind:b.kind,encrypted:b.encrypted,drmInfos:[],keyIds:b.keyIds,language:b.language,label:b.label,type:b.type,primary:b.primary,trickModeVideo:null,emsgSchemeIdUris:null,
|
|
757
757
|
roles:b.roles,forced:b.forced,channelsCount:b.channelsCount,audioSamplingRate:b.audioSamplingRate,spatialAudio:b.spatialAudio,closedCaptions:b.closedCaptions,tilesLayout:b.tilesLayout}}function Os(a,b){var c=new Is("segment",a.h,a.g,b.dataKey);return new Ii(b.startTime,b.endTime,function(){return[c.toString()]},0,null,null!=b.initSegmentKey?Ps(a,b.initSegmentKey):null,b.timestampOffset,b.appendWindowStart,b.appendWindowEnd,[],b.tilesLayout||"")}
|
|
758
758
|
function Ps(a,b){var c=new Is("segment",a.h,a.g,b);return new Gi(function(){return[c.toString()]},0,null)};function Qs(){this.g=null}r=Qs.prototype;r.configure=function(){};
|
|
759
|
-
r.start=function(a,b){var c=this,d,e,f,g,h,k,l;return L(function(m){switch(m.g){case 1:d=Js(a);c.g=d;if(null==d||"manifest"!=d.g)throw new N(2,1,9004,a);e=new ps;ua(m);return u(m,e.init(),4);case 4:return u(m,ts(e,d.
|
|
760
|
-
r.update=function(){};r.onExpirationUpdated=function(a,b){var c=this,d,e,f,g,h,k,l;return L(function(m){switch(m.g){case 1:return d=c.g,e=new ps,C(m,2,3),u(m,e.init(),5);case 5:return u(m,ts(e,d.
|
|
759
|
+
r.start=function(a,b){var c=this,d,e,f,g,h,k,l;return L(function(m){switch(m.g){case 1:d=Js(a);c.g=d;if(null==d||"manifest"!=d.g)throw new N(2,1,9004,a);e=new ps;ua(m);return u(m,e.init(),4);case 4:return u(m,ts(e,d.Ca(),d.la()),5);case 5:return f=m.h,u(m,f.getManifests([d.key()]),6);case 6:return g=m.h,h=g[0],k=new Ks(d.Ca(),d.la()),l=Ls(k,h),b.makeTextStreamsForClosedCaptions(l),m["return"](l);case 2:return wa(m),u(m,e.destroy(),7);case 7:ya(m,0)}})};r.stop=function(){return Promise.resolve()};
|
|
760
|
+
r.update=function(){};r.onExpirationUpdated=function(a,b){var c=this,d,e,f,g,h,k,l;return L(function(m){switch(m.g){case 1:return d=c.g,e=new ps,C(m,2,3),u(m,e.init(),5);case 5:return u(m,ts(e,d.Ca(),d.la()),6);case 6:return f=m.h,u(m,f.getManifests([d.key()]),7);case 7:g=m.h;h=g[0];k=h.sessionIds.includes(a);l=void 0==h.expiration||h.expiration>b;if(!k||!l){m.B(3);break}return u(m,f.updateManifestExpiration(d.key(),b),3);case 3:return wa(m),u(m,e.destroy(),10);case 10:ya(m,0);break;case 2:E(m),m.B(3)}})};
|
|
761
761
|
Bg["application/x-offline-manifest"]=function(){return new Qs};function Rs(){}function Ss(a){var b=Js(a);b&&"manifest"==b.g?(a={uri:a,ve:a,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"}},a=Ie(a)):a=b&&"segment"==b.g?Ts(b.key(),b):Ge(new N(2,1,9004,a));return a}
|
|
762
|
-
function Ts(a,b){var c=new ps;return Ie(void 0).$(function(){return c.init()}).$(function(){return ts(c,b.
|
|
762
|
+
function Ts(a,b){var c=new ps;return Ie(void 0).$(function(){return c.init()}).$(function(){return ts(c,b.Ca(),b.la())}).$(function(d){return d.getSegments([b.key()])}).$(function(d){return{uri:b,data:d[0].data,headers:{}}})["finally"](function(){return c.destroy()})}M("shaka.offline.OfflineScheme",Rs);Rs.plugin=Ss;Te("offline",Ss);function Us(a,b,c){var d,e,f,g,h,k;return L(function(l){switch(l.g){case 1:d=[];for(var m=[],n=t(c),p=n.next();!p.done;p=n.next()){p=p.value;for(var q=!1,v=t(m),y=v.next();!y.done;y=v.next())if(y=y.value,Vs(y.info,p)){y.sessionIds.push(p.sessionId);q=!0;break}q||m.push({info:p,sessionIds:[p.sessionId]})}e=t(m);f=e.next();case 2:if(f.done){l.B(4);break}g=f.value;h=Ws(a,b,g);return u(l,h,5);case 5:k=l.h;d=d.concat(k);f=e.next();l.B(2);break;case 4:return l["return"](d)}})}
|
|
763
763
|
function Ws(a,b,c){var d,e;return L(function(f){switch(f.g){case 1:return d=new Pf({nb:b,onError:function(){},Pc:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),C(f,2),d.configure(a),u(f,Xf(d,c.info.keySystem,c.info.licenseUri,c.info.serverCertificate,c.info.audioCapabilities,c.info.videoCapabilities),4);case 4:va(f,3);break;case 2:return E(f),u(f,d.destroy(),5);case 5:return f["return"]([]);case 3:return C(f,6),u(f,fg(d),8);case 8:va(f,7);break;case 6:return E(f),u(f,d.destroy(),
|
|
764
764
|
9);case 9:return f["return"]([]);case 7:return e=[],u(f,Promise.all(c.sessionIds.map(function(g){return L(function(h){if(1==h.g)return C(h,2),u(h,gg(d,g),4);if(2!=h.g)return e.push(g),va(h,0);E(h);A(h)})})),10);case 10:return u(f,d.destroy(),11);case 11:return f["return"](e)}})}
|
|
765
|
-
function Vs(a,b){function c(d,e){return d.robustness==e.robustness&&d.contentType==e.contentType}return a.keySystem==b.keySystem&&a.licenseUri==b.licenseUri&&gb(a.audioCapabilities,b.audioCapabilities,c)&&gb(a.videoCapabilities,b.videoCapabilities,c)};function Xs(a,b,c){var d=b.presentationTimeline.getDuration();b=Ys(b);return{offlineUri:null,originalManifestUri:a,duration:d,size:0,expiration:Infinity,tracks:b,appMetadata:c,isIncomplete:!1}}function Zs(a,b){var c=Ls(new Ks(a.
|
|
765
|
+
function Vs(a,b){function c(d,e){return d.robustness==e.robustness&&d.contentType==e.contentType}return a.keySystem==b.keySystem&&a.licenseUri==b.licenseUri&&gb(a.audioCapabilities,b.audioCapabilities,c)&&gb(a.videoCapabilities,b.videoCapabilities,c)};function Xs(a,b,c){var d=b.presentationTimeline.getDuration();b=Ys(b);return{offlineUri:null,originalManifestUri:a,duration:d,size:0,expiration:Infinity,tracks:b,appMetadata:c,isIncomplete:!1}}function Zs(a,b){var c=Ls(new Ks(a.Ca(),a.la()),b),d=b.appMetadata||{};c=Ys(c);return{offlineUri:a.toString(),originalManifestUri:b.originalManifestUri,duration:b.duration,size:b.size,expiration:b.expiration,tracks:c,appMetadata:d,isIncomplete:b.isIncomplete||!1}}
|
|
766
766
|
function Ys(a){var b=[],c=ie(a.variants);c=t(c);for(var d=c.next();!d.done;d=c.next())b.push($d(d.value));a=t(a.textStreams);for(c=a.next();!c.done;c=a.next())b.push(ae(c.value));return b};function $s(){this.g={}}function at(a,b){var c=b.audio,d=b.video;c&&!d&&(a.g[c.id]=c.bandwidth||b.bandwidth);!c&&d&&(a.g[d.id]=d.bandwidth||b.bandwidth);if(c&&d){var e=c.bandwidth||393216,f=d.bandwidth||b.bandwidth-e;0>=f&&(f=b.bandwidth);a.g[c.id]=e;a.g[d.id]=f}}function bt(a,b){a.g[b.id]=b.bandwidth||2048}function ct(a,b){var c=a.g[b];null==c&&(c=0);return c};function dt(a){var b=this;if(a&&a.constructor!=U)throw new N(2,9,9008);this.g=this.h=null;a?(this.h=a.h,this.g=a.cc()):(this.h=Uk(),this.g=new Se);this.i=[];this.j=[];var c=!a;this.l=new cf(function(){var d,e,f,g,h;return L(function(k){switch(k.g){case 1:return u(k,Promise.all(b.j.map(function(l){return $r(l)})),2);case 2:d=function(){};e=[];f=t(b.i);for(g=f.next();!g.done;g=f.next())h=g.value,e.push(h.then(d,d));return u(k,Promise.all(e),3);case 3:if(!c){k.B(4);break}return u(k,b.g.destroy(),4);
|
|
767
767
|
case 4:b.h=null,b.g=null,A(k)}})})}function et(){if(uc())a:{var a=t(qs.values());for(var b=a.next();!b.done;b=a.next())if(b=b.value,b=b()){b.destroy();a=!0;break a}a=!1}else a=!1;return a}r=dt.prototype;r.destroy=function(){return this.l.destroy()};
|
|
768
768
|
r.configure=function(a,b){2==arguments.length&&"string"==typeof a&&(a=Rk(a,b));a.manifest&&a.manifest.dash&&"defaultPresentationDelay"in a.manifest.dash&&(Kb("manifest.dash.defaultPresentationDelay configuration","Please Use manifest.defaultPresentationDelay instead."),a.manifest.defaultPresentationDelay=a.manifest.dash.defaultPresentationDelay,delete a.manifest.dash.defaultPresentationDelay);return Wk(this.h,a)};r.getConfiguration=function(){var a=Uk();Wk(a,this.h,Uk());return a};r.cc=function(){return this.g};
|
|
769
769
|
r.store=function(a,b,c){var d=this,e=this.getConfiguration(),f=new Zr(this.g);this.j.push(f);b=ft(this,a,b||{},function(){var h;return L(function(k){if(1==k.g)return u(k,Ag(a,d.g,e.manifest.retryParameters,c||null),2);h=k.h;return k["return"](Sb(h))})},e,f);var g=new Fe(b,function(){return $r(f)});g["finally"](function(){fb(d.j,f)});g.then=function(h){Kb("shaka.offline.Storage.store.then","Storage operations now return a shaka.util.AbortableOperation, rather than a promise. Please update to conform to this new API; you can use the |chain| method instead.");
|
|
770
770
|
return g.promise.then(h)};return gt(this,g)};r.tf=function(){Kb("shaka.offline.Storage.getStoreInProgress","Multiple concurrent downloads are now supported.");return!1};
|
|
771
771
|
function ft(a,b,c,d,e,f){var g,h,k,l,m,n,p,q,v,y,w,x,D,z;return L(function(B){switch(B.g){case 1:return ht(),h=g=null,k=new ps,n=m=l=null,C(B,2,3),u(B,d(),5);case 5:return g=B.h,u(B,it(a,b,g,e),6);case 6:p=B.h;jt(a);q=!p.presentationTimeline.T()&&!p.presentationTimeline.mb();if(!q)throw new N(2,9,9005,b);return u(B,kt(a,p,function(F){n=n||F},e),7);case 7:h=B.h;jt(a);if(n)throw n;return u(B,lt(p,e),8);case 8:return u(B,k.init(),9);case 9:return jt(a),u(B,rs(k),10);case 10:return l=B.h,jt(a),v=mt(h,
|
|
772
|
-
p,b,c,e,f),y=v.Ef,w=v.$d,u(B,l.la.addManifests([y]),11);case 11:x=B.h;jt(a);m=x[0];jt(a);if(n)throw n;return u(B,nt(a,w,m,y,f,e,l.la,p,h),12);case 12:return jt(a),D=new Is("manifest",l.path.
|
|
772
|
+
p,b,c,e,f),y=v.Ef,w=v.$d,u(B,l.la.addManifests([y]),11);case 11:x=B.h;jt(a);m=x[0];jt(a);if(n)throw n;return u(B,nt(a,w,m,y,f,e,l.la,p,h),12);case 12:return jt(a),D=new Is("manifest",l.path.Ca,l.path.la,m),B["return"](Zs(D,y));case 3:return wa(B),u(B,k.destroy(),13);case 13:if(!g){B.B(14);break}return u(B,g.stop(),14);case 14:if(!h){B.B(16);break}return u(B,h.destroy(),16);case 16:ya(B,0);break;case 2:z=E(B);if(null==m){B.B(18);break}return u(B,ot(m),18);case 18:throw n||z;}})}
|
|
773
773
|
function nt(a,b,c,d,e,f,g,h,k){var l,m,n,p,q,v,y,w,x,D;return L(function(z){switch(z.g){case 1:l={};m=0;n=function(B,F){var G,H,I,J,K,P,R;return L(function(ba){if(1==ba.g){G={};H=t(B);for(I=H.next();!I.done;G={bb:G.bb},I=H.next())G.bb=I.value,J=Wr(G.bb,f),K=G.bb.i,P=G.bb.h,R=function(aa){return function(Y){var Da,Fa,xa;return L(function(Ia){if(1==Ia.g)return u(Ia,g.addSegments([{data:Y}]),2);Da=Ia.h;jt(a);Fa=aa.bb.g;xa=Vr(Fa);l[xa]=Da[0];m+=Y.byteLength;A(Ia)})}}(G),bs(e,G.bb.groupId,J,K,P,R);return u(ba,
|
|
774
774
|
ds(e),2)}if(!F)return ba.B(0);jt(a);pt(h,d,k,f);return u(ba,g.updateManifest(c,d),0)})};p=!1;C(z,2);if(!qt(h)||!p||rt(h)){z.B(4);break}return u(z,n(b.filter(function(B){return B.h}),!0),5);case 5:return jt(a),b=b.filter(function(B){return!B.h}),q=l,v=m,l={},m=0,u(z,st(g,c,d,q,v,function(){return jt(a)}),6);case 6:jt(a);case 4:if(p){z.B(7);break}return u(z,n(b,!1),8);case 8:return jt(a),y=l,w=m,l={},m=0,u(z,st(g,c,d,y,w,function(){return jt(a)}),9);case 9:jt(a);case 7:va(z,0);break;case 2:return x=
|
|
775
|
-
E(z),D=Object.values(l),u(z,g.removeSegments(D,function(){}),10);case 10:throw x;}})}function ot(a){var b,c,d,e;return L(function(f){switch(f.g){case 1:return b=new ps,u(f,b.init(),2);case 2:return u(f,rs(b),3);case 3:return c=f.h,d=new Is("manifest",c.path.
|
|
775
|
+
E(z),D=Object.values(l),u(z,g.removeSegments(D,function(){}),10);case 10:throw x;}})}function ot(a){var b,c,d,e;return L(function(f){switch(f.g){case 1:return b=new ps,u(f,b.init(),2);case 2:return u(f,rs(b),3);case 3:return c=f.h,d=new Is("manifest",c.path.Ca,c.path.la,a),u(f,b.destroy(),4);case 4:return e=new dt,u(f,e.remove(d.toString()),0)}})}
|
|
776
776
|
function st(a,b,c,d,e,f){var g,h,k,l,m,n,p,q,v,y,w;return L(function(x){switch(x.g){case 1:g=!1;C(x,2);h=!0;k=t(c.streams);for(l=k.next();!l.done;l=k.next())for(m=l.value,n=t(m.segments),p=n.next();!p.done;p=n.next())q=p.value,v=q.pendingSegmentRefId?d[q.pendingSegmentRefId]:null,null!=v&&(q.dataKey=v,q.pendingSegmentRefId=void 0),v=q.pendingInitSegmentRefId?d[q.pendingInitSegmentRefId]:null,null!=v&&(q.initSegmentKey=v,q.pendingInitSegmentRefId=void 0),q.pendingSegmentRefId&&(h=!1),q.pendingInitSegmentRefId&&
|
|
777
777
|
(h=!1);c.size+=e;h&&(c.isIncomplete=!1);return u(x,a.updateManifest(b,c),4);case 4:g=!0;f();va(x,0);break;case 2:return y=E(x),u(x,ot(b),5);case 5:if(g){x.B(6);break}w=Object.values(d);return u(x,a.removeSegments(w,function(){}),6);case 6:throw y;}})}
|
|
778
778
|
function lt(a,b){var c,d,e,f,g,h,k,l,m,n,p,q,v,y,w,x,D,z,B,F,G,H,I,J,K,P,R,ba,aa;return L(function(Y){switch(Y.g){case 1:return c={width:Infinity,height:Infinity},Nd(a,b.restrictions,c),u(Y,Qd(a,b.offline.usePersistentLicense),2);case 2:d=[];e=b.preferredAudioChannelCount;f=b.preferredDecodingAttributes;g=b.preferredVideoCodecs;h=b.preferredAudioCodecs;Bd(a,g,h,e,f);k=t(a.variants);for(l=k.next();!l.done;l=k.next())m=l.value,d.push($d(m));n=t(a.textStreams);for(p=n.next();!p.done;p=n.next())q=p.value,
|
|
@@ -781,16 +781,16 @@ ba.next())aa=F.value,"variant"==aa.type&&K.add(aa.id),"text"==aa.type&&P.add(aa.
|
|
|
781
781
|
function mt(a,b,c,d,e,f){var g=Xs(c,b,d),h=e.offline.progressCallback;as(f,function(q,v){g.size=v;h(g,q)},function(q,v){k&&e.offline.usePersistentLicense&&l==v&&eg(a,"cenc",q)});var k=qt(b)&&!rt(b),l=null;k&&(l=ut.get(a.g.keySystem));for(var m=new $s,n=t(b.textStreams),p=n.next();!p.done;p=n.next())m.g[p.value.id]=52;n=t(b.imageStreams);for(p=n.next();!p.done;p=n.next())bt(m,p.value);p=t(b.variants);for(n=p.next();!n.done;n=p.next())at(m,n.value);m=vt(f,m,b);f=m.streams;m=m.$d;p=a.g;n=e.offline.usePersistentLicense;
|
|
782
782
|
p&&n&&(p.initData=[]);return{Ef:{creationTime:Date.now(),originalManifestUri:c,duration:b.presentationTimeline.getDuration(),size:0,expiration:a.bc(),streams:f,sessionIds:n?kg(a):[],drmInfo:p,appMetadata:d,isIncomplete:!0},$d:m}}function qt(a){return a.variants.some(function(b){var c=b.audio&&b.audio.encrypted;return b.video&&b.video.encrypted||c})}
|
|
783
783
|
function rt(a){return a.variants.some(function(b){return(b.video?b.video.drmInfos:[]).concat(b.audio?b.audio.drmInfos:[]).some(function(c){return c.initData&&c.initData.length})})}function pt(a,b,c,d){b.expiration=c.bc();c=kg(c);b.sessionIds=d.offline.usePersistentLicense?c:[];if(qt(a)&&d.offline.usePersistentLicense&&!c.length)throw new N(2,9,9007);}r.remove=function(a){return wt(this,xt(this,a))};
|
|
784
|
-
function xt(a,b){var c,d,e,f,g,h;return L(function(k){switch(k.g){case 1:ht();c=Js(b);if(null==c||"manifest"!=c.g)throw new N(2,9,9004,b);d=c;e=new ps;ua(k);return u(k,e.init(),4);case 4:return u(k,ts(e,d.
|
|
784
|
+
function xt(a,b){var c,d,e,f,g,h;return L(function(k){switch(k.g){case 1:ht();c=Js(b);if(null==c||"manifest"!=c.g)throw new N(2,9,9004,b);d=c;e=new ps;ua(k);return u(k,e.init(),4);case 4:return u(k,ts(e,d.Ca(),d.la()),5);case 5:return f=k.h,u(k,f.getManifests([d.key()]),6);case 6:return g=k.h,h=g[0],u(k,Promise.all([yt(a,h,e),zt(f,d,h)]),2);case 2:return wa(k),u(k,e.destroy(),8);case 8:ya(k,0)}})}
|
|
785
785
|
function At(a,b){for(var c=[],d=t(a.streams),e=d.next();!e.done;e=d.next())e=e.value,b&&"video"==e.type?c.push({contentType:ad(e.mimeType,e.codecs),robustness:a.drmInfo.videoRobustness}):b||"audio"!=e.type||c.push({contentType:ad(e.mimeType,e.codecs),robustness:a.drmInfo.audioRobustness});return c}function yt(a,b,c){return L(function(d){return u(d,Bt(a.g,a.h.drm,c,b),0)})}
|
|
786
786
|
function zt(a,b,c){function d(){}var e=Ct(c);Zs(b,c);return Promise.all([a.removeSegments(e,d),a.removeManifests([b.key()],d)])}r.Sf=function(){return wt(this,Dt(this))};
|
|
787
787
|
function Dt(a){var b,c,d,e,f,g,h,k,l,m;return L(function(n){switch(n.g){case 1:return ht(),b=a.g,c=a.h.drm,d=new ps,e=!1,ua(n),u(n,d.init(),4);case 4:f=[],us(d,function(p){return f.push(p)}),g=t(f),h=g.next();case 5:if(h.done){n.B(2);break}k=h.value;return u(n,k.getAll(),8);case 8:return l=n.h,u(n,Us(c,b,l),9);case 9:return m=n.h,u(n,k.remove(m),10);case 10:m.length!=l.length&&(e=!0);h=g.next();n.B(5);break;case 2:return wa(n),u(n,d.destroy(),11);case 11:ya(n,3);break;case 3:return n["return"](!e)}})}
|
|
788
|
-
r.list=function(){return wt(this,Et())};function Et(){var a,b,c;return L(function(d){switch(d.g){case 1:return ht(),a=[],b=new ps,ua(d),u(d,b.init(),4);case 4:return c=Promise.resolve(),ss(b,function(e,f){c=c.then(function(){var g;return L(function(h){if(1==h.g)return u(h,f.getAllManifests(),2);g=h.h;g.forEach(function(k,l){var m=Zs(new Is("manifest",e.
|
|
788
|
+
r.list=function(){return wt(this,Et())};function Et(){var a,b,c;return L(function(d){switch(d.g){case 1:return ht(),a=[],b=new ps,ua(d),u(d,b.init(),4);case 4:return c=Promise.resolve(),ss(b,function(e,f){c=c.then(function(){var g;return L(function(h){if(1==h.g)return u(h,f.getAllManifests(),2);g=h.h;g.forEach(function(k,l){var m=Zs(new Is("manifest",e.Ca,e.la,l),k);a.push(m)});A(h)})})}),u(d,c,2);case 2:return wa(d),u(d,b.destroy(),6);case 6:ya(d,3);break;case 3:return d["return"](a)}})}
|
|
789
789
|
function it(a,b,c,d){var e,f,g,h,k;return L(function(l){if(1==l.g)return e=null,f=a.g,g={networkingEngine:f,modifyManifestRequest:function(){},modifySegmentRequest:function(){},filter:function(){return Promise.resolve()},makeTextStreamsForClosedCaptions:function(){},onTimelineRegionAdded:function(){},onEvent:function(){},onError:function(m){e=m},isLowLatencyMode:function(){return!1},isAutoLowLatencyMode:function(){return!1},enableLowLatencyMode:function(){}},c.configure(d.manifest),jt(a),u(l,c.start(b,
|
|
790
790
|
g),2);if(3!=l.g)return h=l.h,jt(a),k=Ft(h),u(l,Promise.all(nf(k,function(m){return m.createSegmentIndex()})),3);jt(a);if(e)throw e;return l["return"](h)})}function kt(a,b,c,d){var e;return L(function(f){switch(f.g){case 1:return e=new Pf({nb:a.g,onError:c,Pc:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),e.configure(d.drm),u(f,Uf(e,b.variants,d.offline.usePersistentLicense),2);case 2:return u(f,fg(e),3);case 3:return u(f,dg(e),4);case 4:return f["return"](e)}})}
|
|
791
791
|
function vt(a,b,c){var d=new Map,e=Ft(c),f=new Map;e=t(e);for(var g=e.next();!g.done;g=e.next()){g=g.value;var h=Gt(a,b,c,g,d);f.set(g.id,h)}a=t(c.variants);for(b=a.next();!b.done;b=a.next())b=b.value,b.audio&&f.get(b.audio.id).variantIds.push(b.id),b.video&&f.get(b.video.id).variantIds.push(b.id);return{streams:Array.from(f.values()),$d:Array.from(d.values())}}
|
|
792
792
|
function Gt(a,b,c,d,e){var f={id:d.id,originalId:d.originalId,primary:d.primary,type:d.type,mimeType:d.mimeType,codecs:d.codecs,frameRate:d.frameRate,pixelAspectRatio:d.pixelAspectRatio,hdr:d.hdr,kind:d.kind,language:d.language,label:d.label,width:d.width||null,height:d.height||null,encrypted:d.encrypted,keyIds:d.keyIds,segments:[],variantIds:[],roles:d.roles,forced:d.forced,channelsCount:d.channelsCount,audioSamplingRate:d.audioSamplingRate,spatialAudio:d.spatialAudio,closedCaptions:d.closedCaptions,
|
|
793
|
-
tilesLayout:d.tilesLayout};Ht(d,c.presentationTimeline.
|
|
793
|
+
tilesLayout:d.tilesLayout};Ht(d,c.presentationTimeline.Qa(),function(g){var h=Vr(g),k=void 0;if(!e.has(h)){var l=g.endTime-g.startTime;l=ct(b,d.id)*l;l=Yr(a.g,l);e.set(h,new Ur(g,l,d.id,!1))}g.g&&(k=Vr(g.g),e.has(k)||(l=.5*ct(b,d.id),l=Yr(a.g,l),e.set(k,new Ur(g.g,l,d.id,!0))));f.segments.push({pendingInitSegmentRefId:k,initSegmentKey:k?0:null,startTime:g.startTime,endTime:g.endTime,appendWindowStart:g.appendWindowStart,appendWindowEnd:g.appendWindowEnd,timestampOffset:g.timestampOffset,tilesLayout:g.tilesLayout,
|
|
794
794
|
pendingSegmentRefId:h,dataKey:0})});return f}function Ht(a,b,c){b=a.segmentIndex.find(b);if(null!=b)for(var d=a.segmentIndex.get(b);d;)c(d),d=a.segmentIndex.get(++b)}function jt(a){if(a.l.g)throw new N(2,9,7001);}function ht(){if(!et())throw new N(2,9,9E3);}function wt(a,b){return L(function(c){if(1==c.g)return a.i.push(b),ua(c),u(c,b,4);if(2!=c.g)return c["return"](c.h);wa(c);fb(a.i,b);return ya(c,0)})}function gt(a,b){var c=b.promise;a.i.push(c);return b["finally"](function(){fb(a.i,c)})}
|
|
795
795
|
function Ct(a){var b=new Set;a=t(a.streams);for(var c=a.next();!c.done;c=a.next()){c=t(c.value.segments);for(var d=c.next();!d.done;d=c.next())d=d.value,null!=d.initSegmentKey&&b.add(d.initSegmentKey),b.add(d.dataKey)}return Array.from(b)}
|
|
796
796
|
function Bt(a,b,c,d){var e,f,g;return L(function(h){if(1==h.g){if(!d.drmInfo)return h["return"]();e=vs(c);f=d.sessionIds.map(function(k){return{sessionId:k,keySystem:d.drmInfo.keySystem,licenseUri:d.drmInfo.licenseServerUri,serverCertificate:d.drmInfo.serverCertificate,audioCapabilities:At(d,!1),videoCapabilities:At(d,!0)}});return u(h,Us(b,a,f),2)}return 3!=h.g?(g=h.h,u(h,e.remove(g),3)):u(h,e.add(f.filter(function(k){return!g.includes(k.sessionId)})),0)})}
|
|
@@ -816,27 +816,27 @@ function nu(a){var b=this.mediaKeys;b&&b!=a&&ru(b,null);delete this.mediaKeys;re
|
|
|
816
816
|
function pu(a,b){this.keySystem=a;if(a.startsWith("com.apple.fps"))for(var c=t(b),d=c.next();!d.done;d=c.next()){var e=d.value;if("required"==e.persistentState)d=null;else{d={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:e.initDataTypes,sessionTypes:["temporary"],label:e.label};var f=!1,g=!1;if(e.audioCapabilities)for(var h=t(e.audioCapabilities),k=h.next();!k.done;k=h.next())k=k.value,k.contentType&&(f=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,
|
|
817
817
|
k.contentType.split(";")[0])&&(d.audioCapabilities.push(k),g=!0));if(e.videoCapabilities)for(e=t(e.videoCapabilities),k=e.next();!k.done;k=e.next())h=k.value,h.contentType&&(f=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,h.contentType.split(";")[0])&&(d.videoCapabilities.push(h),g=!0));f||(g=WebKitMediaKeys.isTypeSupported(this.keySystem,"video/mp4"));d=g?d:null}if(d){this.g=d;return}}c=Error("Unsupported keySystem");c.name="NotSupportedError";c.code=DOMException.NOT_SUPPORTED_ERR;throw c;}
|
|
818
818
|
pu.prototype.createMediaKeys=function(){var a=new ou(this.keySystem);return Promise.resolve(a)};pu.prototype.getConfiguration=function(){return this.g};function ou(a){this.h=new WebKitMediaKeys(a);this.g=new ef}ou.prototype.createSession=function(a){a=a||"temporary";if("temporary"!=a)throw new TypeError("Session type "+a+" is unsupported on this platform.");return new tu(this.h,a)};ou.prototype.setServerCertificate=function(){return Promise.resolve(!1)};
|
|
819
|
-
function ru(a,b){a.g.
|
|
819
|
+
function ru(a,b){a.g.Sa();if(!b)return Promise.resolve();a.g.A(b,"webkitneedkey",su);try{return Pi(b,HTMLMediaElement.HAVE_METADATA,a.g,function(){b.webkitSetMediaKeys(a.h)}),Promise.resolve()}catch(c){return Promise.reject(c)}}function tu(a){Ne.call(this);this.i=null;this.l=a;this.h=this.g=null;this.j=new ef;this.sessionId="";this.expiration=NaN;this.closed=new rc;this.keyStatuses=new uu}qa(tu,Ne);r=tu.prototype;
|
|
820
820
|
r.generateRequest=function(a,b){var c=this;this.g=new rc;try{var d=this.l.createSession("video/mp4",Fb(b));this.i=d;this.sessionId=d.sessionId||"";this.j.A(this.i,"webkitkeymessage",function(e){c.g&&(c.g.resolve(),c.g=null);e=(new Map).set("messageType",void 0==c.keyStatuses.g?"license-request":"license-renewal").set("message",Gb(e.message));e=new Q("message",e);c.dispatchEvent(e)});this.j.A(d,"webkitkeyadded",function(){c.h&&(vu(c,"usable"),c.h.resolve(),c.h=null)});this.j.A(d,"webkitkeyerror",function(){var e=
|
|
821
821
|
Error("EME PatchedMediaKeysApple key error");e.errorCode=c.i.error;if(null!=c.g)c.g.reject(e),c.g=null;else if(null!=c.h)c.h.reject(e),c.h=null;else switch(c.i.error.code){case WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT:case WebKitMediaKeyError.MEDIA_KEYERR_HARDWARECHANGE:vu(c,"output-not-allowed");break;default:vu(c,"internal-error")}});vu(this,"status-pending")}catch(e){this.g.reject(e)}return this.g};r.load=function(){return Promise.reject(Error("MediaKeySession.load not yet supported"))};
|
|
822
|
-
r.update=function(a){this.h=new rc;try{this.i.update(Fb(a))}catch(b){this.h.reject(b)}return this.h};r.close=function(){try{this.i.close(),this.closed.resolve(),this.j.
|
|
822
|
+
r.update=function(a){this.h=new rc;try{this.i.update(Fb(a))}catch(b){this.h.reject(b)}return this.h};r.close=function(){try{this.i.close(),this.closed.resolve(),this.j.Sa()}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 vu(a,b){var c=a.keyStatuses;c.size=void 0==b?0:1;c.g=b;c=new Q("keystatuseschange");a.dispatchEvent(c)}
|
|
823
823
|
function uu(){this.size=0;this.g=void 0}r=uu.prototype;r.forEach=function(a){this.g&&a(this.g,yg.value())};r.get=function(a){if(this.has(a))return this.g};r.has=function(a){var b=yg.value();return this.g&&Db(a,b)?!0:!1};r.entries=function(){};r.keys=function(){};r.values=function(){};Jt(mu);function wu(){}function xu(){!window.HTMLVideoElement||!window.MSMediaKeys||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,window.MediaKeys=yu,window.MediaKeySystemAccess=zu,navigator.requestMediaKeySystemAccess=Au,HTMLMediaElement.prototype.setMediaKeys=Bu)}function Au(a,b){try{var c=new zu(a,b);return Promise.resolve(c)}catch(d){return Promise.reject(d)}}
|
|
824
824
|
function Cu(a){if(a.initData){var b=new CustomEvent("encrypted");b.initDataType="cenc";b.initData=Gb(Do(a.initData));this.dispatchEvent(b)}}It.PatchedMediaKeysMs=wu;wu.install=xu;
|
|
825
825
|
function zu(a,b){this.keySystem=a;for(var c=!1,d=t(b),e=d.next();!e.done;e=d.next()){e=e.value;var f={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:e.initDataTypes,sessionTypes:["temporary"],label:e.label},g=!1;if(e.audioCapabilities)for(var h=t(e.audioCapabilities),k=h.next();!k.done;k=h.next())k=k.value,k.contentType&&(g=!0,MSMediaKeys.isTypeSupported(this.keySystem,k.contentType.split(";")[0])&&(f.audioCapabilities.push(k),c=
|
|
826
826
|
!0));if(e.videoCapabilities)for(h=t(e.videoCapabilities),k=h.next();!k.done;k=h.next())k=k.value,k.contentType&&(g=!0,MSMediaKeys.isTypeSupported(this.keySystem,k.contentType.split(";")[0])&&(f.videoCapabilities.push(k),c=!0));g||(c=MSMediaKeys.isTypeSupported(this.keySystem,"video/mp4"));"required"==e.persistentState&&(c=!1);if(c){this.g=f;return}}c=Error("Unsupported keySystem");c.name="NotSupportedError";c.code=DOMException.NOT_SUPPORTED_ERR;throw c;}
|
|
827
827
|
zu.prototype.createMediaKeys=function(){var a=new yu(this.keySystem);return Promise.resolve(a)};zu.prototype.getConfiguration=function(){return this.g};function Bu(a){var b=this.mediaKeys;b&&b!=a&&Du(b,null);delete this.mediaKeys;return(this.mediaKeys=a)?Du(a,this):Promise.resolve()}function yu(a){this.h=new MSMediaKeys(a);this.g=new ef}
|
|
828
|
-
yu.prototype.createSession=function(a){a=a||"temporary";if("temporary"!=a)throw new TypeError("Session type "+a+" is unsupported on this platform.");return new Eu(this.h,a)};yu.prototype.setServerCertificate=function(){return Promise.resolve(!1)};function Du(a,b){a.g.
|
|
828
|
+
yu.prototype.createSession=function(a){a=a||"temporary";if("temporary"!=a)throw new TypeError("Session type "+a+" is unsupported on this platform.");return new Eu(this.h,a)};yu.prototype.setServerCertificate=function(){return Promise.resolve(!1)};function Du(a,b){a.g.Sa();if(!b)return Promise.resolve();a.g.A(b,"msneedkey",Cu);try{return Pi(b,HTMLMediaElement.HAVE_METADATA,a.g,function(){b.msSetMediaKeys(a.h)}),Promise.resolve()}catch(c){return Promise.reject(c)}}
|
|
829
829
|
function Eu(a){Ne.call(this);this.i=null;this.l=a;this.h=this.g=null;this.j=new ef;this.sessionId="";this.expiration=NaN;this.closed=new rc;this.keyStatuses=new Fu}qa(Eu,Ne);r=Eu.prototype;
|
|
830
830
|
r.generateRequest=function(a,b){var c=this;this.g=new rc;try{this.i=this.l.createSession("video/mp4",Fb(b),null),this.j.A(this.i,"mskeymessage",function(d){c.g&&(c.g.resolve(),c.g=null);d=(new Map).set("messageType",void 0==c.keyStatuses.g?"license-request":"license-renewal").set("message",Gb(d.message));d=new Q("message",d);c.dispatchEvent(d)}),this.j.A(this.i,"mskeyadded",function(){c.g?(Gu(c,"usable"),c.g.resolve(),c.g=null):c.h&&(Gu(c,"usable"),c.h.resolve(),c.h=null)}),this.j.A(this.i,"mskeyerror",
|
|
831
831
|
function(){var d=Error("EME PatchedMediaKeysMs key error");d.errorCode=c.i.error;if(null!=c.g)c.g.reject(d),c.g=null;else if(null!=c.h)c.h.reject(d),c.h=null;else switch(c.i.error.code){case MSMediaKeyError.MS_MEDIA_KEYERR_OUTPUT:case MSMediaKeyError.MS_MEDIA_KEYERR_HARDWARECHANGE:Gu(c,"output-not-allowed");break;default:Gu(c,"internal-error")}}),Gu(this,"status-pending")}catch(d){this.g.reject(d)}return this.g};r.load=function(){return Promise.reject(Error("MediaKeySession.load not yet supported"))};
|
|
832
|
-
r.update=function(a){this.h=new rc;try{this.i.update(Fb(a))}catch(b){this.h.reject(b)}return this.h};r.close=function(){try{this.i.close(),this.closed.resolve(),this.j.
|
|
832
|
+
r.update=function(a){this.h=new rc;try{this.i.update(Fb(a))}catch(b){this.h.reject(b)}return this.h};r.close=function(){try{this.i.close(),this.closed.resolve(),this.j.Sa()}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 Gu(a,b){var c=a.keyStatuses;c.size=void 0==b?0:1;c.g=b;c=new Q("keystatuseschange");a.dispatchEvent(c)}
|
|
833
833
|
function Fu(){this.size=0;this.g=void 0}r=Fu.prototype;r.forEach=function(a){this.g&&a(this.g,yg.value())};r.get=function(a){if(this.has(a))return this.g};r.has=function(a){var b=yg.value();return this.g&&Db(a,b)?!0:!1};r.entries=function(){};r.keys=function(){};r.values=function(){};Jt(xu);function Hu(){}function Iu(){!window.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(navigator.requestMediaKeySystemAccess=Ju,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=Ku,window.MediaKeys=Lu,window.MediaKeySystemAccess=Mu)}function Ju(){return Promise.reject(Error("The key system specified is not supported."))}
|
|
834
834
|
function Ku(a){return null==a?Promise.resolve():Promise.reject(Error("MediaKeys not supported."))}It.PatchedMediaKeysNop=Hu;Hu.install=Iu;function Lu(){throw new TypeError("Illegal constructor.");}Lu.prototype.createSession=function(){};Lu.prototype.setServerCertificate=function(){};function Mu(){this.keySystem="";throw new TypeError("Illegal constructor.");}Mu.prototype.getConfiguration=function(){};Mu.prototype.createMediaKeys=function(){};Jt(Iu,-10);function Nu(){}function Ou(){if(!(!window.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)){if(HTMLMediaElement.prototype.webkitGenerateKeyRequest)Pu="webkit";else if(!HTMLMediaElement.prototype.generateKeyRequest)return;navigator.requestMediaKeySystemAccess=Qu;delete HTMLMediaElement.prototype.mediaKeys;HTMLMediaElement.prototype.mediaKeys=null;HTMLMediaElement.prototype.setMediaKeys=Ru;window.MediaKeys=Su;window.MediaKeySystemAccess=Tu}}
|
|
835
835
|
function Uu(a){var b=Pu;return b?b+a.charAt(0).toUpperCase()+a.slice(1):a}function Qu(a,b){try{var c=new Tu(a,b);return Promise.resolve(c)}catch(d){return Promise.reject(d)}}function Ru(a){var b=this.mediaKeys;b&&b!=a&&Vu(b,null);delete this.mediaKeys;(this.mediaKeys=a)&&Vu(a,this);return Promise.resolve()}It.PatchedMediaKeysWebkit=Nu;Nu.install=Ou;
|
|
836
836
|
function Tu(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");for(var f=t(b),g=f.next();!g.done;g=f.next()){g=g.value;var h={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:g.initDataTypes,sessionTypes:["temporary"],label:g.label},k=!1;if(g.audioCapabilities)for(var l=t(g.audioCapabilities),
|
|
837
837
|
m=l.next();!m.done;m=l.next())m=m.value,m.contentType&&(k=!0,e.canPlayType(m.contentType.split(";")[0],this.g)&&(h.audioCapabilities.push(m),d=!0));if(g.videoCapabilities)for(l=t(g.videoCapabilities),m=l.next();!m.done;m=l.next())m=m.value,m.contentType&&(k=!0,e.canPlayType(m.contentType,this.g)&&(h.videoCapabilities.push(m),d=!0));k||(d=e.canPlayType("video/mp4",this.g)||e.canPlayType("video/webm",this.g));"required"==g.persistentState&&(c?(h.persistentState="required",h.sessionTypes=["persistent-license"]):
|
|
838
838
|
d=!1);if(d){this.h=h;return}}c="Unsupported keySystem";if("org.w3.clearkey"==a||"com.widevine.alpha"==a)c="None of the requested configurations were supported.";c=Error(c);c.name="NotSupportedError";c.code=DOMException.NOT_SUPPORTED_ERR;throw c;}Tu.prototype.createMediaKeys=function(){var a=new Su(this.g);return Promise.resolve(a)};Tu.prototype.getConfiguration=function(){return this.h};function Su(a){this.l=a;this.h=null;this.g=new ef;this.i=[];this.j=new Map}
|
|
839
|
-
function Vu(a,b){a.h=b;a.g.
|
|
839
|
+
function Vu(a,b){a.h=b;a.g.Sa();var c=Pu;b&&(a.g.A(b,c+"needkey",function(d){var e=new CustomEvent("encrypted");e.initDataType="cenc";e.initData=Gb(d.initData);a.h.dispatchEvent(e)}),a.g.A(b,c+"keymessage",function(d){var e=Wu(a,d.sessionId);e&&(d=(new Map).set("messageType",void 0==e.keyStatuses.g?"licenserequest":"licenserenewal").set("message",d.message),d=new Q("message",d),e.h&&(e.h.resolve(),e.h=null),e.dispatchEvent(d))}),a.g.A(b,c+"keyadded",function(d){if(d=Wu(a,d.sessionId))Xu(d,"usable"),
|
|
840
840
|
d.g&&d.g.resolve(),d.g=null}),a.g.A(b,c+"keyerror",function(d){var e=Wu(a,d.sessionId);e&&e.handleError(d)}))}Su.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 Yu(b,this.l,a);this.i.push(a);return a};Su.prototype.setServerCertificate=function(){return Promise.resolve(!1)};
|
|
841
841
|
function Wu(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 Yu(a,b,c){Ne.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 rc;this.keyStatuses=new Zu}qa(Yu,Ne);r=Yu.prototype;
|
|
842
842
|
r.handleError=function(a){var b=Error("EME v0.1b key error"),c=a.errorCode;c.systemCode=a.systemCode;b.errorCode=c;!a.sessionId&&this.h?(45==a.systemCode&&(b.message="Unsupported session type."),this.h.reject(b),this.h=null):a.sessionId&&this.g?(this.g.reject(b),this.g=null):(b=a.systemCode,a.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?Xu(this,"output-restricted"):1==b?Xu(this,"expired"):Xu(this,"internal-error"))};
|