@castlabs/prestoplay 6.18.0 → 6.19.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.
Files changed (64) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +7 -7
  5. package/cjs/cl.cast.js +115 -114
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +581 -577
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +77 -75
  10. package/cjs/cl.externs.js +175 -293
  11. package/cjs/cl.freewheel.js +23 -24
  12. package/cjs/cl.hls.js +70 -71
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +28 -29
  15. package/cjs/cl.ima.js +24 -24
  16. package/cjs/cl.mse.js +313 -314
  17. package/cjs/cl.muxdata.js +15 -15
  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.sessions.js +16 -15
  22. package/cjs/cl.simid.js +15 -15
  23. package/cjs/cl.smooth.js +71 -72
  24. package/cjs/cl.thumbnails.js +26 -26
  25. package/cjs/cl.tizen.js +71 -71
  26. package/cjs/cl.ttml.js +27 -27
  27. package/cjs/cl.verimatrix.js +5 -5
  28. package/cjs/cl.vimond.js +12 -13
  29. package/cjs/cl.vr.js +19 -19
  30. package/cjs/cl.vtt.js +14 -14
  31. package/cjs/cl.youbora.js +18 -18
  32. package/cl.adobe.js +3 -3
  33. package/cl.airplay.js +3 -3
  34. package/cl.broadpeak.js +5 -5
  35. package/cl.cast.js +90 -89
  36. package/cl.conviva.js +27 -27
  37. package/cl.core.js +475 -474
  38. package/cl.crypto.js +9 -9
  39. package/cl.dash.js +72 -71
  40. package/cl.externs.js +172 -294
  41. package/cl.freewheel.js +19 -19
  42. package/cl.hls.js +74 -72
  43. package/cl.hlssmpte.js +5 -5
  44. package/cl.htmlcue.js +25 -26
  45. package/cl.ima.js +17 -17
  46. package/cl.mse.js +277 -274
  47. package/cl.muxdata.js +13 -13
  48. package/cl.onboard.js +4 -4
  49. package/cl.persistent.js +11 -11
  50. package/cl.playlist.js +5 -5
  51. package/cl.sessions.js +10 -10
  52. package/cl.simid.js +13 -13
  53. package/cl.smooth.js +59 -59
  54. package/cl.thumbnails.js +19 -19
  55. package/cl.tizen.js +57 -57
  56. package/cl.ttml.js +22 -22
  57. package/cl.verimatrix.js +4 -4
  58. package/cl.vimond.js +9 -8
  59. package/cl.vr.js +14 -14
  60. package/cl.vtt.js +12 -12
  61. package/cl.youbora.js +15 -15
  62. package/clpp.styles.css +14 -0
  63. package/package.json +1 -1
  64. package/typings.d.ts +379 -384
