shaka-player 3.2.11 → 3.2.12

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.
@@ -333,10 +333,10 @@ function Lj(a,b,c){var d=1<c.length,e=d?"span":"div";if(b.lineBreak||b.spacer)b.
333
333
  e.style.height=c.height+g;e.style.width=c.width+h;e.style.position="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,{dd:f,
334
334
  ve:e,$b:c})}
335
335
  function Mj(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.backgroundColor=c.backgroundColor;f.border=c.border;f.color=c.color;f.direction=c.direction;f.opacity=c.opacity;f.paddingLeft=Nj(c.linePadding,c,a.m);f.paddingRight=Nj(c.linePadding,c,a.m);if(c.backgroundImage)f.backgroundImage="url('"+c.backgroundImage+"')",f.backgroundRepeat="no-repeat",f.backgroundSize="contain",f.backgroundPosition=
336
- "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=Oj(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="before"==c.displayAlign?"flex-start":"center"==c.displayAlign?"center":"flex-end");
337
- g||(f.margin="0");f.fontFamily=c.fontFamily;f.fontWeight=c.fontWeight.toString();f.fontStyle=c.fontStyle;f.letterSpacing=c.letterSpacing;f.fontSize=Nj(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?f.left=c.line+"%":"end"==c.lineAlign&&(f.right=c.line+"%")):(f.height="100%",c.lineAlign==
338
- 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&&f.writingMode==c.writingMode||(f.webkitWritingMode=c.writingMode);c.size&&(c.writingMode==
339
- nb?f.width=c.size+"%":f.height=c.size+"%")}function Nj(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}}function Oj(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",Ij);
336
+ "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=Oj(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="before"==c.displayAlign?"flex-start":"center"==c.displayAlign?
337
+ "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=Nj(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?f.left=c.line+"%":"end"==c.lineAlign&&(f.right=c.line+"%")):(f.height=
338
+ "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&&f.writingMode==c.writingMode||(f.webkitWritingMode=c.writingMode);c.size&&
339
+ (c.writingMode==nb?f.width=c.size+"%":f.height=c.size+"%")}function Nj(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}}function Oj(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",Ij);
340
340
  Ij.prototype.setTextVisibility=Ij.prototype.setTextVisibility;Ij.prototype.isTextVisible=Ij.prototype.isTextVisible;Ij.prototype.remove=Ij.prototype.remove;Ij.prototype.destroy=Ij.prototype.destroy;Ij.prototype.append=Ij.prototype.append;function Pj(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,n=h.textDecoration.includes("underline");l&&k.push("b");m&&k.push("i");n&&k.push("u");l=k.reduce(function(p,q){return p+"<"+q+">"},
341
341
  "");k=k.reduceRight(function(p,q){return p+"</"+q+">"},"");return h.lineBreak||h.spacer?(h.spacer&&Kb("shaka.text.Cue","Please use lineBreak instead of spacer."),"\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");
342
342
  break;case "right":k.push("align:right");break;case mb:k.push("align:middle");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 Qj(){}
@@ -351,7 +351,7 @@ minBandwidth:0,maxBandwidth:Infinity}},preferredAudioLanguage:"",preferredTextLa
351
351
  e.trackSelectionCallback=function(g){return L(function(h){return h["return"](Wj(g,f.preferredAudioLanguage))})};return f}function Xj(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 Rj(a,b,c||Vj(),d,"")}
