@castlabs/prestoplay 6.4.0 → 6.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +6 -6
  5. package/cjs/cl.cast.js +110 -110
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +421 -402
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +72 -72
  10. package/cjs/cl.externs.js +54 -133
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +47 -49
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +31 -32
  15. package/cjs/cl.ima.js +22 -22
  16. package/cjs/cl.mse.js +258 -255
  17. package/cjs/cl.muxdata.js +12 -12
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +14 -14
  20. package/cjs/cl.playlist.js +6 -6
  21. package/cjs/cl.smooth.js +69 -69
  22. package/cjs/cl.thumbnails.js +24 -24
  23. package/cjs/cl.tizen.js +71 -71
  24. package/cjs/cl.ttml.js +27 -27
  25. package/cjs/cl.verimatrix.js +5 -5
  26. package/cjs/cl.vimond.js +13 -13
  27. package/cjs/cl.vr.js +19 -18
  28. package/cjs/cl.vtt.js +14 -14
  29. package/cjs/cl.youbora.js +20 -20
  30. package/cl.adobe.js +3 -3
  31. package/cl.airplay.js +3 -3
  32. package/cl.broadpeak.js +5 -5
  33. package/cl.cast.js +88 -88
  34. package/cl.conviva.js +27 -27
  35. package/cl.core.js +363 -351
  36. package/cl.crypto.js +8 -8
  37. package/cl.dash.js +67 -67
  38. package/cl.externs.js +49 -132
  39. package/cl.freewheel.js +19 -19
  40. package/cl.hls.js +40 -40
  41. package/cl.hlssmpte.js +5 -5
  42. package/cl.htmlcue.js +25 -25
  43. package/cl.ima.js +16 -16
  44. package/cl.mse.js +230 -231
  45. package/cl.muxdata.js +8 -8
  46. package/cl.onboard.js +4 -4
  47. package/cl.persistent.js +9 -9
  48. package/cl.playlist.js +5 -5
  49. package/cl.smooth.js +58 -58
  50. package/cl.thumbnails.js +17 -17
  51. package/cl.tizen.js +57 -57
  52. package/cl.ttml.js +22 -22
  53. package/cl.verimatrix.js +4 -4
  54. package/cl.vimond.js +8 -8
  55. package/cl.vr.js +15 -14
  56. package/cl.vtt.js +12 -12
  57. package/cl.youbora.js +15 -16
  58. package/package.json +8 -2
