@castlabs/prestoplay 6.23.1 → 6.24.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 +14 -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 +113 -113
- package/cjs/cl.conviva.js +32 -32
- package/cjs/cl.core.js +608 -591
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +87 -86
- package/cjs/cl.externs.js +94 -30
- package/cjs/cl.freewheel.js +25 -24
- package/cjs/cl.hls.js +73 -71
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +23 -23
- package/cjs/cl.mse.js +344 -339
- package/cjs/cl.muxdata.js +15 -15
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +14 -13
- 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 +71 -71
- 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 +492 -478
- package/cl.crypto.js +9 -9
- package/cl.dash.js +81 -80
- package/cl.externs.js +94 -30
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +75 -74
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +17 -17
- package/cl.mse.js +307 -305
- 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 +59 -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 +44 -10
package/cjs/cl.mse.js
CHANGED
|
@@ -1,350 +1,355 @@
|
|
|
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 NC,OC,PC,QC,RC,SC,TC,UC,VC,WC,XC,YC,ZC,$C,aD,bD,cD,dD,eD,fD,gD,hD,iD,jD,kD,lD,mD,nD,oD,pD,qD,rD,sD,tD,uD,vD,wD,xD,yD,AD,CD,DD,ED,FD,GD,HD,ID,JD,KD,LD,MD,ND,PD,QD,RD,SD,TD,UD,VD,XD,$D,aE,cE,dE,eE,fE,gE,hE,iE,kE,lE,nE,oE,tE,uE,vE,wE,xE,yE,zE,AE,CE,GE,HE,JE,KE,LE,ME,OE,QE,RE,TE,UE,VE,XE,YE,ZE,$E,aF,bF,cF,dF,eF,gF,lF,rF,wF,zF,oF,yF,AF,BF,CF,DF,EF,FF,GF,HF,IF,MF,OF,PF,QF,NF,SF,RF,TF,UF,XF,YF,ZF,WF,VF,$F,dG,fG,cG,gG,bG,eG,aG,iG,hG,jG,kG,lG,oG,qG,tG,vG,uG,zG,CG,AG,BG,DG,EG,FG,GG,HG,JG,KG,LG,MG,NG,PG,
|
|
3
|
+
QG,RG,TG,UG,SG,VG,WG,XG,YG,ZG,$G,aH,bH,cH,fH,iH,jH,nH,lH,mH,rH,qH,sH,wH,uH,yH,zH,AH,CH,BH,DH,FH,EH,LH,MH,IH,GH,JH,KH,NH,OH,RH,QH,SH,TH,UH,HH,VH,PH,YH,ZH,aI,$H,bI,pH,cI,dI,gI,eI,fI,iI,hI,jI,kI,lI,oI,qI,pI,sI,rI,uI,vI,wI,zI,yI,xI,AI,CI,BI,DI,EI,FI,GI,HI,II,LI,KI,JI,NI,MI,PI,TI,VI,WI,aJ,dJ,eJ,gJ,iJ,kJ,mJ,QI,nJ,qJ,rJ,sJ,uJ,vJ,xJ,yJ,AJ,hJ,jJ,ZI,DJ,CJ,XI,lJ,GJ,EJ,zJ,BJ,IJ,HJ,FJ,PJ,QJ,KJ,SJ,LJ,NJ,VJ,UJ,OJ,TJ,WJ,YI,wJ,XJ,YJ,MJ,tJ,$I,bJ,SI,JJ,cJ,RJ,oJ,pJ,ZJ,bK,cK,dK,eK,fK,iK,FK,hK,LK,MK,TK,gK,SK,UK,NK,OK,
|
|
4
|
+
PK,ZK,VK,JK,IK,HK,KK,XK,YK,QK,RK,iL,dL,lL,mL,nL,rL,oL,dH,hH,eH,DL,CL,kH,gH,AL,FL,zL,EL,xL,GL,jL,hL,qL,BL,yL,IL,pL,tL,aL,sL,JL,gL,LL,KL,ML,NL,QL,kL,fL,PL,OL,WK,HL,wL,SL,oH,vL,uL,RL,GK,TL,cL,bL,UL,VL,WL,XL,YL,ZL,$L,aM,bM;NC=" and the media start time is ";OC=" between media times and segment times for ";PC=" buffer";QC=" buffer. Range:";RC=" is being or has been set up";SC=" range:";TC=" seconds";UC=" with element state: ";VC=". Adjusting timestampOffset.";WC=". The segment start time is ";XC="\x3c/DATA\x3e\x3c/WRMHEADER\x3e";
|
|
5
|
+
YC="\x3c/LA_URL\x3e";ZC="\x3cLA_URL\x3e";$C='\x3cWRMHEADER xmlns\x3d"http://schemas.microsoft.com/DRM/2007/03/PlayReadyHeader" version\x3d"';aD="Aborting operations for ";bD="Appended audio segment ";cD="Appended video segment ";dD="Appending data to ";eD="Buffer:";fD="Cannot get segment, period ID unknown";gD="Choosing new streams after key status change";hD="Detected a delta of ";iD="Done Aborting operations for ";jD="Done Appending data to ";kD="Done Flushing buffer for ";lD="Done Removing data from ";
|
|
6
|
+
mD="Done Setting append window for ";nD="Done Setting timestamp offset for ";oD="Failed to abort operations for ";pD="Failed to append data for ";qD="Failed to flush buffer for ";rD="Failed to remove data from ";sD="Failed to set append window for ";tD="Failed to set timestamp offset for ";uD="Flushing buffer for ";vD="IterateSegmentReference";wD="Jumping forward";xD="MediaSource threw QuotaExceededError:";yD="No more scheduled operations for ";_.zD="No stream with id";AD="Period not found.";
|
|
7
|
+
_.BD="Player is in ERROR state and can not switch to ";CD="PrestoPlay TextTrack";DD="QuotaExceededError";ED="Removing audio from variant - audio not compatible with platform";FD="Removing data from ";GD="Reset transmuxers.";HD="Setting append window for ";ID="Setting playback rate to\x3d";JD="Setting timestamp offset for ";KD="Skip buffer flush for ";LD="Starting next operation for ";MD="URI-REPLACEMENT";ND="Update-End received for ";_.OD="Updating manifest...";PD="X-Playback-Session-Id";QD="bufferBehind\x3d";
|
|
8
|
+
RD="bufferedBehind\x3d";SD="calling onCanSwitch()...";TD="cannot find segment";UD="clpp.mse.Player";VD="currentPeriod.startTime\x3d";_.WD="dashif:Laurl";XD="failed to get buffered range for ";_.YD="getSegmentNextReference";_.ZD="iterateSegmentReference";$D="key-restriction";aE="manifest.start";_.bE="onChooseStreams_";cE="presentationTime:";dE="presentationTime\x3d";eE="reference.endTime\x3d";fE="reference.position\x3d";gE="reference.startTime\x3d";hE="sourceopen";iE="startstreaming";_.jE="subtitles";
|
|
9
|
+
kE="switch: Stream ";lE="updateend";_.mE=function(a,b){return _.qh[a]=b};nE=function(a,b){for(var c in a.a)b(c,a.a[c])};oE=function(a){for(var b=a.a+a.f.byteOffset,c=void 0;_.tn(a);)if(0===_.vn(a)){c=a.a+a.f.byteOffset-1;break}a=a.f.buffer.slice(b,c);return _.T.da(a)};_.qE=function(a){var b=new Uint8Array(pE),c=4+b.byteLength+a.j.byteLength+4+a.f.byteLength,d=new _.pn(c,!1);_.W(d,c);_.rn(d,b);_.rn(d,a.j);_.W(d,a.f.byteLength);_.rn(d,a.f);return _.Xj(d.buffer)};
|
|
10
|
+
_.rE=function(a,b,c,d){var e=_.kk(b);if(8!==e.byteLength)e="";else{var f=_.ip(e);e=_.hk(f);b:switch(f=f.byteLength,_.ai("Trying to create PlayReady header in version",a),a){case "4.0.0.0":e=[$C+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?ZC+d+YC:"",XC].join("");break b;case "4.1.0.0":e=[$C+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?ZC+d+YC:"",XC].join("");break b;case "4.2.0.0":case "4.3.0.0":e=[$C+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?ZC+d+YC:"",XC].join("");break b;default:_.Wh("Cannot create PlayReady header in version",a),e=""}}if(!e)return null;_.ai("New payload",e);e=_.Xj(_.T.Ef(e,!0));return new _.ep(_.jp,
|
|
12
|
+
b,d||null,e,a,c)};_.sE=function(a,b){return b===a.version?a:_.rE(b,a.a,a.l||void 0,a.h||void 0)};tE=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};uE=function(a,b){if(_.Ol("Edge/"))return!0;b=b.toLowerCase();if(_.Mk()&&b.includes('codecs\x3d"ac-3"')){var c=b.replace("ac-3",_.ve);return a.K.has(b)||a.K.has(c)}return a.K.has(b)};
|
|
13
|
+
vE=function(a,b){var c=a.o.get(b);return!(!c||c!==_.qf&&c!==_.Ie)};wE=function(a,b){var c=b.audio,d=b.video;if(c&&c.encrypted&&(c=_.Xp(c),!uE(a,c))||d&&d.encrypted&&(d=_.Xp(d),!uE(a,d)))return!1;var e=a.keySystem();return 0===b.drmInfos.length||b.drmInfos.some(function(f){return f.keySystem===e})};xE=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
|
+
yE=function(a,b){if(null==a.a)return null;var c=a.a[a.a.length-1];return c?c[b]:null};zE=function(a){a=yE(a,_.Nw);return null==a?null:a};AE=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};_.BE=function(a,b){return a.concat(b)};CE=function(){};
|
|
15
|
+
_.DE=function(a,b){if(0===b.length)return a;var c=b.map(function(d){return new _.rj(d)});return a.map(function(d){return new _.rj(d)}).map(function(d){return c.map(d.resolve.bind(d))}).reduce(_.BE,[]).map(function(d){return d.toString()})};_.EE=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:b||[],keyIds:[],periodId:c?c:null}};
|
|
16
|
+
_.FE=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.qd=_.N.R(e)?!1:!!e;this.ye=f;this.Ta=g};GE=function(a,b){a=_.Oj(a);b=_.Oj(b);var c=a.split("-"),d=b.split("-");return c[0]===d[0]&&1===c.length&&2===d.length};HE=function(a){return a.language?_.Oj(a.language):a.audio&&a.audio.language?_.Oj(a.audio.language):a.video&&a.video.language?_.Oj(a.video.language):_.Lg};
|
|
17
|
+
_.IE=function(a,b){for(var c=_.Oj(a),d=new Set,e=_.w(b),f=e.next();!f.done;f=e.next())d.add(_.Oj(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,GE(f,c))return f;e=_.w(d);for(f=e.next();!f.done;f=e.next()){var g=f=f.value,h=c;g=_.Oj(g);h=_.Oj(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,GE(c,e))return e;return null};
|
|
18
|
+
JE=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};KE=function(a,b){var c=_.Il(b,a);if(!c)return!1;c=c();var d=c.isMuxed(a,b);c.destroy();return d};LE=function(a){for(var b=[a.mimeType],c=_.w(_.xw),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
|
+
ME=function(a){return a.split(",").map(function(b){return b.trim()}).filter(function(b){return 0<b.length})};_.NE=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(",")};OE=function(a,b){for(var c=new _.Gm(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
|
+
_.PE=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
|
+
QE=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
|
+
RE=function(a){function b(h,l){return new _.PE(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 u="",v=a.charCodeAt(e);39!==v&&34!==v;)e++,v=a.charCodeAt(e);if(39===v||34===v){if(u=e+1,e=a.indexOf(a[e],u),u=a.slice(u,e),-1===e)throw Error("Missing closing quote");}else e--;p[q]=u;q=q.split(":");"xmlns"===q[0]&&q[1]&&g.set(u,q[1])}e++}q=[];u=a.charCodeAt(e-1);e++;47!==u&&(q=c(m));l.push(new _.
|
|
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
|
-
b,a.a=d,a.l=c;d=b-a.j;d>=a.o&&c&&a.f(a.a,d)}}else if((0!==e||a.A)&&a.I&&(f=d.start(e),!(f>=
|
|
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 u="",v=a.charCodeAt(e);39!==v&&34!==v;)e++,v=a.charCodeAt(e);if(39===v||34===v){if(u=e+1,e=a.indexOf(a[e],u),u=a.slice(u,e),-1===e)throw Error("Missing closing quote");}else e--;p[q]=u;q=q.split(":");"xmlns"===q[0]&&q[1]&&g.set(u,q[1])}e++}q=[];u=a.charCodeAt(e-1);e++;47!==u&&(q=c(m));l.push(new _.PE(m,
|
|
25
|
+
null,p,q,n,g))}else m=e,e=a.indexOf("\x3c",e)-1,-2===e&&(e=f),m=QE(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 _.PE("#document",null,{},c(""),null,g)};_.SE=function(){};
|
|
26
|
+
TE=function(a){switch(a){case _.Nm:_.Mw.info("Select DOM parser for XML");_.fp=new _.Zo;break;case "txml":_.Mw.info("Select TXML parser for XML");_.fp=new _.SE;break;default:_.Mw.warn("XML parser option unknown, using default DOM parser. Option: "+a),_.fp=new _.Zo}};UE=function(){return!!window.SourceBuffer&&!!SourceBuffer.prototype&&!!SourceBuffer.prototype.changeType};VE=function(a,b){return a.start-b.start};
|
|
27
|
+
_.WE=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};XE=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}})};YE=function(a){a.player&&(a.player.off(_.bg,a.jd),a.a&&a.player.off(_.Gg,a.jd));a.player=null};ZE=function(a){a.player&&a.player.trigger(new _.L(_.id))};$E=function(a){a.player&&a.player.trigger(new _.L(_.id))};
|
|
28
|
+
aF=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(_.Gg,a.jd,a),a.a=!0):!b&&a.a&&(a.log.debug("Stop tracking timeupdates"),a.player.off(_.Gg,a.jd),a.a=!1)}};bF=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(_.Zg))};
|
|
29
|
+
cF=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};dF=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};eF=function(a,b){for(var c=0;c<a.length;c++)if(dF(a[c]).has(b))return c;return-1};
|
|
30
|
+
gF=function(a,b){Array.from(dF(a)).forEach(function(c){c.segmentIndex&&_.fF(c.segmentIndex,b)})};_.hF=function(a){this.h=Math.exp(Math.log(.5)/a);this.f=this.a=0};_.iF=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)};_.jF=function(a){return a.a/(1-Math.pow(a.h,a.f))};
|
|
31
|
+
_.kF=function(a,b,c,d,e,f,g,h){a=_.wk(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};lF=function(a){this.a=this.h=0;this.f=a};_.mF=function(a,b,c){a.h=b;a.a=c};
|
|
32
|
+
_.nF=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 lF(d);this.J=null;this.B=this.j.type||null};_.pF=function(a,b){a.L={offsetDateTime:b-oF(a),seekRangeStartDateTime:b}};_.qF=function(a,b){a.l=b;a.C=b;a.a.f=b};rF=function(a){return 2===a.j.version?a.a.f?a.a.a:null:a.l?a.f:a.C?a.o:null};
|
|
33
|
+
_.uF=function(a,b,c){if(0!==b.length){var d=b[b.length-1].endTime+c;_.sF(a,b[0].startTime+c);a.h=b.reduce(function(e,f){return Math.max(e,f.endTime-f.startTime)},a.h);_.tF(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)}};_.sF=function(a,b){a.w=null==a.w?b:Math.min(a.w,b)};_.tF=function(a,b){a.o=Math.max(a.o||0,b)};_.vF=function(a,b){a.h=Math.max(a.h,b);a.g.debug("notifyNewSegmentDuration: maxSegmentDuration\x3d"+a.h)};
|
|
34
|
+
_.xF=function(a){return 2===a.j.version?a.a.dc():Infinity===a.A?0:Math.max(0,wF(a)-a.A)};wF=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};zF=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(wF(a)-a.A+b,yF(a)))};
|
|
35
|
+
oF=function(a){return 2===a.j.version?a.a.dc():zF(a,0)};yF=function(a){var b=a.pe()&&!a.C?a.K:0;return 2===a.j.version?a.a.a-b:Math.max(0,wF(a)-b)};AF=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}};BF=function(){this.f=function(){};this.h=function(){};this.a=new Set};
|
|
36
|
+
CF=function(a,b,c){a.f=b;a.h=c};DF=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
|
+
EF=function(a,b){b=void 0===b?!1:b;return Array.from(a.a.values()).map(function(c){return AF(c,b)}).sort(function(c,d){return c.startTime-d.startTime})};FF=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 _.av("crop",a,d.endTime?d.endTime-a:Infinity,!1))};GF=function(a){var b=a.a.ji(),c=a.h,d=b?b.id:null;(c?c.id:null)!==d&&b&&a.f(new _.L(_.eg,{id:d}));a.h=b;"basic"===a.o.timeline&&(a.j.a=b)};
|
|
38
|
+
HF=function(a,b,c){this.h=a;this.a=b;this.f=c;this.g=new _.K("clpp.media.SegmentIterator")};IF=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};_.JF=function(a){this.a=a;this.g=new _.K("clpp.media.SegmentIndex")};_.KF=function(a){return a.a.length?a.a[a.a.length-1].endTime:0};_.LF=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
|
+
MF=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 HF(a,c,e)};_.fF=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
|
+
OF=function(a,b){this.h=a;this.l=NF(a);this.a=a.a.currentTime;this.j=Date.now()/1E3;this.o=b;this.f=function(){}};PF=function(a,b){a.f=b};QF=function(a){this.a=a};NF=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
|
+
SF=function(a,b,c,d,e){var f=this;this.a=a;this.H=b;this.l=c;this.G=e;this.h=new _.vi;this.C=!1;this.J=a.readyState;this.j=!1;this.f=d;this.B=this.o=this.I=this.A=!1;this.h.on(a,_.dh,function(){return RF(f)});this.w=(new _.li(function(){RF(f)})).Kb(.25)};
|
|
42
|
+
RF=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.j=!1,a.J=a.a.readyState);var b=a.l.smallGapLimit,c=a.a.currentTime,d=a.a.buffered;a:{var e=new _.Gm(d);var f=a.l.gapDetectionThreshold;if(e.length&&!(1===e.length&&1E-6>e.end(0)-e.start(0)))for(var g=0;g<e.length;g++)if(e.start(g)>c&&(0===g||e.end(g-1)-c<=f)){e=g;break a}e=null}if(null==e){if(a.f){a=a.f;d=a.h;c=NF(d);d=d.a.currentTime;b=Date.now()/1E3;if(a.a!==d||a.l!==c)a.j=
|
|
43
|
+
b,a.a=d,a.l=c;d=b-a.j;d>=a.o&&c&&a.f(a.a,d)}}else if((0!==e||a.A)&&a.I&&(f=d.start(e),!(f>=yF(a.H)))){g=f-c;b=g<=b;var h=!1;if(!(.001>g)){if(!b&&!a.j){a.j=!0;var l=new _.L("largegap",{detail:{currentTime:c,gapSize:g}});l.cancelable=!0;a.G(l);a.l.jumpLargeGaps&&!l.defaultPrevented?h=!0:_.$h("Ignoring large gap at",c,"size",g)}if(b||h)0===e?_.$h(wD,g,"seconds because of gap before start time of",f):_.$h(wD,g,"seconds because of gap starting at",d.end(e-1),"and ending at",f),a.B=!0,a.a.currentTime=f}}}}};
|
|
44
|
+
TF=function(a){var b=this;this.f=a;this.o=10;this.l=this.h=this.j=0;this.a=new _.li(function(){0>=b.j?(_.Wh(["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--)})};UF=function(a,b){a.h=a.f.currentTime;a.l=b;a.j=a.o;a.f.currentTime=b;a.a.Kb(.1)};XF=function(a,b,c,d){this.a=a;this.j=b;this.o=d;this.A=c;this.l=!1;this.f=new _.vi;this.h=new TF(a);this.w=!1;0<a.readyState?VF(this,c):WF(this,c)};
|
|
45
|
+
YF=function(a){return a.l?a.a.currentTime:a.A};ZF=function(a,b){0<a.a.readyState?UF(a.h,b):WF(a,b)};WF=function(a,b){a.A=b;a.f.off(a.a,_.Te);a.f.one(a.a,_.Te,function(){VF(a,b)})};VF=function(a,b){a.w||(a.w=!0,a.o&&a.o());.001>Math.abs(a.a.currentTime-b)?$F(a):(a.f.one(a.a,_.ig,function(){$F(a)}),UF(a.h,0===a.a.currentTime?b:a.a.currentTime))};$F=function(a){_.Ql()&&!a.l&&a.j();a.l=!0;a.f.on(a.a,_.ig,function(){return a.j()})};
|
|
46
|
+
dG=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 SF(a,b.presentationTimeline,c,aG(this,a,c),f);this.f=new XF(a,function(){a:{var l=h.j;var m=l.B;l.B=!1;l.C=!0;l.A=!1;l.j=!1;l=YF(h.f);var n=bG(h,l);if(.001<Math.abs(n-l)){var p=(new Date).getTime()/1E3;if(!h.w||h.w<p-1){h.w=p;ZF(h.f,n);m=void 0;break a}}h.g.debug("Seek to "+l);h.A(m?1:0);m=void 0}return m},cG(this,d,g),function(){h.j.I=!0});this.o=(new _.li(function(){if(0!==
|
|
47
|
+
h.h.readyState&&!h.h.paused){var l=YF(h.f),m=oF(h.a),n=yF(h.a);3>n-m&&(m=n-3);l<m&&(m=bG(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")};fG=function(a){var b=YF(a.f);return 0<a.h.readyState&&!a.h.paused?eG(a,b):b};cG=function(a,b,c){null==b?b=Infinity>a.a.getDuration()||c?oF(a.a):yF(a.a):0>b&&(b=yF(a.a)+b);return gG(a,eG(a,b))};
|
|
48
|
+
gG=function(a,b){var c=a.a.getDuration();return b>=c?c-a.l.durationBackoff:b};
|
|
49
|
+
bG=function(a,b){if("startover"===a.a.B)return b;var c=new _.Gm(a.h.buffered);c=c.Tb.bind(c);var d=Math.max(a.B,a.l.rebufferingGoal),e=a.l.safeSeekOffset,f=oF(a.a),g=yF(a.a),h=a.a.getDuration();3>g-f&&(f=g-3);var l=zF(a.a,d),m=zF(a.a,e);d=zF(a.a,d+e);if(b>=h)return a.g.debug("Playhead past duration."),gG(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};eG=function(a,b){var c=oF(a.a);if(b<c)return c;c=yF(a.a);return b>c?c:b};
|
|
51
|
+
aG=function(a,b,c){if(!c.stallEnabled)return null;var d=c.gapDetectionThreshold,e=c.stallSkip;c=new OF(new QF(b),c.stallThreshold);PF(c,function(f,g){a.g.warn("Stall detected at "+f+" for "+g+" seconds.");if(e){var h=new _.Gm(b.buffered),l;if(l=_.Ol("Edge/")||_.Ol("Trident/")||_.Mk()||_.Ql())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};iG=function(a){var b=this;this.f=a;this.a=new Set;this.h=(new _.li(function(){hG(b,!1)})).Kb(.25)};hG=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
|
+
jG=function(a,b){var c=a.offset||0;return b<a.startTime+c?1:b>a.endTime+c?3:2};
|
|
54
|
+
kG=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,Lc:function(c,d){return b.a(c,d)}},{Vc:1,Uc:2,Lc:function(c,d){return b.a(c,d)}},{Vc:3,Uc:2,Lc:function(c,d){return b.a(c,d)}},{Vc:2,Uc:1,Lc:function(c,d){return b.f(c,d)}},{Vc:2,Uc:3,Lc:function(c,d){return b.f(c,d)}},{Vc:1,Uc:3,Lc:function(c,d){return b.h(c,d)}},{Vc:3,Uc:1,Lc:function(c,d){return b.h(c,d)}}]};lG=function(a,b,c,d){a.a=b;a.f=c;a.h=d};
|
|
55
|
+
_.mG=function(a){_.gv[a]&&delete _.gv[a]};_.nG=function(a){_.ev[a]&&delete _.ev[a]};oG=function(){this.f=new _.hF(2);this.h=new _.hF(5);this.a=0};_.pG=function(a,b,c){if(!(16E3>c)){var d=8E3*c/b;b/=1E3;a.a+=c;_.iF(a.f,b,d);_.iF(a.h,b,d)}};qG=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};_.rG=function(a,b){this.id=a;this.ka=b};
|
|
56
|
+
_.sG=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()})};tG=function(a,b){_.Hm.call(this);this.A=a;this.h=null;this.B=b;this.C=new _.Jk;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
|
+
vG=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,Xh:b.defaultServiceLocation?b.defaultServiceLocation.split(","):[]};b.baseUriCollections.forEach(function(d){var e=[];if(a.h.Xh.length)for(var f=
|
|
58
|
+
{},g=_.w(a.h.Xh),h=g.next();!h.done;f={Ne:f.Ne},h=g.next())f.Ne=h.value,(h=d.ka.find(function(l){return function(m){return m.serviceLocationId===l.Ne}}(f)))?e.push(h):a.g.warn("setManifestConfig: could not get default location:","pathwayId: "+f.Ne+" 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"](uG(a));a.g.info("defaultServiceLocations: "+b.defaultServiceLocation);uG(a)}_.B(c)})};
|
|
59
|
+
_.xG=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.Od&&d>f.Od&&(f.Od=0,a.trigger(new _.L(_.$d,{detail:{serviceLocationId:g,banned:!1,bannedSeconds:0}})))});var e=c.filter(function(f){return 0===_.wG(a,f.serviceLocationId).Od});e.length||(e=c);e.length&&(c=a.w.get(b),qG(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 _.rG(b,e)};_.yG=function(a,b){var c=_.wG(a,b);c.Od=Date.now()+1E3*a.f;c.Ae=!1;a.g.info("service location "+b+" banned during "+a.f+TC);a.trigger(new _.L(_.$d,{detail:{serviceLocationId:b,banned:!0,bannedSeconds:a.f}}))};_.wG=function(a,b){var c=a.j.get(b);c||(c={Od:0,Uf:new oG,Ae:!1},a.j.set(b,c));return c};
|
|
61
|
+
uG=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=zG(a,b),a.g.info("Sending request to content steering server, URI: "+c),d=_.wk(c,a.A.attemptParameters),d.type=7,e=a.B.fetch(d),_.Kk(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;AG(a,a.f)}else try{h=_.T.da(f.data),l=JSON.parse(h),1===l.VERSION?BG(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 _.li(function(){uG(a)});AG(a,a.f)}_.B(m)})};
|
|
63
|
+
zG=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===_.Wc?(c.searchParams.set("_DASH_pathway",'"'+d.toString()+'"'),c.searchParams.set("_DASH_throughput",e.toString())):a.h.manifestType===_.tm&&(c.searchParams.set("_HLS_pathway",'"'+d.toString()+'"'),c.searchParams.set("_HLS_throughput",e.toString())):a.g.debug("addQueryParams_: serviceLocations EMPTY");return c.toString()};
|
|
64
|
+
CG=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={Kd:a.Kd,Yb:a.Yb,Ed:a.Ed},b=c.next())if(a.Kd=b.value,b=f.find(function(g){return function(h){return h.serviceLocationId===g.Kd}}(a)))e.push(b);else if(a.Yb=d.find(function(g){return function(h){return h.ID===g.Kd}}(a)),a.Yb&&(b=f.find(function(g){return function(h){return h.serviceLocationId===g.Yb["BASE-ID"]}}(a))))a.Ed={serviceLocationId:a.Kd,uri:b.uri,params:{}},a.Yb[MD]&&(a.Yb[MD].HOST&&
|
|
65
|
+
(b=new URL(b.uri),b.hostname=a.Yb[MD].HOST,a.Ed.uri=b.toString()),a.Yb[MD].PARAMS&&Object.entries(a.Yb[MD].PARAMS).forEach(function(g){return function(h){var l=_.w(h);h=l.next().value;l=l.next().value;g.Ed.params[h]=l}}(a))),e.push(a.Ed);return e};AG=function(a,b){a.g.info("Scheduling next steering manifest update in "+b+" s.");a.a.fa(b)};
|
|
66
|
+
BG=function(a,b,c){null!=a.a&&(a.a.stop(),a.a=null);var d=b["RELOAD-URI"]||c;a.a=new _.li(function(){uG(a,d)});if(c=b.TTL)a.f=c;AG(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=CG(a,h,e,f);a.l.set(h,l)})};DG=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
|
+
EG=function(a,b){if(b!==_.Vc){var c=_.Cv[b];if(!c)throw new _.O(_.P,2,2012,"Text parser is unavailable for "+b);a.w=new c(a.C)}};FG=function(a,b,c,d){return Promise.resolve().then(function(){if(a.w&&a.j)if(null==c||null==d)a.w.parseInit(_.Xj(b));else{var e={periodStart:a.A,segmentStart:c,segmentEnd:d};e=a.w.parseMedia(_.Xj(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
|
+
GG=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
|
+
HG=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 _.fj(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))};_.IG=function(a){a=a.toLowerCase();return _.Cv[a]||window.muxjs&&a===_.Vc?!0:!1};
|
|
71
|
+
JG=function(a,b){var c=String(_.dl++);c=new _.Xk(c,a);c.mimeType=_.Yk(b.mimeType);if(a===_.Zk||a===_.U)c.label=_.Yk(b.label),c.language=_.Yk(b.language),c.originalLanguage=_.Yk(b.originalLanguage);a===_.$k?(c.frameRate=b.frameRate,c.roles=b.roles,c.trickPlay=b.trickPlay):a===_.U?(c.channelsCount=b.channelsCount,c.roles=b.audioRoles||[],c.mimeType=_.Yk(b.audioMimeType)):(c.kind=_.Yk(b.kind),c.roles=b.roles);c.accessibility=a===_.$k||a===_.U?(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.g.debug("(
|
|
151
|
-
|
|
152
|
-
e
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
d.startTime;
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
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
|
+
KG=function(a,b,c){var d=new _.gl(a===_.$k?""+b.videoId:a===_.U?""+b.audioId:""+b.id,c);switch(a){case _.$k:d.codec=_.Yk(b.videoCodec);d.bandwidth=b.videoBandwidth||b.bandwidth;d.width=b.width;d.height=b.height;d.originalId=b.originalVideoId;break;case _.U:d.codec=_.Yk(b.audioCodec);d.bandwidth=b.audioBandwidth||b.bandwidth;d.originalId=b.originalAudioId;break;default:d.codec=_.Yk(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};LG=function(a,b){var c=a.reduce(function(d,e){b===_.$k?null===e.videoId||d[e.videoId]&&!e.activeVideo||(d[e.videoId]=e):b===_.U&&(null===e.audioId||d[e.audioId]&&!e.activeAudio||(d[e.audioId]=e));return d},{});return Object.values(c)};MG=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
|
+
NG=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};_.OG=function(a,b){a.forEach(function(c){c.startTime+=b;c.endTime+=b})};PG=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}};QG=function(a){return Object.assign({},a,{periods:a.periods.map(function(b){return Object.assign({},b)})})};
|
|
76
|
+
RG=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=_.th(a[0].periods).concat(),d={},e=1;e<a.length;d={Oe:d.Oe},e++)d.Oe=PG(a[e-1]).end,_.OG(a[e].periods,d.Oe),c.push.apply(c,_.th(a[e].periods)),a[e].cues.forEach(function(f){return function(g){g.offset=f.Oe}}(d));d=a.flatMap(function(f){return f.cues});c={periods:c,presentationTimeline:b,minBufferTime:0,cues:d};d=PG(c).end;_.mF(b.a,0,d);(d=
|
|
77
|
+
a[0].presentationTimeline.Jc())&&_.pF(b,d.seekRangeStartDateTime);return c};TG=function(a,b){try{if(1===a.length)return a[0];if(!a.every(SG))throw new _.mj("Period durations must be finite");return RG(a,b)}catch(c){throw new _.O(_.P,7,7003,"Failed to join manifests into a continuous playlist!",c);}};
|
|
78
|
+
UG=function(a,b){var c=b.periods[0].configurationId,d=_.th(a.periods).concat().filter(function(f){return f.configurationId!==c}),e=a.presentationTimeline;d={periods:d,presentationTimeline:e,minBufferTime:0};_.qF(e,b.presentationTimeline.l);return TG([d,b],e)};SG=function(a){return a.periods.every(function(b){return null!=b.endTime&&0<=b.endTime&&isFinite(b.endTime)})};
|
|
79
|
+
VG=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}};WG=function(a,b){return b.find(function(c){return c.id===a.id})||null};XG=function(){this.g=new _.K("clpp.mse.TrackManager");this.m=null;this.h=[];this.a=new Map;this.f=new Map};YG=function(a,b){return a.h.filter(function(c){return c.type===b})};ZG=function(a,b){var c=a.a.get(b)||null;return c&&c.track};
|
|
80
|
+
$G=function(a,b,c){if(!c||ZG(a,c.type)!==c||a.m.wa())switch(c=c?c.renditions[0]||null:null,b){case _.$k:a.ub(c);break;case _.U:a.Hb(c);break;case _.Zk:a.Ib(c);break;default:throw Error("Unknown track type "+b);}};aH=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)};bH=function(a,b,c){return a.m.wa()?!0:(a.a.get(c)||null)===b?!1:!0};
|
|
81
|
+
cH=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
|
+
fH=function(a,b,c){cH(a,b,_.$k);if(bH(a,b,_.$k)){var d=a.m;a.g.info("Set video rendition with ID: "+b.id);var e=a.a.get(_.U)||null,f=null;if(e&&!e.a){var g=dH(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=dH(d).find(function(l){return l.videoId===parseInt(b.id,10)})||null;f?(a.f.set(_.$k,b),eH(d,f,c)):a.g.warn("Cannot find matching variant")}};
|
|
84
|
+
iH=function(a,b){var c,d,e;_.I(function(f){if(1==f.a){c=_.Zk;cH(a,b,c);if(!bH(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);_.C(f,2);aH(a,b);return _.y(f,gH(a.m,!0),4)}if(2!=f.a)return hH(a.m,d),a.m.trigger(new _.L(_.Bg)),_.Hh(f,0);e=_.E(f);a.g.warn("Failed to set text rendition",e);_.B(f)})};
|
|
85
|
+
jH=function(a){var b,c,d;_.I(function(e){if(1==e.a){b=_.Zk;c=ZG(a,b);if(!c)return e["return"]();a.g.info("Unset text rendition.");_.C(e,2);return _.y(e,gH(a.m,!1),4)}if(2!=e.a)return a.a.set(b,null),a.m.trigger(new _.L(_.Bg)),_.Hh(e,0);d=_.E(e);a.g.warn("Failed to unset text rendition",d);_.B(e)})};
|
|
86
|
+
nH=function(a){if(a.m){a.g.debug("Track list change detected, updating track list");for(var b=[],c=_.w(Object.values(_.ww)),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={Ac:c.Ac},e=d.next()){e=e.value;c.Ac=JG(_.Zk,e);var f=b.find(function(h){return function(l){return h.Ac.qa(l)}}(c));c.Ac=f||c.Ac;var g=KG(_.Zk,e,c.Ac);e.activeText&&a.a.set(_.Zk,g);f||b.push(c.Ac)}kH(a.m)||a.a.set(_.Zk,null);c=dH(a.m);lH(a,b,c,_.$k);lH(a,
|
|
87
|
+
b,c,_.U);mH(a,b);a.h=b}};lH=function(a,b,c,d){var e=LG(c,d);c={};e=_.w(e);for(var f=e.next();!f.done;c={Bc:c.Bc},f=e.next()){f=f.value;c.Bc=JG(d,f);var g=b.find(function(l){return function(m){return l.Bc.qa(m)}}(c));c.Bc=g||c.Bc;var h=KG(d,f,c.Bc);(d===_.$k&&f.activeVideo||d===_.U&&f.activeAudio)&&a.a.set(d,h);g||b.push(c.Bc)}};
|
|
88
|
+
mH=function(a,b){var c=a.m;if(c.f){var d=(d=oH(c))?pH(c.l,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(_.dl++),e=new _.Xk(e,_.U),e.mimeType="",e.label=c.label,e.language=c.language,e.originalLanguage=c.language,e.channelsCount=c.channelsCount,e.roles=[],e.accessibility=[],f=new _.gl(""+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(_.U,e.renditions[0])};rH=function(a,b,c,d){a.h.length||nH(a);var e=a.a.get(c)||null;(b=qH(a,b,c))&&e!==b&&(aH(a,b),c===_.U?a.m.trigger(new _.L(_.jd)):c===_.$k&&a.m.trigger(new _.L(_.$g,{details:{width:b.width||0,height:b.height||0,bandwidth:b.bandwidth,track:b.track,abrSelection:d}})))};qH=function(a,b,c){return YG(a,c).flatMap(function(d){return d.renditions}).find(function(d){return parseInt(d.id,10)===b})||null};
|
|
90
|
+
sH=function(){this.a=new muxjs.mp4.CaptionParser;this.l=[];this.j={}};_.tH=function(){};_.vH=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 _.vi;this.I=!1;this.w={};this.H=b;this.B=d;this.L=e;this.P=this.L.streaming.maxSegmentToMediaOffset||1;this.J=new _.Gk;this.A="";this.G={};this.o=uH(this,this.J);this.M=!0;this.g=new _.K("clpp.mse.MediaSourceEngine")};
|
|
91
|
+
wH=function(a){var b=_.Jl(a.mimeType,a.codecs),c=LE(a);return _.IG(b)||_.Bu(c)||(_.Il(b,a.type)?!0:!1)};uH=function(a,b){if(window.ManagedMediaSource){a.j.disableRemotePlayback=!0;var c=new ManagedMediaSource;a.l.one(c,hE,function(){URL.revokeObjectURL(a.A);b.resolve()});a.l.on(c,iE,function(){a.M=!0});a.l.on(c,"endstreaming",function(){a.M=!1});a.A=xH(c);a.j.src=a.A;return c}c=new MediaSource;a.A=xH(c);a.l.one(c,hE,function(){URL.revokeObjectURL(a.A);b.resolve()});a.j.src=a.A;return c};
|
|
92
|
+
yH=function(a,b){b.forEach(function(c,d){var e=a.a[d];e&&(a.l.off(e,_.ze),a.l.off(e,lE),a.o.removeSourceBuffer(e),delete a.a[d]);e=a.o.addSourceBuffer(c);a.l.on(e,_.ze,a.$k.bind(a,d));a.l.on(e,lE,a.md.bind(a,d));a.a[d]=e;a.h[d]=[];a.G[d]=!1})};zH=function(a,b){try{return new _.Gm(a.a[b].buffered,b)}catch(c){return b in a.a&&a.g.error(XD+b,c),null}};AH=function(a,b){if(!a.a[b])return"";var c=zH(a,b);return c?c.toString():""};
|
|
93
|
+
CH=function(a,b,c,d,e){return[BH(a,b,a.Zk.bind(a,b)),BH(a,b,a.Ih.bind(a,b,c)),BH(a,b,a.al.bind(a,b,d,e))]};BH=function(a,b,c){if(a.I)return Promise.reject();c={start:c,p:new _.Gk};a.h[b].push(c);1===a.h[b].length&&DH(a,b);return c.p};DH=function(a,b){var c=a.h[b][0];if(c)try{a.g.debug(LD+b),c.start()}catch(d){d.name===DD?c.p.reject(new _.O(_.P,3,3017,{type:b})):c.p.reject(new _.O(_.P,3,3015,{mediaError:d})),EH(a,b)}else a.g.debug(yD+b)};
|
|
94
|
+
FH=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 _.Gk,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();_.C(p,2);return _.y(p,Promise.all(c),4);case 4:_.Hh(p,3);break;case 2:g=_.E(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);_.C(p,5,6);return _.y(p,b(),6);case 6:_.Ih(p);for(m in a.a)EH(a,
|
|
95
|
+
m);_.Jh(p);break;case 5:return n=_.E(p),p["return"](Promise.reject(new _.O(_.P,3,3015,{mediaError:n})))}})};EH=function(a,b){a.h[b].shift();DH(a,b)};
|
|
96
|
+
LH=function(a,b,c,d){var e=a.periods.flatMap(function(n){return n.variants});if(b.length||c.length)e=GH(e,b,c);e=HH(e,d);if(1<a.periods.length){var f=function(n){n=n.split(".");var p=n[0];1<n.length&&(p+="."+n[1]);return p.toLowerCase()};b=[];c=_.w(a.periods);for(var g=c.next();!g.done;g=c.next()){d=new Set;g=_.w(g.value.variants);for(var h=g.next();!h.done;h=g.next())h=h.value,null!==h.audio&&d.add(f(h.audio.codecs));b.push(d)}var l=b[0];c={};for(d=1;d<b.length;c={Kf:c.Kf},d++)c.Kf=b[d],l=new Set(_.th(l).concat().filter(function(n){return function(p){return n.Kf.has(p)}}(c)));
|
|
97
|
+
e=e.filter(function(n){return 0===l.size&&null===n.audio?!0:0<l.size&&null===n.audio?!1:l.has(f(n.audio.codecs))})}e=IH(e);var m=JH(e);a=_.w(a.periods);for(e=a.next();!e.done;e=a.next())e=e.value,e.variants=e.variants.filter(function(n){if(KH(n)===m)return!0;_.ai("Dropping Variant (better codec available)",n);return!1})};
|
|
98
|
+
MH=function(a,b,c,d){var e=a.periods.flatMap(function(f){return f.variants});if(b.length||c.length)e=GH(e,b,c);e=HH(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)})};IH=function(a){var b=new _.si;a=_.w(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=KH(c);b.push(d,c)}return b};
|
|
99
|
+
GH=function(a,b,c){if(!b.length&&!c.length)return a;var d=a.filter(function(g){return(g=g.audio)&&c.length&&(g=_.NE(g.codecs),c.includes(g))?!0:!1}),e=a.filter(function(g){return(g=g.video)&&b.length&&(g=_.NE(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
|
+
JH=function(a){var b="",c=Infinity;nE(a,function(d,e){var f=e.reduce(function(g,h){return g+h.bandwidth||0},0)/e.length;_.ai(_.Md,d,"avg bandwidth",f);f<c&&(b=d,c=f)});return b};KH=function(a){var b="";a.video&&(b=_.NE(a.video.codecs));var c="";a.audio&&(c=_.NE(a.audio.codecs));return b+"-"+c};
|
|
101
|
+
NH=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};OH=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=NH(e,b);f!==e.allowedByApplication&&(c=!0)}return c};
|
|
102
|
+
RH=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&&!wE(a,n))return _.ai("Dropping variant - not compatible with key system",n),!1;var p=n.audio,q=n.video;if(p&&!wH(p)){var u=p.codecs;0<=p.codecs.indexOf(_.ve)?(_.ai("Trying to use AC-3 for EC-3"),p.codecs=p.codecs.replace(_.ve,"ac-3"),wH(p)?_.$h("Using AC-3 instead of EC-3 for",PH(p)):(p.codecs=u,_.$h(ED,PH(p)),n.audio=null,f=!0,p=null)):(_.$h(ED,PH(p)),n.audio=null,f=!0,p=null)}return q&&!wH(q)?
|
|
103
|
+
(_.$h("Dropping variant - video not compatible with platform",PH(q)),!1):p&&b&&!QH(p,b,e)?(_.$h("Dropping variant - not compatible with active audio","active audio",PH(b),"variant.audio",PH(p)),!1):q&&c&&!QH(q,c,e)?(_.$h("Dropping variant - not compatible with active video","active video",PH(c),"variant.video",PH(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?(_.$h("Dropping variant - not compatible with video + audio","variant.video",PH(n.video)),!1):!0}))}d.textStreams=d.textStreams.filter(function(n){var p=_.IG(_.Jl(n.mimeType,n.codecs));p||_.ai("Dropping text stream. Is not supported by the platform.",n);return p})};QH=function(a,b,c){return a.mimeType!==b.mimeType||(void 0===c||c)&&a.codecs.split(".")[0]!==b.codecs.split(".")[0]?!1:!0};
|
|
105
|
+
SH=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(u){return u?u.accessibility||[]:[]}).reduce(function(u,v){return u.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
|
+
TH=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}};UH=function(a){return a.allowedByApplication&&a.allowedByKeySystem};
|
|
110
|
+
HH=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
|
+
_.WH=function(a,b,c,d){b=_.Ui(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=_.IE(_.Oj(h),a.map(function(m){return m.language}));return l?(e=a.filter(function(m){return _.Oj(m.language)===l}),!0):!1});d&&e.some(function(h){return h.kind===_.Be})&&(e=e.filter(function(h){return h.kind===_.Be}));if(c){b=VH(e,c);if(b.length)return b;_.Wh("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(_.BE,[]);return b.length?VH(e,b[0]):e};VH=function(a,b){return a.filter(function(c){return c.roles.includes(b)})};
|
|
113
|
+
PH=function(a){var b=LE(a);return a.type===_.cd?"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
|
+
_.XH=function(){this.g=new _.K("clpp.abr");this.A=null;this.l=!1;this.w=new oG;this.f=[];this.o=1;this.C=this.B=!1;this.j=this.a=this.h=null};YH=function(a,b,c){if(a.j&&a.a.useCmsd){var d=zE(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 NH(e,b)}));return a.sort(function(e,f){return e.bandwidth-f.bandwidth})};ZH=function(){this.a=null};
|
|
115
|
+
aI=function(a,b){if(b&&(null==a.a||a.a!==b))throw $H(a);};$H=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.")};bI=function(){this.a=new Map};pH=function(a,b){a.a.has(b)||a.a.set(b,new cI);return a.a.get(b)};cI=function(){this.text=this.video=this.fb=this.audio=null};dI=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
|
+
gI=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||eI(d,e))&&fI(d.roles,e.roles))}!d&&(d=a.video&&b.video)&&(a=a.video,b=b.video,d=!((!c||eI(a,b))&&fI(a.roles,b.roles)));return d?!1:!0};
|
|
117
|
+
eI=function(a,b){if(a.mimeType!==b.mimeType)return!1;var c=ME(a.codecs).map(function(f){return _.NE(f)}),d=ME(b.codecs).map(function(f){return _.NE(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};fI=function(a,b){var c=new Set(a),d=new Set(b);c["delete"](_.Ve);d["delete"](_.Ve);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
|
+
iI=function(a){var b=void 0===b?_.Tf:b;this.f=a;this.a=b;this.h=new hI(a.language,"",a.audio&&a.audio.channelsCount?a.audio.channelsCount:0,!1,b)};hI=function(a,b,c,d,e){this.j=_.Ui(a);this.a=b;this.f=c;this.l=void 0===d?!1:d;this.h=void 0===e?_.Tf:e};jI=function(a,b){var c=null;b.some(function(d){c=_.IE(_.Oj(d),a.map(function(e){return HE(e)}));return!!c});return c?a.filter(function(d){return c===HE(d)}):[]};
|
|
119
|
+
kI=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)})};lI=function(a,b){return a.filter(function(c){return c.audio&&c.audio.spatialAudio!==b?!1:!0})};oI=function(a,b){this.a=mI;this.f=(new Map).set(mI,b).set(nI,a)};
|
|
120
|
+
qI=function(a){var b=this;this.D=a;this.a=a.getConfiguration().streaming;this.f=new _.vi;this.g=new _.K("clpp.mse.media.LiveEdgeObserver");pI(this)&&(a=this.D.getSurface().getMedia(),this.f.on(a,_.Gg,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
|
+
pI=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
|
+
sI=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 _.vi;this.K=!1;this.w={};this.I=b;this.B=d;this.J=e;this.U=this.J.streaming.maxSegmentToMediaOffset||1;this.L=new _.Gk;this.A="";this.H={};this.o=rI(this,this.L);this.P=!0;this.g=new _.K("clpp.mse.MediaSourceEngineSmooth")};
|
|
124
|
+
rI=function(a,b){if(window.ManagedMediaSource){a.j.disableRemotePlayback=!0;var c=new ManagedMediaSource;a.l.one(c,hE,function(){URL.revokeObjectURL(a.A);b.resolve()});a.l.on(c,iE,function(){a.P=!0});a.l.on(c,"endstreaming",function(){a.P=!1});a.A=tI(c);a.j.src=a.A;return c}c=new MediaSource;a.A=tI(c);a.l.one(c,hE,function(){URL.revokeObjectURL(a.A);b.resolve()});a.j.src=a.A;return c};
|
|
125
|
+
uI=function(a,b){b.forEach(function(c,d){var e=a.o.addSourceBuffer(c);a.l.on(e,_.ze,a.Yk.bind(a,d));a.l.on(e,lE,a.Ec.bind(a,d));a.a[d]=e;a.G[d]=c;a.h[d]=[];a.H[d]=!1});a.M=b.has(_.cd)&&b.has(_.r)};vI=function(a,b){try{return new _.Gm(a.a[b].buffered,b)}catch(c){return b in a.a&&a.g.error(XD+b,c),null}};wI=function(a,b){if(!a.a[b])return"";var c=vI(a,b);return c?c.toString():""};
|
|
126
|
+
zI=function(a,b,c,d,e,f){return[f?Promise.resolve():xI(a,b,function(){try{a.g.debug(aD+b+PC);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(oD+b+PC,l),l;}a.g.debug(iD+b+PC);a.Ec(b)}),xI(a,b,function(){return yI(a,b,c)}),xI(a,b,function(){try{a.g.debug(HD+b,d,e),a.a[b].appendWindowStart=0,a.a[b].appendWindowEnd=e,a.a[b].appendWindowStart=d}catch(g){throw a.g.warn(sD+b,d,e,g),g;}a.g.debug(mD+b,d,e);a.Ec(b)})]};
|
|
127
|
+
yI=function(a,b,c){0>c&&(c+=.001);try{a.g.debug(JD+b,c),a.a[b].timestampOffset=c}catch(d){throw a.g.warn(tD+b,c,d),d;}a.g.debug(nD+b,c);a.Ec(b)};xI=function(a,b,c){if(a.K)return Promise.reject();c={start:c,p:new _.Gk};a.h[b].push(c);1===a.h[b].length&&AI(a,b);return c.p};AI=function(a,b){var c=a.h[b][0];if(c)try{a.g.debug(LD+b),c.start()}catch(d){d.name===DD?c.p.reject(new _.O(_.P,3,3017,{type:b})):c.p.reject(new _.O(_.P,3,3015,{mediaError:d})),BI(a,b)}else a.g.debug(yD+b)};
|
|
128
|
+
CI=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 _.Gk,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();_.C(p,2);return _.y(p,Promise.all(c),4);case 4:_.Hh(p,3);break;case 2:g=_.E(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);_.C(p,5,6);return _.y(p,b(),6);case 6:_.Ih(p);for(m in a.a)BI(a,
|
|
129
|
+
m);_.Jh(p);break;case 5:return n=_.E(p),p["return"](Promise.reject(new _.O(_.P,3,3015,{mediaError:n})))}})};BI=function(a,b){a.h[b].shift();AI(a,b)};DI=function(a,b,c){return xI(a,b,function(){b===_.Q?a.g.debug("Change not supported for "+b):(a.g.debug("Change Type: "+a.G[b]+" -\x3e "+c),UE()?(a.a[b].changeType(c),a.G[b]=c):a.g.debug("Change Type not supported"),a.Ec(b))})};
|
|
130
|
+
EI=function(a,b,c,d){var e,f,g,h,l;return _.I(function(m){return 1==m.a?(e=_.NE(_.Ll(a.G[b])),f=_.Kl(a.G[b]),g=_.Jl(c,d),h=_.NE(_.Ll(g)),l=_.Kl(g),e===h&&f===l?m["return"](!1):a.J.mediaSource.codecSwitchingStrategy===_.ng&&UE()?_.y(m,DI(a,b,g),2):m.F(2)):m["return"](!0)})};FI=function(a){this.h=a;this.a=null;this.f=function(){}};GI=function(a,b){a.f=b};
|
|
131
|
+
HI=function(a){var b=this;this.f=a;this.o=this.A=this.l=!1;this.h=this.f.ri();this.w=_.ce;this.j=null;this.a=new _.li(function(){b.A||b.f.Sm(.25*b.h)});this.g=new _.K("clpp.mse.media.PlayRateController")};II=function(a,b){a.j=b;a.j.speedUpMode&&(a.w=a.j.speedUpMode)};
|
|
132
|
+
LI=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{JI(a,c)}catch(d){a.g.warn('Set playbackRate using "decoder" mode fails, due to unsupported range by platform. Fallback to "seek" mode.',d),KI(a)}else KI(a)};KI=function(a){a.g.debug(ID,a.h,' using "seek" mode.');JI(a,0);a.o=!0;a.a.Kb(.25)};JI=function(a,b){if(a.f.ri()!==b){a.g.debug(ID,b,' using native playbackRate "decoder" mode.');try{a.f.yo(b)}catch(c){throw c;}}};
|
|
133
|
+
NI=function(a){function b(){d=!0}function c(m){f.push(m);_.Dn(m)}a=_.Xj(a);var d=!1,e,f=[],g=[];(new _.Cn).N(_.bf,c).N(_.Ig,c).N(_.Xe,c).N(_.af,c).N(_.sg,c).aa(_.ug,function(m){e=m;f.push(m);_.En(m)}).aa("encv",b).aa("enca",b).aa("avc1",function(m){g.push({N:m,zd:1701733238})}).aa("avc3",function(m){g.push({N:m,zd:1701733238})}).aa("ac-3",function(m){g.push({N:m,zd:1701733217})}).aa(_.ve,function(m){g.push({N:m,zd:1701733217})}).aa("mp4a",function(m){g.push({N:m,zd:1701733217})}).parse(a);if(d)return _.$h("Init segment already indicates encryption."),
|
|
134
|
+
a;if(0===g.length||!e)throw _.bi("Failed to find boxes needed to fake encryption!"),_.bi("Failed init segment (hex):",_.lk(a)),new _.O(_.P,3,14E3);g.reverse();for(var h=_.w(g),l=h.next();!l.done;l=h.next())l=l.value,_.$h('Inserting "'+_.Hn(l.zd)+'" box into init segment.'),a=MI(a,e,l.N,f,l.zd);return a};
|
|
135
|
+
MI=function(a,b,c,d,e){var f=OI.value(),g=a.subarray(c.start,c.start+c.size),h=_.ek(g),l=new Uint8Array(c.size+f.byteLength);l.set(g,0);g=_.ek(l);g.setUint32(4,e);l.set(f,c.size);e=h.getUint32(4);g.setUint32(c.size+16,e);PI(l,0,l.byteLength);e=new Uint8Array(a.byteLength+l.byteLength);c=_.Ol("Xbox One")||_.Nl()?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,PI(e,d.start,d.size+l.byteLength);l=_.ek(e,
|
|
136
|
+
b.start);b=_.In(b);a=l.getUint32(b);l.setUint32(b,a+1);return e};PI=function(a,b,c){a=_.ek(a,b);b=a.getUint32(0);0!==b&&(1===b?(a.setUint32(8,c>>32),a.setUint32(12,c&4294967295)):a.setUint32(0,c))};_.RI=function(a,b){this.D=b;this.j=a;QI(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
|
+
TI=function(a){var b=a.a.get(_.r);return b?SI(a,b.hc):(b=a.a.get(_.cd))?SI(a,b.hc):null};VI=function(a){return _.UI(a,_.cd)};WI=function(a){return _.UI(a,_.r)};
|
|
138
|
+
aJ=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=_.dr,_.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,XI(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=YI(a,m);if(null==n)return a.g.warn("Cannot set up text media state, period not found at",
|
|
139
|
+
m),q["return"]();p=ZI(b,n,0);a.a.set(c.TEXT,p);$I(a,p,0)}_.B(q)}})};dJ=function(a){a.J=!0;var b=a.a.get(_.Q);b&&(a.g.info("Unload text stream"),bJ(b),cJ(b)["catch"](function(){}),a.a["delete"](_.Q))};eJ=function(a){var b,c;return _.I(function(d){if(1==d.a){b=_.dr;c=a.a.get(b.AUDIO);if(!c)return d.F(0);a.g.info("Unload audio stream");bJ(c);return _.y(d,cJ(c)["catch"](function(){}),3)}a.a["delete"](b.AUDIO);_.B(d)})};gJ=function(a,b,c,d){b.video&&_.fJ(a,b.video,c,d);b.audio&&_.fJ(a,b.audio,c,d)};
|
|
140
|
+
iJ=function(a){var b,c;_.I(function(d){if(1==d.a){if(a.A)return d["return"]();a.A=!0;return _.y(d,eJ(a),2)}b=_.dr;c=a.a.get(b.VIDEO);return _.y(d,hJ(a,c),0)})};kJ=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,jJ(a,b,null,null,c),2)}_.fJ(a,b,!0,0);_.B(d)})};mJ=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;QI(a.j);lJ(a)};
|
|
141
|
+
QI=function(a){a.periods.every(function(b){return typeof b.id===_.tg})};
|
|
142
|
+
nJ=function(a){function b(l){return a.D.X.Tb(l,c,0)}var c=a.D.Qb(),d=!1,e=YI(a,c);if(_.Uj(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)||(hJ(a,h),d=!0)}else if(!_.Uj(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())hJ(a,f.value);d=!0}d||a.g.debug("(all): seeked: buffered seek: presentationTime\x3d"+
|
|
143
|
+
c)};qJ=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=oJ(d);if(d.vd||b&&pJ(d))a.g.info(e,"Retrying after failure..."),d.vd=!1,$I(a,d,.1)}};rJ=function(a){return Array.from(a.a.values()).some(function(b){return null!==b.vb})};
|
|
144
|
+
sJ=function(a){var b=Array.from(a.a.values());return a.C&&b.every(function(c){return c.endOfStream})};uJ=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,bJ(e),e.Fb&&e.jc&&(e.Fb=!1,b.push(e.jc.abort())),e.nc&&b.push(tJ(a,e,!0,0));return _.y(f,Promise.all(b),0)})};vJ=function(a,b,c){(a=a.a.get(b))&&c&&(bJ(a),a.stream=c,a.qc=c,a.ta&&(a.ta=c.getSegmentReference(a.ta.position)),a.ta||(a.qc=null))};
|
|
145
|
+
_.UI=function(a,b){var c=a.a.get(b);return c?c.vc||c.stream:null};
|
|
146
|
+
_.fJ=function(a,b,c,d){var e=a.a.get(b.type);if(!e&&b.type===_.Q&&a.h.ignoreTextStreamFailures)aJ(a,b);else if(e){var f=wJ(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())hJ(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
|
+
xJ(a,f)&&yJ(a,b.id))if(e.stream!==b){var g=a.j.presentationTimeline.getDuration(),h=a.D.Qb();h=zJ(a,e,h);!c&&(e.endOfStream||h>=g)?a.g.debug(kE+oJ(e)+" already buffered to the end. Not switching."):(b.type===_.Q&&a.D.X.uc(_.Jl(b.mimeType,b.codecs)),e.stream=b,e.stream.segmentIterator=null,e.nf=!0,a.g.debug("switch: switching to Stream "+oJ(e)),AJ(a,e,f)&&(a.g.info("Aborting current segment request to switch."),e.jc.abort()),c&&(e.Cc?e.Gf=!0:e.Fb?(e.nc=!0,e.Se=d,e.Gf=!0):(bJ(e),tJ(a,e,!0,d)["catch"](function(l){if(a.D)a.D.onError(l)}))))}else a.g.debug(kE+
|
|
148
|
+
oJ(e)+" already active")}};xJ=function(a,b){var c=a.B.get(b);return!(!c||!c.Bf)};yJ=function(a,b){var c=a.w.get(b);return!(!c||!c.Bf)};AJ=function(a,b,c){if(!b.jc)return!1;var d=a.D.Qb(),e=a.D.X.la(b.type);c=(c=BJ(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};
|
|
149
|
+
hJ=function(a,b){var c,d;return _.I(function(e){c=oJ(b);if(b.Cc)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.Se=0,e["return"]();d=b.type;if(null==a.D.X.Ua(d))return a.g.debug(c,"clear: nothing buffered"),null==b.vb&&$I(a,b,0),e["return"]();a.g.debug(c,"clear: handling right now");bJ(b);return _.y(e,tJ(a,b,!1,0)["catch"](function(f){if(a.D)a.D.onError(f)}),
|
|
150
|
+
0)})};
|
|
151
|
+
jJ=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=YI(a,f);if(null==g)return a.g.warn("Cannot initialize streams, period not found at",f),q["return"]();h=_.dr;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"]();lJ(a);return _.y(q,XI(a,m),3)}if(a.f)return q["return"]();l.forEach(function(u,v){if(!a.a.has(v)){var z=
|
|
152
|
+
ZI(u,g,e);a.a.set(v,z);$I(a,z,0)}});_.B(q)})};ZI=function(a,b,c){return{stream:a,type:a.type,qc:null,segmentIterator:null,ta:null,vc:null,nf:!0,hc:b,endOfStream:!1,Fb:!1,vb:null,nc:!1,Se:0,Gf:!1,Cc:!1,Mg:!1,vd:!1,tj:c||0,jc:null,Ye:!1,Ni:0}};DJ=function(a){a.g.debug("(all) setupAllPeriods_");a.j.periods.map(function(b){return b.id}).forEach(function(b){CJ(a,b)["catch"](CE)})};
|
|
153
|
+
CJ=function(a,b){var c=a.B.get(b);if(c)return a.g.debug("(all) Period "+b+RC),c;a.g.debug("(all) setting up Period "+b);var d=new _.Gk;a.B.set(b,d);var e=new Set;c=SI(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:XI(a,e)}).then(function(){a.f||(d.resolve(),
|
|
154
|
+
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};
|
|
155
|
+
XI=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,u,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+RC),c.push(g)):(a.g.debug("(all) setting up Stream "+f.id),a.w.set(f.id,new _.Gk),h=a.D.Eb,c.push(f.createSegmentIndex(h)));_.C(z,2);return _.y(z,Promise.all(c),4);case 4:if(a.f)return z["return"]();_.Hh(z,3);break;case 2:l=_.E(z);if(a.f)return z["return"]();m=_.w(b);for(e=m.next();!e.done;e=m.next())if(n=
|
|
156
|
+
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())u=e.value,(v=a.w.get(u.id))&&!v.done&&(v.resolve(),a.g.debug("(all) setup Stream "+u.id));_.B(z)}})};lJ=function(a){var b=a.j.presentationTimeline.getDuration();Infinity>b?a.D.X.eg(b):a.D.X.eg(Math.pow(2,32))};
|
|
157
|
+
GJ=function(a,b){function c(n){return n.type===_.Q&&n.stream.mimeType===_.Vc}if(c(b))return a.D.X.Hh(b.stream.originalId||""),null;b.type===_.Q&&a.D.X.zh();if(!a.D.X.Ji()&&b.type!==_.Q)return a.h.bufferLimitUpdateInterval?a.h.bufferLimitUpdateInterval/2:.5;var d=oJ(b),e=a.D.Qb(),f=zJ(a,b,e);a.g.debug(d,"timeNeeded\x3d"+f);var g=a.D.X.Ga(b.type,e);a.g.debug(d,"update_:",dE+e,"bufferedAhead\x3d"+g);var h=Math.max(a.j.minBufferTime||0,a.h.rebufferingGoal,a.h.bufferingGoal)*a.l,l=rF(a.j.presentationTimeline);
|
|
158
|
+
if(null!=l&&f>=l&&!b.Ye)return EJ(a,b),null;b.endOfStream=!1;l=wJ(a,b.stream).id;var m=YI(a,f);null!=m&&(b.hc=m);if(m!==l)return a.g.debug(d,"need Period "+m,dE+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=BJ(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."),EJ(a,b),
|
|
159
|
+
null);d=Infinity;h=_.w(a.a.values());for(m=h.next();!m.done;m=h.next())m=m.value,c(m)||(m=zJ(a,m,e),d=Math.min(d,m));if(f>=d+a.j.presentationTimeline.h)return a.h.bufferLimitUpdateInterval||1;b.tj=0;FJ(a,b,e,l,g)["catch"](function(){});return null};EJ=function(a,b){a.g.debug(oJ(b),"buffered to end of presentation");b.endOfStream=!0;if(b.type===_.r){var c=a.a.get(_.Q);c&&c.stream.mimeType===_.Vc&&(c.endOfStream=!0)}};
|
|
160
|
+
zJ=function(a,b,c){return b.qc&&b.ta?wJ(a,b.qc).startTime+b.ta.endTime:Math.max(c,b.tj)};
|
|
161
|
+
BJ=function(a,b,c,d,e){if(null==e)return a.g.warn(fD),null;if(b.stream.segmentLookupStrategy===_.ZD)b.stream.segmentIterator?a=IF(b.stream.segmentIterator):b.ta||d?(c=b.ta?b.ta.endTime:d,a.g.info(vD,"looking up segment from new stream endTime:",c),b.stream.segmentIterator=MF(b.stream.segmentIndex,c),e=b.stream.segmentIterator.next().value,null===e&&(b.stream.segmentIterator=null,a.g.warn(vD,TD,"endTime:",c,b.ta)),a=e):(e=SI(a,e),e=Math.max(0,c-e.startTime),a.g.info(vD,"looking up segment","lookupTime:",
|
|
162
|
+
e,cE,c),d=null,d||(b.stream.segmentIterator=MF(b.stream.segmentIndex,e),d=b.stream.segmentIterator.next().value),null===d&&a.g.warn(vD,TD,"lookupTime:",e,cE,c),a=d);else{var f=oJ(b);if(b.ta&&b.stream===b.qc)c=b.ta.position+1,a.g.debug(f,"next position known:","position\x3d"+c),a=HJ(a,b,e,c);else{if(b.ta){a.g.debug(f,"next position unknown: another Stream buffered");f=wJ(a,b.qc);var g=IJ(a,b,f.startTime+b.ta.endTime,e)}else a.g.debug(f,"next position unknown: nothing buffered"),g=IJ(a,b,d||c,e);if(null==
|
|
163
|
+
g)a=null;else if(f=HJ(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=HJ(a,b,e,Math.max(0,g-1)))&&(f=a));a=f}}}return a};IJ=function(a,b,c,d){var e=oJ(b);d=SI(a,d);var f=Math.max(0,c-d.startTime);b=b.stream.findSegmentPosition(f);a.g.debug(e,"Looked up segment:",dE+c,"lookupTime\x3d"+f,VD+d.startTime,"Result: segment position\x3d"+b);null==b&&a.g.warn(e,"cannot find segment:",VD+d.startTime,"lookupTime\x3d"+f);return b};
|
|
164
|
+
HJ=function(a,b,c,d){var e=oJ(b);if(null==c)return a.g.warn(e,fD),null;c=SI(a,c);var f=b.stream.getSegmentReference(d);if(!f)return a.g.debug(e,"segment does not exist:",VD+c.startTime,"position\x3d"+d),null;var g=a.j.presentationTimeline;d=_.xF(g);g=wF(g);return!b.Ye&&(c.startTime+f.endTime<d||c.startTime+f.startTime>g)?(a.g.debug(e,"segment is not available:",VD+c.startTime,gE+f.startTime,eE+f.endTime,"availabilityStart\x3d"+d,"availabilityEnd\x3d"+g),null):f};
|
|
165
|
+
FJ=function(a,b,c,d,e){var f,g,h,l,m,n,p,q,u,v,z,A,H;return _.I(function(G){f=_.dr;g=oJ(b);h=SI(a,d);a.g.debug(g,"fetchAndAppend_:",dE+c,VD+h.startTime,fE+e.position,gE+e.startTime,eE+e.endTime);l=b.stream;m=b.stream.segmentIterator;n=a.j.presentationTimeline.getDuration();p=JJ(a,d);q=Math.max(0,h.startTime-.1);u=p?p.startTime+.01:n;v=KJ(a,b,h,q,u,e);b.Fb=!0;b.nf=!1;a.g.debug(g,"fetching segment");z=!1;A=function(D,F){if(a.f||a.o)return null;z=!0;return LJ(a,b,c,h,l,e,D,F)};H=a.D.X.la(b.type)||0;
|
|
166
|
+
v.then(function(){return a.f||a.o?null:MJ(a,b,e,!1,function(D){return A(D.data,!0)})}).then(function(D){return a.f||a.o?null:z||null===D?(NJ(a,b,H,e,l),null):A(D,!1)}).then(function(){if(!a.f&&!a.o){NJ(a,b,H,e,l);b.Fb=!1;b.Mg=!1;b.nc||a.D.vf();if(m){var D=m.next().value;D&&a.g.debug("New iterated segment",D)}$I(a,b,0);OJ(a,b,l);a.g.debug(g,"finished fetch and append")}})["catch"](function(D){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===
|
|
167
|
+
D.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===D.code)return b.Fb=!1,b.vb=null,$I(a,b,0),F.F(0);if(3017===D.code)return PJ(a,b,D),F.F(0);if(1001===D.code&&D.data&&404===D.data[1])return a.g.warn(g,"request for segment failed","segment not available on server",fE+e.position,gE+e.startTime,eE+e.endTime,"error\x3d"+D),b.Fb=!1,b.vb=null,$I(a,b,1),F.F(0);if(b.type===f.TEXT)return D instanceof
|
|
168
|
+
_.O&&D.a(1),bJ(b),a.D.onError(new _.O(1,2,2010,D)),F.F(0);if(1001<=D.code&&1003>=D.code)return _.y(F,QJ(a,b,h,D),0);a.g.error(g,"failed fetch and append: code\x3d"+D.code);b.vd=!0;D instanceof _.O&&D.a(_.P);return _.y(F,RJ(a,D),0)})});_.B(G)})};
|
|
169
|
+
PJ=function(a,b,c){var d=oJ(b);if(Array.from(a.a.values()).some(function(f){return f!==b&&f.Mg}))a.g.debug(d,xD,"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.vd=!0;a.o=!0;a.D.onError(c);return}a.g.warn(d,xD,"reducing buffering goals by "+(100-Math.round(100*a.l))+"%");b.Mg=!0}$I(a,b,4)};
|
|
170
|
+
QJ=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.vd=!0;d.a(_.P);return _.y(g,RJ(a,d),0)})};
|
|
171
|
+
KJ=function(a,b,c,d,e,f){var g,h,l,m,n,p,q;return _.I(function(u){g=c.startTime-f.Ja;h=b.nf||f.initSegment!==(b.ta&&b.ta.initSegment);if(!h&&g===b.Ni)return u["return"](Promise.resolve());b.Ni=g;l=oJ(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.vj(b.type,g,d,e,b.stream.mimeType,b.stream.codecs);if(!b.stream.initSegmentReference||!h)return u["return"](m);a.g.debug(l,"fetching init segment");
|
|
172
|
+
n=f&&f.initSegment||b.stream.initSegmentReference;p=MJ(a,b,n,!0);q=p.then(function(v){if(a.f)return null;a.g.debug(l,"appending init segment");return SJ(a,v,b).then(function(){return a.D.X.Ue(b.type,v,null,null,!!b.stream.closedCaptions&&0<b.stream.closedCaptions.size)})})["catch"](function(v){b.nf=!0;return Promise.reject(v)});return u["return"](Promise.all([m,q]))})};
|
|
173
|
+
SJ=function(a,b,c){var d;return _.I(function(e){if(!a.h.patchEdgeWhenMixedContent||!_.Nl())return e.F(0);d=NI(b);return _.y(e,a.D.X.Ue(c.type,d.buffer,null,null,!!c.stream.closedCaptions&&0<c.stream.closedCaptions.size),0)})};
|
|
174
|
+
LJ=function(a,b,c,d,e,f,g,h){h=void 0===h?!1:h;var l,m,n,p,q,u,v,z;return _.I(function(A){switch(A.a){case 1:l=oJ(b);if(!(e&&e.keyId&&a.D.Zd)){A.F(2);break}m=tE(a.D.Zd,e.keyId);if(!m){a.g.warn("Unable to find DRM session for "+e.keyId);A.F(2);break}_.C(A,4);return _.y(A,m,6);case 6:_.Hh(A,2);break;case 4:_.E(A),a.g.warn("DRM session load failed, cannot append segment!");case 2:if(!(e.encrypted&&e.keyId&&a.D.Zd&&vE(a.D.Zd,e.keyId))){A.F(7);break}bJ(b);n=wJ(a,e).id;p=TJ(a,n);if(!p){A.F(8);break}return _.y(A,
|
|
175
|
+
p,8);case 8:return q=a.D.Wf(e,d,$D),u=f.startTime+d.startTime,v=f.endTime+d.startTime,a.g.warn(l,"Blocked append for "+u+" - "+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 _.Cn).aa("emsg",a.On.bind(a,d,f,e.emsgSchemeIdUris)).parse(g),A["return"](UJ(a,b,c).then(function(){if(a.f)return null;var H=f.startTime+d.startTime,G=f.endTime+
|
|
176
|
+
d.startTime;a.g.debug(l,"Appending segment with "+(H.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.Ue(b.type,g,H,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)}))}})};
|
|
177
|
+
NJ=function(a,b,c,d,e){if(!a.j.presentationTimeline.isLive()&&b.type!==_.Q){var f=oJ(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.Ye=!0,a=a.j.periods,e.adjustSegmentDurations(d.position,c),d=eF(a,e),b=a[d],e=e.getDuration(),gF(b,e),e=d+1;e<a.length;e++)a[e].startTime+=c}};
|
|
178
|
+
VJ=function(a,b,c){(new _.Cn).N(_.bf,_.Dn).N(_.Ig,_.Dn).N(_.Xe,_.Dn).N(_.af,_.Dn).N(_.sg,_.Dn).aa(_.ug,_.En).N("encv",function(d){d.reader.skip(78);_.Dn(d)}).N(_.mg,_.Dn).N("schi",_.Dn).N("tenc",function(d){d.reader.skip(6);if(_.vn(d.reader)){d.reader.skip(1);var e=_.lk(_.Bn(d.reader,16));e!==b.stream.keyId&&(a.g.debug(oJ(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)};
|
|
179
|
+
UJ=function(a,b,c){if(a.f)return Promise.resolve();var d=oJ(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:",dE+c,QD+e),Promise.resolve();var g=c-f,h=g-e;if(.01>=h)return a.g.debug(d,"buffer behind okay:",dE+c,RD+g,QD+e,"underflow\x3d"+Math.abs(h)),Promise.resolve();a.g.debug(d,"buffer behind too large:",dE+c,RD+g,QD+e,"overflow\x3d"+h);return a.D.X.remove(b.type,
|
|
180
|
+
f,f+h).then(function(){a.f||a.g.debug(d,"evicted "+h+TC)})};OJ=function(a,b,c){if(!a.C){b=oJ(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.Cc&&e.ta}):a.G&&(a.C=!0);a.C&&(a.g.debug(b,"startup complete"),c=wJ(a,c).id,JJ(a,c),TJ(a,c))}};TJ=function(a,b){var c=null;a.B.has(b)||(c=CJ(a,b).then(function(){a.f||(a.g.debug(SD),a.D.xg())})["catch"](CE));DJ(a);a.D.In&&(a.g.debug("calling onStartupComplete()..."),a.D.In());return c};
|
|
181
|
+
WJ=function(a,b){var c=oJ(b),d=wJ(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(pJ)?(a.g.debug(c,"all need Period "+e),CJ(a,e).then(function(){if(!a.f)if(a.D.X.sj(),f.every(function(n){var p=pJ(n),q=wJ(a,n.stream).id;return p&&n.hc===e&&q!==e})){var g=SI(a,e);a.g.debug(c,"Streaming period",e,g);a.g.debug(c,"calling onChooseStreams()...");var h=a.D.yg(g);a.G=!h.audio&&!h.video&&!!h.text;var l=new Map;h.video&&l.set(_.r,h.video);h.audio&&
|
|
182
|
+
l.set(_.cd,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)jJ(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()));
|
|
183
|
+
for(h=g.next();!h.done;h=g.next())h=h.value,(m=l.get(h))?(_.fJ(a,m,!1,0),$I(a,a.a.get(h),0)):a.a["delete"](h);a.g.debug(c,SD);a.D.xg()}else a.g.debug(c,"ignoring transition to Period",e,"since another is happening")})["catch"](CE)):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)}};YI=function(a,b){var c=cF(a.j.periods,b+_.qw);return c?c.id:null};
|
|
184
|
+
wJ=function(a,b){var c=a.j.periods,d=eF(c,b);c=c[d];if(!c)throw new _.O(_.P,5,5006,"No period found for stream with ID "+b.id+".");return c};XJ=function(a,b){if(a.D.od){var c=b.Ta;if(c)return _.xG(a.D.od,c.id)}return null};YJ=function(a,b,c){if(a.D.od&&b){c&&0===c.request.uriIndex||_.yG(a.D.od,b.ka[0].serviceLocationId);var d=c.request,e=c.timeMs;c=c.data.byteLength;e&&c&&(a=_.wG(a.D.od,b.ka[d.uriIndex].serviceLocationId),_.pG(a.Uf,e,c),a.Ae=!0)}};
|
|
185
|
+
MJ=function(a,b,c,d,e){d=void 0===d?!1:d;e=void 0===e?null:e;var f=[],g=XJ(a,c);g&&(f=_.sG(g,c.ye));f.length||(f=c.eb());f=_.kF(f,c.Da,c.pa,a.h.attemptParameters,c.startTime,c.endTime,b.type,c.timescale);f.type=2;f.onFragment=c.qd?null:e;f.disableFragmentSupport=c.qd||a.h.disableFragmentSupport;f.disableMergedFragments=a.h.disableMergedFragments;if(e=c.f())f.keyInfo=e,f.onFragment=null;d&&(f.responseModifiers.push(function(h){VJ(a,b,h.data)}),b.type===_.r&&a.h.overridePasp&&f.responseModifiers.push(a.Qo.bind(a)));
|
|
186
|
+
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);YJ(a,g,h);b.jc=null;return h.data})["catch"](function(h){YJ(a,g);throw h;})};
|
|
187
|
+
tJ=function(a,b,c,d){var e,f,g,h;return _.I(function(l){if(1==l.a)return e=oJ(b),b.nc=!1,b.Gf=!1,b.Se=0,b.Cc=!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.Cc=!1;b.endOfStream=!1;b.Ye=!1;$I(a,b,0);_.B(l)})};
|
|
188
|
+
$I=function(a,b,c){a.g.debug(oJ(b),"updating in "+c+TC);b.vb=(new _.ji(function(){var d;return _.I(function(e){if(1==e.a)return _.C(e,2),_.y(e,a.ic(b),4);if(2!=e.a)return _.Hh(e,0);d=_.E(e);if(a.D)a.D.onError(d);_.B(e)})})).fa(c)};bJ=function(a){null!=a.vb&&(a.vb.stop(),a.vb=null)};SI=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};
|
|
189
|
+
JJ=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};cJ=function(a){return _.I(function(b){return a.jc?_.y(b,a.jc.abort(),0):b.F(0)})};RJ=function(a,b){var c;return _.I(function(d){switch(d.a){case 1:if(a.f)return d["return"]();if(!a.D.yj){d.F(2);break}_.C(d,3);return _.y(d,a.D.yj(b),5);case 5:_.Hh(d,2);break;case 3:c=_.E(d),c.cause=b,b=c;case 2:if(!b.f)a.D.onError(b);_.B(d)}})};oJ=function(a){return"("+a.type+":"+a.stream.id+")"};
|
|
190
|
+
pJ=function(a){return!a.Fb&&null==a.vb&&!a.nc&&!a.Cc};ZJ=function(){this.a=null};
|
|
191
|
+
bK=function(){_.Sm.call(this,UD);var a=this;this.I=$J;this.j=this.ha=null;this.fh=0;this.Cj=2;this.ed=null;this.Yg=!1;this.o=new _.vi;this.bd=this.ih=this.hf=this.J=this.dd=this.C=this.M=this.B=null;this.ke=!1;this.f=this.w=this.a=this.L=this.K=null;this.h=new _.XH;this.ca=null;this.jh=1E9;this.mf=new Set;this.Ea=!0;this.ya=null;this.Ej=!1;this.Dj=0;this.ea=null;this.l=new bI;this.H=null;this.Lb=_.Gq;this.be=new hI(this.configuration.preferredAudioLanguage||[],this.configuration.preferredAudioRole,
|
|
192
|
+
this.configuration.preferredAudioChannelCount,this.configuration.preferSpatialAudio,this.configuration.mediaSource.codecSwitchingStrategy);this.Wd=this.configuration.preferredTextLanguage;this.A=new ZH;this.ja=this.Zb=null;this.Wc=new Map;this.de=null;this.gf=this.configuration.preferredTextRole;this.Pd=this.configuration.preferForcedSubtitles;this.o.on(window,"online",function(){a.I===aK&&qJ(a.a)});this.qf=this.$d=this.xf=null;this.Y=_.qa;this.ne=new ZJ;this.bh=null};
|
|
193
|
+
cK=function(a){return new _.WE(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,_.th(e.value.renditions))}return d.find(function(f){return f.id===b.toString()})||null})};
|
|
194
|
+
dK=function(a,b){if(a.Lb!==b){var c=_.T.Ml;if(a.Lb===_.Rq&&b!==_.Gq)c=c(b,_.Pq),a.log.info(_.BD+c);else{var d=a.fh;d=0===d?0:Date.now()-d;var e=a.Lb;a.Lb=b;a.fh=Date.now();null!==a.J&&(a.J.A=b===_.Tq);a.H&&_.zq(a.H.a,a.Lb);b===_.Lq&&(a.Cj=a.Pg?1:2);var f=a.Cj,g={currentState:a.Lb,previousState:e,timeSinceLastStateChangeMS:d,reason:b===_.Lq||e===_.Lq?f:void 0},h=c(e,_.Pq),l=c(b,_.Pq);c=b!==_.Lq?"":"["+c(f,_.Oq)+"]";a.log.info(_.Mb+h+" -\x3e "+(l+c));a.trigger(new _.L(_.qg,{detail:g}));(b===_.Nq||b===
|
|
195
|
+
_.Rq)&&a.bd&&a.bd.stop();b===_.Lq?a.trigger(new _.L(_.od,{detail:{bufferedTimeMS:-1,reason:f}})):e===_.Lq&&a.trigger(new _.L(_.nd,{detail:{bufferedTimeMS:d,reason:f}}))}}};eK=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,_.Sm.prototype.release.call(a),4);case 4:return _.y(c,a.unload(),5);case 5:dK(a,_.Gq),_.B(c)}})};
|
|
196
|
+
fK=function(a){var b=new _.bv;(a=a.playlist)&&a.cropTimeline&&(a.startTime||a.endTime)&&(b.h={start:a.startTime||null,end:a.endTime||null});return b};iK=function(a,b){var c,d;return _.I(function(e){a.Y===_.qa?gK(a,b.cues):a.Y===_.Hb?(a.f=UG(a.f,QG(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.w.requestStop(),a.w=null,_.qF(a.f.presentationTimeline,!0),a.trigger(new _.L(_.Qe))),hK(a,a.f)):mJ(a.a,b);_.B(e)})};
|
|
197
|
+
FK=function(a){return _.I(function(b){a.w.requestStop();a.w=null;a.Y===_.Hb?a.trigger(new _.L(_.fg)):a.trigger(new _.L(_.Qe));_.B(b)})};
|
|
198
|
+
hK=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 _.av(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));AE(d,c);a:if(c=d.a,f.length!==c.length)f=!1;else{for(d=
|
|
199
|
+
0;d<f.length;d++)if(!f[d].qa(c[d])){f=!1;break a}f=!0}!f&&a.trigger(new _.L(_.gg));GF(a.qf);DF(a.L,b.cues)};LK=function(a){var b,c;return _.I(function(d){if(1==d.a)return GK(a),_.y(d,HK(a),2);if(3!=d.a){IK(a);b=_.Mk(4)||_.Mk(5);if(!b)return d.F(3);c=a.getSurface().getMedia();JK(a,c);return _.y(d,KK(a,c),3)}a.configuration=a.kb;_.B(d)})};
|
|
200
|
+
MK=function(a,b){return _.I(function(c){if(1==c.a){if(!a.configuration.contentSteering.enabled)return c.F(2);if(a.ca)return c.F(3);a.ca=new tG(a.configuration.contentSteering,a.getNetworkEngine());a.ca.on(_.Zd,function(d){a.trigger(d)});return _.y(c,vG(a.ca,b),3)}return 2!=c.a?c["return"](a.ca):c["return"](null)})};
|
|
201
|
+
TK=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 _.Gk,a.A.a=e,_.C(l,2),GK(a),_.y(l,NK(a),4);case 4:return aI(a.A,e),a.ba=_.Yq(b),a.configuration=_.Qm(a.kb,b),TE(a.configuration.xmlParser),a.bh&&a.configuration.mse.sendPlaybackSessionIdHeader&&a.getNetworkEngine().headers.set(PD,a.bh),a.log.info(_.sb,a.configuration),a.log.info(_.Lb,a.ba),_.y(l,OK(a,e),5);case 5:return aI(a.A,e),_.y(l,PK(a,b,a.getSourceIndex(),e,!1),6);case 6:return f=
|
|
202
|
+
l.f,aI(a.A,e),a.w=f.parser,a.f=f.manifest,gK(a,f.manifest.cues),g=a,_.y(l,QK(a,a.f,a.configuration),7);case 7:g.B=l.f;aI(a.A,e);if(!c){l.F(8);break}return _.y(l,RK(a,e),9);case 9:aI(a.A,e),a.o.one(a.j,_.Se,function(){var m=Date.now()/1E3-d;a.H&&(a.H.B=m)});case 8:e.resolve();_.Hh(l,0);break;case 2:h=_.E(l),SK(a,h,e),_.B(l)}})};gK=function(a,b){if(a.configuration.ads.hls.mockCuesFn){var c=a.configuration.ads.hls.mockCuesFn(a);DF(a.L,c)}else DF(a.L,b)};
|
|
203
|
+
SK=function(a,b,c){b=UK(a,b,c);c["catch"](function(){});c.reject(b);a.onError(b);throw b;};UK=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):$H(a.A)};NK=function(a){return a.ha?a.ha["catch"](function(){}):Promise.resolve()};
|
|
204
|
+
OK=function(a,b){var c;return _.I(function(d){if(1==d.a)return a.H=new _.Eq,dK(a,_.Sq),c=VK(a,a.configuration),_.y(d,KK(a,c),2);aI(a.A,b);a.L=new BF;CF(a.L,function(e){a.log.info("Timeline cue found",e);WK(a,_.Cg,e)},function(){a.log.info("Timeline cues changed");a.trigger(new _.L(_.Fg))});_.B(d)})};
|
|
205
|
+
PK=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=_.Yq(f),h=g[c],_.y(n,XK(a,h),2);case 2:return l=n.f,aI(a.A,d),_.mp(aE),_.y(n,YK(a,l,h,f.id||""),3);case 3:m=n.f;aI(a.A,d);if(!e||!m.presentationTimeline.l){n.F(4);break}return _.y(n,l.stop(),5);case 5:aI(a.A,d);case 4:return _.mp("manifest.end"),_.op("Fetch and parse manifest",aE,"manifest.end"),n["return"]({parser:l,manifest:m})}})};
|
|
206
|
+
ZK=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a)return _.y(f,PK(a,b,0,null,!0),2);c=f.f;try{return d=[a.f,QG(c.manifest)],e=TG(d,a.f.presentationTimeline),f["return"]({parser:c.parser,manifest:e})}catch(g){throw new _.O(_.P,7,7003,"Failed to append load manifest");}})};VK=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);JK(a,c);return c};
|
|
207
|
+
JK=function(a,b){a.j||(a.o.on(b,_.ze,function(){if(a.j.error){var c=a.j.error.code;if(1===c)c=null;else{var d=a.j.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.j.error.message})}}else c=null;if(c)a.onError(c)}),a.j=b)};IK=function(a){a.j&&(a.o.off(a.j,_.ze),a.j=null)};
|
|
208
|
+
HK=function(a){var b;return _.I(function(c){switch(c.a){case 1:a.I!==$K&&(a.I=$J);if(b=a.j)a.o.off(b,_.Se),a.o.off(b,_.Kf),a.o.off(b,_.rf),a.o.off(b,_.ye),a.o.off(b,_.Xf),a.o.off(b,_.Vf);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.w){c.F(2);break}return _.y(c,a.w.stop(),3);case 3:a.w=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.ca){c.F(8);break}return _.y(c,
|
|
209
|
+
a.ca.destroy(),9);case 9:a.ca=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.hf&&(a.hf.release(),a.hf=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.l.clear(),a.K=null,a.mf.clear(),a.f=null,a.H=null,a.Ea=!0,a.Wc.clear(),a.ke=!1,aL(a),_.B(c)}})};
|
|
210
|
+
KK=function(a,b){var c,d,e,f,g;return _.I(function(h){if(1==h.a)return c=window.muxjs?new sH:new _.tH,d=_.xq(a.configuration,[_.Ge,"single-native"]),e=d.create(a),a.U=e,f=cK(a),f.track(a),a.ed=f,g=null,bL(a)?g=new sI(b,c,e,f,a.configuration):g=new _.vH(b,c,e,f,a.configuration),_.y(h,g.open(),2);a.M=g;_.B(h)})};
|
|
211
|
+
XK=function(a,b){var c,d;return _.I(function(e){if(1==e.a)return c=a.getNetworkEngine(),_.y(e,_.dv(b.url,c,a.configuration.manifest.attemptParameters,b.type||null),2);d=e.f;d.configure(a.configuration.manifest);return e["return"](d)})};
|
|
212
|
+
YK=function(a,b,c,d){return(new _.Hk(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}_.C(h,4);var l=c.url;var m=cL(a,d);l=b.start(l,m);return _.y(h,l,6);case 6:e=h.f;_.Hh(h,2);break;case 4:f=_.E(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);dL(e.periods);return h["return"](e)}})}),function(){a.log.info("Aborting parser step...");
|
|
210
213
|
return b.stop()})).T};
|
|
211
|
-
|
|
212
|
-
if(z.length){z=a.getPeriods();for(var H=0;H<z.length;H++)for(var G=z[H],D=_.w(G.variants),F=D.next();!F.done;F=D.next()){F=F.value;var M=[];F.audio&&M.push(F.audio);F.video&&M.push(F.video);M=_.w(M);for(var
|
|
213
|
-
(
|
|
214
|
-
e=b.periods.every(function(q){return q.variants.some(function(u){return u.drmInfos.some(function(v){return v.licenseServerUriOrigin===_.
|
|
214
|
+
QK=function(a,b,c){var d,e,f,g,h,l,m,n;return _.I(function(p){switch(p.a){case 1:_.mp("initDrm.start");d=new _.tp({Eb:a.getNetworkEngine(),onError:function(q){return a.onError(q)},Bg:function(q){if(a.a){var u=oH(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.");
|
|
215
|
+
if(z.length){z=a.getPeriods();for(var H=0;H<z.length;H++)for(var G=z[H],D=_.w(G.variants),F=D.next();!F.done;F=D.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 V=q[A?"00":R.keyId];V=!!V&&!eL.includes(V);F.allowedByKeySystem=V}la!==F.allowedByKeySystem&&(V=R.type,R.type===_.r&&(V="video "+R.width+"x"+R.height+"@"+_.T.Vf(R.bandwidth)),a.log.warn("DRM Key not available for KID: '"+
|
|
216
|
+
(R.keyId+"'. Applying restrictions to "+V)));G===u&&la!==F.allowedByKeySystem&&(v=!0)}}}if(q=TI(a.a)){A=VI(a.a);z=WI(a.a);a:{H=q.variants;for(G=0;G<H.length;G++)if(H[G].audio===A&&H[G].video===z){A=H[G];break a}A=null}if(!A||A.allowedByKeySystem)a.log.info(gD),fL(a),gL(a,q.variants)}v&&q!==u&&(a.log.info(gD),fL(a),gL(a,u.variants))}},Ag:function(q,u){a.trigger(new _.L(_.me,{expirationTime:u}))},onEvent:function(q){return a.bg(q)},getConfiguration:function(){return a.getConfiguration()},ud:function(){return a.ud()}});
|
|
217
|
+
e=b.periods.every(function(q){return q.variants.some(function(u){return u.drmInfos.some(function(v){return v.licenseServerUriOrigin===_.WD})})});c.drmResolver&&(c.drm=c.drmResolver({hasLaurl:e}));f=c.drm;g=_.ln(f);d.f=g;h=f?f.offlineId||"":"";l=[];m=_.Vu(b.periods);if(!h){p.F(2);break}n=_.Um(_.sf);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,_.yp(d,m,l),6);case 6:return a.B=d,hL(a,b.periods),_.mp("initDrm.end"),_.op("Init DRM","initDrm.start",
|
|
215
218
|
"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
|
-
if(l){var m=l.renditions.map(function(n){return n.id});h=f.find(function(n){return m.find(function(p){return p===String(n.video.id)})})}}}else h=f[0];if(!h)throw Error("Variant with target audio track not found.");if(
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
b).
|
|
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
|
-
_.
|
|
219
|
+
RK=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.j,iL(a,c),jL(a,a.f.periods),a.be=new hI(a.configuration.preferredAudioLanguage||[],a.configuration.preferredAudioRole,a.configuration.preferredAudioChannelCount,a.configuration.preferSpatialAudio,a.configuration.mediaSource.codecSwitchingStrategy),a.Wd=a.configuration.preferredTextLanguage,a.gf=a.configuration.preferredTextRole,a.Pd=a.configuration.preferForcedSubtitles,_.y(q,_.Qp(a.B,c),2);if(3!=q.a)return aI(a.A,
|
|
220
|
+
b),a.h.configure(a.configuration.abr),a.Kg&&a.h.setCmsdManager(a.Kg),a.h.init(function(u,v,z){if(!a.Ea){var A=oH(a);(u=WG(u,A.variants))?kL(a,u,v,z):a.log.warn("No matching variant found for track switch")}}),a.C=lL(a,c,a.configuration.startTime),a.dd=mL(a),a.J=new HI({ri:function(){return c.playbackRate},yo:function(u){c.playbackRate=u},Sm:function(u){c.currentTime+=u}}),II(a.J,a.configuration.trickPlay),a.isLive()&&a.configuration.streaming.enableLiveEdgeChasing&&(a.hf=new qI(a)),d=Math.max(1E-4,
|
|
221
|
+
a.configuration.streaming.rebufferingGoal),nL(a,d),bL(a)?MH(a.f,_.Ui(a.configuration.preferredVideoCodec),_.Ui(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount):LH(a.f,_.Ui(a.configuration.preferredVideoCodec),_.Ui(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount),e=oL(a),e.h=a.configuration.streaming,a.a=e,a.I=aK,_.y(q,e.start(),3);aI(a.A,b);a.configuration.streaming.startAtSegmentBoundary&&(f=fG(a.C),g=pL(a,f),ZF(a.C.f,g));h=_.w(a.f.periods);
|
|
222
|
+
for(l=h.next();!l.done;l=h.next())m=l.value,qL(a,m);fL(a);n=oH(a)||a.f.periods[0];p=n.variants.some(function(u){return u.primary});a.configuration.preferredAudioLanguage||p||a.log.warn("No preferred audio language set. We will choose an arbitrary language initially");gL(a,n.variants);_.B(q)})};
|
|
223
|
+
iL=function(a,b){function c(d){a.j&&a.K&&(d.type===_.ig&&a.qe?(a.K.a=nI,aL(a)):d.type===_.dh&&a.getState()===_.Uq&&.1>a.getBufferInfo().Ga(a.getMediaPosition())?(a.K.a=nI,aL(a)):a.K&&rL(a));sL(a)}a.o.on(b,_.Kf,c);a.o.on(b,_.rf,c);a.o.on(b,_.ye,c);a.o.on(b,_.ig,c);a.o.on(b,_.hg,c);a.o.on(b,_.Vf,c);a.o.on(b,_.dh,c);a.o.on(b,_.Xf,function(){if(a.j){var d=a.j.playbackRate;0!==d&&a.J.set(d)}})};
|
|
224
|
+
dL=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)})){_.ai("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)}};lL=function(a,b,c){return new dG(b,a.f,a.configuration.streaming,c,function(d){a.dd&&hG(a.dd,!0,d);a.a&&nJ(a.a)},function(d){return a.dispatchEvent(d)},a.Y===_.Hb)};
|
|
225
|
+
mL=function(a){var b=new iG(a.j),c=new FI(a.f);GI(c,function(){fL(a)});b.a.add(c);a.L&&(c=new kG(a.L),lG(c,function(d){d.tf&&d.tf();WK(a,_.Dg,d)},function(d){d.zg&&d.zg();WK(a,_.Eg,d)},function(d,e){e||(d.tf&&d.tf(),WK(a,_.Dg,d),d.zg&&d.zg(),WK(a,_.Eg,d))}),b.a.add(c));a.Y===_.Hb&&(c=new FF(a.$d,a.ne,function(d){return a.trigger(d)},a.configuration.playlist),b.a.add(c),a.qf=c);return b};nL=function(a,b){a.K=new oI(b,Math.min(.5,b/2));a.K.a=nI;aL(a);a.bd=(new _.li(function(){rL(a)})).Kb(.25)};
|
|
226
|
+
rL=function(a){switch(a.I){case aK:a:if(a.j.ended||a.M.Ve())var b=!0;else{if(a.isLive()){b=wF(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.mg();c=d.video;d=d.audio;var e=a.j.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?mI:nI;d.a=c;d=e!==c}c=d;d=tL(a);c||a.getState()===_.Lq&&!d?(a.log.debug("Buffering state changed. Is buffering",
|
|
227
|
+
d,"buffered to end",b,"state",a.getState()),aL(a)):a.ke&&sL(a)};oL=function(a){var b={configuration:{Im:a.Y===_.Hb},Qb:function(){return fG(a.C)},X:a.M,Eb:a.getNetworkEngine(),od:a.ca,yg:a.Xk.bind(a),xg:a.Wk.bind(a),onError:a.onError.bind(a),Wi:a.qn.bind(a),onEvent:a.bg.bind(a),aj:a.Po.bind(a),vf:a.Dn.bind(a),ee:function(){return a.h},Wf:a.ak.bind(a),yj:a.Fo.bind(a),Zd:a.B};return new _.RI(a.f,b)};
|
|
228
|
+
dH=function(a){if(!a.f||!a.C)return[];var b=uL(a),c=vL(a),d=[];a=_.w(wL(a));for(var e=a.next();!e.done;e=a.next()){e=e.value;var f=SH(e);f.activeVideo=e.video===b;f.activeAudio=e.audio===c;d.push(f)}return d};hH=function(a,b){if(a.f&&a.a){var c=oH(a),d=c.textStreams.find(function(e){return e.id===b.id});d?(xL(a,c,d,!1),yL(a,d),a.Wd=d.language,a.Pd=d.kind===_.Be):a.log.error(_.zD,b.id)}};
|
|
229
|
+
eH=function(a,b,c){c=void 0===c?!1:c;var d=void 0===d?0:d;if(!a.f||!a.a)throw Error("Player not ready to select tracks.");var e=oH(a);if(!e)throw Error(AD);if(b){a.configuration.abr.enabled&&(a.log.info("Disable ABR and enable manual track selection to select "+(b.width+"x"+b.height+"@"+b.bandwidth)),a.configuration.abr.enabled=!1,a.h.disable());var f=e.variants.find(function(g){return g.id===b.id});if(!f)throw a.log.error("No variant with id",b.id),Error("Variant not found.");if(!UH(f))throw a.log.error("Unable to switch to restricted track",
|
|
230
|
+
b.id),Error("Unable to switch to restricted track.");a.ja=f.video.id;pH(a.l,e).fb?f.video&&(zL(a,e,f.video,!1),_.fJ(a.a,f.video,c,d)):(AL(a,e,f,!1),BL(a,f,c,d));null==a.de&&(a.de=a.be);a.be=new iI(f);gL(a,e.variants)}else a.ja=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()),c=gL(a,e.variants).variant,null==c||a.Ea||kL(a,c)};
|
|
231
|
+
DL=function(a,b){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.");var c=(a.f.muxedAudioTracks||[]).find(function(n){return n.id===b});if(c)CL(a,c);else{var d=WI(a.a),e=VI(a.a);c=oH(a);if(!c)throw Error(AD);var f=c.variants.filter(function(n){return n.audio.id===b&&UH(n)}),g=!1,h=void 0;if(d){if(h=f.find(function(n){return n.video.id===d.id}),!h){a.log.debug("Cannot find exact variant, looking for anything else that matches with given audioId");
|
|
232
|
+
g=!0;var l=a.getTrackManager().Na();if(l){var m=l.renditions.map(function(n){return n.id});h=f.find(function(n){return m.find(function(p){return p===String(n.video.id)})})}}}else h=f[0];if(!h)throw Error("Variant with target audio track not found.");if(!pH(a.l,c).fb&&e.codecs.split(".")[0]!==h.audio.codecs.split(".")[0])throw a.log.warn("Cannot select audio track, codecs are not compatible with active track."),Error("Audio codecs not compatible with active audio.");e=h.audio;a.Zb=e.id;f=f.map(VG);
|
|
233
|
+
a.h.setTracks(f);AL(a,c,h,!1);g||a.Ea?BL(a,h,!0,0):kJ(a.a,e)}};CL=function(a,b){var c=oH(a);if(!c)throw Error(AD);var d=c.variants.filter(function(g){return g.video&&g.video.muxedAudioId===b.groupId&&UH(g)});if(0===d.length)throw Error("No variants containing muxed audio found.");var e=d[0],f=WI(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),EL(a,c,b,!1),iJ(a.a))};
|
|
234
|
+
kH=function(a){var b=a.Yg;return a.f?a.M.getTextDisplayer().isTextVisible():b};gH=function(a,b){var c,d,e,f;return _.I(function(g){c=a.Yg;d=b;if(c===d)return g["return"]();a.Yg=d;if(a.I!==aK)return g.F(0);a.M.getTextDisplayer().setTextVisibility(b);if(a.configuration.streaming.alwaysStreamText)return g.F(0);if(!b)return dJ(a.a),g.F(0);e=oH(a);f=_.WH(e.textStreams,a.Wd,a.gf,a.Pd);return 0<f.length?_.y(g,aJ(a.a,f[0]),0):g.F(0)})};
|
|
235
|
+
AL=function(a,b,c,d){a.w&&a.w.setCurrentVariant(c);c.video&&zL(a,b,c.video,d);c.audio&&FL(a,b,c.audio,d)};FL=function(a,b,c,d){var e=a.getTrackManager();if(e){var f=a.H.f;a=pH(a.l,b);a.audio=c;a.fb=null;rH(e,c.id,_.U,d);c=e.Va();xE(f,c,d)}};zL=function(a,b,c,d){var e=a.getTrackManager();if(e){var f=a.H.f;pH(a.l,b).video=c;rH(e,c.id,_.$k,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}))}};
|
|
236
|
+
EL=function(a,b,c,d){b=pH(a.l,b);b.audio=null;b.fb=c;if(b=a.getTrackManager())a=a.H.f,rH(b,c.id,_.U,d),c=b.Va(),xE(a,c,d)};xL=function(a,b,c,d){pH(a.l,b).text=c;if(b=a.getTrackManager())rH(b,c.id,_.Zk,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}))};GL=function(a){return a.Y===_.Hb&&"flat"===a.configuration.playlist.timeline};
|
|
237
|
+
jL=function(a,b){for(var c=0;c<b.length;c++){for(var d=b[c],e=new Map,f=_.w(d.variants),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.jh++,originalId:l,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return null},getSegmentReference:function(){return null},initSegmentReference:null,Ja:0,mimeType:_.Vc,codecs:"",kind:_.rd,encrypted:!1,
|
|
238
|
+
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)}};
|
|
239
|
+
hL=function(a,b){for(var c=a.a?VI(a.a):null,d=a.a?WI(a.a):null,e=!bL(a),f=_.w(b),g=f.next();!g.done;g=f.next())RH(a.B,c,d,g.value,e);c=JE(b,function(h){return h.variants.some(UH)});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=
|
|
240
|
+
e.value,(g=e.video)&&!KE(g.type,_.Jl(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,OH(d.variants,a.configuration.restrictions)&&a.a&&oH(a)===d&&fL(a),HL(a,d.variants)};
|
|
241
|
+
qL=function(a,b){var c=a.a?VI(a.a):null,d=a.a?WI(a.a):null,e=!bL(a);RH(a.B,c,d,b,e);d=b.variants;if(!d.some(UH))throw new _.O(_.P,4,4011);HL(a,b.variants);OH(d,a.configuration.restrictions)&&a.a&&oH(a)===b&&fL(a);if(!_.Mk(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===c.keySystem){f=_.w(f.initData||[]);for(var g=f.next();!g.done;g=f.next())g=g.value,_.Tp(a.B,g.keyId,g.initData)||
|
|
242
|
+
_.Jp(a.B,g.initDataType,g.initData,g.keyId)}}};BL=function(a,b,c,d){c=void 0===c?!1:c;d=void 0===d?0:d;a.Ea?(a.ya=b,a.Ej=c,a.Dj=d):gJ(a.a,b,c,d)};yL=function(a,b){a.Ea?a.ea=b:_.fJ(a.a,b,!0,0)};IL=function(a){if(a.a&&a.f){var b=TI(a.a),c=oH(a);null!=b&&b===c&&(VI(a.a),WI(a.a),_.UI(a.a,_.Q),pH(a.l,c),pH(a.l,c),pH(a.l,c),pH(a.l,c))}};
|
|
243
|
+
pL=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=VI(a.a),e=WI(a.a),f=oH(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};tL=function(a){return a.B&&a.B.G?!0:a.K?a.K.getState()===nI:!1};
|
|
244
|
+
aL=function(a){if(a.H&&a.K&&a.C){var b=JL(a)===_.Lq,c=a.J;c.l=b;LI(c,c.o?"seek":void 0);a.C.j.o=b;sL(a);a.qf&&(c=1>Math.abs(a.getMediaDuration()-a.getMediaPosition()),a=a.qf,b&&c&&(b=a.a,b.a[b.a.length-1]&&a.f(new _.L(_.dg))))}};sL=function(a){dK(a,JL(a))};JL=function(a){if(a.qe)var b=!1;else if(a.j&&a.j.ended)b=!0;else{b=a.getMediaDuration();var c=a.getMediaPosition();b=a.ke&&0<=c&&b<=c?!0:!1}return b?_.Nq:tL(a)||a.qe?_.Lq:a.j&&a.j.paused?_.Tq:_.Uq};
|
|
245
|
+
gL=function(a,b){var c=KL(a,b);if(!c)return{variant:null,fb:null};var d=LL(a,c);return{variant:c,fb:d}};LL=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};
|
|
246
|
+
KL=function(a,b){try{HL(a,b)}catch(f){return a.onError(f),null}var c=b.filter(function(f){return UH(f)}),d=MG(c,a.Zb);c=a.be.create(d);c=Array.from(c.values());var e=c.map(VG);a.h.setTracks(e);if(null!==a.ja&&null!==a.Zb&&(e=c.find(function(f){return f.video.id===a.ja&&f.audio.id===a.Zb}),a.ja=null,e))return e;if(a.configuration.abr.enabled||null===a.ja)return d=a.h.chooseTrack(),WG(d,c);d=d.find(function(f){return null!==f.video&&f.video.id===a.ja});return d?d:(a.log.warn("Selected video track not found. Falling back to ABR selection"),
|
|
247
|
+
d=a.h.chooseTrack(),WG(d,c))};ML=function(a,b){return _.WH(b,a.Wd,a.gf,a.Pd)[0]||null};NL=function(a,b,c){c=void 0===c?!0:c;var d=gL(a,b.variants).variant;a.Zb=d&&d.audio&&d.audio.id;d&&(AL(a,b,d,!0),BL(a,d,c));(c=ML(a,b.textStreams))&&(a.configuration.streaming.alwaysStreamText||kH(a))&&(xL(a,b,c,!0),yL(a,c))};
|
|
248
|
+
QL=function(a,b){a.Ea=!0;a.h.disable();a.log.debug("Choosing new streams after period changed");var c=gL(a,b.variants),d=c.variant,e=c.fb,f=ML(a,b.textStreams);a.ya&&(b.variants.includes(a.ya)&&(d=a.ya),a.ya=null);a.ea&&(b.textStreams.includes(a.ea)&&(f=a.ea),a.ea=null);var g=d?d.video:null,h=d&&!e?d.audio:null;d&&a.w&&a.w.setCurrentVariant(d);g&&OL(a,b,function(){return zL(a,b,g,!0)});h&&OL(a,b,function(){return FL(a,b,h,!0)});e&&OL(a,b,function(){return EL(a,b,e,!0)});f&&(a.configuration.streaming.alwaysStreamText||
|
|
249
|
+
kH(a))&&OL(a,b,function(){return xL(a,b,f,!0)});b===oH(a)&&PL(a);c=a.configuration.streaming.alwaysStreamText||kH(a)?f:null;return{video:g,audio:h,text:c,fb:e}};kL=function(a,b,c,d){c=void 0===c?!1:c;d=void 0===d?0:d;if(a.configuration.abr.enabled&&a.a){a.log.debug("switch_");var e=RL(a,b);if(pH(a.l,e).fb){var f=b.video;if(f){OL(a,e,function(){return zL(a,e,f,!0)});e===oH(a)&&PL(a);_.fJ(a.a,f,c,d);return}}OL(a,e,function(){return AL(a,e,b,!0)});e===oH(a)&&PL(a);gJ(a.a,b,c,d)}};
|
|
250
|
+
fL=function(a){var b=a.getTrackManager();b&&a.I!==$K&&(b.m&&(nH(b),b.m.trigger(new _.L(_.Hg))),PL(a))};PL=function(a){var b=oH(a);if(b){var c=a.Wc.get(b)||[];for(a.Wc["delete"](b);c.length;)c.shift()()}};OL=function(a,b,c){a.Wc.has(b)||a.Wc.set(b,[]);a.Wc.get(b).push(c)};WK=function(a,b,c){a.trigger(new _.L(b,{detail:AF(c,GL(a))}))};
|
|
251
|
+
HL=function(a,b){var c=a.B?_.N.mh(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?eL.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,
|
|
252
|
+
missingKeys:g,restrictedKeyStatuses:h});};wL=function(a){var b=oH(a);if(null==b)return[];IL(a);return b.variants.filter(function(c){return UH(c)})};SL=function(a){var b=oH(a);if(null==b)return[];IL(a);return b.textStreams.filter(function(c){return!a.mf.has(c)})};oH=function(a){var b=fG(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};vL=function(a){var b=oH(a);return b?pH(a.l,b).audio:null};
|
|
253
|
+
uL=function(a){var b=oH(a);return b?pH(a.l,b).video:null};RL=function(a,b){for(var c=_.w(a.f.periods),d=c.next();!d.done;d=c.next())if(d=d.value,d.variants.includes(b))return d;return null};GK=function(a){if(a.I===$K)throw new _.O(_.P,7,7E3,"Player is destroyed.");};
|
|
254
|
+
TL=function(a,b,c,d){var e,f,g,h,l,m,n,p,q,u,v,z,A,H,G,D,F,M,R,la;return _.I(function(V){switch(V.a){case 1:return e=_.dr,_.C(V,2),_.y(V,_.dv(b.url,a.getNetworkEngine(),a.configuration.manifest.attemptParameters,b.type||null),4);case 4:f=V.f;f.configure(a.configuration.manifest);var za=f;var Ia=b.url,Aa=cL(a,a.configuration.id||"");za=za.start(Ia,Aa);return _.y(V,za,5);case 5:g=V.f;dL(g.periods);if(!g.periods.length)throw new _.O(_.P,4,4014);return _.y(V,a.w.stop(),6);case 6:a.w=f;h=d&&d.id;l=c&&
|
|
255
|
+
c.id;a.f.periods=g.periods;m=cF(g.periods,fG(a.C))||g.periods[0];bL(a)?MH(a.f,_.Ui(a.configuration.preferredVideoCodec),_.Ui(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount):LH(a.f,_.Ui(a.configuration.preferredVideoCodec),_.Ui(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount);n=NG(h,l,m.variants);p=ML(a,m.textStreams);gL(a,m.variants);q=n&&n.video;u=n&&n.audio;v=[];z=new Set;A=_.w(m.variants);for(H=A.next();!H.done;H=A.next())G=H.value,
|
|
256
|
+
G.video&&z.add(G.video),G.audio&&z.add(G.audio);D=a.getNetworkEngine();F=_.w(_.th(z).concat(_.th(m.textStreams)));for(M=F.next();!M.done;M=F.next())R=M.value,v.push(R.createSegmentIndex(D));return _.y(V,Promise.all(v),7);case 7:vJ(a.a,e.AUDIO,u);vJ(a.a,e.VIDEO,q);vJ(a.a,e.TEXT,p);n&&AL(a,m,n,!1);a.log.info("Switch CDN successful.");_.Hh(V,0);break;case 2:la=_.E(V);if(!f){V.F(8);break}return _.y(V,f.stop(),8);case 8:throw la;}})};
|
|
257
|
+
cL=function(a,b){return{networkingEngine:a.getNetworkEngine(),onContentSteeringInfoFound:function(c){return MK(a,c)},configurationId:b,filterNewPeriod:function(c){return qL(a,c)},filterAllPeriods:function(c){return hL(a,c)},onEvent:function(c){return a.bg(c)},onError:function(c){return a.onError(c)},onUpdate:function(c){return iK(a,c)},onTurnedStatic:function(){return FK(a)},ee:function(){return a.h}}};
|
|
258
|
+
bL=function(a){return a.configuration.mediaSource.codecSwitchingStrategy===_.ng&&(_.Mk(2)||_.Mk(3)||_.Mk(4)||_.Mk(5)||_.Mk(6)||_.Nk()&&38===_.Pl().major||_.Nk()&&53===_.Pl().major||_.Nk()&&68===_.Pl().major?!1:!0)};UL=function(){};VL=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}};
|
|
259
|
+
WL=function(){var a=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(b,c){return a.call(this,b,c-.001)}};XL=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"mp2t"===b.split(/ *; */)[0].split("/")[1].toLowerCase()?!1:a(b)}};YL=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"opus"!==_.NE(b)&&a(b)}};
|
|
260
|
+
ZL=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)}};
|
|
261
|
+
$L=function(a){_.cw.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===CD&&(this.a=c)}this.a||(this.a=a.addTextTrack(_.jE,CD));this.a.mode=_.Fe};aM=function(a,b){var c=a.mode;a.mode=c===_.jg?_.jg:_.Fe;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};bM=function(){};_.Mj.prototype.f=_.mE(0,function(){return this.keyInfo});var pE=[112,115,115,104,0,0,0,0];
|
|
262
|
+
_.FE.prototype.he=function(){return this.pa?this.pa-this.Da+1:null};_.FE.prototype.f=function(){return this.keyInfo};_.PE.prototype.getAttribute=function(a){a=this.attributes[a];return null==a?null:a};_.t=_.SE.prototype;_.t.we=function(a,b){var c=RE(a).childNodes[0];return b&&c.tagName!==b?null:c};_.t.Ma=function(a,b){var c=this.Z(a,b);return 1!==c.length?null:c[0]};_.t.Z=function(a,b){return Array.from(a.childNodes).filter(function(c){return c.tagName===b})};_.t.bc=_.rh(1);_.t.Gc=_.rh(3);
|
|
263
|
+
_.t.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};_.t.getAttributeNS=function(a,b,c){return(b=a.a.get(b))?a.attributes[b+":"+c]||null:null};_.t.W=_.rh(5);_.t.$e=_.rh(7);_.t.zf=_.rh(11);_.t.removeChild=function(a,b){a.childNodes=a.childNodes.filter(function(c){return c!==b})};_.t.lf=_.rh(13);_.t.kf=_.rh(15);_.t.nd=_.rh(9);_.t.Af=_.rh(17);_.t.Ee=_.rh(19);_.cM=0;_.t=_.WE.prototype;
|
|
264
|
+
_.t.track=function(a){null!=this.player&&YE(this);a&&(this.player=a,this.player.on(_.bg,this.jd,this))};_.t.release=function(){YE(this);this.S=[];this.f=this.h=null};
|
|
260
265
|
_.t.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&&
|
|
261
|
-
b<e.end&&(e.start=b);this.S.push(c);this.S.sort(
|
|
262
|
-
_.t.
|
|
263
|
-
{detail:{width:b,height:c,bandwidth:a?a.bandwidth:null,rendition:a}}))}}}};
|
|
264
|
-
_.t.isLive=function(){return 2===this.j.version?!this.a.f:Infinity===this.f&&!this.l};_.t.
|
|
265
|
-
|
|
266
|
-
_.t.
|
|
267
|
-
_.t.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]};_.t.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.
|
|
268
|
-
_.t.
|
|
269
|
-
_.t.
|
|
270
|
-
if(b.length)for(d=b[b.length-1].position+1;e<a.length;)f=a[e++],f=new _.
|
|
271
|
-
f.
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
_.t.
|
|
276
|
-
_.t.
|
|
277
|
-
_.t.
|
|
266
|
+
b<e.end&&(e.start=b);this.S.push(c);this.S.sort(VE)}aF(this);this.jd();this.player&&this.player.trigger(new _.L(_.Zg))};_.t.clear=function(){this.S=[];aF(this);this.player&&(this.player.trigger(new _.L(_.Zg)),this.player.trigger(new _.L(_.id)))};
|
|
267
|
+
_.t.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(_.ld,
|
|
268
|
+
{detail:{width:b,height:c,bandwidth:a?a.bandwidth:null,rendition:a}}))}}}};lF.prototype.dc=function(){return this.h};lF.prototype.getDuration=function(){return this.f?this.a-this.h:Infinity};_.t=_.nF.prototype;_.t.Jc=function(){return this.L};_.t.getDuration=function(){return 2===this.j.version?this.a.getDuration():this.f};_.t.getPresentationStartTime=function(){return this.G};_.t.offset=function(a){null!=this.w&&(this.w+=a);null!=this.o&&(this.o+=a)};
|
|
269
|
+
_.t.isLive=function(){return 2===this.j.version?!this.a.f:Infinity===this.f&&!this.l};_.t.pe=function(){return!this.l};BF.prototype.release=function(){this.f=function(){};this.h=function(){};this.a.clear()};BF.prototype.cues=function(){return this.a};FF.prototype.release=function(){this.f=this.j=this.h=this.a=null};FF.prototype.l=function(a){AE(this.a,a);GF(this)};
|
|
270
|
+
HF.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=IF(this);return{value:a,done:!a}};_.t=_.JF.prototype;_.t.destroy=function(){this.a=[];return Promise.resolve()};
|
|
271
|
+
_.t.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};
|
|
272
|
+
_.t.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]};_.t.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};
|
|
273
|
+
_.t.Ld=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};_.t.getDuration=function(){return this.a[this.a.length-1].endTime-this.a[0].startTime};
|
|
274
|
+
_.t.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 _.Mj(f.position,g.startTime,g.endTime,g.eb,g.Da,g.pa,g.Ja,g.keyInfo,g.qd,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++]);
|
|
275
|
+
if(b.length)for(d=b[b.length-1].position+1;e<a.length;)f=a[e++],f=new _.Mj(d++,f.startTime,f.endTime,f.eb,f.Da,f.pa,f.Ja,f.keyInfo,f.qd,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 _.Mj(e-d--,f.startTime,f.endTime,f.eb,f.Da,f.pa,f.Ja,f.keyInfo,f.qd,f.timescale,f.horizontalTiles,f.verticalTiles,f.durationPerTile,null,null,
|
|
276
|
+
f.ye,f.Ta));b=_.w(b);for(f=b.next();!f.done;f=b.next())a.push(f.value)}this.a=a};_.t.replace=function(a){this.a=a};OF.prototype.release=function(){this.h=null;this.f=function(){}};SF.prototype.release=function(){this.h&&(this.h.release(),this.h=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};SF.prototype.vf=function(){this.A=!0;RF(this)};TF.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};
|
|
277
|
+
XF.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};dG.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(){}};iG.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()};
|
|
278
|
+
kG.prototype.release=function(){this.j=null;this.o.clear();this.a=function(){};this.f=function(){};this.h=function(){}};kG.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,Ie:d.Ie},f=e.next()){f=f.value;d.Of=this.o.get(f)||null;d.Ie=jG(f,a);this.o.set(f,d.Ie);var g=this.w.find(function(h){return function(l){return l.Vc===h.Of&&l.Uc===h.Ie}}(d));g&&g.Lc(f,b&&0===c)}};
|
|
279
|
+
oG.prototype.getBandwidthEstimate=function(a){return 128E3>this.a?a:Math.min(_.jF(this.f),_.jF(this.h))};_.x(tG,_.Hm);tG.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()};_.t=DG.prototype;_.t.destroy=function(){this.j=this.w=null;this.o.clear();return Promise.resolve()};
|
|
280
|
+
_.t.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))})};_.t.Ua=function(){return this.a};_.t.la=function(){return this.f};_.t.Tb=function(a){return null==this.a||null==this.f?!1:a>=this.a&&a<this.f};_.t.Ga=function(a){return null==this.f||this.f<a?0:this.f-Math.max(a,this.a)};_.x(XG,_.Bl);_.t=XG.prototype;_.t.initialize=function(a){this.m=a};_.t.release=function(){this.h=[];this.a.clear();this.f.clear()};_.t.load=function(){};_.t.destroy=function(){this.release();this.m=null};_.t.getVideoTracks=function(){return YG(this,_.$k)};_.t.getAudioTracks=function(){return YG(this,_.U)};_.t.ma=function(){return YG(this,_.Zk)};_.t.na=function(){return this.a.get(_.$k)||null};_.t.Va=function(){return this.a.get(_.U)||null};_.t.Za=function(){return this.a.get(_.Zk)||null};
|
|
281
|
+
_.t.Bb=function(){return this.f.get(_.$k)||null};_.t.Nb=function(){return this.f.get(_.U)||null};_.t.Ob=function(){return this.f.get(_.Zk)||null};_.t.Na=function(){return ZG(this,_.$k)};_.t.ra=function(){return ZG(this,_.U)};_.t.Ba=function(){return ZG(this,_.Zk)};_.t.Jb=function(a){this.m&&$G(this,_.$k,a)};_.t.Ka=function(a){this.m&&$G(this,_.U,a)};_.t.$a=function(a){this.m&&$G(this,_.Zk,a)};
|
|
282
|
+
_.t.ub=function(a,b){b=void 0===b?!1:b;if(this.m)if(a)fH(this,a,b);else{var c=b,d=ZG(this,_.$k);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."),eH(this.m,null,c)))}};_.t.Hb=function(a){this.m&&(a?(cH(this,a,_.U),bH(this,a,_.U)&&(this.g.info("Set audio rendition with ID: "+a.id),this.f.set(_.U,a),DL(this.m,parseInt(a.id,10)))):this.g.info("Enabling ABR for audio is not supported"))};
|
|
278
283
|
_.t.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"]()})};_.t.wa=function(){return!!this.m&&this.m.wa()};
|
|
279
|
-
_.t.
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
_.t.destroy=function(){var a=this;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"](
|
|
283
|
-
{};a.H=null;a.K=!1;for(var g in a.h);a.h={}})};_.t.open=function(){return this.J};_.t.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=_.
|
|
284
|
-
_.t.
|
|
285
|
-
_.t.
|
|
286
|
-
_.t.
|
|
287
|
-
_.r,this.
|
|
288
|
-
d&&g){var
|
|
289
|
-
_.t.
|
|
290
|
-
_.t.flush=function(a){return a===_.
|
|
291
|
-
_.t.getDuration=function(){return this.o.duration};_.t.
|
|
292
|
-
_.t.
|
|
293
|
-
_.t.
|
|
294
|
-
_.t.
|
|
295
|
-
_.t.chooseTrack=function(){var a=
|
|
284
|
+
_.t.Ib=function(a){if(this.m){var b=a;if(!a){var c=this.Za();if(c&&c.track.kind!==_.Be){a=this.ma().find(function(e){return e.kind===_.Be&&e.language===c.track.language});if(!a){var d=this.ra();d&&(a=this.ma().find(function(e){return e.kind===_.Be&&e.language===d.language}))}a&&(b=a.renditions[0])}}b?iH(this,b):jH(this)}};XG.prototype.setTextRendition=XG.prototype.Ib;XG.prototype.isAbrEnabled=XG.prototype.wa;XG.prototype.addTextTrack=XG.prototype.addTextTrack;XG.prototype.setAudioRendition=XG.prototype.Hb;
|
|
285
|
+
XG.prototype.setVideoRendition=XG.prototype.ub;XG.prototype.setTextTrack=XG.prototype.$a;XG.prototype.setAudioTrack=XG.prototype.Ka;XG.prototype.setVideoTrack=XG.prototype.Jb;XG.prototype.getTextTrack=XG.prototype.Ba;XG.prototype.getAudioTrack=XG.prototype.ra;XG.prototype.getVideoTrack=XG.prototype.Na;XG.prototype.getLoadingTextRendition=XG.prototype.Ob;XG.prototype.getLoadingAudioRendition=XG.prototype.Nb;XG.prototype.getLoadingVideoRendition=XG.prototype.Bb;XG.prototype.getTextRendition=XG.prototype.Za;
|
|
286
|
+
XG.prototype.getAudioRendition=XG.prototype.Va;XG.prototype.getVideoRendition=XG.prototype.na;XG.prototype.getTextTracks=XG.prototype.ma;XG.prototype.getAudioTracks=XG.prototype.getAudioTracks;XG.prototype.getVideoTracks=XG.prototype.getVideoTracks;sH.prototype.init=function(a){var b=muxjs.mp4.probe;a=_.Xj(a);this.l=b.videoTrackIds(a);this.j=b.timescale(a)||{};this.a.init()};sH.prototype.h=function(a,b){var c=_.Xj(a);(c=this.a.parse(c,this.l,this.j))&&c.captions&&b(c.captions);this.a.clearParsedCaptions()};sH.prototype.f=function(){this.a.resetCaptionStream()};_.tH.prototype.init=function(){};_.tH.prototype.h=function(){};_.tH.prototype.f=function(){};_.t=_.vH.prototype;
|
|
287
|
+
_.t.destroy=function(){var a=this;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"](CE));for(e=1;e<d.length;++e)d[e].p["catch"](CE),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.G=
|
|
288
|
+
{};a.H=null;a.K=!1;for(var g in a.h);a.h={}})};_.t.open=function(){return this.J};_.t.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=_.dr,_.y(f,d.J,2);a.forEach(function(g,h){var l=_.Jl(g.mimeType,g.codecs);if(h===e.TEXT)d.uc(l);else{var m=new Map;m.set(h,l);if((!_.Bu(l)||!b||g.aesEncrypted)&&_.Il(l,h)){var n=_.Il(l);n&&(m=n(),d.w[h]=m,m=m.demuxMimeTypes(h,l),c&&m["delete"](e.AUDIO))}yH(d,m);d.K=m.has(e.AUDIO)&&m.has(e.VIDEO)}});_.B(f)})};
|
|
289
|
+
_.t.sj=function(){this.g.debug(GD);Object.values(this.w).forEach(function(a){return a.reset()})};_.t.Ji=function(){return this.L.streaming.ignoreManagedMediaSourceStreamingHints?!0:this.M};_.t.uc=function(a){this.f||(this.f=new DG(this.L,this.C));EG(this.f,a)};_.t.Ve=function(){return this.o?this.o.readyState===_.ye:!0};_.t.Ua=function(a){return a===_.Q?this.f.Ua():(a=zH(this,a))?a.Ua():null};_.t.la=function(a){return a===_.Q?this.f.la():(a=zH(this,a))?a.la():null};
|
|
290
|
+
_.t.Tb=function(a,b,c){return a===_.Q?this.f.Tb(b):(a=zH(this,a))?a.Tb(b,!1,c):!1};_.t.Ga=function(a,b){if(a===_.Q)return this.f.Ga(b);var c=zH(this,a);return c?c.Ga(b):0};_.t.mg=function(){var a={};a.total=new _.Gm(this.j.buffered,"total");a.audio=zH(this,_.cd);a.video=zH(this,_.r);var b=[];this.f&&(b=[{start:this.f.Ua(),end:this.f.la()}]);a.text=OE(b,_.Q);return a};
|
|
291
|
+
_.t.Ue=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=FG(this.f,b,c,d):this.w[a]?(b=this.w[a].transmux(b),b.captions&&0<b.captions.length&&(this.f||this.uc(_.zg),HG(this.f,b.captions,c,d,this.a.video.timestampOffset)),e=[],0<b.audio.byteLength&&this.a.audio&&!h&&e.push(BH(this,_.cd,this.dg.bind(this,_.cd,b.audio.buffer))),0<b.video.byteLength&&
|
|
292
|
+
this.a.video&&e.push(BH(this,_.r,this.dg.bind(this,_.r,b.video.buffer))),h=Promise.all(e)):(e&&window.muxjs&&(this.f||this.uc(_.zg),null==c&&null==d?this.H.init(b):this.H.h(b,function(q){q.length&&HG(l.f,q,c,d,l.a.video.timestampOffset)})),h=BH(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(cD,c,d,eD,AH(l,a));else if(a===_.cd&&null!==c&&null!==d)ZE(l.B),null!==c&&null!==d&&l.g.debug(bD,c,d,eD,AH(l,a));else if(a===
|
|
293
|
+
_.r&&null!==c&&null!==d&&g){var q=m.buffered.length,u=0<q?m.buffered.end(q-1):-1;0>n&&0<q&&(n=m.buffered.start(0));0<=n&&0<u&&l.B.append(n,u,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(hD+v+OC+(a+WC)+(c+NC)+(q+VC)),q=BH(l,a,function(){l.Ih(a,v)}),u=BH(l,a,l.Fh.bind(l,a,!1)),Promise.all([q,u])}null!==c&&null!==d&&(l.G[a]=!0)})["catch"](function(q){throw q;})};
|
|
294
|
+
_.t.Hh=function(a){var b=this.la(_.r)||0;GG(this.f,a,b)};_.t.zh=function(){this.f&&GG(this.f,"",0)};_.t.remove=function(a,b,c){var d=this;return a===_.Q?this.f.remove(b,c):BH(this,a,this.Gh.bind(this,a,b,c)).then(function(){if(a===_.r){var e=d.Ua(a),f=d.la(a);null!==e&&null!==f&&bF(d.B,e,f)}else a===_.cd&&$E(d.B)})};_.t.clear=function(a){if(a===_.Q){if(!this.f)return Promise.resolve();this.H.f();return this.f.remove(0,Infinity)}return BH(this,a,this.Gh.bind(this,a,0,this.o.duration))};
|
|
295
|
+
_.t.flush=function(a){return a===_.Q?Promise.resolve():BH(this,a,this.Fh.bind(this,a))};_.t.vj=function(a,b,c,d){var e=this,f,g;return _.I(function(h){f=_.dr;if(a===f.TEXT){e.f.A=b;var l=e.f;l.h=c;l.l=d;return h["return"]()}g=CH(e,a,b,c,d);e.K&&(g=g.concat(CH(e,f.AUDIO,b,c,d)));return _.y(h,Promise.all(g),0)})};_.t.endOfStream=function(a){var b=this;return FH(this,function(){b.Ve()||(a?b.o.endOfStream(a):b.o.endOfStream())})};_.t.eg=function(a){var b=this;FH(this,function(){b.o.duration=a})};
|
|
296
|
+
_.t.getDuration=function(){return this.o.duration};_.t.dg=function(a,b){this.g.debug(dD+a+PC);try{this.a[a].appendBuffer(b)}catch(c){throw this.g.warn(pD+a,c),c;}this.g.debug(jD+a+PC)};_.t.Gh=function(a,b,c){if(c<=b)this.md(a);else{this.g.debug(FD+a+SC,b,c);try{this.a[a].remove(b,c)}catch(d){throw this.g.warn(rD+a+QC,b,c,d),d;}this.g.debug(lD+a+SC,b,c)}};
|
|
297
|
+
_.t.Zk=function(a){try{this.g.debug(aD+a+PC);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(oD+a+PC,d),d;}this.g.debug(iD+a+PC);this.md(a)};_.t.Fh=function(a){try{this.j.readyState>HTMLMediaElement.HAVE_NOTHING?(this.g.debug(uD+a),this.j.currentTime-=.001):this.g.warn(KD+a+UC+this.j.readyState)}catch(b){throw this.g.warn(qD+a,b),b;}this.g.debug(kD+a);this.md(a)};
|
|
298
|
+
_.t.Ih=function(a,b){0>b&&(b+=.001);try{this.g.debug(JD+a,b),this.a[a].timestampOffset=b}catch(c){throw this.g.warn(tD+a,b,c),c;}this.g.debug(nD+a,b);this.md(a)};_.t.al=function(a,b,c){try{this.g.debug(HD+a,b,c),this.a[a].appendWindowStart=0,this.a[a].appendWindowEnd=c,this.a[a].appendWindowStart=b}catch(d){throw this.g.warn(sD+a,b,c,d),d;}this.g.debug(mD+a,b,c);this.md(a)};_.t.$k=function(a){this.h[a][0].p.reject(new _.O(_.P,3,3014,{mediaError:this.j.error?this.j.error.code:0}))};
|
|
299
|
+
_.t.md=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug(ND+a),EH(this,a))};_.t.getTextDisplayer=function(){return this.C};var xH=window.URL.createObjectURL;_.t=_.XH.prototype;_.t.stop=function(){this.A=null;this.l=!1;this.f=[];this.o=1;this.h=null;this.C=!1};_.t.init=function(a){this.A=a};
|
|
300
|
+
_.t.chooseTrack=function(){var a=YH(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=YH(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;
|
|
296
301
|
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]};_.t.enable=function(){this.l=!0};_.t.disable=function(){this.l=!1};
|
|
297
|
-
_.t.segmentDownloaded=function(a,b){this.g.debug("Segment downloaded:","deltaTimeMs\x3d"+a,"numBytes\x3d"+b,"lastTimeChosenMs\x3d"+this.h,"enabled\x3d"+this.l);
|
|
298
|
-
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)}};_.t.playbackRateChanged=function(a){this.o=a};
|
|
299
|
-
_.t.
|
|
300
|
-
|
|
301
|
-
for(var d=a.next();!d.done;d=a.next())c.add(d.value,!b);return c};
|
|
302
|
-
_.t.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"](
|
|
303
|
-
{};a.I=null;a.M=!1;for(var g in a.h);a.h={}})};_.t.open=function(){return this.L};_.t.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=_.
|
|
304
|
-
_.t.
|
|
305
|
-
_.t.
|
|
306
|
-
_.t.
|
|
307
|
-
_.r,this.
|
|
308
|
-
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 u=c-p;if(Math.abs(u)>h.U&&0===l.timestampOffset)return h.g.warn(
|
|
309
|
-
_.t.
|
|
310
|
-
_.t.flush=function(a){return a===_.
|
|
311
|
-
_.t.
|
|
312
|
-
_.t.
|
|
313
|
-
_.t.start=function(){var a=this,b,c,d;return _.I(function(e){if(1==e.a){b=a.D.
|
|
314
|
-
a.D.
|
|
315
|
-
_.t.
|
|
316
|
-
f=_.w(b.a.values());for(g=f.next();!g.done;g=f.next())h=g.value,h.
|
|
317
|
-
_.t.
|
|
318
|
-
_.t.
|
|
319
|
-
_.t.unload=function(){var a=this,b;return _.I(function(c){if(1==c.a){
|
|
320
|
-
_.t.getBufferInfo=function(a){if(this.
|
|
321
|
-
_.t.seek=function(a){if(this.
|
|
322
|
-
_.t.getMediaDuration=function(){return this.f?this.f.presentationTimeline.getDuration():Infinity};_.t.destroy=function(){var a=this;return _.I(function(b){if(1==b.a)return _.y(b,_.
|
|
323
|
-
_.t.setupPlaylist=function(a){var b=this,c,d,e,f,g,h,l,m,n,p,q,u,v;return _.I(function(z){switch(z.a){case 1:return c=new _.
|
|
324
|
-
case 6:f=z.f;g=f.filter(function(A){return A.manifest.presentationTimeline.isLive()});if(h=g[0])b.
|
|
325
|
-
q=
|
|
326
|
-
_.t.appendLoad=function(a){var b=this,c;return _.I(function(d){if(1==d.a){
|
|
327
|
-
_.t.
|
|
328
|
-
_.t.load=function(a){return
|
|
329
|
-
_.t.getSeekRange=function(){var a={start:0,end:0};if(this.f){var b=this.f.presentationTimeline;a={start:
|
|
330
|
-
_.t.setPlaybackRate=function(a,b){if(0===a)this.log.warn("A trick play rate of 0 is unsupported!");else if(this.
|
|
331
|
-
d),_.
|
|
332
|
-
_.t.getStats=function(){if(this.
|
|
333
|
-
_.t.getTimelineCues=function(){return this.
|
|
334
|
-
_.t.addTextTrack=function(a,b,c,d,e,f){var g=this,h,l,m,n,p,q,u,v,z;return _.I(function(A){if(1==A.a){if(g.
|
|
335
|
-
findSegmentPosition:function(){return 1},getSegmentReference:function(H){return 1===H?u:null},adjustSegmentDurations:function(){},getDuration:function(){return q},segmentLookupStrategy:_.
|
|
336
|
-
2)}if(z=_.
|
|
337
|
-
_.t.
|
|
338
|
-
_.t.
|
|
339
|
-
_.t.
|
|
340
|
-
|
|
341
|
-
_.t.
|
|
342
|
-
_.y(
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
_.
|
|
346
|
-
_.t.append=function(a){function b(e){if(e.startTime>=e.endTime)_.
|
|
347
|
-
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)};_.t.remove=function(a,b){if(!this.a)return!1;
|
|
302
|
+
_.t.segmentDownloaded=function(a,b){this.g.debug("Segment downloaded:","deltaTimeMs\x3d"+a,"numBytes\x3d"+b,"lastTimeChosenMs\x3d"+this.h,"enabled\x3d"+this.l);_.pG(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...");
|
|
303
|
+
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)}};_.t.playbackRateChanged=function(a){this.o=a};_.t.getBandwidthEstimate=function(){if(this.j&&this.a.useCmsd){var a=yE(this.j,_.Ae);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)};
|
|
304
|
+
_.t.setTracks=function(a){this.f=a};_.t.setCmsdManager=function(a){this.j=a};_.t.configure=function(a){this.a=a};_.t.reset=function(){this.B=!1;this.w=new oG;var a=this.chooseTrack();a&&this.A(a)};bI.prototype.clear=function(){this.a.clear()};dI.prototype.add=function(a,b){var c=void 0===b?!0:b;if(gI(this.f,a,void 0===c?!0:c))return this.a.add(a),!0;_.Wh("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};dI.prototype.values=function(){return this.a.values()};iI.prototype.create=function(a){var b=this,c=this.a===_.ng&&UE(),d=a.filter(function(e){return gI(b.f,e,!c)});return d.length?new dI(d[0],d):this.h.create(a)};
|
|
305
|
+
hI.prototype.create=function(a){var b=jI(a,this.j);0<b.length&&(a=b);b=!1;if(this.a){var c=kI(a,this.a);0<c.length?(a=c,b=!0):_.Wh("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=HH(a,this.f),b.length?a=b:_.Wh("No exact match for the channel count could be found."));b=lI(a,this.l);b.length?a=b:_.Wh("No exact match for spatial audio could be found.");b=this.h===_.ng&&UE();c=new dI(a[0]);a=_.w(a);
|
|
306
|
+
for(var d=a.next();!d.done;d=a.next())c.add(d.value,!b);return c};oI.prototype.getState=function(){return this.a};var nI=0,mI=1;qI.prototype.release=function(){this.f.release()};_.t=sI.prototype;
|
|
307
|
+
_.t.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"](CE));for(e=1;e<d.length;++e)d[e].p["catch"](CE),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=
|
|
308
|
+
{};a.I=null;a.M=!1;for(var g in a.h);a.h={}})};_.t.open=function(){return this.L};_.t.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=_.dr,_.y(f,d.L,2);a.forEach(function(g,h){var l=_.Jl(g.mimeType,g.codecs);if(h===e.TEXT)d.uc(l);else{var m=new Map;m.set(h,l);if((!_.Bu(l)||!b||g.aesEncrypted)&&_.Il(l,h)){var n=_.Il(l);n&&(m=n(),d.w[h]=m,m=m.demuxMimeTypes(h,l),c&&m["delete"](e.AUDIO))}uI(d,m)}d.h[h]=[]});_.B(f)})};_.t.sj=function(){this.g.debug(GD);Object.values(this.w).forEach(function(a){return a.reset()})};
|
|
309
|
+
_.t.Ji=function(){return this.J.streaming.ignoreManagedMediaSourceStreamingHints?!0:this.P};_.t.uc=function(a){this.f||(this.f=new DG(this.J,this.C));EG(this.f,a)};_.t.Ve=function(){return this.o?this.o.readyState===_.ye:!0};_.t.Ua=function(a){return a===_.Q?this.f.Ua():(a=vI(this,a))?a.Ua():null};_.t.la=function(a){return a===_.Q?this.f.la():(a=vI(this,a))?a.la():null};_.t.Tb=function(a,b,c){return a===_.Q?this.f.Tb(b):(a=vI(this,a))?a.Tb(b,!1,c):!1};
|
|
310
|
+
_.t.Ga=function(a,b){if(a===_.Q)return this.f.Ga(b);var c=vI(this,a);return c?c.Ga(b):0};_.t.mg=function(){var a={};a.total=new _.Gm(this.j.buffered,"total");a.audio=vI(this,_.cd);a.video=vI(this,_.r);var b=[];this.f&&(b=[{start:this.f.Ua(),end:this.f.la()}]);a.text=OE(b,_.Q);return a};
|
|
311
|
+
_.t.Ue=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=FG(this.f,b,c,d):this.w[a]?(b=this.w[a].transmux(b),b.captions&&0<b.captions.length&&(this.f||this.uc(_.zg),HG(this.f,b.captions,c,d,this.a.video.timestampOffset)),e=[],0<b.audio.byteLength&&this.a.audio&&e.push(xI(this,_.cd,this.cg.bind(this,_.cd,b.audio.buffer))),0<b.video.byteLength&&this.a.video&&e.push(xI(this,
|
|
312
|
+
_.r,this.cg.bind(this,_.r,b.video.buffer))),b=Promise.all(e)):(e&&window.muxjs&&(this.f||this.uc(_.zg),null==c&&null==d?this.I.init(b):this.I.h(b,function(p){p.length&&HG(h.f,p,c,d,h.a.video.timestampOffset)})),b=xI(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(cD,c,d,eD,wI(h,a));else if(a===_.cd&&null!==c&&null!==d)ZE(h.B),null!==c&&null!==d&&h.g.debug(bD,c,d,eD,wI(h,a));else if(a===_.r&&null!==c&&null!==
|
|
313
|
+
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 u=c-p;if(Math.abs(u)>h.U&&0===l.timestampOffset)return h.g.warn(hD+u+OC+(a+WC)+(c+NC)+(p+VC)),p=xI(h,a,function(){yI(h,a,u)}),q=xI(h,a,h.Dh.bind(h,a,!1)),Promise.all([p,q])}null!==c&&null!==d&&(h.H[a]=!0)})["catch"](function(p){throw p;})};_.t.Hh=function(a){var b=this.la(_.r)||0;GG(this.f,a,b)};
|
|
314
|
+
_.t.zh=function(){this.f&&GG(this.f,"",0)};_.t.remove=function(a,b,c){var d=this;return a===_.Q?this.f.remove(b,c):xI(this,a,this.Eh.bind(this,a,b,c)).then(function(){if(a===_.r){var e=d.Ua(a),f=d.la(a);null!==e&&null!==f&&bF(d.B,e,f)}else a===_.cd&&$E(d.B)})};_.t.clear=function(a){if(a===_.Q){if(!this.f)return Promise.resolve();this.I.f();return this.f.remove(0,Infinity)}return xI(this,a,this.Eh.bind(this,a,0,this.o.duration))};
|
|
315
|
+
_.t.flush=function(a){return a===_.Q?Promise.resolve():xI(this,a,this.Dh.bind(this,a))};_.t.vj=function(a,b,c,d,e,f){var g=this,h,l,m;return _.I(function(n){if(1==n.a){h=_.dr;if(a===h.TEXT){g.f.A=b;var p=g.f;p.h=c;p.l=d;return n["return"]()}return _.y(n,EI(g,a,e,f),2)}l=n.f;m=zI(g,a,b,c,d,l);g.M&&(m=m.concat(zI(g,h.AUDIO,b,c,d,l)));return _.y(n,Promise.all(m),0)})};_.t.endOfStream=function(a){var b=this;return CI(this,function(){b.Ve()||(a?b.o.endOfStream(a):b.o.endOfStream())})};
|
|
316
|
+
_.t.eg=function(a){var b=this;CI(this,function(){b.o.duration=a})};_.t.getDuration=function(){return this.o.duration};_.t.cg=function(a,b){this.g.debug(dD+a+PC);try{this.a[a].appendBuffer(b)}catch(c){throw this.g.warn(pD+a,c),c;}this.g.debug(jD+a+PC)};_.t.Eh=function(a,b,c){if(c<=b)this.Ec(a);else{this.g.debug(FD+a+SC,b,c);try{this.a[a].remove(b,c)}catch(d){throw this.g.warn(rD+a+QC,b,c,d),d;}this.g.debug(lD+a+SC,b,c)}};
|
|
317
|
+
_.t.Dh=function(a){try{this.j.readyState>HTMLMediaElement.HAVE_NOTHING?(this.g.debug(uD+a),this.j.currentTime-=.001):this.g.warn(KD+a+UC+this.j.readyState)}catch(b){throw this.g.warn(qD+a,b),b;}this.g.debug(kD+a);this.Ec(a)};_.t.Yk=function(a){this.h[a][0].p.reject(new _.O(_.P,3,3014,{mediaError:this.j.error?this.j.error.code:0}))};_.t.Ec=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug(ND+a),BI(this,a))};_.t.getTextDisplayer=function(){return this.C};var tI=window.URL.createObjectURL;FI.prototype.release=function(){this.a=this.h=null;this.f=function(){}};FI.prototype.l=function(a){var b=this.a,c=this.h.periods;a=cF(c,a)||c[0];b!==a&&this.f(a);this.a=a};HI.prototype.getConfiguration=function(){return this.j};HI.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};HI.prototype.set=function(a,b){this.h=a;LI(this,b)};var OI=new _.oo(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])});_.t=_.RI.prototype;_.t.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,bJ(e),b.push(cJ(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;_.B(f)})};
|
|
318
|
+
_.t.start=function(){var a=this,b,c,d;return _.I(function(e){if(1==e.a){b=a.D.Qb();c=cF(a.j.periods,b+_.qw);if(!c)throw new _.O(_.P,5,5006,"No period found.");d=a.D.yg(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,jJ(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()..."),
|
|
319
|
+
a.D.sn());_.B(e)})};_.t.resume=function(){if(!rJ(this))for(var a=_.w(this.a.values()),b=a.next();!b.done;b=a.next())b=b.value,b.endOfStream=!1,$I(this,b,0)};
|
|
320
|
+
_.t.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=oJ(a);if(a.Fb||null==a.vb||a.Cc)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,tJ(b,a,a.Gf,a.Se),3);case 3:return m["return"]();case 2:_.C(m,4);d=GJ(b,a);null!=d&&($I(b,a,d),a.vd=!1);_.Hh(m,5);break;case 4:return e=_.E(m),_.y(m,RJ(b,e),6);case 6:return m["return"]();case 5:WJ(b,a);if(!sJ(b)){m.F(0);break}if(b.D.configuration.Im){b.g.debug("End of stream reached, keeping MediaSource open.");
|
|
321
|
+
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.Wi();_.B(m)}})};
|
|
322
|
+
_.t.On=function(a,b,c,d){var e=oE(d.reader),f=oE(d.reader),g=_.xn(d.reader),h=_.xn(d.reader),l=_.xn(d.reader),m=_.xn(d.reader);d=_.Bn(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.aj();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}}))};
|
|
323
|
+
_.t.Qo=function(a){var b=this,c=!1,d=0;(new _.Cn).N(_.bf,_.Dn).N(_.Ig,_.Dn).N(_.Xe,_.Dn).N(_.af,_.Dn).N(_.sg,_.Dn).aa(_.ug,_.En).N("encv",function(e){e.reader.skip(78);_.Dn(e)}).N("pasp",function(e){d=e.start+e.headerSize;var f=_.xn(e.reader),g=_.xn(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 _.pn(new DataView(a.data)),a.seek(d),_.W(a,1),_.W(a,1))};_.x(bK,_.Sm);_.t=bK.prototype;_.t.init=function(a,b){var c=a.getMedia();_.Sm.prototype.init.call(this,a,b);JK(this,c)};_.t.namespace=function(){return UD};_.t.setSeekInterceptor=function(a){this.ih=a||null};_.t.setPlaybackSessionId=function(a){this.bh=a};_.t.Wh=function(){return new XG};_.t.getState=function(){return this.Lb};_.t.getDrmInfo=function(){return this.B?this.B.getDrmInfo():null};
|
|
324
|
+
_.t.unload=function(){var a=this,b;return _.I(function(c){if(1==c.a){gH(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===$K?c["return"]():_.y(c,LK(a),2)}a.ba=null;a.fh=0;a.Zb=null;a.ja=null;a.getNetworkEngine().headers["delete"](PD);_.B(c)})};_.t.release=function(){var a=this;return _.I(function(b){if(a.ha)return b["return"](a.ha);a.ha=eK(a);a.ha["finally"](function(){a.ha=null});return b["return"](a.ha)})};
|
|
325
|
+
_.t.getBufferInfo=function(a){if(this.M){var b=this.M.mg(),c=new _.Gm(void 0,a);switch(a){case _.$k:return b.video?b.video:c;case _.U:return b.audio?b.audio:c;case _.Zk:return b.text?b.text:c}return b.total?b.total:c}return this.ed?(b=XE(this.ed),OE(b,a)):_.Sm.prototype.getBufferInfo.call(this,a)};_.t.getPosition=function(){var a=this.ne,b=this.getMediaPosition();a.a&&(a=a.a,b-=a.f,b=0>b?0:b>a.a?a.a:b);return b};_.t.getMediaPosition=function(){return this.C?fG(this.C):_.Sm.prototype.getMediaPosition.call(this)};
|
|
326
|
+
_.t.seek=function(a,b){if(this.ih&&!this.ih(a,b))return Promise.resolve();var c=this.ne;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 _.Sm.prototype.seek.call(this,c)};_.t.getPresentationStartTime=function(){return this.f?this.f.presentationTimeline.getPresentationStartTime():null};_.t.getDuration=function(){var a=this.ne,b=this.getMediaDuration();return a.a?a.a.getDuration():b};
|
|
327
|
+
_.t.getMediaDuration=function(){return this.f?this.f.presentationTimeline.getDuration():Infinity};_.t.destroy=function(){var a=this;return _.I(function(b){if(1==b.a)return _.y(b,_.Sm.prototype.destroy.call(a),2);if(a.I===$K)return b["return"]();a.log.debug("Destroying player...");a.I=$K;IK(a);a.o&&(a.o.release(),a.o=null);a.$d=null;a.h=null;_.B(b)})};_.t.getTimeline=function(){return this.$d};
|
|
328
|
+
_.t.setupPlaylist=function(a){var b=this,c,d,e,f,g,h,l,m,n,p,q,u,v;return _.I(function(z){switch(z.a){case 1:return c=new _.Gk,b.A.a=c,_.C(z,2),GK(b),b.Y=_.Hb,_.y(z,NK(b),4);case 4:return aI(b.A,c),d=a[0],d.playlist&&d.playlist.startTime&&(d.startTime=d.playlist.startTime),b.ba=_.Yq(d),b.configuration=_.Qm(b.kb,d),b.log.info("Loading playlist configurations",a),b.$d=fK(b.configuration),_.y(z,OK(b,c),5);case 5:return aI(b.A,c),e=a.map(function(A){return PK(b,A,0,null,!0)}),_.y(z,Promise.all(e),6);
|
|
329
|
+
case 6:f=z.f;g=f.filter(function(A){return A.manifest.presentationTimeline.isLive()});if(h=g[0])b.w=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===_.jc)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 _.nF({version:2},null,0,m);p=f.map(function(A){return QG(A.manifest)});
|
|
330
|
+
q=TG(p,n);b.f=q;u=b;return _.y(z,QK(b,q,b.configuration),7);case 7:return u.B=z.f,aI(b.A,c),_.y(z,RK(b,c),8);case 8:aI(b.A,c);mJ(b.a,q);hK(b,q);c.resolve();_.Hh(z,0);break;case 2:v=_.E(z);if(!b.w){z.F(9);break}return _.y(z,b.w.stop(),10);case 10:b.w=null;case 9:SK(b,v,c),_.B(z)}})};
|
|
331
|
+
_.t.appendLoad=function(a){var b=this,c;return _.I(function(d){if(1==d.a){GK(b);if(b.Y!==_.Hb)throw new _.O(_.P,7,7003,"Cannot append-load to non-playlist player.");return _.y(d,ZK(b,a),2)}c=d.f;b.f=c.manifest;b.w=c.parser;mJ(b.a,c.manifest);sJ(b.a)&&b.a.resume();hK(b,c.manifest);_.B(d)})};_.t.seekWith=function(a){return this.seek(this.getPosition()+a)};
|
|
332
|
+
_.t.Ch=function(){var a=this;return _.I(function(b){GK(a);if(!a.xf)return a.log.warn("No preloaded asset found"),b["return"]();a.log.info("Loading preloaded asset",a.xf);a.xf=null;return _.y(b,RK(a,null),0)})};_.t.preload=function(a){var b=this;return _.I(function(c){if(1==c.a)return GK(b),_.mp("preload.start"),b.log.info("Preloading asset",a),_.y(c,TK(b,a,!1),2);b.xf=a;b.log.info("Preloaded asset",a);_.mp("preload.end");_.op("preload","preload.start","preload.end");_.B(c)})};
|
|
333
|
+
_.t.load=function(a){return TK(this,a)};_.t.detach=function(){var a=this;return _.I(function(b){if(1==b.a)return _.y(b,HK(a),2);a.configuration=a.kb;IK(a);_.B(b)})};_.t.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};_.t.ej=function(){this.log.debug("User seeking finished");this.K&&rL(this);sL(this)};
|
|
334
|
+
_.t.getSeekRange=function(){var a={start:0,end:0};if(this.f){var b=this.f.presentationTimeline;a={start:oF(b),end:yF(b)}}b=this.ne;b.a?(b=b.a.getDuration(),b>a.end&&(b=a.end),b={start:0,end:b}):b=a;return b};_.t.Jc=function(){return this.f?this.f.presentationTimeline.Jc():null};_.t.getPlaybackRate=function(){if(this.J){var a=this.J;a=a.l?0:a.h}else a=0;return a};
|
|
335
|
+
_.t.setPlaybackRate=function(a,b){if(0===a)this.log.warn("A trick play rate of 0 is unsupported!");else if(this.I===aK){if(_.Mk()){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",
|
|
336
|
+
d),_.fJ(c,d,!1,0),e.vc=f);else if(f=e.vc)c.g.debug("Restoring non-trick-mode stream",f),e.vc=null,_.fJ(c,f,!0,0)}}this.h.playbackRateChanged(a)}};_.t.ma=function(){if(this.f&&this.C){var a=oH(this);if(null==a)a=null;else{if(!pH(this.l,a).text){var b=_.WH(a.textStreams,this.Wd,this.gf,this.Pd);b.length&&(b=b[0],pH(this.l,a).text=b)}a=pH(this.l,a).text}b=[];for(var c=_.w(SL(this)),d=c.next();!d.done;d=c.next()){d=d.value;var e=TH(d);e.activeText=d===a;b.push(e)}return b}return[]};_.t.getPeriods=function(){return this.f.periods};
|
|
337
|
+
_.t.getStats=function(){if(this.I!==aK)return _.Fq();sL(this);var a=this.j;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===aK){(b=oH(this))?(a=pH(this.l,b).video,b=pH(this.l,b).audio,a=(a.bandwidth||0)+(b.bandwidth||0)):a=null;a&&(this.H.w=a);if(a=uL(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()};
|
|
338
|
+
_.t.getBandwidthEstimate=function(){return this.h.getBandwidthEstimate()};_.t.getCueTimeline=function(){return this.L};_.t.getTimelineCues=function(){return this.L?EF(this.L,GL(this)):[]};_.t.resetAbr=function(){this.h&&this.h.reset()};_.t.ee=function(){return this.h};
|
|
339
|
+
_.t.addTextTrack=function(a,b,c,d,e,f){var g=this,h,l,m,n,p,q,u,v,z;return _.I(function(A){if(1==A.a){if(g.I!==aK)throw g.log.error("Must call load() and wait for it to resolve before adding text tracks."),Error("State error!");h=oH(g);l=_.dr;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);u=new _.Mj(1,0,q,function(){return[a]},0,null,0);v={id:g.jh++,originalId:null,createSegmentIndex:Promise.resolve.bind(Promise),
|
|
340
|
+
findSegmentPosition:function(){return 1},getSegmentReference:function(H){return 1===H?u:null},adjustSegmentDurations:function(){},getDuration:function(){return q},segmentLookupStrategy:_.YD,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.mf.add(v);h.textStreams.push(v);return _.y(A,aJ(g.a,v),
|
|
341
|
+
2)}if(z=_.UI(g.a,_.Q))pH(g.l,h).text=z;g.mf["delete"](v);g.log.debug("Choosing new streams after adding a text stream");NL(g,h);fL(g);return A["return"](TH(v))})};
|
|
342
|
+
_.t.Xk=function(a){this.log.debug(_.bE,a);try{this.log.debug("onChooseStreams_, choosing variant from ",a.variants);this.log.debug("onChooseStreams_, choosing text from ",a.textStreams);var b=QL(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}}};
|
|
343
|
+
_.t.Wk=function(){this.log.debug("canSwitch_");this.Ea=!1;this.configuration.abr.enabled&&this.h.enable();this.ya&&(gJ(this.a,this.ya,this.Ej,this.Dj),this.ya=null);this.ea&&(_.fJ(this.a,this.ea,!0,0),this.ea=null)};_.t.Po=function(){this.w&&this.w.update()};_.t.Dn=function(){this.C&&this.C.j.vf()};
|
|
344
|
+
_.t.ak=function(a,b,c){if((void 0===c?"":c)===$D)return fL(this),this.wa()||(this.configuration.abr.enabled=!0,this.h.enable()),NL(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===_.cd&&(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)}fL(this);this.wa()||(this.configuration.abr.enabled=!0,this.h.enable());
|
|
345
|
+
NL(this,b)}return c};_.t.qn=function(){this.log.debug("endOfStream called by streaming engine");this.ke=!0};_.t.onError=function(a){if(this.I!==$K&&7001!==a.code&&7E3!==a.code){var b=new _.L(_.ze,{detail:a});a.severity===_.P&&dK(this,_.Rq);this.trigger(b);b.defaultPrevented&&(b.a=!0)}};_.t.bg=function(a){a.type===_.se?this.dispatchEvent(a):"largegap"!==a.type&&(a.type===_.eh?aL(this):"emsg"!==a.type&&(a instanceof _.L?this.dispatchEvent(a):this.log.debug(_.dc,a.type)))};_.t.wa=function(){return this.configuration.abr.enabled};
|
|
346
|
+
_.t.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,uJ(b.a),3);case 3:g=uL(b),h=vL(b);case 4:return l=!1,_.C(p,7),b.log.info("Switching CDN to "+f.url+"."),_.y(p,TL(b,f,g,h),9);case 9:_.Hh(p,6);break;case 7:return m=_.E(p),b.log.info("Switch failed"),
|
|
347
|
+
_.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(),qJ(b.a,!0),b.ba[b.getSourceIndex()]=f,a.f=!0,b.trigger(new _.L(_.ud,{newManifest:f.url})),_.B(p))}})};var $K=0,$J=1,aK=2,eL=[_.qf,_.Ie];UL.prototype.a=function(){return UD};
|
|
348
|
+
UL.prototype.canPlay=function(a,b){if(_.Rl())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 _.ev||_.fv(a.url)in _.gv?!0:!1:!1;if(d&&e){if(_.Mk(2))return 1;if(_.Sl()&&c===_.tm){if(b.streaming.preferNativeHlsOnSafari)return 1;_.Wh("Support for MSE + FairPlay on Apple is experimental. In case of issues, consider using native HLS.")}return 2}return 0};
|
|
349
|
+
UL.prototype.f=function(a){return a===_.qa||a===_.Hb};UL.prototype.create=function(){return new bK};_.gi(new UL);_.it(function(){_.ai("MediaSource.install");if(window.MediaSource)if(window.cast&&cast.__platform__&&cast.__platform__.canDisplayType)_.$h("Patching Chromecast MSE bugs."),ZL();else if(_.Sl()){var a=navigator.appVersion;a=0<=a.indexOf("Version")?parseInt(a.match(/Version\/(\d+)/)[1],10):13;XL();10>=a?(_.$h("Blacklisting MSE on Safari \x3c\x3d 10."),window.MediaSource=null):12>=a?(_.$h("Patching Safari 11 \x26 12 MSE bugs."),VL(),WL()):(_.$h("Patching Safari 13 MSE bugs."),VL())}else _.Mk(2)||_.Mk(3)||
|
|
350
|
+
_.Mk(4)?YL():_.$h("Using native MSE as-is.");else _.$h("No MSE implementation available.")});_.x($L,_.cw);_.t=$L.prototype;
|
|
351
|
+
_.t.append=function(a){function b(e){if(e.startTime>=e.endTime)_.Wh("Invalid cue times: "+e.startTime+" - "+e.endTime),e=null;else{var f=e.payload||"";f=f.replace(/<br\s*\/?>/igm,"\n");f=_.T.Wg(f);f=new VTTCue(e.startTime,e.endTime,f);f.line=-1;try{f.align=_.wd}catch(g){f.align="middle"}e.writingMode===_.Vg?f.vertical="lr":e.writingMode===_.Wg&&(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?
|
|
352
|
+
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)};_.t.remove=function(a,b){if(!this.a)return!1;aM(this.a,function(c){return c.startTime<b&&c.endTime>a});return!0};_.t.isTextVisible=function(){return this.a.mode===_.jg};_.t.setTextVisibility=function(a){null!==this.a&&(this.a.mode=a?_.jg:_.Fe)};_.t.destroy=function(){this.a&&aM(this.a,function(){return!0});this.a=null;return Promise.resolve()};bM.prototype.a=function(){return!0};bM.prototype.create=function(a){return new $L(a)};_.wq("single-native",new bM);};
|
|
348
353
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
349
354
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
350
355
|
else{_=this.clpp._;(f.call(g,this));}
|