@castlabs/prestoplay 6.6.1-beta.2 → 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 +20 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +6 -6
  5. package/cjs/cl.cast.js +110 -110
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +403 -403
  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 +70 -69
  22. package/cjs/cl.thumbnails.js +24 -24
  23. package/cjs/cl.tizen.js +71 -71
  24. package/cjs/cl.ttml.js +27 -27
  25. package/cjs/cl.verimatrix.js +5 -5
  26. package/cjs/cl.vimond.js +13 -13
  27. package/cjs/cl.vr.js +13 -13
  28. package/cjs/cl.vtt.js +11 -11
  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 +345 -343
  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 +227 -227
  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 -58
  50. package/cl.thumbnails.js +17 -17
  51. package/cl.tizen.js +57 -57
  52. package/cl.ttml.js +22 -22
  53. package/cl.verimatrix.js +4 -4
  54. package/cl.vimond.js +8 -8
  55. package/cl.vr.js +15 -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 +118 -12
@@ -1,28 +1,28 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var pK="clpp-freewheel",qK="clpp.freewheel.AdsManagerFactory",rK="freewheel",sK=function(){this.f=this.a=null},tK=function(){},uK=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""}},vK=function(a,b,c){this.g=a;this.f=b;this.a=c},wK=function(a){this.a=a},xK=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 _.Th;this.h=null},yK=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(", ")});},zK=function(){var a,b,c,d;return _.A(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)})},CK=function(a){return _.A(function(b){if(a.A.length)return AK(a),a.f=a.A.shift(),a.f.play(),b.G(0);BK(a);return _.x(b,a.l.a.play(),0)})},DK=function(a){a.w.length?(AK(a),a.f=a.w.shift(),a.f.play()):BK(a)},AK=function(a){var b=a.l.$b(rK).Dc();b&&(a.l.getSurface().show(b),a.l.getSurface().hideMediaElement(),
5
- a.a.registerVideoDisplayBase(pK),a.l.isMuted()?a.setVolume(0):a.setVolume(a.l.getVolume()||1))},BK=function(a){var b=a.l.$b(rK).Dc();b&&a.l.getSurface().hide(b);a.l.getSurface().showMediaElement()},EK=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 vK(a.a,c,d)});a.l.trigger(new _.I(b,d))},FK=function(){this.a=new _.H(qK)};_.v(sK,_.nq);_.t=sK.prototype;
6
- _.t.onPlayerCreated=function(a){if(window.tv&&tv.freewheel&&tv.freewheel.SDK)this.a=_.In(_.Yc,{id:pK}),this.f=_.In(_.Re,{"class":_.Gc}),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 rK};_.t.Dc=function(){return this.a};_.t.fi=function(){return this.f};
7
- _.C("clpp.freewheel.FreeWheelPlugin",sK);sK.prototype.getAdVideo=sK.prototype.fi;sK.prototype.getAdContainer=sK.prototype.Dc;sK.Id=rK;sK.AD_CONTAINER_ID=pK;tK.prototype.create=function(){return new sK};_.Fo(new tK);_.t=vK.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[]};vK.prototype.getWrapperCreativeIds=vK.prototype.getWrapperCreativeIds;vK.prototype.getWrapperAdSystems=vK.prototype.getWrapperAdSystems;vK.prototype.getWrapperAdIds=vK.prototype.getWrapperAdIds;vK.prototype.getSequenceLength=vK.prototype.wb;vK.prototype.getPositionInSequence=vK.prototype.Lb;vK.prototype.getPodTimeOffset=vK.prototype.Kb;vK.prototype.getPodIndex=vK.prototype.getPodIndex;vK.prototype.getPodType=vK.prototype.Ua;
12
- vK.prototype.getMediaBitrate=vK.prototype.gb;vK.prototype.getMediaHeight=vK.prototype.tb;vK.prototype.getMediaWidth=vK.prototype.ub;vK.prototype.getMediaUrl=vK.prototype.getMediaUrl;vK.prototype.getClickThroughUrl=vK.prototype.Jb;vK.prototype.isBumper=vK.prototype.dc;vK.prototype.getSkipTimeOffset=vK.prototype.getSkipTimeOffset;vK.prototype.getDuration=vK.prototype.getDuration;vK.prototype.getTitle=vK.prototype.getTitle;vK.prototype.getAdvertiserName=vK.prototype.getAdvertiserName;
13
- vK.prototype.getAdSystem=vK.prototype.getAdSystem;vK.prototype.getApiFramework=vK.prototype.getApiFramework;vK.prototype.getCreativeId=vK.prototype.getCreativeId;vK.prototype.getId=vK.prototype.getId;vK.prototype.getTechnology=vK.prototype.xb;vK.prototype.getAdManagerVersion=vK.prototype.sb;vK.prototype.getAdManagerName=vK.prototype.rb;wK.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()}})};wK.prototype.Mb=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL).length};wK.prototype.hb=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL).length};
14
- wK.prototype.hasPostroll=wK.prototype.hb;wK.prototype.hasPreroll=wK.prototype.Mb;wK.prototype.getCuePoints=wK.prototype.getCuePoints;_.t=xK.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{yK(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,zK(),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,uK(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,CK(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);BK(a);a.a&&(a.a.dispose(),a.a=null);_.z(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 _.I(_.Xb,{adsTimeline:new wK(this.a)})),this.h=new _.Ap(this.l.getSurface(),function(c,d){return b.a.resize(c,d)},this.l.$b(rK).f);else this.l.onError(new _.L(1,9,10003,{errorType:0},
20
- void 0));this.j.resolve()};_.t.oj=function(a){EK(this,_.Gb,a);this.h.start()};_.t.nj=function(a){this.f=null;a=a.slot;EK(this,_.Hb);this.h.stop();if(a)switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:CK(this);break;case tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL:BK(this);this.l.play();break;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:DK(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:EK(this,_.Tb,a);EK(this,_.Mb,a);break;case tv.freewheel.SDK.EVENT_AD_IMPRESSION_END:EK(this,_.Ub,a);break;case tv.freewheel.SDK.EVENT_AD_FIRST_QUARTILE:EK(this,_.Lb,a);break;case tv.freewheel.SDK.EVENT_AD_MIDPOINT:EK(this,_.Ob,a);break;case tv.freewheel.SDK.EVENT_AD_THIRD_QUARTILE:EK(this,_.Vb,a);break;case tv.freewheel.SDK.EVENT_AD_COMPLETE:EK(this,_.Kb,a);break;case tv.freewheel.SDK.EVENT_AD_CLICK:EK(this,
22
- _.Jb,a);break;case tv.freewheel.SDK.EVENT_AD_PAUSE:EK(this,_.Pb,a);break;case tv.freewheel.SDK.EVENT_AD_RESUME:EK(this,_.Rb,a);break;case tv.freewheel.SDK.EVENT_AD_SKIPPED:EK(this,_.Sb,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_START:EK(this,_.Ib,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_END:EK(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();AK(this);this.f.play()}}};
24
- _.t.mh=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);DK(this);break;case _.Ym:case _.jn:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_STOPPED)}};xK.prototype.getPosition=xK.prototype.getPosition;xK.prototype.setVolume=xK.prototype.setVolume;
25
- xK.prototype.getVolume=xK.prototype.getVolume;xK.prototype.skip=xK.prototype.skip;xK.prototype.pause=xK.prototype.pause;xK.prototype.resume=xK.prototype.resume;xK.prototype.start=xK.prototype.start;FK.prototype.name=function(){return qK};FK.prototype.ba=function(a,b){return a.namespace()===_.Ic?!1:window.tv&&tv.freewheel&&tv.freewheel.SDK?!(!b||!b.freewheel):(this.a.warn("FreeWheel SDK is not loaded."),!1)};FK.prototype.create=function(a){return new xK(a)};FK.prototype.create=FK.prototype.create;FK.prototype.isSupported=FK.prototype.ba;FK.prototype.name=FK.prototype.name;_.Fn(new FK);};
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 _.Ik();--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.type=b;this.pa=c;this.da=1===b?d:null},qB=function(a,b,c){c=void 0===c?[]:c;this.pa=b;this.a=a;this.f=c},rB=function(a,b){return a.filter(function(c){return c.name==b})},
4
- 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 _.Lv([a],[b])[0]},wB=function(){this.a=0},BB=function(a,b,c){var d=b.trim().split(/\n+/m);if(!/^#EXTM3U($|[ \t\n])/m.test(d[0]))throw new _.L(_.M,4,4015);b=0;for(var e=!0,f=_.u(d),g=f.next();!g.done;g=f.next())if(g=g.value,g=g.trim(),!g.length||/^#(?!EXT)/m.test(g)||e)e=!1;
5
- else if(g=xB(a,g),--a.a,yB.includes(g.name)){b=1;break}else g.name===gB&&(e=!0);f=[];e=!0;g=_.u(_.UA(d));for(var h=g.next();!h.done;h=g.next()){var l=h.value;h=l.Jd;var m=l.item;l=l.next;m=m.trim();if(!m.length||/^#(?!EXT)/m.test(m)||e)e=!1;else{m=xB(a,m);if(zB.includes(m.name)){if(1!==b)throw new _.L(_.M,4,4017);d=d.splice(h,d.length-h);a=AB(a,c,d,f);return new pB(c,b,f,a)}f.push(m);m.name===gB&&(m.attributes.push(new _.eh(_.ub,l)),e=!0)}}return new pB(c,b,f)},AB=function(a,b,c,d){var e=[],f=[],
6
- g=[];c.forEach(function(h){/^(#EXT)/.test(h)?(h=xB(a,h),yB.includes(h.name)?d.push(h):CB.includes(h.name)?"EXT-X-PART"===h.name?g.push(h):h.name===eB&&"PART"===_.dh(h,"TYPE")&&g.push(h):f.push(h)):/^#(?!EXT)/m.test(h)||(h=vB(b,h.trim()),e.push(new qB(h,f,g)),f=[],g=[])});g.length&&e.push(new qB(null,f,g));return e},xB=function(a,b){return _.kh(a.a++,b)},DB=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>
7
- a[b+8]&&128>a[b+9]?!0:!1},EB=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);}DB(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"===
8
- 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}}DB(a,e)||d();e+=10;e+=f}while(e<a.byteLength);return d()},FB=function(a,b){var c=null,d=0;try{(new _.Pk).L(_.Fd,_.Qk).L(_.Ge,_.Qk).L(_.Ad,_.Qk).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 _.Tq.error("Unable to find timescale in init segment!"),new _.L(_.M,4,4030,{message:WA,Kg:c&&c.message?
9
- c.message:null},c);var e=0,f=!1;try{(new _.Pk).L("moof",_.Qk).L("traf",_.Qk).V("tfdt",function(g){e=(0==g.version?_.U(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,{message:WA,Kg:c&&c.message?c.message:null},c);return e},GB=function(a){for(;a.getPosition()<a.ya()-1;){var b=a.getPosition();if(71===_.Jk(a))return oB(a),b}return-1},HB=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),
10
- f=_.Jk(d));71!=f&&c();oB(d)}function c(){throw new _.L(_.M,4,4030);}var d=new _.Gk(new DataView(a),!1),e=0,f=0;e=GB(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!=_.U(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)<<
11
- 14|(h&65534)>>1))/9E4}else b()},JB=function(){var a=this;this.g=this.C=null;this.fa=1;this.Z=0;this.o=new Map;this.ca=new Set;this.a=new Map;this.h=null;this.A="";this.P=new wB;this.aa=0;this.U=new Map;this.w=new _.Ti(function(){a.Ab()});this.j=IB;this.J=null;this.D=0;this.F=Infinity;this.B=new _.Xh;this.$=[];this.M=new Map;this.I=!1;this.m=new Map;this.S=null;this.f=new _.H("clpp.hls.HlsParser");this.H=new Map;this.K=new Map},OB=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,r,w,y,B;return _.A(function(E){if(1==
12
- E.a){c=KB;d=b.Dg;e=new _.Lg(d);if(a.g.hlsLowLatency){f=e.a;if(b.Jg){var F=b.segmentIndex;if(F=F.a[F.a.length-1]){var D=F.a,J=D.length-1;F={Ai:F.position,uj:D&&0<D.length?J:null}}else F=null;g=F;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(E,LB(a,e.toString()),2)}if(3!=E.a){m=E.f;n=m.response;p=m.text;q=BB(a.P,p,n.uri);if(1!==q.type)throw new _.L(_.M,4,4017);r=b.stream;return _.x(E,MB(a,b.Rd,q,r.type,r.mimeType,r.codecs,r.keyInfo||null,
13
- b.Xh),3)}w=E.f;r.da=w;b.segmentIndex.replace(w);y=w[w.length-1];if(B=tB(q.pa,$A))NB(a,c.VOD),a.h.Sb(y.endTime);_.z(E)})},RB=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,r,w,y,B,E,F,D,J,O;return _.A(function(S){if(1==S.a){c=BB(a.P,b,a.A);if(1===c.type){a.H.set(a.A,c);d=c.da[0].a;e=_.xn;var Da=_.Zg(d)||"";f=null!=_.$g.video[Da]?_.Re:null!=_.$g.audio[Da]?_.kc:null;g="";f===e.VIDEO?g="avc1.42E01E":f===e.AUDIO&&(g="mp4a.40.2");Da=a.P;var ha=a.A,ka=a.g.hlsDefaultCodecs||g,Aa=[],wa=[];wa.push(new _.eh(_.ma,"0"));
14
- wa.push(new _.eh(_.ub,ha));ka.length&&wa.push(new _.eh(_.oa,ka));Aa.push(new _.ch(Da.a++,gB,wa));c=new pB(ha,0,Aa)}return _.x(S,PB(a,c.pa),2)}h=S.f;if(!a.C)throw new _.L(_.M,7,7001);a.C.filterAllPeriods([h]);l=Infinity;m=0;n=Infinity;p=_.u(a.a.values());for(q=p.next();!q.done;q=p.next())r=q.value,l=Math.min(l,r.De),m=Math.max(m,r.De),r.stream.type!=_.Ce&&(n=Math.min(n,r.duration));a.j!=IB?(a.h=new _.iw(0,a.Z,!1),_.mw(a.h,1)):a.h=new _.iw(null,0,!0);QB(a);if(a.j!=IB){a.aa=a.F;w=KB;a.j===w.LIVE&&(y=
15
- a.h.Pe,B=Math.max(n,y),isNaN(a.g.availabilityWindowOverride)||(B=a.g.availabilityWindowOverride),a.h.gc=B);for(E=0;95443.7176888889<=m;)E+=95443.7176888889,m-=95443.7176888889;if(E)for(a.f.debug("Offsetting live streams by",E,"to compensate for rollover"),F=_.u(a.a.values()),q=F.next();!q.done;q=F.next())D=q.value,95443.7176888889>D.De?(a.f.debug("Offset applied to",D.stream.type),D.segmentIndex.offset(E)):a.f.debug("Offset NOT applied to",D.stream.type)}else for(a.h.Sb(n),a.h.offset(-l),J=_.u(a.a.values()),
16
- q=J.next();!q.done;q=J.next())O=q.value,O.segmentIndex.offset(-l),_.zw(O.segmentIndex,n);a.J={presentationTimeline:a.h,periods:[h],offlineSessionIds:[],minBufferTime:0};_.z(S)})},PB=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=_.u(d),n=m.next();!n.done;n=m.next()){var p=n.value,q=_.dh(p,"AUDIO");n=_.dh(p,"VIDEO");var r=_.dh(p,lB);p=SB(a,p);if(r){var w=_.Yg(_.Ce,p);a.m.set(r,w);r=p.indexOf(w);-1<
17
- r&&p.splice(r,1)}q&&(r=TB(_.kc,p),a.m.set(q,r));n&&(q=TB(_.Re,p),a.m.set(n,q))}return _.x(l,UB(a,c),2);case 2:m=sB(c,VA);m=_.u(m);for(n=m.next();!n.done;n=m.next())p=n.value,n=VB(p),q=nB(p,_.La),p=nB(p,"INSTREAM-ID"),a.M.get(q)||a.M.set(q,new Map),a.M.get(q).set(p,n);return _.x(l,WB(a,d),3);case 3:return f=l.f,_.x(l,XB(a,c),4);case 4:return g=l.f,_.x(l,YB(a,e),5);case 5:return h=l.f,l["return"]({startTime:0,variants:f,textStreams:g,thumbStreams:h})}})},XB=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,r;
18
- return _.A(function(w){if(1==w.a)return c=sB(b,lB),d=c.map(function(y){var B,E;return _.A(function(F){if(1==F.a)return _.zf(F,2),_.x(F,ZB(a,y),4);if(2!=F.a)return B=F.f,F["return"](B.stream);E=_.Bf(F);throw E;})}),_.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.m.get(l))if(n=a.o.get(l))for(p=_.u(n),q=p.next();!q.done;q=p.next())r=q.value,r.stream.codecs=m;return w["return"](e.filter(function(y){return y}))})},YB=function(a,b){var c,d;return _.A(function(e){if(1==
19
- e.a)return c=b.map(function(f){var g;return _.A(function(h){if(1==h.a)return _.x(h,$B(a,f),2);g=h.f;return h["return"](g.stream)})}),_.x(e,Promise.all(c),2);d=e.f;return e["return"](d.filter(function(f){return f}))})},UB=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,ZB(a,b[0]),2):d.G(2);c=b.slice(1).map(function(e){return ZB(a,e)});return _.x(d,Promise.all(c),0)})},WB=function(a,b){var c,
20
- d,e,f,g,h,l,m,n,p;return _.A(function(q){if(1==q.a){c=function(r){var w,y,B,E,F,D,J;return _.A(function(O){return 1==O.a?(w=_.dh(r,"FRAME-RATE"),y=Number(nB(r,_.ma)),B=_.dh(r,_.ib),E=_.u(B?B.split("x"):[null,null]),F=E.next().value,D=E.next().value,_.x(O,aC(a,r,B,w),2)):(J=O.f)?O["return"](bC(a,J.audio,J.video,y,F,D,w)):O["return"]([])})};d=0;e=Infinity;for(f=0;f<b.length;++f)g=Number(nB(b[f],_.ma)),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,
21
- Promise.all(m),3);n=q.f;n.splice(d,0,l);p=n.reduce(_.Jv,[]);return q["return"](p.filter(_.Kg))})},aC=function(a,b,c,d){var e,f,g,h,l,m,n,p,q,r,w,y,B,E;return _.A(function(F){if(1==F.a)return e=_.xn,f=SB(a,b),g=_.dh(b,"AUDIO"),h=_.dh(b,"VIDEO"),m=(l=g||h)&&a.o.has(l)?a.o.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(D){return D.Rd===r}),y=_.Yg(e.VIDEO,f),B=c||d||y,1!==f.length||B?!m.length&&1<f.length?(a.f.debug("Guessing multiplexed audio+video"),
22
- p=e.VIDEO,f=[f.join(",")]):n.audio.length&&w?(a.f.debug(jB),p=e.AUDIO,q=!0):n.video.length?(a.f.debug(jB),p=e.AUDIO):(a.f.debug("Guessing video-only"),p=e.VIDEO):(p=e.AUDIO,a.f.debug(jB)),q?F.G(2):_.x(F,cC(a,b,f,p),3);2!=F.a&&(E=F.f);if(E)n[E.stream.type]=[E];else if(null===E)return a.f.debug("streamInfo is null"),F["return"](null);dC(n);return F["return"](n)})},dC=function(a){a=_.u(a.audio.concat(a.video));for(var b=a.next();!b.done;b=a.next()){b=b.value;var c=b.stream.codecs.split(",");c=c.filter(function(d){return"mp4a.40.34"!=
23
- d});b.stream.codecs=c.join(",")}},bC=function(a,b,c,d,e,f,g){c.forEach(function(B){if(B=B.stream)B.width=Number(e)||void 0,B.height=Number(f)||void 0,B.frameRate=Number(g)||void 0});b.length||(b=[null]);c.length||(c=[null]);var h=[];b=_.u(b);for(var l=b.next();!l.done;l=b.next()){l=l.value;for(var m=_.u(c),n=m.next();!n.done;n=m.next()){var p=n.value;n=l?l.stream:null;var q=p?p.stream:null,r=l?l.drmInfos:null,w=p?p.drmInfos:null;p=(p?p.Rd:"")+" - "+(l?l.Rd:"");var y=void 0;if(n&&q)if(r.length&&w.length?
24
- 0<_.Vv(r,w).length:1)y=_.Vv(r,w);else{a.f.warn("Incompatible DRM info in HLS variant. Skipping.");continue}else n?y=r:q&&(y=w);a.ca.has(p)?a.f.debug("Skipping variant which only differs in text streams."):(n=eC(a,n,q,d,y),h.push(n),a.ca.add(p))}}return h},eC=function(a,b,c,d,e){return{id:a.fa++,language:b?b.language:_.Ie,primary:!!b&&b.primary||!!c&&c.primary,audio:b,video:c,bandwidth:d,drmInfos:e,allowedByApplication:!0,allowedByKeySystem:!0}},ZB=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,r,w;return _.A(function(y){if(1==
25
- y.a){c=nB(b,_.La);d="";e=nB(b,"TYPE").toLowerCase();f=_.xn;e==_.xv&&(e=f.TEXT);e!==f.TEXT&&c&&a.m.has(c)&&(d=a.m.get(c));g=nB(b,_.ub);if(a.a.has(g))return y["return"](a.a.get(g));h=VB(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(y,fC(a,g,d,e,h,r,l,q,null),2)}w=y.f;if(null==w)return y["return"](null);a.o.has(c)?a.o.get(c).push(w):a.o.set(c,[w]);if(a.a.has(g))return y["return"](a.a.get(g));
26
- a.a.set(g,w);return y["return"](w)})},$B=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));d=_.dh(b,_.oa)||"jpg";e=VB(b);f=_.dh(b,"NAME");return _.x(l,fC(a,c,d,_.od,e,!1,f,null,null),2)}g=l.f;if(null===g)return l["return"](null);if(a.a.has(c))return l["return"](a.a.get(c));if(h=_.dh(b,_.ma))g.stream.bandwidth=Number(h);a.a.set(c,g);return l["return"](g)})},SB=function(a,b){var c=_.dh(b,_.oa,a.g.hlsDefaultCodecs||"avc1.42E01E,mp4a.40.2").split(/\s*,\s*/),
27
- d=new Set,e=[];c=_.u(c);for(var f=c.next();!f.done;f=c.next()){f=f.value;var g=_.Tv(f)[0];d.has(g)?a.f.debug("Ignoring duplicate codec"):(e.push(f),d.add(g))}return e},VB=function(a){a=_.dh(a,"LANGUAGE")||_.Ie;return _.Ki(a)},cC=function(a,b,c,d){var e,f,g,h,l,m;return _.A(function(n){if(1==n.a){e=_.xn;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.M.get(g));l=TB(d,c);return _.x(n,fC(a,f,l,d,_.Ie,!1,null,null,h),2)}m=n.f;if(null==m)return n["return"](null);
28
- if(a.a.has(f))return n["return"](a.a.get(f));a.a.set(f,m);return n["return"](m)})},fC=function(a,b,c,d,e,f,g,h,l){var m,n,p,q,r,w,y,B,E,F,D,J,O,S,Da,ha,ka,Aa,wa,qa,ta,Ma,Ja,Bb,Cb,Db,Li,Mi,Vf,$c,$b,fh;return _.A(function(ad){switch(ad.a){case 1:m=vB(a.A,b);p=null;if(a.j==IB&&a.H.has(m)){n=a.H.get(m);a.H["delete"](m);ad.G(2);break}return _.x(ad,LB(a,m),3);case 3:q=ad.f,r=q.response,w=q.text,m=r.uri,n=BB(a.P,w,m);case 2:if(1!==n.type)throw new _.L(_.M,4,4017);hC(a,n);return _.x(ad,iC(a,d,c,n),4);case 4:y=
29
- ad.f;B=[];n.da.forEach(function(Ni){Ni=rB(Ni.pa,"EXT-X-KEY");B.push.apply(B,Ni)});E=!1;F=[];D=null;J=_.u(B);for(O=J.next();!O.done;O=J.next())S=O.value,Da=nB(S,"METHOD"),ha=_.dh(S,"KEYFORMAT","identity"),"NONE"!=Da&&("AES-128"==Da?(ka=_.dh(S,"IV",""),Aa=vB(a.A,nB(S,_.ub)),p={method:"AES-128",url:Aa,iv:ka?_.nk((ka||"0x").slice(2)):null},a.I=!0):(E=!0,(qa=(wa=EC[ha])?wa(S,y):null)?(qa.keyIds.length&&(D=qa.keyIds[0]),F.push(qa)):a.f.warn("Unsupported HLS KEYFORMAT",ha)));if(E&&!F.length&&!a.I)throw new _.L(_.M,
30
- 4,4026);ta=new Map;return _.x(ad,MB(a,b,n,d,y,c,p,ta),5);case 5:return Ma=ad.f,Ja=Ma[0].startTime,Bb=Ma[Ma.length-1].endTime,Cb=Bb-Ja,Db=new _.vw(Ma),Li=a.g.hlsLowLatency?_.qz:_.ov,Mi=FC(n,p),Vf=void 0,d==_.Ce&&(Vf=_.ye),$b=($c=tB(n.pa,fB))?"YES"===_.dh($c,"CAN-BLOCK-RELOAD"):!1,fh={id:a.fa++,originalId:g,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:Db.yc.bind(Db),getSegmentReference:Db.get.bind(Db),adjustSegmentDurations:Db.Pc.bind(Db),getDuration:Db.getDuration.bind(Db),
31
- segmentIndex:Db,segmentLookupStrategy:Li,initSegmentReference:Mi,mimeType:y,codecs:c,kind:Vf,encrypted:E,keyId:D,language:e,label:g,type:d,primary:f,trickModeVideo:null,emsgSchemeIdUris:null,frameRate:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:[],channelsCount:h,closedCaptions:l,keyInfo:p,da:Ma},ad["return"]({stream:fh,segmentIndex:Db,drmInfos:F,Rd:b,Dg:m,De:Ja,uk:Bb,duration:Cb,Xh:ta,Jg:$b})}})},hC=function(a,b){var c=tB(b.pa,dB),d=tB(b.pa,$A);d=c&&"VOD"==c.value||d;c=c&&"EVENT"==c.value&&
32
- !d;c=!d&&!c;if(d)NB(a,IB);else{c?NB(a,GC):NB(a,HC);d=tB(b.pa,hB);if(!d)throw new _.L(_.M,4,4024,{missingTag:hB});d=Number(d.value);c=tB(b.pa,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.pa,fB),a.Z=d?Number(nB(d,"PART-HOLD-BACK")):0):(a.D=Math.max(d,a.D),a.F=Math.min(d,a.F),a.Z=3*a.D)}},FC=function(a,b){var c=rB(a.pa,aB);if(!c.length)return null;if(1<c.length)throw new _.L(_.M,4,4020);var d=c[0];c=nB(d,_.ub);var e=vB(a.a,c);c=0;var f=null;if(d=
33
- _.dh(d,"BYTERANGE"))c=d.split("@"),d=Number(c[0]),c=Number(c[1]),f=c+d-1;return new _.gw(function(){return[e]},c,f,b)},JC=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.Jd;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(IC(p,w));p=w.next().value;w=w.next().value;var y=_.dh(n,_.ub);y=vB(g,y);l.Td=y?[y]:[];q=new _.hw(c,q,r,function(B){return function(){return B.Td}}(l),
34
- p,w,e,f,!1,null,null,null,null);if("YES"===_.dh(n,"INDEPENDENT")||0===m)q.g=!0;h.push(q)}return h},KC=function(a,b,c,d,e,f,g,h,l){var m=c.pa,n=c.a,p=n?[n]:[];n=tB(m,iB);(g=g?Object.assign({},g):null)&&!g.iv&&(g.iv=_.qk(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(y){return parseInt(y,10)})),q=r.next().value,
35
- 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=JC(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(IC(b,m?m.value:null)),c=b.next().value,l=b.next().value):a=h[h.length-1].endTime;return new _.hw(d,e,a,function(){return p},c,l,f,g,!1,null,q,r,w,h)},IC=function(a,b){var c=0,d=null;b&&(c=b.split("@"),d=Number(c[0]),c=c[1]?Number(c[1]):a.Na+1,d=c+d-1);return[c,d]},QB=function(a){a.h&&
36
- (a.$.forEach(function(b){_.lw(a.h,b,0)}),a.$=[])},MB=function(a,b,c,d,e,f,g,h){var l,m,n,p,q,r,w,y,B,E,F,D,J,O,S,Da,ha,ka,Aa,wa,qa,ta,Ma;return _.A(function(Ja){switch(Ja.a){case 1:l=c.da;m=FC(c,g);n=uB(c.pa);if(null!==a.S){Ja.G(2);break}p=a;return _.x(Ja,LC(a,b,m,l[0],n,g,e,f,d),3);case 3:p.S=Ja.f;case 2:q=a.S;r=l[0].a;a.f.debug("First segment",r.split("/").pop(),"starts at",q);y=(w=tB(c.pa,ZA))?Number(w.value):0;h.has(y)||h.set(y,n);if(!w)for(;h.has(y+1)&&h.get(y+1)<n;)y++;B=a.K.get(y)||0;E=[];
37
- F=function(Bb){return _.UA(Bb)};D=_.u(F(l));J=D.next();case 4:if(J.done){Ja.G(6);break}S=O=J.value;Da=S.Jd;ha=S.item;ka=E[E.length-1];Aa=0==Da?q:ka.endTime;wa=n+Da;qa=tB(ha.pa,YA);if(!qa){Ja.G(7);break}y++;h.set(y,wa);return _.x(Ja,MC(a,y,b,m,ha,wa,g,e,f,Aa,d),8);case 8:B=Ja.f;case 7:ta=KC(a,ka,ha,wa,Aa,B,g,d,c.a);Ma=tB(ha.pa,iB);ta&&(a.g.hlsLowLatency||Ma)&&E.push(ta);J=D.next();Ja.G(4);break;case 6:return a.$.push(E),QB(a),Ja["return"](E)}})},MC=function(a,b,c,d,e,f,g,h,l,m,n){var p,q;return _.A(function(r){if(1==
38
- r.a)return p=0,a.K.has(b)?(p=a.K.get(b),r.G(2)):_.x(r,LC(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.K.set(b,p));return r["return"](p)})},OC=function(a,b){var c,d,e,f,g,h,l;return _.A(function(m){switch(m.a){case 1:return c=b.f(),d=_.fw(b.Oa(),b.$a,b.$a+2048-1,a.g.attemptParameters),d.type=2,e=_.fw(b.Oa(),b.$a,b.Na,a.g.attemptParameters),e.type=2,c&&(e.keyInfo=c),_.zf(m,2),f=a.I?e:d,_.x(m,NC(a,f),4);case 4:return g=m.f,m["return"](g);case 2:h=_.Bf(m);
39
- if(7001==h.code||a.I)throw h;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 preflights.",d.uris[0]);return _.x(m,NC(a,e),5);case 5:return l=m.f,m["return"](l)}})},LC=function(a,b,c,d,e,f,g,h,l,m){var n,p,q,r,w,y,B,E,F,D,J;return _.A(function(O){switch(O.a){case 1:n=KC(a,null,d,e,0,0,f,l,"");if(!n)return O["return"](0);if(a.J&&!m){p=a.a.get(b);q=p.segmentIndex;if(r=q.get(n.position))return a.f.debug("Found segment start time in previous manifest"),
40
- O["return"](r.startTime);a.f.debug("Unable to find segment start time in previous manifest!")}a.f.debug("Fetching segment to find start time");if("audio/mpeg"==g)return O["return"](0);if(g!=_.lc){O.G(2);break}return _.x(O,OC(a,n),3);case 3:return w=O.f,y=_.N(w.data),DB(y)?O["return"](EB(y)):O["return"](HB(w.data));case 2:if(g!=_.Te&&g!=_.pc){O.G(4);break}B=[OC(a,n)];c&&B.push(OC(a,c));return _.x(O,Promise.all(B),5);case 5:return E=O.f,F=E[0],D=E[1]||E[0],O["return"](FB(F.data,D.data));case 4:if(g!=
41
- _.Se){O.G(6);break}return _.x(O,OC(a,n),7);case 7:return J=O.f,O["return"](HB(J.data));case 6:if(g===_.oc||g===_.nc||!MediaSource.isTypeSupported((g.split("/")[0]||"")+'/mp4;codecs\x3d"'+h+'"'))return O["return"](0);throw new _.L(_.M,4,4030);}})},TB=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});},iC=function(a,b,c,d){var e,f,g,h;return _.A(function(l){e=d.da[0];f=e.a;h=(g=tB(e.pa,aB))?nB(g,_.ub):null;return l["return"](PC(a,b,
42
- c,f,h))})},PC=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,c))return n["return"](g);h=_.Oh([d],a.g.attemptParameters);h.method="HEAD";h.type=2;return _.x(n,NC(a,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])})},LB=function(a,b){var c,d,e;return _.A(function(f){if(1==f.a)return c=_.Oh([b],a.g.attemptParameters),c.type=1,_.x(f,NC(a,c),2);d=f.f;e="";try{e=_.wh(d.data)}catch(g){throw new _.L(_.M,
43
- 4,4042);}e=e.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");e=e.trim();return f["return"]({text:e,response:d})})},QC=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=_.aq(a);a=null;b=_.N(b.data);try{a=_.Cv(_.Pl(b))}catch(d){a=b}return _.Mv(_.Rc,[{initDataType:_.Bc,initData:a}],"")},NB=function(a,b){a.j=b;if(a.h){var c=a.h,d=a.j==IB;c.j=d;c.m=d}a.j!=IB||a.w.stop()},NC=function(a,b){if(!a.B)throw new _.L(_.M,
44
- 7,7001);var c=a.C.networkingEngine.fetch(b);_.Yh(a.B,c);return c.O},RC=function(){},yB=[hB,bB,ZA,dB,aB,"EXT-X-I-FRAMES-ONLY",$A,fB,cB],zB=[iB,XA,YA,"EXT-X-PROGRAM-DATE-TIME","EXT-X-KEY","EXT-X-DATERANGE"],CB=["EXT-X-PART",eB];_.t=JB.prototype;_.t.configure=function(a){this.g=a};
45
- _.t.setCurrentVariant=function(a){var b=a.video?a.video.id:null;a=a.audio?a.audio.id:null;this.U.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.stream||e.stream.id!==b&&e.stream.id!==a||this.U.set(d,e)}};_.t.start=function(a,b){var c=this,d,e,f,g;return _.A(function(h){if(1==h.a)return c.C=b,_.x(h,LB(c,a),2);if(3!=h.a)return d=h.f,e=d.response,f=d.text,c.A=e.uri,_.x(h,RB(c,f),3);g=c.aa;0<g&&c.w.Y(g);return h["return"](c.J)})};
46
- _.t.stop=function(){this.w&&(this.w.stop(),this.w=null);var a=[];this.B&&(a.push(this.B.destroy()),this.B=null);this.g=this.C=null;this.ca.clear();this.a.clear();this.H.clear();this.J=null;this.o.clear();this.m.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==IB)return g["return"]();b=[];a.S=null;c=Array.from(a.a.values());d=Array.from(a.U.values());e=a.g.hlsLowLatency&&0<d.length?d:c;return _.x(g,OB(a,e[0]),2)}for(f=1;f<e.length;f++)b.push(OB(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(_.hv);if(!a.C)return e["return"]();_.zf(e,2);return _.x(e,a.update(),4)}if(2!=e.a)return b=a.aa,a.w.Y(b),_.Af(e,0);c=_.Bf(e);a.C&&(a.C.onError(c),d=c,1===d.severity&&a.w.Y(.1));_.z(e)})};
49
- var EC={"com.apple.streamingkeydelivery":function(a,b){if(b===_.Se)throw new _.L(_.M,4,4041);return _.Mv(_.Qc,[{initDataType:_.oe,initData:new Uint8Array(0)}],"")},"com.microsoft.playready":QC,"urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":QC,"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=_.aq(b);b=_.N(b.data);b=_.Mv(_.Sc,[{initDataType:_.Bc,
50
- initData:b}],"");if(a=_.dh(a,"KEYID"))b.keyIds=[a.substr(2).toLowerCase()];return b}},IB="VOD",HC="EVENT",GC="LIVE",KB={VOD:IB,Zj:HC,LIVE:GC};_.v(RC,_.Ko);RC.prototype.Ga=function(){_.Hp.m3u8=JB;_.Fp[_.Dj]=JB;_.Fp[mB]=JB};RC.prototype.Ba=function(){_.Ew("m3u8");_.Fw(_.Dj);_.Fw(mB)};RC.prototype.id=function(){return"hls"};_.C("clpp.hls.HlsComponent",RC);};
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 eK=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.X(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.X(a)?a:null}},gK=function(a,b,c){this.l=a;this.m=b;this.j=c;this.a=new _.eg;this.h=(a=_.bq[_.hc]||null)?new a(this.l.getConfiguration()):null;this.f=new _.H("clpp.hlssmpte.ImageCueHandler");this.g=null;fK(this)},fK=function(a){a.a.one(a.l,_.wd,function(){return hK(a)})},
3
- hK=function(a){var b=a.l.getSurface().getMedia();if(b)if(a.h){a.a.on(b.textTracks,_.Wb,function(d){return iK(a,d)});var c=Array.from(b.textTracks);c.filter(function(d){return d.kind===_.Cd}).forEach(function(d){iK(a,{track:d})});!jK(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."),kK(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
- jK=function(a){return a.some(function(b){return b.kind===_.Cd})},kK=function(a,b){var c=a.l.getTrackManager(),d=c.ma(),e=c.getAudioTracks().find(function(g){return g!==d});if(e){var f=function(){return c.sa(d)};a.a.on(b.textTracks,_.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.")},iK=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,_.Vc,function(d){return lK(a,d)}))},lK=function(a,b){var c=mK(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 eK(d);if(e.f===c&&null!==e.a){a.g=d;d=a.h.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)}}})},mK=function(a){return(a=
6
- a.l.getTrackManager().na())&&a.language&&a.language.toLowerCase()},nK=function(){this.a=null;this.f=!1},oK=function(){};gK.prototype.destroy=function(){this.a.release();this.g=null;return Promise.resolve()};_.v(nK,_.nq);nK.prototype.onPlayerCreated=function(){};nK.prototype.onContentWillLoad=function(a){if(this.f=_.$i()){var b=a.getConfiguration();b=_.K.La(b.hlssmpte||{});_.K.Nf(b.patchMetadataTrack)||(b.patchMetadataTrack=!1);_.K.ka(b.timestampOffset)||(b.timestampOffset=0);this.a=new gK(a,b.patchMetadataTrack,b.timestampOffset)}};nK.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;_.z(b)})};nK.prototype.id=function(){return"hlssmpte"};
7
- _.C("clpp.hlssmpte.HlsSmptePlugin",nK);nK.Id="hlssmpte";oK.prototype.create=function(){return new nK};_.Fo(new oK);};
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));}