@castlabs/prestoplay 6.25.0 → 6.25.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/cl.ima.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
2
  var f=function(window){var BU="clpp.ima.AdsManagerFactory",CU=function(a,b){return new Promise(function(c){if(a.readyState===HTMLMediaElement.HAVE_NOTHING&&0===a.networkState)c();else b.one(a,"emptied",c)})},DU=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.h=c},EU=function(){},FU=function(a){this.a=a},GU=function(a){var b=a.ge("ima");if(!b)throw Error("IMA plugin not created.");var c=b.ud(),d=b.h;b=b.a;if(!c||!d||!b)throw Error("IMA plugin not initialized.");var e=a.getSurface().getMedia();if(!e)throw Error("Missing media element.");
3
- this.m=a;this.f=e;a=this.m.getConfiguration();a=_.N.nb(a.ima||{});this.I=_.N.ua({disableCustomPlayback:!1},a);this.L=c;this.M=d;this.o=b;this.J=new _.bv;this.g=new _.K("clpp.ima");this.j=this.a=null;this.h=new _.xk;this.K=!1;this.l=new _.wi;this.P=new EU;this.w=null;this.H=this.B=this.C=!1;this.G=this.A=null;c=this.l;d=google.ima.AdErrorEvent.Type.AD_ERROR;c.one(this.o,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.cn.bind(this));c.on(this.o,d,this.bn.bind(this));c.on(this.m,_.ze,this.jn.bind(this))},
4
- HU=function(a){var b=a.a,c=a.l,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.Tm.bind(a));c.on(b,d.LOADED,a.Ok.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.kn.bind(a));c.on(b,d.STARTED,a.Rk.bind(a));c.on(b,d.LOG,a.Xm.bind(a));c.on(b,d.AD_PROGRESS,a.Pk.bind(a));c.on(b,d.AD_BUFFERING,a.Um.bind(a));c.on(b,d.FIRST_QUARTILE,a.Mk.bind(a));c.on(b,d.MIDPOINT,a.Ym.bind(a));c.on(b,d.THIRD_QUARTILE,a.Sk.bind(a));c.on(b,d.PAUSED,a.$m.bind(a));c.on(b,d.RESUMED,a.an.bind(a));c.on(b,d.CLICK,a.Lk.bind(a));c.on(b,
5
- d.SKIPPED,a.Qk.bind(a));c.on(b,d.IMPRESSION,a.Nk.bind(a));c.on(b,d.COMPLETE,a.Vm.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.ln.bind(a))},IU=function(a){a=a.I;var b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.k&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.nd?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.k&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===
3
+ this.m=a;this.f=e;a=this.m.getConfiguration();a=_.N.nb(a.ima||{});this.I=_.N.ua({disableCustomPlayback:!1},a);this.L=c;this.M=d;this.o=b;this.J=new _.bv;this.g=new _.K("clpp.ima");this.j=this.a=null;this.h=new _.xk;this.K=!1;this.l=new _.wi;this.P=new EU;this.w=null;this.H=this.B=this.C=!1;this.G=this.A=null;c=this.l;d=google.ima.AdErrorEvent.Type.AD_ERROR;c.one(this.o,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.bn.bind(this));c.on(this.o,d,this.an.bind(this));c.on(this.m,_.ze,this.hn.bind(this))},
4
+ HU=function(a){var b=a.a,c=a.l,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.Sm.bind(a));c.on(b,d.LOADED,a.Nk.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.jn.bind(a));c.on(b,d.STARTED,a.Qk.bind(a));c.on(b,d.LOG,a.Wm.bind(a));c.on(b,d.AD_PROGRESS,a.Ok.bind(a));c.on(b,d.AD_BUFFERING,a.Tm.bind(a));c.on(b,d.FIRST_QUARTILE,a.Lk.bind(a));c.on(b,d.MIDPOINT,a.Xm.bind(a));c.on(b,d.THIRD_QUARTILE,a.Rk.bind(a));c.on(b,d.PAUSED,a.Zm.bind(a));c.on(b,d.RESUMED,a.$m.bind(a));c.on(b,d.CLICK,a.Kk.bind(a));c.on(b,
5
+ d.SKIPPED,a.Pk.bind(a));c.on(b,d.IMPRESSION,a.Mk.bind(a));c.on(b,d.COMPLETE,a.Um.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.kn.bind(a))},IU=function(a){a=a.I;var b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.k&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.nd?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.k&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===
6
6
  _.k&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===_.nd&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},KU=function(a){a.w=null;JU(a,_.Oc);a.m.getSurface().hide(a.L)},LU=function(a){return _.I(function(b){if(1==b.a)return _.y(b,a.m.detach(),2);var c=a.m;c.a&&c.a.stopForwardingEventsTo(c);_.C(b)})},MU=function(a){return _.I(function(b){return _.y(b,CU(a.f,a.l),0)})},NU=function(a){return _.I(function(b){return b["return"](new Promise(function(c){a.l.on(a.f,
7
7
  _.Wf,function(){a.m.getState()===_.Uq&&c()})}))})},OU=function(a){_.vr(a.f,{visibility:"visible"})},JU=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new DU(c,a.C,a.B)});a.m.trigger(new _.L(b,d))},PU=function(a,b){var c=b?a.P.create(b.getErrorCode()):null;a.m.onError(new _.O(1,9,10003,{errorType:c},b))},QU=function(a){return!1===a.I.disableCustomPlayback&&a.a.isCustomPlaybackUsed()},SU=function(a){var b,c;return _.I(function(d){if(1==d.a)return a.M.initialize(),b=!!a.m.getConfiguration().muted,
8
8
  _.y(d,a.J.canPlay(b),2);if(3!=d.a)return c=d.f,c||QU(a)?QU(a)?_.y(d,LU(a),3):d.F(3):(JU(a,_.ld),a.g.warn(_.oa),d["return"]());RU(a);_.C(d)})},TU=function(a,b){return _.I(function(c){if(1==c.a)return a.M.initialize(),_.y(c,b.play(),2);RU(a);_.C(c)})},RU=function(a){a.a.init(a.f.offsetWidth,a.f.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();a.K=!0},UU=function(){this.a=this.h=this.f=null},VU=function(){return!window.google||!google.ima||!google.ima.AdsLoader},WU=function(){},XU=function(){this.Ca=
@@ -13,15 +13,15 @@ _.u.getWrapperAdSystems=function(){return this.a.getWrapperAdSystems()};_.u.getW
13
13
  DU.prototype.getPositionInSequence=DU.prototype.Cb;DU.prototype.getPodTimeOffset=DU.prototype.Pb;DU.prototype.getPodIndex=DU.prototype.getPodIndex;DU.prototype.getPodType=DU.prototype.Ya;DU.prototype.getMediaBitrate=DU.prototype.Xa;DU.prototype.getMediaHeight=DU.prototype.pb;DU.prototype.getMediaWidth=DU.prototype.qb;DU.prototype.getMediaUrl=DU.prototype.getMediaUrl;DU.prototype.getClickThroughUrl=DU.prototype.Ab;DU.prototype.isBumper=DU.prototype.gc;DU.prototype.getSkipTimeOffset=DU.prototype.getSkipTimeOffset;
14
14
  DU.prototype.getPosition=DU.prototype.getPosition;DU.prototype.getDuration=DU.prototype.getDuration;DU.prototype.getTitle=DU.prototype.getTitle;DU.prototype.getAdvertiserName=DU.prototype.getAdvertiserName;DU.prototype.getAdSystem=DU.prototype.getAdSystem;DU.prototype.getApiFramework=DU.prototype.getApiFramework;DU.prototype.getSourceId=DU.prototype.cc;DU.prototype.getCreativeId=DU.prototype.getCreativeId;DU.prototype.getId=DU.prototype.getId;DU.prototype.getTechnology=DU.prototype.Db;
15
15
  DU.prototype.getAdManagerVersion=DU.prototype.zb;DU.prototype.getAdManagerName=DU.prototype.yb;EU.prototype.create=function(a){var b=google.ima.AdError.ErrorCode;switch(a){case b.VAST_LOAD_TIMEOUT:case b.VAST_MEDIA_LOAD_TIMEOUT:case b.FAILED_TO_REQUEST_ADS:return 0;case b.VIDEO_PLAY_ERROR:return 1;default:return 2}};FU.prototype.getCuePoints=function(){return this.a};FU.prototype.Sb=function(){return 0<=this.a.indexOf(0)||0===this.a.length};FU.prototype.Rb=function(){return 0<=this.a.indexOf(-1)};FU.prototype.hasPostroll=FU.prototype.Rb;FU.prototype.hasPreroll=FU.prototype.Sb;FU.prototype.getCuePoints=FU.prototype.getCuePoints;_.u=GU.prototype;
16
- _.u.cn=function(a){var b=this;this.a=a.getAdsManager(this.f,IU(this));this.a.isCustomPlaybackUsed()&&!QU(this)?(this.g.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.O(1,9,10002)),this.Ec()):(this.j=new _.Zu(this.m.getSurface(),function(c,d,e){b.a.resize(c,d,e?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.A=new FU(a),this.m.trigger(new _.L(_.Rc,{adsTimeline:this.A})),HU(this));this.h.resolve()};
17
- _.u.bn=function(a){PU(this,a.getError());this.h.resolve()};_.u.kn=function(a){var b=this;return _.I(function(c){if(1==c.a)return b.H=!0,QU(b)?(b.G=b.m.getPosition(),_.y(c,LU(b),3)):_.y(c,b.m.pause(),4);if(3!=c.a)return _.vr(b.f,{visibility:_.Ge}),c.F(3);JU(b,_.xc,a);b.j.start();_.C(c)})};_.u.Tm=function(){var a=this;return _.I(function(b){if(1==b.a)return QU(a)?_.y(b,CU(a.f,a.l),2):b.F(2);a.a.start();_.C(b)})};
18
- _.u.Ok=function(a){a.getAd().isLinear()?JU(this,_.Hc,a):(this.a.discardAdBreak(),this.C||(this.C=!0,this.m.play()))};_.u.Rk=function(a){this.w=a.getAd().getDuration();JU(this,_.Nc,a);this.m.getSurface().show(this.L)};_.u.Xm=function(a){a=a.getAdData();PU(this,a?a.adError:null);KU(this)};_.u.Pk=function(a){JU(this,_.Kc,a)};_.u.Um=function(a){JU(this,_.zc,a)};_.u.Mk=function(a){JU(this,_.Cc,a)};_.u.Ym=function(a){JU(this,_.Ic,a)};_.u.Sk=function(a){JU(this,_.Pc,a)};_.u.$m=function(a){JU(this,_.Jc,a)};
19
- _.u.an=function(a){JU(this,_.Lc,a)};_.u.Lk=function(a){this.pause();JU(this,_.Ac,a)};_.u.Qk=function(a){JU(this,_.Mc,a);KU(this)};_.u.Nk=function(a){JU(this,_.Gc,a)};_.u.Vm=function(a){JU(this,_.Bc,a);KU(this)};
20
- _.u.ln=function(){var a=this;return _.I(function(b){switch(b.a){case 1:a.C=!0;if(!QU(a)||null===a.G){if(!a.H)return b["return"](a.m.play());OU(a);b.F(2);break}return _.y(b,MU(a),3);case 3:return _.y(b,_.Zt(a.m),4);case 4:if(a.B||!a.G){b.F(2);break}return _.y(b,NU(a),6);case 6:return _.y(b,a.m.seek(a.G),2);case 2:a.H=!1;a.j&&a.j.stop();if(a.B){b.F(8);break}return _.y(b,a.m.play(),8);case 8:JU(a,_.yc),_.C(b)}})};_.u.jn=function(){this.B=!0;this.o.contentComplete()};
16
+ _.u.bn=function(a){var b=this;this.a=a.getAdsManager(this.f,IU(this));this.a.isCustomPlaybackUsed()&&!QU(this)?(this.g.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.O(1,9,10002)),this.Ec()):(this.j=new _.Zu(this.m.getSurface(),function(c,d,e){b.a.resize(c,d,e?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.A=new FU(a),this.m.trigger(new _.L(_.Rc,{adsTimeline:this.A})),HU(this));this.h.resolve()};
17
+ _.u.an=function(a){PU(this,a.getError());this.h.resolve()};_.u.jn=function(a){var b=this;return _.I(function(c){if(1==c.a)return b.H=!0,QU(b)?(b.G=b.m.getPosition(),_.y(c,LU(b),3)):_.y(c,b.m.pause(),4);if(3!=c.a)return _.vr(b.f,{visibility:_.Ge}),c.F(3);JU(b,_.xc,a);b.j.start();_.C(c)})};_.u.Sm=function(){var a=this;return _.I(function(b){if(1==b.a)return QU(a)?_.y(b,CU(a.f,a.l),2):b.F(2);a.a.start();_.C(b)})};
18
+ _.u.Nk=function(a){a.getAd().isLinear()?JU(this,_.Hc,a):(this.a.discardAdBreak(),this.C||(this.C=!0,this.m.play()))};_.u.Qk=function(a){this.w=a.getAd().getDuration();JU(this,_.Nc,a);this.m.getSurface().show(this.L)};_.u.Wm=function(a){a=a.getAdData();PU(this,a?a.adError:null);KU(this)};_.u.Ok=function(a){JU(this,_.Kc,a)};_.u.Tm=function(a){JU(this,_.zc,a)};_.u.Lk=function(a){JU(this,_.Cc,a)};_.u.Xm=function(a){JU(this,_.Ic,a)};_.u.Rk=function(a){JU(this,_.Pc,a)};_.u.Zm=function(a){JU(this,_.Jc,a)};
19
+ _.u.$m=function(a){JU(this,_.Lc,a)};_.u.Kk=function(a){this.pause();JU(this,_.Ac,a)};_.u.Pk=function(a){JU(this,_.Mc,a);KU(this)};_.u.Mk=function(a){JU(this,_.Gc,a)};_.u.Um=function(a){JU(this,_.Bc,a);KU(this)};
20
+ _.u.kn=function(){var a=this;return _.I(function(b){switch(b.a){case 1:a.C=!0;if(!QU(a)||null===a.G){if(!a.H)return b["return"](a.m.play());OU(a);b.F(2);break}return _.y(b,MU(a),3);case 3:return _.y(b,_.Zt(a.m),4);case 4:if(a.B||!a.G){b.F(2);break}return _.y(b,NU(a),6);case 6:return _.y(b,a.m.seek(a.G),2);case 2:a.H=!1;a.j&&a.j.stop();if(a.B){b.F(8);break}return _.y(b,a.m.play(),8);case 8:JU(a,_.yc),_.C(b)}})};_.u.hn=function(){this.B=!0;this.o.contentComplete()};
21
21
  _.u.load=function(){var a=this,b,c,d,e,f;return _.I(function(g){if(1==g.a){b=a.m;c=a.I;try{if(typeof c.adTagUrl!==_.ug)throw new _.O(1,9,10001,{missingKeys:"adTagUrl"});}catch(h){return b.onError(h),a.h.resolve(),g["return"](a.h)}return c.adTagUrl?_.y(g,a.J.canPlay(!1),2):(a.h.resolve(),g["return"](a.h))}if(3!=g.a)return d=g.f,_.y(g,a.J.canPlay(!0),3);e=g.f;f=new google.ima.AdsRequest;f.adTagUrl=c.adTagUrl;f.setAdWillAutoPlay(d);f.setAdWillPlayMuted(e);a.o.getSettings().setAutoPlayAdBreaks(!1);a.o.requestAds(f);
22
22
  return g["return"](a.h)})};_.u.start=function(a){var b=this;return _.I(function(c){return b.a&&b.A&&!b.K?b.A.Sb()?_.y(c,SU(b),0):_.y(c,TU(b,a),0):_.y(c,a.play(),0)})};_.u.kd=function(){};_.u.gd=function(){return!0};_.u.resume=function(){this.a&&this.a.resume()};_.u.pause=function(){this.a&&this.a.pause()};_.u.skip=function(){this.a&&this.a.skip()};_.u.getVolume=function(){return this.a?this.a.getVolume():1};_.u.setVolume=function(a){this.a&&this.a.setVolume(a)};
23
23
  _.u.getPosition=function(){if(!this.a||null===this.w)return-1;var a=this.a.getRemainingTime();return 0>a?0:this.w-a};_.u.Ec=function(){this.a&&(this.a.destroy(),this.a=null);OU(this);this.l.release();this.j&&(this.j.stop(),this.j=null);return Promise.resolve()};GU.prototype.getPosition=GU.prototype.getPosition;GU.prototype.setVolume=GU.prototype.setVolume;GU.prototype.getVolume=GU.prototype.getVolume;GU.prototype.skip=GU.prototype.skip;GU.prototype.pause=GU.prototype.pause;GU.prototype.resume=GU.prototype.resume;_.x(UU,_.gw);_.u=UU.prototype;_.u.onPlayerCreated=function(a){if(VU())return a.onError(new _.O(1,9,1E4));this.f=_.tr(_.fe,{"class":"clpp-ima clpp-hidden"});a.getSurface().addElementToContainer(this.f);this.h=new google.ima.AdDisplayContainer(this.f,a.getSurface().getMedia());this.a=new google.ima.AdsLoader(this.h);this.a.getSettings().setPlayerType(_.xa);this.a.getSettings().setPlayerVersion(_.ia);this.a.getSettings().setAutoPlayAdBreaks(!0)};
24
- _.u.onPlayerWillDestroy=function(a){this.a&&(this.a.destroy(),this.a=null);this.h&&(this.h.destroy(),this.h=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)};_.u.Xl=function(){return this.a};_.u.Vl=function(){return this.h};_.u.ud=function(){return this.f};_.u.id=function(){return"ima"};_.J("clpp.ima.ImaPlugin",UU);UU.prototype.getAdContainer=UU.prototype.ud;UU.prototype.getAdDisplayContainer=UU.prototype.Vl;UU.prototype.getAdsLoader=UU.prototype.Xl;UU.Id="ima";
24
+ _.u.onPlayerWillDestroy=function(a){this.a&&(this.a.destroy(),this.a=null);this.h&&(this.h.destroy(),this.h=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)};_.u.Wl=function(){return this.a};_.u.Ul=function(){return this.h};_.u.ud=function(){return this.f};_.u.id=function(){return"ima"};_.J("clpp.ima.ImaPlugin",UU);UU.prototype.getAdContainer=UU.prototype.ud;UU.prototype.getAdDisplayContainer=UU.prototype.Ul;UU.prototype.getAdsLoader=UU.prototype.Wl;UU.Id="ima";
25
25
  UU.isSdkMissing=VU;WU.prototype.create=function(){return new UU};_.cu(new WU);XU.prototype.name=function(){return BU};XU.prototype.a=function(a,b){return a.namespace()===_.Hd?!1:VU()?(this.Ca.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};XU.prototype.create=function(a){return new GU(a)};_.nr(new XU);};
26
26
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
27
27
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
package/cjs/cl.mse.js CHANGED
@@ -13,7 +13,7 @@ b,d||null,e,a,c)};_.vE=function(a,b){return b===a.version?a:_.uE(b,a.a,a.l||void
13
13
  yE=function(a,b){var c=a.o.get(b);return!(!c||c!==_.rf&&c!==_.Je)};zE=function(a,b){var c=b.audio,d=b.video;if(c&&c.encrypted&&(c=_.Yp(c),!xE(a,c))||d&&d.encrypted&&(d=_.Yp(d),!xE(a,d)))return!1;var e=a.keySystem();return 0===b.drmInfos.length||b.drmInfos.some(function(f){return f.keySystem===e})};AE=function(a,b,c){a.f!==b&&(a.f=b,a.a.push({timestamp:Date.now()/1E3,id:b.id,trackId:b.track.id,type:b.track.type,fromAdaptation:c,width:null,height:null,bandwidth:b.bandwidth}))};
14
14
  BE=function(a,b){if(null==a.a)return null;var c=a.a[a.a.length-1];return c?c[b]:null};CE=function(a){a=BE(a,_.Qw);return null==a?null:a};DE=function(a,b){if(a.a.length)if(0>b)a.f=0;else{for(var c=0,d=a.a[c]||null;d&&b>d.dc()+d.getDuration();)c+=1,d=a.a[c]||null;a.f=d?c:a.a.length-1}else a.f=-1};_.EE=function(a,b){return a.concat(b)};FE=function(){};
15
15
  _.GE=function(a,b){if(0===b.length)return a;var c=b.map(function(d){return new _.sj(d)});return a.map(function(d){return new _.sj(d)}).map(function(d){return c.map(d.resolve.bind(d))}).reduce(_.EE,[]).map(function(d){return d.toString()})};_.HE=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:b||[],keyIds:[],periodId:c?c:null}};
16
- _.IE=function(a,b,c,d,e,f,g){f=void 0===f?"":f;this.eb=a;this.Da=b;this.pa=c;this.keyInfo=d||null;this.sd=_.N.R(e)?!1:!!e;this.ye=f;this.Ta=g};JE=function(a,b){a=_.Pj(a);b=_.Pj(b);var c=a.split("-"),d=b.split("-");return c[0]===d[0]&&1===c.length&&2===d.length};KE=function(a){return a.language?_.Pj(a.language):a.audio&&a.audio.language?_.Pj(a.audio.language):a.video&&a.video.language?_.Pj(a.video.language):_.Ng};
16
+ _.IE=function(a,b,c,d,e,f,g){f=void 0===f?"":f;this.eb=a;this.Da=b;this.pa=c;this.keyInfo=d||null;this.sd=_.N.R(e)?!1:!!e;this.ye=f;this.Ta=g};JE=function(a,b){a=_.Pj(a);b=_.Pj(b);var c=a.split("-"),d=b.split("-");return c[0]===d[0]&&1===c.length&&2===d.length};KE=function(a){return a.language?_.Pj(a.language):a.audio&&a.audio.language?_.Pj(a.audio.language):a.video&&a.video.language?_.Pj(a.video.language):_.Og};
17
17
  _.LE=function(a,b){for(var c=_.Pj(a),d=new Set,e=_.w(b),f=e.next();!f.done;f=e.next())d.add(_.Pj(f.value));e=_.w(d);for(f=e.next();!f.done;f=e.next())if(f=f.value,f===c)return f;e=_.w(d);for(f=e.next();!f.done;f=e.next())if(f=f.value,JE(f,c))return f;e=_.w(d);for(f=e.next();!f.done;f=e.next()){var g=f=f.value,h=c;g=_.Pj(g);h=_.Pj(h);g=g.split("-");h=h.split("-");if(2===g.length&&2===h.length&&g[0]===h[0])return f}d=_.w(d);for(f=d.next();!f.done;f=d.next())if(e=f.value,JE(c,e))return e;return null};
18
18
  ME=function(a,b){for(var c=0,d=_.w(a),e=d.next();!e.done;e=d.next())c+=b(e.value)?1:0;return c};NE=function(a,b){var c=_.Bl(b,a);if(!c)return!1;c=c();var d=c.isMuxed(a,b);c.destroy();return d};OE=function(a){for(var b=[a.mimeType],c=_.w(_.Aw),d=c.next();!d.done;d=c.next()){var e=_.w(d.value);d=e.next().value;e=e.next().value;d=a[d];null!=d&&b.push(e.trim()+'\x3d"'+String(d).trim()+'"')}return b.join(";").replace(/\s/g,"")};
19
19
  PE=function(a){return a.split(",").map(function(b){return b.trim()}).filter(function(b){return 0<b.length})};_.QE=function(a){var b=[];a=_.w(a.split(/\s*,\s*/));for(var c=a.next();!c.done;c=a.next()){c=c.value.split(".");var d=c[0];c.shift();b.push(d)}return b.sort().join(",")};RE=function(a,b){for(var c=new _.zm(void 0,void 0===b?"total":b),d=_.w(a),e=d.next();!e.done;e=d.next())c.a.push(e.value);c.length=a.length;return c};
@@ -89,8 +89,8 @@ pH=function(a,b){var c=a.m;if(c.f){var d=(d=rH(c))?sH(c.o,d).fb:null;c=c.f.muxed
89
89
  b.push(e),c.active&&a.a.set(_.V,e.renditions[0])};uH=function(a,b,c,d){a.h.length||qH(a);var e=a.a.get(c)||null;(b=tH(a,b,c))&&e!==b&&(dH(a,b),c===_.V?a.m.trigger(new _.L(_.kd)):c===_.Tk&&a.m.trigger(new _.L(_.bh,{details:{width:b.width||0,height:b.height||0,bandwidth:b.bandwidth,track:b.track,abrSelection:d}})))};tH=function(a,b,c){return aH(a,c).flatMap(function(d){return d.renditions}).find(function(d){return parseInt(d.id,10)===b})||null};
90
90
  vH=function(){this.a=new muxjs.mp4.CaptionParser;this.l=[];this.j={}};_.wH=function(){};_.yH=function(a,b,c,d,e){this.j=a;this.C=c;this.a={};this.K=!1;this.f=null;this.h={};this.l=new _.wi;this.I=!1;this.w={};this.H=b;this.B=d;this.L=e;this.P=this.L.streaming.maxSegmentToMediaOffset||1;this.J=new _.xk;this.A="";this.G={};this.o=xH(this,this.J);this.M=!0;this.g=new _.K("clpp.mse.MediaSourceEngine")};
91
91
  zH=function(a){var b=_.Cl(a.mimeType,a.codecs),c=OE(a);return _.LG(b)||_.Cu(c)||(_.Bl(b,a.type)?!0:!1)};xH=function(a,b){if(window.ManagedMediaSource){a.j.disableRemotePlayback=!0;var c=new ManagedMediaSource;a.l.one(c,kE,function(){URL.revokeObjectURL(a.A);b.resolve()});a.l.on(c,lE,function(){a.M=!0});a.l.on(c,"endstreaming",function(){a.M=!1});a.A=AH(c);a.j.src=a.A;return c}c=new MediaSource;a.A=AH(c);a.l.one(c,kE,function(){URL.revokeObjectURL(a.A);b.resolve()});a.j.src=a.A;return c};
92
- BH=function(a,b){b.forEach(function(c,d){var e=a.a[d];e&&(a.l.off(e,_.Ae),a.l.off(e,oE),a.o.removeSourceBuffer(e),delete a.a[d]);e=a.o.addSourceBuffer(c);a.l.on(e,_.Ae,a.Xk.bind(a,d));a.l.on(e,oE,a.md.bind(a,d));a.a[d]=e;a.h[d]=[];a.G[d]=!1})};CH=function(a,b){try{return new _.zm(a.a[b].buffered,b)}catch(c){return b in a.a&&a.g.error($D+b,c),null}};DH=function(a,b){if(!a.a[b])return"";var c=CH(a,b);return c?c.toString():""};
93
- FH=function(a,b,c,d,e){return[EH(a,b,a.Wk.bind(a,b)),EH(a,b,a.Hh.bind(a,b,c)),EH(a,b,a.Yk.bind(a,b,d,e))]};EH=function(a,b,c){if(a.I)return Promise.reject();c={start:c,p:new _.xk};a.h[b].push(c);1===a.h[b].length&&GH(a,b);return c.p};GH=function(a,b){var c=a.h[b][0];if(c)try{a.g.debug(OD+b),c.start()}catch(d){d.name===GD?c.p.reject(new _.O(_.P,3,3017,{type:b})):c.p.reject(new _.O(_.P,3,3015,{mediaError:d})),HH(a,b)}else a.g.debug(CD+b)};
92
+ BH=function(a,b){b.forEach(function(c,d){var e=a.a[d];e&&(a.l.off(e,_.Ae),a.l.off(e,oE),a.o.removeSourceBuffer(e),delete a.a[d]);e=a.o.addSourceBuffer(c);a.l.on(e,_.Ae,a.Wk.bind(a,d));a.l.on(e,oE,a.md.bind(a,d));a.a[d]=e;a.h[d]=[];a.G[d]=!1})};CH=function(a,b){try{return new _.zm(a.a[b].buffered,b)}catch(c){return b in a.a&&a.g.error($D+b,c),null}};DH=function(a,b){if(!a.a[b])return"";var c=CH(a,b);return c?c.toString():""};
93
+ FH=function(a,b,c,d,e){return[EH(a,b,a.Vk.bind(a,b)),EH(a,b,a.Hh.bind(a,b,c)),EH(a,b,a.Xk.bind(a,b,d,e))]};EH=function(a,b,c){if(a.I)return Promise.reject();c={start:c,p:new _.xk};a.h[b].push(c);1===a.h[b].length&&GH(a,b);return c.p};GH=function(a,b){var c=a.h[b][0];if(c)try{a.g.debug(OD+b),c.start()}catch(d){d.name===GD?c.p.reject(new _.O(_.P,3,3017,{type:b})):c.p.reject(new _.O(_.P,3,3015,{mediaError:d})),HH(a,b)}else a.g.debug(CD+b)};
94
94
  IH=function(a,b){var c,d,e,f,g,h,l,m,n;return _.I(function(p){switch(p.a){case 1:if(a.I)return p["return"](Promise.reject());c=[];for(d in a.a)e=new _.xk,f={start:function(q){q.resolve()}.bind(null,e),p:e},a.h[d].push(f),c.push(e),1===a.h[d].length&&f.start();_.D(p,2);return _.y(p,Promise.all(c),4);case 4:_.Jh(p,3);break;case 2:g=_.H(p);for(h in a.a)a.h[h].length&&a.h[h].shift();return p["return"](Promise.reject(g));case 3:for(l in a.a);_.D(p,5,6);return _.y(p,b(),6);case 6:_.Kh(p);for(m in a.a)HH(a,
95
95
  m);_.Lh(p);break;case 5:return n=_.H(p),p["return"](Promise.reject(new _.O(_.P,3,3015,{mediaError:n})))}})};HH=function(a,b){a.h[b].shift();GH(a,b)};
96
96
  OH=function(a,b,c,d){var e=a.periods.flatMap(function(n){return n.variants}),f=e;if(b.length||c.length)f=JH(f,b,c);f=KH(f,d);if(1<a.periods.length&&e.some(function(n){return null!=n.audio})){var g=function(n){n=n.split(".");var p=n[0];1<n.length&&(p+="."+n[1]);return p.toLowerCase()};b=[];c=_.w(a.periods);for(e=c.next();!e.done;e=c.next()){d=new Set;e=_.w(e.value.variants);for(var h=e.next();!h.done;h=e.next())h=h.value,null!==h.audio&&d.add(g(h.audio.codecs));b.push(d)}var l=b[0];c={};for(d=1;d<
@@ -122,14 +122,14 @@ b.D.setPlaybackRate(b.a.chasingRate,_.ce)):1<e&&c<=f&&(b.g.debug("On live edge,
122
122
  sI=function(a){return 1>=a.a.chasingRate?(a.g.warn("chasingRate must be greater than 1."),!1):a.a.chaseJumpDistance<=a.a.startChasingAt?(a.g.warn("chaseJumpDistance must be greater than startChasingAt."),!1):a.a.startChasingAt<=a.a.stopChasingAt?(a.g.warn("startChasingAt must be greater than stopChasingAt."),!1):0>a.a.stopChasingAt?(a.g.warn("stopChasingAt must be greater than or equal to 0."),!1):!0};
123
123
  vI=function(a,b,c,d,e){this.j=a;this.C=c;this.a={};this.G={};this.M=!1;this.f=null;this.h={};this.l=new _.wi;this.K=!1;this.w={};this.I=b;this.B=d;this.J=e;this.U=this.J.streaming.maxSegmentToMediaOffset||1;this.L=new _.xk;this.A="";this.H={};this.o=uI(this,this.L);this.P=!0;this.g=new _.K("clpp.mse.MediaSourceEngineSmooth")};
124
124
  uI=function(a,b){if(window.ManagedMediaSource){a.j.disableRemotePlayback=!0;var c=new ManagedMediaSource;a.l.one(c,kE,function(){URL.revokeObjectURL(a.A);b.resolve()});a.l.on(c,lE,function(){a.P=!0});a.l.on(c,"endstreaming",function(){a.P=!1});a.A=wI(c);a.j.src=a.A;return c}c=new MediaSource;a.A=wI(c);a.l.one(c,kE,function(){URL.revokeObjectURL(a.A);b.resolve()});a.j.src=a.A;return c};
125
- xI=function(a,b){b.forEach(function(c,d){var e=a.o.addSourceBuffer(c);a.l.on(e,_.Ae,a.Vk.bind(a,d));a.l.on(e,oE,a.Fc.bind(a,d));a.a[d]=e;a.G[d]=c;a.h[d]=[];a.H[d]=!1});a.M=b.has(_.dd)&&b.has(_.r)};yI=function(a,b){try{return new _.zm(a.a[b].buffered,b)}catch(c){return b in a.a&&a.g.error($D+b,c),null}};zI=function(a,b){if(!a.a[b])return"";var c=yI(a,b);return c?c.toString():""};
125
+ xI=function(a,b){b.forEach(function(c,d){var e=a.o.addSourceBuffer(c);a.l.on(e,_.Ae,a.Uk.bind(a,d));a.l.on(e,oE,a.Fc.bind(a,d));a.a[d]=e;a.G[d]=c;a.h[d]=[];a.H[d]=!1});a.M=b.has(_.dd)&&b.has(_.r)};yI=function(a,b){try{return new _.zm(a.a[b].buffered,b)}catch(c){return b in a.a&&a.g.error($D+b,c),null}};zI=function(a,b){if(!a.a[b])return"";var c=yI(a,b);return c?c.toString():""};
126
126
  CI=function(a,b,c,d,e,f){return[f?Promise.resolve():AI(a,b,function(){try{a.g.debug(dD+b+SC);var g=a.a[b].appendWindowStart,h=a.a[b].appendWindowEnd;a.a[b].abort();a.a[b].appendWindowStart=g;a.a[b].appendWindowEnd=h}catch(l){throw a.g.warn(sD+b+SC,l),l;}a.g.debug(mD+b+SC);a.Fc(b)}),AI(a,b,function(){return BI(a,b,c)}),AI(a,b,function(){try{a.g.debug(KD+b,d,e),a.a[b].appendWindowStart=0,a.a[b].appendWindowEnd=e,a.a[b].appendWindowStart=d}catch(g){throw a.g.warn(wD+b,d,e,g),g;}a.g.debug(qD+b,d,e);a.Fc(b)})]};
127
127
  BI=function(a,b,c){0>c&&(c+=.001);try{a.g.debug(MD+b,c),a.a[b].timestampOffset=c}catch(d){throw a.g.warn(xD+b,c,d),d;}a.g.debug(rD+b,c);a.Fc(b)};AI=function(a,b,c){if(a.K)return Promise.reject();c={start:c,p:new _.xk};a.h[b].push(c);1===a.h[b].length&&DI(a,b);return c.p};DI=function(a,b){var c=a.h[b][0];if(c)try{a.g.debug(OD+b),c.start()}catch(d){d.name===GD?c.p.reject(new _.O(_.P,3,3017,{type:b})):c.p.reject(new _.O(_.P,3,3015,{mediaError:d})),EI(a,b)}else a.g.debug(CD+b)};
128
128
  FI=function(a,b){var c,d,e,f,g,h,l,m,n;return _.I(function(p){switch(p.a){case 1:if(a.K)return p["return"](Promise.reject());c=[];for(d in a.a)e=new _.xk,f={start:function(q){q.resolve()}.bind(null,e),p:e},a.h[d].push(f),c.push(e),1===a.h[d].length&&f.start();_.D(p,2);return _.y(p,Promise.all(c),4);case 4:_.Jh(p,3);break;case 2:g=_.H(p);for(h in a.a)a.h[h].length&&a.h[h].shift();return p["return"](Promise.reject(g));case 3:for(l in a.a);_.D(p,5,6);return _.y(p,b(),6);case 6:_.Kh(p);for(m in a.a)EI(a,
129
129
  m);_.Lh(p);break;case 5:return n=_.H(p),p["return"](Promise.reject(new _.O(_.P,3,3015,{mediaError:n})))}})};EI=function(a,b){a.h[b].shift();DI(a,b)};GI=function(a,b,c){return AI(a,b,function(){b===_.Q?a.g.debug("Change not supported for "+b):(a.g.debug("Change Type: "+a.G[b]+" -\x3e "+c),XE()?(a.a[b].changeType(c),a.G[b]=c):a.g.debug("Change Type not supported"),a.Fc(b))})};
130
130
  HI=function(a,b,c,d){var e,f,g,h,l;return _.I(function(m){return 1==m.a?(e=_.QE(_.El(a.G[b])),f=_.Dl(a.G[b]),g=_.Cl(c,d),h=_.QE(_.El(g)),l=_.Dl(g),e===h&&f===l?m["return"](!1):a.J.mediaSource.codecSwitchingStrategy===_.og&&XE()?_.y(m,GI(a,b,g),2):m.F(2)):m["return"](!0)})};II=function(a){this.h=a;this.a=null;this.f=function(){}};JI=function(a,b){a.f=b};
131
- KI=function(a){var b=this;this.f=a;this.o=this.A=this.l=!1;this.h=this.f.oi();this.w=_.ce;this.j=null;this.a=new _.mi(function(){b.A||b.f.Sm(.25*b.h)});this.g=new _.K("clpp.mse.media.PlayRateController")};LI=function(a,b){a.j=b;a.j.speedUpMode&&(a.w=a.j.speedUpMode)};
132
- OI=function(a,b){a.a.stop();a.l||(a.o=!1);var c=a.l?0:a.h;if((b?b:a.w)===_.ce||0===c||1===c)try{MI(a,c)}catch(d){a.g.warn('Set playbackRate using "decoder" mode fails, due to unsupported range by platform. Fallback to "seek" mode.',d),NI(a)}else NI(a)};NI=function(a){a.g.debug(LD,a.h,' using "seek" mode.');MI(a,0);a.o=!0;a.a.Kb(.25)};MI=function(a,b){if(a.f.oi()!==b){a.g.debug(LD,b,' using native playbackRate "decoder" mode.');try{a.f.yo(b)}catch(c){throw c;}}};
131
+ KI=function(a){var b=this;this.f=a;this.o=this.A=this.l=!1;this.h=this.f.oi();this.w=_.ce;this.j=null;this.a=new _.mi(function(){b.A||b.f.Rm(.25*b.h)});this.g=new _.K("clpp.mse.media.PlayRateController")};LI=function(a,b){a.j=b;a.j.speedUpMode&&(a.w=a.j.speedUpMode)};
132
+ OI=function(a,b){a.a.stop();a.l||(a.o=!1);var c=a.l?0:a.h;if((b?b:a.w)===_.ce||0===c||1===c)try{MI(a,c)}catch(d){a.g.warn('Set playbackRate using "decoder" mode fails, due to unsupported range by platform. Fallback to "seek" mode.',d),NI(a)}else NI(a)};NI=function(a){a.g.debug(LD,a.h,' using "seek" mode.');MI(a,0);a.o=!0;a.a.Kb(.25)};MI=function(a,b){if(a.f.oi()!==b){a.g.debug(LD,b,' using native playbackRate "decoder" mode.');try{a.f.xo(b)}catch(c){throw c;}}};
133
133
  QI=function(a){function b(){d=!0}function c(m){f.push(m);_.En(m)}a=_.bk(a);var d=!1,e,f=[],g=[];(new _.Dn).N(_.cf,c).N(_.Jg,c).N(_.Ye,c).N(_.bf,c).N(_.tg,c).aa(_.vg,function(m){e=m;f.push(m);_.Fn(m)}).aa("encv",b).aa("enca",b).aa("avc1",function(m){g.push({N:m,Bd:1701733238})}).aa("avc3",function(m){g.push({N:m,Bd:1701733238})}).aa("ac-3",function(m){g.push({N:m,Bd:1701733217})}).aa(_.we,function(m){g.push({N:m,Bd:1701733217})}).aa("mp4a",function(m){g.push({N:m,Bd:1701733217})}).parse(a);if(d)return _.bi("Init segment already indicates encryption."),
134
134
  a;if(0===g.length||!e)throw _.di("Failed to find boxes needed to fake encryption!"),_.di("Failed init segment (hex):",_.cn(a)),new _.O(_.P,3,14E3);g.reverse();for(var h=_.w(g),l=h.next();!l.done;l=h.next())l=l.value,_.bi('Inserting "'+_.In(l.Bd)+'" box into init segment.'),a=PI(a,e,l.N,f,l.Bd);return a};
135
135
  PI=function(a,b,c,d,e){var f=RI.value(),g=a.subarray(c.start,c.start+c.size),h=_.ik(g),l=new Uint8Array(c.size+f.byteLength);l.set(g,0);g=_.ik(l);g.setUint32(4,e);l.set(f,c.size);e=h.getUint32(4);g.setUint32(c.size+16,e);SI(l,0,l.byteLength);e=new Uint8Array(a.byteLength+l.byteLength);c=_.Hl("Xbox One")||_.Gl()?c.start:c.start+c.size;f=a.subarray(c);e.set(a.subarray(0,c));e.set(l,c);e.set(f,c+l.byteLength);a=_.w(d);for(d=a.next();!d.done;d=a.next())d=d.value,SI(e,d.start,d.size+l.byteLength);l=_.ik(e,
@@ -150,15 +150,15 @@ DJ=function(a,b,c){if(!b.jc)return!1;var d=a.D.Qb(),e=a.D.X.la(b.type);c=(c=EJ(a
150
150
  kJ=function(a,b){var c,d;return _.I(function(e){c=rJ(b);if(b.Dc)return a.g.debug(c,"clear: already clearing the buffer"),e["return"]();if(b.nc)return a.g.debug(c,"clear: already waiting"),e["return"]();if(b.Fb)return a.g.debug(c,"clear: currently updating"),b.nc=!0,b.Te=0,e["return"]();d=b.type;if(null==a.D.X.Ua(d))return a.g.debug(c,"clear: nothing buffered"),null==b.vb&&cJ(a,b,0),e["return"]();a.g.debug(c,"clear: handling right now");eJ(b);return _.y(e,wJ(a,b,!1,0)["catch"](function(f){if(a.D)a.D.onError(f)}),
151
151
  0)})};
152
152
  mJ=function(a,b,c,d,e){var f,g,h,l,m,n,p;return _.I(function(q){if(1==q.a){f=a.D.Qb();g=aJ(a,f);if(null==g)return a.g.warn("Cannot initialize streams, period not found at",f),q["return"]();h=_.er;l=new Map;m=new Set;b&&(l.set(h.AUDIO,b),m.add(b));c&&(l.set(h.VIDEO,c),m.add(c));d&&(l.set(h.TEXT,d),m.add(d));n=a.D.X;p=a.h.forceNativeTS;return _.y(q,n.init(l,p,a.h.disableAudioTracks),2)}if(3!=q.a){if(a.f)return q["return"]();oJ(a);return _.y(q,$I(a,m),3)}if(a.f)return q["return"]();l.forEach(function(t,v){if(!a.a.has(v)){var z=
153
- bJ(t,g,e);a.a.set(v,z);cJ(a,z,0)}});_.C(q)})};bJ=function(a,b,c){return{stream:a,type:a.type,qc:null,segmentIterator:null,ta:null,vc:null,pf:!0,hc:b,endOfStream:!1,Fb:!1,vb:null,nc:!1,Te:0,Gf:!1,Dc:!1,Kg:!1,wd:!1,rj:c||0,jc:null,Ze:!1,Ki:0}};GJ=function(a){a.g.debug("(all) setupAllPeriods_");a.j.periods.map(function(b){return b.id}).forEach(function(b){FJ(a,b)["catch"](FE)})};
153
+ bJ(t,g,e);a.a.set(v,z);cJ(a,z,0)}});_.C(q)})};bJ=function(a,b,c){return{stream:a,type:a.type,qc:null,segmentIterator:null,ta:null,vc:null,pf:!0,hc:b,endOfStream:!1,Fb:!1,vb:null,nc:!1,Te:0,Gf:!1,Dc:!1,Kg:!1,wd:!1,qj:c||0,jc:null,Ze:!1,Ki:0}};GJ=function(a){a.g.debug("(all) setupAllPeriods_");a.j.periods.map(function(b){return b.id}).forEach(function(b){FJ(a,b)["catch"](FE)})};
154
154
  FJ=function(a,b){var c=a.B.get(b);if(c)return a.g.debug("(all) Period "+b+UC),c;a.g.debug("(all) setting up Period "+b);var d=new _.xk;a.B.set(b,d);var e=new Set;c=VI(a,b);for(var f=_.w(c.variants),g=f.next();!g.done;g=f.next())g=g.value,g.video&&e.add(g.video),g.video&&g.video.trickModeVideo&&e.add(g.video.trickModeVideo),g.audio&&e.add(g.audio);c=_.w(c.textStreams);for(f=c.next();!f.done;f=c.next())e.add(f.value);a.H=a.H.then(function(){return a.f?null:$I(a,e)}).then(function(){a.f||(d.resolve(),
155
155
  a.g.debug("(all) setup Period "+b))})["catch"](function(h){a.f||(d["catch"](function(){}),d.reject(),a.B["delete"](b),a.g.warn("(all) failed to setup Period "+b),a.D.onError(h))});return d};
156
156
  $I=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,v;return _.I(function(z){switch(z.a){case 1:c=[];d=_.w(b);for(e=d.next();!e.done;e=d.next())f=e.value,(g=a.w.get(f.id))?(a.g.debug("(all) Stream "+f.id+UC),c.push(g)):(a.g.debug("(all) setting up Stream "+f.id),a.w.set(f.id,new _.xk),h=a.D.Eb,c.push(f.createSegmentIndex(h)));_.D(z,2);return _.y(z,Promise.all(c),4);case 4:if(a.f)return z["return"]();_.Jh(z,3);break;case 2:l=_.H(z);if(a.f)return z["return"]();m=_.w(b);for(e=m.next();!e.done;e=m.next())if(n=
157
157
  e.value,p=a.w.get(n.id))p["catch"](function(){}),p.reject(),a.w["delete"](n.id);throw l;case 3:q=_.w(b);for(e=q.next();!e.done;e=q.next())t=e.value,(v=a.w.get(t.id))&&!v.done&&(v.resolve(),a.g.debug("(all) setup Stream "+t.id));_.C(z)}})};oJ=function(a){var b=a.j.presentationTimeline.getDuration();Infinity>b?a.D.X.eg(b):a.D.X.eg(Math.pow(2,32))};
158
158
  JJ=function(a,b){function c(n){return n.type===_.Q&&n.stream.mimeType===_.Wc}if(c(b))return a.D.X.Gh(b.stream.originalId||""),null;b.type===_.Q&&a.D.X.yh();if(!a.D.X.Gi()&&b.type!==_.Q)return a.h.bufferLimitUpdateInterval?a.h.bufferLimitUpdateInterval/2:.5;var d=rJ(b),e=a.D.Qb(),f=CJ(a,b,e);a.g.debug(d,"timeNeeded\x3d"+f);var g=a.D.X.Ga(b.type,e);a.g.debug(d,"update_:",gE+e,"bufferedAhead\x3d"+g);var h=Math.max(a.j.minBufferTime||0,a.h.rebufferingGoal,a.h.bufferingGoal)*a.l,l=uF(a.j.presentationTimeline);
159
159
  if(null!=l&&f>=l&&!b.Ze)return HJ(a,b),null;b.endOfStream=!1;l=zJ(a,b.stream).id;var m=aJ(a,f);null!=m&&(b.hc=m);if(m!==l)return a.g.debug(d,"need Period "+m,gE+e,"timeNeeded\x3d"+f,"currentPeriodId\x3d"+l),null;if(g>=h)return a.g.debug(d,"buffering goal met"),a.h.bufferLimitUpdateInterval||.5;g=a.D.X.la(b.type);g=EJ(a,b,e,g,l);if(!g)return a.j.presentationTimeline.isLive()||b.type===_.Q?a.h.bufferLimitUpdateInterval||1:(a.g.debug("Media state "+d+": no next segment found. Assuming EOS."),HJ(a,b),
160
- null);d=Infinity;h=_.w(a.a.values());for(m=h.next();!m.done;m=h.next())m=m.value,c(m)||(m=CJ(a,m,e),d=Math.min(d,m));if(f>=d+a.j.presentationTimeline.h)return a.h.bufferLimitUpdateInterval||1;b.rj=0;IJ(a,b,e,l,g)["catch"](function(){});return null};HJ=function(a,b){a.g.debug(rJ(b),"buffered to end of presentation");b.endOfStream=!0;if(b.type===_.r){var c=a.a.get(_.Q);c&&c.stream.mimeType===_.Wc&&(c.endOfStream=!0)}};
161
- CJ=function(a,b,c){return b.qc&&b.ta?zJ(a,b.qc).startTime+b.ta.endTime:Math.max(c,b.rj)};
160
+ null);d=Infinity;h=_.w(a.a.values());for(m=h.next();!m.done;m=h.next())m=m.value,c(m)||(m=CJ(a,m,e),d=Math.min(d,m));if(f>=d+a.j.presentationTimeline.h)return a.h.bufferLimitUpdateInterval||1;b.qj=0;IJ(a,b,e,l,g)["catch"](function(){});return null};HJ=function(a,b){a.g.debug(rJ(b),"buffered to end of presentation");b.endOfStream=!0;if(b.type===_.r){var c=a.a.get(_.Q);c&&c.stream.mimeType===_.Wc&&(c.endOfStream=!0)}};
161
+ CJ=function(a,b,c){return b.qc&&b.ta?zJ(a,b.qc).startTime+b.ta.endTime:Math.max(c,b.qj)};
162
162
  EJ=function(a,b,c,d,e){if(null==e)return a.g.warn(iD),null;if(b.stream.segmentLookupStrategy===_.bE)b.stream.segmentIterator?a=LF(b.stream.segmentIterator):b.ta||d?(c=b.ta?b.ta.endTime:d,a.g.info(zD,"looking up segment from new stream endTime:",c),b.stream.segmentIterator=PF(b.stream.segmentIndex,c),e=b.stream.segmentIterator.next().value,null===e&&(b.stream.segmentIterator=null,a.g.warn(zD,WD,"endTime:",c,b.ta)),a=e):(e=VI(a,e),e=Math.max(0,c-e.startTime),a.g.info(zD,"looking up segment","lookupTime:",
163
163
  e,fE,c),d=null,d||(b.stream.segmentIterator=PF(b.stream.segmentIndex,e),d=b.stream.segmentIterator.next().value),null===d&&a.g.warn(zD,WD,"lookupTime:",e,fE,c),a=d);else{var f=rJ(b);if(b.ta&&b.stream===b.qc)c=b.ta.position+1,a.g.debug(f,"next position known:","position\x3d"+c),a=KJ(a,b,e,c);else{if(b.ta){a.g.debug(f,"next position unknown: another Stream buffered");f=zJ(a,b.qc);var g=LJ(a,b,f.startTime+b.ta.endTime,e)}else a.g.debug(f,"next position unknown: nothing buffered"),g=LJ(a,b,d||c,e);if(null==
164
164
  g)a=null;else if(f=KJ(a,b,e,g),null==f)a=null;else{var h=null==a.h?!1:a.h.ignoreDrift;null!=d||h||(d=f,d.Ja+d.startTime+2>c&&(a=KJ(a,b,e,Math.max(0,g-1)))&&(f=a));a=f}}}return a};LJ=function(a,b,c,d){var e=rJ(b);d=VI(a,d);var f=Math.max(0,c-d.startTime);b=b.stream.findSegmentPosition(f);a.g.debug(e,"Looked up segment:",gE+c,"lookupTime\x3d"+f,YD+d.startTime,"Result: segment position\x3d"+b);null==b&&a.g.warn(e,"cannot find segment:",YD+d.startTime,"lookupTime\x3d"+f);return b};
@@ -169,30 +169,30 @@ B.code?a.g.warn(g,"Text stream failed to download. Proceeding without it."):a.g.
169
169
  _.O&&B.a(1),eJ(b),a.D.onError(new _.O(1,2,2010,B)),F.F(0);if(1001<=B.code&&1003>=B.code)return _.y(F,TJ(a,b,h,B),0);a.g.error(g,"failed fetch and append: code\x3d"+B.code);b.wd=!0;B instanceof _.O&&B.a(_.P);return _.y(F,UJ(a,B),0)})});_.C(G)})};