@@ -1,28 +1,27 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var iT="clpp-freewheel",jT="clpp.freewheel.AdsManagerFactory",kT="freewheel",lT=function(){this.f=this.a=null},mT=function(){},nT=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""}},oT=function(a,b,c){this.h=a;this.f=b;this.a=c},pT=function(a){this.a=a},qT=function(a){this.g=new _.K("clpp.freewheel.AdsManager");this.m=a;this.h=new _.Xh;this.w=new tv.freewheel.SDK.AdManager;
3
- this.f=this.a=null;this.B=[];this.o=[];this.A=[];this.l=new _.Rj;this.j=null},rT=function(a){var b=[];typeof a.networkId!==_.k&&b.push("networkId");typeof a.serverUrl!==_.mg&&b.push("serverUrl");typeof a.profileId!==_.mg&&b.push("profileId");typeof a.videoAssetId!==_.mg&&typeof a.videoAssetId!==_.k&&b.push("videoAssetId");if(b.length)throw new _.N(1,9,12001,{missingKeys:b.join(", ")});},sT=function(){var a,b,c,d;return _.I(function(e){if(1==e.a)return a=new _.Lt,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)})},vT=function(a){return _.I(function(b){if(a.B.length)return tT(a),a.f=a.B.shift(),a.f.play(),b.F(0);uT(a);return _.y(b,a.m.a.play(),0)})},wT=function(a){a.A.length?(tT(a),a.f=a.A.shift(),a.f.play()):uT(a)},tT=function(a){var b=a.m.rc(kT).Xc();b&&(a.m.getSurface().show(b),a.m.getSurface().hideMediaElement(),
5
- a.a.registerVideoDisplayBase(iT),a.m.isMuted()?a.setVolume(0):a.setVolume(a.m.getVolume()||1))},uT=function(a){var b=a.m.rc(kT).Xc();b&&a.m.getSurface().hide(b);a.m.getSurface().showMediaElement()},xT=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 oT(a.a,c,d)});a.m.trigger(new _.L(b,d))},yT=function(){this.dd=new _.K(jT)};_.x(lT,_.Gu);_.t=lT.prototype;
6
- _.t.onPlayerCreated=function(a){if(window.tv&&tv.freewheel&&tv.freewheel.SDK)this.a=_.Yp(_.be,{id:iT}),this.f=_.Yp(_.r,{"class":_.Ad}),this.a.appendChild(this.f),a.getSurface().addElementToContainer(this.a,!0),a.getSurface().hide(this.a);else a.onError(new _.N(1,9,12E3))};_.t.onPlayerWillDestroy=function(a){this.a&&(a.getSurface().removeElementFromContainer(this.a),this.f=this.a=null)};_.t.id=function(){return kT};_.t.Xc=function(){return this.a};_.t.Mk=function(){return this.f};
7
- _.J("clpp.freewheel.FreeWheelPlugin",lT);lT.prototype.getAdVideo=lT.prototype.Mk;lT.prototype.getAdContainer=lT.prototype.Xc;lT.Id=kT;lT.AD_CONTAINER_ID=iT;mT.prototype.create=function(){return new lT};_.br(new mT);_.t=oT.prototype;_.t.Cb=function(){return"FreeWheel AdManager SDK"};_.t.Db=function(){return tv.freewheel.SDK.version};_.t.Jb=function(){return 0};_.t.getId=function(){return this.a?this.a.getAdId():""};_.t.getCreativeId=function(){var a=(this.a||{})._creativeId;return typeof a===_.mg?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.vc=function(){return!1};_.t.Wb=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.Gb=function(){return this.a?this.a.getActiveCreativeRendition().getWidth():0};_.t.Fb=function(){return this.a?this.a.getActiveCreativeRendition().getHeight():0};_.t.qb=function(){return 0};_.t.gb=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.gb()){case 0:return 0;case 2:return-1}return this.h.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL).indexOf(this.f)+1};_.t.Xb=function(){switch(this.gb()){case 0:return 0;case 2:return-1;default:return this.f.getTimePosition()}};_.t.Yb=function(){return this.a?this.f.getAdInstances().indexOf(this.a)+1:1};_.t.Ib=function(){return this.f.getAdCount()};_.t.getWrapperAdIds=function(){return[]};_.t.getWrapperAdSystems=function(){return[]};
11
- _.t.getWrapperCreativeIds=function(){return[]};oT.prototype.getWrapperCreativeIds=oT.prototype.getWrapperCreativeIds;oT.prototype.getWrapperAdSystems=oT.prototype.getWrapperAdSystems;oT.prototype.getWrapperAdIds=oT.prototype.getWrapperAdIds;oT.prototype.getSequenceLength=oT.prototype.Ib;oT.prototype.getPositionInSequence=oT.prototype.Yb;oT.prototype.getPodTimeOffset=oT.prototype.Xb;oT.prototype.getPodIndex=oT.prototype.getPodIndex;oT.prototype.getPodType=oT.prototype.gb;
12
- oT.prototype.getMediaBitrate=oT.prototype.qb;oT.prototype.getMediaHeight=oT.prototype.Fb;oT.prototype.getMediaWidth=oT.prototype.Gb;oT.prototype.getMediaUrl=oT.prototype.getMediaUrl;oT.prototype.getClickThroughUrl=oT.prototype.Wb;oT.prototype.isBumper=oT.prototype.vc;oT.prototype.getSkipTimeOffset=oT.prototype.getSkipTimeOffset;oT.prototype.getDuration=oT.prototype.getDuration;oT.prototype.getTitle=oT.prototype.getTitle;oT.prototype.getAdvertiserName=oT.prototype.getAdvertiserName;
13
- oT.prototype.getAdSystem=oT.prototype.getAdSystem;oT.prototype.getApiFramework=oT.prototype.getApiFramework;oT.prototype.getCreativeId=oT.prototype.getCreativeId;oT.prototype.getId=oT.prototype.getId;oT.prototype.getTechnology=oT.prototype.Jb;oT.prototype.getAdManagerVersion=oT.prototype.Db;oT.prototype.getAdManagerName=oT.prototype.Cb;pT.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()}})};pT.prototype.Zb=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL).length};pT.prototype.sb=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL).length};
14
- pT.prototype.hasPostroll=pT.prototype.sb;pT.prototype.hasPreroll=pT.prototype.Zb;pT.prototype.getCuePoints=pT.prototype.getCuePoints;_.t=qT.prototype;
15
- _.t.load=function(){var a=this,b,c,d,e,f,g,h,l;return _.I(function(m){if(1==m.a){b=a.m.getConfiguration().freewheel||{};try{rT(b)}catch(n){return a.m.onError(n),a.l.resolve(),m["return"](a.l)}a.w.setNetwork(b.networkId);a.w.setServer(b.serverUrl);a.a=a.w.newContext();a.a.setProfile(b.profileId);typeof b.siteSectionId!==_.mg&&typeof b.siteSectionId!==_.k||a.a.setSiteSection(b.siteSectionId);return _.y(m,sT(),2)}c=m.f;a.a.setVideoAsset(b.videoAssetId,a.m.getDuration(),void 0,void 0,c);if(Array.isArray(b.pods))for(d=
16
- _.w(b.pods),e=d.next();!e.done;e=d.next())f=e.value,a.a.addTemporalSlot(f.id,nT(f.type),f.position,f.slotProfile,f.cuepointSequence,f.maxDuration,f.minDuration,f.acceptContentType);b.keyValues&&typeof b.keyValues===_.$e&&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=_.w(b.parameters),h=g.next();!h.done;h=
17
- g.next())l=h.value,a.a.setParameter(l.name,l.value,l.level);a.h.on(a.a,tv.freewheel.SDK.EVENT_REQUEST_COMPLETE,a.tm.bind(a));a.h.on(a.a,tv.freewheel.SDK.EVENT_SLOT_STARTED,a.xm.bind(a));a.h.on(a.a,tv.freewheel.SDK.EVENT_SLOT_ENDED,a.wm.bind(a));a.h.on(a.a,tv.freewheel.SDK.EVENT_AD,a.Nl.bind(a));a.h.on(a.m,_.ug,a.Dj.bind(a));a.h.on(a.m,_.jg,a.Cj.bind(a));a.a.submitRequest();return m["return"](a.l)})};_.t.start=function(){var a=this;return _.I(function(b){return _.y(b,vT(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 _.I(function(b){a.h.release();a.j&&(a.j.stop(),a.j=null);uT(a);a.a&&(a.a.dispose(),a.a=null);_.B(b)})};
19
- _.t.tm=function(a){var b=this;if(a.success)this.B=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL),this.o=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL),this.A=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL),this.m.trigger(new _.L(_.Qc,{adsTimeline:new pT(this.a)})),this.j=new _.Jt(this.m.getSurface(),function(c,d){return b.a.resize(c,d)},this.m.rc(kT).f);else this.m.onError(new _.N(1,9,10003,{errorType:0},
20
- void 0));this.l.resolve()};_.t.xm=function(a){xT(this,_.zc,a);this.j.start()};_.t.wm=function(a){this.f=null;a=a.slot;xT(this,_.Ac);this.j.stop();if(a)switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:vT(this);break;case tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL:uT(this);this.m.play();break;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:wT(this)}};
21
- _.t.Nl=function(a){var b=a.subType;this.g.debug("ad event",b);switch(b){case tv.freewheel.SDK.EVENT_AD_IMPRESSION:xT(this,_.Mc,a);xT(this,_.Fc,a);break;case tv.freewheel.SDK.EVENT_AD_IMPRESSION_END:xT(this,_.Nc,a);break;case tv.freewheel.SDK.EVENT_AD_FIRST_QUARTILE:xT(this,_.Ec,a);break;case tv.freewheel.SDK.EVENT_AD_MIDPOINT:xT(this,_.Hc,a);break;case tv.freewheel.SDK.EVENT_AD_THIRD_QUARTILE:xT(this,_.Oc,a);break;case tv.freewheel.SDK.EVENT_AD_COMPLETE:xT(this,_.Dc,a);break;case tv.freewheel.SDK.EVENT_AD_CLICK:xT(this,
22
- _.Cc,a);break;case tv.freewheel.SDK.EVENT_AD_PAUSE:xT(this,_.Ic,a);break;case tv.freewheel.SDK.EVENT_AD_RESUME:xT(this,_.Kc,a);break;case tv.freewheel.SDK.EVENT_AD_SKIPPED:xT(this,_.Lc,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_START:xT(this,_.Bc,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_END:xT(this,_.Jc,a);break;case tv.freewheel.SDK.EVENT_ERROR:this.m.onError(new _.N(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.Dj=function(){var a=this;if(!this.f){var b=this.m.getPosition();if(this.f=this.o.find(function(d){return.5>Math.abs(b-d.getTimePosition())})||null){var c=this.o.findIndex(function(d){return d===a.f});this.o.splice(c,1);this.m.pause();tT(this);this.f.play()}}};
24
- _.t.Cj=function(a){if((a=a.detail)&&this.a)switch(a.currentState){case _.Bp:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PLAYING);break;case _.Ap:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PAUSED);break;case _.up:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_COMPLETED);wT(this);break;case _.np:case _.yp:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_STOPPED)}};qT.prototype.getPosition=qT.prototype.getPosition;qT.prototype.setVolume=qT.prototype.setVolume;
25
- qT.prototype.getVolume=qT.prototype.getVolume;qT.prototype.skip=qT.prototype.skip;qT.prototype.pause=qT.prototype.pause;qT.prototype.resume=qT.prototype.resume;qT.prototype.start=qT.prototype.start;yT.prototype.name=function(){return jT};yT.prototype.isSupported=function(a,b){return a.namespace()===_.Hd?!1:window.tv&&tv.freewheel&&tv.freewheel.SDK?!(!b||!b.freewheel):(this.dd.warn("FreeWheel SDK is not loaded."),!1)};yT.prototype.create=function(a){return new qT(a)};yT.prototype.create=yT.prototype.create;yT.prototype.isSupported=yT.prototype.isSupported;yT.prototype.name=yT.prototype.name;_.Vp(new yT);};
2
+ var f=function(window){var sT="clpp-freewheel",tT="clpp.freewheel.AdsManagerFactory",uT="freewheel",vT=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""}},wT=function(a){this.a=a},xT=function(a,b,c){this.h=a;this.f=b;this.a=c},yT=function(){this.f=this.a=null},zT=function(){},AT=function(a){this.g=new _.K("clpp.freewheel.AdsManager");this.m=a;this.h=new _.Oh;this.w=new tv.freewheel.SDK.AdManager;
3
+ this.f=this.a=null;this.B=[];this.o=[];this.A=[];this.l=new _.Cj;this.j=null},BT=function(a){var b=[];typeof a.networkId!==_.k&&b.push("networkId");typeof a.serverUrl!==_.gg&&b.push("serverUrl");typeof a.profileId!==_.gg&&b.push("profileId");typeof a.videoAssetId!==_.gg&&typeof a.videoAssetId!==_.k&&b.push("videoAssetId");if(b.length)throw new _.N(1,9,12001,{missingKeys:b.join(", ")});},CT=function(){var a,b,c,d;return _.I(function(e){if(1==e.a)return a=new _.St,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)})},FT=function(a){return _.I(function(b){if(a.B.length)return DT(a),a.f=a.B.shift(),a.f.play(),b.F(0);ET(a);return _.y(b,a.m.a.play(),0)})},GT=function(a){a.A.length?(DT(a),a.f=a.A.shift(),a.f.play()):ET(a)},DT=function(a){var b=a.m.uc(uT).bd();b&&(a.m.getSurface().show(b),a.m.getSurface().hideMediaElement(),
5
+ a.a.registerVideoDisplayBase(sT),a.m.isMuted()?a.setVolume(0):a.setVolume(a.m.getVolume()||1))},ET=function(a){var b=a.m.uc(uT).bd();b&&a.m.getSurface().hide(b);a.m.getSurface().showMediaElement()},HT=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 xT(a.a,c,d)});a.m.trigger(new _.L(b,d))},IT=function(){this.hd=new _.K(tT)};wT.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()}})};wT.prototype.Fb=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL).length};wT.prototype.Eb=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL).length};
6
+ wT.prototype.hasPostroll=wT.prototype.Eb;wT.prototype.hasPreroll=wT.prototype.Fb;wT.prototype.getCuePoints=wT.prototype.getCuePoints;_.u=xT.prototype;_.u.jb=function(){return"FreeWheel AdManager SDK"};_.u.kb=function(){return tv.freewheel.SDK.version};_.u.qb=function(){return 0};_.u.getId=function(){return this.a?this.a.getAdId():""};_.u.getCreativeId=function(){var a=(this.a||{})._creativeId;return typeof a===_.gg?a:""};_.u.getApiFramework=function(){return this.a?this.a.getActiveCreativeRendition().getCreativeApi():""};_.u.getAdSystem=function(){return""};_.u.getAdvertiserName=function(){return""};_.u.getTitle=function(){return""};
7
+ _.u.getDuration=function(){return this.a?this.a.getActiveCreativeRendition().getDuration():0};_.u.getPosition=function(){return 0};_.u.getSkipTimeOffset=function(){return 0};_.u.Sb=function(){return!1};_.u.yb=function(){return this.a&&this.a.getEventCallbackUrls(tv.freewheel.SDK.EVENT_AD_CLICK,tv.freewheel.SDK.EVENT_TYPE_CLICK)[0]||""};_.u.getMediaUrl=function(){return this.a?this.a.getActiveCreativeRendition().getPrimaryCreativeRenditionAsset().getUrl():""};
8
+ _.u.ob=function(){return this.a?this.a.getActiveCreativeRendition().getWidth():0};_.u.nb=function(){return this.a?this.a.getActiveCreativeRendition().getHeight():0};_.u.ab=function(){return 0};_.u.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}};
9
+ _.u.getPodIndex=function(){switch(this.Ua()){case 0:return 0;case 2:return-1}return this.h.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL).indexOf(this.f)+1};_.u.Cb=function(){switch(this.Ua()){case 0:return 0;case 2:return-1;default:return this.f.getTimePosition()}};_.u.Db=function(){return this.a?this.f.getAdInstances().indexOf(this.a)+1:1};_.u.pb=function(){return this.f.getAdCount()};_.u.getWrapperAdIds=function(){return[]};_.u.getWrapperAdSystems=function(){return[]};
10
+ _.u.getWrapperCreativeIds=function(){return[]};xT.prototype.getWrapperCreativeIds=xT.prototype.getWrapperCreativeIds;xT.prototype.getWrapperAdSystems=xT.prototype.getWrapperAdSystems;xT.prototype.getWrapperAdIds=xT.prototype.getWrapperAdIds;xT.prototype.getSequenceLength=xT.prototype.pb;xT.prototype.getPositionInSequence=xT.prototype.Db;xT.prototype.getPodTimeOffset=xT.prototype.Cb;xT.prototype.getPodIndex=xT.prototype.getPodIndex;xT.prototype.getPodType=xT.prototype.Ua;
11
+ xT.prototype.getMediaBitrate=xT.prototype.ab;xT.prototype.getMediaHeight=xT.prototype.nb;xT.prototype.getMediaWidth=xT.prototype.ob;xT.prototype.getMediaUrl=xT.prototype.getMediaUrl;xT.prototype.getClickThroughUrl=xT.prototype.yb;xT.prototype.isBumper=xT.prototype.Sb;xT.prototype.getSkipTimeOffset=xT.prototype.getSkipTimeOffset;xT.prototype.getPosition=xT.prototype.getPosition;xT.prototype.getDuration=xT.prototype.getDuration;xT.prototype.getTitle=xT.prototype.getTitle;
12
+ xT.prototype.getAdvertiserName=xT.prototype.getAdvertiserName;xT.prototype.getAdSystem=xT.prototype.getAdSystem;xT.prototype.getApiFramework=xT.prototype.getApiFramework;xT.prototype.getCreativeId=xT.prototype.getCreativeId;xT.prototype.getId=xT.prototype.getId;xT.prototype.getTechnology=xT.prototype.qb;xT.prototype.getAdManagerVersion=xT.prototype.kb;xT.prototype.getAdManagerName=xT.prototype.jb;_.x(yT,_.Hu);_.u=yT.prototype;_.u.onPlayerCreated=function(a){if(window.tv&&tv.freewheel&&tv.freewheel.SDK)this.a=_.ir(_.Xd,{id:sT}),this.f=_.ir(_.r,{"class":_.yd}),this.a.appendChild(this.f),a.getSurface().addElementToContainer(this.a,!0),a.getSurface().hide(this.a);else a.onError(new _.N(1,9,12E3))};_.u.onPlayerWillDestroy=function(a){this.a&&(a.getSurface().removeElementFromContainer(this.a),this.f=this.a=null)};_.u.id=function(){return uT};_.u.bd=function(){return this.a};_.u.Wk=function(){return this.f};
13
+ _.J("clpp.freewheel.FreeWheelPlugin",yT);yT.prototype.getAdVideo=yT.prototype.Wk;yT.prototype.getAdContainer=yT.prototype.bd;yT.Id=uT;yT.AD_CONTAINER_ID=sT;zT.prototype.create=function(){return new yT};_.lt(new zT);_.u=AT.prototype;
14
+ _.u.load=function(){var a=this,b,c,d,e,f,g,h,l;return _.I(function(m){if(1==m.a){b=a.m.getConfiguration().freewheel||{};try{BT(b)}catch(n){return a.m.onError(n),a.l.resolve(),m["return"](a.l)}a.w.setNetwork(b.networkId);a.w.setServer(b.serverUrl);a.a=a.w.newContext();a.a.setProfile(b.profileId);typeof b.siteSectionId!==_.gg&&typeof b.siteSectionId!==_.k||a.a.setSiteSection(b.siteSectionId);return _.y(m,CT(),2)}c=m.f;a.a.setVideoAsset(b.videoAssetId,a.m.getDuration(),void 0,void 0,c);if(Array.isArray(b.pods))for(d=
15
+ _.w(b.pods),e=d.next();!e.done;e=d.next())f=e.value,a.a.addTemporalSlot(f.id,vT(f.type),f.position,f.slotProfile,f.cuepointSequence,f.maxDuration,f.minDuration,f.acceptContentType);b.keyValues&&typeof b.keyValues===_.Ve&&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=_.w(b.parameters),h=g.next();!h.done;h=
16
+ g.next())l=h.value,a.a.setParameter(l.name,l.value,l.level);a.h.on(a.a,tv.freewheel.SDK.EVENT_REQUEST_COMPLETE,a.ym.bind(a));a.h.on(a.a,tv.freewheel.SDK.EVENT_SLOT_STARTED,a.Cm.bind(a));a.h.on(a.a,tv.freewheel.SDK.EVENT_SLOT_ENDED,a.Bm.bind(a));a.h.on(a.a,tv.freewheel.SDK.EVENT_AD,a.Tl.bind(a));a.h.on(a.m,_.pg,a.Pj.bind(a));a.h.on(a.m,_.dg,a.Oj.bind(a));a.a.submitRequest();return m["return"](a.l)})};_.u.start=function(){var a=this;return _.I(function(b){return _.y(b,FT(a),0)})};_.u.Vc=function(){};
17
+ _.u.resume=function(){this.f&&this.f.resume()};_.u.pause=function(){this.f&&this.f.pause()};_.u.skip=function(){this.f&&this.f.skipCurrentAd()};_.u.getVolume=function(){return this.a?this.a.getAdVolume():1};_.u.setVolume=function(a){this.a&&this.a.setAdVolume(a)};_.u.getPosition=function(){return this.f?this.f.getPlayheadTime():-1};_.u.Rc=function(){return!0};_.u.pc=function(){var a=this;return _.I(function(b){a.h.release();a.j&&(a.j.stop(),a.j=null);ET(a);a.a&&(a.a.dispose(),a.a=null);_.A(b)})};
18
+ _.u.ym=function(a){var b=this;if(a.success)this.B=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL),this.o=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL),this.A=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL),this.m.trigger(new _.L(_.Oc,{adsTimeline:new wT(this.a)})),this.j=new _.Tt(this.m.getSurface(),function(c,d){return b.a.resize(c,d)},this.m.uc(uT).f);else this.m.onError(new _.N(1,9,10003,{errorType:0},
19
+ void 0));this.l.resolve()};_.u.Cm=function(a){HT(this,_.vc,a);this.j.start()};_.u.Bm=function(a){this.f=null;a=a.slot;HT(this,_.wc);this.j.stop();if(a)switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:FT(this);break;case tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL:ET(this);this.m.play();break;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:GT(this)}};
20
+ _.u.Tl=function(a){var b=a.subType;this.g.debug("ad event",b);switch(b){case tv.freewheel.SDK.EVENT_AD_IMPRESSION:HT(this,_.Kc,a);HT(this,_.Dc,a);break;case tv.freewheel.SDK.EVENT_AD_IMPRESSION_END:HT(this,_.Lc,a);break;case tv.freewheel.SDK.EVENT_AD_FIRST_QUARTILE:HT(this,_.Ac,a);break;case tv.freewheel.SDK.EVENT_AD_MIDPOINT:HT(this,_.Fc,a);break;case tv.freewheel.SDK.EVENT_AD_THIRD_QUARTILE:HT(this,_.Mc,a);break;case tv.freewheel.SDK.EVENT_AD_COMPLETE:HT(this,_.zc,a);break;case tv.freewheel.SDK.EVENT_AD_CLICK:HT(this,
21
+ _.yc,a);break;case tv.freewheel.SDK.EVENT_AD_PAUSE:HT(this,_.Gc,a);break;case tv.freewheel.SDK.EVENT_AD_RESUME:HT(this,_.Ic,a);break;case tv.freewheel.SDK.EVENT_AD_SKIPPED:HT(this,_.Jc,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_START:HT(this,_.xc,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_END:HT(this,_.Hc,a);break;case tv.freewheel.SDK.EVENT_ERROR:this.m.onError(new _.N(1,9,10003,{errorType:1},{fwCode:a[tv.freewheel.SDK.INFO_KEY_ERROR_CODE],fwInfo:a[tv.freewheel.SDK.INFO_KEY_ERROR_INFO],
22
+ fwModule:a[tv.freewheel.SDK.INFO_KEY_ERROR_MODULE]}))}};_.u.Pj=function(){var a=this;if(!this.f){var b=this.m.getPosition();if(this.f=this.o.find(function(d){return.5>Math.abs(b-d.getTimePosition())})||null){var c=this.o.findIndex(function(d){return d===a.f});this.o.splice(c,1);this.m.pause();DT(this);this.f.play()}}};
23
+ _.u.Oj=function(a){if((a=a.detail)&&this.a)switch(a.currentState){case _.Cp:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PLAYING);break;case _.Bp:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PAUSED);break;case _.vp:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_COMPLETED);GT(this);break;case _.op:case _.zp:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_STOPPED)}};AT.prototype.getPosition=AT.prototype.getPosition;AT.prototype.setVolume=AT.prototype.setVolume;
24
+ AT.prototype.getVolume=AT.prototype.getVolume;AT.prototype.skip=AT.prototype.skip;AT.prototype.pause=AT.prototype.pause;AT.prototype.resume=AT.prototype.resume;IT.prototype.name=function(){return tT};IT.prototype.a=function(a,b){return a.namespace()===_.Cd?!1:window.tv&&tv.freewheel&&tv.freewheel.SDK?!(!b||!b.freewheel):(this.hd.warn("FreeWheel SDK is not loaded."),!1)};IT.prototype.create=function(a){return new AT(a)};_.Yp(new IT);};
26
25
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
27
26
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
28
27
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.hls.js CHANGED
@@ -1,75 +1,74 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var sJ="Could not parse MP4 segment start time.",tJ="Failed to infer discontinuity number",uJ="Guessing audio-only",vJ="METHOD",wJ="SAMPLE-AES-CTR",xJ="Setting playlist start time to ",yJ="Two EXT-X-KEY tags, one with METHOD\x3dAES-128 are applied to one ",zJ="application/vnd.apple.mpegurl",AJ="sample",BJ="whole-segment",CJ=function(a){if(1>a.a)throw _.Km();--a.a},DJ=function(a,b,c,d){if(1===b){if(!d||0===d.length)throw new _.N(_.O,4,4043,"Media playlist must have at least one segment!");if(null==
3
- d[0].a)throw new _.N(_.O,4,4043,"Media playlist must have at least one full segment!");}this.f=a;this.a="";this.type=b;this.X=c;this.U=1===b?d:null},EJ=function(a,b,c){c=void 0===c?[]:c;this.X=b;this.a=a;this.f=c;this.ga=-1},FJ=function(a){a=_.w(a);for(var b=a.next();!b.done;b=a.next())if(b=b.value,b.startsWith("#EXT-")&&(b=_.Hj(0,b),_.jv.has(b.name)))return 1;return 0},GJ=function(a,b){var c=new Map,d=new URL(b);a.forEach(function(e){var f=_.bj(e,"NAME"),g=_.bj(e,"QUERYPARAM");if(f)g=_.cj(e,"VALUE"),
4
- c.set(f,g);else if(g){f=d.searchParams.get(g);if(null==f)throw new _.N(_.O,4,4044,"Query param '"+g+"' missing in playlist URI.");if(!f)throw new _.N(_.O,4,4044,"Query param '"+g+"' has no associated value in playlist URI.");c.set(g,decodeURIComponent(f))}});return c},HJ=function(a,b){return a.replace(/\{\$([a-zA-Z0-9_-]+)\}/g,function(c,d){var e=b.get(d);if(null==e)throw new _.N(_.O,4,4044,"Undefined variable '"+d+"'");return e})},IJ=function(a,b){a.forEach(function(c){c.attributes.forEach(function(d){d.value=
5
- HJ(d.value,b)})})},JJ=function(a,b,c){IJ(a,c);b.forEach(function(d){d.a&&(d.a=HJ(d.a,c));IJ(d.X,c);IJ(d.f,c)})},KJ=function(){this.f=0;this.a=new Map},NJ=function(a,b,c){b=b.trim().split(/\n+/m).map(function(d){return d.trim()}).filter(function(d){return d.length&&!_.Y.Fh(d)});if(!/^#EXTM3U($|[ \t\n])/m.test(b[0]))throw new _.N(_.O,4,4015);return 0===FJ(b)?LJ(a,b,c):MJ(a,b,c)},MJ=function(a,b,c){for(var d=[],e=1;e<b.length;){var f=OJ(a,b[e]);if(_.kv.has(f.name))break;d.push(f);e++}b=PJ(a,c,b.slice(e));
6
- e=b.U;d=d.concat(b.X);a=QJ(a,d,c);JJ(d,e,a);return new DJ(c,1,d,b.U)},LJ=function(a,b,c){for(var d=[],e=1;e<b.length;e++){var f=OJ(a,b[e]);d.push(f);if(f.name===_.Ya){var g=b[e+1];if(!g)throw new _.N(_.O,4,4044,"EXT-X-STREAM-INF is not followed by a URI.");f.attributes.push(new _.dj(_.hc,g));e++}}b=_.Y.Bb(d,"EXT-X-DEFINE");_.Y.Ai(b);b=GJ(b,c);a.a=b;JJ(d,[],a.a);return new DJ(c,0,d)},PJ=function(a,b,c){var d=[],e=[],f=[],g=[];c.forEach(function(h){/^(#EXT)/.test(h)?(h=OJ(a,h),_.jv.has(h.name)||_.mv.has(h.name)?
7
- d.push(h):_.lv.has(h.name)?"EXT-X-PART"===h.name?g.push(h):h.name===_.Va&&"PART"===_.bj(h,_.fc)&&g.push(h):f.push(h)):_.Y.Fh(h)||(h=_.Y.vd(b,h.trim(),!1),e.push(new EJ(h,f,g)),f=[],g=[])});0<g.length&&e.push(new EJ(null,f,g));return{U:e,X:d}},OJ=function(a,b){return _.Hj(a.f++,b)},QJ=function(a,b,c){b=_.Y.Bb(b,"EXT-X-DEFINE");_.Y.Ai(b);var d=GJ(b,c);b.map(function(e){return _.bj(e,"IMPORT")}).filter(Boolean).forEach(function(e){var f=a.a.get(e);if(null==f)throw new _.N(_.O,4,4044,"Cannot import variable '"+
8
- e+"' as it is not defined in the master playlist");d.set(e,f)});return d},RJ=function(a){var b=void 0===b?0:b;return 0>a?[]:Array.from({length:a},function(c,d){return d+b})},SJ=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},TJ=function(){this.a=new Map;this.f=new Map},UJ=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]<<
9
- 21|l[1]<<14|l[2]<<7|l[3]}function d(){throw new _.N(_.O,4,4030);}SJ(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+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}}SJ(a,e)||d();
10
- e+=10;e+=f}while(e<a.byteLength);return d()},VJ=function(a){for(;a.getPosition()<a.Ia()-1;){var b=a.getPosition();if(71===_.Lm(a))return CJ(a),b}return-1},WJ=function(a){function b(){d.seek(e+188);f=_.Lm(d);71!==f&&(d.seek(e+192),f=_.Lm(d));71!==f&&(d.seek(e+204),f=_.Lm(d));71!==f&&c();CJ(d)}function c(){throw new _.N(_.O,4,4030);}var d=new _.Im(new DataView(a),!1),e=0,f=0;e=VJ(d);0>e&&(_.Iv.error("Unable to find sync byte in TS after scanning."),c());for(;;)if(e=d.getPosition(),f=_.Lm(d),71!==f&&
11
- c(),a=_.Mm(d),8191===(a&8191))b();else if(a&16384)if(a=(_.Lm(d)&48)>>4,0!==a&&2!==a||c(),3===a&&(a=_.Lm(d),d.skip(a)),1!==_.W(d)>>8)b();else{d.skip(3);a=_.Lm(d)>>6;0!==a&&1!==a||c();0===_.Lm(d)&&c();a=_.Lm(d);var g=_.Mm(d),h=_.Mm(d);return(1073741824*((a&14)>>1)+((g&65534)<<14|(h&65534)>>1))/9E4}else b()},XJ=function(a,b){var c=null,d=0;try{(new _.Rm).M(_.We,_.Sm).M(_.vg,_.Sm).M(_.Re,_.Sm).Y("mdhd",function(g){g.reader.skip(0===g.version?8:16);d=_.W(g.reader);g.parser.stop()}).parse(b,!0)}catch(g){c=
12
- g}if(c||!d)throw _.Iv.error("Unable to find timescale in init segment!"),new _.N(_.O,4,4030,sJ,c);var e=0,f=!1;try{(new _.Rm).M("moof",_.Sm).M("traf",_.Sm).Y("tfdt",function(g){var h=d;if(0===g.version)h=_.W(g.reader)/h;else{var l=_.W(g.reader),m=_.W(g.reader);if(!(2097151>=l||h>=Math.pow(2,12)))throw Error("Cannot accurately parse MP4 timestamp, base time is too high and timescale is \x3c\x3d 2^12");h=l/h*Math.pow(2,32)+m/h}e=h;f=!0;g.parser.stop()}).parse(a,!0)}catch(g){c=g}if(c||!f)throw new _.N(_.O,
13
- 4,4030,sJ,c);return e},$J=function(a){var b=_.cj(a,vJ);if(!YJ.includes(b))return ZJ.error("PlayReady in HLS is only supported with [",YJ.join(", "),"], not",b),null;a=_.cj(a,_.hc);b=_.ru(a);a=null;b=_.oj(b.data);try{a=_.yC(_.Un(b))}catch(c){a=b}return _.LC(_.Td,[{initDataType:_.vd,initData:a}],"")},aK=function(a){this.g=new _.K("clpp.hls.MediaReader");this.f=a;this.a={attemptParameters:_.Jj()}},cK=function(a,b,c,d,e,f){var g,h,l,m,n,p,q,u;return _.I(function(v){switch(v.a){case 1:a.g.debug("Fetching segment to find start time");
14
- if("audio/mpeg"===d||d===_.gd||d===_.ed)return v["return"](0);g=f;if(d!==_.dd){v.F(2);break}return _.y(v,bK(a,c,g),3);case 3:return h=v.f,l=_.oj(h.data),SJ(l)?v["return"](UJ(l)):v["return"](WJ(h.data));case 2:if(d!==_.Mg&&d!==_.hd){v.F(4);break}m=[bK(a,c,g)];b&&m.push(bK(a,b,!0));return _.y(v,Promise.all(m),5);case 5:return n=v.f,p=n[0],q=n[1]||n[0],v["return"](XJ(p.data,q.data));case 4:if(d!==_.Lg){v.F(6);break}return _.y(v,bK(a,c,g),7);case 7:return u=v.f,v["return"](WJ(u.data));case 6:if(!_.Cr((d.split("/")[0]||
15
- "")+'/mp4;codecs\x3d"'+e+'"'))return v["return"](0);throw new _.N(_.O,4,4030);}})},bK=function(a,b,c){var d,e,f,g,h,l,m;return _.I(function(n){switch(n.a){case 1:return d=b.f(),e=_.mD(b.Sa(),b.xa,b.xa+2048-1,a.a.attemptParameters),e.type=2,f=_.mD(b.Sa(),b.xa,b.ka,a.a.attemptParameters),f.type=2,d&&(f.keyInfo=d),_.D(n,2),g=c?f:e,_.y(n,a.f(g),4);case 4:return h=n.f,n["return"](h);case 2:l=_.E(n);if(7001===l.code||c)throw l;a.g.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 pre-flights.",
16
- e.uris[0]);_.D(n,5);return _.y(n,a.f(f),7);case 7:return n["return"](n.f);case 5:throw m=_.E(n),a.g.error("Failed to fetch media segment to parse its start timestamp.",f.uris[0],m),new _.N(_.O,4,4030,"Failed to fetch the media segment.");}})},dK=function(a){this.streams=a},eK=function(a,b){a.streams.forEach(function(c){c.hf=b})},fK=function(a,b){a.streams.forEach(function(c){c.width=b})},gK=function(a,b){a.streams.forEach(function(c){c.height=b})},hK=function(a,b){a.streams.forEach(function(c){c.frameRate=
17
- b})},iK=function(a,b){a.streams.forEach(function(c){c.bandwidth=b})},jK=function(a,b){var c=a.map(function(d){return d.streams[b]});return c.some(function(d){return null==d})?null:c},kK=function(a){this.a=a},lK=function(a,b){var c=a.map(function(d){return d.a[b]});return c.some(function(d){return null==d})?null:c},mK=function(a,b){var c=new Set(a.map(function(d){return d.ga}));return b.filter(function(d){return!c.has(d.ga)})},pK=function(a,b){for(;a[0].ga<b[0].ga;)a.splice(0,1);var c=a[0],d=b[0];
18
- nK(c,d)||oK(c,d);var e=a.length-1;c=a[e];d=b[e];0<e&&!nK(c,d)&&oK(c,d);for(c=e+1;c<b.length;)a.push(b[c]),c++},qK=function(a,b){var c=a[a.length-1],d=b.findIndex(function(f){return f.ga===c.ga}),e=b[d];nK(c,e)||oK(c,e);for(d+=1;d<b.length;d++)a.push(b[d])},vK=function(a,b,c,d,e){var f=b[0].length();f=RJ(f).map(function(g){var h=lK(b,g)||[],l=jK(c,g)||[];g=jK(d,g)||[];var m=_.fh(rK(h)).concat(_.fh(l),_.fh(g)).filter(Boolean);sK(m);var n=m[0];m=n.ga;n=n.duration;return{configurationId:a,variants:h,
19
- textStreams:l,thumbStreams:g,startTime:0,id:"P"+m,endTime:n,duration:n,ga:m}});e&&tK(f[0]);uK(f);return f},rK=function(a){a=new Set(a.flatMap(function(b){return[b.video,b.audio]}).filter(Boolean));return Array.from(a)},tK=function(a){var b=rK(a.variants)[0].U[0].Aa;a.startTime+=b;a.endTime+=b},uK=function(a){for(var b=0;b<a.length;b++){var c=a[b],d=a[b-1];c.startTime=d?d.endTime:c.startTime;c.endTime=c.startTime+c.duration}},nK=function(a,b){return a.startTime===b.startTime&&a.endTime===b.endTime},
20
- oK=function(a,b){a.startTime=b.startTime;a.endTime=b.endTime;a.duration=b.duration;wK(a.variants,b.variants);xK(_.Y.Qe(a),_.Y.Qe(b))},wK=function(a,b){var c=new Map(a.map(function(d){return[_.Y.bh(d),d]}));b.forEach(function(d){c.get(_.Y.bh(d)).drmInfos=d.drmInfos})},xK=function(a,b){var c=new Map(a.map(function(d){return[d.hc,d]}));b.forEach(function(d){var e=c.get(d.hc);e.U=d.U;e.segmentIndex.replace(d.U);e.ac=d.ac;e.Ee=d.Ee;e.duration=d.duration;e.gh=d.gh;e.encrypted=d.encrypted;e.drmInfos=d.drmInfos;
21
- e.keyId=d.keyId})},sK=function(a){var b=yK(a);a.forEach(function(c){_.hD(c.segmentIndex,b);c.duration=b;c.Ee=c.ac+b})},yK=function(a){var b=Infinity;_.Y.Ck(a).forEach(function(c){b=Math.min(b,c.duration)});return b},zK=function(){var a=this;this.a=this.C=null;this.R=1;this.f=new TJ;this.w="";this.L=new KJ;this.D=0;this.j=null;this.h=new _.Zk(function(){a.Mb()});this.l=_.oc;this.o=null;this.B=new _.Vj;this.A=null;this.g=new _.K("clpp.hls.HlsParser");this.I=new Map;this.N=new aK(this.sf.bind(this));
22
- this.K=!1;this.H=null;this.J=!1;this.G=new Map},AK=function(a){if(null===a.j)return[];a=a.j;return[a.audio,a.video].filter(function(b){return b}).map(function(b){return b.hc})},BK=function(a,b){for(var c=_.w(b),d=c.next();!d.done;d=c.next()){d=d.value;var e=a.G.get(d.id);if(e&&e.startTime!==d.startTime)a.C.onError(new _.N(1,4,4044,"EXT-X-DATERANGE START-DATE has changed for ID\x3d"+d.id));e||(a.G.set(d.id,d),a.C.onTimelineCueAdded({configurationId:a.C.configurationId,schemeIdUri:d.schemeIdUri,va:d.va,
23
- value:"",startTime:d.startTime,endTime:d.endTime,id:d.id,type:_.iv,eventElement:null}))}},HK=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,u,v,z;return _.I(function(A){if(1==A.a){c=_.Mp;d=_.Y;e=CK(a,b,a.w,"");if(1===e.type){f=e.U[0].a;var G=_.Yi(f)||"";g=null!=_.Zi.video[G]?_.r:null!=_.Zi.audio[G]?_.cd:null;h="";g===c.VIDEO?h="avc1.42E01E":g===c.AUDIO&&(h="mp4a.40.2");G=a.L;var F=a.w,C=a.a.hlsDefaultCodecs||h,H=[],Q=[];Q.push(new _.dj(_.pa,"0"));Q.push(new _.dj(_.hc,F));C.length&&Q.push(new _.dj(_.ta,C));
24
- H.push(new _.aj(G.f++,_.Ya,Q));e=new DJ(F,0,H)}l=_.Y.Km(e.X);return _.y(A,DK(a,l),2)}m=A.f;n=m.periods;p=m.Vm;q=m.sn;if(!a.C)throw new _.N(_.O,7,7001);u=d.Xk(n[0]);EK(a,n);G=!0;F=null;C=0;FK(a)||(G=!1,F=0,C=u.delay);H=a.a.timeline||{};H.type=void 0;F=new _.pD(H,F,C,!0,void 0,!!a.a.lowLatencyMode);_.sD(F,G);GK(F,n);p&&_.rD(F,p);v=F;if(!FK(a)){a.D=u.Bc;C=0;F=_.w(a.f.values());for(G=F.next();!G.done;G=F.next())C=Math.max(C,G.value.streams[0].ac);for(F=0;95443.7176888889<=C;)F+=95443.7176888889,C-=95443.7176888889;
25
- if(F)for(a.g.debug("Offsetting live streams by",F,"to compensate for rollover"),C=_.w(a.f.values()),G=C.next();!G.done;G=C.next())G=G.value.streams[0],95443.7176888889>G.ac?(a.g.debug("Offset applied to",G.type),G.segmentIndex.offset(F)):a.g.debug("Offset NOT applied to",G.type)}G=_.Y.Yk(n);"LIVE"===a.l||"EVENT"===a.l?(G=Math.max(G,v.K),isNaN(a.a.availabilityWindowOverride)||(G=a.a.availabilityWindowOverride),v.A=G):a.l===_.oc&&(v.f=G);BK(a,q);z={presentationTimeline:v,adaptedPeriods:_.fh(n).concat(),
26
- periods:n,minBufferTime:0};a.g.debug("HLS playlist parsed",z);return A["return"](z)})},KK=function(a,b){var c,d,e,f,g,h,l,m,n;return _.I(function(p){if(1==p.a)return c=_.Y,_.y(p,IK(a,b),2);d=p.f;e=d.textStreams;f=d.thumbStreams;g=d.Vi;h=a.o.periods[0].variants;a.a.lowLatencyMode&&null!==a.j&&(h=h.filter(function(q){return q.id===a.j.id}));l=h.map(function(q){var u=c.lh(q.audio,g),v=c.lh(q.video,g);q=JK(a,u,v,q.bandwidth);if(!q)throw new _.N(_.O,4,4047,{message:"Video and audio are encrypted in an incompatible way.",
27
- oo:v?v.Kb():void 0,audio:u?u.Kb():void 0});return q});m=a.C.configurationId;n=vK(m,l,e,f,!0);return p["return"](n)})},IK=function(a,b){var c,d,e,f,g,h,l,m,n;return _.I(function(p){if(1==p.a)return c=_.Mp,d=function(q){return q.stream.td()===c.VIDEO||q.stream.td()===c.AUDIO},e=b.filter(d),f=b.filter(function(q){return!d(q)}),g=function(q){q=q.map(function(u){var v=u.stream.streams[0];u=Object.assign({},{playlist:u.playlist},{language:v.language,channelsCount:v.channelsCount,spatialAudio:v.spatialAudio,
28
- closedCaptions:v.closedCaptions,primary:v.primary,kind:v.kind||null,groupId:v.groupId,type:v.type,codecs:v.codecs,name:v.originalId,uri:v.hc,Te:{width:v.width,height:v.height,frameRate:v.frameRate}});return LK(a,u)});return Promise.all(q)},_.y(p,g(e),2);if(3!=p.a)return h=p.f,_.y(p,g(f),3);l=p.f;MK(a,h.concat(l));m=l.filter(function(q){return q.td()===c.Oi});n=l.filter(function(q){return q.td()===c.IMAGE});return p["return"]({textStreams:m,thumbStreams:n,Vi:h})})},MK=function(a,b){b.forEach(function(c){a.f.a.set(c.Kb(),
29
- c)})},DK=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,u,v;return _.I(function(z){switch(z.a){case 1:return c=_.Y.Dm(b.ed.closedCaptions),d=NK(a,b.ce),_.y(z,OK(a,b),2);case 2:return e=z.f,f=Object.values(e).flat().map(function(A){return A.playlist}),PK(a,f),_.y(z,QK(a,e.Bg,d),3);case 3:return g=z.f,_.y(z,RK(a,e.ce,g,c),4);case 4:return h=z.f,_.y(z,SK(a,e.nn,d),5);case 5:return l=z.f,_.y(z,TK(a,e.Hf),6);case 6:return m=z.f,n=a.C.configurationId,p=vK(n,h,l,m,!FK(a)),a.C.filterAllPeriods(p),q=_.fh(e.ce).concat(_.fh(e.Bg)).map(function(A){return A.playlist}),
30
- u=UK(a,q),v=VK(a,q,u),z["return"]({periods:p,Vm:u,sn:v})}})},EK=function(a,b){FK(a)||2!==a.a.timeline.version||(a.H||(a.H=b[0].startTime),_.fF(b,-a.H))},VK=function(a,b,c){b=b.find(function(d){return null!==_.Y.Ra(d.X,_.La)});if(!b)return[];if(null===c)throw new _.N(_.O,4,4024,"EXT-X-PROGRAM-DATE-TIME tag is required when EXT-X-DATERANGE tags are present");return b.X.filter(function(d){return d.name===_.La}).map(function(d){return _.Y.Em(d,c,a.A,!FK(a))}).filter(Boolean)},UK=function(a,b){var c=b.flatMap(function(e){return e.U[0].X});
31
- c=_.Y.Ra(c,_.Wa);if(!c)return null;var d=(new Date(c.value)).getTime();return isNaN(d)?(a.g.warn("Failed to parse EXT-X-PROGRAM-DATE-TIME tag value (value: "+(c.value+").")),null):d/1E3},OK=function(a,b){var c,d,e,f,g,h;return _.I(function(l){if(1==l.a)return _.y(l,Promise.all([WK(a,b.ed.Ui),WK(a,b.ed.pn),WK(a,b.ce),WK(a,b.Hf)]),2);c=l.f;d=_.w(c);e=d.next().value;f=d.next().value;g=d.next().value;h=d.next().value;return l["return"]({Bg:e,nn:f,ce:g,Hf:h})})},YK=function(a,b){return Promise.all(b.map(function(c){return XK(a,
32
- c)}))},NK=function(a,b){for(var c=_.Y.te,d=new Map,e=_.w(b),f=e.next();!f.done;f=e.next()){var g=f.value,h=_.bj(g,"AUDIO");f=_.bj(g,_.nc);var l=_.bj(g,_.Yb);g=ZK(a,g);if(l){var m=_.Xi(_.P,g);d.set(c(_.P,l),m);l=g.indexOf(m);-1<l&&g.splice(l,1)}h&&(l=$K(_.cd,g),d.set(c(_.cd,h),l));f&&(h=$K(_.r,g),d.set(c(_.r,f),h))}return d},SK=function(a,b,c){return Promise.all(b.map(function(d){return aL(a,d,c)}))},TK=function(a,b){return Promise.all(b.map(function(c){return bL(a,c)}))},QK=function(a,b,c){var d,
33
- e;return _.I(function(f){if(1==f.a){if(0===b.length)return f["return"](new Map);d=[aL(a,b[0],c)];return _.y(f,d[0],2)}if(3!=f.a)return d=d.concat(b.slice(1).map(function(g){return aL(a,g,c)})),_.y(f,Promise.all(d),3);e=f.f;return f["return"](_.Y.tn(e))})},RK=function(a,b,c,d){var e,f,g,h,l,m,n,p,q,u,v;return _.I(function(z){if(1==z.a){e=new Set;f=_.fh(b).concat();g=0;h=Infinity;for(l=0;l<f.length;++l)m=Number(_.cj(f[l].tag,_.pa)),m<h&&(h=m,g=l);n=f.splice(g,1).pop();return _.y(z,cL(a,n,c,d,e),2)}if(3!=
34
- z.a)return p=z.f,q=f.map(function(A){return cL(a,A,c,d,e)}),_.y(z,Promise.all(q),3);u=z.f;u.splice(g,0,p);v=u.reduce(_.IC,[]);return z["return"](v)})},cL=function(a,b,c,d,e){var f,g,h,l,m,n;return _.I(function(p){return 1==p.a?(f=_.Y,g=b,h=g.tag,l=Number(_.cj(h,_.pa)),m=f.Om(h),_.y(p,dL(a,b,m,c,d),2)):(n=p.f)?p["return"](eL(a,n,l,e)):p["return"]([])})},dL=function(a,b,c,d,e){var f,g,h,l,m,n,p,q,u,v,z,A,G,F,C,H,Q,R,na;return _.I(function(da){if(1==da.a)return f=_.Mp,g=_.Y.te,h=b,l=h.tag,m=h.playlist,
35
- n=ZK(a,l),p=_.bj(l,"AUDIO"),q=_.bj(l,_.nc),u=p?d.get(g(f.AUDIO,p))||[]:[],v=q?d.get(g(f.VIDEO,q))||[]:[],z=_.fh(u).concat(_.fh(v)),A={audio:u,video:v},a.g.debug("Guessing stream type for",l.toString()),F=!1,C=m.a,H=A.audio.find(function(Ba){return Ba.Kb()===C}),Q=_.Xi(f.VIDEO,n),R=c||Q,1!==n.length||R?!z.length&&1<n.length?(a.g.debug("Guessing multiplexed audio+video"),G=f.VIDEO,n=[n.join(",")]):A.audio.length&&H?(a.g.debug(uJ),G=f.AUDIO,F=!0):A.video.length?(a.g.debug(uJ),G=f.AUDIO):(a.g.debug("Guessing video-only"),
36
- G=f.VIDEO):(G=f.AUDIO,a.g.debug(uJ)),na=null,F?da.F(2):_.y(da,fL(a,b,n,G,e,c),3);2!=da.a&&(na=da.f);if(null==na)return da["return"](null);A[G]=[na];G===f.AUDIO&&c&&z.forEach(function(Ba){fK(Ba,c.width);gK(Ba,c.height);hK(Ba,c.frameRate)});_.Y.yk(A);return da["return"](A)})},eL=function(a,b,c,d){var e=b.video,f=b.audio;e=0<e.length?e:[null];b=[];f=_.w(0<f.length?f:[null]);for(var g=f.next();!g.done;g=f.next()){g=g.value;for(var h=_.w(e),l=h.next();!l.done;l=h.next()){var m=l.value;l=_.Y.uk(g,m);d.has(l)?
37
- a.g.debug("Skipping variant which only differs in text streams."):(m=JK(a,g,m,c),null==m?a.g.warn("Incompatible DRM info in HLS variant. Skipping."):(b.push(m),d.add(l)))}}return b},JK=function(a,b,c,d){for(var e=[],f=(c||b).length(),g=0;g<f;g++){var h=b?b.streams[g]||null:null,l=c?c.streams[g]||null:null,m=_.Y.Qk(h,l);if(!m)return null;var n=d;h={id:a.R++,language:h?h.language:_.yg,primary:!!h&&h.primary||!!l&&l.primary,audio:h,video:l,bandwidth:n,drmInfos:m,allowedByApplication:!0,allowedByKeySystem:!0};
38
- e.push(h)}return new kK(e)},aL=function(a,b,c){var d,e,f,g;return _.I(function(h){d=b;e=d.tag;f=d.playlist;g=f.a;return h["return"](gL(a,g,function(){var l,m,n,p,q,u,v,z,A,G,F,C,H,Q,R;return _.I(function(na){if(1==na.a){l=_.Mp;m=_.Y.te;n=_.cj(e,_.gb);p=_.Y.$g(_.cj(e,_.fc));q=_.Y.qk(e);u=c.get(m(p,n))||"";v=_.bj(e,_.vb);z=_.bj(e,"NAME");A=e.getAttribute("DEFAULT");G=e.getAttribute("AUTOSELECT");F=_.bj(e,"CHANNELS");C=p===l.AUDIO?F?parseInt(F.split("/")[0],10):null:null;var da=p===l.AUDIO?(da=_.bj(e,
39
- "CHANNELS"))?da.includes("/JOC"):!1:!1;H=da;Q=!!A&&!!G;return _.y(na,LK(a,{playlist:f,codecs:u,type:p,Sd:v,primary:Q,name:z,channelsCount:C,spatialAudio:H,groupId:n,kind:q,closedCaptions:null,Te:null}),2)}R=na.f;return na["return"](R)})}))})},bL=function(a,b){var c,d,e,f;return _.I(function(g){c=b;d=c.tag;e=c.playlist;f=e.a;return g["return"](gL(a,f,function(){var h,l,m,n,p;return _.I(function(q){if(1==q.a)return h=_.bj(d,_.ta)||"jpg",l=_.bj(d,_.vb),m=_.bj(d,"NAME"),_.y(q,LK(a,{playlist:e,codecs:h,
40
- type:_.Be,Sd:l,name:m,primary:!1,kind:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,groupId:null,Te:null}),2);n=q.f;(p=_.bj(d,_.pa))&&iK(n,Number(p));return q["return"](n)})}))})},ZK=function(a,b){var c=_.bj(b,_.ta,a.a.hlsDefaultCodecs||"avc1.42E01E,mp4a.40.2").split(/\s*,\s*/),d=new Set,e=[];c=_.w(c);for(var f=c.next();!f.done;f=c.next()){f=f.value;var g=_.UC(f);d.has(g)?a.g.debug("Ignoring duplicate codec"):(e.push(f),d.add(g))}return e},fL=function(a,b,c,d,e,f){var g,h,l,m,n;return _.I(function(p){g=
41
- b;h=g.tag;l=g.playlist;m=_.Mp;n=l.a;return p["return"](gL(a,n,function(){var q,u,v,z;return _.I(function(A){if(1==A.a)return q=_.bj(h,_.sa),u=null,d===m.VIDEO&&q&&"NONE"!==q&&(u=e.get(q)),v=$K(d,c),_.y(A,LK(a,{playlist:l,codecs:v,type:d,closedCaptions:u,primary:!1,kind:null,Sd:null,name:null,channelsCount:null,spatialAudio:!1,groupId:null,Te:f}),2);z=A.f;return A["return"](z)})}))})},gL=function(a,b,c){if(a.f.has(b))return a=a.f.get(b),Promise.resolve(a);if(a.f.f.has(b))return a.f.f.get(b)||null;
42
- c=c();a.f.set(b,c);return c},LK=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,u,v,z,A,G,F,C,H,Q,R,na,da,Ba,ab,bb;return _.I(function(Qa){if(1==Qa.a){c=hL;d=iL;e=_.Mp;f=_.Y;g=b;h=g.playlist;l=g.codecs;m=g.type;n=g.Sd;p=g.groupId;q=g.primary;u=g.kind;v=g.name;z=g.channelsCount;A=g.spatialAudio;G=g.closedCaptions;F=g.Te;C=_.Y.th(n);if(1!==h.type)throw new _.N(_.O,4,4017);H=_.Y.Mm(h.X,null==a.o);a.l=H;Q=_.Y.Jm(h.X,H,a.a.lowLatencyMode||!1,a.a.suggestedPresentationDelay);return _.y(Qa,jL(a,h,m,l),2)}R=Qa.f;
43
- na=a.a.lowLatencyMode?d.Ii:d.Ki;da=u;m!==e.TEXT||u||(da=_.pg);Ba=f.ii(h.X);ab=Ba.me;bb=R.map(function(Ca){var fb=Ca.U,pc=Ca.Ak,Eg=Ca.mimeType;Ca=Ca.ga;var Fg=fb[0].startTime,wn=fb[fb.length-1].endTime,hu=wn-Fg,fd=new _.LD(fb),xn=fb[0].initSegment||null;return{id:_.rJ++,originalId:v,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:fd.find.bind(fd),getSegmentReference:fd.get.bind(fd),adjustSegmentDurations:fd.od.bind(fd),getDuration:fd.getDuration.bind(fd),segmentIndex:fd,segmentLookupStrategy:na,
44
- initSegmentReference:xn,mimeType:Eg,codecs:l,kind:da,gh:pc.type,encrypted:pc.type===c.Ni,keyId:pc.keyId,language:C,originalLanguage:n||_.yg,label:v,type:m,primary:q,trickModeVideo:null,emsgSchemeIdUris:null,frameRate:F?F.frameRate:void 0,width:F?F.width:void 0,height:F?F.height:void 0,bandwidth:void 0,roles:[],channelsCount:z,spatialAudio:A,closedCaptions:G,keyInfo:pc.keyInfo,U:fb,drmInfos:pc.drmInfos,ga:Ca,hc:h.a,hf:h.f,ac:Fg,Ee:wn,duration:hu,me:ab,groupId:p,Bl:Q}});return Qa["return"](new dK(bb))})},
45
- WK=function(a,b){var c;return _.I(function(d){if(1==d.a)return _.y(d,Promise.all(b.map(function(e){var f;return _.I(function(g){if(1==g.a)return _.y(g,kL(a,e),2);f=g.f;return g["return"](f?{tag:e,playlist:f}:null)})})),2);c=d.f;return d["return"](c.filter(Boolean))})},kL=function(a,b){var c,d,e,f,g,h,l;return _.I(function(m){if(1==m.a){c=_.Y.xl(b);d=_.bj(b,_.hc,void 0,{required:c});if(!d)return m["return"](null);e=_.Y.vd(a.w,d);return _.y(m,lL(a,e),2)}f=m.f;g=f.response;h=f.text;l=g.uri;return m["return"](CK(a,
46
- h,l,d))})},XK=function(a,b){var c,d,e,f,g,h,l,m;return _.I(function(n){if(1==n.a){var p=new _.Ji(b.streams[0].hf);if(a.a.lowLatencyMode&&b.streams[0].me){var q=b.streams[b.streams.length-1].segmentIndex;if(q=q.a[q.a.length-1]){var u=q.a,v=u.length-1;q={Gl:q.position,Pm:u&&0<u.length?v:null}}else q=null;if(u=q)q=u.Gl,u=u.Pm,v=_.wk(p.a.toString()),v._HLS_msn=q.toString(),null===u&&v._HLS_part&&delete v._HLS_part,null!==u&&(v._HLS_part=u.toString()),q=_.vk(v,!0),_.Mi(p,new _.Qi(q))}c=p.toString();return _.y(n,
47
- lL(a,c),2)}d=n.f;e=d.response;f=d.text;g=b.Kb();h=b.streams[0].hf;l=e.uri;h!==l&&(h=l,eK(b,h));m=CK(a,f,h,g);return n["return"]({stream:b,playlist:m})})},CK=function(a,b,c,d){a=NJ(a.L,b,c);a.a=d;return a},mL=function(a){if(1<(new Set(a.map(function(b){return b.mimeType}))).size)throw new _.N(_.O,4,4045,"Media playlist contains discontinuities with different MIME types. This is valid, but not yet supported.");},nL=function(a){a=a.map(function(b){return b.a?b.a:b.f.map(function(c){return _.bj(c,_.hc)})||
48
- null}).map(function(b){return _.Yi(b)});if(1<(new Set(a)).size)throw new _.N(_.O,4,4044,"Unexpected change in file format.");},oL=function(a,b,c){a=_.Y.Bb(a.X,_.Ra);if(1<a.length)throw new _.N(_.O,4,4020);a=a[0];if(!a)return null;var d=_.cj(a,_.hc),e=_.Y.vd(b,d);b=_.Y.gi(a,null,!0);return new _.MC(function(){return[e]},b.xa,b.ka,c)},pL=function(a,b,c,d,e,f,g){var h=[],l={};b=_.w(_.qJ(b.f));for(var m=b.next();!m.done;l={Ve:l.Ve},m=b.next()){var n=m.value;m=n.Ah;n=n.item;var p=0===m,q=p?a:h[h.length-
49
- 1],u=p?d:q.endTime,v=Number(_.bj(n,_.Ha));v=u+v;p=_.Y.gi(n,p?null:q.ka,p);q=_.bj(n,_.hc);q=_.Y.vd(g,q);l.Ve=q?[q]:[];u=new _.fj(c,u,v,function(z){return function(){return z.Ve}}(l),p.xa,p.ka,e,f,!1,null,null,null,null);if("YES"===_.bj(n,"INDEPENDENT")||0===m)u.h=!0;h.push(u)}return h},qL=function(a,b,c,d,e,f,g,h,l,m,n){var p=c.X,q=c.a;0<_.Y.Bb(p,_.Ra).length&&(n=oL(c,l,g));var u=null!=q,v=q?[q]:[];if(!u&&!a.a.lowLatencyMode)return null;a=0;q={xa:0,ka:null};var z=null;u?(c=_.Y.Hm(p).duration,a=e+c,
50
- q=_.Y.hi(p,b?b.ka:null)):(b=pL(b,c,d,e,f,g,l),a=b[b.length-1].endTime,z=b);h=h===_.Be?_.Y.Nm(p):null;d=new _.fj(d,e,a,function(){return v},q.xa,q.ka,f,g,!1,null,h?h.Jd:null,h?h.be:null,h?h.durationPerTile:null,z,n);d.ga=m;return d},jL=function(a,b,c,d){var e,f,g,h,l,m,n,p,q,u,v,z,A,G;return _.I(function(F){switch(F.a){case 1:return e=_.Y,f=rL,g=sL,h=b.a,l=b.U,m=e.Uk(b.X,_.Sa),n=[],!FK(a)&&g.Ti(l),_.y(F,tL(a,b.f,h,l,m,c,d),2);case 2:p=F.f,q=m,u=f.ln(l),v=0;case 3:if(!(v<u.length)){F.F(5);break}z=u[v];
51
- A=n[n.length-1]||null;return _.y(F,uL(a,b.f,z,q,p,c,d,A,u.length),6);case 6:G=F.f;n.push(G);q+=z.length;v++;F.F(3);break;case 5:return mL(n),F["return"](n)}})},tL=function(a,b,c,d,e,f,g){var h,l,m,n,p,q,u,v,z,A,G,F;return _.I(function(C){if(1==C.a){h=d[0];if(null!=a.A)return C["return"](a.A);if(!FK(a)&&a.o)try{var H=a.f.get(c),Q=H?H.find(e)||null:null;if(!Q)throw new _.N(_.O,4,4030,"Segment not found in pervious playlist update.");l=Q.startTime+Q.Aa;a.g.debug(xJ+l+".");a.A=l;return C["return"](l)}catch(R){if(m=
52
- a.f.get(c))n=m.streams[0].U[0].position,C=m.streams[m.streams.length-1].U,p=C[C.length-1].position,q=e,u=e+d.length-1,a.g.warn("Last #EXT-X-MEDIA-SEQUENCE values "+n+" - "+p+(", new values "+q+" - "+u+"."),b,m);throw new _.N(_.O,4,4047,{message:"The updated playlist does not share any segments with the previous one.",uri:c});}return _.y(C,vL(a,f,g,h),2)}if(3!=C.a)return v=C.f,z=sL.Lm(h,a.w,v),A=oL(h,b,z.keyInfo),G=_.Y.Df(z.keyInfo,e),_.y(C,wL(a,A,h,G,v,g),3);F=C.f;a.g.debug(xJ+F+".");a.A=F;return C["return"](F)})},
53
- uL=function(a,b,c,d,e,f,g,h,l){var m,n,p,q,u,v,z,A,G,F,C,H,Q,R,na,da,Ba,ab,bb,Qa,Ca;return _.I(function(fb){switch(fb.a){case 1:return m=_.Y,n=sL,p=c[0],q=null==h,nL(c),_.y(fb,vL(a,f,g,p),2);case 2:u=fb.f;v=n.Gm(c,a.w,u,h?h.Al:null,1===l);z=v[v.length-1];A=sL.pa(v);G=oL(p,b,A.keyInfo)||(h?h.ol:null);F=_.Y.Df(A.keyInfo,d);C=p.ga;if(q){H=e;fb.F(3);break}return _.y(fb,xL(a,C,G,p,d,F,u,g),4);case 4:H=fb.f;case 3:Q=H;R=[];for(na=0;na<c.length;na++)if(da=c[na],Ba=R[R.length-1]||null,ab=0===na?0:Ba.endTime,
54
- bb=d+na,Qa=m.Df(A.keyInfo,bb),Ca=qL(a,Ba,da,bb,ab,Q,Qa,f,b,C,G))G=Ca.initSegment,R.push(Ca);return fb["return"]({U:R,Ak:A,Al:z,mimeType:u,endTime:R[R.length-1].endTime,ga:C,ol:G})}})},PK=function(a,b){b.forEach(function(c){var d=a.f.get(c.a);rL.Zi(c,d,!FK(a))});rL.vk(b)},xL=function(a,b,c,d,e,f,g,h){var l;return _.I(function(m){if(1==m.a)return a.I.has(b)?m["return"](a.I.get(b)):_.y(m,wL(a,c,d,f,g,h),2);l=m.f;a.g.debug("Segment #"+e+" has raw media timestamp "+(l+" s."));a.I.set(b,l);return m["return"](l)})},
55
- wL=function(a,b,c,d,e,f){var g;return _.I(function(h){if(null==c.a)return h["return"](0);g=_.Y.tk(c,d);return h["return"](cK(a.N,b,g,e,f,null!=d))})},$K=function(a,b){if(1===b.length)return b[0];var c=_.Xi(a,b);if(null!=c)return c;throw new _.N(_.O,4,4025,{codecList:b});},vL=function(a,b,c,d){var e,f,g;return _.I(function(h){e=d.a;g=(f=_.Y.Ra(d.X,_.Ra))?_.cj(f,_.hc):null;return h["return"](yL(a,b,c,e,g))})},yL=function(a,b,c,d,e){var f,g,h,l,m;return _.I(function(n){if(1==n.a){f=[d,e].filter(Boolean);
56
- if(g=_.$i(f,b,c))return n["return"](g);h=_.Mj([d],a.a.attemptParameters);h.method="HEAD";h.type=2;return _.y(n,a.sf(h),2)}l=n.f;m=l.headers["content-type"];if(!m)throw new _.N(_.O,4,4021,"Unknown MIME type of: "+f.join(", "));return n["return"](m.split(";")[0])})},lL=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a)return c=_.Mj([b],a.a.attemptParameters),c.type=1,_.y(f,a.sf(c),2);d=f.f;e="";try{e=_.S.ba(d.data)}catch(g){throw new _.N(_.O,4,4042);}e=_.S.Qh(e);e=e.trim();return f["return"]({text:e,
57
- response:d})})},FK=function(a){return a.l===_.oc},GK=function(a,b){_.Y.Mh(b,function(c,d){_.wD(a,c.U,d.startTime)});_.oD(a.a,b[0].startTime,b[b.length-1].endTime)},zL=function(){},iL={Ii:_.iC,Ki:_.hC},hL={Ni:AJ,Pn:BJ,NONE:_.Ze};_.t=TJ.prototype;_.t.set=function(a,b){var c=this;this.f.set(a,b);return b.then(function(d){return c.a.set(a,d)})["catch"](function(){}).then(function(){return c.f["delete"](a)})};_.t.has=function(a){return this.a.has(a)};_.t.get=function(a){return this.a.get(a)||null};
58
- _.t.values=function(){return Array.from(this.a.values())};_.t.clear=function(){this.f.clear();this.a.clear()};
59
- var rL={vk:function(a){var b=rL.Jk(a),c=rL.zl(a);a.forEach(function(d){var e=d.U,f=e.findIndex(function(h){return h.ga===b}),g=e.findIndex(function(h){return h.ga===c+1});-1===g&&(g=e.length);d.U=e.slice(f,g)})},Zi:function(a,b,c){b=rL.Tk(a,b,c);a=_.w(a.U||[]);for(c=a.next();!c.done;c=a.next())c=c.value,_.Y.bd(c.X,_.Ma)&&b++,c.ga=b},Tk:function(a,b,c){var d=_.Y.Ra(a.X,_.Na);if(d)return Number(d.value);d=rL.rl(b);if(c&&d)try{return rL.nl(a,b)}catch(e){throw new _.N(_.O,4,4024,"EXT-X-DISCONTINUITY-SEQUENCE tag is required for discontinuous HLS live streams.");
60
- }return 0},rl:function(a){return 0<rL.Wk(a)},ln:function(a){if(0===a.length)return[];var b=[],c=[];a=_.w(a);for(var d=a.next();!d.done;d=a.next())d=d.value,_.Y.bd(d.X,_.Ma)&&0<c.length&&(b.push(c),c=[]),c.push(d);b.push(c);return b},Wk:function(a){if(!a)return 0;a=a.streams[a.streams.length-1].U;return a[a.length-1].ga},nl:function(a,b){var c=_.Y.Ra(a.X,_.Sa);if(!c)throw rL.g.error("Failed to infer discontinuity number, because EXT-X-MEDIA-SEQUENCE tag is missing."),Error(tJ);c=Number(c.value);var d=
61
- b.find(c);if(!d)throw rL.g.error("Failed to infer discontinuity number, could not find the appropriate segment in the previous playlist (segment position \x3d "+(c+")")),Error(tJ);return d.ga},zl:function(a){a=a.map(function(b){return b.U[b.U.length-1].ga});return Math.min.apply(Math,_.fh(a))},Jk:function(a){a=a.map(function(b){return b.U[0].ga});return Math.max.apply(Math,_.fh(a))}};rL.g=new _.K("clpp.hls.DiscontinuityUtils");var AL={"com.apple.streamingkeydelivery":function(a,b){if(b===_.Lg)throw new _.N(_.O,4,4041);if(_.cj(a,vJ)===wJ)throw new _.N(_.O,4,4044,"EXT-X-KEY:METHOD SAMPLE-AES-CTR is not supported in FairPlay.");return _.LC(_.Rd,[{initDataType:_.fg,initData:new Uint8Array(0)}],"")},"com.microsoft.playready":$J,"urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":$J,"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(a){var b=_.cj(a,vJ);if(!YJ.includes(b))return ZJ.error("Widevine in HLS is only supported with [",
62
- YJ.join(", "),"], not",b),null;b=_.cj(a,_.hc);b=_.ru(b);b=_.oj(b.data);b=_.LC(_.Vd,[{initDataType:_.vd,initData:b}],"");if(a=_.bj(a,"KEYID"))b.keyIds=[a.substr(2).toLowerCase()];return b}},YJ=["SAMPLE-AES",wJ],ZJ=new _.K("clpp.hls.DrmParser");var sL={Lm:function(a,b,c){return sL.Yf(a.X,b,c)||{type:_.Ze,keyInfo:null,drmInfos:[],keyId:null}},Gm:function(a,b,c,d,e){if(a.slice(1).some(sL.yh))throw new _.N(_.O,4,4046,e?"Media playlist contains an EXT-X-KEY tag with METHOD\x3dAES-128 which is not at the beginning of the playlist.":"Media playlist contains an EXT-X-KEY tag with METHOD\x3dAES-128 which is not marked by an EXT-X-DISCONTINUITY tag and is not at the beginning of the playlist.");if(_.Y.bd(a[0].X,_.Pa)||null===d){if((d=sL.Yf(a[0].X,
63
- b,c))&&d.type===BJ){if(1<sL.ah(a))throw new _.N(_.O,4,4046,yJ+((e?"playlist":"discontinuity")+"."));return[d]}a=sL.ei(a,b,c);return 0===a.length?[{type:_.Ze,keyInfo:null,drmInfos:[],keyId:null}]:a}b=sL.ei(a,b,c);if(d.type===_.Ze||d.type===AJ)return[d].concat(_.fh(b));if(0<sL.ah(a))throw new _.N(_.O,4,4046,yJ+((e?"playlist":"discontinuity")+"."));return[d]},pa:function(a){if(0===a.length)return{type:_.Ze,keyInfo:null,drmInfos:[],keyId:null};if(a.some(function(c){return c.type===BJ})||a.every(function(c){return c.type===
64
- _.Ze}))return a[0];a=a.filter(function(c){return c.type===AJ});var b=_.qi(a.flatMap(function(c){return c.drmInfos}));return{keyInfo:null,keyId:a[a.length-1].keyId,type:AJ,drmInfos:b}},Ti:function(a){a=sL.kh(a);if(a.some(function(b){return sL.yh(b)})&&1<a.length)throw new _.N(_.O,4,4046,"Two EXT-X-KEY tags, one with METHOD\x3dAES-128 are applied to one playlist.");},yh:function(a){return _.Y.Bb(a.X,_.Pa).some(function(b){return"AES-128"===_.bj(b,vJ)})},ei:function(a,b,c){return sL.kh(a).map(function(d){return sL.Yf(d.X,
65
- b,c)})},ah:function(a){return a.filter(function(b){return _.Y.bd(b.X,_.Pa)}).length},kh:function(a){return a.filter(function(b){return _.Y.bd(b.X,_.Pa)})},Yf:function(a,b,c){a=_.Y.Bb(a,_.Pa);if(0===a.length)return null;var d=_.cj(a[0],vJ);if(1===a.length){if("NONE"===d)return{type:_.Ze,keyInfo:null,drmInfos:[],keyId:null};if("AES-128"===d)return a=a[0],d=_.bj(a,"IV",""),{type:BJ,keyInfo:{method:"AES-128",url:_.Y.vd(b,_.cj(a,_.hc)),iv:d?_.Bj((d||"0x").slice(2)):null},drmInfos:[],keyId:null}}b=a.map(function(e){return _.cj(e,
66
- vJ)});if(!b.every(function(e){return"SAMPLE-AES"===e})&&!b.every(function(e){return e===wJ}))throw sL.g.warn("EXT-X-KEY methods "+b.join(", ")+" are incompatible."),new _.N(_.O,4,4044,"Multiple EXT-X-KEY tags with incompatible METHOD values.");b=a.map(function(e){var f=_.bj(e,"KEYFORMAT","identity"),g=AL[f]||null;(e=g?g(e,c):null)||sL.g.warn("Unsupported HLS KEYFORMAT",f);return e}).filter(Boolean);if(0===b.length)throw new _.N(_.O,4,4026);return{keyInfo:null,keyId:b.map(function(e){return e.keyIds}).reduce(function(e,
67
- f){return e.concat(f)},[]).reverse()[0]||null,type:AJ,drmInfos:b}},io:function(){return{type:_.Ze,keyInfo:null,drmInfos:[],keyId:null}}};sL.g=new _.K("clpp.hls.EncryptionUtils");_.t=dK.prototype;_.t.length=function(){return this.streams.length};_.t.Vk=function(){return this.streams[0].groupId};_.t.td=function(){return this.streams[0].type};_.t.Pk=function(){return this.streams[0].codecs.split(",")};_.t.Kb=function(){return this.streams[0].hc};_.t.dn=function(a){this.streams.forEach(function(b){b.codecs=a.join(",")})};
68
- _.t.find=function(a){var b=this.streams.find(function(c){c=c.U;return c[0].position<=a&&a<=c[c.length-1].position});return null==b?null:b.U.find(function(c){return c.position===a})||null};kK.prototype.length=function(){return this.a.length};_.t=zK.prototype;_.t.configure=function(a){this.a=a;this.N.a=a};_.t.setCurrentVariant=function(a){this.j=a};_.t.start=function(a,b){var c=this,d,e,f,g,h;return _.I(function(l){if(1==l.a){if(c.K)throw Error("start() may be called only once!");c.K=!0;c.C=b;return _.y(l,lL(c,a),2)}if(3!=l.a)return d=l.f,e=d.response,f=d.text,c.w=e.uri,_.y(l,HK(c,f),3);g=l.f;c.o=g;h=c.D;c.h&&0<h&&c.h.da(h);return l["return"](g)})};_.t.requestStop=function(){this.J=!0};
69
- _.t.stop=function(){this.h&&(this.h.stop(),this.h=null);var a=[];this.B&&(a.push(this.B.destroy()),this.B=null);this.f.clear();this.o=this.a=this.C=this.j=null;this.G.clear();return Promise.all(a)};
70
- _.t.update=function(){var a=this,b,c,d,e,f,g,h,l,m,n;return _.I(function(p){if(1==p.a){b=a.o;if(FK(a)||!b)return p["return"]();c=b.presentationTimeline;"LIVE"===a.l&&(a.A=null);d=Array.from(a.f.values());a.a.lowLatencyMode&&null!==a.j&&(e=AK(a),d=d.filter(function(q){return e.includes(q.Kb())}));return _.y(p,YK(a,d),2)}if(3!=p.a)return f=p.f,g=f.map(function(q){return q.playlist}),PK(a,g),_.y(p,KK(a,f),3);h=p.f;mK(b.periods,h).forEach(function(q){a.C.filterNewPeriod(q)});EK(a,h);l=UK(a,g);m=VK(a,
71
- g,l);BK(a,m);pK(b.periods,h);qK(b.adaptedPeriods,h);GK(c,h);if(n=_.Y.ll(g))!0!==a.a.keepTimelineLive&&(a.l=_.oc,_.sD(c,!0),c.f=h[h.length-1].endTime),a.h.stop(),a.h=null;if(a.C.onUpdate)a.C.onUpdate(b);if(n&&a.C.onTurnedStatic)a.C.onTurnedStatic();return a.J?_.y(p,a.stop(),0):p.F(0)})};
72
- _.t.Mb=function(){var a=this,b,c;return _.I(function(d){if(1==d.a){a.g.debug(_.$B);if(!a.C)return d["return"]();_.D(d,2);return _.y(d,a.update(),4)}if(2!=d.a)return a.h&&0<a.D&&a.h.da(a.D),_.th(d,0);b=_.E(d);if(!(b instanceof _.N))throw b;a.C&&(a.C.onError(b),c=b,1===c.severity&&a.h&&a.h.da(.1));_.B(d)})};_.t.sf=function(a){if(!this.B)throw new _.N(_.O,7,7001);a=this.C.networkingEngine.fetch(a);_.Wj(this.B,a);return a.P};_.x(zL,_.Ts);zL.prototype.f=function(){_.St.m3u8=zK;_.Qt[_.Il]=zK;_.Qt[zJ]=zK};zL.prototype.a=function(){_.oE("m3u8");_.pE(_.Il);_.pE(zJ)};zL.prototype.id=function(){return"hls"};_.J("clpp.hls.HlsComponent",zL);};
2
+ var f=function(window){var BJ="Could not parse MP4 segment start time.",CJ="Failed to infer discontinuity number",DJ="Guessing audio-only",EJ="METHOD",FJ="SAMPLE-AES-CTR",GJ="Setting playlist start time to ",HJ="Two EXT-X-KEY tags, one with METHOD\x3dAES-128 are applied to one ",IJ="application/vnd.apple.mpegurl",JJ="sample",KJ="whole-segment",LJ=function(a){if(1>a.a)throw _.Lm();--a.a},MJ=function(a,b,c,d){if(1===b){if(!d||0===d.length)throw new _.N(_.O,4,4043,"Media playlist must have at least one segment!");if(null==
3
+ d[0].a)throw new _.N(_.O,4,4043,"Media playlist must have at least one full segment!");}this.f=a;this.a="";this.type=b;this.X=c;this.T=1===b?d:null},NJ=function(a,b,c){c=void 0===c?[]:c;this.X=b;this.a=a;this.f=c;this.ja=-1},OJ=function(a){a=_.w(a);for(var b=a.next();!b.done;b=a.next())if(b=b.value,b.startsWith("#EXT-")&&(b=_.oj(0,b),_.iv.has(b.name)))return 1;return 0},PJ=function(a,b){var c=new Map,d=new URL(b);a.forEach(function(e){var f=_.Ii(e,"NAME"),g=_.Ii(e,"QUERYPARAM");if(f)g=_.Ji(e,"VALUE"),
4
+ c.set(f,g);else if(g){f=d.searchParams.get(g);if(null==f)throw new _.N(_.O,4,4044,"Query param '"+g+"' missing in playlist URI.");if(!f)throw new _.N(_.O,4,4044,"Query param '"+g+"' has no associated value in playlist URI.");c.set(g,decodeURIComponent(f))}});return c},QJ=function(a,b){return a.replace(/\{\$([a-zA-Z0-9_-]+)\}/g,function(c,d){var e=b.get(d);if(null==e)throw new _.N(_.O,4,4044,"Undefined variable '"+d+"'");return e})},RJ=function(a,b){a.forEach(function(c){c.attributes.forEach(function(d){d.value=
5
+ QJ(d.value,b)})})},SJ=function(a,b,c){RJ(a,c);b.forEach(function(d){d.a&&(d.a=QJ(d.a,c));RJ(d.X,c);RJ(d.f,c)})},TJ=function(){this.f=0;this.a=new Map},WJ=function(a,b,c){b=b.trim().split(/\n+/m).map(function(d){return d.trim()}).filter(function(d){return d.length&&!_.Y.Nh(d)});if(!/^#EXTM3U($|[ \t\n])/m.test(b[0]))throw new _.N(_.O,4,4015);return 0===OJ(b)?UJ(a,b,c):VJ(a,b,c)},VJ=function(a,b,c){for(var d=[],e=1;e<b.length;){var f=XJ(a,b[e]);if(_.jv.has(f.name))break;d.push(f);e++}b=YJ(a,c,b.slice(e));
6
+ e=b.T;d=d.concat(b.X);a=ZJ(a,d,c);SJ(d,e,a);return new MJ(c,1,d,b.T)},UJ=function(a,b,c){for(var d=[],e=1;e<b.length;e++){var f=XJ(a,b[e]);d.push(f);if(f.name===_.Ya){var g=b[e+1];if(!g)throw new _.N(_.O,4,4044,"EXT-X-STREAM-INF is not followed by a URI.");f.attributes.push(new _.Ki(_.dc,g));e++}}b=_.Y.Ob(d,"EXT-X-DEFINE");_.Y.Li(b);b=PJ(b,c);a.a=b;SJ(d,[],a.a);return new MJ(c,0,d)},YJ=function(a,b,c){var d=[],e=[],f=[],g=[];c.forEach(function(h){/^(#EXT)/.test(h)?(h=XJ(a,h),_.iv.has(h.name)||_.lv.has(h.name)?
7
+ d.push(h):_.kv.has(h.name)?"EXT-X-PART"===h.name?g.push(h):h.name===_.Va&&"PART"===_.Ii(h,_.bc)&&g.push(h):f.push(h)):_.Y.Nh(h)||(h=_.Y.Bd(b,h.trim(),!1),e.push(new NJ(h,f,g)),f=[],g=[])});0<g.length&&e.push(new NJ(null,f,g));return{T:e,X:d}},XJ=function(a,b){return _.oj(a.f++,b)},ZJ=function(a,b,c){b=_.Y.Ob(b,"EXT-X-DEFINE");_.Y.Li(b);var d=PJ(b,c);b.map(function(e){return _.Ii(e,"IMPORT")}).filter(Boolean).forEach(function(e){var f=a.a.get(e);if(null==f)throw new _.N(_.O,4,4044,"Cannot import variable '"+
8
+ e+"' as it is not defined in the master playlist");d.set(e,f)});return d},$J=function(a){var b=void 0===b?0:b;return 0>a?[]:Array.from({length:a},function(c,d){return d+b})},aK=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},bK=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]}
9
+ function d(){throw new _.N(_.O,4,4030);}aK(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+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}}aK(a,e)||d();e+=10;e+=f}while(e<a.byteLength);
10
+ return d()},cK=function(a){for(;a.getPosition()<a.Ma()-1;){var b=a.getPosition();if(71===_.Mm(a))return LJ(a),b}return-1},dK=function(a){function b(){d.seek(e+188);f=_.Mm(d);71!==f&&(d.seek(e+192),f=_.Mm(d));71!==f&&(d.seek(e+204),f=_.Mm(d));71!==f&&c();LJ(d)}function c(){throw new _.N(_.O,4,4030);}var d=new _.Jm(new DataView(a),!1),e=0,f=0;e=cK(d);0>e&&(_.Ev.error("Unable to find sync byte in TS after scanning."),c());for(;;)if(e=d.getPosition(),f=_.Mm(d),71!==f&&c(),a=_.Nm(d),8191===(a&8191))b();
11
+ else if(a&16384)if(a=(_.Mm(d)&48)>>4,0!==a&&2!==a||c(),3===a&&(a=_.Mm(d),d.skip(a)),1!==_.W(d)>>8)b();else{d.skip(3);a=_.Mm(d)>>6;0!==a&&1!==a||c();0===_.Mm(d)&&c();a=_.Mm(d);var g=_.Nm(d),h=_.Nm(d);return(1073741824*((a&14)>>1)+((g&65534)<<14|(h&65534)>>1))/9E4}else b()},eK=function(a,b){var c=null,d=0;try{(new _.Sm).M(_.Re,_.Tm).M(_.qg,_.Tm).M(_.Me,_.Tm).Y("mdhd",function(g){g.reader.skip(0===g.version?8:16);d=_.W(g.reader);g.parser.stop()}).parse(b,!0)}catch(g){c=g}if(c||!d)throw _.Ev.error("Unable to find timescale in init segment!"),
12
+ new _.N(_.O,4,4030,BJ,c);var e=0,f=!1;try{(new _.Sm).M("moof",_.Tm).M("traf",_.Tm).Y("tfdt",function(g){var h=d;if(0===g.version)h=_.W(g.reader)/h;else{var l=_.W(g.reader),m=_.W(g.reader);if(!(2097151>=l||h>=Math.pow(2,12)))throw Error("Cannot accurately parse MP4 timestamp, base time is too high and timescale is \x3c\x3d 2^12");h=l/h*Math.pow(2,32)+m/h}e=h;f=!0;g.parser.stop()}).parse(a,!0)}catch(g){c=g}if(c||!f)throw new _.N(_.O,4,4030,BJ,c);return e},fK=function(){this.a=new Map;this.f=new Map},
13
+ gK=function(a){this.streams=a},hK=function(a,b){a.streams.forEach(function(c){c.mf=b})},iK=function(a,b){a.streams.forEach(function(c){c.width=b})},jK=function(a,b){a.streams.forEach(function(c){c.height=b})},kK=function(a,b){a.streams.forEach(function(c){c.frameRate=b})},lK=function(a,b){a.streams.forEach(function(c){c.bandwidth=b})},mK=function(a,b){var c=a.streams.find(function(d){d=d.T;return d[0].position<=b&&b<=d[d.length-1].position});return null==c?null:c.T.find(function(d){return d.position===
14
+ b})||null},nK=function(a,b){var c=a.map(function(d){return d.streams[b]});return c.some(function(d){return null==d})?null:c},oK=function(a){this.a=a},pK=function(a,b){var c=a.map(function(d){return d.a[b]});return c.some(function(d){return null==d})?null:c},qK=function(a){this.g=new _.K("clpp.hls.MediaReader");this.f=a;this.a={attemptParameters:_.qj()}},sK=function(a,b,c,d,e,f){var g,h,l,m,n,p,q,t;return _.I(function(v){switch(v.a){case 1:a.g.debug("Fetching segment to find start time");if("audio/mpeg"===
15
+ d||d===_.dd||d===_.cd)return v["return"](0);g=f;if(d!==_.bd){v.F(2);break}return _.y(v,rK(a,c,g),3);case 3:return h=v.f,l=_.Wi(h.data),aK(l)?v["return"](bK(l)):v["return"](dK(h.data));case 2:if(d!==_.Ig&&d!==_.ed){v.F(4);break}m=[rK(a,c,g)];b&&m.push(rK(a,b,!0));return _.y(v,Promise.all(m),5);case 5:return n=v.f,p=n[0],q=n[1]||n[0],v["return"](eK(p.data,q.data));case 4:if(d!==_.Hg){v.F(6);break}return _.y(v,rK(a,c,g),7);case 7:return t=v.f,v["return"](dK(t.data));case 6:if(!_.Ot((d.split("/")[0]||
16
+ "")+'/mp4;codecs\x3d"'+e+'"'))return v["return"](0);throw new _.N(_.O,4,4030);}})},rK=function(a,b,c){var d,e,f,g,h,l,m;return _.I(function(n){switch(n.a){case 1:return d=b.f(),e=_.lE(b.Va(),b.ya,b.ya+2048-1,a.a.attemptParameters),e.type=2,f=_.lE(b.Va(),b.ya,b.ka,a.a.attemptParameters),f.type=2,d&&(f.keyInfo=d),_.D(n,2),g=c?f:e,_.y(n,a.f(g),4);case 4:return h=n.f,n["return"](h);case 2:l=_.F(n);if(7001===l.code||c)throw l;a.g.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 pre-flights.",
17
+ e.uris[0]);_.D(n,5);return _.y(n,a.f(f),7);case 7:return n["return"](n.f);case 5:throw m=_.F(n),a.g.error("Failed to fetch media segment to parse its start timestamp.",f.uris[0],m),new _.N(_.O,4,4030,"Failed to fetch the media segment.");}})},vK=function(a){var b=_.Ji(a,EJ);if(!tK.includes(b))return uK.error("PlayReady in HLS is only supported with [",tK.join(", "),"], not",b),null;a=_.Ji(a,_.dc);b=_.Mq(a);a=null;b=_.Wi(b.data);try{a=_.CC(_.Vn(b))}catch(c){a=b}return _.PC(_.Od,[{initDataType:_.td,
18
+ initData:a}],"")},wK=function(a,b){var c=new Set(a.map(function(d){return d.ja}));return b.filter(function(d){return!c.has(d.ja)})},yK=function(a,b){for(;a[0].ja<b[0].ja;)a.splice(0,1);var c=a[0],d=b[0];c.startTime===d.startTime&&c.endTime===d.endTime||xK(c,d);var e=a.length-1;c=a[e];d=b[e];0<e&&(c.startTime!==d.startTime||c.endTime!==d.endTime)&&xK(c,d);for(c=e+1;c<b.length;)a.push(b[c]),c++},DK=function(a,b,c,d,e){var f=b[0].length();f=$J(f).map(function(g){var h=pK(b,g)||[],l=nK(c,g)||[];g=nK(d,
19
+ g)||[];var m=_.bh(zK(h)).concat(_.bh(l),_.bh(g)).filter(Boolean);AK(m);var n=m[0];m=n.ja;n=n.duration;return{configurationId:a,variants:h,textStreams:l,thumbStreams:g,startTime:0,id:"P"+m,endTime:n,duration:n,ja:m}});e&&BK(f[0]);CK(f);return f},zK=function(a){a=new Set(a.flatMap(function(b){return[b.video,b.audio]}).filter(Boolean));return Array.from(a)},BK=function(a){var b=zK(a.variants)[0].T[0].Ca;a.startTime+=b;a.endTime+=b},CK=function(a){for(var b=0;b<a.length;b++){var c=a[b],d=a[b-1];c.startTime=
20
+ d?d.endTime:c.startTime;c.endTime=c.startTime+c.duration}},xK=function(a,b){a.startTime=b.startTime;a.endTime=b.endTime;a.duration=b.duration;EK(a.variants,b.variants);FK(_.Y.Ue(a),_.Y.Ue(b))},EK=function(a,b){var c=new Map(a.map(function(d){return[_.Y.kh(d),d]}));b.forEach(function(d){c.get(_.Y.kh(d)).drmInfos=d.drmInfos})},FK=function(a,b){var c=new Map(a.map(function(d){return[d.jc,d]}));b.forEach(function(d){var e=c.get(d.jc);e.T=d.T;e.segmentIndex.replace(d.T);e.dc=d.dc;e.Je=d.Je;e.duration=
21
+ d.duration;e.nh=d.nh;e.encrypted=d.encrypted;e.drmInfos=d.drmInfos;e.keyId=d.keyId})},AK=function(a){var b=GK(a);a.forEach(function(c){_.aE(c.segmentIndex,b);c.duration=b;c.Je=c.dc+b})},GK=function(a){var b=Infinity;_.Y.Mk(a).forEach(function(c){b=Math.min(b,c.duration)});return b},HK=function(){var a=this;this.a=this.D=null;this.P=1;this.f=new fK;this.A="";this.L=new TJ;this.G=0;this.j=null;this.h=new _.Vk(function(){a.Ub()});this.l=_.kc;this.o=null;this.C=new _.Fj;this.B=null;this.g=new _.K("clpp.hls.HlsParser");
22
+ this.I=new Map;this.N=new qK(this.xf.bind(this));this.K=!1;this.H=null;this.J=!1;this.w=new Map},IK=function(a){if(null===a.j)return[];a=a.j;return[a.audio,a.video].filter(function(b){return b}).map(function(b){return b.jc})},JK=function(a,b){var c=new Set(b.map(function(h){return h.id}));a.w.forEach(function(h,l){c.has(l)||a.w["delete"](l)});for(var d=_.w(b),e=d.next();!e.done;e=d.next()){e=e.value;var f=a.w.get(e.id);if(f&&f.startTime!==e.startTime)a.D.onError(new _.N(1,4,4044,"EXT-X-DATERANGE START-DATE has changed for ID\x3d"+
23
+ e.id));var g={configurationId:a.D.configurationId,schemeIdUri:e.schemeIdUri,customAttributes:e.customAttributes,value:"",startTime:e.startTime,endTime:e.endTime,id:e.id,type:_.hv,eventElement:null};f&&!_.M.Uh(f,g)||a.w.set(e.id,g)}return Array.from(a.w.values())},PK=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,v,z,C;return _.I(function(H){if(1==H.a){c=_.Np;d=_.Y;e=KK(a,b,a.A,"");if(1===e.type){f=e.T[0].a;var E=_.Ei(f)||"";g=null!=_.Fi.video[E]?_.r:null!=_.Fi.audio[E]?_.ad:null;h="";g===c.VIDEO?h="avc1.42E01E":
24
+ g===c.AUDIO&&(h="mp4a.40.2");E=a.L;var B=a.A,G=a.a.hlsDefaultCodecs||h,P=[],R=[];R.push(new _.Ki(_.pa,"0"));R.push(new _.Ki(_.dc,B));G.length&&R.push(new _.Ki(_.ta,G));P.push(new _.Hi(E.f++,_.Ya,R));e=new MJ(B,0,P)}l=_.Y.Pm(e.X);return _.y(H,LK(a,l),2)}m=H.f;n=m.periods;p=m.an;q=m.Bn;if(!a.D)throw new _.N(_.O,7,7001);t=d.gl(n[0]);MK(a,n);E=!0;B=null;G=0;NK(a)||(E=!1,B=0,G=t.delay);P=a.a.timeline||{};P.type=void 0;B=new _.dD(P,B,G,!0,void 0,!!a.a.lowLatencyMode);_.gD(B,E);OK(B,n);p&&_.fD(B,p);v=B;
25
+ if(!NK(a)){a.G=t.Cc;G=0;B=_.w(a.f.values());for(E=B.next();!E.done;E=B.next())G=Math.max(G,E.value.streams[0].dc);for(B=0;95443.7176888889<=G;)B+=95443.7176888889,G-=95443.7176888889;if(B)for(a.g.debug("Offsetting live streams by",B,"to compensate for rollover"),G=_.w(a.f.values()),E=G.next();!E.done;E=G.next())E=E.value.streams[0],95443.7176888889>E.dc?(a.g.debug("Offset applied to",E.type),E.segmentIndex.offset(B)):a.g.debug("Offset NOT applied to",E.type)}E=_.Y.hl(n);"LIVE"===a.l||"EVENT"===a.l?
26
+ (E=Math.max(E,v.K),isNaN(a.a.availabilityWindowOverride)||(E=a.a.availabilityWindowOverride),v.A=E):a.l===_.kc&&(v.f=E);z=JK(a,q);C={presentationTimeline:v,periods:n,minBufferTime:0,cues:z};a.g.debug("HLS playlist parsed",C);return H["return"](C)})},SK=function(a,b){var c,d,e,f,g,h,l,m,n;return _.I(function(p){if(1==p.a)return c=_.Y,_.y(p,QK(a,b),2);d=p.f;e=d.textStreams;f=d.thumbStreams;g=d.gj;h=a.o.periods[0].variants;a.a.lowLatencyMode&&null!==a.j&&(h=h.filter(function(q){return q.id===a.j.id}));
27
+ l=h.map(function(q){var t=c.sh(q.audio,g),v=c.sh(q.video,g);q=RK(a,t,v,q.bandwidth);if(!q)throw new _.N(_.O,4,4047,{message:"Video and audio are encrypted in an incompatible way.",zo:v?v.Rb():void 0,audio:t?t.Rb():void 0});return q});m=a.D.configurationId;n=DK(m,l,e,f,!0);return p["return"](n)})},QK=function(a,b){var c,d,e,f,g,h,l,m,n;return _.I(function(p){if(1==p.a)return c=_.Np,d=function(q){return q.stream.yd()===c.VIDEO||q.stream.yd()===c.AUDIO},e=b.filter(d),f=b.filter(function(q){return!d(q)}),
28
+ g=function(q){q=q.map(function(t){var v=t.stream.streams[0];t=Object.assign({},{playlist:t.playlist},{language:v.language,channelsCount:v.channelsCount,spatialAudio:v.spatialAudio,closedCaptions:v.closedCaptions,primary:v.primary,kind:v.kind||null,groupId:v.groupId,type:v.type,codecs:v.codecs,name:v.originalId,uri:v.jc,Xe:{width:v.width,height:v.height,frameRate:v.frameRate}});return TK(a,t)});return Promise.all(q)},_.y(p,g(e),2);if(3!=p.a)return h=p.f,_.y(p,g(f),3);l=p.f;UK(a,h.concat(l));m=l.filter(function(q){return q.yd()===
29
+ c.Zi});n=l.filter(function(q){return q.yd()===c.IMAGE});return p["return"]({textStreams:m,thumbStreams:n,gj:h})})},UK=function(a,b){b.forEach(function(c){a.f.a.set(c.Rb(),c)})},LK=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:return c=_.Y.Im(b.jd.closedCaptions),d=VK(a,b.fe),_.y(z,WK(a,b),2);case 2:return e=z.f,f=Object.values(e).flat().map(function(C){return C.playlist}),XK(a,f),_.y(z,YK(a,e.Jg,d),3);case 3:return g=z.f,_.y(z,ZK(a,e.fe,g,c),4);case 4:return h=
30
+ z.f,_.y(z,$K(a,e.xn,d),5);case 5:return l=z.f,_.y(z,aL(a,e.Lf),6);case 6:return m=z.f,n=a.D.configurationId,p=DK(n,h,l,m,!NK(a)),a.D.filterAllPeriods(p),q=_.bh(e.fe).concat(_.bh(e.Jg)).map(function(C){return C.playlist}),t=bL(a,q),v=cL(a,q,t),z["return"]({periods:p,an:t,Bn:v})}})},MK=function(a,b){NK(a)||2!==a.a.timeline.version||(a.H||(a.H=b[0].startTime),_.kH(b,-a.H))},cL=function(a,b,c){b=b.find(function(d){return null!==_.Y.Ta(d.X,_.La)});if(!b)return[];if(null===c)throw new _.N(_.O,4,4024,"EXT-X-PROGRAM-DATE-TIME tag is required when EXT-X-DATERANGE tags are present");
31
+ return b.X.filter(function(d){return d.name===_.La}).map(function(d){return _.Y.Jm(d,c,a.B,!NK(a))}).filter(Boolean)},bL=function(a,b){var c=b.flatMap(function(e){return e.T[0].X});c=_.Y.Ta(c,_.Wa);if(!c)return null;var d=(new Date(c.value)).getTime();return isNaN(d)?(a.g.warn("Failed to parse EXT-X-PROGRAM-DATE-TIME tag value (value: "+(c.value+").")),null):d/1E3},WK=function(a,b){var c,d,e,f,g,h;return _.I(function(l){if(1==l.a)return _.y(l,Promise.all([dL(a,b.jd.fj),dL(a,b.jd.yn),dL(a,b.fe),dL(a,
32
+ b.Lf)]),2);c=l.f;d=_.w(c);e=d.next().value;f=d.next().value;g=d.next().value;h=d.next().value;return l["return"]({Jg:e,xn:f,fe:g,Lf:h})})},fL=function(a,b){return Promise.all(b.map(function(c){return eL(a,c)}))},VK=function(a,b){for(var c=_.Y.we,d=new Map,e=_.w(b),f=e.next();!f.done;f=e.next()){var g=f.value,h=_.Ii(g,_.ka);f=_.Ii(g,_.jc);var l=_.Ii(g,_.Ub);g=gL(a,g);if(l){var m=_.Di(_.Q,g);d.set(c(_.Q,l),m);l=g.indexOf(m);-1<l&&g.splice(l,1)}h&&(l=hL(_.ad,g),d.set(c(_.ad,h),l));f&&(h=hL(_.r,g),d.set(c(_.r,
33
+ f),h))}return d},$K=function(a,b,c){return Promise.all(b.map(function(d){return iL(a,d,c)}))},aL=function(a,b){return Promise.all(b.map(function(c){return jL(a,c)}))},YK=function(a,b,c){var d,e;return _.I(function(f){if(1==f.a){if(0===b.length)return f["return"](new Map);d=[iL(a,b[0],c)];return _.y(f,d[0],2)}if(3!=f.a)return d=d.concat(b.slice(1).map(function(g){return iL(a,g,c)})),_.y(f,Promise.all(d),3);e=f.f;return f["return"](_.Y.Cn(e))})},ZK=function(a,b,c,d){var e,f,g,h,l,m,n,p,q,t,v;return _.I(function(z){if(1==
34
+ z.a){e=new Set;f=_.bh(b).concat();g=0;h=Infinity;for(l=0;l<f.length;++l)m=Number(_.Ji(f[l].tag,_.pa)),m<h&&(h=m,g=l);n=f.splice(g,1).pop();return _.y(z,kL(a,n,c,d,e),2)}if(3!=z.a)return p=z.f,q=f.map(function(C){return kL(a,C,c,d,e)}),_.y(z,Promise.all(q),3);t=z.f;t.splice(g,0,p);v=t.reduce(_.MC,[]);return z["return"](v)})},kL=function(a,b,c,d,e){var f,g,h,l,m,n;return _.I(function(p){return 1==p.a?(f=_.Y,g=b,h=g.tag,l=Number(_.Ji(h,_.pa)),m=f.Tm(h),_.y(p,lL(a,b,m,c,d),2)):(n=p.f)?p["return"](mL(a,
35
+ n,l,e)):p["return"]([])})},lL=function(a,b,c,d,e){var f,g,h,l,m,n,p,q,t,v,z,C,H,E,B,G,P,R,da;return _.I(function(ea){if(1==ea.a)return f=_.Np,g=_.Y.we,h=b,l=h.tag,m=h.playlist,n=gL(a,l),p=_.Ii(l,_.ka),q=_.Ii(l,_.jc),t=p?d.get(g(f.AUDIO,p))||[]:[],v=q?d.get(g(f.VIDEO,q))||[]:[],z=_.bh(t).concat(_.bh(v)),C={audio:t,video:v},a.g.debug("Guessing stream type for",l.toString()),E=!1,B=m.a,G=C.audio.find(function(Ca){return Ca.Rb()===B}),P=_.Di(f.VIDEO,n),R=c||P,1!==n.length||R?!z.length&&1<n.length?(a.g.debug("Guessing multiplexed audio+video"),
36
+ H=f.VIDEO,n=[n.join(",")]):C.audio.length&&G?(a.g.debug(DJ),H=f.AUDIO,E=!0):C.video.length?(a.g.debug(DJ),H=f.AUDIO):(a.g.debug("Guessing video-only"),H=f.VIDEO):(H=f.AUDIO,a.g.debug(DJ)),da=null,E?ea.F(2):_.y(ea,nL(a,b,n,H,e,c),3);2!=ea.a&&(da=ea.f);if(null==da)return ea["return"](null);C[H]=[da];H===f.AUDIO&&c&&z.forEach(function(Ca){iK(Ca,c.width);jK(Ca,c.height);kK(Ca,c.frameRate)});_.Y.Ik(C);return ea["return"](C)})},mL=function(a,b,c,d){var e=b.video,f=b.audio;e=0<e.length?e:[null];b=[];f=_.w(0<
37
+ f.length?f:[null]);for(var g=f.next();!g.done;g=f.next()){g=g.value;for(var h=_.w(e),l=h.next();!l.done;l=h.next()){var m=l.value;l=_.Y.Ek(g,m);d.has(l)?a.g.debug("Skipping variant which only differs in text streams."):(m=RK(a,g,m,c),null==m?a.g.warn("Incompatible DRM info in HLS variant. Skipping."):(b.push(m),d.add(l)))}}return b},RK=function(a,b,c,d){for(var e=[],f=(c||b).length(),g=0;g<f;g++){var h=b?b.streams[g]||null:null,l=c?c.streams[g]||null:null,m=_.Y.$k(h,l);if(!m)return null;var n=d;h=
38
+ {id:a.P++,language:h?h.language:_.tg,primary:!!h&&h.primary||!!l&&l.primary,audio:h,video:l,bandwidth:n,drmInfos:m,allowedByApplication:!0,allowedByKeySystem:!0};e.push(h)}return new oK(e)},iL=function(a,b,c){var d,e,f,g;return _.I(function(h){d=b;e=d.tag;f=d.playlist;g=f.a;return h["return"](oL(a,g,function(){var l,m,n,p,q,t,v,z,C,H,E,B,G,P,R;return _.I(function(da){if(1==da.a){l=_.Np;m=_.Y.we;n=_.Ji(e,_.gb);p=_.Y.ih(_.Ji(e,_.bc));q=_.Y.Ak(e);t=c.get(m(p,n))||"";v=_.Ii(e,_.sb);z=_.Ii(e,"NAME");C=
39
+ e.getAttribute("DEFAULT");H=e.getAttribute("AUTOSELECT");E=_.Ii(e,"CHANNELS");B=p===l.AUDIO?E?parseInt(E.split("/")[0],10):null:null;var ea=p===l.AUDIO?(ea=_.Ii(e,"CHANNELS"))?ea.includes("/JOC"):!1:!1;G=ea;P=!!C&&!!H;return _.y(da,TK(a,{playlist:f,codecs:t,type:p,Wd:v,primary:P,name:z,channelsCount:B,spatialAudio:G,groupId:n,kind:q,closedCaptions:null,Xe:null}),2)}R=da.f;return da["return"](R)})}))})},jL=function(a,b){var c,d,e,f;return _.I(function(g){c=b;d=c.tag;e=c.playlist;f=e.a;return g["return"](oL(a,
40
+ f,function(){var h,l,m,n,p;return _.I(function(q){if(1==q.a)return h=_.Ii(d,_.ta)||"jpg",l=_.Ii(d,_.sb),m=_.Ii(d,"NAME"),_.y(q,TK(a,{playlist:e,codecs:h,type:_.we,Wd:l,name:m,primary:!1,kind:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,groupId:null,Xe:null}),2);n=q.f;(p=_.Ii(d,_.pa))&&lK(n,Number(p));return q["return"](n)})}))})},gL=function(a,b){var c=_.Ii(b,_.ta,a.a.hlsDefaultCodecs||"avc1.42E01E,mp4a.40.2").split(/\s*,\s*/),d=new Set,e=[];c=_.w(c);for(var f=c.next();!f.done;f=c.next()){f=
41
+ f.value;var g=_.YC(f);d.has(g)?a.g.debug("Ignoring duplicate codec"):(e.push(f),d.add(g))}return e},nL=function(a,b,c,d,e,f){var g,h,l,m,n;return _.I(function(p){g=b;h=g.tag;l=g.playlist;m=_.Np;n=l.a;return p["return"](oL(a,n,function(){var q,t,v,z;return _.I(function(C){if(1==C.a)return q=_.Ii(h,_.sa),t=null,d===m.VIDEO&&q&&"NONE"!==q&&(t=e.get(q)),v=hL(d,c),_.y(C,TK(a,{playlist:l,codecs:v,type:d,closedCaptions:t,primary:!1,kind:null,Wd:null,name:null,channelsCount:null,spatialAudio:!1,groupId:null,
42
+ Xe:f}),2);z=C.f;return C["return"](z)})}))})},oL=function(a,b,c){if(a.f.has(b))return a=a.f.get(b),Promise.resolve(a);if(a.f.f.has(b))return a.f.f.get(b)||null;c=c();a.f.set(b,c);return c},TK=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,v,z,C,H,E,B,G,P,R,da,ea,Ca,bb,cb;return _.I(function(Ta){if(1==Ta.a){c=pL;d=qL;e=_.Np;f=_.Y;g=b;h=g.playlist;l=g.codecs;m=g.type;n=g.Wd;p=g.groupId;q=g.primary;t=g.kind;v=g.name;z=g.channelsCount;C=g.spatialAudio;H=g.closedCaptions;E=g.Xe;B=_.Y.zh(n);if(1!==h.type)throw new _.N(_.O,
43
+ 4,4017);G=_.Y.Rm(h.X,null==a.o);a.l=G;P=_.Y.Om(h.X,G,a.a.lowLatencyMode||!1,a.a.suggestedPresentationDelay);return _.y(Ta,rL(a,h,m,l),2)}R=Ta.f;da=a.a.lowLatencyMode?d.Ti:d.Vi;ea=t;m!==e.TEXT||t||(ea=_.jg);Ca=f.si(h.X);bb=Ca.qe;cb=R.map(function(Da){var fb=Da.T,lc=Da.Kk,Ag=Da.mimeType;Da=Da.ja;var Bg=fb[0].startTime,nn=fb[fb.length-1].endTime,Xt=nn-Bg,fd=new _.XD(fb),on=fb[0].initSegment||null;return{id:_.AJ++,originalId:v,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:fd.Wc.bind(fd),
44
+ getSegmentReference:fd.get.bind(fd),adjustSegmentDurations:fd.sd.bind(fd),getDuration:fd.getDuration.bind(fd),segmentIndex:fd,segmentLookupStrategy:da,initSegmentReference:on,mimeType:Ag,codecs:l,kind:ea,nh:lc.type,encrypted:lc.type===c.Yi,keyId:lc.keyId,language:B,originalLanguage:n||_.tg,label:v,type:m,primary:q,trickModeVideo:null,emsgSchemeIdUris:null,frameRate:E?E.frameRate:void 0,width:E?E.width:void 0,height:E?E.height:void 0,bandwidth:void 0,roles:[],channelsCount:z,spatialAudio:C,closedCaptions:H,
45
+ keyInfo:lc.keyInfo,T:fb,drmInfos:lc.drmInfos,ja:Da,jc:h.a,mf:h.f,dc:Bg,Je:nn,duration:Xt,qe:bb,groupId:p,Jl:P}});return Ta["return"](new gK(cb))})},dL=function(a,b){var c;return _.I(function(d){if(1==d.a)return _.y(d,Promise.all(b.map(function(e){var f;return _.I(function(g){if(1==g.a)return _.y(g,sL(a,e),2);f=g.f;return g["return"](f?{tag:e,playlist:f}:null)})})),2);c=d.f;return d["return"](c.filter(Boolean))})},sL=function(a,b){var c,d,e,f,g,h,l;return _.I(function(m){if(1==m.a){c=_.Y.Fl(b);d=_.Ii(b,
46
+ _.dc,void 0,{required:c});if(!d)return m["return"](null);e=_.Y.Bd(a.A,d);return _.y(m,tL(a,e),2)}f=m.f;g=f.response;h=f.text;l=g.uri;return m["return"](KK(a,h,l,d))})},eL=function(a,b){var c,d,e,f,g,h,l,m;return _.I(function(n){if(1==n.a){var p=new _.pi(b.streams[0].mf);if(a.a.lowLatencyMode&&b.streams[0].qe){var q=b.streams[b.streams.length-1].segmentIndex;if(q=q.a[q.a.length-1]){var t=q.a,v=t.length-1;q={Ml:q.position,Um:t&&0<t.length?v:null}}else q=null;if(t=q)q=t.Ml,t=t.Um,v=_.ek(p.a.toString()),
47
+ v._HLS_msn=q.toString(),null===t&&v._HLS_part&&delete v._HLS_part,null!==t&&(v._HLS_part=t.toString()),q=_.dk(v,!0),_.si(p,new _.wi(q))}c=p.toString();return _.y(n,tL(a,c),2)}d=n.f;e=d.response;f=d.text;g=b.Rb();h=b.streams[0].mf;l=e.uri;h!==l&&(h=l,hK(b,h));m=KK(a,f,h,g);return n["return"]({stream:b,playlist:m})})},KK=function(a,b,c,d){a=WJ(a.L,b,c);a.a=d;return a},uL=function(a){if(1<(new Set(a.map(function(b){return b.mimeType}))).size)throw new _.N(_.O,4,4045,"Media playlist contains discontinuities with different MIME types. This is valid, but not yet supported.");
48
+ },vL=function(a){a=a.map(function(b){return b.a?b.a:b.f.map(function(c){return _.Ii(c,_.dc)})||null}).map(function(b){return _.Ei(b)});if(1<(new Set(a)).size)throw new _.N(_.O,4,4044,"Unexpected change in file format.");},wL=function(a,b,c){a=_.Y.Ob(a.X,_.Qa);if(1<a.length)throw new _.N(_.O,4,4020);a=a[0];if(!a)return null;var d=_.Ji(a,_.dc),e=_.Y.Bd(b,d);b=_.Y.pi(a,null,!0);return new _.QC(function(){return[e]},b.ya,b.ka,c)},yL=function(a,b,c,d,e,f,g){var h=[],l={};b=_.w(xL(b.f));for(var m=b.next();!m.done;l=
49
+ {Ze:l.Ze},m=b.next()){var n=m.value;m=n.Ih;n=n.item;var p=0===m,q=p?a:h[h.length-1],t=p?d:q.endTime,v=Number(_.Ii(n,_.Ha));v=t+v;p=_.Y.pi(n,p?null:q.ka,p);q=_.Ii(n,_.dc);q=_.Y.Bd(g,q);l.Ze=q?[q]:[];t=new _.Mi(c,t,v,function(z){return function(){return z.Ze}}(l),p.ya,p.ka,e,f,!1,null,null,null,null);if("YES"===_.Ii(n,"INDEPENDENT")||0===m)t.h=!0;h.push(t)}return h},zL=function(a,b,c,d,e,f,g,h,l,m,n){var p=c.X,q=c.a;0<_.Y.Ob(p,_.Qa).length&&(n=wL(c,l,g));var t=null!=q,v=q?[q]:[];if(!t&&!a.a.lowLatencyMode)return null;
50
+ a=0;q={ya:0,ka:null};var z=null;t?(c=_.Y.Mm(p).duration,a=e+c,q=_.Y.ri(p,b?b.ka:null)):(b=yL(b,c,d,e,f,g,l),a=b[b.length-1].endTime,z=b);h=h===_.we?_.Y.Sm(p):null;d=new _.Mi(d,e,a,function(){return v},q.ya,q.ka,f,g,!1,null,h?h.Pd:null,h?h.ee:null,h?h.durationPerTile:null,z,n);d.ja=m;return d},rL=function(a,b,c,d){var e,f,g,h,l,m,n,p,q,t,v,z,C,H;return _.I(function(E){switch(E.a){case 1:return e=_.Y,f=AL,g=BL,h=b.a,l=b.T,m=e.dl(b.X,_.Ra),n=[],!NK(a)&&g.ej(l),_.y(E,CL(a,b.f,h,l,m,c,d),2);case 2:p=E.f,
51
+ q=m,t=f.vn(l),v=0;case 3:if(!(v<t.length)){E.F(5);break}z=t[v];C=n[n.length-1]||null;return _.y(E,DL(a,b.f,z,q,p,c,d,C,t.length),6);case 6:H=E.f;n.push(H);q+=z.length;v++;E.F(3);break;case 5:return uL(n),E["return"](n)}})},CL=function(a,b,c,d,e,f,g){var h,l,m,n,p,q,t,v,z,C,H,E;return _.I(function(B){if(1==B.a){h=d[0];if(null!=a.B)return B["return"](a.B);if(!NK(a)&&a.o)try{var G=a.f.get(c),P=G?mK(G,e)||null:null;if(!P)throw new _.N(_.O,4,4030,"Segment not found in pervious playlist update.");l=P.startTime+
52
+ P.Ca;a.g.debug(GJ+l+".");a.B=l;return B["return"](l)}catch(R){if(m=a.f.get(c))n=m.streams[0].T[0].position,B=m.streams[m.streams.length-1].T,p=B[B.length-1].position,q=e,t=e+d.length-1,a.g.warn("Last #EXT-X-MEDIA-SEQUENCE values "+n+" - "+p+(", new values "+q+" - "+t+"."),b,m);throw new _.N(_.O,4,4047,{message:"The updated playlist does not share any segments with the previous one.",uri:c});}return _.y(B,EL(a,f,g,h),2)}if(3!=B.a)return v=B.f,z=BL.Qm(h,a.A,v),C=wL(h,b,z.keyInfo),H=_.Y.If(z.keyInfo,
53
+ e),_.y(B,FL(a,C,h,H,v,g),3);E=B.f;a.g.debug(GJ+E+".");a.B=E;return B["return"](E)})},DL=function(a,b,c,d,e,f,g,h,l){var m,n,p,q,t,v,z,C,H,E,B,G,P,R,da,ea,Ca,bb,cb,Ta,Da;return _.I(function(fb){switch(fb.a){case 1:return m=_.Y,n=BL,p=c[0],q=null==h,vL(c),_.y(fb,EL(a,f,g,p),2);case 2:t=fb.f;v=n.Lm(c,a.A,t,h?h.Il:null,1===l);z=v[v.length-1];C=BL.sa(v);H=wL(p,b,C.keyInfo)||(h?h.wl:null);E=_.Y.If(C.keyInfo,d);B=p.ja;if(q){G=e;fb.F(3);break}return _.y(fb,GL(a,B,H,p,d,E,t,g),4);case 4:G=fb.f;case 3:P=G;
54
+ R=[];for(da=0;da<c.length;da++)if(ea=c[da],Ca=R[R.length-1]||null,bb=0===da?0:Ca.endTime,cb=d+da,Ta=m.If(C.keyInfo,cb),Da=zL(a,Ca,ea,cb,bb,P,Ta,f,b,B,H))H=Da.initSegment,R.push(Da);return fb["return"]({T:R,Kk:C,Il:z,mimeType:t,endTime:R[R.length-1].endTime,ja:B,wl:H})}})},XK=function(a,b){b.forEach(function(c){var d=a.f.get(c.a);AL.kj(c,d,!NK(a))});AL.Fk(b)},GL=function(a,b,c,d,e,f,g,h){var l;return _.I(function(m){if(1==m.a)return a.I.has(b)?m["return"](a.I.get(b)):_.y(m,FL(a,c,d,f,g,h),2);l=m.f;
55
+ a.g.debug("Segment #"+e+" has raw media timestamp "+(l+" s."));a.I.set(b,l);return m["return"](l)})},FL=function(a,b,c,d,e,f){var g;return _.I(function(h){if(null==c.a)return h["return"](0);g=_.Y.Dk(c,d);return h["return"](sK(a.N,b,g,e,f,null!=d))})},hL=function(a,b){if(1===b.length)return b[0];var c=_.Di(a,b);if(null!=c)return c;throw new _.N(_.O,4,4025,{codecList:b});},EL=function(a,b,c,d){var e,f,g;return _.I(function(h){e=d.a;g=(f=_.Y.Ta(d.X,_.Qa))?_.Ji(f,_.dc):null;return h["return"](HL(a,b,
56
+ c,e,g))})},HL=function(a,b,c,d,e){var f,g,h,l,m;return _.I(function(n){if(1==n.a){f=[d,e].filter(Boolean);if(g=_.Gi(f,b,c))return n["return"](g);h=_.uj([d],a.a.attemptParameters);h.method="HEAD";h.type=2;return _.y(n,a.xf(h),2)}l=n.f;m=l.headers["content-type"];if(!m)throw new _.N(_.O,4,4021,"Unknown MIME type of: "+f.join(", "));return n["return"](m.split(";")[0])})},tL=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a)return c=_.uj([b],a.a.attemptParameters),c.type=1,_.y(f,a.xf(c),2);d=f.f;
57
+ e="";try{e=_.S.aa(d.data)}catch(g){throw new _.N(_.O,4,4042);}e=_.S.$h(e);e=e.trim();return f["return"]({text:e,response:d})})},NK=function(a){return a.l===_.kc},OK=function(a,b){_.Y.Wh(b,function(c,d){_.kD(a,c.T,d.startTime)});_.cD(a.a,b[0].startTime,b[b.length-1].endTime)},IL=function(){},qL={Ti:_.lC,Vi:_.kC},pL={Yi:JJ,Xn:KJ,NONE:_.Ue},xL=function JL(a){var c,d,e,f,g,h;return _.xh(JL,function(l){1==l.a&&(c=-1,e=d=void 0,f=_.w(a),g=f.next());if(5!=l.a){if(g.done)return-1===c?l.F(0):_.y(l,{Ih:c,Zm:d,
58
+ item:e,next:void 0},0);h=g.value;return 0<=c?_.y(l,{Ih:c,item:e,Zm:d,next:h},5):l.F(5)}c++;d=e;e=h;g=f.next();return l.F(2)})};_.u=fK.prototype;_.u.set=function(a,b){var c=this;this.f.set(a,b);return b.then(function(d){return c.a.set(a,d)})["catch"](function(){}).then(function(){return c.f["delete"](a)})};_.u.has=function(a){return this.a.has(a)};_.u.get=function(a){return this.a.get(a)||null};_.u.values=function(){return Array.from(this.a.values())};_.u.clear=function(){this.f.clear();this.a.clear()};
59
+ _.u=gK.prototype;_.u.length=function(){return this.streams.length};_.u.el=function(){return this.streams[0].groupId};_.u.yd=function(){return this.streams[0].type};_.u.Zk=function(){return this.streams[0].codecs.split(",")};_.u.Rb=function(){return this.streams[0].jc};_.u.nn=function(a){this.streams.forEach(function(b){b.codecs=a.join(",")})};oK.prototype.length=function(){return this.a.length};var AL={Fk:function(a){var b=AL.Tk(a),c=AL.Hl(a);a.forEach(function(d){var e=d.T,f=e.findIndex(function(h){return h.ja===b}),g=e.findIndex(function(h){return h.ja===c+1});-1===g&&(g=e.length);d.T=e.slice(f,g)})},kj:function(a,b,c){b=AL.cl(a,b,c);a=_.w(a.T||[]);for(c=a.next();!c.done;c=a.next())c=c.value,_.Y.ed(c.X,_.Ma)&&b++,c.ja=b},cl:function(a,b,c){var d=_.Y.Ta(a.X,_.Na);if(d)return Number(d.value);d=AL.zl(b);if(c&&d)try{return AL.vl(a,b)}catch(e){throw new _.N(_.O,4,4024,"EXT-X-DISCONTINUITY-SEQUENCE tag is required for discontinuous HLS live streams.");
60
+ }return 0},zl:function(a){return 0<AL.fl(a)},vn:function(a){if(0===a.length)return[];var b=[],c=[];a=_.w(a);for(var d=a.next();!d.done;d=a.next())d=d.value,_.Y.ed(d.X,_.Ma)&&0<c.length&&(b.push(c),c=[]),c.push(d);b.push(c);return b},fl:function(a){if(!a)return 0;a=a.streams[a.streams.length-1].T;return a[a.length-1].ja},vl:function(a,b){var c=_.Y.Ta(a.X,_.Ra);if(!c)throw AL.g.error("Failed to infer discontinuity number, because EXT-X-MEDIA-SEQUENCE tag is missing."),Error(CJ);c=Number(c.value);var d=
61
+ mK(b,c);if(!d)throw AL.g.error("Failed to infer discontinuity number, could not find the appropriate segment in the previous playlist (segment position \x3d "+(c+")")),Error(CJ);return d.ja},Hl:function(a){a=a.map(function(b){return b.T[b.T.length-1].ja});return Math.min.apply(Math,_.bh(a))},Tk:function(a){a=a.map(function(b){return b.T[0].ja});return Math.max.apply(Math,_.bh(a))}};AL.g=new _.K("clpp.hls.DiscontinuityUtils");var KL={"com.apple.streamingkeydelivery":function(a,b){if(b===_.Hg)throw new _.N(_.O,4,4041);if(_.Ji(a,EJ)===FJ)throw new _.N(_.O,4,4044,"EXT-X-KEY:METHOD SAMPLE-AES-CTR is not supported in FairPlay.");return _.PC(_.Md,[{initDataType:_.$f,initData:new Uint8Array(0)}],"")},"com.microsoft.playready":vK,"urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":vK,"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(a){var b=_.Ji(a,EJ);if(!tK.includes(b))return uK.error("Widevine in HLS is only supported with [",
62
+ tK.join(", "),"], not",b),null;b=_.Ji(a,_.dc);b=_.Mq(b);b=_.Wi(b.data);b=_.PC(_.Qd,[{initDataType:_.td,initData:b}],"");if(a=_.Ii(a,"KEYID"))b.keyIds=[a.substr(2).toLowerCase()];return b}},tK=["SAMPLE-AES",FJ],uK=new _.K("clpp.hls.DrmParser");var BL={Qm:function(a,b,c){return BL.dg(a.X,b,c)||{type:_.Ue,keyInfo:null,drmInfos:[],keyId:null}},Lm:function(a,b,c,d,e){if(a.slice(1).some(BL.Gh))throw new _.N(_.O,4,4046,e?"Media playlist contains an EXT-X-KEY tag with METHOD\x3dAES-128 which is not at the beginning of the playlist.":"Media playlist contains an EXT-X-KEY tag with METHOD\x3dAES-128 which is not marked by an EXT-X-DISCONTINUITY tag and is not at the beginning of the playlist.");if(_.Y.ed(a[0].X,_.Pa)||null===d){if((d=BL.dg(a[0].X,
63
+ b,c))&&d.type===KJ){if(1<BL.jh(a))throw new _.N(_.O,4,4046,HJ+((e?"playlist":"discontinuity")+"."));return[d]}a=BL.ni(a,b,c);return 0===a.length?[{type:_.Ue,keyInfo:null,drmInfos:[],keyId:null}]:a}b=BL.ni(a,b,c);if(d.type===_.Ue||d.type===JJ)return[d].concat(_.bh(b));if(0<BL.jh(a))throw new _.N(_.O,4,4046,HJ+((e?"playlist":"discontinuity")+"."));return[d]},sa:function(a){if(0===a.length)return{type:_.Ue,keyInfo:null,drmInfos:[],keyId:null};if(a.some(function(c){return c.type===KJ})||a.every(function(c){return c.type===
64
+ _.Ue}))return a[0];a=a.filter(function(c){return c.type===JJ});var b=_.hi(a.flatMap(function(c){return c.drmInfos}));return{keyInfo:null,keyId:a[a.length-1].keyId,type:JJ,drmInfos:b}},ej:function(a){a=BL.rh(a);if(a.some(function(b){return BL.Gh(b)})&&1<a.length)throw new _.N(_.O,4,4046,"Two EXT-X-KEY tags, one with METHOD\x3dAES-128 are applied to one playlist.");},Gh:function(a){return _.Y.Ob(a.X,_.Pa).some(function(b){return"AES-128"===_.Ii(b,EJ)})},ni:function(a,b,c){return BL.rh(a).map(function(d){return BL.dg(d.X,
65
+ b,c)})},jh:function(a){return a.filter(function(b){return _.Y.ed(b.X,_.Pa)}).length},rh:function(a){return a.filter(function(b){return _.Y.ed(b.X,_.Pa)})},dg:function(a,b,c){a=_.Y.Ob(a,_.Pa);if(0===a.length)return null;var d=_.Ji(a[0],EJ);if(1===a.length){if("NONE"===d)return{type:_.Ue,keyInfo:null,drmInfos:[],keyId:null};if("AES-128"===d)return a=a[0],d=_.Ii(a,"IV",""),{type:KJ,keyInfo:{method:"AES-128",url:_.Y.Bd(b,_.Ji(a,_.dc)),iv:d?_.ij((d||"0x").slice(2)):null},drmInfos:[],keyId:null}}b=a.map(function(e){return _.Ji(e,
66
+ EJ)});if(!b.every(function(e){return"SAMPLE-AES"===e})&&!b.every(function(e){return e===FJ}))throw BL.g.warn("EXT-X-KEY methods "+b.join(", ")+" are incompatible."),new _.N(_.O,4,4044,"Multiple EXT-X-KEY tags with incompatible METHOD values.");b=a.map(function(e){var f=_.Ii(e,"KEYFORMAT","identity"),g=KL[f]||null;(e=g?g(e,c):null)||BL.g.warn("Unsupported HLS KEYFORMAT",f);return e}).filter(Boolean);if(0===b.length)throw new _.N(_.O,4,4026);return{keyInfo:null,keyId:b.map(function(e){return e.keyIds}).reduce(function(e,
67
+ f){return e.concat(f)},[]).reverse()[0]||null,type:JJ,drmInfos:b}},ro:function(){return{type:_.Ue,keyInfo:null,drmInfos:[],keyId:null}}};BL.g=new _.K("clpp.hls.EncryptionUtils");_.u=HK.prototype;_.u.configure=function(a){this.a=a;this.N.a=a};_.u.setCurrentVariant=function(a){this.j=a};_.u.start=function(a,b){var c=this,d,e,f,g,h;return _.I(function(l){if(1==l.a){if(c.K)throw Error("start() may be called only once!");c.K=!0;c.D=b;return _.y(l,tL(c,a),2)}if(3!=l.a)return d=l.f,e=d.response,f=d.text,c.A=e.uri,_.y(l,PK(c,f),3);g=l.f;c.o=g;h=c.G;c.h&&0<h&&c.h.ea(h);return l["return"](g)})};_.u.requestStop=function(){this.J=!0};
68
+ _.u.stop=function(){this.h&&(this.h.stop(),this.h=null);var a=[];this.C&&(a.push(this.C.destroy()),this.C=null);this.f.clear();this.o=this.a=this.D=this.j=null;this.w.clear();return Promise.all(a)};
69
+ _.u.update=function(){var a=this,b,c,d,e,f,g,h,l,m,n;return _.I(function(p){switch(p.a){case 1:b=a.o;if(NK(a)||!b)return p["return"]();c=b.presentationTimeline;"LIVE"===a.l&&(a.B=null);d=Array.from(a.f.values());a.a.lowLatencyMode&&null!==a.j&&(e=IK(a),d=d.filter(function(q){return e.includes(q.Rb())}));return _.y(p,fL(a,d),2);case 2:return f=p.f,g=f.map(function(q){return q.playlist}),XK(a,g),_.y(p,SK(a,f),3);case 3:h=p.f;wK(b.periods,h).forEach(function(q){a.D.filterNewPeriod(q)});MK(a,h);l=bL(a,
70
+ g);m=cL(a,g,l);b.cues=JK(a,m);yK(b.periods,h);OK(c,h);if(n=_.Y.tl(g))!0!==a.a.keepTimelineLive&&(a.l=_.kc,_.gD(c,!0),c.f=h[h.length-1].endTime),a.h.stop(),a.h=null;if(a.D.onUpdate)a.D.onUpdate(b);if(n&&a.D.onTurnedStatic)a.D.onTurnedStatic();if(!a.J){p.F(4);break}return _.y(p,a.stop(),4);case 4:return p["return"](b)}})};
71
+ _.u.Ub=function(){var a=this,b,c;return _.I(function(d){if(1==d.a){a.g.debug(_.cC);if(!a.D)return d["return"]();_.D(d,2);return _.y(d,a.update(),4)}if(2!=d.a)return a.h&&0<a.G&&a.h.ea(a.G),_.ph(d,0);b=_.F(d);if(!(b instanceof _.N))throw b;a.D&&(a.D.onError(b),c=b,1===c.severity&&a.h&&a.h.ea(.1));_.A(d)})};_.u.xf=function(a){if(!this.C)throw new _.N(_.O,7,7001);a=this.D.networkingEngine.fetch(a);_.Gj(this.C,a);return a.U};_.x(IL,_.Lt);IL.prototype.f=function(){_.Tq.m3u8=HK;_.Rq[_.El]=HK;_.Rq[IJ]=HK};IL.prototype.a=function(){_.bE("m3u8");_.cE(_.El);_.cE(IJ)};IL.prototype.id=function(){return"hls"};_.J("clpp.hls.HlsComponent",IL);};
73
72
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
74
73
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
75
74
  else{_=this.clpp._;(f.call(g,this));}
