@castlabs/prestoplay 6.33.0 → 6.34.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 +22 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +19 -19
  5. package/cjs/cl.cast.js +129 -129
  6. package/cjs/cl.conviva.js +31 -31
  7. package/cjs/cl.core.js +635 -624
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +101 -101
  10. package/cjs/cl.externs.js +49 -74
  11. package/cjs/cl.freewheel.js +26 -26
  12. package/cjs/cl.hls.js +76 -76
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +30 -30
  15. package/cjs/cl.ima.js +26 -26
  16. package/cjs/cl.mediatailor.js +3 -3
  17. package/cjs/cl.mse.js +356 -353
  18. package/cjs/cl.muxdata.js +14 -14
  19. package/cjs/cl.onboard.js +4 -5
  20. package/cjs/cl.persistent.js +14 -14
  21. package/cjs/cl.playlist.js +6 -6
  22. package/cjs/cl.simid.js +16 -16
  23. package/cjs/cl.smooth.js +71 -71
  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 +11 -11
  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 +39 -39
  33. package/cl.adobe.js +3 -3
  34. package/cl.airplay.js +3 -3
  35. package/cl.broadpeak.js +14 -14
  36. package/cl.cast.js +100 -100
  37. package/cl.conviva.js +27 -27
  38. package/cl.core.js +513 -502
  39. package/cl.crypto.js +9 -9
  40. package/cl.dash.js +90 -90
  41. package/cl.externs.js +52 -65
  42. package/cl.freewheel.js +20 -20
  43. package/cl.hls.js +82 -82
  44. package/cl.hlssmpte.js +5 -5
  45. package/cl.htmlcue.js +26 -26
  46. package/cl.ima.js +20 -20
  47. package/cl.mediatailor.js +2 -2
  48. package/cl.mse.js +306 -306
  49. package/cl.muxdata.js +13 -13
  50. package/cl.onboard.js +5 -5
  51. package/cl.persistent.js +10 -10
  52. package/cl.playlist.js +5 -5
  53. package/cl.simid.js +14 -14
  54. package/cl.smooth.js +61 -61
  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 -3
  63. package/cl.youbora.js +31 -31
  64. package/package.json +1 -1
  65. package/typings.d.ts +57 -171
