@castlabs/prestoplay 6.2.6 → 6.2.7

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 +12 -0
  2. package/README.md +1 -1
  3. package/cjs/cl.adobe.js +3 -3
  4. package/cjs/cl.airplay.js +3 -3
  5. package/cjs/cl.broadpeak.js +6 -6
  6. package/cjs/cl.cast.js +101 -101
  7. package/cjs/cl.conviva.js +32 -32
  8. package/cjs/cl.core.js +362 -362
  9. package/cjs/cl.crypto.js +9 -9
  10. package/cjs/cl.dash.js +68 -68
  11. package/cjs/cl.externs.js +63 -32
  12. package/cjs/cl.freewheel.js +19 -19
  13. package/cjs/cl.hls.js +43 -43
  14. package/cjs/cl.hlssmpte.js +6 -6
  15. package/cjs/cl.htmlcue.js +30 -30
  16. package/cjs/cl.ima.js +18 -18
  17. package/cjs/cl.mse.js +252 -249
  18. package/cjs/cl.muxdata.js +11 -11
  19. package/cjs/cl.onboard.js +3 -3
  20. package/cjs/cl.persistent.js +13 -13
  21. package/cjs/cl.playlist.js +5 -5
  22. package/cjs/cl.smooth.js +69 -69
  23. package/cjs/cl.thumbnails.js +22 -22
  24. package/cjs/cl.tizen.js +69 -69
  25. package/cjs/cl.ttml.js +26 -26
  26. package/cjs/cl.verimatrix.js +5 -5
  27. package/cjs/cl.vimond.js +12 -12
  28. package/cjs/cl.vr.js +24 -0
  29. package/cjs/cl.vtt.js +14 -14
  30. package/cjs/cl.youbora.js +16 -16
  31. package/cl.adobe.js +3 -3
  32. package/cl.airplay.js +3 -3
  33. package/cl.broadpeak.js +5 -5
  34. package/cl.cast.js +78 -78
  35. package/cl.conviva.js +25 -25
  36. package/cl.core.js +172 -171
  37. package/cl.crypto.js +8 -8
  38. package/cl.dash.js +61 -61
  39. package/cl.externs.js +59 -32
  40. package/cl.freewheel.js +18 -18
  41. package/cl.hls.js +36 -36
  42. package/cl.hlssmpte.js +5 -5
  43. package/cl.htmlcue.js +24 -24
  44. package/cl.ima.js +15 -15
  45. package/cl.mse.js +223 -220
  46. package/cl.muxdata.js +9 -9
  47. package/cl.onboard.js +3 -3
  48. package/cl.persistent.js +9 -9
  49. package/cl.playlist.js +4 -4
  50. package/cl.smooth.js +57 -57
  51. package/cl.thumbnails.js +15 -15
  52. package/cl.tizen.js +55 -55
  53. package/cl.ttml.js +21 -21
  54. package/cl.verimatrix.js +4 -4
  55. package/cl.vimond.js +7 -7
  56. package/cl.vr.js +14 -0
  57. package/cl.vtt.js +7 -7
  58. package/cl.youbora.js +8 -8
  59. package/package.json +1 -1
