@castlabs/prestoplay 6.6.1 → 6.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/CHANGELOG.md +13 -1
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +6 -6
  5. package/cjs/cl.cast.js +110 -110
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +423 -423
  8. package/cjs/cl.crypto.js +10 -10
  9. package/cjs/cl.dash.js +71 -71
  10. package/cjs/cl.externs.js +47 -41
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +68 -49
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +31 -31
  15. package/cjs/cl.ima.js +24 -23
  16. package/cjs/cl.mse.js +263 -260
  17. package/cjs/cl.muxdata.js +11 -12
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +14 -14
  20. package/cjs/cl.playlist.js +6 -6
  21. package/cjs/cl.smooth.js +71 -71
  22. package/cjs/cl.thumbnails.js +23 -23
  23. package/cjs/cl.tizen.js +71 -71
  24. package/cjs/cl.ttml.js +27 -27
  25. package/cjs/cl.verimatrix.js +5 -5
  26. package/cjs/cl.vimond.js +13 -13
  27. package/cjs/cl.vr.js +19 -19
  28. package/cjs/cl.vtt.js +14 -14
  29. package/cjs/cl.youbora.js +19 -19
  30. package/cl.adobe.js +3 -3
  31. package/cl.airplay.js +3 -3
  32. package/cl.broadpeak.js +5 -5
  33. package/cl.cast.js +88 -88
  34. package/cl.conviva.js +27 -27
  35. package/cl.core.js +346 -344
  36. package/cl.crypto.js +8 -8
  37. package/cl.dash.js +67 -67
  38. package/cl.externs.js +47 -41
  39. package/cl.freewheel.js +19 -19
  40. package/cl.hls.js +57 -40
  41. package/cl.hlssmpte.js +5 -5
  42. package/cl.htmlcue.js +25 -25
  43. package/cl.ima.js +17 -16
  44. package/cl.mse.js +228 -228
  45. package/cl.muxdata.js +9 -8
  46. package/cl.onboard.js +4 -4
  47. package/cl.persistent.js +10 -10
  48. package/cl.playlist.js +5 -5
  49. package/cl.smooth.js +58 -59
  50. package/cl.thumbnails.js +17 -17
  51. package/cl.tizen.js +57 -57
  52. package/cl.ttml.js +22 -22
  53. package/cl.verimatrix.js +4 -4
  54. package/cl.vimond.js +8 -8
  55. package/cl.vr.js +15 -15
  56. package/cl.vtt.js +12 -12
  57. package/cl.youbora.js +14 -14
  58. package/package.json +1 -1
  59. package/typings.d.ts +108 -7
