@castlabs/prestoplay 6.7.0 → 6.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/CHANGELOG.md +50 -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 +419 -420
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +71 -71
  10. package/cjs/cl.externs.js +26 -26
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +72 -67
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +31 -31
  15. package/cjs/cl.ima.js +23 -23
  16. package/cjs/cl.mse.js +272 -261
  17. package/cjs/cl.muxdata.js +15 -11
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +13 -13
  20. package/cjs/cl.playlist.js +6 -6
  21. package/cjs/cl.smooth.js +71 -71
  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 +18 -18
  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 +87 -87
  34. package/cl.conviva.js +27 -27
  35. package/cl.core.js +358 -363
  36. package/cl.crypto.js +8 -8
  37. package/cl.dash.js +67 -67
  38. package/cl.externs.js +26 -26
  39. package/cl.freewheel.js +19 -19
  40. package/cl.hls.js +61 -57
  41. package/cl.hlssmpte.js +5 -5
  42. package/cl.htmlcue.js +25 -25
  43. package/cl.ima.js +17 -17
  44. package/cl.mse.js +238 -228
  45. package/cl.muxdata.js +12 -9
  46. package/cl.onboard.js +4 -4
  47. package/cl.persistent.js +9 -9
  48. package/cl.playlist.js +5 -5
  49. package/cl.smooth.js +58 -58
  50. package/cl.thumbnails.js +17 -17
  51. package/cl.tizen.js +57 -57
  52. package/cl.ttml.js +22 -22
  53. package/cl.verimatrix.js +4 -4
  54. package/cl.vimond.js +8 -8
  55. package/cl.vr.js +15 -15
  56. package/cl.vtt.js +12 -12
  57. package/cl.youbora.js +15 -15
  58. package/package.json +1 -1
  59. package/typings.d.ts +74 -20
