@castlabs/prestoplay 6.23.1 → 6.25.0
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/CHANGELOG.md +35 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +7 -7
- package/cjs/cl.cast.js +116 -116
- package/cjs/cl.conviva.js +32 -32
- package/cjs/cl.core.js +607 -591
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +88 -86
- package/cjs/cl.externs.js +105 -54
- package/cjs/cl.freewheel.js +25 -24
- package/cjs/cl.hls.js +77 -71
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +24 -23
- package/cjs/cl.mse.js +352 -342
- package/cjs/cl.muxdata.js +15 -15
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +15 -14
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.sessions.js +16 -16
- package/cjs/cl.simid.js +15 -15
- package/cjs/cl.smooth.js +72 -72
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +72 -72
- package/cjs/cl.ttml.js +29 -29
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +12 -12
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.yospace.js +4 -4
- package/cjs/cl.youbora.js +37 -37
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +88 -88
- package/cl.conviva.js +27 -27
- package/cl.core.js +491 -478
- package/cl.crypto.js +9 -9
- package/cl.dash.js +82 -80
- package/cl.externs.js +105 -54
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +79 -74
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +18 -17
- package/cl.mse.js +310 -306
- package/cl.muxdata.js +13 -13
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +10 -10
- package/cl.playlist.js +5 -5
- package/cl.sessions.js +10 -10
- package/cl.simid.js +13 -13
- package/cl.smooth.js +60 -59
- package/cl.thumbnails.js +19 -19
- package/cl.tizen.js +57 -57
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -8
- package/cl.vr.js +14 -14
- package/cl.vtt.js +12 -12
- package/cl.yospace.js +3 -3
- package/cl.youbora.js +28 -28
- package/package.json +1 -1
- package/typings.d.ts +54 -25
package/cjs/cl.mse.js
CHANGED
|
@@ -1,350 +1,360 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
_.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
_.
|
|
11
|
-
c?'CHECKSUM\x3d"'+c+'" ':"",'VALUE\x3d"'+e+'"',"\x3e\x3c/KID\x3e\x3c/PROTECTINFO\x3e",d?
|
|
12
|
-
b,d||null,e,a,c)};_.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
_.
|
|
16
|
-
|
|
17
|
-
_.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
_.
|
|
21
|
-
|
|
22
|
-
|
|
2
|
+
var f=function(window){var QC,RC,SC,TC,UC,VC,WC,XC,YC,ZC,$C,aD,bD,cD,dD,eD,fD,gD,hD,iD,jD,lD,mD,nD,oD,pD,qD,rD,sD,tD,uD,vD,wD,xD,yD,zD,AD,BD,CD,DD,FD,GD,HD,ID,JD,KD,LD,MD,ND,OD,PD,QD,SD,TD,UD,VD,WD,XD,YD,$D,cE,dE,fE,gE,hE,iE,jE,kE,lE,nE,oE,qE,rE,wE,xE,yE,zE,AE,BE,CE,DE,FE,JE,KE,ME,NE,OE,PE,RE,TE,UE,WE,XE,YE,$E,aF,bF,cF,dF,eF,fF,gF,hF,jF,oF,uF,zF,CF,rF,BF,DF,EF,FF,GF,HF,IF,JF,KF,LF,PF,RF,SF,TF,QF,VF,UF,WF,XF,$F,aG,bG,ZF,YF,cG,gG,iG,fG,jG,eG,hG,dG,lG,kG,mG,nG,oG,rG,tG,wG,yG,xG,CG,FG,DG,EG,GG,HG,IG,JG,KG,MG,NG,OG,PG,QG,SG,
|
|
3
|
+
TG,UG,WG,XG,VG,YG,ZG,$G,aH,bH,cH,dH,eH,fH,iH,lH,mH,qH,oH,pH,uH,tH,vH,zH,xH,BH,CH,DH,FH,EH,GH,IH,HH,OH,PH,LH,JH,MH,NH,QH,RH,UH,TH,VH,WH,XH,KH,YH,SH,aI,bI,dI,cI,eI,sH,fI,gI,jI,hI,iI,lI,kI,mI,nI,oI,rI,tI,sI,vI,uI,xI,yI,zI,CI,BI,AI,DI,FI,EI,GI,HI,II,JI,KI,LI,OI,NI,MI,QI,PI,SI,WI,YI,ZI,dJ,gJ,hJ,jJ,lJ,nJ,pJ,TI,qJ,tJ,uJ,vJ,xJ,yJ,AJ,BJ,DJ,kJ,mJ,bJ,GJ,FJ,$I,oJ,JJ,HJ,CJ,EJ,LJ,KJ,IJ,SJ,TJ,NJ,VJ,OJ,QJ,YJ,XJ,RJ,WJ,ZJ,aJ,zJ,$J,aK,PJ,wJ,cJ,eJ,VI,MJ,fJ,UJ,rJ,sJ,bK,eK,fK,gK,hK,iK,lK,HK,kK,NK,OK,VK,jK,UK,WK,PK,QK,
|
|
4
|
+
RK,aL,XK,LK,KK,JK,MK,ZK,$K,SK,TK,kL,fL,oL,pL,qL,uL,rL,gH,kH,hH,GL,FL,nH,jH,DL,IL,CL,HL,BL,JL,lL,jL,tL,EL,LL,sL,wL,cL,vL,ML,iL,OL,NL,PL,QL,TL,nL,hL,SL,RL,YK,KL,zL,VL,rH,yL,xL,UL,IK,WL,eL,dL,mL,XL,YL,ZL,$L,aM,bM,cM,dM,eM;QC=" and the media start time is ";RC=" between media times and segment times for ";SC=" buffer";TC=" buffer. Range:";UC=" is being or has been set up";VC=" range:";WC=" seconds";XC=" with element state: ";YC=". Adjusting timestampOffset.";ZC=". The segment start time is ";$C="\x3c/DATA\x3e\x3c/WRMHEADER\x3e";
|
|
5
|
+
aD="\x3c/LA_URL\x3e";bD="\x3cLA_URL\x3e";cD='\x3cWRMHEADER xmlns\x3d"http://schemas.microsoft.com/DRM/2007/03/PlayReadyHeader" version\x3d"';dD="Aborting operations for ";eD="Appended audio segment ";fD="Appended video segment ";gD="Appending data to ";hD="Buffer:";iD="Cannot get segment, period ID unknown";jD="Choosing new streams after key status change";_.kD="Could not load text stream with id: ";lD="Detected a delta of ";mD="Done Aborting operations for ";nD="Done Appending data to ";oD="Done Flushing buffer for ";
|
|
6
|
+
pD="Done Removing data from ";qD="Done Setting append window for ";rD="Done Setting timestamp offset for ";sD="Failed to abort operations for ";tD="Failed to append data for ";uD="Failed to flush buffer for ";vD="Failed to remove data from ";wD="Failed to set append window for ";xD="Failed to set timestamp offset for ";yD="Flushing buffer for ";zD="IterateSegmentReference";AD="Jumping forward";BD="MediaSource threw QuotaExceededError:";CD="No more scheduled operations for ";DD="Period not found.";
|
|
7
|
+
_.ED="Player is in ERROR state and can not switch to ";FD="PrestoPlay TextTrack";GD="QuotaExceededError";HD="Removing audio from variant - audio not compatible with platform";ID="Removing data from ";JD="Reset transmuxers.";KD="Setting append window for ";LD="Setting playback rate to\x3d";MD="Setting timestamp offset for ";ND="Skip buffer flush for ";OD="Starting next operation for ";PD="URI-REPLACEMENT";QD="Update-End received for ";_.RD="Updating manifest...";SD="X-Playback-Session-Id";TD="bufferBehind\x3d";
|
|
8
|
+
UD="bufferedBehind\x3d";VD="calling onCanSwitch()...";WD="cannot find segment";XD="clpp.mse.Player";YD="currentPeriod.startTime\x3d";_.ZD="dashif:Laurl";$D="failed to get buffered range for ";_.aE="getSegmentNextReference";_.bE="iterateSegmentReference";cE="key-restriction";dE="manifest.start";_.eE="onChooseStreams_";fE="presentationTime:";gE="presentationTime\x3d";hE="reference.endTime\x3d";iE="reference.position\x3d";jE="reference.startTime\x3d";kE="sourceopen";lE="startstreaming";_.mE="subtitles";
|
|
9
|
+
nE="switch: Stream ";oE="updateend";_.pE=function(a,b){return _.sh[a]=b};qE=function(a,b){for(var c in a.a)b(c,a.a[c])};rE=function(a){for(var b=a.a+a.f.byteOffset,c=void 0;_.un(a);)if(0===_.wn(a)){c=a.a+a.f.byteOffset-1;break}a=a.f.buffer.slice(b,c);return _.T.ea(a)};_.tE=function(a){var b=new Uint8Array(sE),c=4+b.byteLength+a.j.byteLength+4+a.f.byteLength,d=new _.qn(c,!1);_.W(d,c);_.sn(d,b);_.sn(d,a.j);_.W(d,a.f.byteLength);_.sn(d,a.f);return _.bk(d.buffer)};
|
|
10
|
+
_.uE=function(a,b,c,d){var e=_.bn(b);if(8!==e.byteLength)e="";else{var f=_.jp(e);e=_.Zm(f);b:switch(f=f.byteLength,_.ci("Trying to create PlayReady header in version",a),a){case "4.0.0.0":e=[cD+a+'"\x3e',"\x3cDATA\x3e\x3cPROTECTINFO\x3e","\x3cKEYLEN\x3e"+f+"\x3c/KEYLEN\x3e","\x3cALGID\x3eAESCTR\x3c/ALGID\x3e\x3c/PROTECTINFO\x3e","\x3cKID\x3e"+e+"\x3c/KID\x3e",c?"\x3cCHECKSUM\x3e"+c+"\x3c/CHECKSUM\x3e":"",d?bD+d+aD:"",$C].join("");break b;case "4.1.0.0":e=[cD+a+'"\x3e','\x3cDATA\x3e\x3cPROTECTINFO\x3e\x3cKID ALGID\x3d"AESCTR" ',
|
|
11
|
+
c?'CHECKSUM\x3d"'+c+'" ':"",'VALUE\x3d"'+e+'"',"\x3e\x3c/KID\x3e\x3c/PROTECTINFO\x3e",d?bD+d+aD:"",$C].join("");break b;case "4.2.0.0":case "4.3.0.0":e=[cD+a+'"\x3e','\x3cDATA\x3e\x3cPROTECTINFO\x3e\x3cKIDS\x3e\x3cKID ALGID\x3d"AESCTR" ',c?'CHECKSUM\x3d"'+c+'" ':"",'VALUE\x3d"'+e+'"',"\x3e\x3c/KID\x3e\x3c/KIDS\x3e\x3c/PROTECTINFO\x3e",d?bD+d+aD:"",$C].join("");break b;default:_.Yh("Cannot create PlayReady header in version",a),e=""}}if(!e)return null;_.ci("New payload",e);e=_.bk(_.T.Ff(e,!0));return new _.fp(_.kp,
|
|
12
|
+
b,d||null,e,a,c)};_.vE=function(a,b){return b===a.version?a:_.uE(b,a.a,a.l||void 0,a.h||void 0)};wE=function(a,b){a:{if(b){var c=_.w(a.h.keys());for(var d=c.next();!d.done;d=c.next()){d=a.h.get(d.value);for(var e=0;e<d.wb.length;e++)if(d.wb[e]===b){c=d;break a}}}c=null}return c?c.sb:null};xE=function(a,b){if(_.Hl("Edge/"))return!0;b=b.toLowerCase();if(_.Fk()&&b.includes('codecs\x3d"ac-3"')){var c=b.replace("ac-3",_.we);return a.K.has(b)||a.K.has(c)}return a.K.has(b)};
|
|
13
|
+
yE=function(a,b){var c=a.o.get(b);return!(!c||c!==_.rf&&c!==_.Je)};zE=function(a,b){var c=b.audio,d=b.video;if(c&&c.encrypted&&(c=_.Yp(c),!xE(a,c))||d&&d.encrypted&&(d=_.Yp(d),!xE(a,d)))return!1;var e=a.keySystem();return 0===b.drmInfos.length||b.drmInfos.some(function(f){return f.keySystem===e})};AE=function(a,b,c){a.f!==b&&(a.f=b,a.a.push({timestamp:Date.now()/1E3,id:b.id,trackId:b.track.id,type:b.track.type,fromAdaptation:c,width:null,height:null,bandwidth:b.bandwidth}))};
|
|
14
|
+
BE=function(a,b){if(null==a.a)return null;var c=a.a[a.a.length-1];return c?c[b]:null};CE=function(a){a=BE(a,_.Qw);return null==a?null:a};DE=function(a,b){if(a.a.length)if(0>b)a.f=0;else{for(var c=0,d=a.a[c]||null;d&&b>d.dc()+d.getDuration();)c+=1,d=a.a[c]||null;a.f=d?c:a.a.length-1}else a.f=-1};_.EE=function(a,b){return a.concat(b)};FE=function(){};
|
|
15
|
+
_.GE=function(a,b){if(0===b.length)return a;var c=b.map(function(d){return new _.sj(d)});return a.map(function(d){return new _.sj(d)}).map(function(d){return c.map(d.resolve.bind(d))}).reduce(_.EE,[]).map(function(d){return d.toString()})};_.HE=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:b||[],keyIds:[],periodId:c?c:null}};
|
|
16
|
+
_.IE=function(a,b,c,d,e,f,g){f=void 0===f?"":f;this.eb=a;this.Da=b;this.pa=c;this.keyInfo=d||null;this.sd=_.N.R(e)?!1:!!e;this.ye=f;this.Ta=g};JE=function(a,b){a=_.Pj(a);b=_.Pj(b);var c=a.split("-"),d=b.split("-");return c[0]===d[0]&&1===c.length&&2===d.length};KE=function(a){return a.language?_.Pj(a.language):a.audio&&a.audio.language?_.Pj(a.audio.language):a.video&&a.video.language?_.Pj(a.video.language):_.Ng};
|
|
17
|
+
_.LE=function(a,b){for(var c=_.Pj(a),d=new Set,e=_.w(b),f=e.next();!f.done;f=e.next())d.add(_.Pj(f.value));e=_.w(d);for(f=e.next();!f.done;f=e.next())if(f=f.value,f===c)return f;e=_.w(d);for(f=e.next();!f.done;f=e.next())if(f=f.value,JE(f,c))return f;e=_.w(d);for(f=e.next();!f.done;f=e.next()){var g=f=f.value,h=c;g=_.Pj(g);h=_.Pj(h);g=g.split("-");h=h.split("-");if(2===g.length&&2===h.length&&g[0]===h[0])return f}d=_.w(d);for(f=d.next();!f.done;f=d.next())if(e=f.value,JE(c,e))return e;return null};
|
|
18
|
+
ME=function(a,b){for(var c=0,d=_.w(a),e=d.next();!e.done;e=d.next())c+=b(e.value)?1:0;return c};NE=function(a,b){var c=_.Bl(b,a);if(!c)return!1;c=c();var d=c.isMuxed(a,b);c.destroy();return d};OE=function(a){for(var b=[a.mimeType],c=_.w(_.Aw),d=c.next();!d.done;d=c.next()){var e=_.w(d.value);d=e.next().value;e=e.next().value;d=a[d];null!=d&&b.push(e.trim()+'\x3d"'+String(d).trim()+'"')}return b.join(";").replace(/\s/g,"")};
|
|
19
|
+
PE=function(a){return a.split(",").map(function(b){return b.trim()}).filter(function(b){return 0<b.length})};_.QE=function(a){var b=[];a=_.w(a.split(/\s*,\s*/));for(var c=a.next();!c.done;c=a.next()){c=c.value.split(".");var d=c[0];c.shift();b.push(d)}return b.sort().join(",")};RE=function(a,b){for(var c=new _.zm(void 0,void 0===b?"total":b),d=_.w(a),e=d.next();!e.done;e=d.next())c.a.push(e.value);c.length=a.length;return c};
|
|
20
|
+
_.SE=function(a,b,c,d,e,f){this.tagName=a;this.textContent=b;this.attributes=c;this.childNodes=d;this.localName=e;this.a=f};
|
|
21
|
+
TE=function(a){return-1===a.indexOf("\x26")?a:a.replace(/&(?:amp|lt|gt|quot|apos|nbsp|lrm|rlm|#[xX]?[0-9a-fA-F]+);/g,function(b){switch(b){case "\x26amp;":return"\x26";case "\x26lt;":return"\x3c";case "\x26gt;":return"\x3e";case "\x26quot;":return'"';case "\x26apos;":return"'";case "\x26nbsp;":return"\u00a0";case "\x26lrm;":return"\u200e";case "\x26rlm;":return"\u200f";default:return"#"===b[1]?(b="x"===b[2]||"X"===b[2]?parseInt(b.slice(3),16):parseInt(b.slice(2),10),String.fromCodePoint(b)):b}})};
|
|
22
|
+
UE=function(a){function b(h,l){return new _.SE(void 0===l?_.da:l,h,{},[],null,g)}function c(h){h=void 0===h?"":h;for(var l=[];a[e];)if(60==a.charCodeAt(e)){if(47===a.charCodeAt(e+1)){var m=e+2;e=a.indexOf("\x3e",e);if(!a.startsWith(h,m))throw h=a.substring(0,e).split("\n"),Error("Unexpected close tag\nLine: "+(h.length-1)+"\nColumn: "+(h[h.length-1].length+1)+"\nChar: "+a[e]);e+1&&(e+=1);break}else if(63===a.charCodeAt(e+1)){e=a.indexOf("\x3e",e);e++;continue}else if(33===a.charCodeAt(e+1)){if(45==
|
|
23
23
|
a.charCodeAt(e+2)){for(;-1!==e&&(62!==a.charCodeAt(e)||45!=a.charCodeAt(e-1)||45!=a.charCodeAt(e-2)||-1==e);)e=a.indexOf("\x3e",e+1);-1===e&&(e=f)}else if(91===a.charCodeAt(e+2)&&91===a.charCodeAt(e+8)&&a.startsWith("CDATA",e+3)){m=a.indexOf("]]\x3e",e);-1==m?(l.push(b(a.substr(e+9),"#cdata")),e=f):(l.push(b(a.substring(e+9,m),"#cdata")),e=m+3);continue}else{m=e+1;e+=2;for(var n=!1;(62!==a.charCodeAt(e)||!0===n)&&a[e];)91===a.charCodeAt(e)?n=!0:!0===n&&93===a.charCodeAt(e)&&(n=!1),e++;l.push(b(a.substring(m,
|
|
24
|
-
e),"#doctype"))}e++;continue}e++;n=m=d();var p=m.indexOf(":");-1!==p&&(m.slice(0,p),n=m.slice(p+1));for(p={};62!==a.charCodeAt(e)&&a[e];){var q=a.charCodeAt(e);if(64<q&&91>q||96<q&&123>q){q=d();for(var
|
|
25
|
-
null,p,q,n,g))}else m=e,e=a.indexOf("\x3c",e)-1,-2===e&&(e=f),m=
|
|
26
|
-
|
|
27
|
-
_.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
_.
|
|
32
|
-
_.
|
|
33
|
-
_
|
|
34
|
-
_.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
h.h.readyState&&!h.h.paused){var l=
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return d}if(b>=l||c(b))return a.g.debug("Playhead in safe region or in buffered region."),b;a.g.debug("Playhead outside safe region \x26 in unbuffered region.");return d};
|
|
51
|
-
|
|
52
|
-
h.start(l+1)-f;break a}h=null}h&&(e=Math.min(h+.1,e))}a.g.warn("Seeking forward "+e+" seconds to break stall.");b.currentTime+=e}else a.g.warn("Pausing and unpausing to break stall."),b.pause(),b.play()});return c};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
_.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
(b=new _.
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
oG=function(a,b){var c=String(_.Nk++);c=new _.Hk(c,a);c.mimeType=_.Ik(b.mimeType);if(a===_.U||a===_.Jk)c.label=_.Ik(b.label),c.language=_.Ik(b.language),c.originalLanguage=_.Ik(b.originalLanguage);a===_.Kk?(c.frameRate=b.frameRate,c.roles=b.roles,c.trickPlay=b.trickPlay):a===_.Jk?(c.channelsCount=b.channelsCount,c.roles=b.audioRoles||[],c.mimeType=_.Ik(b.audioMimeType)):(c.kind=_.Ik(b.kind),c.roles=b.roles);c.accessibility=a===_.Kk||a===_.Jk?(b.accessibility||[]).filter(function(d){return d.type===
|
|
24
|
+
e),"#doctype"))}e++;continue}e++;n=m=d();var p=m.indexOf(":");-1!==p&&(m.slice(0,p),n=m.slice(p+1));for(p={};62!==a.charCodeAt(e)&&a[e];){var q=a.charCodeAt(e);if(64<q&&91>q||96<q&&123>q){q=d();for(var t="",v=a.charCodeAt(e);39!==v&&34!==v;)e++,v=a.charCodeAt(e);if(39===v||34===v){if(t=e+1,e=a.indexOf(a[e],t),t=a.slice(t,e),-1===e)throw Error("Missing closing quote");}else e--;p[q]=t;q=q.split(":");"xmlns"===q[0]&&q[1]&&g.set(t,q[1])}e++}q=[];t=a.charCodeAt(e-1);e++;47!==t&&(q=c(m));l.push(new _.SE(m,
|
|
25
|
+
null,p,q,n,g))}else m=e,e=a.indexOf("\x3c",e)-1,-2===e&&(e=f),m=TE(a.slice(m,e+1)).trim(),0<m.length&&l.push(b(m)),e++;return l}function d(){for(var h=e;-1==="\r\n\t\x3e/\x3d ".indexOf(a[e])&&a[e];)e++;return a.slice(h,e)}var e=0,f=a.length,g=new Map;return new _.SE("#document",null,{},c(""),null,g)};_.VE=function(){};
|
|
26
|
+
WE=function(a){switch(a){case _.Gm:_.Pw.info("Select DOM parser for XML");_.gp=new _.$o;break;case "txml":_.Pw.info("Select TXML parser for XML");_.gp=new _.VE;break;default:_.Pw.warn("XML parser option unknown, using default DOM parser. Option: "+a),_.gp=new _.$o}};XE=function(){return!!window.SourceBuffer&&!!SourceBuffer.prototype&&!!SourceBuffer.prototype.changeType};YE=function(a,b){return a.start-b.start};
|
|
27
|
+
_.ZE=function(a){this.h=void 0===a?null:a;this.log=new _.K("clpp.renditions");this.S=[];this.f=this.player=null;this.a=!1};$E=function(a){return a.S.map(function(b){return{start:b.start,end:b.end,width:b.width,height:b.height,bandwidth:b.bandwidth,rendition:b.rendition}})};aF=function(a){a.player&&(a.player.off(_.cg,a.jd),a.a&&a.player.off(_.Hg,a.jd));a.player=null};bF=function(a){a.player&&a.player.trigger(new _.L(_.jd))};cF=function(a){a.player&&a.player.trigger(new _.L(_.jd))};
|
|
28
|
+
dF=function(a){if(a.player){for(var b=!1,c={},d=0;d<a.S.length;d++){var e=a.S[d],f=e.width+"x"+e.height,g=c[f];if(g&&g!==e.bandwidth){b=!0;break}c[f]=e.bandwidth}b&&!a.a?(a.log.debug("Tracking timeupdates"),a.player.on(_.Hg,a.jd,a),a.a=!0):!b&&a.a&&(a.log.debug("Stop tracking timeupdates"),a.player.off(_.Hg,a.jd),a.a=!1)}};eF=function(a,b,c){a.S=a.S.filter(function(d){if(d.end<=b||d.start>=c)return!1;d.start=Math.max(d.start,b);d.end=Math.min(d.end,c);return!0});a.player&&a.player.trigger(new _.L(_.ah))};
|
|
29
|
+
fF=function(a,b){for(var c=null,d=_.w(a),e=d.next();!e.done;e=d.next())e=e.value,b>=e.startTime&&(c=e);return c};gF=function(a){var b=new Set;a.variants.forEach(function(c){c.audio&&b.add(c.audio);c.video&&(b.add(c.video),c.video.trickModeVideo&&b.add(c.video.trickModeVideo))});a.textStreams.forEach(function(c){return b.add(c)});a.thumbStreams.forEach(function(c){return b.add(c)});return b};hF=function(a,b){for(var c=0;c<a.length;c++)if(gF(a[c]).has(b))return c;return-1};
|
|
30
|
+
jF=function(a,b){Array.from(gF(a)).forEach(function(c){c.segmentIndex&&_.iF(c.segmentIndex,b)})};_.kF=function(a){this.h=Math.exp(Math.log(.5)/a);this.f=this.a=0};_.lF=function(a,b,c){var d=Math.pow(a.h,b);c=c*(1-d)+d*a.a;isNaN(c)||(a.a=c,a.f+=b)};_.mF=function(a){return a.a/(1-Math.pow(a.h,a.f))};
|
|
31
|
+
_.nF=function(a,b,c,d,e,f,g,h){a=_.pk(a);a.timeout=d.timeout;a.maxAttempts=d.maxAttempts;a.baseDelay=d.baseDelay;a.fuzzFactor=d.fuzzFactor;a.backoffFactor=d.backoffFactor;if(0!==b||null!=c)a.headers.Range=c?"bytes\x3d"+b+"-"+c:"bytes\x3d"+b+"-";e&&(a.startTime=e);f&&(a.endTime=f);g&&(a.contentType=g);h&&(a.timescale=h);return a};oF=function(a){this.a=this.h=0;this.f=a};_.pF=function(a,b,c){a.h=b;a.a=c};
|
|
32
|
+
_.qF=function(a,b,c,d,e,f){f=void 0===f?!1:f;this.j=a;this.G=b;this.K=c;this.A=this.f=Infinity;this.h=1;this.H=0;this.o=this.w=null;this.I=0;this.C=this.l=d;this.M=void 0===e?!0:e;this.g=new _.K("clpp.media.PresentationTimeline");this.P=f;this.L=null;this.a=new oF(d);this.J=null;this.B=this.j.type||null};_.sF=function(a,b){a.L={offsetDateTime:b-rF(a),seekRangeStartDateTime:b}};_.tF=function(a,b){a.l=b;a.C=b;a.a.f=b};uF=function(a){return 2===a.j.version?a.a.f?a.a.a:null:a.l?a.f:a.C?a.o:null};
|
|
33
|
+
_.xF=function(a,b,c){if(0!==b.length){var d=b[b.length-1].endTime+c;_.vF(a,b[0].startTime+c);a.h=b.reduce(function(e,f){return Math.max(e,f.endTime-f.startTime)},a.h);_.wF(a,d);null!=a.G&&a.M&&(a.G=(Date.now()+a.I)/1E3-(a.o||0)-a.h);a.g.debug("notifySegments: maxSegmentDuration\x3d"+a.h)}};_.vF=function(a,b){a.w=null==a.w?b:Math.min(a.w,b)};_.wF=function(a,b){a.o=Math.max(a.o||0,b)};_.yF=function(a,b){a.h=Math.max(a.h,b);a.g.debug("notifyNewSegmentDuration: maxSegmentDuration\x3d"+a.h)};
|
|
34
|
+
_.AF=function(a){return 2===a.j.version?a.a.dc():Infinity===a.A?0:Math.max(0,zF(a)-a.A)};zF=function(a){if(2===a.j.version)a=a.a.a;else if(a.l)a=a.f;else if(a.C)a=a.o||0;else{if("startover"===a.B)var b=a.J||0;else b=(Date.now()+a.I)/1E3,b=a.P?Math.max(0,b-(a.h-a.H)-a.G):Math.max(0,b-a.h-a.G);a=Math.min(b,a.f)}return a};CF=function(a,b){if(2===a.j.version)return a.a.dc();var c=Math.max(a.w,0);return Infinity===a.A?Math.ceil(1E3*c)/1E3:Math.max(c,Math.min(zF(a)-a.A+b,BF(a)))};
|
|
35
|
+
rF=function(a){return 2===a.j.version?a.a.dc():CF(a,0)};BF=function(a){var b=a.qe()&&!a.C?a.K:0;return 2===a.j.version?a.a.a-b:Math.max(0,zF(a)-b)};DF=function(a,b){var c=(void 0===b?0:b)?a.offset:0;return{schemeIdUri:a.schemeIdUri,configurationId:a.configurationId,value:a.value,startTime:a.startTime+c,endTime:a.endTime+c,id:a.id,eventElement:a.eventElement,type:a.type,customAttributes:a.customAttributes}};EF=function(){this.f=function(){};this.h=function(){};this.a=new Set};
|
|
36
|
+
FF=function(a,b,c){a.f=b;a.h=c};GF=function(a,b){for(var c=[],d=!1,e={},f=_.w(b),g=f.next();!g.done;e={Xc:e.Xc},g=f.next())e.Xc=g.value,a.a.has(e.Xc)||(c.push(e.Xc),g=Array.from(a.a.values()).some(function(h){return function(l){return l.id===h.Xc.id}}(e)),e.Xc.id&&g&&(d=!0));e=a.a.size;a.a.clear();b.forEach(function(h){return a.a.add(h)});f=a.a.size;c.forEach(function(h){return a.f(h)});(d||0<c.length||e!==f)&&a.h()};
|
|
37
|
+
HF=function(a,b){b=void 0===b?!1:b;return Array.from(a.a.values()).map(function(c){return DF(c,b)}).sort(function(c,d){return c.startTime-d.startTime})};IF=function(a,b,c,d){this.a=a;this.h=null;this.j=b;this.f=c;this.o=d;"flat"===d.timeline&&d.cropTimeline&&(a=d.startTime||0,this.j.a=new _.cv("crop",a,d.endTime?d.endTime-a:Infinity,!1))};JF=function(a){var b=a.a.hi(),c=a.h,d=b?b.id:null;(c?c.id:null)!==d&&b&&a.f(new _.L(_.fg,{id:d}));a.h=b;"basic"===a.o.timeline&&(a.j.a=b)};
|
|
38
|
+
KF=function(a,b,c){this.h=a;this.a=b;this.f=c;this.g=new _.K("clpp.media.SegmentIterator")};LF=function(a){var b=a.h.get(a.a);if(!b)return null;0<b.a.length&&b.eb().length&&a.f>=b.a.length&&(a.a+=1,a.f=0,b=a.h.get(a.a));return b&&0<b.a.length?b.a[a.f]||null:b};_.MF=function(a){this.a=a;this.g=new _.K("clpp.media.SegmentIndex")};_.NF=function(a){return a.a.length?a.a[a.a.length-1].endTime:0};_.OF=function(a,b){for(var c=0;c<a.a.length;++c)if(a.a[c].endTime>b)return a.a.splice(0,c);c=a.a;a.a=[];return c};
|
|
39
|
+
PF=function(a,b){var c=a.ld(b);c=null===c?-1:c-1;var d=a.get(c+1),e=-1;if(d&&0<d.a.length)for(var f=d.a.length-1;0<=f;--f){var g=d.a[f];if(b>=g.startTime&&b<g.endTime){for(;f&&!g.h;)--f,g=d.a[f];if(!g.h)break;c+=1;e=f-1;break}}return new KF(a,c,e)};_.iF=function(a,b){for(;a.a.length;)if(0>=a.a[0].endTime)a.a.shift();else break;0===a.a.length||a.a[a.a.length-1].startTime>=b||(a.a[a.a.length-1].endTime=b)};
|
|
40
|
+
RF=function(a,b){this.h=a;this.l=QF(a);this.a=a.a.currentTime;this.j=Date.now()/1E3;this.o=b;this.f=function(){}};SF=function(a,b){a.f=b};TF=function(a){this.a=a};QF=function(a){if(a.a.paused||0===a.a.playbackRate||0===a.a.buffered.length)var b=!1;else a:{b=a.a.buffered;a=a.a.currentTime;for(var c=0;c<b.length;c++){var d=b.start(c),e=b.end(c);if(!(a<d-.1||a>e-(c+1===b.length?.5:.1))){b=!0;break a}}b=!1}return b};
|
|
41
|
+
VF=function(a,b,c,d,e){var f=this;this.a=a;this.H=b;this.h=c;this.G=e;this.j=new _.wi;this.C=!1;this.J=a.readyState;this.l=!1;this.f=d;this.B=this.o=this.I=this.A=!1;this.j.on(a,_.fh,function(){return UF(f)});this.w=(new _.mi(function(){UF(f)})).Kb(.25)};
|
|
42
|
+
UF=function(a){if(0!==a.a.readyState){if(a.a.seeking){if(!a.C)return}else a.C=!1;if(!a.a.paused&&!a.o){a.a.readyState!==a.J&&(a.l=!1,a.J=a.a.readyState);var b=a.h.smallGapLimit,c=a.a.currentTime,d=a.a.buffered,e=a.h.gapTolerance;a:{var f=new _.zm(d);var g=a.h.gapDetectionThreshold;if(f.length&&!(1===f.length&&1E-6>f.end(0)-f.start(0)))for(var h=0;h<f.length;h++)if(f.start(h)>c&&(0===h||f.end(h-1)-c<=g)){f=h;break a}f=null}if(null==f){if(a.f){a=a.f;d=a.h;c=QF(d);d=d.a.currentTime;e=Date.now()/1E3;
|
|
43
|
+
if(a.a!==d||a.l!==c)a.j=e,a.a=d,a.l=c;d=e-a.j;d>=a.o&&c&&a.f(a.a,d)}}else if((0!==f||a.A)&&a.I&&(g=d.start(f),!(g>=BF(a.H)))){h=g-c;b=h<=b;var l=!1;h<e||(b||a.l||(a.l=!0,e=new _.L("largegap",{detail:{currentTime:c,gapSize:h}}),e.cancelable=!0,a.G(e),a.h.jumpLargeGaps&&!e.defaultPrevented?l=!0:_.bi("Ignoring large gap at",c,"size",h)),!b&&!l)||(0===f?_.bi(AD,h,"seconds because of gap before start time of",g):_.bi(AD,h,"seconds because of gap starting at",d.end(f-1),"and ending at",g),a.B=!0,a.a.currentTime=
|
|
44
|
+
g)}}}};WF=function(a){var b=this;this.f=a;this.o=10;this.l=this.h=this.j=0;this.a=new _.mi(function(){0>=b.j?(_.Yh(["Failed to move playhead from",b.h,"to",b.l].join(" ")),b.a.stop()):b.f.currentTime!==b.h?b.a.stop():(b.f.currentTime=b.l,b.j--)})};XF=function(a,b){a.h=a.f.currentTime;a.l=b;a.j=a.o;a.f.currentTime=b;a.a.Kb(.1)};$F=function(a,b,c,d){this.a=a;this.j=b;this.o=d;this.A=c;this.l=!1;this.f=new _.wi;this.h=new WF(a);this.w=!1;0<a.readyState?YF(this,c):ZF(this,c)};
|
|
45
|
+
aG=function(a){return a.l?a.a.currentTime:a.A};bG=function(a,b){0<a.a.readyState?XF(a.h,b):ZF(a,b)};ZF=function(a,b){a.A=b;a.f.off(a.a,_.Ue);a.f.one(a.a,_.Ue,function(){YF(a,b)})};YF=function(a,b){a.w||(a.w=!0,a.o&&a.o());.001>Math.abs(a.a.currentTime-b)?cG(a):(a.f.one(a.a,_.jg,function(){cG(a)}),XF(a.h,0===a.a.currentTime?b:a.a.currentTime))};cG=function(a){_.Jl()&&!a.l&&a.j();a.l=!0;a.f.on(a.a,_.jg,function(){return a.j()})};
|
|
46
|
+
gG=function(a,b,c,d,e,f,g){var h=this;this.h=a;this.a=b.presentationTimeline;this.B=b.minBufferTime||0;this.l=c;this.A=e;this.w=null;this.j=new VF(a,b.presentationTimeline,c,dG(this,a,c),f);this.f=new $F(a,function(){a:{var l=h.j;var m=l.B;l.B=!1;l.C=!0;l.A=!1;l.l=!1;l=aG(h.f);var n=eG(h,l);if(Math.abs(n-l)>h.l.gapTolerance){var p=(new Date).getTime()/1E3;if(!h.w||h.w<p-1){h.w=p;bG(h.f,n);m=void 0;break a}}h.g.debug("Seek to "+l);h.A(m?1:0);m=void 0}return m},fG(this,d,g),function(){h.j.I=!0});this.o=
|
|
47
|
+
(new _.mi(function(){if(0!==h.h.readyState&&!h.h.paused){var l=aG(h.f),m=rF(h.a),n=BF(h.a);3>n-m&&(m=n-3);l<m&&(m=eG(h,l),h.g.info("Jumping forward "+(m-l)+" seconds to catch up with the seek range."),h.h.currentTime=m)}})).Kb(.25);this.g=new _.K("clpp.mse.Playhead")};iG=function(a){var b=aG(a.f);return 0<a.h.readyState&&!a.h.paused?hG(a,b):b};fG=function(a,b,c){null==b?b=Infinity>a.a.getDuration()||c?rF(a.a):BF(a.a):0>b&&(b=BF(a.a)+b);return jG(a,hG(a,b))};
|
|
48
|
+
jG=function(a,b){var c=a.a.getDuration();return b>=c?c-a.l.durationBackoff:b};
|
|
49
|
+
eG=function(a,b){if("startover"===a.a.B)return b;var c=new _.zm(a.h.buffered);c=c.Tb.bind(c);var d=Math.max(a.B,a.l.rebufferingGoal),e=a.l.safeSeekOffset,f=rF(a.a),g=BF(a.a),h=a.a.getDuration();3>g-f&&(f=g-3);var l=CF(a.a,d),m=CF(a.a,e);d=CF(a.a,d+e);if(b>=h)return a.g.debug("Playhead past duration."),jG(a,b);if(b>g)return a.g.debug("Playhead past end."),g;if(b<f){if(c(m))return a.g.debug("Playhead before start \x26 start is buffered"),m;a.g.debug("Playhead before start \x26 start is unbuffered");
|
|
50
|
+
return d}if(b>=l||c(b))return a.g.debug("Playhead in safe region or in buffered region."),b;a.g.debug("Playhead outside safe region \x26 in unbuffered region.");return d};hG=function(a,b){var c=rF(a.a);if(b<c)return c;c=BF(a.a);return b>c?c:b};
|
|
51
|
+
dG=function(a,b,c){if(!c.stallEnabled)return null;var d=c.gapDetectionThreshold,e=c.stallSkip;c=new RF(new TF(b),c.stallThreshold);SF(c,function(f,g){a.g.warn("Stall detected at "+f+" for "+g+" seconds.");if(e){var h=new _.zm(b.buffered),l;if(l=_.Hl("Edge/")||_.Hl("Trident/")||_.Fk()||_.Jl())a:{if(h.length&&!(1>=h.length))for(l=0;l<h.length-1;l++)if(f>h.start(l)&&f<h.end(l)){l=h.start(l+1)-h.end(l)>=d;break a}l=!1}if(l){a:{if(h.length&&!(1>=h.length))for(l=0;l<h.length-1;l++)if(f>h.start(l)&&f<h.end(l)){h=
|
|
52
|
+
h.start(l+1)-f;break a}h=null}h&&(e=Math.min(h+.1,e))}a.g.warn("Seeking forward "+e+" seconds to break stall.");b.currentTime+=e}else a.g.warn("Pausing and unpausing to break stall."),b.pause(),b.play()});return c};lG=function(a){var b=this;this.f=a;this.a=new Set;this.h=(new _.mi(function(){kG(b,!1)})).Kb(.25)};kG=function(a,b,c){c=void 0===c?0:c;for(var d=_.w(a.a),e=d.next();!e.done;e=d.next())e.value.l(a.f.currentTime,b,c)};
|
|
53
|
+
mG=function(a,b){var c=a.offset||0;return b<a.startTime+c?1:b>a.endTime+c?3:2};
|
|
54
|
+
nG=function(a){var b=this;this.j=a;this.o=new Map;this.a=function(){};this.f=function(){};this.h=function(){};this.w=[{Vc:null,Uc:2,Mc:function(c,d){return b.a(c,d)}},{Vc:1,Uc:2,Mc:function(c,d){return b.a(c,d)}},{Vc:3,Uc:2,Mc:function(c,d){return b.a(c,d)}},{Vc:2,Uc:1,Mc:function(c,d){return b.f(c,d)}},{Vc:2,Uc:3,Mc:function(c,d){return b.f(c,d)}},{Vc:1,Uc:3,Mc:function(c,d){return b.h(c,d)}},{Vc:3,Uc:1,Mc:function(c,d){return b.h(c,d)}}]};oG=function(a,b,c,d){a.a=b;a.f=c;a.h=d};
|
|
55
|
+
_.pG=function(a){_.iv[a]&&delete _.iv[a]};_.qG=function(a){_.gv[a]&&delete _.gv[a]};rG=function(){this.f=new _.kF(2);this.h=new _.kF(5);this.a=0};_.sG=function(a,b,c){if(!(16E3>c)){var d=8E3*c/b;b/=1E3;a.a+=c;_.lF(a.f,b,d);_.lF(a.h,b,d)}};tG=function(a,b){if(typeof a!==typeof b||a.length!==b.length)return!1;for(var c=0;c<a.length;c++)if(a[c].serviceLocationId!==b[c].serviceLocationId||a[c].uri!==b[c].uri||a[c].params!==b[c].params)return!1;return!0};_.uG=function(a,b){this.id=a;this.ka=b};
|
|
56
|
+
_.vG=function(a,b){return a.ka.map(function(c){var d=new URL(c.uri+b);if(c.params){c=_.w(Object.entries(c.params));for(var e=c.next();!e.done;e=c.next()){var f=_.w(e.value);e=f.next().value;f=f.next().value;d.searchParams.set(e,f)}}return d.toString()})};wG=function(a,b){_.Am.call(this);this.A=a;this.h=null;this.B=b;this.C=new _.Ak;this.f=300;this.o=new Map;this.l=new Map;this.w=new Map;this.j=new Map;this.a=null;this.g=new _.K("clpp.net.ContentSteeringManager")};
|
|
57
|
+
yG=function(a,b){return _.I(function(c){null!=a.a&&(a.a.stop(),a.a=null);a.o.clear();a.l.clear();a.j.clear();a.w.clear();a.g.debug("contentSteeringServerUri: "+b.contentSteeringServerUri);a.g.info("queryBeforeStart: "+b.queryBeforeStart);a.h={manifestType:b.manifestType,contentSteeringServerUri:b.contentSteeringServerUri,queryBeforeStart:b.queryBeforeStart,Vh:b.defaultServiceLocation?b.defaultServiceLocation.split(","):[]};b.baseUriCollections.forEach(function(d){var e=[];if(a.h.Vh.length)for(var f=
|
|
58
|
+
{},g=_.w(a.h.Vh),h=g.next();!h.done;f={Oe:f.Oe},h=g.next())f.Oe=h.value,(h=d.ka.find(function(l){return function(m){return m.serviceLocationId===l.Oe}}(f)))?e.push(h):a.g.warn("setManifestConfig: could not get default location:","pathwayId: "+f.Oe+" processedLocations:",e);e.length?a.l.set(d.id,e):a.l.set(d.id,d.ka);a.o.set(d.id,d.ka)});if(b.contentSteeringServerUri){if(a.h.queryBeforeStart)return c["return"](xG(a));a.g.info("defaultServiceLocations: "+b.defaultServiceLocation);xG(a)}_.C(c)})};
|
|
59
|
+
_.AG=function(a,b){var c=a.l.get(b);if(!c)return a.g.warn("getBaseUriCollectionById: invalid baseUriSetId:"+b+"."),null;var d=Date.now();a.j.forEach(function(f,g){f.Pd&&d>f.Pd&&(f.Pd=0,a.trigger(new _.L(_.$d,{detail:{serviceLocationId:g,banned:!1,bannedSeconds:0}})))});var e=c.filter(function(f){return 0===_.zG(a,f.serviceLocationId).Pd});e.length||(e=c);e.length&&(c=a.w.get(b),tG(e,c)||(c={baseUriCollectionId:b,from:c||[],to:e},a.g.info("Steering server update baseUriCollectionId: "+c.baseUriCollectionId+
|
|
60
|
+
" from: "+JSON.stringify(c.from)+" to: "+JSON.stringify(c.to)),a.trigger(new _.L(_.Zd,{detail:c})),a.w.set(b,e)));return new _.uG(b,e)};_.BG=function(a,b){var c=_.zG(a,b);c.Pd=Date.now()+1E3*a.f;c.Ae=!1;a.g.info("service location "+b+" banned during "+a.f+WC);a.trigger(new _.L(_.$d,{detail:{serviceLocationId:b,banned:!0,bannedSeconds:a.f}}))};_.zG=function(a,b){var c=a.j.get(b);c||(c={Pd:0,Uf:new rG,Ae:!1},a.j.set(b,c));return c};
|
|
61
|
+
xG=function(a,b){var c,d,e,f,g,h,l;return _.I(function(m){if(1==m.a)return b=b||a.h.contentSteeringServerUri,c=CG(a,b),a.g.info("Sending request to content steering server, URI: "+c),d=_.pk(c,a.A.attemptParameters),d.type=7,e=a.B.fetch(d),_.Bk(a.C,e),_.y(m,e.T,2);f=m.f;if(410===f.status)a.g.info(" Content steering server not available(HTTP response 410), stopping updates."),null!=a.a&&(a.a.stop(),a.a=null);else if(429===f.status){a.g.info("Content steering server overloaded (HTTP response 429).");
|
|
62
|
+
if(g=parseInt(f.headers["retry-after"],10))a.g.info("Will retry after "+g+" s based on Retry-After header."),a.f=g;DG(a,a.f)}else try{h=_.T.ea(f.data),l=JSON.parse(h),1===l.VERSION?EG(a,l,f.uri):a.g.warn("Received unsupported steering manifest version: "+l.VERSION+", ignoring it and stop requesting.")}catch(n){a.g.error("requestInfo_: error parsing received steering manifest:",n);if(n&&7001===n.code)return m["return"]();null!=a.a&&(a.a.stop(),a.a=null);a.a=new _.mi(function(){xG(a)});DG(a,a.f)}_.C(m)})};
|
|
63
|
+
CG=function(a,b){var c=new URL(b),d=[],e=[];a.j.forEach(function(f,g){f.Ae&&(d.push(g),e.push(parseInt(f.Uf.getBandwidthEstimate(1E4),10)));f.Ae=!1});d.length?a.h.manifestType===_.Xc?(c.searchParams.set("_DASH_pathway",'"'+d.toString()+'"'),c.searchParams.set("_DASH_throughput",e.toString())):a.h.manifestType===_.mm&&(c.searchParams.set("_HLS_pathway",'"'+d.toString()+'"'),c.searchParams.set("_HLS_throughput",e.toString())):a.g.debug("addQueryParams_: serviceLocations EMPTY");return c.toString()};
|
|
64
|
+
FG=function(a,b,c,d){var e=[],f=a.o.get(b)||[];if(!c.length)return a.l.get(b);a={};c=_.w(c);for(b=c.next();!b.done;a={Ld:a.Ld,Yb:a.Yb,Fd:a.Fd},b=c.next())if(a.Ld=b.value,b=f.find(function(g){return function(h){return h.serviceLocationId===g.Ld}}(a)))e.push(b);else if(a.Yb=d.find(function(g){return function(h){return h.ID===g.Ld}}(a)),a.Yb&&(b=f.find(function(g){return function(h){return h.serviceLocationId===g.Yb["BASE-ID"]}}(a))))a.Fd={serviceLocationId:a.Ld,uri:b.uri,params:{}},a.Yb[PD]&&(a.Yb[PD].HOST&&
|
|
65
|
+
(b=new URL(b.uri),b.hostname=a.Yb[PD].HOST,a.Fd.uri=b.toString()),a.Yb[PD].PARAMS&&Object.entries(a.Yb[PD].PARAMS).forEach(function(g){return function(h){var l=_.w(h);h=l.next().value;l=l.next().value;g.Fd.params[h]=l}}(a))),e.push(a.Fd);return e};DG=function(a,b){a.g.info("Scheduling next steering manifest update in "+b+" s.");a.a.fa(b)};
|
|
66
|
+
EG=function(a,b,c){null!=a.a&&(a.a.stop(),a.a=null);var d=b["RELOAD-URI"]||c;a.a=new _.mi(function(){xG(a,d)});if(c=b.TTL)a.f=c;DG(a,a.f);var e=b["PATHWAY-PRIORITY"]||[],f=b["PATHWAY-CLONES"]||[];a.j.forEach(function(g,h){e.includes(h)||a.j["delete"](h)});a.o.forEach(function(g,h){var l=FG(a,h,e,f);a.l.set(h,l)})};GG=function(a,b){this.w=null;this.C=a;this.j=b;this.h=this.A=0;this.l=Infinity;this.f=this.a=null;this.B="";this.o=new Map};
|
|
67
|
+
HG=function(a,b){if(b!==_.Wc){var c=_.Ev[b];if(!c)throw new _.O(_.P,2,2012,"Text parser is unavailable for "+b);a.w=new c(a.C)}};IG=function(a,b,c,d){return Promise.resolve().then(function(){if(a.w&&a.j)if(null==c||null==d)a.w.parseInit(_.bk(b));else{var e={periodStart:a.A,segmentStart:c,segmentEnd:d};e=a.w.parseMedia(_.bk(b),e);var f=e.cues.filter(function(g){return g.startTime>=a.h&&g.startTime<a.l});a.j.append(f,e.styles);null==a.a&&(a.a=Math.max(c,a.h));a.f=Math.min(d,a.l)}})};
|
|
68
|
+
JG=function(a,b,c){a.B=b;if(b=a.o.get(b))for(var d=_.w(b.keys()),e=d.next();!e.done;e=d.next())if(e=b.get(e.value))e=e.filter(function(f){return f.endTime<=c}),a.j.append(e,[])};
|
|
69
|
+
KG=function(a,b,c,d,e){var f=c+" "+d,g=new Map;b=_.w(b);for(var h=b.next();!h.done;h=b.next()){var l=h.value;h=l.stream;g.has(h)||g.set(h,new Map);g.get(h).has(f)||g.get(h).set(f,[]);l.startTime+=e;l.endTime+=e;l.startTime>=a.h&&l.startTime<a.l&&(l=new _.gj(l.startTime,l.endTime,l.text),g.get(h).get(f).push(l),h===a.B&&a.j.append([l],[]))}e=_.w(g.keys());for(f=e.next();!f.done;f=e.next())for(f=f.value,a.o.has(f)||a.o.set(f,new Map),b=_.w(g.get(f).keys()),h=b.next();!h.done;h=b.next())h=h.value,l=
|
|
70
|
+
g.get(f).get(h),a.o.get(f).set(h,l);a.a=null==a.a?Math.max(c,a.h):Math.min(a.a,Math.max(c,a.h));a.f=Math.max(a.f,Math.min(d,a.l))};_.LG=function(a){a=a.toLowerCase();return _.Ev[a]||window.muxjs&&a===_.Wc?!0:!1};
|
|
71
|
+
MG=function(a,b){var c=String(_.Wk++);c=new _.Qk(c,a);c.mimeType=_.Rk(b.mimeType);if(a===_.Sk||a===_.V)c.label=_.Rk(b.label),c.language=_.Rk(b.language),c.originalLanguage=_.Rk(b.originalLanguage);a===_.Tk?(c.frameRate=b.frameRate,c.roles=b.roles,c.trickPlay=b.trickPlay):a===_.V?(c.channelsCount=b.channelsCount,c.roles=b.audioRoles||[],c.mimeType=_.Rk(b.audioMimeType)):(c.kind=_.Rk(b.kind),c.roles=b.roles);c.accessibility=a===_.Tk||a===_.V?(b.accessibility||[]).filter(function(d){return d.type===
|
|
73
72
|
a}):b.accessibility||[];return c};
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
a[0].presentationTimeline.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
l.audioId})})||null}}else f=
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
a.h=b}};
|
|
89
|
-
|
|
90
|
-
_.
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
m
|
|
96
|
-
|
|
97
|
-
e=
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
(_.
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
a.
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
b.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
a;if(0===g.
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
c)};
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
a.
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
$I=function(a,b
|
|
158
|
-
e,
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
a.
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
a
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
73
|
+
NG=function(a,b,c){var d=new _.Zk(a===_.Tk?""+b.videoId:a===_.V?""+b.audioId:""+b.id,c);switch(a){case _.Tk:d.codec=_.Rk(b.videoCodec);d.bandwidth=b.videoBandwidth||b.bandwidth;d.width=b.width;d.height=b.height;d.originalId=b.originalVideoId;break;case _.V:d.codec=_.Rk(b.audioCodec);d.bandwidth=b.audioBandwidth||b.bandwidth;d.originalId=b.originalAudioId;break;default:d.codec=_.Rk(b.codecs),d.originalId=b.originalTextId}(a=c.renditions.find(function(e){return _.N.qa(e,d,null,["id","track"])}))||c.renditions.push(d);
|
|
74
|
+
return a||d};OG=function(a,b){var c=a.reduce(function(d,e){b===_.Tk?null===e.videoId||d[e.videoId]&&!e.activeVideo||(d[e.videoId]=e):b===_.V&&(null===e.audioId||d[e.audioId]&&!e.activeAudio||(d[e.audioId]=e));return d},{});return Object.values(c)};PG=function(a,b){if(void 0!==b&&null!==b){var c=a.filter(function(d){return d.audio&&d.audio.id===b});if(0<c.length)return c}return a};
|
|
75
|
+
QG=function(a,b,c){function d(f,g){return null==f?null==g:g.id===f}for(var e=0;e<c.length;e++)if(d(a,c[e].audio)&&d(b,c[e].video))return c[e];return null};_.RG=function(a,b){a.forEach(function(c){c.startTime+=b;c.endTime+=b})};SG=function(a){var b=a.periods[0].startTime;a=a.periods[a.periods.length-1].endTime;if(null==a)throw Error("Period end time must be known");return{start:b,end:a}};TG=function(a){return Object.assign({},a,{periods:a.periods.map(function(b){return Object.assign({},b)})})};
|
|
76
|
+
UG=function(a,b){if(0===a.length)throw Error("Cannot concatenate 0 manifests");if(1===a.length)return a[0];a[0].cues.forEach(function(f){f.offset=0});for(var c=_.vh(a[0].periods).concat(),d={},e=1;e<a.length;d={Pe:d.Pe},e++)d.Pe=SG(a[e-1]).end,_.RG(a[e].periods,d.Pe),c.push.apply(c,_.vh(a[e].periods)),a[e].cues.forEach(function(f){return function(g){g.offset=f.Pe}}(d));d=a.flatMap(function(f){return f.cues});c={periods:c,presentationTimeline:b,minBufferTime:0,cues:d,alternativeVariants:a[0].alternativeVariants};
|
|
77
|
+
d=SG(c).end;_.pF(b.a,0,d);(d=a[0].presentationTimeline.Kc())&&_.sF(b,d.seekRangeStartDateTime);return c};WG=function(a,b){try{if(1===a.length)return a[0];if(!a.every(VG))throw new _.nj("Period durations must be finite");return UG(a,b)}catch(c){throw new _.O(_.P,7,7003,"Failed to join manifests into a continuous playlist!",c);}};
|
|
78
|
+
XG=function(a,b){var c=b.periods[0].configurationId,d=_.vh(a.periods).concat().filter(function(f){return f.configurationId!==c}),e=a.presentationTimeline;d={periods:d,presentationTimeline:e,minBufferTime:0};_.tF(e,b.presentationTimeline.l);return WG([d,b],e)};VG=function(a){return a.periods.every(function(b){return null!=b.endTime&&0<=b.endTime&&isFinite(b.endTime)})};
|
|
79
|
+
YG=function(a){return{id:a.id,bandwidth:a.bandwidth,trickPlay:a.video?a.video.trickPlay:!1,width:a.video?a.video.width:void 0,height:a.video?a.video.height:void 0}};ZG=function(a,b){return b.find(function(c){return c.id===a.id})||null};$G=function(){this.g=new _.K("clpp.mse.TrackManager");this.m=null;this.h=[];this.a=new Map;this.f=new Map};aH=function(a,b){return a.h.filter(function(c){return c.type===b})};bH=function(a,b){var c=a.a.get(b)||null;return c&&c.track};
|
|
80
|
+
cH=function(a,b,c){if(!c||bH(a,c.type)!==c||a.m.wa())switch(c=c?c.renditions[0]||null:null,b){case _.Tk:a.ub(c);break;case _.V:a.Hb(c);break;case _.Sk:a.Ib(c);break;default:throw Error("Unknown track type "+b);}};dH=function(a,b){a.a.set(b.track.type,b);b===(a.f.get(b.track.type)||null)&&a.f.set(b.track.type,null)};eH=function(a,b,c){return a.m.wa()?!0:(a.a.get(c)||null)===b?!1:!0};
|
|
81
|
+
fH=function(a,b,c){if(0>a.h.indexOf(b.track))throw Error("Unknown rendition with ID "+b.id);if(c!==b.track.type)throw Error("Types mismatch");};
|
|
82
|
+
iH=function(a,b,c){fH(a,b,_.Tk);if(eH(a,b,_.Tk)){var d=a.m;a.g.info("Set video rendition with ID: "+b.id);var e=a.a.get(_.V)||null,f=null;if(e&&!e.a){var g=gH(d).filter(function(l){return l.videoId===parseInt(b.id,10)});f=g.find(function(l){return l.audioId===parseInt(e.id,10)})||null;if(!f){a.g.debug("Unable to find exact variant. Searching for equivalent");var h=e.track.renditions.map(function(l){return l.id}).filter(function(l){return l!==e.id});f=g.find(function(l){return h.find(function(m){return m===
|
|
83
|
+
l.audioId})})||null}}else f=gH(d).find(function(l){return l.videoId===parseInt(b.id,10)})||null;f?(a.f.set(_.Tk,b),hH(d,f,c)):a.g.warn("Cannot find matching variant")}};
|
|
84
|
+
lH=function(a,b){var c,d,e;_.I(function(f){switch(f.a){case 1:c=_.Sk;fH(a,b,c);if(!eH(a,b,c))return f["return"]();d=a.m.ma().find(function(g){return g.id===parseInt(b.id,10)});if(!d)return a.g.warn("Text rendition with ID: "+b.id+" not found."),f["return"]();a.g.info("Set text rendition with ID: "+b.id);a.f.set(c,b);_.D(f,2);dH(a,b);return _.y(f,jH(a.m,!0),4);case 4:return _.y(f,kH(a.m,d),5);case 5:a.m.trigger(new _.L(_.Cg));_.Jh(f,0);break;case 2:e=_.H(f),a.g.warn("Failed to set text rendition",
|
|
85
|
+
e),_.C(f)}})};mH=function(a){var b,c,d;_.I(function(e){if(1==e.a){b=_.Sk;c=bH(a,b);if(!c)return e["return"]();a.g.info("Unset text rendition.");_.D(e,2);return _.y(e,jH(a.m,!1),4)}if(2!=e.a)return a.a.set(b,null),a.m.trigger(new _.L(_.Cg)),_.Jh(e,0);d=_.H(e);a.g.warn("Failed to unset text rendition",d);_.C(e)})};
|
|
86
|
+
qH=function(a){if(a.m){a.g.debug("Track list change detected, updating track list");for(var b=[],c=_.w(Object.values(_.zw)),d=c.next();!d.done;d=c.next())d=d.value,a.a.set(d,null),a.f.set(d,null);c={};d=_.w(a.m.ma());for(var e=d.next();!e.done;c={Bc:c.Bc},e=d.next()){e=e.value;c.Bc=MG(_.Sk,e);var f=b.find(function(h){return function(l){return h.Bc.qa(l)}}(c));c.Bc=f||c.Bc;var g=NG(_.Sk,e,c.Bc);e.activeText&&a.a.set(_.Sk,g);f||b.push(c.Bc)}nH(a.m)||a.a.set(_.Sk,null);c=gH(a.m);oH(a,b,c,_.Tk);oH(a,
|
|
87
|
+
b,c,_.V);pH(a,b);a.h=b}};oH=function(a,b,c,d){var e=OG(c,d);c={};e=_.w(e);for(var f=e.next();!f.done;c={Cc:c.Cc},f=e.next()){f=f.value;c.Cc=MG(d,f);var g=b.find(function(l){return function(m){return l.Cc.qa(m)}}(c));c.Cc=g||c.Cc;var h=NG(d,f,c.Cc);(d===_.Tk&&f.activeVideo||d===_.V&&f.activeAudio)&&a.a.set(d,h);g||b.push(c.Cc)}};
|
|
88
|
+
pH=function(a,b){var c=a.m;if(c.f){var d=(d=rH(c))?sH(c.o,d).fb:null;c=c.f.muxedAudioTracks||[];if(d)for(var e=_.w(c),f=e.next();!f.done;f=e.next())f=f.value,f.active=d.id===f.id;d=c}else d=[];d=_.w(d);for(c=d.next();!c.done;c=d.next())c=c.value,e=String(_.Wk++),e=new _.Qk(e,_.V),e.mimeType="",e.label=c.label,e.language=c.language,e.originalLanguage=c.language,e.channelsCount=c.channelsCount,e.roles=[],e.accessibility=[],f=new _.Zk(""+c.id,e),f.codec="",f.bandwidth=0,f.originalId=c.label,f.a=!0,e.renditions.push(f),
|
|
89
|
+
b.push(e),c.active&&a.a.set(_.V,e.renditions[0])};uH=function(a,b,c,d){a.h.length||qH(a);var e=a.a.get(c)||null;(b=tH(a,b,c))&&e!==b&&(dH(a,b),c===_.V?a.m.trigger(new _.L(_.kd)):c===_.Tk&&a.m.trigger(new _.L(_.bh,{details:{width:b.width||0,height:b.height||0,bandwidth:b.bandwidth,track:b.track,abrSelection:d}})))};tH=function(a,b,c){return aH(a,c).flatMap(function(d){return d.renditions}).find(function(d){return parseInt(d.id,10)===b})||null};
|
|
90
|
+
vH=function(){this.a=new muxjs.mp4.CaptionParser;this.l=[];this.j={}};_.wH=function(){};_.yH=function(a,b,c,d,e){this.j=a;this.C=c;this.a={};this.K=!1;this.f=null;this.h={};this.l=new _.wi;this.I=!1;this.w={};this.H=b;this.B=d;this.L=e;this.P=this.L.streaming.maxSegmentToMediaOffset||1;this.J=new _.xk;this.A="";this.G={};this.o=xH(this,this.J);this.M=!0;this.g=new _.K("clpp.mse.MediaSourceEngine")};
|
|
91
|
+
zH=function(a){var b=_.Cl(a.mimeType,a.codecs),c=OE(a);return _.LG(b)||_.Cu(c)||(_.Bl(b,a.type)?!0:!1)};xH=function(a,b){if(window.ManagedMediaSource){a.j.disableRemotePlayback=!0;var c=new ManagedMediaSource;a.l.one(c,kE,function(){URL.revokeObjectURL(a.A);b.resolve()});a.l.on(c,lE,function(){a.M=!0});a.l.on(c,"endstreaming",function(){a.M=!1});a.A=AH(c);a.j.src=a.A;return c}c=new MediaSource;a.A=AH(c);a.l.one(c,kE,function(){URL.revokeObjectURL(a.A);b.resolve()});a.j.src=a.A;return c};
|
|
92
|
+
BH=function(a,b){b.forEach(function(c,d){var e=a.a[d];e&&(a.l.off(e,_.Ae),a.l.off(e,oE),a.o.removeSourceBuffer(e),delete a.a[d]);e=a.o.addSourceBuffer(c);a.l.on(e,_.Ae,a.Xk.bind(a,d));a.l.on(e,oE,a.md.bind(a,d));a.a[d]=e;a.h[d]=[];a.G[d]=!1})};CH=function(a,b){try{return new _.zm(a.a[b].buffered,b)}catch(c){return b in a.a&&a.g.error($D+b,c),null}};DH=function(a,b){if(!a.a[b])return"";var c=CH(a,b);return c?c.toString():""};
|
|
93
|
+
FH=function(a,b,c,d,e){return[EH(a,b,a.Wk.bind(a,b)),EH(a,b,a.Hh.bind(a,b,c)),EH(a,b,a.Yk.bind(a,b,d,e))]};EH=function(a,b,c){if(a.I)return Promise.reject();c={start:c,p:new _.xk};a.h[b].push(c);1===a.h[b].length&&GH(a,b);return c.p};GH=function(a,b){var c=a.h[b][0];if(c)try{a.g.debug(OD+b),c.start()}catch(d){d.name===GD?c.p.reject(new _.O(_.P,3,3017,{type:b})):c.p.reject(new _.O(_.P,3,3015,{mediaError:d})),HH(a,b)}else a.g.debug(CD+b)};
|
|
94
|
+
IH=function(a,b){var c,d,e,f,g,h,l,m,n;return _.I(function(p){switch(p.a){case 1:if(a.I)return p["return"](Promise.reject());c=[];for(d in a.a)e=new _.xk,f={start:function(q){q.resolve()}.bind(null,e),p:e},a.h[d].push(f),c.push(e),1===a.h[d].length&&f.start();_.D(p,2);return _.y(p,Promise.all(c),4);case 4:_.Jh(p,3);break;case 2:g=_.H(p);for(h in a.a)a.h[h].length&&a.h[h].shift();return p["return"](Promise.reject(g));case 3:for(l in a.a);_.D(p,5,6);return _.y(p,b(),6);case 6:_.Kh(p);for(m in a.a)HH(a,
|
|
95
|
+
m);_.Lh(p);break;case 5:return n=_.H(p),p["return"](Promise.reject(new _.O(_.P,3,3015,{mediaError:n})))}})};HH=function(a,b){a.h[b].shift();GH(a,b)};
|
|
96
|
+
OH=function(a,b,c,d){var e=a.periods.flatMap(function(n){return n.variants}),f=e;if(b.length||c.length)f=JH(f,b,c);f=KH(f,d);if(1<a.periods.length&&e.some(function(n){return null!=n.audio})){var g=function(n){n=n.split(".");var p=n[0];1<n.length&&(p+="."+n[1]);return p.toLowerCase()};b=[];c=_.w(a.periods);for(e=c.next();!e.done;e=c.next()){d=new Set;e=_.w(e.value.variants);for(var h=e.next();!h.done;h=e.next())h=h.value,null!==h.audio&&d.add(g(h.audio.codecs));b.push(d)}var l=b[0];c={};for(d=1;d<
|
|
97
|
+
b.length;c={Kf:c.Kf},d++)c.Kf=b[d],l=new Set(_.vh(l).concat().filter(function(n){return function(p){return n.Kf.has(p)}}(c)));f=f.filter(function(n){return 0===l.size&&null===n.audio?!0:0<l.size&&null===n.audio?!1:l.has(g(n.audio.codecs))})}f=LH(f);var m=MH(f);a=_.w(a.periods);for(f=a.next();!f.done;f=a.next())f=f.value,f.variants=f.variants.filter(function(n){if(NH(n)===m)return!0;_.ci("Dropping Variant (better codec available)",n);return!1})};
|
|
98
|
+
PH=function(a,b,c,d){var e=a.periods.flatMap(function(f){return f.variants});if(b.length||c.length)e=JH(e,b,c);e=KH(e,d);a=_.w(a.periods);for(b=a.next();!b.done;b=a.next())b=b.value,b.variants=b.variants.filter(function(f){return e.includes(f)})};LH=function(a){var b=new _.ti;a=_.w(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=NH(c);b.push(d,c)}return b};
|
|
99
|
+
JH=function(a,b,c){if(!b.length&&!c.length)return a;var d=a.filter(function(g){return(g=g.audio)&&c.length&&(g=_.QE(g.codecs),c.includes(g))?!0:!1}),e=a.filter(function(g){return(g=g.video)&&b.length&&(g=_.QE(g.codecs),b.includes(g))?!0:!1}),f=a.filter(function(g){return d.length&&!e.length?d.includes(g):!d.length&&e.length?e.includes(g):d.includes(g)&&e.includes(g)});return f.length?f:a};
|
|
100
|
+
MH=function(a){var b="",c=Infinity;qE(a,function(d,e){var f=e.reduce(function(g,h){return g+h.bandwidth||0},0)/e.length;_.ci(_.Od,d,"avg bandwidth",f);f<c&&(b=d,c=f)});return b};NH=function(a){var b="";a.video&&(b=_.QE(a.video.codecs));var c="";a.audio&&(c=_.QE(a.audio.codecs));return b+"-"+c};
|
|
101
|
+
QH=function(a,b){function c(d,e,f){return d>=e&&d<=f}return(!a.width||!a.height||c(a.width,b.minWidth,b.maxWidth)&&c(a.height,b.minHeight,b.maxHeight)&&c(a.width*a.height,b.minPixels,b.maxPixels))&&c(a.bandwidth,b.minBandwidth,b.maxBandwidth)?!0:!1};RH=function(a,b){for(var c=!1,d=_.w(a),e=d.next();!e.done;e=d.next()){e=e.value;var f=e.allowedByApplication;e.allowedByApplication=QH(e,b);f!==e.allowedByApplication&&(c=!0)}return c};
|
|
102
|
+
UH=function(a,b,c,d,e){e=void 0===e?!0:e;var f=!1;d.variants=d.variants.filter(function(n){if(a&&a.ca&&!zE(a,n))return _.ci("Dropping variant - not compatible with key system",n),!1;var p=n.audio,q=n.video;if(p&&!zH(p)){var t=p.codecs;0<=p.codecs.indexOf(_.we)?(_.ci("Trying to use AC-3 for EC-3"),p.codecs=p.codecs.replace(_.we,"ac-3"),zH(p)?_.bi("Using AC-3 instead of EC-3 for",SH(p)):(p.codecs=t,_.bi(HD,SH(p)),n.audio=null,f=!0,p=null)):(_.bi(HD,SH(p)),n.audio=null,f=!0,p=null)}return q&&!zH(q)?
|
|
103
|
+
(_.bi("Dropping variant - video not compatible with platform",SH(q)),!1):p&&b&&!TH(p,b,e)?(_.bi("Dropping variant - not compatible with active audio","active audio",SH(b),"variant.audio",SH(p)),!1):q&&c&&!TH(q,c,e)?(_.bi("Dropping variant - not compatible with active video","active video",SH(c),"variant.video",SH(q)),!1):!0});if(f){for(var g=!1,h=!1,l=_.w(d.variants),m=l.next();!m.done;m=l.next())m=m.value,!g&&m.video&&m.audio&&(g=!0),h||m.audio||!m.video||(h=!0);g&&h&&(d.variants=d.variants.filter(function(n){return n.video&&
|
|
104
|
+
!n.audio?(_.bi("Dropping variant - not compatible with video + audio","variant.video",SH(n.video)),!1):!0}))}d.textStreams=d.textStreams.filter(function(n){var p=_.LG(_.Cl(n.mimeType,n.codecs));p||_.ci("Dropping text stream. Is not supported by the platform.",n);return p})};TH=function(a,b,c){return a.mimeType!==b.mimeType||(void 0===c||c)&&a.codecs.split(".")[0]!==b.codecs.split(".")[0]?!1:!0};
|
|
105
|
+
VH=function(a){var b=a.audio,c=a.video,d=b?b.codecs:null,e=c?c.codecs:null,f=[];e&&f.push(e);d&&f.push(d);var g=c&&c.mimeType||null,h=b&&b.mimeType||null,l=[];b&&l.push(b.kind);c&&l.push(c.kind);l=l[0]||null;var m=new Set,n=new Set;if(b)for(var p=_.w(b.roles),q=p.next();!q.done;q=p.next())n.add(q.value);if(c)for(p=_.w(c.roles),q=p.next();!q.done;q=p.next())m.add(q.value);q=[c,b].map(function(t){return t?t.accessibility||[]:[]}).reduce(function(t,v){return t.concat(v)},[]);a={id:a.id,activeVideo:!1,
|
|
106
|
+
activeAudio:!1,activeText:!1,type:"variant",bandwidth:a.bandwidth,language:a.language,originalLanguage:a.language,label:null,kind:l,width:null,height:null,frameRate:null,trickPlay:!1,mimeType:g,audioMimeType:h,codecs:f.join(", "),audioCodec:d,videoCodec:e,primary:a.primary,roles:Array.from(m),audioRoles:Array.from(n),videoId:null,audioId:null,channelsCount:null,spatialAudio:!1,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null,accessibility:q};c&&
|
|
107
|
+
(a.videoId=c.id,a.originalVideoId=c.originalId,a.width=c.width||null,a.height=c.height||null,a.frameRate=c.frameRate||null,a.trickPlay=!!c.trickPlay,a.videoBandwidth=c.bandwidth||null);b&&(a.audioId=b.id,a.originalAudioId=b.originalId,a.originalLanguage=b.originalLanguage,a.channelsCount=b.channelsCount,a.audioBandwidth=b.bandwidth||null,a.label=b.label,a.audioRoles=b.roles);return a};
|
|
108
|
+
WH=function(a){return{id:a.id,activeVideo:!1,activeAudio:!1,activeText:!1,type:_.Q,bandwidth:0,language:a.language,originalLanguage:a.originalLanguage,label:a.label,kind:a.kind||null,width:null,height:null,frameRate:null,trickPlay:!1,mimeType:a.mimeType,audioMimeType:null,codecs:a.codecs||null,audioCodec:null,videoCodec:null,primary:a.primary,roles:a.roles,audioRoles:null,videoId:null,audioId:null,channelsCount:null,spatialAudio:!1,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,
|
|
109
|
+
originalTextId:a.originalId,accessibility:a.accessibility,keyId:null}};XH=function(a){return a.allowedByApplication&&a.allowedByKeySystem};
|
|
110
|
+
KH=function(a,b){var c=a.filter(function(g){return g.audio&&g.audio.channelsCount}),d=new Map;c=_.w(c);for(var e=c.next();!e.done;e=c.next()){e=e.value;var f=e.audio.channelsCount;d.has(f)||d.set(f,[]);d.get(f).push(e)}c=Array.from(d.keys());if(0===c.length)return a;e=c.filter(function(g){return g<=b});return e.length?d.get(Math.max.apply(null,e)):d.get(Math.min.apply(null,c))};
|
|
111
|
+
_.ZH=function(a,b,c,d){b=_.Vi(b);var e=a,f=a.filter(function(h){return h.primary});f.length&&(e=f);var g=e.length?e[0].language:"";e=e.filter(function(h){return h.language===g});b.some(function(h){var l=_.LE(_.Pj(h),a.map(function(m){return m.language}));return l?(e=a.filter(function(m){return _.Pj(m.language)===l}),!0):!1});d&&e.some(function(h){return h.kind===_.Ce})&&(e=e.filter(function(h){return h.kind===_.Ce}));if(c){b=YH(e,c);if(b.length)return b;_.Yh("No exact match for the text role could be found.")}else if(b=
|
|
112
|
+
e.filter(function(h){return 0===h.roles.length}),b.length)return b;b=e.map(function(h){return h.roles}).reduce(_.EE,[]);return b.length?YH(e,b[0]):e};YH=function(a,b){return a.filter(function(c){return c.roles.includes(b)})};
|
|
113
|
+
SH=function(a){var b=OE(a);return a.type===_.dd?"type\x3daudio mimeType\x3d"+a.mimeType+" codecs\x3d"+a.codecs+" codecInfo\x3d"+b+" bandwidth\x3d"+a.bandwidth+" channelsCount\x3d"+a.channelsCount:a.type===_.r?"type\x3dvideo mimeType\x3d"+a.mimeType+" codecs\x3d"+a.codecs+" codecInfo\x3d"+b+" bandwidth\x3d"+a.bandwidth+" frameRate\x3d"+a.frameRate+" width\x3d"+a.width+" height\x3d"+a.height:"unexpected stream type"};
|
|
114
|
+
_.$H=function(){this.g=new _.K("clpp.abr");this.A=null;this.l=!1;this.w=new rG;this.f=[];this.o=1;this.C=this.B=!1;this.j=this.a=this.h=null};aI=function(a,b,c){if(a.j&&a.a.useCmsd){var d=CE(a.j);null!==d&&(a.g.debug("Using CMSD maxSuggestedBitrateKbps:",d),c=c.filter(function(e){return e.bandwidth<=1E3*d}))}a=c.filter(function(e){return!e.trickPlay});b&&(a=a.filter(function(e){return QH(e,b)}));return a.sort(function(e,f){return e.bandwidth-f.bandwidth})};bI=function(){this.a=null};
|
|
115
|
+
dI=function(a,b){if(b&&(null==a.a||a.a!==b))throw cI(a);};cI=function(a){return new _.O(_.P,7,7E3,a.a?"Another load operation was started while a load operation was in progress.":"Player was released while a load operation was in progress.")};eI=function(){this.a=new Map};sH=function(a,b){a.a.has(b)||a.a.set(b,new fI);return a.a.get(b)};fI=function(){this.text=this.video=this.fb=this.audio=null};gI=function(a,b){this.f=a;this.a=new Set([a]);b=b||[];for(var c=_.w(b),d=c.next();!d.done;d=c.next())this.add(d.value)};
|
|
116
|
+
jI=function(a,b,c){c=void 0===c?!0:c;var d;if(!(d=!!a.audio!==!!b.audio||!!a.video!==!!b.video||a.language!==b.language)&&(d=a.audio&&b.audio)){d=a.audio;var e=b.audio;d=!(d.channelsCount===e.channelsCount&&(!c||hI(d,e))&&iI(d.roles,e.roles))}!d&&(d=a.video&&b.video)&&(a=a.video,b=b.video,d=!((!c||hI(a,b))&&iI(a.roles,b.roles)));return d?!1:!0};
|
|
117
|
+
hI=function(a,b){if(a.mimeType!==b.mimeType)return!1;var c=PE(a.codecs).map(function(f){return _.QE(f)}),d=PE(b.codecs).map(function(f){return _.QE(f)});if(c.length!==d.length)return!1;c.sort();d.sort();for(var e=0;e<c.length;e++)if(c[e]!==d[e])return!1;return!0};iI=function(a,b){var c=new Set(a),d=new Set(b);c["delete"](_.We);d["delete"](_.We);if(c.size!==d.size)return!1;c=_.w(c);for(var e=c.next();!e.done;e=c.next())if(!d.has(e.value))return!1;return!0};
|
|
118
|
+
lI=function(a){var b=void 0===b?_.Uf:b;this.f=a;this.a=b;this.h=new kI(a.language,"",a.audio&&a.audio.channelsCount?a.audio.channelsCount:0,!1,b)};kI=function(a,b,c,d,e){this.j=_.Vi(a);this.a=b;this.f=c;this.l=void 0===d?!1:d;this.h=void 0===e?_.Uf:e};mI=function(a,b){var c=null;b.some(function(d){c=_.LE(_.Pj(d),a.map(function(e){return KE(e)}));return!!c});return c?a.filter(function(d){return c===KE(d)}):[]};
|
|
119
|
+
nI=function(a,b){return a.filter(function(c){var d=c.audio;c=c.video;return d&&0<=d.roles.indexOf(b)||c&&0<=c.roles.indexOf(b)})};oI=function(a,b){return a.filter(function(c){return c.audio&&c.audio.spatialAudio!==b?!1:!0})};rI=function(a,b){this.a=pI;this.f=(new Map).set(pI,b).set(qI,a)};
|
|
120
|
+
tI=function(a){var b=this;this.D=a;this.a=a.getConfiguration().streaming;this.f=new _.wi;this.g=new _.K("clpp.mse.media.LiveEdgeObserver");sI(this)&&(a=this.D.getSurface().getMedia(),this.f.on(a,_.Hg,function(){var c=b.D.getPosition(),d=b.D.getSeekRange().end;c=d-c;var e=b.D.getPlaybackRate(),f=b.a.stopChasingAt;1<=e&&c>=b.a.chaseJumpDistance?(b.g.debug("Too far from edge, jump to beginning."),b.D.setPlaybackRate(1),b.D.seek(d)):1===e&&c>=b.a.startChasingAt?(b.g.debug("Not on live edge, increase playback rate."),
|
|
121
|
+
b.D.setPlaybackRate(b.a.chasingRate,_.ce)):1<e&&c<=f&&(b.g.debug("On live edge, reduce playback rate."),b.D.setPlaybackRate(1))}))};
|
|
122
|
+
sI=function(a){return 1>=a.a.chasingRate?(a.g.warn("chasingRate must be greater than 1."),!1):a.a.chaseJumpDistance<=a.a.startChasingAt?(a.g.warn("chaseJumpDistance must be greater than startChasingAt."),!1):a.a.startChasingAt<=a.a.stopChasingAt?(a.g.warn("startChasingAt must be greater than stopChasingAt."),!1):0>a.a.stopChasingAt?(a.g.warn("stopChasingAt must be greater than or equal to 0."),!1):!0};
|
|
123
|
+
vI=function(a,b,c,d,e){this.j=a;this.C=c;this.a={};this.G={};this.M=!1;this.f=null;this.h={};this.l=new _.wi;this.K=!1;this.w={};this.I=b;this.B=d;this.J=e;this.U=this.J.streaming.maxSegmentToMediaOffset||1;this.L=new _.xk;this.A="";this.H={};this.o=uI(this,this.L);this.P=!0;this.g=new _.K("clpp.mse.MediaSourceEngineSmooth")};
|
|
124
|
+
uI=function(a,b){if(window.ManagedMediaSource){a.j.disableRemotePlayback=!0;var c=new ManagedMediaSource;a.l.one(c,kE,function(){URL.revokeObjectURL(a.A);b.resolve()});a.l.on(c,lE,function(){a.P=!0});a.l.on(c,"endstreaming",function(){a.P=!1});a.A=wI(c);a.j.src=a.A;return c}c=new MediaSource;a.A=wI(c);a.l.one(c,kE,function(){URL.revokeObjectURL(a.A);b.resolve()});a.j.src=a.A;return c};
|
|
125
|
+
xI=function(a,b){b.forEach(function(c,d){var e=a.o.addSourceBuffer(c);a.l.on(e,_.Ae,a.Vk.bind(a,d));a.l.on(e,oE,a.Fc.bind(a,d));a.a[d]=e;a.G[d]=c;a.h[d]=[];a.H[d]=!1});a.M=b.has(_.dd)&&b.has(_.r)};yI=function(a,b){try{return new _.zm(a.a[b].buffered,b)}catch(c){return b in a.a&&a.g.error($D+b,c),null}};zI=function(a,b){if(!a.a[b])return"";var c=yI(a,b);return c?c.toString():""};
|
|
126
|
+
CI=function(a,b,c,d,e,f){return[f?Promise.resolve():AI(a,b,function(){try{a.g.debug(dD+b+SC);var g=a.a[b].appendWindowStart,h=a.a[b].appendWindowEnd;a.a[b].abort();a.a[b].appendWindowStart=g;a.a[b].appendWindowEnd=h}catch(l){throw a.g.warn(sD+b+SC,l),l;}a.g.debug(mD+b+SC);a.Fc(b)}),AI(a,b,function(){return BI(a,b,c)}),AI(a,b,function(){try{a.g.debug(KD+b,d,e),a.a[b].appendWindowStart=0,a.a[b].appendWindowEnd=e,a.a[b].appendWindowStart=d}catch(g){throw a.g.warn(wD+b,d,e,g),g;}a.g.debug(qD+b,d,e);a.Fc(b)})]};
|
|
127
|
+
BI=function(a,b,c){0>c&&(c+=.001);try{a.g.debug(MD+b,c),a.a[b].timestampOffset=c}catch(d){throw a.g.warn(xD+b,c,d),d;}a.g.debug(rD+b,c);a.Fc(b)};AI=function(a,b,c){if(a.K)return Promise.reject();c={start:c,p:new _.xk};a.h[b].push(c);1===a.h[b].length&&DI(a,b);return c.p};DI=function(a,b){var c=a.h[b][0];if(c)try{a.g.debug(OD+b),c.start()}catch(d){d.name===GD?c.p.reject(new _.O(_.P,3,3017,{type:b})):c.p.reject(new _.O(_.P,3,3015,{mediaError:d})),EI(a,b)}else a.g.debug(CD+b)};
|
|
128
|
+
FI=function(a,b){var c,d,e,f,g,h,l,m,n;return _.I(function(p){switch(p.a){case 1:if(a.K)return p["return"](Promise.reject());c=[];for(d in a.a)e=new _.xk,f={start:function(q){q.resolve()}.bind(null,e),p:e},a.h[d].push(f),c.push(e),1===a.h[d].length&&f.start();_.D(p,2);return _.y(p,Promise.all(c),4);case 4:_.Jh(p,3);break;case 2:g=_.H(p);for(h in a.a)a.h[h].length&&a.h[h].shift();return p["return"](Promise.reject(g));case 3:for(l in a.a);_.D(p,5,6);return _.y(p,b(),6);case 6:_.Kh(p);for(m in a.a)EI(a,
|
|
129
|
+
m);_.Lh(p);break;case 5:return n=_.H(p),p["return"](Promise.reject(new _.O(_.P,3,3015,{mediaError:n})))}})};EI=function(a,b){a.h[b].shift();DI(a,b)};GI=function(a,b,c){return AI(a,b,function(){b===_.Q?a.g.debug("Change not supported for "+b):(a.g.debug("Change Type: "+a.G[b]+" -\x3e "+c),XE()?(a.a[b].changeType(c),a.G[b]=c):a.g.debug("Change Type not supported"),a.Fc(b))})};
|
|
130
|
+
HI=function(a,b,c,d){var e,f,g,h,l;return _.I(function(m){return 1==m.a?(e=_.QE(_.El(a.G[b])),f=_.Dl(a.G[b]),g=_.Cl(c,d),h=_.QE(_.El(g)),l=_.Dl(g),e===h&&f===l?m["return"](!1):a.J.mediaSource.codecSwitchingStrategy===_.og&&XE()?_.y(m,GI(a,b,g),2):m.F(2)):m["return"](!0)})};II=function(a){this.h=a;this.a=null;this.f=function(){}};JI=function(a,b){a.f=b};
|
|
131
|
+
KI=function(a){var b=this;this.f=a;this.o=this.A=this.l=!1;this.h=this.f.oi();this.w=_.ce;this.j=null;this.a=new _.mi(function(){b.A||b.f.Sm(.25*b.h)});this.g=new _.K("clpp.mse.media.PlayRateController")};LI=function(a,b){a.j=b;a.j.speedUpMode&&(a.w=a.j.speedUpMode)};
|
|
132
|
+
OI=function(a,b){a.a.stop();a.l||(a.o=!1);var c=a.l?0:a.h;if((b?b:a.w)===_.ce||0===c||1===c)try{MI(a,c)}catch(d){a.g.warn('Set playbackRate using "decoder" mode fails, due to unsupported range by platform. Fallback to "seek" mode.',d),NI(a)}else NI(a)};NI=function(a){a.g.debug(LD,a.h,' using "seek" mode.');MI(a,0);a.o=!0;a.a.Kb(.25)};MI=function(a,b){if(a.f.oi()!==b){a.g.debug(LD,b,' using native playbackRate "decoder" mode.');try{a.f.yo(b)}catch(c){throw c;}}};
|
|
133
|
+
QI=function(a){function b(){d=!0}function c(m){f.push(m);_.En(m)}a=_.bk(a);var d=!1,e,f=[],g=[];(new _.Dn).N(_.cf,c).N(_.Jg,c).N(_.Ye,c).N(_.bf,c).N(_.tg,c).aa(_.vg,function(m){e=m;f.push(m);_.Fn(m)}).aa("encv",b).aa("enca",b).aa("avc1",function(m){g.push({N:m,Bd:1701733238})}).aa("avc3",function(m){g.push({N:m,Bd:1701733238})}).aa("ac-3",function(m){g.push({N:m,Bd:1701733217})}).aa(_.we,function(m){g.push({N:m,Bd:1701733217})}).aa("mp4a",function(m){g.push({N:m,Bd:1701733217})}).parse(a);if(d)return _.bi("Init segment already indicates encryption."),
|
|
134
|
+
a;if(0===g.length||!e)throw _.di("Failed to find boxes needed to fake encryption!"),_.di("Failed init segment (hex):",_.cn(a)),new _.O(_.P,3,14E3);g.reverse();for(var h=_.w(g),l=h.next();!l.done;l=h.next())l=l.value,_.bi('Inserting "'+_.In(l.Bd)+'" box into init segment.'),a=PI(a,e,l.N,f,l.Bd);return a};
|
|
135
|
+
PI=function(a,b,c,d,e){var f=RI.value(),g=a.subarray(c.start,c.start+c.size),h=_.ik(g),l=new Uint8Array(c.size+f.byteLength);l.set(g,0);g=_.ik(l);g.setUint32(4,e);l.set(f,c.size);e=h.getUint32(4);g.setUint32(c.size+16,e);SI(l,0,l.byteLength);e=new Uint8Array(a.byteLength+l.byteLength);c=_.Hl("Xbox One")||_.Gl()?c.start:c.start+c.size;f=a.subarray(c);e.set(a.subarray(0,c));e.set(l,c);e.set(f,c+l.byteLength);a=_.w(d);for(d=a.next();!d.done;d=a.next())d=d.value,SI(e,d.start,d.size+l.byteLength);l=_.ik(e,
|
|
136
|
+
b.start);b=_.Jn(b);a=l.getUint32(b);l.setUint32(b,a+1);return e};SI=function(a,b,c){a=_.ik(a,b);b=a.getUint32(0);0!==b&&(1===b?(a.setUint32(8,c>>32),a.setUint32(12,c&4294967295)):a.setUint32(0,c))};_.UI=function(a,b){this.D=b;this.j=a;TI(a);this.h=null;this.l=1;this.H=Promise.resolve();this.B=new Map;this.w=new Map;this.a=new Map;this.J=this.f=this.o=this.C=!1;this.I=0;this.g=new _.K("clpp.mse.Streaming");this.A=this.G=!1};
|
|
137
|
+
WI=function(a){var b=a.a.get(_.r);return b?VI(a,b.hc):(b=a.a.get(_.dd))?VI(a,b.hc):null};YI=function(a){return _.XI(a,_.dd)};ZI=function(a){return _.XI(a,_.r)};
|
|
138
|
+
dJ=function(a,b){var c,d,e,f,g,h,l,m,n,p;return _.I(function(q){switch(q.a){case 1:return c=_.er,_.y(q,a.D.X.clear(c.TEXT),2);case 2:return a.I++,a.J=!1,d=a.I,e=a.D.X,f=new Map,g=new Set,f.set(c.TEXT,b),g.add(b),_.y(q,e.init(f,!1,a.h.disableAudioTracks),3);case 3:return a.f?q["return"]():_.y(q,$I(a,g),4);case 4:if(a.f)return q["return"]();l=(h=e.getTextDisplayer().isTextVisible())||a.h.alwaysStreamText;if(a.I===d&&!a.a.has(c.TEXT)&&!a.J&&l){m=a.D.Qb();n=aJ(a,m);if(null==n)return a.g.warn("Cannot set up text media state, period not found at",
|
|
139
|
+
m),q["return"]();p=bJ(b,n,0);a.a.set(c.TEXT,p);cJ(a,p,0)}_.C(q)}})};gJ=function(a){a.J=!0;var b=a.a.get(_.Q);b&&(a.g.info("Unload text stream"),eJ(b),fJ(b)["catch"](function(){}),a.a["delete"](_.Q))};hJ=function(a){var b,c;return _.I(function(d){if(1==d.a){b=_.er;c=a.a.get(b.AUDIO);if(!c)return d.F(0);a.g.info("Unload audio stream");eJ(c);return _.y(d,fJ(c)["catch"](function(){}),3)}a.a["delete"](b.AUDIO);_.C(d)})};jJ=function(a,b,c,d){b.video&&_.iJ(a,b.video,c,d);b.audio&&_.iJ(a,b.audio,c,d)};
|
|
140
|
+
lJ=function(a){var b,c;_.I(function(d){if(1==d.a){if(a.A)return d["return"]();a.A=!0;return _.y(d,hJ(a),2)}b=_.er;c=a.a.get(b.VIDEO);return _.y(d,kJ(a,c),0)})};nJ=function(a,b){var c;_.I(function(d){if(1==d.a){if(!a.A)return d.F(2);a.A=!1;c=a.D.Qb();return _.y(d,mJ(a,b,null,null,c),2)}_.iJ(a,b,!0,0);_.C(d)})};pJ=function(a,b){var c=a.j.periods.map(function(d){return d.id});a.g.debug("Manifest updated, periods ("+c.length+"): "+c.join(", "));a.j.periods=b.periods;TI(a.j);oJ(a)};
|
|
141
|
+
TI=function(a){a.periods.every(function(b){return typeof b.id===_.ug})};
|
|
142
|
+
qJ=function(a){function b(l){return a.D.X.Tb(l,c,0)}var c=a.D.Qb(),d=!1,e=aJ(a,c);if(_.Yj(a.a.values(),function(l){return l.hc===e}))for(var f=_.w(a.a.keys()),g=f.next();!g.done;g=f.next()){g=g.value;var h=a.a.get(g);h.stream.segmentIterator=null;b(g)||(kJ(a,h),d=!0)}else if(!_.Yj(a.a.keys(),b)){a.g.debug("(all): seeked: unbuffered seek: clearing all buffers");d=_.w(a.a.values());for(f=d.next();!f.done;f=d.next())kJ(a,f.value);d=!0}d||a.g.debug("(all): seeked: buffered seek: presentationTime\x3d"+
|
|
143
|
+
c)};tJ=function(a,b){b=void 0===b?!1:b;if(a.f)a.g.error("Unable to retry after StreamingEngine is destroyed!");else if(a.o)a.g.error("Unable to retry after StreamingEngine encountered a fatal error!");else for(var c=_.w(a.a.values()),d=c.next();!d.done;d=c.next()){d=d.value;var e=rJ(d);if(d.wd||b&&sJ(d))a.g.info(e,"Retrying after failure..."),d.wd=!1,cJ(a,d,.1)}};uJ=function(a){return Array.from(a.a.values()).some(function(b){return null!==b.vb})};
|
|
144
|
+
vJ=function(a){var b=Array.from(a.a.values());return a.C&&b.every(function(c){return c.endOfStream})};xJ=function(a){var b,c,d,e;return _.I(function(f){b=[];c=_.w(a.a.values());for(d=c.next();!d.done;d=c.next())e=d.value,eJ(e),e.Fb&&e.jc&&(e.Fb=!1,b.push(e.jc.abort())),e.nc&&b.push(wJ(a,e,!0,0));return _.y(f,Promise.all(b),0)})};yJ=function(a,b,c){(a=a.a.get(b))&&c&&(eJ(a),a.stream=c,a.qc=c,a.ta&&(a.ta=c.getSegmentReference(a.ta.position)),a.ta||(a.qc=null))};
|
|
145
|
+
_.XI=function(a,b){var c=a.a.get(b);return c?c.vc||c.stream:null};
|
|
146
|
+
_.iJ=function(a,b,c,d){var e=a.a.get(b.type);if(!e&&b.type===_.Q&&a.h.ignoreTextStreamFailures)dJ(a,b);else if(e){var f=zJ(a,b).id;if(c&&f!==e.hc)for(a.g.debug("switch: switching to stream in another Period; clearing buffer and changing Periods"),b=_.w(a.a.values()),c=b.next();!c.done;c=b.next())kJ(a,c.value);else if(e.vc&&(a.g.debug("switch during trick play mode",b),b.trickModeVideo?(e.vc=b,b=b.trickModeVideo,a.g.debug("switch found trick play stream",b)):(e.vc=null,a.g.debug("switch found no special trick play stream"))),
|
|
147
|
+
AJ(a,f))if(BJ(a,b.id)||$I(a,new Set([b])),e.stream!==b){var g=a.j.presentationTimeline.getDuration(),h=a.D.Qb();h=CJ(a,e,h);!c&&(e.endOfStream||h>=g)?a.g.debug(nE+rJ(e)+" already buffered to the end. Not switching."):(b.type===_.Q&&a.D.X.uc(_.Cl(b.mimeType,b.codecs)),e.stream=b,e.stream.segmentIterator=null,e.pf=!0,a.g.debug("switch: switching to Stream "+rJ(e)),DJ(a,e,f)&&(a.g.info("Aborting current segment request to switch."),e.jc.abort()),c&&(e.Dc?e.Gf=!0:e.Fb?(e.nc=!0,e.Te=d,e.Gf=!0):(eJ(e),
|
|
148
|
+
wJ(a,e,!0,d)["catch"](function(l){if(a.D)a.D.onError(l)}))))}else a.g.debug(nE+rJ(e)+" already active")}};AJ=function(a,b){var c=a.B.get(b);return!(!c||!c.Cf)};BJ=function(a,b){var c=a.w.get(b);return!(!c||!c.Cf)};
|
|
149
|
+
DJ=function(a,b,c){if(!b.jc)return!1;var d=a.D.Qb(),e=a.D.X.la(b.type);c=(c=EJ(a,b,d,e,c))?c.he():null;if(null==c)return!1;var f=b.stream.initSegmentReference;f&&(c+=f.he()||0);f=a.D.ee().getBandwidthEstimate();if(8*c/f<(null===e?0:e-d)-Math.max(a.j.minBufferTime||0,a.h.rebufferingGoal))return!0;a=b.jc;a=a.j?a.j.bytesRemaining:-1;return 0>a||a>c?!0:!1};
|
|
150
|
+
kJ=function(a,b){var c,d;return _.I(function(e){c=rJ(b);if(b.Dc)return a.g.debug(c,"clear: already clearing the buffer"),e["return"]();if(b.nc)return a.g.debug(c,"clear: already waiting"),e["return"]();if(b.Fb)return a.g.debug(c,"clear: currently updating"),b.nc=!0,b.Te=0,e["return"]();d=b.type;if(null==a.D.X.Ua(d))return a.g.debug(c,"clear: nothing buffered"),null==b.vb&&cJ(a,b,0),e["return"]();a.g.debug(c,"clear: handling right now");eJ(b);return _.y(e,wJ(a,b,!1,0)["catch"](function(f){if(a.D)a.D.onError(f)}),
|
|
151
|
+
0)})};
|
|
152
|
+
mJ=function(a,b,c,d,e){var f,g,h,l,m,n,p;return _.I(function(q){if(1==q.a){f=a.D.Qb();g=aJ(a,f);if(null==g)return a.g.warn("Cannot initialize streams, period not found at",f),q["return"]();h=_.er;l=new Map;m=new Set;b&&(l.set(h.AUDIO,b),m.add(b));c&&(l.set(h.VIDEO,c),m.add(c));d&&(l.set(h.TEXT,d),m.add(d));n=a.D.X;p=a.h.forceNativeTS;return _.y(q,n.init(l,p,a.h.disableAudioTracks),2)}if(3!=q.a){if(a.f)return q["return"]();oJ(a);return _.y(q,$I(a,m),3)}if(a.f)return q["return"]();l.forEach(function(t,v){if(!a.a.has(v)){var z=
|
|
153
|
+
bJ(t,g,e);a.a.set(v,z);cJ(a,z,0)}});_.C(q)})};bJ=function(a,b,c){return{stream:a,type:a.type,qc:null,segmentIterator:null,ta:null,vc:null,pf:!0,hc:b,endOfStream:!1,Fb:!1,vb:null,nc:!1,Te:0,Gf:!1,Dc:!1,Kg:!1,wd:!1,rj:c||0,jc:null,Ze:!1,Ki:0}};GJ=function(a){a.g.debug("(all) setupAllPeriods_");a.j.periods.map(function(b){return b.id}).forEach(function(b){FJ(a,b)["catch"](FE)})};
|
|
154
|
+
FJ=function(a,b){var c=a.B.get(b);if(c)return a.g.debug("(all) Period "+b+UC),c;a.g.debug("(all) setting up Period "+b);var d=new _.xk;a.B.set(b,d);var e=new Set;c=VI(a,b);for(var f=_.w(c.variants),g=f.next();!g.done;g=f.next())g=g.value,g.video&&e.add(g.video),g.video&&g.video.trickModeVideo&&e.add(g.video.trickModeVideo),g.audio&&e.add(g.audio);c=_.w(c.textStreams);for(f=c.next();!f.done;f=c.next())e.add(f.value);a.H=a.H.then(function(){return a.f?null:$I(a,e)}).then(function(){a.f||(d.resolve(),
|
|
155
|
+
a.g.debug("(all) setup Period "+b))})["catch"](function(h){a.f||(d["catch"](function(){}),d.reject(),a.B["delete"](b),a.g.warn("(all) failed to setup Period "+b),a.D.onError(h))});return d};
|
|
156
|
+
$I=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,v;return _.I(function(z){switch(z.a){case 1:c=[];d=_.w(b);for(e=d.next();!e.done;e=d.next())f=e.value,(g=a.w.get(f.id))?(a.g.debug("(all) Stream "+f.id+UC),c.push(g)):(a.g.debug("(all) setting up Stream "+f.id),a.w.set(f.id,new _.xk),h=a.D.Eb,c.push(f.createSegmentIndex(h)));_.D(z,2);return _.y(z,Promise.all(c),4);case 4:if(a.f)return z["return"]();_.Jh(z,3);break;case 2:l=_.H(z);if(a.f)return z["return"]();m=_.w(b);for(e=m.next();!e.done;e=m.next())if(n=
|
|
157
|
+
e.value,p=a.w.get(n.id))p["catch"](function(){}),p.reject(),a.w["delete"](n.id);throw l;case 3:q=_.w(b);for(e=q.next();!e.done;e=q.next())t=e.value,(v=a.w.get(t.id))&&!v.done&&(v.resolve(),a.g.debug("(all) setup Stream "+t.id));_.C(z)}})};oJ=function(a){var b=a.j.presentationTimeline.getDuration();Infinity>b?a.D.X.eg(b):a.D.X.eg(Math.pow(2,32))};
|
|
158
|
+
JJ=function(a,b){function c(n){return n.type===_.Q&&n.stream.mimeType===_.Wc}if(c(b))return a.D.X.Gh(b.stream.originalId||""),null;b.type===_.Q&&a.D.X.yh();if(!a.D.X.Gi()&&b.type!==_.Q)return a.h.bufferLimitUpdateInterval?a.h.bufferLimitUpdateInterval/2:.5;var d=rJ(b),e=a.D.Qb(),f=CJ(a,b,e);a.g.debug(d,"timeNeeded\x3d"+f);var g=a.D.X.Ga(b.type,e);a.g.debug(d,"update_:",gE+e,"bufferedAhead\x3d"+g);var h=Math.max(a.j.minBufferTime||0,a.h.rebufferingGoal,a.h.bufferingGoal)*a.l,l=uF(a.j.presentationTimeline);
|
|
159
|
+
if(null!=l&&f>=l&&!b.Ze)return HJ(a,b),null;b.endOfStream=!1;l=zJ(a,b.stream).id;var m=aJ(a,f);null!=m&&(b.hc=m);if(m!==l)return a.g.debug(d,"need Period "+m,gE+e,"timeNeeded\x3d"+f,"currentPeriodId\x3d"+l),null;if(g>=h)return a.g.debug(d,"buffering goal met"),a.h.bufferLimitUpdateInterval||.5;g=a.D.X.la(b.type);g=EJ(a,b,e,g,l);if(!g)return a.j.presentationTimeline.isLive()||b.type===_.Q?a.h.bufferLimitUpdateInterval||1:(a.g.debug("Media state "+d+": no next segment found. Assuming EOS."),HJ(a,b),
|
|
160
|
+
null);d=Infinity;h=_.w(a.a.values());for(m=h.next();!m.done;m=h.next())m=m.value,c(m)||(m=CJ(a,m,e),d=Math.min(d,m));if(f>=d+a.j.presentationTimeline.h)return a.h.bufferLimitUpdateInterval||1;b.rj=0;IJ(a,b,e,l,g)["catch"](function(){});return null};HJ=function(a,b){a.g.debug(rJ(b),"buffered to end of presentation");b.endOfStream=!0;if(b.type===_.r){var c=a.a.get(_.Q);c&&c.stream.mimeType===_.Wc&&(c.endOfStream=!0)}};
|
|
161
|
+
CJ=function(a,b,c){return b.qc&&b.ta?zJ(a,b.qc).startTime+b.ta.endTime:Math.max(c,b.rj)};
|
|
162
|
+
EJ=function(a,b,c,d,e){if(null==e)return a.g.warn(iD),null;if(b.stream.segmentLookupStrategy===_.bE)b.stream.segmentIterator?a=LF(b.stream.segmentIterator):b.ta||d?(c=b.ta?b.ta.endTime:d,a.g.info(zD,"looking up segment from new stream endTime:",c),b.stream.segmentIterator=PF(b.stream.segmentIndex,c),e=b.stream.segmentIterator.next().value,null===e&&(b.stream.segmentIterator=null,a.g.warn(zD,WD,"endTime:",c,b.ta)),a=e):(e=VI(a,e),e=Math.max(0,c-e.startTime),a.g.info(zD,"looking up segment","lookupTime:",
|
|
163
|
+
e,fE,c),d=null,d||(b.stream.segmentIterator=PF(b.stream.segmentIndex,e),d=b.stream.segmentIterator.next().value),null===d&&a.g.warn(zD,WD,"lookupTime:",e,fE,c),a=d);else{var f=rJ(b);if(b.ta&&b.stream===b.qc)c=b.ta.position+1,a.g.debug(f,"next position known:","position\x3d"+c),a=KJ(a,b,e,c);else{if(b.ta){a.g.debug(f,"next position unknown: another Stream buffered");f=zJ(a,b.qc);var g=LJ(a,b,f.startTime+b.ta.endTime,e)}else a.g.debug(f,"next position unknown: nothing buffered"),g=LJ(a,b,d||c,e);if(null==
|
|
164
|
+
g)a=null;else if(f=KJ(a,b,e,g),null==f)a=null;else{var h=null==a.h?!1:a.h.ignoreDrift;null!=d||h||(d=f,d.Ja+d.startTime+2>c&&(a=KJ(a,b,e,Math.max(0,g-1)))&&(f=a));a=f}}}return a};LJ=function(a,b,c,d){var e=rJ(b);d=VI(a,d);var f=Math.max(0,c-d.startTime);b=b.stream.findSegmentPosition(f);a.g.debug(e,"Looked up segment:",gE+c,"lookupTime\x3d"+f,YD+d.startTime,"Result: segment position\x3d"+b);null==b&&a.g.warn(e,"cannot find segment:",YD+d.startTime,"lookupTime\x3d"+f);return b};
|
|
165
|
+
KJ=function(a,b,c,d){var e=rJ(b);if(null==c)return a.g.warn(e,iD),null;c=VI(a,c);var f=b.stream.getSegmentReference(d);if(!f)return a.g.debug(e,"segment does not exist:",YD+c.startTime,"position\x3d"+d),null;var g=a.j.presentationTimeline;d=_.AF(g);g=zF(g);return!b.Ze&&(c.startTime+f.endTime<d||c.startTime+f.startTime>g)?(a.g.debug(e,"segment is not available:",YD+c.startTime,jE+f.startTime,hE+f.endTime,"availabilityStart\x3d"+d,"availabilityEnd\x3d"+g),null):f};
|
|
166
|
+
IJ=function(a,b,c,d,e){var f,g,h,l,m,n,p,q,t,v,z,A,E;return _.I(function(G){f=_.er;g=rJ(b);h=VI(a,d);a.g.debug(g,"fetchAndAppend_:",gE+c,YD+h.startTime,iE+e.position,jE+e.startTime,hE+e.endTime);l=b.stream;m=b.stream.segmentIterator;n=a.j.presentationTimeline.getDuration();p=MJ(a,d);q=Math.max(0,h.startTime-.1);t=p?p.startTime+.01:n;v=NJ(a,b,h,q,t,e);b.Fb=!0;b.pf=!1;a.g.debug(g,"fetching segment");z=!1;A=function(B,F){if(a.f||a.o)return null;z=!0;return OJ(a,b,c,h,l,e,B,F)};E=a.D.X.la(b.type)||0;
|
|
167
|
+
v.then(function(){return a.f||a.o?null:PJ(a,b,e,!1,function(B){return A(B.data,!0)})}).then(function(B){return a.f||a.o?null:z||null===B?(QJ(a,b,E,e,l),null):A(B,!1)}).then(function(){if(!a.f&&!a.o){QJ(a,b,E,e,l);b.Fb=!1;b.Kg=!1;b.nc||a.D.wf();if(m){var B=m.next().value;B&&a.g.debug("New iterated segment",B)}cJ(a,b,0);RJ(a,b,l);a.g.debug(g,"finished fetch and append")}})["catch"](function(B){return _.I(function(F){if(a.f||a.o)return F["return"]();b.Fb=!1;if(b.type===f.TEXT&&a.h.ignoreTextStreamFailures)return 1001===
|
|
168
|
+
B.code?a.g.warn(g,"Text stream failed to download. Proceeding without it."):a.g.warn(g,"Text stream failed to parse. Proceeding without it."),a.a["delete"](f.TEXT),F.F(0);if(7001===B.code)return b.Fb=!1,b.vb=null,cJ(a,b,0),F.F(0);if(3017===B.code)return SJ(a,b,B),F.F(0);if(1001===B.code&&B.data&&404===B.data[1])return a.g.warn(g,"request for segment failed","segment not available on server",iE+e.position,jE+e.startTime,hE+e.endTime,"error\x3d"+B),b.Fb=!1,b.vb=null,cJ(a,b,1),F.F(0);if(b.type===f.TEXT)return B instanceof
|
|
169
|
+
_.O&&B.a(1),eJ(b),a.D.onError(new _.O(1,2,2010,B)),F.F(0);if(1001<=B.code&&1003>=B.code)return _.y(F,TJ(a,b,h,B),0);a.g.error(g,"failed fetch and append: code\x3d"+B.code);b.wd=!0;B instanceof _.O&&B.a(_.P);return _.y(F,UJ(a,B),0)})});_.C(G)})};
|
|
170
|
+
SJ=function(a,b,c){var d=rJ(b);if(Array.from(a.a.values()).some(function(f){return f!==b&&f.Kg}))a.g.debug(d,BD,"waiting for another stream to recover...");else{var e=Math.round(100*a.l);if(20<e)a.l-=.2;else if(4<e)a.l-=.04;else{a.g.error(d,"MediaSource threw QuotaExceededError too many times");b.wd=!0;a.o=!0;a.D.onError(c);return}a.g.warn(d,BD,"reducing buffering goals by "+(100-Math.round(100*a.l))+"%");b.Kg=!0}cJ(a,b,4)};
|
|
171
|
+
TJ=function(a,b,c,d){var e,f;return _.I(function(g){e=1001===d.code&&500<=d.data.status;f=!0;e||(f=!a.D.Wf(b.stream,c));if(!f)return g.F(0);b.wd=!0;d.a(_.P);return _.y(g,UJ(a,d),0)})};
|
|
172
|
+
NJ=function(a,b,c,d,e,f){var g,h,l,m,n,p,q;return _.I(function(t){g=c.startTime-f.Ja;h=b.pf||f.initSegment!==(b.ta&&b.ta.initSegment);if(!h&&g===b.Ki)return t["return"](Promise.resolve());b.Ki=g;l=rJ(b);a.g.debug(l,"setting timestamp offset to "+g);a.g.debug(l,"setting append window start to "+d);a.g.debug(l,"setting append window end to "+e);m=a.D.X.tj(b.type,g,d,e,b.stream.mimeType,b.stream.codecs);if(!b.stream.initSegmentReference||!h)return t["return"](m);a.g.debug(l,"fetching init segment");
|
|
173
|
+
n=f&&f.initSegment||b.stream.initSegmentReference;p=PJ(a,b,n,!0);q=p.then(function(v){if(a.f)return null;a.g.debug(l,"appending init segment");return VJ(a,v,b).then(function(){return a.D.X.Ve(b.type,v,null,null,!!b.stream.closedCaptions&&0<b.stream.closedCaptions.size)})})["catch"](function(v){b.pf=!0;return Promise.reject(v)});return t["return"](Promise.all([m,q]))})};
|
|
174
|
+
VJ=function(a,b,c){var d;return _.I(function(e){if(!a.h.patchEdgeWhenMixedContent||!_.Gl())return e.F(0);d=QI(b);return _.y(e,a.D.X.Ve(c.type,d.buffer,null,null,!!c.stream.closedCaptions&&0<c.stream.closedCaptions.size),0)})};
|
|
175
|
+
OJ=function(a,b,c,d,e,f,g,h){h=void 0===h?!1:h;var l,m,n,p,q,t,v,z;return _.I(function(A){switch(A.a){case 1:l=rJ(b);if(!(e&&e.keyId&&a.D.Zd)){A.F(2);break}m=wE(a.D.Zd,e.keyId);if(!m){a.g.warn("Unable to find DRM session for "+e.keyId);A.F(2);break}_.D(A,4);return _.y(A,m,6);case 6:_.Jh(A,2);break;case 4:_.H(A),a.g.warn("DRM session load failed, cannot append segment!");case 2:if(!(e.encrypted&&e.keyId&&a.D.Zd&&yE(a.D.Zd,e.keyId))){A.F(7);break}eJ(b);n=zJ(a,e).id;p=WJ(a,n);if(!p){A.F(8);break}return _.y(A,
|
|
176
|
+
p,8);case 8:return q=a.D.Wf(e,d,cE),t=f.startTime+d.startTime,v=f.endTime+d.startTime,a.g.warn(l,"Blocked append for "+t+" - "+v+": "+q+". Stream with Key ID "+(e.keyId+" has restrictions.")),A["return"](Promise.resolve());case 7:return z=e.closedCaptions&&0<e.closedCaptions.size,null!=e.emsgSchemeIdUris&&0<e.emsgSchemeIdUris.length&&(new _.Dn).aa("emsg",a.On.bind(a,d,f,e.emsgSchemeIdUris)).parse(g),A["return"](XJ(a,b,c).then(function(){if(a.f)return null;var E=f.startTime+d.startTime,G=f.endTime+
|
|
177
|
+
d.startTime;a.g.debug(l,"Appending segment with "+(E.toFixed(3)+" - "+G.toFixed(3)+" KeyID: ")+(e.keyId+" Width: ")+(e.width+" Height: "+e.height+" Bitrate: ")+(_.T.Vf(e.bandwidth)+" Fragment: ")+h);return a.D.X.Ve(b.type,g,E,G,z,e.id,h,e.type===_.r&&null!=e.muxedAudioId&&!a.A)}).then(function(){a.f||(a.g.debug(l,"appended media segment"),b.qc=e,b.ta=f)}))}})};
|
|
178
|
+
QJ=function(a,b,c,d,e){if(!a.j.presentationTimeline.isLive()&&b.type!==_.Q){var f=rJ(b),g=(a.D.X.la(b.type)||0)-c,h=d.endTime-d.startTime;c=g-h;if(Math.abs(c)>=Math.min(.01,h)&&Math.abs(c)<=Math.min(1,h))for(a.g.debug(f,"Adjusted segment",d.position,"with real duration",g,"and accounted for",c,"delta between segment duration and real duration"),b.Ze=!0,a=a.j.periods,e.adjustSegmentDurations(d.position,c),d=hF(a,e),b=a[d],e=e.getDuration(),jF(b,e),e=d+1;e<a.length;e++)a[e].startTime+=c}};
|
|
179
|
+
YJ=function(a,b,c){(new _.Dn).N(_.cf,_.En).N(_.Jg,_.En).N(_.Ye,_.En).N(_.bf,_.En).N(_.tg,_.En).aa(_.vg,_.Fn).N("encv",function(d){d.reader.skip(78);_.En(d)}).N(_.ng,_.En).N("schi",_.En).N("tenc",function(d){d.reader.skip(6);if(_.wn(d.reader)){d.reader.skip(1);var e=_.cn(_.Cn(d.reader,16));e!==b.stream.keyId&&(a.g.debug(rJ(b),"Key id from tenc mismatches with key id from manifest. Switching from "+(b.stream.keyId+" to "+e+".")),b.stream.keyId=e)}d.parser.stop()}).parse(c)};
|
|
180
|
+
XJ=function(a,b,c){if(a.f)return Promise.resolve();var d=rJ(b);a.g.debug(d,"checking buffer length");var e=Math.max(a.h.bufferBehind,a.j.presentationTimeline.h),f=a.D.X.Ua(b.type);if(null==f)return a.g.debug(d,"buffer behind okay because nothing buffered:",gE+c,TD+e),Promise.resolve();var g=c-f,h=g-e;if(.01>=h)return a.g.debug(d,"buffer behind okay:",gE+c,UD+g,TD+e,"underflow\x3d"+Math.abs(h)),Promise.resolve();a.g.debug(d,"buffer behind too large:",gE+c,UD+g,TD+e,"overflow\x3d"+h);return a.D.X.remove(b.type,
|
|
181
|
+
f,f+h).then(function(){a.f||a.g.debug(d,"evicted "+h+WC)})};RJ=function(a,b,c){if(!a.C){b=rJ(b);var d=Array.from(a.a.values());1!==d.length||d[0].type!==_.Q?a.C=d.every(function(e){return e.type===_.Q||a.G?!0:!e.nc&&!e.Dc&&e.ta}):a.G&&(a.C=!0);a.C&&(a.g.debug(b,"startup complete"),c=zJ(a,c).id,MJ(a,c),WJ(a,c))}};WJ=function(a,b){var c=null;a.B.has(b)||(c=FJ(a,b).then(function(){a.f||(a.g.debug(VD),a.D.wg())})["catch"](FE));GJ(a);a.D.In&&(a.g.debug("calling onStartupComplete()..."),a.D.In());return c};
|
|
182
|
+
ZJ=function(a,b){var c=rJ(b),d=zJ(a,b.stream).id;if(b.hc!==d){var e=b.hc,f=Array.from(a.a.values());f.every(function(g){return g.hc===e})?f.every(sJ)?(a.g.debug(c,"all need Period "+e),FJ(a,e).then(function(){if(!a.f)if(a.D.X.qj(),f.every(function(n){var p=sJ(n),q=zJ(a,n.stream).id;return p&&n.hc===e&&q!==e})){var g=VI(a,e);a.g.debug(c,"Streaming period",e,g);a.g.debug(c,"calling onChooseStreams()...");var h=a.D.xg(g);a.G=!h.audio&&!h.video&&!!h.text;var l=new Map;h.video&&l.set(_.r,h.video);h.audio&&
|
|
183
|
+
l.set(_.dd,h.audio);h.text&&l.set(_.Q,h.text);var m=_.w(a.a.keys());for(h=m.next();!h.done;h=m.next())if(h=h.value,!l.has(h)&&h!==_.Q){a.g.error(c,"invalid Streams chosen: missing "+h+" Stream");a.D.onError(new _.O(_.P,5,5005));return}m=_.w(Array.from(l.keys()));for(h=m.next();!h.done;h=m.next())if(h=h.value,!a.a.has(h))if(h===_.Q)mJ(a,null,null,l.get(_.Q),g.startTime),l["delete"](h);else{a.g.error(c,"invalid Streams chosen: unusable "+h+" Stream");a.D.onError(new _.O(_.P,5,5005));return}g=_.w(Array.from(a.a.keys()));
|
|
184
|
+
for(h=g.next();!h.done;h=g.next())h=h.value,(m=l.get(h))?(_.iJ(a,m,!1,0),cJ(a,a.a.get(h),0)):a.a["delete"](h);a.g.debug(c,VD);a.D.wg()}else a.g.debug(c,"ignoring transition to Period",e,"since another is happening")})["catch"](FE)):a.g.debug(c,"all MediaStates need Period "+e+", but not all MediaStates are idle"):a.g.debug(c,"not all MediaStates need Period "+e)}};aJ=function(a,b){var c=fF(a.j.periods,b+_.sw);return c?c.id:null};
|
|
185
|
+
zJ=function(a,b){var c=a.j.periods,d=hF(c,b);c=c[d];if(!c)throw new _.O(_.P,5,5006,"No period found for stream with ID "+b.id+".");return c};$J=function(a,b){if(a.D.pd){var c=b.Ta;if(c)return _.AG(a.D.pd,c.id)}return null};aK=function(a,b,c){if(a.D.pd&&b){c&&0===c.request.uriIndex||_.BG(a.D.pd,b.ka[0].serviceLocationId);var d=c.request,e=c.timeMs;c=c.data.byteLength;e&&c&&(a=_.zG(a.D.pd,b.ka[d.uriIndex].serviceLocationId),_.sG(a.Uf,e,c),a.Ae=!0)}};
|
|
186
|
+
PJ=function(a,b,c,d,e){d=void 0===d?!1:d;e=void 0===e?null:e;var f=[],g=$J(a,c);g&&(f=_.vG(g,c.ye));f.length||(f=c.eb());f=_.nF(f,c.Da,c.pa,a.h.attemptParameters,c.startTime,c.endTime,b.type,c.timescale);f.type=2;f.onFragment=c.sd?null:e;f.disableFragmentSupport=c.sd||a.h.disableFragmentSupport;f.disableMergedFragments=a.h.disableMergedFragments;if(e=c.f())f.keyInfo=e,f.onFragment=null;d&&(f.responseModifiers.push(function(h){YJ(a,b,h.data)}),b.type===_.r&&a.h.overridePasp&&f.responseModifiers.push(a.Qo.bind(a)));
|
|
187
|
+
a.g.debug("fetching: reference\x3d",c);c=a.D.Eb.fetch(f);b.jc=c;return c.T.then(function(h){var l=a.D.ee(),m=h.timeMs,n=h.data.byteLength;m&&n&&!d&&l.segmentDownloaded(m,n);aK(a,g,h);b.jc=null;return h.data})["catch"](function(h){aK(a,g);throw h;})};
|
|
188
|
+
wJ=function(a,b,c,d){var e,f,g,h;return _.I(function(l){if(1==l.a)return e=rJ(b),b.nc=!1,b.Gf=!1,b.Te=0,b.Dc=!0,b.stream.segmentIterator=null,a.g.debug(e,"clearing buffer"),d?(g=a.D.Qb(),h=a.D.X.getDuration(),f=a.D.X.remove(b.type,g+d,h)):f=a.D.X.clear(b.type).then(function(){return!a.f&&c?a.D.X.flush(b.type):null}),_.y(l,f,2);if(a.f)return l["return"]();a.g.debug(e,"cleared buffer");b.qc=null;b.ta=null;b.Dc=!1;b.endOfStream=!1;b.Ze=!1;cJ(a,b,0);_.C(l)})};
|
|
189
|
+
cJ=function(a,b,c){a.g.debug(rJ(b),"updating in "+c+WC);b.vb=(new _.ji(function(){var d;return _.I(function(e){if(1==e.a)return _.D(e,2),_.y(e,a.ic(b),4);if(2!=e.a)return _.Jh(e,0);d=_.H(e);if(a.D)a.D.onError(d);_.C(e)})})).fa(c)};eJ=function(a){null!=a.vb&&(a.vb.stop(),a.vb=null)};VI=function(a,b){var c=a.j.periods.find(function(d){return d.id===b})||null;if(!c)throw new _.O(_.P,5,5006,"Period "+b+" not found");return c};
|
|
190
|
+
MJ=function(a,b){var c=a.j.periods.findIndex(function(d){return d.id===b});return 0>c?null:a.j.periods[c+1]||null};fJ=function(a){return _.I(function(b){return a.jc?_.y(b,a.jc.abort(),0):b.F(0)})};UJ=function(a,b){var c;return _.I(function(d){switch(d.a){case 1:if(a.f)return d["return"]();if(!a.D.wj){d.F(2);break}_.D(d,3);return _.y(d,a.D.wj(b),5);case 5:_.Jh(d,2);break;case 3:c=_.H(d),c.cause=b,b=c;case 2:if(!b.f)a.D.onError(b);_.C(d)}})};rJ=function(a){return"("+a.type+":"+a.stream.id+")"};
|
|
191
|
+
sJ=function(a){return!a.Fb&&null==a.vb&&!a.nc&&!a.Dc};bK=function(){this.a=null};
|
|
192
|
+
eK=function(){_.Lm.call(this,XD);var a=this;this.I=cK;this.l=this.ja=null;this.dh=0;this.Aj=2;this.ed=null;this.Wg=!1;this.w=new _.wi;this.bd=this.gh=this.jf=this.J=this.dd=this.C=this.M=this.B=null;this.ke=!1;this.f=this.j=this.a=this.L=this.K=null;this.h=new _.$H;this.da=null;this.hh=1E9;this.nf=new Set;this.ga=!0;this.Ea=null;this.Cj=!1;this.Bj=0;this.ca=null;this.o=new eI;this.H=null;this.Lb=_.Hq;this.be=new kI(this.configuration.preferredAudioLanguage||[],this.configuration.preferredAudioRole,
|
|
193
|
+
this.configuration.preferredAudioChannelCount,this.configuration.preferSpatialAudio,this.configuration.mediaSource.codecSwitchingStrategy);this.Wd=this.configuration.preferredTextLanguage;this.A=new bI;this.ya=this.Zb=null;this.Wc=new Map;this.de=null;this.hf=this.configuration.preferredTextRole;this.Qd=this.configuration.preferForcedSubtitles;this.w.on(window,"online",function(){a.I===dK&&tJ(a.a)});this.rf=this.$d=this.yf=null;this.Y=_.qa;this.oe=new bK;this.$g=null};
|
|
194
|
+
fK=function(a){return new _.ZE(function(b){var c=a.getTrackManager(),d=[];if(c){c=_.w(c.getVideoTracks());for(var e=c.next();!e.done;e=c.next())d.push.apply(d,_.vh(e.value.renditions))}return d.find(function(f){return f.id===b.toString()})||null})};
|
|
195
|
+
gK=function(a,b){if(a.Lb!==b){var c=_.T.Jl;if(a.Lb===_.Sq&&b!==_.Hq)c=c(b,_.Qq),a.log.info(_.ED+c);else{var d=a.dh;d=0===d?0:Date.now()-d;var e=a.Lb;a.Lb=b;a.dh=Date.now();null!==a.J&&(a.J.A=b===_.Uq);a.H&&_.Aq(a.H.a,a.Lb);b===_.Mq&&(a.Aj=a.Ng?1:2);var f=a.Aj,g={currentState:a.Lb,previousState:e,timeSinceLastStateChangeMS:d,reason:b===_.Mq||e===_.Mq?f:void 0},h=c(e,_.Qq),l=c(b,_.Qq);c=b!==_.Mq?"":"["+c(f,_.Pq)+"]";a.log.info(_.Nb+h+" -\x3e "+(l+c));a.trigger(new _.L(_.rg,{detail:g}));(b===_.Oq||b===
|
|
196
|
+
_.Sq)&&a.bd&&a.bd.stop();b===_.Mq?a.trigger(new _.L(_.qd,{detail:{bufferedTimeMS:-1,reason:f}})):e===_.Mq&&a.trigger(new _.L(_.od,{detail:{bufferedTimeMS:d,reason:f}}))}}};hK=function(a){var b;return _.I(function(c){switch(c.a){case 1:b=a.A.a;if(!b){c.F(2);break}return _.y(c,b["catch"](function(){}),2);case 2:return _.y(c,_.Lm.prototype.release.call(a),4);case 4:return _.y(c,a.unload(),5);case 5:gK(a,_.Hq),_.C(c)}})};
|
|
197
|
+
iK=function(a){var b=new _.dv;(a=a.playlist)&&a.cropTimeline&&(a.startTime||a.endTime)&&(b.h={start:a.startTime||null,end:a.endTime||null});return b};lK=function(a,b){var c,d;return _.I(function(e){a.Y===_.qa?jK(a,b.cues):a.Y===_.Ib?(a.f=XG(a.f,TG(b)),c=a.configuration.playlist.endTime,d=a.f.presentationTimeline.a.a,c&&d>c&&(a.log.info("Reached end of playlist. Turning timeline static."),a.j.requestStop(),a.j=null,_.tF(a.f.presentationTimeline,!0),a.trigger(new _.L(_.Re))),kK(a,a.f)):pJ(a.a,b);_.C(e)})};
|
|
198
|
+
HK=function(a){return _.I(function(b){a.j.requestStop();a.j=null;a.Y===_.Ib?a.trigger(new _.L(_.gg)):a.trigger(new _.L(_.Re));_.C(b)})};
|
|
199
|
+
kK=function(a,b){var c=a.getMediaPosition(),d=a.$d,e=b.periods,f=d.a;d.a=[];var g=null,h=null;e=_.w(e);for(var l=e.next();!l.done;l=e.next()){l=l.value;var m=l.endTime-l.startTime;l.configurationId===g?h.a+=m:(g=l.configurationId||"",h=new _.cv(g||"",l.startTime,m,!1),d.a.push(h))}d.h&&(h=d.h,g=h.start,h=h.end,e=d.a[0],null!=g&&e&&g>=e.f&&g<=e.f+e.a&&(l=g-e.f,l<e.a&&(e.f=g,e.a-=l)),g=d.a[d.a.length-1],null!=h&&g&&h>=g.f&&h<=g.f+g.a&&(g.a=h-g.f));DE(d,c);a:if(c=d.a,f.length!==c.length)f=!1;else{for(d=
|
|
200
|
+
0;d<f.length;d++)if(!f[d].qa(c[d])){f=!1;break a}f=!0}!f&&a.trigger(new _.L(_.hg));JF(a.rf);GF(a.L,b.cues)};NK=function(a){var b,c;return _.I(function(d){if(1==d.a)return IK(a),_.y(d,JK(a),2);if(3!=d.a){KK(a);b=_.Fk(4)||_.Fk(5);if(!b)return d.F(3);c=a.getSurface().getMedia();LK(a,c);return _.y(d,MK(a,c),3)}a.configuration=a.kb;_.C(d)})};
|
|
201
|
+
OK=function(a,b){return _.I(function(c){if(1==c.a){if(!a.configuration.contentSteering.enabled)return c.F(2);if(a.da)return c.F(3);a.da=new wG(a.configuration.contentSteering,a.getNetworkEngine());a.da.on(_.Zd,function(d){a.trigger(d)});return _.y(c,yG(a.da,b),3)}return 2!=c.a?c["return"](a.da):c["return"](null)})};
|
|
202
|
+
VK=function(a,b,c){c=void 0===c?!0:c;var d,e,f,g,h;return _.I(function(l){switch(l.a){case 1:return d=Date.now()/1E3,e=new _.xk,a.A.a=e,_.D(l,2),IK(a),_.y(l,PK(a),4);case 4:return dI(a.A,e),a.ba=_.Zq(b),a.configuration=_.Jm(a.kb,b),WE(a.configuration.xmlParser),a.$g&&a.configuration.mse.sendPlaybackSessionIdHeader&&a.getNetworkEngine().headers.set(SD,a.$g),a.log.info(_.tb,a.configuration),a.log.info(_.Mb,a.ba),_.y(l,QK(a,e),5);case 5:return dI(a.A,e),_.y(l,RK(a,b,a.getSourceIndex(),e,!1),6);case 6:return f=
|
|
203
|
+
l.f,dI(a.A,e),a.j=f.parser,a.f=f.manifest,jK(a,f.manifest.cues),g=a,_.y(l,SK(a,a.f,a.configuration),7);case 7:g.B=l.f;dI(a.A,e);if(!c){l.F(8);break}return _.y(l,TK(a,e),9);case 9:dI(a.A,e),a.w.one(a.l,_.Te,function(){var m=Date.now()/1E3-d;a.H&&(a.H.B=m)});case 8:e.resolve();_.Jh(l,0);break;case 2:h=_.H(l),UK(a,h,e),_.C(l)}})};jK=function(a,b){if(a.configuration.ads.hls.mockCuesFn){var c=a.configuration.ads.hls.mockCuesFn(a);GF(a.L,c)}else GF(a.L,b)};
|
|
204
|
+
UK=function(a,b,c){b=WK(a,b,c);c["catch"](function(){});c.reject(b);a.onError(b);throw b;};WK=function(a,b,c){var d=a.A;return null!=d.a&&d.a===c||b instanceof _.O&&7E3===b.code?b instanceof _.O?b:new _.O(_.P,7,7003,"Unexpected error.",b):cI(a.A)};PK=function(a){return a.ja?a.ja["catch"](function(){}):Promise.resolve()};
|
|
205
|
+
QK=function(a,b){var c;return _.I(function(d){if(1==d.a)return a.H=new _.Fq,gK(a,_.Tq),c=XK(a,a.configuration),_.y(d,MK(a,c),2);dI(a.A,b);a.L=new EF;FF(a.L,function(e){a.log.info("Timeline cue found",e);YK(a,_.Dg,e)},function(){a.log.info("Timeline cues changed");a.trigger(new _.L(_.Gg))});_.C(d)})};
|
|
206
|
+
RK=function(a,b,c,d,e){var f,g,h,l,m;return _.I(function(n){switch(n.a){case 1:return f=b,g=_.Zq(f),h=g[c],_.y(n,ZK(a,h),2);case 2:return l=n.f,dI(a.A,d),_.np(dE),_.y(n,$K(a,l,h,f.id||""),3);case 3:m=n.f;dI(a.A,d);if(!e||!m.presentationTimeline.l){n.F(4);break}return _.y(n,l.stop(),5);case 5:dI(a.A,d);case 4:return _.np("manifest.end"),_.pp("Fetch and parse manifest",dE,"manifest.end"),n["return"]({parser:l,manifest:m})}})};
|
|
207
|
+
aL=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a)return _.y(f,RK(a,b,0,null,!0),2);c=f.f;try{return d=[a.f,TG(c.manifest)],e=WG(d,a.f.presentationTimeline),f["return"]({parser:c.parser,manifest:e})}catch(g){throw new _.O(_.P,7,7003,"Failed to append load manifest");}})};XK=function(a,b){var c=a.getSurface().getMedia();c.loop=!!b.loop;_.N.R(b.volume)||a.setVolume(b.volume);_.N.R(b.muted)||a.setMuted(b.muted);LK(a,c);return c};
|
|
208
|
+
LK=function(a,b){a.l||(a.w.on(b,_.Ae,function(){if(a.l.error){var c=a.l.error.code;if(1===c)c=null;else{var d=a.l.error.msExtendedCode;d&&(0>d&&(d+=Math.pow(2,32)),d=d.toString(16));c=new _.O(_.P,3,3016,{code:c,extendedError:d,message:a.l.error.message})}}else c=null;if(c)a.onError(c)}),a.l=b)};KK=function(a){a.l&&(a.w.off(a.l,_.Ae),a.l=null)};
|
|
209
|
+
JK=function(a){var b;return _.I(function(c){switch(c.a){case 1:a.I!==bL&&(a.I=cK);if(b=a.l)a.w.off(b,_.Te),a.w.off(b,_.Lf),a.w.off(b,_.sf),a.w.off(b,_.ze),a.w.off(b,_.Yf),a.w.off(b,_.Wf);a.L&&(a.L.release(),a.L=null);a.dd&&(a.dd.release(),a.dd=null);a.bd&&(a.bd.stop(),a.bd=null);if(!a.j){c.F(2);break}return _.y(c,a.j.stop(),3);case 3:a.j=null;case 2:if(!a.h){c.F(4);break}return _.y(c,a.h.stop(),4);case 4:if(!a.a){c.F(6);break}return _.y(c,a.a.destroy(),7);case 7:a.a=null;case 6:if(!a.da){c.F(8);break}return _.y(c,
|
|
210
|
+
a.da.destroy(),9);case 9:a.da=null;case 8:a.C&&(a.C.release(),a.C=null);a.J&&(a.J.release(),a.J=null);if(!a.M){c.F(10);break}return _.y(c,a.M.destroy(),11);case 11:a.M=null;case 10:a.ed&&(a.ed.release(),a.ed=null);a.jf&&(a.jf.release(),a.jf=null);b&&b.src&&(b.removeAttribute("src"),b.load());if(!a.B){c.F(12);break}return _.y(c,a.B.destroy(),13);case 13:a.B=null;case 12:a.o.clear(),a.K=null,a.nf.clear(),a.f=null,a.H=null,a.ga=!0,a.Wc.clear(),a.ke=!1,cL(a),_.C(c)}})};
|
|
211
|
+
MK=function(a,b){var c,d,e,f,g;return _.I(function(h){if(1==h.a)return c=window.muxjs?new vH:new _.wH,d=_.yq(a.configuration,[_.He,"single-native"]),e=d.create(a),a.U=e,f=fK(a),f.track(a),a.ed=f,g=null,dL(a)?g=new vI(b,c,e,f,a.configuration):g=new _.yH(b,c,e,f,a.configuration),_.y(h,g.open(),2);a.M=g;_.C(h)})};
|
|
212
|
+
ZK=function(a,b){var c,d;return _.I(function(e){if(1==e.a)return c=a.getNetworkEngine(),_.y(e,_.fv(b.url,c,a.configuration.manifest.attemptParameters,b.type||null),2);d=e.f;d.configure(a.configuration.manifest);return e["return"](d)})};
|
|
213
|
+
$K=function(a,b,c,d){return(new _.yk(Promise.resolve().then(function(){var e,f,g;return _.I(function(h){switch(h.a){case 1:e=null;case 2:if(e){h.F(3);break}_.D(h,4);var l=c.url;var m=eL(a,d);l=b.start(l,m);return _.y(h,l,6);case 6:e=h.f;_.Jh(h,2);break;case 4:f=_.H(h);if(!a.cd)throw f;return _.y(h,a.cd(c.url,f),8);case 8:if(g=h.f)c.url=g;else throw f;h.F(2);break;case 3:if(0===e.periods.length)throw new _.O(_.P,4,4014);fL(e.periods);return h["return"](e)}})}),function(){a.log.info("Aborting parser step...");
|
|
210
214
|
return b.stop()})).T};
|
|
211
|
-
|
|
212
|
-
if(z.length){z=a.getPeriods();for(var
|
|
213
|
-
(
|
|
214
|
-
e=b.periods.every(function(q){return q.variants.some(function(
|
|
215
|
+
SK=function(a,b,c){var d,e,f,g,h,l,m,n;return _.I(function(p){switch(p.a){case 1:_.np("initDrm.start");d=new _.up({Eb:a.getNetworkEngine(),onError:function(q){return a.onError(q)},Ag:function(q){if(a.a){var t=rH(a),v=!1,z=Object.keys(q);0===z.length&&a.log.warn("Got a key status event without any key statuses, so we don't know the real key statuses. If we don't have all the keys, you'll need to set restrictions so we don't select those tracks.");var A=1===z.length&&"00"===z[0];A&&a.log.warn("Got a synthetic key status event, so we don't know the real key statuses. If we don't have all the keys, you'll need to set restrictions so we don't select those tracks.");
|
|
216
|
+
if(z.length){z=a.getPeriods();for(var E=0;E<z.length;E++)for(var G=z[E],B=_.w(G.variants),F=B.next();!F.done;F=B.next()){F=F.value;var M=[];F.audio&&M.push(F.audio);F.video&&M.push(F.video);M=_.w(M);for(var R=M.next();!R.done;R=M.next()){R=R.value;var la=F.allowedByKeySystem;if(R.keyId){var U=q[A?"00":R.keyId];U=!!U&&!gL.includes(U);F.allowedByKeySystem=U}la!==F.allowedByKeySystem&&(U=R.type,R.type===_.r&&(U="video "+R.width+"x"+R.height+"@"+_.T.Vf(R.bandwidth)),a.log.warn("DRM Key not available for KID: '"+
|
|
217
|
+
(R.keyId+"'. Applying restrictions to "+U)));G===t&&la!==F.allowedByKeySystem&&(v=!0)}}}if(q=WI(a.a)){A=YI(a.a);z=ZI(a.a);a:{E=q.variants;for(G=0;G<E.length;G++)if(E[G].audio===A&&E[G].video===z){A=E[G];break a}A=null}if(!A||A.allowedByKeySystem)a.log.info(jD),hL(a),iL(a,q.variants)}v&&q!==t&&(a.log.info(jD),hL(a),iL(a,t.variants))}},zg:function(q,t){a.trigger(new _.L(_.me,{expirationTime:t}))},onEvent:function(q){return a.bg(q)},getConfiguration:function(){return a.getConfiguration()},vd:function(){return a.vd()}});
|
|
218
|
+
e=b.periods.every(function(q){return q.variants.some(function(t){return t.drmInfos.some(function(v){return v.licenseServerUriOrigin===_.ZD})})});c.drmResolver&&(c.drm=c.drmResolver({hasLaurl:e}));f=c.drm;g=_.mn(f);d.f=g;h=f?f.offlineId||"":"";l=[];m=_.Wu(b.periods);if(!h){p.F(2);break}n=_.Nm(_.tf);if(!n){p.F(2);break}return _.y(p,n.l(a,m),4);case 4:return _.y(p,n.j(h),5);case 5:l=p.f;case 2:return _.y(p,_.zp(d,m,l),6);case 6:return a.B=d,jL(a,b.periods),_.np("initDrm.end"),_.pp("Init DRM","initDrm.start",
|
|
215
219
|
"initDrm.end"),p["return"](d)}})};
|
|
216
|
-
|
|
217
|
-
b),a.h.configure(a.configuration.abr),a.
|
|
218
|
-
a.configuration.streaming.rebufferingGoal),
|
|
219
|
-
for(l=h.next();!l.done;l=h.next())m=l.value,
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
d,"buffered to end",b,"state",a.getState()),
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
b.id),Error("Unable to switch to restricted track.");a.
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
_.
|
|
263
|
-
{
|
|
264
|
-
_.
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
_.
|
|
268
|
-
|
|
269
|
-
_.
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
_.
|
|
283
|
-
|
|
284
|
-
_.
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
_.
|
|
288
|
-
|
|
289
|
-
_.
|
|
290
|
-
_.
|
|
291
|
-
_.
|
|
292
|
-
_.
|
|
293
|
-
|
|
294
|
-
_.
|
|
295
|
-
_.
|
|
296
|
-
|
|
297
|
-
_.
|
|
298
|
-
|
|
299
|
-
_.
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
_.
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
_.
|
|
310
|
-
_.
|
|
311
|
-
_.
|
|
312
|
-
_.
|
|
313
|
-
_.
|
|
314
|
-
|
|
315
|
-
_.
|
|
316
|
-
|
|
317
|
-
_.
|
|
318
|
-
_.
|
|
319
|
-
_.
|
|
320
|
-
|
|
321
|
-
_.
|
|
322
|
-
_.
|
|
323
|
-
_.
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
_.
|
|
327
|
-
_.
|
|
328
|
-
_.
|
|
329
|
-
_.
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
_.
|
|
333
|
-
_.
|
|
334
|
-
_.
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
_.
|
|
338
|
-
_.
|
|
339
|
-
_.
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
_.
|
|
346
|
-
_.
|
|
347
|
-
|
|
220
|
+
TK=function(a,b){var c,d,e,f,g,h,l,m,n,p;return _.I(function(q){if(1==q.a)return c=a.l,kL(a,c),lL(a,a.f.periods),a.be=new kI(a.configuration.preferredAudioLanguage||[],a.configuration.preferredAudioRole,a.configuration.preferredAudioChannelCount,a.configuration.preferSpatialAudio,a.configuration.mediaSource.codecSwitchingStrategy),a.Wd=a.configuration.preferredTextLanguage,a.hf=a.configuration.preferredTextRole,a.Qd=a.configuration.preferForcedSubtitles,_.y(q,_.Rp(a.B,c),2);if(3!=q.a)return dI(a.A,
|
|
221
|
+
b),a.h.configure(a.configuration.abr),a.Ig&&a.h.setCmsdManager(a.Ig),a.h.init(function(t,v,z){var A,E,G;return _.I(function(B){if(1==B.a){if(a.ga)return B["return"]();A=mL(a).find(function(F){return F.id===t.id})||null;if(!A)return a.log.warn("No matching variant found for track switch"),B.F(0);E=rH(a);return _.y(B,a.j.loadVariant(A,E.id),3)}G=B.f;nL(a,G,v,z);_.C(B)})}),a.C=oL(a,c,a.configuration.startTime),a.dd=pL(a),a.J=new KI({oi:function(){return c.playbackRate},yo:function(t){c.playbackRate=
|
|
222
|
+
t},Sm:function(t){c.currentTime+=t}}),LI(a.J,a.configuration.trickPlay),a.isLive()&&a.configuration.streaming.enableLiveEdgeChasing&&(a.jf=new tI(a)),d=Math.max(1E-4,a.configuration.streaming.rebufferingGoal),qL(a,d),dL(a)?PH(a.f,_.Vi(a.configuration.preferredVideoCodec),_.Vi(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount):OH(a.f,_.Vi(a.configuration.preferredVideoCodec),_.Vi(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount),e=rL(a),
|
|
223
|
+
e.h=a.configuration.streaming,a.a=e,a.I=dK,_.y(q,e.start(),3);dI(a.A,b);a.configuration.streaming.startAtSegmentBoundary&&(f=iG(a.C),g=sL(a,f),bG(a.C.f,g));h=_.w(a.f.periods);for(l=h.next();!l.done;l=h.next())m=l.value,tL(a,m);hL(a);n=mL(a);p=n.some(function(t){return t.primary});a.configuration.preferredAudioLanguage||p||a.log.warn("No preferred audio language set. We will choose an arbitrary language initially");iL(a,n);_.C(q)})};
|
|
224
|
+
kL=function(a,b){function c(d){a.l&&a.K&&(d.type===_.jg&&a.re?(a.K.a=qI,cL(a)):d.type===_.fh&&a.getState()===_.Vq&&.1>a.getBufferInfo().Ga(a.getMediaPosition())?(a.K.a=qI,cL(a)):a.K&&uL(a));vL(a)}a.w.on(b,_.Lf,c);a.w.on(b,_.sf,c);a.w.on(b,_.ze,c);a.w.on(b,_.jg,c);a.w.on(b,_.ig,c);a.w.on(b,_.Wf,c);a.w.on(b,_.fh,c);a.w.on(b,_.Yf,function(){if(a.l){var d=a.l.playbackRate;0!==d&&a.J.set(d)}})};
|
|
225
|
+
fL=function(a){function b(d){return d.video&&d.audio||d.video&&d.video.codecs.includes(",")}if(a.some(function(d){return d.variants.some(b)})){_.ci("Found variant with audio and video content, so filtering out audio-only content in all periods.");a=_.w(a);for(var c=a.next();!c.done;c=a.next())c=c.value,c.variants=c.variants.filter(b)}};oL=function(a,b,c){return new gG(b,a.f,a.configuration.streaming,c,function(d){a.dd&&kG(a.dd,!0,d);a.a&&qJ(a.a)},function(d){return a.dispatchEvent(d)},a.Y===_.Ib)};
|
|
226
|
+
pL=function(a){var b=new lG(a.l),c=new II(a.f);JI(c,function(){hL(a)});b.a.add(c);a.L&&(c=new nG(a.L),oG(c,function(d){d.uf&&d.uf();YK(a,_.Eg,d)},function(d){d.yg&&d.yg();YK(a,_.Fg,d)},function(d,e){e||(d.uf&&d.uf(),YK(a,_.Eg,d),d.yg&&d.yg(),YK(a,_.Fg,d))}),b.a.add(c));a.Y===_.Ib&&(c=new IF(a.$d,a.oe,function(d){return a.trigger(d)},a.configuration.playlist),b.a.add(c),a.rf=c);return b};qL=function(a,b){a.K=new rI(b,Math.min(.5,b/2));a.K.a=qI;cL(a);a.bd=(new _.mi(function(){uL(a)})).Kb(.25)};
|
|
227
|
+
uL=function(a){switch(a.I){case dK:a:if(a.l.ended||a.M.We())var b=!0;else{if(a.isLive()){b=zF(a.f.presentationTimeline);var c=a.getBufferInfo();if(null!==c&&(c=c.la(),null!==c&&c>=b)){b=!0;break a}}b=!1}break;default:b=!1}if(a.M){var d=a.M.lg();c=d.video;d=d.audio;var e=a.l.currentTime;c&&d?(c=c.Ga(e),d=d.Ga(e),c=Math.min(c,d)):c=c?c.Ga(e):d?d.Ga(e):0}else c=0;if(d=a.K){d=a.K;var f=b,g=d.f.get(d.a);e=d.a;c=f||c>=g?pI:qI;d.a=c;d=e!==c}c=d;d=wL(a);c||a.getState()===_.Mq&&!d?(a.log.debug("Buffering state changed. Is buffering",
|
|
228
|
+
d,"buffered to end",b,"state",a.getState()),cL(a)):a.ke&&vL(a)};rL=function(a){var b={configuration:{Hm:a.Y===_.Ib},Qb:function(){return iG(a.C)},X:a.M,Eb:a.getNetworkEngine(),pd:a.da,xg:a.Uk.bind(a),wg:a.Tk.bind(a),onError:a.onError.bind(a),Ti:a.qn.bind(a),onEvent:a.bg.bind(a),Yi:a.Po.bind(a),wf:a.Dn.bind(a),ee:function(){return a.h},Wf:a.Yj.bind(a),wj:a.Fo.bind(a),Zd:a.B};return new _.UI(a.f,b)};
|
|
229
|
+
gH=function(a){if(!a.f||!a.C)return[];var b=xL(a),c=yL(a),d=[];a=_.w(zL(a));for(var e=a.next();!e.done;e=a.next()){e=e.value;var f=VH(e);f.activeVideo=e.video===b;f.activeAudio=e.audio===c;d.push(f)}return d};kH=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a){c=AL;if(!a.f||!a.a)return f.F(0);d=rH(a);return _.y(f,a.j.loadTextStream(b.id,d.id),3)}if(4!=f.a)return e=f.f,_.y(f,dJ(a.a,e),4);BL(a,d,e,!1);a.ga?a.ca=e:_.iJ(a.a,e,!0,0);a.Wd=e.language;a.Qd=e.kind===c.Gj;_.C(f)})};
|
|
230
|
+
hH=function(a,b,c){c=void 0===c?!1:c;var d=void 0===d?0:d;var e,f,g,h,l,m,n;_.I(function(p){if(1==p.a){if(!a.f||!a.a)throw Error("Player not ready to select tracks.");e=rH(a);if(!e)throw Error(DD);if(!b)return a.ya=null,null!=a.de&&(a.be=a.de,a.de=null),a.configuration.abr.enabled||(a.log.info("Enable ABR Selection"),a.configuration.abr.enabled=!0,a.h.enable()),f=iL(a,e.variants),g=f.variant,null==g||a.ga||nL(a,g),p["return"]();a.configuration.abr.enabled&&(a.log.info("Disable ABR and enable manual track selection to select "+
|
|
231
|
+
(b.width+"x"+b.height+"@"+b.bandwidth)),a.configuration.abr.enabled=!1,a.h.disable());h=mL(a);l=h.find(function(q){return q.id===b.id})||null;if(!l)throw a.log.error("No variant with id",b.id),Error("Variant not found.");if(!XH(l))throw a.log.error("Unable to switch to restricted track",b.id),Error("Unable to switch to restricted track.");a.ya=l.video.id;return _.y(p,a.j.loadVariant(l,e.id),2)}m=p.f;(n=!!sH(a.o,e).fb)?m.video&&(CL(a,e,m.video,!1),_.iJ(a.a,m.video,c,d)):(DL(a,e,m,!1),EL(a,m,c,d));
|
|
232
|
+
null==a.de&&(a.de=a.be);a.be=new lI(l);iL(a,e.variants);_.C(p)})};
|
|
233
|
+
GL=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,v,z;_.I(function(A){if(1==A.a){if(a.configuration.streaming.disableAudioTracks)throw Error("Audio tracks are disabled by config.");if(!a.a||!a.f||!a.C)throw Error("Not ready to select audio track.");if(c=(a.f.muxedAudioTracks||[]).find(function(E){return E.id===b}))return FL(a,c),A["return"]();d=ZI(a.a);e=YI(a.a);f=rH(a);if(!f)throw Error(DD);g=mL(a).filter(function(E){return E.audio.id===b&&XH(E)});h=!1;l=void 0;if(d){if(l=g.find(function(E){return E.video.id===
|
|
234
|
+
d.id}),!l&&(a.log.debug("Cannot find exact variant, looking for anything else that matches with given audioId"),h=!0,m=a.getTrackManager().Na()))n=m.renditions.map(function(E){return E.id}),l=g.find(function(E){return n.find(function(G){return G===String(E.video.id)})})}else l=g[0];if(!l)throw Error("Variant with target audio track not found.");q=(p=!!sH(a.o,f).fb)?!0:e.codecs.split(".")[0]===l.audio.codecs.split(".")[0];if(!q)throw a.log.warn("Cannot select audio track, codecs are not compatible with active track."),
|
|
235
|
+
Error("Audio codecs not compatible with active audio.");return _.y(A,a.j.loadVariant(l,f.id),2)}t=A.f;v=t.audio;a.Zb=v.id;z=g.map(YG);a.h.setTracks(z);DL(a,f,t,!1);h||a.ga?EL(a,t,!0,0):nJ(a.a,v);_.C(A)})};
|
|
236
|
+
FL=function(a,b){var c=rH(a);if(!c)throw Error(DD);var d=c.variants.filter(function(g){return g.video&&g.video.muxedAudioId===b.groupId&&XH(g)});if(0===d.length)throw Error("No variants containing muxed audio found.");var e=d[0],f=ZI(a.a);f&&(e=d.find(function(g){return g.video.id===f.id})||null);e&&e.video&&(a.Zb=b.id,a.log.info("Select muxed audio track "+b.id),HL(a,c,b,!1),lJ(a.a))};nH=function(a){var b=a.Wg;return a.f?a.M.getTextDisplayer().isTextVisible():b};
|
|
237
|
+
jH=function(a,b){var c,d,e,f;return _.I(function(g){c=a.Wg;d=b;if(c===d)return g["return"]();a.Wg=d;if(a.I!==dK)return g.F(0);a.M.getTextDisplayer().setTextVisibility(b);if(a.configuration.streaming.alwaysStreamText)return g.F(0);if(!b)return gJ(a.a),g.F(0);e=rH(a);f=_.ZH(e.textStreams,a.Wd,a.hf,a.Qd);return 0<f.length?_.y(g,dJ(a.a,f[0]),0):g.F(0)})};DL=function(a,b,c,d){a.j&&a.j.setCurrentVariant(c);c.video&&CL(a,b,c.video,d);c.audio&&IL(a,b,c.audio,d)};
|
|
238
|
+
IL=function(a,b,c,d){var e=a.getTrackManager();if(e){var f=a.H.f;a=sH(a.o,b);a.audio=c;a.fb=null;uH(e,c.id,_.V,d);c=e.Va();AE(f,c,d)}};CL=function(a,b,c,d){var e=a.getTrackManager();if(e){var f=a.H.f;sH(a.o,b).video=c;uH(e,c.id,_.Tk,d);a=e.na();f.j!==a&&(f.j=a,f.a.push({timestamp:Date.now()/1E3,id:a.id,trackId:a.track.id,type:a.track.type,fromAdaptation:d,width:a.width,height:a.height,bandwidth:a.bandwidth}))}};
|
|
239
|
+
HL=function(a,b,c,d){b=sH(a.o,b);b.audio=null;b.fb=c;if(b=a.getTrackManager())a=a.H.f,uH(b,c.id,_.V,d),c=b.Va(),AE(a,c,d)};BL=function(a,b,c,d){sH(a.o,b).text=c;if(b=a.getTrackManager())uH(b,c.id,_.Sk,d),c=b.Za(),a=a.H.f,a.h!==c&&(a.h=c,a.a.push({timestamp:Date.now()/1E3,id:c.id,trackId:c.track.id,type:c.track.type,fromAdaptation:d,width:null,height:null,bandwidth:null}))};JL=function(a){return a.Y===_.Ib&&"flat"===a.configuration.playlist.timeline};
|
|
240
|
+
lL=function(a,b){for(var c=0;c<b.length;c++){for(var d=b[c],e=new Map,f=_.w(mL(a)),g=f.next();!g.done;g=f.next())if(g=g.value,g.video&&g.video.closedCaptions){g=g.video;for(var h=_.w(g.closedCaptions.keys()),l=h.next();!l.done;l=h.next())if(l=l.value,!e.has(l)){var m={id:a.hh++,originalId:l,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return null},getSegmentReference:function(){return null},initSegmentReference:null,Ja:0,mimeType:_.Wc,codecs:"",kind:_.td,encrypted:!1,
|
|
241
|
+
keyId:null,language:g.closedCaptions.get(l),label:null,type:_.Q,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:g.roles,channelsCount:null,spatialAudio:!1,closedCaptions:null};e.set(l,m)}}e=_.w(e.values());for(f=e.next();!f.done;f=e.next())d.textStreams.push(f.value)}};
|
|
242
|
+
jL=function(a,b){for(var c=a.a?YI(a.a):null,d=a.a?ZI(a.a):null,e=!dL(a),f=_.w(b),g=f.next();!g.done;g=f.next())UH(a.B,c,d,g.value,e);c=ME(b,function(h){return h.variants.some(XH)});if(a.configuration.streaming.disableAudioTracks)for(d=_.w(b),e=d.next();!e.done;e=d.next())for(f=_.w(e.value.variants),e=f.next();!e.done;e=f.next())delete e.value.audio;if(a.configuration.streaming.disableVideoTracks)for(d=_.w(b),e=d.next();!e.done;e=d.next())for(f=_.w(e.value.variants),e=f.next();!e.done;e=f.next())e=
|
|
243
|
+
e.value,(g=e.video)&&!NE(g.type,_.Cl(g.mimeType,g.codecs))&&delete e.video;if(0===c)throw new _.O(_.P,4,4032);if(c<b.length)throw new _.O(_.P,4,4011);c=_.w(b);for(e=c.next();!e.done;e=c.next())d=e.value,RH(d.variants,a.configuration.restrictions)&&a.a&&rH(a)===d&&hL(a),KL(a,d.variants)};
|
|
244
|
+
tL=function(a,b){var c=a.a?YI(a.a):null,d=a.a?ZI(a.a):null,e=!dL(a);UH(a.B,c,d,b,e);d=b.variants;if(a.configuration.streaming.disableAudioTracks)for(c=_.w(d),e=c.next();!e.done;e=c.next())delete e.value.audio;if(!d.some(XH))throw new _.O(_.P,4,4011);KL(a,b.variants);RH(d,a.configuration.restrictions)&&a.a&&rH(a)===b&&hL(a);if(!_.Fk(2)&&(c=a.B?a.B.getDrmInfo():null))for(d=_.w(d),e=d.next();!e.done;e=d.next()){e=_.w(e.value.drmInfos);for(var f=e.next();!f.done;f=e.next())if(f=f.value,f.keySystem===
|
|
245
|
+
c.keySystem){f=_.w(f.initData||[]);for(var g=f.next();!g.done;g=f.next())g=g.value,_.Up(a.B,g.keyId,g.initData)||_.Kp(a.B,g.initDataType,g.initData,g.keyId)}}};EL=function(a,b,c,d){c=void 0===c?!1:c;d=void 0===d?0:d;a.ga?(a.Ea=b,a.Cj=c,a.Bj=d):jJ(a.a,b,c,d)};LL=function(a){if(a.a&&a.f){var b=WI(a.a),c=rH(a);null!=b&&b===c&&(YI(a.a),ZI(a.a),_.XI(a.a,_.Q),sH(a.o,c),sH(a.o,c),sH(a.o,c),sH(a.o,c))}};
|
|
246
|
+
sL=function(a,b){function c(g,h){if(!g)return null;var l=g.findSegmentPosition(h-f.startTime);return null==l?null:(l=g.getSegmentReference(l))?l.startTime+f.startTime:null}var d=YI(a.a),e=ZI(a.a),f=rH(a);d=c(d,b);e=c(e,b);return null!=e&&null!=d?Math.max(e,d):null!=e?e:null!=d?d:b};wL=function(a){return a.B&&a.B.G?!0:a.K?a.K.getState()===qI:!1};
|
|
247
|
+
cL=function(a){if(a.H&&a.K&&a.C){var b=ML(a)===_.Mq,c=a.J;c.l=b;OI(c,c.o?"seek":void 0);a.C.j.o=b;vL(a);a.rf&&(c=1>Math.abs(a.getMediaDuration()-a.getMediaPosition()),a=a.rf,b&&c&&(b=a.a,b.a[b.a.length-1]&&a.f(new _.L(_.eg))))}};vL=function(a){gK(a,ML(a))};ML=function(a){if(a.re)var b=!1;else if(a.l&&a.l.ended)b=!0;else{b=a.getMediaDuration();var c=a.getMediaPosition();b=a.ke&&0<=c&&b<=c?!0:!1}return b?_.Oq:wL(a)||a.re?_.Mq:a.l&&a.l.paused?_.Uq:_.Vq};
|
|
248
|
+
iL=function(a,b){var c=NL(a,b);if(!c)return{variant:null,fb:null};var d=OL(a,c);return{variant:c,fb:d}};OL=function(a,b){if(!b||!b.video)return null;var c=(a.f.muxedAudioTracks||[]).find(function(d){return d.groupId===b.video.muxedAudioId});return c&&c.primary?c:null};
|
|
249
|
+
NL=function(a,b){try{KL(a,b)}catch(f){return a.onError(f),null}var c=b.filter(function(f){return XH(f)}),d=PG(c,a.Zb);c=a.be.create(d);c=Array.from(c.values());var e=c.map(YG);a.h.setTracks(e);if(null!==a.ya&&null!==a.Zb&&(e=c.find(function(f){return f.video.id===a.ya&&f.audio.id===a.Zb}),a.ya=null,e))return e;if(a.configuration.abr.enabled||null===a.ya)return d=a.h.chooseTrack(),ZG(d,c);d=d.find(function(f){return null!==f.video&&f.video.id===a.ya});return d?d:(a.log.warn("Selected video track not found. Falling back to ABR selection"),
|
|
250
|
+
d=a.h.chooseTrack(),ZG(d,c))};PL=function(a,b){return _.ZH(b,a.Wd,a.hf,a.Qd)[0]||null};QL=function(a,b,c){c=void 0===c?!0:c;var d,e,f,g;_.I(function(h){if(1==h.a)return d=iL(a,b.variants),e=d.variant,a.Zb=e&&e.audio&&e.audio.id,e?_.y(h,a.j.loadVariant(e,b.id),3):h.F(2);2!=h.a&&(f=h.f,DL(a,b,f,!0),EL(a,f,c));(g=PL(a,b.textStreams))&&(a.configuration.streaming.alwaysStreamText||nH(a))&&(BL(a,b,g,!0),a.ga?a.ca=g:_.iJ(a.a,g,!0,0));_.C(h)})};
|
|
251
|
+
TL=function(a,b){a.ga=!0;a.h.disable();a.log.debug("Choosing new streams after period changed");var c=iL(a,b.variants),d=c.variant,e=c.fb,f=PL(a,b.textStreams);a.Ea&&(b.variants.includes(a.Ea)&&(d=a.Ea),a.Ea=null);a.ca&&(b.textStreams.includes(a.ca)&&(f=a.ca),a.ca=null);var g=d?d.video:null,h=d&&!e?d.audio:null;d&&a.j&&a.j.setCurrentVariant(d);g&&RL(a,b,function(){return CL(a,b,g,!0)});h&&RL(a,b,function(){return IL(a,b,h,!0)});e&&RL(a,b,function(){return HL(a,b,e,!0)});f&&(a.configuration.streaming.alwaysStreamText||
|
|
252
|
+
nH(a))&&RL(a,b,function(){return BL(a,b,f,!0)});b===rH(a)&&SL(a);c=a.configuration.streaming.alwaysStreamText||nH(a)?f:null;return{video:g,audio:h,text:c,fb:e}};nL=function(a,b,c,d){c=void 0===c?!1:c;d=void 0===d?0:d;if(a.configuration.abr.enabled&&a.a){var e=UL(a,b);if(sH(a.o,e).fb){var f=b.video;if(f){RL(a,e,function(){return CL(a,e,f,!0)});e===rH(a)&&SL(a);_.iJ(a.a,f,c,d);return}}RL(a,e,function(){DL(a,e,b,!0)});e===rH(a)&&SL(a);jJ(a.a,b,c,d)}};
|
|
253
|
+
hL=function(a){var b=a.getTrackManager();b&&a.I!==bL&&(b.m&&(qH(b),b.m.trigger(new _.L(_.Ig))),SL(a))};SL=function(a){var b=rH(a);if(b){var c=a.Wc.get(b)||[];for(a.Wc["delete"](b);c.length;)c.shift()()}};RL=function(a,b,c){a.Wc.has(b)||a.Wc.set(b,[]);a.Wc.get(b).push(c)};YK=function(a,b,c){a.trigger(new _.L(b,{detail:DF(c,JL(a))}))};
|
|
254
|
+
KL=function(a,b){var c=a.B?_.N.lh(a.B.ja):{},d=Object.keys(c);d=d.length&&"00"===d[0];for(var e=!1,f=!1,g=[],h=[],l=_.w(b),m=l.next();!m.done;m=l.next()){m=m.value;var n=[];m.audio&&n.push(m.audio);m.video&&n.push(m.video);n=_.w(n);for(var p=n.next();!p.done;p=n.next())if(p=p.value,p.keyId){var q=c[d?"00":p.keyId];q?gL.includes(q)&&(h.includes(q)||h.push(q)):g.includes(p.keyId)||g.push(p.keyId)}m.allowedByApplication?m.allowedByKeySystem&&(e=!0):f=!0}if(!e)throw new _.O(_.P,4,4012,{hasAppRestrictions:f,
|
|
255
|
+
missingKeys:g,restrictedKeyStatuses:h});};zL=function(a){if(null==rH(a))return[];LL(a);return mL(a).filter(function(b){return XH(b)})};VL=function(a){var b=rH(a);if(null==b)return[];LL(a);return a.f.alternativeTextStreams?a.f.alternativeTextStreams:b.textStreams.filter(function(c){return!a.nf.has(c)})};rH=function(a){var b=iG(a.C),c=null;a=_.w(a.f.periods);for(var d=a.next();!d.done;d=a.next())d=d.value,d.startTime<=b&&(c=d);return c};yL=function(a){var b=rH(a);return b?sH(a.o,b).audio:null};
|
|
256
|
+
xL=function(a){var b=rH(a);return b?sH(a.o,b).video:null};UL=function(a,b){for(var c=_.w(a.f.periods),d=c.next();!d.done;d=c.next())if(d=d.value,d.variants.some(function(e){return e.id===b.id}))return d;return null};IK=function(a){if(a.I===bL)throw new _.O(_.P,7,7E3,"Player is destroyed.");};
|
|
257
|
+
WL=function(a,b,c,d){var e,f,g,h,l,m,n,p,q,t,v,z,A,E,G,B,F,M,R,la;return _.I(function(U){switch(U.a){case 1:return e=_.er,_.D(U,2),_.y(U,_.fv(b.url,a.getNetworkEngine(),a.configuration.manifest.attemptParameters,b.type||null),4);case 4:f=U.f;f.configure(a.configuration.manifest);var ra=f;var Ba=b.url,Ca=eL(a,a.configuration.id||"");ra=ra.start(Ba,Ca);return _.y(U,ra,5);case 5:g=U.f;fL(g.periods);if(!g.periods.length)throw new _.O(_.P,4,4014);return _.y(U,a.j.stop(),6);case 6:a.j=f;h=d&&d.id;l=c&&
|
|
258
|
+
c.id;a.f.periods=g.periods;m=fF(g.periods,iG(a.C))||g.periods[0];dL(a)?PH(a.f,_.Vi(a.configuration.preferredVideoCodec),_.Vi(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount):OH(a.f,_.Vi(a.configuration.preferredVideoCodec),_.Vi(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount);n=QG(h,l,m.variants);p=PL(a,m.textStreams);iL(a,m.variants);q=n&&n.video;t=n&&n.audio;v=[];z=new Set;A=_.w(m.variants);for(E=A.next();!E.done;E=A.next())G=E.value,
|
|
259
|
+
G.video&&z.add(G.video),G.audio&&z.add(G.audio);B=a.getNetworkEngine();F=_.w(_.vh(z).concat(_.vh(m.textStreams)));for(M=F.next();!M.done;M=F.next())R=M.value,v.push(R.createSegmentIndex(B));return _.y(U,Promise.all(v),7);case 7:yJ(a.a,e.AUDIO,t);yJ(a.a,e.VIDEO,q);yJ(a.a,e.TEXT,p);n&&DL(a,m,n,!1);a.log.info("Switch CDN successful.");_.Jh(U,0);break;case 2:la=_.H(U);if(!f){U.F(8);break}return _.y(U,f.stop(),8);case 8:throw la;}})};
|
|
260
|
+
eL=function(a,b){return{networkingEngine:a.getNetworkEngine(),onContentSteeringInfoFound:function(c){return OK(a,c)},configurationId:b,filterNewPeriod:function(c){return tL(a,c)},filterAllPeriods:function(c){return jL(a,c)},onEvent:function(c){return a.bg(c)},onError:function(c){return a.onError(c)},onUpdate:function(c){return lK(a,c)},onTurnedStatic:function(){return HK(a)},ee:function(){return a.h}}};
|
|
261
|
+
dL=function(a){return a.configuration.mediaSource.codecSwitchingStrategy===_.og&&(_.Fk(2)||_.Fk(3)||_.Fk(4)||_.Fk(5)||_.Fk(6)||_.Gk()&&38===_.Il().major||_.Gk()&&53===_.Il().major||_.Gk()&&68===_.Il().major?!1:!0)};mL=function(a){return a.f.alternativeVariants&&0<a.f.alternativeVariants.length?a.f.alternativeVariants:a.C?rH(a).variants:a.f.periods[0].variants};XL=function(){};
|
|
262
|
+
YL=function(){var a=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(b){for(var c=[],d=0;d<arguments.length;++d)c[d]=arguments[d];c=a.apply(this,c);c.abort=function(){};return c}};ZL=function(){var a=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(b,c){return a.call(this,b,c-.001)}};$L=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"mp2t"===b.split(/ *; */)[0].split("/")[1].toLowerCase()?!1:a(b)}};
|
|
263
|
+
aM=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"opus"!==_.QE(b)&&a(b)}};
|
|
264
|
+
bM=function(){var a=MediaSource.isTypeSupported,b=/^dv(?:h[e1]|a[v1])\./;MediaSource.isTypeSupported=function(c){var d=c.split(/ *; */),e=d.shift(),f={};d=_.w(d);for(var g=d.next();!g.done;g=d.next())g=g.value.split("\x3d"),f[g[0]]=g[1].replace(/"(.*)"/,"$1");d=f.codecs;if(!d)return a(c);var h=!1,l=!1;c=d.split(",").filter(function(n){b.test(n)&&(l=!0);/^(hev|hvc)1\.2/.test(n)&&(h=!0);return!0});l&&(h=!1);f.codecs=c.join(",");h&&(f.eotf="smpte2084");for(var m in f)e+="; "+m+'\x3d"'+f[m]+'"';return cast.__platform__.canDisplayType(e)}};
|
|
265
|
+
cM=function(a){_.ew.call(this,a);a=a.getSurface().getMedia();this.a=null;for(var b=0;b<a.textTracks.length;++b){var c=a.textTracks[b];c.mode=_.ee;c.label===FD&&(this.a=c)}this.a||(this.a=a.addTextTrack(_.mE,FD));this.a.mode=_.Ge};dM=function(a,b){var c=a.mode;a.mode=c===_.kg?_.kg:_.Ge;for(var d=a.cues,e=d.length-1;0<=e;e--){var f=d[e];f&&b(f)&&a.removeCue(f)}a.mode=c};eM=function(){};_.Nj.prototype.f=_.pE(0,function(){return this.keyInfo});var sE=[112,115,115,104,0,0,0,0],AL={jh:_.xg,Uo:_.td,Gj:_.Ce};
|
|
266
|
+
_.IE.prototype.he=function(){return this.pa?this.pa-this.Da+1:null};_.IE.prototype.f=function(){return this.keyInfo};_.SE.prototype.getAttribute=function(a){a=this.attributes[a];return null==a?null:a};_.u=_.VE.prototype;_.u.we=function(a,b){var c=UE(a).childNodes[0];return b&&c.tagName!==b?null:c};_.u.Ma=function(a,b){var c=this.Z(a,b);return 1!==c.length?null:c[0]};_.u.Z=function(a,b){return Array.from(a.childNodes).filter(function(c){return c.tagName===b})};_.u.bc=_.th(1);_.u.Hc=_.th(3);
|
|
267
|
+
_.u.sa=function(a){return a.childNodes.every(function(b){return b.tagName===_.da||"#cdata"===b.tagName})?a.childNodes.map(function(b){return b.textContent}).join(""):null};_.u.getAttributeNS=function(a,b,c){return(b=a.a.get(b))?a.attributes[b+":"+c]||null:null};_.u.W=_.th(5);_.u.af=_.th(7);_.u.Af=_.th(11);_.u.removeChild=function(a,b){a.childNodes=a.childNodes.filter(function(c){return c!==b})};_.u.mf=_.th(13);_.u.lf=_.th(15);_.u.nd=_.th(9);_.u.Bf=_.th(17);_.u.Ee=_.th(19);_.fM=0;_.u=_.ZE.prototype;
|
|
268
|
+
_.u.track=function(a){null!=this.player&&aF(this);a&&(this.player=a,this.player.on(_.cg,this.jd,this))};_.u.release=function(){aF(this);this.S=[];this.f=this.h=null};
|
|
269
|
+
_.u.append=function(a,b,c){c=void 0===c?null:c;var d=this.h&&null!==c?this.h(c):null;d||this.log.debug("Unable to resolve rendition for ID",c);c={start:a,end:b,rendition:d,width:d?d.width:0,height:d?d.height:0,bandwidth:d?d.bandwidth:0};var e=this.S.find(function(f){return f.start>=a&&f.end<=b});if(e)e.rendition=d,e.width=c.width,e.height=c.height,e.bandwidth=c.bandwidth,e.start=c.start,e.end=c.end;else{d=_.w(this.S);for(e=d.next();!e.done;e=d.next())e=e.value,a>=e.start&&a<e.end?e.end=a:b>=e.start&&
|
|
270
|
+
b<e.end&&(e.start=b);this.S.push(c);this.S.sort(YE)}dF(this);this.jd();this.player&&this.player.trigger(new _.L(_.ah))};_.u.clear=function(){this.S=[];dF(this);this.player&&(this.player.trigger(new _.L(_.ah)),this.player.trigger(new _.L(_.jd)))};
|
|
271
|
+
_.u.jd=function(){if(this.player){var a=this.player.getMediaPosition();if(0<=a){a:{for(var b=this.S.length,c=Number.MAX_SAFE_INTEGER,d=0;d<b;d++){var e=this.S[d];c=Math.min(e.start,c);if(e.start<=a&&e.end>a){a=.1>e.end-a&&d<b-1?this.S[d+1].rendition:e.rendition;break a}if(e.start>a)break}a=0<b&&c>a&&.25>c-a?this.S[0].rendition:null}if(a&&this.f!==a&&(this.f=a,this.player)){c=b=-1;if(a)b=a.width||-1,c=a.height||-1;else if(d=this.player.getSurface().getMedia())b=d.videoWidth,c=d.videoHeight;this.player.trigger(new _.L(_.md,
|
|
272
|
+
{detail:{width:b,height:c,bandwidth:a?a.bandwidth:null,rendition:a}}))}}}};oF.prototype.dc=function(){return this.h};oF.prototype.getDuration=function(){return this.f?this.a-this.h:Infinity};_.u=_.qF.prototype;_.u.Kc=function(){return this.L};_.u.getDuration=function(){return 2===this.j.version?this.a.getDuration():this.f};_.u.getPresentationStartTime=function(){return this.G};_.u.offset=function(a){null!=this.w&&(this.w+=a);null!=this.o&&(this.o+=a)};
|
|
273
|
+
_.u.isLive=function(){return 2===this.j.version?!this.a.f:Infinity===this.f&&!this.l};_.u.qe=function(){return!this.l};EF.prototype.release=function(){this.f=function(){};this.h=function(){};this.a.clear()};EF.prototype.cues=function(){return this.a};IF.prototype.release=function(){this.f=this.j=this.h=this.a=null};IF.prototype.l=function(a){DE(this.a,a);JF(this)};
|
|
274
|
+
KF.prototype.next=function(){var a=this.h.get(this.a);a&&0<a.a.length?(this.f+=1,a.eb().length&&this.f===a.a.length&&(this.a+=1,this.f=0)):(this.a+=1,this.f=0);a=LF(this);return{value:a,done:!a}};_.u=_.MF.prototype;_.u.destroy=function(){this.a=[];return Promise.resolve()};
|
|
275
|
+
_.u.ld=function(a){for(var b=this.a.length-1;0<=b;--b){var c=this.a[b];if(a>=c.startTime&&a<c.endTime)return c.position}if(this.a.length&&a<this.a[0].startTime)return this.a[0].position;this.g.warn("No Segment found for "+a+". We have "+this.a.length+" references");for(a=0;a<this.a.length;a++)b=this.a[a],this.g.debug("SegmentIndex Ref "+a+" start: "+b.startTime+" end: "+b.endTime+" pos: "+b.position);return null};
|
|
276
|
+
_.u.get=function(a){if(0===this.a.length)return null;a-=this.a[0].position;return 0>a||a>=this.a.length?null:this.a[a]};_.u.offset=function(a){this.g.info("Apply offset"+a+" to segment index");for(var b=_.w(this.a),c=b.next();!c.done;c=b.next())c=c.value,c.startTime+=a,c.endTime+=a,c.Ja-=a};
|
|
277
|
+
_.u.Md=function(a,b){var c=a-this.a[0].position;if(0<=c&&c<this.a.length)for(this.g.warn("Accounting for segment duration drift",b,"at",c),this.a[c].endTime+=b,c+=1;c<this.a.length;++c)this.a[c].startTime+=b,this.a[c].endTime+=b};_.u.getDuration=function(){return 0===this.a.length?0:this.a[this.a.length-1].endTime-this.a[0].startTime};
|
|
278
|
+
_.u.ua=function(a){for(var b=[],c=[],d=0,e=0;d<this.a.length&&e<a.length;){var f=this.a[d],g=a[e];f.startTime<g.startTime?(b.push(f),d++):(f.startTime>g.startTime?0===d?c.push(g):this.g.info("Refusing to rewrite original references on update!"):(.1<Math.abs(f.endTime-g.endTime)?(f=new _.Nj(f.position,g.startTime,g.endTime,g.eb,g.Da,g.pa,g.Ja,g.keyInfo,g.sd,g.timescale,g.horizontalTiles,g.verticalTiles,g.durationPerTile,null,null,g.ye,g.Ta),b.push(f)):b.push(f),d++),e++)}for(;d<this.a.length;)b.push(this.a[d++]);
|
|
279
|
+
if(b.length)for(d=b[b.length-1].position+1;e<a.length;)f=a[e++],f=new _.Nj(d++,f.startTime,f.endTime,f.eb,f.Da,f.pa,f.Ja,f.keyInfo,f.sd,f.timescale,f.horizontalTiles,f.verticalTiles,f.durationPerTile,null,null,f.ye,f.Ta),b.push(f);else b=a;a=b;if(c.length&&b.length){a=[];e=b[0].position;d=c.length;c=_.w(c);for(f=c.next();!f.done;f=c.next())f=f.value,a.push(new _.Nj(e-d--,f.startTime,f.endTime,f.eb,f.Da,f.pa,f.Ja,f.keyInfo,f.sd,f.timescale,f.horizontalTiles,f.verticalTiles,f.durationPerTile,null,null,
|
|
280
|
+
f.ye,f.Ta));b=_.w(b);for(f=b.next();!f.done;f=b.next())a.push(f.value)}this.a=a};_.u.replace=function(a){this.a=a};RF.prototype.release=function(){this.h=null;this.f=function(){}};VF.prototype.release=function(){this.j&&(this.j.release(),this.j=null);null!=this.w&&(this.w.stop(),this.w=null);this.f&&(this.f.release(),this.f=null);this.a=this.H=this.G=null;this.o=!1};VF.prototype.wf=function(){this.A=!0;UF(this)};WF.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};
|
|
281
|
+
$F.prototype.release=function(){this.f&&(this.f.release(),this.f=null);null!=this.h&&(this.h.release(),this.h=null);this.j=function(){};this.a=null;this.o=function(){};this.w=!1};gG.prototype.release=function(){this.f&&(this.f.release(),this.f=null);this.j&&(this.j.release(),this.j=null);this.o&&(this.o.stop(),this.o=null);this.h=this.f=this.a=this.l=null;this.A=function(){}};lG.prototype.release=function(){this.h.stop();for(var a=_.w(this.a),b=a.next();!b.done;b=a.next())b.value.release();this.a.clear()};
|
|
282
|
+
nG.prototype.release=function(){this.j=null;this.o.clear();this.a=function(){};this.f=function(){};this.h=function(){}};nG.prototype.l=function(a,b,c){if(this.j)for(var d={},e=_.w(this.j.cues()),f=e.next();!f.done;d={Of:d.Of,Je:d.Je},f=e.next()){f=f.value;d.Of=this.o.get(f)||null;d.Je=mG(f,a);this.o.set(f,d.Je);var g=this.w.find(function(h){return function(l){return l.Vc===h.Of&&l.Uc===h.Je}}(d));g&&g.Mc(f,b&&0===c)}};
|
|
283
|
+
rG.prototype.getBandwidthEstimate=function(a){return 128E3>this.a?a:Math.min(_.mF(this.f),_.mF(this.h))};_.x(wG,_.Am);wG.prototype.destroy=function(){this.B=this.h=this.A=null;this.o.clear();this.l.clear();this.j.clear();this.w.clear();null!=this.a&&(this.a.stop(),this.a=null);return this.C.destroy()};_.u=GG.prototype;_.u.destroy=function(){this.j=this.w=null;this.o.clear();return Promise.resolve()};
|
|
284
|
+
_.u.remove=function(a,b){var c=this;return Promise.resolve().then(function(){!c.j||!c.j.remove(a,b)||null==c.a||b<=c.a||a>=c.f||(a<=c.a&&b>=c.f?c.a=c.f=null:a<=c.a&&b<c.f?c.a=b:a>c.a&&b>=c.f&&(c.f=a))})};_.u.Ua=function(){return this.a};_.u.la=function(){return this.f};_.u.Tb=function(a){return null==this.a||null==this.f?!1:a>=this.a&&a<this.f};_.u.Ga=function(a){return null==this.f||this.f<a?0:this.f-Math.max(a,this.a)};_.x($G,_.ul);_.u=$G.prototype;_.u.initialize=function(a){this.m=a};_.u.release=function(){this.h=[];this.a.clear();this.f.clear()};_.u.load=function(){};_.u.destroy=function(){this.release();this.m=null};_.u.getVideoTracks=function(){return aH(this,_.Tk)};_.u.getAudioTracks=function(){return aH(this,_.V)};_.u.ma=function(){return aH(this,_.Sk)};_.u.na=function(){return this.a.get(_.Tk)||null};_.u.Va=function(){return this.a.get(_.V)||null};_.u.Za=function(){return this.a.get(_.Sk)||null};
|
|
285
|
+
_.u.Bb=function(){return this.f.get(_.Tk)||null};_.u.Nb=function(){return this.f.get(_.V)||null};_.u.Ob=function(){return this.f.get(_.Sk)||null};_.u.Na=function(){return bH(this,_.Tk)};_.u.ra=function(){return bH(this,_.V)};_.u.Ba=function(){return bH(this,_.Sk)};_.u.Jb=function(a){this.m&&cH(this,_.Tk,a)};_.u.Ka=function(a){this.m&&cH(this,_.V,a)};_.u.$a=function(a){this.m&&cH(this,_.Sk,a)};
|
|
286
|
+
_.u.ub=function(a,b){b=void 0===b?!1:b;if(this.m)if(a)iH(this,a,b);else{var c=b,d=bH(this,_.Tk);d&&(this.g.info("Unset video rendition."),d.trickPlay?this.g.info("Enabling ABR for trick play tracks is not supported"):(this.g.info("Enable ABR."),hH(this.m,null,c)))}};_.u.Hb=function(a){this.m&&(a?(fH(this,a,_.V),eH(this,a,_.V)&&(this.g.info("Set audio rendition with ID: "+a.id),this.f.set(_.V,a),GL(this.m,parseInt(a.id,10)))):this.g.info("Enabling ABR for audio is not supported"))};
|
|
287
|
+
_.u.addTextTrack=function(a){var b=this;return _.I(function(c){return b.m?_.y(c,b.m.addTextTrack(a.url,a.language,a.kind,a.mimeType,a.codec,a.label),0):c["return"]()})};_.u.wa=function(){return!!this.m&&this.m.wa()};
|
|
288
|
+
_.u.Ib=function(a){if(this.m){var b=a;if(!a){var c=this.Za();if(c&&c.track.kind!==_.Ce){a=this.ma().find(function(e){return e.kind===_.Ce&&e.language===c.track.language});if(!a){var d=this.ra();d&&(a=this.ma().find(function(e){return e.kind===_.Ce&&e.language===d.language}))}a&&(b=a.renditions[0])}}b?lH(this,b):mH(this)}};$G.prototype.setTextRendition=$G.prototype.Ib;$G.prototype.isAbrEnabled=$G.prototype.wa;$G.prototype.addTextTrack=$G.prototype.addTextTrack;$G.prototype.setAudioRendition=$G.prototype.Hb;
|
|
289
|
+
$G.prototype.setVideoRendition=$G.prototype.ub;$G.prototype.setTextTrack=$G.prototype.$a;$G.prototype.setAudioTrack=$G.prototype.Ka;$G.prototype.setVideoTrack=$G.prototype.Jb;$G.prototype.getTextTrack=$G.prototype.Ba;$G.prototype.getAudioTrack=$G.prototype.ra;$G.prototype.getVideoTrack=$G.prototype.Na;$G.prototype.getLoadingTextRendition=$G.prototype.Ob;$G.prototype.getLoadingAudioRendition=$G.prototype.Nb;$G.prototype.getLoadingVideoRendition=$G.prototype.Bb;$G.prototype.getTextRendition=$G.prototype.Za;
|
|
290
|
+
$G.prototype.getAudioRendition=$G.prototype.Va;$G.prototype.getVideoRendition=$G.prototype.na;$G.prototype.getTextTracks=$G.prototype.ma;$G.prototype.getAudioTracks=$G.prototype.getAudioTracks;$G.prototype.getVideoTracks=$G.prototype.getVideoTracks;vH.prototype.init=function(a){var b=muxjs.mp4.probe;a=_.bk(a);this.l=b.videoTrackIds(a);this.j=b.timescale(a)||{};this.a.init()};vH.prototype.h=function(a,b){var c=_.bk(a);(c=this.a.parse(c,this.l,this.j))&&c.captions&&b(c.captions);this.a.clearParsedCaptions()};vH.prototype.f=function(){this.a.resetCaptionStream()};_.wH.prototype.init=function(){};_.wH.prototype.h=function(){};_.wH.prototype.f=function(){};_.u=_.yH.prototype;
|
|
291
|
+
_.u.destroy=function(){var a=this;window.ManagedMediaSource&&(this.j.disableRemotePlayback=!1);this.I=!0;var b=[],c;for(c in this.h){var d=this.h[c],e=d[0];this.h[c]=d.slice(0,1);e&&b.push(e.p["catch"](FE));for(e=1;e<d.length;++e)d[e].p["catch"](FE),d[e].p.reject()}this.f&&b.push(this.f.destroy());this.C&&b.push(this.C.destroy());for(var f in this.w)this.w[f].destroy(),delete this.w[f];return Promise.all(b).then(function(){a.l&&(a.l.release(),a.l=null);a.j&&(a.j.removeAttribute("src"),a.j.load(),
|
|
292
|
+
a.j=null);a.A="";a.o=null;a.f=null;a.C=null;a.a={};a.w={};a.G={};a.H=null;a.K=!1;for(var g in a.h);a.h={}})};_.u.open=function(){return this.J};
|
|
293
|
+
_.u.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e;return _.I(function(f){if(1==f.a)return e=_.er,_.y(f,d.J,2);a.forEach(function(g,h){var l=_.Cl(g.mimeType,g.codecs);if(h===e.TEXT)d.uc(l);else{var m=new Map;m.set(h,l);if((!_.Cu(l)||!b||g.aesEncrypted)&&_.Bl(l,h)){var n=_.Bl(l);n&&(m=n(),d.w[h]=m,m=m.demuxMimeTypes(h,l),c&&m["delete"](e.AUDIO))}BH(d,m);d.K=m.has(e.AUDIO)&&m.has(e.VIDEO)}});_.C(f)})};_.u.qj=function(){this.g.debug(JD);Object.values(this.w).forEach(function(a){return a.reset()})};
|
|
294
|
+
_.u.Gi=function(){return this.L.streaming.ignoreManagedMediaSourceStreamingHints?!0:this.M};_.u.uc=function(a){this.f||(this.f=new GG(this.L,this.C));HG(this.f,a)};_.u.We=function(){return this.o?this.o.readyState===_.ze:!0};_.u.Ua=function(a){return a===_.Q?this.f.Ua():(a=CH(this,a))?a.Ua():null};_.u.la=function(a){return a===_.Q?this.f.la():(a=CH(this,a))?a.la():null};_.u.Tb=function(a,b,c){return a===_.Q?this.f.Tb(b):(a=CH(this,a))?a.Tb(b,!1,c):!1};
|
|
295
|
+
_.u.Ga=function(a,b){if(a===_.Q)return this.f.Ga(b);var c=CH(this,a);return c?c.Ga(b):0};_.u.lg=function(){var a={};a.total=new _.zm(this.j.buffered,"total");a.audio=CH(this,_.dd);a.video=CH(this,_.r);var b=[];this.f&&(b=[{start:this.f.Ua(),end:this.f.la()}]);a.text=RE(b,_.Q);return a};
|
|
296
|
+
_.u.Ve=function(a,b,c,d,e,f,g,h){var l=this;g=void 0===g?!1:g;h=void 0===h?!1:h;var m=this.a[a],n=-1,p=0;m&&m.buffered&&(p=m.buffered.length);a===_.r&&null!==c&&null!==d&&g&&(n=0<p?m.buffered.end(p-1):-1);a===_.Q?h=IG(this.f,b,c,d):this.w[a]?(b=this.w[a].transmux(b),b.captions&&0<b.captions.length&&(this.f||this.uc(_.Ag),KG(this.f,b.captions,c,d,this.a.video.timestampOffset)),e=[],0<b.audio.byteLength&&this.a.audio&&!h&&e.push(EH(this,_.dd,this.dg.bind(this,_.dd,b.audio.buffer))),0<b.video.byteLength&&
|
|
297
|
+
this.a.video&&e.push(EH(this,_.r,this.dg.bind(this,_.r,b.video.buffer))),h=Promise.all(e)):(e&&window.muxjs&&(this.f||this.uc(_.Ag),null==c&&null==d?this.H.init(b):this.H.h(b,function(q){q.length&&KG(l.f,q,c,d,l.a.video.timestampOffset)})),h=EH(this,a,this.dg.bind(this,a,b)));return h.then(function(){if(a===_.r&&null!==c&&null!==d&&!g)l.B.append(c,d,f),null!==c&&null!==d&&l.g.debug(fD,c,d,hD,DH(l,a));else if(a===_.dd&&null!==c&&null!==d)bF(l.B),null!==c&&null!==d&&l.g.debug(eD,c,d,hD,DH(l,a));else if(a===
|
|
298
|
+
_.r&&null!==c&&null!==d&&g){var q=m.buffered.length,t=0<q?m.buffered.end(q-1):-1;0>n&&0<q&&(n=m.buffered.start(0));0<=n&&0<t&&l.B.append(n,t,f)}if(!l.G[a]&&m&&1===m.buffered.length){q=m.buffered.start(0);var v=c-q;if(Math.abs(v)>l.P&&0===m.timestampOffset)return l.g.warn(lD+v+RC+(a+ZC)+(c+QC)+(q+YC)),q=EH(l,a,function(){l.Hh(a,v)}),t=EH(l,a,l.Eh.bind(l,a,!1)),Promise.all([q,t])}null!==c&&null!==d&&(l.G[a]=!0)})["catch"](function(q){throw q;})};
|
|
299
|
+
_.u.Gh=function(a){var b=this.la(_.r)||0;JG(this.f,a,b)};_.u.yh=function(){this.f&&JG(this.f,"",0)};_.u.remove=function(a,b,c){var d=this;return a===_.Q?this.f.remove(b,c):EH(this,a,this.Fh.bind(this,a,b,c)).then(function(){if(a===_.r){var e=d.Ua(a),f=d.la(a);null!==e&&null!==f&&eF(d.B,e,f)}else a===_.dd&&cF(d.B)})};_.u.clear=function(a){if(a===_.Q){if(!this.f)return Promise.resolve();this.H.f();return this.f.remove(0,Infinity)}return EH(this,a,this.Fh.bind(this,a,0,this.o.duration))};
|
|
300
|
+
_.u.flush=function(a){return a===_.Q?Promise.resolve():EH(this,a,this.Eh.bind(this,a))};_.u.tj=function(a,b,c,d){var e=this,f,g;return _.I(function(h){f=_.er;if(a===f.TEXT){e.f.A=b;var l=e.f;l.h=c;l.l=d;return h["return"]()}g=FH(e,a,b,c,d);e.K&&(g=g.concat(FH(e,f.AUDIO,b,c,d)));return _.y(h,Promise.all(g),0)})};_.u.endOfStream=function(a){var b=this;return IH(this,function(){b.We()||(a?b.o.endOfStream(a):b.o.endOfStream())})};_.u.eg=function(a){var b=this;IH(this,function(){b.o.duration=a})};
|
|
301
|
+
_.u.getDuration=function(){return this.o.duration};_.u.dg=function(a,b){this.g.debug(gD+a+SC);try{this.a[a].appendBuffer(b)}catch(c){throw this.g.warn(tD+a,c),c;}this.g.debug(nD+a+SC)};_.u.Fh=function(a,b,c){if(c<=b)this.md(a);else{this.g.debug(ID+a+VC,b,c);try{this.a[a].remove(b,c)}catch(d){throw this.g.warn(vD+a+TC,b,c,d),d;}this.g.debug(pD+a+VC,b,c)}};
|
|
302
|
+
_.u.Wk=function(a){try{this.g.debug(dD+a+SC);var b=this.a[a].appendWindowStart,c=this.a[a].appendWindowEnd;this.a[a].abort();this.a[a].appendWindowStart=b;this.a[a].appendWindowEnd=c}catch(d){throw this.g.warn(sD+a+SC,d),d;}this.g.debug(mD+a+SC);this.md(a)};_.u.Eh=function(a){try{this.j.readyState>HTMLMediaElement.HAVE_NOTHING?(this.g.debug(yD+a),this.j.currentTime-=.001):this.g.warn(ND+a+XC+this.j.readyState)}catch(b){throw this.g.warn(uD+a,b),b;}this.g.debug(oD+a);this.md(a)};
|
|
303
|
+
_.u.Hh=function(a,b){0>b&&(b+=.001);try{this.g.debug(MD+a,b),this.a[a].timestampOffset=b}catch(c){throw this.g.warn(xD+a,b,c),c;}this.g.debug(rD+a,b);this.md(a)};_.u.Yk=function(a,b,c){try{this.g.debug(KD+a,b,c),this.a[a].appendWindowStart=0,this.a[a].appendWindowEnd=c,this.a[a].appendWindowStart=b}catch(d){throw this.g.warn(wD+a,b,c,d),d;}this.g.debug(qD+a,b,c);this.md(a)};_.u.Xk=function(a){this.h[a][0].p.reject(new _.O(_.P,3,3014,{mediaError:this.j.error?this.j.error.code:0}))};
|
|
304
|
+
_.u.md=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug(QD+a),HH(this,a))};_.u.getTextDisplayer=function(){return this.C};var AH=window.URL.createObjectURL;_.u=_.$H.prototype;_.u.stop=function(){this.A=null;this.l=!1;this.f=[];this.o=1;this.h=null;this.C=!1};_.u.init=function(a){this.A=a};
|
|
305
|
+
_.u.chooseTrack=function(){var a=aI(this,!this.C&&this.a.initialRestrictions?this.a.initialRestrictions:this.a.restrictions,this.f),b=this.getBandwidthEstimate();this.f.length&&!a.length&&(this.g.warn("No tracks met the ABR restrictions. Choosing a track by lowest bandwidth."),a=aI(this,null,this.f),a=[a[0]]);this.h=Date.now();this.C=!0;for(var c=a,d=c[0]||null,e=0;e<c.length;e++){var f=c[e],g=c[e+1],h=isNaN(this.o)||0===this.o?1:Math.abs(this.o),l=h*f.bandwidth,m=l/this.a.bandwidthDowngradeTarget;
|
|
306
|
+
g=h*(g?g.bandwidth:Infinity)/this.a.bandwidthUpgradeTarget;this.g.debug("Bandwidth ranges:",(l/1E6).toFixed(3),(m/1E6).toFixed(3),(g/1E6).toFixed(3));b>=m&&b<=g&&(d=f)}return d||a[0]||this.f[0]};_.u.enable=function(){this.l=!0};_.u.disable=function(){this.l=!1};
|
|
307
|
+
_.u.segmentDownloaded=function(a,b){this.g.debug("Segment downloaded:","deltaTimeMs\x3d"+a,"numBytes\x3d"+b,"lastTimeChosenMs\x3d"+this.h,"enabled\x3d"+this.l);_.sG(this.w,a,b);if(null!=this.h&&this.l)a:{this.g.debug("Suggesting Streams...");if(!this.B){if(!(128E3<=this.w.a)){this.g.debug("Still waiting for a good estimate...");break a}this.B=!0;if(this.a.useSwitchIntervalForInitialSwitch&&Date.now()-this.h<1E3*this.a.switchInterval){this.g.debug("Skipping initial estimation switch due to switch interval...");
|
|
308
|
+
break a}}else if(Date.now()-this.h<1E3*this.a.switchInterval){this.g.debug("Still within switch interval...");break a}var c=this.chooseTrack(),d=this.getBandwidthEstimate();this.g.debug("Calling switch_(), bandwidth\x3d"+Math.round(d/1E3)+" kbps");c&&this.A(c)}};_.u.playbackRateChanged=function(a){this.o=a};_.u.getBandwidthEstimate=function(){if(this.j&&this.a.useCmsd){var a=BE(this.j,_.Be);a=null==a?null:a;if(null!==a)return this.g.debug("Using CMSD estimatedThroughputKbps:",a),1E3*a}return this.w.getBandwidthEstimate(this.a.defaultBandwidthEstimate)};
|
|
309
|
+
_.u.setTracks=function(a){this.f=a};_.u.setCmsdManager=function(a){this.j=a};_.u.configure=function(a){this.a=a};_.u.reset=function(){this.B=!1;this.w=new rG;var a=this.chooseTrack();a&&this.A(a)};eI.prototype.clear=function(){this.a.clear()};gI.prototype.add=function(a,b){var c=void 0===b?!0:b;if(jI(this.f,a,void 0===c?!0:c))return this.a.add(a),!0;_.Yh("Dropping variant due to incompatible codecs for the current adaptation set. This may be because CodecSwitchingStrategy is set to PREVENT or SourceBuffer.changeType() is not available on this platform. Variant dropped:",a,"because it is not compatible with",this.f);return!1};gI.prototype.values=function(){return this.a.values()};lI.prototype.create=function(a){var b=this,c=this.a===_.og&&XE(),d=a.filter(function(e){return jI(b.f,e,!c)});return d.length?new gI(d[0],d):this.h.create(a)};
|
|
310
|
+
kI.prototype.create=function(a){var b=mI(a,this.j);0<b.length&&(a=b);b=!1;if(this.a){var c=nI(a,this.a);0<c.length?(a=c,b=!0):_.Yh("No exact match for preferred variant role could be found. Role: "+this.a)}b||(b=a.filter(function(e){return e.primary}),0<b.length&&(a=b));this.f&&(b=KH(a,this.f),b.length?a=b:_.Yh("No exact match for the channel count could be found."));b=oI(a,this.l);b.length?a=b:_.Yh("No exact match for spatial audio could be found.");b=this.h===_.og&&XE();c=new gI(a[0]);a=_.w(a);
|
|
311
|
+
for(var d=a.next();!d.done;d=a.next())c.add(d.value,!b);return c};rI.prototype.getState=function(){return this.a};var qI=0,pI=1;tI.prototype.release=function(){this.f.release()};_.u=vI.prototype;
|
|
312
|
+
_.u.destroy=function(){var a=this;this.K=!0;var b=[],c;for(c in this.h){var d=this.h[c],e=d[0];this.h[c]=d.slice(0,1);e&&b.push(e.p["catch"](FE));for(e=1;e<d.length;++e)d[e].p["catch"](FE),d[e].p.reject()}this.f&&b.push(this.f.destroy());this.C&&b.push(this.C.destroy());for(var f in this.w)this.w[f].destroy(),delete this.w[f];return Promise.all(b).then(function(){a.l&&(a.l.release(),a.l=null);a.j&&(a.j.removeAttribute("src"),a.j.load(),a.j=null);a.A="";a.o=null;a.f=null;a.C=null;a.a={};a.w={};a.H=
|
|
313
|
+
{};a.I=null;a.M=!1;for(var g in a.h);a.h={}})};_.u.open=function(){return this.L};_.u.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e;return _.I(function(f){if(1==f.a)return e=_.er,_.y(f,d.L,2);a.forEach(function(g,h){var l=_.Cl(g.mimeType,g.codecs);if(h===e.TEXT)d.uc(l);else{var m=new Map;m.set(h,l);if((!_.Cu(l)||!b||g.aesEncrypted)&&_.Bl(l,h)){var n=_.Bl(l);n&&(m=n(),d.w[h]=m,m=m.demuxMimeTypes(h,l),c&&m["delete"](e.AUDIO))}xI(d,m)}d.h[h]=[]});_.C(f)})};_.u.qj=function(){this.g.debug(JD);Object.values(this.w).forEach(function(a){return a.reset()})};
|
|
314
|
+
_.u.Gi=function(){return this.J.streaming.ignoreManagedMediaSourceStreamingHints?!0:this.P};_.u.uc=function(a){this.f||(this.f=new GG(this.J,this.C));HG(this.f,a)};_.u.We=function(){return this.o?this.o.readyState===_.ze:!0};_.u.Ua=function(a){return a===_.Q?this.f.Ua():(a=yI(this,a))?a.Ua():null};_.u.la=function(a){return a===_.Q?this.f.la():(a=yI(this,a))?a.la():null};_.u.Tb=function(a,b,c){return a===_.Q?this.f.Tb(b):(a=yI(this,a))?a.Tb(b,!1,c):!1};
|
|
315
|
+
_.u.Ga=function(a,b){if(a===_.Q)return this.f.Ga(b);var c=yI(this,a);return c?c.Ga(b):0};_.u.lg=function(){var a={};a.total=new _.zm(this.j.buffered,"total");a.audio=yI(this,_.dd);a.video=yI(this,_.r);var b=[];this.f&&(b=[{start:this.f.Ua(),end:this.f.la()}]);a.text=RE(b,_.Q);return a};
|
|
316
|
+
_.u.Ve=function(a,b,c,d,e,f,g){var h=this;g=void 0===g?!1:g;var l=this.a[a],m=-1,n=0;l&&l.buffered&&(n=l.buffered.length);a===_.r&&null!==c&&null!==d&&g&&(m=0<n?l.buffered.end(n-1):-1);a===_.Q?b=IG(this.f,b,c,d):this.w[a]?(b=this.w[a].transmux(b),b.captions&&0<b.captions.length&&(this.f||this.uc(_.Ag),KG(this.f,b.captions,c,d,this.a.video.timestampOffset)),e=[],0<b.audio.byteLength&&this.a.audio&&e.push(AI(this,_.dd,this.cg.bind(this,_.dd,b.audio.buffer))),0<b.video.byteLength&&this.a.video&&e.push(AI(this,
|
|
317
|
+
_.r,this.cg.bind(this,_.r,b.video.buffer))),b=Promise.all(e)):(e&&window.muxjs&&(this.f||this.uc(_.Ag),null==c&&null==d?this.I.init(b):this.I.h(b,function(p){p.length&&KG(h.f,p,c,d,h.a.video.timestampOffset)})),b=AI(this,a,this.cg.bind(this,a,b)));return b.then(function(){if(a===_.r&&null!==c&&null!==d&&!g)h.B.append(c,d,f),null!==c&&null!==d&&h.g.debug(fD,c,d,hD,zI(h,a));else if(a===_.dd&&null!==c&&null!==d)bF(h.B),null!==c&&null!==d&&h.g.debug(eD,c,d,hD,zI(h,a));else if(a===_.r&&null!==c&&null!==
|
|
318
|
+
d&&g){var p=l.buffered.length,q=0<p?l.buffered.end(p-1):-1;0>m&&0<p&&(m=l.buffered.start(0));0<=m&&0<q&&h.B.append(m,q,f)}if(!h.H[a]&&l&&1===l.buffered.length){p=l.buffered.start(0);var t=c-p;if(Math.abs(t)>h.U&&0===l.timestampOffset)return h.g.warn(lD+t+RC+(a+ZC)+(c+QC)+(p+YC)),p=AI(h,a,function(){BI(h,a,t)}),q=AI(h,a,h.Ch.bind(h,a,!1)),Promise.all([p,q])}null!==c&&null!==d&&(h.H[a]=!0)})["catch"](function(p){throw p;})};_.u.Gh=function(a){var b=this.la(_.r)||0;JG(this.f,a,b)};
|
|
319
|
+
_.u.yh=function(){this.f&&JG(this.f,"",0)};_.u.remove=function(a,b,c){var d=this;return a===_.Q?this.f.remove(b,c):AI(this,a,this.Dh.bind(this,a,b,c)).then(function(){if(a===_.r){var e=d.Ua(a),f=d.la(a);null!==e&&null!==f&&eF(d.B,e,f)}else a===_.dd&&cF(d.B)})};_.u.clear=function(a){if(a===_.Q){if(!this.f)return Promise.resolve();this.I.f();return this.f.remove(0,Infinity)}return AI(this,a,this.Dh.bind(this,a,0,this.o.duration))};
|
|
320
|
+
_.u.flush=function(a){return a===_.Q?Promise.resolve():AI(this,a,this.Ch.bind(this,a))};_.u.tj=function(a,b,c,d,e,f){var g=this,h,l,m;return _.I(function(n){if(1==n.a){h=_.er;if(a===h.TEXT){g.f.A=b;var p=g.f;p.h=c;p.l=d;return n["return"]()}return _.y(n,HI(g,a,e,f),2)}l=n.f;m=CI(g,a,b,c,d,l);g.M&&(m=m.concat(CI(g,h.AUDIO,b,c,d,l)));return _.y(n,Promise.all(m),0)})};_.u.endOfStream=function(a){var b=this;return FI(this,function(){b.We()||(a?b.o.endOfStream(a):b.o.endOfStream())})};
|
|
321
|
+
_.u.eg=function(a){var b=this;FI(this,function(){b.o.duration=a})};_.u.getDuration=function(){return this.o.duration};_.u.cg=function(a,b){this.g.debug(gD+a+SC);try{this.a[a].appendBuffer(b)}catch(c){throw this.g.warn(tD+a,c),c;}this.g.debug(nD+a+SC)};_.u.Dh=function(a,b,c){if(c<=b)this.Fc(a);else{this.g.debug(ID+a+VC,b,c);try{this.a[a].remove(b,c)}catch(d){throw this.g.warn(vD+a+TC,b,c,d),d;}this.g.debug(pD+a+VC,b,c)}};
|
|
322
|
+
_.u.Ch=function(a){try{this.j.readyState>HTMLMediaElement.HAVE_NOTHING?(this.g.debug(yD+a),this.j.currentTime-=.001):this.g.warn(ND+a+XC+this.j.readyState)}catch(b){throw this.g.warn(uD+a,b),b;}this.g.debug(oD+a);this.Fc(a)};_.u.Vk=function(a){this.h[a][0].p.reject(new _.O(_.P,3,3014,{mediaError:this.j.error?this.j.error.code:0}))};_.u.Fc=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug(QD+a),EI(this,a))};_.u.getTextDisplayer=function(){return this.C};var wI=window.URL.createObjectURL;II.prototype.release=function(){this.a=this.h=null;this.f=function(){}};II.prototype.l=function(a){var b=this.a,c=this.h.periods;a=fF(c,a)||c[0];b!==a&&this.f(a);this.a=a};KI.prototype.getConfiguration=function(){return this.j};KI.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};KI.prototype.set=function(a,b){this.h=a;OI(this,b)};var RI=new _.po(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])});_.u=_.UI.prototype;_.u.destroy=function(){var a=this,b,c,d,e;return _.I(function(f){if(1==f.a){b=[];c=_.w(a.a.values());for(d=c.next();!d.done;d=c.next())e=d.value,eJ(e),b.push(fJ(e));return _.y(f,Promise.all(b),2)}a.a.clear();a.w.clear();a.D=null;a.j=null;a.H=null;a.B.clear();a.h=null;a.f=!0;_.C(f)})};
|
|
323
|
+
_.u.start=function(){var a=this,b,c,d;return _.I(function(e){if(1==e.a){b=a.D.Qb();c=fF(a.j.periods,b+_.sw);if(!c)throw new _.O(_.P,5,5006,"No period found.");d=a.D.xg(c);if(!d.video&&!d.audio&&!d.text)throw a.g.error("start(): No streams chosen"),new _.O(_.P,5,5005,"No streams chosen.");a.G=!d.video&&!d.audio&&!!d.text;a.A=!!d.fb;return _.y(e,mJ(a,d.audio,d.video,d.text,b),2)}if(a.f)return e["return"]();a.g.debug("init: completed initial Stream setup");a.D&&a.D.sn&&(a.g.debug("init: calling onInitialStreamsSetup()..."),
|
|
324
|
+
a.D.sn());_.C(e)})};_.u.resume=function(){if(!uJ(this))for(var a=_.w(this.a.values()),b=a.next();!b.done;b=a.next())b=b.value,b.endOfStream=!1,cJ(this,b,0)};
|
|
325
|
+
_.u.ic=function(a){var b=this,c,d,e,f,g,h,l;return _.I(function(m){switch(m.a){case 1:if(b.f)return m["return"]();c=rJ(a);if(a.Fb||null==a.vb||a.Dc)return m["return"]();a.vb=null;if(!a.nc){m.F(2);break}b.g.debug(c,"skipping update and clearing the buffer");return _.y(m,wJ(b,a,a.Gf,a.Te),3);case 3:return m["return"]();case 2:_.D(m,4);d=JJ(b,a);null!=d&&(cJ(b,a,d),a.wd=!1);_.Jh(m,5);break;case 4:return e=_.H(m),_.y(m,UJ(b,e),6);case 6:return m["return"]();case 5:ZJ(b,a);if(!vJ(b)){m.F(0);break}if(b.D.configuration.Hm){b.g.debug("End of stream reached, keeping MediaSource open.");
|
|
326
|
+
f=_.w(b.a.values());for(g=f.next();!g.done;g=f.next())h=g.value,h.vb=null;return m["return"]()}b.g.debug("End of stream reached, calling ms.endOfStream().");return _.y(m,b.D.X.endOfStream(),8);case 8:if(b.f)return m["return"]();l=b.D.X.getDuration();l<b.j.presentationTimeline.getDuration()&&(b.j.presentationTimeline.f=l);b.D.Ti();_.C(m)}})};
|
|
327
|
+
_.u.On=function(a,b,c,d){var e=rE(d.reader),f=rE(d.reader),g=_.yn(d.reader),h=_.yn(d.reader),l=_.yn(d.reader),m=_.yn(d.reader);d=_.Cn(d.reader,d.reader.Wa()-d.reader.getPosition());a=a.startTime+b.startTime+h/g;if(c.includes(e))if("urn:mpeg:dash:event:2012"===e)this.D.Yi();else this.D.onEvent(new _.L("emsg",{detail:{startTime:a,endTime:a+l/g,schemeIdUri:e,value:f,timescale:g,presentationTimeDelta:h,eventDuration:l,id:m,messageData:d}}))};
|
|
328
|
+
_.u.Qo=function(a){var b=this,c=!1,d=0;(new _.Dn).N(_.cf,_.En).N(_.Jg,_.En).N(_.Ye,_.En).N(_.bf,_.En).N(_.tg,_.En).aa(_.vg,_.Fn).N("encv",function(e){e.reader.skip(78);_.En(e)}).N("pasp",function(e){d=e.start+e.headerSize;var f=_.yn(e.reader),g=_.yn(e.reader);c=f!==g;b.g.debug("hSpacing\x3d"+f+", vSpacing\x3d"+g+", updatePASP\x3d"+c);e.parser.stop()}).parse(a.data);c&&(a=new _.qn(new DataView(a.data)),a.seek(d),_.W(a,1),_.W(a,1))};_.x(eK,_.Lm);_.u=eK.prototype;_.u.init=function(a,b){var c=a.getMedia();_.Lm.prototype.init.call(this,a,b);LK(this,c)};_.u.namespace=function(){return XD};_.u.setSeekInterceptor=function(a){this.gh=a||null};_.u.setPlaybackSessionId=function(a){this.$g=a};_.u.Uh=function(){return new $G};_.u.getState=function(){return this.Lb};_.u.getDrmInfo=function(){return this.B?this.B.getDrmInfo():null};
|
|
329
|
+
_.u.unload=function(){var a=this,b;return _.I(function(c){if(1==c.a){jH(a,!1);a.ke=!1;if(!a.ba)return c["return"]();a.log.debug("Unload player with source",a.ba);(b=a.getTrackManager())&&b.release();return a.I===bL?c["return"]():_.y(c,NK(a),2)}a.ba=null;a.dh=0;a.Zb=null;a.ya=null;a.getNetworkEngine().headers["delete"](SD);_.C(c)})};_.u.release=function(){var a=this;return _.I(function(b){if(a.ja)return b["return"](a.ja);a.ja=hK(a);a.ja["finally"](function(){a.ja=null});return b["return"](a.ja)})};
|
|
330
|
+
_.u.getBufferInfo=function(a){if(this.M){var b=this.M.lg(),c=new _.zm(void 0,a);switch(a){case _.Tk:return b.video?b.video:c;case _.V:return b.audio?b.audio:c;case _.Sk:return b.text?b.text:c}return b.total?b.total:c}return this.ed?(b=$E(this.ed),RE(b,a)):_.Lm.prototype.getBufferInfo.call(this,a)};_.u.getPosition=function(){var a=this.oe,b=this.getMediaPosition();a.a&&(a=a.a,b-=a.f,b=0>b?0:b>a.a?a.a:b);return b};_.u.getMediaPosition=function(){return this.C?iG(this.C):_.Lm.prototype.getMediaPosition.call(this)};
|
|
331
|
+
_.u.seek=function(a,b){if(this.gh&&!this.gh(a,b))return Promise.resolve();var c=this.oe;c=c.a?a+c.a.dc():a;c!==a&&this.log.info("Seeking to "+a+" s corresponding to media time of "+(c+" s."));return _.Lm.prototype.seek.call(this,c)};_.u.getPresentationStartTime=function(){return this.f?this.f.presentationTimeline.getPresentationStartTime():null};_.u.getDuration=function(){var a=this.oe,b=this.getMediaDuration();return a.a?a.a.getDuration():b};
|
|
332
|
+
_.u.getMediaDuration=function(){return this.f?this.f.presentationTimeline.getDuration():Infinity};_.u.destroy=function(){var a=this;return _.I(function(b){if(1==b.a)return _.y(b,_.Lm.prototype.destroy.call(a),2);if(a.I===bL)return b["return"]();a.log.debug("Destroying player...");a.I=bL;KK(a);a.w&&(a.w.release(),a.w=null);a.$d=null;a.h=null;_.C(b)})};_.u.getTimeline=function(){return this.$d};
|
|
333
|
+
_.u.setupPlaylist=function(a){var b=this,c,d,e,f,g,h,l,m,n,p,q,t,v;return _.I(function(z){switch(z.a){case 1:return c=new _.xk,b.A.a=c,_.D(z,2),IK(b),b.Y=_.Ib,_.y(z,PK(b),4);case 4:return dI(b.A,c),d=a[0],d.playlist&&d.playlist.startTime&&(d.startTime=d.playlist.startTime),b.ba=_.Zq(d),b.configuration=_.Jm(b.kb,d),b.log.info("Loading playlist configurations",a),b.$d=iK(b.configuration),_.y(z,QK(b,c),5);case 5:return dI(b.A,c),e=a.map(function(A){return RK(b,A,0,null,!0)}),_.y(z,Promise.all(e),6);
|
|
334
|
+
case 6:f=z.f;g=f.filter(function(A){return A.manifest.presentationTimeline.isLive()});if(h=g[0])b.j=h.parser;if(1<g.length)throw new _.O(_.P,7,7003,"Playlist of multiple live streams is not supported.");if(h){l=b.configuration.playlist.content;if(l===_.kc)throw new _.O(_.P,7,7003,"Cannot play live content in VOD mode.");if("IPR"===l&&h!==f[f.length-1])throw new _.O(_.P,7,7003,"Wrong order of playlist assets.");}m=null==h;n=new _.qF({version:2},null,0,m);p=f.map(function(A){return TG(A.manifest)});
|
|
335
|
+
q=WG(p,n);b.f=q;t=b;return _.y(z,SK(b,q,b.configuration),7);case 7:return t.B=z.f,dI(b.A,c),_.y(z,TK(b,c),8);case 8:dI(b.A,c);pJ(b.a,q);kK(b,q);c.resolve();_.Jh(z,0);break;case 2:v=_.H(z);if(!b.j){z.F(9);break}return _.y(z,b.j.stop(),10);case 10:b.j=null;case 9:UK(b,v,c),_.C(z)}})};
|
|
336
|
+
_.u.appendLoad=function(a){var b=this,c;return _.I(function(d){if(1==d.a){IK(b);if(b.Y!==_.Ib)throw new _.O(_.P,7,7003,"Cannot append-load to non-playlist player.");return _.y(d,aL(b,a),2)}c=d.f;b.f=c.manifest;b.j=c.parser;pJ(b.a,c.manifest);vJ(b.a)&&b.a.resume();kK(b,c.manifest);_.C(d)})};_.u.seekWith=function(a){return this.seek(this.getPosition()+a)};
|
|
337
|
+
_.u.Bh=function(){var a=this;return _.I(function(b){IK(a);if(!a.yf)return a.log.warn("No preloaded asset found"),b["return"]();a.log.info("Loading preloaded asset",a.yf);a.yf=null;return _.y(b,TK(a,null),0)})};_.u.preload=function(a){var b=this;return _.I(function(c){if(1==c.a)return IK(b),_.np("preload.start"),b.log.info("Preloading asset",a),_.y(c,VK(b,a,!1),2);b.yf=a;b.log.info("Preloaded asset",a);_.np("preload.end");_.pp("preload","preload.start","preload.end");_.C(c)})};
|
|
338
|
+
_.u.load=function(a){return VK(this,a)};_.u.detach=function(){var a=this;return _.I(function(b){if(1==b.a)return _.y(b,JK(a),2);a.configuration=a.kb;KK(a);_.C(b)})};_.u.isLive=function(){var a;this.f?(a=this.f.presentationTimeline.isLive())||(a=this.f.presentationTimeline,a=Infinity!==a.f&&!a.l):a=!1;return a};_.u.bj=function(){this.log.debug("User seeking finished");this.K&&uL(this);vL(this)};
|
|
339
|
+
_.u.getSeekRange=function(){var a={start:0,end:0};if(this.f){var b=this.f.presentationTimeline;a={start:rF(b),end:BF(b)}}b=this.oe;b.a?(b=b.a.getDuration(),b>a.end&&(b=a.end),b={start:0,end:b}):b=a;return b};_.u.Kc=function(){return this.f?this.f.presentationTimeline.Kc():null};_.u.getPlaybackRate=function(){if(this.J){var a=this.J;a=a.l?0:a.h}else a=0;return a};
|
|
340
|
+
_.u.setPlaybackRate=function(a,b){if(0===a)this.log.warn("A trick play rate of 0 is unsupported!");else if(this.I===dK){if(_.Fk()){this.log.warn("Pausing and unpausing to mitigate playbackRate platform issue.");var c=this.getSurface().getMedia();c.pause();this.J.set(a,b);c.play()}else this.J.set(a,b);if((c=this.J.getConfiguration())&&c.preferTrickPlayTracks){c=this.a;var d=1<Math.abs(a),e=c.a.get(_.r);if(e){var f=e.stream;if(f)if(c.g.debug("setTrickPlay",d),d)(d=f.trickModeVideo)&&!e.vc&&(c.g.debug("Engaging trick mode stream",
|
|
341
|
+
d),_.iJ(c,d,!1,0),e.vc=f);else if(f=e.vc)c.g.debug("Restoring non-trick-mode stream",f),e.vc=null,_.iJ(c,f,!0,0)}}this.h.playbackRateChanged(a)}};_.u.ma=function(){if(this.f&&this.C){var a=rH(this);if(null==a)a=null;else{if(!sH(this.o,a).text){var b=_.ZH(a.textStreams,this.Wd,this.hf,this.Qd);b.length&&(b=b[0],sH(this.o,a).text=b)}a=sH(this.o,a).text}b=[];for(var c=_.w(VL(this)),d=c.next();!d.done;d=c.next()){d=d.value;var e=WH(d);e.activeText=d===a;b.push(e)}return b}return[]};_.u.getPeriods=function(){return this.f.periods};
|
|
342
|
+
_.u.getStats=function(){if(this.I!==dK)return _.Gq();vL(this);var a=this.l;if(a.getVideoPlaybackQuality){a=a.getVideoPlaybackQuality();var b=this.H,c=Number(a.totalVideoFrames);b.o=Number(a.droppedVideoFrames);b.l=c}if(this.I===dK){(b=rH(this))?(a=sH(this.o,b).video,b=sH(this.o,b).audio,a=(a.bandwidth||0)+(b.bandwidth||0)):a=null;a&&(this.H.w=a);if(a=xL(this))b=this.H,c=a.height||NaN,b.A=a.width||NaN,b.j=c;a=this.h.getBandwidthEstimate();this.H.h=a}return this.H.getStats()};
|
|
343
|
+
_.u.getBandwidthEstimate=function(){return this.h.getBandwidthEstimate()};_.u.getCueTimeline=function(){return this.L};_.u.getTimelineCues=function(){return this.L?HF(this.L,JL(this)):[]};_.u.resetAbr=function(){this.h&&this.h.reset()};_.u.ee=function(){return this.h};
|
|
344
|
+
_.u.addTextTrack=function(a,b,c,d,e,f){var g=this,h,l,m,n,p,q,t,v,z;return _.I(function(A){if(1==A.a){if(g.I!==dK)throw g.log.error("Must call load() and wait for it to resolve before adding text tracks."),Error("State error!");h=rH(g);l=_.er;m=g.f.periods.indexOf(h);n=m+1;p=n>=g.f.periods.length?g.f.presentationTimeline.getDuration():g.f.periods[n].startTime;q=p-h.startTime;if(Infinity===q)throw new _.O(1,4,4040);t=new _.Nj(1,0,q,function(){return[a]},0,null,0);v={id:g.hh++,originalId:null,createSegmentIndex:Promise.resolve.bind(Promise),
|
|
345
|
+
findSegmentPosition:function(){return 1},getSegmentReference:function(E){return 1===E?t:null},adjustSegmentDurations:function(){},getDuration:function(){return q},segmentLookupStrategy:_.aE,initSegmentReference:null,mimeType:d,codecs:e||"",kind:c,encrypted:!1,keyId:null,language:b,originalLanguage:b,label:f||null,type:l.TEXT,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:null,spatialAudio:!1,closedCaptions:null};g.nf.add(v);h.textStreams.push(v);return _.y(A,dJ(g.a,v),
|
|
346
|
+
2)}if(z=_.XI(g.a,_.Q))sH(g.o,h).text=z;g.nf["delete"](v);g.log.debug("Choosing new streams after adding a text stream");QL(g,h);hL(g);return A["return"](WH(v))})};
|
|
347
|
+
_.u.Uk=function(a){this.log.debug(_.eE,a);try{this.log.debug("onChooseStreams_, choosing variant from ",a.variants);this.log.debug("onChooseStreams_, choosing text from ",a.textStreams);var b=TL(this,a);this.log.debug("onChooseStreams_, chose video ",b.video);this.log.debug("onChooseStreams_, chose audio ",b.audio);this.log.debug("onChooseStreams_, chose text ",b.text);return b}catch(c){return this.onError(c),{audio:null,video:null,text:null,fb:null}}};
|
|
348
|
+
_.u.Tk=function(){this.log.debug("canSwitch_");this.ga=!1;this.configuration.abr.enabled&&this.h.enable();this.Ea&&(jJ(this.a,this.Ea,this.Cj,this.Bj),this.Ea=null);this.ca&&(_.iJ(this.a,this.ca,!0,0),this.ca=null)};_.u.Po=function(){this.j&&this.j.update()};_.u.Dn=function(){this.C&&this.C.j.wf()};
|
|
349
|
+
_.u.Yj=function(a,b,c){if((void 0===c?"":c)===cE)return hL(this),this.wa()||(this.configuration.abr.enabled=!0,this.h.enable()),QL(this,b,!1),!0;if(c=b.variants.some(function(g){var h=!1,l=g[a.type];l&&(h=g.allowedByApplication&&l.id!==a.id,a.type===_.dd&&(h=h&&l.language===a.language));return h})&&this.wa()){for(var d=_.w(b.variants),e=d.next();!e.done;e=d.next()){e=e.value;var f=e[a.type];f&&f.id===a.id&&(e.allowedByApplication=!1)}hL(this);this.wa()||(this.configuration.abr.enabled=!0,this.h.enable());
|
|
350
|
+
QL(this,b)}return c};_.u.qn=function(){this.log.debug("endOfStream called by streaming engine");this.ke=!0};_.u.onError=function(a){if(this.I!==bL&&7001!==a.code&&7E3!==a.code){var b=new _.L(_.Ae,{detail:a});a.severity===_.P&&gK(this,_.Sq);this.trigger(b);b.defaultPrevented&&(b.a=!0)}};_.u.bg=function(a){a.type===_.te?this.dispatchEvent(a):"largegap"!==a.type&&(a.type===_.gh?cL(this):"emsg"!==a.type&&(a instanceof _.L?this.dispatchEvent(a):this.log.debug(_.ec,a.type)))};_.u.wa=function(){return this.configuration.abr.enabled};
|
|
351
|
+
_.u.Fo=function(a){var b=this,c,d,e,f,g,h,l,m,n;return _.I(function(p){switch(p.a){case 1:if(!b.cd)return p["return"]();b.log.info("Attempt to switch CDN.");c=b.getLoadedSource();d=b.wa();return _.y(p,b.cd(c.url,a),2);case 2:e=p.f;if(!e)return p["return"]();f=_.N.ua(b.getLoadedSource(),{url:e});d&&b.h.disable();return _.y(p,xJ(b.a),3);case 3:g=xL(b),h=yL(b);case 4:return l=!1,_.D(p,7),b.log.info("Switching CDN to "+f.url+"."),_.y(p,WL(b,f,g,h),9);case 9:_.Jh(p,6);break;case 7:return m=_.H(p),b.log.info("Switch failed"),
|
|
352
|
+
_.y(p,b.cd(f.url,a),10);case 10:if(n=p.f)f.url=n,l=!0;else throw m;case 6:l?p.F(4):(d&&b.h.enable(),tJ(b.a,!0),b.ba[b.getSourceIndex()]=f,a.f=!0,b.trigger(new _.L(_.wd,{newManifest:f.url})),_.C(p))}})};var bL=0,cK=1,dK=2,gL=[_.rf,_.Je];XL.prototype.a=function(){return XD};
|
|
353
|
+
XL.prototype.canPlay=function(a,b){if(_.Kl())return 0;var c=a.type||"",d=(window.ManagedMediaSource?!0:!1)||(window.MediaSource&&MediaSource.isTypeSupported?!0:!1),e=window.ManagedMediaSource||window.MediaSource&&MediaSource.isTypeSupported?c in _.gv||_.hv(a.url)in _.iv?!0:!1:!1;if(d&&e){if(_.Fk(2))return 1;if(_.Ll()&&c===_.mm){if(b.streaming.preferNativeHlsOnSafari)return 1;_.Yh("Support for MSE + FairPlay on Apple is experimental. In case of issues, consider using native HLS.")}return 2}return 0};
|
|
354
|
+
XL.prototype.f=function(a){return a===_.qa||a===_.Ib};XL.prototype.create=function(){return new eK};_.hi(new XL);_.jt(function(){_.ci("MediaSource.install");if(window.MediaSource)if(window.cast&&cast.__platform__&&cast.__platform__.canDisplayType)_.bi("Patching Chromecast MSE bugs."),bM();else if(_.Ll()){var a=navigator.appVersion;a=0<=a.indexOf("Version")?parseInt(a.match(/Version\/(\d+)/)[1],10):13;$L();10>=a?(_.bi("Blacklisting MSE on Safari \x3c\x3d 10."),window.MediaSource=null):12>=a?(_.bi("Patching Safari 11 \x26 12 MSE bugs."),YL(),ZL()):(_.bi("Patching Safari 13 MSE bugs."),YL())}else _.Fk(2)||_.Fk(3)||
|
|
355
|
+
_.Fk(4)?aM():_.bi("Using native MSE as-is.");else _.bi("No MSE implementation available.")});_.x(cM,_.ew);_.u=cM.prototype;
|
|
356
|
+
_.u.append=function(a){function b(e){if(e.startTime>=e.endTime)_.Yh("Invalid cue times: "+e.startTime+" - "+e.endTime),e=null;else{var f=e.payload||"";f=f.replace(/<br\s*\/?>/igm,"\n");f=_.T.Ug(f);f=new VTTCue(e.startTime,e.endTime,f);f.line=-1;try{f.align=_.yd}catch(g){f.align="middle"}e.writingMode===_.Xg?f.vertical="lr":e.writingMode===_.Yg&&(f.vertical="rl");e=f}e&&c.push(e)}var c=[],d=_.w(a);for(a=d.next();!a.done;a=d.next())b(a.value);a=c.slice().sort(function(e,f){return e.startTime!==f.startTime?
|
|
357
|
+
e.startTime-f.startTime:e.endTime!==f.endTime?e.endTime-f.startTime:c.indexOf(f)-c.indexOf(e)});d=_.w(a);for(a=d.next();!a.done;a=d.next())this.a.addCue(a.value)};_.u.remove=function(a,b){if(!this.a)return!1;dM(this.a,function(c){return c.startTime<b&&c.endTime>a});return!0};_.u.isTextVisible=function(){return this.a.mode===_.kg};_.u.setTextVisibility=function(a){null!==this.a&&(this.a.mode=a?_.kg:_.Ge)};_.u.destroy=function(){this.a&&dM(this.a,function(){return!0});this.a=null;return Promise.resolve()};eM.prototype.a=function(){return!0};eM.prototype.create=function(a){return new cM(a)};_.xq("single-native",new eM);};
|
|
348
358
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
349
359
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
350
360
|
else{_=this.clpp._;(f.call(g,this));}
|