@castlabs/prestoplay 6.20.0 → 6.21.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 +35 -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 +109 -110
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +553 -550
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +78 -77
  10. package/cjs/cl.externs.js +81 -97
  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 +29 -29
  15. package/cjs/cl.ima.js +22 -24
  16. package/cjs/cl.mse.js +305 -305
  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 +25 -25
  25. package/cjs/cl.tizen.js +70 -69
  26. package/cjs/cl.ttml.js +29 -29
  27. package/cjs/cl.verimatrix.js +5 -5
  28. package/cjs/cl.vimond.js +13 -13
  29. package/cjs/cl.vr.js +18 -18
  30. package/cjs/cl.vtt.js +14 -14
  31. package/cjs/cl.yospace.js +9 -0
  32. package/cjs/cl.youbora.js +38 -20
  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 -89
  37. package/cl.conviva.js +27 -27
  38. package/cl.core.js +471 -468
  39. package/cl.crypto.js +8 -8
  40. package/cl.dash.js +74 -72
  41. package/cl.externs.js +71 -99
  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 +16 -17
  47. package/cl.mse.js +276 -276
  48. package/cl.muxdata.js +13 -13
  49. package/cl.onboard.js +4 -4
  50. package/cl.persistent.js +11 -11
  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 +14 -14
  61. package/cl.vtt.js +12 -12
  62. package/cl.yospace.js +3 -0
  63. package/cl.youbora.js +27 -15
  64. package/package.json +3 -1
  65. package/typings.d.ts +123 -24