@@ -1,28 +1,28 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var KJ="clpp-freewheel",LJ="clpp.freewheel.AdsManagerFactory",MJ="freewheel",NJ=function(){this.f=this.a=null},OJ=function(){},PJ=function(a){switch(a){case 0:return tv.freewheel.SDK.ADUNIT_PREROLL;case 1:return tv.freewheel.SDK.ADUNIT_MIDROLL;case 2:return tv.freewheel.SDK.ADUNIT_POSTROLL;default:return""}},QJ=function(a,b,c){this.g=a;this.f=b;this.a=c},RJ=function(a){this.a=a},SJ=function(a){this.B=new _.H("clpp.freewheel.AdsManager");this.l=a;this.g=new _.bg;this.o=new tv.freewheel.SDK.AdManager;
3
- this.f=this.a=null;this.A=[];this.m=[];this.w=[];this.j=new _.ai;this.h=null},TJ=function(a){var b=[];typeof a.networkId!==_.k&&b.push("networkId");typeof a.serverUrl!==_.se&&b.push("serverUrl");typeof a.profileId!==_.se&&b.push("profileId");typeof a.videoAssetId!==_.se&&typeof a.videoAssetId!==_.k&&b.push("videoAssetId");if(b.length)throw new _.L(1,9,12001,{missingKeys:b.join(", ")});},UJ=function(){var a,b,c,d;return _.A(function(e){if(1==e.a)return a=new _.Uo,b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_NONE,
4
- _.y(e,a.canPlay(!1),2);if(3!=e.a)return c=e.f,_.y(e,a.canPlay(!0),3);d=e.f;c?b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_ATTENDED:d&&(b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_UNATTENDED);return e["return"](b)})},XJ=function(a){return _.A(function(b){if(a.A.length)return VJ(a),a.f=a.A.shift(),a.f.play(),b.H(0);WJ(a);return _.y(b,a.l.a.play(),0)})},YJ=function(a){a.w.length?(VJ(a),a.f=a.w.shift(),a.f.play()):WJ(a)},VJ=function(a){var b=a.l.$b(MJ).Dc();b&&(a.l.getSurface().show(b),a.l.getSurface().hideMediaElement(),
5
- a.a.registerVideoDisplayBase(KJ),a.l.isMuted()?a.setVolume(0):a.setVolume(a.l.getVolume()||1))},WJ=function(a){var b=a.l.$b(MJ).Dc();b&&a.l.getSurface().hide(b);a.l.getSurface().showMediaElement()},ZJ=function(a,b,c){var d=null;a.a&&c&&(c.adInstance||c.slot)&&(c=(d=c.adInstance||null)?d.getSlot():c.slot,d={ad:new QJ(a.a,c,d)});a.l.trigger(new _.J(b,d))},$J=function(){this.a=new _.H(LJ)};_.v(NJ,_.Gp);_.t=NJ.prototype;
6
- _.t.onPlayerCreated=function(a){if(window.tv&&tv.freewheel&&tv.freewheel.SDK)this.a=_.Xm(_.Tc,{id:KJ}),this.f=_.Xm(_.Oe,{"class":_.Bc}),this.a.appendChild(this.f),a.getSurface().addElementToContainer(this.a,!0),a.getSurface().hide(this.a);else a.onError(new _.L(1,9,12E3))};_.t.onPlayerWillDestroy=function(a){this.a&&(a.getSurface().removeElementFromContainer(this.a),this.f=this.a=null)};_.t.id=function(){return MJ};_.t.Dc=function(){return this.a};_.t.bi=function(){return this.f};
7
- _.C("clpp.freewheel.FreeWheelPlugin",NJ);NJ.prototype.getAdVideo=NJ.prototype.bi;NJ.prototype.getAdContainer=NJ.prototype.Dc;NJ.Id=MJ;NJ.AD_CONTAINER_ID=KJ;OJ.prototype.create=function(){return new NJ};_.Un(new OJ);_.t=QJ.prototype;_.t.sb=function(){return"FreeWheel AdManager SDK"};_.t.tb=function(){return tv.freewheel.SDK.version};_.t.yb=function(){return 0};_.t.getId=function(){return this.a?this.a.getAdId():""};_.t.getCreativeId=function(){var a=(this.a||{})._creativeId;return typeof a===_.se?a:""};_.t.getApiFramework=function(){return this.a?this.a.getActiveCreativeRendition().getCreativeApi():""};_.t.getAdSystem=function(){return""};_.t.getAdvertiserName=function(){return""};_.t.getTitle=function(){return""};
8
- _.t.getDuration=function(){return this.a?this.a.getActiveCreativeRendition().getDuration():0};_.t.getSkipTimeOffset=function(){return 0};_.t.dc=function(){return!1};_.t.Ib=function(){return this.a&&this.a.getEventCallbackUrls(tv.freewheel.SDK.EVENT_AD_CLICK,tv.freewheel.SDK.EVENT_TYPE_CLICK)[0]||""};_.t.getMediaUrl=function(){return this.a?this.a.getActiveCreativeRendition().getPrimaryCreativeRenditionAsset().getUrl():""};
9
- _.t.vb=function(){return this.a?this.a.getActiveCreativeRendition().getWidth():0};_.t.ub=function(){return this.a?this.a.getActiveCreativeRendition().getHeight():0};_.t.gb=function(){return 0};_.t.Ua=function(){switch(this.f.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:return 0;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:return 2;default:return 1}};
10
- _.t.getPodIndex=function(){switch(this.Ua()){case 0:return 0;case 2:return-1}return this.g.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL).indexOf(this.f)+1};_.t.Jb=function(){switch(this.Ua()){case 0:return 0;case 2:return-1;default:return this.f.getTimePosition()}};_.t.Kb=function(){return this.a?this.f.getAdInstances().indexOf(this.a)+1:1};_.t.xb=function(){return this.f.getAdCount()};_.t.getWrapperAdIds=function(){return[]};_.t.getWrapperAdSystems=function(){return[]};
11
- _.t.getWrapperCreativeIds=function(){return[]};QJ.prototype.getWrapperCreativeIds=QJ.prototype.getWrapperCreativeIds;QJ.prototype.getWrapperAdSystems=QJ.prototype.getWrapperAdSystems;QJ.prototype.getWrapperAdIds=QJ.prototype.getWrapperAdIds;QJ.prototype.getSequenceLength=QJ.prototype.xb;QJ.prototype.getPositionInSequence=QJ.prototype.Kb;QJ.prototype.getPodTimeOffset=QJ.prototype.Jb;QJ.prototype.getPodIndex=QJ.prototype.getPodIndex;QJ.prototype.getPodType=QJ.prototype.Ua;
12
- QJ.prototype.getMediaBitrate=QJ.prototype.gb;QJ.prototype.getMediaHeight=QJ.prototype.ub;QJ.prototype.getMediaWidth=QJ.prototype.vb;QJ.prototype.getMediaUrl=QJ.prototype.getMediaUrl;QJ.prototype.getClickThroughUrl=QJ.prototype.Ib;QJ.prototype.isBumper=QJ.prototype.dc;QJ.prototype.getSkipTimeOffset=QJ.prototype.getSkipTimeOffset;QJ.prototype.getDuration=QJ.prototype.getDuration;QJ.prototype.getTitle=QJ.prototype.getTitle;QJ.prototype.getAdvertiserName=QJ.prototype.getAdvertiserName;
13
- QJ.prototype.getAdSystem=QJ.prototype.getAdSystem;QJ.prototype.getApiFramework=QJ.prototype.getApiFramework;QJ.prototype.getCreativeId=QJ.prototype.getCreativeId;QJ.prototype.getId=QJ.prototype.getId;QJ.prototype.getTechnology=QJ.prototype.yb;QJ.prototype.getAdManagerVersion=QJ.prototype.tb;QJ.prototype.getAdManagerName=QJ.prototype.sb;RJ.prototype.getCuePoints=function(){return this.a.getTemporalSlots().map(function(a){switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:return 0;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:return-1;default:return a.getTimePosition()}})};RJ.prototype.Lb=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL).length};RJ.prototype.hb=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL).length};
14
- RJ.prototype.hasPostroll=RJ.prototype.hb;RJ.prototype.hasPreroll=RJ.prototype.Lb;RJ.prototype.getCuePoints=RJ.prototype.getCuePoints;_.t=SJ.prototype;
15
- _.t.load=function(){var a=this,b,c,d,e,f,g,h,l;return _.A(function(m){if(1==m.a){b=a.l.getConfiguration().freewheel||{};try{TJ(b)}catch(n){return a.l.onError(n),a.j.resolve(),m["return"](a.j)}a.o.setNetwork(b.networkId);a.o.setServer(b.serverUrl);a.a=a.o.newContext();a.a.setProfile(b.profileId);typeof b.siteSectionId!==_.se&&typeof b.siteSectionId!==_.k||a.a.setSiteSection(b.siteSectionId);return _.y(m,UJ(),2)}c=m.f;a.a.setVideoAsset(b.videoAssetId,a.l.getDuration(),void 0,void 0,c);if(Array.isArray(b.pods))for(d=
16
- _.u(b.pods),e=d.next();!e.done;e=d.next())f=e.value,a.a.addTemporalSlot(f.id,PJ(f.type),f.position,f.slotProfile,f.cuepointSequence,f.maxDuration,f.minDuration,f.acceptContentType);b.keyValues&&typeof b.keyValues===_.Gd&&Object.keys(b.keyValues).forEach(function(n){return a.a.addKeyValue(n,b.keyValues[n])});a.a.setParameter(tv.freewheel.SDK.PARAMETER_EXTENSION_CONTENT_VIDEO_ENABLED,!1,tv.freewheel.SDK.PARAMETER_LEVEL_GLOBAL);if(Array.isArray(b.parameters))for(g=_.u(b.parameters),h=g.next();!h.done;h=
17
- g.next())l=h.value,a.a.setParameter(l.name,l.value,l.level);a.g.on(a.a,tv.freewheel.SDK.EVENT_REQUEST_COMPLETE,a.ij.bind(a));a.g.on(a.a,tv.freewheel.SDK.EVENT_SLOT_STARTED,a.mj.bind(a));a.g.on(a.a,tv.freewheel.SDK.EVENT_SLOT_ENDED,a.lj.bind(a));a.g.on(a.a,tv.freewheel.SDK.EVENT_AD,a.Ei.bind(a));a.g.on(a.l,_.Ce,a.ih.bind(a));a.g.on(a.l,_.oe,a.hh.bind(a));a.a.submitRequest();return m["return"](a.j)})};_.t.start=function(){var a=this;return _.A(function(b){return _.y(b,XJ(a),0)})};
18
- _.t.resume=function(){this.f&&this.f.resume()};_.t.pause=function(){this.f&&this.f.pause()};_.t.skip=function(){this.f&&this.f.skipCurrentAd()};_.t.getVolume=function(){return this.a?this.a.getAdVolume():1};_.t.setVolume=function(a){this.a&&this.a.setAdVolume(a)};_.t.getPosition=function(){return this.f?this.f.getPlayheadTime():-1};_.t.dispose=function(){var a=this;return _.A(function(b){a.g.release();a.h&&(a.h.stop(),a.h=null);WJ(a);a.a&&(a.a.dispose(),a.a=null);_.z(b)})};
19
- _.t.ij=function(a){var b=this;if(a.success)this.A=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL),this.m=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL),this.w=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL),this.l.trigger(new _.J(_.Tb,{adsTimeline:new RJ(this.a)})),this.h=new _.So(this.l.getSurface(),function(c,d){return b.a.resize(c,d)},this.l.$b(MJ).f);else this.l.onError(new _.L(1,9,10003,{errorType:0},
20
- void 0));this.j.resolve()};_.t.mj=function(a){ZJ(this,_.Bb,a);this.h.start()};_.t.lj=function(a){this.f=null;a=a.slot;ZJ(this,_.Cb);this.h.stop();if(a)switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:XJ(this);break;case tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL:WJ(this);this.l.play();break;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:YJ(this)}};
21
- _.t.Ei=function(a){var b=a.subType;this.B.debug("ad event",b);switch(b){case tv.freewheel.SDK.EVENT_AD_IMPRESSION:ZJ(this,_.Pb,a);ZJ(this,_.Ib,a);break;case tv.freewheel.SDK.EVENT_AD_IMPRESSION_END:ZJ(this,_.Qb,a);break;case tv.freewheel.SDK.EVENT_AD_FIRST_QUARTILE:ZJ(this,_.Hb,a);break;case tv.freewheel.SDK.EVENT_AD_MIDPOINT:ZJ(this,_.Kb,a);break;case tv.freewheel.SDK.EVENT_AD_THIRD_QUARTILE:ZJ(this,_.Rb,a);break;case tv.freewheel.SDK.EVENT_AD_COMPLETE:ZJ(this,_.Gb,a);break;case tv.freewheel.SDK.EVENT_AD_CLICK:ZJ(this,
22
- _.Fb,a);break;case tv.freewheel.SDK.EVENT_AD_PAUSE:ZJ(this,_.Lb,a);break;case tv.freewheel.SDK.EVENT_AD_RESUME:ZJ(this,_.Nb,a);break;case tv.freewheel.SDK.EVENT_AD_SKIPPED:ZJ(this,_.Ob,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_START:ZJ(this,_.Eb,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_END:ZJ(this,_.Mb,a);break;case tv.freewheel.SDK.EVENT_ERROR:this.l.onError(new _.L(1,9,10003,{errorType:1},{fwCode:a[tv.freewheel.SDK.INFO_KEY_ERROR_CODE],fwInfo:a[tv.freewheel.SDK.INFO_KEY_ERROR_INFO],
23
- fwModule:a[tv.freewheel.SDK.INFO_KEY_ERROR_MODULE]}))}};_.t.ih=function(){var a=this;if(!this.f){var b=this.l.getPosition();if(this.f=this.m.find(function(d){return.5>Math.abs(b-d.getTimePosition())})||null){var c=this.m.findIndex(function(d){return d===a.f});this.m.splice(c,1);this.l.pause();VJ(this);this.f.play()}}};
24
- _.t.hh=function(a){if((a=a.detail)&&this.a)switch(a.currentState){case _.xm:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PLAYING);break;case _.wm:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PAUSED);break;case _.qm:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_COMPLETED);YJ(this);break;case _.jm:case _.um:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_STOPPED)}};SJ.prototype.getPosition=SJ.prototype.getPosition;SJ.prototype.setVolume=SJ.prototype.setVolume;
25
- SJ.prototype.getVolume=SJ.prototype.getVolume;SJ.prototype.skip=SJ.prototype.skip;SJ.prototype.pause=SJ.prototype.pause;SJ.prototype.resume=SJ.prototype.resume;SJ.prototype.start=SJ.prototype.start;$J.prototype.name=function(){return LJ};$J.prototype.W=function(a,b){return a.namespace()===_.Dc?!1:window.tv&&tv.freewheel&&tv.freewheel.SDK?!(!b||!b.freewheel):(this.a.warn("FreeWheel SDK is not loaded."),!1)};$J.prototype.create=function(a){return new SJ(a)};$J.prototype.create=$J.prototype.create;$J.prototype.isSupported=$J.prototype.W;$J.prototype.name=$J.prototype.name;_.Um(new $J);};
2
+ var f=function(window){var fK="clpp-freewheel",gK="clpp.freewheel.AdsManagerFactory",hK="freewheel",iK=function(){this.f=this.a=null},jK=function(){},kK=function(a){switch(a){case 0:return tv.freewheel.SDK.ADUNIT_PREROLL;case 1:return tv.freewheel.SDK.ADUNIT_MIDROLL;case 2:return tv.freewheel.SDK.ADUNIT_POSTROLL;default:return""}},lK=function(a,b,c){this.g=a;this.f=b;this.a=c},mK=function(a){this.a=a},nK=function(a){this.B=new _.H("clpp.freewheel.AdsManager");this.l=a;this.g=new _.dg;this.o=new tv.freewheel.SDK.AdManager;
3
+ this.f=this.a=null;this.A=[];this.m=[];this.w=[];this.j=new _.Nh;this.h=null},oK=function(a){var b=[];typeof a.networkId!==_.k&&b.push("networkId");typeof a.serverUrl!==_.ue&&b.push("serverUrl");typeof a.profileId!==_.ue&&b.push("profileId");typeof a.videoAssetId!==_.ue&&typeof a.videoAssetId!==_.k&&b.push("videoAssetId");if(b.length)throw new _.L(1,9,12001,{missingKeys:b.join(", ")});},pK=function(){var a,b,c,d;return _.B(function(e){if(1==e.a)return a=new _.tp,b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_NONE,
4
+ _.x(e,a.canPlay(!1),2);if(3!=e.a)return c=e.f,_.x(e,a.canPlay(!0),3);d=e.f;c?b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_ATTENDED:d&&(b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_UNATTENDED);return e["return"](b)})},sK=function(a){return _.B(function(b){if(a.A.length)return qK(a),a.f=a.A.shift(),a.f.play(),b.H(0);rK(a);return _.x(b,a.l.a.play(),0)})},tK=function(a){a.w.length?(qK(a),a.f=a.w.shift(),a.f.play()):rK(a)},qK=function(a){var b=a.l.bc(hK).Fc();b&&(a.l.getSurface().show(b),a.l.getSurface().hideMediaElement(),
5
+ a.a.registerVideoDisplayBase(fK),a.l.isMuted()?a.setVolume(0):a.setVolume(a.l.getVolume()||1))},rK=function(a){var b=a.l.bc(hK).Fc();b&&a.l.getSurface().hide(b);a.l.getSurface().showMediaElement()},uK=function(a,b,c){var d=null;a.a&&c&&(c.adInstance||c.slot)&&(c=(d=c.adInstance||null)?d.getSlot():c.slot,d={ad:new lK(a.a,c,d)});a.l.trigger(new _.J(b,d))},vK=function(){this.a=new _.H(gK)};_.v(iK,_.eq);_.t=iK.prototype;
6
+ _.t.onPlayerCreated=function(a){if(window.tv&&tv.freewheel&&tv.freewheel.SDK)this.a=_.zn(_.Wc,{id:fK}),this.f=_.zn(_.Qe,{"class":_.Ec}),this.a.appendChild(this.f),a.getSurface().addElementToContainer(this.a,!0),a.getSurface().hide(this.a);else a.onError(new _.L(1,9,12E3))};_.t.onPlayerWillDestroy=function(a){this.a&&(a.getSurface().removeElementFromContainer(this.a),this.f=this.a=null)};_.t.id=function(){return hK};_.t.Fc=function(){return this.a};_.t.fi=function(){return this.f};
7
+ _.C("clpp.freewheel.FreeWheelPlugin",iK);iK.prototype.getAdVideo=iK.prototype.fi;iK.prototype.getAdContainer=iK.prototype.Fc;iK.Id=hK;iK.AD_CONTAINER_ID=fK;jK.prototype.create=function(){return new iK};_.wo(new jK);_.t=lK.prototype;_.t.sb=function(){return"FreeWheel AdManager SDK"};_.t.tb=function(){return tv.freewheel.SDK.version};_.t.yb=function(){return 0};_.t.getId=function(){return this.a?this.a.getAdId():""};_.t.getCreativeId=function(){var a=(this.a||{})._creativeId;return typeof a===_.ue?a:""};_.t.getApiFramework=function(){return this.a?this.a.getActiveCreativeRendition().getCreativeApi():""};_.t.getAdSystem=function(){return""};_.t.getAdvertiserName=function(){return""};_.t.getTitle=function(){return""};
8
+ _.t.getDuration=function(){return this.a?this.a.getActiveCreativeRendition().getDuration():0};_.t.getSkipTimeOffset=function(){return 0};_.t.fc=function(){return!1};_.t.Kb=function(){return this.a&&this.a.getEventCallbackUrls(tv.freewheel.SDK.EVENT_AD_CLICK,tv.freewheel.SDK.EVENT_TYPE_CLICK)[0]||""};_.t.getMediaUrl=function(){return this.a?this.a.getActiveCreativeRendition().getPrimaryCreativeRenditionAsset().getUrl():""};
9
+ _.t.vb=function(){return this.a?this.a.getActiveCreativeRendition().getWidth():0};_.t.ub=function(){return this.a?this.a.getActiveCreativeRendition().getHeight():0};_.t.hb=function(){return 0};_.t.Va=function(){switch(this.f.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:return 0;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:return 2;default:return 1}};
10
+ _.t.getPodIndex=function(){switch(this.Va()){case 0:return 0;case 2:return-1}return this.g.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL).indexOf(this.f)+1};_.t.Lb=function(){switch(this.Va()){case 0:return 0;case 2:return-1;default:return this.f.getTimePosition()}};_.t.Mb=function(){return this.a?this.f.getAdInstances().indexOf(this.a)+1:1};_.t.xb=function(){return this.f.getAdCount()};_.t.getWrapperAdIds=function(){return[]};_.t.getWrapperAdSystems=function(){return[]};
11
+ _.t.getWrapperCreativeIds=function(){return[]};lK.prototype.getWrapperCreativeIds=lK.prototype.getWrapperCreativeIds;lK.prototype.getWrapperAdSystems=lK.prototype.getWrapperAdSystems;lK.prototype.getWrapperAdIds=lK.prototype.getWrapperAdIds;lK.prototype.getSequenceLength=lK.prototype.xb;lK.prototype.getPositionInSequence=lK.prototype.Mb;lK.prototype.getPodTimeOffset=lK.prototype.Lb;lK.prototype.getPodIndex=lK.prototype.getPodIndex;lK.prototype.getPodType=lK.prototype.Va;
12
+ lK.prototype.getMediaBitrate=lK.prototype.hb;lK.prototype.getMediaHeight=lK.prototype.ub;lK.prototype.getMediaWidth=lK.prototype.vb;lK.prototype.getMediaUrl=lK.prototype.getMediaUrl;lK.prototype.getClickThroughUrl=lK.prototype.Kb;lK.prototype.isBumper=lK.prototype.fc;lK.prototype.getSkipTimeOffset=lK.prototype.getSkipTimeOffset;lK.prototype.getDuration=lK.prototype.getDuration;lK.prototype.getTitle=lK.prototype.getTitle;lK.prototype.getAdvertiserName=lK.prototype.getAdvertiserName;
13
+ lK.prototype.getAdSystem=lK.prototype.getAdSystem;lK.prototype.getApiFramework=lK.prototype.getApiFramework;lK.prototype.getCreativeId=lK.prototype.getCreativeId;lK.prototype.getId=lK.prototype.getId;lK.prototype.getTechnology=lK.prototype.yb;lK.prototype.getAdManagerVersion=lK.prototype.tb;lK.prototype.getAdManagerName=lK.prototype.sb;mK.prototype.getCuePoints=function(){return this.a.getTemporalSlots().map(function(a){switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:return 0;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:return-1;default:return a.getTimePosition()}})};mK.prototype.Nb=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL).length};mK.prototype.ib=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL).length};
14
+ mK.prototype.hasPostroll=mK.prototype.ib;mK.prototype.hasPreroll=mK.prototype.Nb;mK.prototype.getCuePoints=mK.prototype.getCuePoints;_.t=nK.prototype;
15
+ _.t.load=function(){var a=this,b,c,d,e,f,g,h,l;return _.B(function(m){if(1==m.a){b=a.l.getConfiguration().freewheel||{};try{oK(b)}catch(n){return a.l.onError(n),a.j.resolve(),m["return"](a.j)}a.o.setNetwork(b.networkId);a.o.setServer(b.serverUrl);a.a=a.o.newContext();a.a.setProfile(b.profileId);typeof b.siteSectionId!==_.ue&&typeof b.siteSectionId!==_.k||a.a.setSiteSection(b.siteSectionId);return _.x(m,pK(),2)}c=m.f;a.a.setVideoAsset(b.videoAssetId,a.l.getDuration(),void 0,void 0,c);if(Array.isArray(b.pods))for(d=
16
+ _.u(b.pods),e=d.next();!e.done;e=d.next())f=e.value,a.a.addTemporalSlot(f.id,kK(f.type),f.position,f.slotProfile,f.cuepointSequence,f.maxDuration,f.minDuration,f.acceptContentType);b.keyValues&&typeof b.keyValues===_.Jd&&Object.keys(b.keyValues).forEach(function(n){return a.a.addKeyValue(n,b.keyValues[n])});a.a.setParameter(tv.freewheel.SDK.PARAMETER_EXTENSION_CONTENT_VIDEO_ENABLED,!1,tv.freewheel.SDK.PARAMETER_LEVEL_GLOBAL);if(Array.isArray(b.parameters))for(g=_.u(b.parameters),h=g.next();!h.done;h=
17
+ g.next())l=h.value,a.a.setParameter(l.name,l.value,l.level);a.g.on(a.a,tv.freewheel.SDK.EVENT_REQUEST_COMPLETE,a.lj.bind(a));a.g.on(a.a,tv.freewheel.SDK.EVENT_SLOT_STARTED,a.pj.bind(a));a.g.on(a.a,tv.freewheel.SDK.EVENT_SLOT_ENDED,a.oj.bind(a));a.g.on(a.a,tv.freewheel.SDK.EVENT_AD,a.Hi.bind(a));a.g.on(a.l,_.Ee,a.nh.bind(a));a.g.on(a.l,_.re,a.mh.bind(a));a.a.submitRequest();return m["return"](a.j)})};_.t.start=function(){var a=this;return _.B(function(b){return _.x(b,sK(a),0)})};
18
+ _.t.resume=function(){this.f&&this.f.resume()};_.t.pause=function(){this.f&&this.f.pause()};_.t.skip=function(){this.f&&this.f.skipCurrentAd()};_.t.getVolume=function(){return this.a?this.a.getAdVolume():1};_.t.setVolume=function(a){this.a&&this.a.setAdVolume(a)};_.t.getPosition=function(){return this.f?this.f.getPlayheadTime():-1};_.t.dispose=function(){var a=this;return _.B(function(b){a.g.release();a.h&&(a.h.stop(),a.h=null);rK(a);a.a&&(a.a.dispose(),a.a=null);_.z(b)})};
19
+ _.t.lj=function(a){var b=this;if(a.success)this.A=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL),this.m=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL),this.w=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL),this.l.trigger(new _.J(_.Wb,{adsTimeline:new mK(this.a)})),this.h=new _.rp(this.l.getSurface(),function(c,d){return b.a.resize(c,d)},this.l.bc(hK).f);else this.l.onError(new _.L(1,9,10003,{errorType:0},
20
+ void 0));this.j.resolve()};_.t.pj=function(a){uK(this,_.Fb,a);this.h.start()};_.t.oj=function(a){this.f=null;a=a.slot;uK(this,_.Gb);this.h.stop();if(a)switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:sK(this);break;case tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL:rK(this);this.l.play();break;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:tK(this)}};
21
+ _.t.Hi=function(a){var b=a.subType;this.B.debug("ad event",b);switch(b){case tv.freewheel.SDK.EVENT_AD_IMPRESSION:uK(this,_.Sb,a);uK(this,_.Lb,a);break;case tv.freewheel.SDK.EVENT_AD_IMPRESSION_END:uK(this,_.Tb,a);break;case tv.freewheel.SDK.EVENT_AD_FIRST_QUARTILE:uK(this,_.Kb,a);break;case tv.freewheel.SDK.EVENT_AD_MIDPOINT:uK(this,_.Nb,a);break;case tv.freewheel.SDK.EVENT_AD_THIRD_QUARTILE:uK(this,_.Ub,a);break;case tv.freewheel.SDK.EVENT_AD_COMPLETE:uK(this,_.Jb,a);break;case tv.freewheel.SDK.EVENT_AD_CLICK:uK(this,
22
+ _.Ib,a);break;case tv.freewheel.SDK.EVENT_AD_PAUSE:uK(this,_.Ob,a);break;case tv.freewheel.SDK.EVENT_AD_RESUME:uK(this,_.Qb,a);break;case tv.freewheel.SDK.EVENT_AD_SKIPPED:uK(this,_.Rb,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_START:uK(this,_.Hb,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_END:uK(this,_.Pb,a);break;case tv.freewheel.SDK.EVENT_ERROR:this.l.onError(new _.L(1,9,10003,{errorType:1},{fwCode:a[tv.freewheel.SDK.INFO_KEY_ERROR_CODE],fwInfo:a[tv.freewheel.SDK.INFO_KEY_ERROR_INFO],
23
+ fwModule:a[tv.freewheel.SDK.INFO_KEY_ERROR_MODULE]}))}};_.t.nh=function(){var a=this;if(!this.f){var b=this.l.getPosition();if(this.f=this.m.find(function(d){return.5>Math.abs(b-d.getTimePosition())})||null){var c=this.m.findIndex(function(d){return d===a.f});this.m.splice(c,1);this.l.pause();qK(this);this.f.play()}}};
24
+ _.t.mh=function(a){if((a=a.detail)&&this.a)switch(a.currentState){case _.cn:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PLAYING);break;case _.bn:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PAUSED);break;case _.Wm:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_COMPLETED);tK(this);break;case _.Pm:case _.$m:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_STOPPED)}};nK.prototype.getPosition=nK.prototype.getPosition;nK.prototype.setVolume=nK.prototype.setVolume;
25
+ nK.prototype.getVolume=nK.prototype.getVolume;nK.prototype.skip=nK.prototype.skip;nK.prototype.pause=nK.prototype.pause;nK.prototype.resume=nK.prototype.resume;nK.prototype.start=nK.prototype.start;vK.prototype.name=function(){return gK};vK.prototype.ca=function(a,b){return a.namespace()===_.Gc?!1:window.tv&&tv.freewheel&&tv.freewheel.SDK?!(!b||!b.freewheel):(this.a.warn("FreeWheel SDK is not loaded."),!1)};vK.prototype.create=function(a){return new nK(a)};vK.prototype.create=vK.prototype.create;vK.prototype.isSupported=vK.prototype.ca;vK.prototype.name=vK.prototype.name;_.wn(new vK);};
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;});}
28
28
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.hls.js CHANGED
@@ -1,53 +1,51 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var jA="BANDWIDTH",kA="CLOSED-CAPTIONS",lA="EXT-X-BYTERANGE",mA="EXT-X-DISCONTINUITY",nA="EXT-X-DISCONTINUITY-SEQUENCE",oA="EXT-X-ENDLIST",pA="EXT-X-MEDIA-SEQUENCE",qA="EXT-X-PART-INF",rA="EXT-X-PLAYLIST-TYPE",sA="EXT-X-PRELOAD-HINT",tA="EXT-X-SERVER-CONTROL",uA="EXT-X-STREAM-INF",vA="EXT-X-TARGETDURATION",wA="EXTINF",xA="GROUP-ID",yA="Guessing audio-only",zA="SAMPLE-AES-CTR",AA="SUBTITLES",BA="URI",CA="application/vnd.apple.mpegurl",DA=function(a){if(1>a.a)throw _.Sj();--a.a},EA=function(a,b){b=
3
- void 0===b?0:b;return b+10<=a.length&&73===a[b]&&68===a[b+1]&&51===a[b+2]&&255>a[b+3]&&255>a[b+4]&&128>a[b+6]&&128>a[b+7]&&128>a[b+8]&&128>a[b+9]?!0:!1},FA=function(a,b,c,d){this.f=a;this.type=b;this.sa=c;this.a=d||null},GA=function(a,b,c,d){this.id=a;this.name=b;this.attributes=c;this.value=void 0===d?null:d},HA=function(a,b,c){return(a=a.getAttribute(b))?a.value:c||null},IA=function(a,b){var c=a.getAttribute(b);if(!c)throw new _.L(_.M,4,4023,b);return c.value},JA=function(a,b){this.name=a;this.value=
4
- b},KA=function(a,b,c){c=void 0===c?[]:c;this.sa=b;this.a=a;this.f=c},LA=function(a,b){return a.filter(function(c){return c.name==b})},MA=function(a,b){return a.filter(function(c){return IA(c,"TYPE")===b})},NA=function(a,b){var c=LA(a,b);return c.length?c[0]:null},OA=function(a){var b=void 0===b?0:b;return(a=NA(a,pA))?Number(a.value):b},PA=function(a,b){return _.jv([a],[b])[0]},QA=function(){this.a=0},VA=function(a,b,c){b=_.ah(b);b=b.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n").trim();var d=b.split(/\n+/m);
5
- if(!/^#EXTM3U($|[ \t\n])/m.test(d[0]))throw new _.L(_.M,4,4015);b=0;for(var e=!0,f=_.u(d),g=f.next();!g.done;g=f.next())if(g=g.value,g=g.trim(),!g.length||/^#(?!EXT)/m.test(g)||e)e=!1;else if(g=RA(a,g),--a.a,SA.includes(g.name)){b=1;break}else g.name==uA&&(e=!0);f=[];e=!0;g=_.u(_.iA(d));for(var h=g.next();!h.done;h=g.next()){var l=h.value;h=l.Gd;var m=l.item;l=l.next;m=m.trim();if(!m.length||/^#(?!EXT)/m.test(m)||e)e=!1;else{m=RA(a,m);if(TA.includes(m.name)){if(1!=b)throw new _.L(_.M,4,4017);d=d.splice(h,
6
- d.length-h);a=UA(a,c,d,f);return new FA(c,b,f,a)}f.push(m);m.name==uA&&(m.attributes.push(new JA(BA,l)),e=!0)}}return new FA(c,b,f)},UA=function(a,b,c,d){var e=[],f=[],g=[];c.forEach(function(h){/^(#EXT)/.test(h)?(h=RA(a,h),SA.includes(h.name)?d.push(h):WA.includes(h.name)?"EXT-X-PART"===h.name?g.push(h):h.name===sA&&"PART"===HA(h,"TYPE")&&g.push(h):f.push(h)):/^#(?!EXT)/m.test(h)||(h=PA(b,h.trim()),e.push(new KA(h,f,g)),f=[],g=[])});g.length&&e.push(new KA(null,f,g));return e},RA=function(a,b){var c=
7
- a.a++,d=b.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!d)throw new _.L(_.M,4,4016,{invalidTag:b});var e=d[1],f=d[2];d=[];var g;if(f){f=new _.No(f);var h;(h=_.Oo(f,/^([^,=]+)(?:,|$)/g))&&(g=h[1]);for(var l=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;h=_.Oo(f,l);)d.push(new JA(h[1],h[2]||h[3]))}return new GA(c,e,d,g)},ZA=function(){var a=this;this.g=this.j=null;this.ua=1;this.aa=0;this.w=new Map;this.ia=new Set;this.f=new Map;this.h=null;this.B="";this.T=new QA;this.da=0;this.Y=new Map;this.A=new _.Ch(function(){XA(a)});
8
- this.m=YA;this.K=null;this.D=0;this.G=Infinity;this.C=new _.ei;this.ca=[];this.O=new Map;this.J=!1;this.o=new Map;this.U=null;this.a=new _.H("clpp.hls.HlsParser");this.I=new Map;this.L=new Map},dB=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,r,w;return _.A(function(x){if(1==x.a){c=$A;d=b.zg;e=new _.gi(d);if(a.g.hlsLowLatency){f=e.a;if(b.Fg){var B=b.segmentIndex;if(B=B.a[B.a.length-1]){var D=B.a,E=D.length-1;B={yi:B.position,rj:D&&0<D.length?E:null}}else B=null;g=B;h=g.yi;l=g.rj;null!==h&&(f.add("_HLS_msn",
9
- h),null!==l&&f.add("_HLS_part",l))}_.ri(f);f.g&&_.ji(e,f)}return _.y(x,aB(a,e.toString()),2)}if(3!=x.a){m=x.f;n=VA(a.T,m.data,m.uri);if(1!=n.type)throw new _.L(_.M,4,4017);p=b.stream;return _.y(x,bB(a,b.Pd,n,p.type,p.mimeType,p.codecs,p.keyInfo||null,b.Th),3)}q=x.f;b.segmentIndex.replace(q);r=q[q.length-1];if(w=NA(n.sa,oA))cB(a,c.VOD),a.h.Rb(r.endTime);_.z(x)})},hB=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,r,w,x,B,D,E,G,I,O,S,Ca,da;return _.A(function(fa){if(1==fa.a){c=VA(a.T,b,a.B);if(1===c.type){a.I.set(a.B,
10
- c);d=c.a[0].a;e=_.Nm;f=new _.gi(d);g=f.pa.split(".").pop();h=eB[e.AUDIO][g];l=eB[e.VIDEO][g];m="";l?m="avc1.42E01E":h&&(m="mp4a.40.2");var xa=a.T,ha=a.B,qa=a.g.hlsDefaultCodecs||m,Ba=[],$a=[];$a.push(new JA(jA,"0"));$a.push(new JA(BA,ha));qa.length&&$a.push(new JA(_.oa,qa));Ba.push(new GA(xa.a++,uA,$a));c=new FA(ha,0,Ba)}return _.y(fa,fB(a,c.sa),2)}n=fa.f;if(!a.j)throw new _.L(_.M,7,7001);a.j.filterAllPeriods([n]);p=Infinity;q=0;r=Infinity;w=_.u(a.f.values());for(x=w.next();!x.done;x=w.next())B=x.value,
11
- p=Math.min(p,B.Be),q=Math.max(q,B.Be),B.stream.type!=_.ze&&(r=Math.min(r,B.duration));a.m!=YA?(a.h=new _.zv(0,a.aa,!1),_.Dv(a.h,1)):a.h=new _.zv(null,0,!0);gB(a);if(a.m!=YA){a.da=a.G;D=$A;a.m===D.LIVE&&(E=a.h.Ne,G=Math.max(r,E),isNaN(a.g.availabilityWindowOverride)||(G=a.g.availabilityWindowOverride),a.h.hc=G);for(I=0;95443.7176888889<=q;)I+=95443.7176888889,q-=95443.7176888889;if(I)for(a.a.debug("Offsetting live streams by",I,"to compensate for rollover"),O=_.u(a.f.values()),x=O.next();!x.done;x=
12
- O.next())S=x.value,95443.7176888889>S.Be?(a.a.debug("Offset applied to",S.stream.type),S.segmentIndex.offset(I)):a.a.debug("Offset NOT applied to",S.stream.type)}else for(a.h.Rb(r),a.h.offset(-p),Ca=_.u(a.f.values()),x=Ca.next();!x.done;x=Ca.next())da=x.value,da.segmentIndex.offset(-p),_.Qv(da.segmentIndex,r);a.K={presentationTimeline:a.h,periods:[n],offlineSessionIds:[],minBufferTime:0};_.z(fa)})},fB=function(a,b){var c,d,e,f,g,h;return _.A(function(l){switch(l.a){case 1:c=LA(b,"EXT-X-MEDIA");d=
13
- LA(b,uA);e=LA(b,"EXT-X-IMAGE-STREAM-INF");for(var m=_.u(d),n=m.next();!n.done;n=m.next()){var p=n.value,q=HA(p,"AUDIO");n=HA(p,"VIDEO");var r=HA(p,AA);p=iB(a,p);if(r){var w=jB(_.ze,p);a.o.set(r,w);r=p.indexOf(w);-1<r&&p.splice(r,1)}q&&(r=kB(_.gc,p),a.o.set(q,r));n&&(q=kB(_.Oe,p),a.o.set(n,q))}return _.y(l,lB(a,c),2);case 2:m=MA(c,kA);m=_.u(m);for(n=m.next();!n.done;n=m.next())p=n.value,n=mB(p),q=IA(p,xA),p=IA(p,"INSTREAM-ID"),a.O.get(q)||a.O.set(q,new Map),a.O.get(q).set(p,n);return _.y(l,nB(a,d),
14
- 3);case 3:return f=l.f,_.y(l,oB(a,c),4);case 4:return g=l.f,_.y(l,pB(a,e),5);case 5:return h=l.f,l["return"]({startTime:0,variants:f,textStreams:g,thumbStreams:h})}})},oB=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,r;return _.A(function(w){if(1==w.a)return c=MA(b,AA),d=c.map(function(x){var B,D;return _.A(function(E){if(1==E.a)return _.wf(E,2),_.y(E,qB(a,x),4);if(2!=E.a)return B=E.f,E["return"](B.stream);D=_.yf(E);throw D;})}),_.y(w,Promise.all(d),2);e=w.f;f=_.u(c);for(g=f.next();!g.done;g=f.next())if(h=
15
- g.value,l=IA(h,xA),m=a.o.get(l))if(n=a.w.get(l))for(p=_.u(n),q=p.next();!q.done;q=p.next())r=q.value,r.stream.codecs=m;return w["return"](e.filter(function(x){return x}))})},pB=function(a,b){var c,d;return _.A(function(e){if(1==e.a)return c=b.map(function(f){var g;return _.A(function(h){if(1==h.a)return _.y(h,rB(a,f),2);g=h.f;return h["return"](g.stream)})}),_.y(e,Promise.all(c),2);d=e.f;return e["return"](d.filter(function(f){return f}))})},lB=function(a,b){var c;return _.A(function(d){if(1==d.a)return b=
16
- b.filter(function(e){var f=HA(e,BA)||"";return HA(e,"TYPE")!==AA&&""!==f}),b.length?_.y(d,qB(a,b[0]),2):d.H(2);c=b.slice(1).map(function(e){return qB(a,e)});return _.y(d,Promise.all(c),0)})},nB=function(a,b){var c,d,e,f,g,h,l,m,n,p;return _.A(function(q){if(1==q.a){c=function(r){var w,x,B,D,E,G,I;return _.A(function(O){return 1==O.a?(w=HA(r,"FRAME-RATE"),x=Number(IA(r,jA)),B=HA(r,"RESOLUTION"),D=_.u(B?B.split("x"):[null,null]),E=D.next().value,G=D.next().value,_.y(O,sB(a,r,B,w),2)):(I=O.f)?O["return"](tB(a,
17
- I.audio,I.video,x,E,G,w)):O["return"]([])})};d=0;e=Infinity;for(f=0;f<b.length;++f)g=Number(IA(b[f],jA)),g<e&&(e=g,d=f);h=b.splice(d,1).pop();return _.y(q,c(h),2)}if(3!=q.a)return l=q.f,m=b.map(c),_.y(q,Promise.all(m),3);n=q.f;n.splice(d,0,l);p=n.reduce(_.hv,[]);return q["return"](p.filter(_.Yl))})},sB=function(a,b,c,d){var e,f,g,h,l,m,n,p,q,r,w,x,B,D;return _.A(function(E){if(1==E.a)return e=_.Nm,f=iB(a,b),g=HA(b,"AUDIO"),h=HA(b,"VIDEO"),m=(l=g||h)&&a.w.has(l)?a.w.get(l):[],n={audio:g?m:[],video:h?
18
- m:[]},a.a.debug("Guessing stream type for",b.toString()),q=!1,r=IA(b,BA),w=n.audio.find(function(G){return G.Pd===r}),x=jB(e.VIDEO,f),B=c||d||x,1!==f.length||B?!m.length&&1<f.length?(a.a.debug("Guessing multiplexed audio+video"),p=e.VIDEO,f=[f.join(",")]):n.audio.length&&w?(a.a.debug(yA),p=e.AUDIO,q=!0):n.video.length?(a.a.debug(yA),p=e.AUDIO):(a.a.debug("Guessing video-only"),p=e.VIDEO):(p=e.AUDIO,a.a.debug(yA)),q?E.H(2):_.y(E,uB(a,b,f,p),3);2!=E.a&&(D=E.f);if(D)n[D.stream.type]=[D];else if(null===
19
- D)return a.a.debug("streamInfo is null"),E["return"](null);vB(n);return E["return"](n)})},vB=function(a){a=_.u(a.audio.concat(a.video));for(var b=a.next();!b.done;b=a.next()){b=b.value;var c=b.stream.codecs.split(",");c=c.filter(function(d){return"mp4a.40.34"!=d});b.stream.codecs=c.join(",")}},tB=function(a,b,c,d,e,f,g){c.forEach(function(B){if(B=B.stream)B.width=Number(e)||void 0,B.height=Number(f)||void 0,B.frameRate=Number(g)||void 0});b.length||(b=[null]);c.length||(c=[null]);var h=[];b=_.u(b);
20
- for(var l=b.next();!l.done;l=b.next()){l=l.value;for(var m=_.u(c),n=m.next();!n.done;n=m.next()){var p=n.value;n=l?l.stream:null;var q=p?p.stream:null,r=l?l.drmInfos:null,w=p?p.drmInfos:null;p=(p?p.Pd:"")+" - "+(l?l.Pd:"");var x=void 0;if(n&&q)if(r.length&&w.length?0<_.gv(r,w).length:1)x=_.gv(r,w);else{a.a.warn("Incompatible DRM info in HLS variant. Skipping.");continue}else n?x=r:q&&(x=w);a.ia.has(p)?a.a.debug("Skipping variant which only differs in text streams."):(n=wB(a,n,q,d,x),h.push(n),a.ia.add(p))}}return h},
21
- wB=function(a,b,c,d,e){return{id:a.ua++,language:b?b.language:_.Fe,primary:!!b&&b.primary||!!c&&c.primary,audio:b,video:c,bandwidth:d,drmInfos:e,allowedByApplication:!0,allowedByKeySystem:!0}},qB=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,r,w;return _.A(function(x){if(1==x.a){c=IA(b,xA);d="";e=IA(b,"TYPE").toLowerCase();f=_.Nm;e==_.Nu&&(e=f.TEXT);e!==f.TEXT&&c&&a.o.has(c)&&(d=a.o.get(c));g=IA(b,BA);if(a.f.has(g))return x["return"](a.f.get(g));h=mB(b);l=HA(b,"NAME");m=b.getAttribute("DEFAULT");n=b.getAttribute("AUTOSELECT");
22
- p=HA(b,"CHANNELS");q=e==_.gc?p?parseInt(p.split("/")[0],10):null:null;r=!!m&&!!n;return _.y(x,xB(a,g,d,e,h,r,l,q,null),2)}w=x.f;if(null==w)return x["return"](null);a.w.has(c)?a.w.get(c).push(w):a.w.set(c,[w]);if(a.f.has(g))return x["return"](a.f.get(g));a.f.set(g,w);return x["return"](w)})},rB=function(a,b){var c,d,e,f,g,h;return _.A(function(l){if(1==l.a){c=IA(b,BA);if(a.f.has(c))return l["return"](a.f.get(c));d=HA(b,_.oa)||"jpg";e=mB(b);f=HA(b,"NAME");return _.y(l,xB(a,c,d,_.id,e,!1,f,null,null),
23
- 2)}g=l.f;if(null===g)return l["return"](null);if(a.f.has(c))return l["return"](a.f.get(c));if(h=HA(b,jA))g.stream.bandwidth=Number(h);a.f.set(c,g);return l["return"](g)})},iB=function(a,b){var c=HA(b,_.oa,a.g.hlsDefaultCodecs||"avc1.42E01E,mp4a.40.2").split(/\s*,\s*/),d=new Set,e=[];c=_.u(c);for(var f=c.next();!f.done;f=c.next()){f=f.value;var g=_.dv(f)[0];d.has(g)?a.a.debug("Ignoring duplicate codec"):(e.push(f),d.add(g))}return e},mB=function(a){a=HA(a,"LANGUAGE")||_.Fe;return _.Gh(a)},uB=function(a,
24
- b,c,d){var e,f,g,h,l,m;return _.A(function(n){if(1==n.a){e=_.Nm;f=IA(b,BA);if(a.f.has(f))return n["return"](a.f.get(f));g=HA(b,kA);h=null;d==e.VIDEO&&g&&"NONE"!=g&&(h=a.O.get(g));l=kB(d,c);return _.y(n,xB(a,f,l,d,_.Fe,!1,null,null,h),2)}m=n.f;if(null==m)return n["return"](null);if(a.f.has(f))return n["return"](a.f.get(f));a.f.set(f,m);return n["return"](m)})},xB=function(a,b,c,d,e,f,g,h,l){var m,n,p,q,r,w,x,B,D,E,G,I,O,S,Ca,da,fa,xa,ha,qa,Ba,$a,Ka,ab,Db,le,kh,Pi,lh,Xc;return _.A(function(pb){switch(pb.a){case 1:m=
25
- PA(a.B,b);p=null;if(a.m==YA&&a.I.has(m)){n=a.I.get(m);a.I["delete"](m);pb.H(2);break}return _.y(pb,aB(a,m),3);case 3:q=pb.f,m=q.uri,n=VA(a.T,q.data,m);case 2:if(1!=n.type)throw new _.L(_.M,4,4017);yB(a,n);return _.y(pb,zB(a,d,c,n),4);case 4:r=pb.f;w=[];n.a.forEach(function(Xf){Xf=LA(Xf.sa,"EXT-X-KEY");w.push.apply(w,Xf)});x=!1;B=[];D=null;E=_.u(w);for(G=E.next();!G.done;G=E.next())I=G.value,O=IA(I,"METHOD"),S=HA(I,"KEYFORMAT","identity"),"NONE"!=O&&("AES-128"==O?(Ca=HA(I,"IV",""),da=PA(a.B,IA(I,BA)),
26
- p={method:"AES-128",url:da,iv:Ca?_.xj((Ca||"0x").slice(2)):null},a.J=!0):(x=!0,(xa=(fa=AB[S])?fa(I,r):null)?(xa.keyIds.length&&(D=xa.keyIds[0]),B.push(xa)):a.a.warn("Unsupported HLS KEYFORMAT",S)));if(x&&!B.length&&!a.J)throw new _.L(_.M,4,4026);ha=new Map;return _.y(pb,bB(a,b,n,d,r,c,p,ha),5);case 5:return qa=pb.f,Ba=qa[0].startTime,$a=qa[qa.length-1].endTime,Ka=$a-Ba,ab=new _.Mv(qa),Db=a.g.hlsLowLatency?_.Iy:_.Fu,le=BB(n,p),kh=void 0,d==_.ze&&(kh=_.ve),lh=(Pi=NA(n.sa,tA))?"YES"===HA(Pi,"CAN-BLOCK-RELOAD"):
27
- !1,Xc={id:a.ua++,originalId:g,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:ab.zc.bind(ab),getSegmentReference:ab.get.bind(ab),adjustSegmentDurations:ab.Oc.bind(ab),getDuration:ab.getDuration.bind(ab),segmentIndex:ab,segmentLookupStrategy:Db,initSegmentReference:le,mimeType:r,codecs:c,kind:kh,encrypted:x,keyId:D,language:e,label:g,type:d,primary:f,trickModeVideo:null,emsgSchemeIdUris:null,frameRate:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:[],channelsCount:h,
28
- closedCaptions:l,keyInfo:p},pb["return"]({stream:Xc,segmentIndex:ab,drmInfos:B,Pd:b,zg:m,Be:Ba,nk:$a,duration:Ka,Th:ha,Fg:lh})}})},yB=function(a,b){var c=NA(b.sa,rA),d=NA(b.sa,oA);d=c&&"VOD"==c.value||d;c=c&&"EVENT"==c.value&&!d;c=!d&&!c;if(d)cB(a,YA);else{c?cB(a,CB):cB(a,DB);d=NA(b.sa,vA);if(!d)throw new _.L(_.M,4,4024,{missingTag:vA});d=Number(d.value);c=NA(b.sa,qA);a.g.hlsLowLatency&&c?(d=Number(IA(c,"PART-TARGET")),a.G=Math.min(d,a.G),a.D=Math.max(d,a.D),d=NA(b.sa,tA),a.aa=d?Number(IA(d,"PART-HOLD-BACK")):
29
- 0):(a.D=Math.max(d,a.D),a.G=Math.min(d,a.G),a.aa=3*a.D)}},BB=function(a,b){var c=LA(a.sa,"EXT-X-MAP");if(!c.length)return null;if(1<c.length)throw new _.L(_.M,4,4020);var d=c[0];c=IA(d,BA);var e=PA(a.f,c);c=0;var f=null;if(d=HA(d,"BYTERANGE"))c=d.split("@"),d=Number(c[0]),c=Number(c[1]),f=c+d-1;return new _.xv(function(){return[e]},c,f,b)},FB=function(a,b,c,d,e,f,g){var h=[],l={};b=_.u(_.iA(b.f));for(var m=b.next();!m.done;l={Rd:l.Rd},m=b.next()){var n=m.value;m=n.Gd;n=n.item;var p=0==m?a:h[h.length-
30
- 1],q=0==m?d:p.endTime,r=Number(HA(n,"DURATION"));r=q+r;var w=HA(n,"BYTERANGE");w=_.u(EB(p,w));p=w.next().value;w=w.next().value;var x=HA(n,BA);x=PA(g,x);l.Rd=x?[x]:[];q=new _.yv(c,q,r,function(B){return function(){return B.Rd}}(l),p,w,e,f,!1,null,null,null,null);if("YES"===HA(n,"INDEPENDENT")||0===m)q.g=!0;h.push(q)}return h},GB=function(a,b,c,d,e,f,g,h,l){var m=c.sa,n=c.a,p=n?[n]:[];n=NA(m,wA);(g=g?Object.assign({},g):null)&&!g.iv&&(g.iv=_.Aj(new Uint8Array(12),new Uint8Array([d>>24&255,d>>16&255,
31
- d>>8&255,d&255])));var q=null,r=null,w=null;h===_.id&&(r=NA(m,"EXT-X-TILES"),q="1x1",r&&(q=HA(r,"LAYOUT")||"1x1",w=(w=HA(r,"DURATION"))?Number(w):null),r=_.u(q.split("x").map(function(x){return parseInt(x,10)})),q=r.next().value,r=r.next().value);if(0===c.f.length&&!n)throw new _.L(_.M,4,4024,{missingTag:wA});h=null;if(0<c.f.length)if(a.g.hlsLowLatency)h=FB(b,c,d,e,f,g,l);else return null;c=a=0;l=null;n?(a=e+Number(n.value.split(",")[0]),m=NA(m,lA),b=_.u(EB(b,m?m.value:null)),c=b.next().value,l=b.next().value):
32
- a=h[h.length-1].endTime;return new _.yv(d,e,a,function(){return p},c,l,f,g,!1,null,q,r,w,h)},EB=function(a,b){var c=0,d=null;b&&(c=b.split("@"),d=Number(c[0]),c=c[1]?Number(c[1]):a.Ea+1,d=c+d-1);return[c,d]},gB=function(a){a.h&&(a.ca.forEach(function(b){_.Cv(a.h,b,0)}),a.ca=[])},bB=function(a,b,c,d,e,f,g,h){var l,m,n,p,q,r,w,x,B,D,E,G,I,O,S,Ca,da,fa,xa,ha,qa,Ba,$a;return _.A(function(Ka){switch(Ka.a){case 1:l=c.a;m=BB(c,g);n=OA(c.sa);if(null!==a.U){Ka.H(2);break}p=a;return _.y(Ka,HB(a,b,m,l[0],n,
33
- g,e,f,d),3);case 3:p.U=Ka.f;case 2:q=a.U;r=l[0].a;a.a.debug("First segment",r.split("/").pop(),"starts at",q);x=(w=NA(c.sa,nA))?Number(w.value):0;h.has(x)||h.set(x,n);if(!w)for(;h.has(x+1)&&h.get(x+1)<n;)x++;B=a.L.get(x)||0;D=[];E=function(ab){return _.iA(ab)};G=_.u(E(l));I=G.next();case 4:if(I.done){Ka.H(6);break}S=O=I.value;Ca=S.Gd;da=S.item;fa=D[D.length-1];xa=0==Ca?q:fa.endTime;ha=n+Ca;qa=NA(da.sa,mA);if(!qa){Ka.H(7);break}x++;h.set(x,ha);return _.y(Ka,IB(a,x,b,m,da,ha,g,e,f,xa,d),8);case 8:B=
34
- Ka.f;case 7:Ba=GB(a,fa,da,ha,xa,B,g,d,c.f);$a=NA(da.sa,wA);Ba&&(a.g.hlsLowLatency||$a)&&D.push(Ba);I=G.next();Ka.H(4);break;case 6:return a.ca.push(D),gB(a),Ka["return"](D)}})},IB=function(a,b,c,d,e,f,g,h,l,m,n){var p,q;return _.A(function(r){if(1==r.a)return p=0,a.L.has(b)?(p=a.L.get(b),r.H(2)):_.y(r,HB(a,c,d,e,f,g,h,l,n,!0),3);2!=r.a&&(q=r.f,p=q-m,a.a.debug("Discontinuity segment offset",p),a.L.set(b,p));return r["return"](p)})},KB=function(a,b){var c,d,e,f,g,h,l;return _.A(function(m){switch(m.a){case 1:return c=
35
- b.f(),d=_.wv(b.Ha(),b.Pa,b.Pa+2048-1,a.g.attemptParameters),d.type=2,e=_.wv(b.Ha(),b.Pa,b.Ea,a.g.attemptParameters),e.type=2,c&&(e.keyInfo=c),_.wf(m,2),f=a.J?e:d,_.y(m,JB(a,f),4);case 4:return g=m.f,m["return"](g);case 2:h=_.yf(m);if(7001==h.code||a.J)throw h;a.a.warn("Unable to fetch a partial HLS segment! Falling back to a full segment request, which is expensive! Your server should support Range requests and CORS preflights.",d.uris[0]);return _.y(m,JB(a,e),5);case 5:return l=m.f,m["return"](l)}})},
36
- HB=function(a,b,c,d,e,f,g,h,l,m){var n,p,q,r,w,x,B,D,E,G,I;return _.A(function(O){switch(O.a){case 1:n=GB(a,null,d,e,0,0,f,l,"");if(!n)return O["return"](0);if(a.K&&!m){p=a.f.get(b);q=p.segmentIndex;if(r=q.get(n.position))return a.a.debug("Found segment start time in previous manifest"),O["return"](r.startTime);a.a.debug("Unable to find segment start time in previous manifest!")}a.a.debug("Fetching segment to find start time");if("audio/mpeg"==g)return O["return"](0);if(g!=_.hc){O.H(2);break}return _.y(O,
37
- KB(a,n),3);case 3:return w=O.f,x=_.R(w.data),EA(x)?O["return"](LB(x)):O["return"](MB(a,w.data));case 2:if(g!=_.Qe&&g!=_.kc){O.H(4);break}B=[KB(a,n)];c&&B.push(KB(a,c));return _.y(O,Promise.all(B),5);case 5:return D=O.f,E=D[0],G=D[1]||D[0],O["return"](NB(a,E.data,G.data));case 4:if(g!=_.Pe){O.H(6);break}return _.y(O,KB(a,n),7);case 7:return I=O.f,O["return"](MB(a,I.data));case 6:if(g===_.jc||g===_.ic||!MediaSource.isTypeSupported((g.split("/")[0]||"")+'/mp4;codecs\x3d"'+h+'"'))return O["return"](0);
38
- throw new _.L(_.M,4,4030);}})},NB=function(a,b,c){var d=0;(new _.Zj).M(_.zd,_.ak).M(_.De,_.ak).M(_.ud,_.ak).V("mdhd",function(g){g.F.skip(0==g.version?8:16);d=_.U(g.F);g.Wa.stop()}).parse(c,!0);if(!d)throw a.a.error("Unable to find timescale in init segment!"),new _.L(_.M,4,4030);var e=0,f=!1;(new _.Zj).M("moof",_.ak).M("traf",_.ak).V("tfdt",function(g){e=(0==g.version?_.U(g.F):_.Xj(g.F))/d;f=!0;g.Wa.stop()}).parse(b,!0);if(!f)throw new _.L(_.M,4,4030);return e},MB=function(a,b){function c(){e.seek(f+
39
- 188);g=_.Tj(e);71!=g&&(e.seek(f+192),g=_.Tj(e));71!=g&&(e.seek(f+204),g=_.Tj(e));71!=g&&d();DA(e)}function d(){throw new _.L(_.M,4,4030);}var e=new _.Qj(new DataView(b),!1),f=0,g=0;f=OB(e);0>f&&(a.a.error("Unable to find sync byte in TS after scanning"),d());for(;;){f=e.getPosition();g=_.Tj(e);71!=g&&d();var h=_.Uj(e);if(8191===(h&8191))c();else if(h&16384)if(h=(_.Tj(e)&48)>>4,0!=h&&2!=h||d(),3==h&&(h=_.Tj(e),e.skip(h)),1!=_.U(e)>>8)c();else{e.skip(3);h=_.Tj(e)>>6;0!=h&&1!=h||d();0==_.Tj(e)&&d();
40
- h=_.Tj(e);var l=_.Uj(e),m=_.Uj(e);return(1073741824*((h&14)>>1)+((l&65534)<<14|(m&65534)>>1))/9E4}else c()}},OB=function(a){for(;a.getPosition()<a.ya()-1;){var b=a.getPosition();if(71===_.Tj(a))return DA(a),b}return-1},LB=function(a){function b(l,m,n){for(var p="";m<n;m++)p+="%"+("00"+l[m].toString(16)).slice(-2);return p}function c(l){return l[0]<<21|l[1]<<14|l[2]<<7|l[3]}function d(){throw new _.L(_.M,4,4030);}EA(a)||d();var e=10;a[5]&64&&(e=e+4+c(a.subarray(10,14)));do{var f=c(a.subarray(e+4,e+
41
- 8));1>f&&d();var g=String.fromCharCode(a[e],a[e+1],a[e+2],a[e+3]);if("PRIV"===g){g=a.subarray(e+10,e+f+10);for(var h=0;h<g.byteLength;h++)if(0===g[h]){if("com.apple.streaming.transportStreamTimestamp"===unescape(b(g,0,h)))return a=g.subarray(h+1),f=(a[3]&1)<<30|a[4]<<22|a[5]<<14|a[6]<<6|a[7]>>>2,f*=4,f+=a[7]&3,Math.round(f/9E4);break}}EA(a,e)||d();e+=10;e+=f}while(e<a.byteLength);return d()},jB=function(a,b){for(var c=PB[a],d=0;d<c.length;d++)for(var e=0;e<b.length;e++)if(c[d].test(b[e].trim()))return b[e].trim();
42
- return a==_.ze?"":null},kB=function(a,b){if(1==b.length)return b[0];var c=jB(a,b);if(null!=c)return c;throw new _.L(_.M,4,4025,{codecList:b});},zB=function(a,b,c,d){var e,f,g,h,l,m,n,p,q;return _.A(function(r){if(1==r.a){e=_.Nm;f=d.a[0].a;g=new _.gi(f);h=g.pa.split(".").pop();l=eB[b];if(m=l[h])return r["return"](m);if(b==e.TEXT)return c&&"vtt"!=c?r["return"](_.$b):r["return"](_.Ae);n=_.vh([f],a.g.attemptParameters);n.method="HEAD";n.type=2;return _.y(r,JB(a,n),2)}p=r.f;q=p.headers["content-type"];
43
- if(!q)throw new _.L(_.M,4,4021,h);return r["return"](q.split(";")[0])})},aB=function(a,b){var c=_.vh([b],a.g.attemptParameters);c.type=1;return JB(a,c)},QB=function(a){var b=IA(a,"METHOD"),c=["SAMPLE-AES",zA];if(!c.includes(b))return _.Qf("PlayReady in HLS is only supported with [",c.join(", "),"], not",b),null;a=IA(a,BA);b=_.sp(a);a=null;b=_.R(b.data);try{a=_.Su(_.dl(b))}catch(d){a=b}return _.kv(_.Mc,[{initDataType:_.xc,initData:a}],"")},XA=function(a){var b,c,d;_.A(function(e){if(1==e.a){a.a.debug(_.yu);
44
- if(!a.j)return e["return"]();_.wf(e,2);return _.y(e,a.update(),4)}if(2!=e.a)return b=a.da,a.A.$(b),_.xf(e,0);c=_.yf(e);a.j&&(a.j.onError(c),d=c,1===d.severity&&a.A.$(.1));_.z(e)})},cB=function(a,b){a.m=b;if(a.h){var c=a.h,d=a.m==YA;c.j=d;c.m=d}a.m!=YA||a.A.stop()},JB=function(a,b){if(!a.C)throw new _.L(_.M,7,7001);var c=a.j.networkingEngine.fetch(b);_.fi(a.C,c);return c.P},RB=function(){};
45
- GA.prototype.toString=function(){function a(d){return d.name+"\x3d"+(isNaN(Number(d.value))?'"'+d.value+'"':d.value)}var b="#"+this.name,c=this.attributes?this.attributes.map(a):[];this.value&&c.unshift(this.value);0<c.length&&(b+=":"+c.join(","));return b};GA.prototype.getAttribute=function(a){var b=this.attributes.filter(function(c){return c.name==a});return b.length?b[0]:null};var SA=[vA,pA,nA,rA,"EXT-X-MAP","EXT-X-I-FRAMES-ONLY",oA,tA,qA],TA=[wA,lA,mA,"EXT-X-PROGRAM-DATE-TIME","EXT-X-KEY","EXT-X-DATERANGE"],WA=["EXT-X-PART",sA];_.t=ZA.prototype;_.t.configure=function(a){this.g=a};_.t.setCurrentVariant=function(a){var b=a.video?a.video.id:null;a=a.audio?a.audio.id:null;this.Y.clear();for(var c=_.u(this.f.keys()),d=c.next();!d.done;d=c.next()){d=d.value;var e=this.f.get(d);!e.stream||e.stream.id!==b&&e.stream.id!==a||this.Y.set(d,e)}};_.t.start=function(a,b){var c=this,d,e;return _.A(function(f){if(1==f.a)return c.j=b,_.y(f,aB(c,a),2);if(3!=f.a)return d=f.f,c.B=d.uri,_.y(f,hB(c,d.data),3);e=c.da;0<e&&c.A.$(e);return f["return"](c.K)})};
46
- _.t.stop=function(){this.A&&(this.A.stop(),this.A=null);var a=[];this.C&&(a.push(this.C.destroy()),this.C=null);this.g=this.j=null;this.ia.clear();this.f.clear();this.I.clear();this.K=null;this.w.clear();this.o.clear();return Promise.all(a)};
47
- _.t.update=function(){var a=this,b,c,d,e,f;return _.A(function(g){if(1==g.a){if(a.m==YA)return g["return"]();b=[];a.U=null;c=Array.from(a.f.values());d=Array.from(a.Y.values());e=a.g.hlsLowLatency&&0<d.length?d:c;return _.y(g,dB(a,e[0]),2)}for(f=1;f<e.length;f++)b.push(dB(a,e[f]));return _.y(g,Promise.all(b),0)})};_.t.onExpirationUpdated=function(){};
48
- var PB={audio:[/^vorbis$/,/^opus$/,/^flac$/,/^mp4a/,/^[ae]c-3$/],video:[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av1$/],text:[/^vtt$/,/^wvtt/,/^stpp/]},eB={audio:{mp4:_.kc,m4s:_.kc,m4i:_.kc,m4a:_.kc,cmfa:_.kc,ts:_.Pe,aac:_.hc,ec3:_.jc,ac3:_.ic},video:{mp4:_.Qe,m4s:_.Qe,m4i:_.Qe,m4v:_.Qe,cmfv:_.Qe,ts:_.Pe},text:{mp4:_.$b,m4s:_.$b,m4i:_.$b,cmft:_.$b,vtt:_.Ae,ttml:_.cc},image:{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",svg:"image/svg+xml",webp:"image/webp",avif:"image/avif"}},AB={"com.apple.streamingkeydelivery":function(a,
49
- b){if(b===_.Pe)throw new _.L(_.M,4,4041);return _.kv(_.Lc,[{initDataType:_.je,initData:new Uint8Array(0)}],"")},"com.microsoft.playready":QB,"urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":QB,"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(a){var b=IA(a,"METHOD"),c=["SAMPLE-AES",zA];if(!c.includes(b))return _.Qf("Widevine in HLS is only supported with [",c.join(", "),"], not",b),null;b=IA(a,BA);b=_.sp(b);b=_.R(b.data);b=_.kv(_.Nc,[{initDataType:_.xc,initData:b}],"");if(a=HA(a,"KEYID"))b.keyIds=
50
- [a.substr(2).toLowerCase()];return b}},YA="VOD",DB="EVENT",CB="LIVE",$A={VOD:YA,Vj:DB,LIVE:CB};_.v(RB,_.Zn);RB.prototype.Ja=function(){_.Zo.m3u8=ZA;_.Xo[_.ec]=ZA;_.Xo[CA]=ZA};RB.prototype.Ca=function(){_.Vv("m3u8");_.Wv(_.ec);_.Wv(CA)};RB.prototype.id=function(){return"hls"};_.C("clpp.hls.HlsComponent",RB);};
2
+ var f=function(window){var MA="CLOSED-CAPTIONS",NA="EXT-X-BYTERANGE",OA="EXT-X-DISCONTINUITY",PA="EXT-X-DISCONTINUITY-SEQUENCE",QA="EXT-X-ENDLIST",RA="EXT-X-MEDIA-SEQUENCE",SA="EXT-X-PART-INF",TA="EXT-X-PLAYLIST-TYPE",UA="EXT-X-PRELOAD-HINT",VA="EXT-X-SERVER-CONTROL",WA="EXT-X-STREAM-INF",XA="EXT-X-TARGETDURATION",YA="EXTINF",ZA="GROUP-ID",$A="Guessing audio-only",aB="SAMPLE-AES-CTR",bB="SUBTITLES",cB="application/vnd.apple.mpegurl",dB=function(a,b){var c=a.getAttribute(b);if(!c)throw new _.L(_.M,4,4023,b);return c.value},
3
+ eB=function(a){if(1>a.a)throw _.zk();--a.a},fB=function(a,b,c,d){this.f=a;this.type=b;this.ta=c;this.a=d||null},gB=function(a,b,c){c=void 0===c?[]:c;this.ta=b;this.a=a;this.f=c},hB=function(a,b){return a.filter(function(c){return c.name==b})},iB=function(a,b){return a.filter(function(c){return dB(c,"TYPE")===b})},jB=function(a,b){var c=hB(a,b);return c.length?c[0]:null},kB=function(a){var b=void 0===b?0:b;return(a=jB(a,RA))?Number(a.value):b},lB=function(a,b){return _.Bv([a],[b])[0]},mB=function(){this.a=
4
+ 0},rB=function(a,b,c){b=_.ph(b);b=b.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n").trim();var d=b.split(/\n+/m);if(!/^#EXTM3U($|[ \t\n])/m.test(d[0]))throw new _.L(_.M,4,4015);b=0;for(var e=!0,f=_.u(d),g=f.next();!g.done;g=f.next())if(g=g.value,g=g.trim(),!g.length||/^#(?!EXT)/m.test(g)||e)e=!1;else if(g=nB(a,g),--a.a,oB.includes(g.name)){b=1;break}else g.name==WA&&(e=!0);f=[];e=!0;g=_.u(_.LA(d));for(var h=g.next();!h.done;h=g.next()){var l=h.value;h=l.Kd;var m=l.item;l=l.next;m=m.trim();if(!m.length||/^#(?!EXT)/m.test(m)||
5
+ e)e=!1;else{m=nB(a,m);if(pB.includes(m.name)){if(1!=b)throw new _.L(_.M,4,4017);d=d.splice(h,d.length-h);a=qB(a,c,d,f);return new fB(c,b,f,a)}f.push(m);m.name==WA&&(m.attributes.push(new _.Yg(_.vb,l)),e=!0)}}return new fB(c,b,f)},qB=function(a,b,c,d){var e=[],f=[],g=[];c.forEach(function(h){/^(#EXT)/.test(h)?(h=nB(a,h),oB.includes(h.name)?d.push(h):sB.includes(h.name)?"EXT-X-PART"===h.name?g.push(h):h.name===UA&&"PART"===_.Xg(h,"TYPE")&&g.push(h):f.push(h)):/^#(?!EXT)/m.test(h)||(h=lB(b,h.trim()),
6
+ e.push(new gB(h,f,g)),f=[],g=[])});g.length&&e.push(new gB(null,f,g));return e},nB=function(a,b){return _.Dh(a.a++,b)},tB=function(a,b){b=void 0===b?0:b;return b+10<=a.length&&73===a[b]&&68===a[b+1]&&51===a[b+2]&&255>a[b+3]&&255>a[b+4]&&128>a[b+6]&&128>a[b+7]&&128>a[b+8]&&128>a[b+9]?!0:!1},vB=function(){var a=this;this.g=this.C=null;this.fa=1;this.$=0;this.o=new Map;this.da=new Set;this.f=new Map;this.h=null;this.A="";this.R=new mB;this.ba=0;this.V=new Map;this.w=new _.Ni(function(){a.Bb()});this.j=
7
+ uB;this.K=null;this.D=0;this.F=Infinity;this.B=new _.Rh;this.aa=[];this.N=new Map;this.J=!1;this.m=new Map;this.T=null;this.a=new _.H("clpp.hls.HlsParser");this.I=new Map;this.L=new Map},AB=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,r,w;return _.B(function(y){if(1==y.a){c=wB;d=b.Eg;e=new _.Fg(d);if(a.g.hlsLowLatency){f=e.a;if(b.Kg){var A=b.segmentIndex;if(A=A.a[A.a.length-1]){var E=A.a,F=E.length-1;A={Bi:A.position,vj:E&&0<E.length?F:null}}else A=null;g=A;h=g.Bi;l=g.vj;null!==h&&(f.add("_HLS_msn",h),
8
+ null!==l&&f.add("_HLS_part",l))}_.Qg(f);f.g&&_.Ig(e,f)}return _.x(y,xB(a,e.toString()),2)}if(3!=y.a){m=y.f;n=rB(a.R,m.data,m.uri);if(1!=n.type)throw new _.L(_.M,4,4017);p=b.stream;return _.x(y,yB(a,b.Sd,n,p.type,p.mimeType,p.codecs,p.keyInfo||null,b.Xh),3)}q=y.f;b.segmentIndex.replace(q);r=q[q.length-1];if(w=jB(n.ta,QA))zB(a,c.VOD),a.h.Tb(r.endTime);_.z(y)})},EB=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,r,w,y,A,E,F,D,I,O,T,Fa,fa;return _.B(function(ka){if(1==ka.a){c=rB(a.R,b,a.A);if(1===c.type){a.I.set(a.A,
9
+ c);d=c.a[0].a;e=_.on;f=new _.Fg(d);g=f.pa.split(".").pop();h=BB[e.AUDIO][g];l=BB[e.VIDEO][g];m="";l?m="avc1.42E01E":h&&(m="mp4a.40.2");var wa=a.R,Aa=a.A,la=a.g.hlsDefaultCodecs||m,qa=[],Ga=[];Ga.push(new _.Yg(_.na,"0"));Ga.push(new _.Yg(_.vb,Aa));la.length&&Ga.push(new _.Yg(_.pa,la));qa.push(new _.Wg(wa.a++,WA,Ga));c=new fB(Aa,0,qa)}return _.x(ka,CB(a,c.ta),2)}n=ka.f;if(!a.C)throw new _.L(_.M,7,7001);a.C.filterAllPeriods([n]);p=Infinity;q=0;r=Infinity;w=_.u(a.f.values());for(y=w.next();!y.done;y=
10
+ w.next())A=y.value,p=Math.min(p,A.Fe),q=Math.max(q,A.Fe),A.stream.type!=_.Be&&(r=Math.min(r,A.duration));a.j!=uB?(a.h=new _.Zv(0,a.$,!1),_.cw(a.h,1)):a.h=new _.Zv(null,0,!0);DB(a);if(a.j!=uB){a.ba=a.F;E=wB;a.j===E.LIVE&&(F=a.h.Re,D=Math.max(r,F),isNaN(a.g.availabilityWindowOverride)||(D=a.g.availabilityWindowOverride),a.h.ic=D);for(I=0;95443.7176888889<=q;)I+=95443.7176888889,q-=95443.7176888889;if(I)for(a.a.debug("Offsetting live streams by",I,"to compensate for rollover"),O=_.u(a.f.values()),y=
11
+ O.next();!y.done;y=O.next())T=y.value,95443.7176888889>T.Fe?(a.a.debug("Offset applied to",T.stream.type),T.segmentIndex.offset(I)):a.a.debug("Offset NOT applied to",T.stream.type)}else for(a.h.Tb(r),a.h.offset(-p),Fa=_.u(a.f.values()),y=Fa.next();!y.done;y=Fa.next())fa=y.value,fa.segmentIndex.offset(-p),_.pw(fa.segmentIndex,r);a.K={presentationTimeline:a.h,periods:[n],offlineSessionIds:[],minBufferTime:0};_.z(ka)})},CB=function(a,b){var c,d,e,f,g,h;return _.B(function(l){switch(l.a){case 1:c=hB(b,
12
+ "EXT-X-MEDIA");d=hB(b,WA);e=hB(b,"EXT-X-IMAGE-STREAM-INF");for(var m=_.u(d),n=m.next();!n.done;n=m.next()){var p=n.value,q=_.Xg(p,"AUDIO");n=_.Xg(p,"VIDEO");var r=_.Xg(p,bB);p=FB(a,p);if(r){var w=_.Sg(_.Be,p);a.m.set(r,w);r=p.indexOf(w);-1<r&&p.splice(r,1)}q&&(r=GB(_.ic,p),a.m.set(q,r));n&&(q=GB(_.Qe,p),a.m.set(n,q))}return _.x(l,HB(a,c),2);case 2:m=iB(c,MA);m=_.u(m);for(n=m.next();!n.done;n=m.next())p=n.value,n=IB(p),q=dB(p,ZA),p=dB(p,"INSTREAM-ID"),a.N.get(q)||a.N.set(q,new Map),a.N.get(q).set(p,
13
+ n);return _.x(l,JB(a,d),3);case 3:return f=l.f,_.x(l,KB(a,c),4);case 4:return g=l.f,_.x(l,LB(a,e),5);case 5:return h=l.f,l["return"]({startTime:0,variants:f,textStreams:g,thumbStreams:h})}})},KB=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,r;return _.B(function(w){if(1==w.a)return c=iB(b,bB),d=c.map(function(y){var A,E;return _.B(function(F){if(1==F.a)return _.yf(F,2),_.x(F,MB(a,y),4);if(2!=F.a)return A=F.f,F["return"](A.stream);E=_.Af(F);throw E;})}),_.x(w,Promise.all(d),2);e=w.f;f=_.u(c);for(g=f.next();!g.done;g=
14
+ f.next())if(h=g.value,l=dB(h,ZA),m=a.m.get(l))if(n=a.o.get(l))for(p=_.u(n),q=p.next();!q.done;q=p.next())r=q.value,r.stream.codecs=m;return w["return"](e.filter(function(y){return y}))})},LB=function(a,b){var c,d;return _.B(function(e){if(1==e.a)return c=b.map(function(f){var g;return _.B(function(h){if(1==h.a)return _.x(h,NB(a,f),2);g=h.f;return h["return"](g.stream)})}),_.x(e,Promise.all(c),2);d=e.f;return e["return"](d.filter(function(f){return f}))})},HB=function(a,b){var c;return _.B(function(d){if(1==
15
+ d.a)return b=b.filter(function(e){var f=_.Xg(e,_.vb)||"";return _.Xg(e,"TYPE")!==bB&&""!==f}),b.length?_.x(d,MB(a,b[0]),2):d.H(2);c=b.slice(1).map(function(e){return MB(a,e)});return _.x(d,Promise.all(c),0)})},JB=function(a,b){var c,d,e,f,g,h,l,m,n,p;return _.B(function(q){if(1==q.a){c=function(r){var w,y,A,E,F,D,I;return _.B(function(O){return 1==O.a?(w=_.Xg(r,"FRAME-RATE"),y=Number(dB(r,_.na)),A=_.Xg(r,_.ib),E=_.u(A?A.split("x"):[null,null]),F=E.next().value,D=E.next().value,_.x(O,OB(a,r,A,w),2)):
16
+ (I=O.f)?O["return"](PB(a,I.audio,I.video,y,F,D,w)):O["return"]([])})};d=0;e=Infinity;for(f=0;f<b.length;++f)g=Number(dB(b[f],_.na)),g<e&&(e=g,d=f);h=b.splice(d,1).pop();return _.x(q,c(h),2)}if(3!=q.a)return l=q.f,m=b.map(c),_.x(q,Promise.all(m),3);n=q.f;n.splice(d,0,l);p=n.reduce(_.zv,[]);return q["return"](p.filter(_.Eg))})},OB=function(a,b,c,d){var e,f,g,h,l,m,n,p,q,r,w,y,A,E;return _.B(function(F){if(1==F.a)return e=_.on,f=FB(a,b),g=_.Xg(b,"AUDIO"),h=_.Xg(b,"VIDEO"),m=(l=g||h)&&a.o.has(l)?a.o.get(l):
17
+ [],n={audio:g?m:[],video:h?m:[]},a.a.debug("Guessing stream type for",b.toString()),q=!1,r=dB(b,_.vb),w=n.audio.find(function(D){return D.Sd===r}),y=_.Sg(e.VIDEO,f),A=c||d||y,1!==f.length||A?!m.length&&1<f.length?(a.a.debug("Guessing multiplexed audio+video"),p=e.VIDEO,f=[f.join(",")]):n.audio.length&&w?(a.a.debug($A),p=e.AUDIO,q=!0):n.video.length?(a.a.debug($A),p=e.AUDIO):(a.a.debug("Guessing video-only"),p=e.VIDEO):(p=e.AUDIO,a.a.debug($A)),q?F.H(2):_.x(F,QB(a,b,f,p),3);2!=F.a&&(E=F.f);if(E)n[E.stream.type]=
18
+ [E];else if(null===E)return a.a.debug("streamInfo is null"),F["return"](null);RB(n);return F["return"](n)})},RB=function(a){a=_.u(a.audio.concat(a.video));for(var b=a.next();!b.done;b=a.next()){b=b.value;var c=b.stream.codecs.split(",");c=c.filter(function(d){return"mp4a.40.34"!=d});b.stream.codecs=c.join(",")}},PB=function(a,b,c,d,e,f,g){c.forEach(function(A){if(A=A.stream)A.width=Number(e)||void 0,A.height=Number(f)||void 0,A.frameRate=Number(g)||void 0});b.length||(b=[null]);c.length||(c=[null]);
19
+ var h=[];b=_.u(b);for(var l=b.next();!l.done;l=b.next()){l=l.value;for(var m=_.u(c),n=m.next();!n.done;n=m.next()){var p=n.value;n=l?l.stream:null;var q=p?p.stream:null,r=l?l.drmInfos:null,w=p?p.drmInfos:null;p=(p?p.Sd:"")+" - "+(l?l.Sd:"");var y=void 0;if(n&&q)if(r.length&&w.length?0<_.Lv(r,w).length:1)y=_.Lv(r,w);else{a.a.warn("Incompatible DRM info in HLS variant. Skipping.");continue}else n?y=r:q&&(y=w);a.da.has(p)?a.a.debug("Skipping variant which only differs in text streams."):(n=SB(a,n,q,
20
+ d,y),h.push(n),a.da.add(p))}}return h},SB=function(a,b,c,d,e){return{id:a.fa++,language:b?b.language:_.He,primary:!!b&&b.primary||!!c&&c.primary,audio:b,video:c,bandwidth:d,drmInfos:e,allowedByApplication:!0,allowedByKeySystem:!0}},MB=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,r,w;return _.B(function(y){if(1==y.a){c=dB(b,ZA);d="";e=dB(b,"TYPE").toLowerCase();f=_.on;e==_.mv&&(e=f.TEXT);e!==f.TEXT&&c&&a.m.has(c)&&(d=a.m.get(c));g=dB(b,_.vb);if(a.f.has(g))return y["return"](a.f.get(g));h=IB(b);l=_.Xg(b,
21
+ "NAME");m=b.getAttribute("DEFAULT");n=b.getAttribute("AUTOSELECT");p=_.Xg(b,"CHANNELS");q=e==_.ic?p?parseInt(p.split("/")[0],10):null:null;r=!!m&&!!n;return _.x(y,TB(a,g,d,e,h,r,l,q,null),2)}w=y.f;if(null==w)return y["return"](null);a.o.has(c)?a.o.get(c).push(w):a.o.set(c,[w]);if(a.f.has(g))return y["return"](a.f.get(g));a.f.set(g,w);return y["return"](w)})},NB=function(a,b){var c,d,e,f,g,h;return _.B(function(l){if(1==l.a){c=dB(b,_.vb);if(a.f.has(c))return l["return"](a.f.get(c));d=_.Xg(b,_.pa)||
22
+ "jpg";e=IB(b);f=_.Xg(b,"NAME");return _.x(l,TB(a,c,d,_.ld,e,!1,f,null,null),2)}g=l.f;if(null===g)return l["return"](null);if(a.f.has(c))return l["return"](a.f.get(c));if(h=_.Xg(b,_.na))g.stream.bandwidth=Number(h);a.f.set(c,g);return l["return"](g)})},FB=function(a,b){var c=_.Xg(b,_.pa,a.g.hlsDefaultCodecs||"avc1.42E01E,mp4a.40.2").split(/\s*,\s*/),d=new Set,e=[];c=_.u(c);for(var f=c.next();!f.done;f=c.next()){f=f.value;var g=_.Jv(f)[0];d.has(g)?a.a.debug("Ignoring duplicate codec"):(e.push(f),d.add(g))}return e},
23
+ IB=function(a){a=_.Xg(a,"LANGUAGE")||_.He;return _.Gi(a)},QB=function(a,b,c,d){var e,f,g,h,l,m;return _.B(function(n){if(1==n.a){e=_.on;f=dB(b,_.vb);if(a.f.has(f))return n["return"](a.f.get(f));g=_.Xg(b,MA);h=null;d==e.VIDEO&&g&&"NONE"!=g&&(h=a.N.get(g));l=GB(d,c);return _.x(n,TB(a,f,l,d,_.He,!1,null,null,h),2)}m=n.f;if(null==m)return n["return"](null);if(a.f.has(f))return n["return"](a.f.get(f));a.f.set(f,m);return n["return"](m)})},TB=function(a,b,c,d,e,f,g,h,l){var m,n,p,q,r,w,y,A,E,F,D,I,O,T,
24
+ Fa,fa,ka,wa,Aa,la,qa,Ga,Ma,ab,Eb,me,eh,Li,fh,$c;return _.B(function(rb){switch(rb.a){case 1:m=lB(a.A,b);p=null;if(a.j==uB&&a.I.has(m)){n=a.I.get(m);a.I["delete"](m);rb.H(2);break}return _.x(rb,xB(a,m),3);case 3:q=rb.f,m=q.uri,n=rB(a.R,q.data,m);case 2:if(1!=n.type)throw new _.L(_.M,4,4017);UB(a,n);return _.x(rb,VB(a,d,c,n),4);case 4:r=rb.f;w=[];n.a.forEach(function(Vf){Vf=hB(Vf.ta,"EXT-X-KEY");w.push.apply(w,Vf)});y=!1;A=[];E=null;F=_.u(w);for(D=F.next();!D.done;D=F.next())I=D.value,O=dB(I,"METHOD"),
25
+ T=_.Xg(I,"KEYFORMAT","identity"),"NONE"!=O&&("AES-128"==O?(Fa=_.Xg(I,"IV",""),fa=lB(a.A,dB(I,_.vb)),p={method:"AES-128",url:fa,iv:Fa?_.ek((Fa||"0x").slice(2)):null},a.J=!0):(y=!0,(wa=(ka=WB[T])?ka(I,r):null)?(wa.keyIds.length&&(E=wa.keyIds[0]),A.push(wa)):a.a.warn("Unsupported HLS KEYFORMAT",T)));if(y&&!A.length&&!a.J)throw new _.L(_.M,4,4026);Aa=new Map;return _.x(rb,yB(a,b,n,d,r,c,p,Aa),5);case 5:return la=rb.f,qa=la[0].startTime,Ga=la[la.length-1].endTime,Ma=Ga-qa,ab=new _.lw(la),Eb=a.g.hlsLowLatency?
26
+ _.hz:_.ev,me=XB(n,p),eh=void 0,d==_.Be&&(eh=_.xe),fh=(Li=jB(n.ta,VA))?"YES"===_.Xg(Li,"CAN-BLOCK-RELOAD"):!1,$c={id:a.fa++,originalId:g,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:ab.Bc.bind(ab),getSegmentReference:ab.get.bind(ab),adjustSegmentDurations:ab.Qc.bind(ab),getDuration:ab.getDuration.bind(ab),segmentIndex:ab,segmentLookupStrategy:Eb,initSegmentReference:me,mimeType:r,codecs:c,kind:eh,encrypted:y,keyId:E,language:e,label:g,type:d,primary:f,trickModeVideo:null,emsgSchemeIdUris:null,
27
+ frameRate:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:[],channelsCount:h,closedCaptions:l,keyInfo:p},rb["return"]({stream:$c,segmentIndex:ab,drmInfos:A,Sd:b,Eg:m,Fe:qa,tk:Ga,duration:Ma,Xh:Aa,Kg:fh})}})},UB=function(a,b){var c=jB(b.ta,TA),d=jB(b.ta,QA);d=c&&"VOD"==c.value||d;c=c&&"EVENT"==c.value&&!d;c=!d&&!c;if(d)zB(a,uB);else{c?zB(a,YB):zB(a,ZB);d=jB(b.ta,XA);if(!d)throw new _.L(_.M,4,4024,{missingTag:XA});d=Number(d.value);c=jB(b.ta,SA);a.g.hlsLowLatency&&c?(d=Number(dB(c,"PART-TARGET")),
28
+ a.F=Math.min(d,a.F),a.D=Math.max(d,a.D),d=jB(b.ta,VA),a.$=d?Number(dB(d,"PART-HOLD-BACK")):0):(a.D=Math.max(d,a.D),a.F=Math.min(d,a.F),a.$=3*a.D)}},XB=function(a,b){var c=hB(a.ta,"EXT-X-MAP");if(!c.length)return null;if(1<c.length)throw new _.L(_.M,4,4020);var d=c[0];c=dB(d,_.vb);var e=lB(a.f,c);c=0;var f=null;if(d=_.Xg(d,"BYTERANGE"))c=d.split("@"),d=Number(c[0]),c=Number(c[1]),f=c+d-1;return new _.Xv(function(){return[e]},c,f,b)},bC=function(a,b,c,d,e,f,g){var h=[],l={};b=_.u(_.LA(b.f));for(var m=
29
+ b.next();!m.done;l={Ud:l.Ud},m=b.next()){var n=m.value;m=n.Kd;n=n.item;var p=0==m?a:h[h.length-1],q=0==m?d:p.endTime,r=Number(_.Xg(n,"DURATION"));r=q+r;var w=_.Xg(n,"BYTERANGE");w=_.u(aC(p,w));p=w.next().value;w=w.next().value;var y=_.Xg(n,_.vb);y=lB(g,y);l.Ud=y?[y]:[];q=new _.Yv(c,q,r,function(A){return function(){return A.Ud}}(l),p,w,e,f,!1,null,null,null,null);if("YES"===_.Xg(n,"INDEPENDENT")||0===m)q.g=!0;h.push(q)}return h},xC=function(a,b,c,d,e,f,g,h,l){var m=c.ta,n=c.a,p=n?[n]:[];n=jB(m,YA);
30
+ (g=g?Object.assign({},g):null)&&!g.iv&&(g.iv=_.hk(new Uint8Array(12),new Uint8Array([d>>24&255,d>>16&255,d>>8&255,d&255])));var q=null,r=null,w=null;h===_.ld&&(r=jB(m,"EXT-X-TILES"),q="1x1",r&&(q=_.Xg(r,"LAYOUT")||"1x1",w=(w=_.Xg(r,"DURATION"))?Number(w):null),r=_.u(q.split("x").map(function(y){return parseInt(y,10)})),q=r.next().value,r=r.next().value);if(0===c.f.length&&!n)throw new _.L(_.M,4,4024,{missingTag:YA});h=null;if(0<c.f.length)if(a.g.hlsLowLatency)h=bC(b,c,d,e,f,g,l);else return null;
31
+ c=a=0;l=null;n?(a=e+Number(n.value.split(",")[0]),m=jB(m,NA),b=_.u(aC(b,m?m.value:null)),c=b.next().value,l=b.next().value):a=h[h.length-1].endTime;return new _.Yv(d,e,a,function(){return p},c,l,f,g,!1,null,q,r,w,h)},aC=function(a,b){var c=0,d=null;b&&(c=b.split("@"),d=Number(c[0]),c=c[1]?Number(c[1]):a.Ea+1,d=c+d-1);return[c,d]},DB=function(a){a.h&&(a.aa.forEach(function(b){_.bw(a.h,b,0)}),a.aa=[])},yB=function(a,b,c,d,e,f,g,h){var l,m,n,p,q,r,w,y,A,E,F,D,I,O,T,Fa,fa,ka,wa,Aa,la,qa,Ga;return _.B(function(Ma){switch(Ma.a){case 1:l=
32
+ c.a;m=XB(c,g);n=kB(c.ta);if(null!==a.T){Ma.H(2);break}p=a;return _.x(Ma,yC(a,b,m,l[0],n,g,e,f,d),3);case 3:p.T=Ma.f;case 2:q=a.T;r=l[0].a;a.a.debug("First segment",r.split("/").pop(),"starts at",q);y=(w=jB(c.ta,PA))?Number(w.value):0;h.has(y)||h.set(y,n);if(!w)for(;h.has(y+1)&&h.get(y+1)<n;)y++;A=a.L.get(y)||0;E=[];F=function(ab){return _.LA(ab)};D=_.u(F(l));I=D.next();case 4:if(I.done){Ma.H(6);break}T=O=I.value;Fa=T.Kd;fa=T.item;ka=E[E.length-1];wa=0==Fa?q:ka.endTime;Aa=n+Fa;la=jB(fa.ta,OA);if(!la){Ma.H(7);
33
+ break}y++;h.set(y,Aa);return _.x(Ma,zC(a,y,b,m,fa,Aa,g,e,f,wa,d),8);case 8:A=Ma.f;case 7:qa=xC(a,ka,fa,Aa,wa,A,g,d,c.f);Ga=jB(fa.ta,YA);qa&&(a.g.hlsLowLatency||Ga)&&E.push(qa);I=D.next();Ma.H(4);break;case 6:return a.aa.push(E),DB(a),Ma["return"](E)}})},zC=function(a,b,c,d,e,f,g,h,l,m,n){var p,q;return _.B(function(r){if(1==r.a)return p=0,a.L.has(b)?(p=a.L.get(b),r.H(2)):_.x(r,yC(a,c,d,e,f,g,h,l,n,!0),3);2!=r.a&&(q=r.f,p=q-m,a.a.debug("Discontinuity segment offset",p),a.L.set(b,p));return r["return"](p)})},
34
+ BC=function(a,b){var c,d,e,f,g,h,l;return _.B(function(m){switch(m.a){case 1:return c=b.f(),d=_.Wv(b.Ha(),b.Qa,b.Qa+2048-1,a.g.attemptParameters),d.type=2,e=_.Wv(b.Ha(),b.Qa,b.Ea,a.g.attemptParameters),e.type=2,c&&(e.keyInfo=c),_.yf(m,2),f=a.J?e:d,_.x(m,AC(a,f),4);case 4:return g=m.f,m["return"](g);case 2:h=_.Af(m);if(7001==h.code||a.J)throw h;a.a.warn("Unable to fetch a partial HLS segment! Falling back to a full segment request, which is expensive! Your server should support Range requests and CORS preflights.",
35
+ d.uris[0]);return _.x(m,AC(a,e),5);case 5:return l=m.f,m["return"](l)}})},yC=function(a,b,c,d,e,f,g,h,l,m){var n,p,q,r,w,y,A,E,F,D,I;return _.B(function(O){switch(O.a){case 1:n=xC(a,null,d,e,0,0,f,l,"");if(!n)return O["return"](0);if(a.K&&!m){p=a.f.get(b);q=p.segmentIndex;if(r=q.get(n.position))return a.a.debug("Found segment start time in previous manifest"),O["return"](r.startTime);a.a.debug("Unable to find segment start time in previous manifest!")}a.a.debug("Fetching segment to find start time");
36
+ if("audio/mpeg"==g)return O["return"](0);if(g!=_.jc){O.H(2);break}return _.x(O,BC(a,n),3);case 3:return w=O.f,y=_.N(w.data),tB(y)?O["return"](CC(y)):O["return"](DC(a,w.data));case 2:if(g!=_.Se&&g!=_.nc){O.H(4);break}A=[BC(a,n)];c&&A.push(BC(a,c));return _.x(O,Promise.all(A),5);case 5:return E=O.f,F=E[0],D=E[1]||E[0],O["return"](EC(a,F.data,D.data));case 4:if(g!=_.Re){O.H(6);break}return _.x(O,BC(a,n),7);case 7:return I=O.f,O["return"](DC(a,I.data));case 6:if(g===_.lc||g===_.kc||!MediaSource.isTypeSupported((g.split("/")[0]||
37
+ "")+'/mp4;codecs\x3d"'+h+'"'))return O["return"](0);throw new _.L(_.M,4,4030);}})},EC=function(a,b,c){var d=0;(new _.Gk).M(_.Dd,_.Hk).M(_.Fe,_.Hk).M(_.yd,_.Hk).W("mdhd",function(g){g.G.skip(0==g.version?8:16);d=_.U(g.G);g.Xa.stop()}).parse(c,!0);if(!d)throw a.a.error("Unable to find timescale in init segment!"),new _.L(_.M,4,4030);var e=0,f=!1;(new _.Gk).M("moof",_.Hk).M("traf",_.Hk).W("tfdt",function(g){e=(0==g.version?_.U(g.G):_.Ek(g.G))/d;f=!0;g.Xa.stop()}).parse(b,!0);if(!f)throw new _.L(_.M,
38
+ 4,4030);return e},DC=function(a,b){function c(){e.seek(f+188);g=_.Ak(e);71!=g&&(e.seek(f+192),g=_.Ak(e));71!=g&&(e.seek(f+204),g=_.Ak(e));71!=g&&d();eB(e)}function d(){throw new _.L(_.M,4,4030);}var e=new _.xk(new DataView(b),!1),f=0,g=0;f=FC(e);0>f&&(a.a.error("Unable to find sync byte in TS after scanning"),d());for(;;){f=e.getPosition();g=_.Ak(e);71!=g&&d();var h=_.Bk(e);if(8191===(h&8191))c();else if(h&16384)if(h=(_.Ak(e)&48)>>4,0!=h&&2!=h||d(),3==h&&(h=_.Ak(e),e.skip(h)),1!=_.U(e)>>8)c();else{e.skip(3);
39
+ h=_.Ak(e)>>6;0!=h&&1!=h||d();0==_.Ak(e)&&d();h=_.Ak(e);var l=_.Bk(e),m=_.Bk(e);return(1073741824*((h&14)>>1)+((l&65534)<<14|(m&65534)>>1))/9E4}else c()}},FC=function(a){for(;a.getPosition()<a.ya()-1;){var b=a.getPosition();if(71===_.Ak(a))return eB(a),b}return-1},CC=function(a){function b(l,m,n){for(var p="";m<n;m++)p+="%"+("00"+l[m].toString(16)).slice(-2);return p}function c(l){return l[0]<<21|l[1]<<14|l[2]<<7|l[3]}function d(){throw new _.L(_.M,4,4030);}tB(a)||d();var e=10;a[5]&64&&(e=e+4+c(a.subarray(10,
40
+ 14)));do{var f=c(a.subarray(e+4,e+8));1>f&&d();var g=String.fromCharCode(a[e],a[e+1],a[e+2],a[e+3]);if("PRIV"===g){g=a.subarray(e+10,e+f+10);for(var h=0;h<g.byteLength;h++)if(0===g[h]){if("com.apple.streaming.transportStreamTimestamp"===unescape(b(g,0,h)))return a=g.subarray(h+1),f=(a[3]&1)<<30|a[4]<<22|a[5]<<14|a[6]<<6|a[7]>>>2,f*=4,f+=a[7]&3,Math.round(f/9E4);break}}tB(a,e)||d();e+=10;e+=f}while(e<a.byteLength);return d()},GB=function(a,b){if(1==b.length)return b[0];var c=_.Sg(a,b);if(null!=c)return c;
41
+ throw new _.L(_.M,4,4025,{codecList:b});},VB=function(a,b,c,d){var e,f,g,h,l,m,n,p,q;return _.B(function(r){if(1==r.a){e=_.on;f=d.a[0].a;g=new _.Fg(f);h=g.pa.split(".").pop();l=BB[b];if(m=l[h])return r["return"](m);if(b==e.TEXT)return c&&"vtt"!=c?r["return"](_.cc):r["return"](_.Ce);n=_.Ih([f],a.g.attemptParameters);n.method="HEAD";n.type=2;return _.x(r,AC(a,n),2)}p=r.f;q=p.headers["content-type"];if(!q)throw new _.L(_.M,4,4021,h);return r["return"](q.split(";")[0])})},xB=function(a,b){var c=_.Ih([b],
42
+ a.g.attemptParameters);c.type=1;return AC(a,c)},GC=function(a){var b=dB(a,"METHOD"),c=["SAMPLE-AES",aB];if(!c.includes(b))return _.Sf("PlayReady in HLS is only supported with [",c.join(", "),"], not",b),null;a=dB(a,_.vb);b=_.Sp(a);a=null;b=_.N(b.data);try{a=_.rv(_.Gl(b))}catch(d){a=b}return _.Cv(_.Pc,[{initDataType:_.zc,initData:a}],"")},zB=function(a,b){a.j=b;if(a.h){var c=a.h,d=a.j==uB;c.j=d;c.m=d}a.j!=uB||a.w.stop()},AC=function(a,b){if(!a.B)throw new _.L(_.M,7,7001);var c=a.C.networkingEngine.fetch(b);
43
+ _.Sh(a.B,c);return c.P},HC=function(){},oB=[XA,RA,PA,TA,"EXT-X-MAP","EXT-X-I-FRAMES-ONLY",QA,VA,SA],pB=[YA,NA,OA,"EXT-X-PROGRAM-DATE-TIME","EXT-X-KEY","EXT-X-DATERANGE"],sB=["EXT-X-PART",UA];_.t=vB.prototype;_.t.configure=function(a){this.g=a};_.t.setCurrentVariant=function(a){var b=a.video?a.video.id:null;a=a.audio?a.audio.id:null;this.V.clear();for(var c=_.u(this.f.keys()),d=c.next();!d.done;d=c.next()){d=d.value;var e=this.f.get(d);!e.stream||e.stream.id!==b&&e.stream.id!==a||this.V.set(d,e)}};
44
+ _.t.start=function(a,b){var c=this,d,e;return _.B(function(f){if(1==f.a)return c.C=b,_.x(f,xB(c,a),2);if(3!=f.a)return d=f.f,c.A=d.uri,_.x(f,EB(c,d.data),3);e=c.ba;0<e&&c.w.Z(e);return f["return"](c.K)})};_.t.stop=function(){this.w&&(this.w.stop(),this.w=null);var a=[];this.B&&(a.push(this.B.destroy()),this.B=null);this.g=this.C=null;this.da.clear();this.f.clear();this.I.clear();this.K=null;this.o.clear();this.m.clear();return Promise.all(a)};
45
+ _.t.update=function(){var a=this,b,c,d,e,f;return _.B(function(g){if(1==g.a){if(a.j==uB)return g["return"]();b=[];a.T=null;c=Array.from(a.f.values());d=Array.from(a.V.values());e=a.g.hlsLowLatency&&0<d.length?d:c;return _.x(g,AB(a,e[0]),2)}for(f=1;f<e.length;f++)b.push(AB(a,e[f]));return _.x(g,Promise.all(b),0)})};_.t.onExpirationUpdated=function(){};
46
+ _.t.Bb=function(){var a=this,b,c,d;return _.B(function(e){if(1==e.a){a.a.debug(_.Yu);if(!a.C)return e["return"]();_.yf(e,2);return _.x(e,a.update(),4)}if(2!=e.a)return b=a.ba,a.w.Z(b),_.zf(e,0);c=_.Af(e);a.C&&(a.C.onError(c),d=c,1===d.severity&&a.w.Z(.1));_.z(e)})};
47
+ var BB={audio:{mp4:_.nc,m4s:_.nc,m4i:_.nc,m4a:_.nc,cmfa:_.nc,ts:_.Re,aac:_.jc,ec3:_.lc,ac3:_.kc},video:{mp4:_.Se,m4s:_.Se,m4i:_.Se,m4v:_.Se,cmfv:_.Se,ts:_.Re},text:{mp4:_.cc,m4s:_.cc,m4i:_.cc,cmft:_.cc,vtt:_.Ce,ttml:_.fc},image:{jpg:_.md,jpeg:_.md,png:"image/png",svg:"image/svg+xml",webp:"image/webp",avif:"image/avif"}},WB={"com.apple.streamingkeydelivery":function(a,b){if(b===_.Re)throw new _.L(_.M,4,4041);return _.Cv(_.Oc,[{initDataType:_.ne,initData:new Uint8Array(0)}],"")},"com.microsoft.playready":GC,
48
+ "urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":GC,"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(a){var b=dB(a,"METHOD"),c=["SAMPLE-AES",aB];if(!c.includes(b))return _.Sf("Widevine in HLS is only supported with [",c.join(", "),"], not",b),null;b=dB(a,_.vb);b=_.Sp(b);b=_.N(b.data);b=_.Cv(_.Qc,[{initDataType:_.zc,initData:b}],"");if(a=_.Xg(a,"KEYID"))b.keyIds=[a.substr(2).toLowerCase()];return b}},uB="VOD",ZB="EVENT",YB="LIVE",wB={VOD:uB,$j:ZB,LIVE:YB};_.v(HC,_.Bo);HC.prototype.Ja=function(){_.yp.m3u8=vB;_.wp[_.uj]=vB;_.wp[cB]=vB};HC.prototype.Ca=function(){_.uw("m3u8");_.vw(_.uj);_.vw(cB)};HC.prototype.id=function(){return"hls"};_.C("clpp.hls.HlsComponent",HC);};
51
49
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
52
50
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
53
51
  else{_=this.clpp._;(f.call(g,this));}
@@ -1,10 +1,10 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var zJ=function(a){this.startTime=a.startTime;this.endTime=a.endTime;this.a=this.f=null;a=a.value;if(!_.K.R(a)){a:{var b=a.info;if(_.K.Z(b)&&(b=b.toLowerCase().match(/lang:(\w+)/))&&b[1]){b=b[1].toLowerCase();break a}b=null}this.f=b;a=a.data;this.a=_.K.Z(a)?a:null}},BJ=function(a,b,c){this.l=a;this.m=b;this.j=c;this.a=new _.bg;this.h=(a=_.tp[_.cc]||null)?new a(this.l.getConfiguration()):null;this.f=new _.H("clpp.hlssmpte.ImageCueHandler");this.g=null;AJ(this)},AJ=function(a){a.a.one(a.l,_.qd,function(){return CJ(a)})},
3
- CJ=function(a){var b=a.l.getSurface().getMedia();if(b)if(a.h){a.a.on(b.textTracks,_.Sb,function(d){return DJ(a,d)});var c=Array.from(b.textTracks);c.filter(function(d){return d.kind===_.wd}).forEach(function(d){DJ(a,{track:d})});!EJ(c)&&a.m&&(a.f.warn("The metadata track is not present. Changing an audio track in order to enforce the creation of the metadata track."),FJ(a,b))}else a.f.warn("The clpp.ttml.TextParser class is not available. Please register the ttml component first.");else a.f.warn("A video element is not available. Skipping.")},
4
- EJ=function(a){return a.some(function(b){return b.kind===_.wd})},FJ=function(a,b){var c=a.l.getTrackManager(),d=c.ka(),e=c.getAudioTracks().find(function(g){return g!==d});if(e){var f=function(){return c.ra(d)};a.a.on(b.textTracks,_.Sb,function(g){g.track.kind===_.wd&&(a.a.off(b.textTracks,_.Sb,f),f())});c.ra(e)}else a.f.warn("Can't enforce the creation of the metadata track if single audio track. Skipping.")},DJ=function(a,b){var c=b.track;c.kind===_.wd&&(a.f.info("The metadata track has been added."),
5
- c.mode=_.hd,a.a.on(c,_.Qc,function(d){return GJ(a,d)}))},GJ=function(a,b){var c=HJ(a);c&&Array.from(b.target.activeCues||[]).forEach(function(d){if(d!==a.g&&Number.isFinite(d.startTime)&&Number.isFinite(d.endTime)&&"org.id3"===d.type&&d.value&&"TXXX"===d.value.key){var e=new zJ(d);if(e.f===c&&null!==e.a){a.g=d;d=a.h.parseMedia(_.eh(e.a),{periodStart:a.j,segmentStart:e.startTime,segmentEnd:e.endTime});var f=a.l.getTextDisplayer();f.remove(0,e.startTime);f.append(d.cues,d.styles)}}})},HJ=function(a){return(a=
6
- a.l.getTrackManager().la())&&a.language&&a.language.toLowerCase()},IJ=function(){this.a=null;this.f=!1},JJ=function(){};BJ.prototype.destroy=function(){this.a.release();this.g=null;return Promise.resolve()};_.v(IJ,_.Gp);IJ.prototype.onPlayerCreated=function(){};IJ.prototype.onContentWillLoad=function(a){if(this.f=_.Ii()){var b=a.getConfiguration();b=_.K.Ma(b.hlssmpte||{});_.K.Kf(b.patchMetadataTrack)||(b.patchMetadataTrack=!1);_.K.oa(b.timestampOffset)||(b.timestampOffset=0);this.a=new BJ(a,b.patchMetadataTrack,b.timestampOffset)}};IJ.prototype.onPlayerWillDestroy=function(){var a=this;return _.A(function(b){if(1==b.a)return a.a?_.y(b,a.a.destroy(),3):b.H(0);a.a=null;_.z(b)})};IJ.prototype.id=function(){return"hlssmpte"};
7
- _.C("clpp.hlssmpte.HlsSmptePlugin",IJ);IJ.Id="hlssmpte";JJ.prototype.create=function(){return new IJ};_.Un(new JJ);};
2
+ var f=function(window){var VJ=function(a){this.startTime=a.startTime;this.endTime=a.endTime;this.a=this.f=null;a=a.value;if(!_.K.S(a)){a:{var b=a.info;if(_.K.Y(b)&&(b=b.toLowerCase().match(/lang:(\w+)/))&&b[1]){b=b[1].toLowerCase();break a}b=null}this.f=b;a=a.data;this.a=_.K.Y(a)?a:null}},XJ=function(a,b,c){this.l=a;this.m=b;this.j=c;this.a=new _.dg;this.h=(a=_.Tp[_.fc]||null)?new a(this.l.getConfiguration()):null;this.f=new _.H("clpp.hlssmpte.ImageCueHandler");this.g=null;WJ(this)},WJ=function(a){a.a.one(a.l,_.ud,function(){return YJ(a)})},
3
+ YJ=function(a){var b=a.l.getSurface().getMedia();if(b)if(a.h){a.a.on(b.textTracks,_.Vb,function(d){return ZJ(a,d)});var c=Array.from(b.textTracks);c.filter(function(d){return d.kind===_.Ad}).forEach(function(d){ZJ(a,{track:d})});!$J(c)&&a.m&&(a.f.warn("The metadata track is not present. Changing an audio track in order to enforce the creation of the metadata track."),aK(a,b))}else a.f.warn("The clpp.ttml.TextParser class is not available. Please register the ttml component first.");else a.f.warn("A video element is not available. Skipping.")},
4
+ $J=function(a){return a.some(function(b){return b.kind===_.Ad})},aK=function(a,b){var c=a.l.getTrackManager(),d=c.ma(),e=c.getAudioTracks().find(function(g){return g!==d});if(e){var f=function(){return c.sa(d)};a.a.on(b.textTracks,_.Vb,function(g){g.track.kind===_.Ad&&(a.a.off(b.textTracks,_.Vb,f),f())});c.sa(e)}else a.f.warn("Can't enforce the creation of the metadata track if single audio track. Skipping.")},ZJ=function(a,b){var c=b.track;c.kind===_.Ad&&(a.f.info("The metadata track has been added."),
5
+ c.mode=_.kd,a.a.on(c,_.Tc,function(d){return bK(a,d)}))},bK=function(a,b){var c=cK(a);c&&Array.from(b.target.activeCues||[]).forEach(function(d){if(d!==a.g&&Number.isFinite(d.startTime)&&Number.isFinite(d.endTime)&&"org.id3"===d.type&&d.value&&"TXXX"===d.value.key){var e=new VJ(d);if(e.f===c&&null!==e.a){a.g=d;d=a.h.parseMedia(_.th(e.a),{periodStart:a.j,segmentStart:e.startTime,segmentEnd:e.endTime});var f=a.l.getTextDisplayer();f.remove(0,e.startTime);f.append(d.cues,d.styles)}}})},cK=function(a){return(a=
6
+ a.l.getTrackManager().na())&&a.language&&a.language.toLowerCase()},dK=function(){this.a=null;this.f=!1},eK=function(){};XJ.prototype.destroy=function(){this.a.release();this.g=null;return Promise.resolve()};_.v(dK,_.eq);dK.prototype.onPlayerCreated=function(){};dK.prototype.onContentWillLoad=function(a){if(this.f=_.Ui()){var b=a.getConfiguration();b=_.K.Na(b.hlssmpte||{});_.K.Of(b.patchMetadataTrack)||(b.patchMetadataTrack=!1);_.K.ka(b.timestampOffset)||(b.timestampOffset=0);this.a=new XJ(a,b.patchMetadataTrack,b.timestampOffset)}};dK.prototype.onPlayerWillDestroy=function(){var a=this;return _.B(function(b){if(1==b.a)return a.a?_.x(b,a.a.destroy(),3):b.H(0);a.a=null;_.z(b)})};dK.prototype.id=function(){return"hlssmpte"};
7
+ _.C("clpp.hlssmpte.HlsSmptePlugin",dK);dK.Id="hlssmpte";eK.prototype.create=function(){return new dK};_.wo(new eK);};
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;});}
10
10
  else{_=this.clpp._;(f.call(g,this));}