@castlabs/prestoplay 6.6.0 → 6.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/CHANGELOG.md +17 -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 +406 -406
  8. package/cjs/cl.crypto.js +8 -8
  9. package/cjs/cl.dash.js +71 -71
  10. package/cjs/cl.externs.js +17 -6
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +49 -48
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +30 -30
  15. package/cjs/cl.ima.js +22 -22
  16. package/cjs/cl.mse.js +256 -257
  17. package/cjs/cl.muxdata.js +12 -12
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +14 -14
  20. package/cjs/cl.playlist.js +6 -6
  21. package/cjs/cl.smooth.js +71 -70
  22. package/cjs/cl.thumbnails.js +24 -24
  23. package/cjs/cl.tizen.js +71 -71
  24. package/cjs/cl.ttml.js +27 -27
  25. package/cjs/cl.verimatrix.js +5 -5
  26. package/cjs/cl.vimond.js +13 -13
  27. package/cjs/cl.vr.js +19 -19
  28. package/cjs/cl.vtt.js +14 -14
  29. package/cjs/cl.youbora.js +20 -20
  30. package/cl.adobe.js +3 -3
  31. package/cl.airplay.js +3 -3
  32. package/cl.broadpeak.js +5 -5
  33. package/cl.cast.js +88 -88
  34. package/cl.conviva.js +27 -27
  35. package/cl.core.js +357 -356
  36. package/cl.crypto.js +8 -8
  37. package/cl.dash.js +66 -66
  38. package/cl.externs.js +17 -6
  39. package/cl.freewheel.js +19 -19
  40. package/cl.hls.js +40 -40
  41. package/cl.hlssmpte.js +5 -5
  42. package/cl.htmlcue.js +25 -25
  43. package/cl.ima.js +16 -16
  44. package/cl.mse.js +199 -200
  45. package/cl.muxdata.js +8 -8
  46. package/cl.onboard.js +2 -2
  47. package/cl.persistent.js +9 -9
  48. package/cl.playlist.js +4 -4
  49. package/cl.smooth.js +59 -58
  50. package/cl.thumbnails.js +16 -16
  51. package/cl.tizen.js +57 -57
  52. package/cl.ttml.js +12 -12
  53. package/cl.verimatrix.js +4 -4
  54. package/cl.vimond.js +8 -8
  55. package/cl.vr.js +13 -13
  56. package/cl.vtt.js +11 -11
  57. package/cl.youbora.js +15 -15
  58. package/package.json +5 -1
  59. package/typings.d.ts +100 -96
package/cjs/cl.muxdata.js CHANGED
@@ -1,16 +1,16 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var Lu=function(a,b){this.l=a;this.m=this.g=null;this.A=("000000"+(Math.random()*Math.pow(36,6)<<0).toString(36)).slice(-6);this.a=new _.eg;this.f=b;this.o=this.j=this.h=this.w=!1},Nu=function(a){var b={debug:!0,data:Mu(a)};a.g&&a.g.muxOptionsOverride&&_.K.Ic(a.g.muxOptionsOverride)&&(b=_.K.Wa(b,a.g.muxOptionsOverride,{getPlayheadTime:function(){return 1E3*a.l.getPosition()},getStateData:function(){a.f.debug("getStateData()");var c=a.l.getLoadedSource(),d=a.l.getTrackManager(),e=a.l.getSurface(),
3
- f=d.ga(),g={player_is_paused:a.l.isPaused(),player_is_fullscreen:e.isFullscreen(),video_source_duration:1E3*a.l.getDuration(),player_autoplay_on:!!a.l.getConfiguration().autoplay};if(c){var h=new _.qi(c.url);g.video_source_url=_.ri(h);g.video_source_mime_type=c.type;c.name&&(g.video_title=c.name)}if(c=e.getContainer())g.player_width=c.offsetWidth,g.player_height=c.offsetHeight;f&&f.height&&f.width&&(g.video_source_height=f.height,g.video_source_width=f.width);(d=d.ma())&&d.language&&(g.player_language_code=
4
- d.language);return g}}));a.f.debug("Mux SDK options",b);return b},Mu=function(a){var b={env_key:a.g.envKey,video_title:a.m&&a.m.name||"",player_name:_.ta,player_software_name:_.ta,player_software_version:_.ea,player_mux_plugin_name:"CastlabsPlayer built-in Mux Plugin",player_mux_plugin_version:_.ea};(a=a.l.getConfiguration().viewerId)&&(b.viewer_user_id=a);return b},Ou=function(a,b,c){a.f.debug("Event: "+b);mux.emit(a.A,b,c)},Pu=function(a){a.a.on(a.l,_.Fe,function(){Ou(a,_.Fe,{player_playhead_time:1E3*
5
- a.l.getPosition()})});a.a.on(a.l,_.Yd,function(){return Ou(a,_.Yd)});a.a.on(a.l,_.rc,a.Ch.bind(a));a.a.on(a.l,_.se,a.Eh.bind(a));a.a.on(a.l,_.Ne,function(){return Ou(a,_.le)});a.a.on(a.l,_.Me,function(){return Ou(a,_.ke)});a.a.on(a.l,_.hd,a.Dh.bind(a));a.a.on(a.l,_.Gb,function(){return Ou(a,"adbreakstart")});a.a.on(a.l,_.Hb,function(){return Ou(a,"adbreakend")});a.a.on(a.l,_.Tb,function(){Ou(a,"adplay");Ou(a,"adplaying")});a.a.on(a.l,_.Pb,function(){return Ou(a,"adpause")});a.a.on(a.l,_.Rb,function(){Ou(a,
6
- "adplay");Ou(a,"adplaying")});a.a.on(a.l,_.Ub,function(){return Ou(a,"adended")});a.a.on(a.l,_.Lb,function(){return Ou(a,"adfirstquartile")});a.a.on(a.l,_.Ob,function(){return Ou(a,"admidpoint")});a.a.on(a.l,_.Vb,function(){return Ou(a,"adthirdquartile")})},Qu=function(){this.f=null;this.a=!1;this.g=new _.H("clpp.muxdata")},Ru=function(){};_.t=Lu.prototype;
7
- _.t.initialize=function(a,b){this.g=a;this.m=b;this.w=!1;if(!this.h){try{this.h=!0,mux.init(this.A,Nu(this))}catch(c){throw this.h=!1,_.hg(this.a),new _.L(1,9,9302,null,c);}Ou(this,"playerready")}this.j&&!this.o&&(Ou(this,"videochange",Mu(this)),this.j=!1);Pu(this)};_.t.release=function(){this.f.debug("release()");this.j?this.f.debug(_.ja):(_.hg(this.a),this.j=!0,this.m=this.g=null)};
8
- _.t.destroy=function(){this.f.debug(_.Vc);this.o?this.f.debug(_.ia):(this.o=!0,this.h&&this.w&&Ou(this,"viewend"),Ou(this,"destroy"))};_.t.Ch=function(a){this.f.debug(_.Ld);var b=a.detail;a=this.l.getTrackManager();b&&b.bandwidth&&(b=b.bandwidth,(a=a.Fa())&&a.bandwidth&&(b+=a.bandwidth),Ou(this,"renditionchange",{video_source_bitrate:b}))};
9
- _.t.Eh=function(a){this.f.debug(_.Pd);switch(a.detail.currentState){case _.hn:this.l.getConfiguration().autoplay&&Ou(this,_.Yd);break;case _.kn:Ou(this,_.Zd);break;case _.jn:Ou(this,_.Ud);break;case _.cn:this.w=!0,Ou(this,_.gd)}};
10
- _.t.Dh=function(a){this.f.debug(_.Md);if(this.h&&(a=a.detail||null))if(10003===a.code)Ou(this,"aderror");else if(a.severity===_.M){var b=a.message||"Player error";if(1===a.category||6100===a.code||6007===a.code)b="Download error",6100===a.code?b="Certificate request error":6007===a.code&&(b="License request error"),b=b+" castlabs-error-data:"+JSON.stringify(a.data);Ou(this,_.hd,{player_error_code:a.code,player_error_message:b})}};_.v(Qu,_.lq);_.t=Qu.prototype;_.t.onPlayerCreated=function(a){this.f=new Lu(a,this.g)};
11
- _.t.onContentWillLoad=function(a,b){var c=a.getConfiguration();if(this.a=!_.K.S(c.muxdata)&&typeof c.muxdata===_.Kd){c=c.muxdata;var d;if(d="undefined"===typeof window.mux)c=c.muxLib,d="undefined"!==typeof c&&typeof c.init===_.jd&&typeof c.emit===_.jd,window.mux=c,d=!d;d&&(this.g.warn("Mux SDK is not loaded. Will do nothing."),this.a=!1,c=new _.L(1,9,9301),this.U(a,c))}else this.g.warn("Mux plugin is loaded but not configured. Will do nothing.");if(this.a){c=a.getConfiguration();c=_.K.Na(c.muxdata||
12
- {});try{d=[];typeof c===_.Kd&&(c.envKey||d.push("envKey"));if(0<d.length)throw new _.L(1,9,9300,{missingKeys:d});this.f.initialize(c,b)}catch(e){this.a=!1,this.U(a,e)}}};_.t.onContentLoaded=function(){};_.t.onPlayerWillDestroy=function(){this.a&&(this.f.destroy(),this.f=null)};_.t.onPlayerWillRelease=function(){this.a&&this.f.release()};_.t.id=function(){return"mux"};_.t.U=function(a,b){a.trigger(new _.J(_.hd,{detail:b}))};_.C("clpp.muxdata.MuxDataPlugin",Qu);Qu.Id="mux";Ru.prototype.create=function(){return new Qu};
13
- _.Do(new Ru);};
2
+ var f=function(window){var Mu=function(a,b){this.l=a;this.m=this.g=null;this.A=("000000"+(Math.random()*Math.pow(36,6)<<0).toString(36)).slice(-6);this.a=new _.eg;this.f=b;this.o=this.j=this.h=this.w=!1},Ou=function(a){var b={debug:!0,data:Nu(a)};a.g&&a.g.muxOptionsOverride&&_.K.Hc(a.g.muxOptionsOverride)&&(b=_.K.Va(b,a.g.muxOptionsOverride,{getPlayheadTime:function(){return 1E3*a.l.getPosition()},getStateData:function(){a.f.debug("getStateData()");var c=a.l.getLoadedSource(),d=a.l.getTrackManager(),e=a.l.getSurface(),
3
+ f=d.ha(),g={player_is_paused:a.l.isPaused(),player_is_fullscreen:e.isFullscreen(),video_source_duration:1E3*a.l.getDuration(),player_autoplay_on:!!a.l.getConfiguration().autoplay};if(c){var h=new _.pi(c.url);g.video_source_url=_.qi(h);g.video_source_mime_type=c.type;c.name&&(g.video_title=c.name)}if(c=e.getContainer())g.player_width=c.offsetWidth,g.player_height=c.offsetHeight;f&&f.height&&f.width&&(g.video_source_height=f.height,g.video_source_width=f.width);(d=d.na())&&d.language&&(g.player_language_code=
4
+ d.language);return g}}));a.f.debug("Mux SDK options",b);return b},Nu=function(a){var b={env_key:a.g.envKey,video_title:a.m&&a.m.name||"",player_name:_.sa,player_software_name:_.sa,player_software_version:_.ea,player_mux_plugin_name:"CastlabsPlayer built-in Mux Plugin",player_mux_plugin_version:_.ea};(a=a.l.getConfiguration().viewerId)&&(b.viewer_user_id=a);return b},Pu=function(a,b,c){a.f.debug("Event: "+b);mux.emit(a.A,b,c)},Qu=function(a){a.a.on(a.l,_.Fe,function(){Pu(a,_.Fe,{player_playhead_time:1E3*
5
+ a.l.getPosition()})});a.a.on(a.l,_.Zd,function(){return Pu(a,_.Zd)});a.a.on(a.l,_.tc,a.zh.bind(a));a.a.on(a.l,_.se,a.Bh.bind(a));a.a.on(a.l,_.Ne,function(){return Pu(a,_.me)});a.a.on(a.l,_.Me,function(){return Pu(a,_.le)});a.a.on(a.l,_.jd,a.Ah.bind(a));a.a.on(a.l,_.Gb,function(){return Pu(a,"adbreakstart")});a.a.on(a.l,_.Hb,function(){return Pu(a,"adbreakend")});a.a.on(a.l,_.Tb,function(){Pu(a,"adplay");Pu(a,"adplaying")});a.a.on(a.l,_.Pb,function(){return Pu(a,"adpause")});a.a.on(a.l,_.Rb,function(){Pu(a,
6
+ "adplay");Pu(a,"adplaying")});a.a.on(a.l,_.Ub,function(){return Pu(a,"adended")});a.a.on(a.l,_.Lb,function(){return Pu(a,"adfirstquartile")});a.a.on(a.l,_.Ob,function(){return Pu(a,"admidpoint")});a.a.on(a.l,_.Vb,function(){return Pu(a,"adthirdquartile")})},Ru=function(){this.f=null;this.a=!1;this.g=new _.H("clpp.muxdata")},Su=function(){};_.t=Mu.prototype;
7
+ _.t.initialize=function(a,b){this.g=a;this.m=b;this.w=!1;if(!this.h){try{this.h=!0,mux.init(this.A,Ou(this))}catch(c){throw this.h=!1,_.hg(this.a),new _.L(1,9,9302,null,c);}Pu(this,"playerready")}this.j&&!this.o&&(Pu(this,"videochange",Nu(this)),this.j=!1);Qu(this)};_.t.release=function(){this.f.debug("release()");this.j?this.f.debug(_.ia):(_.hg(this.a),this.j=!0,this.m=this.g=null)};
8
+ _.t.destroy=function(){this.f.debug(_.Xc);this.o?this.f.debug(_.ha):(this.o=!0,this.h&&this.w&&Pu(this,"viewend"),Pu(this,"destroy"))};_.t.zh=function(a){this.f.debug(_.Md);var b=a.detail;a=this.l.getTrackManager();b&&b.bandwidth&&(b=b.bandwidth,(a=a.Ea())&&a.bandwidth&&(b+=a.bandwidth),Pu(this,"renditionchange",{video_source_bitrate:b}))};
9
+ _.t.Bh=function(a){this.f.debug(_.Qd);switch(a.detail.currentState){case _.jn:this.l.getConfiguration().autoplay&&Pu(this,_.Zd);break;case _.ln:Pu(this,_.$d);break;case _.kn:Pu(this,_.Vd);break;case _.dn:this.w=!0,Pu(this,_.id)}};
10
+ _.t.Ah=function(a){this.f.debug(_.Nd);if(this.h&&(a=a.detail||null))if(10003===a.code)Pu(this,"aderror");else if(a.severity===_.M){var b=a.message||"Player error";if(1===a.category||6100===a.code||6007===a.code)b="Download error",6100===a.code?b="Certificate request error":6007===a.code&&(b="License request error"),b=b+" castlabs-error-data:"+JSON.stringify(a.data);Pu(this,_.jd,{player_error_code:a.code,player_error_message:b})}};_.v(Ru,_.mq);_.t=Ru.prototype;_.t.onPlayerCreated=function(a){this.f=new Mu(a,this.g)};
11
+ _.t.onContentWillLoad=function(a,b){var c=a.getConfiguration();if(this.a=!_.K.R(c.muxdata)&&typeof c.muxdata===_.Ld){c=c.muxdata;var d;if(d="undefined"===typeof window.mux)c=c.muxLib,d="undefined"!==typeof c&&typeof c.init===_.ld&&typeof c.emit===_.ld,window.mux=c,d=!d;d&&(this.g.warn("Mux SDK is not loaded. Will do nothing."),this.a=!1,c=new _.L(1,9,9301),this.T(a,c))}else this.g.warn("Mux plugin is loaded but not configured. Will do nothing.");if(this.a){c=a.getConfiguration();c=_.K.Ma(c.muxdata||
12
+ {});try{d=[];typeof c===_.Ld&&(c.envKey||d.push("envKey"));if(0<d.length)throw new _.L(1,9,9300,{missingKeys:d});this.f.initialize(c,b)}catch(e){this.a=!1,this.T(a,e)}}};_.t.onContentLoaded=function(){};_.t.onPlayerWillDestroy=function(){this.a&&(this.f.destroy(),this.f=null)};_.t.onPlayerWillRelease=function(){this.a&&this.f.release()};_.t.id=function(){return"mux"};_.t.T=function(a,b){a.trigger(new _.J(_.jd,{detail:b}))};_.D("clpp.muxdata.MuxDataPlugin",Ru);Ru.Id="mux";Su.prototype.create=function(){return new Ru};
13
+ _.Eo(new Su);};
14
14
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
15
15
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
16
16
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.onboard.js CHANGED
@@ -1,7 +1,7 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var Ju=function(){this.l=null;this.a=new _.H("clpp.onboard")},Ku=function(a,b){function c(l){return l&&(_.Ch(l,"https://")||_.Ch(l,"http://")||_.Ch(l,"//"))?l:d+l}var d=b.baseUrl;_.Dh(d,"/")||(d+="/");var e=c(b.widevineUrl||"widevine"),f=c(b.playreadyUrl||"playready"),g=c(b.fairplayUrl||"fairplay"),h=new _.zk(a);h.Ka(_.Rc,{licenseUrl:e,videoRobustness:[_.ob,void 0],audioRobustness:[_.nb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:_.nl,
3
- licenseResponse:_.sl}});h.Ka(_.Pc,{licenseUrl:g,certificateUrl:g,modifiers:{licenseRequest:_.pl,licenseResponse:_.ql,extractContentId:_.ml,certificateRequest:_.rl}});h.Ka(_.Qc,{licenseUrl:f,modifiers:{licenseRequest:_.nl}});_.uk(h)};_.v(Ju,_.Io);_.t=Ju.prototype;_.t.Ja=function(a){this.l=a};_.t.Ca=function(){this.l=null};
4
- _.t.Yb=function(){var a=this.l.getConfiguration().drm,b;if(b=!(!a||!a.env))b=a&&a.customData,b=!(!b||!b.baseUrl);b&&(b=a.env,a=a.customData,a={baseUrl:a.baseUrl,widevineUrl:a.widevineUrl,playreadyUrl:a.playreadyUrl,fairplayUrl:a.fairplayUrl},this.a.info("Registering the DRMtoday Onboard environment, name\x3d'"+b+"'"),Ku(b,a))};_.t.release=function(){};_.t.id=function(){return"onboard"};_.C("clpp.onboard.OnboardComponent",Ju);_.C("clpp.onboard.register",Ku);};
2
+ var f=function(window){var Ku=function(){this.l=null;this.a=new _.H("clpp.onboard")},Lu=function(a,b){function c(l){return l&&(_.Ch(l,"https://")||_.Ch(l,"http://")||_.Ch(l,"//"))?l:d+l}var d=b.baseUrl;_.Dh(d,"/")||(d+="/");var e=c(b.widevineUrl||"widevine"),f=c(b.playreadyUrl||"playready"),g=c(b.fairplayUrl||"fairplay"),h=new _.Ak(a);h.Ka(_.Tc,{licenseUrl:e,videoRobustness:[_.nb,void 0],audioRobustness:[_.mb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:_.ol,
3
+ licenseResponse:_.tl}});h.Ka(_.Rc,{licenseUrl:g,certificateUrl:g,modifiers:{licenseRequest:_.ql,licenseResponse:_.rl,extractContentId:_.nl,certificateRequest:_.sl}});h.Ka(_.Sc,{licenseUrl:f,modifiers:{licenseRequest:_.ol}});_.vk(h)};_.v(Ku,_.Jo);_.t=Ku.prototype;_.t.Ia=function(a){this.l=a};_.t.Ca=function(){this.l=null};
4
+ _.t.Xb=function(){var a=this.l.getConfiguration().drm,b;if(b=!(!a||!a.env))b=a&&a.customData,b=!(!b||!b.baseUrl);b&&(b=a.env,a=a.customData,a={baseUrl:a.baseUrl,widevineUrl:a.widevineUrl,playreadyUrl:a.playreadyUrl,fairplayUrl:a.fairplayUrl},this.a.info("Registering the DRMtoday Onboard environment, name\x3d'"+b+"'"),Lu(b,a))};_.t.release=function(){};_.t.id=function(){return"onboard"};_.D("clpp.onboard.OnboardComponent",Ku);_.D("clpp.onboard.register",Lu);};
5
5
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
6
6
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
7
7
  else{_=this.clpp._;(f.call(g,this));}