package/cjs/cl.muxdata.js CHANGED
@@ -1,19 +1,19 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var bB=function(a){switch(a.type){case 1:return ZA;case 2:return $A;case 3:return aB}},dB=function(a){var b=Object.keys(a).find(function(c){return cB.includes(c.toLowerCase())});return void 0!==b?a[b]:void 0},eB=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 _.Qh;this.g=b;this.A=this.l=this.h=!1;this.w=null;this.j=a.getNetworkEngine();this.G=this.gk.bind(this);this.C=this.kn.bind(this)},gB=function(a){var b={debug:!0,
3
- data:fB(a)};a.f&&a.f.muxOptionsOverride&&_.M.dd(a.f.muxOptionsOverride)&&(b=_.M.pa(b,a.f.muxOptionsOverride));b=_.M.pa(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 _.Fk(c.url);
4
- f.video_source_url=_.Gk(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().na(),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.ma())&&d.language&&(f.player_language_code=
5
- d.language);return f}});a.g.debug("Mux SDK options",b);return b},fB=function(a){var b={env_key:a.f.envKey,video_title:a.o&&a.o.name||"",player_name:_.va,player_software_name:_.va,player_software_version:_.ja,player_mux_plugin_name:"CastlabsPlayer built-in Mux Plugin",player_mux_plugin_version:_.ja};(a=a.m.getConfiguration().viewerId)&&(b.viewer_user_id=a);return b},hB=function(a){a.a.on(a.m,_.ng,function(){var b={player_playhead_time:1E3*a.m.getPosition()};a.emit(_.ng,b)});a.a.on(a.m,_.hf,function(){return a.emit(_.hf)});
6
- a.a.on(a.m,_.hd,a.dk.bind(a));a.a.on(a.m,_.cg,a.fk.bind(a));a.a.on(a.m,_.xg,function(){return a.emit(_.Vf)});a.a.on(a.m,_.wg,function(){return a.emit(_.Uf)});a.a.on(a.m,_.ne,a.ek.bind(a));a.a.on(a.m,_.uc,function(){return a.emit("adbreakstart")});a.a.on(a.m,_.vc,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,_.zc,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.Oc(a.G);a.j.nf(a.C);a.a.on(a.m,_.ne,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 _.Fk(b.uris[b.uriIndex]);b={request_start:c,request_type:bB(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 _.Fk(b.uris[b.uriIndex]),f=c.data;b={request_start:d,request_type:bB(b),request_hostname:e.a,request_error:""+bB(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)}})},iB=function(a){_.Th(a.a);a.j.ae(a.G);a.j.lg(a.C)},jB=function(){this.f=this.m=null;this.a=!1;this.g=new _.K("clpp.muxdata")},kB=function(a){return!_.M.R(a)&&typeof a.init===_.re&&typeof a.emit===_.re},lB=function(){},ZA="manifest",$A="media",aB="encryption",cB=["x-request-id","cf-ray","x-amz-cf-id","x-akamai-request-id"];_.u=eB.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,gB(this))}catch(d){throw this.h=!1,iB(this),new _.N(1,9,9302,null,d);}this.emit("playerready")}this.l&&!this.A&&(a=fB(this),this.emit("videochange",a),this.l=!1);hB(this)};_.u.release=function(){this.g.debug("release()");this.l?this.g.debug(_.ma):(iB(this),this.l=!0,this.o=this.f=null)};_.u.destroy=function(){this.g.debug(_.Ud);this.A?this.g.debug(_.la):(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.dk=function(a){this.g.debug(_.Ve);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}))};_.u.fk=function(a){this.g.debug(_.Ze);switch(a.detail.currentState){case _.Kp:this.m.getConfiguration().autoplay&&this.emit(_.hf);break;case _.Mp:this.emit(_.tf);break;case _.Lp:this.emit(_.df);break;case _.Fp:this.emit(_.me)}};
11
- _.u.ek=function(a){this.g.debug(_.We);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(_.ne,{player_error_code:a.code,player_error_message:b})}};
12
- _.u.gk=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 _.Fk(b.uris[b.uriIndex]);a={request_start:e,request_type:bB(b),request_hostname:g.a,request_id:dB(c),request_bytes_loaded:d,request_response_start:h,request_response_end:a,request_response_headers:c,request_media_duration:f,
13
- request_url:_.Gk(g)};this.g.debug("onRequestCompleted()","Track event: requestcompleted",a);this.emit("requestcompleted",a)}};_.u.kn=function(a){a.requestStartTimestamp=Date.now()};_.x(jB,_.ev);_.u=jB.prototype;_.u.onPlayerCreated=function(a){this.m=a;this.f=new eB(a,this.g)};
14
- _.u.onContentWillLoad=function(a,b){var c=a.getConfiguration();c=_.M.$a(c.muxdata);try{var d=[];typeof c===_.Ue&&(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===_.Ue){var f=e.muxdata;d=kB(f.muxLib)?f.muxLib:window.mux;if(!kB(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(_.ne,{detail:b}))};_.J("clpp.muxdata.MuxDataPlugin",jB);jB.prototype.emit=jB.prototype.emit;
16
- jB.Id="mux";lB.prototype.create=function(){return new jB};_.Fs(new lB);};
2
+ var f=function(window){var JB=function(a){switch(a.type){case 1:return GB;case 2:return HB;case 3:return IB}},LB=function(a){var b=Object.keys(a).find(function(c){return KB.includes(c.toLowerCase())});return void 0!==b?a[b]:void 0},MB=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 _.Sh;this.g=b;this.A=this.l=this.h=!1;this.w=null;this.j=a.getNetworkEngine();this.G=this.jk.bind(this);this.C=this.nn.bind(this)},OB=function(a){var b={debug:!0,
3
+ data:NB(a)};a.f&&a.f.muxOptionsOverride&&_.M.dd(a.f.muxOptionsOverride)&&(b=_.M.pa(b,a.f.muxOptionsOverride));b=_.M.pa(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 _.Jk(c.url);
4
+ f.video_source_url=_.Kk(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().ja(),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.na())&&d.language&&(f.player_language_code=
5
+ d.language);return f}});a.g.debug("Mux SDK options",b);return b},NB=function(a){var b={env_key:a.f.envKey,video_title:a.o&&a.o.name||"",player_name:_.va,player_software_name:_.va,player_software_version:_.ja,player_mux_plugin_name:"CastlabsPlayer built-in Mux Plugin",player_mux_plugin_version:_.ja};(a=a.m.getConfiguration().viewerId)&&(b.viewer_user_id=a);return b},PB=function(a){a.a.on(a.m,_.ng,function(){var b={player_playhead_time:1E3*a.m.getPosition()};a.emit(_.ng,b)});a.a.on(a.m,_.hf,function(){return a.emit(_.hf)});
6
+ a.a.on(a.m,_.hd,a.gk.bind(a));a.a.on(a.m,_.cg,a.ik.bind(a));a.a.on(a.m,_.xg,function(){return a.emit(_.Vf)});a.a.on(a.m,_.wg,function(){return a.emit(_.Uf)});a.a.on(a.m,_.ne,a.hk.bind(a));a.a.on(a.m,_.uc,function(){return a.emit("adbreakstart")});a.a.on(a.m,_.vc,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,_.zc,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.Oc(a.G);a.j.nf(a.C);a.a.on(a.m,_.ne,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 _.Jk(b.uris[b.uriIndex]);b={request_start:c,request_type:JB(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 _.Jk(b.uris[b.uriIndex]),f=c.data;b={request_start:d,request_type:JB(b),request_hostname:e.a,request_error:""+JB(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)}})},QB=function(a){_.Vh(a.a);a.j.ae(a.G);a.j.mg(a.C)},RB=function(){this.f=this.m=null;this.a=!1;this.g=new _.K("clpp.muxdata")},SB=function(a){return!_.M.R(a)&&typeof a.init===_.re&&typeof a.emit===_.re},TB=function(){},GB="manifest",HB="media",IB="encryption",KB=["x-request-id","cf-ray","x-amz-cf-id","x-akamai-request-id"];_.u=MB.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,OB(this))}catch(d){throw this.h=!1,QB(this),new _.N(1,9,9302,null,d);}this.emit("playerready")}this.l&&!this.A&&(a=NB(this),this.emit("videochange",a),this.l=!1);PB(this)};_.u.release=function(){this.g.debug("release()");this.l?this.g.debug(_.ma):(QB(this),this.l=!0,this.o=this.f=null)};_.u.destroy=function(){this.g.debug(_.Ud);this.A?this.g.debug(_.la):(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.gk=function(a){this.g.debug(_.Ve);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.ik=function(a){this.g.debug(_.Ze);switch(a.detail.currentState){case _.Sp:this.m.getConfiguration().autoplay&&this.emit(_.hf);break;case _.Up:this.emit(_.tf);break;case _.Tp:this.emit(_.df);break;case _.Np:this.emit(_.me)}};
11
+ _.u.hk=function(a){this.g.debug(_.We);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(_.ne,{player_error_code:a.code,player_error_message:b})}};
12
+ _.u.jk=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 _.Jk(b.uris[b.uriIndex]);a={request_start:e,request_type:JB(b),request_hostname:g.a,request_id:LB(c),request_bytes_loaded:d,request_response_start:h,request_response_end:a,request_response_headers:c,request_media_duration:f,
13
+ request_url:_.Kk(g)};this.g.debug("onRequestCompleted()","Track event: requestcompleted",a);this.emit("requestcompleted",a)}};_.u.nn=function(a){a.requestStartTimestamp=Date.now()};_.x(RB,_.pv);_.u=RB.prototype;_.u.onPlayerCreated=function(a){this.m=a;this.f=new MB(a,this.g)};
14
+ _.u.onContentWillLoad=function(a,b){var c=a.getConfiguration();c=_.M.bb(c.muxdata);try{var d=[];typeof c===_.Ue&&(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===_.Ue){var f=e.muxdata;d=SB(f.muxLib)?f.muxLib:window.mux;if(!SB(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(_.ne,{detail:b}))};_.J("clpp.muxdata.MuxDataPlugin",RB);RB.prototype.emit=RB.prototype.emit;
16
+ RB.Id="mux";TB.prototype.create=function(){return new RB};_.Qs(new TB);};
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 XA=function(){this.g=new _.K("clpp.onboard");this.j=new Set},YA=function(a,b){function c(l){return l&&(_.R.startsWith(l,"https://")||_.R.startsWith(l,"http://")||_.R.startsWith(l,"//"))?l:d+l}var d=b.baseUrl;_.R.endsWith(d,"/")||(d+="/");var e=c(b.widevineUrl||"widevine"),f=c(b.playreadyUrl||"playready"),g=c(b.fairplayUrl||"fairplay"),h=new _.Qm(a);h.Wa(_.Pd,{licenseUrl:e,videoRobustness:[_.Wb,void 0],audioRobustness:[_.Vb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,
3
- modifiers:{licenseRequest:_.En,licenseResponse:_.Jn}});h.Wa(_.Kd,{licenseUrl:g,certificateUrl:g,modifiers:{licenseRequest:_.Gn,licenseResponse:_.Hn,extractContentId:_.Cn,certificateRequest:_.In}});h.Wa(_.Nd,{licenseUrl:f,modifiers:{licenseRequest:_.En}});_.Lm(h)};_.x(XA,_.it);XA.prototype.a=function(){for(var a=_.w(this.j),b=a.next();!b.done;b=a.next())delete _.Km[b.value];this.j.clear()};
4
- XA.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+"'"),YA(b,a),this.j.add(b))};XA.prototype.id=function(){return"onboard"};_.J("clpp.onboard.OnboardComponent",XA);_.J("clpp.onboard.register",YA);};
2
+ var f=function(window){var EB=function(){this.g=new _.K("clpp.onboard");this.j=new Set},FB=function(a,b){function c(l){return l&&(_.R.startsWith(l,"https://")||_.R.startsWith(l,"http://")||_.R.startsWith(l,"//"))?l:d+l}var d=b.baseUrl;_.R.endsWith(d,"/")||(d+="/");var e=c(b.widevineUrl||"widevine"),f=c(b.playreadyUrl||"playready"),g=c(b.fairplayUrl||"fairplay"),h=new _.Um(a);h.Ya(_.Pd,{licenseUrl:e,videoRobustness:[_.Wb,void 0],audioRobustness:[_.Vb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,
3
+ modifiers:{licenseRequest:_.In,licenseResponse:_.Nn}});h.Ya(_.Kd,{licenseUrl:g,certificateUrl:g,modifiers:{licenseRequest:_.Kn,licenseResponse:_.Ln,extractContentId:_.Gn,certificateRequest:_.Mn}});h.Ya(_.Nd,{licenseUrl:f,modifiers:{licenseRequest:_.In}});_.Pm(h)};_.x(EB,_.tt);EB.prototype.a=function(){for(var a=_.w(this.j),b=a.next();!b.done;b=a.next())delete _.Om[b.value];this.j.clear()};
4
+ EB.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+"'"),FB(b,a),this.j.add(b))};EB.prototype.id=function(){return"onboard"};_.J("clpp.onboard.OnboardComponent",EB);_.J("clpp.onboard.register",FB);};
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 FA="A persistent DRM session already exists for: ",GA="No DRM configuration.",HA="clpp.persistent",IA="clpp.persistent.SimpleSessionStorage",JA=function(a,b){for(var c=[],d=_.w(a),e=d.next();!e.done;e=d.next())c.push(b(e.value));return c},KA=function(a){a=a.f.keys();a=JA(a,function(b){return b.sessionId});return Array.from(a)},LA=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a)return _.y(f,_.Qo(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.Lb=new _.ek,d.push(e.Lb));a.g.debug("Attempting to remove session",b);d.push(c.remove());return f["return"](Promise.all(d))})},NA=function(a,b){a.K=MA;a.L=[];a.G=!0;return _.xo(a,b)},PA=function(a,b,c,d,e,f){a.K=OA;var g=new Map,h=_.Vo(b);g.set(h,{audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:_.af,persistentState:_.Nf,sessionTypes:[_.ff],label:h,drmInfos:[{keySystem:b,licenseServerUri:c,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",
4
- videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}]});return _.Do(a,g)},QA=function(){this.g=new _.K(IA)},RA=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}},SA=function(a,b){var c=
5
- _.Nm(a),d=_.rm({drm:a});d.drm=a;var e=new _.to({Jb:b,onError:function(){},Xf:function(){},Wf:function(){},onEvent:function(){},getConfiguration:function(){return d},$c:function(){return null}});e.h=c;return e},VA=function(a,b,c){var d,e,f,g,h,l,m,n,p;return _.I(function(q){switch(q.a){case 1:d=TA;e=UA;if(!a)return e.debug(GA),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(FA,f),q["return"]();h=SA(a,c);_.D(q,3,4);return _.y(q,NA(h,b),
6
- 6);case 6:return _.y(q,_.Jo(h),7);case 7:return _.y(q,_.Ko(h),8);case 8:return l=h.getDrmInfo(),m=b.map(function(t){return{contentType:_.gl(t.video.mimeType,t.video.codecs),robustness:l.videoRobustness}}),n=KA(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 _.nh(q),_.y(q,h.destroy(),10);case 10:_.oh(q);break;case 3:throw p=_.E(q),e.error("Error while persisting DRM session "+
7
- f),new _.N(1,6,6200,null,p);}})},WA=function(){this.g=new _.K(HA)},MA=1,OA=2;_.u=QA.prototype;
2
+ var f=function(window){var mB="A persistent DRM session already exists for: ",nB="No DRM configuration.",oB="clpp.persistent",pB="clpp.persistent.SimpleSessionStorage",qB=function(a,b){for(var c=[],d=_.w(a),e=d.next();!e.done;e=d.next())c.push(b(e.value));return c},rB=function(a){a=a.f.keys();a=qB(a,function(b){return b.sessionId});return Array.from(a)},sB=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a)return _.y(f,_.Yo(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.Lb=new _.gk,d.push(e.Lb));a.g.debug("Attempting to remove session",b);d.push(c.remove());return f["return"](Promise.all(d))})},uB=function(a,b){a.K=tB;a.L=[];a.G=!0;return _.Bo(a,b)},wB=function(a,b,c,d,e,f){a.K=vB;var g=new Map,h=_.cp(b);g.set(h,{audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:_.af,persistentState:_.Nf,sessionTypes:[_.ff],label:h,drmInfos:[{keySystem:b,licenseServerUri:c,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",
4
+ videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}]});return _.Lo(a,g)},xB=function(){this.g=new _.K(pB)},yB=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}},zB=function(a,b){var c=
5
+ _.Rm(a),d=_.vm({drm:a});d.drm=a;var e=new _.xo({Jb:b,onError:function(){},Yf:function(){},Xf:function(){},onEvent:function(){},getConfiguration:function(){return d},$c:function(){return null}});e.h=c;return e},CB=function(a,b,c){var d,e,f,g,h,l,m,n,p;return _.I(function(q){switch(q.a){case 1:d=AB;e=BB;if(!a)return e.debug(nB),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(mB,f),q["return"]();h=zB(a,c);_.D(q,3,4);return _.y(q,uB(h,b),
6
+ 6);case 6:return _.y(q,_.Ro(h),7);case 7:return _.y(q,_.So(h),8);case 8:return l=h.getDrmInfo(),m=b.map(function(t){return{contentType:_.kl(t.video.mimeType,t.video.codecs),robustness:l.videoRobustness}}),n=rB(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 _.ph(q),_.y(q,h.destroy(),10);case 10:_.qh(q);break;case 3:throw p=_.E(q),e.error("Error while persisting DRM session "+
7
+ f),new _.N(1,6,6200,null,p);}})},DB=function(){this.g=new _.K(oB)},tB=1,vB=2;_.u=xB.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));_.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"](RA(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 IA};_.J("clpp.persistent.useStorage",function(a){var b=["store","get","delete","clear","getName"];var c=[];_.M.R(a)||(_.M.Ib(a.store)||c.push("store"),_.M.Ib(a.get)||c.push("get"),_.M.Ib(a["delete"])||c.push("delete"),_.M.Ib(a.clear)||c.push("clear"),_.M.Ib(a.getName)||c.push("getName"),b=c);if(0<b.length)throw UA.warn("Invalid session storage implementation"),new _.N(1,6,6202,{missingMethods:b});TA=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,C,F,G,A,H,O,T,da;return _.I(function(aa){switch(aa.a){case 1:f=TA;g=UA;h=function(wa,Va){return new _.N(1,6,6200,wa,Va)};l=_.Qp(a).shift();if(!l)throw h("No source specified.");if(!b)throw h(GA);m=b.offlineId;if(typeof m!==_.fg||!m.length)throw h("Missing offline id.");return _.y(aa,f.get(m),2);case 2:if(n=aa.f)return g.debug(FA,m),aa["return"]();p=_.rm();q=new _.rk;
11
- t=[];v=_.w(d);for(z=v.next();!z.done;z=v.next())C=z.value,F=new C,_.vm(F.id())||(F.f(),_.xm(F),t.push(F));G=null;_.D(aa,3,4);return _.y(aa,_.eu(l.url,q,p.manifest.attemptParameters,l.type||null),6);case 6:return G=aa.f,G.configure(p.manifest),_.y(aa,G.start(l.url,{configurationId:"",networkingEngine:q,filterAllPeriods:function(){},filterNewPeriod:function(){},onEvent:function(){},onError:function(){}}),7);case 7:A=aa.f;if(!A.periods.length)throw h(null,new _.N(_.P,4,4014));H=_.Wt(A.periods);return _.y(aa,
12
- VA(b,H,q),4);case 4:for(_.nh(aa);t.length;)O=t.shift(),O.a(),_.um["delete"](O.id());T=[];G&&T.push(G.stop());T.push(q.destroy());return _.y(aa,Promise.all(T),9);case 9:_.oh(aa);break;case 3:da=_.E(aa);if(da instanceof _.N&&6200===da.code)throw da;throw h(null,da);}})});
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=TA;c=UA;if(!_.M.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 _.rk;d=SA(f.drmConfig,e);return _.y(l,PA(d,f.keySystem,f.licenseServerUri,f.serverCertificate,f.audioCapabilities,f.videoCapabilities),
14
- 6);case 6:return _.y(l,_.Jo(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,LA(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 _.nh(l),g=[],d&&g.push(d.destroy()),e&&g.push(e.destroy()),_.y(l,Promise.all(g),10);case 10:_.oh(l);break;case 2:throw h=_.E(l),c.error("Failed to remove session"),new _.N(1,6,6201,null,h);}})});var TA=new QA,UA=new _.K(HA);_.x(WA,_.it);WA.prototype.id=function(){return _.ef};WA.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,VA(d,b,e),4)}if(2!=g.a)return a.trigger(new _.L(_.fe,{offlineId:d.offlineId})),_.mh(g,0);f=_.E(g);a.onError(f);_.B(g)})};
15
- WA.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=TA,_.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",WA);};
9
+ btoa(c));_.A(d)})};_.u.get=function(a){var b=this,c;return _.I(function(d){if(c=window.localStorage.getItem(encodeURIComponent(a)))try{return d["return"](yB(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));_.A(b)})};_.u.clear=function(){return _.I(function(a){window.localStorage.clear();_.A(a)})};_.u.getName=function(){return pB};_.J("clpp.persistent.useStorage",function(a){var b=["store","get","delete","clear","getName"];var c=[];_.M.R(a)||(_.M.Ib(a.store)||c.push("store"),_.M.Ib(a.get)||c.push("get"),_.M.Ib(a["delete"])||c.push("delete"),_.M.Ib(a.clear)||c.push("clear"),_.M.Ib(a.getName)||c.push("getName"),b=c);if(0<b.length)throw BB.warn("Invalid session storage implementation"),new _.N(1,6,6202,{missingMethods:b});AB=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,C,F,G,B,H,O,T,da;return _.I(function(aa){switch(aa.a){case 1:f=AB;g=BB;h=function(ya,Va){return new _.N(1,6,6200,ya,Va)};l=_.Yp(a).shift();if(!l)throw h("No source specified.");if(!b)throw h(nB);m=b.offlineId;if(typeof m!==_.fg||!m.length)throw h("Missing offline id.");return _.y(aa,f.get(m),2);case 2:if(n=aa.f)return g.debug(mB,m),aa["return"]();p=_.vm();q=new _.tk;
11
+ t=[];v=_.w(d);for(z=v.next();!z.done;z=v.next())C=z.value,F=new C,_.zm(F.id())||(F.f(),_.Bm(F),t.push(F));G=null;_.D(aa,3,4);return _.y(aa,_.pu(l.url,q,p.manifest.attemptParameters,l.type||null),6);case 6:return G=aa.f,G.configure(p.manifest),_.y(aa,G.start(l.url,{configurationId:"",networkingEngine:q,filterAllPeriods:function(){},filterNewPeriod:function(){},onEvent:function(){},onError:function(){}}),7);case 7:B=aa.f;if(!B.periods.length)throw h(null,new _.N(_.P,4,4014));H=_.gu(B.periods);return _.y(aa,
12
+ CB(b,H,q),4);case 4:for(_.ph(aa);t.length;)O=t.shift(),O.a(),_.ym["delete"](O.id());T=[];G&&T.push(G.stop());T.push(q.destroy());return _.y(aa,Promise.all(T),9);case 9:_.qh(aa);break;case 3:da=_.E(aa);if(da instanceof _.N&&6200===da.code)throw da;throw h(null,da);}})});
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=AB;c=BB;if(!_.M.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 _.tk;d=zB(f.drmConfig,e);return _.y(l,wB(d,f.keySystem,f.licenseServerUri,f.serverCertificate,f.audioCapabilities,f.videoCapabilities),
14
+ 6);case 6:return _.y(l,_.Ro(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,sB(d,m),2);c.debug("successfully removed session with id",m);_.A(n)})})),8);case 8:return _.y(l,b["delete"](a),3);case 3:return _.ph(l),g=[],d&&g.push(d.destroy()),e&&g.push(e.destroy()),_.y(l,Promise.all(g),10);case 10:_.qh(l);break;case 2:throw h=_.E(l),c.error("Failed to remove session"),new _.N(1,6,6201,null,h);}})});var AB=new xB,BB=new _.K(oB);_.x(DB,_.tt);DB.prototype.id=function(){return _.ef};DB.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,CB(d,b,e),4)}if(2!=g.a)return a.trigger(new _.L(_.ee,{offlineId:d.offlineId})),_.oh(g,0);f=_.E(g);a.onError(f);_.A(g)})};
15
+ DB.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=AB,_.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",DB);};
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 CA=function(a,b){b=void 0===b?function(){return Promise.resolve()}:b;_.jm.call(this);this.m=a;this.l=b;this.f=0;this.a=[];this.h=!1;this.j=this.rb.bind(this)},DA=function(a){a.trigger(new _.L(_.vf))},EA=function(a,b){return 0<=b&&b<a.a.length};_.x(CA,_.jm);_.u=CA.prototype;_.u.on=function(a,b,c){return _.jm.prototype.on.call(this,a,b,c)};_.u.one=function(a,b,c){return _.jm.prototype.one.call(this,a,b,c)};_.u.off=function(a,b){return _.jm.prototype.off.call(this,a,b)};_.u.getPosition=function(){return this.f};
3
- _.u.ll=function(){return this.a};_.u.Md=function(){return 0<this.a.length&&EA(this,this.f)?this.a[this.f]:null};_.u.nl=function(){var a=this.f+1;return 0<this.a.length&&EA(this,a)?this.a[a]:null};_.u.Dl=function(){return this.h};_.u.start=function(){this.h||(this.h=!0,this.m.on(_.me,this.j),this.De(this.f,!0))};_.u.stop=function(){this.h=!1;this.m.off(_.me,this.j)};_.u.rb=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.De(b),0)})};_.u.cn=function(){var a=this,b;return _.I(function(c){b=Math.max(0,a.f-1);return _.y(c,a.De(b),0)})};_.u.De=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&&EA(c,a))||!b&&c.f===a)return e["return"]();c.f=a;return(d=c.Md())?_.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(_.uf,{item:d}));_.B(e)})};
5
- _.u.append=function(a){this.a.push(a);DA(this)};_.u.yl=function(a,b){if(0<=b&&b<=this.a.length){var c=this.Md();this.a.splice(b,0,a);c&&(this.f=this.a.indexOf(c));DA(this)}};_.u.remove=function(a){if(0<this.a.length&&EA(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);DA(this)}};_.u.clear=function(){this.stop();this.f=0;this.a=[];this.h=!1;DA(this)};_.J("clpp.Playlist",CA);CA.prototype.clear=CA.prototype.clear;CA.prototype.remove=CA.prototype.remove;
6
- CA.prototype.insert=CA.prototype.yl;CA.prototype.append=CA.prototype.append;CA.prototype.goTo=CA.prototype.De;CA.prototype.previous=CA.prototype.cn;CA.prototype.next=CA.prototype.next;CA.prototype.onEnded=CA.prototype.rb;CA.prototype.stop=CA.prototype.stop;CA.prototype.start=CA.prototype.start;CA.prototype.isStarted=CA.prototype.Dl;CA.prototype.getUpcoming=CA.prototype.nl;CA.prototype.getCurrent=CA.prototype.Md;CA.prototype.getQueue=CA.prototype.ll;CA.prototype.getPosition=CA.prototype.getPosition;
7
- CA.prototype.off=CA.prototype.off;CA.prototype.one=CA.prototype.one;CA.prototype.on=CA.prototype.on;};
2
+ var f=function(window){var jB=function(a,b){b=void 0===b?function(){return Promise.resolve()}:b;_.nm.call(this);this.m=a;this.l=b;this.f=0;this.a=[];this.h=!1;this.j=this.sb.bind(this)},kB=function(a){a.trigger(new _.L(_.vf))},lB=function(a,b){return 0<=b&&b<a.a.length};_.x(jB,_.nm);_.u=jB.prototype;_.u.on=function(a,b,c){return _.nm.prototype.on.call(this,a,b,c)};_.u.one=function(a,b,c){return _.nm.prototype.one.call(this,a,b,c)};_.u.off=function(a,b){return _.nm.prototype.off.call(this,a,b)};_.u.getPosition=function(){return this.f};
3
+ _.u.ol=function(){return this.a};_.u.Md=function(){return 0<this.a.length&&lB(this,this.f)?this.a[this.f]:null};_.u.ql=function(){var a=this.f+1;return 0<this.a.length&&lB(this,a)?this.a[a]:null};_.u.Gl=function(){return this.h};_.u.start=function(){this.h||(this.h=!0,this.m.on(_.me,this.j),this.De(this.f,!0))};_.u.stop=function(){this.h=!1;this.m.off(_.me,this.j)};_.u.sb=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.De(b),0)})};_.u.fn=function(){var a=this,b;return _.I(function(c){b=Math.max(0,a.f-1);return _.y(c,a.De(b),0)})};_.u.De=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&&lB(c,a))||!b&&c.f===a)return e["return"]();c.f=a;return(d=c.Md())?_.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(_.uf,{item:d}));_.A(e)})};
5
+ _.u.append=function(a){this.a.push(a);kB(this)};_.u.Bl=function(a,b){if(0<=b&&b<=this.a.length){var c=this.Md();this.a.splice(b,0,a);c&&(this.f=this.a.indexOf(c));kB(this)}};_.u.remove=function(a){if(0<this.a.length&&lB(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);kB(this)}};_.u.clear=function(){this.stop();this.f=0;this.a=[];this.h=!1;kB(this)};_.J("clpp.Playlist",jB);jB.prototype.clear=jB.prototype.clear;jB.prototype.remove=jB.prototype.remove;
6
+ jB.prototype.insert=jB.prototype.Bl;jB.prototype.append=jB.prototype.append;jB.prototype.goTo=jB.prototype.De;jB.prototype.previous=jB.prototype.fn;jB.prototype.next=jB.prototype.next;jB.prototype.onEnded=jB.prototype.sb;jB.prototype.stop=jB.prototype.stop;jB.prototype.start=jB.prototype.start;jB.prototype.isStarted=jB.prototype.Gl;jB.prototype.getUpcoming=jB.prototype.ql;jB.prototype.getCurrent=jB.prototype.Md;jB.prototype.getQueue=jB.prototype.ol;jB.prototype.getPosition=jB.prototype.getPosition;
7
+ jB.prototype.off=jB.prototype.off;jB.prototype.one=jB.prototype.one;jB.prototype.on=jB.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 vz="apiUrl config is missing",wz="prestoplay-web",xz=function(a,b){a.j=a.j.filter(function(c){return c!==b})},yz=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]},zz=function(){this.a=[]},Cz=function(a,b,c){Az(a,b,c,function(d,e){Bz(d,e)})},Bz=function(a,b){if(0<=b)Dz(a,b);else{for(var c=b,d=0;9>d;d++)a.a.push(c&127|128),c>>=7;a.a.push(1)}},Fz=function(a,b,c){Az(a,b,c,function(d,
3
- e){if(0<=e){var f=_.w(yz(e)),g=f.next().value;f=f.next().value;Ez(d,g,f)}else f=_.w(yz(e)),g=f.next().value,f=f.next().value,Ez(d,g,f)})},Hz=function(a,b,c){Gz(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)}})},Jz=function(a,b,c){Gz(a,b,c,function(d,e){Iz(d,e.a())})},Kz=function(a,b,c){Gz(a,b,c,function(d,e){Iz(d,e)})},Iz=function(a,b){a.a.push.apply(a.a,b)},Az=function(a,b,c,d){if(!(null===c||void 0===c||typeof c===_.k&&0===c||typeof c===_.fg&&0===c.length||Array.isArray(c)&&0===c.length))if(Array.isArray(c)){Dz(a,b<<3|2);b=new zz;for(var e=0;e<c.length;e++)d(b,c[e]);Bz(a,b.length());Iz(a,b.end())}else Dz(a,b<<3|0),d(a,c)},
5
- Gz=function(a,b,c,d){if(!(null===c||void 0===c||typeof c===_.k&&0===c||typeof c===_.fg&&0===c.length||Array.isArray(c)&&0===c.length))if(Array.isArray(c))for(var e=0;e<c.length;e++){Dz(a,b<<3|2);var f=new zz;d(f,c[e]);Bz(a,f.length());Iz(a,f.end())}else Dz(a,b<<3|2),b=new zz,d(b,c),Bz(a,b.length()),Iz(a,b.end())},Dz=function(a,b){for(;127<b;)a.a.push(b&127|128),b>>>=7;a.a.push(b)},Ez=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)},Lz=function(a,b,c,d){this.downloadId=
6
- a;this.h=b;this.duration=c;this.j=d;this.f=[]},Mz=function(a,b){this.f=a;this.url=b;this.downloadId=null;this.headers=[];this.size=this.duration=null},Nz=function(a,b){this.h=a;this.f=b},Oz=function(a){this.cause=a;this.f=this.message=this.severity=this.errorCode=null},Pz=function(a,b){this.key=a;this.value=b},Qz=function(){this.cause=this.severity=this.code=null},Rz=function(){this.data=null},Sz=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},Tz=function(){this.headers=[]},Uz=function(){},Vz=function(a){this.j=a;this.f=this.h=this.time=this.sessionId=null},Wz=function(){this.f=null;this.events=[]},Xz=function(){this.f=this.h=null},Yz=function(){this.f=this.h=null},Zz=function(a){var b=new Yz;b.h=Math.floor(a/1E3);b.f=a%1E3*1E6;return b},bA=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 Sz;this.A=new Sz;this.a=[];this.h=setInterval(function(){return $z(g)},h);
8
- this.f=null;this.j=!1;aA(this,a,b,c,d)},cA=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,$z(a),5);case 5:a.a=[];case 4:a.j=!0,_.B(b)}})},aA=function(a,b,c,d,e){var f=new Tz;f.headers=[new Pz("CL-BROWSER-NAME",b),new Pz("CL-BROWSER-VERSION",c),new Pz("CL-OS-FAMILY",d),new Pz("CL-OS-VERSION",e),new Pz("CL-SDK-NAME",wz),new Pz("CL-SDK-NAME",wz),new Pz("CL-SDK-VERSION",
9
- _.ja)];dA(a,f)},$z=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&&dA(a,new Uz);b=function(){};a.f=new Promise(function(g){b=g});_.lh(f);c=new Wz;c.f=a.o;c.events.push.apply(c.events,_.Zg(a.a));d=_.Zg(a.a).concat();return _.y(f,fetch(a.l,{method:_.Ib,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+"'"));_.nh(f);b();a.f=null;return _.oh(f)})},dA=function(a,b){if(!a.j){var c=new Vz(a.w);c.sessionId=a.A;var d=Date.now(),e=new Xz;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)}},eA=function(){this.reason=this.currentState=this.previousState=null},fA=function(){this.m=null;this.a=this.l=!1;this.f=new _.Qh;this.h=null;this.g=new _.K("clpp.sessions.SessionsPlugin");this.o=this.om.bind(this);this.j=this.nm.bind(this)},
11
- nA=function(a){switch(a){case _.yp:return gA;case _.Kp:return hA;case _.Dp:return iA;case _.Mp:return jA;case _.Lp:return kA;case _.Fp:return lA;case _.Jp:return mA;default:return null}},vA=function(a,b){switch(a){case 1:return oA;case 2:return b===_.r?pA:b===_.$c?qA:b===_.Q?rA:b===_.ve?sA:tA;case 3:return uA;default:return tA}},wA=function(a){var b;_.I(function(c){if(1==c.a)return a.g.info("Destroy the session and stop sending events."),_.Th(a.f),a.a=!1,b=a.m.getNetworkEngine(),b.lg(a.o),b.ae(a.j),
12
- xz(b,a.j),a.h?_.y(c,cA(a.h),3):c.F(0);a.h=null;_.B(c)})},xA=function(a,b){a.g.debug("Sending event",b);dA(a.h,b)},yA=function(){};zz.prototype.length=function(){return this.a.length};zz.prototype.end=function(){var a=this.a;this.a=[];return a};Lz.prototype.a=function(){var a=new zz;Jz(a,1,this.downloadId);Cz(a,2,this.h);Jz(a,3,this.duration);Cz(a,4,this.j);Jz(a,5,this.f);return a.end()};Lz.prototype.getId=function(){return 4};Mz.prototype.a=function(){var a=new zz;Cz(a,1,this.f);Jz(a,2,this.downloadId);Hz(a,3,this.url);Jz(a,4,this.headers);Hz(a,5,null);Jz(a,6,null);Jz(a,7,this.duration);Fz(a,8,this.size);return a.end()};Mz.prototype.getId=function(){return 2};Nz.prototype.a=function(){var a=new zz;Cz(a,1,this.h);Kz(a,2,this.f);return a.end()};Oz.prototype.a=function(){var a=new zz;Cz(a,1,this.errorCode);Cz(a,2,this.severity);Hz(a,3,this.message);Hz(a,4,this.f);Jz(a,5,this.cause);return a.end()};Oz.prototype.getId=function(){return 7};Pz.prototype.a=function(){var a=new zz;Hz(a,1,this.key);Hz(a,2,this.value);return a.end()};Qz.prototype.a=function(){var a=new zz;Cz(a,1,this.code);Cz(a,2,this.severity);Jz(a,3,this.cause);return a.end()};Qz.prototype.getId=function(){return 12};Rz.prototype.a=function(){var a=new zz;Kz(a,1,this.data);return a.end()};_.x(Sz,Rz);Sz.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]]};Tz.prototype.a=function(){var a=new zz;Jz(a,1,this.headers);return a.end()};Tz.prototype.getId=function(){return 1};Uz.prototype.a=function(){return(new zz).end()};Uz.prototype.getId=function(){return 6};Vz.prototype.a=function(){var a=new zz;Jz(a,1,this.j);Jz(a,2,this.sessionId);Jz(a,3,this.time);Fz(a,4,null);Hz(a,5,null);Cz(a,6,this.h);Kz(a,7,this.f);return a.end()};Wz.prototype.a=function(){var a=new zz;Kz(a,1,this.f);Jz(a,2,this.events);return a.end()};Xz.prototype.a=function(){var a=new zz;Fz(a,1,this.h);Cz(a,2,this.f);return a.end()};Yz.prototype.a=function(){var a=new zz;Fz(a,1,this.h);Cz(a,2,this.f);return a.end()};eA.prototype.a=function(){var a=new zz;Cz(a,1,this.previousState);Cz(a,2,this.currentState);Cz(a,3,this.reason);Jz(a,4,null);Jz(a,5,null);Jz(a,6,null);return a.end()};eA.prototype.getId=function(){return 5};_.x(fA,_.ev);_.u=fA.prototype;_.u.onPlayerCreated=function(a){this.m=a};
13
- _.u.onContentWillLoad=function(a){var b=a.getConfiguration().sessions;(b=!(!b||typeof b!==_.Ue))||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(_.xa),this.g.info("Create a session and start sending events."),a=_.ok(),this.h=new bA(a.browser,a.browserVersion.name,a.os,a.osVersion.name,b.apiUrl),this.f.on(this.m,_.cg,this.kk.bind(this)),this.f.on(this.m,_.Vf,this.jk.bind(this)),this.f.on(this.m,_.Uf,
14
- this.ik.bind(this)),this.f.on(this.m,_.ne,this.S.bind(this)),a=this.m.getNetworkEngine(),a.nf(this.o),a.Oc(this.j),a.j.push(this.j)):(this.g.warn(vz),a.onError(new _.N(1,9,15E3,vz)))};_.u.onPlayerWillRelease=function(){wA(this)};_.u.id=function(){return"sessions"};_.u.kk=function(a){if(!this.a){a=a.detail;var b=a.currentState,c=new eA;c.previousState=nA(a.previousState);c.currentState=nA(b);xA(this,c)}};
15
- _.u.jk=function(){if(!this.a){var a=new eA;a.previousState=nA(this.m.getState());a.currentState=zA;xA(this,a);this.a=!0}};_.u.ik=function(){if(this.a){var a=new eA;a.previousState=zA;a.currentState=nA(this.m.getState());xA(this,a);this.a=!1}};_.u.S=function(a){a=a.detail;var b=new Qz;b=new Oz(new Nz(b.getId(),new Uint8Array(b.a())));b.errorCode=a.code;b.message=a.message;b.f=a.stack;b.severity=a.severity===_.P?AA:BA;xA(this,b)};
16
- _.u.om=function(a){var b=new Sz;a.downloadId=b;var c=new Mz(vA(a.type,a.contentType),a.uris[0]);c.downloadId=b;c.headers=Object.keys(a.headers).map(function(d){return new Pz(d,a.headers[d])});xA(this,c)};_.u.nm=function(a){var b=a.request.downloadId;b?(b=new Lz(b,a.data.byteLength,Zz(a.timeMs||0),a.status||-1),b.f=Object.keys(a.headers).map(function(c){return new Pz(c,a.headers[c])}),xA(this,b)):this.g.warn("Download ID is missing on download completed event.")};yA.prototype.create=function(){return new fA};
17
- _.Fs(new yA);var BA=1,AA=2;var gA=0,hA=2,mA=3,zA=5,iA=6,jA=8,kA=10,lA=11;var oA=0,pA=1,qA=2,rA=3,sA=4,uA=5,tA=9;};
2
+ var f=function(window){var cA="apiUrl config is missing",dA="prestoplay-web",eA=function(a,b){a.j=a.j.filter(function(c){return c!==b})},fA=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]},gA=function(){this.a=[]},jA=function(a,b,c){hA(a,b,c,function(d,e){iA(d,e)})},iA=function(a,b){if(0<=b)kA(a,b);else{for(var c=b,d=0;9>d;d++)a.a.push(c&127|128),c>>=7;a.a.push(1)}},mA=function(a,b,c){hA(a,b,c,function(d,
3
+ e){if(0<=e){var f=_.w(fA(e)),g=f.next().value;f=f.next().value;lA(d,g,f)}else f=_.w(fA(e)),g=f.next().value,f=f.next().value,lA(d,g,f)})},oA=function(a,b,c){nA(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)}})},qA=function(a,b,c){nA(a,b,c,function(d,e){pA(d,e.a())})},rA=function(a,b,c){nA(a,b,c,function(d,e){pA(d,e)})},pA=function(a,b){a.a.push.apply(a.a,b)},hA=function(a,b,c,d){if(!(null===c||void 0===c||typeof c===_.k&&0===c||typeof c===_.fg&&0===c.length||Array.isArray(c)&&0===c.length))if(Array.isArray(c)){kA(a,b<<3|2);b=new gA;for(var e=0;e<c.length;e++)d(b,c[e]);iA(a,b.length());pA(a,b.end())}else kA(a,b<<3|0),d(a,c)},
5
+ nA=function(a,b,c,d){if(!(null===c||void 0===c||typeof c===_.k&&0===c||typeof c===_.fg&&0===c.length||Array.isArray(c)&&0===c.length))if(Array.isArray(c))for(var e=0;e<c.length;e++){kA(a,b<<3|2);var f=new gA;d(f,c[e]);iA(a,f.length());pA(a,f.end())}else kA(a,b<<3|2),b=new gA,d(b,c),iA(a,b.length()),pA(a,b.end())},kA=function(a,b){for(;127<b;)a.a.push(b&127|128),b>>>=7;a.a.push(b)},lA=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)},sA=function(a,b,c,d){this.downloadId=
6
+ a;this.h=b;this.duration=c;this.j=d;this.f=[]},tA=function(a,b){this.f=a;this.url=b;this.downloadId=null;this.headers=[];this.size=this.duration=null},uA=function(a,b){this.h=a;this.f=b},vA=function(a){this.cause=a;this.f=this.message=this.severity=this.errorCode=null},wA=function(a,b){this.key=a;this.value=b},xA=function(){this.cause=this.severity=this.code=null},yA=function(){this.data=null},zA=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},AA=function(){this.headers=[]},BA=function(){},CA=function(a){this.j=a;this.f=this.h=this.time=this.sessionId=null},DA=function(){this.f=null;this.events=[]},EA=function(){this.f=this.h=null},FA=function(){this.f=this.h=null},GA=function(a){var b=new FA;b.h=Math.floor(a/1E3);b.f=a%1E3*1E6;return b},JA=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 zA;this.A=new zA;this.a=[];this.h=setInterval(function(){return HA(g)},h);
8
+ this.f=null;this.j=!1;IA(this,a,b,c,d)},KA=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,HA(a),5);case 5:a.a=[];case 4:a.j=!0,_.A(b)}})},IA=function(a,b,c,d,e){var f=new AA;f.headers=[new wA("CL-BROWSER-NAME",b),new wA("CL-BROWSER-VERSION",c),new wA("CL-OS-FAMILY",d),new wA("CL-OS-VERSION",e),new wA("CL-SDK-NAME",dA),new wA("CL-SDK-NAME",dA),new wA("CL-SDK-VERSION",
9
+ _.ja)];LA(a,f)},HA=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&&LA(a,new BA);b=function(){};a.f=new Promise(function(g){b=g});_.nh(f);c=new DA;c.f=a.o;c.events.push.apply(c.events,_.ah(a.a));d=_.ah(a.a).concat();return _.y(f,fetch(a.l,{method:_.Ib,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+"'"));_.ph(f);b();a.f=null;return _.qh(f)})},LA=function(a,b){if(!a.j){var c=new CA(a.w);c.sessionId=a.A;var d=Date.now(),e=new EA;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)}},MA=function(){this.reason=this.currentState=this.previousState=null},NA=function(){this.m=null;this.a=this.l=!1;this.f=new _.Sh;this.h=null;this.g=new _.K("clpp.sessions.SessionsPlugin");this.o=this.qm.bind(this);this.j=this.pm.bind(this)},
11
+ VA=function(a){switch(a){case _.Gp:return OA;case _.Sp:return PA;case _.Lp:return QA;case _.Up:return RA;case _.Tp:return SA;case _.Np:return TA;case _.Rp:return UA;default:return null}},cB=function(a,b){switch(a){case 1:return WA;case 2:return b===_.r?XA:b===_.$c?YA:b===_.Q?ZA:b===_.ve?$A:aB;case 3:return bB;default:return aB}},dB=function(a){var b;_.I(function(c){if(1==c.a)return a.g.info("Destroy the session and stop sending events."),_.Vh(a.f),a.a=!1,b=a.m.getNetworkEngine(),b.mg(a.o),b.ae(a.j),
12
+ eA(b,a.j),a.h?_.y(c,KA(a.h),3):c.F(0);a.h=null;_.A(c)})},eB=function(a,b){a.g.debug("Sending event",b);LA(a.h,b)},fB=function(){};gA.prototype.length=function(){return this.a.length};gA.prototype.end=function(){var a=this.a;this.a=[];return a};sA.prototype.a=function(){var a=new gA;qA(a,1,this.downloadId);jA(a,2,this.h);qA(a,3,this.duration);jA(a,4,this.j);qA(a,5,this.f);return a.end()};sA.prototype.getId=function(){return 4};tA.prototype.a=function(){var a=new gA;jA(a,1,this.f);qA(a,2,this.downloadId);oA(a,3,this.url);qA(a,4,this.headers);oA(a,5,null);qA(a,6,null);qA(a,7,this.duration);mA(a,8,this.size);return a.end()};tA.prototype.getId=function(){return 2};uA.prototype.a=function(){var a=new gA;jA(a,1,this.h);rA(a,2,this.f);return a.end()};vA.prototype.a=function(){var a=new gA;jA(a,1,this.errorCode);jA(a,2,this.severity);oA(a,3,this.message);oA(a,4,this.f);qA(a,5,this.cause);return a.end()};vA.prototype.getId=function(){return 7};wA.prototype.a=function(){var a=new gA;oA(a,1,this.key);oA(a,2,this.value);return a.end()};xA.prototype.a=function(){var a=new gA;jA(a,1,this.code);jA(a,2,this.severity);qA(a,3,this.cause);return a.end()};xA.prototype.getId=function(){return 12};yA.prototype.a=function(){var a=new gA;rA(a,1,this.data);return a.end()};_.x(zA,yA);zA.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]]};AA.prototype.a=function(){var a=new gA;qA(a,1,this.headers);return a.end()};AA.prototype.getId=function(){return 1};BA.prototype.a=function(){return(new gA).end()};BA.prototype.getId=function(){return 6};CA.prototype.a=function(){var a=new gA;qA(a,1,this.j);qA(a,2,this.sessionId);qA(a,3,this.time);mA(a,4,null);oA(a,5,null);jA(a,6,this.h);rA(a,7,this.f);return a.end()};DA.prototype.a=function(){var a=new gA;rA(a,1,this.f);qA(a,2,this.events);return a.end()};EA.prototype.a=function(){var a=new gA;mA(a,1,this.h);jA(a,2,this.f);return a.end()};FA.prototype.a=function(){var a=new gA;mA(a,1,this.h);jA(a,2,this.f);return a.end()};MA.prototype.a=function(){var a=new gA;jA(a,1,this.previousState);jA(a,2,this.currentState);jA(a,3,this.reason);qA(a,4,null);qA(a,5,null);qA(a,6,null);return a.end()};MA.prototype.getId=function(){return 5};_.x(NA,_.pv);_.u=NA.prototype;_.u.onPlayerCreated=function(a){this.m=a};
13
+ _.u.onContentWillLoad=function(a){var b=a.getConfiguration().sessions;(b=!(!b||typeof b!==_.Ue))||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(_.wa),this.g.info("Create a session and start sending events."),a=_.qk(),this.h=new JA(a.browser,a.browserVersion.name,a.os,a.osVersion.name,b.apiUrl),this.f.on(this.m,_.cg,this.nk.bind(this)),this.f.on(this.m,_.Vf,this.mk.bind(this)),this.f.on(this.m,_.Uf,
14
+ this.lk.bind(this)),this.f.on(this.m,_.ne,this.S.bind(this)),a=this.m.getNetworkEngine(),a.nf(this.o),a.Oc(this.j),a.j.push(this.j)):(this.g.warn(cA),a.onError(new _.N(1,9,15E3,cA)))};_.u.onPlayerWillRelease=function(){dB(this)};_.u.id=function(){return"sessions"};_.u.nk=function(a){if(!this.a){a=a.detail;var b=a.currentState,c=new MA;c.previousState=VA(a.previousState);c.currentState=VA(b);eB(this,c)}};
15
+ _.u.mk=function(){if(!this.a){var a=new MA;a.previousState=VA(this.m.getState());a.currentState=gB;eB(this,a);this.a=!0}};_.u.lk=function(){if(this.a){var a=new MA;a.previousState=gB;a.currentState=VA(this.m.getState());eB(this,a);this.a=!1}};_.u.S=function(a){a=a.detail;var b=new xA;b=new vA(new uA(b.getId(),new Uint8Array(b.a())));b.errorCode=a.code;b.message=a.message;b.f=a.stack;b.severity=a.severity===_.P?hB:iB;eB(this,b)};
16
+ _.u.qm=function(a){var b=new zA;a.downloadId=b;var c=new tA(cB(a.type,a.contentType),a.uris[0]);c.downloadId=b;c.headers=Object.keys(a.headers).map(function(d){return new wA(d,a.headers[d])});eB(this,c)};_.u.pm=function(a){var b=a.request.downloadId;b?(b=new sA(b,a.data.byteLength,GA(a.timeMs||0),a.status||-1),b.f=Object.keys(a.headers).map(function(c){return new wA(c,a.headers[c])}),eB(this,b)):this.g.warn("Download ID is missing on download completed event.")};fB.prototype.create=function(){return new NA};
17
+ _.Qs(new fB);var iB=1,hB=2;var OA=0,PA=2,UA=3,gB=5,QA=6,RA=8,SA=10,TA=11;var WA=0,XA=1,YA=2,ZA=3,$A=4,bB=5,aB=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 dz="No surface found. Can not attach frame!",ez="SIMID:Media:timeupdate",fz="Starting creative",kz=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=_.Te;this.a.style.backgroundColor="transparent";this.a.style.transition="opacity .5s";this.a.style.transitionDelay=".5s";this.a.style.pointerEvents=_.Te;this.a.style.overflow=_.te;this.a.classList.add(_.wd);this.o=function(c){if(c.source===b.a.contentWindow&&
3
- (c=(c=c.data)?typeof c===_.fg?JSON.parse(c):c:null))if(c.type)switch(b.g.info("Received message ["+c.messageId+"] '"+c.type+"':",c.args),c.type){case "createSession":gz(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=hz(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=hz(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);iz(b,c)}else b.g.warn("WARNING: received message without 'type' property")};
5
- this.g=new _.K("clpp.simid.SimidPlayer");jz(this.f,this)},nz=function(a){var b=lz(a,"SIMID:Player:startCreative",void 0);mz(a,b).then(function(){var c=a.f;c.g.info(fz);c.m.trigger(new _.L(_.Xf));a.a.style.opacity="1"})["catch"](function(c){a.unload();a.f.g.error("Error while starting creative",c)})},gz=function(a,b){var c;_.I(function(d){if(1==d.a){a.h=b.sessionId;iz(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 Lz="No surface found. Can not attach frame!",Mz="SIMID:Media:timeupdate",Nz="Starting creative",Sz=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=_.Te;this.a.style.backgroundColor="transparent";this.a.style.transition="opacity .5s";this.a.style.transitionDelay=".5s";this.a.style.pointerEvents=_.Te;this.a.style.overflow=_.te;this.a.classList.add(_.wd);this.o=function(c){if(c.source===b.a.contentWindow&&
3
+ (c=(c=c.data)?typeof c===_.fg?JSON.parse(c):c:null))if(c.type)switch(b.g.info("Received message ["+c.messageId+"] '"+c.type+"':",c.args),c.type){case "createSession":Oz(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=Pz(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=Pz(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);Qz(b,c)}else b.g.warn("WARNING: received message without 'type' property")};
5
+ this.g=new _.K("clpp.simid.SimidPlayer");Rz(this.f,this)},Vz=function(a){var b=Tz(a,"SIMID:Player:startCreative",void 0);Uz(a,b).then(function(){var c=a.f;c.g.info(Nz);c.m.trigger(new _.L(_.Xf));a.a.style.opacity="1"})["catch"](function(c){a.unload();a.f.g.error("Error while starting creative",c)})},Oz=function(a,b){var c;_.I(function(d){if(1==d.a){a.h=b.sessionId;Qz(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=lz(a,"SIMID:Player:init",e);e=mz(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"),_.mh(d,0);c=_.E(d);a.g.error("Error while initializing",c);a.f.g.error("Error while initializing SIMID player: ",c);a.unload();_.B(d)})},lz=function(a,b,c){return{type:b,sessionId:a.h,messageId:a.l++,timestamp:Date.now(),args:c}},oz=function(a,b){a.h?(b.type!==ez&&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+"'")},iz=function(a,b){oz(a,lz(a,"resolve",{messageId:b.messageId,value:void 0}))},mz=function(a,b){return new Promise(function(c,d){new pz(a.j,c,d,b);oz(a,b)})},pz=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))},qz=function(){this.g=
9
- new _.K("clpp.simid.Plugin");this.h=this.a=this.m=null;this.l=[];this.j=null;this.w=this.lk.bind(this);this.f=null;this.o=!1},rz=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=lz(d,"SIMID:Player:resize",e);oz(d,e)}})},sz=function(a){this.m=a;this.a=null;this.g=new _.K("clpp.simid.Loader");this.h=!1;this.f=
10
- null},hz=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+"%"}},jz=function(a,b){a.g.info("SIMID Session created");a.a=b},tz=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(_.Yf))},uz=function(){};kz.prototype.load=function(a){window.addEventListener(_.Me,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
- kz.prototype.unload=function(){tz(this.f);this.h=this.a.src="";this.l=0;this.a.style.opacity="0";window.removeEventListener(_.Me,this.o);this.a.parentElement&&this.a.parentElement.removeChild(this.a)};pz.prototype.resolve=function(a){null!==this.a&&(clearTimeout(this.a),this.a=null);this.f["delete"](this.h.messageId);this.l(a)};pz.prototype.reject=function(a){null!==this.a&&(clearTimeout(this.a),this.a=null);this.f["delete"](this.h.messageId);this.j(a)};_.x(qz,_.ev);_.u=qz.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 sz(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 kz(this.h);var c=b.getContainer();this.j=rz(this,c,b);this.j.observe(c);a.on(_.ng,this.w)}else this.g.warn(dz)};
14
- _.u.lk=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&&(nz(this.a),this.o=!0,this.g.info(fz)),c&&(c=this.a,oz(c,lz(c,ez,{currentTime:a-b}))))):((a=this.m.getSurface())||this.g.warn(dz),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){_.ev.prototype.onPlayerWillRelease.call(this,a);this.m.getSurface()&&(this.j&&(this.j.disconnect(),this.j=null),a.off(_.ng,this.w),this.f&&(this.a.unload(),this.f=this.h.f=null))};sz.prototype.release=function(){this.g.info("Releasing loader")};
16
- sz.prototype.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};sz.prototype.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};sz.prototype.url=function(){return this.f?this.f.url:""};uz.prototype.create=function(){return new qz};
17
- _.Fs(new uz);};
7
+ clickThruUrl:""}};e=Tz(a,"SIMID:Player:init",e);e=Uz(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"),_.oh(d,0);c=_.E(d);a.g.error("Error while initializing",c);a.f.g.error("Error while initializing SIMID player: ",c);a.unload();_.A(d)})},Tz=function(a,b,c){return{type:b,sessionId:a.h,messageId:a.l++,timestamp:Date.now(),args:c}},Wz=function(a,b){a.h?(b.type!==Mz&&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+"'")},Qz=function(a,b){Wz(a,Tz(a,"resolve",{messageId:b.messageId,value:void 0}))},Uz=function(a,b){return new Promise(function(c,d){new Xz(a.j,c,d,b);Wz(a,b)})},Xz=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))},Yz=function(){this.g=
9
+ new _.K("clpp.simid.Plugin");this.h=this.a=this.m=null;this.l=[];this.j=null;this.w=this.pk.bind(this);this.f=null;this.o=!1},Zz=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=Tz(d,"SIMID:Player:resize",e);Wz(d,e)}})},$z=function(a){this.m=a;this.a=null;this.g=new _.K("clpp.simid.Loader");this.h=!1;this.f=
10
+ null},Pz=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+"%"}},Rz=function(a,b){a.g.info("SIMID Session created");a.a=b},aA=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(_.Yf))},bA=function(){};Sz.prototype.load=function(a){window.addEventListener(_.Me,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
+ Sz.prototype.unload=function(){aA(this.f);this.h=this.a.src="";this.l=0;this.a.style.opacity="0";window.removeEventListener(_.Me,this.o);this.a.parentElement&&this.a.parentElement.removeChild(this.a)};Xz.prototype.resolve=function(a){null!==this.a&&(clearTimeout(this.a),this.a=null);this.f["delete"](this.h.messageId);this.l(a)};Xz.prototype.reject=function(a){null!==this.a&&(clearTimeout(this.a),this.a=null);this.f["delete"](this.h.messageId);this.j(a)};_.x(Yz,_.pv);_.u=Yz.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 $z(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 Sz(this.h);var c=b.getContainer();this.j=Zz(this,c,b);this.j.observe(c);a.on(_.ng,this.w)}else this.g.warn(Lz)};
14
+ _.u.pk=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&&(Vz(this.a),this.o=!0,this.g.info(Nz)),c&&(c=this.a,Wz(c,Tz(c,Mz,{currentTime:a-b}))))):((a=this.m.getSurface())||this.g.warn(Lz),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){_.pv.prototype.onPlayerWillRelease.call(this,a);this.m.getSurface()&&(this.j&&(this.j.disconnect(),this.j=null),a.off(_.ng,this.w),this.f&&(this.a.unload(),this.f=this.h.f=null))};_.u=$z.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.Lh=function(){return this.a};_.u.url=function(){return this.f?this.f.url:""};bA.prototype.create=function(){return new Yz};
17
+ _.Qs(new bA);};
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));}