@@ -1,10 +1,10 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var YS=function(a){this.startTime=a.startTime;this.endTime=a.endTime;this.a=this.f=null;a=a.value;if(!_.M.S(a)){a:{var b=a.info;if(_.M.ca(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=_.M.ca(a)?a:null}},$S=function(a,b,c){this.m=a;this.l=b;this.j=c;this.a=new _.Xh;this.h=(a=_.uu(_.$c))?new a(this.m.getConfiguration()):null;this.g=new _.K("clpp.hlssmpte.ImageCueHandler");this.f=null;ZS(this)},ZS=function(a){a.a.one(a.m,_.Le,function(){return aT(a)})},
3
- aT=function(a){var b=a.m.getSurface().getMedia();if(b)if(a.h){a.a.on(b.textTracks,_.Pc,function(d){return bT(a,d)});var c=Array.from(b.textTracks);c.filter(function(d){return d.kind===_.Te}).forEach(function(d){bT(a,{track:d})});!cT(c)&&a.l&&(a.g.warn("The metadata track is not present. Changing an audio track in order to enforce the creation of the metadata track."),dT(a,b))}else a.g.warn("The clpp.ttml.TextParser class is not available. Please register the ttml component first.");else a.g.warn("A video element is not available. Skipping.")},
4
- cT=function(a){return a.some(function(b){return b.kind===_.Te})},dT=function(a,b){var c=a.m.getTrackManager(),d=c.ma(),e=c.getAudioTracks().find(function(g){return g!==d});if(e){var f=function(){return c.Ba(d)};a.a.on(b.textTracks,_.Pc,function(g){g.track.kind===_.Te&&(a.a.off(b.textTracks,_.Pc,f),f())});c.Ba(e)}else a.g.warn("Can't enforce the creation of the metadata track if single audio track. Skipping.")},bT=function(a,b){var c=b.track;c.kind===_.Te&&(a.g.info("The metadata track has been added."),
5
- c.mode=_.ye,a.a.on(c,_.Yd,function(d){return eT(a,d)}))},eT=function(a,b){var c=fT(a);c&&Array.from(b.target.activeCues||[]).forEach(function(d){if(d!==a.f&&Number.isFinite(d.startTime)&&Number.isFinite(d.endTime)&&"org.id3"===d.type&&d.value&&"TXXX"===d.value.key){var e=new YS(d);if(e.f===c&&null!==e.a){a.f=d;d=a.h.parseMedia(_.S.Wa(e.a),{periodStart:a.j,segmentStart:e.startTime,segmentEnd:e.endTime});var f=a.m.getTextDisplayer();f.remove(0,e.startTime);f.append(d.cues,d.styles)}}})},fT=function(a){return(a=
6
- a.m.getTrackManager().wa())&&a.language&&a.language.toLowerCase()},gT=function(){this.a=null;this.f=!1},hT=function(){};$S.prototype.destroy=function(){this.a.release();this.f=null;return Promise.resolve()};_.x(gT,_.Gu);gT.prototype.onPlayerCreated=function(){};gT.prototype.onContentWillLoad=function(a){if(this.f=_.gl()){var b=a.getConfiguration();b=_.M.Oa(b.hlssmpte||{});_.M.Eh(b.patchMetadataTrack)||(b.patchMetadataTrack=!1);_.M.sa(b.timestampOffset)||(b.timestampOffset=0);this.a=new $S(a,b.patchMetadataTrack,b.timestampOffset)}};gT.prototype.onPlayerWillDestroy=function(){var a=this;return _.I(function(b){if(1==b.a)return a.a?_.y(b,a.a.destroy(),3):b.F(0);a.a=null;_.B(b)})};gT.prototype.id=function(){return"hlssmpte"};
7
- _.J("clpp.hlssmpte.HlsSmptePlugin",gT);gT.Id="hlssmpte";hT.prototype.create=function(){return new gT};_.br(new hT);};
2
+ var f=function(window){var hT=function(a){this.startTime=a.startTime;this.endTime=a.endTime;this.a=this.f=null;a=a.value;if(!_.M.R(a)){a:{var b=a.info;if(_.M.da(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=_.M.da(a)?a:null}},jT=function(a,b,c){this.m=a;this.l=b;this.j=c;this.a=new _.Oh;this.h=(a=_.fu(_.Yc))?new a(this.m.getConfiguration()):null;this.g=new _.K("clpp.hlssmpte.ImageCueHandler");this.f=null;iT(this)},iT=function(a){a.a.one(a.m,_.He,function(){return kT(a)})},
3
+ kT=function(a){var b=a.m.getSurface().getMedia();if(b)if(a.h){a.a.on(b.textTracks,_.Nc,function(d){return lT(a,d)});var c=Array.from(b.textTracks);c.filter(function(d){return d.kind===_.Oe}).forEach(function(d){lT(a,{track:d})});!mT(c)&&a.l&&(a.g.warn("The metadata track is not present. Changing an audio track in order to enforce the creation of the metadata track."),nT(a,b))}else a.g.warn("The clpp.ttml.TextParser class is not available. Please register the ttml component first.");else a.g.warn("A video element is not available. Skipping.")},
4
+ mT=function(a){return a.some(function(b){return b.kind===_.Oe})},nT=function(a,b){var c=a.m.getTrackManager(),d=c.ma(),e=c.getAudioTracks().find(function(g){return g!==d});if(e){var f=function(){return c.Da(d)};a.a.on(b.textTracks,_.Nc,function(g){g.track.kind===_.Oe&&(a.a.off(b.textTracks,_.Nc,f),f())});c.Da(e)}else a.g.warn("Can't enforce the creation of the metadata track if single audio track. Skipping.")},lT=function(a,b){var c=b.track;c.kind===_.Oe&&(a.g.info("The metadata track has been added."),
5
+ c.mode=_.ue,a.a.on(c,_.Td,function(d){return oT(a,d)}))},oT=function(a,b){var c=pT(a);c&&Array.from(b.target.activeCues||[]).forEach(function(d){if(d!==a.f&&Number.isFinite(d.startTime)&&Number.isFinite(d.endTime)&&"org.id3"===d.type&&d.value&&"TXXX"===d.value.key){var e=new hT(d);if(e.f===c&&null!==e.a){a.f=d;d=a.h.parseMedia(_.S.Ya(e.a),{periodStart:a.j,segmentStart:e.startTime,segmentEnd:e.endTime});var f=a.m.getTextDisplayer();f.remove(0,e.startTime);f.append(d.cues,d.styles)}}})},pT=function(a){return(a=
6
+ a.m.getTrackManager().xa())&&a.language&&a.language.toLowerCase()},qT=function(){this.a=null;this.f=!1},rT=function(){};jT.prototype.destroy=function(){this.a.release();this.f=null;return Promise.resolve()};_.x(qT,_.Hu);qT.prototype.onPlayerCreated=function(){};qT.prototype.onContentWillLoad=function(a){if(this.f=_.bl()){var b=a.getConfiguration();b=_.M.$a(b.hlssmpte||{});_.M.Mh(b.patchMetadataTrack)||(b.patchMetadataTrack=!1);_.M.ra(b.timestampOffset)||(b.timestampOffset=0);this.a=new jT(a,b.patchMetadataTrack,b.timestampOffset)}};qT.prototype.onPlayerWillDestroy=function(){var a=this;return _.I(function(b){if(1==b.a)return a.a?_.y(b,a.a.destroy(),3):b.F(0);a.a=null;_.A(b)})};qT.prototype.id=function(){return"hlssmpte"};
7
+ _.J("clpp.hlssmpte.HlsSmptePlugin",qT);qT.Id="hlssmpte";rT.prototype.create=function(){return new qT};_.lt(new rT);};
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));}