@castlabs/prestoplay 6.22.0 → 6.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/CHANGELOG.md +9 -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 +112 -112
  6. package/cjs/cl.conviva.js +32 -33
  7. package/cjs/cl.core.js +591 -586
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +81 -80
  10. package/cjs/cl.externs.js +43 -36
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +69 -69
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +30 -29
  15. package/cjs/cl.ima.js +23 -23
  16. package/cjs/cl.mse.js +330 -325
  17. package/cjs/cl.muxdata.js +15 -15
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +13 -13
  20. package/cjs/cl.playlist.js +6 -6
  21. package/cjs/cl.sessions.js +16 -16
  22. package/cjs/cl.simid.js +15 -15
  23. package/cjs/cl.smooth.js +72 -72
  24. package/cjs/cl.thumbnails.js +26 -26
  25. package/cjs/cl.tizen.js +72 -72
  26. package/cjs/cl.ttml.js +29 -29
  27. package/cjs/cl.verimatrix.js +5 -5
  28. package/cjs/cl.vimond.js +12 -13
  29. package/cjs/cl.vr.js +19 -19
  30. package/cjs/cl.vtt.js +14 -14
  31. package/cjs/cl.yospace.js +4 -4
  32. package/cjs/cl.youbora.js +37 -37
  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 +88 -88
  37. package/cl.conviva.js +27 -27
  38. package/cl.core.js +477 -474
  39. package/cl.crypto.js +9 -9
  40. package/cl.dash.js +76 -75
  41. package/cl.externs.js +43 -36
  42. package/cl.freewheel.js +19 -19
  43. package/cl.hls.js +74 -74
  44. package/cl.hlssmpte.js +5 -5
  45. package/cl.htmlcue.js +26 -26
  46. package/cl.ima.js +17 -17
  47. package/cl.mse.js +295 -291
  48. package/cl.muxdata.js +13 -13
  49. package/cl.onboard.js +4 -4
  50. package/cl.persistent.js +10 -10
  51. package/cl.playlist.js +5 -5
  52. package/cl.sessions.js +10 -10
  53. package/cl.simid.js +13 -13
  54. package/cl.smooth.js +59 -59
  55. package/cl.thumbnails.js +19 -19
  56. package/cl.tizen.js +57 -57
  57. package/cl.ttml.js +22 -22
  58. package/cl.verimatrix.js +4 -4
  59. package/cl.vimond.js +8 -8
  60. package/cl.vr.js +15 -15
  61. package/cl.vtt.js +12 -12
  62. package/cl.yospace.js +3 -3
  63. package/cl.youbora.js +28 -27
  64. package/package.json +1 -1
  65. package/typings.d.ts +53 -6
