@castlabs/prestoplay 6.25.2-beta.7 → 6.25.2

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 (65) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +7 -7
  5. package/cjs/cl.cast.js +105 -105
  6. package/cjs/cl.conviva.js +31 -31
  7. package/cjs/cl.core.js +329 -329
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +88 -88
  10. package/cjs/cl.externs.js +31 -31
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +77 -77
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +30 -30
  15. package/cjs/cl.ima.js +24 -24
  16. package/cjs/cl.mediatailor.js +3 -3
  17. package/cjs/cl.mse.js +291 -289
  18. package/cjs/cl.muxdata.js +9 -9
  19. package/cjs/cl.persistent.js +10 -10
  20. package/cjs/cl.playlist.js +4 -4
  21. package/cjs/cl.sessions.js +8 -8
  22. package/cjs/cl.simid.js +4 -4
  23. package/cjs/cl.smooth.js +72 -72
  24. package/cjs/cl.thumbnails.js +11 -11
  25. package/cjs/cl.tizen.js +69 -69
  26. package/cjs/cl.ttml.js +3 -3
  27. package/cjs/cl.verimatrix.js +2 -2
  28. package/cjs/cl.vimond.js +8 -8
  29. package/cjs/cl.vr.js +7 -7
  30. package/cjs/cl.vtt.js +2 -2
  31. package/cjs/cl.yospace.js +2 -2
  32. package/cjs/cl.youbora.js +17 -17
  33. package/cl.adobe.js +3 -3
  34. package/cl.airplay.js +3 -3
  35. package/cl.broadpeak.js +5 -5
  36. package/cl.cast.js +84 -84
  37. package/cl.conviva.js +26 -26
  38. package/cl.core.js +178 -178
  39. package/cl.crypto.js +8 -8
  40. package/cl.dash.js +82 -82
  41. package/cl.externs.js +31 -31
  42. package/cl.freewheel.js +19 -19
  43. package/cl.hls.js +80 -80
  44. package/cl.hlssmpte.js +5 -5
  45. package/cl.htmlcue.js +26 -26
  46. package/cl.ima.js +17 -18
  47. package/cl.mediatailor.js +3 -3
  48. package/cl.mse.js +243 -243
  49. package/cl.muxdata.js +6 -6
  50. package/cl.persistent.js +2 -2
  51. package/cl.playlist.js +4 -4
  52. package/cl.sessions.js +2 -2
  53. package/cl.simid.js +1 -1
  54. package/cl.smooth.js +60 -60
  55. package/cl.thumbnails.js +9 -9
  56. package/cl.tizen.js +54 -54
  57. package/cl.ttml.js +2 -2
  58. package/cl.verimatrix.js +1 -1
  59. package/cl.vimond.js +3 -3
  60. package/cl.vr.js +2 -2
  61. package/cl.vtt.js +2 -2
  62. package/cl.yospace.js +2 -2
  63. package/cl.youbora.js +12 -12
  64. package/package.json +1 -1
  65. package/typings.d.ts +9 -0