@@ -1,28 +1,28 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var qK="clpp-freewheel",rK="clpp.freewheel.AdsManagerFactory",sK="freewheel",tK=function(){this.f=this.a=null},uK=function(){},vK=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""}},wK=function(a,b,c){this.g=a;this.f=b;this.a=c},xK=function(a){this.a=a},yK=function(a){this.B=new _.H("clpp.freewheel.AdsManager");this.l=a;this.g=new _.eg;this.o=new tv.freewheel.SDK.AdManager;
3
- this.f=this.a=null;this.A=[];this.m=[];this.w=[];this.j=new _.Sh;this.h=null},zK=function(a){var b=[];typeof a.networkId!==_.k&&b.push("networkId");typeof a.serverUrl!==_.ve&&b.push("serverUrl");typeof a.profileId!==_.ve&&b.push("profileId");typeof a.videoAssetId!==_.ve&&typeof a.videoAssetId!==_.k&&b.push("videoAssetId");if(b.length)throw new _.L(1,9,12001,{missingKeys:b.join(", ")});},AK=function(){var a,b,c,d;return _.A(function(e){if(1==e.a)return a=new _.Bp,b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_NONE,
4
- _.x(e,a.canPlay(!1),2);if(3!=e.a)return c=e.f,_.x(e,a.canPlay(!0),3);d=e.f;c?b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_ATTENDED:d&&(b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_UNATTENDED);return e["return"](b)})},DK=function(a){return _.A(function(b){if(a.A.length)return BK(a),a.f=a.A.shift(),a.f.play(),b.G(0);CK(a);return _.x(b,a.l.a.play(),0)})},EK=function(a){a.w.length?(BK(a),a.f=a.w.shift(),a.f.play()):CK(a)},BK=function(a){var b=a.l.$b(sK).Ec();b&&(a.l.getSurface().show(b),a.l.getSurface().hideMediaElement(),
5
- a.a.registerVideoDisplayBase(qK),a.l.isMuted()?a.setVolume(0):a.setVolume(a.l.getVolume()||1))},CK=function(a){var b=a.l.$b(sK).Ec();b&&a.l.getSurface().hide(b);a.l.getSurface().showMediaElement()},FK=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 wK(a.a,c,d)});a.l.trigger(new _.J(b,d))},GK=function(){this.a=new _.H(rK)};_.v(tK,_.mq);_.t=tK.prototype;
6
- _.t.onPlayerCreated=function(a){if(window.tv&&tv.freewheel&&tv.freewheel.SDK)this.a=_.Hn(_.Zc,{id:qK}),this.f=_.Hn(_.Re,{"class":_.Hc}),this.a.appendChild(this.f),a.getSurface().addElementToContainer(this.a,!0),a.getSurface().hide(this.a);else a.onError(new _.L(1,9,12E3))};_.t.onPlayerWillDestroy=function(a){this.a&&(a.getSurface().removeElementFromContainer(this.a),this.f=this.a=null)};_.t.id=function(){return sK};_.t.Ec=function(){return this.a};_.t.fi=function(){return this.f};
7
- _.D("clpp.freewheel.FreeWheelPlugin",tK);tK.prototype.getAdVideo=tK.prototype.fi;tK.prototype.getAdContainer=tK.prototype.Ec;tK.Id=sK;tK.AD_CONTAINER_ID=qK;uK.prototype.create=function(){return new tK};_.Eo(new uK);_.t=wK.prototype;_.t.rb=function(){return"FreeWheel AdManager SDK"};_.t.sb=function(){return tv.freewheel.SDK.version};_.t.xb=function(){return 0};_.t.getId=function(){return this.a?this.a.getAdId():""};_.t.getCreativeId=function(){var a=(this.a||{})._creativeId;return typeof a===_.ve?a:""};_.t.getApiFramework=function(){return this.a?this.a.getActiveCreativeRendition().getCreativeApi():""};_.t.getAdSystem=function(){return""};_.t.getAdvertiserName=function(){return""};_.t.getTitle=function(){return""};
8
- _.t.getDuration=function(){return this.a?this.a.getActiveCreativeRendition().getDuration():0};_.t.getSkipTimeOffset=function(){return 0};_.t.dc=function(){return!1};_.t.Jb=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.ub=function(){return this.a?this.a.getActiveCreativeRendition().getWidth():0};_.t.tb=function(){return this.a?this.a.getActiveCreativeRendition().getHeight():0};_.t.gb=function(){return 0};_.t.Ua=function(){switch(this.f.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:return 0;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:return 2;default:return 1}};
10
- _.t.getPodIndex=function(){switch(this.Ua()){case 0:return 0;case 2:return-1}return this.g.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL).indexOf(this.f)+1};_.t.Kb=function(){switch(this.Ua()){case 0:return 0;case 2:return-1;default:return this.f.getTimePosition()}};_.t.Lb=function(){return this.a?this.f.getAdInstances().indexOf(this.a)+1:1};_.t.wb=function(){return this.f.getAdCount()};_.t.getWrapperAdIds=function(){return[]};_.t.getWrapperAdSystems=function(){return[]};
11
- _.t.getWrapperCreativeIds=function(){return[]};wK.prototype.getWrapperCreativeIds=wK.prototype.getWrapperCreativeIds;wK.prototype.getWrapperAdSystems=wK.prototype.getWrapperAdSystems;wK.prototype.getWrapperAdIds=wK.prototype.getWrapperAdIds;wK.prototype.getSequenceLength=wK.prototype.wb;wK.prototype.getPositionInSequence=wK.prototype.Lb;wK.prototype.getPodTimeOffset=wK.prototype.Kb;wK.prototype.getPodIndex=wK.prototype.getPodIndex;wK.prototype.getPodType=wK.prototype.Ua;
12
- wK.prototype.getMediaBitrate=wK.prototype.gb;wK.prototype.getMediaHeight=wK.prototype.tb;wK.prototype.getMediaWidth=wK.prototype.ub;wK.prototype.getMediaUrl=wK.prototype.getMediaUrl;wK.prototype.getClickThroughUrl=wK.prototype.Jb;wK.prototype.isBumper=wK.prototype.dc;wK.prototype.getSkipTimeOffset=wK.prototype.getSkipTimeOffset;wK.prototype.getDuration=wK.prototype.getDuration;wK.prototype.getTitle=wK.prototype.getTitle;wK.prototype.getAdvertiserName=wK.prototype.getAdvertiserName;
13
- wK.prototype.getAdSystem=wK.prototype.getAdSystem;wK.prototype.getApiFramework=wK.prototype.getApiFramework;wK.prototype.getCreativeId=wK.prototype.getCreativeId;wK.prototype.getId=wK.prototype.getId;wK.prototype.getTechnology=wK.prototype.xb;wK.prototype.getAdManagerVersion=wK.prototype.sb;wK.prototype.getAdManagerName=wK.prototype.rb;xK.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()}})};xK.prototype.Mb=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL).length};xK.prototype.hb=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL).length};
14
- xK.prototype.hasPostroll=xK.prototype.hb;xK.prototype.hasPreroll=xK.prototype.Mb;xK.prototype.getCuePoints=xK.prototype.getCuePoints;_.t=yK.prototype;
15
- _.t.load=function(){var a=this,b,c,d,e,f,g,h,l;return _.A(function(m){if(1==m.a){b=a.l.getConfiguration().freewheel||{};try{zK(b)}catch(n){return a.l.onError(n),a.j.resolve(),m["return"](a.j)}a.o.setNetwork(b.networkId);a.o.setServer(b.serverUrl);a.a=a.o.newContext();a.a.setProfile(b.profileId);typeof b.siteSectionId!==_.ve&&typeof b.siteSectionId!==_.k||a.a.setSiteSection(b.siteSectionId);return _.x(m,AK(),2)}c=m.f;a.a.setVideoAsset(b.videoAssetId,a.l.getDuration(),void 0,void 0,c);if(Array.isArray(b.pods))for(d=
16
- _.u(b.pods),e=d.next();!e.done;e=d.next())f=e.value,a.a.addTemporalSlot(f.id,vK(f.type),f.position,f.slotProfile,f.cuepointSequence,f.maxDuration,f.minDuration,f.acceptContentType);b.keyValues&&typeof b.keyValues===_.Ld&&Object.keys(b.keyValues).forEach(function(n){return a.a.addKeyValue(n,b.keyValues[n])});a.a.setParameter(tv.freewheel.SDK.PARAMETER_EXTENSION_CONTENT_VIDEO_ENABLED,!1,tv.freewheel.SDK.PARAMETER_LEVEL_GLOBAL);if(Array.isArray(b.parameters))for(g=_.u(b.parameters),h=g.next();!h.done;h=
17
- g.next())l=h.value,a.a.setParameter(l.name,l.value,l.level);a.g.on(a.a,tv.freewheel.SDK.EVENT_REQUEST_COMPLETE,a.kj.bind(a));a.g.on(a.a,tv.freewheel.SDK.EVENT_SLOT_STARTED,a.oj.bind(a));a.g.on(a.a,tv.freewheel.SDK.EVENT_SLOT_ENDED,a.nj.bind(a));a.g.on(a.a,tv.freewheel.SDK.EVENT_AD,a.Gi.bind(a));a.g.on(a.l,_.Fe,a.nh.bind(a));a.g.on(a.l,_.se,a.mh.bind(a));a.a.submitRequest();return m["return"](a.j)})};_.t.start=function(){var a=this;return _.A(function(b){return _.x(b,DK(a),0)})};
18
- _.t.resume=function(){this.f&&this.f.resume()};_.t.pause=function(){this.f&&this.f.pause()};_.t.skip=function(){this.f&&this.f.skipCurrentAd()};_.t.getVolume=function(){return this.a?this.a.getAdVolume():1};_.t.setVolume=function(a){this.a&&this.a.setAdVolume(a)};_.t.getPosition=function(){return this.f?this.f.getPlayheadTime():-1};_.t.dispose=function(){var a=this;return _.A(function(b){a.g.release();a.h&&(a.h.stop(),a.h=null);CK(a);a.a&&(a.a.dispose(),a.a=null);_.y(b)})};
19
- _.t.kj=function(a){var b=this;if(a.success)this.A=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL),this.m=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL),this.w=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL),this.l.trigger(new _.J(_.Xb,{adsTimeline:new xK(this.a)})),this.h=new _.zp(this.l.getSurface(),function(c,d){return b.a.resize(c,d)},this.l.$b(sK).f);else this.l.onError(new _.L(1,9,10003,{errorType:0},
20
- void 0));this.j.resolve()};_.t.oj=function(a){FK(this,_.Gb,a);this.h.start()};_.t.nj=function(a){this.f=null;a=a.slot;FK(this,_.Hb);this.h.stop();if(a)switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:DK(this);break;case tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL:CK(this);this.l.play();break;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:EK(this)}};
21
- _.t.Gi=function(a){var b=a.subType;this.B.debug("ad event",b);switch(b){case tv.freewheel.SDK.EVENT_AD_IMPRESSION:FK(this,_.Tb,a);FK(this,_.Mb,a);break;case tv.freewheel.SDK.EVENT_AD_IMPRESSION_END:FK(this,_.Ub,a);break;case tv.freewheel.SDK.EVENT_AD_FIRST_QUARTILE:FK(this,_.Lb,a);break;case tv.freewheel.SDK.EVENT_AD_MIDPOINT:FK(this,_.Ob,a);break;case tv.freewheel.SDK.EVENT_AD_THIRD_QUARTILE:FK(this,_.Vb,a);break;case tv.freewheel.SDK.EVENT_AD_COMPLETE:FK(this,_.Kb,a);break;case tv.freewheel.SDK.EVENT_AD_CLICK:FK(this,
22
- _.Jb,a);break;case tv.freewheel.SDK.EVENT_AD_PAUSE:FK(this,_.Pb,a);break;case tv.freewheel.SDK.EVENT_AD_RESUME:FK(this,_.Rb,a);break;case tv.freewheel.SDK.EVENT_AD_SKIPPED:FK(this,_.Sb,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_START:FK(this,_.Ib,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_END:FK(this,_.Qb,a);break;case tv.freewheel.SDK.EVENT_ERROR:this.l.onError(new _.L(1,9,10003,{errorType:1},{fwCode:a[tv.freewheel.SDK.INFO_KEY_ERROR_CODE],fwInfo:a[tv.freewheel.SDK.INFO_KEY_ERROR_INFO],
23
- fwModule:a[tv.freewheel.SDK.INFO_KEY_ERROR_MODULE]}))}};_.t.nh=function(){var a=this;if(!this.f){var b=this.l.getPosition();if(this.f=this.m.find(function(d){return.5>Math.abs(b-d.getTimePosition())})||null){var c=this.m.findIndex(function(d){return d===a.f});this.m.splice(c,1);this.l.pause();BK(this);this.f.play()}}};
24
- _.t.mh=function(a){if((a=a.detail)&&this.a)switch(a.currentState){case _.ln:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PLAYING);break;case _.kn:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PAUSED);break;case _.dn:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_COMPLETED);EK(this);break;case _.Xm:case _.hn:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_STOPPED)}};yK.prototype.getPosition=yK.prototype.getPosition;yK.prototype.setVolume=yK.prototype.setVolume;
25
- yK.prototype.getVolume=yK.prototype.getVolume;yK.prototype.skip=yK.prototype.skip;yK.prototype.pause=yK.prototype.pause;yK.prototype.resume=yK.prototype.resume;yK.prototype.start=yK.prototype.start;GK.prototype.name=function(){return rK};GK.prototype.ca=function(a,b){return a.namespace()===_.Jc?!1:window.tv&&tv.freewheel&&tv.freewheel.SDK?!(!b||!b.freewheel):(this.a.warn("FreeWheel SDK is not loaded."),!1)};GK.prototype.create=function(a){return new yK(a)};GK.prototype.create=GK.prototype.create;GK.prototype.isSupported=GK.prototype.ca;GK.prototype.name=GK.prototype.name;_.En(new GK);};
2
+ var f=function(window){var YK="clpp-freewheel",ZK="clpp.freewheel.AdsManagerFactory",$K="freewheel",aL=function(){this.f=this.a=null},bL=function(){},cL=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""}},dL=function(a,b,c){this.g=a;this.f=b;this.a=c},eL=function(a){this.a=a},fL=function(a){this.h=new _.H("clpp.freewheel.AdsManager");this.l=a;this.g=new _.eg;this.w=new tv.freewheel.SDK.AdManager;
3
+ this.f=this.a=null;this.B=[];this.o=[];this.A=[];this.m=new _.di;this.j=null},gL=function(a){var b=[];typeof a.networkId!==_.k&&b.push("networkId");typeof a.serverUrl!==_.ve&&b.push("serverUrl");typeof a.profileId!==_.ve&&b.push("profileId");typeof a.videoAssetId!==_.ve&&typeof a.videoAssetId!==_.k&&b.push("videoAssetId");if(b.length)throw new _.L(1,9,12001,{missingKeys:b.join(", ")});},hL=function(){var a,b,c,d;return _.B(function(e){if(1==e.a)return a=new _.Cp,b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_NONE,
4
+ _.x(e,a.canPlay(!1),2);if(3!=e.a)return c=e.f,_.x(e,a.canPlay(!0),3);d=e.f;c?b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_ATTENDED:d&&(b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_UNATTENDED);return e["return"](b)})},kL=function(a){return _.B(function(b){if(a.B.length)return iL(a),a.f=a.B.shift(),a.f.play(),b.G(0);jL(a);return _.x(b,a.l.a.play(),0)})},lL=function(a){a.A.length?(iL(a),a.f=a.A.shift(),a.f.play()):jL(a)},iL=function(a){var b=a.l.cc($K).Jc();b&&(a.l.getSurface().show(b),a.l.getSurface().hideMediaElement(),
5
+ a.a.registerVideoDisplayBase(YK),a.l.isMuted()?a.setVolume(0):a.setVolume(a.l.getVolume()||1))},jL=function(a){var b=a.l.cc($K).Jc();b&&a.l.getSurface().hide(b);a.l.getSurface().showMediaElement()},mL=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 dL(a.a,c,d)});a.l.trigger(new _.I(b,d))},nL=function(){this.a=new _.H(ZK)};_.w(aL,_.nq);_.t=aL.prototype;
6
+ _.t.onPlayerCreated=function(a){if(window.tv&&tv.freewheel&&tv.freewheel.SDK)this.a=_.In(_.$c,{id:YK}),this.f=_.In(_.Re,{"class":_.Ic}),this.a.appendChild(this.f),a.getSurface().addElementToContainer(this.a,!0),a.getSurface().hide(this.a);else a.onError(new _.L(1,9,12E3))};_.t.onPlayerWillDestroy=function(a){this.a&&(a.getSurface().removeElementFromContainer(this.a),this.f=this.a=null)};_.t.id=function(){return $K};_.t.Jc=function(){return this.a};_.t.Yi=function(){return this.f};
7
+ _.C("clpp.freewheel.FreeWheelPlugin",aL);aL.prototype.getAdVideo=aL.prototype.Yi;aL.prototype.getAdContainer=aL.prototype.Jc;aL.Id=$K;aL.AD_CONTAINER_ID=YK;bL.prototype.create=function(){return new aL};_.Fo(new bL);_.t=dL.prototype;_.t.ub=function(){return"FreeWheel AdManager SDK"};_.t.vb=function(){return tv.freewheel.SDK.version};_.t.Ab=function(){return 0};_.t.getId=function(){return this.a?this.a.getAdId():""};_.t.getCreativeId=function(){var a=(this.a||{})._creativeId;return typeof a===_.ve?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.gc=function(){return!1};_.t.Nb=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.xb=function(){return this.a?this.a.getActiveCreativeRendition().getWidth():0};_.t.wb=function(){return this.a?this.a.getActiveCreativeRendition().getHeight():0};_.t.jb=function(){return 0};_.t.Ya=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.Ya()){case 0:return 0;case 2:return-1}return this.g.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL).indexOf(this.f)+1};_.t.Ob=function(){switch(this.Ya()){case 0:return 0;case 2:return-1;default:return this.f.getTimePosition()}};_.t.Pb=function(){return this.a?this.f.getAdInstances().indexOf(this.a)+1:1};_.t.zb=function(){return this.f.getAdCount()};_.t.getWrapperAdIds=function(){return[]};_.t.getWrapperAdSystems=function(){return[]};
11
+ _.t.getWrapperCreativeIds=function(){return[]};dL.prototype.getWrapperCreativeIds=dL.prototype.getWrapperCreativeIds;dL.prototype.getWrapperAdSystems=dL.prototype.getWrapperAdSystems;dL.prototype.getWrapperAdIds=dL.prototype.getWrapperAdIds;dL.prototype.getSequenceLength=dL.prototype.zb;dL.prototype.getPositionInSequence=dL.prototype.Pb;dL.prototype.getPodTimeOffset=dL.prototype.Ob;dL.prototype.getPodIndex=dL.prototype.getPodIndex;dL.prototype.getPodType=dL.prototype.Ya;
12
+ dL.prototype.getMediaBitrate=dL.prototype.jb;dL.prototype.getMediaHeight=dL.prototype.wb;dL.prototype.getMediaWidth=dL.prototype.xb;dL.prototype.getMediaUrl=dL.prototype.getMediaUrl;dL.prototype.getClickThroughUrl=dL.prototype.Nb;dL.prototype.isBumper=dL.prototype.gc;dL.prototype.getSkipTimeOffset=dL.prototype.getSkipTimeOffset;dL.prototype.getDuration=dL.prototype.getDuration;dL.prototype.getTitle=dL.prototype.getTitle;dL.prototype.getAdvertiserName=dL.prototype.getAdvertiserName;
13
+ dL.prototype.getAdSystem=dL.prototype.getAdSystem;dL.prototype.getApiFramework=dL.prototype.getApiFramework;dL.prototype.getCreativeId=dL.prototype.getCreativeId;dL.prototype.getId=dL.prototype.getId;dL.prototype.getTechnology=dL.prototype.Ab;dL.prototype.getAdManagerVersion=dL.prototype.vb;dL.prototype.getAdManagerName=dL.prototype.ub;eL.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()}})};eL.prototype.Qb=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL).length};eL.prototype.kb=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL).length};
14
+ eL.prototype.hasPostroll=eL.prototype.kb;eL.prototype.hasPreroll=eL.prototype.Qb;eL.prototype.getCuePoints=eL.prototype.getCuePoints;_.t=fL.prototype;
15
+ _.t.load=function(){var a=this,b,c,d,e,f,g,h,l;return _.B(function(m){if(1==m.a){b=a.l.getConfiguration().freewheel||{};try{gL(b)}catch(n){return a.l.onError(n),a.m.resolve(),m["return"](a.m)}a.w.setNetwork(b.networkId);a.w.setServer(b.serverUrl);a.a=a.w.newContext();a.a.setProfile(b.profileId);typeof b.siteSectionId!==_.ve&&typeof b.siteSectionId!==_.k||a.a.setSiteSection(b.siteSectionId);return _.x(m,hL(),2)}c=m.f;a.a.setVideoAsset(b.videoAssetId,a.l.getDuration(),void 0,void 0,c);if(Array.isArray(b.pods))for(d=
16
+ _.u(b.pods),e=d.next();!e.done;e=d.next())f=e.value,a.a.addTemporalSlot(f.id,cL(f.type),f.position,f.slotProfile,f.cuepointSequence,f.maxDuration,f.minDuration,f.acceptContentType);b.keyValues&&typeof b.keyValues===_.Ld&&Object.keys(b.keyValues).forEach(function(n){return a.a.addKeyValue(n,b.keyValues[n])});a.a.setParameter(tv.freewheel.SDK.PARAMETER_EXTENSION_CONTENT_VIDEO_ENABLED,!1,tv.freewheel.SDK.PARAMETER_LEVEL_GLOBAL);if(Array.isArray(b.parameters))for(g=_.u(b.parameters),h=g.next();!h.done;h=
17
+ g.next())l=h.value,a.a.setParameter(l.name,l.value,l.level);a.g.on(a.a,tv.freewheel.SDK.EVENT_REQUEST_COMPLETE,a.pk.bind(a));a.g.on(a.a,tv.freewheel.SDK.EVENT_SLOT_STARTED,a.tk.bind(a));a.g.on(a.a,tv.freewheel.SDK.EVENT_SLOT_ENDED,a.sk.bind(a));a.g.on(a.a,tv.freewheel.SDK.EVENT_AD,a.Lj.bind(a));a.g.on(a.l,_.Fe,a.Xh.bind(a));a.g.on(a.l,_.se,a.Wh.bind(a));a.a.submitRequest();return m["return"](a.m)})};_.t.start=function(){var a=this;return _.B(function(b){return _.x(b,kL(a),0)})};
18
+ _.t.resume=function(){this.f&&this.f.resume()};_.t.pause=function(){this.f&&this.f.pause()};_.t.skip=function(){this.f&&this.f.skipCurrentAd()};_.t.getVolume=function(){return this.a?this.a.getAdVolume():1};_.t.setVolume=function(a){this.a&&this.a.setAdVolume(a)};_.t.getPosition=function(){return this.f?this.f.getPlayheadTime():-1};_.t.dispose=function(){var a=this;return _.B(function(b){a.g.release();a.j&&(a.j.stop(),a.j=null);jL(a);a.a&&(a.a.dispose(),a.a=null);_.z(b)})};
19
+ _.t.pk=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.l.trigger(new _.I(_.Zb,{adsTimeline:new eL(this.a)})),this.j=new _.Ap(this.l.getSurface(),function(c,d){return b.a.resize(c,d)},this.l.cc($K).f);else this.l.onError(new _.L(1,9,10003,{errorType:0},
20
+ void 0));this.m.resolve()};_.t.tk=function(a){mL(this,_.Ib,a);this.j.start()};_.t.sk=function(a){this.f=null;a=a.slot;mL(this,_.Jb);this.j.stop();if(a)switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:kL(this);break;case tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL:jL(this);this.l.play();break;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:lL(this)}};
21
+ _.t.Lj=function(a){var b=a.subType;this.h.debug("ad event",b);switch(b){case tv.freewheel.SDK.EVENT_AD_IMPRESSION:mL(this,_.Vb,a);mL(this,_.Ob,a);break;case tv.freewheel.SDK.EVENT_AD_IMPRESSION_END:mL(this,_.Wb,a);break;case tv.freewheel.SDK.EVENT_AD_FIRST_QUARTILE:mL(this,_.Nb,a);break;case tv.freewheel.SDK.EVENT_AD_MIDPOINT:mL(this,_.Qb,a);break;case tv.freewheel.SDK.EVENT_AD_THIRD_QUARTILE:mL(this,_.Xb,a);break;case tv.freewheel.SDK.EVENT_AD_COMPLETE:mL(this,_.Mb,a);break;case tv.freewheel.SDK.EVENT_AD_CLICK:mL(this,
22
+ _.Lb,a);break;case tv.freewheel.SDK.EVENT_AD_PAUSE:mL(this,_.Rb,a);break;case tv.freewheel.SDK.EVENT_AD_RESUME:mL(this,_.Tb,a);break;case tv.freewheel.SDK.EVENT_AD_SKIPPED:mL(this,_.Ub,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_START:mL(this,_.Kb,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_END:mL(this,_.Sb,a);break;case tv.freewheel.SDK.EVENT_ERROR:this.l.onError(new _.L(1,9,10003,{errorType:1},{fwCode:a[tv.freewheel.SDK.INFO_KEY_ERROR_CODE],fwInfo:a[tv.freewheel.SDK.INFO_KEY_ERROR_INFO],
23
+ fwModule:a[tv.freewheel.SDK.INFO_KEY_ERROR_MODULE]}))}};_.t.Xh=function(){var a=this;if(!this.f){var b=this.l.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.l.pause();iL(this);this.f.play()}}};
24
+ _.t.Wh=function(a){if((a=a.detail)&&this.a)switch(a.currentState){case _.mn:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PLAYING);break;case _.ln:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PAUSED);break;case _.en:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_COMPLETED);lL(this);break;case _.Ym:case _.jn:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_STOPPED)}};fL.prototype.getPosition=fL.prototype.getPosition;fL.prototype.setVolume=fL.prototype.setVolume;
25
+ fL.prototype.getVolume=fL.prototype.getVolume;fL.prototype.skip=fL.prototype.skip;fL.prototype.pause=fL.prototype.pause;fL.prototype.resume=fL.prototype.resume;fL.prototype.start=fL.prototype.start;nL.prototype.name=function(){return ZK};nL.prototype.$=function(a,b){return a.namespace()===_.Kc?!1:window.tv&&tv.freewheel&&tv.freewheel.SDK?!(!b||!b.freewheel):(this.a.warn("FreeWheel SDK is not loaded."),!1)};nL.prototype.create=function(a){return new fL(a)};nL.prototype.create=nL.prototype.create;nL.prototype.isSupported=nL.prototype.$;nL.prototype.name=nL.prototype.name;_.Fn(new nL);};
26
26
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
27
27
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
28
28
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.hls.js CHANGED
@@ -1,53 +1,72 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var VA="CLOSED-CAPTIONS",WA="Could not parse MP4 segment start time.",XA="EXT-X-BYTERANGE",YA="EXT-X-DISCONTINUITY",ZA="EXT-X-DISCONTINUITY-SEQUENCE",$A="EXT-X-ENDLIST",aB="EXT-X-MAP",bB="EXT-X-MEDIA-SEQUENCE",cB="EXT-X-PART-INF",dB="EXT-X-PLAYLIST-TYPE",eB="EXT-X-PRELOAD-HINT",fB="EXT-X-SERVER-CONTROL",gB="EXT-X-STREAM-INF",hB="EXT-X-TARGETDURATION",iB="EXTINF",jB="Guessing audio-only",kB="SAMPLE-AES-CTR",lB="SUBTITLES",mB="application/vnd.apple.mpegurl",nB=function(a,b){var c=a.getAttribute(b);
3
- if(!c)throw new _.L(_.M,4,4023,b);return c.value},oB=function(a){if(1>a.a)throw _.Hk();--a.a},pB=function(a,b,c,d){if(1===b){if(!d||0===d.length)throw new _.L(_.M,4,4043,"Media playlist must have at least one segment!");if(null==d[0].a)throw new _.L(_.M,4,4043,"Media playlist must have at least one full segment!");}this.a=a;this.f="";this.type=b;this.fa=c;this.X=1===b?d:null},qB=function(a,b,c){c=void 0===c?[]:c;this.fa=b;this.a=a;this.f=c},rB=function(a,b){return a.filter(function(c){return c.name==
4
- b})},sB=function(a,b){return a.filter(function(c){return nB(c,"TYPE")===b})},tB=function(a,b){var c=rB(a,b);return c.length?c[0]:null},uB=function(a){var b=void 0===b?0:b;return(a=tB(a,bB))?Number(a.value):b},vB=function(a,b){return _.Kv([a],[b])[0]},wB=function(){this.a=0},zB=function(a,b,c){var d=[],e=[],f=[],g=[];c.forEach(function(h){/^(#EXT)/.test(h)?(h=_.jh(a.a++,h),xB.includes(h.name)?d.push(h):yB.includes(h.name)?"EXT-X-PART"===h.name?g.push(h):h.name===eB&&"PART"===_.dh(h,"TYPE")&&g.push(h):
5
- f.push(h)):/^#(?!EXT)/m.test(h)||(h=vB(b,h.trim()),e.push(new qB(h,f,g)),f=[],g=[])});0<g.length&&e.push(new qB(null,f,g));return{X:e,fa:d}},AB=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},BB=function(a){function b(l,m,n){for(var p="";m<n;m++)p+="%"+("00"+l[m].toString(16)).slice(-2);return p}function c(l){return l[0]<<21|l[1]<<14|l[2]<<7|l[3]}function d(){throw new _.L(_.M,
6
- 4,4030);}AB(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}}AB(a,e)||d();e+=10;e+=f}while(e<a.byteLength);return d()},CB=function(a,
7
- b){var c=null,d=0;try{(new _.Ok).L(_.Fd,_.Pk).L(_.Ge,_.Pk).L(_.Ad,_.Pk).V("mdhd",function(g){g.reader.skip(0==g.version?8:16);d=_.U(g.reader);g.parser.stop()}).parse(b,!0)}catch(g){c=g}if(c||!d)throw _.Sq.error("Unable to find timescale in init segment!"),new _.L(_.M,4,4030,WA,c);var e=0,f=!1;try{(new _.Ok).L("moof",_.Pk).L("traf",_.Pk).V("tfdt",function(g){e=(0==g.version?_.U(g.reader):_.Mk(g.reader))/d;f=!0;g.parser.stop()}).parse(a,!0)}catch(g){c=g}if(c||!f)throw new _.L(_.M,4,4030,WA,c);return e},
8
- DB=function(a){for(;a.getPosition()<a.za()-1;){var b=a.getPosition();if(71===_.Ik(a))return oB(a),b}return-1},EB=function(a){function b(){d.seek(e+188);f=_.Ik(d);71!=f&&(d.seek(e+192),f=_.Ik(d));71!=f&&(d.seek(e+204),f=_.Ik(d));71!=f&&c();oB(d)}function c(){throw new _.L(_.M,4,4030);}var d=new _.Fk(new DataView(a),!1),e=0,f=0;e=DB(d);0>e&&(_.Sq.error("Unable to find sync byte in TS after scanning."),c());for(;;)if(e=d.getPosition(),f=_.Ik(d),71!=f&&c(),a=_.Jk(d),8191===(a&8191))b();else if(a&16384)if(a=
9
- (_.Ik(d)&48)>>4,0!=a&&2!=a||c(),3==a&&(a=_.Ik(d),d.skip(a)),1!=_.U(d)>>8)b();else{d.skip(3);a=_.Ik(d)>>6;0!=a&&1!=a||c();0==_.Ik(d)&&c();a=_.Ik(d);var g=_.Jk(d),h=_.Jk(d);return(1073741824*((a&14)>>1)+((g&65534)<<14|(h&65534)>>1))/9E4}else b()},FB=function(a){this.f=new _.H("clpp.hls.MediaReader");this.g=a;this.a={attemptParameters:_.Kh()}},HB=function(a,b,c,d,e,f){var g,h,l,m,n,p,q;return _.A(function(r){switch(r.a){case 1:a.f.debug("Fetching segment to find start time");if("audio/mpeg"===d||d===
10
- _.pc||d===_.oc)return r["return"](0);if(d!==_.mc){r.G(2);break}return _.x(r,GB(a,c,f),3);case 3:return g=r.f,h=_.N(g.data),AB(h)?r["return"](BB(h)):r["return"](EB(g.data));case 2:if(d!==_.Te&&d!==_.qc){r.G(4);break}l=[GB(a,c,f)];b&&l.push(GB(a,b,!0));return _.x(r,Promise.all(l),5);case 5:return m=r.f,n=m[0],p=m[1]||m[0],r["return"](CB(n.data,p.data));case 4:if(d!==_.Se){r.G(6);break}return _.x(r,GB(a,c,f),7);case 7:return q=r.f,r["return"](EB(q.data));case 6:if(!MediaSource.isTypeSupported((d.split("/")[0]||
11
- "")+'/mp4;codecs\x3d"'+e+'"'))return r["return"](0);throw new _.L(_.M,4,4030);}})},GB=function(a,b,c){var d,e,f,g,h,l,m;return _.A(function(n){switch(n.a){case 1:return d=b.f(),e=_.ew(b.Ga(),b.$a,b.$a+2048-1,a.a.attemptParameters),e.type=2,f=_.ew(b.Ga(),b.$a,b.Oa,a.a.attemptParameters),f.type=2,d&&(f.keyInfo=d),_.zf(n,2),g=c?f:e,_.x(n,a.g(g),4);case 4:return h=n.f,n["return"](h);case 2:l=_.Bf(n);if(7001===l.code||c)throw l;a.f.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.",
12
- e.uris[0]);_.zf(n,5);return _.x(n,a.g(f),7);case 7:return n["return"](n.f);case 5:throw m=_.Bf(n),a.f.error("Failed to fetch media segment to parse its start timestamp.",f.uris[0],m),new _.L(_.M,4,4030,"Failed to fetch the media segment.");}})},IB=function(a,b,c,d,e,f,g,h,l,m,n,p,q,r){r=void 0===r?[]:r;_.gw.call(this,a,b,c,d,e,f,g,h,l,void 0===m?null:m,void 0===n?null:n,void 0===p?null:p,void 0===q?null:q,r);this.initSegment=void 0},KB=function(){var a=this;this.g=this.C=null;this.da=1;this.U=0;this.m=
13
- new Map;this.ba=new Set;this.a=new Map;this.h=null;this.w="";this.ga=new wB;this.aa=0;this.M=new Map;this.o=new _.Si(function(){a.Ab()});this.j=JB;this.S=null;this.D=0;this.F=Infinity;this.A=new _.Wh;this.$=[];this.J=new Map;this.P=!1;this.B=new Map;this.K=null;this.f=new _.H("clpp.hls.HlsParser");this.H=new Map;this.I=new Map;this.ua=new FB(this.ke.bind(this))},QB=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,r,w,z;return _.A(function(C){if(1==C.a){c=LB;d=b.Eg;e=new _.Lg(d);if(a.g.hlsLowLatency){f=e.a;
14
- if(b.Kg){var E=b.segmentIndex;if(E=E.a[E.a.length-1]){var F=E.a,B=F.length-1;E={Ai:E.position,uj:F&&0<F.length?B:null}}else E=null;g=E;h=g.Ai;l=g.uj;null!==h&&(f.add("_HLS_msn",h),null!==l&&f.add("_HLS_part",l))}_.Wg(f);f.g&&_.Og(e,f)}return _.x(C,MB(a,e.toString()),2)}if(3!=C.a){m=C.f;n=m.response;p=m.text;q=NB(a,p,n.uri,b.nd);if(1!==q.type)throw new _.L(_.M,4,4017);return _.x(C,OB(a,b.nd,q,b.type,b.mimeType,b.codecs,b.keyInfo||null,b.Xh),3)}r=C.f;b.X=r;b.segmentIndex.replace(r);w=r[r.length-1];
15
- if(z=tB(q.fa,$A))PB(a,c.VOD),a.h.Sb(w.endTime);_.y(C)})},TB=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,r,w,z,C,E;return _.A(function(F){if(1==F.a){c=NB(a,b,a.w,"");if(1===c.type){a.H.set(a.w,c);d=c.X[0].a;e=_.wn;var B=_.Zg(d)||"";f=null!=_.$g.video[B]?_.Re:null!=_.$g.audio[B]?_.kc:null;g="";f===e.VIDEO?g="avc1.42E01E":f===e.AUDIO&&(g="mp4a.40.2");B=a.ga;var I=a.w,O=a.g.hlsDefaultCodecs||g,S=[],Ba=[];Ba.push(new _.eh(_.la,"0"));Ba.push(new _.eh(_.ub,I));O.length&&Ba.push(new _.eh(_.na,O));S.push(new _.ch(B.a++,
16
- gB,Ba));c=new pB(I,0,S)}return _.x(F,RB(a,c.fa),2)}h=F.f;if(!a.C)throw new _.L(_.M,7,7001);a.C.filterAllPeriods([h]);m=l=Infinity;n=_.u(a.a.values());for(p=n.next();!p.done;p=n.next())q=p.value,l=Math.min(l,q.Ee),q.type!==_.Ce&&(m=Math.min(m,q.duration));a.j===JB?a.h=new _.hw(null,0,!0):(a.h=new _.hw(0,a.U,!1),_.lw(a.h,1));SB(a);if(a.j===JB)for(a.h.Sb(m),a.h.offset(-l),C=_.u(a.a.values()),p=C.next();!p.done;p=C.next())E=p.value,E.segmentIndex.offset(-l),_.yw(E.segmentIndex,m);else{a.aa=a.F;r=LB;a.j===
17
- r.LIVE&&(w=a.h.Qe,z=Math.max(m,w),isNaN(a.g.availabilityWindowOverride)||(z=a.g.availabilityWindowOverride),a.h.gc=z);O=0;I=_.u(a.a.values());for(B=I.next();!B.done;B=I.next())O=Math.max(O,B.value.Ee);for(I=0;95443.7176888889<=O;)I+=95443.7176888889,O-=95443.7176888889;if(I)for(a.f.debug("Offsetting live streams by",I,"to compensate for rollover"),O=_.u(a.a.values()),B=O.next();!B.done;B=O.next())B=B.value,95443.7176888889>B.Ee?(a.f.debug("Offset applied to",B.type),B.segmentIndex.offset(I)):a.f.debug("Offset NOT applied to",
18
- B.type)}return F["return"]({presentationTimeline:a.h,periods:[h],offlineSessionIds:[],minBufferTime:0})})},RB=function(a,b){var c,d,e,f,g,h;return _.A(function(l){switch(l.a){case 1:c=rB(b,"EXT-X-MEDIA");d=rB(b,gB);e=rB(b,"EXT-X-IMAGE-STREAM-INF");for(var m=new Map,n=_.u(d),p=n.next();!p.done;p=n.next()){var q=p.value,r=_.dh(q,"AUDIO");p=_.dh(q,"VIDEO");var w=_.dh(q,lB);q=UB(a,q);if(w){var z=_.Yg(_.Ce,q);m.set(w,z);w=q.indexOf(z);-1<w&&q.splice(w,1)}r&&(w=VB(_.kc,q),m.set(r,w));p&&(r=VB(_.Re,q),m.set(p,
19
- r))}a.B=m;return _.x(l,WB(a,c),2);case 2:m=sB(c,VA);m=_.u(m);for(n=m.next();!n.done;n=m.next())r=n.value,n=XB(r),p=nB(r,_.La),r=nB(r,"INSTREAM-ID"),a.J.get(p)||a.J.set(p,new Map),a.J.get(p).set(r,n);return _.x(l,YB(a,d),3);case 3:return f=l.f,_.x(l,ZB(a,c),4);case 4:return g=l.f,_.x(l,$B(a,e),5);case 5:return h=l.f,l["return"]({startTime:0,variants:f,textStreams:g,thumbStreams:h})}})},ZB=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,r;return _.A(function(w){if(1==w.a)return c=sB(b,lB),d=c.map(function(z){var C;
20
- return _.A(function(E){if(1==E.a)return _.zf(E,2),_.x(E,aC(a,z),4);if(2!=E.a)return E["return"](E.f);C=_.Bf(E);throw C;})}),_.x(w,Promise.all(d),2);e=w.f;f=_.u(c);for(g=f.next();!g.done;g=f.next())if(h=g.value,l=nB(h,_.La),m=a.B.get(l))if(n=a.m.get(l))for(p=_.u(n),q=p.next();!q.done;q=p.next())r=q.value,r.codecs=m;return w["return"](e.filter(function(z){return z}))})},$B=function(a,b){var c,d;return _.A(function(e){if(1==e.a)return c=b.map(function(f){return _.A(function(g){return g["return"](bC(a,
21
- f))})}),_.x(e,Promise.all(c),2);d=e.f;return e["return"](d.filter(function(f){return f}))})},WB=function(a,b){var c;return _.A(function(d){if(1==d.a)return b=b.filter(function(e){var f=_.dh(e,_.ub)||"";return _.dh(e,"TYPE")!==lB&&""!==f}),b.length?_.x(d,aC(a,b[0]),2):d.G(2);c=b.slice(1).map(function(e){return aC(a,e)});return _.x(d,Promise.all(c),0)})},YB=function(a,b){var c,d,e,f,g,h,l,m,n,p;return _.A(function(q){if(1==q.a){c=function(r){var w,z,C,E,F,B,I;return _.A(function(O){return 1==O.a?(w=
22
- _.dh(r,"FRAME-RATE"),z=Number(nB(r,_.la)),C=_.dh(r,_.ib),E=_.u(C?C.split("x"):[null,null]),F=E.next().value,B=E.next().value,_.x(O,cC(a,r,C,w),2)):(I=O.f)?O["return"](dC(a,I.audio,I.video,z,F,B,w)):O["return"]([])})};d=0;e=Infinity;for(f=0;f<b.length;++f)g=Number(nB(b[f],_.la)),g<e&&(e=g,d=f);h=b.splice(d,1).pop();return _.x(q,c(h),2)}if(3!=q.a)return l=q.f,m=b.map(c),_.x(q,Promise.all(m),3);n=q.f;n.splice(d,0,l);p=n.reduce(_.Iv,[]);return q["return"](p.filter(_.Kg))})},cC=function(a,b,c,d){var e,
23
- f,g,h,l,m,n,p,q,r,w,z,C,E;return _.A(function(F){if(1==F.a)return e=_.wn,f=UB(a,b),g=_.dh(b,"AUDIO"),h=_.dh(b,"VIDEO"),m=(l=g||h)&&a.m.has(l)?a.m.get(l):[],n={audio:g?m:[],video:h?m:[]},a.f.debug("Guessing stream type for",b.toString()),q=!1,r=nB(b,_.ub),w=n.audio.find(function(B){return B.nd===r}),z=_.Yg(e.VIDEO,f),C=c||d||z,1!==f.length||C?!m.length&&1<f.length?(a.f.debug("Guessing multiplexed audio+video"),p=e.VIDEO,f=[f.join(",")]):n.audio.length&&w?(a.f.debug(jB),p=e.AUDIO,q=!0):n.video.length?
24
- (a.f.debug(jB),p=e.AUDIO):(a.f.debug("Guessing video-only"),p=e.VIDEO):(p=e.AUDIO,a.f.debug(jB)),E=null,q?F.G(2):_.x(F,eC(a,b,f,p),3);2!=F.a&&(E=F.f);if(E)n[E.type]=[E];else if(null===E)return a.f.debug("stream is null"),F["return"](null);gC(n);return F["return"](n)})},gC=function(a){a=_.u(a.audio.concat(a.video));for(var b=a.next();!b.done;b=a.next()){b=b.value;var c=b.codecs.split(",");c=c.filter(function(d){return"mp4a.40.34"!==d});b.codecs=c.join(",")}},dC=function(a,b,c,d,e,f,g){c.forEach(function(z){z&&
25
- (z.width=Number(e)||void 0,z.height=Number(f)||void 0,z.frameRate=Number(g)||void 0)});b.length||(b=[null]);c.length||(c=[null]);var h=[];b=_.u(b);for(var l=b.next();!l.done;l=b.next()){l=l.value;for(var m=_.u(c),n=m.next();!n.done;n=m.next()){var p=n.value,q=l?l.drmInfos:null,r=p?p.drmInfos:null;n=(p?p.nd:"")+" - "+(l?l.nd:"");var w=void 0;if(l&&p)if(q.length&&r.length?0<_.Uv(q,r).length:1)w=_.Uv(q,r);else{a.f.warn("Incompatible DRM info in HLS variant. Skipping.");continue}else l?w=q:p&&(w=r);
26
- a.ba.has(n)?a.f.debug("Skipping variant which only differs in text streams."):(p=hC(a,l,p,d,w),h.push(p),a.ba.add(n))}}return h},hC=function(a,b,c,d,e){return{id:a.da++,language:b?b.language:_.Ie,primary:!!b&&b.primary||!!c&&c.primary,audio:b,video:c,bandwidth:d,drmInfos:e,allowedByApplication:!0,allowedByKeySystem:!0}},aC=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,r,w;return _.A(function(z){if(1==z.a){c=nB(b,_.La);d="";e=nB(b,"TYPE").toLowerCase();f=_.wn;e===_.wv&&(e=f.TEXT);e!==f.TEXT&&c&&a.B.has(c)&&
27
- (d=a.B.get(c));g=nB(b,_.ub);if(a.a.has(g))return z["return"](a.a.get(g));h=XB(b);l=_.dh(b,"NAME");m=b.getAttribute("DEFAULT");n=b.getAttribute("AUTOSELECT");p=_.dh(b,"CHANNELS");q=e==_.kc?p?parseInt(p.split("/")[0],10):null:null;r=!!m&&!!n;return _.x(z,DC(a,g,d,e,h,r,l,q,null),2)}w=z.f;a.m.has(c)?a.m.get(c).push(w):a.m.set(c,[w]);if(a.a.has(g))return z["return"](a.a.get(g));a.a.set(g,w);return z["return"](w)})},bC=function(a,b){var c,d,e,f,g,h;return _.A(function(l){if(1==l.a){c=nB(b,_.ub);if(a.a.has(c))return l["return"](a.a.get(c));
28
- d=_.dh(b,_.na)||"jpg";e=XB(b);f=_.dh(b,"NAME");return _.x(l,DC(a,c,d,_.od,e,!1,f,null,null),2)}g=l.f;if(a.a.has(c))return l["return"](a.a.get(c));if(h=_.dh(b,_.la))g.bandwidth=Number(h);a.a.set(c,g);return l["return"](g)})},UB=function(a,b){var c=_.dh(b,_.na,a.g.hlsDefaultCodecs||"avc1.42E01E,mp4a.40.2").split(/\s*,\s*/),d=new Set,e=[];c=_.u(c);for(var f=c.next();!f.done;f=c.next()){f=f.value;var g=_.Sv(f)[0];d.has(g)?a.f.debug("Ignoring duplicate codec"):(e.push(f),d.add(g))}return e},XB=function(a){a=
29
- _.dh(a,"LANGUAGE")||_.Ie;return _.Ji(a)},eC=function(a,b,c,d){var e,f,g,h,l,m;return _.A(function(n){if(1==n.a){e=_.wn;f=nB(b,_.ub);if(a.a.has(f))return n["return"](a.a.get(f));g=_.dh(b,VA);h=null;d==e.VIDEO&&g&&"NONE"!==g&&(h=a.J.get(g));l=VB(d,c);return _.x(n,DC(a,f,l,d,_.Ie,!1,null,null,h),2)}m=n.f;if(a.a.has(f))return n["return"](a.a.get(f));a.a.set(f,m);return n["return"](m)})},DC=function(a,b,c,d,e,f,g,h,l){var m,n,p,q,r,w,z,C,E,F,B,I,O,S,Ba,ja,pa,Ca,Ga,qa,ta,Ma,Ja,Bb,Cb,Fb,Mi,Ni,Wf,ad,$b;return _.A(function(lc){switch(lc.a){case 1:m=
30
- vB(a.w,b);p=null;if(a.j===JB&&a.H.has(m)){n=a.H.get(m);a.H["delete"](m);lc.G(2);break}return _.x(lc,MB(a,m),3);case 3:q=lc.f,r=q.response,w=q.text,m=r.uri,n=NB(a,w,m,b);case 2:if(1!==n.type)throw new _.L(_.M,4,4017);EC(a,n);return _.x(lc,FC(a,d,c,n),4);case 4:z=lc.f;C=[];n.X.forEach(function(Oi){Oi=rB(Oi.fa,"EXT-X-KEY");C.push.apply(C,Oi)});E=!1;F=[];B=null;I=_.u(C);for(O=I.next();!O.done;O=I.next())S=O.value,Ba=nB(S,"METHOD"),ja=_.dh(S,"KEYFORMAT","identity"),"NONE"!==Ba&&("AES-128"===Ba?(pa=_.dh(S,
31
- "IV",""),Ca=vB(a.w,nB(S,_.ub)),p={method:"AES-128",url:Ca,iv:pa?_.mk((pa||"0x").slice(2)):null},a.P=!0):(E=!0,(qa=(Ga=GC[ja])?Ga(S,z):null)?(qa.keyIds.length&&(B=qa.keyIds[0]),F.push(qa)):a.f.warn("Unsupported HLS KEYFORMAT",ja)));if(E&&!F.length&&!a.P)throw new _.L(_.M,4,4026);ta=new Map;return _.x(lc,OB(a,b,n,d,z,c,p,ta),5);case 5:return Ma=lc.f,Ja=Ma[0].startTime,Bb=Ma[Ma.length-1].endTime,Cb=Bb-Ja,Fb=new _.uw(Ma),Mi=a.g.hlsLowLatency?_.qz:_.nv,Ni=HC(n,p),Wf=void 0,d==_.Ce&&(Wf=_.ye),$b=(ad=tB(n.fa,
32
- fB))?"YES"===_.dh(ad,"CAN-BLOCK-RELOAD"):!1,lc["return"]({id:a.da++,originalId:g,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:Fb.zc.bind(Fb),getSegmentReference:Fb.get.bind(Fb),adjustSegmentDurations:Fb.Pc.bind(Fb),getDuration:Fb.getDuration.bind(Fb),segmentIndex:Fb,segmentLookupStrategy:Mi,initSegmentReference:Ni,mimeType:z,codecs:c,kind:Wf,encrypted:E,keyId:B,language:e,label:g,type:d,primary:f,trickModeVideo:null,emsgSchemeIdUris:null,frameRate:void 0,width:void 0,height:void 0,
33
- bandwidth:void 0,roles:[],channelsCount:h,closedCaptions:l,keyInfo:p,X:Ma,drmInfos:F,nd:b,Eg:m,Ee:Ja,uk:Bb,duration:Cb,Xh:ta,Kg:$b})}})},NB=function(a,b,c,d){a:{a=a.ga;b=b.trim().split(/\n+/m);if(!/^#EXTM3U($|[ \t\n])/m.test(b[0]))throw new _.L(_.M,4,4015);var e=0;for(var f=!0,g=_.u(b),h=g.next();!h.done;h=g.next())if(h=h.value,h=h.trim(),!h.length||/^#(?!EXT)/m.test(h)||f)f=!1;else if(h=_.jh(0,h),xB.includes(h.name)){e=1;break}else h.name===gB&&(f=!0);f=[];g=!0;h=_.u(_.UA(b));for(var l=h.next();!l.done;l=
34
- h.next()){var m=l.value;l=m.Kd;var n=m.item;m=m.next;n=n.trim();if(!n.length||/^#(?!EXT)/m.test(n)||g)g=!1;else{n=_.jh(a.a++,n);if(IC.includes(n.name)){if(1!==e)throw new _.L(_.M,4,4017);b=b.splice(l,b.length-l);a=zB(a,c,b);c=new pB(c,e,f.concat(a.fa),a.X);break a}f.push(n);n.name===gB&&(n.attributes.push(new _.eh(_.ub,m)),g=!0)}}c=new pB(c,e,f)}c.f=d;return c},EC=function(a,b){var c=tB(b.fa,dB),d=tB(b.fa,$A);d=c&&"VOD"===c.value||d;c=c&&"EVENT"===c.value&&!d;c=!d&&!c;if(d)PB(a,JB);else{c?PB(a,JC):
35
- PB(a,KC);d=tB(b.fa,hB);if(!d)throw new _.L(_.M,4,4024,{missingTag:hB});d=Number(d.value);c=tB(b.fa,cB);a.g.hlsLowLatency&&c?(d=Number(nB(c,"PART-TARGET")),a.F=Math.min(d,a.F),a.D=Math.max(d,a.D),d=tB(b.fa,fB),a.U=d?Number(nB(d,"PART-HOLD-BACK")):0):(a.D=Math.max(d,a.D),a.F=Math.min(d,a.F),a.U=3*a.D)}},HC=function(a,b){var c=rB(a.X[0].fa,aB);if(!c.length)return null;if(1<a.X.map(function(g){return rB(g.fa,aB)}).reduce(function(g,h){return g.concat(h)},[]).length)throw new _.L(_.M,4,4020);var d=c[0];
36
- c=nB(d,_.ub);var e=vB(a.a,c);c=0;var f=null;if(d=_.dh(d,"BYTERANGE"))c=d.split("@"),d=Number(c[0]),c=Number(c[1]),f=c+d-1;return new _.fw(function(){return[e]},c,f,b)},MC=function(a,b,c,d,e,f,g){var h=[],l={};b=_.u(_.UA(b.f));for(var m=b.next();!m.done;l={Td:l.Td},m=b.next()){var n=m.value;m=n.Kd;n=n.item;var p=0==m?a:h[h.length-1],q=0==m?d:p.endTime,r=Number(_.dh(n,"DURATION"));r=q+r;var w=_.dh(n,"BYTERANGE");w=_.u(LC(p,w));p=w.next().value;w=w.next().value;var z=_.dh(n,_.ub);z=vB(g,z);l.Td=z?[z]:
37
- [];q=new IB(c,q,r,function(C){return function(){return C.Td}}(l),p,w,e,f,!1,null,null,null,null);if("YES"===_.dh(n,"INDEPENDENT")||0===m)q.g=!0;h.push(q)}return h},NC=function(a,b,c,d,e,f,g,h,l){var m=c.fa,n=c.a,p=n?[n]:[];n=tB(m,iB);(g=g?Object.assign({},g):null)&&!g.iv&&(g.iv=_.pk(new Uint8Array(12),new Uint8Array([d>>24&255,d>>16&255,d>>8&255,d&255])));var q=null,r=null,w=null;h===_.od&&(r=tB(m,"EXT-X-TILES"),q="1x1",r&&(q=_.dh(r,"LAYOUT")||"1x1",w=(w=_.dh(r,"DURATION"))?Number(w):null),r=_.u(q.split("x").map(function(z){return parseInt(z,
38
- 10)})),q=r.next().value,r=r.next().value);if(0===c.f.length&&!n)throw new _.L(_.M,4,4024,{missingTag:iB});h=null;if(0<c.f.length)if(a.g.hlsLowLatency)h=MC(b,c,d,e,f,g,l);else return null;c=a=0;l=null;n?(a=e+Number(n.value.split(",")[0]),m=tB(m,XA),b=_.u(LC(b,m?m.value:null)),c=b.next().value,l=b.next().value):a=h[h.length-1].endTime;return new IB(d,e,a,function(){return p},c,l,f,g,!1,null,q,r,w,h)},LC=function(a,b){var c=0,d=null;b&&(c=b.split("@"),d=Number(c[0]),c=c[1]?Number(c[1]):a.Oa+1,d=c+d-
39
- 1);return[c,d]},SB=function(a){a.h&&(a.$.forEach(function(b){_.kw(a.h,b,0)}),a.$=[])},OB=function(a,b,c,d,e,f,g,h){var l,m,n,p,q,r,w,z,C,E,F,B,I,O,S,Ba,ja,pa,Ca,Ga,qa,ta,Ma;return _.A(function(Ja){switch(Ja.a){case 1:l=c.X;m=HC(c,g);n=uB(c.fa);if(null!==a.K){Ja.G(2);break}p=a;return _.x(Ja,OC(a,b,m,l[0],n,g,e,f,d),3);case 3:p.K=Ja.f;case 2:q=a.K;r=l[0].a;a.f.debug("First segment",r.split("/").pop(),"starts at",q);z=(w=tB(c.fa,ZA))?Number(w.value):0;h.has(z)||h.set(z,n);if(!w)for(;h.has(z+1)&&h.get(z+
40
- 1)<n;)z++;C=a.I.get(z)||0;E=[];F=function(Bb){return _.UA(Bb)};B=_.u(F(l));I=B.next();case 4:if(I.done){Ja.G(6);break}S=O=I.value;Ba=S.Kd;ja=S.item;pa=E[E.length-1];Ca=0==Ba?q:pa.endTime;Ga=n+Ba;qa=tB(ja.fa,YA);if(!qa){Ja.G(7);break}z++;h.set(z,Ga);return _.x(Ja,PC(a,z,b,m,ja,Ga,g,e,f,Ca,d),8);case 8:C=Ja.f;case 7:ta=NC(a,pa,ja,Ga,Ca,C,g,d,c.a);Ma=tB(ja.fa,iB);ta&&(a.g.hlsLowLatency||Ma)&&E.push(ta);I=B.next();Ja.G(4);break;case 6:return a.$.push(E),SB(a),Ja["return"](E)}})},PC=function(a,b,c,d,e,
41
- f,g,h,l,m,n){var p,q;return _.A(function(r){if(1==r.a)return p=0,a.I.has(b)?(p=a.I.get(b),r.G(2)):_.x(r,OC(a,c,d,e,f,g,h,l,n,!0),3);2!=r.a&&(q=r.f,p=q-m,a.f.debug("Discontinuity segment offset",p),a.I.set(b,p));return r["return"](p)})},OC=function(a,b,c,d,e,f,g,h,l,m){var n,p;return _.A(function(q){n=NC(a,null,d,e,0,0,f,l,"");if(!n)return q["return"](0);if(a.S&&!m){var r=n.position;var w=a.a.get(b);r=w?(r=w.segmentIndex.get(r))?r.startTime:null:null;p=r;if(null!=p)return a.f.debug("Found segment start time in previous manifest"),
42
- q["return"](p);a.f.debug("Unable to find segment start time in previous manifest!")}return q["return"](HB(a.ua,c,n,g,h,a.P))})},VB=function(a,b){if(1===b.length)return b[0];var c=_.Yg(a,b);if(null!=c)return c;throw new _.L(_.M,4,4025,{codecList:b});},FC=function(a,b,c,d){var e,f,g,h;return _.A(function(l){e=d.X[0];f=e.a;h=(g=tB(e.fa,aB))?nB(g,_.ub):null;return l["return"](QC(a,b,c,f,h))})},QC=function(a,b,c,d,e){var f,g,h,l,m;return _.A(function(n){if(1==n.a){f=[d,e].filter(Boolean);if(g=_.ah(f,b,
43
- c))return n["return"](g);h=_.Nh([d],a.g.attemptParameters);h.method="HEAD";h.type=2;return _.x(n,a.ke(h),2)}l=n.f;m=l.headers["content-type"];if(!m)throw new _.L(_.M,4,4021,f.join(", "));return n["return"](m.split(";")[0])})},MB=function(a,b){var c,d,e;return _.A(function(f){if(1==f.a)return c=_.Nh([b],a.g.attemptParameters),c.type=1,_.x(f,a.ke(c),2);d=f.f;e="";try{e=_.vh(d.data)}catch(g){throw new _.L(_.M,4,4042);}e=e.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");e=e.trim();return f["return"]({text:e,response:d})})},
44
- RC=function(a){var b=nB(a,"METHOD"),c=["SAMPLE-AES",kB];if(!c.includes(b))return _.Tf("PlayReady in HLS is only supported with [",c.join(", "),"], not",b),null;a=nB(a,_.ub);b=_.$p(a);a=null;b=_.N(b.data);try{a=_.Bv(_.Ol(b))}catch(d){a=b}return _.Lv(_.Sc,[{initDataType:_.Cc,initData:a}],"")},PB=function(a,b){a.j=b;if(a.h){var c=a.h,d=a.j===JB;c.j=d;c.m=d}a.j===JB&&a.o.stop()},SC=function(){},IC=[iB,XA,"EXT-X-DATERANGE",YA,"EXT-X-KEY",aB,"EXT-X-PROGRAM-DATE-TIME"],xB=[ZA,$A,"EXT-X-I-FRAMES-ONLY",bB,
45
- cB,dB,fB,hB],yB=["EXT-X-PART",eB];_.v(IB,_.gw);_.t=KB.prototype;_.t.configure=function(a){this.g=a;this.ua.a=a};_.t.setCurrentVariant=function(a){var b=a.video?a.video.id:null;a=a.audio?a.audio.id:null;this.M.clear();for(var c=_.u(this.a.keys()),d=c.next();!d.done;d=c.next()){d=d.value;var e=this.a.get(d);e.id!==b&&e.id!==a||this.M.set(d,e)}};
46
- _.t.start=function(a,b){var c=this,d,e,f,g,h;return _.A(function(l){if(1==l.a)return c.C=b,_.x(l,MB(c,a),2);if(3!=l.a)return d=l.f,e=d.response,f=d.text,c.w=e.uri,_.x(l,TB(c,f),3);g=l.f;c.S=g;h=c.aa;0<h&&c.o.Z(h);return l["return"](g)})};_.t.stop=function(){this.o&&(this.o.stop(),this.o=null);var a=[];this.A&&(a.push(this.A.destroy()),this.A=null);this.g=this.C=null;this.ba.clear();this.a.clear();this.H.clear();this.S=null;this.m.clear();this.B.clear();return Promise.all(a)};
47
- _.t.update=function(){var a=this,b,c,d,e,f;return _.A(function(g){if(1==g.a){if(a.j===JB)return g["return"]();b=[];a.K=null;c=Array.from(a.a.values());d=Array.from(a.M.values());e=a.g.hlsLowLatency&&0<d.length?d:c;return _.x(g,QB(a,e[0]),2)}for(f=1;f<e.length;f++)b.push(QB(a,e[f]));return _.x(g,Promise.all(b),0)})};_.t.onExpirationUpdated=function(){};
48
- _.t.Ab=function(){var a=this,b,c,d;return _.A(function(e){if(1==e.a){a.f.debug(_.gv);if(!a.C)return e["return"]();_.zf(e,2);return _.x(e,a.update(),4)}if(2!=e.a)return b=a.aa,a.o.Z(b),_.Af(e,0);c=_.Bf(e);a.C&&(a.C.onError(c),d=c,1===d.severity&&a.o.Z(.1));_.y(e)})};_.t.ke=function(a){if(!this.A)throw new _.L(_.M,7,7001);a=this.C.networkingEngine.fetch(a);_.Xh(this.A,a);return a.O};
49
- var GC={"com.apple.streamingkeydelivery":function(a,b){if(b===_.Se)throw new _.L(_.M,4,4041);return _.Lv(_.Rc,[{initDataType:_.oe,initData:new Uint8Array(0)}],"")},"com.microsoft.playready":RC,"urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":RC,"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(a){var b=nB(a,"METHOD"),c=["SAMPLE-AES",kB];if(!c.includes(b))return _.Tf("Widevine in HLS is only supported with [",c.join(", "),"], not",b),null;b=nB(a,_.ub);b=_.$p(b);b=_.N(b.data);b=_.Lv(_.Tc,[{initDataType:_.Cc,
50
- initData:b}],"");if(a=_.dh(a,"KEYID"))b.keyIds=[a.substr(2).toLowerCase()];return b}},JB="VOD",KC="EVENT",JC="LIVE",LB={VOD:JB,Zj:KC,LIVE:JC};_.v(SC,_.Jo);SC.prototype.Ia=function(){_.Gp.m3u8=KB;_.Ep[_.Cj]=KB;_.Ep[mB]=KB};SC.prototype.Ca=function(){_.Dw("m3u8");_.Ew(_.Cj);_.Ew(mB)};SC.prototype.id=function(){return"hls"};_.D("clpp.hls.HlsComponent",SC);};
2
+ var f=function(window){var bB="CLOSED-CAPTIONS",cB="Could not parse MP4 segment start time.",dB="EXT-X-BYTERANGE",eB="EXT-X-DISCONTINUITY",fB="EXT-X-DISCONTINUITY-SEQUENCE",gB="EXT-X-ENDLIST",hB="EXT-X-KEY",iB="EXT-X-MAP",jB="EXT-X-MEDIA-SEQUENCE",kB="EXT-X-PART-INF",lB="EXT-X-PLAYLIST-TYPE",mB="EXT-X-PRELOAD-HINT",nB="EXT-X-SERVER-CONTROL",oB="EXT-X-STREAM-INF",pB="EXT-X-TARGETDURATION",qB="Failed to infer discontinuity number",rB="Guessing audio-only",sB="METHOD",tB="Media playlist contains an EXT-X-KEY tag with METHOD\x3dAES-128 in combination with another EXT-X-KEY tag, which is not supported.",
3
+ uB="Media playlist contains an EXT-X-KEY tag with METHOD\x3dAES-128 which is not at the beginning of the playlist , which is not supported.",vB="SAMPLE-AES-CTR",wB="application/vnd.apple.mpegurl",xB="sample",yB="whole-segment",zB=function(a,b){return _.eh(a,b,void 0,{required:!0})},AB=function(a){if(1>a.a)throw _.Ik();--a.a},BB=function(a,b,c,d){if(1===b){if(!d||0===d.length)throw new _.L(_.M,4,4043,"Media playlist must have at least one segment!");if(null==d[0].a)throw new _.L(_.M,4,4043,"Media playlist must have at least one full segment!");
4
+ }this.f=a;this.a="";this.type=b;this.aa=c;this.U=1===b?d:null},CB=function(a,b,c){c=void 0===c?[]:c;this.aa=b;this.a=a;this.f=c},DB=function(a,b,c,d,e,f,g,h,l,m,n,p,q,r){r=void 0===r?[]:r;_.Qv.call(this,a,b,c,d,e,f,g,void 0===h?null:h,void 0===l?!1:l,void 0===m?null:m,void 0===n?null:n,void 0===p?null:p,void 0===q?null:q,r);this.initSegment=void 0;this.Lb=0},EB=function(a){if(null!==a&&void 0!==a)return Number(a)},FB=function(){this.a=0},IB=function(a,b,c){var d=[],e=[],f=[],g=[];c.forEach(function(h){/^(#EXT)/.test(h)?
5
+ (h=_.Uh(a.a++,h),GB.includes(h.name)?d.push(h):HB.includes(h.name)?"EXT-X-PART"===h.name?g.push(h):h.name===mB&&"PART"===_.eh(h,"TYPE")&&g.push(h):f.push(h)):W.Le(h)||(h=W.dd(b,h.trim()),e.push(new CB(h,f,g)),f=[],g=[])});0<g.length&&e.push(new CB(null,f,g));return{U:e,aa:d}},JB=function(a){var b=void 0===b?0:b;return 0>a?[]:Array.from({length:a},function(c,d){return d+b})},KB=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
+ 6]&&128>a[b+7]&&128>a[b+8]&&128>a[b+9]?!0:!1},LB=function(){this.f=new Map;this.a=new Map},MB=function(a){function b(l,m,n){for(var p="";m<n;m++)p+="%"+("00"+l[m].toString(16)).slice(-2);return p}function c(l){return l[0]<<21|l[1]<<14|l[2]<<7|l[3]}function d(){throw new _.L(_.M,4,4030);}KB(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===
7
+ 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}}KB(a,e)||d();e+=10;e+=f}while(e<a.byteLength);return d()},NB=function(a,b){var c=null,d=0;try{(new _.Pk).L(_.Gd,_.Qk).L(_.Ge,_.Qk).L(_.Ad,_.Qk).W("mdhd",function(g){g.reader.skip(0==g.version?8:16);d=_.T(g.reader);g.parser.stop()}).parse(b,!0)}catch(g){c=g}if(c||!d)throw _.Tq.error("Unable to find timescale in init segment!"),
8
+ new _.L(_.M,4,4030,cB,c);var e=0,f=!1;try{(new _.Pk).L("moof",_.Qk).L("traf",_.Qk).W("tfdt",function(g){e=(0==g.version?_.T(g.reader):_.Nk(g.reader))/d;f=!0;g.parser.stop()}).parse(a,!0)}catch(g){c=g}if(c||!f)throw new _.L(_.M,4,4030,cB,c);return e},OB=function(a){for(;a.getPosition()<a.Ca()-1;){var b=a.getPosition();if(71===_.Jk(a))return AB(a),b}return-1},PB=function(a){function b(){d.seek(e+188);f=_.Jk(d);71!=f&&(d.seek(e+192),f=_.Jk(d));71!=f&&(d.seek(e+204),f=_.Jk(d));71!=f&&c();AB(d)}function c(){throw new _.L(_.M,
9
+ 4,4030);}var d=new _.Gk(new DataView(a),!1),e=0,f=0;e=OB(d);0>e&&(_.Tq.error("Unable to find sync byte in TS after scanning."),c());for(;;)if(e=d.getPosition(),f=_.Jk(d),71!=f&&c(),a=_.Kk(d),8191===(a&8191))b();else if(a&16384)if(a=(_.Jk(d)&48)>>4,0!=a&&2!=a||c(),3==a&&(a=_.Jk(d),d.skip(a)),1!=_.T(d)>>8)b();else{d.skip(3);a=_.Jk(d)>>6;0!=a&&1!=a||c();0==_.Jk(d)&&c();a=_.Jk(d);var g=_.Kk(d),h=_.Kk(d);return(1073741824*((a&14)>>1)+((g&65534)<<14|(h&65534)>>1))/9E4}else b()},SB=function(a){var b=zB(a,
10
+ sB);if(!QB.includes(b))return RB.error("PlayReady in HLS is only supported with [",QB.join(", "),"], not",b),null;a=zB(a,_.wb);b=_.aq(a);a=null;b=_.N(b.data);try{a=_.Ev(_.Pl(b))}catch(c){a=b}return _.Ov(_.Tc,[{initDataType:_.Dc,initData:a}],"")},TB=function(a){this.h=new _.H("clpp.hls.MediaReader");this.f=a;this.a={attemptParameters:_.Wh()}},VB=function(a,b,c,d,e,f){var g,h,l,m,n,p,q,r;return _.B(function(v){switch(v.a){case 1:a.h.debug("Fetching segment to find start time");if("audio/mpeg"===d||
11
+ d===_.qc||d===_.pc)return v["return"](0);g=f;if(d!==_.nc){v.G(2);break}return _.x(v,UB(a,c,g),3);case 3:return h=v.f,l=_.N(h.data),KB(l)?v["return"](MB(l)):v["return"](PB(h.data));case 2:if(d!==_.Te&&d!==_.rc){v.G(4);break}m=[UB(a,c,g)];b&&m.push(UB(a,b,!0));return _.x(v,Promise.all(m),5);case 5:return n=v.f,p=n[0],q=n[1]||n[0],v["return"](NB(p.data,q.data));case 4:if(d!==_.Se){v.G(6);break}return _.x(v,UB(a,c,g),7);case 7:return r=v.f,v["return"](PB(r.data));case 6:if(!MediaSource.isTypeSupported((d.split("/")[0]||
12
+ "")+'/mp4;codecs\x3d"'+e+'"'))return v["return"](0);throw new _.L(_.M,4,4030);}})},UB=function(a,b,c){var d,e,f,g,h,l,m;return _.B(function(n){switch(n.a){case 1:return d=b.f(),e=_.kw(b.Ka(),b.sa,b.sa+2048-1,a.a.attemptParameters),e.type=2,f=_.kw(b.Ka(),b.sa,b.ea,a.a.attemptParameters),f.type=2,d&&(f.keyInfo=d),_.Af(n,2),g=c?f:e,_.x(n,a.f(g),4);case 4:return h=n.f,n["return"](h);case 2:l=_.Cf(n);if(7001===l.code||c)throw l;a.h.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.",
13
+ e.uris[0]);_.Af(n,5);return _.x(n,a.f(f),7);case 7:return n["return"](n.f);case 5:throw m=_.Cf(n),a.h.error("Failed to fetch media segment to parse its start timestamp.",f.uris[0],m),new _.L(_.M,4,4030,"Failed to fetch the media segment.");}})},WB=function(a){this.ba=a},XB=function(a,b){a.ba.forEach(function(c){c.codecs=b.join(",")})},YB=function(a,b){a.ba.forEach(function(c){c.width=b})},ZB=function(a,b){a.ba.forEach(function(c){c.height=b})},$B=function(a,b){a.ba.forEach(function(c){c.frameRate=
14
+ b})},aC=function(a,b){a.ba.forEach(function(c){c.bandwidth=b})},bC=function(a,b){return a.ba.some(function(c){return c.id===b})},cC=function(a,b){var c=a.ba.find(function(d){d=d.U;return d[0].position<=b&&b<=d[d.length-1].position});return null==c?null:c.U.find(function(d){return d.position===b})||null},dC=function(a,b){var c=a.map(function(d){return d.ba[b]});return c.some(function(d){return null==d})?null:c},eC=function(a){this.a=a},fC=function(a,b){var c=a.map(function(d){return d.a[b]});return c.some(function(d){return null==
15
+ d})?null:c},iC=function(a,b,c,d){var e=a[0].length();e=JB(e).map(function(f){var g=fC(a,f)||[],h=dC(b,f)||[],l=dC(c,f)||[];return gC({variants:g,textStreams:h,thumbStreams:l,zj:d&&0===f})});hC(e);return e},lC=function(a){if(1===a.length)return a[0];var b=a[0],c=a.reduce(function(e,f){return e+f.duration},0),d=new Map;a.forEach(function(e,f){var g=W.qf(e);0<f&&jC(g,e.startTime);g.forEach(function(h){var l=h.nc;d.has(l)?d.get(l).push(h):d.set(l,[h])})});W.Wd(b,function(e){var f=d.get(e.nc),g=f.flatMap(function(h){return h.U});
16
+ f=f.map(function(h){return{keyInfo:h.keyInfo,type:h.Vf,drmInfos:h.drmInfos,keyId:h.keyId}});f=kC.ya(f);e.keyInfo=f.keyInfo;e.Vf=f.type;e.encrypted=f.type===xB;e.drmInfos=f.drmInfos;e.keyId=f.keyId;e.U=g;e.segmentIndex.replace(g)});return Object.assign({},b,{duration:c,endTime:a[0].startTime+c})},gC=function(a){var b=a.variants,c=a.textStreams,d=a.thumbStreams,e=a.zj;a=_.nf(b.flatMap(function(g){return[g.video,g.audio]})).concat(_.nf(c),_.nf(d)).filter(Boolean);var f=a[0].Za;e=e?f:0;jC(a,0);mC(a);
17
+ 0<e&&jC(a,e);a=a[0];f=a.Lb;return{variants:b,textStreams:c,thumbStreams:d,startTime:0,id:"P"+f,endTime:a.pd,duration:a.duration+e,Lb:f}},hC=function(a){for(var b=0;b<a.length;b++){var c=a[b],d=a[b-1];c.startTime=d?d.endTime:0;c.endTime=c.startTime+c.duration}},jC=function(a,b){a.forEach(function(c){var d=-c.Za+b;c.segmentIndex.offset(d);c.pd+=d;c.Za=b})},mC=function(a){var b=nC(a);a.forEach(function(c){_.Dw(c.segmentIndex,b);c.duration=b;c.pd=c.Za+b})},nC=function(a){var b=Infinity;W.Pi(a).forEach(function(c){b=
18
+ Math.min(b,c.duration)});return b},oC=function(){var a=this;this.a=this.C=null;this.I=1;this.f=new LB;this.m="";this.K=new FB;this.H=0;this.A=new Map;this.g=new _.aj(function(){a.Db()});this.j=_.jv;this.D=null;this.o=new _.hi;this.B=null;this.h=new _.H("clpp.hls.HlsParser");this.w=new Map;this.F=new Map;this.M=new TB(this.ue.bind(this));this.J=!1},xC=function(a,b,c,d){var e,f,g,h,l,m,n,p,q,r,v;return _.B(function(y){if(1==y.a)return e=pC,f=b.ba[0],g=qC(a,f),_.x(y,rC(a,g.toString()),2);if(3!=y.a){h=
19
+ y.f;l=h.response;m=h.text;n=sC(a,m,l.uri,f.nc);tC(n,f.codecs,f.type);if(1!==n.type)throw new _.L(_.M,4,4017);return _.x(y,uC(a,n,f.type,f.codecs),3)}p=y.f;q=p.flatMap(function(A){return A.U});f.U=q;f.segmentIndex.replace(q);_.pw(c,q,d);r=q[q.length-1];if(v=W.Sa(n.aa,gB))a.j=e.VOD,vC(a)&&a.g.stop(),_.mw(c,!0),c.f=r.endTime;_.z(y)})},qC=function(a,b){var c=new _.Lg(b.kh);if(a.a.hlsLowLatency){var d=c.a;if(b.Dd){var e=b.segmentIndex;if(e=e.a[e.a.length-1]){var f=e.a,g=f.length-1;e={Ej:e.position,Gk:f&&
20
+ 0<f.length?g:null}}else e=null;f=e;e=f.Ej;f=f.Gk;null!==e&&(d.add("_HLS_msn",e),null!==f&&d.add("_HLS_part",f))}_.Wg(d);d.g&&_.Og(c,d)}return c},WC=function(a,b){var c,d,e,f,g,h,l,m,n,p,q;return _.B(function(r){if(1==r.a){c=_.xn;d=W;e=sC(a,b,a.m,"");if(1===e.type){a.w.set(a.m,e);f=e.U[0].a;var v=_.Zg(f)||"";g=null!=_.$g.video[v]?_.Re:null!=_.$g.audio[v]?_.lc:null;h="";g===c.VIDEO?h="avc1.42E01E":g===c.AUDIO&&(h="mp4a.40.2");v=a.K;var y=a.m,A=a.a.hlsDefaultCodecs||h,E=[],F=[];F.push(new _.fh(_.la,
21
+ "0"));F.push(new _.fh(_.wb,y));A.length&&F.push(new _.fh(_.na,A));E.push(new _.dh(v.a++,oB,F));e=new BB(y,0,E)}l=W.Ck(e.aa);return _.x(r,yC(a,l),2)}m=r.f;if(!a.C)throw new _.L(_.M,7,7001);n=d.gj(m[0]);p=UC(a,n.delay,m);if(!vC(a)){a.H=n.vd;A=0;y=_.u(a.f.values());for(v=y.next();!v.done;v=y.next())A=Math.max(A,v.value.ba[0].Za);for(y=0;95443.7176888889<=A;)y+=95443.7176888889,A-=95443.7176888889;if(y)for(a.h.debug("Offsetting live streams by",y,"to compensate for rollover"),A=_.u(a.f.values()),v=A.next();!v.done;v=
22
+ A.next())v=v.value.ba[0],95443.7176888889>v.Za?(a.h.debug("Offset applied to",v.type),v.segmentIndex.offset(y)):a.h.debug("Offset NOT applied to",v.type)}v=W.ij(m);"LIVE"===a.j||"EVENT"===a.j?(v=Math.max(v,p.F),isNaN(a.a.availabilityWindowOverride)||(v=a.a.availabilityWindowOverride),p.m=v):a.j===_.jv&&VC(p,v,m);q={presentationTimeline:p,periods:m,offlineSessionIds:[],minBufferTime:0};a.h.debug("HLS playlist parsed",q);return r["return"](q)})},yC=function(a,b){var c,d,e,f,g,h,l;return _.B(function(m){switch(m.a){case 1:c=
23
+ W.yk(b.Nc.closedCaptions);for(var n=new Map,p=_.u(b.bh),q=p.next();!q.done;q=p.next()){var r=q.value,v=_.eh(r,"AUDIO");q=_.eh(r,_.Db);var y=_.eh(r,"SUBTITLES");r=XC(a,r);if(y){var A=_.Yg(_.Ce,r);n.set(y,A);y=r.indexOf(A);-1<y&&r.splice(y,1)}v&&(y=YC(_.lc,r),n.set(v,y));q&&(v=YC(_.Re,r),n.set(q,v))}d=n;return _.x(m,ZC(a,b.Nc.oh,d),2);case 2:return e=m.f,_.x(m,$C(a,b.bh,e,c),3);case 3:return f=m.f,_.x(m,aD(a,b.Nc.Zk,d),4);case 4:return g=m.f,_.x(m,bD(a,b.pj),5);case 5:return h=m.f,l=iC(f,g,h,!vC(a)),
24
+ l=[lC(l)],a.C.filterAllPeriods(l),m["return"](l)}})},aD=function(a,b,c){return Promise.all(b.map(function(d){return cD(a,d,c)}))},bD=function(a,b){return Promise.all(b.map(function(c){return dD(a,c)}))},ZC=function(a,b,c){var d,e,f;return _.B(function(g){if(1==g.a){d=b.filter(function(h){return""!==(_.eh(h,_.wb)||"")});if(0===d.length)return g["return"](new Map);e=[cD(a,d[0],c)];return _.x(g,e[0],2)}if(3!=g.a)return e=e.concat(d.slice(1).map(function(h){return cD(a,h,c)})),_.x(g,Promise.all(e),3);
25
+ f=g.f;return g["return"](W.al(f))})},$C=function(a,b,c,d){var e,f,g,h,l,m,n,p,q,r,v;return _.B(function(y){if(1==y.a){e=new Set;f=_.nf(b).concat();g=0;h=Infinity;for(l=0;l<f.length;++l)m=Number(zB(f[l],_.la)),m<h&&(h=m,g=l);n=f.splice(g,1).pop();return _.x(y,eD(a,n,c,d,e),2)}if(3!=y.a)return p=y.f,q=f.map(function(A){return eD(a,A,c,d,e)}),_.x(y,Promise.all(q),3);r=y.f;r.splice(g,0,p);v=r.reduce(_.Lv,[]);return y["return"](v)})},eD=function(a,b,c,d,e){var f,g,h,l;return _.B(function(m){return 1==
26
+ m.a?(f=W,g=Number(zB(b,_.la)),h=f.Fk(b),_.x(m,fD(a,b,h,c,d),2)):(l=m.f)?m["return"](gD(a,l,g,e)):m["return"]([])})},fD=function(a,b,c,d,e){var f,g,h,l,m,n,p,q,r,v,y,A,E,F;return _.B(function(D){if(1==D.a)return f=_.xn,g=XC(a,b),h=_.eh(b,"AUDIO"),l=_.eh(b,_.Db),n=(m=h||l)&&d.has(m)?d.get(m):[],p={audio:h?n:[],video:l?n:[]},a.h.debug("Guessing stream type for",b.toString()),r=!1,v=zB(b,_.wb),y=p.audio.find(function(J){return J.nc===v}),A=_.Yg(f.VIDEO,g),E=c||A,1!==g.length||E?!n.length&&1<g.length?
27
+ (a.h.debug("Guessing multiplexed audio+video"),q=f.VIDEO,g=[g.join(",")]):p.audio.length&&y?(a.h.debug(rB),q=f.AUDIO,r=!0):p.video.length?(a.h.debug(rB),q=f.AUDIO):(a.h.debug("Guessing video-only"),q=f.VIDEO):(q=f.AUDIO,a.h.debug(rB)),F=null,r?D.G(2):_.x(D,hD(a,b,g,q,e,c),3);2!=D.a&&(F=D.f);if(null==F)return D["return"](null);p[q]=[F];q===f.AUDIO&&c&&n.forEach(function(J){YB(J,c.width);ZB(J,c.height);$B(J,c.frameRate)});W.Ni(p);return D["return"](p)})},gD=function(a,b,c,d){var e=b.video,f=b.audio;
28
+ e=0<e.length?e:[null];b=[];f=_.u(0<f.length?f:[null]);for(var g=f.next();!g.done;g=f.next()){g=g.value;for(var h=_.u(e),l=h.next();!l.done;l=h.next()){var m=l.value;l=W.Li(g,m);if(d.has(l))a.h.debug("Skipping variant which only differs in text streams.");else{a:{for(var n=a,p=c,q=[],r=(m||g).length(),v=0;v<r;v++){var y=g?g.ba[v]||null:null,A=m?m.ba[v]||null:null,E=W.aj(y,A);if(!E){m=null;break a}var F=p;E={id:n.I++,language:y?y.language:_.Ie,primary:!!y&&y.primary||!!A&&A.primary,audio:y,video:A,
29
+ bandwidth:F,drmInfos:E,allowedByApplication:!0,allowedByKeySystem:!0};q.push(E)}m=new eC(q)}null==m?a.h.warn("Incompatible DRM info in HLS variant. Skipping."):(b.push(m),d.add(l))}}}return b},cD=function(a,b,c){var d;return _.B(function(e){d=zB(b,_.wb);return e["return"](iD(a,d,function(){var f,g,h,l,m,n,p,q,r,v,y,A;return _.B(function(E){if(1==E.a)return f=_.xn,g=zB(b,_.La),h=W.Hi(zB(b,"TYPE")),l=c.get(g)||"",m=W.Fe(b),n=_.eh(b,"NAME"),p=b.getAttribute("DEFAULT"),q=b.getAttribute("AUTOSELECT"),
30
+ r=_.eh(b,"CHANNELS"),v=h===f.AUDIO?r?parseInt(r.split("/")[0],10):null:null,y=!!p&&!!q,_.x(E,jD(a,{uri:d,codecs:l,type:h,language:m,primary:y,name:n,channelsCount:v,groupId:g,closedCaptions:null,xf:null}),2);A=E.f;return E["return"](A)})}))})},dD=function(a,b){var c;return _.B(function(d){c=zB(b,_.wb);return d["return"](iD(a,c,function(){var e,f,g,h,l;return _.B(function(m){if(1==m.a)return e=_.eh(b,_.na)||"jpg",f=W.Fe(b),g=_.eh(b,"NAME"),_.x(m,jD(a,{uri:c,codecs:e,type:_.od,language:f,name:g,primary:!1,
31
+ channelsCount:null,closedCaptions:null,groupId:null,xf:null}),2);h=m.f;(l=_.eh(b,_.la))&&aC(h,Number(l));return m["return"](h)})}))})},XC=function(a,b){var c=_.eh(b,_.na,a.a.hlsDefaultCodecs||"avc1.42E01E,mp4a.40.2").split(/\s*,\s*/),d=new Set,e=[];c=_.u(c);for(var f=c.next();!f.done;f=c.next()){f=f.value;var g=_.Zv(f)[0];d.has(g)?a.h.debug("Ignoring duplicate codec"):(e.push(f),d.add(g))}return e},hD=function(a,b,c,d,e,f){var g,h;return _.B(function(l){g=_.xn;h=zB(b,_.wb);return l["return"](iD(a,
32
+ h,function(){var m,n,p,q;return _.B(function(r){if(1==r.a)return m=_.eh(b,bB),n=null,d===g.VIDEO&&m&&"NONE"!==m&&(n=e.get(m)),p=YC(d,c),_.x(r,jD(a,{uri:h,codecs:p,type:d,closedCaptions:n,primary:!1,language:null,name:null,channelsCount:null,groupId:null,xf:f}),2);q=r.f;return r["return"](q)})}))})},iD=function(a,b,c){if(a.f.has(b))return a=a.f.get(b),Promise.resolve(a);if(a.f.a.has(b))return a.f.a.get(b)||null;c=c();a.f.set(b,c);return c},jD=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,r,v,y,A,E,F,D,J,
33
+ ja,P,Na,pa,ta,Fa,Ka,wa,Aa;return _.B(function(Ba){switch(Ba.a){case 1:c=kD;d=_.aB;e=_.xn;f=W;g=b;h=g.uri;l=g.codecs;m=g.type;n=g.language;p=g.groupId;q=g.primary;r=g.name;v=g.channelsCount;y=g.closedCaptions;A=g.xf;E=W.dd(a.m,h);if(vC(a)&&a.w.has(E)){F=a.w.get(E);a.w["delete"](E);Ba.G(2);break}return _.x(Ba,rC(a,E),3);case 3:D=Ba.f,J=D.response,ja=D.text,E=J.uri,F=sC(a,ja,E,h),tC(F,l,m);case 2:if(1!==F.type)throw new _.L(_.M,4,4017);P=W.Dk(F.aa);a.j=P;vC(a)&&a.g.stop();Na=W.Bk(F.aa,P,a.a.hlsLowLatency||
34
+ !1);return _.x(Ba,uC(a,F,m,l),4);case 4:return pa=Ba.f,ta=a.a.hlsLowLatency?d.pl:d.ql,Fa=void 0,m===e.TEXT&&(Fa=_.ye),Ka=f.Mg(F.aa),wa=Ka.Dd,Aa=pa.map(function(gb){var Ab=gb.U,qb=gb.Oi,ff=gb.mimeType;gb=gb.Lb;var Ri=Ab[0].startTime,Si=Ab[Ab.length-1].endTime,Ti=Si-Ri,Eb=new _.zw(Ab),mc=Ab[0].initSegment||null;return{id:a.I++,originalId:r,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:Eb.Dc.bind(Eb),getSegmentReference:Eb.get.bind(Eb),adjustSegmentDurations:Eb.Vc.bind(Eb),getDuration:Eb.getDuration.bind(Eb),
35
+ segmentIndex:Eb,segmentLookupStrategy:ta,initSegmentReference:mc,mimeType:ff,codecs:l,kind:Fa,Vf:qb.type,encrypted:qb.type===c.hh,keyId:qb.keyId,language:n||_.Ie,label:r,type:m,primary:q,trickModeVideo:null,emsgSchemeIdUris:null,frameRate:A?A.frameRate:void 0,width:A?A.width:void 0,height:A?A.height:void 0,bandwidth:void 0,roles:[],channelsCount:v,closedCaptions:y,keyInfo:qb.keyInfo,U:Ab,drmInfos:qb.drmInfos,Lb:gb,nc:h,kh:E,Za:Ri,pd:Si,duration:Ti,Dd:wa,groupId:p,Bj:Na}}),Ba["return"](new WB(Aa))}})},
36
+ sC=function(a,b,c,d){a:{a=a.K;b=b.trim().split(/\n+/m);if(!/^#EXTM3U($|[ \t\n])/m.test(b[0]))throw new _.L(_.M,4,4015);var e=0;for(var f=!0,g=_.u(b),h=g.next();!h.done;h=g.next())if(h=h.value,h=h.trim(),!h.length||W.Le(h)||f)f=!1;else if(h=_.Uh(0,h),GB.includes(h.name)){e=1;break}else h.name===oB&&(f=!0);f=[];g=!0;h=_.u(_.$A(b));for(var l=h.next();!l.done;l=h.next()){var m=l.value;l=m.Je;var n=m.item;m=m.next;n=n.trim();if(!n.length||W.Le(n)||g)g=!1;else{n=_.Uh(a.a++,n);if(lD.includes(n.name)){if(1!==
37
+ e)throw new _.L(_.M,4,4017);b=b.splice(l,b.length-l);a=IB(a,c,b);c=new BB(c,e,f.concat(a.aa),a.U);break a}f.push(n);n.name===oB&&(n.attributes.push(new _.fh(_.wb,m)),g=!0)}}c=new BB(c,e,f)}c.a=d;mD(c);return c},mD=function(a){1===a.type&&a.U.slice(1).forEach(function(b){if(W.Ie(b.aa,iB))throw new _.L(_.M,4,4045,"Media playlist contains one or more EXT-X-MAP tags that are not located at the beginning of the playlist. This is valid, but not yet supported.");})},tC=function(a,b,c){if(1===a.type&&(a=
38
+ a.U.map(function(d){return d.a?d.a:d.f.map(function(e){return _.eh(e,_.wb)})||null}).map(function(d){return _.ah(d,c,b)}),1<(new Set(a)).size))throw new _.L(_.M,4,4045,"Media playlist contains discontinuities with different MIME types. This is valid, but not yet supported.");},UC=function(a,b,c){var d=!0,e=null,f=0;vC(a)||(d=!1,e=0,f=b);var g=new _.lw(e,f,!0);_.mw(g,d);W.Wd(c,function(h,l){_.pw(g,h.U,l.startTime)});return g},nD=function(a,b,c){a=W.Ic(a.aa,iB);if(1<a.length)throw new _.L(_.M,4,4020);
39
+ a=a[0];if(!a)return null;var d=zB(a,_.wb),e=W.dd(b,d);b=W.Jg(a,null,!0);return new _.Pv(function(){return[e]},b.sa,b.ea,c)},oD=function(a,b,c,d,e,f,g){var h=[],l={};b=_.u(_.$A(b.f));for(var m=b.next();!m.done;l={ce:l.ce},m=b.next()){var n=m.value;m=n.Je;n=n.item;var p=0===m,q=p?a:h[h.length-1],r=p?d:q.endTime,v=Number(_.eh(n,"DURATION"));v=r+v;p=W.Jg(n,p?null:q.ea,p);q=_.eh(n,_.wb);q=W.dd(g,q);l.ce=q?[q]:[];r=new DB(c,r,v,function(y){return function(){return y.ce}}(l),p.sa,p.ea,e,f,!1,null,null,null,
40
+ null);if("YES"===_.eh(n,"INDEPENDENT")||0===m)r.g=!0;h.push(r)}return h},pD=function(a,b,c,d,e,f,g,h,l,m,n){var p=c.aa,q=c.a,r=null!=q,v=q?[q]:[];if(!r&&!a.a.hlsLowLatency)return null;a=0;q={sa:0,ea:null};var y=null;r?(c=W.Ak(p).duration,a=e+c,q=W.Kg(p,b?b.ea:null)):(b=oD(b,c,d,e,f,g,l),a=b[b.length-1].endTime,y=b);h=h===_.od?W.Ek(p):null;d=new DB(d,e,a,function(){return v},q.sa,q.ea,f,g,!1,null,h?h.fg:null,h?h.ah:null,h?h.durationPerTile:null,y);d.Lb=m;d.initSegment=n||void 0;return d},uC=function(a,
41
+ b,c,d){var e,f,g,h,l,m,n,p,q,r,v,y,A,E;return _.B(function(F){switch(F.a){case 1:e=W;f=qD;g=b.a;h=b.U;l=e.ej(b.aa,jB);m=[];var D=a.f.get(b.a);n=qD.cj(b,D,!vC(a));return _.x(F,rD(a,b.f,g,h,l,c,d),2);case 2:p=F.f,q=l,r=f.Xk(h),v=0;case 3:if(!(v<r.length)){F.G(5);break}y=r[v];A=m[m.length-1]||null;return _.x(F,sD(a,g,b.f,y,n+v,q,p,c,d,A),6);case 6:E=F.f;m.push(E);p=E.endTime;q+=y.length;v++;F.G(3);break;case 5:return F["return"](m)}})},rD=function(a,b,c,d,e,f,g){var h,l,m,n,p,q;return _.B(function(r){if(1==
42
+ r.a)return h=d[0],null!=a.B?r["return"](a.B):_.x(r,tD(a,f,g,h),2);if(3!=r.a)return l=r.f,m=kC.Lg([h],a.m,l,null)[0],n=nD(h,b,m.keyInfo),p=W.De(m.keyInfo,e),_.x(r,uD(a,c,n,h,e,p,l,g),3);q=r.f;a.h.debug("Setting playlist start time to "+q+".");a.B=q;return r["return"](q)})},sD=function(a,b,c,d,e,f,g,h,l,m){var n,p,q,r,v,y,A,E,F,D,J,ja,P,Na,pa,ta,Fa,Ka,wa,Aa;return _.B(function(Ba){switch(Ba.a){case 1:return n=W,p=kC,q=d[0],r=null==m,_.x(Ba,tD(a,h,l,q),2);case 2:v=Ba.f;y=p.Lg(d,a.m,v,m?m.Aj:null);A=
43
+ y[y.length-1];E=kC.ya(y);F=nD(q,c,E.keyInfo)||(m?m.rj:null);D=W.De(E.keyInfo,f);if(r&&vC(a)){J=0;Ba.G(3);break}return _.x(Ba,vD(a,e,b,F,q,f,D,v,l,g),4);case 4:J=Ba.f;case 3:ja=J;P=[];for(Na=0;Na<d.length;Na++)pa=d[Na],ta=P[P.length-1]||null,Fa=0===Na?g:ta.endTime,Ka=f+Na,wa=n.De(E.keyInfo,Ka),(Aa=pD(a,ta,pa,Ka,Fa,ja,wa,h,c,e,F))&&P.push(Aa);return Ba["return"]({U:P,Oi:E,Aj:A,mimeType:v,endTime:P[P.length-1].endTime,Lb:e,rj:F})}})},vD=function(a,b,c,d,e,f,g,h,l,m){var n,p;return _.B(function(q){if(1==
44
+ q.a)return n=0,a.F.has(b)?(n=a.F.get(b),q.G(2)):_.x(q,uD(a,c,d,e,f,g,h,l),3);2!=q.a&&(p=q.f,n=p-m,a.h.debug("Segment #"+f+" has timestamp offset "+(n+" s")),a.F.set(b,n));return q["return"](n)})},uD=function(a,b,c,d,e,f,g,h){var l,m;return _.B(function(n){if(null==d.a)return n["return"](0);var p;p=(p=a.f.get(b))?(p=cC(p,e))?p.startTime:null:null;l=p;if(null!=l)return a.h.debug("Found segment start time in previous manifest"),n["return"](l);a.h.debug("Unable to find segment start time in previous manifest!");
45
+ m=W.Ki(d,f);return n["return"](VB(a.M,c,m,g,h,null!=f))})},YC=function(a,b){if(1===b.length)return b[0];var c=_.Yg(a,b);if(null!=c)return c;throw new _.L(_.M,4,4025,{codecList:b});},tD=function(a,b,c,d){var e,f,g;return _.B(function(h){e=d.a;g=(f=W.Sa(d.aa,iB))?zB(f,_.wb):null;return h["return"](wD(a,b,c,e,g))})},wD=function(a,b,c,d,e){var f,g,h,l,m;return _.B(function(n){if(1==n.a){f=[d,e].filter(Boolean);if(g=_.bh(f,b,c))return n["return"](g);h=_.Zh([d],a.a.attemptParameters);h.method="HEAD";h.type=
46
+ 2;return _.x(n,a.ue(h),2)}l=n.f;m=l.headers["content-type"];if(!m)throw new _.L(_.M,4,4021,f.join(", "));return n["return"](m.split(";")[0])})},VC=function(a,b,c){a.f=b;b=c[0];var d=W.dg(b);a.offset(-d.Za);W.Wd(b,function(e){e.segmentIndex.offset(-d.Za);_.Dw(e.segmentIndex,d.duration)})},rC=function(a,b){var c,d,e;return _.B(function(f){if(1==f.a)return c=_.Zh([b],a.a.attemptParameters),c.type=1,_.x(f,a.ue(c),2);d=f.f;e="";try{e=_.wh(d.data)}catch(g){throw new _.L(_.M,4,4042);}e=e.replace(/\r\n|\r(?=[^\n]|$)/gm,
47
+ "\n");e=e.trim();return f["return"]({text:e,response:d})})},vC=function(a){return a.j===_.jv},xD=function(){};_.w(DB,_.Qv);
48
+ var kD={hh:xB,vl:yB,NONE:_.Kd},pC={VOD:_.jv,ml:"EVENT",LIVE:"LIVE"},W={Ic:function(a,b){return a.filter(function(c){return c.name===b})},Ae:function(a,b){var c=Array.isArray(b)?b:[b];return a.filter(function(d){d=zB(d,"TYPE");return c.includes(d)})},Ie:function(a,b){return a.some(function(c){return c.name===b})},Sa:function(a,b,c){c=void 0===c?{}:c;a=a.find(function(d){return d.name===b})||null;if(!a&&c.required)throw new _.L(_.M,4,4024,{missingTag:b});return a},eg:function(a,b){return W.Sa(a,b,{required:!0})},
49
+ ej:function(a,b,c){c=void 0===c?0:c;return(a=W.Sa(a,b))?Number(a.value):c},Hl:function(a,b,c){return a.filter(function(d){var e=d.getAttribute("TYPE");d=d.getAttribute(_.La);return e.value==b&&d.value==c})},Ek:function(a){a=W.Sa(a,"EXT-X-TILES");if(!a)return{fg:1,ah:1,durationPerTile:null};var b=_.eh(a,"LAYOUT")||"1x1";a=(a=_.eh(a,"DURATION"))?Number(a):null;var c=_.u(b.split("x").map(function(d){return parseInt(d,10)}));b=c.next().value;c=c.next().value;return{fg:b,ah:c,durationPerTile:a}},dd:function(a,
50
+ b){return _.Nv([a],[b])[0]},Le:function(a){return/^#(?!EXT)/m.test(a)},Wd:function(a,b){Array.isArray(a)||(a=[a]);a.forEach(function(c){for(var d=_.u(W.qf(c)),e=d.next();!e.done;e=d.next())b(e.value,c)})},qf:function(a){var b=new Set;a.variants.forEach(function(c){c.audio&&b.add(c.audio);c.video&&b.add(c.video)});a.textStreams.forEach(function(c){return b.add(c)});a.thumbStreams.forEach(function(c){return b.add(c)});return Array.from(b)},ph:function(a){return W.qf(a).filter(W.jg)},Dk:function(a){var b=
51
+ W.Sa(a,lB);if(W.Sa(a,gB))return _.jv;if(!b)return"LIVE";if(b.value===_.jv)return _.jv;if("EVENT"===b.value)return"EVENT";throw new _.L(_.M,4,4044,"Invalid EXT-X-PLAYLIST-TYPE value: "+b.value);},Hi:function(a){a={AUDIO:_.lc,VIDEO:_.Re,SUBTITLES:_.Ce,"CLOSED-CAPTIONS":_.Ce}[a.toUpperCase()];if(!a)throw new _.L(_.M,4,4044,"EXT-X-MEDIA tag has an invalid TYPE attribute.");return a},Ig:function(a,b,c){c=void 0===c?!1:c;var d=0,e=null;if(a){d=a.split("@");a=Number(d[0]);if(0>=a)throw new _.L(_.M,4,4044,
52
+ "Byte range length must be positive.");if(d[1]){if(d=Number(d[1]),0>d)throw new _.L(_.M,4,4044,"Byte range start byte must not be negative.");}else{if(c)throw new _.L(_.M,4,4044,"Invalid byte range, offset is required but missing.");if(null==b)throw new _.L(_.M,4,4044,"Invalid byte range, cannot calculate offset based on previous byte ranges.");d=b+1}e=d+a-1}return{sa:d,ea:e}},Kg:function(a,b){var c=W.Sa(a,dB);return W.Ig(c?c.value:null,b)},Ak:function(a){a=W.eg(a,"EXTINF").value.split(",");return{duration:Number(a[0]),
53
+ title:a[1]||null}},Mg:function(a,b){function c(f){return null==f?null:Number(f)}b=void 0===b?{}:b;var d={Dd:!1,sh:!1,th:null,oj:null,Ng:null},e=W.Sa(a,nB,{required:b.Sg});if(!e)return d;d.Dd="YES"===_.eh(e,"CAN-BLOCK-RELOAD");d.sh="YES"===_.eh(e,"CAN-SKIP-DATERANGES");d.th=c(_.eh(e,"CAN-SKIP-UNTIL"));d.oj=c(_.eh(e,"HOLD-BACK"));d.Ng=c(_.eh(e,"PART-HOLD-BACK",void 0,{required:b.Sg}));return d},Jg:function(a,b,c){c=void 0===c?!1:c;a=_.eh(a,"BYTERANGE");return W.Ig(a,b,c)},Ck:function(a){var b=W.Ic(a,
54
+ "EXT-X-MEDIA"),c=W.Ic(a,oB);a=W.Ic(a,"EXT-X-IMAGE-STREAM-INF");return{Nc:{oh:W.Ae(b,["AUDIO",_.Db]),closedCaptions:W.Ae(b,bB),Zk:W.Ae(b,"SUBTITLES")},bh:c,pj:a}},Ki:function(a,b){var c=W.Kg(a.aa,null);return new DB(0,0,0,function(){return[a.a]},c.sa,c.ea,0,b)},De:function(a,b){if(null==a)return null;var c=Object.assign({},a);null==c.iv&&(c.iv=_.Rh(new Uint8Array(12),new Uint8Array([b>>24&255,b>>16&255,b>>8&255,b&255])));return c},kj:function(a){var b=a.U;a=b[0].startTime;b=b[b.length-1].endTime;return{Za:a,
55
+ pd:b,duration:b-a}},dg:function(a){var b=Infinity,c=Infinity;W.ph(a).forEach(function(d){d=W.kj(d);b=Math.min(b,d.Za);c=Math.min(c,d.duration)});return{Za:b,duration:c}},jg:function(a){return a.type===_.lc||a.type===_.Re},Pi:function(a){return a.filter(W.jg)},ij:function(a){return a.map(function(b){return W.dg(b).duration}).reduce(function(b,c){return b+c},0)},aj:function(a,b){return a&&b?_.Wv(a.drmInfos,b.drmInfos)?_.Vv(a.drmInfos,b.drmInfos):null:a?a.drmInfos:b?b.drmInfos:null},Li:function(a,b){return(b?
56
+ b.ba[0].nc:"")+" - "+(a?a.ba[0].nc:"")},Bk:function(a,b,c){if(b===_.jv)return{delay:0,vd:0};b=W.Sa(a,kB);if(c&&b)return c=Number(zB(b,"PART-TARGET")),{delay:W.Mg(a,{Sg:!0}).Ng,vd:c};a=W.eg(a,pB);a=Number(a.value);return{delay:3*a,vd:a}},gj:function(a){var b=[];W.Wd(a,function(c){b.push(c.Bj)});return{delay:Math.max.apply(Math,_.nf(b.map(function(c){return c.delay}))),vd:Math.min.apply(Math,_.nf(b.map(function(c){return c.vd})))}},al:function(a){var b=new Map;a.forEach(function(c){var d=c.ba[0].groupId;
57
+ b.has(d)?(d=b.get(d),d.includes(c)||d.push(c)):b.set(d,[c])});return b},Fe:function(a){a=_.eh(a,"LANGUAGE")||_.Ie;return _.gh(a)},yk:function(a){var b=new Map;a=_.u(a);for(var c=a.next();!c.done;c=a.next()){var d=c.value;c=W.Fe(d);var e=zB(d,_.La);d=zB(d,"INSTREAM-ID");b.has(e)||b.set(e,new Map);b.get(e).set(d,c)}return b},Ni:function(a){a=_.u(a.audio.concat(a.video));for(var b=a.next();!b.done;b=a.next()){b=b.value;var c=b.ba[0].codecs.split(",").filter(function(d){return"mp4a.40.34"!==d});XB(b,
58
+ c)}},Fk:function(a){if(null==a.getAttribute("FRAME-RATE")&&null==a.getAttribute(_.jb))return null;var b=_.eh(a,"FRAME-RATE");a=_.eh(a,_.jb);var c=_.u(a?a.split("x"):[null,null]);a=c.next().value;c=c.next().value;return{frameRate:EB(b),width:EB(a),height:EB(c)}}},lD=["EXTINF",dB,"EXT-X-DATERANGE",eB,hB,iB,"EXT-X-PROGRAM-DATE-TIME"],GB=[fB,gB,"EXT-X-I-FRAMES-ONLY",jB,kB,lB,nB,pB],HB=["EXT-X-PART",mB];_.t=LB.prototype;
59
+ _.t.set=function(a,b){var c=this;this.a.set(a,b);return b.then(function(d){return c.f.set(a,d)})["catch"](function(){}).then(function(){return c.a["delete"](a)})};_.t.has=function(a){return this.f.has(a)};_.t.get=function(a){return this.f.get(a)||null};_.t.values=function(){return Array.from(this.f.values())};_.t.clear=function(){this.a.clear();this.f.clear()};
60
+ var qD={cj:function(a,b,c){var d=W.Sa(a.aa,fB);if(d)return Number(d.value);d=qD.tj(b);if(c&&d)try{return qD.qj(a,b)}catch(e){throw new _.L(_.M,4,4024,"EXT-X-DISCONTINUITY-SEQUENCE tag is required for discontinuous HLS live streams.");}return 0},tj:function(a){return 0<qD.fj(a)},Xk:function(a){if(0===a.length)return[];var b=[],c=[];a=_.u(a);for(var d=a.next();!d.done;d=a.next())d=d.value,W.Ie(d.aa,eB)&&0<c.length&&(b.push(c),c=[]),c.push(d);b.push(c);return b},fj:function(a){if(!a)return 0;a=a.ba[a.ba.length-
61
+ 1].U;return a[a.length-1].Lb},qj:function(a,b){var c=W.Sa(a.aa,jB);if(!c)throw qD.h.error("Failed to infer discontinuity number, because EXT-X-MEDIA-SEQUENCE tag is missing."),Error(qB);c=Number(c.value);var d=cC(b,c);if(!d)throw qD.h.error("Failed to infer discontinuity number, could not find the appropriate segment in the previous playlist (segment position \x3d "+(c+")")),Error(qB);return d.Lb}};qD.h=new _.H("clpp.hls.DiscontinuityUtils");var yD={"com.apple.streamingkeydelivery":function(a,b){if(b===_.Se)throw new _.L(_.M,4,4041);if(zB(a,sB)===vB)throw new _.L(_.M,4,4044,"EXT-X-KEY:METHOD SAMPLE-AES-CTR is not supported in FairPlay.");return _.Ov(_.Sc,[{initDataType:_.oe,initData:new Uint8Array(0)}],"")},"com.microsoft.playready":SB,"urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":SB,"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(a){var b=zB(a,sB);if(!QB.includes(b))return RB.error("Widevine in HLS is only supported with [",
62
+ QB.join(", "),"], not",b),null;b=zB(a,_.wb);b=_.aq(b);b=_.N(b.data);b=_.Ov(_.Uc,[{initDataType:_.Dc,initData:b}],"");if(a=_.eh(a,"KEYID"))b.keyIds=[a.substr(2).toLowerCase()];return b}},QB=["SAMPLE-AES",vB],RB=new _.H("clpp.hls.DrmParser");var kC={Lg:function(a,b,c,d){if(null===d){if(a.slice(1).some(kC.gg))throw new _.L(_.M,4,4046,uB);if((d=kC.df(a[0].aa,b,c))&&d.type===yB){if(0<kC.Nd(a.slice(1)).length)throw new _.L(_.M,4,4046,tB);return[d]}a=kC.Nd(a).map(function(e){return kC.df(e.aa,b,c)});return 0===a.length?[{type:_.Kd,keyInfo:null,drmInfos:[],keyId:null}]:a}if(a.some(kC.gg))throw new _.L(_.M,4,4046,uB);if(d.type===yB){if(0<kC.Nd(a).length)throw new _.L(_.M,4,4046,tB);return[d]}d=d.type===xB?[d]:[];a=kC.Nd(a).map(function(e){return kC.df(e.aa,
63
+ b,c)});return d.concat(a)},ya:function(a){if(0===a.length)return{type:_.Kd,keyInfo:null,drmInfos:[],keyId:null};if(a.some(function(c){return c.type===yB})||a.every(function(c){return c.type===_.Kd}))return a[0];a=a.filter(function(c){return c.type===xB});var b=Array.from((new Set(a.flatMap(function(c){return c.drmInfos}))).values());return{keyInfo:null,keyId:a[a.length-1].keyId,type:xB,drmInfos:b}},gg:function(a){return W.Ic(a.aa,hB).some(function(b){return"AES-128"===_.eh(b,sB)})},Nd:function(a){return a.filter(function(b){return W.Ie(b.aa,
64
+ hB)})},df:function(a,b,c){a=W.Ic(a,hB);if(0===a.length)return null;var d=zB(a[0],sB);if(1===a.length){if("NONE"===d)return{type:_.Kd,keyInfo:null,drmInfos:[],keyId:null};if("AES-128"===d)return a=a[0],d=_.eh(a,"IV",""),{type:yB,keyInfo:{method:"AES-128",url:W.dd(b,zB(a,_.wb)),iv:d?_.Oh((d||"0x").slice(2)):null},drmInfos:[],keyId:null}}b=a.map(function(e){return zB(e,sB)});if(!b.every(function(e){return"SAMPLE-AES"===e})&&!b.every(function(e){return e===vB}))throw kC.h.warn("EXT-X-KEY methods "+b.join(", ")+
65
+ " are incompatible."),new _.L(_.M,4,4044,"Multiple EXT-X-KEY tags with incompatible METHOD values.");b=a.map(function(e){var f=_.eh(e,"KEYFORMAT","identity"),g=yD[f]||null;(e=g?g(e,c):null)||kC.h.warn("Unsupported HLS KEYFORMAT",f);return e}).filter(Boolean);if(0===b.length)throw new _.L(_.M,4,4026);return{keyInfo:null,keyId:b.map(function(e){return e.keyIds}).reduce(function(e,f){return e.concat(f)},[]).reverse()[0]||null,type:xB,drmInfos:b}},Ll:function(){return{type:_.Kd,keyInfo:null,drmInfos:[],
66
+ keyId:null}}};kC.h=new _.H("clpp.hls.EncryptionUtils");WB.prototype.length=function(){return this.ba.length};eC.prototype.length=function(){return this.a.length};_.t=oC.prototype;_.t.configure=function(a){this.a=a;this.M.a=a};_.t.setCurrentVariant=function(a){var b=a.video?a.video.id:null;a=a.audio?a.audio.id:null;this.A.clear();for(var c=_.u(this.f.values()),d=c.next();!d.done;d=c.next())d=d.value,(null!=b&&bC(d,b)||null!=a&&bC(d,a))&&this.A.set(d.ba[0].nc,d)};
67
+ _.t.start=function(a,b){var c=this,d,e,f,g,h;return _.B(function(l){if(1==l.a){if(c.J)throw Error("start() may be called only once!");c.J=!0;c.C=b;return _.x(l,rC(c,a),2)}if(3!=l.a)return d=l.f,e=d.response,f=d.text,c.m=e.uri,_.x(l,WC(c,f),3);g=l.f;c.D=g;h=c.H;0<h&&c.g.Z(h);return l["return"](g)})};_.t.stop=function(){this.g&&(this.g.stop(),this.g=null);var a=[];this.o&&(a.push(this.o.destroy()),this.o=null);this.f.clear();this.A.clear();this.a=this.C=null;this.w.clear();this.D=null;return Promise.all(a)};
68
+ _.t.onExpirationUpdated=function(){};_.t.update=function(){var a=this,b,c,d,e,f,g,h,l;return _.B(function(m){if(1==m.a){b=a.D;if(vC(a)||!b)return m["return"]();c=b.presentationTimeline;d=b.periods[0].startTime;e=[];"LIVE"===a.j&&(a.B=null);f=Array.from(a.f.values());g=Array.from(a.A.values());h=a.a.hlsLowLatency&&0<g.length?g:f;return _.x(m,xC(a,h[0],c,d),2)}for(l=1;l<h.length;l++)e.push(xC(a,h[l],c,d));return _.x(m,Promise.all(e),0)})};
69
+ _.t.Db=function(){var a=this,b,c,d;return _.B(function(e){if(1==e.a){a.h.debug(_.iv);if(!a.C)return e["return"]();_.Af(e,2);return _.x(e,a.update(),4)}if(2!=e.a)return b=a.H,a.g.Z(b),_.Bf(e,0);c=_.Cf(e);a.C&&(a.C.onError(c),d=c,1===d.severity&&a.g.Z(.1));_.z(e)})};_.t.ue=function(a){if(!this.o)throw new _.L(_.M,7,7001);a=this.C.networkingEngine.fetch(a);_.ii(this.o,a);return a.O};_.w(xD,_.Ko);xD.prototype.Ma=function(){_.Hp.m3u8=oC;_.Fp[_.Lj]=oC;_.Fp[wB]=oC};xD.prototype.Fa=function(){_.Iw("m3u8");_.Jw(_.Lj);_.Jw(wB)};xD.prototype.id=function(){return"hls"};_.C("clpp.hls.HlsComponent",xD);};
51
70
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
52
71
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
53
72
  else{_=this.clpp._;(f.call(g,this));}