170
170
  SJ=function(a,b,c){var d=rJ(b);if(Array.from(a.a.values()).some(function(f){return f!==b&&f.Kg}))a.g.debug(d,BD,"waiting for another stream to recover...");else{var e=Math.round(100*a.l);if(20<e)a.l-=.2;else if(4<e)a.l-=.04;else{a.g.error(d,"MediaSource threw QuotaExceededError too many times");b.wd=!0;a.o=!0;a.D.onError(c);return}a.g.warn(d,BD,"reducing buffering goals by "+(100-Math.round(100*a.l))+"%");b.Kg=!0}cJ(a,b,4)};
171
171
  TJ=function(a,b,c,d){var e,f;return _.I(function(g){e=1001===d.code&&500<=d.data.status;f=!0;e||(f=!a.D.Wf(b.stream,c));if(!f)return g.F(0);b.wd=!0;d.a(_.P);return _.y(g,UJ(a,d),0)})};
172
- NJ=function(a,b,c,d,e,f){var g,h,l,m,n,p,q;return _.I(function(t){g=c.startTime-f.Ja;h=b.pf||f.initSegment!==(b.ta&&b.ta.initSegment);if(!h&&g===b.Ki)return t["return"](Promise.resolve());b.Ki=g;l=rJ(b);a.g.debug(l,"setting timestamp offset to "+g);a.g.debug(l,"setting append window start to "+d);a.g.debug(l,"setting append window end to "+e);m=a.D.X.tj(b.type,g,d,e,b.stream.mimeType,b.stream.codecs);if(!b.stream.initSegmentReference||!h)return t["return"](m);a.g.debug(l,"fetching init segment");
172
+ NJ=function(a,b,c,d,e,f){var g,h,l,m,n,p,q;return _.I(function(t){g=c.startTime-f.Ja;h=b.pf||f.initSegment!==(b.ta&&b.ta.initSegment);if(!h&&g===b.Ki)return t["return"](Promise.resolve());b.Ki=g;l=rJ(b);a.g.debug(l,"setting timestamp offset to "+g);a.g.debug(l,"setting append window start to "+d);a.g.debug(l,"setting append window end to "+e);m=a.D.X.sj(b.type,g,d,e,b.stream.mimeType,b.stream.codecs);if(!b.stream.initSegmentReference||!h)return t["return"](m);a.g.debug(l,"fetching init segment");
173
173
  n=f&&f.initSegment||b.stream.initSegmentReference;p=PJ(a,b,n,!0);q=p.then(function(v){if(a.f)return null;a.g.debug(l,"appending init segment");return VJ(a,v,b).then(function(){return a.D.X.Ve(b.type,v,null,null,!!b.stream.closedCaptions&&0<b.stream.closedCaptions.size)})})["catch"](function(v){b.pf=!0;return Promise.reject(v)});return t["return"](Promise.all([m,q]))})};
174
174
  VJ=function(a,b,c){var d;return _.I(function(e){if(!a.h.patchEdgeWhenMixedContent||!_.Gl())return e.F(0);d=QI(b);return _.y(e,a.D.X.Ve(c.type,d.buffer,null,null,!!c.stream.closedCaptions&&0<c.stream.closedCaptions.size),0)})};
175
175
  OJ=function(a,b,c,d,e,f,g,h){h=void 0===h?!1:h;var l,m,n,p,q,t,v,z;return _.I(function(A){switch(A.a){case 1:l=rJ(b);if(!(e&&e.keyId&&a.D.Zd)){A.F(2);break}m=wE(a.D.Zd,e.keyId);if(!m){a.g.warn("Unable to find DRM session for "+e.keyId);A.F(2);break}_.D(A,4);return _.y(A,m,6);case 6:_.Jh(A,2);break;case 4:_.H(A),a.g.warn("DRM session load failed, cannot append segment!");case 2:if(!(e.encrypted&&e.keyId&&a.D.Zd&&yE(a.D.Zd,e.keyId))){A.F(7);break}eJ(b);n=zJ(a,e).id;p=WJ(a,n);if(!p){A.F(8);break}return _.y(A,
176
- p,8);case 8:return q=a.D.Wf(e,d,cE),t=f.startTime+d.startTime,v=f.endTime+d.startTime,a.g.warn(l,"Blocked append for "+t+" - "+v+": "+q+". Stream with Key ID "+(e.keyId+" has restrictions.")),A["return"](Promise.resolve());case 7:return z=e.closedCaptions&&0<e.closedCaptions.size,null!=e.emsgSchemeIdUris&&0<e.emsgSchemeIdUris.length&&(new _.Dn).aa("emsg",a.On.bind(a,d,f,e.emsgSchemeIdUris)).parse(g),A["return"](XJ(a,b,c).then(function(){if(a.f)return null;var E=f.startTime+d.startTime,G=f.endTime+
176
+ p,8);case 8:return q=a.D.Wf(e,d,cE),t=f.startTime+d.startTime,v=f.endTime+d.startTime,a.g.warn(l,"Blocked append for "+t+" - "+v+": "+q+". Stream with Key ID "+(e.keyId+" has restrictions.")),A["return"](Promise.resolve());case 7:return z=e.closedCaptions&&0<e.closedCaptions.size,null!=e.emsgSchemeIdUris&&0<e.emsgSchemeIdUris.length&&(new _.Dn).aa("emsg",a.Nn.bind(a,d,f,e.emsgSchemeIdUris)).parse(g),A["return"](XJ(a,b,c).then(function(){if(a.f)return null;var E=f.startTime+d.startTime,G=f.endTime+
177
177
  d.startTime;a.g.debug(l,"Appending segment with "+(E.toFixed(3)+" - "+G.toFixed(3)+" KeyID: ")+(e.keyId+" Width: ")+(e.width+" Height: "+e.height+" Bitrate: ")+(_.T.Vf(e.bandwidth)+" Fragment: ")+h);return a.D.X.Ve(b.type,g,E,G,z,e.id,h,e.type===_.r&&null!=e.muxedAudioId&&!a.A)}).then(function(){a.f||(a.g.debug(l,"appended media segment"),b.qc=e,b.ta=f)}))}})};
178
178
  QJ=function(a,b,c,d,e){if(!a.j.presentationTimeline.isLive()&&b.type!==_.Q){var f=rJ(b),g=(a.D.X.la(b.type)||0)-c,h=d.endTime-d.startTime;c=g-h;if(Math.abs(c)>=Math.min(.01,h)&&Math.abs(c)<=Math.min(1,h))for(a.g.debug(f,"Adjusted segment",d.position,"with real duration",g,"and accounted for",c,"delta between segment duration and real duration"),b.Ze=!0,a=a.j.periods,e.adjustSegmentDurations(d.position,c),d=hF(a,e),b=a[d],e=e.getDuration(),jF(b,e),e=d+1;e<a.length;e++)a[e].startTime+=c}};
179
179
  YJ=function(a,b,c){(new _.Dn).N(_.cf,_.En).N(_.Jg,_.En).N(_.Ye,_.En).N(_.bf,_.En).N(_.tg,_.En).aa(_.vg,_.Fn).N("encv",function(d){d.reader.skip(78);_.En(d)}).N(_.ng,_.En).N("schi",_.En).N("tenc",function(d){d.reader.skip(6);if(_.wn(d.reader)){d.reader.skip(1);var e=_.cn(_.Cn(d.reader,16));e!==b.stream.keyId&&(a.g.debug(rJ(b),"Key id from tenc mismatches with key id from manifest. Switching from "+(b.stream.keyId+" to "+e+".")),b.stream.keyId=e)}d.parser.stop()}).parse(c)};
180
180
  XJ=function(a,b,c){if(a.f)return Promise.resolve();var d=rJ(b);a.g.debug(d,"checking buffer length");var e=Math.max(a.h.bufferBehind,a.j.presentationTimeline.h),f=a.D.X.Ua(b.type);if(null==f)return a.g.debug(d,"buffer behind okay because nothing buffered:",gE+c,TD+e),Promise.resolve();var g=c-f,h=g-e;if(.01>=h)return a.g.debug(d,"buffer behind okay:",gE+c,UD+g,TD+e,"underflow\x3d"+Math.abs(h)),Promise.resolve();a.g.debug(d,"buffer behind too large:",gE+c,UD+g,TD+e,"overflow\x3d"+h);return a.D.X.remove(b.type,
181
- f,f+h).then(function(){a.f||a.g.debug(d,"evicted "+h+WC)})};RJ=function(a,b,c){if(!a.C){b=rJ(b);var d=Array.from(a.a.values());1!==d.length||d[0].type!==_.Q?a.C=d.every(function(e){return e.type===_.Q||a.G?!0:!e.nc&&!e.Dc&&e.ta}):a.G&&(a.C=!0);a.C&&(a.g.debug(b,"startup complete"),c=zJ(a,c).id,MJ(a,c),WJ(a,c))}};WJ=function(a,b){var c=null;a.B.has(b)||(c=FJ(a,b).then(function(){a.f||(a.g.debug(VD),a.D.wg())})["catch"](FE));GJ(a);a.D.In&&(a.g.debug("calling onStartupComplete()..."),a.D.In());return c};
182
- ZJ=function(a,b){var c=rJ(b),d=zJ(a,b.stream).id;if(b.hc!==d){var e=b.hc,f=Array.from(a.a.values());f.every(function(g){return g.hc===e})?f.every(sJ)?(a.g.debug(c,"all need Period "+e),FJ(a,e).then(function(){if(!a.f)if(a.D.X.qj(),f.every(function(n){var p=sJ(n),q=zJ(a,n.stream).id;return p&&n.hc===e&&q!==e})){var g=VI(a,e);a.g.debug(c,"Streaming period",e,g);a.g.debug(c,"calling onChooseStreams()...");var h=a.D.xg(g);a.G=!h.audio&&!h.video&&!!h.text;var l=new Map;h.video&&l.set(_.r,h.video);h.audio&&
181
+ f,f+h).then(function(){a.f||a.g.debug(d,"evicted "+h+WC)})};RJ=function(a,b,c){if(!a.C){b=rJ(b);var d=Array.from(a.a.values());1!==d.length||d[0].type!==_.Q?a.C=d.every(function(e){return e.type===_.Q||a.G?!0:!e.nc&&!e.Dc&&e.ta}):a.G&&(a.C=!0);a.C&&(a.g.debug(b,"startup complete"),c=zJ(a,c).id,MJ(a,c),WJ(a,c))}};WJ=function(a,b){var c=null;a.B.has(b)||(c=FJ(a,b).then(function(){a.f||(a.g.debug(VD),a.D.wg())})["catch"](FE));GJ(a);a.D.Hn&&(a.g.debug("calling onStartupComplete()..."),a.D.Hn());return c};
182
+ ZJ=function(a,b){var c=rJ(b),d=zJ(a,b.stream).id;if(b.hc!==d){var e=b.hc,f=Array.from(a.a.values());f.every(function(g){return g.hc===e})?f.every(sJ)?(a.g.debug(c,"all need Period "+e),FJ(a,e).then(function(){if(!a.f)if(a.D.X.pj(),f.every(function(n){var p=sJ(n),q=zJ(a,n.stream).id;return p&&n.hc===e&&q!==e})){var g=VI(a,e);a.g.debug(c,"Streaming period",e,g);a.g.debug(c,"calling onChooseStreams()...");var h=a.D.xg(g);a.G=!h.audio&&!h.video&&!!h.text;var l=new Map;h.video&&l.set(_.r,h.video);h.audio&&
183
183
  l.set(_.dd,h.audio);h.text&&l.set(_.Q,h.text);var m=_.w(a.a.keys());for(h=m.next();!h.done;h=m.next())if(h=h.value,!l.has(h)&&h!==_.Q){a.g.error(c,"invalid Streams chosen: missing "+h+" Stream");a.D.onError(new _.O(_.P,5,5005));return}m=_.w(Array.from(l.keys()));for(h=m.next();!h.done;h=m.next())if(h=h.value,!a.a.has(h))if(h===_.Q)mJ(a,null,null,l.get(_.Q),g.startTime),l["delete"](h);else{a.g.error(c,"invalid Streams chosen: unusable "+h+" Stream");a.D.onError(new _.O(_.P,5,5005));return}g=_.w(Array.from(a.a.keys()));
184
184
  for(h=g.next();!h.done;h=g.next())h=h.value,(m=l.get(h))?(_.iJ(a,m,!1,0),cJ(a,a.a.get(h),0)):a.a["delete"](h);a.g.debug(c,VD);a.D.wg()}else a.g.debug(c,"ignoring transition to Period",e,"since another is happening")})["catch"](FE)):a.g.debug(c,"all MediaStates need Period "+e+", but not all MediaStates are idle"):a.g.debug(c,"not all MediaStates need Period "+e)}};aJ=function(a,b){var c=fF(a.j.periods,b+_.sw);return c?c.id:null};
185
185
  zJ=function(a,b){var c=a.j.periods,d=hF(c,b);c=c[d];if(!c)throw new _.O(_.P,5,5006,"No period found for stream with ID "+b.id+".");return c};$J=function(a,b){if(a.D.pd){var c=b.Ta;if(c)return _.AG(a.D.pd,c.id)}return null};aK=function(a,b,c){if(a.D.pd&&b){c&&0===c.request.uriIndex||_.BG(a.D.pd,b.ka[0].serviceLocationId);var d=c.request,e=c.timeMs;c=c.data.byteLength;e&&c&&(a=_.zG(a.D.pd,b.ka[d.uriIndex].serviceLocationId),_.sG(a.Uf,e,c),a.Ae=!0)}};
186
- PJ=function(a,b,c,d,e){d=void 0===d?!1:d;e=void 0===e?null:e;var f=[],g=$J(a,c);g&&(f=_.vG(g,c.ye));f.length||(f=c.eb());f=_.nF(f,c.Da,c.pa,a.h.attemptParameters,c.startTime,c.endTime,b.type,c.timescale);f.type=2;f.onFragment=c.sd?null:e;f.disableFragmentSupport=c.sd||a.h.disableFragmentSupport;f.disableMergedFragments=a.h.disableMergedFragments;if(e=c.f())f.keyInfo=e,f.onFragment=null;d&&(f.responseModifiers.push(function(h){YJ(a,b,h.data)}),b.type===_.r&&a.h.overridePasp&&f.responseModifiers.push(a.Qo.bind(a)));
186
+ PJ=function(a,b,c,d,e){d=void 0===d?!1:d;e=void 0===e?null:e;var f=[],g=$J(a,c);g&&(f=_.vG(g,c.ye));f.length||(f=c.eb());f=_.nF(f,c.Da,c.pa,a.h.attemptParameters,c.startTime,c.endTime,b.type,c.timescale);f.type=2;f.onFragment=c.sd?null:e;f.disableFragmentSupport=c.sd||a.h.disableFragmentSupport;f.disableMergedFragments=a.h.disableMergedFragments;if(e=c.f())f.keyInfo=e,f.onFragment=null;d&&(f.responseModifiers.push(function(h){YJ(a,b,h.data)}),b.type===_.r&&a.h.overridePasp&&f.responseModifiers.push(a.Po.bind(a)));
187
187
  a.g.debug("fetching: reference\x3d",c);c=a.D.Eb.fetch(f);b.jc=c;return c.T.then(function(h){var l=a.D.ee(),m=h.timeMs,n=h.data.byteLength;m&&n&&!d&&l.segmentDownloaded(m,n);aK(a,g,h);b.jc=null;return h.data})["catch"](function(h){aK(a,g);throw h;})};
188
188
  wJ=function(a,b,c,d){var e,f,g,h;return _.I(function(l){if(1==l.a)return e=rJ(b),b.nc=!1,b.Gf=!1,b.Te=0,b.Dc=!0,b.stream.segmentIterator=null,a.g.debug(e,"clearing buffer"),d?(g=a.D.Qb(),h=a.D.X.getDuration(),f=a.D.X.remove(b.type,g+d,h)):f=a.D.X.clear(b.type).then(function(){return!a.f&&c?a.D.X.flush(b.type):null}),_.y(l,f,2);if(a.f)return l["return"]();a.g.debug(e,"cleared buffer");b.qc=null;b.ta=null;b.Dc=!1;b.endOfStream=!1;b.Ze=!1;cJ(a,b,0);_.C(l)})};
189
189
  cJ=function(a,b,c){a.g.debug(rJ(b),"updating in "+c+WC);b.vb=(new _.ji(function(){var d;return _.I(function(e){if(1==e.a)return _.D(e,2),_.y(e,a.ic(b),4);if(2!=e.a)return _.Jh(e,0);d=_.H(e);if(a.D)a.D.onError(d);_.C(e)})})).fa(c)};eJ=function(a){null!=a.vb&&(a.vb.stop(),a.vb=null)};VI=function(a,b){var c=a.j.periods.find(function(d){return d.id===b})||null;if(!c)throw new _.O(_.P,5,5006,"Period "+b+" not found");return c};
190
- MJ=function(a,b){var c=a.j.periods.findIndex(function(d){return d.id===b});return 0>c?null:a.j.periods[c+1]||null};fJ=function(a){return _.I(function(b){return a.jc?_.y(b,a.jc.abort(),0):b.F(0)})};UJ=function(a,b){var c;return _.I(function(d){switch(d.a){case 1:if(a.f)return d["return"]();if(!a.D.wj){d.F(2);break}_.D(d,3);return _.y(d,a.D.wj(b),5);case 5:_.Jh(d,2);break;case 3:c=_.H(d),c.cause=b,b=c;case 2:if(!b.f)a.D.onError(b);_.C(d)}})};rJ=function(a){return"("+a.type+":"+a.stream.id+")"};
190
+ MJ=function(a,b){var c=a.j.periods.findIndex(function(d){return d.id===b});return 0>c?null:a.j.periods[c+1]||null};fJ=function(a){return _.I(function(b){return a.jc?_.y(b,a.jc.abort(),0):b.F(0)})};UJ=function(a,b){var c;return _.I(function(d){switch(d.a){case 1:if(a.f)return d["return"]();if(!a.D.vj){d.F(2);break}_.D(d,3);return _.y(d,a.D.vj(b),5);case 5:_.Jh(d,2);break;case 3:c=_.H(d),c.cause=b,b=c;case 2:if(!b.f)a.D.onError(b);_.C(d)}})};rJ=function(a){return"("+a.type+":"+a.stream.id+")"};
191
191
  sJ=function(a){return!a.Fb&&null==a.vb&&!a.nc&&!a.Dc};bK=function(){this.a=null};
192
- eK=function(){_.Lm.call(this,XD);var a=this;this.I=cK;this.l=this.ja=null;this.dh=0;this.Aj=2;this.ed=null;this.Wg=!1;this.w=new _.wi;this.bd=this.gh=this.jf=this.J=this.dd=this.C=this.M=this.B=null;this.ke=!1;this.f=this.j=this.a=this.L=this.K=null;this.h=new _.$H;this.da=null;this.hh=1E9;this.nf=new Set;this.ga=!0;this.Ea=null;this.Cj=!1;this.Bj=0;this.ca=null;this.o=new eI;this.H=null;this.Lb=_.Hq;this.be=new kI(this.configuration.preferredAudioLanguage||[],this.configuration.preferredAudioRole,
192
+ eK=function(){_.Lm.call(this,XD);var a=this;this.I=cK;this.l=this.ja=null;this.dh=0;this.zj=2;this.ed=null;this.Wg=!1;this.w=new _.wi;this.bd=this.gh=this.jf=this.J=this.dd=this.C=this.M=this.B=null;this.ke=!1;this.f=this.j=this.a=this.L=this.K=null;this.h=new _.$H;this.da=null;this.hh=1E9;this.nf=new Set;this.ga=!0;this.Ea=null;this.Bj=!1;this.Aj=0;this.ca=null;this.o=new eI;this.H=null;this.Lb=_.Hq;this.be=new kI(this.configuration.preferredAudioLanguage||[],this.configuration.preferredAudioRole,
193
193
  this.configuration.preferredAudioChannelCount,this.configuration.preferSpatialAudio,this.configuration.mediaSource.codecSwitchingStrategy);this.Wd=this.configuration.preferredTextLanguage;this.A=new bI;this.ya=this.Zb=null;this.Wc=new Map;this.de=null;this.hf=this.configuration.preferredTextRole;this.Qd=this.configuration.preferForcedSubtitles;this.w.on(window,"online",function(){a.I===dK&&tJ(a.a)});this.rf=this.$d=this.yf=null;this.Y=_.qa;this.oe=new bK;this.$g=null};
194
194
  fK=function(a){return new _.ZE(function(b){var c=a.getTrackManager(),d=[];if(c){c=_.w(c.getVideoTracks());for(var e=c.next();!e.done;e=c.next())d.push.apply(d,_.vh(e.value.renditions))}return d.find(function(f){return f.id===b.toString()})||null})};
195
- gK=function(a,b){if(a.Lb!==b){var c=_.T.Jl;if(a.Lb===_.Sq&&b!==_.Hq)c=c(b,_.Qq),a.log.info(_.ED+c);else{var d=a.dh;d=0===d?0:Date.now()-d;var e=a.Lb;a.Lb=b;a.dh=Date.now();null!==a.J&&(a.J.A=b===_.Uq);a.H&&_.Aq(a.H.a,a.Lb);b===_.Mq&&(a.Aj=a.Ng?1:2);var f=a.Aj,g={currentState:a.Lb,previousState:e,timeSinceLastStateChangeMS:d,reason:b===_.Mq||e===_.Mq?f:void 0},h=c(e,_.Qq),l=c(b,_.Qq);c=b!==_.Mq?"":"["+c(f,_.Pq)+"]";a.log.info(_.Nb+h+" -\x3e "+(l+c));a.trigger(new _.L(_.rg,{detail:g}));(b===_.Oq||b===
195
+ gK=function(a,b){if(a.Lb!==b){var c=_.T.Il;if(a.Lb===_.Sq&&b!==_.Hq)c=c(b,_.Qq),a.log.info(_.ED+c);else{var d=a.dh;d=0===d?0:Date.now()-d;var e=a.Lb;a.Lb=b;a.dh=Date.now();null!==a.J&&(a.J.A=b===_.Uq);a.H&&_.Aq(a.H.a,a.Lb);b===_.Mq&&(a.zj=a.Ng?1:2);var f=a.zj,g={currentState:a.Lb,previousState:e,timeSinceLastStateChangeMS:d,reason:b===_.Mq||e===_.Mq?f:void 0},h=c(e,_.Qq),l=c(b,_.Qq);c=b!==_.Mq?"":"["+c(f,_.Pq)+"]";a.log.info(_.Nb+h+" -\x3e "+(l+c));a.trigger(new _.L(_.rg,{detail:g}));(b===_.Oq||b===
196
196
  _.Sq)&&a.bd&&a.bd.stop();b===_.Mq?a.trigger(new _.L(_.qd,{detail:{bufferedTimeMS:-1,reason:f}})):e===_.Mq&&a.trigger(new _.L(_.od,{detail:{bufferedTimeMS:d,reason:f}}))}}};hK=function(a){var b;return _.I(function(c){switch(c.a){case 1:b=a.A.a;if(!b){c.F(2);break}return _.y(c,b["catch"](function(){}),2);case 2:return _.y(c,_.Lm.prototype.release.call(a),4);case 4:return _.y(c,a.unload(),5);case 5:gK(a,_.Hq),_.C(c)}})};
197
197
  iK=function(a){var b=new _.dv;(a=a.playlist)&&a.cropTimeline&&(a.startTime||a.endTime)&&(b.h={start:a.startTime||null,end:a.endTime||null});return b};lK=function(a,b){var c,d;return _.I(function(e){a.Y===_.qa?jK(a,b.cues):a.Y===_.Ib?(a.f=XG(a.f,TG(b)),c=a.configuration.playlist.endTime,d=a.f.presentationTimeline.a.a,c&&d>c&&(a.log.info("Reached end of playlist. Turning timeline static."),a.j.requestStop(),a.j=null,_.tF(a.f.presentationTimeline,!0),a.trigger(new _.L(_.Re))),kK(a,a.f)):pJ(a.a,b);_.C(e)})};
198
198
  HK=function(a){return _.I(function(b){a.j.requestStop();a.j=null;a.Y===_.Ib?a.trigger(new _.L(_.gg)):a.trigger(new _.L(_.Re));_.C(b)})};
@@ -218,15 +218,15 @@ if(z.length){z=a.getPeriods();for(var E=0;E<z.length;E++)for(var G=z[E],B=_.w(G.
218
218
  e=b.periods.every(function(q){return q.variants.some(function(t){return t.drmInfos.some(function(v){return v.licenseServerUriOrigin===_.ZD})})});c.drmResolver&&(c.drm=c.drmResolver({hasLaurl:e}));f=c.drm;g=_.mn(f);d.f=g;h=f?f.offlineId||"":"";l=[];m=_.Wu(b.periods);if(!h){p.F(2);break}n=_.Nm(_.tf);if(!n){p.F(2);break}return _.y(p,n.l(a,m),4);case 4:return _.y(p,n.j(h),5);case 5:l=p.f;case 2:return _.y(p,_.zp(d,m,l),6);case 6:return a.B=d,jL(a,b.periods),_.np("initDrm.end"),_.pp("Init DRM","initDrm.start",
219
219
  "initDrm.end"),p["return"](d)}})};
220
220
  TK=function(a,b){var c,d,e,f,g,h,l,m,n,p;return _.I(function(q){if(1==q.a)return c=a.l,kL(a,c),lL(a,a.f.periods),a.be=new kI(a.configuration.preferredAudioLanguage||[],a.configuration.preferredAudioRole,a.configuration.preferredAudioChannelCount,a.configuration.preferSpatialAudio,a.configuration.mediaSource.codecSwitchingStrategy),a.Wd=a.configuration.preferredTextLanguage,a.hf=a.configuration.preferredTextRole,a.Qd=a.configuration.preferForcedSubtitles,_.y(q,_.Rp(a.B,c),2);if(3!=q.a)return dI(a.A,
221
- b),a.h.configure(a.configuration.abr),a.Ig&&a.h.setCmsdManager(a.Ig),a.h.init(function(t,v,z){var A,E,G;return _.I(function(B){if(1==B.a){if(a.ga)return B["return"]();A=mL(a).find(function(F){return F.id===t.id})||null;if(!A)return a.log.warn("No matching variant found for track switch"),B.F(0);E=rH(a);return _.y(B,a.j.loadVariant(A,E.id),3)}G=B.f;nL(a,G,v,z);_.C(B)})}),a.C=oL(a,c,a.configuration.startTime),a.dd=pL(a),a.J=new KI({oi:function(){return c.playbackRate},yo:function(t){c.playbackRate=
222
- t},Sm:function(t){c.currentTime+=t}}),LI(a.J,a.configuration.trickPlay),a.isLive()&&a.configuration.streaming.enableLiveEdgeChasing&&(a.jf=new tI(a)),d=Math.max(1E-4,a.configuration.streaming.rebufferingGoal),qL(a,d),dL(a)?PH(a.f,_.Vi(a.configuration.preferredVideoCodec),_.Vi(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount):OH(a.f,_.Vi(a.configuration.preferredVideoCodec),_.Vi(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount),e=rL(a),
221
+ b),a.h.configure(a.configuration.abr),a.Ig&&a.h.setCmsdManager(a.Ig),a.h.init(function(t,v,z){var A,E,G;return _.I(function(B){if(1==B.a){if(a.ga)return B["return"]();A=mL(a).find(function(F){return F.id===t.id})||null;if(!A)return a.log.warn("No matching variant found for track switch"),B.F(0);E=rH(a);return _.y(B,a.j.loadVariant(A,E.id),3)}G=B.f;nL(a,G,v,z);_.C(B)})}),a.C=oL(a,c,a.configuration.startTime),a.dd=pL(a),a.J=new KI({oi:function(){return c.playbackRate},xo:function(t){c.playbackRate=
222
+ t},Rm:function(t){c.currentTime+=t}}),LI(a.J,a.configuration.trickPlay),a.isLive()&&a.configuration.streaming.enableLiveEdgeChasing&&(a.jf=new tI(a)),d=Math.max(1E-4,a.configuration.streaming.rebufferingGoal),qL(a,d),dL(a)?PH(a.f,_.Vi(a.configuration.preferredVideoCodec),_.Vi(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount):OH(a.f,_.Vi(a.configuration.preferredVideoCodec),_.Vi(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount),e=rL(a),
223
223
  e.h=a.configuration.streaming,a.a=e,a.I=dK,_.y(q,e.start(),3);dI(a.A,b);a.configuration.streaming.startAtSegmentBoundary&&(f=iG(a.C),g=sL(a,f),bG(a.C.f,g));h=_.w(a.f.periods);for(l=h.next();!l.done;l=h.next())m=l.value,tL(a,m);hL(a);n=mL(a);p=n.some(function(t){return t.primary});a.configuration.preferredAudioLanguage||p||a.log.warn("No preferred audio language set. We will choose an arbitrary language initially");iL(a,n);_.C(q)})};
224
224
  kL=function(a,b){function c(d){a.l&&a.K&&(d.type===_.jg&&a.re?(a.K.a=qI,cL(a)):d.type===_.fh&&a.getState()===_.Vq&&.1>a.getBufferInfo().Ga(a.getMediaPosition())?(a.K.a=qI,cL(a)):a.K&&uL(a));vL(a)}a.w.on(b,_.Lf,c);a.w.on(b,_.sf,c);a.w.on(b,_.ze,c);a.w.on(b,_.jg,c);a.w.on(b,_.ig,c);a.w.on(b,_.Wf,c);a.w.on(b,_.fh,c);a.w.on(b,_.Yf,function(){if(a.l){var d=a.l.playbackRate;0!==d&&a.J.set(d)}})};
225
225
  fL=function(a){function b(d){return d.video&&d.audio||d.video&&d.video.codecs.includes(",")}if(a.some(function(d){return d.variants.some(b)})){_.ci("Found variant with audio and video content, so filtering out audio-only content in all periods.");a=_.w(a);for(var c=a.next();!c.done;c=a.next())c=c.value,c.variants=c.variants.filter(b)}};oL=function(a,b,c){return new gG(b,a.f,a.configuration.streaming,c,function(d){a.dd&&kG(a.dd,!0,d);a.a&&qJ(a.a)},function(d){return a.dispatchEvent(d)},a.Y===_.Ib)};
226
226
  pL=function(a){var b=new lG(a.l),c=new II(a.f);JI(c,function(){hL(a)});b.a.add(c);a.L&&(c=new nG(a.L),oG(c,function(d){d.uf&&d.uf();YK(a,_.Eg,d)},function(d){d.yg&&d.yg();YK(a,_.Fg,d)},function(d,e){e||(d.uf&&d.uf(),YK(a,_.Eg,d),d.yg&&d.yg(),YK(a,_.Fg,d))}),b.a.add(c));a.Y===_.Ib&&(c=new IF(a.$d,a.oe,function(d){return a.trigger(d)},a.configuration.playlist),b.a.add(c),a.rf=c);return b};qL=function(a,b){a.K=new rI(b,Math.min(.5,b/2));a.K.a=qI;cL(a);a.bd=(new _.mi(function(){uL(a)})).Kb(.25)};
227
- uL=function(a){switch(a.I){case dK:a:if(a.l.ended||a.M.We())var b=!0;else{if(a.isLive()){b=zF(a.f.presentationTimeline);var c=a.getBufferInfo();if(null!==c&&(c=c.la(),null!==c&&c>=b)){b=!0;break a}}b=!1}break;default:b=!1}if(a.M){var d=a.M.lg();c=d.video;d=d.audio;var e=a.l.currentTime;c&&d?(c=c.Ga(e),d=d.Ga(e),c=Math.min(c,d)):c=c?c.Ga(e):d?d.Ga(e):0}else c=0;if(d=a.K){d=a.K;var f=b,g=d.f.get(d.a);e=d.a;c=f||c>=g?pI:qI;d.a=c;d=e!==c}c=d;d=wL(a);c||a.getState()===_.Mq&&!d?(a.log.debug("Buffering state changed. Is buffering",
228
- d,"buffered to end",b,"state",a.getState()),cL(a)):a.ke&&vL(a)};rL=function(a){var b={configuration:{Hm:a.Y===_.Ib},Qb:function(){return iG(a.C)},X:a.M,Eb:a.getNetworkEngine(),pd:a.da,xg:a.Uk.bind(a),wg:a.Tk.bind(a),onError:a.onError.bind(a),Ti:a.qn.bind(a),onEvent:a.bg.bind(a),Yi:a.Po.bind(a),wf:a.Dn.bind(a),ee:function(){return a.h},Wf:a.Yj.bind(a),wj:a.Fo.bind(a),Zd:a.B};return new _.UI(a.f,b)};
229
- gH=function(a){if(!a.f||!a.C)return[];var b=xL(a),c=yL(a),d=[];a=_.w(zL(a));for(var e=a.next();!e.done;e=a.next()){e=e.value;var f=VH(e);f.activeVideo=e.video===b;f.activeAudio=e.audio===c;d.push(f)}return d};kH=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a){c=AL;if(!a.f||!a.a)return f.F(0);d=rH(a);return _.y(f,a.j.loadTextStream(b.id,d.id),3)}if(4!=f.a)return e=f.f,_.y(f,dJ(a.a,e),4);BL(a,d,e,!1);a.ga?a.ca=e:_.iJ(a.a,e,!0,0);a.Wd=e.language;a.Qd=e.kind===c.Gj;_.C(f)})};
227
+ uL=function(a){switch(a.I){case dK:a:if(a.l.ended||a.M.We())var b=!0;else{if(a.isLive()){b=zF(a.f.presentationTimeline);var c=a.getBufferInfo();if(null!==c&&(c=c.la(),null!==c&&c>=b)){b=!0;break a}}b=!1}break;default:b=!1}if(a.M){var d=a.M.kg();c=d.video;d=d.audio;var e=a.l.currentTime;c&&d?(c=c.Ga(e),d=d.Ga(e),c=Math.min(c,d)):c=c?c.Ga(e):d?d.Ga(e):0}else c=0;if(d=a.K){d=a.K;var f=b,g=d.f.get(d.a);e=d.a;c=f||c>=g?pI:qI;d.a=c;d=e!==c}c=d;d=wL(a);c||a.getState()===_.Mq&&!d?(a.log.debug("Buffering state changed. Is buffering",
228
+ d,"buffered to end",b,"state",a.getState()),cL(a)):a.ke&&vL(a)};rL=function(a){var b={configuration:{Gm:a.Y===_.Ib},Qb:function(){return iG(a.C)},X:a.M,Eb:a.getNetworkEngine(),pd:a.da,xg:a.Tk.bind(a),wg:a.Sk.bind(a),onError:a.onError.bind(a),Si:a.pn.bind(a),onEvent:a.bg.bind(a),Xi:a.Oo.bind(a),wf:a.Cn.bind(a),ee:function(){return a.h},Wf:a.Xj.bind(a),vj:a.Eo.bind(a),Zd:a.B};return new _.UI(a.f,b)};
229
+ gH=function(a){if(!a.f||!a.C)return[];var b=xL(a),c=yL(a),d=[];a=_.w(zL(a));for(var e=a.next();!e.done;e=a.next()){e=e.value;var f=VH(e);f.activeVideo=e.video===b;f.activeAudio=e.audio===c;d.push(f)}return d};kH=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a){c=AL;if(!a.f||!a.a)return f.F(0);d=rH(a);return _.y(f,a.j.loadTextStream(b.id,d.id),3)}if(4!=f.a)return e=f.f,_.y(f,dJ(a.a,e),4);BL(a,d,e,!1);a.ga?a.ca=e:_.iJ(a.a,e,!0,0);a.Wd=e.language;a.Qd=e.kind===c.Fj;_.C(f)})};
230
230
  hH=function(a,b,c){c=void 0===c?!1:c;var d=void 0===d?0:d;var e,f,g,h,l,m,n;_.I(function(p){if(1==p.a){if(!a.f||!a.a)throw Error("Player not ready to select tracks.");e=rH(a);if(!e)throw Error(DD);if(!b)return a.ya=null,null!=a.de&&(a.be=a.de,a.de=null),a.configuration.abr.enabled||(a.log.info("Enable ABR Selection"),a.configuration.abr.enabled=!0,a.h.enable()),f=iL(a,e.variants),g=f.variant,null==g||a.ga||nL(a,g),p["return"]();a.configuration.abr.enabled&&(a.log.info("Disable ABR and enable manual track selection to select "+
231
231
  (b.width+"x"+b.height+"@"+b.bandwidth)),a.configuration.abr.enabled=!1,a.h.disable());h=mL(a);l=h.find(function(q){return q.id===b.id})||null;if(!l)throw a.log.error("No variant with id",b.id),Error("Variant not found.");if(!XH(l))throw a.log.error("Unable to switch to restricted track",b.id),Error("Unable to switch to restricted track.");a.ya=l.video.id;return _.y(p,a.j.loadVariant(l,e.id),2)}m=p.f;(n=!!sH(a.o,e).fb)?m.video&&(CL(a,e,m.video,!1),_.iJ(a.a,m.video,c,d)):(DL(a,e,m,!1),EL(a,m,c,d));
232
232
  null==a.de&&(a.de=a.be);a.be=new lI(l);iL(a,e.variants);_.C(p)})};
@@ -242,7 +242,7 @@ keyId:null,language:g.closedCaptions.get(l),label:null,type:_.Q,primary:!1,trick
242
242
  jL=function(a,b){for(var c=a.a?YI(a.a):null,d=a.a?ZI(a.a):null,e=!dL(a),f=_.w(b),g=f.next();!g.done;g=f.next())UH(a.B,c,d,g.value,e);c=ME(b,function(h){return h.variants.some(XH)});if(a.configuration.streaming.disableAudioTracks)for(d=_.w(b),e=d.next();!e.done;e=d.next())for(f=_.w(e.value.variants),e=f.next();!e.done;e=f.next())delete e.value.audio;if(a.configuration.streaming.disableVideoTracks)for(d=_.w(b),e=d.next();!e.done;e=d.next())for(f=_.w(e.value.variants),e=f.next();!e.done;e=f.next())e=
243
243
  e.value,(g=e.video)&&!NE(g.type,_.Cl(g.mimeType,g.codecs))&&delete e.video;if(0===c)throw new _.O(_.P,4,4032);if(c<b.length)throw new _.O(_.P,4,4011);c=_.w(b);for(e=c.next();!e.done;e=c.next())d=e.value,RH(d.variants,a.configuration.restrictions)&&a.a&&rH(a)===d&&hL(a),KL(a,d.variants)};
244
244
  tL=function(a,b){var c=a.a?YI(a.a):null,d=a.a?ZI(a.a):null,e=!dL(a);UH(a.B,c,d,b,e);d=b.variants;if(a.configuration.streaming.disableAudioTracks)for(c=_.w(d),e=c.next();!e.done;e=c.next())delete e.value.audio;if(!d.some(XH))throw new _.O(_.P,4,4011);KL(a,b.variants);RH(d,a.configuration.restrictions)&&a.a&&rH(a)===b&&hL(a);if(!_.Fk(2)&&(c=a.B?a.B.getDrmInfo():null))for(d=_.w(d),e=d.next();!e.done;e=d.next()){e=_.w(e.value.drmInfos);for(var f=e.next();!f.done;f=e.next())if(f=f.value,f.keySystem===
245
- c.keySystem){f=_.w(f.initData||[]);for(var g=f.next();!g.done;g=f.next())g=g.value,_.Up(a.B,g.keyId,g.initData)||_.Kp(a.B,g.initDataType,g.initData,g.keyId)}}};EL=function(a,b,c,d){c=void 0===c?!1:c;d=void 0===d?0:d;a.ga?(a.Ea=b,a.Cj=c,a.Bj=d):jJ(a.a,b,c,d)};LL=function(a){if(a.a&&a.f){var b=WI(a.a),c=rH(a);null!=b&&b===c&&(YI(a.a),ZI(a.a),_.XI(a.a,_.Q),sH(a.o,c),sH(a.o,c),sH(a.o,c),sH(a.o,c))}};
245
+ c.keySystem){f=_.w(f.initData||[]);for(var g=f.next();!g.done;g=f.next())g=g.value,_.Up(a.B,g.keyId,g.initData)||_.Kp(a.B,g.initDataType,g.initData,g.keyId)}}};EL=function(a,b,c,d){c=void 0===c?!1:c;d=void 0===d?0:d;a.ga?(a.Ea=b,a.Bj=c,a.Aj=d):jJ(a.a,b,c,d)};LL=function(a){if(a.a&&a.f){var b=WI(a.a),c=rH(a);null!=b&&b===c&&(YI(a.a),ZI(a.a),_.XI(a.a,_.Q),sH(a.o,c),sH(a.o,c),sH(a.o,c),sH(a.o,c))}};
246
246
  sL=function(a,b){function c(g,h){if(!g)return null;var l=g.findSegmentPosition(h-f.startTime);return null==l?null:(l=g.getSegmentReference(l))?l.startTime+f.startTime:null}var d=YI(a.a),e=ZI(a.a),f=rH(a);d=c(d,b);e=c(e,b);return null!=e&&null!=d?Math.max(e,d):null!=e?e:null!=d?d:b};wL=function(a){return a.B&&a.B.G?!0:a.K?a.K.getState()===qI:!1};
247
247
  cL=function(a){if(a.H&&a.K&&a.C){var b=ML(a)===_.Mq,c=a.J;c.l=b;OI(c,c.o?"seek":void 0);a.C.j.o=b;vL(a);a.rf&&(c=1>Math.abs(a.getMediaDuration()-a.getMediaPosition()),a=a.rf,b&&c&&(b=a.a,b.a[b.a.length-1]&&a.f(new _.L(_.eg))))}};vL=function(a){gK(a,ML(a))};ML=function(a){if(a.re)var b=!1;else if(a.l&&a.l.ended)b=!0;else{b=a.getMediaDuration();var c=a.getMediaPosition();b=a.ke&&0<=c&&b<=c?!0:!1}return b?_.Oq:wL(a)||a.re?_.Mq:a.l&&a.l.paused?_.Uq:_.Vq};
248
248
  iL=function(a,b){var c=NL(a,b);if(!c)return{variant:null,fb:null};var d=OL(a,c);return{variant:c,fb:d}};OL=function(a,b){if(!b||!b.video)return null;var c=(a.f.muxedAudioTracks||[]).find(function(d){return d.groupId===b.video.muxedAudioId});return c&&c.primary?c:null};
@@ -262,7 +262,7 @@ dL=function(a){return a.configuration.mediaSource.codecSwitchingStrategy===_.og&
262
262
  YL=function(){var a=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(b){for(var c=[],d=0;d<arguments.length;++d)c[d]=arguments[d];c=a.apply(this,c);c.abort=function(){};return c}};ZL=function(){var a=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(b,c){return a.call(this,b,c-.001)}};$L=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"mp2t"===b.split(/ *; */)[0].split("/")[1].toLowerCase()?!1:a(b)}};
263
263
  aM=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"opus"!==_.QE(b)&&a(b)}};
264
264
  bM=function(){var a=MediaSource.isTypeSupported,b=/^dv(?:h[e1]|a[v1])\./;MediaSource.isTypeSupported=function(c){var d=c.split(/ *; */),e=d.shift(),f={};d=_.w(d);for(var g=d.next();!g.done;g=d.next())g=g.value.split("\x3d"),f[g[0]]=g[1].replace(/"(.*)"/,"$1");d=f.codecs;if(!d)return a(c);var h=!1,l=!1;c=d.split(",").filter(function(n){b.test(n)&&(l=!0);/^(hev|hvc)1\.2/.test(n)&&(h=!0);return!0});l&&(h=!1);f.codecs=c.join(",");h&&(f.eotf="smpte2084");for(var m in f)e+="; "+m+'\x3d"'+f[m]+'"';return cast.__platform__.canDisplayType(e)}};
265
- cM=function(a){_.ew.call(this,a);a=a.getSurface().getMedia();this.a=null;for(var b=0;b<a.textTracks.length;++b){var c=a.textTracks[b];c.mode=_.ee;c.label===FD&&(this.a=c)}this.a||(this.a=a.addTextTrack(_.mE,FD));this.a.mode=_.Ge};dM=function(a,b){var c=a.mode;a.mode=c===_.kg?_.kg:_.Ge;for(var d=a.cues,e=d.length-1;0<=e;e--){var f=d[e];f&&b(f)&&a.removeCue(f)}a.mode=c};eM=function(){};_.Nj.prototype.f=_.pE(0,function(){return this.keyInfo});var sE=[112,115,115,104,0,0,0,0],AL={jh:_.xg,Uo:_.td,Gj:_.Ce};
265
+ cM=function(a){_.ew.call(this,a);a=a.getSurface().getMedia();this.a=null;for(var b=0;b<a.textTracks.length;++b){var c=a.textTracks[b];c.mode=_.ee;c.label===FD&&(this.a=c)}this.a||(this.a=a.addTextTrack(_.mE,FD));this.a.mode=_.Ge};dM=function(a,b){var c=a.mode;a.mode=c===_.kg?_.kg:_.Ge;for(var d=a.cues,e=d.length-1;0<=e;e--){var f=d[e];f&&b(f)&&a.removeCue(f)}a.mode=c};eM=function(){};_.Nj.prototype.f=_.pE(0,function(){return this.keyInfo});var sE=[112,115,115,104,0,0,0,0],AL={jh:_.xg,To:_.td,Fj:_.Ce};
266
266
  _.IE.prototype.he=function(){return this.pa?this.pa-this.Da+1:null};_.IE.prototype.f=function(){return this.keyInfo};_.SE.prototype.getAttribute=function(a){a=this.attributes[a];return null==a?null:a};_.u=_.VE.prototype;_.u.we=function(a,b){var c=UE(a).childNodes[0];return b&&c.tagName!==b?null:c};_.u.Ma=function(a,b){var c=this.Z(a,b);return 1!==c.length?null:c[0]};_.u.Z=function(a,b){return Array.from(a.childNodes).filter(function(c){return c.tagName===b})};_.u.bc=_.th(1);_.u.Hc=_.th(3);
267
267
  _.u.sa=function(a){return a.childNodes.every(function(b){return b.tagName===_.da||"#cdata"===b.tagName})?a.childNodes.map(function(b){return b.textContent}).join(""):null};_.u.getAttributeNS=function(a,b,c){return(b=a.a.get(b))?a.attributes[b+":"+c]||null:null};_.u.W=_.th(5);_.u.af=_.th(7);_.u.Af=_.th(11);_.u.removeChild=function(a,b){a.childNodes=a.childNodes.filter(function(c){return c!==b})};_.u.mf=_.th(13);_.u.lf=_.th(15);_.u.nd=_.th(9);_.u.Bf=_.th(17);_.u.Ee=_.th(19);_.fM=0;_.u=_.ZE.prototype;
268
268
  _.u.track=function(a){null!=this.player&&aF(this);a&&(this.player=a,this.player.on(_.cg,this.jd,this))};_.u.release=function(){aF(this);this.S=[];this.f=this.h=null};
@@ -290,17 +290,17 @@ $G.prototype.setVideoRendition=$G.prototype.ub;$G.prototype.setTextTrack=$G.prot
290
290
  $G.prototype.getAudioRendition=$G.prototype.Va;$G.prototype.getVideoRendition=$G.prototype.na;$G.prototype.getTextTracks=$G.prototype.ma;$G.prototype.getAudioTracks=$G.prototype.getAudioTracks;$G.prototype.getVideoTracks=$G.prototype.getVideoTracks;vH.prototype.init=function(a){var b=muxjs.mp4.probe;a=_.bk(a);this.l=b.videoTrackIds(a);this.j=b.timescale(a)||{};this.a.init()};vH.prototype.h=function(a,b){var c=_.bk(a);(c=this.a.parse(c,this.l,this.j))&&c.captions&&b(c.captions);this.a.clearParsedCaptions()};vH.prototype.f=function(){this.a.resetCaptionStream()};_.wH.prototype.init=function(){};_.wH.prototype.h=function(){};_.wH.prototype.f=function(){};_.u=_.yH.prototype;
291
291
  _.u.destroy=function(){var a=this;window.ManagedMediaSource&&(this.j.disableRemotePlayback=!1);this.I=!0;var b=[],c;for(c in this.h){var d=this.h[c],e=d[0];this.h[c]=d.slice(0,1);e&&b.push(e.p["catch"](FE));for(e=1;e<d.length;++e)d[e].p["catch"](FE),d[e].p.reject()}this.f&&b.push(this.f.destroy());this.C&&b.push(this.C.destroy());for(var f in this.w)this.w[f].destroy(),delete this.w[f];return Promise.all(b).then(function(){a.l&&(a.l.release(),a.l=null);a.j&&(a.j.removeAttribute("src"),a.j.load(),
292
292
  a.j=null);a.A="";a.o=null;a.f=null;a.C=null;a.a={};a.w={};a.G={};a.H=null;a.K=!1;for(var g in a.h);a.h={}})};_.u.open=function(){return this.J};
293
- _.u.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e;return _.I(function(f){if(1==f.a)return e=_.er,_.y(f,d.J,2);a.forEach(function(g,h){var l=_.Cl(g.mimeType,g.codecs);if(h===e.TEXT)d.uc(l);else{var m=new Map;m.set(h,l);if((!_.Cu(l)||!b||g.aesEncrypted)&&_.Bl(l,h)){var n=_.Bl(l);n&&(m=n(),d.w[h]=m,m=m.demuxMimeTypes(h,l),c&&m["delete"](e.AUDIO))}BH(d,m);d.K=m.has(e.AUDIO)&&m.has(e.VIDEO)}});_.C(f)})};_.u.qj=function(){this.g.debug(JD);Object.values(this.w).forEach(function(a){return a.reset()})};
293
+ _.u.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e;return _.I(function(f){if(1==f.a)return e=_.er,_.y(f,d.J,2);a.forEach(function(g,h){var l=_.Cl(g.mimeType,g.codecs);if(h===e.TEXT)d.uc(l);else{var m=new Map;m.set(h,l);if((!_.Cu(l)||!b||g.aesEncrypted)&&_.Bl(l,h)){var n=_.Bl(l);n&&(m=n(),d.w[h]=m,m=m.demuxMimeTypes(h,l),c&&m["delete"](e.AUDIO))}BH(d,m);d.K=m.has(e.AUDIO)&&m.has(e.VIDEO)}});_.C(f)})};_.u.pj=function(){this.g.debug(JD);Object.values(this.w).forEach(function(a){return a.reset()})};
294
294
  _.u.Gi=function(){return this.L.streaming.ignoreManagedMediaSourceStreamingHints?!0:this.M};_.u.uc=function(a){this.f||(this.f=new GG(this.L,this.C));HG(this.f,a)};_.u.We=function(){return this.o?this.o.readyState===_.ze:!0};_.u.Ua=function(a){return a===_.Q?this.f.Ua():(a=CH(this,a))?a.Ua():null};_.u.la=function(a){return a===_.Q?this.f.la():(a=CH(this,a))?a.la():null};_.u.Tb=function(a,b,c){return a===_.Q?this.f.Tb(b):(a=CH(this,a))?a.Tb(b,!1,c):!1};
295
- _.u.Ga=function(a,b){if(a===_.Q)return this.f.Ga(b);var c=CH(this,a);return c?c.Ga(b):0};_.u.lg=function(){var a={};a.total=new _.zm(this.j.buffered,"total");a.audio=CH(this,_.dd);a.video=CH(this,_.r);var b=[];this.f&&(b=[{start:this.f.Ua(),end:this.f.la()}]);a.text=RE(b,_.Q);return a};
295
+ _.u.Ga=function(a,b){if(a===_.Q)return this.f.Ga(b);var c=CH(this,a);return c?c.Ga(b):0};_.u.kg=function(){var a={};a.total=new _.zm(this.j.buffered,"total");a.audio=CH(this,_.dd);a.video=CH(this,_.r);var b=[];this.f&&(b=[{start:this.f.Ua(),end:this.f.la()}]);a.text=RE(b,_.Q);return a};
296
296
  _.u.Ve=function(a,b,c,d,e,f,g,h){var l=this;g=void 0===g?!1:g;h=void 0===h?!1:h;var m=this.a[a],n=-1,p=0;m&&m.buffered&&(p=m.buffered.length);a===_.r&&null!==c&&null!==d&&g&&(n=0<p?m.buffered.end(p-1):-1);a===_.Q?h=IG(this.f,b,c,d):this.w[a]?(b=this.w[a].transmux(b),b.captions&&0<b.captions.length&&(this.f||this.uc(_.Ag),KG(this.f,b.captions,c,d,this.a.video.timestampOffset)),e=[],0<b.audio.byteLength&&this.a.audio&&!h&&e.push(EH(this,_.dd,this.dg.bind(this,_.dd,b.audio.buffer))),0<b.video.byteLength&&
297
297
  this.a.video&&e.push(EH(this,_.r,this.dg.bind(this,_.r,b.video.buffer))),h=Promise.all(e)):(e&&window.muxjs&&(this.f||this.uc(_.Ag),null==c&&null==d?this.H.init(b):this.H.h(b,function(q){q.length&&KG(l.f,q,c,d,l.a.video.timestampOffset)})),h=EH(this,a,this.dg.bind(this,a,b)));return h.then(function(){if(a===_.r&&null!==c&&null!==d&&!g)l.B.append(c,d,f),null!==c&&null!==d&&l.g.debug(fD,c,d,hD,DH(l,a));else if(a===_.dd&&null!==c&&null!==d)bF(l.B),null!==c&&null!==d&&l.g.debug(eD,c,d,hD,DH(l,a));else if(a===
298
298
  _.r&&null!==c&&null!==d&&g){var q=m.buffered.length,t=0<q?m.buffered.end(q-1):-1;0>n&&0<q&&(n=m.buffered.start(0));0<=n&&0<t&&l.B.append(n,t,f)}if(!l.G[a]&&m&&1===m.buffered.length){q=m.buffered.start(0);var v=c-q;if(Math.abs(v)>l.P&&0===m.timestampOffset)return l.g.warn(lD+v+RC+(a+ZC)+(c+QC)+(q+YC)),q=EH(l,a,function(){l.Hh(a,v)}),t=EH(l,a,l.Eh.bind(l,a,!1)),Promise.all([q,t])}null!==c&&null!==d&&(l.G[a]=!0)})["catch"](function(q){throw q;})};
299
299
  _.u.Gh=function(a){var b=this.la(_.r)||0;JG(this.f,a,b)};_.u.yh=function(){this.f&&JG(this.f,"",0)};_.u.remove=function(a,b,c){var d=this;return a===_.Q?this.f.remove(b,c):EH(this,a,this.Fh.bind(this,a,b,c)).then(function(){if(a===_.r){var e=d.Ua(a),f=d.la(a);null!==e&&null!==f&&eF(d.B,e,f)}else a===_.dd&&cF(d.B)})};_.u.clear=function(a){if(a===_.Q){if(!this.f)return Promise.resolve();this.H.f();return this.f.remove(0,Infinity)}return EH(this,a,this.Fh.bind(this,a,0,this.o.duration))};
300
- _.u.flush=function(a){return a===_.Q?Promise.resolve():EH(this,a,this.Eh.bind(this,a))};_.u.tj=function(a,b,c,d){var e=this,f,g;return _.I(function(h){f=_.er;if(a===f.TEXT){e.f.A=b;var l=e.f;l.h=c;l.l=d;return h["return"]()}g=FH(e,a,b,c,d);e.K&&(g=g.concat(FH(e,f.AUDIO,b,c,d)));return _.y(h,Promise.all(g),0)})};_.u.endOfStream=function(a){var b=this;return IH(this,function(){b.We()||(a?b.o.endOfStream(a):b.o.endOfStream())})};_.u.eg=function(a){var b=this;IH(this,function(){b.o.duration=a})};
300
+ _.u.flush=function(a){return a===_.Q?Promise.resolve():EH(this,a,this.Eh.bind(this,a))};_.u.sj=function(a,b,c,d){var e=this,f,g;return _.I(function(h){f=_.er;if(a===f.TEXT){e.f.A=b;var l=e.f;l.h=c;l.l=d;return h["return"]()}g=FH(e,a,b,c,d);e.K&&(g=g.concat(FH(e,f.AUDIO,b,c,d)));return _.y(h,Promise.all(g),0)})};_.u.endOfStream=function(a){var b=this;return IH(this,function(){b.We()||(a?b.o.endOfStream(a):b.o.endOfStream())})};_.u.eg=function(a){var b=this;IH(this,function(){b.o.duration=a})};
301
301
  _.u.getDuration=function(){return this.o.duration};_.u.dg=function(a,b){this.g.debug(gD+a+SC);try{this.a[a].appendBuffer(b)}catch(c){throw this.g.warn(tD+a,c),c;}this.g.debug(nD+a+SC)};_.u.Fh=function(a,b,c){if(c<=b)this.md(a);else{this.g.debug(ID+a+VC,b,c);try{this.a[a].remove(b,c)}catch(d){throw this.g.warn(vD+a+TC,b,c,d),d;}this.g.debug(pD+a+VC,b,c)}};
302
- _.u.Wk=function(a){try{this.g.debug(dD+a+SC);var b=this.a[a].appendWindowStart,c=this.a[a].appendWindowEnd;this.a[a].abort();this.a[a].appendWindowStart=b;this.a[a].appendWindowEnd=c}catch(d){throw this.g.warn(sD+a+SC,d),d;}this.g.debug(mD+a+SC);this.md(a)};_.u.Eh=function(a){try{this.j.readyState>HTMLMediaElement.HAVE_NOTHING?(this.g.debug(yD+a),this.j.currentTime-=.001):this.g.warn(ND+a+XC+this.j.readyState)}catch(b){throw this.g.warn(uD+a,b),b;}this.g.debug(oD+a);this.md(a)};
303
- _.u.Hh=function(a,b){0>b&&(b+=.001);try{this.g.debug(MD+a,b),this.a[a].timestampOffset=b}catch(c){throw this.g.warn(xD+a,b,c),c;}this.g.debug(rD+a,b);this.md(a)};_.u.Yk=function(a,b,c){try{this.g.debug(KD+a,b,c),this.a[a].appendWindowStart=0,this.a[a].appendWindowEnd=c,this.a[a].appendWindowStart=b}catch(d){throw this.g.warn(wD+a,b,c,d),d;}this.g.debug(qD+a,b,c);this.md(a)};_.u.Xk=function(a){this.h[a][0].p.reject(new _.O(_.P,3,3014,{mediaError:this.j.error?this.j.error.code:0}))};
302
+ _.u.Vk=function(a){try{this.g.debug(dD+a+SC);var b=this.a[a].appendWindowStart,c=this.a[a].appendWindowEnd;this.a[a].abort();this.a[a].appendWindowStart=b;this.a[a].appendWindowEnd=c}catch(d){throw this.g.warn(sD+a+SC,d),d;}this.g.debug(mD+a+SC);this.md(a)};_.u.Eh=function(a){try{this.j.readyState>HTMLMediaElement.HAVE_NOTHING?(this.g.debug(yD+a),this.j.currentTime-=.001):this.g.warn(ND+a+XC+this.j.readyState)}catch(b){throw this.g.warn(uD+a,b),b;}this.g.debug(oD+a);this.md(a)};
303
+ _.u.Hh=function(a,b){0>b&&(b+=.001);try{this.g.debug(MD+a,b),this.a[a].timestampOffset=b}catch(c){throw this.g.warn(xD+a,b,c),c;}this.g.debug(rD+a,b);this.md(a)};_.u.Xk=function(a,b,c){try{this.g.debug(KD+a,b,c),this.a[a].appendWindowStart=0,this.a[a].appendWindowEnd=c,this.a[a].appendWindowStart=b}catch(d){throw this.g.warn(wD+a,b,c,d),d;}this.g.debug(qD+a,b,c);this.md(a)};_.u.Wk=function(a){this.h[a][0].p.reject(new _.O(_.P,3,3014,{mediaError:this.j.error?this.j.error.code:0}))};
304
304
  _.u.md=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug(QD+a),HH(this,a))};_.u.getTextDisplayer=function(){return this.C};var AH=window.URL.createObjectURL;_.u=_.$H.prototype;_.u.stop=function(){this.A=null;this.l=!1;this.f=[];this.o=1;this.h=null;this.C=!1};_.u.init=function(a){this.A=a};