package/cjs/cl.muxdata.js CHANGED
@@ -1,18 +1,18 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var eB=function(a){switch(a.type){case 1:return bB;case 2:return cB;case 3:return dB}},gB=function(a){var b=Object.keys(a).find(function(c){return fB.includes(c.toLowerCase())});return void 0!==b?a[b]:void 0},hB=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 _.ti;this.g=b;this.A=this.l=this.h=!1;this.w=null;this.j=a.getNetworkEngine();this.G=this.Bl.bind(this);this.D=this.Al.bind(this)},jB=function(a){var b={debug:!0,
3
- data:iB(a)};a.f&&a.f.muxOptionsOverride&&_.M.Rd(a.f.muxOptionsOverride)&&(b=_.M.ta(b,a.f.muxOptionsOverride));b=_.M.ta(b,{getPlayheadTime:function(){return 1E3*a.m.getPosition()},getStateData:function(){a.g.debug("getStateData()");var c=a.m.$a(),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 _.rn(c.url);f.video_source_url=
4
- _.sn(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().sa(),c={videoWidth:c.width,videoHeight:c.height});e=c;c=e.videoWidth;e=e.videoHeight;a.g.debug("Video dimensions: "+c+"x"+e);c&&e&&(f.video_source_height=c,f.video_source_width=e);(d=d.qa())&&d.language&&(f.player_language_code=d.language);
5
- return f}});a.g.debug("Mux SDK options",b);return b},iB=function(a){var b={env_key:a.f.envKey,video_title:a.o&&a.o.name||"",player_name:_.Aa,player_software_name:_.Aa,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},kB=function(a){a.a.on(a.m,_.xg,function(){var b={player_playhead_time:1E3*a.m.getPosition()};a.emit(_.xg,b)});a.a.on(a.m,_.lf,function(){return a.emit(_.lf)});
6
- a.a.on(a.m,_.$c,a.xl.bind(a));a.a.on(a.m,_.gg,a.zl.bind(a));a.a.on(a.m,_.Ig,function(){return a.emit(_.Zf)});a.a.on(a.m,_.Hg,function(){return a.emit(_.Yf)});a.a.on(a.m,_.ne,a.yl.bind(a));a.a.on(a.m,_.fc,function(){return a.emit("adbreakstart")});a.a.on(a.m,_.gc,function(){return a.emit("adbreakend")});a.a.on(a.m,_.yc,function(){a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,_.rc,function(){return a.emit("adpause")});a.a.on(a.m,_.wc,function(){a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,
7
- _.zc,function(){return a.emit("adended")});a.a.on(a.m,_.kc,function(){return a.emit("adfirstquartile")});a.a.on(a.m,_.qc,function(){return a.emit("admidpoint")});a.a.on(a.m,_.Ac,function(){return a.emit("adthirdquartile")});a.j.fe(a.G);a.j.Eh(a.D);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 _.rn(b.uris[b.uriIndex]);b={request_start:c,request_type:eB(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 _.rn(b.uris[b.uriIndex]),f=c.data;b={request_start:d,request_type:eB(b),request_hostname:e.a,request_error:""+eB(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)}})},lB=function(a){_.wi(a.a);a.j.dg(a.G);a.j.Jj(a.D)},mB=function(){this.f=this.m=null;this.a=!1;this.g=new _.L("clpp.muxdata")},nB=function(a){return!_.M.R(a)&&typeof a.init===_.re&&typeof a.emit===_.re},oB=function(a,b){a.trigger(new _.Q(_.ne,{detail:b}))},pB=function(){},bB="manifest",cB="media",dB="encryption",fB=["x-request-id","cf-ray","x-amz-cf-id","x-akamai-request-id"];_.r=hB.prototype;_.r.initialize=function(a,b,c){this.f=a;this.o=b;this.w=c;if(!this.h){try{this.h=!0,this.w.init(this.B,jB(this))}catch(d){throw this.h=!1,lB(this),new _.N(1,9,9302,null,d);}this.emit("playerready")}this.l&&!this.A&&(a=iB(this),this.emit("videochange",a),this.l=!1);kB(this)};_.r.release=function(){this.g.debug("release()");this.l?this.g.debug(_.na):(lB(this),this.l=!0,this.o=this.f=null)};_.r.destroy=function(){this.g.debug(_.Sd);this.A?this.g.debug(_.ma):(this.A=!0,this.emit("destroy"))};
10
- _.r.emit=function(a,b){if(null===this.w)throw new _.N(1,9,9301);this.w.emit(this.B,a,b)};_.r.xl=function(a){this.g.debug(_.Xe);var b=a.detail;a=this.m.getTrackManager();b&&b.bandwidth&&(b=b.bandwidth,(a=a.Ya())&&a.bandwidth&&(b+=a.bandwidth),this.emit("renditionchange",{video_source_bitrate:b}))};_.r.zl=function(a){this.g.debug(_.bf);switch(a.detail.currentState){case 1:this.m.getConfiguration().autoplay&&this.emit(_.lf);break;case 3:this.emit(_.wf);break;case 4:this.emit(_.gf);break;case 5:this.emit(_.me)}};
11
- _.r.yl=function(a){this.g.debug(_.Ze);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
- _.r.Bl=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,k=e+a.responseStartMs;a=e+a.timeMs;f=f&&g?g-f:void 0;g=new _.rn(b.uris[b.uriIndex]);a={request_start:e,request_type:eB(b),request_hostname:g.a,request_id:gB(c),request_bytes_loaded:d,request_response_start:k,request_response_end:a,request_response_headers:c,request_media_duration:f,
13
- request_url:_.sn(g)};this.g.debug("onRequestCompleted()","Track event: requestcompleted",a);this.emit("requestcompleted",a)}};_.r.Al=function(a){a.requestStartTimestamp=Date.now()};_.w(mB,_.Yv);_.r=mB.prototype;_.r.onPlayerCreated=function(a){this.m=a;this.f=new hB(a,this.g)};
14
- _.r.onContentWillLoad=function(a,b){var c=a.getConfiguration();c=_.M.xb(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=nB(f.muxLib)?f.muxLib:window.mux;if(!nB(d)){this.g.warn("Mux SDK is not loaded. Will do nothing.");this.a=!1;var g=new _.N(1,9,9301);oB(a,g)}}else this.g.debug("Mux plugin is loaded but not configured. Will do nothing.");
15
- var k=d;null!==k&&this.f.initialize(c,b,k)}catch(l){this.a=!1,oB(a,l)}};_.r.onContentLoaded=function(){};_.r.onPlayerWillDestroy=function(){this.a&&(this.f.destroy(),this.m=this.f=null)};_.r.onPlayerWillRelease=function(){this.a&&this.f.release()};_.r.id=function(){return"mux"};_.r.emit=function(a,b){try{this.f.emit(a,b)}catch(c){throw null!==this.m&&oB(this.m,c),c;}};_.K("clpp.muxdata.MuxDataPlugin",mB);mB.prototype.emit=mB.prototype.emit;mB.Id="mux";pB.prototype.create=function(){return new mB};_.Yo(new pB);};
2
+ var f=function(window){var iB=function(a){switch(a.type){case 1:return fB;case 2:return gB;case 3:return hB}},kB=function(a){var b=Object.keys(a).find(function(c){return jB.includes(c.toLowerCase())});return void 0!==b?a[b]:void 0},lB=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 _.ki;this.g=b;this.A=this.l=this.h=!1;this.w=null;this.j=a.getNetworkEngine();this.G=this.Bl.bind(this);this.D=this.Al.bind(this)},nB=function(a){var b={debug:!0,
3
+ data:mB(a)};a.f&&a.f.muxOptionsOverride&&_.N.Qd(a.f.muxOptionsOverride)&&(b=_.N.ta(b,a.f.muxOptionsOverride));b=_.N.ta(b,{getPlayheadTime:function(){return 1E3*a.m.getPosition()},getStateData:function(){a.g.debug("getStateData()");var c=a.m.ab(),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 _.ck(c.url);f.video_source_url=
4
+ _.dk(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().sa(),c={videoWidth:c.width,videoHeight:c.height});e=c;c=e.videoWidth;e=e.videoHeight;a.g.debug("Video dimensions: "+c+"x"+e);c&&e&&(f.video_source_height=c,f.video_source_width=e);(d=d.qa())&&d.language&&(f.player_language_code=d.language);
5
+ return f}});a.g.debug("Mux SDK options",b);return b},mB=function(a){var b={env_key:a.f.envKey,video_title:a.o&&a.o.name||"",player_name:_.Ba,player_software_name:_.Ba,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},oB=function(a){a.a.on(a.m,_.ug,function(){var b={player_playhead_time:1E3*a.m.getPosition()};a.emit(_.ug,b)});a.a.on(a.m,_.jf,function(){return a.emit(_.jf)});
6
+ a.a.on(a.m,_.ad,a.xl.bind(a));a.a.on(a.m,_.uf,a.zl.bind(a));a.a.on(a.m,_.Fg,function(){return a.emit(_.Xf)});a.a.on(a.m,_.Eg,function(){return a.emit(_.Wf)});a.a.on(a.m,_.le,a.yl.bind(a));a.a.on(a.m,_.gc,function(){return a.emit("adbreakstart")});a.a.on(a.m,_.hc,function(){return a.emit("adbreakend")});a.a.on(a.m,_.xc,function(){a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,_.tc,function(){return a.emit("adpause")});a.a.on(a.m,_.vc,function(){a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,
7
+ _.zc,function(){return a.emit("adended")});a.a.on(a.m,_.lc,function(){return a.emit("adfirstquartile")});a.a.on(a.m,_.rc,function(){return a.emit("admidpoint")});a.a.on(a.m,_.Bc,function(){return a.emit("adthirdquartile")});a.j.ee(a.G);a.j.Eh(a.D);a.a.on(a.m,_.le,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 _.ck(b.uris[b.uriIndex]);b={request_start:c,request_type:iB(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 _.ck(b.uris[b.uriIndex]),f=c.data;b={request_start:d,request_type:iB(b),request_hostname:e.a,request_error:""+iB(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)}})},pB=function(a){_.ni(a.a);a.j.ag(a.G);a.j.Jj(a.D)},qB=function(){this.f=this.m=null;this.a=!1;this.g=new _.L("clpp.muxdata")},rB=function(a){return!_.N.R(a)&&typeof a.init===_.pe&&typeof a.emit===_.pe},sB=function(a,b){a.trigger(new _.R(_.le,{detail:b}))},tB=function(){},fB="manifest",gB="media",hB="encryption",jB=["x-request-id","cf-ray","x-amz-cf-id","x-akamai-request-id"];_.r=lB.prototype;_.r.initialize=function(a,b,c){this.f=a;this.o=b;this.w=c;if(!this.h){try{this.h=!0,this.w.init(this.B,nB(this))}catch(d){throw this.h=!1,pB(this),new _.O(1,9,9302,null,d);}this.emit("playerready")}this.l&&!this.A&&(a=mB(this),this.emit("videochange",a),this.l=!1);oB(this)};_.r.release=function(){this.g.debug("release()");this.l?this.g.debug(_.pa):(pB(this),this.l=!0,this.o=this.f=null)};_.r.destroy=function(){this.g.debug(_.Od);this.A?this.g.debug(_.na):(this.A=!0,this.emit("destroy"))};
10
+ _.r.emit=function(a,b){if(null===this.w)throw new _.O(1,9,9301);this.w.emit(this.B,a,b)};_.r.xl=function(a){this.g.debug(_.Ve);var b=a.detail;a=this.m.getTrackManager();b&&b.bandwidth&&(b=b.bandwidth,(a=a.Za())&&a.bandwidth&&(b+=a.bandwidth),this.emit("renditionchange",{video_source_bitrate:b}))};_.r.zl=function(a){this.g.debug(_.$e);switch(a.detail.currentState){case 2:this.m.getConfiguration().autoplay&&this.emit(_.jf);break;case 8:this.emit(_.vf);break;case 10:this.emit(_.ef);break;case 11:this.emit(_.ke)}};
11
+ _.r.yl=function(a){this.g.debug(_.Xe);if(this.h&&(a=a.detail||null))if(10003===a.code)this.emit("aderror");else if(a.severity===_.Q){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(_.le,{player_error_code:a.code,player_error_message:b})}};
12
+ _.r.Bl=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,k=e+a.responseStartMs;a=e+a.timeMs;f=f&&g?g-f:void 0;g=new _.ck(b.uris[b.uriIndex]);a={request_start:e,request_type:iB(b),request_hostname:g.a,request_id:kB(c),request_bytes_loaded:d,request_response_start:k,request_response_end:a,request_response_headers:c,request_media_duration:f,
13
+ request_url:_.dk(g)};this.g.debug("onRequestCompleted()","Track event: requestcompleted",a);this.emit("requestcompleted",a)}};_.r.Al=function(a){a.requestStartTimestamp=Date.now()};_.w(qB,_.hw);_.r=qB.prototype;_.r.onPlayerCreated=function(a){this.m=a;this.f=new lB(a,this.g)};
14
+ _.r.onContentWillLoad=function(a,b){var c=a.getConfiguration();c=_.N.wb(c.muxdata);try{var d=[];typeof c===_.Ue&&(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===_.Ue){var f=e.muxdata;d=rB(f.muxLib)?f.muxLib:window.mux;if(!rB(d)){this.g.warn("Mux SDK is not loaded. Will do nothing.");this.a=!1;var g=new _.O(1,9,9301);sB(a,g)}}else this.g.debug("Mux plugin is loaded but not configured. Will do nothing.");
15
+ var k=d;null!==k&&this.f.initialize(c,b,k)}catch(l){this.a=!1,sB(a,l)}};_.r.onContentLoaded=function(){};_.r.onPlayerWillDestroy=function(){this.a&&(this.f.destroy(),this.m=this.f=null)};_.r.onPlayerWillRelease=function(){this.a&&this.f.release()};_.r.id=function(){return"mux"};_.r.emit=function(a,b){try{this.f.emit(a,b)}catch(c){throw null!==this.m&&sB(this.m,c),c;}};_.J("clpp.muxdata.MuxDataPlugin",qB);qB.prototype.emit=qB.prototype.emit;qB.Id="mux";tB.prototype.create=function(){return new qB};_.eu(new tB);};
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));}
package/cjs/cl.onboard.js CHANGED
@@ -1,9 +1,8 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var ZA=function(a,b,c){var d=c&&c.customData&&c.customData.fpsContentId;_.Vu(a,b,c,!1);b.headers[_.Ca]=_.Pc;c={spc:_.Dm(b.body)};if(a.drm&&d){a={};var e=_.un((new _.rn(_.Mq(d))).f);d=e.keyId;if(e=e.assetId)_.Qq.info("Applying assetId from HLS manifest."),a.assetId=e;d&&(_.Qq.info("Applying keyId from HLS manifest."),a.keyId=d);a.keyId&&(_.Uu.info("Adding keyID to FPS payload:",a.keyId),c.keyId=a.keyId);a.assetId&&(_.Uu.info("Adding assetID to FPS payload:",a.assetId),c.assetId=a.assetId)}b.body=_.R.ld(_.tn(c,
3
- !0))},$A=function(){this.g=new _.L("clpp.onboard");this.a=new Set},aB=function(a,b){function c(n){return n&&(_.R.startsWith(n,_.we)||_.R.startsWith(n,"http://")||_.R.startsWith(n,"//"))?n:d+n}var d=b.baseUrl;_.R.endsWith(d,"/")||(d+="/");var e=c(b.widevineUrl||"widevine"),f=c(b.playreadyUrl||"playready"),g=c(b.fairplayUrl||"fairplay"),k=b.serverCertificate,l=_.Tq("V2"),m=new _.Qu(a);m.rb(_.Jd,{licenseUrl:e,videoRobustness:[_.Ab,void 0],audioRobustness:[_.zb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,
4
- serverCertificate:_.Ru(k,l),modifiers:{licenseRequest:_.Vu,licenseResponse:_.$u}});m.rb(_.Fd,{licenseUrl:g,certificateUrl:g,modifiers:{licenseRequest:ZA,licenseResponse:_.Yu,extractContentId:_.Tu}});m.rb(_.Hd,{licenseUrl:f,modifiers:{licenseRequest:_.Vu}});_.Rn(m)};_.w($A,_.Pu);$A.prototype.uninstall=function(){for(var a=_.v(this.a),b=a.next();!b.done;b=a.next())delete _.Qn[b.value];this.a.clear()};
5
- $A.prototype.beforeLoad=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,serverCertificate:a.serverCertificate,playreadyUrl:a.playreadyUrl,fairplayUrl:a.fairplayUrl},this.g.info("Registering the DRMtoday Onboard environment, name\x3d'"+b+"'"),aB(b,a),this.a.add(b))};$A.prototype.id=function(){return"onboard"};_.K("clpp.onboard.OnboardComponent",$A);
6
- _.K("clpp.onboard.register",aB);};
2
+ var f=function(window){var cB=function(a,b,c){var d=c&&c.customData&&c.customData.fpsContentId;_.Ru(a,b,c,!1);b.headers[_.Da]=_.Qc;c={spc:_.Hl(b.body)};if(a.drm&&d){a={};var e=_.fk((new _.ck(_.jo(d))).f);d=e.keyId;if(e=e.assetId)_.ko.info("Applying assetId from HLS manifest."),a.assetId=e;d&&(_.ko.info("Applying keyId from HLS manifest."),a.keyId=d);a.keyId&&(_.Qu.info("Adding keyID to FPS payload:",a.keyId),c.keyId=a.keyId);a.assetId&&(_.Qu.info("Adding assetID to FPS payload:",a.assetId),c.assetId=a.assetId)}b.body=_.S.kd(_.ek(c,
3
+ !0))},dB=function(){this.g=new _.L("clpp.onboard");this.a=new Set},eB=function(a,b){function c(n){return n&&(_.S.startsWith(n,_.te)||_.S.startsWith(n,"http://")||_.S.startsWith(n,"//"))?n:d+n}var d=b.baseUrl;_.S.endsWith(d,"/")||(d+="/");var e=c(b.widevineUrl||"widevine"),f=c(b.playreadyUrl||"playready"),g=c(b.fairplayUrl||"fairplay"),k=b.serverCertificate,l=_.ro("V2"),m=new _.Ju(a);m.Ma(_.Jd,{licenseUrl:e,videoRobustness:[_.Bb,void 0],audioRobustness:[_.Ab,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,
4
+ serverCertificate:_.Ku(k,l),modifiers:{licenseRequest:_.Ru,licenseResponse:_.Wu}});m.Ma(_.Fd,{licenseUrl:g,certificateUrl:g,modifiers:{licenseRequest:cB,licenseResponse:_.Uu,extractContentId:_.Pu}});m.Ma(_.Hd,{licenseUrl:f,modifiers:{licenseRequest:_.Ru}});_.dl(m)};_.w(dB,_.Iu);dB.prototype.uninstall=function(){for(var a=_.v(this.a),b=a.next();!b.done;b=a.next())delete _.bl[b.value];this.a.clear()};
5
+ dB.prototype.drmConfigurationResolved=function(a){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,serverCertificate:a.serverCertificate,playreadyUrl:a.playreadyUrl,fairplayUrl:a.fairplayUrl},this.g.info("Registering the DRMtoday Onboard environment, name\x3d'"+b+"'"),eB(b,a),this.a.add(b))};dB.prototype.id=function(){return"onboard"};_.J("clpp.onboard.OnboardComponent",dB);_.J("clpp.onboard.register",eB);};
7
6
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
8
7
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
9
8
  else{_=this.clpp._;(f.call(g,this));}