@@ -1,18 +1,18 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var qu="A persistent DRM session already exists for: ",ru="No DRM configuration.",su="clpp.persistent",tu=function(a){a.A=[a.g];a.m=0;a.j=0},uu=function(a){var b=a.A.splice(0)[0];(b=a.g=a.g||b)?b.Qf?a.a=a.m||a.j:void 0!=b.H&&a.j<b.H?(a.a=b.H,a.g=null):a.a=a.j:a.a=0},vu=function(a,b){for(var c=[],d=_.u(a),e=d.next();!e.done;e=d.next())c.push(b(e.value));return c},wu=function(a){a=a.g.keys();a=vu(a,function(b){return b.sessionId});return Array.from(a)},xu=function(a,b){var c,d,e;return _.B(function(f){if(1==
3
- f.a)return _.x(f,_.om(a,b),2);c=f.f;if(!c)return a.a.debug("Ignoring attempt to remove missing session",b),f["return"]();d=[];(e=a.g.get(c))&&a.B&&(e.ob=new _.Th,d.push(e.ob));a.a.debug("Attempting to remove session",b);d.push(c.remove());return f["return"](Promise.all(d))})},zu=function(a,b){a.K=yu;a.L=[];a.F=!0;return _.Wl(a,b)},Bu=function(a,b,c,d,e,f){a.K=Au;var g=new Map,h=_.qm(b);g.set(h,{audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:_.Rd,persistentState:_.he,sessionTypes:[_.Wd],
4
- label:h,drmInfos:[{keySystem:b,licenseServerUri:c,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}]});return _.bm(a,g)},Cu=function(){},Du=function(a){a=JSON.parse(a);var b=JSON.parse(a.sessionIds),c=JSON.parse(a.audioCapabilities),d=JSON.parse(a.videoCapabilities),e=JSON.parse(a.serverCertificate),f=JSON.parse(a.drmConfig);return{sessionIds:b,keySystem:a.keySystem,licenseServerUri:decodeURIComponent(a.licenseServerUri),
5
- serverCertificate:e?new Uint8Array(e):null,audioCapabilities:c,videoCapabilities:d,drmConfig:f}},Eu=function(a,b){var c=_.wk(a),d=_.Zj({drm:a});d.drm=a;var e=new _.Sl({Ab:b,onError:function(){},Le:function(){},onExpirationUpdated:function(){},onEvent:function(){},getConfiguration:function(){return d},Gc:function(){return null}});e.h=c;return e},Hu=function(a,b,c){var d,e,f,g,h,l,m,n,p;return _.B(function(q){switch(q.a){case 1:d=Fu;e=Gu;if(!a)return e.debug(ru),q["return"]();f=a.offlineId;return 0===
6
- f.length?q["return"]():_.x(q,d.get(f),2);case 2:if(g=q.f)return e.debug(qu,f),q["return"]();h=Eu(a,c);_.zf(q,3,4);return _.x(q,zu(h,b),6);case 6:return _.x(q,_.hm(h),7);case 7:return _.x(q,_.im(h),8);case 8:return l=h.getDrmInfo(),m=b.map(function(r){return{contentType:_.Oi(r.video.mimeType,r.video.codecs),robustness:l.videoRobustness}}),n=wu(h),g={sessionIds:n,keySystem:l.keySystem,licenseServerUri:l.licenseServerUri,serverCertificate:l.serverCertificate,audioCapabilities:[],videoCapabilities:m,
7
- drmConfig:a},_.x(q,d.store(f,g),4);case 4:return tu(q),_.x(q,h.destroy(),10);case 10:uu(q);break;case 3:throw p=_.Bf(q),e.error("Error while persisting DRM session"),new _.L(1,6,6200,null,p);}})},Iu=function(){this.l=null;this.f=Fu;this.a=new _.H(su)},yu=1,Au=2;_.t=Cu.prototype;
8
- _.t.store=function(a,b){var c;return _.B(function(d){var e=JSON.stringify(b.sessionIds),f=b.serverCertificate?Array.from(b.serverCertificate):null;f=JSON.stringify(f);var g=JSON.stringify(b.audioCapabilities),h=JSON.stringify(b.videoCapabilities);c=JSON.stringify({sessionIds:e,keySystem:b.keySystem,licenseServerUri:encodeURIComponent(b.licenseServerUri),serverCertificate:f,audioCapabilities:g,videoCapabilities:h,drmConfig:JSON.stringify(b.drmConfig)});window.localStorage.setItem(encodeURIComponent(a),
9
- btoa(c));_.z(d)})};_.t.get=function(a){var b;return _.B(function(c){return(b=window.localStorage.getItem(encodeURIComponent(a)))?c["return"](Du(atob(b))):c["return"](null)})};_.t["delete"]=function(a){return _.B(function(b){window.localStorage.removeItem(encodeURIComponent(a));_.z(b)})};_.t.clear=function(){return _.B(function(a){window.localStorage.clear();_.z(a)})};_.t.getName=function(){return"clpp.persistent.SimpleSessionStorage"};_.C("clpp.persistent.useStorage",function(a){var b=["store","get","delete","clear","getName"];var c=[];_.K.S(a)||(_.K.kb(a.store)||c.push("store"),_.K.kb(a.get)||c.push("get"),_.K.kb(a["delete"])||c.push("delete"),_.K.kb(a.clear)||c.push("clear"),_.K.kb(a.getName)||c.push("getName"),b=c);if(0<b.length)throw Gu.warn("Invalid session storage implementation"),new _.L(1,6,6202,{missingMethods:b});Fu=a});
10
- _.C("clpp.persistent.fetchLicense",function(a,b,c){for(var d=[],e=2;e<arguments.length;++e)d[e-2]=arguments[e];var f,g,h,l,m,n,p,q,r,w,y,A,E,F,D,I,O,S,Fa;return _.B(function(fa){switch(fa.a){case 1:f=Fu;g=Gu;h=function(ka,wa){return new _.L(1,6,6200,ka,wa)};l=_.on(a).shift();if(!l)throw h("No source specified.");if(!b)throw h(ru);m=b.offlineId;if(typeof m!==_.ve||!m.length)throw h("Missing offline id.");return _.x(fa,f.get(m),2);case 2:if(n=fa.f)return g.debug(qu,m),fa["return"]();p=_.Zj();q=new _.ei;
11
- r=[];w=_.u(d);for(y=w.next();!y.done;y=w.next())A=y.value,E=new A,_.dk(E.id())||(E.Ja(null),_.fk(E),r.push(E));F=null;_.zf(fa,3,4);return _.x(fa,_.Cp(l.url,q,p.manifest.attemptParameters,l.type||null),6);case 6:return F=fa.f,F.configure(p.manifest),_.x(fa,F.start(l.url,{networkingEngine:q,filterAllPeriods:function(){},filterNewPeriod:function(){},onTimelineCueAdded:function(){},onEvent:function(){},onError:function(){}}),7);case 7:D=fa.f;if(!D.periods.length)throw h(null,new _.L(_.M,4,4014));I=_.vp(D.periods);
12
- return _.x(fa,Hu(b,I,q),4);case 4:for(tu(fa);r.length;)O=r.shift(),O.Ca(),_.ck["delete"](O.id());S=[];F&&S.push(F.stop());S.push(q.destroy());return _.x(fa,Promise.all(S),9);case 9:uu(fa);break;case 3:Fa=_.Bf(fa);if(Fa instanceof _.L&&6200===Fa.code)throw Fa;throw h(null,Fa);}})});
13
- _.C("clpp.persistent.removeLicense",function(a){var b,c,d,e,f,g,h;return _.B(function(l){switch(l.a){case 1:b=Fu;c=Gu;if(!_.K.Y(a)||0===a.length)return c.warn("Invalid offlineId"),l["return"]();e=d=null;_.zf(l,2,3);return _.x(l,b.get(a),5);case 5:f=l.f;if(!f)return c.debug("No persistent DRM session found"),l["return"]();f.drmConfig.delayLicenseRequestUntilPlayed=!0;e=new _.ei;d=Eu(f.drmConfig,e);return _.x(l,Bu(d,f.keySystem,f.licenseServerUri,f.serverCertificate,f.audioCapabilities,f.videoCapabilities),
14
- 6);case 6:return _.x(l,_.hm(d),7);case 7:return _.x(l,Promise.all(f.sessionIds.map(function(m){return _.B(function(n){if(1==n.a)return _.x(n,xu(d,m),2);c.debug("successfully removed session with id",m);_.z(n)})})),8);case 8:return _.x(l,b["delete"](a),3);case 3:return tu(l),g=[],d&&g.push(d.destroy()),e&&g.push(e.destroy()),_.x(l,Promise.all(g),10);case 10:uu(l);break;case 2:throw h=_.Bf(l),c.error("Failed to remove session"),new _.L(1,6,6201,null,h);}})});var Fu=new Cu,Gu=new _.H(su);_.v(Iu,_.Io);_.t=Iu.prototype;_.t.Ja=function(a){this.l=a};_.t.Ca=function(){this.l=null};_.t.release=function(){};_.t.Yb=function(){this.f=Fu};_.t.id=function(){return _.Vd};_.t.zj=function(a,b,c){var d=this,e;return _.B(function(f){if(1==f.a){if(!a)return d.a.debug("No DRM configuration found for loaded source."),f["return"]();_.zf(f,2);return _.x(f,Hu(a,b,c),4)}if(2!=f.a)return d.l.trigger(new _.J(_.ad,{offlineId:a.offlineId})),_.Af(f,0);e=_.Bf(f);d.l.onError(e);_.z(f)})};
15
- _.t.mi=function(a){var b=this,c;return _.B(function(d){if(1==d.a)return _.zf(d,2),_.x(d,b.f.get(a),4);if(2!=d.a){if(c=d.f)return d["return"](c.sessionIds);b.a.debug("No offline session found for "+a);return d["return"]([])}_.Bf(d);b.a.warn("Error while loading session info from storage");return d["return"]([])})};_.C("clpp.persistent.PersistentLicenseComponent",Iu);};
2
+ var f=function(window){var ru="A persistent DRM session already exists for: ",su="No DRM configuration.",tu="clpp.persistent",uu=function(a){a.A=[a.g];a.m=0;a.j=0},vu=function(a){var b=a.A.splice(0)[0];(b=a.g=a.g||b)?b.Pf?a.a=a.m||a.j:void 0!=b.G&&a.j<b.G?(a.a=b.G,a.g=null):a.a=a.j:a.a=0},wu=function(a,b){for(var c=[],d=_.u(a),e=d.next();!e.done;e=d.next())c.push(b(e.value));return c},xu=function(a){a=a.g.keys();a=wu(a,function(b){return b.sessionId});return Array.from(a)},yu=function(a,b){var c,d,e;return _.A(function(f){if(1==
3
+ f.a)return _.x(f,_.pm(a,b),2);c=f.f;if(!c)return a.a.debug("Ignoring attempt to remove missing session",b),f["return"]();d=[];(e=a.g.get(c))&&a.B&&(e.nb=new _.Sh,d.push(e.nb));a.a.debug("Attempting to remove session",b);d.push(c.remove());return f["return"](Promise.all(d))})},Au=function(a,b){a.J=zu;a.K=[];a.F=!0;return _.Xl(a,b)},Cu=function(a,b,c,d,e,f){a.J=Bu;var g=new Map,h=_.rm(b);g.set(h,{audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:_.Sd,persistentState:_.ie,sessionTypes:[_.Xd],
4
+ label:h,drmInfos:[{keySystem:b,licenseServerUri:c,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}]});return _.cm(a,g)},Du=function(){},Eu=function(a){a=JSON.parse(a);var b=JSON.parse(a.sessionIds),c=JSON.parse(a.audioCapabilities),d=JSON.parse(a.videoCapabilities),e=JSON.parse(a.serverCertificate),f=JSON.parse(a.drmConfig);return{sessionIds:b,keySystem:a.keySystem,licenseServerUri:decodeURIComponent(a.licenseServerUri),
5
+ serverCertificate:e?new Uint8Array(e):null,audioCapabilities:c,videoCapabilities:d,drmConfig:f}},Fu=function(a,b){var c=_.xk(a),d=_.ak({drm:a});d.drm=a;var e=new _.Tl({zb:b,onError:function(){},Ke:function(){},onExpirationUpdated:function(){},onEvent:function(){},getConfiguration:function(){return d},Fc:function(){return null}});e.h=c;return e},Iu=function(a,b,c){var d,e,f,g,h,l,m,n,p;return _.A(function(q){switch(q.a){case 1:d=Gu;e=Hu;if(!a)return e.debug(su),q["return"]();f=a.offlineId;return 0===
6
+ f.length?q["return"]():_.x(q,d.get(f),2);case 2:if(g=q.f)return e.debug(ru,f),q["return"]();h=Fu(a,c);_.zf(q,3,4);return _.x(q,Au(h,b),6);case 6:return _.x(q,_.im(h),7);case 7:return _.x(q,_.jm(h),8);case 8:return l=h.getDrmInfo(),m=b.map(function(r){return{contentType:_.Pi(r.video.mimeType,r.video.codecs),robustness:l.videoRobustness}}),n=xu(h),g={sessionIds:n,keySystem:l.keySystem,licenseServerUri:l.licenseServerUri,serverCertificate:l.serverCertificate,audioCapabilities:[],videoCapabilities:m,
7
+ drmConfig:a},_.x(q,d.store(f,g),4);case 4:return uu(q),_.x(q,h.destroy(),10);case 10:vu(q);break;case 3:throw p=_.Bf(q),e.error("Error while persisting DRM session"),new _.L(1,6,6200,null,p);}})},Ju=function(){this.l=null;this.f=Gu;this.a=new _.H(tu)},zu=1,Bu=2;_.t=Du.prototype;
8
+ _.t.store=function(a,b){var c;return _.A(function(d){var e=JSON.stringify(b.sessionIds),f=b.serverCertificate?Array.from(b.serverCertificate):null;f=JSON.stringify(f);var g=JSON.stringify(b.audioCapabilities),h=JSON.stringify(b.videoCapabilities);c=JSON.stringify({sessionIds:e,keySystem:b.keySystem,licenseServerUri:encodeURIComponent(b.licenseServerUri),serverCertificate:f,audioCapabilities:g,videoCapabilities:h,drmConfig:JSON.stringify(b.drmConfig)});window.localStorage.setItem(encodeURIComponent(a),
9
+ btoa(c));_.y(d)})};_.t.get=function(a){var b;return _.A(function(c){return(b=window.localStorage.getItem(encodeURIComponent(a)))?c["return"](Eu(atob(b))):c["return"](null)})};_.t["delete"]=function(a){return _.A(function(b){window.localStorage.removeItem(encodeURIComponent(a));_.y(b)})};_.t.clear=function(){return _.A(function(a){window.localStorage.clear();_.y(a)})};_.t.getName=function(){return"clpp.persistent.SimpleSessionStorage"};_.D("clpp.persistent.useStorage",function(a){var b=["store","get","delete","clear","getName"];var c=[];_.K.R(a)||(_.K.jb(a.store)||c.push("store"),_.K.jb(a.get)||c.push("get"),_.K.jb(a["delete"])||c.push("delete"),_.K.jb(a.clear)||c.push("clear"),_.K.jb(a.getName)||c.push("getName"),b=c);if(0<b.length)throw Hu.warn("Invalid session storage implementation"),new _.L(1,6,6202,{missingMethods:b});Gu=a});
10
+ _.D("clpp.persistent.fetchLicense",function(a,b,c){for(var d=[],e=2;e<arguments.length;++e)d[e-2]=arguments[e];var f,g,h,l,m,n,p,q,r,w,z,C,E,F,B,I,O,S,Ba;return _.A(function(ja){switch(ja.a){case 1:f=Gu;g=Hu;h=function(pa,Ca){return new _.L(1,6,6200,pa,Ca)};l=_.pn(a).shift();if(!l)throw h("No source specified.");if(!b)throw h(su);m=b.offlineId;if(typeof m!==_.ve||!m.length)throw h("Missing offline id.");return _.x(ja,f.get(m),2);case 2:if(n=ja.f)return g.debug(ru,m),ja["return"]();p=_.ak();q=new _.di;
11
+ r=[];w=_.u(d);for(z=w.next();!z.done;z=w.next())C=z.value,E=new C,_.ek(E.id())||(E.Ia(null),_.gk(E),r.push(E));F=null;_.zf(ja,3,4);return _.x(ja,_.Dp(l.url,q,p.manifest.attemptParameters,l.type||null),6);case 6:return F=ja.f,F.configure(p.manifest),_.x(ja,F.start(l.url,{networkingEngine:q,filterAllPeriods:function(){},filterNewPeriod:function(){},onTimelineCueAdded:function(){},onEvent:function(){},onError:function(){}}),7);case 7:B=ja.f;if(!B.periods.length)throw h(null,new _.L(_.M,4,4014));I=_.wp(B.periods);
12
+ return _.x(ja,Iu(b,I,q),4);case 4:for(uu(ja);r.length;)O=r.shift(),O.Ca(),_.dk["delete"](O.id());S=[];F&&S.push(F.stop());S.push(q.destroy());return _.x(ja,Promise.all(S),9);case 9:vu(ja);break;case 3:Ba=_.Bf(ja);if(Ba instanceof _.L&&6200===Ba.code)throw Ba;throw h(null,Ba);}})});
13
+ _.D("clpp.persistent.removeLicense",function(a){var b,c,d,e,f,g,h;return _.A(function(l){switch(l.a){case 1:b=Gu;c=Hu;if(!_.K.Y(a)||0===a.length)return c.warn("Invalid offlineId"),l["return"]();e=d=null;_.zf(l,2,3);return _.x(l,b.get(a),5);case 5:f=l.f;if(!f)return c.debug("No persistent DRM session found"),l["return"]();f.drmConfig.delayLicenseRequestUntilPlayed=!0;e=new _.di;d=Fu(f.drmConfig,e);return _.x(l,Cu(d,f.keySystem,f.licenseServerUri,f.serverCertificate,f.audioCapabilities,f.videoCapabilities),
14
+ 6);case 6:return _.x(l,_.im(d),7);case 7:return _.x(l,Promise.all(f.sessionIds.map(function(m){return _.A(function(n){if(1==n.a)return _.x(n,yu(d,m),2);c.debug("successfully removed session with id",m);_.y(n)})})),8);case 8:return _.x(l,b["delete"](a),3);case 3:return uu(l),g=[],d&&g.push(d.destroy()),e&&g.push(e.destroy()),_.x(l,Promise.all(g),10);case 10:vu(l);break;case 2:throw h=_.Bf(l),c.error("Failed to remove session"),new _.L(1,6,6201,null,h);}})});var Gu=new Du,Hu=new _.H(tu);_.v(Ju,_.Jo);_.t=Ju.prototype;_.t.Ia=function(a){this.l=a};_.t.Ca=function(){this.l=null};_.t.release=function(){};_.t.Xb=function(){this.f=Gu};_.t.id=function(){return _.Wd};_.t.vj=function(a,b,c){var d=this,e;return _.A(function(f){if(1==f.a){if(!a)return d.a.debug("No DRM configuration found for loaded source."),f["return"]();_.zf(f,2);return _.x(f,Iu(a,b,c),4)}if(2!=f.a)return d.l.trigger(new _.J(_.cd,{offlineId:a.offlineId})),_.Af(f,0);e=_.Bf(f);d.l.onError(e);_.y(f)})};
15
+ _.t.ji=function(a){var b=this,c;return _.A(function(d){if(1==d.a)return _.zf(d,2),_.x(d,b.f.get(a),4);if(2!=d.a){if(c=d.f)return d["return"](c.sessionIds);b.a.debug("No offline session found for "+a);return d["return"]([])}_.Bf(d);b.a.warn("Error while loading session info from storage");return d["return"]([])})};_.D("clpp.persistent.PersistentLicenseComponent",Ju);};
16
16
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
17
17
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
18
18
  else{_=this.clpp._;(f.call(g,this));}