package/cjs/cl.muxdata.js CHANGED
@@ -1,15 +1,15 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var Ws=function(a,b){this.l=a;this.m=this.g=null;this.A=("000000"+(Math.random()*Math.pow(36,6)<<0).toString(36)).slice(-6);this.a=new _.Vf;this.f=b;this.o=this.j=this.h=this.w=!1},Ys=function(a){var b={debug:!0,data:Xs(a)};a.g&&a.g.muxOptionsOverride&&_.H.Dc(a.g.muxOptionsOverride)&&(b=_.H.Sa(b,a.g.muxOptionsOverride,{getPlayheadTime:function(){return 1E3*a.l.getPosition()},getStateData:function(){a.f.debug("getStateData()");var c=a.l.getLoadedSource(),d=a.l.getTrackManager(),e=a.l.getSurface(),
3
- f=d.fa(),g={player_is_paused:a.l.isPaused(),player_is_fullscreen:e.isFullscreen(),video_source_duration:1E3*a.l.getDuration(),player_autoplay_on:!!a.l.getConfiguration().autoplay};if(c){var k=new _.Hj(c.url);g.video_source_url=_.Ij(k);g.video_source_mime_type=c.type;c.name&&(g.video_title=c.name)}if(c=e.getContainer())g.player_width=c.offsetWidth,g.player_height=c.offsetHeight;f&&f.height&&f.width&&(g.video_source_height=f.height,g.video_source_width=f.width);(d=d.ha())&&d.language&&(g.player_language_code=
4
- d.language);return g}}));a.f.debug("Mux SDK options",b);return b},Xs=function(a){var b={env_key:a.g.envKey,video_title:a.m&&a.m.name||"",player_software_name:_.oa,player_software_version:_.da,player_mux_plugin_name:"CastlabsPlayer built-in Mux Plugin",player_mux_plugin_version:_.da};(a=a.l.getConfiguration().viewerId)&&(b.viewer_user_id=a);return b},Zs=function(a,b,c){a.f.debug("Event: "+b);mux.emit(a.A,b,c)},$s=function(a){a.a.on(a.l,_.ue,function(){Zs(a,_.ue,{player_playhead_time:1E3*a.l.getPosition()})});
5
- a.a.on(a.l,_.Pd,function(){return Zs(a,_.Pd)});a.a.on(a.l,_.gc,a.uh.bind(a));a.a.on(a.l,_.he,a.wh.bind(a));a.a.on(a.l,_.Ce,function(){return Zs(a,_.ce)});a.a.on(a.l,_.Be,function(){return Zs(a,_.be)});a.a.on(a.l,_.Wc,a.vh.bind(a));a.a.on(a.l,_.tb,function(){return Zs(a,"adbreakstart")});a.a.on(a.l,_.ub,function(){return Zs(a,"adbreakend")});a.a.on(a.l,_.Hb,function(){Zs(a,"adplay");Zs(a,"adplaying")});a.a.on(a.l,_.Db,function(){return Zs(a,"adpause")});a.a.on(a.l,_.Fb,function(){Zs(a,"adplay");Zs(a,
6
- "adplaying")});a.a.on(a.l,_.Ib,function(){return Zs(a,"adended")});a.a.on(a.l,_.yb,function(){return Zs(a,"adfirstquartile")});a.a.on(a.l,_.Cb,function(){return Zs(a,"admidpoint")});a.a.on(a.l,_.Jb,function(){return Zs(a,"adthirdquartile")})},at=function(){this.f=null;this.a=!1;this.g=new _.C("clpp.muxdata")},bt=function(){};_.h=Ws.prototype;_.h.release=function(){this.f.debug("release()");this.j?this.f.debug(_.ia):(_.Yf(this.a),this.j=!0,this.m=this.g=null)};
7
- _.h.destroy=function(){this.f.debug(_.Jc);this.o?this.f.debug(_.ha):(this.o=!0,this.h&&this.w&&Zs(this,"viewend"),Zs(this,"destroy"))};_.h.uh=function(a){this.f.debug(_.Bd);var b=a.detail;a=this.l.getTrackManager();b&&b.bandwidth&&(b=b.bandwidth,(a=a.za())&&a.bandwidth&&(b+=a.bandwidth),Zs(this,"renditionchange",{video_source_bitrate:b}))};
8
- _.h.wh=function(a){this.f.debug(_.Gd);switch(a.detail.currentState){case _.Kl:this.l.getConfiguration().autoplay&&Zs(this,_.Pd);break;case _.Ml:Zs(this,_.Qd);break;case _.Ll:Zs(this,_.Ld);break;case _.Fl:this.w=!0,Zs(this,_.Uc)}};
9
- _.h.vh=function(a){this.f.debug(_.Dd);if(this.h&&(a=a.detail||null))if(10003===a.code)Zs(this,"aderror");else if(a.severity===_.K){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);Zs(this,_.Wc,{player_error_code:a.code,player_error_message:b})}};_.u(at,_.So);_.h=at.prototype;_.h.onPlayerCreated=function(a){this.f=new Ws(a,this.g)};
10
- _.h.onContentWillLoad=function(a,b){var c=a.getConfiguration();if(this.a=!_.H.R(c.muxdata)&&typeof c.muxdata===_.Ad){c=c.muxdata;var d;if(d="undefined"===typeof window.mux)c=c.muxLib,d="undefined"!==typeof c&&typeof c.init===_.Yc&&typeof c.emit===_.Yc,window.mux=c,d=!d;d&&(this.g.warn("Mux SDK is not loaded. Will do nothing."),this.a=!1,c=new _.J(1,9,9301),this.S(a,c))}else this.g.warn("Mux plugin is loaded but not configured. Will do nothing.");if(this.a){c=a.getConfiguration();c=_.H.xa(c.muxdata||
11
- {});try{d=[];typeof c===_.Ad&&(c.envKey||d.push("envKey"));if(0<d.length)throw new _.J(1,9,9300,{missingKeys:d});var e=this.f;e.g=c;e.m=b;e.w=!1;if(!e.h){try{e.h=!0,mux.init(e.A,Ys(e))}catch(f){throw e.h=!1,_.Yf(e.a),new _.J(1,9,9302,null,f);}Zs(e,"playerready")}e.j&&!e.o&&(Zs(e,"videochange",Xs(e)),e.j=!1);$s(e)}catch(f){this.a=!1,this.S(a,f)}}};_.h.onContentLoaded=function(){};_.h.onPlayerWillDestroy=function(){this.a&&(this.f.destroy(),this.f=null)};_.h.onPlayerWillRelease=function(){this.a&&this.f.release()};
12
- _.h.id=function(){return"mux"};_.h.S=function(a,b){a.trigger(new _.D(_.Wc,{detail:b}))};_.A("clpp.muxdata.MuxDataPlugin",at);at.Id="mux";bt.prototype.create=function(){return new at};_.fn(new bt);};
2
+ var f=function(window){var rt=function(a,b){this.l=a;this.m=this.g=null;this.A=("000000"+(Math.random()*Math.pow(36,6)<<0).toString(36)).slice(-6);this.a=new _.Tf;this.f=b;this.o=this.j=this.h=this.w=!1},tt=function(a){var b={debug:!0,data:st(a)};a.g&&a.g.muxOptionsOverride&&_.H.Ec(a.g.muxOptionsOverride)&&(b=_.H.Sa(b,a.g.muxOptionsOverride,{getPlayheadTime:function(){return 1E3*a.l.getPosition()},getStateData:function(){a.f.debug("getStateData()");var c=a.l.getLoadedSource(),d=a.l.getTrackManager(),e=a.l.getSurface(),
3
+ f=d.fa(),g={player_is_paused:a.l.isPaused(),player_is_fullscreen:e.isFullscreen(),video_source_duration:1E3*a.l.getDuration(),player_autoplay_on:!!a.l.getConfiguration().autoplay};if(c){var k=new _.Ij(c.url);g.video_source_url=_.Jj(k);g.video_source_mime_type=c.type;c.name&&(g.video_title=c.name)}if(c=e.getContainer())g.player_width=c.offsetWidth,g.player_height=c.offsetHeight;f&&f.height&&f.width&&(g.video_source_height=f.height,g.video_source_width=f.width);(d=d.ia())&&d.language&&(g.player_language_code=
4
+ d.language);return g}}));a.f.debug("Mux SDK options",b);return b},st=function(a){var b={env_key:a.g.envKey,video_title:a.m&&a.m.name||"",player_software_name:_.na,player_software_version:_.da,player_mux_plugin_name:"CastlabsPlayer built-in Mux Plugin",player_mux_plugin_version:_.da};(a=a.l.getConfiguration().viewerId)&&(b.viewer_user_id=a);return b},ut=function(a,b,c){a.f.debug("Event: "+b);mux.emit(a.A,b,c)},vt=function(a){a.a.on(a.l,_.ve,function(){ut(a,_.ve,{player_playhead_time:1E3*a.l.getPosition()})});
5
+ a.a.on(a.l,_.Pd,function(){return ut(a,_.Pd)});a.a.on(a.l,_.fc,a.xh.bind(a));a.a.on(a.l,_.he,a.zh.bind(a));a.a.on(a.l,_.De,function(){return ut(a,_.ce)});a.a.on(a.l,_.Ce,function(){return ut(a,_.be)});a.a.on(a.l,_.Vc,a.yh.bind(a));a.a.on(a.l,_.tb,function(){return ut(a,"adbreakstart")});a.a.on(a.l,_.ub,function(){return ut(a,"adbreakend")});a.a.on(a.l,_.Hb,function(){ut(a,"adplay");ut(a,"adplaying")});a.a.on(a.l,_.Db,function(){return ut(a,"adpause")});a.a.on(a.l,_.Fb,function(){ut(a,"adplay");ut(a,
6
+ "adplaying")});a.a.on(a.l,_.Ib,function(){return ut(a,"adended")});a.a.on(a.l,_.yb,function(){return ut(a,"adfirstquartile")});a.a.on(a.l,_.Cb,function(){return ut(a,"admidpoint")});a.a.on(a.l,_.Jb,function(){return ut(a,"adthirdquartile")})},wt=function(){this.f=null;this.a=!1;this.g=new _.D("clpp.muxdata")},xt=function(){};_.h=rt.prototype;_.h.release=function(){this.f.debug("release()");this.j?this.f.debug(_.ia):(_.Zf(this.a),this.j=!0,this.m=this.g=null)};
7
+ _.h.destroy=function(){this.f.debug(_.Jc);this.o?this.f.debug(_.ha):(this.o=!0,this.h&&this.w&&ut(this,"viewend"),ut(this,"destroy"))};_.h.xh=function(a){this.f.debug(_.Bd);var b=a.detail;a=this.l.getTrackManager();b&&b.bandwidth&&(b=b.bandwidth,(a=a.Aa())&&a.bandwidth&&(b+=a.bandwidth),ut(this,"renditionchange",{video_source_bitrate:b}))};
8
+ _.h.zh=function(a){this.f.debug(_.Gd);switch(a.detail.currentState){case _.Ll:this.l.getConfiguration().autoplay&&ut(this,_.Pd);break;case _.Nl:ut(this,_.Qd);break;case _.Ml:ut(this,_.Ld);break;case _.Gl:this.w=!0,ut(this,_.Uc)}};
9
+ _.h.yh=function(a){this.f.debug(_.Dd);if(this.h&&(a=a.detail||null))if(10003===a.code)ut(this,"aderror");else if(a.severity===_.K){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);ut(this,_.Vc,{player_error_code:a.code,player_error_message:b})}};_.u(wt,_.To);_.h=wt.prototype;_.h.onPlayerCreated=function(a){this.f=new rt(a,this.g)};
10
+ _.h.onContentWillLoad=function(a,b){var c=a.getConfiguration();if(this.a=!_.H.R(c.muxdata)&&typeof c.muxdata===_.Ad){c=c.muxdata;var d;if(d="undefined"===typeof window.mux)c=c.muxLib,d="undefined"!==typeof c&&typeof c.init===_.Yc&&typeof c.emit===_.Yc,window.mux=c,d=!d;d&&(this.g.warn("Mux SDK is not loaded. Will do nothing."),this.a=!1,c=new _.J(1,9,9301),this.S(a,c))}else this.g.warn("Mux plugin is loaded but not configured. Will do nothing.");if(this.a){c=a.getConfiguration();c=_.H.ya(c.muxdata||
11
+ {});try{d=[];typeof c===_.Ad&&(c.envKey||d.push("envKey"));if(0<d.length)throw new _.J(1,9,9300,{missingKeys:d});var e=this.f;e.g=c;e.m=b;e.w=!1;if(!e.h){try{e.h=!0,mux.init(e.A,tt(e))}catch(f){throw e.h=!1,_.Zf(e.a),new _.J(1,9,9302,null,f);}ut(e,"playerready")}e.j&&!e.o&&(ut(e,"videochange",st(e)),e.j=!1);vt(e)}catch(f){this.a=!1,this.S(a,f)}}};_.h.onContentLoaded=function(){};_.h.onPlayerWillDestroy=function(){this.a&&(this.f.destroy(),this.f=null)};_.h.onPlayerWillRelease=function(){this.a&&this.f.release()};
12
+ _.h.id=function(){return"mux"};_.h.S=function(a,b){a.trigger(new _.E(_.Vc,{detail:b}))};_.A("clpp.muxdata.MuxDataPlugin",wt);wt.Id="mux";xt.prototype.create=function(){return new wt};_.gn(new xt);};
13
13
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
14
14
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
15
15
  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 Us=function(){this.l=null;this.a=new _.C("clpp.onboard")},Vs=function(a,b){function c(l){return l&&(_.Xg(l,"https://")||_.Xg(l,"http://")||_.Xg(l,"//"))?l:d+l}var d=b.baseUrl;_.Yg(d,"/")||(d+="/");var e=c(b.widevineUrl||"widevine"),f=c(b.playreadyUrl||"playready"),g=c(b.fairplayUrl||"fairplay"),k=new _.uj(a);k.Ea(_.Fc,{licenseUrl:e,videoRobustness:[_.gb,void 0],audioRobustness:[_.fb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:_.dk,
3
- licenseResponse:_.ik}});k.Ea(_.Dc,{licenseUrl:g,certificateUrl:g,modifiers:{licenseRequest:_.fk,licenseResponse:_.gk,extractContentId:_.ck,certificateRequest:_.hk}});k.Ea(_.Ec,{licenseUrl:f,modifiers:{licenseRequest:_.dk}});_.pj(k)};_.u(Us,_.ln);_.h=Us.prototype;_.h.Da=function(a){this.l=a};_.h.va=function(){this.l=null};
4
- _.h.Vb=function(){var a=this.l.getConfiguration().drm,b;if(b=!(!a||!a.env))b=a&&a.customData,b=!(!b||!b.baseUrl);b&&(b=a.env,a=a.customData,a={baseUrl:a.baseUrl,widevineUrl:a.widevineUrl,playreadyUrl:a.playreadyUrl,fairplayUrl:a.fairplayUrl},this.a.info("Registering the DRMtoday Onboard environment, name\x3d'"+b+"'"),Vs(b,a))};_.h.release=function(){};_.h.id=function(){return"onboard"};_.A("clpp.onboard.OnboardComponent",Us);_.A("clpp.onboard.register",Vs);};
2
+ var f=function(window){var pt=function(){this.l=null;this.a=new _.D("clpp.onboard")},qt=function(a,b){function c(l){return l&&(_.Yg(l,"https://")||_.Yg(l,"http://")||_.Yg(l,"//"))?l:d+l}var d=b.baseUrl;_.Zg(d,"/")||(d+="/");var e=c(b.widevineUrl||"widevine"),f=c(b.playreadyUrl||"playready"),g=c(b.fairplayUrl||"fairplay"),k=new _.vj(a);k.Fa(_.Fc,{licenseUrl:e,videoRobustness:[_.gb,void 0],audioRobustness:[_.fb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:_.ek,
3
+ licenseResponse:_.jk}});k.Fa(_.Dc,{licenseUrl:g,certificateUrl:g,modifiers:{licenseRequest:_.gk,licenseResponse:_.hk,extractContentId:_.dk,certificateRequest:_.ik}});k.Fa(_.Ec,{licenseUrl:f,modifiers:{licenseRequest:_.ek}});_.qj(k)};_.u(pt,_.mn);_.h=pt.prototype;_.h.Ea=function(a){this.l=a};_.h.va=function(){this.l=null};
4
+ _.h.Vb=function(){var a=this.l.getConfiguration().drm,b;if(b=!(!a||!a.env))b=a&&a.customData,b=!(!b||!b.baseUrl);b&&(b=a.env,a=a.customData,a={baseUrl:a.baseUrl,widevineUrl:a.widevineUrl,playreadyUrl:a.playreadyUrl,fairplayUrl:a.fairplayUrl},this.a.info("Registering the DRMtoday Onboard environment, name\x3d'"+b+"'"),qt(b,a))};_.h.release=function(){};_.h.id=function(){return"onboard"};_.A("clpp.onboard.OnboardComponent",pt);_.A("clpp.onboard.register",qt);};
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 Bs="A persistent DRM session already exists for: ",Cs="No DRM configuration.",Ds="clpp.persistent",Es=function(a){a.A=[a.g];a.m=0;a.j=0},Fs=function(a){var b=a.A.splice(0)[0];(b=a.g=a.g||b)?b.Df?a.a=a.m||a.j:void 0!=b.G&&a.j<b.G?(a.a=b.G,a.g=null):a.a=a.j:a.a=0},Gs=function(a,b){for(var c=[],d=_.t(a),e=d.next();!e.done;e=d.next())c.push(b(e.value));return c},Hs=function(a){a=a.g.keys();a=Gs(a,function(b){return b.sessionId});return Array.from(a)},Is=function(a,b){var c,d,e;return _.z(function(f){if(1==
3
- f.a)return _.v(f,_.Wk(a,b),2);c=f.f;if(!c)return a.a.debug("Ignoring attempt to remove missing session",b),f["return"]();d=[];(e=a.g.get(c))&&a.B&&(e.ib=new _.Nh,d.push(e.ib));a.a.debug("Attempting to remove session",b);d.push(c.remove());return f["return"](Promise.all(d))})},Ks=function(a,b){a.K=Js;a.J=[];a.D=!0;return _.Ek(a,b)},Ms=function(a,b,c,d,e,f){a.K=Ls;var g=new Map,k=_.Yk(b);g.set(k,{audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:_.Id,persistentState:_.Zd,sessionTypes:[_.Nd],
4
- label:k,drmInfos:[{keySystem:b,licenseServerUri:c,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}]});return _.Kk(a,g)},Ns=function(){},Os=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}},Ps=function(a,b){var c=_.rj(a),d=_.Vi({drm:a});d.drm=a;var e=new _.Ak({wb:b,onError:function(){},Ae:function(){},onExpirationUpdated:function(){},onEvent:function(){},getConfiguration:function(){return d},Bc:function(){return null}});e.h=c;return e},Ss=function(a,b,c){var d,e,f,g,k,l,m,n,p;return _.z(function(q){switch(q.a){case 1:d=Qs;e=Rs;if(!a)return e.debug(Cs),q["return"]();f=a.offlineId;return 0===
6
- f.length?q["return"]():_.v(q,d.get(f),2);case 2:if(g=q.f)return e.debug(Bs,f),q["return"]();k=Ps(a,c);_.pf(q,3,4);return _.v(q,Ks(k,b),6);case 6:return _.v(q,_.Qk(k),7);case 7:return _.v(q,_.Rk(k),8);case 8:return l=k.getDrmInfo(),m=b.map(function(r){return{contentType:_.uh(r.video.mimeType,r.video.codecs),robustness:l.videoRobustness}}),n=Hs(k),g={sessionIds:n,keySystem:l.keySystem,licenseServerUri:l.licenseServerUri,serverCertificate:l.serverCertificate,audioCapabilities:[],videoCapabilities:m,
7
- drmConfig:a},_.v(q,d.store(f,g),4);case 4:return Es(q),_.v(q,k.destroy(),10);case 10:Fs(q);break;case 3:throw p=_.rf(q),e.error("Error while persisting DRM session"),new _.J(1,6,6200,null,p);}})},Ts=function(){this.l=null;this.f=Qs;this.a=new _.C(Ds)},Js=1,Ls=2;_.h=Ns.prototype;
2
+ var f=function(window){var Xs="A persistent DRM session already exists for: ",Ys="No DRM configuration.",Zs="clpp.persistent",$s=function(a){a.A=[a.g];a.m=0;a.j=0},at=function(a){var b=a.A.splice(0)[0];(b=a.g=a.g||b)?b.Ff?a.a=a.m||a.j:void 0!=b.H&&a.j<b.H?(a.a=b.H,a.g=null):a.a=a.j:a.a=0},bt=function(a,b){for(var c=[],d=_.t(a),e=d.next();!e.done;e=d.next())c.push(b(e.value));return c},ct=function(a){a=a.g.keys();a=bt(a,function(b){return b.sessionId});return Array.from(a)},dt=function(a,b){var c,d,e;return _.z(function(f){if(1==
3
+ f.a)return _.v(f,_.Xk(a,b),2);c=f.f;if(!c)return a.a.debug("Ignoring attempt to remove missing session",b),f["return"]();d=[];(e=a.g.get(c))&&a.B&&(e.ib=new _.Oh,d.push(e.ib));a.a.debug("Attempting to remove session",b);d.push(c.remove());return f["return"](Promise.all(d))})},ft=function(a,b){a.K=et;a.J=[];a.D=!0;return _.Fk(a,b)},ht=function(a,b,c,d,e,f){a.K=gt;var g=new Map,k=_.Zk(b);g.set(k,{audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:_.Id,persistentState:_.Zd,sessionTypes:[_.Nd],
4
+ label:k,drmInfos:[{keySystem:b,licenseServerUri:c,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}]});return _.Lk(a,g)},it=function(){},jt=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}},kt=function(a,b){var c=_.sj(a),d=_.Ui({drm:a});d.drm=a;var e=new _.Bk({wb:b,onError:function(){},Ce:function(){},onExpirationUpdated:function(){},onEvent:function(){},getConfiguration:function(){return d},Cc:function(){return null}});e.h=c;return e},nt=function(a,b,c){var d,e,f,g,k,l,m,n,p;return _.z(function(q){switch(q.a){case 1:d=lt;e=mt;if(!a)return e.debug(Ys),q["return"]();f=a.offlineId;return 0===
6
+ f.length?q["return"]():_.v(q,d.get(f),2);case 2:if(g=q.f)return e.debug(Xs,f),q["return"]();k=kt(a,c);_.qf(q,3,4);return _.v(q,ft(k,b),6);case 6:return _.v(q,_.Rk(k),7);case 7:return _.v(q,_.Sk(k),8);case 8:return l=k.getDrmInfo(),m=b.map(function(r){return{contentType:_.vh(r.video.mimeType,r.video.codecs),robustness:l.videoRobustness}}),n=ct(k),g={sessionIds:n,keySystem:l.keySystem,licenseServerUri:l.licenseServerUri,serverCertificate:l.serverCertificate,audioCapabilities:[],videoCapabilities:m,
7
+ drmConfig:a},_.v(q,d.store(f,g),4);case 4:return $s(q),_.v(q,k.destroy(),10);case 10:at(q);break;case 3:throw p=_.sf(q),e.error("Error while persisting DRM session"),new _.J(1,6,6200,null,p);}})},ot=function(){this.l=null;this.f=lt;this.a=new _.D(Zs)},et=1,gt=2;_.h=it.prototype;
8
8
  _.h.store=function(a,b){var c;return _.z(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),k=JSON.stringify(b.videoCapabilities);c=JSON.stringify({sessionIds:e,keySystem:b.keySystem,licenseServerUri:encodeURIComponent(b.licenseServerUri),serverCertificate:f,audioCapabilities:g,videoCapabilities:k,drmConfig:JSON.stringify(b.drmConfig)});window.localStorage.setItem(encodeURIComponent(a),
9
- btoa(c));_.w(d)})};_.h.get=function(a){var b;return _.z(function(c){return(b=window.localStorage.getItem(encodeURIComponent(a)))?c["return"](Os(atob(b))):c["return"](null)})};_.h["delete"]=function(a){return _.z(function(b){window.localStorage.removeItem(encodeURIComponent(a));_.w(b)})};_.h.clear=function(){return _.z(function(a){window.localStorage.clear();_.w(a)})};_.h.getName=function(){return"clpp.persistent.SimpleSessionStorage"};_.A("clpp.persistent.useStorage",function(a){var b=["store","get","delete","clear","getName"];var c=[];_.H.R(a)||(_.H.tb(a.store)||c.push("store"),_.H.tb(a.get)||c.push("get"),_.H.tb(a["delete"])||c.push("delete"),_.H.tb(a.clear)||c.push("clear"),_.H.tb(a.getName)||c.push("getName"),b=c);if(0<b.length)throw Rs.warn("Invalid session storage implementation"),new _.J(1,6,6202,{missingMethods:b});Qs=a});
10
- _.A("clpp.persistent.fetchLicense",function(a,b,c){for(var d=[],e=2;e<arguments.length;++e)d[e-2]=arguments[e];var f,g,k,l,m,n,p,q,r,x,y,E,I,F,G,M,O,T,Ma;return _.z(function(ea){switch(ea.a){case 1:f=Qs;g=Rs;k=function(na,ya){return new _.J(1,6,6200,na,ya)};l=_.Ql(a).shift();if(!l)throw k("No source specified.");if(!b)throw k(Cs);m=b.offlineId;if(typeof m!==_.le||!m.length)throw k("Missing offline id.");return _.v(ea,f.get(m),2);case 2:if(n=ea.f)return g.debug(Bs,m),ea["return"]();p=_.Vi();q=new _.ji;
11
- r=[];x=_.t(d);for(y=x.next();!y.done;y=x.next())E=y.value,I=new E,_.Zi(I.id())||(I.Da(null),_.aj(I),r.push(I));F=null;_.pf(ea,3,4);return _.v(ea,_.ho(l.url,q,p.manifest.attemptParameters,l.type),6);case 6:return F=ea.f,F.configure(p.manifest),_.v(ea,F.start(l.url,{networkingEngine:q,filterAllPeriods:function(){},filterNewPeriod:function(){},onTimelineCueAdded:function(){},onEvent:function(){},onError:function(){}}),7);case 7:G=ea.f;if(!G.periods.length)throw k(null,new _.J(_.K,4,4014));M=_.$n(G.periods);
12
- return _.v(ea,Ss(b,M,q),4);case 4:for(Es(ea);r.length;)O=r.shift(),O.va(),_.Yi["delete"](O.id());T=[];F&&T.push(F.stop());T.push(q.destroy());return _.v(ea,Promise.all(T),9);case 9:Fs(ea);break;case 3:Ma=_.rf(ea);if(Ma instanceof _.J&&6200===Ma.code)throw Ma;throw k(null,Ma);}})});
13
- _.A("clpp.persistent.removeLicense",function(a){var b,c,d,e,f,g,k;return _.z(function(l){switch(l.a){case 1:b=Qs;c=Rs;if(!_.H.Y(a)||0===a.length)return c.warn("Invalid offlineId"),l["return"]();e=d=null;_.pf(l,2,3);return _.v(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 _.ji;d=Ps(f.drmConfig,e);return _.v(l,Ms(d,f.keySystem,f.licenseServerUri,f.serverCertificate,f.audioCapabilities,f.videoCapabilities),
14
- 6);case 6:return _.v(l,_.Qk(d),7);case 7:return _.v(l,Promise.all(f.sessionIds.map(function(m){return _.z(function(n){if(1==n.a)return _.v(n,Is(d,m),2);c.debug("sucessfully removed session with id",m);_.w(n)})})),8);case 8:return _.v(l,b["delete"](a),3);case 3:return Es(l),g=[],d&&g.push(d.destroy()),e&&g.push(e.destroy()),_.v(l,Promise.all(g),10);case 10:Fs(l);break;case 2:throw k=_.rf(l),c.error("Failed to remove session"),new _.J(1,6,6201,null,k);}})});var Qs=new Ns,Rs=new _.C(Ds);_.u(Ts,_.ln);_.h=Ts.prototype;_.h.Da=function(a){this.l=a};_.h.va=function(){this.l=null};_.h.release=function(){};_.h.Vb=function(){this.f=Qs};_.h.id=function(){return _.Md};_.h.hj=function(a,b,c){var d=this,e;return _.z(function(f){if(1==f.a){if(!a)return d.a.debug("No DRM configuration found for loaded source."),f["return"]();_.pf(f,2);return _.v(f,Ss(a,b,c),4)}if(2!=f.a)return d.l.trigger(new _.D(_.Oc,{offlineId:a.offlineId})),_.qf(f,0);e=_.rf(f);d.l.onError(e);_.w(f)})};
15
- _.h.fi=function(a){var b=this,c;return _.z(function(d){if(1==d.a)return _.pf(d,2),_.v(d,b.f.get(a),4);if(2!=d.a){if(c=d.f)return d["return"](c.sessionIds);b.a.debug("No offline session found for "+a);return d["return"]([])}_.rf(d);b.a.warn("Error while loading session info from storage");return d["return"]([])})};_.A("clpp.persistent.PersistentLicenseComponent",Ts);};
9
+ btoa(c));_.w(d)})};_.h.get=function(a){var b;return _.z(function(c){return(b=window.localStorage.getItem(encodeURIComponent(a)))?c["return"](jt(atob(b))):c["return"](null)})};_.h["delete"]=function(a){return _.z(function(b){window.localStorage.removeItem(encodeURIComponent(a));_.w(b)})};_.h.clear=function(){return _.z(function(a){window.localStorage.clear();_.w(a)})};_.h.getName=function(){return"clpp.persistent.SimpleSessionStorage"};_.A("clpp.persistent.useStorage",function(a){var b=["store","get","delete","clear","getName"];var c=[];_.H.R(a)||(_.H.tb(a.store)||c.push("store"),_.H.tb(a.get)||c.push("get"),_.H.tb(a["delete"])||c.push("delete"),_.H.tb(a.clear)||c.push("clear"),_.H.tb(a.getName)||c.push("getName"),b=c);if(0<b.length)throw mt.warn("Invalid session storage implementation"),new _.J(1,6,6202,{missingMethods:b});lt=a});
10
+ _.A("clpp.persistent.fetchLicense",function(a,b,c){for(var d=[],e=2;e<arguments.length;++e)d[e-2]=arguments[e];var f,g,k,l,m,n,p,q,r,x,y,C,I,F,G,M,O,T,Na;return _.z(function(fa){switch(fa.a){case 1:f=lt;g=mt;k=function(pa,za){return new _.J(1,6,6200,pa,za)};l=_.Rl(a).shift();if(!l)throw k("No source specified.");if(!b)throw k(Ys);m=b.offlineId;if(typeof m!==_.le||!m.length)throw k("Missing offline id.");return _.v(fa,f.get(m),2);case 2:if(n=fa.f)return g.debug(Xs,m),fa["return"]();p=_.Ui();q=new _.ki;
11
+ r=[];x=_.t(d);for(y=x.next();!y.done;y=x.next())C=y.value,I=new C,_.$i(I.id())||(I.Ea(null),_.bj(I),r.push(I));F=null;_.qf(fa,3,4);return _.v(fa,_.io(l.url,q,p.manifest.attemptParameters,l.type),6);case 6:return F=fa.f,F.configure(p.manifest),_.v(fa,F.start(l.url,{networkingEngine:q,filterAllPeriods:function(){},filterNewPeriod:function(){},onTimelineCueAdded:function(){},onEvent:function(){},onError:function(){}}),7);case 7:G=fa.f;if(!G.periods.length)throw k(null,new _.J(_.K,4,4014));M=_.ao(G.periods);
12
+ return _.v(fa,nt(b,M,q),4);case 4:for($s(fa);r.length;)O=r.shift(),O.va(),_.Xi["delete"](O.id());T=[];F&&T.push(F.stop());T.push(q.destroy());return _.v(fa,Promise.all(T),9);case 9:at(fa);break;case 3:Na=_.sf(fa);if(Na instanceof _.J&&6200===Na.code)throw Na;throw k(null,Na);}})});
13
+ _.A("clpp.persistent.removeLicense",function(a){var b,c,d,e,f,g,k;return _.z(function(l){switch(l.a){case 1:b=lt;c=mt;if(!_.H.Z(a)||0===a.length)return c.warn("Invalid offlineId"),l["return"]();e=d=null;_.qf(l,2,3);return _.v(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 _.ki;d=kt(f.drmConfig,e);return _.v(l,ht(d,f.keySystem,f.licenseServerUri,f.serverCertificate,f.audioCapabilities,f.videoCapabilities),
14
+ 6);case 6:return _.v(l,_.Rk(d),7);case 7:return _.v(l,Promise.all(f.sessionIds.map(function(m){return _.z(function(n){if(1==n.a)return _.v(n,dt(d,m),2);c.debug("successfully removed session with id",m);_.w(n)})})),8);case 8:return _.v(l,b["delete"](a),3);case 3:return $s(l),g=[],d&&g.push(d.destroy()),e&&g.push(e.destroy()),_.v(l,Promise.all(g),10);case 10:at(l);break;case 2:throw k=_.sf(l),c.error("Failed to remove session"),new _.J(1,6,6201,null,k);}})});var lt=new it,mt=new _.D(Zs);_.u(ot,_.mn);_.h=ot.prototype;_.h.Ea=function(a){this.l=a};_.h.va=function(){this.l=null};_.h.release=function(){};_.h.Vb=function(){this.f=lt};_.h.id=function(){return _.Md};_.h.pj=function(a,b,c){var d=this,e;return _.z(function(f){if(1==f.a){if(!a)return d.a.debug("No DRM configuration found for loaded source."),f["return"]();_.qf(f,2);return _.v(f,nt(a,b,c),4)}if(2!=f.a)return d.l.trigger(new _.E(_.Oc,{offlineId:a.offlineId})),_.rf(f,0);e=_.sf(f);d.l.onError(e);_.w(f)})};
15
+ _.h.ji=function(a){var b=this,c;return _.z(function(d){if(1==d.a)return _.qf(d,2),_.v(d,b.f.get(a),4);if(2!=d.a){if(c=d.f)return d["return"](c.sessionIds);b.a.debug("No offline session found for "+a);return d["return"]([])}_.sf(d);b.a.warn("Error while loading session info from storage");return d["return"]([])})};_.A("clpp.persistent.PersistentLicenseComponent",ot);};
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,9 +1,9 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var ys=function(a,b){b=void 0===b?function(){return Promise.resolve()}:b;_.Mh.call(this);this.l=a;this.j=b;this.f=0;this.a=[];this.g=!1;this.h=this.Pf.bind(this)},zs=function(a){a.trigger(new _.D(_.Sd))},As=function(a,b){return 0<=b&&b<a.a.length};_.u(ys,_.Mh);_.h=ys.prototype;_.h.getPosition=function(){return this.f};_.h.hi=function(){return this.a};_.h.ee=function(){return 0<this.a.length&&As(this,this.f)?this.a[this.f]:null};
3
- _.h.ii=function(){var a=this.f+1;return 0<this.a.length&&As(this,a)?this.a[a]:null};_.h.mi=function(){return this.g};_.h.start=function(){this.g||(this.g=!0,this.l.on(_.Uc,this.h),this.wd(this.f,!0))};_.h.stop=function(){this.g=!1;this.l.off(_.Uc,this.h)};_.h.Pf=function(){this.next()};_.h.next=function(){var a=this,b;return _.z(function(c){b=Math.min(a.a.length-1,a.f+1);return _.v(c,a.wd(b),0)})};_.h.kj=function(){var a=this,b;return _.z(function(c){b=Math.max(0,a.f-1);return _.v(c,a.wd(b),0)})};
4
- _.h.wd=function(a,b){b=void 0===b?!1:b;var c=this,d;return _.z(function(e){if(1==e.a){if(!(0<c.a.length&&As(c,a))||!b&&c.f===a)return e["return"]();c.f=a;return(d=c.ee())?_.v(e,c.j(d),3):e.G(0)}if(4!=e.a)return _.v(e,c.l.load(d.configuration),4);c.trigger(new _.D(_.Rd,{item:d}));_.w(e)})};_.h.append=function(a){this.a.push(a);zs(this)};_.h.ki=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));zs(this)}};
5
- _.h.remove=function(a){if(0<this.a.length&&As(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);zs(this)}};_.h.clear=function(){this.stop();this.f=0;this.a=[];this.g=!1;zs(this)};_.A("clpp.Playlist",ys);ys.prototype.clear=ys.prototype.clear;ys.prototype.remove=ys.prototype.remove;ys.prototype.insert=ys.prototype.ki;ys.prototype.append=ys.prototype.append;ys.prototype.goTo=ys.prototype.wd;ys.prototype.previous=ys.prototype.kj;ys.prototype.next=ys.prototype.next;
6
- ys.prototype.onEnded=ys.prototype.Pf;ys.prototype.stop=ys.prototype.stop;ys.prototype.start=ys.prototype.start;ys.prototype.isStarted=ys.prototype.mi;ys.prototype.getUpcoming=ys.prototype.ii;ys.prototype.getCurrent=ys.prototype.ee;ys.prototype.getQueue=ys.prototype.hi;ys.prototype.getPosition=ys.prototype.getPosition;};
2
+ var f=function(window){var Us=function(a,b){b=void 0===b?function(){return Promise.resolve()}:b;_.Nh.call(this);this.l=a;this.j=b;this.f=0;this.a=[];this.g=!1;this.h=this.Pf.bind(this)},Vs=function(a){a.trigger(new _.E(_.Sd))},Ws=function(a,b){return 0<=b&&b<a.a.length};_.u(Us,_.Nh);_.h=Us.prototype;_.h.getPosition=function(){return this.f};_.h.li=function(){return this.a};_.h.ge=function(){return 0<this.a.length&&Ws(this,this.f)?this.a[this.f]:null};
3
+ _.h.mi=function(){var a=this.f+1;return 0<this.a.length&&Ws(this,a)?this.a[a]:null};_.h.ri=function(){return this.g};_.h.start=function(){this.g||(this.g=!0,this.l.on(_.Uc,this.h),this.wd(this.f,!0))};_.h.stop=function(){this.g=!1;this.l.off(_.Uc,this.h)};_.h.Pf=function(){this.next()};_.h.next=function(){var a=this,b;return _.z(function(c){b=Math.min(a.a.length-1,a.f+1);return _.v(c,a.wd(b),0)})};_.h.sj=function(){var a=this,b;return _.z(function(c){b=Math.max(0,a.f-1);return _.v(c,a.wd(b),0)})};
4
+ _.h.wd=function(a,b){b=void 0===b?!1:b;var c=this,d;return _.z(function(e){if(1==e.a){if(!(0<c.a.length&&Ws(c,a))||!b&&c.f===a)return e["return"]();c.f=a;return(d=c.ge())?_.v(e,c.j(d),3):e.H(0)}if(4!=e.a)return _.v(e,c.l.load(d.configuration),4);c.trigger(new _.E(_.Rd,{item:d}));_.w(e)})};_.h.append=function(a){this.a.push(a);Vs(this)};_.h.oi=function(a,b){if(0<=b&&b<=this.a.length){var c=this.ge();this.a.splice(b,0,a);c&&(this.f=this.a.indexOf(c));Vs(this)}};
5
+ _.h.remove=function(a){if(0<this.a.length&&Ws(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);Vs(this)}};_.h.clear=function(){this.stop();this.f=0;this.a=[];this.g=!1;Vs(this)};_.A("clpp.Playlist",Us);Us.prototype.clear=Us.prototype.clear;Us.prototype.remove=Us.prototype.remove;Us.prototype.insert=Us.prototype.oi;Us.prototype.append=Us.prototype.append;Us.prototype.goTo=Us.prototype.wd;Us.prototype.previous=Us.prototype.sj;Us.prototype.next=Us.prototype.next;
6
+ Us.prototype.onEnded=Us.prototype.Pf;Us.prototype.stop=Us.prototype.stop;Us.prototype.start=Us.prototype.start;Us.prototype.isStarted=Us.prototype.ri;Us.prototype.getUpcoming=Us.prototype.mi;Us.prototype.getCurrent=Us.prototype.ge;Us.prototype.getQueue=Us.prototype.li;Us.prototype.getPosition=Us.prototype.getPosition;};
7
7
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
8
8
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
9
9
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.smooth.js CHANGED
@@ -1,74 +1,74 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var sE="Full MP4 box must have flags defined",tE="clpp.smooth.SmoothMP4Processor",uE="codecPrivateData",vE=function(a,b){var c=Math.floor(b/Math.pow(2,32)),d=b-c*Math.pow(2,32);_.R(a,c);_.R(a,d)},wE=function(a,b){try{a.f.setUint8(a.a,b),a.a+=1}catch(c){_.xj()}},xE=function(a,b){wE(a,b>>16&255);wE(a,b>>8&255);wE(a,b&255)},yE=function(a,b){try{a.f.setUint16(a.a,b,a.g),a.a+=2}catch(c){_.xj()}},zE=function(a,b){try{a.f.setInt32(a.a,b,a.g),a.a+=4}catch(c){_.xj()}},AE=function(a,b){try{a.f.setInt16(a.a,
3
- b,a.g),a.a+=2}catch(c){_.xj()}},BE=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},V=function(a){this.type=a;this.size=this.start=0;this.parent=null;this.w=!1;this.entries=[];this.f=[]},W=function(a,b,c){V.call(this,a);this.version=b;this.flags=c},CE=function(a,b,c){V.call(this,a);this.g=b;this.offset=c},DE=function(a,b,c,d,e){W.call(this,
4
- a,b,c);this.g=d;this.offset=e},EE=function(a,b,c){V.call(this,"ftyp");this.h=a;this.If=b;this.g=c},FE=function(){V.call(this,_.rd)},GE=function(){V.call(this,_.ve)},HE=function(a,b,c){W.call(this,"mvhd",1,0);this.timescale=a;this.duration=b;this.volume=256;this.h=c+1;this.g=[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0]},IE=function(){V.call(this,"mvex")},JE=function(a){W.call(this,"trex",0,0);this.g=a},KE=function(a,b,c,d,e){W.call(this,"tkhd",1,7);this.h=a;this.duration=
5
- b;this.timescale=c;this.width=d;this.height=e;this.volume=1;this.g=[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0]},LE=function(a,b){W.call(this,"mdhd",1,0);this.timescale=a;this.duration=b;this.language=21956},ME=function(a){W.call(this,"hdlr",0,0);this.g=a},NE=function(){W.call(this,"vmhd",0,1);this.g=new Uint8Array([0,0,0,0,0,0])},OE=function(a){V.call(this,a);this.w=!0},PE=function(a){OE.call(this,a);this.height=this.width=0},QE=function(a,b,c,d){OE.call(this,a);this.channelCount=
6
- b;this.sampleSize=c;this.sampleRate=d},RE=function(a,b){PE.call(this,"avc1");this.width=a;this.height=b},SE=function(a,b){RE.call(this,a,b);this.type="encv"},TE=function(a,b,c){QE.call(this,"mp4a",a,b,c)},UE=function(a,b,c){TE.call(this,a,b,c);this.type="enca"},VE=function(a,b){V.call(this,"avcC");this.Fa=a;this.Lb=b;this.version=1;this.g=this.Fa[0][1];this.h=this.Fa[0][2];this.level=this.Fa[0][3]},WE=function(a){W.call(this,"esds",0,0);this.Eb=a},XE=function(a){a=void 0===a?"":a;W.call(this,"url ",
7
- 0,1);this.location=a},YE=function(){W.call(this,"dref",0,0)},ZE=function(){V.call(this,_.ke)},$E=function(){W.call(this,_.me,0,0)},aF=function(){W.call(this,"stts",0,0)},bF=function(){W.call(this,"stsc",0,0)},cF=function(){W.call(this,"stco",0,0)},dF=function(){W.call(this,"stsz",0,0)},eF=function(){W.call(this,"smhd",0,0)},fF=function(){V.call(this,"dinf")},gF=function(){V.call(this,_.qd)},hF=function(){V.call(this,_.md)},iF=function(a,b){W.call(this,"tfdt",a,0);this.g=b},jF=function(){W.call(this,
8
- "mfhd",0,0);this.g=0},kF=function(a,b){W.call(this,"trun",a,b);this.m=this.j=this.g=0;this.o=[];this.sampleSize=[];this.A=[];this.h=[]},lF=function(a,b){W.call(this,"tfhd",a,b);this.g=255;this.m=this.o=this.j=this.A=this.h=0},mF=function(){V.call(this,"traf")},nF=function(){V.call(this,"moof")},oF=function(){V.call(this,_.ld);this.g=new Uint8Array(0)},pF=function(){W.call(this,"tenc",0,0);this.g=1;this.h=8;this.m="";this.j=[]},qF=function(a,b){W.call(this,"schm",0,0);this.g=a;this.h=b;this.yb=""},
9
- rF=function(a){V.call(this,"frma");this.g=a},sF=function(){W.call(this,"saio",0,0);this.offset=[0]},tF=function(a,b,c){W.call(this,"saiz",0,0);this.g=a;this.j=b;this.h=c},uF=function(a,b){W.call(this,"senc",a,b);this.h=0;this.j=8;this.g=[]},vF=function(a){var b=a.split("/");return b[b.length-1].toLowerCase().match("manifest(\\(.+\\))?")?a:a+"/Manifest"},wF=function(a,b,c,d){c=b.xf[c];b=b.Fj;a=a.replace("Manifest","");b=b.replace("{bitrate}",String(d.bitrate)).replace("{Bitrate}",String(d.bitrate)).replace("{start time}",
10
- String(c.t)).replace("{start_time}",String(c.t));return _.Tt([a],[b])[0]},xF=function(a,b){if(a.type!==b.type)return!1;var c=[];a.type===_.Ge?c=["maxWidth","maxHeight","bitrate",uE,"fourCC"]:a.type===_.Zb&&(c=["bitrate",uE,"channels","bitsPerSample","samplingRate","fourCC"]);return _.H.Oa(a,b,c,["id","segmentIndex"])},yF=function(a,b,c){var d=c.nd.split("00000001");a={id:1,type:c.type,duration:a/b,timescale:b,Fa:null,Lb:null,width:NaN,height:NaN,Eb:null,Zc:NaN,sampleSize:NaN,channelCount:NaN};switch(c.type){case _.Ge:a.Fa=
11
- [_.gj(d[1])];a.Lb=[_.gj(d[2])];a.width=c.maxWidth;a.height=c.maxHeight;break;case _.Zb:a.Eb=_.gj(c.nd),a.sampleSize=c.Bg||16,a.Zc=c.Zc,a.channelCount=c.cf}return a},zF=function(a,b){return a.filter(function(c){return c.type===b})},AF=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)},HF=function(a,b,c){var d=null;if(BF.test(a)){a=BF.exec(a);d=Number(a[1]);var e=Number(a[2]),f=Number(a[3]),g=Number(a[4]);
12
- g+=(Number(a[5])||0)/c.f;f+=g/c.frameRate;d=f+60*e+3600*d}else CF.test(a)?d=AF(CF,a):DF.test(a)?d=AF(DF,a):EF.test(a)?(a=EF.exec(a),d=Number(a[1])/c.frameRate):FF.test(a)?(a=FF.exec(a),d=Number(a[1])/c.a):GF.test(a)&&(d=AF(GF,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},IF=function(a,b,c,d){this.frameRate=Number(a)||30;this.f=Number(b)||1;this.a=
13
- 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))},KF=function(a){this.a=a;this.f=JF(this)},JF=function(a){for(var b=0,c=0;c<a.a.length;c++)b+=a.a[c].a();return new _.wj(b)},LF=function(a){var b=_.gi();a="ie"===b.browser||"edge"===b.browser?a.fe(_.Ec):a.fe(_.Fc);null===a&&(_.B(tE,"Could not get PSSH box!"),a={initData:new Uint8Array(0),initDataType:_.pc,keyId:"",periodId:null});return a},MF=function(a,b,c){var d=
14
- LF(c);c=new V("xxxx");a.type===_.Ge?c=new SE(a.width,a.height):c=new UE(a.channelCount,a.sampleSize,a.Zc);a=new pF;a.g=1;a.h=8;a.m=d.keyId||"00000000000000000000000000000000";a=(new V("schi")).append([a]);b=(new V("sinf")).append([new rF(b),new qF(_.pc,65536),a]);c.append([b]);return c},NF=function(a,b){var c=b.yd(),d=new HE(a.timescale,a.duration,a.id),e=(new IE).append([new JE(a.id)]),f=new KE(a.id,a.duration,a.timescale,a.width,a.height),g=new LE(a.timescale,a.duration),k=new ME(a.type),l=null,
15
- m=new YE;m.entries=[new XE];var n=new $E;switch(a.type){case _.Ge:var p=new VE(a.Fa,a.Lb);c?(l=MF(a,"avc1",b),l.append([p]),n.entries=[l]):(l=(new RE(a.width,a.height)).append([p]),n.entries=[l]);l=new NE;break;case _.Zb:p=new WE(a.Eb),c?(l=MF(a,"mp4a",b),l.append([p]),n.entries=[l]):(l=(new TE(a.channelCount,a.sampleSize,a.Zc)).append([p]),n.entries=[l]),l=new eF}n=(new ZE).append([n,new aF,new bF,new dF,new cF]);m=(new fF).append([m]);m=(new gF).append([l,m,n]);g=(new hF).append([g,k,m]);f=(new GE).append([f,
16
- g]);d=(new FE).append([d,f,e]);e=new EE("dash",0,["iso6","mp41","avc1"]);c&&(c=LF(b).initData,d.append([new CE("pssh",c,8)]));c=new KF([e,d]);return _.Q(c.write())},PF=function(a,b){var c,d,e,f,g,k;(new _.pk).L("moof",_.qk).U("mfhd",function(m){var n=new jF;n.g=_.Dj(m.F);c=n}).L("traf",_.qk).U("tfhd",function(m){var n=m.F.Aa();if(null===m.flags)throw new _.J(_.K,3,3019,sE);var p=new lF(m.version||0,m.flags||0);p.g=_.Dj(m.F);0<n-m.F.getPosition()&&m.flags&1&&(p.h=_.Fj(m.F));0<n-m.F.getPosition()&&
17
- m.flags&2&&(p.A=_.Dj(m.F));0<n-m.F.getPosition()&&m.flags&8&&(p.j=_.Dj(m.F));0<n-m.F.getPosition()&&m.flags&16&&(p.o=_.Dj(m.F));0<n-m.F.getPosition()&&m.flags&32&&(p.m=_.Dj(m.F));d=p}).U("trun",function(m){var n=m.F.Aa();if(null===m.flags)throw new _.J(_.K,3,3019,sE);var p=new kF(m.version||0,m.flags||0);p.g=_.Dj(m.F);0<n-m.F.getPosition()&&m.flags&1&&(p.j=_.Ej(m.F));0<n-m.F.getPosition()&&m.flags&4&&(p.m=_.Dj(m.F));if(0<n-m.F.getPosition())for(n=0;n<p.g;n++)m.flags&256&&p.o.push(_.Dj(m.F)),m.flags&
18
- 512&&p.sampleSize.push(_.Dj(m.F)),m.flags&1024&&p.A.push(_.Dj(m.F)),m.flags&2048&&(0===m.version?p.h.push(_.Dj(m.F)):p.h.push(_.Ej(m.F)));e=p}).U("sdtp",function(m){var n=_.Gj(m.F,m.F.Aa());f=new DE("sdtp",m.version||0,m.flags||0,n,0)}).L("uuid",function(m){var n=_.Gj(m.F,16);if(_.ij(n,OF)){n=_.Dj(m.F);m.version=n>>>24;m.flags=n&16777215;n=new uF(m.version,m.flags);n.h=_.Dj(m.F);m.flags&1&&(n.j=_.Ct(m.F));for(var p=0;p<n.h;p++){var q={Bf:_.Gj(m.F,8),Ic:0,Oe:[]};if(m.flags&2){q.Ic=_.Cj(m.F);for(var r=
19
- 0;r<q.Ic;r++){var x={af:0,bf:0};x.af=_.Cj(m.F);x.bf=_.Dj(m.F);q.Oe.push(x)}}n.g.push(q)}g=n}}).L(_.ld,function(m){var n=new oF;0<m.F.Aa()?n.g=_.Gj(m.F,m.F.Aa()):(_.B(tE,"mdat box is empty!"),n.g=new Uint8Array(0));k=n}).parse(a,!1);if(!k)return null;var l=(new mF).append([d,e]);f&&l.append([f]);b.yd()&&g&&l.append([g]);l=(new nF).append([c,l]);return new KF([l,k])},QF=function(a,b,c){var d=c.yd(),e=a.request.startTime,f=parseInt(e*b,10);b=a.data||new ArrayBuffer(0);var g=PF(b,c);if(null===g)return a.request.contentType===
20
- _.re?a.data:g;c=g.get(_.ld);if(a.request.contentType===_.re){d=c.g.buffer;if(e){d=_.Tg(d);if((d=(new DOMParser).parseFromString(d,_.te))&&"tt"===d.documentElement.tagName.toLowerCase())var k=d.documentElement;if(k&&(c=new IF(k.getAttribute("ttp:frameRate"),k.getAttribute("ttp:subFrameRate"),k.getAttribute("ttp:frameRateMultiplier"),k.getAttribute("ttp:tickRate")),k=k.getElementsByTagName("body")[0]))for(k=k.getElementsByTagName("p"),a=0,b=k.length;a<b;a++){f=k[a];g=["begin",_.Tc];for(var l=0,m=g.length;l<
21
- m;l++){b:{var n=f;var p=g[l],q=new RegExp("\\w+:"+p),r=0;if(n.hasAttribute(p))n=n.getAttribute(p);else{p=n.attributes;for(var x=p.length;r<x;r++){var y=p[r].name;if(y=y.match(q)){n=n.getAttribute(y[0]);break b}}n=null}}f.setAttribute(g[l],HF(n||"",e,c))}}d=(new XMLSerializer).serializeToString(d);e=_.Ug(d).buffer}else e=d;return e}k=new nF;a=g.get("mfhd");b=new mF;l=g.get("tfhd");m=new iF(1,f);f=g.get("trun");n=g.get("sdtp");e=g.get("senc");l.g=1;l.flags&=16777214;l.flags|=131072;b.append([l,m,f]);
22
- n&&b.append([n]);if(d){g=0;l=[];if(e.flags&2)for(l=[],m=0;m<e.h;m++)l.push(10+6*e.g[m].Ic);else g=8;b.append([e,new sF,new tF(g,l,e.h)])}k.append([a,b]);f.flags|=1;f.j=k.a()+8;c=new KF([k,c]);k=c.write();d&&(d=c.get("saio"),c=c.f,d.offset[0]=e.start+16,c.seek(d.start),d.write(c),k=c.buffer);return k},RF=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[b],keyIds:c,
23
- periodId:null}},SF=function(a,b,c){a=_.pu(a);c&&a.version!==c&&(a=_.nu(a,c));return{initData:_.gu(a),initDataType:_.pc,keyId:b,periodId:null}},UF=function(){this.B=this.j=this.h=this.g=null;this.M=1;this.T=0;this.o="";this.w=this.a=null;this.f=new _.C("clpp.smooth.SmoothParser");this.J=!1;this.m=this.C=null;this.P=TF;this.H=0;this.D=this.I=Infinity;this.A=[];this.K=this.qj.bind(this)},VF=function(a,b){var c,d,e;return _.z(function(f){if(1==f.a)return c=_.fh(b),c.timeout=a.h.attemptParameters.timeout,
24
- c.maxAttempts=Math.max(a.h.attemptParameters.maxAttempts,b.length),c.baseDelay=a.h.attemptParameters.baseDelay,c.backoffFactor=a.h.attemptParameters.backoffFactor,c.fuzzFactor=a.h.attemptParameters.fuzzFactor,c.type=1,d=a.g.networkingEngine.fetch(c),_.v(f,d.N,2);e=f.f;a.o=e.uri;return f["return"](e)})},bG=function(a,b){var c=null;try{var d=new DOMParser;try{var e=_.Tg(b);var f=d.parseFromString(e.trim(),_.te)}catch(PA){throw PA;}if(f&&f.documentElement.tagName==_.kb)var g=f.documentElement;c=g&&0<
25
- g.getElementsByTagName("parsererror").length?null:g}catch(PA){}if(!c)throw a.f.error("Unable to parse manifest"),new _.J(_.K,4,4033,a.o);var k=+WF(a,c,"MajorVersion"),l=+WF(a,c,"MinorVersion"),m=+c.getAttribute("TimeScale")||1E7,n=+WF(a,c,"Duration"),p="TRUE"===c.getAttribute("IsLive"),q=+c.getAttribute("LookAheadCount"),r=+c.getAttribute("DVRWindowLength")||Infinity,x=_.au(c,"Protection")[0];if(!1===/^[2].[0-2]$/.test(""+k+"."+l))throw a.f.error("Smooth Streaming version must be 2.0, 2.1 or 2.2"),
26
- new _.J(_.K,4,4036,a.o);p?(XF(a,YF),a.C=typeof a.h.liveRefreshPeriod===_.zd?1E3*a.h.liveRefreshPeriod:Math.min(1E3*a.H,1E4),n=Infinity):XF(a,TF);a.a={startTime:0,delay:0,duration:n/m,ae:r/m,Vc:0};if(x){var y=a.h.playreadyVersion,E=[],I=_.au(x,"ProtectionHeader")[0],F=_.fj(_.cu(I)||""),G=_.pu(F).a;E.push(RF(_.Fc,{initData:_.gu(_.ju(G)),initDataType:_.pc,keyId:G,periodId:null},[G]));E.push(RF(_.Ec,SF(F,G,y),[G]));a.A=E}var M=[],O=_.au(c,"StreamIndex");if(!O.length)throw a.f.error("No streams found!"),
27
- new _.J(_.K,4,4034,a.o);for(var T=0;T<O.length;T++){for(var Ma,ea=a,na=O[T],ya=WF(ea,na,"Type"),Aa=+na.getAttribute("Chunks"),Ra=na.getAttribute("Subtype"),Sa=_.rh(na.getAttribute("Language")||_.xe),xa=na.getAttribute("Name")||"",ib=+na.getAttribute(_.Oa),eb=+na.getAttribute(_.Na),Bb=WF(ea,na,"Url"),ud=+na.getAttribute("TimeScale")||null,Di=[],vc=_.au(na,_.ab),Qf=0;Qf<vc.length;Qf++){var Ze=ea,Vc=vc[Qf],zr=ya,BJ=+Vc.getAttribute("Index"),CJ=+WF(Ze,Vc,"Bitrate"),SA=NaN,TA=NaN,hm=NaN,Ar=NaN,UA=NaN,
28
- VA=NaN,WA=NaN,XA=Vc.getAttribute("FourCC");switch(zr){case _.Ge:SA=+WF(Ze,Vc,_.Na);TA=+WF(Ze,Vc,_.Oa);break;case _.Zb:Ar=+Vc.getAttribute("Channels")||2,hm=+WF(Ze,Vc,"SamplingRate"),VA=+WF(Ze,Vc,"AudioTag"),UA=+WF(Ze,Vc,"BitsPerSample"),WA=+WF(Ze,Vc,"PacketSize")}var Br=String(Vc.getAttribute("CodecPrivateData"));if(zr===_.Zb&&!Br){var YA=Ar,ZA={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},im=ZA[hm];if("AACH"===XA){var fc=new Uint8Array(4);var $A=
29
- ZA[2*hm];fc[0]=40|im>>1;fc[1]=im<<7|YA<<3|$A>>1;fc[2]=$A<<7|8;fc[3]=0;var Tf=new Uint16Array(2);Tf[0]=(fc[0]<<8)+fc[1];Tf[1]=(fc[2]<<8)+fc[3];var aB=Tf[0].toString(16)+Tf[1].toString(16)}else fc=new Uint8Array(2),fc[0]=16|im>>1,fc[1]=im<<7|YA<<3,Tf=new Uint16Array(1),Tf[0]=(fc[0]<<8)+fc[1],aB=Tf[0].toString(16);Br=aB.toUpperCase()}var DJ={id:Ze.T++,type:zr,index:BJ,bitrate:CJ,nd:Br,maxHeight:SA,maxWidth:TA,Zc:hm,cf:Ar,Wj:VA,Bg:UA,fk:WA,$h:XA,fb:null};Di.push(DJ)}Ma=Di;for(var je=[],bB=_.au(na,"c"),
30
- Ti=0;Ti<bB.length;Ti++){var Cr=bB[Ti],vd=parseInt(Cr.getAttribute("t"),10),ih=parseInt(Cr.getAttribute("d"),10),Dr=parseInt(Cr.getAttribute("r"),10),Ui=0;if(isNaN(vd)&&isNaN(ih))throw ea.f.error("Either one or both FragmentDuration and FragmentTime field MUST be present in StreamFragmentElement"),new _.J(_.K,4,4037,ea.o);0===Ti&&isNaN(vd)&&(Ui=vd=0);if(0<Ti){var Uf=je[je.length-1];Ui=Uf.n+1;Uf.d||(Uf.d=vd-Uf.t);vd||(vd=Uf.t+Uf.d);ih||(ih=vd-Uf.t)}je.push({n:Ui,d:ih,t:vd});if(Dr){Dr--;for(var cB=0;cB<
31
- Dr;cB++){var jm=je[je.length-1];Ui=jm.n+1;vd=jm.t+jm.d;ih=jm.d;je.push({n:Ui,d:ih,t:vd})}}}ea.Qc()||je.length===Aa||ea.f.warn("Number of fragments ("+Aa+") differs from number of chunks ("+je.length+").");M.push({type:ya,Xj:Aa,zj:Ra,language:Sa,name:xa,maxWidth:ib,maxHeight:eb,Fj:Bb,tracks:Ma,xf:je,timescale:ud})}var $e={dk:k,If:l,timescale:m,duration:n,isLive:p,ck:q,ae:r,me:!1,streams:M};if(a.j&&a.B)return ZF(a,$e),Promise.resolve();var Er=$e.timescale,Fr=$e.duration,FJ=zF($e.streams,_.Zb),GJ=zF($e.streams,
32
- _.Ge),HJ=zF($e.streams,_.re),dB=[],km=$F(a,Fr,Er,FJ),lm=$F(a,Fr,Er,GJ),IJ=$F(a,Fr,Er,HJ);km.length||(km=[null]);lm.length||(lm=[null]);for(var Hr=0;Hr<lm.length;Hr++)for(var Ir=0;Ir<km.length;Ir++)dB.push(aG(a,lm[Hr],km[Ir]));var eB={startTime:0,variants:dB,textStreams:IJ,thumbStreams:[]};var KJ=$e.streams,Jr=a.a.startTime,fB=a.a.delay,Kr=a.I,gB=Math.min(a.a.duration||Infinity,Kr),Lr=a.Qc(),LJ=a.a.ae,MJ=a.a.Vc,hB=a.H,iB=isFinite(a.D)?a.D:0;if(Lr)gB=Infinity,Jr=Date.now()/1E3-MJ,a.a.startTime=Jr,fB=
33
- 3*hB;else for(var NJ=isFinite(Kr)?Kr:a.a.duration,jB=_.t(KJ),Mr=jB.next();!Mr.done;Mr=jB.next())for(var kB=_.t(Mr.value.tracks),Nr=kB.next();!Nr.done;Nr=kB.next()){var lB=Nr.value;lB.fb.offset(-iB);_.Ju(lB.fb,NJ)}a.w=new _.xu(Jr,fB,!0);a.w.f=!Lr;a.w.Pb(gB);_.Au(a.w,hB);a.w.hc=LJ;Lr||a.w.offset(-iB);a.g.filterAllPeriods([eB]);a.j={presentationTimeline:a.w,periods:[eB],offlineSessionIds:[],minBufferTime:0};Promise.resolve();a.J||(a.g.networkingEngine.Td(a.K),a.J=!0);a.B=$e;return Promise.resolve()},
34
- ZF=function(a,b){for(var c=0;c<a.B.streams.length;c++)for(var d=b.streams[c],e={},f=_.t(a.B.streams[c].tracks),g=f.next();!g.done;e={Db:e.Db},g=f.next())if(e.Db=g.value,g=d.tracks.find(function(l){return function(m){return m.type===l.Db.type&&m.bitrate===l.Db.bitrate}}(e))){xF(e.Db,g)||a.f.warn("The current stream is updated with a stream that seems to have different base properties!");var k=cG(a,a.B.timescale,d,g);g=e.Db.fb;g.Sa(k);(k=a.a.ae)&&_.Iu(g,(g.a.length?g.a[g.a.length-1].endTime:0)-k)}else a.f.warn("Cannot find satisfying update for "+
35
- e.Db.type+" track with bitrate "+(e.Db.bitrate+". Skipping update."))},$F=function(a,b,c,d){for(var e=[],f={qc:0};f.qc<d.length;f={qc:f.qc},f.qc++){var g=d[f.qc].tracks.map(function(k){return function(l){var m=d[k.qc],n=cG(a,c,m,l),p=new _.Hu(n),q=null;m.type!==_.re&&(q=dG(a,b,c,m,l));l.fb=p;n=a.M++;var r=Promise.resolve.bind(Promise),x=p.Pc.bind(p),y=p.get.bind(p),E=p.Kc.bind(p);p=p.getDuration.bind(p);var I=eG[m.type],F="";switch(m.type){case _.Ge:F=l.nd;var G=/00000001[0-9]7/.exec(F);F="avc1."+
36
- (G&&G[0]?F.substr(F.indexOf(G[0])+10,6):"42c00c");a.f.debug("VIDEO CODECS: ",F);break;case _.Zb:F=l.nd,G=2,"AACH"===l.$h?G=5:F&&(G=(parseInt(F.substr(0,2),16)&248)>>3),F="mp4a.40."+G,a.f.debug("AUDIO CODECS: ",F)}G=m.type===_.re?fG[m.zj]:void 0;return{id:n,originalId:null,hk:null,createSegmentIndex:r,findSegmentPosition:x,getSegmentReference:y,adjustSegmentDurations:E,getDuration:p,initSegmentReference:q,mimeType:I,codecs:F,frameRate:void 0,bandwidth:l.bitrate,width:l.maxWidth||void 0,height:l.maxHeight||
37
- void 0,kind:G,encrypted:a.oe(),keyId:null,language:m.language,label:m.name,type:m.type,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:l.cf||null,closedCaptions:null}}}(f));e=e.concat(g)}return e},cG=function(a,b,c,d){var e=0,f=[],g=c.timescale||b;c.xf.forEach(function(k,l){var m=k.d/g;if(0===l){var n=k.t/g;a.D=Math.min(a.D,n)}else n=f[l-1].endTime;var p=n+m,q=wF(a.o,c,l,d);a.H=Math.max(a.H,m);f.push(new _.wu(l,n,p,function(){return[q]},0,null,0,null,!0,g));e+=m});if(c.type===
38
- _.Ge||c.type===_.Zb)b=f[f.length-1],a.I=Math.min(a.I,e),0===a.a.Vc?a.a.Vc=b.endTime:a.a.Vc=Math.min(a.a.Vc,b.endTime);return f},dG=function(a,b,c,d,e){b=yF(b,d.timescale||c,e);c={isLive:a.Qc.bind(a),yd:a.oe.bind(a),ei:function(){return 1},fe:a.zf.bind(a)};d=new Uint8Array(0);try{d=NF(b,c)}catch(g){throw a.f.error("Failed to generate initialization segment."),new _.J(_.K,3,4035,g);}var f="data:text/plain;base64,"+_.ej(d);return new _.vu(function(){return[f]},0,null,null,!0)},aG=function(a,b,c){var d=
39
- (c?c.bandwidth:0)+(b?b.bandwidth:0),e=c?c.language:_.xe;return c||b?{id:a.M++,language:e,primary:!1,audio:c,video:b,bandwidth:d,drmInfos:a.A,allowedByApplication:!0,allowedByKeySystem:!0}:null},WF=function(a,b,c){if(b=b.getAttribute(c))return b;a.f.error("required attribute not provided: "+c);throw new _.J(_.K,4,4038,a.o,c);},gG=function(a,b){null!=a.C&&null!=b&&(a.m=window.setTimeout(a.yh.bind(a),b))},XF=function(a,b){var c=b===TF;a.j&&a.j.presentationTimeline&&(a.j.presentationTimeline.f=c);c&&
40
- null!=a.m&&(window.clearTimeout(a.m),a.m=null,a.C=null);a.P=b},hG=function(){};V.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};V.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};
2
+ var f=function(window){var PE="Full MP4 box must have flags defined",QE="clpp.smooth.SmoothMP4Processor",RE="codecPrivateData",SE=function(a,b){var c=Math.floor(b/Math.pow(2,32)),d=b-c*Math.pow(2,32);_.R(a,c);_.R(a,d)},TE=function(a,b){try{a.f.setUint8(a.a,b),a.a+=1}catch(c){_.yj()}},UE=function(a,b){TE(a,b>>16&255);TE(a,b>>8&255);TE(a,b&255)},VE=function(a,b){try{a.f.setUint16(a.a,b,a.g),a.a+=2}catch(c){_.yj()}},WE=function(a,b){try{a.f.setInt32(a.a,b,a.g),a.a+=4}catch(c){_.yj()}},XE=function(a,b){try{a.f.setInt16(a.a,
3
+ b,a.g),a.a+=2}catch(c){_.yj()}},YE=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},V=function(a){this.type=a;this.size=this.start=0;this.parent=null;this.w=!1;this.entries=[];this.f=[]},W=function(a,b,c){V.call(this,a);this.version=b;this.flags=c},ZE=function(a,b,c){V.call(this,a);this.g=b;this.offset=c},$E=function(a,b,c,d,e){W.call(this,
4
+ a,b,c);this.g=d;this.offset=e},aF=function(a,b,c){V.call(this,"ftyp");this.h=a;this.Jf=b;this.g=c},bF=function(){V.call(this,_.rd)},cF=function(){V.call(this,_.we)},dF=function(a,b,c){W.call(this,"mvhd",1,0);this.timescale=a;this.duration=b;this.volume=256;this.h=c+1;this.g=[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0]},eF=function(){V.call(this,"mvex")},fF=function(a){W.call(this,"trex",0,0);this.g=a},gF=function(a,b,c,d,e){W.call(this,"tkhd",1,7);this.h=a;this.duration=
5
+ b;this.timescale=c;this.width=d;this.height=e;this.volume=1;this.g=[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0]},hF=function(a,b){W.call(this,"mdhd",1,0);this.timescale=a;this.duration=b;this.language=21956},iF=function(a){W.call(this,"hdlr",0,0);this.g=a},jF=function(){W.call(this,"vmhd",0,1);this.g=new Uint8Array([0,0,0,0,0,0])},kF=function(a){V.call(this,a);this.w=!0},lF=function(a){kF.call(this,a);this.height=this.width=0;this.depth=24},mF=function(a,b,c,d){kF.call(this,
6
+ a);this.channelCount=b;this.sampleSize=c;this.sampleRate=d},nF=function(a,b){lF.call(this,"avc1");this.width=a;this.height=b},oF=function(a,b){nF.call(this,a,b);this.type="encv"},pF=function(a,b,c){mF.call(this,"mp4a",a,b,c)},qF=function(a,b,c){pF.call(this,a,b,c);this.type="enca"},rF=function(a,b){V.call(this,"avcC");this.Ga=a;this.Lb=b;this.version=1;this.g=this.Ga[0][1];this.h=this.Ga[0][2];this.level=this.Ga[0][3]},sF=function(a){W.call(this,"esds",0,0);this.Eb=a},tF=function(a){a=void 0===a?
7
+ "":a;W.call(this,"url ",0,1);this.location=a},uF=function(){W.call(this,"dref",0,0)},vF=function(){V.call(this,_.je)},wF=function(){W.call(this,_.me,0,0)},xF=function(){W.call(this,"stts",0,0)},yF=function(){W.call(this,"stsc",0,0)},zF=function(){W.call(this,"stco",0,0)},AF=function(){W.call(this,"stsz",0,0)},BF=function(){W.call(this,"smhd",0,0)},CF=function(){V.call(this,"dinf")},DF=function(){V.call(this,_.qd)},EF=function(){V.call(this,_.md)},FF=function(a,b){W.call(this,"tfdt",a,0);this.g=b},
8
+ GF=function(){W.call(this,"mfhd",0,0);this.g=0},HF=function(a,b){W.call(this,"trun",a,b);this.m=this.j=this.g=0;this.o=[];this.sampleSize=[];this.A=[];this.h=[]},IF=function(a,b){W.call(this,"tfhd",a,b);this.g=255;this.m=this.o=this.j=this.A=this.h=0},JF=function(){V.call(this,"traf")},KF=function(){V.call(this,"moof")},LF=function(){V.call(this,_.ld);this.g=new Uint8Array(0)},MF=function(){W.call(this,"tenc",0,0);this.g=1;this.h=8;this.m="";this.j=[]},NF=function(a,b){W.call(this,"schm",0,0);this.g=
9
+ a;this.h=b;this.yb=""},OF=function(a){V.call(this,"frma");this.g=a},PF=function(){W.call(this,"saio",0,0);this.offset=[0]},QF=function(a,b,c){W.call(this,"saiz",0,0);this.g=a;this.j=b;this.h=c},RF=function(a,b){W.call(this,"senc",a,b);this.h=0;this.j=8;this.g=[]},SF=function(a){var b=a.split("/");return b[b.length-1].toLowerCase().match("manifest(\\(.+\\))?")?a:a+"/Manifest"},TF=function(a,b,c,d){c=b.zf[c];b=b.Nj;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 _.nu([a],[b])[0]},UF=function(a,b){if(a.type!==b.type)return!1;var c=[];a.type===_.He?c=["maxWidth","maxHeight","bitrate",RE,"fourCC"]:a.type===_.Zb&&(c=["bitrate",RE,"channels","bitsPerSample","samplingRate","fourCC"]);return _.H.Oa(a,b,c,["id","segmentIndex"])},VF=function(a,b,c){var d=c.nd.split("00000001");a={id:1,type:c.type,duration:a/b,timescale:b,Ga:null,Lb:null,width:NaN,height:NaN,Eb:null,$c:NaN,
11
+ sampleSize:NaN,channelCount:NaN};switch(c.type){case _.He:a.Ga=[_.hj(d[1])];a.Lb=[_.hj(d[2])];a.width=c.maxWidth;a.height=c.maxHeight;break;case _.Zb:a.Eb=_.hj(c.nd),a.sampleSize=c.Eg||16,a.$c=c.$c,a.channelCount=c.ef}return a},WF=function(a,b){return a.filter(function(c){return c.type===b})},XF=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)},dG=function(a,b,c){var d=null;if(YF.test(a)){a=YF.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 ZF.test(a)?d=XF(ZF,a):$F.test(a)?d=XF($F,a):aG.test(a)?(a=aG.exec(a),d=Number(a[1])/c.frameRate):bG.test(a)?(a=bG.exec(a),d=Number(a[1])/c.a):cG.test(a)&&(d=XF(cG,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},eG=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))},gG=function(a){this.a=a;this.f=fG(this)},fG=function(a){for(var b=0,c=0;c<a.a.length;c++)b+=a.a[c].a();return new _.xj(b)},hG=function(a){var b=_.hi();a="ie"===b.browser||"edge"===b.browser?a.he(_.Ec):a.he(_.Fc);null===a&&(_.B(QE,"Could not get PSSH box!"),a={initData:new Uint8Array(0),initDataType:_.pc,
14
+ keyId:"",periodId:null});return a},iG=function(a,b,c){var d=hG(c);c=new V("xxxx");a.type===_.He?c=new oF(a.width,a.height):c=new qF(a.channelCount,a.sampleSize,a.$c);a=new MF;a.g=1;a.h=8;a.m=d.keyId||"00000000000000000000000000000000";a=(new V("schi")).append([a]);b=(new V("sinf")).append([new OF(b),new NF(_.pc,65536),a]);c.append([b]);return c},jG=function(a,b){var c=b.zd(),d=new dF(a.timescale,a.duration,a.id),e=(new eF).append([new fF(a.id)]),f=new gF(a.id,a.duration,a.timescale,a.width,a.height),
15
+ g=new hF(a.timescale,a.duration),k=new iF(a.type),l=null,m=new uF;m.entries=[new tF];var n=new wF;switch(a.type){case _.He:var p=new rF(a.Ga,a.Lb);c?(l=iG(a,"avc1",b),l.append([p]),n.entries=[l]):(l=(new nF(a.width,a.height)).append([p]),n.entries=[l]);l=new jF;break;case _.Zb:p=new sF(a.Eb),c?(l=iG(a,"mp4a",b),l.append([p]),n.entries=[l]):(l=(new pF(a.channelCount,a.sampleSize,a.$c)).append([p]),n.entries=[l]),l=new BF}n=(new vF).append([n,new xF,new yF,new AF,new zF]);m=(new CF).append([m]);m=(new DF).append([l,
16
+ m,n]);g=(new EF).append([g,k,m]);f=(new cF).append([f,g]);d=(new bF).append([d,f,e]);e=new aF("dash",0,["iso6","mp41","avc1"]);c&&(c=hG(b).initData,d.append([new ZE("pssh",c,8)]));c=new gG([e,d]);return _.Q(c.write())},lG=function(a,b){var c,d,e,f,g,k;(new _.qk).M("moof",_.rk).V("mfhd",function(m){var n=new GF;n.g=_.Ej(m.F);c=n}).M("traf",_.rk).V("tfhd",function(m){var n=m.F.Ba();if(null===m.flags)throw new _.J(_.K,3,3019,PE);var p=new IF(m.version||0,m.flags||0);p.g=_.Ej(m.F);0<n-m.F.getPosition()&&
17
+ m.flags&1&&(p.h=_.Gj(m.F));0<n-m.F.getPosition()&&m.flags&2&&(p.A=_.Ej(m.F));0<n-m.F.getPosition()&&m.flags&8&&(p.j=_.Ej(m.F));0<n-m.F.getPosition()&&m.flags&16&&(p.o=_.Ej(m.F));0<n-m.F.getPosition()&&m.flags&32&&(p.m=_.Ej(m.F));d=p}).V("trun",function(m){var n=m.F.Ba();if(null===m.flags)throw new _.J(_.K,3,3019,PE);var p=new HF(m.version||0,m.flags||0);p.g=_.Ej(m.F);0<n-m.F.getPosition()&&m.flags&1&&(p.j=_.Fj(m.F));0<n-m.F.getPosition()&&m.flags&4&&(p.m=_.Ej(m.F));if(0<n-m.F.getPosition())for(n=
18
+ 0;n<p.g;n++)m.flags&256&&p.o.push(_.Ej(m.F)),m.flags&512&&p.sampleSize.push(_.Ej(m.F)),m.flags&1024&&p.A.push(_.Ej(m.F)),m.flags&2048&&(0===m.version?p.h.push(_.Ej(m.F)):p.h.push(_.Fj(m.F)));e=p}).V("sdtp",function(m){var n=_.Hj(m.F,m.F.Ba());f=new $E("sdtp",m.version||0,m.flags||0,n,0)}).M("uuid",function(m){var n=_.Hj(m.F,16);if(_.jj(n,kG)){n=_.Ej(m.F);m.version=n>>>24;m.flags=n&16777215;n=new RF(m.version,m.flags);n.h=_.Ej(m.F);m.flags&1&&(n.j=_.Xt(m.F));for(var p=0;p<n.h;p++){var q={Df:_.Hj(m.F,
19
+ 8),Jc:0,Qe:[]};if(m.flags&2){q.Jc=_.Dj(m.F);for(var r=0;r<q.Jc;r++){var x={cf:0,df:0};x.cf=_.Dj(m.F);x.df=_.Ej(m.F);q.Qe.push(x)}}n.g.push(q)}g=n}}).M(_.ld,function(m){var n=new LF;0<m.F.Ba()?n.g=_.Hj(m.F,m.F.Ba()):(_.B(QE,"mdat box is empty!"),n.g=new Uint8Array(0));k=n}).parse(a,!1);if(!k)return null;var l=(new JF).append([d,e]);f&&l.append([f]);b.zd()&&g&&l.append([g]);l=(new KF).append([c,l]);return new gG([l,k])},mG=function(a,b,c){var d=c.zd(),e=a.request.startTime,f=parseInt(e*b,10);b=a.data||
20
+ new ArrayBuffer(0);var g=lG(b,c);if(null===g)return a.request.contentType===_.se?a.data:g;c=g.get(_.ld);if(a.request.contentType===_.se){d=c.g.buffer;if(e){d=_.Ug(d);if((d=(new DOMParser).parseFromString(d,_.ue))&&"tt"===d.documentElement.tagName.toLowerCase())var k=d.documentElement;if(k&&(c=new eG(k.getAttribute("ttp:frameRate"),k.getAttribute("ttp:subFrameRate"),k.getAttribute("ttp:frameRateMultiplier"),k.getAttribute("ttp:tickRate")),k=k.getElementsByTagName("body")[0]))for(k=k.getElementsByTagName("p"),
21
+ a=0,b=k.length;a<b;a++){f=k[a];g=["begin",_.Tc];for(var l=0,m=g.length;l<m;l++){b:{var n=f;var p=g[l],q=new RegExp("\\w+:"+p),r=0;if(n.hasAttribute(p))n=n.getAttribute(p);else{p=n.attributes;for(var x=p.length;r<x;r++){var y=p[r].name;if(y=y.match(q)){n=n.getAttribute(y[0]);break b}}n=null}}f.setAttribute(g[l],dG(n||"",e,c))}}d=(new XMLSerializer).serializeToString(d);e=_.Vg(d).buffer}else e=d;return e}k=new KF;a=g.get("mfhd");b=new JF;l=g.get("tfhd");m=new FF(1,f);f=g.get("trun");n=g.get("sdtp");
22
+ e=g.get("senc");l.g=1;l.flags&=16777214;l.flags|=131072;b.append([l,m,f]);n&&b.append([n]);if(d){g=0;l=[];if(e.flags&2)for(l=[],m=0;m<e.h;m++)l.push(10+6*e.g[m].Jc);else g=8;b.append([e,new PF,new QF(g,l,e.h)])}k.append([a,b]);f.flags|=1;f.j=k.a()+8;c=new gG([k,c]);k=c.write();d&&(d=c.get("saio"),c=c.f,d.offset[0]=e.start+16,c.seek(d.start),d.write(c),k=c.buffer);return k},nG=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",
23
+ videoRobustness:"",serverCertificate:null,initData:[b],keyIds:c,periodId:null}},oG=function(a,b,c){a=_.Ku(a);c&&a.version!==c&&(a=_.Iu(a,c));return{initData:_.Bu(a),initDataType:_.pc,keyId:b,periodId:null}},qG=function(){this.B=this.j=this.h=this.g=null;this.L=1;this.T=0;this.o="";this.w=this.a=null;this.f=new _.D("clpp.smooth.SmoothParser");this.J=!1;this.m=this.C=null;this.O=pG;this.G=0;this.D=this.I=Infinity;this.A=[];this.K=this.yj.bind(this)},rG=function(a,b){var c,d,e;return _.z(function(f){if(1==
24
+ f.a)return c=_.gh(b),c.timeout=a.h.attemptParameters.timeout,c.maxAttempts=Math.max(a.h.attemptParameters.maxAttempts,b.length),c.baseDelay=a.h.attemptParameters.baseDelay,c.backoffFactor=a.h.attemptParameters.backoffFactor,c.fuzzFactor=a.h.attemptParameters.fuzzFactor,c.type=1,d=a.g.networkingEngine.fetch(c),_.v(f,d.N,2);e=f.f;a.o=e.uri;return f["return"](e)})},yG=function(a,b){var c=null;try{var d=new DOMParser;try{var e=_.Ug(b);var f=d.parseFromString(e.trim(),_.ue)}catch(gB){throw gB;}if(f&&f.documentElement.tagName==
25
+ _.kb)var g=f.documentElement;c=g&&0<g.getElementsByTagName("parsererror").length?null:g}catch(gB){}if(!c)throw a.f.error("Unable to parse manifest"),new _.J(_.K,4,4033,a.o);var k=+sG(a,c,"MajorVersion"),l=+sG(a,c,"MinorVersion"),m=+c.getAttribute("TimeScale")||1E7,n=+sG(a,c,"Duration"),p="TRUE"===c.getAttribute("IsLive"),q=+c.getAttribute("LookAheadCount"),r=+c.getAttribute("DVRWindowLength")||Infinity,x=_.vu(c,"Protection")[0];if(!1===/^[2].[0-2]$/.test(""+k+"."+l))throw a.f.error("Smooth Streaming version must be 2.0, 2.1 or 2.2"),
26
+ new _.J(_.K,4,4036,a.o);p?(tG(a,uG),a.C=typeof a.h.liveRefreshPeriod===_.zd?1E3*a.h.liveRefreshPeriod:Math.min(1E3*a.G,1E4),n=Infinity):tG(a,pG);a.a={startTime:0,delay:0,duration:n/m,ce:r/m,Wc:0};if(x){var y=a.h.playreadyVersion,C=[],I=_.vu(x,"ProtectionHeader")[0],F=_.gj(_.xu(I)||""),G=_.Ku(F).a;C.push(nG(_.Fc,{initData:_.Bu(_.Eu(G)),initDataType:_.pc,keyId:G,periodId:null},[G]));C.push(nG(_.Ec,oG(F,G,y),[G]));a.A=C}var M=[],O=_.vu(c,"StreamIndex");if(!O.length)throw a.f.error("No streams found!"),
27
+ new _.J(_.K,4,4034,a.o);for(var T=0;T<O.length;T++){for(var Na,fa=a,pa=O[T],za=sG(fa,pa,"Type"),Ba=+pa.getAttribute("Chunks"),Ra=pa.getAttribute("Subtype"),Sa=_.sh(pa.getAttribute("Language")||_.ye),xa=pa.getAttribute("Name")||"",ib=+pa.getAttribute(_.Oa),eb=+pa.getAttribute(_.Ma),Bb=sG(fa,pa,"Url"),vd=+pa.getAttribute("TimeScale")||null,Hi=[],vc=_.vu(pa,_.ab),Uf=0;Uf<vc.length;Uf++){var cf=fa,Wc=vc[Uf],Gr=za,YJ=+Wc.getAttribute("Index"),ZJ=+sG(cf,Wc,"Bitrate"),jB=NaN,kB=NaN,jm=NaN,Hr=NaN,lB=NaN,
28
+ mB=NaN,nB=NaN,oB=Wc.getAttribute("FourCC");switch(Gr){case _.He:jB=+sG(cf,Wc,_.Ma);kB=+sG(cf,Wc,_.Oa);break;case _.Zb:Hr=+Wc.getAttribute("Channels")||2,jm=+sG(cf,Wc,"SamplingRate"),mB=+sG(cf,Wc,"AudioTag"),lB=+sG(cf,Wc,"BitsPerSample"),nB=+sG(cf,Wc,"PacketSize")}var Ir=String(Wc.getAttribute("CodecPrivateData"));if(Gr===_.Zb&&!Ir){var pB=Hr,qB={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},km=qB[jm];if("AACH"===oB){var gc=new Uint8Array(4);var rB=
29
+ qB[2*jm];gc[0]=40|km>>1;gc[1]=km<<7|pB<<3|rB>>1;gc[2]=rB<<7|8;gc[3]=0;var Xf=new Uint16Array(2);Xf[0]=(gc[0]<<8)+gc[1];Xf[1]=(gc[2]<<8)+gc[3];var sB=Xf[0].toString(16)+Xf[1].toString(16)}else gc=new Uint8Array(2),gc[0]=16|km>>1,gc[1]=km<<7|pB<<3,Xf=new Uint16Array(1),Xf[0]=(gc[0]<<8)+gc[1],sB=Xf[0].toString(16);Ir=sB.toUpperCase()}var $J={id:cf.T++,type:Gr,index:YJ,bitrate:ZJ,nd:Ir,maxHeight:jB,maxWidth:kB,$c:jm,ef:Hr,fk:mB,Eg:lB,qk:nB,ci:oB,fb:null};Hi.push($J)}Na=Hi;for(var ke=[],tB=_.vu(pa,"c"),
30
+ Yi=0;Yi<tB.length;Yi++){var Jr=tB[Yi],wd=parseInt(Jr.getAttribute("t"),10),mh=parseInt(Jr.getAttribute("d"),10),Kr=parseInt(Jr.getAttribute("r"),10),Zi=0;if(isNaN(wd)&&isNaN(mh))throw fa.f.error("Either one or both FragmentDuration and FragmentTime field MUST be present in StreamFragmentElement"),new _.J(_.K,4,4037,fa.o);0===Yi&&isNaN(wd)&&(Zi=wd=0);if(0<Yi){var Yf=ke[ke.length-1];Zi=Yf.n+1;Yf.d||(Yf.d=wd-Yf.t);wd||(wd=Yf.t+Yf.d);mh||(mh=wd-Yf.t)}ke.push({n:Zi,d:mh,t:wd});if(Kr){Kr--;for(var uB=0;uB<
31
+ Kr;uB++){var lm=ke[ke.length-1];Zi=lm.n+1;wd=lm.t+lm.d;mh=lm.d;ke.push({n:Zi,d:mh,t:wd})}}}fa.Rc()||ke.length===Ba||fa.f.warn("Number of fragments ("+Ba+") differs from number of chunks ("+ke.length+").");M.push({type:za,gk:Ba,Ij:Ra,language:Sa,name:xa,maxWidth:ib,maxHeight:eb,Nj:Bb,tracks:Na,zf:ke,timescale:vd})}var df={nk:k,Jf:l,timescale:m,duration:n,isLive:p,mk:q,ce:r,ne:!1,streams:M};if(a.j&&a.B)return vG(a,df),Promise.resolve();var Lr=df.timescale,Mr=df.duration,bK=WF(df.streams,_.Zb),cK=WF(df.streams,
32
+ _.He),dK=WF(df.streams,_.se),vB=[],mm=wG(a,Mr,Lr,bK),nm=wG(a,Mr,Lr,cK),eK=wG(a,Mr,Lr,dK);mm.length||(mm=[null]);nm.length||(nm=[null]);for(var Or=0;Or<nm.length;Or++)for(var Pr=0;Pr<mm.length;Pr++)vB.push(xG(a,nm[Or],mm[Pr]));var wB={startTime:0,variants:vB,textStreams:eK,thumbStreams:[]};var gK=df.streams,Qr=a.a.startTime,xB=a.a.delay,Rr=a.I,yB=Math.min(a.a.duration||Infinity,Rr),Sr=a.Rc(),hK=a.a.ce,iK=a.a.Wc,zB=a.G,AB=isFinite(a.D)?a.D:0;if(Sr)yB=Infinity,Qr=Date.now()/1E3-iK,a.a.startTime=Qr,xB=
33
+ 3*zB;else for(var jK=isFinite(Rr)?Rr:a.a.duration,BB=_.t(gK),Tr=BB.next();!Tr.done;Tr=BB.next())for(var CB=_.t(Tr.value.tracks),Ur=CB.next();!Ur.done;Ur=CB.next()){var DB=Ur.value;DB.fb.offset(-AB);_.dv(DB.fb,jK)}a.w=new _.Su(Qr,xB,!0);a.w.f=!Sr;a.w.Pb(yB);_.Vu(a.w,zB);a.w.hc=hK;Sr||a.w.offset(-AB);a.g.filterAllPeriods([wB]);a.j={presentationTimeline:a.w,periods:[wB],offlineSessionIds:[],minBufferTime:0};Promise.resolve();a.J||(a.g.networkingEngine.Vd(a.K),a.J=!0);a.B=df;return Promise.resolve()},
34
+ vG=function(a,b){for(var c=0;c<a.B.streams.length;c++)for(var d=b.streams[c],e={},f=_.t(a.B.streams[c].tracks),g=f.next();!g.done;e={Db:e.Db},g=f.next())if(e.Db=g.value,g=d.tracks.find(function(l){return function(m){return m.type===l.Db.type&&m.bitrate===l.Db.bitrate}}(e))){UF(e.Db,g)||a.f.warn("The current stream is updated with a stream that seems to have different base properties!");var k=zG(a,a.B.timescale,d,g);g=e.Db.fb;g.Sa(k);(k=a.a.ce)&&_.cv(g,(g.a.length?g.a[g.a.length-1].endTime:0)-k)}else a.f.warn("Cannot find satisfying update for "+
35
+ e.Db.type+" track with bitrate "+(e.Db.bitrate+". Skipping update."))},wG=function(a,b,c,d){for(var e=[],f={qc:0};f.qc<d.length;f={qc:f.qc},f.qc++){var g=d[f.qc].tracks.map(function(k){return function(l){var m=d[k.qc],n=zG(a,c,m,l),p=new _.bv(n),q=null;m.type!==_.se&&(q=AG(a,b,c,m,l));l.fb=p;n=a.L++;var r=Promise.resolve.bind(Promise),x=p.Qc.bind(p),y=p.get.bind(p),C=p.Kc.bind(p);p=p.getDuration.bind(p);var I=BG[m.type],F="";switch(m.type){case _.He:F=l.nd;var G=/00000001[0-9]7/.exec(F);F="avc1."+
36
+ (G&&G[0]?F.substr(F.indexOf(G[0])+10,6):"42c00c");a.f.debug("VIDEO CODECS: ",F);break;case _.Zb:F=l.nd,G=2,"AACH"===l.ci?G=5:F&&(G=(parseInt(F.substr(0,2),16)&248)>>3),F="mp4a.40."+G,a.f.debug("AUDIO CODECS: ",F)}G=m.type===_.se?CG[m.Ij]:void 0;return{id:n,originalId:null,sk:null,createSegmentIndex:r,findSegmentPosition:x,getSegmentReference:y,adjustSegmentDurations:C,getDuration:p,initSegmentReference:q,mimeType:I,codecs:F,frameRate:void 0,bandwidth:l.bitrate,width:l.maxWidth||void 0,height:l.maxHeight||
37
+ void 0,kind:G,encrypted:a.pe(),keyId:null,language:m.language,label:m.name,type:m.type,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:l.ef||null,closedCaptions:null}}}(f));e=e.concat(g)}return e},zG=function(a,b,c,d){var e=0,f=[],g=c.timescale||b;c.zf.forEach(function(k,l){var m=k.d/g;if(0===l){var n=k.t/g;a.D=Math.min(a.D,n)}else n=f[l-1].endTime;var p=n+m,q=TF(a.o,c,l,d);a.G=Math.max(a.G,m);f.push(new _.Ru(l,n,p,function(){return[q]},0,null,0,null,!0,g));e+=m});if(c.type===
38
+ _.He||c.type===_.Zb)b=f[f.length-1],a.I=Math.min(a.I,e),0===a.a.Wc?a.a.Wc=b.endTime:a.a.Wc=Math.min(a.a.Wc,b.endTime);return f},AG=function(a,b,c,d,e){b=VF(b,d.timescale||c,e);c={isLive:a.Rc.bind(a),zd:a.pe.bind(a),ii:function(){return 1},he:a.Bf.bind(a)};d=new Uint8Array(0);try{d=jG(b,c)}catch(g){throw a.f.error("Failed to generate initialization segment."),new _.J(_.K,3,4035,g);}var f="data:text/plain;base64,"+_.fj(d);return new _.Qu(function(){return[f]},0,null,null,!0)},xG=function(a,b,c){var d=
39
+ (c?c.bandwidth:0)+(b?b.bandwidth:0),e=c?c.language:_.ye;return c||b?{id:a.L++,language:e,primary:!1,audio:c,video:b,bandwidth:d,drmInfos:a.A,allowedByApplication:!0,allowedByKeySystem:!0}:null},sG=function(a,b,c){if(b=b.getAttribute(c))return b;a.f.error("required attribute not provided: "+c);throw new _.J(_.K,4,4038,a.o,c);},DG=function(a,b){null!=a.C&&null!=b&&(a.m=window.setTimeout(a.Bh.bind(a),b))},tG=function(a,b){var c=b===pG;a.j&&a.j.presentationTimeline&&(a.j.presentationTimeline.f=c);c&&
40
+ null!=a.m&&(window.clearTimeout(a.m),a.m=null,a.C=null);a.O=b},EG=function(){};V.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};V.prototype.get=function(a){if(this.type===a)return this;for(var b=0;b<this.f.length;b++){if(this.f[b].type===a)return this.f[b];var c=this.f[b].get(a);if(c)return c}return null};
41
41
  V.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