@@ -1,19 +1,19 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var IA="A persistent DRM session already exists for: ",JA="No DRM configuration.",KA="clpp.persistent",LA="clpp.persistent.SimpleSessionStorage",MA=function(a){var b=[];a=_.v(a.h.keys());for(var c=a.next();!c.done;c=a.next())b.push(c.value.sessionId);return b},NA=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a)return _.x(f,_.qs(a,b),2);c=f.f;if(!c)return a.g.debug("Ignoring attempt to remove missing session",b),f["return"]();d=[];(e=a.h.get(c))&&a.D&&(e.Oc=new _.jm,d.push(e.Oc));a.g.debug("Attempting to remove session",
3
- b);d.push(c.remove());return f["return"](Promise.all(d))})},PA=function(a,b){a.L=OA;a.M=[];a.H=!0;return _.Tr(a,b)},RA=function(a,b,c,d,e,f){a.L=QA;var g=new Map,k=_.vs(b);g.set(k,{audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:_.df,persistentState:_.Qf,sessionTypes:[_.jf],label:k,drmInfos:[{keySystem:b,licenseServerUri:c,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}]});return _.cs(a,
4
- g)},SA=function(){this.g=new _.L(LA)},TA=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}},UA=function(a,b){var c=_.Tn(a),d=_.Jn([{drm:a}]);d.drm=a;var e=new _.Pr({Mb:b,onError:function(){},Wg:function(){},
5
- Vg:function(){},onEvent:function(){},getConfiguration:function(){return d},Kd:function(){return null}});e.f=c;return e},XA=function(a,b,c){var d,e,f,g,k,l,m,n,p;return _.I(function(q){switch(q.a){case 1:d=VA;e=WA;if(!a)return e.debug(JA),q["return"]();f=a.offlineId;return 0===f.length?q["return"]():_.x(q,d.get(f),2);case 2:if(g=q.f)return e.debug(IA,f),q["return"]();k=UA(a,c);_.F(q,3,4);return _.x(q,PA(k,b),6);case 6:return _.x(q,_.js(k),7);case 7:return _.x(q,_.ks(k),8);case 8:return l=k.getDrmInfo(),
6
- m=b.map(function(t){return{contentType:_.An(t.video.mimeType,t.video.codecs),robustness:l.videoRobustness}}),n=MA(k),g={sessionIds:n,keySystem:l.keySystem,licenseServerUri:l.licenseServerUri,serverCertificate:l.serverCertificate,audioCapabilities:[],videoCapabilities:m,drmConfig:a},_.x(q,d.store(f,g),4);case 4:return _.Bh(q),_.x(q,k.destroy(),10);case 10:_.Ch(q);break;case 3:throw p=_.H(q),e.error("Error while persisting DRM session "+f),new _.N(1,6,6200,null,p);}})},YA=function(){this.g=new _.L(KA)},
7
- OA=1,QA=2;_.r=SA.prototype;
2
+ var f=function(window){var MA="A persistent DRM session already exists for: ",NA="No DRM configuration.",OA="clpp.persistent",PA="clpp.persistent.SimpleSessionStorage",QA=function(a){var b=[];a=_.v(a.h.keys());for(var c=a.next();!c.done;c=a.next())b.push(c.value.sessionId);return b},RA=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a)return _.x(f,_.Xp(a,b),2);c=f.f;if(!c)return a.g.debug("Ignoring attempt to remove missing session",b),f["return"]();d=[];(e=a.h.get(c))&&a.D&&(e.Mc=new _.ol,d.push(e.Mc));a.g.debug("Attempting to remove session",
3
+ b);d.push(c.remove());return f["return"](Promise.all(d))})},TA=function(a,b){a.L=SA;a.M=[];a.H=!0;return _.Ap(a,b)},VA=function(a,b,c,d,e,f){a.L=UA;var g=new Map,k=_.bq(b);g.set(k,{audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:_.bf,persistentState:_.Pf,sessionTypes:[_.gf],label:k,drmInfos:[{keySystem:b,licenseServerUri:c,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}]});return _.Kp(a,
4
+ g)},WA=function(){this.g=new _.L(PA)},XA=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}},YA=function(a,b){var c=_.fl(a),d=_.zn([{drm:a}]);d.drm=a;var e=new _.wp({Lb:b,onError:function(){},Vg:function(){},
5
+ Ug:function(){},onEvent:function(){},getConfiguration:function(){return d},Jd:function(){return null}});e.f=c;return e},aB=function(a,b,c){var d,e,f,g,k,l,m,n,p;return _.I(function(q){switch(q.a){case 1:d=ZA;e=$A;if(!a)return e.debug(NA),q["return"]();f=a.offlineId;return 0===f.length?q["return"]():_.x(q,d.get(f),2);case 2:if(g=q.f)return e.debug(MA,f),q["return"]();k=YA(a,c);_.F(q,3,4);return _.x(q,TA(k,b),6);case 6:return _.x(q,_.Qp(k),7);case 7:return _.x(q,_.Rp(k),8);case 8:return l=k.getDrmInfo(),
6
+ m=b.map(function(t){return{contentType:_.Hm(t.video.mimeType,t.video.codecs),robustness:l.videoRobustness}}),n=QA(k),g={sessionIds:n,keySystem:l.keySystem,licenseServerUri:l.licenseServerUri,serverCertificate:l.serverCertificate,audioCapabilities:[],videoCapabilities:m,drmConfig:a},_.x(q,d.store(f,g),4);case 4:return _.yh(q),_.x(q,k.destroy(),10);case 10:_.zh(q);break;case 3:throw p=_.H(q),e.error("Error while persisting DRM session "+f),new _.O(1,6,6200,null,p);}})},bB=function(){this.g=new _.L(OA)},
7
+ SA=1,UA=2;_.r=WA.prototype;
8
8
  _.r.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),k=JSON.stringify(b.videoCapabilities);c=JSON.stringify({sessionIds:e,keySystem:b.keySystem,licenseServerUri:encodeURIComponent(b.licenseServerUri),serverCertificate:f,audioCapabilities:g,videoCapabilities:k,drmConfig:JSON.stringify(b.drmConfig)});window.localStorage.setItem(encodeURIComponent(a),btoa(c));