package/cjs/cl.muxdata.js CHANGED
@@ -1,16 +1,16 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var uC=function(a){switch(a.type){case 1:return rC;case 2:return sC;case 3:return tC}},wC=function(a){var b=Object.keys(a).find(function(c){return vC.includes(c.toLowerCase())});return void 0!==b?a[b]:void 0},xC=function(a,b){this.m=a;this.o=this.f=null;this.B=("000000"+(Math.random()*Math.pow(36,6)<<0).toString(36)).slice(-6);this.a=new _.gi;this.g=b;this.A=this.l=this.h=!1;this.w=null;this.j=a.getNetworkEngine();this.G=this.Nk.bind(this);this.C=this.ao.bind(this)},zC=function(a){var b={debug:!0,
3
- data:yC(a)};a.f&&a.f.muxOptionsOverride&&_.L.wd(a.f.muxOptionsOverride)&&(b=_.L.ta(b,a.f.muxOptionsOverride));b=_.L.ta(b,{getPlayheadTime:function(){return 1E3*a.m.getPosition()},getStateData:function(){a.g.debug("getStateData()");var c=a.m.getLoadedSource(),d=a.m.getTrackManager(),e=a.m.getSurface(),f={player_is_paused:a.m.isPaused(),player_is_fullscreen:e.isFullscreen(),video_source_duration:1E3*a.m.getDuration(),player_autoplay_on:!!a.m.getConfiguration().autoplay};if(c){var g=new _.Mk(c.url);
2
+ var f=function(window){var uC=function(a){switch(a.type){case 1:return rC;case 2:return sC;case 3:return tC}},wC=function(a){var b=Object.keys(a).find(function(c){return vC.includes(c.toLowerCase())});return void 0!==b?a[b]:void 0},xC=function(a,b){this.m=a;this.o=this.f=null;this.B=("000000"+(Math.random()*Math.pow(36,6)<<0).toString(36)).slice(-6);this.a=new _.gi;this.g=b;this.A=this.l=this.h=!1;this.w=null;this.j=a.getNetworkEngine();this.G=this.Qk.bind(this);this.C=this.Pk.bind(this)},zC=function(a){var b={debug:!0,
3
+ data:yC(a)};a.f&&a.f.muxOptionsOverride&&_.L.xd(a.f.muxOptionsOverride)&&(b=_.L.ta(b,a.f.muxOptionsOverride));b=_.L.ta(b,{getPlayheadTime:function(){return 1E3*a.m.getPosition()},getStateData:function(){a.g.debug("getStateData()");var c=a.m.getLoadedSource(),d=a.m.getTrackManager(),e=a.m.getSurface(),f={player_is_paused:a.m.isPaused(),player_is_fullscreen:e.isFullscreen(),video_source_duration:1E3*a.m.getDuration(),player_autoplay_on:!!a.m.getConfiguration().autoplay};if(c){var g=new _.Mk(c.url);
4
4
  f.video_source_url=_.Nk(g);f.video_source_mime_type=c.type;c.name&&(f.video_title=c.name)}if(c=e.getContainer())f.player_width=c.offsetWidth,f.player_height=c.offsetHeight;(c=a.m.getSurface().getMedia())?c={videoWidth:c.videoWidth,videoHeight:c.videoHeight}:(c=a.m.getTrackManager().ma(),c={videoWidth:c.width,videoHeight:c.height});e=c;c=e.videoWidth;e=e.videoHeight;a.g.debug("Video dimensions: "+c+"x"+e);c&&e&&(f.video_source_height=c,f.video_source_width=e);(d=d.qa())&&d.language&&(f.player_language_code=
5
5
  d.language);return f}});a.g.debug("Mux SDK options",b);return b},yC=function(a){var b={env_key:a.f.envKey,video_title:a.o&&a.o.name||"",player_name:_.xa,player_software_name:_.xa,player_software_version:_.ia,player_mux_plugin_name:"CastlabsPlayer built-in Mux Plugin",player_mux_plugin_version:_.ia};(a=a.m.getConfiguration().viewerId)&&(b.viewer_user_id=a);return b},AC=function(a){a.a.on(a.m,_.rg,function(){var b={player_playhead_time:1E3*a.m.getPosition()};a.emit(_.rg,b)});a.a.on(a.m,_.ff,function(){return a.emit(_.ff)});
6
- a.a.on(a.m,_.Yc,a.Kk.bind(a));a.a.on(a.m,_.bg,a.Mk.bind(a));a.a.on(a.m,_.Cg,function(){return a.emit(_.Uf)});a.a.on(a.m,_.Bg,function(){return a.emit(_.Tf)});a.a.on(a.m,_.ie,a.Lk.bind(a));a.a.on(a.m,_.hc,function(){return a.emit("adbreakstart")});a.a.on(a.m,_.ic,function(){return a.emit("adbreakend")});a.a.on(a.m,_.yc,function(){a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,_.tc,function(){return a.emit("adpause")});a.a.on(a.m,_.vc,function(){a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,
7
- _.zc,function(){return a.emit("adended")});a.a.on(a.m,_.mc,function(){return a.emit("adfirstquartile")});a.a.on(a.m,_.sc,function(){return a.emit("admidpoint")});a.a.on(a.m,_.Ac,function(){return a.emit("adthirdquartile")});a.j.ed(a.G);a.j.Pf(a.C);a.a.on(a.m,_.ie,function(b){var c=b.detail;if(c&&1===c.category&&(b=(b=c.data)&&b.request,void 0!==b&&!0===(1===b.type||2===b.type||3===b.type)))if(7001===c.code){c=b.requestStartTimestamp;var d=new _.Mk(b.uris[b.uriIndex]);b={request_start:c,request_type:uC(b),
6
+ a.a.on(a.m,_.Yc,a.Mk.bind(a));a.a.on(a.m,_.bg,a.Ok.bind(a));a.a.on(a.m,_.Cg,function(){return a.emit(_.Uf)});a.a.on(a.m,_.Bg,function(){return a.emit(_.Tf)});a.a.on(a.m,_.ie,a.Nk.bind(a));a.a.on(a.m,_.hc,function(){return a.emit("adbreakstart")});a.a.on(a.m,_.ic,function(){return a.emit("adbreakend")});a.a.on(a.m,_.xc,function(){a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,_.tc,function(){return a.emit("adpause")});a.a.on(a.m,_.vc,function(){a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,
7
+ _.zc,function(){return a.emit("adended")});a.a.on(a.m,_.mc,function(){return a.emit("adfirstquartile")});a.a.on(a.m,_.sc,function(){return a.emit("admidpoint")});a.a.on(a.m,_.Ac,function(){return a.emit("adthirdquartile")});a.j.fd(a.G);a.j.Qe(a.C);a.a.on(a.m,_.ie,function(b){var c=b.detail;if(c&&1===c.category&&(b=(b=c.data)&&b.request,void 0!==b&&!0===(1===b.type||2===b.type||3===b.type)))if(7001===c.code){c=b.requestStartTimestamp;var d=new _.Mk(b.uris[b.uriIndex]);b={request_start:c,request_type:uC(b),
8
8
  request_hostname:d.a};a.g.debug("onRequestCanceled()","Track event: requestcanceled",b);a.emit("requestcanceled",b)}else{d=b.requestStartTimestamp;var e=new _.Mk(b.uris[b.uriIndex]),f=c.data;b={request_start:d,request_type:uC(b),request_hostname:e.a,request_error:""+uC(b)+"LoadError",request_error_code:void 0===f?-1:void 0!==f.response?f.response.status:void 0!==f.status?f.status:-1,request_error_text:c.toString()};a.g.debug("onRequestFailed()","Track event: requestfailed",b);a.emit("requestfailed",
9
- b)}})},BC=function(a){_.ki(a.a);a.j.xe(a.G);a.j.Gg(a.C)},CC=function(){this.f=this.m=null;this.a=!1;this.g=new _.J("clpp.muxdata")},DC=function(a){return!_.L.R(a)&&typeof a.init===_.me&&typeof a.emit===_.me},EC=function(a,b){a.trigger(new _.K(_.ie,{detail:b}))},FC=function(){},rC="manifest",sC="media",tC="encryption",vC=["x-request-id","cf-ray","x-amz-cf-id","x-akamai-request-id"];_.r=xC.prototype;_.r.initialize=function(a,b,c){this.f=a;this.o=b;this.w=c;if(!this.h){try{this.h=!0,this.w.init(this.B,zC(this))}catch(d){throw this.h=!1,BC(this),new _.N(1,9,9302,null,d);}this.emit("playerready")}this.l&&!this.A&&(a=yC(this),this.emit("videochange",a),this.l=!1);AC(this)};_.r.release=function(){this.g.debug("release()");this.l?this.g.debug(_.na):(BC(this),this.l=!0,this.o=this.f=null)};_.r.destroy=function(){this.g.debug(_.Nd);this.A?this.g.debug(_.ma):(this.A=!0,this.emit("destroy"))};
10
- _.r.emit=function(a,b){if(null===this.w)throw new _.N(1,9,9301);this.w.emit(this.B,a,b)};_.r.Kk=function(a){this.g.debug(_.Se);var b=a.detail;a=this.m.getTrackManager();b&&b.bandwidth&&(b=b.bandwidth,(a=a.Sa())&&a.bandwidth&&(b+=a.bandwidth),this.emit("renditionchange",{video_source_bitrate:b}))};_.r.Mk=function(a){this.g.debug(_.Xe);switch(a.detail.currentState){case _.Fq:this.m.getConfiguration().autoplay&&this.emit(_.ff);break;case _.Hq:this.emit(_.rf);break;case _.Gq:this.emit(_.bf);break;case _.Aq:this.emit(_.he)}};
11
- _.r.Lk=function(a){this.g.debug(_.Ue);if(this.h&&(a=a.detail||null))if(10003===a.code)this.emit("aderror");else if(a.severity===_.O){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);this.emit(_.ie,{player_error_code:a.code,player_error_message:b})}};
12
- _.r.Nk=function(a){var b=a.request;if(b=void 0!==b&&!0===(1===b.type||2===b.type||3===b.type))b=a.status,b=void 0!==b&&200<=b&&299>=b;if(b){b=a.request;var c=a.headers,d=b.bytesLoaded,e=b.requestStartTimestamp,f=b.startTime,g=b.endTime,h=e+a.responseStartMs;a=e+a.timeMs;f=f&&g?g-f:void 0;g=new _.Mk(b.uris[b.uriIndex]);a={request_start:e,request_type:uC(b),request_hostname:g.a,request_id:wC(c),request_bytes_loaded:d,request_response_start:h,request_response_end:a,request_response_headers:c,request_media_duration:f,
13
- request_url:_.Nk(g)};this.g.debug("onRequestCompleted()","Track event: requestcompleted",a);this.emit("requestcompleted",a)}};_.r.ao=function(a){a.requestStartTimestamp=Date.now()};_.w(CC,_.bw);_.r=CC.prototype;_.r.onPlayerCreated=function(a){this.m=a;this.f=new xC(a,this.g)};
9
+ b)}})},BC=function(a){_.ki(a.a);a.j.ye(a.G);a.j.Bf(a.C)},CC=function(){this.f=this.m=null;this.a=!1;this.g=new _.J("clpp.muxdata")},DC=function(a){return!_.L.R(a)&&typeof a.init===_.oe&&typeof a.emit===_.oe},EC=function(a,b){a.trigger(new _.K(_.ie,{detail:b}))},FC=function(){},rC="manifest",sC="media",tC="encryption",vC=["x-request-id","cf-ray","x-amz-cf-id","x-akamai-request-id"];_.r=xC.prototype;_.r.initialize=function(a,b,c){this.f=a;this.o=b;this.w=c;if(!this.h){try{this.h=!0,this.w.init(this.B,zC(this))}catch(d){throw this.h=!1,BC(this),new _.N(1,9,9302,null,d);}this.emit("playerready")}this.l&&!this.A&&(a=yC(this),this.emit("videochange",a),this.l=!1);AC(this)};_.r.release=function(){this.g.debug("release()");this.l?this.g.debug(_.na):(BC(this),this.l=!0,this.o=this.f=null)};_.r.destroy=function(){this.g.debug(_.Nd);this.A?this.g.debug(_.ma):(this.A=!0,this.emit("destroy"))};
10
+ _.r.emit=function(a,b){if(null===this.w)throw new _.N(1,9,9301);this.w.emit(this.B,a,b)};_.r.Mk=function(a){this.g.debug(_.Se);var b=a.detail;a=this.m.getTrackManager();b&&b.bandwidth&&(b=b.bandwidth,(a=a.Sa())&&a.bandwidth&&(b+=a.bandwidth),this.emit("renditionchange",{video_source_bitrate:b}))};_.r.Ok=function(a){this.g.debug(_.Xe);switch(a.detail.currentState){case _.Fq:this.m.getConfiguration().autoplay&&this.emit(_.ff);break;case _.Hq:this.emit(_.rf);break;case _.Gq:this.emit(_.bf);break;case _.Aq:this.emit(_.he)}};
11
+ _.r.Nk=function(a){this.g.debug(_.Ue);if(this.h&&(a=a.detail||null))if(10003===a.code)this.emit("aderror");else if(a.severity===_.O){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);this.emit(_.ie,{player_error_code:a.code,player_error_message:b})}};
12
+ _.r.Qk=function(a){var b=a.request;if(b=void 0!==b&&!0===(1===b.type||2===b.type||3===b.type))b=a.status,b=void 0!==b&&200<=b&&299>=b;if(b){b=a.request;var c=a.headers,d=b.bytesLoaded,e=b.requestStartTimestamp,f=b.startTime,g=b.endTime,h=e+a.responseStartMs;a=e+a.timeMs;f=f&&g?g-f:void 0;g=new _.Mk(b.uris[b.uriIndex]);a={request_start:e,request_type:uC(b),request_hostname:g.a,request_id:wC(c),request_bytes_loaded:d,request_response_start:h,request_response_end:a,request_response_headers:c,request_media_duration:f,
13
+ request_url:_.Nk(g)};this.g.debug("onRequestCompleted()","Track event: requestcompleted",a);this.emit("requestcompleted",a)}};_.r.Pk=function(a){a.requestStartTimestamp=Date.now()};_.w(CC,_.bw);_.r=CC.prototype;_.r.onPlayerCreated=function(a){this.m=a;this.f=new xC(a,this.g)};
14
14
  _.r.onContentWillLoad=function(a,b){var c=a.getConfiguration();c=_.L.kb(c.muxdata);try{var d=[];typeof c===_.Re&&(c.envKey||d.push("envKey"));if(0<d.length)throw new _.N(1,9,9300,{missingKeys:d});var e=a.getConfiguration();d=null;if(this.a=!_.L.R(e.muxdata)&&typeof e.muxdata===_.Re){var f=e.muxdata;d=DC(f.muxLib)?f.muxLib:window.mux;if(!DC(d)){this.g.warn("Mux SDK is not loaded. Will do nothing.");this.a=!1;var g=new _.N(1,9,9301);EC(a,g)}}else this.g.debug("Mux plugin is loaded but not configured. Will do nothing.");
15
15
  var h=d;null!==h&&this.f.initialize(c,b,h)}catch(l){this.a=!1,EC(a,l)}};_.r.onContentLoaded=function(){};_.r.onPlayerWillDestroy=function(){this.a&&(this.f.destroy(),this.m=this.f=null)};_.r.onPlayerWillRelease=function(){this.a&&this.f.release()};_.r.id=function(){return"mux"};_.r.emit=function(a,b){try{this.f.emit(a,b)}catch(c){throw null!==this.m&&EC(this.m,c),c;}};_.I("clpp.muxdata.MuxDataPlugin",CC);CC.prototype.emit=CC.prototype.emit;CC.Id="mux";FC.prototype.create=function(){return new CC};
16
16
  _.Yt(new FC);};
@@ -1,19 +1,19 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
2
  var f=function(window){var YB="A persistent DRM session already exists for: ",ZB="No DRM configuration.",$B="clpp.persistent",aC="clpp.persistent.SimpleSessionStorage",bC=function(a,b){for(var c=[],d=_.u(a),e=d.next();!e.done;e=d.next())c.push(b(e.value));return c},cC=function(a){a=a.h.keys();a=bC(a,function(b){return b.sessionId});return Array.from(a)},dC=function(a,b){var c,d,e;return _.H(function(f){if(1==f.a)return _.x(f,_.Ip(a,b),2);c=f.f;if(!c)return a.g.debug("Ignoring attempt to remove missing session",b),f["return"]();
3
- d=[];(e=a.h.get(c))&&a.C&&(e.xc=new _.kk,d.push(e.xc));a.g.debug("Attempting to remove session",b);d.push(c.remove());return f["return"](Promise.all(d))})},fC=function(a,b){a.L=eC;a.N=[];a.H=!0;return _.kp(a,b)},hC=function(a,b,c,d,e,f){a.L=gC;var g=new Map,h=_.Np(b);g.set(h,{audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:_.Ze,persistentState:_.Mf,sessionTypes:[_.df],label:h,drmInfos:[{keySystem:b,licenseServerUri:c,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",
3
+ d=[];(e=a.h.get(c))&&a.C&&(e.yc=new _.kk,d.push(e.yc));a.g.debug("Attempting to remove session",b);d.push(c.remove());return f["return"](Promise.all(d))})},fC=function(a,b){a.L=eC;a.N=[];a.H=!0;return _.kp(a,b)},hC=function(a,b,c,d,e,f){a.L=gC;var g=new Map,h=_.Np(b);g.set(h,{audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:_.Ze,persistentState:_.Mf,sessionTypes:[_.df],label:h,drmInfos:[{keySystem:b,licenseServerUri:c,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",
4
4
  videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}]});return _.up(a,g)},iC=function(){this.g=new _.J(aC)},jC=function(a){a=JSON.parse(a);var b=JSON.parse(a.sessionIds),c=a.audioCapabilities||[],d=a.videoCapabilities||[],e=a.serverCertificate||[],f=a.drmConfig||{};return{sessionIds:b,keySystem:a.keySystem,licenseServerUri:decodeURIComponent(a.licenseServerUri||""),serverCertificate:e?new Uint8Array(e):null,audioCapabilities:c,videoCapabilities:d,drmConfig:f}},kC=function(a,b){var c=
5
- _.Ym(a),d=_.vm({drm:a});d.drm=a;var e=new _.gp({Cb:b,onError:function(){},ug:function(){},tg:function(){},onEvent:function(){},getConfiguration:function(){return d},td:function(){return null}});e.f=c;return e},nC=function(a,b,c){var d,e,f,g,h,l,m,n,p;return _.H(function(q){switch(q.a){case 1:d=lC;e=mC;if(!a)return e.debug(ZB),q["return"]();f=a.offlineId;return 0===f.length?q["return"]():_.x(q,d.get(f),2);case 2:if(g=q.f)return e.debug(YB,f),q["return"]();h=kC(a,c);_.C(q,3,4);return _.x(q,fC(h,b),
6
- 6);case 6:return _.x(q,_.Bp(h),7);case 7:return _.x(q,_.Cp(h),8);case 8:return l=h.getDrmInfo(),m=b.map(function(t){return{contentType:_.ol(t.video.mimeType,t.video.codecs),robustness:l.videoRobustness}}),n=cC(h),g={sessionIds:n,keySystem:l.keySystem,licenseServerUri:l.licenseServerUri,serverCertificate:l.serverCertificate,audioCapabilities:[],videoCapabilities:m,drmConfig:a},_.x(q,d.store(f,g),4);case 4:return _.vh(q),_.x(q,h.destroy(),10);case 10:_.wh(q);break;case 3:throw p=_.D(q),e.error("Error while persisting DRM session "+
5
+ _.Ym(a),d=_.vm({drm:a});d.drm=a;var e=new _.gp({Db:b,onError:function(){},xg:function(){},wg:function(){},onEvent:function(){},getConfiguration:function(){return d},ud:function(){return null}});e.f=c;return e},nC=function(a,b,c){var d,e,f,g,h,l,m,n,p;return _.H(function(q){switch(q.a){case 1:d=lC;e=mC;if(!a)return e.debug(ZB),q["return"]();f=a.offlineId;return 0===f.length?q["return"]():_.x(q,d.get(f),2);case 2:if(g=q.f)return e.debug(YB,f),q["return"]();h=kC(a,c);_.C(q,3,4);return _.x(q,fC(h,b),
6
+ 6);case 6:return _.x(q,_.Bp(h),7);case 7:return _.x(q,_.Cp(h),8);case 8:return l=h.getDrmInfo(),m=b.map(function(t){return{contentType:_.ol(t.video.mimeType,t.video.codecs),robustness:l.videoRobustness}}),n=cC(h),g={sessionIds:n,keySystem:l.keySystem,licenseServerUri:l.licenseServerUri,serverCertificate:l.serverCertificate,audioCapabilities:[],videoCapabilities:m,drmConfig:a},_.x(q,d.store(f,g),4);case 4:return _.vh(q),_.x(q,h.destroy(),10);case 10:_.wh(q);break;case 3:throw p=_.E(q),e.error("Error while persisting DRM session "+
7
7
  f),new _.N(1,6,6200,null,p);}})},oC=function(){this.g=new _.J($B)},eC=1,gC=2;_.r=iC.prototype;
8
8
  _.r.store=function(a,b){var c;return _.H(function(d){var e=JSON.stringify(b.sessionIds),f=b.serverCertificate?Array.from(b.serverCertificate):null;f=JSON.stringify(f);var g=JSON.stringify(b.audioCapabilities),h=JSON.stringify(b.videoCapabilities);c=JSON.stringify({sessionIds:e,keySystem:b.keySystem,licenseServerUri:encodeURIComponent(b.licenseServerUri),serverCertificate:f,audioCapabilities:g,videoCapabilities:h,drmConfig:JSON.stringify(b.drmConfig)});window.localStorage.setItem(encodeURIComponent(a),
9
- btoa(c));_.y(d)})};_.r.get=function(a){var b=this,c;return _.H(function(d){if(c=window.localStorage.getItem(encodeURIComponent(a)))try{return d["return"](jC(atob(c)))}catch(e){b.g.warn("Error while loading offline items for "+a+" from storage: ",e)}return d["return"](null)})};_.r["delete"]=function(a){return _.H(function(b){window.localStorage.removeItem(encodeURIComponent(a));_.y(b)})};_.r.clear=function(){return _.H(function(a){window.localStorage.clear();_.y(a)})};_.r.getName=function(){return aC};_.I("clpp.persistent.useStorage",function(a){var b=["store","get","delete","clear","getName"];var c=[];_.L.R(a)||(_.L.Tb(a.store)||c.push("store"),_.L.Tb(a.get)||c.push("get"),_.L.Tb(a["delete"])||c.push("delete"),_.L.Tb(a.clear)||c.push("clear"),_.L.Tb(a.getName)||c.push("getName"),b=c);if(0<b.length)throw mC.warn("Invalid session storage implementation"),new _.N(1,6,6202,{missingMethods:b});lC=a});
10
- _.I("clpp.persistent.fetchLicense",function(a,b,c){for(var d=[],e=2;e<arguments.length;++e)d[e-2]=arguments[e];var f,g,h,l,m,n,p,q,t,v,z,A,E,G,B,F,M,R,ka;return _.H(function(U){switch(U.a){case 1:f=lC;g=mC;h=function(qa,Ba){return new _.N(1,6,6200,qa,Ba)};l=_.Lq(a).shift();if(!l)throw h("No source specified.");if(!b)throw h(ZB);m=b.offlineId;if(typeof m!==_.eg||!m.length)throw h("Missing offline id.");return _.x(U,f.get(m),2);case 2:if(n=U.f)return g.debug(YB,m),U["return"]();p=_.vm();q=new _.vk;
11
- t=[];v=_.u(d);for(z=v.next();!z.done;z=v.next())A=z.value,E=new A,_.zm(E.id())||(E.f(),_.Bm(E),t.push(E));G=null;_.C(U,3,4);return _.x(U,_.av(l.url,q,p.manifest.attemptParameters,l.type||null),6);case 6:return G=U.f,G.configure(p.manifest),_.x(U,G.start(l.url,{configurationId:"",networkingEngine:q,onContentSteeringInfoFound:function(){return null},filterAllPeriods:function(){},filterNewPeriod:function(){},onEvent:function(){},onError:function(){}}),7);case 7:B=U.f;if(!B.periods.length)throw h(null,
12
- new _.N(_.O,4,4014));F=_.Su(B.periods);return _.x(U,nC(b,F,q),4);case 4:for(_.vh(U);t.length;)M=t.shift(),M.a(),_.ym["delete"](M.id());R=[];G&&R.push(G.stop());R.push(q.destroy());return _.x(U,Promise.all(R),9);case 9:_.wh(U);break;case 3:ka=_.D(U);if(ka instanceof _.N&&6200===ka.code)throw ka;throw h(null,ka);}})});
9
+ btoa(c));_.y(d)})};_.r.get=function(a){var b=this,c;return _.H(function(d){if(c=window.localStorage.getItem(encodeURIComponent(a)))try{return d["return"](jC(atob(c)))}catch(e){b.g.warn("Error while loading offline items for "+a+" from storage: ",e)}return d["return"](null)})};_.r["delete"]=function(a){return _.H(function(b){window.localStorage.removeItem(encodeURIComponent(a));_.y(b)})};_.r.clear=function(){return _.H(function(a){window.localStorage.clear();_.y(a)})};_.r.getName=function(){return aC};_.I("clpp.persistent.useStorage",function(a){var b=["store","get","delete","clear","getName"];var c=[];_.L.R(a)||(_.L.Ub(a.store)||c.push("store"),_.L.Ub(a.get)||c.push("get"),_.L.Ub(a["delete"])||c.push("delete"),_.L.Ub(a.clear)||c.push("clear"),_.L.Ub(a.getName)||c.push("getName"),b=c);if(0<b.length)throw mC.warn("Invalid session storage implementation"),new _.N(1,6,6202,{missingMethods:b});lC=a});
10
+ _.I("clpp.persistent.fetchLicense",function(a,b,c){for(var d=[],e=2;e<arguments.length;++e)d[e-2]=arguments[e];var f,g,h,l,m,n,p,q,t,v,z,A,D,G,B,F,M,R,ka;return _.H(function(U){switch(U.a){case 1:f=lC;g=mC;h=function(qa,Ba){return new _.N(1,6,6200,qa,Ba)};l=_.Lq(a).shift();if(!l)throw h("No source specified.");if(!b)throw h(ZB);m=b.offlineId;if(typeof m!==_.eg||!m.length)throw h("Missing offline id.");return _.x(U,f.get(m),2);case 2:if(n=U.f)return g.debug(YB,m),U["return"]();p=_.vm();q=new _.vk;
11
+ t=[];v=_.u(d);for(z=v.next();!z.done;z=v.next())A=z.value,D=new A,_.zm(D.id())||(D.f(),_.Bm(D),t.push(D));G=null;_.C(U,3,4);return _.x(U,_.av(l.url,q,p.manifest.attemptParameters,l.type||null),6);case 6:return G=U.f,G.configure(p.manifest),_.x(U,G.start(l.url,{configurationId:"",networkingEngine:q,onContentSteeringInfoFound:function(){return null},filterAllPeriods:function(){},filterNewPeriod:function(){},onEvent:function(){},onError:function(){}}),7);case 7:B=U.f;if(!B.periods.length)throw h(null,
12
+ new _.N(_.O,4,4014));F=_.Su(B.periods);return _.x(U,nC(b,F,q),4);case 4:for(_.vh(U);t.length;)M=t.shift(),M.a(),_.ym["delete"](M.id());R=[];G&&R.push(G.stop());R.push(q.destroy());return _.x(U,Promise.all(R),9);case 9:_.wh(U);break;case 3:ka=_.E(U);if(ka instanceof _.N&&6200===ka.code)throw ka;throw h(null,ka);}})});
13
13
  _.I("clpp.persistent.removeLicense",function(a){var b,c,d,e,f,g,h;return _.H(function(l){switch(l.a){case 1:b=lC;c=mC;if(!_.L.ia(a)||0===a.length)return c.warn("Invalid offlineId"),l["return"]();e=d=null;_.C(l,2,3);return _.x(l,b.get(a),5);case 5:f=l.f;if(!f)return c.debug("No persistent DRM session found"),l["return"]();f.drmConfig.delayLicenseRequestUntilPlayed=!0;e=new _.vk;d=kC(f.drmConfig,e);return _.x(l,hC(d,f.keySystem,f.licenseServerUri,f.serverCertificate,f.audioCapabilities,f.videoCapabilities),
14
- 6);case 6:return _.x(l,_.Bp(d),7);case 7:return _.x(l,Promise.all(f.sessionIds.map(function(m){return _.H(function(n){if(1==n.a)return _.x(n,dC(d,m),2);c.debug("successfully removed session with id",m);_.y(n)})})),8);case 8:return _.x(l,b["delete"](a),3);case 3:return _.vh(l),g=[],d&&g.push(d.destroy()),e&&g.push(e.destroy()),_.x(l,Promise.all(g),10);case 10:_.wh(l);break;case 2:throw h=_.D(l),c.error("Failed to remove session"),new _.N(1,6,6201,null,h);}})});
15
- _.I("clpp.persistent.getSessionStorage",function(){return lC});var lC=new iC,mC=new _.J($B);_.w(oC,_.Bu);oC.prototype.id=function(){return _.cf};oC.prototype.l=function(a,b){var c=this,d,e,f;return _.H(function(g){if(1==g.a){d=a.getConfiguration().drm;if(!d)return c.g.debug("No DRM configuration found for loaded source."),g["return"]();c.g.debug("Persisting DRM session ID: "+d.offlineId);e=a.getNetworkEngine();_.C(g,2);return _.x(g,nC(d,b,e),4)}if(2!=g.a)return a.trigger(new _.K(_.ae,{offlineId:d.offlineId})),_.uh(g,0);f=_.D(g);a.onError(f);_.y(g)})};
16
- oC.prototype.j=function(a){var b=this,c,d;return _.H(function(e){if(1==e.a)return b.g.debug("Getting EME session IDs for "+a),c=lC,_.C(e,2),_.x(e,c.get(a),4);if(2!=e.a){if(d=e.f)return e["return"](d.sessionIds||[]);b.g.debug("No offline session found for "+a);return e["return"]([])}_.D(e);b.g.warn("Error while loading session info from storage");return e["return"]([])})};_.I("clpp.persistent.PersistentLicenseComponent",oC);};
14
+ 6);case 6:return _.x(l,_.Bp(d),7);case 7:return _.x(l,Promise.all(f.sessionIds.map(function(m){return _.H(function(n){if(1==n.a)return _.x(n,dC(d,m),2);c.debug("successfully removed session with id",m);_.y(n)})})),8);case 8:return _.x(l,b["delete"](a),3);case 3:return _.vh(l),g=[],d&&g.push(d.destroy()),e&&g.push(e.destroy()),_.x(l,Promise.all(g),10);case 10:_.wh(l);break;case 2:throw h=_.E(l),c.error("Failed to remove session"),new _.N(1,6,6201,null,h);}})});
15
+ _.I("clpp.persistent.getSessionStorage",function(){return lC});var lC=new iC,mC=new _.J($B);_.w(oC,_.Bu);oC.prototype.id=function(){return _.cf};oC.prototype.l=function(a,b){var c=this,d,e,f;return _.H(function(g){if(1==g.a){d=a.getConfiguration().drm;if(!d)return c.g.debug("No DRM configuration found for loaded source."),g["return"]();c.g.debug("Persisting DRM session ID: "+d.offlineId);e=a.getNetworkEngine();_.C(g,2);return _.x(g,nC(d,b,e),4)}if(2!=g.a)return a.trigger(new _.K(_.ae,{offlineId:d.offlineId})),_.uh(g,0);f=_.E(g);a.onError(f);_.y(g)})};
16
+ oC.prototype.j=function(a){var b=this,c,d;return _.H(function(e){if(1==e.a)return b.g.debug("Getting EME session IDs for "+a),c=lC,_.C(e,2),_.x(e,c.get(a),4);if(2!=e.a){if(d=e.f)return e["return"](d.sessionIds||[]);b.g.debug("No offline session found for "+a);return e["return"]([])}_.E(e);b.g.warn("Error while loading session info from storage");return e["return"]([])})};_.I("clpp.persistent.PersistentLicenseComponent",oC);};
17
17
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
18
18
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
19
19
  else{_=this.clpp._;(f.call(g,this));}
@@ -1,9 +1,9 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
2
  var f=function(window){var VB=function(a,b){b=void 0===b?function(){return Promise.resolve()}:b;_.mm.call(this);this.m=a;this.l=b;this.f=0;this.a=[];this.h=!1;this.j=this.Fa.bind(this)},WB=function(a){a.trigger(new _.K(_.tf))},XB=function(a,b){return 0<=b&&b<a.a.length};_.w(VB,_.mm);_.r=VB.prototype;_.r.on=function(a,b,c){return _.mm.prototype.on.call(this,a,b,c)};_.r.one=function(a,b,c){return _.mm.prototype.one.call(this,a,b,c)};_.r.off=function(a,b){return _.mm.prototype.off.call(this,a,b)};_.r.getPosition=function(){return this.f};
3
- _.r.Wl=function(){return this.a};_.r.fe=function(){return 0<this.a.length&&XB(this,this.f)?this.a[this.f]:null};_.r.Yl=function(){var a=this.f+1;return 0<this.a.length&&XB(this,a)?this.a[a]:null};_.r.qm=function(){return this.h};_.r.start=function(){this.h||(this.h=!0,this.m.on(_.he,this.j),this.af(this.f,!0))};_.r.stop=function(){this.h=!1;this.m.off(_.he,this.j)};_.r.Fa=function(){this.next()};
4
- _.r.next=function(){var a=this,b;return _.H(function(c){b=Math.min(a.a.length-1,a.f+1);return _.x(c,a.af(b),0)})};_.r.Un=function(){var a=this,b;return _.H(function(c){b=Math.max(0,a.f-1);return _.x(c,a.af(b),0)})};_.r.af=function(a,b){b=void 0===b?!1:b;var c=this,d;return _.H(function(e){if(1==e.a){if(!(0<c.a.length&&XB(c,a))||!b&&c.f===a)return e["return"]();c.f=a;return(d=c.fe())?_.x(e,c.l(d),3):e.F(0)}if(4!=e.a)return _.x(e,c.m.load(d.configuration),4);c.trigger(new _.K(_.sf,{item:d}));_.y(e)})};
5
- _.r.append=function(a){this.a.push(a);WB(this)};_.r.km=function(a,b){if(0<=b&&b<=this.a.length){var c=this.fe();this.a.splice(b,0,a);c&&(this.f=this.a.indexOf(c));WB(this)}};_.r.remove=function(a){if(0<this.a.length&&XB(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);WB(this)}};_.r.clear=function(){this.stop();this.f=0;this.a=[];this.h=!1;WB(this)};_.I("clpp.Playlist",VB);VB.prototype.clear=VB.prototype.clear;VB.prototype.remove=VB.prototype.remove;
6
- VB.prototype.insert=VB.prototype.km;VB.prototype.append=VB.prototype.append;VB.prototype.goTo=VB.prototype.af;VB.prototype.previous=VB.prototype.Un;VB.prototype.next=VB.prototype.next;VB.prototype.onEnded=VB.prototype.Fa;VB.prototype.stop=VB.prototype.stop;VB.prototype.start=VB.prototype.start;VB.prototype.isStarted=VB.prototype.qm;VB.prototype.getUpcoming=VB.prototype.Yl;VB.prototype.getCurrent=VB.prototype.fe;VB.prototype.getQueue=VB.prototype.Wl;VB.prototype.getPosition=VB.prototype.getPosition;
3
+ _.r.am=function(){return this.a};_.r.ge=function(){return 0<this.a.length&&XB(this,this.f)?this.a[this.f]:null};_.r.cm=function(){var a=this.f+1;return 0<this.a.length&&XB(this,a)?this.a[a]:null};_.r.vm=function(){return this.h};_.r.start=function(){this.h||(this.h=!0,this.m.on(_.he,this.j),this.cf(this.f,!0))};_.r.stop=function(){this.h=!1;this.m.off(_.he,this.j)};_.r.Fa=function(){this.next()};
4
+ _.r.next=function(){var a=this,b;return _.H(function(c){b=Math.min(a.a.length-1,a.f+1);return _.x(c,a.cf(b),0)})};_.r.Zn=function(){var a=this,b;return _.H(function(c){b=Math.max(0,a.f-1);return _.x(c,a.cf(b),0)})};_.r.cf=function(a,b){b=void 0===b?!1:b;var c=this,d;return _.H(function(e){if(1==e.a){if(!(0<c.a.length&&XB(c,a))||!b&&c.f===a)return e["return"]();c.f=a;return(d=c.ge())?_.x(e,c.l(d),3):e.D(0)}if(4!=e.a)return _.x(e,c.m.load(d.configuration),4);c.trigger(new _.K(_.sf,{item:d}));_.y(e)})};
5
+ _.r.append=function(a){this.a.push(a);WB(this)};_.r.pm=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));WB(this)}};_.r.remove=function(a){if(0<this.a.length&&XB(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);WB(this)}};_.r.clear=function(){this.stop();this.f=0;this.a=[];this.h=!1;WB(this)};_.I("clpp.Playlist",VB);VB.prototype.clear=VB.prototype.clear;VB.prototype.remove=VB.prototype.remove;
6
+ VB.prototype.insert=VB.prototype.pm;VB.prototype.append=VB.prototype.append;VB.prototype.goTo=VB.prototype.cf;VB.prototype.previous=VB.prototype.Zn;VB.prototype.next=VB.prototype.next;VB.prototype.onEnded=VB.prototype.Fa;VB.prototype.stop=VB.prototype.stop;VB.prototype.start=VB.prototype.start;VB.prototype.isStarted=VB.prototype.vm;VB.prototype.getUpcoming=VB.prototype.cm;VB.prototype.getCurrent=VB.prototype.ge;VB.prototype.getQueue=VB.prototype.am;VB.prototype.getPosition=VB.prototype.getPosition;
7
7
  VB.prototype.off=VB.prototype.off;VB.prototype.one=VB.prototype.one;VB.prototype.on=VB.prototype.on;};
