@castlabs/prestoplay 6.20.0 → 6.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +7 -7
- package/cjs/cl.cast.js +109 -110
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +553 -550
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +78 -77
- package/cjs/cl.externs.js +81 -97
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +69 -69
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +29 -29
- package/cjs/cl.ima.js +22 -24
- package/cjs/cl.mse.js +305 -305
- package/cjs/cl.muxdata.js +15 -15
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +13 -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 +25 -25
- package/cjs/cl.tizen.js +70 -69
- package/cjs/cl.ttml.js +29 -29
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +13 -13
- package/cjs/cl.vr.js +18 -18
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.yospace.js +9 -0
- package/cjs/cl.youbora.js +38 -20
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +88 -89
- package/cl.conviva.js +27 -27
- package/cl.core.js +471 -468
- package/cl.crypto.js +8 -8
- package/cl.dash.js +74 -72
- package/cl.externs.js +71 -99
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +74 -74
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +16 -17
- package/cl.mse.js +276 -276
- package/cl.muxdata.js +13 -13
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +11 -11
- 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 -0
- package/cl.youbora.js +27 -15
- package/package.json +3 -1
- package/typings.d.ts +123 -24
package/cjs/cl.mse.js
CHANGED
|
@@ -1,322 +1,322 @@
|
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
_.
|
|
25
|
-
_.
|
|
26
|
-
_.
|
|
27
|
-
_.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
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>=
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
h.h.readyState&&!h.h.paused){var l=
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
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};
|
|
44
|
-
|
|
45
|
-
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};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
_.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
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))};_.
|
|
53
|
-
|
|
2
|
+
var f=function(window){var UB,VB,WB,XB,YB,ZB,$B,aC,bC,cC,dC,eC,fC,gC,hC,iC,jC,kC,lC,mC,nC,oC,pC,qC,rC,sC,tC,uC,vC,wC,xC,yC,zC,AC,BC,CC,DC,EC,HC,IC,JC,KC,LC,MC,NC,OC,PC,QC,RC,TC,UC,VC,WC,XC,YC,ZC,$C,cD,dD,fD,gD,hD,iD,jD,kD,lD,nD,oD,pD,qD,vD,wD,xD,yD,zD,AD,BD,DD,HD,ID,KD,LD,MD,ND,PD,QD,RD,TD,UD,VD,WD,XD,YD,ZD,$D,aE,cE,hE,nE,sE,vE,kE,uE,wE,xE,yE,zE,AE,BE,CE,DE,EE,IE,KE,LE,ME,JE,OE,NE,PE,QE,TE,UE,VE,SE,RE,WE,$E,bF,ZE,cF,YE,aF,XE,eF,dF,fF,gF,hF,kF,lF,mF,nF,oF,qF,rF,sF,tF,uF,wF,xF,yF,AF,BF,zF,CF,DF,EF,FF,GF,IF,JF,HF,RF,QF,SF,
|
|
3
|
+
TF,UF,YF,WF,$F,aG,bG,dG,cG,eG,gG,fG,mG,nG,jG,hG,kG,lG,oG,pG,sG,rG,tG,uG,vG,iG,wG,qG,zG,AG,CG,BG,DG,FG,EG,GG,JG,HG,IG,LG,KG,MG,NG,OG,RG,TG,SG,VG,UG,XG,YG,ZG,bH,aH,$G,cH,eH,dH,fH,gH,hH,iH,jH,kH,nH,mH,lH,pH,oH,rH,vH,xH,yH,DH,GH,IH,KH,sH,MH,PH,QH,RH,TH,UH,WH,XH,ZH,LH,aI,BH,cI,bI,zH,JH,fI,dI,YH,$H,hI,gI,eI,oI,pI,jI,rI,kI,mI,uI,tI,nI,sI,vI,AH,VH,lI,SH,CH,EH,uH,iI,FH,qI,NH,OH,wI,zI,AI,BI,CI,DI,GI,HI,FI,NI,UI,EI,TI,VI,OI,PI,QI,$I,WI,LI,KI,JI,MI,YI,ZI,RI,SI,IJ,CJ,LJ,MJ,NJ,RJ,OJ,NF,LF,OF,MF,PF,KF,YJ,WJ,$J,
|
|
4
|
+
JJ,HJ,QJ,ZJ,XJ,bK,PJ,TJ,cJ,SJ,cK,GJ,dK,eK,hK,KJ,FJ,gK,fK,XI,aK,VJ,jK,DJ,UJ,iK,II,kK,BJ,AJ,lK,mK,nK,oK,pK,qK,rK,sK,tK;UB=" and the media start time is ";VB=" between media times and segment times for ";WB=" buffer";XB=" buffer. Range:";YB=" is being or has been set up";ZB=" range:";$B=" with element state: ";aC=". Adjusting timestampOffset.";bC=". The segment start time is ";cC="\x3c/DATA\x3e\x3c/WRMHEADER\x3e";dC="\x3c/LA_URL\x3e";eC="\x3cLA_URL\x3e";fC='\x3cWRMHEADER xmlns\x3d"http://schemas.microsoft.com/DRM/2007/03/PlayReadyHeader" version\x3d"';
|
|
5
|
+
gC="Aborting operations for ";hC="Appended audio segment ";iC="Appended video segment ";jC="Appending data to ";kC="Buffer:";lC="Cannot get segment, period ID unknown";mC="Choosing new streams after key status change";nC="Detected a delta of ";oC="Done Aborting operations for ";pC="Done Appending data to ";qC="Done Flushing buffer for ";rC="Done Removing data from ";sC="Done Setting append window for ";tC="Done Setting timestamp offset for ";uC="Failed to abort operations for ";vC="Failed to append data for ";
|
|
6
|
+
wC="Failed to flush buffer for ";xC="Failed to remove data from ";yC="Failed to set append window for ";zC="Failed to set timestamp offset for ";AC="Flushing buffer for ";BC="IterateSegmentReference";CC="Jumping forward";DC="MediaSource threw QuotaExceededError:";EC="No more scheduled operations for ";_.FC="No stream with id";_.GC="Player is in ERROR state and can not switch to ";HC="PrestoPlay TextTrack";IC="QuotaExceededError";JC="Removing audio from variant - audio not compatible with platform";
|
|
7
|
+
KC="Removing data from ";LC="Reset transmuxers.";MC="Setting append window for ";NC="Setting playback rate to\x3d";OC="Setting timestamp offset for ";PC="Skip buffer flush for ";QC="Starting next operation for ";RC="Update-End received for ";_.SC="Updating manifest...";TC="X-Playback-Session-Id";UC="bufferBehind\x3d";VC="bufferedBehind\x3d";WC="calling onCanSwitch()...";XC="cannot find segment";YC="clpp.mse.Player";ZC="currentPeriod.startTime\x3d";$C="failed to get buffered range for ";_.aD="getSegmentNextReference";
|
|
8
|
+
_.bD="iterateSegmentReference";cD="key-restriction";dD="manifest.start";_.eD="onChooseStreams_";fD="presentationTime:";gD="presentationTime\x3d";hD="reference.endTime\x3d";iD="reference.position\x3d";jD="reference.startTime\x3d";kD="sourceopen";lD="startstreaming";_.mD="subtitles";nD="switch: Stream ";oD=function(a,b){return _.Yg[a]=b};pD=function(a,b){for(var c in a.a)b(c,a.a[c])};
|
|
9
|
+
qD=function(a){for(var b=a.a+a.f.byteOffset,c=void 0;_.Zm(a);)if(0===_.an(a)){c=a.a+a.f.byteOffset-1;break}a=a.f.buffer.slice(b,c);return _.R.aa(a)};_.sD=function(a){var b=new Uint8Array(rD),c=4+b.byteLength+a.j.byteLength+4+a.f.byteLength,d=new _.Vm(c,!1);_.V(d,c);_.Xm(d,b);_.Xm(d,a.j);_.V(d,a.f.byteLength);_.Xm(d,a.f);return _.zj(d.buffer)};
|
|
10
|
+
_.tD=function(a,b,c,d){var e=_.Mj(b);if(8!==e.byteLength)e="";else{var f=_.go(e);e=_.Jj(f);b:switch(f=f.byteLength,_.Ih("Trying to create PlayReady header in version",a),a){case "4.0.0.0":e=[fC+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?eC+d+dC:"",cC].join("");break b;case "4.1.0.0":e=[fC+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?eC+d+dC:"",cC].join("");break b;case "4.2.0.0":case "4.3.0.0":e=[fC+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?eC+d+dC:"",cC].join("");break b;default:_.Dh("Cannot create PlayReady header in version",a),e=""}}if(!e)return null;_.Ih("New payload",e);e=_.zj(_.R.We(e,!0));return new _.co(_.ho,
|
|
12
|
+
b,d||null,e,a,c)};_.uD=function(a,b){return b===a.version?a:_.tD(b,a.a,a.l||void 0,a.h||void 0)};vD=function(a,b){a:{if(b){var c=_.w(a.f.keys());for(var d=c.next();!d.done;d=c.next()){d=a.f.get(d.value);for(var e=0;e<d.kb.length;e++)if(d.kb[e]===b){c=d;break a}}}c=null}return c?c.Sa:null};wD=function(a,b){if(_.sl("Edge/"))return!0;b=b.toLowerCase();if(_.ok()&&b.includes('codecs\x3d"ac-3"')){var c=b.replace("ac-3",_.je);return a.J.has(b)||a.J.has(c)}return a.J.has(b)};
|
|
13
|
+
xD=function(a,b){var c=a.o.get(b);return!(!c||c!==_.cf&&c!==_.we)};yD=function(a,b){var c=b.audio,d=b.video;if(c&&c.encrypted&&(c=_.$o(c),!wD(a,c))||d&&d.encrypted&&(d=_.$o(d),!wD(a,d)))return!1;var e=a.keySystem();return 0===b.drmInfos.length||b.drmInfos.some(function(f){return f.keySystem===e})};zD=function(a,b){if(null==a.a)return null;var c=a.a[a.a.length-1];return c?c[b]:null};AD=function(a){a=zD(a,_.Wv);return null==a?null:a};
|
|
14
|
+
BD=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.Rb()+d.getDuration();)c+=1,d=a.a[c]||null;a.f=d?c:a.a.length-1}else a.f=-1};_.CD=function(a,b){return a.concat(b)};DD=function(){};_.ED=function(a,b){if(0===b.length)return a;var c=b.map(function(d){return new _.Ti(d)});return a.map(function(d){return new _.Ti(d)}).map(function(d){return c.map(d.resolve.bind(d))}).reduce(_.CD,[]).map(function(d){return d.toString()})};
|
|
15
|
+
_.FD=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:b||[],keyIds:[],periodId:c?c:null}};_.GD=function(a,b,c,d,e){this.Xa=a;this.ya=b;this.la=c;this.keyInfo=d||null;this.Xc=_.M.R(e)?!1:!!e};HD=function(a,b){a=_.qj(a);b=_.qj(b);var c=a.split("-"),d=b.split("-");return c[0]===d[0]&&1===c.length&&2===d.length};
|
|
16
|
+
ID=function(a){return a.language?_.qj(a.language):a.audio&&a.audio.language?_.qj(a.audio.language):a.video&&a.video.language?_.qj(a.video.language):_.rg};
|
|
17
|
+
_.JD=function(a,b){for(var c=_.qj(a),d=new Set,e=_.w(b),f=e.next();!f.done;f=e.next())d.add(_.qj(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,HD(f,c))return f;e=_.w(d);for(f=e.next();!f.done;f=e.next()){var g=f=f.value,h=c;g=_.qj(g);h=_.qj(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,HD(c,e))return e;return null};
|
|
18
|
+
KD=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};LD=function(a,b){var c=_.jl(b,a);if(!c)return!1;c=c();var d=c.isMuxed(a,b);c.destroy();return d};MD=function(a){for(var b=[a.mimeType],c=_.w(_.Jv),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
|
+
ND=function(a){return a.split(",").map(function(b){return b.trim()}).filter(function(b){return 0<b.length})};_.OD=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(",")};PD=function(a,b){for(var c=new _.mm(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};QD=function(){return!!window.SourceBuffer&&!!SourceBuffer.prototype&&!!SourceBuffer.prototype.changeType};
|
|
20
|
+
RD=function(a,b){return a.start-b.start};_.SD=function(a){this.h=void 0===a?null:a;this.log=new _.K("clpp.renditions");this.T=[];this.f=this.player=null;this.a=!1};TD=function(a){return a.T.map(function(b){return{start:b.start,end:b.end,width:b.width,height:b.height,bandwidth:b.bandwidth,rendition:b.rendition}})};UD=function(a){a.player&&(a.player.off(_.Of,a.Sc),a.a&&a.player.off(_.ng,a.Sc));a.player=null};VD=function(a){a.player&&a.player.trigger(new _.L(_.fd))};WD=function(a){a.player&&a.player.trigger(new _.L(_.fd))};
|
|
21
|
+
XD=function(a){if(a.player){for(var b=!1,c={},d=0;d<a.T.length;d++){var e=a.T[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(_.ng,a.Sc,a),a.a=!0):!b&&a.a&&(a.log.debug("Stop tracking timeupdates"),a.player.off(_.ng,a.Sc),a.a=!1)}};YD=function(a,b,c){a.T=a.T.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(_.Gg))};
|
|
22
|
+
ZD=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};$D=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};aE=function(a,b){for(var c=0;c<a.length;c++)if($D(a[c]).has(b))return c;return-1};
|
|
23
|
+
cE=function(a,b){Array.from($D(a)).forEach(function(c){c.segmentIndex&&_.bE(c.segmentIndex,b)})};_.dE=function(a){this.h=Math.exp(Math.log(.5)/a);this.f=this.a=0};_.eE=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)};_.fE=function(a){return a.a/(1-Math.pow(a.h,a.f))};
|
|
24
|
+
_.gE=function(a,b,c,d,e,f,g,h){a=_.Yj(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};hE=function(a){this.a=this.h=0;this.f=a};_.iE=function(a,b,c){a.h=b;a.a=c};
|
|
25
|
+
_.jE=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.N=void 0===e?!0:e;this.g=new _.K("clpp.media.PresentationTimeline");this.P=f;this.L=null;this.a=new hE(d);this.J=null;this.B=this.j.type||null};_.lE=function(a,b){a.L={offsetDateTime:b-kE(a),seekRangeStartDateTime:b}};_.mE=function(a,b){a.l=b;a.C=b;a.a.f=b};nE=function(a){return 2===a.j.version?a.a.f?a.a.a:null:a.l?a.f:a.C?a.o:null};
|
|
26
|
+
_.qE=function(a,b,c){if(0!==b.length){var d=b[b.length-1].endTime+c;_.oE(a,b[0].startTime+c);a.h=b.reduce(function(e,f){return Math.max(e,f.endTime-f.startTime)},a.h);_.pE(a,d);null!=a.G&&a.N&&(a.G=(Date.now()+a.I)/1E3-(a.o||0)-a.h);a.g.debug("notifySegments: maxSegmentDuration\x3d"+a.h)}};_.oE=function(a,b){a.w=null==a.w?b:Math.min(a.w,b)};_.pE=function(a,b){a.o=Math.max(a.o||0,b)};_.rE=function(a,b){a.h=Math.max(a.h,b);a.g.debug("notifyNewSegmentDuration: maxSegmentDuration\x3d"+a.h)};
|
|
27
|
+
_.tE=function(a){return 2===a.j.version?a.a.Rb():Infinity===a.A?0:Math.max(0,sE(a)-a.A)};sE=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};vE=function(a,b){if(2===a.j.version)return a.a.Rb();var c=Math.max(a.w,0);return Infinity===a.A?Math.ceil(1E3*c)/1E3:Math.max(c,Math.min(sE(a)-a.A+b,uE(a)))};
|
|
28
|
+
kE=function(a){return 2===a.j.version?a.a.Rb():vE(a,0)};uE=function(a){var b=a.Vd()&&!a.C?a.K:0;return 2===a.j.version?a.a.a-b:Math.max(0,sE(a)-b)};wE=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}};xE=function(){this.f=function(){};this.h=function(){};this.a=new Set};
|
|
29
|
+
yE=function(a,b,c){a.f=b;a.h=c};zE=function(a,b){for(var c=[],d=!1,e={},f=_.w(b),g=f.next();!g.done;e={Fc:e.Fc},g=f.next())e.Fc=g.value,a.a.has(e.Fc)||(c.push(e.Fc),g=Array.from(a.a.values()).some(function(h){return function(l){return l.id===h.Fc.id}}(e)),e.Fc.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()};
|
|
30
|
+
AE=function(a,b){b=void 0===b?!1:b;return Array.from(a.a.values()).map(function(c){return wE(c,b)}).sort(function(c,d){return c.startTime-d.startTime})};BE=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 _.mu("crop",a,d.endTime?d.endTime-a:Infinity,!1))};CE=function(a){var b=a.a.Ch(),c=a.h,d=b?b.id:null;(c?c.id:null)!==d&&b&&a.f(new _.L(_.Rf,{id:d}));a.h=b;"basic"===a.o.timeline&&(a.j.a=b)};
|
|
31
|
+
DE=function(a,b,c){this.h=a;this.a=b;this.f=c;this.g=new _.K("clpp.media.SegmentIterator")};EE=function(a){var b=a.h.get(a.a);if(!b)return null;0<b.a.length&&b.Xa().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};_.FE=function(a){this.a=a;this.g=new _.K("clpp.media.SegmentIndex")};_.GE=function(a){return a.a.length?a.a[a.a.length-1].endTime:0};_.HE=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};
|
|
32
|
+
IE=function(a,b){var c=a.Uc(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 DE(a,c,e)};_.bE=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)};
|
|
33
|
+
KE=function(a,b){this.h=a;this.l=JE(a);this.a=a.a.currentTime;this.j=Date.now()/1E3;this.o=b;this.f=function(){}};LE=function(a,b){a.f=b};ME=function(a){this.a=a};JE=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};
|
|
34
|
+
OE=function(a,b,c,d,e){var f=this;this.a=a;this.H=b;this.l=c;this.G=e;this.h=new _.Sh;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,_.Lg,function(){return NE(f)});this.w=(new _.pl(function(){NE(f)})).yb(.25)};
|
|
35
|
+
NE=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 _.mm(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=JE(d);d=d.a.currentTime;b=Date.now()/1E3;if(a.a!==d||a.l!==c)a.j=
|
|
36
|
+
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>=uE(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:_.Hh("Ignoring large gap at",c,"size",g)}if(b||h)0===e?_.Hh(CC,g,"seconds because of gap before start time of",f):_.Hh(CC,g,"seconds because of gap starting at",d.end(e-1),"and ending at",f),a.B=!0,a.a.currentTime=f}}}}};
|
|
37
|
+
PE=function(a){var b=this;this.f=a;this.o=10;this.l=this.h=this.j=0;this.a=new _.pl(function(){0>=b.j?(_.Dh(["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--)})};QE=function(a,b){a.h=a.f.currentTime;a.l=b;a.j=a.o;a.f.currentTime=b;a.a.yb(.1)};TE=function(a,b,c,d){this.a=a;this.j=b;this.o=d;this.A=c;this.l=!1;this.f=new _.Sh;this.h=new PE(a);this.w=!1;0<a.readyState?RE(this,c):SE(this,c)};
|
|
38
|
+
UE=function(a){return a.l?a.a.currentTime:a.A};VE=function(a,b){0<a.a.readyState?QE(a.h,b):SE(a,b)};SE=function(a,b){a.A=b;a.f.off(a.a,_.Ge);a.f.one(a.a,_.Ge,function(){RE(a,b)})};RE=function(a,b){a.w||(a.w=!0,a.o&&a.o());.001>Math.abs(a.a.currentTime-b)?WE(a):(a.f.one(a.a,_.Vf,function(){WE(a)}),QE(a.h,0===a.a.currentTime?b:a.a.currentTime))};WE=function(a){_.ul()&&!a.l&&a.j();a.l=!0;a.f.on(a.a,_.Vf,function(){return a.j()})};
|
|
39
|
+
$E=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 OE(a,b.presentationTimeline,c,XE(this,a,c),f);this.f=new TE(a,function(){a:{var l=h.j;var m=l.B;l.B=!1;l.C=!0;l.A=!1;l.j=!1;l=UE(h.f);var n=YE(h,l);if(.001<Math.abs(n-l)){var p=(new Date).getTime()/1E3;if(!h.w||h.w<p-1){h.w=p;VE(h.f,n);m=void 0;break a}}h.g.debug("Seek to "+l);h.A(m?1:0);m=void 0}return m},ZE(this,d,g),function(){h.j.I=!0});this.o=(new _.pl(function(){if(0!==
|
|
40
|
+
h.h.readyState&&!h.h.paused){var l=UE(h.f),m=kE(h.a),n=uE(h.a);3>n-m&&(m=n-3);l<m&&(m=YE(h,l),h.g.info("Jumping forward "+(m-l)+" seconds to catch up with the seek range."),h.h.currentTime=m)}})).yb(.25);this.g=new _.K("clpp.mse.Playhead")};bF=function(a){var b=UE(a.f);return 0<a.h.readyState&&!a.h.paused?aF(a,b):b};ZE=function(a,b,c){null==b?b=Infinity>a.a.getDuration()||c?kE(a.a):uE(a.a):0>b&&(b=uE(a.a)+b);return cF(a,aF(a,b))};
|
|
41
|
+
cF=function(a,b){var c=a.a.getDuration();return b>=c?c-a.l.durationBackoff:b};
|
|
42
|
+
YE=function(a,b){if("startover"===a.a.B)return b;var c=new _.mm(a.h.buffered);c=c.Gb.bind(c);var d=Math.max(a.B,a.l.rebufferingGoal),e=a.l.safeSeekOffset,f=kE(a.a),g=uE(a.a),h=a.a.getDuration();3>g-f&&(f=g-3);var l=vE(a.a,d),m=vE(a.a,e);d=vE(a.a,d+e);if(b>=h)return a.g.debug("Playhead past duration."),cF(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");
|
|
43
|
+
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};aF=function(a,b){var c=kE(a.a);if(b<c)return c;c=uE(a.a);return b>c?c:b};
|
|
44
|
+
XE=function(a,b,c){if(!c.stallEnabled)return null;var d=c.gapDetectionThreshold,e=c.stallSkip;c=new KE(new ME(b),c.stallThreshold);LE(c,function(f,g){a.g.warn("Stall detected at "+f+" for "+g+" seconds.");if(e){var h=new _.mm(b.buffered),l;if(l=_.sl("Edge/")||_.sl("Trident/")||_.ok()||_.ul())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=
|
|
45
|
+
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};eF=function(a){var b=this;this.f=a;this.a=new Set;this.h=(new _.pl(function(){dF(b,!1)})).yb(.25)};dF=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)};
|
|
46
|
+
fF=function(a,b){var c=a.offset||0;return b<a.startTime+c?1:b>a.endTime+c?3:2};
|
|
47
|
+
gF=function(a){var b=this;this.j=a;this.o=new Map;this.a=function(){};this.f=function(){};this.h=function(){};this.w=[{Dc:null,Cc:2,wc:function(c,d){return b.a(c,d)}},{Dc:1,Cc:2,wc:function(c,d){return b.a(c,d)}},{Dc:3,Cc:2,wc:function(c,d){return b.a(c,d)}},{Dc:2,Cc:1,wc:function(c,d){return b.f(c,d)}},{Dc:2,Cc:3,wc:function(c,d){return b.f(c,d)}},{Dc:1,Cc:3,wc:function(c,d){return b.h(c,d)}},{Dc:3,Cc:1,wc:function(c,d){return b.h(c,d)}}]};hF=function(a,b,c,d){a.a=b;a.f=c;a.h=d};
|
|
48
|
+
_.iF=function(a){_.su[a]&&delete _.su[a]};_.jF=function(a){_.qu[a]&&delete _.qu[a]};kF=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};lF=function(a,b){if(b!==_.Sc){var c=_.bv[b];if(!c)throw new _.N(_.P,2,2012,"Text parser is unavailable for "+b);a.w=new c(a.C)}};
|
|
49
|
+
mF=function(a,b,c,d){return Promise.resolve().then(function(){if(a.w&&a.j)if(null==c||null==d)a.w.parseInit(_.zj(b));else{var e={periodStart:a.A,segmentStart:c,segmentEnd:d};e=a.w.parseMedia(_.zj(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)}})};
|
|
50
|
+
nF=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,[])};
|
|
51
|
+
oF=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 _.Hi(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=
|
|
52
|
+
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))};_.pF=function(a){a=a.toLowerCase();return _.bv[a]||window.muxjs&&a===_.Sc?!0:!1};
|
|
53
|
+
qF=function(a,b){var c=String(_.Fk++);c=new _.zk(c,a);c.mimeType=_.Ak(b.mimeType);if(a===_.S||a===_.Bk)c.label=_.Ak(b.label),c.language=_.Ak(b.language),c.originalLanguage=_.Ak(b.originalLanguage);a===_.Ck?(c.frameRate=b.frameRate,c.roles=b.roles,c.trickPlay=b.trickPlay):a===_.Bk?(c.channelsCount=b.channelsCount,c.roles=b.audioRoles||[],c.mimeType=_.Ak(b.audioMimeType)):(c.kind=_.Ak(b.kind),c.roles=b.roles);c.accessibility=a===_.Ck||a===_.Bk?(b.accessibility||[]).filter(function(d){return d.type===
|
|
54
54
|
a}):b.accessibility||[];return c};
|
|
55
|
-
|
|
56
|
-
c.renditions.push(d);return a||d};
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
a[0].presentationTimeline.uc())&&_.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
n)}))}else if(b===_.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
a.h=b}};
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
m);_.
|
|
75
|
-
|
|
76
|
-
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=
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
"variant.video",
|
|
84
|
-
|
|
55
|
+
rF=function(a,b,c){var d=new _.Ik(a===_.Ck?""+b.videoId:a===_.Bk?""+b.audioId:""+b.id,c);switch(a){case _.Ck:d.codec=_.Ak(b.videoCodec);d.bandwidth=b.videoBandwidth||b.bandwidth;d.width=b.width;d.height=b.height;d.originalId=b.originalVideoId;break;case _.Bk:d.codec=_.Ak(b.audioCodec);d.bandwidth=b.audioBandwidth||b.bandwidth;d.originalId=b.originalAudioId;break;default:d.codec=_.Ak(b.codecs),d.originalId=b.originalTextId}(a=c.renditions.find(function(e){return _.M.ma(e,d,null,["id","track"])}))||
|
|
56
|
+
c.renditions.push(d);return a||d};sF=function(a,b){var c=a.reduce(function(d,e){b===_.Ck?null===e.videoId||d[e.videoId]&&!e.active||(d[e.videoId]=e):b===_.Bk&&(null===e.audioId||d[e.audioId]&&!e.active||(d[e.audioId]=e));return d},{});return Object.values(c)};tF=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};
|
|
57
|
+
uF=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};_.vF=function(a,b){a.forEach(function(c){c.startTime+=b;c.endTime+=b})};wF=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}};xF=function(a){return Object.assign({},a,{periods:a.periods.map(function(b){return Object.assign({},b)})})};
|
|
58
|
+
yF=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=_.ah(a[0].periods).concat(),d={},e=1;e<a.length;d={ne:d.ne},e++)d.ne=wF(a[e-1]).end,_.vF(a[e].periods,d.ne),c.push.apply(c,_.ah(a[e].periods)),a[e].cues.forEach(function(f){return function(g){g.offset=f.ne}}(d));d=a.flatMap(function(f){return f.cues});c={periods:c,presentationTimeline:b,minBufferTime:0,cues:d};d=wF(c).end;_.iE(b.a,0,d);(d=
|
|
59
|
+
a[0].presentationTimeline.uc())&&_.lE(b,d.seekRangeStartDateTime);return c};AF=function(a,b){try{if(1===a.length)return a[0];if(!a.every(zF))throw new _.Oi("Period durations must be finite");return yF(a,b)}catch(c){throw new _.N(_.P,7,7003,"Failed to join manifests into a continuous playlist!",c);}};
|
|
60
|
+
BF=function(a,b){var c=b.periods[0].configurationId,d=_.ah(a.periods).concat().filter(function(f){return f.configurationId!==c}),e=a.presentationTimeline;d={periods:d,presentationTimeline:e,minBufferTime:0};_.mE(e,b.presentationTimeline.l);return AF([d,b],e)};zF=function(a){return a.periods.every(function(b){return null!=b.endTime&&0<=b.endTime&&isFinite(b.endTime)})};
|
|
61
|
+
CF=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}};DF=function(a,b){return b.find(function(c){return c.id===a.id})||null};EF=function(){this.g=new _.K("cl.api.mse.TrackManager");this.m=null;this.h=[];this.a=new Map;this.f=new Map};FF=function(a,b){return a.h.filter(function(c){return c.type===b})};GF=function(a,b){var c=a.a.get(b)||null;return c&&c.track};
|
|
62
|
+
IF=function(a,b,c){if(!c||GF(a,c.type)!==c||a.m.ra())switch(b){case _.Ck:a.hb(c&&c.renditions[0]);break;case _.Bk:a.vb(c&&c.renditions[0]);break;case _.S:a.wb(c&&c.renditions[0]);break;default:HF(a,b,c&&c.renditions[0])}};JF=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)};
|
|
63
|
+
HF=function(a,b,c,d){d=void 0===d?!1:d;if(a.m&&((a.a.get(b)||null)!==c||a.m.ra())){var e=a.m;if(c){if(0>a.h.indexOf(c.track))throw Error("Unknown rendition with ID "+c.id);if(b!==c.track.type)throw Error("Types mismatch");a.g.debug("Activate rendition type\n "+b+" with ID: "+c.id);if(b===_.S){var f=e.ia().find(function(n){return n.id===parseInt(c.id,10)});f&&(a.f.set(b,c),JF(a,c),e.trigger(new _.L(_.hm)),KF(e,!0).then(function(){LF(e,f)})["catch"](function(n){a.g.warn("Error while activating track",
|
|
64
|
+
n)}))}else if(b===_.Bk)a.f.set(b,c),MF(e,parseInt(c.id,10));else if(b===_.Ck){var g=a.a.get(_.Bk)||null,h=null;if(g){var l=NF(e).filter(function(n){return n.videoId===parseInt(c.id,10)});h=l.find(function(n){return n.audioId===parseInt(g.id,10)})||null;if(!h){a.g.debug("Unable to find exact variant. Searching for equivalent");var m=g.track.renditions.map(function(n){return n.id}).filter(function(n){return n!==g.id});h=l.find(function(n){return m.find(function(p){return p===n.audioId})})||null}}else h=
|
|
65
|
+
NF(e).find(function(n){return n.videoId===parseInt(c.id,10)})||null;h?(a.f.set(b,c),OF(e,h,d)):a.g.warn("Cannot find matching variant")}}else a.g.debug(_.Ha+b),(h=GF(a,b))&&(b===_.S?KF(e,!1).then(function(){a.a.set(b,null);e.trigger(new _.L(_.hm))})["catch"](function(n){a.g.warn("Error while de-activating text tracks",n)}):b===_.Bk?a.g.info("Enabling ABR for audio is not supported"):b===_.Ck&&h.trickPlay?a.g.info("Enabling ABR for trick play tracks is not supported"):OF(e,null,d))}};
|
|
66
|
+
RF=function(a){if(a.m){a.g.debug("Track list change detected, updating track list");for(var b=[],c=_.w(Object.values(_.Iv)),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.ia());for(var e=d.next();!e.done;c={lc:c.lc},e=d.next()){e=e.value;c.lc=qF(_.S,e);var f=b.find(function(h){return function(l){return h.lc.ma(l)}}(c));c.lc=f||c.lc;var g=rF(_.S,e,c.lc);e.active&&a.a.set(_.S,g);f||b.push(c.lc)}PF(a.m)||a.a.set(_.S,null);c=NF(a.m);QF(a,b,c,_.Ck);QF(a,b,c,_.Bk);
|
|
67
|
+
a.h=b}};QF=function(a,b,c,d){var e=sF(c,d);c={};e=_.w(e);for(var f=e.next();!f.done;c={mc:c.mc},f=e.next()){f=f.value;c.mc=qF(d,f);var g=b.find(function(l){return function(m){return l.mc.ma(m)}}(c));c.mc=g||c.mc;var h=rF(d,f,c.mc);f.active&&a.a.set(d,h);g||b.push(c.mc)}};
|
|
68
|
+
SF=function(a,b,c){if(b){a.h.length||RF(a);for(var d=b.type,e=a.a.get(d)||null,f,g=_.w(FF(a,d)),h=g.next();!h.done&&!(f=h.value.renditions.find(function(l){return parseInt(l.id,10)===b.id}));h=g.next());f&&e!==f&&(JF(a,f),d===_.Bk?a.m.trigger(new _.L(_.gm)):d===_.Ck&&a.m.trigger(new _.L(_.Hg,{details:{width:f.width||0,height:f.height||0,bandwidth:f.bandwidth,track:f.track,abrSelection:c}})))}};TF=function(){this.f=new _.dE(2);this.h=new _.dE(5);this.a=0};
|
|
69
|
+
UF=function(){this.a=new muxjs.mp4.CaptionParser;this.l=[];this.j={}};_.VF=function(){};_.XF=function(a,b,c,d,e){this.j=a;this.C=c;this.f={};this.K=!1;this.a=null;this.h={};this.l=new _.Sh;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=WF(this,this.J);this.N=!0;this.g=new _.K("clpp.mse.MediaSourceEngine")};
|
|
70
|
+
YF=function(a){var b=_.kl(a.mimeType,a.codecs),c=MD(a);return _.pF(b)||_.pt(c)||(_.jl(b,a.type)?!0:!1)};WF=function(a,b){if(window.ManagedMediaSource){a.j.disableRemotePlayback=!0;var c=new ManagedMediaSource;a.l.one(c,kD,function(){URL.revokeObjectURL(a.A);b.resolve()});a.l.on(c,lD,function(){a.N=!0});a.l.on(c,"endstreaming",function(){a.N=!1});a.A=ZF(c);a.j.src=a.A;return c}c=new MediaSource;a.A=ZF(c);a.l.one(c,kD,function(){URL.revokeObjectURL(a.A);b.resolve()});a.j.src=a.A;return c};
|
|
71
|
+
$F=function(a,b){b.forEach(function(c,d){var e=a.o.addSourceBuffer(c);a.l.on(e,_.ne,a.S.bind(a,d));a.l.on(e,"updateend",a.Vc.bind(a,d));a.f[d]=e;a.h[d]=[];a.G[d]=!1});a.K=b.has(_.$c)&&b.has(_.r)};aG=function(a,b){try{return new _.mm(a.f[b].buffered,b)}catch(c){return b in a.f&&a.g.error($C+b,c),null}};bG=function(a,b){if(!a.f[b])return"";var c=aG(a,b);return c?c.toString():""};dG=function(a,b,c,d,e){return[cG(a,b,a.ek.bind(a,b)),cG(a,b,a.dh.bind(a,b,c)),cG(a,b,a.fk.bind(a,b,d,e))]};
|
|
72
|
+
cG=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&&eG(a,b);return c.p};eG=function(a,b){var c=a.h[b][0];if(c)try{a.g.debug(QC+b),c.start()}catch(d){d.name===IC?c.p.reject(new _.N(_.P,3,3017,{type:b})):c.p.reject(new _.N(_.P,3,3015,{mediaError:d})),fG(a,b)}else a.g.debug(EC+b)};
|
|
73
|
+
gG=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.f)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();_.D(p,2);return _.y(p,Promise.all(c),4);case 4:_.oh(p,3);break;case 2:g=_.E(p);for(h in a.f)a.h[h].length&&a.h[h].shift();return p["return"](Promise.reject(g));case 3:for(l in a.f);_.D(p,5,6);return _.y(p,b(),6);case 6:_.ph(p);for(m in a.f)fG(a,
|
|
74
|
+
m);_.qh(p);break;case 5:return n=_.E(p),p["return"](Promise.reject(new _.N(_.P,3,3015,{mediaError:n})))}})};fG=function(a,b){a.h[b].shift();eG(a,b)};
|
|
75
|
+
mG=function(a,b,c,d){var e=a.periods.flatMap(function(n){return n.variants});if(b.length||c.length)e=hG(e,b,c);e=iG(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={cf:c.cf},d++)c.cf=b[d],l=new Set(_.ah(l).concat().filter(function(n){return function(p){return n.cf.has(p)}}(c)));
|
|
76
|
+
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=jG(e);var m=kG(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(lG(n)===m)return!0;_.Ih("Dropping Variant (better codec available)",n);return!1})};
|
|
77
|
+
nG=function(a,b,c,d){var e=a.periods.flatMap(function(f){return f.variants});if(b.length||c.length)e=hG(e,b,c);e=iG(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)})};jG=function(a){var b=new _.Ph;a=_.w(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=lG(c);b.push(d,c)}return b};
|
|
78
|
+
hG=function(a,b,c){if(!b.length&&!c.length)return a;var d=a.filter(function(g){return(g=g.audio)&&c.length&&(g=_.OD(g.codecs),c.includes(g))?!0:!1}),e=a.filter(function(g){return(g=g.video)&&b.length&&(g=_.OD(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};
|
|
79
|
+
kG=function(a){var b="",c=Infinity;pD(a,function(d,e){var f=e.reduce(function(g,h){return g+h.bandwidth||0},0)/e.length;_.Ih(_.Gd,d,"avg bandwidth",f);f<c&&(b=d,c=f)});return b};lG=function(a){var b="";a.video&&(b=_.OD(a.video.codecs));var c="";a.audio&&(c=_.OD(a.audio.codecs));return b+"-"+c};
|
|
80
|
+
oG=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};pG=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=oG(e,b);f!==e.allowedByApplication&&(c=!0)}return c};
|
|
81
|
+
sG=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.Z&&!yD(a,n))return _.Ih("Dropping variant - not compatible with key system",n),!1;var p=n.audio,q=n.video;if(p&&!YF(p)){var t=p.codecs;0<=p.codecs.indexOf(_.je)?(_.Ih("Trying to use AC-3 for EC-3"),p.codecs=p.codecs.replace(_.je,"ac-3"),YF(p)?_.Hh("Using AC-3 instead of EC-3 for",qG(p)):(p.codecs=t,_.Hh(JC,qG(p)),n.audio=null,f=!0,p=null)):(_.Hh(JC,qG(p)),n.audio=null,f=!0,p=null)}return q&&!YF(q)?(_.Hh("Dropping variant - video not compatible with platform",
|
|
82
|
+
qG(q)),!1):p&&b&&!rG(p,b,e)?(_.Hh("Dropping variant - not compatible with active audio","active audio",qG(b),"variant.audio",qG(p)),!1):q&&c&&!rG(q,c,e)?(_.Hh("Dropping variant - not compatible with active video","active video",qG(c),"variant.video",qG(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&&!n.audio?(_.Hh("Dropping variant - not compatible with video + audio",
|
|
83
|
+
"variant.video",qG(n.video)),!1):!0}))}d.textStreams=d.textStreams.filter(function(n){var p=_.pF(_.kl(n.mimeType,n.codecs));p||_.Ih("Dropping text stream. Is not supported by the platform.",n);return p})};rG=function(a,b,c){return a.mimeType!==b.mimeType||(void 0===c||c)&&a.codecs.split(".")[0]!==b.codecs.split(".")[0]?!1:!0};
|
|
84
|
+
tG=function(a){var b=a.audio,c=a.video,d=b?b.codecs:null,e=c?c.codecs:null,f=[];e&&f.push(e);d&&f.push(d);var g=c&&c.mimeType||null,h=b&&b.mimeType||null,l=[];b&&l.push(b.kind);c&&l.push(c.kind);l=l[0]||null;var m=new Set,n=new Set;if(b)for(var p=_.w(b.roles),q=p.next();!q.done;q=p.next())n.add(q.value);if(c)for(p=_.w(c.roles),q=p.next();!q.done;q=p.next())m.add(q.value);q=[c,b].map(function(t){return t?t.accessibility||[]:[]}).reduce(function(t,v){return t.concat(v)},[]);a={id:a.id,active:!1,type:"variant",
|
|
85
85
|
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&&(a.videoId=c.id,a.originalVideoId=c.originalId,
|
|
86
86
|
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};
|
|
87
|
-
|
|
88
|
-
accessibility:a.accessibility,keyId:null}};
|
|
89
|
-
_.
|
|
90
|
-
e.filter(function(h){return 0===h.roles.length}),b.length)return b;b=e.map(function(h){return h.roles}).reduce(_.
|
|
91
|
-
|
|
92
|
-
_.
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
87
|
+
uG=function(a){return{id:a.id,active:!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,originalTextId:a.originalId,
|
|
88
|
+
accessibility:a.accessibility,keyId:null}};vG=function(a){return a.allowedByApplication&&a.allowedByKeySystem};iG=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))};
|
|
89
|
+
_.xG=function(a,b,c,d){b=_.vi(b);var e=a,f=a.filter(function(h){return h.primary});f.length&&(e=f);var g=e.length?e[0].language:"";e=e.filter(function(h){return h.language===g});b.some(function(h){var l=_.JD(_.qj(h),a.map(function(m){return m.language}));return l?(e=a.filter(function(m){return _.qj(m.language)===l}),!0):!1});d&&e.some(function(h){return h.kind===_.pe})&&(e=e.filter(function(h){return h.kind===_.pe}));if(c){b=wG(e,c);if(b.length)return b;_.Dh("No exact match for the text role could be found.")}else if(b=
|
|
90
|
+
e.filter(function(h){return 0===h.roles.length}),b.length)return b;b=e.map(function(h){return h.roles}).reduce(_.CD,[]);return b.length?wG(e,b[0]):e};wG=function(a,b){return a.filter(function(c){return c.roles.includes(b)})};
|
|
91
|
+
qG=function(a){var b=MD(a);return a.type===_.$c?"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"};
|
|
92
|
+
_.yG=function(){this.g=new _.K("clpp.abr");this.A=null;this.l=!1;this.w=new TF;this.f=[];this.o=1;this.C=this.B=!1;this.j=this.a=this.h=null};zG=function(a,b,c){if(a.j&&a.a.useCmsd){var d=AD(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 oG(e,b)}));return a.sort(function(e,f){return e.bandwidth-f.bandwidth})};AG=function(){this.a=null};
|
|
93
|
+
CG=function(a,b){if(b&&(null==a.a||a.a!==b))throw BG(a);};BG=function(a){return new _.N(_.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.")};DG=function(){this.a=new Map};FG=function(a,b){a.a.has(b)||a.a.set(b,new EG);return a.a.get(b)};EG=function(){this.text=this.variant=null};GG=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)};
|
|
94
|
+
JG=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||HG(d,e))&&IG(d.roles,e.roles))}!d&&(d=a.video&&b.video)&&(a=a.video,b=b.video,d=!((!c||HG(a,b))&&IG(a.roles,b.roles)));return d?!1:!0};
|
|
95
|
+
HG=function(a,b){if(a.mimeType!==b.mimeType)return!1;var c=ND(a.codecs).map(function(f){return _.OD(f)}),d=ND(b.codecs).map(function(f){return _.OD(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};IG=function(a,b){var c=new Set(a),d=new Set(b);c["delete"](_.Ie);d["delete"](_.Ie);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};
|
|
96
|
+
LG=function(a){var b=void 0===b?_.Ff:b;this.f=a;this.a=b;this.h=new KG(a.language,"",a.audio&&a.audio.channelsCount?a.audio.channelsCount:0,!1,b)};KG=function(a,b,c,d,e){this.j=_.vi(a);this.a=b;this.f=c;this.l=void 0===d?!1:d;this.h=void 0===e?_.Ff:e};MG=function(a,b){var c=null;b.some(function(d){c=_.JD(_.qj(d),a.map(function(e){return ID(e)}));return!!c});return c?a.filter(function(d){return c===ID(d)}):[]};
|
|
97
|
+
NG=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)})};OG=function(a,b){return a.filter(function(c){return c.audio&&c.audio.spatialAudio!==b?!1:!0})};RG=function(a,b){this.a=PG;this.f=(new Map).set(PG,b).set(QG,a)};
|
|
98
|
+
TG=function(a){var b=this;this.D=a;this.a=a.getConfiguration().streaming;this.f=new _.Sh;this.g=new _.K("clpp.mse.media.LiveEdgeObserver");SG(this)&&(a=this.D.getSurface().getMedia(),this.f.on(a,_.ng,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."),
|
|
99
99
|
b.D.setPlaybackRate(b.a.chasingRate,_.Td)):1<e&&c<=f&&(b.g.debug("On live edge, reduce playback rate."),b.D.setPlaybackRate(1))}))};
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
m);_.
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
a;if(0===g.length||!e)throw _.
|
|
113
|
-
|
|
114
|
-
b.start);b=_.
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
m),q["return"]();p=
|
|
118
|
-
|
|
119
|
-
c)};
|
|
120
|
-
|
|
121
|
-
_.
|
|
122
|
-
_.
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
v){if(!a.a.has(v)){var z=
|
|
128
|
-
|
|
100
|
+
SG=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};
|
|
101
|
+
VG=function(a,b,c,d,e){this.j=a;this.C=c;this.a={};this.G={};this.N=!1;this.f=null;this.h={};this.l=new _.Sh;this.K=!1;this.w={};this.I=b;this.B=d;this.J=e;this.V=this.J.streaming.maxSegmentToMediaOffset||1;this.L=new _.gk;this.A="";this.H={};this.o=UG(this,this.L);this.P=!0;this.g=new _.K("clpp.mse.MediaSourceEngineSmooth")};
|
|
102
|
+
UG=function(a,b){if(window.ManagedMediaSource){a.j.disableRemotePlayback=!0;var c=new ManagedMediaSource;a.l.one(c,kD,function(){URL.revokeObjectURL(a.A);b.resolve()});a.l.on(c,lD,function(){a.P=!0});a.l.on(c,"endstreaming",function(){a.P=!1});a.A=WG(c);a.j.src=a.A;return c}c=new MediaSource;a.A=WG(c);a.l.one(c,kD,function(){URL.revokeObjectURL(a.A);b.resolve()});a.j.src=a.A;return c};
|
|
103
|
+
XG=function(a,b){b.forEach(function(c,d){var e=a.o.addSourceBuffer(c);a.l.on(e,_.ne,a.S.bind(a,d));a.l.on(e,"updateend",a.qc.bind(a,d));a.a[d]=e;a.G[d]=c;a.h[d]=[];a.H[d]=!1});a.N=b.has(_.$c)&&b.has(_.r)};YG=function(a,b){try{return new _.mm(a.a[b].buffered,b)}catch(c){return b in a.a&&a.g.error($C+b,c),null}};ZG=function(a,b){if(!a.a[b])return"";var c=YG(a,b);return c?c.toString():""};
|
|
104
|
+
bH=function(a,b,c,d,e,f){return[f?Promise.resolve():$G(a,b,function(){try{a.g.debug(gC+b+WB);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(uC+b+WB,l),l;}a.g.debug(oC+b+WB);a.qc(b)}),$G(a,b,function(){return aH(a,b,c)}),$G(a,b,function(){try{a.g.debug(MC+b,d,e),a.a[b].appendWindowStart=0,a.a[b].appendWindowEnd=e,a.a[b].appendWindowStart=d}catch(g){throw a.g.warn(yC+b,d,e,g),g;}a.g.debug(sC+b,d,e);a.qc(b)})]};
|
|
105
|
+
aH=function(a,b,c){0>c&&(c+=.001);try{a.g.debug(OC+b,c),a.a[b].timestampOffset=c}catch(d){throw a.g.warn(zC+b,c,d),d;}a.g.debug(tC+b,c);a.qc(b)};$G=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&&cH(a,b);return c.p};cH=function(a,b){var c=a.h[b][0];if(c)try{a.g.debug(QC+b),c.start()}catch(d){d.name===IC?c.p.reject(new _.N(_.P,3,3017,{type:b})):c.p.reject(new _.N(_.P,3,3015,{mediaError:d})),dH(a,b)}else a.g.debug(EC+b)};
|
|
106
|
+
eH=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();_.D(p,2);return _.y(p,Promise.all(c),4);case 4:_.oh(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);_.D(p,5,6);return _.y(p,b(),6);case 6:_.ph(p);for(m in a.a)dH(a,
|
|
107
|
+
m);_.qh(p);break;case 5:return n=_.E(p),p["return"](Promise.reject(new _.N(_.P,3,3015,{mediaError:n})))}})};dH=function(a,b){a.h[b].shift();cH(a,b)};fH=function(a,b,c){return $G(a,b,function(){b===_.Q?a.g.debug("Change not supported for "+b):(a.g.debug("Change Type: "+a.G[b]+" -\x3e "+c),QD()?(a.a[b].changeType(c),a.G[b]=c):a.g.debug("Change Type not supported"),a.qc(b))})};
|
|
108
|
+
gH=function(a,b,c,d){var e,f,g,h,l;return _.I(function(m){return 1==m.a?(e=_.OD(_.ml(a.G[b])),f=_.ll(a.G[b]),g=_.kl(c,d),h=_.OD(_.ml(g)),l=_.ll(g),e===h&&f===l?m["return"](!1):a.J.mediaSource.codecSwitchingStrategy===_.$f&&QD()?_.y(m,fH(a,b,g),2):m.F(2)):m["return"](!0)})};hH=function(a){this.h=a;this.a=null;this.f=function(){}};iH=function(a,b){a.f=b};
|
|
109
|
+
jH=function(a){var b=this;this.f=a;this.o=this.A=this.l=!1;this.h=this.f.Jh();this.w=_.Td;this.j=null;this.a=new _.pl(function(){b.A||b.f.Ul(.25*b.h)});this.g=new _.K("clpp.mse.media.PlayRateController")};kH=function(a,b){a.j=b;a.j.speedUpMode&&(a.w=a.j.speedUpMode)};
|
|
110
|
+
nH=function(a,b){a.a.stop();a.l||(a.o=!1);var c=a.l?0:a.h;if((b?b:a.w)===_.Td||0===c||1===c)try{lH(a,c)}catch(d){a.g.warn('Set playbackRate using "decoder" mode fails, due to unsupported range by platform. Fallback to "seek" mode.',d),mH(a)}else mH(a)};mH=function(a){a.g.debug(NC,a.h,' using "seek" mode.');lH(a,0);a.o=!0;a.a.yb(.25)};lH=function(a,b){if(a.f.Jh()!==b){a.g.debug(NC,b,' using native playbackRate "decoder" mode.');try{a.f.zn(b)}catch(c){throw c;}}};
|
|
111
|
+
pH=function(a){function b(){d=!0}function c(m){f.push(m);_.hn(m)}a=_.zj(a);var d=!1,e,f=[],g=[];(new _.gn).M(_.Qe,c).M(_.og,c).M(_.Le,c).M(_.Pe,c).M(_.eg,c).Y(_.gg,function(m){e=m;f.push(m);_.jn(m)}).Y("encv",b).Y("enca",b).Y("avc1",function(m){g.push({M:m,hd:1701733238})}).Y("avc3",function(m){g.push({M:m,hd:1701733238})}).Y("ac-3",function(m){g.push({M:m,hd:1701733217})}).Y(_.je,function(m){g.push({M:m,hd:1701733217})}).Y("mp4a",function(m){g.push({M:m,hd:1701733217})}).parse(a);if(d)return _.Hh("Init segment already indicates encryption."),
|
|
112
|
+
a;if(0===g.length||!e)throw _.Jh("Failed to find boxes needed to fake encryption!"),_.Jh("Failed init segment (hex):",_.Nj(a)),new _.N(_.P,3,14E3);g.reverse();for(var h=_.w(g),l=h.next();!l.done;l=h.next())l=l.value,_.Hh('Inserting "'+_.mn(l.hd)+'" box into init segment.'),a=oH(a,e,l.M,f,l.hd);return a};
|
|
113
|
+
oH=function(a,b,c,d,e){var f=qH.value(),g=a.subarray(c.start,c.start+c.size),h=_.Gj(g),l=new Uint8Array(c.size+f.byteLength);l.set(g,0);g=_.Gj(l);g.setUint32(4,e);l.set(f,c.size);e=h.getUint32(4);g.setUint32(c.size+16,e);rH(l,0,l.byteLength);e=new Uint8Array(a.byteLength+l.byteLength);c=_.sl("Xbox One")||_.rl()?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,rH(e,d.start,d.size+l.byteLength);l=_.Gj(e,
|
|
114
|
+
b.start);b=_.nn(b);a=l.getUint32(b);l.setUint32(b,a+1);return e};rH=function(a,b,c){a=_.Gj(a,b);b=a.getUint32(0);0!==b&&(1===b?(a.setUint32(8,c>>32),a.setUint32(12,c&4294967295)):a.setUint32(0,c))};_.tH=function(a,b){this.D=b;this.j=a;sH(a);this.h=null;this.l=1;this.G=Promise.resolve();this.A=new Map;this.w=new Map;this.a=new Map;this.I=this.f=this.o=this.B=!1;this.H=0;this.g=new _.K("clpp.mse.Streaming");this.C=!1};
|
|
115
|
+
vH=function(a){var b=a.a.get(_.r);return b?uH(a,b.Ub):(b=a.a.get(_.$c))?uH(a,b.Ub):null};xH=function(a){return _.wH(a,_.$c)};yH=function(a){return _.wH(a,_.r)};
|
|
116
|
+
DH=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=_.eq,_.y(q,a.D.W.clear(c.TEXT),2);case 2:return a.H++,a.I=!1,d=a.H,e=a.D.W,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,zH(a,g),4);case 4:if(a.f)return q["return"]();l=(h=e.getTextDisplayer().isTextVisible())||a.h.alwaysStreamText;if(a.H===d&&!a.a.has(c.TEXT)&&!a.I&&l){m=a.D.Qb();n=AH(a,m);if(null==n)return a.g.warn("Cannot set up text media state, period not found at",
|
|
117
|
+
m),q["return"]();p=BH(b,n,0);a.a.set(c.TEXT,p);CH(a,p,0)}_.A(q)}})};GH=function(a){a.I=!0;var b=a.a.get(_.Q);b&&(EH(b),FH(b)["catch"](function(){}),a.a["delete"](_.Q))};IH=function(a,b,c,d){b.video&&_.HH(a,b.video,c,d);b.audio&&_.HH(a,b.audio,c,d)};KH=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;sH(a.j);JH(a)};sH=function(a){a.periods.every(function(b){return typeof b.id===_.fg})};
|
|
118
|
+
MH=function(a){function b(l){return a.D.W.Gb(l,c,0)}var c=a.D.Qb(),d=!1,e=AH(a,c);if(_.wj(a.a.values(),function(l){return l.Ub===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)||(LH(a,h),d=!0)}else if(!_.wj(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())LH(a,f.value);d=!0}d||a.g.debug("(all): seeked: buffered seek: presentationTime\x3d"+
|
|
119
|
+
c)};PH=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=NH(d);if(d.bd||b&&OH(d))a.g.info(e,"Retrying after failure..."),d.bd=!1,CH(a,d,.1)}};QH=function(a){return Array.from(a.a.values()).some(function(b){return null!==b.jb})};
|
|
120
|
+
RH=function(a){var b=Array.from(a.a.values());return a.B&&b.every(function(c){return c.endOfStream})};TH=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,EH(e),e.tb&&e.Wb&&(e.tb=!1,b.push(e.Wb.abort())),e.$b&&b.push(SH(a,e,!0,0));return _.y(f,Promise.all(b),0)})};UH=function(a,b,c){(a=a.a.get(b))&&c&&(EH(a),a.stream=c,a.dc=c,a.oa&&(a.oa=c.getSegmentReference(a.oa.position)),a.oa||(a.dc=null))};
|
|
121
|
+
_.wH=function(a,b){var c=a.a.get(b);return c?c.hc||c.stream:null};
|
|
122
|
+
_.HH=function(a,b,c,d){var e=a.a.get(b.type);if(!e&&b.type===_.Q&&a.h.ignoreTextStreamFailures)DH(a,b);else if(e){var f=VH(a,b).id;if(c&&f!==e.Ub)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())LH(a,c.value);else if(e.hc&&(a.g.debug("switch during trick play mode",b),b.trickModeVideo?(e.hc=b,b=b.trickModeVideo,a.g.debug("switch found trick play stream",b)):(e.hc=null,a.g.debug("switch found no special trick play stream"))),
|
|
123
|
+
WH(a,f)&&XH(a,b.id))if(e.stream!==b){var g=a.j.presentationTimeline.getDuration(),h=a.D.Qb();h=YH(a,e,h);!c&&(e.endOfStream||h>=g)?a.g.debug(nD+NH(e)+" already buffered to the end. Not switching."):(b.type===_.Q&&a.D.W.gc(_.kl(b.mimeType,b.codecs)),e.stream=b,e.stream.segmentIterator=null,e.Le=!0,a.g.debug("switch: switching to Stream "+NH(e)),ZH(a,e,f)&&(a.g.info("Aborting current segment request to switch."),e.Wb.abort()),c&&(e.oc?e.Ye=!0:e.tb?(e.$b=!0,e.re=d,e.Ye=!0):(EH(e),SH(a,e,!0,d)["catch"](function(l){if(a.D)a.D.onError(l)}))))}else a.g.debug(nD+
|
|
124
|
+
NH(e)+" already active")}};WH=function(a,b){var c=a.A.get(b);return!(!c||!c.Te)};XH=function(a,b){var c=a.w.get(b);return!(!c||!c.Te)};ZH=function(a,b,c){if(!b.Wb)return!1;var d=a.D.Qb(),e=a.D.W.ha(b.type);c=(c=$H(a,b,d,e,c))?c.Od():null;if(null==c)return!1;var f=b.stream.initSegmentReference;f&&(c+=f.Od()||0);f=a.D.ze().getBandwidthEstimate();if(8*c/f<(null===e?0:e-d)-Math.max(a.j.minBufferTime||0,a.h.rebufferingGoal))return!0;a=b.Wb;a=a.j?a.j.bytesRemaining:-1;return 0>a||a>c?!0:!1};
|
|
125
|
+
LH=function(a,b){var c=NH(b);b.oc?a.g.debug(c,"clear: already clearing the buffer"):b.$b?a.g.debug(c,"clear: already waiting"):b.tb?(a.g.debug(c,"clear: currently updating"),b.$b=!0,b.re=0):null==a.D.W.Na(b.type)?(a.g.debug(c,"clear: nothing buffered"),null==b.jb&&CH(a,b,0)):(a.g.debug(c,"clear: handling right now"),EH(b),SH(a,b,!1,0)["catch"](function(d){if(a.D)a.D.onError(d)}))};
|
|
126
|
+
aI=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=AH(a,f);if(null==g)return a.g.warn("Cannot initialize streams, period not found at",f),q["return"]();h=_.eq;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.W;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"]();JH(a);return _.y(q,zH(a,m),3)}if(a.f)return q["return"]();l.forEach(function(t,
|
|
127
|
+
v){if(!a.a.has(v)){var z=BH(t,g,e);a.a.set(v,z);CH(a,z,0)}});_.A(q)})};BH=function(a,b,c){return{stream:a,type:a.type,dc:null,segmentIterator:null,oa:null,hc:null,Le:!0,Ub:b,endOfStream:!1,tb:!1,jb:null,$b:!1,re:0,Ye:!1,oc:!1,lg:!1,bd:!1,Ki:c||0,Wb:null,xe:!1,ci:0}};cI=function(a){a.g.debug("(all) setupAllPeriods_");a.j.periods.map(function(b){return b.id}).forEach(function(b){bI(a,b)["catch"](DD)})};
|
|
128
|
+
bI=function(a,b){var c=a.A.get(b);if(c)return a.g.debug("(all) Period "+b+YB),c;a.g.debug("(all) setting up Period "+b);var d=new _.gk;a.A.set(b,d);var e=new Set;c=uH(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.G=a.G.then(function(){return a.f?null:zH(a,e)}).then(function(){a.f||(d.resolve(),
|
|
129
129
|
a.g.debug("(all) setup Period "+b))})["catch"](function(h){a.f||(d["catch"](function(){}),d.reject(),a.A["delete"](b),a.g.warn("(all) failed to setup Period "+b),a.D.onError(h))});return d};
|
|
130
|
-
|
|
131
|
-
e.value,p=a.w.get(n.id))p["catch"](function(){}),p.reject(),a.w["delete"](n.id);throw l;case 3:q=_.w(b);for(e=q.next();!e.done;e=q.next())t=e.value,(v=a.w.get(t.id))&&!v.done&&(v.resolve(),a.g.debug("(all) setup Stream "+t.id));_.
|
|
132
|
-
|
|
133
|
-
if(null!=l&&f>=l&&!b.xe)return
|
|
134
|
-
null);d=Infinity;h=_.w(a.a.values());for(m=h.next();!m.done;m=h.next())m=m.value,c(m)||(m=
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
e,
|
|
138
|
-
g)a=null;else if(f=
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
v.then(function(){return a.f||a.o?null:
|
|
142
|
-
|
|
143
|
-
_.N&&
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
n=f&&f.initSegment||b.stream.initSegmentReference;p=
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
a.D.rf(e,d,
|
|
151
|
-
"Appending segment with "+(G.toFixed(3)+" - "+
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
f,f+h).then(function(){a.f||a.g.debug(d,"evicted "+h+" seconds")})};
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
h.variant&&h.variant.audio&&l.set(_.$c,h.variant.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 _.N(_.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)
|
|
159
|
-
5,5005));return}g=_.w(Array.from(a.a.keys()));for(h=g.next();!h.done;h=g.next())h=h.value,(m=l.get(h))?(_.
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
c);c=a.D.Jb.fetch(f);b.
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
this.configuration.preferSpatialAudio,this.configuration.mediaSource.codecSwitchingStrategy);this.Gd=this.configuration.preferredTextLanguage;this.
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
_.
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
0;d<f.length;d++)if(!f[d].
|
|
176
|
-
|
|
177
|
-
l.f;
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
a.B=null);a.I&&(a.I.release(),a.I=null);if(!a.L){c.F(8);break}return _.y(c,a.L.destroy(),9);case 9:a.L=null;case 8:a.Qc&&(a.Qc.release(),a.Qc=null);a.He&&(a.He.release(),a.He=null);b&&b.src&&(b.removeAttribute("src"),b.load());if(!a.w){c.F(10);break}return _.y(c,a.w.destroy(),11);case 11:a.w=null;case 10:a.P.clear(),a.J=null,a.Ie.clear(),a.f=null,a.H=null,a.ca=!0,a.Nc.clear(),a.Ld=!1,
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
130
|
+
zH=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,v;return _.I(function(z){switch(z.a){case 1:c=[];d=_.w(b);for(e=d.next();!e.done;e=d.next())f=e.value,(g=a.w.get(f.id))?(a.g.debug("(all) Stream "+f.id+YB),c.push(g)):(a.g.debug("(all) setting up Stream "+f.id),a.w.set(f.id,new _.gk),h=a.D.Jb,c.push(f.createSegmentIndex(h)));_.D(z,2);return _.y(z,Promise.all(c),4);case 4:if(a.f)return z["return"]();_.oh(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=
|
|
131
|
+
e.value,p=a.w.get(n.id))p["catch"](function(){}),p.reject(),a.w["delete"](n.id);throw l;case 3:q=_.w(b);for(e=q.next();!e.done;e=q.next())t=e.value,(v=a.w.get(t.id))&&!v.done&&(v.resolve(),a.g.debug("(all) setup Stream "+t.id));_.A(z)}})};JH=function(a){var b=a.j.presentationTimeline.getDuration();Infinity>b?a.D.W.Bf(b):a.D.W.Bf(Math.pow(2,32))};
|
|
132
|
+
fI=function(a,b){function c(n){return n.type===_.Q&&n.stream.mimeType===_.Sc}if(c(b))return a.D.W.bh(b.stream.originalId||""),null;b.type===_.Q&&a.D.W.Ug();if(!a.D.W.Zh()&&b.type!==_.Q)return a.h.bufferLimitUpdateInterval?a.h.bufferLimitUpdateInterval/2:.5;var d=NH(b),e=a.D.Qb(),f=YH(a,b,e);a.g.debug(d,"timeNeeded\x3d"+f);var g=a.D.W.Aa(b.type,e);a.g.debug(d,"update_:",gD+e,"bufferedAhead\x3d"+g);var h=Math.max(a.j.minBufferTime||0,a.h.rebufferingGoal,a.h.bufferingGoal)*a.l,l=nE(a.j.presentationTimeline);
|
|
133
|
+
if(null!=l&&f>=l&&!b.xe)return dI(a,b),null;b.endOfStream=!1;l=VH(a,b.stream).id;var m=AH(a,f);null!=m&&(b.Ub=m);if(m!==l)return a.g.debug(d,"need Period "+m,gD+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.W.ha(b.type);g=$H(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."),dI(a,b),
|
|
134
|
+
null);d=Infinity;h=_.w(a.a.values());for(m=h.next();!m.done;m=h.next())m=m.value,c(m)||(m=YH(a,m,e),d=Math.min(d,m));if(f>=d+a.j.presentationTimeline.h)return a.h.bufferLimitUpdateInterval||1;b.Ki=0;eI(a,b,e,l,g)["catch"](function(){});return null};dI=function(a,b){a.g.debug(NH(b),"buffered to end of presentation");b.endOfStream=!0;if(b.type===_.r){var c=a.a.get(_.Q);c&&c.stream.mimeType===_.Sc&&(c.endOfStream=!0)}};
|
|
135
|
+
YH=function(a,b,c){return b.dc&&b.oa?VH(a,b.dc).startTime+b.oa.endTime:Math.max(c,b.Ki)};
|
|
136
|
+
$H=function(a,b,c,d,e){if(null==e)return a.g.warn(lC),null;if(b.stream.segmentLookupStrategy===_.bD)b.stream.segmentIterator?a=EE(b.stream.segmentIterator):b.oa||d?(c=b.oa?b.oa.endTime:d,a.g.info(BC,"looking up segment from new stream endTime:",c),b.stream.segmentIterator=IE(b.stream.segmentIndex,c),e=b.stream.segmentIterator.next().value,null===e&&(b.stream.segmentIterator=null,a.g.warn(BC,XC,"endTime:",c,b.oa)),a=e):(e=uH(a,e),e=Math.max(0,c-e.startTime),a.g.info(BC,"looking up segment","lookupTime:",
|
|
137
|
+
e,fD,c),d=null,d||(b.stream.segmentIterator=IE(b.stream.segmentIndex,e),d=b.stream.segmentIterator.next().value),null===d&&a.g.warn(BC,XC,"lookupTime:",e,fD,c),a=d);else{var f=NH(b);if(b.oa&&b.stream===b.dc)c=b.oa.position+1,a.g.debug(f,"next position known:","position\x3d"+c),a=gI(a,b,e,c);else{if(b.oa){a.g.debug(f,"next position unknown: another Stream buffered");f=VH(a,b.dc);var g=hI(a,b,f.startTime+b.oa.endTime,e)}else a.g.debug(f,"next position unknown: nothing buffered"),g=hI(a,b,d||c,e);if(null==
|
|
138
|
+
g)a=null;else if(f=gI(a,b,e,g),null==f)a=null;else{var h=null==a.h?!1:a.h.ignoreDrift;null!=d||h||(d=f,d.Da+d.startTime+2>c&&(a=gI(a,b,e,Math.max(0,g-1)))&&(f=a));a=f}}}return a};hI=function(a,b,c,d){var e=NH(b);d=uH(a,d);var f=Math.max(0,c-d.startTime);b=b.stream.findSegmentPosition(f);a.g.debug(e,"Looked up segment:",gD+c,"lookupTime\x3d"+f,ZC+d.startTime,"Result: segment position\x3d"+b);null==b&&a.g.warn(e,"cannot find segment:",ZC+d.startTime,"lookupTime\x3d"+f);return b};
|
|
139
|
+
gI=function(a,b,c,d){var e=NH(b);if(null==c)return a.g.warn(e,lC),null;c=uH(a,c);var f=b.stream.getSegmentReference(d);if(!f)return a.g.debug(e,"segment does not exist:",ZC+c.startTime,"position\x3d"+d),null;var g=a.j.presentationTimeline;d=_.tE(g);g=sE(g);return!b.xe&&(c.startTime+f.endTime<d||c.startTime+f.startTime>g)?(a.g.debug(e,"segment is not available:",ZC+c.startTime,jD+f.startTime,hD+f.endTime,"availabilityStart\x3d"+d,"availabilityEnd\x3d"+g),null):f};
|
|
140
|
+
eI=function(a,b,c,d,e){var f,g,h,l,m,n,p,q,t,v,z,C,F;return _.I(function(G){f=_.eq;g=NH(b);h=uH(a,d);a.g.debug(g,"fetchAndAppend_:",gD+c,ZC+h.startTime,iD+e.position,jD+e.startTime,hD+e.endTime);l=b.stream;m=b.stream.segmentIterator;n=a.j.presentationTimeline.getDuration();p=iI(a,d);q=Math.max(0,h.startTime-.1);t=p?p.startTime+.01:n;v=jI(a,b,h,q,t,e);b.tb=!0;b.Le=!1;a.g.debug(g,"fetching segment");z=!1;C=function(B,H){if(a.f||a.o)return null;z=!0;return kI(a,b,c,h,l,e,B,H)};F=a.D.W.ha(b.type)||0;
|
|
141
|
+
v.then(function(){return a.f||a.o?null:lI(a,b,e,!1,function(B){return C(B.data,!0)})}).then(function(B){return a.f||a.o?null:z||null===B?(mI(a,b,F,e,l),null):C(B,!1)}).then(function(){if(!a.f&&!a.o){mI(a,b,F,e,l);b.tb=!1;b.lg=!1;b.$b||a.D.Qe();if(m){var B=m.next().value;B&&a.g.debug("New iterated segment",B)}CH(a,b,0);nI(a,b,l);a.g.debug(g,"finished fetch and append")}})["catch"](function(B){return _.I(function(H){if(a.f||a.o)return H["return"]();b.tb=!1;if(b.type===f.TEXT&&a.h.ignoreTextStreamFailures)return 1001===
|
|
142
|
+
B.code?a.g.warn(g,"Text stream failed to download. Proceeding without it."):a.g.warn(g,"Text stream failed to parse. Proceeding without it."),a.a["delete"](f.TEXT),H.F(0);if(7001===B.code)return b.tb=!1,b.jb=null,CH(a,b,0),H.F(0);if(3017===B.code)return oI(a,b,B),H.F(0);if(1001===B.code&&B.data&&404===B.data[1])return a.g.warn(g,"request for segment failed","segment not available on server",iD+e.position,jD+e.startTime,hD+e.endTime,"error\x3d"+B),b.tb=!1,b.jb=null,CH(a,b,1),H.F(0);if(b.type===f.TEXT)return B instanceof
|
|
143
|
+
_.N&&B.a(1),EH(b),a.D.onError(new _.N(1,2,2010,B)),H.F(0);if(1001<=B.code&&1003>=B.code)return _.y(H,pI(a,b,h,B),0);a.g.error(g,"failed fetch and append: code\x3d"+B.code);b.bd=!0;B instanceof _.N&&B.a(_.P);return _.y(H,qI(a,B),0)})});_.A(G)})};
|
|
144
|
+
oI=function(a,b,c){var d=NH(b);if(Array.from(a.a.values()).some(function(f){return f!==b&&f.lg}))a.g.debug(d,DC,"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.bd=!0;a.o=!0;a.D.onError(c);return}a.g.warn(d,DC,"reducing buffering goals by "+(100-Math.round(100*a.l))+"%");b.lg=!0}CH(a,b,4)};
|
|
145
|
+
pI=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.rf(b.stream,c));if(!f)return g.F(0);b.bd=!0;d.a(_.P);return _.y(g,qI(a,d),0)})};
|
|
146
|
+
jI=function(a,b,c,d,e,f){var g,h,l,m,n,p,q;return _.I(function(t){g=c.startTime-f.Da;h=b.Le||f.initSegment!==(b.oa&&b.oa.initSegment);if(!h&&g===b.ci)return t["return"](Promise.resolve());b.ci=g;l=NH(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.W.Li(b.type,g,d,e,b.stream.mimeType,b.stream.codecs);if(!b.stream.initSegmentReference||!h)return t["return"](m);a.g.debug(l,"fetching init segment");
|
|
147
|
+
n=f&&f.initSegment||b.stream.initSegmentReference;p=lI(a,b,n,!0);q=p.then(function(v){if(a.f)return null;a.g.debug(l,"appending init segment");return rI(a,v,b).then(function(){return a.D.W.te(b.type,v,null,null,!!b.stream.closedCaptions&&0<b.stream.closedCaptions.size)})})["catch"](function(v){b.Le=!0;return Promise.reject(v)});return t["return"](Promise.all([m,q]))})};
|
|
148
|
+
rI=function(a,b,c){var d;return _.I(function(e){if(!a.h.patchEdgeWhenMixedContent||!_.rl())return e.F(0);d=pH(b);return _.y(e,a.D.W.te(c.type,d.buffer,null,null,!!c.stream.closedCaptions&&0<c.stream.closedCaptions.size),0)})};
|
|
149
|
+
kI=function(a,b,c,d,e,f,g,h){h=void 0===h?!1:h;var l,m,n,p,q,t,v,z,C;return _.I(function(F){switch(F.a){case 1:l=NH(b);if(!(e&&e.keyId&&a.D.Fd)){F.F(2);break}m=vD(a.D.Fd,e.keyId);if(!m){a.g.warn("Unable to find DRM session for "+e.keyId);F.F(2);break}_.D(F,4);return _.y(F,m,6);case 6:_.oh(F,2);break;case 4:n=_.E(F),a.g.warn("DRM session load failed!",n);case 2:if(!(e.encrypted&&e.keyId&&a.D.Fd&&xD(a.D.Fd,e.keyId))){F.F(7);break}EH(b);p=VH(a,e).id;q=sI(a,p);if(!q){F.F(8);break}return _.y(F,q,8);case 8:return t=
|
|
150
|
+
a.D.rf(e,d,cD),v=f.startTime+d.startTime,z=f.endTime+d.startTime,a.g.warn(l,"Blocked append for "+v+" - "+z+": "+t+". Stream with Key ID "+(e.keyId+" has restrictions.")),F["return"](Promise.resolve());case 7:return C=e.closedCaptions&&0<e.closedCaptions.size,null!=e.emsgSchemeIdUris&&0<e.emsgSchemeIdUris.length&&(new _.gn).Y("emsg",a.Pm.bind(a,d,f,e.emsgSchemeIdUris)).parse(g),F["return"](tI(a,b,c).then(function(){if(a.f)return null;var G=f.startTime+d.startTime,B=f.endTime+d.startTime;a.g.debug(l,
|
|
151
|
+
"Appending segment with "+(G.toFixed(3)+" - "+B.toFixed(3)+" KeyID: ")+(e.keyId+" Width: ")+(e.width+" Height: "+e.height+" Bitrate: ")+(_.R.qf(e.bandwidth)+" Fragment: ")+h);return a.D.W.te(b.type,g,G,B,C,e.id,h)}).then(function(){a.f||(a.g.debug(l,"appended media segment"),b.dc=e,b.oa=f)}))}})};
|
|
152
|
+
mI=function(a,b,c,d,e){if(!a.j.presentationTimeline.isLive()&&b.type!==_.Q){var f=NH(b),g=(a.D.W.ha(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.xe=!0,a=a.j.periods,e.adjustSegmentDurations(d.position,c),d=aE(a,e),b=a[d],e=e.getDuration(),cE(b,e),e=d+1;e<a.length;e++)a[e].startTime+=c}};
|
|
153
|
+
uI=function(a,b,c){(new _.gn).M(_.Qe,_.hn).M(_.og,_.hn).M(_.Le,_.hn).M(_.Pe,_.hn).M(_.eg,_.hn).Y(_.gg,_.jn).M("encv",function(d){d.reader.skip(78);_.hn(d)}).M(_.Zf,_.hn).M("schi",_.hn).M("tenc",function(d){d.reader.skip(6);if(_.an(d.reader)){d.reader.skip(1);var e=_.Nj(_.fn(d.reader,16));e!==b.stream.keyId&&(a.g.debug(NH(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)};
|
|
154
|
+
tI=function(a,b,c){if(a.f)return Promise.resolve();var d=NH(b);a.g.debug(d,"checking buffer length");var e=Math.max(a.h.bufferBehind,a.j.presentationTimeline.h),f=a.D.W.Na(b.type);if(null==f)return a.g.debug(d,"buffer behind okay because nothing buffered:",gD+c,UC+e),Promise.resolve();var g=c-f,h=g-e;if(.01>=h)return a.g.debug(d,"buffer behind okay:",gD+c,VC+g,UC+e,"underflow\x3d"+Math.abs(h)),Promise.resolve();a.g.debug(d,"buffer behind too large:",gD+c,VC+g,UC+e,"overflow\x3d"+h);return a.D.W.remove(b.type,
|
|
155
|
+
f,f+h).then(function(){a.f||a.g.debug(d,"evicted "+h+" seconds")})};nI=function(a,b,c){if(!a.B){b=NH(b);var d=Array.from(a.a.values());1!==d.length||d[0].type!==_.Q?a.B=d.every(function(e){return e.type===_.Q||a.C?!0:!e.$b&&!e.oc&&e.oa}):a.C&&(a.B=!0);a.B&&(a.g.debug(b,"startup complete"),c=VH(a,c).id,iI(a,c),sI(a,c))}};
|
|
156
|
+
sI=function(a,b){var c=null;a.A.has(b)||(c=bI(a,b).then(function(){a.f||(a.g.debug(WC),a.D.Uf())})["catch"](DD));cI(a);a.D.Jm&&(a.g.debug("calling onStartupComplete()..."),a.D.Jm());return c};
|
|
157
|
+
vI=function(a,b){var c=NH(b),d=VH(a,b.stream).id;if(b.Ub!==d){var e=b.Ub,f=Array.from(a.a.values());f.every(function(g){return g.Ub===e})?f.every(OH)?(a.g.debug(c,"all need Period "+e),bI(a,e).then(function(){if(!a.f)if(a.D.W.Ji(),f.every(function(n){var p=OH(n),q=VH(a,n.stream).id;return p&&n.Ub===e&&q!==e})){var g=uH(a,e);a.g.debug(c,"Streaming period",e,g);a.g.debug(c,"calling onChooseStreams()...");var h=a.D.Vf(g);a.C=!h.variant&&!!h.text;var l=new Map;h.variant&&h.variant.video&&l.set(_.r,h.variant.video);
|
|
158
|
+
h.variant&&h.variant.audio&&l.set(_.$c,h.variant.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 _.N(_.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)aI(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 _.N(_.P,
|
|
159
|
+
5,5005));return}g=_.w(Array.from(a.a.keys()));for(h=g.next();!h.done;h=g.next())h=h.value,(m=l.get(h))?(_.HH(a,m,!1,0),CH(a,a.a.get(h),0)):a.a["delete"](h);a.g.debug(c,WC);a.D.Uf()}else a.g.debug(c,"ignoring transition to Period",e,"since another is happening")})["catch"](DD)):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)}};AH=function(a,b){var c=ZD(a.j.periods,b+_.Cv);return c?c.id:null};
|
|
160
|
+
VH=function(a,b){var c=a.j.periods,d=aE(c,b);c=c[d];if(!c)throw new _.N(_.P,5,5006,"No period found for stream with ID "+b.id+".");return c};
|
|
161
|
+
lI=function(a,b,c,d,e){d=void 0===d?!1:d;e=void 0===e?null:e;var f=_.gE(c.Xa(),c.ya,c.la,a.h.attemptParameters,c.startTime,c.endTime,b.type,c.timescale);f.type=2;f.onFragment=c.Xc?null:e;f.disableFragmentSupport=c.Xc||a.h.disableFragmentSupport;f.disableMergedFragments=a.h.disableMergedFragments;if(e=c.f())f.keyInfo=e,f.onFragment=null;d&&(f.responseModifiers.push(function(g){uI(a,b,g.data)}),b.type===_.r&&a.h.overridePasp&&f.responseModifiers.push(a.Rn.bind(a)));a.g.debug("fetching: reference\x3d",
|
|
162
|
+
c);c=a.D.Jb.fetch(f);b.Wb=c;return c.U.then(function(g){var h=a.D.ze(),l=g.timeMs,m=g.data.byteLength;l&&m&&!d&&h.segmentDownloaded(l,m);b.Wb=null;return g.data})};
|
|
163
|
+
SH=function(a,b,c,d){var e,f,g,h;return _.I(function(l){if(1==l.a)return e=NH(b),b.$b=!1,b.Ye=!1,b.re=0,b.oc=!0,b.stream.segmentIterator=null,a.g.debug(e,"clearing buffer"),d?(g=a.D.Qb(),h=a.D.W.getDuration(),f=a.D.W.remove(b.type,g+d,h)):f=a.D.W.clear(b.type).then(function(){return!a.f&&c?a.D.W.flush(b.type):null}),_.y(l,f,2);if(a.f)return l["return"]();a.g.debug(e,"cleared buffer");b.dc=null;b.oa=null;b.oc=!1;b.endOfStream=!1;b.xe=!1;CH(a,b,0);_.A(l)})};
|
|
164
|
+
CH=function(a,b,c){a.g.debug(NH(b),"updating in "+c+" seconds");b.jb=(new _.nl(function(){var d;return _.I(function(e){if(1==e.a)return _.D(e,2),_.y(e,a.Vb(b),4);if(2!=e.a)return _.oh(e,0);d=_.E(e);if(a.D)a.D.onError(d);_.A(e)})})).ea(c)};EH=function(a){null!=a.jb&&(a.jb.stop(),a.jb=null)};uH=function(a,b){var c=a.j.periods.find(function(d){return d.id===b})||null;if(!c)throw new _.N(_.P,5,5006,"Period "+b+" not found");return c};
|
|
165
|
+
iI=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};FH=function(a){return _.I(function(b){return a.Wb?_.y(b,a.Wb.abort(),0):b.F(0)})};qI=function(a,b){var c;return _.I(function(d){switch(d.a){case 1:if(a.f)return d["return"]();if(!a.D.Ni){d.F(2);break}_.D(d,3);return _.y(d,a.D.Ni(b),5);case 5:_.oh(d,2);break;case 3:c=_.E(d),c.cause=b,b=c;case 2:if(!b.f)a.D.onError(b);_.A(d)}})};NH=function(a){return"("+a.type+":"+a.stream.id+")"};
|
|
166
|
+
OH=function(a){return!a.tb&&null==a.jb&&!a.$b&&!a.oc};wI=function(){this.a=null};
|
|
167
|
+
zI=function(){_.xm.call(this,YC);var a=this;this.G=xI;this.j=this.ga=null;this.Bg=0;this.Ri=2;this.Qc=null;this.ng=!1;this.l=new _.Sh;this.Jc=this.Eg=this.He=this.I=this.Ec=this.B=this.L=this.w=null;this.Ld=!1;this.f=this.A=this.a=this.K=this.J=null;this.h=new _.yG;this.Ui=1E9;this.Ie=new Set;this.ca=!0;this.ta=null;this.Ti=!1;this.Si=0;this.fa=null;this.P=new DG;this.H=null;this.nc=_.Gp;this.Lc=new KG(this.configuration.preferredAudioLanguage||[],this.configuration.preferredAudioRole,this.configuration.preferredAudioChannelCount,
|
|
168
|
+
this.configuration.preferSpatialAudio,this.configuration.mediaSource.codecSwitchingStrategy);this.Gd=this.configuration.preferredTextLanguage;this.o=new AG;this.Z=this.Mc=null;this.Nc=new Map;this.za=null;this.Ge=this.configuration.preferredTextRole;this.Cd=this.configuration.preferForcedSubtitles;this.l.on(window,"online",function(){a.G===yI&&PH(a.a)});this.Ke=this.Jd=this.Ne=null;this.ba=_.pa;this.Qd=new wI;this.xg=null};
|
|
169
|
+
AI=function(a){return new _.SD(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,_.ah(e.value.renditions))}return d.find(function(f){return f.id===b.toString()})||null})};
|
|
170
|
+
BI=function(a,b){if(a.nc!==b){var c=_.R.Qk;if(a.nc===_.Rp&&b!==_.Gp)c=c(b,_.Pp),a.log.info(_.GC+c);else{var d=a.Bg;d=0===d?0:Date.now()-d;var e=a.nc;a.nc=b;a.Bg=Date.now();null!==a.I&&(a.I.A=b===_.Tp);a.H&&_.wp(a.H.a,a.nc);b===_.Lp&&(a.Ri=a.kg?1:2);var f=a.Ri,g={currentState:a.nc,previousState:e,timeSinceLastStateChangeMS:d,reason:b===_.Lp||e===_.Lp?f:void 0},h=c(e,_.Pp),l=c(b,_.Pp);c=b!==_.Lp?"":"["+c(f,_.Op)+"]";a.log.info(_.Nb+h+" -\x3e "+(l+c));a.trigger(new _.L(_.cg,{detail:g}));(b===_.Np||b===
|
|
171
|
+
_.Rp)&&a.Jc&&a.Jc.stop();b===_.Lp?a.trigger(new _.L(_.kd,{detail:{bufferedTimeMS:-1,reason:f}})):e===_.Lp&&a.trigger(new _.L(_.jd,{detail:{bufferedTimeMS:d,reason:f}}))}}};CI=function(a){var b;return _.I(function(c){switch(c.a){case 1:b=a.o.a;if(!b){c.F(2);break}return _.y(c,b["catch"](function(){}),2);case 2:return _.y(c,_.xm.prototype.release.call(a),4);case 4:return _.y(c,a.unload(),5);case 5:BI(a,_.Gp),_.A(c)}})};
|
|
172
|
+
DI=function(a){var b=new _.nu;(a=a.playlist)&&a.cropTimeline&&(a.startTime||a.endTime)&&(b.h={start:a.startTime||null,end:a.endTime||null});return b};
|
|
173
|
+
GI=function(a,b){var c,d;return _.I(function(e){a.ba===_.pa?EI(a,b.cues):a.ba===_.Hb?(a.f=BF(a.f,xF(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.A.requestStop(),a.A=null,_.mE(a.f.presentationTimeline,!0),a.trigger(new _.L(_.De))),FI(a,a.f)):KH(a.a,b);_.A(e)})};HI=function(a){return _.I(function(b){a.A.requestStop();a.A=null;a.ba===_.Hb?a.trigger(new _.L(_.Sf)):a.trigger(new _.L(_.De));_.A(b)})};
|
|
174
|
+
FI=function(a,b){var c=a.getMediaPosition(),d=a.Jd,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 _.mu(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));BD(d,c);a:if(c=d.a,f.length!==c.length)f=!1;else{for(d=
|
|
175
|
+
0;d<f.length;d++)if(!f[d].ma(c[d])){f=!1;break a}f=!0}!f&&a.trigger(new _.L(_.Tf));CE(a.Ke);zE(a.K,b.cues)};NI=function(a){var b,c;return _.I(function(d){if(1==d.a)return II(a),_.y(d,JI(a),2);if(3!=d.a){KI(a);b=_.ok(4)||_.ok(5);if(!b)return d.F(3);c=a.getSurface().getMedia();LI(a,c);return _.y(d,MI(a,c),3)}a.configuration=a.Nb;_.A(d)})};
|
|
176
|
+
UI=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.o.a=e,_.D(l,2),II(a),_.y(l,OI(a),4);case 4:return CG(a.o,e),a.$=_.Yp(b),a.configuration=_.vm(a.Nb,b),a.xg&&a.configuration.mse.sendPlaybackSessionIdHeader&&a.getNetworkEngine().headers.set(TC,a.xg),a.log.info(_.tb,a.configuration),a.log.info(_.Mb,a.$),_.y(l,PI(a,e),5);case 5:return CG(a.o,e),_.y(l,QI(a,b,a.getSourceIndex(),e,!1),6);case 6:return f=l.f,CG(a.o,e),a.A=f.parser,
|
|
177
|
+
a.f=f.manifest,EI(a,f.manifest.cues),g=a,_.y(l,RI(a,a.f,a.configuration.drm),7);case 7:g.w=l.f;CG(a.o,e);if(!c){l.F(8);break}return _.y(l,SI(a,e),9);case 9:CG(a.o,e),a.l.one(a.j,_.Fe,function(){var m=Date.now()/1E3-d;a.H&&(a.H.A=m)});case 8:e.resolve();_.oh(l,0);break;case 2:h=_.E(l),TI(a,h,e),_.A(l)}})};EI=function(a,b){if(a.configuration.ads.hls.mockCuesFn){var c=a.configuration.ads.hls.mockCuesFn(a);zE(a.K,c)}else zE(a.K,b)};
|
|
178
|
+
TI=function(a,b,c){b=VI(a,b,c);c["catch"](function(){});c.reject(b);a.onError(b);throw b;};VI=function(a,b,c){var d=a.o;return null!=d.a&&d.a===c||b instanceof _.N&&7E3===b.code?b instanceof _.N?b:new _.N(_.P,7,7003,"Unexpected error.",b):BG(a.o)};OI=function(a){return a.ga?a.ga["catch"](function(){}):Promise.resolve()};
|
|
179
|
+
PI=function(a,b){var c;return _.I(function(d){if(1==d.a)return a.H=new _.Bp,BI(a,_.Sp),c=WI(a,a.configuration),_.y(d,MI(a,c),2);CG(a.o,b);a.K=new xE;yE(a.K,function(e){a.log.info("Timeline cue found",e);XI(a,_.ki,e)},function(){a.log.info("Timeline cues changed");a.trigger(new _.L(_.ei))});_.A(d)})};
|
|
180
|
+
QI=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=_.Yp(f),h=g[c],_.y(n,YI(a,h),2);case 2:return l=n.f,CG(a.o,d),_.ko(dD),_.y(n,ZI(a,l,h,f.id||""),3);case 3:m=n.f;CG(a.o,d);if(!e||!m.presentationTimeline.l){n.F(4);break}return _.y(n,l.stop(),5);case 5:CG(a.o,d);case 4:return _.ko("manifest.end"),_.so("Fetch and parse manifest",dD,"manifest.end"),n["return"]({parser:l,manifest:m})}})};
|
|
181
|
+
$I=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a)return _.y(f,QI(a,b,0,null,!0),2);c=f.f;try{return d=[a.f,xF(c.manifest)],e=AF(d,a.f.presentationTimeline),f["return"]({parser:c.parser,manifest:e})}catch(g){throw new _.N(_.P,7,7003,"Failed to append load manifest");}})};WI=function(a,b){var c=a.getSurface().getMedia();c.loop=!!b.loop;_.M.R(b.volume)||a.setVolume(b.volume);_.M.R(b.muted)||a.setMuted(b.muted);LI(a,c);return c};
|
|
182
|
+
LI=function(a,b){a.j||(a.l.on(b,_.ne,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 _.N(_.P,3,3016,{code:c,extendedError:d,message:a.j.error.message})}}else c=null;if(c)a.onError(c)}),a.j=b)};KI=function(a){a.j&&(a.l.off(a.j,_.ne),a.j=null)};
|
|
183
|
+
JI=function(a){var b;return _.I(function(c){switch(c.a){case 1:a.G!==bJ&&(a.G=xI);if(b=a.j)a.l.off(b,_.Fe),a.l.off(b,_.tf),a.l.off(b,_.df),a.l.off(b,_.me),a.l.off(b,_.Jf),a.l.off(b,_.Hf);a.K&&(a.K.release(),a.K=null);a.Ec&&(a.Ec.release(),a.Ec=null);a.Jc&&(a.Jc.stop(),a.Jc=null);if(!a.A){c.F(2);break}return _.y(c,a.A.stop(),3);case 3:a.A=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:a.B&&(a.B.release(),
|
|
184
|
+
a.B=null);a.I&&(a.I.release(),a.I=null);if(!a.L){c.F(8);break}return _.y(c,a.L.destroy(),9);case 9:a.L=null;case 8:a.Qc&&(a.Qc.release(),a.Qc=null);a.He&&(a.He.release(),a.He=null);b&&b.src&&(b.removeAttribute("src"),b.load());if(!a.w){c.F(10);break}return _.y(c,a.w.destroy(),11);case 11:a.w=null;case 10:a.P.clear(),a.J=null,a.Ie.clear(),a.f=null,a.H=null,a.ca=!0,a.Nc.clear(),a.Ld=!1,cJ(a),_.A(c)}})};
|
|
185
|
+
MI=function(a,b){var c,d,e,f,g;return _.I(function(h){if(1==h.a)return c=window.muxjs?new UF:new _.VF,d=_.up(a.configuration,[_.ue,"single-native"]),e=d.create(a),a.V=e,f=AI(a),f.track(a),a.Qc=f,g=null,AJ(a)?g=new VG(b,c,e,f,a.configuration):g=new _.XF(b,c,e,f,a.configuration),_.y(h,g.open(),2);a.L=g;_.A(h)})};
|
|
186
|
+
YI=function(a,b){var c,d;return _.I(function(e){if(1==e.a)return c=a.getNetworkEngine(),_.y(e,_.pu(b.url,c,a.configuration.manifest.attemptParameters,b.type||null),2);d=e.f;d.configure(a.configuration.manifest);return e["return"](d)})};
|
|
187
|
+
ZI=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}_.D(h,4);var l=c.url;var m=BJ(a,d);l=b.start(l,m);return _.y(h,l,6);case 6:e=h.f;_.oh(h,2);break;case 4:f=_.E(h);if(!a.Kc)throw f;return _.y(h,a.Kc(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 _.N(_.P,4,4014);CJ(e.periods);return h["return"](e)}})}),function(){a.log.info("Aborting parser step...");
|
|
188
188
|
return b.stop()})).U};
|
|
189
|
-
|
|
190
|
-
if(t.length){t=a.getPeriods();for(var z=0;z<t.length;z++)for(var C=t[z],F=_.w(C.variants),G=F.next();!G.done;G=F.next()){G=G.value;var
|
|
191
|
-
(H.keyId+"'. Applying restrictions to "+T)));C===p&&O!==G.allowedByKeySystem&&(q=!0)}}}if(n=
|
|
192
|
-
e=_.
|
|
193
|
-
|
|
194
|
-
b),a.h.configure(a.configuration.abr),a.
|
|
195
|
-
a.configuration.streaming.rebufferingGoal),
|
|
196
|
-
for(l=h.next();!l.done;l=h.next())m=l.value,
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
d,"buffered to end",b,"state",a.getState()),
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
b.id});f?(a
|
|
205
|
-
|
|
206
|
-
if(h){var l=h.renditions.map(function(m){return m.id});g=f.find(function(m){return l.find(function(n){return n===String(m.video.id)})})}}}else g=f[0];if(g){if(d.codecs.split(".")[0]===g.audio.codecs.split(".")[0]){d=g.audio;a.Mc=d.id;f=f.map(
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
b).variant=c};
|
|
210
|
-
|
|
189
|
+
RI=function(a,b,c){var d,e,f,g,h,l;return _.I(function(m){switch(m.a){case 1:_.ko("initDrm.start");d=new _.xo({Jb:a.getNetworkEngine(),onError:function(n){return a.onError(n)},Yf:function(n){if(a.a){var p=DJ(a),q=!1,t=Object.keys(n);0===t.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 v=1===t.length&&"00"===t[0];v&&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.");
|
|
190
|
+
if(t.length){t=a.getPeriods();for(var z=0;z<t.length;z++)for(var C=t[z],F=_.w(C.variants),G=F.next();!G.done;G=F.next()){G=G.value;var B=[];G.audio&&B.push(G.audio);G.video&&B.push(G.video);B=_.w(B);for(var H=B.next();!H.done;H=B.next()){H=H.value;var O=G.allowedByKeySystem;if(H.keyId){var T=n[v?"00":H.keyId];T=!!T&&!EJ.includes(T);G.allowedByKeySystem=T}O!==G.allowedByKeySystem&&(T=H.type,H.type===_.r&&(T="video "+H.width+"x"+H.height+"@"+_.R.qf(H.bandwidth)),a.log.warn("DRM Key not available for KID: '"+
|
|
191
|
+
(H.keyId+"'. Applying restrictions to "+T)));C===p&&O!==G.allowedByKeySystem&&(q=!0)}}}if(n=vH(a.a)){v=xH(a.a);t=yH(a.a);a:{z=n.variants;for(C=0;C<z.length;C++)if(z[C].audio===v&&z[C].video===t){v=z[C];break a}v=null}if(!v||v.allowedByKeySystem)a.log.info(mC),FJ(a),GJ(a,n.variants)}q&&n!==p&&(a.log.info(mC),FJ(a),GJ(a,p.variants))}},Xf:function(n,p){a.trigger(new _.L(_.ce,{expirationTime:p}))},onEvent:function(n){return a.yf(n)},getConfiguration:function(){return a.getConfiguration()},$c:function(){return a.$c()}});
|
|
192
|
+
e=_.Rm(c);d.h=e;f=c?c.offlineId||"":"";g=[];h=_.gu(b.periods);if(!f){m.F(2);break}l=_.zm(_.ef);if(!l){m.F(2);break}return _.y(m,l.l(a,h),4);case 4:return _.y(m,l.j(f),5);case 5:g=m.f;case 2:return _.y(m,_.Co(d,h,g),6);case 6:return a.w=d,HJ(a,b.periods),_.ko("initDrm.end"),_.so("Init DRM","initDrm.start","initDrm.end"),m["return"](d)}})};
|
|
193
|
+
SI=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,IJ(a,c),JJ(a,a.f.periods),a.Lc=new KG(a.configuration.preferredAudioLanguage||[],a.configuration.preferredAudioRole,a.configuration.preferredAudioChannelCount,a.configuration.preferSpatialAudio,a.configuration.mediaSource.codecSwitchingStrategy),a.Gd=a.configuration.preferredTextLanguage,a.Ge=a.configuration.preferredTextRole,a.Cd=a.configuration.preferForcedSubtitles,_.y(q,_.To(a.w,c),2);if(3!=q.a)return CG(a.o,
|
|
194
|
+
b),a.h.configure(a.configuration.abr),a.dg&&a.h.setCmsdManager(a.dg),a.h.init(function(t,v,z){if(!a.ca){var C=DJ(a);(t=DF(t,C.variants))?KJ(a,t,v,z):a.log.warn("No matching variant found for track switch")}}),a.B=LJ(a,c,a.configuration.startTime),a.Ec=MJ(a),a.I=new jH({Jh:function(){return c.playbackRate},zn:function(t){c.playbackRate=t},Ul:function(t){c.currentTime+=t}}),kH(a.I,a.configuration.trickPlay),a.isLive()&&a.configuration.streaming.enableLiveEdgeChasing&&(a.He=new TG(a)),d=Math.max(1E-4,
|
|
195
|
+
a.configuration.streaming.rebufferingGoal),NJ(a,d),AJ(a)?nG(a.f,_.vi(a.configuration.preferredVideoCodec),_.vi(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount):mG(a.f,_.vi(a.configuration.preferredVideoCodec),_.vi(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount),e=OJ(a),e.h=a.configuration.streaming,a.a=e,a.G=yI,_.y(q,e.start(),3);CG(a.o,b);a.configuration.streaming.startAtSegmentBoundary&&(f=bF(a.B),g=PJ(a,f),VE(a.B.f,g));h=_.w(a.f.periods);
|
|
196
|
+
for(l=h.next();!l.done;l=h.next())m=l.value,QJ(a,m);FJ(a);n=DJ(a)||a.f.periods[0];p=n.variants.some(function(t){return t.primary});a.configuration.preferredAudioLanguage||p||a.log.warn("No preferred audio language set. We will choose an arbitrary language initially");GJ(a,n.variants);_.A(q)})};
|
|
197
|
+
IJ=function(a,b){function c(d){a.j&&a.J&&(d.type===_.Vf&&a.Td?(a.J.a=QG,cJ(a)):d.type===_.Lg&&a.getState()===_.Up&&.1>a.getBufferInfo().Aa(a.getMediaPosition())?(a.J.a=QG,cJ(a)):a.J&&RJ(a));SJ(a)}a.l.on(b,_.tf,c);a.l.on(b,_.df,c);a.l.on(b,_.me,c);a.l.on(b,_.Vf,c);a.l.on(b,_.Uf,c);a.l.on(b,_.Hf,c);a.l.on(b,_.Lg,c);a.l.on(b,_.Jf,function(){if(a.j){var d=a.j.playbackRate;0!==d&&a.I.set(d)}})};
|
|
198
|
+
CJ=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)})){_.Ih("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)}};LJ=function(a,b,c){return new $E(b,a.f,a.configuration.streaming,c,function(d){a.Ec&&dF(a.Ec,!0,d);a.a&&MH(a.a)},function(d){return a.dispatchEvent(d)},a.ba===_.Hb)};
|
|
199
|
+
MJ=function(a){var b=new eF(a.j),c=new hH(a.f);iH(c,function(){FJ(a)});b.a.add(c);a.K&&(c=new gF(a.K),hF(c,function(d){d.Pe&&d.Pe();XI(a,_.fi,d)},function(d){d.Wf&&d.Wf();XI(a,_.gi,d)},function(d,e){e||(d.Pe&&d.Pe(),XI(a,_.fi,d),d.Wf&&d.Wf(),XI(a,_.gi,d))}),b.a.add(c));a.ba===_.Hb&&(c=new BE(a.Jd,a.Qd,function(d){return a.trigger(d)},a.configuration.playlist),b.a.add(c),a.Ke=c);return b};NJ=function(a,b){a.J=new RG(b,Math.min(.5,b/2));a.J.a=QG;cJ(a);a.Jc=(new _.pl(function(){RJ(a)})).yb(.25)};
|
|
200
|
+
RJ=function(a){switch(a.G){case yI:a:if(a.j.ended||a.L.ue())var b=!0;else{if(a.isLive()){b=sE(a.f.presentationTimeline);var c=a.getBufferInfo();if(null!==c&&(c=c.ha(),null!==c&&c>=b)){b=!0;break a}}b=!1}break;default:b=!1}if(a.L){var d=a.L.Jf();c=d.video;d=d.audio;var e=a.j.currentTime;c&&d?(c=c.Aa(e),d=d.Aa(e),c=Math.min(c,d)):c=c?c.Aa(e):d?d.Aa(e):0}else c=0;if(d=a.J){d=a.J;var f=b,g=d.f.get(d.a);e=d.a;c=f||c>=g?PG:QG;d.a=c;d=e!==c}c=d;d=TJ(a);c||a.getState()===_.Lp&&!d?(a.log.debug("Buffering state changed. Is buffering",
|
|
201
|
+
d,"buffered to end",b,"state",a.getState()),cJ(a)):a.Ld&&SJ(a)};OJ=function(a){var b={configuration:{Ll:a.ba===_.Hb},Qb:function(){return bF(a.B)},W:a.L,Jb:a.getNetworkEngine(),Vf:a.dk.bind(a),Uf:a.ck.bind(a),onError:a.onError.bind(a),ji:a.rm.bind(a),onEvent:a.yf.bind(a),oi:a.Qn.bind(a),Qe:a.Em.bind(a),ze:function(){return a.h},rf:a.oj.bind(a),Ni:a.Gn.bind(a),Fd:a.w};return new _.tH(a.f,b)};
|
|
202
|
+
NF=function(a){if(a.f&&a.B){var b=UJ(a),c=[];a=_.w(VJ(a));for(var d=a.next();!d.done;d=a.next()){d=d.value;var e=tG(d);e.active=d===b;c.push(e)}return c}return[]};LF=function(a,b){if(a.f&&a.a){var c=DJ(a),d=c.textStreams.find(function(e){return e.id===b.id});d?(WJ(a,c,d,!1),XJ(a,d),a.Gd=d.language,a.Cd=d.kind===_.pe):a.log.error(_.FC,b.id)}};
|
|
203
|
+
OF=function(a,b,c){var d=void 0===d?0:d;if(a.f&&a.a){var e=DJ(a);if(a.configuration.abr.enabled&&b)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();else if(!a.configuration.abr.enabled&&!b){a.log.info("Enable ABR Selection");a.configuration.abr.enabled=!0;a.h.enable();a.Z=null;c=GJ(a,e.variants);null!=a.za&&(a.Lc=a.za,a.za=null);null==c||a.ca||KJ(a,c);return}if(b){a.Z=b.id;var f=e.variants.find(function(g){return g.id===
|
|
204
|
+
b.id});f?(a.Z=f.video.id,vG(f)?(YJ(a,e,f,!1),ZJ(a,f,c,d),null==a.za&&(a.za=a.Lc),a.Lc=new LG(f),GJ(a,e.variants)):a.log.error("Unable to switch to restricted track",b.id)):a.log.error("No variant with id",b.id)}else a.Z=null,null!=a.za&&(a.Lc=a.za,a.za=null),c=GJ(a,e.variants),null==c||a.ca||KJ(a,c)}};
|
|
205
|
+
MF=function(a,b){if(a.configuration.streaming.disableAudioTracks)Promise.reject(Error("Audio tracks are disabled by config."));else{if(a.a&&(a.f||a.B)){var c=yH(a.a),d=xH(a.a),e=ZD(a.f.periods,bF(a.B)),f=a.f.periods[e?a.f.periods.indexOf(e):0].variants.filter(function(m){return m.audio.id===b&&vG(m)});e=!1;var g=void 0;if(c){if(g=f.find(function(m){return m.video.id===c.id}),!g){a.log.debug("Cannot find exact variant, looking for anything else that matches with given audioId");e=!0;var h=a.getTrackManager().Ga();
|
|
206
|
+
if(h){var l=h.renditions.map(function(m){return m.id});g=f.find(function(m){return l.find(function(n){return n===String(m.video.id)})})}}}else g=f[0];if(g){if(d.codecs.split(".")[0]===g.audio.codecs.split(".")[0]){d=g.audio;a.Mc=d.id;f=f.map(CF);a.h.setTracks(f);f=DJ(a);YJ(a,f,g,!1);e||a.ca?ZJ(a,g,!0,0):_.HH(a.a,d,!0,0);Promise.resolve();return}a.log.warn("Target audio codecs not compatible with active audio codecs.")}}Promise.reject()}};
|
|
207
|
+
PF=function(a){var b=a.ng;return a.f?a.L.getTextDisplayer().isTextVisible():b};KF=function(a,b){var c,d,e,f;return _.I(function(g){c=a.ng;d=b;if(c===d)return g["return"]();a.ng=d;if(a.G!==yI)return g.F(0);a.L.getTextDisplayer().setTextVisibility(b);if(a.configuration.streaming.alwaysStreamText)return g.F(0);if(!b)return GH(a.a),g.F(0);e=DJ(a);f=_.xG(e.textStreams,a.Gd,a.Ge,a.Cd);return 0<f.length?_.y(g,DH(a.a,f[0]),0):g.F(0)})};
|
|
208
|
+
YJ=function(a,b,c,d){var e=a.getTrackManager();a.A&&a.A.setCurrentVariant(c);if(e){var f=a.H.B;if(c.video){SF(e,c.video,d);var g=e.ja();f.j!==g&&(f.j=g,f.a.push({timestamp:Date.now()/1E3,id:g.id,trackId:g.track.id,type:g.track.type,fromAdaptation:d,width:g.width,height:g.height,bandwidth:g.bandwidth}))}c.audio&&(SF(e,c.audio,d),e=e.Va(),f.f!==e&&(f.f=e,f.a.push({timestamp:Date.now()/1E3,id:e.id,trackId:e.track.id,type:e.track.type,fromAdaptation:d,width:null,height:null,bandwidth:e.bandwidth})))}FG(a.P,
|
|
209
|
+
b).variant=c};WJ=function(a,b,c,d){FG(a.P,b).text=c;if(b=a.getTrackManager())SF(b,c,d),c=b.Ra(),a=a.H.B,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}))};$J=function(a){return a.ba===_.Hb&&"flat"===a.configuration.playlist.timeline};
|
|
210
|
+
JJ=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.Ui++,originalId:l,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return null},getSegmentReference:function(){return null},initSegmentReference:null,Da:0,mimeType:_.Sc,codecs:"",kind:_.nd,encrypted:!1,
|
|
211
211
|
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)}};
|
|
212
|
-
|
|
213
|
-
e.value,(g=e.video)&&!
|
|
214
|
-
|
|
215
|
-
_.
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
d=a.h.chooseTrack(),
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
missingKeys:g,restrictedKeyStatuses:h});};
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
c.audio.id;h=c.video&&c.video.id;a.f.periods=f.periods;l=
|
|
228
|
-
z.next())F=C.value,F.video&&v.add(F.video),F.audio&&v.add(F.audio);G=a.getNetworkEngine();
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
_.
|
|
212
|
+
HJ=function(a,b){for(var c=a.a?xH(a.a):null,d=a.a?yH(a.a):null,e=!AJ(a),f=_.w(b),g=f.next();!g.done;g=f.next())sG(a.w,c,d,g.value,e);c=KD(b,function(h){return h.variants.some(vG)});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=
|
|
213
|
+
e.value,(g=e.video)&&!LD(g.type,_.kl(g.mimeType,g.codecs))&&delete e.video;if(0===c)throw new _.N(_.P,4,4032);if(c<b.length)throw new _.N(_.P,4,4011);c=_.w(b);for(e=c.next();!e.done;e=c.next())d=e.value,pG(d.variants,a.configuration.restrictions)&&a.a&&DJ(a)===d&&FJ(a),aK(a,d.variants)};
|
|
214
|
+
QJ=function(a,b){var c=a.a?xH(a.a):null,d=a.a?yH(a.a):null,e=!AJ(a);sG(a.w,c,d,b,e);d=b.variants;if(!d.some(vG))throw new _.N(_.P,4,4011);aK(a,b.variants);pG(d,a.configuration.restrictions)&&a.a&&DJ(a)===b&&FJ(a);if(!_.ok(2)&&(c=a.w?a.w.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,_.Wo(a.w,g.keyId,g.initData)||
|
|
215
|
+
_.No(a.w,g.initDataType,g.initData,g.keyId)}}};ZJ=function(a,b,c,d){c=void 0===c?!1:c;d=void 0===d?0:d;a.ca?(a.ta=b,a.Ti=c,a.Si=d):IH(a.a,b,c,d)};XJ=function(a,b){a.ca?a.fa=b:_.HH(a.a,b,!0,0)};bK=function(a){if(a.a&&a.f){var b=vH(a.a),c=DJ(a);null!=b&&b===c&&(xH(a.a),yH(a.a),_.wH(a.a,_.Q),FG(a.P,c),FG(a.P,c))}};
|
|
216
|
+
PJ=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=xH(a.a),e=yH(a.a),f=DJ(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};TJ=function(a){return a.w&&a.w.C?!0:a.J?a.J.getState()===QG:!1};
|
|
217
|
+
cJ=function(a){if(a.H&&a.J&&a.B){var b=cK(a)===_.Lp,c=a.I;c.l=b;nH(c,c.o?"seek":void 0);a.B.j.o=b;SJ(a);a.Ke&&(c=1>Math.abs(a.getMediaDuration()-a.getMediaPosition()),a=a.Ke,b&&c&&(b=a.a,b.a[b.a.length-1]&&a.f(new _.L(_.Qf))))}};SJ=function(a){BI(a,cK(a))};cK=function(a){if(a.Td)var b=!1;else if(a.j&&a.j.ended)b=!0;else{b=a.getMediaDuration();var c=a.getMediaPosition();b=a.Ld&&0<=c&&b<=c?!0:!1}return b?_.Np:TJ(a)||a.Td?_.Lp:a.j&&a.j.paused?_.Tp:_.Up};
|
|
218
|
+
GJ=function(a,b){try{aK(a,b)}catch(f){return a.onError(f),null}var c=b.filter(function(f){return vG(f)}),d=tF(c,a.Mc);c=a.Lc.create(d);c=Array.from(c.values());var e=c.map(CF);a.h.setTracks(e);if(null!==a.Z&&null!==a.Mc&&(e=c.find(function(f){return f.video.id===a.Z&&f.audio.id===a.Mc}),a.Z=null,e))return e;if(a.configuration.abr.enabled||null===a.Z)return d=a.h.chooseTrack(),DF(d,c);d=d.find(function(f){return null!==f.video&&f.video.id===a.Z});return d?d:(a.log.warn("Selected video track not found. Falling back to ABR selection"),
|
|
219
|
+
d=a.h.chooseTrack(),DF(d,c))};dK=function(a,b){return _.xG(b,a.Gd,a.Ge,a.Cd)[0]||null};eK=function(a,b,c){c=void 0===c?!0:c;var d=GJ(a,b.variants);a.Mc=d&&d.audio&&d.audio.id;d&&(YJ(a,b,d,!0),ZJ(a,d,c));(c=dK(a,b.textStreams))&&(a.configuration.streaming.alwaysStreamText||PF(a))&&(WJ(a,b,c,!0),XJ(a,c))};
|
|
220
|
+
hK=function(a,b){a.ca=!0;a.h.disable();a.log.debug("Choosing new streams after period changed");var c=GJ(a,b.variants),d=dK(a,b.textStreams);a.ta&&(b.variants.includes(a.ta)&&(c=a.ta),a.ta=null);a.fa&&(b.textStreams.includes(a.fa)&&(d=a.fa),a.fa=null);c&&fK(a,b,function(){return YJ(a,b,c,!0)});d&&(a.configuration.streaming.alwaysStreamText||PF(a))&&fK(a,b,function(){return WJ(a,b,d,!0)});b===DJ(a)&&gK(a);return a.configuration.streaming.alwaysStreamText||PF(a)?{variant:c,text:d}:{variant:c,text:null}};
|
|
221
|
+
KJ=function(a,b,c,d){c=void 0===c?!1:c;d=void 0===d?0:d;if(a.configuration.abr.enabled){a.log.debug("switch_");var e=iK(a,b);fK(a,e,function(){return YJ(a,e,b,!0)});e===DJ(a)&&gK(a);a.a&&IH(a.a,b,c,d)}};FJ=function(a){var b=a.getTrackManager();b&&a.G!==bJ&&(b.m&&(RF(b),b.m.trigger(new _.L(_.Kv))),gK(a))};gK=function(a){var b=DJ(a);if(b){var c=a.Nc.get(b)||[];for(a.Nc["delete"](b);c.length;)c.shift()()}};fK=function(a,b,c){a.Nc.has(b)||a.Nc.set(b,[]);a.Nc.get(b).push(c)};
|
|
222
|
+
XI=function(a,b,c){a.trigger(new _.L(b,{detail:wE(c,$J(a))}))};
|
|
223
|
+
aK=function(a,b){var c=a.w?_.M.Ig(a.w.fa):{},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?EJ.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 _.N(_.P,4,4012,{hasAppRestrictions:f,
|
|
224
|
+
missingKeys:g,restrictedKeyStatuses:h});};VJ=function(a){var b=DJ(a);if(null==b)return[];bK(a);return b.variants.filter(function(c){return vG(c)})};jK=function(a){var b=DJ(a);if(null==b)return[];bK(a);return b.textStreams.filter(function(c){return!a.Ie.has(c)})};DJ=function(a){var b=bF(a.B),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};UJ=function(a){var b=DJ(a);return b&&FG(a.P,b).variant};
|
|
225
|
+
iK=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};II=function(a){if(a.G===bJ)throw new _.N(_.P,7,7E3,"Player is destroyed.");};
|
|
226
|
+
kK=function(a,b,c){var d,e,f,g,h,l,m,n,p,q,t,v,z,C,F,G,B,H,O,T;return _.I(function(da){switch(da.a){case 1:return d=_.eq,_.D(da,2),_.y(da,_.pu(b.url,a.getNetworkEngine(),a.configuration.manifest.attemptParameters,b.type||null),4);case 4:e=da.f;e.configure(a.configuration.manifest);var aa=e;var ya=b.url,Va=BJ(a,a.configuration.id||"");aa=aa.start(ya,Va);return _.y(da,aa,5);case 5:f=da.f;CJ(f.periods);if(!f.periods.length)throw new _.N(_.P,4,4014);return _.y(da,a.A.stop(),6);case 6:a.A=e;g=c.audio&&
|
|
227
|
+
c.audio.id;h=c.video&&c.video.id;a.f.periods=f.periods;l=ZD(f.periods,bF(a.B))||f.periods[0];AJ(a)?nG(a.f,_.vi(a.configuration.preferredVideoCodec),_.vi(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount):mG(a.f,_.vi(a.configuration.preferredVideoCodec),_.vi(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount);m=uF(g,h,l.variants);n=dK(a,l.textStreams);GJ(a,l.variants);p=m&&m.video;q=m&&m.audio;t=[];v=new Set;z=_.w(l.variants);for(C=z.next();!C.done;C=
|
|
228
|
+
z.next())F=C.value,F.video&&v.add(F.video),F.audio&&v.add(F.audio);G=a.getNetworkEngine();B=_.w(_.ah(v).concat(_.ah(l.textStreams)));for(H=B.next();!H.done;H=B.next())O=H.value,t.push(O.createSegmentIndex(G));return _.y(da,Promise.all(t),7);case 7:UH(a.a,d.AUDIO,q);UH(a.a,d.VIDEO,p);UH(a.a,d.TEXT,n);m&&YJ(a,l,m,!1);a.log.info("Switch CDN successful.");_.oh(da,0);break;case 2:T=_.E(da);if(!e){da.F(8);break}return _.y(da,e.stop(),8);case 8:throw T;}})};
|
|
229
|
+
BJ=function(a,b){return{networkingEngine:a.getNetworkEngine(),configurationId:b,filterNewPeriod:function(c){return QJ(a,c)},filterAllPeriods:function(c){return HJ(a,c)},onEvent:function(c){return a.yf(c)},onError:function(c){return a.onError(c)},onUpdate:function(c){return GI(a,c)},onTurnedStatic:function(){return HI(a)}}};
|
|
230
|
+
AJ=function(a){return a.configuration.mediaSource.codecSwitchingStrategy===_.$f&&(_.ok(2)||_.ok(3)||_.ok(4)||_.ok(5)||_.ok(6)||_.pk()&&38===_.tl().major||_.pk()&&53===_.tl().major||_.pk()&&68===_.tl().major?!1:!0)};lK=function(){};mK=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}};
|
|
231
|
+
nK=function(){var a=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(b,c){return a.call(this,b,c-.001)}};oK=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"mp2t"===b.split(/ *; */)[0].split("/")[1].toLowerCase()?!1:a(b)}};pK=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"opus"!==_.OD(b)&&a(b)}};
|
|
232
|
+
qK=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)}};
|
|
233
|
+
rK=function(a){_.nv.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=_.Vd;c.label===HC&&(this.a=c)}this.a||(this.a=a.addTextTrack(_.mD,HC));this.a.mode=_.te};sK=function(a,b){var c=a.mode;a.mode=c===_.Wf?_.Wf:_.te;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};tK=function(){};_.oj.prototype.f=oD(0,function(){return this.keyInfo});var rD=[112,115,115,104,0,0,0,0];
|
|
234
|
+
_.GD.prototype.Od=function(){return this.la?this.la-this.ya+1:null};_.GD.prototype.f=function(){return this.keyInfo};_.uK=0;_.u=_.SD.prototype;_.u.track=function(a){null!=this.player&&UD(this);a&&(this.player=a,this.player.on(_.Of,this.Sc,this))};_.u.release=function(){UD(this);this.T=[];this.f=this.h=null};
|
|
235
235
|
_.u.append=function(a,b,c){c=void 0===c?null:c;var d=this.h&&null!==c?this.h(c):null;d||this.log.debug("Unable to resolve rendition for ID",c);c={start:a,end:b,rendition:d,width:d?d.width:0,height:d?d.height:0,bandwidth:d?d.bandwidth:0};var e=this.T.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.T);for(e=d.next();!e.done;e=d.next())e=e.value,a>=e.start&&a<e.end?e.end=a:b>=e.start&&
|
|
236
|
-
b<e.end&&(e.start=b);this.T.push(c);this.T.sort(
|
|
236
|
+
b<e.end&&(e.start=b);this.T.push(c);this.T.sort(RD)}XD(this);this.Sc();this.player&&this.player.trigger(new _.L(_.Gg))};_.u.clear=function(){this.T=[];XD(this);this.player&&(this.player.trigger(new _.L(_.Gg)),this.player.trigger(new _.L(_.fd)))};
|
|
237
237
|
_.u.Sc=function(){if(this.player){var a=this.player.getMediaPosition();if(0<=a){a:{for(var b=this.T.length,c=Number.MAX_SAFE_INTEGER,d=0;d<b;d++){var e=this.T[d];c=Math.min(e.start,c);if(e.start<=a&&e.end>a){a=.1>e.end-a&&d<b-1?this.T[d+1].rendition:e.rendition;break a}if(e.start>a)break}a=0<b&&c>a&&.25>c-a?this.T[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(_.hd,
|
|
238
|
-
{detail:{width:b,height:c,bandwidth:a?a.bandwidth:null,rendition:a}}))}}}};
|
|
239
|
-
_.u.isLive=function(){return 2===this.j.version?!this.a.f:Infinity===this.f&&!this.l};_.u.Vd=function(){return!this.l};
|
|
240
|
-
|
|
238
|
+
{detail:{width:b,height:c,bandwidth:a?a.bandwidth:null,rendition:a}}))}}}};hE.prototype.Rb=function(){return this.h};hE.prototype.getDuration=function(){return this.f?this.a-this.h:Infinity};_.u=_.jE.prototype;_.u.uc=function(){return this.L};_.u.getDuration=function(){return 2===this.j.version?this.a.getDuration():this.f};_.u.getPresentationStartTime=function(){return this.G};_.u.offset=function(a){null!=this.w&&(this.w+=a);null!=this.o&&(this.o+=a)};
|
|
239
|
+
_.u.isLive=function(){return 2===this.j.version?!this.a.f:Infinity===this.f&&!this.l};_.u.Vd=function(){return!this.l};xE.prototype.release=function(){this.f=function(){};this.h=function(){};this.a.clear()};xE.prototype.cues=function(){return this.a};BE.prototype.release=function(){this.f=this.j=this.h=this.a=null};BE.prototype.l=function(a){BD(this.a,a);CE(this)};
|
|
240
|
+
DE.prototype.next=function(){var a=this.h.get(this.a);a&&0<a.a.length?(this.f+=1,a.Xa().length&&this.f===a.a.length&&(this.a+=1,this.f=0)):(this.a+=1,this.f=0);a=EE(this);return{value:a,done:!a}};_.u=_.FE.prototype;_.u.destroy=function(){this.a=[];return Promise.resolve()};
|
|
241
241
|
_.u.Uc=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};
|
|
242
|
-
_.u.get=function(a){if(0===this.a.length)return null;a-=this.a[0].position;return 0>a||a>=this.a.length?null:this.a[a]};_.u.offset=function(a){this.g.info("Apply offset"+a+" to segment index");for(var b=_.w(this.a),c=b.next();!c.done;c=b.next())c=c.value,c.startTime+=a,c.endTime+=a,c.
|
|
242
|
+
_.u.get=function(a){if(0===this.a.length)return null;a-=this.a[0].position;return 0>a||a>=this.a.length?null:this.a[a]};_.u.offset=function(a){this.g.info("Apply offset"+a+" to segment index");for(var b=_.w(this.a),c=b.next();!c.done;c=b.next())c=c.value,c.startTime+=a,c.endTime+=a,c.Da-=a};
|
|
243
243
|
_.u.qd=function(a,b){var c=a-this.a[0].position;if(0<=c&&c<this.a.length)for(this.g.warn("Accounting for segment duration drift",b,"at",c),this.a[c].endTime+=b,c+=1;c<this.a.length;++c)this.a[c].startTime+=b,this.a[c].endTime+=b};_.u.getDuration=function(){return this.a[this.a.length-1].endTime-this.a[0].startTime};
|
|
244
|
-
_.u.pa=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 _.
|
|
245
|
-
b[b.length-1].position+1;e<a.length;)f=a[e++],f=new _.
|
|
246
|
-
a};_.u.replace=function(a){this.a=a};
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
_.u.
|
|
250
|
-
_.u.
|
|
251
|
-
_.u.
|
|
252
|
-
_.u.ra=function(){return!!this.m&&this.m.ra()};
|
|
253
|
-
|
|
254
|
-
_.u.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"](
|
|
255
|
-
{};a.H=null;a.K=!1;for(var g in a.h);a.h={}})};_.u.open=function(){return this.J};_.u.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e;return _.I(function(f){if(1==f.a)return e=_.
|
|
256
|
-
_.u.
|
|
257
|
-
_.u.
|
|
258
|
-
_.u.te=function(a,b,c,d,e,f,g){var h=this;g=void 0===g?!1:g;var l=this.f[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=
|
|
259
|
-
_.r,this.Af.bind(this,_.r,b.video.buffer))),b=Promise.all(e)):(e&&window.muxjs&&(this.a||this.
|
|
260
|
-
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.G[a]&&l&&1===l.buffered.length){p=l.buffered.start(0);var t=c-p;if(Math.abs(t)>h.P&&0===l.timestampOffset)return h.g.warn(
|
|
261
|
-
_.u.
|
|
262
|
-
_.u.flush=function(a){return a===_.Q?Promise.resolve():
|
|
263
|
-
_.u.getDuration=function(){return this.o.duration};_.u.Af=function(a,b){this.g.debug(
|
|
264
|
-
_.u.
|
|
265
|
-
_.u.
|
|
266
|
-
_.u.Vc=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug(
|
|
267
|
-
_.u.chooseTrack=function(){var a=
|
|
244
|
+
_.u.pa=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 _.oj(f.position,g.startTime,g.endTime,g.Xa,g.ya,g.la,g.Da,g.keyInfo,g.Xc,g.timescale,g.horizontalTiles,g.verticalTiles,g.durationPerTile),b.push(f)):b.push(f),d++),e++)}for(;d<this.a.length;)b.push(this.a[d++]);if(b.length)for(d=
|
|
245
|
+
b[b.length-1].position+1;e<a.length;)f=a[e++],f=new _.oj(d++,f.startTime,f.endTime,f.Xa,f.ya,f.la,f.Da,f.keyInfo,f.Xc,f.timescale,f.horizontalTiles,f.verticalTiles,f.durationPerTile),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 _.oj(e-d--,f.startTime,f.endTime,f.Xa,f.ya,f.la,f.Da,f.keyInfo,f.Xc,f.timescale,f.horizontalTiles,f.verticalTiles,f.durationPerTile));b=_.w(b);for(f=b.next();!f.done;f=b.next())a.push(f.value)}this.a=
|
|
246
|
+
a};_.u.replace=function(a){this.a=a};KE.prototype.release=function(){this.h=null;this.f=function(){}};OE.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};OE.prototype.Qe=function(){this.A=!0;NE(this)};PE.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};
|
|
247
|
+
TE.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};$E.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(){}};eF.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()};
|
|
248
|
+
gF.prototype.release=function(){this.j=null;this.o.clear();this.a=function(){};this.f=function(){};this.h=function(){}};gF.prototype.l=function(a,b,c){if(this.j)for(var d={},e=_.w(this.j.cues()),f=e.next();!f.done;d={gf:d.gf,he:d.he},f=e.next()){f=f.value;d.gf=this.o.get(f)||null;d.he=fF(f,a);this.o.set(f,d.he);var g=this.w.find(function(h){return function(l){return l.Dc===h.gf&&l.Cc===h.he}}(d));g&&g.wc(f,b&&0===c)}};_.u=kF.prototype;_.u.destroy=function(){this.j=this.w=null;this.o.clear();return Promise.resolve()};
|
|
249
|
+
_.u.remove=function(a,b){var c=this;return Promise.resolve().then(function(){!c.j||!c.j.remove(a,b)||null==c.a||b<=c.a||a>=c.f||(a<=c.a&&b>=c.f?c.a=c.f=null:a<=c.a&&b<c.f?c.a=b:a>c.a&&b>=c.f&&(c.f=a))})};_.u.Na=function(){return this.a};_.u.ha=function(){return this.f};_.u.Gb=function(a){return null==this.a||null==this.f?!1:a>=this.a&&a<this.f};_.u.Aa=function(a){return null==this.f||this.f<a?0:this.f-Math.max(a,this.a)};_.x(EF,_.U);_.u=EF.prototype;_.u.initialize=function(a){this.m=a};_.u.release=function(){this.h=[];this.a.clear();this.f.clear()};_.u.load=function(){};_.u.destroy=function(){this.release();this.m=null};_.u.getVideoTracks=function(){return FF(this,_.Ck)};_.u.getAudioTracks=function(){return FF(this,_.Bk)};_.u.ia=function(){return FF(this,_.S)};_.u.ja=function(){return this.a.get(_.Ck)||null};_.u.Va=function(){return this.a.get(_.Bk)||null};_.u.Ra=function(){return this.a.get(_.S)||null};
|
|
250
|
+
_.u.qb=function(){return this.f.get(_.Ck)||null};_.u.Ab=function(){return this.f.get(_.Bk)||null};_.u.Bb=function(){return this.f.get(_.S)||null};_.u.Ga=function(){return GF(this,_.Ck)};_.u.na=function(){return GF(this,_.Bk)};_.u.xa=function(){return GF(this,_.S)};_.u.xb=function(a){IF(this,_.Ck,a)};_.u.Ea=function(a){IF(this,_.Bk,a)};_.u.Ta=function(a){IF(this,_.S,a)};_.u.hb=function(a,b){HF(this,_.Ck,a,void 0===b?!1:b)};_.u.vb=function(a,b){HF(this,_.Bk,a,void 0===b?!1:b)};
|
|
251
|
+
_.u.wb=function(a,b){b=void 0===b?!1:b;var c=a;if(!a){var d=this.Ra();if(d&&d.track.kind!==_.pe){var e=this.ia().find(function(g){return g.kind===_.pe&&g.language===d.track.language});if(!e){var f=this.na();f&&(e=this.ia().find(function(g){return g.kind===_.pe&&g.language===f.language}))}e&&(c=e.renditions[0])}}HF(this,_.S,c,b)};_.u.addTextTrack=function(a){var b=this;return _.I(function(c){return b.m?_.y(c,b.m.addTextTrack(a.url,a.language,a.kind,a.mimeType,a.codec,a.label),0):c.F(0)})};
|
|
252
|
+
_.u.ra=function(){return!!this.m&&this.m.ra()};EF.prototype.isAbrEnabled=EF.prototype.ra;EF.prototype.addTextTrack=EF.prototype.addTextTrack;EF.prototype.setTextRendition=EF.prototype.wb;EF.prototype.setAudioRendition=EF.prototype.vb;EF.prototype.setVideoRendition=EF.prototype.hb;EF.prototype.setTextTrack=EF.prototype.Ta;EF.prototype.setAudioTrack=EF.prototype.Ea;EF.prototype.setVideoTrack=EF.prototype.xb;EF.prototype.getTextTrack=EF.prototype.xa;EF.prototype.getAudioTrack=EF.prototype.na;
|
|
253
|
+
EF.prototype.getVideoTrack=EF.prototype.Ga;EF.prototype.getLoadingTextRendition=EF.prototype.Bb;EF.prototype.getLoadingAudioRendition=EF.prototype.Ab;EF.prototype.getLoadingVideoRendition=EF.prototype.qb;EF.prototype.getTextRendition=EF.prototype.Ra;EF.prototype.getAudioRendition=EF.prototype.Va;EF.prototype.getVideoRendition=EF.prototype.ja;EF.prototype.getTextTracks=EF.prototype.ia;EF.prototype.getAudioTracks=EF.prototype.getAudioTracks;EF.prototype.getVideoTracks=EF.prototype.getVideoTracks;UF.prototype.init=function(a){var b=muxjs.mp4.probe;a=_.zj(a);this.l=b.videoTrackIds(a);this.j=b.timescale(a)||{};this.a.init()};UF.prototype.h=function(a,b){var c=_.zj(a);(c=this.a.parse(c,this.l,this.j))&&c.captions&&b(c.captions);this.a.clearParsedCaptions()};UF.prototype.f=function(){this.a.resetCaptionStream()};_.VF.prototype.init=function(){};_.VF.prototype.h=function(){};_.VF.prototype.f=function(){};_.u=_.XF.prototype;
|
|
254
|
+
_.u.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"](DD));for(e=1;e<d.length;++e)d[e].p["catch"](DD),d[e].p.reject()}this.a&&b.push(this.a.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.a=null;a.C=null;a.f={};a.w={};a.G=
|
|
255
|
+
{};a.H=null;a.K=!1;for(var g in a.h);a.h={}})};_.u.open=function(){return this.J};_.u.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e;return _.I(function(f){if(1==f.a)return e=_.eq,_.y(f,d.J,2);a.forEach(function(g,h){var l=_.kl(g.mimeType,g.codecs);if(h===e.TEXT)d.gc(l);else{var m=new Map;m.set(h,l);if((!_.pt(l)||!b||g.keyInfo)&&_.jl(l,h)){var n=_.jl(l);n&&(m=n(),d.w[h]=m,m=m.demuxMimeTypes(h,l),c&&m["delete"](e.AUDIO))}$F(d,m)}});_.A(f)})};_.u.Ji=function(){this.g.debug(LC);Object.values(this.w).forEach(function(a){return a.reset()})};
|
|
256
|
+
_.u.Zh=function(){return this.L.streaming.ignoreManagedMediaSourceStreamingHints?!0:this.N};_.u.gc=function(a){this.a||(this.a=new kF(this.L,this.C));lF(this.a,a)};_.u.ue=function(){return this.o?this.o.readyState===_.me:!0};_.u.Na=function(a){return a===_.Q?this.a.Na():(a=aG(this,a))?a.Na():null};_.u.ha=function(a){return a===_.Q?this.a.ha():(a=aG(this,a))?a.ha():null};_.u.Gb=function(a,b,c){return a===_.Q?this.a.Gb(b):(a=aG(this,a))?a.Gb(b,!1,c):!1};
|
|
257
|
+
_.u.Aa=function(a,b){if(a===_.Q)return this.a.Aa(b);var c=aG(this,a);return c?c.Aa(b):0};_.u.Jf=function(){var a={};a.total=new _.mm(this.j.buffered,"total");a.audio=aG(this,_.$c);a.video=aG(this,_.r);var b=[];this.a&&(b=[{start:this.a.Na(),end:this.a.ha()}]);a.text=PD(b,_.Q);return a};
|
|
258
|
+
_.u.te=function(a,b,c,d,e,f,g){var h=this;g=void 0===g?!1:g;var l=this.f[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=mF(this.a,b,c,d):this.w[a]?(b=this.w[a].transmux(b),b.captions&&0<b.captions.length&&(this.a||this.gc(_.lg),oF(this.a,b.captions,c,d,this.f.video.timestampOffset)),e=[],0<b.audio.byteLength&&this.f.audio&&e.push(cG(this,_.$c,this.Af.bind(this,_.$c,b.audio.buffer))),0<b.video.byteLength&&this.f.video&&e.push(cG(this,
|
|
259
|
+
_.r,this.Af.bind(this,_.r,b.video.buffer))),b=Promise.all(e)):(e&&window.muxjs&&(this.a||this.gc(_.lg),null==c&&null==d?this.H.init(b):this.H.h(b,function(p){p.length&&oF(h.a,p,c,d,h.f.video.timestampOffset)})),b=cG(this,a,this.Af.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(iC,c,d,kC,bG(h,a));else if(a===_.$c&&null!==c&&null!==d)VD(h.B),null!==c&&null!==d&&h.g.debug(hC,c,d,kC,bG(h,a));else if(a===_.r&&null!==c&&null!==
|
|
260
|
+
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.G[a]&&l&&1===l.buffered.length){p=l.buffered.start(0);var t=c-p;if(Math.abs(t)>h.P&&0===l.timestampOffset)return h.g.warn(nC+t+VB+(a+bC)+(c+UB)+(p+aC)),p=cG(h,a,function(){h.dh(a,t)}),q=cG(h,a,h.$g.bind(h,a,!1)),Promise.all([p,q])}null!==c&&null!==d&&(h.G[a]=!0)})["catch"](function(p){throw p;})};_.u.bh=function(a){var b=this.ha(_.r)||0;nF(this.a,a,b)};
|
|
261
|
+
_.u.Ug=function(){this.a&&nF(this.a,"",0)};_.u.remove=function(a,b,c){var d=this;return a===_.Q?this.a.remove(b,c):cG(this,a,this.ah.bind(this,a,b,c)).then(function(){if(a===_.r){var e=d.Na(a),f=d.ha(a);null!==e&&null!==f&&YD(d.B,e,f)}else a===_.$c&&WD(d.B)})};_.u.clear=function(a){if(a===_.Q){if(!this.a)return Promise.resolve();this.H.f();return this.a.remove(0,Infinity)}return cG(this,a,this.ah.bind(this,a,0,this.o.duration))};
|
|
262
|
+
_.u.flush=function(a){return a===_.Q?Promise.resolve():cG(this,a,this.$g.bind(this,a))};_.u.Li=function(a,b,c,d){var e=this,f,g;return _.I(function(h){f=_.eq;if(a===f.TEXT){e.a.A=b;var l=e.a;l.h=c;l.l=d;return h["return"]()}g=dG(e,a,b,c,d);e.K&&(g=g.concat(dG(e,f.AUDIO,b,c,d)));return _.y(h,Promise.all(g),0)})};_.u.endOfStream=function(a){var b=this;return gG(this,function(){b.ue()||(a?b.o.endOfStream(a):b.o.endOfStream())})};_.u.Bf=function(a){var b=this;gG(this,function(){b.o.duration=a})};
|
|
263
|
+
_.u.getDuration=function(){return this.o.duration};_.u.Af=function(a,b){this.g.debug(jC+a+WB);try{this.f[a].appendBuffer(b)}catch(c){throw this.g.warn(vC+a,c),c;}this.g.debug(pC+a+WB)};_.u.ah=function(a,b,c){if(c<=b)this.Vc(a);else{this.g.debug(KC+a+ZB,b,c);try{this.f[a].remove(b,c)}catch(d){throw this.g.warn(xC+a+XB,b,c,d),d;}this.g.debug(rC+a+ZB,b,c)}};
|
|
264
|
+
_.u.ek=function(a){try{this.g.debug(gC+a+WB);var b=this.f[a].appendWindowStart,c=this.f[a].appendWindowEnd;this.f[a].abort();this.f[a].appendWindowStart=b;this.f[a].appendWindowEnd=c}catch(d){throw this.g.warn(uC+a+WB,d),d;}this.g.debug(oC+a+WB);this.Vc(a)};_.u.$g=function(a){try{this.j.readyState>HTMLMediaElement.HAVE_NOTHING?(this.g.debug(AC+a),this.j.currentTime-=.001):this.g.warn(PC+a+$B+this.j.readyState)}catch(b){throw this.g.warn(wC+a,b),b;}this.g.debug(qC+a);this.Vc(a)};
|
|
265
|
+
_.u.dh=function(a,b){0>b&&(b+=.001);try{this.g.debug(OC+a,b),this.f[a].timestampOffset=b}catch(c){throw this.g.warn(zC+a,b,c),c;}this.g.debug(tC+a,b);this.Vc(a)};_.u.fk=function(a,b,c){try{this.g.debug(MC+a,b,c),this.f[a].appendWindowStart=0,this.f[a].appendWindowEnd=c,this.f[a].appendWindowStart=b}catch(d){throw this.g.warn(yC+a,b,c,d),d;}this.g.debug(sC+a,b,c);this.Vc(a)};_.u.S=function(a){this.h[a][0].p.reject(new _.N(_.P,3,3014,{mediaError:this.j.error?this.j.error.code:0}))};
|
|
266
|
+
_.u.Vc=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug(RC+a),fG(this,a))};_.u.getTextDisplayer=function(){return this.C};var ZF=window.URL.createObjectURL;_.u=_.yG.prototype;_.u.stop=function(){this.A=null;this.l=!1;this.f=[];this.o=1;this.h=null;this.C=!1};_.u.init=function(a){this.A=a};
|
|
267
|
+
_.u.chooseTrack=function(){var a=zG(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=zG(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;
|
|
268
268
|
g=h*(g?g.bandwidth:Infinity)/this.a.bandwidthUpgradeTarget;this.g.debug("Bandwidth ranges:",(l/1E6).toFixed(3),(m/1E6).toFixed(3),(g/1E6).toFixed(3));b>=m&&b<=g&&(d=f)}return d||a[0]||this.f[0]};_.u.enable=function(){this.l=!0};_.u.disable=function(){this.l=!1};
|
|
269
|
-
_.u.segmentDownloaded=function(a,b){this.g.debug("Segment downloaded:","deltaTimeMs\x3d"+a,"numBytes\x3d"+b,"lastTimeChosenMs\x3d"+this.h,"enabled\x3d"+this.l);var c=this.w;if(!(16E3>b)){var d=8E3*b/a,e=a/1E3;c.a+=b;_.
|
|
269
|
+
_.u.segmentDownloaded=function(a,b){this.g.debug("Segment downloaded:","deltaTimeMs\x3d"+a,"numBytes\x3d"+b,"lastTimeChosenMs\x3d"+this.h,"enabled\x3d"+this.l);var c=this.w;if(!(16E3>b)){var d=8E3*b/a,e=a/1E3;c.a+=b;_.eE(c.f,e,d);_.eE(c.h,e,d)}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...");
|
|
270
270
|
break a}}else if(Date.now()-this.h<1E3*this.a.switchInterval){this.g.debug("Still within switch interval...");break a}c=this.chooseTrack();d=this.getBandwidthEstimate();this.g.debug("Calling switch_(), bandwidth\x3d"+Math.round(d/1E3)+" kbps");c&&this.A(c)}};_.u.playbackRateChanged=function(a){this.o=a};
|
|
271
|
-
_.u.getBandwidthEstimate=function(){if(this.j&&this.a.useCmsd){var a=
|
|
272
|
-
|
|
273
|
-
for(var d=a.next();!d.done;d=a.next())c.add(d.value,!b);return c};
|
|
274
|
-
_.u.destroy=function(){var a=this;this.K=!0;var b=[],c;for(c in this.h){var d=this.h[c],e=d[0];this.h[c]=d.slice(0,1);e&&b.push(e.p["catch"](
|
|
275
|
-
{};a.I=null;a.N=!1;for(var g in a.h);a.h={}})};_.u.open=function(){return this.L};_.u.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e;return _.I(function(f){if(1==f.a)return e=_.
|
|
276
|
-
_.u.
|
|
277
|
-
_.u.
|
|
278
|
-
_.u.te=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=
|
|
279
|
-
_.r,this.zf.bind(this,_.r,b.video.buffer))),b=Promise.all(e)):(e&&window.muxjs&&(this.f||this.
|
|
280
|
-
d&&g){var p=l.buffered.length,q=0<p?l.buffered.end(p-1):-1;0>m&&0<p&&(m=l.buffered.start(0));0<=m&&0<q&&h.B.append(m,q,f)}if(!h.H[a]&&l&&1===l.buffered.length){p=l.buffered.start(0);var t=c-p;if(Math.abs(t)>h.V&&0===l.timestampOffset)return h.g.warn(
|
|
281
|
-
_.u.
|
|
282
|
-
_.u.flush=function(a){return a===_.Q?Promise.resolve()
|
|
283
|
-
_.u.Bf=function(a){var b=this;
|
|
284
|
-
_.u.
|
|
285
|
-
_.u.start=function(){var a=this,b,c,d;return _.I(function(e){if(1==e.a){b=a.D.
|
|
286
|
-
a.D.
|
|
287
|
-
_.u.
|
|
288
|
-
f=_.w(b.a.values());for(g=f.next();!g.done;g=f.next())h=g.value,h.
|
|
289
|
-
_.u.
|
|
290
|
-
_.u.
|
|
291
|
-
_.u.unload=function(){var a=this,b;return _.I(function(c){if(1==c.a){
|
|
292
|
-
_.u.getBufferInfo=function(a){if(this.L){var b=this.L.Jf(),c=new _.
|
|
293
|
-
_.u.seek=function(a){if(this.
|
|
294
|
-
_.u.getMediaDuration=function(){return this.f?this.f.presentationTimeline.getDuration():Infinity};_.u.destroy=function(){var a=this;return _.I(function(b){if(1==b.a)return _.y(b,_.
|
|
295
|
-
_.u.setupPlaylist=function(a){var b=this,c,d,e,f,g,h,l,m,n,p,q,t,v;return _.I(function(z){switch(z.a){case 1:return c=new _.
|
|
296
|
-
case 6:f=z.f;g=f.filter(function(C){return C.manifest.presentationTimeline.isLive()});if(h=g[0])b.A=h.parser;if(1<g.length)throw new _.N(_.P,7,7003,"Playlist of multiple live streams is not supported.");if(h){l=b.configuration.playlist.content;if(l===_.kc)throw new _.N(_.P,7,7003,"Cannot play live content in VOD mode.");if("IPR"===l&&h!==f[f.length-1])throw new _.N(_.P,7,7003,"Wrong order of playlist assets.");}m=null==h;n=new _.
|
|
297
|
-
q=
|
|
298
|
-
_.u.appendLoad=function(a){var b=this,c;return _.I(function(d){if(1==d.a){
|
|
299
|
-
_.u.
|
|
300
|
-
_.u.load=function(a){return
|
|
301
|
-
_.u.getSeekRange=function(){var a={start:0,end:0};if(this.f){var b=this.f.presentationTimeline;a={start:
|
|
302
|
-
_.u.setPlaybackRate=function(a,b){if(0===a)this.log.warn("A trick play rate of 0 is unsupported!");else if(this.G===
|
|
303
|
-
d),_.
|
|
304
|
-
_.u.getStats=function(){if(this.G!==
|
|
305
|
-
_.u.getTimelineCues=function(){return this.K?
|
|
306
|
-
_.u.addTextTrack=function(a,b,c,d,e,f){var g=this,h,l,m,n,p,q,t,v,z;return _.I(function(C){if(1==C.a){if(g.G!==
|
|
307
|
-
findSegmentPosition:function(){return 1},getSegmentReference:function(F){return 1===F?t:null},adjustSegmentDurations:function(){},getDuration:function(){return q},segmentLookupStrategy:_.
|
|
308
|
-
2)}if(z=_.
|
|
309
|
-
_.u.
|
|
310
|
-
_.u
|
|
311
|
-
_.u.
|
|
312
|
-
|
|
313
|
-
_.u.
|
|
314
|
-
_.y(n,b.Kc(f.url,a),10);case 10:if(m=n.f)f.url=m,h=!0;else throw l;case 6:h?n.F(4):(d&&b.h.enable(),
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
_.
|
|
318
|
-
_.u.append=function(a){function b(e){if(e.startTime>=e.endTime)_.
|
|
319
|
-
e.startTime-f.startTime:e.endTime!==f.endTime?e.endTime-f.startTime:c.indexOf(f)-c.indexOf(e)});d=_.w(a);for(a=d.next();!a.done;a=d.next())this.a.addCue(a.value)};_.u.remove=function(a,b){if(!this.a)return!1;
|
|
271
|
+
_.u.getBandwidthEstimate=function(){if(this.j&&this.a.useCmsd){var a=zD(this.j,_.oe);a=null==a?null:a;if(null!==a)return this.g.debug("Using CMSD estimatedThroughputKbps:",a),1E3*a}a=this.w;return 128E3>a.a?this.a.defaultBandwidthEstimate:Math.min(_.fE(a.f),_.fE(a.h))};_.u.setTracks=function(a){this.f=a};_.u.setCmsdManager=function(a){this.j=a};_.u.configure=function(a){this.a=a};_.u.reset=function(){this.B=!1;this.w=new TF;var a=this.chooseTrack();a&&this.A(a)};DG.prototype.clear=function(){this.a.clear()};GG.prototype.add=function(a,b){var c=void 0===b?!0:b;if(JG(this.f,a,void 0===c?!0:c))return this.a.add(a),!0;_.Dh("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};GG.prototype.values=function(){return this.a.values()};LG.prototype.create=function(a){var b=this,c=this.a===_.$f&&QD(),d=a.filter(function(e){return JG(b.f,e,!c)});return d.length?new GG(d[0],d):this.h.create(a)};
|
|
272
|
+
KG.prototype.create=function(a){var b=MG(a,this.j);0<b.length&&(a=b);b=!1;if(this.a){var c=NG(a,this.a);0<c.length?(a=c,b=!0):_.Dh("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=iG(a,this.f),b.length?a=b:_.Dh("No exact match for the channel count could be found."));b=OG(a,this.l);b.length?a=b:_.Dh("No exact match for spatial audio could be found.");b=this.h===_.$f&&QD();c=new GG(a[0]);a=_.w(a);
|
|
273
|
+
for(var d=a.next();!d.done;d=a.next())c.add(d.value,!b);return c};RG.prototype.getState=function(){return this.a};var QG=0,PG=1;TG.prototype.release=function(){this.f.release()};_.u=VG.prototype;
|
|
274
|
+
_.u.destroy=function(){var a=this;this.K=!0;var b=[],c;for(c in this.h){var d=this.h[c],e=d[0];this.h[c]=d.slice(0,1);e&&b.push(e.p["catch"](DD));for(e=1;e<d.length;++e)d[e].p["catch"](DD),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=
|
|
275
|
+
{};a.I=null;a.N=!1;for(var g in a.h);a.h={}})};_.u.open=function(){return this.L};_.u.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e;return _.I(function(f){if(1==f.a)return e=_.eq,_.y(f,d.L,2);a.forEach(function(g,h){var l=_.kl(g.mimeType,g.codecs);if(h===e.TEXT)d.gc(l);else{var m=new Map;m.set(h,l);if((!_.pt(l)||!b||g.keyInfo)&&_.jl(l,h)){var n=_.jl(l);n&&(m=n(),d.w[h]=m,m=m.demuxMimeTypes(h,l),c&&m["delete"](e.AUDIO))}XG(d,m)}d.h[h]=[]});_.A(f)})};_.u.Ji=function(){this.g.debug(LC);Object.values(this.w).forEach(function(a){return a.reset()})};
|
|
276
|
+
_.u.Zh=function(){return this.J.streaming.ignoreManagedMediaSourceStreamingHints?!0:this.P};_.u.gc=function(a){this.f||(this.f=new kF(this.J,this.C));lF(this.f,a)};_.u.ue=function(){return this.o?this.o.readyState===_.me:!0};_.u.Na=function(a){return a===_.Q?this.f.Na():(a=YG(this,a))?a.Na():null};_.u.ha=function(a){return a===_.Q?this.f.ha():(a=YG(this,a))?a.ha():null};_.u.Gb=function(a,b,c){return a===_.Q?this.f.Gb(b):(a=YG(this,a))?a.Gb(b,!1,c):!1};
|
|
277
|
+
_.u.Aa=function(a,b){if(a===_.Q)return this.f.Aa(b);var c=YG(this,a);return c?c.Aa(b):0};_.u.Jf=function(){var a={};a.total=new _.mm(this.j.buffered,"total");a.audio=YG(this,_.$c);a.video=YG(this,_.r);var b=[];this.f&&(b=[{start:this.f.Na(),end:this.f.ha()}]);a.text=PD(b,_.Q);return a};
|
|
278
|
+
_.u.te=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=mF(this.f,b,c,d):this.w[a]?(b=this.w[a].transmux(b),b.captions&&0<b.captions.length&&(this.f||this.gc(_.lg),oF(this.f,b.captions,c,d,this.a.video.timestampOffset)),e=[],0<b.audio.byteLength&&this.a.audio&&e.push($G(this,_.$c,this.zf.bind(this,_.$c,b.audio.buffer))),0<b.video.byteLength&&this.a.video&&e.push($G(this,
|
|
279
|
+
_.r,this.zf.bind(this,_.r,b.video.buffer))),b=Promise.all(e)):(e&&window.muxjs&&(this.f||this.gc(_.lg),null==c&&null==d?this.I.init(b):this.I.h(b,function(p){p.length&&oF(h.f,p,c,d,h.a.video.timestampOffset)})),b=$G(this,a,this.zf.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(iC,c,d,kC,ZG(h,a));else if(a===_.$c&&null!==c&&null!==d)VD(h.B),null!==c&&null!==d&&h.g.debug(hC,c,d,kC,ZG(h,a));else if(a===_.r&&null!==c&&null!==
|
|
280
|
+
d&&g){var p=l.buffered.length,q=0<p?l.buffered.end(p-1):-1;0>m&&0<p&&(m=l.buffered.start(0));0<=m&&0<q&&h.B.append(m,q,f)}if(!h.H[a]&&l&&1===l.buffered.length){p=l.buffered.start(0);var t=c-p;if(Math.abs(t)>h.V&&0===l.timestampOffset)return h.g.warn(nC+t+VB+(a+bC)+(c+UB)+(p+aC)),p=$G(h,a,function(){aH(h,a,t)}),q=$G(h,a,h.Yg.bind(h,a,!1)),Promise.all([p,q])}null!==c&&null!==d&&(h.H[a]=!0)})["catch"](function(p){throw p;})};_.u.bh=function(a){var b=this.ha(_.r)||0;nF(this.f,a,b)};
|
|
281
|
+
_.u.Ug=function(){this.f&&nF(this.f,"",0)};_.u.remove=function(a,b,c){var d=this;return a===_.Q?this.f.remove(b,c):$G(this,a,this.Zg.bind(this,a,b,c)).then(function(){if(a===_.r){var e=d.Na(a),f=d.ha(a);null!==e&&null!==f&&YD(d.B,e,f)}else a===_.$c&&WD(d.B)})};_.u.clear=function(a){if(a===_.Q){if(!this.f)return Promise.resolve();this.I.f();return this.f.remove(0,Infinity)}return $G(this,a,this.Zg.bind(this,a,0,this.o.duration))};
|
|
282
|
+
_.u.flush=function(a){return a===_.Q?Promise.resolve():$G(this,a,this.Yg.bind(this,a))};_.u.Li=function(a,b,c,d,e,f){var g=this,h,l,m;return _.I(function(n){if(1==n.a){h=_.eq;if(a===h.TEXT){g.f.A=b;var p=g.f;p.h=c;p.l=d;return n["return"]()}return _.y(n,gH(g,a,e,f),2)}l=n.f;m=bH(g,a,b,c,d,l);g.N&&(m=m.concat(bH(g,h.AUDIO,b,c,d,l)));return _.y(n,Promise.all(m),0)})};_.u.endOfStream=function(a){var b=this;return eH(this,function(){b.ue()||(a?b.o.endOfStream(a):b.o.endOfStream())})};
|
|
283
|
+
_.u.Bf=function(a){var b=this;eH(this,function(){b.o.duration=a})};_.u.getDuration=function(){return this.o.duration};_.u.zf=function(a,b){this.g.debug(jC+a+WB);try{this.a[a].appendBuffer(b)}catch(c){throw this.g.warn(vC+a,c),c;}this.g.debug(pC+a+WB)};_.u.Zg=function(a,b,c){if(c<=b)this.qc(a);else{this.g.debug(KC+a+ZB,b,c);try{this.a[a].remove(b,c)}catch(d){throw this.g.warn(xC+a+XB,b,c,d),d;}this.g.debug(rC+a+ZB,b,c)}};
|
|
284
|
+
_.u.Yg=function(a){try{this.j.readyState>HTMLMediaElement.HAVE_NOTHING?(this.g.debug(AC+a),this.j.currentTime-=.001):this.g.warn(PC+a+$B+this.j.readyState)}catch(b){throw this.g.warn(wC+a,b),b;}this.g.debug(qC+a);this.qc(a)};_.u.S=function(a){this.h[a][0].p.reject(new _.N(_.P,3,3014,{mediaError:this.j.error?this.j.error.code:0}))};_.u.qc=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug(RC+a),dH(this,a))};_.u.getTextDisplayer=function(){return this.C};var WG=window.URL.createObjectURL;hH.prototype.release=function(){this.a=this.h=null;this.f=function(){}};hH.prototype.l=function(a){var b=this.a,c=this.h.periods;a=ZD(c,a)||c[0];b!==a&&this.f(a);this.a=a};jH.prototype.getConfiguration=function(){return this.j};jH.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};jH.prototype.set=function(a,b){this.h=a;nH(this,b)};var qH=new _.Dp(function(){return new Uint8Array([0,0,0,80,115,105,110,102,0,0,0,12,102,114,109,97,0,0,0,0,0,0,0,20,115,99,104,109,0,0,0,0,99,101,110,99,0,1,0,0,0,0,0,40,115,99,104,105,0,0,0,32,116,101,110,99,0,0,0,0,0,0,1,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])});_.u=_.tH.prototype;_.u.destroy=function(){var a=this,b,c,d,e;return _.I(function(f){if(1==f.a){b=[];c=_.w(a.a.values());for(d=c.next();!d.done;d=c.next())e=d.value,EH(e),b.push(FH(e));return _.y(f,Promise.all(b),2)}a.a.clear();a.w.clear();a.D=null;a.j=null;a.G=null;a.A.clear();a.h=null;a.f=!0;_.A(f)})};
|
|
285
|
+
_.u.start=function(){var a=this,b,c,d;return _.I(function(e){if(1==e.a){b=a.D.Qb();c=ZD(a.j.periods,b+_.Cv);if(!c)throw new _.N(_.P,5,5006,"No period found.");d=a.D.Vf(c);if(!d.variant&&!d.text)throw a.g.error("start(): No streams chosen"),new _.N(_.P,5,5005,"No streams chosen.");a.C=!d.variant&&!!d.text;return _.y(e,aI(a,d.variant?d.variant.audio:null,d.variant?d.variant.video:null,d.text,b),2)}if(a.f)return e["return"]();a.g.debug("init: completed initial Stream setup");a.D&&a.D.tm&&(a.g.debug("init: calling onInitialStreamsSetup()..."),
|
|
286
|
+
a.D.tm());_.A(e)})};_.u.resume=function(){if(!QH(this))for(var a=_.w(this.a.values()),b=a.next();!b.done;b=a.next())b=b.value,b.endOfStream=!1,CH(this,b,0)};
|
|
287
|
+
_.u.Vb=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=NH(a);if(a.tb||null==a.jb||a.oc)return m["return"]();a.jb=null;if(!a.$b){m.F(2);break}b.g.debug(c,"skipping update and clearing the buffer");return _.y(m,SH(b,a,a.Ye,a.re),3);case 3:return m["return"]();case 2:_.D(m,4);d=fI(b,a);null!=d&&(CH(b,a,d),a.bd=!1);_.oh(m,5);break;case 4:return e=_.E(m),_.y(m,qI(b,e),6);case 6:return m["return"]();case 5:vI(b,a);if(!RH(b)){m.F(0);break}if(b.D.configuration.Ll){b.g.debug("End of stream reached, keeping MediaSource open.");
|
|
288
|
+
f=_.w(b.a.values());for(g=f.next();!g.done;g=f.next())h=g.value,h.jb=null;return m["return"]()}b.g.debug("End of stream reached, calling ms.endOfStream().");return _.y(m,b.D.W.endOfStream(),8);case 8:if(b.f)return m["return"]();l=b.D.W.getDuration();l<b.j.presentationTimeline.getDuration()&&(b.j.presentationTimeline.f=l);b.D.ji();_.A(m)}})};
|
|
289
|
+
_.u.Pm=function(a,b,c,d){var e=qD(d.reader),f=qD(d.reader),g=_.W(d.reader),h=_.W(d.reader),l=_.W(d.reader),m=_.W(d.reader);d=_.fn(d.reader,d.reader.Oa()-d.reader.getPosition());a=a.startTime+b.startTime+h/g;if(c.includes(e))if("urn:mpeg:dash:event:2012"===e)this.D.oi();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}}))};
|
|
290
|
+
_.u.Rn=function(a){var b=this,c=!1,d=0;(new _.gn).M(_.Qe,_.hn).M(_.og,_.hn).M(_.Le,_.hn).M(_.Pe,_.hn).M(_.eg,_.hn).Y(_.gg,_.jn).M("encv",function(e){e.reader.skip(78);_.hn(e)}).M("pasp",function(e){d=e.start+e.headerSize;var f=_.W(e.reader),g=_.W(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 _.Vm(new DataView(a.data)),a.seek(d),_.V(a,1),_.V(a,1))};_.x(zI,_.xm);_.u=zI.prototype;_.u.init=function(a,b){var c=a.getMedia();_.xm.prototype.init.call(this,a,b);LI(this,c)};_.u.namespace=function(){return YC};_.u.setSeekInterceptor=function(a){this.Eg=a||null};_.u.setPlaybackSessionId=function(a){this.xg=a};_.u.qh=function(){return new EF};_.u.getState=function(){return this.nc};_.u.getDrmInfo=function(){return this.w?this.w.getDrmInfo():null};
|
|
291
|
+
_.u.unload=function(){var a=this,b;return _.I(function(c){if(1==c.a){KF(a,!1);a.Ld=!1;if(!a.$)return c["return"]();a.log.debug("Unload player with source",a.$);(b=a.getTrackManager())&&b.release();return a.G===bJ?c["return"]():_.y(c,NI(a),2)}a.$=null;a.Bg=0;a.Mc=null;a.Z=null;a.getNetworkEngine().headers["delete"](TC);_.A(c)})};_.u.release=function(){var a=this;return _.I(function(b){if(a.ga)return b["return"](a.ga);a.ga=CI(a);a.ga["finally"](function(){a.ga=null});return b["return"](a.ga)})};
|
|
292
|
+
_.u.getBufferInfo=function(a){if(this.L){var b=this.L.Jf(),c=new _.mm(void 0,a);switch(a){case _.Ck:return b.video?b.video:c;case _.Bk:return b.audio?b.audio:c;case _.S:return b.text?b.text:c}return b.total?b.total:c}return this.Qc?(b=TD(this.Qc),PD(b,a)):_.xm.prototype.getBufferInfo.call(this,a)};_.u.getPosition=function(){var a=this.Qd,b=this.getMediaPosition();a.a&&(a=a.a,b-=a.f,b=0>b?0:b>a.a?a.a:b);return b};_.u.getMediaPosition=function(){return this.B?bF(this.B):_.xm.prototype.getMediaPosition.call(this)};
|
|
293
|
+
_.u.seek=function(a){if(this.Eg&&!this.Eg(a))return Promise.resolve();var b=this.Qd;b=b.a?a+b.a.Rb():a;b!==a&&this.log.info("Seeking to "+a+" s corresponding to media time of "+(b+" s."));return _.xm.prototype.seek.call(this,b)};_.u.getPresentationStartTime=function(){return this.f?this.f.presentationTimeline.getPresentationStartTime():null};_.u.getDuration=function(){var a=this.Qd,b=this.getMediaDuration();return a.a?a.a.getDuration():b};
|
|
294
|
+
_.u.getMediaDuration=function(){return this.f?this.f.presentationTimeline.getDuration():Infinity};_.u.destroy=function(){var a=this;return _.I(function(b){if(1==b.a)return _.y(b,_.xm.prototype.destroy.call(a),2);if(a.G===bJ)return b["return"]();a.log.debug("Destroying player...");a.G=bJ;KI(a);a.l&&(a.l.release(),a.l=null);a.Jd=null;a.h=null;_.A(b)})};_.u.getTimeline=function(){return this.Jd};
|
|
295
|
+
_.u.setupPlaylist=function(a){var b=this,c,d,e,f,g,h,l,m,n,p,q,t,v;return _.I(function(z){switch(z.a){case 1:return c=new _.gk,b.o.a=c,_.D(z,2),II(b),b.ba=_.Hb,_.y(z,OI(b),4);case 4:return CG(b.o,c),d=a[0],d.playlist&&d.playlist.startTime&&(d.startTime=d.playlist.startTime),b.$=_.Yp(d),b.configuration=_.vm(b.Nb,d),b.log.info("Loading playlist configurations",a),b.Jd=DI(b.configuration),_.y(z,PI(b,c),5);case 5:return CG(b.o,c),e=a.map(function(C){return QI(b,C,0,null,!0)}),_.y(z,Promise.all(e),6);
|
|
296
|
+
case 6:f=z.f;g=f.filter(function(C){return C.manifest.presentationTimeline.isLive()});if(h=g[0])b.A=h.parser;if(1<g.length)throw new _.N(_.P,7,7003,"Playlist of multiple live streams is not supported.");if(h){l=b.configuration.playlist.content;if(l===_.kc)throw new _.N(_.P,7,7003,"Cannot play live content in VOD mode.");if("IPR"===l&&h!==f[f.length-1])throw new _.N(_.P,7,7003,"Wrong order of playlist assets.");}m=null==h;n=new _.jE({version:2},null,0,m);p=f.map(function(C){return xF(C.manifest)});
|
|
297
|
+
q=AF(p,n);b.f=q;t=b;return _.y(z,RI(b,q,b.configuration.drm),7);case 7:return t.w=z.f,CG(b.o,c),_.y(z,SI(b,c),8);case 8:CG(b.o,c);KH(b.a,q);FI(b,q);c.resolve();_.oh(z,0);break;case 2:v=_.E(z);if(!b.A){z.F(9);break}return _.y(z,b.A.stop(),10);case 10:b.A=null;case 9:TI(b,v,c),_.A(z)}})};
|
|
298
|
+
_.u.appendLoad=function(a){var b=this,c;return _.I(function(d){if(1==d.a){II(b);if(b.ba!==_.Hb)throw new _.N(_.P,7,7003,"Cannot append-load to non-playlist player.");return _.y(d,$I(b,a),2)}c=d.f;b.f=c.manifest;b.A=c.parser;KH(b.a,c.manifest);RH(b.a)&&b.a.resume();FI(b,c.manifest);_.A(d)})};_.u.seekWith=function(a){return this.seek(this.getPosition()+a)};
|
|
299
|
+
_.u.Xg=function(){var a=this;return _.I(function(b){II(a);if(!a.Ne)return a.log.warn("No preloaded asset found"),b["return"]();a.log.info("Loading preloaded asset",a.Ne);a.Ne=null;return _.y(b,SI(a,null),0)})};_.u.preload=function(a){var b=this;return _.I(function(c){if(1==c.a)return II(b),_.ko("preload.start"),b.log.info("Preloading asset",a),_.y(c,UI(b,a,!1),2);b.Ne=a;b.log.info("Preloaded asset",a);_.ko("preload.end");_.so("preload","preload.start","preload.end");_.A(c)})};
|
|
300
|
+
_.u.load=function(a){return UI(this,a)};_.u.detach=function(){var a=this;return _.I(function(b){if(1==b.a)return _.y(b,JI(a),2);a.configuration=a.Nb;KI(a);_.A(b)})};_.u.isLive=function(){var a;this.f?(a=this.f.presentationTimeline.isLive())||(a=this.f.presentationTimeline,a=Infinity!==a.f&&!a.l):a=!1;return a};_.u.vi=function(){this.log.debug("User seeking finished");this.J&&RJ(this);SJ(this)};
|
|
301
|
+
_.u.getSeekRange=function(){var a={start:0,end:0};if(this.f){var b=this.f.presentationTimeline;a={start:kE(b),end:uE(b)}}b=this.Qd;b.a?(b=b.a.getDuration(),b>a.end&&(b=a.end),b={start:0,end:b}):b=a;return b};_.u.uc=function(){return this.f?this.f.presentationTimeline.uc():null};_.u.getPlaybackRate=function(){if(this.I){var a=this.I;a=a.l?0:a.h}else a=0;return a};
|
|
302
|
+
_.u.setPlaybackRate=function(a,b){if(0===a)this.log.warn("A trick play rate of 0 is unsupported!");else if(this.G===yI){if(_.ok()){this.log.warn("Pausing and unpausing to mitigate playbackRate platform issue.");var c=this.getSurface().getMedia();c.pause();this.I.set(a,b);c.play()}else this.I.set(a,b);if((c=this.I.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.hc&&(c.g.debug("Engaging trick mode stream",
|
|
303
|
+
d),_.HH(c,d,!1,0),e.hc=f);else if(f=e.hc)c.g.debug("Restoring non-trick-mode stream",f),e.hc=null,_.HH(c,f,!0,0)}}this.h.playbackRateChanged(a)}};_.u.ia=function(){if(this.f&&this.B){var a=DJ(this);if(null==a)a=null;else{if(!FG(this.P,a).text){var b=_.xG(a.textStreams,this.Gd,this.Ge,this.Cd);b.length&&(b=b[0],FG(this.P,a).text=b)}a=FG(this.P,a).text}b=[];for(var c=_.w(jK(this)),d=c.next();!d.done;d=c.next()){d=d.value;var e=uG(d);e.active=d===a;b.push(e)}return b}return[]};_.u.getPeriods=function(){return this.f.periods};
|
|
304
|
+
_.u.getStats=function(){if(this.G!==yI)return _.Cp();SJ(this);var a=this.j;if(a.getVideoPlaybackQuality){a=a.getVideoPlaybackQuality();var b=this.H,c=Number(a.totalVideoFrames);b.l=Number(a.droppedVideoFrames);b.j=c}if(this.G===yI){if(a=UJ(this))this.H.o=a.bandwidth;a&&a.video&&(b=this.H,c=a.video.height||NaN,b.w=a.video.width||NaN,b.h=c);a=this.h.getBandwidthEstimate();this.H.f=a}return this.H.getStats()};_.u.getCueTimeline=function(){return this.K};
|
|
305
|
+
_.u.getTimelineCues=function(){return this.K?AE(this.K,$J(this)):[]};_.u.resetAbr=function(){this.h&&this.h.reset()};_.u.ze=function(){return this.h};
|
|
306
|
+
_.u.addTextTrack=function(a,b,c,d,e,f){var g=this,h,l,m,n,p,q,t,v,z;return _.I(function(C){if(1==C.a){if(g.G!==yI)throw g.log.error("Must call load() and wait for it to resolve before adding text tracks."),Error("State error!");h=DJ(g);l=_.eq;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 _.N(1,4,4040);t=new _.oj(1,0,q,function(){return[a]},0,null,0);v={id:g.Ui++,originalId:null,createSegmentIndex:Promise.resolve.bind(Promise),
|
|
307
|
+
findSegmentPosition:function(){return 1},getSegmentReference:function(F){return 1===F?t:null},adjustSegmentDurations:function(){},getDuration:function(){return q},segmentLookupStrategy:_.aD,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.Ie.add(v);h.textStreams.push(v);return _.y(C,DH(g.a,v),
|
|
308
|
+
2)}if(z=_.wH(g.a,_.Q))FG(g.P,h).text=z;g.Ie["delete"](v);g.log.debug("Choosing new streams after adding a text stream");eK(g,h);FJ(g);return C["return"](uG(v))})};
|
|
309
|
+
_.u.dk=function(a){this.log.debug(_.eD,a);try{this.log.debug("onChooseStreams_, choosing variant from ",a.variants);this.log.debug("onChooseStreams_, choosing text from ",a.textStreams);var b=hK(this,a);this.log.debug("onChooseStreams_, chose variant ",b.variant);this.log.debug("onChooseStreams_, chose text ",b.text);return b}catch(c){return this.onError(c),{variant:null,text:null}}};
|
|
310
|
+
_.u.ck=function(){this.log.debug("canSwitch_");this.ca=!1;this.configuration.abr.enabled&&this.h.enable();this.ta&&(IH(this.a,this.ta,this.Ti,this.Si),this.ta=null);this.fa&&(_.HH(this.a,this.fa,!0,0),this.fa=null)};_.u.Qn=function(){this.A&&this.A.update()};_.u.Em=function(){this.B&&this.B.j.Qe()};
|
|
311
|
+
_.u.oj=function(a,b,c){if((void 0===c?"":c)===cD)return FJ(this),this.ra()||(this.configuration.abr.enabled=!0,this.h.enable()),eK(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===_.$c&&(h=h&&l.language===a.language));return h})&&this.ra()){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)}FJ(this);this.ra()||(this.configuration.abr.enabled=!0,this.h.enable());
|
|
312
|
+
eK(this,b)}return c};_.u.rm=function(){this.log.debug("endOfStream called by streaming engine");this.Ld=!0};_.u.onError=function(a){if(this.G!==bJ&&7001!==a.code&&7E3!==a.code){var b=new _.L(_.ne,{detail:a});a.severity===_.P&&BI(this,_.Rp);this.trigger(b);b.defaultPrevented&&(b.a=!0)}};_.u.yf=function(a){a.type===_.fe?this.dispatchEvent(a):"largegap"!==a.type&&(a.type===_.Mg?cJ(this):"emsg"!==a.type&&(a instanceof _.L?this.dispatchEvent(a):this.log.debug(_.fc,a.type)))};_.u.ra=function(){return this.configuration.abr.enabled};
|
|
313
|
+
_.u.Gn=function(a){var b=this,c,d,e,f,g,h,l,m;return _.I(function(n){switch(n.a){case 1:if(!b.Kc)return n["return"]();b.log.info("Attempt to switch CDN.");c=b.getLoadedSource();d=b.ra();return _.y(n,b.Kc(c.url,a),2);case 2:e=n.f;if(!e)return n["return"]();f=_.M.pa(b.getLoadedSource(),{url:e});d&&b.h.disable();return _.y(n,TH(b.a),3);case 3:g=UJ(b);case 4:return h=!1,_.D(n,7),b.log.info("Switching CDN to "+f.url+"."),_.y(n,kK(b,f,g),9);case 9:_.oh(n,6);break;case 7:return l=_.E(n),b.log.info("Switch failed"),
|
|
314
|
+
_.y(n,b.Kc(f.url,a),10);case 10:if(m=n.f)f.url=m,h=!0;else throw l;case 6:h?n.F(4):(d&&b.h.enable(),PH(b.a,!0),b.$[b.getSourceIndex()]=f,a.f=!0,b.trigger(new _.L(_.qd,{newManifest:f.url})),_.A(n))}})};var bJ=0,xI=1,yI=2,EJ=[_.cf,_.we];lK.prototype.a=function(){return YC};
|
|
315
|
+
lK.prototype.canPlay=function(a,b){if(_.vl())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 _.qu||_.ru(a.url)in _.su?!0:!1:!1;if(d&&e){if(_.ok(2))return 1;if(_.wl()&&c===_.Yl){if(b.streaming.preferNativeHlsOnSafari)return 1;_.Dh("Support for MSE + FairPlay on Apple is experimental. In case of issues, consider using native HLS.")}return 2}return 0};
|
|
316
|
+
lK.prototype.f=function(a){return a===_.pa||a===_.Hb};lK.prototype.create=function(){return new zI};_.Nh(new lK);_.Xr(function(){_.Ih("MediaSource.install");if(window.MediaSource)if(window.cast&&cast.__platform__&&cast.__platform__.canDisplayType)_.Hh("Patching Chromecast MSE bugs."),qK();else if(_.wl()){var a=navigator.appVersion;a=0<=a.indexOf("Version")?parseInt(a.match(/Version\/(\d+)/)[1],10):13;oK();10>=a?(_.Hh("Blacklisting MSE on Safari \x3c\x3d 10."),window.MediaSource=null):12>=a?(_.Hh("Patching Safari 11 \x26 12 MSE bugs."),mK(),nK()):(_.Hh("Patching Safari 13 MSE bugs."),mK())}else _.ok(2)||_.ok(3)||
|
|
317
|
+
_.ok(4)?pK():_.Hh("Using native MSE as-is.");else _.Hh("No MSE implementation available.")});_.x(rK,_.nv);_.u=rK.prototype;
|
|
318
|
+
_.u.append=function(a){function b(e){if(e.startTime>=e.endTime)_.Dh("Invalid cue times: "+e.startTime+" - "+e.endTime),e=null;else{var f=e.payload||"";f=f.replace(/<br\s*\/?>/igm,"\n");f=_.R.vg(f);f=new VTTCue(e.startTime,e.endTime,f);f.line=-1;try{f.align=_.sd}catch(g){f.align="middle"}e.writingMode===_.Ag?f.vertical="lr":e.writingMode===_.Bg&&(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?
|
|
319
|
+
e.startTime-f.startTime:e.endTime!==f.endTime?e.endTime-f.startTime:c.indexOf(f)-c.indexOf(e)});d=_.w(a);for(a=d.next();!a.done;a=d.next())this.a.addCue(a.value)};_.u.remove=function(a,b){if(!this.a)return!1;sK(this.a,function(c){return c.startTime<b&&c.endTime>a});return!0};_.u.isTextVisible=function(){return this.a.mode===_.Wf};_.u.setTextVisibility=function(a){null!==this.a&&(this.a.mode=a?_.Wf:_.te)};_.u.destroy=function(){this.a&&sK(this.a,function(){return!0});this.a=null;return Promise.resolve()};tK.prototype.a=function(){return!0};tK.prototype.create=function(a){return new rK(a)};_.tp("single-native",new tK);};
|
|
320
320
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
321
321
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
322
322
|
else{_=this.clpp._;(f.call(g,this));}
|