@castlabs/prestoplay 6.25.2 → 6.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +5 -5
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +7 -7
- package/cjs/cl.cast.js +112 -112
- package/cjs/cl.conviva.js +32 -32
- package/cjs/cl.core.js +601 -600
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +89 -88
- package/cjs/cl.externs.js +37 -31
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +77 -77
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +23 -23
- package/cjs/cl.mediatailor.js +3 -3
- package/cjs/cl.mse.js +341 -334
- package/cjs/cl.muxdata.js +15 -15
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +14 -14
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.sessions.js +16 -16
- package/cjs/cl.simid.js +17 -17
- package/cjs/cl.smooth.js +72 -72
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +71 -71
- package/cjs/cl.ttml.js +29 -29
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +12 -12
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.yospace.js +4 -4
- package/cjs/cl.youbora.js +38 -36
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +87 -87
- package/cl.conviva.js +27 -27
- package/cl.core.js +489 -488
- package/cl.crypto.js +9 -9
- package/cl.dash.js +82 -82
- package/cl.externs.js +37 -31
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +79 -80
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +17 -17
- package/cl.mediatailor.js +3 -3
- package/cl.mse.js +299 -292
- package/cl.muxdata.js +13 -13
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +10 -10
- package/cl.playlist.js +5 -5
- package/cl.sessions.js +10 -10
- package/cl.simid.js +14 -14
- package/cl.smooth.js +60 -60
- package/cl.thumbnails.js +19 -19
- package/cl.tizen.js +57 -57
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -8
- package/cl.vr.js +14 -14
- package/cl.vtt.js +12 -12
- package/cl.yospace.js +3 -3
- package/cl.youbora.js +28 -27
- package/package.json +3 -3
- package/typings.d.ts +41 -3
package/cjs/cl.mse.js
CHANGED
|
@@ -1,345 +1,352 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
WG,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
_.
|
|
7
|
-
_.
|
|
8
|
-
_.
|
|
9
|
-
c?'CHECKSUM\x3d"'+c+'" ':"",'VALUE\x3d"'+e+'"',"\x3e\x3c/KID\x3e\x3c/PROTECTINFO\x3e",d?
|
|
10
|
-
b,d||null,e,a,c)};_.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
_.
|
|
14
|
-
_.
|
|
15
|
-
_.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
2
|
+
var f=function(window){var JC,KC,LC,MC,NC,OC,PC,QC,RC,TC,UC,VC,WC,YC,ZC,$C,aD,cD,dD,eD,fD,gD,hD,iD,mD,nD,pD,qD,rD,sD,tD,vD,xD,yD,DD,ED,FD,GD,HD,ID,JD,KD,MD,QD,RD,TD,UD,VD,WD,YD,ZD,aE,bE,dE,eE,fE,hE,iE,jE,kE,lE,mE,nE,oE,qE,vE,BE,GE,JE,yE,IE,KE,LE,ME,NE,OE,PE,QE,RE,SE,WE,YE,ZE,$E,XE,bF,aF,cF,dF,gF,hF,iF,fF,eF,jF,nF,pF,mF,qF,lF,oF,kF,sF,rF,tF,uF,vF,yF,AF,DF,FF,EF,JF,MF,KF,LF,NF,PF,OF,RF,QF,SF,TF,UF,VF,XF,YF,ZF,$F,aG,cG,dG,eG,gG,hG,fG,iG,jG,kG,lG,mG,nG,oG,pG,qG,sG,vG,wG,AG,yG,zG,EG,DG,FG,JG,HG,LG,NG,MG,PG,QG,RG,TG,SG,UG,VG,
|
|
3
|
+
WG,XG,$G,ZG,bH,OG,cH,aH,dH,YG,jH,kH,gH,eH,hH,iH,lH,mH,pH,oH,qH,rH,sH,fH,tH,nH,wH,xH,zH,yH,AH,CG,BH,CH,FH,DH,EH,HH,GH,IH,JH,KH,NH,PH,OH,QH,RH,SH,TH,WH,VH,UH,YH,XH,$H,dI,fI,gI,lI,oI,pI,rI,tI,vI,xI,aI,yI,BI,CI,DI,FI,GI,II,JI,LI,sI,uI,jI,OI,NI,hI,wI,RI,PI,KI,MI,TI,SI,QI,$I,aJ,VI,cJ,WI,YI,fJ,eJ,ZI,dJ,gJ,iI,HI,hJ,iJ,XI,EI,kI,mI,cI,UI,nI,bJ,zI,AI,jJ,mJ,nJ,oJ,pJ,qJ,rJ,sJ,vJ,wJ,uJ,XJ,YJ,fK,ZJ,tJ,eK,gK,$J,aK,bK,lK,hK,VJ,UJ,TJ,WJ,jK,kK,cK,dK,uK,pK,yK,zK,AK,FK,CK,uG,rG,OK,NK,xG,tG,LK,QK,KK,PK,JK,RK,vK,tK,EK,
|
|
4
|
+
MK,TK,DK,HK,nK,GK,UK,sK,WK,VK,XK,YK,aL,xK,rK,$K,ZK,iK,SK,cL,dL,BG,eL,fL,bL,xJ,gL,oK,BK,wK,hL,iL,jL,kL,lL,mL,nL,oL,pL;JC=" buffer";KC=" is being or has been set up";LC=" seconds";MC="\x3c/DATA\x3e\x3c/WRMHEADER\x3e";NC="\x3c/LA_URL\x3e";OC="\x3cLA_URL\x3e";PC='\x3cWRMHEADER xmlns\x3d"http://schemas.microsoft.com/DRM/2007/03/PlayReadyHeader" version\x3d"';QC="Cannot get segment, period ID unknown";RC="Choosing new streams after key status change";_.SC="Could not load text stream with id: ";TC="IterateSegmentReference";
|
|
5
|
+
UC="Jumping forward";VC="MediaSource threw QuotaExceededError:";WC="Period not found.";_.XC="Player is in ERROR state and can not switch to ";YC="PrestoPlay TextTrack";ZC="Removing audio from variant - audio not compatible with platform";$C="Setting playback rate to\x3d";aD="URI-REPLACEMENT";_.bD="Updating manifest...";cD="X-Playback-Session-Id";dD="bufferBehind\x3d";eD="bufferedBehind\x3d";fD="calling onCanSwitch()...";gD="cannot find segment";hD="clpp.mse.Player";iD="currentPeriod.startTime\x3d";
|
|
6
|
+
_.jD="dashif:Laurl";_.kD="getSegmentNextReference";_.lD="iterateSegmentReference";mD="key-restriction";nD="manifest.start";_.oD="onChooseStreams_";pD="presentationTime:";qD="presentationTime\x3d";rD="reference.endTime\x3d";sD="reference.position\x3d";tD="reference.startTime\x3d";_.uD="subtitles";vD="switch: Stream ";_.wD=function(a,b){return _.eh[a]=b};xD=function(a,b){a.f=a.f.filter(function(c){return c!==b})};
|
|
7
|
+
yD=function(a){for(var b=a.a+a.f.byteOffset,c=void 0;_.jn(a);)if(0===_.ln(a)){c=a.a+a.f.byteOffset-1;break}a=a.f.buffer.slice(b,c);return _.Q.ea(a)};_.AD=function(a){var b=new Uint8Array(zD),c=4+b.byteLength+a.j.byteLength+4+a.f.byteLength,d=new _.en(c,!1);_.V(d,c);_.gn(d,b);_.gn(d,a.j);_.V(d,a.f.byteLength);_.gn(d,a.f);return _.Oj(d.buffer)};
|
|
8
|
+
_.BD=function(a,b,c,d){var e=_.Rm(b);if(8!==e.byteLength)e="";else{var f=_.Zo(e);e=_.Om(f);b:switch(f=f.byteLength,_.Ph("Trying to create PlayReady header in version",a),a){case "4.0.0.0":e=[PC+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?OC+d+NC:"",MC].join("");break b;case "4.1.0.0":e=[PC+a+'"\x3e','\x3cDATA\x3e\x3cPROTECTINFO\x3e\x3cKID ALGID\x3d"AESCTR" ',
|
|
9
|
+
c?'CHECKSUM\x3d"'+c+'" ':"",'VALUE\x3d"'+e+'"',"\x3e\x3c/KID\x3e\x3c/PROTECTINFO\x3e",d?OC+d+NC:"",MC].join("");break b;case "4.2.0.0":case "4.3.0.0":e=[PC+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?OC+d+NC:"",MC].join("");break b;default:_.Kh("Cannot create PlayReady header in version",a),e=""}}if(!e)return null;_.Ph("New payload",e);e=_.Oj(_.Q.Kf(e,!0));return new _.Vo(_.$o,
|
|
10
|
+
b,d||null,e,a,c)};_.CD=function(a,b){return b===a.version?a:_.BD(b,a.a,a.l||void 0,a.h||void 0)};DD=function(a,b){a:{if(b){var c=_.v(a.h.keys());for(var d=c.next();!d.done;d=c.next()){d=a.h.get(d.value);for(var e=0;e<d.vb.length;e++)if(d.vb[e]===b){c=d;break a}}}c=null}return c?c.qb:null};ED=function(a,b){if(_.wl("Edge/"))return!0;b=b.toLowerCase();if(_.wk()&&b.includes('codecs\x3d"ac-3"')){var c=b.replace("ac-3",_.ee);return a.K.has(b)||a.K.has(c)}return a.K.has(b)};
|
|
11
|
+
FD=function(a,b){var c=a.o.get(b);return!(!c||c!==_.bf&&c!==_.ue)};GD=function(a,b){var c=b.audio,d=b.video;if(c&&c.encrypted&&(c=_.Np(c),!ED(a,c))||d&&d.encrypted&&(d=_.Np(d),!ED(a,d)))return!1;var e=a.keySystem();return 0===b.drmInfos.length||b.drmInfos.some(function(f){return f.keySystem===e})};HD=function(a,b,c){a.f!==b&&(a.f=b,a.a.push({timestamp:Date.now()/1E3,id:b.id,trackId:b.track.id,type:b.track.type,fromAdaptation:c,width:null,height:null,bandwidth:b.bandwidth}))};
|
|
12
|
+
ID=function(a,b){if(null==a.a)return null;var c=a.a[a.a.length-1];return c?c[b]:null};JD=function(a){a=ID(a,_.Jw);return null==a?null:a};KD=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.cc()+d.getDuration();)c+=1,d=a.a[c]||null;a.f=d?c:a.a.length-1}else a.f=-1};_.LD=function(a,b){return a.concat(b)};MD=function(){};
|
|
13
|
+
_.ND=function(a,b){if(0===b.length)return a;var c=b.map(function(d){return new _.ej(d)});return a.map(function(d){return new _.ej(d)}).map(function(d){return c.map(d.resolve.bind(d))}).reduce(_.LD,[]).map(function(d){return d.toString()})};_.OD=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:b||[],keyIds:[],periodId:c?c:null}};
|
|
14
|
+
_.PD=function(a,b,c,d,e,f,g){f=void 0===f?function(){return""}:f;this.La=a;this.la=b;this.ga=c;this.keyInfo=d||null;this.sd=_.L.R(e)?!1:!!e;this.ke=f?f:function(){return""};this.Ra=g};QD=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};RD=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):_.xg};
|
|
15
|
+
_.SD=function(a,b){for(var c=_.Dj(a),d=new Set,e=_.v(b),f=e.next();!f.done;f=e.next())d.add(_.Dj(f.value));e=_.v(d);for(f=e.next();!f.done;f=e.next())if(f=f.value,f===c)return f;e=_.v(d);for(f=e.next();!f.done;f=e.next())if(f=f.value,QD(f,c))return f;e=_.v(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=_.v(d);for(f=d.next();!f.done;f=d.next())if(e=f.value,QD(c,e))return e;return null};
|
|
16
|
+
TD=function(a,b){for(var c=0,d=_.v(a),e=d.next();!e.done;e=d.next())c+=b(e.value)?1:0;return c};UD=function(a,b){var c=_.ql(b,a);if(!c)return!1;c=c();var d=c.isMuxed(a,b);c.destroy();return d};VD=function(a){for(var b=[a.mimeType],c=_.v(_.tw),d=c.next();!d.done;d=c.next()){var e=_.v(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,"")};
|
|
17
|
+
WD=function(a){return a.split(",").map(function(b){return b.trim()}).filter(function(b){return 0<b.length})};_.XD=function(a){var b=[];a=_.v(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(",")};YD=function(a,b){var c=_.XD(_.tl(a)),d=_.sl(a),e=_.XD(_.tl(b));return d===_.sl(b)&&c===e};
|
|
18
|
+
ZD=function(a,b){for(var c=new _.om(void 0,void 0===b?"total":b),d=_.v(a),e=d.next();!e.done;e=d.next())c.a.push(e.value);c.length=a.length;return c};_.$D=function(a,b,c,d,e,f){this.tagName=a;this.textContent=b;this.attributes=c;this.childNodes=d;this.localName=e;this.a=f};
|
|
19
|
+
aE=function(a){return-1===a.indexOf("\x26")?a:a.replace(/&(?:amp|lt|gt|quot|apos|nbsp|lrm|rlm|#[xX]?[0-9a-fA-F]+);/g,function(b){switch(b){case "\x26amp;":return"\x26";case "\x26lt;":return"\x3c";case "\x26gt;":return"\x3e";case "\x26quot;":return'"';case "\x26apos;":return"'";case "\x26nbsp;":return"\u00a0";case "\x26lrm;":return"\u200e";case "\x26rlm;":return"\u200f";default:return"#"===b[1]?(b="x"===b[2]||"X"===b[2]?parseInt(b.slice(3),16):parseInt(b.slice(2),10),String.fromCodePoint(b)):b}})};
|
|
20
|
+
bE=function(a){function b(h,l){return new _.$D(void 0===l?_.da:l,h,{},[],null,g)}function c(h){h=void 0===h?"":h;for(var l=[];a[e];)if(60==a.charCodeAt(e)){if(47===a.charCodeAt(e+1)){var m=e+2;e=a.indexOf("\x3e",e);if(!a.startsWith(h,m))throw h=a.substring(0,e).split("\n"),Error("Unexpected close tag\nLine: "+(h.length-1)+"\nColumn: "+(h[h.length-1].length+1)+"\nChar: "+a[e]);e+1&&(e+=1);break}else if(63===a.charCodeAt(e+1)){e=a.indexOf("\x3e",e);e++;continue}else if(33===a.charCodeAt(e+1)){if(45==
|
|
21
21
|
a.charCodeAt(e+2)){for(;-1!==e&&(62!==a.charCodeAt(e)||45!=a.charCodeAt(e-1)||45!=a.charCodeAt(e-2)||-1==e);)e=a.indexOf("\x3e",e+1);-1===e&&(e=f)}else if(91===a.charCodeAt(e+2)&&91===a.charCodeAt(e+8)&&a.startsWith("CDATA",e+3)){m=a.indexOf("]]\x3e",e);-1==m?(l.push(b(a.substr(e+9),"#cdata")),e=f):(l.push(b(a.substring(e+9,m),"#cdata")),e=m+3);continue}else{m=e+1;e+=2;for(var n=!1;(62!==a.charCodeAt(e)||!0===n)&&a[e];)91===a.charCodeAt(e)?n=!0:!0===n&&93===a.charCodeAt(e)&&(n=!1),e++;l.push(b(a.substring(m,
|
|
22
|
-
e),"#doctype"))}e++;continue}e++;n=m=d();var p=m.indexOf(":");-1!==p&&(m.slice(0,p),n=m.slice(p+1));for(p={};62!==a.charCodeAt(e)&&a[e];){var q=a.charCodeAt(e);if(64<q&&91>q||96<q&&123>q){q=d();for(var t="",
|
|
23
|
-
null,p,q,n,g))}else m=e,e=a.indexOf("\x3c",e)-1,-2===e&&(e=f),m=
|
|
24
|
-
|
|
25
|
-
_.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
_.
|
|
30
|
-
_.
|
|
31
|
-
_.
|
|
32
|
-
_.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
e=Date.now()/1E3;if(a.a!==d||a.l!==c)a.j=e,a.a=d,a.l=c;d=e-a.j;d>=a.o&&c&&a.f(a.a,d)}}else if((0!==f||a.A)&&a.I&&(g=d.start(f),!(g>=
|
|
42
|
-
g),a.B=!0,a.a.currentTime=g)}}}};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
(new _.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return d}if(b>=l||c(b))return a.g.debug("Playhead in safe region or in buffered region."),b;a.g.debug("Playhead outside safe region \x26 in unbuffered region.");return d};
|
|
49
|
-
|
|
50
|
-
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};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
_.
|
|
54
|
-
_.
|
|
55
|
-
|
|
56
|
-
{},g=_.
|
|
57
|
-
_.
|
|
58
|
-
" from: "+JSON.stringify(c.from)+" to: "+JSON.stringify(c.to)),a.trigger(new _.K(_.Id,{detail:c})),a.w.set(b,e)));return new _.
|
|
59
|
-
|
|
60
|
-
if(g=parseInt(f.headers["retry-after"],10))a.g.info("Will retry after "+g+" s based on Retry-After header."),a.f=g;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
(b=new URL(b.uri),b.hostname=a.Xb[
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
QF=function(a
|
|
22
|
+
e),"#doctype"))}e++;continue}e++;n=m=d();var p=m.indexOf(":");-1!==p&&(m.slice(0,p),n=m.slice(p+1));for(p={};62!==a.charCodeAt(e)&&a[e];){var q=a.charCodeAt(e);if(64<q&&91>q||96<q&&123>q){q=d();for(var t="",u=a.charCodeAt(e);39!==u&&34!==u;)e++,u=a.charCodeAt(e);if(39===u||34===u){if(t=e+1,e=a.indexOf(a[e],t),t=a.slice(t,e),-1===e)throw Error("Missing closing quote");}else e--;p[q]=t;q=q.split(":");"xmlns"===q[0]&&q[1]&&g.set(t,q[1])}e++}q=[];t=a.charCodeAt(e-1);e++;47!==t&&(q=c(m));l.push(new _.$D(m,
|
|
23
|
+
null,p,q,n,g))}else m=e,e=a.indexOf("\x3c",e)-1,-2===e&&(e=f),m=aE(a.slice(m,e+1)).trim(),0<m.length&&l.push(b(m)),e++;return l}function d(){for(var h=e;-1==="\r\n\t\x3e/\x3d ".indexOf(a[e])&&a[e];)e++;return a.slice(h,e)}var e=0,f=a.length,g=new Map;return new _.$D("#document",null,{},c(""),null,g)};_.cE=function(){};
|
|
24
|
+
dE=function(a){switch(a){case _.vm:_.Iw.info("Select DOM parser for XML");_.Wo=new _.Jo;break;case "txml":_.Iw.info("Select TXML parser for XML");_.Wo=new _.cE;break;default:_.Iw.warn("XML parser option unknown, using default DOM parser. Option: "+a),_.Wo=new _.Jo}};eE=function(){return!!window.SourceBuffer&&!!SourceBuffer.prototype&&!!SourceBuffer.prototype.changeType};fE=function(a,b){return a.start-b.start};
|
|
25
|
+
_.gE=function(a){this.h=void 0===a?null:a;this.log=new _.J("clpp.renditions");this.U=[];this.f=this.player=null;this.a=!1};hE=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}})};iE=function(a){a.player&&(a.player.off(_.Of,a.ld),a.a&&a.player.off(_.sg,a.ld));a.player=null};jE=function(a){a.player&&a.player.trigger(new _.K(_.Vc))};
|
|
26
|
+
kE=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(_.sg,a.ld,a),a.a=!0):!b&&a.a&&(a.log.debug("Stop tracking timeupdates"),a.player.off(_.sg,a.ld),a.a=!1)}};lE=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 _.K(_.Ng))};
|
|
27
|
+
mE=function(a,b){for(var c=null,d=_.v(a),e=d.next();!e.done;e=d.next())e=e.value,b>=e.startTime&&(c=e);return c};nE=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};oE=function(a,b){for(var c=0;c<a.length;c++)if(nE(a[c]).has(b))return c;return-1};
|
|
28
|
+
qE=function(a,b){Array.from(nE(a)).forEach(function(c){c.segmentIndex&&_.pE(c.segmentIndex,b)})};_.rE=function(a){this.h=Math.exp(Math.log(.5)/a);this.f=this.a=0};_.sE=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)};_.tE=function(a){return a.a/(1-Math.pow(a.h,a.f))};
|
|
29
|
+
_.uE=function(a,b,c,d,e,f,g,h){a=_.ik(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};vE=function(a){this.a=this.h=0;this.f=a};_.wE=function(a,b,c){a.h=b;a.a=c};
|
|
30
|
+
_.xE=function(a,b,c,d,e,f){f=void 0===f?!1:f;this.j=a;this.G=b;this.K=c;this.A=this.f=Infinity;this.h=1;this.H=0;this.o=this.w=null;this.I=0;this.F=this.l=d;this.N=void 0===e?!0:e;this.g=new _.J("clpp.media.PresentationTimeline");this.P=f;this.L=null;this.a=new vE(d);this.J=null;this.B=this.j.type||null};_.zE=function(a,b){a.L={offsetDateTime:b-yE(a),seekRangeStartDateTime:b}};_.AE=function(a,b){a.l=b;a.F=b;a.a.f=b};BE=function(a){return 2===a.j.version?a.a.f?a.a.a:null:a.l?a.f:a.F?a.o:null};
|
|
31
|
+
_.EE=function(a,b,c){if(0!==b.length){var d=b[b.length-1].endTime+c;_.CE(a,b[0].startTime+c);a.h=b.reduce(function(e,f){return Math.max(e,f.endTime-f.startTime)},a.h);_.DE(a,d);null!=a.G&&a.N&&(a.G=(Date.now()+a.I)/1E3-(a.o||0)-a.h);a.g.debug("notifySegments: maxSegmentDuration\x3d"+a.h)}};_.CE=function(a,b){a.w=null==a.w?b:Math.min(a.w,b)};_.DE=function(a,b){a.o=Math.max(a.o||0,b)};_.FE=function(a,b){a.h=Math.max(a.h,b);a.g.debug("notifyNewSegmentDuration: maxSegmentDuration\x3d"+a.h)};
|
|
32
|
+
_.HE=function(a){return 2===a.j.version?a.a.cc():Infinity===a.A?0:Math.max(0,GE(a)-a.A)};GE=function(a){if(2===a.j.version)a=a.a.a;else if(a.l)a=a.f;else if(a.F)a=a.o||0;else{if("startover"===a.B)var b=a.J||0;else b=(Date.now()+a.I)/1E3,b=a.P?Math.max(0,b-(a.h-a.H)-a.G):Math.max(0,b-a.h-a.G);a=Math.min(b,a.f)}return a};JE=function(a,b){if(2===a.j.version)return a.a.cc();var c=Math.max(a.w,0);return Infinity===a.A?Math.ceil(1E3*c)/1E3:Math.max(c,Math.min(GE(a)-a.A+b,IE(a)))};
|
|
33
|
+
yE=function(a){return 2===a.j.version?a.a.cc():JE(a,0)};IE=function(a){var b=a.se()&&!a.F?a.K:0;return 2===a.j.version?a.a.a-b:Math.max(0,GE(a)-b)};KE=function(a,b){var c=(void 0===b?0:b)?a.offset:0;return{schemeIdUri:a.schemeIdUri,configurationId:a.configurationId,value:a.value,startTime:a.startTime+c,endTime:a.endTime+c,id:a.id,eventElement:a.eventElement,type:a.type,customAttributes:a.customAttributes}};LE=function(){this.f=function(){};this.h=function(){};this.a=new Set};
|
|
34
|
+
ME=function(a,b,c){a.f=b;a.h=c};NE=function(a,b){for(var c=[],d=!1,e={},f=_.v(b),g=f.next();!g.done;e={Xc:e.Xc},g=f.next())e.Xc=g.value,a.a.has(e.Xc)||(c.push(e.Xc),g=Array.from(a.a.values()).some(function(h){return function(l){return l.id===h.Xc.id}}(e)),e.Xc.id&&g&&(d=!0));e=a.a.size;a.a.clear();b.forEach(function(h){return a.a.add(h)});f=a.a.size;c.forEach(function(h){return a.f(h)});(d||0<c.length||e!==f)&&a.h()};
|
|
35
|
+
OE=function(a,b){b=void 0===b?!1:b;return Array.from(a.a.values()).map(function(c){return KE(c,b)}).sort(function(c,d){return c.startTime-d.startTime})};PE=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 _.bv("crop",a,d.endTime?d.endTime-a:Infinity,!1))};QE=function(a){var b=a.a.ci(),c=a.h,d=b?b.id:null;(c?c.id:null)!==d&&b&&a.f(new _.K(_.Rf,{id:d}));a.h=b;"basic"===a.o.timeline&&(a.j.a=b)};
|
|
36
|
+
RE=function(a,b,c){this.h=a;this.a=b;this.f=c;this.g=new _.J("clpp.media.SegmentIterator")};SE=function(a){var b=a.h.get(a.a);if(!b)return null;0<b.a.length&&b.La().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};_.TE=function(a){this.a=a;this.g=new _.J("clpp.media.SegmentIndex")};_.UE=function(a){return a.a.length?a.a[a.a.length-1].endTime:0};_.VE=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};
|
|
37
|
+
WE=function(a,b){var c=a.nd(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 RE(a,c,e)};_.pE=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)};
|
|
38
|
+
YE=function(a,b){this.h=a;this.l=XE(a);this.a=a.a.currentTime;this.j=Date.now()/1E3;this.o=b;this.f=function(){}};ZE=function(a,b){a.f=b};$E=function(a){this.a=a};XE=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};
|
|
39
|
+
bF=function(a,b,c,d,e){var f=this;this.a=a;this.H=b;this.h=c;this.G=e;this.j=new _.hi;this.F=!1;this.J=a.readyState;this.l=!1;this.f=d;this.B=this.o=this.I=this.A=!1;this.j.on(a,_.Sg,function(){return aF(f)});this.w=(new _.Yh(function(){aF(f)})).Jb(.25)};
|
|
40
|
+
aF=function(a){if(0!==a.a.readyState){if(a.a.seeking){if(!a.F)return}else a.F=!1;if(!a.a.paused&&!a.o){a.a.readyState!==a.J&&(a.l=!1,a.J=a.a.readyState);var b=a.h.smallGapLimit,c=a.a.currentTime,d=a.a.buffered,e=a.h.gapTolerance;a:{var f=new _.om(d);var g=a.h.gapDetectionThreshold;g=void 0===g?0:g;if(f.length&&!(1===f.length&&1E-6>f.end(0)-f.start(0)))for(var h=0;h<f.length;h++)if(f.start(h)>c&&(0===h||f.end(h-1)-c<=g)){f=h;break a}f=null}if(null==f){if(a.f){a=a.f;d=a.h;c=XE(d);d=d.a.currentTime;
|
|
41
|
+
e=Date.now()/1E3;if(a.a!==d||a.l!==c)a.j=e,a.a=d,a.l=c;d=e-a.j;d>=a.o&&c&&a.f(a.a,d)}}else if((0!==f||a.A)&&a.I&&(g=d.start(f),!(g>=IE(a.H)))){h=g-c;b=h<=b;var l=!1;h<e||(b||a.l||(a.l=!0,e=new _.K("largegap",{detail:{currentTime:c,gapSize:h}}),e.cancelable=!0,a.G(e),a.h.jumpLargeGaps&&!e.defaultPrevented?l=!0:_.Oh("Ignoring large gap at",c,"size",h)),!b&&!l)||(0===f?_.Oh(UC,h,"seconds because of gap before start time of",g):_.Oh(UC,h,"seconds because of gap starting at",d.end(f-1),"and ending at",
|
|
42
|
+
g),a.B=!0,a.a.currentTime=g)}}}};cF=function(a){var b=this;this.f=a;this.o=10;this.l=this.h=this.j=0;this.a=new _.Yh(function(){0>=b.j?(_.Kh(["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--)})};dF=function(a,b){a.h=a.f.currentTime;a.l=b;a.j=a.o;a.f.currentTime=b;a.a.Jb(.1)};gF=function(a,b,c,d){this.a=a;this.j=b;this.o=d;this.A=c;this.l=!1;this.f=new _.hi;this.h=new cF(a);this.w=!1;0<a.readyState?eF(this,c):fF(this,c)};
|
|
43
|
+
hF=function(a){return a.l?a.a.currentTime:a.A};iF=function(a,b){0<a.a.readyState?dF(a.h,b):fF(a,b)};fF=function(a,b){a.A=b;a.f.off(a.a,_.Ee);a.f.one(a.a,_.Ee,function(){eF(a,b)})};eF=function(a,b){a.w||(a.w=!0,a.o&&a.o());.001>Math.abs(a.a.currentTime-b)?jF(a):(a.f.one(a.a,_.Vf,function(){jF(a)}),dF(a.h,0===a.a.currentTime?b:a.a.currentTime))};jF=function(a){_.yl()&&!a.l&&a.j();a.l=!0;a.f.on(a.a,_.Vf,function(){return a.j()})};
|
|
44
|
+
nF=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 bF(a,b.presentationTimeline,c,kF(this,a,c),f);this.f=new gF(a,function(){a:{var l=h.j;var m=l.B;l.B=!1;l.F=!0;l.A=!1;l.l=!1;l=hF(h.f);var n=lF(h,l);if(Math.abs(n-l)>h.l.gapTolerance){var p=(new Date).getTime()/1E3;if(!h.w||h.w<p-1){h.w=p;iF(h.f,n);m=void 0;break a}}h.g.debug("Seek to "+l);h.A(m?1:0);m=void 0}return m},mF(this,d,g),function(){h.j.I=!0});this.o=
|
|
45
|
+
(new _.Yh(function(){if(0!==h.h.readyState&&!h.h.paused){var l=hF(h.f),m=yE(h.a),n=IE(h.a);3>n-m&&(m=n-3);l<m&&(m=lF(h,l),h.g.info("Jumping forward "+(m-l)+" seconds to catch up with the seek range."),h.h.currentTime=m)}})).Jb(.25);this.g=new _.J("clpp.mse.Playhead")};pF=function(a){var b=hF(a.f);return 0<a.h.readyState&&!a.h.paused?oF(a,b):b};mF=function(a,b,c){null==b?b=Infinity>a.a.getDuration()||c?yE(a.a):IE(a.a):0>b&&(b=IE(a.a)+b);return qF(a,oF(a,b))};
|
|
46
|
+
qF=function(a,b){var c=a.a.getDuration();return b>=c?c-a.l.durationBackoff:b};
|
|
47
|
+
lF=function(a,b){if("startover"===a.a.B)return b;var c=new _.om(a.h.buffered);c=c.Mc.bind(c);var d=Math.max(a.B,a.l.rebufferingGoal),e=a.l.safeSeekOffset,f=yE(a.a),g=IE(a.a),h=a.a.getDuration();3>g-f&&(f=g-3);var l=JE(a.a,d),m=JE(a.a,e);d=JE(a.a,d+e);if(b>=h)return a.g.debug("Playhead past duration."),qF(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");
|
|
48
|
+
return d}if(b>=l||c(b))return a.g.debug("Playhead in safe region or in buffered region."),b;a.g.debug("Playhead outside safe region \x26 in unbuffered region.");return d};oF=function(a,b){var c=yE(a.a);if(b<c)return c;c=IE(a.a);return b>c?c:b};
|
|
49
|
+
kF=function(a,b,c){if(!c.stallEnabled)return null;var d=c.gapDetectionThreshold,e=c.stallSkip;c=new YE(new $E(b),c.stallThreshold);ZE(c,function(f,g){a.g.warn("Stall detected at "+f+" for "+g+" seconds.");if(e){var h=new _.om(b.buffered),l;if(l=_.wl("Edge/")||_.wl("Trident/")||_.wk()||_.yl())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=
|
|
50
|
+
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};sF=function(a){var b=this;this.f=a;this.a=new Set;this.h=(new _.Yh(function(){rF(b,!1)})).Jb(.25)};rF=function(a,b,c){c=void 0===c?0:c;for(var d=_.v(a.a),e=d.next();!e.done;e=d.next())e.value.l(a.f.currentTime,b,c)};
|
|
51
|
+
tF=function(a,b){var c=a.offset||0;return b<a.startTime+c?1:b>a.endTime+c?3:2};
|
|
52
|
+
uF=function(a){var b=this;this.j=a;this.o=new Map;this.a=function(){};this.f=function(){};this.h=function(){};this.w=[{Vc:null,Uc:2,Kc:function(c,d){return b.a(c,d)}},{Vc:1,Uc:2,Kc:function(c,d){return b.a(c,d)}},{Vc:3,Uc:2,Kc:function(c,d){return b.a(c,d)}},{Vc:2,Uc:1,Kc:function(c,d){return b.f(c,d)}},{Vc:2,Uc:3,Kc:function(c,d){return b.f(c,d)}},{Vc:1,Uc:3,Kc:function(c,d){return b.h(c,d)}},{Vc:3,Uc:1,Kc:function(c,d){return b.h(c,d)}}]};vF=function(a,b,c,d){a.a=b;a.f=c;a.h=d};
|
|
53
|
+
_.wF=function(a){_.hv[a]&&delete _.hv[a]};_.xF=function(a){_.fv[a]&&delete _.fv[a]};yF=function(){this.f=new _.rE(2);this.h=new _.rE(5);this.a=0};_.zF=function(a,b,c){if(!(16E3>c)){var d=8E3*c/b;b/=1E3;a.a+=c;_.sE(a.f,b,d);_.sE(a.h,b,d)}};AF=function(a,b){if(typeof a!==typeof b||a.length!==b.length)return!1;for(var c=0;c<a.length;c++)if(a[c].serviceLocationId!==b[c].serviceLocationId||a[c].uri!==b[c].uri||a[c].params!==b[c].params)return!1;return!0};_.BF=function(a,b){this.id=a;this.ma=b};
|
|
54
|
+
_.CF=function(a,b){return a.ma.map(function(c){var d=new URL(c.uri+b);if(c.params){c=_.v(Object.entries(c.params));for(var e=c.next();!e.done;e=c.next()){var f=_.v(e.value);e=f.next().value;f=f.next().value;d.searchParams.set(e,f)}}return d.toString()})};DF=function(a,b){_.pm.call(this);this.A=a;this.h=null;this.B=b;this.F=new _.tk;this.f=300;this.o=new Map;this.l=new Map;this.w=new Map;this.j=new Map;this.a=null;this.g=new _.J("clpp.net.ContentSteeringManager")};
|
|
55
|
+
FF=function(a,b){return _.H(function(c){null!=a.a&&(a.a.stop(),a.a=null);a.o.clear();a.l.clear();a.j.clear();a.w.clear();a.g.debug("contentSteeringServerUri: "+b.contentSteeringServerUri);a.g.info("queryBeforeStart: "+b.queryBeforeStart);a.h={manifestType:b.manifestType,contentSteeringServerUri:b.contentSteeringServerUri,queryBeforeStart:b.queryBeforeStart,Ph:b.defaultServiceLocation?b.defaultServiceLocation.split(","):[]};b.baseUriCollections.forEach(function(d){var e=[];if(a.h.Ph.length)for(var f=
|
|
56
|
+
{},g=_.v(a.h.Ph),h=g.next();!h.done;f={Te:f.Te},h=g.next())f.Te=h.value,(h=d.ma.find(function(l){return function(m){return m.serviceLocationId===l.Te}}(f)))?e.push(h):a.g.warn("setManifestConfig: could not get default location:","pathwayId: "+f.Te+" processedLocations:",e);e.length?a.l.set(d.id,e):a.l.set(d.id,d.ma);a.o.set(d.id,d.ma)});if(b.contentSteeringServerUri){if(a.h.queryBeforeStart)return c["return"](EF(a));a.g.info("defaultServiceLocations: "+b.defaultServiceLocation);EF(a)}_.z(c)})};
|
|
57
|
+
_.HF=function(a,b){var c=a.l.get(b);if(!c)return a.g.warn("getBaseUriCollectionById: invalid baseUriSetId:"+b+"."),null;var d=Date.now();a.j.forEach(function(f,g){f.Rd&&d>f.Rd&&(f.Rd=0,a.trigger(new _.K(_.Jd,{detail:{serviceLocationId:g,banned:!1,bannedSeconds:0}})))});var e=c.filter(function(f){return 0===_.GF(a,f.serviceLocationId).Rd});e.length||(e=c);e.length&&(c=a.w.get(b),AF(e,c)||(c={baseUriCollectionId:b,from:c||[],to:e},a.g.info("Steering server update baseUriCollectionId: "+c.baseUriCollectionId+
|
|
58
|
+
" from: "+JSON.stringify(c.from)+" to: "+JSON.stringify(c.to)),a.trigger(new _.K(_.Id,{detail:c})),a.w.set(b,e)));return new _.BF(b,e)};_.IF=function(a,b){var c=_.GF(a,b);c.Rd=Date.now()+1E3*a.f;c.De=!1;a.g.info("service location "+b+" banned during "+a.f+LC);a.trigger(new _.K(_.Jd,{detail:{serviceLocationId:b,banned:!0,bannedSeconds:a.f}}))};_.GF=function(a,b){var c=a.j.get(b);c||(c={Rd:0,Yf:new yF,De:!1},a.j.set(b,c));return c};
|
|
59
|
+
EF=function(a,b){var c,d,e,f,g,h,l;return _.H(function(m){if(1==m.a)return b=b||a.h.contentSteeringServerUri,c=JF(a,b),a.g.info("Sending request to content steering server, URI: "+c),d=_.ik(c,a.A.attemptParameters),d.type=7,e=a.B.fetch(d),_.uk(a.F,e),_.x(m,e.T,2);f=m.f;if(410===f.status)a.g.info(" Content steering server not available(HTTP response 410), stopping updates."),null!=a.a&&(a.a.stop(),a.a=null);else if(429===f.status){a.g.info("Content steering server overloaded (HTTP response 429).");
|
|
60
|
+
if(g=parseInt(f.headers["retry-after"],10))a.g.info("Will retry after "+g+" s based on Retry-After header."),a.f=g;KF(a,a.f)}else try{h=_.Q.ea(f.data),l=JSON.parse(h),1===l.VERSION?LF(a,l,f.uri):a.g.warn("Received unsupported steering manifest version: "+l.VERSION+", ignoring it and stop requesting.")}catch(n){a.g.error("requestInfo_: error parsing received steering manifest:",n);if(n&&7001===n.code)return m["return"]();null!=a.a&&(a.a.stop(),a.a=null);a.a=new _.Yh(function(){EF(a)});KF(a,a.f)}_.z(m)})};
|
|
61
|
+
JF=function(a,b){var c=new URL(b),d=[],e=[];a.j.forEach(function(f,g){f.De&&(d.push(g),e.push(parseInt(f.Yf.getBandwidthEstimate(1E4),10)));f.De=!1});d.length?a.h.manifestType===_.Ic?(c.searchParams.set("_DASH_pathway",'"'+d.toString()+'"'),c.searchParams.set("_DASH_throughput",e.toString())):a.h.manifestType===_.bm&&(c.searchParams.set("_HLS_pathway",'"'+d.toString()+'"'),c.searchParams.set("_HLS_throughput",e.toString())):a.g.debug("addQueryParams_: serviceLocations EMPTY");return c.toString()};
|
|
62
|
+
MF=function(a,b,c,d){var e=[],f=a.o.get(b)||[];if(!c.length)return a.l.get(b);a={};c=_.v(c);for(b=c.next();!b.done;a={Od:a.Od,Xb:a.Xb,Jd:a.Jd},b=c.next())if(a.Od=b.value,b=f.find(function(g){return function(h){return h.serviceLocationId===g.Od}}(a)))e.push(b);else if(a.Xb=d.find(function(g){return function(h){return h.ID===g.Od}}(a)),a.Xb&&(b=f.find(function(g){return function(h){return h.serviceLocationId===g.Xb["BASE-ID"]}}(a))))a.Jd={serviceLocationId:a.Od,uri:b.uri,params:{}},a.Xb[aD]&&(a.Xb[aD].HOST&&
|
|
63
|
+
(b=new URL(b.uri),b.hostname=a.Xb[aD].HOST,a.Jd.uri=b.toString()),a.Xb[aD].PARAMS&&Object.entries(a.Xb[aD].PARAMS).forEach(function(g){return function(h){var l=_.v(h);h=l.next().value;l=l.next().value;g.Jd.params[h]=l}}(a))),e.push(a.Jd);return e};KF=function(a,b){a.g.info("Scheduling next steering manifest update in "+b+" s.");a.a.ha(b)};
|
|
64
|
+
LF=function(a,b,c){null!=a.a&&(a.a.stop(),a.a=null);var d=b["RELOAD-URI"]||c;a.a=new _.Yh(function(){EF(a,d)});if(c=b.TTL)a.f=c;KF(a,a.f);var e=b["PATHWAY-PRIORITY"]||[],f=b["PATHWAY-CLONES"]||[];a.j.forEach(function(g,h){e.includes(h)||a.j["delete"](h)});a.o.forEach(function(g,h){var l=MF(a,h,e,f);a.l.set(h,l)})};
|
|
65
|
+
NF=function(a){function b(u){return 100*c(u/100)}function c(u){return Math.round(u)}for(var d={br:c,d:c,bl:b,dl:b,mtp:b,nor:function(u){return encodeURIComponent(u)},rtp:b,tb:c,Gp:c,Hp:c},e=["nor","nrr","sid","cid"],f=["ot","sf","st"],g={},h=_.v(Object.entries({Object:["br","d","ot","tb"],Request:"bl dl mtp nor nrr su".split(" "),Session:"cid pr sf sid st v".split(" "),Status:["bs","rtp"]})),l=h.next();!l.done;l=h.next()){var m=_.v(l.value);l=m.next().value;var n=m.next().value;m=[];n=_.v(n);for(var p=
|
|
66
|
+
n.next();!p.done;p=n.next()){p=p.value;var q=a[p];if(void 0!==q&&null!==q){var t=d[p];t&&(q=t(q));t=p+"\x3d"+q;f.includes(p)?t=p+"\x3d"+q:e.includes(p)?t=p+'\x3d"'+q+'"':typeof q===_.Zc&&(t=q?""+p:"");t&&m.push(t)}}0<m.length&&(g["CMCD-"+l]=m.join(","))}return g};PF=function(a,b,c){this.h=a;this.a=b;b.version||(this.a.version=1);b.rtpSafetyFactor||(this.a.rtpSafetyFactor=5);this.j=OF(this);this.h.f.push(this.j);this.l=c;this.f=!1};
|
|
67
|
+
OF=function(a){return function(b,c){if(!a.a||!a.a.enabled||!c)return Promise.resolve(b);var d=a.l;var e=d.getBandwidthEstimate,f=d.getBufferInfo,g=d.getLoadedSource,h=d.getMediaPosition,l=d.getPlaybackRate,m=d.getPlayerState,n=d.wd;d=c.stream;var p=c.segment,q=c.objectType,t=c.nextSegment,u=c.streamType;l=l();m=m();var y=l||1;e=e();g=(g=g())?QF(g):void 0;f=f().Ta(h());h=!1;!a.f||"v"!==q&&"av"!==q||(h=!0,a.f=!1);n=RF(q,n);if(p&&t&&p!==t){var A=p.La()[0],B=t.La()[0];var E=new URL(B);A=new URL(A);if(E.origin!==
|
|
68
|
+
A.origin)E=B;else{B=E.pathname.split("/").slice(1);for(A=A.pathname.split("/").slice(1,-1);B[0]===A[0];)B.shift(),A.shift();for(;A.length;)A.shift(),B.unshift("..");E=B.join("/")+E.search+E.hash}}else E=void 0;p&&t&&(t.la||t.ga)&&(p.la!==t.la||p.ga!==t.ga)?(B=t.la+"-",t.ga&&(B+=t.ga),t=B):t=void 0;a:{if(p&&d&&(B=d.bandwidth)){B=B*(p.endTime-p.startTime)/1E3/((f||500)/(y||1)/1E3);B=a.a.rtpSafetyFactor?B*a.a.rtpSafetyFactor:B;break a}B=void 0}d=Object.assign({},d&&{br:d.bandwidth},p&&{d:p.endTime-p.startTime},
|
|
69
|
+
{ot:q},n&&{tb:n},{bl:f,dl:f/y},e&&{mtp:e/1E3},E&&{nor:E},t&&{nrr:t},{su:m===_.Bq},1!==l&&{pr:l},g&&{sf:g},{sid:a.a.sessionId,st:u},1!==a.a.version&&{v:a.a.version},{bs:h},B&&{rtp:B});d=NF(d);b.headers=Object.assign({},b.headers||{},d);return Promise.resolve(b)}};RF=function(a,b){var c=b();if(0!==c.length)switch(c=c.reduce(function(d,e){return d&&d.bandwidth>e.bandwidth?d:e}),a){case "a":return c.audioBandwidth||void 0;case "v":return c.videoBandwidth||void 0;default:return c.bandwidth}};
|
|
70
|
+
QF=function(a){switch(a.type){case _.Ic:return"d";case _.bm:return"h";case _.Nc:return"s";default:return"o"}};SF=function(a,b){this.w=null;this.F=a;this.h=b;this.j=this.A=0;this.l=Infinity;this.f=this.a=null;this.B="";this.o=new Map};
|
|
71
|
+
TF=function(a,b,c,d){return Promise.resolve().then(function(){if(a.w&&a.h)if(null==c||null==d)a.w.parseInit(_.Oj(b));else{var e={periodStart:a.A,segmentStart:c,segmentEnd:d};e=a.w.parseMedia(_.Oj(b),e);var f=e.cues.filter(function(g){return g.startTime>=a.j&&g.startTime<a.l});a.h.append(f,e.styles);null==a.a&&(a.a=Math.max(c,a.j));a.f=Math.min(d,a.l)}})};
|
|
72
|
+
UF=function(a,b,c){a.B=b;if(b=a.o.get(b))for(var d=_.v(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.h.append(e,[])};
|
|
73
|
+
VF=function(a,b,c,d,e){var f=c+" "+d,g=new Map;b=_.v(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.j&&l.startTime<a.l&&(l=new _.Ti(l.startTime,l.endTime,l.text),g.get(h).get(f).push(l),h===a.B&&a.h.append([l],[]))}e=_.v(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=_.v(g.get(f).keys()),h=b.next();!h.done;h=b.next())h=h.value,l=
|
|
74
|
+
g.get(f).get(h),a.o.get(f).set(h,l);a.a=null==a.a?Math.max(c,a.j):Math.min(a.a,Math.max(c,a.j));a.f=Math.max(a.f,Math.min(d,a.l))};_.WF=function(a){a=a.toLowerCase();return _.Cv[a]||window.muxjs&&a===_.Hc?!0:!1};
|
|
75
|
+
XF=function(a,b){var c=String(_.Qk++);c=new _.Lk(c,a);c.mimeType=_.Mk(b.mimeType);if(a===_.S||a===_.T)c.label=_.Mk(b.label),c.language=_.Mk(b.language),c.originalLanguage=_.Mk(b.originalLanguage);a===_.Nk?(c.frameRate=b.frameRate,c.roles=b.roles,c.trickPlay=b.trickPlay):a===_.T?(c.channelsCount=b.channelsCount,c.roles=b.audioRoles||[],c.mimeType=_.Mk(b.audioMimeType)):(c.kind=_.Mk(b.kind),c.roles=b.roles);c.accessibility=a===_.Nk||a===_.T?(b.accessibility||[]).filter(function(d){return d.type===a}):
|
|
71
76
|
b.accessibility||[];return c};
|
|
72
|
-
|
|
73
|
-
return a||d};
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
d=
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
l.audioId})})||null}}else f=
|
|
83
|
-
|
|
84
|
-
_.
|
|
85
|
-
|
|
86
|
-
_.T);
|
|
87
|
-
|
|
88
|
-
b.push(e),c.active&&a.a.set(_.T,e.renditions[0])};
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
c.video.buffer))),l=Promise.all(f)):(f&&window.muxjs&&(a.f||
|
|
97
|
-
null!==d&&null!==e&&h){var q=m.buffered.length,t=0<q?m.buffered.end(q-1):-1;0>n&&0<q&&(n=m.buffered.start(0));0<=n&&0<t&&a.
|
|
98
|
-
Promise.all([q,t])}null!==d&&null!==e&&(a.G[b]=!0)})["catch"](function(q){throw q;})};
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
m);_.
|
|
103
|
-
|
|
104
|
-
b.length;c={
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
(_.
|
|
111
|
-
!n.audio?(_.
|
|
112
|
-
|
|
77
|
+
YF=function(a,b,c){var d=new _.Tk(a===_.Nk?""+b.videoId:a===_.T?""+b.audioId:""+b.id,c);switch(a){case _.Nk:d.codec=_.Mk(b.videoCodec);d.bandwidth=b.videoBandwidth||b.bandwidth;d.width=b.width;d.height=b.height;d.originalId=b.originalVideoId;break;case _.T:d.codec=_.Mk(b.audioCodec);d.bandwidth=b.audioBandwidth||b.bandwidth;d.originalId=b.originalAudioId;break;default:d.codec=_.Mk(b.codecs),d.originalId=b.originalTextId}(a=c.renditions.find(function(e){return _.L.ra(e,d,null,["id","track"])}))||c.renditions.push(d);
|
|
78
|
+
return a||d};ZF=function(a,b){var c=a.reduce(function(d,e){b===_.Nk?null===e.videoId||d[e.videoId]&&!e.activeVideo||(d[e.videoId]=e):b===_.T&&(null===e.audioId||d[e.audioId]&&!e.activeAudio||(d[e.audioId]=e));return d},{});return Object.values(c)};$F=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};
|
|
79
|
+
aG=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};_.bG=function(a,b){a.forEach(function(c){c.startTime+=b;c.endTime+=b})};cG=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}};dG=function(a){return Object.assign({},a,{periods:a.periods.map(function(b){return Object.assign({},b)})})};
|
|
80
|
+
eG=function(a,b){if(0===a.length)throw Error("Cannot concatenate 0 manifests");if(1===a.length)return a[0];a[0].cues.forEach(function(f){f.offset=0});for(var c=_.hh(a[0].periods).concat(),d={},e=1;e<a.length;d={Ve:d.Ve},e++)d.Ve=cG(a[e-1]).end,_.bG(a[e].periods,d.Ve),c.push.apply(c,_.hh(a[e].periods)),a[e].cues.forEach(function(f){return function(g){g.offset=f.Ve}}(d));d=a.flatMap(function(f){return f.cues});c={periods:c,presentationTimeline:b,minBufferTime:0,cues:d,alternativeVariants:a[0].alternativeVariants};
|
|
81
|
+
d=cG(c).end;_.wE(b.a,0,d);(d=a[0].presentationTimeline.Ic())&&_.zE(b,d.seekRangeStartDateTime);return c};gG=function(a,b){try{if(1===a.length)return a[0];if(!a.every(fG))throw new _.$i("Period durations must be finite");return eG(a,b)}catch(c){throw new _.N(_.O,7,7003,"Failed to join manifests into a continuous playlist!",c);}};
|
|
82
|
+
hG=function(a,b){var c=b.periods[0].configurationId,d=_.hh(a.periods).concat().filter(function(f){return f.configurationId!==c}),e=a.presentationTimeline;d={periods:d,presentationTimeline:e,minBufferTime:0};_.AE(e,b.presentationTimeline.l);return gG([d,b],e)};fG=function(a){return a.periods.every(function(b){return null!=b.endTime&&0<=b.endTime&&isFinite(b.endTime)})};
|
|
83
|
+
iG=function(a){return{id:a.id,bandwidth:a.bandwidth,trickPlay:a.video?a.video.trickPlay:!1,width:a.video?a.video.width:void 0,height:a.video?a.video.height:void 0}};jG=function(a,b){return b.find(function(c){return c.id===a.id})||null};kG=function(){this.g=new _.J("clpp.mse.TrackManager");this.m=null;this.h=[];this.a=new Map;this.f=new Map};lG=function(a,b){return a.h.filter(function(c){return c.type===b})};mG=function(a,b){var c=a.a.get(b)||null;return c&&c.track};
|
|
84
|
+
nG=function(a,b,c){if(!c||mG(a,c.type)!==c||a.m.xa())switch(c=c?c.renditions[0]||null:null,b){case _.Nk:a.sb(c);break;case _.T:a.Gb(c);break;case _.S:a.Hb(c);break;default:throw Error("Unknown track type "+b);}};oG=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)};pG=function(a,b,c){return a.m.xa()?!0:(a.a.get(c)||null)===b?!1:!0};
|
|
85
|
+
qG=function(a,b,c){if(0>a.h.indexOf(b.track))throw Error("Unknown rendition with ID "+b.id);if(c!==b.track.type)throw Error("Types mismatch");};
|
|
86
|
+
sG=function(a,b,c){qG(a,b,_.Nk);if(pG(a,b,_.Nk)){var d=a.m;a.g.info("Set video rendition with ID: "+b.id);var e=a.a.get(_.T)||null,f=null;if(e&&!e.a){var g=d.wd().filter(function(l){return l.videoId===parseInt(b.id,10)});f=g.find(function(l){return l.audioId===parseInt(e.id,10)})||null;if(!f){a.g.debug("Unable to find exact variant. Searching for equivalent");var h=e.track.renditions.map(function(l){return l.id}).filter(function(l){return l!==e.id});f=g.find(function(l){return h.find(function(m){return m===
|
|
87
|
+
l.audioId})})||null}}else f=d.wd().find(function(l){return l.videoId===parseInt(b.id,10)})||null;f?(a.f.set(_.Nk,b),rG(d,f,c)):a.g.warn("Cannot find matching variant")}};
|
|
88
|
+
vG=function(a,b){var c,d,e;_.H(function(f){switch(f.a){case 1:c=_.S;qG(a,b,c);if(!pG(a,b,c))return f["return"]();d=a.m.oa().find(function(g){return g.id===parseInt(b.id,10)});if(!d)return a.g.warn("Text rendition with ID: "+b.id+" not found."),f["return"]();a.g.info("Set text rendition with ID: "+b.id);a.f.set(c,b);_.D(f,2);oG(a,b);return _.x(f,tG(a.m,!0),4);case 4:return _.x(f,uG(a.m,d),5);case 5:a.m.trigger(new _.K(_.ng));_.vh(f,0);break;case 2:e=_.F(f),a.g.warn("Failed to set text rendition",e),
|
|
89
|
+
_.z(f)}})};wG=function(a){var b,c,d;_.H(function(e){if(1==e.a){b=_.S;c=mG(a,b);if(!c)return e["return"]();a.g.info("Unset text rendition.");_.D(e,2);return _.x(e,tG(a.m,!1),4)}if(2!=e.a)return a.a.set(b,null),a.m.trigger(new _.K(_.ng)),_.vh(e,0);d=_.F(e);a.g.warn("Failed to unset text rendition",d);_.z(e)})};
|
|
90
|
+
AG=function(a){if(a.m){a.g.debug("Track list change detected, updating track list");for(var b=[],c=_.v(Object.values(_.sw)),d=c.next();!d.done;d=c.next())d=d.value,a.a.set(d,null),a.f.set(d,null);c={};d=_.v(a.m.oa());for(var e=d.next();!e.done;c={Ac:c.Ac},e=d.next()){e=e.value;c.Ac=XF(_.S,e);var f=b.find(function(h){return function(l){return h.Ac.ra(l)}}(c));c.Ac=f||c.Ac;var g=YF(_.S,e,c.Ac);e.activeText&&a.a.set(_.S,g);f||b.push(c.Ac)}xG(a.m)||a.a.set(_.S,null);c=a.m.wd();yG(a,b,c,_.Nk);yG(a,b,c,
|
|
91
|
+
_.T);zG(a,b);a.h=b}};yG=function(a,b,c,d){var e=ZF(c,d);c={};e=_.v(e);for(var f=e.next();!f.done;c={Bc:c.Bc},f=e.next()){f=f.value;c.Bc=XF(d,f);var g=b.find(function(l){return function(m){return l.Bc.ra(m)}}(c));c.Bc=g||c.Bc;var h=YF(d,f,c.Bc);(d===_.Nk&&f.activeVideo||d===_.T&&f.activeAudio)&&a.a.set(d,h);g||b.push(c.Bc)}};
|
|
92
|
+
zG=function(a,b){var c=a.m;if(c.f){var d=(d=BG(c))?CG(c.l,d).eb:null;c=c.f.muxedAudioTracks||[];if(d)for(var e=_.v(c),f=e.next();!f.done;f=e.next())f=f.value,f.active=d.id===f.id;d=c}else d=[];d=_.v(d);for(c=d.next();!c.done;c=d.next())c=c.value,e=String(_.Qk++),e=new _.Lk(e,_.T),e.mimeType="",e.label=c.label,e.language=c.language,e.originalLanguage=c.language,e.channelsCount=c.channelsCount,e.roles=[],e.accessibility=[],f=new _.Tk(""+c.id,e),f.codec="",f.bandwidth=0,f.originalId=c.label,f.a=!0,e.renditions.push(f),
|
|
93
|
+
b.push(e),c.active&&a.a.set(_.T,e.renditions[0])};EG=function(a,b,c,d){a.h.length||AG(a);var e=a.a.get(c)||null;(b=DG(a,b,c))&&e!==b&&(oG(a,b),c===_.T?a.m.trigger(new _.K(_.Wc)):c===_.Nk&&a.m.trigger(new _.K(_.Og,{details:{width:b.width||0,height:b.height||0,bandwidth:b.bandwidth,track:b.track,abrSelection:d}})))};DG=function(a,b,c){return lG(a,c).flatMap(function(d){return d.renditions}).find(function(d){return parseInt(d.id,10)===b})||null};
|
|
94
|
+
FG=function(){this.a=new muxjs.mp4.CaptionParser;this.l=[];this.j={}};_.GG=function(){};_.IG=function(a,b,c,d,e){this.j=a;this.B=c;this.a={};this.J={};this.N=!1;this.f=null;this.h={};this.l=new _.hi;this.K=!1;this.w={};this.H=b;this.F=d;this.I=e;this.S=this.I.streaming.maxSegmentToMediaOffset||1;this.L=new _.qk;this.A="";this.G={};this.o=HG(this,this.L);this.P=!0;this.g=new _.J("clpp.mse.MediaSourceEngine")};
|
|
95
|
+
JG=function(a){var b=_.rl(a.mimeType,a.codecs),c=VD(a);return _.WF(b)||_.Bu(c)||(_.ql(b,a.type)?!0:!1)};
|
|
96
|
+
HG=function(a,b){if(window.ManagedMediaSource){a.j.disableRemotePlayback=!0;var c=new ManagedMediaSource;a.l.one(c,"sourceopen",function(){URL.revokeObjectURL(a.A);b.resolve()});a.l.on(c,"startstreaming",function(){a.P=!0});a.l.on(c,"endstreaming",function(){a.P=!1});a.A=KG(c);a.j.src=a.A;return c}c=new MediaSource;a.A=KG(c);a.l.one(c,"sourceopen",function(){URL.revokeObjectURL(a.A);b.resolve()});a.j.src=a.A;return c};LG=function(a){a.g.debug("Reset transmuxers.");Object.values(a.w).forEach(function(b){return b.reset()})};
|
|
97
|
+
NG=function(a,b){var c,d,e,f,g,h,l,m,n;return _.H(function(p){1==p.a&&(c=_.v(b),d=c.next());if(5!=p.a){if(d.done)return p.D(0);e=d.value;f=_.v(e);g=f.next().value;h=f.next().value;l=g;m=a.a[l];return m?_.x(p,MG(a,l,m),5):(n=a.o.addSourceBuffer(h),a.l.on(n,_.ie,a.Ok.bind(a,l)),a.l.on(n,"updateend",a.Qc.bind(a,l)),a.a[l]=n,p.D(5))}a.J[l]=h;a.h[l]=[];a.G[l]=!1;d=c.next();return p.D(2)})};MG=function(a,b,c){return _.H(function(d){return _.x(d,OG(a,b,function(){c.remove(0,Infinity)}),0)})};
|
|
98
|
+
PG=function(a){return a.I.streaming.ignoreManagedMediaSourceStreamingHints?!0:a.P};QG=function(a,b){a.f||(a.f=new SF(a.I,a.B));var c=a.f;if(b!==_.Hc){var d=_.Cv[b];if(!d)throw new _.N(_.O,2,2012,"Text parser is unavailable for "+b);c.w=new d(c.F)}};RG=function(a){return a.o?a.o.readyState===_.he:!0};TG=function(a){var b={};b.total=new _.om(a.j.buffered,"total");b.audio=SG(a,_.Pc);b.video=SG(a,_.Jg);var c=[];a.f&&(c=[{start:a.f.Zb(),end:a.f.Sa()}]);b.text=ZD(c,_.qj);return b};
|
|
99
|
+
SG=function(a,b){try{return new _.om(a.a[b].buffered,b)}catch(c){return b in a.a&&a.g.error("failed to get buffered range for "+b,c),null}};UG=function(a,b){if(!a.a[b])return"";var c=SG(a,b);return c?c.toString():""};
|
|
100
|
+
VG=function(a,b,c,d,e,f,g,h,l){h=void 0===h?!1:h;l=void 0===l?!1:l;var m=a.a[b],n=-1,p=0;m&&m.buffered&&(p=m.buffered.length);b===_.Jg&&null!==d&&null!==e&&h&&(n=0<p?m.buffered.end(p-1):-1);b===_.qj?l=TF(a.f,c,d,e):a.w[b]?(c=a.w[b].transmux(c),c.captions&&0<c.captions.length&&(a.f||QG(a,_.lg),VF(a.f,c.captions,d,e,a.a.video.timestampOffset)),f=[],0<c.audio.byteLength&&a.a.audio&&!l&&f.push(OG(a,_.Pc,a.gg.bind(a,_.Pc,c.audio.buffer))),0<c.video.byteLength&&a.a.video&&f.push(OG(a,_.Jg,a.gg.bind(a,_.Jg,
|
|
101
|
+
c.video.buffer))),l=Promise.all(f)):(f&&window.muxjs&&(a.f||QG(a,_.lg),null==d&&null==e?a.H.init(c):a.H.h(c,function(q){q.length&&VF(a.f,q,d,e,a.a.video.timestampOffset)})),l=OG(a,b,a.gg.bind(a,b,c)));return l.then(function(){if(b===_.Jg&&null!==d&&null!==e&&!h)a.F.append(d,e,g),null!==d&&null!==e&&a.g.debug("Appended video segment ",d,e,"Buffer:",UG(a,b));else if(b===_.Pc&&null!==d&&null!==e)jE(a.F),null!==d&&null!==e&&a.g.debug("Appended audio segment ",d,e,"Buffer:",UG(a,b));else if(b===_.Jg&&
|
|
102
|
+
null!==d&&null!==e&&h){var q=m.buffered.length,t=0<q?m.buffered.end(q-1):-1;0>n&&0<q&&(n=m.buffered.start(0));0<=n&&0<t&&a.F.append(n,t,g)}if(!a.G[b]&&m&&1===m.buffered.length){q=m.buffered.start(0);var u=d-q;if(Math.abs(u)>a.S&&0===m.timestampOffset)return a.g.warn("Detected a delta of "+u+" between media times and segment times for "+(b+". The segment start time is ")+(d+" and the media start time is ")+(q+". Adjusting timestampOffset.")),q=OG(a,b,function(){a.nj(b,u)}),t=OG(a,b,a.Yh.bind(a,b,!1)),
|
|
103
|
+
Promise.all([q,t])}null!==d&&null!==e&&(a.G[b]=!0)})["catch"](function(q){throw q;})};WG=function(a,b){var c=a.Sa(_.Jg)||0;UF(a.f,b,c)};XG=function(a){a.f&&UF(a.f,"",0)};$G=function(a,b,c,d,e,f,g){var h,l;return _.H(function(m){if(1==m.a){h=_.Uq;if(b===h.TEXT){a.f.A=c;var n=a.f;n.j=d;n.l=e;return m["return"]()}return _.x(m,YG(a,b,f,g),2)}l=ZG(a,b,c,d,e);a.N&&(l=l.concat(ZG(a,h.AUDIO,c,d,e)));return _.x(m,Promise.all(l),0)})};
|
|
104
|
+
ZG=function(a,b,c,d,e){return[OG(a,b,a.Hj.bind(a,b)),OG(a,b,a.nj.bind(a,b,c)),OG(a,b,a.po.bind(a,b,d,e))]};bH=function(a,b){aH(a,function(){a.o.duration=b})};OG=function(a,b,c){if(a.K)return Promise.reject();c={start:c,p:new _.qk};a.h[b].push(c);1===a.h[b].length&&cH(a,b);return c.p};
|
|
105
|
+
cH=function(a,b){var c=a.h[b][0];if(c)try{a.g.debug("Starting next operation for "+b),c.start()}catch(d){"QuotaExceededError"===d.name?c.p.reject(new _.N(_.O,3,3017,{type:b})):c.p.reject(new _.N(_.O,3,3015,{mediaError:d})),dH(a,b)}else a.g.debug("No more scheduled operations for "+b)};
|
|
106
|
+
aH=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 _.qk,f={start:function(q){q.resolve()}.bind(null,e),p:e},a.h[d].push(f),c.push(e),1===a.h[d].length&&f.start();_.D(p,2);return _.x(p,Promise.all(c),4);case 4:_.vh(p,3);break;case 2:g=_.F(p);for(h in a.a)a.h[h].length&&a.h[h].shift();return p["return"](Promise.reject(g));case 3:for(l in a.a);_.D(p,5,6);return _.x(p,b(),6);case 6:_.wh(p);for(m in a.a)dH(a,
|
|
107
|
+
m);_.xh(p);break;case 5:return n=_.F(p),p["return"](Promise.reject(new _.N(_.O,3,3015,{mediaError:n})))}})};dH=function(a,b){a.h[b].shift();cH(a,b)};YG=function(a,b,c,d){var e,f,g;return _.H(function(h){e=_.Uq;if(b===e.TEXT||!eE()||a.I.mediaSource.codecSwitchingStrategy!==_.$f)return h["return"]();f=a.J[b];g=_.rl(c,d);return YD(f,g)?h["return"]():_.x(h,OG(a,b,function(){a.g.info("Change MIME type of "+b+" to "+g);a.a[b].changeType(g);a.J[b]=g;a.Qc(b)}),0)})};
|
|
108
|
+
jH=function(a,b,c,d){var e=a.periods.flatMap(function(n){return n.variants}),f=e;if(b.length||c.length)f=eH(f,b,c);f=fH(f,d);if(1<a.periods.length&&e.some(function(n){return null!=n.audio})){var g=function(n){n=n.split(".");var p=n[0];1<n.length&&(p+="."+n[1]);return p.toLowerCase()};b=[];c=_.v(a.periods);for(e=c.next();!e.done;e=c.next()){d=new Set;e=_.v(e.value.variants);for(var h=e.next();!h.done;h=e.next())h=h.value,null!==h.audio&&d.add(g(h.audio.codecs));b.push(d)}var l=b[0];c={};for(d=1;d<
|
|
109
|
+
b.length;c={Of:c.Of},d++)c.Of=b[d],l=new Set(_.hh(l).concat().filter(function(n){return function(p){return n.Of.has(p)}}(c)));f=f.filter(function(n){return 0===l.size&&null===n.audio?!0:0<l.size&&null===n.audio?!1:l.has(g(n.audio.codecs))})}f=gH(f);var m=hH(f);a=_.v(a.periods);for(f=a.next();!f.done;f=a.next())f=f.value,f.variants=f.variants.filter(function(n){if(iH(n)===m)return!0;_.Ph("Dropping Variant (better codec available)",n);return!1})};
|
|
110
|
+
kH=function(a,b,c,d){var e=a.periods.flatMap(function(f){return f.variants});if(b.length||c.length)e=eH(e,b,c);e=fH(e,d);a=_.v(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)})};gH=function(a){var b=new _.ei;a=_.v(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=iH(c);b.push(d,c)}return b};
|
|
111
|
+
eH=function(a,b,c){if(!b.length&&!c.length)return a;var d=a.filter(function(g){return(g=g.audio)&&c.length&&(g=_.XD(g.codecs),c.includes(g))?!0:!1}),e=a.filter(function(g){return(g=g.video)&&b.length&&(g=_.XD(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};
|
|
112
|
+
hH=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;_.Ph(_.zd,d,"avg bandwidth",f);f<c&&(b=d,c=f)});return b};iH=function(a){var b="";a.video&&(b=_.XD(a.video.codecs));var c="";a.audio&&(c=_.XD(a.audio.codecs));return b+"-"+c};
|
|
113
|
+
lH=function(a,b){function c(d,e,f){return d>=e&&d<=f}return(!a.width||!a.height||c(a.width,b.minWidth,b.maxWidth)&&c(a.height,b.minHeight,b.maxHeight)&&c(a.width*a.height,b.minPixels,b.maxPixels))&&c(a.bandwidth,b.minBandwidth,b.maxBandwidth)?!0:!1};mH=function(a,b){for(var c=!1,d=_.v(a),e=d.next();!e.done;e=d.next()){e=e.value;var f=e.allowedByApplication;e.allowedByApplication=lH(e,b);f!==e.allowedByApplication&&(c=!0)}return c};
|
|
114
|
+
pH=function(a,b,c,d,e){e=void 0===e?!0:e;var f=!1;d.variants=d.variants.filter(function(n){if(a&&a.ca&&!GD(a,n))return _.Ph("Dropping variant - not compatible with key system",n),!1;var p=n.audio,q=n.video;if(p&&!JG(p)){var t=p.codecs;0<=p.codecs.indexOf(_.ee)?(_.Ph("Trying to use AC-3 for EC-3"),p.codecs=p.codecs.replace(_.ee,"ac-3"),JG(p)?_.Oh("Using AC-3 instead of EC-3 for",nH(p)):(p.codecs=t,_.Oh(ZC,nH(p)),n.audio=null,f=!0,p=null)):(_.Oh(ZC,nH(p)),n.audio=null,f=!0,p=null)}return q&&!JG(q)?
|
|
115
|
+
(_.Oh("Dropping variant - video not compatible with platform",nH(q)),!1):p&&b&&!oH(p,b,e)?(_.Oh("Dropping variant - not compatible with active audio","active audio",nH(b),"variant.audio",nH(p)),!1):q&&c&&!oH(q,c,e)?(_.Oh("Dropping variant - not compatible with active video","active video",nH(c),"variant.video",nH(q)),!1):!0});if(f){for(var g=!1,h=!1,l=_.v(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&&
|
|
116
|
+
!n.audio?(_.Oh("Dropping variant - not compatible with video + audio","variant.video",nH(n.video)),!1):!0}))}d.textStreams=d.textStreams.filter(function(n){var p=_.WF(_.rl(n.mimeType,n.codecs));p||_.Ph("Dropping text stream. Is not supported by the platform.",n);return p})};oH=function(a,b,c){return a.mimeType!==b.mimeType||(void 0===c||c)&&a.codecs.split(".")[0]!==b.codecs.split(".")[0]?!1:!0};
|
|
117
|
+
qH=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=_.v(b.roles),q=p.next();!q.done;q=p.next())n.add(q.value);if(c)for(p=_.v(c.roles),q=p.next();!q.done;q=p.next())m.add(q.value);q=[c,b].map(function(t){return t?t.accessibility||[]:[]}).reduce(function(t,u){return t.concat(u)},[]);a={id:a.id,activeVideo:!1,
|
|
113
118
|
activeAudio:!1,activeText:!1,type:"variant",bandwidth:a.bandwidth,language:a.language,originalLanguage:a.language,label:null,kind:l,width:null,height:null,frameRate:null,trickPlay:!1,mimeType:g,audioMimeType:h,codecs:f.join(", "),audioCodec:d,videoCodec:e,primary:a.primary,roles:Array.from(m),audioRoles:Array.from(n),videoId:null,audioId:null,channelsCount:null,spatialAudio:!1,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null,accessibility:q};c&&
|
|
114
119
|
(a.videoId=c.id,a.originalVideoId=c.originalId,a.width=c.width||null,a.height=c.height||null,a.frameRate=c.frameRate||null,a.trickPlay=!!c.trickPlay,a.videoBandwidth=c.bandwidth||null);b&&(a.audioId=b.id,a.originalAudioId=b.originalId,a.originalLanguage=b.originalLanguage,a.channelsCount=b.channelsCount,a.audioBandwidth=b.bandwidth||null,a.label=b.label,a.audioRoles=b.roles);return a};
|
|
115
|
-
|
|
116
|
-
originalTextId:a.originalId,accessibility:a.accessibility,keyId:null}};
|
|
117
|
-
|
|
118
|
-
_.
|
|
119
|
-
e.filter(function(h){return 0===h.roles.length}),b.length)return b;b=e.map(function(h){return h.roles}).reduce(_.
|
|
120
|
-
|
|
121
|
-
_.
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
b.
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
a;if(0===g.length||!e)throw _.
|
|
134
|
-
|
|
135
|
-
b.start);b=_.
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
m),q["return"]();p=
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
c)};
|
|
143
|
-
|
|
144
|
-
_.
|
|
145
|
-
_.
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
120
|
+
rH=function(a){return{id:a.id,activeVideo:!1,activeAudio:!1,activeText:!1,type:_.qj,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,
|
|
121
|
+
originalTextId:a.originalId,accessibility:a.accessibility,keyId:null}};sH=function(a){return a.allowedByApplication&&a.allowedByKeySystem};
|
|
122
|
+
fH=function(a,b){var c=a.filter(function(g){return g.audio&&g.audio.channelsCount}),d=new Map;c=_.v(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))};
|
|
123
|
+
_.uH=function(a,b,c,d){b=_.Hi(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=_.SD(_.Dj(h),a.map(function(m){return m.language}));return l?(e=a.filter(function(m){return _.Dj(m.language)===l}),!0):!1});d&&e.some(function(h){return h.kind===_.ke})&&(e=e.filter(function(h){return h.kind===_.ke}));if(c){b=tH(e,c);if(b.length)return b;_.Kh("No exact match for the text role could be found.")}else if(b=
|
|
124
|
+
e.filter(function(h){return 0===h.roles.length}),b.length)return b;b=e.map(function(h){return h.roles}).reduce(_.LD,[]);return b.length?tH(e,b[0]):e};tH=function(a,b){return a.filter(function(c){return c.roles.includes(b)})};
|
|
125
|
+
nH=function(a){var b=VD(a);return a.type===_.Pc?"type\x3daudio mimeType\x3d"+a.mimeType+" codecs\x3d"+a.codecs+" codecInfo\x3d"+b+" bandwidth\x3d"+a.bandwidth+" channelsCount\x3d"+a.channelsCount:a.type===_.Jg?"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"};
|
|
126
|
+
_.vH=function(){this.g=new _.J("clpp.abr");this.A=null;this.l=!1;this.w=new yF;this.f=[];this.o=1;this.F=this.B=!1;this.j=this.a=this.h=null};wH=function(a,b,c){if(a.j&&a.a.useCmsd){var d=JD(a.j);null!==d&&(a.g.debug("Using CMSD maxSuggestedBitrateKbps:",d),c=c.filter(function(e){return e.bandwidth<=1E3*d}))}a=c.filter(function(e){return!e.trickPlay});b&&(a=a.filter(function(e){return lH(e,b)}));return a.sort(function(e,f){return e.bandwidth-f.bandwidth})};xH=function(){this.a=null};
|
|
127
|
+
zH=function(a,b){if(b&&(null==a.a||a.a!==b))throw yH(a);};yH=function(a){return new _.N(_.O,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.")};AH=function(){this.a=new Map};CG=function(a,b){a.a.has(b)||a.a.set(b,new BH);return a.a.get(b)};BH=function(){this.text=this.video=this.eb=this.audio=null};CH=function(a,b){this.f=a;this.a=new Set([a]);b=b||[];for(var c=_.v(b),d=c.next();!d.done;d=c.next())this.add(d.value)};
|
|
128
|
+
FH=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||DH(d,e))&&EH(d.roles,e.roles))}!d&&(d=a.video&&b.video)&&(a=a.video,b=b.video,d=!((!c||DH(a,b))&&EH(a.roles,b.roles)));return d?!1:!0};
|
|
129
|
+
DH=function(a,b){if(a.mimeType!==b.mimeType)return!1;var c=WD(a.codecs).map(function(f){return _.XD(f)}),d=WD(b.codecs).map(function(f){return _.XD(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};EH=function(a,b){var c=new Set(a),d=new Set(b);c["delete"](_.Ge);d["delete"](_.Ge);if(c.size!==d.size)return!1;c=_.v(c);for(var e=c.next();!e.done;e=c.next())if(!d.has(e.value))return!1;return!0};
|
|
130
|
+
HH=function(a){var b=void 0===b?_.Bf:b;this.f=a;this.a=b;this.h=new GH(a.language,"",a.audio&&a.audio.channelsCount?a.audio.channelsCount:0,!1,b)};GH=function(a,b,c,d,e){this.j=_.Hi(a);this.a=b;this.f=c;this.l=void 0===d?!1:d;this.h=void 0===e?_.Bf:e};IH=function(a,b){var c=null;b.some(function(d){c=_.SD(_.Dj(d),a.map(function(e){return RD(e)}));return!!c});return c?a.filter(function(d){return c===RD(d)}):[]};
|
|
131
|
+
JH=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)})};KH=function(a,b){return a.filter(function(c){return c.audio&&c.audio.spatialAudio!==b?!1:!0})};NH=function(a,b){this.a=LH;this.f=(new Map).set(LH,b).set(MH,a)};
|
|
132
|
+
PH=function(a){var b=this;this.C=a;this.a=a.getConfiguration().streaming;this.f=new _.hi;this.g=new _.J("clpp.mse.media.LiveEdgeObserver");OH(this)&&(a=this.C.getSurface().getMedia(),this.f.on(a,_.sg,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."),
|
|
133
|
+
b.C.setPlaybackRate(b.a.chasingRate,_.Md)):1<e&&c<=f&&(b.g.debug("On live edge, reduce playback rate."),b.C.setPlaybackRate(1))}))};
|
|
134
|
+
OH=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};QH=function(a){this.h=a;this.a=null;this.f=function(){}};RH=function(a,b){a.f=b};
|
|
135
|
+
SH=function(a){var b=this;this.f=a;this.o=this.A=this.l=!1;this.h=this.f.ji();this.w=_.Md;this.j=null;this.a=new _.Yh(function(){b.A||b.f.Pm(.25*b.h)});this.g=new _.J("clpp.mse.media.PlayRateController")};TH=function(a,b){a.j=b;a.j.speedUpMode&&(a.w=a.j.speedUpMode)};
|
|
136
|
+
WH=function(a,b){a.a.stop();a.l||(a.o=!1);var c=a.l?0:a.h;if((b?b:a.w)===_.Md||0===c||1===c)try{UH(a,c)}catch(d){a.g.warn('Set playbackRate using "decoder" mode fails, due to unsupported range by platform. Fallback to "seek" mode.',d),VH(a)}else VH(a)};VH=function(a){a.g.debug($C,a.h,' using "seek" mode.');UH(a,0);a.o=!0;a.a.Jb(.25)};UH=function(a,b){if(a.f.ji()!==b){a.g.debug($C,b,' using native playbackRate "decoder" mode.');try{a.f.wo(b)}catch(c){throw c;}}};
|
|
137
|
+
YH=function(a){function b(){d=!0}function c(m){f.push(m);_.tn(m)}a=_.Oj(a);var d=!1,e,f=[],g=[];(new _.sn).M(_.Ne,c).M(_.ug,c).M(_.Ie,c).M(_.Me,c).M(_.eg,c).aa(_.gg,function(m){e=m;f.push(m);_.un(m)}).aa("encv",b).aa("enca",b).aa("avc1",function(m){g.push({M:m,Dd:1701733238})}).aa("avc3",function(m){g.push({M:m,Dd:1701733238})}).aa("ac-3",function(m){g.push({M:m,Dd:1701733217})}).aa(_.ee,function(m){g.push({M:m,Dd:1701733217})}).aa("mp4a",function(m){g.push({M:m,Dd:1701733217})}).parse(a);if(d)return _.Oh("Init segment already indicates encryption."),
|
|
138
|
+
a;if(0===g.length||!e)throw _.Qh("Failed to find boxes needed to fake encryption!"),_.Qh("Failed init segment (hex):",_.Sm(a)),new _.N(_.O,3,14E3);g.reverse();for(var h=_.v(g),l=h.next();!l.done;l=h.next())l=l.value,_.Oh('Inserting "'+_.xn(l.Dd)+'" box into init segment.'),a=XH(a,e,l.M,f,l.Dd);return a};
|
|
139
|
+
XH=function(a,b,c,d,e){var f=ZH.value(),g=a.subarray(c.start,c.start+c.size),h=_.Vj(g),l=new Uint8Array(c.size+f.byteLength);l.set(g,0);g=_.Vj(l);g.setUint32(4,e);l.set(f,c.size);e=h.getUint32(4);g.setUint32(c.size+16,e);$H(l,0,l.byteLength);e=new Uint8Array(a.byteLength+l.byteLength);c=_.wl("Xbox One")||_.vl()?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=_.v(d);for(d=a.next();!d.done;d=a.next())d=d.value,$H(e,d.start,d.size+l.byteLength);l=_.Vj(e,
|
|
140
|
+
b.start);b=_.yn(b);a=l.getUint32(b);l.setUint32(b,a+1);return e};$H=function(a,b,c){a=_.Vj(a,b);b=a.getUint32(0);0!==b&&(1===b?(a.setUint32(8,c>>32),a.setUint32(12,c&4294967295)):a.setUint32(0,c))};_.bI=function(a,b){this.C=b;this.j=a;aI(a);this.h=null;this.l=1;this.H=Promise.resolve();this.B=new Map;this.w=new Map;this.a=new Map;this.J=this.f=this.o=this.F=!1;this.I=0;this.g=new _.J("clpp.mse.Streaming");this.A=this.G=!1};
|
|
141
|
+
dI=function(a){var b=a.a.get(_.Jg);return b?cI(a,b.gc):(b=a.a.get(_.Pc))?cI(a,b.gc):null};fI=function(a){return _.eI(a,_.Pc)};gI=function(a){return _.eI(a,_.Jg)};
|
|
142
|
+
lI=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=_.Uq,_.x(q,a.C.X.clear(c.TEXT),2);case 2:return a.I++,a.J=!1,d=a.I,e=a.C.X,f=new Map,g=new Set,f.set(c.TEXT,b),g.add(b),_.x(q,e.init(f,!1,a.h.disableAudioTracks),3);case 3:return a.f?q["return"]():_.x(q,hI(a,g),4);case 4:if(a.f)return q["return"]();l=(h=e.getTextDisplayer().isTextVisible())||a.h.alwaysStreamText;if(a.I===d&&!a.a.has(c.TEXT)&&!a.J&&l){m=a.C.Pb();n=iI(a,m);if(null==n)return a.g.warn("Cannot set up text media state, period not found at",
|
|
143
|
+
m),q["return"]();p=jI(b,n,0);a.a.set(c.TEXT,p);kI(a,p,0)}_.z(q)}})};oI=function(a){a.J=!0;var b=a.a.get(_.qj);b&&(a.g.info("Unload text stream"),mI(b),nI(b)["catch"](function(){}),a.a["delete"](_.qj))};pI=function(a){var b,c;return _.H(function(d){if(1==d.a){b=_.Uq;c=a.a.get(b.AUDIO);if(!c)return d.D(0);a.g.info("Unload audio stream");mI(c);return _.x(d,nI(c)["catch"](function(){}),3)}a.a["delete"](b.AUDIO);_.z(d)})};rI=function(a,b,c,d){b.video&&_.qI(a,b.video,c,d);b.audio&&_.qI(a,b.audio,c,d)};
|
|
144
|
+
tI=function(a){var b,c;_.H(function(d){if(1==d.a){if(a.A)return d["return"]();a.A=!0;return _.x(d,pI(a),2)}b=_.Uq;c=a.a.get(b.VIDEO);return _.x(d,sI(a,c),0)})};vI=function(a,b){var c;_.H(function(d){if(1==d.a){if(!a.A)return d.D(2);a.A=!1;c=a.C.Pb();return _.x(d,uI(a,b,null,null,c),2)}_.qI(a,b,!0,0);_.z(d)})};xI=function(a,b){var c=a.j.periods.map(function(d){return d.id});a.g.debug("Manifest updated, periods ("+c.length+"): "+c.join(", "));a.j.periods=b.periods;aI(a.j);wI(a)};
|
|
145
|
+
aI=function(a){a.periods.every(function(b){return typeof b.id===_.fg})};
|
|
146
|
+
yI=function(a){function b(l){return a.C.X.Mc(l,c,0)}var c=a.C.Pb(),d=!1,e=iI(a,c);if(_.Lj(a.a.values(),function(l){return l.gc===e}))for(var f=_.v(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)||(sI(a,h),d=!0)}else if(!_.Lj(a.a.keys(),b)){a.g.debug("(all): seeked: unbuffered seek: clearing all buffers");d=_.v(a.a.values());for(f=d.next();!f.done;f=d.next())sI(a,f.value);d=!0}d||a.g.debug("(all): seeked: buffered seek: presentationTime\x3d"+
|
|
147
|
+
c)};BI=function(a,b){b=void 0===b?!1:b;if(a.f)a.g.error("Unable to retry after StreamingEngine is destroyed!");else if(a.o)a.g.error("Unable to retry after StreamingEngine encountered a fatal error!");else for(var c=_.v(a.a.values()),d=c.next();!d.done;d=c.next()){d=d.value;var e=zI(d);if(d.xd||b&&AI(d))a.g.info(e,"Retrying after failure..."),d.xd=!1,kI(a,d,.1)}};CI=function(a){return Array.from(a.a.values()).some(function(b){return null!==b.ub})};
|
|
148
|
+
DI=function(a){var b=Array.from(a.a.values());return a.F&&b.every(function(c){return c.endOfStream})};FI=function(a){var b,c,d,e;return _.H(function(f){b=[];c=_.v(a.a.values());for(d=c.next();!d.done;d=c.next())e=d.value,mI(e),e.Eb&&e.ic&&(e.Eb=!1,b.push(e.ic.abort())),e.mc&&b.push(EI(a,e,!0,0));return _.x(f,Promise.all(b),0)})};GI=function(a,b,c){(a=a.a.get(b))&&c&&(mI(a),a.stream=c,a.qc=c,a.ta&&(a.ta=c.getSegmentReference(a.ta.position)),a.ta||(a.qc=null))};
|
|
149
|
+
_.eI=function(a,b){var c=a.a.get(b);return c?c.uc||c.stream:null};
|
|
150
|
+
_.qI=function(a,b,c,d){var e=a.a.get(b.type);if(!e&&b.type===_.qj&&a.h.ignoreTextStreamFailures)lI(a,b);else if(e){var f=HI(a,b).id;if(c&&f!==e.gc)for(a.g.debug("switch: switching to stream in another Period; clearing buffer and changing Periods"),b=_.v(a.a.values()),c=b.next();!c.done;c=b.next())sI(a,c.value);else if(e.uc&&(a.g.debug("switch during trick play mode",b),b.trickModeVideo?(e.uc=b,b=b.trickModeVideo,a.g.debug("switch found trick play stream",b)):(e.uc=null,a.g.debug("switch found no special trick play stream"))),
|
|
151
|
+
II(a,f))if(JI(a,b.id)||hI(a,new Set([b])),e.stream!==b){var g=a.j.presentationTimeline.getDuration(),h=a.C.Pb();h=KI(a,e,h);!c&&(e.endOfStream||h>=g)?a.g.debug(vD+zI(e)+" already buffered to the end. Not switching."):(b.type===_.qj&&QG(a.C.X,_.rl(b.mimeType,b.codecs)),e.stream=b,e.stream.segmentIterator=null,e.rf=!0,a.g.debug("switch: switching to Stream "+zI(e)),LI(a,e,f)&&(a.g.info("Aborting current segment request to switch."),e.ic.abort()),c&&(e.Cc?e.Lf=!0:e.Eb?(e.mc=!0,e.Ze=d,e.Lf=!0):(mI(e),
|
|
152
|
+
EI(a,e,!0,d)["catch"](function(l){if(a.C)a.C.onError(l)}))))}else a.g.debug(vD+zI(e)+" already active")}};II=function(a,b){var c=a.B.get(b);return!(!c||!c.Gf)};JI=function(a,b){var c=a.w.get(b);return!(!c||!c.Gf)};
|
|
153
|
+
LI=function(a,b,c){if(!b.ic)return!1;var d=a.C.Pb(),e=a.C.X.Sa(b.type);c=(c=MI(a,b,d,e,c))?c.le():null;if(null==c)return!1;var f=b.stream.initSegmentReference;f&&(c+=f.le()||0);f=a.C.ge().getBandwidthEstimate();if(8*c/f<(null===e?0:e-d)-Math.max(a.j.minBufferTime||0,a.h.rebufferingGoal))return!0;a=b.ic;a=a.j?a.j.bytesRemaining:-1;return 0>a||a>c?!0:!1};
|
|
154
|
+
sI=function(a,b){var c,d;return _.H(function(e){c=zI(b);if(b.Cc)return a.g.debug(c,"clear: already clearing the buffer"),e["return"]();if(b.mc)return a.g.debug(c,"clear: already waiting"),e["return"]();if(b.Eb)return a.g.debug(c,"clear: currently updating"),b.mc=!0,b.Ze=0,e["return"]();d=b.type;if(null==a.C.X.Zb(d))return a.g.debug(c,"clear: nothing buffered"),null==b.ub&&kI(a,b,0),e["return"]();a.g.debug(c,"clear: handling right now");mI(b);return _.x(e,EI(a,b,!1,0)["catch"](function(f){if(a.C)a.C.onError(f)}),
|
|
150
155
|
0)})};
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
a.g.debug("(all) setup Period "+b))})["catch"](function(h){a.f||(d["catch"](function(){}),d.reject(),a.B["delete"](b),a.g.warn("(all) failed to setup Period "+b),a.
|
|
155
|
-
|
|
156
|
-
e.value,
|
|
157
|
-
|
|
158
|
-
if(null!=l&&f>=l&&!b.
|
|
159
|
-
null);d=Infinity;h=_.
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
e,
|
|
163
|
-
g)a=null;else if(f=
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
_.N&&
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
n=f&&f.initSegment||b.stream.initSegmentReference;p=
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
p,8);case 8:return q=a.
|
|
176
|
-
d.startTime;a.g.debug(l,"Appending segment with "+(
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
f,f+h).then(function(){a.f||a.g.debug(d,"evicted "+h+
|
|
181
|
-
|
|
182
|
-
l.set(_.Pc,h.audio);h.text&&l.set(_.
|
|
183
|
-
for(h=g.next();!h.done;h=g.next())h=h.value,(m=l.get(h))?(_.
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
a.g.debug("fetching: reference\x3d",c);c=a.
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
this.configuration.preferredAudioChannelCount,this.configuration.preferSpatialAudio,this.configuration.mediaSource.codecSwitchingStrategy);this.
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
_.
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
0;d<f.length;d++)if(!f[d].
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
a.
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
return b.
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
a.
|
|
216
|
-
|
|
217
|
-
_.
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
(b
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
d.
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
c.
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
c
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
_.
|
|
266
|
-
_.r.
|
|
267
|
-
_.r.
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
{
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
_.r.
|
|
275
|
-
_.r.
|
|
276
|
-
_.r.
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
uF.prototype.
|
|
282
|
-
|
|
283
|
-
_.r.
|
|
284
|
-
_.r.
|
|
285
|
-
_.r.
|
|
286
|
-
_.r.
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
156
|
+
uI=function(a,b,c,d,e){var f,g,h,l,m,n,p;return _.H(function(q){if(1==q.a){f=a.C.Pb();g=iI(a,f);if(null==g)return a.g.warn("Cannot initialize streams, period not found at",f),q["return"]();h=_.Uq;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.X;p=a.h.forceNativeTS;return _.x(q,n.init(l,p,a.h.disableAudioTracks),2)}if(3!=q.a){if(a.f)return q["return"]();wI(a);return _.x(q,hI(a,m),3)}if(a.f)return q["return"]();l.forEach(function(t,u){if(!a.a.has(u)){var y=
|
|
157
|
+
jI(t,g,e);a.a.set(u,y);kI(a,y,0)}});_.z(q)})};jI=function(a,b,c){return{stream:a,type:a.type,qc:null,segmentIterator:null,ta:null,uc:null,rf:!0,gc:b,endOfStream:!1,Eb:!1,ub:null,mc:!1,Ze:0,Lf:!1,Cc:!1,Ig:!1,xd:!1,kj:c||0,ic:null,cf:!1,Di:0}};OI=function(a){a.g.debug("(all) setupAllPeriods_");a.j.periods.map(function(b){return b.id}).forEach(function(b){NI(a,b)["catch"](MD)})};
|
|
158
|
+
NI=function(a,b){var c=a.B.get(b);if(c)return a.g.debug("(all) Period "+b+KC),c;a.g.debug("(all) setting up Period "+b);var d=new _.qk;a.B.set(b,d);var e=new Set;c=cI(a,b);for(var f=_.v(c.variants),g=f.next();!g.done;g=f.next())g=g.value,g.video&&e.add(g.video),g.video&&g.video.trickModeVideo&&e.add(g.video.trickModeVideo),g.audio&&e.add(g.audio);c=_.v(c.textStreams);for(f=c.next();!f.done;f=c.next())e.add(f.value);a.H=a.H.then(function(){return a.f?null:hI(a,e)}).then(function(){a.f||(d.resolve(),
|
|
159
|
+
a.g.debug("(all) setup Period "+b))})["catch"](function(h){a.f||(d["catch"](function(){}),d.reject(),a.B["delete"](b),a.g.warn("(all) failed to setup Period "+b),a.C.onError(h))});return d};
|
|
160
|
+
hI=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t;return _.H(function(u){switch(u.a){case 1:c=[];d=_.v(b);for(e=d.next();!e.done;e=d.next())f=e.value,(g=a.w.get(f.id))?(a.g.debug("(all) Stream "+f.id+KC),c.push(g)):(a.g.debug("(all) setting up Stream "+f.id),a.w.set(f.id,new _.qk),c.push(f.createSegmentIndex(a.C.Db,a.h.attemptParameters)));_.D(u,2);return _.x(u,Promise.all(c),4);case 4:if(a.f)return u["return"]();_.vh(u,3);break;case 2:h=_.F(u);if(a.f)return u["return"]();l=_.v(b);for(e=l.next();!e.done;e=
|
|
161
|
+
l.next())if(m=e.value,n=a.w.get(m.id))n["catch"](function(){}),n.reject(),a.w["delete"](m.id);throw h;case 3:p=_.v(b);for(e=p.next();!e.done;e=p.next())q=e.value,(t=a.w.get(q.id))&&!t.done&&(t.resolve(),a.g.debug("(all) setup Stream "+q.id));_.z(u)}})};wI=function(a){var b=a.j.presentationTimeline.getDuration();Infinity>b?bH(a.C.X,b):bH(a.C.X,Math.pow(2,32))};
|
|
162
|
+
RI=function(a,b){function c(n){return n.type===_.qj&&n.stream.mimeType===_.Hc}if(c(b))return WG(a.C.X,b.stream.originalId||""),null;b.type===_.qj&&XG(a.C.X);if(!PG(a.C.X)&&b.type!==_.qj)return a.h.bufferLimitUpdateInterval?a.h.bufferLimitUpdateInterval/2:.5;var d=zI(b),e=a.C.Pb(),f=KI(a,b,e);a.g.debug(d,"timeNeeded\x3d"+f);var g=a.C.X.Ta(b.type,e);a.g.debug(d,"update_:",qD+e,"bufferedAhead\x3d"+g);var h=Math.max(a.j.minBufferTime||0,a.h.rebufferingGoal,a.h.bufferingGoal)*a.l,l=BE(a.j.presentationTimeline);
|
|
163
|
+
if(null!=l&&f>=l&&!b.cf)return PI(a,b),null;b.endOfStream=!1;l=HI(a,b.stream).id;var m=iI(a,f);null!=m&&(b.gc=m);if(m!==l)return a.g.debug(d,"need Period "+m,qD+e,"timeNeeded\x3d"+f,"currentPeriodId\x3d"+l),null;if(g>=h)return a.g.debug(d,"buffering goal met"),a.h.bufferLimitUpdateInterval||.5;g=a.C.X.Sa(b.type);g=MI(a,b,e,g,l);if(!g)return a.j.presentationTimeline.isLive()||b.type===_.qj?a.h.bufferLimitUpdateInterval||1:(a.g.debug("Media state "+d+": no next segment found. Assuming EOS."),PI(a,b),
|
|
164
|
+
null);d=Infinity;h=_.v(a.a.values());for(m=h.next();!m.done;m=h.next())m=m.value,c(m)||(m=KI(a,m,e),d=Math.min(d,m));if(f>=d+a.j.presentationTimeline.h)return a.h.bufferLimitUpdateInterval||1;b.kj=0;QI(a,b,e,l,g)["catch"](function(){});return null};PI=function(a,b){a.g.debug(zI(b),"buffered to end of presentation");b.endOfStream=!0;if(b.type===_.Jg){var c=a.a.get(_.qj);c&&c.stream.mimeType===_.Hc&&(c.endOfStream=!0)}};
|
|
165
|
+
KI=function(a,b,c){return b.qc&&b.ta?HI(a,b.qc).startTime+b.ta.endTime:Math.max(c,b.kj)};
|
|
166
|
+
MI=function(a,b,c,d,e){if(null==e)return a.g.warn(QC),null;if(b.stream.segmentLookupStrategy===_.lD)b.stream.segmentIterator?a=SE(b.stream.segmentIterator):b.ta||d?(c=b.ta?b.ta.endTime:d,a.g.info(TC,"looking up segment from new stream endTime:",c),b.stream.segmentIterator=WE(b.stream.segmentIndex,c),e=b.stream.segmentIterator.next().value,null===e&&(b.stream.segmentIterator=null,a.g.warn(TC,gD,"endTime:",c,b.ta)),a=e):(e=cI(a,e),e=Math.max(0,c-e.startTime),a.g.info(TC,"looking up segment","lookupTime:",
|
|
167
|
+
e,pD,c),d=null,d||(b.stream.segmentIterator=WE(b.stream.segmentIndex,e),d=b.stream.segmentIterator.next().value),null===d&&a.g.warn(TC,gD,"lookupTime:",e,pD,c),a=d);else{var f=zI(b);if(b.ta&&b.stream===b.qc)c=b.ta.position+1,a.g.debug(f,"next position known:","position\x3d"+c),a=SI(a,b,e,c);else{if(b.ta){a.g.debug(f,"next position unknown: another Stream buffered");f=HI(a,b.qc);var g=TI(a,b,f.startTime+b.ta.endTime,e)}else a.g.debug(f,"next position unknown: nothing buffered"),g=TI(a,b,d||c,e);if(null==
|
|
168
|
+
g)a=null;else if(f=SI(a,b,e,g),null==f)a=null;else{var h=null==a.h?!1:a.h.ignoreDrift;null!=d||h||(d=f,d.Ha+d.startTime+2>c&&(a=SI(a,b,e,Math.max(0,g-1)))&&(f=a));a=f}}}return a};TI=function(a,b,c,d){var e=zI(b);d=cI(a,d);var f=Math.max(0,c-d.startTime);b=b.stream.findSegmentPosition(f);a.g.debug(e,"Looked up segment:",qD+c,"lookupTime\x3d"+f,iD+d.startTime,"Result: segment position\x3d"+b);null==b&&a.g.warn(e,"cannot find segment:",iD+d.startTime,"lookupTime\x3d"+f);return b};
|
|
169
|
+
SI=function(a,b,c,d){var e=zI(b);if(null==c)return a.g.warn(e,QC),null;c=cI(a,c);var f=b.stream.getSegmentReference(d);if(!f)return a.g.debug(e,"segment does not exist:",iD+c.startTime,"position\x3d"+d),null;var g=a.j.presentationTimeline;d=_.HE(g);g=GE(g);return!b.cf&&(c.startTime+f.endTime<d||c.startTime+f.startTime>g)?(a.g.debug(e,"segment is not available:",iD+c.startTime,tD+f.startTime,rD+f.endTime,"availabilityStart\x3d"+d,"availabilityEnd\x3d"+g),null):f};
|
|
170
|
+
QI=function(a,b,c,d,e){var f,g,h,l,m,n,p,q,t,u,y,A,B;return _.H(function(E){f=_.Uq;g=zI(b);h=cI(a,d);a.g.debug(g,"fetchAndAppend_:",qD+c,iD+h.startTime,sD+e.position,tD+e.startTime,rD+e.endTime);l=b.stream;m=b.stream.segmentIterator;n=a.j.presentationTimeline.getDuration();p=UI(a,d);q=Math.max(0,h.startTime-.1);t=p?p.startTime+.01:n;u=VI(a,b,h,q,t,e);b.Eb=!0;b.rf=!1;a.g.debug(g,"fetching segment");y=!1;A=function(C,G){if(a.f||a.o)return null;y=!0;return WI(a,b,c,h,l,e,C,G)};B=a.C.X.Sa(b.type)||0;
|
|
171
|
+
u.then(function(){return a.f||a.o?null:XI(a,b,e,!1,function(C){return A(C.data,!0)})}).then(function(C){return a.f||a.o?null:y||null===C?(YI(a,b,B,e,l),null):A(C,!1)}).then(function(){if(!a.f&&!a.o){YI(a,b,B,e,l);b.Eb=!1;b.Ig=!1;b.mc||a.C.yf();if(m){var C=m.next().value;C&&a.g.debug("New iterated segment",C)}kI(a,b,0);ZI(a,b,l);a.g.debug(g,"finished fetch and append")}})["catch"](function(C){return _.H(function(G){if(a.f||a.o)return G["return"]();b.Eb=!1;if(b.type===f.TEXT&&a.h.ignoreTextStreamFailures)return 1001===
|
|
172
|
+
C.code?a.g.warn(g,"Text stream failed to download. Proceeding without it."):a.g.warn(g,"Text stream failed to parse. Proceeding without it."),a.a["delete"](f.TEXT),G.D(0);if(7001===C.code)return b.Eb=!1,b.ub=null,kI(a,b,0),G.D(0);if(3017===C.code)return $I(a,b,C),G.D(0);if(1001===C.code&&C.data&&404===C.data[1])return a.g.warn(g,"request for segment failed","segment not available on server",sD+e.position,tD+e.startTime,rD+e.endTime,"error\x3d"+C),b.Eb=!1,b.ub=null,kI(a,b,1),G.D(0);if(b.type===f.TEXT)return C instanceof
|
|
173
|
+
_.N&&C.a(1),mI(b),a.C.onError(new _.N(1,2,2010,C)),G.D(0);if(1001<=C.code&&1003>=C.code)return _.x(G,aJ(a,b,h,C),0);a.g.error(g,"failed fetch and append: code\x3d"+C.code);b.xd=!0;C instanceof _.N&&C.a(_.O);return _.x(G,bJ(a,C),0)})});_.z(E)})};
|
|
174
|
+
$I=function(a,b,c){var d=zI(b);if(Array.from(a.a.values()).some(function(f){return f!==b&&f.Ig}))a.g.debug(d,VC,"waiting for another stream to recover...");else{var e=Math.round(100*a.l);if(20<e)a.l-=.2;else if(4<e)a.l-=.04;else{a.g.error(d,"MediaSource threw QuotaExceededError too many times");b.xd=!0;a.o=!0;a.C.onError(c);return}a.g.warn(d,VC,"reducing buffering goals by "+(100-Math.round(100*a.l))+"%");b.Ig=!0}kI(a,b,4)};
|
|
175
|
+
aJ=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.$f(b.stream,c));if(!f)return g.D(0);b.xd=!0;d.a(_.O);return _.x(g,bJ(a,d),0)})};
|
|
176
|
+
VI=function(a,b,c,d,e,f){var g,h,l,m,n,p,q;return _.H(function(t){g=c.startTime-f.Ha;h=b.rf||f.initSegment!==(b.ta&&b.ta.initSegment);if(!h&&g===b.Di)return t["return"](Promise.resolve());b.Di=g;l=zI(b);a.g.debug(l,"setting timestamp offset to "+g);a.g.debug(l,"setting append window start to "+d);a.g.debug(l,"setting append window end to "+e);m=$G(a.C.X,b.type,g,d,e,b.stream.mimeType,b.stream.codecs);if(!b.stream.initSegmentReference||!h)return t["return"](m);a.g.debug(l,"fetching init segment");
|
|
177
|
+
n=f&&f.initSegment||b.stream.initSegmentReference;p=XI(a,b,n,!0);q=p.then(function(u){if(a.f)return null;a.g.debug(l,"appending init segment");return cJ(a,u,b).then(function(){return VG(a.C.X,b.type,u,null,null,!!b.stream.closedCaptions&&0<b.stream.closedCaptions.size)})})["catch"](function(u){b.rf=!0;return Promise.reject(u)});return t["return"](Promise.all([m,q]))})};
|
|
178
|
+
cJ=function(a,b,c){var d;return _.H(function(e){if(!a.h.patchEdgeWhenMixedContent||!_.vl())return e.D(0);d=YH(b);return _.x(e,VG(a.C.X,c.type,d.buffer,null,null,!!c.stream.closedCaptions&&0<c.stream.closedCaptions.size),0)})};
|
|
179
|
+
WI=function(a,b,c,d,e,f,g,h){h=void 0===h?!1:h;var l,m,n,p,q,t,u,y;return _.H(function(A){switch(A.a){case 1:l=zI(b);if(!(e&&e.keyId&&a.C.ae)){A.D(2);break}m=DD(a.C.ae,e.keyId);if(!m){a.g.warn("Unable to find DRM session for "+e.keyId);A.D(2);break}_.D(A,4);return _.x(A,m,6);case 6:_.vh(A,2);break;case 4:_.F(A),a.g.warn("DRM session load failed, cannot append segment!");case 2:if(!(e.encrypted&&e.keyId&&a.C.ae&&FD(a.C.ae,e.keyId))){A.D(7);break}mI(b);n=HI(a,e).id;p=dJ(a,n);if(!p){A.D(8);break}return _.x(A,
|
|
180
|
+
p,8);case 8:return q=a.C.$f(e,d,mD),t=f.startTime+d.startTime,u=f.endTime+d.startTime,a.g.warn(l,"Blocked append for "+t+" - "+u+": "+q+". Stream with Key ID "+(e.keyId+" has restrictions.")),A["return"](Promise.resolve());case 7:return y=e.closedCaptions&&0<e.closedCaptions.size,null!=e.emsgSchemeIdUris&&0<e.emsgSchemeIdUris.length&&(new _.sn).aa("emsg",a.Mn.bind(a,d,f,e.emsgSchemeIdUris)).parse(g),A["return"](eJ(a,b,c).then(function(){if(a.f)return null;var B=f.startTime+d.startTime,E=f.endTime+
|
|
181
|
+
d.startTime;a.g.debug(l,"Appending segment with "+(B.toFixed(3)+" - "+E.toFixed(3)+" KeyID: ")+(e.keyId+" Width: ")+(e.width+" Height: "+e.height+" Bitrate: ")+(_.Q.Zf(e.bandwidth)+" Fragment: ")+h);return VG(a.C.X,b.type,g,B,E,y,e.id,h,e.type===_.Jg&&null!=e.muxedAudioId&&!a.A)}).then(function(){a.f||(a.g.debug(l,"appended media segment"),b.qc=e,b.ta=f)}))}})};
|
|
182
|
+
YI=function(a,b,c,d,e){if(!a.j.presentationTimeline.isLive()&&b.type!==_.qj){var f=zI(b),g=(a.C.X.Sa(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.cf=!0,a=a.j.periods,e.adjustSegmentDurations(d.position,c),d=oE(a,e),b=a[d],e=e.getDuration(),qE(b,e),e=d+1;e<a.length;e++)a[e].startTime+=c}};
|
|
183
|
+
fJ=function(a,b,c){(new _.sn).M(_.Ne,_.tn).M(_.ug,_.tn).M(_.Ie,_.tn).M(_.Me,_.tn).M(_.eg,_.tn).aa(_.gg,_.un).M("encv",function(d){d.reader.skip(78);_.tn(d)}).M(_.Zf,_.tn).M("schi",_.tn).M("tenc",function(d){d.reader.skip(6);if(_.ln(d.reader)){d.reader.skip(1);var e=_.Sm(_.rn(d.reader,16));e!==b.stream.keyId&&(a.g.debug(zI(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)};
|
|
184
|
+
eJ=function(a,b,c){if(a.f)return Promise.resolve();var d=zI(b);a.g.debug(d,"checking buffer length");var e=Math.max(a.h.bufferBehind,a.j.presentationTimeline.h),f=a.C.X.Zb(b.type);if(null==f)return a.g.debug(d,"buffer behind okay because nothing buffered:",qD+c,dD+e),Promise.resolve();var g=c-f,h=g-e;if(.01>=h)return a.g.debug(d,"buffer behind okay:",qD+c,eD+g,dD+e,"underflow\x3d"+Math.abs(h)),Promise.resolve();a.g.debug(d,"buffer behind too large:",qD+c,eD+g,dD+e,"overflow\x3d"+h);return a.C.X.remove(b.type,
|
|
185
|
+
f,f+h).then(function(){a.f||a.g.debug(d,"evicted "+h+LC)})};ZI=function(a,b,c){if(!a.F){b=zI(b);var d=Array.from(a.a.values());1!==d.length||d[0].type!==_.qj?a.F=d.every(function(e){return e.type===_.qj||a.G?!0:!e.mc&&!e.Cc&&e.ta}):a.G&&(a.F=!0);a.F&&(a.g.debug(b,"startup complete"),c=HI(a,c).id,UI(a,c),dJ(a,c))}};dJ=function(a,b){var c=null;a.B.has(b)||(c=NI(a,b).then(function(){a.f||(a.g.debug(fD),a.C.wg())})["catch"](MD));OI(a);a.C.Gn&&(a.g.debug("calling onStartupComplete()..."),a.C.Gn());return c};
|
|
186
|
+
gJ=function(a,b){var c=zI(b),d=HI(a,b.stream).id;if(b.gc!==d){var e=b.gc,f=Array.from(a.a.values());f.every(function(g){return g.gc===e})?f.every(AI)?(a.g.debug(c,"all need Period "+e),NI(a,e).then(function(){if(!a.f)if(LG(a.C.X),f.every(function(n){var p=AI(n),q=HI(a,n.stream).id;return p&&n.gc===e&&q!==e})){var g=cI(a,e);a.g.debug(c,"Streaming period",e,g);a.g.debug(c,"calling onChooseStreams()...");var h=a.C.xg(g);a.G=!h.audio&&!h.video&&!!h.text;var l=new Map;h.video&&l.set(_.Jg,h.video);h.audio&&
|
|
187
|
+
l.set(_.Pc,h.audio);h.text&&l.set(_.qj,h.text);var m=_.v(a.a.keys());for(h=m.next();!h.done;h=m.next())if(h=h.value,!l.has(h)&&h!==_.qj){a.g.error(c,"invalid Streams chosen: missing "+h+" Stream");a.C.onError(new _.N(_.O,5,5005));return}m=_.v(Array.from(l.keys()));for(h=m.next();!h.done;h=m.next())if(h=h.value,!a.a.has(h))if(h===_.qj)uI(a,null,null,l.get(_.qj),g.startTime),l["delete"](h);else{a.g.error(c,"invalid Streams chosen: unusable "+h+" Stream");a.C.onError(new _.N(_.O,5,5005));return}g=_.v(Array.from(a.a.keys()));
|
|
188
|
+
for(h=g.next();!h.done;h=g.next())h=h.value,(m=l.get(h))?(_.qI(a,m,!1,0),kI(a,a.a.get(h),0)):a.a["delete"](h);a.g.debug(c,fD);a.C.wg()}else a.g.debug(c,"ignoring transition to Period",e,"since another is happening")})["catch"](MD)):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)}};iI=function(a,b){var c=mE(a.j.periods,b+_.qw);return c?c.id:null};
|
|
189
|
+
HI=function(a,b){var c=a.j.periods,d=oE(c,b);c=c[d];if(!c)throw new _.N(_.O,5,5006,"No period found for stream with ID "+b.id+".");return c};hJ=function(a,b){if(a.C.pd){var c=b.Ra;if(c)return _.HF(a.C.pd,c.id)}return null};iJ=function(a,b,c){if(a.C.pd&&b){c&&0===c.request.uriIndex||_.IF(a.C.pd,b.ma[0].serviceLocationId);var d=c.request,e=c.timeMs;c=c.data.byteLength;e&&c&&(a=_.GF(a.C.pd,b.ma[d.uriIndex].serviceLocationId),_.zF(a.Yf,e,c),a.De=!0)}};
|
|
190
|
+
XI=function(a,b,c,d,e){d=void 0===d?!1:d;e=void 0===e?null:e;var f=[],g=hJ(a,c);g&&(f=c.ke(),f=_.CF(g,f));f.length||(f=c.La());f=_.uE(f,c.la,c.ga,a.h.attemptParameters,c.startTime,c.endTime,b.type,c.timescale);f.type=2;f.onFragment=c.sd?null:e;f.disableFragmentSupport=c.sd||a.h.disableFragmentSupport;f.disableMergedFragments=a.h.disableMergedFragments;if(e=c.f())f.keyInfo=e,f.onFragment=null;d&&(f.responseModifiers.push(function(h){fJ(a,b,h.data)}),b.type===_.Jg&&a.h.overridePasp&&f.responseModifiers.push(a.Oo.bind(a)));
|
|
191
|
+
a.g.debug("fetching: reference\x3d",c);c=a.C.Db.fetch(f);b.ic=c;return c.T.then(function(h){var l=a.C.ge(),m=h.timeMs,n=h.data.byteLength;m&&n&&!d&&l.segmentDownloaded(m,n);iJ(a,g,h);b.ic=null;return h.data})["catch"](function(h){iJ(a,g);throw h;})};
|
|
192
|
+
EI=function(a,b,c,d){var e,f,g,h;return _.H(function(l){if(1==l.a)return e=zI(b),b.mc=!1,b.Lf=!1,b.Ze=0,b.Cc=!0,b.stream.segmentIterator=null,a.g.debug(e,"clearing buffer"),d?(g=a.C.Pb(),h=a.C.X.getDuration(),f=a.C.X.remove(b.type,g+d,h)):f=a.C.X.clear(b.type).then(function(){return!a.f&&c?a.C.X.flush(b.type):null}),_.x(l,f,2);if(a.f)return l["return"]();a.g.debug(e,"cleared buffer");b.qc=null;b.ta=null;b.Cc=!1;b.endOfStream=!1;b.cf=!1;kI(a,b,0);_.z(l)})};
|
|
193
|
+
kI=function(a,b,c){a.g.debug(zI(b),"updating in "+c+LC);b.ub=(new _.Wh(function(){var d;return _.H(function(e){if(1==e.a)return _.D(e,2),_.x(e,a.hc(b),4);if(2!=e.a)return _.vh(e,0);d=_.F(e);if(a.C)a.C.onError(d);_.z(e)})})).ha(c)};mI=function(a){null!=a.ub&&(a.ub.stop(),a.ub=null)};cI=function(a,b){var c=a.j.periods.find(function(d){return d.id===b})||null;if(!c)throw new _.N(_.O,5,5006,"Period "+b+" not found");return c};
|
|
194
|
+
UI=function(a,b){var c=a.j.periods.findIndex(function(d){return d.id===b});return 0>c?null:a.j.periods[c+1]||null};nI=function(a){return _.H(function(b){return a.ic?_.x(b,a.ic.abort(),0):b.D(0)})};bJ=function(a,b){var c;return _.H(function(d){switch(d.a){case 1:if(a.f)return d["return"]();if(!a.C.qj){d.D(2);break}_.D(d,3);return _.x(d,a.C.qj(b),5);case 5:_.vh(d,2);break;case 3:c=_.F(d),c.cause=b,b=c;case 2:if(!b.f)a.C.onError(b);_.z(d)}})};zI=function(a){return"("+a.type+":"+a.stream.id+")"};
|
|
195
|
+
AI=function(a){return!a.Eb&&null==a.ub&&!a.mc&&!a.Cc};jJ=function(){this.a=null};
|
|
196
|
+
mJ=function(){_.Am.call(this,hD);var a=this;this.H=kJ;this.j=this.ka=null;this.eh=0;this.uj=2;this.jd=null;this.ah=!1;this.o=new _.hi;this.cd=this.fh=this.uf=this.I=this.Wc=this.B=this.L=this.A=null;this.te=!1;this.a=this.K=this.J=null;this.da=[];this.f=null;this.h=new _.vH;this.ca=this.ed=null;this.hh=1E9;this.Af=new Set;this.ia=!0;this.Ea=null;this.gh=!1;this.vj=0;this.Y=null;this.l=new AH;this.G=null;this.Kb=_.wq;this.ne=new GH(this.configuration.preferredAudioLanguage||[],this.configuration.preferredAudioRole,
|
|
197
|
+
this.configuration.preferredAudioChannelCount,this.configuration.preferSpatialAudio,this.configuration.mediaSource.codecSwitchingStrategy);this.be=this.configuration.preferredTextLanguage;this.w=new xH;this.za=this.Yb=null;this.fd=new Map;this.qe=null;this.qf=this.configuration.preferredTextRole;this.Yd=this.configuration.preferForcedSubtitles;this.o.on(window,"online",function(){a.H===lJ&&BI(a.a)});this.Cf=this.fe=this.Df=null;this.S=_.qa;this.ue=new jJ;this.de=null};
|
|
198
|
+
nJ=function(a){return new _.gE(function(b){var c=a.getTrackManager(),d=[];if(c){c=_.v(c.getVideoTracks());for(var e=c.next();!e.done;e=c.next())d.push.apply(d,_.hh(e.value.renditions))}return d.find(function(f){return f.id===b.toString()})||null})};
|
|
199
|
+
oJ=function(a,b){if(a.Kb!==b){var c=_.Q.Cl;if(a.Kb===_.Hq&&b!==_.wq)c=c(b,_.Fq),a.log.info(_.XC+c);else{var d=a.eh;d=0===d?0:Date.now()-d;var e=a.Kb;a.Kb=b;a.eh=Date.now();null!==a.I&&(a.I.A=b===_.Jq);a.G&&_.pq(a.G.a,a.Kb);b===_.Bq&&(a.uj=a.Yg?1:2);var f=a.uj,g={currentState:a.Kb,previousState:e,timeSinceLastStateChangeMS:d,reason:b===_.Bq||e===_.Bq?f:void 0},h=c(e,_.Fq),l=c(b,_.Fq);c=b!==_.Bq?"":"["+c(f,_.Eq)+"]";a.log.info(_.wb+h+" -\x3e "+(l+c));a.trigger(new _.K(_.cg,{detail:g}));(b===_.Dq||b===
|
|
200
|
+
_.Hq)&&a.cd&&a.cd.stop();b===_.Bq?a.trigger(new _.K(_.ad,{detail:{bufferedTimeMS:-1,reason:f}})):e===_.Bq&&a.trigger(new _.K(_.$c,{detail:{bufferedTimeMS:d,reason:f}}))}}};pJ=function(a){var b;return _.H(function(c){switch(c.a){case 1:b=a.w.a;if(!b){c.D(2);break}return _.x(c,b["catch"](function(){}),2);case 2:return a.ed&&(a.ed.release(),a.ed=null),_.x(c,_.Am.prototype.release.call(a),4);case 4:return _.x(c,a.unload(),5);case 5:oJ(a,_.wq),_.z(c)}})};
|
|
201
|
+
qJ=function(a){return _.H(function(b){if(1==b.a)return _.x(b,Promise.all(a.da.map(function(c){return c.stop()})),2);a.da=[];_.z(b)})};rJ=function(a){a.da.map(function(b){return b.requestStop()})};sJ=function(a){var b=new _.cv;(a=a.playlist)&&a.cropTimeline&&(a.startTime||a.endTime)&&(b.h={start:a.startTime||null,end:a.endTime||null});return b};
|
|
202
|
+
vJ=function(a,b){var c,d;return _.H(function(e){a.S===_.qa?tJ(a,b.cues):a.S===_.rb?(a.f=hG(a.f,dG(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."),rJ(a),a.da=[],_.AE(a.f.presentationTimeline,!0),a.trigger(new _.K(_.Be))),uJ(a,a.f)):xI(a.a,b);_.z(e)})};wJ=function(a){return _.H(function(b){rJ(a);a.da=[];a.S===_.rb?a.trigger(new _.K(_.Sf)):a.trigger(new _.K(_.Be));_.z(b)})};
|
|
203
|
+
uJ=function(a,b){var c=a.getMediaPosition(),d=a.fe,e=b.periods,f=d.a;d.a=[];var g=null,h=null;e=_.v(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 _.bv(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));KD(d,c);a:if(c=d.a,f.length!==c.length)f=!1;else{for(d=
|
|
204
|
+
0;d<f.length;d++)if(!f[d].ra(c[d])){f=!1;break a}f=!0}!f&&a.trigger(new _.K(_.Tf));QE(a.Cf);NE(a.K,b.cues)};XJ=function(a){var b,c;return _.H(function(d){if(1==d.a)return xJ(a),_.x(d,TJ(a),2);if(3!=d.a){UJ(a);b=_.wk(4)||_.wk(5);if(!b)return d.D(3);c=a.getSurface().getMedia();VJ(a,c);return _.x(d,WJ(a,c),3)}a.configuration=a.jb;_.z(d)})};
|
|
205
|
+
YJ=function(a,b){return _.H(function(c){if(1==c.a){if(!a.configuration.contentSteering.enabled)return c.D(2);if(a.ca)return c.D(3);a.ca=new DF(a.configuration.contentSteering,a.getNetworkEngine());a.ca.on(_.Id,function(d){a.trigger(d)});return _.x(c,FF(a.ca,b),3)}return 2!=c.a?c["return"](a.ca):c["return"](null)})};
|
|
206
|
+
fK=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 _.qk,a.w.a=e,ZJ(a,b),_.D(l,2),xJ(a),_.x(l,$J(a),4);case 4:return zH(a.w,e),a.ba=_.Oq(b),a.configuration=_.ym(a.jb,b),dE(a.configuration.xmlParser),a.de&&a.configuration.mse.sendPlaybackSessionIdHeader&&a.getNetworkEngine().headers.set(cD,a.de),a.log.info(_.db,a.configuration),a.log.info(_.vb,a.ba),_.x(l,aK(a,e),5);case 5:return zH(a.w,e),_.x(l,bK(a,b,a.getSourceIndex(),e,!1),
|
|
207
|
+
6);case 6:return f=l.f,zH(a.w,e),a.da=[f.parser],a.f=f.manifest,tJ(a,f.manifest.cues),g=a,_.x(l,cK(a,a.f,a.configuration),7);case 7:g.A=l.f;zH(a.w,e);if(!c){l.D(8);break}return _.x(l,dK(a,e),9);case 9:zH(a.w,e),a.o.one(a.j,_.De,function(){var m=Date.now()/1E3-d;a.G&&(a.G.B=m)});case 8:e.resolve();_.vh(l,0);break;case 2:h=_.F(l),eK(a,h,e),_.z(l)}})};
|
|
208
|
+
ZJ=function(a,b){b.cmcd&&b.cmcd.enabled&&(b.cmcd.sessionId||(b.cmcd.sessionId=a.de?a.de:void 0),a.ed=new PF(a.getNetworkEngine(),b.cmcd,{getBandwidthEstimate:a.getBandwidthEstimate.bind(a),getBufferInfo:a.getBufferInfo.bind(a),getLoadedSource:a.getLoadedSource.bind(a),getMediaPosition:a.getMediaPosition.bind(a),getPlaybackRate:a.getPlaybackRate.bind(a),getPlayerState:a.getState.bind(a),wd:a.wd.bind(a)}))};
|
|
209
|
+
tJ=function(a,b){if(a.configuration.ads.hls.mockCuesFn){var c=a.configuration.ads.hls.mockCuesFn(a);NE(a.K,c)}else NE(a.K,b)};eK=function(a,b,c){b=gK(a,b,c);c["catch"](function(){});c.reject(b);a.onError(b);throw b;};gK=function(a,b,c){var d=a.w;return null!=d.a&&d.a===c||b instanceof _.N&&7E3===b.code?b instanceof _.N?b:new _.N(_.O,7,7003,"Unexpected error.",b):yH(a.w)};$J=function(a){return a.ka?a.ka["catch"](function(){}):Promise.resolve()};
|
|
210
|
+
aK=function(a,b){var c;return _.H(function(d){if(1==d.a)return a.G=new _.uq,oJ(a,_.Iq),c=hK(a,a.configuration),_.x(d,WJ(a,c),2);zH(a.w,b);a.K=new LE;ME(a.K,function(e){a.log.info("Timeline cue found",e);iK(a,_.og,e)},function(){a.log.info("Timeline cues changed");a.trigger(new _.K(_.rg))});_.z(d)})};
|
|
211
|
+
bK=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=_.Oq(f),h=g[c],_.x(n,jK(a,h),2);case 2:return l=n.f,zH(a.w,d),_.cp(nD),_.x(n,kK(a,l,h,f.id||""),3);case 3:m=n.f;zH(a.w,d);m.periods.forEach(function(p){p.parser=l});if(!e||!m.presentationTimeline.l){n.D(4);break}return _.x(n,l.stop(),5);case 5:zH(a.w,d);case 4:return _.cp("manifest.end"),_.ep("Fetch and parse manifest",nD,"manifest.end"),n["return"]({parser:l,manifest:m})}})};
|
|
212
|
+
lK=function(a,b){var c,d,e;return _.H(function(f){if(1==f.a)return _.x(f,bK(a,b,0,null,!0),2);c=f.f;try{return d=[a.f,dG(c.manifest)],e=gG(d,a.f.presentationTimeline),f["return"]({parser:c.parser,manifest:e})}catch(g){throw new _.N(_.O,7,7003,"Failed to append load manifest");}})};hK=function(a,b){var c=a.getSurface().getMedia();c.loop=!!b.loop;_.L.R(b.volume)||a.setVolume(b.volume);_.L.R(b.muted)||a.setMuted(b.muted);VJ(a,c);return c};
|
|
213
|
+
VJ=function(a,b){a.j||(a.o.on(b,_.ie,function(){if(a.j.error){var c=a.j.error.code;if(1===c)c=null;else{var d=a.j.error.msExtendedCode;d&&(0>d&&(d+=Math.pow(2,32)),d=d.toString(16));c=new _.N(_.O,3,3016,{code:c,extendedError:d,message:a.j.error.message})}}else c=null;if(c)a.onError(c)}),a.j=b)};UJ=function(a){a.j&&(a.o.off(a.j,_.ie),a.j=null)};
|
|
214
|
+
TJ=function(a){var b;return _.H(function(c){switch(c.a){case 1:a.H!==mK&&(a.H=kJ);if(b=a.j)a.o.off(b,_.De),a.o.off(b,_.sf),a.o.off(b,_.cf),a.o.off(b,_.he),a.o.off(b,_.Jf),a.o.off(b,_.Ef);a.K&&(a.K.release(),a.K=null);a.Wc&&(a.Wc.release(),a.Wc=null);a.cd&&(a.cd.stop(),a.cd=null);return _.x(c,qJ(a),2);case 2:if(!a.h){c.D(3);break}return _.x(c,a.h.stop(),3);case 3:if(!a.a){c.D(5);break}return _.x(c,a.a.destroy(),6);case 6:a.a=null;case 5:if(!a.ca){c.D(7);break}return _.x(c,a.ca.destroy(),8);case 8:a.ca=
|
|
215
|
+
null;case 7:a.B&&(a.B.release(),a.B=null);a.I&&(a.I.release(),a.I=null);if(!a.L){c.D(9);break}return _.x(c,a.L.destroy(),10);case 10:a.L=null;case 9:a.jd&&(a.jd.release(),a.jd=null);a.uf&&(a.uf.release(),a.uf=null);b&&b.src&&(b.removeAttribute("src"),b.load());if(!a.A){c.D(11);break}return _.x(c,a.A.destroy(),12);case 12:a.A=null;case 11:a.l.clear(),a.J=null,a.Af.clear(),a.f=null,a.G=null,a.ia=!0,a.fd.clear(),a.te=!1,nK(a),_.z(c)}})};
|
|
216
|
+
WJ=function(a,b){var c,d,e,f,g;return _.H(function(h){if(1==h.a)return c=window.muxjs?new FG:new _.GG,d=_.nq(a.configuration,[_.re,"single-native"]),e=d.create(a),a.P=e,f=nJ(a),f.track(a),a.jd=f,g=new _.IG(b,c,e,f,a.configuration),_.x(h,g.open(),2);a.L=g;_.z(h)})};jK=function(a,b){var c,d;return _.H(function(e){if(1==e.a)return c=a.getNetworkEngine(),_.x(e,_.ev(b.url,c,a.configuration.manifest.attemptParameters,b.type||null),2);d=e.f;d.configure(a.configuration.manifest);return e["return"](d)})};
|
|
217
|
+
kK=function(a,b,c,d){return(new _.rk(Promise.resolve().then(function(){var e,f,g;return _.H(function(h){switch(h.a){case 1:e=null;case 2:if(e){h.D(3);break}_.D(h,4);var l=c.url;var m=oK(a,d);l=b.start(l,m);return _.x(h,l,6);case 6:e=h.f;_.vh(h,2);break;case 4:f=_.F(h);if(!a.dd)throw f;return _.x(h,a.dd(c.url,f),8);case 8:if(g=h.f)c.url=g;else throw f;h.D(2);break;case 3:if(0===e.periods.length)throw new _.N(_.O,4,4014);pK(e.periods);return h["return"](e)}})}),function(){a.log.info("Aborting parser step...");
|
|
218
|
+
return b.stop()})).T};
|
|
219
|
+
cK=function(a,b,c){var d,e,f,g,h,l,m,n;return _.H(function(p){switch(p.a){case 1:_.cp("initDrm.start");d=new _.jp({Db:a.getNetworkEngine(),onError:function(q){return a.onError(q)},Ag:function(q){if(a.a){var t=BG(a),u=!1,y=Object.keys(q);0===y.length&&a.log.warn("Got a key status event without any key statuses, so we don't know the real key statuses. If we don't have all the keys, you'll need to set restrictions so we don't select those tracks.");var A=1===y.length&&"00"===y[0];A&&a.log.warn("Got a synthetic key status event, so we don't know the real key statuses. If we don't have all the keys, you'll need to set restrictions so we don't select those tracks.");
|
|
220
|
+
if(y.length&&!a.configuration.disableRestrictions){y=a.getPeriods();for(var B=0;B<y.length;B++)for(var E=y[B],C=_.v(E.variants),G=C.next();!G.done;G=C.next()){G=G.value;var M=[];G.audio&&M.push(G.audio);G.video&&M.push(G.video);M=_.v(M);for(var R=M.next();!R.done;R=M.next()){R=R.value;var ka=G.allowedByKeySystem;if(R.keyId){var U=q[A?"00":R.keyId];U=!!U&&!qK.includes(U);G.allowedByKeySystem=U}ka!==G.allowedByKeySystem&&(U=R.type,R.type===_.Jg&&(U="video "+R.width+"x"+R.height+"@"+_.Q.Zf(R.bandwidth)),
|
|
221
|
+
a.log.warn("DRM Key not available for KID: '"+(R.keyId+"'. Applying restrictions to "+U)));E===t&&ka!==G.allowedByKeySystem&&(u=!0)}}}if(q=dI(a.a)){A=fI(a.a);y=gI(a.a);a:{B=q.variants;for(E=0;E<B.length;E++)if(B[E].audio===A&&B[E].video===y){A=B[E];break a}A=null}if(!A||A.allowedByKeySystem)a.log.info(RC),rK(a),sK(a,q.variants)}u&&q!==t&&(a.log.info(RC),rK(a),sK(a,t.variants))}},zg:function(q,t){a.trigger(new _.K(_.Xd,{expirationTime:t}))},onEvent:function(q){return a.fg(q)},getConfiguration:function(){return a.getConfiguration()},
|
|
222
|
+
vd:function(){return a.vd()}});e=b.periods.every(function(q){return q.variants.some(function(t){return t.drmInfos.some(function(u){return u.licenseServerUriOrigin===_.jD})})});c.drmResolver&&(c.drm=c.drmResolver({hasLaurl:e}));f=c.drm;g=_.an(f);d.f=g;h=f?f.offlineId||"":"";l=[];m=_.Wu(b.periods);if(!h){p.D(2);break}n=_.Cm(_.df);if(!n){p.D(2);break}return _.x(p,n.l(a,m),4);case 4:return _.x(p,n.j(h),5);case 5:l=p.f;case 2:return _.x(p,_.op(d,m,l),6);case 6:return a.A=d,tK(a,b.periods),_.cp("initDrm.end"),
|
|
223
|
+
_.ep("Init DRM","initDrm.start","initDrm.end"),p["return"](d)}})};
|
|
224
|
+
dK=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,uK(a,c),vK(a,a.f.periods),a.ne=new GH(a.configuration.preferredAudioLanguage||[],a.configuration.preferredAudioRole,a.configuration.preferredAudioChannelCount,a.configuration.preferSpatialAudio,a.configuration.mediaSource.codecSwitchingStrategy),a.be=a.configuration.preferredTextLanguage,a.qf=a.configuration.preferredTextRole,a.Yd=a.configuration.preferForcedSubtitles,_.x(q,_.Gp(a.A,c),2);if(3!=q.a)return zH(a.w,
|
|
225
|
+
b),a.h.configure(a.configuration.abr),a.Lg&&a.h.setCmsdManager(a.Lg),a.h.init(function(t,u,y){var A,B,E;return _.H(function(C){if(1==C.a){if(a.ia)return C["return"]();A=wK(a).find(function(G){return G.id===t.id})||null;if(!A)return a.log.warn("No matching variant found for track switch"),C.D(0);B=BG(a);return _.x(C,B.parser.loadVariant(A,B.id),3)}E=C.f;xK(a,E,u,y);_.z(C)})}),a.B=yK(a,c,a.configuration.startTime),a.Wc=zK(a),a.I=new SH({ji:function(){return c.playbackRate},wo:function(t){c.playbackRate=
|
|
226
|
+
t},Pm:function(t){c.currentTime+=t}}),TH(a.I,a.configuration.trickPlay),a.isLive()&&a.configuration.streaming.enableLiveEdgeChasing&&(a.uf=new PH(a)),d=Math.max(1E-4,a.configuration.streaming.rebufferingGoal),AK(a,d),BK(a)?kH(a.f,_.Hi(a.configuration.preferredVideoCodec),_.Hi(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount):jH(a.f,_.Hi(a.configuration.preferredVideoCodec),_.Hi(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount),e=CK(a),
|
|
227
|
+
e.h=a.configuration.streaming,a.a=e,a.H=lJ,_.x(q,e.start(),3);zH(a.w,b);a.configuration.streaming.startAtSegmentBoundary&&(f=pF(a.B),g=DK(a,f),iF(a.B.f,g));h=_.v(a.f.periods);for(l=h.next();!l.done;l=h.next())m=l.value,EK(a,m);rK(a);n=wK(a);p=n.some(function(t){return t.primary});a.configuration.preferredAudioLanguage||p||a.log.warn("No preferred audio language set. We will choose an arbitrary language initially");sK(a,n);_.z(q)})};
|
|
228
|
+
uK=function(a,b){function c(d){a.j&&a.J&&(d.type===_.Vf&&a.ve?(a.J.a=MH,nK(a)):d.type===_.Sg&&a.getState()===_.Kq&&.1>a.getBufferInfo().Ta(a.getMediaPosition())?(a.J.a=MH,nK(a)):a.J&&FK(a));GK(a)}a.o.on(b,_.sf,c);a.o.on(b,_.cf,c);a.o.on(b,_.he,c);a.o.on(b,_.Vf,c);a.o.on(b,_.Uf,c);a.o.on(b,_.Ef,c);a.o.on(b,_.Sg,c);a.o.on(b,_.Jf,function(){if(a.j){var d=a.j.playbackRate;0!==d&&a.I.set(d)}})};
|
|
229
|
+
pK=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)})){_.Ph("Found variant with audio and video content, so filtering out audio-only content in all periods.");a=_.v(a);for(var c=a.next();!c.done;c=a.next())c=c.value,c.variants=c.variants.filter(b)}};yK=function(a,b,c){return new nF(b,a.f,a.configuration.streaming,c,function(d){a.Wc&&rF(a.Wc,!0,d);a.a&&yI(a.a)},function(d){return a.dispatchEvent(d)},a.S===_.rb)};
|
|
230
|
+
zK=function(a){var b=new sF(a.j),c=new QH(a.f);RH(c,function(){rK(a)});b.a.add(c);a.K&&(c=new uF(a.K),vF(c,function(d){d.wf&&d.wf();iK(a,_.pg,d)},function(d){d.yg&&d.yg();iK(a,_.qg,d)},function(d,e){e||(d.wf&&d.wf(),iK(a,_.pg,d),d.yg&&d.yg(),iK(a,_.qg,d))}),b.a.add(c));a.S===_.rb&&(c=new PE(a.fe,a.ue,function(d){return a.trigger(d)},a.configuration.playlist),b.a.add(c),a.Cf=c);return b};AK=function(a,b){a.J=new NH(b,Math.min(.5,b/2));a.J.a=MH;nK(a);a.cd=(new _.Yh(function(){FK(a)})).Jb(.25)};
|
|
231
|
+
FK=function(a){switch(a.H){case lJ:a:if(a.j.ended||RG(a.L))var b=!0;else{if(a.isLive()){b=GE(a.f.presentationTimeline);var c=a.getBufferInfo();if(null!==c&&(c=c.Sa(),null!==c&&c>=b)){b=!0;break a}}b=!1}break;default:b=!1}if(a.L){var d=TG(a.L);c=d.video;d=d.audio;var e=a.j.currentTime;c&&d?(c=c.Ta(e),d=d.Ta(e),c=Math.min(c,d)):c=c?c.Ta(e):d?d.Ta(e):0}else c=0;if(d=a.J){d=a.J;var f=b,g=d.f.get(d.a);e=d.a;c=f||c>=g?LH:MH;d.a=c;d=e!==c}c=d;(d=HK(a))&&a.ed&&(a.ed.f=!0);c||a.getState()===_.Bq&&!d?(a.log.debug("Buffering state changed. Is buffering",
|
|
232
|
+
d,"buffered to end",b,"state",a.getState()),nK(a)):a.te&&GK(a)};CK=function(a){var b={configuration:{Em:a.S===_.rb},Pb:function(){return pF(a.B)},X:a.L,Db:a.getNetworkEngine(),pd:a.ca,xg:a.Nk.bind(a),wg:a.Mk.bind(a),onError:a.onError.bind(a),Li:a.mn.bind(a),onEvent:a.fg.bind(a),Qi:a.No.bind(a),yf:a.Bn.bind(a),ge:function(){return a.h},$f:a.Sj.bind(a),qj:a.Do.bind(a),ae:a.A};return new _.bI(a.f,b)};
|
|
233
|
+
uG=function(a,b){var c,d,e;return _.H(function(f){if(1==f.a){c=IK;if(!a.f||!a.a)return f.D(0);d=BG(a);return _.x(f,d.parser.loadTextStream(b.id,d.id),3)}if(4!=f.a)return e=f.f,_.x(f,lI(a.a,e),4);JK(a,d,e,!1);a.ia?a.Y=e:_.qI(a.a,e,!0,0);a.be=e.language;a.Yd=e.kind===c.zj;_.z(f)})};
|
|
234
|
+
rG=function(a,b,c){c=void 0===c?!1:c;var d=void 0===d?0:d;var e,f,g,h,l,m,n;_.H(function(p){if(1==p.a){if(!a.f||!a.a)throw Error("Player not ready to select tracks.");e=BG(a);if(!e)throw Error(WC);if(!b)return a.za=null,null!=a.qe&&(a.ne=a.qe,a.qe=null),a.configuration.abr.enabled||(a.log.info("Enable ABR Selection"),a.configuration.abr.enabled=!0,a.h.enable()),f=sK(a,e.variants),g=f.variant,null==g||a.ia||xK(a,g),p["return"]();a.configuration.abr.enabled&&(a.log.info("Disable ABR and enable manual track selection to select "+
|
|
235
|
+
(b.width+"x"+b.height+"@"+b.bandwidth)),a.configuration.abr.enabled=!1,a.h.disable());h=wK(a);l=h.find(function(q){return q.id===b.id})||null;if(!l)throw a.log.error("No variant with id",b.id),Error("Variant not found.");if(!sH(l))throw a.log.error("Unable to switch to restricted track",b.id),Error("Unable to switch to restricted track.");a.za=l.video.id;return _.x(p,e.parser.loadVariant(l,e.id),2)}m=p.f;(n=!!CG(a.l,e).eb)?m.video&&(KK(a,e,m.video,!1),_.qI(a.a,m.video,c,d)):(LK(a,e,m,!1),MK(a,m,c,
|
|
236
|
+
d));null==a.qe&&(a.qe=a.ne);a.ne=new HH(l);sK(a,e.variants);_.z(p)})};
|
|
237
|
+
OK=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,u,y;_.H(function(A){if(1==A.a){if(a.configuration.streaming.disableAudioTracks)throw Error("Audio tracks are disabled by config.");if(!a.a||!a.f||!a.B)throw Error("Not ready to select audio track.");if(c=(a.f.muxedAudioTracks||[]).find(function(B){return B.id===b}))return NK(a,c),A["return"]();d=gI(a.a);e=fI(a.a);f=BG(a);if(!f)throw Error(WC);g=wK(a).filter(function(B){return B.audio.id===b&&sH(B)});h=!1;l=void 0;if(d){if(l=g.find(function(B){return B.video.id===
|
|
238
|
+
d.id}),!l&&(a.log.debug("Cannot find exact variant, looking for anything else that matches with given audioId"),h=!0,m=a.getTrackManager().Ma()))n=m.renditions.map(function(B){return B.id}),l=g.find(function(B){return n.find(function(E){return E===String(B.video.id)})})}else l=g[0];if(!l)throw Error("Variant with target audio track not found.");q=(p=!!CG(a.l,f).eb)?!0:e.codecs.split(".")[0]===l.audio.codecs.split(".")[0];if(!q)throw a.log.warn("Cannot select audio track, codecs are not compatible with active track."),
|
|
239
|
+
Error("Audio codecs not compatible with active audio.");return _.x(A,f.parser.loadVariant(l,f.id),2)}t=A.f;u=t.audio;a.Yb=u.id;y=g.map(iG);a.h.setTracks(y);LK(a,f,t,!1);h||a.ia?MK(a,t,!0,0):vI(a.a,u);_.z(A)})};
|
|
240
|
+
NK=function(a,b){var c=BG(a);if(!c)throw Error(WC);var d=c.variants.filter(function(g){return g.video&&g.video.muxedAudioId===b.groupId&&sH(g)});if(0===d.length)throw Error("No variants containing muxed audio found.");var e=d[0],f=gI(a.a);f&&(e=d.find(function(g){return g.video.id===f.id})||null);e&&e.video&&(a.Yb=b.id,a.log.info("Select muxed audio track "+b.id),PK(a,c,b,!1),tI(a.a))};xG=function(a){var b=a.ah;return a.f?a.L.getTextDisplayer().isTextVisible():b};
|
|
241
|
+
tG=function(a,b){var c,d,e,f;return _.H(function(g){c=a.ah;d=b;if(c===d)return g["return"]();a.ah=d;if(a.H!==lJ)return g.D(0);a.L.getTextDisplayer().setTextVisibility(b);if(a.configuration.streaming.alwaysStreamText)return g.D(0);if(!b)return oI(a.a),g.D(0);e=BG(a);f=_.uH(e.textStreams,a.be,a.qf,a.Yd);return 0<f.length?_.x(g,lI(a.a,f[0]),0):g.D(0)})};LK=function(a,b,c,d){b.parser&&b.parser.setCurrentVariant(c);c.video&&KK(a,b,c.video,d);c.audio&&QK(a,b,c.audio,d)};
|
|
242
|
+
QK=function(a,b,c,d){var e=a.getTrackManager();if(e){var f=a.G.f;a=CG(a.l,b);a.audio=c;a.eb=null;EG(e,c.id,_.T,d);c=e.Ua();HD(f,c,d)}};KK=function(a,b,c,d){var e=a.getTrackManager();if(e){var f=a.G.f;CG(a.l,b).video=c;EG(e,c.id,_.Nk,d);a=e.pa();f.j!==a&&(f.j=a,f.a.push({timestamp:Date.now()/1E3,id:a.id,trackId:a.track.id,type:a.track.type,fromAdaptation:d,width:a.width,height:a.height,bandwidth:a.bandwidth}))}};
|
|
243
|
+
PK=function(a,b,c,d){b=CG(a.l,b);b.audio=null;b.eb=c;if(b=a.getTrackManager())a=a.G.f,EG(b,c.id,_.T,d),c=b.Ua(),HD(a,c,d)};JK=function(a,b,c,d){CG(a.l,b).text=c;if(b=a.getTrackManager())EG(b,c.id,_.S,d),c=b.Ya(),a=a.G.f,a.h!==c&&(a.h=c,a.a.push({timestamp:Date.now()/1E3,id:c.id,trackId:c.track.id,type:c.track.type,fromAdaptation:d,width:null,height:null,bandwidth:null}))};RK=function(a){return a.S===_.rb&&"flat"===a.configuration.playlist.timeline};
|
|
244
|
+
vK=function(a,b){for(var c=0;c<b.length;c++){for(var d=b[c],e=new Map,f=_.v(wK(a)),g=f.next();!g.done;g=f.next())if(g=g.value,g.video&&g.video.closedCaptions){g=g.video;for(var h=_.v(g.closedCaptions.keys()),l=h.next();!l.done;l=h.next())if(l=l.value,!e.has(l)){var m={id:a.hh++,originalId:l,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return null},getSegmentReference:function(){return null},initSegmentReference:null,Ha:0,mimeType:_.Hc,codecs:"",kind:_.dd,encrypted:!1,
|
|
245
|
+
keyId:null,language:g.closedCaptions.get(l),label:null,type:_.qj,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:g.roles,channelsCount:null,spatialAudio:!1,closedCaptions:null};e.set(l,m)}}e=_.v(e.values());for(f=e.next();!f.done;f=e.next())d.textStreams.push(f.value)}};
|
|
246
|
+
tK=function(a,b){for(var c=a.a?fI(a.a):null,d=a.a?gI(a.a):null,e=!BK(a),f=_.v(b),g=f.next();!g.done;g=f.next())pH(a.A,c,d,g.value,e);c=TD(b,function(h){return h.variants.some(sH)});if(a.configuration.streaming.disableAudioTracks)for(d=_.v(b),e=d.next();!e.done;e=d.next())for(f=_.v(e.value.variants),e=f.next();!e.done;e=f.next())delete e.value.audio;if(a.configuration.streaming.disableVideoTracks)for(d=_.v(b),e=d.next();!e.done;e=d.next())for(f=_.v(e.value.variants),e=f.next();!e.done;e=f.next())e=
|
|
247
|
+
e.value,(g=e.video)&&!UD(g.type,_.rl(g.mimeType,g.codecs))&&delete e.video;if(0===c)throw new _.N(_.O,4,4032);if(c<b.length)throw new _.N(_.O,4,4011);c=_.v(b);for(e=c.next();!e.done;e=c.next())d=e.value,mH(d.variants,a.configuration.restrictions)&&a.a&&BG(a)===d&&rK(a),SK(a,d.variants)};
|
|
248
|
+
EK=function(a,b){var c=a.a?fI(a.a):null,d=a.a?gI(a.a):null,e=!BK(a);pH(a.A,c,d,b,e);d=b.variants;if(a.configuration.streaming.disableAudioTracks)for(c=_.v(d),e=c.next();!e.done;e=c.next())delete e.value.audio;if(!d.some(sH))throw new _.N(_.O,4,4011);SK(a,b.variants);mH(d,a.configuration.restrictions)&&a.a&&BG(a)===b&&rK(a);if(!_.wk(2)&&(c=a.A?a.A.getDrmInfo():null))for(d=_.v(d),e=d.next();!e.done;e=d.next()){e=_.v(e.value.drmInfos);for(var f=e.next();!f.done;f=e.next())if(f=f.value,f.keySystem===
|
|
249
|
+
c.keySystem){f=_.v(f.initData||[]);for(var g=f.next();!g.done;g=f.next())g=g.value,_.Jp(a.A,g.keyId,g.initData)||_.zp(a.A,g.initDataType,g.initData,g.keyId)}}};MK=function(a,b,c,d){c=void 0===c?!1:c;d=void 0===d?0:d;a.ia?(a.Ea=b,a.gh=c,a.vj=d):rI(a.a,b,c,d)};TK=function(a){if(a.a&&a.f){var b=dI(a.a),c=BG(a);null!=b&&b===c&&(fI(a.a),gI(a.a),_.eI(a.a,_.qj),CG(a.l,c),CG(a.l,c),CG(a.l,c),CG(a.l,c))}};
|
|
250
|
+
DK=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=fI(a.a),e=gI(a.a),f=BG(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};HK=function(a){return a.A&&a.A.G?!0:a.J?a.J.getState()===MH:!1};
|
|
251
|
+
nK=function(a){if(a.G&&a.J&&a.B){var b=UK(a)===_.Bq,c=a.I;c.l=b;WH(c,c.o?"seek":void 0);a.B.j.o=b;GK(a);a.Cf&&(c=1>Math.abs(a.getMediaDuration()-a.getMediaPosition()),a=a.Cf,b&&c&&(b=a.a,b.a[b.a.length-1]&&a.f(new _.K(_.Qf))))}};GK=function(a){oJ(a,UK(a))};UK=function(a){if(a.ve)var b=!1;else if(a.j&&a.j.ended)b=!0;else{b=a.getMediaDuration();var c=a.getMediaPosition();b=a.te&&0<=c&&b<=c?!0:!1}return b?_.Dq:HK(a)||a.ve?_.Bq:a.j&&a.j.paused?_.Jq:_.Kq};
|
|
252
|
+
sK=function(a,b){var c=VK(a,b);if(!c)return{variant:null,eb:null};var d=WK(a,c);return{variant:c,eb:d}};WK=function(a,b){if(!b||!b.video)return null;var c=(a.f.muxedAudioTracks||[]).find(function(d){return d.groupId===b.video.muxedAudioId});return c&&c.primary?c:null};
|
|
253
|
+
VK=function(a,b){try{SK(a,b)}catch(f){return a.onError(f),null}var c=b.filter(function(f){return sH(f)}),d=$F(c,a.Yb);c=a.ne.create(d);c=Array.from(c.values());var e=c.map(iG);a.h.setTracks(e);if(null!==a.za&&null!==a.Yb&&(e=c.find(function(f){return f.video.id===a.za&&f.audio.id===a.Yb}),a.za=null,e))return e;if(a.configuration.abr.enabled||null===a.za)return d=a.h.chooseTrack(),jG(d,c);d=d.find(function(f){return null!==f.video&&f.video.id===a.za});return d?d:(a.log.warn("Selected video track not found. Falling back to ABR selection"),
|
|
254
|
+
d=a.h.chooseTrack(),jG(d,c))};XK=function(a,b){return _.uH(b,a.be,a.qf,a.Yd)[0]||null};YK=function(a,b,c){c=void 0===c?!0:c;var d,e,f,g;_.H(function(h){if(1==h.a)return d=sK(a,b.variants),e=d.variant,a.Yb=e&&e.audio&&e.audio.id,e?_.x(h,b.parser.loadVariant(e,b.id),3):h.D(2);2!=h.a&&(f=h.f,LK(a,b,f,!0),MK(a,f,c));(g=XK(a,b.textStreams))&&(a.configuration.streaming.alwaysStreamText||xG(a))&&(JK(a,b,g,!0),a.ia?a.Y=g:_.qI(a.a,g,!0,0));_.z(h)})};
|
|
255
|
+
aL=function(a,b){a.ia=!0;a.h.disable();a.log.debug("Choosing new streams after period changed");var c=sK(a,b.variants),d=c.variant,e=c.eb,f=XK(a,b.textStreams);a.Ea&&(b.variants.includes(a.Ea)&&(d=a.Ea),a.Ea=null);a.Y&&(b.textStreams.includes(a.Y)&&(f=a.Y),a.Y=null);var g=d?d.video:null,h=d&&!e?d.audio:null;d&&b.parser&&b.parser.setCurrentVariant(d);g&&ZK(a,b,function(){return KK(a,b,g,!0)});h&&ZK(a,b,function(){return QK(a,b,h,!0)});e&&ZK(a,b,function(){return PK(a,b,e,!0)});f&&(a.configuration.streaming.alwaysStreamText||
|
|
256
|
+
xG(a))&&ZK(a,b,function(){return JK(a,b,f,!0)});b===BG(a)&&$K(a);c=a.configuration.streaming.alwaysStreamText||xG(a)?f:null;return{video:g,audio:h,text:c,eb:e}};xK=function(a,b,c,d){c=void 0===c?!1:c;d=void 0===d?0:d;if(a.configuration.abr.enabled&&a.a){var e=bL(a,b);if(CG(a.l,e).eb){var f=b.video;if(f){ZK(a,e,function(){return KK(a,e,f,!0)});e===BG(a)&&$K(a);_.qI(a.a,f,c,d);return}}ZK(a,e,function(){LK(a,e,b,!0)});e===BG(a)&&$K(a);rI(a.a,b,c,d)}};
|
|
257
|
+
rK=function(a){var b=a.getTrackManager();b&&a.H!==mK&&(b.m&&(AG(b),b.m.trigger(new _.K(_.tg))),$K(a))};$K=function(a){var b=BG(a);if(b){var c=a.fd.get(b)||[];for(a.fd["delete"](b);c.length;)c.shift()()}};ZK=function(a,b,c){a.fd.has(b)||a.fd.set(b,[]);a.fd.get(b).push(c)};iK=function(a,b,c){a.trigger(new _.K(b,{detail:KE(c,RK(a))}))};
|
|
258
|
+
SK=function(a,b){var c=a.A?_.L.lh(a.A.ka):{},d=Object.keys(c);d=d.length&&"00"===d[0];for(var e=!1,f=!1,g=[],h=[],l=_.v(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=_.v(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?qK.includes(q)&&(h.includes(q)||h.push(q)):g.includes(p.keyId)||g.push(p.keyId)}m.allowedByApplication?m.allowedByKeySystem&&(e=!0):f=!0}if(!e)throw new _.N(_.O,4,4012,{hasAppRestrictions:f,
|
|
259
|
+
missingKeys:g,restrictedKeyStatuses:h});};cL=function(a){if(null==BG(a))return[];TK(a);return wK(a).filter(function(b){return sH(b)})};dL=function(a){var b=BG(a);if(null==b)return[];TK(a);return a.f.alternativeTextStreams?a.f.alternativeTextStreams:b.textStreams.filter(function(c){return!a.Af.has(c)})};BG=function(a){var b=pF(a.B),c=null;a=_.v(a.f.periods);for(var d=a.next();!d.done;d=a.next())d=d.value,d.startTime<=b&&(c=d);return c};eL=function(a){var b=BG(a);return b?CG(a.l,b).audio:null};
|
|
260
|
+
fL=function(a){var b=BG(a);return b?CG(a.l,b).video:null};bL=function(a,b){for(var c=_.v(a.f.periods),d=c.next();!d.done;d=c.next())if(d=d.value,d.variants.some(function(e){return e.id===b.id}))return d;return null};xJ=function(a){if(a.H===mK)throw new _.N(_.O,7,7E3,"Player is destroyed.");};
|
|
261
|
+
gL=function(a,b,c,d){var e,f,g,h,l,m,n,p,q,t,u,y,A,B,E,C,G,M,R,ka;return _.H(function(U){switch(U.a){case 1:return e=_.Uq,_.D(U,2),_.x(U,_.ev(b.url,a.getNetworkEngine(),a.configuration.manifest.attemptParameters,b.type||null),4);case 4:f=U.f;f.configure(a.configuration.manifest);var ra=f;var Ba=b.url,Ca=oK(a,a.configuration.id||"");ra=ra.start(Ba,Ca);return _.x(U,ra,5);case 5:g=U.f;pK(g.periods);if(!g.periods.length)throw new _.N(_.O,4,4014);return _.x(U,qJ(a),6);case 6:a.da=[f];h=d&&d.id;l=c&&c.id;
|
|
262
|
+
a.f.periods=g.periods;m=mE(g.periods,pF(a.B))||g.periods[0];BK(a)?kH(a.f,_.Hi(a.configuration.preferredVideoCodec),_.Hi(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount):jH(a.f,_.Hi(a.configuration.preferredVideoCodec),_.Hi(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount);n=aG(h,l,m.variants);p=XK(a,m.textStreams);sK(a,m.variants);q=n&&n.video;t=n&&n.audio;u=[];y=new Set;A=_.v(m.variants);for(B=A.next();!B.done;B=A.next())E=B.value,E.video&&
|
|
263
|
+
y.add(E.video),E.audio&&y.add(E.audio);C=a.getNetworkEngine();G=_.v(_.hh(y).concat(_.hh(m.textStreams)));for(M=G.next();!M.done;M=G.next())R=M.value,u.push(R.createSegmentIndex(C,a.configuration.streaming.attemptParameters));return _.x(U,Promise.all(u),7);case 7:GI(a.a,e.AUDIO,t);GI(a.a,e.VIDEO,q);GI(a.a,e.TEXT,p);n&&LK(a,m,n,!1);a.log.info("Switch CDN successful.");_.vh(U,0);break;case 2:ka=_.F(U);if(!f){U.D(8);break}return _.x(U,f.stop(),8);case 8:throw ka;}})};
|
|
264
|
+
oK=function(a,b){return{networkingEngine:a.getNetworkEngine(),onContentSteeringInfoFound:function(c){return YJ(a,c)},configurationId:b,filterNewPeriod:function(c){return EK(a,c)},filterAllPeriods:function(c){return tK(a,c)},onEvent:function(c){return a.fg(c)},onError:function(c){return a.onError(c)},onUpdate:function(c){return vJ(a,c)},onTurnedStatic:function(){return wJ(a)},ge:function(){return a.h}}};
|
|
265
|
+
BK=function(a){return a.configuration.mediaSource.codecSwitchingStrategy===_.$f&&(_.wk(2)||_.wk(3)||_.wk(4)||_.wk(5)||_.wk(6)||_.xk()&&38===_.xl().major||_.xk()&&53===_.xl().major||_.xk()&&68===_.xl().major?!1:!0)};wK=function(a){return a.f.alternativeVariants&&0<a.f.alternativeVariants.length?a.f.alternativeVariants:a.B?BG(a).variants:a.f.periods[0].variants};hL=function(){};
|
|
266
|
+
iL=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}};jL=function(){var a=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(b,c){return a.call(this,b,c-.001)}};kL=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"mp2t"===b.split(/ *; */)[0].split("/")[1].toLowerCase()?!1:a(b)}};
|
|
267
|
+
lL=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"opus"!==_.XD(b)&&a(b)}};
|
|
268
|
+
mL=function(){var a=MediaSource.isTypeSupported,b=/^dv(?:h[e1]|a[v1])\./;MediaSource.isTypeSupported=function(c){var d=c.split(/ *; */),e=d.shift(),f={};d=_.v(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)}};
|
|
269
|
+
nL=function(a){_.cw.call(this,a);a=a.getSurface().getMedia();this.a=null;for(var b=0;b<a.textTracks.length;++b){var c=a.textTracks[b];c.mode=_.Od;c.label===YC&&(this.a=c)}this.a||(this.a=a.addTextTrack(_.uD,YC));this.a.mode=_.oe};oL=function(a,b){var c=a.mode;a.mode=c===_.Wf?_.Wf:_.oe;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};pL=function(){};_.Aj.prototype.f=_.wD(0,function(){return this.keyInfo});var zD=[112,115,115,104,0,0,0,0],IK={jh:_.ig,To:_.dd,zj:_.ke};
|
|
270
|
+
_.PD.prototype.le=function(){return this.ga?this.ga-this.la+1:null};_.PD.prototype.f=function(){return this.keyInfo};_.$D.prototype.getAttribute=function(a){a=this.attributes[a];return null==a?null:a};_.r=_.cE.prototype;_.r.Be=function(a,b){var c=bE(a).childNodes[0];return b&&c.tagName!==b?null:c};_.r.Ka=function(a,b){var c=this.$(a,b);return 1!==c.length?null:c[0]};_.r.$=function(a,b){return Array.from(a.childNodes).filter(function(c){return c.tagName===b})};_.r.ac=_.fh(1);_.r.Fc=_.fh(3);
|
|
271
|
+
_.r.sa=function(a){return a.childNodes.every(function(b){return b.tagName===_.da||"#cdata"===b.tagName})?a.childNodes.map(function(b){return b.textContent}).join(""):null};_.r.getAttributeNS=function(a,b,c){return(b=a.a.get(b))?a.attributes[b+":"+c]||null:null};_.r.W=_.fh(5);_.r.ef=_.fh(7);_.r.Ef=_.fh(11);_.r.removeChild=function(a,b){a.childNodes=a.childNodes.filter(function(c){return c!==b})};_.r.pf=_.fh(13);_.r.nf=_.fh(15);_.r.od=_.fh(9);_.r.Ff=_.fh(17);_.r.He=_.fh(19);_.qL=0;_.r=_.gE.prototype;
|
|
272
|
+
_.r.track=function(a){null!=this.player&&iE(this);a&&(this.player=a,this.player.on(_.Of,this.ld,this))};_.r.release=function(){iE(this);this.U=[];this.f=this.h=null};
|
|
273
|
+
_.r.append=function(a,b,c){c=void 0===c?null:c;var d=this.h&&null!==c?this.h(c):null;d||this.log.debug("Unable to resolve rendition for ID",c);c={start:a,end:b,rendition:d,width:d?d.width:0,height:d?d.height:0,bandwidth:d?d.bandwidth:0};var e=this.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=_.v(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&&
|
|
274
|
+
b<e.end&&(e.start=b);this.U.push(c);this.U.sort(fE)}kE(this);this.ld();this.player&&this.player.trigger(new _.K(_.Ng))};_.r.clear=function(){this.U=[];kE(this);this.player&&(this.player.trigger(new _.K(_.Ng)),this.player.trigger(new _.K(_.Vc)))};
|
|
275
|
+
_.r.ld=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 _.K(_.Yc,
|
|
276
|
+
{detail:{width:b,height:c,bandwidth:a?a.bandwidth:null,rendition:a}}))}}}};vE.prototype.cc=function(){return this.h};vE.prototype.getDuration=function(){return this.f?this.a-this.h:Infinity};_.r=_.xE.prototype;_.r.Ic=function(){return this.L};_.r.getDuration=function(){return 2===this.j.version?this.a.getDuration():this.f};_.r.getPresentationStartTime=function(){return this.G};_.r.offset=function(a){null!=this.w&&(this.w+=a);null!=this.o&&(this.o+=a)};
|
|
277
|
+
_.r.isLive=function(){return 2===this.j.version?!this.a.f:Infinity===this.f&&!this.l};_.r.se=function(){return!this.l};LE.prototype.release=function(){this.f=function(){};this.h=function(){};this.a.clear()};LE.prototype.cues=function(){return this.a};PE.prototype.release=function(){this.f=this.j=this.h=this.a=null};PE.prototype.l=function(a){KD(this.a,a);QE(this)};
|
|
278
|
+
RE.prototype.next=function(){var a=this.h.get(this.a);a&&0<a.a.length?(this.f+=1,a.La().length&&this.f===a.a.length&&(this.a+=1,this.f=0)):(this.a+=1,this.f=0);a=SE(this);return{value:a,done:!a}};_.r=_.TE.prototype;_.r.destroy=function(){this.a=[];return Promise.resolve()};
|
|
279
|
+
_.r.nd=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};
|
|
280
|
+
_.r.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]};_.r.offset=function(a){this.g.info("Apply offset"+a+" to segment index");for(var b=_.v(this.a),c=b.next();!c.done;c=b.next())c=c.value,c.startTime+=a,c.endTime+=a,c.Ha-=a};
|
|
281
|
+
_.r.Pd=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};_.r.getDuration=function(){return 0===this.a.length?0:this.a[this.a.length-1].endTime-this.a[0].startTime};
|
|
282
|
+
_.r.ua=function(a){for(var b=[],c=[],d=0,e=0;d<this.a.length&&e<a.length;){var f=this.a[d],g=a[e];f.startTime<g.startTime?(b.push(f),d++):(f.startTime>g.startTime?0===d?c.push(g):this.g.info("Refusing to rewrite original references on update!"):(.1<Math.abs(f.endTime-g.endTime)?(f=new _.Aj(f.position,g.startTime,g.endTime,g.La,g.la,g.ga,g.Ha,g.keyInfo,g.sd,g.timescale,g.horizontalTiles,g.verticalTiles,g.durationPerTile,null,null,g.ke,g.Ra),b.push(f)):b.push(f),d++),e++)}for(;d<this.a.length;)b.push(this.a[d++]);
|
|
283
|
+
if(b.length)for(d=b[b.length-1].position+1;e<a.length;)f=a[e++],f=new _.Aj(d++,f.startTime,f.endTime,f.La,f.la,f.ga,f.Ha,f.keyInfo,f.sd,f.timescale,f.horizontalTiles,f.verticalTiles,f.durationPerTile,null,null,f.ke,f.Ra),b.push(f);else b=a;a=b;if(c.length&&b.length){a=[];e=b[0].position;d=c.length;c=_.v(c);for(f=c.next();!f.done;f=c.next())f=f.value,a.push(new _.Aj(e-d--,f.startTime,f.endTime,f.La,f.la,f.ga,f.Ha,f.keyInfo,f.sd,f.timescale,f.horizontalTiles,f.verticalTiles,f.durationPerTile,null,null,
|
|
284
|
+
f.ke,f.Ra));b=_.v(b);for(f=b.next();!f.done;f=b.next())a.push(f.value)}this.a=a};_.r.replace=function(a){this.a=a};YE.prototype.release=function(){this.h=null;this.f=function(){}};bF.prototype.release=function(){this.j&&(this.j.release(),this.j=null);null!=this.w&&(this.w.stop(),this.w=null);this.f&&(this.f.release(),this.f=null);this.a=this.H=this.G=null;this.o=!1};bF.prototype.yf=function(){this.A=!0;aF(this)};cF.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};
|
|
285
|
+
gF.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};nF.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(){}};sF.prototype.release=function(){this.h.stop();for(var a=_.v(this.a),b=a.next();!b.done;b=a.next())b.value.release();this.a.clear()};
|
|
286
|
+
uF.prototype.release=function(){this.j=null;this.o.clear();this.a=function(){};this.f=function(){};this.h=function(){}};uF.prototype.l=function(a,b,c){if(this.j)for(var d={},e=_.v(this.j.cues()),f=e.next();!f.done;d={Rf:d.Rf,Ne:d.Ne},f=e.next()){f=f.value;d.Rf=this.o.get(f)||null;d.Ne=tF(f,a);this.o.set(f,d.Ne);var g=this.w.find(function(h){return function(l){return l.Vc===h.Rf&&l.Uc===h.Ne}}(d));g&&g.Kc(f,b&&0===c)}};
|
|
287
|
+
yF.prototype.getBandwidthEstimate=function(a){return 128E3>this.a?a:Math.min(_.tE(this.f),_.tE(this.h))};_.w(DF,_.pm);DF.prototype.destroy=function(){this.B=this.h=this.A=null;this.o.clear();this.l.clear();this.j.clear();this.w.clear();null!=this.a&&(this.a.stop(),this.a=null);return this.F.destroy()};PF.prototype.release=function(){xD(this.h,this.j)};_.r=SF.prototype;_.r.destroy=function(){this.h=this.w=null;this.o.clear();return Promise.resolve()};
|
|
288
|
+
_.r.remove=function(a,b){var c=this;return Promise.resolve().then(function(){!c.h||!c.h.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))})};_.r.Zb=function(){return this.a};_.r.Sa=function(){return this.f};_.r.Mc=function(a){return null==this.a||null==this.f?!1:a>=this.a&&a<this.f};_.r.Ta=function(a){return null==this.f||this.f<a?0:this.f-Math.max(a,this.a)};_.w(kG,_.jl);_.r=kG.prototype;_.r.initialize=function(a){this.m=a};_.r.release=function(){this.h=[];this.a.clear();this.f.clear()};_.r.load=function(){};_.r.destroy=function(){this.release();this.m=null};_.r.getVideoTracks=function(){return lG(this,_.Nk)};_.r.getAudioTracks=function(){return lG(this,_.T)};_.r.oa=function(){return lG(this,_.S)};_.r.pa=function(){return this.a.get(_.Nk)||null};_.r.Ua=function(){return this.a.get(_.T)||null};_.r.Ya=function(){return this.a.get(_.S)||null};
|
|
289
|
+
_.r.Ab=function(){return this.f.get(_.Nk)||null};_.r.Mb=function(){return this.f.get(_.T)||null};_.r.Nb=function(){return this.f.get(_.S)||null};_.r.Ma=function(){return mG(this,_.Nk)};_.r.na=function(){return mG(this,_.T)};_.r.va=function(){return mG(this,_.S)};_.r.Ib=function(a){this.m&&nG(this,_.Nk,a)};_.r.Ia=function(a){this.m&&nG(this,_.T,a)};_.r.Za=function(a){this.m&&nG(this,_.S,a)};
|
|
290
|
+
_.r.sb=function(a,b){b=void 0===b?!1:b;if(this.m)if(a)sG(this,a,b);else{var c=b,d=mG(this,_.Nk);d&&(this.g.info("Unset video rendition."),d.trickPlay?this.g.info("Enabling ABR for trick play tracks is not supported"):(this.g.info("Enable ABR."),rG(this.m,null,c)))}};_.r.Gb=function(a){this.m&&(a?(qG(this,a,_.T),pG(this,a,_.T)&&(this.g.info("Set audio rendition with ID: "+a.id),this.f.set(_.T,a),OK(this.m,parseInt(a.id,10)))):this.g.info("Enabling ABR for audio is not supported"))};
|
|
291
|
+
_.r.addTextTrack=function(a){var b=this;return _.H(function(c){return b.m?_.x(c,b.m.addTextTrack(a.url,a.language,a.kind,a.mimeType,a.codec,a.label),0):c["return"]()})};_.r.xa=function(){return!!this.m&&this.m.xa()};
|
|
292
|
+
_.r.Hb=function(a){if(this.m){var b=a;if(!a){var c=this.Ya();if(c&&c.track.kind!==_.ke){a=this.oa().find(function(e){return e.kind===_.ke&&e.language===c.track.language});if(!a){var d=this.na();d&&(a=this.oa().find(function(e){return e.kind===_.ke&&e.language===d.language}))}a&&(b=a.renditions[0])}}b?vG(this,b):wG(this)}};kG.prototype.setTextRendition=kG.prototype.Hb;kG.prototype.isAbrEnabled=kG.prototype.xa;kG.prototype.addTextTrack=kG.prototype.addTextTrack;kG.prototype.setAudioRendition=kG.prototype.Gb;
|
|
293
|
+
kG.prototype.setVideoRendition=kG.prototype.sb;kG.prototype.setTextTrack=kG.prototype.Za;kG.prototype.setAudioTrack=kG.prototype.Ia;kG.prototype.setVideoTrack=kG.prototype.Ib;kG.prototype.getTextTrack=kG.prototype.va;kG.prototype.getAudioTrack=kG.prototype.na;kG.prototype.getVideoTrack=kG.prototype.Ma;kG.prototype.getLoadingTextRendition=kG.prototype.Nb;kG.prototype.getLoadingAudioRendition=kG.prototype.Mb;kG.prototype.getLoadingVideoRendition=kG.prototype.Ab;kG.prototype.getTextRendition=kG.prototype.Ya;
|
|
294
|
+
kG.prototype.getAudioRendition=kG.prototype.Ua;kG.prototype.getVideoRendition=kG.prototype.pa;kG.prototype.getTextTracks=kG.prototype.oa;kG.prototype.getAudioTracks=kG.prototype.getAudioTracks;kG.prototype.getVideoTracks=kG.prototype.getVideoTracks;FG.prototype.init=function(a){var b=muxjs.mp4.probe;a=_.Oj(a);this.l=b.videoTrackIds(a);this.j=b.timescale(a)||{};this.a.init()};FG.prototype.h=function(a,b){var c=_.Oj(a);(c=this.a.parse(c,this.l,this.j))&&c.captions&&b(c.captions);this.a.clearParsedCaptions()};FG.prototype.f=function(){this.a.resetCaptionStream()};_.GG.prototype.init=function(){};_.GG.prototype.h=function(){};_.GG.prototype.f=function(){};_.r=_.IG.prototype;
|
|
295
|
+
_.r.destroy=function(){var a=this;window.ManagedMediaSource&&(this.j.disableRemotePlayback=!1);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"](MD));for(e=1;e<d.length;++e)d[e].p["catch"](MD),d[e].p.reject()}this.f&&b.push(this.f.destroy());this.B&&b.push(this.B.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(),
|
|
290
296
|
a.j=null);a.A="";a.o=null;a.f=null;a.B=null;a.a={};a.J={};a.w={};a.G={};a.H=null;a.N=!1;for(var g in a.h);a.h={}})};_.r.open=function(){return this.L};
|
|
291
|
-
_.r.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e,f,g,h,l,m,n,p,q,t,
|
|
292
|
-
|
|
293
|
-
_.r.remove=function(a,b,c){var d=this;return a===_.
|
|
294
|
-
_.r.flush=function(a){return a===_.
|
|
295
|
-
_.r.
|
|
296
|
-
_.r.
|
|
297
|
-
_.r.
|
|
298
|
-
_.r.
|
|
299
|
-
_.r.
|
|
300
|
-
_.r.Qc=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug("Update-End received for "+a),
|
|
301
|
-
_.r.chooseTrack=function(){var a=
|
|
297
|
+
_.r.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e,f,g,h,l,m,n,p,q,t,u,y,A;return _.H(function(B){switch(B.a){case 1:return e=_.Uq,_.x(B,d.L,2);case 2:f=_.v(a),g=f.next();case 3:if(g.done){B.D(0);break}h=g.value;l=_.v(h);m=l.next().value;p=n=l.next().value;q=m;t=_.rl(p.mimeType,p.codecs);if(q===e.TEXT){QG(d,t);B.D(4);break}u=new Map;u.set(q,t);_.Bu(t)&&b&&!p.aesEncrypted||!_.ql(t,q)||!(y=_.ql(t))||(A=y(),d.w[q]=A,u=A.demuxMimeTypes(q,t),c&&u["delete"](e.AUDIO));return _.x(B,NG(d,u),7);case 7:d.N=
|
|
298
|
+
u.has(e.AUDIO)&&u.has(e.VIDEO);case 4:g=f.next(),B.D(3)}})};_.r.Zb=function(a){return a===_.qj?this.f.Zb():(a=SG(this,a))?a.Zb():null};_.r.Sa=function(a){return a===_.qj?this.f.Sa():(a=SG(this,a))?a.Sa():null};_.r.Mc=function(a,b,c){return a===_.qj?this.f.Mc(b):(a=SG(this,a))?a.Mc(b,!1,c):!1};_.r.Ta=function(a,b){if(a===_.qj)return this.f.Ta(b);var c=SG(this,a);return c?c.Ta(b):0};
|
|
299
|
+
_.r.remove=function(a,b,c){var d=this;return a===_.qj?this.f.remove(b,c):OG(this,a,this.hj.bind(this,a,b,c)).then(function(){if(a===_.Jg){var e=d.Zb(a),f=d.Sa(a);null!==e&&null!==f&&lE(d.F,e,f)}else a===_.Pc&&(e=d.F,e.player&&e.player.trigger(new _.K(_.Vc)))})};_.r.clear=function(a){if(a===_.qj){if(!this.f)return Promise.resolve();this.H.f();return this.f.remove(0,Infinity)}return OG(this,a,this.hj.bind(this,a,0,this.o.duration))};
|
|
300
|
+
_.r.flush=function(a){return a===_.qj?Promise.resolve():OG(this,a,this.Yh.bind(this,a))};_.r.endOfStream=function(a){var b=this;return aH(this,function(){RG(b)||(a?b.o.endOfStream(a):b.o.endOfStream())})};_.r.getDuration=function(){return this.o.duration};_.r.gg=function(a,b){this.g.debug("Appending data to "+a+JC);try{this.a[a].appendBuffer(b)}catch(c){throw this.g.warn("Failed to append data for "+a,c),c;}this.g.debug("Done Appending data to "+a+JC)};
|
|
301
|
+
_.r.hj=function(a,b,c){if(c<=b)this.Qc(a);else{this.g.debug("Removing data from "+a+" range:",b,c);try{this.a[a].remove(b,c)}catch(d){throw this.g.warn("Failed to remove data from "+a+" buffer. Range:",b,c,d),d;}this.g.debug("Done Removing data from "+a+" range:",b,c)}};
|
|
302
|
+
_.r.Hj=function(a){try{this.g.debug("Aborting operations for "+a+JC);var b=this.a[a].appendWindowStart,c=this.a[a].appendWindowEnd;this.a[a].abort();this.a[a].appendWindowStart=b;this.a[a].appendWindowEnd=c}catch(d){throw this.g.warn("Failed to abort operations for "+a+JC,d),d;}this.g.debug("Done Aborting operations for "+a+JC);this.Qc(a)};
|
|
303
|
+
_.r.Yh=function(a){try{this.j.readyState>HTMLMediaElement.HAVE_NOTHING?(this.g.debug("Flushing buffer for "+a),this.j.currentTime-=.001):this.g.warn("Skip buffer flush for "+a+" with element state: "+this.j.readyState)}catch(b){throw this.g.warn("Failed to flush buffer for "+a,b),b;}this.g.debug("Done Flushing buffer for "+a);this.Qc(a)};
|
|
304
|
+
_.r.nj=function(a,b){0>b&&(b+=.001);try{this.g.debug("Setting timestamp offset for "+a,b),this.a[a].timestampOffset=b}catch(c){throw this.g.warn("Failed to set timestamp offset for "+a,b,c),c;}this.g.debug("Done Setting timestamp offset for "+a,b);this.Qc(a)};
|
|
305
|
+
_.r.po=function(a,b,c){try{this.g.debug("Setting append window for "+a,b,c),this.a[a].appendWindowStart=0,this.a[a].appendWindowEnd=c,this.a[a].appendWindowStart=b}catch(d){throw this.g.warn("Failed to set append window for "+a,b,c,d),d;}this.g.debug("Done Setting append window for "+a,b,c);this.Qc(a)};_.r.Ok=function(a){this.h[a][0].p.reject(new _.N(_.O,3,3014,{mediaError:this.j.error?this.j.error.code:0}))};
|
|
306
|
+
_.r.Qc=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug("Update-End received for "+a),dH(this,a))};_.r.getTextDisplayer=function(){return this.B};var KG=window.URL.createObjectURL;_.r=_.vH.prototype;_.r.stop=function(){this.A=null;this.l=!1;this.f=[];this.o=1;this.h=null;this.F=!1};_.r.init=function(a){this.A=a};
|
|
307
|
+
_.r.chooseTrack=function(){var a=wH(this,!this.F&&this.a.initialRestrictions?this.a.initialRestrictions:this.a.restrictions,this.f),b=this.getBandwidthEstimate();this.f.length&&!a.length&&(this.g.warn("No tracks met the ABR restrictions. Choosing a track by lowest bandwidth."),a=wH(this,null,this.f),a=[a[0]]);this.h=Date.now();this.F=!0;for(var c=a,d=c[0]||null,e=0;e<c.length;e++){var f=c[e],g=c[e+1],h=isNaN(this.o)||0===this.o?1:Math.abs(this.o),l=h*f.bandwidth,m=l/this.a.bandwidthDowngradeTarget;
|
|
302
308
|
g=h*(g?g.bandwidth:Infinity)/this.a.bandwidthUpgradeTarget;this.g.debug("Bandwidth ranges:",(l/1E6).toFixed(3),(m/1E6).toFixed(3),(g/1E6).toFixed(3));b>=m&&b<=g&&(d=f)}return d||a[0]||this.f[0]};_.r.enable=function(){this.l=!0};_.r.disable=function(){this.l=!1};
|
|
303
|
-
_.r.segmentDownloaded=function(a,b){this.g.debug("Segment downloaded:","deltaTimeMs\x3d"+a,"numBytes\x3d"+b,"lastTimeChosenMs\x3d"+this.h,"enabled\x3d"+this.l);_.
|
|
304
|
-
break a}}else if(Date.now()-this.h<1E3*this.a.switchInterval){this.g.debug("Still within switch interval...");break a}var c=this.chooseTrack(),d=this.getBandwidthEstimate();this.g.debug("Calling switch_(), bandwidth\x3d"+Math.round(d/1E3)+" kbps");c&&this.A(c)}};_.r.playbackRateChanged=function(a){this.o=a};_.r.getBandwidthEstimate=function(){if(this.j&&this.a.useCmsd){var a=
|
|
305
|
-
_.r.setTracks=function(a){this.f=a};_.r.setCmsdManager=function(a){this.j=a};_.r.configure=function(a){this.a=a};_.r.reset=function(){this.B=!1;this.w=new
|
|
306
|
-
|
|
307
|
-
for(var d=a.next();!d.done;d=a.next())c.add(d.value,!b);return c};
|
|
308
|
-
_.r.start=function(){var a=this,b,c,d;return _.H(function(e){if(1==e.a){b=a.
|
|
309
|
-
a.
|
|
310
|
-
_.r.hc=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=
|
|
311
|
-
f=_.
|
|
312
|
-
_.r.
|
|
313
|
-
_.r.
|
|
314
|
-
_.r.unload=function(){var a=this,b;return _.H(function(c){if(1==c.a){
|
|
315
|
-
_.r.getBufferInfo=function(a){if(this.
|
|
316
|
-
_.r.seek=function(a,b){if(this.
|
|
317
|
-
_.r.getMediaDuration=function(){return this.f?this.f.presentationTimeline.getDuration():Infinity};_.r.destroy=function(){var a=this;return _.H(function(b){if(1==b.a)return _.x(b,_.
|
|
318
|
-
_.r.setupPlaylist=function(a){var b=this,c,d,e,f,g,h,l,m,n,p,q,t,
|
|
319
|
-
case 6:f=
|
|
320
|
-
q
|
|
321
|
-
_.r.appendLoad=function(a){var b=this,c;return _.H(function(d){if(1==d.a){
|
|
322
|
-
_.r.
|
|
323
|
-
_.r.load=function(a){return
|
|
324
|
-
_.r.getSeekRange=function(){var a={start:0,end:0};if(this.f){var b=this.f.presentationTimeline;a={start:
|
|
325
|
-
_.r.setPlaybackRate=function(a,b){if(0===a)this.log.warn("A trick play rate of 0 is unsupported!");else if(this.
|
|
326
|
-
d),_.
|
|
327
|
-
_.r.
|
|
328
|
-
_.r.
|
|
329
|
-
_.r.
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
_.
|
|
333
|
-
_.r.
|
|
334
|
-
_.r.
|
|
335
|
-
|
|
336
|
-
_.r.
|
|
337
|
-
_.x(p,b.
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
_.
|
|
341
|
-
_.
|
|
342
|
-
e.startTime
|
|
309
|
+
_.r.segmentDownloaded=function(a,b){this.g.debug("Segment downloaded:","deltaTimeMs\x3d"+a,"numBytes\x3d"+b,"lastTimeChosenMs\x3d"+this.h,"enabled\x3d"+this.l);_.zF(this.w,a,b);if(null!=this.h&&this.l)a:{this.g.debug("Suggesting Streams...");if(!this.B){if(!(128E3<=this.w.a)){this.g.debug("Still waiting for a good estimate...");break a}this.B=!0;if(this.a.useSwitchIntervalForInitialSwitch&&Date.now()-this.h<1E3*this.a.switchInterval){this.g.debug("Skipping initial estimation switch due to switch interval...");
|
|
310
|
+
break a}}else if(Date.now()-this.h<1E3*this.a.switchInterval){this.g.debug("Still within switch interval...");break a}var c=this.chooseTrack(),d=this.getBandwidthEstimate();this.g.debug("Calling switch_(), bandwidth\x3d"+Math.round(d/1E3)+" kbps");c&&this.A(c)}};_.r.playbackRateChanged=function(a){this.o=a};_.r.getBandwidthEstimate=function(){if(this.j&&this.a.useCmsd){var a=ID(this.j,_.je);a=null==a?null:a;if(null!==a)return this.g.debug("Using CMSD estimatedThroughputKbps:",a),1E3*a}return this.w.getBandwidthEstimate(this.a.defaultBandwidthEstimate)};
|
|
311
|
+
_.r.setTracks=function(a){this.f=a};_.r.setCmsdManager=function(a){this.j=a};_.r.configure=function(a){this.a=a};_.r.reset=function(){this.B=!1;this.w=new yF;var a=this.chooseTrack();a&&this.A(a)};AH.prototype.clear=function(){this.a.clear()};CH.prototype.add=function(a,b){var c=void 0===b?!0:b;if(FH(this.f,a,void 0===c?!0:c))return this.a.add(a),!0;_.Kh("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};CH.prototype.values=function(){return this.a.values()};HH.prototype.create=function(a){var b=this,c=this.a===_.$f&&eE(),d=a.filter(function(e){return FH(b.f,e,!c)});return d.length?new CH(d[0],d):this.h.create(a)};
|
|
312
|
+
GH.prototype.create=function(a){var b=IH(a,this.j);0<b.length&&(a=b);b=!1;if(this.a){var c=JH(a,this.a);0<c.length?(a=c,b=!0):_.Kh("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=fH(a,this.f),b.length?a=b:_.Kh("No exact match for the channel count could be found."));b=KH(a,this.l);b.length?a=b:_.Kh("No exact match for spatial audio could be found.");b=this.h===_.$f&&eE();c=new CH(a[0]);a=_.v(a);
|
|
313
|
+
for(var d=a.next();!d.done;d=a.next())c.add(d.value,!b);return c};NH.prototype.getState=function(){return this.a};var MH=0,LH=1;PH.prototype.release=function(){this.f.release()};QH.prototype.release=function(){this.a=this.h=null;this.f=function(){}};QH.prototype.l=function(a){var b=this.a,c=this.h.periods;a=mE(c,a)||c[0];b!==a&&this.f(a);this.a=a};SH.prototype.getConfiguration=function(){return this.j};SH.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};SH.prototype.set=function(a,b){this.h=a;WH(this,b)};var ZH=new _.eo(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])});_.r=_.bI.prototype;_.r.destroy=function(){var a=this,b,c,d,e;return _.H(function(f){if(1==f.a){b=[];c=_.v(a.a.values());for(d=c.next();!d.done;d=c.next())e=d.value,mI(e),b.push(nI(e));return _.x(f,Promise.all(b),2)}a.a.clear();a.w.clear();a.C=null;a.j=null;a.H=null;a.B.clear();a.h=null;a.f=!0;_.z(f)})};
|
|
314
|
+
_.r.start=function(){var a=this,b,c,d;return _.H(function(e){if(1==e.a){b=a.C.Pb();c=mE(a.j.periods,b+_.qw);if(!c)throw new _.N(_.O,5,5006,"No period found.");d=a.C.xg(c);if(!d.video&&!d.audio&&!d.text)throw a.g.error("start(): No streams chosen"),new _.N(_.O,5,5005,"No streams chosen.");a.G=!d.video&&!d.audio&&!!d.text;a.A=!!d.eb;return _.x(e,uI(a,d.audio,d.video,d.text,b),2)}if(a.f)return e["return"]();a.g.debug("init: completed initial Stream setup");a.C&&a.C.pn&&(a.g.debug("init: calling onInitialStreamsSetup()..."),
|
|
315
|
+
a.C.pn());_.z(e)})};_.r.resume=function(){if(!CI(this))for(var a=_.v(this.a.values()),b=a.next();!b.done;b=a.next())b=b.value,b.endOfStream=!1,kI(this,b,0)};
|
|
316
|
+
_.r.hc=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=zI(a);if(a.Eb||null==a.ub||a.Cc)return m["return"]();a.ub=null;if(!a.mc){m.D(2);break}b.g.debug(c,"skipping update and clearing the buffer");return _.x(m,EI(b,a,a.Lf,a.Ze),3);case 3:return m["return"]();case 2:_.D(m,4);d=RI(b,a);null!=d&&(kI(b,a,d),a.xd=!1);_.vh(m,5);break;case 4:return e=_.F(m),_.x(m,bJ(b,e),6);case 6:return m["return"]();case 5:gJ(b,a);if(!DI(b)){m.D(0);break}if(b.C.configuration.Em){b.g.debug("End of stream reached, keeping MediaSource open.");
|
|
317
|
+
f=_.v(b.a.values());for(g=f.next();!g.done;g=f.next())h=g.value,h.ub=null;return m["return"]()}b.g.debug("End of stream reached, calling ms.endOfStream().");return _.x(m,b.C.X.endOfStream(),8);case 8:if(b.f)return m["return"]();l=b.C.X.getDuration();l<b.j.presentationTimeline.getDuration()&&(b.j.presentationTimeline.f=l);b.C.Li();_.z(m)}})};
|
|
318
|
+
_.r.Mn=function(a,b,c,d){var e=yD(d.reader),f=yD(d.reader),g=_.nn(d.reader),h=_.nn(d.reader),l=_.nn(d.reader),m=_.nn(d.reader);d=_.rn(d.reader,d.reader.Va()-d.reader.getPosition());a=a.startTime+b.startTime+h/g;if(c.includes(e))if("urn:mpeg:dash:event:2012"===e)this.C.Qi();else this.C.onEvent(new _.K("emsg",{detail:{startTime:a,endTime:a+l/g,schemeIdUri:e,value:f,timescale:g,presentationTimeDelta:h,eventDuration:l,id:m,messageData:d}}))};
|
|
319
|
+
_.r.Oo=function(a){var b=this,c=!1,d=0;(new _.sn).M(_.Ne,_.tn).M(_.ug,_.tn).M(_.Ie,_.tn).M(_.Me,_.tn).M(_.eg,_.tn).aa(_.gg,_.un).M("encv",function(e){e.reader.skip(78);_.tn(e)}).M("pasp",function(e){d=e.start+e.headerSize;var f=_.nn(e.reader),g=_.nn(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 _.en(new DataView(a.data)),a.seek(d),_.V(a,1),_.V(a,1))};_.w(mJ,_.Am);_.r=mJ.prototype;_.r.init=function(a,b){var c=a.getMedia();_.Am.prototype.init.call(this,a,b);VJ(this,c)};_.r.namespace=function(){return hD};_.r.setSeekInterceptor=function(a){this.fh=a||null};_.r.setPlaybackSessionId=function(a){this.de=a};_.r.Oh=function(){return new kG};_.r.getState=function(){return this.Kb};_.r.getDrmInfo=function(){return this.A?this.A.getDrmInfo():null};
|
|
320
|
+
_.r.unload=function(){var a=this,b;return _.H(function(c){if(1==c.a){tG(a,!1);a.te=!1;if(!a.ba)return c["return"]();a.log.debug("Unload player with source",a.ba);(b=a.getTrackManager())&&b.release();return a.H===mK?c["return"]():_.x(c,XJ(a),2)}a.ba=null;a.eh=0;a.Yb=null;a.za=null;a.getNetworkEngine().headers["delete"](cD);_.z(c)})};_.r.release=function(){var a=this;return _.H(function(b){if(a.ka)return b["return"](a.ka);a.ka=pJ(a);a.ka["finally"](function(){a.ka=null});return b["return"](a.ka)})};
|
|
321
|
+
_.r.getBufferInfo=function(a){if(this.L){var b=TG(this.L),c=new _.om(void 0,a);switch(a){case _.Nk:return b.video?b.video:c;case _.T:return b.audio?b.audio:c;case _.S:return b.text?b.text:c}return b.total?b.total:c}return this.jd?(b=hE(this.jd),ZD(b,a)):_.Am.prototype.getBufferInfo.call(this,a)};_.r.getPosition=function(){var a=this.ue,b=this.getMediaPosition();a.a&&(a=a.a,b-=a.f,b=0>b?0:b>a.a?a.a:b);return b};_.r.getMediaPosition=function(){return this.B?pF(this.B):_.Am.prototype.getMediaPosition.call(this)};
|
|
322
|
+
_.r.seek=function(a,b){if(this.fh&&!this.fh(a,b))return Promise.resolve();var c=this.ue;c=c.a?a+c.a.cc():a;c!==a&&this.log.info("Seeking to "+a+" s corresponding to media time of "+(c+" s."));return _.Am.prototype.seek.call(this,c)};_.r.getPresentationStartTime=function(){return this.f?this.f.presentationTimeline.getPresentationStartTime():null};_.r.getDuration=function(){var a=this.ue,b=this.getMediaDuration();return a.a?a.a.getDuration():b};
|
|
323
|
+
_.r.getMediaDuration=function(){return this.f?this.f.presentationTimeline.getDuration():Infinity};_.r.destroy=function(){var a=this;return _.H(function(b){if(1==b.a)return _.x(b,_.Am.prototype.destroy.call(a),2);if(a.H===mK)return b["return"]();a.log.debug("Destroying player...");a.H=mK;UJ(a);a.o&&(a.o.release(),a.o=null);a.fe=null;a.h=null;_.z(b)})};_.r.getTimeline=function(){return this.fe};
|
|
324
|
+
_.r.setupPlaylist=function(a){var b=this,c,d,e,f,g,h,l,m,n,p,q,t,u;return _.H(function(y){switch(y.a){case 1:return c=new _.qk,b.w.a=c,_.D(y,2),xJ(b),b.S=_.rb,_.x(y,$J(b),4);case 4:return zH(b.w,c),d=a[0],d.playlist&&d.playlist.startTime&&(d.startTime=d.playlist.startTime),b.ba=_.Oq(d),b.configuration=_.ym(b.jb,d),b.log.info("Loading playlist configurations",a),b.fe=sJ(b.configuration),_.x(y,aK(b,c),5);case 5:return zH(b.w,c),e=a.map(function(A){return bK(b,A,0,null,!0)}),_.x(y,Promise.all(e),6);
|
|
325
|
+
case 6:f=y.f;b.da=f.map(function(A){return A.parser}).filter(function(A){return null!=A});g=f.filter(function(A){return A.manifest.presentationTimeline.isLive()});h=g[0];if(1<g.length)throw new _.N(_.O,7,7003,"Playlist of multiple live streams is not supported.");if(h){l=b.configuration.playlist.content;if(l===_.Wb)throw new _.N(_.O,7,7003,"Cannot play live content in VOD mode.");if("IPR"===l&&h!==f[f.length-1])throw new _.N(_.O,7,7003,"Wrong order of playlist assets.");}m=null==h;n=new _.xE({version:2},
|
|
326
|
+
null,0,m);p=f.map(function(A){return dG(A.manifest)});q=gG(p,n);b.f=q;t=b;return _.x(y,cK(b,q,b.configuration),7);case 7:return t.A=y.f,zH(b.w,c),_.x(y,dK(b,c),8);case 8:zH(b.w,c);xI(b.a,q);uJ(b,q);c.resolve();_.vh(y,0);break;case 2:return u=_.F(y),_.x(y,qJ(b),9);case 9:eK(b,u,c),_.z(y)}})};
|
|
327
|
+
_.r.appendLoad=function(a){var b=this,c;return _.H(function(d){if(1==d.a){xJ(b);if(b.S!==_.rb)throw new _.N(_.O,7,7003,"Cannot append-load to non-playlist player.");return _.x(d,lK(b,a),2)}c=d.f;b.f=c.manifest;c.parser&&b.da.push(c.parser);xI(b.a,c.manifest);DI(b.a)&&b.a.resume();uJ(b,c.manifest);_.z(d)})};_.r.seekWith=function(a){return this.seek(this.getPosition()+a)};
|
|
328
|
+
_.r.Bh=function(){var a=this;return _.H(function(b){xJ(a);if(!a.Df)return a.log.warn("No preloaded asset found"),b["return"]();a.log.info("Loading preloaded asset",a.Df);a.Df=null;return _.x(b,dK(a,null),0)})};_.r.preload=function(a){var b=this;return _.H(function(c){if(1==c.a)return xJ(b),_.cp("preload.start"),b.log.info("Preloading asset",a),_.x(c,fK(b,a,!1),2);b.Df=a;b.log.info("Preloaded asset",a);_.cp("preload.end");_.ep("preload","preload.start","preload.end");_.z(c)})};
|
|
329
|
+
_.r.load=function(a){return fK(this,a)};_.r.detach=function(){var a=this;return _.H(function(b){if(1==b.a)return _.x(b,TJ(a),2);a.configuration=a.jb;UJ(a);_.z(b)})};_.r.isLive=function(){var a;this.f?(a=this.f.presentationTimeline.isLive())||(a=this.f.presentationTimeline,a=Infinity!==a.f&&!a.l):a=!1;return a};_.r.Ui=function(){this.log.debug("User seeking finished");this.J&&FK(this);GK(this)};
|
|
330
|
+
_.r.getSeekRange=function(){var a={start:0,end:0};if(this.f){var b=this.f.presentationTimeline;a={start:yE(b),end:IE(b)}}b=this.ue;b.a?(b=b.a.getDuration(),b>a.end&&(b=a.end),b={start:0,end:b}):b=a;return b};_.r.Ic=function(){return this.f?this.f.presentationTimeline.Ic():null};_.r.getPlaybackRate=function(){if(this.I){var a=this.I;a=a.l?0:a.h}else a=0;return a};
|
|
331
|
+
_.r.setPlaybackRate=function(a,b){if(0===a)this.log.warn("A trick play rate of 0 is unsupported!");else if(this.H===lJ){if(_.wk()){this.log.warn("Pausing and unpausing to mitigate playbackRate platform issue.");var c=this.getSurface().getMedia();c.pause();this.I.set(a,b);c.play()}else this.I.set(a,b);if((c=this.I.getConfiguration())&&c.preferTrickPlayTracks){c=this.a;var d=1<Math.abs(a),e=c.a.get(_.Jg);if(e){var f=e.stream;if(f)if(c.g.debug("setTrickPlay",d),d)(d=f.trickModeVideo)&&!e.uc&&(c.g.debug("Engaging trick mode stream",
|
|
332
|
+
d),_.qI(c,d,!1,0),e.uc=f);else if(f=e.uc)c.g.debug("Restoring non-trick-mode stream",f),e.uc=null,_.qI(c,f,!0,0)}}this.h.playbackRateChanged(a)}};_.r.wd=function(){if(!this.f||!this.B)return[];for(var a=fL(this),b=eL(this),c=[],d=_.v(cL(this)),e=d.next();!e.done;e=d.next()){e=e.value;var f=qH(e);f.activeVideo=e.video===a;f.activeAudio=e.audio===b;c.push(f)}return c};
|
|
333
|
+
_.r.oa=function(){if(this.f&&this.B){var a=BG(this);if(null==a)a=null;else{if(!CG(this.l,a).text){var b=_.uH(a.textStreams,this.be,this.qf,this.Yd);b.length&&(b=b[0],CG(this.l,a).text=b)}a=CG(this.l,a).text}b=[];for(var c=_.v(dL(this)),d=c.next();!d.done;d=c.next()){d=d.value;var e=rH(d);e.activeText=d===a;b.push(e)}return b}return[]};_.r.getPeriods=function(){return this.f.periods};
|
|
334
|
+
_.r.getStats=function(){if(this.H!==lJ)return _.vq();GK(this);var a=this.j;if(a.getVideoPlaybackQuality){a=a.getVideoPlaybackQuality();var b=this.G,c=Number(a.totalVideoFrames);b.o=Number(a.droppedVideoFrames);b.l=c}if(this.H===lJ){(b=BG(this))?(a=CG(this.l,b).video,b=CG(this.l,b).audio,a=(a.bandwidth||0)+(b.bandwidth||0)):a=null;a&&(this.G.w=a);if(a=fL(this))b=this.G,c=a.height||NaN,b.A=a.width||NaN,b.j=c;a=this.h.getBandwidthEstimate();this.G.h=a}return this.G.getStats()};
|
|
335
|
+
_.r.getBandwidthEstimate=function(){return this.h.getBandwidthEstimate()};_.r.getCueTimeline=function(){return this.K};_.r.getTimelineCues=function(){return this.K?OE(this.K,RK(this)):[]};_.r.resetAbr=function(){this.h&&this.h.reset()};_.r.ge=function(){return this.h};
|
|
336
|
+
_.r.addTextTrack=function(a,b,c,d,e,f){var g=this,h,l,m,n,p,q,t,u,y;return _.H(function(A){if(1==A.a){if(g.H!==lJ)throw g.log.error("Must call load() and wait for it to resolve before adding text tracks."),Error("State error!");h=BG(g);l=_.Uq;m=g.f.periods.indexOf(h);n=m+1;p=n>=g.f.periods.length?g.f.presentationTimeline.getDuration():g.f.periods[n].startTime;q=p-h.startTime;if(Infinity===q)throw new _.N(1,4,4040);t=new _.Aj(1,0,q,function(){return[a]},0,null,0);u={id:g.hh++,originalId:null,createSegmentIndex:Promise.resolve.bind(Promise),
|
|
337
|
+
findSegmentPosition:function(){return 1},getSegmentReference:function(B){return 1===B?t:null},adjustSegmentDurations:function(){},getDuration:function(){return q},segmentLookupStrategy:_.kD,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.Af.add(u);h.textStreams.push(u);return _.x(A,lI(g.a,u),
|
|
338
|
+
2)}if(y=_.eI(g.a,_.qj))CG(g.l,h).text=y;g.Af["delete"](u);g.log.debug("Choosing new streams after adding a text stream");YK(g,h);rK(g);return A["return"](rH(u))})};
|
|
339
|
+
_.r.Nk=function(a){this.log.debug(_.oD,a);try{this.log.debug("onChooseStreams_, choosing variant from ",a.variants);this.log.debug("onChooseStreams_, choosing text from ",a.textStreams);var b=aL(this,a);this.log.debug("onChooseStreams_, chose video ",b.video);this.log.debug("onChooseStreams_, chose audio ",b.audio);this.log.debug("onChooseStreams_, chose text ",b.text);return b}catch(c){return this.onError(c),{audio:null,video:null,text:null,eb:null}}};
|
|
340
|
+
_.r.Mk=function(){this.log.debug("canSwitch_");this.ia=!1;this.configuration.abr.enabled&&this.h.enable();this.Ea&&(rI(this.a,this.Ea,this.gh,this.vj),this.Ea=null);this.Y&&(_.qI(this.a,this.Y,!0,0),this.Y=null)};_.r.No=function(){var a=BG(this);a&&a.parser&&a.parser.update()};_.r.Bn=function(){this.B&&this.B.j.yf()};
|
|
341
|
+
_.r.Sj=function(a,b,c){if((void 0===c?"":c)===mD)return rK(this),this.xa()||(this.configuration.abr.enabled=!0,this.h.enable()),YK(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===_.Pc&&(h=h&&l.language===a.language));return h})&&this.xa()){for(var d=_.v(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)}rK(this);this.xa()||(this.configuration.abr.enabled=!0,this.h.enable());
|
|
342
|
+
YK(this,b)}return c};_.r.mn=function(){this.log.debug("endOfStream called by streaming engine");this.te=!0};_.r.onError=function(a){if(this.H!==mK&&7001!==a.code&&7E3!==a.code){var b=new _.K(_.ie,{detail:a});a.severity===_.O&&oJ(this,_.Hq);this.trigger(b);b.defaultPrevented&&(b.a=!0)}};_.r.fg=function(a){a.type===_.be?this.dispatchEvent(a):"largegap"!==a.type&&(a.type===_.Tg?nK(this):"emsg"!==a.type&&(a instanceof _.K?this.dispatchEvent(a):this.log.debug(_.Qb,a.type)))};_.r.xa=function(){return this.configuration.abr.enabled};
|
|
343
|
+
_.r.Do=function(a){var b=this,c,d,e,f,g,h,l,m,n;return _.H(function(p){switch(p.a){case 1:if(!b.dd)return p["return"]();b.log.info("Attempt to switch CDN.");c=b.getLoadedSource();d=b.xa();return _.x(p,b.dd(c.url,a),2);case 2:e=p.f;if(!e)return p["return"]();f=_.L.ua(b.getLoadedSource(),{url:e});d&&b.h.disable();return _.x(p,FI(b.a),3);case 3:g=fL(b),h=eL(b);case 4:return l=!1,_.D(p,7),b.log.info("Switching CDN to "+f.url+"."),_.x(p,gL(b,f,g,h),9);case 9:_.vh(p,6);break;case 7:return m=_.F(p),b.log.info("Switch failed"),
|
|
344
|
+
_.x(p,b.dd(f.url,a),10);case 10:if(n=p.f)f.url=n,l=!0;else throw m;case 6:l?p.D(4):(d&&b.h.enable(),BI(b.a,!0),b.ba[b.getSourceIndex()]=f,a.f=!0,b.trigger(new _.K(_.gd,{newManifest:f.url})),_.z(p))}})};var mK=0,kJ=1,lJ=2,qK=[_.bf,_.ue];hL.prototype.a=function(){return hD};
|
|
345
|
+
hL.prototype.canPlay=function(a,b){if(_.zl())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 _.fv||_.gv(a.url)in _.hv?!0:!1:!1;if(d&&e){if(_.wk(2))return 1;if(_.Al()&&c===_.bm){if(b.streaming.preferNativeHlsOnSafari)return 1;_.Kh("Support for MSE + FairPlay on Apple is experimental. In case of issues, consider using native HLS.")}return 2}return 0};
|
|
346
|
+
hL.prototype.f=function(a){return a===_.qa||a===_.rb};hL.prototype.create=function(){return new mJ};_.Uh(new hL);_.ht(function(){_.Ph("MediaSource.install");if(window.MediaSource)if(window.cast&&cast.__platform__&&cast.__platform__.canDisplayType)_.Oh("Patching Chromecast MSE bugs."),mL();else if(_.Al()){var a=navigator.appVersion;a=0<=a.indexOf("Version")?parseInt(a.match(/Version\/(\d+)/)[1],10):13;kL();10>=a?(_.Oh("Blacklisting MSE on Safari \x3c\x3d 10."),window.MediaSource=null):12>=a?(_.Oh("Patching Safari 11 \x26 12 MSE bugs."),iL(),jL()):(_.Oh("Patching Safari 13 MSE bugs."),iL())}else _.wk(2)||_.wk(3)||
|
|
347
|
+
_.wk(4)?lL():_.Oh("Using native MSE as-is.");else _.Oh("No MSE implementation available.")});_.w(nL,_.cw);_.r=nL.prototype;
|
|
348
|
+
_.r.append=function(a){function b(e){if(e.startTime>=e.endTime)_.Kh("Invalid cue times: "+e.startTime+" - "+e.endTime),e=null;else{var f=e.payload||"";f=f.replace(/<br\s*\/?>/igm,"\n");f=_.Q.Sg(f);f=new VTTCue(e.startTime,e.endTime,f);f.line=-1;try{f.align=_.id}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=_.v(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?
|
|
349
|
+
e.startTime-f.startTime:e.endTime!==f.endTime?e.endTime-f.startTime:c.indexOf(f)-c.indexOf(e)});d=_.v(a);for(a=d.next();!a.done;a=d.next())this.a.addCue(a.value)};_.r.remove=function(a,b){if(!this.a)return!1;oL(this.a,function(c){return c.startTime<b&&c.endTime>a});return!0};_.r.isTextVisible=function(){return this.a.mode===_.Wf};_.r.setTextVisibility=function(a){null!==this.a&&(this.a.mode=a?_.Wf:_.oe)};_.r.destroy=function(){this.a&&oL(this.a,function(){return!0});this.a=null;return Promise.resolve()};pL.prototype.a=function(){return!0};pL.prototype.create=function(a){return new nL(a)};_.mq("single-native",new pL);};
|
|
343
350
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
344
351
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
345
352
|
else{_=this.clpp._;(f.call(g,this));}
|