package/cjs/cl.muxdata.js CHANGED
@@ -1,15 +1,19 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var Ou=function(a,b){this.l=a;this.m=this.f=null;this.B=("000000"+(Math.random()*Math.pow(36,6)<<0).toString(36)).slice(-6);this.a=new _.eg;this.h=b;this.o=this.j=this.g=this.w=!1;this.A=null},Qu=function(a){var b={debug:!0,data:Pu(a)};a.f&&a.f.muxOptionsOverride&&_.K.Mc(a.f.muxOptionsOverride)&&(b=_.K.ya(b,a.f.muxOptionsOverride));b=_.K.ya(b,{getPlayheadTime:function(){return 1E3*a.l.getPosition()},getStateData:function(){a.h.debug("getStateData()");var c=a.l.getLoadedSource(),d=a.l.getTrackManager(),
3
- e=a.l.getSurface(),f={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 g=new _.Bi(c.url);f.video_source_url=_.Ci(g);f.video_source_mime_type=c.type;c.name&&(f.video_title=c.name)}if(c=e.getContainer())f.player_width=c.offsetWidth,f.player_height=c.offsetHeight;(c=a.l.getSurface().getMedia())?c={videoWidth:c.videoWidth,videoHeight:c.videoHeight}:(c=a.l.getTrackManager().fa(),
4
- c={videoWidth:c.width,videoHeight:c.height});e=c;c=e.videoWidth;e=e.videoHeight;a.h.debug("Video dimensions: "+c+"x"+e);c&&e&&(f.video_source_height=c,f.video_source_width=e);(d=d.pa())&&d.language&&(f.player_language_code=d.language);return f}});a.h.debug("Mux SDK options",b);return b},Pu=function(a){var b={env_key:a.f.envKey,video_title:a.m&&a.m.name||"",player_name:_.ra,player_software_name:_.ra,player_software_version:_.ea,player_mux_plugin_name:"CastlabsPlayer built-in Mux Plugin",player_mux_plugin_version:_.ea};
5
- (a=a.l.getConfiguration().viewerId)&&(b.viewer_user_id=a);return b},Ru=function(a,b,c){a.h.debug("Event: "+b);a.A.emit(a.B,b,c)},Su=function(a){a.a.on(a.l,_.Fe,function(){var b={player_playhead_time:1E3*a.l.getPosition()};Ru(a,_.Fe,b)});a.a.on(a.l,_.Zd,function(){return Ru(a,_.Zd)});a.a.on(a.l,_.uc,a.ji.bind(a));a.a.on(a.l,_.se,a.li.bind(a));a.a.on(a.l,_.Ne,function(){return Ru(a,_.me)});a.a.on(a.l,_.Me,function(){return Ru(a,_.le)});a.a.on(a.l,_.jd,a.ki.bind(a));a.a.on(a.l,_.Ib,function(){return Ru(a,
6
- "adbreakstart")});a.a.on(a.l,_.Jb,function(){return Ru(a,"adbreakend")});a.a.on(a.l,_.Vb,function(){Ru(a,"adplay");Ru(a,"adplaying")});a.a.on(a.l,_.Rb,function(){return Ru(a,"adpause")});a.a.on(a.l,_.Tb,function(){Ru(a,"adplay");Ru(a,"adplaying")});a.a.on(a.l,_.Wb,function(){return Ru(a,"adended")});a.a.on(a.l,_.Nb,function(){return Ru(a,"adfirstquartile")});a.a.on(a.l,_.Qb,function(){return Ru(a,"admidpoint")});a.a.on(a.l,_.Xb,function(){return Ru(a,"adthirdquartile")})},Tu=function(){this.f=null;
7
- this.a=!1;this.h=new _.H("clpp.muxdata")},Uu=function(){};_.t=Ou.prototype;_.t.initialize=function(a,b,c){this.f=a;this.m=b;this.A=c;this.w=!1;if(!this.g){try{this.g=!0,this.A.init(this.B,Qu(this))}catch(d){throw this.g=!1,_.hg(this.a),new _.L(1,9,9302,null,d);}Ru(this,"playerready")}this.j&&!this.o&&(a=Pu(this),Ru(this,"videochange",a),this.j=!1);Su(this)};_.t.release=function(){this.h.debug("release()");this.j?this.h.debug(_.ia):(_.hg(this.a),this.j=!0,this.m=this.f=null)};
8
- _.t.destroy=function(){this.h.debug(_.Yc);this.o?this.h.debug(_.ha):(this.o=!0,this.g&&this.w&&Ru(this,"viewend"),Ru(this,"destroy"))};_.t.ji=function(a){this.h.debug(_.Md);var b=a.detail;a=this.l.getTrackManager();b&&b.bandwidth&&(b=b.bandwidth,(a=a.Ia())&&a.bandwidth&&(b+=a.bandwidth),Ru(this,"renditionchange",{video_source_bitrate:b}))};
9
- _.t.li=function(a){this.h.debug(_.Qd);switch(a.detail.currentState){case _.kn:this.l.getConfiguration().autoplay&&Ru(this,_.Zd);break;case _.mn:Ru(this,_.$d);break;case _.ln:Ru(this,_.Vd);break;case _.en:this.w=!0,Ru(this,_.id)}};
10
- _.t.ki=function(a){this.h.debug(_.Nd);if(this.g&&(a=a.detail||null))if(10003===a.code)Ru(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);Ru(this,_.jd,{player_error_code:a.code,player_error_message:b})}};_.w(Tu,_.nq);_.t=Tu.prototype;_.t.onPlayerCreated=function(a){this.f=new Ou(a,this.h)};
11
- _.t.onContentWillLoad=function(a,b){var c=a.getConfiguration();var d=null;(this.a=!_.K.R(c.muxdata)&&typeof c.muxdata===_.Ld)?(d=c.muxdata,c=d.muxLib,d="undefined"!==typeof c&&typeof c.init===_.ld&&typeof c.emit===_.ld?d.muxLib:window.mux,"undefined"===d&&(this.h.warn("Mux SDK is not loaded. Will do nothing."),this.a=!1,c=new _.L(1,9,9301),this.S(a,c))):this.h.warn("Mux plugin is loaded but not configured. Will do nothing.");if(this.a){c=a.getConfiguration();c=_.K.Qa(c.muxdata||{});try{var e=[];typeof c===
12
- _.Ld&&(c.envKey||e.push("envKey"));if(0<e.length)throw new _.L(1,9,9300,{missingKeys:e});this.f.initialize(c,b,d)}catch(f){this.a=!1,this.S(a,f)}}};_.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.S=function(a,b){a.trigger(new _.I(_.jd,{detail:b}))};_.C("clpp.muxdata.MuxDataPlugin",Tu);Tu.Id="mux";Uu.prototype.create=function(){return new Tu};_.Fo(new Uu);};
2
+ var f=function(window){var Fu=function(a){switch(a.type){case 1:return Cu;case 2:return Du;case 3:return Eu}},Hu=function(a){var b=Object.keys(a).find(function(c){return Gu.includes(c.toLowerCase())});return void 0!==b?a[b]:void 0},Iu=function(a,b){this.l=a;this.o=this.f=null;this.D=("000000"+(Math.random()*Math.pow(36,6)<<0).toString(36)).slice(-6);this.a=new _.dg;this.h=b;this.w=this.m=this.g=this.A=!1;this.B=null;this.j=a.getNetworkEngine();this.H=this.vi.bind(this);this.F=this.bl.bind(this)},Ku=function(a){var b={debug:!0,
3
+ data:Ju(a)};a.f&&a.f.muxOptionsOverride&&_.K.Oc(a.f.muxOptionsOverride)&&(b=_.K.va(b,a.f.muxOptionsOverride));b=_.K.va(b,{getPlayheadTime:function(){return 1E3*a.l.getPosition()},getStateData:function(){a.h.debug("getStateData()");var c=a.l.getLoadedSource(),d=a.l.getTrackManager(),e=a.l.getSurface(),f={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 g=new _.zi(c.url);
4
+ f.video_source_url=_.Ai(g);f.video_source_mime_type=c.type;c.name&&(f.video_title=c.name)}if(c=e.getContainer())f.player_width=c.offsetWidth,f.player_height=c.offsetHeight;(c=a.l.getSurface().getMedia())?c={videoWidth:c.videoWidth,videoHeight:c.videoHeight}:(c=a.l.getTrackManager().fa(),c={videoWidth:c.width,videoHeight:c.height});e=c;c=e.videoWidth;e=e.videoHeight;a.h.debug("Video dimensions: "+c+"x"+e);c&&e&&(f.video_source_height=c,f.video_source_width=e);(d=d.pa())&&d.language&&(f.player_language_code=
5
+ d.language);return f}});a.h.debug("Mux SDK options",b);return b},Ju=function(a){var b={env_key:a.f.envKey,video_title:a.o&&a.o.name||"",player_name:_.oa,player_software_name:_.oa,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},Lu=function(a,b,c){a.h.debug("Event: "+b);a.B.emit(a.D,b,c)},Mu=function(a){a.a.on(a.l,_.De,function(){var b={player_playhead_time:1E3*
6
+ a.l.getPosition()};Lu(a,_.De,b)});a.a.on(a.l,_.Xd,function(){return Lu(a,_.Xd)});a.a.on(a.l,_.rc,a.pi.bind(a));a.a.on(a.l,_.pe,a.si.bind(a));a.a.on(a.l,_.Le,function(){return Lu(a,_.ke)});a.a.on(a.l,_.Ke,function(){return Lu(a,_.je)});a.a.on(a.l,_.hd,a.ri.bind(a));a.a.on(a.l,_.Fb,function(){return Lu(a,"adbreakstart")});a.a.on(a.l,_.Gb,function(){return Lu(a,"adbreakend")});a.a.on(a.l,_.Sb,function(){Lu(a,"adplay");Lu(a,"adplaying")});a.a.on(a.l,_.Ob,function(){return Lu(a,"adpause")});a.a.on(a.l,
7
+ _.Qb,function(){Lu(a,"adplay");Lu(a,"adplaying")});a.a.on(a.l,_.Tb,function(){return Lu(a,"adended")});a.a.on(a.l,_.Kb,function(){return Lu(a,"adfirstquartile")});a.a.on(a.l,_.Nb,function(){return Lu(a,"admidpoint")});a.a.on(a.l,_.Ub,function(){return Lu(a,"adthirdquartile")});a.j.Ed(a.H);a.j.Cf(a.F);a.a.on(a.l,_.hd,function(b){var c=b.detail;if(c&&1===c.category&&(b=(b=c.data)&&b.request,void 0!==b&&!0===(1===b.type||2===b.type||3===b.type)))if(7001===c.code){c=b.requestStartTimestamp;var d=new _.zi(b.uris[b.uriIndex]);
8
+ b={request_start:c,request_type:Fu(b),request_hostname:d.a};a.h.debug("onRequestCanceled()","Track event: requestcanceled",b);Lu(a,"requestcanceled",b)}else{d=b.requestStartTimestamp;var e=new _.zi(b.uris[b.uriIndex]),f=c.data;b={request_start:d,request_type:Fu(b),request_hostname:e.a,request_error:""+Fu(b)+"LoadError",request_error_code:void 0===f?-1:void 0!==f.response?f.response.status:void 0!==f.status?f.status:-1,request_error_text:c.toString()};a.h.debug("onRequestFailed()","Track event: requestfailed",
9
+ b);Lu(a,"requestfailed",b)}})},Nu=function(a){_.gg(a.a);a.j.be(a.H);a.j.Wg(a.F)},Ou=function(){this.f=null;this.a=!1;this.h=new _.I("clpp.muxdata")},Pu=function(){},Cu="manifest",Du="media",Eu="encryption",Gu=["x-request-id","cf-ray","x-amz-cf-id","x-akamai-request-id"];_.t=Iu.prototype;_.t.initialize=function(a,b,c){this.f=a;this.o=b;this.B=c;this.A=!1;if(!this.g){try{this.g=!0,this.B.init(this.D,Ku(this))}catch(d){throw this.g=!1,Nu(this),new _.L(1,9,9302,null,d);}Lu(this,"playerready")}this.m&&!this.w&&(a=Ju(this),Lu(this,"videochange",a),this.m=!1);Mu(this)};_.t.release=function(){this.h.debug("release()");this.m?this.h.debug(_.ia):(Nu(this),this.m=!0,this.o=this.f=null)};
10
+ _.t.destroy=function(){this.h.debug(_.Vc);this.w?this.h.debug(_.ha):(this.w=!0,this.g&&this.A&&Lu(this,"viewend"),Lu(this,"destroy"))};_.t.pi=function(a){this.h.debug(_.Kd);var b=a.detail;a=this.l.getTrackManager();b&&b.bandwidth&&(b=b.bandwidth,(a=a.Ka())&&a.bandwidth&&(b+=a.bandwidth),Lu(this,"renditionchange",{video_source_bitrate:b}))};
11
+ _.t.si=function(a){this.h.debug(_.Od);switch(a.detail.currentState){case _.Vm:this.l.getConfiguration().autoplay&&Lu(this,_.Xd);break;case _.Xm:Lu(this,_.Yd);break;case _.Wm:Lu(this,_.Td);break;case _.Qm:this.A=!0,Lu(this,_.gd)}};
12
+ _.t.ri=function(a){this.h.debug(_.Ld);if(this.g&&(a=a.detail||null))if(10003===a.code)Lu(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);Lu(this,_.hd,{player_error_code:a.code,player_error_message:b})}};
13
+ _.t.vi=function(a){var b=a.request;if(b=void 0!==b&&!0===(1===b.type||2===b.type||3===b.type))b=a.status,b=void 0!==b&&200<=b&&299>=b;if(b){b=a.request;var c=a.headers,d=b.bytesLoaded,e=b.requestStartTimestamp,f=b.startTime,g=b.endTime,h=e+a.responseStartMs;a=e+a.timeMs;f=f&&g?g-f:void 0;g=new _.zi(b.uris[b.uriIndex]);a={request_start:e,request_type:Fu(b),request_hostname:g.a,request_id:Hu(c),request_bytes_loaded:d,request_response_start:h,request_response_end:a,request_response_headers:c,request_media_duration:f,
14
+ request_url:_.Ai(g)};this.h.debug("onRequestCompleted()","Track event: requestcompleted",a);Lu(this,"requestcompleted",a)}};_.t.bl=function(a){a.requestStartTimestamp=Date.now()};_.w(Ou,_.$p);_.t=Ou.prototype;_.t.onPlayerCreated=function(a){this.f=new Iu(a,this.h)};
15
+ _.t.onContentWillLoad=function(a,b){var c=a.getConfiguration();var d=null;(this.a=!_.K.R(c.muxdata)&&typeof c.muxdata===_.Jd)?(d=c.muxdata,c=d.muxLib,d="undefined"!==typeof c&&typeof c.init===_.jd&&typeof c.emit===_.jd?d.muxLib:window.mux,"undefined"===d&&(this.h.warn("Mux SDK is not loaded. Will do nothing."),this.a=!1,c=new _.L(1,9,9301),this.U(a,c))):this.h.warn("Mux plugin is loaded but not configured. Will do nothing.");if(this.a){c=a.getConfiguration();c=_.K.Ra(c.muxdata||{});try{var e=[];typeof c===
16
+ _.Jd&&(c.envKey||e.push("envKey"));if(0<e.length)throw new _.L(1,9,9300,{missingKeys:e});this.f.initialize(c,b,d)}catch(f){this.a=!1,this.U(a,f)}}};_.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",Ou);Ou.Id="mux";Pu.prototype.create=function(){return new Ou};_.qo(new Pu);};
13
17
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
14
18
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
15
19
  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 Mu=function(){this.l=null;this.h=new _.H("clpp.onboard")},Nu=function(a,b){function c(l){return l&&(_.Dh(l,"https://")||_.Dh(l,"http://")||_.Dh(l,"//"))?l:d+l}var d=b.baseUrl;_.Eh(d,"/")||(d+="/");var e=c(b.widevineUrl||"widevine"),f=c(b.playreadyUrl||"playready"),g=c(b.fairplayUrl||"fairplay"),h=new _.Bk(a);h.Oa(_.Uc,{licenseUrl:e,videoRobustness:[_.ob,void 0],audioRobustness:[_.nb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:_.pl,
3
- licenseResponse:_.ul}});h.Oa(_.Sc,{licenseUrl:g,certificateUrl:g,modifiers:{licenseRequest:_.rl,licenseResponse:_.sl,extractContentId:_.ol,certificateRequest:_.tl}});h.Oa(_.Tc,{licenseUrl:f,modifiers:{licenseRequest:_.pl}});_.wk(h)};_.w(Mu,_.Ko);_.t=Mu.prototype;_.t.Ma=function(a){this.l=a};_.t.Fa=function(){this.l=null};
4
- _.t.$b=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.h.info("Registering the DRMtoday Onboard environment, name\x3d'"+b+"'"),Nu(b,a))};_.t.release=function(){};_.t.id=function(){return"onboard"};_.C("clpp.onboard.OnboardComponent",Mu);_.C("clpp.onboard.register",Nu);};
2
+ var f=function(window){var Au=function(){this.l=null;this.h=new _.I("clpp.onboard")},Bu=function(a,b){function c(l){return l&&(_.Bh(l,"https://")||_.Bh(l,"http://")||_.Bh(l,"//"))?l:d+l}var d=b.baseUrl;_.Ch(d,"/")||(d+="/");var e=c(b.widevineUrl||"widevine"),f=c(b.playreadyUrl||"playready"),g=c(b.fairplayUrl||"fairplay"),h=new _.wk(a);h.Pa(_.Rc,{licenseUrl:e,videoRobustness:[_.mb,void 0],audioRobustness:[_.lb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:_.kl,
3
+ licenseResponse:_.pl}});h.Pa(_.Pc,{licenseUrl:g,certificateUrl:g,modifiers:{licenseRequest:_.ml,licenseResponse:_.nl,extractContentId:_.jl,certificateRequest:_.ol}});h.Pa(_.Qc,{licenseUrl:f,modifiers:{licenseRequest:_.kl}});_.rk(h)};_.w(Au,_.wo);_.t=Au.prototype;_.t.Oa=function(a){this.l=a};_.t.Ha=function(){this.l=null};
4
+ _.t.ac=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.h.info("Registering the DRMtoday Onboard environment, name\x3d'"+b+"'"),Bu(b,a))};_.t.release=function(){};_.t.id=function(){return"onboard"};_.C("clpp.onboard.OnboardComponent",Au);_.C("clpp.onboard.register",Bu);};
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 tu="A persistent DRM session already exists for: ",uu="No DRM configuration.",vu="clpp.persistent",wu=function(a){a.B=[a.g];a.o=0;a.m=0},xu=function(a){var b=a.B.splice(0)[0];(b=a.g=a.g||b)?b.lg?a.a=a.o||a.m:void 0!=b.G&&a.m<b.G?(a.a=b.G,a.g=null):a.a=a.m:a.a=0},yu=function(a,b){for(var c=[],d=_.u(a),e=d.next();!e.done;e=d.next())c.push(b(e.value));return c},zu=function(a){a=a.f.keys();a=yu(a,function(b){return b.sessionId});return Array.from(a)},Au=function(a,b){var c,d,e;return _.B(function(f){if(1==
3
- f.a)return _.x(f,_.qm(a,b),2);c=f.f;if(!c)return a.h.debug("Ignoring attempt to remove missing session",b),f["return"]();d=[];(e=a.f.get(c))&&a.B&&(e.qb=new _.di,d.push(e.qb));a.h.debug("Attempting to remove session",b);d.push(c.remove());return f["return"](Promise.all(d))})},Cu=function(a,b){a.J=Bu;a.K=[];a.F=!0;return _.Yl(a,b)},Eu=function(a,b,c,d,e,f){a.J=Du;var g=new Map,h=_.sm(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 _.dm(a,g)},Fu=function(){},Gu=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}},Hu=function(a,b){var c=_.yk(a),d=_.jk({drm:a});d.drm=a;var e=new _.Ul({Cb:b,onError:function(){},Ze:function(){},onExpirationUpdated:function(){},onEvent:function(){},getConfiguration:function(){return d},Kc:function(){return null}});e.g=c;return e},Ku=function(a,b,c){var d,e,f,g,h,l,m,n,p;return _.B(function(q){switch(q.a){case 1:d=Iu;e=Ju;if(!a)return e.debug(uu),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(tu,f),q["return"]();h=Hu(a,c);_.Af(q,3,4);return _.x(q,Cu(h,b),6);case 6:return _.x(q,_.jm(h),7);case 7:return _.x(q,_.km(h),8);case 8:return l=h.getDrmInfo(),m=b.map(function(r){return{contentType:_.Yi(r.video.mimeType,r.video.codecs),robustness:l.videoRobustness}}),n=zu(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 wu(q),_.x(q,h.destroy(),10);case 10:xu(q);break;case 3:throw p=_.Cf(q),e.error("Error while persisting DRM session"),new _.L(1,6,6200,null,p);}})},Lu=function(){this.l=null;this.a=Iu;this.h=new _.H(vu)},Bu=1,Du=2;_.t=Fu.prototype;
2
+ var f=function(window){var hu="A persistent DRM session already exists for: ",iu="No DRM configuration.",ju="clpp.persistent",ku=function(a){a.B=[a.g];a.o=0;a.m=0},lu=function(a){var b=a.B.splice(0)[0];(b=a.g=a.g||b)?b.qg?a.a=a.o||a.m:void 0!=b.G&&a.m<b.G?(a.a=b.G,a.g=null):a.a=a.m:a.a=0},mu=function(a,b){for(var c=[],d=_.u(a),e=d.next();!e.done;e=d.next())c.push(b(e.value));return c},nu=function(a){a=a.f.keys();a=mu(a,function(b){return b.sessionId});return Array.from(a)},ou=function(a,b){var c,d,e;return _.B(function(f){if(1==
3
+ f.a)return _.x(f,_.bm(a,b),2);c=f.f;if(!c)return a.h.debug("Ignoring attempt to remove missing session",b),f["return"]();d=[];(e=a.f.get(c))&&a.B&&(e.rb=new _.bi,d.push(e.rb));a.h.debug("Attempting to remove session",b);d.push(c.remove());return f["return"](Promise.all(d))})},qu=function(a,b){a.J=pu;a.K=[];a.F=!0;return _.Jl(a,b)},su=function(a,b,c,d,e,f){a.J=ru;var g=new Map,h=_.dm(b);g.set(h,{audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:_.Qd,persistentState:_.ge,sessionTypes:[_.Vd],
4
+ label:h,drmInfos:[{keySystem:b,licenseServerUri:c,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}]});return _.Pl(a,g)},tu=function(){},uu=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}},vu=function(a,b){var c=_.tk(a),d=_.ek({drm:a});d.drm=a;var e=new _.Fl({Db:b,onError:function(){},cf:function(){},onExpirationUpdated:function(){},onEvent:function(){},getConfiguration:function(){return d},Mc:function(){return null}});e.g=c;return e},yu=function(a,b,c){var d,e,f,g,h,l,m,n,p;return _.B(function(q){switch(q.a){case 1:d=wu;e=xu;if(!a)return e.debug(iu),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(hu,f),q["return"]();h=vu(a,c);_.zf(q,3,4);return _.x(q,qu(h,b),6);case 6:return _.x(q,_.Vl(h),7);case 7:return _.x(q,_.Wl(h),8);case 8:return l=h.getDrmInfo(),m=b.map(function(r){return{contentType:_.Ti(r.video.mimeType,r.video.codecs),robustness:l.videoRobustness}}),n=nu(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 ku(q),_.x(q,h.destroy(),10);case 10:lu(q);break;case 3:throw p=_.Bf(q),e.error("Error while persisting DRM session"),new _.L(1,6,6200,null,p);}})},zu=function(){this.l=null;this.a=wu;this.h=new _.I(ju)},pu=1,ru=2;_.t=tu.prototype;
8
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"](Gu(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.R(a)||(_.K.mb(a.store)||c.push("store"),_.K.mb(a.get)||c.push("get"),_.K.mb(a["delete"])||c.push("delete"),_.K.mb(a.clear)||c.push("clear"),_.K.mb(a.getName)||c.push("getName"),b=c);if(0<b.length)throw Ju.warn("Invalid session storage implementation"),new _.L(1,6,6202,{missingMethods:b});Iu=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,v,y,A,E,F,D,J,ja,P,Na;return _.B(function(pa){switch(pa.a){case 1:f=Iu;g=Ju;h=function(ta,Fa){return new _.L(1,6,6200,ta,Fa)};l=_.qn(a).shift();if(!l)throw h("No source specified.");if(!b)throw h(uu);m=b.offlineId;if(typeof m!==_.ve||!m.length)throw h("Missing offline id.");return _.x(pa,f.get(m),2);case 2:if(n=pa.f)return g.debug(tu,m),pa["return"]();p=_.jk();q=new _.pi;
11
- r=[];v=_.u(d);for(y=v.next();!y.done;y=v.next())A=y.value,E=new A,_.nk(E.id())||(E.Ma(null),_.pk(E),r.push(E));F=null;_.Af(pa,3,4);return _.x(pa,_.Ep(l.url,q,p.manifest.attemptParameters,l.type||null),6);case 6:return F=pa.f,F.configure(p.manifest),_.x(pa,F.start(l.url,{networkingEngine:q,filterAllPeriods:function(){},filterNewPeriod:function(){},onTimelineCueAdded:function(){},onEvent:function(){},onError:function(){}}),7);case 7:D=pa.f;if(!D.periods.length)throw h(null,new _.L(_.M,4,4014));J=_.xp(D.periods);
12
- return _.x(pa,Ku(b,J,q),4);case 4:for(wu(pa);r.length;)ja=r.shift(),ja.Fa(),_.mk["delete"](ja.id());P=[];F&&P.push(F.stop());P.push(q.destroy());return _.x(pa,Promise.all(P),9);case 9:xu(pa);break;case 3:Na=_.Cf(pa);if(Na instanceof _.L&&6200===Na.code)throw Na;throw h(null,Na);}})});
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=Iu;c=Ju;if(!_.K.Y(a)||0===a.length)return c.warn("Invalid offlineId"),l["return"]();e=d=null;_.Af(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 _.pi;d=Hu(f.drmConfig,e);return _.x(l,Eu(d,f.keySystem,f.licenseServerUri,f.serverCertificate,f.audioCapabilities,f.videoCapabilities),
14
- 6);case 6:return _.x(l,_.jm(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,Au(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 wu(l),g=[],d&&g.push(d.destroy()),e&&g.push(e.destroy()),_.x(l,Promise.all(g),10);case 10:xu(l);break;case 2:throw h=_.Cf(l),c.error("Failed to remove session"),new _.L(1,6,6201,null,h);}})});var Iu=new Fu,Ju=new _.H(vu);_.w(Lu,_.Ko);_.t=Lu.prototype;_.t.Ma=function(a){this.l=a};_.t.Fa=function(){this.l=null};_.t.release=function(){};_.t.$b=function(){this.a=Iu};_.t.id=function(){return _.Wd};_.t.Hk=function(a,b,c){var d=this,e;return _.B(function(f){if(1==f.a){if(!a)return d.h.debug("No DRM configuration found for loaded source."),f["return"]();_.Af(f,2);return _.x(f,Ku(a,b,c),4)}if(2!=f.a)return d.l.trigger(new _.I(_.cd,{offlineId:a.offlineId})),_.Bf(f,0);e=_.Cf(f);d.l.onError(e);_.z(f)})};
15
- _.t.dj=function(a){var b=this,c;return _.B(function(d){if(1==d.a)return _.Af(d,2),_.x(d,b.a.get(a),4);if(2!=d.a){if(c=d.f)return d["return"](c.sessionIds);b.h.debug("No offline session found for "+a);return d["return"]([])}_.Cf(d);b.h.warn("Error while loading session info from storage");return d["return"]([])})};_.C("clpp.persistent.PersistentLicenseComponent",Lu);};
9
+ btoa(c));_.y(d)})};_.t.get=function(a){var b;return _.B(function(c){return(b=window.localStorage.getItem(encodeURIComponent(a)))?c["return"](uu(atob(b))):c["return"](null)})};_.t["delete"]=function(a){return _.B(function(b){window.localStorage.removeItem(encodeURIComponent(a));_.y(b)})};_.t.clear=function(){return _.B(function(a){window.localStorage.clear();_.y(a)})};_.t.getName=function(){return"clpp.persistent.SimpleSessionStorage"};_.C("clpp.persistent.useStorage",function(a){var b=["store","get","delete","clear","getName"];var c=[];_.K.R(a)||(_.K.nb(a.store)||c.push("store"),_.K.nb(a.get)||c.push("get"),_.K.nb(a["delete"])||c.push("delete"),_.K.nb(a.clear)||c.push("clear"),_.K.nb(a.getName)||c.push("getName"),b=c);if(0<b.length)throw xu.warn("Invalid session storage implementation"),new _.L(1,6,6202,{missingMethods:b});wu=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,v,z,A,E,H,D,F,V,P,Ca;return _.B(function(qa){switch(qa.a){case 1:f=wu;g=xu;h=function(ra,Da){return new _.L(1,6,6200,ra,Da)};l=_.an(a).shift();if(!l)throw h("No source specified.");if(!b)throw h(iu);m=b.offlineId;if(typeof m!==_.te||!m.length)throw h("Missing offline id.");return _.x(qa,f.get(m),2);case 2:if(n=qa.f)return g.debug(hu,m),qa["return"]();p=_.ek();q=new _.ni;
11
+ r=[];v=_.u(d);for(z=v.next();!z.done;z=v.next())A=z.value,E=new A,_.ik(E.id())||(E.Oa(null),_.kk(E),r.push(E));H=null;_.zf(qa,3,4);return _.x(qa,_.qp(l.url,q,p.manifest.attemptParameters,l.type||null),6);case 6:return H=qa.f,H.configure(p.manifest),_.x(qa,H.start(l.url,{networkingEngine:q,filterAllPeriods:function(){},filterNewPeriod:function(){},onTimelineCueAdded:function(){},onEvent:function(){},onError:function(){}}),7);case 7:D=qa.f;if(!D.periods.length)throw h(null,new _.L(_.M,4,4014));F=_.jp(D.periods);
12
+ return _.x(qa,yu(b,F,q),4);case 4:for(ku(qa);r.length;)V=r.shift(),V.Ha(),_.hk["delete"](V.id());P=[];H&&P.push(H.stop());P.push(q.destroy());return _.x(qa,Promise.all(P),9);case 9:lu(qa);break;case 3:Ca=_.Bf(qa);if(Ca instanceof _.L&&6200===Ca.code)throw Ca;throw h(null,Ca);}})});
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=wu;c=xu;if(!_.K.$(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 _.ni;d=vu(f.drmConfig,e);return _.x(l,su(d,f.keySystem,f.licenseServerUri,f.serverCertificate,f.audioCapabilities,f.videoCapabilities),
14
+ 6);case 6:return _.x(l,_.Vl(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,ou(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 ku(l),g=[],d&&g.push(d.destroy()),e&&g.push(e.destroy()),_.x(l,Promise.all(g),10);case 10:lu(l);break;case 2:throw h=_.Bf(l),c.error("Failed to remove session"),new _.L(1,6,6201,null,h);}})});var wu=new tu,xu=new _.I(ju);_.w(zu,_.wo);_.t=zu.prototype;_.t.Oa=function(a){this.l=a};_.t.Ha=function(){this.l=null};_.t.release=function(){};_.t.ac=function(){this.a=wu};_.t.id=function(){return _.Ud};_.t.Uk=function(a,b,c){var d=this,e;return _.B(function(f){if(1==f.a){if(!a)return d.h.debug("No DRM configuration found for loaded source."),f["return"]();_.zf(f,2);return _.x(f,yu(a,b,c),4)}if(2!=f.a)return d.l.trigger(new _.J(_.$c,{offlineId:a.offlineId})),_.Af(f,0);e=_.Bf(f);d.l.onError(e);_.y(f)})};
15
+ _.t.lj=function(a){var b=this,c;return _.B(function(d){if(1==d.a)return _.zf(d,2),_.x(d,b.a.get(a),4);if(2!=d.a){if(c=d.f)return d["return"](c.sessionIds);b.h.debug("No offline session found for "+a);return d["return"]([])}_.Bf(d);b.h.warn("Error while loading session info from storage");return d["return"]([])})};_.C("clpp.persistent.PersistentLicenseComponent",zu);};
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 qu=function(a,b){b=void 0===b?function(){return Promise.resolve()}:b;_.bk.call(this);this.l=a;this.m=b;this.f=0;this.a=[];this.g=!1;this.j=this.yg.bind(this)},ru=function(a){a.trigger(new _.I(_.be))},su=function(a,b){return 0<=b&&b<a.a.length};_.w(qu,_.bk);_.t=qu.prototype;_.t.on=function(a,b,c){return _.bk.prototype.on.call(this,a,b,c)};_.t.one=function(a,b,c){return _.bk.prototype.one.call(this,a,b,c)};_.t.off=function(a,b){return _.bk.prototype.off.call(this,a,b)};_.t.getPosition=function(){return this.f};
3
- _.t.jj=function(){return this.a};_.t.Ee=function(){return 0<this.a.length&&su(this,this.f)?this.a[this.f]:null};_.t.lj=function(){var a=this.f+1;return 0<this.a.length&&su(this,a)?this.a[a]:null};_.t.wj=function(){return this.g};_.t.start=function(){this.g||(this.g=!0,this.l.on(_.id,this.j),this.Sd(this.f,!0))};_.t.stop=function(){this.g=!1;this.l.off(_.id,this.j)};_.t.yg=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.Sd(b),0)})};_.t.Kk=function(){var a=this,b;return _.B(function(c){b=Math.max(0,a.f-1);return _.x(c,a.Sd(b),0)})};_.t.Sd=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&&su(c,a))||!b&&c.f===a)return e["return"]();c.f=a;return(d=c.Ee())?_.x(e,c.m(d),3):e.G(0)}if(4!=e.a)return _.x(e,c.l.load(d.configuration),4);c.trigger(new _.I(_.ae,{item:d}));_.z(e)})};
5
- _.t.append=function(a){this.a.push(a);ru(this)};_.t.sj=function(a,b){if(0<=b&&b<=this.a.length){var c=this.Ee();this.a.splice(b,0,a);c&&(this.f=this.a.indexOf(c));ru(this)}};_.t.remove=function(a){if(0<this.a.length&&su(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);ru(this)}};_.t.clear=function(){this.stop();this.f=0;this.a=[];this.g=!1;ru(this)};_.C("clpp.Playlist",qu);qu.prototype.clear=qu.prototype.clear;qu.prototype.remove=qu.prototype.remove;
6
- qu.prototype.insert=qu.prototype.sj;qu.prototype.append=qu.prototype.append;qu.prototype.goTo=qu.prototype.Sd;qu.prototype.previous=qu.prototype.Kk;qu.prototype.next=qu.prototype.next;qu.prototype.onEnded=qu.prototype.yg;qu.prototype.stop=qu.prototype.stop;qu.prototype.start=qu.prototype.start;qu.prototype.isStarted=qu.prototype.wj;qu.prototype.getUpcoming=qu.prototype.lj;qu.prototype.getCurrent=qu.prototype.Ee;qu.prototype.getQueue=qu.prototype.jj;qu.prototype.getPosition=qu.prototype.getPosition;
7
- qu.prototype.off=qu.prototype.off;qu.prototype.one=qu.prototype.one;qu.prototype.on=qu.prototype.on;};
2
+ var f=function(window){var eu=function(a,b){b=void 0===b?function(){return Promise.resolve()}:b;_.Wj.call(this);this.l=a;this.m=b;this.f=0;this.a=[];this.g=!1;this.j=this.Dg.bind(this)},fu=function(a){a.trigger(new _.J(_.$d))},gu=function(a,b){return 0<=b&&b<a.a.length};_.w(eu,_.Wj);_.t=eu.prototype;_.t.on=function(a,b,c){return _.Wj.prototype.on.call(this,a,b,c)};_.t.one=function(a,b,c){return _.Wj.prototype.one.call(this,a,b,c)};_.t.off=function(a,b){return _.Wj.prototype.off.call(this,a,b)};_.t.getPosition=function(){return this.f};
3
+ _.t.tj=function(){return this.a};_.t.He=function(){return 0<this.a.length&&gu(this,this.f)?this.a[this.f]:null};_.t.vj=function(){var a=this.f+1;return 0<this.a.length&&gu(this,a)?this.a[a]:null};_.t.Fj=function(){return this.g};_.t.start=function(){this.g||(this.g=!0,this.l.on(_.gd,this.j),this.Ud(this.f,!0))};_.t.stop=function(){this.g=!1;this.l.off(_.gd,this.j)};_.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.Ud(b),0)})};_.t.Xk=function(){var a=this,b;return _.B(function(c){b=Math.max(0,a.f-1);return _.x(c,a.Ud(b),0)})};_.t.Ud=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&&gu(c,a))||!b&&c.f===a)return e["return"]();c.f=a;return(d=c.He())?_.x(e,c.m(d),3):e.G(0)}if(4!=e.a)return _.x(e,c.l.load(d.configuration),4);c.trigger(new _.J(_.Zd,{item:d}));_.y(e)})};
5
+ _.t.append=function(a){this.a.push(a);fu(this)};_.t.Bj=function(a,b){if(0<=b&&b<=this.a.length){var c=this.He();this.a.splice(b,0,a);c&&(this.f=this.a.indexOf(c));fu(this)}};_.t.remove=function(a){if(0<this.a.length&&gu(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);fu(this)}};_.t.clear=function(){this.stop();this.f=0;this.a=[];this.g=!1;fu(this)};_.C("clpp.Playlist",eu);eu.prototype.clear=eu.prototype.clear;eu.prototype.remove=eu.prototype.remove;
6
+ eu.prototype.insert=eu.prototype.Bj;eu.prototype.append=eu.prototype.append;eu.prototype.goTo=eu.prototype.Ud;eu.prototype.previous=eu.prototype.Xk;eu.prototype.next=eu.prototype.next;eu.prototype.onEnded=eu.prototype.Dg;eu.prototype.stop=eu.prototype.stop;eu.prototype.start=eu.prototype.start;eu.prototype.isStarted=eu.prototype.Fj;eu.prototype.getUpcoming=eu.prototype.vj;eu.prototype.getCurrent=eu.prototype.He;eu.prototype.getQueue=eu.prototype.tj;eu.prototype.getPosition=eu.prototype.getPosition;
7
+ eu.prototype.off=eu.prototype.off;eu.prototype.one=eu.prototype.one;eu.prototype.on=eu.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,75 +1,75 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var mH="Full MP4 box must have flags defined",nH="clpp.smooth.SmoothMP4Processor",oH="codecPrivateData",pH=function(a,b){var c=Math.floor(b/Math.pow(2,32)),d=b-c*Math.pow(2,32);_.S(a,c);_.S(a,d)},qH=function(a,b){try{a.f.setUint8(a.a,b),a.a+=1}catch(c){_.Ek()}},rH=function(a,b){qH(a,b>>16&255);qH(a,b>>8&255);qH(a,b&255)},sH=function(a,b){try{a.f.setUint16(a.a,b,a.g),a.a+=2}catch(c){_.Ek()}},tH=function(a,b){try{a.f.setInt32(a.a,b,a.g),a.a+=4}catch(c){_.Ek()}},uH=function(a,b){try{a.f.setInt16(a.a,
3
- b,a.g),a.a+=2}catch(c){_.Ek()}},vH=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.A=!1;this.entries=[];this.f=[]},Y=function(a,b,c){X.call(this,a);this.version=b;this.flags=c},wH=function(a,b,c){X.call(this,a);this.g=b;this.offset=c},xH=function(a,b,c,d,e){Y.call(this,
4
- a,b,c);this.g=d;this.offset=e},yH=function(a,b,c){X.call(this,"ftyp");this.j=a;this.rg=b;this.g=c},zH=function(){X.call(this,_.Gd)},AH=function(){X.call(this,_.Ge)},BH=function(a,b,c){Y.call(this,"mvhd",1,0);this.timescale=a;this.duration=b;this.volume=256;this.j=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]},CH=function(){X.call(this,"mvex")},DH=function(a){Y.call(this,"trex",0,0);this.g=a},EH=function(a,b,c,d,e){Y.call(this,"tkhd",1,7);this.j=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]},FH=function(a,b){Y.call(this,"mdhd",1,0);this.timescale=a;this.duration=b;this.language=21956},GH=function(a){Y.call(this,"hdlr",0,0);this.g=a},HH=function(){Y.call(this,"vmhd",0,1);this.g=new Uint8Array([0,0,0,0,0,0])},IH=function(a){X.call(this,a);this.A=!0},JH=function(a){IH.call(this,a);this.height=this.width=0;this.depth=24},KH=function(a,b,c,d){IH.call(this,
6
- a);this.channelCount=b;this.sampleSize=c;this.sampleRate=d},LH=function(a,b){JH.call(this,"avc1");this.width=a;this.height=b},MH=function(a,b){LH.call(this,a,b);this.type="encv"},NH=function(a,b,c){KH.call(this,"mp4a",a,b,c)},OH=function(a,b,c){NH.call(this,a,b,c);this.type="enca"},PH=function(a,b){X.call(this,"avcC");this.Pa=a;this.Tb=b;this.version=1;this.g=this.Pa[0][1];this.j=this.Pa[0][2];this.level=this.Pa[0][3]},QH=function(a){Y.call(this,"esds",0,0);this.Kb=a},RH=function(a){a=void 0===a?
7
- "":a;Y.call(this,"url ",0,1);this.location=a},SH=function(){Y.call(this,"dref",0,0)},TH=function(){X.call(this,_.ue)},UH=function(){Y.call(this,_.we,0,0)},VH=function(){Y.call(this,"stts",0,0)},WH=function(){Y.call(this,"stsc",0,0)},XH=function(){Y.call(this,"stco",0,0)},YH=function(){Y.call(this,"stsz",0,0)},ZH=function(){Y.call(this,"smhd",0,0)},$H=function(){X.call(this,"dinf")},aI=function(){X.call(this,_.Ed)},bI=function(){X.call(this,_.Ad)},cI=function(a,b){Y.call(this,"tfdt",a,0);this.g=b},
8
- dI=function(){Y.call(this,"mfhd",0,0);this.g=0},eI=function(a,b){Y.call(this,"trun",a,b);this.o=this.m=this.g=0;this.w=[];this.sampleSize=[];this.B=[];this.j=[]},fI=function(a,b){Y.call(this,"tfhd",a,b);this.g=255;this.o=this.w=this.m=this.B=this.j=0},gI=function(){X.call(this,"traf")},hI=function(){X.call(this,"moof")},iI=function(){X.call(this,_.zd);this.g=new Uint8Array(0)},jI=function(){Y.call(this,"tenc",0,0);this.g=1;this.j=8;this.o="";this.m=[]},kI=function(a,b){Y.call(this,"schm",0,0);this.g=
9
- a;this.j=b;this.Fb=""},lI=function(a){X.call(this,"frma");this.g=a},mI=function(){Y.call(this,"saio",0,0);this.offset=[0]},nI=function(a,b,c){Y.call(this,"saiz",0,0);this.g=a;this.m=b;this.j=c},oI=function(a,b){Y.call(this,"senc",a,b);this.j=0;this.m=8;this.g=[]},pI=function(a){var b=a.split("/");return b[b.length-1].toLowerCase().match("manifest(\\(.+\\))?")?a:a+"/Manifest"},qI=function(a,b,c,d){c=b.ag[c];b=b.gl;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 _.Nv([a],[b])[0]},rI=function(a,b){if(a.type!==b.type)return!1;var c=[];a.type===_.Re?c=["maxWidth","maxHeight","bitrate",oH,"fourCC"]:a.type===_.lc&&(c=["bitrate",oH,"channels","bitsPerSample","samplingRate","fourCC"]);return _.K.xa(a,b,c,["id","segmentIndex"])},sI=function(a,b,c){var d=c.Hd.split("00000001");a={id:1,type:c.type,duration:a/b,timescale:b,Pa:null,Tb:null,width:NaN,height:NaN,Kb:null,sd:NaN,
11
- sampleSize:NaN,channelCount:NaN};switch(c.type){case _.Re:a.Pa=[_.Oh(d[1])];a.Tb=[_.Oh(d[2])];a.width=c.maxWidth;a.height=c.maxHeight;break;case _.lc:a.Kb=_.Oh(c.Hd),a.sampleSize=c.qh||16,a.sd=c.sd,a.channelCount=c.Hf}return a},tI=function(a,b){return a.filter(function(c){return c.type===b})},uI=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)},BI=function(a,b,c){var d=null;if(vI.test(a)){a=vI.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 wI.test(a)?d=uI(wI,a):xI.test(a)?d=uI(xI,a):yI.test(a)?(a=yI.exec(a),d=Number(a[1])/c.frameRate):zI.test(a)?(a=zI.exec(a),d=Number(a[1])/c.a):AI.test(a)&&(d=uI(AI,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},CI=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))},EI=function(a){this.a=a;this.f=DI(this)},DI=function(a){for(var b=0,c=0;c<a.a.length;c++)b+=a.a[c].a();return new _.Dk(b)},FI=function(a,b,c){a:{var d=_.u([_.Uc,_.Tc]);for(var e=d.next();!e.done;e=d.next())if((e=c.Pd(e.value))&&e.keyId){d=e.keyId;break a}_.G(nH,"Could not get default Key ID for DRM init data!");
14
- d=null}c=new X("xxxx");a.type===_.Re?c=new MH(a.width,a.height):c=new OH(a.channelCount,a.sampleSize,a.sd);a=new jI;a.g=1;a.j=8;a.o=d||"00000000000000000000000000000000";a=(new X("schi")).append([a]);b=(new X(_.oe)).append([new lI(b),new kI(_.Dc,65536),a]);c.append([b]);return c},GI=function(a,b){var c=b.Vd(),d=new BH(a.timescale,a.duration,a.id),e=(new CH).append([new DH(a.id)]),f=new EH(a.id,a.duration,a.timescale,a.width,a.height),g=new FH(a.timescale,a.duration),h=new GH(a.type),l=null,m=new SH;
15
- m.entries=[new RH];var n=new UH;switch(a.type){case _.Re:var p=new PH(a.Pa,a.Tb);c?(l=FI(a,"avc1",b),l.append([p]),n.entries=[l]):(l=(new LH(a.width,a.height)).append([p]),n.entries=[l]);l=new HH;break;case _.lc:p=new QH(a.Kb),c?(l=FI(a,"mp4a",b),l.append([p]),n.entries=[l]):(l=(new NH(a.channelCount,a.sampleSize,a.sd)).append([p]),n.entries=[l]),l=new ZH}n=(new TH).append([n,new VH,new WH,new YH,new XH]);m=(new $H).append([m]);m=(new aI).append([l,m,n]);g=(new bI).append([g,h,m]);f=(new AH).append([f,
16
- g]);d=(new zH).append([d,f,e]);e=new yH("dash",0,["iso6","mp41","avc1"]);c&&(c=b.Pd(_.Tc),f=b.Pd(_.Uc),c&&d.append([new wH("pssh",c.initData,8)]),f&&d.append([new wH("pssh",f.initData,8)]),c||f||_.G(nH,"Could not get PSSH init data!"));c=new EI([e,d]);return _.N(c.write())},II=function(a,b){var c,d,e,f,g,h;(new _.Pk).L("moof",_.Qk).W("mfhd",function(m){var n=new dI;n.g=_.T(m.reader);c=n}).L("traf",_.Qk).W("tfhd",function(m){var n=m.reader.Ca();if(null===m.flags)throw new _.L(_.M,3,3019,mH);var p=
17
- new fI(m.version||0,m.flags||0);p.g=_.T(m.reader);0<n-m.reader.getPosition()&&m.flags&1&&(p.j=_.Nk(m.reader));0<n-m.reader.getPosition()&&m.flags&2&&(p.B=_.T(m.reader));0<n-m.reader.getPosition()&&m.flags&8&&(p.m=_.T(m.reader));0<n-m.reader.getPosition()&&m.flags&16&&(p.w=_.T(m.reader));0<n-m.reader.getPosition()&&m.flags&32&&(p.o=_.T(m.reader));d=p}).W("trun",function(m){var n=m.reader.Ca();if(null===m.flags)throw new _.L(_.M,3,3019,mH);var p=new eI(m.version||0,m.flags||0);p.g=_.T(m.reader);0<n-
18
- m.reader.getPosition()&&m.flags&1&&(p.m=_.Lk(m.reader));0<n-m.reader.getPosition()&&m.flags&4&&(p.o=_.T(m.reader));if(0<n-m.reader.getPosition())for(n=0;n<p.g;n++)m.flags&256&&p.w.push(_.T(m.reader)),m.flags&512&&p.sampleSize.push(_.T(m.reader)),m.flags&1024&&p.B.push(_.T(m.reader)),m.flags&2048&&(0===m.version?p.j.push(_.T(m.reader)):p.j.push(_.Lk(m.reader)));e=p}).W("sdtp",function(m){var n=_.Ok(m.reader,m.reader.Ca());f=new xH("sdtp",m.version||0,m.flags||0,n,0)}).L("uuid",function(m){var n=_.Ok(m.reader,
19
- 16);if(_.Qh(n,HI)){n=_.T(m.reader);m.version=n>>>24;m.flags=n&16777215;n=new oI(m.version,m.flags);n.j=_.T(m.reader);m.flags&1&&(n.m=_.Jk(m.reader));for(var p=0;p<n.j;p++){var q={ig:_.Ok(m.reader,8),Sc:0,rf:[]};if(m.flags&2){q.Sc=_.Kk(m.reader);for(var r=0;r<q.Sc;r++){var v={Ff:0,Gf:0};v.Ff=_.Kk(m.reader);v.Gf=_.T(m.reader);q.rf.push(v)}}n.g.push(q)}g=n}}).L(_.zd,function(m){var n=new iI;0<m.reader.Ca()?n.g=_.Ok(m.reader,m.reader.Ca()):(_.G(nH,"mdat box is empty!"),n.g=new Uint8Array(0));h=n}).parse(a,
20
- !1);if(!h)return null;var l=(new gI).append([d,e]);f&&l.append([f]);b.Vd()&&g&&l.append([g]);l=(new hI).append([c,l]);return new EI([l,h])},JI=function(a,b,c,d){var e=d.Vd(),f=parseInt(c*b,10);b=a.data||new ArrayBuffer(0);var g=II(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=_.zh(e);if((e=(new DOMParser).parseFromString(e,_.Ee))&&"tt"===e.documentElement.tagName.toLowerCase())var h=e.documentElement;if(h&&(d=new CI(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),v=0;if(p.hasAttribute(q))p=p.getAttribute(q);else{q=p.attributes;for(var y=q.length;v<y;v++){var A=q[v].name;if(A=A.match(r)){p=p.getAttribute(A[0]);break b}}p=null}}f.setAttribute(l[m],BI(p||
22
- "",g,d))}}e=(new XMLSerializer).serializeToString(e);c=_.Ah(e).buffer}else c=e;return c}h=new hI;a=g.get("mfhd");b=new gI;l=g.get("tfhd");m=new cI(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.j;m++)l.push(10+6*c.g[m].Sc);else g=8;b.append([c,new mI,new nI(g,l,c.j)])}h.append([a,b]);f.flags|=1;f.m=h.a()+8;d=new EI([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},KI=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[b],keyIds:c,periodId:null}},LI=function(a,b,c){a=_.Pl(a);c&&a.version!==c&&(a=_.Gv(a,c));return{initData:_.Ev(a),initDataType:_.Dc,keyId:b,periodId:null}},NI=function(){this.w=this.g=this.f=this.C=null;this.M=1;this.T=0;this.m="";this.B=this.a=null;this.h=new _.H("clpp.smooth.SmoothParser");
24
- this.J=!1;this.j=this.A=null;this.P=MI;this.H=0;this.D=this.I=Infinity;this.o=[];this.K=this.Qk.bind(this);this.F=new Map},OI=function(a,b){var c,d,e;return _.B(function(f){if(1==f.a)return c=_.Zh(b),c.timeout=a.f.attemptParameters.timeout,c.maxAttempts=Math.max(a.f.attemptParameters.maxAttempts,b.length),c.baseDelay=a.f.attemptParameters.baseDelay,c.backoffFactor=a.f.attemptParameters.backoffFactor,c.fuzzFactor=a.f.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)})},VI=function(a,b){var c=null;try{var d=new DOMParser;try{var e=_.zh(b);var f=d.parseFromString(e.trim(),_.Ee)}catch(wC){throw wC;}if(f&&f.documentElement.tagName==_.ub)var g=f.documentElement;c=g&&0<g.getElementsByTagName("parsererror").length?null:g}catch(wC){}if(!c)throw a.h.error("Unable to parse manifest"),new _.L(_.M,4,4033,a.m);var h=+PI(a,c,"MajorVersion"),l=+PI(a,c,"MinorVersion"),m=+c.getAttribute("TimeScale")||1E7,n=+PI(a,c,"Duration"),p="TRUE"===
26
- c.getAttribute("IsLive"),q=+c.getAttribute("LookAheadCount"),r=+c.getAttribute("DVRWindowLength")||Infinity,v=_.Bl(c,"Protection")[0];if(!1===/^[2].[0-2]$/.test(""+h+"."+l))throw a.h.error("Smooth Streaming version must be 2.0, 2.1 or 2.2"),new _.L(_.M,4,4036,a.m);p?(QI(a,RI),a.A=typeof a.f.liveRefreshPeriod===_.k?1E3*a.f.liveRefreshPeriod:Math.min(1E3*a.H,1E4),n=Infinity):QI(a,MI);a.a={startTime:0,delay:0,duration:n/m,ye:r/m,md:0};if(v){var y=a.f.playreadyVersion,A=[],E=_.Bl(v,"ProtectionHeader")[0],
27
- F=_.Nh(_.Dl(E)||""),D=_.Pl(F).a;A.push(KI(_.Uc,{initData:_.Ev(_.Il(D)),initDataType:_.Dc,keyId:D,periodId:null},[D]));A.push(KI(_.Tc,LI(F,D,y),[D]));a.o=A}var J=[],ja=_.Bl(c,"StreamIndex");if(!ja.length)throw a.h.error("No streams found!"),new _.L(_.M,4,4034,a.m);for(var P=0;P<ja.length;P++){for(var Na,pa=a,ta=ja[P],Fa=PI(pa,ta,"Type"),Ka=+ta.getAttribute("Chunks"),wa=ta.getAttribute("Subtype"),Aa=_.gh(ta.getAttribute("Language")||_.Ie),Ba=ta.getAttribute("Name")||"",gb=+ta.getAttribute(_.Wa),Ab=
28
- +ta.getAttribute(_.Va),qb=PI(pa,ta,"Url"),ff=+ta.getAttribute("TimeScale")||null,Ri=[],Si=_.Bl(ta,_.ib),Ti=0;Ti<Si.length;Ti++){var Eb=pa,mc=Si[Ti],hs=Fa,CM=+mc.getAttribute("Index"),DM=+PI(Eb,mc,"Bitrate"),zC=NaN,AC=NaN,Bm=NaN,is=NaN,BC=NaN,CC=NaN,DC=NaN,EC=mc.getAttribute("FourCC");switch(hs){case _.Re:zC=+PI(Eb,mc,_.Va);AC=+PI(Eb,mc,_.Wa);break;case _.lc:is=+mc.getAttribute("Channels")||2,Bm=+PI(Eb,mc,"SamplingRate"),CC=+PI(Eb,mc,"AudioTag"),BC=+PI(Eb,mc,"BitsPerSample"),DC=+PI(Eb,mc,"PacketSize")}var js=
29
- String(mc.getAttribute("CodecPrivateData"));if(hs===_.lc&&!js){var FC=is,GC={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=GC[Bm];if("AACH"===EC){var oc=new Uint8Array(4);var HC=GC[2*Bm];oc[0]=40|Cm>>1;oc[1]=Cm<<7|FC<<3|HC>>1;oc[2]=HC<<7|8;oc[3]=0;var ag=new Uint16Array(2);ag[0]=(oc[0]<<8)+oc[1];ag[1]=(oc[2]<<8)+oc[3];var IC=ag[0].toString(16)+ag[1].toString(16)}else oc=new Uint8Array(2),oc[0]=16|Cm>>1,oc[1]=Cm<<7|FC<<3,ag=new Uint16Array(1),
30
- ag[0]=(oc[0]<<8)+oc[1],IC=ag[0].toString(16);js=IC.toUpperCase()}var EM={id:Eb.T++,type:hs,index:CM,bitrate:DM,Hd:js,maxHeight:zC,maxWidth:AC,sd:Bm,Hf:is,zl:CC,qh:BC,Ml:DC,Wi:EC,segmentIndex:null};Ri.push(EM)}Na=Ri;for(var re=[],JC=_.Bl(ta,"c"),kj=0;kj<JC.length;kj++){var ks=JC[kj],Fd=parseInt(ks.getAttribute("t"),10),lh=parseInt(ks.getAttribute("d"),10),ls=parseInt(ks.getAttribute("r"),10),lj=0;if(isNaN(Fd)&&isNaN(lh))throw pa.h.error("Either one or both FragmentDuration and FragmentTime field MUST be present in StreamFragmentElement"),
31
- new _.L(_.M,4,4037,pa.m);0===kj&&isNaN(Fd)&&(lj=Fd=0);if(0<kj){var bg=re[re.length-1];lj=bg.n+1;bg.d||(bg.d=Fd-bg.t);Fd||(Fd=bg.t+bg.d);lh||(lh=Fd-bg.t)}re.push({n:lj,d:lh,t:Fd});if(ls){ls--;for(var KC=0;KC<ls;KC++){var Dm=re[re.length-1];lj=Dm.n+1;Fd=Dm.t+Dm.d;lh=Dm.d;re.push({n:lj,d:lh,t:Fd})}}}pa.cd()||re.length===Ka||pa.h.warn("Number of fragments ("+Ka+") differs from number of chunks ("+re.length+").");J.push({type:Fa,Cl:Ka,Yk:wa,language:Aa,name:Ba,maxWidth:gb,maxHeight:Ab,gl:qb,tracks:Na,
32
- ag:re,timescale:ff})}var jf={Kl:h,rg:l,timescale:m,duration:n,isLive:p,Jl:q,ye:r,Ke:!1,streams:J};if(a.g&&a.w)return SI(a,jf),Promise.resolve();a.F.clear();var ms=jf.timescale,ns=jf.duration,GM=tI(jf.streams,_.lc),HM=tI(jf.streams,_.Re),IM=tI(jf.streams,_.Ce),LC=[],Em=TI(a,ns,ms,GM),Fm=TI(a,ns,ms,HM),JM=TI(a,ns,ms,IM);Em.length||(Em=[null]);Fm.length||(Fm=[null]);for(var ps=0;ps<Fm.length;ps++)for(var qs=0;qs<Em.length;qs++)LC.push(UI(a,Fm[ps],Em[qs]));var MC={startTime:0,variants:LC,textStreams:JM,
33
- thumbStreams:[]};var LM=jf.streams,rs=a.a.startTime,NC=a.a.delay,ss=a.I,OC=Math.min(a.a.duration||Infinity,ss),ts=a.cd(),MM=a.a.ye,NM=a.a.md,PC=a.H,QC=isFinite(a.D)?a.D:0;if(ts)OC=Infinity,rs=Date.now()/1E3-NM,a.a.startTime=rs,NC=3*PC;else for(var OM=isFinite(ss)?ss:a.a.duration,RC=_.u(LM),us=RC.next();!us.done;us=RC.next())for(var SC=_.u(us.value.tracks),vs=SC.next();!vs.done;vs=SC.next()){var TC=vs.value;TC.segmentIndex.offset(-QC);_.Dw(TC.segmentIndex,OM)}a.B=new _.lw(rs,NC,!ts,!0);a.B.f=OC;_.qw(a.B,
34
- PC);a.B.m=MM;ts||a.B.offset(-QC);a.C.filterAllPeriods([MC]);a.g={presentationTimeline:a.B,periods:[MC],offlineSessionIds:[],minBufferTime:0};Promise.resolve();a.J||(a.C.networkingEngine.ne(a.K),a.J=!0);a.w=jf;return Promise.resolve()},SI=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={Jb:e.Jb},g=f.next())if(e.Jb=g.value,g=d.tracks.find(function(l){return function(m){return m.type===l.Jb.type&&m.bitrate===l.Jb.bitrate}}(e))){rI(e.Jb,
35
- g)||a.h.warn("The current stream is updated with a stream that seems to have different base properties!");var h=WI(a,a.w.timescale,d,g);g=e.Jb.segmentIndex;g.ya(h);(h=a.a.ye)&&_.Bw(g,_.Aw(g)-h).forEach(function(l){l.Ka().forEach(function(m){a.F["delete"](m)})})}else a.h.warn("Cannot find satisfying update for "+e.Jb.type+" track with bitrate "+(e.Jb.bitrate+". Skipping update."))},TI=function(a,b,c,d){for(var e=[],f={tc:0};f.tc<d.length;f={tc:f.tc},f.tc++){var g=d[f.tc].tracks.map(function(h){return function(l){var m=
36
- d[h.tc],n=WI(a,c,m,l),p=new _.zw(n),q=null;m.type!==_.Ce&&(q=XI(a,b,c,m,l));l.segmentIndex=p;n=a.M++;var r=Promise.resolve.bind(Promise),v=p.Dc.bind(p),y=p.get.bind(p),A=p.Vc.bind(p);p=p.getDuration.bind(p);var E=YI[m.type],F="";switch(m.type){case _.Re:F=l.Hd;var D=/00000001[0-9]7/.exec(F);F="avc1."+(D&&D[0]?F.substr(F.indexOf(D[0])+10,6):"42c00c");a.h.debug("VIDEO CODECS: ",F);break;case _.lc:F=l.Hd,D=2,"AACH"===l.Wi?D=5:F&&(D=(parseInt(F.substr(0,2),16)&248)>>3),F="mp4a.40."+D,a.h.debug("AUDIO CODECS: ",
37
- F)}D=m.type===_.Ce?ZI[m.Yk]:void 0;return{id:n,originalId:null,Ol:null,createSegmentIndex:r,findSegmentPosition:v,getSegmentReference:y,adjustSegmentDurations:A,getDuration:p,segmentIndex:null,segmentLookupStrategy:_.qv,initSegmentReference:q,mimeType:E,codecs:F,frameRate:void 0,bandwidth:l.bitrate,width:l.maxWidth||void 0,height:l.maxHeight||void 0,kind:D,encrypted:a.Ne(),keyId:null,language:m.language,label:m.name,type:m.type,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:l.Hf||
38
- null,closedCaptions:null}}}(f));e=e.concat(g)}return e},WI=function(a,b,c,d){var e=0,f=[],g=c.timescale||b;c.ag.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=qI(a.m,c,l,d);a.H=Math.max(a.H,m);f.push(new _.Qv(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===_.lc)b=f[f.length-1],a.I=Math.min(a.I,e),0===a.a.md?a.a.md=b.endTime:a.a.md=Math.min(a.a.md,b.endTime);return f},XI=function(a,b,c,d,
39
- e){b=sI(b,d.timescale||c,e);c={isLive:a.cd.bind(a),Vd:a.Ne.bind(a),bj:function(){return 1},Pd:a.cg.bind(a)};d=new Uint8Array(0);try{d=GI(b,c)}catch(g){throw a.h.error("Failed to generate initialization segment."),new _.L(_.M,3,4035,g);}var f="data:text/plain;base64,"+_.Mh(d);return new _.Pv(function(){return[f]},0,null,null,!0)},UI=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,
40
- allowedByKeySystem:!0}:null},PI=function(a,b,c){if(b=b.getAttribute(c))return b;a.h.error("required attribute not provided: "+c);throw new _.L(_.M,4,4038,a.m,c);},$I=function(a,b){null!=a.A&&null!=b&&(a.j=window.setTimeout(a.Db.bind(a),b))},QI=function(a,b){var c=b===MI;a.g&&a.g.presentationTimeline&&_.mw(a.g.presentationTimeline,c);c&&null!=a.j&&(window.clearTimeout(a.j),a.j=null,a.A=null);a.P=b},aJ=function(){};
41
- 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};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?_.S(a,1):_.S(a,this.size);_.Fk(a,vH(this.type));this.size>b&&pH(a,this.size);"uuid"===this.type&&_.Fk(a,null);if(0<this.f.length&&!this.A)for(b=0;b<this.f.length;b++)this.f[b].write(a),this.f[b].a(),a.getPosition()};_.w(Y,X);Y.prototype.a=function(){return 4+X.prototype.a.call(this)};Y.prototype.write=function(a){X.prototype.write.call(this,a);qH(a,this.version);rH(a,this.flags)};
43
- _.w(wH,X);wH.prototype.a=function(){return this.g.byteLength+X.prototype.a.call(this)-this.offset};wH.prototype.write=function(a){X.prototype.write.call(this,a);_.Fk(a,this.g,this.offset);a.getPosition()};_.w(xH,Y);xH.prototype.a=function(){return this.g.byteLength+Y.prototype.a.call(this)-this.offset};xH.prototype.write=function(a){Y.prototype.write.call(this,a);_.Fk(a,this.g,this.offset);a.getPosition()};_.w(yH,X);
44
- yH.prototype.a=function(){var a=this.j.length;a=a+4+this.g.join("").length;return a+X.prototype.a.call(this)};yH.prototype.write=function(a){X.prototype.write.call(this,a);_.Fk(a,vH(this.j));_.S(a,this.rg);_.Fk(a,vH(this.g.join("")));a.getPosition()};_.w(zH,X);_.w(AH,X);_.w(BH,Y);BH.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
- BH.prototype.write=function(a){Y.prototype.write.call(this,a);1===this.version?(pH(a,0),pH(a,0),_.S(a,this.timescale),pH(a,this.duration*this.timescale)):(_.S(a,0),_.S(a,0),_.S(a,this.timescale),_.S(a,this.duration*this.timescale));_.S(a,65536);sH(a,this.volume);sH(a,0);_.S(a,0);_.S(a,0);for(var b=0;b<this.g.length;b++)qH(a,this.g[b]);_.S(a,0);_.S(a,0);_.S(a,0);_.S(a,0);_.S(a,0);_.S(a,0);_.S(a,this.j);a.getPosition()};_.w(CH,X);_.w(DH,Y);DH.prototype.a=function(){return 20+Y.prototype.a.call(this)};
46
- DH.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.g);_.S(a,1);_.S(a,0);_.S(a,0);_.S(a,0);a.getPosition()};_.w(EH,Y);EH.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
- EH.prototype.write=function(a){Y.prototype.write.call(this,a);1===this.version?(pH(a,0),pH(a,0),_.S(a,this.j),_.S(a,0),pH(a,this.duration*this.timescale)):(_.S(a,0),_.S(a,0),_.S(a,this.j),_.S(a,0),_.S(a,this.duration*this.timescale));_.S(a,0);_.S(a,0);sH(a,0);sH(a,0);sH(a,this.volume);sH(a,0);for(var b=0;b<this.g.length;b++)qH(a,this.g[b]);sH(a,this.width);sH(a,0);sH(a,this.height);sH(a,0);a.getPosition()};_.w(FH,Y);FH.prototype.a=function(){var a=0;a=1===this.version?a+28:a+16;return a+4+Y.prototype.a.call(this)};
48
- FH.prototype.write=function(a){Y.prototype.write.call(this,a);1===this.version?(pH(a,0),pH(a,0),_.S(a,this.timescale),pH(a,this.duration*this.timescale)):(_.S(a,0),_.S(a,0),_.S(a,this.timescale),_.S(a,this.duration*this.timescale));sH(a,this.language);sH(a,0);a.getPosition()};_.w(GH,Y);GH.prototype.a=function(){return 33+Y.prototype.a.call(this)};
49
- GH.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,0);this.g===_.Re?_.Fk(a,vH("vide")):_.Fk(a,vH("soun"));_.S(a,0);_.S(a,0);_.S(a,0);this.g===_.Re?_.Fk(a,vH("VideoHandler\x00")):_.Fk(a,vH("SoundHandler\x00"));a.getPosition()};_.w(HH,Y);HH.prototype.a=function(){return 2+this.g.byteLength+Y.prototype.a.call(this)};HH.prototype.write=function(a){Y.prototype.write.call(this,a);sH(a,0);_.Fk(a,this.g);a.getPosition()};_.w(IH,X);IH.prototype.a=function(){return 8+X.prototype.a.call(this)};
50
- IH.prototype.write=function(a){X.prototype.write.call(this,a);_.S(a,0);sH(a,0);sH(a,1)};_.w(JH,IH);JH.prototype.a=function(){return 70+IH.prototype.a.call(this)};JH.prototype.write=function(a){IH.prototype.write.call(this,a);sH(a,0);sH(a,0);_.S(a,0);_.S(a,0);_.S(a,0);sH(a,this.width);sH(a,this.height);_.S(a,4718592);_.S(a,4718592);_.S(a,0);sH(a,1);qH(a,10);_.Fk(a,vH("AVC Coding",31));sH(a,this.depth);uH(a,-1)};_.w(KH,IH);KH.prototype.a=function(){return 20+IH.prototype.a.call(this)};
51
- KH.prototype.write=function(a){IH.prototype.write.call(this,a);_.S(a,0);_.S(a,0);sH(a,this.channelCount);sH(a,this.sampleSize);uH(a,0);sH(a,0);sH(a,this.sampleRate);sH(a,0)};_.w(LH,JH);LH.prototype.write=function(a){JH.prototype.write.call(this,a);for(var b=0;b<this.f.length;b++)this.f[b].write(a);a.getPosition()};_.w(MH,LH);_.w(NH,KH);NH.prototype.write=function(a){KH.prototype.write.call(this,a);for(var b=0;b<this.f.length;b++)this.f[b].write(a);a.getPosition()};_.w(OH,NH);_.w(PH,X);
52
- PH.prototype.a=function(){for(var a=7,b=0;b<this.Pa.length;b++)a+=2,a+=this.Pa[b].byteLength;for(b=0;b<this.Pa.length;b++)a+=2,a+=this.Tb[b].byteLength;return a+X.prototype.a.call(this)};
53
- PH.prototype.write=function(a){X.prototype.write.call(this,a);qH(a,this.version);qH(a,this.g);qH(a,this.j);qH(a,this.level);qH(a,255);qH(a,224|this.Pa.length);for(var b=0;b<this.Pa.length;b++)sH(a,this.Pa[b].length),_.Fk(a,this.Pa[b]);qH(a,this.Tb.length);for(b=0;b<this.Tb.length;b++)sH(a,this.Tb[b].length),_.Fk(a,this.Tb[b]);a.getPosition()};_.w(QH,Y);QH.prototype.a=function(){return 22+(this.Kb.byteLength+3)+Y.prototype.a.call(this)};
54
- QH.prototype.write=function(a){Y.prototype.write.call(this,a);qH(a,3);qH(a,23+this.Kb.byteLength);sH(a,1);qH(a,0);qH(a,4);qH(a,15+this.Kb.byteLength);qH(a,64);qH(a,21);rH(a,0);_.S(a,0);_.S(a,0);qH(a,5);qH(a,this.Kb.byteLength);_.Fk(a,this.Kb);_.Fk(a,new Uint8Array([6,1,2]));a.getPosition()};_.w(RH,Y);RH.prototype.a=function(){return this.location.length+Y.prototype.a.call(this)};RH.prototype.write=function(a){Y.prototype.write.call(this,a);0<this.location.length&&_.Fk(a,vH(this.location));a.getPosition()};
55
- _.w(SH,Y);SH.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)};SH.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(TH,X);_.w(UH,Y);UH.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
- UH.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(VH,Y);VH.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)};VH.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(WH,Y);
57
- WH.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)};WH.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(XH,Y);XH.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
- XH.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(YH,Y);YH.prototype.a=function(){return 8+Y.prototype.a.call(this)};YH.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,0);_.S(a,0);a.getPosition()};_.w(ZH,Y);ZH.prototype.a=function(){return 4+Y.prototype.a.call(this)};ZH.prototype.write=function(a){Y.prototype.write.call(this,a);uH(a,0);sH(a,0);a.getPosition()};
59
- _.w($H,X);_.w(aI,X);_.w(bI,X);_.w(cI,Y);cI.prototype.a=function(){var a=0;a=1===this.version?a+8:a+4;return a+Y.prototype.a.call(this)};cI.prototype.write=function(a){Y.prototype.write.call(this,a);1===this.version?pH(a,this.g):_.S(a,this.g);a.getPosition()};_.w(dI,Y);dI.prototype.a=function(){return 4+Y.prototype.a.call(this)};dI.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.g);a.getPosition()};_.w(eI,Y);
60
- eI.prototype.a=function(){var a=4;this.flags&bJ&&(a+=4);this.flags&cJ&&(a+=4);for(var b=0;b<this.g;b++)this.flags&dJ&&(a+=4),this.flags&eJ&&(a+=4),this.flags&fJ&&(a+=4),this.flags&gJ&&(a+=4);return a+Y.prototype.a.call(this)};
61
- eI.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.g);this.flags&bJ&&(a.getPosition(),tH(a,this.m));this.flags&cJ&&_.S(a,this.o);for(var b=0;b<this.g;b++)this.flags&dJ&&_.S(a,this.w[b]),this.flags&eJ&&_.S(a,this.sampleSize[b]),this.flags&fJ&&_.S(a,this.B[b]),this.flags&gJ&&(0===this.version?_.S(a,this.j[b]):tH(a,this.j[b]));a.getPosition()};var bJ=1,cJ=4,dJ=256,eJ=512,fJ=1024,gJ=2048;_.w(fI,Y);
62
- fI.prototype.a=function(){var a=4;this.flags&hJ&&(a+=8);this.flags&iJ&&(a+=4);this.flags&jJ&&(a+=4);this.flags&kJ&&(a+=4);this.flags&lJ&&(a+=4);return a+Y.prototype.a.call(this)};fI.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.g);this.flags&hJ&&pH(a,this.j);this.flags&iJ&&_.S(a,this.B);this.flags&jJ&&_.S(a,this.m);this.flags&kJ&&_.S(a,this.w);this.flags&lJ&&_.S(a,this.o);a.getPosition()};var hJ=1,iJ=2,jJ=8,kJ=16,lJ=32;_.w(gI,X);_.w(hI,X);_.w(iI,X);
63
- iI.prototype.a=function(){return this.g.byteLength+X.prototype.a.call(this)};iI.prototype.write=function(a){X.prototype.write.call(this,a);0<this.g.byteLength&&_.Fk(a,this.g)};_.w(jI,Y);jI.prototype.a=function(){var a=20;1===this.g&&0===this.j&&(a=a+1+this.m.length);return a+Y.prototype.a.call(this)};
64
- jI.prototype.write=function(a){Y.prototype.write.call(this,a);qH(a,0);0===this.version?qH(a,0):qH(a,0);qH(a,this.g);qH(a,this.j);_.Fk(a,_.Oh(this.o));if(1===this.g&&0===this.j){qH(a,0);for(var b=0;b<this.m.length;b++)qH(a,this.m[b])}a.getPosition()};_.w(kI,Y);kI.prototype.a=function(){var a=8;this.flags&1&&(a+=vH(this.Fb).byteLength);return a+Y.prototype.a.call(this)};kI.prototype.write=function(a){Y.prototype.write.call(this,a);_.Fk(a,vH(this.g));_.S(a,this.j);this.flags&1&&_.Fk(a,vH(this.Fb));a.getPosition()};
65
- _.w(lI,X);lI.prototype.a=function(){return vH(this.g).byteLength+X.prototype.a.call(this)};lI.prototype.write=function(a){X.prototype.write.call(this,a);_.Fk(a,vH(this.g));a.getPosition()};_.w(mI,Y);mI.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
- mI.prototype.write=function(a){Y.prototype.write.call(this,a);this.flags&1&&(_.S(a,0),_.S(a,0));_.S(a,1);for(var b=0;1>b;b++)0===this.version?_.S(a,this.offset[b]):pH(a,this.offset[b]);a.getPosition()};_.w(nI,Y);nI.prototype.a=function(){var a=0;this.flags&1&&(a+=8);a+=5;0===this.g&&(a+=this.m.length);return a+Y.prototype.a.call(this)};
67
- nI.prototype.write=function(a){Y.prototype.write.call(this,a);this.flags&1&&(_.S(a,0),_.S(a,0));qH(a,this.g);_.S(a,this.j);if(0===this.g)for(var b=0;b<this.j;b++)qH(a,this.m[b]);a.getPosition()};_.w(oI,Y);oI.prototype.a=function(){var a=4;this.flags&1&&(a+=1);for(var b=0;b<this.j;b++)if(a+=this.g[b].ig.byteLength,this.flags&2){a+=2;for(var c=0;c<this.g[b].Sc;c++)a+=2,a+=4}return a+Y.prototype.a.call(this)};
68
- oI.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.j);this.flags&1&&qH(a,this.m);for(var b=0;b<this.j;b++)if(_.Fk(a,this.g[b].ig),this.flags&2){sH(a,this.g[b].Sc);for(var c=0;c<this.g[b].Sc;c++)sH(a,this.g[b].rf[c].Ff),_.S(a,this.g[b].rf[c].Gf)}a.getPosition()};var vI=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,wI=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,xI=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,yI=/^(\d*\.?\d*)f$/,zI=/^(\d*\.?\d*)t$/,AI=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/;EI.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};EI.prototype.write=function(){this.f=DI(this);for(var a=0;a<this.a.length;a++)this.a[a].write(this.f);return this.f.buffer};var HI=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);_.t=NI.prototype;_.t.configure=function(a){this.f=a};_.t.start=function(a,b){var c=this;this.C=b;var d=_.nf(new Set([a,pI(a)])).concat();return OI(this,d).then(function(e){return VI(c,e.data).then(function(){$I(c,c.A);return c.g})})};_.t.stop=function(){this.C&&this.C.networkingEngine.hf(this.K);this.A=this.w=this.g=this.f=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.cd())return OI(this,[this.m]).then(function(b){return VI(a,b.data).then(function(){return a.g})})["catch"](function(b){if(a.C)a.C.onError(b)})};_.t.onExpirationUpdated=function(){};_.t.setCurrentVariant=function(){};_.t.Db=function(){var a=this;this.h.debug(_.iv);this.C&&(this.j=null,this.update().then(function(){$I(a,a.A)})["catch"](function(b){a.C&&(a.C.onError(b),1===b.severity&&$I(a,100))}))};_.t.cd=function(){return this.P===RI};
70
- _.t.Ne=function(){return 0<this.o.length};_.t.cg=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.Qk=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.cd.bind(this),Vd:this.Ne.bind(this),bj:function(){return 1},Pd:this.cg.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.h.debug("Using base media decode time "+g+" instead of segment reference time "+a.request.startTime);f=JI(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 YI={video:_.Te,audio:_.rc,text:_.ic},MI=_.jv,RI="LIVE",ZI={il:"caption",rl:_.ye};_.w(aJ,_.Ko);aJ.prototype.Ma=function(){_.Hp.ism=NI;_.Fp[_.jc]=NI};aJ.prototype.Fa=function(){_.Iw("ism");_.Jw(_.jc)};aJ.prototype.id=function(){return"smooth"};_.C("clpp.smooth.SmoothComponent",aJ);};
2
+ var f=function(window){var MH="Full MP4 box must have flags defined",NH="clpp.smooth.SmoothMP4Processor",OH="codecPrivateData",PH=function(a,b){var c=Math.floor(b/Math.pow(2,32)),d=b-c*Math.pow(2,32);_.S(a,c);_.S(a,d)},QH=function(a,b){try{a.f.setUint8(a.a,b),a.a+=1}catch(c){_.zk()}},RH=function(a,b){QH(a,b>>16&255);QH(a,b>>8&255);QH(a,b&255)},SH=function(a,b){try{a.f.setUint16(a.a,b,a.g),a.a+=2}catch(c){_.zk()}},TH=function(a,b){try{a.f.setInt32(a.a,b,a.g),a.a+=4}catch(c){_.zk()}},UH=function(a,b){try{a.f.setInt16(a.a,
3
+ b,a.g),a.a+=2}catch(c){_.zk()}},VH=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.A=!1;this.entries=[];this.f=[]},Y=function(a,b,c){X.call(this,a);this.version=b;this.flags=c},WH=function(a,b,c){X.call(this,a);this.g=b;this.offset=c},XH=function(a,b,c,d,e){Y.call(this,
4
+ a,b,c);this.g=d;this.offset=e},YH=function(a,b,c){X.call(this,"ftyp");this.j=a;this.wg=b;this.g=c},ZH=function(){X.call(this,_.Dd)},$H=function(){X.call(this,_.Ee)},aI=function(a,b,c){Y.call(this,"mvhd",1,0);this.timescale=a;this.duration=b;this.volume=256;this.j=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]},bI=function(){X.call(this,"mvex")},cI=function(a){Y.call(this,"trex",0,0);this.g=a},dI=function(a,b,c,d,e){Y.call(this,"tkhd",1,7);this.j=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]},eI=function(a,b){Y.call(this,"mdhd",1,0);this.timescale=a;this.duration=b;this.language=21956},fI=function(a){Y.call(this,"hdlr",0,0);this.g=a},gI=function(){Y.call(this,"vmhd",0,1);this.g=new Uint8Array([0,0,0,0,0,0])},hI=function(a){X.call(this,a);this.A=!0},iI=function(a){hI.call(this,a);this.height=this.width=0;this.depth=24},jI=function(a,b,c,d){hI.call(this,
6
+ a);this.channelCount=b;this.sampleSize=c;this.sampleRate=d},kI=function(a,b){iI.call(this,"avc1");this.width=a;this.height=b},lI=function(a,b){kI.call(this,a,b);this.type="encv"},mI=function(a,b,c){jI.call(this,"mp4a",a,b,c)},nI=function(a,b,c){mI.call(this,a,b,c);this.type="enca"},oI=function(a,b){X.call(this,"avcC");this.Qa=a;this.Ub=b;this.version=1;this.g=this.Qa[0][1];this.j=this.Qa[0][2];this.level=this.Qa[0][3]},pI=function(a){Y.call(this,"esds",0,0);this.Lb=a},qI=function(a){a=void 0===a?
7
+ "":a;Y.call(this,"url ",0,1);this.location=a},rI=function(){Y.call(this,"dref",0,0)},sI=function(){X.call(this,_.re)},tI=function(){Y.call(this,_.ue,0,0)},uI=function(){Y.call(this,"stts",0,0)},vI=function(){Y.call(this,"stsc",0,0)},wI=function(){Y.call(this,"stco",0,0)},xI=function(){Y.call(this,"stsz",0,0)},yI=function(){Y.call(this,"smhd",0,0)},zI=function(){X.call(this,"dinf")},AI=function(){X.call(this,_.Cd)},BI=function(){X.call(this,_.yd)},CI=function(a,b){Y.call(this,"tfdt",a,0);this.g=b},
8
+ DI=function(){Y.call(this,"mfhd",0,0);this.g=0},EI=function(a,b){Y.call(this,"trun",a,b);this.o=this.m=this.g=0;this.w=[];this.sampleSize=[];this.B=[];this.j=[]},FI=function(a,b){Y.call(this,"tfhd",a,b);this.g=255;this.o=this.w=this.m=this.B=this.j=0},GI=function(){X.call(this,"traf")},HI=function(){X.call(this,"moof")},II=function(){X.call(this,_.xd);this.g=new Uint8Array(0)},JI=function(){Y.call(this,"tenc",0,0);this.g=1;this.j=8;this.o="";this.m=[]},KI=function(a,b){Y.call(this,"schm",0,0);this.g=
9
+ a;this.j=b;this.Gb=""},LI=function(a){X.call(this,"frma");this.g=a},MI=function(){Y.call(this,"saio",0,0);this.offset=[0]},NI=function(a,b,c){Y.call(this,"saiz",0,0);this.g=a;this.m=b;this.j=c},OI=function(a,b){Y.call(this,"senc",a,b);this.j=0;this.m=8;this.g=[]},PI=function(a){var b=a.split("/");return b[b.length-1].toLowerCase().match("manifest(\\(.+\\))?")?a:a+"/Manifest"},QI=function(a,b,c,d){c=b.gg[c];b=b.ul;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 _.Hv([a],[b])[0]},RI=function(a,b){if(a.type!==b.type)return!1;var c=[];a.type===_.Pe?c=["maxWidth","maxHeight","bitrate",OH,"fourCC"]:a.type===_.jc&&(c=["bitrate",OH,"channels","bitsPerSample","samplingRate","fourCC"]);return _.K.Aa(a,b,c,["id","segmentIndex"])},SI=function(a,b,c){var d=c.Ld.split("00000001");a={id:1,type:c.type,duration:a/b,timescale:b,Qa:null,Ub:null,width:NaN,height:NaN,Lb:null,ud:NaN,
11
+ sampleSize:NaN,channelCount:NaN};switch(c.type){case _.Pe:a.Qa=[_.Mh(d[1])];a.Ub=[_.Mh(d[2])];a.width=c.maxWidth;a.height=c.maxHeight;break;case _.jc:a.Lb=_.Mh(c.Ld),a.sampleSize=c.wh||16,a.ud=c.ud,a.channelCount=c.Lf}return a},TI=function(a,b){return a.filter(function(c){return c.type===b})},UI=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)},aJ=function(a,b,c){var d=null;if(VI.test(a)){a=VI.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 WI.test(a)?d=UI(WI,a):XI.test(a)?d=UI(XI,a):YI.test(a)?(a=YI.exec(a),d=Number(a[1])/c.frameRate):ZI.test(a)?(a=ZI.exec(a),d=Number(a[1])/c.a):$I.test(a)&&(d=UI($I,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},bJ=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))},dJ=function(a){this.a=a;this.f=cJ(this)},cJ=function(a){for(var b=0,c=0;c<a.a.length;c++)b+=a.a[c].a();return new _.yk(b)},eJ=function(a,b,c){a:{var d=_.u([_.Rc,_.Qc]);for(var e=d.next();!e.done;e=d.next())if((e=c.Rd(e.value))&&e.keyId){d=e.keyId;break a}_.G(NH,"Could not get default Key ID for DRM init data!");
14
+ d=null}c=new X("xxxx");a.type===_.Pe?c=new lI(a.width,a.height):c=new nI(a.channelCount,a.sampleSize,a.ud);a=new JI;a.g=1;a.j=8;a.o=d||"00000000000000000000000000000000";a=(new X("schi")).append([a]);b=(new X(_.me)).append([new LI(b),new KI(_.Ac,65536),a]);c.append([b]);return c},fJ=function(a,b){var c=b.Xd(),d=new aI(a.timescale,a.duration,a.id),e=(new bI).append([new cI(a.id)]),f=new dI(a.id,a.duration,a.timescale,a.width,a.height),g=new eI(a.timescale,a.duration),h=new fI(a.type),l=null,m=new rI;
15
+ m.entries=[new qI];var n=new tI;switch(a.type){case _.Pe:var p=new oI(a.Qa,a.Ub);c?(l=eJ(a,"avc1",b),l.append([p]),n.entries=[l]):(l=(new kI(a.width,a.height)).append([p]),n.entries=[l]);l=new gI;break;case _.jc:p=new pI(a.Lb),c?(l=eJ(a,"mp4a",b),l.append([p]),n.entries=[l]):(l=(new mI(a.channelCount,a.sampleSize,a.ud)).append([p]),n.entries=[l]),l=new yI}n=(new sI).append([n,new uI,new vI,new xI,new wI]);m=(new zI).append([m]);m=(new AI).append([l,m,n]);g=(new BI).append([g,h,m]);f=(new $H).append([f,
16
+ g]);d=(new ZH).append([d,f,e]);e=new YH("dash",0,["iso6","mp41","avc1"]);c&&(c=b.Rd(_.Qc),f=b.Rd(_.Rc),c&&d.append([new WH("pssh",c.initData,8)]),f&&d.append([new WH("pssh",f.initData,8)]),c||f||_.G(NH,"Could not get PSSH init data!"));c=new dJ([e,d]);return _.N(c.write())},hJ=function(a,b){var c,d,e,f,g,h;(new _.Kk).L("moof",_.Lk).Y("mfhd",function(m){var n=new DI;n.g=_.T(m.reader);c=n}).L("traf",_.Lk).Y("tfhd",function(m){var n=m.reader.Ea();if(null===m.flags)throw new _.L(_.M,3,3019,MH);var p=
17
+ new FI(m.version||0,m.flags||0);p.g=_.T(m.reader);0<n-m.reader.getPosition()&&m.flags&1&&(p.j=_.Ik(m.reader));0<n-m.reader.getPosition()&&m.flags&2&&(p.B=_.T(m.reader));0<n-m.reader.getPosition()&&m.flags&8&&(p.m=_.T(m.reader));0<n-m.reader.getPosition()&&m.flags&16&&(p.w=_.T(m.reader));0<n-m.reader.getPosition()&&m.flags&32&&(p.o=_.T(m.reader));d=p}).Y("trun",function(m){var n=m.reader.Ea();if(null===m.flags)throw new _.L(_.M,3,3019,MH);var p=new EI(m.version||0,m.flags||0);p.g=_.T(m.reader);0<n-
18
+ m.reader.getPosition()&&m.flags&1&&(p.m=_.Gk(m.reader));0<n-m.reader.getPosition()&&m.flags&4&&(p.o=_.T(m.reader));if(0<n-m.reader.getPosition())for(n=0;n<p.g;n++)m.flags&256&&p.w.push(_.T(m.reader)),m.flags&512&&p.sampleSize.push(_.T(m.reader)),m.flags&1024&&p.B.push(_.T(m.reader)),m.flags&2048&&(0===m.version?p.j.push(_.T(m.reader)):p.j.push(_.Gk(m.reader)));e=p}).Y("sdtp",function(m){var n=_.Jk(m.reader,m.reader.Ea());f=new XH("sdtp",m.version||0,m.flags||0,n,0)}).L("uuid",function(m){var n=_.Jk(m.reader,
19
+ 16);if(_.Oh(n,gJ)){n=_.T(m.reader);m.version=n>>>24;m.flags=n&16777215;n=new OI(m.version,m.flags);n.j=_.T(m.reader);m.flags&1&&(n.m=_.Ek(m.reader));for(var p=0;p<n.j;p++){var q={ng:_.Jk(m.reader,8),Uc:0,uf:[]};if(m.flags&2){q.Uc=_.Fk(m.reader);for(var r=0;r<q.Uc;r++){var v={Jf:0,Kf:0};v.Jf=_.Fk(m.reader);v.Kf=_.T(m.reader);q.uf.push(v)}}n.g.push(q)}g=n}}).L(_.xd,function(m){var n=new II;0<m.reader.Ea()?n.g=_.Jk(m.reader,m.reader.Ea()):(_.G(NH,"mdat box is empty!"),n.g=new Uint8Array(0));h=n}).parse(a,
20
+ !1);if(!h)return null;var l=(new GI).append([d,e]);f&&l.append([f]);b.Xd()&&g&&l.append([g]);l=(new HI).append([c,l]);return new dJ([l,h])},iJ=function(a,b,c,d){var e=d.Xd(),f=parseInt(c*b,10);b=a.data||new ArrayBuffer(0);var g=hJ(b,d);if(null===g)return a.request.contentType===_.Ae?a.data:g;d=g.get(_.xd);if(a.request.contentType===_.Ae){e=d.g.buffer;if(c){e=_.xh(e);if((e=(new DOMParser).parseFromString(e,_.Ce))&&"tt"===e.documentElement.tagName.toLowerCase())var h=e.documentElement;if(h&&(d=new bJ(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",_.ed],m=0,n=l.length;m<n;m++){b:{var p=f;var q=l[m],r=new RegExp("\\w+:"+q),v=0;if(p.hasAttribute(q))p=p.getAttribute(q);else{q=p.attributes;for(var z=q.length;v<z;v++){var A=q[v].name;if(A=A.match(r)){p=p.getAttribute(A[0]);break b}}p=null}}f.setAttribute(l[m],aJ(p||
22
+ "",g,d))}}e=(new XMLSerializer).serializeToString(e);c=_.yh(e).buffer}else c=e;return c}h=new HI;a=g.get("mfhd");b=new GI;l=g.get("tfhd");m=new CI(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.j;m++)l.push(10+6*c.g[m].Uc);else g=8;b.append([c,new MI,new NI(g,l,c.j)])}h.append([a,b]);f.flags|=1;f.m=h.a()+8;d=new dJ([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},jJ=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[b],keyIds:c,periodId:null}},kJ=function(a,b,c){a=_.lw(a);c&&a.version!==c&&(a=_.hw(a,c));return{initData:_.Av(a),initDataType:_.Ac,keyId:b,periodId:null}},mJ=function(){this.w=this.g=this.f=this.C=null;this.M=1;this.T=0;this.m="";this.B=this.a=null;this.h=new _.I("clpp.smooth.SmoothParser");
24
+ this.J=!1;this.j=this.A=null;this.N=lJ;this.H=0;this.D=this.I=Infinity;this.o=[];this.K=this.cl.bind(this);this.F=new Map},nJ=function(a,b){var c,d,e;return _.B(function(f){if(1==f.a)return c=_.Xh(b),c.timeout=a.f.attemptParameters.timeout,c.maxAttempts=Math.max(a.f.attemptParameters.maxAttempts,b.length),c.baseDelay=a.f.attemptParameters.baseDelay,c.backoffFactor=a.f.attemptParameters.backoffFactor,c.fuzzFactor=a.f.attemptParameters.fuzzFactor,c.type=1,d=a.C.networkingEngine.fetch(c),_.x(f,d.P,2);
25
+ e=f.f;a.m=e.uri;return f["return"](e)})},uJ=function(a,b){var c=null;try{var d=new DOMParser;try{var e=_.xh(b);var f=d.parseFromString(e.trim(),_.Ce)}catch(HC){throw HC;}if(f&&f.documentElement.tagName==_.rb)var g=f.documentElement;c=g&&0<g.getElementsByTagName("parsererror").length?null:g}catch(HC){}if(!c)throw a.h.error("Unable to parse manifest"),new _.L(_.M,4,4033,a.m);var h=+oJ(a,c,"MajorVersion"),l=+oJ(a,c,"MinorVersion"),m=+c.getAttribute("TimeScale")||1E7,n=+oJ(a,c,"Duration"),p="TRUE"===
26
+ c.getAttribute("IsLive"),q=+c.getAttribute("LookAheadCount"),r=+c.getAttribute("DVRWindowLength")||Infinity,v=_.aw(c,"Protection")[0];if(!1===/^[2].[0-2]$/.test(""+h+"."+l))throw a.h.error("Smooth Streaming version must be 2.0, 2.1 or 2.2"),new _.L(_.M,4,4036,a.m);p?(pJ(a,qJ),a.A=typeof a.f.liveRefreshPeriod===_.k?1E3*a.f.liveRefreshPeriod:Math.min(1E3*a.H,1E4),n=Infinity):pJ(a,lJ);a.a={startTime:0,delay:0,duration:n/m,Be:r/m,od:0};if(v){var z=a.f.playreadyVersion,A=[],E=_.aw(v,"ProtectionHeader")[0],
27
+ H=_.Lh(_.cw(E)||""),D=_.lw(H).a;A.push(jJ(_.Rc,{initData:_.Av(_.zl(D)),initDataType:_.Ac,keyId:D,periodId:null},[D]));A.push(jJ(_.Qc,kJ(H,D,z),[D]));a.o=A}var F=[],V=_.aw(c,"StreamIndex");if(!V.length)throw a.h.error("No streams found!"),new _.L(_.M,4,4034,a.m);for(var P=0;P<V.length;P++){for(var Ca,qa=a,ra=V[P],Da=oJ(qa,ra,"Type"),Fa=+ra.getAttribute("Chunks"),pa=ra.getAttribute("Subtype"),za=_.eh(ra.getAttribute("Language")||_.Ge),La=ra.getAttribute("Name")||"",tb=+ra.getAttribute(_.Ua),Zb=+ra.getAttribute(_.Ta),
28
+ bb=oJ(qa,ra,"Url"),gf=+ra.getAttribute("TimeScale")||null,KC=[],LC=_.aw(ra,_.gb),ls=0;ls<LC.length;ls++){var jf=qa,fd=LC[ls],ms=Da,bN=+fd.getAttribute("Index"),cN=+oJ(jf,fd,"Bitrate"),MC=NaN,NC=NaN,Fm=NaN,ns=NaN,OC=NaN,PC=NaN,QC=NaN,RC=fd.getAttribute("FourCC");switch(ms){case _.Pe:MC=+oJ(jf,fd,_.Ta);NC=+oJ(jf,fd,_.Ua);break;case _.jc:ns=+fd.getAttribute("Channels")||2,Fm=+oJ(jf,fd,"SamplingRate"),PC=+oJ(jf,fd,"AudioTag"),OC=+oJ(jf,fd,"BitsPerSample"),QC=+oJ(jf,fd,"PacketSize")}var os=String(fd.getAttribute("CodecPrivateData"));
29
+ if(ms===_.jc&&!os){var SC=ns,TC={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},Gm=TC[Fm];if("AACH"===RC){var mc=new Uint8Array(4);var UC=TC[2*Fm];mc[0]=40|Gm>>1;mc[1]=Gm<<7|SC<<3|UC>>1;mc[2]=UC<<7|8;mc[3]=0;var ag=new Uint16Array(2);ag[0]=(mc[0]<<8)+mc[1];ag[1]=(mc[2]<<8)+mc[3];var VC=ag[0].toString(16)+ag[1].toString(16)}else mc=new Uint8Array(2),mc[0]=16|Gm>>1,mc[1]=Gm<<7|SC<<3,ag=new Uint16Array(1),ag[0]=(mc[0]<<8)+mc[1],VC=ag[0].toString(16);
30
+ os=VC.toUpperCase()}var dN={id:jf.T++,type:ms,index:bN,bitrate:cN,Ld:os,maxHeight:MC,maxWidth:NC,ud:Fm,Lf:ns,Nl:PC,wh:OC,$l:QC,ej:RC,segmentIndex:null};KC.push(dN)}Ca=KC;for(var se=[],WC=_.aw(ra,"c"),ij=0;ij<WC.length;ij++){var ps=WC[ij],Hd=parseInt(ps.getAttribute("t"),10),nh=parseInt(ps.getAttribute("d"),10),qs=parseInt(ps.getAttribute("r"),10),jj=0;if(isNaN(Hd)&&isNaN(nh))throw qa.h.error("Either one or both FragmentDuration and FragmentTime field MUST be present in StreamFragmentElement"),new _.L(_.M,
31
+ 4,4037,qa.m);0===ij&&isNaN(Hd)&&(jj=Hd=0);if(0<ij){var bg=se[se.length-1];jj=bg.n+1;bg.d||(bg.d=Hd-bg.t);Hd||(Hd=bg.t+bg.d);nh||(nh=Hd-bg.t)}se.push({n:jj,d:nh,t:Hd});if(qs){qs--;for(var XC=0;XC<qs;XC++){var Hm=se[se.length-1];jj=Hm.n+1;Hd=Hm.t+Hm.d;nh=Hm.d;se.push({n:jj,d:nh,t:Hd})}}}qa.ed()||se.length===Fa||qa.h.warn("Number of fragments ("+Fa+") differs from number of chunks ("+se.length+").");F.push({type:Da,Ql:Fa,kl:pa,language:za,name:La,maxWidth:tb,maxHeight:Zb,ul:bb,tracks:Ca,gg:se,timescale:gf})}var kf=
32
+ {Yl:h,wg:l,timescale:m,duration:n,isLive:p,Xl:q,Be:r,Ne:!1,streams:F};if(a.g&&a.w)return rJ(a,kf),Promise.resolve();a.F.clear();var rs=kf.timescale,ss=kf.duration,fN=TI(kf.streams,_.jc),gN=TI(kf.streams,_.Pe),hN=TI(kf.streams,_.Ae),YC=[],Im=sJ(a,ss,rs,fN),Jm=sJ(a,ss,rs,gN),iN=sJ(a,ss,rs,hN);Im.length||(Im=[null]);Jm.length||(Jm=[null]);for(var us=0;us<Jm.length;us++)for(var vs=0;vs<Im.length;vs++)YC.push(tJ(a,Jm[us],Im[vs]));var ZC={startTime:0,variants:YC,textStreams:iN,thumbStreams:[]};var kN=kf.streams,
33
+ ws=a.a.startTime,$C=a.a.delay,xs=a.I,aD=Math.min(a.a.duration||Infinity,xs),ys=a.ed(),lN=a.a.Be,mN=a.a.od,bD=a.H,cD=isFinite(a.D)?a.D:0;if(ys)aD=Infinity,ws=Date.now()/1E3-mN,a.a.startTime=ws,$C=3*bD;else for(var nN=isFinite(xs)?xs:a.a.duration,dD=_.u(kN),zs=dD.next();!zs.done;zs=dD.next())for(var eD=_.u(zs.value.tracks),As=eD.next();!As.done;As=eD.next()){var fD=As.value;fD.segmentIndex.offset(-cD);_.vw(fD.segmentIndex,nN)}a.B=new _.Bw(ws,$C,!ys,!0);a.B.f=aD;_.Gw(a.B,bD);a.B.m=lN;ys||a.B.offset(-cD);
34
+ a.C.filterAllPeriods([ZC]);a.g={presentationTimeline:a.B,periods:[ZC],offlineSessionIds:[],minBufferTime:0};Promise.resolve();a.J||(a.C.networkingEngine.Ed(a.K),a.J=!0);a.w=kf;return Promise.resolve()},rJ=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={Kb:e.Kb},g=f.next())if(e.Kb=g.value,g=d.tracks.find(function(l){return function(m){return m.type===l.Kb.type&&m.bitrate===l.Kb.bitrate}}(e))){RI(e.Kb,g)||a.h.warn("The current stream is updated with a stream that seems to have different base properties!");
35
+ var h=vJ(a,a.w.timescale,d,g);g=e.Kb.segmentIndex;g.va(h);(h=a.a.Be)&&_.Rw(g,_.Qw(g)-h).forEach(function(l){l.Ma().forEach(function(m){a.F["delete"](m)})})}else a.h.warn("Cannot find satisfying update for "+e.Kb.type+" track with bitrate "+(e.Kb.bitrate+". Skipping update."))},sJ=function(a,b,c,d){for(var e=[],f={vc:0};f.vc<d.length;f={vc:f.vc},f.vc++){var g=d[f.vc].tracks.map(function(h){return function(l){var m=d[h.vc],n=vJ(a,c,m,l);n=new _.Pw(n);var p=null;m.type!==_.Ae&&(p=wJ(a,b,c,m,l));l.segmentIndex=
36
+ n;var q=a.M++,r=Promise.resolve.bind(Promise),v=n.Fc.bind(n),z=n.get.bind(n),A=n.Xc.bind(n),E=n.getDuration.bind(n),H=xJ[m.type],D="";switch(m.type){case _.Pe:D=l.Ld;var F=/00000001[0-9]7/.exec(D);D="avc1."+(F&&F[0]?D.substr(D.indexOf(F[0])+10,6):"42c00c");a.h.debug("VIDEO CODECS: ",D);break;case _.jc:D=l.Ld,F=2,"AACH"===l.ej?F=5:D&&(F=(parseInt(D.substr(0,2),16)&248)>>3),D="mp4a.40."+F,a.h.debug("AUDIO CODECS: ",D)}F=m.type===_.Ae?yJ[m.kl]:void 0;return{id:q,originalId:null,bm:null,createSegmentIndex:r,
37
+ findSegmentPosition:v,getSegmentReference:z,adjustSegmentDurations:A,getDuration:E,segmentIndex:n,segmentLookupStrategy:_.mv,initSegmentReference:p,mimeType:H,codecs:D,frameRate:void 0,bandwidth:l.bitrate,width:l.maxWidth||void 0,height:l.maxHeight||void 0,kind:F,encrypted:a.Qe(),keyId:null,language:m.language,label:m.name,type:m.type,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:l.Lf||null,closedCaptions:null}}}(f));e=e.concat(g)}return e},vJ=function(a,b,c,d){var e=
38
+ 0,f=[],g=c.timescale||b;c.gg.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=QI(a.m,c,l,d);a.H=Math.max(a.H,m);f.push(new _.Kv(l,n,p,function(){return[q]},0,null,0,null,!0,g));a.F.set(q,n);e+=m});if(c.type===_.Pe||c.type===_.jc)b=f[f.length-1],a.I=Math.min(a.I,e),0===a.a.od?a.a.od=b.endTime:a.a.od=Math.min(a.a.od,b.endTime);return f},wJ=function(a,b,c,d,e){b=SI(b,d.timescale||c,e);c={isLive:a.ed.bind(a),Xd:a.Qe.bind(a),kj:function(){return 1},
39
+ Rd:a.ig.bind(a)};d=new Uint8Array(0);try{d=fJ(b,c)}catch(g){throw a.h.error("Failed to generate initialization segment."),new _.L(_.M,3,4035,g);}var f="data:text/plain;base64,"+_.Kh(d);return new _.Jv(function(){return[f]},0,null,null,!0)},tJ=function(a,b,c){var d=(c?c.bandwidth:0)+(b?b.bandwidth:0),e=c?c.language:_.Ge;return c||b?{id:a.M++,language:e,primary:!1,audio:c,video:b,bandwidth:d,drmInfos:a.o,allowedByApplication:!0,allowedByKeySystem:!0}:null},oJ=function(a,b,c){if(b=b.getAttribute(c))return b;
40
+ a.h.error("required attribute not provided: "+c);throw new _.L(_.M,4,4038,a.m,c);},zJ=function(a,b){null!=a.A&&null!=b&&(a.j=window.setTimeout(a.Eb.bind(a),b))},pJ=function(a,b){var c=b===lJ;a.g&&a.g.presentationTimeline&&_.Cw(a.g.presentationTimeline,c);c&&null!=a.j&&(window.clearTimeout(a.j),a.j=null,a.A=null);a.N=b},AJ=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?_.S(a,1):_.S(a,this.size);_.Ak(a,VH(this.type));this.size>b&&PH(a,this.size);"uuid"===this.type&&_.Ak(a,null);if(0<this.f.length&&!this.A)for(b=0;b<this.f.length;b++)this.f[b].write(a),this.f[b].a(),a.getPosition()};_.w(Y,X);Y.prototype.a=function(){return 4+X.prototype.a.call(this)};Y.prototype.write=function(a){X.prototype.write.call(this,a);QH(a,this.version);RH(a,this.flags)};
43
+ _.w(WH,X);WH.prototype.a=function(){return this.g.byteLength+X.prototype.a.call(this)-this.offset};WH.prototype.write=function(a){X.prototype.write.call(this,a);_.Ak(a,this.g,this.offset);a.getPosition()};_.w(XH,Y);XH.prototype.a=function(){return this.g.byteLength+Y.prototype.a.call(this)-this.offset};XH.prototype.write=function(a){Y.prototype.write.call(this,a);_.Ak(a,this.g,this.offset);a.getPosition()};_.w(YH,X);
44
+ YH.prototype.a=function(){var a=this.j.length;a=a+4+this.g.join("").length;return a+X.prototype.a.call(this)};YH.prototype.write=function(a){X.prototype.write.call(this,a);_.Ak(a,VH(this.j));_.S(a,this.wg);_.Ak(a,VH(this.g.join("")));a.getPosition()};_.w(ZH,X);_.w($H,X);_.w(aI,Y);aI.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
+ aI.prototype.write=function(a){Y.prototype.write.call(this,a);1===this.version?(PH(a,0),PH(a,0),_.S(a,this.timescale),PH(a,this.duration*this.timescale)):(_.S(a,0),_.S(a,0),_.S(a,this.timescale),_.S(a,this.duration*this.timescale));_.S(a,65536);SH(a,this.volume);SH(a,0);_.S(a,0);_.S(a,0);for(var b=0;b<this.g.length;b++)QH(a,this.g[b]);_.S(a,0);_.S(a,0);_.S(a,0);_.S(a,0);_.S(a,0);_.S(a,0);_.S(a,this.j);a.getPosition()};_.w(bI,X);_.w(cI,Y);cI.prototype.a=function(){return 20+Y.prototype.a.call(this)};
46
+ cI.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.g);_.S(a,1);_.S(a,0);_.S(a,0);_.S(a,0);a.getPosition()};_.w(dI,Y);dI.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
+ dI.prototype.write=function(a){Y.prototype.write.call(this,a);1===this.version?(PH(a,0),PH(a,0),_.S(a,this.j),_.S(a,0),PH(a,this.duration*this.timescale)):(_.S(a,0),_.S(a,0),_.S(a,this.j),_.S(a,0),_.S(a,this.duration*this.timescale));_.S(a,0);_.S(a,0);SH(a,0);SH(a,0);SH(a,this.volume);SH(a,0);for(var b=0;b<this.g.length;b++)QH(a,this.g[b]);SH(a,this.width);SH(a,0);SH(a,this.height);SH(a,0);a.getPosition()};_.w(eI,Y);eI.prototype.a=function(){var a=0;a=1===this.version?a+28:a+16;return a+4+Y.prototype.a.call(this)};
48
+ eI.prototype.write=function(a){Y.prototype.write.call(this,a);1===this.version?(PH(a,0),PH(a,0),_.S(a,this.timescale),PH(a,this.duration*this.timescale)):(_.S(a,0),_.S(a,0),_.S(a,this.timescale),_.S(a,this.duration*this.timescale));SH(a,this.language);SH(a,0);a.getPosition()};_.w(fI,Y);fI.prototype.a=function(){return 33+Y.prototype.a.call(this)};
49
+ fI.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,0);this.g===_.Pe?_.Ak(a,VH("vide")):_.Ak(a,VH("soun"));_.S(a,0);_.S(a,0);_.S(a,0);this.g===_.Pe?_.Ak(a,VH("VideoHandler\x00")):_.Ak(a,VH("SoundHandler\x00"));a.getPosition()};_.w(gI,Y);gI.prototype.a=function(){return 2+this.g.byteLength+Y.prototype.a.call(this)};gI.prototype.write=function(a){Y.prototype.write.call(this,a);SH(a,0);_.Ak(a,this.g);a.getPosition()};_.w(hI,X);hI.prototype.a=function(){return 8+X.prototype.a.call(this)};
50
+ hI.prototype.write=function(a){X.prototype.write.call(this,a);_.S(a,0);SH(a,0);SH(a,1)};_.w(iI,hI);iI.prototype.a=function(){return 70+hI.prototype.a.call(this)};iI.prototype.write=function(a){hI.prototype.write.call(this,a);SH(a,0);SH(a,0);_.S(a,0);_.S(a,0);_.S(a,0);SH(a,this.width);SH(a,this.height);_.S(a,4718592);_.S(a,4718592);_.S(a,0);SH(a,1);QH(a,10);_.Ak(a,VH("AVC Coding",31));SH(a,this.depth);UH(a,-1)};_.w(jI,hI);jI.prototype.a=function(){return 20+hI.prototype.a.call(this)};
51
+ jI.prototype.write=function(a){hI.prototype.write.call(this,a);_.S(a,0);_.S(a,0);SH(a,this.channelCount);SH(a,this.sampleSize);UH(a,0);SH(a,0);SH(a,this.sampleRate);SH(a,0)};_.w(kI,iI);kI.prototype.write=function(a){iI.prototype.write.call(this,a);for(var b=0;b<this.f.length;b++)this.f[b].write(a);a.getPosition()};_.w(lI,kI);_.w(mI,jI);mI.prototype.write=function(a){jI.prototype.write.call(this,a);for(var b=0;b<this.f.length;b++)this.f[b].write(a);a.getPosition()};_.w(nI,mI);_.w(oI,X);
52
+ oI.prototype.a=function(){for(var a=7,b=0;b<this.Qa.length;b++)a+=2,a+=this.Qa[b].byteLength;for(b=0;b<this.Qa.length;b++)a+=2,a+=this.Ub[b].byteLength;return a+X.prototype.a.call(this)};
53
+ oI.prototype.write=function(a){X.prototype.write.call(this,a);QH(a,this.version);QH(a,this.g);QH(a,this.j);QH(a,this.level);QH(a,255);QH(a,224|this.Qa.length);for(var b=0;b<this.Qa.length;b++)SH(a,this.Qa[b].length),_.Ak(a,this.Qa[b]);QH(a,this.Ub.length);for(b=0;b<this.Ub.length;b++)SH(a,this.Ub[b].length),_.Ak(a,this.Ub[b]);a.getPosition()};_.w(pI,Y);pI.prototype.a=function(){return 22+(this.Lb.byteLength+3)+Y.prototype.a.call(this)};
54
+ pI.prototype.write=function(a){Y.prototype.write.call(this,a);QH(a,3);QH(a,23+this.Lb.byteLength);SH(a,1);QH(a,0);QH(a,4);QH(a,15+this.Lb.byteLength);QH(a,64);QH(a,21);RH(a,0);_.S(a,0);_.S(a,0);QH(a,5);QH(a,this.Lb.byteLength);_.Ak(a,this.Lb);_.Ak(a,new Uint8Array([6,1,2]));a.getPosition()};_.w(qI,Y);qI.prototype.a=function(){return this.location.length+Y.prototype.a.call(this)};qI.prototype.write=function(a){Y.prototype.write.call(this,a);0<this.location.length&&_.Ak(a,VH(this.location));a.getPosition()};
55
+ _.w(rI,Y);rI.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)};rI.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(sI,X);_.w(tI,Y);tI.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
+ tI.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(uI,Y);uI.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)};uI.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(vI,Y);
57
+ vI.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)};vI.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(wI,Y);wI.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
+ wI.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(xI,Y);xI.prototype.a=function(){return 8+Y.prototype.a.call(this)};xI.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,0);_.S(a,0);a.getPosition()};_.w(yI,Y);yI.prototype.a=function(){return 4+Y.prototype.a.call(this)};yI.prototype.write=function(a){Y.prototype.write.call(this,a);UH(a,0);SH(a,0);a.getPosition()};
59
+ _.w(zI,X);_.w(AI,X);_.w(BI,X);_.w(CI,Y);CI.prototype.a=function(){var a=0;a=1===this.version?a+8:a+4;return a+Y.prototype.a.call(this)};CI.prototype.write=function(a){Y.prototype.write.call(this,a);1===this.version?PH(a,this.g):_.S(a,this.g);a.getPosition()};_.w(DI,Y);DI.prototype.a=function(){return 4+Y.prototype.a.call(this)};DI.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.g);a.getPosition()};_.w(EI,Y);
60
+ EI.prototype.a=function(){var a=4;this.flags&BJ&&(a+=4);this.flags&CJ&&(a+=4);for(var b=0;b<this.g;b++)this.flags&DJ&&(a+=4),this.flags&EJ&&(a+=4),this.flags&FJ&&(a+=4),this.flags&GJ&&(a+=4);return a+Y.prototype.a.call(this)};
61
+ EI.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.g);this.flags&BJ&&(a.getPosition(),TH(a,this.m));this.flags&CJ&&_.S(a,this.o);for(var b=0;b<this.g;b++)this.flags&DJ&&_.S(a,this.w[b]),this.flags&EJ&&_.S(a,this.sampleSize[b]),this.flags&FJ&&_.S(a,this.B[b]),this.flags&GJ&&(0===this.version?_.S(a,this.j[b]):TH(a,this.j[b]));a.getPosition()};var BJ=1,CJ=4,DJ=256,EJ=512,FJ=1024,GJ=2048;_.w(FI,Y);
62
+ FI.prototype.a=function(){var a=4;this.flags&HJ&&(a+=8);this.flags&IJ&&(a+=4);this.flags&JJ&&(a+=4);this.flags&KJ&&(a+=4);this.flags&LJ&&(a+=4);return a+Y.prototype.a.call(this)};FI.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.g);this.flags&HJ&&PH(a,this.j);this.flags&IJ&&_.S(a,this.B);this.flags&JJ&&_.S(a,this.m);this.flags&KJ&&_.S(a,this.w);this.flags&LJ&&_.S(a,this.o);a.getPosition()};var HJ=1,IJ=2,JJ=8,KJ=16,LJ=32;_.w(GI,X);_.w(HI,X);_.w(II,X);
63
+ II.prototype.a=function(){return this.g.byteLength+X.prototype.a.call(this)};II.prototype.write=function(a){X.prototype.write.call(this,a);0<this.g.byteLength&&_.Ak(a,this.g)};_.w(JI,Y);JI.prototype.a=function(){var a=20;1===this.g&&0===this.j&&(a=a+1+this.m.length);return a+Y.prototype.a.call(this)};
64
+ JI.prototype.write=function(a){Y.prototype.write.call(this,a);QH(a,0);0===this.version?QH(a,0):QH(a,0);QH(a,this.g);QH(a,this.j);_.Ak(a,_.Mh(this.o));if(1===this.g&&0===this.j){QH(a,0);for(var b=0;b<this.m.length;b++)QH(a,this.m[b])}a.getPosition()};_.w(KI,Y);KI.prototype.a=function(){var a=8;this.flags&1&&(a+=VH(this.Gb).byteLength);return a+Y.prototype.a.call(this)};KI.prototype.write=function(a){Y.prototype.write.call(this,a);_.Ak(a,VH(this.g));_.S(a,this.j);this.flags&1&&_.Ak(a,VH(this.Gb));a.getPosition()};
65
+ _.w(LI,X);LI.prototype.a=function(){return VH(this.g).byteLength+X.prototype.a.call(this)};LI.prototype.write=function(a){X.prototype.write.call(this,a);_.Ak(a,VH(this.g));a.getPosition()};_.w(MI,Y);MI.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
+ MI.prototype.write=function(a){Y.prototype.write.call(this,a);this.flags&1&&(_.S(a,0),_.S(a,0));_.S(a,1);for(var b=0;1>b;b++)0===this.version?_.S(a,this.offset[b]):PH(a,this.offset[b]);a.getPosition()};_.w(NI,Y);NI.prototype.a=function(){var a=0;this.flags&1&&(a+=8);a+=5;0===this.g&&(a+=this.m.length);return a+Y.prototype.a.call(this)};
67
+ NI.prototype.write=function(a){Y.prototype.write.call(this,a);this.flags&1&&(_.S(a,0),_.S(a,0));QH(a,this.g);_.S(a,this.j);if(0===this.g)for(var b=0;b<this.j;b++)QH(a,this.m[b]);a.getPosition()};_.w(OI,Y);OI.prototype.a=function(){var a=4;this.flags&1&&(a+=1);for(var b=0;b<this.j;b++)if(a+=this.g[b].ng.byteLength,this.flags&2){a+=2;for(var c=0;c<this.g[b].Uc;c++)a+=2,a+=4}return a+Y.prototype.a.call(this)};
68
+ OI.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.j);this.flags&1&&QH(a,this.m);for(var b=0;b<this.j;b++)if(_.Ak(a,this.g[b].ng),this.flags&2){SH(a,this.g[b].Uc);for(var c=0;c<this.g[b].Uc;c++)SH(a,this.g[b].uf[c].Jf),_.S(a,this.g[b].uf[c].Kf)}a.getPosition()};var VI=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,WI=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,XI=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,YI=/^(\d*\.?\d*)f$/,ZI=/^(\d*\.?\d*)t$/,$I=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/;dJ.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};dJ.prototype.write=function(){this.f=cJ(this);for(var a=0;a<this.a.length;a++)this.a[a].write(this.f);return this.f.buffer};var gJ=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);_.t=mJ.prototype;_.t.configure=function(a){this.f=a};_.t.start=function(a,b){var c=this;this.C=b;var d=_.mf(new Set([a,PI(a)])).concat();return nJ(this,d).then(function(e){return uJ(c,e.data).then(function(){zJ(c,c.A);return c.g})})};_.t.stop=function(){this.C&&this.C.networkingEngine.be(this.K);this.A=this.w=this.g=this.f=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.ed())return nJ(this,[this.m]).then(function(b){return uJ(a,b.data).then(function(){return a.g})})["catch"](function(b){if(a.C)a.C.onError(b)})};_.t.onExpirationUpdated=function(){};_.t.setCurrentVariant=function(){};_.t.Eb=function(){var a=this;this.h.debug(_.ev);this.C&&(this.j=null,this.update().then(function(){zJ(a,a.A)})["catch"](function(b){a.C&&(a.C.onError(b),1===b.severity&&zJ(a,100))}))};_.t.ed=function(){return this.N===qJ};
70
+ _.t.Qe=function(){return 0<this.o.length};_.t.ig=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.cl=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.ed.bind(this),Xd:this.Qe.bind(this),kj:function(){return 1},Rd:this.ig.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.h.debug("Using base media decode time "+g+" instead of segment reference time "+a.request.startTime);f=iJ(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 xJ={video:_.Re,audio:_.oc,text:_.gc},lJ=_.fv,qJ="LIVE",yJ={wl:"caption",Fl:_.we};_.w(AJ,_.wo);AJ.prototype.Oa=function(){_.tp.ism=mJ;_.rp[_.hc]=mJ};AJ.prototype.Ha=function(){_.Xw("ism");_.Yw(_.hc)};AJ.prototype.id=function(){return"smooth"};_.C("clpp.smooth.SmoothComponent",AJ);};
73
73
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
74
74
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
75
75
  else{_=this.clpp._;(f.call(g,this));}