8
8
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
9
9
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
@@ -5,15 +5,15 @@ e){if(0<=e){var f=_.u(RA(e)),g=f.next().value;f=f.next().value;XA(d,g,f)}else f=
5
5
  ZA=function(a,b,c,d){if(!(null===c||void 0===c||typeof c===_.k&&0===c||typeof c===_.eg&&0===c.length||Array.isArray(c)&&0===c.length))if(Array.isArray(c))for(var e=0;e<c.length;e++){WA(a,b<<3|2);var f=new SA;d(f,c[e]);UA(a,f.length());aB(a,f.end())}else WA(a,b<<3|2),b=new SA,d(b,c),UA(a,b.length()),aB(a,b.end())},WA=function(a,b){for(;127<b;)a.a.push(b&127|128),b>>>=7;a.a.push(b)},XA=function(a,b,c){for(;0<c||127<b;)a.a.push(b&127|128),b=(b>>>7|c<<25)>>>0,c>>>=7;a.a.push(b)},dB=function(a,b,c,d){this.downloadId=
6
6
  a;this.h=b;this.duration=c;this.j=d;this.f=[]},eB=function(a,b){this.f=a;this.url=b;this.downloadId=null;this.headers=[];this.size=this.duration=null},fB=function(a,b){this.h=a;this.f=b},gB=function(a){this.cause=a;this.f=this.message=this.severity=this.errorCode=null},hB=function(a,b){this.key=a;this.value=b},iB=function(){this.cause=this.severity=this.code=null},jB=function(){this.data=null},kB=function(){this.data=null;var a=new Uint8Array(16);crypto.getRandomValues(a);a[6]=a[6]&15|64;a[8]=a[8]&
7
7
  63|128;this.data=a},lB=function(){this.headers=[]},mB=function(){},nB=function(a){this.j=a;this.f=this.h=this.time=this.sessionId=null},oB=function(){this.f=null;this.events=[]},pB=function(){this.f=this.h=null},qB=function(){this.f=this.h=null},rB=function(a){var b=new qB;b.h=Math.floor(a/1E3);b.f=a%1E3*1E6;return b},uB=function(a,b,c,d,e){var f=new Uint8Array([]),g=this;var h=void 0===h?2500:h;this.o=f;this.l=e;this.w=new kB;this.A=new kB;this.a=[];this.h=setInterval(function(){return sB(g)},h);
8
- this.f=null;this.j=!1;tB(this,a,b,c,d)},vB=function(a){return _.H(function(b){switch(b.a){case 1:a.h&&(clearInterval(a.h),a.h=null);if(!a.f){b.F(2);break}return _.x(b,a.f,2);case 2:if(!(0<a.a.length)){b.F(4);break}return _.x(b,sB(a),5);case 5:a.a=[];case 4:a.j=!0,_.y(b)}})},tB=function(a,b,c,d,e){var f=new lB;f.headers=[new hB("CL-BROWSER-NAME",b),new hB("CL-BROWSER-VERSION",c),new hB("CL-OS-FAMILY",d),new hB("CL-OS-VERSION",e),new hB("CL-SDK-NAME",PA),new hB("CL-SDK-NAME",PA),new hB("CL-SDK-VERSION",
8
+ this.f=null;this.j=!1;tB(this,a,b,c,d)},vB=function(a){return _.H(function(b){switch(b.a){case 1:a.h&&(clearInterval(a.h),a.h=null);if(!a.f){b.D(2);break}return _.x(b,a.f,2);case 2:if(!(0<a.a.length)){b.D(4);break}return _.x(b,sB(a),5);case 5:a.a=[];case 4:a.j=!0,_.y(b)}})},tB=function(a,b,c,d,e){var f=new lB;f.headers=[new hB("CL-BROWSER-NAME",b),new hB("CL-BROWSER-VERSION",c),new hB("CL-OS-FAMILY",d),new hB("CL-OS-VERSION",e),new hB("CL-SDK-NAME",PA),new hB("CL-SDK-NAME",PA),new hB("CL-SDK-VERSION",
9
9
  _.ia)];wB(a,f)},sB=function(a){var b,c,d,e;return _.H(function(f){if(1==f.a){if(a.j||a.f)return f["return"]();0===a.a.length&&wB(a,new mB);b=function(){};a.f=new Promise(function(g){b=g});_.th(f);c=new oB;c.f=a.o;c.events.push.apply(c.events,_.gh(a.a));d=_.gh(a.a).concat();return _.x(f,fetch(a.l,{method:_.sb,headers:{"Content-Type":"application/proto"},body:new Uint8Array(c.a())}),4)}if(2!=f.a)if(e=f.f,e.ok)a.a=a.a.filter(function(g){return!d.includes(g)});else throw Error("An error occurred while sending telemetry events to the API, status\x3d'"+
10
- (e.status+"' statusText\x3d'"+e.statusText+"'"));_.vh(f);b();a.f=null;return _.wh(f)})},wB=function(a,b){if(!a.j){var c=new nB(a.w);c.sessionId=a.A;var d=Date.now(),e=new pB;e.h=Math.floor(d/1E3);e.f=d%1E3*1E6;c.time=e;c.h=b.getId();c.f=new Uint8Array(b.a());a.a.push(c)}},xB=function(){this.reason=this.currentState=this.previousState=null},yB=function(){this.m=null;this.f=this.l=!1;this.a=new _.gi;this.h=null;this.g=new _.J("clpp.sessions.SessionsPlugin");this.o=this.cn.bind(this);this.j=this.bn.bind(this)},
11
- GB=function(a){switch(a){case _.tq:return zB;case _.Fq:return AB;case _.yq:return BB;case _.Hq:return CB;case _.Gq:return DB;case _.Aq:return EB;case _.Eq:return FB;default:return null}},OB=function(a,b){switch(a){case 1:return HB;case 2:return b===_.Jg?IB:b===_.Pc?JB:b===_.pj?KB:b===_.se?LB:MB;case 3:return NB;default:return MB}},PB=function(a){var b;_.H(function(c){if(1==c.a)return a.g.info("Destroy the session and stop sending events."),_.ki(a.a),a.f=!1,b=a.m.getNetworkEngine(),b.Gg(a.o),b.xe(a.j),
12
- QA(b,a.j),a.h?_.x(c,vB(a.h),3):c.F(0);a.h=null;_.y(c)})},QB=function(a,b){a.g.debug("Sending event",b);wB(a.h,b)},RB=function(){};SA.prototype.length=function(){return this.a.length};SA.prototype.end=function(){var a=this.a;this.a=[];return a};dB.prototype.a=function(){var a=new SA;bB(a,1,this.downloadId);VA(a,2,this.h);bB(a,3,this.duration);VA(a,4,this.j);bB(a,5,this.f);return a.end()};dB.prototype.getId=function(){return 4};eB.prototype.a=function(){var a=new SA;VA(a,1,this.f);bB(a,2,this.downloadId);$A(a,3,this.url);bB(a,4,this.headers);$A(a,5,null);bB(a,6,null);bB(a,7,this.duration);YA(a,8,this.size);return a.end()};eB.prototype.getId=function(){return 2};fB.prototype.a=function(){var a=new SA;VA(a,1,this.h);cB(a,2,this.f);return a.end()};gB.prototype.a=function(){var a=new SA;VA(a,1,this.errorCode);VA(a,2,this.severity);$A(a,3,this.message);$A(a,4,this.f);bB(a,5,this.cause);return a.end()};gB.prototype.getId=function(){return 7};hB.prototype.a=function(){var a=new SA;$A(a,1,this.key);$A(a,2,this.value);return a.end()};iB.prototype.a=function(){var a=new SA;VA(a,1,this.code);VA(a,2,this.severity);bB(a,3,this.cause);return a.end()};iB.prototype.getId=function(){return 12};jB.prototype.a=function(){var a=new SA;cB(a,1,this.data);return a.end()};_.w(kB,jB);kB.prototype.toString=function(){for(var a=[],b=0;256>b;++b)a.push((b+256).toString(16).slice(1));return a[this.data[0]]+a[this.data[1]]+a[this.data[2]]+a[this.data[3]]+"-"+a[this.data[4]]+a[this.data[5]]+"-"+a[this.data[6]]+a[this.data[7]]+"-"+a[this.data[8]]+a[this.data[9]]+"-"+a[this.data[10]]+a[this.data[11]]+a[this.data[12]]+a[this.data[13]]+a[this.data[14]]+a[this.data[15]]};lB.prototype.a=function(){var a=new SA;bB(a,1,this.headers);return a.end()};lB.prototype.getId=function(){return 1};mB.prototype.a=function(){return(new SA).end()};mB.prototype.getId=function(){return 6};nB.prototype.a=function(){var a=new SA;bB(a,1,this.j);bB(a,2,this.sessionId);bB(a,3,this.time);YA(a,4,null);$A(a,5,null);VA(a,6,this.h);cB(a,7,this.f);return a.end()};oB.prototype.a=function(){var a=new SA;cB(a,1,this.f);bB(a,2,this.events);return a.end()};pB.prototype.a=function(){var a=new SA;YA(a,1,this.h);VA(a,2,this.f);return a.end()};qB.prototype.a=function(){var a=new SA;YA(a,1,this.h);VA(a,2,this.f);return a.end()};xB.prototype.a=function(){var a=new SA;VA(a,1,this.previousState);VA(a,2,this.currentState);VA(a,3,this.reason);bB(a,4,null);bB(a,5,null);bB(a,6,null);return a.end()};xB.prototype.getId=function(){return 5};_.w(yB,_.bw);_.r=yB.prototype;_.r.onPlayerCreated=function(a){this.m=a};
13
- _.r.onContentWillLoad=function(a){var b=a.getConfiguration().sessions;(b=!(!b||typeof b!==_.Re))||this.g.debug("Sessions plugin is loaded but not configured. Will do nothing.");if(this.l=b)b=a.getConfiguration().sessions,b.apiUrl?(this.g.debug(_.ya),this.g.info("Create a session and start sending events."),a=_.sk(),this.h=new uB(a.browser,a.browserVersion.name,a.os,a.osVersion.name,b.apiUrl),this.a.on(this.m,_.bg,this.Sk.bind(this)),this.a.on(this.m,_.Uf,this.Rk.bind(this)),this.a.on(this.m,_.Tf,
14
- this.Qk.bind(this)),this.a.on(this.m,_.ie,this.Pk.bind(this)),a=this.m.getNetworkEngine(),a.Pf(this.o),a.ed(this.j),a.j.push(this.j)):(this.g.warn(OA),a.onError(new _.N(1,9,15E3,OA)))};_.r.onPlayerWillRelease=function(){PB(this)};_.r.id=function(){return"sessions"};_.r.Sk=function(a){if(!this.f){a=a.detail;var b=a.currentState,c=new xB;c.previousState=GB(a.previousState);c.currentState=GB(b);QB(this,c)}};
15
- _.r.Rk=function(){if(!this.f){var a=new xB;a.previousState=GB(this.m.getState());a.currentState=SB;QB(this,a);this.f=!0}};_.r.Qk=function(){if(this.f){var a=new xB;a.previousState=SB;a.currentState=GB(this.m.getState());QB(this,a);this.f=!1}};_.r.Pk=function(a){a=a.detail;var b=new iB;b=new gB(new fB(b.getId(),new Uint8Array(b.a())));b.errorCode=a.code;b.message=a.message;b.f=a.stack;b.severity=a.severity===_.O?TB:UB;QB(this,b)};
16
- _.r.cn=function(a){var b=new kB;a.downloadId=b;var c=new eB(OB(a.type,a.contentType),a.uris[0]);c.downloadId=b;c.headers=Object.keys(a.headers).map(function(d){return new hB(d,a.headers[d])});QB(this,c)};_.r.bn=function(a){var b=a.request.downloadId;b?(b=new dB(b,a.data.byteLength,rB(a.timeMs||0),a.status||-1),b.f=Object.keys(a.headers).map(function(c){return new hB(c,a.headers[c])}),QB(this,b)):this.g.warn("Download ID is missing on download completed event.")};RB.prototype.create=function(){return new yB};
10
+ (e.status+"' statusText\x3d'"+e.statusText+"'"));_.vh(f);b();a.f=null;return _.wh(f)})},wB=function(a,b){if(!a.j){var c=new nB(a.w);c.sessionId=a.A;var d=Date.now(),e=new pB;e.h=Math.floor(d/1E3);e.f=d%1E3*1E6;c.time=e;c.h=b.getId();c.f=new Uint8Array(b.a());a.a.push(c)}},xB=function(){this.reason=this.currentState=this.previousState=null},yB=function(){this.m=null;this.f=this.l=!1;this.a=new _.gi;this.h=null;this.g=new _.J("clpp.sessions.SessionsPlugin");this.o=this.hn.bind(this);this.j=this.gn.bind(this)},
11
+ GB=function(a){switch(a){case _.tq:return zB;case _.Fq:return AB;case _.yq:return BB;case _.Hq:return CB;case _.Gq:return DB;case _.Aq:return EB;case _.Eq:return FB;default:return null}},OB=function(a,b){switch(a){case 1:return HB;case 2:return b===_.Jg?IB:b===_.Pc?JB:b===_.pj?KB:b===_.se?LB:MB;case 3:return NB;default:return MB}},PB=function(a){var b;_.H(function(c){if(1==c.a)return a.g.info("Destroy the session and stop sending events."),_.ki(a.a),a.f=!1,b=a.m.getNetworkEngine(),b.Bf(a.o),b.ye(a.j),
12
+ QA(b,a.j),a.h?_.x(c,vB(a.h),3):c.D(0);a.h=null;_.y(c)})},QB=function(a,b){a.g.debug("Sending event",b);wB(a.h,b)},RB=function(){};SA.prototype.length=function(){return this.a.length};SA.prototype.end=function(){var a=this.a;this.a=[];return a};dB.prototype.a=function(){var a=new SA;bB(a,1,this.downloadId);VA(a,2,this.h);bB(a,3,this.duration);VA(a,4,this.j);bB(a,5,this.f);return a.end()};dB.prototype.getId=function(){return 4};eB.prototype.a=function(){var a=new SA;VA(a,1,this.f);bB(a,2,this.downloadId);$A(a,3,this.url);bB(a,4,this.headers);$A(a,5,null);bB(a,6,null);bB(a,7,this.duration);YA(a,8,this.size);return a.end()};eB.prototype.getId=function(){return 2};fB.prototype.a=function(){var a=new SA;VA(a,1,this.h);cB(a,2,this.f);return a.end()};gB.prototype.a=function(){var a=new SA;VA(a,1,this.errorCode);VA(a,2,this.severity);$A(a,3,this.message);$A(a,4,this.f);bB(a,5,this.cause);return a.end()};gB.prototype.getId=function(){return 7};hB.prototype.a=function(){var a=new SA;$A(a,1,this.key);$A(a,2,this.value);return a.end()};iB.prototype.a=function(){var a=new SA;VA(a,1,this.code);VA(a,2,this.severity);bB(a,3,this.cause);return a.end()};iB.prototype.getId=function(){return 12};jB.prototype.a=function(){var a=new SA;cB(a,1,this.data);return a.end()};_.w(kB,jB);kB.prototype.toString=function(){for(var a=[],b=0;256>b;++b)a.push((b+256).toString(16).slice(1));return a[this.data[0]]+a[this.data[1]]+a[this.data[2]]+a[this.data[3]]+"-"+a[this.data[4]]+a[this.data[5]]+"-"+a[this.data[6]]+a[this.data[7]]+"-"+a[this.data[8]]+a[this.data[9]]+"-"+a[this.data[10]]+a[this.data[11]]+a[this.data[12]]+a[this.data[13]]+a[this.data[14]]+a[this.data[15]]};lB.prototype.a=function(){var a=new SA;bB(a,1,this.headers);return a.end()};lB.prototype.getId=function(){return 1};mB.prototype.a=function(){return(new SA).end()};mB.prototype.getId=function(){return 6};nB.prototype.a=function(){var a=new SA;bB(a,1,this.j);bB(a,2,this.sessionId);bB(a,3,this.time);YA(a,4,null);$A(a,5,null);VA(a,6,this.h);cB(a,7,this.f);return a.end()};oB.prototype.a=function(){var a=new SA;cB(a,1,this.f);bB(a,2,this.events);return a.end()};pB.prototype.a=function(){var a=new SA;YA(a,1,this.h);VA(a,2,this.f);return a.end()};qB.prototype.a=function(){var a=new SA;YA(a,1,this.h);VA(a,2,this.f);return a.end()};xB.prototype.a=function(){var a=new SA;VA(a,1,this.previousState);VA(a,2,this.currentState);VA(a,3,this.reason);bB(a,4,null);bB(a,5,null);bB(a,6,null);return a.end()};xB.prototype.getId=function(){return 5};_.w(yB,_.bw);_.r=yB.prototype;_.r.onPlayerCreated=function(a){this.m=a};
13
+ _.r.onContentWillLoad=function(a){var b=a.getConfiguration().sessions;(b=!(!b||typeof b!==_.Re))||this.g.debug("Sessions plugin is loaded but not configured. Will do nothing.");if(this.l=b)b=a.getConfiguration().sessions,b.apiUrl?(this.g.debug(_.ya),this.g.info("Create a session and start sending events."),a=_.sk(),this.h=new uB(a.browser,a.browserVersion.name,a.os,a.osVersion.name,b.apiUrl),this.a.on(this.m,_.bg,this.Vk.bind(this)),this.a.on(this.m,_.Uf,this.Uk.bind(this)),this.a.on(this.m,_.Tf,
14
+ this.Tk.bind(this)),this.a.on(this.m,_.ie,this.Sk.bind(this)),a=this.m.getNetworkEngine(),a.Qe(this.o),a.fd(this.j),a.j.push(this.j)):(this.g.warn(OA),a.onError(new _.N(1,9,15E3,OA)))};_.r.onPlayerWillRelease=function(){PB(this)};_.r.id=function(){return"sessions"};_.r.Vk=function(a){if(!this.f){a=a.detail;var b=a.currentState,c=new xB;c.previousState=GB(a.previousState);c.currentState=GB(b);QB(this,c)}};
15
+ _.r.Uk=function(){if(!this.f){var a=new xB;a.previousState=GB(this.m.getState());a.currentState=SB;QB(this,a);this.f=!0}};_.r.Tk=function(){if(this.f){var a=new xB;a.previousState=SB;a.currentState=GB(this.m.getState());QB(this,a);this.f=!1}};_.r.Sk=function(a){a=a.detail;var b=new iB;b=new gB(new fB(b.getId(),new Uint8Array(b.a())));b.errorCode=a.code;b.message=a.message;b.f=a.stack;b.severity=a.severity===_.O?TB:UB;QB(this,b)};
16
+ _.r.hn=function(a){var b=new kB;a.downloadId=b;var c=new eB(OB(a.type,a.contentType),a.uris[0]);c.downloadId=b;c.headers=Object.keys(a.headers).map(function(d){return new hB(d,a.headers[d])});QB(this,c)};_.r.gn=function(a){var b=a.request.downloadId;b?(b=new dB(b,a.data.byteLength,rB(a.timeMs||0),a.status||-1),b.f=Object.keys(a.headers).map(function(c){return new hB(c,a.headers[c])}),QB(this,b)):this.g.warn("Download ID is missing on download completed event.")};RB.prototype.create=function(){return new yB};
17
17
  _.Yt(new RB);var UB=1,TB=2;var zB=0,AB=2,FB=3,SB=5,BB=6,CB=8,DB=10,EB=11;var HB=0,IB=1,JB=2,KB=3,LB=4,NB=5,MB=9;};