352
352
  function Wj(a,b){var c=a.filter(function(h){return"variant"==h.type}),d=[],e=ud(b,c.map(function(h){return h.language}));e&&(d=c.filter(function(h){return od(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/
353
353
  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!=nc&&"image"!=g.type||c.push(g);return c}M("shaka.util.PlayerConfiguration",Uj);Uj.mergeConfigObjects=Xj;function Yj(){this.g=null;this.h=[]}function Zj(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 ak(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}
354
- function bk(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 ck(){this.i=this.h=null;this.g=[]}function dk(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 ek(){this.o=this.s=this.D=this.B=this.m=this.j=this.C=this.l=this.i=this.F=this.G=this.J=this.u=this.M=NaN;this.g=new Yj;this.h=new ck};function V(a,b){Ke.call(this);var c=this;this.l=fk;this.mc=this.g=null;this.ia=!1;this.tc=new bf;this.Lb=new bf;this.o=new bf;this.ed=this.u=this.Kb=this.i=this.uc=this.G=this.j=this.vc=this.J=this.oc=this.F=this.La=this.C=this.M=this.m=this.D=null;this.nd=1E9;this.h=gk(this);this.md={width:Infinity,height:Infinity};this.s=null;this.Ba=new re(this.h.preferredAudioLanguage,this.h.preferredVariantRole,this.h.preferredAudioChannelCount);this.Ca=this.h.preferredTextLanguage;this.Eb=this.h.preferredTextRole;
354
+ function bk(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 ck(){this.i=this.h=null;this.g=[]}function dk(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 ek(){this.u=this.B=this.F=this.C=this.s=this.j=this.D=this.m=this.i=this.G=this.J=this.M=this.l=this.o=NaN;this.g=new Yj;this.h=new ck};function V(a,b){Ke.call(this);var c=this;this.l=fk;this.mc=this.g=null;this.ia=!1;this.tc=new bf;this.Lb=new bf;this.o=new bf;this.ed=this.u=this.Kb=this.i=this.uc=this.G=this.j=this.vc=this.J=this.oc=this.F=this.La=this.C=this.M=this.m=this.D=null;this.nd=1E9;this.h=gk(this);this.md={width:Infinity,height:Infinity};this.s=null;this.Ba=new re(this.h.preferredAudioLanguage,this.h.preferredVariantRole,this.h.preferredAudioChannelCount);this.Ca=this.h.preferredTextLanguage;this.Eb=this.h.preferredTextRole;
355
355
  this.Nb=this.h.preferForcedSubs;this.Mb=[];b&&b(this);this.D=hk(this);this.D.Jd(this.h.streaming.forceHTTPS);this.B=null;ik&&(this.B=Rb(ik));this.tc.v(window,"online",function(){c.Ed()});this.T={name:"detach"};this.V={name:"attach"};this.ea={name:"unload"};this.sd={name:"manifest-parser"};this.ld={name:"manifest"};this.Ka={name:"media-source"};this.gd={name:"drm-engine"};this.aa={name:"load"};this.vd={name:"src-equals-drm-engine"};this.qb={name:"src-equals"};var d=new Map;d.set(this.V,function(e,
356
356
  f){return Ge(jk(c,e,f))});d.set(this.T,function(e){e.H&&(c.Lb.Ra(),e.H=null);c.B&&c.B.release();c.g=null;e=Promise.resolve();return Ge(e)});d.set(this.ea,function(e){return Ge(kk(c,e))});d.set(this.Ka,function(e){e=lk(c,e);return Ge(e)});d.set(this.sd,function(e,f){var g=mk(c,e,f);return Ge(g)});d.set(this.ld,function(e){return nk(c,e)});d.set(this.gd,function(e){e=ok(c,e);return Ge(e)});d.set(this.aa,function(e,f){return Ge(pk(c,e,f))});d.set(this.vd,function(e,f){var g=qk(c,e,f);return Ge(g)});
357
357
  d.set(this.qb,function(e,f){return rk(c,e,f)});this.ja=new wj(this.T,{Ze:function(e,f,g,h){var k=null;e==c.T&&(k=g==c.T?c.T:c.V);e==c.V&&(k=g==c.T||f.H!=h.H?c.T:g==c.V?c.V:g==c.Ka||g==c.aa?c.Ka:g==c.qb?c.vd:null);e==c.Ka&&(k=g==c.aa&&f.H==h.H?c.sd:c.ea);e==c.sd&&(k=sk(c.aa,c.ld,c.ea,g,f,h));e==c.ld&&(k=sk(c.aa,c.gd,c.ea,g,f,h));e==c.gd&&(k=sk(c.aa,c.aa,c.ea,g,f,h));e==c.vd&&(k=g==c.qb&&f.H==h.H?c.qb:c.ea);if(e==c.aa||e==c.qb)k=c.ea;e==c.ea&&(k=h.H&&f.H==h.H?c.V:c.T);return k},Le:function(e,f,g){c.dispatchEvent(tk(uk,
@@ -368,18 +368,18 @@ function lk(a,b){var c,d,e,f;return L(function(g){if(1==g.g)return c=new Eh,d=a.
368
368
  function mk(a,b,c){var d,e,f,g;return L(function(h){if(1==h.g)return b.mimeType=c.mimeType,b.uri=c.uri,d=b.uri,e=a.D,a.Kb=d,f=a,u(h,cg(d,e,a.h.manifest.retryParameters,b.mimeType),2);f.uc=h.h;a.G=Rb(a.uc);g=Le(a.h.manifest);c.H&&"AUDIO"===c.H.nodeName&&(g.disableVideo=!0);a.G.configure(g);z(h)})}
369
369
  function nk(a,b){var c=b.uri,d=a.D;a.vc=new Qi(function(){return a.ac()});a.vc.addEventListener("regionadd",function(g){g=g.region;Jk(a,Kk,g);if(a.B)a.B.onDashTimedMetadata(g)});var e={networkingEngine:d,filter:function(g){return Lk(a,g)},makeTextStreamsForClosedCaptions:function(g){return Mk(a,g)},onTimelineRegionAdded:function(g){var h=a.vc;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=
370
370
  l;break a}k=null}null==k&&(h.g.add(g),g=new P("regionadd",new Map([["region",g]])),h.dispatchEvent(g))},onEvent:function(g){return a.dispatchEvent(g)},onError:function(g){return Ek(a,g)},isLowLatencyMode:function(){return a.h.streaming.lowLatencyMode},isAutoLowLatencyMode:function(){return a.h.streaming.autoLowLatencyMode},enableLowLatencyMode:function(){a.configure("streaming.lowLatencyMode",!0)}},f=Date.now()/1E3;return new Ce(function(){var g,h,k,l;return L(function(m){if(1==m.g)return g=a,u(m,
371
- a.G.start(c,e),2);g.i=m.h;h=tk(Nk);a.dispatchEvent(h);if(0==a.i.variants.length)throw new N(2,4,4036);Ok(a.i);k=Date.now()/1E3;l=k-f;a.s.C=l;z(m)})}(),function(){return a.G.stop()})}
371
+ a.G.start(c,e),2);g.i=m.h;h=tk(Nk);a.dispatchEvent(h);if(0==a.i.variants.length)throw new N(2,4,4036);Ok(a.i);k=Date.now()/1E3;l=k-f;a.s.D=l;z(m)})}(),function(){return a.G.stop()})}
372
372
  function ok(a,b){var c,d;return L(function(e){return 1==e.g?(c=Date.now()/1E3,d=!0,a.m=Pk(a,{ib:a.D,onError:function(f){Ek(a,f)},Fc:function(f){Qk(a,f)},onExpirationUpdated:function(f,g){Rk(a,f,g)},onEvent:function(f){a.dispatchEvent(f);f.type==Sk&&d&&(d=!1,a.s.j=Date.now()/1E3-c)}}),a.m.configure(a.h.drm),u(e,yf(a.m,a.i.variants,a.i.offlineSessionIds),2)):3!=e.g?u(e,a.m.Ob(b.H),3):u(e,Lk(a,a.i),0)})}
373
373
  function pk(a,b,c){var d,e,f,g,h,k,l,m,n,p,q,v;return L(function(y){switch(y.g){case 1:b.startTime=c.startTime;d=b.H;e=b.uri;a.Kb=e;a.F=new Ji({Ac:function(){return d.playbackRate},xc:function(){return d.defaultPlaybackRate},Ld:function(x){d.playbackRate=x},fe:function(x){d.currentTime+=x}});f=function(){return Tk(a)};g=function(){return Uk(a)};a.o.v(d,"playing",f);a.o.v(d,"pause",f);a.o.v(d,"ended",f);a.o.v(d,"ratechange",g);h=a.h.abrFactory;a.u&&a.ed==h||(a.ed=h,a.u=Rb(h),"function"!=typeof a.u.playbackRateChanged&&
374
374
  (Kb("AbrManager","Please use an AbrManager with playbackRateChanged function."),a.u.playbackRateChanged=function(){}),a.u.configure(a.h.abr));a.Ba=new re(a.h.preferredAudioLanguage,a.h.preferredVariantRole,a.h.preferredAudioChannelCount);a.Ca=a.h.preferredTextLanguage;a.Eb=a.h.preferredTextRole;a.Nb=a.h.preferForcedSubs;Vk(a.i.presentationTimeline,a.h.playRangeStart,a.h.playRangeEnd);a.u.init(function(x,w,D){a.j&&x!=a.j.l&&Wk(a,x,!0,void 0===w?!1:w,void 0===D?0:D)});a.C=Xk(a,b.startTime);a.La=Yk(a);
375
375
  k=Math.max(a.i.minBufferTime,a.h.streaming.rebufferingGoal);Zk(a,k);xd(a.i,a.h.preferredVideoCodecs,a.h.preferredAudioCodecs,a.h.preferredAudioChannelCount,a.h.preferredDecodingAttributes);a.j=$k(a);a.j.configure(a.h.streaming);a.l=al;d.textTracks&&a.o.v(d.textTracks,"addtrack",function(x){if(x.track)switch(x=x.track,x.kind){case "chapters":bl(a,x)}});a.dispatchEvent(tk(cl));l=null;if(m=a.Bc().find(function(x){return x.active})){y.A(2);break}l=dl(a)?a.u.chooseVariant():null;Wk(a,l,!0,!1,0);if(!a.h.streaming.startAtSegmentBoundary){y.A(3);
376
376
  break}n=a.C.m();return u(y,el(l,n),4);case 4:p=y.h,a.C.o(p);case 3:fl(a,null,Wd(l));case 2:return q=a.eb().find(function(x){return x.active}),q||((v=fe(a.i.textStreams,a.Ca,a.Eb,a.Nb)[0]||null)&&dk(a.s.h,v,!0),l&&(v?(l.audio&&gl(a,l.audio,v)&&(a.ia=!0),a.ia&&a.M.l.setTextVisibility(!0),hl(a)):a.ia=!1),v&&(a.h.streaming.alwaysStreamText||a.kd())&&fj(a.j,v)),u(y,a.j.start(),5);case 5:a.h.abr.enabled&&(a.u.enable(),il(a)),Nd(a.j?a.j.l:null,a.i),jl(a.i),kl(a),dl(a),a.i.variants.some(function(x){return x.primary}),
377
- a.o.oa(d,"loadedmetadata",function(){a.s.l=Date.now()/1E3-c.Nd}),z(y)}})}
377
+ a.o.oa(d,"loadedmetadata",function(){a.s.m=Date.now()/1E3-c.Nd}),z(y)}})}
378
378
  function qk(a,b,c){var d,e,f,g,h,k,l;return L(function(m){return 1==m.g?(d=oc,e=Date.now()/1E3,f=!0,a.m=Pk(a,{ib:a.D,onError:function(n){Ek(a,n)},Fc:function(n){Qk(a,n)},onExpirationUpdated:function(n,p){Rk(a,n,p)},onEvent:function(n){a.dispatchEvent(n);n.type==Sk&&f&&(f=!1,a.s.j=Date.now()/1E3-e)}}),a.m.configure(a.h.drm),g=c.uri||"",h=eg(g),k=Ck[h],"application/x-mpegurl"==k&&Ac()&&(k="application/vnd.apple.mpegurl"),k||(k="video/mp4"),l={id:0,language:"und",primary:!1,audio:null,video:{id:0,originalId:null,
379
379
  createSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:c.mimeType?c.mimeType.split(";")[0]:k,codecs:c.mimeType?cd(c.mimeType):"",encrypted:!0,drmInfos:[],keyIds:new Set,language:"und",label:null,type:d.Ma,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null},bandwidth:100,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]},a.m.V=!0,u(m,yf(a.m,[l],[]),2)):u(m,a.m.Ob(b.H),
380
380
  0)})}
381
381
  function rk(a,b,c){function d(){return Tk(a)}b.uri=c.uri;b.startTime=c.startTime;a.Kb=b.uri;var e=b.H;a.C=new zi(e);var f=!1;a.Mb.push(function(){f=!0});null!=b.startTime&&a.C.o(b.startTime);a.F=new Ji({Ac:function(){return e.playbackRate},xc:function(){return e.defaultPlaybackRate},Ld:function(h){e.playbackRate=h},fe:function(h){e.currentTime+=h}});Zk(a,a.h.streaming.rebufferingGoal);a.o.v(e,"playing",d);a.o.v(e,"pause",d);a.o.v(e,"ended",d);a.o.v(e,"ratechange",function(){return Uk(a)});"none"!=e.preload&&
382
- a.o.oa(e,"loadedmetadata",function(){a.s.l=Date.now()/1E3-c.Nd});e.audioTracks&&(a.o.v(e.audioTracks,"addtrack",function(){return kl(a)}),a.o.v(e.audioTracks,"removetrack",function(){return kl(a)}),a.o.v(e.audioTracks,"change",function(){return kl(a)}));e.textTracks&&(a.o.v(e.textTracks,"addtrack",function(h){if(h.track)switch(h=h.track,h.kind){case "metadata":ll(a,h);break;case "chapters":bl(a,h);break;default:kl(a)}}),a.o.v(e.textTracks,"removetrack",function(){return kl(a)}),a.o.v(e.textTracks,
382
+ a.o.oa(e,"loadedmetadata",function(){a.s.m=Date.now()/1E3-c.Nd});e.audioTracks&&(a.o.v(e.audioTracks,"addtrack",function(){return kl(a)}),a.o.v(e.audioTracks,"removetrack",function(){return kl(a)}),a.o.v(e.audioTracks,"change",function(){return kl(a)}));e.textTracks&&(a.o.v(e.textTracks,"addtrack",function(h){if(h.track)switch(h=h.track,h.kind){case "metadata":ll(a,h);break;case "chapters":bl(a,h);break;default:kl(a)}}),a.o.v(e.textTracks,"removetrack",function(){return kl(a)}),a.o.v(e.textTracks,
383
383
  "change",function(){return kl(a)}));e.src=b.uri;(xc()||yc())&&e.load();a.l=ml;a.dispatchEvent(tk(cl));var g=new pc;qi(e,HTMLMediaElement.HAVE_METADATA,a.o,function(){g.resolve()});qi(e,HTMLMediaElement.HAVE_CURRENT_DATA,a.o,function(){var h;return L(function(k){if(1==k.g)return nl(a),h=ol(a),h.find(function(l){return"disabled"!=l.mode})?k.A(2):u(k,new Promise(function(l){a.o.oa(e.textTracks,"change",l);(new O(l)).R(1)}),2);if(f)return k["return"]();pl(a);z(k)})});e.error?g.reject(Dk(a)):"none"==e.preload&&
384
384
  (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.'),g.resolve());a.o.oa(e,"error",function(){g.reject(Dk(a))});return new Ce(g,function(){g.reject(new N(2,7,7001));return Promise.resolve()})}function nl(a){var b=a.h.preferredAudioLanguage;if(""!=b){a.Gd(b);var c=a.h.preferredVariantRole;""!=c&&a.Gd(b,c)}}
385
385
  function pl(a){var b=a.h.preferredTextLanguage,c=a.h.preferForcedSubs;if(""!=b){a.Hd(b,"",c);var d=a.h.preferredTextRole;""!=d&&a.Hd(b,d,c)}}
@@ -415,9 +415,9 @@ r.Lf=function(a){a=!!a;if(this.ia!=a){this.ia=a;if(this.l==al)this.M.l.setTextVi
415
415
  r.bf=function(){if(!this.U())return null;var a=this.ja.l,b=0;if(this.C)b=this.C.m();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};
416
416
  r.$d=function(){if(!this.U())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.wc=function(){if(this.l==al)return this.M.wc();var a={total:[],audio:[],video:[],text:[]};this.l==ml&&(a.total=Jh(this.g.buffered));return a};
417
417
  r.getStats=function(){if(this.l!=al&&this.l!=ml)return{width:NaN,height:NaN,streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,corruptedFrames: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:[]};Tk(this);var a=this.g,b=a.currentTime/a.duration;if(!isNaN(b)){var c=this.s;b=Math.round(100*b);c.i=isNaN(c.i)?
418
- b:Math.max(c.i,b)}a.getVideoPlaybackQuality&&(a=a.getVideoPlaybackQuality(),c=this.s,b=Number(a.totalVideoFrames),c.J=Number(a.droppedVideoFrames),c.G=b,this.s.F=Number(a.corruptedVideoFrames));this.m?(a=this.m,a=a.F?a.F:NaN):a=NaN;this.s.m=a;if(this.l==al){if(a=this.j.l)this.s.s=(this.F?this.F.i:1)*a.bandwidth;a&&a.video&&(c=this.s,b=a.video.height||NaN,c.M=a.video.width||NaN,c.u=b);this.U()&&(a=this.$d().valueOf()+1E3*this.ac().end,this.s.B=(Date.now()-a)/1E3);this.i&&this.i.presentationTimeline&&
419
- (this.s.D=this.i.presentationTimeline.g);a=this.u.getBandwidthEstimate();this.s.o=a}var d=this.s;a=d.M;c=d.u;b=d.s;var e=d.G,f=d.J,g=d.F,h=d.o,k=d.i,l=d.l,m=d.C,n=d.j,p=ak(d.g,"playing"),q=ak(d.g,"paused"),v=ak(d.g,"buffering"),y=d.m,x=d.B,w=d.D,D=bk(d.g),C=[];d=t(d.h.g);for(var B=d.next();!B.done;B=d.next())B=B.value,C.push({timestamp:B.timestamp,id:B.id,type:B.type,fromAdaptation:B.fromAdaptation,bandwidth:B.bandwidth});return{width:a,height:c,streamBandwidth:b,decodedFrames:e,droppedFrames:f,corruptedFrames:g,
420
- estimatedBandwidth:h,completionPercent:k,loadLatency:l,manifestTimeSeconds:m,drmTimeSeconds:n,playTime:p,pauseTime:q,bufferingTime:v,licenseTime:y,liveLatency:x,maxSegmentDuration:w,stateHistory:D,switchHistory:C}};
418
+ b:Math.max(c.i,b)}if(a.getVideoPlaybackQuality){c=a.getVideoPlaybackQuality();b=this.s;var d=Number(c.totalVideoFrames);b.M=Number(c.droppedVideoFrames);b.J=d;this.s.G=Number(c.corruptedVideoFrames)}this.m?(c=this.m,c=c.F?c.F:NaN):c=NaN;this.s.s=c;if(this.l==al){if(c=this.j.l)this.s.B=(this.F?this.F.i:1)*c.bandwidth;c&&c.video&&(b=this.s,d=c.video.height||NaN,b.o=c.video.width||NaN,b.l=d);this.U()&&(c=this.$d().valueOf()+1E3*this.ac().end,this.s.C=(Date.now()-c)/1E3);this.i&&this.i.presentationTimeline&&
419
+ (this.s.F=this.i.presentationTimeline.g);c=this.u.getBandwidthEstimate();this.s.u=c}this.l==ml&&(c=this.s,b=a.videoHeight||NaN,c.o=a.videoWidth||NaN,c.l=b);var e=this.s;a=e.o;c=e.l;b=e.B;d=e.J;var f=e.M,g=e.G,h=e.u,k=e.i,l=e.m,m=e.D,n=e.j,p=ak(e.g,"playing"),q=ak(e.g,"paused"),v=ak(e.g,"buffering"),y=e.s,x=e.C,w=e.F,D=bk(e.g),C=[];e=t(e.h.g);for(var B=e.next();!B.done;B=e.next())B=B.value,C.push({timestamp:B.timestamp,id:B.id,type:B.type,fromAdaptation:B.fromAdaptation,bandwidth:B.bandwidth});return{width:a,
420
+ height:c,streamBandwidth:b,decodedFrames:d,droppedFrames:f,corruptedFrames:g,estimatedBandwidth:h,completionPercent:k,loadLatency:l,manifestTimeSeconds:m,drmTimeSeconds:n,playTime:p,pauseTime:q,bufferingTime:v,licenseTime:y,liveLatency:x,maxSegmentDuration:w,stateHistory:D,switchHistory:C}};
421
421
  r.addTextTrack=function(a,b,c,d,e,f,g){g=void 0===g?!1:g;Kb("addTextTrack","Please use an addTextTrackAsync.");if(this.l!=al&&this.l!=ml)throw new N(1,7,7004);if(!d){var h=eg(a);d=Dl[h];if(!d)throw new N(1,2,2011,h);}if(this.l==ml){if("text/vtt"!=d)throw new N(1,2,2013,d);g&&(c="forced");d=document.createElement("track");d.src=a;d.label=f||"";d.kind=c;d.srclang=b;this.g.getAttribute("crossorigin")||this.g.setAttribute("crossorigin","anonymous");this.g.appendChild(d);if(a=this.eb().find(function(k){return k.language==
422
422
  b&&k.label==(f||"")&&k.kind==c}))return kl(this),a;throw new N(1,2,2012);}h=this.i.presentationTimeline.getDuration();if(Infinity==h)throw new N(1,4,4033);a={id:this.nd++,originalId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:Hi(0,h,[a]),mimeType:d||"",codecs:e||"",kind:c,encrypted:!1,drmInfos:[],keyIds:new Set,language:b,label:f||null,type:nc,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!!g,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,
423
423
  closedCaptions:null};if(!ed(Zc(a.mimeType,a.codecs)))throw new N(2,2,2014,d);this.i.textStreams.push(a);kl(this);return Xd(a)};
@@ -459,13 +459,13 @@ for(l=p.next();!l.done;l=p.next())l=l.value,k[l]=sc()?ed(l)?!0:MediaSource.isTyp
459
459
  V.isBrowserSupported=function(){window.Promise||Va("A Promise implementation or polyfill is required");if(!(window.Promise&&window.Uint8Array&&Array.prototype.forEach)||wc("Trident/"))return!1;var a=Dc();return a&&12>a||!(window.MediaKeys&&window.navigator&&window.navigator.requestMediaKeySystemAccess&&window.MediaKeySystemAccess&&window.MediaKeySystemAccess.prototype.getConfiguration)?!1:sc()?!0:tc("application/x-mpegurl")};V.setAdManagerFactory=function(a){ik=a};
460
460
  V.registerSupportPlugin=function(a,b){Xl[a]=b};V.prototype.destroy=V.prototype.destroy;
461
461
  var Tl="abrstatuschanged",Nl="adaptation",Kl="buffering",Sk="drmsessionupdate",uj="emsg",Ul="error",Wl="expirationupdated",Bk="loaded",zk="loading",Nk="manifestparsed",rl="metadata",uk="onstatechange",vk="onstateidle",Ll="ratechange",cl="streaming",Rl="textchanged",Sl="texttrackvisibility",Kk="timelineregionadded",tl="timelineregionenter",ul="timelineregionexit",Pl="trackschanged",Fk="unloading",Ql="variantchanged",Yl={Tf:Tl,Uf:Nl,Vf:Kl,Wf:Sk,Yf:uj,Error:Ul,Zf:Wl,$f:"largegap",ag:Bk,bg:zk,cg:Nk,Metadata:rl,
462
- dg:uk,eg:vk,fg:Ll,gg:"sessiondata",hg:cl,ig:Rl,jg:Sl,kg:Kk,lg:tl,mg:ul,ng:Pl,og:Fk,pg:Ql},wk=0,fk=1,al=2,ml=3;V.LoadMode={DESTROYED:wk,NOT_LOADED:fk,MEDIA_SOURCE:al,SRC_EQUALS:ml};V.version="v3.2.11";var Zl=["3","2"];Lb=new function(a){this.g=a;this.i=Mb;this.h=Nb}(new Jb(Number(Zl[0]),Number(Zl[1])));
462
+ dg:uk,eg:vk,fg:Ll,gg:"sessiondata",hg:cl,ig:Rl,jg:Sl,kg:Kk,lg:tl,mg:ul,ng:Pl,og:Fk,pg:Ql},wk=0,fk=1,al=2,ml=3;V.LoadMode={DESTROYED:wk,NOT_LOADED:fk,MEDIA_SOURCE:al,SRC_EQUALS:ml};V.version="v3.2.12";var Zl=["3","2"];Lb=new function(a){this.g=a;this.i=Mb;this.h=Nb}(new Jb(Number(Zl[0]),Number(Zl[1])));
463
463
  var Vl=["output-restricted","internal-error"],Xl={},ik=null,Ck={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"},Dl={sbv:"text/x-subviewer",srt:"text/srt",vtt:"text/vtt",webvtt:"text/vtt",ttml:"application/ttml+xml",lrc:"application/x-subtitle-lrc",
464
464
  ssa:"text/x-ssa",ass:"text/x-ssa"};function $l(){this.h=[];this.j=this.i=this.g=0};function W(a,b){var c=this;this.h=a;this.g=b;this.i=!1;this.l=this.g.getVolume();this.j=new bf;this.j.v(this.g,google.ima.AdEvent.Type.PAUSED,function(){c.i=!0});this.j.v(this.g,google.ima.AdEvent.Type.RESUMED,function(){c.i=!1})}r=W.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};
465
465
  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()};
466
466
  r.resize=function(a,b){this.g.resize(a,b,document.fullscreenElement?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()};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",W);
467
467
  W.prototype.release=W.prototype.release;W.prototype.getPositionInSequence=W.prototype.getPositionInSequence;W.prototype.getSequenceLength=W.prototype.getSequenceLength;W.prototype.setMuted=W.prototype.setMuted;W.prototype.resize=W.prototype.resize;W.prototype.isMuted=W.prototype.isMuted;W.prototype.setVolume=W.prototype.setVolume;W.prototype.getVolume=W.prototype.getVolume;W.prototype.play=W.prototype.play;W.prototype.pause=W.prototype.pause;W.prototype.skip=W.prototype.skip;
468
- W.prototype.canSkipNow=W.prototype.canSkipNow;W.prototype.getTimeUntilSkippable=W.prototype.getTimeUntilSkippable;W.prototype.isSkippable=W.prototype.isSkippable;W.prototype.isPaused=W.prototype.isPaused;W.prototype.getRemainingTime=W.prototype.getRemainingTime;W.prototype.getMinSuggestedDuration=W.prototype.getMinSuggestedDuration;W.prototype.getDuration=W.prototype.getDuration;function am(a,b,c,d){var e=this;this.m=a;this.i=b;this.s=null;this.u=NaN;this.j=d;this.o=null;this.h=new bf;google.ima.settings.setLocale(c);a=new google.ima.AdDisplayContainer(this.m,this.i);a.initialize();this.l=new google.ima.AdsLoader(a);this.l.getSettings().setPlayerType("shaka-player");this.l.getSettings().setPlayerVersion("v3.2.11");this.g=null;this.h.oa(this.l,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,function(f){bm(e,f)});this.h.v(this.l,google.ima.AdErrorEvent.Type.AD_ERROR,
468
+ W.prototype.canSkipNow=W.prototype.canSkipNow;W.prototype.getTimeUntilSkippable=W.prototype.getTimeUntilSkippable;W.prototype.isSkippable=W.prototype.isSkippable;W.prototype.isPaused=W.prototype.isPaused;W.prototype.getRemainingTime=W.prototype.getRemainingTime;W.prototype.getMinSuggestedDuration=W.prototype.getMinSuggestedDuration;W.prototype.getDuration=W.prototype.getDuration;function am(a,b,c,d){var e=this;this.m=a;this.i=b;this.s=null;this.u=NaN;this.j=d;this.o=null;this.h=new bf;google.ima.settings.setLocale(c);a=new google.ima.AdDisplayContainer(this.m,this.i);a.initialize();this.l=new google.ima.AdsLoader(a);this.l.getSettings().setPlayerType("shaka-player");this.l.getSettings().setPlayerVersion("v3.2.12");this.g=null;this.h.oa(this.l,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,function(f){bm(e,f)});this.h.v(this.l,google.ima.AdErrorEvent.Type.AD_ERROR,
469
469
  function(f){cm(e,f)});this.i.onended=function(){e.l.contentComplete()}}am.prototype.stop=function(){this.g&&this.g.stop();this.m&&Hj(this.m)};am.prototype.release=function(){this.stop();this.s&&this.s.disconnect();this.h&&this.h.release();this.g&&this.g.destroy();this.l.destroy()};function cm(a,b){b.getError();dm(a,null);a.j(new P("ad-cue-points-changed",(new Map).set("cuepoints",[])))}
470
470
  function bm(a,b){a.j(new P("ads-loaded",(new Map).set("loadTime",Date.now()/1E3-a.u)));a.g=b.getAdsManager(a.i);a.j(new P("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.j(new P("ad-cue-points-changed",(new Map).set("cuepoints",d)))}em(a);try{a.g.init(a.i.offsetWidth,a.i.offsetHeight,document.fullscreenElement?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL),
471
471
  a.h.v(a.i,"loadeddata",function(){a.g.resize(a.i.offsetWidth,a.i.offsetHeight,document.fullscreenElement?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,document.fullscreenElement?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a.s.observe(a.i)),a.g.start()}catch(f){dm(a,null)}}
@@ -486,8 +486,8 @@ f;e.i(new P("ad-cue-points-changed",(new Map).set("cuepoints",f)))})}gm.prototyp
486
486
  function hm(a,b){a.i(new P("ads-loaded",(new Map).set("loadTime",Date.now()/1E3-a.F)));var c=b.getStreamData().url;a.j.resolve(c);a.j=null;a.D||a.h.v(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 Y(){Ke.call(this);this.g=this.i=null;this.h=new $l;this.j=navigator.language}pa(Y,Ke);r=Y.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 am(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)})};
487
487
  r.release=function(){this.i&&(this.i.release(),this.i=null);this.g&&(this.g.release(),this.g=null);Ke.prototype.release.call(this)};r.onAssetUnload=function(){this.i&&this.i.stop();this.g&&this.g.stop();this.dispatchEvent(new P("ad-stopped"));this.h=new $l};r.requestClientSideAds=function(a){if(!this.i)throw new N(1,10,10001);var b=this.i;b.u=Date.now()/1E3;b.l.requestAds(a)};
488
488
  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 gm(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)})};
489
- 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="v3.2.11";c=this.g;var d=b;c.j?c=Promise.reject(new N(1,10,10004)):(a instanceof google.ima.dai.api.LiveStreamRequest&&
490
- (c.D=!0),c.j=new pc,c.g.requestStream(a),c.B=d||"",c.F=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="v3.2.11";this.g.g.replaceAdTagParameters(a)};r.getServerSideCuePoints=function(){if(!this.g)throw new N(1,10,10003);return this.g.C};
489
+ 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="v3.2.12";c=this.g;var d=b;c.j?c=Promise.reject(new N(1,10,10004)):(a instanceof google.ima.dai.api.LiveStreamRequest&&
490
+ (c.D=!0),c.j=new pc,c.g.requestStream(a),c.B=d||"",c.F=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="v3.2.12";this.g.g.replaceAdTagParameters(a)};r.getServerSideCuePoints=function(){if(!this.g)throw new N(1,10,10003);return this.g.C};
491
491
  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",Y);
492
492
  Y.prototype.onCueMetadataChange=Y.prototype.onCueMetadataChange;Y.prototype.onHlsTimedMetadata=Y.prototype.onHlsTimedMetadata;Y.prototype.onDashTimedMetadata=Y.prototype.onDashTimedMetadata;Y.prototype.getStats=Y.prototype.getStats;Y.prototype.getServerSideCuePoints=Y.prototype.getServerSideCuePoints;Y.prototype.replaceServerSideAdTagParameters=Y.prototype.replaceServerSideAdTagParameters;Y.prototype.requestServerSideStream=Y.prototype.requestServerSideStream;Y.prototype.initServerSide=Y.prototype.initServerSide;
493
493
  Y.prototype.requestClientSideAds=Y.prototype.requestClientSideAds;Y.prototype.onAssetUnload=Y.prototype.onAssetUnload;Y.prototype.release=Y.prototype.release;Y.prototype.initClientSide=Y.prototype.initClientSide;Y.prototype.setLocale=Y.prototype.setLocale;Y.ADS_LOADED="ads-loaded";Y.AD_STARTED="ad-started";Y.AD_FIRST_QUARTILE="ad-first-quartile";Y.AD_MIDPOINT="ad-midpoint";Y.AD_THIRD_QUARTILE="ad-third-quartile";Y.AD_COMPLETE="ad-complete";Y.AD_STOPPED="ad-stopped";Y.AD_SKIPPED="ad-skipped";