305
305
  _.u.chooseTrack=function(){var a=aI(this,!this.C&&this.a.initialRestrictions?this.a.initialRestrictions:this.a.restrictions,this.f),b=this.getBandwidthEstimate();this.f.length&&!a.length&&(this.g.warn("No tracks met the ABR restrictions. Choosing a track by lowest bandwidth."),a=aI(this,null,this.f),a=[a[0]]);this.h=Date.now();this.C=!0;for(var c=a,d=c[0]||null,e=0;e<c.length;e++){var f=c[e],g=c[e+1],h=isNaN(this.o)||0===this.o?1:Math.abs(this.o),l=h*f.bandwidth,m=l/this.a.bandwidthDowngradeTarget;
306
306
  g=h*(g?g.bandwidth:Infinity)/this.a.bandwidthUpgradeTarget;this.g.debug("Bandwidth ranges:",(l/1E6).toFixed(3),(m/1E6).toFixed(3),(g/1E6).toFixed(3));b>=m&&b<=g&&(d=f)}return d||a[0]||this.f[0]};_.u.enable=function(){this.l=!0};_.u.disable=function(){this.l=!1};
@@ -310,24 +310,24 @@ _.u.setTracks=function(a){this.f=a};_.u.setCmsdManager=function(a){this.j=a};_.u
310
310
  kI.prototype.create=function(a){var b=mI(a,this.j);0<b.length&&(a=b);b=!1;if(this.a){var c=nI(a,this.a);0<c.length?(a=c,b=!0):_.Yh("No exact match for preferred variant role could be found. Role: "+this.a)}b||(b=a.filter(function(e){return e.primary}),0<b.length&&(a=b));this.f&&(b=KH(a,this.f),b.length?a=b:_.Yh("No exact match for the channel count could be found."));b=oI(a,this.l);b.length?a=b:_.Yh("No exact match for spatial audio could be found.");b=this.h===_.og&&XE();c=new gI(a[0]);a=_.w(a);
311
311
  for(var d=a.next();!d.done;d=a.next())c.add(d.value,!b);return c};rI.prototype.getState=function(){return this.a};var qI=0,pI=1;tI.prototype.release=function(){this.f.release()};_.u=vI.prototype;