- V.prototype.write=function(a){var b=Math.pow(2,32)-1;this.start=a.getPosition();this.size=this.a();this.size>b?_.R(a,1):_.R(a,this.size);_.yj(a,BE(this.type));this.size>b&&vE(a,this.size);"uuid"===this.type&&_.yj(a,null);if(0<this.f.length&&!this.w)for(b=0;b<this.f.length;b++)this.f[b].write(a),this.f[b].a(),a.getPosition()};_.u(W,V);W.prototype.a=function(){return 4+V.prototype.a.call(this)};W.prototype.write=function(a){V.prototype.write.call(this,a);wE(a,this.version);xE(a,this.flags)};
43
- _.u(CE,V);CE.prototype.a=function(){return this.g.byteLength+V.prototype.a.call(this)-this.offset};CE.prototype.write=function(a){V.prototype.write.call(this,a);_.yj(a,this.g,this.offset);a.getPosition()};_.u(DE,W);DE.prototype.a=function(){return this.g.byteLength+W.prototype.a.call(this)-this.offset};DE.prototype.write=function(a){W.prototype.write.call(this,a);_.yj(a,this.g,this.offset);a.getPosition()};_.u(EE,V);
44
- EE.prototype.a=function(){var a=this.h.length;a=a+4+this.g.join("").length;return a+V.prototype.a.call(this)};EE.prototype.write=function(a){V.prototype.write.call(this,a);_.yj(a,BE(this.h));_.R(a,this.If);_.yj(a,BE(this.g.join("")));a.getPosition()};_.u(FE,V);_.u(GE,V);_.u(HE,W);HE.prototype.a=function(){var a=0;a=1===this.version?a+28:a+16;a=a+44+this.g.length;return a+=W.prototype.a.call(this)};
45
- HE.prototype.write=function(a){W.prototype.write.call(this,a);1===this.version?(vE(a,0),vE(a,0),_.R(a,this.timescale),vE(a,this.duration*this.timescale)):(_.R(a,0),_.R(a,0),_.R(a,this.timescale),_.R(a,this.duration*this.timescale));_.R(a,65536);yE(a,this.volume);yE(a,0);_.R(a,0);_.R(a,0);for(var b=0;b<this.g.length;b++)wE(a,this.g[b]);_.R(a,0);_.R(a,0);_.R(a,0);_.R(a,0);_.R(a,0);_.R(a,0);_.R(a,this.h);a.getPosition()};_.u(IE,V);_.u(JE,W);JE.prototype.a=function(){return 20+W.prototype.a.call(this)};
46
- JE.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,this.g);_.R(a,1);_.R(a,0);_.R(a,0);_.R(a,0);a.getPosition()};_.u(KE,W);KE.prototype.a=function(){var a=0;a=1===this.version?a+32:a+20;a=a+24+this.g.length;return a+W.prototype.a.call(this)};
47
- KE.prototype.write=function(a){W.prototype.write.call(this,a);1===this.version?(vE(a,0),vE(a,0),_.R(a,this.h),_.R(a,0),vE(a,this.duration*this.timescale)):(_.R(a,0),_.R(a,0),_.R(a,this.h),_.R(a,0),_.R(a,this.duration*this.timescale));_.R(a,0);_.R(a,0);yE(a,0);yE(a,0);yE(a,this.volume);yE(a,0);for(var b=0;b<this.g.length;b++)wE(a,this.g[b]);yE(a,this.width);yE(a,0);yE(a,this.height);yE(a,0);a.getPosition()};_.u(LE,W);LE.prototype.a=function(){var a=0;a=1===this.version?a+28:a+16;return a+4+W.prototype.a.call(this)};
48
- LE.prototype.write=function(a){W.prototype.write.call(this,a);1===this.version?(vE(a,0),vE(a,0),_.R(a,this.timescale),vE(a,this.duration*this.timescale)):(_.R(a,0),_.R(a,0),_.R(a,this.timescale),_.R(a,this.duration*this.timescale));yE(a,this.language);yE(a,0);a.getPosition()};_.u(ME,W);ME.prototype.a=function(){return 33+W.prototype.a.call(this)};
49
- ME.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,0);this.g===_.Ge?_.yj(a,BE("vide")):_.yj(a,BE("soun"));_.R(a,0);_.R(a,0);_.R(a,0);this.g===_.Ge?_.yj(a,BE("VideoHandler\x00")):_.yj(a,BE("SoundHandler\x00"));a.getPosition()};_.u(NE,W);NE.prototype.a=function(){return 2+this.g.byteLength+W.prototype.a.call(this)};NE.prototype.write=function(a){W.prototype.write.call(this,a);yE(a,0);_.yj(a,this.g);a.getPosition()};_.u(OE,V);OE.prototype.a=function(){return 8+V.prototype.a.call(this)};
50
- OE.prototype.write=function(a){V.prototype.write.call(this,a);_.R(a,0);yE(a,0);yE(a,1)};_.u(PE,OE);PE.prototype.a=function(){return 70+OE.prototype.a.call(this)};PE.prototype.write=function(a){OE.prototype.write.call(this,a);yE(a,0);yE(a,0);_.R(a,0);_.R(a,0);_.R(a,0);yE(a,this.width);yE(a,this.height);_.R(a,4718592);_.R(a,4718592);_.R(a,0);yE(a,1);wE(a,10);_.yj(a,BE("AVC Coding",31));yE(a,24);AE(a,-1)};_.u(QE,OE);QE.prototype.a=function(){return 20+OE.prototype.a.call(this)};
51
- QE.prototype.write=function(a){OE.prototype.write.call(this,a);_.R(a,0);_.R(a,0);yE(a,this.channelCount);yE(a,this.sampleSize);AE(a,0);yE(a,0);yE(a,this.sampleRate);yE(a,0)};_.u(RE,PE);RE.prototype.write=function(a){PE.prototype.write.call(this,a);for(var b=0;b<this.f.length;b++)this.f[b].write(a);a.getPosition()};_.u(SE,RE);_.u(TE,QE);TE.prototype.write=function(a){QE.prototype.write.call(this,a);for(var b=0;b<this.f.length;b++)this.f[b].write(a);a.getPosition()};_.u(UE,TE);_.u(VE,V);
52
- VE.prototype.a=function(){for(var a=7,b=0;b<this.Fa.length;b++)a+=2,a+=this.Fa[b].byteLength;for(b=0;b<this.Fa.length;b++)a+=2,a+=this.Lb[b].byteLength;return a+V.prototype.a.call(this)};
53
- VE.prototype.write=function(a){V.prototype.write.call(this,a);wE(a,this.version);wE(a,this.g);wE(a,this.h);wE(a,this.level);wE(a,255);wE(a,224|this.Fa.length);for(var b=0;b<this.Fa.length;b++)yE(a,this.Fa[b].length),_.yj(a,this.Fa[b]);wE(a,this.Lb.length);for(b=0;b<this.Lb.length;b++)yE(a,this.Lb[b].length),_.yj(a,this.Lb[b]);a.getPosition()};_.u(WE,W);WE.prototype.a=function(){return 22+(this.Eb.byteLength+3)+W.prototype.a.call(this)};
54
- WE.prototype.write=function(a){W.prototype.write.call(this,a);wE(a,3);wE(a,23+this.Eb.byteLength);yE(a,1);wE(a,0);wE(a,4);wE(a,15+this.Eb.byteLength);wE(a,64);wE(a,21);xE(a,0);_.R(a,0);_.R(a,0);wE(a,5);wE(a,this.Eb.byteLength);_.yj(a,this.Eb);_.yj(a,new Uint8Array([6,1,2]));a.getPosition()};_.u(XE,W);XE.prototype.a=function(){return this.location.length+W.prototype.a.call(this)};XE.prototype.write=function(a){W.prototype.write.call(this,a);0<this.location.length&&_.yj(a,BE(this.location));a.getPosition()};
55
- _.u(YE,W);YE.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+W.prototype.a.call(this)};YE.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.u(ZE,V);_.u($E,W);$E.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+W.prototype.a.call(this)};
56
- $E.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.u(aF,W);aF.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+W.prototype.a.call(this)};aF.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.u(bF,W);
57
- bF.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+W.prototype.a.call(this)};bF.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.u(cF,W);cF.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+W.prototype.a.call(this)};
58
- cF.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.u(dF,W);dF.prototype.a=function(){return 8+W.prototype.a.call(this)};dF.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,0);_.R(a,0);a.getPosition()};_.u(eF,W);eF.prototype.a=function(){return 4+W.prototype.a.call(this)};eF.prototype.write=function(a){W.prototype.write.call(this,a);AE(a,0);yE(a,0);a.getPosition()};
59
- _.u(fF,V);_.u(gF,V);_.u(hF,V);_.u(iF,W);iF.prototype.a=function(){var a=0;a=1===this.version?a+8:a+4;return a+W.prototype.a.call(this)};iF.prototype.write=function(a){W.prototype.write.call(this,a);1===this.version?vE(a,this.g):_.R(a,this.g);a.getPosition()};_.u(jF,W);jF.prototype.a=function(){return 4+W.prototype.a.call(this)};jF.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,this.g);a.getPosition()};_.u(kF,W);
60
- kF.prototype.a=function(){var a=4;this.flags&iG&&(a+=4);this.flags&jG&&(a+=4);for(var b=0;b<this.g;b++)this.flags&kG&&(a+=4),this.flags&lG&&(a+=4),this.flags&mG&&(a+=4),this.flags&nG&&(a+=4);return a+W.prototype.a.call(this)};
61
- kF.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,this.g);this.flags&iG&&(a.getPosition(),zE(a,this.j));this.flags&jG&&_.R(a,this.m);for(var b=0;b<this.g;b++)this.flags&kG&&_.R(a,this.o[b]),this.flags&lG&&_.R(a,this.sampleSize[b]),this.flags&mG&&_.R(a,this.A[b]),this.flags&nG&&(0===this.version?_.R(a,this.h[b]):zE(a,this.h[b]));a.getPosition()};var iG=1,jG=4,kG=256,lG=512,mG=1024,nG=2048;_.u(lF,W);
62
- lF.prototype.a=function(){var a=4;this.flags&oG&&(a+=8);this.flags&pG&&(a+=4);this.flags&qG&&(a+=4);this.flags&rG&&(a+=4);this.flags&sG&&(a+=4);return a+W.prototype.a.call(this)};lF.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,this.g);this.flags&oG&&vE(a,this.h);this.flags&pG&&_.R(a,this.A);this.flags&qG&&_.R(a,this.j);this.flags&rG&&_.R(a,this.o);this.flags&sG&&_.R(a,this.m);a.getPosition()};var oG=1,pG=2,qG=8,rG=16,sG=32;_.u(mF,V);_.u(nF,V);_.u(oF,V);
63
- oF.prototype.a=function(){return this.g.byteLength+V.prototype.a.call(this)};oF.prototype.write=function(a){V.prototype.write.call(this,a);0<this.g.byteLength&&_.yj(a,this.g)};_.u(pF,W);pF.prototype.a=function(){var a=20;1===this.g&&0===this.h&&(a=a+1+this.j.length);return a+W.prototype.a.call(this)};
64
- pF.prototype.write=function(a){W.prototype.write.call(this,a);wE(a,0);0===this.version?wE(a,0):wE(a,0);wE(a,this.g);wE(a,this.h);_.yj(a,_.gj(this.m));if(1===this.g&&0===this.h){wE(a,0);for(var b=0;b<this.j.length;b++)wE(a,this.j[b])}a.getPosition()};_.u(qF,W);qF.prototype.a=function(){var a=8;this.flags&1&&(a+=BE(this.yb).byteLength);return a+W.prototype.a.call(this)};qF.prototype.write=function(a){W.prototype.write.call(this,a);_.yj(a,BE(this.g));_.R(a,this.h);this.flags&1&&_.yj(a,BE(this.yb));a.getPosition()};
65
- _.u(rF,V);rF.prototype.a=function(){return BE(this.g).byteLength+V.prototype.a.call(this)};rF.prototype.write=function(a){V.prototype.write.call(this,a);_.yj(a,BE(this.g));a.getPosition()};_.u(sF,W);sF.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+W.prototype.a.call(this)};
66
- sF.prototype.write=function(a){W.prototype.write.call(this,a);this.flags&1&&(_.R(a,0),_.R(a,0));_.R(a,1);for(var b=0;1>b;b++)0===this.version?_.R(a,this.offset[b]):vE(a,this.offset[b]);a.getPosition()};_.u(tF,W);tF.prototype.a=function(){var a=0;this.flags&1&&(a+=8);a+=5;0===this.g&&(a+=this.j.length);return a+W.prototype.a.call(this)};
67
- tF.prototype.write=function(a){W.prototype.write.call(this,a);this.flags&1&&(_.R(a,0),_.R(a,0));wE(a,this.g);_.R(a,this.h);if(0===this.g)for(var b=0;b<this.h;b++)wE(a,this.j[b]);a.getPosition()};_.u(uF,W);uF.prototype.a=function(){var a=4;this.flags&1&&(a+=1);for(var b=0;b<this.h;b++)if(a+=this.g[b].Bf.byteLength,this.flags&2){a+=2;for(var c=0;c<this.g[b].Ic;c++)a+=2,a+=4}return a+W.prototype.a.call(this)};
68
- uF.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,this.h);this.flags&1&&wE(a,this.j);for(var b=0;b<this.h;b++)if(_.yj(a,this.g[b].Bf),this.flags&2){yE(a,this.g[b].Ic);for(var c=0;c<this.g[b].Ic;c++)yE(a,this.g[b].Oe[c].af),_.R(a,this.g[b].Oe[c].bf)}a.getPosition()};var BF=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,CF=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,DF=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,EF=/^(\d*\.?\d*)f$/,FF=/^(\d*\.?\d*)t$/,GF=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/;KF.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};KF.prototype.write=function(){this.f=JF(this);for(var a=0;a<this.a.length;a++)this.a[a].write(this.f);return this.f.buffer};var OF=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);_.h=UF.prototype;_.h.configure=function(a){this.h=a};_.h.start=function(a,b){var c=this;this.g=b;var d=_.bf(new Set([a,vF(a)])).concat();return VF(this,d).then(function(e){return bG(c,e.data).then(function(){gG(c,c.C);return c.j})})};_.h.stop=function(){this.g&&this.g.networkingEngine.Ie(this.K);this.C=this.B=this.j=this.h=this.g=null;this.m&&(clearTimeout(this.m),this.m=null);this.J=!1;this.I=this.D=Infinity;return Promise.resolve()};
69
- _.h.update=function(){var a=this;if(this.Qc())return VF(this,[this.o]).then(function(b){return bG(a,b.data).then(function(){return a.j})})["catch"](function(b){if(a.g)a.g.onError(b)})};_.h.onExpirationUpdated=function(){};_.h.yh=function(){var a=this;this.f.debug(_.ot);this.g&&(this.m=null,this.update().then(function(){gG(a,a.C)})["catch"](function(b){a.g&&(a.g.onError(b),1===b.severity&&gG(a,100))}))};_.h.Qc=function(){return this.P===YF};_.h.oe=function(){return 0<this.A.length};
70
- _.h.zf=function(a){var b=null;if(this.A.length)for(var c=0;c<this.A.length;c++)if(this.A[c].keySystem===a){b=this.A[c].initData[0];break}return b};
71
- _.h.qj=function(a){if(2!==a.request.type||a.uri.startsWith("data:"))return Promise.resolve(a);var b=a.request.timescale||this.B.timescale,c={isLive:this.Qc.bind(this),yd:this.oe.bind(this),ei:function(){return 1},fe:this.zf.bind(this)},d=!1,e=new _.J(_.K,3,4035,null),f=null;try{f=QF(a,b,c)}catch(g){d=!0,e.data=g,3E3===g.code&&(e.code=4039)}if(d||!f)return Promise.reject(e);a.data=f;return Promise.resolve(a)};var eG={video:_.Ie,audio:_.cc,text:_.Vb},TF="VOD",YF="LIVE",fG={Hj:"caption",Qj:_.yt};_.u(hG,_.ln);hG.prototype.Da=function(){_.ko.ism=UF;_.io[_.Wb]=UF};hG.prototype.va=function(){_.Ou("ism");_.Pu(_.Wb)};hG.prototype.id=function(){return"smooth"};_.A("clpp.smooth.SmoothComponent",hG);};
42
+ V.prototype.write=function(a){var b=Math.pow(2,32)-1;this.start=a.getPosition();this.size=this.a();this.size>b?_.R(a,1):_.R(a,this.size);_.zj(a,YE(this.type));this.size>b&&SE(a,this.size);"uuid"===this.type&&_.zj(a,null);if(0<this.f.length&&!this.w)for(b=0;b<this.f.length;b++)this.f[b].write(a),this.f[b].a(),a.getPosition()};_.u(W,V);W.prototype.a=function(){return 4+V.prototype.a.call(this)};W.prototype.write=function(a){V.prototype.write.call(this,a);TE(a,this.version);UE(a,this.flags)};
43
+ _.u(ZE,V);ZE.prototype.a=function(){return this.g.byteLength+V.prototype.a.call(this)-this.offset};ZE.prototype.write=function(a){V.prototype.write.call(this,a);_.zj(a,this.g,this.offset);a.getPosition()};_.u($E,W);$E.prototype.a=function(){return this.g.byteLength+W.prototype.a.call(this)-this.offset};$E.prototype.write=function(a){W.prototype.write.call(this,a);_.zj(a,this.g,this.offset);a.getPosition()};_.u(aF,V);
44
+ aF.prototype.a=function(){var a=this.h.length;a=a+4+this.g.join("").length;return a+V.prototype.a.call(this)};aF.prototype.write=function(a){V.prototype.write.call(this,a);_.zj(a,YE(this.h));_.R(a,this.Jf);_.zj(a,YE(this.g.join("")));a.getPosition()};_.u(bF,V);_.u(cF,V);_.u(dF,W);dF.prototype.a=function(){var a=0;a=1===this.version?a+28:a+16;a=a+44+this.g.length;return a+=W.prototype.a.call(this)};
45
+ dF.prototype.write=function(a){W.prototype.write.call(this,a);1===this.version?(SE(a,0),SE(a,0),_.R(a,this.timescale),SE(a,this.duration*this.timescale)):(_.R(a,0),_.R(a,0),_.R(a,this.timescale),_.R(a,this.duration*this.timescale));_.R(a,65536);VE(a,this.volume);VE(a,0);_.R(a,0);_.R(a,0);for(var b=0;b<this.g.length;b++)TE(a,this.g[b]);_.R(a,0);_.R(a,0);_.R(a,0);_.R(a,0);_.R(a,0);_.R(a,0);_.R(a,this.h);a.getPosition()};_.u(eF,V);_.u(fF,W);fF.prototype.a=function(){return 20+W.prototype.a.call(this)};
46
+ fF.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,this.g);_.R(a,1);_.R(a,0);_.R(a,0);_.R(a,0);a.getPosition()};_.u(gF,W);gF.prototype.a=function(){var a=0;a=1===this.version?a+32:a+20;a=a+24+this.g.length;return a+W.prototype.a.call(this)};
47
+ gF.prototype.write=function(a){W.prototype.write.call(this,a);1===this.version?(SE(a,0),SE(a,0),_.R(a,this.h),_.R(a,0),SE(a,this.duration*this.timescale)):(_.R(a,0),_.R(a,0),_.R(a,this.h),_.R(a,0),_.R(a,this.duration*this.timescale));_.R(a,0);_.R(a,0);VE(a,0);VE(a,0);VE(a,this.volume);VE(a,0);for(var b=0;b<this.g.length;b++)TE(a,this.g[b]);VE(a,this.width);VE(a,0);VE(a,this.height);VE(a,0);a.getPosition()};_.u(hF,W);hF.prototype.a=function(){var a=0;a=1===this.version?a+28:a+16;return a+4+W.prototype.a.call(this)};
48
+ hF.prototype.write=function(a){W.prototype.write.call(this,a);1===this.version?(SE(a,0),SE(a,0),_.R(a,this.timescale),SE(a,this.duration*this.timescale)):(_.R(a,0),_.R(a,0),_.R(a,this.timescale),_.R(a,this.duration*this.timescale));VE(a,this.language);VE(a,0);a.getPosition()};_.u(iF,W);iF.prototype.a=function(){return 33+W.prototype.a.call(this)};
49
+ iF.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,0);this.g===_.He?_.zj(a,YE("vide")):_.zj(a,YE("soun"));_.R(a,0);_.R(a,0);_.R(a,0);this.g===_.He?_.zj(a,YE("VideoHandler\x00")):_.zj(a,YE("SoundHandler\x00"));a.getPosition()};_.u(jF,W);jF.prototype.a=function(){return 2+this.g.byteLength+W.prototype.a.call(this)};jF.prototype.write=function(a){W.prototype.write.call(this,a);VE(a,0);_.zj(a,this.g);a.getPosition()};_.u(kF,V);kF.prototype.a=function(){return 8+V.prototype.a.call(this)};
50
+ kF.prototype.write=function(a){V.prototype.write.call(this,a);_.R(a,0);VE(a,0);VE(a,1)};_.u(lF,kF);lF.prototype.a=function(){return 70+kF.prototype.a.call(this)};lF.prototype.write=function(a){kF.prototype.write.call(this,a);VE(a,0);VE(a,0);_.R(a,0);_.R(a,0);_.R(a,0);VE(a,this.width);VE(a,this.height);_.R(a,4718592);_.R(a,4718592);_.R(a,0);VE(a,1);TE(a,10);_.zj(a,YE("AVC Coding",31));VE(a,this.depth);XE(a,-1)};_.u(mF,kF);mF.prototype.a=function(){return 20+kF.prototype.a.call(this)};
51
+ mF.prototype.write=function(a){kF.prototype.write.call(this,a);_.R(a,0);_.R(a,0);VE(a,this.channelCount);VE(a,this.sampleSize);XE(a,0);VE(a,0);VE(a,this.sampleRate);VE(a,0)};_.u(nF,lF);nF.prototype.write=function(a){lF.prototype.write.call(this,a);for(var b=0;b<this.f.length;b++)this.f[b].write(a);a.getPosition()};_.u(oF,nF);_.u(pF,mF);pF.prototype.write=function(a){mF.prototype.write.call(this,a);for(var b=0;b<this.f.length;b++)this.f[b].write(a);a.getPosition()};_.u(qF,pF);_.u(rF,V);
52
+ rF.prototype.a=function(){for(var a=7,b=0;b<this.Ga.length;b++)a+=2,a+=this.Ga[b].byteLength;for(b=0;b<this.Ga.length;b++)a+=2,a+=this.Lb[b].byteLength;return a+V.prototype.a.call(this)};
53
+ rF.prototype.write=function(a){V.prototype.write.call(this,a);TE(a,this.version);TE(a,this.g);TE(a,this.h);TE(a,this.level);TE(a,255);TE(a,224|this.Ga.length);for(var b=0;b<this.Ga.length;b++)VE(a,this.Ga[b].length),_.zj(a,this.Ga[b]);TE(a,this.Lb.length);for(b=0;b<this.Lb.length;b++)VE(a,this.Lb[b].length),_.zj(a,this.Lb[b]);a.getPosition()};_.u(sF,W);sF.prototype.a=function(){return 22+(this.Eb.byteLength+3)+W.prototype.a.call(this)};
54
+ sF.prototype.write=function(a){W.prototype.write.call(this,a);TE(a,3);TE(a,23+this.Eb.byteLength);VE(a,1);TE(a,0);TE(a,4);TE(a,15+this.Eb.byteLength);TE(a,64);TE(a,21);UE(a,0);_.R(a,0);_.R(a,0);TE(a,5);TE(a,this.Eb.byteLength);_.zj(a,this.Eb);_.zj(a,new Uint8Array([6,1,2]));a.getPosition()};_.u(tF,W);tF.prototype.a=function(){return this.location.length+W.prototype.a.call(this)};tF.prototype.write=function(a){W.prototype.write.call(this,a);0<this.location.length&&_.zj(a,YE(this.location));a.getPosition()};
55
+ _.u(uF,W);uF.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+W.prototype.a.call(this)};uF.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.u(vF,V);_.u(wF,W);wF.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+W.prototype.a.call(this)};
56
+ wF.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.u(xF,W);xF.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+W.prototype.a.call(this)};xF.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.u(yF,W);
57
+ yF.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+W.prototype.a.call(this)};yF.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.u(zF,W);zF.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+W.prototype.a.call(this)};
58
+ zF.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.u(AF,W);AF.prototype.a=function(){return 8+W.prototype.a.call(this)};AF.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,0);_.R(a,0);a.getPosition()};_.u(BF,W);BF.prototype.a=function(){return 4+W.prototype.a.call(this)};BF.prototype.write=function(a){W.prototype.write.call(this,a);XE(a,0);VE(a,0);a.getPosition()};
59
+ _.u(CF,V);_.u(DF,V);_.u(EF,V);_.u(FF,W);FF.prototype.a=function(){var a=0;a=1===this.version?a+8:a+4;return a+W.prototype.a.call(this)};FF.prototype.write=function(a){W.prototype.write.call(this,a);1===this.version?SE(a,this.g):_.R(a,this.g);a.getPosition()};_.u(GF,W);GF.prototype.a=function(){return 4+W.prototype.a.call(this)};GF.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,this.g);a.getPosition()};_.u(HF,W);
60
+ HF.prototype.a=function(){var a=4;this.flags&FG&&(a+=4);this.flags&GG&&(a+=4);for(var b=0;b<this.g;b++)this.flags&HG&&(a+=4),this.flags&IG&&(a+=4),this.flags&JG&&(a+=4),this.flags&KG&&(a+=4);return a+W.prototype.a.call(this)};
61
+ HF.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,this.g);this.flags&FG&&(a.getPosition(),WE(a,this.j));this.flags&GG&&_.R(a,this.m);for(var b=0;b<this.g;b++)this.flags&HG&&_.R(a,this.o[b]),this.flags&IG&&_.R(a,this.sampleSize[b]),this.flags&JG&&_.R(a,this.A[b]),this.flags&KG&&(0===this.version?_.R(a,this.h[b]):WE(a,this.h[b]));a.getPosition()};var FG=1,GG=4,HG=256,IG=512,JG=1024,KG=2048;_.u(IF,W);
62
+ IF.prototype.a=function(){var a=4;this.flags&LG&&(a+=8);this.flags&MG&&(a+=4);this.flags&NG&&(a+=4);this.flags&OG&&(a+=4);this.flags&PG&&(a+=4);return a+W.prototype.a.call(this)};IF.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,this.g);this.flags&LG&&SE(a,this.h);this.flags&MG&&_.R(a,this.A);this.flags&NG&&_.R(a,this.j);this.flags&OG&&_.R(a,this.o);this.flags&PG&&_.R(a,this.m);a.getPosition()};var LG=1,MG=2,NG=8,OG=16,PG=32;_.u(JF,V);_.u(KF,V);_.u(LF,V);
63
+ LF.prototype.a=function(){return this.g.byteLength+V.prototype.a.call(this)};LF.prototype.write=function(a){V.prototype.write.call(this,a);0<this.g.byteLength&&_.zj(a,this.g)};_.u(MF,W);MF.prototype.a=function(){var a=20;1===this.g&&0===this.h&&(a=a+1+this.j.length);return a+W.prototype.a.call(this)};
64
+ MF.prototype.write=function(a){W.prototype.write.call(this,a);TE(a,0);0===this.version?TE(a,0):TE(a,0);TE(a,this.g);TE(a,this.h);_.zj(a,_.hj(this.m));if(1===this.g&&0===this.h){TE(a,0);for(var b=0;b<this.j.length;b++)TE(a,this.j[b])}a.getPosition()};_.u(NF,W);NF.prototype.a=function(){var a=8;this.flags&1&&(a+=YE(this.yb).byteLength);return a+W.prototype.a.call(this)};NF.prototype.write=function(a){W.prototype.write.call(this,a);_.zj(a,YE(this.g));_.R(a,this.h);this.flags&1&&_.zj(a,YE(this.yb));a.getPosition()};
65
+ _.u(OF,V);OF.prototype.a=function(){return YE(this.g).byteLength+V.prototype.a.call(this)};OF.prototype.write=function(a){V.prototype.write.call(this,a);_.zj(a,YE(this.g));a.getPosition()};_.u(PF,W);PF.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+W.prototype.a.call(this)};
66
+ PF.prototype.write=function(a){W.prototype.write.call(this,a);this.flags&1&&(_.R(a,0),_.R(a,0));_.R(a,1);for(var b=0;1>b;b++)0===this.version?_.R(a,this.offset[b]):SE(a,this.offset[b]);a.getPosition()};_.u(QF,W);QF.prototype.a=function(){var a=0;this.flags&1&&(a+=8);a+=5;0===this.g&&(a+=this.j.length);return a+W.prototype.a.call(this)};
67
+ QF.prototype.write=function(a){W.prototype.write.call(this,a);this.flags&1&&(_.R(a,0),_.R(a,0));TE(a,this.g);_.R(a,this.h);if(0===this.g)for(var b=0;b<this.h;b++)TE(a,this.j[b]);a.getPosition()};_.u(RF,W);RF.prototype.a=function(){var a=4;this.flags&1&&(a+=1);for(var b=0;b<this.h;b++)if(a+=this.g[b].Df.byteLength,this.flags&2){a+=2;for(var c=0;c<this.g[b].Jc;c++)a+=2,a+=4}return a+W.prototype.a.call(this)};
68
+ RF.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,this.h);this.flags&1&&TE(a,this.j);for(var b=0;b<this.h;b++)if(_.zj(a,this.g[b].Df),this.flags&2){VE(a,this.g[b].Jc);for(var c=0;c<this.g[b].Jc;c++)VE(a,this.g[b].Qe[c].cf),_.R(a,this.g[b].Qe[c].df)}a.getPosition()};var YF=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,ZF=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,$F=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,aG=/^(\d*\.?\d*)f$/,bG=/^(\d*\.?\d*)t$/,cG=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/;gG.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};gG.prototype.write=function(){this.f=fG(this);for(var a=0;a<this.a.length;a++)this.a[a].write(this.f);return this.f.buffer};var kG=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);_.h=qG.prototype;_.h.configure=function(a){this.h=a};_.h.start=function(a,b){var c=this;this.g=b;var d=_.af(new Set([a,SF(a)])).concat();return rG(this,d).then(function(e){return yG(c,e.data).then(function(){DG(c,c.C);return c.j})})};_.h.stop=function(){this.g&&this.g.networkingEngine.Ke(this.K);this.C=this.B=this.j=this.h=this.g=null;this.m&&(clearTimeout(this.m),this.m=null);this.J=!1;this.I=this.D=Infinity;return Promise.resolve()};
69
+ _.h.update=function(){var a=this;if(this.Rc())return rG(this,[this.o]).then(function(b){return yG(a,b.data).then(function(){return a.j})})["catch"](function(b){if(a.g)a.g.onError(b)})};_.h.onExpirationUpdated=function(){};_.h.Bh=function(){var a=this;this.f.debug(_.Kt);this.g&&(this.m=null,this.update().then(function(){DG(a,a.C)})["catch"](function(b){a.g&&(a.g.onError(b),1===b.severity&&DG(a,100))}))};_.h.Rc=function(){return this.O===uG};_.h.pe=function(){return 0<this.A.length};
70
+ _.h.Bf=function(a){var b=null;if(this.A.length)for(var c=0;c<this.A.length;c++)if(this.A[c].keySystem===a){b=this.A[c].initData[0];break}return b};
71
+ _.h.yj=function(a){if(2!==a.request.type||a.uri.startsWith("data:"))return Promise.resolve(a);var b=a.request.timescale||this.B.timescale,c={isLive:this.Rc.bind(this),zd:this.pe.bind(this),ii:function(){return 1},he:this.Bf.bind(this)},d=!1,e=new _.J(_.K,3,4035,null),f=null;try{f=mG(a,b,c)}catch(g){d=!0,e.data=g,3E3===g.code&&(e.code=4039)}if(d||!f)return Promise.reject(e);a.data=f;return Promise.resolve(a)};var BG={video:_.Je,audio:_.cc,text:_.Vb},pG="VOD",uG="LIVE",CG={Qj:"caption",Zj:_.oe};_.u(EG,_.mn);EG.prototype.Ea=function(){_.lo.ism=qG;_.jo[_.Wb]=qG};EG.prototype.va=function(){_.iv("ism");_.jv(_.Wb)};EG.prototype.id=function(){return"smooth"};_.A("clpp.smooth.SmoothComponent",EG);};
72
72
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
73
73
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
74
74
  else{_=this.clpp._;(f.call(g,this));}