package/cjs/cl.muxdata.js CHANGED
@@ -1,19 +1,19 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var TB=function(a){switch(a.type){case 1:return QB;case 2:return RB;case 3:return SB}},VB=function(a){var b=Object.keys(a).find(function(c){return UB.includes(c.toLowerCase())});return void 0!==b?a[b]:void 0},WB=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 _.Uh;this.g=b;this.A=this.l=this.h=!1;this.w=null;this.j=a.getNetworkEngine();this.G=this.yk.bind(this);this.C=this.An.bind(this)},YB=function(a){var b={debug:!0,
3
- data:XB(a)};a.f&&a.f.muxOptionsOverride&&_.M.kd(a.f.muxOptionsOverride)&&(b=_.M.ra(b,a.f.muxOptionsOverride));b=_.M.ra(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 _.Nk(c.url);
4
- f.video_source_url=_.Ok(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().la(),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.pa())&&d.language&&(f.player_language_code=
5
- d.language);return f}});a.g.debug("Mux SDK options",b);return b},XB=function(a){var b={env_key:a.f.envKey,video_title:a.o&&a.o.name||"",player_name:_.ua,player_software_name:_.ua,player_software_version:_.ha,player_mux_plugin_name:"CastlabsPlayer built-in Mux Plugin",player_mux_plugin_version:_.ha};(a=a.m.getConfiguration().viewerId)&&(b.viewer_user_id=a);return b},ZB=function(a){a.a.on(a.m,_.pg,function(){var b={player_playhead_time:1E3*a.m.getPosition()};a.emit(_.pg,b)});a.a.on(a.m,_.kf,function(){return a.emit(_.kf)});
6
- a.a.on(a.m,_.hd,a.vk.bind(a));a.a.on(a.m,_.eg,a.xk.bind(a));a.a.on(a.m,_.zg,function(){return a.emit(_.Xf)});a.a.on(a.m,_.yg,function(){return a.emit(_.Wf)});a.a.on(a.m,_.pe,a.wk.bind(a));a.a.on(a.m,_.tc,function(){return a.emit("adbreakstart")});a.a.on(a.m,_.uc,function(){return a.emit("adbreakend")});a.a.on(a.m,_.Jc,function(){a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,_.Fc,function(){return a.emit("adpause")});a.a.on(a.m,_.Hc,function(){a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,
7
- _.Kc,function(){return a.emit("adended")});a.a.on(a.m,_.yc,function(){return a.emit("adfirstquartile")});a.a.on(a.m,_.Ec,function(){return a.emit("admidpoint")});a.a.on(a.m,_.Lc,function(){return a.emit("adthirdquartile")});a.j.Sc(a.G);a.j.zf(a.C);a.a.on(a.m,_.pe,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 _.Nk(b.uris[b.uriIndex]);b={request_start:c,request_type:TB(b),
8
- request_hostname:d.a};a.g.debug("onRequestCanceled()","Track event: requestcanceled",b);a.emit("requestcanceled",b)}else{d=b.requestStartTimestamp;var e=new _.Nk(b.uris[b.uriIndex]),f=c.data;b={request_start:d,request_type:TB(b),request_hostname:e.a,request_error:""+TB(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)}})},$B=function(a){_.Xh(a.a);a.j.me(a.G);a.j.vg(a.C)},aC=function(){this.f=this.m=null;this.a=!1;this.g=new _.K("clpp.muxdata")},bC=function(a){return!_.M.R(a)&&typeof a.init===_.te&&typeof a.emit===_.te},cC=function(){},QB="manifest",RB="media",SB="encryption",UB=["x-request-id","cf-ray","x-amz-cf-id","x-akamai-request-id"];_.u=WB.prototype;_.u.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,YB(this))}catch(d){throw this.h=!1,$B(this),new _.N(1,9,9302,null,d);}this.emit("playerready")}this.l&&!this.A&&(a=XB(this),this.emit("videochange",a),this.l=!1);ZB(this)};_.u.release=function(){this.g.debug("release()");this.l?this.g.debug(_.ka):($B(this),this.l=!0,this.o=this.f=null)};_.u.destroy=function(){this.g.debug(_.Wd);this.A?this.g.debug(_.ja):(this.A=!0,this.emit("destroy"))};
10
- _.u.emit=function(a,b){if(null===this.w)throw new _.N(1,9,9301);this.w.emit(this.B,a,b)};_.u.vk=function(a){this.g.debug(_.Xe);var b=a.detail;a=this.m.getTrackManager();b&&b.bandwidth&&(b=b.bandwidth,(a=a.Xa())&&a.bandwidth&&(b+=a.bandwidth),this.emit("renditionchange",{video_source_bitrate:b}))};_.u.xk=function(a){this.g.debug(_.af);switch(a.detail.currentState){case _.Yp:this.m.getConfiguration().autoplay&&this.emit(_.kf);break;case _.$p:this.emit(_.vf);break;case _.Zp:this.emit(_.ff);break;case _.Tp:this.emit(_.oe)}};
11
- _.u.wk=function(a){this.g.debug(_.Ye);if(this.h&&(a=a.detail||null))if(10003===a.code)this.emit("aderror");else if(a.severity===_.P){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(_.pe,{player_error_code:a.code,player_error_message:b})}};
12
- _.u.yk=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 _.Nk(b.uris[b.uriIndex]);a={request_start:e,request_type:TB(b),request_hostname:g.a,request_id:VB(c),request_bytes_loaded:d,request_response_start:h,request_response_end:a,request_response_headers:c,request_media_duration:f,
13
- request_url:_.Ok(g)};this.g.debug("onRequestCompleted()","Track event: requestcompleted",a);this.emit("requestcompleted",a)}};_.u.An=function(a){a.requestStartTimestamp=Date.now()};_.x(aC,_.yv);_.u=aC.prototype;_.u.onPlayerCreated=function(a){this.m=a;this.f=new WB(a,this.g)};
14
- _.u.onContentWillLoad=function(a,b){var c=a.getConfiguration();c=_.M.eb(c.muxdata);try{var d=[];typeof c===_.We&&(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=!_.M.R(e.muxdata)&&typeof e.muxdata===_.We){var f=e.muxdata;d=bC(f.muxLib)?f.muxLib:window.mux;if(!bC(d)){this.g.warn("Mux SDK is not loaded. Will do nothing.");this.a=!1;var g=new _.N(1,9,9301);this.S(a,g)}}else this.g.debug("Mux plugin is loaded but not configured. Will do nothing.");
15
- var h=d;null!==h&&this.f.initialize(c,b,h)}catch(l){this.a=!1,this.S(a,l)}};_.u.onContentLoaded=function(){};_.u.onPlayerWillDestroy=function(){this.a&&(this.f.destroy(),this.m=this.f=null)};_.u.onPlayerWillRelease=function(){this.a&&this.f.release()};_.u.id=function(){return"mux"};_.u.emit=function(a,b){try{this.f.emit(a,b)}catch(c){throw null!==this.m&&this.S(this.m,c),c;}};_.u.S=function(a,b){a.trigger(new _.L(_.pe,{detail:b}))};_.J("clpp.muxdata.MuxDataPlugin",aC);aC.prototype.emit=aC.prototype.emit;
16
- aC.Id="mux";cC.prototype.create=function(){return new aC};_.Ys(new cC);};
2
+ var f=function(window){var aC=function(a){switch(a.type){case 1:return YB;case 2:return ZB;case 3:return $B}},cC=function(a){var b=Object.keys(a).find(function(c){return bC.includes(c.toLowerCase())});return void 0!==b?a[b]:void 0},dC=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 _.Wh;this.g=b;this.A=this.l=this.h=!1;this.w=null;this.j=a.getNetworkEngine();this.G=this.Ek.bind(this);this.C=this.In.bind(this)},fC=function(a){var b={debug:!0,
3
+ data:eC(a)};a.f&&a.f.muxOptionsOverride&&_.N.gd(a.f.muxOptionsOverride)&&(b=_.N.qa(b,a.f.muxOptionsOverride));b=_.N.qa(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 _.Qk(c.url);
4
+ f.video_source_url=_.Rk(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().ka(),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.oa())&&d.language&&(f.player_language_code=
5
+ d.language);return f}});a.g.debug("Mux SDK options",b);return b},eC=function(a){var b={env_key:a.f.envKey,video_title:a.o&&a.o.name||"",player_name:_.ta,player_software_name:_.ta,player_software_version:_.ha,player_mux_plugin_name:"CastlabsPlayer built-in Mux Plugin",player_mux_plugin_version:_.ha};(a=a.m.getConfiguration().viewerId)&&(b.viewer_user_id=a);return b},gC=function(a){a.a.on(a.m,_.qg,function(){var b={player_playhead_time:1E3*a.m.getPosition()};a.emit(_.qg,b)});a.a.on(a.m,_.mf,function(){return a.emit(_.mf)});
6
+ a.a.on(a.m,_.gd,a.Bk.bind(a));a.a.on(a.m,_.fg,a.Dk.bind(a));a.a.on(a.m,_.Ag,function(){return a.emit(_.Yf)});a.a.on(a.m,_.zg,function(){return a.emit(_.Xf)});a.a.on(a.m,_.qe,a.Ck.bind(a));a.a.on(a.m,_.rc,function(){return a.emit("adbreakstart")});a.a.on(a.m,_.sc,function(){return a.emit("adbreakend")});a.a.on(a.m,_.Hc,function(){a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,_.Dc,function(){return a.emit("adpause")});a.a.on(a.m,_.Fc,function(){a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,
7
+ _.Ic,function(){return a.emit("adended")});a.a.on(a.m,_.wc,function(){return a.emit("adfirstquartile")});a.a.on(a.m,_.Cc,function(){return a.emit("admidpoint")});a.a.on(a.m,_.Jc,function(){return a.emit("adthirdquartile")});a.j.Rc(a.G);a.j.zf(a.C);a.a.on(a.m,_.qe,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 _.Qk(b.uris[b.uriIndex]);b={request_start:c,request_type:aC(b),
8
+ request_hostname:d.a};a.g.debug("onRequestCanceled()","Track event: requestcanceled",b);a.emit("requestcanceled",b)}else{d=b.requestStartTimestamp;var e=new _.Qk(b.uris[b.uriIndex]),f=c.data;b={request_start:d,request_type:aC(b),request_hostname:e.a,request_error:""+aC(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)}})},hC=function(a){_.Zh(a.a);a.j.me(a.G);a.j.vg(a.C)},iC=function(){this.f=this.m=null;this.a=!1;this.g=new _.K("clpp.muxdata")},jC=function(a){return!_.N.R(a)&&typeof a.init===_.ue&&typeof a.emit===_.ue},kC=function(a,b){a.trigger(new _.L(_.qe,{detail:b}))},lC=function(){},YB="manifest",ZB="media",$B="encryption",bC=["x-request-id","cf-ray","x-amz-cf-id","x-akamai-request-id"];_.u=dC.prototype;_.u.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,fC(this))}catch(d){throw this.h=!1,hC(this),new _.O(1,9,9302,null,d);}this.emit("playerready")}this.l&&!this.A&&(a=eC(this),this.emit("videochange",a),this.l=!1);gC(this)};_.u.release=function(){this.g.debug("release()");this.l?this.g.debug(_.ka):(hC(this),this.l=!0,this.o=this.f=null)};_.u.destroy=function(){this.g.debug(_.Vd);this.A?this.g.debug(_.ja):(this.A=!0,this.emit("destroy"))};
10
+ _.u.emit=function(a,b){if(null===this.w)throw new _.O(1,9,9301);this.w.emit(this.B,a,b)};_.u.Bk=function(a){this.g.debug(_.Ye);var b=a.detail;a=this.m.getTrackManager();b&&b.bandwidth&&(b=b.bandwidth,(a=a.Va())&&a.bandwidth&&(b+=a.bandwidth),this.emit("renditionchange",{video_source_bitrate:b}))};_.u.Dk=function(a){this.g.debug(_.cf);switch(a.detail.currentState){case _.gq:this.m.getConfiguration().autoplay&&this.emit(_.mf);break;case _.iq:this.emit(_.xf);break;case _.hq:this.emit(_.hf);break;case _.bq:this.emit(_.pe)}};
11
+ _.u.Ck=function(a){this.g.debug(_.$e);if(this.h&&(a=a.detail||null))if(10003===a.code)this.emit("aderror");else if(a.severity===_.P){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(_.qe,{player_error_code:a.code,player_error_message:b})}};
12
+ _.u.Ek=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 _.Qk(b.uris[b.uriIndex]);a={request_start:e,request_type:aC(b),request_hostname:g.a,request_id:cC(c),request_bytes_loaded:d,request_response_start:h,request_response_end:a,request_response_headers:c,request_media_duration:f,
13
+ request_url:_.Rk(g)};this.g.debug("onRequestCompleted()","Track event: requestcompleted",a);this.emit("requestcompleted",a)}};_.u.In=function(a){a.requestStartTimestamp=Date.now()};_.x(iC,_.Gv);_.u=iC.prototype;_.u.onPlayerCreated=function(a){this.m=a;this.f=new dC(a,this.g)};
14
+ _.u.onContentWillLoad=function(a,b){var c=a.getConfiguration();c=_.N.cb(c.muxdata);try{var d=[];typeof c===_.Xe&&(c.envKey||d.push("envKey"));if(0<d.length)throw new _.O(1,9,9300,{missingKeys:d});var e=a.getConfiguration();d=null;if(this.a=!_.N.R(e.muxdata)&&typeof e.muxdata===_.Xe){var f=e.muxdata;d=jC(f.muxLib)?f.muxLib:window.mux;if(!jC(d)){this.g.warn("Mux SDK is not loaded. Will do nothing.");this.a=!1;var g=new _.O(1,9,9301);kC(a,g)}}else this.g.debug("Mux plugin is loaded but not configured. Will do nothing.");
15
+ var h=d;null!==h&&this.f.initialize(c,b,h)}catch(l){this.a=!1,kC(a,l)}};_.u.onContentLoaded=function(){};_.u.onPlayerWillDestroy=function(){this.a&&(this.f.destroy(),this.m=this.f=null)};_.u.onPlayerWillRelease=function(){this.a&&this.f.release()};_.u.id=function(){return"mux"};_.u.emit=function(a,b){try{this.f.emit(a,b)}catch(c){throw null!==this.m&&kC(this.m,c),c;}};_.J("clpp.muxdata.MuxDataPlugin",iC);iC.prototype.emit=iC.prototype.emit;iC.Id="mux";lC.prototype.create=function(){return new iC};
16
+ _.gt(new lC);};
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));}
package/cjs/cl.onboard.js CHANGED
@@ -1,7 +1,7 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var OB=function(){this.g=new _.K("clpp.onboard");this.j=new Set},PB=function(a,b){function c(l){return l&&(_.S.startsWith(l,"https://")||_.S.startsWith(l,"http://")||_.S.startsWith(l,"//"))?l:d+l}var d=b.baseUrl;_.S.endsWith(d,"/")||(d+="/");var e=c(b.widevineUrl||"widevine"),f=c(b.playreadyUrl||"playready"),g=c(b.fairplayUrl||"fairplay"),h=new _.Zm(a);h.$a(_.Pd,{licenseUrl:e,videoRobustness:[_.Ub,void 0],audioRobustness:[_.Tb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,
3
- modifiers:{licenseRequest:_.On,licenseResponse:_.Tn}});h.$a(_.Jd,{licenseUrl:g,certificateUrl:g,modifiers:{licenseRequest:_.Qn,licenseResponse:_.Rn,extractContentId:_.Mn,certificateRequest:_.Sn}});h.$a(_.Nd,{licenseUrl:f,modifiers:{licenseRequest:_.On}});_.Um(h)};_.x(OB,_.Bt);OB.prototype.a=function(){for(var a=_.w(this.j),b=a.next();!b.done;b=a.next())delete _.Tm[b.value];this.j.clear()};
4
- OB.prototype.h=function(a){a=a.getConfiguration().drm;var b;if(b=!(!a||!a.env))b=a&&a.customData,b=!(!b||!b.baseUrl);b&&(b=a.env,a=a.customData,a={baseUrl:a.baseUrl,widevineUrl:a.widevineUrl,playreadyUrl:a.playreadyUrl,fairplayUrl:a.fairplayUrl},this.g.info("Registering the DRMtoday Onboard environment, name\x3d'"+b+"'"),PB(b,a),this.j.add(b))};OB.prototype.id=function(){return"onboard"};_.J("clpp.onboard.OnboardComponent",OB);_.J("clpp.onboard.register",PB);};
2
+ var f=function(window){var WB=function(){this.g=new _.K("clpp.onboard");this.j=new Set},XB=function(a,b){function c(l){return l&&(_.T.startsWith(l,"https://")||_.T.startsWith(l,"http://")||_.T.startsWith(l,"//"))?l:d+l}var d=b.baseUrl;_.T.endsWith(d,"/")||(d+="/");var e=c(b.widevineUrl||"widevine"),f=c(b.playreadyUrl||"playready"),g=c(b.fairplayUrl||"fairplay"),h=new _.bn(a);h.Ya(_.Od,{licenseUrl:e,videoRobustness:[_.Tb,void 0],audioRobustness:[_.Sb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,
3
+ modifiers:{licenseRequest:_.Sn,licenseResponse:_.Xn}});h.Ya(_.Jd,{licenseUrl:g,certificateUrl:g,modifiers:{licenseRequest:_.Un,licenseResponse:_.Vn,extractContentId:_.Qn,certificateRequest:_.Wn}});h.Ya(_.Md,{licenseUrl:f,modifiers:{licenseRequest:_.Sn}});_.Xm(h)};_.x(WB,_.Kt);WB.prototype.a=function(){for(var a=_.w(this.j),b=a.next();!b.done;b=a.next())delete _.Wm[b.value];this.j.clear()};
4
+ WB.prototype.h=function(a){a=a.getConfiguration().drm;var b;if(b=!(!a||!a.env))b=a&&a.customData,b=!(!b||!b.baseUrl);b&&(b=a.env,a=a.customData,a={baseUrl:a.baseUrl,widevineUrl:a.widevineUrl,playreadyUrl:a.playreadyUrl,fairplayUrl:a.fairplayUrl},this.g.info("Registering the DRMtoday Onboard environment, name\x3d'"+b+"'"),XB(b,a),this.j.add(b))};WB.prototype.id=function(){return"onboard"};_.J("clpp.onboard.OnboardComponent",WB);_.J("clpp.onboard.register",XB);};
5
5
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
6
6
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
7
7
  else{_=this.clpp._;(f.call(g,this));}
@@ -1,18 +1,18 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var wB="A persistent DRM session already exists for: ",xB="No DRM configuration.",yB="clpp.persistent",zB="clpp.persistent.SimpleSessionStorage",AB=function(a,b){for(var c=[],d=_.w(a),e=d.next();!e.done;e=d.next())c.push(b(e.value));return c},BB=function(a){a=a.f.keys();a=AB(a,function(b){return b.sessionId});return Array.from(a)},CB=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a)return _.y(f,_.dp(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.f.get(c))&&a.B&&(e.Mb=new _.kk,d.push(e.Mb));a.g.debug("Attempting to remove session",b);d.push(c.remove());return f["return"](Promise.all(d))})},EB=function(a,b){a.K=DB;a.L=[];a.G=!0;return _.Ho(a,b)},GB=function(a,b,c,d,e,f){a.K=FB;var g=new Map,h=_.ip(b);g.set(h,{audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:_.cf,persistentState:_.Pf,sessionTypes:[_.hf],label:h,drmInfos:[{keySystem:b,licenseServerUri:c,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",
4
- videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}]});return _.Ro(a,g)},HB=function(){this.g=new _.K(zB)},IB=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}},JB=function(a,b){var c=
5
- _.Wm(a),d=_.Am({drm:a});d.drm=a;var e=new _.Do({Kb:b,onError:function(){},hg:function(){},gg:function(){},onEvent:function(){},getConfiguration:function(){return d},gd:function(){return null}});e.h=c;return e},MB=function(a,b,c){var d,e,f,g,h,l,m,n,p;return _.I(function(q){switch(q.a){case 1:d=KB;e=LB;if(!a)return e.debug(xB),q["return"]();f=a.offlineId;return 0===f.length?q["return"]():_.y(q,d.get(f),2);case 2:if(g=q.f)return e.debug(wB,f),q["return"]();h=JB(a,c);_.D(q,3,4);return _.y(q,EB(h,b),
6
- 6);case 6:return _.y(q,_.Xo(h),7);case 7:return _.y(q,_.Yo(h),8);case 8:return l=h.getDrmInfo(),m=b.map(function(t){return{contentType:_.pl(t.video.mimeType,t.video.codecs),robustness:l.videoRobustness}}),n=BB(h),g={sessionIds:n,keySystem:l.keySystem,licenseServerUri:l.licenseServerUri,serverCertificate:l.serverCertificate,audioCapabilities:[],videoCapabilities:m,drmConfig:a},_.y(q,d.store(f,g),4);case 4:return _.rh(q),_.y(q,h.destroy(),10);case 10:_.sh(q);break;case 3:throw p=_.E(q),e.error("Error while persisting DRM session "+
7
- f),new _.N(1,6,6200,null,p);}})},NB=function(){this.g=new _.K(yB)},DB=1,FB=2;_.u=HB.prototype;
2
+ var f=function(window){var EB="A persistent DRM session already exists for: ",FB="No DRM configuration.",GB="clpp.persistent",HB="clpp.persistent.SimpleSessionStorage",IB=function(a,b){for(var c=[],d=_.w(a),e=d.next();!e.done;e=d.next())c.push(b(e.value));return c},JB=function(a){a=a.h.keys();a=IB(a,function(b){return b.sessionId});return Array.from(a)},KB=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a)return _.y(f,_.hp(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.nc=new _.mk,d.push(e.nc));a.g.debug("Attempting to remove session",b);d.push(c.remove());return f["return"](Promise.all(d))})},MB=function(a,b){a.L=LB;a.M=[];a.H=!0;return _.Lo(a,b)},OB=function(a,b,c,d,e,f){a.L=NB;var g=new Map,h=_.mp(b);g.set(h,{audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:_.ef,persistentState:_.Qf,sessionTypes:[_.kf],label:h,drmInfos:[{keySystem:b,licenseServerUri:c,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",
4
+ videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}]});return _.Vo(a,g)},PB=function(){this.g=new _.K(HB)},QB=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}},RB=function(a,b){var c=
5
+ _.Zm(a),d=_.Em({drm:a});d.drm=a;var e=new _.Ho({tb:b,onError:function(){},hg:function(){},gg:function(){},onEvent:function(){},getConfiguration:function(){return d},dd:function(){return null}});e.f=c;return e},UB=function(a,b,c){var d,e,f,g,h,l,m,n,p;return _.I(function(q){switch(q.a){case 1:d=SB;e=TB;if(!a)return e.debug(FB),q["return"]();f=a.offlineId;return 0===f.length?q["return"]():_.y(q,d.get(f),2);case 2:if(g=q.f)return e.debug(EB,f),q["return"]();h=RB(a,c);_.D(q,3,4);return _.y(q,MB(h,b),
6
+ 6);case 6:return _.y(q,_.ap(h),7);case 7:return _.y(q,_.bp(h),8);case 8:return l=h.getDrmInfo(),m=b.map(function(t){return{contentType:_.sl(t.video.mimeType,t.video.codecs),robustness:l.videoRobustness}}),n=JB(h),g={sessionIds:n,keySystem:l.keySystem,licenseServerUri:l.licenseServerUri,serverCertificate:l.serverCertificate,audioCapabilities:[],videoCapabilities:m,drmConfig:a},_.y(q,d.store(f,g),4);case 4:return _.th(q),_.y(q,h.destroy(),10);case 10:_.uh(q);break;case 3:throw p=_.F(q),e.error("Error while persisting DRM session "+
7
+ f),new _.O(1,6,6200,null,p);}})},VB=function(){this.g=new _.K(GB)},LB=1,NB=2;_.u=PB.prototype;
8
8
  _.u.store=function(a,b){var c;return _.I(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));_.C(d)})};_.u.get=function(a){var b=this,c;return _.I(function(d){if(c=window.localStorage.getItem(encodeURIComponent(a)))try{return d["return"](IB(atob(c)))}catch(e){b.g.warn("Error while loading offline items for "+a+" from storage: ",e)}return d["return"](null)})};_.u["delete"]=function(a){return _.I(function(b){window.localStorage.removeItem(encodeURIComponent(a));_.C(b)})};_.u.clear=function(){return _.I(function(a){window.localStorage.clear();_.C(a)})};_.u.getName=function(){return zB};_.J("clpp.persistent.useStorage",function(a){var b=["store","get","delete","clear","getName"];var c=[];_.M.R(a)||(_.M.Jb(a.store)||c.push("store"),_.M.Jb(a.get)||c.push("get"),_.M.Jb(a["delete"])||c.push("delete"),_.M.Jb(a.clear)||c.push("clear"),_.M.Jb(a.getName)||c.push("getName"),b=c);if(0<b.length)throw LB.warn("Invalid session storage implementation"),new _.N(1,6,6202,{missingMethods:b});KB=a});