18
18
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
19
19
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
package/cjs/cl.simid.js CHANGED
@@ -4,17 +4,17 @@ _.qe);this.a.classList.add(_.md);this.o=function(e){if(e.source===c.a.contentWin
4
4
  f.m.getSurface()&&f.m.getSurface().getMedia()&&g.mediaDimensions){f.h?f.m.getSurface().getMedia().style.transition="":(f.m.getSurface().getMedia().style.transition="left .5s, top .5s,width .5s, height .5s",f.h=!0);var h=AA(f,g.mediaDimensions);f.m.getSurface().getMedia().style.left=h.left;f.m.getSurface().getMedia().style.top=h.top;f.m.getSurface().getMedia().style.width=h.width;f.m.getSurface().getMedia().style.height=h.height}g.creativeDimensions&&(g=AA(f,g.creativeDimensions),f.a.a.style.left=
5
5
  g.left,f.a.a.style.top=g.top,f.a.a.style.width=g.width,f.a.a.style.height=g.height);BA(c,e)}else c.g.warn("WARNING: received message without 'type' property")};this.g=new _.J("clpp.simid.SimidPlayer");CA(this.f,this)},GA=function(a){var b=EA(a,"SIMID:Player:startCreative",void 0);FA(a,b).then(function(){var c=a.f;c.g.info(yA);c.m.trigger(new _.K(_.Wf));a.a.style.opacity="1"})["catch"](function(c){a.unload();a.f.g.error("Error while starting creative",c)})},zA=function(a,b){var c;_.H(function(d){if(1==
6
6
  d.a){a.h=b.sessionId;BA(a,b);_.C(d,2);var e=a.f;var f=e.getSurface(),g=e.getContainer();e={environmentData:{videoDimensions:{x:0,y:0,height:g.clientHeight,width:g.clientWidth},creativeDimensions:{x:0,y:0,height:g.clientHeight,width:g.clientWidth},fullscreen:f.isFullscreen(),fullscreenAllowed:!0,variableDurationAllowed:!1,skippableState:"notSkippable",version:"1.1",skipoffset:"",siteUrl:window.location.toString(),appId:"",useragent:"",deviceId:"",muted:e.m.isMuted()||!1,volume:e.m.getVolume()||0,navigationSupport:"adHandles",
7
- closeButtonSupport:"adHandles",nonlinearDuration:e.f.duration},creativeData:{adParameters:e.f.adParameters||"",clickThruUri:"",clickThruUrl:""}};e=EA(a,"SIMID:Player:init",e);e=FA(a,e);return _.x(d,e,4)}if(2!=d.a)return a.g.info("Player Init acknowledged"),a.f.g.info("SIMID Player initialized"),_.uh(d,0);c=_.D(d);a.g.error("Error while initializing",c);a.f.g.error("Error while initializing SIMID player: ",c);a.unload();_.y(d)})},EA=function(a,b,c){return{type:b,sessionId:a.h,messageId:a.l++,timestamp:Date.now(),
7
+ closeButtonSupport:"adHandles",nonlinearDuration:e.f.duration},creativeData:{adParameters:e.f.adParameters||"",clickThruUri:"",clickThruUrl:""}};e=EA(a,"SIMID:Player:init",e);e=FA(a,e);return _.x(d,e,4)}if(2!=d.a)return a.g.info("Player Init acknowledged"),a.f.g.info("SIMID Player initialized"),_.uh(d,0);c=_.E(d);a.g.error("Error while initializing",c);a.f.g.error("Error while initializing SIMID player: ",c);a.unload();_.y(d)})},EA=function(a,b,c){return{type:b,sessionId:a.h,messageId:a.l++,timestamp:Date.now(),
8
8
  args:c}},HA=function(a,b){a.h?(b.type!==xA&&a.g.info("Posting message ["+b.messageId+"] '"+b.type+"':",b.args),a.a.contentWindow&&a.a.contentWindow.postMessage(JSON.stringify(b),"*")):a.g.warn("WARNING: no session available to send message '"+b.type+"'")},BA=function(a,b){HA(a,EA(a,"resolve",{messageId:b.messageId,value:void 0}))},FA=function(a,b){return new Promise(function(c,d){new IA(a.j,c,d,b);HA(a,b)})},IA=function(a,b,c,d){var e=this;var f=void 0===f?-1:f;this.f=a;this.l=b;this.j=c;this.h=d;
9
- this.a=null;this.f.set(d.messageId,this);0<=f&&(this.a=setTimeout(function(){e.resolve()},f))},JA=function(){this.g=new _.J("clpp.simid.Plugin");this.h=this.a=this.m=null;this.l=[];this.j=null;this.w=this.Tk.bind(this);this.f=null;this.o=!1},KA=function(a,b,c){return new ResizeObserver(function(){if(a.a.h){var d=a.a,e={videoDimensions:{x:0,y:0,height:b.clientHeight,width:b.clientWidth},creativeDimensions:{x:0,y:0,height:b.clientHeight,width:b.clientWidth},fullscreen:c.isFullscreen()};e=EA(d,"SIMID:Player:resize",
9
+ this.a=null;this.f.set(d.messageId,this);0<=f&&(this.a=setTimeout(function(){e.resolve()},f))},JA=function(){this.g=new _.J("clpp.simid.Plugin");this.h=this.a=this.m=null;this.l=[];this.j=null;this.w=this.Wk.bind(this);this.f=null;this.o=!1},KA=function(a,b,c){return new ResizeObserver(function(){if(a.a.h){var d=a.a,e={videoDimensions:{x:0,y:0,height:b.clientHeight,width:b.clientWidth},creativeDimensions:{x:0,y:0,height:b.clientHeight,width:b.clientWidth},fullscreen:c.isFullscreen()};e=EA(d,"SIMID:Player:resize",
10
10
  e);HA(d,e)}})},LA=function(a){this.m=a;this.a=null;this.g=new _.J("clpp.simid.Loader");this.h=!1;this.f=null},AA=function(a,b){var c=a.getContainer(),d=c.clientWidth;c=c.clientHeight;return{top:b.y/c*100+"%",left:b.x/d*100+"%",width:b.width/d*100+"%",height:b.height/c*100+"%"}},CA=function(a,b){a.g.info("SIMID Session created");a.a=b},MA=function(a){a.g.info("Stopping creative");a.m.getSurface().getMedia().style.transition=".5s";setTimeout(function(){a.m.getSurface().getMedia().style.transition=""},
11
11
  500);a.m.getSurface().getMedia().style.left="";a.m.getSurface().getMedia().style.top="";a.m.getSurface().getMedia().style.width="";a.m.getSurface().getMedia().style.height="";a.a.a.style.left="";a.a.a.style.top="";a.a.a.style.width="";a.a.a.style.height="";a.h=!1;a.m.trigger(new _.K(_.Xf))},NA=function(){};
12
12
  DA.prototype.load=function(a){window.addEventListener(_.Ie,this.o);this.h="";this.l=0;var b=this.f.url();this.g.info('Loading "'+b+'" as src of iFrame');this.a.src=b;this.g.info("Attaching iFrame");a.appendChild(this.a)};DA.prototype.unload=function(){MA(this.f);this.h=this.a.src="";this.l=0;this.a.style.opacity="0";window.removeEventListener(_.Ie,this.o);this.a.parentElement&&this.a.parentElement.removeChild(this.a)};
13
13
  IA.prototype.resolve=function(a){null!==this.a&&(clearTimeout(this.a),this.a=null);this.f["delete"](this.h.messageId);this.l(a)};IA.prototype.reject=function(a){null!==this.a&&(clearTimeout(this.a),this.a=null);this.f["delete"](this.h.messageId);this.j(a)};_.w(JA,_.bw);_.r=JA.prototype;_.r.id=function(){return"simid"};_.r.onPlayerCreated=function(a){this.g.info("New player created");this.a&&(this.a.unload(),this.a=null);this.m=a;this.h&&this.h.release();this.h=new LA(a)};
14
14
  _.r.onContentWillLoad=function(a){var b=a.getConfiguration();if(b.simid&&b.simid.creatives&&0!==b.simid.creatives.length){this.l=b.simid.creatives;this.g.info("Setting up SIMID plugin for "+this.l.length+" creatives");var c=this.m.getSurface();c?(this.g.info("Creating new session"),this.a=new DA(this.h,b.simid),b=c.getContainer(),this.j=KA(this,b,c),this.j.observe(b),a.on(_.rg,this.w)):this.g.warn(wA)}};
15
- _.r.Tk=function(){var a=this.m.getPosition();a:if(this.f&&a<this.f.startTime+this.f.duration)var b=this.f;else{for(b=0;b<this.l.length;b++){var c=this.l[b],d=c.startTime+c.duration;if(a>=c.startTime-(c.preload||5)&&a<d){b=c;break a}}b=null}b?b===this.f?(b=b.startTime,this.a&&(c=a>=b,!this.o&&c&&(GA(this.a),this.o=!0,this.g.info(yA)),c&&(c=this.a,HA(c,EA(c,xA,{currentTime:a-b}))))):((a=this.m.getSurface())||this.g.warn(wA),a=a.getContainer(),this.f=b,this.o=!1,this.g.info("Loading session"),this.h.f=
15
+ _.r.Wk=function(){var a=this.m.getPosition();a:if(this.f&&a<this.f.startTime+this.f.duration)var b=this.f;else{for(b=0;b<this.l.length;b++){var c=this.l[b],d=c.startTime+c.duration;if(a>=c.startTime-(c.preload||5)&&a<d){b=c;break a}}b=null}b?b===this.f?(b=b.startTime,this.a&&(c=a>=b,!this.o&&c&&(GA(this.a),this.o=!0,this.g.info(yA)),c&&(c=this.a,HA(c,EA(c,xA,{currentTime:a-b}))))):((a=this.m.getSurface())||this.g.warn(wA),a=a.getContainer(),this.f=b,this.o=!1,this.g.info("Loading session"),this.h.f=
16
16
  b,this.a.load(a)):this.f&&(this.a.unload(),this.f=null,this.o=!1)};_.r.onPlayerWillRelease=function(a){_.bw.prototype.onPlayerWillRelease.call(this,a);this.m.getSurface()&&(this.j&&(this.j.disconnect(),this.j=null),a.off(_.rg,this.w),this.f&&(this.a.unload(),this.f=this.h.f=null))};_.r=LA.prototype;_.r.release=function(){this.g.info("Releasing loader")};
17
- _.r.getContainer=function(){var a=this.getSurface().getContainer();if(!a)throw this.g.error("No player container found. Can not create SIMID init data"),new _.N(1,10,10100,"No player container found");return a};_.r.getSurface=function(){var a=this.m.getSurface();if(!a)throw this.g.error("No player surface found. Can not create SIMID init data"),new _.N(1,10,10100,"No surface");return a};_.r.fi=function(){return this.a};_.r.url=function(){return this.f?this.f.url:""};NA.prototype.create=function(){return new JA};
17
+ _.r.getContainer=function(){var a=this.getSurface().getContainer();if(!a)throw this.g.error("No player container found. Can not create SIMID init data"),new _.N(1,10,10100,"No player container found");return a};_.r.getSurface=function(){var a=this.m.getSurface();if(!a)throw this.g.error("No player surface found. Can not create SIMID init data"),new _.N(1,10,10100,"No surface");return a};_.r.ii=function(){return this.a};_.r.url=function(){return this.f?this.f.url:""};NA.prototype.create=function(){return new JA};
18
18
  _.Yt(new NA);};
19
19
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
20
20
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
package/cjs/cl.smooth.js CHANGED
@@ -1,76 +1,76 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var GR="Full MP4 box must have flags defined",HR="clpp.smooth.SmoothMP4Processor",IR="codecPrivateData",JR=function(a,b){var c=Math.floor(b/Math.pow(2,32)),d=b-c*Math.pow(2,32);_.V(a,c);_.V(a,d)},KR=function(a,b){try{a.f.setUint8(a.a,b),a.a+=1}catch(c){_.cn()}},LR=function(a,b){KR(a,b>>16&255);KR(a,b>>8&255);KR(a,b&255)},MR=function(a,b){try{a.f.setUint16(a.a,b,a.h),a.a+=2}catch(c){_.cn()}},NR=function(a,b){try{a.f.setInt32(a.a,b,a.h),a.a+=4}catch(c){_.cn()}},OR=function(a,b){try{a.f.setInt16(a.a,
3
- b,a.h),a.a+=2}catch(c){_.cn()}},PR=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},QR=function(a){this.type=a;this.size=this.start=0;this.parent=null;this.w=!1;this.entries=[];this.children=[]},Z=function(a,b,c){QR.call(this,a);this.version=b;this.flags=c},RR=function(a,b,c){QR.call(this,a);this.f=b;this.offset=c},SR=function(a,
4
- b,c,d,e){Z.call(this,a,b,c);this.f=d;this.offset=e},TR=function(a,b,c){QR.call(this,"ftyp");this.h=a;this.Ai=b;this.f=c},UR=function(){QR.call(this,_.Ne)},VR=function(){QR.call(this,_.tg)},WR=function(a,b,c){Z.call(this,"mvhd",1,0);this.timescale=a;this.duration=b;this.volume=256;this.h=c+1;this.f=[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]},YR=function(){QR.call(this,"mvex")},ZR=function(a){Z.call(this,"trex",0,0);this.f=a},$R=function(a,b,c,d,e){Z.call(this,"tkhd",
5
- 1,7);this.h=a;this.duration=b;this.timescale=c;this.width=d;this.height=e;this.volume=1;this.f=[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]},aS=function(a,b){Z.call(this,"mdhd",1,0);this.timescale=a;this.duration=b;this.language=21956},bS=function(a){Z.call(this,"hdlr",0,0);this.f=a},cS=function(){Z.call(this,"vmhd",0,1);this.f=new Uint8Array([0,0,0,0,0,0])},dS=function(a){QR.call(this,a);this.w=!0},eS=function(a){dS.call(this,a);this.height=this.width=0;this.depth=24},
6
- fS=function(a,b,c,d){dS.call(this,a);this.channelCount=b;this.sampleSize=c;this.sampleRate=d},gS=function(a,b){eS.call(this,"avc1");this.width=a;this.height=b},hS=function(a,b){gS.call(this,a,b);this.type="encv"},iS=function(a,b,c){fS.call(this,"mp4a",a,b,c)},jS=function(a,b,c){iS.call(this,a,b,c);this.type="enca"},kS=function(a,b){QR.call(this,"avcC");this.gb=a;this.sc=b;this.version=1;this.f=this.gb[0][1];this.h=this.gb[0][2];this.level=this.gb[0][3]},lS=function(a){Z.call(this,"esds",0,0);this.nc=
7
- a},mS=function(a){a=void 0===a?"":a;Z.call(this,"url ",0,1);this.location=a},nS=function(){Z.call(this,"dref",0,0)},oS=function(){QR.call(this,_.dg)},pS=function(){Z.call(this,_.fg,0,0)},qS=function(){Z.call(this,"stts",0,0)},rS=function(){Z.call(this,"stsc",0,0)},sS=function(){Z.call(this,"stco",0,0)},tS=function(){Z.call(this,"stsz",0,0)},uS=function(){Z.call(this,"smhd",0,0)},vS=function(){QR.call(this,"dinf")},wS=function(){QR.call(this,_.Le)},xS=function(){QR.call(this,_.He)},yS=function(a,b){Z.call(this,
8
- "tfdt",a,0);this.baseMediaDecodeTime=b},zS=function(){Z.call(this,"mfhd",0,0);this.f=0},AS=function(a,b){Z.call(this,"trun",a,b);this.l=this.j=this.f=0;this.o=[];this.sampleSize=[];this.A=[];this.h=[]},BS=function(a,b){Z.call(this,"tfhd",a,b);this.f=255;this.l=this.o=this.j=this.A=this.h=0},CS=function(){QR.call(this,"traf")},DS=function(){QR.call(this,"moof")},ES=function(){QR.call(this,_.Ge);this.f=new Uint8Array(0)},FS=function(){Z.call(this,"tenc",0,0);this.f=1;this.h=8;this.l="";this.j=[]},GS=
9
- function(a,b){Z.call(this,"schm",0,0);this.f=a;this.h=b;this.ic=""},HS=function(a){QR.call(this,"frma");this.f=a},IS=function(){Z.call(this,"saio",0,0);this.offset=[0]},JS=function(a,b,c){Z.call(this,"saiz",0,0);this.f=a;this.j=b;this.h=c},KS=function(a,b){Z.call(this,"senc",a,b);this.h=0;this.j=8;this.f=[]},LS=function(a){var b=a.split("/");return b[b.length-1].toLowerCase().match("manifest(\\(.+\\))?")?a:a+"/Manifest"},MS=function(a,b,c,d){c=b.Th[c];b=b.Io;a=a.replace("Manifest","");b=b.replace("{bitrate}",
10
- String(d.bitrate)).replace("{Bitrate}",String(d.bitrate)).replace("{start time}",String(c.t)).replace("{start_time}",String(c.t));return _.JD([a],[b])[0]},NS=function(a,b){if(a.type!==b.type)return!1;var c=[];a.type===_.Jg?c=["maxWidth","maxHeight","bitrate",IR,"fourCC"]:a.type===_.Pc&&(c=["bitrate",IR,"channels","bitsPerSample","samplingRate","fourCC"]);return _.L.pa(a,b,c,["id","segmentIndex"])},OS=function(a,b,c){var d=c.Te.split("00000001");a={id:1,type:c.type,duration:a/b,timescale:b,gb:null,
11
- sc:null,width:NaN,height:NaN,nc:null,ze:NaN,sampleSize:NaN,channelCount:NaN};switch(c.type){case _.Jg:a.gb=[_.Om(d[1])];a.sc=[_.Om(d[2])];a.width=c.maxWidth;a.height=c.maxHeight;break;case _.Pc:a.nc=_.Om(c.Te),a.sampleSize=c.Mj||16,a.ze=c.ze,a.channelCount=c.rh}return a},PS=function(a,b){return a.filter(function(c){return c.type===b})},QS=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)},XS=function(a,
12
- b,c){var d=null;if(RS.test(a)){a=RS.exec(a);d=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 SS.test(a)?d=QS(SS,a):TS.test(a)?d=QS(TS,a):US.test(a)?(a=US.exec(a),d=Number(a[1])/c.frameRate):VS.test(a)?(a=VS.exec(a),d=Number(a[1])/c.a):WS.test(a)&&(d=QS(WS,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*
13
- d);return b+":"+c+":"+a+"."+d},YS=function(a,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))},$S=function(a){this.a=a;this.f=ZS(this)},ZS=function(a){for(var b=0,c=0;c<a.a.length;c++)b+=a.a[c].a();return new _.bn(b)},aT=function(a,b,c){a:{var d=_.u([_.Gd,_.Ed]);for(var e=d.next();!e.done;e=d.next())if((e=c.Ze(e.value))&&e.keyId){d=e.keyId;break a}_.Jh(HR,
14
- "Could not get default Key ID for DRM init data!");d=null}c=new QR("xxxx");a.type===_.Jg?c=new hS(a.width,a.height):c=new jS(a.channelCount,a.sampleSize,a.ze);a=new FS;a.f=1;a.h=8;a.l=d||"00000000000000000000000000000000";a=(new QR("schi")).append([a]);b=(new QR(_.Yf)).append([new HS(b),new GS(_.hd,65536),a]);c.append([b]);return c},bT=function(a,b){var c=b.bf(),d=new WR(a.timescale,a.duration,a.id),e=(new YR).append([new ZR(a.id)]),f=new $R(a.id,a.duration,a.timescale,a.width,a.height),g=new aS(a.timescale,
15
- a.duration),h=new bS(a.type),l=null,m=new nS;m.entries=[new mS];var n=new pS;switch(a.type){case _.Jg:var p=new kS(a.gb,a.sc);c?(l=aT(a,"avc1",b),l.append([p]),n.entries=[l]):(l=(new gS(a.width,a.height)).append([p]),n.entries=[l]);l=new cS;break;case _.Pc:p=new lS(a.nc),c?(l=aT(a,"mp4a",b),l.append([p]),n.entries=[l]):(l=(new iS(a.channelCount,a.sampleSize,a.ze)).append([p]),n.entries=[l]),l=new uS}n=(new oS).append([n,new qS,new rS,new tS,new sS]);m=(new vS).append([m]);m=(new wS).append([l,m,n]);
16
- g=(new xS).append([g,h,m]);f=(new VR).append([f,g]);d=(new UR).append([d,f,e]);e=new TR("dash",0,["iso6","mp41","avc1"]);c&&(c=b.Ze(_.Ed),f=b.Ze(_.Gd),c&&d.append([new RR("pssh",c.initData,8)]),f&&d.append([new RR("pssh",f.initData,8)]),c||f||_.Jh(HR,"Could not get PSSH init data!"));c=new $S([e,d]);return _.Oj(c.write())},dT=function(a,b){var c,d,e,f,g,h;(new _.pn).M("moof",_.qn).aa("mfhd",function(m){var n=new zS;n.f=_.kn(m.reader);c=n}).M("traf",_.qn).aa("tfhd",function(m){var n=m.reader.Ta();
17
- if(null===m.flags)throw new _.N(_.O,3,3019,GR);var p=new BS(m.version||0,m.flags||0);p.f=_.kn(m.reader);0<n-m.reader.getPosition()&&m.flags&1&&(p.h=_.mn(m.reader));0<n-m.reader.getPosition()&&m.flags&2&&(p.A=_.kn(m.reader));0<n-m.reader.getPosition()&&m.flags&8&&(p.j=_.kn(m.reader));0<n-m.reader.getPosition()&&m.flags&16&&(p.o=_.kn(m.reader));0<n-m.reader.getPosition()&&m.flags&32&&(p.l=_.kn(m.reader));d=p}).aa("trun",function(m){var n=m.reader.Ta();if(null===m.flags)throw new _.N(_.O,3,3019,GR);
18
- var p=new AS(m.version||0,m.flags||0);p.f=_.kn(m.reader);0<n-m.reader.getPosition()&&m.flags&1&&(p.j=_.ln(m.reader));0<n-m.reader.getPosition()&&m.flags&4&&(p.l=_.kn(m.reader));if(0<n-m.reader.getPosition())for(n=0;n<p.f;n++)m.flags&256&&p.o.push(_.kn(m.reader)),m.flags&512&&p.sampleSize.push(_.kn(m.reader)),m.flags&1024&&p.A.push(_.kn(m.reader)),m.flags&2048&&(0===m.version?p.h.push(_.kn(m.reader)):p.h.push(_.ln(m.reader)));e=p}).aa("sdtp",function(m){var n=_.on(m.reader,m.reader.Ta());f=new SR("sdtp",
19
- m.version||0,m.flags||0,n,0)}).M("uuid",function(m){var n=_.on(m.reader,16);if(_.Qm(n,cT)){n=_.kn(m.reader);m.version=n>>>24;m.flags=n&16777215;n=new KS(m.version,m.flags);n.h=_.kn(m.reader);m.flags&1&&(n.j=_.hn(m.reader));for(var p=0;p<n.h;p++){var q={ki:_.on(m.reader,8),Dd:0,Pg:[]};if(m.flags&2){q.Dd=_.jn(m.reader);for(var t=0;t<q.Dd;t++){var v={nh:0,oh:0};v.nh=_.jn(m.reader);v.oh=_.kn(m.reader);q.Pg.push(v)}}n.f.push(q)}g=n}}).M(_.Ge,function(m){var n=new ES;0<m.reader.Ta()?n.f=_.on(m.reader,m.reader.Ta()):
20
- (_.Jh(HR,"mdat box is empty!"),n.f=new Uint8Array(0));h=n}).parse(a,!1);if(!h)return null;var l=(new CS).append([d,e]);f&&l.append([f]);b.bf()&&g&&l.append([g]);l=(new DS).append([c,l]);return new $S([l,h])},eT=function(a,b,c,d){var e=d.bf(),f=parseInt(c*b,10);b=a.data||new ArrayBuffer(0);var g=dT(b,d);if(null===g)return a.request.contentType===_.pj?a.data:g;d=g.get(_.Ge);if(a.request.contentType===_.pj){e=d.f.buffer;if(c){e=_.Q.ce(e);if((e=(new DOMParser).parseFromString(e,_.lg))&&"tt"===e.documentElement.tagName.toLowerCase())var h=
21
- e.documentElement;if(h&&(d=new YS(h.getAttribute("ttp:frameRate"),h.getAttribute("ttp:subFrameRate"),h.getAttribute("ttp:frameRateMultiplier"),h.getAttribute("ttp:tickRate")),h=h.getElementsByTagName("body")[0]))for(h=h.getElementsByTagName("p"),a=0,b=h.length;a<b;a++){f=h[a];g=c;for(var l=["begin",_.ge],m=0,n=l.length;m<n;m++){b:{var p=f;var q=l[m],t=new RegExp("\\w+:"+q),v=0;if(p.hasAttribute(q))p=p.getAttribute(q);else{q=p.attributes;for(var z=q.length;v<z;v++){var A=q[v].name;if(A=A.match(t)){p=
22
- p.getAttribute(A[0]);break b}}p=null}}f.setAttribute(l[m],XS(p||"",g,d))}}e=(new XMLSerializer).serializeToString(e);c=_.Q.hb(e).buffer}else c=e;return c}h=new DS;a=g.get("mfhd");b=new CS;l=g.get("tfhd");m=new yS(1,f);f=g.get("trun");n=g.get("sdtp");c=g.get("senc");l.f=1;l.flags&=16777214;l.flags|=131072;b.append([l,m,f]);n&&b.append([n]);if(e){g=0;l=[];if(c.flags&2)for(l=[],m=0;m<c.h;m++)l.push(10+6*c.f[m].Dd);else g=8;b.append([c,new IS,new JS(g,l,c.h)])}h.append([a,b]);f.flags|=1;f.j=h.a()+8;d=
23
- new $S([h,d]);h=d.write();e&&(e=d.get("saio"),d=d.f,e.offset[0]=c.start+16,d.seek(e.start),e.write(d),h=d.buffer);return h},fT=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[b],keyIds:c,periodId:null}},gT=function(a,b,c){a=_.Yo(a);c&&a.version!==c&&(a=_.yD(a,c));return{initData:_.wD(a),initDataType:_.hd,keyId:b,periodId:null}},iT=function(){this.A=this.j=this.f=
24
- this.D=null;this.h=1;this.P=0;this.o="";this.C=this.a=null;this.g=new _.J("clpp.smooth.SmoothParser");this.K=!1;this.l=this.B=null;this.N=hT;this.I=0;this.G=this.J=Infinity;this.w=[];this.L=this.bo.bind(this);this.H=new Map},jT=function(a,b){var c,d,e;return _.H(function(f){if(1==f.a)return c=_.ck(b),c.timeout=a.f.attemptParameters.timeout,c.maxAttempts=Math.max(a.f.attemptParameters.maxAttempts,b.length),c.baseDelay=a.f.attemptParameters.baseDelay,c.backoffFactor=a.f.attemptParameters.backoffFactor,
25
- c.fuzzFactor=a.f.attemptParameters.fuzzFactor,c.type=1,d=a.D.networkingEngine.fetch(c),_.x(f,d.S,2);e=f.f;a.o=e.uri;return f["return"](e)})},qT=function(a,b){var c=_.To,d=null;try{var e=_.Q.ce(b);d=c.ve(e,_.Lb)}catch(CY){}if(!d)throw a.g.error("Unable to parse manifest"),new _.N(_.O,4,4033,a.o);var f=+kT(a,d,"MajorVersion"),g=+kT(a,d,"MinorVersion"),h=+d.getAttribute("TimeScale")||1E7,l=+kT(a,d,"Duration"),m="TRUE"===d.getAttribute("IsLive"),n=+d.getAttribute("LookAheadCount"),p=+d.getAttribute("DVRWindowLength")||
26
- Infinity,q=c.$(d,"Protection")[0];if(!1===/^[2].[0-2]$/.test(""+f+"."+g))throw a.g.error("Smooth Streaming version must be 2.0, 2.1 or 2.2"),new _.N(_.O,4,4036,a.o);m?(lT(a,mT),a.B=typeof a.f.liveRefreshPeriod===_.k?1E3*a.f.liveRefreshPeriod:Math.min(1E3*a.I,1E4),l=Infinity):lT(a,hT);a.a={startTime:0,delay:0,duration:l/h,ag:p/h,re:0};if(q){var t=a.f.playreadyVersion,v=_.To,z=[],A=v.$(q,"ProtectionHeader")[0],E=_.Nm(v.ra(A)||""),G=_.Yo(E).a;z.push(fT(_.Gd,{initData:_.wD(_.Qo(G)),initDataType:_.hd,
27
- keyId:G,periodId:null},[G]));z.push(fT(_.Ed,gT(E,G,t),[G]));a.w=z}var B=[],F=_.To.$(d,"StreamIndex");if(!F.length)throw a.g.error("No streams found!"),new _.N(_.O,4,4034,a.o);for(var M=0;M<F.length;M++){for(var R,ka=a,U=F[M],qa=kT(ka,U,"Type"),Ba=+U.getAttribute("Chunks"),Ca=U.getAttribute("Subtype")||"",Da=U.getAttribute("Language")||_.wg,Ma=_.Cj(Da),zb=U.getAttribute("Name")||"",ne=+U.getAttribute(_.fb),Cf=+U.getAttribute(_.eb),Fg=kT(ka,U,"Url"),Pu=+U.getAttribute("TimeScale")||null,od=[],Ln=_.To.$(U,
28
- _.Ab),Ev=0;Ev<Ln.length;Ev++){var Ef=void 0,xc=void 0,Fv=void 0,Ff=ka,Od=Ln[Ev],Gv=qa,eX=+Od.getAttribute("Index"),fX=+kT(Ff,Od,"Bitrate"),tJ=NaN,uJ=NaN,Io=NaN,Hv=NaN,vJ=NaN,wJ=NaN,xJ=NaN,yJ=Od.getAttribute("FourCC")||"";switch(Gv){case _.Jg:tJ=+kT(Ff,Od,_.eb);uJ=+kT(Ff,Od,_.fb);break;case _.Pc:Hv=+Od.getAttribute("Channels")||2,Io=+kT(Ff,Od,"SamplingRate"),wJ=+kT(Ff,Od,"AudioTag"),vJ=+kT(Ff,Od,"BitsPerSample"),xJ=+kT(Ff,Od,"PacketSize")}var Iv=String(Od.getAttribute("CodecPrivateData"));if(Gv===
29
- _.Pc&&!Iv){var zJ=Hv,AJ={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},Jo=AJ[Io];if("AACH"===yJ){xc=new Uint8Array(4);var BJ=AJ[2*Io];xc[0]=40|Jo>>1;xc[1]=Jo<<7|zJ<<3|BJ>>1;xc[2]=BJ<<7|8;xc[3]=0;Ef=new Uint16Array(2);Ef[0]=(xc[0]<<8)+xc[1];Ef[1]=(xc[2]<<8)+xc[3];Fv=Ef[0].toString(16)+Ef[1].toString(16)}else xc=new Uint8Array(2),xc[0]=16|Jo>>1,xc[1]=Jo<<7|zJ<<3,Ef=new Uint16Array(1),Ef[0]=(xc[0]<<8)+xc[1],Fv=Ef[0].toString(16);Iv=Fv.toUpperCase()}var gX=
30
- {id:Ff.P++,type:Gv,index:eX,bitrate:fX,Te:Iv,maxHeight:tJ,maxWidth:uJ,ze:Io,rh:Hv,Zo:wJ,Mj:vJ,qp:xJ,Fl:yJ,segmentIndex:null};od.push(gX)}R=od;for(var Me=[],CJ=_.To.$(U,"c"),Bk=0;Bk<CJ.length;Bk++){var Jv=CJ[Bk],oe=parseInt(Jv.getAttribute("t"),10),hi=parseInt(Jv.getAttribute("d"),10),Kv=parseInt(Jv.getAttribute("r"),10),Ck=0;if(isNaN(oe)&&isNaN(hi))throw ka.g.error("Either one or both FragmentDuration and FragmentTime field MUST be present in StreamFragmentElement"),new _.N(_.O,4,4037,ka.o);0===Bk&&
31
- isNaN(oe)&&(Ck=oe=0);if(0<Bk){var Ig=Me[Me.length-1];Ck=Ig.n+1;Ig.d||(Ig.d=oe-Ig.t);oe||(oe=Ig.t+Ig.d);hi||(hi=oe-Ig.t)}Me.push({n:Ck,d:hi,t:oe});if(Kv){Kv--;for(var DJ=0;DJ<Kv;DJ++){var Ko=Me[Me.length-1];Ck=Ko.n+1;oe=Ko.t+Ko.d;hi=Ko.d;Me.push({n:Ck,d:hi,t:oe})}}}ka.Ud()||Me.length===Ba||ka.g.warn("Number of fragments ("+Ba+") differs from number of chunks ("+Me.length+").");B.push({type:qa,ep:Ba,so:Ca,language:Ma,xd:Da,name:zb,maxWidth:ne,maxHeight:Cf,Io:Fg,tracks:R,Th:Me,timescale:Pu})}var Gf=
32
- {op:f,Ai:g,timescale:h,duration:l,isLive:m,np:n,ag:p,hg:!1,streams:B};if(a.j&&a.A)return nT(a,Gf),Promise.resolve();a.H.clear();var Lv=Gf.timescale,Lo=Gf.duration,iX=PS(Gf.streams,_.Pc),jX=PS(Gf.streams,_.Jg),kX=PS(Gf.streams,_.pj),EJ=[],Mo=oT(a,Lo,Lv,iX),No=oT(a,Lo,Lv,jX),lX=oT(a,Lo,Lv,kX);Mo.length||(Mo=[null]);No.length||(No=[null]);for(var Nv=0;Nv<No.length;Nv++)for(var Ov=0;Ov<Mo.length;Ov++)EJ.push(pT(a,No[Nv],Mo[Ov]));var FJ={id:"ID",configurationId:void 0,startTime:0,endTime:Lo,variants:EJ,
33
- textStreams:lX,thumbStreams:[]};var nX=Gf.streams,Pv=a.a.startTime,GJ=a.a.delay,Qv=a.J,HJ=Math.min(a.a.duration||Infinity,Qv),Rv=a.Ud(),oX=a.a.ag,pX=a.a.re,IJ=a.I,JJ=isFinite(a.G)?a.G:0;if(Rv)HJ=Infinity,Pv=Date.now()/1E3-pX,a.a.startTime=Pv,GJ=3*IJ;else for(var qX=isFinite(Qv)?Qv:a.a.duration,KJ=_.u(nX),Sv=KJ.next();!Sv.done;Sv=KJ.next())for(var LJ=_.u(Sv.value.tracks),Tv=LJ.next();!Tv.done;Tv=LJ.next()){var MJ=Tv.value;MJ.segmentIndex.offset(-JJ);_.lE(MJ.segmentIndex,qX)}var NJ=a.f.timeline||{};
34
- NJ.type=void 0;a.C=new _.tE(NJ,Pv,GJ,!Rv,!0);a.C.f=HJ;_.BE(a.C,IJ);a.C.A=oX;Rv||a.C.offset(-JJ);a.D.filterAllPeriods([FJ]);a.j={presentationTimeline:a.C,periods:[FJ],minBufferTime:0,cues:[]};Promise.resolve();a.K||(a.D.networkingEngine.ed(a.L),a.K=!0);a.A=Gf;return Promise.resolve()},nT=function(a,b){for(var c=0;c<a.A.streams.length;c++)for(var d=b.streams[c],e={},f=_.u(a.A.streams[c].tracks),g=f.next();!g.done;e={mc:e.mc},g=f.next())if(e.mc=g.value,g=d.tracks.find(function(l){return function(m){return m.type===
35
- l.mc.type&&m.bitrate===l.mc.bitrate}}(e))){NS(e.mc,g)||a.g.warn("The current stream is updated with a stream that seems to have different base properties!");var h=rT(a,a.A.timescale,d,g);g=e.mc.segmentIndex;g.ta(h);(h=a.a.ag)&&_.RE(g,_.QE(g)-h).forEach(function(l){l.cb().forEach(function(m){a.H["delete"](m)})})}else a.g.warn("Cannot find satisfying update for "+e.mc.type+" track with bitrate "+(e.mc.bitrate+". Skipping update."))},oT=function(a,b,c,d){for(var e=[],f={Zc:0};f.Zc<d.length;f={Zc:f.Zc},
36
- f.Zc++){var g=d[f.Zc].tracks.map(function(h){return function(l){var m=d[h.Zc],n=rT(a,c,m,l);n=new _.PE(n);var p=null;m.type!==_.pj&&(p=sT(a,b,c,m,l));l.segmentIndex=n;var q=_.eL++,t=Promise.resolve.bind(Promise),v=n.kd.bind(n),z=n.get.bind(n),A=n.Md.bind(n),E=n.getDuration.bind(n),G=tT[m.type],B="";switch(m.type){case _.Jg:B=l.Te;var F=/00000001[0-9]7/.exec(B);B="avc1."+(F&&F[0]?B.substr(B.indexOf(F[0])+10,6):"42c00c");a.g.debug("VIDEO CODECS: ",B);break;case _.Pc:B=l.Te,F=2,"AACH"===l.Fl?F=5:B&&
37
- (F=(parseInt(B.substr(0,2),16)&248)>>3),B="mp4a.40."+F,a.g.debug("AUDIO CODECS: ",B)}F=m.type===_.pj?uT[m.so]:void 0;return{id:q,originalId:null,tp:null,createSegmentIndex:t,findSegmentPosition:v,getSegmentReference:z,adjustSegmentDurations:A,getDuration:E,segmentIndex:n,segmentLookupStrategy:_.hD,initSegmentReference:p,mimeType:G,codecs:B,frameRate:void 0,bandwidth:l.bitrate,width:l.maxWidth||void 0,height:l.maxHeight||void 0,kind:F,encrypted:a.kg(),keyId:null,language:m.language,originalLanguage:m.xd,
38
- label:m.name,type:m.type,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:l.rh||null,spatialAudio:!1,closedCaptions:null}}}(f));e=e.concat(g)}return e},rT=function(a,b,c,d){var e=0,f=[],g=c.timescale||b;c.Th.forEach(function(h,l){var m=h.d/g;if(0===l){var n=h.t/g;a.G=Math.min(a.G,n)}else n=f[l-1].endTime;var p=n+m,q=MS(a.o,c,l,d);a.I=Math.max(a.I,m);f.push(new _.zj(l,n,p,function(){return[q]},0,null,0,null,!0,g));a.H.set(q,n);e+=m});if(c.type===_.Jg||c.type===_.Pc)b=f[f.length-
39
- 1],a.J=Math.min(a.J,e),0===a.a.re?a.a.re=b.endTime:a.a.re=Math.min(a.a.re,b.endTime);return f},sT=function(a,b,c,d,e){b=OS(b,d.timescale||c,e);c={isLive:a.Ud.bind(a),bf:a.kg.bind(a),Ol:function(){return 1},Ze:a.Yh.bind(a)};d=new Uint8Array(0);try{d=bT(b,c)}catch(g){throw a.g.error("Failed to generate initialization segment."),new _.N(_.O,3,4035,g);}var f="data:text/plain;base64,"+_.Mm(d);return new _.LD(function(){return[f]},0,null,null,!0)},pT=function(a,b,c){var d=(c?c.bandwidth:0)+(b?b.bandwidth:
40
- 0),e=c?c.language:_.wg;return c||b?{id:a.h++,language:e,primary:!1,audio:c,video:b,bandwidth:d,drmInfos:a.w,allowedByApplication:!0,allowedByKeySystem:!0}:null},kT=function(a,b,c){if(b=b.getAttribute(c))return b;a.g.error("required attribute not provided: "+c);throw new _.N(_.O,4,4038,a.o,c);},vT=function(a,b){null!=a.B&&null!=b&&(a.l=window.setTimeout(a.gc.bind(a),b))},lT=function(a,b){var c=b===hT;a.j&&a.j.presentationTimeline&&_.wE(a.j.presentationTimeline,c);c&&null!=a.l&&(window.clearTimeout(a.l),
41
- a.l=null,a.B=null);a.N=b},wT=function(){};QR.prototype.append=function(a){a=void 0===a?[]:a;for(var b=0;b<a.length;b++)this.children.push(a[b]),a[b].parent=this;return this};QR.prototype.get=function(a){if(this.type===a)return this;for(var b=0;b<this.children.length;b++){if(this.children[b].type===a)return this.children[b];var c=this.children[b].get(a);if(c)return c}return null};
42
- QR.prototype.a=function(){var a=Math.pow(2,32)-1;var b=4+this.type.length;"uuid"===this.type&&(b+=16);if(0<this.children.length)for(var c=0;c<this.children.length;c++)b+=this.children[c].a();this.size>a&&(b+=8);return b};
43
- QR.prototype.write=function(a){var b=Math.pow(2,32)-1;this.start=a.getPosition();this.size=this.a();this.size>b?_.V(a,1):_.V(a,this.size);_.dn(a,PR(this.type));this.size>b&&JR(a,this.size);"uuid"===this.type&&_.dn(a,null);if(0<this.children.length&&!this.w)for(b=0;b<this.children.length;b++)this.children[b].write(a),this.children[b].a(),a.getPosition()};_.w(Z,QR);Z.prototype.a=function(){return 4+QR.prototype.a.call(this)};
44
- Z.prototype.write=function(a){QR.prototype.write.call(this,a);KR(a,this.version);LR(a,this.flags)};_.w(RR,QR);RR.prototype.a=function(){return this.f.byteLength+QR.prototype.a.call(this)-this.offset};RR.prototype.write=function(a){QR.prototype.write.call(this,a);_.dn(a,this.f,this.offset);a.getPosition()};_.w(SR,Z);SR.prototype.a=function(){return this.f.byteLength+Z.prototype.a.call(this)-this.offset};SR.prototype.write=function(a){Z.prototype.write.call(this,a);_.dn(a,this.f,this.offset);a.getPosition()};
45
- _.w(TR,QR);TR.prototype.a=function(){var a=this.h.length;a=a+4+this.f.join("").length;return a+QR.prototype.a.call(this)};TR.prototype.write=function(a){QR.prototype.write.call(this,a);_.dn(a,PR(this.h));_.V(a,this.Ai);_.dn(a,PR(this.f.join("")));a.getPosition()};_.w(UR,QR);_.w(VR,QR);_.w(WR,Z);WR.prototype.a=function(){var a=0;a=1===this.version?a+28:a+16;a=a+44+this.f.length;return a+=Z.prototype.a.call(this)};
46
- WR.prototype.write=function(a){Z.prototype.write.call(this,a);1===this.version?(JR(a,0),JR(a,0),_.V(a,this.timescale),JR(a,this.duration*this.timescale)):(_.V(a,0),_.V(a,0),_.V(a,this.timescale),_.V(a,this.duration*this.timescale));_.V(a,65536);MR(a,this.volume);MR(a,0);_.V(a,0);_.V(a,0);for(var b=0;b<this.f.length;b++)KR(a,this.f[b]);_.V(a,0);_.V(a,0);_.V(a,0);_.V(a,0);_.V(a,0);_.V(a,0);_.V(a,this.h);a.getPosition()};_.w(YR,QR);_.w(ZR,Z);ZR.prototype.a=function(){return 20+Z.prototype.a.call(this)};
47
- ZR.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.f);_.V(a,1);_.V(a,0);_.V(a,0);_.V(a,0);a.getPosition()};_.w($R,Z);$R.prototype.a=function(){var a=0;a=1===this.version?a+32:a+20;a=a+24+this.f.length;return a+Z.prototype.a.call(this)};
48
- $R.prototype.write=function(a){Z.prototype.write.call(this,a);1===this.version?(JR(a,0),JR(a,0),_.V(a,this.h),_.V(a,0),JR(a,this.duration*this.timescale)):(_.V(a,0),_.V(a,0),_.V(a,this.h),_.V(a,0),_.V(a,this.duration*this.timescale));_.V(a,0);_.V(a,0);MR(a,0);MR(a,0);MR(a,this.volume);MR(a,0);for(var b=0;b<this.f.length;b++)KR(a,this.f[b]);MR(a,this.width);MR(a,0);MR(a,this.height);MR(a,0);a.getPosition()};_.w(aS,Z);aS.prototype.a=function(){var a=0;a=1===this.version?a+28:a+16;return a+4+Z.prototype.a.call(this)};
49
- aS.prototype.write=function(a){Z.prototype.write.call(this,a);1===this.version?(JR(a,0),JR(a,0),_.V(a,this.timescale),JR(a,this.duration*this.timescale)):(_.V(a,0),_.V(a,0),_.V(a,this.timescale),_.V(a,this.duration*this.timescale));MR(a,this.language);MR(a,0);a.getPosition()};_.w(bS,Z);bS.prototype.a=function(){return 33+Z.prototype.a.call(this)};
50
- bS.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,0);this.f===_.Jg?_.dn(a,PR("vide")):_.dn(a,PR("soun"));_.V(a,0);_.V(a,0);_.V(a,0);this.f===_.Jg?_.dn(a,PR("VideoHandler\x00")):_.dn(a,PR("SoundHandler\x00"));a.getPosition()};_.w(cS,Z);cS.prototype.a=function(){return 2+this.f.byteLength+Z.prototype.a.call(this)};cS.prototype.write=function(a){Z.prototype.write.call(this,a);MR(a,0);_.dn(a,this.f);a.getPosition()};_.w(dS,QR);dS.prototype.a=function(){return 8+QR.prototype.a.call(this)};
51
- dS.prototype.write=function(a){QR.prototype.write.call(this,a);_.V(a,0);MR(a,0);MR(a,1)};_.w(eS,dS);eS.prototype.a=function(){return 70+dS.prototype.a.call(this)};eS.prototype.write=function(a){dS.prototype.write.call(this,a);MR(a,0);MR(a,0);_.V(a,0);_.V(a,0);_.V(a,0);MR(a,this.width);MR(a,this.height);_.V(a,4718592);_.V(a,4718592);_.V(a,0);MR(a,1);KR(a,10);_.dn(a,PR("AVC Coding",31));MR(a,this.depth);OR(a,-1)};_.w(fS,dS);fS.prototype.a=function(){return 20+dS.prototype.a.call(this)};
52
- fS.prototype.write=function(a){dS.prototype.write.call(this,a);_.V(a,0);_.V(a,0);MR(a,this.channelCount);MR(a,this.sampleSize);OR(a,0);MR(a,0);MR(a,this.sampleRate);MR(a,0)};_.w(gS,eS);gS.prototype.write=function(a){eS.prototype.write.call(this,a);for(var b=0;b<this.children.length;b++)this.children[b].write(a);a.getPosition()};_.w(hS,gS);_.w(iS,fS);iS.prototype.write=function(a){fS.prototype.write.call(this,a);for(var b=0;b<this.children.length;b++)this.children[b].write(a);a.getPosition()};
53
- _.w(jS,iS);_.w(kS,QR);kS.prototype.a=function(){for(var a=7,b=0;b<this.gb.length;b++)a+=2,a+=this.gb[b].byteLength;for(b=0;b<this.gb.length;b++)a+=2,a+=this.sc[b].byteLength;return a+QR.prototype.a.call(this)};
54
- kS.prototype.write=function(a){QR.prototype.write.call(this,a);KR(a,this.version);KR(a,this.f);KR(a,this.h);KR(a,this.level);KR(a,255);KR(a,224|this.gb.length);for(var b=0;b<this.gb.length;b++)MR(a,this.gb[b].length),_.dn(a,this.gb[b]);KR(a,this.sc.length);for(b=0;b<this.sc.length;b++)MR(a,this.sc[b].length),_.dn(a,this.sc[b]);a.getPosition()};_.w(lS,Z);lS.prototype.a=function(){return 22+(this.nc.byteLength+3)+Z.prototype.a.call(this)};
55
- lS.prototype.write=function(a){Z.prototype.write.call(this,a);KR(a,3);KR(a,23+this.nc.byteLength);MR(a,1);KR(a,0);KR(a,4);KR(a,15+this.nc.byteLength);KR(a,64);KR(a,21);LR(a,0);_.V(a,0);_.V(a,0);KR(a,5);KR(a,this.nc.byteLength);_.dn(a,this.nc);_.dn(a,new Uint8Array([6,1,2]));a.getPosition()};_.w(mS,Z);mS.prototype.a=function(){return this.location.length+Z.prototype.a.call(this)};mS.prototype.write=function(a){Z.prototype.write.call(this,a);0<this.location.length&&_.dn(a,PR(this.location));a.getPosition()};
56
- _.w(nS,Z);nS.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Z.prototype.a.call(this)};nS.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(oS,QR);_.w(pS,Z);pS.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Z.prototype.a.call(this)};
57
- pS.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(qS,Z);qS.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Z.prototype.a.call(this)};qS.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(rS,Z);
58
- rS.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Z.prototype.a.call(this)};rS.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(sS,Z);sS.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Z.prototype.a.call(this)};
59
- sS.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(tS,Z);tS.prototype.a=function(){return 8+Z.prototype.a.call(this)};tS.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,0);_.V(a,0);a.getPosition()};_.w(uS,Z);uS.prototype.a=function(){return 4+Z.prototype.a.call(this)};uS.prototype.write=function(a){Z.prototype.write.call(this,a);OR(a,0);MR(a,0);a.getPosition()};
60
- _.w(vS,QR);_.w(wS,QR);_.w(xS,QR);_.w(yS,Z);yS.prototype.a=function(){var a=0;a=1===this.version?a+8:a+4;return a+Z.prototype.a.call(this)};yS.prototype.write=function(a){Z.prototype.write.call(this,a);1===this.version?JR(a,this.baseMediaDecodeTime):_.V(a,this.baseMediaDecodeTime);a.getPosition()};_.w(zS,Z);zS.prototype.a=function(){return 4+Z.prototype.a.call(this)};zS.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.f);a.getPosition()};_.w(AS,Z);
61
- AS.prototype.a=function(){var a=4;this.flags&xT&&(a+=4);this.flags&yT&&(a+=4);for(var b=0;b<this.f;b++)this.flags&zT&&(a+=4),this.flags&AT&&(a+=4),this.flags&BT&&(a+=4),this.flags&CT&&(a+=4);return a+Z.prototype.a.call(this)};
62
- AS.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.f);this.flags&xT&&(a.getPosition(),NR(a,this.j));this.flags&yT&&_.V(a,this.l);for(var b=0;b<this.f;b++)this.flags&zT&&_.V(a,this.o[b]),this.flags&AT&&_.V(a,this.sampleSize[b]),this.flags&BT&&_.V(a,this.A[b]),this.flags&CT&&(0===this.version?_.V(a,this.h[b]):NR(a,this.h[b]));a.getPosition()};var xT=1,yT=4,zT=256,AT=512,BT=1024,CT=2048;_.w(BS,Z);
63
- BS.prototype.a=function(){var a=4;this.flags&DT&&(a+=8);this.flags&ET&&(a+=4);this.flags&FT&&(a+=4);this.flags&GT&&(a+=4);this.flags&HT&&(a+=4);return a+Z.prototype.a.call(this)};BS.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.f);this.flags&DT&&JR(a,this.h);this.flags&ET&&_.V(a,this.A);this.flags&FT&&_.V(a,this.j);this.flags&GT&&_.V(a,this.o);this.flags&HT&&_.V(a,this.l);a.getPosition()};var DT=1,ET=2,FT=8,GT=16,HT=32;_.w(CS,QR);_.w(DS,QR);_.w(ES,QR);
64
- ES.prototype.a=function(){return this.f.byteLength+QR.prototype.a.call(this)};ES.prototype.write=function(a){QR.prototype.write.call(this,a);0<this.f.byteLength&&_.dn(a,this.f)};_.w(FS,Z);FS.prototype.a=function(){var a=20;1===this.f&&0===this.h&&(a=a+1+this.j.length);return a+Z.prototype.a.call(this)};
65
- FS.prototype.write=function(a){Z.prototype.write.call(this,a);KR(a,0);0===this.version?KR(a,0):KR(a,0);KR(a,this.f);KR(a,this.h);_.dn(a,_.Om(this.l));if(1===this.f&&0===this.h){KR(a,0);for(var b=0;b<this.j.length;b++)KR(a,this.j[b])}a.getPosition()};_.w(GS,Z);GS.prototype.a=function(){var a=8;this.flags&1&&(a+=PR(this.ic).byteLength);return a+Z.prototype.a.call(this)};GS.prototype.write=function(a){Z.prototype.write.call(this,a);_.dn(a,PR(this.f));_.V(a,this.h);this.flags&1&&_.dn(a,PR(this.ic));a.getPosition()};
66
- _.w(HS,QR);HS.prototype.a=function(){return PR(this.f).byteLength+QR.prototype.a.call(this)};HS.prototype.write=function(a){QR.prototype.write.call(this,a);_.dn(a,PR(this.f));a.getPosition()};_.w(IS,Z);IS.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+Z.prototype.a.call(this)};
67
- IS.prototype.write=function(a){Z.prototype.write.call(this,a);this.flags&1&&(_.V(a,0),_.V(a,0));_.V(a,1);for(var b=0;1>b;b++)0===this.version?_.V(a,this.offset[b]):JR(a,this.offset[b]);a.getPosition()};_.w(JS,Z);JS.prototype.a=function(){var a=0;this.flags&1&&(a+=8);a+=5;0===this.f&&(a+=this.j.length);return a+Z.prototype.a.call(this)};
68
- JS.prototype.write=function(a){Z.prototype.write.call(this,a);this.flags&1&&(_.V(a,0),_.V(a,0));KR(a,this.f);_.V(a,this.h);if(0===this.f)for(var b=0;b<this.h;b++)KR(a,this.j[b]);a.getPosition()};_.w(KS,Z);KS.prototype.a=function(){var a=4;this.flags&1&&(a+=1);for(var b=0;b<this.h;b++)if(a+=this.f[b].ki.byteLength,this.flags&2){a+=2;for(var c=0;c<this.f[b].Dd;c++)a+=2,a+=4}return a+Z.prototype.a.call(this)};
69
- KS.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.h);this.flags&1&&KR(a,this.j);for(var b=0;b<this.h;b++)if(_.dn(a,this.f[b].ki),this.flags&2){MR(a,this.f[b].Dd);for(var c=0;c<this.f[b].Dd;c++)MR(a,this.f[b].Pg[c].nh),_.V(a,this.f[b].Pg[c].oh)}a.getPosition()};var RS=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,SS=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,TS=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,US=/^(\d*\.?\d*)f$/,VS=/^(\d*\.?\d*)t$/,WS=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/;$S.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};$S.prototype.write=function(){this.f=ZS(this);for(var a=0;a<this.a.length;a++)this.a[a].write(this.f);return this.f.buffer};var cT=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);_.r=iT.prototype;_.r.configure=function(a){this.f=a};_.r.start=function(a,b){var c=this;this.D=b;var d=_.gh(new Set([a,LS(a)])).concat();return jT(this,d).then(function(e){return qT(c,e.data).then(function(){vT(c,c.B);return c.j})})};_.r.requestStop=function(){};_.r.stop=function(){this.D&&this.D.networkingEngine.xe(this.L);this.B=this.A=this.j=this.f=this.D=null;this.l&&(clearTimeout(this.l),this.l=null);this.K=!1;this.J=this.G=Infinity;return Promise.resolve()};
70
- _.r.update=function(){var a=this;if(this.Ud())return jT(this,[this.o]).then(function(b){return qT(a,b.data).then(function(){return a.j})})["catch"](function(b){if(a.D)a.D.onError(b)})};_.r.setCurrentVariant=function(){};_.r.gc=function(){var a=this;this.g.debug(_.ZC);this.D&&(this.l=null,this.update().then(function(){vT(a,a.B)})["catch"](function(b){a.D&&(a.D.onError(b),1===b.severity&&vT(a,100))}))};_.r.Ud=function(){return this.N===mT};_.r.kg=function(){return 0<this.w.length};
71
- _.r.Yh=function(a){var b=null;if(this.w.length)for(var c=0;c<this.w.length;c++)if(this.w[c].keySystem===a){b=this.w[c].initData[0];break}return b};
72
- _.r.bo=function(a){if(2!==a.request.type||a.uri.startsWith("data:"))return Promise.resolve(a);var b=a.request.timescale||this.A.timescale,c={isLive:this.Ud.bind(this),bf:this.kg.bind(this),Ol:function(){return 1},Ze:this.Yh.bind(this)},d=!1,e=new _.N(_.O,3,4035,null),f=null;try{var g=this.H.get(a.request.uris[a.request.uriIndex])||a.request.startTime||0;g!==a.request.startTime&&this.g.debug("Using base media decode time "+g+" instead of segment reference time "+a.request.startTime);f=eT(a,b,g,c)}catch(h){d=
73
- !0,e.data=h,3E3===h.code&&(e.code=4039)}if(d||!f)return Promise.reject(e);a.data=f;return Promise.resolve(a)};_.r.loadVariant=function(a){return _.H(function(b){return b["return"](a)})};_.r.loadTextStream=function(a,b){var c=this,d,e;return _.H(function(f){(e=c.j.periods.find(function(g){return g.id===b}))&&(d=e.textStreams.find(function(g){return g.id===a})||null);if(!d)throw new _.Zi(_.PC+a);return f["return"](d)})};var tT={video:_.Lg,audio:_.Tc,text:_.Mc},hT=_.Wb,mT="LIVE",uT={Lo:_.dd,So:_.hg};_.w(wT,_.Bu);wT.prototype.f=function(){_.dv.ism=iT;_.bv[_.Nc]=iT};wT.prototype.a=function(){_.sF("ism");_.tF(_.Nc)};wT.prototype.id=function(){return _.Zf};_.I("clpp.smooth.SmoothComponent",wT);};
2
+ var f=function(window){var JR="Full MP4 box must have flags defined",KR="clpp.smooth.SmoothMP4Processor",LR="codecPrivateData",MR=function(a,b){var c=Math.floor(b/Math.pow(2,32)),d=b-c*Math.pow(2,32);_.V(a,c);_.V(a,d)},NR=function(a,b){try{a.f.setUint8(a.a,b),a.a+=1}catch(c){_.cn()}},OR=function(a,b){NR(a,b>>16&255);NR(a,b>>8&255);NR(a,b&255)},PR=function(a,b){try{a.f.setUint16(a.a,b,a.h),a.a+=2}catch(c){_.cn()}},QR=function(a,b){try{a.f.setInt32(a.a,b,a.h),a.a+=4}catch(c){_.cn()}},RR=function(a,b){try{a.f.setInt16(a.a,
3
+ b,a.h),a.a+=2}catch(c){_.cn()}},SR=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},TR=function(a){this.type=a;this.size=this.start=0;this.parent=null;this.w=!1;this.entries=[];this.children=[]},Z=function(a,b,c){TR.call(this,a);this.version=b;this.flags=c},UR=function(a,b,c){TR.call(this,a);this.f=b;this.offset=c},VR=function(a,
4
+ b,c,d,e){Z.call(this,a,b,c);this.f=d;this.offset=e},WR=function(a,b,c){TR.call(this,"ftyp");this.h=a;this.Di=b;this.f=c},YR=function(){TR.call(this,_.Ne)},ZR=function(){TR.call(this,_.tg)},$R=function(a,b,c){Z.call(this,"mvhd",1,0);this.timescale=a;this.duration=b;this.volume=256;this.h=c+1;this.f=[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]},aS=function(){TR.call(this,"mvex")},bS=function(a){Z.call(this,"trex",0,0);this.f=a},cS=function(a,b,c,d,e){Z.call(this,"tkhd",
5
+ 1,7);this.h=a;this.duration=b;this.timescale=c;this.width=d;this.height=e;this.volume=1;this.f=[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]},dS=function(a,b){Z.call(this,"mdhd",1,0);this.timescale=a;this.duration=b;this.language=21956},eS=function(a){Z.call(this,"hdlr",0,0);this.f=a},fS=function(){Z.call(this,"vmhd",0,1);this.f=new Uint8Array([0,0,0,0,0,0])},gS=function(a){TR.call(this,a);this.w=!0},hS=function(a){gS.call(this,a);this.height=this.width=0;this.depth=24},
6
+ iS=function(a,b,c,d){gS.call(this,a);this.channelCount=b;this.sampleSize=c;this.sampleRate=d},jS=function(a,b){hS.call(this,"avc1");this.width=a;this.height=b},kS=function(a,b){jS.call(this,a,b);this.type="encv"},lS=function(a,b,c){iS.call(this,"mp4a",a,b,c)},mS=function(a,b,c){lS.call(this,a,b,c);this.type="enca"},nS=function(a,b){TR.call(this,"avcC");this.gb=a;this.tc=b;this.version=1;this.f=this.gb[0][1];this.h=this.gb[0][2];this.level=this.gb[0][3]},oS=function(a){Z.call(this,"esds",0,0);this.oc=
7
+ a},pS=function(a){a=void 0===a?"":a;Z.call(this,"url ",0,1);this.location=a},qS=function(){Z.call(this,"dref",0,0)},rS=function(){TR.call(this,_.dg)},sS=function(){Z.call(this,_.fg,0,0)},tS=function(){Z.call(this,"stts",0,0)},uS=function(){Z.call(this,"stsc",0,0)},vS=function(){Z.call(this,"stco",0,0)},wS=function(){Z.call(this,"stsz",0,0)},xS=function(){Z.call(this,"smhd",0,0)},yS=function(){TR.call(this,"dinf")},zS=function(){TR.call(this,_.Le)},AS=function(){TR.call(this,_.He)},BS=function(a,b){Z.call(this,
8
+ "tfdt",a,0);this.baseMediaDecodeTime=b},CS=function(){Z.call(this,"mfhd",0,0);this.f=0},DS=function(a,b){Z.call(this,"trun",a,b);this.l=this.j=this.f=0;this.o=[];this.sampleSize=[];this.A=[];this.h=[]},ES=function(a,b){Z.call(this,"tfhd",a,b);this.f=255;this.l=this.o=this.j=this.A=this.h=0},FS=function(){TR.call(this,"traf")},GS=function(){TR.call(this,"moof")},HS=function(){TR.call(this,_.Ge);this.f=new Uint8Array(0)},IS=function(){Z.call(this,"tenc",0,0);this.f=1;this.h=8;this.l="";this.j=[]},JS=
9
+ function(a,b){Z.call(this,"schm",0,0);this.f=a;this.h=b;this.jc=""},KS=function(a){TR.call(this,"frma");this.f=a},LS=function(){Z.call(this,"saio",0,0);this.offset=[0]},MS=function(a,b,c){Z.call(this,"saiz",0,0);this.f=a;this.j=b;this.h=c},NS=function(a,b){Z.call(this,"senc",a,b);this.h=0;this.j=8;this.f=[]},OS=function(a){var b=a.split("/");return b[b.length-1].toLowerCase().match("manifest(\\(.+\\))?")?a:a+"/Manifest"},PS=function(a,b,c,d){c=b.Wh[c];b=b.Mo;a=a.replace("Manifest","");b=b.replace("{bitrate}",
10
+ String(d.bitrate)).replace("{Bitrate}",String(d.bitrate)).replace("{start time}",String(c.t)).replace("{start_time}",String(c.t));return _.JD([a],[b])[0]},QS=function(a,b){if(a.type!==b.type)return!1;var c=[];a.type===_.Jg?c=["maxWidth","maxHeight","bitrate",LR,"fourCC"]:a.type===_.Pc&&(c=["bitrate",LR,"channels","bitsPerSample","samplingRate","fourCC"]);return _.L.pa(a,b,c,["id","segmentIndex"])},RS=function(a,b,c){var d=c.Ve.split("00000001");a={id:1,type:c.type,duration:a/b,timescale:b,gb:null,
11
+ tc:null,width:NaN,height:NaN,oc:null,Ae:NaN,sampleSize:NaN,channelCount:NaN};switch(c.type){case _.Jg:a.gb=[_.Om(d[1])];a.tc=[_.Om(d[2])];a.width=c.maxWidth;a.height=c.maxHeight;break;case _.Pc:a.oc=_.Om(c.Ve),a.sampleSize=c.Oj||16,a.Ae=c.Ae,a.channelCount=c.uh}return a},SS=function(a,b){return a.filter(function(c){return c.type===b})},TS=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)},$S=function(a,
12
+ b,c){var d=null;if(US.test(a)){a=US.exec(a);d=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 VS.test(a)?d=TS(VS,a):WS.test(a)?d=TS(WS,a):XS.test(a)?(a=XS.exec(a),d=Number(a[1])/c.frameRate):YS.test(a)?(a=YS.exec(a),d=Number(a[1])/c.a):ZS.test(a)&&(d=TS(ZS,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*
13
+ d);return b+":"+c+":"+a+"."+d},aT=function(a,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))},cT=function(a){this.a=a;this.f=bT(this)},bT=function(a){for(var b=0,c=0;c<a.a.length;c++)b+=a.a[c].a();return new _.bn(b)},dT=function(a,b,c){a:{var d=_.u([_.Gd,_.Ed]);for(var e=d.next();!e.done;e=d.next())if((e=c.af(e.value))&&e.keyId){d=e.keyId;break a}_.Jh(KR,
14
+ "Could not get default Key ID for DRM init data!");d=null}c=new TR("xxxx");a.type===_.Jg?c=new kS(a.width,a.height):c=new mS(a.channelCount,a.sampleSize,a.Ae);a=new IS;a.f=1;a.h=8;a.l=d||"00000000000000000000000000000000";a=(new TR("schi")).append([a]);b=(new TR(_.Yf)).append([new KS(b),new JS(_.hd,65536),a]);c.append([b]);return c},eT=function(a,b){var c=b.df(),d=new $R(a.timescale,a.duration,a.id),e=(new aS).append([new bS(a.id)]),f=new cS(a.id,a.duration,a.timescale,a.width,a.height),g=new dS(a.timescale,
15
+ a.duration),h=new eS(a.type),l=null,m=new qS;m.entries=[new pS];var n=new sS;switch(a.type){case _.Jg:var p=new nS(a.gb,a.tc);c?(l=dT(a,"avc1",b),l.append([p]),n.entries=[l]):(l=(new jS(a.width,a.height)).append([p]),n.entries=[l]);l=new fS;break;case _.Pc:p=new oS(a.oc),c?(l=dT(a,"mp4a",b),l.append([p]),n.entries=[l]):(l=(new lS(a.channelCount,a.sampleSize,a.Ae)).append([p]),n.entries=[l]),l=new xS}n=(new rS).append([n,new tS,new uS,new wS,new vS]);m=(new yS).append([m]);m=(new zS).append([l,m,n]);
16
+ g=(new AS).append([g,h,m]);f=(new ZR).append([f,g]);d=(new YR).append([d,f,e]);e=new WR("dash",0,["iso6","mp41","avc1"]);c&&(c=b.af(_.Ed),f=b.af(_.Gd),c&&d.append([new UR("pssh",c.initData,8)]),f&&d.append([new UR("pssh",f.initData,8)]),c||f||_.Jh(KR,"Could not get PSSH init data!"));c=new cT([e,d]);return _.Oj(c.write())},gT=function(a,b){var c,d,e,f,g,h;(new _.pn).M("moof",_.qn).aa("mfhd",function(m){var n=new CS;n.f=_.kn(m.reader);c=n}).M("traf",_.qn).aa("tfhd",function(m){var n=m.reader.Ta();
17
+ if(null===m.flags)throw new _.N(_.O,3,3019,JR);var p=new ES(m.version||0,m.flags||0);p.f=_.kn(m.reader);0<n-m.reader.getPosition()&&m.flags&1&&(p.h=_.mn(m.reader));0<n-m.reader.getPosition()&&m.flags&2&&(p.A=_.kn(m.reader));0<n-m.reader.getPosition()&&m.flags&8&&(p.j=_.kn(m.reader));0<n-m.reader.getPosition()&&m.flags&16&&(p.o=_.kn(m.reader));0<n-m.reader.getPosition()&&m.flags&32&&(p.l=_.kn(m.reader));d=p}).aa("trun",function(m){var n=m.reader.Ta();if(null===m.flags)throw new _.N(_.O,3,3019,JR);
18
+ var p=new DS(m.version||0,m.flags||0);p.f=_.kn(m.reader);0<n-m.reader.getPosition()&&m.flags&1&&(p.j=_.ln(m.reader));0<n-m.reader.getPosition()&&m.flags&4&&(p.l=_.kn(m.reader));if(0<n-m.reader.getPosition())for(n=0;n<p.f;n++)m.flags&256&&p.o.push(_.kn(m.reader)),m.flags&512&&p.sampleSize.push(_.kn(m.reader)),m.flags&1024&&p.A.push(_.kn(m.reader)),m.flags&2048&&(0===m.version?p.h.push(_.kn(m.reader)):p.h.push(_.ln(m.reader)));e=p}).aa("sdtp",function(m){var n=_.on(m.reader,m.reader.Ta());f=new VR("sdtp",
19
+ m.version||0,m.flags||0,n,0)}).M("uuid",function(m){var n=_.on(m.reader,16);if(_.Qm(n,fT)){n=_.kn(m.reader);m.version=n>>>24;m.flags=n&16777215;n=new NS(m.version,m.flags);n.h=_.kn(m.reader);m.flags&1&&(n.j=_.hn(m.reader));for(var p=0;p<n.h;p++){var q={ni:_.on(m.reader,8),Ed:0,Qg:[]};if(m.flags&2){q.Ed=_.jn(m.reader);for(var t=0;t<q.Ed;t++){var v={qh:0,rh:0};v.qh=_.jn(m.reader);v.rh=_.kn(m.reader);q.Qg.push(v)}}n.f.push(q)}g=n}}).M(_.Ge,function(m){var n=new HS;0<m.reader.Ta()?n.f=_.on(m.reader,m.reader.Ta()):
20
+ (_.Jh(KR,"mdat box is empty!"),n.f=new Uint8Array(0));h=n}).parse(a,!1);if(!h)return null;var l=(new FS).append([d,e]);f&&l.append([f]);b.df()&&g&&l.append([g]);l=(new GS).append([c,l]);return new cT([l,h])},hT=function(a,b,c,d){var e=d.df(),f=parseInt(c*b,10);b=a.data||new ArrayBuffer(0);var g=gT(b,d);if(null===g)return a.request.contentType===_.pj?a.data:g;d=g.get(_.Ge);if(a.request.contentType===_.pj){e=d.f.buffer;if(c){e=_.Q.de(e);if((e=(new DOMParser).parseFromString(e,_.lg))&&"tt"===e.documentElement.tagName.toLowerCase())var h=
21
+ e.documentElement;if(h&&(d=new aT(h.getAttribute("ttp:frameRate"),h.getAttribute("ttp:subFrameRate"),h.getAttribute("ttp:frameRateMultiplier"),h.getAttribute("ttp:tickRate")),h=h.getElementsByTagName("body")[0]))for(h=h.getElementsByTagName("p"),a=0,b=h.length;a<b;a++){f=h[a];g=c;for(var l=["begin",_.ge],m=0,n=l.length;m<n;m++){b:{var p=f;var q=l[m],t=new RegExp("\\w+:"+q),v=0;if(p.hasAttribute(q))p=p.getAttribute(q);else{q=p.attributes;for(var z=q.length;v<z;v++){var A=q[v].name;if(A=A.match(t)){p=
22
+ p.getAttribute(A[0]);break b}}p=null}}f.setAttribute(l[m],$S(p||"",g,d))}}e=(new XMLSerializer).serializeToString(e);c=_.Q.hb(e).buffer}else c=e;return c}h=new GS;a=g.get("mfhd");b=new FS;l=g.get("tfhd");m=new BS(1,f);f=g.get("trun");n=g.get("sdtp");c=g.get("senc");l.f=1;l.flags&=16777214;l.flags|=131072;b.append([l,m,f]);n&&b.append([n]);if(e){g=0;l=[];if(c.flags&2)for(l=[],m=0;m<c.h;m++)l.push(10+6*c.f[m].Ed);else g=8;b.append([c,new LS,new MS(g,l,c.h)])}h.append([a,b]);f.flags|=1;f.j=h.a()+8;d=
23
+ new cT([h,d]);h=d.write();e&&(e=d.get("saio"),d=d.f,e.offset[0]=c.start+16,d.seek(e.start),e.write(d),h=d.buffer);return h},iT=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[b],keyIds:c,periodId:null}},jT=function(a,b,c){a=_.Yo(a);c&&a.version!==c&&(a=_.yD(a,c));return{initData:_.wD(a),initDataType:_.hd,keyId:b,periodId:null}},lT=function(){this.A=this.j=this.f=
24
+ this.F=null;this.h=1;this.P=0;this.o="";this.C=this.a=null;this.g=new _.J("clpp.smooth.SmoothParser");this.K=!1;this.l=this.B=null;this.N=kT;this.I=0;this.G=this.J=Infinity;this.w=[];this.L=this.ho.bind(this);this.H=new Map},mT=function(a,b){var c,d,e;return _.H(function(f){if(1==f.a)return c=_.ck(b),c.timeout=a.f.attemptParameters.timeout,c.maxAttempts=Math.max(a.f.attemptParameters.maxAttempts,b.length),c.baseDelay=a.f.attemptParameters.baseDelay,c.backoffFactor=a.f.attemptParameters.backoffFactor,
25
+ c.fuzzFactor=a.f.attemptParameters.fuzzFactor,c.type=1,d=a.F.networkingEngine.fetch(c),_.x(f,d.S,2);e=f.f;a.o=e.uri;return f["return"](e)})},tT=function(a,b){var c=_.To,d=null;try{var e=_.Q.de(b);d=c.we(e,_.Lb)}catch(DY){}if(!d)throw a.g.error("Unable to parse manifest"),new _.N(_.O,4,4033,a.o);var f=+nT(a,d,"MajorVersion"),g=+nT(a,d,"MinorVersion"),h=+d.getAttribute("TimeScale")||1E7,l=+nT(a,d,"Duration"),m="TRUE"===d.getAttribute("IsLive"),n=+d.getAttribute("LookAheadCount"),p=+d.getAttribute("DVRWindowLength")||
26
+ Infinity,q=c.$(d,"Protection")[0];if(!1===/^[2].[0-2]$/.test(""+f+"."+g))throw a.g.error("Smooth Streaming version must be 2.0, 2.1 or 2.2"),new _.N(_.O,4,4036,a.o);m?(oT(a,pT),a.B=typeof a.f.liveRefreshPeriod===_.k?1E3*a.f.liveRefreshPeriod:Math.min(1E3*a.I,1E4),l=Infinity):oT(a,kT);a.a={startTime:0,delay:0,duration:l/h,dg:p/h,se:0};if(q){var t=a.f.playreadyVersion,v=_.To,z=[],A=v.$(q,"ProtectionHeader")[0],D=_.Nm(v.ra(A)||""),G=_.Yo(D).a;z.push(iT(_.Gd,{initData:_.wD(_.Qo(G)),initDataType:_.hd,
27
+ keyId:G,periodId:null},[G]));z.push(iT(_.Ed,jT(D,G,t),[G]));a.w=z}var B=[],F=_.To.$(d,"StreamIndex");if(!F.length)throw a.g.error("No streams found!"),new _.N(_.O,4,4034,a.o);for(var M=0;M<F.length;M++){for(var R,ka=a,U=F[M],qa=nT(ka,U,"Type"),Ba=+U.getAttribute("Chunks"),Ca=U.getAttribute("Subtype")||"",Da=U.getAttribute("Language")||_.wg,Na=_.Cj(Da),zb=U.getAttribute("Name")||"",me=+U.getAttribute(_.fb),Cf=+U.getAttribute(_.eb),Fg=nT(ka,U,"Url"),Pu=+U.getAttribute("TimeScale")||null,od=[],Ln=_.To.$(U,
28
+ _.Ab),Ev=0;Ev<Ln.length;Ev++){var Ef=void 0,yc=void 0,Fv=void 0,Ff=ka,Od=Ln[Ev],Gv=qa,gX=+Od.getAttribute("Index"),hX=+nT(Ff,Od,"Bitrate"),uJ=NaN,vJ=NaN,Io=NaN,Hv=NaN,wJ=NaN,xJ=NaN,yJ=NaN,zJ=Od.getAttribute("FourCC")||"";switch(Gv){case _.Jg:uJ=+nT(Ff,Od,_.eb);vJ=+nT(Ff,Od,_.fb);break;case _.Pc:Hv=+Od.getAttribute("Channels")||2,Io=+nT(Ff,Od,"SamplingRate"),xJ=+nT(Ff,Od,"AudioTag"),wJ=+nT(Ff,Od,"BitsPerSample"),yJ=+nT(Ff,Od,"PacketSize")}var Iv=String(Od.getAttribute("CodecPrivateData"));if(Gv===
29
+ _.Pc&&!Iv){var AJ=Hv,BJ={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},Jo=BJ[Io];if("AACH"===zJ){yc=new Uint8Array(4);var CJ=BJ[2*Io];yc[0]=40|Jo>>1;yc[1]=Jo<<7|AJ<<3|CJ>>1;yc[2]=CJ<<7|8;yc[3]=0;Ef=new Uint16Array(2);Ef[0]=(yc[0]<<8)+yc[1];Ef[1]=(yc[2]<<8)+yc[3];Fv=Ef[0].toString(16)+Ef[1].toString(16)}else yc=new Uint8Array(2),yc[0]=16|Jo>>1,yc[1]=Jo<<7|AJ<<3,Ef=new Uint16Array(1),Ef[0]=(yc[0]<<8)+yc[1],Fv=Ef[0].toString(16);Iv=Fv.toUpperCase()}var iX=
30
+ {id:Ff.P++,type:Gv,index:gX,bitrate:hX,Ve:Iv,maxHeight:uJ,maxWidth:vJ,Ae:Io,uh:Hv,cp:xJ,Oj:wJ,up:yJ,Kl:zJ,segmentIndex:null};od.push(iX)}R=od;for(var Me=[],DJ=_.To.$(U,"c"),Ak=0;Ak<DJ.length;Ak++){var Jv=DJ[Ak],ne=parseInt(Jv.getAttribute("t"),10),hi=parseInt(Jv.getAttribute("d"),10),Kv=parseInt(Jv.getAttribute("r"),10),Bk=0;if(isNaN(ne)&&isNaN(hi))throw ka.g.error("Either one or both FragmentDuration and FragmentTime field MUST be present in StreamFragmentElement"),new _.N(_.O,4,4037,ka.o);0===Ak&&
31
+ isNaN(ne)&&(Bk=ne=0);if(0<Ak){var Ig=Me[Me.length-1];Bk=Ig.n+1;Ig.d||(Ig.d=ne-Ig.t);ne||(ne=Ig.t+Ig.d);hi||(hi=ne-Ig.t)}Me.push({n:Bk,d:hi,t:ne});if(Kv){Kv--;for(var EJ=0;EJ<Kv;EJ++){var Ko=Me[Me.length-1];Bk=Ko.n+1;ne=Ko.t+Ko.d;hi=Ko.d;Me.push({n:Bk,d:hi,t:ne})}}}ka.Vd()||Me.length===Ba||ka.g.warn("Number of fragments ("+Ba+") differs from number of chunks ("+Me.length+").");B.push({type:qa,ip:Ba,xo:Ca,language:Na,yd:Da,name:zb,maxWidth:me,maxHeight:Cf,Mo:Fg,tracks:R,Wh:Me,timescale:Pu})}var Gf=
32
+ {sp:f,Di:g,timescale:h,duration:l,isLive:m,rp:n,dg:p,kg:!1,streams:B};if(a.j&&a.A)return qT(a,Gf),Promise.resolve();a.H.clear();var Lv=Gf.timescale,Lo=Gf.duration,kX=SS(Gf.streams,_.Pc),lX=SS(Gf.streams,_.Jg),mX=SS(Gf.streams,_.pj),FJ=[],Mo=rT(a,Lo,Lv,kX),No=rT(a,Lo,Lv,lX),nX=rT(a,Lo,Lv,mX);Mo.length||(Mo=[null]);No.length||(No=[null]);for(var Nv=0;Nv<No.length;Nv++)for(var Ov=0;Ov<Mo.length;Ov++)FJ.push(sT(a,No[Nv],Mo[Ov]));var GJ={id:"ID",configurationId:void 0,startTime:0,endTime:Lo,variants:FJ,
33
+ textStreams:nX,thumbStreams:[]};var pX=Gf.streams,Pv=a.a.startTime,HJ=a.a.delay,Qv=a.J,IJ=Math.min(a.a.duration||Infinity,Qv),Rv=a.Vd(),qX=a.a.dg,rX=a.a.se,JJ=a.I,KJ=isFinite(a.G)?a.G:0;if(Rv)IJ=Infinity,Pv=Date.now()/1E3-rX,a.a.startTime=Pv,HJ=3*JJ;else for(var sX=isFinite(Qv)?Qv:a.a.duration,LJ=_.u(pX),Sv=LJ.next();!Sv.done;Sv=LJ.next())for(var MJ=_.u(Sv.value.tracks),Tv=MJ.next();!Tv.done;Tv=MJ.next()){var NJ=Tv.value;NJ.segmentIndex.offset(-KJ);_.lE(NJ.segmentIndex,sX)}var OJ=a.f.timeline||{};
34
+ OJ.type=void 0;a.C=new _.tE(OJ,Pv,HJ,!Rv,!0);a.C.f=IJ;_.BE(a.C,JJ);a.C.A=qX;Rv||a.C.offset(-KJ);a.F.filterAllPeriods([GJ]);a.j={presentationTimeline:a.C,periods:[GJ],minBufferTime:0,cues:[]};Promise.resolve();a.K||(a.F.networkingEngine.fd(a.L),a.K=!0);a.A=Gf;return Promise.resolve()},qT=function(a,b){for(var c=0;c<a.A.streams.length;c++)for(var d=b.streams[c],e={},f=_.u(a.A.streams[c].tracks),g=f.next();!g.done;e={nc:e.nc},g=f.next())if(e.nc=g.value,g=d.tracks.find(function(l){return function(m){return m.type===
35
+ l.nc.type&&m.bitrate===l.nc.bitrate}}(e))){QS(e.nc,g)||a.g.warn("The current stream is updated with a stream that seems to have different base properties!");var h=uT(a,a.A.timescale,d,g);g=e.nc.segmentIndex;g.ta(h);(h=a.a.dg)&&_.RE(g,_.QE(g)-h).forEach(function(l){l.cb().forEach(function(m){a.H["delete"](m)})})}else a.g.warn("Cannot find satisfying update for "+e.nc.type+" track with bitrate "+(e.nc.bitrate+". Skipping update."))},rT=function(a,b,c,d){for(var e=[],f={$c:0};f.$c<d.length;f={$c:f.$c},
36
+ f.$c++){var g=d[f.$c].tracks.map(function(h){return function(l){var m=d[h.$c],n=uT(a,c,m,l);n=new _.PE(n);var p=null;m.type!==_.pj&&(p=vT(a,b,c,m,l));l.segmentIndex=n;var q=_.hL++,t=Promise.resolve.bind(Promise),v=n.ld.bind(n),z=n.get.bind(n),A=n.Nd.bind(n),D=n.getDuration.bind(n),G=wT[m.type],B="";switch(m.type){case _.Jg:B=l.Ve;var F=/00000001[0-9]7/.exec(B);B="avc1."+(F&&F[0]?B.substr(B.indexOf(F[0])+10,6):"42c00c");a.g.debug("VIDEO CODECS: ",B);break;case _.Pc:B=l.Ve,F=2,"AACH"===l.Kl?F=5:B&&
37
+ (F=(parseInt(B.substr(0,2),16)&248)>>3),B="mp4a.40."+F,a.g.debug("AUDIO CODECS: ",B)}F=m.type===_.pj?xT[m.xo]:void 0;return{id:q,originalId:null,xp:null,createSegmentIndex:t,findSegmentPosition:v,getSegmentReference:z,adjustSegmentDurations:A,getDuration:D,segmentIndex:n,segmentLookupStrategy:_.hD,initSegmentReference:p,mimeType:G,codecs:B,frameRate:void 0,bandwidth:l.bitrate,width:l.maxWidth||void 0,height:l.maxHeight||void 0,kind:F,encrypted:a.ng(),keyId:null,language:m.language,originalLanguage:m.yd,
38
+ label:m.name,type:m.type,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:l.uh||null,spatialAudio:!1,closedCaptions:null}}}(f));e=e.concat(g)}return e},uT=function(a,b,c,d){var e=0,f=[],g=c.timescale||b;c.Wh.forEach(function(h,l){var m=h.d/g;if(0===l){var n=h.t/g;a.G=Math.min(a.G,n)}else n=f[l-1].endTime;var p=n+m,q=PS(a.o,c,l,d);a.I=Math.max(a.I,m);f.push(new _.zj(l,n,p,function(){return[q]},0,null,0,null,!0,g));a.H.set(q,n);e+=m});if(c.type===_.Jg||c.type===_.Pc)b=f[f.length-
39
+ 1],a.J=Math.min(a.J,e),0===a.a.se?a.a.se=b.endTime:a.a.se=Math.min(a.a.se,b.endTime);return f},vT=function(a,b,c,d,e){b=RS(b,d.timescale||c,e);c={isLive:a.Vd.bind(a),df:a.ng.bind(a),Tl:function(){return 1},af:a.ai.bind(a)};d=new Uint8Array(0);try{d=eT(b,c)}catch(g){throw a.g.error("Failed to generate initialization segment."),new _.N(_.O,3,4035,g);}var f="data:text/plain;base64,"+_.Mm(d);return new _.LD(function(){return[f]},0,null,null,!0)},sT=function(a,b,c){var d=(c?c.bandwidth:0)+(b?b.bandwidth:
40
+ 0),e=c?c.language:_.wg;return c||b?{id:a.h++,language:e,primary:!1,audio:c,video:b,bandwidth:d,drmInfos:a.w,allowedByApplication:!0,allowedByKeySystem:!0}:null},nT=function(a,b,c){if(b=b.getAttribute(c))return b;a.g.error("required attribute not provided: "+c);throw new _.N(_.O,4,4038,a.o,c);},yT=function(a,b){null!=a.B&&null!=b&&(a.l=window.setTimeout(a.hc.bind(a),b))},oT=function(a,b){var c=b===kT;a.j&&a.j.presentationTimeline&&_.wE(a.j.presentationTimeline,c);c&&null!=a.l&&(window.clearTimeout(a.l),
41
+ a.l=null,a.B=null);a.N=b},zT=function(){};TR.prototype.append=function(a){a=void 0===a?[]:a;for(var b=0;b<a.length;b++)this.children.push(a[b]),a[b].parent=this;return this};TR.prototype.get=function(a){if(this.type===a)return this;for(var b=0;b<this.children.length;b++){if(this.children[b].type===a)return this.children[b];var c=this.children[b].get(a);if(c)return c}return null};
42
+ TR.prototype.a=function(){var a=Math.pow(2,32)-1;var b=4+this.type.length;"uuid"===this.type&&(b+=16);if(0<this.children.length)for(var c=0;c<this.children.length;c++)b+=this.children[c].a();this.size>a&&(b+=8);return b};
43
+ TR.prototype.write=function(a){var b=Math.pow(2,32)-1;this.start=a.getPosition();this.size=this.a();this.size>b?_.V(a,1):_.V(a,this.size);_.dn(a,SR(this.type));this.size>b&&MR(a,this.size);"uuid"===this.type&&_.dn(a,null);if(0<this.children.length&&!this.w)for(b=0;b<this.children.length;b++)this.children[b].write(a),this.children[b].a(),a.getPosition()};_.w(Z,TR);Z.prototype.a=function(){return 4+TR.prototype.a.call(this)};
44
+ Z.prototype.write=function(a){TR.prototype.write.call(this,a);NR(a,this.version);OR(a,this.flags)};_.w(UR,TR);UR.prototype.a=function(){return this.f.byteLength+TR.prototype.a.call(this)-this.offset};UR.prototype.write=function(a){TR.prototype.write.call(this,a);_.dn(a,this.f,this.offset);a.getPosition()};_.w(VR,Z);VR.prototype.a=function(){return this.f.byteLength+Z.prototype.a.call(this)-this.offset};VR.prototype.write=function(a){Z.prototype.write.call(this,a);_.dn(a,this.f,this.offset);a.getPosition()};
45
+ _.w(WR,TR);WR.prototype.a=function(){var a=this.h.length;a=a+4+this.f.join("").length;return a+TR.prototype.a.call(this)};WR.prototype.write=function(a){TR.prototype.write.call(this,a);_.dn(a,SR(this.h));_.V(a,this.Di);_.dn(a,SR(this.f.join("")));a.getPosition()};_.w(YR,TR);_.w(ZR,TR);_.w($R,Z);$R.prototype.a=function(){var a=0;a=1===this.version?a+28:a+16;a=a+44+this.f.length;return a+=Z.prototype.a.call(this)};
46
+ $R.prototype.write=function(a){Z.prototype.write.call(this,a);1===this.version?(MR(a,0),MR(a,0),_.V(a,this.timescale),MR(a,this.duration*this.timescale)):(_.V(a,0),_.V(a,0),_.V(a,this.timescale),_.V(a,this.duration*this.timescale));_.V(a,65536);PR(a,this.volume);PR(a,0);_.V(a,0);_.V(a,0);for(var b=0;b<this.f.length;b++)NR(a,this.f[b]);_.V(a,0);_.V(a,0);_.V(a,0);_.V(a,0);_.V(a,0);_.V(a,0);_.V(a,this.h);a.getPosition()};_.w(aS,TR);_.w(bS,Z);bS.prototype.a=function(){return 20+Z.prototype.a.call(this)};
47
+ bS.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.f);_.V(a,1);_.V(a,0);_.V(a,0);_.V(a,0);a.getPosition()};_.w(cS,Z);cS.prototype.a=function(){var a=0;a=1===this.version?a+32:a+20;a=a+24+this.f.length;return a+Z.prototype.a.call(this)};
48
+ cS.prototype.write=function(a){Z.prototype.write.call(this,a);1===this.version?(MR(a,0),MR(a,0),_.V(a,this.h),_.V(a,0),MR(a,this.duration*this.timescale)):(_.V(a,0),_.V(a,0),_.V(a,this.h),_.V(a,0),_.V(a,this.duration*this.timescale));_.V(a,0);_.V(a,0);PR(a,0);PR(a,0);PR(a,this.volume);PR(a,0);for(var b=0;b<this.f.length;b++)NR(a,this.f[b]);PR(a,this.width);PR(a,0);PR(a,this.height);PR(a,0);a.getPosition()};_.w(dS,Z);dS.prototype.a=function(){var a=0;a=1===this.version?a+28:a+16;return a+4+Z.prototype.a.call(this)};
49
+ dS.prototype.write=function(a){Z.prototype.write.call(this,a);1===this.version?(MR(a,0),MR(a,0),_.V(a,this.timescale),MR(a,this.duration*this.timescale)):(_.V(a,0),_.V(a,0),_.V(a,this.timescale),_.V(a,this.duration*this.timescale));PR(a,this.language);PR(a,0);a.getPosition()};_.w(eS,Z);eS.prototype.a=function(){return 33+Z.prototype.a.call(this)};
50
+ eS.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,0);this.f===_.Jg?_.dn(a,SR("vide")):_.dn(a,SR("soun"));_.V(a,0);_.V(a,0);_.V(a,0);this.f===_.Jg?_.dn(a,SR("VideoHandler\x00")):_.dn(a,SR("SoundHandler\x00"));a.getPosition()};_.w(fS,Z);fS.prototype.a=function(){return 2+this.f.byteLength+Z.prototype.a.call(this)};fS.prototype.write=function(a){Z.prototype.write.call(this,a);PR(a,0);_.dn(a,this.f);a.getPosition()};_.w(gS,TR);gS.prototype.a=function(){return 8+TR.prototype.a.call(this)};
51
+ gS.prototype.write=function(a){TR.prototype.write.call(this,a);_.V(a,0);PR(a,0);PR(a,1)};_.w(hS,gS);hS.prototype.a=function(){return 70+gS.prototype.a.call(this)};hS.prototype.write=function(a){gS.prototype.write.call(this,a);PR(a,0);PR(a,0);_.V(a,0);_.V(a,0);_.V(a,0);PR(a,this.width);PR(a,this.height);_.V(a,4718592);_.V(a,4718592);_.V(a,0);PR(a,1);NR(a,10);_.dn(a,SR("AVC Coding",31));PR(a,this.depth);RR(a,-1)};_.w(iS,gS);iS.prototype.a=function(){return 20+gS.prototype.a.call(this)};
52
+ iS.prototype.write=function(a){gS.prototype.write.call(this,a);_.V(a,0);_.V(a,0);PR(a,this.channelCount);PR(a,this.sampleSize);RR(a,0);PR(a,0);PR(a,this.sampleRate);PR(a,0)};_.w(jS,hS);jS.prototype.write=function(a){hS.prototype.write.call(this,a);for(var b=0;b<this.children.length;b++)this.children[b].write(a);a.getPosition()};_.w(kS,jS);_.w(lS,iS);lS.prototype.write=function(a){iS.prototype.write.call(this,a);for(var b=0;b<this.children.length;b++)this.children[b].write(a);a.getPosition()};
53
+ _.w(mS,lS);_.w(nS,TR);nS.prototype.a=function(){for(var a=7,b=0;b<this.gb.length;b++)a+=2,a+=this.gb[b].byteLength;for(b=0;b<this.gb.length;b++)a+=2,a+=this.tc[b].byteLength;return a+TR.prototype.a.call(this)};
54
+ nS.prototype.write=function(a){TR.prototype.write.call(this,a);NR(a,this.version);NR(a,this.f);NR(a,this.h);NR(a,this.level);NR(a,255);NR(a,224|this.gb.length);for(var b=0;b<this.gb.length;b++)PR(a,this.gb[b].length),_.dn(a,this.gb[b]);NR(a,this.tc.length);for(b=0;b<this.tc.length;b++)PR(a,this.tc[b].length),_.dn(a,this.tc[b]);a.getPosition()};_.w(oS,Z);oS.prototype.a=function(){return 22+(this.oc.byteLength+3)+Z.prototype.a.call(this)};
55
+ oS.prototype.write=function(a){Z.prototype.write.call(this,a);NR(a,3);NR(a,23+this.oc.byteLength);PR(a,1);NR(a,0);NR(a,4);NR(a,15+this.oc.byteLength);NR(a,64);NR(a,21);OR(a,0);_.V(a,0);_.V(a,0);NR(a,5);NR(a,this.oc.byteLength);_.dn(a,this.oc);_.dn(a,new Uint8Array([6,1,2]));a.getPosition()};_.w(pS,Z);pS.prototype.a=function(){return this.location.length+Z.prototype.a.call(this)};pS.prototype.write=function(a){Z.prototype.write.call(this,a);0<this.location.length&&_.dn(a,SR(this.location));a.getPosition()};
56
+ _.w(qS,Z);qS.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Z.prototype.a.call(this)};qS.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(rS,TR);_.w(sS,Z);sS.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Z.prototype.a.call(this)};
57
+ sS.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(tS,Z);tS.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Z.prototype.a.call(this)};tS.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(uS,Z);
58
+ uS.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Z.prototype.a.call(this)};uS.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(vS,Z);vS.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Z.prototype.a.call(this)};
59
+ vS.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(wS,Z);wS.prototype.a=function(){return 8+Z.prototype.a.call(this)};wS.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,0);_.V(a,0);a.getPosition()};_.w(xS,Z);xS.prototype.a=function(){return 4+Z.prototype.a.call(this)};xS.prototype.write=function(a){Z.prototype.write.call(this,a);RR(a,0);PR(a,0);a.getPosition()};
60
+ _.w(yS,TR);_.w(zS,TR);_.w(AS,TR);_.w(BS,Z);BS.prototype.a=function(){var a=0;a=1===this.version?a+8:a+4;return a+Z.prototype.a.call(this)};BS.prototype.write=function(a){Z.prototype.write.call(this,a);1===this.version?MR(a,this.baseMediaDecodeTime):_.V(a,this.baseMediaDecodeTime);a.getPosition()};_.w(CS,Z);CS.prototype.a=function(){return 4+Z.prototype.a.call(this)};CS.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.f);a.getPosition()};_.w(DS,Z);
61
+ DS.prototype.a=function(){var a=4;this.flags&AT&&(a+=4);this.flags&BT&&(a+=4);for(var b=0;b<this.f;b++)this.flags&CT&&(a+=4),this.flags&DT&&(a+=4),this.flags&ET&&(a+=4),this.flags&FT&&(a+=4);return a+Z.prototype.a.call(this)};
62
+ DS.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.f);this.flags&AT&&(a.getPosition(),QR(a,this.j));this.flags&BT&&_.V(a,this.l);for(var b=0;b<this.f;b++)this.flags&CT&&_.V(a,this.o[b]),this.flags&DT&&_.V(a,this.sampleSize[b]),this.flags&ET&&_.V(a,this.A[b]),this.flags&FT&&(0===this.version?_.V(a,this.h[b]):QR(a,this.h[b]));a.getPosition()};var AT=1,BT=4,CT=256,DT=512,ET=1024,FT=2048;_.w(ES,Z);
63
+ ES.prototype.a=function(){var a=4;this.flags&GT&&(a+=8);this.flags&HT&&(a+=4);this.flags&IT&&(a+=4);this.flags&JT&&(a+=4);this.flags&KT&&(a+=4);return a+Z.prototype.a.call(this)};ES.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.f);this.flags&GT&&MR(a,this.h);this.flags&HT&&_.V(a,this.A);this.flags&IT&&_.V(a,this.j);this.flags&JT&&_.V(a,this.o);this.flags&KT&&_.V(a,this.l);a.getPosition()};var GT=1,HT=2,IT=8,JT=16,KT=32;_.w(FS,TR);_.w(GS,TR);_.w(HS,TR);
64
+ HS.prototype.a=function(){return this.f.byteLength+TR.prototype.a.call(this)};HS.prototype.write=function(a){TR.prototype.write.call(this,a);0<this.f.byteLength&&_.dn(a,this.f)};_.w(IS,Z);IS.prototype.a=function(){var a=20;1===this.f&&0===this.h&&(a=a+1+this.j.length);return a+Z.prototype.a.call(this)};
65
+ IS.prototype.write=function(a){Z.prototype.write.call(this,a);NR(a,0);0===this.version?NR(a,0):NR(a,0);NR(a,this.f);NR(a,this.h);_.dn(a,_.Om(this.l));if(1===this.f&&0===this.h){NR(a,0);for(var b=0;b<this.j.length;b++)NR(a,this.j[b])}a.getPosition()};_.w(JS,Z);JS.prototype.a=function(){var a=8;this.flags&1&&(a+=SR(this.jc).byteLength);return a+Z.prototype.a.call(this)};JS.prototype.write=function(a){Z.prototype.write.call(this,a);_.dn(a,SR(this.f));_.V(a,this.h);this.flags&1&&_.dn(a,SR(this.jc));a.getPosition()};
66
+ _.w(KS,TR);KS.prototype.a=function(){return SR(this.f).byteLength+TR.prototype.a.call(this)};KS.prototype.write=function(a){TR.prototype.write.call(this,a);_.dn(a,SR(this.f));a.getPosition()};_.w(LS,Z);LS.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+Z.prototype.a.call(this)};
67
+ LS.prototype.write=function(a){Z.prototype.write.call(this,a);this.flags&1&&(_.V(a,0),_.V(a,0));_.V(a,1);for(var b=0;1>b;b++)0===this.version?_.V(a,this.offset[b]):MR(a,this.offset[b]);a.getPosition()};_.w(MS,Z);MS.prototype.a=function(){var a=0;this.flags&1&&(a+=8);a+=5;0===this.f&&(a+=this.j.length);return a+Z.prototype.a.call(this)};
68
+ MS.prototype.write=function(a){Z.prototype.write.call(this,a);this.flags&1&&(_.V(a,0),_.V(a,0));NR(a,this.f);_.V(a,this.h);if(0===this.f)for(var b=0;b<this.h;b++)NR(a,this.j[b]);a.getPosition()};_.w(NS,Z);NS.prototype.a=function(){var a=4;this.flags&1&&(a+=1);for(var b=0;b<this.h;b++)if(a+=this.f[b].ni.byteLength,this.flags&2){a+=2;for(var c=0;c<this.f[b].Ed;c++)a+=2,a+=4}return a+Z.prototype.a.call(this)};
69
+ NS.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.h);this.flags&1&&NR(a,this.j);for(var b=0;b<this.h;b++)if(_.dn(a,this.f[b].ni),this.flags&2){PR(a,this.f[b].Ed);for(var c=0;c<this.f[b].Ed;c++)PR(a,this.f[b].Qg[c].qh),_.V(a,this.f[b].Qg[c].rh)}a.getPosition()};var US=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,VS=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,WS=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,XS=/^(\d*\.?\d*)f$/,YS=/^(\d*\.?\d*)t$/,ZS=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/;cT.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};cT.prototype.write=function(){this.f=bT(this);for(var a=0;a<this.a.length;a++)this.a[a].write(this.f);return this.f.buffer};var fT=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);_.r=lT.prototype;_.r.configure=function(a){this.f=a};_.r.start=function(a,b){var c=this;this.F=b;var d=_.gh(new Set([a,OS(a)])).concat();return mT(this,d).then(function(e){return tT(c,e.data).then(function(){yT(c,c.B);return c.j})})};_.r.requestStop=function(){};_.r.stop=function(){this.F&&this.F.networkingEngine.ye(this.L);this.B=this.A=this.j=this.f=this.F=null;this.l&&(clearTimeout(this.l),this.l=null);this.K=!1;this.J=this.G=Infinity;return Promise.resolve()};
70
+ _.r.update=function(){var a=this;if(this.Vd())return mT(this,[this.o]).then(function(b){return tT(a,b.data).then(function(){return a.j})})["catch"](function(b){if(a.F)a.F.onError(b)})};_.r.setCurrentVariant=function(){};_.r.hc=function(){var a=this;this.g.debug(_.ZC);this.F&&(this.l=null,this.update().then(function(){yT(a,a.B)})["catch"](function(b){a.F&&(a.F.onError(b),1===b.severity&&yT(a,100))}))};_.r.Vd=function(){return this.N===pT};_.r.ng=function(){return 0<this.w.length};
71
+ _.r.ai=function(a){var b=null;if(this.w.length)for(var c=0;c<this.w.length;c++)if(this.w[c].keySystem===a){b=this.w[c].initData[0];break}return b};
72
+ _.r.ho=function(a){if(2!==a.request.type||a.uri.startsWith("data:"))return Promise.resolve(a);var b=a.request.timescale||this.A.timescale,c={isLive:this.Vd.bind(this),df:this.ng.bind(this),Tl:function(){return 1},af:this.ai.bind(this)},d=!1,e=new _.N(_.O,3,4035,null),f=null;try{var g=this.H.get(a.request.uris[a.request.uriIndex])||a.request.startTime||0;g!==a.request.startTime&&this.g.debug("Using base media decode time "+g+" instead of segment reference time "+a.request.startTime);f=hT(a,b,g,c)}catch(h){d=
73
+ !0,e.data=h,3E3===h.code&&(e.code=4039)}if(d||!f)return Promise.reject(e);a.data=f;return Promise.resolve(a)};_.r.loadVariant=function(a){return _.H(function(b){return b["return"](a)})};_.r.loadTextStream=function(a,b){var c=this,d,e;return _.H(function(f){(e=c.j.periods.find(function(g){return g.id===b}))&&(d=e.textStreams.find(function(g){return g.id===a})||null);if(!d)throw new _.Zi(_.PC+a);return f["return"](d)})};var wT={video:_.Lg,audio:_.Tc,text:_.Mc},kT=_.Wb,pT="LIVE",xT={Po:_.dd,Wo:_.hg};_.w(zT,_.Bu);zT.prototype.f=function(){_.dv.ism=lT;_.bv[_.Nc]=lT};zT.prototype.a=function(){_.sF("ism");_.tF(_.Nc)};zT.prototype.id=function(){return _.Zf};_.I("clpp.smooth.SmoothComponent",zT);};
74
74
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
75
75
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
76
76
  else{_=this.clpp._;(f.call(g,this));}