shaka-player 4.1.3 → 4.1.4
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/.github/workflows/selenium-lab-tests.yaml +158 -53
- package/CHANGELOG.md +11 -0
- package/dist/controls.css +1 -1
- package/dist/controls.css.map +1 -1
- package/dist/locales.js +33 -33
- package/dist/shaka-player.compiled.debug.js +10 -9
- package/dist/shaka-player.compiled.debug.map +3 -3
- package/dist/shaka-player.compiled.js +36 -36
- package/dist/shaka-player.compiled.map +2 -2
- package/dist/shaka-player.ui.debug.js +13 -11
- package/dist/shaka-player.ui.debug.map +3 -3
- package/dist/shaka-player.ui.js +37 -37
- package/dist/shaka-player.ui.map +2 -2
- package/lib/player.js +13 -1
- package/lib/text/ui_text_displayer.js +8 -0
- package/lib/util/player_configuration.js +1 -0
- package/package.json +1 -1
- package/test/media/drm_engine_unit.js +29 -0
- package/test/player_src_equals_integration.js +2 -0
- package/test/player_unit.js +39 -1
- package/test/test/assets/small.mp4 +0 -0
- package/ui/less/ad_controls.less +4 -0
|
@@ -346,11 +346,11 @@ n.startTime-q.startTime:n.endTime-q.endTime});h=t(h);for(k=h.next();!k.done;k=h.
|
|
|
346
346
|
function Yj(a,b,c){var d=1<c.length,e=d?"span":"div";b.lineBreak&&(e="br");d=!d&&0<b.nestedCues.length;var f=document.createElement(e);"br"!=e&&Zj(a,f,b,c,d);c=null;if(b.region&&b.region.id)if(c=b.region,a.o.has(c.id))c=a.o.get(c.id);else{e=document.createElement("span");var g=c.heightUnits==Ab?"%":"px",h=c.widthUnits==Ab?"%":"px",k=c.viewportAnchorUnits==Ab?"%":"px";e.id="shaka-text-region---"+c.id;e.classList.add("shaka-text-region");e.style.height=c.height+g;e.style.width=c.width+h;e.style.position=
|
|
347
347
|
"absolute";e.style.top=c.viewportAnchorY+k;e.style.left=c.viewportAnchorX+k;e.style.display="flex";e.style.flexDirection="column";e.style.alignItems="center";e.style.justifyContent="before"==b.displayAlign?"flex-start":"center"==b.displayAlign?"center":"flex-end";a.o.set(c.id,e);c=e}e=f;d&&(e=document.createElement("span"),e.classList.add("shaka-text-wrapper"),e.style.backgroundColor=b.backgroundColor,f.appendChild(e));a.h.set(b,{vd:f,Qe:e,oc:c})}
|
|
348
348
|
function Zj(a,b,c,d,e){var f=b.style,g=0==c.nestedCues.length,h=1<d.length;f.whiteSpace="pre-wrap";var k=c.payload.replace(/\s+$/g,function(m){return"\u00a0".repeat(m.length)});f.webkitTextStrokeColor=c.textStrokeColor;f.webkitTextStrokeWidth=c.textStrokeWidth;f.color=c.color;f.direction=c.direction;f.opacity=c.opacity;f.paddingLeft=ak(c.linePadding,c,a.m);f.paddingRight=ak(c.linePadding,c,a.m);f.textShadow=c.textShadow;if(c.backgroundImage)f.backgroundImage="url('"+c.backgroundImage+"')",f.backgroundRepeat=
|
|
349
|
-
"no-repeat",f.backgroundSize="contain",f.backgroundPosition="center";else{if(c.nestedCues.length)var l=b;else l=document.createElement("span"),b.appendChild(l);c.border&&(l.style.border=c.border);e||((b=bk(d,function(m){return m.backgroundColor}))?l.style.backgroundColor=b:k&&(l.style.backgroundColor="rgba(0, 0, 0, 0.8)"));k&&(l.textContent=k)}h&&!d[d.length-1].isContainer?f.display="inline":(f.display="flex",f.flexDirection="column",f.alignItems="center",f.justifyContent=
|
|
350
|
-
"flex-start":"center"==c.displayAlign?"center":"flex-end");g||(f.margin="0");f.fontFamily=c.fontFamily;f.fontWeight=c.fontWeight.toString();f.fontStyle=c.fontStyle;f.letterSpacing=c.letterSpacing;f.fontSize=ak(c.fontSize,c,a.m);c.line&&1==c.lineInterpretation&&(f.position="absolute",f.left="0",f.top="0",c.writingMode==nb?(f.width="100%",c.lineAlign==pb?f.top=c.line+"%":"end"==c.lineAlign&&(f.bottom=c.line+"%")):"vertical-lr"==c.writingMode?(f.height="100%",c.lineAlign==pb?
|
|
351
|
-
c.lineAlign&&(f.right=c.line+"%")):(f.height="100%",c.lineAlign==pb?f.right=c.line+"%":"end"==c.lineAlign&&(f.left=c.line+"%")));f.lineHeight=c.lineHeight;c.position&&(c.writingMode==nb?f.paddingLeft=c.position:f.paddingTop=c.position);"line-left"==c.positionAlign?f.cssFloat="left":"line-right"==c.positionAlign&&(f.cssFloat="right");f.textAlign=c.textAlign;f.textDecoration=c.textDecoration.join(" ");f.writingMode=c.writingMode;"writingMode"in document.documentElement.style&&
|
|
352
|
-
(f.webkitWritingMode=c.writingMode);c.size&&(c.writingMode==nb?f.width=c.size+"%":f.height=c.size+"%")}function ak(a,b,c){var d=(d=(new RegExp(/(\d*\.?\d+)([a-z]+|%+)/)).exec(a))?{value:Number(d[1]),unit:d[2]}:null;if(!d)return a;var e=d.value;switch(d.unit){case "%":return e/100*c.clientHeight/b.cellResolution.rows+"px";case "c":return c.clientHeight*e/b.cellResolution.rows+"px";default:return a}}
|
|
353
|
-
M("shaka.text.UITextDisplayer",Vj);Vj.prototype.setTextVisibility=Vj.prototype.setTextVisibility;Vj.prototype.isTextVisible=Vj.prototype.isTextVisible;Vj.prototype.remove=Vj.prototype.remove;Vj.prototype.destroy=Vj.prototype.destroy;Vj.prototype.append=Vj.prototype.append;function ck(a,b){function c(h){for(var k=h,l=t(b),m=l.next();!m.done;m=l.next())m=m.value,m.end&&m.start<h&&(k+=m.end-m.start);h=Math.floor(k/3600);l=Math.floor(k/60%60);m=Math.floor(k%60);k=Math.floor(1E3*k%1E3);return(10>h?"0":"")+h+":"+(10>l?"0":"")+l+":"+(10>m?"0":"")+m+"."+(100>k?10>k?"00":"0":"")+k}function d(h){var k=[],l=700<=h.fontWeight,m="italic"==h.fontStyle,p=h.textDecoration.includes("underline");l&&k.push("b");m&&k.push("i");p&&k.push("u");l=k.reduce(function(n,q){return n+"<"+q+">"},
|
|
349
|
+
"no-repeat",f.backgroundSize="contain",f.backgroundPosition="center",f.width="100%",f.height="100%";else{if(c.nestedCues.length)var l=b;else l=document.createElement("span"),b.appendChild(l);c.border&&(l.style.border=c.border);e||((b=bk(d,function(m){return m.backgroundColor}))?l.style.backgroundColor=b:k&&(l.style.backgroundColor="rgba(0, 0, 0, 0.8)"));k&&(l.textContent=k)}h&&!d[d.length-1].isContainer?f.display="inline":(f.display="flex",f.flexDirection="column",f.alignItems="center",f.justifyContent=
|
|
350
|
+
"before"==c.displayAlign?"flex-start":"center"==c.displayAlign?"center":"flex-end");g||(f.margin="0");f.fontFamily=c.fontFamily;f.fontWeight=c.fontWeight.toString();f.fontStyle=c.fontStyle;f.letterSpacing=c.letterSpacing;f.fontSize=ak(c.fontSize,c,a.m);c.line&&1==c.lineInterpretation&&(f.position="absolute",f.left="0",f.top="0",c.writingMode==nb?(f.width="100%",c.lineAlign==pb?f.top=c.line+"%":"end"==c.lineAlign&&(f.bottom=c.line+"%")):"vertical-lr"==c.writingMode?(f.height="100%",c.lineAlign==pb?
|
|
351
|
+
f.left=c.line+"%":"end"==c.lineAlign&&(f.right=c.line+"%")):(f.height="100%",c.lineAlign==pb?f.right=c.line+"%":"end"==c.lineAlign&&(f.left=c.line+"%")));f.lineHeight=c.lineHeight;c.position&&(c.writingMode==nb?f.paddingLeft=c.position:f.paddingTop=c.position);"line-left"==c.positionAlign?f.cssFloat="left":"line-right"==c.positionAlign&&(f.cssFloat="right");f.textAlign=c.textAlign;f.textDecoration=c.textDecoration.join(" ");f.writingMode=c.writingMode;"writingMode"in document.documentElement.style&&
|
|
352
|
+
f.writingMode==c.writingMode||(f.webkitWritingMode=c.writingMode);c.size&&(c.writingMode==nb?f.width=c.size+"%":f.height=c.size+"%")}function ak(a,b,c){var d=(d=(new RegExp(/(\d*\.?\d+)([a-z]+|%+)/)).exec(a))?{value:Number(d[1]),unit:d[2]}:null;if(!d)return a;var e=d.value;switch(d.unit){case "%":return e/100*c.clientHeight/b.cellResolution.rows+"px";case "c":return c.clientHeight*e/b.cellResolution.rows+"px";default:return a}}
|
|
353
|
+
function bk(a,b){for(var c=a.length-1;0<=c;c--){var d=b(a[c]);if(d||0===d)return d}return null}M("shaka.text.UITextDisplayer",Vj);Vj.prototype.setTextVisibility=Vj.prototype.setTextVisibility;Vj.prototype.isTextVisible=Vj.prototype.isTextVisible;Vj.prototype.remove=Vj.prototype.remove;Vj.prototype.destroy=Vj.prototype.destroy;Vj.prototype.append=Vj.prototype.append;function ck(a,b){function c(h){for(var k=h,l=t(b),m=l.next();!m.done;m=l.next())m=m.value,m.end&&m.start<h&&(k+=m.end-m.start);h=Math.floor(k/3600);l=Math.floor(k/60%60);m=Math.floor(k%60);k=Math.floor(1E3*k%1E3);return(10>h?"0":"")+h+":"+(10>l?"0":"")+l+":"+(10>m?"0":"")+m+"."+(100>k?10>k?"00":"0":"")+k}function d(h){var k=[],l=700<=h.fontWeight,m="italic"==h.fontStyle,p=h.textDecoration.includes("underline");l&&k.push("b");m&&k.push("i");p&&k.push("u");l=k.reduce(function(n,q){return n+"<"+q+">"},
|
|
354
354
|
"");k=k.reduceRight(function(n,q){return n+"</"+q+">"},"");return h.lineBreak?"\n":h.nestedCues.length?h.nestedCues.map(d).join(""):l+h.payload+k}var e=a.map(function(h){if(h.nestedCues.length){var k=h.clone();k.nestedCues=[];k.payload=d(h);return k}return h}),f="WEBVTT\n\n";e=t(e);for(var g=e.next();!g.done;g=e.next())g=g.value,f+=c(g.startTime)+" --\x3e "+c(g.endTime)+function(h){var k=[];switch(h.textAlign){case "left":k.push("align:left");break;case "right":k.push("align:right");break;case mb:k.push("align:middle");
|
|
355
355
|
break;case "start":k.push("align:start");break;case "end":k.push("align:end")}switch(h.writingMode){case "vertical-lr":k.push("vertical:lr");break;case "vertical-rl":k.push("vertical:rl")}return k.length?" "+k.join(" "):""}(g)+"\n",f+=g.payload+"\n\n";return f}M("shaka.text.WebVttGenerator",function(){});function dk(a,b){this.h=a;this.g=b;this.j="";this.o=void 0;this.i=!1;this.m=!0;this.l=!1}function ek(a,b,c){try{if(a.g.enabled){var d={d:1E3*c.duration,st:a.h.V()?fk:gk};d.ot=hk(c);var e=d.ot===ik||d.ot===jk||d.ot===kk||d.ot===lk;e&&(d.bl=mk(a,c.type));c.bandwidth&&(d.br=c.bandwidth/1E3);e&&d.ot!==lk&&(d.tb=nk(a,d.ot)/1E3);ok(a,b,d)}}catch(f){Wa("CMCD_SEGMENT_ERROR","Could not generate segment CMCD data.",f)}}
|
|
356
356
|
function pk(a,b,c){try{if(!a.g.enabled)return b;var d=qk(a);a:{switch(c){case "video/webm":case "video/mp4":var e=kk;break a;case "application/x-mpegurl":e=rk;break a}e=void 0}d.ot=e;d.su=!0;var f=sk(d);return tk(b,f)}catch(g){return Wa("CMCD_SRC_ERROR","Could not generate src CMCD data.",g),b}}function qk(a){a.j||(a.j=a.g.sessionId||window.crypto.randomUUID());return{v:1,sf:a.o,sid:a.j,cid:a.g.contentId,mtp:a.h.getBandwidthEstimate()/1E3}}
|
|
@@ -369,43 +369,43 @@ rebufferingGoal:2,bufferingGoal:10,bufferBehind:30,ignoreTextStreamFailures:!1,a
|
|
|
369
369
|
vc()||xc())d.gapDetectionThreshold=.5;if(uc("Web0S")||vc()||xc())d.stallSkip=0;var e={trackSelectionCallback:function(g){return K(function(h){return h["return"](g)})},downloadSizeCallback:function(g){var h;return K(function(k){if(1==k.g)return navigator.storage&&navigator.storage.estimate?u(k,navigator.storage.estimate(),3):k["return"](!0);h=k.h;return k["return"](h.usage+g<.95*h.quota)})},progressCallback:function(g,h){return Ak([g,h],void 0)},usePersistentLicense:!0,numberOfParallelDownloads:5},
|
|
370
370
|
f={drm:b,manifest:c,streaming:d,offline:e,abrFactory:function(){return new pe},abr:{enabled:!0,useNetworkInformation:!0,defaultBandwidthEstimate:1E6,switchInterval:8,bandwidthUpgradeTarget:.85,bandwidthDowngradeTarget:.95,restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:a,minPixels:0,maxPixels:Infinity,minFrameRate:0,maxFrameRate:Infinity,minBandwidth:0,maxBandwidth:Infinity},advanced:{minTotalBytes:128E3,minBytes:16E3,fastHalfLife:2,slowHalfLife:5}},preferredAudioLanguage:"",preferredTextLanguage:"",
|
|
371
371
|
preferredVariantRole:"",preferredTextRole:"",preferredAudioChannelCount:2,preferredVideoCodecs:[],preferredAudioCodecs:[],preferForcedSubs:!1,preferredDecodingAttributes:[],restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:Infinity,minPixels:0,maxPixels:Infinity,minFrameRate:0,maxFrameRate:Infinity,minBandwidth:0,maxBandwidth:Infinity},playRangeStart:0,playRangeEnd:Infinity,textDisplayFactory:function(){return null},cmcd:{enabled:!1,sessionId:"",contentId:"",useHeaders:!1}};e.trackSelectionCallback=
|
|
372
|
-
function(g){return K(function(h){return h["return"](Dk(g,f.preferredAudioLanguage))})};return f}function Ek(a,b,c){var d={".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:"",audioRobustness:"",sessionType:"",serverCertificate:new Uint8Array(0),serverCertificateUri:"",individualizationServer:""}};return yk(a,b,c||Ck(),d,"")}
|
|
372
|
+
function(g){return K(function(h){return h["return"](Dk(g,f.preferredAudioLanguage))})};return f}function Ek(a,b,c){var d={".drm.keySystemsMapping":"",".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:"",audioRobustness:"",sessionType:"",serverCertificate:new Uint8Array(0),serverCertificateUri:"",individualizationServer:""}};return yk(a,b,c||Ck(),d,"")}
|
|
373
373
|
function Dk(a,b){var c=a.filter(function(h){return"variant"==h.type}),d=[],e=wd(b,c.map(function(h){return h.language}));e&&(d=c.filter(function(h){return Q(h.language)==e}));0==d.length&&(d=c.filter(function(h){return h.primary}));0==d.length&&(c.map(function(h){return h.language}),d=c);var f=d.filter(function(h){return h.height&&480>=h.height});f.length&&(f.sort(function(h,k){return k.height-h.height}),d=f.filter(function(h){return h.height==f[0].height}));c=[];if(d.length){var g=Math.floor(d.length/
|
|
374
374
|
2);d.sort(function(h,k){return h.bandwidth-k.bandwidth});c.push(d[g])}d=t(a);for(g=d.next();!g.done;g=d.next())g=g.value,g.type!=lc&&"image"!=g.type||c.push(g);return c}M("shaka.util.PlayerConfiguration",Bk);Bk.mergeConfigObjects=Ek;Bk.createDefault=Ck;function Fk(){this.g=null;this.h=[]}function Gk(a,b){if(null==a.g)a.g={timestamp:Date.now()/1E3,state:b,duration:0};else{var c=Date.now()/1E3;a.g.duration=c-a.g.timestamp;a.g.state!=b&&(a.h.push(a.g),a.g={timestamp:c,state:b,duration:0})}}function Hk(a,b){var c=0;a.g&&a.g.state==b&&(c+=a.g.duration);for(var d=t(a.h),e=d.next();!e.done;e=d.next())e=e.value,c+=e.state==b?e.duration:0;return c}
|
|
375
|
-
function Ik(a){function b(f){return{timestamp:f.timestamp,state:f.state,duration:f.duration}}for(var c=[],d=t(a.h),e=d.next();!e.done;e=d.next())c.push(b(e.value));a.g&&c.push(b(a.g));return c};function Jk(){this.i=this.h=null;this.g=[]}function Kk(a,b,c){a.i!=b&&(a.i=b,a.g.push({timestamp:Date.now()/1E3,id:b.id,type:"text",fromAdaptation:c,bandwidth:null}))};function Lk(){this.
|
|
375
|
+
function Ik(a){function b(f){return{timestamp:f.timestamp,state:f.state,duration:f.duration}}for(var c=[],d=t(a.h),e=d.next();!e.done;e=d.next())c.push(b(e.value));a.g&&c.push(b(a.g));return c};function Jk(){this.i=this.h=null;this.g=[]}function Kk(a,b,c){a.i!=b&&(a.i=b,a.g.push({timestamp:Date.now()/1E3,id:b.id,type:"text",fromAdaptation:c,bandwidth:null}))};function Lk(){this.u=this.B=this.G=this.D=this.s=this.j=this.F=this.m=this.i=this.O=this.T=this.I=this.L=this.M=this.l=this.o=NaN;this.g=new Fk;this.h=new Jk};function U(a,b){Re.call(this);var c=this;this.l=Mk;this.Hc=this.g=null;this.ha=!1;this.Qc=new jf;this.Ub=new jf;this.s=new jf;this.zd=this.u=this.Tb=this.i=this.Rc=this.I=this.j=this.ia=this.T=this.Sc=this.M=this.Ic=this.G=this.ub=this.B=this.L=this.m=this.F=null;this.Ee=1E9;this.h=Nk(this);this.Yb={width:Infinity,height:Infinity};this.o=null;this.La=new xe(this.h.preferredAudioLanguage,this.h.preferredVariantRole,this.h.preferredAudioChannelCount);this.Ma=this.h.preferredTextLanguage;this.Xb=this.h.preferredTextRole;
|
|
376
376
|
this.Vb=this.h.preferForcedSubs;this.Kb=[];this.ac=null;b&&b(this);this.F=Ok(this);this.F.$d(this.h.streaming.forceHTTPS);this.D=null;Pk&&(this.D=Pk());this.Qc.C(window,"online",function(){c.Ud()});this.O={name:"detach"};this.Y={name:"attach"};this.ea={name:"unload"};this.Nd={name:"manifest-parser"};this.Kd={name:"manifest"};this.sb={name:"media-source"};this.Bd={name:"drm-engine"};this.ca={name:"load"};this.Qd={name:"src-equals-drm-engine"};this.vb={name:"src-equals"};var d=new Map;d.set(this.Y,
|
|
377
377
|
function(e,f){return Me(Qk(c,e,f))});d.set(this.O,function(e){e.K&&(c.Ub.pc(),e.K=null);c.D&&c.D.release();c.g=null;e=Promise.resolve();return Me(e)});d.set(this.ea,function(e){return Me(Rk(c,e))});d.set(this.sb,function(e){e=Sk(c,e);return Me(e)});d.set(this.Nd,function(e,f){var g=Tk(c,e,f);return Me(g)});d.set(this.Kd,function(e){return Uk(c,e)});d.set(this.Bd,function(e){e=Vk(c,e);return Me(e)});d.set(this.ca,function(e,f){return Me(Wk(c,e,f))});d.set(this.Qd,function(e,f){var g=Xk(c,e,f);return Me(g)});
|
|
378
378
|
d.set(this.vb,function(e,f){return Yk(c,e,f)});this.ua=new Jj(this.O,{vf:function(e,f,g,h){var k=null;e==c.O&&(k=g==c.O?c.O:c.Y);e==c.Y&&(k=g==c.O||f.K!=h.K?c.O:g==c.Y?c.Y:g==c.sb||g==c.ca?c.sb:g==c.vb?c.Qd:null);e==c.sb&&(k=g==c.ca&&f.K==h.K?c.Nd:c.ea);e==c.Nd&&(k=Zk(c.ca,c.Kd,c.ea,g,f,h));e==c.Kd&&(k=Zk(c.ca,c.Bd,c.ea,g,f,h));e==c.Bd&&(k=Zk(c.ca,c.ca,c.ea,g,f,h));e==c.Qd&&(k=g==c.vb&&f.K==h.K?c.vb:c.ea);if(e==c.ca||e==c.vb)k=c.ea;e==c.ea&&(k=h.K&&f.K==h.K?c.Y:c.O);return k},ef:function(e,f,g){c.dispatchEvent($k("onstatechange",
|
|
379
379
|
(new Map).set("state",e.name)));return d.get(e)(f,g)},handleError:function(e){return K(function(f){return 1==f.g?u(f,Rk(c,e),2):f["return"](e.K?c.Y:c.O)})},Nf:function(e){c.dispatchEvent($k("onstateidle",(new Map).set("state",e.name)))}});this.De=new O(function(){Nd(c.i.variants,c.h.restrictions,c.Yb)&&al(c)});a&&this.Wb(a,!0)}pa(U,Re);function $k(a,b){return new R(a,b)}r=U.prototype;
|
|
380
|
-
r.destroy=function(){var a=this,b;return K(function(c){switch(c.g){case 1:if(a.l==bl)return c["return"]();a.l=bl;b=Oj(a.ua,function(){return{node:a.O,payload:Kj(),hb:!1}});return u(c,new Promise(function(d){b.Fb=function(){};b.Vc=function(){d()};b.lb=function(){d()};b.onError=function(){d()};b.Xc=function(){d()}}),2);case 2:return u(c,a.ua.destroy(),3);case 3:a.Qc&&(a.Qc.release(),a.Qc=null);a.Ub&&(a.Ub.release(),a.Ub=null);a.
|
|
380
|
+
r.destroy=function(){var a=this,b;return K(function(c){switch(c.g){case 1:if(a.l==bl)return c["return"]();a.l=bl;b=Oj(a.ua,function(){return{node:a.O,payload:Kj(),hb:!1}});return u(c,new Promise(function(d){b.Fb=function(){};b.Vc=function(){d()};b.lb=function(){d()};b.onError=function(){d()};b.Xc=function(){d()}}),2);case 2:return u(c,a.ua.destroy(),3);case 3:a.Qc&&(a.Qc.release(),a.Qc=null);a.Ub&&(a.Ub.release(),a.Ub=null);a.s&&(a.s.release(),a.s=null);a.zd=null;a.u=null;a.h=null;a.o=null;a.Hc=null;
|
|
381
381
|
a.T=null;if(!a.F){c.A(4);break}return u(c,a.F.destroy(),5);case 5:a.F=null;case 4:Re.prototype.release.call(a),z(c)}})};r.Wb=function(a,b){b=void 0===b?!0:b;if(this.l==bl)return Promise.reject(cl());var c=Kj();c.K=a;qc()||(b=!1);var d=b?this.sb:this.Y,e=Oj(this.ua,function(){return{node:d,payload:c,hb:!1}});e.Fb=function(){};return dl(e)};r.detach=function(){var a=this;if(this.l==bl)return Promise.reject(cl());var b=Oj(this.ua,function(){return{node:a.O,payload:Kj(),hb:!1}});b.Fb=function(){};return dl(b)};
|
|
382
382
|
r.ge=function(a){var b=this;a=void 0===a?!0:a;if(this.l==bl)return Promise.reject(cl());qc()||(a=!1);var c=Kj(),d=Oj(this.ua,function(e){var f=e.K&&a?b.sb:e.K?b.Y:b.O;c.K=e.K;return{node:f,payload:c,hb:!1}});d.Fb=function(){};return dl(d)};r.ng=function(a){this.ac=a};
|
|
383
|
-
r.load=function(a,b,c){var d=this;this.ac=null;if(this.l==bl)return Promise.reject(cl());this.dispatchEvent($k("loading"));var e=Kj();e.uri=a;e.de=Date.now()/1E3;c&&(e.mimeType=c);void 0!==b&&(e.startTime=b);var f=el(this,e)?this.vb:this.ca,g=Oj(this.ua,function(h){if(null==h.K)return null;e.K=h.K;return{node:f,payload:e,hb:!0}});this.
|
|
383
|
+
r.load=function(a,b,c){var d=this;this.ac=null;if(this.l==bl)return Promise.reject(cl());this.dispatchEvent($k("loading"));var e=Kj();e.uri=a;e.de=Date.now()/1E3;c&&(e.mimeType=c);void 0!==b&&(e.startTime=b);var f=el(this,e)?this.vb:this.ca,g=Oj(this.ua,function(h){if(null==h.K)return null;e.K=h.K;return{node:f,payload:e,hb:!0}});this.o=new Lk;this.T=fl(this);g.Fb=function(){};return new Promise(function(h,k){g.Xc=function(){return k(new N(2,7,7002))};g.Vc=function(){h();d.dispatchEvent($k("loaded"))};
|
|
384
384
|
g.lb=function(){return k(cl())};g.onError=function(l){return k(l)}})};function el(a,b){if(!qc())return!0;var c=b.mimeType,d=b.uri||"";c||(c=jg(d),c=gl[c]);if(c){if(""==(b.K||sc()).canPlayType(c))return!1;if(!qc()||!(c in ig||jg(d)in kg)||a.h.streaming.preferNativeHls)return!0;if(yc())return a.h.streaming.useNativeHlsOnSafari}return!1}function Qk(a,b,c){null==b.K&&(b.K=c.K,a.Ub.C(b.K,"error",function(){var d=hl(a);d&&il(a,d)}));a.g=b.K;return Promise.resolve()}
|
|
385
|
-
function Rk(a,b){var c,d,e,f,g,h,k,l,m;return K(function(p){switch(p.g){case 1:return a.l!=bl&&(a.l=Mk),c=a.Kb.map(function(n){return n()}),a.Kb=[],u(p,Promise.all(c),2);case 2:a.dispatchEvent($k("unloading"));b.mimeType=null;b.startTime=null;b.uri=null;b.K&&a.
|
|
385
|
+
function Rk(a,b){var c,d,e,f,g,h,k,l,m;return K(function(p){switch(p.g){case 1:return a.l!=bl&&(a.l=Mk),c=a.Kb.map(function(n){return n()}),a.Kb=[],u(p,Promise.all(c),2);case 2:a.dispatchEvent($k("unloading"));b.mimeType=null;b.startTime=null;b.uri=null;b.K&&a.s.pc();a.De.stop();a.ub&&(a.ub.release(),a.ub=null);a.Ic&&(a.Ic.stop(),a.Ic=null);if(!a.I){p.A(3);break}return u(p,a.I.stop(),4);case 4:a.I=null,a.Rc=null;case 3:if(!a.u){p.A(5);break}return u(p,a.u.stop(),5);case 5:if(!a.j){p.A(7);break}return u(p,
|
|
386
386
|
a.j.destroy(),8);case 8:a.j=null;case 7:a.G&&(a.G.release(),a.G=null);a.B&&(a.B.release(),a.B=null);if(!a.L){p.A(9);break}return u(p,a.L.destroy(),10);case 10:a.L=null;case 9:if(a.D)a.D.onAssetUnload();if(!b.K||!b.K.src){p.A(11);break}return u(p,new Promise(function(n){return(new O(n)).S(.1)}),12);case 12:for(b.K.removeAttribute("src"),b.K.load();b.K.lastChild;)b.K.removeChild(b.K.firstChild);case 11:if(!a.m){p.A(13);break}return u(p,a.m.destroy(),14);case 14:a.m=null;case 13:a.Tb=null;a.M=null;if(a.i){d=
|
|
387
|
-
t(a.i.variants);for(e=d.next();!e.done;e=d.next())for(f=e.value,g=t([f.audio,f.video]),h=g.next();!h.done;h=g.next())(k=h.value)&&k.segmentIndex&&k.segmentIndex.release();l=t(a.i.textStreams);for(h=l.next();!h.done;h=l.next())m=h.value,m.segmentIndex&&m.segmentIndex.release()}a.i=null;a.
|
|
387
|
+
t(a.i.variants);for(e=d.next();!e.done;e=d.next())for(f=e.value,g=t([f.audio,f.video]),h=g.next();!h.done;h=g.next())(k=h.value)&&k.segmentIndex&&k.segmentIndex.release();l=t(a.i.textStreams);for(h=l.next();!h.done;h=l.next())m=h.value,m.segmentIndex&&m.segmentIndex.release()}a.i=null;a.o=new Lk;a.Gd=null;jl(a);z(p)}})}
|
|
388
388
|
function Sk(a,b){var c,d,e,f,g,h;return K(function(k){if(1==k.g)return c=new Jh,d=a.h.textDisplayFactory,e=d(),a.Gd=d,f=kl(b.K,c,e,function(l,m,p){l=t(l);for(var n=l.next();!n.done;n=l.next())if(n=n.value,n.data&&n.cueTime&&n.frames){for(var q=n.cueTime+m,w=p,y=t(n.frames),x=y.next();!x.done;x=y.next())ll(a,q,w,"ID3",x.value);if(a.D)a.D.onHlsTimedMetadata(n,q)}}),g=a.h.manifest,h=g.segmentRelativeVttTiming,f.F=h,u(k,f.G,2);a.L=f;z(k)})}
|
|
389
389
|
function Tk(a,b,c){var d,e,f,g;return K(function(h){if(1==h.g)return b.mimeType=c.mimeType,b.uri=c.uri,d=b.uri,e=a.F,a.Tb=d,f=a,u(h,hg(d,e,a.h.manifest.retryParameters,b.mimeType),2);f.Rc=h.h;a.I=a.Rc();g=Se(a.h.manifest);c.K&&"AUDIO"===c.K.nodeName&&(g.disableVideo=!0);a.I.configure(g);z(h)})}
|
|
390
390
|
function Uk(a,b){var c=b.uri,d=a.F;a.Sc=new aj(function(){return a.qc()});a.Sc.addEventListener("regionadd",function(g){g=g.region;ml(a,"timelineregionadded",g);if(a.D)a.D.onDashTimedMetadata(g)});a.ia=null;a.h.streaming.observeQualityChanges&&(a.ia=new Xi(function(){return a.Oa()}),a.ia.addEventListener("qualitychange",function(g){var h=g.quality;g=g.position;h=(new Map).set("mediaQuality",{bandwidth:h.bandwidth,audioSamplingRate:h.audioSamplingRate,codecs:h.codecs,contentType:h.contentType,frameRate:h.frameRate,
|
|
391
391
|
height:h.height,mimeType:h.mimeType,channelsCount:h.channelsCount,pixelAspectRatio:h.pixelAspectRatio,width:h.width}).set("position",g);a.dispatchEvent($k("mediaqualitychanged",h))}));var e={networkingEngine:d,modifyManifestRequest:function(g,h){var k=a.T;try{k.g.enabled&&(k.o=h.format,ok(k,g,{ot:rk,su:!k.i}))}catch(l){Wa("CMCD_MANIFEST_ERROR","Could not generate manifest CMCD data.",l)}},modifySegmentRequest:function(g,h){ek(a.T,g,h)},filter:function(g){return nl(a,g)},makeTextStreamsForClosedCaptions:function(g){return ol(a,
|
|
392
392
|
g)},onTimelineRegionAdded:function(g){var h=a.Sc;a:{var k=t(h.g);for(var l=k.next();!l.done;l=k.next())if(l=l.value,l.schemeIdUri==g.schemeIdUri&&l.id==g.id&&l.startTime==g.startTime&&l.endTime==g.endTime){k=l;break a}k=null}null==k&&(h.g.add(g),g=new R("regionadd",new Map([["region",g]])),h.dispatchEvent(g))},onEvent:function(g){return a.dispatchEvent(g)},onError:function(g){return il(a,g)},isLowLatencyMode:function(){return a.h.streaming.lowLatencyMode},isAutoLowLatencyMode:function(){return a.h.streaming.autoLowLatencyMode},
|
|
393
|
-
enableLowLatencyMode:function(){a.configure("streaming.lowLatencyMode",!0)}},f=Date.now()/1E3;return new Ie(function(){var g,h,k,l;return K(function(m){if(1==m.g)return g=a,u(m,a.I.start(c,e),2);g.i=m.h;h=$k("manifestparsed");a.dispatchEvent(h);if(0==a.i.variants.length)throw new N(2,4,4036);pl(a.i);k=Date.now()/1E3;l=k-f;a.
|
|
394
|
-
function Vk(a,b){var c,d;return K(function(e){return 1==e.g?(c=Date.now()/1E3,d=!0,a.m=ql(a,{kb:a.F,onError:function(f){il(a,f)},Wc:function(f){rl(a,f)},onExpirationUpdated:function(f,g){sl(a,f,g)},onEvent:function(f){a.dispatchEvent(f);"drmsessionupdate"==f.type&&d&&(d=!1,a.
|
|
395
|
-
function Wk(a,b,c){var d,e,f,g,h,k,l,m,p,n,q,w;return K(function(y){switch(y.g){case 1:b.startTime=c.startTime;null!=a.ac&&(b.startTime=a.ac,a.ac=null);d=b.K;e=b.uri;a.Tb=e;a.G=new Ti({Oc:function(){return d.playbackRate},Kc:function(){return d.defaultPlaybackRate},be:function(x){d.playbackRate=x},Ae:function(x){d.currentTime+=x}});f=function(){return tl(a)};g=function(){return ul(a)};a.
|
|
393
|
+
enableLowLatencyMode:function(){a.configure("streaming.lowLatencyMode",!0)}},f=Date.now()/1E3;return new Ie(function(){var g,h,k,l;return K(function(m){if(1==m.g)return g=a,u(m,a.I.start(c,e),2);g.i=m.h;h=$k("manifestparsed");a.dispatchEvent(h);if(0==a.i.variants.length)throw new N(2,4,4036);pl(a.i);k=Date.now()/1E3;l=k-f;a.o.F=l;z(m)})}(),function(){return a.I.stop()})}
|
|
394
|
+
function Vk(a,b){var c,d;return K(function(e){return 1==e.g?(c=Date.now()/1E3,d=!0,a.m=ql(a,{kb:a.F,onError:function(f){il(a,f)},Wc:function(f){rl(a,f)},onExpirationUpdated:function(f,g){sl(a,f,g)},onEvent:function(f){a.dispatchEvent(f);"drmsessionupdate"==f.type&&d&&(d=!1,a.o.j=Date.now()/1E3-c)}}),a.m.configure(a.h.drm),u(e,Af(a.m,a.i.variants,a.i.offlineSessionIds),2)):3!=e.g?u(e,a.m.Wb(b.K),3):u(e,nl(a,a.i),0)})}
|
|
395
|
+
function Wk(a,b,c){var d,e,f,g,h,k,l,m,p,n,q,w;return K(function(y){switch(y.g){case 1:b.startTime=c.startTime;null!=a.ac&&(b.startTime=a.ac,a.ac=null);d=b.K;e=b.uri;a.Tb=e;a.G=new Ti({Oc:function(){return d.playbackRate},Kc:function(){return d.defaultPlaybackRate},be:function(x){d.playbackRate=x},Ae:function(x){d.currentTime+=x}});f=function(){return tl(a)};g=function(){return ul(a)};a.s.C(d,"playing",f);a.s.C(d,"pause",f);a.s.C(d,"ended",f);a.s.C(d,"ratechange",g);h=a.h.abrFactory;a.u&&a.zd==h||
|
|
396
396
|
(a.zd=h,a.u=h(),a.u.configure(a.h.abr));a.La=new xe(a.h.preferredAudioLanguage,a.h.preferredVariantRole,a.h.preferredAudioChannelCount);a.Ma=a.h.preferredTextLanguage;a.Xb=a.h.preferredTextRole;a.Vb=a.h.preferForcedSubs;vl(a.i.presentationTimeline,a.h.playRangeStart,a.h.playRangeEnd);a.u.init(function(x,v,D){a.j&&x!=a.j.l&&wl(a,x,!0,void 0===v?!1:v,void 0===D?0:D)});a.B=xl(a,b.startTime);a.ub=yl(a);k=Math.max(a.i.minBufferTime,a.h.streaming.rebufferingGoal);zl(a,k);zd(a.i,a.h.preferredVideoCodecs,
|
|
397
|
-
a.h.preferredAudioCodecs,a.h.preferredAudioChannelCount,a.h.preferredDecodingAttributes);a.j=Al(a);a.j.configure(a.h.streaming);a.l=Bl;d.textTracks&&a.
|
|
398
|
-
null,be(l));case 2:return q=a.Bb().find(function(x){return x.active}),q||((w=me(a.i.textStreams,a.Ma,a.Xb,a.Vb)[0]||null)&&Kk(a.
|
|
397
|
+
a.h.preferredAudioCodecs,a.h.preferredAudioChannelCount,a.h.preferredDecodingAttributes);a.j=Al(a);a.j.configure(a.h.streaming);a.l=Bl;d.textTracks&&a.s.C(d.textTracks,"addtrack",function(x){if(x.track)switch(x=x.track,x.kind){case "chapters":Cl(a,x)}});a.dispatchEvent($k("streaming"));l=null;if(m=a.Za().find(function(x){return x.active})){y.A(2);break}l=al(a);wl(a,l,!0,!1,0);if(!a.h.streaming.startAtSegmentBoundary){y.A(3);break}p=a.B.Cc();return u(y,Dl(l,p),4);case 4:n=y.h,a.B.ud(n);case 3:El(a,
|
|
398
|
+
null,be(l));case 2:return q=a.Bb().find(function(x){return x.active}),q||((w=me(a.i.textStreams,a.Ma,a.Xb,a.Vb)[0]||null)&&Kk(a.o.h,w,!0),l&&(w?(l.audio&&Fl(a,l.audio,w)&&(a.ha=!0),a.ha&&a.L.m.setTextVisibility(!0),Gl(a)):a.ha=!1),w&&(a.h.streaming.alwaysStreamText||a.yd())&&tj(a.j,w)),u(y,a.j.start(),5);case 5:a.h.abr.enabled&&(a.u.enable(),Hl(a)),Qd(a.j?a.j.l:null,a.i),Il(a.i),Jl(a),Kl(a),a.i.variants.some(function(x){return x.primary}),a.s.oa(d,"loadedmetadata",function(){a.o.m=Date.now()/1E3-
|
|
399
399
|
c.de}),z(y)}})}
|
|
400
|
-
function Xk(a,b,c){var d,e,f,g,h,k,l;return K(function(m){return 1==m.g?(d=mc,e=Date.now()/1E3,f=!0,a.m=ql(a,{kb:a.F,onError:function(p){il(a,p)},Wc:function(p){rl(a,p)},onExpirationUpdated:function(p,n){sl(a,p,n)},onEvent:function(p){a.dispatchEvent(p);"drmsessionupdate"==p.type&&f&&(f=!1,a.
|
|
400
|
+
function Xk(a,b,c){var d,e,f,g,h,k,l;return K(function(m){return 1==m.g?(d=mc,e=Date.now()/1E3,f=!0,a.m=ql(a,{kb:a.F,onError:function(p){il(a,p)},Wc:function(p){rl(a,p)},onExpirationUpdated:function(p,n){sl(a,p,n)},onEvent:function(p){a.dispatchEvent(p);"drmsessionupdate"==p.type&&f&&(f=!1,a.o.j=Date.now()/1E3-e)}}),a.m.configure(a.h.drm),g=c.uri||"",h=jg(g),k=gl[h],"application/x-mpegurl"==k&&yc()&&(k="application/vnd.apple.mpegurl"),k||(k="video/mp4"),l={id:0,language:"und",disabledUntilTime:0,primary:!1,
|
|
401
401
|
audio:null,video:{id:0,originalId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:c.mimeType?c.mimeType.split(";")[0]:k,codecs:c.mimeType?bd(c.mimeType):"",encrypted:!0,drmInfos:[],keyIds:new Set,language:"und",label:null,type:d.va,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null},bandwidth:100,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]},
|
|
402
402
|
a.m.Y=!0,u(m,Af(a.m,[l],[]),2)):u(m,a.m.Wb(b.K),0)})}
|
|
403
|
-
function Yk(a,b,c){function d(){return tl(a)}b.uri=c.uri;b.startTime=c.startTime;a.Tb=b.uri;var e=b.K;a.B=new Ii(e);var f=!1;a.Kb.push(function(){f=!0});null!=b.startTime&&a.B.ud(b.startTime);a.G=new Ti({Oc:function(){return e.playbackRate},Kc:function(){return e.defaultPlaybackRate},be:function(k){e.playbackRate=k},Ae:function(k){e.currentTime+=k}});zl(a,a.h.streaming.rebufferingGoal);a.
|
|
404
|
-
e.preload&&a.
|
|
405
|
-
"change",function(){return Jl(a)}));var g=jg(b.uri);e.src=pk(a.T,b.uri,gl[g]);(vc()||uc("Web0S"))&&e.load();a.l=Ml;a.dispatchEvent($k("streaming"));var h=new nc;zi(e,HTMLMediaElement.HAVE_METADATA,a.
|
|
406
|
-
z(l)})});e.error?h.reject(hl(a)):"none"==e.preload&&(Va('With <video preload="none">, the browser will not load anything until play() is called. We are unable to measure load latency in a meaningful way, and we cannot provide track info yet. Please do not use preload="none" with Shaka Player.'),h.resolve());a.
|
|
403
|
+
function Yk(a,b,c){function d(){return tl(a)}b.uri=c.uri;b.startTime=c.startTime;a.Tb=b.uri;var e=b.K;a.B=new Ii(e);var f=!1;a.Kb.push(function(){f=!0});null!=b.startTime&&a.B.ud(b.startTime);a.G=new Ti({Oc:function(){return e.playbackRate},Kc:function(){return e.defaultPlaybackRate},be:function(k){e.playbackRate=k},Ae:function(k){e.currentTime+=k}});zl(a,a.h.streaming.rebufferingGoal);a.s.C(e,"playing",d);a.s.C(e,"pause",d);a.s.C(e,"ended",d);a.s.C(e,"ratechange",function(){return ul(a)});"none"!=
|
|
404
|
+
e.preload&&a.s.oa(e,"loadedmetadata",function(){a.o.m=Date.now()/1E3-c.de});e.audioTracks&&(a.s.C(e.audioTracks,"addtrack",function(){return Jl(a)}),a.s.C(e.audioTracks,"removetrack",function(){return Jl(a)}),a.s.C(e.audioTracks,"change",function(){return Jl(a)}));e.textTracks&&(a.s.C(e.textTracks,"addtrack",function(k){if(k.track)switch(k=k.track,k.kind){case "metadata":Ll(a,k);break;case "chapters":Cl(a,k);break;default:Jl(a)}}),a.s.C(e.textTracks,"removetrack",function(){return Jl(a)}),a.s.C(e.textTracks,
|
|
405
|
+
"change",function(){return Jl(a)}));var g=jg(b.uri);e.src=pk(a.T,b.uri,gl[g]);(vc()||uc("Web0S"))&&e.load();a.l=Ml;a.dispatchEvent($k("streaming"));var h=new nc;zi(e,HTMLMediaElement.HAVE_METADATA,a.s,function(){h.resolve()});zi(e,HTMLMediaElement.HAVE_CURRENT_DATA,a.s,function(){var k;return K(function(l){if(1==l.g)return Nl(a),k=Ol(a),k.find(function(m){return"disabled"!=m.mode})?l.A(2):u(l,new Promise(function(m){a.s.oa(e.textTracks,"change",m);(new O(m)).S(1)}),2);if(f)return l["return"]();Pl(a);
|
|
406
|
+
z(l)})});e.error?h.reject(hl(a)):"none"==e.preload&&(Va('With <video preload="none">, the browser will not load anything until play() is called. We are unable to measure load latency in a meaningful way, and we cannot provide track info yet. Please do not use preload="none" with Shaka Player.'),h.resolve());a.s.oa(e,"error",function(){h.reject(hl(a))});return new Ie(h,function(){h.reject(new N(2,7,7001));return Promise.resolve()})}
|
|
407
407
|
function Nl(a){var b=a.h.preferredAudioLanguage;if(""!=b){a.Xd(b);var c=a.h.preferredVariantRole;""!=c&&a.Xd(b,c)}}function Pl(a){var b=a.h.preferredTextLanguage,c=a.h.preferForcedSubs;if(""!=b){a.Yd(b,"",c);var d=a.h.preferredTextRole;""!=d&&a.Yd(b,d,c)}}
|
|
408
|
-
function Ll(a,b){if("metadata"==b.kind){b.mode="hidden";a.
|
|
408
|
+
function Ll(a,b){if("metadata"==b.kind){b.mode="hidden";a.s.C(b,"cuechange",function(){if(b.activeCues)for(var d=t(b.activeCues),e=d.next();!e.done;e=d.next())if(e=e.value,ll(a,e.startTime,e.endTime,e.type,e.value),a.D)a.D.onCueMetadataChange(e.value)});var c=(new O(function(){var d=Ql(a);d=t(d);for(var e=d.next();!e.done;e=d.next())e.value.mode="hidden"})).Jb().S(.5);a.Kb.push(function(){c.stop()})}}
|
|
409
409
|
function ll(a,b,c,d,e){b=(new Map).set("startTime",b).set("endTime",c).set("metadataType",d).set("payload",e);a.dispatchEvent($k("metadata",b))}function Cl(a,b){if(b&&"chapters"==b.kind){b.mode="hidden";var c=(new O(function(){b.mode="hidden"})).Jb().S(.5);a.Kb.push(function(){c.stop()})}}function pl(a){function b(c){return c.video&&c.audio||c.video&&c.video.codecs.includes(",")}a.variants.some(b)&&(a.variants=a.variants.filter(b))}function ql(a,b){return new tf(b,a.h.drm.updateExpirationTime)}
|
|
410
410
|
function Ok(a){return new We(function(b,c){a.u&&a.u.segmentDownloaded(b,c)},function(b,c,d){b=(new Map).set("headers",b).set("request",c).set("requestType",d);a.dispatchEvent($k("downloadheadersreceived",b))},function(b,c,d,e){b=(new Map).set("request",b).set("error",c).set("httpResponseCode",d).set("aborted",e);a.dispatchEvent($k("downloadfailed",b))})}
|
|
411
411
|
function xl(a,b){return new Ji(a.g,a.i,a.h.streaming,b,function(){a.ub&&Wi(a.ub,!0);a.j&&a.j.rc();a.M&&Rl(a)},function(c){return a.dispatchEvent(c)})}
|
|
@@ -424,26 +424,26 @@ r.Za=function(){if(this.i){for(var a=this.j?this.j.l:null,b=[],c=0,d=t(this.i.va
|
|
|
424
424
|
r.Bb=function(){if(this.i){for(var a=this.j?this.j.o:null,b=[],c=t(this.i.textStreams),d=c.next();!d.done;d=c.next()){d=d.value;var e=ce(d);e.active=d==a;b.push(e)}return b}return this.g&&this.g.src&&this.g.textTracks?Ol(this).map(function(f){return ge(f)}):[]};r.mf=function(){return this.i?this.i.imageStreams.map(function(a){return de(a)}):[]};
|
|
425
425
|
r.Bf=function(a,b){var c=this,d,e,f,g,h,k,l,m,p,n,q,w,y,x,v,D,C,A;return K(function(G){if(1==G.g)return c.i?(d=c.i.imageStreams.find(function(E){return E.id==a}))?d.segmentIndex?G.A(3):u(G,d.createSegmentIndex(),3):G["return"](null):G.A(2);if(2!=G.g){e=d.segmentIndex.find(b);if(null==e)return G["return"](null);f=d.segmentIndex.get(e);g=f.tilesLayout||d.tilesLayout;h=/(\d+)x(\d+)/.exec(g);if(!h)return G["return"](null);k=d.width||0;l=d.height||0;m=parseInt(h[1],10);p=parseInt(h[2],10);n=k/m;q=l/p;
|
|
426
426
|
w=m*p;y=f.j-f.startTime;x=f.l||y/w;v=f.startTime;C=D=0;1<w&&(A=Math.floor((b-f.startTime)/x),v=f.startTime+A*x,D=A%m*n,C=Math.floor(A/m)*q);return G["return"]({imageHeight:l,imageWidth:k,height:q,positionX:D,positionY:C,startTime:v,duration:x,uris:f.ya(),width:n})}return G["return"](null)})};
|
|
427
|
-
r.Ie=function(a){if(this.i&&this.j){var b=this.i.textStreams.find(function(d){return d.id==a.id});b&&b!=this.j.o&&(Kk(this.
|
|
427
|
+
r.Ie=function(a){if(this.i&&this.j){var b=this.i.textStreams.find(function(d){return d.id==a.id});b&&b!=this.j.o&&(Kk(this.o.h,b,!1),tj(this.j,b),Vl(this),this.Ma=b.language)}else if(this.g&&this.g.src&&this.g.textTracks){b=Ol(this);b=t(b);for(var c=b.next();!c.done;c=b.next())c=c.value,ee(c)==a.id?c.mode=this.ha?"showing":"hidden":c.mode="disabled";Vl(this)}};
|
|
428
428
|
r.Je=function(a,b,c){b=void 0===b?!1:b;c=void 0===c?0:c;if(this.i&&this.j){this.h.abr.enabled&&Va("Changing tracks while abr manager is enabled will likely result in the selected track being overriden. Consider disabling abr before calling selectVariantTrack().");var d=this.i.variants.find(function(e){return e.id==a.id});d&&ke(d)&&(wl(this,d,!1,b,c),this.La=new we(d),Kl(this))}else if(this.g&&this.g.audioTracks)for(b=Array.from(this.g.audioTracks),b=t(b),c=b.next();!c.done;c=b.next())if(c=c.value,
|
|
429
429
|
ee(c)==a.id){Wl(this,c);break}};r.gf=function(){return Xl(this.Za())};r.Af=function(){return Xl(this.Bb())};r.ff=function(){return Array.from(Yl(this.Za()))};r.zf=function(){return Array.from(Yl(this.Bb()))};
|
|
430
430
|
r.Xd=function(a,b){if(this.i&&this.B){this.La=new xe(a,b||"",0,"");var c=function(k,l){return k.video||l.video?k.video&&l.video?Math.abs((k.video.height||0)-(l.video.height||0))+Math.abs((k.video.width||0)-(l.video.width||0)):Infinity:0},d=this.j.l,e=this.La.create(this.i.variants),f=null;e=t(e.values());for(var g=e.next();!g.done;g=e.next())if(g=g.value,!f||c(f,d)>c(g,d))f=g;f?(c=be(f),this.Je(c,!0)):Ul(this)}else if(this.g&&this.g.audioTracks){e=Array.from(this.g.audioTracks);c=Q(a);f=d=null;e=
|
|
431
431
|
t(e);for(g=e.next();!g.done;g=e.next()){g=g.value;var h=je(g);Q(h.language)==c&&(d=g,b?h.roles.includes(b)&&(f=g):0==h.roles.length&&(f=g))}f?Wl(this,f):d&&Wl(this,d)}};
|
|
432
|
-
r.Yd=function(a,b,c){c=void 0===c?!1:c;if(this.i&&this.B){if(this.Ma=a,this.Xb=b||"",this.Vb=c,(a=me(this.i.textStreams,this.Ma,this.Xb,this.Vb)[0]||null)&&a!=this.j.o&&(Kk(this.
|
|
432
|
+
r.Yd=function(a,b,c){c=void 0===c?!1:c;if(this.i&&this.B){if(this.Ma=a,this.Xb=b||"",this.Vb=c,(a=me(this.i.textStreams,this.Ma,this.Xb,this.Vb)[0]||null)&&a!=this.j.o&&(Kk(this.o.h,a,!1),this.h.streaming.alwaysStreamText||this.yd()))tj(this.j,a),Vl(this)}else{var d=Q(a);(a=this.Bb().find(function(e){return Q(e.language)==d&&(!b||e.roles.includes(b))&&e.forced==c}))&&this.Ie(a)}};
|
|
433
433
|
r.ag=function(a){if(this.i&&this.B){for(var b=null,c=t(this.i.variants),d=c.next();!d.done;d=c.next())if(d=d.value,d.audio.label==a){b=d;break}null!=b&&(this.La=new xe(b.language,"",0,a),Ul(this))}};r.yd=function(){var a=this.ha;return this.L?this.L.m.isTextVisible():this.g&&this.g.src&&this.g.textTracks?Ol(this).some(function(b){return"showing"==b.mode}):a};r.ue=function(){return this.g&&this.g.src&&this.g.textTracks?Zl(this).map(function(a){return ge(a)}):[]};
|
|
434
434
|
r.jf=function(a){var b=Q(a),c=Zl(this).filter(function(g){return Q(g.language)==b});if(!c||!c.length)return[];a=[];c=t(c);for(var d=c.next();!d.done;d=c.next())if((d=d.value)&&d.cues){d=t(d.cues);for(var e=d.next();!e.done;e=d.next()){e=e.value;var f=e.id;f&&""!=f||(f=e.startTime+"-"+e.endTime+"-"+e.text);a.push({id:f,title:e.text,startTime:e.startTime,endTime:e.endTime})}}return a};
|
|
435
435
|
function Ol(a){return Array.from(a.g.textTracks).filter(function(b){return"metadata"!=b.kind&&"chapters"!=b.kind&&"Shaka Player TextTrack"!=b.label})}function Ql(a){return Array.from(a.g.textTracks).filter(function(b){return"metadata"==b.kind})}function Zl(a){return Array.from(a.g.textTracks).filter(function(b){return"chapters"==b.kind})}
|
|
436
436
|
r.gg=function(a){a=!!a;if(this.ha!=a){this.ha=a;if(this.l==Bl)this.L.m.setTextVisibility(a),this.h.streaming.alwaysStreamText||(a?this.j.o||(a=me(this.i.textStreams,this.Ma,this.Xb,this.Vb),0<a.length&&(tj(this.j,a[0]),Vl(this))):pj(this.j));else if(this.g&&this.g.src&&this.g.textTracks){var b=Ol(this);b=t(b);for(var c=b.next();!c.done;c=b.next())c=c.value,"disabled"!=c.mode&&(c.mode=a?"showing":"hidden")}Gl(this)}};
|
|
437
437
|
r.xf=function(){if(!this.V())return null;var a=this.ua.l,b=0;if(this.B)b=this.B.Cc();else if(a){if(null==a.startTime)return new Date;b=a.startTime}return this.i?new Date(1E3*(this.i.presentationTimeline.l+b)):this.g&&this.g.getStartDate?(a=this.g.getStartDate(),isNaN(a.getTime())?null:new Date(a.getTime()+1E3*b)):null};
|
|
438
438
|
r.ve=function(){if(!this.V())return null;if(this.i)return new Date(1E3*this.i.presentationTimeline.l);if(this.g&&this.g.getStartDate){var a=this.g.getStartDate();return isNaN(a.getTime())?null:a}return null};r.Oa=function(){if(this.l==Bl)return this.L.Oa();var a={total:[],audio:[],video:[],text:[]};this.l==Ml&&(a.total=Uh(this.g.buffered));return a};
|
|
439
|
-
r.getStats=function(){if(this.l!=Bl&&this.l!=Ml)return{width:NaN,height:NaN,streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,corruptedFrames:NaN,stallsDetected:NaN,gapsJumped:NaN,estimatedBandwidth:NaN,completionPercent:NaN,loadLatency:NaN,manifestTimeSeconds:NaN,drmTimeSeconds:NaN,playTime:NaN,pauseTime:NaN,bufferingTime:NaN,licenseTime:NaN,liveLatency:NaN,maxSegmentDuration:NaN,switchHistory:[],stateHistory:[]};tl(this);var a=this.g,b=a.currentTime/a.duration;if(!isNaN(b)){var c=this.
|
|
440
|
-
Math.round(100*b);c.i=isNaN(c.i)?b:Math.max(c.i,b)}this.B&&(this.
|
|
441
|
-
1E3*this.qc().end,this.
|
|
442
|
-
return{width:a,height:c,streamBandwidth:b,decodedFrames:
|
|
439
|
+
r.getStats=function(){if(this.l!=Bl&&this.l!=Ml)return{width:NaN,height:NaN,streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,corruptedFrames:NaN,stallsDetected:NaN,gapsJumped:NaN,estimatedBandwidth:NaN,completionPercent:NaN,loadLatency:NaN,manifestTimeSeconds:NaN,drmTimeSeconds:NaN,playTime:NaN,pauseTime:NaN,bufferingTime:NaN,licenseTime:NaN,liveLatency:NaN,maxSegmentDuration:NaN,switchHistory:[],stateHistory:[]};tl(this);var a=this.g,b=a.currentTime/a.duration;if(!isNaN(b)){var c=this.o;b=
|
|
440
|
+
Math.round(100*b);c.i=isNaN(c.i)?b:Math.max(c.i,b)}this.B&&(this.o.O=this.B.ie(),this.o.T=this.B.je());if(a.getVideoPlaybackQuality){c=a.getVideoPlaybackQuality();b=this.o;var d=Number(c.totalVideoFrames);b.M=Number(c.droppedVideoFrames);b.L=d;this.o.I=Number(c.corruptedVideoFrames)}this.m?(c=this.m,c=c.I?c.I:NaN):c=NaN;this.o.s=c;if(this.l==Bl){if(c=this.j.l)this.o.B=(this.G?this.G.i:1)*c.bandwidth;c&&c.video&&(b=this.o,d=c.video.height||NaN,b.o=c.video.width||NaN,b.l=d);this.V()&&(c=this.ve().valueOf()+
|
|
441
|
+
1E3*this.qc().end,this.o.D=(Date.now()-c)/1E3);this.i&&this.i.presentationTimeline&&(this.o.G=this.i.presentationTimeline.g);c=this.u.getBandwidthEstimate();this.o.u=c}this.l==Ml&&(c=this.o,b=a.videoHeight||NaN,c.o=a.videoWidth||NaN,c.l=b);var e=this.o;a=e.o;c=e.l;b=e.B;d=e.L;var f=e.M,g=e.I,h=e.T,k=e.O,l=e.u,m=e.i,p=e.m,n=e.F,q=e.j,w=Hk(e.g,"playing"),y=Hk(e.g,"paused"),x=Hk(e.g,"buffering"),v=e.s,D=e.D,C=e.G,A=Ik(e.g),G=[];e=t(e.h.g);for(var E=e.next();!E.done;E=e.next())E=E.value,G.push({timestamp:E.timestamp,
|
|
442
|
+
id:E.id,type:E.type,fromAdaptation:E.fromAdaptation,bandwidth:E.bandwidth});return{width:a,height:c,streamBandwidth:b,decodedFrames:d,droppedFrames:f,corruptedFrames:g,stallsDetected:h,gapsJumped:k,estimatedBandwidth:l,completionPercent:m,loadLatency:p,manifestTimeSeconds:n,drmTimeSeconds:q,playTime:w,pauseTime:y,bufferingTime:x,licenseTime:v,liveLatency:D,maxSegmentDuration:C,stateHistory:A,switchHistory:G}};
|
|
443
443
|
r.Ve=function(a,b,c,d,e,f,g){g=void 0===g?!1:g;var h=this,k,l,m,p,n,q,w,y,x,v,D;return K(function(C){switch(C.g){case 1:if(h.l!=Bl&&h.l!=Ml)throw new N(1,7,7004);if(d){C.A(2);break}return u(C,$l(h,a),3);case 3:d=C.h;case 2:k=[];if(h.D)try{k=h.D.getServerSideCuePoints()}catch(A){}if(h.l!=Ml){C.A(4);break}g&&(c="forced");return u(C,am(h,a,b,c,d,f||"",k),5);case 5:l=h.Bb();if(m=l.find(function(A){return A.language==b&&A.label==(f||"")&&A.kind==c}))return Jl(h),C["return"](m);throw new N(1,2,2012);case 4:p=
|
|
444
444
|
mc;n=h.i.presentationTimeline.getDuration();if(Infinity==n)throw new N(1,4,4033);if(!k.length){C.A(6);break}return u(C,bm(h,a,h.F,h.h.streaming.retryParameters),7);case 7:q=C.h,w=cm(h,q,d,k),y=new Blob([w],{type:"text/vtt"}),a=Zh(y),d="text/vtt";case 6:x={id:h.Ee++,originalId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:Ri(0,n,[a]),mimeType:d||"",codecs:e||"",kind:c,encrypted:!1,drmInfos:[],keyIds:new Set,language:b,label:f||null,type:p.X,primary:!1,trickModeVideo:null,
|
|
445
445
|
emsgSchemeIdUris:null,roles:[],forced:!!g,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null};v=Yc(x.mimeType,x.codecs);D=dd(v);if(!D)throw new N(2,2,2014,d);h.i.textStreams.push(x);Jl(h);return C["return"](ce(x))}})};
|
|
446
|
-
r.Ue=function(a,b,c){var d=this,e,f,g,h;return K(function(k){switch(k.g){case 1:if(d.l!=Bl&&d.l!=Ml)throw new N(1,7,7004);if(c){k.A(2);break}return u(k,$l(d,a),3);case 3:c=k.h;case 2:e=[];if(d.D)try{e=d.D.getServerSideCuePoints()}catch(l){}return u(k,am(d,a,b,"chapters",c,"",e),4);case 4:f=k.h;g=d.ue();h=g.find(function(l){return l.language==b});if(!h){k.A(5);break}return u(k,new Promise(function(l,m){d.
|
|
446
|
+
r.Ue=function(a,b,c){var d=this,e,f,g,h;return K(function(k){switch(k.g){case 1:if(d.l!=Bl&&d.l!=Ml)throw new N(1,7,7004);if(c){k.A(2);break}return u(k,$l(d,a),3);case 3:c=k.h;case 2:e=[];if(d.D)try{e=d.D.getServerSideCuePoints()}catch(l){}return u(k,am(d,a,b,"chapters",c,"",e),4);case 4:f=k.h;g=d.ue();h=g.find(function(l){return l.language==b});if(!h){k.A(5);break}return u(k,new Promise(function(l,m){d.s.oa(f,"load",l);d.s.oa(f,"error",function(){m(new N(1,2,2015))})}),6);case 6:return k["return"](h);
|
|
447
447
|
case 5:throw new N(1,2,2012);}})};function $l(a,b){var c,d;return K(function(e){switch(e.g){case 1:c=jg(b);if(d=dm[c])return e["return"](d);B(e,2);return u(e,lg(b,a.F,a.h.streaming.retryParameters),4);case 4:d=e.h;va(e,3);break;case 2:F(e);case 3:if(d)return e["return"](d);throw new N(1,2,2011,c);}})}
|
|
448
448
|
function am(a,b,c,d,e,f,g){var h,k,l,m;return K(function(p){if(1==p.g)return"text/vtt"!=e||g.length?u(p,bm(a,b,a.F,a.h.streaming.retryParameters),3):p.A(2);2!=p.g&&(h=p.h,k=cm(a,h,e,g),l=new Blob([k],{type:"text/vtt"}),b=Zh(l),e="text/vtt");m=document.createElement("track");var n=a.T,q=b;try{if(n.g.enabled){var w=qk(n);w.ot=wk;w.su=!0;var y=sk(w);var x=tk(q,y)}else x=q}catch(v){Wa("CMCD_TEXT_TRACK_ERROR","Could not generate text track CMCD data.",v),x=q}m.src=x;m.label=f;m.kind=d;m.srclang=c;a.g.getAttribute("crossorigin")||
|
|
449
449
|
a.g.setAttribute("crossorigin","anonymous");a.g.appendChild(m);return p["return"](m)})}function bm(a,b,c,d){var e,f,g;return K(function(h){if(1==h.g){e=ff;f=$e([b],d);f.method="GET";var k=a.T;try{k.g.enabled&&ok(k,f,{ot:wk,su:!0})}catch(l){Wa("CMCD_TEXT_ERROR","Could not generate text CMCD data.",l)}return u(h,c.request(e,f).promise,2)}g=h.h;return h["return"](g.data)})}
|
|
@@ -455,12 +455,12 @@ segmentIndex:k,mimeType:h,codecs:"",kind:"caption",encrypted:!1,drmInfos:[],keyI
|
|
|
455
455
|
function em(a,b){var c;return K(function(d){if(1==d.g)return c=a.j?a.j.l:null,u(d,Od(c,b),2);Il(b);z(d)})}
|
|
456
456
|
function Tl(a,b){if(a.l!=bl){Nd(b.variants,a.h.restrictions,a.Yb)&&a.j&&Jl(a);var c=a.m?a.m.g:null;if(c&&a.m.s)for(var d=t(b.variants),e=d.next();!e.done;e=d.next()){e=e.value;e=t((e.video?e.video.drmInfos:[]).concat(e.audio?e.audio.drmInfos:[]));for(var f=e.next();!f.done;f=e.next())if(f=f.value,f.keySystem==c.keySystem){f=t(f.initData||[]);for(var g=f.next();!g.done;g=f.next())g=g.value,Lf(a.m,g.initDataType,g.initData)}}fm(a,b)}}
|
|
457
457
|
function Dl(a,b){var c,d,e,f,g;return K(function(h){if(1==h.g)return c=a.audio,d=a.video,e=function(k,l){var m,p,n;return K(function(q){if(1==q.g)return k?u(q,k.createSegmentIndex(),2):q["return"](null);p=(m=k.segmentIndex.zb(l))?m.next().value:null;if(!p)return q["return"](null);n=p.startTime;return q["return"](n)})},u(h,e(c,b),2);if(3!=h.g)return f=h.h,u(h,e(d,b),3);g=h.h;return null!=g&&null!=f?h["return"](Math.max(g,f)):null!=g?h["return"](g):null!=f?h["return"](f):h["return"](b)})}
|
|
458
|
-
function jl(a){var b=a.xd();if(a.
|
|
458
|
+
function jl(a){var b=a.xd();if(a.o&&a.M&&a.B){var c=a.G;c.j=b;Ui(c);a.T&&(c=a.T,b||c.i||(c.i=!0),c.i&&b&&(c.l=!0),c.m=b);tl(a)}b=(new Map).set("buffering",b);a.dispatchEvent($k("buffering",b))}function ul(a){var b=a.g.playbackRate;0!=b&&(a.G&&a.G.set(b),b=$k("ratechange"),a.dispatchEvent(b))}function tl(a){if(a.o&&a.M){var b=a.o.g;a.M.g==De?Gk(b,"buffering"):a.g.paused?Gk(b,"paused"):a.g.ended?Gk(b,"ended"):Gk(b,"playing")}}
|
|
459
459
|
function Kl(a){try{fm(a,a.i)}catch(c){return il(a,c),!1}var b=a.i.variants.filter(function(c){return ke(c)});b=a.La.create(b);a.u.setVariants(Array.from(b.values()));return!0}function al(a){return Kl(a)?a.u.chooseVariant():null}function Ul(a){var b=al(a);b&&wl(a,b,!0,!0,0)}
|
|
460
|
-
function wl(a,b,c,d,e){var f=a.j.l;if(b==f)d&&sj(a.j,b,d,e,!0);else{var g=a.
|
|
460
|
+
function wl(a,b,c,d,e){var f=a.j.l;if(b==f)d&&sj(a.j,b,d,e,!0);else{var g=a.o.h;g.h!=b&&(g.h=b,g.g.push({timestamp:Date.now()/1E3,id:b.id,type:"variant",fromAdaptation:c,bandwidth:b.bandwidth}));sj(a.j,b,d,e);d=null;f&&(d=be(f));b=be(b);c?El(a,d,b):gm(a,d,b)}}function Wl(a,b){var c=Array.from(a.g.audioTracks).find(function(e){return e.enabled});b.enabled=!0;b.id!==c.id&&(c.enabled=!1);c=je(c);var d=je(b);gm(a,c,d)}
|
|
461
461
|
function Fl(a,b,c){a=Q(a.h.preferredTextLanguage);b=Q(b.language);c=Q(c.language);return pd(c,a)&&!pd(b,c)}function El(a,b,c){b=(new Map).set("oldTrack",b).set("newTrack",c);b=$k("adaptation",b);hm(a,b)}function Jl(a){var b=$k("trackschanged");hm(a,b)}function gm(a,b,c){b=(new Map).set("oldTrack",b).set("newTrack",c);b=$k("variantchanged",b);hm(a,b)}function Vl(a){var b=$k("textchanged");hm(a,b)}function Gl(a){var b=$k("texttrackvisibility");hm(a,b)}
|
|
462
462
|
function Hl(a){var b=(new Map).set("newStatus",a.h.abr.enabled);hm(a,$k("abrstatuschanged",b))}
|
|
463
|
-
function im(a,b){if(1002!=b.code&&1011!=b.code||1!=b.category)return!1;var c=a.h.streaming.maxDisabledTime;if(0==c)if(1011==b.code)c=1;else return!1;for(var d=a.Za().find(function(h){return h.active}),e=a.i,f=t(e.variants),g=f.next();!g.done;g=f.next())g=g.value,g.id===d.id&&(g.disabledUntilTime=Date.now()/1E3+c);Nd(e.variants,a.h.restrictions,a.Yb);d=al(a);if(!d)return!1;e=a.Oa().video.reduce(function(h,k){return h+k.end-k.start},0);wl(a,d,!1,!0,e);a.De.S(c);return!0}
|
|
463
|
+
function im(a,b){if(1002!=b.code&&1011!=b.code||1!=b.category||!navigator.onLine)return!1;var c=a.h.streaming.maxDisabledTime;if(0==c)if(1011==b.code)c=1;else return!1;for(var d=a.Za().find(function(h){return h.active}),e=a.i,f=t(e.variants),g=f.next();!g.done;g=f.next())g=g.value,g.id===d.id&&(g.disabledUntilTime=Date.now()/1E3+c);Nd(e.variants,a.h.restrictions,a.Yb);d=al(a);if(!d)return!1;e=a.Oa().video.reduce(function(h,k){return h+k.end-k.start},0);wl(a,d,!1,!0,e);a.De.S(c);return!0}
|
|
464
464
|
function il(a,b){if(a.l!=bl)if(im(a,b))b.handled=!0;else{var c=$k("error",(new Map).set("detail",b));a.dispatchEvent(c);c.defaultPrevented&&(b.handled=!0)}}function ml(a,b,c){c=(new Map).set("detail",{schemeIdUri:c.schemeIdUri,value:c.value,startTime:c.startTime,endTime:c.endTime,id:c.id,eventElement:c.eventElement});a.dispatchEvent($k(b,c))}
|
|
465
465
|
function hl(a){if(!a.g.error)return null;var b=a.g.error.code;if(1==b)return null;var c=a.g.error.msExtendedCode;c&&(0>c&&(c+=Math.pow(2,32)),c=c.toString(16));return new N(2,3,3016,b,c,a.g.error.message)}
|
|
466
466
|
function rl(a,b){if(a.j){var c=Object.keys(b),d=1==c.length&&"00"==c[0],e=!1;if(c.length){c=t(a.i.variants);for(var f=c.next();!f.done;f=c.next()){f=f.value;var g=[];f.audio&&g.push(f.audio);f.video&&g.push(f.video);g=t(g);for(var h=g.next();!h.done;h=g.next()){var k=h.value;h=f.allowedByKeySystem;if(k.keyIds.size){f.allowedByKeySystem=!0;k=t(k.keyIds);for(var l=k.next();!l.done;l=k.next())l=l.value,l=b[d?"00":l],f.allowedByKeySystem=f.allowedByKeySystem&&!!l&&!jm.includes(l)}h!=f.allowedByKeySystem&&
|
|
@@ -478,14 +478,14 @@ U.probeSupport=function(a){a=void 0===a?!0:a;var b,c,d,e,f,g;return K(function(h
|
|
|
478
478
|
qc()?!!kg[n]:rc(l[n]);c=k;n='video/mp4; codecs="avc1.42E01E",video/mp4; codecs="avc3.42E01E",video/mp4; codecs="hev1.1.6.L93.90",video/mp4; codecs="hvc1.1.6.L93.90",video/mp4; codecs="hev1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="hvc1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="vp9",video/mp4; codecs="vp09.00.10.08",video/mp4; codecs="av01.0.01M.08",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",audio/mp4; codecs="opus",audio/mp4; codecs="flac",video/webm; codecs="vp8",video/webm; codecs="vp9",video/webm; codecs="vp09.00.10.08",audio/webm; codecs="vorbis",audio/webm; codecs="opus",video/mp2t; codecs="avc1.42E01E",video/mp2t; codecs="avc3.42E01E",video/mp2t; codecs="hvc1.1.6.L93.90",video/mp2t; codecs="mp4a.40.2",video/mp2t; codecs="ac-3",video/mp2t; codecs="ec-3",text/vtt,application/mp4; codecs="wvtt",application/ttml+xml,application/mp4; codecs="stpp"'.split(",").concat(ia(si));
|
|
479
479
|
k={};n=t(n);for(l=n.next();!l.done;l=n.next())l=l.value,k[l]=qc()?dd(l)?!0:MediaSource.isTypeSupported(l)||Tc(l):rc(l),m=l.split(";")[0],k[m]=k[m]||k[l];d=k;e={manifest:c,media:d,drm:b};f=km;for(g in f)e[g]=f[g]();return h["return"](e)})};
|
|
480
480
|
U.isBrowserSupported=function(){window.Promise||Va("A Promise implementation or polyfill is required");if(!(window.Promise&&window.Uint8Array&&Array.prototype.forEach)||uc("Trident/"))return!1;var a=Ac();return a&&13>a||!(window.MediaKeys&&window.navigator&&window.navigator.requestMediaKeySystemAccess&&window.MediaKeySystemAccess&&window.MediaKeySystemAccess.prototype.getConfiguration)?!1:qc()?!0:rc("application/x-mpegurl")};U.setAdManagerFactory=function(a){Pk=a};
|
|
481
|
-
U.registerSupportPlugin=function(a,b){km[a]=b};U.prototype.destroy=U.prototype.destroy;var bl=0,Mk=1,Bl=2,Ml=3;U.LoadMode={DESTROYED:bl,NOT_LOADED:Mk,MEDIA_SOURCE:Bl,SRC_EQUALS:Ml};U.version="v4.1.
|
|
481
|
+
U.registerSupportPlugin=function(a,b){km[a]=b};U.prototype.destroy=U.prototype.destroy;var bl=0,Mk=1,Bl=2,Ml=3;U.LoadMode={DESTROYED:bl,NOT_LOADED:Mk,MEDIA_SOURCE:Bl,SRC_EQUALS:Ml};U.version="v4.1.4";
|
|
482
482
|
var jm=["output-restricted","internal-error"],km={},Pk=null,gl={mp4:"video/mp4",m4v:"video/mp4",m4a:"audio/mp4",webm:"video/webm",weba:"audio/webm",mkv:"video/webm",ts:"video/mp2t",ogv:"video/ogg",ogg:"audio/ogg",mpg:"video/mpeg",mpeg:"video/mpeg",m3u8:"application/x-mpegurl",mpd:"application/dash+xml",mp3:"audio/mpeg",aac:"audio/aac",flac:"audio/flac",wav:"audio/wav"},dm={sbv:"text/x-subviewer",srt:"text/srt",vtt:"text/vtt",webvtt:"text/vtt",ttml:"application/ttml+xml",lrc:"application/x-subtitle-lrc",
|
|
483
483
|
ssa:"text/x-ssa",ass:"text/x-ssa"};function lm(){this.h=[];this.j=this.i=this.g=0};function V(a,b,c){var d=this;this.h=a;this.g=b;this.m=c;this.i=!1;this.l=this.g.getVolume();this.j=new jf;this.j.C(this.g,google.ima.AdEvent.Type.PAUSED,function(){d.i=!0});this.j.C(this.g,google.ima.AdEvent.Type.RESUMED,function(){d.i=!1})}r=V.prototype;r.getDuration=function(){return this.h.getDuration()};r.getMinSuggestedDuration=function(){return this.h.getMinSuggestedDuration()};r.getRemainingTime=function(){return this.g.getRemainingTime()};r.isPaused=function(){return this.i};
|
|
484
484
|
r.isSkippable=function(){return 0<=this.h.getSkipTimeOffset()};r.getTimeUntilSkippable=function(){var a=this.h.getSkipTimeOffset();a=this.getRemainingTime()-a;return Math.max(a,0)};r.canSkipNow=function(){return this.g.getAdSkippableState()};r.skip=function(){return this.g.skip()};r.pause=function(){return this.g.pause()};r.play=function(){return this.g.resume()};r.getVolume=function(){return this.g.getVolume()};r.setVolume=function(a){return this.g.setVolume(a)};r.isMuted=function(){return 0==this.g.getVolume()};
|
|
485
485
|
r.isLinear=function(){return this.h.isLinear()};r.resize=function(a,b){var c=!1,d=this.m;document.fullscreenEnabled?c=!!document.fullscreenElement:d.webkitSupportsFullscreen&&(c=d.webkitDisplayingFullscreen);this.g.resize(a,b,c?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)};r.setMuted=function(a){a?(this.l=this.getVolume(),this.setVolume(0)):this.setVolume(this.l)};r.getSequenceLength=function(){var a=this.h.getAdPodInfo();return null==a?1:a.getTotalAds()};
|
|
486
486
|
r.getPositionInSequence=function(){var a=this.h.getAdPodInfo();return null==a?1:a.getAdPosition()};r.release=function(){this.g=this.h=null};M("shaka.ads.ClientSideAd",V);V.prototype.release=V.prototype.release;V.prototype.getPositionInSequence=V.prototype.getPositionInSequence;V.prototype.getSequenceLength=V.prototype.getSequenceLength;V.prototype.setMuted=V.prototype.setMuted;V.prototype.resize=V.prototype.resize;V.prototype.isLinear=V.prototype.isLinear;V.prototype.isMuted=V.prototype.isMuted;
|
|
487
487
|
V.prototype.setVolume=V.prototype.setVolume;V.prototype.getVolume=V.prototype.getVolume;V.prototype.play=V.prototype.play;V.prototype.pause=V.prototype.pause;V.prototype.skip=V.prototype.skip;V.prototype.canSkipNow=V.prototype.canSkipNow;V.prototype.getTimeUntilSkippable=V.prototype.getTimeUntilSkippable;V.prototype.isSkippable=V.prototype.isSkippable;V.prototype.isPaused=V.prototype.isPaused;V.prototype.getRemainingTime=V.prototype.getRemainingTime;V.prototype.getMinSuggestedDuration=V.prototype.getMinSuggestedDuration;
|
|
488
|
-
V.prototype.getDuration=V.prototype.getDuration;function mm(a,b,c,d){var e=this;this.o=a;this.i=b;this.s=null;this.u=NaN;this.l=d;this.j=null;this.h=new jf;google.ima.settings.setLocale(c);a=new google.ima.AdDisplayContainer(this.o,this.i);a.initialize();this.m=new google.ima.AdsLoader(a);this.m.getSettings().setPlayerType("shaka-player");this.m.getSettings().setPlayerVersion("v4.1.
|
|
488
|
+
V.prototype.getDuration=V.prototype.getDuration;function mm(a,b,c,d){var e=this;this.o=a;this.i=b;this.s=null;this.u=NaN;this.l=d;this.j=null;this.h=new jf;google.ima.settings.setLocale(c);a=new google.ima.AdDisplayContainer(this.o,this.i);a.initialize();this.m=new google.ima.AdsLoader(a);this.m.getSettings().setPlayerType("shaka-player");this.m.getSettings().setPlayerVersion("v4.1.4");this.g=null;this.h.oa(this.m,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,function(f){nm(e,f)});this.h.C(this.m,google.ima.AdErrorEvent.Type.AD_ERROR,
|
|
489
489
|
function(f){om(e,f)});this.i.onended=function(){e.m.contentComplete()}}mm.prototype.stop=function(){this.g&&this.g.stop();this.o&&Uj(this.o)};mm.prototype.release=function(){this.stop();this.s&&this.s.disconnect();this.h&&this.h.release();this.g&&this.g.destroy();this.m.destroy()};function om(a,b){b.getError();pm(a,null);a.l(new R("ad-cue-points-changed",(new Map).set("cuepoints",[])))}
|
|
490
490
|
function nm(a,b){a.l(new R("ads-loaded",(new Map).set("loadTime",Date.now()/1E3-a.u)));a.g=b.getAdsManager(a.i);a.l(new R("ima-ad-manager-loaded",(new Map).set("imaAdManager",a.g)));var c=a.g.getCuePoints();if(c.length){var d=[];c=t(c);for(var e=c.next();!e.done;e=c.next())d.push({start:e.value,end:null});a.l(new R("ad-cue-points-changed",(new Map).set("cuepoints",d)))}qm(a);try{a.g.init(a.i.offsetWidth,a.i.offsetHeight,rm(a)?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL),a.h.C(a.i,"loadeddata",
|
|
491
491
|
function(){a.g.resize(a.i.offsetWidth,a.i.offsetHeight,rm(a)?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),"ResizeObserver"in window&&(a.s=new ResizeObserver(function(){a.g.resize(a.i.offsetWidth,a.i.offsetHeight,rm(a)?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a.s.observe(a.i)),a.g.start()}catch(f){pm(a,null)}}function rm(a){if(document.fullscreenEnabled)return!!document.fullscreenElement;a=a.i;return a.webkitSupportsFullscreen?a.webkitDisplayingFullscreen:!1}
|
|
@@ -506,8 +506,8 @@ f;e.i(new R("ad-cue-points-changed",(new Map).set("cuepoints",f)))})}tm.prototyp
|
|
|
506
506
|
function um(a,b){a.i(new R("ads-loaded",(new Map).set("loadTime",Date.now()/1E3-a.G)));var c=b.getStreamData().url;a.j.resolve(c);a.j=null;a.F||a.h.C(a.l,"seeked",function(){var d=a.l.currentTime;if(0!=d){a.g.streamTimeForContentTime(d);var e=a.g.previousCuePointForStreamTime(d);e&&!e.played&&(a.o=d,a.l.currentTime=e.start)}})};function X(){Re.call(this);this.g=this.i=null;this.h=new lm;this.j=navigator.language}pa(X,Re);r=X.prototype;r.setLocale=function(a){this.j=a};r.initClientSide=function(a,b){var c=this;if(!window.google||!google.ima||!google.ima.AdsLoader)throw new N(2,10,1E4);this.i&&this.i.release();this.i=new mm(a,b,this.j,function(d){if(d&&d.type)switch(d.type){case "ads-loaded":c.h.h.push(d.loadTime);break;case "ad-started":c.h.g++;break;case "ad-complete":c.h.i++;break;case "ad-skipped":c.h.j++}c.dispatchEvent(d)})};
|
|
507
507
|
r.release=function(){this.i&&(this.i.release(),this.i=null);this.g&&(this.g.release(),this.g=null);Re.prototype.release.call(this)};r.onAssetUnload=function(){this.i&&this.i.stop();this.g&&this.g.stop();this.dispatchEvent(new R("ad-stopped"));this.h=new lm};r.requestClientSideAds=function(a){if(!this.i)throw new N(1,10,10001);var b=this.i;b.u=Date.now()/1E3;b.m.requestAds(a)};
|
|
508
508
|
r.initServerSide=function(a,b){var c=this;if(!window.google||!google.ima||!google.ima.dai)throw new N(2,10,10002);this.g&&this.g.release();this.g=new tm(a,b,this.j,function(d){if(d&&d.type)switch(d.type){case "ads-loaded":c.h.h.push(d.loadTime);break;case "ad-started":c.h.g++;break;case "ad-complete":c.h.i++;break;case "ad-skipped":c.h.j++}c.dispatchEvent(d)})};
|
|
509
|
-
r.requestServerSideStream=function(a,b){b=void 0===b?"":b;if(!this.g)throw new N(1,10,10003);a.adTagParameters||(a.adTagParameters={});var c=a.adTagParameters;(c.mpt||c.mpv)&&Va('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overriden.');a.adTagParameters.mpt="shaka-player";a.adTagParameters.mpv="v4.1.
|
|
510
|
-
(c.F=!0),c.j=new nc,c.g.requestStream(a),c.B=d||"",c.G=Date.now()/1E3,c=c.j);return c};r.replaceServerSideAdTagParameters=function(a){if(!this.g)throw new N(1,10,10003);(a.mpt||a.mpv)&&Va('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overriden.');a.mpt="Shaka Player";a.mpv="v4.1.
|
|
509
|
+
r.requestServerSideStream=function(a,b){b=void 0===b?"":b;if(!this.g)throw new N(1,10,10003);a.adTagParameters||(a.adTagParameters={});var c=a.adTagParameters;(c.mpt||c.mpv)&&Va('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overriden.');a.adTagParameters.mpt="shaka-player";a.adTagParameters.mpv="v4.1.4";c=this.g;var d=b;c.j?c=Promise.reject(new N(1,10,10004)):(a instanceof google.ima.dai.api.LiveStreamRequest&&
|
|
510
|
+
(c.F=!0),c.j=new nc,c.g.requestStream(a),c.B=d||"",c.G=Date.now()/1E3,c=c.j);return c};r.replaceServerSideAdTagParameters=function(a){if(!this.g)throw new N(1,10,10003);(a.mpt||a.mpv)&&Va('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overriden.');a.mpt="Shaka Player";a.mpv="v4.1.4";this.g.g.replaceAdTagParameters(a)};r.getServerSideCuePoints=function(){if(!this.g)throw new N(1,10,10003);return this.g.D};
|
|
511
511
|
r.getStats=function(){var a=this.h;return{loadTimes:a.h,started:a.g,playedCompletely:a.i,skipped:a.j}};r.onDashTimedMetadata=function(a){if(this.g&&"urn:google:dai:2018"==a.schemeIdUri){var b=a.schemeIdUri,c=a.eventElement?a.eventElement.getAttribute("messageData"):null;this.g.g.processMetadata(b,c,a.startTime)}};r.onHlsTimedMetadata=function(a,b){this.g&&this.g.g.processMetadata("ID3",a.data,b)};r.onCueMetadataChange=function(a){if(this.g)this.g.onCueMetadataChange(a)};M("shaka.ads.AdManager",X);
|
|
512
512
|
X.prototype.onCueMetadataChange=X.prototype.onCueMetadataChange;X.prototype.onHlsTimedMetadata=X.prototype.onHlsTimedMetadata;X.prototype.onDashTimedMetadata=X.prototype.onDashTimedMetadata;X.prototype.getStats=X.prototype.getStats;X.prototype.getServerSideCuePoints=X.prototype.getServerSideCuePoints;X.prototype.replaceServerSideAdTagParameters=X.prototype.replaceServerSideAdTagParameters;X.prototype.requestServerSideStream=X.prototype.requestServerSideStream;X.prototype.initServerSide=X.prototype.initServerSide;
|
|
513
513
|
X.prototype.requestClientSideAds=X.prototype.requestClientSideAds;X.prototype.onAssetUnload=X.prototype.onAssetUnload;X.prototype.release=X.prototype.release;X.prototype.initClientSide=X.prototype.initClientSide;X.prototype.setLocale=X.prototype.setLocale;X.ADS_LOADED="ads-loaded";X.AD_STARTED="ad-started";X.AD_FIRST_QUARTILE="ad-first-quartile";X.AD_MIDPOINT="ad-midpoint";X.AD_THIRD_QUARTILE="ad-third-quartile";X.AD_COMPLETE="ad-complete";X.AD_STOPPED="ad-stopped";X.AD_SKIPPED="ad-skipped";
|