312
312
  _.u.destroy=function(){var a=this;this.K=!0;var b=[],c;for(c in this.h){var d=this.h[c],e=d[0];this.h[c]=d.slice(0,1);e&&b.push(e.p["catch"](FE));for(e=1;e<d.length;++e)d[e].p["catch"](FE),d[e].p.reject()}this.f&&b.push(this.f.destroy());this.C&&b.push(this.C.destroy());for(var f in this.w)this.w[f].destroy(),delete this.w[f];return Promise.all(b).then(function(){a.l&&(a.l.release(),a.l=null);a.j&&(a.j.removeAttribute("src"),a.j.load(),a.j=null);a.A="";a.o=null;a.f=null;a.C=null;a.a={};a.w={};a.H=
313
- {};a.I=null;a.M=!1;for(var g in a.h);a.h={}})};_.u.open=function(){return this.L};_.u.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e;return _.I(function(f){if(1==f.a)return e=_.er,_.y(f,d.L,2);a.forEach(function(g,h){var l=_.Cl(g.mimeType,g.codecs);if(h===e.TEXT)d.uc(l);else{var m=new Map;m.set(h,l);if((!_.Cu(l)||!b||g.aesEncrypted)&&_.Bl(l,h)){var n=_.Bl(l);n&&(m=n(),d.w[h]=m,m=m.demuxMimeTypes(h,l),c&&m["delete"](e.AUDIO))}xI(d,m)}d.h[h]=[]});_.C(f)})};_.u.qj=function(){this.g.debug(JD);Object.values(this.w).forEach(function(a){return a.reset()})};
313
+ {};a.I=null;a.M=!1;for(var g in a.h);a.h={}})};_.u.open=function(){return this.L};_.u.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e;return _.I(function(f){if(1==f.a)return e=_.er,_.y(f,d.L,2);a.forEach(function(g,h){var l=_.Cl(g.mimeType,g.codecs);if(h===e.TEXT)d.uc(l);else{var m=new Map;m.set(h,l);if((!_.Cu(l)||!b||g.aesEncrypted)&&_.Bl(l,h)){var n=_.Bl(l);n&&(m=n(),d.w[h]=m,m=m.demuxMimeTypes(h,l),c&&m["delete"](e.AUDIO))}xI(d,m)}d.h[h]=[]});_.C(f)})};_.u.pj=function(){this.g.debug(JD);Object.values(this.w).forEach(function(a){return a.reset()})};
314
314
  _.u.Gi=function(){return this.J.streaming.ignoreManagedMediaSourceStreamingHints?!0:this.P};_.u.uc=function(a){this.f||(this.f=new GG(this.J,this.C));HG(this.f,a)};_.u.We=function(){return this.o?this.o.readyState===_.ze:!0};_.u.Ua=function(a){return a===_.Q?this.f.Ua():(a=yI(this,a))?a.Ua():null};_.u.la=function(a){return a===_.Q?this.f.la():(a=yI(this,a))?a.la():null};_.u.Tb=function(a,b,c){return a===_.Q?this.f.Tb(b):(a=yI(this,a))?a.Tb(b,!1,c):!1};
