@castlabs/prestoplay 6.34.0-beta.1 → 6.34.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 +8 -2
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +18 -18
- package/cjs/cl.cast.js +127 -127
- package/cjs/cl.conviva.js +31 -31
- package/cjs/cl.core.js +541 -539
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +100 -100
- package/cjs/cl.externs.js +37 -38
- package/cjs/cl.freewheel.js +26 -26
- package/cjs/cl.hls.js +76 -76
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +25 -25
- package/cjs/cl.mediatailor.js +3 -3
- package/cjs/cl.mse.js +348 -349
- package/cjs/cl.muxdata.js +13 -13
- package/cjs/cl.onboard.js +4 -4
- package/cjs/cl.persistent.js +14 -14
- package/cjs/cl.playlist.js +5 -5
- package/cjs/cl.simid.js +16 -16
- package/cjs/cl.smooth.js +71 -71
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +68 -68
- package/cjs/cl.ttml.js +29 -29
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +11 -11
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.yospace.js +3 -3
- package/cjs/cl.youbora.js +37 -37
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +14 -14
- package/cl.cast.js +98 -98
- package/cl.conviva.js +26 -26
- package/cl.core.js +435 -432
- package/cl.crypto.js +7 -7
- package/cl.dash.js +89 -89
- package/cl.externs.js +37 -38
- package/cl.freewheel.js +20 -20
- package/cl.hls.js +82 -82
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +19 -19
- package/cl.mediatailor.js +2 -2
- package/cl.mse.js +297 -299
- package/cl.muxdata.js +12 -12
- package/cl.onboard.js +5 -5
- package/cl.persistent.js +10 -10
- package/cl.playlist.js +5 -5
- package/cl.simid.js +14 -14
- package/cl.smooth.js +60 -60
- package/cl.thumbnails.js +17 -17
- package/cl.tizen.js +55 -55
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +7 -7
- package/cl.vr.js +14 -14
- package/cl.vtt.js +12 -12
- package/cl.yospace.js +3 -3
- package/cl.youbora.js +30 -30
- package/package.json +1 -1
- package/typings.d.ts +24 -125
package/cjs/cl.mse.js
CHANGED
|
@@ -1,369 +1,368 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
|
|
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
|
-
uC=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,k=d.getMediaPosition,l=d.getPlaybackRate,m=d.getPlayerState,n=d.Md;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())?wC(g):void 0;f=1E3*f().Xa(k());k=["a","v","av"].includes(q)?f:void 0;var A=!1;!a.f||"v"!==q&&"av"!==q||(A=!0,a.f=!1);n=xC(n,q);if(p&&t&&p!==t){var D=p.Ia()[0],
|
|
2
|
+
var f=function(window){var uB,vB,wB,xB,yB,zB,AB,BB,CB,EB,FB,GB,HB,JB,KB,LB,MB,OB,PB,QB,RB,SB,TB,UB,VB,XB,$B,aC,cC,dC,eC,fC,gC,hC,jC,lC,mC,rC,sC,tC,uC,vC,wC,xC,zC,DC,EC,FC,GC,HC,JC,KC,MC,LC,OC,NC,PC,RC,SC,UC,VC,WC,YC,ZC,$C,aD,bD,cD,dD,eD,gD,lD,mD,nD,oD,qD,wD,BD,ED,tD,DD,FD,GD,HD,ID,JD,KD,LD,MD,ND,OD,QD,SD,TD,UD,RD,WD,VD,XD,YD,aE,bE,$D,ZD,cE,gE,fE,hE,eE,dE,jE,iE,kE,lE,mE,pE,qE,tE,uE,wE,xE,vE,yE,BE,zE,AE,CE,DE,EE,FE,GE,HE,IE,KE,LE,ME,OE,PE,NE,QE,RE,SE,TE,UE,VE,WE,XE,YE,$E,cF,dF,hF,fF,gF,lF,kF,mF,qF,oF,sF,uF,tF,wF,xF,yF,AF,
|
|
3
|
+
zF,BF,CF,DF,EF,HF,GF,JF,vF,KF,IF,LF,FF,RF,SF,OF,MF,PF,QF,TF,UF,XF,WF,YF,ZF,$F,NF,aG,VF,dG,gG,fG,eG,hG,iG,kG,jG,lG,jF,mG,nG,qG,oG,pG,sG,rG,tG,uG,vG,yG,AG,zG,BG,CG,DG,EG,HG,GG,FG,JG,IG,LG,PG,RG,SG,XG,$G,aH,cH,dH,fH,gH,iH,mH,lH,MG,nH,qH,rH,sH,uH,vH,bH,zH,eH,hH,VG,CH,BH,TG,kH,FH,DH,xH,yH,HH,GH,EH,OH,PH,JH,RH,TH,LH,VH,UH,MH,NH,WH,UG,wH,XH,YH,KH,SH,aI,$H,ZH,tH,WG,YG,OG,IH,ZG,AH,QH,oH,pH,bI,eI,fI,gI,hI,iI,jI,mI,nI,lI,tI,uI,CI,vI,kI,BI,DI,wI,xI,yI,II,EI,rI,qI,pI,sI,GI,HI,zI,AI,TI,RI,MI,WI,XI,YI,cJ,$I,bF,
|
|
4
|
+
ZE,HJ,GJ,eF,aF,jJ,JJ,iJ,IJ,gJ,KJ,SI,LJ,QI,bJ,kJ,hJ,NJ,aJ,eJ,KI,dJ,PI,PJ,OJ,QJ,RJ,UJ,VI,OI,TJ,SJ,FI,MJ,WJ,XJ,iF,YJ,ZJ,VJ,oI,$J,LI,ZI,UI,aK,bK,cK,dK,eK,fK,gK,hK,iK,nC;uB=" buffer";vB=" is being or has been set up";wB=" seconds";xB="\x3c/DATA\x3e\x3c/WRMHEADER\x3e";yB="\x3c/LA_URL\x3e";zB="\x3cLA_URL\x3e";AB='\x3cWRMHEADER xmlns\x3d"http://schemas.microsoft.com/DRM/2007/03/PlayReadyHeader" version\x3d"';BB="Cannot get segment, period ID unknown";CB="Choosing new streams after key status change";
|
|
5
|
+
_.DB="Could not load text stream with id: ";EB="IterateSegmentReference";FB="Jumping forward";GB="MediaSource threw QuotaExceededError:";HB="Period not found.";_.IB="Player is in ERROR state and can not switch to ";JB="PrestoPlay TextTrack";KB="Removing audio from variant - audio not compatible with platform";LB="Setting playback rate to\x3d";MB="URI-REPLACEMENT";_.NB="Updating manifest...";OB="X-Playback-Session-Id";PB="bufferBehind\x3d";QB="bufferedBehind\x3d";RB="cannot find segment";SB="clpp.mse.Player";
|
|
6
|
+
TB="content-steering-change";UB="content-steering-location-ban-update";VB="currentPeriod.startTime\x3d";_.WB="dashif:Laurl";XB="fetching init segment";_.YB="getSegmentNextReference";_.ZB="iterateSegmentReference";$B="key-restriction";aC="manifest.start";_.bC="onChooseStreams_ period";cC="presentationTime:";dC="presentationTime\x3d";eC="reference.endTime\x3d";fC="reference.position\x3d";gC="reference.startTime\x3d";hC="single-native";_.iC="subtitles";jC="switch: Stream ";
|
|
7
|
+
_.kC=function(a,b){return _.gh[a]=b};lC=function(a,b){a.a=a.a.filter(function(c){return c!==b})};mC=function(a){for(var b=a.a+a.f.byteOffset,c=void 0;_.Ln(a);)if(0===_.Nn(a)){c=a.a+a.f.byteOffset-1;break}a=a.f.buffer.slice(b,c);return _.S.ga(a)};_.oC=function(a){var b=new Uint8Array(nC),c=4+b.byteLength+a.j.byteLength+4+a.f.byteLength,d=new _.Hn(c,!1);_.V(d,c);_.Jn(d,b);_.Jn(d,a.j);_.V(d,a.f.byteLength);_.Jn(d,a.f);return _.Vi(d.buffer)};
|
|
8
|
+
_.pC=function(a,b,c,d){var e=_.Kl(b);if(8!==e.byteLength)e="";else{var f=_.lp(e);e=_.Hl(f);b:switch(f=f.byteLength,_.Ph("Trying to create PlayReady header in version",a),a){case "4.0.0.0":e=[AB+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?zB+d+yB:"",xB].join("");break b;case "4.1.0.0":e=[AB+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?zB+d+yB:"",xB].join("");break b;case "4.2.0.0":case "4.3.0.0":e=[AB+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?zB+d+yB:"",xB].join("");break b;default:_.Kh("Cannot create PlayReady header in version",a),e=""}}if(!e)return null;_.Ph("New payload",e);e=_.Vi(_.S.eg(e,!0));return new _.hp(_.mp,
|
|
10
|
+
b,d||null,e,a,c)};_.qC=function(a,b){return b===a.version?a:_.pC(b,a.a,a.l||void 0,a.h||void 0)};rC=function(a,b){if(_.ri("Edge/"))return!0;b=b.toLowerCase();if(_.si()&&b.includes('codecs\x3d"ac-3"')){var c=b.replace("ac-3",_.ge);return a.K.has(b)||a.K.has(c)}return a.K.has(b)};
|
|
11
|
+
sC=function(a,b){var c=b.audio,d=b.video;if(c&&c.encrypted&&(c=_.Zp(c),!rC(a,c))||d&&d.encrypted&&(d=_.Zp(d),!rC(a,d)))return!1;var e=a.keySystem();return 0===b.drmInfos.length||b.drmInfos.some(function(f){return f.keySystem===e})};tC=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}))};uC=function(a,b){if(null==a.a)return null;var c=a.a[a.a.length-1];return c?c[b]:null};
|
|
12
|
+
vC=function(a){a=uC(a,_.Dw);return null==a?null:a};wC=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.jc()+d.getDuration();)c+=1,d=a.a[c]||null;a.f=d?c:a.a.length-1}else a.f=-1};xC=function(a){return 1001===a||1002===a||1003===a};_.yC=function(a,b){return a.concat(b)};zC=function(){};_.AC=function(a,b){return 0===b.length?a:a.map(function(c){return b.map(function(d){return _.gk(d,c)})}).reduce(_.yC,[])};
|
|
13
|
+
_.BC=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:b||[],keyIds:[],periodId:c?c:null}};_.CC=function(a,b,c,d,e,f,g){f=void 0===f?function(){return""}:f;this.Ia=a;this.la=b;this.fa=c;this.keyInfo=d||null;this.Fd=_.N.R(e)?!1:!!e;this.Kd=f?f:function(){return""};this.Oa=g};
|
|
14
|
+
DC=function(a){return a.language?_.Hk(a.language):a.audio&&a.audio.language?_.Hk(a.audio.language):a.video&&a.video.language?_.Hk(a.video.language):_.zg};EC=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};FC=function(a,b){var c=_.Gm(b,a);if(!c)return!1;c=c();var d=c.isMuxed(a,b);c.destroy();return d};
|
|
15
|
+
GC=function(a){function b(d,e){null!=d&&c.push(e+'\x3d"'+String(d).trim()+'"')}var c=[a.mimeType];b(a.codecs,_.Cd);b(a.frameRate,"framerate");b(a.bandwidth,"bitrate");b(a.width,_.ah);b(a.height,_.qe);b(a.channelsCount,"channels");return c.join(";").replace(/\s/g,"")};HC=function(a){return a.split(",").map(function(b){return b.trim()}).filter(function(b){return 0<b.length})};
|
|
16
|
+
_.IC=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(",")};JC=function(a,b){var c=_.IC(_.Jm(a)),d=_.Im(a),e=_.IC(_.Jm(b));return d===_.Im(b)&&c===e};
|
|
17
|
+
KC=function(a){function b(y){return 100*c(y/100)}function c(y){return Math.round(y)}for(var d={br:c,d:c,bl:b,dl:b,mtp:b,nor:function(y){return encodeURIComponent(y)},rtp:b,tb:c,oq:c,pq:c},e=["nor","nrr","sid","cid"],f=["ot","sf","st"],g=["mtp"],k={},l=_.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"]})),m=l.next();!m.done;m=l.next()){var n=_.v(m.value);m=n.next().value;var p=n.next().value;n=[];p=_.v(p);
|
|
18
|
+
for(var q=p.next();!q.done;q=p.next()){q=q.value;var t=a[q];if(void 0!==t&&null!==t){var u=d[q];u&&(t=u(t));u=q+"\x3d"+t;g.includes(q)&&0===t&&(u="");f.includes(q)?u=q+"\x3d"+t:e.includes(q)?u=q+'\x3d"'+t+'"':typeof t===_.bd&&(u=t?""+q:"");u&&n.push(u)}}0<n.length&&(k[m]=n.join(","))}return k};MC=function(a,b,c){this.h=a;this.a=b;this.g=new _.L("clpp.net.CmcdManager");this.j=LC(this);this.h.a.push(this.j);this.l=c;this.f=!1};
|
|
19
|
+
LC=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,k=d.getMediaPosition,l=d.getPlaybackRate,m=d.getPlayerState,n=d.Md;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())?NC(g):void 0;f=1E3*f().Ya(k());k=["a","v","av"].includes(q)?f:void 0;var A=!1;!a.f||"v"!==q&&"av"!==q||(A=!0,a.f=!1);n=OC(n,q);if(p&&t&&p!==t){var D=p.Ia()[0],
|
|
21
20
|
B=t.Ia()[0];var E=new URL(B);D=new URL(D);if(E.origin!==D.origin)E=B;else{B=E.pathname.split("/").slice(1);for(D=D.pathname.split("/").slice(1,-1);B[0]===D[0];)B.shift(),D.shift();for(;D.length;)D.shift(),B.unshift("..");E=B.join("/")+E.search+E.hash}}else E=void 0;p&&t&&(t.la||t.fa)&&(p.la!==t.la||p.fa!==t.fa)?(B=t.la+"-",t.fa&&(B+=t.fa),t=B):t=void 0;a:{if(p&&d&&(B=d.bandwidth)){B=B*(p.endTime-p.startTime)/1E3/((f/1E3||500)/(y||1)/1E3);B=a.a.rtpMultiplier?B*a.a.rtpMultiplier:B;break a}B=void 0}(D=
|
|
22
|
-
a.a.contentId)&&64<D.length&&(a.g.warn("CMCD contentId: "+D+" is longer than 64 characters,\n it will be ignored.\n Refer to the CMCD spec for more details."),D=void 0);d=Object.assign({},d&&{br:d.bandwidth},p&&{d:p.endTime-p.startTime},q&&{ot:q},n&&{tb:n},k&&{bl:k},{dl:f/y},e&&{mtp:e/1E3},E&&{nor:E},t&&{nrr:t},{su:6===m},D&&{cid:D},1!==l&&{pr:l},g&&{sf:g},{sid:a.a.sessionId},u&&{st:u},1!==a.a.version&&{v:a.a.version},{bs:A},B&&{rtp:B});if("query"===a.a.deliveryMode){if(d=
|
|
23
|
-
(d=Object.values(d).join(","))&&b.uris)for(p=0;p<b.uris.length;p++)q=new _.bk(b.uris[p]),q.a.searchParams.set("CMCD",d),b.uris[p]=q.toString()}else{p=
|
|
24
|
-
|
|
25
|
-
_.
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
a.a.contentId)&&64<D.length&&(a.g.warn("CMCD contentId: "+D+" is longer than 64 characters,\n it will be ignored.\n Refer to the CMCD spec for more details."),D=void 0);d=Object.assign({},d&&{br:d.bandwidth},p&&{d:p.endTime-p.startTime},q&&{ot:q},n&&{tb:n},k&&{bl:k},{dl:f/y},e&&{mtp:e/1E3},E&&{nor:E},t&&{nrr:t},{su:6===m},D&&{cid:D},1!==l&&{pr:l},g&&{sf:g},{sid:a.a.sessionId},u&&{st:u},1!==a.a.version&&{v:a.a.version},{bs:A},B&&{rtp:B});if("query"===a.a.deliveryMode){if(d=KC(d),
|
|
22
|
+
(d=Object.values(d).join(","))&&b.uris)for(p=0;p<b.uris.length;p++)q=new _.bk(b.uris[p]),q.a.searchParams.set("CMCD",d),b.uris[p]=q.toString()}else{p=KC(d);d={};p=_.v(Object.entries(p));for(q=p.next();!q.done;q=p.next())u=_.v(q.value),q=u.next().value,u=u.next().value,d["CMCD-"+q]=u;b.headers=Object.assign({},b.headers||{},d)}return Promise.resolve(b)}};
|
|
23
|
+
OC=function(a,b){var c=a();if(0!==c.length)switch(c=c.reduce(function(d,e){return d&&d.bandwidth>e.bandwidth?d:e}),b){case "a":return c.pf||void 0;case "v":return c.fg||void 0;default:return c.bandwidth}};NC=function(a){switch(a.type){case _.Jc:return"d";case _.Xm:return"h";case _.Pc:return"s";default:return"o"}};PC=function(a,b){for(var c=new _.nn(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};
|
|
24
|
+
_.QC=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};
|
|
25
|
+
RC=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}})};
|
|
26
|
+
SC=function(a){function b(k,l){return new _.QC(void 0===l?_.ea:l,k,{},[],null,g)}function c(k){k=void 0===k?"":k;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(k,m))throw k=a.substring(0,e).split("\n"),Error("Unexpected close tag\nLine: "+(k.length-1)+"\nColumn: "+(k[k.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==
|
|
28
27
|
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,
|
|
29
|
-
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 _.
|
|
30
|
-
null,p,q,n,g))}else m=e,e=a.indexOf("\x3c",e)-1,-2===e&&(e=f),m=
|
|
31
|
-
|
|
32
|
-
_.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
_.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
g.get(f).get(k),a.o.get(f).set(k,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))};_.
|
|
41
|
-
_.
|
|
42
|
-
_.
|
|
43
|
-
_.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
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>=
|
|
54
|
-
g),a.B=!0,a.a.currentTime=g)}}}};
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
this.o=(new _.Yh(function(){if(0!==k.h.readyState&&!k.h.paused){var l=k.f.getTime(),m=
|
|
58
|
-
|
|
28
|
+
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 _.QC(m,
|
|
29
|
+
null,p,q,n,g))}else m=e,e=a.indexOf("\x3c",e)-1,-2===e&&(e=f),m=RC(a.slice(m,e+1)).trim(),0<m.length&&l.push(b(m)),e++;return l}function d(){for(var k=e;-1==="\r\n\t\x3e/\x3d ".indexOf(a[e])&&a[e];)e++;return a.slice(k,e)}var e=0,f=a.length,g=new Map;return new _.QC("#document",null,{},c(""),null,g)};_.TC=function(){};
|
|
30
|
+
UC=function(a){switch(a){case _.wn:_.Cw.info("Select DOM parser for XML");_.ip=new _.bp;break;case "txml":_.Cw.info("Select TXML parser for XML");_.ip=new _.TC;break;default:_.Cw.warn("XML parser option unknown, using default DOM parser. Option: "+a),_.ip=new _.bp}};VC=function(){return!!window.SourceBuffer&&!!SourceBuffer.prototype&&!!SourceBuffer.prototype.changeType};WC=function(a,b){return a.start-b.start};
|
|
31
|
+
_.XC=function(a){this.h=void 0===a?null:a;this.log=new _.L("clpp.renditions");this.S=[];this.f=this.player=null;this.a=!1};YC=function(a){return a.S.map(function(b){return{start:b.start,end:b.end,width:b.width,height:b.height,bandwidth:b.bandwidth,rendition:b.rendition}})};ZC=function(a){a.player&&(a.player.off(_.Qf,a.Bd),a.a&&a.player.off(_.ug,a.Bd));a.player=null};$C=function(a){a.player&&a.player.trigger(new _.R(_.Yc))};
|
|
32
|
+
aD=function(a){if(a.player){for(var b=!1,c={},d=0;d<a.S.length;d++){var e=a.S[d],f=e.width+"x"+e.height,g=c[f];if(g&&g!==e.bandwidth){b=!0;break}c[f]=e.bandwidth}b&&!a.a?(a.log.debug("Tracking timeupdates"),a.player.on(_.ug,a.Bd,a),a.a=!0):!b&&a.a&&(a.log.debug("Stop tracking timeupdates"),a.player.off(_.ug,a.Bd),a.a=!1)}};bD=function(a,b,c){a.S=a.S.filter(function(d){if(d.end<=b||d.start>=c)return!1;d.start=Math.max(d.start,b);d.end=Math.min(d.end,c);return!0});a.player&&a.player.trigger(new _.R(_.Pg))};
|
|
33
|
+
cD=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};dD=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};eD=function(a,b){for(var c=0;c<a.length;c++)if(dD(a[c]).has(b))return c;return-1};
|
|
34
|
+
gD=function(a,b){Array.from(dD(a)).forEach(function(c){c.segmentIndex&&_.fD(c.segmentIndex,b)})};_.hD=function(a){this.h=Math.exp(Math.log(.5)/a);this.f=this.a=0};_.iD=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)};_.jD=function(a){return a.a/(1-Math.pow(a.h,a.f))};
|
|
35
|
+
_.kD=function(a,b,c,d,e,f,g,k){a=_.Vk(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);k&&(a.timescale=k);return a};lD=function(a,b){this.w=null;this.D=a;this.h=b;this.j=this.A=0;this.l=Infinity;this.f=this.a=null;this.B="";this.o=new Map};
|
|
36
|
+
mD=function(a,b,c,d){return Promise.resolve().then(function(){if(a.w&&a.h)if(null==c||null==d)a.w.parseInit(_.Vi(b));else{var e={periodStart:a.A,segmentStart:c,segmentEnd:d};e=a.w.parseMedia(_.Vi(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)}})};
|
|
37
|
+
nD=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,[])};
|
|
38
|
+
oD=function(a,b,c,d,e){var f=c+" "+d,g=new Map;b=_.v(b);for(var k=b.next();!k.done;k=b.next()){var l=k.value;k=l.stream;g.has(k)||g.set(k,new Map);g.get(k).has(f)||g.get(k).set(f,[]);l.startTime+=e;l.endTime+=e;l.startTime>=a.j&&l.startTime<a.l&&(l=new _.Qj(l.startTime,l.endTime,l.text),g.get(k).get(f).push(l),k===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()),k=b.next();!k.done;k=b.next())k=k.value,l=
|
|
39
|
+
g.get(f).get(k),a.o.get(f).set(k,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))};_.pD=function(a){a=a.toLowerCase();return _.Bv[a]||window.muxjs&&a===_.Ic?!0:!1};qD=function(a){this.a=this.h=0;this.f=a};_.rD=function(a,b,c){a.h=b;a.a=c};
|
|
40
|
+
_.sD=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.w=this.l=null;this.I=0;this.D=this.o=d;this.M=void 0===e?!0:e;this.g=new _.L("clpp.media.PresentationTimeline");this.P=f;this.L=null;this.a=new qD(d);this.J=null;this.B=this.j.type||null};_.uD=function(a,b){a.L={offsetDateTime:b-tD(a),seekRangeStartDateTime:b}};_.vD=function(a,b){a.o=b;a.D=b;a.a.f=b};wD=function(a){return 2===a.j.version?a.a.f?a.a.a:null:a.o?a.f:a.D?a.w:null};
|
|
41
|
+
_.yD=function(a,b,c){if(0!==b.length){var d=b[0].startTime+c;c=b[b.length-1].endTime+c;b=b.reduce(function(e,f){return Math.max(e,f.endTime-f.startTime)},a.h);_.xD(a,{Fc:d,nc:c,oc:b},"notifySegments")}};_.xD=function(a,b,c){var d=b.Fc;a.l=null==a.l?d:Math.min(a.l,d);a.h=Math.max(a.h,b.oc);_.zD(a,b.nc);null!=a.G&&a.M&&(a.G=(Date.now()+a.I)/1E3-(a.w||0)-a.h);a.g.debug(c+": maxSegmentDuration\x3d"+a.h)};_.zD=function(a,b){a.w=Math.max(a.w||0,b)};
|
|
42
|
+
_.AD=function(a,b){a.h=Math.max(a.h,b);a.g.debug("notifyNewSegmentDuration: maxSegmentDuration\x3d"+a.h)};_.CD=function(a){return 2===a.j.version?a.a.jc():Infinity===a.A?0:Math.max(0,BD(a)-a.A)};BD=function(a){if(2===a.j.version)a=a.a.a;else if(a.o)a=a.f;else if(a.D)a=a.w||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};
|
|
43
|
+
ED=function(a,b){if(2===a.j.version)return a.a.jc();var c=Math.max(a.l,0);return Infinity===a.A?Math.ceil(1E3*c)/1E3:Math.max(c,Math.min(BD(a)-a.A+b,DD(a)))};tD=function(a){return 2===a.j.version?a.a.jc():ED(a,0)};DD=function(a){var b=a.Ie()&&!a.D?a.K:0;return 2===a.j.version?a.a.a-b:Math.max(0,BD(a)-b)};FD=function(a,b){var c=tD(a);if(b<c)return c;c=DD(a);2===a.j.version&&(c=a.a.a);return b>c?c:b};
|
|
44
|
+
GD=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}};HD=function(){this.f=function(){};this.h=function(){};this.a=new Set};ID=function(a,b,c){a.f=b;a.h=c};
|
|
45
|
+
JD=function(a,b){for(var c=[],d=!1,e={},f=_.v(b),g=f.next();!g.done;e={pd:e.pd},g=f.next())e.pd=g.value,a.a.has(e.pd)||(c.push(e.pd),g=Array.from(a.a.values()).some(function(k){return function(l){return l.id===k.pd.id}}(e)),e.pd.id&&g&&(d=!0));e=a.a.size;a.a.clear();b.forEach(function(k){return a.a.add(k)});f=a.a.size;c.forEach(function(k){return a.f(k)});(d||0<c.length||e!==f)&&a.h()};
|
|
46
|
+
KD=function(a,b){b=void 0===b?!1:b;return Array.from(a.a.values()).map(function(c){return GD(c,b)}).sort(function(c,d){return c.startTime-d.startTime})};LD=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 _.aw("crop",a,d.endTime?d.endTime-a:Infinity,!1))};MD=function(a){var b=a.a.Ci(),c=a.h,d=b?b.id:null;(c?c.id:null)!==d&&b&&a.f(new _.R(_.Tf,{id:d}));a.h=b;"basic"===a.o.timeline&&(a.j.a=b)};
|
|
47
|
+
ND=function(a,b,c){this.h=a;this.a=b;this.f=c;this.g=new _.L("clpp.media.SegmentIterator")};OD=function(a){var b=a.h.get(a.a);if(!b)return null;0<b.a.length&&b.Ia().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};_.PD=function(a){this.a=a;this.g=new _.L("clpp.media.SegmentIndex")};
|
|
48
|
+
QD=function(a,b){var c=a.vf(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 ND(a,c,e)};_.fD=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)};
|
|
49
|
+
SD=function(a,b){this.h=a;this.l=RD(a);this.a=a.a.currentTime;this.j=Date.now()/1E3;this.o=b;this.f=function(){}};TD=function(a,b){a.f=b};UD=function(a){this.a=a};RD=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};
|
|
50
|
+
WD=function(a,b,c,d,e){var f=this;this.a=a;this.H=b;this.h=c;this.G=e;this.j=new _.ki;this.D=!1;this.J=a.readyState;this.l=!1;this.f=d;this.B=this.o=this.I=this.A=!1;this.j.on(a,_.Ug,function(){return VD(f)});this.w=(new _.Yh(function(){VD(f)})).Qb(.25)};
|
|
51
|
+
VD=function(a){if(0!==a.a.readyState){if(a.a.seeking){if(!a.D)return}else a.D=!1;if(!a.a.paused&&!a.o){a.a.readyState!==a.J&&(a.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 _.nn(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 k=0;k<f.length;k++)if(f.start(k)>c&&(0===k||f.end(k-1)-c<=g)){f=k;break a}f=null}if(null==f){if(a.f){a=a.f;d=a.h;c=RD(d);d=d.a.currentTime;
|
|
52
|
+
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>=DD(a.H)))){k=g-c;b=k<=b;var l=!1;k<e||(b||a.l||(a.l=!0,e=new _.R("largegap",{detail:{currentTime:c,gapSize:k}}),e.cancelable=!0,a.G(e),a.h.jumpLargeGaps&&!e.defaultPrevented?l=!0:_.Oh("Ignoring large gap at",c,"size",k)),!b&&!l)||(0===f?_.Oh(FB,k,"seconds because of gap before start time of",g):_.Oh(FB,k,"seconds because of gap starting at",d.end(f-1),"and ending at",
|
|
53
|
+
g),a.B=!0,a.a.currentTime=g)}}}};XD=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--)})};YD=function(a,b){a.h=a.f.currentTime;a.l=b;a.j=a.o;a.f.currentTime=b;a.a.Qb(.1)};aE=function(a,b,c,d){this.a=a;this.j=b;this.o=d;this.A=c;this.l=!1;this.f=new _.ki;this.h=new XD(a);this.w=!1;0<a.readyState?ZD(this,c):$D(this,c)};
|
|
54
|
+
bE=function(a,b){0<a.a.readyState?YD(a.h,b):$D(a,b)};$D=function(a,b){a.A=b;a.f.off(a.a,_.Fe);a.f.one(a.a,_.Fe,function(){ZD(a,b)})};ZD=function(a,b){a.w||(a.w=!0,a.o&&a.o());.001>Math.abs(a.a.currentTime-b)?cE(a):(a.f.one(a.a,_.Xf,function(){cE(a)}),YD(a.h,0===a.a.currentTime?b:a.a.currentTime))};cE=function(a){_.ti()&&79===_.Qi().major&&!a.l&&a.j();a.l=!0;a.f.on(a.a,_.Xf,function(){return a.j()})};
|
|
55
|
+
gE=function(a,b,c,d,e,f,g){var k=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 WD(a,b.presentationTimeline,c,dE(this,a,c),f);this.f=new aE(a,function(){a:{var l=k.j;var m=l.B;l.B=!1;l.D=!0;l.A=!1;l.l=!1;l=k.f.getTime();var n=eE(k,l);if(Math.abs(n-l)>k.l.gapTolerance){var p=(new Date).getTime()/1E3;if(!k.w||k.w<p-1){k.w=p;bE(k.f,n);m=void 0;break a}}k.g.debug("Seek to "+l);k.A(m?1:0);m=void 0}return m},fE(this,d,g),function(){k.j.I=!0});
|
|
56
|
+
this.o=(new _.Yh(function(){if(0!==k.h.readyState&&!k.h.paused){var l=k.f.getTime(),m=tD(k.a),n=DD(k.a);3>n-m&&(m=n-3);l<m&&(m=eE(k,l),k.g.info("Jumping forward "+(m-l)+" seconds to catch up with the seek range."),k.h.currentTime=m)}})).Qb(.25);this.g=new _.L("clpp.mse.Playhead")};fE=function(a,b,c){null==b?b=Infinity>a.a.getDuration()||c?tD(a.a):DD(a.a):0>b&&(b=DD(a.a)+b);return hE(a,FD(a.a,b))};hE=function(a,b){var c=a.a.getDuration();return b>=c?c-a.l.durationBackoff:b};
|
|
57
|
+
eE=function(a,b){if("startover"===a.a.$c())return b;var c=new _.nn(a.h.buffered);c=c.Ec.bind(c);var d=Math.max(a.B,a.l.rebufferingGoal),e=a.l.safeSeekOffset,f=tD(a.a),g=DD(a.a),k=a.a.getDuration();3>g-f&&(f=g-3);var l=ED(a.a,d),m=ED(a.a,e);d=ED(a.a,d+e);if(b>=k)return a.g.debug("Playhead past duration."),hE(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");
|
|
59
58
|
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};
|
|
60
|
-
|
|
61
|
-
k.start(l+1)-f;break a}k=null}k&&(e=Math.min(k+.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};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
_.
|
|
65
|
-
_.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
{},g=_.v(a.h.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if(g=parseInt(f.headers["retry-after"],10))a.g.info("Will retry after "+g+" s based on Retry-After header."),a.f=g;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
(b=new URL(b.uri),b.hostname=a.fc[
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
[];return c};
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
d=
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
l.zc})})||null}}else f=d.Md().find(function(l){return l.uc===parseInt(b.id,10)})||null;f?(a.f.set(_.
|
|
89
|
-
|
|
90
|
-
_.z(f)}})};
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
b.push(e),c.active&&a.a.set(_.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
c.video.buffer))),l=Promise.all(f)):(f&&window.muxjs&&(a.f||
|
|
103
|
-
null!==d&&null!==e&&k){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.D.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.T&&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=
|
|
104
|
-
Promise.all([q,t])}null!==d&&null!==e&&(a.G[b]=!0)})["catch"](function(q){throw q;})};
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
m);_.zh(p);break;case 5:return n=_.H(p),p["return"](Promise.reject(new _.O(_.Q,3,3015,{mediaError:n})))}})};
|
|
109
|
-
|
|
110
|
-
b.length;c={
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
"variant.video",
|
|
118
|
-
|
|
119
|
-
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:k,codecs:f.join(", "),audioCodec:d,
|
|
120
|
-
!!c.trickPlay,a.fg=c.bandwidth||null);b&&(a.zc=b.id,a
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
_.
|
|
124
|
-
e.filter(function(k){return 0===k.roles.length}),b.length)return b;b=e.map(function(k){return k.roles}).reduce(_.
|
|
125
|
-
|
|
126
|
-
_.
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
59
|
+
dE=function(a,b,c){if(!c.stallEnabled)return null;var d=c.gapDetectionThreshold,e=c.stallSkip;c=new SD(new UD(b),c.stallThreshold);TD(c,function(f,g){a.g.warn("Stall detected at "+f+" for "+g+" seconds.");if(e){var k=new _.nn(b.buffered),l;if(l=_.ri("Edge/")||_.si()||_.ti()&&79===_.Qi().major)a:{if(k.length&&!(1>=k.length))for(l=0;l<k.length-1;l++)if(f>k.start(l)&&f<k.end(l)){l=k.start(l+1)-k.end(l)>=d;break a}l=!1}if(l){a:{if(k.length&&!(1>=k.length))for(l=0;l<k.length-1;l++)if(f>k.start(l)&&f<k.end(l)){k=
|
|
60
|
+
k.start(l+1)-f;break a}k=null}k&&(e=Math.min(k+.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};jE=function(a){var b=this;this.f=a;this.a=new Set;this.h=(new _.Yh(function(){iE(b,!1)})).Qb(.25)};iE=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)};
|
|
61
|
+
kE=function(a,b){var c=a.offset||0;return b<a.startTime+c?1:b>a.endTime+c?3:2};
|
|
62
|
+
lE=function(a){var b=this;this.j=a;this.o=new Map;this.a=function(){};this.f=function(){};this.h=function(){};this.w=[{nd:null,md:2,cd:function(c,d){return b.a(c,d)}},{nd:1,md:2,cd:function(c,d){return b.a(c,d)}},{nd:3,md:2,cd:function(c,d){return b.a(c,d)}},{nd:2,md:1,cd:function(c,d){return b.f(c,d)}},{nd:2,md:3,cd:function(c,d){return b.f(c,d)}},{nd:1,md:3,cd:function(c,d){return b.h(c,d)}},{nd:3,md:1,cd:function(c,d){return b.h(c,d)}}]};mE=function(a,b,c,d){a.a=b;a.f=c;a.h=d};
|
|
63
|
+
_.nE=function(a){_.fw[a]&&delete _.fw[a]};_.oE=function(a){_.ew[a]&&delete _.ew[a]};pE=function(){this.f=new _.hD(2);this.h=new _.hD(5);this.a=0};qE=function(a,b,c){if(!(16E3>c)){var d=8E3*c/b;b/=1E3;a.a+=c;_.iD(a.f,b,d);_.iD(a.h,b,d)}};_.rE=function(a,b){this.id=a;this.pa=b};
|
|
64
|
+
_.sE=function(a,b){return a.pa.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()})};tE=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};
|
|
65
|
+
uE=function(a,b){_.qn.call(this);this.A=a;this.h=null;this.B=b;this.D=new _.ll;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 _.L("clpp.net.ContentSteeringManager")};
|
|
66
|
+
wE=function(a,b){return _.I(function(c){null!=a.a&&(a.a.stop(),a.a=null);a.o.clear();a.l.clear();a.j.clear();a.w.clear();a.g.debug("contentSteeringServerUri: "+b.contentSteeringServerUri);a.g.info("queryBeforeStart: "+b.queryBeforeStart);a.h={manifestType:b.manifestType,contentSteeringServerUri:b.contentSteeringServerUri,queryBeforeStart:b.queryBeforeStart,li:b.defaultServiceLocation?b.defaultServiceLocation.split(","):[]};b.baseUriCollections.forEach(function(d){var e=[];if(a.h.li.length)for(var f=
|
|
67
|
+
{},g=_.v(a.h.li),k=g.next();!k.done;f={jf:f.jf},k=g.next())f.jf=k.value,(k=d.pa.find(function(l){return function(m){return m.serviceLocationId===l.jf}}(f)))?e.push(k):a.g.warn("setManifestConfig: could not get default location:","pathwayId: "+f.jf+" processedLocations:",e);e.length?a.l.set(d.id,e):a.l.set(d.id,d.pa);a.o.set(d.id,d.pa)});if(b.contentSteeringServerUri){if(a.h.queryBeforeStart)return c["return"](vE(a));a.g.info("defaultServiceLocations: "+b.defaultServiceLocation);vE(a)}_.z(c)})};
|
|
68
|
+
xE=function(a,b){var c=a.j.get(b);c||(c={ge:0,Oh:new pE,bg:!1},a.j.set(b,c));return c};
|
|
69
|
+
vE=function(a,b){var c,d,e,f,g,k,l;return _.I(function(m){if(1==m.a)return b=b||a.h.contentSteeringServerUri,c=yE(a,b),a.g.info("Sending request to content steering server, URI: "+c),d=_.Vk(c,a.A.attemptParameters),d.type=7,e=a.B.fetch(d),_.nl(a.D,e),_.x(m,e.U,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).");
|
|
70
|
+
if(g=parseInt(f.headers["retry-after"],10))a.g.info("Will retry after "+g+" s based on Retry-After header."),a.f=g;zE(a,a.f)}else try{k=_.S.ga(f.data),l=JSON.parse(k),1===l.VERSION?AE(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(){vE(a)});zE(a,a.f)}_.z(m)})};
|
|
71
|
+
yE=function(a,b){var c=new URL(b),d=[],e=[];a.j.forEach(function(f,g){f.bg&&(d.push(g),e.push(parseInt(f.Oh.getBandwidthEstimate(1E4),10)));f.bg=!1});d.length?a.h.manifestType===_.Jc?(c.searchParams.set("_DASH_pathway",'"'+d.toString()+'"'),c.searchParams.set("_DASH_throughput",e.toString())):a.h.manifestType===_.Xm&&(c.searchParams.set("_HLS_pathway",'"'+d.toString()+'"'),c.searchParams.set("_HLS_throughput",e.toString())):a.g.debug("addQueryParams_: serviceLocations EMPTY");return c.toString()};
|
|
72
|
+
BE=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={ce:a.ce,fc:a.fc,Yd:a.Yd},b=c.next())if(a.ce=b.value,b=f.find(function(g){return function(k){return k.serviceLocationId===g.ce}}(a)))e.push(b);else if(a.fc=d.find(function(g){return function(k){return k.ID===g.ce}}(a)),a.fc&&(b=f.find(function(g){return function(k){return k.serviceLocationId===g.fc["BASE-ID"]}}(a))))a.Yd={serviceLocationId:a.ce,uri:b.uri,params:{}},a.fc[MB]&&(a.fc[MB].HOST&&
|
|
73
|
+
(b=new URL(b.uri),b.hostname=a.fc[MB].HOST,a.Yd.uri=b.toString()),a.fc[MB].PARAMS&&Object.entries(a.fc[MB].PARAMS).forEach(function(g){return function(k){var l=_.v(k);k=l.next().value;l=l.next().value;g.Yd.params[k]=l}}(a))),e.push(a.Yd);return e};zE=function(a,b){a.g.info("Scheduling next steering manifest update in "+b+" s.");a.a.ia(b)};
|
|
74
|
+
AE=function(a,b,c){null!=a.a&&(a.a.stop(),a.a=null);var d=b["RELOAD-URI"]||c;a.a=new _.Yh(function(){vE(a,d)});if(c=b.TTL)a.f=c;zE(a,a.f);var e=b["PATHWAY-PRIORITY"]||[],f=b["PATHWAY-CLONES"]||[];a.j.forEach(function(g,k){e.includes(k)||a.j["delete"](k)});a.o.forEach(function(g,k){var l=BE(a,k,e,f);a.l.set(k,l)})};
|
|
75
|
+
CE=function(a,b){var c=String(_.sw++);c=new _.em(c,a);c.mimeType=_.fm(b.mimeType);if(a===_.gm||a===_.hm)c.label=_.fm(b.label),c.language=_.fm(b.language),c.originalLanguage=_.fm(b.originalLanguage);a===_.im?(c.frameRate=b.frameRate,c.roles=b.roles,c.trickPlay=b.trickPlay):a===_.hm?(c.channelsCount=b.channelsCount,c.roles=b.tg||[],c.mimeType=_.fm(b.audioMimeType)):(c.kind=_.fm(b.kind),c.roles=b.roles);c.accessibility=a===_.im||a===_.hm?(b.accessibility||[]).filter(function(d){return d.type===a}):b.accessibility||
|
|
76
|
+
[];return c};DE=function(a,b,c){var d=new _.nm(a===_.im?""+b.uc:a===_.hm?""+b.zc:""+b.id,c);switch(a){case _.im:d.codec=_.fm(b.Yj);d.bandwidth=b.fg||b.bandwidth;d.width=b.width;d.height=b.height;d.originalId=b.ah;break;case _.hm:d.codec=_.fm(b.audioCodec);d.bandwidth=b.pf||b.bandwidth;d.originalId=b.$g;break;default:d.codec=_.fm(b.codecs),d.originalId=b.sj}(a=c.renditions.find(function(e){return _.N.va(e,d,null,["id","track"])}))||c.renditions.push(d);return a||d};
|
|
77
|
+
EE=function(a,b){var c=a.reduce(function(d,e){b===_.im?null===e.uc||d[e.uc]&&!e.nf||(d[e.uc]=e):b===_.hm&&(null===e.zc||d[e.zc]&&!e.mf||(d[e.zc]=e));return d},{});return Object.values(c)};FE=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};GE=function(a){this.F=a;this.g=new _.L("clpp.mse.StateManager");this.h=this.a=0;this.f=2};
|
|
78
|
+
HE=function(a,b){if(a.a!==b){var c=_.S.Uc;if(3===a.a&&0!==b)c=c(b,_.ij),a.g.info(_.IB+c);else{c=a.h;c=0===c?0:Date.now()-c;var d=a.a;a.a=b;a.h=Date.now();a.F.In(b);6===b&&(a.F.isSeeking()?a.f=1:a.f=2);var e=a.f,f=void 0;if(6===b||6===d)f=e;a.F.trigger(new _.R(_.uf,{detail:{currentState:b,previousState:d,timeSinceLastStateChangeMS:c,reason:f}}));11!==b&&3!==b||a.F.ko();6===b?a.F.trigger(new _.R(_.dd,{detail:{bufferedTimeMS:-1,reason:e}})):6===d&&a.F.trigger(new _.R(_.cd,{detail:{bufferedTimeMS:c,reason:e}}))}}};
|
|
79
|
+
IE=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};_.JE=function(a,b){a.forEach(function(c){c.startTime+=b;c.endTime+=b})};KE=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}};LE=function(a){return Object.assign({},a,{periods:a.periods.map(function(b){return Object.assign({},b)})})};
|
|
80
|
+
ME=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=_.jh(a[0].periods).concat(),d={},e=1;e<a.length;d={lf:d.lf},e++)d.lf=KE(a[e-1]).end,_.JE(a[e].periods,d.lf),c.push.apply(c,_.jh(a[e].periods)),a[e].cues.forEach(function(f){return function(g){g.offset=f.lf}}(d));d=a.flatMap(function(f){return f.cues});c={periods:c,presentationTimeline:b,minBufferTime:0,cues:d,alternativeVariants:a[0].alternativeVariants};
|
|
81
|
+
d=KE(c).end;_.rD(b.a,0,d);(d=a[0].presentationTimeline.Zc())&&_.uD(b,d.seekRangeStartDateTime);return c};OE=function(a,b){try{if(1===a.length)return a[0];if(!a.every(NE))throw new _.hi("Period durations must be finite");return ME(a,b)}catch(c){throw new _.O(_.Q,7,7003,"Failed to join manifests into a continuous playlist!",c);}};
|
|
82
|
+
PE=function(a,b){var c=b.periods[0].configurationId,d=_.jh(a.periods).concat().filter(function(f){return f.configurationId!==c}),e=a.presentationTimeline;d={periods:d,presentationTimeline:e,minBufferTime:0};_.vD(e,b.presentationTimeline.o);return OE([d,b],e)};NE=function(a){return a.periods.every(function(b){return null!=b.endTime&&0<=b.endTime&&isFinite(b.endTime)})};
|
|
83
|
+
QE=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}};RE=function(a,b){return b.find(function(c){return c.id===a.id})||null};SE=function(){this.g=new _.L("clpp.mse.TrackManager");this.m=null;this.h=[];this.a=new Map;this.f=new Map};TE=function(a,b){return a.h.filter(function(c){return c.type===b})};UE=function(a,b){var c=a.a.get(b)||null;return c&&c.track};
|
|
84
|
+
VE=function(a,b,c){if(!c||UE(a,c.type)!==c||a.m.xa())switch(c=c?c.renditions[0]||null:null,b){case _.im:a.Cb(c);break;case _.hm:a.Nb(c);break;case _.gm:a.Ob(c);break;default:throw Error("Unknown track type "+b);}};WE=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)};XE=function(a,b,c){return a.m.xa()?!0:(a.a.get(c)||null)===b?!1:!0};
|
|
85
|
+
YE=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
|
+
$E=function(a,b,c){YE(a,b,_.im);if(XE(a,b,_.im)){var d=a.m;a.g.info("Set video rendition with ID: "+b.id);var e=a.a.get(_.hm)||null,f=null;if(e&&!e.a){var g=d.Md().filter(function(l){return l.uc===parseInt(b.id,10)});f=g.find(function(l){return l.zc===parseInt(e.id,10)})||null;if(!f){a.g.debug("Unable to find exact variant. Searching for equivalent");var k=e.track.renditions.map(function(l){return l.id}).filter(function(l){return l!==e.id});f=g.find(function(l){return k.find(function(m){return m===
|
|
87
|
+
l.zc})})||null}}else f=d.Md().find(function(l){return l.uc===parseInt(b.id,10)})||null;f?(a.f.set(_.im,b),ZE(d,f,c)):a.g.warn("Cannot find matching variant")}};
|
|
88
|
+
cF=function(a,b){var c,d,e;_.I(function(f){switch(f.a){case 1:c=_.gm;YE(a,b,c);if(!XE(a,b,c))return f["return"]();d=a.m.ra().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);_.F(f,2);WE(a,b);return _.x(f,aF(a.m,!0),4);case 4:return _.x(f,bF(a.m,d),5);case 5:a.m.trigger(new _.R(_.pg));_.G(f,0);break;case 2:e=_.H(f),a.g.warn("Failed to set text rendition",e),
|
|
89
|
+
_.z(f)}})};dF=function(a){var b,c,d;_.I(function(e){if(1==e.a){b=_.gm;c=UE(a,b);if(!c)return e["return"]();a.g.info("Unset text rendition.");_.F(e,2);return _.x(e,aF(a.m,!1),4)}if(2!=e.a)return a.a.set(b,null),a.m.trigger(new _.R(_.pg)),_.G(e,0);d=_.H(e);a.g.warn("Failed to unset text rendition",d);_.z(e)})};
|
|
90
|
+
hF=function(a){if(a.m){a.g.debug("Track list change detected, updating track list");for(var b=[],c=_.v(Object.values(_.tw)),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.ra());for(var e=d.next();!e.done;c={Nc:c.Nc},e=d.next()){e=e.value;c.Nc=CE(_.gm,e);var f=b.find(function(k){return function(l){return k.Nc.va(l)}}(c));c.Nc=f||c.Nc;var g=DE(_.gm,e,c.Nc);e.rg&&a.a.set(_.gm,g);f||b.push(c.Nc)}eF(a.m)||a.a.set(_.gm,null);c=a.m.Md();fF(a,b,c,_.im);fF(a,b,c,_.hm);
|
|
91
|
+
gF(a,b);a.h=b}};fF=function(a,b,c,d){var e=EE(c,d);c={};e=_.v(e);for(var f=e.next();!f.done;c={Oc:c.Oc},f=e.next()){f=f.value;c.Oc=CE(d,f);var g=b.find(function(l){return function(m){return l.Oc.va(m)}}(c));c.Oc=g||c.Oc;var k=DE(d,f,c.Oc);(d===_.im&&f.nf||d===_.hm&&f.mf)&&a.a.set(d,k);g||b.push(c.Oc)}};
|
|
92
|
+
gF=function(a,b){var c=a.m;if(c.f){var d=(d=iF(c))?jF(c.l,d).qb: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(_.sw++),e=new _.em(e,_.hm),e.mimeType="",e.label=c.label,e.language=c.language,e.originalLanguage=c.language,e.channelsCount=c.channelsCount,e.roles=[],e.accessibility=[],f=new _.nm(""+c.id,e),f.codec="",f.bandwidth=0,f.originalId=c.label,f.a=!0,
|
|
93
|
+
e.renditions.push(f),b.push(e),c.active&&a.a.set(_.hm,e.renditions[0])};lF=function(a,b,c,d){a.h.length||hF(a);var e=a.a.get(c)||null;(b=kF(a,b,c))&&e!==b&&(WE(a,b),c===_.hm?a.m.trigger(new _.R(_.Zc)):c===_.im&&a.m.trigger(new _.R(_.Qg,{details:{width:b.width||0,height:b.height||0,bandwidth:b.bandwidth,track:b.track,abrSelection:d}})))};kF=function(a,b,c){return TE(a,c).flatMap(function(d){return d.renditions}).find(function(d){return parseInt(d.id,10)===b})||null};
|
|
94
|
+
mF=function(){this.a=new muxjs.mp4.CaptionParser;this.l=[];this.j={}};_.nF=function(){};_.pF=function(a,b,c,d,e){this.j=a;this.B=c;this.a={};this.J={};this.M=!1;this.f=null;this.h={};this.l=new _.ki;this.K=!1;this.w={};this.H=b;this.D=d;this.I=e;this.T=this.I.streaming.maxSegmentToMediaOffset||1;this.L=new _.ol;this.A="";this.G={};this.o=oF(this,this.L);this.P=!0;this.g=new _.L("clpp.mse.MediaSourceEngine")};
|
|
95
|
+
qF=function(a){var b=_.Hm(a.mimeType,a.codecs),c=GC(a);return _.pD(b)||_.Eu(c)||(_.Gm(b,a.type)?!0:!1)};
|
|
96
|
+
oF=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=rF(c);a.j.src=a.A;return c}c=new MediaSource;a.A=rF(c);a.l.one(c,"sourceopen",function(){URL.revokeObjectURL(a.A);b.resolve()});a.j.src=a.A;return c};sF=function(a){a.g.debug("Reset transmuxers.");Object.values(a.w).forEach(function(b){return b.reset()})};
|
|
97
|
+
uF=function(a,b){var c,d,e,f,g,k,l,m,n;return _.I(function(p){1==p.a&&(c=_.v(b),d=c.next());if(5!=p.a){if(d.done)return p.C(0);e=d.value;f=_.v(e);g=f.next().value;k=f.next().value;l=g;m=a.a[l];return m?_.x(p,tF(a,l,m),5):(n=a.o.addSourceBuffer(k),a.l.on(n,_.le,a.wl.bind(a,l)),a.l.on(n,"updateend",a.gd.bind(a,l)),a.a[l]=n,p.C(5))}a.J[l]=k;a.h[l]=[];a.G[l]=!1;d=c.next();return p.C(2)})};tF=function(a,b,c){return _.I(function(d){return _.x(d,vF(a,b,function(){c.remove(0,Infinity)}),0)})};
|
|
98
|
+
wF=function(a){return a.I.streaming.ignoreManagedMediaSourceStreamingHints?!0:a.P};xF=function(a,b){a.f||(a.f=new lD(a.I,a.B));var c=a.f;if(b!==_.Ic){var d=_.Bv[b];if(!d)throw new _.O(_.Q,2,2012,"Text parser is unavailable for "+b);c.w=new d(c.D)}};yF=function(a){return a.o?a.o.readyState===_.ke:!0};AF=function(a){var b={};b.total=new _.nn(a.j.buffered,"total");b.audio=zF(a,_.Rc);b.video=zF(a,_.Kg);var c=[];a.f&&(c=[{start:a.f.gc(),end:a.f.Xa()}]);b.text=PC(c,_.jk);return b};
|
|
99
|
+
zF=function(a,b){try{return new _.nn(a.a[b].buffered,b)}catch(c){return b in a.a&&a.g.error("failed to get buffered range for "+b,c),null}};BF=function(a,b){if(!a.a[b])return"";var c=zF(a,b);return c?c.toString():""};
|
|
100
|
+
CF=function(a,b,c,d,e,f,g,k,l){k=void 0===k?!1:k;l=void 0===l?!1:l;var m=a.a[b],n=-1,p=0;m&&m.buffered&&(p=m.buffered.length);b===_.Kg&&null!==d&&null!==e&&k&&(n=0<p?m.buffered.end(p-1):-1);b===_.jk?l=mD(a.f,c,d,e):a.w[b]?(c=a.w[b].transmux(c),c.captions&&0<c.captions.length&&(a.f||xF(a,_.ng),oD(a.f,c.captions,d,e,a.a.video.timestampOffset)),f=[],0<c.audio.byteLength&&a.a.audio&&!l&&f.push(vF(a,_.Rc,a.Dg.bind(a,_.Rc,c.audio.buffer))),0<c.video.byteLength&&a.a.video&&f.push(vF(a,_.Kg,a.Dg.bind(a,_.Kg,
|
|
101
|
+
c.video.buffer))),l=Promise.all(f)):(f&&window.muxjs&&(a.f||xF(a,_.ng),null==d&&null==e?a.H.init(c):a.H.h(c,function(q){q.length&&oD(a.f,q,d,e,a.a.video.timestampOffset)})),l=vF(a,b,a.Dg.bind(a,b,c)));return l.then(function(){if(b===_.Kg&&null!==d&&null!==e&&!k)a.D.append(d,e,g),null!==d&&null!==e&&a.g.debug("Appended video segment ",d,e,"Buffer:",BF(a,b));else if(b===_.Rc&&null!==d&&null!==e)$C(a.D),null!==d&&null!==e&&a.g.debug("Appended audio segment ",d,e,"Buffer:",BF(a,b));else if(b===_.Kg&&
|
|
102
|
+
null!==d&&null!==e&&k){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.D.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.T&&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=vF(a,b,function(){a.Qj(b,u)}),t=vF(a,b,a.xi.bind(a,b,!1)),
|
|
103
|
+
Promise.all([q,t])}null!==d&&null!==e&&(a.G[b]=!0)})["catch"](function(q){throw q;})};DF=function(a,b){var c=a.Xa(_.Kg)||0;nD(a.f,b,c)};EF=function(a){a.f&&nD(a.f,"",0)};HF=function(a,b,c,d,e,f,g){var k,l;return _.I(function(m){if(1==m.a){k=_.Pq;if(b===k.TEXT){a.f.A=c;var n=a.f;n.j=d;n.l=e;return m["return"]()}return _.x(m,FF(a,b,f,g),2)}l=GF(a,b,c,d,e);a.M&&(l=l.concat(GF(a,k.AUDIO,c,d,e)));return _.x(m,Promise.all(l),0)})};
|
|
104
|
+
GF=function(a,b,c,d,e){return[vF(a,b,a.mk.bind(a,b)),vF(a,b,a.Qj.bind(a,b,c)),vF(a,b,a.So.bind(a,b,d,e))]};JF=function(a,b){IF(a,function(){a.o.duration=b})};vF=function(a,b,c){if(a.K)return Promise.reject();c={start:c,p:new _.ol};a.h[b].push(c);1===a.h[b].length&&KF(a,b);return c.p};
|
|
105
|
+
KF=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 _.O(_.Q,3,3017,{type:b})):c.p.reject(new _.O(_.Q,3,3015,{mediaError:d})),LF(a,b)}else a.g.debug("No more scheduled operations for "+b)};
|
|
106
|
+
IF=function(a,b){var c,d,e,f,g,k,l,m,n;return _.I(function(p){switch(p.a){case 1:if(a.K)return p["return"](Promise.reject());c=[];for(d in a.a)e=new _.ol,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();_.F(p,2);return _.x(p,Promise.all(c),4);case 4:_.G(p,3);break;case 2:g=_.H(p);for(k in a.a)a.h[k].length&&a.h[k].shift();return p["return"](Promise.reject(g));case 3:for(l in a.a);_.F(p,5,6);return _.x(p,b(),6);case 6:_.yh(p);for(m in a.a)LF(a,
|
|
107
|
+
m);_.zh(p);break;case 5:return n=_.H(p),p["return"](Promise.reject(new _.O(_.Q,3,3015,{mediaError:n})))}})};LF=function(a,b){a.h[b].shift();KF(a,b)};FF=function(a,b,c,d){var e,f,g;return _.I(function(k){e=_.Pq;if(b===e.TEXT||!VC()||a.I.mediaSource.codecSwitchingStrategy!==_.bg)return k["return"]();f=a.J[b];g=_.Hm(c,d);return JC(f,g)?k["return"]():_.x(k,vF(a,b,function(){a.g.info("Change MIME type of "+b+" to "+g);a.a[b].changeType(g);a.J[b]=g;a.gd(b)}),0)})};
|
|
108
|
+
RF=function(a,b,c,d){var e=a.periods.flatMap(function(n){return n.variants}),f=e;if(b.length||c.length)f=MF(f,b,c);f=NF(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 k=e.next();!k.done;k=e.next())k=k.value,null!==k.audio&&d.add(g(k.audio.codecs));b.push(d)}var l=b[0];c={};for(d=1;d<
|
|
109
|
+
b.length;c={kg:c.kg},d++)c.kg=b[d],l=new Set(_.jh(l).concat().filter(function(n){return function(p){return n.kg.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=OF(f);var m=PF(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(QF(n)===m)return!0;_.Ph("Dropping Variant (better codec available)",n);return!1})};
|
|
110
|
+
SF=function(a,b,c,d){var e=a.periods.flatMap(function(f){return f.variants});if(b.length||c.length)e=MF(e,b,c);e=NF(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)})};OF=function(a){var b=new _.ji;a=_.v(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=QF(c);b.push(d,c)}return b};
|
|
111
|
+
MF=function(a,b,c){if(!b.length&&!c.length)return a;var d=a.filter(function(g){return(g=g.audio)&&c.length&&(g=_.IC(g.codecs),c.includes(g))?!0:!1}),e=a.filter(function(g){return(g=g.video)&&b.length&&(g=_.IC(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
|
+
PF=function(a){var b="",c=Infinity;a.forEach(function(d,e){var f=e.reduce(function(g,k){return g+k.bandwidth||0},0)/e.length;_.Ph(_.Cd,d,"avg bandwidth",f);f<c&&(b=d,c=f)});return b};QF=function(a){var b="";a.video&&(b=_.IC(a.video.codecs));var c="";a.audio&&(c=_.IC(a.audio.codecs));return b+"-"+c};
|
|
113
|
+
TF=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};UF=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=TF(e,b);f!==e.allowedByApplication&&(c=!0)}return c};
|
|
114
|
+
XF=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.X&&!sC(a,n))return _.Ph("Dropping variant - not compatible with key system",n),!1;var p=n.audio,q=n.video;if(p&&!qF(p)){var t=p.codecs;0<=p.codecs.indexOf(_.ge)?(_.Ph("Trying to use AC-3 for EC-3"),p.codecs=p.codecs.replace(_.ge,"ac-3"),qF(p)?_.Oh("Using AC-3 instead of EC-3 for",VF(p)):(p.codecs=t,_.Oh(KB,VF(p)),n.audio=null,f=!0,p=null)):(_.Oh(KB,VF(p)),n.audio=null,f=!0,p=null)}return q&&!qF(q)?(_.Oh("Dropping variant - video not compatible with platform",
|
|
115
|
+
VF(q)),!1):p&&b&&!WF(p,b,e)?(_.Oh("Dropping variant - not compatible with active audio","active audio",VF(b),"variant.audio",VF(p)),!1):q&&c&&!WF(q,c,e)?(_.Oh("Dropping variant - not compatible with active video","active video",VF(c),"variant.video",VF(q)),!1):!0});if(f){for(var g=!1,k=!1,l=_.v(d.variants),m=l.next();!m.done;m=l.next())m=m.value,!g&&m.video&&m.audio&&(g=!0),k||m.audio||!m.video||(k=!0);g&&k&&(d.variants=d.variants.filter(function(n){return n.video&&!n.audio?(_.Oh("Dropping variant - not compatible with video + audio",
|
|
116
|
+
"variant.video",VF(n.video)),!1):!0}))}d.textStreams=d.textStreams.filter(function(n){var p=_.pD(_.Hm(n.mimeType,n.codecs));p||_.Ph("Dropping text stream. Is not supported by the platform.",n);return p})};WF=function(a,b,c){return a.mimeType!==b.mimeType||(void 0===c||c)&&a.codecs.split(".")[0]!==b.codecs.split(".")[0]?!1:!0};
|
|
117
|
+
YF=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,k=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,nf:!1,mf:!1,rg:!1,
|
|
118
|
+
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:k,codecs:f.join(", "),audioCodec:d,Yj:e,primary:a.primary,roles:Array.from(m),tg:Array.from(n),uc:null,zc:null,channelsCount:null,spatialAudio:!1,pf:null,fg:null,ah:null,$g:null,sj:null,accessibility:q};c&&(a.uc=c.id,a.ah=c.originalId,a.width=c.width||null,a.height=c.height||null,a.frameRate=c.frameRate||null,a.trickPlay=
|
|
119
|
+
!!c.trickPlay,a.fg=c.bandwidth||null);b&&(a.zc=b.id,a.$g=b.originalId,a.originalLanguage=b.originalLanguage,a.channelsCount=b.channelsCount,a.pf=b.bandwidth||null,a.label=b.label,a.tg=b.roles);return a};
|
|
120
|
+
ZF=function(a){return{id:a.id,nf:!1,mf:!1,rg:!1,type:_.jk,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,Yj:null,primary:a.primary,roles:a.roles,tg:null,uc:null,zc:null,channelsCount:null,spatialAudio:!1,pf:null,fg:null,ah:null,$g:null,sj:a.originalId,accessibility:a.accessibility,keyId:null}};
|
|
121
|
+
$F=function(a){return a.allowedByApplication&&a.allowedByKeySystem};NF=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))};
|
|
122
|
+
_.bG=function(a,b,c,d){b=_.Ej(b);var e=a,f=a.filter(function(k){return k.primary});f.length&&(e=f);var g=e.length?e[0].language:"";e=e.filter(function(k){return k.language===g});b.some(function(k){var l=_.Lk(_.Hk(k),a.map(function(m){return m.language}));return l?(e=a.filter(function(m){return _.Hk(m.language)===l}),!0):!1});d&&e.some(function(k){return k.kind===_.ne})&&(e=e.filter(function(k){return k.kind===_.ne}));if(c){b=aG(e,c);if(b.length)return b;_.Kh("No exact match for the text role could be found.")}else if(b=
|
|
123
|
+
e.filter(function(k){return 0===k.roles.length}),b.length)return b;b=e.map(function(k){return k.roles}).reduce(_.yC,[]);return b.length?aG(e,b[0]):e};aG=function(a,b){return a.filter(function(c){return c.roles.includes(b)})};
|
|
124
|
+
VF=function(a){var b=GC(a);return a.type===_.Rc?"type\x3daudio mimeType\x3d"+a.mimeType+" codecs\x3d"+a.codecs+" codecInfo\x3d"+b+" bandwidth\x3d"+a.bandwidth+" channelsCount\x3d"+a.channelsCount:a.type===_.Kg?"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"};
|
|
125
|
+
_.cG=function(){this.g=new _.L("clpp.abr");this.o=null;this.l=!1;this.w=new pE;this.f=[];this.B=1;this.H=this.G=!1;this.A=this.a=this.h=this.j=null;this.D=new Set};
|
|
126
|
+
dG=function(a,b,c,d){if(a.l&&!c.stopped&&!b.a){var e=Date.now()-c.bp,f=b.f?b.f.bytesLoaded||0:0,g=b.f?b.f.bytesRemaining:-1;if(0>=f||e<d)c.uh=setTimeout(function(){return dG(a,b,c,d)},500);else{var k=a.f.find(function(m){return m.id===a.j});k=k?k.bandwidth:a.getBandwidthEstimate();var l=8E3*f/e;eG(a,l,k,0<=g?8E3*g/l:Infinity)&&fG(a,k)?(qE(a.w,e,f),c.stop(),b.abort(),gG(a,l)):c.uh=setTimeout(function(){return dG(a,b,c,d)},500)}}};gG=function(a,b){var c=fG(a,b)||a.f[0];a.h=Date.now();a.o(c)};
|
|
127
|
+
fG=function(a,b){return hG(a,a.a.restrictions||null,a.f).filter(function(c){return c.bandwidth<b}).pop()||null};eG=function(a,b,c,d){return 0===b||Infinity===d||300>d?!1:b<c/(a.a.bandwidthDowngradeTarget||1)};
|
|
128
|
+
hG=function(a,b,c){if(a.A&&a.a.useCmsd){var d=vC(a.A);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 TF(e,b)}));return a.sort(function(e,f){return e.bandwidth-f.bandwidth})};iG=function(){this.a=null};kG=function(a,b){if(b&&(null==a.a||a.a!==b))throw jG(a);};
|
|
129
|
+
jG=function(a){return new _.O(_.Q,7,7E3,a.a?"Another load operation was started while a load operation was in progress.":"Player was released while a load operation was in progress.")};lG=function(){this.a=new Map};jF=function(a,b){a.a.has(b)||a.a.set(b,new mG);return a.a.get(b)};mG=function(){this.text=this.video=this.qb=this.audio=null};nG=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)};
|
|
130
|
+
qG=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||oG(d,e))&&pG(d.roles,e.roles))}!d&&(d=a.video&&b.video)&&(a=a.video,b=b.video,d=!((!c||oG(a,b))&&pG(a.roles,b.roles)));return d?!1:!0};
|
|
131
|
+
oG=function(a,b){if(a.mimeType!==b.mimeType)return!1;var c=HC(a.codecs).map(function(f){return _.IC(f)}),d=HC(b.codecs).map(function(f){return _.IC(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};pG=function(a,b){var c=new Set(a),d=new Set(b);c["delete"](_.He);d["delete"](_.He);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};
|
|
132
|
+
sG=function(a){var b=void 0===b?_.Ff:b;this.f=a;this.a=b;this.h=new rG(a.language,"",a.audio&&a.audio.channelsCount?a.audio.channelsCount:0,!1,b)};rG=function(a,b,c,d,e){this.j=_.Ej(a);this.a=b;this.f=c;this.l=void 0===d?!1:d;this.h=void 0===e?_.Ff:e};tG=function(a,b){var c=null;b.some(function(d){c=_.Lk(_.Hk(d),a.map(function(e){return DC(e)}));return!!c});return c?a.filter(function(d){return c===DC(d)}):[]};
|
|
133
|
+
uG=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)})};vG=function(a,b){return a.filter(function(c){return c.audio&&c.audio.spatialAudio!==b?!1:!0})};yG=function(a,b){this.a=wG;this.f=(new Map).set(wG,b).set(xG,a)};
|
|
134
|
+
AG=function(a){var b=this;this.F=a;this.a=a.getConfiguration().streaming;this.f=new _.ki;this.g=new _.L("clpp.mse.media.LiveEdgeObserver");zG(this)&&(a=this.F.getSurface().getMedia(),this.f.on(a,_.ug,function(){var c=b.F.getPosition(),d=b.F.getSeekRange().end;c=d-c;var e=b.F.getPlaybackRate(),f=b.a.stopChasingAt;1<=e&&c>=b.a.chaseJumpDistance?(b.g.debug("Too far from edge, jump to beginning."),b.F.setPlaybackRate(1),b.F.seek(d)):1===e&&c>=b.a.startChasingAt?(b.g.debug("Not on live edge, increase playback rate."),
|
|
136
135
|
b.F.setPlaybackRate(b.a.chasingRate,_.Nd)):1<e&&c<=f&&(b.g.debug("On live edge, reduce playback rate."),b.F.setPlaybackRate(1))}))};
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
a;if(0===g.length||!e)throw _.Qh("Failed to find boxes needed to fake encryption!"),_.Qh("Failed init segment (hex):",_.
|
|
142
|
-
|
|
143
|
-
b.start);b=_
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
m),q["return"]();p=
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
b)};
|
|
153
|
-
|
|
154
|
-
_.
|
|
155
|
-
|
|
156
|
-
(a.g.debug("switch during trick play mode",b),b.trickModeVideo?(g.Jc=b,b=b.trickModeVideo,a.g.debug("switch found trick play stream",b)):(g.Jc=null,a.g.debug("switch found no special trick play stream")));var C=a.B.get(k);if(!C||!C.
|
|
157
|
-
u>=q))return y=
|
|
158
|
-
C=!0:(K=g.bc,K=K.f?K.f.bytesRemaining:-1,C=0>K||K>C?!0:!1)}}else C=!1;C&&(a.g.info("Aborting current segment request to switch."),g.bc.abort());if(!c){E.C(0);break}if(g.Rc){g.gg=!0;E.C(0);break}if(g.Mb){g.vc=!0;g.tf=d;g.gg=!0;E.C(0);break}
|
|
159
|
-
|
|
136
|
+
zG=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};BG=function(a){this.h=a;this.a=null;this.f=function(){}};CG=function(a,b){a.f=b};
|
|
137
|
+
DG=function(a){var b=this;this.f=a;this.o=this.w=this.l=!1;this.h=this.f.Cc();this.A=_.Nd;this.j=null;this.a=new _.Yh(function(){b.w||b.f.nn(.25*b.h)});this.g=new _.L("clpp.mse.media.PlayRateController")};EG=function(a,b){a.j=b;a.j.speedUpMode&&(a.A=a.j.speedUpMode)};
|
|
138
|
+
HG=function(a,b){a.a.stop();a.l||(a.o=!1);var c=a.l?0:a.h;if((b?b:a.A)===_.Nd||0===c||1===c)try{FG(a,c)}catch(d){a.g.warn('Set playbackRate using "decoder" mode fails, due to unsupported range by platform. Fallback to "seek" mode.',d),GG(a)}else GG(a)};GG=function(a){a.g.debug(LB,a.h,' using "seek" mode.');FG(a,0);a.o=!0;a.a.Qb(.25)};FG=function(a,b){if(a.f.Cc()!==b){a.g.debug(LB,b,' using native playbackRate "decoder" mode.');try{a.f.Wd(b)}catch(c){throw c;}}};
|
|
139
|
+
JG=function(a){function b(){d=!0}function c(m){f.push(m);_.Vn(m)}a=_.Vi(a);var d=!1,e,f=[],g=[];(new _.Un).N(_.Oe,c).N(_.wg,c).N(_.Je,c).N(_.Ne,c).N(_.gg,c).da(_.ig,function(m){e=m;f.push(m);_.Wn(m)}).da("encv",b).da("enca",b).da("avc1",function(m){g.push({N:m,Td:1701733238})}).da("avc3",function(m){g.push({N:m,Td:1701733238})}).da("ac-3",function(m){g.push({N:m,Td:1701733217})}).da(_.ge,function(m){g.push({N:m,Td:1701733217})}).da("mp4a",function(m){g.push({N:m,Td:1701733217})}).parse(a);if(d)return _.Oh("Init segment already indicates encryption."),
|
|
140
|
+
a;if(0===g.length||!e)throw _.Qh("Failed to find boxes needed to fake encryption!"),_.Qh("Failed init segment (hex):",_.Ll(a)),new _.O(_.Q,3,14E3);g.reverse();for(var k=_.v(g),l=k.next();!l.done;l=k.next())l=l.value,_.Oh('Inserting "'+_.Zn(l.Td)+'" box into init segment.'),a=IG(a,e,l.N,f,l.Td);return a};
|
|
141
|
+
IG=function(a,b,c,d,e){var f=KG.value(),g=a.subarray(c.start,c.start+c.size),k=_.aj(g),l=new Uint8Array(c.size+f.byteLength);l.set(g,0);g=_.aj(l);g.setUint32(4,e);l.set(f,c.size);e=k.getUint32(4);g.setUint32(c.size+16,e);LG(l,0,l.byteLength);e=new Uint8Array(a.byteLength+l.byteLength);c=_.ri("Xbox One")||_.qi()?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,LG(e,d.start,d.size+l.byteLength);l=_.aj(e,
|
|
142
|
+
b.start);b=_.$n(b);a=l.getUint32(b);l.setUint32(b,a+1);return e};LG=function(a,b,c){a=_.aj(a,b);b=a.getUint32(0);0!==b&&(1===b?(a.setUint32(8,c>>32),a.setUint32(12,c&4294967295)):a.setUint32(0,c))};_.NG=function(a,b){this.F=b;this.j=a;MG(a);this.h=null;this.l=1;this.H=Promise.resolve();this.B=new Map;this.o=new Map;this.a=new Map;this.K=this.f=this.w=this.D=!1;this.J=0;this.g=new _.L("clpp.mse.Streaming");this.G=this.A=this.I=!1};
|
|
143
|
+
PG=function(a){var b=a.a.get(_.Kg);return b?OG(a,b.pc):(b=a.a.get(_.Rc))?OG(a,b.pc):null};RG=function(a){return _.QG(a,_.Rc)};SG=function(a){return _.QG(a,_.Kg)};
|
|
144
|
+
XG=function(a,b){var c,d,e,f,g,k,l,m,n,p;return _.I(function(q){switch(q.a){case 1:return c=_.Pq,_.x(q,a.F.Y.clear(c.TEXT),2);case 2:return a.J++,a.K=!1,d=a.J,e=a.F.Y,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,TG(a,g),4);case 4:if(a.f)return q["return"]();l=(k=e.getTextDisplayer().isTextVisible())||a.h.alwaysStreamText;if(a.J===d&&!a.a.has(c.TEXT)&&!a.K&&l){m=a.F.Hb();n=UG(a,m);if(null==n)return a.g.warn("Cannot set up text media state, period not found at",
|
|
145
|
+
m),q["return"]();p=VG(b,n,0);a.a.set(c.TEXT,p);WG(a,p,0)}_.z(q)}})};$G=function(a){a.K=!0;var b=a.a.get(_.jk);b&&(a.g.info("Unload text stream"),YG(b),ZG(b)["catch"](function(){}),a.a["delete"](_.jk))};aH=function(a){var b,c;return _.I(function(d){if(1==d.a){b=_.Pq;c=a.a.get(b.AUDIO);if(!c)return d.C(0);a.g.info("Unload audio stream");YG(c);return _.x(d,ZG(c)["catch"](function(){}),3)}a.a["delete"](b.AUDIO);_.z(d)})};
|
|
146
|
+
cH=function(a,b){var c,d,e,f,g,k;_.I(function(l){if(1==l.a){c=_.Pq;d=a.a.get(c.VIDEO);if(!d)return l["return"]();e=d.stream;if(!e)return l["return"]();if(b){g=e.trickModeVideo;if(!g||(k=d.Jc))return l["return"]();a.g.debug("Switching to trick mode",g);return _.x(l,bH(a,g,!1,0),5)}f=d.Jc;if(!f)return l["return"]();a.g.debug("Switching back from trick mode",f);d.Jc=null;return _.x(l,bH(a,f,!0,0),0)}d.Jc=e;_.z(l)})};
|
|
147
|
+
dH=function(a,b,c,d){return _.I(function(e){return 1==e.a?b.video?_.x(e,bH(a,b.video,c,d),2):e.C(2):b.audio?_.x(e,bH(a,b.audio,c,d),0):e.C(0)})};fH=function(a){var b,c;return _.I(function(d){if(1==d.a){if(a.A)return d["return"]();a.A=!0;return _.x(d,aH(a),2)}b=_.Pq;c=a.a.get(b.VIDEO);return _.x(d,eH(a,c),0)})};gH=function(a,b,c,d){return _.I(function(e){return _.x(e,bH(a,b,c,d),0)})};
|
|
148
|
+
iH=function(a,b){var c;return _.I(function(d){if(1==d.a){if(!a.A)return d.C(2);a.A=!1;c=a.F.Hb();return _.x(d,hH(a,{audio:b},c),2)}return _.x(d,bH(a,b,!0,0),0)})};_.jH=function(a,b){return _.I(function(c){return _.x(c,bH(a,b,!0,0),0)})};mH=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;MG(a.j);kH(a);lH(a)};
|
|
149
|
+
lH=function(a){a=_.v(a.a.values());for(var b=a.next();!b.done;b=a.next()){b=b.value;var c=b.ma,d=b.mc;c&&d&&(c=d.getSegmentReference(c.position))&&(b.ma=c)}};MG=function(a){a.periods.every(function(b){return typeof b.id===_.hg})};
|
|
150
|
+
nH=function(a){var b=a.F.Hb(),c=!1,d=UG(a,b);if(Array.from(a.a.values()).every(function(k){return k.pc===d}))for(var e=_.v(a.a.keys()),f=e.next();!f.done;f=e.next()){f=f.value;var g=a.a.get(f);g.stream.segmentIterator=null;a.F.Y.Ec(f,b,0)||(eH(a,g),c=!0)}else if(!Array.from(a.a.keys()).every(function(k){return a.F.Y.Ec(k,b,0)})){a.g.debug("(all): seeked: unbuffered seek: clearing all buffers");c=_.v(a.a.values());for(e=c.next();!e.done;e=c.next())eH(a,e.value);c=!0}c||a.g.debug("(all): seeked: buffered seek: presentationTime\x3d"+
|
|
151
|
+
b)};qH=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.w)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=oH(d);if(d.Od||b&&pH(d))a.g.info(e,"Retrying after failure..."),d.Od=!1,WG(a,d,.1)}};rH=function(a){return Array.from(a.a.values()).some(function(b){return null!==b.Db})};
|
|
152
|
+
sH=function(a){var b=Array.from(a.a.values());return a.D&&b.every(function(c){return c.endOfStream})};uH=function(a){var b,c,d,e;return _.I(function(f){b=[];c=_.v(a.a.values());for(d=c.next();!d.done;d=c.next())e=d.value,YG(e),e.Mb&&e.bc&&(e.Mb=!1,b.push(e.bc.abort())),e.vc&&b.push(tH(a,e,!0,0));return _.x(f,Promise.all(b),0)})};vH=function(a,b,c){(a=a.a.get(b))&&c&&(YG(a),a.stream=c,a.mc=c,a.ma&&(a.ma=c.getSegmentReference(a.ma.position)),a.ma||(a.mc=null))};
|
|
153
|
+
_.QG=function(a,b){var c=a.a.get(b);return c?c.Jc||c.stream:null};
|
|
154
|
+
bH=function(a,b,c,d){var e,f,g,k,l,m,n,p,q,t,u,y,A,D,B;return _.I(function(E){switch(E.a){case 1:e=_.Pq;f=b.type;if((g=a.a.get(f))||b.type!==e.TEXT||!a.h.ignoreTextStreamFailures){E.C(2);break}return _.x(E,XG(a,b),3);case 3:return E["return"]();case 2:if(!g)return E["return"]();k=wH(a,b).id;if(c&&k!==g.pc){a.g.debug("switch: switching to stream in another Period; clearing buffer and changing Periods");l=_.v(a.a.values());for(m=l.next();!m.done;m=l.next())n=m.value,eH(a,n);return E["return"]()}g.Jc&&
|
|
155
|
+
(a.g.debug("switch during trick play mode",b),b.trickModeVideo?(g.Jc=b,b=b.trickModeVideo,a.g.debug("switch found trick play stream",b)):(g.Jc=null,a.g.debug("switch found no special trick play stream")));var C=a.B.get(k);if(!C||!C.hh)return E["return"]();if((C=a.o.get(b.id))&&C.hh){E.C(4);break}return _.x(E,TG(a,new Set([b])),4);case 4:if(g.stream===b)return p=oH(g),a.g.debug(jC+p+" already active"),E["return"]();q=a.j.presentationTimeline.getDuration();t=a.F.Hb();u=xH(a,g,t);if(!c&&(g.endOfStream||
|
|
156
|
+
u>=q))return y=oH(g),a.g.debug(jC+y+" already buffered to the end. Not switching."),E["return"]();b.type===e.TEXT&&(A=_.Hm(b.mimeType,b.codecs),xF(a.F.Y,A));g.stream=b;g.stream.segmentIterator=null;g.Nf=!0;D=oH(g);a.g.debug("switch: switching to Stream "+D);if(g.bc){var K=a.F.Hb(),P=a.F.Y.Xa(g.type);C=(C=yH(a,g,K,P,k))?C.Ae():null;if(null==C)C=!1;else{var T=g.stream.initSegmentReference;T&&(C+=T.Ae()||0);T=a.F.xe().getBandwidthEstimate();8*C/T<(null===P?0:P-K)-Math.max(a.j.minBufferTime||0,a.h.rebufferingGoal)?
|
|
157
|
+
C=!0:(K=g.bc,K=K.f?K.f.bytesRemaining:-1,C=0>K||K>C?!0:!1)}}else C=!1;C&&(a.g.info("Aborting current segment request to switch."),g.bc.abort());if(!c){E.C(0);break}if(g.Rc){g.gg=!0;E.C(0);break}if(g.Mb){g.vc=!0;g.tf=d;g.gg=!0;E.C(0);break}YG(g);_.F(E,9);return _.x(E,tH(a,g,!0,d),11);case 11:_.G(E,0);break;case 9:B=_.H(E);if(a.F)a.F.onError(B);_.z(E)}})};zH=function(a){a.G=!0;a.g.debug("calling onCanSwitch()...");a.F.ij()};
|
|
158
|
+
eH=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a){c=oH(b);if(b.Rc)return a.g.debug(c,"clear: already clearing the buffer"),f["return"]();if(b.vc)return a.g.debug(c,"clear: already waiting"),f["return"]();if(b.Mb)return a.g.debug(c,"clear: currently updating"),b.vc=!0,b.tf=0,f["return"]();d=b.type;if(null==a.F.Y.gc(d))return a.g.debug(c,"clear: nothing buffered"),null==b.Db&&WG(a,b,0),f["return"]();a.g.debug(c,"clear: handling right now");YG(b);_.F(f,2);return _.x(f,tH(a,b,!1,0),4)}if(2!=
|
|
160
159
|
f.a)return _.G(f,0);e=_.H(f);if(a.F)a.F.onError(e);_.z(f)})};
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
160
|
+
hH=function(a,b,c){var d,e,f,g,k;return _.I(function(l){if(1==l.a){d=a.F.Hb();e=UG(a,d);if(null==e)return a.g.warn("Cannot initialize streams, period not found at",d),l["return"]();f=AH(b);g=a.F.Y;k=a.h.forceNativeTS;return _.x(l,g.init(f,k,a.h.disableAudioTracks),2)}if(3!=l.a){if(a.f)return l["return"]();kH(a);return _.x(l,TG(a,new Set(f.values())),3)}if(a.f)return l["return"]();f.forEach(function(m,n){if(!a.a.has(n)){var p=VG(m,e,c);a.a.set(n,p);WG(a,p,0)}});_.z(l)})};
|
|
161
|
+
VG=function(a,b,c){return{stream:a,type:a.type,mc:null,segmentIterator:null,ma:null,Jc:null,Nf:!0,pc:b,endOfStream:!1,Mb:!1,Db:null,vc:!1,tf:0,gg:!1,Rc:!1,fh:!1,Od:!1,Nj:c||0,bc:null,zf:!1,$i:0}};CH=function(a){a.g.debug("(all) setupAllPeriods_");a.j.periods.map(function(b){return b.id}).forEach(function(b){BH(a,b)["catch"](zC)})};
|
|
162
|
+
BH=function(a,b){var c=a.B.get(b);if(c)return a.g.debug("(all) Period "+b+vB),c;a.g.debug("(all) setting up period "+b);var d=new _.ol;a.B.set(b,d);c=OG(a,b);for(var e=new Set,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(){if(!a.f)return TG(a,e)}).then(function(){a.f||(d.resolve(),a.g.debug("(all) setup Period "+
|
|
164
163
|
b))})["catch"](function(k){a.f||(d["catch"](function(){}),d.reject(),a.B["delete"](b),a.g.warn("(all) failed to setup Period "+b),a.F.onError(k))});return d};
|
|
165
|
-
|
|
166
|
-
l.next())if(m=e.value,n=a.o.get(m.id))n["catch"](function(){}),n.reject(),a.o["delete"](m.id);throw k;case 3:p=_.v(b);for(e=p.next();!e.done;e=p.next())q=e.value,(t=a.o.get(q.id))&&!t.done&&(t.resolve(),a.g.debug("(all) finished setting up stream "+q.id));_.z(u)}})};
|
|
167
|
-
|
|
168
|
-
if(null!=l&&f>=l&&!b.zf)return
|
|
169
|
-
null);d=Infinity;k=_.v(a.a.values());for(m=k.next();!m.done;m=k.next())m=m.value,c(m)||(m=
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
e,
|
|
173
|
-
else if(f=
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
C}}b.Mb=!1;b.
|
|
178
|
-
a.g.warn(g,"Text stream failed to parse. Proceeding without it."),a.a["delete"](f.TEXT),B.C(0);if(7001===D.code)return b.Mb=!1,b.Db=null,
|
|
179
|
-
2,2010,D,void 0,D.svtaCode));else a.F.onError(new _.O(1,2,2010,D,void 0,5001));return B.C(0)}if(
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
p=
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
case 2:if(C=e.encrypted&&e.keyId&&a.F.qe)C=a.F.qe.o.get(e.keyId),C=!(!C||C!==_.
|
|
187
|
-
a.
|
|
188
|
-
b.mc=e;b.ma=f;_.z(E)}})};
|
|
189
|
-
|
|
190
|
-
k);return _.x(l,a.F.Y.remove(b.type,f,f+k),2)}if(a.f)return l["return"]();a.g.debug(d,"evicted "+k+
|
|
191
|
-
|
|
192
|
-
case 4:if(a.f)return C["return"]();
|
|
193
|
-
y+" Stream"),a.F.onError(new _.O(_.Q,5,5005)),C["return"]();A=_.v(Array.from(q.keys()));for(u=A.next();!u.done;u=A.next())if(D=u.value,!a.a.has(D))if(D===d.TEXT)
|
|
194
|
-
0);_.z(T)})});return _.x(C,Promise.all(E),5);case 5:if(a.f)return C["return"]();
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
u);return k?y["return"]():_.x(y,d(q.data,!1),0)})};
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
a.W.stop()},trigger:function(b){return a.trigger(b)}});this.Ge=new
|
|
207
|
-
"online",function(){a.H===
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
0;d<f.length;d++)if(!f[d].va(c[d])){f=!1;break a}f=!0}!f&&a.trigger(new _.R(_.
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
6);case 6:return f=l.f,
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
null;case 7:a.B&&(a.B.release(),a.B=null);a.I&&(a.I.release(),a.I=null);if(!a.
|
|
225
|
-
|
|
226
|
-
|
|
164
|
+
TG=function(a,b){var c,d,e,f,g,k,l,m,n,p,q,t;return _.I(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.o.get(f.id))?(a.g.debug("(all) stream "+f.id+vB),c.push(g)):(a.g.debug("(all) setting up stream "+f.id),a.o.set(f.id,new _.ol),c.push(f.createSegmentIndex(a.F.Lb,a.h.attemptParameters)));_.F(u,2);return _.x(u,Promise.all(c),4);case 4:if(a.f)return u["return"]();_.G(u,3);break;case 2:k=_.H(u);if(a.f)return u["return"]();l=_.v(b);for(e=l.next();!e.done;e=
|
|
165
|
+
l.next())if(m=e.value,n=a.o.get(m.id))n["catch"](function(){}),n.reject(),a.o["delete"](m.id);throw k;case 3:p=_.v(b);for(e=p.next();!e.done;e=p.next())q=e.value,(t=a.o.get(q.id))&&!t.done&&(t.resolve(),a.g.debug("(all) finished setting up stream "+q.id));_.z(u)}})};kH=function(a){var b=a.j.presentationTimeline.getDuration();Infinity>b?JF(a.F.Y,b):JF(a.F.Y,Math.pow(2,32))};
|
|
166
|
+
FH=function(a,b){function c(n){return n.type===_.jk&&n.stream.mimeType===_.Ic}if(c(b))return DF(a.F.Y,b.stream.originalId||""),null;b.type===_.jk&&EF(a.F.Y);if(!wF(a.F.Y)&&b.type!==_.jk)return a.h.bufferLimitUpdateInterval?a.h.bufferLimitUpdateInterval/2:.5;var d=oH(b),e=a.F.Hb(),f=xH(a,b,e);a.g.debug(d,"timeNeeded\x3d"+f);var g=a.F.Y.Ya(b.type,e);a.g.debug(d,"update_:",dC+e,"bufferedAhead\x3d"+g);var k=Math.max(a.j.minBufferTime||0,a.h.rebufferingGoal,a.h.bufferingGoal)*a.l,l=wD(a.j.presentationTimeline);
|
|
167
|
+
if(null!=l&&f>=l&&!b.zf)return DH(a,b),null;b.endOfStream=!1;l=wH(a,b.stream).id;var m=UG(a,f);null!=m&&(b.pc=m);if(m!==l)return a.g.debug(d,"need Period "+m,dC+e,"timeNeeded\x3d"+f,"currentPeriodId\x3d"+l),null;if(g>=k)return a.g.debug(d,"buffering goal met"),a.h.bufferLimitUpdateInterval||.5;g=a.F.Y.Xa(b.type);g=yH(a,b,e,g,l);if(!g)return a.j.presentationTimeline.isLive()||b.type===_.jk?a.h.bufferLimitUpdateInterval||1:(a.g.debug("Media state "+d+": no next segment found. Assuming EOS."),DH(a,b),
|
|
168
|
+
null);d=Infinity;k=_.v(a.a.values());for(m=k.next();!m.done;m=k.next())m=m.value,c(m)||(m=xH(a,m,e),d=Math.min(d,m));if(f>=d+a.j.presentationTimeline.h)return a.h.bufferLimitUpdateInterval||1;b.Nj=0;EH(a,b,e,l,g)["catch"](function(){});return null};DH=function(a,b){a.g.debug(oH(b),"buffered to end of presentation");b.endOfStream=!0;if(b.type===_.Kg){var c=a.a.get(_.jk);c&&c.stream.mimeType===_.Ic&&(c.endOfStream=!0)}};
|
|
169
|
+
xH=function(a,b,c){return b.mc&&b.ma?wH(a,b.mc).startTime+b.ma.endTime:Math.max(c,b.Nj)};
|
|
170
|
+
yH=function(a,b,c,d,e){if(null==e)return a.g.warn(BB),null;if(b.stream.segmentLookupStrategy===_.ZB)b.stream.segmentIterator?a=OD(b.stream.segmentIterator):b.ma||d?(c=b.ma?b.ma.endTime:d,a.g.info(EB,"looking up segment from new stream endTime:",c),b.stream.segmentIterator=QD(b.stream.segmentIndex,c),e=b.stream.segmentIterator.next().value,null===e&&(b.stream.segmentIterator=null,a.g.warn(EB,RB,"endTime:",c,b.ma)),a=e):(e=OG(a,e),e=Math.max(0,c-e.startTime),a.g.info(EB,"looking up segment","lookupTime:",
|
|
171
|
+
e,cC,c),b.stream.segmentIterator=QD(b.stream.segmentIndex,e),b=b.stream.segmentIterator.next().value,null===b&&a.g.warn(EB,RB,"lookupTime:",e,cC,c),a=b);else{var f=oH(b);if(b.ma&&b.stream===b.mc)c=b.ma.position+1,a.g.debug(f,"next position known:","position\x3d"+c),a=GH(a,b,e,c);else{if(b.ma){a.g.debug(f,"next position unknown: another Stream buffered");f=wH(a,b.mc);var g=HH(a,b,f.startTime+b.ma.endTime,e)}else a.g.debug(f,"next position unknown: nothing buffered"),g=HH(a,b,d||c,e);if(null==g)a=null;
|
|
172
|
+
else if(f=GH(a,b,e,g),null==f)a=null;else{var k=null==a.h?!1:a.h.ignoreDrift;null!=d||k||(d=f,d.Ua+d.startTime+2>c&&(a=GH(a,b,e,Math.max(0,g-1)))&&(f=a));a=f}}}return a};HH=function(a,b,c,d){var e=oH(b);d=OG(a,d);var f=Math.max(0,c-d.startTime);b=b.stream.findSegmentPosition(f);a.g.debug(e,"Looked up segment:",dC+c,"lookupTime\x3d"+f,VB+d.startTime,"Result: segment position\x3d"+b);null==b&&a.g.warn(e,"cannot find segment:",VB+d.startTime,"lookupTime\x3d"+f);return b};
|
|
173
|
+
GH=function(a,b,c,d){var e=oH(b);if(null==c)return a.g.warn(e,BB),null;c=OG(a,c);var f=b.stream.getSegmentReference(d);if(!f)return a.g.debug(e,"segment does not exist:",VB+c.startTime,"position\x3d"+d),null;var g=a.j.presentationTimeline;d=_.CD(g);g=BD(g);return!b.zf&&(c.startTime+f.endTime<d||c.startTime+f.startTime>g)?(a.g.debug(e,"segment is not available:",VB+c.startTime,gC+f.startTime,eC+f.endTime,"availabilityStart\x3d"+d,"availabilityEnd\x3d"+g),null):f};
|
|
174
|
+
EH=function(a,b,c,d,e){var f,g,k,l,m,n,p,q,t,u,y;return _.I(function(A){f=_.Pq;g=oH(b);k=OG(a,d);a.g.debug(g,"fetchAndAppend_:",dC+c,VB+k.startTime,fC+e.position,gC+e.startTime,eC+e.endTime);l=b.stream;m=b.stream.segmentIterator;n=a.j.presentationTimeline.getDuration();p=IH(a,d);q=Math.max(0,k.startTime-.1);t=p?p.startTime+.01:n;u=JH(a,b,k,q,t,e);b.Mb=!0;b.Nf=!1;a.g.debug(g,"fetching segment");y=a.F.Y.Xa(b.type)||0;u.then(function(){return a.f||a.w?null:KH(a,b,e,function(D,B){return a.f||a.w?null:
|
|
175
|
+
LH(a,b,c,k,l,e,D,B)})}).then(function(){if(!a.f&&!a.w){if(!a.j.presentationTimeline.isLive()&&b.type!==_.jk){var D=oH(b),B=(a.F.Y.Xa(b.type)||0)-y,E=e.endTime-e.startTime,C=B-E;if(Math.abs(C)>=Math.min(.01,E)&&Math.abs(C)<=Math.min(1,E)){a.g.debug(D,"Adjusted segment",e.position,"with real duration",B,"and accounted for",C,"delta between segment duration and real duration");b.zf=!0;D=a.j.periods;l.adjustSegmentDurations(e.position,C);B=eD(D,l);E=D[B];var K=l.getDuration();gD(E,K);for(B+=1;B<D.length;B++)D[B].startTime+=
|
|
176
|
+
C}}b.Mb=!1;b.fh=!1;b.vc||a.F.Tf();m&&(C=m.next().value)&&a.g.debug("New iterated segment",C);WG(a,b,0);a.D?C=!1:(a.D=MH(a),C=a.D);C&&(a.g.debug("startup complete"),C=wH(a,l).id,NH(a,C),a.F.jo&&(a.g.debug("calling onStartupComplete()..."),a.F.jo()));a.g.debug(g,"finished fetch and append")}})["catch"](function(D){return _.I(function(B){if(a.f||a.w)return B["return"]();b.Mb=!1;if(b.type===f.TEXT&&a.h.ignoreTextStreamFailures)return 1001===D.code?a.g.warn(g,"Text stream failed to download. Proceeding without it."):
|
|
177
|
+
a.g.warn(g,"Text stream failed to parse. Proceeding without it."),a.a["delete"](f.TEXT),B.C(0);if(7001===D.code)return b.Mb=!1,b.Db=null,WG(a,b,0),B.C(0);if(3017===D.code)return OH(a,b,D),B.C(0);if(1001===D.code&&D.data&&404===D.data[1])return a.g.warn(g,"request for segment failed","segment not available on server",fC+e.position,gC+e.startTime,eC+e.endTime,"error\x3d"+D),b.Mb=!1,b.Db=null,WG(a,b,1),B.C(0);if(b.type===f.TEXT){if(!(D instanceof _.O))return B["return"]();YG(b);if(xC(D.code))a.F.onError(new _.O(1,
|
|
178
|
+
2,2010,D,void 0,D.svtaCode));else a.F.onError(new _.O(1,2,2010,D,void 0,5001));return B.C(0)}if(xC(D.code))return _.x(B,PH(a,b,k,D),0);a.g.error(g,"failed fetch and append: code\x3d"+D.code);b.Od=!0;D instanceof _.O&&D.a(_.Q);return _.x(B,QH(a,D),0)})});_.z(A)})};
|
|
179
|
+
OH=function(a,b,c){var d=oH(b);if(Array.from(a.a.values()).some(function(f){return f!==b&&f.fh}))a.g.debug(d,GB,"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.Od=!0;a.w=!0;a.F.onError(c);return}a.g.warn(d,GB,"reducing buffering goals by "+(100-Math.round(100*a.l))+"%");b.fh=!0}WG(a,b,4)};
|
|
180
|
+
PH=function(a,b,c,d){var e,f;return _.I(function(g){e=1001===d.code&&500<=d.data.status;f=!0;e||(f=!a.F.wg(b.stream,c));if(!f)return g.C(0);b.Od=!0;d.a(_.Q);return _.x(g,QH(a,d),0)})};
|
|
181
|
+
JH=function(a,b,c,d,e,f){var g,k,l,m,n,p;return _.I(function(q){g=c.startTime-f.Ua;k=b.Nf||f.initSegment!==(b.ma&&b.ma.initSegment);if(!k&&g===b.$i)return q["return"]();b.$i=g;l=oH(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=HF(a.F.Y,b.type,g,d,e,b.stream.mimeType,b.stream.codecs);if(!b.stream.initSegmentReference||!k)return q["return"](m);a.g.debug(l,XB);n=f&&f.initSegment||b.stream.initSegmentReference;
|
|
182
|
+
p=RH(a,b,n,l);return q["return"](Promise.all([m,p]))})};RH=function(a,b,c,d){var e,f;return _.I(function(g){switch(g.a){case 1:return _.F(g,2),_.x(g,SH(a,b,c),4);case 4:e=g.f;if(a.f)return g["return"]();a.g.debug(d,"appending init segment");return _.x(g,TH(a,e,b),5);case 5:return _.x(g,CF(a.F.Y,b.type,e,null,null,!!b.stream.closedCaptions&&0<b.stream.closedCaptions.size),6);case 6:_.G(g,0);break;case 2:throw f=_.H(g),b.Nf=!0,f;}})};
|
|
183
|
+
TH=function(a,b,c){var d;return _.I(function(e){if(!a.h.patchEdgeWhenMixedContent||!_.qi())return e.C(0);d=JG(b);return _.x(e,CF(a.F.Y,c.type,d.buffer,null,null,!!c.stream.closedCaptions&&0<c.stream.closedCaptions.size),0)})};
|
|
184
|
+
LH=function(a,b,c,d,e,f,g,k){k=void 0===k?!1:k;var l,m,n,p,q,t,u,y,A,D,B;return _.I(function(E){switch(E.a){case 1:l=oH(b);if(!(e&&e.keyId&&a.F.qe)){E.C(2);break}a:{var C=a.F.qe;var K=e.keyId;if(K)for(var P=_.v(C.h.keys()),T=P.next();!T.done;T=P.next()){T=C.h.get(T.value);for(var W=0;W<T.Eb.length;W++)if(T.Eb[W]===K){C=T;break a}}C=null}m=C?C.Ab:null;if(!m){a.g.warn("Unable to find DRM session for "+e.keyId);E.C(2);break}_.F(E,4);return _.x(E,m,6);case 6:_.G(E,2);break;case 4:_.H(E),a.g.warn("DRM session load failed, cannot append segment!");
|
|
185
|
+
case 2:if(C=e.encrypted&&e.keyId&&a.F.qe)C=a.F.qe.o.get(e.keyId),C=!(!C||C!==_.df&&C!==_.ve);if(!C){E.C(7);break}YG(b);n=wH(a,e).id;p=NH(a,n);if(!p){E.C(8);break}return _.x(E,p,8);case 8:return q=a.F.wg(e,d,$B),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.")),E["return"]();case 7:return y=e.closedCaptions&&0<e.closedCaptions.size,null!=e.emsgSchemeIdUris&&0<e.emsgSchemeIdUris.length&&(new _.Un).da("emsg",
|
|
186
|
+
a.so.bind(a,d,f,e.emsgSchemeIdUris)).parse(g),_.x(E,UH(a,b,c),10);case 10:if(a.f)return E["return"]();A=f.startTime+d.startTime;D=f.endTime+d.startTime;a.g.debug(l,"Appending segment with "+(A.toFixed(3)+" - "+D.toFixed(3)+" KeyID: ")+(e.keyId+" Width: ")+(e.width+" Height: "+e.height+" Bitrate: ")+(_.S.vg(e.bandwidth)+" Fragment: ")+k);B=e.type===_.Kg&&null!=e.muxedAudioId&&!a.A;return _.x(E,CF(a.F.Y,b.type,g,A,D,y,e.id,k,B),11);case 11:if(a.f)return E["return"]();a.g.debug(l,"appended media segment");
|
|
187
|
+
b.mc=e;b.ma=f;_.z(E)}})};VH=function(a,b,c){(new _.Un).N(_.Oe,_.Vn).N(_.wg,_.Vn).N(_.Je,_.Vn).N(_.Ne,_.Vn).N(_.gg,_.Vn).da(_.ig,_.Wn).N("encv",function(d){d.reader.skip(78);_.Vn(d)}).N(_.ag,_.Vn).N("schi",_.Vn).N("tenc",function(d){d.reader.skip(6);if(_.Nn(d.reader)){d.reader.skip(1);var e=_.Ll(_.Tn(d.reader,16));e!==b.stream.keyId&&(a.g.debug(oH(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)};
|
|
188
|
+
UH=function(a,b,c){var d,e,f,g,k;return _.I(function(l){if(1==l.a){if(a.f)return l["return"]();d=oH(b);a.g.debug(d,"checking buffer length");e=Math.max(a.h.bufferBehind,a.j.presentationTimeline.h);f=a.F.Y.gc(b.type);if(null==f)return a.g.debug(d,"buffer behind okay because nothing buffered:",dC+c,PB+e),l["return"]();g=c-f;k=g-e;if(.01>=k)return a.g.debug(d,"buffer behind okay:",dC+c,QB+g,PB+e,"underflow\x3d"+Math.abs(k)),l["return"]();a.g.debug(d,"buffer behind too large:",dC+c,QB+g,PB+e,"overflow\x3d"+
|
|
189
|
+
k);return _.x(l,a.F.Y.remove(b.type,f,f+k),2)}if(a.f)return l["return"]();a.g.debug(d,"evicted "+k+wB);_.z(l)})};MH=function(a){return a.I?!0:Array.from(a.a.values()).filter(function(b){return b.type!==_.jk}).every(function(b){return!b.vc&&!b.Rc&&b.ma})};NH=function(a,b){var c=null;a.B.has(b)||(c=BH(a,b).then(function(){a.f||zH(a)})["catch"](zC));CH(a);return c};
|
|
190
|
+
WH=function(a,b){var c,d,e,f,g,k,l,m,n,p,q,t,u,y,A,D,B,E;_.I(function(C){switch(C.a){case 1:c=oH(b);d=_.Pq;e=wH(a,b.stream).id;if(b.pc===e)return C["return"]();f=b.pc;g=Array.from(a.a.values());k=g.every(function(K){return K.pc===f});if(!k)return a.g.debug(c,"not all MediaStates need Period "+f),C["return"]();l=g.every(pH);if(!l)return a.g.debug(c,"all MediaStates need Period "+f+", but not all MediaStates are idle"),C["return"]();a.g.debug(c,"all need Period "+f);_.F(C,2);return _.x(C,BH(a,f),4);
|
|
191
|
+
case 4:if(a.f)return C["return"]();sF(a.F.Y);m=g.every(function(K){var P=pH(K),T=wH(a,K.stream).id;return P&&K.pc===f&&T!==f});if(!m)return a.g.debug(c,"ignoring transition to Period",f,"since another is happening"),C["return"]();n=OG(a,f);a.g.debug(c,"Streaming period",f,n);a.G=!1;a.g.debug(c,"calling onChooseStreams()...");p=a.F.Sg(n);a.I=!p.audio&&!p.video&&!!p.text;q=AH(p);t=_.v(a.a.keys());for(u=t.next();!u.done;u=t.next())if(y=u.value,!q.has(y)&&y!==d.TEXT)return a.g.error(c,"invalid Streams chosen: missing "+
|
|
192
|
+
y+" Stream"),a.F.onError(new _.O(_.Q,5,5005)),C["return"]();A=_.v(Array.from(q.keys()));for(u=A.next();!u.done;u=A.next())if(D=u.value,!a.a.has(D))if(D===d.TEXT)hH(a,{text:q.get(d.TEXT)},n.startTime),q["delete"](D);else return a.g.error(c,"invalid Streams chosen: unusable "+D+" Stream"),a.F.onError(new _.O(_.Q,5,5005)),C["return"]();B=Array.from(a.a.keys());E=B.map(function(K){var P;return _.I(function(T){if(1==T.a)return P=q.get(K),P?_.x(T,bH(a,P,!1,0),3):(a.a["delete"](K),T.C(0));WG(a,a.a.get(K),
|
|
193
|
+
0);_.z(T)})});return _.x(C,Promise.all(E),5);case 5:if(a.f)return C["return"]();zH(a);_.G(C,0);break;case 2:_.H(C),_.z(C)}})};UG=function(a,b){var c=cD(a.j.periods,b+_.qw);return c?c.id:null};wH=function(a,b){var c=a.j.periods,d=eD(c,b);c=c[d];if(!c)throw new _.O(_.Q,5,5006,"No period found for stream with ID "+b.id+".");return c};XH=function(a,b){if(a.F.Dd){var c=b.Oa;if(c)return a.F.Dd.getBaseUriCollectionById(c.id)}return null};
|
|
194
|
+
YH=function(a,b,c){if(a.F.Dd&&b){c&&0===c.request.uriIndex||a.F.Dd.banLocation(b.pa[0].serviceLocationId);var d=c.request,e=c.timeMs;c=c.data.byteLength;e&&c&&a.F.Dd.notifyThroughput(b.pa[d.uriIndex].serviceLocationId,e,c)}};
|
|
195
|
+
KH=function(a,b,c,d){var e,f,g,k,l,m,n,p,q,t,u;return _.I(function(y){if(1==y.a)return e=ZH(a,c,b.type),f=c.f(),g=c.Fd||a.h.disableFragmentSupport||!!f,k=!1,e.onFragment=g?null:function(A){k=!0;return d(A.data,!0)},e.disableMergedFragments=a.h.disableMergedFragments,a.g.debug("fetching media segment",c),l=$H(a,b,c,!1),m=aI(a,e,b,c,l),n=a.F.xe(),(p=b.bc)&&a.h.enableStalledSegmentAbort&&n.beginSegmentMonitor(p,1E3*a.h.rebufferingGoal),_.x(y,m,2);q=y.f;t=q.timeMs;u=q.data.byteLength;t&&u&&n.segmentDownloaded(t,
|
|
196
|
+
u);return k?y["return"]():_.x(y,d(q.data,!1),0)})};SH=function(a,b,c){var d,e,f,g;return _.I(function(k){if(1==k.a)return d=_.Pq,e=ZH(a,c,b.type),e.responseModifiers.push(function(l){VH(a,b,l.data)}),b.type===d.VIDEO&&a.h.overridePasp&&e.responseModifiers.push(a.up.bind(a)),a.g.debug(XB,c),f=$H(a,b,c,!0),_.x(k,aI(a,e,b,c,f),2);g=k.f;return k["return"](g.data)})};
|
|
197
|
+
aI=function(a,b,c,d,e){var f=XH(a,d);b=_.cm(a.F.Lb,b,e);c.bc=b;return b.U.then(function(g){YH(a,f,g);c.bc=null;return g})["catch"](function(g){YH(a,f);throw g;})};
|
|
198
|
+
$H=function(a,b,c,d){var e=yH(a,b,a.F.Hb(),c.endTime,wH(a,b.stream).id);if(d)var f="i";else a:{if(f=b.stream){var g=f.type;if(g===_.Kg){f=FC(f.type,_.Hm(f.mimeType,f.codecs))?"av":"v";break a}if(g===_.Rc){f="a";break a}if(g===_.mg){f=f.mimeType===_.Kc?"tt":"c";break a}}f=void 0}return{stream:b.stream,segment:d?void 0:c,nextSegment:e?e:void 0,streamType:a.j.presentationTimeline.isLive()?"l":"v",objectType:f}};
|
|
199
|
+
ZH=function(a,b,c){var d=[],e=XH(a,b);e&&(d=b.Kd(),d=_.sE(e,d));d.length||(d=b.Ia());a=_.kD(d,b.la,b.fa,a.h.attemptParameters,b.startTime,b.endTime,c,b.timescale);a.type=2;if(b=b.f())a.keyInfo=b;return a};
|
|
200
|
+
tH=function(a,b,c,d){var e,f,g,k;return _.I(function(l){if(1==l.a)return e=oH(b),b.vc=!1,b.gg=!1,b.tf=0,b.Rc=!0,b.stream.segmentIterator=null,a.g.debug(e,"clearing buffer"),d?(g=a.F.Hb(),k=a.F.Y.getDuration(),f=a.F.Y.remove(b.type,g+d,k)):f=a.F.Y.clear(b.type).then(function(){return!a.f&&c?a.F.Y.flush(b.type):null}),_.x(l,f,2);if(a.f)return l["return"]();a.g.debug(e,"cleared buffer");b.mc=null;b.ma=null;b.Rc=!1;b.endOfStream=!1;b.zf=!1;WG(a,b,0);_.z(l)})};
|
|
201
|
+
WG=function(a,b,c){a.g.debug(oH(b),"updating in "+c+wB);b.Db=(new _.Wh(function(){var d;return _.I(function(e){if(1==e.a)return _.F(e,2),_.x(e,a.qc(b),4);if(2!=e.a)return _.G(e,0);d=_.H(e);if(a.F)a.F.onError(d);_.z(e)})})).ia(c)};YG=function(a){null!=a.Db&&(a.Db.stop(),a.Db=null)};OG=function(a,b){var c=a.j.periods.find(function(d){return d.id===b})||null;if(!c)throw new _.O(_.Q,5,5006,"Period "+b+" not found");return c};
|
|
202
|
+
IH=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};ZG=function(a){return _.I(function(b){return a.bc?_.x(b,a.bc.abort(),0):b.C(0)})};AH=function(a){var b=new Map;a.audio&&b.set(_.Rc,a.audio);a.video&&b.set(_.Kg,a.video);a.text&&b.set(_.jk,a.text);return b};
|
|
203
|
+
QH=function(a,b){var c;return _.I(function(d){switch(d.a){case 1:if(a.f)return d["return"]();if(!a.F.Tj){d.C(2);break}_.F(d,3);return _.x(d,a.F.Tj(b),5);case 5:_.G(d,2);break;case 3:c=_.H(d),c.cause=b,b=c;case 2:if(!b.f)a.F.onError(b);_.z(d)}})};oH=function(a){return"("+a.type+":"+a.stream.id+")"};pH=function(a){return!a.Mb&&null==a.Db&&!a.vc&&!a.Rc};bI=function(){this.a=null};
|
|
204
|
+
eI=function(){_.Bn.call(this,SB);var a=this;this.H=cI;this.yd=this.j=this.na=null;this.wh=!1;this.o=new _.ki;this.W=this.zh=this.Pf=this.I=this.wd=this.B=this.M=this.A=null;this.Ke=!1;this.a=this.K=this.J=null;this.T=[];this.f=null;this.h=new _.cG;this.ba=this.vd=null;this.ak=1E9;this.Vf=new Set;this.Fa=null;this.$j=!1;this.Zj=0;this.ha=null;this.l=new lG;this.G=null;this.ud=new GE({isSeeking:function(){return a.rh},In:function(b){null!==a.I&&(a.I.w=10===b);a.G&&_.Aq(a.G.a,b)},ko:function(){a.W&&
|
|
205
|
+
a.W.stop()},trigger:function(b){return a.trigger(b)}});this.Ge=new rG(this.configuration.preferredAudioLanguage||[],this.configuration.preferredAudioRole,this.configuration.preferredAudioChannelCount,this.configuration.preferSpatialAudio,this.configuration.mediaSource.codecSwitchingStrategy);this.ue=this.configuration.preferredTextLanguage;this.w=new iG;this.Aa=this.Sb=null;this.od=new Map;this.Je=null;this.Mf=this.configuration.preferredTextRole;this.re=this.configuration.preferForcedSubtitles;this.o.on(window,
|
|
206
|
+
"online",function(){a.H===dI&&qH(a.a)});this.Xf=this.De=this.Yf=null;this.X=_.ta;this.Le=new bI;this.we=null};fI=function(a){return new _.XC(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,_.jh(e.value.renditions))}return d.find(function(f){return f.id===b.toString()})||null})};
|
|
207
|
+
gI=function(a){var b;return _.I(function(c){switch(c.a){case 1:b=a.w.a;if(!b){c.C(2);break}return _.x(c,b["catch"](function(){}),2);case 2:return a.vd&&(a.vd.release(),a.vd=null),_.x(c,_.Bn.prototype.release.call(a),4);case 4:return _.x(c,a.unload(),5);case 5:HE(a.ud,0),_.z(c)}})};hI=function(a){return _.I(function(b){if(1==b.a)return _.x(b,Promise.all(a.T.map(function(c){return c.stop()})),2);a.T=[];_.z(b)})};iI=function(a){a.T.map(function(b){return b.requestStop()})};
|
|
208
|
+
jI=function(a){var b=new _.bw;(a=a.playlist)&&a.cropTimeline&&(a.startTime||a.endTime)&&(b.h={start:a.startTime||null,end:a.endTime||null});return b};
|
|
209
|
+
mI=function(a,b){var c,d,e;return _.I(function(f){c=a.T[a.T.length-1];b.periods.forEach(function(g){g.parser=c});a.X===_.ta?(kI(a,b.cues),mH(a.a,b)):a.X===_.ob&&(a.f=PE(a.f,LE(b)),d=a.configuration.playlist.endTime,e=a.f.presentationTimeline.a.a,d&&e>d&&(a.log.info("Reached end of playlist. Turning timeline static."),iI(a),a.T=[],_.vD(a.f.presentationTimeline,!0),a.trigger(new _.R(_.Ce))),lI(a,a.f),mH(a.a,a.f));_.z(f)})};
|
|
210
|
+
nI=function(a){return _.I(function(b){iI(a);a.T=[];a.X===_.ob?a.trigger(new _.R(_.Uf)):a.trigger(new _.R(_.Ce));_.z(b)})};
|
|
211
|
+
lI=function(a,b){var c=a.getMediaPosition(),d=a.De,e=b.periods,f=d.a;d.a=[];var g=null,k=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?k.a+=m:(g=l.configurationId||"",k=new _.aw(g||"",l.startTime,m,!1),d.a.push(k))}d.h&&(k=d.h,g=k.start,k=k.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!=k&&g&&k>=g.f&&k<=g.f+g.a&&(g.a=k-g.f));wC(d,c);a:if(c=d.a,f.length!==c.length)f=!1;else{for(d=
|
|
212
|
+
0;d<f.length;d++)if(!f[d].va(c[d])){f=!1;break a}f=!0}!f&&a.trigger(new _.R(_.Vf));MD(a.Xf);JD(a.K,b.cues)};tI=function(a){var b,c;return _.I(function(d){if(1==d.a)return oI(a),_.x(d,pI(a),2);if(3!=d.a){qI(a);b=_.si(4)||_.si(5);if(!b)return d.C(3);c=a.getSurface().getMedia();rI(a,c);return _.x(d,sI(a,c),3)}a.configuration=a.vb;_.z(d)})};
|
|
213
|
+
uI=function(a,b){return _.I(function(c){if(1==c.a){if(!a.configuration.contentSteering.enabled)return c.C(2);if(a.ba)return c.C(3);a.ba=new uE(a.configuration.contentSteering,a.getNetworkEngine());a.ba.on(TB,function(d){a.trigger(d)});return _.x(c,wE(a.ba,b),3)}return 2!=c.a?c["return"](a.ba):c["return"](null)})};
|
|
214
|
+
CI=function(a,b,c){c=void 0===c?!0:c;var d,e,f,g,k;return _.I(function(l){switch(l.a){case 1:return d=Date.now()/1E3,e=new _.ol,a.w.a=e,vI(a,b),_.F(l,2),oI(a),_.x(l,wI(a),4);case 4:return kG(a.w,e),a.ea=_.Jq(b),a.configuration=_.zn([a.vb,b]),UC(a.configuration.xmlParser),a.we&&a.configuration.mse.sendPlaybackSessionIdHeader&&a.getNetworkEngine().headers.set(OB,a.we),a.log.info(_.bb,a.configuration),a.log.info(_.sb,a.ea),_.x(l,xI(a,e),5);case 5:return kG(a.w,e),_.x(l,yI(a,b,a.getSourceIndex(),e,!1),
|
|
215
|
+
6);case 6:return f=l.f,kG(a.w,e),a.T=[f.parser],a.f=f.manifest,kI(a,f.manifest.cues),g=a,_.x(l,zI(a,a.f,a.configuration),7);case 7:g.A=l.f;kG(a.w,e);if(!c){l.C(8);break}return _.x(l,AI(a,e),9);case 9:kG(a.w,e),a.o.one(a.j,_.Ee,function(){var m=Date.now()/1E3-d;a.G&&(a.G.B=m)});case 8:e.resolve();_.G(l,0);break;case 2:k=_.H(l),BI(a,k,e),_.z(l)}})};
|
|
216
|
+
vI=function(a,b){b.cmcd&&b.cmcd.enabled&&(b.cmcd.sessionId||(b.cmcd.sessionId=a.we?a.we:void 0),a.vd=new MC(a.getNetworkEngine(),b.cmcd,{getBandwidthEstimate:function(){try{return a.getBandwidthEstimate()}catch(c){return null}},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),Md:a.Md.bind(a)}))};
|
|
217
|
+
kI=function(a,b){if(a.configuration.ads.hls.mockCuesFn){var c=a.configuration.ads.hls.mockCuesFn(a);JD(a.K,c)}else JD(a.K,b)};BI=function(a,b,c){b=DI(a,b,c);c["catch"](function(){});c.reject(b);a.onError(b);throw b;};DI=function(a,b,c){var d=a.w;return null!=d.a&&d.a===c||b instanceof _.O&&7E3===b.code?b instanceof _.O?b:new _.O(_.Q,7,7003,"Unexpected error.",b):jG(a.w)};wI=function(a){return a.na?a.na["catch"](function(){}):Promise.resolve()};
|
|
218
|
+
xI=function(a,b){var c;return _.I(function(d){if(1==d.a)return a.G=new _.Fq,HE(a.ud,2),c=EI(a,a.configuration),_.x(d,sI(a,c),2);kG(a.w,b);a.K=new HD;ID(a.K,function(e){a.log.info("Timeline cue found",e);FI(a,_.qg,e)},function(){a.log.info("Timeline cues changed");a.trigger(new _.R(_.tg))});_.z(d)})};
|
|
219
|
+
yI=function(a,b,c,d,e){var f,g,k,l,m;return _.I(function(n){switch(n.a){case 1:return f=b,g=_.Jq(f),k=g[c],_.x(n,GI(a,k),2);case 2:return l=n.f,kG(a.w,d),_.pp(aC),_.x(n,HI(a,l,k,f.id||""),3);case 3:m=n.f;kG(a.w,d);m.periods.forEach(function(p){p.parser=l});if(!e||!m.presentationTimeline.o){n.C(4);break}return _.x(n,l.stop(),5);case 5:kG(a.w,d);case 4:return _.pp("manifest.end"),_.rp("Fetch and parse manifest",aC,"manifest.end"),n["return"]({parser:l,manifest:m})}})};
|
|
220
|
+
II=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a)return _.x(f,yI(a,b,0,null,!0),2);c=f.f;try{return d=[a.f,LE(c.manifest)],e=OE(d,a.f.presentationTimeline),f["return"]({parser:c.parser,manifest:e})}catch(g){throw new _.O(_.Q,7,7003,"Failed to append load manifest");}})};EI=function(a,b){var c=a.getSurface().getMedia();c.loop=!!b.loop;_.N.R(b.volume)||a.setVolume(b.volume);_.N.R(b.muted)||a.setMuted(b.muted);rI(a,c);return c};
|
|
221
|
+
rI=function(a,b){a.j||(a.o.on(b,_.le,function(){if(a.j.error){var c=a.j.error.code;if(1===c)c=null;else{var d=a.j.error.msExtendedCode;d&&(0>d&&(d+=Math.pow(2,32)),d=d.toString(16));c=new _.O(_.Q,3,3016,{code:c,extendedError:d,message:a.j.error.message})}}else c=null;if(c)a.onError(c)}),a.j=b)};qI=function(a){a.j&&(a.o.off(a.j,_.le),a.j=null);a.W&&(a.W.stop(),a.W=null)};
|
|
222
|
+
pI=function(a){var b;return _.I(function(c){switch(c.a){case 1:a.H!==JI&&(a.H=cI);if(b=a.j)a.o.off(b,_.Ee),a.o.off(b,_.vf),a.o.off(b,_.ef),a.o.off(b,_.ke),a.o.off(b,_.Lf),a.o.off(b,_.Jf);a.K&&(a.K.release(),a.K=null);a.wd&&(a.wd.release(),a.wd=null);a.W&&(a.W.stop(),a.W=null);return _.x(c,hI(a),2);case 2:if(!a.h){c.C(3);break}return _.x(c,a.h.stop(),3);case 3:if(!a.a){c.C(5);break}return _.x(c,a.a.destroy(),6);case 6:a.a=null;case 5:if(!a.ba){c.C(7);break}return _.x(c,a.ba.destroy(),8);case 8:a.ba=
|
|
223
|
+
null;case 7:a.B&&(a.B.release(),a.B=null);a.I&&(a.I.release(),a.I=null);if(!a.M){c.C(9);break}return _.x(c,a.M.destroy(),10);case 10:a.M=null;case 9:a.yd&&(a.yd.release(),a.yd=null);a.Pf&&(a.Pf.release(),a.Pf=null);b&&b.src&&(b.removeAttribute("src"),b.load());if(!a.A){c.C(11);break}return _.x(c,a.A.destroy(),12);case 12:a.A=null;case 11:a.l.clear(),a.J=null,a.Vf.clear(),a.f=null,a.G=null,a.od.clear(),a.Ke=!1,KI(a),_.z(c)}})};
|
|
224
|
+
sI=function(a,b){var c,d,e,f,g;return _.I(function(k){if(1==k.a)return c=window.muxjs?new mF:new _.nF,d=_.xq(a.configuration,[_.se,hC]),e=d.create(a),a.L=e,f=fI(a),f.track(a),a.yd=f,g=new _.pF(b,c,e,f,a.configuration),_.x(k,g.open(),2);a.M=g;_.z(k)})};GI=function(a,b){var c,d;return _.I(function(e){if(1==e.a)return c=a.getNetworkEngine(),_.x(e,_.dw(b.url,c,a.configuration.manifest.attemptParameters,b.type||null),2);d=e.f;d.configure(a.configuration.manifest);return e["return"](d)})};
|
|
225
|
+
HI=function(a,b,c,d){return(new _.Ql(Promise.resolve().then(function(){var e,f,g;return _.I(function(k){switch(k.a){case 1:e=null;case 2:if(e){k.C(3);break}_.F(k,4);var l=c.url;var m=LI(a,d);l=b.start(l,m);return _.x(k,l,6);case 6:e=k.f;_.G(k,2);break;case 4:f=_.H(k);if(!a.xc)throw f;return _.x(k,a.xc(c.url,f),8);case 8:if(g=k.f)c.url=g;else throw f;k.C(2);break;case 3:if(0===e.periods.length)throw new _.O(_.Q,4,4014);MI(e.periods);return k["return"](e)}})}),function(){a.log.info("Aborting parser step...");
|
|
227
226
|
return b.stop()})).U};
|
|
228
|
-
|
|
229
|
-
if(A.length&&!a.configuration.disableRestrictions){A=a.getPeriods();for(var B=0;B<A.length;B++)for(var E=A[B],C=_.v(E.variants),K=C.next();!K.done;K=C.next()){K=K.value;var P=[];K.audio&&P.push(K.audio);K.video&&P.push(K.video);P=_.v(P);for(var T=P.next();!T.done;T=P.next()){T=T.value;var W=K.allowedByKeySystem;if(T.keyId){var oa=t[D?"00":T.keyId];oa=!!oa&&!
|
|
230
|
-
a.log.warn("DRM Key not available for KID: '"+(T.keyId+"'. Applying restrictions to "+oa)));E===u&&W!==K.allowedByKeySystem&&(y=!0)}}}if(t=
|
|
231
|
-
Jd:function(){return a.Jd()}});e=b.periods.every(function(t){return t.variants.some(function(u){return u.drmInfos.some(function(y){return y.licenseServerUriOrigin===_.
|
|
232
|
-
_.
|
|
233
|
-
|
|
234
|
-
b),a.h.configure(a.configuration.abr),a.
|
|
235
|
-
Wd:function(t){c.playbackRate=t},
|
|
236
|
-
e
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
(a.log.debug("Buffering state changed. Is buffering",d,"buffered to end",b,"state",a.getState()),
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
(b.width+"x"+b.height+"@"+b.bandwidth)),a.configuration.abr.enabled=!1,a.h.disable());k=
|
|
245
|
-
m.video,c,d),4)}
|
|
246
|
-
|
|
247
|
-
k=!1;l=void 0;if(d){if(l=g.find(function(D){return D.video.id===d.id}),!l&&(a.log.debug("Cannot find exact variant, looking for anything else that matches with given audioId"),k=!0,m=a.getTrackManager().
|
|
248
|
-
Error("Audio codecs not compatible with active audio.");return _.x(A,f.parser.loadVariant(l,f.id),4);case 4:return t=A.f,u=t.audio,a.Sb=u.id,y=g.map(
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
227
|
+
zI=function(a,b,c){var d,e,f,g,k,l,m,n,p;return _.I(function(q){switch(q.a){case 1:_.pp("initDrm.start");d=new _.wp({Lb:a.getNetworkEngine(),onError:function(t){return a.onError(t)},Vg:function(t){if(a.a){var u=iF(a),y=!1,A=Object.keys(t);0===A.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 D=1===A.length&&"00"===A[0];D&&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.");
|
|
228
|
+
if(A.length&&!a.configuration.disableRestrictions){A=a.getPeriods();for(var B=0;B<A.length;B++)for(var E=A[B],C=_.v(E.variants),K=C.next();!K.done;K=C.next()){K=K.value;var P=[];K.audio&&P.push(K.audio);K.video&&P.push(K.video);P=_.v(P);for(var T=P.next();!T.done;T=P.next()){T=T.value;var W=K.allowedByKeySystem;if(T.keyId){var oa=t[D?"00":T.keyId];oa=!!oa&&!NI.includes(oa);K.allowedByKeySystem=oa}W!==K.allowedByKeySystem&&(oa=T.type,T.type===_.Kg&&(oa="video "+T.width+"x"+T.height+"@"+_.S.vg(T.bandwidth)),
|
|
229
|
+
a.log.warn("DRM Key not available for KID: '"+(T.keyId+"'. Applying restrictions to "+oa)));E===u&&W!==K.allowedByKeySystem&&(y=!0)}}}if(t=PG(a.a)){D=RG(a.a);A=SG(a.a);a:{B=t.variants;for(E=0;E<B.length;E++)if(B[E].audio===D&&B[E].video===A){D=B[E];break a}D=null}if(!D||D.allowedByKeySystem)a.log.info(CB),OI(a),PI(a,t.variants)}y&&t!==u&&(a.log.info(CB),OI(a),PI(a,u.variants))}},Ug:function(t,u){a.trigger(new _.R(_.Zd,{expirationTime:u}))},onEvent:function(t){return a.Cg(t)},getConfiguration:function(){return a.getConfiguration()},
|
|
230
|
+
Jd:function(){return a.Jd()}});e=b.periods.every(function(t){return t.variants.some(function(u){return u.drmInfos.some(function(y){return y.licenseServerUriOrigin===_.WB})})});c.drmResolver&&(f=c.drmResolver({hasLaurl:e}),(c.drm=f)&&_.hr(c.drm));g=c.drm;k=_.fl(g);d.f=k;l=g?g.offlineId||"":"";m=[];n=_.xv(b.periods);if(!l){q.C(2);break}p=_.ar(_.ff);if(!p){q.C(2);break}return _.x(q,p.f(a,n),4);case 4:return _.x(q,p.a(l),5);case 5:m=q.f;case 2:return _.x(q,_.Bp(d,n,m),6);case 6:return a.A=d,QI(a,b.periods),
|
|
231
|
+
_.pp("initDrm.end"),_.rp("Init DRM","initDrm.start","initDrm.end"),q["return"](d)}})};
|
|
232
|
+
AI=function(a,b){var c,d,e,f,g,k,l,m,n,p;return _.I(function(q){if(1==q.a)return c=a.j,RI(a,c),SI(a,a.f.periods),a.Ge=new rG(a.configuration.preferredAudioLanguage||[],a.configuration.preferredAudioRole,a.configuration.preferredAudioChannelCount,a.configuration.preferSpatialAudio,a.configuration.mediaSource.codecSwitchingStrategy),a.ue=a.configuration.preferredTextLanguage,a.Mf=a.configuration.preferredTextRole,a.re=a.configuration.preferForcedSubtitles,_.x(q,_.Sp(a.A,c),2);if(3!=q.a)return kG(a.w,
|
|
233
|
+
b),a.h.configure(a.configuration.abr),a.ih&&a.h.setCmsdManager(a.ih),a.h.init(function(t,u,y){var A,D,B;return _.I(function(E){if(1==E.a){if(!TI(a))return E["return"]();a.log.info("ABR switch to "+t.width+"x"+t.height);A=UI(a).find(function(C){return C.id===t.id})||null;if(!A)return a.log.warn("No matching variant found for track switch"),E.C(0);D=iF(a);return _.x(E,D.parser.loadVariant(A,D.id),3)}B=E.f;VI(a,B,u,y);_.z(E)})}),a.B=WI(a,c,a.configuration.startTime),a.wd=XI(a),a.I=new DG({Cc:function(){return c.playbackRate},
|
|
234
|
+
Wd:function(t){c.playbackRate=t},nn:function(t){c.currentTime+=t}}),EG(a.I,a.configuration.trickPlay),a.isLive()&&a.configuration.streaming.enableLiveEdgeChasing&&(a.Pf=new AG(a)),d=Math.max(1E-4,a.configuration.streaming.rebufferingGoal),YI(a,d),ZI(a)?SF(a.f,_.Ej(a.configuration.preferredVideoCodec),_.Ej(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount):RF(a.f,_.Ej(a.configuration.preferredVideoCodec),_.Ej(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount),
|
|
235
|
+
e=$I(a),e.h=a.configuration.streaming,a.a=e,a.H=dI,_.x(q,e.start(),3);kG(a.w,b);a.configuration.streaming.startAtSegmentBoundary&&(f=a.B.getTime(),g=aJ(a,f),bE(a.B.f,g));k=_.v(a.f.periods);for(l=k.next();!l.done;l=k.next())m=l.value,bJ(a,m);OI(a);n=UI(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");PI(a,n);_.z(q)})};TI=function(a){return a.a?a.a.G:!1};
|
|
236
|
+
RI=function(a,b){function c(d){a.j&&a.J&&(d.type===_.Xf&&a.xd?(a.J.a=xG,KI(a)):d.type===_.Ug&&8===a.getState()&&.1>a.getBufferInfo().Ya(a.getMediaPosition())?(a.J.a=xG,KI(a)):a.J&&cJ(a));dJ(a)}a.o.on(b,_.vf,c);a.o.on(b,_.ef,c);a.o.on(b,_.ke,c);a.o.on(b,_.Xf,c);a.o.on(b,_.Wf,c);a.o.on(b,_.Jf,c);a.o.on(b,_.Ug,c);a.o.on(b,_.Lf,function(){if(a.j){var d=a.j.playbackRate;0!==d&&a.I.set(d)}})};
|
|
237
|
+
MI=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)}};WI=function(a,b,c){return new gE(b,a.f,a.configuration.streaming,c,function(d){a.wd&&iE(a.wd,!0,d);a.a&&nH(a.a)},function(d){return a.dispatchEvent(d)},a.X===_.ob)};
|
|
238
|
+
XI=function(a){var b=new jE(a.j),c=new BG(a.f);CG(c,function(){OI(a)});b.a.add(c);a.K&&(c=new lE(a.K),mE(c,function(d){d.Rf&&d.Rf();FI(a,_.rg,d)},function(d){d.Tg&&d.Tg();FI(a,_.sg,d)},function(d,e){e||(d.Rf&&d.Rf(),FI(a,_.rg,d),d.Tg&&d.Tg(),FI(a,_.sg,d))}),b.a.add(c));a.X===_.ob&&(c=new LD(a.De,a.Le,function(d){return a.trigger(d)},a.configuration.playlist),b.a.add(c),a.Xf=c);return b};YI=function(a,b){a.J=new yG(b,Math.min(.5,b/2));a.J.a=xG;KI(a);a.W=(new _.Yh(function(){cJ(a)})).Qb(.25)};
|
|
239
|
+
cJ=function(a){if(a.j){switch(a.H){case dI:a:if(a.j.ended||yF(a.M))var b=!0;else{if(a.isLive()){b=BD(a.f.presentationTimeline);var c=a.getBufferInfo();if(null!==c&&(c=c.Xa(),null!==c&&c>=b)){b=!0;break a}}b=!1}break;default:b=!1}if(a.M){var d=AF(a.M);c=d.video;d=d.audio;var e=a.j.currentTime;c&&d?(c=c.Ya(e),d=d.Ya(e),c=Math.min(c,d)):c=c?c.Ya(e):d?d.Ya(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?wG:xG;d.a=c;d=e!==c}c=d;(d=eJ(a))&&a.vd&&(a.vd.f=!0);c||6===a.getState()&&!d?
|
|
240
|
+
(a.log.debug("Buffering state changed. Is buffering",d,"buffered to end",b,"state",a.getState()),KI(a)):a.Ke&&dJ(a)}};$I=function(a){var b={configuration:{an:a.X===_.ob},Hb:function(){return a.B.getTime()},Y:a.M,Lb:a.getNetworkEngine(),Dd:a.ba,Sg:a.vl.bind(a),ij:a.Fn.bind(a),onError:a.onError.bind(a),jj:a.On.bind(a),onEvent:a.Cg.bind(a),nj:a.tp.bind(a),Tf:a.co.bind(a),xe:function(){return a.h},wg:a.yk.bind(a),Tj:a.gp.bind(a),qe:a.A};return new _.NG(a.f,b)};
|
|
241
|
+
bF=function(a,b){var c,d,e;return _.I(function(f){switch(f.a){case 1:c=_.fJ;if(!a.f||!a.a){f.C(0);break}d=iF(a);return _.x(f,d.parser.loadTextStream(b.id,d.id),3);case 3:return e=f.f,_.x(f,XG(a.a,e),4);case 4:return gJ(a,d,e,!1),_.x(f,hJ(a,e),5);case 5:a.ue=e.language,a.re=e.kind===c.Ch,_.z(f)}})};
|
|
242
|
+
ZE=function(a,b,c){c=void 0===c?!1:c;var d=void 0===d?0:d;var e,f,g,k,l,m,n;_.I(function(p){if(1==p.a){if(!a.f||!a.a)throw Error("Player not ready to select tracks.");e=iF(a);if(!e)throw Error(HB);if(!b)return a.Aa=null,null!=a.Je&&(a.Ge=a.Je,a.Je=null),a.configuration.abr.enabled||(a.log.info("Enable ABR Selection"),a.configuration.abr.enabled=!0,a.h.enable()),f=PI(a,e.variants),g=f.variant,null!=g&&TI(a)&&VI(a,g),p["return"]();a.configuration.abr.enabled&&(a.log.info("Disable ABR and enable manual track selection to select "+
|
|
243
|
+
(b.width+"x"+b.height+"@"+b.bandwidth)),a.configuration.abr.enabled=!1,a.h.disable());k=UI(a);l=k.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(!$F(l))throw a.log.error("Unable to switch to restricted track",b.id),Error("Unable to switch to restricted track.");a.Aa=l.video.id;return _.x(p,e.parser.loadVariant(l,e.id),2)}if(4!=p.a){m=p.f;if(n=!!jF(a.l,e).qb){if(!m.video)return p.C(4);iJ(a,e,m.video,!1);return _.x(p,gH(a.a,
|
|
244
|
+
m.video,c,d),4)}jJ(a,e,m,!1);return _.x(p,kJ(a,m,c,d),4)}null==a.Je&&(a.Je=a.Ge);a.Ge=new sG(l);PI(a,e.variants);_.z(p)})};
|
|
245
|
+
HJ=function(a,b){var c,d,e,f,g,k,l,m,n,p,q,t,u,y;_.I(function(A){switch(A.a){case 1: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.");c=(a.f.muxedAudioTracks||[]).find(function(D){return D.id===b});if(!c){A.C(2);break}return _.x(A,GJ(a,c),3);case 3:return A["return"]();case 2:d=SG(a.a);e=RG(a.a);f=iF(a);if(!f)throw Error(HB);g=UI(a).filter(function(D){return D.audio.id===b&&$F(D)});
|
|
246
|
+
k=!1;l=void 0;if(d){if(l=g.find(function(D){return D.video.id===d.id}),!l&&(a.log.debug("Cannot find exact variant, looking for anything else that matches with given audioId"),k=!0,m=a.getTrackManager().Ra()))n=m.renditions.map(function(D){return D.id}),l=g.find(function(D){return n.find(function(B){return B===String(D.video.id)})})}else l=g[0];if(!l)throw Error("Variant with target audio track not found.");q=(p=!!jF(a.l,f).qb)?!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."),
|
|
247
|
+
Error("Audio codecs not compatible with active audio.");return _.x(A,f.parser.loadVariant(l,f.id),4);case 4:return t=A.f,u=t.audio,a.Sb=u.id,y=g.map(QE),a.h.setTracks(y),jJ(a,f,t,!1),k||!TI(a)?_.x(A,kJ(a,t,!0,0),0):_.x(A,iH(a.a,u),0)}})};
|
|
248
|
+
GJ=function(a,b){var c,d,e,f,g;return _.I(function(k){c=iF(a);if(!c)throw Error(HB);d=c.variants.filter(function(l){return l.video&&l.video.muxedAudioId===b.groupId&&$F(l)});if(0===d.length)throw Error("No variants containing muxed audio found.");e=d[0];(f=SG(a.a))&&(e=d.find(function(l){return l.video.id===f.id})||null);g=e&&e.video;if(!g)return k["return"]();a.Sb=b.id;a.log.info("Select muxed audio track "+b.id);IJ(a,c,b,!1);return _.x(k,fH(a.a),0)})};
|
|
249
|
+
eF=function(a){var b=a.wh;return a.f?a.M.getTextDisplayer().isTextVisible():b};aF=function(a,b){var c,d,e,f;return _.I(function(g){c=a.wh;d=b;if(c===d)return g["return"]();a.wh=d;if(a.H!==dI)return g.C(0);a.M.getTextDisplayer().setTextVisibility(b);if(a.configuration.streaming.alwaysStreamText)return g.C(0);if(!b)return $G(a.a),g.C(0);e=iF(a);f=_.bG(e.textStreams,a.ue,a.Mf,a.re);return 0<f.length?_.x(g,XG(a.a,f[0]),0):g.C(0)})};
|
|
250
|
+
jJ=function(a,b,c,d){b.parser&&b.parser.setCurrentVariant(c);c.video&&iJ(a,b,c.video,d);c.audio&&JJ(a,b,c.audio,d)};JJ=function(a,b,c,d){var e=a.getTrackManager();if(e){var f=a.G.f;a=jF(a.l,b);a.audio=c;a.qb=null;lF(e,c.id,_.hm,d);c=e.Za();tC(f,c,d)}};
|
|
251
|
+
iJ=function(a,b,c,d){var e=a.getTrackManager();if(e){var f=a.G.f;jF(a.l,b).video=c;lF(e,c.id,_.im,d);a=e.sa();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}))}};IJ=function(a,b,c,d){b=jF(a.l,b);b.audio=null;b.qb=c;if(b=a.getTrackManager())a=a.G.f,lF(b,c.id,_.hm,d),c=b.Za(),tC(a,c,d)};
|
|
252
|
+
gJ=function(a,b,c,d){jF(a.l,b).text=c;if(b=a.getTrackManager())lF(b,c.id,_.gm,d),c=b.hb(),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}))};KJ=function(a){return a.X===_.ob&&"flat"===a.configuration.playlist.timeline};
|
|
253
|
+
SI=function(a,b){for(var c=0;c<b.length;c++){for(var d=b[c],e=new Map,f=_.v(UI(a)),g=f.next();!g.done;g=f.next())if(g=g.value,g.video&&g.video.closedCaptions){g=g.video;for(var k=_.v(g.closedCaptions.keys()),l=k.next();!l.done;l=k.next())if(l=l.value,!e.has(l)){var m={id:a.ak++,originalId:l,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return null},getSegmentReference:function(){return null},initSegmentReference:null,Ua:0,mimeType:_.Ic,codecs:"",kind:_.gd,encrypted:!1,
|
|
255
254
|
keyId:null,language:g.closedCaptions.get(l),label:null,type:_.jk,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)}};
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
_.
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
d=a.h.chooseTrack(),
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
missingKeys:g,restrictedKeyStatuses:k});};
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
a.f.periods=g.periods;m=
|
|
274
|
-
B.video&&y.add(B.video),B.audio&&y.add(B.audio);E=a.getNetworkEngine();C=_.v(_.jh(y).concat(_.jh(m.textStreams)));for(K=C.next();!K.done;K=C.next())P=K.value,u.push(P.createSegmentIndex(E,a.configuration.streaming.attemptParameters));return _.x(W,Promise.all(u),7);case 7:
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
_.
|
|
255
|
+
LJ=function(a,b){if(a.configuration.streaming.disableAudioTracks){for(var c=_.v(b),d=c.next();!d.done;d=c.next()){var e=_.v(d.value.variants);for(d=e.next();!d.done;d=e.next())delete d.value.audio}a.log.debug("Audio removed due to disableAudioTracks")}if(a.configuration.streaming.disableVideoTracks){c=_.v(b);for(d=c.next();!d.done;d=c.next())for(e=_.v(d.value.variants),d=e.next();!d.done;d=e.next()){d=d.value;var f=d.video;f&&!FC(f.type,_.Hm(f.mimeType,f.codecs))&&delete d.video}a.log.debug("Video removed due to disableVideoTracks")}};
|
|
256
|
+
QI=function(a,b){LJ(a,b);for(var c=a.a?RG(a.a):null,d=a.a?SG(a.a):null,e=!ZI(a),f=_.v(b),g=f.next();!g.done;g=f.next())XF(a.A,c,d,g.value,e);c=EC(b,function(k){return k.variants.some($F)});if(0===c)throw new _.O(_.Q,4,4032);if(c<b.length)throw new _.O(_.Q,4,4011);c=_.v(b);for(d=c.next();!d.done;d=c.next())d=d.value,UF(d.variants,a.configuration.restrictions)&&a.a&&iF(a)===d&&OI(a),MJ(a,d.variants)};
|
|
257
|
+
bJ=function(a,b){LJ(a,[b]);var c=b.variants,d=a.a?RG(a.a):null,e=a.a?SG(a.a):null,f=!ZI(a);XF(a.A,d,e,b,f);if(!c.some($F))throw new _.O(_.Q,4,4011);MJ(a,b.variants);UF(c,a.configuration.restrictions)&&a.a&&iF(a)===b&&OI(a);if(!_.si(2)&&(d=a.A?a.A.getDrmInfo():null))for(c=_.v(c),e=c.next();!e.done;e=c.next())for(e=_.v(e.value.drmInfos),f=e.next();!f.done;f=e.next())if(f=f.value,f.keySystem===d.keySystem){f=_.v(f.initData||[]);for(var g=f.next();!g.done;g=f.next())g=g.value,_.Vp(a.A,g.keyId,g.initData)||
|
|
258
|
+
_.Mp(a.A,g.initDataType,g.initData,g.keyId)}};kJ=function(a,b,c,d){c=void 0===c?!1:c;d=void 0===d?0:d;return _.I(function(e){return TI(a)?_.x(e,dH(a.a,b,c,d),0):(a.Fa=b,a.$j=c,a.Zj=d,e.C(0))})};hJ=function(a,b){return _.I(function(c){return TI(a)?_.x(c,_.jH(a.a,b),0):(a.ha=b,c.C(0))})};NJ=function(a){if(a.a&&a.f){var b=PG(a.a),c=iF(a);null!=b&&b===c&&(RG(a.a),SG(a.a),_.QG(a.a,_.jk),jF(a.l,c),jF(a.l,c),jF(a.l,c),jF(a.l,c))}};
|
|
259
|
+
aJ=function(a,b){function c(g,k){if(!g)return null;var l=g.findSegmentPosition(k-f.startTime);return null==l?null:(l=g.getSegmentReference(l))?l.startTime+f.startTime:null}var d=RG(a.a),e=SG(a.a),f=iF(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};eJ=function(a){return a.A&&a.A.G?!0:a.J?a.J.getState()===xG:!1};
|
|
260
|
+
KI=function(a){if(a.G&&a.J&&a.B){var b=eJ(a)||a.xd,c=a.I;c.l=b;HG(c,c.o?"seek":void 0);a.B.j.o=b;dJ(a);a.Xf&&(c=1>Math.abs(a.getMediaDuration()-a.getMediaPosition()),a=a.Xf,b&&c&&(b=a.a,b.a[b.a.length-1]&&a.f(new _.R(_.Sf))))}};dJ=function(a){var b=a.ud;if(a.xd)var c=!1;else if(a.j&&a.j.ended)c=!0;else{c=a.getMediaDuration();var d=a.getMediaPosition();c=a.Ke&&0<=d&&c<=d?!0:!1}a=c?11:eJ(a)||a.xd?6:a.j&&a.j.paused?10:8;HE(b,a)};
|
|
261
|
+
PI=function(a,b){var c=OJ(a,b);if(!c)return{variant:null,qb:null};var d=PJ(a,c);return{variant:c,qb:d}};PJ=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};
|
|
262
|
+
OJ=function(a,b){try{MJ(a,b)}catch(f){return a.onError(f),null}var c=b.filter(function(f){return $F(f)}),d=FE(c,a.Sb);c=a.Ge.create(d);c=Array.from(c.values());var e=c.map(QE);a.h.setTracks(e);if(null!==a.Aa&&null!==a.Sb&&(e=c.find(function(f){return f.video.id===a.Aa&&f.audio.id===a.Sb}),a.Aa=null,e))return e;if(a.configuration.abr.enabled||null===a.Aa)return d=a.h.chooseTrack(),RE(d,c);d=d.find(function(f){return null!==f.video&&f.video.id===a.Aa});return d?d:(a.log.warn("Selected video track not found. Falling back to ABR selection"),
|
|
263
|
+
d=a.h.chooseTrack(),RE(d,c))};QJ=function(a,b){return _.bG(b,a.ue,a.Mf,a.re)[0]||null};RJ=function(a,b,c){c=void 0===c?!0:c;var d,e,f,g;_.I(function(k){if(1==k.a)return d=PI(a,b.variants),e=d.variant,a.Sb=e&&e.audio&&e.audio.id,e?_.x(k,b.parser.loadVariant(e,b.id),3):k.C(2);if(2!=k.a)return f=k.f,jJ(a,b,f,!0),_.x(k,kJ(a,f,c),2);g=QJ(a,b.textStreams);if(!g||!a.configuration.streaming.alwaysStreamText&&!eF(a))return k.C(0);gJ(a,b,g,!0);return _.x(k,hJ(a,g),0)})};
|
|
264
|
+
UJ=function(a,b){a.h.disable();a.log.debug("Choosing new streams after period changed");var c=PI(a,b.variants),d=c.variant,e=c.qb,f=QJ(a,b.textStreams);a.Fa&&(b.variants.includes(a.Fa)&&(d=a.Fa),a.Fa=null);a.ha&&(b.textStreams.includes(a.ha)&&(f=a.ha),a.ha=null);var g=d?d.video:null,k=d&&!e?d.audio:null;d&&b.parser&&b.parser.setCurrentVariant(d);g&&SJ(a,b,function(){return iJ(a,b,g,!0)});k&&SJ(a,b,function(){return JJ(a,b,k,!0)});e&&SJ(a,b,function(){return IJ(a,b,e,!0)});f&&(a.configuration.streaming.alwaysStreamText||
|
|
265
|
+
eF(a))&&SJ(a,b,function(){return gJ(a,b,f,!0)});b===iF(a)&&TJ(a);c=a.configuration.streaming.alwaysStreamText||eF(a)?f:null;return{video:g,audio:k,text:c,qb:e}};
|
|
266
|
+
VI=function(a,b,c,d){c=void 0===c?!1:c;d=void 0===d?0:d;var e,f,g;_.I(function(k){if(1==k.a){if(!a.configuration.abr.enabled||!a.a)return k["return"]();e=VJ(a,b);f=!!jF(a.l,e).qb;if(!f)return k.C(2);g=b.video;if(!g)return k.C(2);SJ(a,e,function(){return iJ(a,e,g,!0)});e===iF(a)&&TJ(a);return _.x(k,gH(a.a,g,c,d),4)}if(2!=k.a)return k["return"]();SJ(a,e,function(){jJ(a,e,b,!0)});e===iF(a)&&TJ(a);dH(a.a,b,c,d);_.z(k)})};
|
|
267
|
+
OI=function(a){var b=a.getTrackManager();b&&a.H!==JI&&(b.m&&(hF(b),b.m.trigger(new _.R(_.vg))),TJ(a))};TJ=function(a){var b=iF(a);if(b){var c=a.od.get(b)||[];for(a.od["delete"](b);c.length;)c.shift()()}};SJ=function(a,b,c){a.od.has(b)||a.od.set(b,[]);a.od.get(b).push(c)};FI=function(a,b,c){a.trigger(new _.R(b,{detail:GD(c,KJ(a))}))};
|
|
268
|
+
MJ=function(a,b){var c=a.A?_.N.Gh(a.A.na):{},d=Object.keys(c);d=d.length&&"00"===d[0];for(var e=!1,f=!1,g=[],k=[],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?NI.includes(q)&&(k.includes(q)||k.push(q)):g.includes(p.keyId)||g.push(p.keyId)}m.allowedByApplication?m.allowedByKeySystem&&(e=!0):f=!0}if(!e)throw new _.O(_.Q,4,4012,{hasAppRestrictions:f,
|
|
269
|
+
missingKeys:g,restrictedKeyStatuses:k});};WJ=function(a){if(null==iF(a))return[];NJ(a);return UI(a).filter(function(b){return $F(b)})};XJ=function(a){var b=iF(a);if(null==b)return[];NJ(a);return a.f.alternativeTextStreams?a.f.alternativeTextStreams:b.textStreams.filter(function(c){return!a.Vf.has(c)})};iF=function(a){var b=a.B.getTime(),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};YJ=function(a){var b=iF(a);return b?jF(a.l,b).audio:null};
|
|
270
|
+
ZJ=function(a){var b=iF(a);return b?jF(a.l,b).video:null};VJ=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};oI=function(a){if(a.H===JI)throw new _.O(_.Q,7,7E3,"Player is destroyed.");};
|
|
271
|
+
$J=function(a,b,c,d){var e,f,g,k,l,m,n,p,q,t,u,y,A,D,B,E,C,K,P,T;return _.I(function(W){switch(W.a){case 1:return e=_.Pq,_.F(W,2),_.x(W,_.dw(b.url,a.getNetworkEngine(),a.configuration.manifest.attemptParameters,b.type||null),4);case 4:f=W.f;f.configure(a.configuration.manifest);var oa=f;var Aa=b.url,wa=LI(a,a.configuration.id||"");oa=oa.start(Aa,wa);return _.x(W,oa,5);case 5:g=W.f;MI(g.periods);if(!g.periods.length)throw new _.O(_.Q,4,4014);return _.x(W,hI(a),6);case 6:a.T=[f];k=d&&d.id;l=c&&c.id;
|
|
272
|
+
a.f.periods=g.periods;m=cD(g.periods,a.B.getTime())||g.periods[0];ZI(a)?SF(a.f,_.Ej(a.configuration.preferredVideoCodec),_.Ej(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount):RF(a.f,_.Ej(a.configuration.preferredVideoCodec),_.Ej(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount);n=IE(k,l,m.variants);p=QJ(a,m.textStreams);PI(a,m.variants);q=n&&n.video;t=n&&n.audio;u=[];y=new Set;A=_.v(m.variants);for(D=A.next();!D.done;D=A.next())B=D.value,
|
|
273
|
+
B.video&&y.add(B.video),B.audio&&y.add(B.audio);E=a.getNetworkEngine();C=_.v(_.jh(y).concat(_.jh(m.textStreams)));for(K=C.next();!K.done;K=C.next())P=K.value,u.push(P.createSegmentIndex(E,a.configuration.streaming.attemptParameters));return _.x(W,Promise.all(u),7);case 7:vH(a.a,e.AUDIO,t);vH(a.a,e.VIDEO,q);vH(a.a,e.TEXT,p);n&&jJ(a,m,n,!1);a.log.info("Switch CDN successful.");_.G(W,0);break;case 2:T=_.H(W);if(!f){W.C(8);break}return _.x(W,f.stop(),8);case 8:throw T;}})};
|
|
274
|
+
LI=function(a,b){return{networkingEngine:a.getNetworkEngine(),onContentSteeringInfoFound:function(c){return uI(a,c)},configurationId:b,filterNewPeriod:function(c){return bJ(a,c)},filterAllPeriods:function(c){return QI(a,c)},onEvent:function(c){return a.Cg(c)},onError:function(c){return a.onError(c)},onUpdate:function(c){return mI(a,c)},onTurnedStatic:function(){return nI(a)},xe:function(){return a.h}}};
|
|
275
|
+
ZI=function(a){return a.configuration.mediaSource.codecSwitchingStrategy===_.bg&&(_.si(2)||_.si(3)||_.si(4)||_.si(5)||_.si(6)||_.ti()&&38===_.Qi().major||_.ti()&&53===_.Qi().major||_.ti()&&68===_.Qi().major?!1:!0)};UI=function(a){return a.f.alternativeVariants&&0<a.f.alternativeVariants.length?a.f.alternativeVariants:a.B?iF(a).variants:a.f.periods[0].variants};aK=function(){};
|
|
276
|
+
bK=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}};cK=function(){var a=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(b,c){return a.call(this,b,c-.001)}};dK=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"mp2t"===b.split(/ *; */)[0].split("/")[1].toLowerCase()?!1:a(b)}};
|
|
277
|
+
eK=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"opus"!==_.IC(b)&&a(b)}};
|
|
278
|
+
fK=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 k=!1,l=!1;c=d.split(",").filter(function(n){b.test(n)&&(l=!0);/^(hev|hvc)1\.2/.test(n)&&(k=!0);return!0});l&&(k=!1);f.codecs=c.join(",");k&&(f.eotf="smpte2084");for(var m in f)e+="; "+m+'\x3d"'+f[m]+'"';return cast.__platform__.canDisplayType(e)}};
|
|
279
|
+
gK=function(a){_.Yv.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=_.Qd;c.label===JB&&(this.a=c)}this.a||(this.a=a.addTextTrack(_.iC,JB));this.a.mode=_.re};hK=function(a,b){var c=a.mode;a.mode=c===_.Yf?_.Yf:_.re;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};iK=function(){};_.uk.prototype.f=_.kC(0,function(){return this.keyInfo});nC=[112,115,115,104,0,0,0,0];_.fJ={Dh:_.kg,zp:_.gd,Ch:_.ne};
|
|
280
|
+
_.CC.prototype.Ae=function(){return this.fa?this.fa-this.la+1:null};_.CC.prototype.f=function(){return this.keyInfo};MC.prototype.release=function(){lC(this.h,this.j)};_.QC.prototype.getAttribute=function(a){a=this.attributes[a];return null==a?null:a};_.r=_.TC.prototype;_.r.Se=function(a,b){var c=SC(a).childNodes[0];return b&&c.tagName!==b?null:c};_.r.Qa=function(a,b){var c=this.aa(a,b);return 1!==c.length?null:c[0]};
|
|
282
281
|
_.r.aa=function(a,b){return Array.from(a.childNodes).filter(function(c){return c.tagName===b})};_.r.ic=_.hh(1);_.r.Wc=_.hh(3);_.r.ua=function(a){return a.childNodes.every(function(b){return b.tagName===_.ea||"#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.Z=_.hh(5);_.r.Df=_.hh(7);_.r.Zf=_.hh(11);
|
|
283
|
-
_.r.removeChild=function(a,b){a.childNodes=a.childNodes.filter(function(c){return c!==b})};_.r.Lf=_.hh(13);_.r.Kf=_.hh(15);_.r.Cd=_.hh(9);_.r.$f=_.hh(17);_.r.Ye=_.hh(19);_.
|
|
282
|
+
_.r.removeChild=function(a,b){a.childNodes=a.childNodes.filter(function(c){return c!==b})};_.r.Lf=_.hh(13);_.r.Kf=_.hh(15);_.r.Cd=_.hh(9);_.r.$f=_.hh(17);_.r.Ye=_.hh(19);_.jK=0;_.r=_.XC.prototype;_.r.track=function(a){null!=this.player&&ZC(this);a&&(this.player=a,this.player.on(_.Qf,this.Bd,this))};_.r.release=function(){ZC(this);this.S=[];this.f=this.h=null};
|
|
284
283
|
_.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.S.find(function(f){return f.start>=a&&f.end<=b});if(e)e.rendition=d,e.width=c.width,e.height=c.height,e.bandwidth=c.bandwidth,e.start=c.start,e.end=c.end;else{d=_.v(this.S);for(e=d.next();!e.done;e=d.next())e=e.value,a>=e.start&&a<e.end?e.end=a:b>=e.start&&
|
|
285
|
-
b<e.end&&(e.start=b);this.S.push(c);this.S.sort(
|
|
284
|
+
b<e.end&&(e.start=b);this.S.push(c);this.S.sort(WC)}aD(this);this.Bd();this.player&&this.player.trigger(new _.R(_.Pg))};_.r.clear=function(){this.S=[];aD(this);this.player&&(this.player.trigger(new _.R(_.Pg)),this.player.trigger(new _.R(_.Yc)))};
|
|
286
285
|
_.r.Bd=function(){if(this.player){var a=this.player.getMediaPosition();if(0<=a){a:{for(var b=this.S.length,c=Number.MAX_SAFE_INTEGER,d=0;d<b;d++){var e=this.S[d];c=Math.min(e.start,c);if(e.start<=a&&e.end>a){a=.1>e.end-a&&d<b-1?this.S[d+1].rendition:e.rendition;break a}if(e.start>a)break}a=0<b&&c>a&&.25>c-a?this.S[0].rendition:null}if(a&&this.f!==a&&(this.f=a,this.player)){c=b=-1;if(a)b=a.width||-1,c=a.height||-1;else if(d=this.player.getSurface().getMedia())b=d.videoWidth,c=d.videoHeight;this.player.trigger(new _.R(_.ad,
|
|
287
|
-
{detail:{width:b,height:c,bandwidth:a?a.bandwidth:null,rendition:a}}))}}}};_.r=
|
|
288
|
-
_.r.Ec=function(a){return null==this.a||null==this.f?!1:a>=this.a&&a<this.f};_.r.
|
|
289
|
-
_.r.offset=function(a){null!=this.l&&(this.l+=a);null!=this.w&&(this.w+=a)};_.r.isLive=function(){return 2===this.j.version?!this.a.f:Infinity===this.f&&!this.o};_.r.Ie=function(){return!this.o};_.r.$c=function(){return this.B};
|
|
290
|
-
|
|
286
|
+
{detail:{width:b,height:c,bandwidth:a?a.bandwidth:null,rendition:a}}))}}}};_.r=lD.prototype;_.r.destroy=function(){this.h=this.w=null;this.o.clear();return Promise.resolve()};_.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.gc=function(){return this.a};_.r.Xa=function(){return this.f};
|
|
287
|
+
_.r.Ec=function(a){return null==this.a||null==this.f?!1:a>=this.a&&a<this.f};_.r.Ya=function(a){return null==this.f||this.f<a?0:this.f-Math.max(a,this.a)};qD.prototype.jc=function(){return this.h};qD.prototype.getDuration=function(){return this.f?this.a-this.h:Infinity};_.r=_.sD.prototype;_.r.Zc=function(){return this.L};_.r.getDuration=function(){return 2===this.j.version?this.a.getDuration():this.f};_.r.getPresentationStartTime=function(){return this.G};
|
|
288
|
+
_.r.offset=function(a){null!=this.l&&(this.l+=a);null!=this.w&&(this.w+=a)};_.r.isLive=function(){return 2===this.j.version?!this.a.f:Infinity===this.f&&!this.o};_.r.Ie=function(){return!this.o};_.r.$c=function(){return this.B};HD.prototype.release=function(){this.f=function(){};this.h=function(){};this.a.clear()};HD.prototype.cues=function(){return this.a};LD.prototype.release=function(){this.f=this.j=this.h=this.a=null};LD.prototype.l=function(a){wC(this.a,a);MD(this)};
|
|
289
|
+
ND.prototype.next=function(){var a=this.h.get(this.a);a&&0<a.a.length?(this.f+=1,a.Ia().length&&this.f===a.a.length&&(this.a+=1,this.f=0)):(this.a+=1,this.f=0);a=OD(this);return{value:a,done:!a}};_.r=_.PD.prototype;_.r.destroy=function(){this.a=[];return Promise.resolve()};
|
|
291
290
|
_.r.vf=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};
|
|
292
|
-
_.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.
|
|
293
|
-
_.r.
|
|
294
|
-
_.r.ta=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 _.uk(f.position,g.startTime,g.endTime,g.Ia,g.la,g.fa,g.
|
|
295
|
-
if(b.length)for(d=b[b.length-1].position+1;e<a.length;)f=a[e++],f=new _.uk(d++,f.startTime,f.endTime,f.Ia,f.la,f.fa,f.
|
|
296
|
-
f.Kd,f.
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
c.baseUriCollectionId+" from: "+JSON.stringify(c.from)+" to: "+JSON.stringify(c.to)),this.trigger(new _.R(
|
|
303
|
-
_.r.Gb=function(){return this.f.get(_.
|
|
304
|
-
_.r.Cb=function(a,b){b=void 0===b?!1:b;if(this.m)if(a)
|
|
291
|
+
_.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.Ua-=a};
|
|
292
|
+
_.r.sg=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};
|
|
293
|
+
_.r.ta=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 _.uk(f.position,g.startTime,g.endTime,g.Ia,g.la,g.fa,g.Ua,g.keyInfo,g.Fd,g.timescale,g.horizontalTiles,g.verticalTiles,g.durationPerTile,null,null,g.Kd,g.Oa),b.push(f)):b.push(f),d++),e++)}for(;d<this.a.length;)b.push(this.a[d++]);
|
|
294
|
+
if(b.length)for(d=b[b.length-1].position+1;e<a.length;)f=a[e++],f=new _.uk(d++,f.startTime,f.endTime,f.Ia,f.la,f.fa,f.Ua,f.keyInfo,f.Fd,f.timescale,f.horizontalTiles,f.verticalTiles,f.durationPerTile,null,null,f.Kd,f.Oa),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 _.uk(e-d--,f.startTime,f.endTime,f.Ia,f.la,f.fa,f.Ua,f.keyInfo,f.Fd,f.timescale,f.horizontalTiles,f.verticalTiles,f.durationPerTile,null,null,
|
|
295
|
+
f.Kd,f.Oa));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};SD.prototype.release=function(){this.h=null;this.f=function(){}};WD.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};WD.prototype.Tf=function(){this.A=!0;VD(this)};XD.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};
|
|
296
|
+
aE.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};aE.prototype.getTime=function(){return this.l?this.a.currentTime:this.A};gE.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(){}};
|
|
297
|
+
gE.prototype.getTime=function(){var a=this.f.getTime();return 0<this.h.readyState&&!this.h.paused?FD(this.a,a):a};jE.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()};lE.prototype.release=function(){this.j=null;this.o.clear();this.a=function(){};this.f=function(){};this.h=function(){}};
|
|
298
|
+
lE.prototype.l=function(a,b,c){if(this.j)for(var d={},e=_.v(this.j.cues()),f=e.next();!f.done;d={lg:d.lg,cf:d.cf},f=e.next()){f=f.value;d.lg=this.o.get(f)||null;d.cf=kE(f,a);this.o.set(f,d.cf);var g=this.w.find(function(k){return function(l){return l.nd===k.lg&&l.md===k.cf}}(d));g&&g.cd(f,b&&0===c)}};pE.prototype.getBandwidthEstimate=function(a){return 128E3>this.a?a:Math.min(_.jD(this.f),_.jD(this.h))};_.w(uE,_.qn);
|
|
299
|
+
uE.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.D.destroy()};
|
|
300
|
+
uE.prototype.getBaseUriCollectionById=function(a){var b=this,c=this.l.get(a);if(!c)return this.g.warn("getBaseUriCollectionById: invalid baseUriSetId:"+a+"."),null;var d=Date.now();this.j.forEach(function(f,g){f.ge&&d>f.ge&&(f.ge=0,b.trigger(new _.R(UB,{detail:{serviceLocationId:g,banned:!1,bannedSeconds:0}})))});var e=c.filter(function(f){return 0===xE(b,f.serviceLocationId).ge});e.length||(e=c);e.length&&(c=this.w.get(a),tE(e,c)||(c={baseUriCollectionId:a,from:c||[],to:e},this.g.info("Steering server update baseUriCollectionId: "+
|
|
301
|
+
c.baseUriCollectionId+" from: "+JSON.stringify(c.from)+" to: "+JSON.stringify(c.to)),this.trigger(new _.R(TB,{detail:c})),this.w.set(a,e)));return new _.rE(a,e)};uE.prototype.notifyThroughput=function(a,b,c){a=xE(this,a);qE(a.Oh,b,c);a.bg=!0};uE.prototype.banLocation=function(a){var b=xE(this,a);b.ge=Date.now()+1E3*this.f;b.bg=!1;this.g.info("service location "+a+" banned during "+this.f+wB);this.trigger(new _.R(UB,{detail:{serviceLocationId:a,banned:!0,bannedSeconds:this.f}}))};GE.prototype.getState=function(){return this.a};_.w(SE,_.Nm);_.r=SE.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 TE(this,_.im)};_.r.getAudioTracks=function(){return TE(this,_.hm)};_.r.ra=function(){return TE(this,_.gm)};_.r.sa=function(){return this.a.get(_.im)||null};_.r.Za=function(){return this.a.get(_.hm)||null};_.r.hb=function(){return this.a.get(_.gm)||null};
|
|
302
|
+
_.r.Gb=function(){return this.f.get(_.im)||null};_.r.Wb=function(){return this.f.get(_.hm)||null};_.r.Xb=function(){return this.f.get(_.gm)||null};_.r.Ra=function(){return UE(this,_.im)};_.r.qa=function(){return UE(this,_.hm)};_.r.wa=function(){return UE(this,_.gm)};_.r.Pb=function(a){this.m&&VE(this,_.im,a)};_.r.La=function(a){this.m&&VE(this,_.hm,a)};_.r.kb=function(a){this.m&&VE(this,_.gm,a)};
|
|
303
|
+
_.r.Cb=function(a,b){b=void 0===b?!1:b;if(this.m)if(a)$E(this,a,b);else{var c=b,d=UE(this,_.im);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."),ZE(this.m,null,c)))}};_.r.Nb=function(a){this.m&&(a?(YE(this,a,_.hm),XE(this,a,_.hm)&&(this.g.info("Set audio rendition with ID: "+a.id),this.f.set(_.hm,a),HJ(this.m,parseInt(a.id,10)))):this.g.info("Enabling ABR for audio is not supported"))};
|
|
305
304
|
_.r.addTextTrack=function(a){var b=this;return _.I(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()};
|
|
306
|
-
_.r.Ob=function(a){if(this.m){var b=a;if(!a){var c=this.
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
_.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"](
|
|
305
|
+
_.r.Ob=function(a){if(this.m){var b=a;if(!a){var c=this.hb();if(c&&c.track.kind!==_.ne){a=this.ra().find(function(e){return e.kind===_.ne&&e.language===c.track.language});if(!a){var d=this.qa();d&&(a=this.ra().find(function(e){return e.kind===_.ne&&e.language===d.language}))}a&&(b=a.renditions[0])}}b?cF(this,b):dF(this)}};_.r.detach=function(){};SE.prototype.setTextRendition=SE.prototype.Ob;SE.prototype.isAbrEnabled=SE.prototype.xa;SE.prototype.addTextTrack=SE.prototype.addTextTrack;
|
|
306
|
+
SE.prototype.setAudioRendition=SE.prototype.Nb;SE.prototype.setVideoRendition=SE.prototype.Cb;SE.prototype.setTextTrack=SE.prototype.kb;SE.prototype.setAudioTrack=SE.prototype.La;SE.prototype.setVideoTrack=SE.prototype.Pb;SE.prototype.getTextTrack=SE.prototype.wa;SE.prototype.getAudioTrack=SE.prototype.qa;SE.prototype.getVideoTrack=SE.prototype.Ra;SE.prototype.getLoadingTextRendition=SE.prototype.Xb;SE.prototype.getLoadingAudioRendition=SE.prototype.Wb;SE.prototype.getLoadingVideoRendition=SE.prototype.Gb;
|
|
307
|
+
SE.prototype.getTextRendition=SE.prototype.hb;SE.prototype.getAudioRendition=SE.prototype.Za;SE.prototype.getVideoRendition=SE.prototype.sa;SE.prototype.getTextTracks=SE.prototype.ra;SE.prototype.getAudioTracks=SE.prototype.getAudioTracks;SE.prototype.getVideoTracks=SE.prototype.getVideoTracks;mF.prototype.init=function(a){var b=muxjs.mp4.probe;a=_.Vi(a);this.l=b.videoTrackIds(a);this.j=b.timescale(a)||{};this.a.init()};mF.prototype.h=function(a,b){var c=_.Vi(a);(c=this.a.parse(c,this.l,this.j))&&c.captions&&b(c.captions);this.a.clearParsedCaptions()};mF.prototype.f=function(){this.a.resetCaptionStream()};_.nF.prototype.init=function(){};_.nF.prototype.h=function(){};_.nF.prototype.f=function(){};_.r=_.pF.prototype;
|
|
308
|
+
_.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"](zC));for(e=1;e<d.length;++e)d[e].p["catch"](zC),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(),
|
|
310
309
|
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.M=!1;for(var g in a.h);a.h={}})};_.r.open=function(){return this.L};
|
|
311
|
-
_.r.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e,f,g,k,l,m,n,p,q,t,u,y,A;return _.I(function(D){switch(D.a){case 1:return e=_.
|
|
312
|
-
u.has(e.AUDIO)&&u.has(e.VIDEO);case 4:g=f.next(),D.C(3)}})};_.r.gc=function(a){return a===_.jk?this.f.gc():(a=
|
|
313
|
-
_.r.remove=function(a,b,c){var d=this;return a===_.jk?this.f.remove(b,c):
|
|
314
|
-
_.r.flush=function(a){return a===_.jk?Promise.resolve():
|
|
315
|
-
_.r.
|
|
316
|
-
_.r.
|
|
317
|
-
_.r.
|
|
318
|
-
_.r.
|
|
319
|
-
_.r.
|
|
320
|
-
_.r.gd=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug("Update-End received for "+a),
|
|
321
|
-
_.r.chooseTrack=function(){var a=
|
|
310
|
+
_.r.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e,f,g,k,l,m,n,p,q,t,u,y,A;return _.I(function(D){switch(D.a){case 1:return e=_.Pq,_.x(D,d.L,2);case 2:f=_.v(a),g=f.next();case 3:if(g.done){D.C(0);break}k=g.value;l=_.v(k);m=l.next().value;p=n=l.next().value;q=m;t=_.Hm(p.mimeType,p.codecs);if(q===e.TEXT){xF(d,t);D.C(4);break}u=new Map;u.set(q,t);_.Eu(t)&&b&&!p.aesEncrypted||!_.Gm(t,q)||!(y=_.Gm(t))||(A=y(),d.w[q]=A,u=A.demuxMimeTypes(q,t),c&&u["delete"](e.AUDIO));return _.x(D,uF(d,u),7);case 7:d.M=
|
|
311
|
+
u.has(e.AUDIO)&&u.has(e.VIDEO);case 4:g=f.next(),D.C(3)}})};_.r.gc=function(a){return a===_.jk?this.f.gc():(a=zF(this,a))?a.gc():null};_.r.Xa=function(a){return a===_.jk?this.f.Xa():(a=zF(this,a))?a.Xa():null};_.r.Ec=function(a,b,c){return a===_.jk?this.f.Ec(b):(a=zF(this,a))?a.Ec(b,!1,c):!1};_.r.Ya=function(a,b){if(a===_.jk)return this.f.Ya(b);var c=zF(this,a);return c?c.Ya(b):0};
|
|
312
|
+
_.r.remove=function(a,b,c){var d=this;return a===_.jk?this.f.remove(b,c):vF(this,a,this.Kj.bind(this,a,b,c)).then(function(){if(a===_.Kg){var e=d.gc(a),f=d.Xa(a);null!==e&&null!==f&&bD(d.D,e,f)}else a===_.Rc&&(e=d.D,e.player&&e.player.trigger(new _.R(_.Yc)))})};_.r.clear=function(a){if(a===_.jk){if(!this.f)return Promise.resolve();this.H.f();return this.f.remove(0,Infinity)}return vF(this,a,this.Kj.bind(this,a,0,this.o.duration))};
|
|
313
|
+
_.r.flush=function(a){return a===_.jk?Promise.resolve():vF(this,a,this.xi.bind(this,a))};_.r.endOfStream=function(a){var b=this;return IF(this,function(){yF(b)||(a?b.o.endOfStream(a):b.o.endOfStream())})};_.r.getDuration=function(){return this.o.duration};_.r.Dg=function(a,b){this.g.debug("Appending data to "+a+uB);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+uB)};
|
|
314
|
+
_.r.Kj=function(a,b,c){if(c<=b)this.gd(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)}};
|
|
315
|
+
_.r.mk=function(a){try{this.g.debug("Aborting operations for "+a+uB);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+uB,d),d;}this.g.debug("Done Aborting operations for "+a+uB);this.gd(a)};
|
|
316
|
+
_.r.xi=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.gd(a)};
|
|
317
|
+
_.r.Qj=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.gd(a)};
|
|
318
|
+
_.r.So=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.gd(a)};_.r.wl=function(a){a:switch(a){case _.Rc:var b=2008;break a;case _.Kg:b=2007;break a;default:b=5001}this.h[a][0].p.reject(new _.O(_.Q,3,3014,{mediaError:this.j.error?this.j.error.code:0},void 0,b))};
|
|
319
|
+
_.r.gd=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug("Update-End received for "+a),LF(this,a))};_.r.getTextDisplayer=function(){return this.B};var rF=window.URL.createObjectURL;_.r=_.cG.prototype;_.r.stop=function(){this.o=null;this.l=!1;this.f=[];this.B=1;this.h=null;this.H=!1;this.j=null;for(var a=_.v(this.D),b=a.next();!b.done;b=a.next())b=b.value,b();this.D.clear()};_.r.init=function(a){this.o=a};
|
|
320
|
+
_.r.chooseTrack=function(){var a=hG(this,!this.H&&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=hG(this,null,this.f),a=[a[0]]);this.h=Date.now();this.H=!0;for(var c=a,d=c[0]||null,e=0;e<c.length;e++){var f=c[e],g=c[e+1],k=isNaN(this.B)||0===this.B?1:Math.abs(this.B),l=k*f.bandwidth,m=l/this.a.bandwidthDowngradeTarget;
|
|
322
321
|
g=k*(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)}this.j=(a=d||a[0]||this.f[0])?a.id:null;return a};_.r.enable=function(){this.l=!0};_.r.disable=function(){this.l=!1};
|
|
323
|
-
_.r.segmentDownloaded=function(a,b){this.g.debug("Segment downloaded:","deltaTimeMs\x3d"+a,"numBytes\x3d"+b,"lastTimeChosenMs\x3d"+this.h,"enabled\x3d"+this.l)
|
|
322
|
+
_.r.segmentDownloaded=function(a,b){this.g.debug("Segment downloaded:","deltaTimeMs\x3d"+a,"numBytes\x3d"+b,"lastTimeChosenMs\x3d"+this.h,"enabled\x3d"+this.l);qE(this.w,a,b);if(null!=this.h&&this.l)a:{this.g.debug("Suggesting Streams...");if(!this.G){if(!(128E3<=this.w.a)){this.g.debug("Still waiting for a good estimate...");break a}this.G=!0;if(this.a.useSwitchIntervalForInitialSwitch&&Date.now()-this.h<1E3*this.a.switchInterval){this.g.debug("Skipping initial estimation switch due to switch interval...");
|
|
324
323
|
break a}}else if(Date.now()-this.h<1E3*this.a.switchInterval){this.g.debug("Still within switch interval...");break a}var c=this.j,d=this.chooseTrack();d&&d.id===c||(c=this.getBandwidthEstimate(),this.g.debug("Calling switch_(), bandwidth\x3d"+Math.round(c/1E3)+" kbps"),d&&this.o(d))}};_.r.playbackRateChanged=function(a){this.B=a};
|
|
325
|
-
_.r.getBandwidthEstimate=function(){if(this.A&&this.a.useCmsd){var a=
|
|
326
|
-
_.r.beginSegmentMonitor=function(a,b){var c=this;if(this.o){var d={
|
|
327
|
-
|
|
328
|
-
for(var d=a.next();!d.done;d=a.next())c.add(d.value,!b);return c};
|
|
329
|
-
_.r.start=function(){var a=this,b,c,d;return _.I(function(e){if(1==e.a){b=a.F.Hb();c=
|
|
330
|
-
_.r.resume=function(){if(!
|
|
331
|
-
_.r.qc=function(a){var b=this,c,d,e,f,g,k,l;return _.I(function(m){switch(m.a){case 1:if(b.f)return m["return"]();c=
|
|
332
|
-
f=_.v(b.a.values());for(g=f.next();!g.done;g=f.next())k=g.value,k.Db=null;return m["return"]()}b.g.debug("End of stream reached, calling ms.endOfStream().");return _.x(m,b.F.Y.endOfStream(),8);case 8:if(b.f)return m["return"]();l=b.F.Y.getDuration();l<b.j.presentationTimeline.getDuration()&&(b.j.presentationTimeline.f=l);b.F.
|
|
333
|
-
_.r.
|
|
334
|
-
e?a.startTime+b.startTime+l/k:a.startTime+p/k,c.includes(f))if("urn:mpeg:dash:event:2012"===f)this.F.
|
|
335
|
-
_.r.
|
|
336
|
-
_.r.unload=function(){var a=this,b;return _.I(function(c){if(1==c.a){
|
|
337
|
-
_.r.getBufferInfo=function(a){if(this.
|
|
338
|
-
_.r.seek=function(a,b){if(this.
|
|
339
|
-
_.r.getMediaDuration=function(){return this.f?this.f.presentationTimeline.getDuration():Infinity};_.r.destroy=function(){var a=this;return _.I(function(b){if(1==b.a)return _.x(b,_.
|
|
340
|
-
_.r.setupPlaylist=function(a){var b=this,c,d,e,f,g,k,l,m,n,p,q,t,u;return _.I(function(y){switch(y.a){case 1:return c=new _.
|
|
341
|
-
case 6:f=y.f;b.
|
|
342
|
-
null,0,m);p=f.map(function(A){return
|
|
343
|
-
_.r.appendLoad=function(a){var b=this,c;return _.I(function(d){if(1==d.a){
|
|
344
|
-
_.r.
|
|
345
|
-
_.r.load=function(a){return
|
|
346
|
-
_.r.getSeekRange=function(){var a={start:0,end:0};if(this.f){var b=this.f.presentationTimeline;a={start:
|
|
347
|
-
_.r.setPlaybackRate=function(a,b){if(0===a)this.log.warn("A trick play rate of 0 is unsupported!");else if(this.H===
|
|
348
|
-
_.r.Md=function(){if(!this.f||!this.B)return[];for(var a=
|
|
349
|
-
_.r.ra=function(){if(this.f&&this.B){var a=
|
|
350
|
-
_.r.getStats=function(){if(this.H!==
|
|
351
|
-
_.r.getBandwidthEstimate=function(){return this.h.getBandwidthEstimate()};_.r.getCueTimeline=function(){return this.K};_.r.getTimelineCues=function(){return this.K?
|
|
352
|
-
_.r.addTextTrack=function(a,b,c,d,e,f){var g=this,k,l,m,n,p,q,t,u,y;return _.I(function(A){if(1==A.a){if(g.H!==
|
|
353
|
-
findSegmentPosition:function(){return 1},getSegmentReference:function(D){return 1===D?t:null},adjustSegmentDurations:function(){},getDuration:function(){return q},segmentLookupStrategy:_.
|
|
354
|
-
2)}if(y=_.
|
|
355
|
-
_.r.
|
|
356
|
-
_.r.
|
|
357
|
-
_.r.
|
|
358
|
-
|
|
359
|
-
_.r.
|
|
360
|
-
_.x(p,b.xc(f.url,a),10);case 10:if(n=p.f)f.url=n,l=!0;else throw m;case 6:l?p.C(4):(d&&b.h.enable(),
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
_.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=_.S.
|
|
364
|
-
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;
|
|
365
|
-
_.
|
|
366
|
-
_.si(4)?
|
|
324
|
+
_.r.getBandwidthEstimate=function(){if(this.A&&this.a.useCmsd){var a=uC(this.A,_.me);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)};_.r.setTracks=function(a){this.f=a;this.j=null};_.r.setCmsdManager=function(a){this.A=a};_.r.configure=function(a){this.a=a};_.r.reset=function(){this.G=!1;this.w=new pE;var a=this.j,b=this.chooseTrack();b&&b.id!==a&&this.o(b)};
|
|
325
|
+
_.r.beginSegmentMonitor=function(a,b){var c=this;if(this.o){var d={bp:Date.now(),uh:null,stopped:!1,stop:function(){d.stopped||(d.stopped=!0,clearTimeout(d.uh),c.D["delete"](d.stop))}};a.U["finally"](d.stop)["catch"](function(){});this.D.add(d.stop);dG(this,a,d,b)}};lG.prototype.clear=function(){this.a.clear()};nG.prototype.add=function(a,b){var c=void 0===b?!0:b;if(qG(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};nG.prototype.values=function(){return this.a.values()};sG.prototype.create=function(a){var b=this,c=this.a===_.bg&&VC(),d=a.filter(function(e){return qG(b.f,e,!c)});return d.length?new nG(d[0],d):this.h.create(a)};
|
|
326
|
+
rG.prototype.create=function(a){var b=tG(a,this.j);0<b.length&&(a=b);b=!1;if(this.a){var c=uG(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=NF(a,this.f),b.length?a=b:_.Kh("No exact match for the channel count could be found."));b=vG(a,this.l);b.length?a=b:_.Kh("No exact match for spatial audio could be found.");b=this.h===_.bg&&VC();c=new nG(a[0]);a=_.v(a);
|
|
327
|
+
for(var d=a.next();!d.done;d=a.next())c.add(d.value,!b);return c};yG.prototype.getState=function(){return this.a};var xG=0,wG=1;AG.prototype.release=function(){this.f.release()};BG.prototype.release=function(){this.a=this.h=null;this.f=function(){}};BG.prototype.l=function(a){var b=this.a,c=this.h.periods;a=cD(c,a)||c[0];b!==a&&this.f(a);this.a=a};DG.prototype.getConfiguration=function(){return this.j};DG.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};DG.prototype.set=function(a,b){this.h=a;HG(this,b)};var KG=new _.so(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=_.NG.prototype;_.r.destroy=function(){var a=this,b,c,d,e;return _.I(function(f){if(1==f.a){b=[];c=_.v(a.a.values());for(d=c.next();!d.done;d=c.next())e=d.value,YG(e),b.push(ZG(e));return _.x(f,Promise.all(b),2)}a.a.clear();a.o.clear();a.F=null;a.j=null;a.H=null;a.B.clear();a.h=null;a.f=!0;_.z(f)})};
|
|
328
|
+
_.r.start=function(){var a=this,b,c,d;return _.I(function(e){if(1==e.a){b=a.F.Hb();c=cD(a.j.periods,b+_.qw);if(!c)throw new _.O(_.Q,5,5006,"No period found.");d=a.F.Sg(c);if(!d.video&&!d.audio&&!d.text)throw a.g.error("start(): No streams chosen"),new _.O(_.Q,5,5005,"No streams chosen.");a.I=!d.video&&!d.audio&&!!d.text;a.A=!!d.qb;return _.x(e,hH(a,d,b),2)}if(a.f)return e["return"]();a.g.debug("init: completed initial Stream setup");a.F.Qn&&a.F.Qn();_.z(e)})};
|
|
329
|
+
_.r.resume=function(){if(!rH(this))for(var a=_.v(this.a.values()),b=a.next();!b.done;b=a.next())b=b.value,b.endOfStream=!1,WG(this,b,0)};
|
|
330
|
+
_.r.qc=function(a){var b=this,c,d,e,f,g,k,l;return _.I(function(m){switch(m.a){case 1:if(b.f)return m["return"]();c=oH(a);if(a.Mb||null==a.Db||a.Rc)return m["return"]();a.Db=null;if(!a.vc){m.C(2);break}b.g.debug(c,"skipping update and clearing the buffer");return _.x(m,tH(b,a,a.gg,a.tf),3);case 3:return m["return"]();case 2:_.F(m,4);d=FH(b,a);null!=d&&(WG(b,a,d),a.Od=!1);_.G(m,5);break;case 4:return e=_.H(m),_.x(m,QH(b,e),6);case 6:return m["return"]();case 5:WH(b,a);if(!sH(b)){m.C(0);break}if(b.F.configuration.an){b.g.debug("End of stream reached, keeping MediaSource open.");
|
|
331
|
+
f=_.v(b.a.values());for(g=f.next();!g.done;g=f.next())k=g.value,k.Db=null;return m["return"]()}b.g.debug("End of stream reached, calling ms.endOfStream().");return _.x(m,b.F.Y.endOfStream(),8);case 8:if(b.f)return m["return"]();l=b.F.Y.getDuration();l<b.j.presentationTimeline.getDuration()&&(b.j.presentationTimeline.f=l);b.F.jj();_.z(m)}})};
|
|
332
|
+
_.r.so=function(a,b,c,d){var e=d.version;if(0===e){var f=mC(d.reader);var g=mC(d.reader);var k=_.Pn(d.reader);var l=_.Pn(d.reader);var m=_.Pn(d.reader);var n=_.Pn(d.reader)}else if(1===e){k=_.Pn(d.reader);var p=_.Rn(d.reader);m=_.Pn(d.reader);n=_.Pn(d.reader);f=mC(d.reader);g=mC(d.reader)}else{this.g.warn("Ignoring EMSG box with unsupported version "+e+".");return}if(0===k)this.g.warn("Ignoring EMSG box with invalid timescale 0.");else if(d=_.Tn(d.reader,d.reader.cb()-d.reader.getPosition()),a=0===
|
|
333
|
+
e?a.startTime+b.startTime+l/k:a.startTime+p/k,c.includes(f))if("urn:mpeg:dash:event:2012"===f)this.F.nj();else this.F.onEvent(new _.R("emsg",{detail:{startTime:a,endTime:a+m/k,schemeIdUri:f,value:g,version:e,timescale:k,presentationTimeDelta:l,gq:p,eventDuration:m,id:n,messageData:d}}))};
|
|
334
|
+
_.r.up=function(a){var b=this,c=!1,d=0;(new _.Un).N(_.Oe,_.Vn).N(_.wg,_.Vn).N(_.Je,_.Vn).N(_.Ne,_.Vn).N(_.gg,_.Vn).da(_.ig,_.Wn).N("encv",function(e){e.reader.skip(78);_.Vn(e)}).N("pasp",function(e){d=e.start+e.headerSize;var f=_.Pn(e.reader),g=_.Pn(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 _.Hn(new DataView(a.data)),a.seek(d),_.V(a,1),_.V(a,1))};_.w(eI,_.Bn);_.r=eI.prototype;_.r.init=function(a,b){var c=a.getMedia();_.Bn.prototype.init.call(this,a,b);rI(this,c)};_.r.namespace=function(){return SB};_.r.setSeekInterceptor=function(a){this.zh=a||null};_.r.setPlaybackSessionId=function(a){this.we=a};_.r.ji=function(){return new SE};_.r.getState=function(){return this.ud.getState()};_.r.getDrmInfo=function(){return this.A?this.A.getDrmInfo():null};
|
|
335
|
+
_.r.unload=function(){var a=this,b;return _.I(function(c){if(1==c.a){aF(a,!1);a.Ke=!1;if(!a.ea)return c["return"]();a.log.debug("Unload player with source",a.ea);(b=a.getTrackManager())&&b.release();return a.H===JI?c["return"]():_.x(c,tI(a),2)}a.ea=null;a.ud.h=0;a.Sb=null;a.Aa=null;a.getNetworkEngine().headers["delete"](OB);_.z(c)})};_.r.release=function(){var a=this;return _.I(function(b){if(a.na)return b["return"](a.na);a.na=gI(a);a.na["finally"](function(){a.na=null});return b["return"](a.na)})};
|
|
336
|
+
_.r.getBufferInfo=function(a){if(this.M){var b=AF(this.M),c=new _.nn(void 0,a);switch(a){case _.im:return b.video?b.video:c;case _.hm:return b.audio?b.audio:c;case _.gm:return b.text?b.text:c}return b.total?b.total:c}return this.yd?(b=YC(this.yd),PC(b,a)):_.Bn.prototype.getBufferInfo.call(this,a)};_.r.getPosition=function(){var a=this.Le,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?this.B.getTime():_.Bn.prototype.getMediaPosition.call(this)};
|
|
337
|
+
_.r.seek=function(a,b){if(this.zh&&!this.zh(a,b))return Promise.resolve();var c=this.Le;c=c.a?a+c.a.jc():a;c!==a&&this.log.info("Seeking to "+a+" s corresponding to media time of "+(c+" s."));return _.Bn.prototype.seek.call(this,c)};_.r.getPresentationStartTime=function(){return this.f?this.f.presentationTimeline.getPresentationStartTime():null};_.r.getDuration=function(){var a=this.Le,b=this.getMediaDuration();return a.a?a.a.getDuration():b};
|
|
338
|
+
_.r.getMediaDuration=function(){return this.f?this.f.presentationTimeline.getDuration():Infinity};_.r.destroy=function(){var a=this;return _.I(function(b){if(1==b.a)return _.x(b,_.Bn.prototype.destroy.call(a),2);if(a.H===JI)return b["return"]();a.log.debug("Destroying player...");a.H=JI;qI(a);a.o&&(a.o.release(),a.o=null);a.De=null;a.h=null;_.z(b)})};_.r.getTimeline=function(){return this.De};
|
|
339
|
+
_.r.setupPlaylist=function(a){var b=this,c,d,e,f,g,k,l,m,n,p,q,t,u;return _.I(function(y){switch(y.a){case 1:return c=new _.ol,b.w.a=c,_.F(y,2),oI(b),b.X=_.ob,_.x(y,wI(b),4);case 4:return kG(b.w,c),d=a[0],d.playlist&&d.playlist.startTime&&(d.startTime=d.playlist.startTime),b.ea=_.Jq(d),b.configuration=_.zn([b.vb,d]),b.log.info("Loading playlist configurations",a),b.De=jI(b.configuration),_.x(y,xI(b,c),5);case 5:return kG(b.w,c),e=a.map(function(A){return yI(b,A,0,null,!0)}),_.x(y,Promise.all(e),6);
|
|
340
|
+
case 6:f=y.f;b.T=f.map(function(A){return A.parser}).filter(function(A){return null!=A});g=f.filter(function(A){return A.manifest.presentationTimeline.isLive()});k=g[0];if(1<g.length)throw new _.O(_.Q,7,7003,"Playlist of multiple live streams is not supported.");if(k){l=b.configuration.playlist.content;if(l===_.Tb)throw new _.O(_.Q,7,7003,"Cannot play live content in VOD mode.");if("IPR"===l&&k!==f[f.length-1])throw new _.O(_.Q,7,7003,"Wrong order of playlist assets.");}m=null==k;n=new _.sD({version:2},
|
|
341
|
+
null,0,m);p=f.map(function(A){return LE(A.manifest)});q=OE(p,n);b.f=q;t=b;return _.x(y,zI(b,q,b.configuration),7);case 7:return t.A=y.f,kG(b.w,c),_.x(y,AI(b,c),8);case 8:kG(b.w,c);mH(b.a,q);lI(b,q);c.resolve();_.G(y,0);break;case 2:return u=_.H(y),_.x(y,hI(b),9);case 9:BI(b,u,c),_.z(y)}})};
|
|
342
|
+
_.r.appendLoad=function(a){var b=this,c;return _.I(function(d){if(1==d.a){oI(b);if(b.X!==_.ob)throw new _.O(_.Q,7,7003,"Cannot append-load to non-playlist player.");return _.x(d,II(b,a),2)}c=d.f;b.f=c.manifest;c.parser&&b.T.push(c.parser);mH(b.a,c.manifest);sH(b.a)&&b.a.resume();lI(b,c.manifest);_.z(d)})};_.r.seekWith=function(a){return this.seek(this.getPosition()+a)};
|
|
343
|
+
_.r.Xh=function(){var a=this;return _.I(function(b){oI(a);if(!a.Yf)return a.log.warn("No preloaded asset found"),b["return"]();a.log.info("Loading preloaded asset",a.Yf);a.Yf=null;return _.x(b,AI(a,null),0)})};_.r.preload=function(a){var b=this;return _.I(function(c){if(1==c.a)return oI(b),_.pp("preload.start"),b.log.info("Preloading asset",a),_.x(c,CI(b,a,!1),2);b.Yf=a;b.log.info("Preloaded asset",a);_.pp("preload.end");_.rp("preload","preload.start","preload.end");_.z(c)})};
|
|
344
|
+
_.r.load=function(a){return CI(this,a)};_.r.detach=function(){var a=this;return _.I(function(b){if(1==b.a)return _.x(b,pI(a),2);a.configuration=a.vb;qI(a);_.z(b)})};_.r.isLive=function(){var a;this.f?(a=this.f.presentationTimeline.isLive())||(a=this.f.presentationTimeline,a=Infinity!==a.f&&!a.o):a=!1;return a};_.r.rj=function(){this.log.debug("User seeking finished");this.J&&cJ(this);dJ(this)};
|
|
345
|
+
_.r.getSeekRange=function(){var a={start:0,end:0};if(this.f){var b=this.f.presentationTimeline;a={start:tD(b),end:DD(b)}}b=this.Le;b.a?(b=b.a.getDuration(),b>a.end&&(b=a.end),b={start:0,end:b}):b=a;return b};_.r.Zc=function(){return this.f?this.f.presentationTimeline.Zc():null};_.r.getPlaybackRate=function(){if(this.I){var a=this.I;a=a.l?0:a.h}else a=0;return a};
|
|
346
|
+
_.r.setPlaybackRate=function(a,b){if(0===a)this.log.warn("A trick play rate of 0 is unsupported!");else if(this.H===dI){if(_.si()){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);(c=this.I.getConfiguration())&&c.preferTrickPlayTracks&&cH(this.a,1<Math.abs(a));this.h.playbackRateChanged(a)}};
|
|
347
|
+
_.r.Md=function(){if(!this.f||!this.B)return[];for(var a=ZJ(this),b=YJ(this),c=[],d=_.v(WJ(this)),e=d.next();!e.done;e=d.next()){e=e.value;var f=YF(e);f.nf=e.video===a;f.mf=e.audio===b;c.push(f)}return c};
|
|
348
|
+
_.r.ra=function(){if(this.f&&this.B){var a=iF(this);if(null==a)a=null;else{if(!jF(this.l,a).text){var b=_.bG(a.textStreams,this.ue,this.Mf,this.re);b.length&&(b=b[0],jF(this.l,a).text=b)}a=jF(this.l,a).text}b=[];for(var c=_.v(XJ(this)),d=c.next();!d.done;d=c.next()){d=d.value;var e=ZF(d);e.rg=d===a;b.push(e)}return b}return[]};_.r.getPeriods=function(){return this.f.periods};
|
|
349
|
+
_.r.getStats=function(){if(this.H!==dI)return _.Gq();dJ(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===dI){(b=iF(this))?(a=jF(this.l,b).video,b=jF(this.l,b).audio,a=((a?a.bandwidth:0)||0)+((b?b.bandwidth:0)||0)):a=null;a&&(this.G.w=a);if(a=ZJ(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()};
|
|
350
|
+
_.r.getBandwidthEstimate=function(){return this.h.getBandwidthEstimate()};_.r.getCueTimeline=function(){return this.K};_.r.getTimelineCues=function(){return this.K?KD(this.K,KJ(this)):[]};_.r.resetAbr=function(){this.h&&this.h.reset()};_.r.xe=function(){return this.h};
|
|
351
|
+
_.r.addTextTrack=function(a,b,c,d,e,f){var g=this,k,l,m,n,p,q,t,u,y;return _.I(function(A){if(1==A.a){if(g.H!==dI)throw g.log.error("Must call load() and wait for it to resolve before adding text tracks."),Error("State error!");k=iF(g);l=_.Pq;m=g.f.periods.indexOf(k);n=m+1;p=n>=g.f.periods.length?g.f.presentationTimeline.getDuration():g.f.periods[n].startTime;q=p-k.startTime;if(Infinity===q)throw new _.O(1,4,4040);t=new _.uk(1,0,q,function(){return[a]},0,null,0);u={id:g.ak++,originalId:null,createSegmentIndex:Promise.resolve.bind(Promise),
|
|
352
|
+
findSegmentPosition:function(){return 1},getSegmentReference:function(D){return 1===D?t:null},adjustSegmentDurations:function(){},getDuration:function(){return q},segmentLookupStrategy:_.YB,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.Vf.add(u);k.textStreams.push(u);return _.x(A,XG(g.a,u),
|
|
353
|
+
2)}if(y=_.QG(g.a,_.jk))jF(g.l,k).text=y;g.Vf["delete"](u);g.log.debug("Choosing new streams after adding a text stream");RJ(g,k);OI(g);return A["return"](ZF(u))})};
|
|
354
|
+
_.r.vl=function(a){this.log.debug(_.bC,a.id);try{this.log.debug("onChooseStreams_, choosing variant from ",a.variants);this.log.debug("onChooseStreams_, choosing text from ",a.textStreams);var b=UJ(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,qb:null}}};
|
|
355
|
+
_.r.Fn=function(){var a=this;return _.I(function(b){switch(b.a){case 1:a.log.debug("onCanSwitch_");a.configuration.abr.enabled&&a.h.enable();if(!a.Fa){b.C(2);break}return _.x(b,dH(a.a,a.Fa,a.$j,a.Zj),3);case 3:a.Fa=null;case 2:if(!a.ha){b.C(0);break}return _.x(b,_.jH(a.a,a.ha),5);case 5:a.ha=null,_.z(b)}})};_.r.tp=function(){var a=iF(this);a&&a.parser&&a.parser.update()};_.r.co=function(){this.B&&this.B.j.Tf()};
|
|
356
|
+
_.r.yk=function(a,b,c){if((void 0===c?"":c)===$B)return OI(this),this.xa()||(this.configuration.abr.enabled=!0,this.h.enable()),RJ(this,b,!1),!0;if(c=b.variants.some(function(g){var k=!1,l=g[a.type];l&&(k=g.allowedByApplication&&l.id!==a.id,a.type===_.Rc&&(k=k&&l.language===a.language));return k})&&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)}OI(this);this.xa()||(this.configuration.abr.enabled=!0,this.h.enable());
|
|
357
|
+
RJ(this,b)}return c};_.r.On=function(){this.log.debug("endOfStream called by streaming engine");this.Ke=!0};_.r.onError=function(a){if(this.H!==JI&&7001!==a.code&&7E3!==a.code){var b=new _.R(_.le,{detail:a});a.severity===_.Q&&HE(this.ud,3);this.trigger(b);b.defaultPrevented&&(b.a=!0)}};_.r.Cg=function(a){a.type===_.de?this.dispatchEvent(a):"largegap"!==a.type&&(a.type===_.Vg?KI(this):"emsg"!==a.type&&(a instanceof _.R?this.dispatchEvent(a):this.log.debug(_.Nb,a.type)))};_.r.xa=function(){return this.configuration.abr.enabled};
|
|
358
|
+
_.r.gp=function(a){var b=this,c,d,e,f,g,k,l,m,n;return _.I(function(p){switch(p.a){case 1:if(!b.xc)return p["return"]();b.log.info("Attempt to switch CDN.");c=b.getLoadedSource();d=b.xa();return _.x(p,b.xc(c.url,a),2);case 2:e=p.f;if(!e)return p["return"]();f=_.N.ta(b.getLoadedSource(),{url:e});d&&b.h.disable();return _.x(p,uH(b.a),3);case 3:g=ZJ(b),k=YJ(b);case 4:return l=!1,_.F(p,7),b.log.info("Switching CDN to "+f.url+"."),_.x(p,$J(b,f,g,k),9);case 9:_.G(p,6);break;case 7:return m=_.H(p),b.log.info("Switch failed"),
|
|
359
|
+
_.x(p,b.xc(f.url,a),10);case 10:if(n=p.f)f.url=n,l=!0;else throw m;case 6:l?p.C(4):(d&&b.h.enable(),qH(b.a,!0),b.ea[b.getSourceIndex()]=f,a.f=!0,b.trigger(new _.R(_.kd,{newManifest:f.url})),_.z(p))}})};var JI=0,cI=1,dI=2,NI=[_.df,_.ve];aK.prototype.a=function(){return SB};
|
|
360
|
+
aK.prototype.canPlay=function(a,b){if(_.ui())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 _.ew||_.hk(a.url)in _.fw?!0:!1:!1;if(d&&e){if(_.si(2))return 1;if(_.vi()&&c===_.Xm){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};
|
|
361
|
+
aK.prototype.f=function(a){return a===_.ta||a===_.ob};aK.prototype.create=function(){return new eI};_.w(gK,_.Yv);_.r=gK.prototype;_.r.getClass=function(){return hC};_.r.isRenderer=function(){return!1};
|
|
362
|
+
_.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=_.S.ph(f);f=new VTTCue(e.startTime,e.endTime,f);f.line=-1;try{f.align=_.md}catch(g){f.align="middle"}e.writingMode===_.Ig?f.vertical="lr":e.writingMode===_.Jg&&(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?
|
|
363
|
+
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;hK(this.a,function(c){return c.startTime<b&&c.endTime>a});return!0};_.r.isTextVisible=function(){return this.a.mode===_.Yf};_.r.setTextVisibility=function(a){null!==this.a&&(this.a.mode=a?_.Yf:_.re)};_.r.destroy=function(){this.a&&hK(this.a,function(){return!0});this.a=null;return Promise.resolve()};iK.prototype.a=function(){return!0};iK.prototype.create=function(a){return new gK(a)};_.Uh(new aK);_.wq(hC,new iK);
|
|
364
|
+
_.jt(function(){_.Ph("MediaSource.install");if(window.MediaSource)if(window.cast&&cast.__platform__&&cast.__platform__.canDisplayType)_.Oh("Patching Chromecast MSE bugs."),fK();else if(_.vi()){var a=navigator.appVersion;a=0<=a.indexOf("Version")?parseInt(a.match(/Version\/(\d+)/)[1],10):13;dK();10>=a?(_.Oh("Blacklisting MSE on Safari \x3c\x3d 10."),window.MediaSource=null):12>=a?(_.Oh("Patching Safari 11 \x26 12 MSE bugs."),bK(),cK()):(_.Oh("Patching Safari 13 MSE bugs."),bK())}else _.si(2)||_.si(3)||
|
|
365
|
+
_.si(4)?eK():_.Oh("Using native MSE as-is.");else _.Oh("No MSE implementation available.")});};
|
|
367
366
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
368
367
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
369
368
|
else{_=this.clpp._;(f.call(g,this));}
|