shaka-player 4.11.0 → 4.11.2
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/dist/controls.css +2 -2
- package/dist/controls.css.map +1 -1
- package/dist/deps.js +1 -1
- package/dist/locales.js +191 -53
- package/dist/shaka-player.compiled.debug.js +34 -32
- package/dist/shaka-player.compiled.debug.map +4 -4
- package/dist/shaka-player.compiled.js +245 -242
- package/dist/shaka-player.compiled.map +4 -4
- package/dist/shaka-player.ui.debug.js +115 -99
- package/dist/shaka-player.ui.debug.map +4 -4
- package/dist/shaka-player.ui.js +495 -479
- package/dist/shaka-player.ui.map +4 -4
- package/externs/ima.js +22 -2
- package/lib/dash/dash_parser.js +7 -2
- package/lib/media/segment_index.js +14 -2
- package/lib/media/streaming_engine.js +6 -0
- package/lib/player.js +1 -1
- package/lib/text/simple_text_displayer.js +1 -1
- package/lib/text/text_utils.js +12 -3
- package/lib/text/ttml_text_parser.js +25 -4
- package/lib/util/periods.js +4 -1
- package/package.json +1 -1
- package/ui/less/overflow_menu.less +1 -0
- package/ui/less/tooltip.less +1 -1
- package/ui/locales/ar-XB.json +11 -0
- package/ui/locales/ar.json +11 -0
- package/ui/locales/bg.json +11 -0
- package/ui/locales/ca.json +11 -0
- package/ui/locales/cs.json +11 -0
- package/ui/locales/da.json +11 -0
- package/ui/locales/de.json +13 -2
- package/ui/locales/el.json +11 -0
- package/ui/locales/en-GB.json +10 -1
- package/ui/locales/en-XA.json +12 -1
- package/ui/locales/es-419.json +5 -0
- package/ui/locales/es.json +1 -0
- package/ui/locales/fa.json +15 -4
- package/ui/locales/fi.json +11 -0
- package/ui/locales/fil.json +11 -0
- package/ui/locales/fr.json +3 -3
- package/ui/locales/hi.json +11 -0
- package/ui/locales/hr.json +11 -0
- package/ui/locales/hu.json +12 -1
- package/ui/locales/id.json +11 -0
- package/ui/locales/it.json +11 -0
- package/ui/locales/iw.json +13 -2
- package/ui/locales/ja.json +11 -0
- package/ui/locales/ko.json +11 -0
- package/ui/locales/lt.json +11 -0
- package/ui/locales/lv.json +12 -1
- package/ui/locales/nl.json +13 -2
- package/ui/locales/no.json +11 -0
- package/ui/locales/pl.json +8 -7
- package/ui/locales/pt-BR.json +1 -0
- package/ui/locales/pt-PT.json +1 -0
- package/ui/locales/ro.json +11 -0
- package/ui/locales/ru.json +11 -0
- package/ui/locales/sk.json +11 -0
- package/ui/locales/sl.json +11 -0
- package/ui/locales/sr.json +11 -0
- package/ui/locales/sv.json +11 -0
- package/ui/locales/th.json +12 -1
- package/ui/locales/tr.json +11 -0
- package/ui/locales/uk.json +12 -1
- package/ui/locales/vi.json +13 -2
- package/ui/locales/zh-TW.json +11 -0
- package/ui/locales/zh.json +12 -1
|
@@ -49,7 +49,8 @@ fa("Array.prototype.find",function(a){return a?a:function(b,c){return Na(this,b,
|
|
|
49
49
|
var Pa="function"==typeof Object.assign?Object.assign:function(a,b){for(var c=1;c<arguments.length;c++){var d=arguments[c];if(d)for(var e in d)La(d,e)&&(a[e]=d[e])}return a};fa("Object.assign",function(a){return a||Pa});fa("Promise.prototype.finally",function(a){return a?a:function(b){return this.then(function(c){return Promise.resolve(b()).then(function(){return c})},function(c){return Promise.resolve(b()).then(function(){throw c;})})}});
|
|
50
50
|
fa("Array.prototype.entries",function(a){return a?a:function(){return Ma(this,function(b,c){return[b,c]})}});fa("Number.isNaN",function(a){return a?a:function(b){return"number"===typeof b&&isNaN(b)}});fa("String.prototype.repeat",function(a){return a?a:function(b){var c=Oa(this,null,"repeat");if(0>b||1342177279<b)throw new RangeError("Invalid count value");b|=0;for(var d="";b;)if(b&1&&(d+=c),b>>>=1)c+=c;return d}});
|
|
51
51
|
fa("Number.isFinite",function(a){return a?a:function(b){return"number"!==typeof b?!1:!isNaN(b)&&Infinity!==b&&-Infinity!==b}});fa("Object.values",function(a){return a?a:function(b){var c=[],d;for(d in b)La(b,d)&&c.push(b[d]);return c}});fa("Math.log2",function(a){return a?a:function(b){return Math.log(b)/Math.LN2}});fa("Number.MAX_SAFE_INTEGER",function(){return 9007199254740991});
|
|
52
|
-
fa("Math.trunc",function(a){return a?a:function(b){b=Number(b);if(isNaN(b)||Infinity===b||-Infinity===b||0===b)return b;var c=Math.floor(Math.abs(b));return 0>b?-c:c}});var Qa=this||self;
|
|
52
|
+
fa("String.prototype.endsWith",function(a){return a?a:function(b,c){var d=Oa(this,b,"endsWith");void 0===c&&(c=d.length);c=Math.max(0,Math.min(c|0,d.length));for(var e=b.length;0<e&&0<c;)if(d[--c]!=b[--e])return!1;return 0>=e}});fa("Math.trunc",function(a){return a?a:function(b){b=Number(b);if(isNaN(b)||Infinity===b||-Infinity===b||0===b)return b;var c=Math.floor(Math.abs(b));return 0>b?-c:c}});var Qa=this||self;
|
|
53
|
+
function S(a,b){a=a.split(".");var c=Qa;a[0]in c||"undefined"==typeof c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)a.length||void 0===b?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b};/*
|
|
53
54
|
@license
|
|
54
55
|
Shaka Player
|
|
55
56
|
Copyright 2016 Google LLC
|
|
@@ -138,14 +139,14 @@ var ue=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=
|
|
|
138
139
|
Copyright 2006 The Closure Library Authors
|
|
139
140
|
SPDX-License-Identifier: Apache-2.0
|
|
140
141
|
*/
|
|
141
|
-
function ve(a){var b;a instanceof ve?(we(this,a.Bb),this.xc=a.xc,xe(this,a.Db),ye(this,a.
|
|
142
|
-
q.toString=function(){var a=[],b=this.Bb;b&&a.push(Ce(b,De,!0),":");if(b=this.Db){a.push("//");var c=this.xc;c&&a.push(Ce(c,De,!0),"@");a.push(encodeURIComponent(b).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));b=this.
|
|
143
|
-
q.resolve=function(a){var b=this.clone();"data"===b.Bb&&(b=new ve);var c=!!a.Bb;c?we(b,a.Bb):c=!!a.xc;c?b.xc=a.xc:c=!!a.Db;c?xe(b,a.Db):c=null!=a.
|
|
144
|
-
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.Pa=d:c=""!==a.g.toString();c?ze(b,a.g.clone()):c=!!a.jc;c&&(b.jc=a.jc);return b};q.clone=function(){return new ve(this)};function we(a,b,c){a.Bb=c?Ae(b,!0):b;a.Bb&&(a.Bb=a.Bb.replace(/:$/,""))}function xe(a,b,c){a.Db=c?Ae(b,!0):b}function ye(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error("Bad port number "+b);a.
|
|
142
|
+
function ve(a){var b;a instanceof ve?(we(this,a.Bb),this.xc=a.xc,xe(this,a.Db),ye(this,a.Oc),this.Pa=a.Pa,ze(this,a.g.clone()),this.jc=a.jc):a&&(b=String(a).match(ue))?(we(this,b[1]||"",!0),this.xc=Ae(b[2]||""),xe(this,b[3]||"",!0),ye(this,b[4]),this.Pa=Ae(b[5]||"",!0),ze(this,b[6]||"",!0),this.jc=Ae(b[7]||"")):this.g=new Be(null)}q=ve.prototype;q.Bb="";q.xc="";q.Db="";q.Oc=null;q.Pa="";q.jc="";
|
|
143
|
+
q.toString=function(){var a=[],b=this.Bb;b&&a.push(Ce(b,De,!0),":");if(b=this.Db){a.push("//");var c=this.xc;c&&a.push(Ce(c,De,!0),"@");a.push(encodeURIComponent(b).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));b=this.Oc;null!=b&&a.push(":",String(b))}if(b=this.Pa)this.Db&&"/"!=b.charAt(0)&&a.push("/"),a.push(Ce(b,"/"==b.charAt(0)?Ee:Fe,!0));(b=this.g.toString())&&a.push("?",b);(b=this.jc)&&a.push("#",Ce(b,Ge));return a.join("")};
|
|
144
|
+
q.resolve=function(a){var b=this.clone();"data"===b.Bb&&(b=new ve);var c=!!a.Bb;c?we(b,a.Bb):c=!!a.xc;c?b.xc=a.xc:c=!!a.Db;c?xe(b,a.Db):c=null!=a.Oc;var d=a.Pa;if(c)ye(b,a.Oc);else if(c=!!a.Pa){if("/"!=d.charAt(0))if(this.Db&&!this.Pa)d="/"+d;else{var e=b.Pa.lastIndexOf("/");-1!=e&&(d=b.Pa.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(""):".."==
|
|
145
|
+
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.Pa=d:c=""!==a.g.toString();c?ze(b,a.g.clone()):c=!!a.jc;c&&(b.jc=a.jc);return b};q.clone=function(){return new ve(this)};function we(a,b,c){a.Bb=c?Ae(b,!0):b;a.Bb&&(a.Bb=a.Bb.replace(/:$/,""))}function xe(a,b,c){a.Db=c?Ae(b,!0):b}function ye(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error("Bad port number "+b);a.Oc=b}else a.Oc=null}
|
|
145
146
|
function ze(a,b,c){b instanceof Be?a.g=b:(c||(b=Ce(b,He)),a.g=new Be(b))}function Ae(a,b){return a?b?decodeURI(a):decodeURIComponent(a):""}function Ce(a,b,c){return null!=a?(a=encodeURI(a).replace(b,Ie),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null}function Ie(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)}var De=/[#\/\?@]/g,Fe=/[#\?:]/g,Ee=/[#\?]/g,He=/[#\?@]/g,Ge=/#/g;function Be(a){this.g=a||null}
|
|
146
|
-
function Je(a){if(!a.Ja&&(a.Ja={},a.
|
|
147
|
+
function Je(a){if(!a.Ja&&(a.Ja={},a.Yc=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," ")))}}q=Be.prototype;q.Ja=null;q.Yc=null;function Ke(a){Je(a);return a.Yc}q.add=function(a,b){Je(this);this.g=null;var c=this.Ja.hasOwnProperty(a)?this.Ja[a]:null;c||(this.Ja[a]=c=[]);c.push(b);this.Yc++;return this};
|
|
147
148
|
q.set=function(a,b){Je(this);this.g=null;this.Ja.hasOwnProperty(a)?this.Ja[a]=[b]:this.add(a,b);return this};q.get=function(a){Je(this);return this.Ja[a]||[]};q.toString=function(){if(this.g)return this.g;if(!this.Ja)return"";var a=[],b;for(b in this.Ja)for(var c=encodeURIComponent(b),d=this.Ja[b],e=0;e<d.length;e++){var f=c;""!==d[e]&&(f+="="+encodeURIComponent(d[e]));a.push(f)}return this.g=a.join("&")};
|
|
148
|
-
q.clone=function(){var a=new Be;a.g=this.g;if(this.Ja){var b={},c;for(c in this.Ja)b[c]=this.Ja[c].concat();a.Ja=b;a.
|
|
149
|
+
q.clone=function(){var a=new Be;a.g=this.g;if(this.Ja){var b={},c;for(c in this.Ja)b[c]=this.Ja[c].concat();a.Ja=b;a.Yc=this.Yc}return a};function Le(){}function Me(a){a=Gc(Ab(a));return btoa(a)}function Ne(a,b){b=void 0==b?!0:b;a=Me(a).replace(/\+/g,"-").replace(/\//g,"_");return b?a:a.replace(/[=]*$/,"")}function Oe(a){a=window.atob(a.replace(/-/g,"+").replace(/_/g,"/"));for(var b=new Uint8Array(a.length),c=0;c<a.length;++c)b[c]=a.charCodeAt(c);return b}function Pe(a){for(var b=a.length/2,c=new Uint8Array(b),d=0;d<b;d++)c[d]=window.parseInt(a.substr(2*d,2),16);return c}
|
|
149
150
|
function Qe(a){var b=Ab(a);a="";b=t(b);for(var c=b.next();!c.done;c=b.next())c=c.value,c=c.toString(16),1==c.length&&(c="0"+c),a+=c;return a}function Re(){for(var a=Ka.apply(0,arguments),b=0,c=0;c<a.length;++c)b+=a[c].byteLength;b=new Uint8Array(b);for(var d=c=0;d<a.length;++d){var e=a[d];e instanceof Uint8Array?b.set(e,c):b.set(Ab(e),c);c+=e.byteLength}return b}S("shaka.util.Uint8ArrayUtils",Le);Le.concat=Re;Le.toHex=Qe;Le.fromHex=Pe;Le.fromBase64=Oe;Le.toBase64=Ne;Le.toStandardBase64=Me;function Se(a,b,c){c=void 0===c?"":c;if(0==b.length)return a;if(1==a.length&&1==b.length){var d=new ve(a[0]);b=new ve(b[0]);b=d.resolve(b);c&&ze(b,c);return[b.toString()]}b=b.map(function(h){return new ve(h)});d=[];a=t(a);for(var e=a.next();!e.done;e=a.next()){e=new ve(e.value);for(var f=t(b),g=f.next();!g.done;g=f.next())g=e.resolve(g.value),c&&ze(g,c),d.push(g.toString())}return d}
|
|
150
151
|
function Te(a,b,c,d){a={keySystem:a,encryptionScheme:b,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:c||[],keyIds:new Set};d&&(a.keySystemUris=new Set([d]));return a}
|
|
151
152
|
function Ue(a,b){b=void 0===b?"cenc":b;var c=[],d=[],e=[];a.forEach(function(g,h){var k=h;22!=k.length&&(k=Ne(Pe(h),!1));var l=g;22!=l.length&&(l=Ne(Pe(g),!1));g={kty:"oct",kid:k,k:l};c.push(g);d.push(g.kid);e.push(h)});a=JSON.stringify({keys:c});var f=JSON.stringify({kids:d});f=[{initData:Ab(Ic(f)),initDataType:"keyids"}];return{keySystem:"org.w3.clearkey",encryptionScheme:b,licenseServerUri:"data:application/json;base64,"+window.btoa(a),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,
|
|
@@ -249,13 +250,13 @@ function zh(a,b,c,d){var e=gh(void 0);a=t(a.h);for(var f=a.next(),g={};!f.done;g
|
|
|
249
250
|
ph.prototype.request=ph.prototype.request;ph.prototype.destroy=ph.prototype.destroy;ph.makeRequest=uh;ph.defaultRetryParameters=function(){return Zg()};ph.prototype.clearAllResponseFilters=ph.prototype.kg;ph.prototype.unregisterResponseFilter=ph.prototype.Zi;ph.prototype.registerResponseFilter=ph.prototype.Di;ph.prototype.clearAllRequestFilters=ph.prototype.jg;ph.prototype.unregisterRequestFilter=ph.prototype.Yi;ph.prototype.registerRequestFilter=ph.prototype.Ci;ph.unregisterScheme=function(a){delete sh[a]};
|
|
250
251
|
ph.registerScheme=qh;ph.prototype.setForceHTTPS=ph.prototype.Qf;ph.prototype.setForceHTTP=ph.prototype.Pf;function vh(){this.g=0}ph.NumBytesRemainingClass=vh;function wh(a,b,c){bh.call(this,a,b);this.h=c}qa(wh,bh);ph.PendingRequest=wh;var Ah=1;ph.RequestType={MANIFEST:0,SEGMENT:Ah,LICENSE:2,APP:3,TIMING:4,SERVER_CERTIFICATE:5,KEY:6,ADS:7,CONTENT_STEERING:8};
|
|
251
252
|
ph.AdvancedRequestType={INIT_SEGMENT:0,MEDIA_SEGMENT:1,MEDIA_PLAYLIST:2,MASTER_PLAYLIST:3,MPD:4,MSS:5,MPD_PATCH:6,MEDIATAILOR_SESSION_INFO:7,MEDIATAILOR_TRACKING_INFO:8,MEDIATAILOR_STATIC_RESOURCE:9,MEDIATAILOR_TRACKING_EVENT:10,INTERSTITIAL_ASSET_LIST:11,INTERSTITIAL_AD_URL:12};var rh=3;ph.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:rh};var sh={};function Ch(a){this.g=!1;this.h=new ah;this.i=a}Ch.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 Dh(a,b){if(a.g){if(b instanceof T&&7003==b.code)throw b;throw new T(2,7,7003,b);}};function Eh(a,b){var c=[];a=t(a);for(var d=a.next();!d.done;d=a.next())c.push(b(d.value));return c}function Fh(a,b){a=t(a);for(var c=a.next();!c.done;c=a.next())if(!b(c.value))return!1;return!0};function Gh(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 Hh(a){var b={};a.forEach(function(c,d){b[d]=c});return b};function Ih(a,b){this.h=Fb(a);this.i=b==Jh;this.g=0}q=Ih.prototype;q.ra=function(){return this.g<this.h.byteLength};q.wa=function(){return this.g};q.getLength=function(){return this.h.byteLength};q.S=function(){try{var a=this.h.getUint8(this.g);this.g+=1;return a}catch(b){throw Kh();}};q.ka=function(){try{var a=this.h.getUint16(this.g,this.i);this.g+=2;return a}catch(b){throw Kh();}};q.P=function(){try{var a=this.h.getUint32(this.g,this.i);this.g+=4;return a}catch(b){throw Kh();}};
|
|
252
|
-
q.Ng=function(){try{var a=this.h.getInt32(this.g,this.i);this.g+=4;return a}catch(b){throw Kh();}};q.
|
|
253
|
+
q.Ng=function(){try{var a=this.h.getInt32(this.g,this.i);this.g+=4;return a}catch(b){throw Kh();}};q.Pc=function(){try{if(this.i){var a=this.h.getUint32(this.g,!0);var b=this.h.getUint32(this.g+4,!0)}else b=this.h.getUint32(this.g,!1),a=this.h.getUint32(this.g+4,!1)}catch(c){throw Kh();}if(2097151<b)throw new T(2,3,3001);this.g+=8;return b*Math.pow(2,32)+a};q.rb=function(a){if(this.g+a>this.h.byteLength)throw Kh();var b=Ab(this.h,this.g,a);this.g+=a;return b};
|
|
253
254
|
q.skip=function(a){if(this.g+a>this.h.byteLength)throw Kh();this.g+=a};q.Ki=function(a){if(this.g<a)throw Kh();this.g-=a};q.seek=function(a){if(0>a||a>this.h.byteLength)throw Kh();this.g=a};q.sc=function(){for(var a=this.g;this.ra()&&0!=this.h.getUint8(this.g);)this.g+=1;a=Ab(this.h,a,this.g-a);this.g+=1;return Cc(a)};function Kh(){return new T(2,3,3E3)}S("shaka.util.DataViewReader",Ih);Ih.prototype.readTerminatedString=Ih.prototype.sc;Ih.prototype.seek=Ih.prototype.seek;Ih.prototype.rewind=Ih.prototype.Ki;
|
|
254
|
-
Ih.prototype.skip=Ih.prototype.skip;Ih.prototype.readBytes=Ih.prototype.rb;Ih.prototype.readUint64=Ih.prototype.
|
|
255
|
-
q.
|
|
256
|
-
partialOkay:c||!1,version:m,flags:n,reader:b,size:f,start:e+a,has64BitSize:k}))}else b.skip(Math.min(e+f-b.wa(),b.getLength()-b.wa()))}};function Qh(a){for(var b=Rh(a);a.reader.ra()&&!a.parser.g;)a.parser.
|
|
257
|
-
function Uh(a){var b=Rh(a);a.reader.skip(8);var c=a.reader.ka();a.reader.skip(6);2==c?a.reader.skip(48):a.reader.skip(12);for(1==c&&a.reader.skip(16);a.reader.ra()&&!a.parser.g;)a.parser.
|
|
258
|
-
function Rh(a){return 8+(a.has64BitSize?8:0)+(null!=a.flags?4:0)}S("shaka.util.Mp4Parser",Lh);Lh.headerSize=Rh;Lh.typeToString=Ph;Lh.allData=Vh;Lh.audioSampleEntry=Uh;Lh.visualSampleEntry=Th;Lh.sampleDescription=Sh;Lh.children=Qh;Lh.prototype.parseNext=Lh.prototype.
|
|
255
|
+
Ih.prototype.skip=Ih.prototype.skip;Ih.prototype.readBytes=Ih.prototype.rb;Ih.prototype.readUint64=Ih.prototype.Pc;Ih.prototype.readInt32=Ih.prototype.Ng;Ih.prototype.readUint32=Ih.prototype.P;Ih.prototype.readUint16=Ih.prototype.ka;Ih.prototype.readUint8=Ih.prototype.S;Ih.prototype.getLength=Ih.prototype.getLength;Ih.prototype.getPosition=Ih.prototype.wa;Ih.prototype.hasMoreData=Ih.prototype.ra;var Jh=1;Ih.Endianness={BIG_ENDIAN:0,LITTLE_ENDIAN:Jh};function Lh(){this.i=[];this.h=[];this.g=!1}q=Lh.prototype;q.box=function(a,b){a=Mh(a);this.i[a]=Nh;this.h[a]=b;return this};q.R=function(a,b){a=Mh(a);this.i[a]=Oh;this.h[a]=b;return this};q.stop=function(){this.g=!0};q.parse=function(a,b,c){a=new Ih(a,0);for(this.g=!1;a.ra()&&!this.g;)this.Mc(0,a,b,c)};
|
|
256
|
+
q.Mc=function(a,b,c,d){var e=b.wa();if(d&&e+8>b.getLength())this.g=!0;else{var f=b.P(),g=b.P(),h=Ph(g),k=!1;switch(f){case 0:f=b.getLength()-e;break;case 1:if(d&&b.wa()+8>b.getLength()){this.g=!0;return}f=b.Pc();k=!0}var l=this.h[g];if(l){var m=null,n=null;if(this.i[g]==Oh){if(d&&b.wa()+4>b.getLength()){this.g=!0;return}n=b.P();m=n>>>24;n&=16777215}g=e+f;c&&g>b.getLength()&&(g=b.getLength());d&&g>b.getLength()?this.g=!0:(d=g-b.wa(),b=0<d?b.rb(d):new Uint8Array(0),b=new Ih(b,0),l({name:h,parser:this,
|
|
257
|
+
partialOkay:c||!1,version:m,flags:n,reader:b,size:f,start:e+a,has64BitSize:k}))}else b.skip(Math.min(e+f-b.wa(),b.getLength()-b.wa()))}};function Qh(a){for(var b=Rh(a);a.reader.ra()&&!a.parser.g;)a.parser.Mc(a.start+b,a.reader,a.partialOkay)}function Sh(a){for(var b=Rh(a),c=a.reader.P(),d=0;d<c&&(a.parser.Mc(a.start+b,a.reader,a.partialOkay),!a.parser.g);d++);}function Th(a){var b=Rh(a);for(a.reader.skip(78);a.reader.ra()&&!a.parser.g;)a.parser.Mc(a.start+b,a.reader,a.partialOkay)}
|
|
258
|
+
function Uh(a){var b=Rh(a);a.reader.skip(8);var c=a.reader.ka();a.reader.skip(6);2==c?a.reader.skip(48):a.reader.skip(12);for(1==c&&a.reader.skip(16);a.reader.ra()&&!a.parser.g;)a.parser.Mc(a.start+b,a.reader,a.partialOkay)}function Vh(a){return function(b){a(b.reader.rb(b.reader.getLength()-b.reader.wa()))}}function Mh(a){var b=0;a=t(a);for(var c=a.next();!c.done;c=a.next())b=b<<8|c.value.charCodeAt(0);return b}function Ph(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}
|
|
259
|
+
function Rh(a){return 8+(a.has64BitSize?8:0)+(null!=a.flags?4:0)}S("shaka.util.Mp4Parser",Lh);Lh.headerSize=Rh;Lh.typeToString=Ph;Lh.allData=Vh;Lh.audioSampleEntry=Uh;Lh.visualSampleEntry=Th;Lh.sampleDescription=Sh;Lh.children=Qh;Lh.prototype.parseNext=Lh.prototype.Mc;Lh.prototype.parse=Lh.prototype.parse;Lh.prototype.stop=Lh.prototype.stop;Lh.prototype.fullBox=Lh.prototype.R;Lh.prototype.box=Lh.prototype.box;var Nh=0,Oh=1;function Wh(a){var b=this;this.g=[];this.h=[];this.data=[];(new Lh).box("moov",Qh).box("moof",Qh).R("pssh",function(c){if(!(1<c.version)){var d=Ab(c.reader.h,-12,c.size);b.data.push(d);b.g.push(Qe(c.reader.rb(16)));if(0<c.version){d=c.reader.P();for(var e=0;e<d;e++){var f=Qe(c.reader.rb(16));b.h.push(f)}}}}).parse(a)}
|
|
259
260
|
function Xh(a,b,c,d){var e=a.length,f=b.length+16+e;0<d&&(f+=4+16*c.size);var g=new Uint8Array(f),h=Fb(g),k=0;h.setUint32(k,f);k+=4;h.setUint32(k,1886614376);k+=4;1>d?h.setUint32(k,0):h.setUint32(k,16777216);k+=4;g.set(b,k);k+=b.length;if(0<d)for(h.setUint32(k,c.size),k+=4,b=t(c),c=b.next();!c.done;c=b.next())c=Pe(c.value),g.set(c,k),k+=c.length;h.setUint32(k,e);g.set(a,k+4);return g};function Yh(a){var b=this;this.C=a;this.H=new Set;this.m=this.s=null;this.ga=this.ea=!1;this.J=0;this.g=null;this.B=new hb;this.i=new Map;this.A=new Map;this.l=new ah;this.h=null;this.o=function(c){2==c.severity&&b.l.reject(c);a.onError(c)};this.aa=new Map;this.fa=new Map;this.L=new $b(function(){return Zh(b)});this.O=!1;this.N=[];this.X=!1;this.K=new $b(function(){$h(b)});this.l.catch(function(){});this.j=new Ch(function(){return ai(b)});this.ca=!1;this.F=this.G=null;this.T=function(){return!1}}
|
|
260
261
|
q=Yh.prototype;q.destroy=function(){return this.j.destroy()};function ai(a){return P(function(b){switch(b.g){case 1:return a.B.release(),a.B=null,a.l.reject(),a.K.stop(),a.K=null,a.L.stop(),a.L=null,G(b,bi(a),2);case 2:if(!a.m){b.u(3);break}ua(b,4);return G(b,a.m.setMediaKeys(null),6);case 6:ya(b,5);break;case 4:za(b);case 5:a.m=null;case 3:a.g=null,a.H.clear(),a.s=null,a.A=new Map,a.h=null,a.o=function(){},a.C=null,a.ca=!1,a.G=null,H(b)}})}
|
|
261
262
|
q.configure=function(a,b){this.h=a;b&&(this.T=b);this.K&&this.K.Ra(this.h.updateExpirationTime)};function ci(a,b,c){a.ga=!0;a.A=new Map;a.O=c;return di(a,b)}function ei(a,b,c){a.A=new Map;c=t(c);for(var d=c.next();!d.done;d=c.next())a.A.set(d.value,{initData:null,initDataType:null});c=t(a.h.persistentSessionsMetadata);for(d=c.next();!d.done;d=c.next())d=d.value,a.A.set(d.sessionId,{initData:d.initData,initDataType:d.initDataType});a.O=0<a.A.size;return di(a,b)}
|
|
@@ -269,7 +270,7 @@ function qi(a){var b,c,d,e,f;return P(function(g){switch(g.g){case 1:if(!a.s||!a
|
|
|
269
270
|
ua(g,6);return G(g,a.s.setServerCertificate(a.g.serverCertificate),8);case 8:ya(g,0);break;case 6:throw f=za(g),new T(2,6,6004,f.message);}})}function ri(a,b){var c,d,e;return P(function(f){if(1==f.g)return G(f,si(a,b,{initData:null,initDataType:null}),2);if(3!=f.g){c=f.h;if(!c)return f.return();d=[];if(e=a.i.get(c))e.kb=new ah,d.push(e.kb);d.push(c.remove());return G(f,Promise.all(d),3)}a.i.delete(c);H(f)})}
|
|
270
271
|
function pi(a){var b,c,d,e,f;return P(function(g){if(1==g.g){if(!a.A.size)return g.u(2);a.A.forEach(function(h,k){si(a,k,h)});return G(g,a.l,3)}if(2!=g.g){b=a.g&&a.g.keyIds||new Set([]);if(0<b.size&&ti(a))return g.return(a.l);a.l=new ah;a.l.catch(function(){})}c=(a.g?a.g.initData:[])||[];d=t(c);for(e=d.next();!e.done;e=d.next())f=e.value,ni(a,f.initDataType,f.initData);ui(a)&&a.l.resolve();return g.return(a.l)})}
|
|
271
272
|
function ni(a,b,c){if(c.length){if(a.h.ignoreDuplicateInitData){var d=a.i.values();d=t(d);for(var e=d.next();!e.done;e=d.next())if(yb(c,e.value.initData))return}0<a.i.size&&ui(a)&&(a.l.resolve(),a.l=new ah,a.l.catch(function(){}));vi(a,b,c,a.g.sessionType)}}function wi(a){a=a.i.keys();a=Eh(a,function(b){return b.sessionId});return Array.from(a)}
|
|
272
|
-
q.ef=function(){var a=this,b=this.i.keys();b=Eh(b,function(c){var d=a.i.get(c);return{sessionId:c.sessionId,sessionType:d.type,initData:d.initData,initDataType:d.initDataType}});return Array.from(b)};q
|
|
273
|
+
q.ef=function(){var a=this,b=this.i.keys();b=Eh(b,function(c){var d=a.i.get(c);return{sessionId:c.sessionId,sessionType:d.type,initData:d.initData,initDataType:d.initDataType}});return Array.from(b)};q.ad=function(){var a=Infinity,b=this.i.keys();b=t(b);for(var c=b.next();!c.done;c=b.next())c=c.value,isNaN(c.expiration)||(a=Math.min(a,c.expiration));return a};q.Id=function(){return Hh(this.fa)};
|
|
273
274
|
function gi(a,b,c){var d,e,f,g,h,k,l,m,n,p,r,u,v,w,y,z;return P(function(D){switch(D.g){case 1:d=new Map;if(c.length){e=xi(a,c,d);D.u(2);break}return G(D,yi(a,b),3);case 3:e=D.h;case 2:f=e;if(!f)throw new T(2,6,6001);Dh(a.j);ua(D,4);a.H.clear();g=f.getConfiguration();h=g.audioCapabilities||[];k=g.videoCapabilities||[];l=t(h);for(m=l.next();!m.done;m=l.next())n=m.value,a.H.add(n.contentType.toLowerCase());p=t(k);for(r=p.next();!r.done;r=p.next())u=r.value,a.H.add(u.contentType.toLowerCase());if(c.length){var A=
|
|
274
275
|
f.keySystem;var B=d.get(f.keySystem);var C=[],E=[],F=[],J=[],K=[],L=new Set,I=new Set;zi(B,C,E,J,F,K,L,I);var N=a.O?"persistent-license":"temporary";A={keySystem:A,encryptionScheme:C[0],licenseServerUri:E[0],distinctiveIdentifierRequired:B[0].distinctiveIdentifierRequired,persistentStateRequired:B[0].persistentStateRequired,sessionType:B[0].sessionType||N,audioRobustness:B[0].audioRobustness||"",videoRobustness:B[0].videoRobustness||"",serverCertificate:J[0],serverCertificateUri:F[0],initData:K,keyIds:L};
|
|
275
276
|
0<I.size&&(A.keySystemUris=I);B=t(B);for(I=B.next();!I.done;I=B.next())I=I.value,I.distinctiveIdentifierRequired&&(A.distinctiveIdentifierRequired=I.distinctiveIdentifierRequired),I.persistentStateRequired&&(A.persistentStateRequired=I.persistentStateRequired);B=A}else B=f.keySystem,I=b.get(f.keySystem),A=[],C=[],E=[],F=[],J=[],K=new Set,zi(I.drmInfos,A,C,F,E,J,K),B={keySystem:B,encryptionScheme:A[0],licenseServerUri:C[0],distinctiveIdentifierRequired:"required"==I.distinctiveIdentifier,persistentStateRequired:"required"==
|
|
@@ -318,14 +319,14 @@ missingKeys:Array.from(f),restrictedKeyStatuses:Array.from(g)},new T(2,4,4012,a)
|
|
|
318
319
|
function(m){k.push({box:m,Oa:1701733238})}).R("hev1",function(m){k.push({box:m,Oa:1701733238})}).R("hvc1",function(m){k.push({box:m,Oa:1701733238})}).R("avc1",function(m){k.push({box:m,Oa:1701733238})}).R("avc3",function(m){k.push({box:m,Oa:1701733238})}).R("ac-3",function(m){k.push({box:m,Oa:1701733217})}).R("ec-3",function(m){k.push({box:m,Oa:1701733217})}).R("ac-4",function(m){k.push({box:m,Oa:1701733217})}).R("mp4a",function(m){k.push({box:m,Oa:1701733217})}).parse(a);if(f)return a;if(0==k.length||
|
|
319
320
|
!g)throw fb(Qe(a)),new T(2,3,3019,b);k.reverse();b=t(k);for(var l=b.next();!l.done;l=b.next())l=l.value,e=Ti(e,g,l.box,h,l.Oa);return dc()&&uc()?(b=new Uint8Array(a.byteLength+e.byteLength),b.set(e),b.set(a,e.byteLength),b):e}
|
|
320
321
|
function Ti(a,b,c,d,e){var f=Ui.value(),g=a.subarray(c.start,c.start+c.size),h=Fb(g),k=new Uint8Array(c.size+f.byteLength);k.set(g,0);g=Fb(k);g.setUint32(4,e);k.set(f,c.size);e=h.getUint32(4);g.setUint32(c.size+16,e);Vi(k,0,k.byteLength);e=new Uint8Array(a.byteLength+k.byteLength);c=ec()||dc()?c.start:c.start+c.size;f=a.subarray(c);e.set(a.subarray(0,c));e.set(k,c);e.set(f,c+k.byteLength);a=t(d);for(d=a.next();!d.done;d=a.next())d=d.value,Vi(e,d.start,d.size+k.byteLength);k=Fb(e,b.start);b=Rh(b);
|
|
321
|
-
a=k.getUint32(b);k.setUint32(b,a+1);return e}function Vi(a,b,c){a=Fb(a,b);b=a.getUint32(0);0!=b&&(1==b?(a.setUint32(8,c>>32),a.setUint32(12,c&4294967295)):a.setUint32(0,c))}var Ui=new Sb(function(){return new Uint8Array([0,0,0,80,115,105,110,102,0,0,0,12,102,114,109,97,0,0,0,0,0,0,0,20,115,99,104,109,0,0,0,0,99,101,110,99,0,1,0,0,0,0,0,40,115,99,104,105,0,0,0,32,116,101,110,99,0,0,0,0,0,0,1,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])});function Wi(a,b,c,d,e,f,g){this.M=a;this.Ga=b;this.ua=c;this.
|
|
322
|
+
a=k.getUint32(b);k.setUint32(b,a+1);return e}function Vi(a,b,c){a=Fb(a,b);b=a.getUint32(0);0!=b&&(1==b?(a.setUint32(8,c>>32),a.setUint32(12,c&4294967295)):a.setUint32(0,c))}var Ui=new Sb(function(){return new Uint8Array([0,0,0,80,115,105,110,102,0,0,0,12,102,114,109,97,0,0,0,0,0,0,0,20,115,99,104,109,0,0,0,0,99,101,110,99,0,1,0,0,0,0,0,40,115,99,104,105,0,0,0,32,116,101,110,99,0,0,0,0,0,0,1,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])});function Wi(a,b,c,d,e,f,g){this.M=a;this.Ga=b;this.ua=c;this.Kc=void 0===d?null:d;this.timescale=void 0===e?null:e;this.g=void 0===f?null:f;this.aesKey=void 0===g?null:g;this.mimeType=this.codecs=null}Wi.prototype.Yb=function(){return this.Ga};Wi.prototype.Vb=function(){return this.ua};Wi.prototype.cd=function(){return this.g};function Xi(a,b){return a===b?!0:a&&b?a.Yb()==b.Yb()&&a.Vb()==b.Vb()&&Qb(a.M().sort(),b.M().sort())&&yb(a.cd(),b.cd()):a==b}S("shaka.media.InitSegmentReference",Wi);
|
|
322
323
|
Wi.prototype.getEndByte=Wi.prototype.Vb;Wi.prototype.getStartByte=Wi.prototype.Yb;
|
|
323
|
-
function
|
|
324
|
-
this.o&&this.g.length&&this.g[this.g.length-1].Fg();this.C=this.bandwidth=this.mimeType=this.codecs=null}q=
|
|
325
|
-
q.
|
|
326
|
-
q.Uf=function(a){null==this.h?Ya("Sync attempted without sync time!"):(a=this.h-a-this.startTime,.001<=Math.abs(a)&&this.offset(a))};q.Vi=function(a){this.C=a};q.
|
|
327
|
-
|
|
328
|
-
|
|
324
|
+
function Yi(a,b,c,d,e,f,g,h,k,l,m,n,p,r,u,v){l=void 0===l?[]:l;r=void 0===r?bj:r;this.startTime=a;this.j=this.endTime=b;this.F=c;this.Ga=d;this.ua=e;this.$=f;this.timestampOffset=g;this.appendWindowStart=h;this.appendWindowEnd=k;this.g=l;this.tilesLayout=void 0===m?"":m;this.B=void 0===n?null:n;this.h=void 0===p?null:p;this.status=r;this.preload=!1;this.l=!0;this.m=!1;this.aesKey=void 0===u?null:u;this.A=null;this.i=0;this.o=void 0===v?!1:v;this.G=this.s=!1;a=t(this.g);for(b=a.next();!b.done;b=a.next())b.value.Gg();
|
|
325
|
+
this.o&&this.g.length&&this.g[this.g.length-1].Fg();this.C=this.bandwidth=this.mimeType=this.codecs=null}q=Yi.prototype;q.M=function(){return this.F()};q.getStartTime=function(){return this.startTime};q.Ih=function(){return this.endTime};q.Yb=function(){return this.Ga};q.Vb=function(){return this.ua};q.$h=function(){return this.tilesLayout};q.Zh=function(){return this.B};q.Zb=function(){return this.status};q.si=function(){this.status=cj};q.xf=function(){this.preload=!0};q.isPreload=function(){return this.preload};
|
|
326
|
+
q.Jc=function(){this.l=!1};q.ji=function(){return this.l};q.Gg=function(){this.s=!0};q.li=function(){return this.s};q.Fg=function(){this.G=!0};q.ki=function(){return this.G};q.Eg=function(){this.m=!0};q.fi=function(){return this.m};q.$g=function(a){this.A=a};q.Yh=function(){return this.A};q.offset=function(a){this.startTime+=a;this.endTime+=a;this.j+=a;for(var b=t(this.g),c=b.next();!c.done;c=b.next())c=c.value,c.startTime+=a,c.endTime+=a,c.j+=a};
|
|
327
|
+
q.Uf=function(a){null==this.h?Ya("Sync attempted without sync time!"):(a=this.h-a-this.startTime,.001<=Math.abs(a)&&this.offset(a))};q.Vi=function(a){this.C=a};q.cd=function(){return this.C};function dj(a,b){a.$=b;a=t(a.g);for(var c=a.next();!c.done;c=a.next())dj(c.value,b)}S("shaka.media.SegmentReference",Yi);Yi.prototype.getSegmentData=Yi.prototype.cd;Yi.prototype.setSegmentData=Yi.prototype.Vi;Yi.prototype.syncAgainst=Yi.prototype.Uf;Yi.prototype.offset=Yi.prototype.offset;
|
|
328
|
+
Yi.prototype.getThumbnailSprite=Yi.prototype.Yh;Yi.prototype.setThumbnailSprite=Yi.prototype.$g;Yi.prototype.hasByterangeOptimization=Yi.prototype.fi;Yi.prototype.markAsByterangeOptimization=Yi.prototype.Eg;Yi.prototype.isLastPartial=Yi.prototype.ki;Yi.prototype.markAsLastPartial=Yi.prototype.Fg;Yi.prototype.isPartial=Yi.prototype.li;Yi.prototype.markAsPartial=Yi.prototype.Gg;Yi.prototype.isIndependent=Yi.prototype.ji;Yi.prototype.markAsNonIndependent=Yi.prototype.Jc;Yi.prototype.isPreload=Yi.prototype.isPreload;
|
|
329
|
+
Yi.prototype.markAsPreload=Yi.prototype.xf;Yi.prototype.markAsUnavailable=Yi.prototype.si;Yi.prototype.getStatus=Yi.prototype.Zb;Yi.prototype.getTileDuration=Yi.prototype.Zh;Yi.prototype.getTilesLayout=Yi.prototype.$h;Yi.prototype.getEndByte=Yi.prototype.Vb;Yi.prototype.getStartByte=Yi.prototype.Yb;Yi.prototype.getEndTime=Yi.prototype.Ih;Yi.prototype.getStartTime=Yi.prototype.getStartTime;Yi.prototype.getUris=Yi.prototype.M;var bj=0,cj=1;Yi.Status={dj:bj,Yj:cj,zj:2};function ej(a){return 1==a.length&&1E-4>a.end(0)-a.start(0)}function fj(a){return!a||ej(a)?null:a.length?a.end(a.length-1):null}function gj(a,b){return!a||!a.length||ej(a)||b>a.end(a.length-1)?!1:b>=a.start(0)}function hj(a,b){if(!a||!a.length||ej(a))return 0;var c=0;a=t(ij(a));for(var d=a.next();!d.done;d=a.next()){var e=d.value;d=e.start;e=e.end;e>b&&(c+=e-Math.max(d,b))}return c}
|
|
329
330
|
function jj(a,b,c){if(!a||!a.length||ej(a))return null;a=ij(a).findIndex(function(d,e,f){return d.start>b&&(0==e||f[e-1].end-b<=c)});return 0<=a?a:null}function ij(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};/*
|
|
330
331
|
@license
|
|
331
332
|
Shaka Player
|
|
@@ -337,7 +338,7 @@ function oj(a){var b={key:a.type,description:"",data:"",mimeType:null,pictureTyp
|
|
|
337
338
|
d=a.data.subarray(1).indexOf(0);if(-1===d)return null;c=Cc(Ab(a.data,1,d));a=Cc(Ab(a.data,2+d)).replace(/\0*$/,"");b.description=c;b.data=a;return b}if("WXXX"===a.type){if(2>a.size||3!==a.data[0])return null;d=a.data.subarray(1).indexOf(0);if(-1===d)return null;c=Cc(Ab(a.data,1,d));a=Cc(Ab(a.data,2+d)).replace(/\0*$/,"");b.description=c;b.data=a;return b}if("PRIV"===a.type){if(2>a.size)return null;c=a.data.indexOf(0);if(-1===c)return null;c=Cc(Ab(a.data,0,c));b.description=c;"com.apple.streaming.transportStreamTimestamp"==
|
|
338
339
|
c?(c=a.data.subarray(c.length+1),a=c[3]&1,c=(c[4]<<23)+(c[5]<<15)+(c[6]<<7)+c[7],c/=45,a&&(c+=4.772185884E7),b.data=c):(a=Bb(a.data.subarray(c.length+1)),b.data=a);return b}if("T"===a.type[0]){if(2>a.size||3!==a.data[0])return null;a=Cc(a.data.subarray(1)).replace(/\0*$/,"");b.data=a;return b}return"W"===a.type[0]?(a=Cc(a.data).replace(/\0*$/,""),b.data=a,b):a.data?(b.data=Bb(a.data),b):null}
|
|
339
340
|
function pj(a){for(var b=0,c=[];lj(a,b);){var d=nj(a,b+6);a[b+5]>>6&1&&(b+=10);b+=10;for(d=b+d;b+10<d;){var e=a.subarray(b),f=nj(e,4);e={type:String.fromCharCode(e[0],e[1],e[2],e[3]),size:f,data:e.subarray(10,10+f)};(f=oj(e))&&c.push(f);b+=e.size+10}mj(a,b)&&(b+=10)}return c}function qj(a,b){for(var c=b=void 0===b?0:b,d=0;lj(a,b);)a[b+5]>>6&1&&(d+=10),d+=10,d+=nj(a,b+6),mj(a,b+10)&&(d+=10),b+=d;return 0<d?a.subarray(c,c+d):new Uint8Array([])}S("shaka.util.Id3Utils",kj);kj.getID3Data=qj;
|
|
340
|
-
kj.getID3Frames=pj;function rj(a,b){var c=null,d=null,e=null,f=a.P();b&1&&(e=a.
|
|
341
|
+
kj.getID3Frames=pj;function rj(a,b){var c=null,d=null,e=null,f=a.P();b&1&&(e=a.Pc());b&2&&a.skip(4);b&8&&(c=a.P());b&16&&(d=a.P());return{trackId:f,Zc:c,Fd:d,bk:e}}function sj(a,b){return 1==b?(b=a.P(),a=a.P(),{baseMediaDecodeTime:b*Math.pow(2,32)+a}):{baseMediaDecodeTime:a.P()}}function tj(a,b){1==b?(a.skip(8),a.skip(8)):(a.skip(4),a.skip(4));b=a.P();a.skip(4);a=a.ka();return{timescale:b,language:String.fromCharCode((a>>10)+96)+String.fromCharCode(((a&960)>>5)+96)+String.fromCharCode((a&31)+96)}}
|
|
341
342
|
function uj(a,b,c){var d=a.P(),e=[],f=null;c&1&&(f=a.P());c&4&&a.skip(4);for(var g=0;g<d;g++){var h={Kf:null,sampleSize:null,ke:null};c&256&&(h.Kf=a.P());c&512&&(h.sampleSize=a.P());c&1024&&a.skip(4);c&2048&&(h.ke=0==b?a.P():a.Ng());e.push(h)}return{fk:d,Rg:e,Bh:f}}function vj(a){a.skip(6);a.skip(2);a.skip(8);var b=a.ka();a.skip(2);a.skip(2);a.skip(2);a=a.ka()+a.ka()/65536;return{channelCount:b,sampleRate:a}}function wj(a){a=a.P();return{codec:Ph(a)}}
|
|
342
343
|
function xj(a){var b=null,c=null,d=a.rb(4);var e=String.fromCharCode(d[0]);e+=String.fromCharCode(d[1]);e+=String.fromCharCode(d[2]);e+=String.fromCharCode(d[3]);if("nclx"===e){switch(a.ka()){case 1:case 5:case 6:case 7:b="srgb";break;case 9:b="rec2020";break;case 11:case 12:b="p3"}d=a.ka();a.ka();switch(d){case 1:case 6:case 13:case 14:case 15:c="SDR";break;case 16:c="PQ";break;case 18:c="HLG"}}return{colorGamut:b,vd:c}}
|
|
343
344
|
function yj(a,b){b=void 0===b?!1:b;a=a.toString(16).toUpperCase();return b?a:("0"+a).slice(-2)}function zj(a){return(10>a?"0":"")+a};/*
|
|
@@ -357,8 +358,8 @@ function yj(a,b){b=void 0===b?!1:b;a=a.toString(16).toUpperCase();return b?a:("0
|
|
|
357
358
|
limitations under the License.
|
|
358
359
|
*/
|
|
359
360
|
function Aj(a,b){this.j=a;if(void 0===b?0:b){b=new Uint8Array(a.byteLength);for(var c=0,d=0;d<a.byteLength;d++)2<=d&&3==a[d]&&0==a[d-1]&&0==a[d-2]||(b[c]=a[d],c++);this.j=Ab(b,0,c)}this.i=this.j.byteLength;this.g=this.h=0}function Bj(a){var b=a.j.byteLength-a.i,c=new Uint8Array(4),d=Math.min(4,a.i);0!==d&&(c.set(a.j.subarray(b,b+d)),a.h=(new Ih(c,0)).P(),a.g=8*d,a.i-=d)}function Cj(a,b){if(a.g<=b){b-=a.g;var c=Math.floor(b/8);b-=8*c;a.g-=c;Bj(a)}a.h<<=b;a.g-=b}
|
|
360
|
-
function Dj(a,b){var c=Math.min(a.g,b),d=a.h>>>32-c;a.g-=c;0<a.g?a.h<<=c:0<a.i&&Bj(a);c=b-c;return 0<c?d<<c|Dj(a,c):d}function Ej(a){var b;for(b=0;b<a.g;++b)if(0!==(a.h&2147483648>>>b))return a.h<<=b,a.g-=b,b;Bj(a);return b+Ej(a)}function Fj(a){Cj(a,1+Ej(a))}function W(a){var b=Ej(a);return Dj(a,b+1)-1}function
|
|
361
|
-
function Qj(a,b){for(var c=8,d=8,e=0;e<b;e++)0!==d&&(d=
|
|
361
|
+
function Dj(a,b){var c=Math.min(a.g,b),d=a.h>>>32-c;a.g-=c;0<a.g?a.h<<=c:0<a.i&&Bj(a);c=b-c;return 0<c?d<<c|Dj(a,c):d}function Ej(a){var b;for(b=0;b<a.g;++b)if(0!==(a.h&2147483648>>>b))return a.h<<=b,a.g-=b,b;Bj(a);return b+Ej(a)}function Fj(a){Cj(a,1+Ej(a))}function W(a){var b=Ej(a);return Dj(a,b+1)-1}function Gj(a){a=W(a);return 1&a?1+a>>>1:-1*(a>>>1)}function Oj(a){return 1===Dj(a,1)}function Pj(a){return Dj(a,8)}
|
|
362
|
+
function Qj(a,b){for(var c=8,d=8,e=0;e<b;e++)0!==d&&(d=Gj(a),d=(c+d+256)%256),c=0===d?c:d}function Rj(a){Pj(a);W(a);return W(a)}S("shaka.util.ExpGolomb",Aj);function Sj(){this.G=null;this.H=!1;this.m=this.J=null;this.j=[];this.g=[];this.A=this.B=null;this.i=[];this.h=[];this.C=null;this.l=[];this.F=this.o=this.s=null}q=Sj.prototype;q.clearData=function(){this.j=[];this.g=[];this.i=[];this.h=[];this.l=[]};
|
|
362
363
|
q.parse=function(a){if(564>a.length)return this;for(var b=Math.max(0,Tj(a)),c=a.length-(a.length+b)%188,d=!1,e=b;e<c;e+=188)if(71==a[e]){var f=!!(a[e+1]&64),g=((a[e+1]&31)<<8)+a[e+2];if(1<(a[e+3]&48)>>4){var h=e+5+a[e+4];if(h==e+188)continue}else h=e+4;switch(g){case 0:f&&(h+=a[h]+1);this.G=(a[h+10]&31)<<8|a[h+11];break;case 17:case 8191:break;case this.G:f&&(h+=a[h]+1);f=a;g={audio:-1,video:-1,Od:-1,audioCodec:"",videoCodec:""};var k=h+3+((f[h+1]&15)<<8|f[h+2])-4;for(h+=12+((f[h+10]&15)<<8|f[h+11]);h<
|
|
363
364
|
k;){var l=(f[h+1]&31)<<8|f[h+2],m=(f[h+3]&15)<<8|f[h+4];switch(f[h]){case 6:if(0<m)for(var n=h+5,p=m;2<p;){var r=f[n+1]+2;switch(f[n]){case 5:var u=Gc(f.subarray(n+2,n+r));-1==g.audio&&"Opus"===u?(g.audio=l,g.audioCodec="opus"):-1==g.video&&"AV01"===u&&(g.video=l,g.videoCodec="av1");break;case 106:-1==g.audio&&(g.audio=l,g.audioCodec="ac3");break;case 122:-1==g.audio&&(g.audio=l,g.audioCodec="ec3");break;case 124:-1==g.audio&&(g.audio=l,g.audioCodec="aac");break;case 127:"opus"==g.audioCodec&&(u=
|
|
364
365
|
null,128===f[n+2]&&(u=f[n+3]),null!=u&&(this.F={channelCount:0===(u&15)?2:u&15,yh:u,sampleRate:48E3}))}n+=r;p-=r}break;case 15:-1==g.audio&&(g.audio=l,g.audioCodec="aac");break;case 17:-1==g.audio&&(g.audio=l,g.audioCodec="aac-loas");break;case 21:-1==g.Od&&(g.Od=l);break;case 27:-1==g.video&&(g.video=l,g.videoCodec="avc");break;case 3:case 4:-1==g.audio&&(g.audio=l,g.audioCodec="mp3");break;case 36:-1==g.video&&(g.video=l,g.videoCodec="hvc");break;case 129:-1==g.audio&&(g.audio=l,g.audioCodec="ac3");
|
|
@@ -370,14 +371,14 @@ q.Df=function(a,b,c){var d=a.pts?a.pts/9E4:null;a=a.data;var e=a.byteLength,f=1;
|
|
|
370
371
|
n++;k=n;l="hvc"==this.m?a[n]>>1&63:a[n]&31}g=0}else g++;n>=e-1&&0<=k&&0<=g&&(m={data:a.subarray(k+f,e),fullData:a.subarray(k,e),type:l,time:d})}m&&h.push(m);!h.length&&b&&(b.data=Re(b.data,a),b.fullData=Re(b.fullData,a));return h};q.getMetadata=function(){for(var a=[],b=t(this.l),c=b.next();!c.done;c=b.next())c=Re.apply(Le,x(c.value)),(c=Uj(this,c))&&a.push({cueTime:c.pts?c.pts/9E4:null,data:c.data,frames:pj(c.data),dts:c.dts,pts:c.pts});return a};
|
|
371
372
|
q.Ub=function(){if(this.i.length&&!this.h.length){for(var a=!1,b=t(this.i),c=b.next();!c.done;c=b.next()){var d=Re.apply(Le,x(c.value)),e=Uj(this,d);c=this.h.length?this.h[this.h.length-1]:null;e&&null!=e.pts&&null!=e.dts&&(!c||c.pts!=e.pts&&c.dts!=e.dts)?(this.h.length&&e.dts<(c.dts||0)&&(a=!0),this.h.push(e)):this.h.length&&(d=e?e.data:d)&&(c=this.h.pop(),c.data=Re(c.data,d),this.h.push(c))}a&&(this.h=this.h.sort(function(f,g){var h=(f.pts||0)-(g.pts||0);return(f.dts||0)-(g.dts||0)||h}))}return this.h};
|
|
372
373
|
q.nc=function(a){a=void 0===a?!0:a;if(this.j.length&&!this.g.length){for(var b=!1,c=t(this.j),d=c.next();!d.done;d=c.next()){var e=Re.apply(Le,x(d.value)),f=Uj(this,e);d=this.g.length?this.g[this.g.length-1]:null;f&&null!=f.pts&&null!=f.dts&&(!d||d.pts!=f.pts&&d.dts!=f.dts)?(this.g.length&&f.dts<(d.dts||0)&&(b=!0),this.g.push(f)):this.g.length&&(e=f?f.data:e)&&(d=this.g.pop(),d.data=Re(d.data,e),this.g.push(d))}if(a){c=[];d=t(this.g);for(e=d.next();!e.done;e=d.next())if(e=e.value,e.nalus=this.Df(e,
|
|
373
|
-
g,void 0),e.nalus.length){c.push(e);var g=e.nalus[e.nalus.length-1]}this.g=c}b&&(this.g=this.g.sort(function(h,k){var l=(h.pts||0)-(k.pts||0);return(h.dts||0)-(k.dts||0)||l}))}return a?this.g:(a=this.g,this.g=[],a)};q.getStartTime=function(a){if("audio"==a){a=null;var b=this.Ub();b.length&&(a=b[0],a=Math.min(a.dts,a.pts)/9E4);return a}return"video"==a?(a=null,b=this.nc(!1),b.length&&(a=b[0],a=Math.min(a.dts,a.pts)/9E4),a):null};q
|
|
374
|
+
g,void 0),e.nalus.length){c.push(e);var g=e.nalus[e.nalus.length-1]}this.g=c}b&&(this.g=this.g.sort(function(h,k){var l=(h.pts||0)-(k.pts||0);return(h.dts||0)-(k.dts||0)||l}))}return a?this.g:(a=this.g,this.g=[],a)};q.getStartTime=function(a){if("audio"==a){a=null;var b=this.Ub();b.length&&(a=b[0],a=Math.min(a.dts,a.pts)/9E4);return a}return"video"==a?(a=null,b=this.nc(!1),b.length&&(a=b[0],a=Math.min(a.dts,a.pts)/9E4),a):null};q.$c=function(){return{audio:this.A,video:this.m}};
|
|
374
375
|
q.Md=function(){for(var a=[],b=t(this.nc()),c=b.next();!c.done;c=b.next())a.push.apply(a,x(c.value.nalus));return a};q.ci=function(){rb("TsParser.getVideoResolution","Please use getVideoInfo function instead.");var a=this.kf();return{height:a.height,width:a.width}};q.kf=function(){return"hvc"==this.m?Wj(this):Xj(this)};function Yj(a){var b=a.nc();return 1<b.length&&(a=b[0].pts,b=b[1].pts,!isNaN(b-a))?String(1/(b-a)*9E4):null}
|
|
375
376
|
function Xj(a){var b={height:null,width:null,codec:null,frameRate:null},c=a.Md();if(!c.length)return b;c=c.find(function(r){return 7==r.type});if(!c)return b;c=new Aj(c.data);var d=Pj(c),e=Pj(c),f=Pj(c);Fj(c);if(Zj.includes(d)){var g=W(c);3===g&&Cj(c,1);Fj(c);Fj(c);Cj(c,1);if(Oj(c)){g=3!==g?8:12;for(var h=0;h<g;h++)Oj(c)&&(6>h?Qj(c,16):Qj(c,64))}}Fj(c);g=W(c);if(0===g)W(c);else if(1===g)for(Cj(c,1),Fj(c),Fj(c),g=W(c),h=0;h<g;h++)Fj(c);Fj(c);Cj(c,1);g=W(c);h=W(c);var k=Dj(c,1);0===k&&Cj(c,1);Cj(c,
|
|
376
377
|
1);var l=0,m=0,n=0,p=0;Oj(c)&&(l=W(c),m=W(c),n=W(c),p=W(c));b.height=String((2-k)*(h+1)*16-2*n-2*p);b.width=String(16*(g+1)-2*l-2*m);b.codec="avc1."+("0"+d.toString(16).toUpperCase()).slice(-2)+("0"+e.toString(16).toUpperCase()).slice(-2)+("0"+f.toString(16).toUpperCase()).slice(-2);b.frameRate=Yj(a);return b}
|
|
377
378
|
function Wj(a){var b={height:null,width:null,codec:null,frameRate:null},c=a.Md();if(!c.length)return b;c=c.find(function(B){return 33==B.type});if(!c)return b;var d=new Aj(c.fullData,!0);Pj(d);Pj(d);Dj(d,4);var e=Dj(d,3);Oj(d);var f=Dj(d,2),g=Dj(d,1),h=Dj(d,5),k=Dj(d,32);c=Pj(d);for(var l=Pj(d),m=Pj(d),n=Pj(d),p=Pj(d),r=Pj(d),u=Pj(d),v=[],w=[],y=0;y<e;y++)v.push(Oj(d)),w.push(Oj(d));if(0<e)for(y=e;8>y;y++)Dj(d,2);for(y=0;y<e;y++)v[y]&&Dj(d,88),w[y]&&Pj(d);W(d);e=W(d);3==e&&Dj(d,1);v=W(d);w=W(d);var z=
|
|
378
379
|
y=0,D=0,A=0;Oj(d)&&(y+=W(d),z+=W(d),D+=W(d),A+=W(d));b.width=String(v-(y+z)*(1===e||2===e?2:1));b.height=String(w-(D+A)*(1===e?2:1));d=function(B){for(var C=0,E=0;32>E;E++)C|=(B>>E&1)<<31-E;return C>>>0}(k);g=1==g?"H":"L";f="hvc1"+("."+["","A","B","C"][f]+h);f+="."+d.toString(16).toUpperCase();f+="."+g+u;r&&(f+="."+r.toString(16).toUpperCase());p&&(f+="."+p.toString(16).toUpperCase());n&&(f+="."+n.toString(16).toUpperCase());m&&(f+="."+m.toString(16).toUpperCase());l&&(f+="."+l.toString(16).toUpperCase());
|
|
379
380
|
c&&(f+="."+c.toString(16).toUpperCase());b.codec=f;b.frameRate=Yj(a);return b}function Vj(a,b){var c=1;for(a>b&&(c=-1);4294967296<Math.abs(b-a);)a+=8589934592*c;return a}function ak(a){return 0>Tj(a)?!1:!0}function Tj(a){for(var b=Math.min(1E3,a.length-564),c=0;c<b;){if(71==a[c]&&71==a[c+188]&&71==a[c+376])return c;c++}return-1}S("shaka.util.TsParser",Sj);Sj.syncOffset=Tj;Sj.probe=ak;Sj.prototype.getVideoInfo=Sj.prototype.kf;Sj.prototype.getVideoResolution=Sj.prototype.ci;
|
|
380
|
-
Sj.prototype.getVideoNalus=Sj.prototype.Md;Sj.prototype.getCodecs=Sj.prototype
|
|
381
|
+
Sj.prototype.getVideoNalus=Sj.prototype.Md;Sj.prototype.getCodecs=Sj.prototype.$c;Sj.prototype.getStartTime=Sj.prototype.getStartTime;Sj.prototype.getVideoData=Sj.prototype.nc;Sj.prototype.getAudioData=Sj.prototype.Ub;Sj.prototype.getMetadata=Sj.prototype.getMetadata;Sj.prototype.parseNalus=Sj.prototype.Df;Sj.prototype.parseAvcNalus=Sj.prototype.yi;Sj.prototype.parse=Sj.prototype.parse;Sj.prototype.clearData=Sj.prototype.clearData;Sj.Timescale=9E4;
|
|
381
382
|
var Zj=[100,110,122,244,44,83,86,118,128,138,139,134];function bk(a,b,c){this.g=null;this.o=-1;this.l=a;this.i=b;this.m=c;this.j=!1;a:{"undefined"===typeof libDPIModule&&Za("Could not find LCEVC Library dependencies on this page");if("undefined"!==typeof LCEVCdec)this.h=LCEVCdec;else if("undefined"!==typeof LcevcDil)this.h=LcevcDil,this.j=!0,rb("LcevcDil","lcevc_dil.js is deprecated, please use lcevc_dec.js instead");else{Za("Could not find LCEVC Library on this page");a=!1;break a}"undefined"===typeof this.h.SupportObject?(Za("Could not find LCEVC Library on this page"),
|
|
382
383
|
a=!1):(this.h.SupportObject.SupportStatus||Za(this.h.SupportObject.SupportError),a="undefined"!==typeof this.h&&"undefined"!==typeof libDPIModule&&this.i instanceof HTMLCanvasElement&&this.h.SupportObject.SupportStatus)}a&&!this.g&&this.h.SupportObject.webGLSupport(this.i)&&(this.i.classList.remove("shaka-hidden"),this.g=this.j?new this.h.LcevcDil(this.l,this.i,this.m):new this.h.LCEVCdec(this.l,this.i,this.m))}function ck(a){a.g&&a.i.classList.add("shaka-hidden")}
|
|
383
384
|
bk.prototype.release=function(){this.g&&(this.g.close(),this.g=null)};function dk(a,b,c){var d=0,e=-1;switch(b.mimeType){case "video/webm":d=1;break;case "video/mp4":d=2}switch(c){case "DASH":e=1;break;case "HLS":e=0}a.g&&(a.o=b.id,a.g.setLevelSwitching(b.id,!0),a.g.setContainerFormat(d),a.j||a.g.setStreamingFormat(e))}S("shaka.lcevc.Dec",bk);bk.prototype.release=bk.prototype.release;function ek(a,b,c,d){var e=this;this.i=a;this.aa=c;this.A=null;this.ca=b;this.h={};this.F={};this.Da={};this.g=null;this.fa=!1;this.T=d||null;this.l={};this.s=new hb;this.j={};this.G=null;this.K=new ah;this.L="";this.za=!1;this.m=fk(this,this.K);this.C=!1;this.H=new Ch(function(){return gk(e)});this.B=!1;this.X="UNKNOWN";this.Ea=this.Fa=!1;this.ya=new ah;this.o=!1;this.sa=!0;this.ma=this.N=this.na=this.O=this.J=this.ea=null;this.ga=new ah}
|
|
@@ -417,8 +418,8 @@ function Lk(a,b,c,d){if(b==Ye)var e=!1;else{e=kf(of(a.F[b]));var f=nf(a.F[b]),g=
|
|
|
417
418
|
q.Jg=function(a,b){if(0!=a.length){var c=(Date.now()+this.A)/1E3;a=a.filter(function(e){return e.start+b<c});if(0!=a.length){var d=a[a.length-1].end+b;this.Zd(a[0].start+b);this.g=a.reduce(function(e,f){return Math.max(e,f.end-f.start)},this.g);this.h=Math.max(this.h,d);null!=this.i&&this.C&&!this.s&&(this.i=c-this.h-this.g)}}};
|
|
418
419
|
q.qd=function(a){if(0!=a.length){var b=a[0].startTime,c=a[0].endTime,d=(Date.now()+this.A)/1E3;a=t(a);for(var e=a.next();!e.done;e=a.next())e=e.value,d<e.startTime||(b=Math.min(b,e.startTime),c=Math.max(c,e.endTime),this.g=Math.max(this.g,e.endTime-e.startTime));this.Zd(b);this.h=Math.max(this.h,c);null!=this.i&&this.C&&!this.s&&(this.i=d-this.h-this.g)}};q.Ph=function(){return this.h};q.Ud=function(){this.s=!0};q.mi=function(){return this.s};q.Xg=function(a){this.m=a};q.Lh=function(){return this.m};
|
|
419
420
|
q.Zd=function(a){this.l=null==this.l?a:Math.min(this.l,a)};q.yf=function(a){this.g=Math.max(this.g,a)};q.offset=function(a){null!=this.l&&(this.l+=a);null!=this.h&&(this.h+=a)};q.U=function(){return Infinity==this.j&&!this.G};q.pc=function(){return Infinity!=this.j&&!this.G};q.nb=function(){return Math.max(this.H,this.Xb()-this.o)};q.bh=function(a){this.H=a};
|
|
420
|
-
q.Xb=function(){return this.U()||this.pc()?Math.min(Math.max(0,(Date.now()+this.A)/1E3-this.g-this.i)+this.F,this.j):this.h?Math.min(this.h,this.j):this.j};q.
|
|
421
|
-
q.Vg=function(a){this.F=a};q.Fh=function(){return this.F};S("shaka.media.PresentationTimeline",Mk);Mk.prototype.getAvailabilityTimeOffset=Mk.prototype.Fh;Mk.prototype.setAvailabilityTimeOffset=Mk.prototype.Vg;Mk.prototype.usingPresentationStartTime=Mk.prototype.jh;Mk.prototype.getSeekRangeEnd=Mk.prototype.zb;Mk.prototype.getSeekRangeStart=Mk.prototype.Wb;Mk.prototype.getSafeSeekRangeStart=Mk.prototype.
|
|
421
|
+
q.Xb=function(){return this.U()||this.pc()?Math.min(Math.max(0,(Date.now()+this.A)/1E3-this.g-this.i)+this.F,this.j):this.h?Math.min(this.h,this.j):this.j};q.bd=function(a){var b=Math.max(this.l,this.H);return Infinity==this.o?Math.ceil(1E3*b)/1E3:Math.max(b,Math.min(this.Xb()-this.o+a,this.zb()))};q.Wb=function(){return this.bd(0)};q.zb=function(){return Math.max(0,this.Xb()-(this.U()||this.pc()?this.B:0))};q.jh=function(){return null==this.i||null!=this.h&&this.C?!1:!0};
|
|
422
|
+
q.Vg=function(a){this.F=a};q.Fh=function(){return this.F};S("shaka.media.PresentationTimeline",Mk);Mk.prototype.getAvailabilityTimeOffset=Mk.prototype.Fh;Mk.prototype.setAvailabilityTimeOffset=Mk.prototype.Vg;Mk.prototype.usingPresentationStartTime=Mk.prototype.jh;Mk.prototype.getSeekRangeEnd=Mk.prototype.zb;Mk.prototype.getSeekRangeStart=Mk.prototype.Wb;Mk.prototype.getSafeSeekRangeStart=Mk.prototype.bd;Mk.prototype.getSegmentAvailabilityEnd=Mk.prototype.Xb;Mk.prototype.setUserSeekStart=Mk.prototype.bh;
|
|
422
423
|
Mk.prototype.getSegmentAvailabilityStart=Mk.prototype.nb;Mk.prototype.isInProgress=Mk.prototype.pc;Mk.prototype.isLive=Mk.prototype.U;Mk.prototype.offset=Mk.prototype.offset;Mk.prototype.notifyMaxSegmentDuration=Mk.prototype.yf;Mk.prototype.notifyMinSegmentStartTime=Mk.prototype.Zd;Mk.prototype.getInitialProgramDateTime=Mk.prototype.Lh;Mk.prototype.setInitialProgramDateTime=Mk.prototype.Xg;Mk.prototype.isStartTimeLocked=Mk.prototype.mi;Mk.prototype.lockStartTime=Mk.prototype.Ud;
|
|
423
424
|
Mk.prototype.getMaxSegmentEndTime=Mk.prototype.Ph;Mk.prototype.notifySegments=Mk.prototype.qd;Mk.prototype.notifyTimeRange=Mk.prototype.Jg;Mk.prototype.getDelay=Mk.prototype.Hh;Mk.prototype.setDelay=Mk.prototype.Of;Mk.prototype.getSegmentAvailabilityDuration=Mk.prototype.Ld;Mk.prototype.setSegmentAvailabilityDuration=Mk.prototype.ne;Mk.prototype.setStatic=Mk.prototype.vc;Mk.prototype.setClockOffset=Mk.prototype.Wg;Mk.prototype.getPresentationStartTime=Mk.prototype.Th;Mk.prototype.setDuration=Mk.prototype.Za;
|
|
424
425
|
Mk.prototype.setPresentationStartTime=Mk.prototype.Yg;Mk.prototype.getMaxSegmentDuration=Mk.prototype.Oh;Mk.prototype.getDuration=Mk.prototype.getDuration;function Nk(a,b,c){this.j=c;this.l=a;this.s=Ok(a);this.g=a.g.currentTime;this.m=Date.now()/1E3;this.h=!1;this.o=0;this.A=b;this.i=function(){}}Nk.prototype.release=function(){this.j=this.l=null;this.i=function(){}};function Pk(a,b){a.i=b}function Qk(a){this.g=a}function Ok(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(ij(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 Rk(a,b,c,d,e){var f=this;this.A=e;this.g=a;this.B=b;this.s=c;this.l=new hb;this.j=!1;this.F=a.readyState;this.C=this.i=0;this.h=d;this.o=!1;this.l.D(a,"waiting",function(){return Sk(f)});this.m=(new $b(function(){Sk(f)})).Ra(this.s.gapJumpTimerTime)}Rk.prototype.release=function(){this.l&&(this.l.release(),this.l=null);null!=this.m&&(this.m.stop(),this.m=null);this.h&&(this.h.release(),this.h=null);this.g=this.B=this.A=null};Rk.prototype.Bf=function(){this.o=!0;Sk(this)};
|
|
@@ -430,23 +431,23 @@ q.wd=function(){return(this.j?this.h.currentTime:this.g)||0};q.dg=function(){ret
|
|
|
430
431
|
function cl(a,b,c,d,e,f){var g=this;this.i=a;this.g=b.presentationTimeline;this.B=b.minBufferTime||0;this.l=c;this.A=e;this.s=null;this.o=dl(a,c,f);this.j=new Rk(a,b.presentationTimeline,c,this.o,f);this.h=new Vk(a,function(){a:{var h=g.j;h.j=!0;h.o=!1;var k=Yk(g.h);h=el(g,k);if(.001<Math.abs(h-k)){k=!1;if(!mc()||mc()&&vc())k=!0;else{var l=Date.now()/1E3;if(!g.s||g.s<l-1)g.s=l,k=!0}if(k){Zk(g.h,h);h=void 0;break a}}g.A();h=void 0}return h},function(h){var k=g.j;k.g.seeking&&!k.j&&(k.j=!0,k.i=h)},
|
|
431
432
|
function(){var h=d;null==h?h=Infinity>g.g.getDuration()?g.g.Wb():g.g.zb():0>h&&(h=g.g.zb()+h);return fl(g,gl(g,h))});this.m=new $b(function(){if(0!=g.i.readyState&&!g.i.paused){var h=Yk(g.h),k=g.g.Wb(),l=g.g.zb();3>l-k&&(k=l-3);h<k&&(h=el(g,h),g.i.currentTime=h)}})}q=cl.prototype;q.ready=function(){this.m.Ra(.25)};q.release=function(){this.h&&(this.h.release(),this.h=null);this.j&&(this.j.release(),this.j=null);this.m&&(this.m.stop(),this.m=null);this.i=this.h=this.g=this.l=null;this.A=function(){}};
|
|
432
433
|
q.Ee=function(a){Zk(this.h,a)};q.wd=function(){var a=Yk(this.h);return 0<this.i.readyState&&!this.i.paused?gl(this,a):a};q.dg=function(){return this.o?this.o.o:0};q.cg=function(){return this.j.C};q.Ig=function(){this.j.Bf()};function fl(a,b){var c=a.g.getDuration();return b>=c?c-a.l.durationBackoff:b}
|
|
433
|
-
function el(a,b){var c=Math.max(a.B,a.l.rebufferingGoal),d=a.l.safeSeekOffset,e=a.g.Wb(),f=a.g.zb(),g=a.g.getDuration();3>f-e&&(e=f-3);var h=a.g.
|
|
434
|
-
function dl(a,b,c){if(!b.stallEnabled)return null;var d=b.stallSkip;b=new Nk(new Qk(a),b.stallThreshold,c);Pk(b,function(){d?a.currentTime+=d:(a.pause(),a.play())});return b};function hl(a){this.g=a;this.m=null;this.
|
|
435
|
-
q.find=function(a){for(var b=this.g.length-1,c=b;0<=c;--c){var d=this.g[c],e=c<b?this.g[c+1].startTime:d.endTime;if(a>=d.startTime&&a<e)return c+this.
|
|
436
|
-
q.Wd=function(a){if(!this.o&&a.length){var b=Math.round(1E3*a[0].startTime)/1E3;this.g=this.g.filter(function(c){return Math.round(1E3*c.startTime)/1E3<b});this.g.push.apply(this.g,x(a))}};q.od=function(a,b){var c=this;a=a.filter(function(d){return d.endTime>b&&(0==c.g.length||d.endTime>c.g[0].startTime)});this.Wd(a);this.Ma(b)};q.Ma=function(a){if(!this.o){var b=this.g.length;this.g=this.g.filter(function(c){return c.endTime>a});this.
|
|
437
|
-
q.Ec=function(a,b,c){c=void 0===c?!1:c;if(!this.o){for(;this.g.length;)if(this.g[this.g.length-1].startTime>=b)this.g.pop();else break;for(;this.g.length;)if(this.g[0].endTime<=a)this.g.shift(),c||this.
|
|
434
|
+
function el(a,b){var c=Math.max(a.B,a.l.rebufferingGoal),d=a.l.safeSeekOffset,e=a.g.Wb(),f=a.g.zb(),g=a.g.getDuration();3>f-e&&(e=f-3);var h=a.g.bd(c),k=a.g.bd(d);c=a.g.bd(c+d);return b>=g?fl(a,b):b>f?f:b<e?gj(a.i.buffered,k)?k:c:b>=h||gj(a.i.buffered,b)?b:c}function gl(a,b){var c=a.g.Wb();if(b<c)return c;a=a.g.zb();return b>a?a:b}
|
|
435
|
+
function dl(a,b,c){if(!b.stallEnabled)return null;var d=b.stallSkip;b=new Nk(new Qk(a),b.stallThreshold,c);Pk(b,function(){d?a.currentTime+=d:(a.pause(),a.play())});return b};function hl(a){this.g=a;this.m=null;this.i=0;this.o=!1}q=hl.prototype;q.getNumReferences=function(){return this.g.length};q.getNumEvicted=function(){return this.i};q.release=function(){this.o||(this.g=[],this.m&&this.m.stop(),this.m=null)};q.ti=function(){this.o=!0};q.Gb=function(a){for(var b=t(this.g),c=b.next();!c.done;c=b.next())a(c.value)};function og(a){return a.g[0]||null}
|
|
436
|
+
q.find=function(a){for(var b=this.g.length-1,c=b;0<=c;--c){var d=this.g[c],e=c<b?this.g[c+1].startTime:d.endTime;if(a>=d.startTime&&a<e)return c+this.i}return this.g.length&&a<this.g[0].startTime?this.i:null};q.get=function(a){if(0==this.g.length)return null;a-=this.i;return 0>a||a>=this.g.length?null:this.g[a]};q.offset=function(a){if(!this.o)for(var b=t(this.g),c=b.next();!c.done;c=b.next())c.value.offset(a)};
|
|
437
|
+
q.Wd=function(a){if(!this.o&&a.length){var b=Math.round(1E3*a[0].startTime)/1E3;this.g=this.g.filter(function(c){return Math.round(1E3*c.startTime)/1E3<b});this.g.push.apply(this.g,x(a))}};q.od=function(a,b){var c=this;a=a.filter(function(d){return d.endTime>b&&(0==c.g.length||d.endTime>c.g[0].startTime)});this.Wd(a);this.Ma(b)};q.Ma=function(a){if(!this.o){var b=this.g.length;this.g=this.g.filter(function(c){return c.endTime>a});this.i+=b-this.g.length}};
|
|
438
|
+
q.Ec=function(a,b,c){c=void 0===c?!1:c;if(!this.o){for(;this.g.length;)if(this.g[this.g.length-1].startTime>=b)this.g.pop();else break;for(;this.g.length;)if(this.g[0].endTime<=a)this.g.shift(),c||this.i++;else break;0!=this.g.length&&(a=this.g[this.g.length-1],b=new Yi(a.startTime,b,a.F,a.Ga,a.ua,a.$,a.timestampOffset,a.appendWindowStart,a.appendWindowEnd,a.g,a.tilesLayout,a.B,a.h,a.status,a.aesKey),b.mimeType=a.mimeType,b.codecs=a.codecs,b.i=a.i,this.g[this.g.length-1]=b)}};
|
|
438
439
|
q.re=function(a,b){var c=this;this.o||(this.m&&this.m.stop(),this.m=new $b(function(){var d=b();d?c.g.push.apply(c.g,x(d)):(c.m.stop(),c.m=null)}),this.m.Ra(a))};hl.prototype[Symbol.iterator]=function(){return this.Ib(0)};
|
|
439
|
-
hl.prototype.Ib=function(a,b,c){b=void 0===b?!1:b;c=void 0===c?!1:c;var d=this.find(a);if(null==d)return null;var e=this.get(d);c?d++:d--;var f=-1;if(e&&0<e.g.length)for(var g=e.g.length-1;0<=g;--g){var h=e.g[g];if(a>=h.startTime&&a<h.endTime){if(!b){for(;g&&!h.l;)g--,h=e.g[g];if(!h.l)return Ya("No independent partial segment found!"),null}c?d--:d++;f=g-1;break}}return new il(this,d,f,c)};function jl(a,b,c){a=new
|
|
440
|
+
hl.prototype.Ib=function(a,b,c){b=void 0===b?!1:b;c=void 0===c?!1:c;var d=this.find(a);if(null==d)return null;var e=this.get(d);c?d++:d--;var f=-1;if(e&&0<e.g.length)for(var g=e.g.length-1;0<=g;--g){var h=e.g[g];if(a>=h.startTime&&a<h.endTime){if(!b){for(;g&&!h.l;)g--,h=e.g[g];if(!h.l)return Ya("No independent partial segment found!"),null}c?d--:d++;f=g-1;break}}return new il(this,d,f,c)};function jl(a,b,c){a=new Yi(a,a+b,function(){return c},0,null,null,a,a,a+b);return new hl([a])}
|
|
440
441
|
S("shaka.media.SegmentIndex",hl);hl.forSingleSegment=jl;hl.prototype.getIteratorForTime=hl.prototype.Ib;hl.prototype.updateEvery=hl.prototype.re;hl.prototype.fit=hl.prototype.Ec;hl.prototype.evict=hl.prototype.Ma;hl.prototype.mergeAndEvict=hl.prototype.od;hl.prototype.offset=hl.prototype.offset;hl.prototype.get=hl.prototype.get;hl.prototype.find=hl.prototype.find;hl.prototype.markImmutable=hl.prototype.ti;hl.prototype.release=hl.prototype.release;hl.prototype.getNumEvicted=hl.prototype.getNumEvicted;
|
|
441
|
-
hl.prototype.getNumReferences=hl.prototype.getNumReferences;function il(a,b,c,d){this.i=a;this.h=b;this.g=c;this.reverse=d}il.prototype.
|
|
442
|
+
hl.prototype.getNumReferences=hl.prototype.getNumReferences;function il(a,b,c,d){this.i=a;this.h=b;this.g=c;this.reverse=d}il.prototype.Tc=function(a){this.reverse=a};il.prototype.Ah=function(){return this.h};il.prototype.current=function(){var a=this.i.get(this.h);a&&0<a.g.length&&a.o&&this.g>=a.g.length&&(this.h++,this.g=0,a=this.i.get(this.h));return a&&0<a.g.length?a.g[this.g]:a};
|
|
442
443
|
il.prototype.next=function(){var a=this.i.get(this.h);this.reverse?a&&0<a.g.length?(this.g--,0>this.g&&(this.h--,this.g=(a=this.i.get(this.h))&&0<a.g.length?a.g.length-1:0)):(this.h--,this.g=0):a&&0<a.g.length?(this.g++,a.o&&this.g==a.g.length&&(this.h++,this.g=0)):(this.h++,this.g=0);a=this.current();return{value:a,done:!a}};S("shaka.media.SegmentIterator",il);il.prototype.next=il.prototype.next;il.prototype.current=il.prototype.current;il.prototype.currentPosition=il.prototype.Ah;
|
|
443
|
-
il.prototype.setReverse=il.prototype.
|
|
444
|
-
q.get=function(a){for(var b=
|
|
445
|
-
kl.prototype.offset=kl.prototype.offset;kl.prototype.get=kl.prototype.get;kl.prototype.find=kl.prototype.find;kl.prototype.forEachTopLevelReference=kl.prototype.Gb;kl.prototype.release=kl.prototype.release;function ll(a){var b=this;this.g=a;this.j=!1;this.i=this.g.Kd();this.h=new $b(function(){b.g.Hg(.25*b.i)})}ll.prototype.release=function(){this.set(this.lc());this.h&&(this.h.stop(),this.h=null);this.g=null};ll.prototype.set=function(a){this.i=a;ml(this)};ll.prototype.lc=function(){return this.g.lc()};function ml(a){a.h.stop();var b=a.j?0:a.i;if(0<=b)try{a.g.Kd()!=b&&a.g.Rf(b);return}catch(c){}a.h.Ra(.25);0!=a.g.Kd()&&a.g.Rf(0)};function nl(a){var b=this;this.h=a;this.g=new Set;this.i=(new $b(function(){ol(b,!1)})).Ra(.25)}nl.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 ol(a,b){for(var c=t(a.g),d=c.next();!d.done;d=c.next())d.value.j(a.h.currentTime,b)};function pl(){this.g=null;this.h=[]}function ql(a,b){var c=0;a.g&&a.g.state==b&&(c+=a.g.duration);a=t(a.h);for(var d=a.next();!d.done;d=a.next())d=d.value,c+=d.state==b?d.duration:0;return c}function rl(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 sl(){this.i=this.h=null;this.g=[]}function tl(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 ul(){this.hc=this.Dg=this.A=this.B=this.J=this.C=this.s=this.j=this.H=this.m=this.i=this.T=this.X=this.L=this.N=this.O=this.l=this.o=NaN;this.K=0;this.F=this.G=NaN;this.g=new pl;this.h=new sl};function vl(a,b,c,d){this.m=a;this.i=b;this.l=c;this.h=new Map;this.j=new Map;this.g=null;this.o=d}function wl(a,b){a.l=b;a=t(a.h.values());for(var c=a.next();!c.done;c=a.next())c.value.g=b}function xl(a,b,c){c=void 0===c?!1:c;if(a.i.segmentIndex&&(a.g||(a.g=a.i.segmentIndex.Ib(b,!0,a.o)),a.g)){for(c&&a.g.next();a.h.size<a.m;){b=a.g.next().value;if(!b)break;c=!0;b.isPreload()&&null!=b.ua&&(c=!1);2==b.Zb()&&(c=!1);c&&b.$&&yl(a,b.$);c&&!a.h.has(b)&&(c=new zl(a.l),Al(c,b,a.i),a.h.set(b,c))}Bl(a)}}
|
|
446
|
-
function yl(a,b){if(a.i.segmentIndex&&!Array.from(a.j.keys()).some(function(d){return Xi(d,b)})){var c=new zl(a.l);Al(c,b,a.i);a.j.set(b,c)}}function Cl(a,b){b=t(b.keys());for(var c=b.next();!c.done;c=b.next())(c=c.value)&&Dl(a,c)}function El(a){Cl(a,a.h);Cl(a,a.j);a.g=null}vl.prototype.Ma=function(a,b){b=void 0===b?!1:b;for(var c=t(this.h.keys()),d=c.next();!d.done;d=c.next())d=d.value,a>d.endTime&&Dl(this,d);b&&Bl(this)};vl.prototype.
|
|
444
|
+
il.prototype.setReverse=il.prototype.Tc;function kl(){hl.call(this,[]);this.h=[]}qa(kl,hl);q=kl.prototype;q.clone=function(){var a=new kl;a.h=this.h.slice();a.i=this.i;return a};q.release=function(){for(var a=t(this.h),b=a.next();!b.done;b=a.next())b.value.release();this.h=[]};q.Gb=function(a){for(var b=t(this.h),c=b.next();!c.done;c=b.next())c.value.Gb(a)};
|
|
445
|
+
q.find=function(a){for(var b=this.i,c=t(this.h),d=c.next();!d.done;d=c.next()){d=d.value;var e=d.find(a);if(null!=e)return e+b;b+=d.getNumEvicted()+d.getNumReferences()}return null};q.get=function(a){for(var b=this.i,c=t(this.h),d=c.next();!d.done;d=c.next()){d=d.value;var e=d.get(a-b);if(e)return e;e=d.getNumReferences();b+=d.getNumEvicted()+e}return null};q.offset=function(){};q.Wd=function(){};q.Ma=function(){};q.od=function(){};q.Ec=function(){};q.re=function(){};
|
|
446
|
+
S("shaka.media.MetaSegmentIndex",kl);kl.prototype.updateEvery=kl.prototype.re;kl.prototype.fit=kl.prototype.Ec;kl.prototype.mergeAndEvict=kl.prototype.od;kl.prototype.evict=kl.prototype.Ma;kl.prototype.merge=kl.prototype.Wd;kl.prototype.offset=kl.prototype.offset;kl.prototype.get=kl.prototype.get;kl.prototype.find=kl.prototype.find;kl.prototype.forEachTopLevelReference=kl.prototype.Gb;kl.prototype.release=kl.prototype.release;function ll(a){var b=this;this.g=a;this.j=!1;this.i=this.g.Kd();this.h=new $b(function(){b.g.Hg(.25*b.i)})}ll.prototype.release=function(){this.set(this.lc());this.h&&(this.h.stop(),this.h=null);this.g=null};ll.prototype.set=function(a){this.i=a;ml(this)};ll.prototype.lc=function(){return this.g.lc()};function ml(a){a.h.stop();var b=a.j?0:a.i;if(0<=b)try{a.g.Kd()!=b&&a.g.Rf(b);return}catch(c){}a.h.Ra(.25);0!=a.g.Kd()&&a.g.Rf(0)};function nl(a){var b=this;this.h=a;this.g=new Set;this.i=(new $b(function(){ol(b,!1)})).Ra(.25)}nl.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 ol(a,b){for(var c=t(a.g),d=c.next();!d.done;d=c.next())d.value.j(a.h.currentTime,b)};function pl(){this.g=null;this.h=[]}function ql(a,b){var c=0;a.g&&a.g.state==b&&(c+=a.g.duration);a=t(a.h);for(var d=a.next();!d.done;d=a.next())d=d.value,c+=d.state==b?d.duration:0;return c}function rl(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 sl(){this.i=this.h=null;this.g=[]}function tl(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 ul(){this.hc=this.Dg=this.A=this.B=this.J=this.C=this.s=this.j=this.H=this.m=this.i=this.T=this.X=this.L=this.N=this.O=this.l=this.o=NaN;this.K=0;this.F=this.G=NaN;this.g=new pl;this.h=new sl};function vl(a,b,c,d){this.m=a;this.i=b;this.l=c;this.h=new Map;this.j=new Map;this.g=null;this.o=d}function wl(a,b){a.l=b;a=t(a.h.values());for(var c=a.next();!c.done;c=a.next())c.value.g=b}function xl(a,b,c){c=void 0===c?!1:c;if(a.i.segmentIndex&&(a.g||(a.g=a.i.segmentIndex.Ib(b,!0,a.o)),a.g)){for(c&&a.g.next();a.h.size<a.m;){b=a.g.next().value;if(!b)break;c=!0;b.isPreload()&&null!=b.ua&&(c=!1);2==b.Zb()&&(c=!1);c&&b.$&&yl(a,b.$);c&&!a.h.has(b)&&(c=new zl(a.l),Al(c,b,a.i),a.h.set(b,c))}Bl(a)}}
|
|
447
|
+
function yl(a,b){if(a.i.segmentIndex&&!Array.from(a.j.keys()).some(function(d){return Xi(d,b)})){var c=new zl(a.l);Al(c,b,a.i);a.j.set(b,c)}}function Cl(a,b){b=t(b.keys());for(var c=b.next();!c.done;c=b.next())(c=c.value)&&Dl(a,c)}function El(a){Cl(a,a.h);Cl(a,a.j);a.g=null}vl.prototype.Ma=function(a,b){b=void 0===b?!1:b;for(var c=t(this.h.keys()),d=c.next();!d.done;d=c.next())d=d.value,a>d.endTime&&Dl(this,d);b&&Bl(this)};vl.prototype.Tc=function(a){this.o=a;this.g&&this.g.Tc(a)};
|
|
447
448
|
function Bl(a){for(var b=Array.from(a.h.keys()),c=t(a.j.keys()),d=c.next(),e={};!d.done;e={nf:void 0},d=c.next())e.nf=d.value,b.some(function(f){return function(g){return Xi(g.$,f.nf)}}(e))||Dl(a,e.nf)}function Fl(a,b){a.m=b;for(var c=Array.from(a.h.keys());c.length>b;){var d=c.pop();d&&Dl(a,d)}Bl(a)}function Gl(a,b){b&&b!==a.i&&(El(a),a.i=b)}function Dl(a,b){var c=a.h;b instanceof Wi&&(c=a.j);a=c.get(b);c.delete(b);a&&a.abort()}function zl(a){this.g=a;this.ce=this.Tf=null}
|
|
448
|
-
function Al(a,b,c){var d=new Uint8Array(0);a.ce=a.g(b,c,function(e){return P(function(f){if(1==f.g)return 0<d.byteLength?d=Re(d,e):d=e,a.Tf?G(f,a.Tf(d),3):f.u(0);d=new Uint8Array(0);H(f)})})}zl.prototype.abort=function(){this.ce&&this.ce.abort()};function Hl(a){mh.call(this);var b=this;this.g=new Set;this.i=a;this.h=(new $b(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 V("regionremove",new Map([["region",e]])),b.dispatchEvent(e))})).Ra(2)}qa(Hl,mh);Hl.prototype.release=function(){this.g.clear();this.h.stop();mh.prototype.release.call(this)};function Il(a){mh.call(this);this.g=new Map;this.h=a}qa(Il,mh);Il.prototype.release=function(){this.g.clear();mh.prototype.release.call(this)};function Jl(a,b){var c=a.g.get(b);c||(c={sd:[],Oe:null,contentType:b},a.g.set(b,c));return c}function Kl(a,b,c){var d=Jl(a,b.contentType);Ll(a,d);a={
|
|
449
|
-
Il.prototype.j=function(a){for(var b=t(this.g.values()),c=b.next();!c.done;c=b.next()){c=c.value;var d=c.Oe;a:{var e=c.sd;for(var f=e.length-1;0<=f;f--){var g=e[f];if(g.position<=a){e=g.
|
|
449
|
+
function Al(a,b,c){var d=new Uint8Array(0);a.ce=a.g(b,c,function(e){return P(function(f){if(1==f.g)return 0<d.byteLength?d=Re(d,e):d=e,a.Tf?G(f,a.Tf(d),3):f.u(0);d=new Uint8Array(0);H(f)})})}zl.prototype.abort=function(){this.ce&&this.ce.abort()};function Hl(a){mh.call(this);var b=this;this.g=new Set;this.i=a;this.h=(new $b(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 V("regionremove",new Map([["region",e]])),b.dispatchEvent(e))})).Ra(2)}qa(Hl,mh);Hl.prototype.release=function(){this.g.clear();this.h.stop();mh.prototype.release.call(this)};function Il(a){mh.call(this);this.g=new Map;this.h=a}qa(Il,mh);Il.prototype.release=function(){this.g.clear();mh.prototype.release.call(this)};function Jl(a,b){var c=a.g.get(b);c||(c={sd:[],Oe:null,contentType:b},a.g.set(b,c));return c}function Kl(a,b,c){var d=Jl(a,b.contentType);Ll(a,d);a={Kc:b,position:c};d=d.sd;b=d.findIndex(function(e){return e.position>=c});0<=b?d.splice(b,d[b].position==c?1:0,a):d.push(a)}
|
|
450
|
+
Il.prototype.j=function(a){for(var b=t(this.g.values()),c=b.next();!c.done;c=b.next()){c=c.value;var d=c.Oe;a:{var e=c.sd;for(var f=e.length-1;0<=f;f--){var g=e[f];if(g.position<=a){e=g.Kc;break a}}e=null}f=e&&!(d===e||d&&e&&d.bandwidth==e.bandwidth&&d.audioSamplingRate==e.audioSamplingRate&&d.codecs==e.codecs&&d.contentType==e.contentType&&d.frameRate==e.frameRate&&d.height==e.height&&d.mimeType==e.mimeType&&d.channelsCount==e.channelsCount&&d.pixelAspectRatio==e.pixelAspectRatio&&d.width==e.width);
|
|
450
451
|
g=e&&d&&e.label&&d.label&&d.label!==e.label;var h=e&&d&&e.language&&d.language&&d.language!==e.language;d=e&&d&&e.roles&&d.roles&&!Qb(d.roles,e.roles);(g||h||d)&&Ml(this,a,e.contentType)&&(c.Oe=e,d=new V("audiotrackchange",new Map([["quality",e],["position",a]])),this.dispatchEvent(d));f&&Ml(this,a,e.contentType)&&(c.Oe=e,JSON.stringify(e),c=new V("qualitychange",new Map([["quality",e],["position",a]])),this.dispatchEvent(c))}};
|
|
451
452
|
function Ml(a,b,c){return(a=a.h()[c])&&0<a.length&&(c=a[a.length-1].end,b>=a[0].start&&b<c)?!0:!1}function Ll(a,b){if((a=a.h()[b.contentType])&&0<a.length){var c=a[0].start,d=a[a.length-1].end,e=b.sd;b.sd=e.filter(function(f,g){return f.position<=c&&g+1<e.length&&e[g+1].position<=c||f.position>=d?!1:!0})}else b.sd=[]}
|
|
452
453
|
function Nl(a){var b={bandwidth:a.bandwidth||0,audioSamplingRate:null,codecs:a.codecs,contentType:a.type,frameRate:null,height:null,mimeType:a.mimeType,channelsCount:null,pixelAspectRatio:null,width:null,label:null,roles:a.roles,language:null};"video"==a.type&&(b.frameRate=a.frameRate||null,b.height=a.height||null,b.pixelAspectRatio=a.pixelAspectRatio||null,b.width=a.width||null);"audio"==a.type&&(b.audioSamplingRate=a.audioSamplingRate,b.channelsCount=a.channelsCount,b.label=a.label||null,b.language=
|
|
@@ -467,42 +468,43 @@ function Wl(a){var b,c,d,e,f,g,h;return P(function(k){if(1==k.g){b=[];c=t(a.i.va
|
|
|
467
468
|
q.configure=function(a){this.h=a;this.K=new Yg({maxAttempts:Math.max(a.retryParameters.maxAttempts,2),baseDelay:a.retryParameters.baseDelay,backoffFactor:a.retryParameters.backoffFactor,fuzzFactor:a.retryParameters.fuzzFactor,timeout:0,stallTimeout:0,connectionTimeout:0},!0);if(a.disableAudioPrefetch){var b=this.i.get("audio");b&&b.V&&(El(b.V),b.V=null);b=t(this.o.keys());for(var c=b.next();!c.done;c=b.next())c=c.value,El(this.o.get(c)),this.o.delete(c)}a.disableTextPrefetch&&(b=this.i.get(Ye))&&
|
|
468
469
|
b.V&&(El(b.V),b.V=null);a.disableVideoPrefetch&&(b=this.i.get("video"))&&b.V&&(El(b.V),b.V=null);b=t(this.i.keys());for(c=b.next();!c.done;c=b.next())c=this.i.get(c.value),c.V?(Fl(c.V,a.segmentPrefetchLimit),0<a.segmentPrefetchLimit||(El(c.V),c.V=null)):0<a.segmentPrefetchLimit&&(c.V=Zl(this,c.stream));a.disableAudioPrefetch||$l(this)};function am(a,b,c){a.l.presentationTimeline.U()||(a.O=b,a.N=c)}
|
|
469
470
|
q.start=function(a){var b=this;return P(function(c){if(1==c.g)return G(c,bm(b,a||new Map),2);Dh(b.m);b.C=!0;H(c)})};function cm(a,b){var c,d,e,f,g,h,k;P(function(l){switch(l.g){case 1:return c=$e,a.J++,d=a.J,ua(l,2),G(l,Bk(a.g.ba,c.va),4);case 4:ya(l,3);break;case 2:if(e=za(l),a.g)a.g.onError(e);case 3:f=cf(b.mimeType,b.codecs),kk(a.g.ba,f,a.l.sequenceMode,b.external),g=a.g.ba.ca,(h=g.isTextVisible()||a.h.alwaysStreamText)&&a.J==d&&(k=dm(a,b),a.i.set(c.va,k),em(a,k,0)),H(l)}})}
|
|
470
|
-
function fm(a){var b=a.i.get(Ye);b&&(Xl(b),Yl(b).catch(function(){}),a.i.delete(Ye));a.s=null}function gm(a,b){for(var c=0>a.g.fb(),d=t(a.i.values()),e=d.next();!e.done;e=d.next())e=e.value,e.la&&e.la.
|
|
471
|
+
function fm(a){var b=a.i.get(Ye);b&&(Xl(b),Yl(b).catch(function(){}),a.i.delete(Ye));a.s=null}function gm(a,b){for(var c=0>a.g.fb(),d=t(a.i.values()),e=d.next();!e.done;e=d.next())e=e.value,e.la&&e.la.Tc(c),e.V&&e.V.Tc(c);d=t(a.o.values());for(e=d.next();!e.done;e=d.next())e.value.Tc(c);if(c=a.i.get("video"))if(d=c.stream)if(b)(b=d.trickModeVideo)&&!c.bc&&(hm(a,b,!1,0,!1),c.bc=d);else if(b=c.bc)c.bc=null,hm(a,b,!0,0,!1)}
|
|
471
472
|
function im(a,b,c,d,e,f){c=void 0===c?!1:c;d=void 0===d?0:d;e=void 0===e?!1:e;f=void 0===f?!1:f;a.j=b;a.C&&(b.video&&hm(a,b.video,c,d,e,f),b.audio&&hm(a,b.audio,c,d,e,f))}function jm(a,b){P(function(c){if(1==c.g)return a.s=b,a.C?b.segmentIndex?c.u(2):G(c,b.createSegmentIndex(),2):c.return();hm(a,b,!0,0,!1);H(c)})}function km(a,b){for(var c=t(a.F.entries()),d=c.next();!d.done;d=c.next()){var e=t(d.value);d=e.next().value;e=e.next().value;d.includes(b.type)&&(e(),a.F.delete(d))}}
|
|
472
|
-
function hm(a,b,c,d,e,f){var g=a.i.get(b.type);g||b.type!=Ye?g&&(g.bc&&(b.trickModeVideo?(g.bc=b,b=b.trickModeVideo):g.bc=null),g.stream!=b||e)&&(a.o.has(b)?g.V=a.o.get(b):g.V&&Gl(g.V,b),b.type==Ye&&(e=cf(b.mimeType,b.codecs),kk(a.g.ba,e,a.l.sequenceMode,b.external)),!a.o.has(g.stream)&&g.stream.closeSegmentIndex&&(g.Ka?(e="("+g.type+":"+g.stream.id+")",a.F.has(e)||a.F.set(e,g.stream.closeSegmentIndex)):g.stream.closeSegmentIndex()),g.stream=b,g.la=null,g.eg=!!f,c?g.
|
|
473
|
+
function hm(a,b,c,d,e,f){var g=a.i.get(b.type);g||b.type!=Ye?g&&(g.bc&&(b.trickModeVideo?(g.bc=b,b=b.trickModeVideo):g.bc=null),g.stream!=b||e)&&(a.o.has(b)?g.V=a.o.get(b):g.V&&Gl(g.V,b),b.type==Ye&&(e=cf(b.mimeType,b.codecs),kk(a.g.ba,e,a.l.sequenceMode,b.external)),!a.o.has(g.stream)&&g.stream.closeSegmentIndex&&(g.Ka?(e="("+g.type+":"+g.stream.id+")",a.F.has(e)||a.F.set(e,g.stream.closeSegmentIndex)):g.stream.closeSegmentIndex()),g.stream=b,g.la=null,g.eg=!!f,c?g.Wc?g.ze=!0:g.Ka?(g.fc=!0,g.Ed=
|
|
473
474
|
d,g.ze=!0):(Xl(g),lm(a,g,!0,d).catch(function(h){if(a.g)a.g.onError(h)})):g.Ka||g.ub||em(a,g,0),mm(a,g).catch(function(h){if(a.g)a.g.onError(h)})):cm(a,b)}
|
|
474
475
|
function mm(a,b){var c,d;return P(function(e){if(1==e.g){if(!b.jb)return e.return();c=b.stream;d=b.jb;return c.segmentIndex?e.u(2):G(e,c.createSegmentIndex(),2)}if(b.jb!=d||b.stream!=c)return e.return();var f=a.g.Jd();var g=qk(a.g.ba,b.type),h=b.stream.segmentIndex.find(b.Na?b.Na.endTime:f),k=null==h?null:b.stream.segmentIndex.get(h);h=k?k.ua?k.ua-k.Ga:null:null;k&&!h&&(h=(k.endTime-k.getStartTime())*(b.stream.bandwidth||0)/8);h?((k=k.$)&&(h+=(k.ua?k.ua-k.Ga:null)||0),k=a.g.getBandwidthEstimate(),
|
|
475
476
|
f=8*h/k<(g||0)-f-Math.max(a.l.minBufferTime||0,a.h.rebufferingGoal)||b.jb.h.g>h?!0:!1):f=!1;f&&b.jb.abort();H(e)})}
|
|
476
|
-
q.
|
|
477
|
-
function nm(a,b){b.
|
|
477
|
+
q.Rc=function(){if(this.g)for(var a=this.g.Jd(),b=t(this.i.keys()),c=b.next();!c.done;c=b.next()){var d=c.value;c=this.i.get(d);var e=this.g.ba;e.C?e=!1:d==Ye?(e=e.g,e=null==e.g||null==e.h?!1:a>=e.g&&a<e.h):(e=pk(e,d),e=gj(e,a));if(!e){c.V&&(c.V.g=null);if("audio"===c.type){e=t(this.o.values());for(var f=e.next();!f.done;f=e.next())f.value.g=null}c.la=null;(null!=qk(this.g.ba,d)||c.Ka)&&nm(this,c);c.jb&&(c.jb.abort(),c.jb=null);d===Ye&&(d=this.g.ba,d.G&&d.G.g());c.Rc=!0}}};
|
|
478
|
+
function nm(a,b){b.Wc||b.fc||(b.Ka?(b.fc=!0,b.Ed=0):null==ok(a.g.ba,b.type)?null==b.ub&&em(a,b,0):(Xl(b),lm(a,b,!1,0).catch(function(c){if(a.g)a.g.onError(c)})))}
|
|
478
479
|
function bm(a,b){var c,d,e,f,g,h,k,l,m,n;return P(function(p){if(1==p.g){c=$e;if(!a.j)throw new T(2,5,5006);d=new Map;e=new Set;a.j.audio&&(d.set(c.Y,a.j.audio),e.add(a.j.audio));a.j.video&&(d.set(c.ja,a.j.video),e.add(a.j.video));a.s&&(d.set(c.va,a.s),e.add(a.s));f=a.g.ba;return G(p,f.init(d,a.l.sequenceMode,a.l.type,a.l.ignoreManifestTimestampsInSegmentsMode),2)}Dh(a.m);a.updateDuration();g=t(d.keys());for(h=g.next();!h.done;h=g.next())k=h.value,l=d.get(k),a.i.has(k)||(m=dm(a,l),b.has(l.id)&&(n=
|
|
479
|
-
b.get(l.id),wl(n,function(r,u,v){return om(r,u,v||null,a.h.retryParameters,a.g.Lb)}),m.V=n),a.i.set(k,m),em(a,m,0));H(p)})}function dm(a,b){return{stream:b,type:b.type,la:null,V:Zl(a,b),Na:null,qc:null,Td:null,Sd:null,Rd:null,bc:null,endOfStream:!1,Ka:!1,ub:null,fc:!1,Ed:0,ze:!1,
|
|
480
|
+
b.get(l.id),wl(n,function(r,u,v){return om(r,u,v||null,a.h.retryParameters,a.g.Lb)}),m.V=n),a.i.set(k,m),em(a,m,0));H(p)})}function dm(a,b){return{stream:b,type:b.type,la:null,V:Zl(a,b),Na:null,qc:null,Td:null,Sd:null,Rd:null,bc:null,endOfStream:!1,Ka:!1,ub:null,fc:!1,Ed:0,ze:!1,Wc:!1,Rc:!0,Hf:!1,ed:!1,jb:null}}
|
|
480
481
|
function Zl(a,b){if("video"===b.type&&a.h.disableVideoPrefetch||"audio"===b.type&&a.h.disableAudioPrefetch||b.type===Ye&&("application/cea-608"==b.mimeType||"application/cea-708"==b.mimeType)||b.type===Ye&&a.h.disableTextPrefetch)return null;if(a.o.has(b))return a.o.get(b);var c=a.i.get(b.type);return(c=c&&c.V)&&b===c.i?c:0<a.h.segmentPrefetchLimit?new vl(a.h.segmentPrefetchLimit,b,function(d,e,f){return om(d,e,f||null,a.h.retryParameters,a.g.Lb)},0>a.g.fb()):null}
|
|
481
482
|
function $l(a){for(var b=a.h.segmentPrefetchLimit,c=a.h.prefetchAudioLanguages,d=t(a.l.variants),e=d.next(),f={};!e.done;f={mb:void 0},e=d.next())if(f.mb=e.value,f.mb.audio)if(a.o.has(f.mb.audio)){if(e=a.o.get(f.mb.audio),Fl(e,b),!(0<b&&c.some(function(h){return function(k){return Cf(h.mb.audio.language,k)}}(f)))){var g=a.i.get(f.mb.audio.type);e!==(g&&g.V)&&El(e);a.o.delete(f.mb.audio)}}else 0>=b||!c.some(function(h){return function(k){return Cf(h.mb.audio.language,k)}}(f))||!(e=Zl(a,f.mb.audio))||
|
|
482
483
|
(f.mb.audio.segmentIndex||f.mb.audio.createSegmentIndex(),a.o.set(f.mb.audio,e))}q.updateDuration=function(){var a=this.l.presentationTimeline.getDuration();Infinity>a?this.g.ba.Za(a):this.g.ba.Za(this.h.infiniteLiveStreamDuration?Infinity:Math.pow(2,32))};
|
|
483
|
-
function pm(a,b){var c,d,e,f,g,h;return P(function(k){switch(k.g){case 1:Dh(a.m);if(b.Ka||null==b.ub||b.
|
|
484
|
-
em(a,b,0),k.return();case 4:ua(k,9);e=rm(a,b);null!=e&&(em(a,b,e),b.
|
|
484
|
+
function pm(a,b){var c,d,e,f,g,h;return P(function(k){switch(k.g){case 1:Dh(a.m);if(b.Ka||null==b.ub||b.Wc)return k.return();b.ub=null;if(!b.fc){k.u(2);break}return G(k,lm(a,b,b.ze,b.Ed),3);case 3:return k.return();case 2:km(a,b);if(b.stream.segmentIndex){k.u(4);break}c=b.stream;ua(k,5);return G(k,b.stream.createSegmentIndex(),7);case 7:ya(k,6);break;case 5:return d=za(k),G(k,qm(a,b,d),8);case 8:return k.return();case 6:if(c!=b.stream)return c.closeSegmentIndex&&c.closeSegmentIndex(),b.Ka||b.ub||
|
|
485
|
+
em(a,b,0),k.return();case 4:ua(k,9);e=rm(a,b);null!=e&&(em(a,b,e),b.ed=!1);ya(k,10);break;case 9:return f=za(k),G(k,qm(a,b,f),11);case 11:return k.return();case 10:g=Array.from(a.i.values());if(!a.C||!g.every(function(l){return l.endOfStream})){k.u(0);break}return G(k,a.g.ba.endOfStream(),13);case 13:Dh(a.m),h=a.g.ba.getDuration(),0!=h&&h<a.l.presentationTimeline.getDuration()&&a.l.presentationTimeline.Za(h),H(k)}})}
|
|
485
486
|
function rm(a,b){if(sm(b))return yk(a.g.ba,b.stream.originalId||""),null;b.type==Ye&&zk(a.g.ba);if(!a.g.ba.sa&&b.type!=Ye)return a.h.updateIntervalSeconds/2;var c=a.g.Jd();if("audio"===b.type)for(var d=t(a.o.keys()),e=d.next();!e.done;e=d.next())e=a.o.get(e.value),e.Ma(c,!0),xl(e,c);d=b.Na?b.Na.endTime:c;var f=rk(a.g.ba,b.type,c),g=Math.max(1,Math.max(a.l.minBufferTime||0,a.h.rebufferingGoal,a.h.bufferingGoal)*a.B),h=a.l.presentationTimeline.getDuration()-d;e=qk(a.g.ba,b.type);if(1E-6>h&&e)return b.endOfStream=
|
|
486
487
|
!0,"video"==b.type&&(a=a.i.get(Ye))&&sm(a)&&(a.endOfStream=!0),null;b.endOfStream=!1;if(f>=g)return a.h.updateIntervalSeconds/2;g=!b.la;e=tm(a,b,c,e);if(!e)return a.h.updateIntervalSeconds;f=!1;g&&b.eg&&(f=!0,b.eg=!1);g=Infinity;h=Array.from(a.i.values());h=t(h);for(var k=h.next();!k.done;k=h.next())k=k.value,sm(k)||k.la&&!k.la.current()||(g=Math.min(g,k.Na?k.Na.endTime:c));if(d>=g+a.l.presentationTimeline.g)return a.h.updateIntervalSeconds;b.V&&b.la&&!a.o.has(b.stream)&&(b.V.Ma(e.startTime),xl(b.V,
|
|
487
488
|
e.startTime));um(a,b,c,e,f).catch(function(){});return null}function tm(a,b,c,d){if(b.la)return b.la.current();if(b.Na||d)return b.la=b.stream.segmentIndex.Ib(b.Na?b.Na.endTime:d,!1,0>a.g.fb()),b.la&&b.la.next().value;d=a.l.sequenceMode?0:a.h.inaccurateManifestTolerance;var e=Math.max(c-d,0);a=0>a.g.fb();var f=null;d&&(b.la=b.stream.segmentIndex.Ib(e,!1,a),f=b.la&&b.la.next().value);f||(b.la=b.stream.segmentIndex.Ib(c,!1,a),f=b.la&&b.la.next().value);return f}
|
|
488
489
|
function um(a,b,c,d,e){var f,g,h,k,l,m,n,p,r,u,v,w,y,z,D,A,B;return P(function(C){switch(C.g){case 1:f=$e;g=b.stream;h=b.la;b.Ka=!0;ua(C,2);if(2==d.Zb())throw new T(1,1,1011);return G(C,vm(a,b,d,e),4);case 4:Dh(a.m);if(a.A)return C.return();k="video/mp4"==g.mimeType||"audio/mp4"==g.mimeType;l=window.ReadableStream;if((m=a.h.lowLatencyMode&&a.l.isLowLatency)&&l&&k&&("HLS"!=a.l.type||d.m))return r=new Uint8Array(0),v=u=!1,y=function(E){var F,J,K,L;return P(function(I){switch(I.g){case 1:if(u)return I.return();
|
|
489
490
|
v=!0;Dh(a.m);if(a.A)return I.return();ua(I,2);r=wm(r,E);F=!1;J=0;(new Lh).box("mdat",function(N){J=N.size+N.start;F=!0}).parse(r,!1,!0);if(!F){I.u(4);break}K=r.subarray(0,J);r=r.subarray(J);return G(I,xm(a,b,c,g,d,K,!0,e),5);case 5:b.V&&b.la&&xl(b.V,d.startTime,!0);case 4:ya(I,0);break;case 2:w=L=za(I),H(I)}})},G(C,ym(a,b,d,y),9);n=ym(a,b,d);return G(C,n,7);case 7:p=C.h;Dh(a.m);if(a.A)return C.return();Dh(a.m);return b.fc?(b.Ka=!1,em(a,b,0),C.return()):G(C,xm(a,b,c,g,d,p,!1,e),6);case 9:z=C.h;if(w)throw w;
|
|
490
491
|
if(v){C.u(10);break}u=!0;Dh(a.m);return a.A?C.return():b.fc?(b.Ka=!1,em(a,b,0),C.return()):G(C,xm(a,b,c,g,d,z,!1,e),10);case 10:b.V&&b.la&&xl(b.V,d.startTime,!0);case 6:Dh(a.m);if(a.A)return C.return();b.Na=d;h.next();b.Ka=!1;b.Hf=!1;D=a.g.ba.xb();A=D[b.type];db(JSON.stringify(A));b.fc||a.g.Bf(d,b.stream);em(a,b,0);ya(C,0);break;case 2:B=za(C);Dh(a.m,B);if(a.A)return C.return();b.Ka=!1;if(7001==B.code)b.Ka=!1,Xl(b),em(a,b,0),C.u(0);else if(b.type==f.va&&a.h.ignoreTextStreamFailures)a.i.delete(f.va),
|
|
491
|
-
C.u(0);else if(3017==B.code)zm(a,b,B),C.u(0);else return b.
|
|
492
|
+
C.u(0);else if(3017==B.code)zm(a,b,B),C.u(0);else return b.ed=!0,1==B.category&&b.V&&Dl(b.V,d),B.severity=2,G(C,qm(a,b,B),0)}})}function wm(a,b){var c=new Uint8Array(a.length+b.length);c.set(a);c.set(b,a.length);return c}function zm(a,b,c){if(!Array.from(a.i.values()).some(function(e){return e!=b&&e.Hf})){if(a.g.disableStream(b.stream,a.h.maxDisabledTime))return;var d=Math.round(100*a.B);if(20<d)a.B-=.2;else if(4<d)a.B-=.04;else{b.ed=!0;a.A=!0;a.g.onError(c);return}b.Hf=!0}em(a,b,4)}
|
|
492
493
|
function vm(a,b,c,d){var e,f,g,h,k,l,m,n,p,r,u,v,w,y,z,D;return P(function(A){switch(A.g){case 1:e=$e;f=null==b.Na&&null==b.qc;g=[];h=Math.max(0,Math.max(c.appendWindowStart,a.O)-.1);k=Math.min(c.appendWindowEnd,a.N)+.01;l=c.codecs||b.stream.codecs;m=mf(l);n=nf(c.mimeType||b.stream.mimeType);p=c.timestampOffset;if(p==b.Td&&h==b.Sd&&k==b.Rd&&m==b.uf&&n==b.vf){A.u(2);break}r=b.uf&&b.vf&&Lk(a.g.ba,b.type,n,l);if(!r){A.u(3);break}u=null;b.type===e.ja?u=a.i.get(e.Y):b.type===e.Y&&(u=a.i.get(e.ja));if(!u){A.u(3);
|
|
493
494
|
break}return G(A,Yl(u).catch(function(){}),5);case 5:u.qc=null,nm(a,u);case 3:return G(A,Am(a,b,p,h,k,c,m,n),2);case 2:return Xi(c.$,b.qc)||(b.qc=c.$,c.l&&c.$&&(v=ym(a,b,c.$),w=function(){var B,C,E,F,J,K,L;return P(function(I){switch(I.g){case 1:return ua(I,2),G(I,v,4);case 4:return B=I.h,Dh(a.m),C=null,E=new Map,F={projection:null,hfov:null},J=new Lh,J.box("moov",Qh).box("trak",Qh).box("mdia",Qh).R("mdhd",function(N){C=tj(N.reader,N.version).timescale}).box("hdlr",function(N){N=N.reader;N.skip(8);
|
|
494
495
|
switch(N.sc()){case "soun":E.set(e.Y,C);break;case "vide":E.set(e.ja,C)}C=null}).box("minf",Qh).box("stbl",Qh).R("stsd",Sh).box("encv",Th).box("avc1",Th).box("avc3",Th).box("hev1",Th).box("hvc1",Th).box("dvav",Th).box("dva1",Th).box("dvh1",Th).box("dvhe",Th).box("dvc1",Th).box("dvi1",Th).box("vexu",Qh).box("proj",Qh).R("prji",function(N){N=N.reader.sc();F.projection=N}).box("hfov",function(N){N=N.reader.P()/1E3;F.hfov=N}).parse(B),Bm(a,F),E.has(b.type)?c.$.timescale=E.get(b.type):null!=C&&(c.$.timescale=
|
|
495
|
-
C),K=b.stream.closedCaptions&&0<b.stream.closedCaptions.size,G(I,a.g.hg(b.type,B),5);case 5:return G(I,tk(a.g.ba,b.type,B,null,b.stream,K,b.
|
|
496
|
+
C),K=b.stream.closedCaptions&&0<b.stream.closedCaptions.size,G(I,a.g.hg(b.type,B),5);case 5:return G(I,tk(a.g.ba,b.type,B,null,b.stream,K,b.Rc,d),6);case 6:ya(I,0);break;case 2:throw L=za(I),b.qc=null,L;}})},y=c.startTime,f&&(z=qk(a.g.ba,b.type),null!=z&&(y=z)),a.g.wi(y,c.$),g.push(w()))),a.l.sequenceMode&&(D=b.Na?b.Na.i:null,c.i!=D&&g.push(Ek(a.g.ba,b.type,c.startTime))),G(A,Promise.all(g),0)}})}
|
|
496
497
|
function Am(a,b,c,d,e,f,g,h){var k,l,m,n;return P(function(p){if(1==p.g)return k=$e,l=new Map,a.j.audio&&l.set(k.Y,a.j.audio),a.j.video&&l.set(k.ja,a.j.video),ua(p,2),b.Sd=d,b.Rd=e,g&&(b.uf=g),h&&(b.vf=h),b.Td=c,m=a.l.sequenceMode||"HLS"==a.l.type,G(p,Ck(a.g.ba,b.type,c,d,e,m,f.mimeType||b.stream.mimeType,f.codecs||b.stream.codecs,l),4);if(2!=p.g)return ya(p,0);n=za(p);b.Sd=null;b.Rd=null;b.uf=null;b.vf=null;b.Td=null;throw n;})}
|
|
497
498
|
function xm(a,b,c,d,e,f,g,h){g=void 0===g?!1:g;h=void 0===h?!1:h;var k,l,m,n,p,r,u,v;return P(function(w){switch(w.g){case 1:k=d.closedCaptions&&0<d.closedCaptions.size;m=null!=d.emsgSchemeIdUris&&0<d.emsgSchemeIdUris.length||a.h.dispatchAllEmsgBoxes;n=a.h.parsePrftBox&&!a.G;p="video/mp4"==d.mimeType||"audio/mp4"==d.mimeType;r=null;e.$&&(r=e.$.timescale);u=p&&r&&"video"===d.type&&"DASH"==a.l.type&&a.h.shouldFixTimestampOffset;if(m||n||u)l=new Lh;m&&l.R("emsg",function(y){var z=d.emsgSchemeIdUris;
|
|
498
|
-
if(0===y.version){var D=y.reader.sc();var A=y.reader.sc();var B=y.reader.P();var C=y.reader.P();var E=y.reader.P();var F=y.reader.P();var J=e.startTime+C/B}else B=y.reader.P(),J=y.reader.
|
|
499
|
+
if(0===y.version){var D=y.reader.sc();var A=y.reader.sc();var B=y.reader.P();var C=y.reader.P();var E=y.reader.P();var F=y.reader.P();var J=e.startTime+C/B}else B=y.reader.P(),J=y.reader.Pc()/B+e.timestampOffset,C=J-e.startTime,E=y.reader.P(),F=y.reader.P(),D=y.reader.sc(),A=y.reader.sc();y=y.reader.rb(y.reader.getLength()-y.reader.wa());if(z&&z.includes(D)||a.h.dispatchAllEmsgBoxes)if("urn:mpeg:dash:event:2012"==D)a.g.xi();else if(z=J+E/B,B=(new Map).set("detail",{startTime:J,endTime:z,schemeIdUri:D,
|
|
499
500
|
value:A,timescale:B,presentationTimeDelta:C,eventDuration:E,id:F,messageData:y}),B=new V("emsg",B),B.cancelable=!0,a.g.onEvent(B),!B.defaultPrevented&&("https://aomedia.org/emsg/ID3"==D||"https://developer.apple.com/streaming/emsg-id3"==D)&&(D=pj(y),D.length))a.g.onMetadata([{cueTime:J,data:y,frames:D,dts:J,pts:J}],0,z)});n&&l.R("prft",function(y){if(!a.G&&e.$.timescale){var z=y.reader,D=y.version;z.P();y=z.P();var A=z.P();y=1E3*y+A/Math.pow(2,32)*1E3;0===D?z=z.P():(D=z.P(),z=z.P(),z=D*Math.pow(2,
|
|
500
501
|
32)+z);y=(new Date((new Date(Date.UTC(1900,0,1,0,0,0))).getTime()+y)).getTime();z=(new Map).set("detail",{wallClockTime:y,programStartDate:new Date(y-z/e.$.timescale*1E3)});z=new V("prft",z);a.g.onEvent(z);a.G=!0}});u&&l.box("moof",Qh).box("traf",Qh).R("tfdt",function(y){var z,D,A,B,C,E;return P(function(F){z=sj(y.reader,y.version);D=z.baseMediaDecodeTime;if(!D)return F.return();A=-D/r;B=Number(b.Td)||0;if(!(B<A))return F.u(0);C=b.Sd;E=b.Rd;return G(F,Am(a,b,A,C,E,e),0)})});(m||n||u)&&l.parse(f,!1,
|
|
501
|
-
g);return G(w,Cm(a,b,c),2);case 2:return Dh(a.m),v=b.
|
|
502
|
+
g);return G(w,Cm(a,b,c),2);case 2:return Dh(a.m),v=b.Rc,b.Rc=!1,G(w,a.g.hg(b.type,f),3);case 3:return G(w,tk(a.g.ba,b.type,f,e,d,k,v,h,g),4);case 4:Dh(a.m),H(w)}})}
|
|
503
|
+
function Cm(a,b,c){var d,e,f,g,h;return P(function(k){if(1==k.g){d=b.stream.segmentIndex;if(d instanceof kl)for(;1<d.h.length&&0==d.h[0].getNumReferences();){var l=d.h.shift();d.i+=l.getNumEvicted();l.release()}e=Math.max(a.h.bufferBehind,a.l.presentationTimeline.g);f=ok(a.g.ba,b.type);if(null==f)return k.return();g=c-f;h=g-e;return h<=a.h.evictionGoal?k.return():G(k,a.g.ba.remove(b.type,f,f+h),2)}Dh(a.m);H(k)})}
|
|
502
504
|
function sm(a){return a&&a.type==Ye&&("application/cea-608"==a.stream.mimeType||"application/cea-708"==a.stream.mimeType)}
|
|
503
|
-
function ym(a,b,c,d){var e,f,g,h,k;return P(function(l){switch(l.g){case 1:if(e=c.
|
|
504
|
-
function om(a,b,c,d,e,f){f=void 0===f?!1:f;var g=a instanceof
|
|
505
|
-
function lm(a,b,c,d){var e,f;return P(function(g){if(1==g.g)return b.fc=!1,b.ze=!1,b.Ed=0,b.
|
|
505
|
+
function ym(a,b,c,d){var e,f,g,h,k;return P(function(l){switch(l.g){case 1:if(e=c.cd())return l.return(e);f=null;if(b.V){var m=b.V,n=m.h;c instanceof Wi&&(n=m.j);n.has(c)?(m=n.get(c),d&&(m.Tf=d),f=m.ce):f=null}f||(f=om(c,b.stream,d||null,a.h.retryParameters,a.g.Lb));g=0;b.la&&(g=b.la.h);b.jb=f;return G(l,f.promise,2);case 2:h=l.h;b.jb=null;k=h.data;if(!c.aesKey){l.u(3);break}return G(l,Tl(k,c.aesKey,g),4);case 4:k=l.h;case 3:return l.return(k)}})}
|
|
506
|
+
function om(a,b,c,d,e,f){f=void 0===f?!1:f;var g=a instanceof Yi?a:void 0,h=g?1:0;a=Ul(a.M(),a.Ga,a.ua,d,c);a.contentType=b.type;return e.request(Ah,a,{type:h,stream:b,segment:g,isPreload:f})}
|
|
507
|
+
function lm(a,b,c,d){var e,f;return P(function(g){if(1==g.g)return b.fc=!1,b.ze=!1,b.Ed=0,b.Wc=!0,b.Na=null,b.la=null,b.V&&!a.o.has(b.stream)&&El(b.V),d?(e=a.g.Jd(),f=a.g.ba.getDuration(),G(g,a.g.ba.remove(b.type,e+d,f),3)):G(g,Bk(a.g.ba,b.type),4);if(3!=g.g)return Dh(a.m),c?G(g,a.g.ba.flush(b.type),3):g.u(3);Dh(a.m);b.Wc=!1;b.endOfStream=!1;b.Ka||b.ub||em(a,b,0);H(g)})}
|
|
506
508
|
function em(a,b,c){var d=b.type;if(d!=Ye||a.i.has(d))b.ub=(new Zb(function(){var e;return P(function(f){if(1==f.g)return ua(f,2),G(f,pm(a,b),4);if(2!=f.g)return ya(f,0);e=za(f);if(a.g)a.g.onError(e);H(f)})})).Z(c)}function Xl(a){null!=a.ub&&(a.ub.stop(),a.ub=null)}function Yl(a){return P(function(b){return a.jb?G(b,a.jb.abort(),0):b.u(0)})}
|
|
507
509
|
function qm(a,b,c){var d;return P(function(e){if(1==e.g)return G(e,$g(a.K),2);Dh(a.m);if(1===c.category){if(b.bc)return gm(a,!1),e.return();d=0===a.h.maxDisabledTime&&1011==c.code?1:a.h.maxDisabledTime;c.handled=a.g.disableStream(b.stream,d);c.handled&&(c.severity=1)}if(!c.handled||1011!=c.code)a.g.onError(c);c.handled||a.h.failureCallback(c);H(e)})}
|
|
508
510
|
function Dm(a){var b,c,d,e,f,g;return P(function(h){if(1==h.g){b=Date.now()/1E3;c=a.h.minTimeBetweenRecoveries;if(!a.h.allowMediaSourceRecoveries||b-a.L<c)return h.return(!1);a.L=b;d=$e;if(e=a.i.get(d.Y))e.qc=null,nm(a,e),Yl(e).catch(function(){});if(f=a.i.get(d.ja))f.qc=null,nm(a,f),Yl(f).catch(function(){});g=new Map;a.j.audio&&g.set(d.Y,a.j.audio);a.j.video&&g.set(d.ja,a.j.video);return G(h,Kk(a.g.ba,g),2)}return h.return(!0)})}
|
|
@@ -535,27 +537,27 @@ function Vm(a,b,c){(a=b?a.J:a.K)?a.push(c):c()}function Wm(a){if(a.J)for(var b=t
|
|
|
535
537
|
function an(a){a.ea=!0;return a.l}function bn(a){a.na=!0;return a.L}
|
|
536
538
|
q.start=function(){var a=this;(function(){var b;return P(function(c){switch(c.g){case 1:return G(c,Promise.resolve(),2);case 2:return ua(c,3),G(c,cn(a),5);case 5:return dn(a),G(c,en(a),6);case 6:dn(a);a.o||(a.o=new Jg(a.g.preferredAudioLanguage,a.g.preferredVariantRole,a.g.preferredAudioChannelCount,a.g.preferredVideoHdrLevel,a.g.preferSpatialAudio,a.g.preferredVideoLayout,a.g.preferredAudioLabel,a.g.preferredVideoLabel,a.g.mediaSource.codecSwitchingStrategy,a.g.manifest.dash.enableAudioGroups));
|
|
537
539
|
if(a.Da){var d=a.g.abrFactory;a.C=d;a.i=d();a.i.configure(a.g.abr)}if(a.Fa){d=a.h.presentationTimeline.U();var e=vg(a.h.variants);e=a.o.create(e);a.i.configure(a.g.abr);a.i.setVariants(Array.from(e.values()));if(e=a.i.chooseVariant())a.ga=e,e.video&&fn(a,e.video,d),e.audio&&fn(a,e.audio,d)}return G(c,void 0,7);case 7:dn(a);a.m.resolve();ya(c,0);break;case 3:b=za(c),a.m.reject(b),H(c)}})})()};q.dispatchEvent=function(a){return this.O?this.O.dispatchEvent(a):mh.prototype.dispatchEvent.call(this,a)};
|
|
538
|
-
q.onError=function(a){2===a.severity&&(this.m.reject(a),this.destroy());var b=(new Map).set("detail",a);b=new V("error",b);this.dispatchEvent(b);b.defaultPrevented&&(a.handled=!0)};function dn(a){if(a.s)throw new T(2,7,7003);}function
|
|
539
|
-
function cn(a){var b,c,d,e;return P(function(f){if(1==f.g)return
|
|
540
|
-
function en(a){var b,c,d,e,f;return P(function(g){switch(g.g){case 1:
|
|
540
|
+
q.onError=function(a){2===a.severity&&(this.m.reject(a),this.destroy());var b=(new Map).set("detail",a);b=new V("error",b);this.dispatchEvent(b);b.defaultPrevented&&(a.handled=!0)};function dn(a){if(a.s)throw new T(2,7,7003);}function gn(a,b){a.dispatchEvent(new V("onstatechange",(new Map).set("state",b)))}
|
|
541
|
+
function cn(a){var b,c,d,e;return P(function(f){if(1==f.g)return gn(a,"manifest-parser"),a.j||(a.G=Qi(a.N,a.X),a.j=a.G(),a.j.configure(a.g.manifest,function(){return a.A})),b=Date.now()/1E3,gn(a,"manifest"),a.h?f.u(2):G(f,a.j.start(a.N,a.bb),3);2!=f.g&&(a.h=f.h);c=new V("manifestparsed",void 0);a.dispatchEvent(c);if(0==a.h.variants.length)throw new T(2,4,4036);hn(a.h);d=Date.now()/1E3;e=d-b;a.aa.H=e;H(f)})}
|
|
542
|
+
function en(a){var b,c,d,e,f;return P(function(g){switch(g.g){case 1:gn(a,"drm-engine");a.sa=Date.now()/1E3;a.l=a.Ta();a.F.g=a.l;a.l.configure(a.g.drm,function(){return a.A});b=Li(a.F,a.h);if(!b){g.u(2);break}c=new V("trackschanged",void 0);return G(g,Promise.resolve(),3);case 3:dn(a),a.dispatchEvent(c);case 2:return d=vg(a.h.variants),G(g,ei(a.l,d,a.h.offlineSessionIds),4);case 4:return dn(a),G(g,Ji(a.F,a.h),5);case 5:e=g.h;if(!e){g.u(0);break}f=new V("trackschanged",void 0);return G(g,Promise.resolve(),
|
|
541
543
|
7);case 7:a.dispatchEvent(f),H(g)}})}q.configure=function(a,b){a=Gm(a,b);Tm(this.g,a)};q.getConfiguration=function(){return Tc(this.g)};
|
|
542
544
|
function fn(a,b,c){var d,e,f,g,h;P(function(k){if(1==k.g)return d=a.g.streaming.segmentPrefetchLimit||2,e=new vl(d,b,function(l,m,n){return om(l,m,n||null,a.g.streaming.retryParameters,a.ya,a.A)},!1),a.L.set(b.id,e),G(k,b.createSegmentIndex(),2);f=a.B||0;(h=(g=b.segmentIndex.Ib(f))?g.current():null)||(h=og(b.segmentIndex));h&&(c?h.$&&yl(e,h.$):xl(e,h.startTime));H(k)})}q.bj=function(){return this.m};
|
|
543
545
|
q.destroy=function(){var a=this,b,c,d;return P(function(e){switch(e.g){case 1:a.s=!0;if(!a.j||a.fa){e.u(2);break}return G(e,a.j.stop(),2);case 2:if(!a.i||a.ca){e.u(4);break}return G(e,a.i.stop(),4);case 4:a.H&&!a.ma&&a.H.release();if(!a.l||a.ea){e.u(6);break}return G(e,a.l.destroy(),6);case 6:if(0<a.L.size&&!a.na)for(b=t(a.L.values()),c=b.next();!c.done;c=b.next())d=c.value,El(d);H(e)}})};
|
|
544
|
-
function
|
|
546
|
+
function hn(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))}S("shaka.media.PreloadManager",Um);Um.prototype.destroy=Um.prototype.destroy;Um.prototype.waitForFinish=Um.prototype.bj;function xn(a,b){mh.call(this);var c=this;this.i=a;this.l=b;this.g=new Map;this.m=[{zc:null,yc:yn,oc:function(d,e){return zn(c,"enter",d,e)}},{zc:An,yc:yn,oc:function(d,e){return zn(c,"enter",d,e)}},{zc:Bn,yc:yn,oc:function(d,e){return zn(c,"enter",d,e)}},{zc:yn,yc:An,oc:function(d,e){return zn(c,"exit",d,e)}},{zc:yn,yc:Bn,oc:function(d,e){return zn(c,"exit",d,e)}},{zc:An,yc:Bn,oc:function(d,e){return zn(c,"skip",d,e)}},{zc:Bn,yc:An,oc:function(d,e){return zn(c,"skip",d,e)}}];this.h=new hb;this.h.D(this.i,
|
|
545
547
|
"regionremove",function(d){c.g.delete(d.region)})}qa(xn,mh);xn.prototype.release=function(){this.i=null;this.g.clear();this.h.release();this.h=null;mh.prototype.release.call(this)};xn.prototype.j=function(a,b){if(!this.l||0!=a){this.l=!1;for(var c=t(this.i.g),d=c.next();!d.done;d=c.next()){d=d.value;var e=this.g.get(d),f=a<d.startTime?An:a>d.endTime?Bn:yn;this.g.set(d,f);for(var g=t(this.m),h=g.next();!h.done;h=g.next())h=h.value,h.zc==e&&h.yc==f&&h.oc(d,b)}}};
|
|
546
548
|
function zn(a,b,c,d){b=new V(b,new Map([["region",c],["seeking",d]]));a.dispatchEvent(b)}var An=1,yn=2,Bn=3;function Cn(a,b,c){var d,e,f,g,h,k,l;return P(function(m){switch(m.g){case 1:var n=(new ve(a)).Pa.split("/").pop().split(".");d=1==n.length?"":n.pop().toLowerCase();if(e=Dn[d])return m.return(e);f=0;g=uh([a],c);ua(m,2);g.method="HEAD";return G(m,b.request(f,g).promise,4);case 4:h=m.h;e=h.headers["content-type"];ya(m,3);break;case 2:k=za(m);if(!k||1002!=k.code&&1001!=k.code){m.u(3);break}g.method="GET";return G(m,b.request(f,g).promise,6);case 6:l=m.h,e=l.headers["content-type"];case 3:return m.return(e?
|
|
547
549
|
e.toLowerCase().split(";").shift():"")}})}
|
|
548
|
-
var Dn={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",ism:"application/vnd.ms-sstr+xml",mp3:"audio/mpeg",aac:"audio/aac",flac:"audio/flac",wav:"audio/wav",sbv:"text/x-subviewer",srt:"text/srt",vtt:"text/vtt",webvtt:"text/vtt",ttml:"application/ttml+xml",lrc:"application/x-subtitle-lrc",ssa:"text/x-ssa",ass:"text/x-ssa"};function En(a,b){if(a.lineBreak)return"\n";if(a.nestedCues.length)return a.nestedCues.map(function(g){return En(g,a)}).join("");var c=[],d=a.fontWeight>=be,e=a.fontStyle==ce,f=a.textDecoration.includes(de);d&&c.push(["b"]);e&&c.push(["i"]);f&&c.push(["u"]);e=a.color;""==e&&b&&(e=b.color);d="";(e=Fn(e))&&(d+="."+e);e=a.backgroundColor;""==e&&b&&(e=b.backgroundColor);(b=Fn(e))&&(d+=".bg_"+b);d&&c.push(["c",d]);return c.reduceRight(function(g,h){var k=t(h);h=k.next().value;
|
|
549
|
-
h+(void 0===k?"":k)+">"+g+"</"+h+">"},a.payload)}
|
|
550
|
+
var Dn={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",ism:"application/vnd.ms-sstr+xml",mp3:"audio/mpeg",aac:"audio/aac",flac:"audio/flac",wav:"audio/wav",sbv:"text/x-subviewer",srt:"text/srt",vtt:"text/vtt",webvtt:"text/vtt",ttml:"application/ttml+xml",lrc:"application/x-subtitle-lrc",ssa:"text/x-ssa",ass:"text/x-ssa"};function En(a,b){if(a.lineBreak)return"\n";if(a.nestedCues.length)return a.nestedCues.map(function(g){return En(g,a)}).join("");if(!a.payload)return a.payload;var c=[],d=a.fontWeight>=be,e=a.fontStyle==ce,f=a.textDecoration.includes(de);d&&c.push(["b"]);e&&c.push(["i"]);f&&c.push(["u"]);e=a.color;""==e&&b&&(e=b.color);d="";(e=Fn(e))&&(d+="."+e);e=a.backgroundColor;""==e&&b&&(e=b.backgroundColor);(b=Fn(e))&&(d+=".bg_"+b);d&&c.push(["c",d]);return c.reduceRight(function(g,h){var k=t(h);h=k.next().value;
|
|
551
|
+
k=k.next().value;return"<"+h+(void 0===k?"":k)+">"+g+"</"+h+">"},a.payload)}
|
|
550
552
|
function Fn(a){a=a.toLowerCase();var b=a.replace(/\s/g,"").match(/^rgba?\((\d+),(\d+),(\d+),?([^,\s)]+)?/i);b?a="#"+(parseInt(b[1],10)|256).toString(16).slice(1)+(parseInt(b[2],10)|256).toString(16).slice(1)+(parseInt(b[3],10)|256).toString(16).slice(1):a.startsWith("#")&&7<a.length&&(a=a.slice(0,7));switch(a){case "white":case "#fff":case "#ffffff":return"white";case "lime":case "#0f0":case "#00ff00":return"lime";case "cyan":case "#0ff":case "#00ffff":return"cyan";case "red":case "#f00":case "#ff0000":return"red";
|
|
551
553
|
case "yellow":case "#ff0":case "#ffff00":return"yellow";case "magenta":case "#f0f":case "#ff00ff":return"magenta";case "blue":case "#00f":case "#0000ff":return"blue";case "black":case "#000":case "#000000":return"black"}return null}function Gn(a,b){var c=[];a=t(Hn(a));for(var d=a.next();!d.done;d=a.next())if(d=d.value,d.isContainer)c.push.apply(c,x(Gn(d.nestedCues,d)));else{var e=d.clone();e.nestedCues=[];e.payload=En(d,b);c.push(e)}return c}
|
|
552
554
|
function Hn(a){var b=[];a=t(a);for(var c=a.next(),d={};!c.done;d={Le:void 0},c=a.next())d.Le=c.value,b.some(function(e){return function(f){return Td(e.Le,f)}}(d))||b.push(d.Le);return b}
|
|
553
555
|
function In(a){function b(d){for(var e=5381,f=d.length;f;)e=33*e^d.charCodeAt(--f);return(e>>>0).toString()}if(a.startTime>=a.endTime)return null;var c=new VTTCue(a.startTime,a.endTime,a.payload);c.id=b(a.startTime.toString())+b(a.endTime.toString())+b(a.payload);c.lineAlign=a.lineAlign;c.positionAlign=a.positionAlign;a.size&&(c.size=a.size);try{c.align=a.textAlign}catch(d){}"center"==a.textAlign&&"center"!=c.align&&(c.align="middle");"vertical-lr"==a.writingMode?c.vertical="lr":"vertical-rl"==a.writingMode&&
|
|
554
556
|
(c.vertical="rl");1==a.lineInterpretation&&(c.snapToLines=!1);null!=a.line&&(c.line=a.line);null!=a.position&&(c.position=a.position);return c}
|
|
555
|
-
function Jn(a){if(Infinity===a.endTime||a.endTime<a.startTime)return null;var b=new Ed(a.startTime,a.endTime,a.text);b.line="number"===typeof a.line?a.line:null;b.lineAlign=a.lineAlign;b.lineInterpretation=a.snapToLines?Jd:1;b.position="number"===typeof a.position?a.position:null;b.positionAlign=a.positionAlign;b.size=a.size;b.textAlign=a.align;"lr"===a.vertical?b.writingMode="vertical-lr":"rl"===a.vertical&&(b.writingMode="vertical-rl");a.region&&(b.region.id=a.region.id,
|
|
556
|
-
b.region.heightUnits=2,b.region.regionAnchorX=a.region.regionAnchorX,b.region.regionAnchorY=a.region.regionAnchorY,b.region.scroll=a.region.scroll,b.region.viewportAnchorX=a.region.viewportAnchorX,b.region.viewportAnchorY=a.region.viewportAnchorY,b.region.viewportAnchorUnits=Lb,b.region.width=a.region.width,b.region.widthUnits=Lb);Ud(b);return b};function Kn(a,b){this.g=null;for(var c=t(Array.from(a.textTracks)),d=c.next();!d.done;d=c.next())d=d.value,"metadata"!==d.kind&&"chapters"!==d.kind&&(d.mode="disabled",d.label==b&&(this.g=d));this.g||(this.g=a.addTextTrack("subtitles",b));this.g.mode="hidden"}q=Kn.prototype;q.configure=function(){};q.remove=function(a,b){if(!this.g)return!1;Ln(this.g,function(c){return c.startTime<b&&c.endTime>a});return!0};
|
|
557
|
-
q.append=function(a){var b=Gn(a),c=[];a=this.g.cues?Array.from(this.g.cues):[];b=t(b);for(var d=b.next(),e={};!d.done;e={
|
|
558
|
-
c.indexOf(g)});a=t(a);for(b=a.next();!b.done;b=a.next())this.g.addCue(b.value)};q.destroy=function(){this.g&&(Ln(this.g,function(){return!0}),this.g.mode="disabled");this.g=null;return Promise.resolve()};q.isTextVisible=function(){return"showing"==this.g.mode};q.setTextVisibility=function(a){this.g.mode=a?"showing":"hidden"};
|
|
557
|
+
function Jn(a){if(Infinity===a.endTime||a.endTime<a.startTime)return null;var b=new Ed(a.startTime,a.endTime,a.text);b.line="number"===typeof a.line?a.line:null;a.lineAlign&&(b.lineAlign=a.lineAlign);b.lineInterpretation=a.snapToLines?Jd:1;b.position="number"===typeof a.position?a.position:null;a.positionAlign&&(b.positionAlign=a.positionAlign);b.size=a.size;b.textAlign=a.align;"lr"===a.vertical?b.writingMode="vertical-lr":"rl"===a.vertical&&(b.writingMode="vertical-rl");a.region&&(b.region.id=a.region.id,
|
|
558
|
+
b.region.height=a.region.lines,b.region.heightUnits=2,b.region.regionAnchorX=a.region.regionAnchorX,b.region.regionAnchorY=a.region.regionAnchorY,b.region.scroll=a.region.scroll,b.region.viewportAnchorX=a.region.viewportAnchorX,b.region.viewportAnchorY=a.region.viewportAnchorY,b.region.viewportAnchorUnits=Lb,b.region.width=a.region.width,b.region.widthUnits=Lb);Ud(b);return b};function Kn(a,b){this.g=null;for(var c=t(Array.from(a.textTracks)),d=c.next();!d.done;d=c.next())d=d.value,"metadata"!==d.kind&&"chapters"!==d.kind&&(d.mode="disabled",d.label==b&&(this.g=d));this.g||(this.g=a.addTextTrack("subtitles",b));this.g.mode="hidden"}q=Kn.prototype;q.configure=function(){};q.remove=function(a,b){if(!this.g)return!1;Ln(this.g,function(c){return c.startTime<b&&c.endTime>a});return!0};
|
|
559
|
+
q.append=function(a){var b=Gn(a),c=[];a=this.g.cues?Array.from(this.g.cues):[];b=t(b);for(var d=b.next(),e={};!d.done;e={Ic:void 0},d=b.next())e.Ic=d.value,!a.some(function(f){return function(g){return g.startTime==f.Ic.startTime&&g.endTime==f.Ic.endTime&&g.text==f.Ic.payload?!0:!1}}(e))&&e.Ic.payload&&(d=In(e.Ic))&&c.push(d);a=c.slice().sort(function(f,g){return f.startTime!=g.startTime?f.startTime-g.startTime:f.endTime!=g.endTime?f.endTime-g.startTime:"line"in VTTCue.prototype?c.indexOf(g)-c.indexOf(f):
|
|
560
|
+
c.indexOf(f)-c.indexOf(g)});a=t(a);for(b=a.next();!b.done;b=a.next())this.g.addCue(b.value)};q.destroy=function(){this.g&&(Ln(this.g,function(){return!0}),this.g.mode="disabled");this.g=null;return Promise.resolve()};q.isTextVisible=function(){return"showing"==this.g.mode};q.setTextVisibility=function(a){this.g.mode=a?"showing":"hidden"};
|
|
559
561
|
function Ln(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}S("shaka.text.SimpleTextDisplayer",Kn);Kn.prototype.setTextVisibility=Kn.prototype.setTextVisibility;Kn.prototype.isTextVisible=Kn.prototype.isTextVisible;Kn.prototype.destroy=Kn.prototype.destroy;Kn.prototype.append=Kn.prototype.append;Kn.prototype.remove=Kn.prototype.remove;Kn.prototype.configure=Kn.prototype.configure;function Mn(){}q=Mn.prototype;q.configure=function(){};q.remove=function(){};q.append=function(){};q.destroy=function(){};q.isTextVisible=function(){return!1};q.setTextVisibility=function(){};S("shaka.text.StubTextDisplayer",Mn);Mn.prototype.setTextVisibility=Mn.prototype.setTextVisibility;Mn.prototype.isTextVisible=Mn.prototype.isTextVisible;Mn.prototype.destroy=Mn.prototype.destroy;Mn.prototype.append=Mn.prototype.append;Mn.prototype.remove=Mn.prototype.remove;Mn.prototype.configure=Mn.prototype.configure;function Nn(){}function On(a){for(;a.firstChild;)a.removeChild(a.firstChild)}S("shaka.util.Dom",Nn);Nn.removeAllChildren=On;function Pn(a,b,c){var d=this;this.m=!1;this.h=[];this.A=a;this.s=b;this.l=null;this.g=document.createElement("div");this.g.classList.add("shaka-text-container");this.g.style.textAlign="center";this.g.style.display="flex";this.g.style.flexDirection="column";this.g.style.alignItems="center";this.g.style.justifyContent="flex-end";this.s.appendChild(this.g);c&&c.captionsUpdatePeriod||rb("UITextDisplayer w/ config","Please migrate to initializing UITextDisplayer with a config.");this.C=(new $b(function(){d.A.paused||
|
|
560
562
|
Qn(d)})).Ra(c&&c.captionsUpdatePeriod?c.captionsUpdatePeriod:.25);this.i=new Map;this.j=new hb;this.j.D(document,"fullscreenchange",function(){Qn(d,!0)});this.j.D(this.A,"seeking",function(){Qn(d,!0)});this.j.D(this.A,"resize",function(){var e=d.A,f=e.videoWidth;e=e.videoHeight;f&&e?d.l=f/e:d.l=null});this.o=null;"ResizeObserver"in window&&(this.o=new ResizeObserver(function(){Qn(d,!0)}),this.o.observe(this.g));this.B=new Map}q=Pn.prototype;q.configure=function(a){this.C&&this.C.Ra(a.captionsUpdatePeriod)};
|
|
561
563
|
q.append=function(a){var b=[].concat(x(this.h));a=t(Hn(a));for(var c=a.next(),d={};!c.done;d={Me:void 0},c=a.next())d.Me=c.value,b.some(function(e){return function(f){return Td(f,e.Me)}}(d))||this.h.push(d.Me);Qn(this)};q.destroy=function(){if(!this.g)return Promise.resolve();this.s.removeChild(this.g);this.g=null;this.m=!1;this.h=[];this.C&&this.C.stop();this.i.clear();this.j&&(this.j.release(),this.j=null);this.o&&(this.o.disconnect(),this.o=null);return Promise.resolve()};
|
|
@@ -585,7 +587,7 @@ function lo(a){function b(n){return 100*c(n/100)}function c(n){return Math.round
|
|
|
585
587
|
l?h:"symbol"===l?h+"="+k.description:h+"="+k;e.push(m)}}return e.join(",")}function qo(a){var b=Object.keys(a),c={},d=["Object","Request","Session","Status"],e=[{},{},{},{}],f={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3};b=t(b);for(var g=b.next();!g.done;g=b.next())g=g.value,e[null!=f[g]?f[g]:1][g]=a[g];for(a=0;a<e.length;a++)(f=lo(e[a]))&&(c["CMCD-"+d[a]]=f);return c}
|
|
586
588
|
function mo(a,b){if(!b||a.includes("offline:"))return a;a=new ve(a);a.g.set("CMCD",b);return a.toString()}var ko="m",io="a",oo="v",jo="av",so="i",uo="c",to="tt",bo="d",co="ld",eo="h",fo="lh";S("shaka.util.CmcdManager.StreamingFormat",{DASH:bo,vj:co,HLS:eo,wj:fo,Jj:"s",OTHER:"o"});function yo(a){this.h=a;this.g=null}q=yo.prototype;q.configure=function(a){this.h=a};q.vg=function(){return this.h.enabled&&this.h.applyMaximumSuggestedBitrate&&this.g&&this.g.has(zo)?1E3*this.g.get(zo):null};q.ug=function(){return this.h.enabled&&this.g&&this.g.has(Ao)?1E3*this.g.get(Ao):null};q.Uh=function(){return this.h.enabled&&this.g&&this.g.has(Bo)?this.g.get(Bo):null};q.Vh=function(){return this.h.enabled&&this.g&&this.g.has(Co)?this.g.get(Co):null};
|
|
587
589
|
q.getBandwidthEstimate=function(a){var b=this.ug();if(!b)return a;var c=this.h.estimatedThroughputWeightRatio;return 0<c&&1>=c?a*(1-c)+b*c:a};function Do(a){return a?"false"===a.toLowerCase()?!1:/^[-0-9]/.test(a)?parseInt(a,10):a.replace(/["]+/g,""):!0}S("shaka.util.CmsdManager",yo);yo.prototype.getBandwidthEstimate=yo.prototype.getBandwidthEstimate;yo.prototype.getRoundTripTime=yo.prototype.Vh;yo.prototype.getResponseDelay=yo.prototype.Uh;yo.prototype.getEstimatedThroughput=yo.prototype.ug;
|
|
588
|
-
yo.prototype.getMaxBitrate=yo.prototype.vg;var Ao="etp",zo="mb",Bo="rd",Co="rtt";function Eo(){this.g=null;this.h=[]}function Fo(a,b){return P(function(c){if(1==c.g)return a.g?G(c,new Promise(function(d){return a.h.push(d)}),2):c.u(2);a.g=b;H(c)})}Eo.prototype.release=function(){0<this.h.length?this.h.shift()():this.g=null};function X(a,b,c){b=void 0===b?null:b;mh.call(this);var d=this;this.m=Go;this.h=null;this.ee=b;this.na=!1;this.qe=new hb;this.jd=new hb;this.l=new hb;this.Ta=new hb;this.vb=new hb;this.F=this.J=this.B=this.G=null;this.ye=0;this.aa=new Eo;this.ma=this.$f=this.ea=this.i=this.bb=this.H=this.j=this.$b=this.L=this.bg=this.fa=this.O=this.
|
|
590
|
+
yo.prototype.getMaxBitrate=yo.prototype.vg;var Ao="etp",zo="mb",Bo="rd",Co="rtt";function Eo(){this.g=null;this.h=[]}function Fo(a,b){return P(function(c){if(1==c.g)return a.g?G(c,new Promise(function(d){return a.h.push(d)}),2):c.u(2);a.g=b;H(c)})}Eo.prototype.release=function(){0<this.h.length?this.h.shift()():this.g=null};function X(a,b,c){b=void 0===b?null:b;mh.call(this);var d=this;this.m=Go;this.h=null;this.ee=b;this.na=!1;this.qe=new hb;this.jd=new hb;this.l=new hb;this.Ta=new hb;this.vb=new hb;this.F=this.J=this.B=this.G=null;this.ye=0;this.aa=new Eo;this.ma=this.$f=this.ea=this.i=this.bb=this.H=this.j=this.$b=this.L=this.bg=this.fa=this.O=this.fd=this.N=this.ge=this.K=this.Fb=null;this.Da=!1;this.ya=this.o=null;this.ag=1E9;this.pd=[];this.X=NaN;this.g=Ho(this);this.T=null;this.Ae=-1;this.Fa=null;this.ga={width:Infinity,
|
|
589
591
|
height:Infinity};this.ae=new Ii(this.g,this.ga,null);this.je=[];this.s=null;this.Ea=new Jg(this.g.preferredAudioLanguage,this.g.preferredVariantRole,this.g.preferredAudioChannelCount,this.g.preferredVideoHdrLevel,this.g.preferSpatialAudio,this.g.preferredVideoLayout,this.g.preferredAudioLabel,this.g.preferredVideoLabel,this.g.mediaSource.codecSwitchingStrategy,this.g.manifest.dash.enableAudioGroups);this.Eb=this.g.preferredTextLanguage;this.nd=this.g.preferredTextRole;this.md=this.g.preferForcedSubs;
|
|
590
592
|
this.ld=[];c&&c(this);this.O=Io(this);this.fa=new yo(this.g.cmsd);this.G=Jo(this);this.G.Pf(this.g.streaming.forceHTTP);this.G.Qf(this.g.streaming.forceHTTPS);this.G.m=this.g.streaming.minBytesForProgressEvents;this.Hb=this.ca=this.A=null;this.Ce=!1;this.Be=new $b(function(){return P(function(e){if(1==e.g)return d.ca?G(e,d.Rb(d.Hb,!0),3):e.u(0);if(4!=e.g)return G(e,d.load(d.ca),4);d.Ce?d.Hb.pause():d.Hb.play();d.ca=null;d.Ce=!1;H(e)})});Ko&&(this.A=Ko(),this.A.configure(this.g.ads),this.vb.D(this.A,
|
|
591
593
|
"ad-content-pause-requested",function(e){var f;return P(function(g){if(1==g.g){d.Be.stop();if(d.ca)return g.u(0);d.Hb=d.h;d.Ce=d.h.ended;f=e.saveLivePosition||!1;return G(g,d.ng(!0,f),3)}d.ca=g.h;H(g)})}),this.vb.D(this.A,"ad-content-resume-requested",function(e){e=e.offset||0;if(d.ca){var f=d.ca;f.B&&e&&(f.B+=e)}d.Be.Z(.1)}),this.vb.D(this.A,"ad-content-attach-requested",function(){return P(function(e){return d.h||!d.Hb?e.u(0):G(e,d.Rb(d.Hb,!0),0)})}));this.qe.D(window,"online",function(){Lo(d);
|
|
@@ -595,14 +597,14 @@ q.destroy=function(){var a=this,b;return P(function(c){switch(c.g){case 1:if(a.m
|
|
|
595
597
|
mh.prototype.release.call(a),H(c)}})};function Ro(a,b){a.dispatchEvent(Po("onstatechange",(new Map).set("state",b)))}
|
|
596
598
|
q.Rb=function(a,b){b=void 0===b?!0:b;var c=this,d,e,f;return P(function(g){switch(g.g){case 1:if(c.m==Qo)throw new T(2,7,7E3);d=c.h&&c.h==a;if(!c.h||c.h==a){g.u(2);break}return G(g,c.detach(),2);case 2:return G(g,So(c,"attach"),4);case 4:if(g.h)return g.return();ua(g,5,6);d||(Ro(c,"attach"),e=function(){var h=To(c,!1);h&&Uo(c,h)},c.jd.D(a,"error",e),c.h=a);if(!b||!ac()||c.J){g.u(6);break}return G(g,Vo(c),6);case 6:Ba(g);c.aa.release();Ca(g,0);break;case 5:return f=za(g),G(g,c.detach(),10);case 10:throw f;
|
|
597
599
|
}})};q.vh=function(a){this.bg=a};q.detach=function(a){a=void 0===a?!1:a;var b=this;return P(function(c){if(1==c.g){if(b.m==Qo)throw new T(2,7,7E3);return G(c,b.ec(!1,a),2)}if(3!=c.g)return G(c,So(b,"detach"),3);if(c.h)return c.return();try{b.h&&(b.jd.Qa(),b.h=null),Ro(b,"detach"),b.A&&!a&&b.A.release()}finally{b.aa.release()}H(c)})};function So(a,b){var c;return P(function(d){return 1==d.g?(c=++a.ye,G(d,Fo(a.aa,b),2)):c!=a.ye?(a.aa.release(),d.return(!0)):d.return(!1)})}
|
|
598
|
-
q.ec=function(a,b){a=void 0===a?!0:a;b=void 0===b?!1:b;var c=this,d,e,f,g,h,k,l,m,n,p;return P(function(r){switch(r.g){case 1:return c.m!=Qo&&(c.m=Go),G(r,So(c,"unload"),2);case 2:if(r.h)return r.return();va(r,3);c.Da=!1;Ro(c,"unload");a&&!ac()&&(a=!1);No(c);d=c.ld.map(function(u){return u()});c.ld=[];return G(r,Promise.all(d),5);case 5:c.dispatchEvent(Po("unloading"));c.
|
|
600
|
+
q.ec=function(a,b){a=void 0===a?!0:a;b=void 0===b?!1:b;var c=this,d,e,f,g,h,k,l,m,n,p;return P(function(r){switch(r.g){case 1:return c.m!=Qo&&(c.m=Go),G(r,So(c,"unload"),2);case 2:if(r.h)return r.return();va(r,3);c.Da=!1;Ro(c,"unload");a&&!ac()&&(a=!1);No(c);d=c.ld.map(function(u){return u()});c.ld=[];return G(r,Promise.all(d),5);case 5:c.dispatchEvent(Po("unloading"));c.fd&&(c.fd.release(),c.fd=null);c.h&&(c.l.Qa(),c.Ta.Qa());c.he.stop();c.Fb&&(c.Fb.release(),c.Fb=null);c.ge&&(c.ge.stop(),c.ge=null);
|
|
599
601
|
if(!c.H){r.u(6);break}return G(r,c.H.stop(),7);case 7:c.H=null,c.bb=null;case 6:if(!c.o){r.u(8);break}return G(r,c.o.stop(),8);case 8:if(!c.j){r.u(10);break}return G(r,c.j.destroy(),11);case 11:c.j=null;case 10:c.K&&(c.K.release(),c.K=null);c.F&&(c.F.release(),c.F=null);if(!zc("webkit")||!c.B){r.u(12);break}return G(r,c.B.destroy(),13);case 13:c.B=null;case 12:if(!c.J){r.u(14);break}return G(r,c.J.destroy(),15);case 15:c.J=null;case 14:if(c.A&&!b)c.A.onAssetUnload();c.ca&&!b&&(c.ca.destroy(),c.ca=
|
|
600
602
|
null);b||c.Be.stop();c.O&&$n(c.O);c.fa&&(c.fa.g=null);if(!c.C){r.u(16);break}return G(r,c.C.destroy(),17);case 17:c.C=null;case 16:c.h&&On(c.h);if(!c.h||!c.h.src){r.u(18);break}return G(r,new Promise(function(u){return(new $b(u)).Z(.1)}),19);case 19:c.h.removeAttribute("src"),c.h.load();case 18:if(!c.B){r.u(20);break}return G(r,c.B.destroy(),21);case 21:c.B=null;case 20:c.sa&&c.ea!=c.sa.Gc()&&(c.sa.s||c.sa.destroy(),c.sa=null);c.ea=null;c.$f=null;c.N=null;if(c.i){e=t(c.i.variants);for(f=e.next();!f.done;f=
|
|
601
603
|
e.next())for(g=f.value,h=t([g.audio,g.video]),k=h.next();!k.done;k=h.next())(l=k.value)&&l.segmentIndex&&l.segmentIndex.release();m=t(c.i.textStreams);for(n=m.next();!n.done;n=m.next())p=n.value,p.segmentIndex&&p.segmentIndex.release()}c.g.streaming.clearDecodingCache&&(fg={},Yb.clear());c.i=null;c.s=new ul;c.we=null;c.Fa=null;c.T=null;c.Ae=-1;c.pd=[];c.X=NaN;Wo(c);case 3:Ba(r);c.aa.release();Ca(r,4);break;case 4:if(a&&ac()&&!c.J&&c.h)return G(r,Vo(c),0);r.u(0)}})};q.aj=function(a){this.ma=a};
|
|
602
604
|
q.load=function(a,b,c){b=void 0===b?null:b;var d=this,e,f,g,h,k,l,m,n,p,r,u,v,w;return P(function(y){switch(y.g){case 1:if(d.m==Qo)throw new T(2,7,7E3);e=null;f="";a instanceof Um?(e=a,f=e.Gc()||""):f=a||"";return G(y,Fo(d.aa,"load"),2);case 2:d.aa.release();if(!d.h)throw new T(2,7,7002);if(!d.ea){y.u(3);break}d.ea=f;return G(y,d.ec(!1),3);case 3:g=++d.ye;h=function(){return P(function(z){if(1==z.g)return d.ye==g?z.u(0):e?G(z,e.destroy(),3):z.u(3);throw new T(2,7,7E3);})};k=function(z,D){return P(function(A){switch(A.g){case 1:return va(A,
|
|
603
605
|
2),G(A,Fo(d.aa,D),4);case 4:return G(A,h(),5);case 5:return G(A,z(),6);case 6:return G(A,h(),7);case 7:e&&d.g&&(e.g=d.g);case 2:Ba(A),d.aa.release(),Ca(A,0)}})};ua(y,5,6);null==b&&e&&(b=e.getStartTime());d.ma=b;d.Da=!1;d.dispatchEvent(Po("loading"));if(e){c=e.X;y.u(8);break}if(c){y.u(8);break}return G(y,k(function(){return P(function(z){if(1==z.g)return G(z,Xo(d,f),2);c=z.h;H(z)})},"guessMimeType_"),8);case 8:l=!!e;if(e){Xm(e,d);d.s=e.getStats();y.u(11);break}return G(y,Yo(d,f,b,c,!0),12);case 12:(e=
|
|
604
606
|
y.h)?(e.A=!1,Xm(e,d),d.s=e.getStats(),e.start(),e.m.catch(function(){})):d.s=new ul;case 11:m=!e;n=Date.now()/1E3;d.s=e?e.getStats():new ul;d.ea=f;d.$f=c||null;if(m)return G(y,k(function(){return P(function(z){return G(z,Zo(d,c),0)})},"initializeSrcEqualsDrmInner_"),20);if(d.J){y.u(15);break}return G(y,k(function(){return P(function(z){return G(z,Vo(d),0)})},"initializeMediaSourceEngineInner_"),15);case 15:return G(y,k(function(){return P(function(z){return G(z,e.m,0)})},"waitForFinish"),17);case 17:d.g=
|
|
605
|
-
e.getConfiguration();d.ae=e.F;d.bb=e.G;d.H=Zm(e);d.H&&d.H.setMediaElement&&d.h&&d.H.setMediaElement(d.h);d.
|
|
607
|
+
e.getConfiguration();d.ae=e.F;d.bb=e.G;d.H=Zm(e);d.H&&d.H.setMediaElement&&d.h&&d.H.setMediaElement(d.h);d.fd=$m(e);d.$b=e.Ea;d.i=e.gf();if(p=e.o)d.Ea=p;l&&d.h&&"AUDIO"===d.h.nodeName&&($o(d),d.configure("manifest.disableVideo",!0));d.B=an(e);return G(y,k(function(){return P(function(z){return G(z,d.B.Rb(d.h),0)})},"drmEngine_.attach"),18);case 18:return!(r=e.C)||d.ya&&d.ya==r||(d.o=Ym(e),d.ya=e.C,"function"!=typeof d.o.setMediaElement&&(rb("AbrManager w/o setMediaElement","Please use an AbrManager with setMediaElement function."),
|
|
606
608
|
d.o.setMediaElement=function(){}),"function"!=typeof d.o.setCmsdManager&&(rb("AbrManager w/o setCmsdManager","Please use an AbrManager with setCmsdManager function."),d.o.setCmsdManager=function(){}),"function"!=typeof d.o.trySuggestStreams&&(rb("AbrManager w/o trySuggestStreams","Please use an AbrManager with trySuggestStreams function."),d.o.trySuggestStreams=function(){})),u=bn(e),v=e.ga,G(y,k(function(){return P(function(z){return G(z,ap(d,n,v,u),0)})},"loadInner_"),19);case 19:Wm(e);y.u(14);
|
|
607
609
|
break;case 20:return G(y,k(function(){return P(function(z){return G(z,bp(d,n,c),0)})},"srcEqualsInner_"),14);case 14:d.dispatchEvent(Po("loaded"));case 6:Ba(y);if(!e){y.u(22);break}return G(y,e.destroy(),22);case 22:d.sa=null;Ca(y,0);break;case 5:w=za(y);if(!w||7E3==w.code){y.u(24);break}return G(y,d.ec(!1),24);case 24:throw w;}})};
|
|
608
610
|
function $o(a){for(var b=t(a.i.variants),c=b.next();!c.done;c=b.next())c=c.value,c.video&&(c.video.closeSegmentIndex(),c.video=null),c.bandwidth=c.audio&&c.audio.bandwidth?c.audio.bandwidth:0;a.i.variants=a.i.variants.filter(function(d){return d.audio})}q.Xi=function(a,b){a=void 0===a?!0:a;b=void 0===b?!1:b;var c=this,d;return P(function(e){return 1==e.g?G(e,cp(c),2):3!=e.g?(d=e.h,G(e,c.ec(a,b),3)):e.return(d)})};
|
|
@@ -647,13 +649,13 @@ Do(n[1]))}}catch(w){}if(l=e["cmsd-dynamic"]){try{var p=new Map,r=l.split(";");fo
|
|
|
647
649
|
h.j?co:bo;break a;case 3:case 2:l=h.j?fo:eo;break a;case 5:l="s";break a}l=void 0}h.i=l}no(h,f,{ot:ko,su:!h.l})}}catch(M){$a("CMCD_MANIFEST_ERROR","Could not generate manifest CMCD data.",M)}break;case Ah:try{if(h.g.enabled){var m=k.segment;l=0;m&&(l=m.endTime-m.startTime);var n={d:1E3*l,st:h.h.U()?"l":"v"};n.ot=ro(k);var p=n.ot===oo||n.ot===io||n.ot===jo||n.ot===to,r=k.stream;if(r){var u=h.h.fb();if(p&&(n.bl=vo(h,r.type),n.ot!==to)){var v=wo(h,r.type);n.dl=u?v/Math.abs(u):v}r.bandwidth&&(n.br=r.bandwidth/
|
|
648
650
|
1E3);if(r.segmentIndex&&m){var w=r.segmentIndex.Ib(m.endTime,!0,0>u);if(w){var y=w.next().value;if(y&&y!=m){if(!Qb(m.M(),y.M())){var z=y.M()[0],D=f.uris[0],A=new URL(z),B=new URL(D);if(A.origin!==B.origin)var C=z;else{for(var E=A.pathname.split("/").slice(1),F=B.pathname.split("/").slice(1,-1);E[0]===F[0];)E.shift(),F.shift();for(;F.length;)F.shift(),E.unshift("..");C=E.join("/")}n.nor=C}if((y.Ga||y.ua)&&(m.Ga!=y.Ga||m.ua!=y.ua)){var J=y.Ga+"-";y.ua&&(J+=y.ua);n.nrr=J}}}var K=h.h.fb()||1,L=wo(h,r.type)||
|
|
649
651
|
500,I=r.bandwidth;var N=I?I*(m.endTime-m.startTime)/1E3/(L/K/1E3)*h.g.rtpSafetyFactor:NaN;isNaN(N)||(n.rtp=N)}}p&&n.ot!==to&&(n.tb=xo(h,n.ot)/1E3);no(h,f,n)}}catch(M){$a("CMCD_SEGMENT_ERROR","Could not generate segment CMCD data.",M)}break;case 2:case 5:case 6:no(h,f,{ot:"k"});break;case 4:no(h,f,{ot:"o"})}})},function(e,f,g,h){(e=b()?b().j:a.H)&&e.banLocation&&e.banLocation(h)},function(e,f){if(f.data){f=f.data.byteLength;var g=b()?b().getStats():a.s;g&&(g.hc=isNaN(g.hc)?f:g.hc+f,0===e&&(g.Dg=f))}})}
|
|
650
|
-
function vp(a,b){return new cl(a.h,a.i,a.g.streaming,b,function(){a.Fb&&ol(a.Fb,!0);a.j&&a.j.
|
|
651
|
-
function wp(a,b){b=new xn(a.
|
|
652
|
+
function vp(a,b){return new cl(a.h,a.i,a.g.streaming,b,function(){a.Fb&&ol(a.Fb,!0);a.j&&a.j.Rc();a.N&&Lp(a)},function(c){return a.dispatchEvent(c)})}
|
|
653
|
+
function wp(a,b){b=new xn(a.fd,a.U()||0<b);b.addEventListener("enter",function(d){hp(a,"timelineregionenter",d.region)});b.addEventListener("exit",function(d){hp(a,"timelineregionexit",d.region)});b.addEventListener("skip",function(d){var e=d.region;d.seeking||(hp(a,"timelineregionenter",e),hp(a,"timelineregionexit",e))});var c=new nl(a.h);c.g.add(b);a.$b&&c.g.add(a.$b);return c}
|
|
652
654
|
function xp(a,b,c){a.N=new Ug;a.N.g=Wg;Xg(a.N,c,Math.min(.5,c/2));Wo(a);a.ge=(new $b(function(){Lp(a)})).Ra(.25);a.l.D(b,"waiting",function(){return Lp(a)});a.l.D(b,"stalled",function(){return Lp(a)});a.l.D(b,"canplaythrough",function(){return Lp(a)});a.l.D(b,"progress",function(){return Lp(a)})}
|
|
653
655
|
function Lp(a){switch(a.m){case Gp:if(a.h.ended)var b=!0;else{var c=fj(a.h.buffered);b=null!=c&&c>=a.h.duration-1}break;case tp:a:if(a.h.ended||nk(a.J))b=!0;else{if(a.i.presentationTimeline.U()){c=a.i.presentationTimeline.Xb();var d=fj(a.h.buffered);if(null!=d&&d>=c){b=!0;break a}}b=!1}break;default:b=!1}d=hj(a.h.buffered,a.h.currentTime);c=a.N;var e=b,f=c.i.get(c.g);b=c.g;d=e||d>=f?Vg:Wg;c.g=d;(b=b!=d)&&d===Vg&&(c.h=Date.now());b&&Wo(a)}function mp(a,b,c,d){return new ek(a,b,c,d)}
|
|
654
656
|
function Io(a){return new Zn({getBandwidthEstimate:function(){return a.o?a.o.getBandwidthEstimate():NaN},xb:function(){return a.xb()},getCurrentTime:function(){return a.h?a.h.currentTime:0},fb:function(){return a.fb()},yb:function(){return a.yb()},mc:function(){return a.mc()},U:function(){return a.U()}},a.g.cmcd)}
|
|
655
657
|
function sp(a){return new Vl(a.i,{Jd:function(){return a.F?a.F.wd():0},getBandwidthEstimate:function(){return a.o.getBandwidthEstimate()},fb:function(){return a.fb()},ba:a.J,Lb:a.G,onError:function(b){return Uo(a,b)},onEvent:function(b){return a.dispatchEvent(b)},xi:function(){a.H&&a.H.update&&a.H.update()},Bf:function(b,c){var d=b.startTime;b=b.endTime;var e=c.type;c=c.codecs.includes(",");if(a.F){a.F.Ig();var f=ok(a.J,e);!a.U()&&a.h.paused&&null!=f&&0<f&&a.F.wd()<f&&a.F.Ee(f)}Lp(a);d=(new Map).set("start",
|
|
656
|
-
d).set("end",b).set("contentType",e).set("isMuxed",c);a.dispatchEvent(Po("segmentappended",d))},wi:function(b,c){(c=c.
|
|
658
|
+
d).set("end",b).set("contentType",e).set("isMuxed",c);a.dispatchEvent(Po("segmentappended",d))},wi:function(b,c){(c=c.Kc)&&a.$b&&Kl(a.$b,c,b)},hg:function(b,c){var d=a.B;if(d.h.parseInbandPsshEnabled&&!d.F&&["audio","video"].includes(b)){b=new Wh(Ab(c));c=0;for(var e=t(b.data),f=e.next();!f.done;f=e.next())c+=f.value.length;if(0==c)d=Promise.resolve();else{c=new Uint8Array(c);e=0;b=t(b.data);for(f=b.next();!f.done;f=b.next())f=f.value,c.set(f,e),e+=f.length;ni(d,"cenc",c);d=d.l}}else d=Promise.resolve();
|
|
657
659
|
return d},onMetadata:function(b,c,d){np(a,b,c,d)},disableStream:function(b,c){return a.disableStream(b,c)}})}
|
|
658
660
|
q.configure=function(a,b){2==arguments.length&&"string"==typeof a&&(a=Gm(a,b));a.streaming&&"forceTransmuxTS"in a.streaming&&(rb("streaming.forceTransmuxTS configuration","Please Use mediaSource.forceTransmux instead."),a.mediaSource.mediaSource=a.streaming.forceTransmuxTS,delete a.streaming.forceTransmuxTS);a.streaming&&"forceTransmux"in a.streaming&&(rb("streaming.forceTransmux configuration","Please Use mediaSource.forceTransmux instead."),a.mediaSource.mediaSource=a.streaming.forceTransmux,delete a.streaming.forceTransmux);
|
|
659
661
|
a.streaming&&"useNativeHlsOnSafari"in a.streaming&&(rb("streaming.useNativeHlsOnSafari configuration","Please Use streaming.useNativeHlsForFairPlay or streaming.preferNativeHls instead."),a.streaming.preferNativeHls=a.streaming.useNativeHlsOnSafari&&nc(),delete a.streaming.useNativeHlsOnSafari);if(a.streaming&&"boolean"==typeof a.streaming.liveSync){rb("streaming.liveSync","Please Use streaming.liveSync.enabled instead.");var c=a.streaming.liveSync;a.streaming.liveSync={};a.streaming.liveSync.enabled=
|
|
@@ -672,9 +674,9 @@ a.i&&(b=Math.max(b,a.i.minBufferTime)),Xg(a.N,b,Math.min(.5,b/2)));a.i&&qp(a.i.p
|
|
|
672
674
|
q.sg=function(){if(this.h){var a=this.h.buffered.length;a=a?this.h.buffered.end(a-1):0;var b=this.getConfiguration().streaming.bufferingGoal;b=Math.min(this.h.currentTime+b,this.Ob().end);if(a>=b)return 1;if(!(a<=this.h.currentTime)&&a<b)return(a-this.h.currentTime)/(b-this.h.currentTime)}return 0};q.Ji=function(){for(var a in this.g)delete this.g[a];Tm(this.g,Ho(this),Ho(this));Mp(this)};q.ff=function(){return this.m};q.hf=function(){return this.i?this.i.type:null};q.Qh=function(){return this.h};
|
|
673
675
|
q.yb=function(){return this.G};q.Gc=function(){return this.ea};q.rg=function(){return this.A?this.A:null};q.U=function(){return this.i?this.i.presentationTimeline.U():this.h&&this.h.src?Infinity==this.h.duration:!1};q.pc=function(){return this.i?this.i.presentationTimeline.pc():!1};q.gi=function(){if(this.i){var a=this.i.variants;return a.length?!a[0].video:!1}return this.h&&this.h.src?this.h.videoTracks?0==this.h.videoTracks.length:0==this.h.videoHeight:!1};
|
|
674
676
|
q.Ob=function(){if(this.i){if(!this.Da&&"HLS"==this.i.type)return{start:0,end:0};var a=this.i.presentationTimeline;return{start:a.Wb(),end:a.zb()}}return this.h&&this.h.src&&(a=this.h.seekable,a.length)?{start:a.start(0),end:a.end(a.length-1)}:{start:0,end:0}};q.di=function(){this.U()&&(this.h.currentTime=this.Ob().end)};q.hi=function(){return this.Da};q.keySystem=function(){var a=this.drmInfo();return a?a.keySystem:""};q.drmInfo=function(){return this.B?this.B.g:null};
|
|
675
|
-
q
|
|
676
|
-
q.ud=function(a,b){var c=this;b=void 0===b?!0:b;0==a?Za("A trick play rate of 0 is unsupported!"):(this.Ta.Qa(),this.h.paused&&this.h.play(),this.K.set(a),this.m==tp&&(this.o.playbackRateChanged(a),gm(this.j,b&&1<Math.abs(a))),this.U()&&this.Ta.D(this.h,"timeupdate",function(){var d=c.h.currentTime,e=c.Ob(),f=c.g.streaming.safeSeekOffset;0<a?Math.floor(d)>=Math.floor(e.end)&&c.
|
|
677
|
-
q.
|
|
677
|
+
q.ad=function(){return this.B?this.B.ad():Infinity};q.ef=function(){return this.B?this.B.ef():[]};q.Id=function(){return this.B?this.B.Id():{}};q.pf=function(){return this.N?this.N.g==Wg:!1};q.fb=function(){return this.h?this.K?this.K.i:1:0};
|
|
678
|
+
q.ud=function(a,b){var c=this;b=void 0===b?!0:b;0==a?Za("A trick play rate of 0 is unsupported!"):(this.Ta.Qa(),this.h.paused&&this.h.play(),this.K.set(a),this.m==tp&&(this.o.playbackRateChanged(a),gm(this.j,b&&1<Math.abs(a))),this.U()&&this.Ta.D(this.h,"timeupdate",function(){var d=c.h.currentTime,e=c.Ob(),f=c.g.streaming.safeSeekOffset;0<a?Math.floor(d)>=Math.floor(e.end)&&c.Uc():Math.floor(d)<=Math.floor(e.start+f)&&c.Uc()}))};
|
|
679
|
+
q.Uc=function(){var a=this.K.lc();this.m==Gp&&this.K.set(a);this.m==tp&&(this.K.set(a),this.o.playbackRateChanged(a),gm(this.j,!1));this.Ta.Qa()};
|
|
678
680
|
q.mc=function(){if(this.i){for(var a=this.j?this.j.j:null,b=[],c=0,d=t(this.i.variants),e=d.next();!e.done;e=d.next())if(e=e.value,ug(e)){var f=lg(e);f.active=e==a;f.active||1==c||null==a||e.video!=a.video||e.audio!=a.audio||(f.active=!0);f.active&&c++;b.push(f)}return b}return this.h&&this.h.audioTracks?Array.from(this.h.audioTracks).map(function(g){return tg(g)}):[]};
|
|
679
681
|
q.Hc=function(){if(this.i){for(var a=this.j?this.j.s:null,b=[],c=t(this.i.textStreams),d=c.next();!d.done;d=c.next()){d=d.value;var e=mg(d);e.active=d==a;b.push(e)}return b}return this.h&&this.h.src&&this.h.textTracks?Fp(this).map(function(f){return rg(f)}):[]};q.Kh=function(){var a=this.pd;this.i&&(a=this.i.imageStreams);return a.map(function(b){return ng(b)})};
|
|
680
682
|
q.Ch=function(a){var b=this,c,d,e,f;return P(function(g){if(1==g.g){if(b.m!=tp&&b.m!=Gp)return g.return(null);c=b.pd;b.i&&(c=b.i.imageStreams);return(d=c.find(function(h){return h.id==a}))?d.segmentIndex?g.u(2):G(g,d.createSegmentIndex(),2):g.return(null)}if(4!=g.g)return e=[],d.segmentIndex.Gb(function(h){var k=Np(h.tilesLayout||d.tilesLayout);if(k){k=k.rows*k.ic;for(var l=h.j-h.startTime,m=0;m<k;m++)e.push(b.yg(a,h.startTime+l*m/k))}}),G(g,Promise.all(e),4);f=g.h;return g.return(f.filter(function(h){return h}))})};
|
|
@@ -703,14 +705,14 @@ q.qh=function(a,b,c,d,e,f,g){g=void 0===g?!1:g;var h=this,k,l,m,n,p,r,u,v,w,y,z,
|
|
|
703
705
|
l&&B.label==(f||"")&&B.kind==c}))return jp(h),A.return(n);throw new T(1,2,2012);case 4:p=$e;r=h.h.duration;h.i&&(r=h.i.presentationTimeline.getDuration());if(Infinity==r)throw new T(1,4,4033);if(!k.length){A.u(6);break}return G(A,Vp(h,a,h.G,h.g.streaming.retryParameters),7);case 7:u=A.h,v=Wp(h,u,d,k),w=new Blob([v],{type:"text/vtt"}),a=hk(w),d="text/vtt";case 6:y={id:h.ag++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:jl(0,r,[a]),mimeType:d||"",
|
|
704
706
|
codecs:e||"",kind:c,encrypted:!1,drmInfos:[],keyIds:new Set,language:b,originalLanguage:b,label:f||null,type:p.va,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!!g,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([cf(d||"",e||"")])};z=cf(y.mimeType,y.codecs);D=rf(z);if(!D)throw new T(2,2,2014,d);h.i.textStreams.push(y);jp(h);return A.return(mg(y))}})};
|
|
705
707
|
q.rh=function(a,b){var c=this,d,e,f,g,h,k,l,m,n,p,r,u,v,w,y,z;return P(function(D){switch(D.g){case 1:if(c.m!=tp&&c.m!=Gp)throw new T(1,7,7004);if(b){D.u(2);break}return G(D,Tp(c,a),3);case 3:b=D.h;case 2:if("text/vtt"!=b)throw new T(1,2,2017,a);d=$e;e=c.h.duration;c.i&&(e=c.i.presentationTimeline.getDuration());if(Infinity==e)throw new T(1,4,4045);return G(D,Vp(c,a,c.G,c.g.streaming.retryParameters),4);case 4:f=D.h;g=sf[b];if(!g)throw new T(2,2,2014,b);h=g();k={periodStart:0,segmentStart:0,segmentEnd:e,
|
|
706
|
-
vttOffset:0};l=Ab(f);m=h.parseMedia(l,k,a,[]);n=[];p=t(m);r=p.next();for(u={};!r.done;u={ve:void 0,Cc:void 0},r=p.next())u.Cc=r.value,u.ve=null,v=function(A){return function(){null==A.ve&&(A.ve=Se([a],[A.Cc.payload]));return A.ve||[]}}(u),w=new
|
|
708
|
+
vttOffset:0};l=Ab(f);m=h.parseMedia(l,k,a,[]);n=[];p=t(m);r=p.next();for(u={};!r.done;u={ve:void 0,Cc:void 0},r=p.next())u.Cc=r.value,u.ve=null,v=function(A){return function(){null==A.ve&&(A.ve=Se([a],[A.Cc.payload]));return A.ve||[]}}(u),w=new Yi(u.Cc.startTime,u.Cc.endTime,v,0,null,null,0,0,Infinity),u.Cc.payload.includes("#xywh")&&(y=u.Cc.payload.split("#xywh=")[1].split(","),4===y.length&&w.$g({height:parseInt(y[3],10),positionX:parseInt(y[0],10),positionY:parseInt(y[1],10),width:parseInt(y[2],
|
|
707
709
|
10)})),n.push(w);z={id:c.ag++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new hl(n),mimeType:b||"",codecs:"",kind:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"und",originalLanguage:null,label:null,type:d.De,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,tilesLayout:"1x1",accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([cf(b||
|
|
708
710
|
"","")])};c.m==Gp?c.pd.push(z):c.i.imageStreams.push(z);jp(c);return D.return(ng(z))}})};
|
|
709
711
|
q.ph=function(a,b,c){var d=this,e,f,g,h;return P(function(k){switch(k.g){case 1:if(d.m!=tp&&d.m!=Gp)throw new T(1,7,7004);if(c){k.u(2);break}return G(k,Tp(d,a),3);case 3:c=k.h;case 2:return e=[],d.A&&(e=d.A.getCuePoints()),G(k,Up(d,a,b,"chapters",c,"",e),4);case 4:f=k.h;g=d.tg();h=g.find(function(l){return l.language==b});if(!h){k.u(5);break}return G(k,new Promise(function(l,m){d.l.oa(f,"load",l);d.l.oa(f,"error",function(){m(new T(1,2,2015))})}),6);case 6:return jp(d),k.return(h);case 5:throw new T(1,
|
|
710
712
|
2,2012);}})};function Tp(a,b){var c;return P(function(d){switch(d.g){case 1:return ua(d,2),G(d,Cn(b,a.G,a.g.streaming.retryParameters),4);case 4:c=d.h;ya(d,3);break;case 2:za(d);case 3:if(c)return d.return(c);throw new T(1,2,2011,b);}})}
|
|
711
713
|
function Up(a,b,c,d,e,f,g){var h,k,l,m;return P(function(n){if(1==n.g)return"text/vtt"!=e||g.length?G(n,Vp(a,b,a.G,a.g.streaming.retryParameters),3):n.u(2);2!=n.g&&(h=n.h,k=Wp(a,h,e,g),l=new Blob([k],{type:"text/vtt"}),b=hk(l),e="text/vtt");m=document.createElement("track");var p=a.O,r=b;try{if(p.g.enabled){var u=ho(p);u.ot=uo;u.su=!0;var v=lo(u);var w=mo(r,v)}else w=r}catch(y){$a("CMCD_TEXT_TRACK_ERROR","Could not generate text track CMCD data.",y),w=r}m.src=w;m.label=f;m.kind=d;m.srclang=c;a.h.getAttribute("crossorigin")||
|
|
712
714
|
a.h.setAttribute("crossorigin","anonymous");a.h.appendChild(m);return n.return(m)})}function Vp(a,b,c,d){var e,f,g;return P(function(h){if(1==h.g){e=Ah;f=uh([b],d);f.method="GET";var k=a.O;try{k.g.enabled&&no(k,f,{ot:uo,su:!0})}catch(l){$a("CMCD_TEXT_ERROR","Could not generate text CMCD data.",l)}return G(h,c.request(e,f).promise,2)}g=h.h;return h.return(g.data)})}
|
|
713
|
-
function Wp(a,b,c,d){var e=sf[c];if(e)return c=e(),a={periodStart:0,segmentStart:0,segmentEnd:a.h.duration,vttOffset:0},b=Ab(b),b=c.parseMedia(b,a,null,[]),Yn(b,d);throw new T(2,2,2014,c);}q.Ui=function(a,b){this.ga.width=a;this.ga.height=b};q.Jf=function(a){if(this.m==tp){var b=this.j;a=void 0===a?.1:a;if(b.m.g)b=!1;else if(b.A)b=!1;else{for(var c=t(b.i.values()),d=c.next();!d.done;d=c.next())d=d.value,!d.
|
|
715
|
+
function Wp(a,b,c,d){var e=sf[c];if(e)return c=e(),a={periodStart:0,segmentStart:0,segmentEnd:a.h.duration,vttOffset:0},b=Ab(b),b=c.parseMedia(b,a,null,[]),Yn(b,d);throw new T(2,2,2014,c);}q.Ui=function(a,b){this.ga.width=a;this.ga.height=b};q.Jf=function(a){if(this.m==tp){var b=this.j;a=void 0===a?.1:a;if(b.m.g)b=!1;else if(b.A)b=!1;else{for(var c=t(b.i.values()),d=c.next();!d.done;d=c.next())d=d.value,!d.ed||d.Ka||d.ub||(d.ed=!1,em(b,d,a));b=!0}}else b=!1;return b};
|
|
714
716
|
q.gf=function(){Za("Shaka Player's internal Manifest structure is NOT covered by semantic versioning compatibility guarantees. It may change at any time! Please consider filing a feature request for whatever you use getManifest() for.");return this.i};q.Nh=function(){return this.bb};
|
|
715
717
|
function Ho(a){var b=Pm();b.streaming.failureCallback=function(c){if(a.U()){var d=null;1001==c.code||1002==c.code?(d=1,a.g.streaming.lowLatencyMode&&(d=.1)):1003==c.code&&(d=.1);null!=d&&(c.severity=1,a.Jf(d))}};b.textDisplayFactory=function(){if(a.ee){var c=a.getConfiguration();return new Pn(a.h,a.ee,c.textDisplayer)}return HTMLMediaElement.prototype.addTextTrack?new Kn(a.h,"Shaka Player TextTrack"):new Mn};return b}q.dh=function(a){this.ee=a};
|
|
716
718
|
function fp(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 kl,l=e.closedCaptions.get(g);h={id:a.ag++,originalId:g,groupId:null,
|
|
@@ -719,10 +721,10 @@ function yp(a,b){var c,d,e,f,g;return P(function(h){if(1==h.g)return c=a.audio,d
|
|
|
719
721
|
function Wo(a){var b=a.pf();if(a.s&&a.N&&a.F){var c=a.K;c.j=b;ml(c);a.O&&(c=a.O,b||c.l||(c.l=!0),c.l&&b&&(c.m=!0),c.o=b);op(a);c=a.g.streaming.liveSync.dynamicTargetLatency.maxAttempts;if(a.g.streaming.liveSync.dynamicTargetLatency.enabled&&b&&a.Ae<c){c=a.g.streaming.liveSync.dynamicTargetLatency.maxLatency;var d=a.g.streaming.liveSync.targetLatencyTolerance,e=a.g.streaming.liveSync.dynamicTargetLatency.rebufferIncrement;a.T&&(a.T=Math.min(a.T+ ++a.Ae*e,c-d))}}b=(new Map).set("buffering",b);a.dispatchEvent(Po("buffering",
|
|
720
722
|
b))}function pp(a){var b=a.h.playbackRate;0!=b&&(a.K&&a.K.set(b),b=Po("ratechange"),a.dispatchEvent(b))}
|
|
721
723
|
function op(a){if(a.s&&a.N){var b=a.s.g,c="playing";a.N.g==Wg?c="buffering":a.h.ended?c="ended":a.h.paused&&(c="paused");var d=c;if(null==b.g)b.g={timestamp:Date.now()/1E3,state:d,duration:0},b=!0;else{var e=Date.now()/1E3;b.g.duration=e-b.g.timestamp;b.g.state==d?b=!1:(b.h.push(b.g),b.g={timestamp:e,state:d,duration:0},b=!0)}b&&(c=(new Map).set("newstate",c),a.dispatchEvent(Po("statechanged",c)))}}
|
|
722
|
-
function Cp(a){var b=a.h.playbackRate,c=a.U();if(a.g.streaming.vodDynamicPlaybackRate&&!c){var d=a.g.streaming.vodDynamicPlaybackRateLowBufferRate,e=a.sg();e<=a.g.streaming.vodDynamicPlaybackRateBufferRatio?b!=d&&a.ud(d,!1):1==e&&b!==a.K.lc()&&a.
|
|
724
|
+
function Cp(a){var b=a.h.playbackRate,c=a.U();if(a.g.streaming.vodDynamicPlaybackRate&&!c){var d=a.g.streaming.vodDynamicPlaybackRateLowBufferRate,e=a.sg();e<=a.g.streaming.vodDynamicPlaybackRateBufferRatio?b!=d&&a.ud(d,!1):1==e&&b!==a.K.lc()&&a.Uc()}if(c&&(c=a.Ob(),Number.isFinite(c.end)&&!(a.h.currentTime<c.start))){d=a.g.streaming.liveSync.targetLatencyTolerance;e=a.g.streaming.liveSync.dynamicTargetLatency.enabled;var f=a.g.streaming.liveSync.dynamicTargetLatency.stabilityThreshold;if(a.g.streaming.liveSync&&
|
|
723
725
|
a.g.streaming.liveSync.enabled){var g=a.g.streaming.liveSync.targetLatency;var h=g+d;var k=Math.max(0,g-d);var l=a.g.streaming.liveSync.maxPlaybackRate;var m=a.g.streaming.liveSync.minPlaybackRate}else a.i&&a.i.serviceDescription&&(g=a.i.serviceDescription.targetLatency,null!=a.i.serviceDescription.targetLatency?h=a.i.serviceDescription.targetLatency+d:null!=a.i.serviceDescription.maxLatency&&(h=a.i.serviceDescription.maxLatency),null!=a.i.serviceDescription.targetLatency?k=Math.max(0,a.i.serviceDescription.targetLatency-
|
|
724
726
|
d):null!=a.i.serviceDescription.minLatency&&(k=a.i.serviceDescription.minLatency),l=a.i.serviceDescription.maxPlaybackRate||a.g.streaming.liveSync.maxPlaybackRate,m=a.i.serviceDescription.minPlaybackRate||a.g.streaming.liveSync.minPlaybackRate);a.T||"number"!==typeof g||(a.T=g);var n=a.g.streaming.liveSync.dynamicTargetLatency.maxAttempts;e&&a.Fa&&null!==a.T&&"number"===typeof g&&a.Ae<n&&Date.now()-a.Fa>1E3*f&&(f=a.g.streaming.liveSync.dynamicTargetLatency.minLatency,a.T=Math.max(a.T-(g-f)/2,f+d),
|
|
725
|
-
a.Fa=Date.now());e&&null!==a.T&&(h=a.T+d,k=a.T-d);g=c.end-a.h.currentTime;d=0;a.m==Gp&&(e=a.h.buffered,0<e.length&&(d=e.end(e.length-1),d=Math.max(l,d-c.end)));c=a.g.streaming.liveSync.panicMode;e=1E3*a.g.streaming.liveSync.panicThreshold;f=Date.now()-a.N.h;c&&!m&&(m=a.g.streaming.liveSync.minPlaybackRate);c&&m&&f<=e?b!=m&&a.ud(m,!1):h&&l&&g-d>h?(b!=l&&a.ud(l,!1),a.Fa=null):k&&m&&g-d<k?(b!=m&&a.ud(m,!1),a.Fa=null):b!==a.K.lc()&&(a.
|
|
727
|
+
a.Fa=Date.now());e&&null!==a.T&&(h=a.T+d,k=a.T-d);g=c.end-a.h.currentTime;d=0;a.m==Gp&&(e=a.h.buffered,0<e.length&&(d=e.end(e.length-1),d=Math.max(l,d-c.end)));c=a.g.streaming.liveSync.panicMode;e=1E3*a.g.streaming.liveSync.panicThreshold;f=Date.now()-a.N.h;c&&!m&&(m=a.g.streaming.liveSync.minPlaybackRate);c&&m&&f<=e?b!=m&&a.ud(m,!1):h&&l&&g-d>h?(b!=l&&a.ud(l,!1),a.Fa=null):k&&m&&g-d<k?(b!=m&&a.ud(m,!1),a.Fa=null):b!==a.K.lc()&&(a.Uc(),a.Fa=Date.now())}}
|
|
726
728
|
function Dp(a){if(a.h){var b=!1,c=a.h.currentTime/a.h.duration;isNaN(c)||(c=Math.round(100*c),isNaN(a.X)?(a.X=c,b=!0):(c=Math.max(a.X,c),a.X!=c&&(a.X=c,b=!0)));if(b){var d;0==a.X?d=Po("started"):25==a.X?d=Po("firstquartile"):50==a.X?d=Po("midpoint"):75==a.X?d=Po("thirdquartile"):100==a.X&&(d=Po("complete"));d&&a.dispatchEvent(d)}}}function kp(a){try{Ni(a.ae,a.i)}catch(c){return Uo(a,c),!1}var b=vg(a.i.variants);b=a.Ea.create(b);a.o.setVariants(Array.from(b.values()));return!0}
|
|
727
729
|
function Mo(a,b,c,d,e){b=void 0===b?!0:b;c=void 0===c?0:c;d=void 0===d?!1:d;e=void 0===e?!0:e;var f;(f=kp(a)?a.o.chooseVariant():null)&&rp(a,f,e,b,c,d)}
|
|
728
730
|
function rp(a,b,c,d,e,f){f=void 0===f?!1:f;var g=a.j.j;if(b==g)d&&im(a.j,b,d,e,!0);else{var h=a.s.h;h.h!=b&&(h.h=b,h.g.push({timestamp:Date.now()/1E3,id:b.id,type:"variant",fromAdaptation:c,bandwidth:b.bandwidth}));im(a.j,b,d,e,f,c);d=null;g&&(d=lg(g));b=lg(b);c?(c=(new Map).set("oldTrack",d).set("newTrack",b),a.L&&dk(a.L,b,a.hf()),c=Po("adaptation",c),Xp(a,c)):Yp(a,d,b)}}
|
|
@@ -741,14 +743,14 @@ function Qp(a){var b=new Map,c=new Map;a=t(a);for(var d=a.next();!d.done;d=a.nex
|
|
|
741
743
|
h.push({language:l,role:m,label:n})}});return h}S("shaka.Player",X);X.prototype.addFont=X.prototype.addFont;X.prototype.setVideoContainer=X.prototype.dh;X.prototype.getManifestParserFactory=X.prototype.Nh;X.prototype.getManifest=X.prototype.gf;X.prototype.retryStreaming=X.prototype.Jf;X.prototype.setMaxHardwareResolution=X.prototype.Ui;X.prototype.addChaptersTrack=X.prototype.ph;X.prototype.addThumbnailsTrack=X.prototype.rh;X.prototype.addTextTrackAsync=X.prototype.qh;X.prototype.getStats=X.prototype.getStats;
|
|
742
744
|
X.prototype.getBufferedInfo=X.prototype.xb;X.prototype.getSegmentAvailabilityDuration=X.prototype.Ld;X.prototype.getPresentationStartTimeAsDate=X.prototype.xg;X.prototype.getPlayheadTimeAsDate=X.prototype.Sh;X.prototype.setTextTrackVisibility=X.prototype.Zg;X.prototype.getChapters=X.prototype.Gh;X.prototype.getChaptersTracks=X.prototype.tg;X.prototype.isTextTrackVisible=X.prototype.rf;X.prototype.selectVariantsByLabel=X.prototype.Pi;X.prototype.selectTextLanguage=X.prototype.Lf;
|
|
743
745
|
X.prototype.selectAudioLanguage=X.prototype.Sg;X.prototype.getTextLanguages=X.prototype.Wh;X.prototype.getAudioLanguages=X.prototype.Dh;X.prototype.getTextLanguagesAndRoles=X.prototype.Xh;X.prototype.getAudioLanguagesAndRoles=X.prototype.Eh;X.prototype.selectVariantTrack=X.prototype.Mf;X.prototype.selectTextTrack=X.prototype.Tg;X.prototype.getThumbnails=X.prototype.yg;X.prototype.getAllThumbnails=X.prototype.Ch;X.prototype.getImageTracks=X.prototype.Kh;X.prototype.getTextTracks=X.prototype.Hc;
|
|
744
|
-
X.prototype.getVariantTracks=X.prototype.mc;X.prototype.cancelTrickPlay=X.prototype.
|
|
746
|
+
X.prototype.getVariantTracks=X.prototype.mc;X.prototype.cancelTrickPlay=X.prototype.Uc;X.prototype.trickPlay=X.prototype.ud;X.prototype.getPlaybackRate=X.prototype.fb;X.prototype.isBuffering=X.prototype.pf;X.prototype.getKeyStatuses=X.prototype.Id;X.prototype.getActiveSessionsMetadata=X.prototype.ef;X.prototype.getExpiration=X.prototype.ad;X.prototype.drmInfo=X.prototype.drmInfo;X.prototype.keySystem=X.prototype.keySystem;X.prototype.isFullyLoaded=X.prototype.hi;X.prototype.goToLive=X.prototype.di;
|
|
745
747
|
X.prototype.seekRange=X.prototype.Ob;X.prototype.isAudioOnly=X.prototype.gi;X.prototype.isInProgress=X.prototype.pc;X.prototype.isLive=X.prototype.U;X.prototype.getAdManager=X.prototype.rg;X.prototype.getAssetUri=X.prototype.Gc;X.prototype.getNetworkingEngine=X.prototype.yb;X.prototype.getMediaElement=X.prototype.Qh;X.prototype.getManifestType=X.prototype.hf;X.prototype.getLoadMode=X.prototype.ff;X.prototype.resetConfiguration=X.prototype.Ji;X.prototype.getBufferFullness=X.prototype.sg;
|
|
746
748
|
X.prototype.getNonDefaultConfiguration=X.prototype.wg;X.prototype.getConfiguration=X.prototype.getConfiguration;X.prototype.configure=X.prototype.configure;X.prototype.releaseAllMutexes=X.prototype.Fi;X.prototype.destroyAllPreloads=X.prototype.Pe;X.prototype.preload=X.prototype.preload;X.prototype.detachAndSavePreload=X.prototype.ng;X.prototype.unloadAndSavePreload=X.prototype.Xi;X.prototype.load=X.prototype.load;X.prototype.updateStartTime=X.prototype.aj;X.prototype.unload=X.prototype.ec;
|
|
747
749
|
X.prototype.detach=X.prototype.detach;X.prototype.attachCanvas=X.prototype.vh;X.prototype.attach=X.prototype.Rb;
|
|
748
750
|
X.probeSupport=function(a){a=void 0===a?!0:a;var b,c,d,e,f,g,h;return P(function(k){switch(k.g){case 1:b={};if(!a){k.u(2);break}return G(k,Fi(),3);case 3:b=k.h;case 2:var l={};if(ac())for(var m in Ri)l[m]=!0;m=t(["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","application/vnd.ms-sstr+xml"]);for(var n=m.next();!n.done;n=m.next())n=n.value,l[n]=ac()?!!Ri[n]:bc(n);c=l;m='video/mp4; codecs="avc1.42E01E",video/mp4; codecs="avc3.42E01E",video/mp4; codecs="hev1.1.6.L93.90",video/mp4; codecs="hvc1.1.6.L93.90",video/mp4; codecs="hev1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="hvc1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="vp9",video/mp4; codecs="vp09.00.10.08",video/mp4; codecs="av01.0.01M.08",video/mp4; codecs="dvh1.20.01",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",audio/mp4; codecs="ac-4.02.01.01",audio/mp4; codecs="opus",audio/mp4; codecs="flac",audio/mp4; codecs="dtsc",audio/mp4; codecs="dtse",audio/mp4; codecs="dtsx",video/webm; codecs="vp8",video/webm; codecs="vp9",video/webm; codecs="vp09.00.10.08",audio/webm; codecs="vorbis",audio/webm; codecs="opus",video/mp2t; codecs="avc1.42E01E",video/mp2t; codecs="avc3.42E01E",video/mp2t; codecs="hvc1.1.6.L93.90",video/mp2t; codecs="mp4a.40.2",video/mp2t; codecs="ac-3",video/mp2t; codecs="ec-3",text/vtt,application/mp4; codecs="wvtt",application/ttml+xml,application/mp4; codecs="stpp"'.split(",").concat(x(df));
|
|
749
751
|
l={};m=t(m);for(n=m.next();!n.done;n=m.next()){n=n.value;l[n]=rf(n)?!0:ac()?nb(n)||(le(n)?!0:!1):bc(n);var p=n.split(";")[0];l[p]=l[p]||l[n]}d=l;return G(k,Ac(),4);case 4:e=k.h;f={manifest:c,media:d,drm:b,hardwareResolution:e};g=Zp;for(h in g)f[h]=g[h]();return k.return(f)}})};
|
|
750
752
|
X.isBrowserSupported=function(){window.Promise||Za("A Promise implementation or polyfill is required");if(!(window.Promise&&window.Uint8Array&&Array.prototype.forEach)||fc("Trident/"))return!1;var a=tc();return a&&9>a||!(window.MediaKeys&&window.navigator&&window.navigator.requestMediaKeySystemAccess&&window.MediaKeySystemAccess&&window.MediaKeySystemAccess.prototype.getConfiguration)?!1:ac()?!0:bc("application/x-mpegurl")};X.setAdManagerFactory=function(a){Ko=a};
|
|
751
|
-
X.registerSupportPlugin=function(a,b){Zp[a]=b};X.prototype.destroy=X.prototype.destroy;var Qo=0,Go=1,tp=2,Gp=3;X.LoadMode={DESTROYED:Qo,NOT_LOADED:Go,MEDIA_SOURCE:tp,SRC_EQUALS:Gp};X.version="v4.11.
|
|
753
|
+
X.registerSupportPlugin=function(a,b){Zp[a]=b};X.prototype.destroy=X.prototype.destroy;var Qo=0,Go=1,tp=2,Gp=3;X.LoadMode={DESTROYED:Qo,NOT_LOADED:Go,MEDIA_SOURCE:tp,SRC_EQUALS:Gp};X.version="v4.11.2";var $p=["4","11"];sb=new function(a){this.g=a;this.i=tb;this.h=ub}(new qb(Number($p[0]),Number($p[1])));var Zp={},Ko=null;function aq(){this.g=[];this.i=this.l=this.j=this.h=0}function bq(a){return a.g.length?a.g.reduce(function(b,c){return b+c},0)/a.g.length:0};function cq(a,b,c){var d=this;this.g=a;this.h=b;this.j=c;this.i=!1;this.l=this.h.getVolume();this.m=new hb;this.m.D(this.h,google.ima.AdEvent.Type.PAUSED,function(){d.i=!0});this.m.D(this.h,google.ima.AdEvent.Type.RESUMED,function(){d.i=!1})}q=cq.prototype;q.needsSkipUI=function(){return!1};q.getDuration=function(){return this.g.getDuration()};q.getMinSuggestedDuration=function(){return this.g.getMinSuggestedDuration()};q.getRemainingTime=function(){return this.h.getRemainingTime()};q.isPaused=function(){return this.i};
|
|
752
754
|
q.isSkippable=function(){return 0<=this.g.getSkipTimeOffset()};q.getTimeUntilSkippable=function(){var a=this.g.getSkipTimeOffset();a=this.getRemainingTime()-a;return Math.max(a,0)};q.canSkipNow=function(){return this.h.getAdSkippableState()};q.skip=function(){return this.h.skip()};q.pause=function(){return this.h.pause()};q.play=function(){return this.h.resume()};q.getVolume=function(){return this.h.getVolume()};q.setVolume=function(a){this.j.volume=a;return this.h.setVolume(a)};
|
|
753
755
|
q.isMuted=function(){return 0==this.h.getVolume()};q.isLinear=function(){return this.g.isLinear()};q.resize=function(a,b){var c=!1,d=this.j;document.fullscreenEnabled?c=!!document.fullscreenElement:d.webkitSupportsFullscreen&&(c=d.webkitDisplayingFullscreen);this.h.resize(a,b,c?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)};q.setMuted=function(a){(this.j.muted=a)?(this.l=this.getVolume(),this.h.setVolume(0)):this.h.setVolume(this.l)};
|
|
754
756
|
q.getSequenceLength=function(){var a=this.g.getAdPodInfo();return null==a?1:a.getTotalAds()};q.getPositionInSequence=function(){var a=this.g.getAdPodInfo();return null==a?1:a.getAdPosition()};q.getTitle=function(){return this.g.getTitle()};q.getDescription=function(){return this.g.getDescription()};q.getVastMediaBitrate=function(){return this.g.getVastMediaBitrate()};q.getVastMediaHeight=function(){return this.g.getVastMediaHeight()};q.getVastMediaWidth=function(){return this.g.getVastMediaWidth()};
|
|
@@ -761,7 +763,7 @@ function eq(a,b){var c=[],d=0;null!=b&&(d=b);a=t(dd(a,"Ad"));for(var e=a.next();
|
|
|
761
763
|
0)-(parseInt(k.attributes.height,10)||0)});g=t(g);for(h=g.next();!h.done;h=g.next())if(h=ed(h.value)){c.push({id:null,startTime:d,endTime:null,uri:h,isSkippable:null!=f,skipOffset:f,canJump:!1,resumeOffset:0,playoutLimit:null,once:!0,pre:null==b,post:Infinity==b,timelineRange:!1});break}}}}return c}S("shaka.ads.Utils",dq);dq.ADS_LOADED="ads-loaded";dq.AD_STARTED="ad-started";dq.AD_FIRST_QUARTILE="ad-first-quartile";dq.AD_MIDPOINT="ad-midpoint";dq.AD_THIRD_QUARTILE="ad-third-quartile";
|
|
762
764
|
dq.AD_COMPLETE="ad-complete";dq.AD_STOPPED="ad-stopped";dq.AD_SKIPPED="ad-skipped";dq.AD_VOLUME_CHANGED="ad-volume-changed";dq.AD_MUTED="ad-muted";dq.AD_PAUSED="ad-paused";dq.AD_RESUMED="ad-resumed";dq.AD_SKIP_STATE_CHANGED="ad-skip-state-changed";dq.CUEPOINTS_CHANGED="ad-cue-points-changed";dq.IMA_AD_MANAGER_LOADED="ima-ad-manager-loaded";dq.IMA_STREAM_MANAGER_LOADED="ima-stream-manager-loaded";dq.AD_CLICKED="ad-clicked";dq.AD_PROGRESS="ad-progress";dq.AD_BUFFERING="ad-buffering";
|
|
763
765
|
dq.AD_IMPRESSION="ad-impression";dq.AD_DURATION_CHANGED="ad-duration-changed";dq.AD_CLOSED="ad-closed";dq.AD_LOADED="ad-loaded";dq.ALL_ADS_COMPLETED="all-ads-completed";dq.AD_LINEAR_CHANGED="ad-linear-changed";dq.AD_METADATA="ad-metadata";dq.AD_RECOVERABLE_ERROR="ad-recoverable-error";dq.AD_ERROR="ad-error";dq.AD_BREAK_READY="ad-break-ready";dq.AD_INTERACTION="ad-interaction";dq.AD_CONTENT_PAUSE_REQUESTED="ad-content-pause-requested";dq.AD_CONTENT_RESUME_REQUESTED="ad-content-resume-requested";
|
|
764
|
-
dq.AD_CONTENT_ATTACH_REQUESTED="ad-content-attach-requested";function fq(a,b,c,d,e){var f=this;this.s=a;this.i=b;this.F=!1;this.A=this.o=null;this.G=NaN;this.l=e;this.j=null;this.h=new hb;google.ima.settings.setLocale(c);google.ima.settings.setDisableCustomPlaybackForIOS10Plus(!0);this.C=new google.ima.AdDisplayContainer(this.s,this.i);this.C.initialize();this.m=new google.ima.AdsLoader(this.C);this.m.getSettings().setPlayerType("shaka-player");this.m.getSettings().setPlayerVersion("v4.11.
|
|
766
|
+
dq.AD_CONTENT_ATTACH_REQUESTED="ad-content-attach-requested";function fq(a,b,c,d,e){var f=this;this.s=a;this.i=b;this.F=!1;this.A=this.o=null;this.G=NaN;this.l=e;this.j=null;this.h=new hb;google.ima.settings.setLocale(c);google.ima.settings.setDisableCustomPlaybackForIOS10Plus(!0);this.C=new google.ima.AdDisplayContainer(this.s,this.i);this.C.initialize();this.m=new google.ima.AdsLoader(this.C);this.m.getSettings().setPlayerType("shaka-player");this.m.getSettings().setPlayerVersion("v4.11.2");this.g=null;this.B=d||new google.ima.AdsRenderingSettings;this.h.D(this.m,
|
|
765
767
|
google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,function(g){gq(f,g)});this.h.D(this.m,google.ima.AdErrorEvent.Type.AD_ERROR,function(g){hq(f,g)});this.h.D(this.i,"ended",function(){f.m.contentComplete()});this.h.oa(this.i,"play",function(){f.F=!0})}fq.prototype.configure=function(a){this.o=a};fq.prototype.stop=function(){this.g&&this.g.stop();this.s&&On(this.s)};
|
|
766
768
|
fq.prototype.release=function(){this.stop();this.A&&this.A.disconnect();this.h&&this.h.release();this.g&&this.g.destroy();this.m.destroy();this.C.destroy()};function hq(a,b){b.getError();b=(new Map).set("originalEvent",b);a.l(new V("ad-error",b));iq(a,null);a.l(new V("ad-cue-points-changed",(new Map).set("cuepoints",[])))}
|
|
767
769
|
function gq(a,b){a.l(new V("ads-loaded",(new Map).set("loadTime",Date.now()/1E3-a.G)));if(a.o.customPlayheadTracker){var c={currentTime:a.i.currentTime};a.g=b.getAdsManager(c,a.B);a.i.muted?a.g.setVolume(0):a.g.setVolume(a.i.volume);a.h.D(a.i,"timeupdate",function(){a.i.duration&&(c.currentTime=a.i.currentTime)});a.h.D(a.i,"volumechange",function(){a.j&&(a.j.setVolume(a.i.volume),a.i.muted&&a.j.setMuted(!0))})}else a.g=b.getAdsManager(a.i,a.B);a.l(new V("ima-ad-manager-loaded",(new Map).set("imaAdManager",
|
|
@@ -842,8 +844,8 @@ q.initClientSide=function(a,b,c){var d=this;if(!window.google||!google.ima||!goo
|
|
|
842
844
|
q.onAssetUnload=function(){this.h&&this.h.stop();this.j&&this.j.stop();this.i&&this.i.stop();this.g&&this.g.stop();this.dispatchEvent(new V("ad-stopped"));this.dispatchEvent(new V("ad-content-attach-requested"));this.m=new aq};q.requestClientSideAds=function(a){if(!this.j)throw new T(1,10,10001);var b=this.j;b.g&&b.g.destroy();b.m&&b.m.contentComplete();b.G=Date.now()/1E3;b.m.requestAds(a)};
|
|
843
845
|
q.updateClientSideAdsRenderingSettings=function(a){if(!this.j)throw new T(1,10,10001);var b=this.j;b.B=a;b.g&&b.g.updateAdsRenderingSettings(b.B)};q.initMediaTailor=function(a,b,c){var d=this;this.i&&this.i.release();this.i=new xq(a,b,c,function(e){return Lq(d,e)})};q.requestMediaTailorStream=function(a,b,c){if(!this.i)throw new T(1,10,10005);var d=this.i;c=void 0===c?"":c;d.l?a=Promise.reject(new T(1,10,10004)):(d.l=new ah,Aq(d,a,b),d.H=c||"",d.T=Date.now()/1E3,a=d.l);return a};
|
|
844
846
|
q.addMediaTailorTrackingUrl=function(a){if(!this.i)throw new T(1,10,10005);var b=this.i;b.G=a;b.i(new V("ads-loaded",(new Map).set("loadTime",0)))};q.initServerSide=function(a,b){var c=this;if(!window.google||!google.ima||!google.ima.dai)throw new T(2,10,10002);this.g&&this.g.release();this.g=new Jq(a,b,this.o,function(d){return Lq(c,d)});this.g.configure(this.l)};
|
|
845
|
-
q.requestServerSideStream=function(a,b){b=void 0===b?"":b;if(!this.g)throw new T(1,10,10003);a.adTagParameters||(a.adTagParameters={});var c=a.adTagParameters;(c.mpt||c.mpv)&&Za('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="v4.11.
|
|
846
|
-
(c.G=!0),c.j=new ah,c.g.requestStream(a),c.B=b||"",c.F=Date.now()/1E3,a=c.j);return a};q.replaceServerSideAdTagParameters=function(a){if(!this.g)throw new T(1,10,10003);(a.mpt||a.mpv)&&Za('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="v4.11.
|
|
847
|
+
q.requestServerSideStream=function(a,b){b=void 0===b?"":b;if(!this.g)throw new T(1,10,10003);a.adTagParameters||(a.adTagParameters={});var c=a.adTagParameters;(c.mpt||c.mpv)&&Za('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="v4.11.2";c=this.g;c.j?a=Promise.reject(new T(1,10,10004)):(a instanceof google.ima.dai.api.LiveStreamRequest&&
|
|
848
|
+
(c.G=!0),c.j=new ah,c.g.requestStream(a),c.B=b||"",c.F=Date.now()/1E3,a=c.j);return a};q.replaceServerSideAdTagParameters=function(a){if(!this.g)throw new T(1,10,10003);(a.mpt||a.mpv)&&Za('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="v4.11.2";this.g.g.replaceAdTagParameters(a)};
|
|
847
849
|
q.getServerSideCuePoints=function(){rb("AdManager.getServerSideCuePoints","Please use getCuePoints function.");return this.getCuePoints()};q.getCuePoints=function(){var a=[];this.g&&(a=a.concat(this.g.getCuePoints()));this.i&&(a=a.concat(this.i.getCuePoints()));return a};q.getStats=function(){var a=this.m;return{loadTimes:a.g,averageLoadTime:bq(a),started:a.h,playedCompletely:a.j,skipped:a.l,errors:a.i}};q.onManifestUpdated=function(a){if(this.i)this.i.onManifestUpdated(a)};
|
|
848
850
|
q.onDashTimedMetadata=function(a){this.g&&"urn:google:dai:2018"==a.schemeIdUri&&this.g.g.processMetadata(a.schemeIdUri,a.eventNode?a.eventNode.attributes.messageData:null,a.startTime)};q.onHlsTimedMetadata=function(a,b){this.g&&this.g.g.processMetadata("ID3",a.data,b)};q.onCueMetadataChange=function(a){if(this.g)this.g.onCueMetadataChange(a)};q.onHLSInterstitialMetadata=function(a,b,c){this.h||this.initInterstitial(null,a,b);this.h&&sq(this.h,c)};
|
|
849
851
|
q.onDASHInterstitialMetadata=function(a,b,c){if("urn:mpeg:dash:event:alternativeMPD:2022"==c.schemeIdUri&&(this.h||this.initInterstitial(null,a,b),this.h)){a=this.h;b=t(c.eventNode.children);for(var d=b.next();!d.done;d=b.next()){var e=d.value;if("AlternativeMPD"==e.tagName&&(d=e.attributes.uri,e=e.attributes.mode,d)){var f=d;var g=e;break}}f?(b="replace"==g,g="insert"==g,(b||g)&&uq(a,[{id:null,startTime:c.startTime,endTime:b?c.endTime:null,uri:f,isSkippable:!1,skipOffset:null,canJump:!0,resumeOffset:g?
|
|
@@ -927,18 +929,18 @@ function Is(a){for(var b=0;a;)b^=a&1,a>>=1;return 1===b}Es.prototype.getStreams=
|
|
|
927
929
|
Ks.prototype.init=function(a){function b(f){f=f.name;f in Ms&&(c.g=Ms[f])}var c=this,d=[],e=[];(new Lh).box("moov",Qh).box("mvex",Qh).R("trex",function(f){var g=f.reader;g.skip(4);g.skip(4);f=g.P();g=g.P();c.h=f;c.i=g}).box("trak",Qh).R("tkhd",function(f){var g=f.reader;f=f.version;1==f?(g.skip(8),g.skip(8)):(g.skip(4),g.skip(4));var h=g.P();1==f?g.skip(8):g.skip(4);g.skip(4);g.skip(8);g.skip(2);g.skip(2);g.skip(2);g.skip(2);g.skip(36);g.ka();g.ka();g.ka();g.ka();d.push(h)}).box("mdia",Qh).R("mdhd",
|
|
928
930
|
function(f){f=tj(f.reader,f.version);e.push(f.timescale)}).box("minf",Qh).box("stbl",Qh).R("stsd",Sh).box("avc1",b).box("avc3",b).box("dvav",b).box("dva1",b).box("hev1",b).box("hvc1",b).box("dvh1",b).box("dvhe",b).box("vvc1",b).box("vvi1",b).box("dvc1",b).box("dvi1",b).box("encv",Th).box("sinf",Qh).box("frma",function(f){f=wj(f.reader).codec;f in Ms&&(c.g=Ms[f])}).parse(a,!0);if(!d.length||!e.length||d.length!=e.length)throw new T(2,2,2010);this.g==Ls&&Za("Unable to determine bitstream format for CEA parsing!");
|
|
929
931
|
d.forEach(function(f,g){c.j.set(f,e[g])})};
|
|
930
|
-
Ks.prototype.parse=function(a){var b=this;if(this.g==Ls)return[];var c=[],d=0,e=[];(new Lh).box("moof",function(f){d=f.start;e=[];Qh(f)}).box("traf",function(f){e.push({baseMediaDecodeTime:null,
|
|
931
|
-
1];f=sj(f.reader,f.version);g.baseMediaDecodeTime=f.baseMediaDecodeTime}).box("mdat",function(f){for(var g=d-f.start-8,h=f.reader.wa(),k=t(e),l=k.next();!l.done;l=k.next()){l=l.value;if(null===l.baseMediaDecodeTime)throw Za("Unable to find base media decode time for CEA captions!"),new T(2,2,2010);f.reader.seek(h);Ns(b,f.reader,l.baseMediaDecodeTime,l.timescale,l.
|
|
932
|
+
Ks.prototype.parse=function(a){var b=this;if(this.g==Ls)return[];var c=[],d=0,e=[];(new Lh).box("moof",function(f){d=f.start;e=[];Qh(f)}).box("traf",function(f){e.push({baseMediaDecodeTime:null,Zc:b.h,Fd:b.i,Kg:[],timescale:9E4});Qh(f)}).R("trun",function(f){var g=e[e.length-1];f=uj(f.reader,f.version,f.flags);g.Kg.push(f)}).R("tfhd",function(f){var g=e[e.length-1];f=rj(f.reader,f.flags);g.Zc=f.Zc||b.h;g.Fd=f.Fd||b.i;f=f.trackId;b.j.has(f)&&(g.timescale=b.j.get(f))}).R("tfdt",function(f){var g=e[e.length-
|
|
933
|
+
1];f=sj(f.reader,f.version);g.baseMediaDecodeTime=f.baseMediaDecodeTime}).box("mdat",function(f){for(var g=d-f.start-8,h=f.reader.wa(),k=t(e),l=k.next();!l.done;l=k.next()){l=l.value;if(null===l.baseMediaDecodeTime)throw Za("Unable to find base media decode time for CEA captions!"),new T(2,2,2010);f.reader.seek(h);Ns(b,f.reader,l.baseMediaDecodeTime,l.timescale,l.Zc,l.Fd,g,l.Kg,c)}}).parse(a,!1);return c};
|
|
932
934
|
function Ns(a,b,c,d,e,f,g,h,k){var l=0,m=f,n=h.map(function(u){return u.Rg});n=[].concat.apply([],x(n));n.length&&(m=n[0].sampleSize||f);for(b.skip(g+h[0].Bh);b.ra();){g=b.P();var p=b.S(),r=null;r=!1;h=1;switch(a.g){case Os:r=p&31;r=6==r;break;case Ps:h=2;b.skip(1);r=p>>1&63;r=39==r||40==r;break;case Qs:h=2;b.skip(1);r=p>>1&63;r=23==r||24==r;break;default:return}if(r)for(p=0,l<n.length&&(p=n[l].ke||0),p=(c+p)/d,h=t(Js(b.rb(g-h))),r=h.next();!r.done;r=h.next())k.push({packet:r.value,pts:p});else try{b.skip(g-
|
|
933
|
-
h)}catch(u){break}m-=g+4;0==m&&(c=l<n.length?c+(n[l].Kf||e):c+e,l++,l<n.length?m=n[l].sampleSize||f:m=f)}}S("shaka.cea.Mp4CeaParser",Ks);var Ls=0,Os=1,Ps=2,Qs=3,Ms={avc1:Os,avc3:Os,dvav:Os,dva1:Os,hev1:Ps,hvc1:Ps,dvh1:Ps,dvhe:Ps,vvc1:Qs,vvi1:Qs,dvc1:Qs,dvi1:Qs};Ib["video/mp4"]=function(){return new Ks};function Rs(){this.g=null}Rs.prototype.init=function(){};Rs.prototype.parse=function(a){this.g?this.g.clearData():this.g=new Sj;var b=[];a=Ab(a);if(!ak(a))return b;a=this.g.parse(a);var c=a
|
|
934
|
-
S("shaka.cea.TsCeaParser",Rs);Ib["video/mp2t"]=function(){return new Rs};function Ss(a,b,c){var d=Ts(a),e=null;a=[];var f=[],g=null,h=new Set(d.map(function(l){return l.keyId}));h.delete(null);var k="cenc";if(1<h.size)throw new T(2,4,4010);if(!b){f=d.filter(function(l){return"urn:mpeg:dash:sea:2012"==l.
|
|
935
|
-
l.
|
|
935
|
+
h)}catch(u){break}m-=g+4;0==m&&(c=l<n.length?c+(n[l].Kf||e):c+e,l++,l<n.length?m=n[l].sampleSize||f:m=f)}}S("shaka.cea.Mp4CeaParser",Ks);var Ls=0,Os=1,Ps=2,Qs=3,Ms={avc1:Os,avc3:Os,dvav:Os,dva1:Os,hev1:Ps,hvc1:Ps,dvh1:Ps,dvhe:Ps,vvc1:Qs,vvi1:Qs,dvc1:Qs,dvi1:Qs};Ib["video/mp4"]=function(){return new Ks};function Rs(){this.g=null}Rs.prototype.init=function(){};Rs.prototype.parse=function(a){this.g?this.g.clearData():this.g=new Sj;var b=[];a=Ab(a);if(!ak(a))return b;a=this.g.parse(a);var c=a.$c(),d=a.Md();a=[];switch(c.video){case "avc":a.push(6);break;case "hvc":a.push(39),a.push(40)}if(!a.length)return b;c=t(d);for(d=c.next();!d.done;d=c.next())if(d=d.value,a.includes(d.type)&&null!=d.time)for(var e=t(Js(d.data)),f=e.next();!f.done;f=e.next())b.push({packet:f.value,pts:d.time});return b};
|
|
936
|
+
S("shaka.cea.TsCeaParser",Rs);Ib["video/mp2t"]=function(){return new Rs};function Ss(a,b,c){var d=Ts(a),e=null;a=[];var f=[],g=null,h=new Set(d.map(function(l){return l.keyId}));h.delete(null);var k="cenc";if(1<h.size)throw new T(2,4,4010);if(!b){f=d.filter(function(l){return"urn:mpeg:dash:sea:2012"==l.Qc});if(1<f.length)throw new T(2,4,4050);f.length&&(g=Us(f[0]));(f=d.find(function(l){return"urn:mpeg:dash:mp4protection:2011"==l.Qc}))&&f.encryptionScheme&&(k=f.encryptionScheme);f=d.filter(function(l){return"urn:mpeg:dash:mp4protection:2011"==l.Qc?(e=l.init||e,!1):"urn:mpeg:dash:sea:2012"!=
|
|
937
|
+
l.Qc});f.length&&(a=Vs(e,k,f,c,h),0==a.length&&(a=[Te("",k,e)]))}if(d.length&&!g&&(b||!f.length))for(a=[],b=t(Object.values(c)),c=b.next();!c.done;c=b.next())c=c.value,"org.w3.clearkey"!=c&&a.push(Te(c,k,e));if(h=Array.from(h)[0]||null)for(k=t(a),b=k.next();!b.done;b=k.next())for(b=t(b.value.initData),c=b.next();!c.done;c=b.next())c.value.keyId=h;return{mg:h,ck:e,drmInfos:a,Fe:g,qg:!0}}
|
|
936
938
|
function Ws(a,b,c,d){var e=Ss(a,c,d);if(b.qg){a=1==b.drmInfos.length&&!b.drmInfos[0].keySystem;c=0==e.drmInfos.length;if(0==b.drmInfos.length||a&&!c)b.drmInfos=e.drmInfos;b.qg=!1}else if(0<e.drmInfos.length&&(b.drmInfos=b.drmInfos.filter(function(f){return e.drmInfos.some(function(g){return g.keySystem==f.keySystem})}),0==b.drmInfos.length))throw new T(2,4,4008);return e.mg||b.mg}
|
|
937
939
|
function Xs(a){var b=0,c=Fb(a),d=c.getUint32(b,!0);if(d!=a.byteLength)return[];a:{a=b+6;for(b=[];a<c.byteLength-1;){d=c.getUint16(a,!0);a+=2;var e=c.getUint16(a,!0);a+=2;if(0!=(e&1)||e+a>c.byteLength){c=[];break a}var f=Ab(c,a,e);b.push({type:d,value:f});a+=e}c=b}return c}function Ys(a){a=t(gd(a,"DATA"));for(var b=a.next();!b.done;b=a.next())if(b=b.value,b.children){b=t(b.children);for(var c=b.next();!c.done;c=b.next())if(c=c.value,"LA_URL"==c.tagName)return ed(c)}return""}
|
|
938
940
|
function Zs(a){var b=id(a.node,"https://dashif.org/CPS","Laurl");if(b&&(b=ed(b)))return b;a=id(a.node,"urn:microsoft:playready","pro");if(!a||!ed(a))return"";a=ed(a);a=Oe(a);a=Xs(a).filter(function(c){return c.type===$s})[0];if(!a)return"";a=Fc(a.value,!0);return(a=Wc(a,"WRMHEADER"))?Ys(a):""}
|
|
939
|
-
function Vs(a,b,c,d,e){var f=[];c=t(c);for(var g=c.next();!g.done;g=c.next()){g=g.value;var h=d[g.
|
|
941
|
+
function Vs(a,b,c,d,e){var f=[];c=t(c);for(var g=c.next();!g.done;g=c.next()){g=g.value;var h=d[g.Qc];if(h){var k;if((k=id(g.node,"urn:microsoft:playready","pro"))&&ed(k)){k=ed(k);k=Oe(k);var l=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);k=[{initData:Xh(k,l,new Set,0),initDataType:"cenc",keyId:g.keyId}]}else k=null;l=null;if("urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e"===g.Qc){l=g;var m=e;if(0==m.size)l=null;else{var n=new Uint8Array([16,119,239,236,192,178,77,2,
|
|
940
942
|
172,227,60,30,82,226,251,75]),p=new Uint8Array([]);l=[{initData:Xh(p,n,m,1),initDataType:"cenc",keyId:l.keyId}]}}k=Te(h,b,g.init||a||k||l);if(h=at.get(h))k.licenseServerUri=h(g);f.push(k)}}return f}function Ts(a){var b=[];a=t(a);for(var c=a.next();!c.done;c=a.next())(c=bt(c.value))&&b.push(c);return b}
|
|
941
|
-
function bt(a){var b=a.attributes.schemeIdUri,c=ld(a,"urn:mpeg:cenc:2013","default_KID"),d=jd(a,"urn:mpeg:cenc:2013","pssh").map(fd),e=a.attributes.value;if(!b)return null;b=b.toLowerCase();if(c&&(c=c.replace(/-/g,"").toLowerCase(),c.includes(" ")))throw new T(2,4,4009);var f=[];try{f=d.map(function(g){return{initDataType:"cenc",initData:Oe(g),keyId:null}})}catch(g){throw new T(2,4,4007);}return{node:a,
|
|
943
|
+
function bt(a){var b=a.attributes.schemeIdUri,c=ld(a,"urn:mpeg:cenc:2013","default_KID"),d=jd(a,"urn:mpeg:cenc:2013","pssh").map(fd),e=a.attributes.value;if(!b)return null;b=b.toLowerCase();if(c&&(c=c.replace(/-/g,"").toLowerCase(),c.includes(" ")))throw new T(2,4,4009);var f=[];try{f=d.map(function(g){return{initDataType:"cenc",initData:Oe(g),keyId:null}})}catch(g){throw new T(2,4,4007);}return{node:a,Qc:b,keyId:c,init:0<f.length?f:null,encryptionScheme:e}}
|
|
942
944
|
function Us(a){if(!window.crypto||!window.crypto.subtle)throw Za("Web Crypto API is not available to decrypt AES-128. (Web Crypto only exists in secure origins like https)"),new T(2,4,4042);var b=id(a.node,"urn:mpeg:dash:schema:sea:2012","SegmentEncryption");if(!b)throw new T(2,4,4051);if("urn:mpeg:dash:sea:aes128-cbc:2013"!=b.attributes.schemeIdUri)throw new T(2,4,4051);b=id(a.node,"urn:mpeg:dash:schema:sea:2012","CryptoPeriod");if(!b)throw new T(2,4,4051);a=b.attributes.IV;b=Lc(b.attributes.keyUriTemplate);
|
|
943
945
|
if(!a||!b)throw new T(2,4,4051);a=Pe(a.substr(2));if(16!=a.byteLength)throw new T(2,4,4048);return{ni:b,iv:a}}
|
|
944
946
|
var $s=1,at=(new Map).set("com.widevine.alpha",function(a){var b=id(a.node,"https://dashif.org/CPS","Laurl");return b&&(b=ed(b))?b:(a=id(a.node,"urn:microsoft","laurl"))?Lc(a.attributes.licenseUrl)||"":""}).set("com.microsoft.playready",Zs).set("com.microsoft.playready.recommendation",Zs).set("com.microsoft.playready.software",Zs).set("com.microsoft.playready.hardware",Zs).set("org.w3.clearkey",function(a){var b=id(a.node,"https://dashif.org/CPS","Laurl");return b&&(b=ed(b))?b:(a=id(a.node,"http://dashif.org/guidelines/clearKey",
|
|
@@ -949,39 +951,39 @@ p)break;else if(r>=p)break;v=Math.ceil((p-r)/u)-1}else{if(Infinity==a)break;else
|
|
|
949
951
|
function ft(a,b,c){b=gt(a,b);a=null;b=t(b);for(var d=b.next();!d.done&&!(a=hd(d.value,c));d=b.next());return a}
|
|
950
952
|
function ht(a,b,c,d,e,f){for(var g=ld(a,"http://www.w3.org/1999/xlink","href"),h=ld(a,"http://www.w3.org/1999/xlink","actuate")||"onRequest",k=t(Object.keys(a.attributes)),l=k.next();!l.done;l=k.next()){l=l.value;var m=l.split(":"),n=Zc("http://www.w3.org/1999/xlink");m[0]==n&&delete a.attributes[l]}if(5<=f)return eh(new T(2,4,4028));if("onLoad"!=h)return eh(new T(2,4,4027));var p=Se([d],[g]);return e.request(0,uh(p,b)).Aa(function(r){r=Vc(r.data,a.tagName);if(!r)return eh(new T(2,4,4001,g));for(a.children=
|
|
951
953
|
[];r.children.length;){var u=r.children.shift();u.tagName&&(u.parent=a);a.children.push(u)}u=t(Object.keys(r.attributes));for(var v=u.next();!v.done;v=u.next())v=v.value,a.attributes[v]=r.attributes[v];return it(a,b,c,p[0],e,f+1)})}
|
|
952
|
-
function it(a,b,c,d,e,f){f=void 0===f?0:f;if(ld(a,"http://www.w3.org/1999/xlink","href")){var g=ht(a,b,c,d,e,f);c&&(g=g.Aa(void 0,function(){return it(a,b,c,d,e,f)}));return g}g=[];for(var h=t(cd(a)),k=h.next(),l={};!k.done;l={
|
|
954
|
+
function it(a,b,c,d,e,f){f=void 0===f?0:f;if(ld(a,"http://www.w3.org/1999/xlink","href")){var g=ht(a,b,c,d,e,f);c&&(g=g.Aa(void 0,function(){return it(a,b,c,d,e,f)}));return g}g=[];for(var h=t(cd(a)),k=h.next(),l={};!k.done;l={Vc:void 0},k=h.next())l.Vc=k.value,"urn:mpeg:dash:resolve-to-zero:2013"==ld(l.Vc,"http://www.w3.org/1999/xlink","href")?a.children=a.children.filter(function(m){return function(n){return n!==m.Vc}}(l)):"SegmentTimeline"!=l.Vc.tagName&&g.push(it(l.Vc,b,c,d,e,f));return ih(g).Aa(function(){return a})}
|
|
953
955
|
;function jt(a,b,c,d,e,f,g){var h,k=(new Lh).R("sidx",function(l){h=kt(b,d,e,f,g,c,l)});a&&k.parse(a);if(h)return h;throw new T(2,3,3004);}
|
|
954
|
-
function kt(a,b,c,d,e,f,g){var h=[];g.reader.skip(4);var k=g.reader.P();if(0==k)throw new T(2,3,3005);if(0==g.version){var l=g.reader.P();var m=g.reader.P()}else l=g.reader.
|
|
956
|
+
function kt(a,b,c,d,e,f,g){var h=[];g.reader.skip(4);var k=g.reader.P();if(0==k)throw new T(2,3,3005);if(0==g.version){var l=g.reader.P();var m=g.reader.P()}else l=g.reader.Pc(),m=g.reader.Pc();g.reader.skip(2);var n=g.reader.ka();a=a+g.size+m;for(m=0;m<n;m++){var p=g.reader.P(),r=(p&2147483648)>>>31;p&=2147483647;var u=g.reader.P();g.reader.skip(4);if(1==r)throw new T(2,3,3006);h.push(new Yi(l/k+c,(l+u)/k+c,function(){return f},a,a+p-1,b,c,d,e));l+=u;a+=p}g.parser.stop();return h};function lt(a){this.h=Fb(a);this.g=new Ih(this.h,0)}lt.prototype.ra=function(){return this.g.ra()};
|
|
955
957
|
function mt(a){var b=nt(a);if(7<b.length)throw new T(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=nt(a);a:{d=t(ot);for(var e=d.next();!e.done;e=d.next())if(yb(b,new Uint8Array(e.value))){d=!0;break a}d=!1}if(d)b=a.h.byteLength-a.g.wa();else{if(8==b.length&&b[1]&224)throw new T(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.wa()+b<=a.h.byteLength?b:a.h.byteLength-a.g.wa();d=Fb(a.h,a.g.wa(),b);a.g.skip(b);return new pt(c,
|
|
956
958
|
d)}function nt(a){var b=a.g.wa(),c=a.g.S();if(0==c)throw new T(2,3,3002);c=8-Math.floor(Math.log2(c));a.g.skip(c-1);return Ab(a.h,b,c)}var ot=[[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 pt(a,b){this.id=a;this.g=b}
|
|
957
|
-
function qt(a){if(8<a.g.byteLength)throw new T(2,3,3002);if(8==a.g.byteLength&&a.g.getUint8(0)&224)throw new T(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 rt(a,b,c,d,e,f,g,h,k){function l(){return e}var m=[];a=new lt(a.g);for(var n=null,p=null;a.ra();){var r=mt(a);if(187==r.id){var u=st(r);u&&(r=c*u.$i,u=b+u.Ei,null!=n&&m.push(new
|
|
959
|
+
function qt(a){if(8<a.g.byteLength)throw new T(2,3,3002);if(8==a.g.byteLength&&a.g.getUint8(0)&224)throw new T(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 rt(a,b,c,d,e,f,g,h,k){function l(){return e}var m=[];a=new lt(a.g);for(var n=null,p=null;a.ra();){var r=mt(a);if(187==r.id){var u=st(r);u&&(r=c*u.$i,u=b+u.Ei,null!=n&&m.push(new Yi(n+g,r+g,l,p,u-1,f,g,h,k)),n=r,p=u)}}null!=n&&m.push(new Yi(n+g,d+g,l,p,null,f,g,h,k));return m}
|
|
958
960
|
function st(a){var b=new lt(a.g);a=mt(b);if(179!=a.id)throw new T(2,3,3013);a=qt(a);b=mt(b);if(183!=b.id)throw new T(2,3,3012);b=new lt(b.g);for(var c=0;b.ra();){var d=mt(b);if(241==d.id){c=qt(d);break}}return{$i:a,Ei:c}};function tt(a,b,c){b=ft(a,b,"Initialization");if(!b)return null;var d=a.I.Ia(),e=b.attributes.sourceURL;e&&(d=Se(d,[Lc(e)],a.lb()));e=0;var f=null;if(b=kd(b,"range",pd))e=b.start,f=b.end;c=new Wi(function(){return d},e,f,ut(a),null,null,c);c.codecs=a.I.codecs;c.mimeType=a.I.mimeType;return c}
|
|
959
961
|
function vt(a,b,c){var d=Number(et(a,wt,"presentationTimeOffset"))||0,e=et(a,wt,"timescale"),f=1;e&&(f=rd(e)||1);var g=d/f||0,h=tt(a,wt,c);xt(a,h);var k=Uc(a);return{kc:function(){var l=ft(k,wt,"RepresentationIndex");var m=k.I.Ia();l&&(l=Lc(l.attributes.sourceURL))&&(m=Se(m,[l],k.lb()));l=yt(k);return zt(k,b,h,m,l.start,l.end,g)}}}
|
|
960
962
|
function zt(a,b,c,d,e,f,g){var h,k,l,m,n,p,r,u,v,w,y,z,D,A,B,C,E,F;return P(function(J){if(1==J.g)return h=a.presentationTimeline,k=!a.wb||!a.ia.qf,l=a.ia.start,m=a.ia.duration,n=a.I.mimeType.split("/")[1],p=b,r=null,u=[p(d,e,f,!1),"webm"==n?p(c.M(),c.Ga,c.ua,!0):null],p=null,G(J,Promise.all(u),2);v=J.h;w=v[0];y=v[1]||null;z=null;D=l-g;A=l;B=m?l+m:Infinity;if("mp4"==n)var K=jt(w,e,d,c,D,A,B);else{K=w;var L=new lt(y);if(440786851!=mt(L).id)throw new T(2,3,3008);var I=mt(L);if(408125543!=I.id)throw new T(2,
|
|
961
963
|
3,3009);L=I.g.byteOffset;I=new lt(I.g);for(var N=null;I.ra();){var M=mt(I);if(357149030==M.id){N=M;break}}if(!N)throw new T(2,3,3010);N=new lt(N.g);M=1E6;for(I=null;N.ra();){var O=mt(N);if(2807729==O.id)M=qt(O);else if(17545==O.id)if(4==O.g.byteLength)I=O.g.getFloat32(0);else if(8==O.g.byteLength)I=O.g.getFloat64(0);else throw new T(2,3,3003);}if(null==I)throw new T(2,3,3011);N=M/1E9;I*=N;K=mt(new lt(K));if(475249515!=K.id)throw new T(2,3,3007);K=rt(K,L,N,I,d,c,D,A,B)}z=K;C=t(z);for(E=C.next();!E.done;E=
|
|
962
|
-
C.next())F=E.value,F.codecs=a.I.codecs,F.mimeType=a.I.mimeType,F.bandwidth=a.bandwidth;h.qd(z);r=new hl(z);k&&r.Ec(A,B,!0);return J.return(r)})}function wt(a){return a.
|
|
964
|
+
C.next())F=E.value,F.codecs=a.I.codecs,F.mimeType=a.I.mimeType,F.bandwidth=a.bandwidth;h.qd(z);r=new hl(z);k&&r.Ec(A,B,!0);return J.return(r)})}function wt(a){return a.Sc}function yt(a){var b=ft(a,wt,"RepresentationIndex");a=et(a,wt,"indexRange");a=pd(a||"");b&&(a=kd(b,"range",pd,a));return a}function xt(a,b){At(a,b);if(!yt(a))throw new T(2,4,4002);}
|
|
963
965
|
function At(a,b){var c=a.I.mimeType.split("/")[1];if(a.I.contentType!=Ye&&"mp4"!=c&&"webm"!=c)throw new T(2,4,4006);if("webm"==c&&!b)throw new T(2,4,4005);}
|
|
964
|
-
function ut(a){var b=a.I;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.$d,pixelAspectRatio:b.pixelAspectRatio||null,width:b.width||null,label:a.ha.label||null,roles:a.roles||null,language:a.ha.language||null}};function Bt(a,b,c){var d=tt(a,Ct,c),e=Dt(a);if(!e.La&&!e.timeline&&1<e.
|
|
965
|
-
f.Ec(a.ia.start,a.ia.duration?a.ia.start+a.ia.duration:Infinity,b);g&&(g.segmentIndex=f);return{kc:function(){f&&0!=f.getNumReferences()||f.Wd(h);return Promise.resolve(f)}}}function Ct(a){return a.Pb}function Dt(a){var b=Ft(a);a=dt(a,Ct);var c=a.td;0==c&&(c=1);var d=0;a.La?d=a.La*(c-1):a.timeline&&0<a.timeline.length&&(d=a.timeline[0].start);return{La:a.La,startTime:d,td:c,Nb:a.Nb,timeline:a.timeline,
|
|
966
|
-
function Et(a,b,c,d,e,f,g,h,k,l){var m=d.
|
|
966
|
+
function ut(a){var b=a.I;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.$d,pixelAspectRatio:b.pixelAspectRatio||null,width:b.width||null,label:a.ha.label||null,roles:a.roles||null,language:a.ha.language||null}};function Bt(a,b,c){var d=tt(a,Ct,c),e=Dt(a);if(!e.La&&!e.timeline&&1<e.Lc.length)throw new T(2,4,4002);if(!e.La&&!a.ia.duration&&!e.timeline&&1==e.Lc.length)throw new T(2,4,4002);if(e.timeline&&0==e.timeline.length)throw new T(2,4,4002);var f=null,g=null;a.pa.id&&a.I.id&&(g=b[a.pa.id+","+a.I.id])&&(f=g.segmentIndex);var h=Et(a.ia.start,a.ia.duration,a.I.Ia,e,d,c,a.I.mimeType,a.I.codecs,a.bandwidth,a.lb);b=!f;f?f.od(h,a.presentationTimeline.nb()):f=new hl(h);a.presentationTimeline.qd(h);a.wb&&a.ia.qf||
|
|
967
|
+
f.Ec(a.ia.start,a.ia.duration?a.ia.start+a.ia.duration:Infinity,b);g&&(g.segmentIndex=f);return{kc:function(){f&&0!=f.getNumReferences()||f.Wd(h);return Promise.resolve(f)}}}function Ct(a){return a.Pb}function Dt(a){var b=Ft(a);a=dt(a,Ct);var c=a.td;0==c&&(c=1);var d=0;a.La?d=a.La*(c-1):a.timeline&&0<a.timeline.length&&(d=a.timeline[0].start);return{La:a.La,startTime:d,td:c,Nb:a.Nb,timeline:a.timeline,Lc:b}}
|
|
968
|
+
function Et(a,b,c,d,e,f,g,h,k,l){var m=d.Lc.length;d.timeline&&d.timeline.length!=d.Lc.length&&(m=Math.min(d.timeline.length,d.Lc.length));for(var n=a-d.Nb,p=b?a+b:Infinity,r=[],u=d.startTime,v={},w=0;w<m;v={se:void 0,le:void 0},w++){v.le=d.Lc[w];var y=u;u=void 0;u=null!=d.La?y+d.La:d.timeline?d.timeline[w].end:y+b;v.se=null;v=new Yi(a+y,a+u,function(z){return function(){null==z.se&&(z.se=Se(c(),[z.le.ui],l()));return z.se}}(v),v.le.start,v.le.end,e,n,a,p,[],"",null,null,bj,f);v.codecs=h;v.mimeType=
|
|
967
969
|
g;v.bandwidth=k;r.push(v)}return r}function Ft(a){return[a.I.Pb,a.ha.Pb,a.pa.Pb].filter(Af).map(function(b){return dd(b,"SegmentURL")}).reduce(function(b,c){return 0<b.length?b:c}).map(function(b){b.attributes.indexRange&&!a.lf&&(a.lf=!0);var c=Lc(b.attributes.media);b=kd(b,"mediaRange",pd,{start:0,end:null});return{ui:c,start:b.start,end:b.end}})};function Gt(a,b,c,d,e,f,g,h,k){k||a.I.Pd||(a.I.Pd=et(a,Ht,"initialization"));var l=a.I.Pd?It(a,g):null,m=Jt(a);Kt(m);var n=Uc(a);if(m.gd)return At(a,l),{kc:function(){var w=ct(m.gd,n.I.id,null,null,n.bandwidth||null,null);w=Se(n.I.Ia(),[w]);return zt(n,b,l,w,0,null,m.Nb)}};if(m.La)return d||"image"===a.ha.contentType||(a.presentationTimeline.yf(m.La),a.presentationTimeline.Zd(a.ia.start)),{kc:function(){return Lt(n,m,e,l,f,g,h,a.I.me)}};var p=null;d=d=null;a.pa.id&&a.I.id&&(d=a.pa.id+","+a.I.id,d=
|
|
968
970
|
c[d])&&(p=d.segmentIndex);var r=a.ia.start,u=a.ia.duration?r+a.ia.duration:Infinity,v=!(a.wb&&a.ia.qf);p?(c=p,Mt(c,m,r,u,v,l),c.Ma(a.presentationTimeline.nb())):p=new Nt(m,a.I.id,a.bandwidth,a.I.Ia,a.lb,r,u,l,v,g,a.I.me);m.timeline&&"image"!==a.ha.contentType&&a.presentationTimeline.Jg(m.timeline,r);d&&a.wb&&(d.segmentIndex=p);return{kc:function(){p instanceof Nt&&0==p.getNumReferences()&&Mt(p,m,r,u,v,l);return Promise.resolve(p)}}}function Ht(a){return a.cc}
|
|
969
971
|
function Jt(a){var b=dt(a,Ht),c=et(a,Ht,"media"),d=et(a,Ht,"index"),e=et(a,Ht,"k"),f=0;e&&(f=parseInt(e,10));return{La:b.La,timescale:b.timescale,td:b.td,Nb:b.Nb,Yf:b.Yf,timeline:b.timeline,ac:c&&Lc(c),gd:d,mimeType:a.I.mimeType,codecs:a.I.codecs,bandwidth:a.bandwidth,vi:f}}function Kt(a){var b=a.gd?1:0;b+=a.timeline?1:0;b+=a.La?1:0;if(0==b)throw new T(2,4,4002);1!=b&&(a.gd&&(a.timeline=null),a.La=null);if(!a.gd&&!a.ac)throw new T(2,4,4002);}
|
|
970
|
-
function Lt(a,b,c,d,e,f,g,h){function k(N){var M=(N-w)*v,O=M+b.Nb,Q=M+p;M=Q+v;var R=Math.min(M,m()),U=[],aa=b.vi;if(aa)for(var la=(R-Q)/aa,na={},Ia=0;Ia<aa;na={fh:void 0},Ia++){var Aa=Q+la*Ia,ab=Aa+la;na.fh=Ia+1;na=new
|
|
971
|
-
Ia%h&&na.
|
|
972
|
+
function Lt(a,b,c,d,e,f,g,h){function k(N){var M=(N-w)*v,O=M+b.Nb,Q=M+p;M=Q+v;var R=Math.min(M,m()),U=[],aa=b.vi;if(aa)for(var la=(R-Q)/aa,na={},Ia=0;Ia<aa;na={fh:void 0},Ia++){var Aa=Q+la*Ia,ab=Aa+la;na.fh=Ia+1;na=new Yi(Aa,ab,function(Va){return function(){var xa=O*y;"BigInt"in window&&xa>Number.MAX_SAFE_INTEGER&&(xa=BigInt(O)*BigInt(y));xa=ct(z,A,N,Va.fh,D,xa);return Se(B(),[xa],C())}}(na),0,null,d,E,p,m(),[],"",null,null,bj,f);na.codecs=a.I.codecs;na.mimeType=a.I.mimeType;0==h?0<Ia&&na.Jc():0!=
|
|
973
|
+
Ia%h&&na.Jc();U.push(na)}Q=new Yi(Q,R,function(){if(aa)return[];var Va=O*y;"BigInt"in window&&Va>Number.MAX_SAFE_INTEGER&&(Va=BigInt(O)*BigInt(y));Va=ct(z,A,N,null,D,Va);return Se(B(),[Va],C())},0,null,d,E,p,m(),U,"",null,null,bj,f,0<U.length);Q.codecs=a.I.codecs;Q.mimeType=a.I.mimeType;Q.bandwidth=a.bandwidth;Q.j=M;return Q}function l(){var N=[Math.max(n.nb(),p),Math.min(n.Xb(),m())].map(function(M){return M-p});N=[Math.ceil(N[0]/v),Math.ceil(N[1]/v)-1];a.I.Sa&&N[1]++;return N.map(function(M){return M+
|
|
972
974
|
w})}function m(){var N=null!=r&&e[r]||u;return N?p+N:Infinity}var n=a.presentationTimeline,p=a.ia.start,r=a.pa.id,u=a.ia.duration,v=b.La,w=b.td,y=b.timescale,z=b.ac,D=a.bandwidth||null,A=a.I.id,B=a.I.Ia,C=a.lb,E=p-b.Nb,F=l();c=a.wb?Math.max(F[0],F[1]-c+1):F[0];g=g||F[1];F=[];for(var J=c;J<=g;++J){var K=k(J);F.push(K)}var L=new hl(F);F=n.Xb()<m();J=n.U();if(F||J){var I=Math.max(c,g+1);c=v;a.I.Sa&&(c=.1);L.re(c,function(){var N=n.nb();L.Ma(N);var M=t(l());M.next();M=M.next().value;for(var O=[];I<=M;){var Q=
|
|
973
975
|
k(I);O.push(Q);I++}return N>m()&&!O.length?null:O})}return Promise.resolve(L)}function It(a,b){var c=a.I.Pd;c||(c=et(a,Ht,"initialization"));if(!c)return null;c=Lc(c);var d=a.I.id,e=a.bandwidth||null,f=a.I.Ia,g=a.lb;b=new Wi(function(){var h=ct(c,d,null,null,e,null);return Se(f(),[h],g())},0,null,ut(a),null,null,b);b.codecs=a.I.codecs;b.mimeType=a.I.mimeType;return b}
|
|
974
|
-
function Nt(a,b,c,d,e,f,g,h,k,l,m){hl.call(this,[]);this.h=a;this.F=b;this.B=c;this.C=d;this.H=e;this.
|
|
975
|
-
q.Ma=function(a){if(this.h){for(var b=0,c=this.h.timeline,d=0;d<c.length;d+=1)if(c[d].end+this.
|
|
976
|
-
function Mt(a,b,c,d,e,f){Pt(a,f);if(a.h){c=a.h.timeline;a.h.ac!==b.ac&&(a.h.ac=b.ac);if(c.length){var g=c[c.length-1];b=b.timeline.filter(function(h){return h.start>=g.end})}else b=b.timeline.slice();0<b.length&&a.h.timeline.push.apply(a.h.timeline,x(b));a.l!==d&&(a.l=d)}else a.h=b,a.
|
|
977
|
-
function Ot(a){if(!a.o){for(var b=a.h.timeline;b.length;)if(b[b.length-1].start>=a.l)b.pop();else break;a.Ma(a.
|
|
978
|
-
q.get=function(a){var b=this;a-=this.
|
|
979
|
-
null==y.te&&(y.te=Qt(b.h.ac,b.F,e,b.B,f,y.gh,b.C,b.H));return y.te}}(r),0,null,this.s,c,this.
|
|
976
|
+
function Nt(a,b,c,d,e,f,g,h,k,l,m){hl.call(this,[]);this.h=a;this.F=b;this.B=c;this.C=d;this.H=e;this.j=f;this.l=g;this.s=h;this.A=l;this.G=m;k&&Ot(this)}qa(Nt,hl);q=Nt.prototype;q.getNumReferences=function(){return this.h?this.h.timeline.length:0};q.release=function(){hl.prototype.release.call(this);this.h=null};
|
|
977
|
+
q.Ma=function(a){if(this.h){for(var b=0,c=this.h.timeline,d=0;d<c.length;d+=1)if(c[d].end+this.j<=a)b+=1;else break;0<b&&(this.h.timeline=c.slice(b),this.g.length>=b&&(this.g=this.g.slice(b)),this.i+=b,0===this.getNumReferences()&&this.release())}};
|
|
978
|
+
function Mt(a,b,c,d,e,f){Pt(a,f);if(a.h){c=a.h.timeline;a.h.ac!==b.ac&&(a.h.ac=b.ac);if(c.length){var g=c[c.length-1];b=b.timeline.filter(function(h){return h.start>=g.end})}else b=b.timeline.slice();0<b.length&&a.h.timeline.push.apply(a.h.timeline,x(b));a.l!==d&&(a.l=d)}else a.h=b,a.j=c,a.l=d;e&&Ot(a)}function Pt(a,b){if(a.s!==b){a.s=b;a=t(a.g);for(var c=a.next();!c.done;c=a.next())(c=c.value)&&dj(c,b)}}
|
|
979
|
+
function Ot(a){if(!a.o){for(var b=a.h.timeline;b.length;)if(b[b.length-1].start>=a.l)b.pop();else break;a.Ma(a.j)}}q.find=function(a){if(this.h&&this.h.timeline&&this.h.timeline.length&&a<this.h.timeline[0].start+this.j)return this.i;if(!this.h)return null;var b=this.h.timeline;if(a<this.j||a>=this.l)return null;for(var c=b.length-1,d=0;d<b.length;d++){var e=b[d],f=e.start+this.j;e=d<c?b[d+1].start+this.j:Infinity===this.l?e.end+this.j:this.l;if(a>=f&&a<e)return d+this.i}return null};
|
|
980
|
+
q.get=function(a){var b=this;a-=this.i;if(0>a||a>=this.getNumReferences()||!this.h)return null;var c=this.g[a];if(!c){var d=this.h.timeline[a],e=d.Oi,f=this.h.Yf+d.Zf;c=this.j-this.h.Nb;var g=this.j+d.end,h=g;a===this.getNumReferences()-1&&Infinity!==this.l&&(h=this.l);for(var k=this.h.codecs,l=this.h.mimeType,m=this.h.bandwidth,n=[],p=(d.end-d.start)/d.Ab,r={},u=0;u<d.Ab;r={te:void 0,gh:void 0},u++){var v=d.start+p*u,w=v+p;r.gh=u+1;r.te=null;r=new Yi(this.j+v,this.j+w,function(y){return function(){if(!b.h)return[];
|
|
981
|
+
null==y.te&&(y.te=Qt(b.h.ac,b.F,e,b.B,f,y.gh,b.C,b.H));return y.te}}(r),0,null,this.s,c,this.j,this.l,[],"",null,null,bj,this.A);r.codecs=k;r.mimeType=l;r.bandwidth=m;0==this.G?0<u&&r.Jc():0!=u%this.G&&r.Jc();n.push(r)}c=new Yi(this.j+d.start,h,function(){return 0<d.Ab||!b.h?[]:Qt(b.h.ac,b.F,e,b.B,f,null,b.C,b.H)},0,null,this.s,c,this.j,this.l,n,"",null,null,bj,this.A,0<d.Ab);c.codecs=k;c.mimeType=l;c.j=g;c.bandwidth=m;this.g[a]=c}return c};
|
|
980
982
|
function Qt(a,b,c,d,e,f,g,h){a=ct(a,b,c,f,d||null,e);return Se(g(),[a],h()).map(function(k){return k.toString()})};function Rt(a){this.o=null;this.A=a;this.G=new nh;this.i=[];this.h=null;this.m=[];this.B=null;this.F=[];this.C=300;this.l=new Map;this.j=new Map;this.g=null;this.s="UNKNOWN"}Rt.prototype.configure=function(a){this.o=a};Rt.prototype.destroy=function(){this.A=this.o=null;this.i=[];this.h=null;this.m=[];this.F=[];this.l.clear();null!=this.g&&(this.g.stop(),this.g=null);return this.G.destroy()};Rt.prototype.setManifestType=function(a){this.s=a};
|
|
981
983
|
function St(a,b){var c,d,e,f,g,h,k;return P(function(l){if(1==l.g)return c=Se(a.i,[Tt(a,b)]),d=uh(c,a.o.retryParameters),e=a.A.networkingEngine.request(8,d),oh(a.G,e),ua(l,2),G(l,e.promise,4);if(2!=l.g)return f=l.h,g=Cc(f.data),h=JSON.parse(g),1==h.VERSION&&Ut(a,h,f.uri),ya(l,0);if((k=za(l))&&7001==k.code)return l.return();null!=a.g&&(a.g.stop(),a.g=null);a.g=new $b(function(){St(a,b)});a.g.Z(a.C);H(l)})}
|
|
982
984
|
function Tt(a,b){if(!a.m.length)return b;b=new ve(b);var c=a.B||a.m[0],d=Math.round(a.A.getBandwidthEstimate()),e=b.g;"DASH"==a.s?(e.add("_DASH_pathway",c),e.add("_DASH_throughput",String(d))):"HLS"==a.s&&(e.add("_HLS_pathway",c),e.add("_HLS_throughput",String(d)));Ke(e)&&ze(b,e);return b.toString()}function Ut(a,b,c){null!=a.g&&(a.g.stop(),a.g=null);var d=b["RELOAD-URI"]||c;a.g=new $b(function(){St(a,d)});if(c=b.TTL)a.C=c;a.g.Z(a.C);a.m=b["PATHWAY-PRIORITY"]||[];a.F=b["PATHWAY-CLONES"]||[]}
|
|
983
985
|
function Vt(a,b,c,d){var e=a.l.get(b);e||(e=new Map);e.set(c,d);a.l.set(b,e)}Rt.prototype.banLocation=function(a){this.j.set(a,Date.now()+6E4)};
|
|
984
|
-
function Wt(a,b,c){c=void 0===c?!1:c;b=a.l.get(b)||new Map;for(var d=[],e=t(a.m),f=e.next(),g={};!f.done;g={
|
|
986
|
+
function Wt(a,b,c){c=void 0===c?!1:c;b=a.l.get(b)||new Map;for(var d=[],e=t(a.m),f=e.next(),g={};!f.done;g={Nc:void 0},f=e.next())if(g.Nc=f.value,f=b.get(g.Nc))d.push({Ef:g.Nc,location:f});else if(f=a.F.find(function(k){return function(l){return l.sj==k.Nc}}(g))){var h=b.get(f["BASE-ID"]);h&&(f["URI-REPLACEMENT"].nh?(h=new ve(h),xe(h,f["URI-REPLACEMENT"].nh),d.push({Ef:g.Nc,location:h.toString()})):d.push({Ef:g.Nc,location:h}))}e=Date.now();g=t(a.j.keys());for(f=g.next();!f.done;f=g.next())f=f.value,
|
|
985
987
|
h=a.j.get(f),e>h&&a.j.delete(f);d=d.filter(function(k){for(var l=t(a.j.keys()),m=l.next();!m.done;m=l.next())if(m.value.includes((new ve(k.location)).Db))return!1;return!0});d.length&&(a.B=d[0].Ef);d=d.map(function(k){return k.location});if(!d.length&&a.h)for(e=t(a.h.split(",")),g=e.next();!g.done;g=e.next())if(g=b.get(g.value))a.B=a.h,d.push(g);if(!d.length)for(b=t(b.values()),e=b.next();!e.done;e=b.next())d.push(e.value);return c?d:Se(a.i,d)};function Xt(){this.j=[];this.h=[];this.g=[];this.l=[];this.i=[];this.s=this.o=!1;this.m=new Set}q=Xt.prototype;q.release=function(){for(var a=t(this.h.concat(this.g,this.l,this.i)),b=a.next();!b.done;b=a.next())b=b.value,b.segmentIndex&&b.segmentIndex.release();this.h=[];this.g=[];this.l=[];this.i=[];this.j=[]};q.ai=function(){return this.j};q.jf=function(){return this.l.slice()};q.Jh=function(){return this.i};
|
|
986
988
|
function Yt(a,b){var c=[],d=[],e=[],f=[];a=t(a);for(var g=a.next();!g.done;g=a.next()){var h=g.value;g=new Map(h.audioStreams.map(function(n){return[Zt(n),n]}));var k=new Map(h.videoStreams.map(function(n){return[$t(n),n]})),l=new Map(h.textStreams.map(function(n){return[au(n),n]}));h=new Map(h.imageStreams.map(function(n){return[bu(n),n]}));if(b){var m=cu(Ye);l.set(au(m),m);m=cu("image");h.set(bu(m),m)}c.push(g);d.push(k);e.push(l);f.push(h)}return{gg:c,lh:d,hh:e,Ag:f}}
|
|
987
989
|
q.Je=function(a,b,c){c=void 0===c?!1:c;var d=this,e,f,g,h,k,l,m,n,p,r,u,v,w,y,z,D,A,B,C,E,F,J,K,L,I,N,M,O,Q,R;return P(function(U){if(1==U.g){e=$e;if(!b&&1==a.length)return f=Yt(a,!1),g=f.gg,h=f.lh,k=f.hh,l=f.Ag,d.h=Array.from(g[0].values()),d.g=Array.from(h[0].values()),d.l=Array.from(k[0].values()),d.i=Array.from(l[0].values()),U.u(2);m=c?d.m.size:0;n=-1;for(p=0;p<a.length;p++)r=a[p],d.m.has(r.id)||(d.m.add(r.id),-1==n&&(n=p));if(-1==n)return U.return();u=Yt(a,!0);v=u.gg;w=u.lh;y=u.hh;z=u.Ag;return G(U,
|
|
@@ -997,8 +999,8 @@ function lu(a,b,c,d,e,f){if(mu(b))return null;var g=d(b);ou(a,c,g);g.createSegme
|
|
|
997
999
|
function qu(a,b,c,d,e){var f=a.matchedStreams;for(b+=e;b<f.length;b++){var g=f[b];c(a,g);var h=!0;"audio"==a.type&&0==Lf(a.language,g.language)&&(h=!1);if(h&&(d[b-e].delete(g),g.fullMimeTypes))for(g=t(g.fullMimeTypes.values()),h=g.next();!h.done;h=g.next())a.fullMimeTypes.add(h.value)}}
|
|
998
1000
|
function eu(a){var b=Object.assign({},a);b.originalId=null;b.createSegmentIndex=function(){return Promise.resolve()};b.closeSegmentIndex=function(){b.segmentIndex&&(b.segmentIndex.release(),b.segmentIndex=null);if(b.matchedStreams)for(var c=t(b.matchedStreams),d=c.next();!d.done;d=c.next())d=d.value,d.segmentIndex&&(d.segmentIndex.release(),d.segmentIndex=null)};b.roles=b.roles.slice();b.segmentIndex=null;b.emsgSchemeIdUris=[];b.keyIds=new Set;b.closedCaptions=null;b.trickModeVideo=null;return b}
|
|
999
1001
|
function iu(a){a=Object.assign({},a);a.roles=a.roles.slice();a.keyIds=new Set;a.segments=[];a.variantIds=[];a.closedCaptions=null;return a}
|
|
1000
|
-
function fu(a,b){function c(g,h){g||(g=[]);h=t(h);for(var k=h.next();!k.done;k=h.next())k=k.value,g.includes(k)||g.push(k);return g}a.roles=c(a.roles,b.roles);b.emsgSchemeIdUris&&(a.emsgSchemeIdUris=c(a.emsgSchemeIdUris,b.emsgSchemeIdUris));for(var d=t(b.keyIds),e=d.next();!e.done;e=d.next())a.keyIds.add(e.value);null==a.originalId?a.originalId=b.originalId:
|
|
1001
|
-
d;a.encrypted=a.encrypted||b.encrypted;if(b.closedCaptions)for(a.closedCaptions||(a.closedCaptions=new Map),d=t(b.closedCaptions),e=d.next();!e.done;e=d.next()){var f=t(e.value);e=f.next().value;f=f.next().value;a.closedCaptions.set(e,f)}a.bandwidth&&b.bandwidth&&(a.bandwidth=Math.max(a.bandwidth,b.bandwidth));b.trickModeVideo?(a.trickModeVideo||(a.trickModeVideo=eu(b.trickModeVideo),a.trickModeVideo.matchedStreams=[],a.trickModeVideo.createSegmentIndex=function(){if(a.trickModeVideo.segmentIndex)return Promise.resolve();
|
|
1002
|
+
function fu(a,b){function c(g,h){g||(g=[]);h=t(h);for(var k=h.next();!k.done;k=h.next())k=k.value,g.includes(k)||g.push(k);return g}a.roles=c(a.roles,b.roles);b.emsgSchemeIdUris&&(a.emsgSchemeIdUris=c(a.emsgSchemeIdUris,b.emsgSchemeIdUris));for(var d=t(b.keyIds),e=d.next();!e.done;e=d.next())a.keyIds.add(e.value);null==a.originalId?a.originalId=b.originalId:(d=b.originalId||"")&&!a.originalId.endsWith(d)&&(a.originalId+=","+d);d=Vb(a.drmInfos,b.drmInfos);if(b.drmInfos.length&&a.drmInfos.length&&!d.length)throw new T(2,
|
|
1003
|
+
4,4038);a.drmInfos=d;a.encrypted=a.encrypted||b.encrypted;if(b.closedCaptions)for(a.closedCaptions||(a.closedCaptions=new Map),d=t(b.closedCaptions),e=d.next();!e.done;e=d.next()){var f=t(e.value);e=f.next().value;f=f.next().value;a.closedCaptions.set(e,f)}a.bandwidth&&b.bandwidth&&(a.bandwidth=Math.max(a.bandwidth,b.bandwidth));b.trickModeVideo?(a.trickModeVideo||(a.trickModeVideo=eu(b.trickModeVideo),a.trickModeVideo.matchedStreams=[],a.trickModeVideo.createSegmentIndex=function(){if(a.trickModeVideo.segmentIndex)return Promise.resolve();
|
|
1002
1004
|
for(var g=new kl,h=t(a.trickModeVideo.matchedStreams),k=h.next();!k.done;k=h.next())g.h.push(k.value.segmentIndex);a.trickModeVideo.segmentIndex=g;return Promise.resolve()}),a.trickModeVideo.matchedStreams.push(b.trickModeVideo),fu(a.trickModeVideo,b.trickModeVideo)):a.trickModeVideo&&(a.trickModeVideo.matchedStreams.push(b),fu(a.trickModeVideo,b))}
|
|
1003
1005
|
function ju(a,b){var c=a.roles;c||(c=[]);for(var d=t(b.roles),e=d.next();!e.done;e=d.next())e=e.value,c.includes(e)||c.push(e);a.roles=c;c=t(b.keyIds);for(d=c.next();!d.done;d=c.next())a.keyIds.add(d.value);a.encrypted=a.encrypted&&b.encrypted;a.segments.push.apply(a.segments,x(b.segments));if(b.closedCaptions)for(a.closedCaptions||(a.closedCaptions=new Map),b=t(b.closedCaptions),c=b.next();!c.done;c=b.next())d=t(c.value),c=d.next().value,d=d.next().value,a.closedCaptions.set(c,d)}
|
|
1004
1006
|
function ou(a,b,c,d){d=(void 0===d?0:d)?c.matchedStreams:[];b=t(b);for(var e=b.next();!e.done;e=b.next()){e=ru(a,e.value,c);if(!e)return;d.push(e)}c.matchedStreams=d}
|
|
@@ -1023,20 +1025,20 @@ q.banLocation=function(a){this.h&&this.h.banLocation(a)};q.setMediaElement=funct
|
|
|
1023
1025
|
function Lu(a){var b,c,d,e,f,g,h,k,l,m,n;return P(function(p){if(1==p.g)return b=4,c="MPD",d=Nu(a),e=a.A,d.length?(e=d,c="Patch",b=6):1<a.A.length&&a.h&&(f=Wt(a.h,"Location",!0),f.length&&(e=f)),g=uh(e,a.g.retryParameters),h=Date.now(),G(p,Ou(a,g,0,{type:b}),2);if(3!=p.g){k=p.h;if(!a.j)return p.return(0);k.uri&&k.uri!=k.originalUri&&!a.A.includes(k.uri)&&a.A.unshift(k.uri);l=new ve(k.uri);a.X=l.g.toString();return G(p,Pu(a,k.data,k.uri,c),3)}m=Date.now();n=(m-h)/1E3;a.ma.sample(1,n);return p.return(n)})}
|
|
1024
1026
|
function Pu(a,b,c,d){var e,f,g,h,k,l,m,n,p,r,u;return P(function(v){if(1==v.g){e=b;f=a.g.dash.manifestPreprocessor;g=Qm;if(f!=g){rb("manifest.dash.manifestPreprocessor configuration","Please Use manifest.dash.manifestPreprocessorTXml instead.");h=Iu(e,d);if(!h)throw new T(2,4,4001,c);f(h);e=Ic(h.outerHTML)}k=Vc(e,d);if(!k)throw new T(2,4,4001,c);l=a.g.dash.manifestPreprocessorTXml;m=Rm;l!=m&&l(k);if("Patch"===d)return v.return(Qu(a,k));if(n=a.g.dash.disableXlinkProcessing)return v.return(Ru(a,k,c));
|
|
1025
1027
|
p=a.g.dash.xlinkFailGracefully;r=it(k,a.g.retryParameters,p,c,a.j.networkingEngine);oh(a.T,r);return G(v,r.promise,2)}u=v.h;return v.return(Ru(a,u,c))})}
|
|
1026
|
-
function Ru(a,b,c){var d,e,f,g,h,k,l,m,n,p,r,u,v,w,y,z,D,A,B,C,E,F,J,K,L,I,N,M,O,Q,R,U,aa,la,na,Ia,Aa,ab,Va,xa,wa,Dc,eb,Tb,Ec,lb,wd,oe,pe,Md,
|
|
1028
|
+
function Ru(a,b,c){var d,e,f,g,h,k,l,m,n,p,r,u,v,w,y,z,D,A,B,C,E,F,J,K,L,I,N,M,O,Q,R,U,aa,la,na,Ia,Aa,ab,Va,xa,wa,Dc,eb,Tb,Ec,lb,wd,oe,pe,Md,Zi,Nd,$i,aj,Qg,qe;return P(function(oc){switch(oc.g){case 1:a.h&&a.h.l.clear();d=[c];e=[];f=new Map;g=dd(b,"Location");h=t(g);for(k=h.next();!k.done;k=h.next())if(l=k.value,m=l.attributes.serviceLocation,n=fd(l))p=Se(d,[n])[0],m&&(a.h?Vt(a.h,"Location",m,p):f.set(m,p)),e.push(p);a.h?(r=Wt(a.h,"Location",!0),0<r.length&&(d=a.A=r)):e.length&&(d=a.A=e);a.l.Yd=b.attributes.id||
|
|
1027
1029
|
"";a.l.rd=kd(b,"publishTime",nd)||0;a.F=dd(b,"PatchLocation");u=Promise.resolve();if((v=hd(b,"ContentSteering"))&&a.j){w=v.attributes.defaultServiceLocation;if(a.h)a.h.i=d,a.h.h=w;else if(a.h=new Rt(a.j),a.h.configure(a.g),a.h.setManifestType("DASH"),a.h.i=d,a.h.h=w,y=fd(v))(z=kd(v,"queryBeforeStart",ud,!1))?u=St(a.h,y):St(a.h,y);D=t(f.keys());for(A=D.next();!A.done;A=D.next())B=A.value,C=f.get(B),Vt(a.h,"Location",B,C)}E=dd(b,"BaseURL");J=!1;if(a.h)for(K=t(E),L=K.next();!L.done;L=K.next())I=L.value,
|
|
1028
1030
|
N=I.attributes.serviceLocation,M=fd(I),N&&M&&(Vt(a.h,"BaseURL",N,M),J=!0);J&&a.h||(O=E.map(fd),F=Se(d,O));Q=function(){return a.h&&J?Wt(a.h,"BaseURL"):F?F:[]};a.l.Ia=Q;R=0;E&&E.length&&(R=kd(E[0],"availabilityTimeOffset",td)||0);a.l.Sa=R;U=a.g.dash.ignoreMinBufferTime;aa=0;U||(aa=kd(b,"minBufferTime",od)||0);a.K=kd(b,"minimumUpdatePeriod",od,-1);la=kd(b,"availabilityStartTime",nd);na=kd(b,"timeShiftBufferDepth",od);Ia=a.g.dash.ignoreSuggestedPresentationDelay;Aa=null;Ia||(Aa=kd(b,"suggestedPresentationDelay",
|
|
1029
1031
|
od));ab=a.g.dash.ignoreMaxSegmentDuration;Va=null;ab||(Va=kd(b,"maxSegmentDuration",od));xa=b.attributes.type||"static";a.i&&a.i.presentationTimeline&&(a.fa=a.i.presentationTimeline.U()&&"static"==xa);a.l.type=xa;Su(a);if(a.i)for(wa=a.i.presentationTimeline,Dc=t(Object.values(a.s)),eb=Dc.next();!eb.done;eb=Dc.next())Tb=eb.value,Tb.segmentIndex&&Tb.segmentIndex.Ma(wa.nb());else Ec=a.g.defaultPresentationDelay||1.5*aa,lb=null!=Aa?Aa:Ec,wa=new Mk(la,lb,a.g.dash.autoCorrectDrift);wa.vc("static"==xa);
|
|
1030
|
-
(wd=wa.U())&&!isNaN(a.g.availabilityWindowOverride)&&(na=a.g.availabilityWindowOverride);null==na&&(na=Infinity);wa.ne(na);oe=b.attributes.profiles||"";a.l.profiles=oe.split(",");pe={wb:"static"!=xa,presentationTimeline:wa,pa:null,ia:null,ha:null,I:null,bandwidth:0,lf:!1,Sa:R,Kb:null,profiles:oe.split(","),roles:null,lb:function(){return""}};a.N=0;Md=Tu(a,pe,Q,b,!1);
|
|
1031
|
-
a.H=a.j.isLowLatencyMode());a.H&&wa.Vg(a.aa);wa.yf(Va||1);return G(oc,u,2);case 2:a.H&&(aa=0
|
|
1032
|
+
(wd=wa.U())&&!isNaN(a.g.availabilityWindowOverride)&&(na=a.g.availabilityWindowOverride);null==na&&(na=Infinity);wa.ne(na);oe=b.attributes.profiles||"";a.l.profiles=oe.split(",");pe={wb:"static"!=xa,presentationTimeline:wa,pa:null,ia:null,ha:null,I:null,bandwidth:0,lf:!1,Sa:R,Kb:null,profiles:oe.split(","),roles:null,lb:function(){return""}};a.N=0;Md=Tu(a,pe,Q,b,!1);Zi=Md.duration;Nd=Md.periods;("static"!=xa||a.fa)&&Md.og||wa.Za(Zi||Infinity);a.ea&&!a.H&&($i=a.j.isAutoLowLatencyMode())&&(a.j.enableLowLatencyMode(),
|
|
1033
|
+
a.H=a.j.isLowLatencyMode());a.H&&wa.Vg(a.aa);wa.yf(Va||1);return G(oc,u,2);case 2:a.H&&(aa=0,aj=null!=Aa?Aa:a.g.defaultPresentationDelay,wa.Of(aj));if(!a.i)return G(oc,a.m.Je(Nd,pe.wb),6);a.i.periodCount=Nd.length;a.i.gapCount=a.N;return G(oc,Uu(a,Nd,!1),4);case 6:a.i={presentationTimeline:wa,variants:a.m.j,textStreams:a.m.jf(),imageStreams:a.m.i,offlineSessionIds:[],minBufferTime:aa||0,sequenceMode:a.g.dash.sequenceMode,ignoreManifestTimestampsInSegmentsMode:!1,type:"DASH",serviceDescription:Vu(b),
|
|
1032
1034
|
nextUrl:Wu(b),periodCount:Nd.length,gapCount:a.N,isLowLatency:a.ea,startTime:null};if(!wa.jh()){oc.u(7);break}Qg=dd(b,"UTCTiming");return G(oc,Xu(a,Q,Qg),8);case 8:qe=oc.h;if(!a.j)return oc.return();wa.Wg(qe);case 7:wa.Ud();case 4:a.j.makeTextStreamsForClosedCaptions(a.i),H(oc)}})}function Uu(a,b,c){var d;return P(function(e){if(1==e.g)return G(e,a.m.Je(b,!0,c),2);a.i.variants=a.m.j;d=a.m.jf();0<d.length&&(a.i.textStreams=d);a.i.imageStreams=a.m.i;a.j.filter(a.i);H(e)})}
|
|
1033
1035
|
function Qu(a,b){var c,d,e,f,g,h,k,l,m,n,p,r,u,v,w,y,z,D,A,B,C,E,F,J,K,L,I;return P(function(N){if(1==N.g){c=b.attributes.mpdId;d=kd(b,"originalPublishTime",nd);if(!c||c!==a.l.Yd||d!==a.l.rd)throw a.F=[],new T(1,4,4052);e=[];f=[];g=new Set;h=t(cd(b));for(k=h.next();!k.done;k=h.next())if(l=k.value,m=xd(l.attributes.sel||""),n=m[m.length-1],p=fd(l)||"","MPD"===n.name)if("mediaPresentationDuration"===n.Sb){r=fd(l)||"";var M=od(r);if(null!=M){a.l.Kb=M;for(var O=t(a.o.values()),Q=O.next();!Q.done;Q=O.next())Q.value.Kb=
|
|
1034
1036
|
M}}else if("type"===n.Sb){a.i.presentationTimeline.vc("static"==p);a.l.type=p;M=t(a.o.values());for(O=M.next();!O.done;O=M.next())O.value.wb="dynamic"==p;"static"==p&&(a.K=-1)}else"publishTime"===n.Sb?a.l.rd=nd(p)||0:null===n.Sb&&"add"===l.tagName&&f.push(l);else if("PatchLocation"===n.name)zd(a.F,l);else if("Period"===n.name)"add"===l.tagName?f.push(l):"remove"===l.tagName&&n.id&&Yu(a,n.id);else if("SegmentTemplate"===n.name){O=xd(l.attributes.sel||"");M=O[O.length-1];if(M.Sb){O=Zu(a,O);Q=fd(l)||
|
|
1035
|
-
"";for(var R=t(O),U=R.next();!U.done;U=R.next())U=a.o.get(U.value),Bd(U.I.cc,l.tagName,M.Sb,Q);M=O}else M=[];u=M;v=t(u);for(w=v.next();!w.done;w=v.next())y=w.value,g.add(y)}else if("SegmentTimeline"===n.name||"S"===n.name){M=xd(l.attributes.sel||"");M=Zu(a,M);O=t(M);for(Q=O.next();!Q.done;Q=O.next())Q=a.o.get(Q.value),Q=ft(Q,Ht,"SegmentTimeline"),R=dd(Q,"S"),zd(R,l),Q.children=R;z=M;D=t(z);for(A=D.next();!A.done;A=D.next())B=A.value,g.add(B)}C=t(g);for(E=C.next();!E.done;E=C.next())F=E.value
|
|
1037
|
+
"";for(var R=t(O),U=R.next();!U.done;U=R.next())U=a.o.get(U.value),Bd(U.I.cc,l.tagName,M.Sb,Q);M=O}else M=[];u=M;v=t(u);for(w=v.next();!w.done;w=v.next())y=w.value,g.add(y)}else if("SegmentTimeline"===n.name||"S"===n.name){M=xd(l.attributes.sel||"");M=Zu(a,M);O=t(M);for(Q=O.next();!Q.done;Q=O.next())Q=a.o.get(Q.value),Q=ft(Q,Ht,"SegmentTimeline"),R=dd(Q,"S"),zd(R,l),Q.children=R;z=M;D=t(z);for(A=D.next();!A.done;A=D.next())B=A.value,g.add(B)}C=t(g);for(E=C.next();!E.done;E=C.next())F=E.value,$u(a,
|
|
1036
1038
|
F);J=t(f);for(K=J.next();!K.done;K=J.next())L=K.value,e.push.apply(e,x(mv(a,L)));if(!e.length)return N.u(2);a.i.periodCount+=e.length;a.i.gapCount=a.N;return G(N,Uu(a,e,!0),2)}"static"==a.l.type&&(I=a.l.Kb,a.i.presentationTimeline.Za(I||Infinity));H(N)})}
|
|
1037
|
-
function mv(a,b){return Tu(a,{wb:"dynamic"==a.l.type,presentationTimeline:a.i.presentationTimeline,pa:null,ia:null,ha:null,I:null,bandwidth:0,lf:!1,Sa:a.l.Sa,profiles:a.l.profiles,Kb:a.l.Kb,roles:null,lb:function(){return""}},a.l.Ia,b,!0).periods}function Yu(a,b){a.i.periodCount--;for(var c=t(a.o.keys()),d=c.next();!d.done;d=c.next())if(d=d.value,d.startsWith(b)){var e=a.o.get(d);ft(e,Ht,"SegmentTimeline").children=[]
|
|
1039
|
+
function mv(a,b){return Tu(a,{wb:"dynamic"==a.l.type,presentationTimeline:a.i.presentationTimeline,pa:null,ia:null,ha:null,I:null,bandwidth:0,lf:!1,Sa:a.l.Sa,profiles:a.l.profiles,Kb:a.l.Kb,roles:null,lb:function(){return""}},a.l.Ia,b,!0).periods}function Yu(a,b){a.i.periodCount--;for(var c=t(a.o.keys()),d=c.next();!d.done;d=c.next())if(d=d.value,d.startsWith(b)){var e=a.o.get(d);ft(e,Ht,"SegmentTimeline").children=[];$u(a,d);a.o.delete(d)}a.B=a.B.filter(function(f){return f!==b})}
|
|
1038
1040
|
function Zu(a,b){var c="",d="",e=-1,f="";b=t(b);for(var g=b.next();!g.done;g=b.next())g=g.value,"Period"===g.name?c=g.id:"AdaptationSet"===g.name?(d=g.id,null!==g.position&&(e=g.position)):"Representation"===g.name&&(f=g.id);b=[];if(f)b.push(c+","+f);else if(d)for(e=t(a.o.values()),a=e.next();!a.done;a=e.next())a=a.value,a.pa.id===c&&a.ha.id===d&&a.I.id&&b.push(c+","+a.I.id);else if(-1<e)for(d=t(a.o.values()),a=d.next();!a.done;a=d.next())a=a.value,a.pa.id===c&&a.ha.position===e&&a.I.id&&b.push(c+
|
|
1039
|
-
","+a.I.id);return b}function
|
|
1041
|
+
","+a.I.id);return b}function $u(a,b){var c=a.o.get(b),d=a.s[b];d.segmentIndex&&d.segmentIndex.Ma(a.i.presentationTimeline.nb());try{var e=Gt(c,function(f,g,h,k){return nv(a,f,g,h,k)},a.s,!0,a.g.dash.initialSegmentLimit,a.ga,c.I.aesKey,null,!0);d.createSegmentIndex=function(){return P(function(f){if(1==f.g)return d.segmentIndex?f.u(0):G(f,e.kc(),3);d.segmentIndex=f.h;H(f)})}}catch(f){if(b=c.I.contentType,b!=Ye&&"application"!=b&&"image"!=b||4002!=f.code)throw f;}}
|
|
1040
1042
|
function Vu(a){var b=hd(a,"ServiceDescription");if(!b)return null;a=hd(b,"Latency");b=hd(b,"PlaybackRate");if(!a&&!b)return null;var c={};a&&("target"in a.attributes&&(c.targetLatency=parseInt(a.attributes.target,10)/1E3),"max"in a.attributes&&(c.maxLatency=parseInt(a.attributes.max,10)/1E3),"min"in a.attributes&&(c.minLatency=parseInt(a.attributes.min,10)/1E3));b&&("max"in b.attributes&&(c.maxPlaybackRate=parseFloat(b.attributes.max)),"min"in b.attributes&&(c.minPlaybackRate=parseFloat(b.attributes.min)));
|
|
1041
1043
|
return c}function Wu(a){a=dd(a,"SupplementalProperty");if(!a.length)return null;a=t(a);for(var b=a.next();!b.done;b=a.next())if(b=b.value,"urn:mpeg:dash:chaining:2016"==b.attributes.schemeIdUri)return b.attributes.value;return null}
|
|
1042
1044
|
function Tu(a,b,c,d,e){var f=b.Kb;f||(f=kd(d,"mediaPresentationDuration",od),a.l.Kb=f);var g=0;a.i&&a.i.presentationTimeline&&a.fa&&(g=a.i.presentationTimeline.Wb());var h=[],k=g;d=dd(d,"Period");for(var l=0;l<d.length;l++){var m=d[l],n=d[l+1],p=kd(m,"start",od,k),r=m.attributes.id,u=kd(m,"duration",od),v=null;if(n){var w=kd(n,"start",od);null!=w&&(v=w-p)}else null!=f&&(v=f-p+g);w=af;v&&u&&Math.abs(v-u)>w&&v>u&&a.N++;null==v&&(v=u);if(!(null!==a.O&&null!==r&&null!==p&&p<a.O)||a.B.includes(r)||l+1==
|
|
@@ -1056,23 +1058,23 @@ w.keyIds||r.keyIds;a.g.dash.enableAudioGroups&&(r.groupId=m)}n=n.map(function(L)
|
|
|
1056
1058
|
function rv(a,b){if((b=id(b,"urn:mpeg:dash:schema:urlparam:2014","UrlQueryInfo"))&&kd(b,"useMPDUrlQuery",ud,!1)){var c=b.attributes.queryTemplate;if(c)return function(){return"$querypart$"==c?a.X:c.split("&").map(function(d){if("$querypart$"==d)return a.X;var e=/\$query:(.*?)\$/g.exec(d);if(e&&2==e.length){e=e[1];var f=(new Be(a.X)).get(e);if(f.length)return e+"="+f[0]}return d}).join("&")}}return null}
|
|
1057
1059
|
function uv(a,b,c,d,e,f,g,h,k,l,m,n){b.I=pv(a,l,b.ha,null);var p=b.I.id;a.aa=Math.min(a.aa,b.I.Sa);a.ea=0<a.aa;if(!wv(b.I))return null;var r=b.ia.start;b.bandwidth=kd(l,"bandwidth",rd)||0;b.roles=h;var u=dd(l,"SupplementalProperty"),v=dd(l,"EssentialProperty"),w=null,y=v.find(function(O){return"urn:mpeg:dash:urlparam:2014"==O.attributes.schemeIdUri});y?w=rv(a,y):(y=u.find(function(O){return"urn:mpeg:dash:urlparam:2014"==O.attributes.schemeIdUri}))&&(w=rv(a,y));w&&(b.lb=w);y=b.I.contentType;w=y==Ye||
|
|
1058
1060
|
"application"==y;y="image"==y;try{var z=void 0;if(c.Fe){var D=b.I.Ia,A=b.lb,B=Se(D(),[c.Fe.ni],A()),C=uh(B,a.g.retryParameters);z={bitsKey:128,blockCipherMode:"CBC",iv:c.Fe.iv,firstMediaSequenceNumber:0,fetchKey:function(){var O,Q,R;return P(function(U){if(1==U.g)return G(U,Ou(a,C,6),2);if(3!=U.g){O=U.h;if(!O.data||16!=O.data.byteLength)throw new T(2,4,4049);Q={name:"AES-CBC"};R=z;return G(U,window.crypto.subtle.importKey("raw",O.data,Q,!0,["decrypt"]),3)}R.cryptoKey=U.h;z.fetchKey=void 0;H(U)})}}}b.I.aesKey=
|
|
1059
|
-
z;D=function(O,Q,R,U){return nv(a,O,Q,R,U)};if(b.I.
|
|
1061
|
+
z;D=function(O,Q,R,U){return nv(a,O,Q,R,U)};if(b.I.Sc)var E=vt(b,D,z);else if(b.I.Pb)E=Bt(b,a.s,z);else if(b.I.cc)E=Gt(b,D,a.s,!!a.i,a.g.dash.initialSegmentLimit,a.ga,z,n,!1);else{var F=b.ia.duration||0,J=b.I.Ia,K=b.I.mimeType,L=b.I.codecs;E={kc:function(){var O=jl(r,F,J());O.Gb(function(Q){Q.mimeType=K;Q.codecs=L});return Promise.resolve(O)}}}}catch(O){if((w||y)&&4002==O.code)return null;throw O;}l=dd(l,"ContentProtection");l=Ws(l,c,a.g.dash.ignoreDrmInfo,a.g.dash.keySystemsByURI);l=new Set(l?[l]:
|
|
1060
1062
|
[]);n=!1;u.some(function(O){return"tag:dolby.com,2018:dash:EC3_ExtensionType:2018"==O.attributes.schemeIdUri&&"JOC"==O.attributes.value})&&(n=!0);u=!1;w&&(u=h.includes("forced_subtitle")||h.includes("forced-subtitle"));var I;if(y&&((v=v.find(function(O){return["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"].includes(O.attributes.schemeIdUri)}))&&(I=v.attributes.value),!I))return null;var N;w=b.I.codecs;b.profiles.includes("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")&&
|
|
1061
1063
|
(w.includes("hvc1.2.4.L153.B0")||w.includes("hev1.2.4.L153.B0"))&&(N="PQ");v=b.I.id?b.pa.id+","+b.I.id:"";a.F.length&&p&&a.o.set(b.pa.id+","+p,xv(b));var M=v&&a.s[v]?a.s[v]:{id:a.na++,originalId:b.I.id,groupId:null,createSegmentIndex:function(){return Promise.resolve()},closeSegmentIndex:function(){M.segmentIndex&&(M.segmentIndex.release(),M.segmentIndex=null)},segmentIndex:null,mimeType:b.I.mimeType,codecs:w,frameRate:b.I.frameRate,pixelAspectRatio:b.I.pixelAspectRatio,bandwidth:b.bandwidth,width:b.I.width,
|
|
1062
1064
|
height:b.I.height,kind:d,encrypted:0<c.drmInfos.length,drmInfos:c.drmInfos,keyIds:l,language:e,originalLanguage:b.ha.language,label:f,type:b.ha.contentType,primary:g,trickModeVideo:null,emsgSchemeIdUris:b.I.emsgSchemeIdUris,roles:h,forced:u,channelsCount:b.I.$d,audioSamplingRate:b.I.audioSamplingRate,spatialAudio:n,closedCaptions:k,hdr:N,colorGamut:void 0,videoLayout:void 0,tilesLayout:I,accessibilityPurpose:m,external:!1,fastSwitching:!1,fullMimeTypes:new Set([cf(b.I.mimeType,b.I.codecs)])};M.createSegmentIndex=
|
|
1063
|
-
function(){var O;return P(function(Q){if(1==Q.g){if(M.segmentIndex)return Q.u(0);O=M;return G(Q,E.kc(),3)}O.segmentIndex=Q.h;H(Q)})};v&&b.wb&&!a.s[v]&&(b=b.pa.id||"",a.C[b]||(a.C[b]=[]),a.s[v]=M,a.C[b].push(v));return M}function xv(a){function b(c){if(!c)return null;c=Uc(c);c.
|
|
1065
|
+
function(){var O;return P(function(Q){if(1==Q.g){if(M.segmentIndex)return Q.u(0);O=M;return G(Q,E.kc(),3)}O.segmentIndex=Q.h;H(Q)})};v&&b.wb&&!a.s[v]&&(b=b.pa.id||"",a.C[b]||(a.C[b]=[]),a.s[v]=M,a.C[b].push(v));return M}function xv(a){function b(c){if(!c)return null;c=Uc(c);c.Sc=null;c.Pb=null;c.cc=Dd(c.cc);return c}a=Uc(a);a.pa=b(a.pa);a.ha=b(a.ha);a.I=b(a.I);a.ia&&(a.ia=Uc(a.ia),a.ia.node=null);return a}
|
|
1064
1066
|
function Ku(a){var b,c;return P(function(d){switch(d.g){case 1:return b=0,ua(d,2),G(d,Lu(a),4);case 4:b=d.h;ya(d,3);break;case 2:if(c=za(d),a.j){if(a.g.raiseFatalErrorOnManifestUpdateRequestFailure)return a.j.onError(c),d.return();c.severity=1;a.j.onError(c)}case 3:if(!a.j)return d.return();a.j.onManifestUpdated();Mu(a,b);H(d)}})}function Mu(a,b){if(!(0>a.K)){var c=a.K;0<=a.g.dash.updatePeriod&&(c=a.g.dash.updatePeriod);a.L.Z(Math.max(c-b,Ua(a.ma)))}}
|
|
1065
1067
|
function pv(a,b,c,d){c=c||{contentType:"",mimeType:"",codecs:"",emsgSchemeIdUris:[],frameRate:void 0,pixelAspectRatio:void 0,$d:null,audioSamplingRate:null,Sa:0,me:0};d=d||c.Ia;var e=b.attributes.id,f=dd(b,"BaseURL"),g,h=!1;if(a.h)for(var k=t(f),l=k.next();!l.done;l=k.next()){var m=l.value;l=m.attributes.serviceLocation;m=fd(m);l&&m&&(Vt(a.h,e,l,m),h=!0)}h&&a.h||(g=f.map(fd));k=b.attributes.contentType||c.contentType;l=b.attributes.mimeType||c.mimeType;m=[b.attributes.codecs||c.codecs];var n=ld(b,
|
|
1066
1068
|
"urn:scte:dash:scte214-extensions","supplementalCodecs");n&&m.push(n);m=Ql(m).join(",");n=kd(b,"frameRate",vd)||c.frameRate;var p=b.attributes.sar||c.pixelAspectRatio,r=yv(dd(b,"InbandEventStream"),c.emsgSchemeIdUris),u=dd(b,"AudioChannelConfiguration");u=zv(u)||c.$d;var v=kd(b,"audioSamplingRate",sd)||c.audioSamplingRate;k||(k=vv(l,m));var w=hd(b,"SegmentBase"),y=hd(b,"SegmentTemplate"),z=w?kd(w,"availabilityTimeOffset",td)||0:0,D=y?kd(y,"availabilityTimeOffset",td)||0:0,A=f&&f.length?kd(f[0],"availabilityTimeOffset",
|
|
1067
|
-
td)||0:0;z=c.Sa+A+z+D;D=null;(A=hd(b,"SegmentSequenceProperties"))&&(A=hd(A,"SAP"))&&(D=kd(A,"cadence",qd));A=b.attributes.label;var B=dd(b,"Label");B&&B.length&&(B=B[0],ed(B)&&(A=ed(B)));return{Ia:function(){return Se(d(),f.length?a.h&&h?Wt(a.h,e):g?g:[]:[])},
|
|
1069
|
+
td)||0:0;z=c.Sa+A+z+D;D=null;(A=hd(b,"SegmentSequenceProperties"))&&(A=hd(A,"SAP"))&&(D=kd(A,"cadence",qd));A=b.attributes.label;var B=dd(b,"Label");B&&B.length&&(B=B[0],ed(B)&&(A=ed(B)));return{Ia:function(){return Se(d(),f.length?a.h&&h?Wt(a.h,e):g?g:[]:[])},Sc:w||c.Sc,Pb:hd(b,"SegmentList")||c.Pb,cc:y||c.cc,width:kd(b,"width",sd)||c.width,height:kd(b,"height",sd)||c.height,contentType:k,mimeType:l,codecs:m,frameRate:n,pixelAspectRatio:p,emsgSchemeIdUris:r,id:e,language:b.attributes.lang,$d:u,audioSamplingRate:v,
|
|
1068
1070
|
Sa:z,Pd:null,me:D||c.me,label:A||null}}function yv(a,b){b=b.slice();a=t(a);for(var c=a.next();!c.done;c=a.next())c=c.value.attributes.schemeIdUri,b.includes(c)||b.push(c);return b}
|
|
1069
1071
|
function zv(a){a=t(a);for(var b=a.next();!b.done;b=a.next()){var c=b.value;if(b=c.attributes.schemeIdUri)if(c=c.attributes.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=
|
|
1070
|
-
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 wv(a){var b=a.
|
|
1072
|
+
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 wv(a){var b=a.Sc?1:0;b+=a.Pb?1:0;b+=a.cc?1:0;if(0==b)return a.contentType==Ye||"application"==a.contentType?!0:!1;1!=b&&(a.Sc&&(a.Pb=null),a.cc=null);return!0}
|
|
1071
1073
|
function Av(a,b,c,d){var e,f,g,h,k,l,m;return P(function(n){if(1==n.g)return e=[Lc(c)],f=Se(b(),e),g=uh(f,a.g.retryParameters),g.method=d,h=a.j.networkingEngine.request(4,g,{isPreload:a.ca()}),oh(a.T,h),G(n,h.promise,2);k=n.h;if("HEAD"==d){if(!k.headers||!k.headers.date)return n.return(0);l=k.headers.date}else l=Cc(k.data);m=Date.parse(l);return isNaN(m)?n.return(0):n.return(m-Date.now())})}
|
|
1072
1074
|
function Xu(a,b,c){var d,e,f,g,h,k,l,m;return P(function(n){switch(n.g){case 1:d=c.map(function(p){return{scheme:p.attributes.schemeIdUri,value:p.attributes.value}}),e=a.g.dash.clockSyncUri,!d.length&&e&&d.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:e}),f=t(d),g=f.next();case 2:if(g.done){n.u(4);break}h=g.value;ua(n,5);k=h.scheme;l=h.value;switch(k){case "urn:mpeg:dash:utc:http-head:2014":case "urn:mpeg:dash:utc:http-head:2012":return n.u(7);case "urn:mpeg:dash:utc:http-xsdate:2014":case "urn:mpeg:dash:utc:http-iso:2014":case "urn:mpeg:dash:utc:http-xsdate:2012":case "urn:mpeg:dash:utc:http-iso:2012":return n.u(8);
|
|
1073
1075
|
case "urn:mpeg:dash:utc:direct:2014":case "urn:mpeg:dash:utc:direct:2012":return m=Date.parse(l),n.return(isNaN(m)?0:m-Date.now());case "urn:mpeg:dash:utc:http-ntp:2014":case "urn:mpeg:dash:utc:ntp:2014":case "urn:mpeg:dash:utc:sntp:2014":Za("NTP UTCTiming scheme is not supported");break;default:Za("Unrecognized scheme in UTCTiming element",k)}n.u(9);break;case 7:return G(n,Av(a,b,l,"HEAD"),10);case 10:return n.return(n.h);case 8:return G(n,Av(a,b,l,"GET"),11);case 11:return n.return(n.h);case 9:ya(n,
|
|
1074
1076
|
3);break;case 5:za(n);case 3:g=f.next();n.u(2);break;case 4:return Za("A UTCTiming element should always be given in live manifests! This content may not play on clients with bad clocks!"),n.return(0)}})}
|
|
1075
|
-
function qv(a,b,c,d,e){var f=d.attributes.schemeIdUri||"",g=d.attributes.value||"",h=kd(d,"timescale",sd)||1;d=t(dd(d,"Event"));for(var
|
|
1077
|
+
function qv(a,b,c,d,e){var f=d.attributes.schemeIdUri||"",g=d.attributes.value||"",h=kd(d,"timescale",sd)||1,k=kd(d,"presentationTimeOffset",sd)||0;d=t(dd(d,"Event"));for(var l=d.next();!l.done;l=d.next()){l=l.value;var m=kd(l,"presentationTime",sd)||0,n=kd(l,"duration",sd)||0;m=Math.max((m-k)/h+b,b);n=m+n/h;null!=c&&(m=Math.min(m,b+c),n=Math.min(n,b+c));n<e||(l={schemeIdUri:f,value:g,startTime:m,endTime:n,id:l.attributes.id||"",eventElement:Cd(l),eventNode:Dd(l)},a.j.onTimelineRegionAdded(l))}}
|
|
1076
1078
|
function nv(a,b,c,d,e){var f,g,h,k;return P(function(l){if(1==l.g)return f=Ah,g=e?0:1,h=Ul(b,c,d,a.g.retryParameters),G(l,Ou(a,h,f,{type:g}),2);k=l.h;return l.return(k.data)})}function vv(a,b){b=cf(a,b);return rf(b)?Ye:a.split("/")[0]}function Ou(a,b,c,d){d||(d={});d.isPreload=a.ca();b=a.j.networkingEngine.request(c,b,d);oh(a.T,b);return b.promise}
|
|
1077
1079
|
function Nu(a){var b=a.l.rd;if(!a.l.Yd||!b||!a.F.length)return[];var c=Date.now()/1E3,d=a.F.filter(function(e){e=sd(e.attributes.ttl);return!e||b+e>c}).map(fd).filter(Af);return d.length?Se(a.A,d):[]}S("shaka.dash.DashParser",Ju);Ri["application/dash+xml"]=function(){return new Ju};Ri["video/vnd.mpeg.dash.mpd"]=function(){return new Ju};function Bv(){}S("shaka.dependencies",Bv);Bv.has=function(a){return Cv.has(a)};Bv.add=function(a,b){if(!Dv[a])throw Error(a+" is not supported");a==Ev?rb("mux.js","mux.js is no longer used in Shaka Player."):Cv.set(a,function(){return b})};var Ev="muxjs",Dv={ek:Ev,ISOBoxer:"ISOBoxer"};Bv.Allowed=Dv;var Cv=new Map([["ISOBoxer",function(){return window.ISOBoxer}]]);function Fv(a,b,c){this.type=a;this.W=b;this.segments=c||null}function Gv(a,b,c,d){this.id=a;this.name=b;this.attributes=c;this.value=void 0===d?null:d}Gv.prototype.toString=function(a){function b(e){return e.name+"="+(isNaN(Number(e.value))?'"'+e.value+'"':e.value)}var c="#"+this.name,d=this.attributes?this.attributes.filter(function(e){return a?!a.has(e.name):!0}).map(b):[];this.value&&d.unshift(this.value);0<d.length&&(c+=":"+d.join(","));return c};
|
|
1078
1080
|
function Hv(a,b){if(b)return a.toString();b=(new Set).add("AUDIO").add("VIDEO").add("SUBTITLES").add("PATHWAY-ID").add("GROUP-ID").add("URI");return a.toString(b)}function Iv(a,b){a=a.attributes.filter(function(c){return c.name==b});return a.length?a[0]:null}function Z(a,b,c){return(a=Iv(a,b))?a.value:c||null}function Jv(a,b){a=Iv(a,b);if(!a)throw new T(2,4,4023,b);return a.value}function Kv(a,b,c){c=void 0===c?[]:c;this.W=b;this.g=a;this.Ab=c}function Lv(a,b){this.name=a;this.value=b};function Mv(a,b){return a.filter(function(c){return c.name==b})}function Nv(a,b){return a.filter(function(c){return Jv(c,"TYPE")==b})}function Ov(a,b){a=t(a);for(var c=a.next();!c.done;c=a.next())if(c=c.value,c.name===b)return c;return null}function Pv(a,b,c){c=void 0===c?0:c;return(a=Ov(a,b))?Number(a.value):c}function Qv(a,b,c){return b?Rv(a,[b],c):[]}function Rv(a,b,c){if(!b.length)return[];b=Se(a,b);a=[];b=t(b);for(var d=b.next();!d.done;d=b.next())a.push(Sv(d.value,c));return a}
|
|
@@ -1085,23 +1087,23 @@ function $v(a){var b=a.split(":");if(2>b.length||"data"!=b[0])throw new T(2,1,10
|
|
|
1085
1087
|
cw;this.m=null;this.bb=0;this.o=Infinity;this.Fa=this.Ea=this.X=0;this.ea=new nh;this.F=new Map;this.G=new Map;this.sa=new Map;this.ma=new Map;this.L=new Map;this.na=new Map;this.za=new Map;this.Hb=this.K=!1;this.Eb=new Ta(5);this.j=null;this.T=!0;this.Da=new Set;this.aa=new hb;this.s=this.ca=null;this.Fb=function(){return!1}}q=aw.prototype;q.configure=function(a,b){this.g=a;b&&(this.Fb=b);this.j&&this.j.configure(this.g)};
|
|
1086
1088
|
q.start=function(a,b){var c=this,d;return P(function(e){return 1==e.g?(c.h=b,c.K=b.isLowLatencyMode(),G(e,dw(c,[a]).promise,2)):3!=e.g?(d=e.h,c.N=d.uri,G(e,ew(c,d.data,a),3)):e.return(c.m)})};
|
|
1087
1089
|
q.stop=function(){this.B&&(this.B.stop(),this.B=null);var a=[];this.ea&&(a.push(this.ea.destroy()),this.ea=null);this.g=this.h=null;this.vb.clear();this.m=null;this.i.clear();this.H.clear();this.G.clear();this.A.clear();this.sa.clear();this.ma.clear();this.L.clear();this.na.clear();this.za.clear();this.Da.clear();this.j&&this.j.destroy();this.aa&&(this.aa.release(),this.aa=null);return Promise.all(a)};
|
|
1088
|
-
q.update=function(){var a=this,b,c,d,e,f,g,h,k,l,m,n,p;return P(function(r){if(1==r.g){if(!fw(a))return r.return();b=[];c=Array.from(a.i.values());a.o=Infinity;a.m.gapCount=0;d=c.filter(function(u){return u.stream.segmentIndex});e=t(d);for(f=e.next();!f.done;f=e.next())g=f.value,b.push(gw(a,g));return G(r,Promise.all(b),2)}hw(a,d.map(function(u){return u.stream}));h=d.some(function(u){return 0==u.
|
|
1090
|
+
q.update=function(){var a=this,b,c,d,e,f,g,h,k,l,m,n,p;return P(function(r){if(1==r.g){if(!fw(a))return r.return();b=[];c=Array.from(a.i.values());a.o=Infinity;a.m.gapCount=0;d=c.filter(function(u){return u.stream.segmentIndex});e=t(d);for(f=e.next();!f.done;f=e.next())g=f.value,b.push(gw(a,g));return G(r,Promise.all(b),2)}hw(a,d.map(function(u){return u.stream}));h=d.some(function(u){return 0==u.dd});d.length&&!h&&(k=iw,jw(a,k.oh),l=d.map(function(u){return u.Jb}),a.l.Za(Math.min.apply(Math,x(l))),
|
|
1089
1091
|
a.h.updateDuration());h&&kw(a);m=t(d);for(n=m.next();!n.done;n=m.next())p=n.value,p.stream.segmentIndex&&!og(p.stream.segmentIndex)&&a.h.disableStream(p.stream);H(r)})};function lw(a,b){return fw(a)?a.O.get(b.type):b.Vd}
|
|
1090
1092
|
function gw(a,b){var c,d,e,f,g,h,k,l,m,n,p,r,u,v,w,y,z,D,A,B,C,E,F,J,K,L,I,N,M,O,Q,R,U,aa,la;return P(function(na){switch(na.g){case 1:c=[];d=t(b.M());for(e=d.next();!e.done;e=d.next())f=e.value,g=new ve(f),h=g.g,b.Cd&&(0<=b.pb&&h.add("_HLS_msn",String(b.pb)),0<=b.qb&&h.add("_HLS_part",String(b.qb))),b.Dd&&h.add("_HLS_skip","YES"),Ke(h)&&ze(g,h),c.push(g.toString());ua(na,2);return G(na,dw(a,c,!0).promise,4);case 4:k=na.h;ya(na,3);break;case 2:throw l=za(na),a.h&&a.h.disableStream(b.stream),l;case 3:if(!b.stream.segmentIndex)return na.return();
|
|
1091
1093
|
m=Uv(a.Ta,k.data);if(1!=m.type)throw new T(2,4,4017);n=k.uri;n==k.originalUri||b.M().includes(n)||b.Og.push(n);p=Mv(m.W,"EXT-X-DEFINE");r=mw(a,p,n);u=b.stream;v=lw(a,b);return G(na,nw(a,m,u.mimeType,b.M,r),5);case 5:w=na.h;y=w.keyIds;z=w.drmInfos;D=function(Ia,Aa){return Ia.size===Aa.size&&[].concat(x(Ia)).every(function(ab){return Aa.has(ab)})};D(u.keyIds,y)||(u.keyIds=y,u.drmInfos=z,a.h.newDrmInfo(u));A=ow(a,m,v,r,b.M,b.type);B=A.segments;if(C=A.bandwidth)u.bandwidth=C;E=Nl(u);F=t(B);for(J=F.next();!J.done;J=
|
|
1092
|
-
F.next())K=J.value,K.$&&(K.$.
|
|
1094
|
+
F.next())K=J.value,K.$&&(K.$.Kc=E);u.segmentIndex.od(B,a.l.nb());B.length&&(L=Pv(m.W,"EXT-X-MEDIA-SEQUENCE",0),N=(I=Ov(m.W,"EXT-X-SKIP"))?Number(Z(I,"SKIPPED-SEGMENTS")):0,M=pw(L,B),O=M.pb,Q=M.qb,b.pb=O+N,b.qb=Q,R=v.get(L),u.segmentIndex.Ma(R));if(U=og(u.segmentIndex))b.rc=U.startTime,aa=B[B.length-1],b.Jb=aa.endTime;if(la=Ov(m.W,"EXT-X-ENDLIST"))b.dd=!0;qw(a,m);rw(a,m.W,u.type,r,b.M);H(na)}})}q.onExpirationUpdated=function(){};q.onInitialVariantChosen=function(){};
|
|
1093
1095
|
q.banLocation=function(a){this.j&&this.j.banLocation(a)};q.setMediaElement=function(a){this.ca=a};
|
|
1094
1096
|
function sw(a,b){for(var c=-1==a.J,d=t(b),e=d.next();!e.done;e=d.next()){e=e.value;var f=e.stream.segmentIndex,g=lw(a,e);if(f=og(f)){g=t(g);for(var h=g.next();!h.done;h=g.next()){h=t(h.value);var k=h.next().value;if(h.next().value==f.startTime){c&&(a.J=Math.max(a.J,k));e.Qe=k;break}}}}if(!(0>a.J))for(b=t(b),c=b.next();!c.done;c=b.next())if(c=c.value,tw(a,c.type)&&(d=c.stream.segmentIndex))if(e=a.J-c.Qe,0<e&&(d.g.splice(0,e),d=og(d)))d=-d.startTime,c.stream.segmentIndex.offset(d),uw(a,c,d)}
|
|
1095
1097
|
function vw(a,b){if(Infinity==a.ga){b=t(b);for(var c=b.next();!c.done;c=b.next())c=og(c.value.stream.segmentIndex),null!=c&&null!=c.h&&(a.ga=Math.min(a.ga,c.h))}b=a.ga;if(Infinity!=b){c=t(a.i.values());for(var d=c.next();!d.done;d=c.next())if(d=d.value,!tw(a,d.type)){var e=d.stream.segmentIndex;if(null!=e){var f=og(e);if(f)if(null==f.h)Ya("Missing EXT-X-PROGRAM-DATE-TIME for stream",d.M(),"Expect AV sync issues!");else for(uw(a,d,f.h-b-f.startTime),d=t(e),e=d.next();!e.done;e=d.next())e.value.Uf(b)}}}}
|
|
1096
1098
|
function uw(a,b,c){b.rc+=c;b.Jb+=c;a=lw(a,b);for(var d=t(a),e=d.next();!e.done;e=d.next()){var f=t(e.value);e=f.next().value;f=f.next().value;a.set(e,f+c)}b.M()}
|
|
1097
1099
|
function ew(a,b,c){var d,e,f,g,h,k,l,m,n,p,r,u,v,w,y,z,D,A,B,C,E,F,J,K,L,I,N,M,O,Q,R,U,aa;return P(function(la){switch(la.g){case 1:d=$e;e=Uv(a.Ta,b);f=Mv(e.W,"EXT-X-DEFINE");g=[];h=[];k=[];a.l=new Mk(null,0);a.l.vc(!0);l=function(){return[c]};m=null;n=new Map;if(1==e.type)return a.T=!1,A=Mv(e.W,"EXT-X-DEFINE"),n=mw(a,A,a.N),m=d.ja,B="",C=new Map,G(la,ww(a,a.C++,n,e,l,"",m,B,!0,"Media Playlist",null,C,null,!1,null,!1),7);xw(a,f);p=Mv(e.W,"EXT-X-MEDIA");r=Mv(e.W,"EXT-X-STREAM-INF");u=Mv(e.W,"EXT-X-IMAGE-STREAM-INF");
|
|
1098
|
-
v=Mv(e.W,"EXT-X-I-FRAME-STREAM-INF");w=Mv(e.W,"EXT-X-SESSION-KEY");y=Mv(e.W,"EXT-X-SESSION-DATA");z=Mv(e.W,"EXT-X-CONTENT-STEERING");yw(a,y);return G(la,zw(a,z),4);case 4:return Aw(a,r),Bw(a,p),D=Cw(a,v),G(la,Dw(a,r,w,p,l,a.A,D),5);case 5:return g=la.h,h=Ew(a,p),G(la,Fw(a,u,v),6);case 6:k=la.h;la.u(3);break;case 7:E=la.h,a.i.set(c,E),E.stream&&(F=Nl(E.stream),E.stream.segmentIndex.Gb(function(na){na.$&&(na.$.
|
|
1100
|
+
v=Mv(e.W,"EXT-X-I-FRAME-STREAM-INF");w=Mv(e.W,"EXT-X-SESSION-KEY");y=Mv(e.W,"EXT-X-SESSION-DATA");z=Mv(e.W,"EXT-X-CONTENT-STEERING");yw(a,y);return G(la,zw(a,z),4);case 4:return Aw(a,r),Bw(a,p),D=Cw(a,v),G(la,Dw(a,r,w,p,l,a.A,D),5);case 5:return g=la.h,h=Ew(a,p),G(la,Fw(a,u,v),6);case 6:k=la.h;la.u(3);break;case 7:E=la.h,a.i.set(c,E),E.stream&&(F=Nl(E.stream),E.stream.segmentIndex.Gb(function(na){na.$&&(na.$.Kc=F)})),m=E.stream.type,g.push({id:0,language:Hf(B||"und"),disabledUntilTime:0,primary:!0,
|
|
1099
1101
|
audio:"audio"==m?E.stream:null,video:"video"==m?E.stream:null,bandwidth:E.stream.bandwidth||0,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]});case 3:if(!a.h)throw new T(2,7,7001);Gw(a,e);1==e.type&&(fw(a)&&(Hw(a,e),J=a.o,a.B.Z(J)),K=Array.from(a.i.values()),Iw(a,K),kw(a),rw(a,e.W,m,n,l));a.m={presentationTimeline:a.l,variants:g,textStreams:h,imageStreams:k,offlineSessionIds:[],minBufferTime:0,sequenceMode:a.g.hls.sequenceMode,ignoreManifestTimestampsInSegmentsMode:a.g.hls.ignoreManifestTimestampsInSegmentsMode,
|
|
1100
1102
|
type:"HLS",serviceDescription:null,nextUrl:null,periodCount:1,gapCount:0,isLowLatency:!1,startTime:a.s};if(a.fa||!a.g.hls.disableCodecGuessing){la.u(8);break}L=[];I=t(a.m.variants);for(N=I.next();!N.done;N=I.next())M=N.value,M.audio&&""===M.audio.codecs&&L.push(M.audio.createSegmentIndex()),M.video&&""===M.video.codecs&&L.push(M.video.createSegmentIndex());return G(la,Promise.all(L),8);case 8:a.h.makeTextStreamsForClosedCaptions(a.m);if(1==g.length){O=[];Q=g[0];R=t([Q.video,Q.audio]);for(U=R.next();!U.done;U=
|
|
1101
1103
|
R.next())(aa=U.value)&&!aa.segmentIndex&&O.push(aa.createSegmentIndex());if(0<O.length)return G(la,Promise.all(O),0)}la.u(0)}})}
|
|
1102
1104
|
function Jw(a,b){var c,d,e,f,g,h,k,l,m,n,p,r,u,v,w,y,z,D,A,B,C,E,F;return P(function(J){switch(J.g){case 1:c=Ol(a.g.hls.mediaPlaylistFullMimeType);if(!b.length)return J.return(c);d=Kw(a,b);e=d.segment;f=d.segmentIndex;g=e.M();h=g[0];k=new ve(h);l=k.Pa.split(".").pop();if(m=Lw[l])return J.return(Ol(m));n=Ah;r=p=null;u=e.$;if(!u){J.u(2);break}v=Ul(u.M(),u.Yb(),u.Vb(),a.g.retryParameters);return G(J,Mw(a,v,n,{type:0}).promise,3);case 3:w=J.h;p=w.data;if(!u.aesKey){J.u(4);break}return G(J,Tl(p,u.aesKey,
|
|
1103
1105
|
0),5);case 5:p=J.h;case 4:(r=w.headers["content-type"])&&(r=r.split(";")[0].toLowerCase());case 2:return y=Ul(e.M(),e.Yb(),e.Vb(),a.g.retryParameters),G(J,Mw(a,y,n,{type:1}).promise,6);case 6:z=J.h;D=z.data;if(!e.aesKey){J.u(7);break}return G(J,Tl(D,e.aesKey,f),8);case 8:D=J.h;case 7:(A=z.headers["content-type"])&&(A=A.split(";")[0].toLowerCase());B="mp4 mp4a m4s m4i m4a m4f cmfa mp4v m4v cmfv fmp4".split(" ");C=["audio/mp4","video/mp4","video/iso.segment"];if(ak(Ab(D))){var K=D;var L=Ab(K);L=(new Sj).parse(L);
|
|
1104
|
-
var I=L
|
|
1106
|
+
var I=L.$c();L=L.kf();var N=[],M=!1,O=!1;switch(I.audio){case "aac":case "aac-loas":N.push("mp4a.40.2");M=!0;break;case "mp3":N.push("mp4a.40.34");M=!0;break;case "ac3":N.push("ac-3");M=!0;break;case "ec3":N.push("ec-3");M=!0;break;case "opus":N.push("opus"),M=!0}switch(I.video){case "avc":L.codec?N.push(L.codec):N.push("avc1.42E01E");O=!0;break;case "hvc":L.codec?N.push(L.codec):N.push("hvc1.1.6.L93.90");O=!0;break;case "av1":N.push("av01.0.01M.08"),O=!0}if(N.length){I=M&&!O;M=new Map;if(O){O=new Hb("video/mp2t");
|
|
1105
1107
|
O.i(K);K=t(O.j());for(var Q=K.next();!Q.done;Q=K.next())Q=Q.value,M.set(Q,Q);O.g()}L={type:I?"audio":"video",mimeType:"video/mp2t",codecs:N.join(", "),language:null,height:L.height,width:L.width,channelCount:null,sampleRate:null,closedCaptions:M,vd:null,colorGamut:null,frameRate:L.frameRate}}else L=null;if(E=L)return J.return(E)}else if(B.includes(l)||C.includes(A)||r&&C.includes(r))if(F=Pl(p,D))return J.return(F);return A?J.return(Ol(A)):r?J.return(Ol(r)):J.return(c)}})}
|
|
1106
1108
|
function kw(a){if(fw(a)){if(a.ya==Nw){for(var b=Infinity,c=Infinity,d=t(a.i.values()),e=d.next();!e.done;e=d.next())e=e.value,e.stream.segmentIndex&&"text"!=e.stream.type&&(b=Math.min(b,e.Jb),c=Math.min(c,e.rc));b=b-c||0;isNaN(a.g.availabilityWindowOverride)||(b=a.g.availabilityWindowOverride);a.l.ne(b)}}else a.l.Za(Ow(a));if(!a.l.s)for(b=t(a.i.values()),c=b.next();!c.done;c=b.next())c=c.value,!c.stream.segmentIndex||"audio"!=c.type&&"video"!=c.type||(c=og(c.stream.segmentIndex))&&c.h&&a.l.Xg(c.h);
|
|
1107
1109
|
a.l.Ud()}function xw(a,b){var c=(new ve(a.N)).g;b=t(b);for(var d=b.next();!d.done;d=b.next()){var e=d.value;d=Z(e,"NAME");var f=Z(e,"VALUE");e=Z(e,"QUERYPARAM");d&&f&&(a.A.has(d)||a.A.set(d,f));e&&(d=c.get(e)[0])&&!a.A.has(d)&&a.A.set(e,d)}}
|
|
@@ -1132,16 +1134,16 @@ function Vw(a,b){var c="video",d=Jv(b,"URI"),e=Z(b,"CODECS")||"";"mjpg"==e&&(c="
|
|
|
1132
1134
|
function ex(a,b,c,d,e,f,g,h,k){for(var l=a.C++,m=[],n=t(b),p=n.next();!p.done;p=n.next()){var r=p.value;p=Jv(r,"URI");r=Z(r,"PATHWAY-ID");a.j&&r&&Vt(a.j,l,r,p);m.push(p)}n=m.sort().join(",");if(a.i.has(n))return a.i.get(n);a:{b=Z(b[0],"CLOSED-CAPTIONS");if("video"==d){if(a.g.disableText){a.T=!1;b=null;break a}if(b){if("NONE"!=b){b=a.F.get(b);break a}a.T=!1}else if(!b&&a.F.size)for(b=t(a.F.keys()).next();!b.done;){b=a.F.get(b.value);break a}}b=null}c=Ve(d,c);d=gx(a,l,m,c,d,e,!1,f,g,b,h,!1,k,!1);a.i.set(n,
|
|
1133
1135
|
d);return d}
|
|
1134
1136
|
function gx(a,b,c,d,e,f,g,h,k,l,m,n,p,r){function u(B){var C,E,F,J,K,L,I,N,M,O,Q,R,U,aa,la,na,Ia,Aa,ab,Va,xa,wa,Dc;return P(function(eb){switch(eb.g){case 1:return C=$e,ua(eb,2),E=z.M(),G(eb,B.promise,4);case 4:F=eb.h;if(B.aborted)return eb.return();J=F.uri;J==F.originalUri||E.includes(J)||y.push(J);K=Uv(a.Ta,F.data);if(1!=K.type)throw new T(2,4,4017);L=Mv(K.W,"EXT-X-DEFINE");I=mw(a,L,J);N=!1;(!a.fa&&a.g.hls.disableCodecGuessing||a.T&&e==C.ja&&!a.g.hls.disableClosedCaptionsDetection)&&0<K.segments.length&&
|
|
1135
|
-
(a.T=!1,N=!0);M=!a.fa&&a.g.hls.disableCodecGuessing;O=fw(a);return G(eb,ww(a,0,I,K,v,d,e,f,g,h,k,l,m,n,p,r,void 0,N,M),5);case 5:Q=eb.h;if(B.aborted)return eb.return();R=Q.stream;Gw(a,K);fw(a)&&!O&&Hw(a,K);z.rc=Q.rc;z.Jb=Q.Jb;z.Dd=Q.Dd;z.Cd=Q.Cd;z.
|
|
1137
|
+
(a.T=!1,N=!0);M=!a.fa&&a.g.hls.disableCodecGuessing;O=fw(a);return G(eb,ww(a,0,I,K,v,d,e,f,g,h,k,l,m,n,p,r,void 0,N,M),5);case 5:Q=eb.h;if(B.aborted)return eb.return();R=Q.stream;Gw(a,K);fw(a)&&!O&&Hw(a,K);z.rc=Q.rc;z.Jb=Q.Jb;z.Dd=Q.Dd;z.Cd=Q.Cd;z.dd=Q.dd;z.Vd=Q.Vd;z.pb=Q.pb;z.qb=Q.qb;z.wf=!0;w.segmentIndex=R.segmentIndex;w.encrypted=R.encrypted;w.drmInfos=R.drmInfos;w.keyIds=R.keyIds;w.mimeType=R.mimeType;w.bandwidth=w.bandwidth||R.bandwidth;w.codecs=w.codecs||R.codecs;w.closedCaptions=w.closedCaptions||
|
|
1136
1138
|
R.closedCaptions;w.width=w.width||R.width;w.height=w.height||R.height;w.hdr=w.hdr||R.hdr;w.colorGamut=w.colorGamut||R.colorGamut;w.frameRate=w.frameRate||R.frameRate;"und"==w.language&&"und"!=R.language&&(w.language=R.language);w.language=w.language||R.language;w.channelsCount=w.channelsCount||R.channelsCount;w.audioSamplingRate=w.audioSamplingRate||R.audioSamplingRate;Tw(w);w.drmInfos.length&&a.h.newDrmInfo(w);U=!1;if(!l&&w.closedCaptions||l&&w.closedCaptions&&l.size!=w.closedCaptions.size)U=!0;
|
|
1137
|
-
a.m&&U&&a.h.makeTextStreamsForClosedCaptions(a.m);if(e==C.ja||e==C.Y)for(aa=t(a.i.values()),la=aa.next();!la.done;la=aa.next())na=la.value,na.wf||na.type!=e||(na.stream.mimeType=R.mimeType,Tw(na.stream));e==C.va&&(Ia=og(R.segmentIndex))&&Ia.$&&(w.mimeType="application/mp4",Tw(w));Aa=Nl(w);w.segmentIndex.Gb(function(Tb){Tb.$&&(Tb.$.
|
|
1138
|
-
K.W,w.type,I,v);a.m&&(a.m.startTime=a.s);ya(eb,0);break;case 2:wa=za(eb);w.closeSegmentIndex();if(7001===wa.code)return eb.return();Dc=a.h.disableStream(w);if(!Dc)throw wa;H(eb)}})}function v(){return a.j&&1<c.length?Wt(a.j,b):y.concat(Rv([a.N],c,a.A))}var w=ix(a,d,e,f,g,h,k,l,m,n,p,r),y=[],z={stream:w,type:e,Og:y,M:v,rc:0,Jb:0,Vd:new Map,Dd:!1,Cd:!1,
|
|
1139
|
+
a.m&&U&&a.h.makeTextStreamsForClosedCaptions(a.m);if(e==C.ja||e==C.Y)for(aa=t(a.i.values()),la=aa.next();!la.done;la=aa.next())na=la.value,na.wf||na.type!=e||(na.stream.mimeType=R.mimeType,Tw(na.stream));e==C.va&&(Ia=og(R.segmentIndex))&&Ia.$&&(w.mimeType="application/mp4",Tw(w));Aa=Nl(w);w.segmentIndex.Gb(function(Tb){Tb.$&&(Tb.$.Kc=Aa)});hx(a)&&(a.$b?Iw(a,[z]):(a.$b=!0,ab=Array.from(a.i.values()),Va=ab.filter(function(Tb){return Tb.stream.segmentIndex}),Iw(a,Va),kw(a),xa=a.o,0<xa&&a.B.Z(xa)));rw(a,
|
|
1140
|
+
K.W,w.type,I,v);a.m&&(a.m.startTime=a.s);ya(eb,0);break;case 2:wa=za(eb);w.closeSegmentIndex();if(7001===wa.code)return eb.return();Dc=a.h.disableStream(w);if(!Dc)throw wa;H(eb)}})}function v(){return a.j&&1<c.length?Wt(a.j,b):y.concat(Rv([a.N],c,a.A))}var w=ix(a,d,e,f,g,h,k,l,m,n,p,r),y=[],z={stream:w,type:e,Og:y,M:v,rc:0,Jb:0,Vd:new Map,Dd:!1,Cd:!1,dd:!1,Qe:-1,pb:-1,qb:-1,wf:!1},D=null,A;w.createSegmentIndex=function(){if(D)return D;A=dw(a,z.M(),!0);return D=new Promise(function(B){B(u(A))})};w.closeSegmentIndex=
|
|
1139
1141
|
function(){D&&!w.segmentIndex&&A.abort();w.segmentIndex&&(w.segmentIndex.release(),w.segmentIndex=null);D=null};return z}function Ow(a){var b=Infinity;a=t(a.i.values());for(var c=a.next();!c.done;c=a.next())c=c.value,c.stream.segmentIndex&&"text"!=c.stream.type&&(b=Math.min(b,c.Jb));return b}function hw(a,b){var c=[];b=t(b);for(var d=b.next();!d.done;d=b.next())d=d.value,d.segmentIndex&&d.segmentIndex.Gb(function(e){c.push(e)});a.l.qd(c)}
|
|
1140
1142
|
function Iw(a,b){if(!fw(a))for(var c=Ow(a),d=t(b),e=d.next();!e.done;e=d.next())e.value.stream.segmentIndex.Ec(0,c);hw(a,b.map(function(f){return f.stream}));a.g.hls.ignoreManifestProgramDateTime?sw(a,b):(vw(a,b),0<a.g.hls.ignoreManifestProgramDateTimeForTypes.length&&sw(a,b))}function tw(a,b){return a.g.hls.ignoreManifestProgramDateTime?!0:a.g.hls.ignoreManifestProgramDateTimeForTypes.includes(b)}
|
|
1141
1143
|
function hx(a){if(!a.m)return!1;var b=[],c=[];a=t(a.m.variants);for(var d=a.next();!d.done;d=a.next())d=d.value,d.video&&b.push(d.video),d.audio&&c.push(d.audio);return 0<b.length&&!b.some(function(e){return e.segmentIndex})||0<c.length&&!c.some(function(e){return e.segmentIndex})?!1:!0}
|
|
1142
1144
|
function ww(a,b,c,d,e,f,g,h,k,l,m,n,p,r,u,v,w,y,z){y=void 0===y?!0:y;z=void 0===z?!0:z;var D,A,B,C,E,F,J,K,L,I,N,M,O,Q,R,U,aa,la,na,Ia,Aa,ab,Va,xa,wa,Dc,eb,Tb,Ec;return P(function(lb){switch(lb.g){case 1:D=d.segments||[];A=D.every(function(wd){return Ov(wd.W,"EXT-X-GAP")?!0:!1});if(!D.length||A)throw new T(2,4,4053);jx(a,d);fw(a)&&qw(a,d);B=fw(a)?a.O.get(g):new Map;C=ow(a,d,B,c,e,g);E=C.segments;F=C.bandwidth;N=I=L=K=J=null;if(!(0<E.length&&y)){lb.u(2);break}return G(lb,Jw(a,E),3);case 3:M=lb.h,g=
|
|
1143
1145
|
M.type,h=M.language,m=M.channelCount,u=M.sampleRate,a.g.disableText||(n=M.closedCaptions),K=M.height,J=M.width,L=M.vd,I=M.colorGamut,N=M.frameRate,z&&(w=M.mimeType,f=M.codecs);case 2:if(w){lb.u(4);break}return G(lb,kx(a,g,f,E),5);case 5:w=lb.h;case 4:return G(lb,nw(a,d,w,e,c),6);case 6:O=lb.h;Q=O.drmInfos;R=O.keyIds;U=O.encrypted;aa=O.sh;if(U&&!Q.length&&!aa)throw new T(2,4,4026);la=ix(a,f,g,h,k,l,m,n,p,r,u,v);la.encrypted=U;la.drmInfos=Q;la.keyIds=R;la.mimeType=w;F&&(la.bandwidth=F);Tw(la);"video"==
|
|
1144
|
-
g&&(J||K||L||I)&&fx(la,J,K,N,L,null,I);fw(a)&&qw(a,d);na=E[0].startTime;Ia=E[E.length-1];Aa=Ia.endTime;ab=new hl(E);la.segmentIndex=ab;xa=(Va=Ov(d.W,"EXT-X-SERVER-CONTROL"))?null!=Iv(Va,"CAN-SKIP-UNTIL"):!1;wa=Va?null!=Iv(Va,"CAN-BLOCK-RELOAD"):!1;Dc=Pv(d.W,"EXT-X-MEDIA-SEQUENCE",0);eb=pw(Dc,E);Tb=eb.pb;Ec=eb.qb;return lb.return({stream:la,type:g,Og:[],M:e,rc:na,Jb:Aa,Dd:xa,Cd:wa,
|
|
1146
|
+
g&&(J||K||L||I)&&fx(la,J,K,N,L,null,I);fw(a)&&qw(a,d);na=E[0].startTime;Ia=E[E.length-1];Aa=Ia.endTime;ab=new hl(E);la.segmentIndex=ab;xa=(Va=Ov(d.W,"EXT-X-SERVER-CONTROL"))?null!=Iv(Va,"CAN-SKIP-UNTIL"):!1;wa=Va?null!=Iv(Va,"CAN-BLOCK-RELOAD"):!1;Dc=Pv(d.W,"EXT-X-MEDIA-SEQUENCE",0);eb=pw(Dc,E);Tb=eb.pb;Ec=eb.qb;return lb.return({stream:la,type:g,Og:[],M:e,rc:na,Jb:Aa,Dd:xa,Cd:wa,dd:!1,Qe:-1,pb:Tb,qb:Ec,Vd:B,wf:!1})}})}
|
|
1145
1147
|
function pw(a,b){a=a+b.length-1;var c=-1;if(!b.length)return a++,{pb:a,qb:c};b=b[b.length-1];var d=b.g;if(!b.g.length)return a++,b.m&&(c=0),{pb:a,qb:c};c=d.length-1;d[d.length-1].isPreload()||(a++,c=0);return{pb:a,qb:c}}
|
|
1146
1148
|
function ix(a,b,c,d,e,f,g,h,k,l,m,n){var p=Rw(c,b)||Sw(c),r=[];if(k){k=t(k.split(","));for(var u=k.next();!u.done;u=k.next())r.push(u.value)}k=void 0;u=null;c==Ye?k=r.includes("public.accessibility.transcribes-spoken-dialog")&&r.includes("public.accessibility.describes-music-and-sound")?"caption":"subtitle":r.includes("public.accessibility.describes-video")&&(u="visually impaired");r.length||"subtitle"!==k||r.push("subtitle");a={id:a.C++,originalId:f,groupId:null,createSegmentIndex:function(){return Promise.resolve()},
|
|
1147
1149
|
segmentIndex:null,mimeType:p,codecs:b,kind:c==Ye?"subtitle":void 0,encrypted:!1,drmInfos:[],keyIds:new Set,language:Hf(d||"und"),originalLanguage:d,label:f,type:c,primary:e,trickModeVideo:null,emsgSchemeIdUris:null,frameRate:void 0,pixelAspectRatio:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:r,forced:l,channelsCount:g,audioSamplingRate:m,spatialAudio:n,closedCaptions:h,hdr:void 0,colorGamut:void 0,videoLayout:void 0,tilesLayout:void 0,accessibilityPurpose:u,external:!1,fastSwitching:!1,
|
|
@@ -1157,8 +1159,8 @@ function lx(a,b,c,d,e){var f=Ov(c,"EXT-X-MAP");if(!f)return null;var g=Jv(f,"URI
|
|
|
1157
1159
|
function ox(a,b,c,d){var e=0,f=null;b=Z(b,"BYTERANGE");!b&&c&&(b=c.value);b&&(e=b.split("@"),f=Number(e[0]),e=Number(e[1]),f=e+f-1,d&&(c=f+1-e,c%16&&(f+=16-c%16)));return new Wi(function(){return a},e,f,null,null,null,d)}
|
|
1158
1160
|
function px(a,b,c,d,e,f,g,h,k){function l(U){U=(new ve(U)).Pa.split(".").pop();var aa=qx[g][U];aa||(aa=Lw[U]);return aa}var m=d.W,n=Ov(m,"EXTINF"),p=0,r=0,u=null;d.Ab.length&&(a.m.isLowLatency=!0);var v=null;if(!a.g.hls.ignoreManifestProgramDateTime){var w=Ov(m,"EXT-X-PROGRAM-DATE-TIME");w&&w.value&&(v=nd(w.value))}var y=bj;Ov(m,"EXT-X-GAP")&&(a.m.gapCount++,y=2);if(!n){if(0==d.Ab.length)throw new T(2,4,4024,"EXTINF");if(!a.K)return null}var z=[];w=!1;var D=null,A=!1,B=!1;if(a.K&&d.Ab.length){p=b&&
|
|
1159
1161
|
window.ReadableStream&&a.g.hls.allowLowLatencyByteRangeOptimization;for(var C=v,E={},F=0;F<d.Ab.length;E={ue:void 0,de:void 0},F++){var J=d.Ab[F],K=0==F?c:z[z.length-1],L=0==F?e:K.endTime,I=Number(Z(J,"DURATION"))||a.X;if(I){var N=L+I,M=0,O=null;"EXT-X-PRELOAD-HINT"==J.name?(M=(M=Z(J,"BYTERANGE-START"))?Number(M):0,(K=Z(J,"BYTERANGE-LENGTH"))?O=M+Number(K)-1:M&&(O=Number.MAX_SAFE_INTEGER)):(M=Z(J,"BYTERANGE"),O=t(rx(K,M)),M=O.next().value,O=O.next().value);E.de=Z(J,"URI");if(E.de){K=bj;"YES"==Z(J,
|
|
1160
|
-
"GAP")&&(a.m.gapCount++,K=2,A=!0);E.ue=null;var Q=function(U){return function(){null==U.ue&&(U.ue=Qv(h(),U.de,f));return U.ue}}(E);p&&0<=M&&null!=O&&(D=Q,w=!0);L=new
|
|
1161
|
-
(w=!1,D=null):z=[]);(n=Ov(m,"EXT-X-BYTERANGE"))?(u=t(rx(c,n.value)),r=u.next().value,u=u.next().value):z.length&&(r=z[0].Ga,u=z[z.length-1].ua);c="";n=null;"image"==g&&(c="1x1",m=Ov(m,"EXT-X-TILES"))&&(c=Jv(m,"LAYOUT"),(m=Z(m,"DURATION"))&&(n=Number(m)));var R=null;b=new
|
|
1162
|
+
"GAP")&&(a.m.gapCount++,K=2,A=!0);E.ue=null;var Q=function(U){return function(){null==U.ue&&(U.ue=Qv(h(),U.de,f));return U.ue}}(E);p&&0<=M&&null!=O&&(D=Q,w=!0);L=new Yi(L,N,Q,M,O,b,0,0,Infinity,[],"",null,C,K,k);"EXT-X-PRELOAD-HINT"==J.name&&(L.xf(),B=!0);"YES"!=Z(J,"INDEPENDENT")&&0<F&&L.Jc();if(E=l(E.de))L.mimeType=E,sx.has(E)&&(L.$=null);z.push(L);C&&(C+=I)}}}}if(n){n=Number(n.value.split(",")[0]);if(0==n)return null;p=e+n}else if(z.length)p=z[z.length-1].endTime;else return null;w&&(A||0!=z[0].Ga?
|
|
1163
|
+
(w=!1,D=null):z=[]);(n=Ov(m,"EXT-X-BYTERANGE"))?(u=t(rx(c,n.value)),r=u.next().value,u=u.next().value):z.length&&(r=z[0].Ga,u=z[z.length-1].ua);c="";n=null;"image"==g&&(c="1x1",m=Ov(m,"EXT-X-TILES"))&&(c=Jv(m,"LAYOUT"),(m=Z(m,"DURATION"))&&(n=Number(m)));var R=null;b=new Yi(e,p,function(){if(D)return D();null==R&&(R=Qv(h(),d.g,f));return R||[]},r,u,b,0,0,Infinity,z,c,n,v,y,k,0<z.length&&!!d.g);if(e=l(d.g))b.mimeType=e,sx.has(e)&&(b.$=null);w&&(a.Hb=!0,b.Eg(),B&&b.xf());return b}
|
|
1162
1164
|
function rx(a,b){var c=0,d=null;b&&(c=b.split("@"),b=Number(c[0]),c=c[1]?Number(c[1]):a.ua+1,d=c+b-1);return[c,d]}
|
|
1163
1165
|
function rw(a,b,c,d,e){if("video"==c||"audio"==c){var f=a.l.m;if(f&&!tw(a,c))for(b=Mv(b,"EXT-X-DATERANGE"),b=b.sort(function(v,w){v=Jv(v,"START-DATE");w=Jv(w,"START-DATE");return v<w?-1:v>w?1:0}),c=0;c<b.length;c++){var g=b[c],h=Jv(g,"ID");if(!a.Da.has(h)){var k=Jv(g,"START-DATE"),l=nd(k);if(!isNaN(l)){k=Math.max(0,l-f);var m=null,n=Z(g,"END-DATE");if(n&&(n=nd(n),!isNaN(n)&&(m=n-f,0>m)))continue;if(null==m&&(n=Z(g,"DURATION")||Z(g,"PLANNED-DURATION"))&&(n=parseFloat(n),isNaN(n)||(m=k+n),0>l-f+n))continue;
|
|
1164
1166
|
n=Z(g,"CLASS")||"com.apple.quicktime.HLS";var p="YES"==Z(g,"END-ON-NEXT");if(null==m&&p){for(p=c+1;p<b.length;p++){var r=Z(b[p],"CLASS")||"com.apple.quicktime.HLS";if(n==r&&(r=Jv(b[p],"START-DATE"),r=nd(r),!isNaN(r)&&r&&r>l)){m=Math.max(0,r-f);break}}if(null==m)continue}l=["CLASS","START-DATE","END-DATE","DURATION","END-ON-NEXT"];p=[];g=t(g.attributes);for(r=g.next();!r.done;r=g.next())if(r=r.value,!l.includes(r.name)){var u=Sv(r.value,d);if("X-ASSET-URI"==r.name||"X-ASSET-LIST"==r.name)u=Qv(e(),
|
|
@@ -1215,7 +1217,7 @@ w.createSegmentIndex=function(){if(w.segmentIndex)return Promise.resolve();if(a.
|
|
|
1215
1217
|
y),w,b,d);w.segmentIndex=new hl(y);return Promise.resolve()};w.closeSegmentIndex=function(){w.segmentIndex&&(w.segmentIndex.release(),w.segmentIndex=null)};return w}
|
|
1216
1218
|
function dy(a,b,c,d){if(a=a.attributes.CodecPrivateData)return a;if("audio"!==b)return null;b=d.channelsCount||2;a=d.audioSamplingRate||44100;var e={96E3:0,88200:1,64E3:2,48E3:3,44100:4,32E3:5,24E3:6,22050:7,16E3:8,12E3:9,11025:10,8E3:11,7350:12};d=e[a];if("AACH"===c)return c=new Uint8Array(4),a=e[2*a],c[0]=40|d>>1,c[1]=d<<7|b<<3|a>>1,c[2]=a<<7|8,c[3]=0,b=new Uint16Array(2),b[0]=(c[0]<<8)+c[1],b[1]=(c[2]<<8)+c[3],b[0].toString(16)+b[1].toString(16);c=new Uint8Array(2);c[0]=16|d>>1;c[1]=d<<7|b<<3;
|
|
1217
1219
|
b=new Uint16Array(1);b[0]=(c[0]<<8)+c[1];return b[0].toString(16)}function ey(a,b){var c=0;"AACH"===a&&(c=5);b?0===c&&(c=(parseInt(b.substr(0,2),16)&248)>>3):(c=2,"AACH"===a&&(c=5));return"mp4a.40."+c}function fy(a){var b=/00000001[0-9]7/.exec(a);return b.length&&a?"avc1."+a.substr(a.indexOf(b[0])+10,6):""}
|
|
1218
|
-
function gy(a,b,c,d,e){var f=d.attributes.Url.replace("{bitrate}",String(c.bandwidth));d=[];e=t(e);for(var g=e.next(),h={};!g.done;h={pe:void 0},g=e.next())h.pe=g.value,d.push(new
|
|
1220
|
+
function gy(a,b,c,d,e){var f=d.attributes.Url.replace("{bitrate}",String(c.bandwidth));d=[];e=t(e);for(var g=e.next(),h={};!g.done;h={pe:void 0},g=e.next())h.pe=g.value,d.push(new Yi(h.pe.start,h.pe.end,function(k){return function(){return Se(a.l,[f.replace("{start time}",String(k.pe.Zf))])}}(h),0,null,b,0,0,c.mssPrivateData.duration));return d}S("shaka.mss.MssParser",Yx);var cy="AAC AACL AACH AACP AVC1 H264 TTML DFXP".split(" "),by={CAPT:"main",SUBT:"alternate",DESC:"main"};
|
|
1219
1221
|
Ri["application/vnd.ms-sstr+xml"]=function(){return new Yx};function hy(a,b,c,d,e,f){if(200<=c&&299>=c&&202!=c)return{uri:e||d,originalUri:d,data:b,status:c,headers:a,fromCache:!!a["x-shaka-from-cache"]};var g=null;try{g=Hc(b)}catch(h){}throw new T(401==c||403==c?2:1,1,1001,d,c,g,a,f,e||d);};function iy(){}
|
|
1220
1222
|
function jy(a,b,c,d,e,f){var g=new ky;Gh(b.headers).forEach(function(m,n){g.append(n,m)});var h=new ly,k={ig:!1,ih:!1};a=my(a,c,{body:b.body||void 0,headers:g,method:b.method,signal:h.signal,credentials:b.allowCrossSiteCredentials?"include":void 0},k,d,e,b.streamDataCallback,f.minBytesForProgressEvents||0);a=new bh(a,function(){k.ig=!0;h.abort();return Promise.resolve()});if(b=b.retryParameters.timeout){var l=new $b(function(){k.ih=!0;h.abort()});l.Z(b/1E3);a.finally(function(){l.stop()})}return a}
|
|
1221
1223
|
function my(a,b,c,d,e,f,g,h){var k,l,m,n,p,r,u,v,w,y,z,D,A;return P(function(B){switch(B.g){case 1:return k=ny,l=oy,r=p=0,u=Date.now(),ua(B,2),G(B,k(a,c),4);case 4:m=B.h;f(py(m.headers));if("HEAD"==c.method){B.u(5);break}v=m.clone().body.getReader();y=(w=m.headers.get("Content-Length"))?parseInt(w,10):0;z=function(C){function E(){var F,J,K,L;return P(function(I){switch(I.g){case 1:return ua(I,2),G(I,v.read(),4);case 4:F=I.h;ya(I,3);break;case 2:return za(I),I.return();case 3:if(F.done){I.u(5);break}p+=
|
|
@@ -1229,7 +1231,7 @@ function Dy(a,b,c,d,e,f){Dh(a.i);var g=(a.j.get(b)||Promise.resolve()).then(func
|
|
|
1229
1231
|
function Ey(a,b){var c,d,e,f;return P(function(g){if(1==g.g)return c=Ah,d=a.o.request(c,b),e=function(){return d.abort()},a.h.push(e),G(g,d.promise,2);f=g.h;Ob(a.h,e);return g.return(f.data)})};function Gy(a,b){var c=this;this.i=a;this.h=a.objectStore(b);this.g=new ah;a.onabort=function(d){d.preventDefault();c.g.reject()};a.onerror=function(d){d.preventDefault();c.g.reject()};a.oncomplete=function(){c.g.resolve()}}Gy.prototype.abort=function(){var a=this;return P(function(b){if(1==b.g){try{a.i.abort()}catch(c){}ua(b,2);return G(b,a.g,4)}if(2!=b.g)return ya(b,0);za(b);H(b)})};
|
|
1230
1232
|
function Hy(a,b){return new Promise(function(c,d){var e=a.h.openCursor();e.onerror=d;e.onsuccess=function(){var f;return P(function(g){if(1==g.g){if(null==e.result)return c(),g.return();f=e.result;return G(g,b(f.key,f.value,f),2)}f.continue();H(g)})}})}Gy.prototype.store=function(){return this.h};Gy.prototype.promise=function(){return this.g};function Iy(a){this.h=a;this.g=[]}Iy.prototype.destroy=function(){return Promise.all(this.g.map(function(a){return a.abort()}))};function Jy(a,b){return Ky(a,b,"readwrite")}function Ky(a,b,c){c=a.h.transaction([b],c);var d=new Gy(c,b);a.g.push(d);d.promise().then(function(){Ob(a.g,d)},function(){Ob(a.g,d)});return d};function Ly(a,b,c){this.h=new Iy(a);this.i=b;this.g=c}q=Ly.prototype;q.destroy=function(){return this.h.destroy()};q.hasFixedKeySpace=function(){return!0};q.addSegments=function(){return My(this.i)};q.removeSegments=function(a,b){return Ny(this,this.i,a,b)};q.getSegments=function(a){var b=this,c;return P(function(d){if(1==d.g)return G(d,Oy(b,b.i,a),2);c=d.h;return d.return(c.map(function(e){return b.lg(e)}))})};q.addManifests=function(){return My(this.g)};
|
|
1231
1233
|
q.updateManifest=function(){return Promise.reject(new T(2,9,9016,"Cannot modify values in "+this.g))};function Py(a,b,c){a=Jy(a.h,a.g);var d=a.store();d.get(b).onsuccess=function(){d.put(c,b)};return a.promise()}q.updateManifestExpiration=function(a,b){var c=Jy(this.h,this.g),d=c.store();d.get(a).onsuccess=function(e){if(e=e.target.result)e.expiration=b,d.put(e,a)};return c.promise()};q.removeManifests=function(a,b){return Ny(this,this.g,a,b)};
|
|
1232
|
-
q.getManifests=function(a){var b=this,c;return P(function(d){if(1==d.g)return G(d,Oy(b,b.g,a),2);c=d.h;return d.return(Promise.all(c.map(function(e){return b.
|
|
1234
|
+
q.getManifests=function(a){var b=this,c;return P(function(d){if(1==d.g)return G(d,Oy(b,b.g,a),2);c=d.h;return d.return(Promise.all(c.map(function(e){return b.Xc(e)})))})};q.getAllManifests=function(){var a=this,b,c;return P(function(d){return 1==d.g?(b=Ky(a.h,a.g,"readonly"),c=new Map,G(d,Hy(b,function(e,f){var g;return P(function(h){if(1==h.g)return G(h,a.Xc(f),2);g=h.h;c.set(e,g);H(h)})}),2)):3!=d.g?G(d,b.promise(),3):d.return(c)})};q.lg=function(a){return a};q.Xc=function(a){return Promise.resolve(a)};
|
|
1233
1235
|
function My(a){return Promise.reject(new T(2,9,9011,"Cannot add new value to "+a))}q.add=function(a,b){var c=this,d,e,f,g,h,k,l;return P(function(m){if(1==m.g){d=Jy(c.h,a);e=d.store();f=[];g=t(b);h=g.next();for(k={};!h.done;k={If:void 0},h=g.next())l=h.value,k.If=e.add(l),k.If.onsuccess=function(n){return function(){f.push(n.If.result)}}(k);return G(m,d.promise(),2)}return m.return(f)})};
|
|
1234
1236
|
function Ny(a,b,c,d){a=Jy(a.h,b);b=a.store();c=t(c);for(var e=c.next(),f={};!e.done;f={tf:void 0},e=c.next())f.tf=e.value,b.delete(f.tf).onsuccess=function(g){return function(){return d(g.tf)}}(f);return a.promise()}
|
|
1235
1237
|
function Oy(a,b,c){var d,e,f,g,h,k,l;return P(function(m){if(1==m.g){d=Ky(a.h,b,"readonly");e=d.store();f={};g=[];h=t(c);k=h.next();for(l={};!k.done;l={ie:void 0,Qd:void 0},k=h.next())l.Qd=k.value,l.ie=e.get(l.Qd),l.ie.onsuccess=function(n){return function(){void 0==n.ie.result&&g.push(n.Qd);f[n.Qd]=n.ie.result}}(l);return G(m,d.promise(),2)}if(g.length)throw new T(2,9,9012,"Could not find values for "+g);return m.return(c.map(function(n){return f[n]}))})};function Qy(a){this.g=new Iy(a)}Qy.prototype.destroy=function(){return this.g.destroy()};Qy.prototype.getAll=function(){var a=this,b,c;return P(function(d){return 1==d.g?(b=Ky(a.g,"session-ids","readonly"),c=[],G(d,Hy(b,function(e,f){c.push(f)}),2)):3!=d.g?G(d,b.promise(),3):d.return(c)})};Qy.prototype.add=function(a){var b=Jy(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()};
|
|
@@ -1237,17 +1239,17 @@ Qy.prototype.remove=function(a){var b=this,c;return P(function(d){return 1==d.g?
|
|
|
1237
1239
|
function Ty(a){var b=null;a.g.forEach(function(c,d){c.getCells().forEach(function(e,f){e.hasFixedKeySpace()||b||(b={path:{ob:d,Ha:f},Ha:e})})});if(b)return b;throw new T(2,9,9013,"Could not find a cell that supports add-operations");}function Uy(a,b){a.g.forEach(function(c,d){c.getCells().forEach(function(e,f){b({ob:d,Ha:f},e)})})}
|
|
1238
1240
|
function Vy(a,b,c){a=a.g.get(b);if(!a)throw new T(2,9,9013,"Could not find mechanism with name "+b);b=a.getCells().get(c);if(!b)throw new T(2,9,9013,"Could not find cell with name "+c);return b}function Wy(a,b){a.g.forEach(function(c){b(c.getEmeSessionCell())})}function Xy(a){var b=Array.from(a.g.keys());if(!b.length)throw new T(2,9,9E3,"No supported storage mechanisms found");return a.g.get(b[0]).getEmeSessionCell()}
|
|
1239
1241
|
function Yy(a){var b,c,d;return P(function(e){return 1==e.g?(b=Array.from(a.g.values()),c=0<b.length,c||(d=Sy,d.forEach(function(f){(f=f())&&b.push(f)})),G(e,Promise.all(b.map(function(f){return f.erase()})),2)):c?e.u(0):G(e,Promise.all(b.map(function(f){return f.destroy()})),0)})}function Zy(a,b){Sy.set(a,b)}S("shaka.offline.StorageMuxer",Ry);Ry.unregister=function(a){Sy.delete(a)};Ry.register=Zy;Ry.prototype.destroy=Ry.prototype.destroy;var Sy=new Map;function $y(){Ly.apply(this,arguments)}qa($y,Ly);$y.prototype.updateManifestExpiration=function(a,b){var c=this,d,e,f;return P(function(g){d=Jy(c.h,c.g);e=d.store();f=new ah;e.get(a).onsuccess=function(h){(h=h.target.result)?(h.expiration=b,e.put(h),f.resolve()):f.reject(new T(2,9,9012,"Could not find values for "+a))};return G(g,Promise.all([d.promise(),f]),0)})};
|
|
1240
|
-
$y.prototype.
|
|
1242
|
+
$y.prototype.Xc=function(a){var b,c,d,e,f,g;return P(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=az(a.periods[c],e),b.push(f);return G(h,gu(b),2)}g=h.h;return h.return({creationTime:0,originalManifestUri:a.originalManifestUri,duration:a.duration,size:a.size,expiration:null==a.expiration?Infinity:a.expiration,streams:g,sessionIds:a.sessionIds,drmInfo:a.drmInfo,appMetadata:a.appMetadata,sequenceMode:!1})})};
|
|
1241
1243
|
function az(a,b){bz(a);for(var c=t(a.streams),d=c.next();!d.done;d=c.next());return a.streams.map(function(e){return cz(e,a.startTime,b)})}
|
|
1242
1244
|
function cz(a,b,c){var d=a.initSegmentUri?dz(a.initSegmentUri):null,e=b+a.presentationTimeOffset,f=b+c;return{id:a.id,originalId:null,groupId:null,primary:a.primary,type:a.contentType,mimeType:a.mimeType,codecs:a.codecs,frameRate:a.frameRate,pixelAspectRatio:void 0,hdr:void 0,colorGamut:void 0,videoLayout:void 0,kind:a.kind,language:a.language,originalLanguage:a.language||null,label:a.label,width:a.width,height:a.height,initSegmentKey:d,encrypted:a.encrypted,keyIds:new Set([a.keyId]),segments:a.segments.map(function(g){var h=
|
|
1243
1245
|
dz(g.uri);return{startTime:b+g.startTime,endTime:b+g.endTime,dataKey:h,initSegmentKey:d,appendWindowStart:b,appendWindowEnd:f,timestampOffset:e,tilesLayout:"",mimeType:null,codecs:null}}),variantIds:a.variantIds,roles:[],forced:!1,audioSamplingRate:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,tilesLayout:void 0,external:!1,fastSwitching:!1}}$y.prototype.lg=function(a){return{data:a.data}};
|
|
1244
1246
|
function dz(a){var b;if((b=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(a))||(b=/^offline:segment\/([0-9]+)$/.exec(a)))return Number(b[1]);throw new T(2,9,9004,"Could not parse uri "+a);}
|
|
1245
1247
|
function bz(a){var b=a.streams.filter(function(h){return"audio"==h.contentType});a=a.streams.filter(function(h){return"video"==h.contentType});if(!b.every(function(h){return h.variantIds})||!a.every(function(h){return h.variantIds})){for(var c=t(b),d=c.next();!d.done;d=c.next())d.value.variantIds=[];c=t(a);for(d=c.next();!d.done;d=c.next())d.value.variantIds=[];c=0;if(a.length&&!b.length){d=c++;for(var e=t(a),f=e.next();!f.done;f=e.next())f.value.variantIds.push(d)}if(!a.length&&b.length)for(d=c++,
|
|
1246
1248
|
e=t(b),f=e.next();!f.done;f=e.next())f.value.variantIds.push(d);if(a.length&&b.length)for(b=t(b),d=b.next();!d.done;d=b.next())for(d=d.value,e=t(a),f=e.next();!f.done;f=e.next()){f=f.value;var g=c++;d.variantIds.push(g);f.variantIds.push(g)}}};function ez(){Ly.apply(this,arguments)}qa(ez,Ly);
|
|
1247
|
-
ez.prototype.
|
|
1249
|
+
ez.prototype.Xc=function(a){var b,c,d,e,f,g;return P(function(h){if(1==h.g){b=[];for(c=0;c<a.periods.length;++c){d=c==a.periods.length-1?a.duration:a.periods[c+1].startTime;e=d-a.periods[c].startTime;for(var k=a.periods[c],l=[],m=t(k.streams),n=m.next();!n.done;n=m.next())n=n.value,0!=n.variantIds.length&&l.push(fz(n,k.startTime,k.startTime+e));f=l;b.push(f)}return G(h,gu(b),2)}g=h.h;return h.return({appMetadata:a.appMetadata,creationTime:0,drmInfo:a.drmInfo,duration:a.duration,expiration:null==a.expiration?
|
|
1248
1250
|
Infinity:a.expiration,originalManifestUri:a.originalManifestUri,sessionIds:a.sessionIds,size:a.size,streams:g,sequenceMode:!1})})};
|
|
1249
1251
|
function fz(a,b,c){return{id:a.id,originalId:a.originalId,groupId:null,primary:a.primary,type:a.contentType,mimeType:a.mimeType,codecs:a.codecs,frameRate:a.frameRate,pixelAspectRatio:a.pixelAspectRatio,hdr:void 0,colorGamut:void 0,videoLayout:void 0,kind:a.kind,language:a.language,originalLanguage:a.language||null,label:a.label,width:a.width,height:a.height,encrypted:a.encrypted,keyIds:new Set([a.keyId]),segments:a.segments.map(function(d){return{startTime:b+d.startTime,endTime:b+d.endTime,initSegmentKey:a.initSegmentKey,
|
|
1250
|
-
appendWindowStart:b,appendWindowEnd:c,timestampOffset:b-a.presentationTimeOffset,dataKey:d.dataKey,tilesLayout:"",mimeType:null,codecs:null}}),variantIds:a.variantIds,roles:[],forced:!1,audioSamplingRate:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,tilesLayout:void 0,external:!1,fastSwitching:!1}};function gz(){Ly.apply(this,arguments)}qa(gz,Ly);q=gz.prototype;q.hasFixedKeySpace=function(){return!1};q.addSegments=function(a){return this.add(this.i,a)};q.addManifests=function(a){return this.add(this.g,a)};q.updateManifest=function(a,b){return Py(this,a,b)};q.
|
|
1252
|
+
appendWindowStart:b,appendWindowEnd:c,timestampOffset:b-a.presentationTimeOffset,dataKey:d.dataKey,tilesLayout:"",mimeType:null,codecs:null}}),variantIds:a.variantIds,roles:[],forced:!1,audioSamplingRate:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,tilesLayout:void 0,external:!1,fastSwitching:!1}};function gz(){Ly.apply(this,arguments)}qa(gz,Ly);q=gz.prototype;q.hasFixedKeySpace=function(){return!1};q.addSegments=function(a){return this.add(this.i,a)};q.addManifests=function(a){return this.add(this.g,a)};q.updateManifest=function(a,b){return Py(this,a,b)};q.Xc=function(a){null==a.expiration&&(a.expiration=Infinity);return Promise.resolve(a)};function hz(){this.m=this.j=this.i=this.h=this.g=this.l=null}q=hz.prototype;
|
|
1251
1253
|
q.init=function(){var a=this,b=new ah,c=!1,d=new $b(function(){c=!0;b.reject(new T(2,9,9017))});d.Z(5);var e=window.indexedDB.open("shaka_offline_db",5);e.onsuccess=function(){if(!c){var f=e.result;a.l=f;var g=f.objectStoreNames;g=g.contains("manifest")&&g.contains("segment")?new $y(f,"segment","manifest"):null;a.g=g;g=f.objectStoreNames;g=g.contains("manifest-v2")&&g.contains("segment-v2")?new ez(f,"segment-v2","manifest-v2"):null;a.h=g;g=f.objectStoreNames;g=g.contains("manifest-v3")&&g.contains("segment-v3")?
|
|
1252
1254
|
new ez(f,"segment-v3","manifest-v3"):null;a.i=g;g=f.objectStoreNames;g=g.contains("manifest-v5")&&g.contains("segment-v5")?new gz(f,"segment-v5","manifest-v5"):null;a.j=g;f=f.objectStoreNames.contains("session-ids")?new Qy(f):null;a.m=f;d.stop();b.resolve()}};e.onupgradeneeded=function(){for(var f=e.result,g=t(["segment-v5","manifest-v5","session-ids"]),h=g.next();!h.done;h=g.next())h=h.value,f.objectStoreNames.contains(h)||f.createObjectStore(h,{autoIncrement:!0})};e.onerror=function(f){c||(b.reject(new T(2,
|
|
1253
1255
|
9,9001,e.error)),d.stop(),f.preventDefault())};return b};q.destroy=function(){var a=this;return P(function(b){switch(b.g){case 1:if(!a.g){b.u(2);break}return G(b,a.g.destroy(),2);case 2:if(!a.h){b.u(4);break}return G(b,a.h.destroy(),4);case 4:if(!a.i){b.u(6);break}return G(b,a.i.destroy(),6);case 6:if(!a.j){b.u(8);break}return G(b,a.j.destroy(),8);case 8:if(!a.m){b.u(10);break}return G(b,a.m.destroy(),10);case 10:a.l&&a.l.close(),H(b)}})};
|
|
@@ -1261,7 +1263,7 @@ function nz(a,b,c,d){for(var e=new Set,f=t(b),g=f.next();!g.done;g=f.next()){g=t
|
|
|
1261
1263
|
b.next())for(g=e.value,e=oz(a,g,d),g=t(g.variantIds),h=g.next();!h.done;h=g.next())h=f.get(h.value),h.language=e.language,h.primary=h.primary||e.primary,h.audio=e;c=t(c);for(b=c.next();!b.done;b=c.next())for(e=b.value,b=oz(a,e,d),e=t(e.variantIds),g=e.next();!g.done;g=e.next())g=f.get(g.value),g.primary=g.primary||b.primary,g.video=b;return f}
|
|
1262
1264
|
function oz(a,b,c){var d=b.segments.map(function(e){return pz(a,e,b)});c.qd(d);return{id:b.id,originalId:b.originalId,groupId:b.groupId,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new hl(d),mimeType:b.mimeType,codecs:b.codecs,width:b.width||void 0,height:b.height||void 0,frameRate:b.frameRate,pixelAspectRatio:b.pixelAspectRatio,hdr:b.hdr,colorGamut:b.colorGamut,videoLayout:b.videoLayout,kind:b.kind,encrypted:b.encrypted,drmInfos:[],keyIds:b.keyIds,language:b.language,originalLanguage:b.originalLanguage||
|
|
1263
1265
|
null,label:b.label,type:b.type,primary:b.primary,trickModeVideo:null,emsgSchemeIdUris:null,roles:b.roles,forced:b.forced,channelsCount:b.channelsCount,audioSamplingRate:b.audioSamplingRate,spatialAudio:b.spatialAudio,closedCaptions:b.closedCaptions,tilesLayout:b.tilesLayout,accessibilityPurpose:null,external:b.external,fastSwitching:b.fastSwitching,fullMimeTypes:new Set([cf(b.mimeType,b.codecs)])}}
|
|
1264
|
-
function pz(a,b,c){var d=new jz("segment",a.h,a.g,b.dataKey);a=new
|
|
1266
|
+
function pz(a,b,c){var d=new jz("segment",a.h,a.g,b.dataKey);a=new Yi(b.startTime,b.endTime,function(){return[d.toString()]},0,null,null!=b.initSegmentKey?qz(a,b.initSegmentKey):null,b.timestampOffset,b.appendWindowStart,b.appendWindowEnd,[],b.tilesLayout||"");a.mimeType=b.mimeType||c.mimeType||"";a.codecs=b.codecs||c.codecs||"";return a}function qz(a,b){var c=new jz("segment",a.h,a.g,b);return new Wi(function(){return[c.toString()]},0,null)};function rz(){this.g=null}q=rz.prototype;q.configure=function(){};
|
|
1265
1267
|
q.start=function(a,b){var c=this,d,e,f,g,h,k,l;return P(function(m){switch(m.g){case 1:d=kz(a);c.g=d;if(null==d||"manifest"!=d.g)throw new T(2,1,9004,a);e=new Ry;va(m,2);return G(m,e.init(),4);case 4:return G(m,Vy(e,d.ob(),d.Ha()),5);case 5:return f=m.h,G(m,f.getManifests([d.key()]),6);case 6:return g=m.h,h=g[0],k=new lz(d.ob(),d.Ha()),l=mz(k,h),b.makeTextStreamsForClosedCaptions(l),m.return(l);case 2:return Ba(m),G(m,e.destroy(),7);case 7:Ca(m,0)}})};q.stop=function(){return Promise.resolve()};
|
|
1266
1268
|
q.update=function(){};
|
|
1267
1269
|
q.onExpirationUpdated=function(a,b){var c=this,d,e,f,g,h,k,l;return P(function(m){switch(m.g){case 1:return d=c.g,e=new Ry,ua(m,2,3),G(m,e.init(),5);case 5:return G(m,Vy(e,d.ob(),d.Ha()),6);case 6:return f=m.h,G(m,f.getManifests([d.key()]),7);case 7:g=m.h;h=g[0];k=h.sessionIds.includes(a);l=void 0==h.expiration||h.expiration>b;if(!k||!l){m.u(3);break}return G(m,f.updateManifestExpiration(d.key(),b),3);case 3:return Ba(m),G(m,e.destroy(),10);case 10:Ca(m,0);break;case 2:za(m),m.u(3)}})};
|
|
@@ -1284,8 +1286,8 @@ function Mz(a,b,c){var d,e,f,g,h,k,l,m,n,p,r,u,v,w,y,z,D,A,B,C,E,F,J,K,L,I,N,M,O
|
|
|
1284
1286
|
e.push(mg(r));u=t(a.imageStreams);for(v=u.next();!v.done;v=u.next())w=v.value,e.push(ng(w));return G(Q,c.offline.trackSelectionCallback(e),3);case 3:y=Q.h;z=a.presentationTimeline.getDuration();D=0;A=t(y);for(B=A.next();!B.done;B=A.next())C=B.value,E=C.bandwidth*z/8,D+=E;ua(Q,4);return G(Q,c.offline.downloadSizeCallback(D),6);case 6:F=Q.h;if(!F)throw new T(2,9,9014);ya(Q,5);break;case 4:J=za(Q);if(J instanceof T)throw J;throw new T(2,9,9015);case 5:K=new Set;L=new Set;I=new Set;N=t(y);for(M=N.next();!M.done;M=
|
|
1285
1287
|
N.next())O=M.value,"variant"==O.type&&K.add(O.id),"text"==O.type&&L.add(O.id),"image"==O.type&&I.add(O.id);a.variants=a.variants.filter(function(R){return K.has(R.id)});a.textStreams=a.textStreams.filter(function(R){return L.has(R.id)});a.imageStreams=a.imageStreams.filter(function(R){return I.has(R.id)});Uz(a);H(Q)}})}
|
|
1286
1288
|
function Nz(a,b,c,d,e,f){var g=yz(c,b,d),h=e.offline.progressCallback;Cy(f,function(r,u){g.size=u;h(g,r)},function(r,u){k&&e.offline.usePersistentLicense&&l==u&&ni(a,"cenc",r)});var k=Rz(b)&&!Sz(b),l=null;k&&(l=Vz.get(a.g.keySystem));for(var m=new Bz,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())Dz(m,p.value);n=t(b.variants);for(p=n.next();!p.done;p=n.next())Cz(m,p.value);m=Wz(f,m,b,e);f=m.streams;m=m.Wf;n=a.g;p=e.offline.usePersistentLicense;
|
|
1287
|
-
n&&p&&(n.initData=[]);return{oi:{creationTime:Date.now(),originalManifestUri:c,duration:b.presentationTimeline.getDuration(),size:0,expiration:a
|
|
1288
|
-
function Sz(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 Pz(a,b,c,d){b.expiration=c
|
|
1289
|
+
n&&p&&(n.initData=[]);return{oi:{creationTime:Date.now(),originalManifestUri:c,duration:b.presentationTimeline.getDuration(),size:0,expiration:a.ad(),streams:f,sessionIds:p?wi(a):[],drmInfo:n,appMetadata:d,isIncomplete:!0,sequenceMode:b.sequenceMode,type:b.type},Wf:m}}function Rz(a){return a.variants.some(function(b){var c=b.audio&&b.audio.encrypted;return b.video&&b.video.encrypted||c})}
|
|
1290
|
+
function Sz(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 Pz(a,b,c,d){b.expiration=c.ad();c=wi(c);b.sessionIds=d.offline.usePersistentLicense?c:[];if(Rz(a)&&d.offline.usePersistentLicense&&!c.length)throw new T(2,9,9007);}q.remove=function(a){return Xz(this,Yz(this,a))};
|
|
1289
1291
|
function Yz(a,b){var c,d,e,f,g,h;return P(function(k){switch(k.g){case 1:Jz();c=kz(b);if(null==c||"manifest"!=c.g)throw new T(2,9,9004,b);d=c;e=new Ry;va(k,2);return G(k,e.init(),4);case 4:return G(k,Vy(e,d.ob(),d.Ha()),5);case 5:return f=k.h,G(k,f.getManifests([d.key()]),6);case 6:return g=k.h,h=g[0],G(k,Promise.all([Zz(a,h,e),$z(f,d,h)]),2);case 2:return Ba(k),G(k,e.destroy(),8);case 8:Ca(k,0)}})}
|
|
1290
1292
|
function aA(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:cf(e.mimeType,e.codecs),robustness:a.drmInfo.videoRobustness}):b||"audio"!=e.type||c.push({contentType:cf(e.mimeType,e.codecs),robustness:a.drmInfo.audioRobustness});return c}function Zz(a,b,c){return P(function(d){return G(d,bA(a.g,a.h.drm,c,b),0)})}
|
|
1291
1293
|
function $z(a,b,c){function d(){}var e=cA(c);Az(b,c);return Promise.all([a.removeSegments(e,d),a.removeManifests([b.key()],d)])}q.Hi=function(){return Xz(this,dA(this))};
|
|
@@ -1353,139 +1355,140 @@ function KB(a){a=a.target;if("picture-in-picture"==a.webkitPresentationMode){doc
|
|
|
1353
1355
|
function GB(){return this.webkitSupportsPresentationMode("picture-in-picture")?(this.webkitSetPresentationMode("picture-in-picture"),document.pictureInPictureElement=this,Promise.resolve()):Promise.reject(Error("PiP not allowed by video element"))}function JB(){var a=document.pictureInPictureElement;return a?(a.webkitSetPresentationMode("inline"),document.pictureInPictureElement=null,Promise.resolve()):Promise.reject(Error("No picture in picture element found"))}
|
|
1354
1356
|
function HB(){return this.hasAttribute("disablePictureInPicture")?!0:!this.webkitSupportsPresentationMode("picture-in-picture")}function IB(a){a?this.setAttribute("disablePictureInPicture",""):this.removeAttribute("disablePictureInPicture")}iA.PiPWebkit=EB;EB.install=FB;jA(FB);function LB(){}function MB(){window.crypto&&("randomUUID"in window.crypto||(window.crypto.randomUUID=NB))}function NB(){var a=URL.createObjectURL(new Blob),b=a.toString();URL.revokeObjectURL(a);return b.substr(b.lastIndexOf("/")+1)}iA.RandomUUID=LB;LB.install=MB;jA(MB);function OB(){}function PB(){var a=Symbol.prototype;"description"in a||Object.defineProperty(a,"description",{get:QB})}function QB(){var a=/\((.*)\)/.exec(this.toString());return a?a[1]:void 0}iA.Symbol=OB;OB.install=PB;jA(PB);function RB(){}function SB(){if(window.HTMLMediaElement){var a=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){var b=a.apply(this);b&&b.catch(function(){});return b}}}iA.VideoPlayPromise=RB;RB.install=SB;jA(SB);function TB(){}function UB(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;!a.getVideoPlaybackQuality&&("webkitDroppedFrameCount"in a||kc())&&(a.getVideoPlaybackQuality=VB)}}function VB(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}iA.VideoPlaybackQuality=TB;TB.install=UB;jA(UB);function WB(){}function XB(){if(!window.VTTCue&&window.TextTrackCue){var a=null,b=TextTrackCue.length;if(3==b)a=YB;else if(6==b)a=ZB;else{try{var c=!!YB(1,2,"")}catch(d){c=!1}c&&(a=YB)}a&&(window.VTTCue=function(d,e,f){return a(d,e,f)})}}function YB(a,b,c){return new window.TextTrackCue(a,b,c)}function ZB(a,b,c){return new window.TextTrackCue(a+"-"+b+"-"+c,a,b,c)}iA.VTTCue=WB;WB.install=XB;jA(XB);function $B(){}$B.prototype.parseInit=function(){};$B.prototype.setSequenceMode=function(){};$B.prototype.setManifestType=function(){};$B.prototype.parseMedia=function(a,b){var c=null,d=[];a=Cc(a).split(/\r?\n/);a=t(a);for(var e=a.next();!e.done;e=a.next())if((e=e.value)&&!/^\s+$/.test(e)&&(e=aC.exec(e))){var f=bC.exec(e[1]);f=60*parseInt(f[1],10)+parseFloat(f[2].replace(",","."));e=new Ed(f,b.segmentEnd?b.segmentEnd:f+2,e[2]);c&&(c.endTime=f,d.push(c));c=e}c&&d.push(c);return d};
|
|
1355
1357
|
S("shaka.text.LrcTextParser",$B);$B.prototype.parseMedia=$B.prototype.parseMedia;$B.prototype.setManifestType=$B.prototype.setManifestType;$B.prototype.setSequenceMode=$B.prototype.setSequenceMode;$B.prototype.parseInit=$B.prototype.parseInit;var aC=/^\[(\d{1,2}:\d{1,2}(?:[.,]\d{1,3})?)\](.*)/,bC=/^(\d+):(\d{1,2}(?:[.,]\d{1,3})?)$/;sf["application/x-subtitle-lrc"]=function(){return new $B};function cC(){}cC.prototype.parseInit=function(){};cC.prototype.setSequenceMode=function(){};cC.prototype.setManifestType=function(){};
|
|
1356
|
-
cC.prototype.parseMedia=function(a,b,c,d){var e=Cc(a);a=[];if(""==e)return a;var f=Wc(e,"tt");if(!f)throw new T(2,2,2005,"Failed to parse TTML.");e=gd(f,"body")[0];if(!e)return[];var g=md(f,dC,"frameRate"),h=md(f,dC,"subFrameRate"),k=md(f,dC,"frameRateMultiplier"),l=md(f,dC,"tickRate"),m=md(f,dC,"cellResolution"),n=f.attributes["xml:space"]||"default",p=md(f,eC,"extent");if("default"!=n&&"preserve"!=n)throw new T(2,2,2005,"Invalid xml:space value: "+n);n="default"==n;g=new fC(g,h,k,l);m=
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
(
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
g)
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
c,f,"
|
|
1369
|
-
|
|
1370
|
-
a.
|
|
1371
|
-
|
|
1372
|
-
function
|
|
1373
|
-
function
|
|
1374
|
-
function AC(a,b){a=
|
|
1358
|
+
cC.prototype.parseMedia=function(a,b,c,d){var e=Cc(a);a=[];if(""==e)return a;var f=Wc(e,"tt");if(!f)throw new T(2,2,2005,"Failed to parse TTML.");e=gd(f,"body")[0];if(!e)return[];var g=md(f,dC,"frameRate"),h=md(f,dC,"subFrameRate"),k=md(f,dC,"frameRateMultiplier"),l=md(f,dC,"tickRate"),m=md(f,dC,"cellResolution"),n=f.attributes["xml:space"]||"default",p=md(f,eC,"extent");if("default"!=n&&"preserve"!=n)throw new T(2,2,2005,"Invalid xml:space value: "+n);n="default"==n;g=new fC(g,h,k,l);m=gC(m);h=gd(f,
|
|
1359
|
+
"metadata")[0];h=(h?h.children:[]).filter(function(v){return"\n"!=v});k=gd(f,"style");f=gd(f,"region");l=[];for(var r=t(f),u=r.next();!u.done;u=r.next())(u=hC(u.value,k,p))&&l.push(u);if(dd(e,"p").length)throw new T(2,2,2001,"<p> can only be inside <div> in TTML");p=t(dd(e,"div"));for(r=p.next();!r.done;r=p.next())if(dd(r.value,"span").length)throw new T(2,2,2001,"<span> can only be inside <p> in TTML");if(b=iC(e,b,g,h,k,f,l,n,m,null,!1,c,d))b.backgroundColor||(b.backgroundColor="transparent"),a.push(b);
|
|
1360
|
+
return a};
|
|
1361
|
+
function iC(a,b,c,d,e,f,g,h,k,l,m,n,p){var r=l;if(bd(a)){if(!m)return null;var u={tagName:"span",children:[ed(a)],attributes:{},parent:null}}else u=a;for(var v=null,w=t(jC),y=w.next();!y.done&&!(v=kC(u,"backgroundImage",d,"#",y.value)[0]);y=w.next());w=null;y=md(u,jC,"backgroundImage");var z=/^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/;if(y&&z.test(y)){w=parseInt(y.split(":").pop(),10)-1;if(w>=p.length)return null;w=p[w]}else n&&y&&!y.startsWith("#")&&(z=new ve(n),y=new ve(y),(y=z.resolve(y).toString())&&
|
|
1362
|
+
(w=y));if("p"==a.tagName||v||w)m=!0;a=m;y="default"==(u.attributes["xml:space"]||(h?"default":"preserve"));z=u.children.every(bd);h=[];if(!z)for(var D=t(u.children),A=D.next();!A.done;A=D.next())(A=iC(A.value,b,c,d,e,f,g,y,k,u,m,n,p))&&h.push(A);d=null!=l;n=ed(u);n=u.children.length&&n&&/\S/.test(n);D=u.attributes.begin||u.attributes.end||u.attributes.dur;if(!(D||n||"br"==u.tagName||0!=h.length||d&&!y))return null;p=lC(u,c);n=p.start;for(p=p.end;r&&r.tagName&&"tt"!=r.tagName;)p=mC(r,c,n,p),n=p.start,
|
|
1363
|
+
p=p.end,r=r.parent;null==n&&(n=0);n+=b.periodStart;p=null==p?Infinity:p+b.periodStart;n=Math.max(n,b.segmentStart);p=Math.min(p,b.segmentEnd);if(!D&&0<h.length)for(n=Infinity,p=0,b=t(h),c=b.next();!c.done;c=b.next())c=c.value,n=Math.min(n,c.startTime),p=Math.max(p,c.endTime);if("br"==u.tagName)return e=new Ed(n,p,""),e.lineBreak=!0,e;b="";z&&(b=Lc(ed(u)||""),y&&(b=b.replace(/\s+/g," ")));b=new Ed(n,p,b);b.nestedCues=h;m||(b.isContainer=!0);k&&(b.cellResolution=k);k=kC(u,"region",f,"")[0];if(u.attributes.region&&
|
|
1364
|
+
k&&k.attributes["xml:id"]){var B=k.attributes["xml:id"];b.region=g.filter(function(C){return C.id==B})[0]}g=k;l&&d&&!u.attributes.region&&!u.attributes.style&&(g=kC(l,"region",f,"")[0]);nC(b,u,g,v,w,e,a,0==h.length);return b}
|
|
1365
|
+
function hC(a,b,c){var d=new Kb,e=a.attributes["xml:id"];if(!e)return null;d.id=e;e=null;c&&(e=oC.exec(c)||pC.exec(c));c=e?Number(e[1]):null;e=e?Number(e[2]):null;var f,g=qC(a,b,"extent");if(g){var h=(f=oC.exec(g))||pC.exec(g);null!=h&&(d.width=Number(h[1]),d.height=Number(h[2]),f||(null!=c&&(d.width=100*d.width/c),null!=e&&(d.height=100*d.height/e)),d.widthUnits=f||null!=c?Lb:0,d.heightUnits=f||null!=e?Lb:0)}if(a=qC(a,b,"origin"))if(h=(f=oC.exec(a))||pC.exec(a),null!=h)d.viewportAnchorX=Number(h[1]),
|
|
1366
|
+
d.viewportAnchorY=Number(h[2]),f?g||(d.width=100-d.viewportAnchorX,d.widthUnits=Lb,d.height=100-d.viewportAnchorY,d.heightUnits=Lb):(null!=e&&(d.viewportAnchorY=100*d.viewportAnchorY/e),null!=c&&(d.viewportAnchorX=100*d.viewportAnchorX/c)),d.viewportAnchorUnits=f||null!=c?Lb:0;return d}function rC(a){var b=a.match(/rgba\(([^)]+)\)/);return b&&(b=b[1].split(","),4==b.length)?(b[3]=String(Number(b[3])/255),"rgba("+b.join(",")+")"):a}
|
|
1367
|
+
function nC(a,b,c,d,e,f,g,h){g=g||h;"rtl"==sC(b,c,f,"direction",g)&&(a.direction="rtl");h=sC(b,c,f,"writingMode",g);"tb"==h||"tblr"==h?a.writingMode="vertical-lr":"tbrl"==h?a.writingMode="vertical-rl":"rltb"==h||"rl"==h?a.direction="rtl":h&&(a.direction=Hd);(h=sC(b,c,f,"textAlign",!0))?(a.positionAlign=tC[h],a.lineAlign=uC[h],a.textAlign=ee[h.toUpperCase()]):a.textAlign=Gd;if(h=sC(b,c,f,"displayAlign",!0))a.displayAlign=fe[h.toUpperCase()];if(h=sC(b,c,f,"color",g))a.color=rC(h);if(h=sC(b,c,f,"backgroundColor",
|
|
1368
|
+
g))a.backgroundColor=rC(h);if(h=sC(b,c,f,"border",g))a.border=h;if(h=sC(b,c,f,"fontFamily",g))switch(h){case "monospaceSerif":a.fontFamily="Courier New,Liberation Mono,Courier,monospace";break;case "proportionalSansSerif":a.fontFamily="Arial,Helvetica,Liberation Sans,sans-serif";break;case "sansSerif":a.fontFamily="sans-serif";break;case "monospaceSansSerif":a.fontFamily="Consolas,monospace";break;case "proportionalSerif":a.fontFamily="serif";break;default:a.fontFamily=h.split(",").filter(function(k){return"default"!=
|
|
1369
|
+
k}).join(",")}(h=sC(b,c,f,"fontWeight",g))&&"bold"==h&&(a.fontWeight=be);h=sC(b,c,f,"wrapOption",g);a.wrapLine=h&&"noWrap"==h?!1:!0;(h=sC(b,c,f,"lineHeight",g))&&h.match(vC)&&(a.lineHeight=h);(h=sC(b,c,f,"fontSize",g))&&(h.match(vC)||h.match(wC))&&(a.fontSize=h);if(h=sC(b,c,f,"fontStyle",g))a.fontStyle=he[h.toUpperCase()];d?(e=d.attributes.imageType||d.attributes.imagetype,h=d.attributes.encoding,d=ed(d).trim(),"PNG"==e&&"Base64"==h&&d&&(a.backgroundImage="data:image/png;base64,"+d)):e&&(a.backgroundImage=
|
|
1370
|
+
e);if(d=sC(b,c,f,"textOutline",g))d=d.split(" "),d[0].match(vC)?a.textStrokeColor=a.color:(a.textStrokeColor=rC(d[0]),d.shift()),d[0]&&d[0].match(vC)?a.textStrokeWidth=d[0]:a.textStrokeColor="";(d=sC(b,c,f,"letterSpacing",g))&&d.match(vC)&&(a.letterSpacing=d);(d=sC(b,c,f,"linePadding",g))&&d.match(vC)&&(a.linePadding=d);if(d=sC(b,c,f,"opacity",g))a.opacity=parseFloat(d);(d=qC(c,f,"textDecoration"))&&xC(a,d);(d=yC(b,f,"textDecoration"))&&xC(a,d);if(d=sC(b,c,f,"textCombine",g))a.textCombineUpright=
|
|
1371
|
+
d;switch(sC(b,c,f,"ruby",g)){case "container":a.rubyTag="ruby";break;case "text":a.rubyTag="rt"}}
|
|
1372
|
+
function xC(a,b){b=t(b.split(" "));for(var c=b.next();!c.done;c=b.next())switch(c.value){case "underline":a.textDecoration.includes(de)||a.textDecoration.push(de);break;case "noUnderline":a.textDecoration.includes(de)&&Ob(a.textDecoration,de);break;case "lineThrough":a.textDecoration.includes("lineThrough")||a.textDecoration.push("lineThrough");break;case "noLineThrough":a.textDecoration.includes("lineThrough")&&Ob(a.textDecoration,"lineThrough");break;case "overline":a.textDecoration.includes("overline")||
|
|
1373
|
+
a.textDecoration.push("overline");break;case "noOverline":a.textDecoration.includes("overline")&&Ob(a.textDecoration,"overline")}}function sC(a,b,c,d,e){e=void 0===e?!0:e;return(a=yC(a,c,d))?a:e?qC(b,c,d):null}function qC(a,b,c){if(!a)return null;var d=md(a,eC,c);return d?d:zC(a,b,c)}function yC(a,b,c){var d=md(a,eC,c);return d?d:zC(a,b,c)}
|
|
1374
|
+
function zC(a,b,c){a=kC(a,"style",b,"");for(var d=null,e=0;e<a.length;e++){var f=ld(a[e],"urn:ebu:tt:style",c);f||(f=md(a[e],eC,c));f||(f=yC(a[e],b,c));f&&(d=f)}return d}function kC(a,b,c,d,e){var f=[];if(!a||1>c.length)return f;var g=a;for(a=null;!a&&!(a=e?ld(g,e,b):g.attributes[b])&&(g=g.parent,g););if(b=a)for(b=t(b.split(" ")),e=b.next();!e.done;e=b.next())for(e=e.value,a=t(c),g=a.next();!g.done;g=a.next())if(g=g.value,d+g.attributes["xml:id"]==e){f.push(g);break}return f}
|
|
1375
|
+
function mC(a,b,c,d){a=lC(a,b);null==c?c=a.start:null!=a.start&&(c+=a.start);null==d?d=a.end:null!=a.start&&(d+=a.start);return{start:c,end:d}}function lC(a,b){var c=AC(a.attributes.begin,b),d=AC(a.attributes.end,b);a=AC(a.attributes.dur,b);null==d&&null!=a&&(d=c+a);return{start:c,end:d}}
|
|
1376
|
+
function AC(a,b){var c=null;if(BC.test(a)){a=BC.exec(a);c=Number(a[1]);var d=Number(a[2]),e=Number(a[3]),f=Number(a[4]);f+=(Number(a[5])||0)/b.h;e+=f/b.frameRate;c=e+60*d+3600*c}else if(CC.test(a))c=DC(CC,a);else if(EC.test(a))c=DC(EC,a);else if(FC.test(a))a=FC.exec(a),c=Number(a[1])/b.frameRate;else if(GC.test(a))a=GC.exec(a),c=Number(a[1])/b.g;else if(HC.test(a))c=DC(HC,a);else if(a)throw new T(2,2,2001,"Could not parse cue time range in TTML");return c}
|
|
1377
|
+
function DC(a,b){a=a.exec(b);return null==a||""==a[0]?null:(Number(a[4])||0)/1E3+(Number(a[3])||0)+60*(Number(a[2])||0)+3600*(Number(a[1])||0)}function gC(a){return a?(a=/^(\d+) (\d+)$/.exec(a))?{ic:parseInt(a[1],10),rows:parseInt(a[2],10)}:null:null}S("shaka.text.TtmlTextParser",cC);cC.prototype.parseMedia=cC.prototype.parseMedia;cC.prototype.setManifestType=cC.prototype.setManifestType;cC.prototype.setSequenceMode=cC.prototype.setSequenceMode;cC.prototype.parseInit=cC.prototype.parseInit;
|
|
1375
1378
|
function fC(a,b,c,d){this.frameRate=Number(a)||30;this.h=Number(b)||1;this.g=Number(d);0==this.g&&(this.g=a?this.frameRate*this.h:1);c&&(a=/^(\d+) (\d+)$/g.exec(c))&&(this.frameRate*=Number(a[1])/Number(a[2]))}
|
|
1376
|
-
var
|
|
1377
|
-
end:"end"},
|
|
1378
|
-
|
|
1379
|
-
b,c,[]))})).parse(a,!1);if(!e)throw new T(2,2,2007);return f};S("shaka.text.Mp4TtmlParser",
|
|
1380
|
-
sf['application/mp4; codecs="stpp.ttml.im1t"']=function(){return new
|
|
1381
|
-
|
|
1379
|
+
var oC=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,wC=/^(\d{1,4}(?:\.\d+)?|100)%$/,vC=/^(\d+px|\d+em|\d*\.?\d+c)$/,pC=/^(\d+)px (\d+)px$/,BC=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,CC=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,EC=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/,FC=/^(\d*(?:\.\d*)?)f$/,GC=/^(\d*(?:\.\d*)?)t$/,HC=RegExp("^(?:(\\d*(?:\\.\\d*)?)h)?(?:(\\d*(?:\\.\\d*)?)m)?(?:(\\d*(?:\\.\\d*)?)s)?(?:(\\d*(?:\\.\\d*)?)ms)?$"),uC={left:Kd,center:"center",right:"end",start:Kd,
|
|
1380
|
+
end:"end"},tC={left:"line-left",center:"center",right:"line-right"},dC=["http://www.w3.org/ns/ttml#parameter","http://www.w3.org/2006/10/ttaf1#parameter"],eC=["http://www.w3.org/ns/ttml#styling","http://www.w3.org/2006/10/ttaf1#styling"],jC=["http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt","http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"];sf["application/ttml+xml"]=function(){return new cC};function IC(){this.g=new cC}IC.prototype.parseInit=function(a){var b=!1;(new Lh).box("moov",Qh).box("trak",Qh).box("mdia",Qh).box("minf",Qh).box("stbl",Qh).R("stsd",Sh).box("stpp",function(c){b=!0;c.parser.stop()}).parse(a);if(!b)throw new T(2,2,2007);};IC.prototype.setSequenceMode=function(){};IC.prototype.setManifestType=function(){};
|
|
1381
|
+
IC.prototype.parseMedia=function(a,b,c){var d=this,e=!1,f=[],g=[];(new Lh).box("moof",Qh).box("traf",Qh).R("subs",function(h){g=[];for(var k=h.reader,l=k.P(),m=0;m<l;m++){k.P();for(var n=k.ka(),p=0;p<n;p++)1==h.version?g.push(k.P()):g.push(k.ka()),k.S(),k.S(),k.P()}}).box("mdat",Vh(function(h){e=!0;if(g.length){for(var k=Ab(h,0,g[0]),l=[],m=g[0],n=1;n<g.length;n++){var p=Ab(h,m,g[n]);p=Me(p);l.push("data:image/png;base64,"+p);m+=g[n]}f=f.concat(d.g.parseMedia(k,b,c,l))}else f=f.concat(d.g.parseMedia(h,
|
|
1382
|
+
b,c,[]))})).parse(a,!1);if(!e)throw new T(2,2,2007);return f};S("shaka.text.Mp4TtmlParser",IC);IC.prototype.parseMedia=IC.prototype.parseMedia;IC.prototype.setManifestType=IC.prototype.setManifestType;IC.prototype.setSequenceMode=IC.prototype.setSequenceMode;IC.prototype.parseInit=IC.prototype.parseInit;sf['application/mp4; codecs="stpp"']=function(){return new IC};sf['application/mp4; codecs="stpp.ttml"']=function(){return new IC};sf['application/mp4; codecs="stpp.ttml.im1i"']=function(){return new IC};
|
|
1383
|
+
sf['application/mp4; codecs="stpp.ttml.im1t"']=function(){return new IC};sf['application/mp4; codecs="stpp.ttml.im2i"']=function(){return new IC};sf['application/mp4; codecs="stpp.ttml.im2t"']=function(){return new IC};sf['application/mp4; codecs="stpp.ttml.etd1"']=function(){return new IC};sf['application/mp4; codecs="stpp.ttml.etd1|im1t"']=function(){return new IC};sf['application/mp4; codecs="stpp.ttml.im1t|etd1"']=function(){return new IC};sf['application/mp4; codecs="stpp.TTML.im1t"']=function(){return new IC};function JC(){this.h=!1;this.g="UNKNOWN"}JC.prototype.parseInit=function(){};JC.prototype.setSequenceMode=function(a){this.h=a};JC.prototype.setManifestType=function(a){this.g=a};
|
|
1384
|
+
JC.prototype.parseMedia=function(a,b){a=Cc(a);a=a.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");var c=a.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(c[0]))throw new T(2,2,2E3);a=b.vttOffset;if(c[0].includes("X-TIMESTAMP-MAP")&&"HLS"==this.g)if(this.h){var d=c[0];a=d.match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m);d=d.match(/MPEGTS:(\d+)/m);if(!a||!d)throw new T(2,2,2E3);a=Sc(a[1]);if(null==a)throw new T(2,2,2E3);d=Number(d[1]);for(var e=b.segmentStart-b.periodStart;95443.7176888889<=e;)e-=95443.7176888889,
|
|
1382
1385
|
d+=8589934592;a=b.periodStart+d/9E4-a}else a=b.segmentStart;b=[];d=t(c[0].split("\n"));for(e=d.next();!e.done;e=d.next())if(e=e.value,/^Region:/.test(e)){e=new Mc(e);var f=new Kb;Pc(e);Nc(e);for(var g=Pc(e);g;){var h=f,k=g;(g=/^id=(.*)$/.exec(k))?h.id=g[1]:(g=/^width=(\d{1,2}|100)%$/.exec(k))?h.width=Number(g[1]):(g=/^lines=(\d+)$/.exec(k))?(h.height=Number(g[1]),h.heightUnits=2):(g=/^regionanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(k))?(h.regionAnchorX=Number(g[1]),h.regionAnchorY=Number(g[2])):
|
|
1383
1386
|
(g=/^viewportanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(k))?(h.viewportAnchorX=Number(g[1]),h.viewportAnchorY=Number(g[2])):/^scroll=up$/.exec(k)&&(h.scroll="up");Nc(e);g=Pc(e)}b.push(f)}d=new Map;Vd(d);e=[];c=t(c.slice(1));for(f=c.next();!f.done;f=c.next()){f=f.value.split("\n");if((1!=f.length||f[0])&&!/^NOTE($|[ \t])/.test(f[0])&&"STYLE"==f[0]){h=[];g=-1;for(k=1;k<f.length;k++)f[k].includes("::cue")&&(h.push([]),g=h.length-1),-1!=g&&(h[g].push(f[k]),f[k].includes("}")&&(g=-1));h=t(h);for(g=h.next();!g.done;g=
|
|
1384
1387
|
h.next()){var l=g.value;g="global";(k=l[0].match(/\((.*)\)/))&&(g=k.pop());k=l.slice(1,-1);l[0].includes("}")&&(l=/\{(.*?)\}/.exec(l[0]))&&(k=l[1].split(";"));(l=d.get(g))||(l=new Ed(0,0,""));for(var m=!1,n=0;n<k.length;n++){var p=/^\s*([^:]+):\s*(.*)/.exec(k[n]);if(p){var r=p[2].trim().replace(";","");switch(p[1].trim()){case "background-color":case "background":m=!0;l.backgroundColor=r;break;case "color":m=!0;l.color=r;break;case "font-family":m=!0;l.fontFamily=r;break;case "font-size":m=!0;l.fontSize=
|
|
1385
1388
|
r;break;case "font-weight":if(700<=parseInt(r,10)||"bold"==r)m=!0,l.fontWeight=be;break;case "font-style":switch(r){case "normal":m=!0;l.fontStyle=Pd;break;case "italic":m=!0;l.fontStyle=ce;break;case "oblique":m=!0,l.fontStyle="oblique"}break;case "opacity":m=!0;l.opacity=parseFloat(r);break;case "text-combine-upright":m=!0;l.textCombineUpright=r;break;case "text-shadow":m=!0;l.textShadow=r;break;case "white-space":m=!0,l.wrapLine="noWrap"!=r}}}m&&d.set(g,l)}}l=f;m=a;if(1==l.length&&!l[0]||/^NOTE($|[ \t])/.test(l[0])||
|
|
1386
|
-
"STYLE"==l[0]||"REGION"==l[0])f=null;else if(f=null,l[0].includes("--\x3e")||(f=l[0],l.splice(0,1)),h=new Mc(l[0]),g=Qc(h),n=Oc(h,/[ \t]+--\x3e[ \t]+/g),k=Qc(h),null==g||null==n||null==k)Za("Failed to parse VTT time code. Cue skipped:",f,l),f=null;else{g+=m;k+=m;m=l.slice(1).join("\n").trim();d.has("global")?(l=d.get("global").clone(),l.startTime=g,l.endTime=k,l.payload=m):l=new Ed(g,k,m);Nc(h);for(g=Pc(h);g;)
|
|
1387
|
-
function
|
|
1388
|
-
b||"end"==b?"line-right":"center"==b||"middle"==b?"center":Fd);else if(d=/^region:(.*)$/.exec(b)){if(b=
|
|
1389
|
-
function
|
|
1390
|
-
|
|
1391
|
-
p.value;var r=p.Kf||l,u=p.ke?c+p.ke:a;a=u+(r||0);var v=0;do{var w=m.P();v+=w;var y=m.P(),z=null;"vttc"==Ph(y)?8<w&&(z=m.rb(w-8)):m.skip(w-8);r&&z&&(w=
|
|
1392
|
-
function
|
|
1393
|
-
S("shaka.text.SbvTextParser",
|
|
1394
|
-
function
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
g<a.length;g++)f[e[g]]=a[g];d.push(f)}e=[];b=null;c=t(c.split(/\r?\n/));f=c.next();for(a={};!f.done;a={eh:void 0},f=c.next())if(f=f.value,!/^\s*;/.test(f)&&(g=
|
|
1398
|
-
l.eh}}(a)))&&
|
|
1399
|
-
function
|
|
1400
|
-
"before";a.textAlign="start";break;case 6:a.displayAlign="before";a.textAlign=Gd;break;case 7:a.displayAlign="before";a.textAlign="end";break;case 9:a.displayAlign="center";a.textAlign="start";break;case 10:a.displayAlign="center";a.textAlign=Gd;break;case 11:a.displayAlign="center",a.textAlign="end"}if(b=b.AlphaLevel)a.opacity=parseFloat(b)}function
|
|
1401
|
-
function
|
|
1402
|
-
sf["text/x-ssa"]=function(){return new
|
|
1403
|
-
function
|
|
1404
|
-
function
|
|
1405
|
-
2,0,178,0,32,8,224]);break;default:if(1===b)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===b||3===b)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null};function
|
|
1406
|
-
q.transmux=function(a,b,c,d){for(var e=Ab(a),f=qj(e),g=f.length;g<e.length&&!
|
|
1389
|
+
"STYLE"==l[0]||"REGION"==l[0])f=null;else if(f=null,l[0].includes("--\x3e")||(f=l[0],l.splice(0,1)),h=new Mc(l[0]),g=Qc(h),n=Oc(h,/[ \t]+--\x3e[ \t]+/g),k=Qc(h),null==g||null==n||null==k)Za("Failed to parse VTT time code. Cue skipped:",f,l),f=null;else{g+=m;k+=m;m=l.slice(1).join("\n").trim();d.has("global")?(l=d.get("global").clone(),l.startTime=g,l.endTime=k,l.payload=m):l=new Ed(g,k,m);Nc(h);for(g=Pc(h);g;)KC(l,g,b),Nc(h),g=Pc(h);Ud(l,d);null!=f&&(l.id=f);f=l}f&&e.push(f)}return e};
|
|
1390
|
+
function KC(a,b,c){var d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"==b?a.textAlign=Gd:a.textAlign=ee[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"==d[1]?"vertical-lr":"vertical-rl";else if(d=/^size:([\d.]+)%$/.exec(b))a.size=Number(d[1]);else if(d=/^position:([\d.]+)%(?:,(line-left|line-right|middle|center|start|end|auto))?$/.exec(b))a.position=Number(d[1]),d[2]&&(b=d[2],a.positionAlign="line-left"==b||"start"==b?"line-left":"line-right"==
|
|
1391
|
+
b||"end"==b?"line-right":"center"==b||"middle"==b?"center":Fd);else if(d=/^region:(.*)$/.exec(b)){if(b=LC(c,d[1]))a.region=b}else if(c=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=1,a.line=Number(c[1]),c[2]&&(a.lineAlign=ge[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=Jd,a.line=Number(c[1]),c[2]&&(a.lineAlign=ge[c[2].toUpperCase()])}
|
|
1392
|
+
function LC(a,b){a=a.filter(function(c){return c.id==b});return a.length?a[0]:null}S("shaka.text.VttTextParser",JC);JC.prototype.parseMedia=JC.prototype.parseMedia;JC.prototype.setManifestType=JC.prototype.setManifestType;JC.prototype.setSequenceMode=JC.prototype.setSequenceMode;JC.prototype.parseInit=JC.prototype.parseInit;sf["text/vtt"]=function(){return new JC};sf['text/vtt; codecs="vtt"']=function(){return new JC};sf['text/vtt; codecs="wvtt"']=function(){return new JC};function MC(){this.g=null}MC.prototype.parseInit=function(a){var b=this,c=!1;(new Lh).box("moov",Qh).box("trak",Qh).box("mdia",Qh).R("mdhd",function(d){d=tj(d.reader,d.version);b.g=d.timescale}).box("minf",Qh).box("stbl",Qh).R("stsd",Sh).box("wvtt",function(){c=!0}).parse(a);if(!this.g)throw new T(2,2,2008);if(!c)throw new T(2,2,2008);};MC.prototype.setSequenceMode=function(){};MC.prototype.setManifestType=function(){};
|
|
1393
|
+
MC.prototype.parseMedia=function(a,b){if(!a.length)return[];if(!this.g)throw new T(2,2,2008);var c=0,d=[],e,f=[],g=!1,h=!1,k=!1,l=null;(new Lh).box("moof",Qh).box("traf",Qh).R("tfdt",function(D){g=!0;c=sj(D.reader,D.version).baseMediaDecodeTime}).R("tfhd",function(D){l=rj(D.reader,D.flags).Zc}).R("trun",function(D){h=!0;d=uj(D.reader,D.version,D.flags).Rg}).box("mdat",Vh(function(D){k=!0;e=D})).parse(a,!1);if(!k&&!g&&!h)throw new T(2,2,2008);a=c;for(var m=new Ih(e,0),n=t(d),p=n.next();!p.done;p=n.next()){p=
|
|
1394
|
+
p.value;var r=p.Kf||l,u=p.ke?c+p.ke:a;a=u+(r||0);var v=0;do{var w=m.P();v+=w;var y=m.P(),z=null;"vttc"==Ph(y)?8<w&&(z=m.rb(w-8)):m.skip(w-8);r&&z&&(w=NC(z,b.periodStart+u/this.g,b.periodStart+a/this.g),f.push(w))}while(p.sampleSize&&v<p.sampleSize)}return f.filter(Af)};function NC(a,b,c){var d,e,f;(new Lh).box("payl",Vh(function(g){d=Cc(g)})).box("iden",Vh(function(g){e=Cc(g)})).box("sttg",Vh(function(g){f=Cc(g)})).parse(a);return d?OC(d,e,f,b,c):null}
|
|
1395
|
+
function OC(a,b,c,d,e){a=new Ed(d,e,a);Ud(a);b&&(a.id=b);if(c)for(b=new Mc(c),c=Pc(b);c;)KC(a,c,[]),Nc(b),c=Pc(b);return a}S("shaka.text.Mp4VttParser",MC);MC.prototype.parseMedia=MC.prototype.parseMedia;MC.prototype.setManifestType=MC.prototype.setManifestType;MC.prototype.setSequenceMode=MC.prototype.setSequenceMode;MC.prototype.parseInit=MC.prototype.parseInit;sf['application/mp4; codecs="wvtt"']=function(){return new MC};function PC(){}PC.prototype.parseInit=function(){};PC.prototype.setSequenceMode=function(){};PC.prototype.setManifestType=function(){};PC.prototype.parseMedia=function(a){var b=Cc(a).replace(/\r+/g,"");b=b.trim();a=[];if(""==b)return a;b=t(b.split("\n\n"));for(var c=b.next();!c.done;c=b.next()){c=c.value.split("\n");var d=new Mc(c[0]),e=Qc(d),f=Oc(d,/,/g);d=Qc(d);if(null==e||null==f||null==d)throw new T(2,2,2001,"Could not parse cue time range in SubViewer");a.push(new Ed(e,d,c.slice(1).join("\n").trim()))}return a};
|
|
1396
|
+
S("shaka.text.SbvTextParser",PC);PC.prototype.parseMedia=PC.prototype.parseMedia;PC.prototype.setManifestType=PC.prototype.setManifestType;PC.prototype.setSequenceMode=PC.prototype.setSequenceMode;PC.prototype.parseInit=PC.prototype.parseInit;sf["text/x-subviewer"]=function(){return new PC};function QC(){this.g=new JC}QC.prototype.parseInit=function(){};QC.prototype.setSequenceMode=function(){};QC.prototype.setManifestType=function(){};QC.prototype.parseMedia=function(a,b,c){a=Cc(a);a=RC(a);a=Ab(Ic(a));return this.g.parseMedia(a,b,c,[])};
|
|
1397
|
+
function RC(a){var b="WEBVTT\n\n";if(""==a)return b;a=a.replace(/\r+/g,"");a=a.trim();a=t(a.split("\n\n"));for(var c=a.next();!c.done;c=a.next())c=c.value.split(/\n/),c[0].match(/\d+/)&&c.shift(),c[0]=c[0].replace(/,/g,"."),b+=c.join("\n").replace(/{b}/g,"<b>").replace(/{\/b}/g,"</b>").replace(/{i}/g,"<i>").replace(/{\/i}/g,"</i>").replace(/{u}/g,"<u>").replace(/{\/u}/g,"</u>")+"\n\n";return b}S("shaka.text.SrtTextParser",QC);QC.srt2webvtt=RC;QC.prototype.parseMedia=QC.prototype.parseMedia;
|
|
1398
|
+
QC.prototype.setManifestType=QC.prototype.setManifestType;QC.prototype.setSequenceMode=QC.prototype.setSequenceMode;QC.prototype.parseInit=QC.prototype.parseInit;sf["text/srt"]=function(){return new QC};function SC(){}SC.prototype.parseInit=function(){};SC.prototype.setSequenceMode=function(){};SC.prototype.setManifestType=function(){};
|
|
1399
|
+
SC.prototype.parseMedia=function(a){var b="",c="",d=null,e=null;e=Cc(a).split(/\r?\n\s*\r?\n/);a=t(e);for(e=a.next();!e.done;e=a.next()){var f=e.value;e=f;if(f=TC.exec(f))d=f[1],e=f[2];"V4 Styles"==d||"V4+ Styles"==d?(b=e,b=c?b+("\n"+e):e):"Events"==d&&(c=c?c+("\n"+e):e)}d=[];e=null;b=t(b.split(/\r?\n/));for(a=b.next();!a.done;a=b.next())if(a=a.value,!/^\s*;/.test(a)&&(f=UC.exec(a)))if(a=f[1].trim(),f=f[2].trim(),"Format"==a)e=f.split(VC);else if("Style"==a){a=f.split(VC);f={};for(var g=0;g<e.length&&
|
|
1400
|
+
g<a.length;g++)f[e[g]]=a[g];d.push(f)}e=[];b=null;c=t(c.split(/\r?\n/));f=c.next();for(a={};!f.done;a={eh:void 0},f=c.next())if(f=f.value,!/^\s*;/.test(f)&&(g=UC.exec(f)))if(f=g[1].trim(),g=g[2].trim(),"Format"==f)b=g.split(VC);else if("Dialogue"==f){g=g.split(VC);f={};for(var h=0;h<b.length&&h<g.length;h++)f[b[h]]=g[h];h=WC(f.Start);var k=WC(f.End);g=new Ed(h,k,g.slice(b.length-1).join(",").replace(/\\N/g,"\n").replace(/\{[^}]+\}/g,""));a.eh=f.Style;(a=d.find(function(l){return function(m){return m.Name==
|
|
1401
|
+
l.eh}}(a)))&&XC(g,a);e.push(g)}return e};
|
|
1402
|
+
function XC(a,b){var c=b.Fontname;c&&(a.fontFamily=c);if(c=b.Fontsize)a.fontSize=c+"px";if(c=b.PrimaryColour)if(c=YC(c))a.color=c;if(c=b.BackColour)if(c=YC(c))a.backgroundColor=c;b.Bold&&(a.fontWeight=be);b.Italic&&(a.fontStyle=ce);b.Underline&&a.textDecoration.push(de);if(c=b.Spacing)a.letterSpacing=c+"px";if(c=b.Alignment)switch(parseInt(c,10)){case 1:a.displayAlign=Ld;a.textAlign="start";break;case 2:a.displayAlign=Ld;a.textAlign=Gd;break;case 3:a.displayAlign=Ld;a.textAlign="end";break;case 5:a.displayAlign=
|
|
1403
|
+
"before";a.textAlign="start";break;case 6:a.displayAlign="before";a.textAlign=Gd;break;case 7:a.displayAlign="before";a.textAlign="end";break;case 9:a.displayAlign="center";a.textAlign="start";break;case 10:a.displayAlign="center";a.textAlign=Gd;break;case 11:a.displayAlign="center",a.textAlign="end"}if(b=b.AlphaLevel)a.opacity=parseFloat(b)}function YC(a){a=parseInt(a.replace("&H",""),16);return 0<=a?"rgba("+(a&255)+","+(a>>8&255)+","+(a>>16&255)+","+(a>>24&255^255)/255+")":null}
|
|
1404
|
+
function WC(a){a=ZC.exec(a);return 3600*(a[1]?parseInt(a[1].replace(":",""),10):0)+60*parseInt(a[2],10)+parseFloat(a[3])}S("shaka.text.SsaTextParser",SC);SC.prototype.parseMedia=SC.prototype.parseMedia;SC.prototype.setManifestType=SC.prototype.setManifestType;SC.prototype.setSequenceMode=SC.prototype.setSequenceMode;SC.prototype.parseInit=SC.prototype.parseInit;var TC=/^\s*\[([^\]]+)\]\r?\n([\s\S]*)/,UC=/^\s*([^:]+):\s*(.*)/,VC=/\s*,\s*/,ZC=/^(\d+:)?(\d{1,2}):(\d{1,2}(?:[.]\d{1,3})?)?$/;
|
|
1405
|
+
sf["text/x-ssa"]=function(){return new SC};function $C(a,b){var c=a[b+1]&1?7:9;return b+c<=a.length&&(a=((a[b+3]&3)<<11|a[b+4]<<3|(a[b+5]&224)>>>5)-c,0<a)?{Nd:c,da:a}:null}function aD(a,b){var c=[96E3,88200,64E3,48E3,44100,32E3,24E3,22050,16E3,12E3,11025,8E3,7350],d=(a[b+2]&60)>>>2;if(d>c.length-1)return null;var e=((a[b+2]&192)>>>6)+1,f=(a[b+2]&1)<<2;f|=(a[b+3]&192)>>>6;return{sampleRate:c[d],channelCount:f,codec:"mp4a.40."+e}}
|
|
1406
|
+
function bD(a,b){if(b+1<a.length&&255===a[b]&&240===(a[b+1]&246)){var c=a[b+1]&1?7:9;if(b+c>=a.length)return!1;var d=(a[b+3]&3)<<11|a[b+4]<<3|(a[b+5]&224)>>>5;if(d<=c)return!1;b+=d;return b===a.length||b+1<a.length&&255===a[b]&&240===(a[b+1]&246)}return!1}
|
|
1407
|
+
function cD(a,b){switch(a){case "mp4a.40.2":if(1===b)return new Uint8Array([0,200,0,128,35,128]);if(2===b)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===b)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===b)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===b)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===b)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,
|
|
1408
|
+
2,0,178,0,32,8,224]);break;default:if(1===b)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===b||3===b)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null};function dD(a){this.i=a;this.h=0;this.g=new Map}q=dD.prototype;q.destroy=function(){this.g.clear()};q.isSupported=function(a){return"audio/aac"==a.toLowerCase().split(";")[0]?nb(this.convertCodecs("audio",a)):!1};q.convertCodecs=function(a,b){return"audio/aac"==b.toLowerCase().split(";")[0]?'audio/mp4; codecs="'+(of(b)||"mp4a.40.2")+'"':b};q.getOriginalMimeType=function(){return this.i};
|
|
1409
|
+
q.transmux=function(a,b,c,d){for(var e=Ab(a),f=qj(e),g=f.length;g<e.length&&!bD(e,g);g++);a=1E3*c.endTime;f=pj(f);f.length&&c&&(f=f.find(function(m){return"com.apple.streaming.transportStreamTimestamp"===m.description}))&&(a=f.data);f=aD(e,g);if(!f)return Promise.reject(new T(2,3,3018,c?c.M()[0]:null));b.audioSamplingRate=f.sampleRate;b.channelsCount=f.channelCount;for(var h=[];g<e.length;){var k=$C(e,g);if(!k)return Promise.reject(new T(2,3,3018,c?c.M()[0]:null));var l=k.Nd+k.da;g+l<=e.length&&h.push({data:e.subarray(g+
|
|
1407
1410
|
k.Nd,g+l),size:k.da,duration:1024,eb:0,flags:{hb:0,Xa:0,Wa:0,Ua:0,Va:2,ib:0}});g+=l}e=f.sampleRate;a=Math.floor(a*e/1E3);d={id:b.id,type:"audio",codecs:f.codec,encrypted:b.encrypted&&0<b.drmInfos.length,timescale:e,duration:d,ab:[],qa:new Uint8Array([]),xa:new Uint8Array([]),Ba:0,Ca:0,data:{sb:this.h,baseMediaDecodeTime:a,Ya:h},stream:b};d=new yx([d]);c=b.id+"_"+c.i;this.g.has(c)?b=this.g.get(c):(b=Ex(d),this.g.set(c,b));c=Vx(d);this.h++;b=Re(b,c);return Promise.resolve(b)};
|
|
1408
|
-
S("shaka.transmuxer.AacTransmuxer",
|
|
1411
|
+
S("shaka.transmuxer.AacTransmuxer",dD);dD.prototype.transmux=dD.prototype.transmux;dD.prototype.getOriginalMimeType=dD.prototype.getOriginalMimeType;dD.prototype.convertCodecs=dD.prototype.convertCodecs;dD.prototype.isSupported=dD.prototype.isSupported;dD.prototype.destroy=dD.prototype.destroy;je("audio/aac",function(){return new dD("audio/aac")},se);function eD(a,b){if(b+8>a.length||11!==a[b]||119!==a[b+1])return null;var c=a[b+4]>>6;if(3<=c)return null;var d=a[b+4]&63,e=2*[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,
|
|
1409
1412
|
1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][3*d+c];if(b+e>a.length)return null;var f=a[b+6]>>5,g=0;2===f?g+=2:(f&1&&1!==f&&(g+=2),f&4&&(g+=2));g=(a[b+6]<<8|a[b+7])>>12-g&1;var h=a[b+5]&7;a=new Uint8Array([c<<6|a[b+5]>>3<<1|h>>2,(h&3)<<6|f<<3|g<<2|d>>4,d<<4&224]);return{sampleRate:[48E3,44100,32E3][c],channelCount:[2,1,2,3,3,4,4,5][f]+g,qa:a,da:e}}
|
|
1410
|
-
function
|
|
1411
|
-
q.transmux=function(a,b,c,d){a=Ab(a);for(var e=qj(a),f=e.length;f<a.length&&!
|
|
1412
|
-
eb:0,flags:{hb:0,Xa:0,Wa:0,Ua:0,Va:2,ib:0}});f+=l.da}a=Math.floor(g*e/1E3);d={id:b.id,type:"audio",codecs:"ac-3",encrypted:b.encrypted&&0<b.drmInfos.length,timescale:e,duration:d,ab:[],qa:h,xa:new Uint8Array([]),Ba:0,Ca:0,data:{sb:this.h,baseMediaDecodeTime:a,Ya:k},stream:b};d=new yx([d]);c=b.id+"_"+c.i;this.g.has(c)?b=this.g.get(c):(b=Ex(d),this.g.set(c,b));c=Vx(d);this.h++;b=Re(b,c);return Promise.resolve(b)};S("shaka.transmuxer.Ac3Transmuxer",
|
|
1413
|
-
|
|
1414
|
-
q.transmux=function(a,b,c,d){a=Ab(a);for(var e=qj(a),f=e.length;f<a.length&&2935!==(a[f]<<8|a[f+1]<<0);f++);var g=1E3*c.endTime;e=pj(e);e.length&&c&&(e=e.find(function(m){return"com.apple.streaming.transportStreamTimestamp"===m.description}))&&(g=e.data);e=0;for(var h=new Uint8Array([]),k=[];f<a.length;){var l=
|
|
1415
|
-
size:l.da,duration:1536,eb:0,flags:{hb:0,Xa:0,Wa:0,Ua:0,Va:2,ib:0}});f+=l.da}a=Math.floor(g*e/1E3);d={id:b.id,type:"audio",codecs:"ec-3",encrypted:b.encrypted&&0<b.drmInfos.length,timescale:e,duration:d,ab:[],qa:h,xa:new Uint8Array([]),Ba:0,Ca:0,data:{sb:this.h,baseMediaDecodeTime:a,Ya:k},stream:b};d=new yx([d]);c=b.id+"_"+c.i;this.g.has(c)?b=this.g.get(c):(b=Ex(d),this.g.set(c,b));c=Vx(d);this.h++;b=Re(b,c);return Promise.resolve(b)};S("shaka.transmuxer.Ec3Transmuxer",
|
|
1416
|
-
|
|
1413
|
+
function fD(a,b){if(11===a[b]&&119===a[b+1]){var c=0,d=5;b+=d;for(var e,f;0<d;){f=a[b];var g=Math.min(d,8),h=8-g;e=4278190080>>>24+h<<h;e=(f&e)>>h;c=c?c<<g|e:e;b+=1;d-=g}if(16>c)return!0}return!1};function gD(a){this.i=a;this.h=0;this.g=new Map}q=gD.prototype;q.destroy=function(){this.g.clear()};q.isSupported=function(a){return"audio/ac3"==a.toLowerCase().split(";")[0]?nb(this.convertCodecs("audio",a)):!1};q.convertCodecs=function(a,b){return"audio/ac3"==b.toLowerCase().split(";")[0]?'audio/mp4; codecs="ac-3"':b};q.getOriginalMimeType=function(){return this.i};
|
|
1414
|
+
q.transmux=function(a,b,c,d){a=Ab(a);for(var e=qj(a),f=e.length;f<a.length&&!fD(a,f);f++);var g=1E3*c.endTime;e=pj(e);e.length&&c&&(e=e.find(function(m){return"com.apple.streaming.transportStreamTimestamp"===m.description}))&&(g=e.data);e=0;for(var h=new Uint8Array([]),k=[];f<a.length;){var l=eD(a,f);if(!l)return Promise.reject(new T(2,3,3018,c?c.M()[0]:null));b.audioSamplingRate=l.sampleRate;b.channelsCount=l.channelCount;e=l.sampleRate;h=l.qa;k.push({data:a.subarray(f,f+l.da),size:l.da,duration:1536,
|
|
1415
|
+
eb:0,flags:{hb:0,Xa:0,Wa:0,Ua:0,Va:2,ib:0}});f+=l.da}a=Math.floor(g*e/1E3);d={id:b.id,type:"audio",codecs:"ac-3",encrypted:b.encrypted&&0<b.drmInfos.length,timescale:e,duration:d,ab:[],qa:h,xa:new Uint8Array([]),Ba:0,Ca:0,data:{sb:this.h,baseMediaDecodeTime:a,Ya:k},stream:b};d=new yx([d]);c=b.id+"_"+c.i;this.g.has(c)?b=this.g.get(c):(b=Ex(d),this.g.set(c,b));c=Vx(d);this.h++;b=Re(b,c);return Promise.resolve(b)};S("shaka.transmuxer.Ac3Transmuxer",gD);gD.prototype.transmux=gD.prototype.transmux;
|
|
1416
|
+
gD.prototype.getOriginalMimeType=gD.prototype.getOriginalMimeType;gD.prototype.convertCodecs=gD.prototype.convertCodecs;gD.prototype.isSupported=gD.prototype.isSupported;gD.prototype.destroy=gD.prototype.destroy;je("audio/ac3",function(){return new gD("audio/ac3")},se);function hD(a,b){if(b+8>a.length||2935!==(a[b]<<8|a[b+1]<<0))return null;var c=new Aj(a.subarray(b+2));Cj(c,2);Cj(c,3);var d=Dj(c,11)+1<<1,e=Dj(c,2);if(3==e){e=Dj(c,2);e=[24E3,22060,16E3][e];var f=3}else e=[48E3,44100,32E3][e],f=Dj(c,2);var g=Dj(c,3),h=Dj(c,1);c=Dj(c,5);if(b+d>a.byteLength)return null;a=Math.floor(d*e/(16*[1,2,3,6][f]));a=new Uint8Array([(a&8160)>>5,(a&31)<<3,e<<6|c<<1|0,0|g<<1|h<<0,0]);return{sampleRate:e,channelCount:[2,1,2,3,3,4,4,5][g]+h,qa:a,da:d}};function iD(a){this.i=a;this.h=0;this.g=new Map}q=iD.prototype;q.destroy=function(){this.g.clear()};q.isSupported=function(a){return"audio/ec3"==a.toLowerCase().split(";")[0]?nb(this.convertCodecs("audio",a)):!1};q.convertCodecs=function(a,b){return"audio/ec3"==b.toLowerCase().split(";")[0]?'audio/mp4; codecs="ec-3"':b};q.getOriginalMimeType=function(){return this.i};
|
|
1417
|
+
q.transmux=function(a,b,c,d){a=Ab(a);for(var e=qj(a),f=e.length;f<a.length&&2935!==(a[f]<<8|a[f+1]<<0);f++);var g=1E3*c.endTime;e=pj(e);e.length&&c&&(e=e.find(function(m){return"com.apple.streaming.transportStreamTimestamp"===m.description}))&&(g=e.data);e=0;for(var h=new Uint8Array([]),k=[];f<a.length;){var l=hD(a,f);if(!l)return Promise.reject(new T(2,3,3018,c?c.M()[0]:null));b.audioSamplingRate=l.sampleRate;b.channelsCount=l.channelCount;e=l.sampleRate;h=l.qa;k.push({data:a.subarray(f,f+l.da),
|
|
1418
|
+
size:l.da,duration:1536,eb:0,flags:{hb:0,Xa:0,Wa:0,Ua:0,Va:2,ib:0}});f+=l.da}a=Math.floor(g*e/1E3);d={id:b.id,type:"audio",codecs:"ec-3",encrypted:b.encrypted&&0<b.drmInfos.length,timescale:e,duration:d,ab:[],qa:h,xa:new Uint8Array([]),Ba:0,Ca:0,data:{sb:this.h,baseMediaDecodeTime:a,Ya:k},stream:b};d=new yx([d]);c=b.id+"_"+c.i;this.g.has(c)?b=this.g.get(c):(b=Ex(d),this.g.set(c,b));c=Vx(d);this.h++;b=Re(b,c);return Promise.resolve(b)};S("shaka.transmuxer.Ec3Transmuxer",iD);iD.prototype.transmux=iD.prototype.transmux;
|
|
1419
|
+
iD.prototype.getOriginalMimeType=iD.prototype.getOriginalMimeType;iD.prototype.convertCodecs=iD.prototype.convertCodecs;iD.prototype.isSupported=iD.prototype.isSupported;iD.prototype.destroy=iD.prototype.destroy;je("audio/ec3",function(){return new iD("audio/ec3")},se);function jD(a){if(!a.length)return null;var b=a.find(function(v){return 7==v.type});a=a.find(function(v){return 8==v.type});if(!b||!a)return null;var c=new Aj(b.data),d=Pj(c);Pj(c);Pj(c);Fj(c);if(kD.includes(d)&&(d=W(c),3===d&&Cj(c,1),Fj(c),Fj(c),Cj(c,1),Oj(c))){d=3!==d?8:12;for(var e=0;e<d;e++)Oj(c)&&(6>e?Qj(c,16):Qj(c,64))}Fj(c);d=W(c);if(0===d)W(c);else if(1===d)for(Cj(c,1),Fj(c),Fj(c),d=W(c),e=0;e<d;e++)Fj(c);Fj(c);Cj(c,1);var f=W(c),g=W(c),h=Dj(c,1);0===h&&Cj(c,1);Cj(c,1);var k=0,l=0,m=0,n=0;
|
|
1417
1420
|
Oj(c)&&(k=W(c),l=W(c),m=W(c),n=W(c));e=d=1;if(Oj(c)&&Oj(c)){var p=Pj(c),r=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],u=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];0<p&&16>=p?(d=r[p-1],e=u[p-1]):255===p&&(d=Dj(c,16),e=Dj(c,16))}c=(2-h)*(g+1)*16-2*m-2*n;f=16*(f+1)-2*k-2*l;k=[];b=b.fullData;k.push(b.byteLength>>>8&255);k.push(b.byteLength&255);k=k.concat.apply(k,x(b));b=[];a=a.fullData;b.push(a.byteLength>>>8&255);b.push(a.byteLength&255);b=b.concat.apply(b,x(a));a=new Uint8Array([1,k[3],k[4],
|
|
1418
1421
|
k[5],255,225].concat(k,[1],b));return{height:c,width:f,xa:a,Ba:d,Ca:e}}
|
|
1419
|
-
function
|
|
1420
|
-
{data:Re.apply(Le,x(c)),hd:b}:null}var
|
|
1421
|
-
xa:b,Ba:a.Ni,Ca:a.Mi}}function
|
|
1422
|
-
function
|
|
1423
|
-
W(a),W(a);W(a);W(a);W(a);W(a);W(a);W(a);if(Oj(a)&&Oj(a))for(K=0;4>K;K++)for(var L=0;L<(3===K?2:6);L++)if(Oj(a)){var I=Math.min(64,1<<4+(K<<1));1<K&&
|
|
1422
|
+
function lD(a){var b=!1,c=[],d=a.find(function(k){return 7==k.type}),e=!1;a=t(a);for(var f=a.next();!f.done;f=a.next()){f=f.value;var g=!1;switch(f.type){case 1:g=e=!0;var h=f.data;d&&4<h.length&&(h=Rj(new Aj(h)),2===h||4===h||7===h||9===h)&&(b=!0);break;case 5:b=g=e=!0;break;case 6:g=!0;break;case 7:g=!0;break;case 8:g=!0;break;case 9:e=g=!0;break;case 12:g=!0;break;default:g=!1}e&&g&&(g=f.fullData.byteLength,h=new Uint8Array(4),h[0]=g>>24&255,h[1]=g>>16&255,h[2]=g>>8&255,h[3]=g&255,c.push(h),c.push(f.fullData))}return c.length?
|
|
1423
|
+
{data:Re.apply(Le,x(c)),hd:b}:null}var kD=[100,110,122,244,44,83,86,118,128,138,139,134];function mD(a){if(!a.length)return null;var b=a.find(function(g){return 32==g.type}),c=a.find(function(g){return 33==g.type}),d=a.find(function(g){return 34==g.type});if(!b||!c||!d)return null;var e=nD(b.fullData);a=oD(c.fullData);var f=pD(d.fullData);b=qD(b.fullData,c.fullData,d.fullData,{zf:e.zf,Vf:e.Vf,cf:a.cf,df:a.df,Xe:a.Xe,bf:a.bf,Ye:a.Ye,Ze:a.Ze,$e:a.$e,af:a.af,Re:a.Re,Se:a.Se,Te:a.Te,Ue:a.Ue,Ve:a.Ve,We:a.We,Ke:a.Ke,Xd:a.Xd,Ie:a.Ie,He:a.He,Ge:a.Ge,Cf:f.Cf});return{height:a.height,width:a.width,
|
|
1424
|
+
xa:b,Ba:a.Ni,Ca:a.Mi}}function nD(a){var b=new Aj(a,!0);Pj(b);Pj(b);Dj(b,4);Dj(b,2);Dj(b,6);a=Dj(b,3);b=Oj(b);return{zf:a+1,Vf:b}}
|
|
1425
|
+
function oD(a){a=new Aj(a,!0);Pj(a);Pj(a);var b=0,c=0,d=0,e=0;Dj(a,4);var f=Dj(a,3);Oj(a);for(var g=Dj(a,2),h=Dj(a,1),k=Dj(a,5),l=Pj(a),m=Pj(a),n=Pj(a),p=Pj(a),r=Pj(a),u=Pj(a),v=Pj(a),w=Pj(a),y=Pj(a),z=Pj(a),D=Pj(a),A=[],B=[],C=0;C<f;C++)A.push(Oj(a)),B.push(Oj(a));if(0<f)for(C=f;8>C;C++)Dj(a,2);for(C=0;C<f;C++)A[C]&&Dj(a,88),B[C]&&Pj(a);W(a);A=W(a);3==A&&Dj(a,1);B=W(a);C=W(a);Oj(a)&&(b+=W(a),c+=W(a),d+=W(a),e+=W(a));var E=W(a),F=W(a),J=W(a);if(Oj(a))for(var K=0;K<=f;K++)W(a),W(a),W(a);else W(a),
|
|
1426
|
+
W(a),W(a);W(a);W(a);W(a);W(a);W(a);W(a);if(Oj(a)&&Oj(a))for(K=0;4>K;K++)for(var L=0;L<(3===K?2:6);L++)if(Oj(a)){var I=Math.min(64,1<<4+(K<<1));1<K&&Gj(a);for(var N=0;N<I;N++)Gj(a)}else W(a);Oj(a);Oj(a);Oj(a)&&(Pj(a),W(a),W(a),Oj(a));K=W(a);for(I=L=0;I<K;I++)if(N=!1,0!==I&&(N=Oj(a)),N){I===K&&W(a);Oj(a);W(a);for(var M=N=0;M<=L;M++){var O=Oj(a),Q=!1;O||(Q=Oj(a));(O||Q)&&N++}L=N}else{M=W(a);N=W(a);L=M+N;for(O=0;O<M;O++)W(a),Oj(a);for(M=0;M<N;M++)W(a),Oj(a)}if(Oj(a))for(K=W(a),L=0;L<K;L++){for(I=0;I<
|
|
1424
1427
|
J+4;I++)Dj(a,1);Dj(a,1)}K=J=1;L=0;Oj(a);Oj(a);if(Oj(a)){Oj(a)&&(I=Pj(a),N=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],M=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1],0<I&&16>=I?(J=N[I-1],K=M[I-1]):255===I&&(J=Dj(a,16),K=Dj(a,16)));Oj(a)&&Oj(a);Oj(a)&&(Dj(a,3),Oj(a),Oj(a)&&(Pj(a),Pj(a),Pj(a)));Oj(a)&&(W(a),W(a));Oj(a);Oj(a);Oj(a);if(I=Oj(a))W(a),W(a),W(a),W(a);if(Oj(a)&&(Dj(a,32),Dj(a,32),Oj(a)&&W(a),Oj(a))){M=!1;I=Oj(a);N=Oj(a);if(I||N){if(M=Oj(a))Pj(a),Dj(a,5),Oj(a),Dj(a,5);Dj(a,4);Dj(a,4);M&&
|
|
1425
1428
|
Dj(a,4);Dj(a,5);Dj(a,5);Dj(a,5)}for(O=0;O<=f;O++){var R=!0;Q=1;Oj(a)||(R=Oj(a));var U=!1;R?W(a):U=Oj(a);U||(Q=W(a)+1);if(I){for(R=0;R<Q;R++)W(a),W(a),M&&(W(a),W(a));Oj(a)}if(N){for(R=0;R<Q;R++)W(a),W(a),M&&(W(a),W(a));Oj(a)}}}Oj(a)&&(Oj(a),Oj(a),Oj(a),L=W(a),W(a),W(a),W(a),W(a))}return{Xe:D,cf:g,df:h,bf:k,Ye:l,Ze:m,$e:n,af:p,Re:r,Se:u,Te:v,Ue:w,Ve:y,We:z,Xd:L,Ke:0,Ie:A,He:E,Ge:F,width:B-(b+c)*(1===A||2===A?2:1),height:C-(d+e)*(1===A?2:1),Ni:J,Mi:K}}
|
|
1426
|
-
function
|
|
1427
|
-
function
|
|
1428
|
-
255)>>0;e.set(a,28);e[23+(5+a.byteLength)]=161;e[a.byteLength+29]=0;e[a.byteLength+30]=1;e[a.byteLength+31]=(b.byteLength&65280)>>8;e[a.byteLength+32]=(b.byteLength&255)>>0;e.set(b,a.byteLength+33);e[23+(a.byteLength+10+b.byteLength)]=162;e[a.byteLength+10+b.byteLength+24]=0;e[a.byteLength+10+b.byteLength+25]=1;e[a.byteLength+10+b.byteLength+26]=(c.byteLength&65280)>>8;e[a.byteLength+10+b.byteLength+27]=(c.byteLength&255)>>0;e.set(c,a.byteLength+10+b.byteLength+28);return e};function
|
|
1429
|
-
function
|
|
1430
|
-
var
|
|
1431
|
-
q.transmux=function(a,b,c,d){for(var e=Ab(a),f=qj(e).length;f<e.length&&!
|
|
1432
|
-
duration:d,ab:[],qa:new Uint8Array([]),xa:new Uint8Array([]),Ba:0,Ca:0,data:{sb:this.h,baseMediaDecodeTime:e,Ya:a},stream:b};d=new yx([d]);c=b.id+"_"+c.i;this.g.has(c)?b=this.g.get(c):(b=Ex(d),this.g.set(c,b));c=Vx(d);this.h++;b=Re(b,c);return Promise.resolve(b)};S("shaka.transmuxer.Mp3Transmuxer",
|
|
1433
|
-
|
|
1434
|
-
q.transmux=function(a,b,c,d,e){this.g?this.g.clearData():this.g=new Sj;a=Ab(a);a=this.g.parse(a);if("mp3"!=a
|
|
1435
|
-
|
|
1429
|
+
function pD(a){var b=new Aj(a,!0);Pj(b);Pj(b);W(b);W(b);Oj(b);Oj(b);Dj(b,3);Oj(b);Oj(b);W(b);W(b);Gj(b);Oj(b);Oj(b);Oj(b)&&W(b);Gj(b);Gj(b);Oj(b);Oj(b);Oj(b);Oj(b);a=Oj(b);b=Oj(b);var c=1;b&&a?c=0:b?c=3:a&&(c=2);return{Cf:c}}
|
|
1430
|
+
function qD(a,b,c,d){var e=new Uint8Array(23+(5+a.byteLength)+(5+b.byteLength)+(5+c.byteLength));e[0]=1;e[1]=(d.cf&3)<<6|(d.df?1:0)<<5|d.bf&31;e[2]=d.Ye;e[3]=d.Ze;e[4]=d.$e;e[5]=d.af;e[6]=d.Re;e[7]=d.Se;e[8]=d.Te;e[9]=d.Ue;e[10]=d.Ve;e[11]=d.We;e[12]=d.Xe;e[13]=240|(d.Xd&3840)>>8;e[14]=d.Xd&255;e[15]=252|d.Cf&3;e[16]=252|d.Ie&3;e[17]=248|d.He&7;e[18]=248|d.Ge&7;e[19]=0;e[20]=0;e[21]=(d.Ke&3)<<6|(d.zf&7)<<3|(d.Vf?1:0)<<2|3;e[22]=3;e[23]=160;e[24]=0;e[25]=1;e[26]=(a.byteLength&65280)>>8;e[27]=(a.byteLength&
|
|
1431
|
+
255)>>0;e.set(a,28);e[23+(5+a.byteLength)]=161;e[a.byteLength+29]=0;e[a.byteLength+30]=1;e[a.byteLength+31]=(b.byteLength&65280)>>8;e[a.byteLength+32]=(b.byteLength&255)>>0;e.set(b,a.byteLength+33);e[23+(a.byteLength+10+b.byteLength)]=162;e[a.byteLength+10+b.byteLength+24]=0;e[a.byteLength+10+b.byteLength+25]=1;e[a.byteLength+10+b.byteLength+26]=(c.byteLength&65280)>>8;e[a.byteLength+10+b.byteLength+27]=(c.byteLength&255)>>0;e.set(c,a.byteLength+10+b.byteLength+28);return e};function rD(a,b){var c=a[b+1]>>3&3,d=a[b+1]>>1&3,e=a[b+2]>>4&15,f=a[b+2]>>2&3;if(1!==c&&0!==e&&15!==e&&3!==f){var g=a[b+3]>>6;e=1E3*sD[14*(3===c?3-d:3===d?3:4)+e-1];f=tD[3*(3===c?0:2===c?1:2)+f];c=uD[c][d];var h=vD[d],k=Math.floor(c*e/f+(a[b+2]>>1&1))*h,l=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);(l=l?parseInt(l[1],10):0)&&87>=l&&2===d&&224E3<=e&&0===g&&(a[b+3]|=128);return{sampleRate:f,channelCount:3===g?1:2,da:k,Li:8*c*h}}return null}
|
|
1432
|
+
function wD(a,b){return 255===a[b]&&224===(a[b+1]&224)&&0!==(a[b+1]&6)}function xD(a,b){if(b+1<a.length&&wD(a,b)){var c=rD(a,b),d=4;c&&c.da&&(d=c.da);b+=d;return b===a.length||b+1<a.length&&wD(a,b)}return!1}
|
|
1433
|
+
var sD=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],tD=[44100,48E3,32E3,22050,24E3,16E3,11025,12E3,8E3],uD=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],vD=[0,1,1,4];function yD(a){this.i=a;this.h=0;this.g=new Map}q=yD.prototype;q.destroy=function(){this.g.clear()};q.isSupported=function(a){return"audio/mpeg"==a.toLowerCase().split(";")[0]?nb(this.convertCodecs("audio",a)):!1};q.convertCodecs=function(a,b){return"audio/mpeg"==b.toLowerCase().split(";")[0]?'audio/mp4; codecs="mp3"':b};q.getOriginalMimeType=function(){return this.i};
|
|
1434
|
+
q.transmux=function(a,b,c,d){for(var e=Ab(a),f=qj(e).length;f<e.length&&!xD(e,f);f++);var g;for(a=[];f<e.length;){var h=rD(e,f);if(!h)return Promise.reject(new T(2,3,3018,c?c.M()[0]:null));g||(g=h);f+h.da<=e.length&&a.push({data:e.subarray(f,f+h.da),size:h.da,duration:1152,eb:0,flags:{hb:0,Xa:0,Wa:0,Ua:0,Va:2,ib:0}});f+=h.da}if(!g)return Promise.reject(new T(2,3,3018,c?c.M()[0]:null));e=9E4*g.Li/g.sampleRate*this.h;d={id:b.id,type:"audio",codecs:"mp3",encrypted:b.encrypted&&0<b.drmInfos.length,timescale:g.sampleRate,
|
|
1435
|
+
duration:d,ab:[],qa:new Uint8Array([]),xa:new Uint8Array([]),Ba:0,Ca:0,data:{sb:this.h,baseMediaDecodeTime:e,Ya:a},stream:b};d=new yx([d]);c=b.id+"_"+c.i;this.g.has(c)?b=this.g.get(c):(b=Ex(d),this.g.set(c,b));c=Vx(d);this.h++;b=Re(b,c);return Promise.resolve(b)};S("shaka.transmuxer.Mp3Transmuxer",yD);yD.prototype.transmux=yD.prototype.transmux;yD.prototype.getOriginalMimeType=yD.prototype.getOriginalMimeType;yD.prototype.convertCodecs=yD.prototype.convertCodecs;yD.prototype.isSupported=yD.prototype.isSupported;
|
|
1436
|
+
yD.prototype.destroy=yD.prototype.destroy;je("audio/mpeg",function(){return new yD("audio/mpeg")},se);function zD(a){this.h=a;this.g=null}q=zD.prototype;q.destroy=function(){};q.isSupported=function(a){if("video/mp2t"!=a.toLowerCase().split(";")[0])return!1;var b=of(a).split(","),c=We("audio",b);b=We("video",b);return!c||b||"mp3"!=kf(c)?!1:nb(this.convertCodecs("audio",a))};q.convertCodecs=function(a,b){return"video/mp2t"==b.toLowerCase().split(";")[0]?"audio/mpeg":b};q.getOriginalMimeType=function(){return this.h};
|
|
1437
|
+
q.transmux=function(a,b,c,d,e){this.g?this.g.clearData():this.g=new Sj;a=Ab(a);a=this.g.parse(a);if("mp3"!=a.$c().audio||"audio"!=e)return Promise.reject(new T(2,3,3018,c?c.M()[0]:null));c=new Uint8Array([]);e=t(a.Ub());for(a=e.next();!a.done;a=e.next())if(a=a.value.data)for(b=0;b<a.length;)(d=rD(a,b))?(b+d.da<=a.length&&(c=Re(c,a.subarray(b,b+d.da))),b+=d.da):b++;return Promise.resolve(c)};S("shaka.transmuxer.MpegTsTransmuxer",zD);zD.prototype.transmux=zD.prototype.transmux;
|
|
1438
|
+
zD.prototype.getOriginalMimeType=zD.prototype.getOriginalMimeType;zD.prototype.convertCodecs=zD.prototype.convertCodecs;zD.prototype.isSupported=zD.prototype.isSupported;zD.prototype.destroy=zD.prototype.destroy;je("video/mp2t",function(){return new zD("video/mp2t")},re);/*
|
|
1436
1439
|
@license
|
|
1437
1440
|
MSS Transmuxer
|
|
1438
1441
|
Copyright 2015 Dash Industry Forum
|
|
1439
1442
|
SPDX-License-Identifier: BSD-3-Clause
|
|
1440
1443
|
*/
|
|
1441
|
-
function
|
|
1442
|
-
function
|
|
1444
|
+
function AD(a){this.h=a;(this.g=Cv.get("ISOBoxer")())&&BD(this)}
|
|
1445
|
+
function BD(a){function b(){this._procFullBox();this.flags&1&&(this._procField("AlgorithmID","uint",24),this._procField("IV_size","uint",8),this._procFieldArray("KID",16,"uint",8));this._procField("sample_count","uint",32);this._procEntries("entry",this.sample_count,function(c){this._procEntryField(c,"InitializationVector","data",8);this.flags&2&&(this._procEntryField(c,"NumberOfEntries","uint",16),this._procSubEntries(c,"clearAndCryptedData",c.NumberOfEntries,function(d){this._procEntryField(d,"BytesOfClearData",
|
|
1443
1446
|
"uint",16);this._procEntryField(d,"BytesOfEncryptedData","uint",32)}))})}a.g.addBoxProcessor("saio",function(){this._procFullBox();this.flags&1&&(this._procField("aux_info_type","uint",32),this._procField("aux_info_type_parameter","uint",32));this._procField("entry_count","uint",32);this._procFieldArray("offset",this.entry_count,"uint",1===this.version?64:32)});a.g.addBoxProcessor("saiz",function(){this._procFullBox();this.flags&1&&(this._procField("aux_info_type","uint",32),this._procField("aux_info_type_parameter",
|
|
1444
|
-
"uint",32));this._procField("default_sample_info_size","uint",8);this._procField("sample_count","uint",32);0===this.default_sample_info_size&&this._procFieldArray("sample_info_size",this.sample_count,"uint",8)});a.g.addBoxProcessor("senc",b);a.g.addBoxProcessor("uuid",function(){for(var c=!0,d=0;16>d;d++)this.usertype[d]!==
|
|
1447
|
+
"uint",32));this._procField("default_sample_info_size","uint",8);this._procField("sample_count","uint",32);0===this.default_sample_info_size&&this._procFieldArray("sample_info_size",this.sample_count,"uint",8)});a.g.addBoxProcessor("senc",b);a.g.addBoxProcessor("uuid",function(){for(var c=!0,d=0;16>d;d++)this.usertype[d]!==CD[d]&&(c=!1);c&&(this._parsing&&(this.type="sepiff"),b.call(this))})}q=AD.prototype;q.destroy=function(){};
|
|
1445
1448
|
q.isSupported=function(a,b){var c=a.startsWith("mss/");if(!this.g||!c)return!1;if(b)return nb(this.convertCodecs(b,a));b=this.convertCodecs("audio",a);a=this.convertCodecs("video",a);return nb(b)||nb(a)};q.convertCodecs=function(a,b){return b.replace("mss/","")};q.getOriginalMimeType=function(){return this.h};
|
|
1446
1449
|
q.transmux=function(a,b,c){if(!c)return Promise.resolve(Ab(a));if(!b.mssPrivateData)return Promise.reject(new T(2,3,3020,c?c.M()[0]:null));try{var d,e=this.g.parseBuffer(a),f=e.fetch("tfhd");f.track_ID=b.id+1;var g=e.fetch("tfdt"),h=e.fetch("traf");null===g&&(g=this.g.createFullBox("tfdt",h,f),g.version=1,g.flags=0,g.baseMediaDecodeTime=Math.floor(c.startTime*b.mssPrivateData.timescale));var k=e.fetch("trun"),l=e.fetch("tfxd");l&&l._parent.boxes.splice(l._parent.boxes.indexOf(l),1);var m=e.fetch("tfrf");
|
|
1447
1450
|
m&&m._parent.boxes.splice(m._parent.boxes.indexOf(m),1);var n=e.fetch("sepiff");if(null!==n){n.type="senc";n.usertype=void 0;var p=e.fetch("saio");if(null===p){p=this.g.createFullBox("saio",h);p.version=0;p.flags=0;p.entry_count=1;p.offset=[0];var r=this.g.createFullBox("saiz",h);r.version=0;r.flags=0;r.sample_count=n.sample_count;r.default_sample_info_size=0;r.sample_info_size=[];if(n.flags&2)for(d=0;d<n.sample_count;d+=1)r.sample_info_size[d]=10+6*n.entry[d].NumberOfEntries;else r.default_sample_info_size=
|
|
1448
|
-
8}}f.flags&=16777214;f.flags|=131072;k.flags|=1;var u=e.fetch("moof");k.data_offset=u.getLength()+8;var v=e.fetch("saio");null!==v&&(v.offset[0]=
|
|
1449
|
-
|
|
1450
|
-
q.isSupported=function(a,b){if("video/mp2t"!=a.toLowerCase().split(";")[0])return!1;var c=a;b&&(c=this.convertCodecs(b,a));var d=of(c).split(",");c=We("audio",d);d=We("video",d);if(c&&(c=kf(c),!
|
|
1451
|
+
8}}f.flags&=16777214;f.flags|=131072;k.flags|=1;var u=e.fetch("moof");k.data_offset=u.getLength()+8;var v=e.fetch("saio");null!==v&&(v.offset[0]=DD(u,"traf")+DD(h,"senc")+16);var w=Ab(e.write());return Promise.resolve(w)}catch(y){return y instanceof T?Promise.reject(y):Promise.reject(new T(2,3,3022,c?c.M()[0]:null))}};function DD(a,b){for(var c=8,d=0;d<a.boxes.length&&a.boxes[d].type!==b;d++)c+=a.boxes[d].size;return c}S("shaka.transmuxer.MssTransmuxer",AD);AD.prototype.transmux=AD.prototype.transmux;
|
|
1452
|
+
AD.prototype.getOriginalMimeType=AD.prototype.getOriginalMimeType;AD.prototype.convertCodecs=AD.prototype.convertCodecs;AD.prototype.isSupported=AD.prototype.isSupported;AD.prototype.destroy=AD.prototype.destroy;var CD=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);je("mss/audio/mp4",function(){return new AD("mss/audio/mp4")},se);je("mss/video/mp4",function(){return new AD("mss/video/mp4")},se);function ED(a){this.l=a;this.g=0;this.i=new Map;this.h=this.j=null}q=ED.prototype;q.destroy=function(){this.i.clear();this.h&&this.h.destroy()};
|
|
1453
|
+
q.isSupported=function(a,b){if("video/mp2t"!=a.toLowerCase().split(";")[0])return!1;var c=a;b&&(c=this.convertCodecs(b,a));var d=of(c).split(",");c=We("audio",d);d=We("video",d);if(c&&(c=kf(c),!FD.includes(c))||d&&(c=kf(d),!GD.includes(c)))return!1;if(b)return nb(this.convertCodecs(b,a));b=this.convertCodecs("audio",a);a=this.convertCodecs("video",a);return nb(b)||nb(a)};
|
|
1451
1454
|
q.convertCodecs=function(a,b){return"video/mp2t"==b.toLowerCase().split(";")[0]?(b=of(b).replace("mp4a.40.34","mp3").split(",").map(function(c){return cg(c,"audio/mp4")}).map(bg).join(","),"audio"==a?'audio/mp4; codecs="'+b+'"':'video/mp4; codecs="'+b+'"'):b};q.getOriginalMimeType=function(){return this.l};
|
|
1452
|
-
q.transmux=function(a,b,c,d,e){var f=Ab(a);if("audio"==e&&!ak(f)){for(var g=qj(f),h=g.length;h<f.length;h++)if(
|
|
1453
|
-
if(!v.length)throw new T(2,3,3023,c?c.M()[0]:null);for(var w=0;w<v.length;w++){var y=v[w],z=y.nalus;u.push.apply(u,x(z));var D=
|
|
1455
|
+
q.transmux=function(a,b,c,d,e){var f=Ab(a);if("audio"==e&&!ak(f)){for(var g=qj(f),h=g.length;h<f.length;h++)if(xD(f,h))return Promise.reject(new T(2,3,3018,c?c.M()[0]:null));for(h=g.length;h<f.length;h++)if(bD(f,h))return this.h||(this.h=new dD("audio/aac")),this.h.transmux(a,b,c,d,e);return Promise.reject(new T(2,3,3018,c?c.M()[0]:null))}this.j?this.j.clearData():this.j=new Sj;var k=this.j.parse(f),l=[],m=k.$c();try{var n=null;if("video"==e){switch(m.video){case "avc":var p=[],r=null,u=[],v=k.nc();
|
|
1456
|
+
if(!v.length)throw new T(2,3,3023,c?c.M()[0]:null);for(var w=0;w<v.length;w++){var y=v[w],z=y.nalus;u.push.apply(u,x(z));var D=lD(z);if(D){null==r&&(r=y.dts);var A=void 0;A=w+1<v.length?(v[w+1].dts||0)-(y.dts||0):1<v.length?(y.dts||0)-(v[w-1].dts||0):9E4*(c.endTime-c.startTime);p.push({data:D.data,size:D.data.byteLength,duration:A,eb:Math.round((y.pts||0)-(y.dts||0)),flags:{hb:0,Xa:0,Wa:0,Ua:0,Va:D.hd?2:1,ib:D.hd?0:1}})}}var B=jD(u);if(!B||null==r)throw new T(2,3,3018,c?c.M()[0]:null);b.height=B.height;
|
|
1454
1457
|
b.width=B.width;n={id:b.id,type:"video",codecs:"avc1",encrypted:b.encrypted&&0<b.drmInfos.length,timescale:9E4,duration:d,ab:[],qa:new Uint8Array([]),xa:B.xa,Ba:B.Ba,Ca:B.Ca,data:{sb:this.g,baseMediaDecodeTime:r,Ya:p},stream:b};break;case "hvc":var C=[],E=null,F=[],J=k.nc();if(!J.length)throw new T(2,3,3023,c?c.M()[0]:null);for(var K=0;K<J.length;K++){var L=J[K],I=L.nalus;F.push.apply(F,x(I));for(var N=!1,M=[],O=!1,Q=t(I),R=Q.next();!R.done;R=Q.next()){var U=R.value;switch(U.type){case 1:case 0:var aa=
|
|
1455
1458
|
O=!0;break;case 19:case 20:case 21:N=aa=O=!0;break;case 32:aa=!0;break;case 33:aa=!0;break;case 34:aa=!0;break;case 35:O=aa=!0;break;case 39:case 40:aa=!0;break;default:aa=!1}if(O&&aa){var la=U.fullData.byteLength,na=new Uint8Array(4);na[0]=la>>24&255;na[1]=la>>16&255;na[2]=la>>8&255;na[3]=la&255;M.push(na);M.push(U.fullData)}}var Ia=M.length?{data:Re.apply(Le,x(M)),hd:N}:null;if(Ia){null==E&&null!=L.dts&&(E=L.dts);var Aa=void 0;Aa=K+1<J.length?(J[K+1].dts||0)-(L.dts||0):1<J.length?(L.dts||0)-(J[K-
|
|
1456
|
-
1].dts||0):9E4*(c.endTime-c.startTime);C.push({data:Ia.data,size:Ia.data.byteLength,duration:Aa,eb:Math.round((L.pts||0)-(L.dts||0)),flags:{hb:0,Xa:0,Wa:0,Ua:0,Va:Ia.hd?2:1,ib:Ia.hd?0:1}})}}var ab=
|
|
1457
|
-
(l.push(n),n=null)}if("audio"==e){switch(m.audio){case "aac":for(var Va=[],xa,wa=null,Dc=t(k.Ub()),eb=Dc.next();!eb.done;eb=Dc.next()){var Tb=eb.value,Ec=Tb.data;if(Ec){var lb=0;xa=
|
|
1458
|
-
Xa:0,Wa:0,Ua:0,Va:2,ib:0}});lb+=oe}else lb++}}}if(!xa||null==wa){if(!k.nc().length)throw new T(2,3,3018,c?c.M()[0]:null);wa=9E4*c.startTime;var pe=We("audio",b.codecs.split(","));if(!pe||!b.channelsCount||!b.audioSamplingRate)throw new T(2,3,3018,c?c.M()[0]:null);xa={sampleRate:b.audioSamplingRate,channelCount:b.channelsCount,codec:pe};var Md
|
|
1459
|
-
duration:1024,eb:0,flags:{hb:0,Xa:0,Wa:0,Ua:0,Va:2,ib:0}}),Nd+=1024/xa.sampleRate*9E4}var
|
|
1460
|
-
|
|
1461
|
-
Ba:0,Ca:0,data:{sb:this.g,baseMediaDecodeTime:
|
|
1462
|
-
Ef++}}if(0==
|
|
1463
|
-
te);Ff?(
|
|
1464
|
-
[],
|
|
1465
|
-
0,1,2,3,4];break;case 134:Cb=[1,1,6,0,1,2,3,4,5];break;case 135:Cb=[1,1,7,0,1,2,3,4,5,6];break;case 136:Cb=[1,1,8,0,1,2,3,4,5,6,7]}var
|
|
1466
|
-
yd=dh+2,
|
|
1467
|
-
Ca:0,data:{sb:this.g,baseMediaDecodeTime:
|
|
1468
|
-
|
|
1459
|
+
1].dts||0):9E4*(c.endTime-c.startTime);C.push({data:Ia.data,size:Ia.data.byteLength,duration:Aa,eb:Math.round((L.pts||0)-(L.dts||0)),flags:{hb:0,Xa:0,Wa:0,Ua:0,Va:Ia.hd?2:1,ib:Ia.hd?0:1}})}}var ab=mD(F);if(!ab||null==E)throw new T(2,3,3018,c?c.M()[0]:null);b.height=ab.height;b.width=ab.width;n={id:b.id,type:"video",codecs:"hvc1",encrypted:b.encrypted&&0<b.drmInfos.length,timescale:9E4,duration:d,ab:[],qa:new Uint8Array([]),xa:ab.xa,Ba:ab.Ba,Ca:ab.Ca,data:{sb:this.g,baseMediaDecodeTime:E,Ya:C},stream:b}}n&&
|
|
1460
|
+
(l.push(n),n=null)}if("audio"==e){switch(m.audio){case "aac":for(var Va=[],xa,wa=null,Dc=t(k.Ub()),eb=Dc.next();!eb.done;eb=Dc.next()){var Tb=eb.value,Ec=Tb.data;if(Ec){var lb=0;xa=aD(Ec,lb);if(!xa)throw new T(2,3,3018,c?c.M()[0]:null);b.audioSamplingRate=xa.sampleRate;b.channelsCount=xa.channelCount;null==wa&&null!==Tb.pts&&(wa=Tb.pts);for(;lb<Ec.length;){var wd=$C(Ec,lb);if(wd){var oe=wd.Nd+wd.da;lb+oe<=Ec.length&&Va.push({data:Ec.subarray(lb+wd.Nd,lb+oe),size:wd.da,duration:1024,eb:0,flags:{hb:0,
|
|
1461
|
+
Xa:0,Wa:0,Ua:0,Va:2,ib:0}});lb+=oe}else lb++}}}if(!xa||null==wa){if(!k.nc().length)throw new T(2,3,3018,c?c.M()[0]:null);wa=9E4*c.startTime;var pe=We("audio",b.codecs.split(","));if(!pe||!b.channelsCount||!b.audioSamplingRate)throw new T(2,3,3018,c?c.M()[0]:null);xa={sampleRate:b.audioSamplingRate,channelCount:b.channelsCount,codec:pe};var Md=cD(pe,b.channelsCount);if(!Md)throw new T(2,3,3018,c?c.M()[0]:null);for(var Zi=wa+9E4*(c.endTime-c.startTime),Nd=wa;Nd<Zi;)Va.push({data:Md,size:Md.byteLength,
|
|
1462
|
+
duration:1024,eb:0,flags:{hb:0,Xa:0,Wa:0,Ua:0,Va:2,ib:0}}),Nd+=1024/xa.sampleRate*9E4}var $i=xa.sampleRate,aj=wa/9E4*$i;n={id:b.id,type:"audio",codecs:xa.codec,encrypted:b.encrypted&&0<b.drmInfos.length,timescale:$i,duration:d,ab:[],qa:new Uint8Array([]),xa:new Uint8Array([]),Ba:0,Ca:0,data:{sb:this.g,baseMediaDecodeTime:aj,Ya:Va},stream:b};break;case "ac3":for(var Qg=[],qe=0,oc=new Uint8Array([]),Hj=null,av=t(k.Ub()),jn=av.next();!jn.done;jn=av.next()){var kn=jn.value,ln=kn.data;null==Hj&&null!==
|
|
1463
|
+
kn.pts&&(Hj=kn.pts);for(var Df=0;Df<ln.length;){var Qd=eD(ln,Df);Qd?(b.audioSamplingRate=Qd.sampleRate,b.channelsCount=Qd.channelCount,qe=Qd.sampleRate,oc=Qd.qa,Qg.push({data:ln.subarray(Df,Df+Qd.da),size:Qd.da,duration:1536,eb:0,flags:{hb:0,Xa:0,Wa:0,Ua:0,Va:2,ib:0}}),Df+=Qd.da):Df++}}if(0==qe||0==oc.byteLength||null==Hj)throw new T(2,3,3018,c?c.M()[0]:null);var WD=Hj/9E4*qe;n={id:b.id,type:"audio",codecs:"ac-3",encrypted:b.encrypted&&0<b.drmInfos.length,timescale:qe,duration:d,ab:[],qa:oc,xa:new Uint8Array([]),
|
|
1464
|
+
Ba:0,Ca:0,data:{sb:this.g,baseMediaDecodeTime:WD,Ya:Qg},stream:b};break;case "ec3":for(var bv=[],Ij=0,mn=new Uint8Array([]),Jj=null,cv=t(k.Ub()),nn=cv.next();!nn.done;nn=cv.next()){var on=nn.value,pn=on.data;null==Jj&&null!==on.pts&&(Jj=on.pts);for(var Ef=0;Ef<pn.length;){var Rd=hD(pn,Ef);Rd?(b.audioSamplingRate=Rd.sampleRate,b.channelsCount=Rd.channelCount,Ij=Rd.sampleRate,mn=Rd.qa,bv.push({data:pn.subarray(Ef,Ef+Rd.da),size:Rd.da,duration:1536,eb:0,flags:{hb:0,Xa:0,Wa:0,Ua:0,Va:2,ib:0}}),Ef+=Rd.da):
|
|
1465
|
+
Ef++}}if(0==Ij||0==mn.byteLength||null==Jj)throw new T(2,3,3018,c?c.M()[0]:null);var XD=Jj/9E4*Ij;n={id:b.id,type:"audio",codecs:"ec-3",encrypted:b.encrypted&&0<b.drmInfos.length,timescale:Ij,duration:d,ab:[],qa:mn,xa:new Uint8Array([]),Ba:0,Ca:0,data:{sb:this.g,baseMediaDecodeTime:XD,Ya:bv},stream:b};break;case "mp3":for(var dv=[],Kj,Lj=null,ev=t(k.Ub()),qn=ev.next();!qn.done;qn=ev.next()){var rn=qn.value,ch=rn.data;if(ch){null==Lj&&null!==rn.pts&&(Lj=rn.pts);for(var te=0;te<ch.length;){var Ff=rD(ch,
|
|
1466
|
+
te);Ff?(Kj||(Kj=Ff),te+Ff.da<=ch.length&&dv.push({data:ch.subarray(te,te+Ff.da),size:Ff.da,duration:1152,eb:0,flags:{hb:0,Xa:0,Wa:0,Ua:0,Va:2,ib:0}}),te+=Ff.da):te++}}}if(!Kj||null==Lj)throw new T(2,3,3018,c?c.M()[0]:null);var fv=Kj.sampleRate,YD=Lj/9E4*fv;n={id:b.id,type:"audio",codecs:"mp3",encrypted:b.encrypted&&0<b.drmInfos.length,timescale:fv,duration:d,ab:[],qa:new Uint8Array([]),xa:new Uint8Array([]),Ba:0,Ca:0,data:{sb:this.g,baseMediaDecodeTime:YD,Ya:dv},stream:b};break;case "opus":var gv=
|
|
1467
|
+
[],Mj=null,Yc=k.F;if(!Yc)throw new T(2,3,3018,c?c.M()[0]:null);var Cb=[];switch(Yc.yh){case 1:case 2:Cb=[0];break;case 0:Cb=[255,1,1,0,1];break;case 128:Cb=[255,2,0,0,1];break;case 3:Cb=[1,2,1,0,2,1];break;case 4:Cb=[1,2,2,0,1,2,3];break;case 5:Cb=[1,3,2,0,4,1,2,3];break;case 6:Cb=[1,4,2,0,4,1,2,3,5];break;case 7:Cb=[1,4,2,0,4,1,2,3,5,6];break;case 8:Cb=[1,5,3,0,6,1,2,3,4,5,7];break;case 130:Cb=[1,1,2,0,1];break;case 131:Cb=[1,1,3,0,1,2];break;case 132:Cb=[1,1,4,0,1,2,3];break;case 133:Cb=[1,1,5,
|
|
1468
|
+
0,1,2,3,4];break;case 134:Cb=[1,1,6,0,1,2,3,4,5];break;case 135:Cb=[1,1,7,0,1,2,3,4,5,6];break;case 136:Cb=[1,1,8,0,1,2,3,4,5,6,7]}var hv=new Uint8Array([0,Yc.channelCount,0,0,Yc.sampleRate>>>24&255,Yc.sampleRate>>>17&255,Yc.sampleRate>>>8&255,Yc.sampleRate>>>0&255,0,0].concat(x(Cb)));for(var iv=Yc.sampleRate,jv=t(k.Ub()),sn=jv.next();!sn.done;sn=jv.next()){var tn=sn.value,Gf=tn.data;null==Mj&&null!==tn.pts&&(Mj=tn.pts);for(var dh=0;dh<Gf.length;){for(var ZD=0!==(Gf[dh+1]&16),$D=0!==(Gf[dh+1]&8),
|
|
1469
|
+
yd=dh+2,Nj=0;255===Gf[yd];)Nj+=255,yd+=1;Nj+=Gf[yd];yd+=1;yd+=ZD?2:0;yd+=$D?2:0;var kv=Gf.slice(yd,yd+Nj);gv.push({data:kv,size:kv.byteLength,duration:960,eb:0,flags:{hb:0,Xa:0,Wa:0,Ua:0,Va:2,ib:0}});dh=yd+Nj}}if(0==hv.byteLength||null==Mj)throw new T(2,3,3018,c?c.M()[0]:null);b.audioSamplingRate=Yc.sampleRate;b.channelsCount=Yc.channelCount;var aE=Mj/9E4*iv;n={id:b.id,type:"audio",codecs:"opus",encrypted:b.encrypted&&0<b.drmInfos.length,timescale:iv,duration:d,ab:[],qa:hv,xa:new Uint8Array([]),Ba:0,
|
|
1470
|
+
Ca:0,data:{sb:this.g,baseMediaDecodeTime:aE,Ya:gv},stream:b}}n&&(l.push(n),n=null)}}catch(un){return un&&3023==un.code?Promise.resolve(new Uint8Array([])):Promise.reject(un)}if(!l.length)return Promise.reject(new T(2,3,3018,c?c.M()[0]:null));var lv=new yx(l),vn=b.id+"_"+c.i;if(this.i.has(vn))var wn=this.i.get(vn);else wn=Ex(lv),this.i.set(vn,wn);var bE=Vx(lv);this.g++;var cE=Re(wn,bE);return Promise.resolve(cE)};S("shaka.transmuxer.TsTransmuxer",ED);ED.prototype.transmux=ED.prototype.transmux;
|
|
1471
|
+
ED.prototype.getOriginalMimeType=ED.prototype.getOriginalMimeType;ED.prototype.convertCodecs=ED.prototype.convertCodecs;ED.prototype.isSupported=ED.prototype.isSupported;ED.prototype.destroy=ED.prototype.destroy;var FD=["aac","ac-3","ec-3","mp3","opus"],GD=["avc","hevc"];je("video/mp2t",function(){return new ED("video/mp2t")},ne);/*
|
|
1469
1472
|
@license
|
|
1470
1473
|
EME Encryption Scheme Polyfill
|
|
1471
1474
|
Copyright 2019 Google LLC
|
|
1472
1475
|
SPDX-License-Identifier: Apache-2.0
|
|
1473
1476
|
*/
|
|
1474
|
-
function
|
|
1475
|
-
function
|
|
1476
|
-
function
|
|
1477
|
+
function HD(){}var ID;
|
|
1478
|
+
function JD(){ID||navigator.emeEncryptionSchemePolyfilled?console.debug("EmeEncryptionSchemePolyfill: Already installed."):navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration?(ID=navigator.requestMediaKeySystemAccess,console.debug("EmeEncryptionSchemePolyfill: Waiting to detect encryptionScheme support."),navigator.requestMediaKeySystemAccess=KD,navigator.emeEncryptionSchemePolyfilled=!0):console.debug("EmeEncryptionSchemePolyfill: EME not found")}
|
|
1479
|
+
function KD(a,b){var c=this,d;return P(function(e){if(1==e.g)return console.assert(c==navigator,'bad "this" for requestMediaKeySystemAccess'),G(e,ID.call(c,a,b),2);d=e.h;if(LD(d))return console.debug("EmeEncryptionSchemePolyfill: Native encryptionScheme support found."),navigator.requestMediaKeySystemAccess=ID,e.return(d);console.debug("EmeEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support.");navigator.requestMediaKeySystemAccess=MD;return e.return(MD.call(c,
|
|
1477
1480
|
a,b))})}
|
|
1478
|
-
function
|
|
1479
|
-
n.name="NotSupportedError",n.code=DOMException.NOT_SUPPORTED_ERR,n;return G(v,
|
|
1480
|
-
function
|
|
1481
|
-
function
|
|
1482
|
-
navigator.mediaCapabilities.decodingInfo=
|
|
1483
|
-
function
|
|
1484
|
-
new
|
|
1485
|
-
function
|
|
1486
|
-
f.length&&(e.audioCapabilities=f);g.length&&(e.videoCapabilities=g);b=e;return G(d,navigator.requestMediaKeySystemAccess(a.keySystemConfiguration.keySystem,[b]),2)}c=d.h;return d.return(c)})}S("McEncryptionSchemePolyfill",
|
|
1487
|
-
|
|
1488
|
-
function
|
|
1489
|
-
function
|
|
1481
|
+
function MD(a,b){var c=this,d,e,f,g,h,k,l,m,n,p,r,u;return P(function(v){if(1==v.g){console.assert(c==navigator,'bad "this" for requestMediaKeySystemAccess');d=ND(a);e=[];f=t(b);for(g=f.next();!g.done;g=f.next())h=g.value,k=OD(h.videoCapabilities,d),l=OD(h.audioCapabilities,d),h.videoCapabilities&&h.videoCapabilities.length&&!k.length||h.audioCapabilities&&h.audioCapabilities.length&&!l.length||(m=Object.assign({},h),m.videoCapabilities=k,m.audioCapabilities=l,e.push(m));if(!e.length)throw n=Error("Unsupported keySystem or supportedConfigurations."),
|
|
1482
|
+
n.name="NotSupportedError",n.code=DOMException.NOT_SUPPORTED_ERR,n;return G(v,ID.call(c,a,e),2)}p=v.h;u=r=null;e[0]&&(e[0].videoCapabilities&&(r=e[0].videoCapabilities[0].encryptionScheme),e[0].audioCapabilities&&(u=e[0].audioCapabilities[0].encryptionScheme));return v.return(new PD(p,r,u))})}function OD(a,b){return a?a.filter(function(c){return QD(c.encryptionScheme,b)}):a}S("EmeEncryptionSchemePolyfill",HD);HD.install=JD;function RD(){}var SD;
|
|
1483
|
+
function TD(){SD||navigator.mediaCapabilitiesEncryptionSchemePolyfilled?console.debug("McEncryptionSchemePolyfill: Already installed."):navigator.mediaCapabilities?(SD=navigator.mediaCapabilities.decodingInfo,console.debug("McEncryptionSchemePolyfill: Waiting to detect encryptionScheme support."),navigator.mediaCapabilities.decodingInfo=UD,navigator.mediaCapabilitiesEncryptionSchemePolyfilled=!0):console.debug("McEncryptionSchemePolyfill: MediaCapabilities not found")}
|
|
1484
|
+
function UD(a){var b=this,c,d;return P(function(e){switch(e.g){case 1:return console.assert(b==navigator.mediaCapabilities,'bad "this" for decodingInfo'),G(e,SD.call(b,a),2);case 2:c=e.h;if(!a.keySystemConfiguration)return e.return(c);if((d=c.keySystemAccess)&&LD(d))return console.debug("McEncryptionSchemePolyfill: Native encryptionScheme support found."),navigator.mediaCapabilities.decodingInfo=SD,e.return(c);console.debug("McEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support.");
|
|
1485
|
+
navigator.mediaCapabilities.decodingInfo=VD;if(d){e.u(3);break}return G(e,dE(a),4);case 4:return c.keySystemAccess=e.h,e.return(c);case 3:return e.return(VD.call(b,a))}})}
|
|
1486
|
+
function VD(a){var b=this,c,d,e,f,g,h,k;return P(function(l){switch(l.g){case 1:return console.assert(b==navigator.mediaCapabilities,'bad "this" for decodingInfo'),d=c=null,!a.keySystemConfiguration||(e=a.keySystemConfiguration,f=e.keySystem,d=e.audio&&e.audio.encryptionScheme,c=e.video&&e.video.encryptionScheme,g=ND(f),h={powerEfficient:!1,smooth:!1,supported:!1,keySystemAccess:null,configuration:a},QD(d,g)&&QD(c,g))?G(l,SD.call(b,a),2):l.return(h);case 2:k=l.h;if(k.keySystemAccess){k.keySystemAccess=
|
|
1487
|
+
new PD(k.keySystemAccess,c,d);l.u(3);break}if(!a.keySystemConfiguration){l.u(3);break}return G(l,dE(a),5);case 5:k.keySystemAccess=l.h;case 3:return l.return(k)}})}
|
|
1488
|
+
function dE(a){var b,c;return P(function(d){if(1==d.g){var e=a.keySystemConfiguration,f=[],g=[];e.audio&&f.push({robustness:e.audio.robustness||"",contentType:a.audio.contentType,encryptionScheme:e.audio.encryptionScheme});e.video&&g.push({robustness:e.video.robustness||"",contentType:a.video.contentType,encryptionScheme:e.video.encryptionScheme});e={initDataTypes:e.initDataType?[e.initDataType]:[],distinctiveIdentifier:e.distinctiveIdentifier,persistentState:e.persistentState,sessionTypes:e.sessionTypes};
|
|
1489
|
+
f.length&&(e.audioCapabilities=f);g.length&&(e.videoCapabilities=g);b=e;return G(d,navigator.requestMediaKeySystemAccess(a.keySystemConfiguration.keySystem,[b]),2)}c=d.h;return d.return(c)})}S("McEncryptionSchemePolyfill",RD);RD.install=TD;function PD(a,b,c){this.g=a;this.i=b||null;this.h=c||null;this.keySystem=a.keySystem}
|
|
1490
|
+
PD.prototype.getConfiguration=function(){var a=this.g.getConfiguration();if(a.videoCapabilities)for(var b=t(a.videoCapabilities),c=b.next();!c.done;c=b.next())c.value.encryptionScheme=this.i;if(a.audioCapabilities)for(b=t(a.audioCapabilities),c=b.next();!c.done;c=b.next())c.value.encryptionScheme=this.h;return a};PD.prototype.createMediaKeys=function(){return this.g.createMediaKeys()};
|
|
1491
|
+
function ND(a){if(a.startsWith("com.widevine")||a.startsWith("com.microsoft")||a.startsWith("com.chromecast")||a.startsWith("com.adobe")||a.startsWith("org.w3"))return"cenc";if(a.startsWith("com.apple"))return"cbcs";console.warn("EmeEncryptionSchemePolyfill: Unknown key system:",a,"Please contribute!");return null}function LD(a){a=a.getConfiguration();var b=a.audioCapabilities&&a.audioCapabilities[0];return(a=a.videoCapabilities&&a.videoCapabilities[0]||b)&&void 0!==a.encryptionScheme?!0:!1}
|
|
1492
|
+
function QD(a,b){if(!a||a==b)return!0;if("cbcs"==a||"cbcs-1-9"==a)if(eE||fE)return!0;return!1}function gE(){}function qA(){JD();TD()}S("EncryptionSchemePolyfills",gE);gE.install=qA;var fE=navigator.userAgent.includes("CrKey"),eE=100<=parseInt(navigator.userAgent.split("Firefox/").pop(),10);"undefined"!==typeof module&&module.exports&&(module.exports=gE);}).call(exportTo,innerGlobal,innerGlobal,undefined);if(typeof exports!="undefined")for(var k in exportTo.shaka)exports[k]=exportTo.shaka[k];else if(typeof define=="function"&&define.amd)define(function(){return exportTo.shaka});else innerGlobal.shaka=exportTo.shaka})();
|
|
1490
1493
|
|
|
1491
1494
|
//# sourceMappingURL=shaka-player.compiled.map
|