315
- _.u.Ga=function(a,b){if(a===_.Q)return this.f.Ga(b);var c=yI(this,a);return c?c.Ga(b):0};_.u.lg=function(){var a={};a.total=new _.zm(this.j.buffered,"total");a.audio=yI(this,_.dd);a.video=yI(this,_.r);var b=[];this.f&&(b=[{start:this.f.Ua(),end:this.f.la()}]);a.text=RE(b,_.Q);return a};
315
+ _.u.Ga=function(a,b){if(a===_.Q)return this.f.Ga(b);var c=yI(this,a);return c?c.Ga(b):0};_.u.kg=function(){var a={};a.total=new _.zm(this.j.buffered,"total");a.audio=yI(this,_.dd);a.video=yI(this,_.r);var b=[];this.f&&(b=[{start:this.f.Ua(),end:this.f.la()}]);a.text=RE(b,_.Q);return a};
316
316
  _.u.Ve=function(a,b,c,d,e,f,g){var h=this;g=void 0===g?!1:g;var l=this.a[a],m=-1,n=0;l&&l.buffered&&(n=l.buffered.length);a===_.r&&null!==c&&null!==d&&g&&(m=0<n?l.buffered.end(n-1):-1);a===_.Q?b=IG(this.f,b,c,d):this.w[a]?(b=this.w[a].transmux(b),b.captions&&0<b.captions.length&&(this.f||this.uc(_.Ag),KG(this.f,b.captions,c,d,this.a.video.timestampOffset)),e=[],0<b.audio.byteLength&&this.a.audio&&e.push(AI(this,_.dd,this.cg.bind(this,_.dd,b.audio.buffer))),0<b.video.byteLength&&this.a.video&&e.push(AI(this,
317
317
  _.r,this.cg.bind(this,_.r,b.video.buffer))),b=Promise.all(e)):(e&&window.muxjs&&(this.f||this.uc(_.Ag),null==c&&null==d?this.I.init(b):this.I.h(b,function(p){p.length&&KG(h.f,p,c,d,h.a.video.timestampOffset)})),b=AI(this,a,this.cg.bind(this,a,b)));return b.then(function(){if(a===_.r&&null!==c&&null!==d&&!g)h.B.append(c,d,f),null!==c&&null!==d&&h.g.debug(fD,c,d,hD,zI(h,a));else if(a===_.dd&&null!==c&&null!==d)bF(h.B),null!==c&&null!==d&&h.g.debug(eD,c,d,hD,zI(h,a));else if(a===_.r&&null!==c&&null!==
318
318
  d&&g){var p=l.buffered.length,q=0<p?l.buffered.end(p-1):-1;0>m&&0<p&&(m=l.buffered.start(0));0<=m&&0<q&&h.B.append(m,q,f)}if(!h.H[a]&&l&&1===l.buffered.length){p=l.buffered.start(0);var t=c-p;if(Math.abs(t)>h.U&&0===l.timestampOffset)return h.g.warn(lD+t+RC+(a+ZC)+(c+QC)+(p+YC)),p=AI(h,a,function(){BI(h,a,t)}),q=AI(h,a,h.Ch.bind(h,a,!1)),Promise.all([p,q])}null!==c&&null!==d&&(h.H[a]=!0)})["catch"](function(p){throw p;})};_.u.Gh=function(a){var b=this.la(_.r)||0;JG(this.f,a,b)};