@@ -1,10 +1,10 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var fK=function(a){this.startTime=a.startTime;this.endTime=a.endTime;this.a=this.f=null;a=a.value;if(!_.K.R(a)){a:{var b=a.info;if(_.K.Y(b)&&(b=b.toLowerCase().match(/lang:(\w+)/))&&b[1]){b=b[1].toLowerCase();break a}b=null}this.f=b;a=a.data;this.a=_.K.Y(a)?a:null}},hK=function(a,b,c){this.l=a;this.m=b;this.j=c;this.a=new _.eg;this.h=(a=_.aq[_.hc]||null)?new a(this.l.getConfiguration()):null;this.f=new _.H("clpp.hlssmpte.ImageCueHandler");this.g=null;gK(this)},gK=function(a){a.a.one(a.l,_.wd,function(){return iK(a)})},
3
- iK=function(a){var b=a.l.getSurface().getMedia();if(b)if(a.h){a.a.on(b.textTracks,_.Wb,function(d){return jK(a,d)});var c=Array.from(b.textTracks);c.filter(function(d){return d.kind===_.Cd}).forEach(function(d){jK(a,{track:d})});!kK(c)&&a.m&&(a.f.warn("The metadata track is not present. Changing an audio track in order to enforce the creation of the metadata track."),lK(a,b))}else a.f.warn("The clpp.ttml.TextParser class is not available. Please register the ttml component first.");else a.f.warn("A video element is not available. Skipping.")},
4
- kK=function(a){return a.some(function(b){return b.kind===_.Cd})},lK=function(a,b){var c=a.l.getTrackManager(),d=c.na(),e=c.getAudioTracks().find(function(g){return g!==d});if(e){var f=function(){return c.sa(d)};a.a.on(b.textTracks,_.Wb,function(g){g.track.kind===_.Cd&&(a.a.off(b.textTracks,_.Wb,f),f())});c.sa(e)}else a.f.warn("Can't enforce the creation of the metadata track if single audio track. Skipping.")},jK=function(a,b){var c=b.track;c.kind===_.Cd&&(a.f.info("The metadata track has been added."),
5
- c.mode=_.nd,a.a.on(c,_.Wc,function(d){return mK(a,d)}))},mK=function(a,b){var c=nK(a);c&&Array.from(b.target.activeCues||[]).forEach(function(d){if(d!==a.g&&Number.isFinite(d.startTime)&&Number.isFinite(d.endTime)&&"org.id3"===d.type&&d.value&&"TXXX"===d.value.key){var e=new fK(d);if(e.f===c&&null!==e.a){a.g=d;d=a.h.parseMedia(_.zh(e.a),{periodStart:a.j,segmentStart:e.startTime,segmentEnd:e.endTime});var f=a.l.getTextDisplayer();f.remove(0,e.startTime);f.append(d.cues,d.styles)}}})},nK=function(a){return(a=
6
- a.l.getTrackManager().oa())&&a.language&&a.language.toLowerCase()},oK=function(){this.a=null;this.f=!1},pK=function(){};hK.prototype.destroy=function(){this.a.release();this.g=null;return Promise.resolve()};_.v(oK,_.mq);oK.prototype.onPlayerCreated=function(){};oK.prototype.onContentWillLoad=function(a){if(this.f=_.Zi()){var b=a.getConfiguration();b=_.K.Ma(b.hlssmpte||{});_.K.Of(b.patchMetadataTrack)||(b.patchMetadataTrack=!1);_.K.la(b.timestampOffset)||(b.timestampOffset=0);this.a=new hK(a,b.patchMetadataTrack,b.timestampOffset)}};oK.prototype.onPlayerWillDestroy=function(){var a=this;return _.A(function(b){if(1==b.a)return a.a?_.x(b,a.a.destroy(),3):b.G(0);a.a=null;_.y(b)})};oK.prototype.id=function(){return"hlssmpte"};
7
- _.D("clpp.hlssmpte.HlsSmptePlugin",oK);oK.Id="hlssmpte";pK.prototype.create=function(){return new oK};_.Eo(new pK);};
2
+ var f=function(window){var NK=function(a){this.startTime=a.startTime;this.endTime=a.endTime;this.a=this.f=null;a=a.value;if(!_.K.R(a)){a:{var b=a.info;if(_.K.Y(b)&&(b=b.toLowerCase().match(/lang:(\w+)/))&&b[1]){b=b[1].toLowerCase();break a}b=null}this.f=b;a=a.data;this.a=_.K.Y(a)?a:null}},PK=function(a,b,c){this.l=a;this.m=b;this.j=c;this.a=new _.eg;this.g=(a=_.bq[_.ic]||null)?new a(this.l.getConfiguration()):null;this.h=new _.H("clpp.hlssmpte.ImageCueHandler");this.f=null;OK(this)},OK=function(a){a.a.one(a.l,_.wd,function(){return QK(a)})},
3
+ QK=function(a){var b=a.l.getSurface().getMedia();if(b)if(a.g){a.a.on(b.textTracks,_.Yb,function(d){return RK(a,d)});var c=Array.from(b.textTracks);c.filter(function(d){return d.kind===_.Cd}).forEach(function(d){RK(a,{track:d})});!SK(c)&&a.m&&(a.h.warn("The metadata track is not present. Changing an audio track in order to enforce the creation of the metadata track."),TK(a,b))}else a.h.warn("The clpp.ttml.TextParser class is not available. Please register the ttml component first.");else a.h.warn("A video element is not available. Skipping.")},
4
+ SK=function(a){return a.some(function(b){return b.kind===_.Cd})},TK=function(a,b){var c=a.l.getTrackManager(),d=c.pa(),e=c.getAudioTracks().find(function(g){return g!==d});if(e){var f=function(){return c.va(d)};a.a.on(b.textTracks,_.Yb,function(g){g.track.kind===_.Cd&&(a.a.off(b.textTracks,_.Yb,f),f())});c.va(e)}else a.h.warn("Can't enforce the creation of the metadata track if single audio track. Skipping.")},RK=function(a,b){var c=b.track;c.kind===_.Cd&&(a.h.info("The metadata track has been added."),
5
+ c.mode=_.nd,a.a.on(c,_.Xc,function(d){return UK(a,d)}))},UK=function(a,b){var c=VK(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 NK(d);if(e.f===c&&null!==e.a){a.f=d;d=a.g.parseMedia(_.Ah(e.a),{periodStart:a.j,segmentStart:e.startTime,segmentEnd:e.endTime});var f=a.l.getTextDisplayer();f.remove(0,e.startTime);f.append(d.cues,d.styles)}}})},VK=function(a){return(a=
6
+ a.l.getTrackManager().qa())&&a.language&&a.language.toLowerCase()},WK=function(){this.a=null;this.f=!1},XK=function(){};PK.prototype.destroy=function(){this.a.release();this.f=null;return Promise.resolve()};_.w(WK,_.nq);WK.prototype.onPlayerCreated=function(){};WK.prototype.onContentWillLoad=function(a){if(this.f=_.hj()){var b=a.getConfiguration();b=_.K.Qa(b.hlssmpte||{});_.K.kg(b.patchMetadataTrack)||(b.patchMetadataTrack=!1);_.K.la(b.timestampOffset)||(b.timestampOffset=0);this.a=new PK(a,b.patchMetadataTrack,b.timestampOffset)}};WK.prototype.onPlayerWillDestroy=function(){var a=this;return _.B(function(b){if(1==b.a)return a.a?_.x(b,a.a.destroy(),3):b.G(0);a.a=null;_.z(b)})};WK.prototype.id=function(){return"hlssmpte"};
7
+ _.C("clpp.hlssmpte.HlsSmptePlugin",WK);WK.Id="hlssmpte";XK.prototype.create=function(){return new WK};_.Fo(new XK);};
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));}