@@ -1,10 +1,10 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var nu=function(a,b){b=void 0===b?function(){return Promise.resolve()}:b;_.Rj.call(this);this.l=a;this.j=b;this.f=0;this.a=[];this.g=!1;this.h=this.dg.bind(this)},ou=function(a){a.trigger(new _.J(_.ae))},pu=function(a,b){return 0<=b&&b<a.a.length};_.v(nu,_.Rj);_.t=nu.prototype;_.t.on=function(a,b,c){return _.Rj.prototype.on.call(this,a,b,c)};_.t.one=function(a,b,c){return _.Rj.prototype.one.call(this,a,b,c)};_.t.off=function(a,b){return _.Rj.prototype.off.call(this,a,b)};_.t.getPosition=function(){return this.f};
3
- _.t.oi=function(){return this.a};_.t.se=function(){return 0<this.a.length&&pu(this,this.f)?this.a[this.f]:null};_.t.pi=function(){var a=this.f+1;return 0<this.a.length&&pu(this,a)?this.a[a]:null};_.t.zi=function(){return this.g};_.t.start=function(){this.g||(this.g=!0,this.l.on(_.gd,this.h),this.Hd(this.f,!0))};_.t.stop=function(){this.g=!1;this.l.off(_.gd,this.h)};_.t.dg=function(){this.next()};
4
- _.t.next=function(){var a=this,b;return _.B(function(c){b=Math.min(a.a.length-1,a.f+1);return _.x(c,a.Hd(b),0)})};_.t.Cj=function(){var a=this,b;return _.B(function(c){b=Math.max(0,a.f-1);return _.x(c,a.Hd(b),0)})};_.t.Hd=function(a,b){b=void 0===b?!1:b;var c=this,d;return _.B(function(e){if(1==e.a){if(!(0<c.a.length&&pu(c,a))||!b&&c.f===a)return e["return"]();c.f=a;return(d=c.se())?_.x(e,c.j(d),3):e.H(0)}if(4!=e.a)return _.x(e,c.l.load(d.configuration),4);c.trigger(new _.J(_.$d,{item:d}));_.z(e)})};
5
- _.t.append=function(a){this.a.push(a);ou(this)};_.t.wi=function(a,b){if(0<=b&&b<=this.a.length){var c=this.se();this.a.splice(b,0,a);c&&(this.f=this.a.indexOf(c));ou(this)}};_.t.remove=function(a){if(0<this.a.length&&pu(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);ou(this)}};_.t.clear=function(){this.stop();this.f=0;this.a=[];this.g=!1;ou(this)};_.C("clpp.Playlist",nu);nu.prototype.clear=nu.prototype.clear;nu.prototype.remove=nu.prototype.remove;
6
- nu.prototype.insert=nu.prototype.wi;nu.prototype.append=nu.prototype.append;nu.prototype.goTo=nu.prototype.Hd;nu.prototype.previous=nu.prototype.Cj;nu.prototype.next=nu.prototype.next;nu.prototype.onEnded=nu.prototype.dg;nu.prototype.stop=nu.prototype.stop;nu.prototype.start=nu.prototype.start;nu.prototype.isStarted=nu.prototype.zi;nu.prototype.getUpcoming=nu.prototype.pi;nu.prototype.getCurrent=nu.prototype.se;nu.prototype.getQueue=nu.prototype.oi;nu.prototype.getPosition=nu.prototype.getPosition;
7
- nu.prototype.off=nu.prototype.off;nu.prototype.one=nu.prototype.one;nu.prototype.on=nu.prototype.on;};
2
+ var f=function(window){var ou=function(a,b){b=void 0===b?function(){return Promise.resolve()}:b;_.Sj.call(this);this.l=a;this.j=b;this.f=0;this.a=[];this.g=!1;this.h=this.cg.bind(this)},pu=function(a){a.trigger(new _.J(_.be))},qu=function(a,b){return 0<=b&&b<a.a.length};_.v(ou,_.Sj);_.t=ou.prototype;_.t.on=function(a,b,c){return _.Sj.prototype.on.call(this,a,b,c)};_.t.one=function(a,b,c){return _.Sj.prototype.one.call(this,a,b,c)};_.t.off=function(a,b){return _.Sj.prototype.off.call(this,a,b)};_.t.getPosition=function(){return this.f};
3
+ _.t.li=function(){return this.a};_.t.se=function(){return 0<this.a.length&&qu(this,this.f)?this.a[this.f]:null};_.t.mi=function(){var a=this.f+1;return 0<this.a.length&&qu(this,a)?this.a[a]:null};_.t.vi=function(){return this.g};_.t.start=function(){this.g||(this.g=!0,this.l.on(_.id,this.h),this.Hd(this.f,!0))};_.t.stop=function(){this.g=!1;this.l.off(_.id,this.h)};_.t.cg=function(){this.next()};
4
+ _.t.next=function(){var a=this,b;return _.A(function(c){b=Math.min(a.a.length-1,a.f+1);return _.x(c,a.Hd(b),0)})};_.t.yj=function(){var a=this,b;return _.A(function(c){b=Math.max(0,a.f-1);return _.x(c,a.Hd(b),0)})};_.t.Hd=function(a,b){b=void 0===b?!1:b;var c=this,d;return _.A(function(e){if(1==e.a){if(!(0<c.a.length&&qu(c,a))||!b&&c.f===a)return e["return"]();c.f=a;return(d=c.se())?_.x(e,c.j(d),3):e.G(0)}if(4!=e.a)return _.x(e,c.l.load(d.configuration),4);c.trigger(new _.J(_.ae,{item:d}));_.y(e)})};
5
+ _.t.append=function(a){this.a.push(a);pu(this)};_.t.pi=function(a,b){if(0<=b&&b<=this.a.length){var c=this.se();this.a.splice(b,0,a);c&&(this.f=this.a.indexOf(c));pu(this)}};_.t.remove=function(a){if(0<this.a.length&&qu(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);pu(this)}};_.t.clear=function(){this.stop();this.f=0;this.a=[];this.g=!1;pu(this)};_.D("clpp.Playlist",ou);ou.prototype.clear=ou.prototype.clear;ou.prototype.remove=ou.prototype.remove;
6
+ ou.prototype.insert=ou.prototype.pi;ou.prototype.append=ou.prototype.append;ou.prototype.goTo=ou.prototype.Hd;ou.prototype.previous=ou.prototype.yj;ou.prototype.next=ou.prototype.next;ou.prototype.onEnded=ou.prototype.cg;ou.prototype.stop=ou.prototype.stop;ou.prototype.start=ou.prototype.start;ou.prototype.isStarted=ou.prototype.vi;ou.prototype.getUpcoming=ou.prototype.mi;ou.prototype.getCurrent=ou.prototype.se;ou.prototype.getQueue=ou.prototype.li;ou.prototype.getPosition=ou.prototype.getPosition;
7
+ ou.prototype.off=ou.prototype.off;ou.prototype.one=ou.prototype.one;ou.prototype.on=ou.prototype.on;};
8
8
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
9
9
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
10
10
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.smooth.js CHANGED
@@ -1,74 +1,75 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var DG="Full MP4 box must have flags defined",EG="clpp.smooth.SmoothMP4Processor",FG="codecPrivateData",GG=function(a,b){var c=Math.floor(b/Math.pow(2,32)),d=b-c*Math.pow(2,32);_.T(a,c);_.T(a,d)},HG=function(a,b){try{a.f.setUint8(a.a,b),a.a+=1}catch(c){_.Ck()}},IG=function(a,b){HG(a,b>>16&255);HG(a,b>>8&255);HG(a,b&255)},JG=function(a,b){try{a.f.setUint16(a.a,b,a.g),a.a+=2}catch(c){_.Ck()}},KG=function(a,b){try{a.f.setInt32(a.a,b,a.g),a.a+=4}catch(c){_.Ck()}},LG=function(a,b){try{a.f.setInt16(a.a,
3
- b,a.g),a.a+=2}catch(c){_.Ck()}},MG=function(a,b){if(void 0!=b){for(var c=new Uint8Array(b),d=Math.min(a.length,b),e=0;e<d;++e)c[e]=a.charCodeAt(e);for(;e<b;e++)c[e]=0;return c}c=new Uint8Array(a.length);for(d=0;d<a.length;++d)c[d]=a.charCodeAt(d);return c},X=function(a){this.type=a;this.size=this.start=0;this.parent=null;this.w=!1;this.entries=[];this.f=[]},Y=function(a,b,c){X.call(this,a);this.version=b;this.flags=c},NG=function(a,b,c){X.call(this,a);this.g=b;this.offset=c},OG=function(a,b,c,d,e){Y.call(this,
4
- a,b,c);this.g=d;this.offset=e},PG=function(a,b,c){X.call(this,"ftyp");this.h=a;this.Xf=b;this.g=c},QG=function(){X.call(this,_.Ed)},RG=function(){X.call(this,_.Ge)},SG=function(a,b,c){Y.call(this,"mvhd",1,0);this.timescale=a;this.duration=b;this.volume=256;this.h=c+1;this.g=[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0]},TG=function(){X.call(this,"mvex")},UG=function(a){Y.call(this,"trex",0,0);this.g=a},VG=function(a,b,c,d,e){Y.call(this,"tkhd",1,7);this.h=a;this.duration=
5
- b;this.timescale=c;this.width=d;this.height=e;this.volume=1;this.g=[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0]},WG=function(a,b){Y.call(this,"mdhd",1,0);this.timescale=a;this.duration=b;this.language=21956},XG=function(a){Y.call(this,"hdlr",0,0);this.g=a},YG=function(){Y.call(this,"vmhd",0,1);this.g=new Uint8Array([0,0,0,0,0,0])},ZG=function(a){X.call(this,a);this.w=!0},$G=function(a){ZG.call(this,a);this.height=this.width=0;this.depth=24},aH=function(a,b,c,d){ZG.call(this,
6
- a);this.channelCount=b;this.sampleSize=c;this.sampleRate=d},bH=function(a,b){$G.call(this,"avc1");this.width=a;this.height=b},cH=function(a,b){bH.call(this,a,b);this.type="encv"},dH=function(a,b,c){aH.call(this,"mp4a",a,b,c)},eH=function(a,b,c){dH.call(this,a,b,c);this.type="enca"},fH=function(a,b){X.call(this,"avcC");this.La=a;this.Qb=b;this.version=1;this.g=this.La[0][1];this.h=this.La[0][2];this.level=this.La[0][3]},gH=function(a){Y.call(this,"esds",0,0);this.Ib=a},hH=function(a){a=void 0===a?
7
- "":a;Y.call(this,"url ",0,1);this.location=a},iH=function(){Y.call(this,"dref",0,0)},jH=function(){X.call(this,_.ue)},kH=function(){Y.call(this,_.we,0,0)},lH=function(){Y.call(this,"stts",0,0)},mH=function(){Y.call(this,"stsc",0,0)},nH=function(){Y.call(this,"stco",0,0)},oH=function(){Y.call(this,"stsz",0,0)},pH=function(){Y.call(this,"smhd",0,0)},qH=function(){X.call(this,"dinf")},rH=function(){X.call(this,_.Dd)},sH=function(){X.call(this,_.zd)},tH=function(a,b){Y.call(this,"tfdt",a,0);this.g=b},
8
- uH=function(){Y.call(this,"mfhd",0,0);this.g=0},vH=function(a,b){Y.call(this,"trun",a,b);this.m=this.j=this.g=0;this.o=[];this.sampleSize=[];this.A=[];this.h=[]},wH=function(a,b){Y.call(this,"tfhd",a,b);this.g=255;this.m=this.o=this.j=this.A=this.h=0},xH=function(){X.call(this,"traf")},yH=function(){X.call(this,"moof")},zH=function(){X.call(this,_.yd);this.g=new Uint8Array(0)},AH=function(){Y.call(this,"tenc",0,0);this.g=1;this.h=8;this.m="";this.j=[]},BH=function(a,b){Y.call(this,"schm",0,0);this.g=
9
- a;this.h=b;this.Db=""},CH=function(a){X.call(this,"frma");this.g=a},DH=function(){Y.call(this,"saio",0,0);this.offset=[0]},EH=function(a,b,c){Y.call(this,"saiz",0,0);this.g=a;this.j=b;this.h=c},FH=function(a,b){Y.call(this,"senc",a,b);this.h=0;this.j=8;this.g=[]},GH=function(a){var b=a.split("/");return b[b.length-1].toLowerCase().match("manifest(\\(.+\\))?")?a:a+"/Manifest"},HH=function(a,b,c,d){c=b.Kf[c];b=b.Xj;a=a.replace("Manifest","");b=b.replace("{bitrate}",String(d.bitrate)).replace("{Bitrate}",
10
- String(d.bitrate)).replace("{start time}",String(c.t)).replace("{start_time}",String(c.t));return _.Jv([a],[b])[0]},IH=function(a,b){if(a.type!==b.type)return!1;var c=[];a.type===_.Re?c=["maxWidth","maxHeight","bitrate",FG,"fourCC"]:a.type===_.jc&&(c=["bitrate",FG,"channels","bitsPerSample","samplingRate","fourCC"]);return _.K.va(a,b,c,["id","segmentIndex"])},JH=function(a,b,c){var d=c.xd.split("00000001");a={id:1,type:c.type,duration:a/b,timescale:b,La:null,Qb:null,width:NaN,height:NaN,Ib:null,ld:NaN,
11
- sampleSize:NaN,channelCount:NaN};switch(c.type){case _.Re:a.La=[_.lk(d[1])];a.Qb=[_.lk(d[2])];a.width=c.maxWidth;a.height=c.maxHeight;break;case _.jc:a.Ib=_.lk(c.xd),a.sampleSize=c.Kg||16,a.ld=c.ld,a.channelCount=c.rf}return a},KH=function(a,b){return a.filter(function(c){return c.type===b})},LH=function(a,b){var c=a.exec(b);return null==c||""==c[0]?null:(Number(c[4])||0)/1E3+(Number(c[3])||0)+60*(Number(c[2])||0)+3600*(Number(c[1])||0)},SH=function(a,b,c){var d=null;if(MH.test(a)){a=MH.exec(a);d=
12
- Number(a[1]);var e=Number(a[2]),f=Number(a[3]),g=Number(a[4]);g+=(Number(a[5])||0)/c.f;f+=g/c.frameRate;d=f+60*e+3600*d}else NH.test(a)?d=LH(NH,a):OH.test(a)?d=LH(OH,a):PH.test(a)?(a=PH.exec(a),d=Number(a[1])/c.frameRate):QH.test(a)?(a=QH.exec(a),d=Number(a[1])/c.a):RH.test(a)&&(d=LH(RH,a));d+=b;b=Math.floor(d/3600);c=Math.floor((d-3600*b)/60);a=Math.floor(d-3600*b-60*c);d-=a;10>b&&(b="0"+b);10>c&&(c="0"+c);10>a&&(a="0"+a);0===d?d="000":d=Math.round(1E3*d);return b+":"+c+":"+a+"."+d},TH=function(a,
13
- b,c,d){this.frameRate=Number(a)||30;this.f=Number(b)||1;this.a=Number(d);0==this.a&&(this.a=a?this.frameRate*this.f:1);c&&(a=/^(\d+) (\d+)$/g.exec(c))&&(this.frameRate*=parseInt(a[1],10)/parseInt(a[2],10))},VH=function(a){this.a=a;this.f=UH(this)},UH=function(a){for(var b=0,c=0;c<a.a.length;c++)b+=a.a[c].a();return new _.Bk(b)},WH=function(a,b,c){a:{var d=_.u([_.Rc,_.Qc]);for(var e=d.next();!e.done;e=d.next())if((e=c.Ed(e.value))&&e.keyId){d=e.keyId;break a}_.G(EG,"Could not get default Key ID for DRM init data!");
14
- d=null}c=new X("xxxx");a.type===_.Re?c=new cH(a.width,a.height):c=new eH(a.channelCount,a.sampleSize,a.ld);a=new AH;a.g=1;a.h=8;a.m=d||"00000000000000000000000000000000";a=(new X("schi")).append([a]);b=(new X(_.oe)).append([new CH(b),new BH(_.Ac,65536),a]);c.append([b]);return c},XH=function(a,b){var c=b.Md(),d=new SG(a.timescale,a.duration,a.id),e=(new TG).append([new UG(a.id)]),f=new VG(a.id,a.duration,a.timescale,a.width,a.height),g=new WG(a.timescale,a.duration),h=new XG(a.type),l=null,m=new iH;
15
- m.entries=[new hH];var n=new kH;switch(a.type){case _.Re:var p=new fH(a.La,a.Qb);c?(l=WH(a,"avc1",b),l.append([p]),n.entries=[l]):(l=(new bH(a.width,a.height)).append([p]),n.entries=[l]);l=new YG;break;case _.jc:p=new gH(a.Ib),c?(l=WH(a,"mp4a",b),l.append([p]),n.entries=[l]):(l=(new dH(a.channelCount,a.sampleSize,a.ld)).append([p]),n.entries=[l]),l=new pH}n=(new jH).append([n,new lH,new mH,new oH,new nH]);m=(new qH).append([m]);m=(new rH).append([l,m,n]);g=(new sH).append([g,h,m]);f=(new RG).append([f,
16
- g]);d=(new QG).append([d,f,e]);e=new PG("dash",0,["iso6","mp41","avc1"]);c&&(c=b.Ed(_.Qc),f=b.Ed(_.Rc),c&&d.append([new NG("pssh",c.initData,8)]),f&&d.append([new NG("pssh",f.initData,8)]),c||f||_.G(EG,"Could not get PSSH init data!"));c=new VH([e,d]);return _.N(c.write())},ZH=function(a,b){var c,d,e,f,g,h;(new _.Nk).M("moof",_.Ok).W("mfhd",function(m){var n=new uH;n.g=_.U(m.G);c=n}).M("traf",_.Ok).W("tfhd",function(m){var n=m.G.ya();if(null===m.flags)throw new _.L(_.M,3,3019,DG);var p=new wH(m.version||
17
- 0,m.flags||0);p.g=_.U(m.G);0<n-m.G.getPosition()&&m.flags&1&&(p.h=_.Lk(m.G));0<n-m.G.getPosition()&&m.flags&2&&(p.A=_.U(m.G));0<n-m.G.getPosition()&&m.flags&8&&(p.j=_.U(m.G));0<n-m.G.getPosition()&&m.flags&16&&(p.o=_.U(m.G));0<n-m.G.getPosition()&&m.flags&32&&(p.m=_.U(m.G));d=p}).W("trun",function(m){var n=m.G.ya();if(null===m.flags)throw new _.L(_.M,3,3019,DG);var p=new vH(m.version||0,m.flags||0);p.g=_.U(m.G);0<n-m.G.getPosition()&&m.flags&1&&(p.j=_.Jk(m.G));0<n-m.G.getPosition()&&m.flags&4&&(p.m=
18
- _.U(m.G));if(0<n-m.G.getPosition())for(n=0;n<p.g;n++)m.flags&256&&p.o.push(_.U(m.G)),m.flags&512&&p.sampleSize.push(_.U(m.G)),m.flags&1024&&p.A.push(_.U(m.G)),m.flags&2048&&(0===m.version?p.h.push(_.U(m.G)):p.h.push(_.Jk(m.G)));e=p}).W("sdtp",function(m){var n=_.Mk(m.G,m.G.ya());f=new OG("sdtp",m.version||0,m.flags||0,n,0)}).M("uuid",function(m){var n=_.Mk(m.G,16);if(_.nk(n,YH)){n=_.U(m.G);m.version=n>>>24;m.flags=n&16777215;n=new FH(m.version,m.flags);n.h=_.U(m.G);m.flags&1&&(n.j=_.Hk(m.G));for(var p=
19
- 0;p<n.h;p++){var q={Of:_.Mk(m.G,8),Nc:0,af:[]};if(m.flags&2){q.Nc=_.Ik(m.G);for(var r=0;r<q.Nc;r++){var w={pf:0,qf:0};w.pf=_.Ik(m.G);w.qf=_.U(m.G);q.af.push(w)}}n.g.push(q)}g=n}}).M(_.yd,function(m){var n=new zH;0<m.G.ya()?n.g=_.Mk(m.G,m.G.ya()):(_.G(EG,"mdat box is empty!"),n.g=new Uint8Array(0));h=n}).parse(a,!1);if(!h)return null;var l=(new xH).append([d,e]);f&&l.append([f]);b.Md()&&g&&l.append([g]);l=(new yH).append([c,l]);return new VH([l,h])},$H=function(a,b,c){var d=c.Md(),e=a.request.startTime,
20
- f=parseInt(e*b,10);b=a.data||new ArrayBuffer(0);var g=ZH(b,c);if(null===g)return a.request.contentType===_.Ce?a.data:g;c=g.get(_.yd);if(a.request.contentType===_.Ce){d=c.g.buffer;if(e){d=_.yh(d);if((d=(new DOMParser).parseFromString(d,_.Ee))&&"tt"===d.documentElement.tagName.toLowerCase())var h=d.documentElement;if(h&&(c=new TH(h.getAttribute("ttp:frameRate"),h.getAttribute("ttp:subFrameRate"),h.getAttribute("ttp:frameRateMultiplier"),h.getAttribute("ttp:tickRate")),h=h.getElementsByTagName("body")[0]))for(h=
21
- h.getElementsByTagName("p"),a=0,b=h.length;a<b;a++){f=h[a];g=["begin",_.fd];for(var l=0,m=g.length;l<m;l++){b:{var n=f;var p=g[l],q=new RegExp("\\w+:"+p),r=0;if(n.hasAttribute(p))n=n.getAttribute(p);else{p=n.attributes;for(var w=p.length;r<w;r++){var y=p[r].name;if(y=y.match(q)){n=n.getAttribute(y[0]);break b}}n=null}}f.setAttribute(g[l],SH(n||"",e,c))}}d=(new XMLSerializer).serializeToString(d);e=_.zh(d).buffer}else e=d;return e}h=new yH;a=g.get("mfhd");b=new xH;l=g.get("tfhd");m=new tH(1,f);f=g.get("trun");
22
- n=g.get("sdtp");e=g.get("senc");l.g=1;l.flags&=16777214;l.flags|=131072;b.append([l,m,f]);n&&b.append([n]);if(d){g=0;l=[];if(e.flags&2)for(l=[],m=0;m<e.h;m++)l.push(10+6*e.g[m].Nc);else g=8;b.append([e,new DH,new EH(g,l,e.h)])}h.append([a,b]);f.flags|=1;f.j=h.a()+8;c=new VH([h,c]);h=c.write();d&&(d=c.get("saio"),c=c.f,d.offset[0]=e.start+16,c.seek(d.start),d.write(c),h=c.buffer);return h},aI=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,
23
- audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[b],keyIds:c,periodId:null}},bI=function(a,b,c){a=_.Nl(a);c&&a.version!==c&&(a=_.Cv(a,c));return{initData:_.Av(a),initDataType:_.Ac,keyId:b,periodId:null}},dI=function(){this.w=this.h=this.g=this.C=null;this.L=1;this.R=0;this.m="";this.A=this.a=null;this.f=new _.H("clpp.smooth.SmoothParser");this.J=!1;this.j=this.B=null;this.N=cI;this.F=0;this.D=this.I=Infinity;this.o=[];this.K=this.Ij.bind(this)},eI=function(a,b){var c,d,e;return _.B(function(f){if(1==
24
- f.a)return c=_.Oh(b),c.timeout=a.g.attemptParameters.timeout,c.maxAttempts=Math.max(a.g.attemptParameters.maxAttempts,b.length),c.baseDelay=a.g.attemptParameters.baseDelay,c.backoffFactor=a.g.attemptParameters.backoffFactor,c.fuzzFactor=a.g.attemptParameters.fuzzFactor,c.type=1,d=a.C.networkingEngine.fetch(c),_.x(f,d.P,2);e=f.f;a.m=e.uri;return f["return"](e)})},lI=function(a,b){var c=null;try{var d=new DOMParser;try{var e=_.yh(b);var f=d.parseFromString(e.trim(),_.Ee)}catch(dC){throw dC;}if(f&&f.documentElement.tagName==
25
- _.ub)var g=f.documentElement;c=g&&0<g.getElementsByTagName("parsererror").length?null:g}catch(dC){}if(!c)throw a.f.error("Unable to parse manifest"),new _.L(_.M,4,4033,a.m);var h=+fI(a,c,"MajorVersion"),l=+fI(a,c,"MinorVersion"),m=+c.getAttribute("TimeScale")||1E7,n=+fI(a,c,"Duration"),p="TRUE"===c.getAttribute("IsLive"),q=+c.getAttribute("LookAheadCount"),r=+c.getAttribute("DVRWindowLength")||Infinity,w=_.zl(c,"Protection")[0];if(!1===/^[2].[0-2]$/.test(""+h+"."+l))throw a.f.error("Smooth Streaming version must be 2.0, 2.1 or 2.2"),
26
- new _.L(_.M,4,4036,a.m);p?(gI(a,hI),a.B=typeof a.g.liveRefreshPeriod===_.k?1E3*a.g.liveRefreshPeriod:Math.min(1E3*a.F,1E4),n=Infinity):gI(a,cI);a.a={startTime:0,delay:0,duration:n/m,oe:r/m,fd:0};if(w){var y=a.g.playreadyVersion,A=[],E=_.zl(w,"ProtectionHeader")[0],F=_.kk(_.Bl(E)||""),D=_.Nl(F).a;A.push(aI(_.Rc,{initData:_.Av(_.Gl(D)),initDataType:_.Ac,keyId:D,periodId:null},[D]));A.push(aI(_.Qc,bI(F,D,y),[D]));a.o=A}var I=[],O=_.zl(c,"StreamIndex");if(!O.length)throw a.f.error("No streams found!"),
27
- new _.L(_.M,4,4034,a.m);for(var S=0;S<O.length;S++){for(var Fa,fa=a,ka=O[S],wa=fI(fa,ka,"Type"),Aa=+ka.getAttribute("Chunks"),la=ka.getAttribute("Subtype"),ra=_.Ki(ka.getAttribute("Language")||_.Ie),Ga=ka.getAttribute("Name")||"",Ma=+ka.getAttribute(_.Wa),ab=+ka.getAttribute(_.Va),Eb=fI(fa,ka,"Url"),me=+ka.getAttribute("TimeScale")||null,eh=[],Li=_.zl(ka,_.ib),fh=0;fh<Li.length;fh++){var $c=fa,rb=Li[fh],Vf=wa,SL=+rb.getAttribute("Index"),TL=+fI($c,rb,"Bitrate"),gC=NaN,hC=NaN,Bm=NaN,$r=NaN,iC=NaN,
28
- jC=NaN,kC=NaN,lC=rb.getAttribute("FourCC");switch(Vf){case _.Re:gC=+fI($c,rb,_.Va);hC=+fI($c,rb,_.Wa);break;case _.jc:$r=+rb.getAttribute("Channels")||2,Bm=+fI($c,rb,"SamplingRate"),jC=+fI($c,rb,"AudioTag"),iC=+fI($c,rb,"BitsPerSample"),kC=+fI($c,rb,"PacketSize")}var as=String(rb.getAttribute("CodecPrivateData"));if(Vf===_.jc&&!as){var mC=$r,nC={96E3:0,88200:1,64E3:2,48E3:3,44100:4,32E3:5,24E3:6,22050:7,16E3:8,12E3:9,11025:10,8E3:11,7350:12},Cm=nC[Bm];if("AACH"===lC){var mc=new Uint8Array(4);var oC=
29
- nC[2*Bm];mc[0]=40|Cm>>1;mc[1]=Cm<<7|mC<<3|oC>>1;mc[2]=oC<<7|8;mc[3]=0;var Yf=new Uint16Array(2);Yf[0]=(mc[0]<<8)+mc[1];Yf[1]=(mc[2]<<8)+mc[3];var pC=Yf[0].toString(16)+Yf[1].toString(16)}else mc=new Uint8Array(2),mc[0]=16|Cm>>1,mc[1]=Cm<<7|mC<<3,Yf=new Uint16Array(1),Yf[0]=(mc[0]<<8)+mc[1],pC=Yf[0].toString(16);as=pC.toUpperCase()}var UL={id:$c.R++,type:Vf,index:SL,bitrate:TL,xd:as,maxHeight:gC,maxWidth:hC,ld:Bm,rf:$r,mk:jC,Kg:iC,zk:kC,gi:lC,segmentIndex:null};eh.push(UL)}Fa=eh;for(var qe=[],qC=_.zl(ka,
30
- "c"),cj=0;cj<qC.length;cj++){var bs=qC[cj],Gd=parseInt(bs.getAttribute("t"),10),ih=parseInt(bs.getAttribute("d"),10),cs=parseInt(bs.getAttribute("r"),10),dj=0;if(isNaN(Gd)&&isNaN(ih))throw fa.f.error("Either one or both FragmentDuration and FragmentTime field MUST be present in StreamFragmentElement"),new _.L(_.M,4,4037,fa.m);0===cj&&isNaN(Gd)&&(dj=Gd=0);if(0<cj){var Zf=qe[qe.length-1];dj=Zf.n+1;Zf.d||(Zf.d=Gd-Zf.t);Gd||(Gd=Zf.t+Zf.d);ih||(ih=Gd-Zf.t)}qe.push({n:dj,d:ih,t:Gd});if(cs){cs--;for(var rC=
31
- 0;rC<cs;rC++){var Dm=qe[qe.length-1];dj=Dm.n+1;Gd=Dm.t+Dm.d;ih=Dm.d;qe.push({n:dj,d:ih,t:Gd})}}}fa.Xc()||qe.length===Aa||fa.f.warn("Number of fragments ("+Aa+") differs from number of chunks ("+qe.length+").");I.push({type:wa,qk:Aa,Qj:la,language:ra,name:Ga,maxWidth:Ma,maxHeight:ab,Xj:Eb,tracks:Fa,Kf:qe,timescale:me})}var jf={xk:h,Xf:l,timescale:m,duration:n,isLive:p,wk:q,oe:r,we:!1,streams:I};if(a.h&&a.w)return iI(a,jf),Promise.resolve();var ds=jf.timescale,es=jf.duration,WL=KH(jf.streams,_.jc),
32
- XL=KH(jf.streams,_.Re),YL=KH(jf.streams,_.Ce),sC=[],Em=jI(a,es,ds,WL),Fm=jI(a,es,ds,XL),ZL=jI(a,es,ds,YL);Em.length||(Em=[null]);Fm.length||(Fm=[null]);for(var gs=0;gs<Fm.length;gs++)for(var hs=0;hs<Em.length;hs++)sC.push(kI(a,Fm[gs],Em[hs]));var tC={startTime:0,variants:sC,textStreams:ZL,thumbStreams:[]};var aM=jf.streams,is=a.a.startTime,uC=a.a.delay,js=a.I,vC=Math.min(a.a.duration||Infinity,js),ks=a.Xc(),bM=a.a.oe,cM=a.a.fd,wC=a.F,xC=isFinite(a.D)?a.D:0;if(ks)vC=Infinity,is=Date.now()/1E3-cM,a.a.startTime=
33
- is,uC=3*wC;else for(var dM=isFinite(js)?js:a.a.duration,yC=_.u(aM),ls=yC.next();!ls.done;ls=yC.next())for(var zC=_.u(ls.value.tracks),ms=zC.next();!ms.done;ms=zC.next()){var AC=ms.value;AC.segmentIndex.offset(-xC);_.xw(AC.segmentIndex,dM)}a.A=new _.gw(is,uC,!ks,!0);a.A.Tb(vC);_.kw(a.A,wC);a.A.ic=bM;ks||a.A.offset(-xC);a.C.filterAllPeriods([tC]);a.h={presentationTimeline:a.A,periods:[tC],offlineSessionIds:[],minBufferTime:0};Promise.resolve();a.J||(a.C.networkingEngine.de(a.K),a.J=!0);a.w=jf;return Promise.resolve()},
34
- iI=function(a,b){for(var c=0;c<a.w.streams.length;c++)for(var d=b.streams[c],e={},f=_.u(a.w.streams[c].tracks),g=f.next();!g.done;e={Hb:e.Hb},g=f.next())if(e.Hb=g.value,g=d.tracks.find(function(l){return function(m){return m.type===l.Hb.type&&m.bitrate===l.Hb.bitrate}}(e))){IH(e.Hb,g)||a.f.warn("The current stream is updated with a stream that seems to have different base properties!");var h=mI(a,a.w.timescale,d,g);g=e.Hb.segmentIndex;g.Wa(h);(h=a.a.oe)&&_.vw(g,_.uw(g)-h)}else a.f.warn("Cannot find satisfying update for "+
35
- e.Hb.type+" track with bitrate "+(e.Hb.bitrate+". Skipping update."))},jI=function(a,b,c,d){for(var e=[],f={sc:0};f.sc<d.length;f={sc:f.sc},f.sc++){var g=d[f.sc].tracks.map(function(h){return function(l){var m=d[h.sc],n=mI(a,c,m,l),p=new _.tw(n),q=null;m.type!==_.Ce&&(q=nI(a,b,c,m,l));l.segmentIndex=p;n=a.L++;var r=Promise.resolve.bind(Promise),w=p.Bc.bind(p),y=p.get.bind(p),A=p.Qc.bind(p);p=p.getDuration.bind(p);var E=oI[m.type],F="";switch(m.type){case _.Re:F=l.xd;var D=/00000001[0-9]7/.exec(F);
36
- F="avc1."+(D&&D[0]?F.substr(F.indexOf(D[0])+10,6):"42c00c");a.f.debug("VIDEO CODECS: ",F);break;case _.jc:F=l.xd,D=2,"AACH"===l.gi?D=5:F&&(D=(parseInt(F.substr(0,2),16)&248)>>3),F="mp4a.40."+D,a.f.debug("AUDIO CODECS: ",F)}D=m.type===_.Ce?pI[m.Qj]:void 0;return{id:n,originalId:null,Bk:null,createSegmentIndex:r,findSegmentPosition:w,getSegmentReference:y,adjustSegmentDurations:A,getDuration:p,segmentIndex:null,segmentLookupStrategy:_.mv,initSegmentReference:q,mimeType:E,codecs:F,frameRate:void 0,bandwidth:l.bitrate,
37
- width:l.maxWidth||void 0,height:l.maxHeight||void 0,kind:D,encrypted:a.ye(),keyId:null,language:m.language,label:m.name,type:m.type,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:l.rf||null,closedCaptions:null}}}(f));e=e.concat(g)}return e},mI=function(a,b,c,d){var e=0,f=[],g=c.timescale||b;c.Kf.forEach(function(h,l){var m=h.d/g;if(0===l){var n=h.t/g;a.D=Math.min(a.D,n)}else n=f[l-1].endTime;var p=n+m,q=HH(a.m,c,l,d);a.F=Math.max(a.F,m);f.push(new _.fw(l,n,p,function(){return[q]},
38
- 0,null,0,null,!0,g));e+=m});if(c.type===_.Re||c.type===_.jc)b=f[f.length-1],a.I=Math.min(a.I,e),0===a.a.fd?a.a.fd=b.endTime:a.a.fd=Math.min(a.a.fd,b.endTime);return f},nI=function(a,b,c,d,e){b=JH(b,d.timescale||c,e);c={isLive:a.Xc.bind(a),Md:a.ye.bind(a),li:function(){return 1},Ed:a.Mf.bind(a)};d=new Uint8Array(0);try{d=XH(b,c)}catch(g){throw a.f.error("Failed to generate initialization segment."),new _.L(_.M,3,4035,g);}var f="data:text/plain;base64,"+_.jk(d);return new _.ew(function(){return[f]},
39
- 0,null,null,!0)},kI=function(a,b,c){var d=(c?c.bandwidth:0)+(b?b.bandwidth:0),e=c?c.language:_.Ie;return c||b?{id:a.L++,language:e,primary:!1,audio:c,video:b,bandwidth:d,drmInfos:a.o,allowedByApplication:!0,allowedByKeySystem:!0}:null},fI=function(a,b,c){if(b=b.getAttribute(c))return b;a.f.error("required attribute not provided: "+c);throw new _.L(_.M,4,4038,a.m,c);},qI=function(a,b){null!=a.B&&null!=b&&(a.j=window.setTimeout(a.Bb.bind(a),b))},gI=function(a,b){var c=b===cI;if(a.h&&a.h.presentationTimeline){var d=
40
- a.h.presentationTimeline;d.j=c;d.m=c}c&&null!=a.j&&(window.clearTimeout(a.j),a.j=null,a.B=null);a.N=b},rI=function(){};X.prototype.append=function(a){a=void 0===a?[]:a;for(var b=0;b<a.length;b++)this.f.push(a[b]),a[b].parent=this;return this};X.prototype.get=function(a){if(this.type===a)return this;for(var b=0;b<this.f.length;b++){if(this.f[b].type===a)return this.f[b];var c=this.f[b].get(a);if(c)return c}return null};
41
- X.prototype.a=function(){var a=Math.pow(2,32)-1;var b=4+this.type.length;"uuid"===this.type&&(b+=16);if(0<this.f.length)for(var c=0;c<this.f.length;c++)b+=this.f[c].a();this.size>a&&(b+=8);return b};
42
- X.prototype.write=function(a){var b=Math.pow(2,32)-1;this.start=a.getPosition();this.size=this.a();this.size>b?_.T(a,1):_.T(a,this.size);_.Dk(a,MG(this.type));this.size>b&&GG(a,this.size);"uuid"===this.type&&_.Dk(a,null);if(0<this.f.length&&!this.w)for(b=0;b<this.f.length;b++)this.f[b].write(a),this.f[b].a(),a.getPosition()};_.v(Y,X);Y.prototype.a=function(){return 4+X.prototype.a.call(this)};Y.prototype.write=function(a){X.prototype.write.call(this,a);HG(a,this.version);IG(a,this.flags)};
43
- _.v(NG,X);NG.prototype.a=function(){return this.g.byteLength+X.prototype.a.call(this)-this.offset};NG.prototype.write=function(a){X.prototype.write.call(this,a);_.Dk(a,this.g,this.offset);a.getPosition()};_.v(OG,Y);OG.prototype.a=function(){return this.g.byteLength+Y.prototype.a.call(this)-this.offset};OG.prototype.write=function(a){Y.prototype.write.call(this,a);_.Dk(a,this.g,this.offset);a.getPosition()};_.v(PG,X);
44
- PG.prototype.a=function(){var a=this.h.length;a=a+4+this.g.join("").length;return a+X.prototype.a.call(this)};PG.prototype.write=function(a){X.prototype.write.call(this,a);_.Dk(a,MG(this.h));_.T(a,this.Xf);_.Dk(a,MG(this.g.join("")));a.getPosition()};_.v(QG,X);_.v(RG,X);_.v(SG,Y);SG.prototype.a=function(){var a=0;a=1===this.version?a+28:a+16;a=a+44+this.g.length;return a+=Y.prototype.a.call(this)};
45
- SG.prototype.write=function(a){Y.prototype.write.call(this,a);1===this.version?(GG(a,0),GG(a,0),_.T(a,this.timescale),GG(a,this.duration*this.timescale)):(_.T(a,0),_.T(a,0),_.T(a,this.timescale),_.T(a,this.duration*this.timescale));_.T(a,65536);JG(a,this.volume);JG(a,0);_.T(a,0);_.T(a,0);for(var b=0;b<this.g.length;b++)HG(a,this.g[b]);_.T(a,0);_.T(a,0);_.T(a,0);_.T(a,0);_.T(a,0);_.T(a,0);_.T(a,this.h);a.getPosition()};_.v(TG,X);_.v(UG,Y);UG.prototype.a=function(){return 20+Y.prototype.a.call(this)};
46
- UG.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,this.g);_.T(a,1);_.T(a,0);_.T(a,0);_.T(a,0);a.getPosition()};_.v(VG,Y);VG.prototype.a=function(){var a=0;a=1===this.version?a+32:a+20;a=a+24+this.g.length;return a+Y.prototype.a.call(this)};
47
- VG.prototype.write=function(a){Y.prototype.write.call(this,a);1===this.version?(GG(a,0),GG(a,0),_.T(a,this.h),_.T(a,0),GG(a,this.duration*this.timescale)):(_.T(a,0),_.T(a,0),_.T(a,this.h),_.T(a,0),_.T(a,this.duration*this.timescale));_.T(a,0);_.T(a,0);JG(a,0);JG(a,0);JG(a,this.volume);JG(a,0);for(var b=0;b<this.g.length;b++)HG(a,this.g[b]);JG(a,this.width);JG(a,0);JG(a,this.height);JG(a,0);a.getPosition()};_.v(WG,Y);WG.prototype.a=function(){var a=0;a=1===this.version?a+28:a+16;return a+4+Y.prototype.a.call(this)};
48
- WG.prototype.write=function(a){Y.prototype.write.call(this,a);1===this.version?(GG(a,0),GG(a,0),_.T(a,this.timescale),GG(a,this.duration*this.timescale)):(_.T(a,0),_.T(a,0),_.T(a,this.timescale),_.T(a,this.duration*this.timescale));JG(a,this.language);JG(a,0);a.getPosition()};_.v(XG,Y);XG.prototype.a=function(){return 33+Y.prototype.a.call(this)};
49
- XG.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,0);this.g===_.Re?_.Dk(a,MG("vide")):_.Dk(a,MG("soun"));_.T(a,0);_.T(a,0);_.T(a,0);this.g===_.Re?_.Dk(a,MG("VideoHandler\x00")):_.Dk(a,MG("SoundHandler\x00"));a.getPosition()};_.v(YG,Y);YG.prototype.a=function(){return 2+this.g.byteLength+Y.prototype.a.call(this)};YG.prototype.write=function(a){Y.prototype.write.call(this,a);JG(a,0);_.Dk(a,this.g);a.getPosition()};_.v(ZG,X);ZG.prototype.a=function(){return 8+X.prototype.a.call(this)};
50
- ZG.prototype.write=function(a){X.prototype.write.call(this,a);_.T(a,0);JG(a,0);JG(a,1)};_.v($G,ZG);$G.prototype.a=function(){return 70+ZG.prototype.a.call(this)};$G.prototype.write=function(a){ZG.prototype.write.call(this,a);JG(a,0);JG(a,0);_.T(a,0);_.T(a,0);_.T(a,0);JG(a,this.width);JG(a,this.height);_.T(a,4718592);_.T(a,4718592);_.T(a,0);JG(a,1);HG(a,10);_.Dk(a,MG("AVC Coding",31));JG(a,this.depth);LG(a,-1)};_.v(aH,ZG);aH.prototype.a=function(){return 20+ZG.prototype.a.call(this)};
51
- aH.prototype.write=function(a){ZG.prototype.write.call(this,a);_.T(a,0);_.T(a,0);JG(a,this.channelCount);JG(a,this.sampleSize);LG(a,0);JG(a,0);JG(a,this.sampleRate);JG(a,0)};_.v(bH,$G);bH.prototype.write=function(a){$G.prototype.write.call(this,a);for(var b=0;b<this.f.length;b++)this.f[b].write(a);a.getPosition()};_.v(cH,bH);_.v(dH,aH);dH.prototype.write=function(a){aH.prototype.write.call(this,a);for(var b=0;b<this.f.length;b++)this.f[b].write(a);a.getPosition()};_.v(eH,dH);_.v(fH,X);
52
- fH.prototype.a=function(){for(var a=7,b=0;b<this.La.length;b++)a+=2,a+=this.La[b].byteLength;for(b=0;b<this.La.length;b++)a+=2,a+=this.Qb[b].byteLength;return a+X.prototype.a.call(this)};
53
- fH.prototype.write=function(a){X.prototype.write.call(this,a);HG(a,this.version);HG(a,this.g);HG(a,this.h);HG(a,this.level);HG(a,255);HG(a,224|this.La.length);for(var b=0;b<this.La.length;b++)JG(a,this.La[b].length),_.Dk(a,this.La[b]);HG(a,this.Qb.length);for(b=0;b<this.Qb.length;b++)JG(a,this.Qb[b].length),_.Dk(a,this.Qb[b]);a.getPosition()};_.v(gH,Y);gH.prototype.a=function(){return 22+(this.Ib.byteLength+3)+Y.prototype.a.call(this)};
54
- gH.prototype.write=function(a){Y.prototype.write.call(this,a);HG(a,3);HG(a,23+this.Ib.byteLength);JG(a,1);HG(a,0);HG(a,4);HG(a,15+this.Ib.byteLength);HG(a,64);HG(a,21);IG(a,0);_.T(a,0);_.T(a,0);HG(a,5);HG(a,this.Ib.byteLength);_.Dk(a,this.Ib);_.Dk(a,new Uint8Array([6,1,2]));a.getPosition()};_.v(hH,Y);hH.prototype.a=function(){return this.location.length+Y.prototype.a.call(this)};hH.prototype.write=function(a){Y.prototype.write.call(this,a);0<this.location.length&&_.Dk(a,MG(this.location));a.getPosition()};
55
- _.v(iH,Y);iH.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Y.prototype.a.call(this)};iH.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.v(jH,X);_.v(kH,Y);kH.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Y.prototype.a.call(this)};
56
- kH.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.v(lH,Y);lH.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Y.prototype.a.call(this)};lH.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.v(mH,Y);
57
- mH.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Y.prototype.a.call(this)};mH.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.v(nH,Y);nH.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Y.prototype.a.call(this)};
58
- nH.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.v(oH,Y);oH.prototype.a=function(){return 8+Y.prototype.a.call(this)};oH.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,0);_.T(a,0);a.getPosition()};_.v(pH,Y);pH.prototype.a=function(){return 4+Y.prototype.a.call(this)};pH.prototype.write=function(a){Y.prototype.write.call(this,a);LG(a,0);JG(a,0);a.getPosition()};
59
- _.v(qH,X);_.v(rH,X);_.v(sH,X);_.v(tH,Y);tH.prototype.a=function(){var a=0;a=1===this.version?a+8:a+4;return a+Y.prototype.a.call(this)};tH.prototype.write=function(a){Y.prototype.write.call(this,a);1===this.version?GG(a,this.g):_.T(a,this.g);a.getPosition()};_.v(uH,Y);uH.prototype.a=function(){return 4+Y.prototype.a.call(this)};uH.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,this.g);a.getPosition()};_.v(vH,Y);
60
- vH.prototype.a=function(){var a=4;this.flags&sI&&(a+=4);this.flags&tI&&(a+=4);for(var b=0;b<this.g;b++)this.flags&uI&&(a+=4),this.flags&vI&&(a+=4),this.flags&wI&&(a+=4),this.flags&xI&&(a+=4);return a+Y.prototype.a.call(this)};
61
- vH.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,this.g);this.flags&sI&&(a.getPosition(),KG(a,this.j));this.flags&tI&&_.T(a,this.m);for(var b=0;b<this.g;b++)this.flags&uI&&_.T(a,this.o[b]),this.flags&vI&&_.T(a,this.sampleSize[b]),this.flags&wI&&_.T(a,this.A[b]),this.flags&xI&&(0===this.version?_.T(a,this.h[b]):KG(a,this.h[b]));a.getPosition()};var sI=1,tI=4,uI=256,vI=512,wI=1024,xI=2048;_.v(wH,Y);
62
- wH.prototype.a=function(){var a=4;this.flags&yI&&(a+=8);this.flags&zI&&(a+=4);this.flags&AI&&(a+=4);this.flags&BI&&(a+=4);this.flags&CI&&(a+=4);return a+Y.prototype.a.call(this)};wH.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,this.g);this.flags&yI&&GG(a,this.h);this.flags&zI&&_.T(a,this.A);this.flags&AI&&_.T(a,this.j);this.flags&BI&&_.T(a,this.o);this.flags&CI&&_.T(a,this.m);a.getPosition()};var yI=1,zI=2,AI=8,BI=16,CI=32;_.v(xH,X);_.v(yH,X);_.v(zH,X);
63
- zH.prototype.a=function(){return this.g.byteLength+X.prototype.a.call(this)};zH.prototype.write=function(a){X.prototype.write.call(this,a);0<this.g.byteLength&&_.Dk(a,this.g)};_.v(AH,Y);AH.prototype.a=function(){var a=20;1===this.g&&0===this.h&&(a=a+1+this.j.length);return a+Y.prototype.a.call(this)};
64
- AH.prototype.write=function(a){Y.prototype.write.call(this,a);HG(a,0);0===this.version?HG(a,0):HG(a,0);HG(a,this.g);HG(a,this.h);_.Dk(a,_.lk(this.m));if(1===this.g&&0===this.h){HG(a,0);for(var b=0;b<this.j.length;b++)HG(a,this.j[b])}a.getPosition()};_.v(BH,Y);BH.prototype.a=function(){var a=8;this.flags&1&&(a+=MG(this.Db).byteLength);return a+Y.prototype.a.call(this)};BH.prototype.write=function(a){Y.prototype.write.call(this,a);_.Dk(a,MG(this.g));_.T(a,this.h);this.flags&1&&_.Dk(a,MG(this.Db));a.getPosition()};
65
- _.v(CH,X);CH.prototype.a=function(){return MG(this.g).byteLength+X.prototype.a.call(this)};CH.prototype.write=function(a){X.prototype.write.call(this,a);_.Dk(a,MG(this.g));a.getPosition()};_.v(DH,Y);DH.prototype.a=function(){var a=0;this.flags&1&&(a+=8);a+=4;for(var b=0;1>b;b++)a=0===this.version?a+4:a+8;return a+Y.prototype.a.call(this)};
66
- DH.prototype.write=function(a){Y.prototype.write.call(this,a);this.flags&1&&(_.T(a,0),_.T(a,0));_.T(a,1);for(var b=0;1>b;b++)0===this.version?_.T(a,this.offset[b]):GG(a,this.offset[b]);a.getPosition()};_.v(EH,Y);EH.prototype.a=function(){var a=0;this.flags&1&&(a+=8);a+=5;0===this.g&&(a+=this.j.length);return a+Y.prototype.a.call(this)};
67
- EH.prototype.write=function(a){Y.prototype.write.call(this,a);this.flags&1&&(_.T(a,0),_.T(a,0));HG(a,this.g);_.T(a,this.h);if(0===this.g)for(var b=0;b<this.h;b++)HG(a,this.j[b]);a.getPosition()};_.v(FH,Y);FH.prototype.a=function(){var a=4;this.flags&1&&(a+=1);for(var b=0;b<this.h;b++)if(a+=this.g[b].Of.byteLength,this.flags&2){a+=2;for(var c=0;c<this.g[b].Nc;c++)a+=2,a+=4}return a+Y.prototype.a.call(this)};
68
- FH.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,this.h);this.flags&1&&HG(a,this.j);for(var b=0;b<this.h;b++)if(_.Dk(a,this.g[b].Of),this.flags&2){JG(a,this.g[b].Nc);for(var c=0;c<this.g[b].Nc;c++)JG(a,this.g[b].af[c].pf),_.T(a,this.g[b].af[c].qf)}a.getPosition()};var MH=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,NH=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,OH=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,PH=/^(\d*\.?\d*)f$/,QH=/^(\d*\.?\d*)t$/,RH=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/;VH.prototype.get=function(a){for(var b=0;b<this.a.length;b++){var c=this.a[b].get(a);if(c)return c}return null};VH.prototype.write=function(){this.f=UH(this);for(var a=0;a<this.a.length;a++)this.a[a].write(this.f);return this.f.buffer};var YH=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);_.t=dI.prototype;_.t.configure=function(a){this.g=a};_.t.start=function(a,b){var c=this;this.C=b;var d=_.mf(new Set([a,GH(a)])).concat();return eI(this,d).then(function(e){return lI(c,e.data).then(function(){qI(c,c.B);return c.h})})};_.t.stop=function(){this.C&&this.C.networkingEngine.Ue(this.K);this.B=this.w=this.h=this.g=this.C=null;this.j&&(clearTimeout(this.j),this.j=null);this.J=!1;this.I=this.D=Infinity;return Promise.resolve()};
69
- _.t.update=function(){var a=this;if(this.Xc())return eI(this,[this.m]).then(function(b){return lI(a,b.data).then(function(){return a.h})})["catch"](function(b){if(a.C)a.C.onError(b)})};_.t.onExpirationUpdated=function(){};_.t.setCurrentVariant=function(){};_.t.Bb=function(){var a=this;this.f.debug(_.fv);this.C&&(this.j=null,this.update().then(function(){qI(a,a.B)})["catch"](function(b){a.C&&(a.C.onError(b),1===b.severity&&qI(a,100))}))};_.t.Xc=function(){return this.N===hI};
70
- _.t.ye=function(){return 0<this.o.length};_.t.Mf=function(a){var b=null;if(this.o.length)for(var c=0;c<this.o.length;c++)if(this.o[c].keySystem===a){b=this.o[c].initData[0];break}return b};
71
- _.t.Ij=function(a){if(2!==a.request.type||a.uri.startsWith("data:"))return Promise.resolve(a);var b=a.request.timescale||this.w.timescale,c={isLive:this.Xc.bind(this),Md:this.ye.bind(this),li:function(){return 1},Ed:this.Mf.bind(this)},d=!1,e=new _.L(_.M,3,4035,null),f=null;try{f=$H(a,b,c)}catch(g){d=!0,e.data=g,3E3===g.code&&(e.code=4039)}if(d||!f)return Promise.reject(e);a.data=f;return Promise.resolve(a)};var oI={video:_.Te,audio:_.oc,text:_.gc},cI="VOD",hI="LIVE",pI={Zj:"caption",fk:_.ye};_.v(rI,_.Io);rI.prototype.Ja=function(){_.Fp.ism=dI;_.Dp[_.hc]=dI};rI.prototype.Ca=function(){_.Cw("ism");_.Dw(_.hc)};rI.prototype.id=function(){return"smooth"};_.C("clpp.smooth.SmoothComponent",rI);};
2
+ var f=function(window){var GG="Full MP4 box must have flags defined",HG="clpp.smooth.SmoothMP4Processor",IG="codecPrivateData",JG=function(a,b){var c=Math.floor(b/Math.pow(2,32)),d=b-c*Math.pow(2,32);_.T(a,c);_.T(a,d)},KG=function(a,b){try{a.f.setUint8(a.a,b),a.a+=1}catch(c){_.Dk()}},LG=function(a,b){KG(a,b>>16&255);KG(a,b>>8&255);KG(a,b&255)},MG=function(a,b){try{a.f.setUint16(a.a,b,a.g),a.a+=2}catch(c){_.Dk()}},NG=function(a,b){try{a.f.setInt32(a.a,b,a.g),a.a+=4}catch(c){_.Dk()}},OG=function(a,b){try{a.f.setInt16(a.a,
3
+ b,a.g),a.a+=2}catch(c){_.Dk()}},PG=function(a,b){if(void 0!=b){for(var c=new Uint8Array(b),d=Math.min(a.length,b),e=0;e<d;++e)c[e]=a.charCodeAt(e);for(;e<b;e++)c[e]=0;return c}c=new Uint8Array(a.length);for(d=0;d<a.length;++d)c[d]=a.charCodeAt(d);return c},X=function(a){this.type=a;this.size=this.start=0;this.parent=null;this.w=!1;this.entries=[];this.f=[]},Y=function(a,b,c){X.call(this,a);this.version=b;this.flags=c},QG=function(a,b,c){X.call(this,a);this.g=b;this.offset=c},RG=function(a,b,c,d,e){Y.call(this,
4
+ a,b,c);this.g=d;this.offset=e},SG=function(a,b,c){X.call(this,"ftyp");this.h=a;this.Wf=b;this.g=c},TG=function(){X.call(this,_.Fd)},UG=function(){X.call(this,_.Ge)},VG=function(a,b,c){Y.call(this,"mvhd",1,0);this.timescale=a;this.duration=b;this.volume=256;this.h=c+1;this.g=[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0]},WG=function(){X.call(this,"mvex")},XG=function(a){Y.call(this,"trex",0,0);this.g=a},YG=function(a,b,c,d,e){Y.call(this,"tkhd",1,7);this.h=a;this.duration=
5
+ b;this.timescale=c;this.width=d;this.height=e;this.volume=1;this.g=[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0]},ZG=function(a,b){Y.call(this,"mdhd",1,0);this.timescale=a;this.duration=b;this.language=21956},$G=function(a){Y.call(this,"hdlr",0,0);this.g=a},aH=function(){Y.call(this,"vmhd",0,1);this.g=new Uint8Array([0,0,0,0,0,0])},bH=function(a){X.call(this,a);this.w=!0},cH=function(a){bH.call(this,a);this.height=this.width=0;this.depth=24},dH=function(a,b,c,d){bH.call(this,
6
+ a);this.channelCount=b;this.sampleSize=c;this.sampleRate=d},eH=function(a,b){cH.call(this,"avc1");this.width=a;this.height=b},fH=function(a,b){eH.call(this,a,b);this.type="encv"},gH=function(a,b,c){dH.call(this,"mp4a",a,b,c)},hH=function(a,b,c){gH.call(this,a,b,c);this.type="enca"},iH=function(a,b){X.call(this,"avcC");this.La=a;this.Pb=b;this.version=1;this.g=this.La[0][1];this.h=this.La[0][2];this.level=this.La[0][3]},jH=function(a){Y.call(this,"esds",0,0);this.Hb=a},kH=function(a){a=void 0===a?
7
+ "":a;Y.call(this,"url ",0,1);this.location=a},lH=function(){Y.call(this,"dref",0,0)},mH=function(){X.call(this,_.ue)},nH=function(){Y.call(this,_.we,0,0)},oH=function(){Y.call(this,"stts",0,0)},pH=function(){Y.call(this,"stsc",0,0)},qH=function(){Y.call(this,"stco",0,0)},rH=function(){Y.call(this,"stsz",0,0)},sH=function(){Y.call(this,"smhd",0,0)},tH=function(){X.call(this,"dinf")},uH=function(){X.call(this,_.Ed)},vH=function(){X.call(this,_.Ad)},wH=function(a,b){Y.call(this,"tfdt",a,0);this.g=b},
8
+ xH=function(){Y.call(this,"mfhd",0,0);this.g=0},yH=function(a,b){Y.call(this,"trun",a,b);this.m=this.j=this.g=0;this.o=[];this.sampleSize=[];this.A=[];this.h=[]},zH=function(a,b){Y.call(this,"tfhd",a,b);this.g=255;this.m=this.o=this.j=this.A=this.h=0},AH=function(){X.call(this,"traf")},BH=function(){X.call(this,"moof")},CH=function(){X.call(this,_.zd);this.g=new Uint8Array(0)},DH=function(){Y.call(this,"tenc",0,0);this.g=1;this.h=8;this.m="";this.j=[]},EH=function(a,b){Y.call(this,"schm",0,0);this.g=
9
+ a;this.h=b;this.Cb=""},FH=function(a){X.call(this,"frma");this.g=a},GH=function(){Y.call(this,"saio",0,0);this.offset=[0]},HH=function(a,b,c){Y.call(this,"saiz",0,0);this.g=a;this.j=b;this.h=c},IH=function(a,b){Y.call(this,"senc",a,b);this.h=0;this.j=8;this.g=[]},JH=function(a){var b=a.split("/");return b[b.length-1].toLowerCase().match("manifest(\\(.+\\))?")?a:a+"/Manifest"},KH=function(a,b,c,d){c=b.Jf[c];b=b.Tj;a=a.replace("Manifest","");b=b.replace("{bitrate}",String(d.bitrate)).replace("{Bitrate}",
10
+ String(d.bitrate)).replace("{start time}",String(c.t)).replace("{start_time}",String(c.t));return _.Kv([a],[b])[0]},LH=function(a,b){if(a.type!==b.type)return!1;var c=[];a.type===_.Re?c=["maxWidth","maxHeight","bitrate",IG,"fourCC"]:a.type===_.kc&&(c=["bitrate",IG,"channels","bitsPerSample","samplingRate","fourCC"]);return _.K.va(a,b,c,["id","segmentIndex"])},MH=function(a,b,c){var d=c.xd.split("00000001");a={id:1,type:c.type,duration:a/b,timescale:b,La:null,Pb:null,width:NaN,height:NaN,Hb:null,kd:NaN,
11
+ sampleSize:NaN,channelCount:NaN};switch(c.type){case _.Re:a.La=[_.mk(d[1])];a.Pb=[_.mk(d[2])];a.width=c.maxWidth;a.height=c.maxHeight;break;case _.kc:a.Hb=_.mk(c.xd),a.sampleSize=c.Ig||16,a.kd=c.kd,a.channelCount=c.qf}return a},NH=function(a,b){return a.filter(function(c){return c.type===b})},OH=function(a,b){var c=a.exec(b);return null==c||""==c[0]?null:(Number(c[4])||0)/1E3+(Number(c[3])||0)+60*(Number(c[2])||0)+3600*(Number(c[1])||0)},VH=function(a,b,c){var d=null;if(PH.test(a)){a=PH.exec(a);d=
12
+ Number(a[1]);var e=Number(a[2]),f=Number(a[3]),g=Number(a[4]);g+=(Number(a[5])||0)/c.f;f+=g/c.frameRate;d=f+60*e+3600*d}else QH.test(a)?d=OH(QH,a):RH.test(a)?d=OH(RH,a):SH.test(a)?(a=SH.exec(a),d=Number(a[1])/c.frameRate):TH.test(a)?(a=TH.exec(a),d=Number(a[1])/c.a):UH.test(a)&&(d=OH(UH,a));d+=b;b=Math.floor(d/3600);c=Math.floor((d-3600*b)/60);a=Math.floor(d-3600*b-60*c);d-=a;10>b&&(b="0"+b);10>c&&(c="0"+c);10>a&&(a="0"+a);0===d?d="000":d=Math.round(1E3*d);return b+":"+c+":"+a+"."+d},WH=function(a,
13
+ b,c,d){this.frameRate=Number(a)||30;this.f=Number(b)||1;this.a=Number(d);0==this.a&&(this.a=a?this.frameRate*this.f:1);c&&(a=/^(\d+) (\d+)$/g.exec(c))&&(this.frameRate*=parseInt(a[1],10)/parseInt(a[2],10))},YH=function(a){this.a=a;this.f=XH(this)},XH=function(a){for(var b=0,c=0;c<a.a.length;c++)b+=a.a[c].a();return new _.Ck(b)},ZH=function(a,b,c){a:{var d=_.u([_.Tc,_.Sc]);for(var e=d.next();!e.done;e=d.next())if((e=c.Ed(e.value))&&e.keyId){d=e.keyId;break a}_.G(HG,"Could not get default Key ID for DRM init data!");
14
+ d=null}c=new X("xxxx");a.type===_.Re?c=new fH(a.width,a.height):c=new hH(a.channelCount,a.sampleSize,a.kd);a=new DH;a.g=1;a.h=8;a.m=d||"00000000000000000000000000000000";a=(new X("schi")).append([a]);b=(new X(_.oe)).append([new FH(b),new EH(_.Cc,65536),a]);c.append([b]);return c},$H=function(a,b){var c=b.Md(),d=new VG(a.timescale,a.duration,a.id),e=(new WG).append([new XG(a.id)]),f=new YG(a.id,a.duration,a.timescale,a.width,a.height),g=new ZG(a.timescale,a.duration),h=new $G(a.type),l=null,m=new lH;
15
+ m.entries=[new kH];var n=new nH;switch(a.type){case _.Re:var p=new iH(a.La,a.Pb);c?(l=ZH(a,"avc1",b),l.append([p]),n.entries=[l]):(l=(new eH(a.width,a.height)).append([p]),n.entries=[l]);l=new aH;break;case _.kc:p=new jH(a.Hb),c?(l=ZH(a,"mp4a",b),l.append([p]),n.entries=[l]):(l=(new gH(a.channelCount,a.sampleSize,a.kd)).append([p]),n.entries=[l]),l=new sH}n=(new mH).append([n,new oH,new pH,new rH,new qH]);m=(new tH).append([m]);m=(new uH).append([l,m,n]);g=(new vH).append([g,h,m]);f=(new UG).append([f,
16
+ g]);d=(new TG).append([d,f,e]);e=new SG("dash",0,["iso6","mp41","avc1"]);c&&(c=b.Ed(_.Sc),f=b.Ed(_.Tc),c&&d.append([new QG("pssh",c.initData,8)]),f&&d.append([new QG("pssh",f.initData,8)]),c||f||_.G(HG,"Could not get PSSH init data!"));c=new YH([e,d]);return _.N(c.write())},bI=function(a,b){var c,d,e,f,g,h;(new _.Ok).L("moof",_.Pk).V("mfhd",function(m){var n=new xH;n.g=_.U(m.reader);c=n}).L("traf",_.Pk).V("tfhd",function(m){var n=m.reader.za();if(null===m.flags)throw new _.L(_.M,3,3019,GG);var p=
17
+ new zH(m.version||0,m.flags||0);p.g=_.U(m.reader);0<n-m.reader.getPosition()&&m.flags&1&&(p.h=_.Mk(m.reader));0<n-m.reader.getPosition()&&m.flags&2&&(p.A=_.U(m.reader));0<n-m.reader.getPosition()&&m.flags&8&&(p.j=_.U(m.reader));0<n-m.reader.getPosition()&&m.flags&16&&(p.o=_.U(m.reader));0<n-m.reader.getPosition()&&m.flags&32&&(p.m=_.U(m.reader));d=p}).V("trun",function(m){var n=m.reader.za();if(null===m.flags)throw new _.L(_.M,3,3019,GG);var p=new yH(m.version||0,m.flags||0);p.g=_.U(m.reader);0<n-
18
+ m.reader.getPosition()&&m.flags&1&&(p.j=_.Kk(m.reader));0<n-m.reader.getPosition()&&m.flags&4&&(p.m=_.U(m.reader));if(0<n-m.reader.getPosition())for(n=0;n<p.g;n++)m.flags&256&&p.o.push(_.U(m.reader)),m.flags&512&&p.sampleSize.push(_.U(m.reader)),m.flags&1024&&p.A.push(_.U(m.reader)),m.flags&2048&&(0===m.version?p.h.push(_.U(m.reader)):p.h.push(_.Kk(m.reader)));e=p}).V("sdtp",function(m){var n=_.Nk(m.reader,m.reader.za());f=new RG("sdtp",m.version||0,m.flags||0,n,0)}).L("uuid",function(m){var n=_.Nk(m.reader,
19
+ 16);if(_.ok(n,aI)){n=_.U(m.reader);m.version=n>>>24;m.flags=n&16777215;n=new IH(m.version,m.flags);n.h=_.U(m.reader);m.flags&1&&(n.j=_.Ik(m.reader));for(var p=0;p<n.h;p++){var q={Nf:_.Nk(m.reader,8),Mc:0,$e:[]};if(m.flags&2){q.Mc=_.Jk(m.reader);for(var r=0;r<q.Mc;r++){var w={nf:0,pf:0};w.nf=_.Jk(m.reader);w.pf=_.U(m.reader);q.$e.push(w)}}n.g.push(q)}g=n}}).L(_.zd,function(m){var n=new CH;0<m.reader.za()?n.g=_.Nk(m.reader,m.reader.za()):(_.G(HG,"mdat box is empty!"),n.g=new Uint8Array(0));h=n}).parse(a,
20
+ !1);if(!h)return null;var l=(new AH).append([d,e]);f&&l.append([f]);b.Md()&&g&&l.append([g]);l=(new BH).append([c,l]);return new YH([l,h])},cI=function(a,b,c,d){var e=d.Md(),f=parseInt(c*b,10);b=a.data||new ArrayBuffer(0);var g=bI(b,d);if(null===g)return a.request.contentType===_.Ce?a.data:g;d=g.get(_.zd);if(a.request.contentType===_.Ce){e=d.g.buffer;if(c){e=_.yh(e);if((e=(new DOMParser).parseFromString(e,_.Ee))&&"tt"===e.documentElement.tagName.toLowerCase())var h=e.documentElement;if(h&&(d=new WH(h.getAttribute("ttp:frameRate"),
21
+ h.getAttribute("ttp:subFrameRate"),h.getAttribute("ttp:frameRateMultiplier"),h.getAttribute("ttp:tickRate")),h=h.getElementsByTagName("body")[0]))for(h=h.getElementsByTagName("p"),a=0,b=h.length;a<b;a++){f=h[a];g=c;for(var l=["begin",_.hd],m=0,n=l.length;m<n;m++){b:{var p=f;var q=l[m],r=new RegExp("\\w+:"+q),w=0;if(p.hasAttribute(q))p=p.getAttribute(q);else{q=p.attributes;for(var z=q.length;w<z;w++){var C=q[w].name;if(C=C.match(r)){p=p.getAttribute(C[0]);break b}}p=null}}f.setAttribute(l[m],VH(p||
22
+ "",g,d))}}e=(new XMLSerializer).serializeToString(e);c=_.zh(e).buffer}else c=e;return c}h=new BH;a=g.get("mfhd");b=new AH;l=g.get("tfhd");m=new wH(1,f);f=g.get("trun");n=g.get("sdtp");c=g.get("senc");l.g=1;l.flags&=16777214;l.flags|=131072;b.append([l,m,f]);n&&b.append([n]);if(e){g=0;l=[];if(c.flags&2)for(l=[],m=0;m<c.h;m++)l.push(10+6*c.g[m].Mc);else g=8;b.append([c,new GH,new HH(g,l,c.h)])}h.append([a,b]);f.flags|=1;f.j=h.a()+8;d=new YH([h,d]);h=d.write();e&&(e=d.get("saio"),d=d.f,e.offset[0]=c.start+
23
+ 16,d.seek(e.start),e.write(d),h=d.buffer);return h},dI=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[b],keyIds:c,periodId:null}},eI=function(a,b,c){a=_.Ol(a);c&&a.version!==c&&(a=_.Dv(a,c));return{initData:_.Bv(a),initDataType:_.Cc,keyId:b,periodId:null}},gI=function(){this.w=this.h=this.g=this.C=null;this.M=1;this.S=0;this.m="";this.A=this.f=null;this.a=new _.H("clpp.smooth.SmoothParser");
24
+ this.J=!1;this.j=this.B=null;this.P=fI;this.H=0;this.D=this.I=Infinity;this.o=[];this.K=this.Ej.bind(this);this.F=new Map},hI=function(a,b){var c,d,e;return _.A(function(f){if(1==f.a)return c=_.Nh(b),c.timeout=a.g.attemptParameters.timeout,c.maxAttempts=Math.max(a.g.attemptParameters.maxAttempts,b.length),c.baseDelay=a.g.attemptParameters.baseDelay,c.backoffFactor=a.g.attemptParameters.backoffFactor,c.fuzzFactor=a.g.attemptParameters.fuzzFactor,c.type=1,d=a.C.networkingEngine.fetch(c),_.x(f,d.O,2);
25
+ e=f.f;a.m=e.uri;return f["return"](e)})},oI=function(a,b){var c=null;try{var d=new DOMParser;try{var e=_.yh(b);var f=d.parseFromString(e.trim(),_.Ee)}catch(fC){throw fC;}if(f&&f.documentElement.tagName==_.sb)var g=f.documentElement;c=g&&0<g.getElementsByTagName("parsererror").length?null:g}catch(fC){}if(!c)throw a.a.error("Unable to parse manifest"),new _.L(_.M,4,4033,a.m);var h=+iI(a,c,"MajorVersion"),l=+iI(a,c,"MinorVersion"),m=+c.getAttribute("TimeScale")||1E7,n=+iI(a,c,"Duration"),p="TRUE"===
26
+ c.getAttribute("IsLive"),q=+c.getAttribute("LookAheadCount"),r=+c.getAttribute("DVRWindowLength")||Infinity,w=_.Al(c,"Protection")[0];if(!1===/^[2].[0-2]$/.test(""+h+"."+l))throw a.a.error("Smooth Streaming version must be 2.0, 2.1 or 2.2"),new _.L(_.M,4,4036,a.m);p?(jI(a,kI),a.B=typeof a.g.liveRefreshPeriod===_.k?1E3*a.g.liveRefreshPeriod:Math.min(1E3*a.H,1E4),n=Infinity):jI(a,fI);a.f={startTime:0,delay:0,duration:n/m,oe:r/m,ed:0};if(w){var z=a.g.playreadyVersion,C=[],E=_.Al(w,"ProtectionHeader")[0],
27
+ F=_.lk(_.Cl(E)||""),B=_.Ol(F).a;C.push(dI(_.Tc,{initData:_.Bv(_.Hl(B)),initDataType:_.Cc,keyId:B,periodId:null},[B]));C.push(dI(_.Sc,eI(F,B,z),[B]));a.o=C}var I=[],O=_.Al(c,"StreamIndex");if(!O.length)throw a.a.error("No streams found!"),new _.L(_.M,4,4034,a.m);for(var S=0;S<O.length;S++){for(var Ba,ja=a,pa=O[S],Ca=iI(ja,pa,"Type"),Ga=+pa.getAttribute("Chunks"),qa=pa.getAttribute("Subtype"),ta=_.Ji(pa.getAttribute("Language")||_.Ie),Ma=pa.getAttribute("Name")||"",Ja=+pa.getAttribute(_.Wa),Bb=+pa.getAttribute(_.Va),
28
+ Cb=iI(ja,pa,"Url"),Fb=+pa.getAttribute("TimeScale")||null,Mi=[],Ni=_.Al(pa,_.hb),Wf=0;Wf<Ni.length;Wf++){var ad=ja,$b=Ni[Wf],lc=Ca,Oi=+$b.getAttribute("Index"),VL=+iI(ad,$b,"Bitrate"),iC=NaN,jC=NaN,ym=NaN,$r=NaN,kC=NaN,lC=NaN,mC=NaN,nC=$b.getAttribute("FourCC");switch(lc){case _.Re:iC=+iI(ad,$b,_.Va);jC=+iI(ad,$b,_.Wa);break;case _.kc:$r=+$b.getAttribute("Channels")||2,ym=+iI(ad,$b,"SamplingRate"),lC=+iI(ad,$b,"AudioTag"),kC=+iI(ad,$b,"BitsPerSample"),mC=+iI(ad,$b,"PacketSize")}var as=String($b.getAttribute("CodecPrivateData"));
29
+ if(lc===_.kc&&!as){var oC=$r,pC={96E3:0,88200:1,64E3:2,48E3:3,44100:4,32E3:5,24E3:6,22050:7,16E3:8,12E3:9,11025:10,8E3:11,7350:12},zm=pC[ym];if("AACH"===nC){var nc=new Uint8Array(4);var qC=pC[2*ym];nc[0]=40|zm>>1;nc[1]=zm<<7|oC<<3|qC>>1;nc[2]=qC<<7|8;nc[3]=0;var Zf=new Uint16Array(2);Zf[0]=(nc[0]<<8)+nc[1];Zf[1]=(nc[2]<<8)+nc[3];var rC=Zf[0].toString(16)+Zf[1].toString(16)}else nc=new Uint8Array(2),nc[0]=16|zm>>1,nc[1]=zm<<7|oC<<3,Zf=new Uint16Array(1),Zf[0]=(nc[0]<<8)+nc[1],rC=Zf[0].toString(16);
30
+ as=rC.toUpperCase()}var WL={id:ad.S++,type:lc,index:Oi,bitrate:VL,xd:as,maxHeight:iC,maxWidth:jC,kd:ym,qf:$r,ik:lC,Ig:kC,vk:mC,di:nC,segmentIndex:null};Mi.push(WL)}Ba=Mi;for(var qe=[],sC=_.Al(pa,"c"),fj=0;fj<sC.length;fj++){var bs=sC[fj],Gd=parseInt(bs.getAttribute("t"),10),ih=parseInt(bs.getAttribute("d"),10),cs=parseInt(bs.getAttribute("r"),10),gj=0;if(isNaN(Gd)&&isNaN(ih))throw ja.a.error("Either one or both FragmentDuration and FragmentTime field MUST be present in StreamFragmentElement"),new _.L(_.M,
31
+ 4,4037,ja.m);0===fj&&isNaN(Gd)&&(gj=Gd=0);if(0<fj){var $f=qe[qe.length-1];gj=$f.n+1;$f.d||($f.d=Gd-$f.t);Gd||(Gd=$f.t+$f.d);ih||(ih=Gd-$f.t)}qe.push({n:gj,d:ih,t:Gd});if(cs){cs--;for(var tC=0;tC<cs;tC++){var Am=qe[qe.length-1];gj=Am.n+1;Gd=Am.t+Am.d;ih=Am.d;qe.push({n:gj,d:ih,t:Gd})}}}ja.Wc()||qe.length===Ga||ja.a.warn("Number of fragments ("+Ga+") differs from number of chunks ("+qe.length+").");I.push({type:Ca,lk:Ga,Mj:qa,language:ta,name:Ma,maxWidth:Ja,maxHeight:Bb,Tj:Cb,tracks:Ba,Jf:qe,timescale:Fb})}var gf=
32
+ {tk:h,Wf:l,timescale:m,duration:n,isLive:p,sk:q,oe:r,ve:!1,streams:I};if(a.h&&a.w)return lI(a,gf),Promise.resolve();a.F.clear();var ds=gf.timescale,es=gf.duration,YL=NH(gf.streams,_.kc),ZL=NH(gf.streams,_.Re),$L=NH(gf.streams,_.Ce),uC=[],Bm=mI(a,es,ds,YL),Cm=mI(a,es,ds,ZL),aM=mI(a,es,ds,$L);Bm.length||(Bm=[null]);Cm.length||(Cm=[null]);for(var gs=0;gs<Cm.length;gs++)for(var hs=0;hs<Bm.length;hs++)uC.push(nI(a,Cm[gs],Bm[hs]));var vC={startTime:0,variants:uC,textStreams:aM,thumbStreams:[]};var cM=gf.streams,
33
+ is=a.f.startTime,wC=a.f.delay,js=a.I,xC=Math.min(a.f.duration||Infinity,js),ks=a.Wc(),dM=a.f.oe,eM=a.f.ed,yC=a.H,zC=isFinite(a.D)?a.D:0;if(ks)xC=Infinity,is=Date.now()/1E3-eM,a.f.startTime=is,wC=3*yC;else for(var fM=isFinite(js)?js:a.f.duration,AC=_.u(cM),ls=AC.next();!ls.done;ls=AC.next())for(var BC=_.u(ls.value.tracks),ms=BC.next();!ms.done;ms=BC.next()){var CC=ms.value;CC.segmentIndex.offset(-zC);_.yw(CC.segmentIndex,fM)}a.A=new _.hw(is,wC,!ks,!0);a.A.Sb(xC);_.lw(a.A,yC);a.A.gc=dM;ks||a.A.offset(-zC);
34
+ a.C.filterAllPeriods([vC]);a.h={presentationTimeline:a.A,periods:[vC],offlineSessionIds:[],minBufferTime:0};Promise.resolve();a.J||(a.C.networkingEngine.ce(a.K),a.J=!0);a.w=gf;return Promise.resolve()},lI=function(a,b){for(var c=0;c<a.w.streams.length;c++)for(var d=b.streams[c],e={},f=_.u(a.w.streams[c].tracks),g=f.next();!g.done;e={Gb:e.Gb},g=f.next())if(e.Gb=g.value,g=d.tracks.find(function(l){return function(m){return m.type===l.Gb.type&&m.bitrate===l.Gb.bitrate}}(e))){LH(e.Gb,g)||a.a.warn("The current stream is updated with a stream that seems to have different base properties!");
35
+ var h=pI(a,a.w.timescale,d,g);g=e.Gb.segmentIndex;g.Va(h);(h=a.f.oe)&&_.ww(g,_.vw(g)-h).forEach(function(l){l.Ga().forEach(function(m){a.F["delete"](m)})})}else a.a.warn("Cannot find satisfying update for "+e.Gb.type+" track with bitrate "+(e.Gb.bitrate+". Skipping update."))},mI=function(a,b,c,d){for(var e=[],f={qc:0};f.qc<d.length;f={qc:f.qc},f.qc++){var g=d[f.qc].tracks.map(function(h){return function(l){var m=d[h.qc],n=pI(a,c,m,l),p=new _.uw(n),q=null;m.type!==_.Ce&&(q=qI(a,b,c,m,l));l.segmentIndex=
36
+ p;n=a.M++;var r=Promise.resolve.bind(Promise),w=p.zc.bind(p),z=p.get.bind(p),C=p.Pc.bind(p);p=p.getDuration.bind(p);var E=rI[m.type],F="";switch(m.type){case _.Re:F=l.xd;var B=/00000001[0-9]7/.exec(F);F="avc1."+(B&&B[0]?F.substr(F.indexOf(B[0])+10,6):"42c00c");a.a.debug("VIDEO CODECS: ",F);break;case _.kc:F=l.xd,B=2,"AACH"===l.di?B=5:F&&(B=(parseInt(F.substr(0,2),16)&248)>>3),F="mp4a.40."+B,a.a.debug("AUDIO CODECS: ",F)}B=m.type===_.Ce?sI[m.Mj]:void 0;return{id:n,originalId:null,xk:null,createSegmentIndex:r,
37
+ findSegmentPosition:w,getSegmentReference:z,adjustSegmentDurations:C,getDuration:p,segmentIndex:null,segmentLookupStrategy:_.nv,initSegmentReference:q,mimeType:E,codecs:F,frameRate:void 0,bandwidth:l.bitrate,width:l.maxWidth||void 0,height:l.maxHeight||void 0,kind:B,encrypted:a.xe(),keyId:null,language:m.language,label:m.name,type:m.type,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:l.qf||null,closedCaptions:null}}}(f));e=e.concat(g)}return e},pI=function(a,b,c,d){var e=
38
+ 0,f=[],g=c.timescale||b;c.Jf.forEach(function(h,l){var m=h.d/g;if(0===l){var n=h.t/g;a.D=Math.min(a.D,n)}else n=f[l-1].endTime;var p=n+m,q=KH(a.m,c,l,d);a.H=Math.max(a.H,m);f.push(new _.gw(l,n,p,function(){return[q]},0,null,0,null,!0,g));a.F.set(q,n);e+=m});if(c.type===_.Re||c.type===_.kc)b=f[f.length-1],a.I=Math.min(a.I,e),0===a.f.ed?a.f.ed=b.endTime:a.f.ed=Math.min(a.f.ed,b.endTime);return f},qI=function(a,b,c,d,e){b=MH(b,d.timescale||c,e);c={isLive:a.Wc.bind(a),Md:a.xe.bind(a),ii:function(){return 1},
39
+ Ed:a.Lf.bind(a)};d=new Uint8Array(0);try{d=$H(b,c)}catch(g){throw a.a.error("Failed to generate initialization segment."),new _.L(_.M,3,4035,g);}var f="data:text/plain;base64,"+_.kk(d);return new _.fw(function(){return[f]},0,null,null,!0)},nI=function(a,b,c){var d=(c?c.bandwidth:0)+(b?b.bandwidth:0),e=c?c.language:_.Ie;return c||b?{id:a.M++,language:e,primary:!1,audio:c,video:b,bandwidth:d,drmInfos:a.o,allowedByApplication:!0,allowedByKeySystem:!0}:null},iI=function(a,b,c){if(b=b.getAttribute(c))return b;
40
+ a.a.error("required attribute not provided: "+c);throw new _.L(_.M,4,4038,a.m,c);},tI=function(a,b){null!=a.B&&null!=b&&(a.j=window.setTimeout(a.Ab.bind(a),b))},jI=function(a,b){var c=b===fI;if(a.h&&a.h.presentationTimeline){var d=a.h.presentationTimeline;d.j=c;d.m=c}c&&null!=a.j&&(window.clearTimeout(a.j),a.j=null,a.B=null);a.P=b},uI=function(){};X.prototype.append=function(a){a=void 0===a?[]:a;for(var b=0;b<a.length;b++)this.f.push(a[b]),a[b].parent=this;return this};
41
+ X.prototype.get=function(a){if(this.type===a)return this;for(var b=0;b<this.f.length;b++){if(this.f[b].type===a)return this.f[b];var c=this.f[b].get(a);if(c)return c}return null};X.prototype.a=function(){var a=Math.pow(2,32)-1;var b=4+this.type.length;"uuid"===this.type&&(b+=16);if(0<this.f.length)for(var c=0;c<this.f.length;c++)b+=this.f[c].a();this.size>a&&(b+=8);return b};
42
+ X.prototype.write=function(a){var b=Math.pow(2,32)-1;this.start=a.getPosition();this.size=this.a();this.size>b?_.T(a,1):_.T(a,this.size);_.Ek(a,PG(this.type));this.size>b&&JG(a,this.size);"uuid"===this.type&&_.Ek(a,null);if(0<this.f.length&&!this.w)for(b=0;b<this.f.length;b++)this.f[b].write(a),this.f[b].a(),a.getPosition()};_.v(Y,X);Y.prototype.a=function(){return 4+X.prototype.a.call(this)};Y.prototype.write=function(a){X.prototype.write.call(this,a);KG(a,this.version);LG(a,this.flags)};
43
+ _.v(QG,X);QG.prototype.a=function(){return this.g.byteLength+X.prototype.a.call(this)-this.offset};QG.prototype.write=function(a){X.prototype.write.call(this,a);_.Ek(a,this.g,this.offset);a.getPosition()};_.v(RG,Y);RG.prototype.a=function(){return this.g.byteLength+Y.prototype.a.call(this)-this.offset};RG.prototype.write=function(a){Y.prototype.write.call(this,a);_.Ek(a,this.g,this.offset);a.getPosition()};_.v(SG,X);
44
+ SG.prototype.a=function(){var a=this.h.length;a=a+4+this.g.join("").length;return a+X.prototype.a.call(this)};SG.prototype.write=function(a){X.prototype.write.call(this,a);_.Ek(a,PG(this.h));_.T(a,this.Wf);_.Ek(a,PG(this.g.join("")));a.getPosition()};_.v(TG,X);_.v(UG,X);_.v(VG,Y);VG.prototype.a=function(){var a=0;a=1===this.version?a+28:a+16;a=a+44+this.g.length;return a+=Y.prototype.a.call(this)};
45
+ VG.prototype.write=function(a){Y.prototype.write.call(this,a);1===this.version?(JG(a,0),JG(a,0),_.T(a,this.timescale),JG(a,this.duration*this.timescale)):(_.T(a,0),_.T(a,0),_.T(a,this.timescale),_.T(a,this.duration*this.timescale));_.T(a,65536);MG(a,this.volume);MG(a,0);_.T(a,0);_.T(a,0);for(var b=0;b<this.g.length;b++)KG(a,this.g[b]);_.T(a,0);_.T(a,0);_.T(a,0);_.T(a,0);_.T(a,0);_.T(a,0);_.T(a,this.h);a.getPosition()};_.v(WG,X);_.v(XG,Y);XG.prototype.a=function(){return 20+Y.prototype.a.call(this)};
46
+ XG.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,this.g);_.T(a,1);_.T(a,0);_.T(a,0);_.T(a,0);a.getPosition()};_.v(YG,Y);YG.prototype.a=function(){var a=0;a=1===this.version?a+32:a+20;a=a+24+this.g.length;return a+Y.prototype.a.call(this)};
47
+ YG.prototype.write=function(a){Y.prototype.write.call(this,a);1===this.version?(JG(a,0),JG(a,0),_.T(a,this.h),_.T(a,0),JG(a,this.duration*this.timescale)):(_.T(a,0),_.T(a,0),_.T(a,this.h),_.T(a,0),_.T(a,this.duration*this.timescale));_.T(a,0);_.T(a,0);MG(a,0);MG(a,0);MG(a,this.volume);MG(a,0);for(var b=0;b<this.g.length;b++)KG(a,this.g[b]);MG(a,this.width);MG(a,0);MG(a,this.height);MG(a,0);a.getPosition()};_.v(ZG,Y);ZG.prototype.a=function(){var a=0;a=1===this.version?a+28:a+16;return a+4+Y.prototype.a.call(this)};
48
+ ZG.prototype.write=function(a){Y.prototype.write.call(this,a);1===this.version?(JG(a,0),JG(a,0),_.T(a,this.timescale),JG(a,this.duration*this.timescale)):(_.T(a,0),_.T(a,0),_.T(a,this.timescale),_.T(a,this.duration*this.timescale));MG(a,this.language);MG(a,0);a.getPosition()};_.v($G,Y);$G.prototype.a=function(){return 33+Y.prototype.a.call(this)};
49
+ $G.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,0);this.g===_.Re?_.Ek(a,PG("vide")):_.Ek(a,PG("soun"));_.T(a,0);_.T(a,0);_.T(a,0);this.g===_.Re?_.Ek(a,PG("VideoHandler\x00")):_.Ek(a,PG("SoundHandler\x00"));a.getPosition()};_.v(aH,Y);aH.prototype.a=function(){return 2+this.g.byteLength+Y.prototype.a.call(this)};aH.prototype.write=function(a){Y.prototype.write.call(this,a);MG(a,0);_.Ek(a,this.g);a.getPosition()};_.v(bH,X);bH.prototype.a=function(){return 8+X.prototype.a.call(this)};
50
+ bH.prototype.write=function(a){X.prototype.write.call(this,a);_.T(a,0);MG(a,0);MG(a,1)};_.v(cH,bH);cH.prototype.a=function(){return 70+bH.prototype.a.call(this)};cH.prototype.write=function(a){bH.prototype.write.call(this,a);MG(a,0);MG(a,0);_.T(a,0);_.T(a,0);_.T(a,0);MG(a,this.width);MG(a,this.height);_.T(a,4718592);_.T(a,4718592);_.T(a,0);MG(a,1);KG(a,10);_.Ek(a,PG("AVC Coding",31));MG(a,this.depth);OG(a,-1)};_.v(dH,bH);dH.prototype.a=function(){return 20+bH.prototype.a.call(this)};
51
+ dH.prototype.write=function(a){bH.prototype.write.call(this,a);_.T(a,0);_.T(a,0);MG(a,this.channelCount);MG(a,this.sampleSize);OG(a,0);MG(a,0);MG(a,this.sampleRate);MG(a,0)};_.v(eH,cH);eH.prototype.write=function(a){cH.prototype.write.call(this,a);for(var b=0;b<this.f.length;b++)this.f[b].write(a);a.getPosition()};_.v(fH,eH);_.v(gH,dH);gH.prototype.write=function(a){dH.prototype.write.call(this,a);for(var b=0;b<this.f.length;b++)this.f[b].write(a);a.getPosition()};_.v(hH,gH);_.v(iH,X);
52
+ iH.prototype.a=function(){for(var a=7,b=0;b<this.La.length;b++)a+=2,a+=this.La[b].byteLength;for(b=0;b<this.La.length;b++)a+=2,a+=this.Pb[b].byteLength;return a+X.prototype.a.call(this)};
53
+ iH.prototype.write=function(a){X.prototype.write.call(this,a);KG(a,this.version);KG(a,this.g);KG(a,this.h);KG(a,this.level);KG(a,255);KG(a,224|this.La.length);for(var b=0;b<this.La.length;b++)MG(a,this.La[b].length),_.Ek(a,this.La[b]);KG(a,this.Pb.length);for(b=0;b<this.Pb.length;b++)MG(a,this.Pb[b].length),_.Ek(a,this.Pb[b]);a.getPosition()};_.v(jH,Y);jH.prototype.a=function(){return 22+(this.Hb.byteLength+3)+Y.prototype.a.call(this)};
54
+ jH.prototype.write=function(a){Y.prototype.write.call(this,a);KG(a,3);KG(a,23+this.Hb.byteLength);MG(a,1);KG(a,0);KG(a,4);KG(a,15+this.Hb.byteLength);KG(a,64);KG(a,21);LG(a,0);_.T(a,0);_.T(a,0);KG(a,5);KG(a,this.Hb.byteLength);_.Ek(a,this.Hb);_.Ek(a,new Uint8Array([6,1,2]));a.getPosition()};_.v(kH,Y);kH.prototype.a=function(){return this.location.length+Y.prototype.a.call(this)};kH.prototype.write=function(a){Y.prototype.write.call(this,a);0<this.location.length&&_.Ek(a,PG(this.location));a.getPosition()};
55
+ _.v(lH,Y);lH.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Y.prototype.a.call(this)};lH.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.v(mH,X);_.v(nH,Y);nH.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Y.prototype.a.call(this)};
56
+ nH.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.v(oH,Y);oH.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Y.prototype.a.call(this)};oH.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.v(pH,Y);
57
+ pH.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Y.prototype.a.call(this)};pH.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.v(qH,Y);qH.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Y.prototype.a.call(this)};
58
+ qH.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.v(rH,Y);rH.prototype.a=function(){return 8+Y.prototype.a.call(this)};rH.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,0);_.T(a,0);a.getPosition()};_.v(sH,Y);sH.prototype.a=function(){return 4+Y.prototype.a.call(this)};sH.prototype.write=function(a){Y.prototype.write.call(this,a);OG(a,0);MG(a,0);a.getPosition()};
59
+ _.v(tH,X);_.v(uH,X);_.v(vH,X);_.v(wH,Y);wH.prototype.a=function(){var a=0;a=1===this.version?a+8:a+4;return a+Y.prototype.a.call(this)};wH.prototype.write=function(a){Y.prototype.write.call(this,a);1===this.version?JG(a,this.g):_.T(a,this.g);a.getPosition()};_.v(xH,Y);xH.prototype.a=function(){return 4+Y.prototype.a.call(this)};xH.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,this.g);a.getPosition()};_.v(yH,Y);
60
+ yH.prototype.a=function(){var a=4;this.flags&vI&&(a+=4);this.flags&wI&&(a+=4);for(var b=0;b<this.g;b++)this.flags&xI&&(a+=4),this.flags&yI&&(a+=4),this.flags&zI&&(a+=4),this.flags&AI&&(a+=4);return a+Y.prototype.a.call(this)};
61
+ yH.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,this.g);this.flags&vI&&(a.getPosition(),NG(a,this.j));this.flags&wI&&_.T(a,this.m);for(var b=0;b<this.g;b++)this.flags&xI&&_.T(a,this.o[b]),this.flags&yI&&_.T(a,this.sampleSize[b]),this.flags&zI&&_.T(a,this.A[b]),this.flags&AI&&(0===this.version?_.T(a,this.h[b]):NG(a,this.h[b]));a.getPosition()};var vI=1,wI=4,xI=256,yI=512,zI=1024,AI=2048;_.v(zH,Y);
62
+ zH.prototype.a=function(){var a=4;this.flags&BI&&(a+=8);this.flags&CI&&(a+=4);this.flags&DI&&(a+=4);this.flags&EI&&(a+=4);this.flags&FI&&(a+=4);return a+Y.prototype.a.call(this)};zH.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,this.g);this.flags&BI&&JG(a,this.h);this.flags&CI&&_.T(a,this.A);this.flags&DI&&_.T(a,this.j);this.flags&EI&&_.T(a,this.o);this.flags&FI&&_.T(a,this.m);a.getPosition()};var BI=1,CI=2,DI=8,EI=16,FI=32;_.v(AH,X);_.v(BH,X);_.v(CH,X);
63
+ CH.prototype.a=function(){return this.g.byteLength+X.prototype.a.call(this)};CH.prototype.write=function(a){X.prototype.write.call(this,a);0<this.g.byteLength&&_.Ek(a,this.g)};_.v(DH,Y);DH.prototype.a=function(){var a=20;1===this.g&&0===this.h&&(a=a+1+this.j.length);return a+Y.prototype.a.call(this)};
64
+ DH.prototype.write=function(a){Y.prototype.write.call(this,a);KG(a,0);0===this.version?KG(a,0):KG(a,0);KG(a,this.g);KG(a,this.h);_.Ek(a,_.mk(this.m));if(1===this.g&&0===this.h){KG(a,0);for(var b=0;b<this.j.length;b++)KG(a,this.j[b])}a.getPosition()};_.v(EH,Y);EH.prototype.a=function(){var a=8;this.flags&1&&(a+=PG(this.Cb).byteLength);return a+Y.prototype.a.call(this)};EH.prototype.write=function(a){Y.prototype.write.call(this,a);_.Ek(a,PG(this.g));_.T(a,this.h);this.flags&1&&_.Ek(a,PG(this.Cb));a.getPosition()};
65
+ _.v(FH,X);FH.prototype.a=function(){return PG(this.g).byteLength+X.prototype.a.call(this)};FH.prototype.write=function(a){X.prototype.write.call(this,a);_.Ek(a,PG(this.g));a.getPosition()};_.v(GH,Y);GH.prototype.a=function(){var a=0;this.flags&1&&(a+=8);a+=4;for(var b=0;1>b;b++)a=0===this.version?a+4:a+8;return a+Y.prototype.a.call(this)};
66
+ GH.prototype.write=function(a){Y.prototype.write.call(this,a);this.flags&1&&(_.T(a,0),_.T(a,0));_.T(a,1);for(var b=0;1>b;b++)0===this.version?_.T(a,this.offset[b]):JG(a,this.offset[b]);a.getPosition()};_.v(HH,Y);HH.prototype.a=function(){var a=0;this.flags&1&&(a+=8);a+=5;0===this.g&&(a+=this.j.length);return a+Y.prototype.a.call(this)};
67
+ HH.prototype.write=function(a){Y.prototype.write.call(this,a);this.flags&1&&(_.T(a,0),_.T(a,0));KG(a,this.g);_.T(a,this.h);if(0===this.g)for(var b=0;b<this.h;b++)KG(a,this.j[b]);a.getPosition()};_.v(IH,Y);IH.prototype.a=function(){var a=4;this.flags&1&&(a+=1);for(var b=0;b<this.h;b++)if(a+=this.g[b].Nf.byteLength,this.flags&2){a+=2;for(var c=0;c<this.g[b].Mc;c++)a+=2,a+=4}return a+Y.prototype.a.call(this)};
68
+ IH.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,this.h);this.flags&1&&KG(a,this.j);for(var b=0;b<this.h;b++)if(_.Ek(a,this.g[b].Nf),this.flags&2){MG(a,this.g[b].Mc);for(var c=0;c<this.g[b].Mc;c++)MG(a,this.g[b].$e[c].nf),_.T(a,this.g[b].$e[c].pf)}a.getPosition()};var PH=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,QH=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,RH=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,SH=/^(\d*\.?\d*)f$/,TH=/^(\d*\.?\d*)t$/,UH=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/;YH.prototype.get=function(a){for(var b=0;b<this.a.length;b++){var c=this.a[b].get(a);if(c)return c}return null};YH.prototype.write=function(){this.f=XH(this);for(var a=0;a<this.a.length;a++)this.a[a].write(this.f);return this.f.buffer};var aI=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);_.t=gI.prototype;_.t.configure=function(a){this.g=a};_.t.start=function(a,b){var c=this;this.C=b;var d=_.mf(new Set([a,JH(a)])).concat();return hI(this,d).then(function(e){return oI(c,e.data).then(function(){tI(c,c.B);return c.h})})};_.t.stop=function(){this.C&&this.C.networkingEngine.Te(this.K);this.B=this.w=this.h=this.g=this.C=null;this.j&&(clearTimeout(this.j),this.j=null);this.J=!1;this.I=this.D=Infinity;return Promise.resolve()};
69
+ _.t.update=function(){var a=this;if(this.Wc())return hI(this,[this.m]).then(function(b){return oI(a,b.data).then(function(){return a.h})})["catch"](function(b){if(a.C)a.C.onError(b)})};_.t.onExpirationUpdated=function(){};_.t.setCurrentVariant=function(){};_.t.Ab=function(){var a=this;this.a.debug(_.gv);this.C&&(this.j=null,this.update().then(function(){tI(a,a.B)})["catch"](function(b){a.C&&(a.C.onError(b),1===b.severity&&tI(a,100))}))};_.t.Wc=function(){return this.P===kI};
70
+ _.t.xe=function(){return 0<this.o.length};_.t.Lf=function(a){var b=null;if(this.o.length)for(var c=0;c<this.o.length;c++)if(this.o[c].keySystem===a){b=this.o[c].initData[0];break}return b};
71
+ _.t.Ej=function(a){if(2!==a.request.type||a.uri.startsWith("data:"))return Promise.resolve(a);var b=a.request.timescale||this.w.timescale,c={isLive:this.Wc.bind(this),Md:this.xe.bind(this),ii:function(){return 1},Ed:this.Lf.bind(this)},d=!1,e=new _.L(_.M,3,4035,null),f=null;try{var g=this.F.get(a.request.uris[a.request.uriIndex])||a.request.startTime||0;g!==a.request.startTime&&this.a.debug("Using base media decode time "+g+" instead of segment reference time "+a.request.startTime);f=cI(a,b,g,c)}catch(h){d=
72
+ !0,e.data=h,3E3===h.code&&(e.code=4039)}if(d||!f)return Promise.reject(e);a.data=f;return Promise.resolve(a)};var rI={video:_.Te,audio:_.qc,text:_.hc},fI="VOD",kI="LIVE",sI={Vj:"caption",bk:_.ye};_.v(uI,_.Jo);uI.prototype.Ia=function(){_.Gp.ism=gI;_.Ep[_.ic]=gI};uI.prototype.Ca=function(){_.Dw("ism");_.Ew(_.ic)};uI.prototype.id=function(){return"smooth"};_.D("clpp.smooth.SmoothComponent",uI);};
72
73
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
73
74
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
74
75
  else{_=this.clpp._;(f.call(g,this));}