319
319
  _.u.yh=function(){this.f&&JG(this.f,"",0)};_.u.remove=function(a,b,c){var d=this;return a===_.Q?this.f.remove(b,c):AI(this,a,this.Dh.bind(this,a,b,c)).then(function(){if(a===_.r){var e=d.Ua(a),f=d.la(a);null!==e&&null!==f&&eF(d.B,e,f)}else a===_.dd&&cF(d.B)})};_.u.clear=function(a){if(a===_.Q){if(!this.f)return Promise.resolve();this.I.f();return this.f.remove(0,Infinity)}return AI(this,a,this.Dh.bind(this,a,0,this.o.duration))};
320
- _.u.flush=function(a){return a===_.Q?Promise.resolve():AI(this,a,this.Ch.bind(this,a))};_.u.tj=function(a,b,c,d,e,f){var g=this,h,l,m;return _.I(function(n){if(1==n.a){h=_.er;if(a===h.TEXT){g.f.A=b;var p=g.f;p.h=c;p.l=d;return n["return"]()}return _.y(n,HI(g,a,e,f),2)}l=n.f;m=CI(g,a,b,c,d,l);g.M&&(m=m.concat(CI(g,h.AUDIO,b,c,d,l)));return _.y(n,Promise.all(m),0)})};_.u.endOfStream=function(a){var b=this;return FI(this,function(){b.We()||(a?b.o.endOfStream(a):b.o.endOfStream())})};
320
+ _.u.flush=function(a){return a===_.Q?Promise.resolve():AI(this,a,this.Ch.bind(this,a))};_.u.sj=function(a,b,c,d,e,f){var g=this,h,l,m;return _.I(function(n){if(1==n.a){h=_.er;if(a===h.TEXT){g.f.A=b;var p=g.f;p.h=c;p.l=d;return n["return"]()}return _.y(n,HI(g,a,e,f),2)}l=n.f;m=CI(g,a,b,c,d,l);g.M&&(m=m.concat(CI(g,h.AUDIO,b,c,d,l)));return _.y(n,Promise.all(m),0)})};_.u.endOfStream=function(a){var b=this;return FI(this,function(){b.We()||(a?b.o.endOfStream(a):b.o.endOfStream())})};
321
321
  _.u.eg=function(a){var b=this;FI(this,function(){b.o.duration=a})};_.u.getDuration=function(){return this.o.duration};_.u.cg=function(a,b){this.g.debug(gD+a+SC);try{this.a[a].appendBuffer(b)}catch(c){throw this.g.warn(tD+a,c),c;}this.g.debug(nD+a+SC)};_.u.Dh=function(a,b,c){if(c<=b)this.Fc(a);else{this.g.debug(ID+a+VC,b,c);try{this.a[a].remove(b,c)}catch(d){throw this.g.warn(vD+a+TC,b,c,d),d;}this.g.debug(pD+a+VC,b,c)}};
322
- _.u.Ch=function(a){try{this.j.readyState>HTMLMediaElement.HAVE_NOTHING?(this.g.debug(yD+a),this.j.currentTime-=.001):this.g.warn(ND+a+XC+this.j.readyState)}catch(b){throw this.g.warn(uD+a,b),b;}this.g.debug(oD+a);this.Fc(a)};_.u.Vk=function(a){this.h[a][0].p.reject(new _.O(_.P,3,3014,{mediaError:this.j.error?this.j.error.code:0}))};_.u.Fc=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug(QD+a),EI(this,a))};_.u.getTextDisplayer=function(){return this.C};var wI=window.URL.createObjectURL;II.prototype.release=function(){this.a=this.h=null;this.f=function(){}};II.prototype.l=function(a){var b=this.a,c=this.h.periods;a=fF(c,a)||c[0];b!==a&&this.f(a);this.a=a};KI.prototype.getConfiguration=function(){return this.j};KI.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};KI.prototype.set=function(a,b){this.h=a;OI(this,b)};var RI=new _.po(function(){return new Uint8Array([0,0,0,80,115,105,110,102,0,0,0,12,102,114,109,97,0,0,0,0,0,0,0,20,115,99,104,109,0,0,0,0,99,101,110,99,0,1,0,0,0,0,0,40,115,99,104,105,0,0,0,32,116,101,110,99,0,0,0,0,0,0,1,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])});_.u=_.UI.prototype;_.u.destroy=function(){var a=this,b,c,d,e;return _.I(function(f){if(1==f.a){b=[];c=_.w(a.a.values());for(d=c.next();!d.done;d=c.next())e=d.value,eJ(e),b.push(fJ(e));return _.y(f,Promise.all(b),2)}a.a.clear();a.w.clear();a.D=null;a.j=null;a.H=null;a.B.clear();a.h=null;a.f=!0;_.C(f)})};
323
- _.u.start=function(){var a=this,b,c,d;return _.I(function(e){if(1==e.a){b=a.D.Qb();c=fF(a.j.periods,b+_.sw);if(!c)throw new _.O(_.P,5,5006,"No period found.");d=a.D.xg(c);if(!d.video&&!d.audio&&!d.text)throw a.g.error("start(): No streams chosen"),new _.O(_.P,5,5005,"No streams chosen.");a.G=!d.video&&!d.audio&&!!d.text;a.A=!!d.fb;return _.y(e,mJ(a,d.audio,d.video,d.text,b),2)}if(a.f)return e["return"]();a.g.debug("init: completed initial Stream setup");a.D&&a.D.sn&&(a.g.debug("init: calling onInitialStreamsSetup()..."),
324
- a.D.sn());_.C(e)})};_.u.resume=function(){if(!uJ(this))for(var a=_.w(this.a.values()),b=a.next();!b.done;b=a.next())b=b.value,b.endOfStream=!1,cJ(this,b,0)};
325
- _.u.ic=function(a){var b=this,c,d,e,f,g,h,l;return _.I(function(m){switch(m.a){case 1:if(b.f)return m["return"]();c=rJ(a);if(a.Fb||null==a.vb||a.Dc)return m["return"]();a.vb=null;if(!a.nc){m.F(2);break}b.g.debug(c,"skipping update and clearing the buffer");return _.y(m,wJ(b,a,a.Gf,a.Te),3);case 3:return m["return"]();case 2:_.D(m,4);d=JJ(b,a);null!=d&&(cJ(b,a,d),a.wd=!1);_.Jh(m,5);break;case 4:return e=_.H(m),_.y(m,UJ(b,e),6);case 6:return m["return"]();case 5:ZJ(b,a);if(!vJ(b)){m.F(0);break}if(b.D.configuration.Hm){b.g.debug("End of stream reached, keeping MediaSource open.");
326
- f=_.w(b.a.values());for(g=f.next();!g.done;g=f.next())h=g.value,h.vb=null;return m["return"]()}b.g.debug("End of stream reached, calling ms.endOfStream().");return _.y(m,b.D.X.endOfStream(),8);case 8:if(b.f)return m["return"]();l=b.D.X.getDuration();l<b.j.presentationTimeline.getDuration()&&(b.j.presentationTimeline.f=l);b.D.Ti();_.C(m)}})};
327
- _.u.On=function(a,b,c,d){var e=rE(d.reader),f=rE(d.reader),g=_.yn(d.reader),h=_.yn(d.reader),l=_.yn(d.reader),m=_.yn(d.reader);d=_.Cn(d.reader,d.reader.Wa()-d.reader.getPosition());a=a.startTime+b.startTime+h/g;if(c.includes(e))if("urn:mpeg:dash:event:2012"===e)this.D.Yi();else this.D.onEvent(new _.L("emsg",{detail:{startTime:a,endTime:a+l/g,schemeIdUri:e,value:f,timescale:g,presentationTimeDelta:h,eventDuration:l,id:m,messageData:d}}))};
328
- _.u.Qo=function(a){var b=this,c=!1,d=0;(new _.Dn).N(_.cf,_.En).N(_.Jg,_.En).N(_.Ye,_.En).N(_.bf,_.En).N(_.tg,_.En).aa(_.vg,_.Fn).N("encv",function(e){e.reader.skip(78);_.En(e)}).N("pasp",function(e){d=e.start+e.headerSize;var f=_.yn(e.reader),g=_.yn(e.reader);c=f!==g;b.g.debug("hSpacing\x3d"+f+", vSpacing\x3d"+g+", updatePASP\x3d"+c);e.parser.stop()}).parse(a.data);c&&(a=new _.qn(new DataView(a.data)),a.seek(d),_.W(a,1),_.W(a,1))};_.x(eK,_.Lm);_.u=eK.prototype;_.u.init=function(a,b){var c=a.getMedia();_.Lm.prototype.init.call(this,a,b);LK(this,c)};_.u.namespace=function(){return XD};_.u.setSeekInterceptor=function(a){this.gh=a||null};_.u.setPlaybackSessionId=function(a){this.$g=a};_.u.Uh=function(){return new $G};_.u.getState=function(){return this.Lb};_.u.getDrmInfo=function(){return this.B?this.B.getDrmInfo():null};
322
+ _.u.Ch=function(a){try{this.j.readyState>HTMLMediaElement.HAVE_NOTHING?(this.g.debug(yD+a),this.j.currentTime-=.001):this.g.warn(ND+a+XC+this.j.readyState)}catch(b){throw this.g.warn(uD+a,b),b;}this.g.debug(oD+a);this.Fc(a)};_.u.Uk=function(a){this.h[a][0].p.reject(new _.O(_.P,3,3014,{mediaError:this.j.error?this.j.error.code:0}))};_.u.Fc=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug(QD+a),EI(this,a))};_.u.getTextDisplayer=function(){return this.C};var wI=window.URL.createObjectURL;II.prototype.release=function(){this.a=this.h=null;this.f=function(){}};II.prototype.l=function(a){var b=this.a,c=this.h.periods;a=fF(c,a)||c[0];b!==a&&this.f(a);this.a=a};KI.prototype.getConfiguration=function(){return this.j};KI.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};KI.prototype.set=function(a,b){this.h=a;OI(this,b)};var RI=new _.po(function(){return new Uint8Array([0,0,0,80,115,105,110,102,0,0,0,12,102,114,109,97,0,0,0,0,0,0,0,20,115,99,104,109,0,0,0,0,99,101,110,99,0,1,0,0,0,0,0,40,115,99,104,105,0,0,0,32,116,101,110,99,0,0,0,0,0,0,1,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])});_.u=_.UI.prototype;_.u.destroy=function(){var a=this,b,c,d,e;return _.I(function(f){if(1==f.a){b=[];c=_.w(a.a.values());for(d=c.next();!d.done;d=c.next())e=d.value,eJ(e),b.push(fJ(e));return _.y(f,Promise.all(b),2)}a.a.clear();a.w.clear();a.D=null;a.j=null;a.H=null;a.B.clear();a.h=null;a.f=!0;_.C(f)})};
323
+ _.u.start=function(){var a=this,b,c,d;return _.I(function(e){if(1==e.a){b=a.D.Qb();c=fF(a.j.periods,b+_.sw);if(!c)throw new _.O(_.P,5,5006,"No period found.");d=a.D.xg(c);if(!d.video&&!d.audio&&!d.text)throw a.g.error("start(): No streams chosen"),new _.O(_.P,5,5005,"No streams chosen.");a.G=!d.video&&!d.audio&&!!d.text;a.A=!!d.fb;return _.y(e,mJ(a,d.audio,d.video,d.text,b),2)}if(a.f)return e["return"]();a.g.debug("init: completed initial Stream setup");a.D&&a.D.rn&&(a.g.debug("init: calling onInitialStreamsSetup()..."),
324
+ a.D.rn());_.C(e)})};_.u.resume=function(){if(!uJ(this))for(var a=_.w(this.a.values()),b=a.next();!b.done;b=a.next())b=b.value,b.endOfStream=!1,cJ(this,b,0)};
325
+ _.u.ic=function(a){var b=this,c,d,e,f,g,h,l;return _.I(function(m){switch(m.a){case 1:if(b.f)return m["return"]();c=rJ(a);if(a.Fb||null==a.vb||a.Dc)return m["return"]();a.vb=null;if(!a.nc){m.F(2);break}b.g.debug(c,"skipping update and clearing the buffer");return _.y(m,wJ(b,a,a.Gf,a.Te),3);case 3:return m["return"]();case 2:_.D(m,4);d=JJ(b,a);null!=d&&(cJ(b,a,d),a.wd=!1);_.Jh(m,5);break;case 4:return e=_.H(m),_.y(m,UJ(b,e),6);case 6:return m["return"]();case 5:ZJ(b,a);if(!vJ(b)){m.F(0);break}if(b.D.configuration.Gm){b.g.debug("End of stream reached, keeping MediaSource open.");
326
+ f=_.w(b.a.values());for(g=f.next();!g.done;g=f.next())h=g.value,h.vb=null;return m["return"]()}b.g.debug("End of stream reached, calling ms.endOfStream().");return _.y(m,b.D.X.endOfStream(),8);case 8:if(b.f)return m["return"]();l=b.D.X.getDuration();l<b.j.presentationTimeline.getDuration()&&(b.j.presentationTimeline.f=l);b.D.Si();_.C(m)}})};
327
+ _.u.Nn=function(a,b,c,d){var e=rE(d.reader),f=rE(d.reader),g=_.yn(d.reader),h=_.yn(d.reader),l=_.yn(d.reader),m=_.yn(d.reader);d=_.Cn(d.reader,d.reader.Wa()-d.reader.getPosition());a=a.startTime+b.startTime+h/g;if(c.includes(e))if("urn:mpeg:dash:event:2012"===e)this.D.Xi();else this.D.onEvent(new _.L("emsg",{detail:{startTime:a,endTime:a+l/g,schemeIdUri:e,value:f,timescale:g,presentationTimeDelta:h,eventDuration:l,id:m,messageData:d}}))};
328
+ _.u.Po=function(a){var b=this,c=!1,d=0;(new _.Dn).N(_.cf,_.En).N(_.Jg,_.En).N(_.Ye,_.En).N(_.bf,_.En).N(_.tg,_.En).aa(_.vg,_.Fn).N("encv",function(e){e.reader.skip(78);_.En(e)}).N("pasp",function(e){d=e.start+e.headerSize;var f=_.yn(e.reader),g=_.yn(e.reader);c=f!==g;b.g.debug("hSpacing\x3d"+f+", vSpacing\x3d"+g+", updatePASP\x3d"+c);e.parser.stop()}).parse(a.data);c&&(a=new _.qn(new DataView(a.data)),a.seek(d),_.W(a,1),_.W(a,1))};_.x(eK,_.Lm);_.u=eK.prototype;_.u.init=function(a,b){var c=a.getMedia();_.Lm.prototype.init.call(this,a,b);LK(this,c)};_.u.namespace=function(){return XD};_.u.setSeekInterceptor=function(a){this.gh=a||null};_.u.setPlaybackSessionId=function(a){this.$g=a};_.u.Uh=function(){return new $G};_.u.getState=function(){return this.Lb};_.u.getDrmInfo=function(){return this.B?this.B.getDrmInfo():null};
329
329
  _.u.unload=function(){var a=this,b;return _.I(function(c){if(1==c.a){jH(a,!1);a.ke=!1;if(!a.ba)return c["return"]();a.log.debug("Unload player with source",a.ba);(b=a.getTrackManager())&&b.release();return a.I===bL?c["return"]():_.y(c,NK(a),2)}a.ba=null;a.dh=0;a.Zb=null;a.ya=null;a.getNetworkEngine().headers["delete"](SD);_.C(c)})};_.u.release=function(){var a=this;return _.I(function(b){if(a.ja)return b["return"](a.ja);a.ja=hK(a);a.ja["finally"](function(){a.ja=null});return b["return"](a.ja)})};
330
- _.u.getBufferInfo=function(a){if(this.M){var b=this.M.lg(),c=new _.zm(void 0,a);switch(a){case _.Tk:return b.video?b.video:c;case _.V:return b.audio?b.audio:c;case _.Sk:return b.text?b.text:c}return b.total?b.total:c}return this.ed?(b=$E(this.ed),RE(b,a)):_.Lm.prototype.getBufferInfo.call(this,a)};_.u.getPosition=function(){var a=this.oe,b=this.getMediaPosition();a.a&&(a=a.a,b-=a.f,b=0>b?0:b>a.a?a.a:b);return b};_.u.getMediaPosition=function(){return this.C?iG(this.C):_.Lm.prototype.getMediaPosition.call(this)};
330
+ _.u.getBufferInfo=function(a){if(this.M){var b=this.M.kg(),c=new _.zm(void 0,a);switch(a){case _.Tk:return b.video?b.video:c;case _.V:return b.audio?b.audio:c;case _.Sk:return b.text?b.text:c}return b.total?b.total:c}return this.ed?(b=$E(this.ed),RE(b,a)):_.Lm.prototype.getBufferInfo.call(this,a)};_.u.getPosition=function(){var a=this.oe,b=this.getMediaPosition();a.a&&(a=a.a,b-=a.f,b=0>b?0:b>a.a?a.a:b);return b};_.u.getMediaPosition=function(){return this.C?iG(this.C):_.Lm.prototype.getMediaPosition.call(this)};
331
331
  _.u.seek=function(a,b){if(this.gh&&!this.gh(a,b))return Promise.resolve();var c=this.oe;c=c.a?a+c.a.dc():a;c!==a&&this.log.info("Seeking to "+a+" s corresponding to media time of "+(c+" s."));return _.Lm.prototype.seek.call(this,c)};_.u.getPresentationStartTime=function(){return this.f?this.f.presentationTimeline.getPresentationStartTime():null};_.u.getDuration=function(){var a=this.oe,b=this.getMediaDuration();return a.a?a.a.getDuration():b};
332
332
  _.u.getMediaDuration=function(){return this.f?this.f.presentationTimeline.getDuration():Infinity};_.u.destroy=function(){var a=this;return _.I(function(b){if(1==b.a)return _.y(b,_.Lm.prototype.destroy.call(a),2);if(a.I===bL)return b["return"]();a.log.debug("Destroying player...");a.I=bL;KK(a);a.w&&(a.w.release(),a.w=null);a.$d=null;a.h=null;_.C(b)})};_.u.getTimeline=function(){return this.$d};
