@castlabs/prestoplay 6.22.0 → 6.23.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 +9 -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 +112 -112
- package/cjs/cl.conviva.js +32 -33
- package/cjs/cl.core.js +591 -586
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +81 -80
- package/cjs/cl.externs.js +43 -36
- 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 +30 -29
- package/cjs/cl.ima.js +23 -23
- package/cjs/cl.mse.js +330 -325
- 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 +26 -26
- package/cjs/cl.tizen.js +72 -72
- package/cjs/cl.ttml.js +29 -29
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +12 -13
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.yospace.js +4 -4
- package/cjs/cl.youbora.js +37 -37
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +88 -88
- package/cl.conviva.js +27 -27
- package/cl.core.js +477 -474
- package/cl.crypto.js +9 -9
- package/cl.dash.js +76 -75
- package/cl.externs.js +43 -36
- 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 +17 -17
- package/cl.mse.js +295 -291
- package/cl.muxdata.js +13 -13
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +10 -10
- package/cl.playlist.js +5 -5
- package/cl.sessions.js +10 -10
- package/cl.simid.js +13 -13
- package/cl.smooth.js +59 -59
- package/cl.thumbnails.js +19 -19
- package/cl.tizen.js +57 -57
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -8
- package/cl.vr.js +15 -15
- package/cl.vtt.js +12 -12
- package/cl.yospace.js +3 -3
- package/cl.youbora.js +28 -27
- package/package.json +1 -1
- package/typings.d.ts +53 -6
package/cjs/cl.mse.js
CHANGED
|
@@ -1,336 +1,341 @@
|
|
|
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=_.w(a.h.
|
|
53
|
-
|
|
54
|
-
" from: "+JSON.stringify(c.from)+" to: "+JSON.stringify(c.to)),a.trigger(new _.L(_.
|
|
55
|
-
|
|
56
|
-
if(g=parseInt(f.headers["retry-after"],10))a.g.info("Will retry after "+g+" s based on Retry-After header."),a.f=g;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
(b=new _.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
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))};_.
|
|
65
|
-
|
|
2
|
+
var f=function(window){var mC,nC,oC,pC,qC,rC,sC,tC,uC,vC,wC,xC,yC,zC,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,$C,bD,cD,dD,eD,fD,gD,hD,iD,jD,kD,lD,mD,oD,pD,qD,rD,sD,tD,uD,wD,zD,AD,CD,DD,ED,FD,GD,HD,ID,KD,LD,MD,ND,SD,TD,UD,VD,WD,XD,YD,$D,dE,eE,gE,hE,iE,jE,lE,mE,nE,pE,qE,rE,sE,tE,uE,vE,wE,xE,zE,EE,KE,PE,SE,HE,RE,TE,UE,VE,WE,XE,YE,ZE,$E,aF,eF,gF,hF,iF,fF,kF,jF,lF,mF,pF,qF,rF,oF,nF,sF,wF,yF,vF,zF,uF,xF,tF,BF,AF,CF,DF,EF,HF,IF,JF,KF,MF,NF,PF,RF,QF,OF,SF,VF,TF,UF,WF,XF,YF,ZF,$F,bG,cG,dG,eG,fG,
|
|
3
|
+
hG,iG,jG,lG,mG,kG,nG,oG,pG,qG,rG,sG,tG,uG,vG,yG,BG,CG,FG,EG,GG,HG,LG,JG,NG,OG,PG,RG,QG,SG,UG,TG,$G,aH,XG,VG,YG,ZG,bH,cH,fH,eH,gH,hH,iH,WG,jH,dH,mH,nH,pH,oH,qH,sH,rH,tH,wH,uH,vH,yH,xH,zH,AH,BH,EH,GH,FH,IH,HH,KH,LH,MH,PH,OH,NH,QH,SH,RH,TH,UH,VH,WH,XH,YH,aI,$H,ZH,cI,bI,eI,iI,kI,lI,qI,tI,vI,xI,fI,zI,CI,DI,EI,GI,HI,JI,KI,MI,yI,OI,oI,QI,PI,mI,wI,TI,RI,LI,NI,VI,UI,SI,bJ,cJ,XI,eJ,YI,$I,hJ,gJ,aJ,fJ,iJ,nI,II,jJ,kJ,ZI,FI,pI,rI,hI,WI,sI,dJ,AI,BI,lJ,oJ,pJ,qJ,rJ,sJ,vJ,wJ,uJ,ZJ,$J,gK,tJ,fK,hK,aK,bK,cK,mK,iK,AJ,
|
|
4
|
+
zJ,yJ,YJ,kK,lK,dK,eK,xK,rK,AK,BK,CK,GK,DK,wG,AG,xG,PK,DG,zG,NK,LK,QK,yK,wK,FK,OK,MK,SK,EK,IK,oK,HK,TK,vK,UK,VK,YK,zK,uK,XK,WK,jK,RK,KK,$K,sK,JK,ZK,xJ,aL,qK,pK,bL,cL,dL,eL,fL,gL,hL,iL,jL;mC=" and the media start time is ";nC=" between media times and segment times for ";oC=" buffer";pC=" buffer. Range:";qC=" is being or has been set up";rC=" range:";sC=" seconds";tC=" with element state: ";uC=". Adjusting timestampOffset.";vC=". The segment start time is ";wC="\x3c/DATA\x3e\x3c/WRMHEADER\x3e";xC="\x3c/LA_URL\x3e";
|
|
5
|
+
yC="\x3cLA_URL\x3e";zC='\x3cWRMHEADER xmlns\x3d"http://schemas.microsoft.com/DRM/2007/03/PlayReadyHeader" version\x3d"';AC="Aborting operations for ";BC="Appended audio segment ";CC="Appended video segment ";DC="Appending data to ";EC="Buffer:";FC="Cannot get segment, period ID unknown";GC="Choosing new streams after key status change";HC="Detected a delta of ";IC="Done Aborting operations for ";JC="Done Appending data to ";KC="Done Flushing buffer for ";LC="Done Removing data from ";MC="Done Setting append window for ";
|
|
6
|
+
NC="Done Setting timestamp offset for ";OC="Failed to abort operations for ";PC="Failed to append data for ";QC="Failed to flush buffer for ";RC="Failed to remove data from ";SC="Failed to set append window for ";TC="Failed to set timestamp offset for ";UC="Flushing buffer for ";VC="IterateSegmentReference";WC="Jumping forward";XC="MediaSource threw QuotaExceededError:";YC="No more scheduled operations for ";_.ZC="No stream with id";$C="Period not found.";_.aD="Player is in ERROR state and can not switch to ";
|
|
7
|
+
bD="PrestoPlay TextTrack";cD="QuotaExceededError";dD="Removing audio from variant - audio not compatible with platform";eD="Removing data from ";fD="Reset transmuxers.";gD="Setting append window for ";hD="Setting playback rate to\x3d";iD="Setting timestamp offset for ";jD="Skip buffer flush for ";kD="Starting next operation for ";lD="URI-REPLACEMENT";mD="Update-End received for ";_.nD="Updating manifest...";oD="X-Playback-Session-Id";pD="bufferBehind\x3d";qD="bufferedBehind\x3d";rD="calling onCanSwitch()...";
|
|
8
|
+
sD="cannot find segment";tD="clpp.mse.Player";uD="currentPeriod.startTime\x3d";_.vD="dashif:Laurl";wD="failed to get buffered range for ";_.xD="getSegmentNextReference";_.yD="iterateSegmentReference";zD="key-restriction";AD="manifest.start";_.BD="onChooseStreams_";CD="presentationTime:";DD="presentationTime\x3d";ED="reference.endTime\x3d";FD="reference.position\x3d";GD="reference.startTime\x3d";HD="sourceopen";ID="startstreaming";_.JD="subtitles";KD="switch: Stream ";
|
|
9
|
+
LD=function(a,b){return _.bh[a]=b};MD=function(a,b){for(var c in a.a)b(c,a.a[c])};ND=function(a){for(var b=a.a+a.f.byteOffset,c=void 0;_.gn(a);)if(0===_.jn(a)){c=a.a+a.f.byteOffset-1;break}a=a.f.buffer.slice(b,c);return _.T.$(a)};_.PD=function(a){var b=new Uint8Array(OD),c=4+b.byteLength+a.j.byteLength+4+a.f.byteLength,d=new _.cn(c,!1);_.W(d,c);_.en(d,b);_.en(d,a.j);_.W(d,a.f.byteLength);_.en(d,a.f);return _.Fj(d.buffer)};
|
|
10
|
+
_.QD=function(a,b,c,d){var e=_.Sj(b);if(8!==e.byteLength)e="";else{var f=_.xo(e);e=_.Pj(f);b:switch(f=f.byteLength,_.Mh("Trying to create PlayReady header in version",a),a){case "4.0.0.0":e=[zC+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?yC+d+xC:"",wC].join("");break b;case "4.1.0.0":e=[zC+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?yC+d+xC:"",wC].join("");break b;case "4.2.0.0":case "4.3.0.0":e=[zC+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?yC+d+xC:"",wC].join("");break b;default:_.Hh("Cannot create PlayReady header in version",a),e=""}}if(!e)return null;_.Mh("New payload",e);e=_.Fj(_.T.jf(e,!0));return new _.oo(_.yo,
|
|
12
|
+
b,d||null,e,a,c)};_.RD=function(a,b){return b===a.version?a:_.QD(b,a.a,a.l||void 0,a.h||void 0)};SD=function(a,b){a:{if(b){var c=_.w(a.h.keys());for(var d=c.next();!d.done;d=c.next()){d=a.h.get(d.value);for(var e=0;e<d.lb.length;e++)if(d.lb[e]===b){c=d;break a}}}c=null}return c?c.hb:null};TD=function(a,b){if(_.Bl("Edge/"))return!0;b=b.toLowerCase();if(_.vk()&&b.includes('codecs\x3d"ac-3"')){var c=b.replace("ac-3",_.me);return a.K.has(b)||a.K.has(c)}return a.K.has(b)};
|
|
13
|
+
UD=function(a,b){var c=a.o.get(b);return!(!c||c!==_.gf&&c!==_.ze)};VD=function(a,b){var c=b.audio,d=b.video;if(c&&c.encrypted&&(c=_.jp(c),!TD(a,c))||d&&d.encrypted&&(d=_.jp(d),!TD(a,d)))return!1;var e=a.keySystem();return 0===b.drmInfos.length||b.drmInfos.some(function(f){return f.keySystem===e})};WD=function(a,b){if(null==a.a)return null;var c=a.a[a.a.length-1];return c?c[b]:null};XD=function(a){a=WD(a,_.lw);return null==a?null:a};
|
|
14
|
+
YD=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.Tb()+d.getDuration();)c+=1,d=a.a[c]||null;a.f=d?c:a.a.length-1}else a.f=-1};_.ZD=function(a,b){return a.concat(b)};$D=function(){};_.aE=function(a,b){if(0===b.length)return a;var c=b.map(function(d){return new _.Xi(d)});return a.map(function(d){return new _.Xi(d)}).map(function(d){return c.map(d.resolve.bind(d))}).reduce(_.ZD,[]).map(function(d){return d.toString()})};
|
|
15
|
+
_.bE=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:b||[],keyIds:[],periodId:c?c:null}};_.cE=function(a,b,c,d,e,f,g){f=void 0===f?"":f;this.Xa=a;this.za=b;this.ma=c;this.keyInfo=d||null;this.$c=_.N.R(e)?!1:!!e;this.le=f;this.Na=g};dE=function(a,b){a=_.wj(a);b=_.wj(b);var c=a.split("-"),d=b.split("-");return c[0]===d[0]&&1===c.length&&2===d.length};
|
|
16
|
+
eE=function(a){return a.language?_.wj(a.language):a.audio&&a.audio.language?_.wj(a.audio.language):a.video&&a.video.language?_.wj(a.video.language):_.ug};
|
|
17
|
+
_.fE=function(a,b){for(var c=_.wj(a),d=new Set,e=_.w(b),f=e.next();!f.done;f=e.next())d.add(_.wj(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,dE(f,c))return f;e=_.w(d);for(f=e.next();!f.done;f=e.next()){var g=f=f.value,h=c;g=_.wj(g);h=_.wj(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,dE(c,e))return e;return null};
|
|
18
|
+
gE=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};hE=function(a,b){var c=_.rl(b,a);if(!c)return!1;c=c();var d=c.isMuxed(a,b);c.destroy();return d};iE=function(a){for(var b=[a.mimeType],c=_.w(_.Zv),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
|
+
jE=function(a){return a.split(",").map(function(b){return b.trim()}).filter(function(b){return 0<b.length})};_.kE=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(",")};lE=function(a,b){for(var c=new _.vm(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};mE=function(){return!!window.SourceBuffer&&!!SourceBuffer.prototype&&!!SourceBuffer.prototype.changeType};
|
|
20
|
+
nE=function(a,b){return a.start-b.start};_.oE=function(a){this.h=void 0===a?null:a;this.log=new _.K("clpp.renditions");this.S=[];this.f=this.player=null;this.a=!1};pE=function(a){return a.S.map(function(b){return{start:b.start,end:b.end,width:b.width,height:b.height,bandwidth:b.bandwidth,rendition:b.rendition}})};qE=function(a){a.player&&(a.player.off(_.Rf,a.Uc),a.a&&a.player.off(_.qg,a.Uc));a.player=null};rE=function(a){a.player&&a.player.trigger(new _.L(_.ed))};sE=function(a){a.player&&a.player.trigger(new _.L(_.ed))};
|
|
21
|
+
tE=function(a){if(a.player){for(var b=!1,c={},d=0;d<a.S.length;d++){var e=a.S[d],f=e.width+"x"+e.height,g=c[f];if(g&&g!==e.bandwidth){b=!0;break}c[f]=e.bandwidth}b&&!a.a?(a.log.debug("Tracking timeupdates"),a.player.on(_.qg,a.Uc,a),a.a=!0):!b&&a.a&&(a.log.debug("Stop tracking timeupdates"),a.player.off(_.qg,a.Uc),a.a=!1)}};uE=function(a,b,c){a.S=a.S.filter(function(d){if(d.end<=b||d.start>=c)return!1;d.start=Math.max(d.start,b);d.end=Math.min(d.end,c);return!0});a.player&&a.player.trigger(new _.L(_.Kg))};
|
|
22
|
+
vE=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};wE=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};xE=function(a,b){for(var c=0;c<a.length;c++)if(wE(a[c]).has(b))return c;return-1};
|
|
23
|
+
zE=function(a,b){Array.from(wE(a)).forEach(function(c){c.segmentIndex&&_.yE(c.segmentIndex,b)})};_.AE=function(a){this.h=Math.exp(Math.log(.5)/a);this.f=this.a=0};_.BE=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)};_.CE=function(a){return a.a/(1-Math.pow(a.h,a.f))};
|
|
24
|
+
_.DE=function(a,b,c,d,e,f,g,h){a=_.ek(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};EE=function(a){this.a=this.h=0;this.f=a};_.FE=function(a,b,c){a.h=b;a.a=c};
|
|
25
|
+
_.GE=function(a,b,c,d,e,f){f=void 0===f?!1:f;this.j=a;this.G=b;this.K=c;this.A=this.f=Infinity;this.h=1;this.H=0;this.o=this.w=null;this.I=0;this.C=this.l=d;this.M=void 0===e?!0:e;this.g=new _.K("clpp.media.PresentationTimeline");this.P=f;this.L=null;this.a=new EE(d);this.J=null;this.B=this.j.type||null};_.IE=function(a,b){a.L={offsetDateTime:b-HE(a),seekRangeStartDateTime:b}};_.JE=function(a,b){a.l=b;a.C=b;a.a.f=b};KE=function(a){return 2===a.j.version?a.a.f?a.a.a:null:a.l?a.f:a.C?a.o:null};
|
|
26
|
+
_.NE=function(a,b,c){if(0!==b.length){var d=b[b.length-1].endTime+c;_.LE(a,b[0].startTime+c);a.h=b.reduce(function(e,f){return Math.max(e,f.endTime-f.startTime)},a.h);_.ME(a,d);null!=a.G&&a.M&&(a.G=(Date.now()+a.I)/1E3-(a.o||0)-a.h);a.g.debug("notifySegments: maxSegmentDuration\x3d"+a.h)}};_.LE=function(a,b){a.w=null==a.w?b:Math.min(a.w,b)};_.ME=function(a,b){a.o=Math.max(a.o||0,b)};_.OE=function(a,b){a.h=Math.max(a.h,b);a.g.debug("notifyNewSegmentDuration: maxSegmentDuration\x3d"+a.h)};
|
|
27
|
+
_.QE=function(a){return 2===a.j.version?a.a.Tb():Infinity===a.A?0:Math.max(0,PE(a)-a.A)};PE=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};SE=function(a,b){if(2===a.j.version)return a.a.Tb();var c=Math.max(a.w,0);return Infinity===a.A?Math.ceil(1E3*c)/1E3:Math.max(c,Math.min(PE(a)-a.A+b,RE(a)))};
|
|
28
|
+
HE=function(a){return 2===a.j.version?a.a.Tb():SE(a,0)};RE=function(a){var b=a.de()&&!a.C?a.K:0;return 2===a.j.version?a.a.a-b:Math.max(0,PE(a)-b)};TE=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}};UE=function(){this.f=function(){};this.h=function(){};this.a=new Set};
|
|
29
|
+
VE=function(a,b,c){a.f=b;a.h=c};WE=function(a,b){for(var c=[],d=!1,e={},f=_.w(b),g=f.next();!g.done;e={Ic:e.Ic},g=f.next())e.Ic=g.value,a.a.has(e.Ic)||(c.push(e.Ic),g=Array.from(a.a.values()).some(function(h){return function(l){return l.id===h.Ic.id}}(e)),e.Ic.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
|
+
XE=function(a,b){b=void 0===b?!1:b;return Array.from(a.a.values()).map(function(c){return TE(c,b)}).sort(function(c,d){return c.startTime-d.startTime})};YE=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 _.Du("crop",a,d.endTime?d.endTime-a:Infinity,!1))};ZE=function(a){var b=a.a.Qh(),c=a.h,d=b?b.id:null;(c?c.id:null)!==d&&b&&a.f(new _.L(_.Uf,{id:d}));a.h=b;"basic"===a.o.timeline&&(a.j.a=b)};
|
|
31
|
+
$E=function(a,b,c){this.h=a;this.a=b;this.f=c;this.g=new _.K("clpp.media.SegmentIterator")};aF=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};_.bF=function(a){this.a=a;this.g=new _.K("clpp.media.SegmentIndex")};_.cF=function(a){return a.a.length?a.a[a.a.length-1].endTime:0};_.dF=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
|
+
eF=function(a,b){var c=a.Wc(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 $E(a,c,e)};_.yE=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
|
+
gF=function(a,b){this.h=a;this.l=fF(a);this.a=a.a.currentTime;this.j=Date.now()/1E3;this.o=b;this.f=function(){}};hF=function(a,b){a.f=b};iF=function(a){this.a=a};fF=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
|
+
kF=function(a,b,c,d,e){var f=this;this.a=a;this.H=b;this.l=c;this.G=e;this.h=new _.Wh;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,_.Pg,function(){return jF(f)});this.w=(new _.xl(function(){jF(f)})).Ab(.25)};
|
|
35
|
+
jF=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 _.vm(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=fF(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>=RE(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:_.Lh("Ignoring large gap at",c,"size",g)}if(b||h)0===e?_.Lh(WC,g,"seconds because of gap before start time of",f):_.Lh(WC,g,"seconds because of gap starting at",d.end(e-1),"and ending at",f),a.B=!0,a.a.currentTime=f}}}}};
|
|
37
|
+
lF=function(a){var b=this;this.f=a;this.o=10;this.l=this.h=this.j=0;this.a=new _.xl(function(){0>=b.j?(_.Hh(["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--)})};mF=function(a,b){a.h=a.f.currentTime;a.l=b;a.j=a.o;a.f.currentTime=b;a.a.Ab(.1)};pF=function(a,b,c,d){this.a=a;this.j=b;this.o=d;this.A=c;this.l=!1;this.f=new _.Wh;this.h=new lF(a);this.w=!1;0<a.readyState?nF(this,c):oF(this,c)};
|
|
38
|
+
qF=function(a){return a.l?a.a.currentTime:a.A};rF=function(a,b){0<a.a.readyState?mF(a.h,b):oF(a,b)};oF=function(a,b){a.A=b;a.f.off(a.a,_.Ke);a.f.one(a.a,_.Ke,function(){nF(a,b)})};nF=function(a,b){a.w||(a.w=!0,a.o&&a.o());.001>Math.abs(a.a.currentTime-b)?sF(a):(a.f.one(a.a,_.Yf,function(){sF(a)}),mF(a.h,0===a.a.currentTime?b:a.a.currentTime))};sF=function(a){_.Dl()&&!a.l&&a.j();a.l=!0;a.f.on(a.a,_.Yf,function(){return a.j()})};
|
|
39
|
+
wF=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 kF(a,b.presentationTimeline,c,tF(this,a,c),f);this.f=new pF(a,function(){a:{var l=h.j;var m=l.B;l.B=!1;l.C=!0;l.A=!1;l.j=!1;l=qF(h.f);var n=uF(h,l);if(.001<Math.abs(n-l)){var p=(new Date).getTime()/1E3;if(!h.w||h.w<p-1){h.w=p;rF(h.f,n);m=void 0;break a}}h.g.debug("Seek to "+l);h.A(m?1:0);m=void 0}return m},vF(this,d,g),function(){h.j.I=!0});this.o=(new _.xl(function(){if(0!==
|
|
40
|
+
h.h.readyState&&!h.h.paused){var l=qF(h.f),m=HE(h.a),n=RE(h.a);3>n-m&&(m=n-3);l<m&&(m=uF(h,l),h.g.info("Jumping forward "+(m-l)+" seconds to catch up with the seek range."),h.h.currentTime=m)}})).Ab(.25);this.g=new _.K("clpp.mse.Playhead")};yF=function(a){var b=qF(a.f);return 0<a.h.readyState&&!a.h.paused?xF(a,b):b};vF=function(a,b,c){null==b?b=Infinity>a.a.getDuration()||c?HE(a.a):RE(a.a):0>b&&(b=RE(a.a)+b);return zF(a,xF(a,b))};
|
|
41
|
+
zF=function(a,b){var c=a.a.getDuration();return b>=c?c-a.l.durationBackoff:b};
|
|
42
|
+
uF=function(a,b){if("startover"===a.a.B)return b;var c=new _.vm(a.h.buffered);c=c.Jb.bind(c);var d=Math.max(a.B,a.l.rebufferingGoal),e=a.l.safeSeekOffset,f=HE(a.a),g=RE(a.a),h=a.a.getDuration();3>g-f&&(f=g-3);var l=SE(a.a,d),m=SE(a.a,e);d=SE(a.a,d+e);if(b>=h)return a.g.debug("Playhead past duration."),zF(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};xF=function(a,b){var c=HE(a.a);if(b<c)return c;c=RE(a.a);return b>c?c:b};
|
|
44
|
+
tF=function(a,b,c){if(!c.stallEnabled)return null;var d=c.gapDetectionThreshold,e=c.stallSkip;c=new gF(new iF(b),c.stallThreshold);hF(c,function(f,g){a.g.warn("Stall detected at "+f+" for "+g+" seconds.");if(e){var h=new _.vm(b.buffered),l;if(l=_.Bl("Edge/")||_.Bl("Trident/")||_.vk()||_.Dl())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};BF=function(a){var b=this;this.f=a;this.a=new Set;this.h=(new _.xl(function(){AF(b,!1)})).Ab(.25)};AF=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
|
+
CF=function(a,b){var c=a.offset||0;return b<a.startTime+c?1:b>a.endTime+c?3:2};
|
|
47
|
+
DF=function(a){var b=this;this.j=a;this.o=new Map;this.a=function(){};this.f=function(){};this.h=function(){};this.w=[{Gc:null,Fc:2,zc:function(c,d){return b.a(c,d)}},{Gc:1,Fc:2,zc:function(c,d){return b.a(c,d)}},{Gc:3,Fc:2,zc:function(c,d){return b.a(c,d)}},{Gc:2,Fc:1,zc:function(c,d){return b.f(c,d)}},{Gc:2,Fc:3,zc:function(c,d){return b.f(c,d)}},{Gc:1,Fc:3,zc:function(c,d){return b.h(c,d)}},{Gc:3,Fc:1,zc:function(c,d){return b.h(c,d)}}]};EF=function(a,b,c,d){a.a=b;a.f=c;a.h=d};
|
|
48
|
+
_.FF=function(a){_.Ju[a]&&delete _.Ju[a]};_.GF=function(a){_.Hu[a]&&delete _.Hu[a]};HF=function(){this.f=new _.AE(2);this.h=new _.AE(5);this.a=0};IF=function(a,b,c){if(!(16E3>c)){var d=8E3*c/b;b/=1E3;a.a+=c;_.BE(a.f,b,d);_.BE(a.h,b,d)}};JF=function(a,b){return 128E3>a.a?b:Math.min(_.CE(a.f),_.CE(a.h))};
|
|
49
|
+
KF=function(a,b){if(typeof a!==typeof b||a.length!==b.length)return!1;for(var c=0;c<a.length;c++)if(a[c].serviceLocationId!==b[c].serviceLocationId||a[c].uri!==b[c].uri||a[c].params!==b[c].params)return!1;return!0};_.LF=function(a,b){this.id=a;this.ra=b};MF=function(a,b){return a.ra.map(function(c){var d=new URL(c.uri+b);if(c.params){c=_.w(Object.entries(c.params));for(var e=c.next();!e.done;e=c.next()){var f=_.w(e.value);e=f.next().value;f=f.next().value;d.searchParams.set(e,f)}}return d.toString()})};
|
|
50
|
+
NF=function(a,b){_.wm.call(this);this.A=a;this.h=null;this.B=b;this.C=new _.sk;this.f=300;this.o=new Map;this.l=new Map;this.w=new Map;this.j=new Map;this.a=null;this.g=new _.K("clpp.net.ContentSteeringManager")};
|
|
51
|
+
PF=function(a,b){return _.I(function(c){null!=a.a&&(a.a.stop(),a.a=null);a.o.clear();a.l.clear();a.j.clear();a.w.clear();a.g.debug("contentSteeringServerUri: "+b.contentSteeringServerUri);a.g.info("queryBeforeStart: "+b.queryBeforeStart);a.h={manifestType:b.manifestType,contentSteeringServerUri:b.contentSteeringServerUri,queryBeforeStart:b.queryBeforeStart,Eh:b.defaultServiceLocation?b.defaultServiceLocation.split(","):[]};b.baseUriCollections.forEach(function(d){var e=[];if(a.h.Eh.length)for(var f=
|
|
52
|
+
{},g=_.w(a.h.Eh),h=g.next();!h.done;f={ye:f.ye},h=g.next())f.ye=h.value,(h=d.ra.find(function(l){return function(m){return m.serviceLocationId===l.ye}}(f)))?e.push(h):a.g.warn("setManifestConfig: could not get default location:","pathwayId: "+f.ye+" processedLocations:",e);e.length?a.l.set(d.id,e):a.l.set(d.id,d.ra);a.o.set(d.id,d.ra)});if(b.contentSteeringServerUri){if(a.h.queryBeforeStart)return c["return"](OF(a));a.g.info("defaultServiceLocations: "+b.defaultServiceLocation);OF(a)}_.B(c)})};
|
|
53
|
+
RF=function(a,b){var c=a.l.get(b);if(!c)return a.g.warn("getBaseUriCollectionById: invalid baseUriSetId:"+b+"."),null;var d=Date.now();a.j.forEach(function(f,g){f.zd&&d>f.zd&&(f.zd=0,a.trigger(new _.L(_.Rd,{detail:{serviceLocationId:g,banned:!1,bannedSeconds:0}})))});var e=c.filter(function(f){return 0===QF(a,f.serviceLocationId).zd});e.length||(e=c);e.length&&(c=a.w.get(b),KF(e,c)||(c={baseUriCollectionId:b,from:c||[],to:e},a.g.info("Steering server update baseUriCollectionId: "+c.baseUriCollectionId+
|
|
54
|
+
" from: "+JSON.stringify(c.from)+" to: "+JSON.stringify(c.to)),a.trigger(new _.L(_.Qd,{detail:c})),a.w.set(b,e)));return new _.LF(b,e)};QF=function(a,b){var c=a.j.get(b);c||(c={zd:0,$g:new HF,ef:!1},a.j.set(b,c));return c};
|
|
55
|
+
OF=function(a,b){var c,d,e,f,g,h,l;return _.I(function(m){if(1==m.a)return b=b||a.h.contentSteeringServerUri,c=SF(a,b),a.g.info("Sending request to content steering server, URI: "+c),d=_.ek(c,a.A.attemptParameters),d.type=7,e=a.B.fetch(d),_.tk(a.C,e),_.y(m,e.T,2);f=m.f;if(410===f.status)a.g.info(" Content steering server not available(HTTP response 410), stopping updates."),null!=a.a&&(a.a.stop(),a.a=null);else if(429===f.status){a.g.info("Content steering server overloaded (HTTP response 429).");
|
|
56
|
+
if(g=parseInt(f.headers["retry-after"],10))a.g.info("Will retry after "+g+" s based on Retry-After header."),a.f=g;TF(a,a.f)}else try{h=_.T.$(f.data),l=JSON.parse(h),1===l.VERSION?UF(a,l,f.uri):a.g.warn("Received unsupported steering manifest version: "+l.VERSION+", ignoring it and stop requesting.")}catch(n){a.g.error("requestInfo_: error parsing received steering manifest:",n);if(n&&7001===n.code)return m["return"]();null!=a.a&&(a.a.stop(),a.a=null);a.a=new _.xl(function(){OF(a)});TF(a,a.f)}_.B(m)})};
|
|
57
|
+
SF=function(a,b){var c=new _.Xi(b),d=[],e=[];a.j.forEach(function(g,h){g.ef&&(d.push(h),e.push(parseInt(JF(g.$g,1E4),10)));g.ef=!1});if(d.length){var f=c.a;a.h.manifestType===_.Sc?(f.add("_DASH_pathway",'"'+d.toString()+'"'),f.add("_DASH_throughput",e.toString())):a.h.manifestType===_.gm&&(f.add("_HLS_pathway",'"'+d.toString()+'"'),f.add("_HLS_throughput",e.toString()));_.ij(f);f.h&&_.aj(c,f)}else a.g.debug("addQueryParams_: serviceLocations EMPTY");return c.toString()};
|
|
58
|
+
VF=function(a,b,c,d){var e=[],f=a.o.get(b)||[];if(!c.length)return a.l.get(b);a={};c=_.w(c);for(b=c.next();!b.done;a={vd:a.vd,Ob:a.Ob,pd:a.pd},b=c.next())if(a.vd=b.value,b=f.find(function(g){return function(h){return h.serviceLocationId===g.vd}}(a)))e.push(b);else if(a.Ob=d.find(function(g){return function(h){return h.ID===g.vd}}(a)),a.Ob&&(b=f.find(function(g){return function(h){return h.serviceLocationId===g.Ob["BASE-ID"]}}(a))))a.pd={serviceLocationId:a.vd,uri:b.uri,params:{}},a.Ob[lD]&&(a.Ob[lD].HOST&&
|
|
59
|
+
(b=new _.Xi(b.uri),_.Zi(b,a.Ob[lD].HOST),a.pd.uri=b.toString()),a.Ob[lD].PARAMS&&Object.entries(a.Ob[lD].PARAMS).forEach(function(g){return function(h){var l=_.w(h);h=l.next().value;l=l.next().value;g.pd.params[h]=l}}(a))),e.push(a.pd);return e};TF=function(a,b){a.g.info("Scheduling next steering manifest update in "+b+" s.");a.a.ca(b)};
|
|
60
|
+
UF=function(a,b,c){null!=a.a&&(a.a.stop(),a.a=null);var d=b["RELOAD-URI"]||c;a.a=new _.xl(function(){OF(a,d)});if(c=b.TTL)a.f=c;TF(a,a.f);var e=b["PATHWAY-PRIORITY"]||[],f=b["PATHWAY-CLONES"]||[];a.j.forEach(function(g,h){e.includes(h)||a.j["delete"](h)});a.o.forEach(function(g,h){var l=VF(a,h,e,f);a.l.set(h,l)})};WF=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};
|
|
61
|
+
XF=function(a,b){if(b!==_.Rc){var c=_.dv[b];if(!c)throw new _.O(_.P,2,2012,"Text parser is unavailable for "+b);a.w=new c(a.C)}};YF=function(a,b,c,d){return Promise.resolve().then(function(){if(a.w&&a.j)if(null==c||null==d)a.w.parseInit(_.Fj(b));else{var e={periodStart:a.A,segmentStart:c,segmentEnd:d};e=a.w.parseMedia(_.Fj(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)}})};
|
|
62
|
+
ZF=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,[])};
|
|
63
|
+
$F=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 _.Li(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=
|
|
64
|
+
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))};_.aG=function(a){a=a.toLowerCase();return _.dv[a]||window.muxjs&&a===_.Rc?!0:!1};
|
|
65
|
+
bG=function(a,b){var c=String(_.Mk++);c=new _.Gk(c,a);c.mimeType=_.Hk(b.mimeType);if(a===_.U||a===_.Ik)c.label=_.Hk(b.label),c.language=_.Hk(b.language),c.originalLanguage=_.Hk(b.originalLanguage);a===_.Jk?(c.frameRate=b.frameRate,c.roles=b.roles,c.trickPlay=b.trickPlay):a===_.Ik?(c.channelsCount=b.channelsCount,c.roles=b.audioRoles||[],c.mimeType=_.Hk(b.audioMimeType)):(c.kind=_.Hk(b.kind),c.roles=b.roles);c.accessibility=a===_.Jk||a===_.Ik?(b.accessibility||[]).filter(function(d){return d.type===
|
|
66
66
|
a}):b.accessibility||[];return c};
|
|
67
|
-
|
|
68
|
-
c.renditions.push(d);return a||d};
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
a[0].presentationTimeline.
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
67
|
+
cG=function(a,b,c){var d=new _.Pk(a===_.Jk?""+b.videoId:a===_.Ik?""+b.audioId:""+b.id,c);switch(a){case _.Jk:d.codec=_.Hk(b.videoCodec);d.bandwidth=b.videoBandwidth||b.bandwidth;d.width=b.width;d.height=b.height;d.originalId=b.originalVideoId;break;case _.Ik:d.codec=_.Hk(b.audioCodec);d.bandwidth=b.audioBandwidth||b.bandwidth;d.originalId=b.originalAudioId;break;default:d.codec=_.Hk(b.codecs),d.originalId=b.originalTextId}(a=c.renditions.find(function(e){return _.N.na(e,d,null,["id","track"])}))||
|
|
68
|
+
c.renditions.push(d);return a||d};dG=function(a,b){var c=a.reduce(function(d,e){b===_.Jk?null===e.videoId||d[e.videoId]&&!e.active||(d[e.videoId]=e):b===_.Ik&&(null===e.audioId||d[e.audioId]&&!e.active||(d[e.audioId]=e));return d},{});return Object.values(c)};eG=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};
|
|
69
|
+
fG=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};_.gG=function(a,b){a.forEach(function(c){c.startTime+=b;c.endTime+=b})};hG=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}};iG=function(a){return Object.assign({},a,{periods:a.periods.map(function(b){return Object.assign({},b)})})};
|
|
70
|
+
jG=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=_.eh(a[0].periods).concat(),d={},e=1;e<a.length;d={ze:d.ze},e++)d.ze=hG(a[e-1]).end,_.gG(a[e].periods,d.ze),c.push.apply(c,_.eh(a[e].periods)),a[e].cues.forEach(function(f){return function(g){g.offset=f.ze}}(d));d=a.flatMap(function(f){return f.cues});c={periods:c,presentationTimeline:b,minBufferTime:0,cues:d};d=hG(c).end;_.FE(b.a,0,d);(d=
|
|
71
|
+
a[0].presentationTimeline.xc())&&_.IE(b,d.seekRangeStartDateTime);return c};lG=function(a,b){try{if(1===a.length)return a[0];if(!a.every(kG))throw new _.Si("Period durations must be finite");return jG(a,b)}catch(c){throw new _.O(_.P,7,7003,"Failed to join manifests into a continuous playlist!",c);}};
|
|
72
|
+
mG=function(a,b){var c=b.periods[0].configurationId,d=_.eh(a.periods).concat().filter(function(f){return f.configurationId!==c}),e=a.presentationTimeline;d={periods:d,presentationTimeline:e,minBufferTime:0};_.JE(e,b.presentationTimeline.l);return lG([d,b],e)};kG=function(a){return a.periods.every(function(b){return null!=b.endTime&&0<=b.endTime&&isFinite(b.endTime)})};
|
|
73
|
+
nG=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}};oG=function(a,b){return b.find(function(c){return c.id===a.id})||null};pG=function(){this.g=new _.K("clpp.mse.TrackManager");this.m=null;this.h=[];this.a=new Map;this.f=new Map};qG=function(a,b){return a.h.filter(function(c){return c.type===b})};rG=function(a,b){var c=a.a.get(b)||null;return c&&c.track};
|
|
74
|
+
sG=function(a,b,c){if(!c||rG(a,c.type)!==c||a.m.ta())switch(c=c?c.renditions[0]||null:null,b){case _.Jk:a.jb(c);break;case _.Ik:a.xb(c);break;case _.U:a.yb(c);break;default:throw Error("Unknown track type "+b);}};tG=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)};uG=function(a,b,c){return a.m.ta()?!0:(a.a.get(c)||null)===b?!1:!0};
|
|
75
|
+
vG=function(a,b,c){if(0>a.h.indexOf(b.track))throw Error("Unknown rendition with ID "+b.id);if(c!==b.track.type)throw Error("Types mismatch");};
|
|
76
|
+
yG=function(a,b,c){vG(a,b,_.Jk);if(uG(a,b,_.Jk)){var d=a.m;a.g.info("Set video rendition with ID: "+b.id);var e=a.a.get(_.Ik)||null,f=null;if(e){var g=wG(d).filter(function(l){return l.videoId===parseInt(b.id,10)});f=g.find(function(l){return l.audioId===parseInt(e.id,10)})||null;if(!f){a.g.debug("Unable to find exact variant. Searching for equivalent");var h=e.track.renditions.map(function(l){return l.id}).filter(function(l){return l!==e.id});f=g.find(function(l){return h.find(function(m){return m===
|
|
77
|
+
l.audioId})})||null}}else f=wG(d).find(function(l){return l.videoId===parseInt(b.id,10)})||null;f?(a.f.set(_.Jk,b),xG(d,f,c)):a.g.warn("Cannot find matching variant")}};
|
|
78
|
+
BG=function(a,b){var c,d,e;_.I(function(f){if(1==f.a){c=_.U;vG(a,b,c);if(!uG(a,b,c))return f["return"]();d=a.m.ja().find(function(g){return g.id===parseInt(b.id,10)});if(!d)return a.g.warn("Text rendition with ID: "+b.id+" not found."),f["return"]();a.g.info("Set text rendition with ID: "+b.id);a.f.set(c,b);_.D(f,2);tG(a,b);return _.y(f,zG(a.m,!0),4)}if(2!=f.a)return AG(a.m,d),a.m.trigger(new _.L(_.qm)),_.sh(f,0);e=_.F(f);a.g.warn("Failed to set text rendition",e);_.B(f)})};
|
|
79
|
+
CG=function(a){var b,c,d;_.I(function(e){if(1==e.a){b=_.U;c=rG(a,b);if(!c)return e["return"]();a.g.info("Unset text rendition.");_.D(e,2);return _.y(e,zG(a.m,!1),4)}if(2!=e.a)return a.a.set(b,null),a.m.trigger(new _.L(_.qm)),_.sh(e,0);d=_.F(e);a.g.warn("Failed to unset text rendition",d);_.B(e)})};
|
|
80
|
+
FG=function(a){if(a.m){a.g.debug("Track list change detected, updating track list");for(var b=[],c=_.w(Object.values(_.Yv)),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.ja());for(var e=d.next();!e.done;c={pc:c.pc},e=d.next()){e=e.value;c.pc=bG(_.U,e);var f=b.find(function(h){return function(l){return h.pc.na(l)}}(c));c.pc=f||c.pc;var g=cG(_.U,e,c.pc);e.active&&a.a.set(_.U,g);f||b.push(c.pc)}DG(a.m)||a.a.set(_.U,null);c=wG(a.m);EG(a,b,c,_.Jk);EG(a,b,c,_.Ik);
|
|
81
|
+
a.h=b}};EG=function(a,b,c,d){var e=dG(c,d);c={};e=_.w(e);for(var f=e.next();!f.done;c={qc:c.qc},f=e.next()){f=f.value;c.qc=bG(d,f);var g=b.find(function(l){return function(m){return l.qc.na(m)}}(c));c.qc=g||c.qc;var h=cG(d,f,c.qc);f.active&&a.a.set(d,h);g||b.push(c.qc)}};
|
|
82
|
+
GG=function(a,b,c){if(b){a.h.length||FG(a);for(var d=b.type,e=a.a.get(d)||null,f,g=_.w(qG(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&&(tG(a,f),d===_.Ik?a.m.trigger(new _.L(_.pm)):d===_.Jk&&a.m.trigger(new _.L(_.Lg,{details:{width:f.width||0,height:f.height||0,bandwidth:f.bandwidth,track:f.track,abrSelection:c}})))}};HG=function(){this.a=new muxjs.mp4.CaptionParser;this.l=[];this.j={}};_.IG=function(){};
|
|
83
|
+
_.KG=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 _.Wh;this.I=!1;this.w={};this.H=b;this.B=d;this.L=e;this.P=this.L.streaming.maxSegmentToMediaOffset||1;this.J=new _.mk;this.A="";this.G={};this.o=JG(this,this.J);this.M=!0;this.g=new _.K("clpp.mse.MediaSourceEngine")};LG=function(a){var b=_.sl(a.mimeType,a.codecs),c=iE(a);return _.aG(b)||_.Gt(c)||(_.rl(b,a.type)?!0:!1)};
|
|
84
|
+
JG=function(a,b){if(window.ManagedMediaSource){a.j.disableRemotePlayback=!0;var c=new ManagedMediaSource;a.l.one(c,HD,function(){URL.revokeObjectURL(a.A);b.resolve()});a.l.on(c,ID,function(){a.M=!0});a.l.on(c,"endstreaming",function(){a.M=!1});a.A=MG(c);a.j.src=a.A;return c}c=new MediaSource;a.A=MG(c);a.l.one(c,HD,function(){URL.revokeObjectURL(a.A);b.resolve()});a.j.src=a.A;return c};
|
|
85
|
+
NG=function(a,b){b.forEach(function(c,d){var e=a.o.addSourceBuffer(c);a.l.on(e,_.qe,a.zk.bind(a,d));a.l.on(e,"updateend",a.Xc.bind(a,d));a.f[d]=e;a.h[d]=[];a.G[d]=!1});a.K=b.has(_.Zc)&&b.has(_.r)};OG=function(a,b){try{return new _.vm(a.f[b].buffered,b)}catch(c){return b in a.f&&a.g.error(wD+b,c),null}};PG=function(a,b){if(!a.f[b])return"";var c=OG(a,b);return c?c.toString():""};RG=function(a,b,c,d,e){return[QG(a,b,a.yk.bind(a,b)),QG(a,b,a.ph.bind(a,b,c)),QG(a,b,a.Ak.bind(a,b,d,e))]};
|
|
86
|
+
QG=function(a,b,c){if(a.I)return Promise.reject();c={start:c,p:new _.mk};a.h[b].push(c);1===a.h[b].length&&SG(a,b);return c.p};SG=function(a,b){var c=a.h[b][0];if(c)try{a.g.debug(kD+b),c.start()}catch(d){d.name===cD?c.p.reject(new _.O(_.P,3,3017,{type:b})):c.p.reject(new _.O(_.P,3,3015,{mediaError:d})),TG(a,b)}else a.g.debug(YC+b)};
|
|
87
|
+
UG=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 _.mk,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:_.sh(p,3);break;case 2:g=_.F(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:_.th(p);for(m in a.f)TG(a,
|
|
88
|
+
m);_.uh(p);break;case 5:return n=_.F(p),p["return"](Promise.reject(new _.O(_.P,3,3015,{mediaError:n})))}})};TG=function(a,b){a.h[b].shift();SG(a,b)};
|
|
89
|
+
$G=function(a,b,c,d){var e=a.periods.flatMap(function(n){return n.variants});if(b.length||c.length)e=VG(e,b,c);e=WG(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={qf:c.qf},d++)c.qf=b[d],l=new Set(_.eh(l).concat().filter(function(n){return function(p){return n.qf.has(p)}}(c)));
|
|
90
|
+
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=XG(e);var m=YG(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(ZG(n)===m)return!0;_.Mh("Dropping Variant (better codec available)",n);return!1})};
|
|
91
|
+
aH=function(a,b,c,d){var e=a.periods.flatMap(function(f){return f.variants});if(b.length||c.length)e=VG(e,b,c);e=WG(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)})};XG=function(a){var b=new _.Th;a=_.w(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=ZG(c);b.push(d,c)}return b};
|
|
92
|
+
VG=function(a,b,c){if(!b.length&&!c.length)return a;var d=a.filter(function(g){return(g=g.audio)&&c.length&&(g=_.kE(g.codecs),c.includes(g))?!0:!1}),e=a.filter(function(g){return(g=g.video)&&b.length&&(g=_.kE(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};
|
|
93
|
+
YG=function(a){var b="",c=Infinity;MD(a,function(d,e){var f=e.reduce(function(g,h){return g+h.bandwidth||0},0)/e.length;_.Mh(_.Fd,d,"avg bandwidth",f);f<c&&(b=d,c=f)});return b};ZG=function(a){var b="";a.video&&(b=_.kE(a.video.codecs));var c="";a.audio&&(c=_.kE(a.audio.codecs));return b+"-"+c};
|
|
94
|
+
bH=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};cH=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=bH(e,b);f!==e.allowedByApplication&&(c=!0)}return c};
|
|
95
|
+
fH=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.aa&&!VD(a,n))return _.Mh("Dropping variant - not compatible with key system",n),!1;var p=n.audio,q=n.video;if(p&&!LG(p)){var t=p.codecs;0<=p.codecs.indexOf(_.me)?(_.Mh("Trying to use AC-3 for EC-3"),p.codecs=p.codecs.replace(_.me,"ac-3"),LG(p)?_.Lh("Using AC-3 instead of EC-3 for",dH(p)):(p.codecs=t,_.Lh(dD,dH(p)),n.audio=null,f=!0,p=null)):(_.Lh(dD,dH(p)),n.audio=null,f=!0,p=null)}return q&&!LG(q)?
|
|
96
|
+
(_.Lh("Dropping variant - video not compatible with platform",dH(q)),!1):p&&b&&!eH(p,b,e)?(_.Lh("Dropping variant - not compatible with active audio","active audio",dH(b),"variant.audio",dH(p)),!1):q&&c&&!eH(q,c,e)?(_.Lh("Dropping variant - not compatible with active video","active video",dH(c),"variant.video",dH(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&&
|
|
97
|
+
!n.audio?(_.Lh("Dropping variant - not compatible with video + audio","variant.video",dH(n.video)),!1):!0}))}d.textStreams=d.textStreams.filter(function(n){var p=_.aG(_.sl(n.mimeType,n.codecs));p||_.Mh("Dropping text stream. Is not supported by the platform.",n);return p})};eH=function(a,b,c){return a.mimeType!==b.mimeType||(void 0===c||c)&&a.codecs.split(".")[0]!==b.codecs.split(".")[0]?!1:!0};
|
|
98
|
+
gH=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",
|
|
97
99
|
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,
|
|
98
100
|
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};
|
|
99
|
-
|
|
100
|
-
accessibility:a.accessibility,keyId:null}};
|
|
101
|
-
_.
|
|
102
|
-
e.filter(function(h){return 0===h.roles.length}),b.length)return b;b=e.map(function(h){return h.roles}).reduce(_.
|
|
103
|
-
|
|
104
|
-
_.
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
b.D.setPlaybackRate(b.a.chasingRate,_.
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
m);_.
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
a;if(0===g.length||!e)throw _.
|
|
125
|
-
|
|
126
|
-
b.start);b=_.
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
m),q["return"]();p=
|
|
130
|
-
|
|
131
|
-
c)};
|
|
132
|
-
|
|
133
|
-
_.
|
|
134
|
-
_.
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
v){if(!a.a.has(v)){var z=
|
|
140
|
-
|
|
101
|
+
hH=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,
|
|
102
|
+
accessibility:a.accessibility,keyId:null}};iH=function(a){return a.allowedByApplication&&a.allowedByKeySystem};WG=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))};
|
|
103
|
+
_.kH=function(a,b,c,d){b=_.zi(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=_.fE(_.wj(h),a.map(function(m){return m.language}));return l?(e=a.filter(function(m){return _.wj(m.language)===l}),!0):!1});d&&e.some(function(h){return h.kind===_.se})&&(e=e.filter(function(h){return h.kind===_.se}));if(c){b=jH(e,c);if(b.length)return b;_.Hh("No exact match for the text role could be found.")}else if(b=
|
|
104
|
+
e.filter(function(h){return 0===h.roles.length}),b.length)return b;b=e.map(function(h){return h.roles}).reduce(_.ZD,[]);return b.length?jH(e,b[0]):e};jH=function(a,b){return a.filter(function(c){return c.roles.includes(b)})};
|
|
105
|
+
dH=function(a){var b=iE(a);return a.type===_.Zc?"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"};
|
|
106
|
+
_.lH=function(){this.g=new _.K("clpp.abr");this.A=null;this.l=!1;this.w=new HF;this.f=[];this.o=1;this.C=this.B=!1;this.j=this.a=this.h=null};mH=function(a,b,c){if(a.j&&a.a.useCmsd){var d=XD(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 bH(e,b)}));return a.sort(function(e,f){return e.bandwidth-f.bandwidth})};nH=function(){this.a=null};
|
|
107
|
+
pH=function(a,b){if(b&&(null==a.a||a.a!==b))throw oH(a);};oH=function(a){return new _.O(_.P,7,7E3,a.a?"Another load operation was started while a load operation was in progress.":"Player was released while a load operation was in progress.")};qH=function(){this.a=new Map};sH=function(a,b){a.a.has(b)||a.a.set(b,new rH);return a.a.get(b)};rH=function(){this.text=this.variant=null};tH=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)};
|
|
108
|
+
wH=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||uH(d,e))&&vH(d.roles,e.roles))}!d&&(d=a.video&&b.video)&&(a=a.video,b=b.video,d=!((!c||uH(a,b))&&vH(a.roles,b.roles)));return d?!1:!0};
|
|
109
|
+
uH=function(a,b){if(a.mimeType!==b.mimeType)return!1;var c=jE(a.codecs).map(function(f){return _.kE(f)}),d=jE(b.codecs).map(function(f){return _.kE(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};vH=function(a,b){var c=new Set(a),d=new Set(b);c["delete"](_.Me);d["delete"](_.Me);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};
|
|
110
|
+
yH=function(a){var b=void 0===b?_.If:b;this.f=a;this.a=b;this.h=new xH(a.language,"",a.audio&&a.audio.channelsCount?a.audio.channelsCount:0,!1,b)};xH=function(a,b,c,d,e){this.j=_.zi(a);this.a=b;this.f=c;this.l=void 0===d?!1:d;this.h=void 0===e?_.If:e};zH=function(a,b){var c=null;b.some(function(d){c=_.fE(_.wj(d),a.map(function(e){return eE(e)}));return!!c});return c?a.filter(function(d){return c===eE(d)}):[]};
|
|
111
|
+
AH=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)})};BH=function(a,b){return a.filter(function(c){return c.audio&&c.audio.spatialAudio!==b?!1:!0})};EH=function(a,b){this.a=CH;this.f=(new Map).set(CH,b).set(DH,a)};
|
|
112
|
+
GH=function(a){var b=this;this.D=a;this.a=a.getConfiguration().streaming;this.f=new _.Wh;this.g=new _.K("clpp.mse.media.LiveEdgeObserver");FH(this)&&(a=this.D.getSurface().getMedia(),this.f.on(a,_.qg,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."),
|
|
113
|
+
b.D.setPlaybackRate(b.a.chasingRate,_.Ud)):1<e&&c<=f&&(b.g.debug("On live edge, reduce playback rate."),b.D.setPlaybackRate(1))}))};
|
|
114
|
+
FH=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};
|
|
115
|
+
IH=function(a,b,c,d,e){this.j=a;this.C=c;this.a={};this.G={};this.M=!1;this.f=null;this.h={};this.l=new _.Wh;this.K=!1;this.w={};this.I=b;this.B=d;this.J=e;this.U=this.J.streaming.maxSegmentToMediaOffset||1;this.L=new _.mk;this.A="";this.H={};this.o=HH(this,this.L);this.P=!0;this.g=new _.K("clpp.mse.MediaSourceEngineSmooth")};
|
|
116
|
+
HH=function(a,b){if(window.ManagedMediaSource){a.j.disableRemotePlayback=!0;var c=new ManagedMediaSource;a.l.one(c,HD,function(){URL.revokeObjectURL(a.A);b.resolve()});a.l.on(c,ID,function(){a.P=!0});a.l.on(c,"endstreaming",function(){a.P=!1});a.A=JH(c);a.j.src=a.A;return c}c=new MediaSource;a.A=JH(c);a.l.one(c,HD,function(){URL.revokeObjectURL(a.A);b.resolve()});a.j.src=a.A;return c};
|
|
117
|
+
KH=function(a,b){b.forEach(function(c,d){var e=a.o.addSourceBuffer(c);a.l.on(e,_.qe,a.xk.bind(a,d));a.l.on(e,"updateend",a.tc.bind(a,d));a.a[d]=e;a.G[d]=c;a.h[d]=[];a.H[d]=!1});a.M=b.has(_.Zc)&&b.has(_.r)};LH=function(a,b){try{return new _.vm(a.a[b].buffered,b)}catch(c){return b in a.a&&a.g.error(wD+b,c),null}};MH=function(a,b){if(!a.a[b])return"";var c=LH(a,b);return c?c.toString():""};
|
|
118
|
+
PH=function(a,b,c,d,e,f){return[f?Promise.resolve():NH(a,b,function(){try{a.g.debug(AC+b+oC);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(OC+b+oC,l),l;}a.g.debug(IC+b+oC);a.tc(b)}),NH(a,b,function(){return OH(a,b,c)}),NH(a,b,function(){try{a.g.debug(gD+b,d,e),a.a[b].appendWindowStart=0,a.a[b].appendWindowEnd=e,a.a[b].appendWindowStart=d}catch(g){throw a.g.warn(SC+b,d,e,g),g;}a.g.debug(MC+b,d,e);a.tc(b)})]};
|
|
119
|
+
OH=function(a,b,c){0>c&&(c+=.001);try{a.g.debug(iD+b,c),a.a[b].timestampOffset=c}catch(d){throw a.g.warn(TC+b,c,d),d;}a.g.debug(NC+b,c);a.tc(b)};NH=function(a,b,c){if(a.K)return Promise.reject();c={start:c,p:new _.mk};a.h[b].push(c);1===a.h[b].length&&QH(a,b);return c.p};QH=function(a,b){var c=a.h[b][0];if(c)try{a.g.debug(kD+b),c.start()}catch(d){d.name===cD?c.p.reject(new _.O(_.P,3,3017,{type:b})):c.p.reject(new _.O(_.P,3,3015,{mediaError:d})),RH(a,b)}else a.g.debug(YC+b)};
|
|
120
|
+
SH=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 _.mk,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:_.sh(p,3);break;case 2:g=_.F(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:_.th(p);for(m in a.a)RH(a,
|
|
121
|
+
m);_.uh(p);break;case 5:return n=_.F(p),p["return"](Promise.reject(new _.O(_.P,3,3015,{mediaError:n})))}})};RH=function(a,b){a.h[b].shift();QH(a,b)};TH=function(a,b,c){return NH(a,b,function(){b===_.Q?a.g.debug("Change not supported for "+b):(a.g.debug("Change Type: "+a.G[b]+" -\x3e "+c),mE()?(a.a[b].changeType(c),a.G[b]=c):a.g.debug("Change Type not supported"),a.tc(b))})};
|
|
122
|
+
UH=function(a,b,c,d){var e,f,g,h,l;return _.I(function(m){return 1==m.a?(e=_.kE(_.ul(a.G[b])),f=_.tl(a.G[b]),g=_.sl(c,d),h=_.kE(_.ul(g)),l=_.tl(g),e===h&&f===l?m["return"](!1):a.J.mediaSource.codecSwitchingStrategy===_.cg&&mE()?_.y(m,TH(a,b,g),2):m.F(2)):m["return"](!0)})};VH=function(a){this.h=a;this.a=null;this.f=function(){}};WH=function(a,b){a.f=b};
|
|
123
|
+
XH=function(a){var b=this;this.f=a;this.o=this.A=this.l=!1;this.h=this.f.Xh();this.w=_.Ud;this.j=null;this.a=new _.xl(function(){b.A||b.f.om(.25*b.h)});this.g=new _.K("clpp.mse.media.PlayRateController")};YH=function(a,b){a.j=b;a.j.speedUpMode&&(a.w=a.j.speedUpMode)};
|
|
124
|
+
aI=function(a,b){a.a.stop();a.l||(a.o=!1);var c=a.l?0:a.h;if((b?b:a.w)===_.Ud||0===c||1===c)try{ZH(a,c)}catch(d){a.g.warn('Set playbackRate using "decoder" mode fails, due to unsupported range by platform. Fallback to "seek" mode.',d),$H(a)}else $H(a)};$H=function(a){a.g.debug(hD,a.h,' using "seek" mode.');ZH(a,0);a.o=!0;a.a.Ab(.25)};ZH=function(a,b){if(a.f.Xh()!==b){a.g.debug(hD,b,' using native playbackRate "decoder" mode.');try{a.f.Tn(b)}catch(c){throw c;}}};
|
|
125
|
+
cI=function(a){function b(){d=!0}function c(m){f.push(m);_.rn(m)}a=_.Fj(a);var d=!1,e,f=[],g=[];(new _.qn).N(_.Te,c).N(_.rg,c).N(_.Oe,c).N(_.Se,c).N(_.hg,c).X(_.jg,function(m){e=m;f.push(m);_.sn(m)}).X("encv",b).X("enca",b).X("avc1",function(m){g.push({N:m,ld:1701733238})}).X("avc3",function(m){g.push({N:m,ld:1701733238})}).X("ac-3",function(m){g.push({N:m,ld:1701733217})}).X(_.me,function(m){g.push({N:m,ld:1701733217})}).X("mp4a",function(m){g.push({N:m,ld:1701733217})}).parse(a);if(d)return _.Lh("Init segment already indicates encryption."),
|
|
126
|
+
a;if(0===g.length||!e)throw _.Nh("Failed to find boxes needed to fake encryption!"),_.Nh("Failed init segment (hex):",_.Tj(a)),new _.O(_.P,3,14E3);g.reverse();for(var h=_.w(g),l=h.next();!l.done;l=h.next())l=l.value,_.Lh('Inserting "'+_.vn(l.ld)+'" box into init segment.'),a=bI(a,e,l.N,f,l.ld);return a};
|
|
127
|
+
bI=function(a,b,c,d,e){var f=dI.value(),g=a.subarray(c.start,c.start+c.size),h=_.Mj(g),l=new Uint8Array(c.size+f.byteLength);l.set(g,0);g=_.Mj(l);g.setUint32(4,e);l.set(f,c.size);e=h.getUint32(4);g.setUint32(c.size+16,e);eI(l,0,l.byteLength);e=new Uint8Array(a.byteLength+l.byteLength);c=_.Bl("Xbox One")||_.Al()?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,eI(e,d.start,d.size+l.byteLength);l=_.Mj(e,
|
|
128
|
+
b.start);b=_.wn(b);a=l.getUint32(b);l.setUint32(b,a+1);return e};eI=function(a,b,c){a=_.Mj(a,b);b=a.getUint32(0);0!==b&&(1===b?(a.setUint32(8,c>>32),a.setUint32(12,c&4294967295)):a.setUint32(0,c))};_.gI=function(a,b){this.D=b;this.j=a;fI(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};
|
|
129
|
+
iI=function(a){var b=a.a.get(_.r);return b?hI(a,b.Xb):(b=a.a.get(_.Zc))?hI(a,b.Xb):null};kI=function(a){return _.jI(a,_.Zc)};lI=function(a){return _.jI(a,_.r)};
|
|
130
|
+
qI=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=_.tq,_.y(q,a.D.V.clear(c.TEXT),2);case 2:return a.H++,a.I=!1,d=a.H,e=a.D.V,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,mI(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.Rb();n=nI(a,m);if(null==n)return a.g.warn("Cannot set up text media state, period not found at",
|
|
131
|
+
m),q["return"]();p=oI(b,n,0);a.a.set(c.TEXT,p);pI(a,p,0)}_.B(q)}})};tI=function(a){a.I=!0;var b=a.a.get(_.Q);b&&(rI(b),sI(b)["catch"](function(){}),a.a["delete"](_.Q))};vI=function(a,b,c,d){b.video&&_.uI(a,b.video,c,d);b.audio&&_.uI(a,b.audio,c,d)};xI=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;fI(a.j);wI(a)};fI=function(a){a.periods.every(function(b){return typeof b.id===_.ig})};
|
|
132
|
+
zI=function(a){function b(l){return a.D.V.Jb(l,c,0)}var c=a.D.Rb(),d=!1,e=nI(a,c);if(_.Cj(a.a.values(),function(l){return l.Xb===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)||(yI(a,h),d=!0)}else if(!_.Cj(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())yI(a,f.value);d=!0}d||a.g.debug("(all): seeked: buffered seek: presentationTime\x3d"+
|
|
133
|
+
c)};CI=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=AI(d);if(d.ed||b&&BI(d))a.g.info(e,"Retrying after failure..."),d.ed=!1,pI(a,d,.1)}};DI=function(a){return Array.from(a.a.values()).some(function(b){return null!==b.kb})};
|
|
134
|
+
EI=function(a){var b=Array.from(a.a.values());return a.B&&b.every(function(c){return c.endOfStream})};GI=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,rI(e),e.vb&&e.Zb&&(e.vb=!1,b.push(e.Zb.abort())),e.cc&&b.push(FI(a,e,!0,0));return _.y(f,Promise.all(b),0)})};HI=function(a,b,c){(a=a.a.get(b))&&c&&(rI(a),a.stream=c,a.gc=c,a.pa&&(a.pa=c.getSegmentReference(a.pa.position)),a.pa||(a.gc=null))};
|
|
135
|
+
_.jI=function(a,b){var c=a.a.get(b);return c?c.kc||c.stream:null};
|
|
136
|
+
_.uI=function(a,b,c,d){var e=a.a.get(b.type);if(!e&&b.type===_.Q&&a.h.ignoreTextStreamFailures)qI(a,b);else if(e){var f=II(a,b).id;if(c&&f!==e.Xb)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())yI(a,c.value);else if(e.kc&&(a.g.debug("switch during trick play mode",b),b.trickModeVideo?(e.kc=b,b=b.trickModeVideo,a.g.debug("switch found trick play stream",b)):(e.kc=null,a.g.debug("switch found no special trick play stream"))),
|
|
137
|
+
JI(a,f)&&KI(a,b.id))if(e.stream!==b){var g=a.j.presentationTimeline.getDuration(),h=a.D.Rb();h=LI(a,e,h);!c&&(e.endOfStream||h>=g)?a.g.debug(KD+AI(e)+" already buffered to the end. Not switching."):(b.type===_.Q&&a.D.V.jc(_.sl(b.mimeType,b.codecs)),e.stream=b,e.stream.segmentIterator=null,e.We=!0,a.g.debug("switch: switching to Stream "+AI(e)),MI(a,e,f)&&(a.g.info("Aborting current segment request to switch."),e.Zb.abort()),c&&(e.rc?e.lf=!0:e.vb?(e.cc=!0,e.De=d,e.lf=!0):(rI(e),FI(a,e,!0,d)["catch"](function(l){if(a.D)a.D.onError(l)}))))}else a.g.debug(KD+
|
|
138
|
+
AI(e)+" already active")}};JI=function(a,b){var c=a.A.get(b);return!(!c||!c.ff)};KI=function(a,b){var c=a.w.get(b);return!(!c||!c.ff)};MI=function(a,b,c){if(!b.Zb)return!1;var d=a.D.Rb(),e=a.D.V.ha(b.type);c=(c=NI(a,b,d,e,c))?c.Xd():null;if(null==c)return!1;var f=b.stream.initSegmentReference;f&&(c+=f.Xd()||0);f=a.D.Ud().getBandwidthEstimate();if(8*c/f<(null===e?0:e-d)-Math.max(a.j.minBufferTime||0,a.h.rebufferingGoal))return!0;a=b.Zb;a=a.j?a.j.bytesRemaining:-1;return 0>a||a>c?!0:!1};
|
|
139
|
+
yI=function(a,b){var c=AI(b);b.rc?a.g.debug(c,"clear: already clearing the buffer"):b.cc?a.g.debug(c,"clear: already waiting"):b.vb?(a.g.debug(c,"clear: currently updating"),b.cc=!0,b.De=0):null==a.D.V.Oa(b.type)?(a.g.debug(c,"clear: nothing buffered"),null==b.kb&&pI(a,b,0)):(a.g.debug(c,"clear: handling right now"),rI(b),FI(a,b,!1,0)["catch"](function(d){if(a.D)a.D.onError(d)}))};
|
|
140
|
+
OI=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.Rb();g=nI(a,f);if(null==g)return a.g.warn("Cannot initialize streams, period not found at",f),q["return"]();h=_.tq;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.V;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"]();wI(a);return _.y(q,mI(a,m),3)}if(a.f)return q["return"]();l.forEach(function(t,
|
|
141
|
+
v){if(!a.a.has(v)){var z=oI(t,g,e);a.a.set(v,z);pI(a,z,0)}});_.B(q)})};oI=function(a,b,c){return{stream:a,type:a.type,gc:null,segmentIterator:null,pa:null,kc:null,We:!0,Xb:b,endOfStream:!1,vb:!1,kb:null,cc:!1,De:0,lf:!1,rc:!1,ug:!1,ed:!1,Zi:c||0,Zb:null,Je:!1,ri:0}};QI=function(a){a.g.debug("(all) setupAllPeriods_");a.j.periods.map(function(b){return b.id}).forEach(function(b){PI(a,b)["catch"]($D)})};
|
|
142
|
+
PI=function(a,b){var c=a.A.get(b);if(c)return a.g.debug("(all) Period "+b+qC),c;a.g.debug("(all) setting up Period "+b);var d=new _.mk;a.A.set(b,d);var e=new Set;c=hI(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:mI(a,e)}).then(function(){a.f||(d.resolve(),
|
|
141
143
|
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};
|
|
142
|
-
|
|
143
|
-
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));_.
|
|
144
|
-
|
|
145
|
-
if(null!=l&&f>=l&&!b.Je)return
|
|
146
|
-
null);d=Infinity;h=_.w(a.a.values());for(m=h.next();!m.done;m=h.next())m=m.value,c(m)||(m=
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
e,
|
|
150
|
-
g)a=null;else if(f=
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
v.then(function(){return a.f||a.o?null:
|
|
154
|
-
|
|
155
|
-
_.
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
n=f&&f.initSegment||b.stream.initSegmentReference;p=
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
a.D.Cf(e,d,
|
|
163
|
-
"Appending segment with "+(G.toFixed(3)+" - "+
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
f,f+h).then(function(){a.f||a.g.debug(d,"evicted "+h+
|
|
168
|
-
|
|
169
|
-
h.variant&&h.variant.audio&&l.set(_
|
|
170
|
-
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))?(_.
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
a.g.debug("fetching: reference\x3d",c);c=a.D.
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
this.configuration.preferredAudioChannelCount,this.configuration.preferSpatialAudio,this.configuration.mediaSource.codecSwitchingStrategy);this.
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
_.
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
0;d<f.length;d++)if(!f[d].
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
a.f=f.manifest,
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
a.
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
return b.stop()})).
|
|
202
|
-
|
|
203
|
-
if(
|
|
204
|
-
(
|
|
205
|
-
e=_.
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
a.
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
b
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
144
|
+
mI=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+qC),c.push(g)):(a.g.debug("(all) setting up Stream "+f.id),a.w.set(f.id,new _.mk),h=a.D.tb,c.push(f.createSegmentIndex(h)));_.D(z,2);return _.y(z,Promise.all(c),4);case 4:if(a.f)return z["return"]();_.sh(z,3);break;case 2:l=_.F(z);if(a.f)return z["return"]();m=_.w(b);for(e=m.next();!e.done;e=m.next())if(n=
|
|
145
|
+
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));_.B(z)}})};wI=function(a){var b=a.j.presentationTimeline.getDuration();Infinity>b?a.D.V.Lf(b):a.D.V.Lf(Math.pow(2,32))};
|
|
146
|
+
TI=function(a,b){function c(n){return n.type===_.Q&&n.stream.mimeType===_.Rc}if(c(b))return a.D.V.oh(b.stream.originalId||""),null;b.type===_.Q&&a.D.V.gh();if(!a.D.V.mi()&&b.type!==_.Q)return a.h.bufferLimitUpdateInterval?a.h.bufferLimitUpdateInterval/2:.5;var d=AI(b),e=a.D.Rb(),f=LI(a,b,e);a.g.debug(d,"timeNeeded\x3d"+f);var g=a.D.V.Ba(b.type,e);a.g.debug(d,"update_:",DD+e,"bufferedAhead\x3d"+g);var h=Math.max(a.j.minBufferTime||0,a.h.rebufferingGoal,a.h.bufferingGoal)*a.l,l=KE(a.j.presentationTimeline);
|
|
147
|
+
if(null!=l&&f>=l&&!b.Je)return RI(a,b),null;b.endOfStream=!1;l=II(a,b.stream).id;var m=nI(a,f);null!=m&&(b.Xb=m);if(m!==l)return a.g.debug(d,"need Period "+m,DD+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.V.ha(b.type);g=NI(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."),RI(a,b),
|
|
148
|
+
null);d=Infinity;h=_.w(a.a.values());for(m=h.next();!m.done;m=h.next())m=m.value,c(m)||(m=LI(a,m,e),d=Math.min(d,m));if(f>=d+a.j.presentationTimeline.h)return a.h.bufferLimitUpdateInterval||1;b.Zi=0;SI(a,b,e,l,g)["catch"](function(){});return null};RI=function(a,b){a.g.debug(AI(b),"buffered to end of presentation");b.endOfStream=!0;if(b.type===_.r){var c=a.a.get(_.Q);c&&c.stream.mimeType===_.Rc&&(c.endOfStream=!0)}};
|
|
149
|
+
LI=function(a,b,c){return b.gc&&b.pa?II(a,b.gc).startTime+b.pa.endTime:Math.max(c,b.Zi)};
|
|
150
|
+
NI=function(a,b,c,d,e){if(null==e)return a.g.warn(FC),null;if(b.stream.segmentLookupStrategy===_.yD)b.stream.segmentIterator?a=aF(b.stream.segmentIterator):b.pa||d?(c=b.pa?b.pa.endTime:d,a.g.info(VC,"looking up segment from new stream endTime:",c),b.stream.segmentIterator=eF(b.stream.segmentIndex,c),e=b.stream.segmentIterator.next().value,null===e&&(b.stream.segmentIterator=null,a.g.warn(VC,sD,"endTime:",c,b.pa)),a=e):(e=hI(a,e),e=Math.max(0,c-e.startTime),a.g.info(VC,"looking up segment","lookupTime:",
|
|
151
|
+
e,CD,c),d=null,d||(b.stream.segmentIterator=eF(b.stream.segmentIndex,e),d=b.stream.segmentIterator.next().value),null===d&&a.g.warn(VC,sD,"lookupTime:",e,CD,c),a=d);else{var f=AI(b);if(b.pa&&b.stream===b.gc)c=b.pa.position+1,a.g.debug(f,"next position known:","position\x3d"+c),a=UI(a,b,e,c);else{if(b.pa){a.g.debug(f,"next position unknown: another Stream buffered");f=II(a,b.gc);var g=VI(a,b,f.startTime+b.pa.endTime,e)}else a.g.debug(f,"next position unknown: nothing buffered"),g=VI(a,b,d||c,e);if(null==
|
|
152
|
+
g)a=null;else if(f=UI(a,b,e,g),null==f)a=null;else{var h=null==a.h?!1:a.h.ignoreDrift;null!=d||h||(d=f,d.Ea+d.startTime+2>c&&(a=UI(a,b,e,Math.max(0,g-1)))&&(f=a));a=f}}}return a};VI=function(a,b,c,d){var e=AI(b);d=hI(a,d);var f=Math.max(0,c-d.startTime);b=b.stream.findSegmentPosition(f);a.g.debug(e,"Looked up segment:",DD+c,"lookupTime\x3d"+f,uD+d.startTime,"Result: segment position\x3d"+b);null==b&&a.g.warn(e,"cannot find segment:",uD+d.startTime,"lookupTime\x3d"+f);return b};
|
|
153
|
+
UI=function(a,b,c,d){var e=AI(b);if(null==c)return a.g.warn(e,FC),null;c=hI(a,c);var f=b.stream.getSegmentReference(d);if(!f)return a.g.debug(e,"segment does not exist:",uD+c.startTime,"position\x3d"+d),null;var g=a.j.presentationTimeline;d=_.QE(g);g=PE(g);return!b.Je&&(c.startTime+f.endTime<d||c.startTime+f.startTime>g)?(a.g.debug(e,"segment is not available:",uD+c.startTime,GD+f.startTime,ED+f.endTime,"availabilityStart\x3d"+d,"availabilityEnd\x3d"+g),null):f};
|
|
154
|
+
SI=function(a,b,c,d,e){var f,g,h,l,m,n,p,q,t,v,z,A,G;return _.I(function(E){f=_.tq;g=AI(b);h=hI(a,d);a.g.debug(g,"fetchAndAppend_:",DD+c,uD+h.startTime,FD+e.position,GD+e.startTime,ED+e.endTime);l=b.stream;m=b.stream.segmentIterator;n=a.j.presentationTimeline.getDuration();p=WI(a,d);q=Math.max(0,h.startTime-.1);t=p?p.startTime+.01:n;v=XI(a,b,h,q,t,e);b.vb=!0;b.We=!1;a.g.debug(g,"fetching segment");z=!1;A=function(C,H){if(a.f||a.o)return null;z=!0;return YI(a,b,c,h,l,e,C,H)};G=a.D.V.ha(b.type)||0;
|
|
155
|
+
v.then(function(){return a.f||a.o?null:ZI(a,b,e,!1,function(C){return A(C.data,!0)})}).then(function(C){return a.f||a.o?null:z||null===C?($I(a,b,G,e,l),null):A(C,!1)}).then(function(){if(!a.f&&!a.o){$I(a,b,G,e,l);b.vb=!1;b.ug=!1;b.cc||a.D.af();if(m){var C=m.next().value;C&&a.g.debug("New iterated segment",C)}pI(a,b,0);aJ(a,b,l);a.g.debug(g,"finished fetch and append")}})["catch"](function(C){return _.I(function(H){if(a.f||a.o)return H["return"]();b.vb=!1;if(b.type===f.TEXT&&a.h.ignoreTextStreamFailures)return 1001===
|
|
156
|
+
C.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===C.code)return b.vb=!1,b.kb=null,pI(a,b,0),H.F(0);if(3017===C.code)return bJ(a,b,C),H.F(0);if(1001===C.code&&C.data&&404===C.data[1])return a.g.warn(g,"request for segment failed","segment not available on server",FD+e.position,GD+e.startTime,ED+e.endTime,"error\x3d"+C),b.vb=!1,b.kb=null,pI(a,b,1),H.F(0);if(b.type===f.TEXT)return C instanceof
|
|
157
|
+
_.O&&C.a(1),rI(b),a.D.onError(new _.O(1,2,2010,C)),H.F(0);if(1001<=C.code&&1003>=C.code)return _.y(H,cJ(a,b,h,C),0);a.g.error(g,"failed fetch and append: code\x3d"+C.code);b.ed=!0;C instanceof _.O&&C.a(_.P);return _.y(H,dJ(a,C),0)})});_.B(E)})};
|
|
158
|
+
bJ=function(a,b,c){var d=AI(b);if(Array.from(a.a.values()).some(function(f){return f!==b&&f.ug}))a.g.debug(d,XC,"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.ed=!0;a.o=!0;a.D.onError(c);return}a.g.warn(d,XC,"reducing buffering goals by "+(100-Math.round(100*a.l))+"%");b.ug=!0}pI(a,b,4)};
|
|
159
|
+
cJ=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.Cf(b.stream,c));if(!f)return g.F(0);b.ed=!0;d.a(_.P);return _.y(g,dJ(a,d),0)})};
|
|
160
|
+
XI=function(a,b,c,d,e,f){var g,h,l,m,n,p,q;return _.I(function(t){g=c.startTime-f.Ea;h=b.We||f.initSegment!==(b.pa&&b.pa.initSegment);if(!h&&g===b.ri)return t["return"](Promise.resolve());b.ri=g;l=AI(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.V.$i(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");
|
|
161
|
+
n=f&&f.initSegment||b.stream.initSegmentReference;p=ZI(a,b,n,!0);q=p.then(function(v){if(a.f)return null;a.g.debug(l,"appending init segment");return eJ(a,v,b).then(function(){return a.D.V.Fe(b.type,v,null,null,!!b.stream.closedCaptions&&0<b.stream.closedCaptions.size)})})["catch"](function(v){b.We=!0;return Promise.reject(v)});return t["return"](Promise.all([m,q]))})};
|
|
162
|
+
eJ=function(a,b,c){var d;return _.I(function(e){if(!a.h.patchEdgeWhenMixedContent||!_.Al())return e.F(0);d=cI(b);return _.y(e,a.D.V.Fe(c.type,d.buffer,null,null,!!c.stream.closedCaptions&&0<c.stream.closedCaptions.size),0)})};
|
|
163
|
+
YI=function(a,b,c,d,e,f,g,h){h=void 0===h?!1:h;var l,m,n,p,q,t,v,z;return _.I(function(A){switch(A.a){case 1:l=AI(b);if(!(e&&e.keyId&&a.D.Od)){A.F(2);break}m=SD(a.D.Od,e.keyId);if(!m){a.g.warn("Unable to find DRM session for "+e.keyId);A.F(2);break}_.D(A,4);return _.y(A,m,6);case 6:_.sh(A,2);break;case 4:_.F(A),a.g.warn("DRM session load failed, cannot append segment!");case 2:if(!(e.encrypted&&e.keyId&&a.D.Od&&UD(a.D.Od,e.keyId))){A.F(7);break}rI(b);n=II(a,e).id;p=fJ(a,n);if(!p){A.F(8);break}return _.y(A,
|
|
164
|
+
p,8);case 8:return q=a.D.Cf(e,d,zD),t=f.startTime+d.startTime,v=f.endTime+d.startTime,a.g.warn(l,"Blocked append for "+t+" - "+v+": "+q+". Stream with Key ID "+(e.keyId+" has restrictions.")),A["return"](Promise.resolve());case 7:return z=e.closedCaptions&&0<e.closedCaptions.size,null!=e.emsgSchemeIdUris&&0<e.emsgSchemeIdUris.length&&(new _.qn).X("emsg",a.jn.bind(a,d,f,e.emsgSchemeIdUris)).parse(g),A["return"](gJ(a,b,c).then(function(){if(a.f)return null;var G=f.startTime+d.startTime,E=f.endTime+
|
|
165
|
+
d.startTime;a.g.debug(l,"Appending segment with "+(G.toFixed(3)+" - "+E.toFixed(3)+" KeyID: ")+(e.keyId+" Width: ")+(e.width+" Height: "+e.height+" Bitrate: ")+(_.T.Bf(e.bandwidth)+" Fragment: ")+h);return a.D.V.Fe(b.type,g,G,E,z,e.id,h)}).then(function(){a.f||(a.g.debug(l,"appended media segment"),b.gc=e,b.pa=f)}))}})};
|
|
166
|
+
$I=function(a,b,c,d,e){if(!a.j.presentationTimeline.isLive()&&b.type!==_.Q){var f=AI(b),g=(a.D.V.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.Je=!0,a=a.j.periods,e.adjustSegmentDurations(d.position,c),d=xE(a,e),b=a[d],e=e.getDuration(),zE(b,e),e=d+1;e<a.length;e++)a[e].startTime+=c}};
|
|
167
|
+
hJ=function(a,b,c){(new _.qn).N(_.Te,_.rn).N(_.rg,_.rn).N(_.Oe,_.rn).N(_.Se,_.rn).N(_.hg,_.rn).X(_.jg,_.sn).N("encv",function(d){d.reader.skip(78);_.rn(d)}).N(_.bg,_.rn).N("schi",_.rn).N("tenc",function(d){d.reader.skip(6);if(_.jn(d.reader)){d.reader.skip(1);var e=_.Tj(_.pn(d.reader,16));e!==b.stream.keyId&&(a.g.debug(AI(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)};
|
|
168
|
+
gJ=function(a,b,c){if(a.f)return Promise.resolve();var d=AI(b);a.g.debug(d,"checking buffer length");var e=Math.max(a.h.bufferBehind,a.j.presentationTimeline.h),f=a.D.V.Oa(b.type);if(null==f)return a.g.debug(d,"buffer behind okay because nothing buffered:",DD+c,pD+e),Promise.resolve();var g=c-f,h=g-e;if(.01>=h)return a.g.debug(d,"buffer behind okay:",DD+c,qD+g,pD+e,"underflow\x3d"+Math.abs(h)),Promise.resolve();a.g.debug(d,"buffer behind too large:",DD+c,qD+g,pD+e,"overflow\x3d"+h);return a.D.V.remove(b.type,
|
|
169
|
+
f,f+h).then(function(){a.f||a.g.debug(d,"evicted "+h+sC)})};aJ=function(a,b,c){if(!a.B){b=AI(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.cc&&!e.rc&&e.pa}):a.C&&(a.B=!0);a.B&&(a.g.debug(b,"startup complete"),c=II(a,c).id,WI(a,c),fJ(a,c))}};fJ=function(a,b){var c=null;a.A.has(b)||(c=PI(a,b).then(function(){a.f||(a.g.debug(rD),a.D.dg())})["catch"]($D));QI(a);a.D.cn&&(a.g.debug("calling onStartupComplete()..."),a.D.cn());return c};
|
|
170
|
+
iJ=function(a,b){var c=AI(b),d=II(a,b.stream).id;if(b.Xb!==d){var e=b.Xb,f=Array.from(a.a.values());f.every(function(g){return g.Xb===e})?f.every(BI)?(a.g.debug(c,"all need Period "+e),PI(a,e).then(function(){if(!a.f)if(a.D.V.Yi(),f.every(function(n){var p=BI(n),q=II(a,n.stream).id;return p&&n.Xb===e&&q!==e})){var g=hI(a,e);a.g.debug(c,"Streaming period",e,g);a.g.debug(c,"calling onChooseStreams()...");var h=a.D.eg(g);a.C=!h.variant&&!!h.text;var l=new Map;h.variant&&h.variant.video&&l.set(_.r,h.variant.video);
|
|
171
|
+
h.variant&&h.variant.audio&&l.set(_.Zc,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 _.O(_.P,5,5005));return}m=_.w(Array.from(l.keys()));for(h=m.next();!h.done;h=m.next())if(h=h.value,!a.a.has(h))if(h===_.Q)OI(a,null,null,l.get(_.Q),g.startTime),l["delete"](h);else{a.g.error(c,"invalid Streams chosen: unusable "+h+" Stream");a.D.onError(new _.O(_.P,
|
|
172
|
+
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))?(_.uI(a,m,!1,0),pI(a,a.a.get(h),0)):a.a["delete"](h);a.g.debug(c,rD);a.D.dg()}else a.g.debug(c,"ignoring transition to Period",e,"since another is happening")})["catch"]($D)):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)}};nI=function(a,b){var c=vE(a.j.periods,b+_.Sv);return c?c.id:null};
|
|
173
|
+
II=function(a,b){var c=a.j.periods,d=xE(c,b);c=c[d];if(!c)throw new _.O(_.P,5,5006,"No period found for stream with ID "+b.id+".");return c};jJ=function(a,b){if(a.D.Yc){var c=b.Na;if(c)return RF(a.D.Yc,c.id)}return null};
|
|
174
|
+
kJ=function(a,b,c){if(a.D.Yc&&b){if(!c||0!==c.request.uriIndex){var d=a.D.Yc,e=b.ra[0].serviceLocationId,f=QF(d,e);f.zd=Date.now()+1E3*d.f;f.ef=!1;d.g.info("service location "+e+" banned during "+d.f+sC);d.trigger(new _.L(_.Rd,{detail:{serviceLocationId:e,banned:!0,bannedSeconds:d.f}}))}e=c.request;d=c.timeMs;c=c.data.byteLength;d&&c&&(a=QF(a.D.Yc,b.ra[e.uriIndex].serviceLocationId),IF(a.$g,d,c),a.ef=!0)}};
|
|
175
|
+
ZI=function(a,b,c,d,e){d=void 0===d?!1:d;e=void 0===e?null:e;var f=[],g=jJ(a,c);g&&(f=MF(g,c.le));f.length||(f=c.Xa());f=_.DE(f,c.za,c.ma,a.h.attemptParameters,c.startTime,c.endTime,b.type,c.timescale);f.type=2;f.onFragment=c.$c?null:e;f.disableFragmentSupport=c.$c||a.h.disableFragmentSupport;f.disableMergedFragments=a.h.disableMergedFragments;if(e=c.f())f.keyInfo=e,f.onFragment=null;d&&(f.responseModifiers.push(function(h){hJ(a,b,h.data)}),b.type===_.r&&a.h.overridePasp&&f.responseModifiers.push(a.mo.bind(a)));
|
|
176
|
+
a.g.debug("fetching: reference\x3d",c);c=a.D.tb.fetch(f);b.Zb=c;return c.T.then(function(h){var l=a.D.Ud(),m=h.timeMs,n=h.data.byteLength;m&&n&&!d&&l.segmentDownloaded(m,n);kJ(a,g,h);b.Zb=null;return h.data})["catch"](function(h){kJ(a,g);throw h;})};
|
|
177
|
+
FI=function(a,b,c,d){var e,f,g,h;return _.I(function(l){if(1==l.a)return e=AI(b),b.cc=!1,b.lf=!1,b.De=0,b.rc=!0,b.stream.segmentIterator=null,a.g.debug(e,"clearing buffer"),d?(g=a.D.Rb(),h=a.D.V.getDuration(),f=a.D.V.remove(b.type,g+d,h)):f=a.D.V.clear(b.type).then(function(){return!a.f&&c?a.D.V.flush(b.type):null}),_.y(l,f,2);if(a.f)return l["return"]();a.g.debug(e,"cleared buffer");b.gc=null;b.pa=null;b.rc=!1;b.endOfStream=!1;b.Je=!1;pI(a,b,0);_.B(l)})};
|
|
178
|
+
pI=function(a,b,c){a.g.debug(AI(b),"updating in "+c+sC);b.kb=(new _.vl(function(){var d;return _.I(function(e){if(1==e.a)return _.D(e,2),_.y(e,a.Yb(b),4);if(2!=e.a)return _.sh(e,0);d=_.F(e);if(a.D)a.D.onError(d);_.B(e)})})).ca(c)};rI=function(a){null!=a.kb&&(a.kb.stop(),a.kb=null)};hI=function(a,b){var c=a.j.periods.find(function(d){return d.id===b})||null;if(!c)throw new _.O(_.P,5,5006,"Period "+b+" not found");return c};
|
|
179
|
+
WI=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};sI=function(a){return _.I(function(b){return a.Zb?_.y(b,a.Zb.abort(),0):b.F(0)})};dJ=function(a,b){var c;return _.I(function(d){switch(d.a){case 1:if(a.f)return d["return"]();if(!a.D.cj){d.F(2);break}_.D(d,3);return _.y(d,a.D.cj(b),5);case 5:_.sh(d,2);break;case 3:c=_.F(d),c.cause=b,b=c;case 2:if(!b.f)a.D.onError(b);_.B(d)}})};AI=function(a){return"("+a.type+":"+a.stream.id+")"};
|
|
180
|
+
BI=function(a){return!a.vb&&null==a.kb&&!a.cc&&!a.rc};lJ=function(){this.a=null};
|
|
181
|
+
oJ=function(){_.Gm.call(this,tD);var a=this;this.G=mJ;this.j=this.ba=null;this.Ng=0;this.gj=2;this.Qc=null;this.Gg=!1;this.l=new _.Wh;this.Mc=this.Pg=this.Te=this.I=this.Pc=this.B=this.L=this.w=null;this.Zd=!1;this.f=this.A=this.a=this.K=this.J=null;this.h=new _.lH;this.Bb=null;this.Qg=1E9;this.Ve=new Set;this.va=!0;this.ga=null;this.ij=!1;this.hj=0;this.aa=null;this.P=new qH;this.H=null;this.bb=_.Vp;this.Rd=new xH(this.configuration.preferredAudioLanguage||[],this.configuration.preferredAudioRole,
|
|
182
|
+
this.configuration.preferredAudioChannelCount,this.configuration.preferSpatialAudio,this.configuration.mediaSource.codecSwitchingStrategy);this.Ld=this.configuration.preferredTextLanguage;this.o=new nH;this.fa=this.Oc=null;this.Hc=new Map;this.Td=null;this.Se=this.configuration.preferredTextRole;this.Bd=this.configuration.preferForcedSubtitles;this.l.on(window,"online",function(){a.G===nJ&&CI(a.a)});this.Ye=this.Pd=this.cf=null;this.Y=_.na;this.be=new lJ;this.Kg=null};
|
|
183
|
+
pJ=function(a){return new _.oE(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,_.eh(e.value.renditions))}return d.find(function(f){return f.id===b.toString()})||null})};
|
|
184
|
+
qJ=function(a,b){if(a.bb!==b){var c=_.T.ll;if(a.bb===_.fq&&b!==_.Vp)c=c(b,_.dq),a.log.info(_.aD+c);else{var d=a.Ng;d=0===d?0:Date.now()-d;var e=a.bb;a.bb=b;a.Ng=Date.now();null!==a.I&&(a.I.A=b===_.hq);a.H&&_.Lp(a.H.a,a.bb);b===_.$p&&(a.gj=a.wg?1:2);var f=a.gj,g={currentState:a.bb,previousState:e,timeSinceLastStateChangeMS:d,reason:b===_.$p||e===_.$p?f:void 0},h=c(e,_.dq),l=c(b,_.dq);c=b!==_.$p?"":"["+c(f,_.cq)+"]";a.log.info(_.Kb+h+" -\x3e "+(l+c));a.trigger(new _.L(_.fg,{detail:g}));(b===_.bq||b===
|
|
185
|
+
_.fq)&&a.Mc&&a.Mc.stop();b===_.$p?a.trigger(new _.L(_.jd,{detail:{bufferedTimeMS:-1,reason:f}})):e===_.$p&&a.trigger(new _.L(_.id,{detail:{bufferedTimeMS:d,reason:f}}))}}};rJ=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,_.Gm.prototype.release.call(a),4);case 4:return _.y(c,a.unload(),5);case 5:qJ(a,_.Vp),_.B(c)}})};
|
|
186
|
+
sJ=function(a){var b=new _.Eu;(a=a.playlist)&&a.cropTimeline&&(a.startTime||a.endTime)&&(b.h={start:a.startTime||null,end:a.endTime||null});return b};vJ=function(a,b){var c,d;return _.I(function(e){a.Y===_.na?tJ(a,b.cues):a.Y===_.Eb?(a.f=mG(a.f,iG(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,_.JE(a.f.presentationTimeline,!0),a.trigger(new _.L(_.Ge))),uJ(a,a.f)):xI(a.a,b);_.B(e)})};
|
|
187
|
+
wJ=function(a){return _.I(function(b){a.A.requestStop();a.A=null;a.Y===_.Eb?a.trigger(new _.L(_.Vf)):a.trigger(new _.L(_.Ge));_.B(b)})};
|
|
188
|
+
uJ=function(a,b){var c=a.getMediaPosition(),d=a.Pd,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 _.Du(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));YD(d,c);a:if(c=d.a,f.length!==c.length)f=!1;else{for(d=
|
|
189
|
+
0;d<f.length;d++)if(!f[d].na(c[d])){f=!1;break a}f=!0}!f&&a.trigger(new _.L(_.Wf));ZE(a.Ye);WE(a.K,b.cues)};ZJ=function(a){var b,c;return _.I(function(d){if(1==d.a)return xJ(a),_.y(d,yJ(a),2);if(3!=d.a){zJ(a);b=_.vk(4)||_.vk(5);if(!b)return d.F(3);c=a.getSurface().getMedia();AJ(a,c);return _.y(d,YJ(a,c),3)}a.configuration=a.Ha;_.B(d)})};
|
|
190
|
+
$J=function(a){return _.I(function(b){if(!a.configuration.contentSteering.enabled||!a.f.contentSteering)return b.F(0);a.Bb=new NF(a.configuration.contentSteering,a.getNetworkEngine());a.Bb.on(_.Qd,function(c){a.trigger(c)});return _.y(b,PF(a.Bb,a.f.contentSteering),0)})};
|
|
191
|
+
gK=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 _.mk,a.o.a=e,_.D(l,2),xJ(a),_.y(l,aK(a),4);case 4:return pH(a.o,e),a.Z=_.mq(b),a.configuration=_.Em(a.Ha,b),a.Kg&&a.configuration.mse.sendPlaybackSessionIdHeader&&a.getNetworkEngine().headers.set(oD,a.Kg),a.log.info(_.qb,a.configuration),a.log.info(_.Ib,a.Z),_.y(l,bK(a,e),5);case 5:return pH(a.o,e),_.y(l,cK(a,b,a.getSourceIndex(),e,!1),6);case 6:return f=l.f,pH(a.o,e),a.A=f.parser,
|
|
192
|
+
a.f=f.manifest,tJ(a,f.manifest.cues),_.y(l,$J(a),7);case 7:return g=a,_.y(l,dK(a,a.f,a.configuration),8);case 8:g.w=l.f;pH(a.o,e);if(!c){l.F(9);break}return _.y(l,eK(a,e),10);case 10:pH(a.o,e),a.l.one(a.j,_.Ie,function(){var m=Date.now()/1E3-d;a.H&&(a.H.A=m)});case 9:e.resolve();_.sh(l,0);break;case 2:h=_.F(l),fK(a,h,e),_.B(l)}})};tJ=function(a,b){if(a.configuration.ads.hls.mockCuesFn){var c=a.configuration.ads.hls.mockCuesFn(a);WE(a.K,c)}else WE(a.K,b)};
|
|
193
|
+
fK=function(a,b,c){b=hK(a,b,c);c["catch"](function(){});c.reject(b);a.onError(b);throw b;};hK=function(a,b,c){var d=a.o;return null!=d.a&&d.a===c||b instanceof _.O&&7E3===b.code?b instanceof _.O?b:new _.O(_.P,7,7003,"Unexpected error.",b):oH(a.o)};aK=function(a){return a.ba?a.ba["catch"](function(){}):Promise.resolve()};
|
|
194
|
+
bK=function(a,b){var c;return _.I(function(d){if(1==d.a)return a.H=new _.Qp,qJ(a,_.gq),c=iK(a,a.configuration),_.y(d,YJ(a,c),2);pH(a.o,b);a.K=new UE;VE(a.K,function(e){a.log.info("Timeline cue found",e);jK(a,_.oi,e)},function(){a.log.info("Timeline cues changed");a.trigger(new _.L(_.ii))});_.B(d)})};
|
|
195
|
+
cK=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=_.mq(f),h=g[c],_.y(n,kK(a,h),2);case 2:return l=n.f,pH(a.o,d),_.Bo(AD),_.y(n,lK(a,l,h,f.id||""),3);case 3:m=n.f;pH(a.o,d);if(!e||!m.presentationTimeline.l){n.F(4);break}return _.y(n,l.stop(),5);case 5:pH(a.o,d);case 4:return _.Bo("manifest.end"),_.Co("Fetch and parse manifest",AD,"manifest.end"),n["return"]({parser:l,manifest:m})}})};
|
|
196
|
+
mK=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a)return _.y(f,cK(a,b,0,null,!0),2);c=f.f;try{return d=[a.f,iG(c.manifest)],e=lG(d,a.f.presentationTimeline),f["return"]({parser:c.parser,manifest:e})}catch(g){throw new _.O(_.P,7,7003,"Failed to append load manifest");}})};iK=function(a,b){var c=a.getSurface().getMedia();c.loop=!!b.loop;_.N.R(b.volume)||a.setVolume(b.volume);_.N.R(b.muted)||a.setMuted(b.muted);AJ(a,c);return c};
|
|
197
|
+
AJ=function(a,b){a.j||(a.l.on(b,_.qe,function(){if(a.j.error){var c=a.j.error.code;if(1===c)c=null;else{var d=a.j.error.msExtendedCode;d&&(0>d&&(d+=Math.pow(2,32)),d=d.toString(16));c=new _.O(_.P,3,3016,{code:c,extendedError:d,message:a.j.error.message})}}else c=null;if(c)a.onError(c)}),a.j=b)};zJ=function(a){a.j&&(a.l.off(a.j,_.qe),a.j=null)};
|
|
198
|
+
yJ=function(a){var b;return _.I(function(c){switch(c.a){case 1:a.G!==nK&&(a.G=mJ);if(b=a.j)a.l.off(b,_.Ie),a.l.off(b,_.xf),a.l.off(b,_.hf),a.l.off(b,_.pe),a.l.off(b,_.Mf),a.l.off(b,_.Kf);a.K&&(a.K.release(),a.K=null);a.Pc&&(a.Pc.release(),a.Pc=null);a.Mc&&(a.Mc.stop(),a.Mc=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:if(!a.Bb){c.F(8);break}return _.y(c,
|
|
199
|
+
a.Bb.destroy(),9);case 9:a.Bb=null;case 8:a.B&&(a.B.release(),a.B=null);a.I&&(a.I.release(),a.I=null);if(!a.L){c.F(10);break}return _.y(c,a.L.destroy(),11);case 11:a.L=null;case 10:a.Qc&&(a.Qc.release(),a.Qc=null);a.Te&&(a.Te.release(),a.Te=null);b&&b.src&&(b.removeAttribute("src"),b.load());if(!a.w){c.F(12);break}return _.y(c,a.w.destroy(),13);case 13:a.w=null;case 12:a.P.clear(),a.J=null,a.Ve.clear(),a.f=null,a.H=null,a.va=!0,a.Hc.clear(),a.Zd=!1,oK(a),_.B(c)}})};
|
|
200
|
+
YJ=function(a,b){var c,d,e,f,g;return _.I(function(h){if(1==h.a)return c=window.muxjs?new HG:new _.IG,d=_.Jp(a.configuration,[_.xe,"single-native"]),e=d.create(a),a.U=e,f=pJ(a),f.track(a),a.Qc=f,g=null,pK(a)?g=new IH(b,c,e,f,a.configuration):g=new _.KG(b,c,e,f,a.configuration),_.y(h,g.open(),2);a.L=g;_.B(h)})};
|
|
201
|
+
kK=function(a,b){var c,d;return _.I(function(e){if(1==e.a)return c=a.getNetworkEngine(),_.y(e,_.Gu(b.url,c,a.configuration.manifest.attemptParameters,b.type||null),2);d=e.f;d.configure(a.configuration.manifest);return e["return"](d)})};
|
|
202
|
+
lK=function(a,b,c,d){return(new _.nk(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=qK(a,d);l=b.start(l,m);return _.y(h,l,6);case 6:e=h.f;_.sh(h,2);break;case 4:f=_.F(h);if(!a.Nc)throw f;return _.y(h,a.Nc(c.url,f),8);case 8:if(g=h.f)c.url=g;else throw f;h.F(2);break;case 3:if(0===e.periods.length)throw new _.O(_.P,4,4014);rK(e.periods);return h["return"](e)}})}),function(){a.log.info("Aborting parser step...");
|
|
203
|
+
return b.stop()})).T};
|
|
204
|
+
dK=function(a,b,c){var d,e,f,g,h,l,m,n;return _.I(function(p){switch(p.a){case 1:_.Bo("initDrm.start");d=new _.Ho({tb:a.getNetworkEngine(),onError:function(q){return a.onError(q)},hg:function(q){if(a.a){var t=sK(a),v=!1,z=Object.keys(q);0===z.length&&a.log.warn("Got a key status event without any key statuses, so we don't know the real key statuses. If we don't have all the keys, you'll need to set restrictions so we don't select those tracks.");var A=1===z.length&&"00"===z[0];A&&a.log.warn("Got a synthetic key status event, so we don't know the real key statuses. If we don't have all the keys, you'll need to set restrictions so we don't select those tracks.");
|
|
205
|
+
if(z.length){z=a.getPeriods();for(var G=0;G<z.length;G++)for(var E=z[G],C=_.w(E.variants),H=C.next();!H.done;H=C.next()){H=H.value;var M=[];H.audio&&M.push(H.audio);H.video&&M.push(H.video);M=_.w(M);for(var R=M.next();!R.done;R=M.next()){R=R.value;var V=H.allowedByKeySystem;if(R.keyId){var S=q[A?"00":R.keyId];S=!!S&&!tK.includes(S);H.allowedByKeySystem=S}V!==H.allowedByKeySystem&&(S=R.type,R.type===_.r&&(S="video "+R.width+"x"+R.height+"@"+_.T.Bf(R.bandwidth)),a.log.warn("DRM Key not available for KID: '"+
|
|
206
|
+
(R.keyId+"'. Applying restrictions to "+S)));E===t&&V!==H.allowedByKeySystem&&(v=!0)}}}if(q=iI(a.a)){A=kI(a.a);z=lI(a.a);a:{G=q.variants;for(E=0;E<G.length;E++)if(G[E].audio===A&&G[E].video===z){A=G[E];break a}A=null}if(!A||A.allowedByKeySystem)a.log.info(GC),uK(a),vK(a,q.variants)}v&&q!==t&&(a.log.info(GC),uK(a),vK(a,t.variants))}},gg:function(q,t){a.trigger(new _.L(_.de,{expirationTime:t}))},onEvent:function(q){return a.If(q)},getConfiguration:function(){return a.getConfiguration()},dd:function(){return a.dd()}});
|
|
207
|
+
e=b.periods.every(function(q){return q.variants.some(function(t){return t.drmInfos.some(function(v){return v.licenseServerUriOrigin===_.vD})})});c.drmResolver&&(c.drm=c.drmResolver({hasLaurl:e}));f=c.drm;g=_.Zm(f);d.f=g;h=f?f.offlineId||"":"";l=[];m=_.xu(b.periods);if(!h){p.F(2);break}n=_.Im(_.jf);if(!n){p.F(2);break}return _.y(p,n.l(a,m),4);case 4:return _.y(p,n.j(h),5);case 5:l=p.f;case 2:return _.y(p,_.Mo(d,m,l),6);case 6:return a.w=d,wK(a,b.periods),_.Bo("initDrm.end"),_.Co("Init DRM","initDrm.start",
|
|
208
|
+
"initDrm.end"),p["return"](d)}})};
|
|
209
|
+
eK=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,xK(a,c),yK(a,a.f.periods),a.Rd=new xH(a.configuration.preferredAudioLanguage||[],a.configuration.preferredAudioRole,a.configuration.preferredAudioChannelCount,a.configuration.preferSpatialAudio,a.configuration.mediaSource.codecSwitchingStrategy),a.Ld=a.configuration.preferredTextLanguage,a.Se=a.configuration.preferredTextRole,a.Bd=a.configuration.preferForcedSubtitles,_.y(q,_.cp(a.w,c),2);if(3!=q.a)return pH(a.o,
|
|
210
|
+
b),a.h.configure(a.configuration.abr),a.sg&&a.h.setCmsdManager(a.sg),a.h.init(function(t,v,z){if(!a.va){var A=sK(a);(t=oG(t,A.variants))?zK(a,t,v,z):a.log.warn("No matching variant found for track switch")}}),a.B=AK(a,c,a.configuration.startTime),a.Pc=BK(a),a.I=new XH({Xh:function(){return c.playbackRate},Tn:function(t){c.playbackRate=t},om:function(t){c.currentTime+=t}}),YH(a.I,a.configuration.trickPlay),a.isLive()&&a.configuration.streaming.enableLiveEdgeChasing&&(a.Te=new GH(a)),d=Math.max(1E-4,
|
|
211
|
+
a.configuration.streaming.rebufferingGoal),CK(a,d),pK(a)?aH(a.f,_.zi(a.configuration.preferredVideoCodec),_.zi(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount):$G(a.f,_.zi(a.configuration.preferredVideoCodec),_.zi(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount),e=DK(a),e.h=a.configuration.streaming,a.a=e,a.G=nJ,_.y(q,e.start(),3);pH(a.o,b);a.configuration.streaming.startAtSegmentBoundary&&(f=yF(a.B),g=EK(a,f),rF(a.B.f,g));h=_.w(a.f.periods);
|
|
212
|
+
for(l=h.next();!l.done;l=h.next())m=l.value,FK(a,m);uK(a);n=sK(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");vK(a,n.variants);_.B(q)})};
|
|
213
|
+
xK=function(a,b){function c(d){a.j&&a.J&&(d.type===_.Yf&&a.ee?(a.J.a=DH,oK(a)):d.type===_.Pg&&a.getState()===_.iq&&.1>a.getBufferInfo().Ba(a.getMediaPosition())?(a.J.a=DH,oK(a)):a.J&&GK(a));HK(a)}a.l.on(b,_.xf,c);a.l.on(b,_.hf,c);a.l.on(b,_.pe,c);a.l.on(b,_.Yf,c);a.l.on(b,_.Xf,c);a.l.on(b,_.Kf,c);a.l.on(b,_.Pg,c);a.l.on(b,_.Mf,function(){if(a.j){var d=a.j.playbackRate;0!==d&&a.I.set(d)}})};
|
|
214
|
+
rK=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)})){_.Mh("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)}};AK=function(a,b,c){return new wF(b,a.f,a.configuration.streaming,c,function(d){a.Pc&&AF(a.Pc,!0,d);a.a&&zI(a.a)},function(d){return a.dispatchEvent(d)},a.Y===_.Eb)};
|
|
215
|
+
BK=function(a){var b=new BF(a.j),c=new VH(a.f);WH(c,function(){uK(a)});b.a.add(c);a.K&&(c=new DF(a.K),EF(c,function(d){d.$e&&d.$e();jK(a,_.ji,d)},function(d){d.fg&&d.fg();jK(a,_.ki,d)},function(d,e){e||(d.$e&&d.$e(),jK(a,_.ji,d),d.fg&&d.fg(),jK(a,_.ki,d))}),b.a.add(c));a.Y===_.Eb&&(c=new YE(a.Pd,a.be,function(d){return a.trigger(d)},a.configuration.playlist),b.a.add(c),a.Ye=c);return b};CK=function(a,b){a.J=new EH(b,Math.min(.5,b/2));a.J.a=DH;oK(a);a.Mc=(new _.xl(function(){GK(a)})).Ab(.25)};
|
|
216
|
+
GK=function(a){switch(a.G){case nJ:a:if(a.j.ended||a.L.Ge())var b=!0;else{if(a.isLive()){b=PE(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.Tf();c=d.video;d=d.audio;var e=a.j.currentTime;c&&d?(c=c.Ba(e),d=d.Ba(e),c=Math.min(c,d)):c=c?c.Ba(e):d?d.Ba(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?CH:DH;d.a=c;d=e!==c}c=d;d=IK(a);c||a.getState()===_.$p&&!d?(a.log.debug("Buffering state changed. Is buffering",
|
|
217
|
+
d,"buffered to end",b,"state",a.getState()),oK(a)):a.Zd&&HK(a)};DK=function(a){var b={configuration:{gm:a.Y===_.Eb},Rb:function(){return yF(a.B)},V:a.L,tb:a.getNetworkEngine(),Yc:a.Bb,eg:a.wk.bind(a),dg:a.vk.bind(a),onError:a.onError.bind(a),Bi:a.Lm.bind(a),onEvent:a.If.bind(a),Gi:a.lo.bind(a),af:a.Ym.bind(a),Ud:function(){return a.h},Cf:a.Dj.bind(a),cj:a.$n.bind(a),Od:a.w};return new _.gI(a.f,b)};
|
|
218
|
+
wG=function(a){if(a.f&&a.B){var b=JK(a),c=[];a=_.w(KK(a));for(var d=a.next();!d.done;d=a.next()){d=d.value;var e=gH(d);e.active=d===b;c.push(e)}return c}return[]};AG=function(a,b){if(a.f&&a.a){var c=sK(a),d=c.textStreams.find(function(e){return e.id===b.id});d?(LK(a,c,d,!1),MK(a,d),a.Ld=d.language,a.Bd=d.kind===_.se):a.log.error(_.ZC,b.id)}};
|
|
219
|
+
xG=function(a,b,c){var d=void 0===d?0:d;if(!a.f||!a.a)throw Error("Player not ready to select tracks.");var e=sK(a);if(!e)throw Error($C);if(b){a.configuration.abr.enabled&&(a.log.info("Disable ABR and enable manual track selection to select "+(b.width+"x"+b.height+"@"+b.bandwidth)),a.configuration.abr.enabled=!1,a.h.disable());var f=e.variants.find(function(g){return g.id===b.id});if(!f)throw a.log.error("No variant with id",b.id),Error("Variant not found.");if(!iH(f))throw a.log.error("Unable to switch to restricted track",
|
|
220
|
+
b.id),Error("Unable to switch to restricted track.");a.fa=f.video.id;NK(a,e,f,!1);OK(a,f,c,d);null==a.Td&&(a.Td=a.Rd);a.Rd=new yH(f);vK(a,e.variants)}else a.fa=null,null!=a.Td&&(a.Rd=a.Td,a.Td=null),a.configuration.abr.enabled||(a.log.info("Enable ABR Selection"),a.configuration.abr.enabled=!0,a.h.enable()),c=vK(a,e.variants),null==c||a.va||zK(a,c)};
|
|
221
|
+
PK=function(a,b){if(a.configuration.streaming.disableAudioTracks)throw Error("Audio tracks are disabled by config.");if(!a.a||!a.f||!a.B)throw Error("Not ready to select audio track.");var c=lI(a.a),d=kI(a.a),e=sK(a);if(!e)throw Error($C);var f=e.variants.filter(function(n){return n.audio.id===b&&iH(n)}),g=!1,h=void 0;if(c){if(h=f.find(function(n){return n.video.id===c.id}),!h){a.log.debug("Cannot find exact variant, looking for anything else that matches with given audioId");g=!0;var l=a.getTrackManager().Ia();
|
|
222
|
+
if(l){var m=l.renditions.map(function(n){return n.id});h=f.find(function(n){return m.find(function(p){return p===String(n.video.id)})})}}}else h=f[0];if(!h)throw Error("Variant with target audio track not found.");if(d.codecs.split(".")[0]!==h.audio.codecs.split(".")[0])throw a.log.warn("Cannot select audio track, codecs are not compatible with active track."),Error("Audio codecs not compatible with active audio.");d=h.audio;a.Oc=d.id;f=f.map(nG);a.h.setTracks(f);NK(a,e,h,!1);g||a.va?OK(a,h,!0,0):
|
|
223
|
+
_.uI(a.a,d,!0,0)};DG=function(a){var b=a.Gg;return a.f?a.L.getTextDisplayer().isTextVisible():b};zG=function(a,b){var c,d,e,f;return _.I(function(g){c=a.Gg;d=b;if(c===d)return g["return"]();a.Gg=d;if(a.G!==nJ)return g.F(0);a.L.getTextDisplayer().setTextVisibility(b);if(a.configuration.streaming.alwaysStreamText)return g.F(0);if(!b)return tI(a.a),g.F(0);e=sK(a);f=_.kH(e.textStreams,a.Ld,a.Se,a.Bd);return 0<f.length?_.y(g,qI(a.a,f[0]),0):g.F(0)})};
|
|
224
|
+
NK=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){GG(e,c.video,d);var g=e.ka();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&&(GG(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})))}sH(a.P,
|
|
225
|
+
b).variant=c};LK=function(a,b,c,d){sH(a.P,b).text=c;if(b=a.getTrackManager())GG(b,c,d),c=b.Sa(),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}))};QK=function(a){return a.Y===_.Eb&&"flat"===a.configuration.playlist.timeline};
|
|
226
|
+
yK=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.Qg++,originalId:l,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return null},getSegmentReference:function(){return null},initSegmentReference:null,Ea:0,mimeType:_.Rc,codecs:"",kind:_.md,encrypted:!1,
|
|
224
227
|
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)}};
|
|
225
|
-
|
|
226
|
-
e.value,(g=e.video)&&!
|
|
227
|
-
|
|
228
|
-
_.
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
d=a.h.chooseTrack(),
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
missingKeys:g,restrictedKeyStatuses:h});};
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
h=c.video&&c.video.id;a.f.periods=f.periods;l=
|
|
241
|
-
z.next())
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
_.
|
|
248
|
-
_.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.
|
|
249
|
-
b<e.end&&(e.start=b);this.
|
|
250
|
-
_.u.
|
|
251
|
-
{detail:{width:b,height:c,bandwidth:a?a.bandwidth:null,rendition:a}}))}}}};
|
|
252
|
-
_.u.isLive=function(){return 2===this.j.version?!this.a.f:Infinity===this.f&&!this.l};_.u.de=function(){return!this.l};
|
|
253
|
-
|
|
254
|
-
_.u.
|
|
255
|
-
_.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.
|
|
256
|
-
_.u.
|
|
257
|
-
_.u.
|
|
258
|
-
if(b.length)for(d=b[b.length-1].position+1;e<a.length;)f=a[e++],f=new _.
|
|
259
|
-
f.le,f.
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
_.u.
|
|
264
|
-
_.u.rb=function(){return this.f.get(_.
|
|
265
|
-
_.u.
|
|
266
|
-
_.u.
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
_.u.
|
|
271
|
-
_.u.
|
|
272
|
-
_.u.
|
|
273
|
-
_.
|
|
274
|
-
d
|
|
275
|
-
_.
|
|
276
|
-
|
|
277
|
-
_.u.
|
|
278
|
-
_.u.
|
|
279
|
-
_.u.
|
|
280
|
-
_.u
|
|
281
|
-
_.u.
|
|
228
|
+
wK=function(a,b){for(var c=a.a?kI(a.a):null,d=a.a?lI(a.a):null,e=!pK(a),f=_.w(b),g=f.next();!g.done;g=f.next())fH(a.w,c,d,g.value,e);c=gE(b,function(h){return h.variants.some(iH)});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=
|
|
229
|
+
e.value,(g=e.video)&&!hE(g.type,_.sl(g.mimeType,g.codecs))&&delete e.video;if(0===c)throw new _.O(_.P,4,4032);if(c<b.length)throw new _.O(_.P,4,4011);c=_.w(b);for(e=c.next();!e.done;e=c.next())d=e.value,cH(d.variants,a.configuration.restrictions)&&a.a&&sK(a)===d&&uK(a),RK(a,d.variants)};
|
|
230
|
+
FK=function(a,b){var c=a.a?kI(a.a):null,d=a.a?lI(a.a):null,e=!pK(a);fH(a.w,c,d,b,e);d=b.variants;if(!d.some(iH))throw new _.O(_.P,4,4011);RK(a,b.variants);cH(d,a.configuration.restrictions)&&a.a&&sK(a)===b&&uK(a);if(!_.vk(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,_.fp(a.w,g.keyId,g.initData)||
|
|
231
|
+
_.Xo(a.w,g.initDataType,g.initData,g.keyId)}}};OK=function(a,b,c,d){c=void 0===c?!1:c;d=void 0===d?0:d;a.va?(a.ga=b,a.ij=c,a.hj=d):vI(a.a,b,c,d)};MK=function(a,b){a.va?a.aa=b:_.uI(a.a,b,!0,0)};SK=function(a){if(a.a&&a.f){var b=iI(a.a),c=sK(a);null!=b&&b===c&&(kI(a.a),lI(a.a),_.jI(a.a,_.Q),sH(a.P,c),sH(a.P,c))}};
|
|
232
|
+
EK=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=kI(a.a),e=lI(a.a),f=sK(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};IK=function(a){return a.w&&a.w.G?!0:a.J?a.J.getState()===DH:!1};
|
|
233
|
+
oK=function(a){if(a.H&&a.J&&a.B){var b=TK(a)===_.$p,c=a.I;c.l=b;aI(c,c.o?"seek":void 0);a.B.j.o=b;HK(a);a.Ye&&(c=1>Math.abs(a.getMediaDuration()-a.getMediaPosition()),a=a.Ye,b&&c&&(b=a.a,b.a[b.a.length-1]&&a.f(new _.L(_.Tf))))}};HK=function(a){qJ(a,TK(a))};TK=function(a){if(a.ee)var b=!1;else if(a.j&&a.j.ended)b=!0;else{b=a.getMediaDuration();var c=a.getMediaPosition();b=a.Zd&&0<=c&&b<=c?!0:!1}return b?_.bq:IK(a)||a.ee?_.$p:a.j&&a.j.paused?_.hq:_.iq};
|
|
234
|
+
vK=function(a,b){try{RK(a,b)}catch(f){return a.onError(f),null}var c=b.filter(function(f){return iH(f)}),d=eG(c,a.Oc);c=a.Rd.create(d);c=Array.from(c.values());var e=c.map(nG);a.h.setTracks(e);if(null!==a.fa&&null!==a.Oc&&(e=c.find(function(f){return f.video.id===a.fa&&f.audio.id===a.Oc}),a.fa=null,e))return e;if(a.configuration.abr.enabled||null===a.fa)return d=a.h.chooseTrack(),oG(d,c);d=d.find(function(f){return null!==f.video&&f.video.id===a.fa});return d?d:(a.log.warn("Selected video track not found. Falling back to ABR selection"),
|
|
235
|
+
d=a.h.chooseTrack(),oG(d,c))};UK=function(a,b){return _.kH(b,a.Ld,a.Se,a.Bd)[0]||null};VK=function(a,b,c){c=void 0===c?!0:c;var d=vK(a,b.variants);a.Oc=d&&d.audio&&d.audio.id;d&&(NK(a,b,d,!0),OK(a,d,c));(c=UK(a,b.textStreams))&&(a.configuration.streaming.alwaysStreamText||DG(a))&&(LK(a,b,c,!0),MK(a,c))};
|
|
236
|
+
YK=function(a,b){a.va=!0;a.h.disable();a.log.debug("Choosing new streams after period changed");var c=vK(a,b.variants),d=UK(a,b.textStreams);a.ga&&(b.variants.includes(a.ga)&&(c=a.ga),a.ga=null);a.aa&&(b.textStreams.includes(a.aa)&&(d=a.aa),a.aa=null);c&&WK(a,b,function(){return NK(a,b,c,!0)});d&&(a.configuration.streaming.alwaysStreamText||DG(a))&&WK(a,b,function(){return LK(a,b,d,!0)});b===sK(a)&&XK(a);return a.configuration.streaming.alwaysStreamText||DG(a)?{variant:c,text:d}:{variant:c,text:null}};
|
|
237
|
+
zK=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=ZK(a,b);WK(a,e,function(){return NK(a,e,b,!0)});e===sK(a)&&XK(a);a.a&&vI(a.a,b,c,d)}};uK=function(a){var b=a.getTrackManager();b&&a.G!==nK&&(b.m&&(FG(b),b.m.trigger(new _.L(_.$v))),XK(a))};XK=function(a){var b=sK(a);if(b){var c=a.Hc.get(b)||[];for(a.Hc["delete"](b);c.length;)c.shift()()}};WK=function(a,b,c){a.Hc.has(b)||a.Hc.set(b,[]);a.Hc.get(b).push(c)};
|
|
238
|
+
jK=function(a,b,c){a.trigger(new _.L(b,{detail:TE(c,QK(a))}))};
|
|
239
|
+
RK=function(a,b){var c=a.w?_.N.Tg(a.w.ga):{},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?tK.includes(q)&&(h.includes(q)||h.push(q)):g.includes(p.keyId)||g.push(p.keyId)}m.allowedByApplication?m.allowedByKeySystem&&(e=!0):f=!0}if(!e)throw new _.O(_.P,4,4012,{hasAppRestrictions:f,
|
|
240
|
+
missingKeys:g,restrictedKeyStatuses:h});};KK=function(a){var b=sK(a);if(null==b)return[];SK(a);return b.variants.filter(function(c){return iH(c)})};$K=function(a){var b=sK(a);if(null==b)return[];SK(a);return b.textStreams.filter(function(c){return!a.Ve.has(c)})};sK=function(a){var b=yF(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};JK=function(a){var b=sK(a);return b&&sH(a.P,b).variant};
|
|
241
|
+
ZK=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};xJ=function(a){if(a.G===nK)throw new _.O(_.P,7,7E3,"Player is destroyed.");};
|
|
242
|
+
aL=function(a,b,c){var d,e,f,g,h,l,m,n,p,q,t,v,z,A,G,E,C,H,M,R;return _.I(function(V){switch(V.a){case 1:return d=_.tq,_.D(V,2),_.y(V,_.Gu(b.url,a.getNetworkEngine(),a.configuration.manifest.attemptParameters,b.type||null),4);case 4:e=V.f;e.configure(a.configuration.manifest);var S=e;var Ba=b.url,Ca=qK(a,a.configuration.id||"");S=S.start(Ba,Ca);return _.y(V,S,5);case 5:f=V.f;rK(f.periods);if(!f.periods.length)throw new _.O(_.P,4,4014);return _.y(V,a.A.stop(),6);case 6:a.A=e;g=c.audio&&c.audio.id;
|
|
243
|
+
h=c.video&&c.video.id;a.f.periods=f.periods;l=vE(f.periods,yF(a.B))||f.periods[0];pK(a)?aH(a.f,_.zi(a.configuration.preferredVideoCodec),_.zi(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount):$G(a.f,_.zi(a.configuration.preferredVideoCodec),_.zi(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount);m=fG(g,h,l.variants);n=UK(a,l.textStreams);vK(a,l.variants);p=m&&m.video;q=m&&m.audio;t=[];v=new Set;z=_.w(l.variants);for(A=z.next();!A.done;A=
|
|
244
|
+
z.next())G=A.value,G.video&&v.add(G.video),G.audio&&v.add(G.audio);E=a.getNetworkEngine();C=_.w(_.eh(v).concat(_.eh(l.textStreams)));for(H=C.next();!H.done;H=C.next())M=H.value,t.push(M.createSegmentIndex(E));return _.y(V,Promise.all(t),7);case 7:HI(a.a,d.AUDIO,q);HI(a.a,d.VIDEO,p);HI(a.a,d.TEXT,n);m&&NK(a,l,m,!1);a.log.info("Switch CDN successful.");_.sh(V,0);break;case 2:R=_.F(V);if(!e){V.F(8);break}return _.y(V,e.stop(),8);case 8:throw R;}})};
|
|
245
|
+
qK=function(a,b){return{networkingEngine:a.getNetworkEngine(),configurationId:b,filterNewPeriod:function(c){return FK(a,c)},filterAllPeriods:function(c){return wK(a,c)},onEvent:function(c){return a.If(c)},onError:function(c){return a.onError(c)},onUpdate:function(c){return vJ(a,c)},onTurnedStatic:function(){return wJ(a)},Ud:function(){return a.h}}};
|
|
246
|
+
pK=function(a){return a.configuration.mediaSource.codecSwitchingStrategy===_.cg&&(_.vk(2)||_.vk(3)||_.vk(4)||_.vk(5)||_.vk(6)||_.wk()&&38===_.Cl().major||_.wk()&&53===_.Cl().major||_.wk()&&68===_.Cl().major?!1:!0)};bL=function(){};cL=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}};
|
|
247
|
+
dL=function(){var a=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(b,c){return a.call(this,b,c-.001)}};eL=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"mp2t"===b.split(/ *; */)[0].split("/")[1].toLowerCase()?!1:a(b)}};fL=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"opus"!==_.kE(b)&&a(b)}};
|
|
248
|
+
gL=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)}};
|
|
249
|
+
hL=function(a){_.Ev.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=_.Wd;c.label===bD&&(this.a=c)}this.a||(this.a=a.addTextTrack(_.JD,bD));this.a.mode=_.we};iL=function(a,b){var c=a.mode;a.mode=c===_.Zf?_.Zf:_.we;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};jL=function(){};_.uj.prototype.f=LD(0,function(){return this.keyInfo});var OD=[112,115,115,104,0,0,0,0];
|
|
250
|
+
_.cE.prototype.Xd=function(){return this.ma?this.ma-this.za+1:null};_.cE.prototype.f=function(){return this.keyInfo};_.kL=0;_.u=_.oE.prototype;_.u.track=function(a){null!=this.player&&qE(this);a&&(this.player=a,this.player.on(_.Rf,this.Uc,this))};_.u.release=function(){qE(this);this.S=[];this.f=this.h=null};
|
|
251
|
+
_.u.append=function(a,b,c){c=void 0===c?null:c;var d=this.h&&null!==c?this.h(c):null;d||this.log.debug("Unable to resolve rendition for ID",c);c={start:a,end:b,rendition:d,width:d?d.width:0,height:d?d.height:0,bandwidth:d?d.bandwidth:0};var e=this.S.find(function(f){return f.start>=a&&f.end<=b});if(e)e.rendition=d,e.width=c.width,e.height=c.height,e.bandwidth=c.bandwidth,e.start=c.start,e.end=c.end;else{d=_.w(this.S);for(e=d.next();!e.done;e=d.next())e=e.value,a>=e.start&&a<e.end?e.end=a:b>=e.start&&
|
|
252
|
+
b<e.end&&(e.start=b);this.S.push(c);this.S.sort(nE)}tE(this);this.Uc();this.player&&this.player.trigger(new _.L(_.Kg))};_.u.clear=function(){this.S=[];tE(this);this.player&&(this.player.trigger(new _.L(_.Kg)),this.player.trigger(new _.L(_.ed)))};
|
|
253
|
+
_.u.Uc=function(){if(this.player){var a=this.player.getMediaPosition();if(0<=a){a:{for(var b=this.S.length,c=Number.MAX_SAFE_INTEGER,d=0;d<b;d++){var e=this.S[d];c=Math.min(e.start,c);if(e.start<=a&&e.end>a){a=.1>e.end-a&&d<b-1?this.S[d+1].rendition:e.rendition;break a}if(e.start>a)break}a=0<b&&c>a&&.25>c-a?this.S[0].rendition:null}if(a&&this.f!==a&&(this.f=a,this.player)){c=b=-1;if(a)b=a.width||-1,c=a.height||-1;else if(d=this.player.getSurface().getMedia())b=d.videoWidth,c=d.videoHeight;this.player.trigger(new _.L(_.gd,
|
|
254
|
+
{detail:{width:b,height:c,bandwidth:a?a.bandwidth:null,rendition:a}}))}}}};EE.prototype.Tb=function(){return this.h};EE.prototype.getDuration=function(){return this.f?this.a-this.h:Infinity};_.u=_.GE.prototype;_.u.xc=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)};
|
|
255
|
+
_.u.isLive=function(){return 2===this.j.version?!this.a.f:Infinity===this.f&&!this.l};_.u.de=function(){return!this.l};UE.prototype.release=function(){this.f=function(){};this.h=function(){};this.a.clear()};UE.prototype.cues=function(){return this.a};YE.prototype.release=function(){this.f=this.j=this.h=this.a=null};YE.prototype.l=function(a){YD(this.a,a);ZE(this)};
|
|
256
|
+
$E.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=aF(this);return{value:a,done:!a}};_.u=_.bF.prototype;_.u.destroy=function(){this.a=[];return Promise.resolve()};
|
|
257
|
+
_.u.Wc=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};
|
|
258
|
+
_.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.Ea-=a};
|
|
259
|
+
_.u.wd=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};
|
|
260
|
+
_.u.qa=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 _.uj(f.position,g.startTime,g.endTime,g.Xa,g.za,g.ma,g.Ea,g.keyInfo,g.$c,g.timescale,g.horizontalTiles,g.verticalTiles,g.durationPerTile,null,null,g.le,g.Na),b.push(f)):b.push(f),d++),e++)}for(;d<this.a.length;)b.push(this.a[d++]);
|
|
261
|
+
if(b.length)for(d=b[b.length-1].position+1;e<a.length;)f=a[e++],f=new _.uj(d++,f.startTime,f.endTime,f.Xa,f.za,f.ma,f.Ea,f.keyInfo,f.$c,f.timescale,f.horizontalTiles,f.verticalTiles,f.durationPerTile,null,null,f.le,f.Na),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 _.uj(e-d--,f.startTime,f.endTime,f.Xa,f.za,f.ma,f.Ea,f.keyInfo,f.$c,f.timescale,f.horizontalTiles,f.verticalTiles,f.durationPerTile,null,null,
|
|
262
|
+
f.le,f.Na));b=_.w(b);for(f=b.next();!f.done;f=b.next())a.push(f.value)}this.a=a};_.u.replace=function(a){this.a=a};gF.prototype.release=function(){this.h=null;this.f=function(){}};kF.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};kF.prototype.af=function(){this.A=!0;jF(this)};lF.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};
|
|
263
|
+
pF.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};wF.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(){}};BF.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()};
|
|
264
|
+
DF.prototype.release=function(){this.j=null;this.o.clear();this.a=function(){};this.f=function(){};this.h=function(){}};DF.prototype.l=function(a,b,c){if(this.j)for(var d={},e=_.w(this.j.cues()),f=e.next();!f.done;d={vf:d.vf,te:d.te},f=e.next()){f=f.value;d.vf=this.o.get(f)||null;d.te=CF(f,a);this.o.set(f,d.te);var g=this.w.find(function(h){return function(l){return l.Gc===h.vf&&l.Fc===h.te}}(d));g&&g.zc(f,b&&0===c)}};_.x(NF,_.wm);
|
|
265
|
+
NF.prototype.destroy=function(){this.B=this.h=this.A=null;this.o.clear();this.l.clear();this.j.clear();this.w.clear();null!=this.a&&(this.a.stop(),this.a=null);return this.C.destroy()};_.u=WF.prototype;_.u.destroy=function(){this.j=this.w=null;this.o.clear();return Promise.resolve()};_.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.Oa=function(){return this.a};
|
|
266
|
+
_.u.ha=function(){return this.f};_.u.Jb=function(a){return null==this.a||null==this.f?!1:a>=this.a&&a<this.f};_.u.Ba=function(a){return null==this.f||this.f<a?0:this.f-Math.max(a,this.a)};_.x(pG,_.kl);_.u=pG.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 qG(this,_.Jk)};_.u.getAudioTracks=function(){return qG(this,_.Ik)};_.u.ja=function(){return qG(this,_.U)};_.u.ka=function(){return this.a.get(_.Jk)||null};_.u.Va=function(){return this.a.get(_.Ik)||null};_.u.Sa=function(){return this.a.get(_.U)||null};
|
|
267
|
+
_.u.rb=function(){return this.f.get(_.Jk)||null};_.u.Db=function(){return this.f.get(_.Ik)||null};_.u.Eb=function(){return this.f.get(_.U)||null};_.u.Ia=function(){return rG(this,_.Jk)};_.u.oa=function(){return rG(this,_.Ik)};_.u.ya=function(){return rG(this,_.U)};_.u.zb=function(a){this.m&&sG(this,_.Jk,a)};_.u.Fa=function(a){this.m&&sG(this,_.Ik,a)};_.u.Ta=function(a){this.m&&sG(this,_.U,a)};
|
|
268
|
+
_.u.jb=function(a,b){b=void 0===b?!1:b;if(this.m)if(a)yG(this,a,b);else{var c=b,d=rG(this,_.Jk);d&&(this.g.info("Unset video rendition."),d.trickPlay?this.g.info("Enabling ABR for trick play tracks is not supported"):(this.g.info("Enable ABR."),xG(this.m,null,c)))}};_.u.xb=function(a){this.m&&(a?(vG(this,a,_.Ik),uG(this,a,_.Ik)&&(this.g.info("Set audio rendition with ID: "+a.id),this.f.set(_.Ik,a),PK(this.m,parseInt(a.id,10)))):this.g.info("Enabling ABR for audio is not supported"))};
|
|
269
|
+
_.u.addTextTrack=function(a){var b=this;return _.I(function(c){return b.m?_.y(c,b.m.addTextTrack(a.url,a.language,a.kind,a.mimeType,a.codec,a.label),0):c["return"]()})};_.u.ta=function(){return!!this.m&&this.m.ta()};
|
|
270
|
+
_.u.yb=function(a){if(this.m){var b=a;if(!a){var c=this.Sa();if(c&&c.track.kind!==_.se){a=this.ja().find(function(e){return e.kind===_.se&&e.language===c.track.language});if(!a){var d=this.oa();d&&(a=this.ja().find(function(e){return e.kind===_.se&&e.language===d.language}))}a&&(b=a.renditions[0])}}b?BG(this,b):CG(this)}};pG.prototype.setTextRendition=pG.prototype.yb;pG.prototype.isAbrEnabled=pG.prototype.ta;pG.prototype.addTextTrack=pG.prototype.addTextTrack;pG.prototype.setAudioRendition=pG.prototype.xb;
|
|
271
|
+
pG.prototype.setVideoRendition=pG.prototype.jb;pG.prototype.setTextTrack=pG.prototype.Ta;pG.prototype.setAudioTrack=pG.prototype.Fa;pG.prototype.setVideoTrack=pG.prototype.zb;pG.prototype.getTextTrack=pG.prototype.ya;pG.prototype.getAudioTrack=pG.prototype.oa;pG.prototype.getVideoTrack=pG.prototype.Ia;pG.prototype.getLoadingTextRendition=pG.prototype.Eb;pG.prototype.getLoadingAudioRendition=pG.prototype.Db;pG.prototype.getLoadingVideoRendition=pG.prototype.rb;pG.prototype.getTextRendition=pG.prototype.Sa;
|
|
272
|
+
pG.prototype.getAudioRendition=pG.prototype.Va;pG.prototype.getVideoRendition=pG.prototype.ka;pG.prototype.getTextTracks=pG.prototype.ja;pG.prototype.getAudioTracks=pG.prototype.getAudioTracks;pG.prototype.getVideoTracks=pG.prototype.getVideoTracks;HG.prototype.init=function(a){var b=muxjs.mp4.probe;a=_.Fj(a);this.l=b.videoTrackIds(a);this.j=b.timescale(a)||{};this.a.init()};HG.prototype.h=function(a,b){var c=_.Fj(a);(c=this.a.parse(c,this.l,this.j))&&c.captions&&b(c.captions);this.a.clearParsedCaptions()};HG.prototype.f=function(){this.a.resetCaptionStream()};_.IG.prototype.init=function(){};_.IG.prototype.h=function(){};_.IG.prototype.f=function(){};_.u=_.KG.prototype;
|
|
273
|
+
_.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"]($D));for(e=1;e<d.length;++e)d[e].p["catch"]($D),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=
|
|
274
|
+
{};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=_.tq,_.y(f,d.J,2);a.forEach(function(g,h){var l=_.sl(g.mimeType,g.codecs);if(h===e.TEXT)d.jc(l);else{var m=new Map;m.set(h,l);if((!_.Gt(l)||!b||g.aesEncrypted)&&_.rl(l,h)){var n=_.rl(l);n&&(m=n(),d.w[h]=m,m=m.demuxMimeTypes(h,l),c&&m["delete"](e.AUDIO))}NG(d,m)}});_.B(f)})};_.u.Yi=function(){this.g.debug(fD);Object.values(this.w).forEach(function(a){return a.reset()})};
|
|
275
|
+
_.u.mi=function(){return this.L.streaming.ignoreManagedMediaSourceStreamingHints?!0:this.M};_.u.jc=function(a){this.a||(this.a=new WF(this.L,this.C));XF(this.a,a)};_.u.Ge=function(){return this.o?this.o.readyState===_.pe:!0};_.u.Oa=function(a){return a===_.Q?this.a.Oa():(a=OG(this,a))?a.Oa():null};_.u.ha=function(a){return a===_.Q?this.a.ha():(a=OG(this,a))?a.ha():null};_.u.Jb=function(a,b,c){return a===_.Q?this.a.Jb(b):(a=OG(this,a))?a.Jb(b,!1,c):!1};
|
|
276
|
+
_.u.Ba=function(a,b){if(a===_.Q)return this.a.Ba(b);var c=OG(this,a);return c?c.Ba(b):0};_.u.Tf=function(){var a={};a.total=new _.vm(this.j.buffered,"total");a.audio=OG(this,_.Zc);a.video=OG(this,_.r);var b=[];this.a&&(b=[{start:this.a.Oa(),end:this.a.ha()}]);a.text=lE(b,_.Q);return a};
|
|
277
|
+
_.u.Fe=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=YF(this.a,b,c,d):this.w[a]?(b=this.w[a].transmux(b),b.captions&&0<b.captions.length&&(this.a||this.jc(_.og),$F(this.a,b.captions,c,d,this.f.video.timestampOffset)),e=[],0<b.audio.byteLength&&this.f.audio&&e.push(QG(this,_.Zc,this.Kf.bind(this,_.Zc,b.audio.buffer))),0<b.video.byteLength&&this.f.video&&e.push(QG(this,
|
|
278
|
+
_.r,this.Kf.bind(this,_.r,b.video.buffer))),b=Promise.all(e)):(e&&window.muxjs&&(this.a||this.jc(_.og),null==c&&null==d?this.H.init(b):this.H.h(b,function(p){p.length&&$F(h.a,p,c,d,h.f.video.timestampOffset)})),b=QG(this,a,this.Kf.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(CC,c,d,EC,PG(h,a));else if(a===_.Zc&&null!==c&&null!==d)rE(h.B),null!==c&&null!==d&&h.g.debug(BC,c,d,EC,PG(h,a));else if(a===_.r&&null!==c&&null!==
|
|
279
|
+
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(HC+t+nC+(a+vC)+(c+mC)+(p+uC)),p=QG(h,a,function(){h.ph(a,t)}),q=QG(h,a,h.mh.bind(h,a,!1)),Promise.all([p,q])}null!==c&&null!==d&&(h.G[a]=!0)})["catch"](function(p){throw p;})};_.u.oh=function(a){var b=this.ha(_.r)||0;ZF(this.a,a,b)};
|
|
280
|
+
_.u.gh=function(){this.a&&ZF(this.a,"",0)};_.u.remove=function(a,b,c){var d=this;return a===_.Q?this.a.remove(b,c):QG(this,a,this.nh.bind(this,a,b,c)).then(function(){if(a===_.r){var e=d.Oa(a),f=d.ha(a);null!==e&&null!==f&&uE(d.B,e,f)}else a===_.Zc&&sE(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 QG(this,a,this.nh.bind(this,a,0,this.o.duration))};
|
|
281
|
+
_.u.flush=function(a){return a===_.Q?Promise.resolve():QG(this,a,this.mh.bind(this,a))};_.u.$i=function(a,b,c,d){var e=this,f,g;return _.I(function(h){f=_.tq;if(a===f.TEXT){e.a.A=b;var l=e.a;l.h=c;l.l=d;return h["return"]()}g=RG(e,a,b,c,d);e.K&&(g=g.concat(RG(e,f.AUDIO,b,c,d)));return _.y(h,Promise.all(g),0)})};_.u.endOfStream=function(a){var b=this;return UG(this,function(){b.Ge()||(a?b.o.endOfStream(a):b.o.endOfStream())})};_.u.Lf=function(a){var b=this;UG(this,function(){b.o.duration=a})};
|
|
282
|
+
_.u.getDuration=function(){return this.o.duration};_.u.Kf=function(a,b){this.g.debug(DC+a+oC);try{this.f[a].appendBuffer(b)}catch(c){throw this.g.warn(PC+a,c),c;}this.g.debug(JC+a+oC)};_.u.nh=function(a,b,c){if(c<=b)this.Xc(a);else{this.g.debug(eD+a+rC,b,c);try{this.f[a].remove(b,c)}catch(d){throw this.g.warn(RC+a+pC,b,c,d),d;}this.g.debug(LC+a+rC,b,c)}};
|
|
283
|
+
_.u.yk=function(a){try{this.g.debug(AC+a+oC);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(OC+a+oC,d),d;}this.g.debug(IC+a+oC);this.Xc(a)};_.u.mh=function(a){try{this.j.readyState>HTMLMediaElement.HAVE_NOTHING?(this.g.debug(UC+a),this.j.currentTime-=.001):this.g.warn(jD+a+tC+this.j.readyState)}catch(b){throw this.g.warn(QC+a,b),b;}this.g.debug(KC+a);this.Xc(a)};
|
|
284
|
+
_.u.ph=function(a,b){0>b&&(b+=.001);try{this.g.debug(iD+a,b),this.f[a].timestampOffset=b}catch(c){throw this.g.warn(TC+a,b,c),c;}this.g.debug(NC+a,b);this.Xc(a)};_.u.Ak=function(a,b,c){try{this.g.debug(gD+a,b,c),this.f[a].appendWindowStart=0,this.f[a].appendWindowEnd=c,this.f[a].appendWindowStart=b}catch(d){throw this.g.warn(SC+a,b,c,d),d;}this.g.debug(MC+a,b,c);this.Xc(a)};_.u.zk=function(a){this.h[a][0].p.reject(new _.O(_.P,3,3014,{mediaError:this.j.error?this.j.error.code:0}))};
|
|
285
|
+
_.u.Xc=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug(mD+a),TG(this,a))};_.u.getTextDisplayer=function(){return this.C};var MG=window.URL.createObjectURL;_.u=_.lH.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};
|
|
286
|
+
_.u.chooseTrack=function(){var a=mH(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=mH(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;
|
|
282
287
|
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};
|
|
283
|
-
_.u.segmentDownloaded=function(a,b){this.g.debug("Segment downloaded:","deltaTimeMs\x3d"+a,"numBytes\x3d"+b,"lastTimeChosenMs\x3d"+this.h,"enabled\x3d"+this.l);
|
|
288
|
+
_.u.segmentDownloaded=function(a,b){this.g.debug("Segment downloaded:","deltaTimeMs\x3d"+a,"numBytes\x3d"+b,"lastTimeChosenMs\x3d"+this.h,"enabled\x3d"+this.l);IF(this.w,a,b);if(null!=this.h&&this.l)a:{this.g.debug("Suggesting Streams...");if(!this.B){if(!(128E3<=this.w.a)){this.g.debug("Still waiting for a good estimate...");break a}this.B=!0;if(this.a.useSwitchIntervalForInitialSwitch&&Date.now()-this.h<1E3*this.a.switchInterval){this.g.debug("Skipping initial estimation switch due to switch interval...");
|
|
284
289
|
break a}}else if(Date.now()-this.h<1E3*this.a.switchInterval){this.g.debug("Still within switch interval...");break a}var c=this.chooseTrack(),d=this.getBandwidthEstimate();this.g.debug("Calling switch_(), bandwidth\x3d"+Math.round(d/1E3)+" kbps");c&&this.A(c)}};_.u.playbackRateChanged=function(a){this.o=a};
|
|
285
|
-
_.u.getBandwidthEstimate=function(){if(this.j&&this.a.useCmsd){var a=
|
|
286
|
-
|
|
287
|
-
for(var d=a.next();!d.done;d=a.next())c.add(d.value,!b);return c};
|
|
288
|
-
_.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"](
|
|
289
|
-
{};a.I=null;a.
|
|
290
|
-
_.u.
|
|
291
|
-
_.u.
|
|
292
|
-
_.u.Fe=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=
|
|
293
|
-
_.r,this.Jf.bind(this,_.r,b.video.buffer))),b=Promise.all(e)):(e&&window.muxjs&&(this.f||this.
|
|
294
|
-
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.
|
|
295
|
-
_.u.gh=function(){this.f&&
|
|
296
|
-
_.u.flush=function(a){return a===_.Q?Promise.resolve():
|
|
297
|
-
_.u.Lf=function(a){var b=this;
|
|
298
|
-
_.u.kh=function(a){try{this.j.readyState>HTMLMediaElement.HAVE_NOTHING?(this.g.debug(
|
|
299
|
-
_.u.start=function(){var a=this,b,c,d;return _.I(function(e){if(1==e.a){b=a.D.
|
|
300
|
-
a.D.
|
|
301
|
-
_.u.
|
|
302
|
-
f=_.w(b.a.values());for(g=f.next();!g.done;g=f.next())h=g.value,h.kb=null;return m["return"]()}b.g.debug("End of stream reached, calling ms.endOfStream().");return _.y(m,b.D.
|
|
303
|
-
_.u.
|
|
304
|
-
_.u.
|
|
305
|
-
_.u.unload=function(){var a=this,b;return _.I(function(c){if(1==c.a){
|
|
306
|
-
_.u.getBufferInfo=function(a){if(this.L){var b=this.L.Tf(),c=new _.
|
|
307
|
-
_.u.seek=function(a){if(this.Pg&&!this.Pg(a))return Promise.resolve();var b=this.be;b=b.a?a+b.a.
|
|
308
|
-
_.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,_.
|
|
309
|
-
_.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 _.
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
_.u.appendLoad=function(a){var b=this,c;return _.I(function(d){if(1==d.a){
|
|
313
|
-
_.u.jh=function(){var a=this;return _.I(function(b){
|
|
314
|
-
_.u.load=function(a){return
|
|
315
|
-
_.u.getSeekRange=function(){var a={start:0,end:0};if(this.f){var b=this.f.presentationTimeline;a={start:
|
|
316
|
-
_.u.setPlaybackRate=function(a,b){if(0===a)this.log.warn("A trick play rate of 0 is unsupported!");else if(this.G
|
|
317
|
-
d),_.
|
|
318
|
-
_.u.getStats=function(){if(this.G
|
|
319
|
-
_.u.getTimelineCues=function(){return this.K?
|
|
320
|
-
_.u.addTextTrack=function(a,b,c,d,e,f){var g=this,h,l,m,n,p,q,t,v,z;return _.I(function(A){if(1==A.a){if(g.G
|
|
321
|
-
findSegmentPosition:function(){return 1},getSegmentReference:function(
|
|
322
|
-
2)}if(z=_.
|
|
323
|
-
_.u.
|
|
324
|
-
_.u.
|
|
325
|
-
_.u.
|
|
326
|
-
|
|
327
|
-
_.u
|
|
328
|
-
_.y(n,b.
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
_.
|
|
332
|
-
_.u.append=function(a){function b(e){if(e.startTime>=e.endTime)_.
|
|
333
|
-
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;
|
|
290
|
+
_.u.getBandwidthEstimate=function(){if(this.j&&this.a.useCmsd){var a=WD(this.j,_.re);a=null==a?null:a;if(null!==a)return this.g.debug("Using CMSD estimatedThroughputKbps:",a),1E3*a}return JF(this.w,this.a.defaultBandwidthEstimate)};_.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 HF;var a=this.chooseTrack();a&&this.A(a)};qH.prototype.clear=function(){this.a.clear()};tH.prototype.add=function(a,b){var c=void 0===b?!0:b;if(wH(this.f,a,void 0===c?!0:c))return this.a.add(a),!0;_.Hh("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};tH.prototype.values=function(){return this.a.values()};yH.prototype.create=function(a){var b=this,c=this.a===_.cg&&mE(),d=a.filter(function(e){return wH(b.f,e,!c)});return d.length?new tH(d[0],d):this.h.create(a)};
|
|
291
|
+
xH.prototype.create=function(a){var b=zH(a,this.j);0<b.length&&(a=b);b=!1;if(this.a){var c=AH(a,this.a);0<c.length?(a=c,b=!0):_.Hh("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=WG(a,this.f),b.length?a=b:_.Hh("No exact match for the channel count could be found."));b=BH(a,this.l);b.length?a=b:_.Hh("No exact match for spatial audio could be found.");b=this.h===_.cg&&mE();c=new tH(a[0]);a=_.w(a);
|
|
292
|
+
for(var d=a.next();!d.done;d=a.next())c.add(d.value,!b);return c};EH.prototype.getState=function(){return this.a};var DH=0,CH=1;GH.prototype.release=function(){this.f.release()};_.u=IH.prototype;
|
|
293
|
+
_.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"]($D));for(e=1;e<d.length;++e)d[e].p["catch"]($D),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=
|
|
294
|
+
{};a.I=null;a.M=!1;for(var g in a.h);a.h={}})};_.u.open=function(){return this.L};_.u.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e;return _.I(function(f){if(1==f.a)return e=_.tq,_.y(f,d.L,2);a.forEach(function(g,h){var l=_.sl(g.mimeType,g.codecs);if(h===e.TEXT)d.jc(l);else{var m=new Map;m.set(h,l);if((!_.Gt(l)||!b||g.aesEncrypted)&&_.rl(l,h)){var n=_.rl(l);n&&(m=n(),d.w[h]=m,m=m.demuxMimeTypes(h,l),c&&m["delete"](e.AUDIO))}KH(d,m)}d.h[h]=[]});_.B(f)})};_.u.Yi=function(){this.g.debug(fD);Object.values(this.w).forEach(function(a){return a.reset()})};
|
|
295
|
+
_.u.mi=function(){return this.J.streaming.ignoreManagedMediaSourceStreamingHints?!0:this.P};_.u.jc=function(a){this.f||(this.f=new WF(this.J,this.C));XF(this.f,a)};_.u.Ge=function(){return this.o?this.o.readyState===_.pe:!0};_.u.Oa=function(a){return a===_.Q?this.f.Oa():(a=LH(this,a))?a.Oa():null};_.u.ha=function(a){return a===_.Q?this.f.ha():(a=LH(this,a))?a.ha():null};_.u.Jb=function(a,b,c){return a===_.Q?this.f.Jb(b):(a=LH(this,a))?a.Jb(b,!1,c):!1};
|
|
296
|
+
_.u.Ba=function(a,b){if(a===_.Q)return this.f.Ba(b);var c=LH(this,a);return c?c.Ba(b):0};_.u.Tf=function(){var a={};a.total=new _.vm(this.j.buffered,"total");a.audio=LH(this,_.Zc);a.video=LH(this,_.r);var b=[];this.f&&(b=[{start:this.f.Oa(),end:this.f.ha()}]);a.text=lE(b,_.Q);return a};
|
|
297
|
+
_.u.Fe=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=YF(this.f,b,c,d):this.w[a]?(b=this.w[a].transmux(b),b.captions&&0<b.captions.length&&(this.f||this.jc(_.og),$F(this.f,b.captions,c,d,this.a.video.timestampOffset)),e=[],0<b.audio.byteLength&&this.a.audio&&e.push(NH(this,_.Zc,this.Jf.bind(this,_.Zc,b.audio.buffer))),0<b.video.byteLength&&this.a.video&&e.push(NH(this,
|
|
298
|
+
_.r,this.Jf.bind(this,_.r,b.video.buffer))),b=Promise.all(e)):(e&&window.muxjs&&(this.f||this.jc(_.og),null==c&&null==d?this.I.init(b):this.I.h(b,function(p){p.length&&$F(h.f,p,c,d,h.a.video.timestampOffset)})),b=NH(this,a,this.Jf.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(CC,c,d,EC,MH(h,a));else if(a===_.Zc&&null!==c&&null!==d)rE(h.B),null!==c&&null!==d&&h.g.debug(BC,c,d,EC,MH(h,a));else if(a===_.r&&null!==c&&null!==
|
|
299
|
+
d&&g){var p=l.buffered.length,q=0<p?l.buffered.end(p-1):-1;0>m&&0<p&&(m=l.buffered.start(0));0<=m&&0<q&&h.B.append(m,q,f)}if(!h.H[a]&&l&&1===l.buffered.length){p=l.buffered.start(0);var t=c-p;if(Math.abs(t)>h.U&&0===l.timestampOffset)return h.g.warn(HC+t+nC+(a+vC)+(c+mC)+(p+uC)),p=NH(h,a,function(){OH(h,a,t)}),q=NH(h,a,h.kh.bind(h,a,!1)),Promise.all([p,q])}null!==c&&null!==d&&(h.H[a]=!0)})["catch"](function(p){throw p;})};_.u.oh=function(a){var b=this.ha(_.r)||0;ZF(this.f,a,b)};
|
|
300
|
+
_.u.gh=function(){this.f&&ZF(this.f,"",0)};_.u.remove=function(a,b,c){var d=this;return a===_.Q?this.f.remove(b,c):NH(this,a,this.lh.bind(this,a,b,c)).then(function(){if(a===_.r){var e=d.Oa(a),f=d.ha(a);null!==e&&null!==f&&uE(d.B,e,f)}else a===_.Zc&&sE(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 NH(this,a,this.lh.bind(this,a,0,this.o.duration))};
|
|
301
|
+
_.u.flush=function(a){return a===_.Q?Promise.resolve():NH(this,a,this.kh.bind(this,a))};_.u.$i=function(a,b,c,d,e,f){var g=this,h,l,m;return _.I(function(n){if(1==n.a){h=_.tq;if(a===h.TEXT){g.f.A=b;var p=g.f;p.h=c;p.l=d;return n["return"]()}return _.y(n,UH(g,a,e,f),2)}l=n.f;m=PH(g,a,b,c,d,l);g.M&&(m=m.concat(PH(g,h.AUDIO,b,c,d,l)));return _.y(n,Promise.all(m),0)})};_.u.endOfStream=function(a){var b=this;return SH(this,function(){b.Ge()||(a?b.o.endOfStream(a):b.o.endOfStream())})};
|
|
302
|
+
_.u.Lf=function(a){var b=this;SH(this,function(){b.o.duration=a})};_.u.getDuration=function(){return this.o.duration};_.u.Jf=function(a,b){this.g.debug(DC+a+oC);try{this.a[a].appendBuffer(b)}catch(c){throw this.g.warn(PC+a,c),c;}this.g.debug(JC+a+oC)};_.u.lh=function(a,b,c){if(c<=b)this.tc(a);else{this.g.debug(eD+a+rC,b,c);try{this.a[a].remove(b,c)}catch(d){throw this.g.warn(RC+a+pC,b,c,d),d;}this.g.debug(LC+a+rC,b,c)}};
|
|
303
|
+
_.u.kh=function(a){try{this.j.readyState>HTMLMediaElement.HAVE_NOTHING?(this.g.debug(UC+a),this.j.currentTime-=.001):this.g.warn(jD+a+tC+this.j.readyState)}catch(b){throw this.g.warn(QC+a,b),b;}this.g.debug(KC+a);this.tc(a)};_.u.xk=function(a){this.h[a][0].p.reject(new _.O(_.P,3,3014,{mediaError:this.j.error?this.j.error.code:0}))};_.u.tc=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug(mD+a),RH(this,a))};_.u.getTextDisplayer=function(){return this.C};var JH=window.URL.createObjectURL;VH.prototype.release=function(){this.a=this.h=null;this.f=function(){}};VH.prototype.l=function(a){var b=this.a,c=this.h.periods;a=vE(c,a)||c[0];b!==a&&this.f(a);this.a=a};XH.prototype.getConfiguration=function(){return this.j};XH.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};XH.prototype.set=function(a,b){this.h=a;aI(this,b)};var dI=new _.Sp(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=_.gI.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,rI(e),b.push(sI(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;_.B(f)})};
|
|
304
|
+
_.u.start=function(){var a=this,b,c,d;return _.I(function(e){if(1==e.a){b=a.D.Rb();c=vE(a.j.periods,b+_.Sv);if(!c)throw new _.O(_.P,5,5006,"No period found.");d=a.D.eg(c);if(!d.variant&&!d.text)throw a.g.error("start(): No streams chosen"),new _.O(_.P,5,5005,"No streams chosen.");a.C=!d.variant&&!!d.text;return _.y(e,OI(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.Nm&&(a.g.debug("init: calling onInitialStreamsSetup()..."),
|
|
305
|
+
a.D.Nm());_.B(e)})};_.u.resume=function(){if(!DI(this))for(var a=_.w(this.a.values()),b=a.next();!b.done;b=a.next())b=b.value,b.endOfStream=!1,pI(this,b,0)};
|
|
306
|
+
_.u.Yb=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=AI(a);if(a.vb||null==a.kb||a.rc)return m["return"]();a.kb=null;if(!a.cc){m.F(2);break}b.g.debug(c,"skipping update and clearing the buffer");return _.y(m,FI(b,a,a.lf,a.De),3);case 3:return m["return"]();case 2:_.D(m,4);d=TI(b,a);null!=d&&(pI(b,a,d),a.ed=!1);_.sh(m,5);break;case 4:return e=_.F(m),_.y(m,dJ(b,e),6);case 6:return m["return"]();case 5:iJ(b,a);if(!EI(b)){m.F(0);break}if(b.D.configuration.gm){b.g.debug("End of stream reached, keeping MediaSource open.");
|
|
307
|
+
f=_.w(b.a.values());for(g=f.next();!g.done;g=f.next())h=g.value,h.kb=null;return m["return"]()}b.g.debug("End of stream reached, calling ms.endOfStream().");return _.y(m,b.D.V.endOfStream(),8);case 8:if(b.f)return m["return"]();l=b.D.V.getDuration();l<b.j.presentationTimeline.getDuration()&&(b.j.presentationTimeline.f=l);b.D.Bi();_.B(m)}})};
|
|
308
|
+
_.u.jn=function(a,b,c,d){var e=ND(d.reader),f=ND(d.reader),g=_.ln(d.reader),h=_.ln(d.reader),l=_.ln(d.reader),m=_.ln(d.reader);d=_.pn(d.reader,d.reader.Pa()-d.reader.getPosition());a=a.startTime+b.startTime+h/g;if(c.includes(e))if("urn:mpeg:dash:event:2012"===e)this.D.Gi();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}}))};
|
|
309
|
+
_.u.mo=function(a){var b=this,c=!1,d=0;(new _.qn).N(_.Te,_.rn).N(_.rg,_.rn).N(_.Oe,_.rn).N(_.Se,_.rn).N(_.hg,_.rn).X(_.jg,_.sn).N("encv",function(e){e.reader.skip(78);_.rn(e)}).N("pasp",function(e){d=e.start+e.headerSize;var f=_.ln(e.reader),g=_.ln(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 _.cn(new DataView(a.data)),a.seek(d),_.W(a,1),_.W(a,1))};_.x(oJ,_.Gm);_.u=oJ.prototype;_.u.init=function(a,b){var c=a.getMedia();_.Gm.prototype.init.call(this,a,b);AJ(this,c)};_.u.namespace=function(){return tD};_.u.setSeekInterceptor=function(a){this.Pg=a||null};_.u.setPlaybackSessionId=function(a){this.Kg=a};_.u.Dh=function(){return new pG};_.u.getState=function(){return this.bb};_.u.getDrmInfo=function(){return this.w?this.w.getDrmInfo():null};
|
|
310
|
+
_.u.unload=function(){var a=this,b;return _.I(function(c){if(1==c.a){zG(a,!1);a.Zd=!1;if(!a.Z)return c["return"]();a.log.debug("Unload player with source",a.Z);(b=a.getTrackManager())&&b.release();return a.G===nK?c["return"]():_.y(c,ZJ(a),2)}a.Z=null;a.Ng=0;a.Oc=null;a.fa=null;a.getNetworkEngine().headers["delete"](oD);_.B(c)})};_.u.release=function(){var a=this;return _.I(function(b){if(a.ba)return b["return"](a.ba);a.ba=rJ(a);a.ba["finally"](function(){a.ba=null});return b["return"](a.ba)})};
|
|
311
|
+
_.u.getBufferInfo=function(a){if(this.L){var b=this.L.Tf(),c=new _.vm(void 0,a);switch(a){case _.Jk:return b.video?b.video:c;case _.Ik:return b.audio?b.audio:c;case _.U:return b.text?b.text:c}return b.total?b.total:c}return this.Qc?(b=pE(this.Qc),lE(b,a)):_.Gm.prototype.getBufferInfo.call(this,a)};_.u.getPosition=function(){var a=this.be,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?yF(this.B):_.Gm.prototype.getMediaPosition.call(this)};
|
|
312
|
+
_.u.seek=function(a){if(this.Pg&&!this.Pg(a))return Promise.resolve();var b=this.be;b=b.a?a+b.a.Tb():a;b!==a&&this.log.info("Seeking to "+a+" s corresponding to media time of "+(b+" s."));return _.Gm.prototype.seek.call(this,b)};_.u.getPresentationStartTime=function(){return this.f?this.f.presentationTimeline.getPresentationStartTime():null};_.u.getDuration=function(){var a=this.be,b=this.getMediaDuration();return a.a?a.a.getDuration():b};
|
|
313
|
+
_.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,_.Gm.prototype.destroy.call(a),2);if(a.G===nK)return b["return"]();a.log.debug("Destroying player...");a.G=nK;zJ(a);a.l&&(a.l.release(),a.l=null);a.Pd=null;a.h=null;_.B(b)})};_.u.getTimeline=function(){return this.Pd};
|
|
314
|
+
_.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 _.mk,b.o.a=c,_.D(z,2),xJ(b),b.Y=_.Eb,_.y(z,aK(b),4);case 4:return pH(b.o,c),d=a[0],d.playlist&&d.playlist.startTime&&(d.startTime=d.playlist.startTime),b.Z=_.mq(d),b.configuration=_.Em(b.Ha,d),b.log.info("Loading playlist configurations",a),b.Pd=sJ(b.configuration),_.y(z,bK(b,c),5);case 5:return pH(b.o,c),e=a.map(function(A){return cK(b,A,0,null,!0)}),_.y(z,Promise.all(e),6);case 6:f=
|
|
315
|
+
z.f;g=f.filter(function(A){return A.manifest.presentationTimeline.isLive()});if(h=g[0])b.A=h.parser;if(1<g.length)throw new _.O(_.P,7,7003,"Playlist of multiple live streams is not supported.");if(h){l=b.configuration.playlist.content;if(l===_.hc)throw new _.O(_.P,7,7003,"Cannot play live content in VOD mode.");if("IPR"===l&&h!==f[f.length-1])throw new _.O(_.P,7,7003,"Wrong order of playlist assets.");}m=null==h;n=new _.GE({version:2},null,0,m);p=f.map(function(A){return iG(A.manifest)});q=lG(p,n);
|
|
316
|
+
b.f=q;t=b;return _.y(z,dK(b,q,b.configuration),7);case 7:return t.w=z.f,pH(b.o,c),_.y(z,eK(b,c),8);case 8:pH(b.o,c);xI(b.a,q);uJ(b,q);c.resolve();_.sh(z,0);break;case 2:v=_.F(z);if(!b.A){z.F(9);break}return _.y(z,b.A.stop(),10);case 10:b.A=null;case 9:fK(b,v,c),_.B(z)}})};
|
|
317
|
+
_.u.appendLoad=function(a){var b=this,c;return _.I(function(d){if(1==d.a){xJ(b);if(b.Y!==_.Eb)throw new _.O(_.P,7,7003,"Cannot append-load to non-playlist player.");return _.y(d,mK(b,a),2)}c=d.f;b.f=c.manifest;b.A=c.parser;xI(b.a,c.manifest);EI(b.a)&&b.a.resume();uJ(b,c.manifest);_.B(d)})};_.u.seekWith=function(a){return this.seek(this.getPosition()+a)};
|
|
318
|
+
_.u.jh=function(){var a=this;return _.I(function(b){xJ(a);if(!a.cf)return a.log.warn("No preloaded asset found"),b["return"]();a.log.info("Loading preloaded asset",a.cf);a.cf=null;return _.y(b,eK(a,null),0)})};_.u.preload=function(a){var b=this;return _.I(function(c){if(1==c.a)return xJ(b),_.Bo("preload.start"),b.log.info("Preloading asset",a),_.y(c,gK(b,a,!1),2);b.cf=a;b.log.info("Preloaded asset",a);_.Bo("preload.end");_.Co("preload","preload.start","preload.end");_.B(c)})};
|
|
319
|
+
_.u.load=function(a){return gK(this,a)};_.u.detach=function(){var a=this;return _.I(function(b){if(1==b.a)return _.y(b,yJ(a),2);a.configuration=a.Ha;zJ(a);_.B(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.Ki=function(){this.log.debug("User seeking finished");this.J&&GK(this);HK(this)};
|
|
320
|
+
_.u.getSeekRange=function(){var a={start:0,end:0};if(this.f){var b=this.f.presentationTimeline;a={start:HE(b),end:RE(b)}}b=this.be;b.a?(b=b.a.getDuration(),b>a.end&&(b=a.end),b={start:0,end:b}):b=a;return b};_.u.xc=function(){return this.f?this.f.presentationTimeline.xc():null};_.u.getPlaybackRate=function(){if(this.I){var a=this.I;a=a.l?0:a.h}else a=0;return a};
|
|
321
|
+
_.u.setPlaybackRate=function(a,b){if(0===a)this.log.warn("A trick play rate of 0 is unsupported!");else if(this.G===nJ){if(_.vk()){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.kc&&(c.g.debug("Engaging trick mode stream",
|
|
322
|
+
d),_.uI(c,d,!1,0),e.kc=f);else if(f=e.kc)c.g.debug("Restoring non-trick-mode stream",f),e.kc=null,_.uI(c,f,!0,0)}}this.h.playbackRateChanged(a)}};_.u.ja=function(){if(this.f&&this.B){var a=sK(this);if(null==a)a=null;else{if(!sH(this.P,a).text){var b=_.kH(a.textStreams,this.Ld,this.Se,this.Bd);b.length&&(b=b[0],sH(this.P,a).text=b)}a=sH(this.P,a).text}b=[];for(var c=_.w($K(this)),d=c.next();!d.done;d=c.next()){d=d.value;var e=hH(d);e.active=d===a;b.push(e)}return b}return[]};_.u.getPeriods=function(){return this.f.periods};
|
|
323
|
+
_.u.getStats=function(){if(this.G!==nJ)return _.Rp();HK(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===nJ){if(a=JK(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};
|
|
324
|
+
_.u.getTimelineCues=function(){return this.K?XE(this.K,QK(this)):[]};_.u.resetAbr=function(){this.h&&this.h.reset()};_.u.Ud=function(){return this.h};
|
|
325
|
+
_.u.addTextTrack=function(a,b,c,d,e,f){var g=this,h,l,m,n,p,q,t,v,z;return _.I(function(A){if(1==A.a){if(g.G!==nJ)throw g.log.error("Must call load() and wait for it to resolve before adding text tracks."),Error("State error!");h=sK(g);l=_.tq;m=g.f.periods.indexOf(h);n=m+1;p=n>=g.f.periods.length?g.f.presentationTimeline.getDuration():g.f.periods[n].startTime;q=p-h.startTime;if(Infinity===q)throw new _.O(1,4,4040);t=new _.uj(1,0,q,function(){return[a]},0,null,0);v={id:g.Qg++,originalId:null,createSegmentIndex:Promise.resolve.bind(Promise),
|
|
326
|
+
findSegmentPosition:function(){return 1},getSegmentReference:function(G){return 1===G?t:null},adjustSegmentDurations:function(){},getDuration:function(){return q},segmentLookupStrategy:_.xD,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.Ve.add(v);h.textStreams.push(v);return _.y(A,qI(g.a,v),
|
|
327
|
+
2)}if(z=_.jI(g.a,_.Q))sH(g.P,h).text=z;g.Ve["delete"](v);g.log.debug("Choosing new streams after adding a text stream");VK(g,h);uK(g);return A["return"](hH(v))})};
|
|
328
|
+
_.u.wk=function(a){this.log.debug(_.BD,a);try{this.log.debug("onChooseStreams_, choosing variant from ",a.variants);this.log.debug("onChooseStreams_, choosing text from ",a.textStreams);var b=YK(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}}};
|
|
329
|
+
_.u.vk=function(){this.log.debug("canSwitch_");this.va=!1;this.configuration.abr.enabled&&this.h.enable();this.ga&&(vI(this.a,this.ga,this.ij,this.hj),this.ga=null);this.aa&&(_.uI(this.a,this.aa,!0,0),this.aa=null)};_.u.lo=function(){this.A&&this.A.update()};_.u.Ym=function(){this.B&&this.B.j.af()};
|
|
330
|
+
_.u.Dj=function(a,b,c){if((void 0===c?"":c)===zD)return uK(this),this.ta()||(this.configuration.abr.enabled=!0,this.h.enable()),VK(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===_.Zc&&(h=h&&l.language===a.language));return h})&&this.ta()){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)}uK(this);this.ta()||(this.configuration.abr.enabled=!0,this.h.enable());
|
|
331
|
+
VK(this,b)}return c};_.u.Lm=function(){this.log.debug("endOfStream called by streaming engine");this.Zd=!0};_.u.onError=function(a){if(this.G!==nK&&7001!==a.code&&7E3!==a.code){var b=new _.L(_.qe,{detail:a});a.severity===_.P&&qJ(this,_.fq);this.trigger(b);b.defaultPrevented&&(b.a=!0)}};_.u.If=function(a){a.type===_.ie?this.dispatchEvent(a):"largegap"!==a.type&&(a.type===_.Qg?oK(this):"emsg"!==a.type&&(a instanceof _.L?this.dispatchEvent(a):this.log.debug(_.cc,a.type)))};_.u.ta=function(){return this.configuration.abr.enabled};
|
|
332
|
+
_.u.$n=function(a){var b=this,c,d,e,f,g,h,l,m;return _.I(function(n){switch(n.a){case 1:if(!b.Nc)return n["return"]();b.log.info("Attempt to switch CDN.");c=b.getLoadedSource();d=b.ta();return _.y(n,b.Nc(c.url,a),2);case 2:e=n.f;if(!e)return n["return"]();f=_.N.qa(b.getLoadedSource(),{url:e});d&&b.h.disable();return _.y(n,GI(b.a),3);case 3:g=JK(b);case 4:return h=!1,_.D(n,7),b.log.info("Switching CDN to "+f.url+"."),_.y(n,aL(b,f,g),9);case 9:_.sh(n,6);break;case 7:return l=_.F(n),b.log.info("Switch failed"),
|
|
333
|
+
_.y(n,b.Nc(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(),CI(b.a,!0),b.Z[b.getSourceIndex()]=f,a.f=!0,b.trigger(new _.L(_.pd,{newManifest:f.url})),_.B(n))}})};var nK=0,mJ=1,nJ=2,tK=[_.gf,_.ze];bL.prototype.a=function(){return tD};
|
|
334
|
+
bL.prototype.canPlay=function(a,b){if(_.El())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 _.Hu||_.Iu(a.url)in _.Ju?!0:!1:!1;if(d&&e){if(_.vk(2))return 1;if(_.Fl()&&c===_.gm){if(b.streaming.preferNativeHlsOnSafari)return 1;_.Hh("Support for MSE + FairPlay on Apple is experimental. In case of issues, consider using native HLS.")}return 2}return 0};
|
|
335
|
+
bL.prototype.f=function(a){return a===_.na||a===_.Eb};bL.prototype.create=function(){return new oJ};_.Rh(new bL);_.ns(function(){_.Mh("MediaSource.install");if(window.MediaSource)if(window.cast&&cast.__platform__&&cast.__platform__.canDisplayType)_.Lh("Patching Chromecast MSE bugs."),gL();else if(_.Fl()){var a=navigator.appVersion;a=0<=a.indexOf("Version")?parseInt(a.match(/Version\/(\d+)/)[1],10):13;eL();10>=a?(_.Lh("Blacklisting MSE on Safari \x3c\x3d 10."),window.MediaSource=null):12>=a?(_.Lh("Patching Safari 11 \x26 12 MSE bugs."),cL(),dL()):(_.Lh("Patching Safari 13 MSE bugs."),cL())}else _.vk(2)||_.vk(3)||
|
|
336
|
+
_.vk(4)?fL():_.Lh("Using native MSE as-is.");else _.Lh("No MSE implementation available.")});_.x(hL,_.Ev);_.u=hL.prototype;
|
|
337
|
+
_.u.append=function(a){function b(e){if(e.startTime>=e.endTime)_.Hh("Invalid cue times: "+e.startTime+" - "+e.endTime),e=null;else{var f=e.payload||"";f=f.replace(/<br\s*\/?>/igm,"\n");f=_.T.Eg(f);f=new VTTCue(e.startTime,e.endTime,f);f.line=-1;try{f.align=_.rd}catch(g){f.align="middle"}e.writingMode===_.Eg?f.vertical="lr":e.writingMode===_.Hg&&(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?
|
|
338
|
+
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;iL(this.a,function(c){return c.startTime<b&&c.endTime>a});return!0};_.u.isTextVisible=function(){return this.a.mode===_.Zf};_.u.setTextVisibility=function(a){null!==this.a&&(this.a.mode=a?_.Zf:_.we)};_.u.destroy=function(){this.a&&iL(this.a,function(){return!0});this.a=null;return Promise.resolve()};jL.prototype.a=function(){return!0};jL.prototype.create=function(a){return new hL(a)};_.Ip("single-native",new jL);};
|
|
334
339
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
335
340
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
336
341
|
else{_=this.clpp._;(f.call(g,this));}
|