@castlabs/prestoplay 6.17.0 → 6.17.1
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 +6 -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 +98 -98
- package/cjs/cl.conviva.js +31 -31
- package/cjs/cl.core.js +372 -369
- package/cjs/cl.crypto.js +8 -8
- package/cjs/cl.dash.js +71 -71
- package/cjs/cl.externs.js +1 -1
- package/cjs/cl.freewheel.js +21 -21
- package/cjs/cl.hls.js +67 -67
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +29 -29
- package/cjs/cl.ima.js +22 -22
- package/cjs/cl.mse.js +302 -302
- package/cjs/cl.muxdata.js +14 -14
- 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 +15 -15
- package/cjs/cl.simid.js +15 -15
- package/cjs/cl.smooth.js +71 -71
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +64 -64
- package/cjs/cl.ttml.js +28 -28
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +9 -9
- package/cjs/cl.vr.js +18 -18
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.youbora.js +14 -14
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +83 -83
- package/cl.conviva.js +26 -26
- package/cl.core.js +324 -323
- package/cl.crypto.js +8 -8
- package/cl.dash.js +69 -69
- package/cl.externs.js +1 -1
- package/cl.freewheel.js +15 -15
- package/cl.hls.js +72 -72
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +15 -15
- package/cl.mse.js +267 -268
- package/cl.muxdata.js +11 -11
- 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 +54 -54
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +6 -6
- package/cl.vr.js +14 -14
- package/cl.vtt.js +11 -11
- package/cl.youbora.js +12 -12
- package/package.json +1 -1
- package/typings.d.ts +3 -2
package/cjs/cl.mse.js
CHANGED
|
@@ -1,321 +1,321 @@
|
|
|
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
|
-
b;a.g.debug("Playhead outside safe region \x26 in unbuffered region.");return d};
|
|
44
|
-
|
|
45
|
-
h.start(l+1)-f;break a}h=null}h&&(e=Math.min(h+.1,e))}a.g.warn("Seeking forward "+e+" seconds to break stall.");b.currentTime+=e}else a.g.warn("Pausing and unpausing to break stall."),b.pause(),b.play()});return c};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
_.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
g.get(f).get(h),a.o.get(f).set(h,l);a.a=null==a.a?Math.max(c,a.h):Math.min(a.a,Math.max(c,a.h));a.f=Math.max(a.f,Math.min(d,a.l))};_.
|
|
53
|
-
_.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
m);_.sh(p,0);break;case 5:return n=_.E(p),p["return"](Promise.reject(new _.P(_.Q,3,3015,{mediaError:n})))}})};
|
|
59
|
-
|
|
60
|
-
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=
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"variant.video",
|
|
68
|
-
|
|
2
|
+
var f=function(window){var WA,XA,YA,ZA,$A,aB,bB,cB,dB,eB,fB,gB,hB,iB,jB,kB,lB,mB,nB,oB,pB,qB,rB,sB,tB,uB,vB,wB,xB,yB,zB,AB,BB,CB,DB,EB,FB,IB,JB,KB,LB,MB,NB,OB,PB,QB,RB,SB,UB,VB,WB,XB,YB,ZB,$B,cC,dC,fC,gC,hC,iC,jC,kC,lC,nC,oC,pC,uC,vC,wC,xC,yC,zC,AC,CC,GC,HC,JC,KC,LC,MC,OC,PC,QC,SC,TC,UC,VC,WC,XC,YC,ZC,$C,bD,gD,mD,rD,uD,jD,tD,vD,wD,xD,yD,zD,AD,BD,CD,DD,ED,ID,KD,LD,MD,JD,OD,ND,PD,QD,TD,UD,VD,SD,RD,WD,$D,bE,ZD,cE,YD,aE,XD,eE,dE,fE,gE,hE,kE,lE,mE,nE,oE,qE,uE,sE,wE,xE,yE,AE,zE,BE,DE,CE,JE,KE,GE,EE,HE,IE,LE,ME,PE,OE,QE,RE,SE,
|
|
3
|
+
FE,TE,NE,VE,WE,XE,YE,ZE,aF,bF,dF,eF,cF,fF,gF,hF,jF,kF,iF,sF,rF,tF,uF,wF,xF,zF,yF,AF,CF,BF,DF,GF,EF,FF,IF,HF,JF,KF,LF,OF,QF,PF,SF,RF,UF,VF,WF,ZF,YF,XF,$F,bG,aG,cG,dG,eG,fG,gG,hG,kG,jG,iG,mG,lG,oG,rG,tG,uG,zG,CG,EG,GG,IG,LG,MG,NG,PG,QG,SG,HG,UG,xG,VG,vG,FG,YG,WG,RG,TG,$G,ZG,XG,fH,gH,aH,iH,bH,dH,lH,kH,eH,jH,mH,wG,cH,OG,yG,AG,qG,BG,hH,JG,KG,nH,qH,rH,sH,tH,uH,wH,xH,vH,yH,EH,LH,KH,MH,FH,GH,HH,RH,NH,CH,BH,AH,DH,PH,QH,IH,JH,bI,WH,eI,fI,gI,kI,hI,oF,mF,pF,nF,qF,lF,MI,qI,OI,cI,aI,jI,NI,LI,QI,iI,mI,TH,lI,RI,
|
|
4
|
+
$H,SI,TI,WI,dI,ZH,VI,UI,OH,PI,pI,YI,XH,nI,XI,zH,ZI,VH,UH,$I,aJ,bJ,cJ,dJ,eJ,fJ,gJ,hJ;WA=" and the media start time is ";XA=" between media times and segment times for ";YA=" buffer";ZA=" buffer. Range:";$A=" is being or has been set up";aB=" range:";bB=" with element state: ";cB=". Adjusting timestampOffset.";dB=". The segment start time is ";eB="\x3c/DATA\x3e\x3c/WRMHEADER\x3e";fB="\x3c/LA_URL\x3e";gB="\x3cLA_URL\x3e";hB='\x3cWRMHEADER xmlns\x3d"http://schemas.microsoft.com/DRM/2007/03/PlayReadyHeader" version\x3d"';
|
|
5
|
+
iB="Aborting operations for ";jB="Appended audio segment ";kB="Appended video segment ";lB="Appending data to ";mB="Buffer:";nB="Choosing new streams after key status change";oB="Detected a delta of ";pB="Done Aborting operations for ";qB="Done Appending data to ";rB="Done Flushing buffer for ";sB="Done Removing data from ";tB="Done Setting append window for ";uB="Done Setting timestamp offset for ";vB="Failed to abort operations for ";wB="Failed to append data for ";xB="Failed to flush buffer for ";
|
|
6
|
+
yB="Failed to remove data from ";zB="Failed to set append window for ";AB="Failed to set timestamp offset for ";BB="Flushing buffer for ";CB="IterateSegmentReference";DB="Jumping forward";EB="MediaSource threw QuotaExceededError:";FB="No more scheduled operations for ";_.GB="No stream with id";_.HB="Player is in ERROR state and can not switch to ";IB="PrestoPlay TextTrack";JB="QuotaExceededError";KB="Removing audio from variant - audio not compatible with platform";LB="Removing data from ";MB="Reset transmuxers.";
|
|
7
|
+
NB="Setting append window for ";OB="Setting playback rate to\x3d";PB="Setting timestamp offset for ";QB="Skip buffer flush for ";RB="Starting next operation for ";SB="Update-End received for ";_.TB="Updating manifest...";UB="bufferBehind\x3d";VB="bufferedBehind\x3d";WB="calling onCanSwitch()...";XB="cannot find segment";YB="clpp.mse.Player";ZB="currentPeriod.startTime\x3d";$B="failed to get buffered range for ";_.aC="getSegmentNextReference";_.bC="iterateSegmentReference";cC="key-restriction";
|
|
8
|
+
dC="manifest.start";_.eC="onChooseStreams_";fC="presentationTime:";gC="presentationTime\x3d";hC="reference.endTime\x3d";iC="reference.position\x3d";jC="reference.startTime\x3d";kC="sourceopen";lC="startstreaming";_.mC="subtitles";nC="switch: Stream ";oC=function(a,b){return _.$g[a]=b};pC=function(a){for(var b=a.a+a.f.byteOffset,c=void 0;_.Gm(a);)if(0===_.Im(a)){c=a.a+a.f.byteOffset-1;break}a=a.f.buffer.slice(b,c);return _.S.ba(a)};
|
|
9
|
+
_.rC=function(a){var b=new Uint8Array(qC),c=4+b.byteLength+a.j.byteLength+4+a.f.byteLength,d=new _.Cm(c,!1);_.W(d,c);_.Em(d,b);_.Em(d,a.j);_.W(d,a.f.byteLength);_.Em(d,a.f);return _.lj(d.buffer)};
|
|
10
|
+
_.sC=function(a,b,c,d){var e=_.yj(b);if(8!==e.byteLength)e="";else{var f=_.Qn(e);e=_.vj(f);b:switch(f=f.byteLength,_.Kh("Trying to create PlayReady header in version",a),a){case "4.0.0.0":e=[hB+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?gB+d+fB:"",eB].join("");break b;case "4.1.0.0":e=[hB+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?gB+d+fB:"",eB].join("");break b;case "4.2.0.0":case "4.3.0.0":e=[hB+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?gB+d+fB:"",eB].join("");break b;default:_.Fh("Cannot create PlayReady header in version",a),e=""}}if(!e)return null;_.Kh("New payload",e);e=_.lj(_.S.Pe(e,!0));return new _.Nn(_.Rn,
|
|
12
|
+
b,d||null,e,a,c)};_.tC=function(a,b){return b===a.version?a:_.sC(b,a.a,a.l||void 0,a.h||void 0)};uC=function(a,b){a:{if(b){var c=_.w(a.f.keys());for(var d=c.next();!d.done;d=c.next()){d=a.f.get(d.value);for(var e=0;e<d.bb.length;e++)if(d.bb[e]===b){c=d;break a}}}c=null}return c?c.Ka:null};vC=function(a,b){if(_.Zk("Edge/"))return!0;b=b.toLowerCase();if(_.Vj()&&b.includes('codecs\x3d"ac-3"')){var c=b.replace("ac-3",_.ne);return a.J.has(b)||a.J.has(c)}return a.J.has(b)};
|
|
13
|
+
wC=function(a,b){var c=a.l.get(b);return!(!c||c!==_.ff&&c!==_.ze)};xC=function(a,b){var c=b.audio,d=b.video;if(c&&c.encrypted&&(c=_.Fo(c),!vC(a,c))||d&&d.encrypted&&(d=_.Fo(d),!vC(a,d)))return!1;var e=a.keySystem();return 0===b.drmInfos.length||b.drmInfos.some(function(f){return f.keySystem===e})};yC=function(a,b){return a.a.find(function(c){return c.getId()===b})||null};
|
|
14
|
+
zC=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.qb()+d.getDuration();)c+=1,d=a.a[c]||null;a.f=d?c:a.a.length-1}else a.f=-1};AC=function(a,b){a.a=b.enabled};_.BC=function(a,b){return a.concat(b)};CC=function(){};_.DC=function(a,b){if(0===b.length)return a;var c=b.map(function(d){return new _.Gi(d)});return a.map(function(d){return new _.Gi(d)}).map(function(d){return c.map(d.resolve.bind(d))}).reduce(_.BC,[]).map(function(d){return d.toString()})};
|
|
15
|
+
_.EC=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:b||[],keyIds:[],periodId:c?c:null}};_.FC=function(a,b,c,d,e){this.Ra=a;this.wa=b;this.ka=c;this.keyInfo=d||null;this.Vc=_.O.R(e)?!1:!!e};GC=function(a,b){a=_.dj(a);b=_.dj(b);var c=a.split("-"),d=b.split("-");return c[0]===d[0]&&1===c.length&&2===d.length};
|
|
16
|
+
HC=function(a){return a.language?_.dj(a.language):a.audio&&a.audio.language?_.dj(a.audio.language):a.video&&a.video.language?_.dj(a.video.language):_.vg};
|
|
17
|
+
_.IC=function(a,b){for(var c=_.dj(a),d=new Set,e=_.w(b),f=e.next();!f.done;f=e.next())d.add(_.dj(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,GC(f,c))return f;e=_.w(d);for(f=e.next();!f.done;f=e.next()){var g=f=f.value,h=c;g=_.dj(g);h=_.dj(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,GC(c,e))return e;return null};
|
|
18
|
+
JC=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};KC=function(a,b){var c=_.Qk(b,a);if(!c)return!1;c=c();var d=c.isMuxed(a,b);c.destroy();return d};LC=function(a){for(var b=[a.mimeType],c=_.w(_.hv),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
|
+
MC=function(a){return a.split(",").map(function(b){return b.trim()}).filter(function(b){return 0<b.length})};_.NC=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(",")};OC=function(a,b){for(var c=new _.Ul(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};PC=function(){return!!window.SourceBuffer&&!!SourceBuffer.prototype&&!!SourceBuffer.prototype.changeType};
|
|
20
|
+
QC=function(a,b){return a.start-b.start};_.RC=function(a){this.h=a;this.log=new _.K("clpp.renditions");this.U=[];this.f=this.player=null;this.a=!1};SC=function(a){return a.U.map(function(b){return{start:b.start,end:b.end,width:b.width,height:b.height,bandwidth:b.bandwidth,rendition:b.rendition}})};TC=function(a){a.player&&(a.player.off(_.Sf,a.Rc),a.a&&a.player.off(_.rg,a.Rc));a.player=null};UC=function(a){a.player&&a.player.trigger(new _.L(_.hd))};VC=function(a){a.player&&a.player.trigger(new _.L(_.hd))};
|
|
21
|
+
WC=function(a){if(a.player){for(var b=!1,c={},d=0;d<a.U.length;d++){var e=a.U[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(_.rg,a.Rc,a),a.a=!0):!b&&a.a&&(a.log.debug("Stop tracking timeupdates"),a.player.off(_.rg,a.Rc),a.a=!1)}};XC=function(a,b,c){a.U=a.U.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
|
+
YC=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};ZC=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};$C=function(a,b){for(var c=0;c<a.length;c++)if(ZC(a[c]).has(b))return c;return-1};
|
|
23
|
+
bD=function(a,b){Array.from(ZC(a)).forEach(function(c){c.segmentIndex&&_.aD(c.segmentIndex,b)})};_.cD=function(a){this.h=Math.exp(Math.log(.5)/a);this.f=this.a=0};_.dD=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)};_.eD=function(a){return a.a/(1-Math.pow(a.h,a.f))};
|
|
24
|
+
_.fD=function(a,b,c,d,e,f,g,h){a=_.Jj(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};gD=function(a){this.a=this.h=0;this.f=a};_.hD=function(a,b,c){a.h=b;a.a=c};
|
|
25
|
+
_.iD=function(a,b,c,d,e,f){f=void 0===f?!1:f;this.j=a;this.D=b;this.I=c;this.A=this.f=Infinity;this.h=1;this.G=0;this.l=this.w=null;this.H=0;this.B=this.o=d;this.K=void 0===e?!0:e;this.g=new _.K("clpp.media.PresentationTimeline");this.L=f;this.J=null;this.a=new gD(d)};_.kD=function(a,b){a.J={offsetDateTime:b-jD(a),seekRangeStartDateTime:b}};_.lD=function(a,b){a.o=b;a.B=b;a.a.f=b};mD=function(a){return 2===a.j.version?a.a.f?a.a.a:null:a.o?a.f:a.B?a.l:null};
|
|
26
|
+
_.pD=function(a,b,c){if(0!==b.length){var d=b[b.length-1].endTime+c;_.nD(a,b[0].startTime+c);a.h=b.reduce(function(e,f){return Math.max(e,f.endTime-f.startTime)},a.h);_.oD(a,d);null!=a.D&&a.K&&(a.D=(Date.now()+a.H)/1E3-(a.l||0)-a.h);a.g.debug("notifySegments: maxSegmentDuration\x3d"+a.h)}};_.nD=function(a,b){a.w=null==a.w?b:Math.min(a.w,b)};_.oD=function(a,b){a.l=Math.max(a.l||0,b)};_.qD=function(a,b){a.h=Math.max(a.h,b);a.g.debug("notifyNewSegmentDuration: maxSegmentDuration\x3d"+a.h)};
|
|
27
|
+
_.sD=function(a){return 2===a.j.version?a.a.qb():Infinity===a.A?0:Math.max(0,rD(a)-a.A)};rD=function(a){if(2===a.j.version)a=a.a.a;else if(a.o)a=a.f;else if(a.B)a=a.l||0;else{var b=(Date.now()+a.H)/1E3;a=Math.min(a.L?Math.max(0,b-(a.h-a.G)-a.D):Math.max(0,b-a.h-a.D),a.f)}return a};uD=function(a,b){if(2===a.j.version)return a.a.qb();var c=Math.max(a.w,0);return Infinity===a.A?Math.ceil(1E3*c)/1E3:Math.max(c,Math.min(rD(a)-a.A+b,tD(a)))};jD=function(a){return 2===a.j.version?a.a.qb():uD(a,0)};
|
|
28
|
+
tD=function(a){var b=a.Nd()&&!a.B?a.I:0;return 2===a.j.version?a.a.a-b:Math.max(0,rD(a)-b)};vD=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,Xa:a.Xa}};wD=function(){this.f=function(){};this.a=new Set};xD=function(a,b){a.f=b};
|
|
29
|
+
yD=function(a,b){a:{var c=_.w(a.a);for(var d=c.next();!d.done;d=c.next())if(d=d.value,d.schemeIdUri===b.schemeIdUri&&d.startTime===b.startTime&&d.endTime===b.endTime&&d.configurationId===b.configurationId){c=d;break a}c=null}null==c&&(a.a.add(b),a.f(b))};zD=function(a,b){for(var c=_.w(b),d=c.next();!d.done;d=c.next())yD(a,d.value)};AD=function(a,b){b=void 0===b?!1:b;return Array.from(a.a.values()).map(function(c){return vD(c,b)})};
|
|
30
|
+
BD=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 _.Ft("crop",a,d.endTime?d.endTime-a:Infinity,!1))};CD=function(a){var b=a.a.mh(),c=a.h,d=b?b.id:null;(c?c.id:null)!==d&&b&&a.f(new _.L(_.Vf,{id:d}));a.h=b;"basic"===a.o.timeline&&(a.j.a=b)};DD=function(a,b,c){this.h=a;this.a=b;this.f=c;this.g=new _.K("clpp.media.SegmentIterator")};
|
|
31
|
+
ED=function(a){var b=a.h.get(a.a);if(!b)return null;0<b.a.length&&b.Ra().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};_.FD=function(a){this.a=a;this.g=new _.K("clpp.media.SegmentIndex")};_.GD=function(a){return a.a.length?a.a[a.a.length-1].endTime:0};_.HD=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
|
+
ID=function(a,b){var c=a.find(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 DD(a,c,e)};_.aD=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
|
+
KD=function(a,b){this.h=a;this.l=JD(a);this.a=a.a.currentTime;this.j=Date.now()/1E3;this.o=b;this.f=function(){}};LD=function(a,b){a.f=b};MD=function(a){this.a=a};JD=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
|
+
OD=function(a,b,c,d,e){var f=this;this.a=a;this.H=b;this.l=c;this.G=e;this.h=new _.Uh;this.D=!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 ND(f)});this.w=(new _.Wk(function(){ND(f)})).lb(.25)};
|
|
35
|
+
ND=function(a){if(0!==a.a.readyState){if(a.a.seeking){if(!a.D)return}else a.D=!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 _.Ul(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=JD(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>=tD(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:_.Jh("Ignoring large gap at",c,"size",g)}if(b||h)0===e?_.Jh(DB,g,"seconds because of gap before start time of",f):_.Jh(DB,g,"seconds because of gap starting at",d.end(e-1),"and ending at",f),a.B=!0,a.a.currentTime=f}}}}};
|
|
37
|
+
PD=function(a){var b=this;this.f=a;this.o=10;this.l=this.h=this.j=0;this.a=new _.Wk(function(){0>=b.j?(_.Fh(["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--)})};QD=function(a,b){a.h=a.f.currentTime;a.l=b;a.j=a.o;a.f.currentTime=b;a.a.lb(.1)};TD=function(a,b,c,d){this.a=a;this.j=b;this.o=d;this.A=c;this.l=!1;this.f=new _.Uh;this.h=new PD(a);this.w=!1;0<a.readyState?RD(this,c):SD(this,c)};
|
|
38
|
+
UD=function(a){return a.l?a.a.currentTime:a.A};VD=function(a,b){0<a.a.readyState?QD(a.h,b):SD(a,b)};SD=function(a,b){a.A=b;a.f.off(a.a,_.Je);a.f.one(a.a,_.Je,function(){RD(a,b)})};RD=function(a,b){a.w||(a.w=!0,a.o&&a.o());.001>Math.abs(a.a.currentTime-b)?WD(a):(a.f.one(a.a,_.Zf,function(){WD(a)}),QD(a.h,0===a.a.currentTime?b:a.a.currentTime))};WD=function(a){_.al()&&!a.l&&a.j();a.l=!0;a.f.on(a.a,_.Zf,function(){return a.j()})};
|
|
39
|
+
$D=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 OD(a,b.presentationTimeline,c,XD(this,a,c),f);this.f=new TD(a,function(){a:{var l=h.j;var m=l.B;l.B=!1;l.D=!0;l.A=!1;l.j=!1;l=UD(h.f);var n=YD(h,l);if(.001<Math.abs(n-l)){var p=(new Date).getTime()/1E3;if(!h.w||h.w<p-1){h.w=p;VD(h.f,n);m=void 0;break a}}h.g.debug("Seek to "+l);h.A(m?1:0);m=void 0}return m},ZD(this,d,g),function(){h.j.I=!0});this.o=(new _.Wk(function(){if(0!==
|
|
40
|
+
h.h.readyState&&!h.h.paused){var l=UD(h.f),m=jD(h.a),n=tD(h.a);3>n-m&&(m=n-3);l<m&&(m=YD(h,l),h.g.info("Jumping forward "+(m-l)+" seconds to catch up with the seek range."),h.h.currentTime=m)}})).lb(.25);this.g=new _.K("clpp.mse.Playhead")};bE=function(a){var b=UD(a.f);return 0<a.h.readyState&&!a.h.paused?aE(a,b):b};ZD=function(a,b,c){null==b?b=Infinity>a.a.getDuration()||c?jD(a.a):tD(a.a):0>b&&(b=tD(a.a)+b);return cE(a,aE(a,b))};
|
|
41
|
+
cE=function(a,b){var c=a.a.getDuration();return b>=c?c-a.l.durationBackoff:b};
|
|
42
|
+
YD=function(a,b){var c=new _.Ul(a.h.buffered);c=c.sb.bind(c);var d=Math.max(a.B,a.l.rebufferingGoal),e=a.l.safeSeekOffset,f=jD(a.a),g=tD(a.a),h=a.a.getDuration();3>g-f&&(f=g-3);var l=uD(a.a,d),m=uD(a.a,e);d=uD(a.a,d+e);if(b>=h)return a.g.debug("Playhead past duration."),cE(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");return d}if(b>=l||c(b))return a.g.debug("Playhead in safe region or in buffered region."),
|
|
43
|
+
b;a.g.debug("Playhead outside safe region \x26 in unbuffered region.");return d};aE=function(a,b){var c=jD(a.a);if(b<c)return c;c=tD(a.a);return b>c?c:b};
|
|
44
|
+
XD=function(a,b,c){if(!c.stallEnabled)return null;var d=c.gapDetectionThreshold,e=c.stallSkip;c=new KD(new MD(b),c.stallThreshold);LD(c,function(f,g){a.g.warn("Stall detected at "+f+" for "+g+" seconds.");if(e){var h=new _.Ul(b.buffered),l;if(l=_.Zk("Edge/")||_.Zk("Trident/")||_.Vj()||_.al())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};eE=function(a){var b=this;this.f=a;this.a=new Set;this.h=(new _.Wk(function(){dE(b,!1)})).lb(.25)};dE=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
|
+
fE=function(a,b){var c=a.offset||0;return b<a.startTime+c?1:b>a.endTime+c?3:2};
|
|
47
|
+
gE=function(a){var b=this;this.j=a;this.o=new Map;this.a=function(){};this.f=function(){};this.h=function(){};this.w=[{Dc:null,Cc:2,rc:function(c,d){return b.a(c,d)}},{Dc:1,Cc:2,rc:function(c,d){return b.a(c,d)}},{Dc:3,Cc:2,rc:function(c,d){return b.a(c,d)}},{Dc:2,Cc:1,rc:function(c,d){return b.f(c,d)}},{Dc:2,Cc:3,rc:function(c,d){return b.f(c,d)}},{Dc:1,Cc:3,rc:function(c,d){return b.h(c,d)}},{Dc:3,Cc:1,rc:function(c,d){return b.h(c,d)}}]};hE=function(a,b,c,d){a.a=b;a.f=c;a.h=d};
|
|
48
|
+
_.iE=function(a){_.Lt[a]&&delete _.Lt[a]};_.jE=function(a){_.Jt[a]&&delete _.Jt[a]};kE=function(a,b){this.w=null;this.D=a;this.j=b;this.h=this.A=0;this.l=Infinity;this.f=this.a=null;this.B="";this.o=new Map};lE=function(a,b){if(b!==_.Tc){var c=_.lu[b];if(!c)throw new _.P(_.Q,2,2012,"Text parser is unavailable for "+b);a.w=new c(a.D)}};
|
|
49
|
+
mE=function(a,b,c,d){return Promise.resolve().then(function(){if(a.w&&a.j)if(null==c||null==d)a.w.parseInit(_.lj(b));else{var e={periodStart:a.A,segmentStart:c,segmentEnd:d};e=a.w.parseMedia(_.lj(b),e);var f=e.cues.filter(function(g){return g.startTime>=a.h&&g.startTime<a.l});a.j.append(f,e.styles);null==a.a&&(a.a=Math.max(c,a.h));a.f=Math.min(d,a.l)}})};
|
|
50
|
+
nE=function(a,b,c){a.B=b;if(b=a.o.get(b))for(var d=_.w(b.keys()),e=d.next();!e.done;e=d.next())if(e=b.get(e.value))e=e.filter(function(f){return f.endTime<=c}),a.j.append(e,[])};
|
|
51
|
+
oE=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 _.ui(l.startTime,l.endTime,l.text),g.get(h).get(f).push(l),h===a.B&&a.j.append([l],[]))}e=_.w(g.keys());for(f=e.next();!f.done;f=e.next())for(f=f.value,a.o.has(f)||a.o.set(f,new Map),b=_.w(g.get(f).keys()),h=b.next();!h.done;h=b.next())h=h.value,l=
|
|
52
|
+
g.get(f).get(h),a.o.get(f).set(h,l);a.a=null==a.a?Math.max(c,a.h):Math.min(a.a,Math.max(c,a.h));a.f=Math.max(a.f,Math.min(d,a.l))};_.pE=function(a){a=a.toLowerCase();return _.lu[a]||window.muxjs&&a===_.Tc?!0:!1};qE=function(){this.a=new muxjs.mp4.CaptionParser;this.l=[];this.j={}};_.rE=function(){};
|
|
53
|
+
_.tE=function(a,b,c,d,e){this.j=a;this.D=c;this.f={};this.K=!1;this.a=null;this.h={};this.l=new _.Uh;this.I=!1;this.w={};this.H=b;this.B=d;this.L=e;this.S=this.L.streaming.maxSegmentToMediaOffset||1;this.J=new _.Oj;this.A="";this.G={};this.o=sE(this,this.J);this.N=!0;this.g=new _.K("clpp.mse.MediaSourceEngine")};uE=function(a){var b=_.Rk(a.mimeType,a.codecs),c=LC(a);return _.pE(b)||_.Ar(c)||(_.Qk(b,a.type)?!0:!1)};
|
|
54
|
+
sE=function(a,b){if(window.ManagedMediaSource){a.j.disableRemotePlayback=!0;var c=new ManagedMediaSource;a.l.one(c,kC,function(){URL.revokeObjectURL(a.A);b.resolve()});a.l.on(c,lC,function(){a.N=!0});a.l.on(c,"endstreaming",function(){a.N=!1});a.A=vE(c);a.j.src=a.A;return c}c=new MediaSource;a.A=vE(c);a.l.one(c,kC,function(){URL.revokeObjectURL(a.A);b.resolve()});a.j.src=a.A;return c};
|
|
55
|
+
wE=function(a,b){b.forEach(function(c,d){var e=a.o.addSourceBuffer(c);a.l.on(e,_.re,a.T.bind(a,d));a.l.on(e,"updateend",a.Sc.bind(a,d));a.f[d]=e;a.h[d]=[];a.G[d]=!1});a.K=b.has(_.ad)&&b.has(_.r)};xE=function(a,b){try{return new _.Ul(a.f[b].buffered,b)}catch(c){return b in a.f&&a.g.error($B+b,c),null}};yE=function(a,b){if(!a.f[b])return"";var c=xE(a,b);return c?c.toString():""};AE=function(a,b,c,d,e){return[zE(a,b,a.Mj.bind(a,b)),zE(a,b,a.Ng.bind(a,b,c)),zE(a,b,a.Nj.bind(a,b,d,e))]};
|
|
56
|
+
zE=function(a,b,c){if(a.I)return Promise.reject();c={start:c,p:new _.Oj};a.h[b].push(c);1===a.h[b].length&&BE(a,b);return c.p};BE=function(a,b){var c=a.h[b][0];if(c)try{a.g.debug(RB+b),c.start()}catch(d){d.name===JB?c.p.reject(new _.P(_.Q,3,3017,{type:b})):c.p.reject(new _.P(_.Q,3,3015,{mediaError:d})),CE(a,b)}else a.g.debug(FB+b)};
|
|
57
|
+
DE=function(a,b){var c,d,e,f,g,h,l,m,n;return _.H(function(p){switch(p.a){case 1:if(a.I)return p["return"](Promise.reject());c=[];for(d in a.f)e=new _.Oj,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();_.B(p,2);return _.y(p,Promise.all(c),4);case 4:_.qh(p,3);break;case 2:g=_.E(p);for(h in a.f)a.h[h].length&&a.h[h].shift();return p["return"](Promise.reject(g));case 3:for(l in a.f);_.B(p,5,6);return _.y(p,b(),6);case 6:_.rh(p);for(m in a.f)CE(a,
|
|
58
|
+
m);_.sh(p,0);break;case 5:return n=_.E(p),p["return"](Promise.reject(new _.P(_.Q,3,3015,{mediaError:n})))}})};CE=function(a,b){a.h[b].shift();BE(a,b)};
|
|
59
|
+
JE=function(a,b,c,d){var e=a.periods.flatMap(function(n){return n.variants});if(b.length||c.length)e=EE(e,b,c);e=FE(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={We:c.We},d++)c.We=b[d],l=new Set(_.ch(l).concat().filter(function(n){return function(p){return n.We.has(p)}}(c)));
|
|
60
|
+
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=GE(e);var m=HE(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(IE(n)===m)return!0;_.Kh("Dropping Variant (better codec available)",n);return!1})};
|
|
61
|
+
KE=function(a,b,c,d){var e=a.periods.flatMap(function(f){return f.variants});if(b.length||c.length)e=EE(e,b,c);e=FE(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)})};GE=function(a){var b=new _.Rh;a=_.w(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=IE(c);b.push(d,c)}return b};
|
|
62
|
+
EE=function(a,b,c){if(!b.length&&!c.length)return a;var d=a.filter(function(g){return(g=g.audio)&&c.length&&(g=_.NC(g.codecs),c.includes(g))?!0:!1}),e=a.filter(function(g){return(g=g.video)&&b.length&&(g=_.NC(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};
|
|
63
|
+
HE=function(a){var b="",c=Infinity;a.forEach(function(d,e){var f=e.reduce(function(g,h){return g+h.bandwidth||0},0)/e.length;_.Kh(_.Md,d,"avg bandwidth",f);f<c&&(b=d,c=f)});return b};IE=function(a){var b="";a.video&&(b=_.NC(a.video.codecs));var c="";a.audio&&(c=_.NC(a.audio.codecs));return b+"-"+c};
|
|
64
|
+
LE=function(a,b,c){function d(f,g,h){return f>=g&&f<=h}var e=a.video;return e&&e.width&&e.height&&!(d(e.width,b.minWidth,Math.min(b.maxWidth,c.width))&&d(e.height,b.minHeight,Math.min(b.maxHeight,c.height))&&d(e.width*e.height,b.minPixels,b.maxPixels))||!d(a.bandwidth,b.minBandwidth,b.maxBandwidth)?!1:!0};ME=function(a,b,c){var d=!1;a=_.w(a);for(var e=a.next();!e.done;e=a.next()){e=e.value;var f=e.allowedByApplication;e.allowedByApplication=LE(e,b,c);f!==e.allowedByApplication&&(d=!0)}return d};
|
|
65
|
+
PE=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.$&&!xC(a,n))return _.Kh("Dropping variant - not compatible with key system",n),!1;var p=n.audio,q=n.video;if(p&&!uE(p)){var u=p.codecs;0<=p.codecs.indexOf(_.ne)?(_.Kh("Trying to use AC-3 for EC-3"),p.codecs=p.codecs.replace(_.ne,"ac-3"),uE(p)?_.Jh("Using AC-3 instead of EC-3 for",NE(p)):(p.codecs=u,_.Jh(KB,NE(p)),n.audio=null,f=!0,p=null)):(_.Jh(KB,NE(p)),n.audio=null,f=!0,p=null)}return q&&!uE(q)?(_.Jh("Dropping variant - video not compatible with platform",
|
|
66
|
+
NE(q)),!1):p&&b&&!OE(p,b,e)?(_.Jh("Dropping variant - not compatible with active audio","active audio",NE(b),"variant.audio",NE(p)),!1):q&&c&&!OE(q,c,e)?(_.Jh("Dropping variant - not compatible with active video","active video",NE(c),"variant.video",NE(q)),!1):!0});if(f){for(var g=!1,h=!1,l=_.w(d.variants),m=l.next();!m.done;m=l.next())m=m.value,!g&&m.video&&m.audio&&(g=!0),h||m.audio||!m.video||(h=!0);g&&h&&(d.variants=d.variants.filter(function(n){return n.video&&!n.audio?(_.Jh("Dropping variant - not compatible with video + audio",
|
|
67
|
+
"variant.video",NE(n.video)),!1):!0}))}d.textStreams=d.textStreams.filter(function(n){var p=_.pE(_.Rk(n.mimeType,n.codecs));p||_.Kh("Dropping text stream. Is not supported by the platform.",n);return p})};OE=function(a,b,c){return a.mimeType!==b.mimeType||(void 0===c||c)&&a.codecs.split(".")[0]!==b.codecs.split(".")[0]?!1:!0};
|
|
68
|
+
QE=function(a){var b=a.audio,c=a.video,d=b?b.codecs:null,e=c?c.codecs:null,f=[];e&&f.push(e);d&&f.push(d);var g=c&&c.mimeType||null,h=b&&b.mimeType||null,l=[];b&&l.push(b.kind);c&&l.push(c.kind);l=l[0]||null;var m=new Set,n=new Set;if(b)for(var p=_.w(b.roles),q=p.next();!q.done;q=p.next())n.add(q.value);if(c)for(p=_.w(c.roles),q=p.next();!q.done;q=p.next())m.add(q.value);q=[c,b].map(function(u){return u?u.accessibility||[]:[]}).reduce(function(u,v){return u.concat(v)},[]);a={id:a.id,active:!1,type:"variant",
|
|
69
69
|
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,keyId:c?c.keyId:b?b.keyId:null};c&&(a.videoId=c.id,
|
|
70
70
|
a.originalVideoId=c.originalId,a.width=c.width||null,a.height=c.height||null,a.frameRate=c.frameRate||null,a.trickPlay=!!c.trickPlay,a.videoBandwidth=c.bandwidth||null);b&&(a.audioId=b.id,a.originalAudioId=b.originalId,a.originalLanguage=b.originalLanguage,a.channelsCount=b.channelsCount,a.audioBandwidth=b.bandwidth||null,a.label=b.label,a.audioRoles=b.roles);return a};
|
|
71
|
-
|
|
72
|
-
accessibility:a.accessibility,keyId:null}};
|
|
73
|
-
_.
|
|
74
|
-
h.roles.length}),b.length)return b;b=e.map(function(h){return h.roles}).reduce(_.
|
|
75
|
-
|
|
76
|
-
|
|
71
|
+
RE=function(a){return{id:a.id,active:!1,type:_.R,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,
|
|
72
|
+
accessibility:a.accessibility,keyId:null}};SE=function(a){return a.allowedByApplication&&a.allowedByKeySystem};FE=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))};
|
|
73
|
+
_.UE=function(a,b,c,d){b=_.ji(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=_.IC(_.dj(h),a.map(function(m){return m.language}));return l?(e=a.filter(function(m){return _.dj(m.language)===l}),!0):!1});e=e.filter(function(h){return d?h.kind===_.se:h.kind!==_.se});if(c){b=TE(e,c);if(b.length)return b;_.Fh("No exact match for the text role could be found.")}else if(b=e.filter(function(h){return 0===
|
|
74
|
+
h.roles.length}),b.length)return b;b=e.map(function(h){return h.roles}).reduce(_.BC,[]);return b.length?TE(e,b[0]):e};TE=function(a,b){return a.filter(function(c){return c.roles.includes(b)})};
|
|
75
|
+
NE=function(a){var b=LC(a);return a.type===_.ad?"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"};
|
|
76
|
+
VE=function(a,b){var c=String(_.kk++);c=new _.ek(c,a);c.mimeType=_.fk(b.mimeType);if(a===_.T||a===_.gk)c.label=_.fk(b.label),c.language=_.fk(b.language),c.originalLanguage=_.fk(b.originalLanguage);a===_.hk?(c.frameRate=b.frameRate,c.roles=b.roles,c.trickPlay=b.trickPlay):a===_.gk?(c.channelsCount=b.channelsCount,c.roles=b.audioRoles||[],c.mimeType=_.fk(b.audioMimeType)):(c.kind=_.fk(b.kind),c.roles=b.roles);c.accessibility=a===_.hk||a===_.gk?(b.accessibility||[]).filter(function(d){return d.type===
|
|
77
77
|
a}):b.accessibility||[];return c};
|
|
78
|
-
|
|
79
|
-
d,null,["id","track"])}))||c.renditions.push(d);return a||d};
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
c=d}return c}catch(l){throw new _.P(_.Q,7,7003,"Failed to join manifests into a continuous playlist!",l);}};
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
n)}))}else if(b===_.gk)a.f.set(b,c),
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
a.h=b}};
|
|
90
|
-
|
|
91
|
-
_.
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
b.C.setPlaybackRate(b.a.chasingRate,_.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
m);_.sh(p,0);break;case 5:return n=_.E(p),p["return"](Promise.reject(new _.P(_.Q,3,3015,{mediaError:n})))}})};
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
a;if(0===g.length||!e)throw _.Lh("Failed to find boxes needed to fake encryption!"),_.Lh("Failed init segment (hex):",_.zj(a)),new _.P(_.Q,3,14E3);g.reverse();for(var h=_.w(g),l=h.next();!l.done;l=h.next())l=l.value,_.Jh('Inserting "'+_.Um(l.ed)+'" box into init segment.'),a=
|
|
112
|
-
|
|
113
|
-
b.start);b=_.Vm(b);a=l.getUint32(b);l.setUint32(b,a+1);return e};
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
_.A(q)}})};
|
|
117
|
-
|
|
118
|
-
c)};
|
|
119
|
-
|
|
120
|
-
_.
|
|
121
|
-
_.
|
|
122
|
-
var g=a.l[f];if(g&&g.gd&&(g=a.o.get(b.id))&&g.gd)if(e.stream!==b){g=a.j.presentationTimeline.getDuration();var h=a.C.Eb();h=
|
|
123
|
-
(
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
78
|
+
WE=function(a,b,c){var d=new _.pk(a===_.hk?""+b.videoId:a===_.gk?""+b.audioId:""+b.id,c);switch(a){case _.hk:d.codec=_.fk(b.videoCodec);d.bandwidth=b.videoBandwidth||b.bandwidth;d.width=b.width;d.height=b.height;d.originalId=b.originalVideoId;d.drm={keyId:b.keyId||void 0};break;case _.gk:d.codec=_.fk(b.audioCodec);d.bandwidth=b.audioBandwidth||b.bandwidth;d.originalId=b.originalAudioId;d.drm={keyId:b.keyId||void 0};break;default:d.codec=_.fk(b.codecs),d.originalId=b.originalTextId}(a=c.renditions.find(function(e){return _.O.la(e,
|
|
79
|
+
d,null,["id","track"])}))||c.renditions.push(d);return a||d};XE=function(a,b){var c=a.reduce(function(d,e){b===_.hk?null===e.videoId||d[e.videoId]&&!e.active||(d[e.videoId]=e):b===_.gk&&(null===e.audioId||d[e.audioId]&&!e.active||(d[e.audioId]=e));return d},{});return Object.values(c)};YE=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};
|
|
80
|
+
ZE=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};_.$E=function(a,b){a.forEach(function(c){c.startTime+=b;c.endTime+=b})};aF=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}};bF=function(a){return Object.assign({},a,{periods:a.periods.map(function(b){return Object.assign({},b)})})};
|
|
81
|
+
dF=function(a,b){try{if(1===a.length)return a[0];if(!a.every(cF))throw new _.Bi("Period durations must be finite");if(0===a.length)throw Error("Cannot concatenate 0 manifests");if(1===a.length)var c=a[0];else{for(var d=_.ch(a[0].periods).concat(),e=1;e<a.length;e++){var f=aF(a[e-1]).end;_.$E(a[e].periods,f);d.push.apply(d,_.ch(a[e].periods))}d={adaptedPeriods:d,periods:d,presentationTimeline:b,minBufferTime:0};var g=aF(d).end;_.hD(b.a,0,g);var h=a[0].presentationTimeline.qc();h&&_.kD(b,h.seekRangeStartDateTime);
|
|
82
|
+
c=d}return c}catch(l){throw new _.P(_.Q,7,7003,"Failed to join manifests into a continuous playlist!",l);}};eF=function(a,b){var c=b.periods[0].configurationId,d=_.ch(a.periods).concat().filter(function(f){return f.configurationId!==c}),e=a.presentationTimeline;d={adaptedPeriods:d,periods:d,presentationTimeline:e,minBufferTime:0};_.lD(e,b.presentationTimeline.o);return dF([d,b],e)};cF=function(a){return a.periods.every(function(b){return null!=b.endTime&&0<=b.endTime&&isFinite(b.endTime)})};
|
|
83
|
+
fF=function(){this.g=new _.K("cl.api.mse.TrackManager");this.m=null;this.h=[];this.a=new Map;this.f=new Map};gF=function(a,b){return a.h.filter(function(c){return c.type===b})};hF=function(a,b){var c=a.a.get(b)||null;return c&&c.track};jF=function(a,b,c){if(!c||hF(a,c.type)!==c||a.m.qa())switch(b){case _.hk:a.Za(c&&c.renditions[0]);break;case _.gk:a.ib(c&&c.renditions[0]);break;case _.T:a.jb(c&&c.renditions[0]);break;default:iF(a,b,c&&c.renditions[0])}};
|
|
84
|
+
kF=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)};
|
|
85
|
+
iF=function(a,b,c,d){d=void 0===d?!1:d;if(a.m&&((a.a.get(b)||null)!==c||a.m.qa())){var e=a.m;if(c){if(0>a.h.indexOf(c.track))throw Error("Unknown rendition with ID "+c.id);if(b!==c.track.type)throw Error("Types mismatch");a.g.debug("Activate rendition type\n "+b+" with ID: "+c.id);if(b===_.T){var f=e.ia().find(function(n){return n.id===parseInt(c.id,10)});f&&(a.f.set(b,c),kF(a,c),e.trigger(new _.L(_.Pl)),lF(e,!0).then(function(){mF(e,f)})["catch"](function(n){a.g.warn("Error while activating track",
|
|
86
|
+
n)}))}else if(b===_.gk)a.f.set(b,c),nF(e,parseInt(c.id,10));else if(b===_.hk){var g=a.a.get(_.gk)||null,h=null;if(g){var l=oF(e).filter(function(n){return n.videoId===parseInt(c.id,10)});h=l.find(function(n){return n.audioId===parseInt(g.id,10)})||null;if(!h){a.g.debug("Unable to find exact variant. Searching for equivalent");var m=g.track.renditions.map(function(n){return n.id}).filter(function(n){return n!==g.id});h=l.find(function(n){return m.find(function(p){return p===n.audioId})})||null}}else h=
|
|
87
|
+
oF(e).find(function(n){return n.videoId===parseInt(c.id,10)})||null;h?(a.f.set(b,c),pF(e,h,d)):a.g.warn("Cannot find matching variant")}}else a.g.debug(_.Ia+b),(h=hF(a,b))&&(b===_.T?lF(e,!1).then(function(){a.a.set(b,null);e.trigger(new _.L(_.Pl))})["catch"](function(n){a.g.warn("Error while de-activating text tracks",n)}):b===_.gk?a.g.info("Enabling ABR for audio is not supported"):b===_.hk&&h.trickPlay?a.g.info("Enabling ABR for trick play tracks is not supported"):pF(e,null,d))}};
|
|
88
|
+
sF=function(a){if(a.m){a.g.debug("Track list change detected, updating track list");for(var b=[],c=_.w(Object.values(_.gv)),d=c.next();!d.done;d=c.next())d=d.value,a.a.set(d,null),a.f.set(d,null);c={};d=_.w(a.m.ia());for(var e=d.next();!e.done;c={gc:c.gc},e=d.next()){e=e.value;c.gc=VE(_.T,e);var f=b.find(function(h){return function(l){return h.gc.la(l)}}(c));c.gc=f||c.gc;var g=WE(_.T,e,c.gc);e.active&&a.a.set(_.T,g);f||b.push(c.gc)}qF(a.m)||a.a.set(_.T,null);c=oF(a.m);rF(a,b,c,_.hk);rF(a,b,c,_.gk);
|
|
89
|
+
a.h=b}};rF=function(a,b,c,d){var e=XE(c,d);c={};e=_.w(e);for(var f=e.next();!f.done;c={hc:c.hc},f=e.next()){f=f.value;c.hc=VE(d,f);var g=b.find(function(l){return function(m){return l.hc.la(m)}}(c));c.hc=g||c.hc;var h=WE(d,f,c.hc);f.active&&a.a.set(d,h);g||b.push(c.hc)}};
|
|
90
|
+
tF=function(a,b,c){if(b){a.h.length||sF(a);for(var d=b.type,e=a.a.get(d)||null,f,g=_.w(gF(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&&(kF(a,f),d===_.gk?a.m.trigger(new _.L(_.Ol)):d===_.hk&&a.m.trigger(new _.L(_.Lg,{details:{width:f.width||0,height:f.height||0,bandwidth:f.bandwidth,track:f.track,abrSelection:c}})))}};uF=function(){this.f=new _.cD(2);this.h=new _.cD(5);this.a=0};
|
|
91
|
+
_.vF=function(){this.g=new _.K("clpp.abr");this.w=null;this.h=!1;this.o=new uF;this.l=[];this.j=1;this.D=this.B=!1;this.A=this.a=this.f=null};wF=function(a,b){b=b.filter(function(c){return!(c.video&&c.video.trickPlay)});a&&(b=b.filter(function(c){return LE(c,a,{width:Infinity,height:Infinity})}));return b.sort(function(c,d){return c.bandwidth-d.bandwidth})};xF=function(){this.a=null};zF=function(a,b){if(b&&(null==a.a||a.a!==b))throw yF(a);};
|
|
92
|
+
yF=function(a){return new _.P(_.Q,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.")};AF=function(){this.a=new Map};CF=function(a,b){a.a.has(b)||a.a.set(b,new BF);return a.a.get(b)};BF=function(){this.text=this.variant=null};DF=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)};
|
|
93
|
+
GF=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||EF(d,e))&&FF(d.roles,e.roles))}!d&&(d=a.video&&b.video)&&(a=a.video,b=b.video,d=!((!c||EF(a,b))&&FF(a.roles,b.roles)));return d?!1:!0};
|
|
94
|
+
EF=function(a,b){if(a.mimeType!==b.mimeType)return!1;var c=MC(a.codecs).map(function(f){return _.NC(f)}),d=MC(b.codecs).map(function(f){return _.NC(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};FF=function(a,b){var c=new Set(a),d=new Set(b);c["delete"](_.Le);d["delete"](_.Le);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};
|
|
95
|
+
IF=function(a){var b=void 0===b?_.If:b;this.f=a;this.a=b;this.h=new HF(a.language,"",a.audio&&a.audio.channelsCount?a.audio.channelsCount:0,!1,b)};HF=function(a,b,c,d,e){this.j=_.ji(a);this.a=b;this.f=c;this.l=void 0===d?!1:d;this.h=void 0===e?_.If:e};JF=function(a,b){var c=null;b.some(function(d){c=_.IC(_.dj(d),a.map(function(e){return HC(e)}));return!!c});return c?a.filter(function(d){return c===HC(d)}):[]};
|
|
96
|
+
KF=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)})};LF=function(a,b){return a.filter(function(c){return c.audio&&c.audio.spatialAudio!==b?!1:!0})};OF=function(a,b){this.a=MF;this.f=(new Map).set(MF,b).set(NF,a)};
|
|
97
|
+
QF=function(a){var b=this;this.C=a;this.a=a.getConfiguration().streaming;this.f=new _.Uh;this.g=new _.K("clpp.mse.media.LiveEdgeObserver");PF(this)&&(a=this.C.getSurface().getMedia(),this.f.on(a,_.rg,function(){var c=b.C.getPosition(),d=b.C.getSeekRange().end;c=d-c;var e=b.C.getPlaybackRate(),f=b.a.stopChasingAt;1<=e&&c>=b.a.chaseJumpDistance?(b.g.debug("Too far from edge, jump to beginning."),b.C.setPlaybackRate(1),b.C.seek(d)):1===e&&c>=b.a.startChasingAt?(b.g.debug("Not on live edge, increase playback rate."),
|
|
98
|
+
b.C.setPlaybackRate(b.a.chasingRate,_.Xd)):1<e&&c<=f&&(b.g.debug("On live edge, reduce playback rate."),b.C.setPlaybackRate(1))}))};
|
|
99
|
+
PF=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};
|
|
100
|
+
SF=function(a,b,c,d,e){this.j=a;this.D=c;this.a={};this.G={};this.N=!1;this.f=null;this.h={};this.l=new _.Uh;this.K=!1;this.w={};this.I=b;this.B=d;this.J=e;this.V=this.J.streaming.maxSegmentToMediaOffset||1;this.L=new _.Oj;this.A="";this.H={};this.o=RF(this,this.L);this.S=!0;this.g=new _.K("clpp.mse.MediaSourceEngineSmooth")};
|
|
101
|
+
RF=function(a,b){if(window.ManagedMediaSource){a.j.disableRemotePlayback=!0;var c=new ManagedMediaSource;a.l.one(c,kC,function(){URL.revokeObjectURL(a.A);b.resolve()});a.l.on(c,lC,function(){a.S=!0});a.l.on(c,"endstreaming",function(){a.S=!1});a.A=TF(c);a.j.src=a.A;return c}c=new MediaSource;a.A=TF(c);a.l.one(c,kC,function(){URL.revokeObjectURL(a.A);b.resolve()});a.j.src=a.A;return c};
|
|
102
|
+
UF=function(a,b){b.forEach(function(c,d){var e=a.o.addSourceBuffer(c);a.l.on(e,_.re,a.T.bind(a,d));a.l.on(e,"updateend",a.lc.bind(a,d));a.a[d]=e;a.G[d]=c;a.h[d]=[];a.H[d]=!1});a.N=b.has(_.ad)&&b.has(_.r)};VF=function(a,b){try{return new _.Ul(a.a[b].buffered,b)}catch(c){return b in a.a&&a.g.error($B+b,c),null}};WF=function(a,b){if(!a.a[b])return"";var c=VF(a,b);return c?c.toString():""};
|
|
103
|
+
ZF=function(a,b,c,d,e,f){return[f?Promise.resolve():XF(a,b,function(){try{a.g.debug(iB+b+YA);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(vB+b+YA,l),l;}a.g.debug(pB+b+YA);a.lc(b)}),XF(a,b,function(){return YF(a,b,c)}),XF(a,b,function(){try{a.g.debug(NB+b,d,e),a.a[b].appendWindowStart=0,a.a[b].appendWindowEnd=e,a.a[b].appendWindowStart=d}catch(g){throw a.g.warn(zB+b,d,e,g),g;}a.g.debug(tB+b,d,e);a.lc(b)})]};
|
|
104
|
+
YF=function(a,b,c){0>c&&(c+=.001);try{a.g.debug(PB+b,c),a.a[b].timestampOffset=c}catch(d){throw a.g.warn(AB+b,c,d),d;}a.g.debug(uB+b,c);a.lc(b)};XF=function(a,b,c){if(a.K)return Promise.reject();c={start:c,p:new _.Oj};a.h[b].push(c);1===a.h[b].length&&$F(a,b);return c.p};$F=function(a,b){var c=a.h[b][0];if(c)try{a.g.debug(RB+b),c.start()}catch(d){d.name===JB?c.p.reject(new _.P(_.Q,3,3017,{type:b})):c.p.reject(new _.P(_.Q,3,3015,{mediaError:d})),aG(a,b)}else a.g.debug(FB+b)};
|
|
105
|
+
bG=function(a,b){var c,d,e,f,g,h,l,m,n;return _.H(function(p){switch(p.a){case 1:if(a.K)return p["return"](Promise.reject());c=[];for(d in a.a)e=new _.Oj,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();_.B(p,2);return _.y(p,Promise.all(c),4);case 4:_.qh(p,3);break;case 2:g=_.E(p);for(h in a.a)a.h[h].length&&a.h[h].shift();return p["return"](Promise.reject(g));case 3:for(l in a.a);_.B(p,5,6);return _.y(p,b(),6);case 6:_.rh(p);for(m in a.a)aG(a,
|
|
106
|
+
m);_.sh(p,0);break;case 5:return n=_.E(p),p["return"](Promise.reject(new _.P(_.Q,3,3015,{mediaError:n})))}})};aG=function(a,b){a.h[b].shift();$F(a,b)};cG=function(a,b,c){return XF(a,b,function(){b===_.R?a.g.debug("Change not supported for "+b):(a.g.debug("Change Type: "+a.G[b]+" -\x3e "+c),PC()?(a.a[b].changeType(c),a.G[b]=c):a.g.debug("Change Type not supported"),a.lc(b))})};
|
|
107
|
+
dG=function(a,b,c,d){var e,f,g,h,l;return _.H(function(m){return 1==m.a?(e=_.NC(_.Tk(a.G[b])),f=_.Sk(a.G[b]),g=_.Rk(c,d),h=_.NC(_.Tk(g)),l=_.Sk(g),e===h&&f===l?m["return"](!1):a.J.mediaSource.codecSwitchingStrategy===_.dg&&PC()?_.y(m,cG(a,b,g),2):m.F(2)):m["return"](!0)})};eG=function(a){this.h=a;this.a=null;this.f=function(){}};fG=function(a,b){a.f=b};
|
|
108
|
+
gG=function(a){var b=this;this.f=a;this.o=this.A=this.l=!1;this.h=this.f.sh();this.w=_.Xd;this.j=null;this.a=new _.Wk(function(){b.A||b.f.Gl(.25*b.h)});this.g=new _.K("clpp.mse.media.PlayRateController")};hG=function(a,b){a.j=b;a.j.speedUpMode&&(a.w=a.j.speedUpMode)};
|
|
109
|
+
kG=function(a,b){a.a.stop();a.l||(a.o=!1);var c=a.l?0:a.h;if((b?b:a.w)===_.Xd||0===c||1===c)try{iG(a,c)}catch(d){a.g.warn('Set playbackRate using "decoder" mode fails, due to unsupported range by platform. Fallback to "seek" mode.',d),jG(a)}else jG(a)};jG=function(a){a.g.debug(OB,a.h,' using "seek" mode.');iG(a,0);a.o=!0;a.a.lb(.25)};iG=function(a,b){if(a.f.sh()!==b){a.g.debug(OB,b,' using native playbackRate "decoder" mode.');try{a.f.dn(b)}catch(c){throw c;}}};
|
|
110
|
+
mG=function(a){function b(){d=!0}function c(m){f.push(m);_.Qm(m)}a=_.lj(a);var d=!1,e,f=[],g=[];(new _.Pm).M(_.Te,c).M(_.sg,c).M(_.Oe,c).M(_.Se,c).M(_.ig,c).Y(_.kg,function(m){e=m;f.push(m);_.Rm(m)}).Y("encv",b).Y("enca",b).Y("avc1",function(m){g.push({M:m,ed:1701733238})}).Y("avc3",function(m){g.push({M:m,ed:1701733238})}).Y("ac-3",function(m){g.push({M:m,ed:1701733217})}).Y(_.ne,function(m){g.push({M:m,ed:1701733217})}).Y("mp4a",function(m){g.push({M:m,ed:1701733217})}).parse(a);if(d)return _.Jh("Init segment already indicates encryption."),
|
|
111
|
+
a;if(0===g.length||!e)throw _.Lh("Failed to find boxes needed to fake encryption!"),_.Lh("Failed init segment (hex):",_.zj(a)),new _.P(_.Q,3,14E3);g.reverse();for(var h=_.w(g),l=h.next();!l.done;l=h.next())l=l.value,_.Jh('Inserting "'+_.Um(l.ed)+'" box into init segment.'),a=lG(a,e,l.M,f,l.ed);return a};
|
|
112
|
+
lG=function(a,b,c,d,e){var f=nG.value(),g=a.subarray(c.start,c.start+c.size),h=_.sj(g),l=new Uint8Array(c.size+f.byteLength);l.set(g,0);g=_.sj(l);g.setUint32(4,e);l.set(f,c.size);e=h.getUint32(4);g.setUint32(c.size+16,e);oG(l,0,l.byteLength);e=new Uint8Array(a.byteLength+l.byteLength);c=_.Zk("Xbox One")||_.Yk()?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,oG(e,d.start,d.size+l.byteLength);l=_.sj(e,
|
|
113
|
+
b.start);b=_.Vm(b);a=l.getUint32(b);l.setUint32(b,a+1);return e};oG=function(a,b,c){a=_.sj(a,b);b=a.getUint32(0);0!==b&&(1===b?(a.setUint32(8,c>>32),a.setUint32(12,c&4294967295)):a.setUint32(0,c))};_.pG=function(a,b){this.C=b;this.j=a;this.h=null;this.w=1;this.G=Promise.resolve();this.l=[];this.o=new Map;this.a=new Map;this.I=this.f=this.A=this.B=!1;this.H=0;this.g=new _.K("clpp.mse.Streaming");this.D=!1};rG=function(a){var b=a.a.get(_.r);return b?qG(a)[b.Hb]:(b=a.a.get(_.ad))?qG(a)[b.Hb]:null};
|
|
114
|
+
tG=function(a){return _.sG(a,_.ad)};uG=function(a){return _.sG(a,_.r)};
|
|
115
|
+
zG=function(a,b){var c,d,e,f,g,h,l,m,n,p;return _.H(function(q){switch(q.a){case 1:return c=_.Kp,_.y(q,a.C.W.clear(c.TEXT),2);case 2:return a.H++,a.I=!1,d=a.H,e=a.C.W,f=new Map,g=new Set,f.set(c.TEXT,b),g.add(b),_.y(q,e.init(f,!1,a.h.disableAudioTracks),3);case 3:return a.f?q["return"]():_.y(q,vG(a,g),4);case 4:if(a.f)return q["return"]();l=(h=e.getTextDisplayer().isTextVisible())||a.h.alwaysStreamText;a.H!==d||a.a.has(c.TEXT)||a.I||!l||(m=a.C.Eb(),n=wG(a,m),p=xG(b,n,0),a.a.set(c.TEXT,p),yG(a,p,0));
|
|
116
|
+
_.A(q)}})};CG=function(a){a.I=!0;var b=a.a.get(_.R);b&&(AG(b),BG(b)["catch"](function(){}),a.a["delete"](_.R))};EG=function(a,b,c,d){b.video&&_.DG(a,b.video,c,d);b.audio&&_.DG(a,b.audio,c,d)};GG=function(a,b){a.j.adaptedPeriods=b.adaptedPeriods;a.j.periods=b.periods;FG(a)};
|
|
117
|
+
IG=function(a){function b(l){return a.C.W.sb(l,c,0)}var c=a.C.Eb(),d=!1,e=wG(a,c);if(_.ij(a.a.values(),function(l){return l.Hb===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)||(HG(a,h),d=!0)}else if(!_.ij(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())HG(a,f.value);d=!0}d||a.g.debug("(all): seeked: buffered seek: presentationTime\x3d"+
|
|
118
|
+
c)};LG=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.A)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=JG(d);if(d.Zc||b&&KG(d))a.g.info(e,"Retrying after failure..."),d.Zc=!1,yG(a,d,.1)}};MG=function(a){return Array.from(a.a.values()).some(function(b){return null!==b.ab})};
|
|
119
|
+
NG=function(a){var b=Array.from(a.a.values());return a.B&&b.every(function(c){return c.endOfStream})};PG=function(a){var b,c,d,e;return _.H(function(f){b=[];c=_.w(a.a.values());for(d=c.next();!d.done;d=c.next())e=d.value,AG(e),e.gb&&e.Jb&&(e.gb=!1,b.push(e.Jb.abort())),e.Nb&&b.push(OG(a,e,!0,0));return _.y(f,Promise.all(b),0)})};QG=function(a,b,c){(a=a.a.get(b))&&c&&(AG(a),a.stream=c,a.Zb=c,a.va&&(a.va=c.getSegmentReference(a.va.position)),a.va||(a.Zb=null))};
|
|
120
|
+
_.sG=function(a,b){var c=a.a.get(b);return c?c.cc||c.stream:null};
|
|
121
|
+
_.DG=function(a,b,c,d){var e=a.a.get(b.type);if(!e&&b.type===_.R&&a.h.ignoreTextStreamFailures)zG(a,b);else if(e){var f=$C(qG(a),b);if(c&&f!==e.Hb)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())HG(a,c.value);else{e.cc&&(a.g.debug("switch during trick play mode",b),b.trickModeVideo?(e.cc=b,b=b.trickModeVideo,a.g.debug("switch found trick play stream",b)):(e.cc=null,a.g.debug("switch found no special trick play stream")));
|
|
122
|
+
var g=a.l[f];if(g&&g.gd&&(g=a.o.get(b.id))&&g.gd)if(e.stream!==b){g=a.j.presentationTimeline.getDuration();var h=a.C.Eb();h=RG(a,e,h);!c&&(e.endOfStream||h>=g)?a.g.debug(nC+JG(e)+" already buffered to the end. Not switching."):(b.type===_.R&&a.C.W.bc(_.Rk(b.mimeType,b.codecs)),e.stream=b,e.stream.segmentIterator=null,e.Vd=!0,a.g.debug("switch: switching to Stream "+JG(e)),SG(a,e,f)&&(a.g.info("Aborting current segment request to switch."),e.Jb.abort()),c&&(e.jc?e.Re=!0:e.gb?(e.Nb=!0,e.oe=d,e.Re=!0):
|
|
123
|
+
(AG(e),OG(a,e,!0,d)["catch"](function(l){if(a.C)a.C.onError(l)}))))}else a.g.debug(nC+JG(e)+" already active")}}};SG=function(a,b,c){if(!b.Jb)return!1;var d=a.C.Eb(),e=a.C.W.ha(b.type);c=(c=TG(a,b,d,e,c))?c.Fd():null;if(null==c)return!1;var f=b.stream.initSegmentReference;f&&(c+=f.Fd()||0);f=a.C.ve().getBandwidthEstimate();if(8*c/f<(null===e?0:e-d)-Math.max(a.j.minBufferTime||0,a.h.rebufferingGoal))return!0;a=b.Jb;a=a.j?a.j.bytesRemaining:-1;return 0>a||a>c?!0:!1};
|
|
124
|
+
HG=function(a,b){var c=JG(b);b.jc?a.g.debug(c,"clear: already clearing the buffer"):b.Nb?a.g.debug(c,"clear: already waiting"):b.gb?(a.g.debug(c,"clear: currently updating"),b.Nb=!0,b.oe=0):null==a.C.W.Ga(b.type)?(a.g.debug(c,"clear: nothing buffered"),null==b.ab&&yG(a,b,0)):(a.g.debug(c,"clear: handling right now"),AG(b),OG(a,b,!1,0)["catch"](function(d){if(a.C)a.C.onError(d)}))};
|
|
125
|
+
UG=function(a,b,c,d,e){var f,g,h,l,m,n,p;return _.H(function(q){if(1==q.a)return f=a.C.Eb(),g=wG(a,f),h=_.Kp,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.C.W,p=a.h.forceNativeTS,_.y(q,n.init(l,p,a.h.disableAudioTracks),2);if(3!=q.a){if(a.f)return q["return"]();FG(a);return _.y(q,vG(a,m),3)}if(a.f)return q["return"]();l.forEach(function(u,v){if(!a.a.has(v)){var z=xG(u,g,e);a.a.set(v,z);yG(a,z,0)}});_.A(q)})};
|
|
126
|
+
xG=function(a,b,c){return{stream:a,type:a.type,Zb:null,segmentIterator:null,va:null,cc:null,Vd:!0,Hb:b,endOfStream:!1,gb:!1,ab:null,Nb:!1,oe:0,Re:!1,jc:!1,Zf:!1,Zc:!1,ni:c||0,Jb:null,te:!1,Kh:0}};
|
|
127
|
+
VG=function(a,b){var c=a.l[b];if(c)return a.g.debug("(all) Period "+b+$A),c.P;a.g.debug("(all) setting up Period "+b);c={P:new _.Oj,gd:!1};a.l[b]=c;for(var d=new Set,e=_.w(qG(a)[b].variants),f=e.next();!f.done;f=e.next())f=f.value,f.video&&d.add(f.video),f.video&&f.video.trickModeVideo&&d.add(f.video.trickModeVideo),f.audio&&d.add(f.audio);e=_.w(qG(a)[b].textStreams);for(f=e.next();!f.done;f=e.next())d.add(f.value);a.G=a.G.then(function(){return a.f?null:vG(a,d)}).then(function(){a.f||(a.l[b].P.resolve(),
|
|
128
128
|
a.l[b].gd=!0,a.g.debug("(all) setup Period "+b))})["catch"](function(g){a.f||(a.l[b].P["catch"](function(){}),a.l[b].P.reject(),delete a.l[b],a.g.warn("(all) failed to setup Period "+b),a.C.onError(g))});return c.P};
|
|
129
|
-
|
|
130
|
-
e.value,a.o.get(n.id).P["catch"](function(){}),a.o.get(n.id).P.reject(),a.o["delete"](n.id);throw l;case 3:p=_.w(b);for(e=p.next();!e.done;e=p.next())q=e.value,u=a.o.get(q.id),u.gd||(u.P.resolve(),u.gd=!0,a.g.debug("(all) setup Stream "+q.id));_.A(v)}})};
|
|
131
|
-
|
|
132
|
-
a.w,n=
|
|
133
|
-
d=Infinity;l=_.w(a.a.values());for(m=l.next();!m.done;m=l.next())m=m.value,c(m)||(m=
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
e,g),null==f)a=null;else{var h=null==a.h?!1:a.h.ignoreDrift;null!=d||h||(d=f,d.ya+d.startTime+2>c&&(a=
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
0;v.then(function(){return a.f||a.A?null:
|
|
141
|
-
D.code?a.g.warn(g,"Text stream failed to download. Proceeding without it."):a.g.warn(g,"Text stream failed to parse. Proceeding without it."),a.a["delete"](f.TEXT),G.F(0);if(7001===D.code)return b.gb=!1,b.ab=null,
|
|
142
|
-
_.P&&D.a(1),
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
!0);p=n.then(function(u){if(a.f)return null;a.g.debug(l,"appending init segment");return
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
a.C.
|
|
150
|
-
"Appending segment with "+(F.toFixed(3)+" - "+D.toFixed(3)+" KeyID: ")+(e.keyId+" Width: ")+(e.width+" Height: "+e.height+" Bitrate: ")+(_.S.
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
f,f+h).then(function(){a.f||a.g.debug(d,"evicted "+h+" seconds")})};
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
h.variant.video);h.variant&&h.variant.audio&&l.set(_.
|
|
158
|
-
a.C.onError(new _.P(_.Q,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))?(_.
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
c);c=a.C.vb.fetch(f);b.Jb=c;return c.P.then(function(g){var h=a.C.
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
this.configuration.preferredAudioChannelCount,this.configuration.preferSpatialAudio,this.configuration.mediaSource.codecSwitchingStrategy);this.Cd=this.configuration.preferredTextLanguage;this.
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
_.wp)&&a.Ic&&a.Ic.stop();b===_.qp?a.trigger(new _.L(_.
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
0;d<f.length;d++)if(!f[d].la(c[d])){f=!1;break a}f=!0}!f&&a.trigger(new _.L(_.
|
|
174
|
-
|
|
175
|
-
break}return _.y(l,
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
a.J=null);if(!a.L){c.F(
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
129
|
+
vG=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,u;return _.H(function(v){switch(v.a){case 1:c=[];d=_.w(b);for(e=d.next();!e.done;e=d.next())f=e.value,(g=a.o.get(f.id))?(a.g.debug("(all) Stream "+f.id+$A),c.push(g.P)):(a.g.debug("(all) setting up Stream "+f.id),a.o.set(f.id,{P:new _.Oj,gd:!1}),h=a.C.vb,c.push(f.createSegmentIndex(h)));_.B(v,2);return _.y(v,Promise.all(c),4);case 4:if(a.f)return v["return"]();_.qh(v,3);break;case 2:l=_.E(v);if(a.f)return v["return"]();m=_.w(b);for(e=m.next();!e.done;e=m.next())n=
|
|
130
|
+
e.value,a.o.get(n.id).P["catch"](function(){}),a.o.get(n.id).P.reject(),a.o["delete"](n.id);throw l;case 3:p=_.w(b);for(e=p.next();!e.done;e=p.next())q=e.value,u=a.o.get(q.id),u.gd||(u.P.resolve(),u.gd=!0,a.g.debug("(all) setup Stream "+q.id));_.A(v)}})};FG=function(a){var b=a.j.presentationTimeline.getDuration();Infinity>b?a.C.W.tf(b):a.C.W.tf(Math.pow(2,32))};
|
|
131
|
+
YG=function(a,b){function c(p){return p.type===_.R&&p.stream.mimeType===_.Tc}if(c(b))return a.C.W.Mg(b.stream.originalId||""),null;b.type===_.R&&a.C.W.Eg();if(!a.C.W.Hh()&&b.type!==_.R)return a.h.bufferLimitUpdateInterval?a.h.bufferLimitUpdateInterval/2:.5;var d=JG(b),e=a.C.Eb(),f=RG(a,b,e);a.g.debug(d,"timeNeeded\x3d"+f);var g=$C(qG(a),b.stream),h=wG(a,f),l=a.C.W.xa(b.type,e);a.g.debug(d,"update_:",gC+e,"bufferedAhead\x3d"+l);var m=Math.max(a.j.minBufferTime||0,a.h.rebufferingGoal,a.h.bufferingGoal)*
|
|
132
|
+
a.w,n=mD(a.j.presentationTimeline);if(null!=n&&f>=n&&!b.te)return WG(a,b),null;b.endOfStream=!1;b.Hb=h;if(h!==g)return a.g.debug(d,"need Period "+h,gC+e,"timeNeeded\x3d"+f,"currentPeriodIndex\x3d"+g),null;if(l>=m)return a.g.debug(d,"buffering goal met"),a.h.bufferLimitUpdateInterval||.5;h=a.C.W.ha(b.type);h=TG(a,b,e,h,g);if(!h)return a.j.presentationTimeline.isLive()||b.type===_.R?a.h.bufferLimitUpdateInterval||1:(a.g.debug("Media state "+d+": no next segment found. Assuming EOS."),WG(a,b),null);
|
|
133
|
+
d=Infinity;l=_.w(a.a.values());for(m=l.next();!m.done;m=l.next())m=m.value,c(m)||(m=RG(a,m,e),d=Math.min(d,m));if(f>=d+a.j.presentationTimeline.h)return a.h.bufferLimitUpdateInterval||1;b.ni=0;XG(a,b,e,g,h)["catch"](function(){});return null};WG=function(a,b){a.g.debug(JG(b),"buffered to end of presentation");b.endOfStream=!0;if(b.type===_.r){var c=a.a.get(_.R);c&&c.stream.mimeType===_.Tc&&(c.endOfStream=!0)}};
|
|
134
|
+
RG=function(a,b,c){if(!b.Zb||!b.va)return Math.max(c,b.ni);c=$C(qG(a),b.Zb);return qG(a)[c].startTime+b.va.endTime};
|
|
135
|
+
TG=function(a,b,c,d,e){if(b.stream.segmentLookupStrategy===_.bC)b.stream.segmentIterator?a=ED(b.stream.segmentIterator):b.va||d?(c=b.va?b.va.endTime:d,a.g.info(CB,"looking up segment from new stream endTime:",c),b.stream.segmentIterator=ID(b.stream.segmentIndex,c),e=b.stream.segmentIterator.next().value,null===e&&(b.stream.segmentIterator=null,a.g.warn(CB,XB,"endTime:",c,b.va)),a=e):(e=Math.max(0,c-qG(a)[e].startTime),a.g.info(CB,"looking up segment","lookupTime:",e,fC,c),d=null,d||(b.stream.segmentIterator=
|
|
136
|
+
ID(b.stream.segmentIndex,e),d=b.stream.segmentIterator.next().value),null===d&&a.g.warn(CB,XB,"lookupTime:",e,fC,c),a=d);else{var f=JG(b);if(b.va&&b.stream===b.Zb)c=b.va.position+1,a.g.debug(f,"next position known:","position\x3d"+c),a=ZG(a,b,e,c);else{if(b.va){a.g.debug(f,"next position unknown: another Stream buffered");f=$C(qG(a),b.Zb);var g=$G(a,b,qG(a)[f].startTime+b.va.endTime,e)}else a.g.debug(f,"next position unknown: nothing buffered"),g=$G(a,b,d||c,e);if(null==g)a=null;else if(f=ZG(a,b,
|
|
137
|
+
e,g),null==f)a=null;else{var h=null==a.h?!1:a.h.ignoreDrift;null!=d||h||(d=f,d.ya+d.startTime+2>c&&(a=ZG(a,b,e,Math.max(0,g-1)))&&(f=a));a=f}}}return a};$G=function(a,b,c,d){var e=JG(b);d=qG(a)[d];var f=Math.max(0,c-d.startTime);b=b.stream.findSegmentPosition(f);a.g.debug(e,"Looked up segment:",gC+c,"lookupTime\x3d"+f,ZB+d.startTime,"Result: segment position\x3d"+b);null==b&&a.g.warn(e,"cannot find segment:",ZB+d.startTime,"lookupTime\x3d"+f);return b};
|
|
138
|
+
ZG=function(a,b,c,d){var e=JG(b);c=qG(a)[c];var f=b.stream.getSegmentReference(d);if(!f)return a.g.debug(e,"segment does not exist:",ZB+c.startTime,"position\x3d"+d),null;var g=a.j.presentationTimeline;d=_.sD(g);g=rD(g);return!b.te&&(c.startTime+f.endTime<d||c.startTime+f.startTime>g)?(a.g.debug(e,"segment is not available:",ZB+c.startTime,jC+f.startTime,hC+f.endTime,"availabilityStart\x3d"+d,"availabilityEnd\x3d"+g),null):f};
|
|
139
|
+
XG=function(a,b,c,d,e){var f,g,h,l,m,n,p,q,u,v,z,C,I;return _.H(function(F){f=_.Kp;g=JG(b);h=qG(a)[d];a.g.debug(g,"fetchAndAppend_:",gC+c,ZB+h.startTime,iC+e.position,jC+e.startTime,hC+e.endTime);l=b.stream;m=b.stream.segmentIterator;n=a.j.presentationTimeline.getDuration();p=qG(a)[d+1];q=Math.max(0,h.startTime-.1);u=p?p.startTime+.01:n;v=aH(a,b,d,q,u,e);b.gb=!0;b.Vd=!1;a.g.debug(g,"fetching segment");z=!1;C=function(D,G){if(a.f||a.A)return null;z=!0;return bH(a,b,c,h,l,e,D,G)};I=a.C.W.ha(b.type)||
|
|
140
|
+
0;v.then(function(){return a.f||a.A?null:cH(a,b,e,!1,function(D){return C(D.data,!0)})}).then(function(D){return a.f||a.A?null:z||null===D?(dH(a,b,I,e,l),null):C(D,!1)}).then(function(){if(!a.f&&!a.A){dH(a,b,I,e,l);b.gb=!1;b.Zf=!1;b.Nb||a.C.Je();if(m){var D=m.next().value;D&&a.g.debug("New iterated segment",D)}yG(a,b,0);eH(a,b,l);a.g.debug(g,"finished fetch and append")}})["catch"](function(D){return _.H(function(G){if(a.f||a.A)return G["return"]();b.gb=!1;if(b.type===f.TEXT&&a.h.ignoreTextStreamFailures)return 1001===
|
|
141
|
+
D.code?a.g.warn(g,"Text stream failed to download. Proceeding without it."):a.g.warn(g,"Text stream failed to parse. Proceeding without it."),a.a["delete"](f.TEXT),G.F(0);if(7001===D.code)return b.gb=!1,b.ab=null,yG(a,b,0),G.F(0);if(3017===D.code)return fH(a,b,D),G.F(0);if(1001===D.code&&D.data&&404===D.data[1])return a.g.warn(g,"request for segment failed","segment not available on server",iC+e.position,jC+e.startTime,hC+e.endTime,"error\x3d"+D),b.gb=!1,b.ab=null,yG(a,b,1),G.F(0);if(b.type===f.TEXT)return D instanceof
|
|
142
|
+
_.P&&D.a(1),AG(b),a.C.onError(new _.P(1,2,2010,D)),G.F(0);if(1001<=D.code&&1003>=D.code)return _.y(G,gH(a,b,h,D),0);a.g.error(g,"failed fetch and append: code\x3d"+D.code);b.Zc=!0;D instanceof _.P&&D.a(_.Q);return _.y(G,hH(a,D),0)})});_.A(F)})};
|
|
143
|
+
fH=function(a,b,c){var d=JG(b);if(Array.from(a.a.values()).some(function(f){return f!==b&&f.Zf}))a.g.debug(d,EB,"waiting for another stream to recover...");else{var e=Math.round(100*a.w);if(20<e)a.w-=.2;else if(4<e)a.w-=.04;else{a.g.error(d,"MediaSource threw QuotaExceededError too many times");b.Zc=!0;a.A=!0;a.C.onError(c);return}a.g.warn(d,EB,"reducing buffering goals by "+(100-Math.round(100*a.w))+"%");b.Zf=!0}yG(a,b,4)};
|
|
144
|
+
gH=function(a,b,c,d){var e,f;return _.H(function(g){e=1001===d.code&&500<=d.data.status;f=!0;e||(f=!a.C.jf(b.stream,c));if(!f)return g.F(0);b.Zc=!0;d.a(_.Q);return _.y(g,hH(a,d),0)})};
|
|
145
|
+
aH=function(a,b,c,d,e,f){var g,h,l,m,n,p;return _.H(function(q){g=qG(a)[c];h=g.startTime-f.ya;if(!b.Vd&&h===b.Kh)return q["return"](Promise.resolve());b.Kh=h;l=JG(b);a.g.debug(l,"setting timestamp offset to "+h);a.g.debug(l,"setting append window start to "+d);a.g.debug(l,"setting append window end to "+e);m=a.C.W.oi(b.type,h,d,e,b.stream.mimeType,b.stream.codecs);if(!b.stream.initSegmentReference||!b.Vd)return q["return"](m);a.g.debug(l,"fetching init segment");n=cH(a,b,b.stream.initSegmentReference,
|
|
146
|
+
!0);p=n.then(function(u){if(a.f)return null;a.g.debug(l,"appending init segment");return iH(a,u,b).then(function(){return a.C.W.qe(b.type,u,null,null,!!b.stream.closedCaptions&&0<b.stream.closedCaptions.size)})})["catch"](function(u){b.Vd=!0;return Promise.reject(u)});return q["return"](Promise.all([m,p]))})};
|
|
147
|
+
iH=function(a,b,c){var d;return _.H(function(e){if(!a.h.patchEdgeWhenMixedContent||!_.Yk())return e.F(0);d=mG(b);return _.y(e,a.C.W.qe(c.type,d.buffer,null,null,!!c.stream.closedCaptions&&0<c.stream.closedCaptions.size),0)})};
|
|
148
|
+
bH=function(a,b,c,d,e,f,g,h){h=void 0===h?!1:h;var l,m,n,p,q,u,v,z,C;return _.H(function(I){switch(I.a){case 1:l=JG(b);if(!(e&&e.keyId&&a.C.wd)){I.F(2);break}m=uC(a.C.wd,e.keyId);if(!m){a.g.warn("Unable to find DRM session for "+e.keyId);I.F(2);break}_.B(I,4);return _.y(I,m,6);case 6:_.qh(I,2);break;case 4:n=_.E(I),a.g.warn("DRM session load failed!",n);case 2:if(!(e.encrypted&&e.keyId&&a.C.wd&&wC(a.C.wd,e.keyId))){I.F(7);break}AG(b);p=$C(qG(a),e);q=jH(a,p);if(!q){I.F(8);break}return _.y(I,q,8);case 8:return u=
|
|
149
|
+
a.C.jf(e,d,cC),v=f.startTime+d.startTime,z=f.endTime+d.startTime,a.g.warn(l,"Blocked append for "+v+" - "+z+": "+u+". Stream with Key ID "+(e.keyId+" has restrictions.")),I["return"](Promise.resolve());case 7:return C=e.closedCaptions&&0<e.closedCaptions.size,null!=e.emsgSchemeIdUris&&0<e.emsgSchemeIdUris.length&&(new _.Pm).Y("emsg",a.Cm.bind(a,d,f,e.emsgSchemeIdUris)).parse(g),I["return"](kH(a,b,c).then(function(){if(a.f)return null;var F=f.startTime+d.startTime,D=f.endTime+d.startTime;a.g.debug(l,
|
|
150
|
+
"Appending segment with "+(F.toFixed(3)+" - "+D.toFixed(3)+" KeyID: ")+(e.keyId+" Width: ")+(e.width+" Height: "+e.height+" Bitrate: ")+(_.S.hf(e.bandwidth)+" Fragment: ")+h);return a.C.W.qe(b.type,g,F,D,C,e.id,h)}).then(function(){a.f||(a.g.debug(l,"appended media segment"),b.Zb=e,b.va=f)}))}})};
|
|
151
|
+
dH=function(a,b,c,d,e){if(!a.j.presentationTimeline.isLive()&&b.type!==_.R){var f=JG(b),g=(a.C.W.ha(b.type)||0)-c,h=d.endTime-d.startTime;c=g-h;if(Math.abs(c)>=Math.min(.01,h)&&Math.abs(c)<=Math.min(1,h))for(a.g.debug(f,"Adjusted segment",d.position,"with real duration",g,"and accounted for",c,"delta between segment duration and real duration"),b.te=!0,a=qG(a),e.adjustSegmentDurations(d.position,c),d=$C(a,e),b=a[d],e=e.getDuration(),bD(b,e),e=d+1;e<a.length;e++)a[e].startTime+=c}};
|
|
152
|
+
lH=function(a,b,c){(new _.Pm).M(_.Te,_.Qm).M(_.sg,_.Qm).M(_.Oe,_.Qm).M(_.Se,_.Qm).M(_.ig,_.Qm).Y(_.kg,_.Rm).M("encv",function(d){d.reader.skip(78);_.Qm(d)}).M(_.cg,_.Qm).M("schi",_.Qm).M("tenc",function(d){d.reader.skip(6);if(_.Im(d.reader)){d.reader.skip(1);var e=_.zj(_.Om(d.reader,16));e!==b.stream.keyId&&(a.g.debug(JG(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)};
|
|
153
|
+
kH=function(a,b,c){if(a.f)return Promise.resolve();var d=JG(b);a.g.debug(d,"checking buffer length");var e=Math.max(a.h.bufferBehind,a.j.presentationTimeline.h),f=a.C.W.Ga(b.type);if(null==f)return a.g.debug(d,"buffer behind okay because nothing buffered:",gC+c,UB+e),Promise.resolve();var g=c-f,h=g-e;if(.01>=h)return a.g.debug(d,"buffer behind okay:",gC+c,VB+g,UB+e,"underflow\x3d"+Math.abs(h)),Promise.resolve();a.g.debug(d,"buffer behind too large:",gC+c,VB+g,UB+e,"overflow\x3d"+h);return a.C.W.remove(b.type,
|
|
154
|
+
f,f+h).then(function(){a.f||a.g.debug(d,"evicted "+h+" seconds")})};eH=function(a,b,c){if(!a.B){b=JG(b);var d=Array.from(a.a.values());1!==d.length||d[0].type!==_.R?a.B=d.every(function(e){return e.type===_.R||a.D?!0:!e.Nb&&!e.jc&&e.va}):a.D&&(a.B=!0);a.B&&(a.g.debug(b,"startup complete"),c=$C(qG(a),c),jH(a,c))}};
|
|
155
|
+
jH=function(a,b){var c=null;a.l[b]||(c=VG(a,b).then(function(){a.f||(a.g.debug(WB),a.C.Mf())})["catch"](CC));for(var d=0;d<qG(a).length;++d)VG(a,d)["catch"](CC);a.C.wm&&(a.g.debug("calling onStartupComplete()..."),a.C.wm());return c};
|
|
156
|
+
mH=function(a,b){var c=JG(b),d=$C(qG(a),b.stream);if(b.Hb!==d){var e=b.Hb,f=Array.from(a.a.values());f.every(function(g){return g.Hb===e})?f.every(KG)?(a.g.debug(c,"all need Period "+e),VG(a,e).then(function(){if(!a.f)if(a.C.W.mi(),f.every(function(n){var p=KG(n),q=$C(qG(a),n.stream);return p&&n.Hb===e&&q!==e})){var g=qG(a)[e];a.g.debug(c,"Streaming period",e,g);a.g.debug(c,"calling onChooseStreams()...");var h=a.C.Nf(g);a.D=!h.variant&&!!h.text;var l=new Map;h.variant&&h.variant.video&&l.set(_.r,
|
|
157
|
+
h.variant.video);h.variant&&h.variant.audio&&l.set(_.ad,h.variant.audio);h.text&&l.set(_.R,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!==_.R){a.g.error(c,"invalid Streams chosen: missing "+h+" Stream");a.C.onError(new _.P(_.Q,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===_.R)UG(a,null,null,l.get(_.R),g.startTime),l["delete"](h);else{a.g.error(c,"invalid Streams chosen: unusable "+h+" Stream");
|
|
158
|
+
a.C.onError(new _.P(_.Q,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))?(_.DG(a,m,!1,0),yG(a,a.a.get(h),0)):a.a["delete"](h);a.g.debug(c,WB);a.C.Mf()}else a.g.debug(c,"ignoring transition to Period",e,"since another is happening")})["catch"](CC)):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)}};
|
|
159
|
+
wG=function(a,b){var c=YC(qG(a),b+_.$u);return c?qG(a).indexOf(c):0};
|
|
160
|
+
cH=function(a,b,c,d,e){d=void 0===d?!1:d;e=void 0===e?null:e;var f=_.fD(c.Ra(),c.wa,c.ka,a.h.attemptParameters,c.startTime,c.endTime,b.type,c.timescale);f.type=2;f.onFragment=c.Vc?null:e;f.disableFragmentSupport=c.Vc||a.h.disableFragmentSupport;f.disableMergedFragments=a.h.disableMergedFragments;if(e=c.f())f.keyInfo=e,f.onFragment=null;d&&(f.responseModifiers.push(function(g){lH(a,b,g.data)}),b.type===_.r&&a.h.overridePasp&&f.responseModifiers.push(a.wn.bind(a)));a.g.debug("fetching: reference\x3d",
|
|
161
|
+
c);c=a.C.vb.fetch(f);b.Jb=c;return c.P.then(function(g){var h=a.C.ve(),l=g.timeMs,m=g.data.byteLength;l&&m&&!d&&h.segmentDownloaded(l,m);b.Jb=null;return g.data})};
|
|
162
|
+
OG=function(a,b,c,d){var e,f,g,h;return _.H(function(l){if(1==l.a)return e=JG(b),b.Nb=!1,b.Re=!1,b.oe=0,b.jc=!0,b.stream.segmentIterator=null,a.g.debug(e,"clearing buffer"),d?(g=a.C.Eb(),h=a.C.W.getDuration(),f=a.C.W.remove(b.type,g+d,h)):f=a.C.W.clear(b.type).then(function(){return!a.f&&c?a.C.W.flush(b.type):null}),_.y(l,f,2);if(a.f)return l["return"]();a.g.debug(e,"cleared buffer");b.Zb=null;b.va=null;b.jc=!1;b.endOfStream=!1;b.te=!1;yG(a,b,0);_.A(l)})};
|
|
163
|
+
yG=function(a,b,c){a.g.debug(JG(b),"updating in "+c+" seconds");b.ab=(new _.Uk(function(){var d;return _.H(function(e){if(1==e.a)return _.B(e,2),_.y(e,a.Ib(b),4);if(2!=e.a)return _.qh(e,0);d=_.E(e);if(a.C)a.C.onError(d);_.A(e)})})).da(c)};AG=function(a){null!=a.ab&&(a.ab.stop(),a.ab=null)};qG=function(a){return a.j.adaptedPeriods||a.j.periods};BG=function(a){return _.H(function(b){return a.Jb?_.y(b,a.Jb.abort(),0):b.F(0)})};
|
|
164
|
+
hH=function(a,b){var c;return _.H(function(d){switch(d.a){case 1:if(a.f)return d["return"]();if(!a.C.ri){d.F(2);break}_.B(d,3);return _.y(d,a.C.ri(b),5);case 5:_.qh(d,2);break;case 3:c=_.E(d),c.cause=b,b=c;case 2:if(!b.f)a.C.onError(b);_.A(d)}})};JG=function(a){return"("+a.type+":"+a.stream.id+")"};KG=function(a){return!a.gb&&null==a.ab&&!a.Nb&&!a.jc};nH=function(){this.a=null};
|
|
165
|
+
qH=function(){_.em.call(this,YB);var a=this;this.G=oH;this.j=this.Ea=null;this.ng=0;this.xi=2;this.Uc=null;this.jg=!1;this.o=new _.Uh;this.Ic=this.Ee=this.J=this.Oc=this.B=this.L=this.w=null;this.Ld=!1;this.f=this.A=this.a=this.I=this.K=null;this.h=new _.vF;this.$=null;this.Ci=1E9;this.Ge=new Set;this.fa=!0;this.Ma=null;this.Ai=!1;this.zi=0;this.ja=null;this.S=new AF;this.Bi={width:Infinity,height:Infinity};this.H=null;this.ic=_.lp;this.Ec=new HF(this.configuration.preferredAudioLanguage||[],this.configuration.preferredAudioRole,
|
|
166
|
+
this.configuration.preferredAudioChannelCount,this.configuration.preferSpatialAudio,this.configuration.mediaSource.codecSwitchingStrategy);this.Cd=this.configuration.preferredTextLanguage;this.l=new xF;this.aa=this.Mc=null;this.Pc=new Map;this.Pb=null;this.Ce=this.configuration.preferredTextRole;this.zd=this.configuration.preferForcedSubtitles;this.o.on(window,"online",function(){a.G===pH&&LG(a.a)});this.Ke=this.Lc=this.Me=null;this.ea=_.pa;this.Od=new nH;this.Hd=[]};
|
|
167
|
+
rH=function(a){return new _.RC(function(b){if(void 0===b||null===b)return null;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,_.ch(e.value.renditions))}return d.find(function(f){return f.id===b})||null})};
|
|
168
|
+
sH=function(a,b){if(a.ic!==b){var c=_.S.zk;if(a.ic===_.wp&&b!==_.lp)c=c(b,_.up),a.log.info(_.HB+c);else{var d=a.ng;d=0===d?0:Date.now()-d;var e=a.ic;a.ic=b;a.ng=Date.now();null!==a.J&&(a.J.A=b===_.yp);a.H&&_.bp(a.H.a,a.ic);b===_.qp&&(a.xi=a.ag?1:2);var f=a.xi,g={currentState:a.ic,previousState:e,timeSinceLastStateChangeMS:d,reason:b===_.qp||e===_.qp?f:void 0},h=c(e,_.up),l=c(b,_.up);c=b!==_.qp?"":"["+c(f,_.tp)+"]";a.log.info(_.Ob+h+" -\x3e "+(l+c));a.trigger(new _.L(_.gg,{detail:g}));(b===_.sp||b===
|
|
169
|
+
_.wp)&&a.Ic&&a.Ic.stop();b===_.qp?a.trigger(new _.L(_.md,{detail:{bufferedTimeMS:-1,reason:f}})):e===_.qp&&a.trigger(new _.L(_.ld,{detail:{bufferedTimeMS:d,reason:f}}))}}};tH=function(a){var b;return _.H(function(c){switch(c.a){case 1:b=a.l.a;a.l.a=null;if(!b){c.F(2);break}return _.y(c,b["catch"](function(){}),2);case 2:return _.y(c,_.em.prototype.release.call(a),4);case 4:return _.y(c,a.unload(),5);case 5:sH(a,_.lp),_.A(c)}})};
|
|
170
|
+
uH=function(a){var b=new _.Gt;(a=a.playlist)&&a.cropTimeline&&(a.startTime||a.endTime)&&(b.h={start:a.startTime||null,end:a.endTime||null});return b};wH=function(a,b){var c,d;return _.H(function(e){a.ea===_.Kb&&(a.f=eF(a.f,bF(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,_.lD(a.f.presentationTimeline,!0),a.trigger(new _.L(_.He))),vH(a,a.f));_.A(e)})};
|
|
171
|
+
xH=function(a){return _.H(function(b){a.A.requestStop();a.A=null;a.ea===_.Kb?a.trigger(new _.L(_.Wf)):a.trigger(new _.L(_.He));_.A(b)})};
|
|
172
|
+
vH=function(a,b){var c=a.getMediaPosition(),d=a.Lc,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 _.Ft(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));zC(d,c);a:if(c=d.a,f.length!==c.length)f=!1;else{for(d=
|
|
173
|
+
0;d<f.length;d++)if(!f[d].la(c[d])){f=!1;break a}f=!0}!f&&a.trigger(new _.L(_.Xf));CD(a.Ke);yH(a)};yH=function(a){if(a.I&&0<a.Hd.length){a.Hd.forEach(function(c){var d=yC(a.Lc,c.configurationId);c.offset=d?d.qb():0});var b=a.Hd.sort(function(c,d){return(c.offset||0)-(d.offset||0)});zD(a.I,b);a.Hd=[]}};EH=function(a){var b,c;return _.H(function(d){if(1==d.a)return zH(a),_.y(d,AH(a),2);BH(a);b=_.Vj(4)||_.Vj(5);if(!b)return d.F(0);c=a.getSurface().getMedia();CH(a,c);return _.y(d,DH(a,c),0)})};
|
|
174
|
+
LH=function(a,b,c){c=void 0===c?!0:c;var d,e,f,g,h;return _.H(function(l){switch(l.a){case 1:return d=Date.now()/1E3,e=new _.Oj,a.l.a=e,_.B(l,2),zH(a),_.y(l,FH(a),4);case 4:return zF(a.l,e),a.Z=_.Dp(b),a.configuration=_.cm(a.Kc,b),a.log.info(_.xb,a.configuration),a.log.info(_.Nb,a.Z),_.y(l,GH(a,e),5);case 5:return zF(a.l,e),_.y(l,HH(a,b,a.getSourceIndex(),e,!1),6);case 6:return f=l.f,zF(a.l,e),a.A=f.parser,a.f=f.manifest,g=a,_.y(l,IH(a,a.f,a.configuration.drm),7);case 7:g.w=l.f;zF(a.l,e);if(!c){l.F(8);
|
|
175
|
+
break}return _.y(l,JH(a,e),9);case 9:zF(a.l,e),a.o.one(a.j,_.Ie,function(){var m=Date.now()/1E3-d;a.H&&(a.H.A=m)});case 8:e.resolve();_.qh(l,0);break;case 2:h=_.E(l),KH(a,h,e),_.A(l)}})};KH=function(a,b,c){b=MH(a,b,c);c["catch"](function(){});c.reject(b);a.onError(b);throw b;};MH=function(a,b,c){var d=a.l;return null!=d.a&&d.a===c||b instanceof _.P&&7E3===b.code?b instanceof _.P?b:new _.P(_.Q,7,7003,"Unexpected error.",b):yF(a.l)};FH=function(a){return a.Ea?a.Ea["catch"](function(){}):Promise.resolve()};
|
|
176
|
+
GH=function(a,b){var c;return _.H(function(d){if(1==d.a)return a.H=new _.gp,sH(a,_.xp),a.$=new _.cu(a.getNetworkEngine()),AC(a.$,{enabled:a.configuration.abr.useCmsd}),c=NH(a,a.configuration),_.y(d,DH(a,c),2);zF(a.l,b);a.I=new wD;xD(a.I,function(e){a.log.info("Timeline cue found",e);OH(a,_.fi,e)});_.A(d)})};
|
|
177
|
+
HH=function(a,b,c,d,e){var f,g,h,l,m;return _.H(function(n){switch(n.a){case 1:return f=b,g=_.Dp(f),h=g[c],_.y(n,PH(a,h),2);case 2:return l=n.f,zF(a.l,d),_.Un(dC),_.y(n,QH(a,l,h,f.id||""),3);case 3:m=n.f;zF(a.l,d);if(!e||!m.presentationTimeline.o){n.F(4);break}return _.y(n,l.stop(),5);case 5:zF(a.l,d);case 4:return _.Un("manifest.end"),_.Vn("Fetch and parse manifest",dC,"manifest.end"),n["return"]({parser:l,manifest:m})}})};
|
|
178
|
+
RH=function(a,b){var c,d,e;return _.H(function(f){if(1==f.a)return _.y(f,HH(a,b,0,null,!0),2);c=f.f;try{return d=[a.f,bF(c.manifest)],e=dF(d,a.f.presentationTimeline),f["return"]({parser:c.parser,manifest:e})}catch(g){throw new _.P(_.Q,7,7003,"Failed to append load manifest");}})};NH=function(a,b){var c=a.getSurface().getMedia();c.loop=!!b.loop;_.O.R(b.volume)||a.setVolume(b.volume);_.O.R(b.muted)||a.setMuted(b.muted);CH(a,c);return c};
|
|
179
|
+
CH=function(a,b){a.j||(a.o.on(b,_.re,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 _.P(_.Q,3,3016,{code:c,extendedError:d,message:a.j.error.message})}}else c=null;if(c)a.onError(c)}),a.j=b)};BH=function(a){a.j&&(a.o.off(a.j,_.re),a.j=null)};
|
|
180
|
+
AH=function(a){var b;return _.H(function(c){switch(c.a){case 1:a.G!==SH&&(a.G=oH);if(b=a.j)a.o.off(b,_.Ie),a.o.off(b,_.wf),a.o.off(b,_.gf),a.o.off(b,_.qe),a.o.off(b,_.Nf),a.o.off(b,_.Lf);a.I&&(a.I.release(),a.I=null);a.Oc&&(a.Oc.release(),a.Oc=null);a.Ic&&(a.Ic.stop(),a.Ic=null);if(!a.A){c.F(2);break}return _.y(c,a.A.stop(),3);case 3:a.A=null;case 2:if(!a.h){c.F(4);break}return _.y(c,a.h.stop(),4);case 4:if(!a.a){c.F(6);break}return _.y(c,a.a.destroy(),7);case 7:a.a=null;case 6:a.B&&(a.B.release(),
|
|
181
|
+
a.B=null);a.J&&(a.J.release(),a.J=null);if(!a.L){c.F(8);break}return _.y(c,a.L.destroy(),9);case 9:a.L=null;case 8:a.Uc&&(a.Uc.release(),a.Uc=null);a.Ee&&(a.Ee.release(),a.Ee=null);b&&b.src&&(b.removeAttribute("src"),b.load());if(!a.w){c.F(10);break}return _.y(c,a.w.destroy(),11);case 11:a.w=null;case 10:a.$&&(a.$.release(),a.$=null),a.S.clear(),a.K=null,a.Ge.clear(),a.f=null,a.H=null,a.fa=!0,a.Pc.clear(),a.Ld=!1,a.configuration=a.Kc,TH(a),_.A(c)}})};
|
|
182
|
+
DH=function(a,b){var c,d,e,f,g;return _.H(function(h){if(1==h.a)return c=window.muxjs?new qE:new _.rE,d=_.$o(a.configuration,[_.xe,"single-native"]),e=d.create(a),a.V=e,f=rH(a),f.track(a),a.Uc=f,g=null,UH(a)?g=new SF(b,c,e,f,a.configuration):g=new _.tE(b,c,e,f,a.configuration),_.y(h,g.open(),2);a.L=g;_.A(h)})};
|
|
183
|
+
PH=function(a,b){var c,d;return _.H(function(e){if(1==e.a)return c=a.getNetworkEngine(),_.y(e,_.It(b.url,c,a.configuration.manifest.attemptParameters,b.type||null),2);d=e.f;d.configure(a.configuration.manifest);return e["return"](d)})};
|
|
184
|
+
QH=function(a,b,c,d){return(new _.Pj(Promise.resolve().then(function(){var e,f,g;return _.H(function(h){switch(h.a){case 1:e=null;case 2:if(e){h.F(3);break}_.B(h,4);var l=c.url;var m=VH(a,d);l=b.start(l,m);return _.y(h,l,6);case 6:e=h.f;_.qh(h,2);break;case 4:f=_.E(h);if(!a.Jc)throw f;return _.y(h,a.Jc(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 _.P(_.Q,4,4014);WH(e.periods);return h["return"](e)}})}),function(){a.log.info("Aborting parser step...");
|
|
185
185
|
return b.stop()})).P};
|
|
186
|
-
|
|
187
|
-
if(u.length){u=a.getPeriods();for(var z=0;z<u.length;z++)for(var C=u[z],I=_.w(C.variants),F=I.next();!F.done;F=I.next()){F=F.value;var D=[];F.audio&&D.push(F.audio);F.video&&D.push(F.video);D=_.w(D);for(var G=D.next();!G.done;G=D.next()){G=G.value;var M=F.allowedByKeySystem;if(G.keyId){var N=n[v?"00":G.keyId];N=!!N&&!
|
|
188
|
-
(G.keyId+"'. Applying restrictions to "+N)));C===p&&M!==F.allowedByKeySystem&&(q=!0)}}}if(n=
|
|
189
|
-
e=_.ym(c);d.h=e;f=c?c.offlineId||"":"";g=[];h=_.
|
|
190
|
-
|
|
191
|
-
b),
|
|
192
|
-
_.ji(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount):
|
|
193
|
-
a.configuration.preferredAudioLanguage||
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
d,"buffered to end",b,"state",a.getState()),
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
b.id});f?(a.aa=f.video.id,
|
|
202
|
-
|
|
203
|
-
if(h){var l=h.renditions.map(function(m){return m.id});g=f.find(function(m){return l.find(function(n){return n===String(m.video.id)})})}}}else g=f[0];if(g){if(d.codecs.split(".")[0]===g.audio.codecs.split(".")[0]){d=g.audio;a.Mc=d.id;a.
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
b).variant=c};
|
|
207
|
-
|
|
186
|
+
IH=function(a,b,c){var d,e,f,g,h,l;return _.H(function(m){switch(m.a){case 1:_.Un("initDrm.start");d=new _.$n({vb:a.getNetworkEngine(),onError:function(n){return a.onError(n)},Qf:function(n){if(a.a){var p=XH(a),q=!1,u=Object.keys(n);0===u.length&&a.log.warn("Got a key status event without any key statuses, so we don't know the real key statuses. If we don't have all the keys, you'll need to set restrictions so we don't select those tracks.");var v=1===u.length&&"00"===u[0];v&&a.log.warn("Got a synthetic key status event, so we don't know the real key statuses. If we don't have all the keys, you'll need to set restrictions so we don't select those tracks.");
|
|
187
|
+
if(u.length){u=a.getPeriods();for(var z=0;z<u.length;z++)for(var C=u[z],I=_.w(C.variants),F=I.next();!F.done;F=I.next()){F=F.value;var D=[];F.audio&&D.push(F.audio);F.video&&D.push(F.video);D=_.w(D);for(var G=D.next();!G.done;G=D.next()){G=G.value;var M=F.allowedByKeySystem;if(G.keyId){var N=n[v?"00":G.keyId];N=!!N&&!YH.includes(N);F.allowedByKeySystem=N}M!==F.allowedByKeySystem&&(N=G.type,G.type===_.r&&(N="video "+G.width+"x"+G.height+"@"+_.S.hf(G.bandwidth)),a.log.warn("DRM Key not available for KID: '"+
|
|
188
|
+
(G.keyId+"'. Applying restrictions to "+N)));C===p&&M!==F.allowedByKeySystem&&(q=!0)}}}if(n=rG(a.a)){v=tG(a.a);u=uG(a.a);a:{z=n.variants;for(C=0;C<z.length;C++)if(z[C].audio===v&&z[C].video===u){v=z[C];break a}v=null}if(!v||v.allowedByKeySystem)a.log.info(nB),ZH(a),$H(a,n.variants)}q&&n!==p&&(a.log.info(nB),ZH(a),$H(a,p.variants))}},Pf:function(n,p){a.trigger(new _.L(_.he,{expirationTime:p}))},onEvent:function(n){return a.qf(n)},getConfiguration:function(){return a.getConfiguration()},Yc:function(){return a.Yc()}});
|
|
189
|
+
e=_.ym(c);d.h=e;f=c?c.offlineId||"":"";g=[];h=_.zt(b.periods);if(!f){m.F(2);break}l=_.gm(_.hf);if(!l){m.F(2);break}return _.y(m,l.l(a,h),4);case 4:return _.y(m,l.j(f),5);case 5:g=m.f;case 2:return _.y(m,_.fo(d,h,g),6);case 6:return a.w=d,aI(a,b.periods),_.Un("initDrm.end"),_.Vn("Init DRM","initDrm.start","initDrm.end"),m["return"](d)}})};
|
|
190
|
+
JH=function(a,b){var c,d,e,f,g,h,l,m,n,p;return _.H(function(q){if(1==q.a)return c=a.j,bI(a,c),cI(a,a.f.periods),a.Ec=new HF(a.configuration.preferredAudioLanguage||[],a.configuration.preferredAudioRole,a.configuration.preferredAudioChannelCount,a.configuration.preferSpatialAudio,a.configuration.mediaSource.codecSwitchingStrategy),a.Cd=a.configuration.preferredTextLanguage,a.Ce=a.configuration.preferredTextRole,a.zd=a.configuration.preferForcedSubtitles,_.y(q,_.yo(a.w,c),2);if(3!=q.a)return zF(a.l,
|
|
191
|
+
b),a.h.configure(a.configuration.abr),a.$&&a.h.setCmsdManager(a.$),a.h.init(function(u,v,z){!a.fa&&dI(a,u,v,z)}),a.B=eI(a,c,a.configuration.startTime),a.Oc=fI(a),a.J=new gG({sh:function(){return c.playbackRate},dn:function(u){c.playbackRate=u},Gl:function(u){c.currentTime+=u}}),hG(a.J,a.configuration.trickPlay),a.isLive()&&a.configuration.streaming.enableLiveEdgeChasing&&(a.Ee=new QF(a)),d=Math.max(1E-4,a.configuration.streaming.rebufferingGoal),gI(a,d),UH(a)?KE(a.f,_.ji(a.configuration.preferredVideoCodec),
|
|
192
|
+
_.ji(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount):JE(a.f,_.ji(a.configuration.preferredVideoCodec),_.ji(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount),e=hI(a),e.h=a.configuration.streaming,a.a=e,a.G=pH,_.y(q,e.start(),3);zF(a.l,b);a.configuration.streaming.startAtSegmentBoundary&&(f=bE(a.B),g=iI(a,f),VD(a.B.f,g));h=_.w(a.f.periods);for(l=h.next();!l.done;l=h.next())m=l.value,jI(a,m);ZH(a);n=XH(a)||a.f.periods[0];p=n.variants.some(function(u){return u.primary});
|
|
193
|
+
a.configuration.preferredAudioLanguage||p||a.log.warn("No preferred audio language set. We will choose an arbitrary language initially");$H(a,n.variants);_.A(q)})};
|
|
194
|
+
bI=function(a,b){function c(d){a.j&&a.K&&(d.type===_.Zf&&a.Pd?(a.K.a=NF,TH(a)):d.type===_.Pg&&a.getState()===_.zp&&.1>a.getBufferInfo().xa(a.getMediaPosition())?(a.K.a=NF,TH(a)):a.K&&kI(a));lI(a)}a.o.on(b,_.wf,c);a.o.on(b,_.gf,c);a.o.on(b,_.qe,c);a.o.on(b,_.Zf,c);a.o.on(b,_.Yf,c);a.o.on(b,_.Lf,c);a.o.on(b,_.Pg,c);a.o.on(b,_.Nf,function(){if(a.j){var d=a.j.playbackRate;0!==d&&a.J.set(d)}})};
|
|
195
|
+
WH=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)})){_.Kh("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)}};eI=function(a,b,c){return new $D(b,a.f,a.configuration.streaming,c,function(d){a.Oc&&dE(a.Oc,!0,d);a.a&&IG(a.a)},function(d){return a.dispatchEvent(d)},a.ea===_.Kb)};
|
|
196
|
+
fI=function(a){var b=new eE(a.j),c=new eG(a.f);fG(c,function(){ZH(a)});b.a.add(c);a.I&&(c=new gE(a.I),hE(c,function(d){d.Ie&&d.Ie();OH(a,_.hi,d)},function(d){d.Of&&d.Of();OH(a,_.ii,d)},function(d,e){e||(d.Ie&&d.Ie(),OH(a,_.hi,d),d.Of&&d.Of(),OH(a,_.ii,d))}),b.a.add(c));a.ea===_.Kb&&(c=new BD(a.Lc,a.Od,function(d){return a.trigger(d)},a.configuration.playlist),b.a.add(c),a.Ke=c);return b};gI=function(a,b){a.K=new OF(b,Math.min(.5,b/2));a.K.a=NF;TH(a);a.Ic=(new _.Wk(function(){kI(a)})).lb(.25)};
|
|
197
|
+
kI=function(a){switch(a.G){case pH:a:if(a.j.ended||a.L.re())var b=!0;else{if(a.isLive()){b=rD(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.Bf();c=d.video;d=d.audio;var e=a.j.currentTime;c&&d?(c=c.xa(e),d=d.xa(e),c=Math.min(c,d)):c=c?c.xa(e):d?d.xa(e):0}else c=0;if(d=a.K){d=a.K;var f=b,g=d.f.get(d.a);e=d.a;c=f||c>=g?MF:NF;d.a=c;d=e!==c}c=d;d=mI(a);c||a.getState()===_.qp&&!d?(a.log.debug("Buffering state changed. Is buffering",
|
|
198
|
+
d,"buffered to end",b,"state",a.getState()),TH(a)):a.Ld&&lI(a)};hI=function(a){var b={configuration:{vl:a.ea===_.Kb},Eb:function(){return bE(a.B)},W:a.L,vb:a.getNetworkEngine(),Nf:a.Lj.bind(a),Mf:a.Kj.bind(a),onError:a.onError.bind(a),Sh:a.em.bind(a),onEvent:a.qf.bind(a),Wh:a.vn.bind(a),Je:a.rm.bind(a),ve:function(){return a.h},jf:a.Wi.bind(a),ri:a.ln.bind(a),wd:a.w};return new _.pG(a.f,b)};
|
|
199
|
+
oF=function(a){if(a.f&&a.B){var b=nI(a),c=[];a=_.w(pI(a));for(var d=a.next();!d.done;d=a.next()){d=d.value;var e=QE(d);e.active=d===b;c.push(e)}return c}return[]};mF=function(a,b){if(a.f&&a.a){var c=XH(a),d=c.textStreams.find(function(e){return e.id===b.id});d?(qI(a,c,d,!1),LI(a,d),a.Cd=d.language,a.zd=d.kind===_.se):a.log.error(_.GB,b.id)}};
|
|
200
|
+
pF=function(a,b,c){var d=void 0===d?0:d;if(a.f&&a.a){var e=XH(a);if(a.configuration.abr.enabled&&b)a.log.info("Disable ABR and enable manual track selection to select "+(b.width+"x"+b.height+"@"+b.bandwidth)),a.configuration.abr.enabled=!1,a.h.disable();else if(!a.configuration.abr.enabled&&!b){a.log.info("Enable ABR Selection");a.configuration.abr.enabled=!0;a.h.enable();a.aa=null;c=$H(a,e.variants);null!=a.Pb&&(a.Ec=a.Pb,a.Pb=null);null==c||a.fa||dI(a,c);return}if(b){a.aa=b.id;var f=e.variants.find(function(g){return g.id===
|
|
201
|
+
b.id});f?(a.aa=f.video.id,SE(f)?(MI(a,e,f,!1),NI(a,f,c,d),null==a.Pb&&(a.Pb=a.Ec),a.Ec=new IF(f),$H(a,e.variants)):a.log.error("Unable to switch to restricted track",b.id)):a.log.error("No variant with id",b.id)}else a.aa=null,null!=a.Pb&&(a.Ec=a.Pb,a.Pb=null),c=$H(a,e.variants),null==c||a.fa||dI(a,c)}};
|
|
202
|
+
nF=function(a,b){if(a.configuration.streaming.disableAudioTracks)Promise.reject(Error("Audio tracks are disabled by config."));else{if(a.a&&(a.f||a.B)){var c=uG(a.a),d=tG(a.a),e=YC(a.f.periods,bE(a.B)),f=a.f.periods[e?a.f.periods.indexOf(e):0].variants.filter(function(m){return m.audio.id===b&&SE(m)});e=!1;var g=void 0;if(c){if(g=f.find(function(m){return m.video.id===c.id}),!g){a.log.debug("Cannot find exact variant, looking for anything else that matches with given audioId");e=!0;var h=a.getTrackManager().Ja();
|
|
203
|
+
if(h){var l=h.renditions.map(function(m){return m.id});g=f.find(function(m){return l.find(function(n){return n===String(m.video.id)})})}}}else g=f[0];if(g){if(d.codecs.split(".")[0]===g.audio.codecs.split(".")[0]){d=g.audio;a.Mc=d.id;a.h.setVariants(f);f=XH(a);MI(a,f,g,!1);e||a.fa?NI(a,g,!0,0):_.DG(a.a,d,!0,0);Promise.resolve();return}a.log.warn("Target audio codecs not compatible with active audio codecs.")}}Promise.reject()}};
|
|
204
|
+
qF=function(a){var b=a.jg;return a.f?a.L.getTextDisplayer().isTextVisible():b};lF=function(a,b){var c,d,e,f;return _.H(function(g){c=a.jg;d=b;if(c===d)return g["return"]();a.jg=d;if(a.G!==pH)return g.F(0);a.L.getTextDisplayer().setTextVisibility(b);if(a.configuration.streaming.alwaysStreamText)return g.F(0);if(!b)return CG(a.a),g.F(0);e=XH(a);f=_.UE(e.textStreams,a.Cd,a.Ce,a.zd);return 0<f.length?_.y(g,zG(a.a,f[0]),0):g.F(0)})};
|
|
205
|
+
MI=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){tF(e,c.video,d);var g=e.na();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&&(tF(e,c.audio,d),e=e.Pa(),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})))}CF(a.S,
|
|
206
|
+
b).variant=c};qI=function(a,b,c,d){CF(a.S,b).text=c;if(b=a.getTrackManager())tF(b,c,d),c=b.Ia(),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}))};OI=function(a){return a.ea===_.Kb&&"flat"===a.configuration.playlist.timeline};
|
|
207
|
+
cI=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.Ci++,originalId:l,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return null},getSegmentReference:function(){return null},initSegmentReference:null,ya:0,mimeType:_.Tc,codecs:"",kind:_.pd,encrypted:!1,
|
|
208
208
|
keyId:null,language:g.closedCaptions.get(l),label:null,type:_.R,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)}};
|
|
209
|
-
|
|
210
|
-
e.value,(g=e.video)&&!
|
|
211
|
-
|
|
212
|
-
_.so(a.w,g.initDataType,g.initData,g.keyId)}}};
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
a.
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
missingKeys:g,restrictedKeyStatuses:h});};
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
h=c.video&&c.video.id;a.f.periods=f.periods;l=
|
|
225
|
-
z.next())I=C.value,I.video&&v.add(I.video),I.audio&&v.add(I.audio);F=a.getNetworkEngine();D=_.w(_.ch(v).concat(_.ch(l.textStreams)));for(G=D.next();!G.done;G=D.next())M=G.value,u.push(M.createSegmentIndex(F));return _.y(U,Promise.all(u),7);case 7:
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
_.
|
|
232
|
-
_.t.track=function(a){null!=this.player&&
|
|
209
|
+
aI=function(a,b){for(var c=a.a?tG(a.a):null,d=a.a?uG(a.a):null,e=!UH(a),f=_.w(b),g=f.next();!g.done;g=f.next())PE(a.w,c,d,g.value,e);c=JC(b,function(h){return h.variants.some(SE)});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=
|
|
210
|
+
e.value,(g=e.video)&&!KC(g.type,_.Rk(g.mimeType,g.codecs))&&delete e.video;if(0===c)throw new _.P(_.Q,4,4032);if(c<b.length)throw new _.P(_.Q,4,4011);c=_.w(b);for(e=c.next();!e.done;e=c.next())d=e.value,ME(d.variants,a.configuration.restrictions,a.Bi)&&a.a&&XH(a)===d&&ZH(a),PI(a,d.variants)};
|
|
211
|
+
jI=function(a,b){var c=a.a?tG(a.a):null,d=a.a?uG(a.a):null,e=!UH(a);PE(a.w,c,d,b,e);d=b.variants;if(!d.some(SE))throw new _.P(_.Q,4,4011);PI(a,b.variants);ME(d,a.configuration.restrictions,a.Bi)&&a.a&&XH(a)===b&&ZH(a);if(!_.Vj(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,_.Bo(a.w,g.keyId,g.initData)||
|
|
212
|
+
_.so(a.w,g.initDataType,g.initData,g.keyId)}}};NI=function(a,b,c,d){c=void 0===c?!1:c;d=void 0===d?0:d;a.fa?(a.Ma=b,a.Ai=c,a.zi=d):EG(a.a,b,c,d)};LI=function(a,b){a.fa?a.ja=b:_.DG(a.a,b,!0,0)};QI=function(a){if(a.a&&a.f){var b=rG(a.a),c=XH(a);null!=b&&b===c&&(tG(a.a),uG(a.a),_.sG(a.a,_.R),CF(a.S,c),CF(a.S,c))}};
|
|
213
|
+
iI=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=tG(a.a),e=uG(a.a),f=XH(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};mI=function(a){return a.w&&a.w.D?!0:a.K?a.K.getState()===NF:!1};
|
|
214
|
+
TH=function(a){if(a.H&&a.K&&a.B){var b=RI(a)===_.qp,c=a.J;c.l=b;kG(c,c.o?"seek":void 0);a.B.j.o=b;lI(a);a.Ke&&(c=1>Math.abs(a.getMediaDuration()-a.getMediaPosition()),a=a.Ke,b&&c&&(b=a.a,b.a[b.a.length-1]&&a.f(new _.L(_.Uf))))}};lI=function(a){sH(a,RI(a))};RI=function(a){if(a.Pd)var b=!1;else if(a.j&&a.j.ended)b=!0;else{b=a.getMediaDuration();var c=a.getMediaPosition();b=a.Ld&&0<=c&&b<=c?!0:!1}return b?_.sp:mI(a)||a.Pd?_.qp:a.j&&a.j.paused?_.yp:_.zp};
|
|
215
|
+
$H=function(a,b){try{PI(a,b)}catch(e){return a.onError(e),null}var c=b.filter(function(e){return SE(e)});c=YE(c,a.Mc);var d=a.Ec.create(c);d=Array.from(d.values());a.h.setVariants(d);if(null!==a.aa&&null!==a.Mc&&(d=d.find(function(e){return e.video.id===a.aa&&e.audio.id===a.Mc}),a.aa=null,d))return d;if(a.configuration.abr.enabled||null===a.aa)return a.h.chooseVariant();c=c.find(function(e){return null!==e.video&&e.video.id===a.aa});return c?c:(a.log.warn("Selected video track not found. Falling back to ABR selection"),
|
|
216
|
+
a.h.chooseVariant())};SI=function(a,b){return _.UE(b,a.Cd,a.Ce,a.zd)[0]||null};TI=function(a,b,c){c=void 0===c?!0:c;var d=$H(a,b.variants);a.Mc=d&&d.audio&&d.audio.id;d&&(MI(a,b,d,!0),NI(a,d,c));(c=SI(a,b.textStreams))&&(a.configuration.streaming.alwaysStreamText||qF(a))&&(qI(a,b,c,!0),LI(a,c))};
|
|
217
|
+
WI=function(a,b){a.fa=!0;a.h.disable();a.log.debug("Choosing new streams after period changed");var c=$H(a,b.variants),d=SI(a,b.textStreams);a.Ma&&(b.variants.includes(a.Ma)&&(c=a.Ma),a.Ma=null);a.ja&&(b.textStreams.includes(a.ja)&&(d=a.ja),a.ja=null);c&&UI(a,b,function(){return MI(a,b,c,!0)});d&&(a.configuration.streaming.alwaysStreamText||qF(a))&&UI(a,b,function(){return qI(a,b,d,!0)});b===XH(a)&&VI(a);return a.configuration.streaming.alwaysStreamText||qF(a)?{variant:c,text:d}:{variant:c,text:null}};
|
|
218
|
+
dI=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=XI(a,b);UI(a,e,function(){return MI(a,e,b,!0)});e===XH(a)&&VI(a);a.a&&EG(a.a,b,c,d)}};ZH=function(a){var b=a.getTrackManager();b&&a.G!==SH&&(b.m&&(sF(b),b.m.trigger(new _.L(_.iv))),VI(a))};VI=function(a){var b=XH(a);if(b){var c=a.Pc.get(b)||[];for(a.Pc["delete"](b);c.length;)c.shift()()}};UI=function(a,b,c){a.Pc.has(b)||a.Pc.set(b,[]);a.Pc.get(b).push(c)};
|
|
219
|
+
OH=function(a,b,c){a.trigger(new _.L(b,{detail:vD(c,OI(a))}))};
|
|
220
|
+
PI=function(a,b){var c=a.w?_.O.tg(a.w.fa):{},d=Object.keys(c);d=d.length&&"00"===d[0];for(var e=!1,f=!1,g=[],h=[],l=_.w(b),m=l.next();!m.done;m=l.next()){m=m.value;var n=[];m.audio&&n.push(m.audio);m.video&&n.push(m.video);n=_.w(n);for(var p=n.next();!p.done;p=n.next())if(p=p.value,p.keyId){var q=c[d?"00":p.keyId];q?YH.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 _.P(_.Q,4,4012,{hasAppRestrictions:f,
|
|
221
|
+
missingKeys:g,restrictedKeyStatuses:h});};pI=function(a){var b=XH(a);if(null==b)return[];QI(a);return b.variants.filter(function(c){return SE(c)})};YI=function(a){var b=XH(a);if(null==b)return[];QI(a);return b.textStreams.filter(function(c){return!a.Ge.has(c)})};XH=function(a){var b=bE(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};nI=function(a){var b=XH(a);return b&&CF(a.S,b).variant};
|
|
222
|
+
XI=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};zH=function(a){if(a.G===SH)throw new _.P(_.Q,7,7E3,"Player is destroyed.");};
|
|
223
|
+
ZI=function(a,b,c){var d,e,f,g,h,l,m,n,p,q,u,v,z,C,I,F,D,G,M,N;return _.H(function(U){switch(U.a){case 1:return d=_.Kp,_.B(U,2),_.y(U,_.It(b.url,a.getNetworkEngine(),a.configuration.manifest.attemptParameters,b.type||null),4);case 4:e=U.f;e.configure(a.configuration.manifest);var oa=e;var Ca=b.url,ab=VH(a,a.configuration.id||"");oa=oa.start(Ca,ab);return _.y(U,oa,5);case 5:f=U.f;WH(f.periods);if(!f.periods.length)throw new _.P(_.Q,4,4014);return _.y(U,a.A.stop(),6);case 6:a.A=e;g=c.audio&&c.audio.id;
|
|
224
|
+
h=c.video&&c.video.id;a.f.periods=f.periods;l=YC(f.periods,bE(a.B))||f.periods[0];UH(a)?KE(a.f,_.ji(a.configuration.preferredVideoCodec),_.ji(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount):JE(a.f,_.ji(a.configuration.preferredVideoCodec),_.ji(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount);m=ZE(g,h,l.variants);n=SI(a,l.textStreams);$H(a,l.variants);p=m&&m.video;q=m&&m.audio;u=[];v=new Set;z=_.w(l.variants);for(C=z.next();!C.done;C=
|
|
225
|
+
z.next())I=C.value,I.video&&v.add(I.video),I.audio&&v.add(I.audio);F=a.getNetworkEngine();D=_.w(_.ch(v).concat(_.ch(l.textStreams)));for(G=D.next();!G.done;G=D.next())M=G.value,u.push(M.createSegmentIndex(F));return _.y(U,Promise.all(u),7);case 7:QG(a.a,d.AUDIO,q);QG(a.a,d.VIDEO,p);QG(a.a,d.TEXT,n);m&&MI(a,l,m,!1);a.log.info("Switch CDN successful.");_.qh(U,0);break;case 2:N=_.E(U);if(!e){U.F(8);break}return _.y(U,e.stop(),8);case 8:throw N;}})};
|
|
226
|
+
VH=function(a,b){return{networkingEngine:a.getNetworkEngine(),configurationId:b,filterNewPeriod:function(c){return jI(a,c)},filterAllPeriods:function(c){return aI(a,c)},onTimelineCueAdded:function(c){a.I&&(a.ea===_.Kb?a.Hd.push(c):yD(a.I,c))},onEvent:function(c){return a.qf(c)},onError:function(c){return a.onError(c)},onUpdate:function(c){return wH(a,c)},onTurnedStatic:function(){return xH(a)}}};
|
|
227
|
+
UH=function(a){return a.configuration.mediaSource.codecSwitchingStrategy===_.dg&&(_.Vj(2)||_.Vj(3)||_.Vj(4)||_.Vj(5)||_.Vj(6)||_.Wj()&&38===_.$k().major||_.Wj()&&53===_.$k().major||_.Wj()&&68===_.$k().major?!1:!0)};$I=function(){};aJ=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}};
|
|
228
|
+
bJ=function(){var a=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(b,c){return a.call(this,b,c-.001)}};cJ=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"mp2t"===b.split(/ *; */)[0].split("/")[1].toLowerCase()?!1:a(b)}};dJ=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"opus"!==_.NC(b)&&a(b)}};
|
|
229
|
+
eJ=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)}};
|
|
230
|
+
fJ=function(a){_.xu.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=_.Zd;c.label===IB&&(this.a=c)}this.a||(this.a=a.addTextTrack(_.mC,IB));this.a.mode=_.we};gJ=function(a,b){var c=a.mode;a.mode=c===_.$f?_.$f:_.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};hJ=function(){};_.bj.prototype.f=oC(0,function(){return this.keyInfo});var qC=[112,115,115,104,0,0,0,0];
|
|
231
|
+
_.FC.prototype.Fd=function(){return this.ka?this.ka-this.wa+1:null};_.FC.prototype.f=function(){return this.keyInfo};_.jJ=function iJ(a){var c,d,e,f,g,h;return _.yh(iJ,function(l){1==l.a&&(c=-1,e=d=void 0,f=_.w(a),g=f.next());if(5!=l.a){if(g.done)return-1===c?l.F(0):_.y(l,{xh:c,Qm:d,item:e,next:void 0},0);h=g.value;return 0<=c?_.y(l,{xh:c,item:e,Qm:d,next:h},5):l.F(5)}c++;d=e;e=h;g=f.next();return l.F(2)})};_.t=_.RC.prototype;
|
|
232
|
+
_.t.track=function(a){null!=this.player&&TC(this);a&&(this.player=a,this.player.on(_.Sf,this.Rc,this))};_.t.release=function(){TC(this);this.U=[];this.f=this.h=null};
|
|
233
233
|
_.t.append=function(a,b,c){var d=this.h?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.U.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.U);for(e=d.next();!e.done;e=d.next())e=e.value,a>=e.start&&a<e.end?e.end=a:b>=e.start&&b<e.end&&(e.start=b);this.U.push(c);
|
|
234
|
-
this.U.sort(
|
|
235
|
-
_.t.Rc=function(){if(this.player){var a=this.player.getMediaPosition();if(0<=a){a:{for(var b=this.U.length,c=Number.MAX_SAFE_INTEGER,d=0;d<b;d++){var e=this.U[d];c=Math.min(e.start,c);if(e.start<=a&&e.end>a){a=.1>e.end-a&&d<b-1?this.U[d+1].rendition:e.rendition;break a}if(e.start>a)break}a=0<b&&c>a&&.25>c-a?this.U[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(_.
|
|
236
|
-
{detail:{width:b,height:c,bandwidth:a?a.bandwidth:null,rendition:a}}))}}}};
|
|
237
|
-
_.t.isLive=function(){return 2===this.j.version?!this.a.f:Infinity===this.f&&!this.o};_.t.Nd=function(){return!this.o};
|
|
238
|
-
|
|
234
|
+
this.U.sort(QC)}WC(this);this.Rc();this.player&&this.player.trigger(new _.L(_.Kg))};_.t.clear=function(){this.U=[];WC(this);this.player&&(this.player.trigger(new _.L(_.Kg)),this.player.trigger(new _.L(_.hd)))};
|
|
235
|
+
_.t.Rc=function(){if(this.player){var a=this.player.getMediaPosition();if(0<=a){a:{for(var b=this.U.length,c=Number.MAX_SAFE_INTEGER,d=0;d<b;d++){var e=this.U[d];c=Math.min(e.start,c);if(e.start<=a&&e.end>a){a=.1>e.end-a&&d<b-1?this.U[d+1].rendition:e.rendition;break a}if(e.start>a)break}a=0<b&&c>a&&.25>c-a?this.U[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(_.jd,
|
|
236
|
+
{detail:{width:b,height:c,bandwidth:a?a.bandwidth:null,rendition:a}}))}}}};gD.prototype.qb=function(){return this.h};gD.prototype.getDuration=function(){return this.f?this.a-this.h:Infinity};_.t=_.iD.prototype;_.t.qc=function(){return this.J};_.t.getDuration=function(){return 2===this.j.version?this.a.getDuration():this.f};_.t.getPresentationStartTime=function(){return this.D};_.t.offset=function(a){null!=this.w&&(this.w+=a);null!=this.l&&(this.l+=a)};
|
|
237
|
+
_.t.isLive=function(){return 2===this.j.version?!this.a.f:Infinity===this.f&&!this.o};_.t.Nd=function(){return!this.o};wD.prototype.release=function(){this.f=function(){};this.a.clear()};wD.prototype.cues=function(){return this.a};BD.prototype.release=function(){this.f=this.j=this.h=this.a=null};BD.prototype.l=function(a){zC(this.a,a);CD(this)};
|
|
238
|
+
DD.prototype.next=function(){var a=this.h.get(this.a);a&&0<a.a.length?(this.f+=1,a.Ra().length&&this.f===a.a.length&&(this.a+=1,this.f=0)):(this.a+=1,this.f=0);a=ED(this);return{value:a,done:!a}};_.t=_.FD.prototype;_.t.destroy=function(){this.a=[];return Promise.resolve()};
|
|
239
239
|
_.t.find=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};
|
|
240
240
|
_.t.get=function(a){if(0===this.a.length)return null;a-=this.a[0].position;return 0>a||a>=this.a.length?null:this.a[a]};_.t.offset=function(a){this.g.info("Apply offset"+a+" to segment index");for(var b=_.w(this.a),c=b.next();!c.done;c=b.next())c=c.value,c.startTime+=a,c.endTime+=a,c.ya-=a};
|
|
241
241
|
_.t.nd=function(a,b){var c=a-this.a[0].position;if(0<=c&&c<this.a.length)for(this.g.warn("Accounting for segment duration drift",b,"at",c),this.a[c].endTime+=b,c+=1;c<this.a.length;++c)this.a[c].startTime+=b,this.a[c].endTime+=b};_.t.getDuration=function(){return this.a[this.a.length-1].endTime-this.a[0].startTime};
|
|
242
242
|
_.t.oa=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 _.bj(f.position,g.startTime,g.endTime,g.Ra,g.wa,g.ka,g.ya,g.keyInfo,g.Vc,g.timescale,g.horizontalTiles,g.verticalTiles,g.durationPerTile),b.push(f)):b.push(f),d++),e++)}for(;d<this.a.length;)b.push(this.a[d++]);if(b.length)for(d=
|
|
243
243
|
b[b.length-1].position+1;e<a.length;)f=a[e++],f=new _.bj(d++,f.startTime,f.endTime,f.Ra,f.wa,f.ka,f.ya,f.keyInfo,f.Vc,f.timescale,f.horizontalTiles,f.verticalTiles,f.durationPerTile),b.push(f);else b=a;a=b;if(c.length&&b.length){a=[];e=b[0].position;d=c.length;c=_.w(c);for(f=c.next();!f.done;f=c.next())f=f.value,a.push(new _.bj(e-d--,f.startTime,f.endTime,f.Ra,f.wa,f.ka,f.ya,f.keyInfo,f.Vc,f.timescale,f.horizontalTiles,f.verticalTiles,f.durationPerTile));b=_.w(b);for(f=b.next();!f.done;f=b.next())a.push(f.value)}this.a=
|
|
244
|
-
a};_.t.replace=function(a){this.a=a};
|
|
245
|
-
|
|
246
|
-
|
|
244
|
+
a};_.t.replace=function(a){this.a=a};KD.prototype.release=function(){this.h=null;this.f=function(){}};OD.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};OD.prototype.Je=function(){this.A=!0;ND(this)};PD.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};
|
|
245
|
+
TD.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};$D.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(){}};eE.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()};
|
|
246
|
+
gE.prototype.release=function(){this.j=null;this.o.clear();this.a=function(){};this.f=function(){};this.h=function(){}};gE.prototype.l=function(a,b,c){if(this.j)for(var d={},e=_.w(this.j.cues()),f=e.next();!f.done;d={$e:d.$e,ce:d.ce},f=e.next()){f=f.value;d.$e=this.o.get(f)||null;d.ce=fE(f,a);this.o.set(f,d.ce);var g=this.w.find(function(h){return function(l){return l.Dc===h.$e&&l.Cc===h.ce}}(d));g&&g.rc(f,b&&0===c)}};_.kJ=0;_.t=kE.prototype;
|
|
247
247
|
_.t.destroy=function(){this.j=this.w=null;this.o.clear();return Promise.resolve()};_.t.remove=function(a,b){var c=this;return Promise.resolve().then(function(){!c.j||!c.j.remove(a,b)||null==c.a||b<=c.a||a>=c.f||(a<=c.a&&b>=c.f?c.a=c.f=null:a<=c.a&&b<c.f?c.a=b:a>c.a&&b>=c.f&&(c.f=a))})};_.t.Ga=function(){return this.a};_.t.ha=function(){return this.f};_.t.sb=function(a){return null==this.a||null==this.f?!1:a>=this.a&&a<this.f};_.t.xa=function(a){return null==this.f||this.f<a?0:this.f-Math.max(a,this.a)};
|
|
248
|
-
|
|
249
|
-
_.t.destroy=function(){var a=this;this.I=!0;var b=[],c;for(c in this.h){var d=this.h[c],e=d[0];this.h[c]=d.slice(0,1);e&&b.push(e.p["catch"](
|
|
250
|
-
{};a.H=null;a.K=!1;for(var g in a.h);a.h={}})};_.t.open=function(){return this.J};_.t.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e;return _.H(function(f){if(1==f.a)return e=_.Kp,_.y(f,d.J,2);a.forEach(function(g,h){var l=_.Rk(g.mimeType,g.codecs);if(h===e.TEXT)d.bc(l);else{var m=new Map;m.set(h,l);if((!_.
|
|
251
|
-
_.t.Hh=function(){return this.L.streaming.ignoreManagedMediaSourceStreamingHints?!0:this.N};_.t.bc=function(a){this.a||(this.a=new
|
|
252
|
-
_.t.xa=function(a,b){if(a===_.R)return this.a.xa(b);var c=
|
|
253
|
-
_.t.qe=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===_.R?b=
|
|
254
|
-
_.r,this.
|
|
255
|
-
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 u=c-p;if(Math.abs(u)>h.S&&0===l.timestampOffset)return h.g.warn(
|
|
256
|
-
_.t.Eg=function(){this.a&&
|
|
257
|
-
_.t.flush=function(a){return a===_.R?Promise.resolve():
|
|
258
|
-
_.t.getDuration=function(){return this.o.duration};_.t.
|
|
259
|
-
_.t.Mj=function(a){try{this.g.debug(
|
|
260
|
-
_.t.Ng=function(a,b){0>b&&(b+=.001);try{this.g.debug(
|
|
261
|
-
_.t.Sc=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug(
|
|
262
|
-
_.t.eb=function(){return this.f.get(_.hk)||null};_.t.nb=function(){return this.f.get(_.gk)||null};_.t.ob=function(){return this.f.get(_.T)||null};_.t.Ja=function(){return
|
|
263
|
-
_.t.jb=function(a,b){b=void 0===b?!1:b;var c=a;if(!a){var d=this.Ia();if(d&&d.track.kind!==_.
|
|
264
|
-
_.t.qa=function(){return!!this.m&&this.m.qa()};
|
|
265
|
-
|
|
266
|
-
_.t.chooseVariant=function(){var a=
|
|
267
|
-
e=f*(e.next||{bandwidth:Infinity}).bandwidth/this.a.bandwidthUpgradeTarget;this.g.debug("Bandwidth ranges:",(g/1E6).toFixed(3),(h/1E6).toFixed(3),(e/1E6).toFixed(3));b>=h&&b<=e&&(c=d)}this.
|
|
268
|
-
_.t.segmentDownloaded=function(a,b){this.g.debug("Segment downloaded:","deltaTimeMs\x3d"+a,"numBytes\x3d"+b,"lastTimeChosenMs\x3d"+this.
|
|
269
|
-
break a}}else if(Date.now()-this.
|
|
270
|
-
_.t.setVariants=function(a){this.l=a};_.t.setCmsdManager=function(a){this.A=a};_.t.configure=function(a){this.a=a
|
|
271
|
-
|
|
272
|
-
for(var d=a.next();!d.done;d=a.next())c.add(d.value,!b);return c};
|
|
273
|
-
_.t.destroy=function(){var a=this;this.K=!0;var b=[],c;for(c in this.h){var d=this.h[c],e=d[0];this.h[c]=d.slice(0,1);e&&b.push(e.p["catch"](
|
|
274
|
-
{};a.I=null;a.N=!1;for(var g in a.h);a.h={}})};_.t.open=function(){return this.L};_.t.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e;return _.H(function(f){if(1==f.a)return e=_.Kp,_.y(f,d.L,2);a.forEach(function(g,h){var l=_.Rk(g.mimeType,g.codecs);if(h===e.TEXT)d.bc(l);else{var m=new Map;m.set(h,l);if((!_.
|
|
275
|
-
_.t.Hh=function(){return this.J.streaming.ignoreManagedMediaSourceStreamingHints?!0:this.S};_.t.bc=function(a){this.f||(this.f=new
|
|
276
|
-
_.t.xa=function(a,b){if(a===_.R)return this.f.xa(b);var c=
|
|
277
|
-
_.t.qe=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===_.R?b=
|
|
278
|
-
_.r,this.
|
|
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.H[a]&&l&&1===l.buffered.length){p=l.buffered.start(0);var u=c-p;if(Math.abs(u)>h.V&&0===l.timestampOffset)return h.g.warn(
|
|
280
|
-
_.t.Eg=function(){this.f&&
|
|
281
|
-
_.t.flush=function(a){return a===_.R?Promise.resolve():
|
|
282
|
-
_.t.
|
|
283
|
-
_.t.Ig=function(a){try{this.j.readyState>HTMLMediaElement.HAVE_NOTHING?(this.g.debug(
|
|
284
|
-
_.t.start=function(){var a=this,b,c,d;return _.H(function(e){if(1==e.a){b=a.C.Eb();c=
|
|
285
|
-
_.t.resume=function(){if(!
|
|
286
|
-
_.t.Ib=function(a){var b=this,c,d,e,f,g,h,l;return _.H(function(m){switch(m.a){case 1:if(b.f)return m["return"]();c=
|
|
248
|
+
qE.prototype.init=function(a){var b=muxjs.mp4.probe;a=_.lj(a);this.l=b.videoTrackIds(a);this.j=b.timescale(a)||{};this.a.init()};qE.prototype.h=function(a,b){var c=_.lj(a);(c=this.a.parse(c,this.l,this.j))&&c.captions&&b(c.captions);this.a.clearParsedCaptions()};qE.prototype.f=function(){this.a.resetCaptionStream()};_.rE.prototype.init=function(){};_.rE.prototype.h=function(){};_.rE.prototype.f=function(){};_.t=_.tE.prototype;
|
|
249
|
+
_.t.destroy=function(){var a=this;this.I=!0;var b=[],c;for(c in this.h){var d=this.h[c],e=d[0];this.h[c]=d.slice(0,1);e&&b.push(e.p["catch"](CC));for(e=1;e<d.length;++e)d[e].p["catch"](CC),d[e].p.reject()}this.a&&b.push(this.a.destroy());this.D&&b.push(this.D.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.D=null;a.f={};a.w={};a.G=
|
|
250
|
+
{};a.H=null;a.K=!1;for(var g in a.h);a.h={}})};_.t.open=function(){return this.J};_.t.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e;return _.H(function(f){if(1==f.a)return e=_.Kp,_.y(f,d.J,2);a.forEach(function(g,h){var l=_.Rk(g.mimeType,g.codecs);if(h===e.TEXT)d.bc(l);else{var m=new Map;m.set(h,l);if((!_.Ar(l)||!b||g.keyInfo)&&_.Qk(l,h)){var n=_.Qk(l);n&&(m=n(),d.w[h]=m,m=m.demuxMimeTypes(h,l),c&&m["delete"](e.AUDIO))}wE(d,m)}});_.A(f)})};_.t.mi=function(){this.g.debug(MB);Object.values(this.w).forEach(function(a){return a.reset()})};
|
|
251
|
+
_.t.Hh=function(){return this.L.streaming.ignoreManagedMediaSourceStreamingHints?!0:this.N};_.t.bc=function(a){this.a||(this.a=new kE(this.L,this.D));lE(this.a,a)};_.t.re=function(){return this.o?this.o.readyState===_.qe:!0};_.t.Ga=function(a){return a===_.R?this.a.Ga():(a=xE(this,a))?a.Ga():null};_.t.ha=function(a){return a===_.R?this.a.ha():(a=xE(this,a))?a.ha():null};_.t.sb=function(a,b,c){return a===_.R?this.a.sb(b):(a=xE(this,a))?a.sb(b,!1,c):!1};
|
|
252
|
+
_.t.xa=function(a,b){if(a===_.R)return this.a.xa(b);var c=xE(this,a);return c?c.xa(b):0};_.t.Bf=function(){var a={};a.total=new _.Ul(this.j.buffered,"total");a.audio=xE(this,_.ad);a.video=xE(this,_.r);var b=[];this.a&&(b=[{start:this.a.Ga(),end:this.a.ha()}]);a.text=OC(b,_.R);return a};
|
|
253
|
+
_.t.qe=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===_.R?b=mE(this.a,b,c,d):this.w[a]?(b=this.w[a].transmux(b),b.captions&&0<b.captions.length&&(this.a||this.bc(_.pg),oE(this.a,b.captions,c,d,this.f.video.timestampOffset)),e=[],0<b.audio.byteLength&&this.f.audio&&e.push(zE(this,_.ad,this.sf.bind(this,_.ad,b.audio.buffer))),0<b.video.byteLength&&this.f.video&&e.push(zE(this,
|
|
254
|
+
_.r,this.sf.bind(this,_.r,b.video.buffer))),b=Promise.all(e)):(e&&window.muxjs&&(this.a||this.bc(_.pg),null==c&&null==d?this.H.init(b):this.H.h(b,function(p){p.length&&oE(h.a,p,c,d,h.f.video.timestampOffset)})),b=zE(this,a,this.sf.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(kB,c,d,mB,yE(h,a));else if(a===_.ad&&null!==c&&null!==d)UC(h.B),null!==c&&null!==d&&h.g.debug(jB,c,d,mB,yE(h,a));else if(a===_.r&&null!==c&&null!==
|
|
255
|
+
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 u=c-p;if(Math.abs(u)>h.S&&0===l.timestampOffset)return h.g.warn(oB+u+XA+(a+dB)+(c+WA)+(p+cB)),p=zE(h,a,function(){h.Ng(a,u)}),q=zE(h,a,h.Kg.bind(h,a,!1)),Promise.all([p,q])}null!==c&&null!==d&&(h.G[a]=!0)})["catch"](function(p){throw p;})};_.t.Mg=function(a){var b=this.ha(_.r)||0;nE(this.a,a,b)};
|
|
256
|
+
_.t.Eg=function(){this.a&&nE(this.a,"",0)};_.t.remove=function(a,b,c){var d=this;return a===_.R?this.a.remove(b,c):zE(this,a,this.Lg.bind(this,a,b,c)).then(function(){if(a===_.r){var e=d.Ga(a),f=d.ha(a);null!==e&&null!==f&&XC(d.B,e,f)}else a===_.ad&&VC(d.B)})};_.t.clear=function(a){if(a===_.R){if(!this.a)return Promise.resolve();this.H.f();return this.a.remove(0,Infinity)}return zE(this,a,this.Lg.bind(this,a,0,this.o.duration))};
|
|
257
|
+
_.t.flush=function(a){return a===_.R?Promise.resolve():zE(this,a,this.Kg.bind(this,a))};_.t.oi=function(a,b,c,d){var e=this,f,g;return _.H(function(h){f=_.Kp;if(a===f.TEXT){e.a.A=b;var l=e.a;l.h=c;l.l=d;return h["return"]()}g=AE(e,a,b,c,d);e.K&&(g=g.concat(AE(e,f.AUDIO,b,c,d)));return _.y(h,Promise.all(g),0)})};_.t.endOfStream=function(a){var b=this;return DE(this,function(){b.re()||(a?b.o.endOfStream(a):b.o.endOfStream())})};_.t.tf=function(a){var b=this;DE(this,function(){b.o.duration=a})};
|
|
258
|
+
_.t.getDuration=function(){return this.o.duration};_.t.sf=function(a,b){this.g.debug(lB+a+YA);try{this.f[a].appendBuffer(b)}catch(c){throw this.g.warn(wB+a,c),c;}this.g.debug(qB+a+YA)};_.t.Lg=function(a,b,c){if(c<=b)this.Sc(a);else{this.g.debug(LB+a+aB,b,c);try{this.f[a].remove(b,c)}catch(d){throw this.g.warn(yB+a+ZA,b,c,d),d;}this.g.debug(sB+a+aB,b,c)}};
|
|
259
|
+
_.t.Mj=function(a){try{this.g.debug(iB+a+YA);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(vB+a+YA,d),d;}this.g.debug(pB+a+YA);this.Sc(a)};_.t.Kg=function(a){try{this.j.readyState>HTMLMediaElement.HAVE_NOTHING?(this.g.debug(BB+a),this.j.currentTime-=.001):this.g.warn(QB+a+bB+this.j.readyState)}catch(b){throw this.g.warn(xB+a,b),b;}this.g.debug(rB+a);this.Sc(a)};
|
|
260
|
+
_.t.Ng=function(a,b){0>b&&(b+=.001);try{this.g.debug(PB+a,b),this.f[a].timestampOffset=b}catch(c){throw this.g.warn(AB+a,b,c),c;}this.g.debug(uB+a,b);this.Sc(a)};_.t.Nj=function(a,b,c){try{this.g.debug(NB+a,b,c),this.f[a].appendWindowStart=0,this.f[a].appendWindowEnd=c,this.f[a].appendWindowStart=b}catch(d){throw this.g.warn(zB+a,b,c,d),d;}this.g.debug(tB+a,b,c);this.Sc(a)};_.t.T=function(a){this.h[a][0].p.reject(new _.P(_.Q,3,3014,{mediaError:this.j.error?this.j.error.code:0}))};
|
|
261
|
+
_.t.Sc=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug(SB+a),CE(this,a))};_.t.getTextDisplayer=function(){return this.D};var vE=window.URL.createObjectURL;_.x(fF,_.V);_.t=fF.prototype;_.t.initialize=function(a){this.m=a};_.t.release=function(){this.h=[];this.a.clear();this.f.clear()};_.t.load=function(){};_.t.destroy=function(){this.release();this.m=null};_.t.getVideoTracks=function(){return gF(this,_.hk)};_.t.getAudioTracks=function(){return gF(this,_.gk)};_.t.ia=function(){return gF(this,_.T)};_.t.na=function(){return this.a.get(_.hk)||null};_.t.Pa=function(){return this.a.get(_.gk)||null};_.t.Ia=function(){return this.a.get(_.T)||null};
|
|
262
|
+
_.t.eb=function(){return this.f.get(_.hk)||null};_.t.nb=function(){return this.f.get(_.gk)||null};_.t.ob=function(){return this.f.get(_.T)||null};_.t.Ja=function(){return hF(this,_.hk)};_.t.ma=function(){return hF(this,_.gk)};_.t.ua=function(){return hF(this,_.T)};_.t.kb=function(a){jF(this,_.hk,a)};_.t.za=function(a){jF(this,_.gk,a)};_.t.La=function(a){jF(this,_.T,a)};_.t.Za=function(a,b){iF(this,_.hk,a,void 0===b?!1:b)};_.t.ib=function(a,b){iF(this,_.gk,a,void 0===b?!1:b)};
|
|
263
|
+
_.t.jb=function(a,b){b=void 0===b?!1:b;var c=a;if(!a){var d=this.Ia();if(d&&d.track.kind!==_.se){var e=this.ia().find(function(g){return g.kind===_.se&&g.language===d.track.language});if(!e){var f=this.ma();f&&(e=this.ia().find(function(g){return g.kind===_.se&&g.language===f.language}))}e&&(c=e.renditions[0])}}iF(this,_.T,c,b)};_.t.addTextTrack=function(a){var b=this;return _.H(function(c){return b.m?_.y(c,b.m.addTextTrack(a.url,a.language,a.kind,a.mimeType,a.codec,a.label),0):c.F(0)})};
|
|
264
|
+
_.t.qa=function(){return!!this.m&&this.m.qa()};fF.prototype.isAbrEnabled=fF.prototype.qa;fF.prototype.addTextTrack=fF.prototype.addTextTrack;fF.prototype.setTextRendition=fF.prototype.jb;fF.prototype.setAudioRendition=fF.prototype.ib;fF.prototype.setVideoRendition=fF.prototype.Za;fF.prototype.setTextTrack=fF.prototype.La;fF.prototype.setAudioTrack=fF.prototype.za;fF.prototype.setVideoTrack=fF.prototype.kb;fF.prototype.getTextTrack=fF.prototype.ua;fF.prototype.getAudioTrack=fF.prototype.ma;
|
|
265
|
+
fF.prototype.getVideoTrack=fF.prototype.Ja;fF.prototype.getLoadingTextRendition=fF.prototype.ob;fF.prototype.getLoadingAudioRendition=fF.prototype.nb;fF.prototype.getLoadingVideoRendition=fF.prototype.eb;fF.prototype.getTextRendition=fF.prototype.Ia;fF.prototype.getAudioRendition=fF.prototype.Pa;fF.prototype.getVideoRendition=fF.prototype.na;fF.prototype.getTextTracks=fF.prototype.ia;fF.prototype.getAudioTracks=fF.prototype.getAudioTracks;fF.prototype.getVideoTracks=fF.prototype.getVideoTracks;_.t=_.vF.prototype;_.t.stop=function(){this.w=null;this.h=!1;this.l=[];this.j=1;this.f=null;this.D=!1};_.t.init=function(a){this.w=a};
|
|
266
|
+
_.t.chooseVariant=function(){var a=wF(!this.D&&this.a.initialRestrictions?this.a.initialRestrictions:this.a.restrictions,this.l),b=this.getBandwidthEstimate();this.l.length&&!a.length&&(this.g.warn("No variants met the ABR restrictions. Choosing a variant by lowest bandwidth."),a=wF(null,this.l),a=[a[0]]);var c=a[0]||null;a=_.w(_.jJ(a));for(var d=a.next();!d.done;d=a.next()){var e=d.value;d=e.item;var f=isNaN(this.j)||0===this.j?1:Math.abs(this.j),g=f*d.bandwidth,h=g/this.a.bandwidthDowngradeTarget;
|
|
267
|
+
e=f*(e.next||{bandwidth:Infinity}).bandwidth/this.a.bandwidthUpgradeTarget;this.g.debug("Bandwidth ranges:",(g/1E6).toFixed(3),(h/1E6).toFixed(3),(e/1E6).toFixed(3));b>=h&&b<=e&&(c=d)}this.f=Date.now();this.D=!0;return c};_.t.enable=function(){this.h=!0};_.t.disable=function(){this.h=!1};
|
|
268
|
+
_.t.segmentDownloaded=function(a,b){this.g.debug("Segment downloaded:","deltaTimeMs\x3d"+a,"numBytes\x3d"+b,"lastTimeChosenMs\x3d"+this.f,"enabled\x3d"+this.h);var c=this.o;if(!(16E3>b)){var d=8E3*b/a,e=a/1E3;c.a+=b;_.dD(c.f,e,d);_.dD(c.h,e,d)}if(null!=this.f&&this.h)a:{this.g.debug("Suggesting Streams...");if(!this.B){if(!(128E3<=this.o.a)){this.g.debug("Still waiting for a good estimate...");break a}this.B=!0;if(this.a.useSwitchIntervalForInitialSwitch&&Date.now()-this.f<1E3*this.a.switchInterval){this.g.debug("Skipping initial estimation switch due to switch interval...");
|
|
269
|
+
break a}}else if(Date.now()-this.f<1E3*this.a.switchInterval){this.g.debug("Still within switch interval...");break a}c=this.chooseVariant();d=this.getBandwidthEstimate();this.g.debug("Calling switch_(), bandwidth\x3d"+Math.round(d/1E3)+" kbps");c&&this.w(c)}};_.t.playbackRateChanged=function(a){this.j=a};_.t.getBandwidthEstimate=function(){var a=this.A&&this.A.oh();a||(a=this.o,a=128E3>a.a?this.a.defaultBandwidthEstimate:Math.min(_.eD(a.f),_.eD(a.h)));return a};
|
|
270
|
+
_.t.setVariants=function(a){this.l=a};_.t.setCmsdManager=function(a){this.A=a};_.t.configure=function(a){this.a=a};_.t.reset=function(){this.B=!1;this.o=new uF;var a=this.chooseVariant();a&&this.w(a)};AF.prototype.clear=function(){this.a.clear()};DF.prototype.add=function(a,b){var c=void 0===b?!0:b;if(GF(this.f,a,void 0===c?!0:c))return this.a.add(a),!0;_.Fh("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};DF.prototype.values=function(){return this.a.values()};IF.prototype.create=function(a){var b=this,c=this.a===_.dg&&PC(),d=a.filter(function(e){return GF(b.f,e,!c)});return d.length?new DF(d[0],d):this.h.create(a)};
|
|
271
|
+
HF.prototype.create=function(a){var b=JF(a,this.j);0<b.length&&(a=b);b=!1;if(this.a){var c=KF(a,this.a);0<c.length?(a=c,b=!0):_.Fh("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=FE(a,this.f),b.length?a=b:_.Fh("No exact match for the channel count could be found."));b=LF(a,this.l);b.length?a=b:_.Fh("No exact match for spatial audio could be found.");b=this.h===_.dg&&PC();c=new DF(a[0]);a=_.w(a);
|
|
272
|
+
for(var d=a.next();!d.done;d=a.next())c.add(d.value,!b);return c};OF.prototype.getState=function(){return this.a};var NF=0,MF=1;QF.prototype.release=function(){this.f.release()};_.t=SF.prototype;
|
|
273
|
+
_.t.destroy=function(){var a=this;this.K=!0;var b=[],c;for(c in this.h){var d=this.h[c],e=d[0];this.h[c]=d.slice(0,1);e&&b.push(e.p["catch"](CC));for(e=1;e<d.length;++e)d[e].p["catch"](CC),d[e].p.reject()}this.f&&b.push(this.f.destroy());this.D&&b.push(this.D.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.D=null;a.a={};a.w={};a.H=
|
|
274
|
+
{};a.I=null;a.N=!1;for(var g in a.h);a.h={}})};_.t.open=function(){return this.L};_.t.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e;return _.H(function(f){if(1==f.a)return e=_.Kp,_.y(f,d.L,2);a.forEach(function(g,h){var l=_.Rk(g.mimeType,g.codecs);if(h===e.TEXT)d.bc(l);else{var m=new Map;m.set(h,l);if((!_.Ar(l)||!b||g.keyInfo)&&_.Qk(l,h)){var n=_.Qk(l);n&&(m=n(),d.w[h]=m,m=m.demuxMimeTypes(h,l),c&&m["delete"](e.AUDIO))}UF(d,m)}d.h[h]=[]});_.A(f)})};_.t.mi=function(){this.g.debug(MB);Object.values(this.w).forEach(function(a){return a.reset()})};
|
|
275
|
+
_.t.Hh=function(){return this.J.streaming.ignoreManagedMediaSourceStreamingHints?!0:this.S};_.t.bc=function(a){this.f||(this.f=new kE(this.J,this.D));lE(this.f,a)};_.t.re=function(){return this.o?this.o.readyState===_.qe:!0};_.t.Ga=function(a){return a===_.R?this.f.Ga():(a=VF(this,a))?a.Ga():null};_.t.ha=function(a){return a===_.R?this.f.ha():(a=VF(this,a))?a.ha():null};_.t.sb=function(a,b,c){return a===_.R?this.f.sb(b):(a=VF(this,a))?a.sb(b,!1,c):!1};
|
|
276
|
+
_.t.xa=function(a,b){if(a===_.R)return this.f.xa(b);var c=VF(this,a);return c?c.xa(b):0};_.t.Bf=function(){var a={};a.total=new _.Ul(this.j.buffered,"total");a.audio=VF(this,_.ad);a.video=VF(this,_.r);var b=[];this.f&&(b=[{start:this.f.Ga(),end:this.f.ha()}]);a.text=OC(b,_.R);return a};
|
|
277
|
+
_.t.qe=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===_.R?b=mE(this.f,b,c,d):this.w[a]?(b=this.w[a].transmux(b),b.captions&&0<b.captions.length&&(this.f||this.bc(_.pg),oE(this.f,b.captions,c,d,this.a.video.timestampOffset)),e=[],0<b.audio.byteLength&&this.a.audio&&e.push(XF(this,_.ad,this.rf.bind(this,_.ad,b.audio.buffer))),0<b.video.byteLength&&this.a.video&&e.push(XF(this,
|
|
278
|
+
_.r,this.rf.bind(this,_.r,b.video.buffer))),b=Promise.all(e)):(e&&window.muxjs&&(this.f||this.bc(_.pg),null==c&&null==d?this.I.init(b):this.I.h(b,function(p){p.length&&oE(h.f,p,c,d,h.a.video.timestampOffset)})),b=XF(this,a,this.rf.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(kB,c,d,mB,WF(h,a));else if(a===_.ad&&null!==c&&null!==d)UC(h.B),null!==c&&null!==d&&h.g.debug(jB,c,d,mB,WF(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.H[a]&&l&&1===l.buffered.length){p=l.buffered.start(0);var u=c-p;if(Math.abs(u)>h.V&&0===l.timestampOffset)return h.g.warn(oB+u+XA+(a+dB)+(c+WA)+(p+cB)),p=XF(h,a,function(){YF(h,a,u)}),q=XF(h,a,h.Ig.bind(h,a,!1)),Promise.all([p,q])}null!==c&&null!==d&&(h.H[a]=!0)})["catch"](function(p){throw p;})};_.t.Mg=function(a){var b=this.ha(_.r)||0;nE(this.f,a,b)};
|
|
280
|
+
_.t.Eg=function(){this.f&&nE(this.f,"",0)};_.t.remove=function(a,b,c){var d=this;return a===_.R?this.f.remove(b,c):XF(this,a,this.Jg.bind(this,a,b,c)).then(function(){if(a===_.r){var e=d.Ga(a),f=d.ha(a);null!==e&&null!==f&&XC(d.B,e,f)}else a===_.ad&&VC(d.B)})};_.t.clear=function(a){if(a===_.R){if(!this.f)return Promise.resolve();this.I.f();return this.f.remove(0,Infinity)}return XF(this,a,this.Jg.bind(this,a,0,this.o.duration))};
|
|
281
|
+
_.t.flush=function(a){return a===_.R?Promise.resolve():XF(this,a,this.Ig.bind(this,a))};_.t.oi=function(a,b,c,d,e,f){var g=this,h,l,m;return _.H(function(n){if(1==n.a){h=_.Kp;if(a===h.TEXT){g.f.A=b;var p=g.f;p.h=c;p.l=d;return n["return"]()}return _.y(n,dG(g,a,e,f),2)}l=n.f;m=ZF(g,a,b,c,d,l);g.N&&(m=m.concat(ZF(g,h.AUDIO,b,c,d,l)));return _.y(n,Promise.all(m),0)})};_.t.endOfStream=function(a){var b=this;return bG(this,function(){b.re()||(a?b.o.endOfStream(a):b.o.endOfStream())})};
|
|
282
|
+
_.t.tf=function(a){var b=this;bG(this,function(){b.o.duration=a})};_.t.getDuration=function(){return this.o.duration};_.t.rf=function(a,b){this.g.debug(lB+a+YA);try{this.a[a].appendBuffer(b)}catch(c){throw this.g.warn(wB+a,c),c;}this.g.debug(qB+a+YA)};_.t.Jg=function(a,b,c){if(c<=b)this.lc(a);else{this.g.debug(LB+a+aB,b,c);try{this.a[a].remove(b,c)}catch(d){throw this.g.warn(yB+a+ZA,b,c,d),d;}this.g.debug(sB+a+aB,b,c)}};
|
|
283
|
+
_.t.Ig=function(a){try{this.j.readyState>HTMLMediaElement.HAVE_NOTHING?(this.g.debug(BB+a),this.j.currentTime-=.001):this.g.warn(QB+a+bB+this.j.readyState)}catch(b){throw this.g.warn(xB+a,b),b;}this.g.debug(rB+a);this.lc(a)};_.t.T=function(a){this.h[a][0].p.reject(new _.P(_.Q,3,3014,{mediaError:this.j.error?this.j.error.code:0}))};_.t.lc=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug(SB+a),aG(this,a))};_.t.getTextDisplayer=function(){return this.D};var TF=window.URL.createObjectURL;eG.prototype.release=function(){this.a=this.h=null;this.f=function(){}};eG.prototype.l=function(a){var b=this.a,c=this.h.periods;a=YC(c,a)||c[0];b!==a&&this.f(a);this.a=a};gG.prototype.getConfiguration=function(){return this.j};gG.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};gG.prototype.set=function(a,b){this.h=a;kG(this,b)};var nG=new _.ip(function(){return new Uint8Array([0,0,0,80,115,105,110,102,0,0,0,12,102,114,109,97,0,0,0,0,0,0,0,20,115,99,104,109,0,0,0,0,99,101,110,99,0,1,0,0,0,0,0,40,115,99,104,105,0,0,0,32,116,101,110,99,0,0,0,0,0,0,1,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])});_.t=_.pG.prototype;_.t.destroy=function(){var a=this,b,c,d,e;return _.H(function(f){if(1==f.a){b=[];c=_.w(a.a.values());for(d=c.next();!d.done;d=c.next())e=d.value,AG(e),b.push(BG(e));return _.y(f,Promise.all(b),2)}a.a.clear();a.o.clear();a.C=null;a.j=null;a.G=null;a.l=null;a.h=null;a.f=!0;_.A(f)})};
|
|
284
|
+
_.t.start=function(){var a=this,b,c,d;return _.H(function(e){if(1==e.a){b=a.C.Eb();c=wG(a,b);d=a.C.Nf(qG(a)[c]);if(!d.variant&&!d.text)throw a.g.error("start(): No streams chosen"),new _.P(_.Q,5,5005,"No streams chosen.");a.D=!d.variant&&!!d.text;return _.y(e,UG(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.C&&a.C.gm&&(a.g.debug("init: calling onInitialStreamsSetup()..."),a.C.gm());_.A(e)})};
|
|
285
|
+
_.t.resume=function(){if(!MG(this))for(var a=_.w(this.a.values()),b=a.next();!b.done;b=a.next())b=b.value,b.endOfStream=!1,yG(this,b,0)};
|
|
286
|
+
_.t.Ib=function(a){var b=this,c,d,e,f,g,h,l;return _.H(function(m){switch(m.a){case 1:if(b.f)return m["return"]();c=JG(a);if(a.gb||null==a.ab||a.jc)return m["return"]();a.ab=null;if(!a.Nb){m.F(2);break}b.g.debug(c,"skipping update and clearing the buffer");return _.y(m,OG(b,a,a.Re,a.oe),3);case 3:return m["return"]();case 2:_.B(m,4);d=YG(b,a);null!=d&&(yG(b,a,d),a.Zc=!1);_.qh(m,5);break;case 4:return e=_.E(m),_.y(m,hH(b,e),6);case 6:return m["return"]();case 5:mH(b,a);if(!NG(b)){m.F(0);break}if(b.C.configuration.vl){b.g.debug("End of stream reached, keeping MediaSource open.");
|
|
287
287
|
f=_.w(b.a.values());for(g=f.next();!g.done;g=f.next())h=g.value,h.ab=null;return m["return"]()}b.g.debug("End of stream reached, calling ms.endOfStream().");return _.y(m,b.C.W.endOfStream(),8);case 8:if(b.f)return m["return"]();l=b.C.W.getDuration();l<b.j.presentationTimeline.getDuration()&&(b.j.presentationTimeline.f=l);b.C.Sh();_.A(m)}})};
|
|
288
|
-
_.t.Cm=function(a,b,c,d){var e=
|
|
289
|
-
_.t.wn=function(a){var b=this,c=!1,d=0;(new _.Pm).M(_.
|
|
290
|
-
_.t.unload=function(){var a=this,b;return _.H(function(c){if(1==c.a){
|
|
291
|
-
_.t.getBufferInfo=function(a){if(this.L){var b=this.L.Bf(),c=new _.Ul(void 0,a);switch(a){case _.hk:return b.video?b.video:c;case _.gk:return b.audio?b.audio:c;case _.T:return b.text?b.text:c}return b.total?b.total:c}return this.Uc?(b=
|
|
288
|
+
_.t.Cm=function(a,b,c,d){var e=pC(d.reader),f=pC(d.reader),g=_.Km(d.reader),h=_.Km(d.reader),l=_.Km(d.reader),m=_.Km(d.reader);d=_.Om(d.reader,d.reader.Ha()-d.reader.getPosition());a=a.startTime+b.startTime+h/g;if(c.includes(e))if("urn:mpeg:dash:event:2012"===e)this.C.Wh();else this.C.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}}))};
|
|
289
|
+
_.t.wn=function(a){var b=this,c=!1,d=0;(new _.Pm).M(_.Te,_.Qm).M(_.sg,_.Qm).M(_.Oe,_.Qm).M(_.Se,_.Qm).M(_.ig,_.Qm).Y(_.kg,_.Rm).M("encv",function(e){e.reader.skip(78);_.Qm(e)}).M("pasp",function(e){d=e.start+e.headerSize;var f=_.Km(e.reader),g=_.Km(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 _.Cm(new DataView(a.data)),a.seek(d),_.W(a,1),_.W(a,1))};_.x(qH,_.em);_.t=qH.prototype;_.t.init=function(a,b){var c=a.getMedia();_.em.prototype.init.call(this,a,b);CH(this,c)};_.t.namespace=function(){return YB};_.t.$g=function(){return new fF};_.t.getState=function(){return this.ic};_.t.getDrmInfo=function(){return this.w?this.w.getDrmInfo():null};
|
|
290
|
+
_.t.unload=function(){var a=this,b;return _.H(function(c){if(1==c.a){lF(a,!1);a.Ld=!1;if(!a.Z)return c["return"]();a.log.debug("Unload player with source",a.Z);(b=a.getTrackManager())&&b.release();return a.G===SH?c["return"]():_.y(c,EH(a),2)}a.Z=null;a.ng=0;a.Mc=null;a.aa=null;_.A(c)})};_.t.release=function(){var a=this;return _.H(function(b){if(a.Ea)return b["return"](a.Ea);a.Ea=tH(a);a.Ea["finally"](function(){a.Ea=null});return b["return"](a.Ea)})};
|
|
291
|
+
_.t.getBufferInfo=function(a){if(this.L){var b=this.L.Bf(),c=new _.Ul(void 0,a);switch(a){case _.hk:return b.video?b.video:c;case _.gk:return b.audio?b.audio:c;case _.T:return b.text?b.text:c}return b.total?b.total:c}return this.Uc?(b=SC(this.Uc),OC(b,a)):_.em.prototype.getBufferInfo.call(this,a)};_.t.getPosition=function(){var a=this.Od,b=this.getMediaPosition();a.a&&(a=a.a,b-=a.f,b=0>b?0:b>a.a?a.a:b);return b};_.t.getMediaPosition=function(){return this.B?bE(this.B):_.em.prototype.getMediaPosition.call(this)};
|
|
292
292
|
_.t.seek=function(a){var b=this.Od;b=b.a?a+b.a.qb():a;b!==a&&this.log.info("Seeking to "+a+" s corresponding to media time of "+(b+" s."));return _.em.prototype.seek.call(this,b)};_.t.getPresentationStartTime=function(){return this.f?this.f.presentationTimeline.getPresentationStartTime():null};_.t.getDuration=function(){var a=this.Od,b=this.getMediaDuration();return a.a?a.a.getDuration():b};_.t.getMediaDuration=function(){return this.f?this.f.presentationTimeline.getDuration():Infinity};
|
|
293
|
-
_.t.destroy=function(){var a=this;return _.H(function(b){if(1==b.a)return _.y(b,_.em.prototype.destroy.call(a),2);if(a.G===
|
|
294
|
-
_.t.setupPlaylist=function(a){var b=this,c,d,e,f,g,h,l,m,n,p,q,u,v;return _.H(function(z){switch(z.a){case 1:return c=new _.Oj,b.
|
|
295
|
-
case 6:f=z.f;g=f.filter(function(C){return C.manifest.presentationTimeline.isLive()});if(h=g[0])b.A=h.parser;if(1<g.length)throw new _.P(_.Q,7,7003,"Playlist of multiple live streams is not supported.");if(h){l=b.configuration.playlist.content;if(l===_.
|
|
296
|
-
q=
|
|
297
|
-
_.t.appendLoad=function(a){var b=this,c;return _.H(function(d){if(1==d.a){
|
|
298
|
-
_.t.Hg=function(){var a=this;return _.H(function(b){
|
|
299
|
-
_.t.load=function(a){return
|
|
300
|
-
_.t.getSeekRange=function(){var a={start:0,end:0};if(this.f){var b=this.f.presentationTimeline;a={start:
|
|
301
|
-
_.t.setPlaybackRate=function(a,b){if(0===a)this.log.warn("A trick play rate of 0 is unsupported!");else if(this.G===
|
|
302
|
-
d),_.
|
|
303
|
-
_.t.getStats=function(){if(this.G!==
|
|
304
|
-
_.t.getTimelineCues=function(){return this.I?
|
|
305
|
-
_.t.addTextTrack=function(a,b,c,d,e,f){var g=this,h,l,m,n,p,q,u,v,z;return _.H(function(C){if(1==C.a){if(g.G!==
|
|
306
|
-
findSegmentPosition:function(){return 1},getSegmentReference:function(I){return 1===I?u:null},adjustSegmentDurations:function(){},getDuration:function(){return q},segmentLookupStrategy:_.
|
|
307
|
-
2)}if(z=_.
|
|
308
|
-
_.t.Lj=function(a){this.log.debug(_.
|
|
309
|
-
_.t.Kj=function(){this.log.debug("canSwitch_");this.fa=!1;this.configuration.abr.enabled&&this.
|
|
310
|
-
_.t.Wi=function(a,b,c){if((void 0===c?"":c)===
|
|
311
|
-
|
|
312
|
-
_.t.ln=function(a){var b=this,c,d,e,f,g,h,l,m;return _.H(function(n){switch(n.a){case 1:if(!b.Jc)return n["return"]();b.log.info("Attempt to switch CDN.");c=b.getLoadedSource();d=b.qa();return _.y(n,b.Jc(c.url,a),2);case 2:e=n.f;if(!e)return n["return"]();f=_.O.oa(b.getLoadedSource(),{url:e});d&&b.
|
|
313
|
-
_.y(n,b.Jc(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.
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
_.Vj(4)?
|
|
317
|
-
_.t.append=function(a){function b(e){if(e.startTime>=e.endTime)_.Fh("Invalid cue times: "+e.startTime+" - "+e.endTime),e=null;else{var f=e.payload||"";f=f.replace(/<br\s*\/?>/igm,"\n");f=_.S.hg(f);f=new VTTCue(e.startTime,e.endTime,f);f.line=-1;try{f.align=_.
|
|
318
|
-
e.startTime-f.startTime:e.endTime!==f.endTime?e.endTime-f.startTime:c.indexOf(f)-c.indexOf(e)});d=_.w(a);for(a=d.next();!a.done;a=d.next())this.a.addCue(a.value)};_.t.remove=function(a,b){if(!this.a)return!1;
|
|
293
|
+
_.t.destroy=function(){var a=this;return _.H(function(b){if(1==b.a)return _.y(b,_.em.prototype.destroy.call(a),2);if(a.G===SH)return b["return"]();a.log.debug("Destroying player...");a.G=SH;BH(a);a.o&&(a.o.release(),a.o=null);a.$&&(a.$.release(),a.$=null);a.Lc=null;a.h=null;_.A(b)})};_.t.getTimeline=function(){return this.Lc};
|
|
294
|
+
_.t.setupPlaylist=function(a){var b=this,c,d,e,f,g,h,l,m,n,p,q,u,v;return _.H(function(z){switch(z.a){case 1:return c=new _.Oj,b.l.a=c,_.B(z,2),zH(b),b.ea=_.Kb,_.y(z,FH(b),4);case 4:return zF(b.l,c),d=a[0],d.playlist&&d.playlist.startTime&&(d.startTime=d.playlist.startTime),b.Z=_.Dp(d),b.configuration=_.cm(b.Kc,d),b.log.info("Loading playlist configurations",a),b.Lc=uH(b.configuration),_.y(z,GH(b,c),5);case 5:return zF(b.l,c),e=a.map(function(C){return HH(b,C,0,null,!0)}),_.y(z,Promise.all(e),6);
|
|
295
|
+
case 6:f=z.f;g=f.filter(function(C){return C.manifest.presentationTimeline.isLive()});if(h=g[0])b.A=h.parser;if(1<g.length)throw new _.P(_.Q,7,7003,"Playlist of multiple live streams is not supported.");if(h){l=b.configuration.playlist.content;if(l===_.mc)throw new _.P(_.Q,7,7003,"Cannot play live content in VOD mode.");if("IPR"===l&&h!==f[f.length-1])throw new _.P(_.Q,7,7003,"Wrong order of playlist assets.");}m=null==h;n=new _.iD({version:2},null,0,m);p=f.map(function(C){return bF(C.manifest)});
|
|
296
|
+
q=dF(p,n);b.f=q;u=b;return _.y(z,IH(b,q,b.configuration.drm),7);case 7:return u.w=z.f,zF(b.l,c),_.y(z,JH(b,c),8);case 8:zF(b.l,c);GG(b.a,q);vH(b,q);c.resolve();_.qh(z,0);break;case 2:v=_.E(z);if(!b.A){z.F(9);break}return _.y(z,b.A.stop(),10);case 10:b.A=null;case 9:KH(b,v,c),_.A(z)}})};
|
|
297
|
+
_.t.appendLoad=function(a){var b=this,c;return _.H(function(d){if(1==d.a){zH(b);if(b.ea!==_.Kb)throw new _.P(_.Q,7,7003,"Cannot append-load to non-playlist player.");return _.y(d,RH(b,a),2)}c=d.f;b.f=c.manifest;b.A=c.parser;GG(b.a,c.manifest);NG(b.a)&&b.a.resume();vH(b,c.manifest);_.A(d)})};_.t.seekWith=function(a){return this.seek(this.getPosition()+a)};
|
|
298
|
+
_.t.Hg=function(){var a=this;return _.H(function(b){zH(a);if(!a.Me)return a.log.warn("No preloaded asset found"),b["return"]();a.log.info("Loading preloaded asset",a.Me);a.Me=null;return _.y(b,JH(a,null),0)})};_.t.preload=function(a){var b=this;return _.H(function(c){if(1==c.a)return zH(b),_.Un("preload.start"),b.log.info("Preloading asset",a),_.y(c,LH(b,a,!1),2);b.Me=a;b.log.info("Preloaded asset",a);_.Un("preload.end");_.Vn("preload","preload.start","preload.end");_.A(c)})};
|
|
299
|
+
_.t.load=function(a){return LH(this,a)};_.t.detach=function(){var a=this;return _.H(function(b){if(1==b.a)return _.y(b,AH(a),2);BH(a);_.A(b)})};_.t.isLive=function(){var a;this.f?(a=this.f.presentationTimeline.isLive())||(a=this.f.presentationTimeline,a=Infinity!==a.f&&!a.o):a=!1;return a};_.t.ai=function(){this.log.debug("User seeking finished");this.K&&kI(this);lI(this)};
|
|
300
|
+
_.t.getSeekRange=function(){var a={start:0,end:0};if(this.f){var b=this.f.presentationTimeline;a={start:jD(b),end:tD(b)}}b=this.Od;b.a?(b=b.a.getDuration(),b>a.end&&(b=a.end),b={start:0,end:b}):b=a;return b};_.t.qc=function(){return this.f?this.f.presentationTimeline.qc():null};_.t.getPlaybackRate=function(){if(this.J){var a=this.J;a=a.l?0:a.h}else a=0;return a};
|
|
301
|
+
_.t.setPlaybackRate=function(a,b){if(0===a)this.log.warn("A trick play rate of 0 is unsupported!");else if(this.G===pH){if(_.Vj()){this.log.warn("Pausing and unpausing to mitigate playbackRate platform issue.");var c=this.getSurface().getMedia();c.pause();this.J.set(a,b);c.play()}else this.J.set(a,b);if((c=this.J.getConfiguration())&&c.preferTrickPlayTracks){c=this.a;var d=1<Math.abs(a),e=c.a.get(_.r);if(e){var f=e.stream;if(f)if(c.g.debug("setTrickPlay",d),d)(d=f.trickModeVideo)&&!e.cc&&(c.g.debug("Engaging trick mode stream",
|
|
302
|
+
d),_.DG(c,d,!1,0),e.cc=f);else if(f=e.cc)c.g.debug("Restoring non-trick-mode stream",f),e.cc=null,_.DG(c,f,!0,0)}}this.h.playbackRateChanged(a)}};_.t.ia=function(){if(this.f&&this.B){var a=XH(this);if(null==a)a=null;else{if(!CF(this.S,a).text){var b=_.UE(a.textStreams,this.Cd,this.Ce,this.zd);b.length&&(b=b[0],CF(this.S,a).text=b)}a=CF(this.S,a).text}b=[];for(var c=_.w(YI(this)),d=c.next();!d.done;d=c.next()){d=d.value;var e=RE(d);e.active=d===a;b.push(e)}return b}return[]};_.t.getPeriods=function(){return this.f.periods};
|
|
303
|
+
_.t.getStats=function(){if(this.G!==pH)return _.hp();lI(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===pH){if(a=nI(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()};_.t.we=function(){return this.I};
|
|
304
|
+
_.t.getTimelineCues=function(){return this.I?AD(this.I,OI(this)):[]};_.t.resetAbr=function(){this.h&&this.h.reset()};_.t.ve=function(){return this.h};
|
|
305
|
+
_.t.addTextTrack=function(a,b,c,d,e,f){var g=this,h,l,m,n,p,q,u,v,z;return _.H(function(C){if(1==C.a){if(g.G!==pH)throw g.log.error("Must call load() and wait for it to resolve before adding text tracks."),Error("State error!");h=XH(g);l=_.Kp;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 _.P(1,4,4040);u=new _.bj(1,0,q,function(){return[a]},0,null,0);v={id:g.Ci++,originalId:null,createSegmentIndex:Promise.resolve.bind(Promise),
|
|
306
|
+
findSegmentPosition:function(){return 1},getSegmentReference:function(I){return 1===I?u:null},adjustSegmentDurations:function(){},getDuration:function(){return q},segmentLookupStrategy:_.aC,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.Ge.add(v);h.textStreams.push(v);return _.y(C,zG(g.a,v),
|
|
307
|
+
2)}if(z=_.sG(g.a,_.R))CF(g.S,h).text=z;g.Ge["delete"](v);g.log.debug("Choosing new streams after adding a text stream");TI(g,h);ZH(g);return C["return"](RE(v))})};
|
|
308
|
+
_.t.Lj=function(a){this.log.debug(_.eC,a);try{this.log.debug("onChooseStreams_, choosing variant from ",a.variants);this.log.debug("onChooseStreams_, choosing text from ",a.textStreams);var b=WI(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}}};
|
|
309
|
+
_.t.Kj=function(){this.log.debug("canSwitch_");this.fa=!1;this.configuration.abr.enabled&&this.h.enable();this.Ma&&(EG(this.a,this.Ma,this.Ai,this.zi),this.Ma=null);this.ja&&(_.DG(this.a,this.ja,!0,0),this.ja=null)};_.t.vn=function(){this.A&&this.A.update()};_.t.rm=function(){this.B&&this.B.j.Je()};
|
|
310
|
+
_.t.Wi=function(a,b,c){if((void 0===c?"":c)===cC)return ZH(this),this.qa()||(this.configuration.abr.enabled=!0,this.h.enable()),TI(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===_.ad&&(h=h&&l.language===a.language));return h})&&this.qa()){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)}ZH(this);this.qa()||(this.configuration.abr.enabled=!0,this.h.enable());
|
|
311
|
+
TI(this,b)}return c};_.t.em=function(){this.log.debug("endOfStream called by streaming engine");this.Ld=!0};_.t.onError=function(a){if(this.G!==SH&&7001!==a.code&&7E3!==a.code){var b=new _.L(_.re,{detail:a});a.severity===_.Q&&sH(this,_.wp);this.trigger(b);b.defaultPrevented&&(b.a=!0)}};_.t.qf=function(a){a.type===_.ke?this.dispatchEvent(a):"largegap"!==a.type&&(a.type===_.Qg?TH(this):"emsg"!==a.type&&(a instanceof _.L?this.dispatchEvent(a):this.log.debug(_.hc,a.type)))};_.t.qa=function(){return this.configuration.abr.enabled};
|
|
312
|
+
_.t.ln=function(a){var b=this,c,d,e,f,g,h,l,m;return _.H(function(n){switch(n.a){case 1:if(!b.Jc)return n["return"]();b.log.info("Attempt to switch CDN.");c=b.getLoadedSource();d=b.qa();return _.y(n,b.Jc(c.url,a),2);case 2:e=n.f;if(!e)return n["return"]();f=_.O.oa(b.getLoadedSource(),{url:e});d&&b.h.disable();return _.y(n,PG(b.a),3);case 3:g=nI(b);case 4:return h=!1,_.B(n,7),b.log.info("Switching CDN to "+f.url+"."),_.y(n,ZI(b,f,g),9);case 9:_.qh(n,6);break;case 7:return l=_.E(n),b.log.info("Switch failed"),
|
|
313
|
+
_.y(n,b.Jc(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(),LG(b.a,!0),b.Z[b.getSourceIndex()]=f,a.f=!0,b.trigger(new _.L(_.sd,{newManifest:f.url})),_.A(n))}})};var SH=0,oH=1,pH=2,YH=[_.ff,_.ze];$I.prototype.a=function(){return YB};
|
|
314
|
+
$I.prototype.canPlay=function(a,b){if(_.bl())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 _.Jt||_.Kt(a.url)in _.Lt?!0:!1:!1;if(d&&e){if(_.Vj(2))return 1;if(_.dl()&&c===_.Fl){if(b.streaming.preferNativeHlsOnSafari)return 1;_.Fh("Support for MSE + FairPlay on Apple is experimental. In case of issues, consider using native HLS.")}return 2}return 0};
|
|
315
|
+
$I.prototype.f=function(a){return a===_.pa||a===_.Kb};$I.prototype.create=function(){return new qH};_.Ph(new $I);_.pq(function(){_.Kh("MediaSource.install");if(window.MediaSource)if(window.cast&&cast.__platform__&&cast.__platform__.canDisplayType)_.Jh("Patching Chromecast MSE bugs."),eJ();else if(_.dl()){var a=navigator.appVersion;a=0<=a.indexOf("Version")?parseInt(a.match(/Version\/(\d+)/)[1],10):13;cJ();10>=a?(_.Jh("Blacklisting MSE on Safari \x3c\x3d 10."),window.MediaSource=null):12>=a?(_.Jh("Patching Safari 11 \x26 12 MSE bugs."),aJ(),bJ()):(_.Jh("Patching Safari 13 MSE bugs."),aJ())}else _.Vj(2)||_.Vj(3)||
|
|
316
|
+
_.Vj(4)?dJ():_.Jh("Using native MSE as-is.");else _.Jh("No MSE implementation available.")});_.x(fJ,_.xu);_.t=fJ.prototype;
|
|
317
|
+
_.t.append=function(a){function b(e){if(e.startTime>=e.endTime)_.Fh("Invalid cue times: "+e.startTime+" - "+e.endTime),e=null;else{var f=e.payload||"";f=f.replace(/<br\s*\/?>/igm,"\n");f=_.S.hg(f);f=new VTTCue(e.startTime,e.endTime,f);f.line=-1;try{f.align=_.ud}catch(g){f.align="middle"}e.writingMode===_.Gg?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?
|
|
318
|
+
e.startTime-f.startTime:e.endTime!==f.endTime?e.endTime-f.startTime:c.indexOf(f)-c.indexOf(e)});d=_.w(a);for(a=d.next();!a.done;a=d.next())this.a.addCue(a.value)};_.t.remove=function(a,b){if(!this.a)return!1;gJ(this.a,function(c){return c.startTime<b&&c.endTime>a});return!0};_.t.isTextVisible=function(){return this.a.mode===_.$f};_.t.setTextVisibility=function(a){null!==this.a&&(this.a.mode=a?_.$f:_.we)};_.t.destroy=function(){this.a&&gJ(this.a,function(){return!0});this.a=null;return Promise.resolve()};hJ.prototype.isSupported=function(){return!0};hJ.prototype.create=function(a){return new fJ(a)};_.Zo("single-native",new hJ);};
|
|
319
319
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
320
320
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
321
321
|
else{_=this.clpp._;(f.call(g,this));}
|