9
- _.z(d)})};_.r.get=function(a){var b=this,c;return _.I(function(d){if(c=window.localStorage.getItem(encodeURIComponent(a)))try{return d["return"](TA(atob(c)))}catch(e){b.g.warn("Error while loading offline items for "+a+" from storage: ",e)}return d["return"](null)})};_.r["delete"]=function(a){return _.I(function(b){window.localStorage.removeItem(encodeURIComponent(a));_.z(b)})};_.r.clear=function(){return _.I(function(a){window.localStorage.clear();_.z(a)})};_.r.getName=function(){return LA};_.K("clpp.persistent.useStorage",function(a){var b=["store","get","delete","clear","getName"];var c=[];_.M.R(a)||(_.M.bc(a.store)||c.push("store"),_.M.bc(a.get)||c.push("get"),_.M.bc(a["delete"])||c.push("delete"),_.M.bc(a.clear)||c.push("clear"),_.M.bc(a.getName)||c.push("getName"),b=c);if(0<b.length)throw WA.warn("Invalid session storage implementation"),new _.N(1,6,6202,{missingMethods:b});VA=a});
10
- _.K("clpp.persistent.fetchLicense",function(a,b,c){for(var d=[],e=2;e<arguments.length;++e)d[e-2]=arguments[e];var f,g,k,l,m,n,p,q,t,u,y,A,D,C,E,B,J,O,U;return _.I(function(V){switch(V.a){case 1:f=VA;g=WA;k=function(ta,za){return new _.N(1,6,6200,ta,za)};l=_.Nn(a).shift();if(!l)throw k("No source specified.");if(!b)throw k(JA);m=b.offlineId;if(typeof m!==_.jg||!m.length)throw k("Missing offline id.");return _.x(V,f.get(m),2);case 2:if(n=V.f)return g.debug(IA,m),V["return"]();p=_.Hn();q=new _.Sm;t=
11
- [];u=_.v(d);for(y=u.next();!y.done;y=u.next())A=y.value,D=new A,_.fi(D.id())||(D.install(),_.ii(D),t.push(D));C=null;_.F(V,3,4);return _.x(V,_.Uv(l.url,q,p.manifest.attemptParameters,l.type||null),6);case 6:return C=V.f,C.configure(p.manifest),_.x(V,C.start(l.url,{configurationId:"",networkingEngine:q,onContentSteeringInfoFound:function(){return null},filterAllPeriods:function(){},filterNewPeriod:function(){},onEvent:function(){},onError:function(){}}),7);case 7:E=V.f;if(!E.periods.length)throw k(null,
12
- new _.N(_.P,4,4014));B=_.mv(E.periods);return _.x(V,XA(b,B,q),4);case 4:for(_.Bh(V);t.length;)J=t.shift(),J.uninstall(),_.ei["delete"](J.id());O=[];C&&O.push(C.stop());O.push(q.destroy());return _.x(V,Promise.all(O),9);case 9:_.Ch(V);break;case 3:U=_.H(V);if(U instanceof _.N&&6200===U.code)throw U;throw k(null,U);}})});
13
- _.K("clpp.persistent.removeLicense",function(a){var b,c,d,e,f,g,k;return _.I(function(l){switch(l.a){case 1:b=VA;c=WA;if(!_.M.ja(a)||0===a.length)return c.warn("Invalid offlineId"),l["return"]();e=d=null;_.F(l,2,3);return _.x(l,b.get(a),5);case 5:f=l.f;if(!f)return c.debug("No persistent DRM session found"),l["return"]();f.drmConfig.delayLicenseRequestUntilPlayed=!0;e=new _.Sm;d=UA(f.drmConfig,e);return _.x(l,RA(d,f.keySystem,f.licenseServerUri,f.serverCertificate,f.audioCapabilities,f.videoCapabilities),
14
- 6);case 6:return _.x(l,_.js(d),7);case 7:return _.x(l,Promise.all(f.sessionIds.map(function(m){return _.I(function(n){if(1==n.a)return _.x(n,NA(d,m),2);c.debug("successfully removed session with id",m);_.z(n)})})),8);case 8:return _.x(l,b["delete"](a),3);case 3:return _.Bh(l),g=[],d&&g.push(d.destroy()),e&&g.push(e.destroy()),_.x(l,Promise.all(g),10);case 10:_.Ch(l);break;case 2:throw k=_.H(l),c.error("Failed to remove session"),new _.N(1,6,6201,null,k);}})});
15
- _.K("clpp.persistent.getSessionStorage",function(){return VA});var VA=new SA,WA=new _.L(KA);_.w(YA,_.Pu);YA.prototype.id=function(){return _.hf};YA.prototype.f=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();_.F(g,2);return _.x(g,XA(d,b,e),4)}if(2!=g.a)return a.trigger(new _.Q(_.ee,{offlineId:d.offlineId})),_.G(g,0);f=_.H(g);a.onError(f);_.z(g)})};
16
- YA.prototype.a=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=VA,_.F(e,2),_.x(e,c.get(a),4);if(2!=e.a){if(d=e.f)return e["return"](d.sessionIds||[]);b.g.debug("No offline session found for "+a);return e["return"]([])}_.H(e);b.g.warn("Error while loading session info from storage");return e["return"]([])})};_.K("clpp.persistent.PersistentLicenseComponent",YA);};
9
+ _.z(d)})};_.r.get=function(a){var b=this,c;return _.I(function(d){if(c=window.localStorage.getItem(encodeURIComponent(a)))try{return d["return"](XA(atob(c)))}catch(e){b.g.warn("Error while loading offline items for "+a+" from storage: ",e)}return d["return"](null)})};_.r["delete"]=function(a){return _.I(function(b){window.localStorage.removeItem(encodeURIComponent(a));_.z(b)})};_.r.clear=function(){return _.I(function(a){window.localStorage.clear();_.z(a)})};_.r.getName=function(){return PA};_.J("clpp.persistent.useStorage",function(a){var b=["store","get","delete","clear","getName"];var c=[];_.N.R(a)||(_.N.ac(a.store)||c.push("store"),_.N.ac(a.get)||c.push("get"),_.N.ac(a["delete"])||c.push("delete"),_.N.ac(a.clear)||c.push("clear"),_.N.ac(a.getName)||c.push("getName"),b=c);if(0<b.length)throw $A.warn("Invalid session storage implementation"),new _.O(1,6,6202,{missingMethods:b});ZA=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,k,l,m,n,p,q,t,u,y,A,D,B,E,C,K,P,T;return _.I(function(W){switch(W.a){case 1:f=ZA;g=$A;k=function(oa,Aa){return new _.O(1,6,6200,oa,Aa)};l=_.Jq(a).shift();if(!l)throw k("No source specified.");if(!b)throw k(NA);m=b.offlineId;if(typeof m!==_.hg||!m.length)throw k("Missing offline id.");return _.x(W,f.get(m),2);case 2:if(n=W.f)return g.debug(MA,m),W["return"]();p=_.xn();q=new _.Wl;t=
11
+ [];u=_.v(d);for(y=u.next();!y.done;y=u.next())A=y.value,D=new A,_.ar(D.id())||(D.install(),_.cr(D),t.push(D));B=null;_.F(W,3,4);return _.x(W,_.dw(l.url,q,p.manifest.attemptParameters,l.type||null),6);case 6:return B=W.f,B.configure(p.manifest),_.x(W,B.start(l.url,{configurationId:"",networkingEngine:q,onContentSteeringInfoFound:function(){return null},filterAllPeriods:function(){},filterNewPeriod:function(){},onEvent:function(){},onError:function(){}}),7);case 7:E=W.f;if(!E.periods.length)throw k(null,
12
+ new _.O(_.Q,4,4014));C=_.xv(E.periods);return _.x(W,aB(b,C,q),4);case 4:for(_.yh(W);t.length;)K=t.shift(),K.uninstall(),_.$q["delete"](K.id());P=[];B&&P.push(B.stop());P.push(q.destroy());return _.x(W,Promise.all(P),9);case 9:_.zh(W);break;case 3:T=_.H(W);if(T instanceof _.O&&6200===T.code)throw T;throw k(null,T);}})});
13
+ _.J("clpp.persistent.removeLicense",function(a){var b,c,d,e,f,g,k;return _.I(function(l){switch(l.a){case 1:b=ZA;c=$A;if(!_.N.ja(a)||0===a.length)return c.warn("Invalid offlineId"),l["return"]();e=d=null;_.F(l,2,3);return _.x(l,b.get(a),5);case 5:f=l.f;if(!f)return c.debug("No persistent DRM session found"),l["return"]();f.drmConfig.delayLicenseRequestUntilPlayed=!0;e=new _.Wl;d=YA(f.drmConfig,e);return _.x(l,VA(d,f.keySystem,f.licenseServerUri,f.serverCertificate,f.audioCapabilities,f.videoCapabilities),
14
+ 6);case 6:return _.x(l,_.Qp(d),7);case 7:return _.x(l,Promise.all(f.sessionIds.map(function(m){return _.I(function(n){if(1==n.a)return _.x(n,RA(d,m),2);c.debug("successfully removed session with id",m);_.z(n)})})),8);case 8:return _.x(l,b["delete"](a),3);case 3:return _.yh(l),g=[],d&&g.push(d.destroy()),e&&g.push(e.destroy()),_.x(l,Promise.all(g),10);case 10:_.zh(l);break;case 2:throw k=_.H(l),c.error("Failed to remove session"),new _.O(1,6,6201,null,k);}})});
15
+ _.J("clpp.persistent.getSessionStorage",function(){return ZA});var ZA=new WA,$A=new _.L(OA);_.w(bB,_.Iu);bB.prototype.id=function(){return _.ff};bB.prototype.f=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();_.F(g,2);return _.x(g,aB(d,b,e),4)}if(2!=g.a)return a.trigger(new _.R(_.ce,{offlineId:d.offlineId})),_.G(g,0);f=_.H(g);a.onError(f);_.z(g)})};
16
+ bB.prototype.a=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=ZA,_.F(e,2),_.x(e,c.get(a),4);if(2!=e.a){if(d=e.f)return e["return"](d.sessionIds||[]);b.g.debug("No offline session found for "+a);return e["return"]([])}_.H(e);b.g.warn("Error while loading session info from storage");return e["return"]([])})};_.J("clpp.persistent.PersistentLicenseComponent",bB);};
17
17
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
18
18
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
19
19
  else{_=this.clpp._;(f.call(g,this));}