333
333
  _.u.setupPlaylist=function(a){var b=this,c,d,e,f,g,h,l,m,n,p,q,t,v;return _.I(function(z){switch(z.a){case 1:return c=new _.xk,b.A.a=c,_.D(z,2),IK(b),b.Y=_.Ib,_.y(z,PK(b),4);case 4:return dI(b.A,c),d=a[0],d.playlist&&d.playlist.startTime&&(d.startTime=d.playlist.startTime),b.ba=_.Zq(d),b.configuration=_.Jm(b.kb,d),b.log.info("Loading playlist configurations",a),b.$d=iK(b.configuration),_.y(z,QK(b,c),5);case 5:return dI(b.A,c),e=a.map(function(A){return RK(b,A,0,null,!0)}),_.y(z,Promise.all(e),6);
@@ -335,7 +335,7 @@ case 6:f=z.f;g=f.filter(function(A){return A.manifest.presentationTimeline.isLiv
335
335
  q=WG(p,n);b.f=q;t=b;return _.y(z,SK(b,q,b.configuration),7);case 7:return t.B=z.f,dI(b.A,c),_.y(z,TK(b,c),8);case 8:dI(b.A,c);pJ(b.a,q);kK(b,q);c.resolve();_.Jh(z,0);break;case 2:v=_.H(z);if(!b.j){z.F(9);break}return _.y(z,b.j.stop(),10);case 10:b.j=null;case 9:UK(b,v,c),_.C(z)}})};
336
336
  _.u.appendLoad=function(a){var b=this,c;return _.I(function(d){if(1==d.a){IK(b);if(b.Y!==_.Ib)throw new _.O(_.P,7,7003,"Cannot append-load to non-playlist player.");return _.y(d,aL(b,a),2)}c=d.f;b.f=c.manifest;b.j=c.parser;pJ(b.a,c.manifest);vJ(b.a)&&b.a.resume();kK(b,c.manifest);_.C(d)})};_.u.seekWith=function(a){return this.seek(this.getPosition()+a)};
337
337
  _.u.Bh=function(){var a=this;return _.I(function(b){IK(a);if(!a.yf)return a.log.warn("No preloaded asset found"),b["return"]();a.log.info("Loading preloaded asset",a.yf);a.yf=null;return _.y(b,TK(a,null),0)})};_.u.preload=function(a){var b=this;return _.I(function(c){if(1==c.a)return IK(b),_.np("preload.start"),b.log.info("Preloading asset",a),_.y(c,VK(b,a,!1),2);b.yf=a;b.log.info("Preloaded asset",a);_.np("preload.end");_.pp("preload","preload.start","preload.end");_.C(c)})};
338
- _.u.load=function(a){return VK(this,a)};_.u.detach=function(){var a=this;return _.I(function(b){if(1==b.a)return _.y(b,JK(a),2);a.configuration=a.kb;KK(a);_.C(b)})};_.u.isLive=function(){var a;this.f?(a=this.f.presentationTimeline.isLive())||(a=this.f.presentationTimeline,a=Infinity!==a.f&&!a.l):a=!1;return a};_.u.bj=function(){this.log.debug("User seeking finished");this.K&&uL(this);vL(this)};
338
+ _.u.load=function(a){return VK(this,a)};_.u.detach=function(){var a=this;return _.I(function(b){if(1==b.a)return _.y(b,JK(a),2);a.configuration=a.kb;KK(a);_.C(b)})};_.u.isLive=function(){var a;this.f?(a=this.f.presentationTimeline.isLive())||(a=this.f.presentationTimeline,a=Infinity!==a.f&&!a.l):a=!1;return a};_.u.aj=function(){this.log.debug("User seeking finished");this.K&&uL(this);vL(this)};
339
339
  _.u.getSeekRange=function(){var a={start:0,end:0};if(this.f){var b=this.f.presentationTimeline;a={start:rF(b),end:BF(b)}}b=this.oe;b.a?(b=b.a.getDuration(),b>a.end&&(b=a.end),b={start:0,end:b}):b=a;return b};_.u.Kc=function(){return this.f?this.f.presentationTimeline.Kc():null};_.u.getPlaybackRate=function(){if(this.J){var a=this.J;a=a.l?0:a.h}else a=0;return a};
340
340
  _.u.setPlaybackRate=function(a,b){if(0===a)this.log.warn("A trick play rate of 0 is unsupported!");else if(this.I===dK){if(_.Fk()){this.log.warn("Pausing and unpausing to mitigate playbackRate platform issue.");var c=this.getSurface().getMedia();c.pause();this.J.set(a,b);c.play()}else this.J.set(a,b);if((c=this.J.getConfiguration())&&c.preferTrickPlayTracks){c=this.a;var d=1<Math.abs(a),e=c.a.get(_.r);if(e){var f=e.stream;if(f)if(c.g.debug("setTrickPlay",d),d)(d=f.trickModeVideo)&&!e.vc&&(c.g.debug("Engaging trick mode stream",
341
341
  d),_.iJ(c,d,!1,0),e.vc=f);else if(f=e.vc)c.g.debug("Restoring non-trick-mode stream",f),e.vc=null,_.iJ(c,f,!0,0)}}this.h.playbackRateChanged(a)}};_.u.ma=function(){if(this.f&&this.C){var a=rH(this);if(null==a)a=null;else{if(!sH(this.o,a).text){var b=_.ZH(a.textStreams,this.Wd,this.hf,this.Qd);b.length&&(b=b[0],sH(this.o,a).text=b)}a=sH(this.o,a).text}b=[];for(var c=_.w(VL(this)),d=c.next();!d.done;d=c.next()){d=d.value;var e=WH(d);e.activeText=d===a;b.push(e)}return b}return[]};_.u.getPeriods=function(){return this.f.periods};
@@ -344,11 +344,11 @@ _.u.getBandwidthEstimate=function(){return this.h.getBandwidthEstimate()};_.u.ge
344
344
  _.u.addTextTrack=function(a,b,c,d,e,f){var g=this,h,l,m,n,p,q,t,v,z;return _.I(function(A){if(1==A.a){if(g.I!==dK)throw g.log.error("Must call load() and wait for it to resolve before adding text tracks."),Error("State error!");h=rH(g);l=_.er;m=g.f.periods.indexOf(h);n=m+1;p=n>=g.f.periods.length?g.f.presentationTimeline.getDuration():g.f.periods[n].startTime;q=p-h.startTime;if(Infinity===q)throw new _.O(1,4,4040);t=new _.Nj(1,0,q,function(){return[a]},0,null,0);v={id:g.hh++,originalId:null,createSegmentIndex:Promise.resolve.bind(Promise),
345
345
  findSegmentPosition:function(){return 1},getSegmentReference:function(E){return 1===E?t:null},adjustSegmentDurations:function(){},getDuration:function(){return q},segmentLookupStrategy:_.aE,initSegmentReference:null,mimeType:d,codecs:e||"",kind:c,encrypted:!1,keyId:null,language:b,originalLanguage:b,label:f||null,type:l.TEXT,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:null,spatialAudio:!1,closedCaptions:null};g.nf.add(v);h.textStreams.push(v);return _.y(A,dJ(g.a,v),
346
346
  2)}if(z=_.XI(g.a,_.Q))sH(g.o,h).text=z;g.nf["delete"](v);g.log.debug("Choosing new streams after adding a text stream");QL(g,h);hL(g);return A["return"](WH(v))})};
347
- _.u.Uk=function(a){this.log.debug(_.eE,a);try{this.log.debug("onChooseStreams_, choosing variant from ",a.variants);this.log.debug("onChooseStreams_, choosing text from ",a.textStreams);var b=TL(this,a);this.log.debug("onChooseStreams_, chose video ",b.video);this.log.debug("onChooseStreams_, chose audio ",b.audio);this.log.debug("onChooseStreams_, chose text ",b.text);return b}catch(c){return this.onError(c),{audio:null,video:null,text:null,fb:null}}};
348
- _.u.Tk=function(){this.log.debug("canSwitch_");this.ga=!1;this.configuration.abr.enabled&&this.h.enable();this.Ea&&(jJ(this.a,this.Ea,this.Cj,this.Bj),this.Ea=null);this.ca&&(_.iJ(this.a,this.ca,!0,0),this.ca=null)};_.u.Po=function(){this.j&&this.j.update()};_.u.Dn=function(){this.C&&this.C.j.wf()};
349
- _.u.Yj=function(a,b,c){if((void 0===c?"":c)===cE)return hL(this),this.wa()||(this.configuration.abr.enabled=!0,this.h.enable()),QL(this,b,!1),!0;if(c=b.variants.some(function(g){var h=!1,l=g[a.type];l&&(h=g.allowedByApplication&&l.id!==a.id,a.type===_.dd&&(h=h&&l.language===a.language));return h})&&this.wa()){for(var d=_.w(b.variants),e=d.next();!e.done;e=d.next()){e=e.value;var f=e[a.type];f&&f.id===a.id&&(e.allowedByApplication=!1)}hL(this);this.wa()||(this.configuration.abr.enabled=!0,this.h.enable());
350
- QL(this,b)}return c};_.u.qn=function(){this.log.debug("endOfStream called by streaming engine");this.ke=!0};_.u.onError=function(a){if(this.I!==bL&&7001!==a.code&&7E3!==a.code){var b=new _.L(_.Ae,{detail:a});a.severity===_.P&&gK(this,_.Sq);this.trigger(b);b.defaultPrevented&&(b.a=!0)}};_.u.bg=function(a){a.type===_.te?this.dispatchEvent(a):"largegap"!==a.type&&(a.type===_.gh?cL(this):"emsg"!==a.type&&(a instanceof _.L?this.dispatchEvent(a):this.log.debug(_.ec,a.type)))};_.u.wa=function(){return this.configuration.abr.enabled};
351
- _.u.Fo=function(a){var b=this,c,d,e,f,g,h,l,m,n;return _.I(function(p){switch(p.a){case 1:if(!b.cd)return p["return"]();b.log.info("Attempt to switch CDN.");c=b.getLoadedSource();d=b.wa();return _.y(p,b.cd(c.url,a),2);case 2:e=p.f;if(!e)return p["return"]();f=_.N.ua(b.getLoadedSource(),{url:e});d&&b.h.disable();return _.y(p,xJ(b.a),3);case 3:g=xL(b),h=yL(b);case 4:return l=!1,_.D(p,7),b.log.info("Switching CDN to "+f.url+"."),_.y(p,WL(b,f,g,h),9);case 9:_.Jh(p,6);break;case 7:return m=_.H(p),b.log.info("Switch failed"),
347
+ _.u.Tk=function(a){this.log.debug(_.eE,a);try{this.log.debug("onChooseStreams_, choosing variant from ",a.variants);this.log.debug("onChooseStreams_, choosing text from ",a.textStreams);var b=TL(this,a);this.log.debug("onChooseStreams_, chose video ",b.video);this.log.debug("onChooseStreams_, chose audio ",b.audio);this.log.debug("onChooseStreams_, chose text ",b.text);return b}catch(c){return this.onError(c),{audio:null,video:null,text:null,fb:null}}};
348
+ _.u.Sk=function(){this.log.debug("canSwitch_");this.ga=!1;this.configuration.abr.enabled&&this.h.enable();this.Ea&&(jJ(this.a,this.Ea,this.Bj,this.Aj),this.Ea=null);this.ca&&(_.iJ(this.a,this.ca,!0,0),this.ca=null)};_.u.Oo=function(){this.j&&this.j.update()};_.u.Cn=function(){this.C&&this.C.j.wf()};
349
+ _.u.Xj=function(a,b,c){if((void 0===c?"":c)===cE)return hL(this),this.wa()||(this.configuration.abr.enabled=!0,this.h.enable()),QL(this,b,!1),!0;if(c=b.variants.some(function(g){var h=!1,l=g[a.type];l&&(h=g.allowedByApplication&&l.id!==a.id,a.type===_.dd&&(h=h&&l.language===a.language));return h})&&this.wa()){for(var d=_.w(b.variants),e=d.next();!e.done;e=d.next()){e=e.value;var f=e[a.type];f&&f.id===a.id&&(e.allowedByApplication=!1)}hL(this);this.wa()||(this.configuration.abr.enabled=!0,this.h.enable());
350
+ QL(this,b)}return c};_.u.pn=function(){this.log.debug("endOfStream called by streaming engine");this.ke=!0};_.u.onError=function(a){if(this.I!==bL&&7001!==a.code&&7E3!==a.code){var b=new _.L(_.Ae,{detail:a});a.severity===_.P&&gK(this,_.Sq);this.trigger(b);b.defaultPrevented&&(b.a=!0)}};_.u.bg=function(a){a.type===_.te?this.dispatchEvent(a):"largegap"!==a.type&&(a.type===_.gh?cL(this):"emsg"!==a.type&&(a instanceof _.L?this.dispatchEvent(a):this.log.debug(_.ec,a.type)))};_.u.wa=function(){return this.configuration.abr.enabled};
351
+ _.u.Eo=function(a){var b=this,c,d,e,f,g,h,l,m,n;return _.I(function(p){switch(p.a){case 1:if(!b.cd)return p["return"]();b.log.info("Attempt to switch CDN.");c=b.getLoadedSource();d=b.wa();return _.y(p,b.cd(c.url,a),2);case 2:e=p.f;if(!e)return p["return"]();f=_.N.ua(b.getLoadedSource(),{url:e});d&&b.h.disable();return _.y(p,xJ(b.a),3);case 3:g=xL(b),h=yL(b);case 4:return l=!1,_.D(p,7),b.log.info("Switching CDN to "+f.url+"."),_.y(p,WL(b,f,g,h),9);case 9:_.Jh(p,6);break;case 7:return m=_.H(p),b.log.info("Switch failed"),
352
352
  _.y(p,b.cd(f.url,a),10);case 10:if(n=p.f)f.url=n,l=!0;else throw m;case 6:l?p.F(4):(d&&b.h.enable(),tJ(b.a,!0),b.ba[b.getSourceIndex()]=f,a.f=!0,b.trigger(new _.L(_.wd,{newManifest:f.url})),_.C(p))}})};var bL=0,cK=1,dK=2,gL=[_.rf,_.Je];XL.prototype.a=function(){return XD};
353
353
  XL.prototype.canPlay=function(a,b){if(_.Kl())return 0;var c=a.type||"",d=(window.ManagedMediaSource?!0:!1)||(window.MediaSource&&MediaSource.isTypeSupported?!0:!1),e=window.ManagedMediaSource||window.MediaSource&&MediaSource.isTypeSupported?c in _.gv||_.hv(a.url)in _.iv?!0:!1:!1;if(d&&e){if(_.Fk(2))return 1;if(_.Ll()&&c===_.mm){if(b.streaming.preferNativeHlsOnSafari)return 1;_.Yh("Support for MSE + FairPlay on Apple is experimental. In case of issues, consider using native HLS.")}return 2}return 0};
354
354
  XL.prototype.f=function(a){return a===_.qa||a===_.Ib};XL.prototype.create=function(){return new eK};_.hi(new XL);_.jt(function(){_.ci("MediaSource.install");if(window.MediaSource)if(window.cast&&cast.__platform__&&cast.__platform__.canDisplayType)_.bi("Patching Chromecast MSE bugs."),bM();else if(_.Ll()){var a=navigator.appVersion;a=0<=a.indexOf("Version")?parseInt(a.match(/Version\/(\d+)/)[1],10):13;$L();10>=a?(_.bi("Blacklisting MSE on Safari \x3c\x3d 10."),window.MediaSource=null):12>=a?(_.bi("Patching Safari 11 \x26 12 MSE bugs."),YL(),ZL()):(_.bi("Patching Safari 13 MSE bugs."),YL())}else _.Fk(2)||_.Fk(3)||
package/cjs/cl.muxdata.js CHANGED
@@ -1,16 +1,16 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var EC=function(a){switch(a.type){case 1:return BC;case 2:return CC;case 3:return DC}},GC=function(a){var b=Object.keys(a).find(function(c){return FC.includes(c.toLowerCase())});return void 0!==b?a[b]:void 0},HC=function(a,b){this.m=a;this.o=this.f=null;this.B=("000000"+(Math.random()*Math.pow(36,6)<<0).toString(36)).slice(-6);this.a=new _.wi;this.g=b;this.A=this.l=this.h=!1;this.w=null;this.j=a.getNetworkEngine();this.G=this.bl.bind(this);this.C=this.mo.bind(this)},JC=function(a){var b={debug:!0,
2
+ var f=function(window){var EC=function(a){switch(a.type){case 1:return BC;case 2:return CC;case 3:return DC}},GC=function(a){var b=Object.keys(a).find(function(c){return FC.includes(c.toLowerCase())});return void 0!==b?a[b]:void 0},HC=function(a,b){this.m=a;this.o=this.f=null;this.B=("000000"+(Math.random()*Math.pow(36,6)<<0).toString(36)).slice(-6);this.a=new _.wi;this.g=b;this.A=this.l=this.h=!1;this.w=null;this.j=a.getNetworkEngine();this.G=this.al.bind(this);this.C=this.lo.bind(this)},JC=function(a){var b={debug:!0,
3
3
  data:IC(a)};a.f&&a.f.muxOptionsOverride&&_.N.xd(a.f.muxOptionsOverride)&&(b=_.N.ua(b,a.f.muxOptionsOverride));b=_.N.ua(b,{getPlayheadTime:function(){return 1E3*a.m.getPosition()},getStateData:function(){a.g.debug("getStateData()");var c=a.m.getLoadedSource(),d=a.m.getTrackManager(),e=a.m.getSurface(),f={player_is_paused:a.m.isPaused(),player_is_fullscreen:e.isFullscreen(),video_source_duration:1E3*a.m.getDuration(),player_autoplay_on:!!a.m.getConfiguration().autoplay};if(c){var g=new _.$k(c.url);
4
4
  f.video_source_url=_.al(g);f.video_source_mime_type=c.type;c.name&&(f.video_title=c.name)}if(c=e.getContainer())f.player_width=c.offsetWidth,f.player_height=c.offsetHeight;(c=a.m.getSurface().getMedia())?c={videoWidth:c.videoWidth,videoHeight:c.videoHeight}:(c=a.m.getTrackManager().na(),c={videoWidth:c.width,videoHeight:c.height});e=c;c=e.videoWidth;e=e.videoHeight;a.g.debug("Video dimensions: "+c+"x"+e);c&&e&&(f.video_source_height=c,f.video_source_width=e);(d=d.ra())&&d.language&&(f.player_language_code=
5
5
  d.language);return f}});a.g.debug("Mux SDK options",b);return b},IC=function(a){var b={env_key:a.f.envKey,video_title:a.o&&a.o.name||"",player_name:_.xa,player_software_name:_.xa,player_software_version:_.ia,player_mux_plugin_name:"CastlabsPlayer built-in Mux Plugin",player_mux_plugin_version:_.ia};(a=a.m.getConfiguration().viewerId)&&(b.viewer_user_id=a);return b},KC=function(a){a.a.on(a.m,_.Hg,function(){var b={player_playhead_time:1E3*a.m.getPosition()};a.emit(_.Hg,b)});a.a.on(a.m,_.wf,function(){return a.emit(_.wf)});
6
- a.a.on(a.m,_.md,a.Zk.bind(a));a.a.on(a.m,_.rg,a.al.bind(a));a.a.on(a.m,_.Ug,function(){return a.emit(_.jg)});a.a.on(a.m,_.Tg,function(){return a.emit(_.ig)});a.a.on(a.m,_.Ae,a.$k.bind(a));a.a.on(a.m,_.xc,function(){return a.emit("adbreakstart")});a.a.on(a.m,_.yc,function(){return a.emit("adbreakend")});a.a.on(a.m,_.Nc,function(){a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,_.Jc,function(){return a.emit("adpause")});a.a.on(a.m,_.Lc,function(){a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,
6
+ a.a.on(a.m,_.md,a.Yk.bind(a));a.a.on(a.m,_.rg,a.$k.bind(a));a.a.on(a.m,_.Ug,function(){return a.emit(_.jg)});a.a.on(a.m,_.Tg,function(){return a.emit(_.ig)});a.a.on(a.m,_.Ae,a.Zk.bind(a));a.a.on(a.m,_.xc,function(){return a.emit("adbreakstart")});a.a.on(a.m,_.yc,function(){return a.emit("adbreakend")});a.a.on(a.m,_.Nc,function(){a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,_.Jc,function(){return a.emit("adpause")});a.a.on(a.m,_.Lc,function(){a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,
7
7
  _.Oc,function(){return a.emit("adended")});a.a.on(a.m,_.Cc,function(){return a.emit("adfirstquartile")});a.a.on(a.m,_.Ic,function(){return a.emit("admidpoint")});a.a.on(a.m,_.Pc,function(){return a.emit("adthirdquartile")});a.j.fd(a.G);a.j.Sf(a.C);a.a.on(a.m,_.Ae,function(b){var c=b.detail;if(c&&1===c.category&&(b=(b=c.data)&&b.request,void 0!==b&&!0===(1===b.type||2===b.type||3===b.type)))if(7001===c.code){c=b.requestStartTimestamp;var d=new _.$k(b.uris[b.uriIndex]);b={request_start:c,request_type:EC(b),
8
8
  request_hostname:d.a};a.g.debug("onRequestCanceled()","Track event: requestcanceled",b);a.emit("requestcanceled",b)}else{d=b.requestStartTimestamp;var e=new _.$k(b.uris[b.uriIndex]),f=c.data;b={request_start:d,request_type:EC(b),request_hostname:e.a,request_error:""+EC(b)+"LoadError",request_error_code:void 0===f?-1:void 0!==f.response?f.response.status:void 0!==f.status?f.status:-1,request_error_text:c.toString()};a.g.debug("onRequestFailed()","Track event: requestfailed",b);a.emit("requestfailed",
9
9
  b)}})},LC=function(a){_.zi(a.a);a.j.ze(a.G);a.j.Mg(a.C)},MC=function(){this.f=this.m=null;this.a=!1;this.g=new _.K("clpp.muxdata")},NC=function(a){return!_.N.R(a)&&typeof a.init===_.Ee&&typeof a.emit===_.Ee},OC=function(a,b){a.trigger(new _.L(_.Ae,{detail:b}))},PC=function(){},BC="manifest",CC="media",DC="encryption",FC=["x-request-id","cf-ray","x-amz-cf-id","x-akamai-request-id"];_.u=HC.prototype;_.u.initialize=function(a,b,c){this.f=a;this.o=b;this.w=c;if(!this.h){try{this.h=!0,this.w.init(this.B,JC(this))}catch(d){throw this.h=!1,LC(this),new _.O(1,9,9302,null,d);}this.emit("playerready")}this.l&&!this.A&&(a=IC(this),this.emit("videochange",a),this.l=!1);KC(this)};_.u.release=function(){this.g.debug("release()");this.l?this.g.debug(_.na):(LC(this),this.l=!0,this.o=this.f=null)};_.u.destroy=function(){this.g.debug(_.de);this.A?this.g.debug(_.ma):(this.A=!0,this.emit("destroy"))};
10
- _.u.emit=function(a,b){if(null===this.w)throw new _.O(1,9,9301);this.w.emit(this.B,a,b)};_.u.Zk=function(a){this.g.debug(_.hf);var b=a.detail;a=this.m.getTrackManager();b&&b.bandwidth&&(b=b.bandwidth,(a=a.Va())&&a.bandwidth&&(b+=a.bandwidth),this.emit("renditionchange",{video_source_bitrate:b}))};_.u.al=function(a){this.g.debug(_.nf);switch(a.detail.currentState){case _.Tq:this.m.getConfiguration().autoplay&&this.emit(_.wf);break;case _.Vq:this.emit(_.Lf);break;case _.Uq:this.emit(_.sf);break;case _.Oq:this.emit(_.ze)}};
11
- _.u.$k=function(a){this.g.debug(_.kf);if(this.h&&(a=a.detail||null))if(10003===a.code)this.emit("aderror");else if(a.severity===_.P){var b=a.message||"Player error";if(1===a.category||6100===a.code||6007===a.code)b="Download error",6100===a.code?b="Certificate request error":6007===a.code&&(b="License request error"),b=b+" castlabs-error-data:"+JSON.stringify(a.data);this.emit(_.Ae,{player_error_code:a.code,player_error_message:b})}};
12
- _.u.bl=function(a){var b=a.request;if(b=void 0!==b&&!0===(1===b.type||2===b.type||3===b.type))b=a.status,b=void 0!==b&&200<=b&&299>=b;if(b){b=a.request;var c=a.headers,d=b.bytesLoaded,e=b.requestStartTimestamp,f=b.startTime,g=b.endTime,h=e+a.responseStartMs;a=e+a.timeMs;f=f&&g?g-f:void 0;g=new _.$k(b.uris[b.uriIndex]);a={request_start:e,request_type:EC(b),request_hostname:g.a,request_id:GC(c),request_bytes_loaded:d,request_response_start:h,request_response_end:a,request_response_headers:c,request_media_duration:f,
13
- request_url:_.al(g)};this.g.debug("onRequestCompleted()","Track event: requestcompleted",a);this.emit("requestcompleted",a)}};_.u.mo=function(a){a.requestStartTimestamp=Date.now()};_.x(MC,_.gw);_.u=MC.prototype;_.u.onPlayerCreated=function(a){this.m=a;this.f=new HC(a,this.g)};
10
+ _.u.emit=function(a,b){if(null===this.w)throw new _.O(1,9,9301);this.w.emit(this.B,a,b)};_.u.Yk=function(a){this.g.debug(_.hf);var b=a.detail;a=this.m.getTrackManager();b&&b.bandwidth&&(b=b.bandwidth,(a=a.Va())&&a.bandwidth&&(b+=a.bandwidth),this.emit("renditionchange",{video_source_bitrate:b}))};_.u.$k=function(a){this.g.debug(_.nf);switch(a.detail.currentState){case _.Tq:this.m.getConfiguration().autoplay&&this.emit(_.wf);break;case _.Vq:this.emit(_.Lf);break;case _.Uq:this.emit(_.sf);break;case _.Oq:this.emit(_.ze)}};
11
+ _.u.Zk=function(a){this.g.debug(_.kf);if(this.h&&(a=a.detail||null))if(10003===a.code)this.emit("aderror");else if(a.severity===_.P){var b=a.message||"Player error";if(1===a.category||6100===a.code||6007===a.code)b="Download error",6100===a.code?b="Certificate request error":6007===a.code&&(b="License request error"),b=b+" castlabs-error-data:"+JSON.stringify(a.data);this.emit(_.Ae,{player_error_code:a.code,player_error_message:b})}};
12
+ _.u.al=function(a){var b=a.request;if(b=void 0!==b&&!0===(1===b.type||2===b.type||3===b.type))b=a.status,b=void 0!==b&&200<=b&&299>=b;if(b){b=a.request;var c=a.headers,d=b.bytesLoaded,e=b.requestStartTimestamp,f=b.startTime,g=b.endTime,h=e+a.responseStartMs;a=e+a.timeMs;f=f&&g?g-f:void 0;g=new _.$k(b.uris[b.uriIndex]);a={request_start:e,request_type:EC(b),request_hostname:g.a,request_id:GC(c),request_bytes_loaded:d,request_response_start:h,request_response_end:a,request_response_headers:c,request_media_duration:f,
13
+ request_url:_.al(g)};this.g.debug("onRequestCompleted()","Track event: requestcompleted",a);this.emit("requestcompleted",a)}};_.u.lo=function(a){a.requestStartTimestamp=Date.now()};_.x(MC,_.gw);_.u=MC.prototype;_.u.onPlayerCreated=function(a){this.m=a;this.f=new HC(a,this.g)};
14
14
  _.u.onContentWillLoad=function(a,b){var c=a.getConfiguration();c=_.N.nb(c.muxdata);try{var d=[];typeof c===_.gf&&(c.envKey||d.push("envKey"));if(0<d.length)throw new _.O(1,9,9300,{missingKeys:d});var e=a.getConfiguration();d=null;if(this.a=!_.N.R(e.muxdata)&&typeof e.muxdata===_.gf){var f=e.muxdata;d=NC(f.muxLib)?f.muxLib:window.mux;if(!NC(d)){this.g.warn("Mux SDK is not loaded. Will do nothing.");this.a=!1;var g=new _.O(1,9,9301);OC(a,g)}}else this.g.debug("Mux plugin is loaded but not configured. Will do nothing.");
15
15
  var h=d;null!==h&&this.f.initialize(c,b,h)}catch(l){this.a=!1,OC(a,l)}};_.u.onContentLoaded=function(){};_.u.onPlayerWillDestroy=function(){this.a&&(this.f.destroy(),this.m=this.f=null)};_.u.onPlayerWillRelease=function(){this.a&&this.f.release()};_.u.id=function(){return"mux"};_.u.emit=function(a,b){try{this.f.emit(a,b)}catch(c){throw null!==this.m&&OC(this.m,c),c;}};_.J("clpp.muxdata.MuxDataPlugin",MC);MC.prototype.emit=MC.prototype.emit;MC.Id="mux";PC.prototype.create=function(){return new MC};
16
16
  _.cu(new PC);};
@@ -1,9 +1,9 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
2
  var f=function(window){var eC=function(a,b){b=void 0===b?function(){return Promise.resolve()}:b;_.Am.call(this);this.m=a;this.l=b;this.f=0;this.a=[];this.h=!1;this.j=this.Ha.bind(this)},fC=function(a){a.trigger(new _.L(_.Nf))},gC=function(a,b){return 0<=b&&b<a.a.length};_.x(eC,_.Am);_.u=eC.prototype;_.u.on=function(a,b,c){return _.Am.prototype.on.call(this,a,b,c)};_.u.one=function(a,b,c){return _.Am.prototype.one.call(this,a,b,c)};_.u.off=function(a,b){return _.Am.prototype.off.call(this,a,b)};_.u.getPosition=function(){return this.f};
3
- _.u.jm=function(){return this.a};_.u.fe=function(){return 0<this.a.length&&gC(this,this.f)?this.a[this.f]:null};_.u.lm=function(){var a=this.f+1;return 0<this.a.length&&gC(this,a)?this.a[a]:null};_.u.Cm=function(){return this.h};_.u.start=function(){this.h||(this.h=!0,this.m.on(_.ze,this.j),this.ef(this.f,!0))};_.u.stop=function(){this.h=!1;this.m.off(_.ze,this.j)};_.u.Ha=function(){this.next()};
4
- _.u.next=function(){var a=this,b;return _.I(function(c){b=Math.min(a.a.length-1,a.f+1);return _.y(c,a.ef(b),0)})};_.u.eo=function(){var a=this,b;return _.I(function(c){b=Math.max(0,a.f-1);return _.y(c,a.ef(b),0)})};_.u.ef=function(a,b){b=void 0===b?!1:b;var c=this,d;return _.I(function(e){if(1==e.a){if(!(0<c.a.length&&gC(c,a))||!b&&c.f===a)return e["return"]();c.f=a;return(d=c.fe())?_.y(e,c.l(d),3):e.F(0)}if(4!=e.a)return _.y(e,c.m.load(d.configuration),4);c.trigger(new _.L(_.Mf,{item:d}));_.C(e)})};
5
- _.u.append=function(a){this.a.push(a);fC(this)};_.u.xm=function(a,b){if(0<=b&&b<=this.a.length){var c=this.fe();this.a.splice(b,0,a);c&&(this.f=this.a.indexOf(c));fC(this)}};_.u.remove=function(a){if(0<this.a.length&&gC(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);fC(this)}};_.u.clear=function(){this.stop();this.f=0;this.a=[];this.h=!1;fC(this)};_.J("clpp.Playlist",eC);eC.prototype.clear=eC.prototype.clear;eC.prototype.remove=eC.prototype.remove;
6
- eC.prototype.insert=eC.prototype.xm;eC.prototype.append=eC.prototype.append;eC.prototype.goTo=eC.prototype.ef;eC.prototype.previous=eC.prototype.eo;eC.prototype.next=eC.prototype.next;eC.prototype.onEnded=eC.prototype.Ha;eC.prototype.stop=eC.prototype.stop;eC.prototype.start=eC.prototype.start;eC.prototype.isStarted=eC.prototype.Cm;eC.prototype.getUpcoming=eC.prototype.lm;eC.prototype.getCurrent=eC.prototype.fe;eC.prototype.getQueue=eC.prototype.jm;eC.prototype.getPosition=eC.prototype.getPosition;
3
+ _.u.im=function(){return this.a};_.u.fe=function(){return 0<this.a.length&&gC(this,this.f)?this.a[this.f]:null};_.u.km=function(){var a=this.f+1;return 0<this.a.length&&gC(this,a)?this.a[a]:null};_.u.Bm=function(){return this.h};_.u.start=function(){this.h||(this.h=!0,this.m.on(_.ze,this.j),this.ef(this.f,!0))};_.u.stop=function(){this.h=!1;this.m.off(_.ze,this.j)};_.u.Ha=function(){this.next()};
4
+ _.u.next=function(){var a=this,b;return _.I(function(c){b=Math.min(a.a.length-1,a.f+1);return _.y(c,a.ef(b),0)})};_.u.co=function(){var a=this,b;return _.I(function(c){b=Math.max(0,a.f-1);return _.y(c,a.ef(b),0)})};_.u.ef=function(a,b){b=void 0===b?!1:b;var c=this,d;return _.I(function(e){if(1==e.a){if(!(0<c.a.length&&gC(c,a))||!b&&c.f===a)return e["return"]();c.f=a;return(d=c.fe())?_.y(e,c.l(d),3):e.F(0)}if(4!=e.a)return _.y(e,c.m.load(d.configuration),4);c.trigger(new _.L(_.Mf,{item:d}));_.C(e)})};
5
+ _.u.append=function(a){this.a.push(a);fC(this)};_.u.wm=function(a,b){if(0<=b&&b<=this.a.length){var c=this.fe();this.a.splice(b,0,a);c&&(this.f=this.a.indexOf(c));fC(this)}};_.u.remove=function(a){if(0<this.a.length&&gC(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);fC(this)}};_.u.clear=function(){this.stop();this.f=0;this.a=[];this.h=!1;fC(this)};_.J("clpp.Playlist",eC);eC.prototype.clear=eC.prototype.clear;eC.prototype.remove=eC.prototype.remove;
6
+ eC.prototype.insert=eC.prototype.wm;eC.prototype.append=eC.prototype.append;eC.prototype.goTo=eC.prototype.ef;eC.prototype.previous=eC.prototype.co;eC.prototype.next=eC.prototype.next;eC.prototype.onEnded=eC.prototype.Ha;eC.prototype.stop=eC.prototype.stop;eC.prototype.start=eC.prototype.start;eC.prototype.isStarted=eC.prototype.Bm;eC.prototype.getUpcoming=eC.prototype.km;eC.prototype.getCurrent=eC.prototype.fe;eC.prototype.getQueue=eC.prototype.im;eC.prototype.getPosition=eC.prototype.getPosition;
7
7
  eC.prototype.off=eC.prototype.off;eC.prototype.one=eC.prototype.one;eC.prototype.on=eC.prototype.on;};
8
8
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
9
9
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
@@ -7,13 +7,13 @@ a;this.h=b;this.duration=c;this.j=d;this.f=[]},oB=function(a,b){this.f=a;this.ur
7
7
  63|128;this.data=a},vB=function(){this.headers=[]},wB=function(){},xB=function(a){this.j=a;this.f=this.h=this.time=this.sessionId=null},yB=function(){this.f=null;this.events=[]},zB=function(){this.f=this.h=null},AB=function(){this.f=this.h=null},BB=function(a){var b=new AB;b.h=Math.floor(a/1E3);b.f=a%1E3*1E6;return b},EB=function(a,b,c,d,e){var f=new Uint8Array([]),g=this;var h=void 0===h?2500:h;this.o=f;this.l=e;this.w=new uB;this.A=new uB;this.a=[];this.h=setInterval(function(){return CB(g)},h);
8
8
  this.f=null;this.j=!1;DB(this,a,b,c,d)},FB=function(a){return _.I(function(b){switch(b.a){case 1:a.h&&(clearInterval(a.h),a.h=null);if(!a.f){b.F(2);break}return _.y(b,a.f,2);case 2:if(!(0<a.a.length)){b.F(4);break}return _.y(b,CB(a),5);case 5:a.a=[];case 4:a.j=!0,_.C(b)}})},DB=function(a,b,c,d,e){var f=new vB;f.headers=[new rB("CL-BROWSER-NAME",b),new rB("CL-BROWSER-VERSION",c),new rB("CL-OS-FAMILY",d),new rB("CL-OS-VERSION",e),new rB("CL-SDK-NAME",ZA),new rB("CL-SDK-NAME",ZA),new rB("CL-SDK-VERSION",
9
9
  _.ia)];GB(a,f)},CB=function(a){var b,c,d,e;return _.I(function(f){if(1==f.a){if(a.j||a.f)return f["return"]();0===a.a.length&&GB(a,new wB);b=function(){};a.f=new Promise(function(g){b=g});_.Ih(f);c=new yB;c.f=a.o;c.events.push.apply(c.events,_.vh(a.a));d=_.vh(a.a).concat();return _.y(f,fetch(a.l,{method:_.Jb,headers:{"Content-Type":"application/proto"},body:new Uint8Array(c.a())}),4)}if(2!=f.a)if(e=f.f,e.ok)a.a=a.a.filter(function(g){return!d.includes(g)});else throw Error("An error occurred while sending telemetry events to the API, status\x3d'"+
10
- (e.status+"' statusText\x3d'"+e.statusText+"'"));_.Kh(f);b();a.f=null;return _.Lh(f)})},GB=function(a,b){if(!a.j){var c=new xB(a.w);c.sessionId=a.A;var d=Date.now(),e=new zB;e.h=Math.floor(d/1E3);e.f=d%1E3*1E6;c.time=e;c.h=b.getId();c.f=new Uint8Array(b.a());a.a.push(c)}},HB=function(){this.reason=this.currentState=this.previousState=null},IB=function(){this.m=null;this.a=this.l=!1;this.f=new _.wi;this.h=null;this.g=new _.K("clpp.sessions.SessionsPlugin");this.o=this.pn.bind(this);this.j=this.nn.bind(this)},
10
+ (e.status+"' statusText\x3d'"+e.statusText+"'"));_.Kh(f);b();a.f=null;return _.Lh(f)})},GB=function(a,b){if(!a.j){var c=new xB(a.w);c.sessionId=a.A;var d=Date.now(),e=new zB;e.h=Math.floor(d/1E3);e.f=d%1E3*1E6;c.time=e;c.h=b.getId();c.f=new Uint8Array(b.a());a.a.push(c)}},HB=function(){this.reason=this.currentState=this.previousState=null},IB=function(){this.m=null;this.a=this.l=!1;this.f=new _.wi;this.h=null;this.g=new _.K("clpp.sessions.SessionsPlugin");this.o=this.nn.bind(this);this.j=this.mn.bind(this)},
11
11
  QB=function(a){switch(a){case _.Hq:return JB;case _.Tq:return KB;case _.Mq:return LB;case _.Vq:return MB;case _.Uq:return NB;case _.Oq:return OB;case _.Sq:return PB;default:return null}},YB=function(a,b){switch(a){case 1:return RB;case 2:return b===_.r?SB:b===_.dd?TB:b===_.Q?UB:b===_.Ie?VB:WB;case 3:return XB;default:return WB}},ZB=function(a){var b;_.I(function(c){if(1==c.a)return a.g.info("Destroy the session and stop sending events."),_.zi(a.f),a.a=!1,b=a.m.getNetworkEngine(),b.Mg(a.o),b.ze(a.j),
12
12
  $A(b,a.j),a.h?_.y(c,FB(a.h),3):c.F(0);a.h=null;_.C(c)})},$B=function(a,b){a.g.debug("Sending event",b);GB(a.h,b)},aC=function(){};bB.prototype.length=function(){return this.a.length};bB.prototype.end=function(){var a=this.a;this.a=[];return a};nB.prototype.a=function(){var a=new bB;lB(a,1,this.downloadId);eB(a,2,this.h);lB(a,3,this.duration);eB(a,4,this.j);lB(a,5,this.f);return a.end()};nB.prototype.getId=function(){return 4};oB.prototype.a=function(){var a=new bB;eB(a,1,this.f);lB(a,2,this.downloadId);jB(a,3,this.url);lB(a,4,this.headers);jB(a,5,null);lB(a,6,null);lB(a,7,this.duration);hB(a,8,this.size);return a.end()};oB.prototype.getId=function(){return 2};pB.prototype.a=function(){var a=new bB;eB(a,1,this.h);mB(a,2,this.f);return a.end()};qB.prototype.a=function(){var a=new bB;eB(a,1,this.errorCode);eB(a,2,this.severity);jB(a,3,this.message);jB(a,4,this.f);lB(a,5,this.cause);return a.end()};qB.prototype.getId=function(){return 7};rB.prototype.a=function(){var a=new bB;jB(a,1,this.key);jB(a,2,this.value);return a.end()};sB.prototype.a=function(){var a=new bB;eB(a,1,this.code);eB(a,2,this.severity);lB(a,3,this.cause);return a.end()};sB.prototype.getId=function(){return 12};tB.prototype.a=function(){var a=new bB;mB(a,1,this.data);return a.end()};_.x(uB,tB);uB.prototype.toString=function(){for(var a=[],b=0;256>b;++b)a.push((b+256).toString(16).slice(1));return a[this.data[0]]+a[this.data[1]]+a[this.data[2]]+a[this.data[3]]+"-"+a[this.data[4]]+a[this.data[5]]+"-"+a[this.data[6]]+a[this.data[7]]+"-"+a[this.data[8]]+a[this.data[9]]+"-"+a[this.data[10]]+a[this.data[11]]+a[this.data[12]]+a[this.data[13]]+a[this.data[14]]+a[this.data[15]]};vB.prototype.a=function(){var a=new bB;lB(a,1,this.headers);return a.end()};vB.prototype.getId=function(){return 1};wB.prototype.a=function(){return(new bB).end()};wB.prototype.getId=function(){return 6};xB.prototype.a=function(){var a=new bB;lB(a,1,this.j);lB(a,2,this.sessionId);lB(a,3,this.time);hB(a,4,null);jB(a,5,null);eB(a,6,this.h);mB(a,7,this.f);return a.end()};yB.prototype.a=function(){var a=new bB;mB(a,1,this.f);lB(a,2,this.events);return a.end()};zB.prototype.a=function(){var a=new bB;hB(a,1,this.h);eB(a,2,this.f);return a.end()};AB.prototype.a=function(){var a=new bB;hB(a,1,this.h);eB(a,2,this.f);return a.end()};HB.prototype.a=function(){var a=new bB;eB(a,1,this.previousState);eB(a,2,this.currentState);eB(a,3,this.reason);lB(a,4,null);lB(a,5,null);lB(a,6,null);return a.end()};HB.prototype.getId=function(){return 5};_.x(IB,_.gw);_.u=IB.prototype;_.u.onPlayerCreated=function(a){this.m=a};
13
- _.u.onContentWillLoad=function(a){var b=a.getConfiguration().sessions;(b=!(!b||typeof b!==_.gf))||this.g.debug("Sessions plugin is loaded but not configured. Will do nothing.");if(this.l=b)b=a.getConfiguration().sessions,b.apiUrl?(this.g.debug(_.ya),this.g.info("Create a session and start sending events."),a=_.Hk(),this.h=new EB(a.browser,a.browserVersion.name,a.os,a.osVersion.name,b.apiUrl),this.f.on(this.m,_.rg,this.gl.bind(this)),this.f.on(this.m,_.jg,this.fl.bind(this)),this.f.on(this.m,_.ig,
14
- this.el.bind(this)),this.f.on(this.m,_.Ae,this.dl.bind(this)),a=this.m.getNetworkEngine(),a.Sf(this.o),a.fd(this.j),a.j.push(this.j)):(this.g.warn(YA),a.onError(new _.O(1,9,15E3,YA)))};_.u.onPlayerWillRelease=function(){ZB(this)};_.u.id=function(){return"sessions"};_.u.gl=function(a){if(!this.a){a=a.detail;var b=a.currentState,c=new HB;c.previousState=QB(a.previousState);c.currentState=QB(b);$B(this,c)}};
15
- _.u.fl=function(){if(!this.a){var a=new HB;a.previousState=QB(this.m.getState());a.currentState=bC;$B(this,a);this.a=!0}};_.u.el=function(){if(this.a){var a=new HB;a.previousState=bC;a.currentState=QB(this.m.getState());$B(this,a);this.a=!1}};_.u.dl=function(a){a=a.detail;var b=new sB;b=new qB(new pB(b.getId(),new Uint8Array(b.a())));b.errorCode=a.code;b.message=a.message;b.f=a.stack;b.severity=a.severity===_.P?cC:dC;$B(this,b)};
16
- _.u.pn=function(a){var b=new uB;a.downloadId=b;var c=new oB(YB(a.type,a.contentType),a.uris[0]);c.downloadId=b;c.headers=Object.keys(a.headers).map(function(d){return new rB(d,a.headers[d])});$B(this,c)};_.u.nn=function(a){var b=a.request.downloadId;b?(b=new nB(b,a.data.byteLength,BB(a.timeMs||0),a.status||-1),b.f=Object.keys(a.headers).map(function(c){return new rB(c,a.headers[c])}),$B(this,b)):this.g.warn("Download ID is missing on download completed event.")};aC.prototype.create=function(){return new IB};
13
+ _.u.onContentWillLoad=function(a){var b=a.getConfiguration().sessions;(b=!(!b||typeof b!==_.gf))||this.g.debug("Sessions plugin is loaded but not configured. Will do nothing.");if(this.l=b)b=a.getConfiguration().sessions,b.apiUrl?(this.g.debug(_.ya),this.g.info("Create a session and start sending events."),a=_.Hk(),this.h=new EB(a.browser,a.browserVersion.name,a.os,a.osVersion.name,b.apiUrl),this.f.on(this.m,_.rg,this.fl.bind(this)),this.f.on(this.m,_.jg,this.el.bind(this)),this.f.on(this.m,_.ig,
14
+ this.dl.bind(this)),this.f.on(this.m,_.Ae,this.cl.bind(this)),a=this.m.getNetworkEngine(),a.Sf(this.o),a.fd(this.j),a.j.push(this.j)):(this.g.warn(YA),a.onError(new _.O(1,9,15E3,YA)))};_.u.onPlayerWillRelease=function(){ZB(this)};_.u.id=function(){return"sessions"};_.u.fl=function(a){if(!this.a){a=a.detail;var b=a.currentState,c=new HB;c.previousState=QB(a.previousState);c.currentState=QB(b);$B(this,c)}};
15
+ _.u.el=function(){if(!this.a){var a=new HB;a.previousState=QB(this.m.getState());a.currentState=bC;$B(this,a);this.a=!0}};_.u.dl=function(){if(this.a){var a=new HB;a.previousState=bC;a.currentState=QB(this.m.getState());$B(this,a);this.a=!1}};_.u.cl=function(a){a=a.detail;var b=new sB;b=new qB(new pB(b.getId(),new Uint8Array(b.a())));b.errorCode=a.code;b.message=a.message;b.f=a.stack;b.severity=a.severity===_.P?cC:dC;$B(this,b)};
16
+ _.u.nn=function(a){var b=new uB;a.downloadId=b;var c=new oB(YB(a.type,a.contentType),a.uris[0]);c.downloadId=b;c.headers=Object.keys(a.headers).map(function(d){return new rB(d,a.headers[d])});$B(this,c)};_.u.mn=function(a){var b=a.request.downloadId;b?(b=new nB(b,a.data.byteLength,BB(a.timeMs||0),a.status||-1),b.f=Object.keys(a.headers).map(function(c){return new rB(c,a.headers[c])}),$B(this,b)):this.g.warn("Download ID is missing on download completed event.")};aC.prototype.create=function(){return new IB};
17
17
  _.cu(new aC);var dC=1,cC=2;var JB=0,KB=2,PB=3,bC=5,LB=6,MB=8,NB=10,OB=11;var RB=0,SB=1,TB=2,UB=3,VB=4,XB=5,WB=9;};
18
18
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
19
19
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}