10
- _.J("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,F,G,B,H,O,U,X;return _.I(function(R){switch(R.a){case 1:f=KB;g=LB;h=function(qa,Ca){return new _.N(1,6,6200,qa,Ca)};l=_.dq(a).shift();if(!l)throw h("No source specified.");if(!b)throw h(xB);m=b.offlineId;if(typeof m!==_.hg||!m.length)throw h("Missing offline id.");return _.y(R,f.get(m),2);case 2:if(n=R.f)return g.debug(wB,m),R["return"]();p=_.Am();q=new _.xk;t=
11
- [];v=_.w(d);for(z=v.next();!z.done;z=v.next())A=z.value,F=new A,_.Em(F.id())||(F.f(),_.Gm(F),t.push(F));G=null;_.D(R,3,4);return _.y(R,_.xu(l.url,q,p.manifest.attemptParameters,l.type||null),6);case 6:return G=R.f,G.configure(p.manifest),_.y(R,G.start(l.url,{configurationId:"",networkingEngine:q,filterAllPeriods:function(){},filterNewPeriod:function(){},onEvent:function(){},onError:function(){}}),7);case 7:B=R.f;if(!B.periods.length)throw h(null,new _.N(_.P,4,4014));H=_.ou(B.periods);return _.y(R,
12
- MB(b,H,q),4);case 4:for(_.rh(R);t.length;)O=t.shift(),O.a(),_.Dm["delete"](O.id());U=[];G&&U.push(G.stop());U.push(q.destroy());return _.y(R,Promise.all(U),9);case 9:_.sh(R);break;case 3:X=_.E(R);if(X instanceof _.N&&6200===X.code)throw X;throw h(null,X);}})});
13
- _.J("clpp.persistent.removeLicense",function(a){var b,c,d,e,f,g,h;return _.I(function(l){switch(l.a){case 1:b=KB;c=LB;if(!_.M.ea(a)||0===a.length)return c.warn("Invalid offlineId"),l["return"]();e=d=null;_.D(l,2,3);return _.y(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 _.xk;d=JB(f.drmConfig,e);return _.y(l,GB(d,f.keySystem,f.licenseServerUri,f.serverCertificate,f.audioCapabilities,f.videoCapabilities),
14
- 6);case 6:return _.y(l,_.Xo(d),7);case 7:return _.y(l,Promise.all(f.sessionIds.map(function(m){return _.I(function(n){if(1==n.a)return _.y(n,CB(d,m),2);c.debug("successfully removed session with id",m);_.C(n)})})),8);case 8:return _.y(l,b["delete"](a),3);case 3:return _.rh(l),g=[],d&&g.push(d.destroy()),e&&g.push(e.destroy()),_.y(l,Promise.all(g),10);case 10:_.sh(l);break;case 2:throw h=_.E(l),c.error("Failed to remove session"),new _.N(1,6,6201,null,h);}})});var KB=new HB,LB=new _.K(yB);_.x(NB,_.Bt);NB.prototype.id=function(){return _.gf};NB.prototype.l=function(a,b){var c=this,d,e,f;return _.I(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();_.D(g,2);return _.y(g,MB(d,b,e),4)}if(2!=g.a)return a.trigger(new _.L(_.ge,{offlineId:d.offlineId})),_.qh(g,0);f=_.E(g);a.onError(f);_.C(g)})};
15
- NB.prototype.j=function(a){var b=this,c,d;return _.I(function(e){if(1==e.a)return b.g.debug("Getting EME session IDs for "+a),c=KB,_.D(e,2),_.y(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"]([])})};_.J("clpp.persistent.PersistentLicenseComponent",NB);};
9
+ btoa(c));_.B(d)})};_.u.get=function(a){var b=this,c;return _.I(function(d){if(c=window.localStorage.getItem(encodeURIComponent(a)))try{return d["return"](QB(atob(c)))}catch(e){b.g.warn("Error while loading offline items for "+a+" from storage: ",e)}return d["return"](null)})};_.u["delete"]=function(a){return _.I(function(b){window.localStorage.removeItem(encodeURIComponent(a));_.B(b)})};_.u.clear=function(){return _.I(function(a){window.localStorage.clear();_.B(a)})};_.u.getName=function(){return HB};_.J("clpp.persistent.useStorage",function(a){var b=["store","get","delete","clear","getName"];var c=[];_.N.R(a)||(_.N.Lb(a.store)||c.push("store"),_.N.Lb(a.get)||c.push("get"),_.N.Lb(a["delete"])||c.push("delete"),_.N.Lb(a.clear)||c.push("clear"),_.N.Lb(a.getName)||c.push("getName"),b=c);if(0<b.length)throw TB.warn("Invalid session storage implementation"),new _.O(1,6,6202,{missingMethods:b});SB=a});
10
+ _.J("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,G,E,C,H,M,R,V;return _.I(function(S){switch(S.a){case 1:f=SB;g=TB;h=function(Ba,Ca){return new _.O(1,6,6200,Ba,Ca)};l=_.mq(a).shift();if(!l)throw h("No source specified.");if(!b)throw h(FB);m=b.offlineId;if(typeof m!==_.ig||!m.length)throw h("Missing offline id.");return _.y(S,f.get(m),2);case 2:if(n=S.f)return g.debug(EB,m),S["return"]();p=_.Em();q=new _.Ak;t=
11
+ [];v=_.w(d);for(z=v.next();!z.done;z=v.next())A=z.value,G=new A,_.Im(G.id())||(G.f(),_.Km(G),t.push(G));E=null;_.D(S,3,4);return _.y(S,_.Gu(l.url,q,p.manifest.attemptParameters,l.type||null),6);case 6:return E=S.f,E.configure(p.manifest),_.y(S,E.start(l.url,{configurationId:"",networkingEngine:q,filterAllPeriods:function(){},filterNewPeriod:function(){},onEvent:function(){},onError:function(){}}),7);case 7:C=S.f;if(!C.periods.length)throw h(null,new _.O(_.P,4,4014));H=_.xu(C.periods);return _.y(S,
12
+ UB(b,H,q),4);case 4:for(_.th(S);t.length;)M=t.shift(),M.a(),_.Hm["delete"](M.id());R=[];E&&R.push(E.stop());R.push(q.destroy());return _.y(S,Promise.all(R),9);case 9:_.uh(S);break;case 3:V=_.F(S);if(V instanceof _.O&&6200===V.code)throw V;throw h(null,V);}})});
13
+ _.J("clpp.persistent.removeLicense",function(a){var b,c,d,e,f,g,h;return _.I(function(l){switch(l.a){case 1:b=SB;c=TB;if(!_.N.da(a)||0===a.length)return c.warn("Invalid offlineId"),l["return"]();e=d=null;_.D(l,2,3);return _.y(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 _.Ak;d=RB(f.drmConfig,e);return _.y(l,OB(d,f.keySystem,f.licenseServerUri,f.serverCertificate,f.audioCapabilities,f.videoCapabilities),
14
+ 6);case 6:return _.y(l,_.ap(d),7);case 7:return _.y(l,Promise.all(f.sessionIds.map(function(m){return _.I(function(n){if(1==n.a)return _.y(n,KB(d,m),2);c.debug("successfully removed session with id",m);_.B(n)})})),8);case 8:return _.y(l,b["delete"](a),3);case 3:return _.th(l),g=[],d&&g.push(d.destroy()),e&&g.push(e.destroy()),_.y(l,Promise.all(g),10);case 10:_.uh(l);break;case 2:throw h=_.F(l),c.error("Failed to remove session"),new _.O(1,6,6201,null,h);}})});var SB=new PB,TB=new _.K(GB);_.x(VB,_.Kt);VB.prototype.id=function(){return _.jf};VB.prototype.l=function(a,b){var c=this,d,e,f;return _.I(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();_.D(g,2);return _.y(g,UB(d,b,e),4)}if(2!=g.a)return a.trigger(new _.L(_.he,{offlineId:d.offlineId})),_.sh(g,0);f=_.F(g);a.onError(f);_.B(g)})};
15
+ VB.prototype.j=function(a){var b=this,c,d;return _.I(function(e){if(1==e.a)return b.g.debug("Getting EME session IDs for "+a),c=SB,_.D(e,2),_.y(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"]([])}_.F(e);b.g.warn("Error while loading session info from storage");return e["return"]([])})};_.J("clpp.persistent.PersistentLicenseComponent",VB);};
16
16
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
17
17
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
18
18
  else{_=this.clpp._;(f.call(g,this));}
@@ -1,10 +1,10 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var tB=function(a,b){b=void 0===b?function(){return Promise.resolve()}:b;_.sm.call(this);this.m=a;this.l=b;this.f=0;this.a=[];this.h=!1;this.j=this.tb.bind(this)},uB=function(a){a.trigger(new _.L(_.xf))},vB=function(a,b){return 0<=b&&b<a.a.length};_.x(tB,_.sm);_.u=tB.prototype;_.u.on=function(a,b,c){return _.sm.prototype.on.call(this,a,b,c)};_.u.one=function(a,b,c){return _.sm.prototype.one.call(this,a,b,c)};_.u.off=function(a,b){return _.sm.prototype.off.call(this,a,b)};_.u.getPosition=function(){return this.f};
3
- _.u.Cl=function(){return this.a};_.u.Vd=function(){return 0<this.a.length&&vB(this,this.f)?this.a[this.f]:null};_.u.El=function(){var a=this.f+1;return 0<this.a.length&&vB(this,a)?this.a[a]:null};_.u.Tl=function(){return this.h};_.u.start=function(){this.h||(this.h=!0,this.m.on(_.oe,this.j),this.Oe(this.f,!0))};_.u.stop=function(){this.h=!1;this.m.off(_.oe,this.j)};_.u.tb=function(){this.next()};
4
- _.u.next=function(){var a=this,b;return _.I(function(c){b=Math.min(a.a.length-1,a.f+1);return _.y(c,a.Oe(b),0)})};_.u.tn=function(){var a=this,b;return _.I(function(c){b=Math.max(0,a.f-1);return _.y(c,a.Oe(b),0)})};_.u.Oe=function(a,b){b=void 0===b?!1:b;var c=this,d;return _.I(function(e){if(1==e.a){if(!(0<c.a.length&&vB(c,a))||!b&&c.f===a)return e["return"]();c.f=a;return(d=c.Vd())?_.y(e,c.l(d),3):e.F(0)}if(4!=e.a)return _.y(e,c.m.load(d.configuration),4);c.trigger(new _.L(_.wf,{item:d}));_.C(e)})};
5
- _.u.append=function(a){this.a.push(a);uB(this)};_.u.Pl=function(a,b){if(0<=b&&b<=this.a.length){var c=this.Vd();this.a.splice(b,0,a);c&&(this.f=this.a.indexOf(c));uB(this)}};_.u.remove=function(a){if(0<this.a.length&&vB(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);uB(this)}};_.u.clear=function(){this.stop();this.f=0;this.a=[];this.h=!1;uB(this)};_.J("clpp.Playlist",tB);tB.prototype.clear=tB.prototype.clear;tB.prototype.remove=tB.prototype.remove;
6
- tB.prototype.insert=tB.prototype.Pl;tB.prototype.append=tB.prototype.append;tB.prototype.goTo=tB.prototype.Oe;tB.prototype.previous=tB.prototype.tn;tB.prototype.next=tB.prototype.next;tB.prototype.onEnded=tB.prototype.tb;tB.prototype.stop=tB.prototype.stop;tB.prototype.start=tB.prototype.start;tB.prototype.isStarted=tB.prototype.Tl;tB.prototype.getUpcoming=tB.prototype.El;tB.prototype.getCurrent=tB.prototype.Vd;tB.prototype.getQueue=tB.prototype.Cl;tB.prototype.getPosition=tB.prototype.getPosition;
7
- tB.prototype.off=tB.prototype.off;tB.prototype.one=tB.prototype.one;tB.prototype.on=tB.prototype.on;};
2
+ var f=function(window){var BB=function(a,b){b=void 0===b?function(){return Promise.resolve()}:b;_.wm.call(this);this.m=a;this.l=b;this.f=0;this.a=[];this.h=!1;this.j=this.ub.bind(this)},CB=function(a){a.trigger(new _.L(_.zf))},DB=function(a,b){return 0<=b&&b<a.a.length};_.x(BB,_.wm);_.u=BB.prototype;_.u.on=function(a,b,c){return _.wm.prototype.on.call(this,a,b,c)};_.u.one=function(a,b,c){return _.wm.prototype.one.call(this,a,b,c)};_.u.off=function(a,b){return _.wm.prototype.off.call(this,a,b)};_.u.getPosition=function(){return this.f};
3
+ _.u.Ll=function(){return this.a};_.u.Vd=function(){return 0<this.a.length&&DB(this,this.f)?this.a[this.f]:null};_.u.Nl=function(){var a=this.f+1;return 0<this.a.length&&DB(this,a)?this.a[a]:null};_.u.bm=function(){return this.h};_.u.start=function(){this.h||(this.h=!0,this.m.on(_.pe,this.j),this.Oe(this.f,!0))};_.u.stop=function(){this.h=!1;this.m.off(_.pe,this.j)};_.u.ub=function(){this.next()};
4
+ _.u.next=function(){var a=this,b;return _.I(function(c){b=Math.min(a.a.length-1,a.f+1);return _.y(c,a.Oe(b),0)})};_.u.Bn=function(){var a=this,b;return _.I(function(c){b=Math.max(0,a.f-1);return _.y(c,a.Oe(b),0)})};_.u.Oe=function(a,b){b=void 0===b?!1:b;var c=this,d;return _.I(function(e){if(1==e.a){if(!(0<c.a.length&&DB(c,a))||!b&&c.f===a)return e["return"]();c.f=a;return(d=c.Vd())?_.y(e,c.l(d),3):e.F(0)}if(4!=e.a)return _.y(e,c.m.load(d.configuration),4);c.trigger(new _.L(_.yf,{item:d}));_.B(e)})};
5
+ _.u.append=function(a){this.a.push(a);CB(this)};_.u.Yl=function(a,b){if(0<=b&&b<=this.a.length){var c=this.Vd();this.a.splice(b,0,a);c&&(this.f=this.a.indexOf(c));CB(this)}};_.u.remove=function(a){if(0<this.a.length&&DB(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);CB(this)}};_.u.clear=function(){this.stop();this.f=0;this.a=[];this.h=!1;CB(this)};_.J("clpp.Playlist",BB);BB.prototype.clear=BB.prototype.clear;BB.prototype.remove=BB.prototype.remove;
6
+ BB.prototype.insert=BB.prototype.Yl;BB.prototype.append=BB.prototype.append;BB.prototype.goTo=BB.prototype.Oe;BB.prototype.previous=BB.prototype.Bn;BB.prototype.next=BB.prototype.next;BB.prototype.onEnded=BB.prototype.ub;BB.prototype.stop=BB.prototype.stop;BB.prototype.start=BB.prototype.start;BB.prototype.isStarted=BB.prototype.bm;BB.prototype.getUpcoming=BB.prototype.Nl;BB.prototype.getCurrent=BB.prototype.Vd;BB.prototype.getQueue=BB.prototype.Ll;BB.prototype.getPosition=BB.prototype.getPosition;
7
+ BB.prototype.off=BB.prototype.off;BB.prototype.one=BB.prototype.one;BB.prototype.on=BB.prototype.on;};
8
8
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
9
9
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
10
10
  else{_=this.clpp._;(f.call(g,this));}
@@ -1,20 +1,20 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var mA="apiUrl config is missing",nA="prestoplay-web",oA=function(a,b){a.j=a.j.filter(function(c){return c!==b})},pA=function(a){var b=0>a;a=Math.abs(a);var c=a>>>0;a=Math.floor((a-c)/4294967296);a>>>=0;b&&(a=~a>>>0,c=(~c>>>0)+1,4294967295<c&&(c=0,a++,4294967295<a&&(a=0)));return[c,a]},qA=function(){this.a=[]},tA=function(a,b,c){rA(a,b,c,function(d,e){sA(d,e)})},sA=function(a,b){if(0<=b)uA(a,b);else{for(var c=b,d=0;9>d;d++)a.a.push(c&127|128),c>>=7;a.a.push(1)}},wA=function(a,b,c){rA(a,b,c,function(d,
3
- e){if(0<=e){var f=_.w(pA(e)),g=f.next().value;f=f.next().value;vA(d,g,f)}else f=_.w(pA(e)),g=f.next().value,f=f.next().value,vA(d,g,f)})},yA=function(a,b,c){xA(a,b,c,function(d,e){for(var f=0;f<e.length;f++){var g=e.charCodeAt(f);if(128>g)d.a.push(g);else if(2048>g)d.a.push(g>>6|192),d.a.push(g&63|128);else if(65536>g)if(55296<=g&&56319>=g&&f+1<e.length){var h=e.charCodeAt(f+1);56320<=h&&57343>=h&&(g=1024*(g-55296)+h-56320+65536,d.a.push(g>>18|240),d.a.push(g>>12&63|128),d.a.push(g>>6&63|128),d.a.push(g&
4
- 63|128),f++)}else d.a.push(g>>12|224),d.a.push(g>>6&63|128),d.a.push(g&63|128)}})},AA=function(a,b,c){xA(a,b,c,function(d,e){zA(d,e.a())})},BA=function(a,b,c){xA(a,b,c,function(d,e){zA(d,e)})},zA=function(a,b){a.a.push.apply(a.a,b)},rA=function(a,b,c,d){if(!(null===c||void 0===c||typeof c===_.k&&0===c||typeof c===_.hg&&0===c.length||Array.isArray(c)&&0===c.length))if(Array.isArray(c)){uA(a,b<<3|2);b=new qA;for(var e=0;e<c.length;e++)d(b,c[e]);sA(a,b.length());zA(a,b.end())}else uA(a,b<<3|0),d(a,c)},
5
- xA=function(a,b,c,d){if(!(null===c||void 0===c||typeof c===_.k&&0===c||typeof c===_.hg&&0===c.length||Array.isArray(c)&&0===c.length))if(Array.isArray(c))for(var e=0;e<c.length;e++){uA(a,b<<3|2);var f=new qA;d(f,c[e]);sA(a,f.length());zA(a,f.end())}else uA(a,b<<3|2),b=new qA,d(b,c),sA(a,b.length()),zA(a,b.end())},uA=function(a,b){for(;127<b;)a.a.push(b&127|128),b>>>=7;a.a.push(b)},vA=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)},CA=function(a,b,c,d){this.downloadId=
6
- a;this.h=b;this.duration=c;this.j=d;this.f=[]},DA=function(a,b){this.f=a;this.url=b;this.downloadId=null;this.headers=[];this.size=this.duration=null},EA=function(a,b){this.h=a;this.f=b},FA=function(a){this.cause=a;this.f=this.message=this.severity=this.errorCode=null},GA=function(a,b){this.key=a;this.value=b},HA=function(){this.cause=this.severity=this.code=null},IA=function(){this.data=null},JA=function(){this.data=null;var a=new Uint8Array(16);crypto.getRandomValues(a);a[6]=a[6]&15|64;a[8]=a[8]&
7
- 63|128;this.data=a},KA=function(){this.headers=[]},LA=function(){},MA=function(a){this.j=a;this.f=this.h=this.time=this.sessionId=null},NA=function(){this.f=null;this.events=[]},OA=function(){this.f=this.h=null},PA=function(){this.f=this.h=null},QA=function(a){var b=new PA;b.h=Math.floor(a/1E3);b.f=a%1E3*1E6;return b},TA=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 JA;this.A=new JA;this.a=[];this.h=setInterval(function(){return RA(g)},h);
8
- this.f=null;this.j=!1;SA(this,a,b,c,d)},UA=function(a){return _.I(function(b){switch(b.a){case 1:a.h&&(clearInterval(a.h),a.h=null);if(!a.f){b.F(2);break}return _.y(b,a.f,2);case 2:if(!(0<a.a.length)){b.F(4);break}return _.y(b,RA(a),5);case 5:a.a=[];case 4:a.j=!0,_.C(b)}})},SA=function(a,b,c,d,e){var f=new KA;f.headers=[new GA("CL-BROWSER-NAME",b),new GA("CL-BROWSER-VERSION",c),new GA("CL-OS-FAMILY",d),new GA("CL-OS-VERSION",e),new GA("CL-SDK-NAME",nA),new GA("CL-SDK-NAME",nA),new GA("CL-SDK-VERSION",
9
- _.ha)];VA(a,f)},RA=function(a){var b,c,d,e;return _.I(function(f){if(1==f.a){if(a.j||a.f)return f["return"]();0===a.a.length&&VA(a,new LA);b=function(){};a.f=new Promise(function(g){b=g});_.ph(f);c=new NA;c.f=a.o;c.events.push.apply(c.events,_.ch(a.a));d=_.ch(a.a).concat();return _.y(f,fetch(a.l,{method:_.Gb,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+"'"));_.rh(f);b();a.f=null;return _.sh(f)})},VA=function(a,b){if(!a.j){var c=new MA(a.w);c.sessionId=a.A;var d=Date.now(),e=new OA;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)}},WA=function(){this.reason=this.currentState=this.previousState=null},XA=function(){this.m=null;this.a=this.l=!1;this.f=new _.Uh;this.h=null;this.g=new _.K("clpp.sessions.SessionsPlugin");this.o=this.Cm.bind(this);this.j=this.Bm.bind(this)},
11
- eB=function(a){switch(a){case _.Mp:return YA;case _.Yp:return ZA;case _.Rp:return $A;case _.$p:return aB;case _.Zp:return bB;case _.Tp:return cB;case _.Xp:return dB;default:return null}},mB=function(a,b){switch(a){case 1:return fB;case 2:return b===_.r?gB:b===_.$c?hB:b===_.Q?iB:b===_.xe?jB:kB;case 3:return lB;default:return kB}},nB=function(a){var b;_.I(function(c){if(1==c.a)return a.g.info("Destroy the session and stop sending events."),_.Xh(a.f),a.a=!1,b=a.m.getNetworkEngine(),b.vg(a.o),b.me(a.j),
12
- oA(b,a.j),a.h?_.y(c,UA(a.h),3):c.F(0);a.h=null;_.C(c)})},oB=function(a,b){a.g.debug("Sending event",b);VA(a.h,b)},pB=function(){};qA.prototype.length=function(){return this.a.length};qA.prototype.end=function(){var a=this.a;this.a=[];return a};CA.prototype.a=function(){var a=new qA;AA(a,1,this.downloadId);tA(a,2,this.h);AA(a,3,this.duration);tA(a,4,this.j);AA(a,5,this.f);return a.end()};CA.prototype.getId=function(){return 4};DA.prototype.a=function(){var a=new qA;tA(a,1,this.f);AA(a,2,this.downloadId);yA(a,3,this.url);AA(a,4,this.headers);yA(a,5,null);AA(a,6,null);AA(a,7,this.duration);wA(a,8,this.size);return a.end()};DA.prototype.getId=function(){return 2};EA.prototype.a=function(){var a=new qA;tA(a,1,this.h);BA(a,2,this.f);return a.end()};FA.prototype.a=function(){var a=new qA;tA(a,1,this.errorCode);tA(a,2,this.severity);yA(a,3,this.message);yA(a,4,this.f);AA(a,5,this.cause);return a.end()};FA.prototype.getId=function(){return 7};GA.prototype.a=function(){var a=new qA;yA(a,1,this.key);yA(a,2,this.value);return a.end()};HA.prototype.a=function(){var a=new qA;tA(a,1,this.code);tA(a,2,this.severity);AA(a,3,this.cause);return a.end()};HA.prototype.getId=function(){return 12};IA.prototype.a=function(){var a=new qA;BA(a,1,this.data);return a.end()};_.x(JA,IA);JA.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]]};KA.prototype.a=function(){var a=new qA;AA(a,1,this.headers);return a.end()};KA.prototype.getId=function(){return 1};LA.prototype.a=function(){return(new qA).end()};LA.prototype.getId=function(){return 6};MA.prototype.a=function(){var a=new qA;AA(a,1,this.j);AA(a,2,this.sessionId);AA(a,3,this.time);wA(a,4,null);yA(a,5,null);tA(a,6,this.h);BA(a,7,this.f);return a.end()};NA.prototype.a=function(){var a=new qA;BA(a,1,this.f);AA(a,2,this.events);return a.end()};OA.prototype.a=function(){var a=new qA;wA(a,1,this.h);tA(a,2,this.f);return a.end()};PA.prototype.a=function(){var a=new qA;wA(a,1,this.h);tA(a,2,this.f);return a.end()};WA.prototype.a=function(){var a=new qA;tA(a,1,this.previousState);tA(a,2,this.currentState);tA(a,3,this.reason);AA(a,4,null);AA(a,5,null);AA(a,6,null);return a.end()};WA.prototype.getId=function(){return 5};_.x(XA,_.yv);_.u=XA.prototype;_.u.onPlayerCreated=function(a){this.m=a};
13
- _.u.onContentWillLoad=function(a){var b=a.getConfiguration().sessions;(b=!(!b||typeof b!==_.We))||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(_.va),this.g.info("Create a session and start sending events."),a=_.uk(),this.h=new TA(a.browser,a.browserVersion.name,a.os,a.osVersion.name,b.apiUrl),this.f.on(this.m,_.eg,this.Ck.bind(this)),this.f.on(this.m,_.Xf,this.Bk.bind(this)),this.f.on(this.m,_.Wf,
14
- this.Ak.bind(this)),this.f.on(this.m,_.pe,this.S.bind(this)),a=this.m.getNetworkEngine(),a.zf(this.o),a.Sc(this.j),a.j.push(this.j)):(this.g.warn(mA),a.onError(new _.N(1,9,15E3,mA)))};_.u.onPlayerWillRelease=function(){nB(this)};_.u.id=function(){return"sessions"};_.u.Ck=function(a){if(!this.a){a=a.detail;var b=a.currentState,c=new WA;c.previousState=eB(a.previousState);c.currentState=eB(b);oB(this,c)}};
15
- _.u.Bk=function(){if(!this.a){var a=new WA;a.previousState=eB(this.m.getState());a.currentState=qB;oB(this,a);this.a=!0}};_.u.Ak=function(){if(this.a){var a=new WA;a.previousState=qB;a.currentState=eB(this.m.getState());oB(this,a);this.a=!1}};_.u.S=function(a){a=a.detail;var b=new HA;b=new FA(new EA(b.getId(),new Uint8Array(b.a())));b.errorCode=a.code;b.message=a.message;b.f=a.stack;b.severity=a.severity===_.P?rB:sB;oB(this,b)};
16
- _.u.Cm=function(a){var b=new JA;a.downloadId=b;var c=new DA(mB(a.type,a.contentType),a.uris[0]);c.downloadId=b;c.headers=Object.keys(a.headers).map(function(d){return new GA(d,a.headers[d])});oB(this,c)};_.u.Bm=function(a){var b=a.request.downloadId;b?(b=new CA(b,a.data.byteLength,QA(a.timeMs||0),a.status||-1),b.f=Object.keys(a.headers).map(function(c){return new GA(c,a.headers[c])}),oB(this,b)):this.g.warn("Download ID is missing on download completed event.")};pB.prototype.create=function(){return new XA};
17
- _.Ys(new pB);var sB=1,rB=2;var YA=0,ZA=2,dB=3,qB=5,$A=6,aB=8,bB=10,cB=11;var fB=0,gB=1,hB=2,iB=3,jB=4,lB=5,kB=9;};
2
+ var f=function(window){var uA="apiUrl config is missing",vA="prestoplay-web",wA=function(a,b){a.j=a.j.filter(function(c){return c!==b})},xA=function(a){var b=0>a;a=Math.abs(a);var c=a>>>0;a=Math.floor((a-c)/4294967296);a>>>=0;b&&(a=~a>>>0,c=(~c>>>0)+1,4294967295<c&&(c=0,a++,4294967295<a&&(a=0)));return[c,a]},yA=function(){this.a=[]},BA=function(a,b,c){zA(a,b,c,function(d,e){AA(d,e)})},AA=function(a,b){if(0<=b)CA(a,b);else{for(var c=b,d=0;9>d;d++)a.a.push(c&127|128),c>>=7;a.a.push(1)}},EA=function(a,b,c){zA(a,b,c,function(d,
3
+ e){if(0<=e){var f=_.w(xA(e)),g=f.next().value;f=f.next().value;DA(d,g,f)}else f=_.w(xA(e)),g=f.next().value,f=f.next().value,DA(d,g,f)})},GA=function(a,b,c){FA(a,b,c,function(d,e){for(var f=0;f<e.length;f++){var g=e.charCodeAt(f);if(128>g)d.a.push(g);else if(2048>g)d.a.push(g>>6|192),d.a.push(g&63|128);else if(65536>g)if(55296<=g&&56319>=g&&f+1<e.length){var h=e.charCodeAt(f+1);56320<=h&&57343>=h&&(g=1024*(g-55296)+h-56320+65536,d.a.push(g>>18|240),d.a.push(g>>12&63|128),d.a.push(g>>6&63|128),d.a.push(g&
4
+ 63|128),f++)}else d.a.push(g>>12|224),d.a.push(g>>6&63|128),d.a.push(g&63|128)}})},IA=function(a,b,c){FA(a,b,c,function(d,e){HA(d,e.a())})},JA=function(a,b,c){FA(a,b,c,function(d,e){HA(d,e)})},HA=function(a,b){a.a.push.apply(a.a,b)},zA=function(a,b,c,d){if(!(null===c||void 0===c||typeof c===_.k&&0===c||typeof c===_.ig&&0===c.length||Array.isArray(c)&&0===c.length))if(Array.isArray(c)){CA(a,b<<3|2);b=new yA;for(var e=0;e<c.length;e++)d(b,c[e]);AA(a,b.length());HA(a,b.end())}else CA(a,b<<3|0),d(a,c)},
5
+ FA=function(a,b,c,d){if(!(null===c||void 0===c||typeof c===_.k&&0===c||typeof c===_.ig&&0===c.length||Array.isArray(c)&&0===c.length))if(Array.isArray(c))for(var e=0;e<c.length;e++){CA(a,b<<3|2);var f=new yA;d(f,c[e]);AA(a,f.length());HA(a,f.end())}else CA(a,b<<3|2),b=new yA,d(b,c),AA(a,b.length()),HA(a,b.end())},CA=function(a,b){for(;127<b;)a.a.push(b&127|128),b>>>=7;a.a.push(b)},DA=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)},KA=function(a,b,c,d){this.downloadId=
6
+ a;this.h=b;this.duration=c;this.j=d;this.f=[]},LA=function(a,b){this.f=a;this.url=b;this.downloadId=null;this.headers=[];this.size=this.duration=null},MA=function(a,b){this.h=a;this.f=b},NA=function(a){this.cause=a;this.f=this.message=this.severity=this.errorCode=null},OA=function(a,b){this.key=a;this.value=b},PA=function(){this.cause=this.severity=this.code=null},QA=function(){this.data=null},RA=function(){this.data=null;var a=new Uint8Array(16);crypto.getRandomValues(a);a[6]=a[6]&15|64;a[8]=a[8]&
7
+ 63|128;this.data=a},SA=function(){this.headers=[]},TA=function(){},UA=function(a){this.j=a;this.f=this.h=this.time=this.sessionId=null},VA=function(){this.f=null;this.events=[]},WA=function(){this.f=this.h=null},XA=function(){this.f=this.h=null},YA=function(a){var b=new XA;b.h=Math.floor(a/1E3);b.f=a%1E3*1E6;return b},aB=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 RA;this.A=new RA;this.a=[];this.h=setInterval(function(){return ZA(g)},h);
8
+ this.f=null;this.j=!1;$A(this,a,b,c,d)},bB=function(a){return _.I(function(b){switch(b.a){case 1:a.h&&(clearInterval(a.h),a.h=null);if(!a.f){b.F(2);break}return _.y(b,a.f,2);case 2:if(!(0<a.a.length)){b.F(4);break}return _.y(b,ZA(a),5);case 5:a.a=[];case 4:a.j=!0,_.B(b)}})},$A=function(a,b,c,d,e){var f=new SA;f.headers=[new OA("CL-BROWSER-NAME",b),new OA("CL-BROWSER-VERSION",c),new OA("CL-OS-FAMILY",d),new OA("CL-OS-VERSION",e),new OA("CL-SDK-NAME",vA),new OA("CL-SDK-NAME",vA),new OA("CL-SDK-VERSION",
9
+ _.ha)];cB(a,f)},ZA=function(a){var b,c,d,e;return _.I(function(f){if(1==f.a){if(a.j||a.f)return f["return"]();0===a.a.length&&cB(a,new TA);b=function(){};a.f=new Promise(function(g){b=g});_.rh(f);c=new VA;c.f=a.o;c.events.push.apply(c.events,_.eh(a.a));d=_.eh(a.a).concat();return _.y(f,fetch(a.l,{method:_.Fb,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+"'"));_.th(f);b();a.f=null;return _.uh(f)})},cB=function(a,b){if(!a.j){var c=new UA(a.w);c.sessionId=a.A;var d=Date.now(),e=new WA;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)}},dB=function(){this.reason=this.currentState=this.previousState=null},eB=function(){this.m=null;this.a=this.l=!1;this.f=new _.Wh;this.h=null;this.g=new _.K("clpp.sessions.SessionsPlugin");this.o=this.Km.bind(this);this.j=this.Jm.bind(this)},
11
+ mB=function(a){switch(a){case _.Vp:return fB;case _.gq:return gB;case _.$p:return hB;case _.iq:return iB;case _.hq:return jB;case _.bq:return kB;case _.fq:return lB;default:return null}},uB=function(a,b){switch(a){case 1:return nB;case 2:return b===_.r?oB:b===_.Zc?pB:b===_.Q?qB:b===_.ye?rB:sB;case 3:return tB;default:return sB}},vB=function(a){var b;_.I(function(c){if(1==c.a)return a.g.info("Destroy the session and stop sending events."),_.Zh(a.f),a.a=!1,b=a.m.getNetworkEngine(),b.vg(a.o),b.me(a.j),
12
+ wA(b,a.j),a.h?_.y(c,bB(a.h),3):c.F(0);a.h=null;_.B(c)})},wB=function(a,b){a.g.debug("Sending event",b);cB(a.h,b)},xB=function(){};yA.prototype.length=function(){return this.a.length};yA.prototype.end=function(){var a=this.a;this.a=[];return a};KA.prototype.a=function(){var a=new yA;IA(a,1,this.downloadId);BA(a,2,this.h);IA(a,3,this.duration);BA(a,4,this.j);IA(a,5,this.f);return a.end()};KA.prototype.getId=function(){return 4};LA.prototype.a=function(){var a=new yA;BA(a,1,this.f);IA(a,2,this.downloadId);GA(a,3,this.url);IA(a,4,this.headers);GA(a,5,null);IA(a,6,null);IA(a,7,this.duration);EA(a,8,this.size);return a.end()};LA.prototype.getId=function(){return 2};MA.prototype.a=function(){var a=new yA;BA(a,1,this.h);JA(a,2,this.f);return a.end()};NA.prototype.a=function(){var a=new yA;BA(a,1,this.errorCode);BA(a,2,this.severity);GA(a,3,this.message);GA(a,4,this.f);IA(a,5,this.cause);return a.end()};NA.prototype.getId=function(){return 7};OA.prototype.a=function(){var a=new yA;GA(a,1,this.key);GA(a,2,this.value);return a.end()};PA.prototype.a=function(){var a=new yA;BA(a,1,this.code);BA(a,2,this.severity);IA(a,3,this.cause);return a.end()};PA.prototype.getId=function(){return 12};QA.prototype.a=function(){var a=new yA;JA(a,1,this.data);return a.end()};_.x(RA,QA);RA.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]]};SA.prototype.a=function(){var a=new yA;IA(a,1,this.headers);return a.end()};SA.prototype.getId=function(){return 1};TA.prototype.a=function(){return(new yA).end()};TA.prototype.getId=function(){return 6};UA.prototype.a=function(){var a=new yA;IA(a,1,this.j);IA(a,2,this.sessionId);IA(a,3,this.time);EA(a,4,null);GA(a,5,null);BA(a,6,this.h);JA(a,7,this.f);return a.end()};VA.prototype.a=function(){var a=new yA;JA(a,1,this.f);IA(a,2,this.events);return a.end()};WA.prototype.a=function(){var a=new yA;EA(a,1,this.h);BA(a,2,this.f);return a.end()};XA.prototype.a=function(){var a=new yA;EA(a,1,this.h);BA(a,2,this.f);return a.end()};dB.prototype.a=function(){var a=new yA;BA(a,1,this.previousState);BA(a,2,this.currentState);BA(a,3,this.reason);IA(a,4,null);IA(a,5,null);IA(a,6,null);return a.end()};dB.prototype.getId=function(){return 5};_.x(eB,_.Gv);_.u=eB.prototype;_.u.onPlayerCreated=function(a){this.m=a};
13
+ _.u.onContentWillLoad=function(a){var b=a.getConfiguration().sessions;(b=!(!b||typeof b!==_.Xe))||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(_.ua),this.g.info("Create a session and start sending events."),a=_.xk(),this.h=new aB(a.browser,a.browserVersion.name,a.os,a.osVersion.name,b.apiUrl),this.f.on(this.m,_.fg,this.Jk.bind(this)),this.f.on(this.m,_.Yf,this.Ik.bind(this)),this.f.on(this.m,_.Xf,
14
+ this.Hk.bind(this)),this.f.on(this.m,_.qe,this.Gk.bind(this)),a=this.m.getNetworkEngine(),a.zf(this.o),a.Rc(this.j),a.j.push(this.j)):(this.g.warn(uA),a.onError(new _.O(1,9,15E3,uA)))};_.u.onPlayerWillRelease=function(){vB(this)};_.u.id=function(){return"sessions"};_.u.Jk=function(a){if(!this.a){a=a.detail;var b=a.currentState,c=new dB;c.previousState=mB(a.previousState);c.currentState=mB(b);wB(this,c)}};
15
+ _.u.Ik=function(){if(!this.a){var a=new dB;a.previousState=mB(this.m.getState());a.currentState=yB;wB(this,a);this.a=!0}};_.u.Hk=function(){if(this.a){var a=new dB;a.previousState=yB;a.currentState=mB(this.m.getState());wB(this,a);this.a=!1}};_.u.Gk=function(a){a=a.detail;var b=new PA;b=new NA(new MA(b.getId(),new Uint8Array(b.a())));b.errorCode=a.code;b.message=a.message;b.f=a.stack;b.severity=a.severity===_.P?zB:AB;wB(this,b)};
16
+ _.u.Km=function(a){var b=new RA;a.downloadId=b;var c=new LA(uB(a.type,a.contentType),a.uris[0]);c.downloadId=b;c.headers=Object.keys(a.headers).map(function(d){return new OA(d,a.headers[d])});wB(this,c)};_.u.Jm=function(a){var b=a.request.downloadId;b?(b=new KA(b,a.data.byteLength,YA(a.timeMs||0),a.status||-1),b.f=Object.keys(a.headers).map(function(c){return new OA(c,a.headers[c])}),wB(this,b)):this.g.warn("Download ID is missing on download completed event.")};xB.prototype.create=function(){return new eB};
17
+ _.gt(new xB);var AB=1,zB=2;var fB=0,gB=2,lB=3,yB=5,hB=6,iB=8,jB=10,kB=11;var nB=0,oB=1,pB=2,qB=3,rB=4,tB=5,sB=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;});}
20
20
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.simid.js CHANGED
@@ -1,20 +1,20 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var Vz="No surface found. Can not attach frame!",Wz="SIMID:Media:timeupdate",Xz="Starting creative",bA=function(a){var b=this;this.f=a;this.h="";this.l=0;this.j=new Map;this.a=document.createElement("iframe");this.a.style.opacity="0";this.a.style.border=_.Ve;this.a.style.backgroundColor="transparent";this.a.style.transition="opacity .5s";this.a.style.transitionDelay=".5s";this.a.style.pointerEvents=_.Ve;this.a.style.overflow=_.ve;this.a.classList.add(_.wd);this.o=function(c){if(c.source===b.a.contentWindow&&
3
- (c=(c=c.data)?typeof c===_.hg?JSON.parse(c):c:null))if(c.type)switch(b.g.info("Received message ["+c.messageId+"] '"+c.type+"':",c.args),c.type){case "createSession":Yz(b,c);break;case "resolve":c=c.args;var d=b.j.get(c.messageId);d&&d.resolve(c);break;case "reject":c=c.args;(d=b.j.get(c.messageId))&&d.reject(c);break;case "SIMID:Creative:requestResize":d=b.f;var e=c.args;d.g.info("Creative requested resize",e);if(d.m&&d.m.getSurface()&&d.m.getSurface().getMedia()&&e.mediaDimensions){d.h?d.m.getSurface().getMedia().style.transition=
4
- "":(d.m.getSurface().getMedia().style.transition="left .5s, top .5s,width .5s, height .5s",d.h=!0);var f=Zz(d,e.mediaDimensions);d.m.getSurface().getMedia().style.left=f.left;d.m.getSurface().getMedia().style.top=f.top;d.m.getSurface().getMedia().style.width=f.width;d.m.getSurface().getMedia().style.height=f.height}e.creativeDimensions&&(e=Zz(d,e.creativeDimensions),d.a.a.style.left=e.left,d.a.a.style.top=e.top,d.a.a.style.width=e.width,d.a.a.style.height=e.height);$z(b,c)}else b.g.warn("WARNING: received message without 'type' property")};
5
- this.g=new _.K("clpp.simid.SimidPlayer");aA(this.f,this)},eA=function(a){var b=cA(a,"SIMID:Player:startCreative",void 0);dA(a,b).then(function(){var c=a.f;c.g.info(Xz);c.m.trigger(new _.L(_.Zf));a.a.style.opacity="1"})["catch"](function(c){a.unload();a.f.g.error("Error while starting creative",c)})},Yz=function(a,b){var c;_.I(function(d){if(1==d.a){a.h=b.sessionId;$z(a,b);_.D(d,2);var e=a.f;var f=e.getSurface(),g=e.getContainer();e={environmentData:{videoDimensions:{x:0,y:0,height:g.clientHeight,
2
+ var f=function(window){var cA="No surface found. Can not attach frame!",dA="SIMID:Media:timeupdate",eA="Starting creative",jA=function(a){var b=this;this.f=a;this.h="";this.l=0;this.j=new Map;this.a=document.createElement("iframe");this.a.style.opacity="0";this.a.style.border=_.We;this.a.style.backgroundColor="transparent";this.a.style.transition="opacity .5s";this.a.style.transitionDelay=".5s";this.a.style.pointerEvents=_.We;this.a.style.overflow=_.we;this.a.classList.add(_.vd);this.o=function(c){if(c.source===b.a.contentWindow&&
3
+ (c=(c=c.data)?typeof c===_.ig?JSON.parse(c):c:null))if(c.type)switch(b.g.info("Received message ["+c.messageId+"] '"+c.type+"':",c.args),c.type){case "createSession":fA(b,c);break;case "resolve":c=c.args;var d=b.j.get(c.messageId);d&&d.resolve(c);break;case "reject":c=c.args;(d=b.j.get(c.messageId))&&d.reject(c);break;case "SIMID:Creative:requestResize":d=b.f;var e=c.args;d.g.info("Creative requested resize",e);if(d.m&&d.m.getSurface()&&d.m.getSurface().getMedia()&&e.mediaDimensions){d.h?d.m.getSurface().getMedia().style.transition=
4
+ "":(d.m.getSurface().getMedia().style.transition="left .5s, top .5s,width .5s, height .5s",d.h=!0);var f=gA(d,e.mediaDimensions);d.m.getSurface().getMedia().style.left=f.left;d.m.getSurface().getMedia().style.top=f.top;d.m.getSurface().getMedia().style.width=f.width;d.m.getSurface().getMedia().style.height=f.height}e.creativeDimensions&&(e=gA(d,e.creativeDimensions),d.a.a.style.left=e.left,d.a.a.style.top=e.top,d.a.a.style.width=e.width,d.a.a.style.height=e.height);hA(b,c)}else b.g.warn("WARNING: received message without 'type' property")};
5
+ this.g=new _.K("clpp.simid.SimidPlayer");iA(this.f,this)},mA=function(a){var b=kA(a,"SIMID:Player:startCreative",void 0);lA(a,b).then(function(){var c=a.f;c.g.info(eA);c.m.trigger(new _.L(_.$f));a.a.style.opacity="1"})["catch"](function(c){a.unload();a.f.g.error("Error while starting creative",c)})},fA=function(a,b){var c;_.I(function(d){if(1==d.a){a.h=b.sessionId;hA(a,b);_.D(d,2);var e=a.f;var f=e.getSurface(),g=e.getContainer();e={environmentData:{videoDimensions:{x:0,y:0,height:g.clientHeight,
6
6
  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",closeButtonSupport:"adHandles",nonlinearDuration:e.f.duration},creativeData:{adParameters:e.f.adParameters||"",clickThruUri:"",
7
- clickThruUrl:""}};e=cA(a,"SIMID:Player:init",e);e=dA(a,e);return _.y(d,e,4)}if(2!=d.a)return a.g.info("Player Init acknowledged"),a.f.g.info("SIMID Player initialized"),_.qh(d,0);c=_.E(d);a.g.error("Error while initializing",c);a.f.g.error("Error while initializing SIMID player: ",c);a.unload();_.C(d)})},cA=function(a,b,c){return{type:b,sessionId:a.h,messageId:a.l++,timestamp:Date.now(),args:c}},fA=function(a,b){a.h?(b.type!==Wz&&a.g.info("Posting message ["+b.messageId+"] '"+b.type+"':",b.args),
8
- a.a.contentWindow&&a.a.contentWindow.postMessage(JSON.stringify(b),"*")):a.g.warn("WARNING: no session available to send message '"+b.type+"'")},$z=function(a,b){fA(a,cA(a,"resolve",{messageId:b.messageId,value:void 0}))},dA=function(a,b){return new Promise(function(c,d){new gA(a.j,c,d,b);fA(a,b)})},gA=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;this.a=null;this.f.set(d.messageId,this);0<=f&&(this.a=setTimeout(function(){e.resolve()},f))},hA=function(){this.g=
9
- new _.K("clpp.simid.Plugin");this.h=this.a=this.m=null;this.l=[];this.j=null;this.w=this.Dk.bind(this);this.f=null;this.o=!1},iA=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=cA(d,"SIMID:Player:resize",e);fA(d,e)}})},jA=function(a){this.m=a;this.a=null;this.g=new _.K("clpp.simid.Loader");this.h=!1;this.f=
10
- null},Zz=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+"%"}},aA=function(a,b){a.g.info("SIMID Session created");a.a=b},kA=function(a){a.g.info("Stopping creative");a.m.getSurface().getMedia().style.transition=".5s";setTimeout(function(){a.m.getSurface().getMedia().style.transition=""},500);a.m.getSurface().getMedia().style.left="";a.m.getSurface().getMedia().style.top="";a.m.getSurface().getMedia().style.width=
11
- "";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 _.L(_.$f))},lA=function(){};bA.prototype.load=function(a){window.addEventListener(_.Oe,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)};
12
- bA.prototype.unload=function(){kA(this.f);this.h=this.a.src="";this.l=0;this.a.style.opacity="0";window.removeEventListener(_.Oe,this.o);this.a.parentElement&&this.a.parentElement.removeChild(this.a)};gA.prototype.resolve=function(a){null!==this.a&&(clearTimeout(this.a),this.a=null);this.f["delete"](this.h.messageId);this.l(a)};gA.prototype.reject=function(a){null!==this.a&&(clearTimeout(this.a),this.a=null);this.f["delete"](this.h.messageId);this.j(a)};_.x(hA,_.yv);_.u=hA.prototype;_.u.id=function(){return"simid"};_.u.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 jA(a)};
13
- _.u.onContentWillLoad=function(a){var b=a.getConfiguration();if(b.simid&&b.simid.creatives&&0!==b.simid.creatives.length)if(this.l=b.simid.creatives,this.g.info("Setting up SIMID plugin for "+this.l.length+" creatives"),b=this.m.getSurface()){this.g.info("Creating new session");this.a=new bA(this.h);var c=b.getContainer();this.j=iA(this,c,b);this.j.observe(c);a.on(_.pg,this.w)}else this.g.warn(Vz)};
14
- _.u.Dk=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&&(eA(this.a),this.o=!0,this.g.info(Xz)),c&&(c=this.a,fA(c,cA(c,Wz,{currentTime:a-b}))))):((a=this.m.getSurface())||this.g.warn(Vz),a=a.getContainer(),this.f=b,this.o=!1,this.g.info("Loading session"),this.h.f=
15
- b,this.a.load(a)):this.f&&(this.a.unload(),this.f=null,this.o=!1)};_.u.onPlayerWillRelease=function(a){_.yv.prototype.onPlayerWillRelease.call(this,a);this.m.getSurface()&&(this.j&&(this.j.disconnect(),this.j=null),a.off(_.pg,this.w),this.f&&(this.a.unload(),this.f=this.h.f=null))};_.u=jA.prototype;_.u.release=function(){this.g.info("Releasing loader")};
16
- _.u.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};_.u.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};_.u.Yh=function(){return this.a};_.u.url=function(){return this.f?this.f.url:""};lA.prototype.create=function(){return new hA};
17
- _.Ys(new lA);};
7
+ clickThruUrl:""}};e=kA(a,"SIMID:Player:init",e);e=lA(a,e);return _.y(d,e,4)}if(2!=d.a)return a.g.info("Player Init acknowledged"),a.f.g.info("SIMID Player initialized"),_.sh(d,0);c=_.F(d);a.g.error("Error while initializing",c);a.f.g.error("Error while initializing SIMID player: ",c);a.unload();_.B(d)})},kA=function(a,b,c){return{type:b,sessionId:a.h,messageId:a.l++,timestamp:Date.now(),args:c}},nA=function(a,b){a.h?(b.type!==dA&&a.g.info("Posting message ["+b.messageId+"] '"+b.type+"':",b.args),
8
+ a.a.contentWindow&&a.a.contentWindow.postMessage(JSON.stringify(b),"*")):a.g.warn("WARNING: no session available to send message '"+b.type+"'")},hA=function(a,b){nA(a,kA(a,"resolve",{messageId:b.messageId,value:void 0}))},lA=function(a,b){return new Promise(function(c,d){new oA(a.j,c,d,b);nA(a,b)})},oA=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;this.a=null;this.f.set(d.messageId,this);0<=f&&(this.a=setTimeout(function(){e.resolve()},f))},pA=function(){this.g=
9
+ new _.K("clpp.simid.Plugin");this.h=this.a=this.m=null;this.l=[];this.j=null;this.w=this.Kk.bind(this);this.f=null;this.o=!1},qA=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=kA(d,"SIMID:Player:resize",e);nA(d,e)}})},rA=function(a){this.m=a;this.a=null;this.g=new _.K("clpp.simid.Loader");this.h=!1;this.f=
10
+ null},gA=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+"%"}},iA=function(a,b){a.g.info("SIMID Session created");a.a=b},sA=function(a){a.g.info("Stopping creative");a.m.getSurface().getMedia().style.transition=".5s";setTimeout(function(){a.m.getSurface().getMedia().style.transition=""},500);a.m.getSurface().getMedia().style.left="";a.m.getSurface().getMedia().style.top="";a.m.getSurface().getMedia().style.width=
11
+ "";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 _.L(_.ag))},tA=function(){};jA.prototype.load=function(a){window.addEventListener(_.Pe,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)};
12
+ jA.prototype.unload=function(){sA(this.f);this.h=this.a.src="";this.l=0;this.a.style.opacity="0";window.removeEventListener(_.Pe,this.o);this.a.parentElement&&this.a.parentElement.removeChild(this.a)};oA.prototype.resolve=function(a){null!==this.a&&(clearTimeout(this.a),this.a=null);this.f["delete"](this.h.messageId);this.l(a)};oA.prototype.reject=function(a){null!==this.a&&(clearTimeout(this.a),this.a=null);this.f["delete"](this.h.messageId);this.j(a)};_.x(pA,_.Gv);_.u=pA.prototype;_.u.id=function(){return"simid"};_.u.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 rA(a)};
13
+ _.u.onContentWillLoad=function(a){var b=a.getConfiguration();if(b.simid&&b.simid.creatives&&0!==b.simid.creatives.length)if(this.l=b.simid.creatives,this.g.info("Setting up SIMID plugin for "+this.l.length+" creatives"),b=this.m.getSurface()){this.g.info("Creating new session");this.a=new jA(this.h);var c=b.getContainer();this.j=qA(this,c,b);this.j.observe(c);a.on(_.qg,this.w)}else this.g.warn(cA)};
14
+ _.u.Kk=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&&(mA(this.a),this.o=!0,this.g.info(eA)),c&&(c=this.a,nA(c,kA(c,dA,{currentTime:a-b}))))):((a=this.m.getSurface())||this.g.warn(cA),a=a.getContainer(),this.f=b,this.o=!1,this.g.info("Loading session"),this.h.f=
15
+ b,this.a.load(a)):this.f&&(this.a.unload(),this.f=null,this.o=!1)};_.u.onPlayerWillRelease=function(a){_.Gv.prototype.onPlayerWillRelease.call(this,a);this.m.getSurface()&&(this.j&&(this.j.disconnect(),this.j=null),a.off(_.qg,this.w),this.f&&(this.a.unload(),this.f=this.h.f=null))};_.u=rA.prototype;_.u.release=function(){this.g.info("Releasing loader")};
16
+ _.u.getContainer=function(){var a=this.getSurface().getContainer();if(!a)throw this.g.error("No player container found. Can not create SIMID init data"),new _.O(1,10,10100,"No player container found");return a};_.u.getSurface=function(){var a=this.m.getSurface();if(!a)throw this.g.error("No player surface found. Can not create SIMID init data"),new _.O(1,10,10100,"No surface");return a};_.u.Zh=function(){return this.a};_.u.url=function(){return this.f?this.f.url:""};tA.prototype.create=function(){return new pA};
17
+ _.gt(new tA);};
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;});}
20
20
  else{_=this.clpp._;(f.call(g,this));}