@@ -1,10 +1,10 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var FA=function(a,b){b=void 0===b?function(){return Promise.resolve()}:b;_.Ai.call(this);this.m=a;this.l=b;this.f=0;this.a=[];this.h=!1;this.j=this.Ja.bind(this)},GA=function(a){a.trigger(new _.Q(_.yf))},HA=function(a,b){return 0<=b&&b<a.a.length};_.w(FA,_.Ai);_.r=FA.prototype;_.r.on=function(a,b,c){return _.Ai.prototype.on.call(this,a,b,c)};_.r.one=function(a,b,c){return _.Ai.prototype.one.call(this,a,b,c)};_.r.off=function(a,b){return _.Ai.prototype.off.call(this,a,b)};_.r.getPosition=function(){return this.f};
3
- _.r.Be=function(){return this.a};_.r.Wb=function(){return 0<this.a.length&&HA(this,this.f)?this.a[this.f]:null};_.r.Ni=function(){var a=this.f+1;return 0<this.a.length&&HA(this,a)?this.a[a]:null};_.r.Pg=function(){return this.h};_.r.start=function(){this.h||(this.h=!0,this.m.on(_.me,this.j),this.Od(this.f,!0))};_.r.stop=function(){this.h=!1;this.m.off(_.me,this.j)};_.r.Ja=function(){this.next()};
4
- _.r.next=function(){var a=this,b;return _.I(function(c){b=Math.min(a.a.length-1,a.f+1);return _.x(c,a.Od(b),0)})};_.r.Ve=function(){var a=this,b;return _.I(function(c){b=Math.max(0,a.f-1);return _.x(c,a.Od(b),0)})};
5
- _.r.Od=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&&HA(c,a))||!b&&c.f===a)return e["return"]();c.f=a;return(d=c.Wb())&&!1===d.skippable?e["return"]():d?_.x(e,c.l(d),3):e.C(0)}if(4!=e.a)return _.x(e,c.m.open(d.configuration),4);c.trigger(new _.Q(_.xf,{item:d}));_.z(e)})};_.r.append=function(a){this.a.push(a);GA(this)};_.r.Si=function(a,b){if(0<=b&&b<=this.a.length){var c=this.Wb();this.a.splice(b,0,a);c&&(this.f=this.a.indexOf(c));GA(this)}};
6
- _.r.remove=function(a){if(0<this.a.length&&HA(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);GA(this)}};_.r.clear=function(){this.stop();this.f=0;this.a=[];this.h=!1;GA(this)};_.K("clpp.Playlist",FA);FA.prototype.clear=FA.prototype.clear;FA.prototype.remove=FA.prototype.remove;FA.prototype.insert=FA.prototype.Si;FA.prototype.append=FA.prototype.append;FA.prototype.goTo=FA.prototype.Od;FA.prototype.previous=FA.prototype.Ve;FA.prototype.next=FA.prototype.next;
7
- FA.prototype.onEnded=FA.prototype.Ja;FA.prototype.stop=FA.prototype.stop;FA.prototype.start=FA.prototype.start;FA.prototype.isStarted=FA.prototype.Pg;FA.prototype.getUpcoming=FA.prototype.Ni;FA.prototype.getCurrent=FA.prototype.Wb;FA.prototype.getQueue=FA.prototype.Be;FA.prototype.getPosition=FA.prototype.getPosition;FA.prototype.off=FA.prototype.off;FA.prototype.one=FA.prototype.one;FA.prototype.on=FA.prototype.on;};
2
+ var f=function(window){var JA=function(a,b){b=void 0===b?function(){return Promise.resolve()}:b;_.qn.call(this);this.m=a;this.l=b;this.f=0;this.a=[];this.h=!1;this.j=this.Ja.bind(this)},KA=function(a){a.trigger(new _.R(_.xf))},LA=function(a,b){return 0<=b&&b<a.a.length};_.w(JA,_.qn);_.r=JA.prototype;_.r.on=function(a,b,c){return _.qn.prototype.on.call(this,a,b,c)};_.r.one=function(a,b,c){return _.qn.prototype.one.call(this,a,b,c)};_.r.off=function(a,b){return _.qn.prototype.off.call(this,a,b)};_.r.getPosition=function(){return this.f};
3
+ _.r.ze=function(){return this.a};_.r.Vb=function(){return 0<this.a.length&&LA(this,this.f)?this.a[this.f]:null};_.r.Mi=function(){var a=this.f+1;return 0<this.a.length&&LA(this,a)?this.a[a]:null};_.r.Og=function(){return this.h};_.r.start=function(){this.h||(this.h=!0,this.m.on(_.ke,this.j),this.Nd(this.f,!0))};_.r.stop=function(){this.h=!1;this.m.off(_.ke,this.j)};_.r.Ja=function(){this.next()};
4
+ _.r.next=function(){var a=this,b;return _.I(function(c){b=Math.min(a.a.length-1,a.f+1);return _.x(c,a.Nd(b),0)})};_.r.Te=function(){var a=this,b;return _.I(function(c){b=Math.max(0,a.f-1);return _.x(c,a.Nd(b),0)})};
5
+ _.r.Nd=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&&LA(c,a))||!b&&c.f===a)return e["return"]();c.f=a;return(d=c.Vb())&&!1===d.skippable?e["return"]():d?_.x(e,c.l(d),3):e.C(0)}if(4!=e.a)return _.x(e,c.m.open(d.configuration),4);c.trigger(new _.R(_.wf,{item:d}));_.z(e)})};_.r.append=function(a){this.a.push(a);KA(this)};_.r.Ri=function(a,b){if(0<=b&&b<=this.a.length){var c=this.Vb();this.a.splice(b,0,a);c&&(this.f=this.a.indexOf(c));KA(this)}};
6
+ _.r.remove=function(a){if(0<this.a.length&&LA(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);KA(this)}};_.r.clear=function(){this.stop();this.f=0;this.a=[];this.h=!1;KA(this)};_.J("clpp.Playlist",JA);JA.prototype.clear=JA.prototype.clear;JA.prototype.remove=JA.prototype.remove;JA.prototype.insert=JA.prototype.Ri;JA.prototype.append=JA.prototype.append;JA.prototype.goTo=JA.prototype.Nd;JA.prototype.previous=JA.prototype.Te;JA.prototype.next=JA.prototype.next;
7
+ JA.prototype.onEnded=JA.prototype.Ja;JA.prototype.stop=JA.prototype.stop;JA.prototype.start=JA.prototype.start;JA.prototype.isStarted=JA.prototype.Og;JA.prototype.getUpcoming=JA.prototype.Mi;JA.prototype.getCurrent=JA.prototype.Vb;JA.prototype.getQueue=JA.prototype.ze;JA.prototype.getPosition=JA.prototype.getPosition;JA.prototype.off=JA.prototype.off;JA.prototype.one=JA.prototype.one;JA.prototype.on=JA.prototype.on;};
8
8
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
9
9
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
10
10
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.simid.js CHANGED
@@ -1,20 +1,20 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var nA="No surface found. Can not attach frame!",oA="SIMID:Media:timeupdate",pA="Starting creative",uA=function(a,b){var c=this;this.f=a;this.w=b;this.h="";this.l=0;this.j=new Map;this.a=document.createElement("iframe");this.a.style.opacity="0";var d=this.w.style;d&&d.className?this.a.classList.add(d.className):(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=
3
- _.te);this.a.classList.add(_.pd);this.o=function(e){if(e.source===c.a.contentWindow&&(e=(e=e.data)?typeof e===_.jg?JSON.parse(e):e:null))if(e.type)switch(c.g.info("Received message ["+e.messageId+"] '"+e.type+"':",e.args),e.type){case "createSession":qA(c,e);break;case "resolve":e=e.args;var f=c.j.get(e.messageId);f&&f.resolve(e);break;case "reject":e=e.args;(f=c.j.get(e.messageId))&&f.reject(e);break;case "SIMID:Creative:requestResize":f=c.f;var g=e.args;f.g.info("Creative requested resize",g);if(f.m&&
4
- f.m.getSurface()&&f.m.getSurface().getMedia()&&g.mediaDimensions){f.h?f.m.getSurface().getMedia().style.transition="":(f.m.getSurface().getMedia().style.transition="left .5s, top .5s,width .5s, height .5s",f.h=!0);var k=rA(f,g.mediaDimensions);f.m.getSurface().getMedia().style.left=k.left;f.m.getSurface().getMedia().style.top=k.top;f.m.getSurface().getMedia().style.width=k.width;f.m.getSurface().getMedia().style.height=k.height}g.creativeDimensions&&(g=rA(f,g.creativeDimensions),f.a.a.style.left=
5
- g.left,f.a.a.style.top=g.top,f.a.a.style.width=g.width,f.a.a.style.height=g.height);sA(c,e)}else c.g.warn("WARNING: received message without 'type' property")};this.g=new _.L("clpp.simid.SimidPlayer");tA(this.f,this)},xA=function(a){var b=vA(a,"SIMID:Player:startCreative",void 0);wA(a,b).then(function(){var c=a.f;c.g.info(pA);c.m.trigger(new _.Q(_.ag));a.a.style.opacity="1"})["catch"](function(c){a.unload();a.f.g.error("Error while starting creative",c)})},qA=function(a,b){var c;_.I(function(d){if(1==
6
- d.a){a.h=b.sessionId;sA(a,b);_.F(d,2);var e=a.f;var f=e.getSurface(),g=e.getContainer();e={environmentData:{videoDimensions:{x:0,y:0,height:g.clientHeight,width:g.clientWidth},creativeDimensions:{x:0,y:0,height:g.clientHeight,width:g.clientWidth},fullscreen:f.isFullscreen(),fullscreenAllowed:!0,variableDurationAllowed:!1,skippableState:"notSkippable",version:"1.1",skipoffset:"",siteUrl:window.location.toString(),appId:"",useragent:"",deviceId:"",muted:e.m.isMuted()||!1,volume:e.m.getVolume()||0,navigationSupport:"adHandles",
7
- closeButtonSupport:"adHandles",nonlinearDuration:e.f.duration},creativeData:{adParameters:e.f.adParameters||"",clickThruUri:"",clickThruUrl:""}};e=vA(a,"SIMID:Player:init",e);e=wA(a,e);return _.x(d,e,4)}if(2!=d.a)return a.g.info("Player Init acknowledged"),a.f.g.info("SIMID Player initialized"),_.G(d,0);c=_.H(d);a.g.error("Error while initializing",c);a.f.g.error("Error while initializing SIMID player: ",c);a.unload();_.z(d)})},vA=function(a,b,c){return{type:b,sessionId:a.h,messageId:a.l++,timestamp:Date.now(),
8
- args:c}},yA=function(a,b){a.h?(b.type!==oA&&a.g.info("Posting message ["+b.messageId+"] '"+b.type+"':",b.args),a.a.contentWindow&&a.a.contentWindow.postMessage(JSON.stringify(b),"*")):a.g.warn("WARNING: no session available to send message '"+b.type+"'")},sA=function(a,b){yA(a,vA(a,"resolve",{messageId:b.messageId,value:void 0}))},wA=function(a,b){return new Promise(function(c,d){new zA(a.j,c,d,b);yA(a,b)})},zA=function(a,b,c,d){var e=this;var f=void 0===f?-1:f;this.f=a;this.l=b;this.j=c;this.h=d;
9
- this.a=null;this.f.set(d.messageId,this);0<=f&&(this.a=setTimeout(function(){e.resolve()},f))},AA=function(){this.g=new _.L("clpp.simid.Plugin");this.h=this.a=this.m=null;this.l=[];this.j=null;this.w=this.Cl.bind(this);this.f=null;this.o=!1},BA=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=vA(d,"SIMID:Player:resize",
10
- e);yA(d,e)}})},CA=function(a){this.m=a;this.a=null;this.g=new _.L("clpp.simid.Loader");this.h=!1;this.f=null},rA=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+"%"}},tA=function(a,b){a.g.info("SIMID Session created");a.a=b},DA=function(a){a.g.info("Stopping creative");a.m.getSurface().getMedia().style.transition=".5s";setTimeout(function(){a.m.getSurface().getMedia().style.transition=""},
11
- 500);a.m.getSurface().getMedia().style.left="";a.m.getSurface().getMedia().style.top="";a.m.getSurface().getMedia().style.width="";a.m.getSurface().getMedia().style.height="";a.a.a.style.left="";a.a.a.style.top="";a.a.a.style.width="";a.a.a.style.height="";a.h=!1;a.m.trigger(new _.Q(_.bg))},EA=function(){};
12
- uA.prototype.load=function(a){window.addEventListener(_.Ne,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)};uA.prototype.unload=function(){DA(this.f);this.h=this.a.src="";this.l=0;this.a.style.opacity="0";window.removeEventListener(_.Ne,this.o);this.a.parentElement&&this.a.parentElement.removeChild(this.a)};
13
- zA.prototype.resolve=function(a){null!==this.a&&(clearTimeout(this.a),this.a=null);this.f["delete"](this.h.messageId);this.l(a)};zA.prototype.reject=function(a){null!==this.a&&(clearTimeout(this.a),this.a=null);this.f["delete"](this.h.messageId);this.j(a)};_.w(AA,_.Yv);_.r=AA.prototype;_.r.id=function(){return"simid"};_.r.onPlayerCreated=function(a){this.g.info("New player created");this.a&&(this.a.unload(),this.a=null);this.m=a;this.h&&this.h.release();this.h=new CA(a)};
14
- _.r.onContentWillLoad=function(a){var b=a.getConfiguration();if(b.simid&&b.simid.creatives&&0!==b.simid.creatives.length){this.l=b.simid.creatives;this.g.info("Setting up SIMID plugin for "+this.l.length+" creatives");var c=this.m.getSurface();c?(this.g.info("Creating new session"),this.a=new uA(this.h,b.simid),b=c.getContainer(),this.j=BA(this,b,c),this.j.observe(b),a.on(_.xg,this.w)):this.g.warn(nA)}};
15
- _.r.Cl=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&&(xA(this.a),this.o=!0,this.g.info(pA)),c&&(c=this.a,yA(c,vA(c,oA,{currentTime:a-b}))))):((a=this.m.getSurface())||this.g.warn(nA),a=a.getContainer(),this.f=b,this.o=!1,this.g.info("Loading session"),this.h.f=
16
- b,this.a.load(a)):this.f&&(this.a.unload(),this.f=null,this.o=!1)};_.r.onPlayerWillRelease=function(a){_.Yv.prototype.onPlayerWillRelease.call(this,a);this.m.getSurface()&&(this.j&&(this.j.disconnect(),this.j=null),a.off(_.xg,this.w),this.f&&(this.a.unload(),this.f=this.h.f=null))};_.r=CA.prototype;_.r.release=function(){this.g.info("Releasing loader")};
17
- _.r.getContainer=function(){var a=this.getSurface().getContainer();if(!a)throw this.g.error("No player container found. Can not create SIMID init data"),new _.N(1,10,10100,"No player container found");return a};_.r.getSurface=function(){var a=this.m.getSurface();if(!a)throw this.g.error("No player surface found. Can not create SIMID init data"),new _.N(1,10,10100,"No surface");return a};_.r.Li=function(){return this.a};_.r.url=function(){return this.f?this.f.url:""};EA.prototype.create=function(){return new AA};_.Yo(new EA);};
2
+ var f=function(window){var rA="No surface found. Can not attach frame!",sA="SIMID:Media:timeupdate",tA="Starting creative",yA=function(a,b){var c=this;this.f=a;this.w=b;this.h="";this.l=0;this.j=new Map;this.a=document.createElement("iframe");this.a.style.opacity="0";var d=this.w.style;d&&d.className?this.a.classList.add(d.className):(this.a.style.border=_.Se,this.a.style.backgroundColor="transparent",this.a.style.transition="opacity .5s",this.a.style.transitionDelay=".5s",this.a.style.pointerEvents=_.Se,this.a.style.overflow=
3
+ _.re);this.a.classList.add(_.qd);this.o=function(e){if(e.source===c.a.contentWindow&&(e=(e=e.data)?typeof e===_.hg?JSON.parse(e):e:null))if(e.type)switch(c.g.info("Received message ["+e.messageId+"] '"+e.type+"':",e.args),e.type){case "createSession":uA(c,e);break;case "resolve":e=e.args;var f=c.j.get(e.messageId);f&&f.resolve(e);break;case "reject":e=e.args;(f=c.j.get(e.messageId))&&f.reject(e);break;case "SIMID:Creative:requestResize":f=c.f;var g=e.args;f.g.info("Creative requested resize",g);if(f.m&&
4
+ f.m.getSurface()&&f.m.getSurface().getMedia()&&g.mediaDimensions){f.h?f.m.getSurface().getMedia().style.transition="":(f.m.getSurface().getMedia().style.transition="left .5s, top .5s,width .5s, height .5s",f.h=!0);var k=vA(f,g.mediaDimensions);f.m.getSurface().getMedia().style.left=k.left;f.m.getSurface().getMedia().style.top=k.top;f.m.getSurface().getMedia().style.width=k.width;f.m.getSurface().getMedia().style.height=k.height}g.creativeDimensions&&(g=vA(f,g.creativeDimensions),f.a.a.style.left=
5
+ g.left,f.a.a.style.top=g.top,f.a.a.style.width=g.width,f.a.a.style.height=g.height);wA(c,e)}else c.g.warn("WARNING: received message without 'type' property")};this.g=new _.L("clpp.simid.SimidPlayer");xA(this.f,this)},BA=function(a){var b=zA(a,"SIMID:Player:startCreative",void 0);AA(a,b).then(function(){var c=a.f;c.g.info(tA);c.m.trigger(new _.R(_.Zf));a.a.style.opacity="1"})["catch"](function(c){a.unload();a.f.g.error("Error while starting creative",c)})},uA=function(a,b){var c;_.I(function(d){if(1==
6
+ d.a){a.h=b.sessionId;wA(a,b);_.F(d,2);var e=a.f;var f=e.getSurface(),g=e.getContainer();e={environmentData:{videoDimensions:{x:0,y:0,height:g.clientHeight,width:g.clientWidth},creativeDimensions:{x:0,y:0,height:g.clientHeight,width:g.clientWidth},fullscreen:f.isFullscreen(),fullscreenAllowed:!0,variableDurationAllowed:!1,skippableState:"notSkippable",version:"1.1",skipoffset:"",siteUrl:window.location.toString(),appId:"",useragent:"",deviceId:"",muted:e.m.isMuted()||!1,volume:e.m.getVolume()||0,navigationSupport:"adHandles",
7
+ closeButtonSupport:"adHandles",nonlinearDuration:e.f.duration},creativeData:{adParameters:e.f.adParameters||"",clickThruUri:"",clickThruUrl:""}};e=zA(a,"SIMID:Player:init",e);e=AA(a,e);return _.x(d,e,4)}if(2!=d.a)return a.g.info("Player Init acknowledged"),a.f.g.info("SIMID Player initialized"),_.G(d,0);c=_.H(d);a.g.error("Error while initializing",c);a.f.g.error("Error while initializing SIMID player: ",c);a.unload();_.z(d)})},zA=function(a,b,c){return{type:b,sessionId:a.h,messageId:a.l++,timestamp:Date.now(),
8
+ args:c}},CA=function(a,b){a.h?(b.type!==sA&&a.g.info("Posting message ["+b.messageId+"] '"+b.type+"':",b.args),a.a.contentWindow&&a.a.contentWindow.postMessage(JSON.stringify(b),"*")):a.g.warn("WARNING: no session available to send message '"+b.type+"'")},wA=function(a,b){CA(a,zA(a,"resolve",{messageId:b.messageId,value:void 0}))},AA=function(a,b){return new Promise(function(c,d){new DA(a.j,c,d,b);CA(a,b)})},DA=function(a,b,c,d){var e=this;var f=void 0===f?-1:f;this.f=a;this.l=b;this.j=c;this.h=d;
9
+ this.a=null;this.f.set(d.messageId,this);0<=f&&(this.a=setTimeout(function(){e.resolve()},f))},EA=function(){this.g=new _.L("clpp.simid.Plugin");this.h=this.a=this.m=null;this.l=[];this.j=null;this.w=this.Cl.bind(this);this.f=null;this.o=!1},FA=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=zA(d,"SIMID:Player:resize",
10
+ e);CA(d,e)}})},GA=function(a){this.m=a;this.a=null;this.g=new _.L("clpp.simid.Loader");this.h=!1;this.f=null},vA=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+"%"}},xA=function(a,b){a.g.info("SIMID Session created");a.a=b},HA=function(a){a.g.info("Stopping creative");a.m.getSurface().getMedia().style.transition=".5s";setTimeout(function(){a.m.getSurface().getMedia().style.transition=""},
11
+ 500);a.m.getSurface().getMedia().style.left="";a.m.getSurface().getMedia().style.top="";a.m.getSurface().getMedia().style.width="";a.m.getSurface().getMedia().style.height="";a.a.a.style.left="";a.a.a.style.top="";a.a.a.style.width="";a.a.a.style.height="";a.h=!1;a.m.trigger(new _.R(_.$f))},IA=function(){};
12
+ yA.prototype.load=function(a){window.addEventListener(_.Ke,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)};yA.prototype.unload=function(){HA(this.f);this.h=this.a.src="";this.l=0;this.a.style.opacity="0";window.removeEventListener(_.Ke,this.o);this.a.parentElement&&this.a.parentElement.removeChild(this.a)};
13
+ DA.prototype.resolve=function(a){null!==this.a&&(clearTimeout(this.a),this.a=null);this.f["delete"](this.h.messageId);this.l(a)};DA.prototype.reject=function(a){null!==this.a&&(clearTimeout(this.a),this.a=null);this.f["delete"](this.h.messageId);this.j(a)};_.w(EA,_.hw);_.r=EA.prototype;_.r.id=function(){return"simid"};_.r.onPlayerCreated=function(a){this.g.info("New player created");this.a&&(this.a.unload(),this.a=null);this.m=a;this.h&&this.h.release();this.h=new GA(a)};
14
+ _.r.onContentWillLoad=function(a){var b=a.getConfiguration();if(b.simid&&b.simid.creatives&&0!==b.simid.creatives.length){this.l=b.simid.creatives;this.g.info("Setting up SIMID plugin for "+this.l.length+" creatives");var c=this.m.getSurface();c?(this.g.info("Creating new session"),this.a=new yA(this.h,b.simid),b=c.getContainer(),this.j=FA(this,b,c),this.j.observe(b),a.on(_.ug,this.w)):this.g.warn(rA)}};
15
+ _.r.Cl=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&&(BA(this.a),this.o=!0,this.g.info(tA)),c&&(c=this.a,CA(c,zA(c,sA,{currentTime:a-b}))))):((a=this.m.getSurface())||this.g.warn(rA),a=a.getContainer(),this.f=b,this.o=!1,this.g.info("Loading session"),this.h.f=
16
+ b,this.a.load(a)):this.f&&(this.a.unload(),this.f=null,this.o=!1)};_.r.onPlayerWillRelease=function(a){_.hw.prototype.onPlayerWillRelease.call(this,a);this.m.getSurface()&&(this.j&&(this.j.disconnect(),this.j=null),a.off(_.ug,this.w),this.f&&(this.a.unload(),this.f=this.h.f=null))};_.r=GA.prototype;_.r.release=function(){this.g.info("Releasing loader")};
17
+ _.r.getContainer=function(){var a=this.getSurface().getContainer();if(!a)throw this.g.error("No player container found. Can not create SIMID init data"),new _.O(1,10,10100,"No player container found");return a};_.r.getSurface=function(){var a=this.m.getSurface();if(!a)throw this.g.error("No player surface found. Can not create SIMID init data"),new _.O(1,10,10100,"No surface");return a};_.r.Ki=function(){return this.a};_.r.url=function(){return this.f?this.f.url:""};IA.prototype.create=function(){return new EA};_.eu(new IA);};
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));}