@castlabs/prestoplay 6.32.0 → 6.33.0-beta.1

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 +29 -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 -127
  6. package/cjs/cl.conviva.js +32 -32
  7. package/cjs/cl.core.js +620 -625
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +101 -101
  10. package/cjs/cl.externs.js +45 -41
  11. package/cjs/cl.freewheel.js +25 -25
  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 +359 -352
  18. package/cjs/cl.muxdata.js +14 -14
  19. package/cjs/cl.onboard.js +4 -4
  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 +12 -12
  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 +35 -35
  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 +101 -102
  37. package/cl.conviva.js +27 -27
  38. package/cl.core.js +497 -503
  39. package/cl.crypto.js +9 -9
  40. package/cl.dash.js +89 -89
  41. package/cl.externs.js +50 -42
  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 +305 -303
  49. package/cl.muxdata.js +13 -13
  50. package/cl.onboard.js +5 -4
  51. package/cl.persistent.js +11 -11
  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 +30 -30
  64. package/package.json +1 -1
  65. package/typings.d.ts +32 -24
package/cjs/cl.vimond.js CHANGED
@@ -1,16 +1,16 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var gy="Registering listeners",hy="clpp.vimond.VimondPlugin",iy=function(a,b,c,d,e){this.G=a;this.H=b;this.I=c;this.m=d;this.D=e;this.a=new _.xi;this.l=!0;this.h=this.j=this.A=!1;this.B=null;this.f=new _.hj(this.wi.bind(this));this.g=new _.M("clpp.vimond.VimondDispatcher");this.o=this.w=0;this.m&&this.a&&(this.g.debug(gy),this.a.on(this.m,_.kg,this.Ql.bind(this)),this.a.on(this.m,_.Bg,this.Rl.bind(this)),this.a.on(this.m,_.ic,this.Ol.bind(this)),this.a.on(this.m,_.jc,this.Pl.bind(this)))},jy=function(a,
3
- b){a.m.trigger(new _.Q(_.Yg,{detail:b}))},ky=function(a,b,c){b&&(a.A=!0,a.f.stop());a.m.onError(new _.O(b?_.P:1,9,9201,c))},ly=function(a,b,c,d,e){this.l=a;this.o=c;this.h=b;this.a=d;this.j=e;this.g=new _.M("clpp.vimond.VimondService");this.f=0},my=function(a){this.m=a;this.a=new _.xi;this.g=new _.M("clpp.vimond.VimondAdapter");this.f=this.h=!1;this.m&&this.a&&(this.g.debug(gy),this.a.on(this.m,_.Sf,this.o.bind(this)),this.a.on(this.m,_.ic,this.j.bind(this)),this.a.on(this.m,_.jc,this.l.bind(this)))},
4
- ny=function(a,b){var c=a.m.getState();if(1===b)return["str-start",_.Af];if(a.h)return[_.pe,_.lf];if(5===c)return[_.pe,null];if(c===_.Bo)return[_.re,_.lf];var d=_.lf;if(2===c||3===c||a.f)d=_.Af;return["period",d]},oy=function(){this.a=!1;this.g=new _.M(hy);this.j=this.h=this.f=null},py=function(){};_.r=iy.prototype;_.r.Rl=function(){this.h||(this.h=1<Math.abs(this.w-this.m.getPosition()));this.w=this.m.getPosition()};_.r.Ol=function(){this.g.debug("Ad break started");this.j=!0};
5
- _.r.Pl=function(){this.g.debug("Ad break stopped");this.j=!1};
6
- _.r.Ql=function(a){var b=this,c,d,e,f,g;return _.I(function(k){if(1==k.a){c=a.detail;d=_.pu;e=c.currentState;f=c.previousState;b.g.debug("State changed, prev: "+f+" curr: "+e);if(b.A||b.j)return k["return"]();if(e===b.B&&!b.h)return b.g.debug("Ignore transition"),k["return"]();if(b.l&&e!==d.PLAYING)return k["return"]();if(b.h&&[d.PAUSED,d.BUFFERING].includes(e))return b.g.debug("Seeking"),k["return"]();b.h&&e===d.PLAYING&&(b.g.debug("Seeked"),b.h=!1);g=[d.PLAYING,d.PAUSED,d.ERROR,d.ENDED];if(!g.includes(e))return k.C(0);
7
- b.B=e;return _.x(k,b.wi(),3)}e===d.ENDED&&b.f.stop();_.A(k)})};
8
- _.r.wi=function(){var a=this,b,c,d,e,f,g;return _.I(function(k){if(1==k.a){var l=Math.floor(Date.now()/1E3);0<a.o&&a.g.debug("Last event was "+(l-a.o)+" seconds ago");a.o=l;a.f.stop();a.f.ia(a.l?10:a.G);a.l=!1;_.F(k,2);return _.x(k,a.D.fireEvent(),4)}if(2!=k.a)return b=k.f,jy(a,b),_.G(k,0);d=c=_.H(k);e=d.code;f=d.data;g=[1002,1003];g.includes(e)?(a.g.debug("Unreachable service"),jy(a,f),ky(a,a.H,f)):1001===e?(a.g.debug("Generic service error"),jy(a,f),ky(a,a.I,f)):a.g.error(c.toString());_.A(k)})};ly.prototype.fireEvent=function(){this.f++;var a=_.N.ta(this.o);a.client.buildName=_.ya;a.client.buildVersion=_.ia;var b=a.client,c=this.a.m.getDrmInfo();b.drm=c?c.keySystem:"";a.client.pageUrl=document.location.href;a.client.streamUrl=this.a.m.$a().url;a.client.userAgent=navigator.userAgent;a.client.videoFormat=this.a.m.$a().type||"";b=a.client;c=this.a.m.$a();c=((new _.vn(c.url)).scheme||"").replace(":","");b.videoProtocol=c;b=ny(this.a,this.f);a.client.playerEvent=b[0]||"";a.client.playerState=
9
- b[1]||"";a.progress.vod&&(a.progress.vod.position=this.a.getPosition());if(b=a.progress.live){c=this.a;var d=c.m.getPresentationStartTime()||0;c=Math.floor(d+c.m.getPosition());c=(new Date(1E3*c)).toISOString();b.position=c;d=this.a;c=d.m.getPosition();d=d.m.getSeekRange().end;b.onLiveEdge=30>Math.abs(d-c);typeof b.liveResumePossible!==_.dd&&(b.liveResumePossible=!0)}a.progress.eventNumber=this.f;a.timestamp=(new Date).toISOString();this.g.debug("Fire an event");b=_.Zk(this.l);b.method=_.rb;b.contentType=
10
- "application/json";b.headers.Authorization="Bearer "+this.h;b.body=_.R.Xd(JSON.stringify(a));return this.j.fetch(b).U};ly.prototype.yh=function(a){this.h=a};my.prototype.getPosition=function(){return Math.floor(this.m.getPosition())};my.prototype.o=function(){this.h=!0};my.prototype.j=function(){this.f=!0};my.prototype.l=function(){this.f=!1};_.w(oy,_.cw);_.r=oy.prototype;_.r.onPlayerCreated=function(){};
11
- _.r.onContentWillLoad=function(a){var b=a.getConfiguration();(this.a=!_.N.R(b.vimond)&&typeof b.vimond===_.$e)?a.namespace()===_.yd&&(this.a=!1,this.g.info("Vimond does not report when casting.")):this.g.debug("Vimond plugin is loaded but not configured. Will do nothing.");if(this.a){b=a.getConfiguration().vimond;for(var c=_.v(["authToken","playerEventRequest"]),d=c.next();!d.done;d=c.next())if(d=d.value,!b[d]){this.g.warn(d+" key is missing");a.onError(new _.O(1,9,9200));return}this.g.debug("Configuration is valid");
12
- c=b.failIfUnreachable;typeof c!==_.dd&&(c=!0);d=b.failOnError;typeof d!==_.dd&&(d=!0);this.f=new my(a);this.h=new ly(b.playerEventRequest.uri,b.authToken,b.playerEventRequest.body,this.f,a.getNetworkEngine());this.j=new iy(b.playerEventRequest.eventInterval,c,d,a,this.h)}};_.r.onPlayerWillRelease=function(){if(this.a){if(this.f){var a=this.f;a.g.debug(_.Qb);_.Ai(a.a)}this.j&&(a=this.j,a.g.debug(_.Qb),_.Ai(a.a),a.f.stop());this.j=this.h=this.f=null}};_.r.onPlayerWillDestroy=function(){};_.r.id=function(){return"vimond"};
13
- _.r.yh=function(a){this.a&&this.h&&this.h.yh(a)};_.J(hy,oy);oy.prototype.updateAuthToken=oy.prototype.yh;oy.Id="vimond";py.prototype.create=function(){return new oy};_.bp(new py);};
2
+ var f=function(window){var Mx="Registering listeners",Nx="clpp.vimond.VimondPlugin",Ox=function(a,b,c,d,e){this.G=a;this.H=b;this.I=c;this.m=d;this.D=e;this.a=new _.ti;this.l=!0;this.h=this.j=this.A=!1;this.B=null;this.f=new _.dj(this.ri.bind(this));this.g=new _.L("clpp.vimond.VimondDispatcher");this.o=this.w=0;this.m&&this.a&&(this.g.debug(Mx),this.a.on(this.m,_.fg,this.Pl.bind(this)),this.a.on(this.m,_.wg,this.Ql.bind(this)),this.a.on(this.m,_.hc,this.Nl.bind(this)),this.a.on(this.m,_.ic,this.Ol.bind(this)))},Px=function(a,
3
+ b){a.m.trigger(new _.Q(_.Tg,{detail:b}))},Qx=function(a,b,c){b&&(a.A=!0,a.f.stop());a.m.onError(new _.N(b?_.P:1,9,9201,c))},Rx=function(a,b,c,d,e){this.l=a;this.o=c;this.h=b;this.a=d;this.j=e;this.g=new _.L("clpp.vimond.VimondService");this.f=0},Sx=function(a){this.m=a;this.a=new _.ti;this.g=new _.L("clpp.vimond.VimondAdapter");this.f=this.h=!1;this.m&&this.a&&(this.g.debug(Mx),this.a.on(this.m,_.Nf,this.o.bind(this)),this.a.on(this.m,_.hc,this.j.bind(this)),this.a.on(this.m,_.ic,this.l.bind(this)))},
4
+ Tx=function(a,b){var c=a.m.getState();if(1===b)return["str-start",_.vf];if(a.h)return[_.je,_.ff];if(5===c)return[_.je,null];if(c===_.so)return[_.me,_.ff];var d=_.ff;if(2===c||3===c||a.f)d=_.vf;return["period",d]},Ux=function(){this.a=!1;this.g=new _.L(Nx);this.j=this.h=this.f=null},Vx=function(){};_.r=Ox.prototype;_.r.Ql=function(){this.h||(this.h=1<Math.abs(this.w-this.m.getPosition()));this.w=this.m.getPosition()};_.r.Nl=function(){this.g.debug("Ad break started");this.j=!0};
5
+ _.r.Ol=function(){this.g.debug("Ad break stopped");this.j=!1};
6
+ _.r.Pl=function(a){var b=this,c,d,e,f,g;return _.I(function(k){if(1==k.a){c=a.detail;d=_.cp;e=c.currentState;f=c.previousState;b.g.debug("State changed, prev: "+f+" curr: "+e);if(b.A||b.j)return k["return"]();if(e===b.B&&!b.h)return b.g.debug("Ignore transition"),k["return"]();if(b.l&&e!==d.PLAYING)return k["return"]();if(b.h&&[d.PAUSED,d.BUFFERING].includes(e))return b.g.debug("Seeking"),k["return"]();b.h&&e===d.PLAYING&&(b.g.debug("Seeked"),b.h=!1);g=[d.PLAYING,d.PAUSED,d.ERROR,d.ENDED];if(!g.includes(e))return k.C(0);
7
+ b.B=e;return _.x(k,b.ri(),3)}e===d.ENDED&&b.f.stop();_.z(k)})};
8
+ _.r.ri=function(){var a=this,b,c,d,e,f,g;return _.I(function(k){if(1==k.a){var l=Math.floor(Date.now()/1E3);0<a.o&&a.g.debug("Last event was "+(l-a.o)+" seconds ago");a.o=l;a.f.stop();a.f.ia(a.l?10:a.G);a.l=!1;_.F(k,2);return _.x(k,a.D.fireEvent(),4)}if(2!=k.a)return b=k.f,Px(a,b),_.G(k,0);d=c=_.H(k);e=d.code;f=d.data;g=[1002,1003];g.includes(e)?(a.g.debug("Unreachable service"),Px(a,f),Qx(a,a.H,f)):1001===e?(a.g.debug("Generic service error"),Px(a,f),Qx(a,a.I,f)):a.g.error(c.toString());_.z(k)})};Rx.prototype.fireEvent=function(){this.f++;var a=_.M.ta(this.o);a.client.buildName=_.Ba;a.client.buildVersion=_.ja;var b=a.client,c=this.a.m.getDrmInfo();b.drm=c?c.keySystem:"";a.client.pageUrl=document.location.href;a.client.streamUrl=this.a.m.$a().url;a.client.userAgent=navigator.userAgent;a.client.videoFormat=this.a.m.$a().type||"";b=a.client;c=this.a.m.$a();c=((new _.kn(c.url)).scheme||"").replace(":","");b.videoProtocol=c;b=Tx(this.a,this.f);a.client.playerEvent=b[0]||"";a.client.playerState=
9
+ b[1]||"";a.progress.vod&&(a.progress.vod.position=this.a.getPosition());if(b=a.progress.live){c=this.a;var d=c.m.getPresentationStartTime()||0;c=Math.floor(d+c.m.getPosition());c=(new Date(1E3*c)).toISOString();b.position=c;d=this.a;c=d.m.getPosition();d=d.m.getSeekRange().end;b.onLiveEdge=30>Math.abs(d-c);typeof b.liveResumePossible!==_.cd&&(b.liveResumePossible=!0)}a.progress.eventNumber=this.f;a.timestamp=(new Date).toISOString();this.g.debug("Fire an event");b=_.Uk(this.l);b.method=_.pb;b.contentType=
10
+ "application/json";b.headers.Authorization="Bearer "+this.h;b.body=_.R.kd(JSON.stringify(a));return this.j.fetch(b).U};Rx.prototype.yh=function(a){this.h=a};Sx.prototype.getPosition=function(){return Math.floor(this.m.getPosition())};Sx.prototype.o=function(){this.h=!0};Sx.prototype.j=function(){this.f=!0};Sx.prototype.l=function(){this.f=!1};_.w(Ux,_.Pv);_.r=Ux.prototype;_.r.onPlayerCreated=function(){};
11
+ _.r.onContentWillLoad=function(a){var b=a.getConfiguration();(this.a=!_.M.R(b.vimond)&&typeof b.vimond===_.Ve)?a.namespace()===_.xd&&(this.a=!1,this.g.info("Vimond does not report when casting.")):this.g.debug("Vimond plugin is loaded but not configured. Will do nothing.");if(this.a){b=a.getConfiguration().vimond;for(var c=_.v(["authToken","playerEventRequest"]),d=c.next();!d.done;d=c.next())if(d=d.value,!b[d]){this.g.warn(d+" key is missing");a.onError(new _.N(1,9,9200));return}this.g.debug("Configuration is valid");
12
+ c=b.failIfUnreachable;typeof c!==_.cd&&(c=!0);d=b.failOnError;typeof d!==_.cd&&(d=!0);this.f=new Sx(a);this.h=new Rx(b.playerEventRequest.uri,b.authToken,b.playerEventRequest.body,this.f,a.getNetworkEngine());this.j=new Ox(b.playerEventRequest.eventInterval,c,d,a,this.h)}};_.r.onPlayerWillRelease=function(){if(this.a){if(this.f){var a=this.f;a.g.debug(_.Pb);_.wi(a.a)}this.j&&(a=this.j,a.g.debug(_.Pb),_.wi(a.a),a.f.stop());this.j=this.h=this.f=null}};_.r.onPlayerWillDestroy=function(){};_.r.id=function(){return"vimond"};
13
+ _.r.yh=function(a){this.a&&this.h&&this.h.yh(a)};_.K(Nx,Ux);Ux.prototype.updateAuthToken=Ux.prototype.yh;Ux.Id="vimond";Vx.prototype.create=function(){return new Ux};_.To(new Vx);};
14
14
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
15
15
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
16
16
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.vr.js CHANGED
@@ -1,24 +1,24 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var Mx="touchmove",Nx="touchstart",Ox=function(a,b,c,d){this.x=a||0;this.y=b||0;this.a=c||0;this.f=d||1},Px=function(a,b){var c=a.x,d=a.y,e=a.a,f=a.f;b.set(1-2*(d*d+e*e),2*(c*d-e*f),2*(c*e+d*f),0,2*(c*d+e*f),1-2*(c*c+e*e),2*(d*e-c*f),0,2*(c*e-d*f),2*(d*e+c*f),1-2*(c*c+d*d),0,0,0,0,1)},Qx=function(a,b,c){c*=.5;var d=Math.sqrt(a*a+b*b),e=Math.sin(c);return new Ox(a/d*e,b/d*e,0/d*e,Math.cos(c))},Rx=function(a,b,c){this.x=a||0;this.y=b||0;this.a=c||0},Sx=function(a,b){isFinite(b)?(a.x*=b,a.y*=b,a.a*=
3
- b):(a.x=0,a.y=0,a.a=0)},Tx=function(a,b){return a.x*b.x+a.y*b.y+a.a*b.a},Ux=function(a,b,c){var d=b.x,e=b.y;b=b.a;var f=c.x,g=c.y;c=c.a;a.x=e*c-b*g;a.y=b*f-d*c;a.a=d*g-e*f;return a},Vx=function(){this.a=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])},Wx=function(a,b,c){b=b.a;c=c.a;var d=a.a,e=0;do d[4*e]=b[4*e]*c[0]+b[4*e+1]*c[4]+b[4*e+2]*c[8]+b[4*e+3]*c[12],d[4*e+1]=b[4*e]*c[1]+b[4*e+1]*c[5]+b[4*e+2]*c[9]+b[4*e+3]*c[13],d[4*e+2]=b[4*e]*c[2]+b[4*e+1]*c[6]+b[4*e+2]*c[10]+b[4*e+3]*c[14],d[4*e+
4
- 3]=b[4*e]*c[3]+b[4*e+1]*c[7]+b[4*e+2]*c[11]+b[4*e+3]*c[15];while(4>++e);return a},Xx=function(a){var b=new Rx(0,0,0),c=new Rx(0,0,1),d=new Rx,e=new Rx,f=new Rx;a=a.a;var g=new Rx(0,1,0);f.x=b.x-g.x;f.y=b.y-g.y;f.a=b.a-g.a;g=f.length();Sx(f,1/g);c=Ux(d,c,f);g=c.length();Sx(c,1/g);Ux(e,f,d);a[0]=d.x;a[1]=d.y;a[2]=d.a;a[3]=-Tx(d,b);a[4]=e.x;a[5]=e.y;a[6]=e.a;a[7]=-Tx(e,b);a[8]=f.x;a[9]=f.y;a[10]=f.a;a[11]=-Tx(f,b);a[12]=0;a[13]=0;a[14]=0;a[15]=1},Zx=function(a){this.a=a;this.f=a.createProgram();this.l=
5
- Yx(this,!1,"uniform highp mat4 Mvpm;\nattribute highp vec4 aPosition;\nattribute highp vec2 aTexCoord;\nvarying highp vec2 oTexCoord;\nvoid main()\n{\n gl_Position \x3d Mvpm * aPosition;\n oTexCoord \x3d aTexCoord;\n}\n");this.j=Yx(this,!0,"precision highp float;\nuniform sampler2D Texture0;\nvarying highp vec2 oTexCoord;\nvoid main()\n{\n gl_FragColor \x3d texture2D(Texture0, oTexCoord);\n gl_FragColor.w \x3d 1.0;\n}\n");a.attachShader(this.f,this.l);a.attachShader(this.f,this.j);a.bindAttribLocation(this.f,
6
- 0,"aPosition");a.bindAttribLocation(this.f,1,"aTexCoord");a.linkProgram(this.f);if(!a.getProgramParameter(this.f,a.LINK_STATUS))throw new _.O(1,9,9004,"Unable to initialize shader");a.useProgram(this.f);this.h=a.getUniformLocation(this.f,"Mvpm");a.uniform1i(a.getUniformLocation(this.f,"Texture0"),0);a.useProgram(null)},Yx=function(a,b,c){b=a.a.createShader(b?a.a.FRAGMENT_SHADER:a.a.VERTEX_SHADER);a.a.shaderSource(b,c);a.a.compileShader(b);if(!a.a.getShaderParameter(b,a.a.COMPILE_STATUS))throw new _.O(1,
7
- 9,9004,"Unable to compile GL shader: "+a.a.getShaderInfoLog(b));return b},$x=function(a){this.a=a;var b=[],c,d;for(d=0;70>=d;d++){var e=3>=d?d/4/64:67<=d?(63+(d-66)/4)/64:(d-3)/64;var f=(e-.5)*Math.PI,g=Math.cos(f);for(c=0;128>=c;c++){var k=c/128,l=(.5+k)*Math.PI*2;128===c?(b.push(b[645*d]),b.push(b[645*d+1]),b.push(b[645*d+2])):(b.push(100*Math.cos(l)*g),b.push(100*Math.sin(l)*g),b.push(100*Math.sin(f)));0===d||70===d?b.push(.5):b.push(1-k);b.push(1-e)}}e=[];for(c=0;128>c;c++)for(d=0;70>d;d++)f=
8
- 5*(129*d+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*d+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*d+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]);this.h=e.length/5;this.f=a.createBuffer();b=new Float32Array(e);a.bindBuffer(a.ARRAY_BUFFER,this.f);a.bufferData(a.ARRAY_BUFFER,b,a.STATIC_DRAW)},ay=function(a,
9
- b){this.a=b;this.f=this.a.createTexture();b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,this.f);b.texImage2D(b.TEXTURE_2D,0,b.RGB,b.RGB,b.UNSIGNED_BYTE,a);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.LINEAR);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.LINEAR);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.bindTexture(b.TEXTURE_2D,null)},by=function(){var a=this;this.o=this.w=this.L=this.J=this.A=
10
- this.ba=this.H=this.f=this.a=this.m=null;this.g=new _.M("clpp.vr");this.I=70;this.X=1;this.P=this.M=!1;this.G=function(){if(a.a&&a.f){a.f.viewport(0,0,a.a.width,a.a.height);var b=a.L.a,c=Math.tan(.5*a.I*Math.PI/180);b[0]=1/(a.a.width/a.a.height*c);b[1]=0;b[2]=0;b[3]=0;b[4]=0;b[5]=1/c;b[6]=0;b[7]=0;b[8]=0;b[9]=0;b[10]=2E3/-1999.9;b[11]=200/-1999.9;b[12]=0;b[13]=0;b[14]=-1;b[15]=1}};this.l=this.j=0;this.h={x:0,y:0};this.T=new Vx;this.W=new Vx;this.ha=new Vx;this.ma=new Vx;this.B=this.Wn.bind(this);
11
- this.D=this.Xn.bind(this);this.K=this.Vn.bind(this)},cy=function(a){var b=Qx(1,0,a.l*Math.PI/180);Px(Qx(0,1,a.j*Math.PI/180),a.T);Px(b,a.W);Xx(a.ha);Wx(a.ma,a.T,a.ha);Wx(a.H,a.W,a.ma)},dy=function(a){a.a&&(a.a.removeEventListener("mousemove",a.B,!1),a.a.removeEventListener(Mx,a.B,!1),a.a.removeEventListener("mouseup",a.D,!1),a.a.removeEventListener("touchend",a.D,!1))},ey=function(){};Rx.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.a*this.a)};Vx.prototype.set=function(a,b,c,d,e,f,g,k,l,m,n,p,q,t,u,y){var B=this.a;B[0]=a;B[4]=b;B[8]=c;B[12]=d;B[1]=e;B[5]=f;B[9]=g;B[13]=k;B[2]=l;B[6]=m;B[10]=n;B[14]=p;B[3]=q;B[7]=t;B[11]=u;B[15]=y;return this};var fy={alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!1,devicePixelRatio:1};_.w(by,_.cw);_.r=by.prototype;_.r.onPlayerCreated=function(a){this.g.info("Player created");this.m=a};
12
- _.r.onContentWillLoad=function(a){var b=a.getConfiguration();if(b.vr&&b.vr.enable){var c=b.vr,d=c.fieldOfView,e=c.sensitivity,f=c.invertHorizontalControl;c=c.invertVerticalControl;if(void 0!==d&&_.N.ya(d))this.I=d;else throw new _.O(1,7,7100,"fieldOfView configuration must be a number");if(void 0!==e&&_.N.ya(e)&&0<e)this.X=e;else throw new _.O(1,7,7100,"sensitivity configuration must be a positive number");this.M=!!f;this.P=!!c;if(a=a.getSurface())if((d=a.getMedia())&&d.tagName.toLowerCase()===_.Tg){this.g.info("Initialize VR Surface");
13
- if(!this.a){this.a=document.createElement("canvas");this.a.style.width="100%";this.f=this.a.getContext("webgl",fy)||this.a.getContext("experimental-webgl",fy);if(!this.f)throw new _.O(1,9,9003,"Unable to create GL context");this.H=new Vx;Xx(this.H);this.ba=new $x(this.f);this.A=new Zx(this.f);this.J=new Vx;this.L=new Vx;this.o=this.w=null;this.a.addEventListener(_.Vf,this.G)}a.addElementToContainer(this.a,!0,!0);a.hideMediaElement();b.vr.attachMouseListener&&(this.a.addEventListener("mousedown",this.K,
14
- !1),this.a.addEventListener(Nx,this.K,!1));this.G();this.Nj()}else this.g.info("No video element found, can not initialize VR plugin");else this.g.info("No surface found, can not initialize VR plugin")}};
15
- _.r.onPlayerWillRelease=function(){this.g.info("Releasing VR plugin resources");this.w&&cancelAnimationFrame(this.w);this.h.x=0;this.l=this.j=this.h.y=0;this.f&&(delete this.f,this.f=null);this.a&&(dy(this),this.a.removeEventListener(_.Vf,this.G),this.a.parentElement.removeChild(this.a),this.a.removeEventListener("mousedown",this.K,!1),delete this.a,this.a=null)};_.r.onPlayerWillDestroy=function(){var a=this;return _.I(function(b){a.m=null;_.A(b)})};_.r.id=function(){return"vr"};
16
- _.r.Nj=function(){if(this.m&&this.f){var a=this.m.getSurface();if(a&&(a=a.getMedia())&&a.tagName.toLowerCase()===_.Tg){this.w=requestAnimationFrame(this.Nj.bind(this));var b=this.f;this.o||a.readyState!==a.HAVE_ENOUGH_DATA||(this.o=new ay(a,b));b.clearColor(0,0,0,1);b.clearDepth(1);b.clearStencil(0);b.enable(b.DEPTH_TEST);b.depthFunc(b.LEQUAL);b.frontFace(b.CCW);b.cullFace(b.BACK);b.disable(b.CULL_FACE);b.enable(b.BLEND);b.blendFunc(b.SRC_ALPHA,b.ONE_MINUS_SRC_ALPHA);b.depthMask(!0);b.clearColor(0,
17
- 0,0,1);b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT);if(this.o){var c=this.A;c.a.useProgram(c.f);c=Wx(this.J,this.L,this.H).a;var d=c[1];c[1]=c[4];c[4]=d;d=c[2];c[2]=c[8];c[8]=d;d=c[6];c[6]=c[9];c[9]=d;d=c[3];c[3]=c[12];c[12]=d;d=c[7];c[7]=c[13];c[13]=d;d=c[11];c[11]=c[14];c[14]=d;b.uniformMatrix4fv(this.A.h,!1,this.J.a);c=this.o;c.a.activeTexture(c.a.TEXTURE0);c.a.bindTexture(c.a.TEXTURE_2D,c.f);b.texImage2D(b.TEXTURE_2D,0,b.RGB,b.RGB,b.UNSIGNED_BYTE,a);a=this.ba;a.a.bindBuffer(a.a.ARRAY_BUFFER,
2
+ var f=function(window){var rx="touchmove",sx="touchstart",tx=function(a,b,c,d){this.x=a||0;this.y=b||0;this.a=c||0;this.f=d||1},ux=function(a,b){var c=a.x,d=a.y,e=a.a,f=a.f;b.set(1-2*(d*d+e*e),2*(c*d-e*f),2*(c*e+d*f),0,2*(c*d+e*f),1-2*(c*c+e*e),2*(d*e-c*f),0,2*(c*e-d*f),2*(d*e+c*f),1-2*(c*c+d*d),0,0,0,0,1)},vx=function(a,b,c){c*=.5;var d=Math.sqrt(a*a+b*b),e=Math.sin(c);return new tx(a/d*e,b/d*e,0/d*e,Math.cos(c))},wx=function(a,b,c){this.x=a||0;this.y=b||0;this.a=c||0},xx=function(a,b){isFinite(b)?(a.x*=b,a.y*=b,a.a*=
3
+ b):(a.x=0,a.y=0,a.a=0)},yx=function(a,b){return a.x*b.x+a.y*b.y+a.a*b.a},zx=function(a,b,c){var d=b.x,e=b.y;b=b.a;var f=c.x,g=c.y;c=c.a;a.x=e*c-b*g;a.y=b*f-d*c;a.a=d*g-e*f;return a},Ax=function(){this.a=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])},Bx=function(a,b,c){b=b.a;c=c.a;var d=a.a,e=0;do d[4*e]=b[4*e]*c[0]+b[4*e+1]*c[4]+b[4*e+2]*c[8]+b[4*e+3]*c[12],d[4*e+1]=b[4*e]*c[1]+b[4*e+1]*c[5]+b[4*e+2]*c[9]+b[4*e+3]*c[13],d[4*e+2]=b[4*e]*c[2]+b[4*e+1]*c[6]+b[4*e+2]*c[10]+b[4*e+3]*c[14],d[4*e+
4
+ 3]=b[4*e]*c[3]+b[4*e+1]*c[7]+b[4*e+2]*c[11]+b[4*e+3]*c[15];while(4>++e);return a},Cx=function(a){var b=new wx(0,0,0),c=new wx(0,0,1),d=new wx,e=new wx,f=new wx;a=a.a;var g=new wx(0,1,0);f.x=b.x-g.x;f.y=b.y-g.y;f.a=b.a-g.a;g=f.length();xx(f,1/g);c=zx(d,c,f);g=c.length();xx(c,1/g);zx(e,f,d);a[0]=d.x;a[1]=d.y;a[2]=d.a;a[3]=-yx(d,b);a[4]=e.x;a[5]=e.y;a[6]=e.a;a[7]=-yx(e,b);a[8]=f.x;a[9]=f.y;a[10]=f.a;a[11]=-yx(f,b);a[12]=0;a[13]=0;a[14]=0;a[15]=1},Ex=function(a){this.a=a;this.f=a.createProgram();this.l=
5
+ Dx(this,!1,"uniform highp mat4 Mvpm;\nattribute highp vec4 aPosition;\nattribute highp vec2 aTexCoord;\nvarying highp vec2 oTexCoord;\nvoid main()\n{\n gl_Position \x3d Mvpm * aPosition;\n oTexCoord \x3d aTexCoord;\n}\n");this.j=Dx(this,!0,"precision highp float;\nuniform sampler2D Texture0;\nvarying highp vec2 oTexCoord;\nvoid main()\n{\n gl_FragColor \x3d texture2D(Texture0, oTexCoord);\n gl_FragColor.w \x3d 1.0;\n}\n");a.attachShader(this.f,this.l);a.attachShader(this.f,this.j);a.bindAttribLocation(this.f,
6
+ 0,"aPosition");a.bindAttribLocation(this.f,1,"aTexCoord");a.linkProgram(this.f);if(!a.getProgramParameter(this.f,a.LINK_STATUS))throw new _.N(1,9,9004,"Unable to initialize shader");a.useProgram(this.f);this.h=a.getUniformLocation(this.f,"Mvpm");a.uniform1i(a.getUniformLocation(this.f,"Texture0"),0);a.useProgram(null)},Dx=function(a,b,c){b=a.a.createShader(b?a.a.FRAGMENT_SHADER:a.a.VERTEX_SHADER);a.a.shaderSource(b,c);a.a.compileShader(b);if(!a.a.getShaderParameter(b,a.a.COMPILE_STATUS))throw new _.N(1,
7
+ 9,9004,"Unable to compile GL shader: "+a.a.getShaderInfoLog(b));return b},Fx=function(a){this.a=a;var b=[],c,d;for(d=0;70>=d;d++){var e=3>=d?d/4/64:67<=d?(63+(d-66)/4)/64:(d-3)/64;var f=(e-.5)*Math.PI,g=Math.cos(f);for(c=0;128>=c;c++){var k=c/128,l=(.5+k)*Math.PI*2;128===c?(b.push(b[645*d]),b.push(b[645*d+1]),b.push(b[645*d+2])):(b.push(100*Math.cos(l)*g),b.push(100*Math.sin(l)*g),b.push(100*Math.sin(f)));0===d||70===d?b.push(.5):b.push(1-k);b.push(1-e)}}e=[];for(c=0;128>c;c++)for(d=0;70>d;d++)f=
8
+ 5*(129*d+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*d+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*d+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]);this.h=e.length/5;this.f=a.createBuffer();b=new Float32Array(e);a.bindBuffer(a.ARRAY_BUFFER,this.f);a.bufferData(a.ARRAY_BUFFER,b,a.STATIC_DRAW)},Gx=function(a,
9
+ b){this.a=b;this.f=this.a.createTexture();b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,this.f);b.texImage2D(b.TEXTURE_2D,0,b.RGB,b.RGB,b.UNSIGNED_BYTE,a);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.LINEAR);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.LINEAR);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.bindTexture(b.TEXTURE_2D,null)},Hx=function(){var a=this;this.o=this.w=this.L=this.J=this.A=
10
+ this.ba=this.H=this.f=this.a=this.m=null;this.g=new _.L("clpp.vr");this.I=70;this.X=1;this.P=this.M=!1;this.G=function(){if(a.a&&a.f){a.f.viewport(0,0,a.a.width,a.a.height);var b=a.L.a,c=Math.tan(.5*a.I*Math.PI/180);b[0]=1/(a.a.width/a.a.height*c);b[1]=0;b[2]=0;b[3]=0;b[4]=0;b[5]=1/c;b[6]=0;b[7]=0;b[8]=0;b[9]=0;b[10]=2E3/-1999.9;b[11]=200/-1999.9;b[12]=0;b[13]=0;b[14]=-1;b[15]=1}};this.l=this.j=0;this.h={x:0,y:0};this.T=new Ax;this.W=new Ax;this.ha=new Ax;this.ma=new Ax;this.B=this.Vn.bind(this);
11
+ this.D=this.Wn.bind(this);this.K=this.Un.bind(this)},Ix=function(a){var b=vx(1,0,a.l*Math.PI/180);ux(vx(0,1,a.j*Math.PI/180),a.T);ux(b,a.W);Cx(a.ha);Bx(a.ma,a.T,a.ha);Bx(a.H,a.W,a.ma)},Jx=function(a){a.a&&(a.a.removeEventListener("mousemove",a.B,!1),a.a.removeEventListener(rx,a.B,!1),a.a.removeEventListener("mouseup",a.D,!1),a.a.removeEventListener("touchend",a.D,!1))},Kx=function(){};wx.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.a*this.a)};Ax.prototype.set=function(a,b,c,d,e,f,g,k,l,m,n,p,q,t,u,y){var A=this.a;A[0]=a;A[4]=b;A[8]=c;A[12]=d;A[1]=e;A[5]=f;A[9]=g;A[13]=k;A[2]=l;A[6]=m;A[10]=n;A[14]=p;A[3]=q;A[7]=t;A[11]=u;A[15]=y;return this};var Lx={alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!1,devicePixelRatio:1};_.w(Hx,_.Pv);_.r=Hx.prototype;_.r.onPlayerCreated=function(a){this.g.info("Player created");this.m=a};
12
+ _.r.onContentWillLoad=function(a){var b=a.getConfiguration();if(b.vr&&b.vr.enable){var c=b.vr,d=c.fieldOfView,e=c.sensitivity,f=c.invertHorizontalControl;c=c.invertVerticalControl;if(void 0!==d&&_.M.ya(d))this.I=d;else throw new _.N(1,7,7100,"fieldOfView configuration must be a number");if(void 0!==e&&_.M.ya(e)&&0<e)this.X=e;else throw new _.N(1,7,7100,"sensitivity configuration must be a positive number");this.M=!!f;this.P=!!c;if(a=a.getSurface())if((d=a.getMedia())&&d.tagName.toLowerCase()===_.Og){this.g.info("Initialize VR Surface");
13
+ if(!this.a){this.a=document.createElement("canvas");this.a.style.width="100%";this.f=this.a.getContext("webgl",Lx)||this.a.getContext("experimental-webgl",Lx);if(!this.f)throw new _.N(1,9,9003,"Unable to create GL context");this.H=new Ax;Cx(this.H);this.ba=new Fx(this.f);this.A=new Ex(this.f);this.J=new Ax;this.L=new Ax;this.o=this.w=null;this.a.addEventListener(_.Qf,this.G)}a.addElementToContainer(this.a,!0,!0);a.hideMediaElement();b.vr.attachMouseListener&&(this.a.addEventListener("mousedown",this.K,
14
+ !1),this.a.addEventListener(sx,this.K,!1));this.G();this.Kj()}else this.g.info("No video element found, can not initialize VR plugin");else this.g.info("No surface found, can not initialize VR plugin")}};
15
+ _.r.onPlayerWillRelease=function(){this.g.info("Releasing VR plugin resources");this.w&&cancelAnimationFrame(this.w);this.h.x=0;this.l=this.j=this.h.y=0;this.f&&(delete this.f,this.f=null);this.a&&(Jx(this),this.a.removeEventListener(_.Qf,this.G),this.a.parentElement.removeChild(this.a),this.a.removeEventListener("mousedown",this.K,!1),delete this.a,this.a=null)};_.r.onPlayerWillDestroy=function(){var a=this;return _.I(function(b){a.m=null;_.z(b)})};_.r.id=function(){return"vr"};
16
+ _.r.Kj=function(){if(this.m&&this.f){var a=this.m.getSurface();if(a&&(a=a.getMedia())&&a.tagName.toLowerCase()===_.Og){this.w=requestAnimationFrame(this.Kj.bind(this));var b=this.f;this.o||a.readyState!==a.HAVE_ENOUGH_DATA||(this.o=new Gx(a,b));b.clearColor(0,0,0,1);b.clearDepth(1);b.clearStencil(0);b.enable(b.DEPTH_TEST);b.depthFunc(b.LEQUAL);b.frontFace(b.CCW);b.cullFace(b.BACK);b.disable(b.CULL_FACE);b.enable(b.BLEND);b.blendFunc(b.SRC_ALPHA,b.ONE_MINUS_SRC_ALPHA);b.depthMask(!0);b.clearColor(0,
17
+ 0,0,1);b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT);if(this.o){var c=this.A;c.a.useProgram(c.f);c=Bx(this.J,this.L,this.H).a;var d=c[1];c[1]=c[4];c[4]=d;d=c[2];c[2]=c[8];c[8]=d;d=c[6];c[6]=c[9];c[9]=d;d=c[3];c[3]=c[12];c[12]=d;d=c[7];c[7]=c[13];c[13]=d;d=c[11];c[11]=c[14];c[14]=d;b.uniformMatrix4fv(this.A.h,!1,this.J.a);c=this.o;c.a.activeTexture(c.a.TEXTURE0);c.a.bindTexture(c.a.TEXTURE_2D,c.f);b.texImage2D(b.TEXTURE_2D,0,b.RGB,b.RGB,b.UNSIGNED_BYTE,a);a=this.ba;a.a.bindBuffer(a.a.ARRAY_BUFFER,
18
18
  a.f);a.a.vertexAttribPointer(0,3,a.a.FLOAT,!1,20,0);a.a.vertexAttribPointer(1,2,a.a.FLOAT,!1,20,12);a.a.enableVertexAttribArray(0);a.a.enableVertexAttribArray(1);a.a.drawArrays(a.a.TRIANGLES,0,a.h);a=this.o;a.a.bindTexture(a.a.TEXTURE_2D,null);this.A.a.useProgram(null)}}}};
19
- _.r.Vn=function(a){this.g.debug("Mouse Down. Enable VR mouse interaction");a.preventDefault();if(0===a.button||a.type===Nx)a.type===Nx?a.touches[0]&&(this.h.x=a.touches[0].clientX,this.h.y=a.touches[0].clientY):(this.h.x=a.clientX,this.h.y=a.clientY),this.g.debug("Mouse Start coordinates:",this.h,a),this.a.addEventListener("mousemove",this.B,!1),this.a.addEventListener(Mx,this.B,!1),this.a.addEventListener("mouseup",this.D,!1),this.a.addEventListener("touchend",this.D,!1)};
20
- _.r.Wn=function(a){a.preventDefault();var b=a.clientX,c=a.clientY;a.type===Mx&&a.touches[0]&&(b=a.touches[0].clientX,c=a.touches[0].clientY);a=this.h.x-b;var d=this.h.y-c;this.h.x=b;this.h.y=c;b=this.X;c=d*b*(this.P?-1:1);this.j+=a*b*(this.M?-1:1);this.l+=c;cy(this)};_.r.Xn=function(a){this.g.debug("Mouse Up. Removing mouse interaction listeners");a.preventDefault();dy(this)};_.r.nn=function(a,b){this.l=b;this.j=a;cy(this)};_.r.sm=function(){return{x:this.j,y:this.l}};
21
- _.r.So=function(a){this.I=a;this.G()};_.J("clpp.vr.VrPlugin",by);by.prototype.setCameraFieldOfView=by.prototype.So;by.prototype.getCameraCoordinates=by.prototype.sm;by.prototype.moveCamera=by.prototype.nn;by.Id="vr";ey.prototype.create=function(){return new by};_.bp(new ey);};
19
+ _.r.Un=function(a){this.g.debug("Mouse Down. Enable VR mouse interaction");a.preventDefault();if(0===a.button||a.type===sx)a.type===sx?a.touches[0]&&(this.h.x=a.touches[0].clientX,this.h.y=a.touches[0].clientY):(this.h.x=a.clientX,this.h.y=a.clientY),this.g.debug("Mouse Start coordinates:",this.h,a),this.a.addEventListener("mousemove",this.B,!1),this.a.addEventListener(rx,this.B,!1),this.a.addEventListener("mouseup",this.D,!1),this.a.addEventListener("touchend",this.D,!1)};
20
+ _.r.Vn=function(a){a.preventDefault();var b=a.clientX,c=a.clientY;a.type===rx&&a.touches[0]&&(b=a.touches[0].clientX,c=a.touches[0].clientY);a=this.h.x-b;var d=this.h.y-c;this.h.x=b;this.h.y=c;b=this.X;c=d*b*(this.P?-1:1);this.j+=a*b*(this.M?-1:1);this.l+=c;Ix(this)};_.r.Wn=function(a){this.g.debug("Mouse Up. Removing mouse interaction listeners");a.preventDefault();Jx(this)};_.r.ln=function(a,b){this.l=b;this.j=a;Ix(this)};_.r.qm=function(){return{x:this.j,y:this.l}};
21
+ _.r.So=function(a){this.I=a;this.G()};_.K("clpp.vr.VrPlugin",Hx);Hx.prototype.setCameraFieldOfView=Hx.prototype.So;Hx.prototype.getCameraCoordinates=Hx.prototype.qm;Hx.prototype.moveCamera=Hx.prototype.ln;Hx.Id="vr";Kx.prototype.create=function(){return new Hx};_.To(new Kx);};
22
22
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
23
23
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
24
24
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.vtt.js CHANGED
@@ -1,18 +1,18 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var sx=" The setting will be ignored.",tx="VTT parser encountered an invalid VTT setting: ",ux="application/x-subrip",vx="text/srt",wx='text/vtt; codecs\x3d"vtt"',xx='text/vtt; codecs\x3d"wvtt"',yx=function(a){_.Ys(a,/[ \t]+/gm)},zx=function(a){return a.a===a.f.length?null:(a=_.Ys(a,/[^ \t\n]*/gm))?a[0]:null},Ax=function(){},Bx=function(a){var b="";for(a=a.split(/\n/);3<a.length;){for(var c=3;c<a.length;++c)a[2]+="\n"+a[c];a.splice(3,a.length-3)}if(3!==a.length)return"";c=0;!a[0].match(/\d+:\d+:\d+/)&&
3
- a[1].match(/\d+:\d+:\d+/)&&(b+=a[0].match(/\w+/)+"\n",++c);if(a[c].match(/\d+:\d+:\d+/)){var d=a[1].match(/(\d+):(\d+):(\d+)(?:,(\d+))?\s*--?>\s*(\d+):(\d+):(\d+)(?:,(\d+))?/);if(d)b+=d[1]+":"+d[2]+":"+d[3]+"."+d[4]+" --\x3e ",b+=d[5]+":"+d[6]+":"+d[7]+"."+d[8]+"\n",++c;else return""}else return"";a[c]&&(b+=a[c]+"\n\n");return b},Cx=function(){},Dx=function(a){this.a=a},Fx=function(a,b,c){var d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"===b?a.textAlign=_.Ap:a.textAlign=
4
- _.mw[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"===d[1]?_.Rg:_.Sg;else if(d=/^size:([\d.]+)%$/.exec(b))a.size=Number(d[1]);else if(d=/^position:([\d.]+)%(?:,(line-left|line-right|center|start|end))?$/.exec(b))a.position=Number(d[1]),d[2]&&(b=d[2],a.positionAlign=b===_.He||b===_.jg?_.He:b===_.Ie||b===_.pe?_.Ie:_.od);else if(d=/^region:(.*)$/.exec(b)){if(b=Ex(c,d[1]))a.region=b}else{a:{if(c=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=1,a.line=
5
- Number(c[1]),c[2]&&(a.lineAlign=_.nw[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.Cp,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.nw[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},Ex=function(a,b){var c=a.filter(function(d){return d.id===b});return c.length?c[0]:(_.Rh("VTT parser could not find a region with id: ",b," The region will be ignored."),null)},Gx=function(a){a=_.Ys(a,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g);if(null==
6
- a)return null;var b=Number(a[2]),c=Number(a[3]);return 59<b||59<c?null:Number(a[4])/1E3+c+60*b+3600*(Number(a[1])||0)},Hx=function(){Dx.apply(this,arguments)},Ix=function(){this.a=null;this.g=new _.M("clpp.vtt.mp4")},Kx=function(a,b,c){var d,e,f;(new _.oq).N("payl",_.rq(function(g){d=_.R.ga(g)})).N("iden",_.rq(function(g){e=_.R.ga(g)})).N("sttg",_.rq(function(g){f=_.R.ga(g)})).parse(a);return d?Jx(d,e,f,b,c):null},Jx=function(a,b,c,d,e){a=new _.Fp(d,e,a,_.$g);b&&(a.id=b);if(c)for(b=new _.Xs(c),c=
7
- zx(b);c;)Fx(a,c,[])||_.Rh(tx,c,sx),yx(b),c=zx(b);return a},Lx=function(){this.a=new Cx};Ax.prototype.a=function(a){a=_.R.ga(a);a=a.replace(/\r+/g,"");a=a.replace(/^\s+|\s+$/g,"");a=a.replace(/<[a-zA-Z\\/][^>]*>/g,"");var b=a.split("\n\n");a="";if(0<b.length){a+="WEBVTT\n\n";b=_.v(b);for(var c=b.next();!c.done;c=b.next())a+=Bx(c.value)}return _.R.ub(a)};Cx.prototype.create=function(){return new Ax};Cx.prototype.probe=function(a,b){return(a===vx||a===ux)&&b===_.ug};Dx.prototype.parseInit=function(){};
8
- Dx.prototype.parseMedia=function(a,b){var c=_.R.ga(a);c=c.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");var d=c.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(d[0]))throw new _.O(_.P,2,2E3);c=b.periodStart;if(d[0].includes("X-TIMESTAMP-MAP")){var e=d[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),f=d[0].match(/MPEGTS:(\d+)/m);if(e&&f){c=Gx(new _.Xs(e[1]));if(null==c)throw new _.O(_.P,2,2E3);f=Number(f[1]);for(e=b.segmentStart;95443.7176888889<=e;)e-=95443.7176888889,f+=8589934592;c=b.periodStart+
9
- f/9E4-c}}else this.a.streaming.relativeTextTimestamp&&null!==b.segmentStart&&(c=b.segmentStart);f=[];e=_.v(d);for(var g=e.next();!g.done;g=e.next()){var k=g.value;if(/^region/.test(k.toLowerCase())){k=new _.Xs(k.replace(/\n/g," "));g=new _.Ip;zx(k);yx(k);for(var l=zx(k);l;){var m;a:{var n=g,p=l;if(m=/^id:(.*)$/.exec(p))n.id=m[1];else if(m=/^width:(\d{1,2}|100)%$/.exec(p))n.width=Number(m[1]);else if(m=/^lines:(\d+)$/.exec(p))n.height=Number(m[1]),n.heightUnits=2;else if(m=/^regionanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.regionAnchorX=
10
- Number(m[1]),n.regionAnchorY=Number(m[2]);else if(m=/^viewportanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.viewportAnchorX=Number(m[1]),n.viewportAnchorY=Number(m[2]);else if(/^scroll:up$/.exec(p))n.scroll="up";else{m=!1;break a}m=!0}m||_.Rh("VTT parser encountered an invalid VTTRegion setting: ",l,sx);yx(k);l=zx(k)}f.push(g)}}e=[];k=_.v(d);for(g=k.next();!g.done;g=k.next())if(g=g.value,/^style/.test(g.toLowerCase())){g=g.replace(/^style/i,"").replace(/\n/g," ");l=/[^{}]+{[^{}]*}/g;do(m=l.exec(g))&&
11
- e.push(m[0]);while(m)}k=[];d=_.v(d);for(g=d.next();!g.done;g=d.next())if(g=g.value,g.includes("--\x3e")){p=g.split("\n");var q=c;if(1===p.length&&!p[0]||/^NOTE($|[ \t])/.test(p[0])||"STYLE"===p[0])g=null;else{g=null;p[0].includes("--\x3e")||(g=p[0],p.splice(0,1));l=new _.Xs(p[0]);m=Gx(l);var t=_.Ys(l,/[ \t]+--\x3e[ \t]+/g);n=Gx(l);if(null==m||null==t||null==n)throw new _.O(_.P,2,2001);m+=q;n+=q;p=p.slice(1).join("\n").trim();m=new _.Fp(m,n,p,_.$g);g&&(m.id=g);yx(l);for(n=zx(l);n;)Fx(m,n,f)||_.Rh(tx,
12
- n,sx),yx(l),n=zx(l);null!=g&&(m.id=g);g=m}g&&k.push(g)}return{cues:k,styles:e}};_.w(Hx,Dx);Hx.prototype.parseMedia=function(a,b){return Dx.prototype.parseMedia.call(this,(new Ax).a(a),b)};Ix.prototype.parseInit=function(a){var b=this,c=!1;(new _.oq).N(_.We,_.pq).N(_.Dg,_.pq).N(_.Qe,_.pq).da("mdhd",function(d){0===d.version?(d.reader.skip(4),d.reader.skip(4),b.a=_.jq(d.reader),d.reader.skip(4)):(d.reader.skip(8),d.reader.skip(8),b.a=_.jq(d.reader),d.reader.skip(8));d.reader.skip(4)}).N(_.Ve,_.pq).N(_.mg,_.pq).da(_.og,_.qq).N("wvtt",function(){c=!0}).parse(a);if(!this.a)throw new _.O(_.P,2,2008);if(!c)throw new _.O(_.P,2,2008);};
13
- Ix.prototype.parseMedia=function(a,b){if(!this.a)throw this.g.error("No init segment for MP4+VTT!"),new _.O(_.P,2,2008);var c=0,d=[],e,f=[],g=!1,k=!1,l=!1,m=null;(new _.oq).N("moof",_.pq).N("traf",_.pq).da("tfdt",function(z){g=!0;c=0===z.version?_.jq(z.reader):_.lq(z.reader)}).da("tfhd",function(z){var K=z.flags;z=z.reader;z.skip(4);K&1&&z.skip(8);K&2&&z.skip(4);m=K&8?_.jq(z):null}).da("trun",function(z){k=!0;var K=z.version,L=z.flags;z=z.reader;var U=_.jq(z);L&1&&z.skip(4);L&4&&z.skip(4);for(var V=
14
- [],ta=0;ta<U;ta++){var za={duration:null,sampleSize:null,uh:null};L&256&&(za.duration=_.jq(z));L&512&&(za.sampleSize=_.jq(z));L&1024&&z.skip(4);L&2048&&(za.uh=0===K?_.jq(z):_.kq(z));V.push(za)}d=V}).N(_.Pe,_.rq(function(z){l=!0;e=z})).parse(a);if(!l&&!g&&!k)throw new _.O(_.P,2,2008);var n=c,p=new DataView(e.buffer,e.byteOffset,e.byteLength);p=new _.eq(p,!1);for(var q=_.v(d),t=q.next();!t.done;t=q.next()){t=t.value;var u=t.duration||m,y=t.uh?c+t.uh:n;n=y+(u||0);var B=0;do{var D=_.jq(p);B+=D;var C=
15
- _.jq(p);C=_.tq(C);var E=null;"vttc"===C?8<D&&(E=_.nq(p,D-8)):("vtte"!==C&&this.g.error("Unknown box "+C+"! Skipping!"),p.skip(D-8));u?E&&f.push(Kx(E,b.periodStart+y/this.a,b.periodStart+n/this.a)):this.g.error("WVTT sample duration unknown, and no default found!")}while(t.sampleSize&&B<t.sampleSize)}return{cues:f.filter(_.sn),styles:[]}};_.w(Lx,_.fv);Lx.prototype.install=function(){_.xv(_.ug,Dx);_.xv(wx,Dx);_.xv(xx,Dx);_.xv(_.Oc,Ix);_.xv(vx,Hx);_.xv(ux,Hx);_.ut.push(this.a)};Lx.prototype.uninstall=function(){_.zv(_.ug);_.zv(wx);_.zv(xx);_.zv(_.Oc);_.zv(vx);_.zv(ux);_.wt(this.a)};Lx.prototype.id=function(){return"subtitles-vtt"};_.J("clpp.vtt.VttComponent",Lx);};
2
+ var f=function(window){var Yw=" The setting will be ignored.",Zw="VTT parser encountered an invalid VTT setting: ",$w="application/x-subrip",ax="text/srt",bx='text/vtt; codecs\x3d"vtt"',cx='text/vtt; codecs\x3d"wvtt"',dx=function(a){_.Wp(a,/[ \t]+/gm)},ex=function(a){return a.a===a.f.length?null:(a=_.Wp(a,/[^ \t\n]*/gm))?a[0]:null},fx=function(){},gx=function(a){var b="";for(a=a.split(/\n/);3<a.length;){for(var c=3;c<a.length;++c)a[2]+="\n"+a[c];a.splice(3,a.length-3)}if(3!==a.length)return"";c=0;!a[0].match(/\d+:\d+:\d+/)&&
3
+ a[1].match(/\d+:\d+:\d+/)&&(b+=a[0].match(/\w+/)+"\n",++c);if(a[c].match(/\d+:\d+:\d+/)){var d=a[1].match(/(\d+):(\d+):(\d+)(?:,(\d+))?\s*--?>\s*(\d+):(\d+):(\d+)(?:,(\d+))?/);if(d)b+=d[1]+":"+d[2]+":"+d[3]+"."+d[4]+" --\x3e ",b+=d[5]+":"+d[6]+":"+d[7]+"."+d[8]+"\n",++c;else return""}else return"";a[c]&&(b+=a[c]+"\n\n");return b},hx=function(){},ix=function(a){this.a=a},kx=function(a,b,c){var d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"===b?a.textAlign=_.Ap:a.textAlign=
4
+ _.Zv[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"===d[1]?_.Mg:_.Ng;else if(d=/^size:([\d.]+)%$/.exec(b))a.size=Number(d[1]);else if(d=/^position:([\d.]+)%(?:,(line-left|line-right|center|start|end))?$/.exec(b))a.position=Number(d[1]),d[2]&&(b=d[2],a.positionAlign=b===_.Ce||b===_.eg?_.Ce:b===_.De||b===_.je?_.De:_.nd);else if(d=/^region:(.*)$/.exec(b)){if(b=jx(c,d[1]))a.region=b}else{a:{if(c=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=1,a.line=
5
+ Number(c[1]),c[2]&&(a.lineAlign=_.$v[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.Cp,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.$v[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},jx=function(a,b){var c=a.filter(function(d){return d.id===b});return c.length?c[0]:(_.Mh("VTT parser could not find a region with id: ",b," The region will be ignored."),null)},lx=function(a){a=_.Wp(a,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g);if(null==
6
+ a)return null;var b=Number(a[2]),c=Number(a[3]);return 59<b||59<c?null:Number(a[4])/1E3+c+60*b+3600*(Number(a[1])||0)},mx=function(){ix.apply(this,arguments)},nx=function(){this.a=null;this.g=new _.L("clpp.vtt.mp4")},px=function(a,b,c){var d,e,f;(new _.jr).N("payl",_.mr(function(g){d=_.R.ga(g)})).N("iden",_.mr(function(g){e=_.R.ga(g)})).N("sttg",_.mr(function(g){f=_.R.ga(g)})).parse(a);return d?ox(d,e,f,b,c):null},ox=function(a,b,c,d,e){a=new _.Fp(d,e,a,_.Vg);b&&(a.id=b);if(c)for(b=new _.Vp(c),c=
7
+ ex(b);c;)kx(a,c,[])||_.Mh(Zw,c,Yw),dx(b),c=ex(b);return a},qx=function(){this.a=new hx};fx.prototype.a=function(a){a=_.R.ga(a);a=a.replace(/\r+/g,"");a=a.replace(/^\s+|\s+$/g,"");a=a.replace(/<[a-zA-Z\\/][^>]*>/g,"");var b=a.split("\n\n");a="";if(0<b.length){a+="WEBVTT\n\n";b=_.v(b);for(var c=b.next();!c.done;c=b.next())a+=gx(c.value)}return _.R.ub(a)};hx.prototype.create=function(){return new fx};hx.prototype.probe=function(a,b){return(a===ax||a===$w)&&b===_.pg};ix.prototype.parseInit=function(){};
8
+ ix.prototype.parseMedia=function(a,b){var c=_.R.ga(a);c=c.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");var d=c.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(d[0]))throw new _.N(_.P,2,2E3);c=b.periodStart;if(d[0].includes("X-TIMESTAMP-MAP")){var e=d[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),f=d[0].match(/MPEGTS:(\d+)/m);if(e&&f){c=lx(new _.Vp(e[1]));if(null==c)throw new _.N(_.P,2,2E3);f=Number(f[1]);for(e=b.segmentStart;95443.7176888889<=e;)e-=95443.7176888889,f+=8589934592;c=b.periodStart+
9
+ f/9E4-c}}else this.a.streaming.relativeTextTimestamp&&null!==b.segmentStart&&(c=b.segmentStart);f=[];e=_.v(d);for(var g=e.next();!g.done;g=e.next()){var k=g.value;if(/^region/.test(k.toLowerCase())){k=new _.Vp(k.replace(/\n/g," "));g=new _.Ip;ex(k);dx(k);for(var l=ex(k);l;){var m;a:{var n=g,p=l;if(m=/^id:(.*)$/.exec(p))n.id=m[1];else if(m=/^width:(\d{1,2}|100)%$/.exec(p))n.width=Number(m[1]);else if(m=/^lines:(\d+)$/.exec(p))n.height=Number(m[1]),n.heightUnits=2;else if(m=/^regionanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.regionAnchorX=
10
+ Number(m[1]),n.regionAnchorY=Number(m[2]);else if(m=/^viewportanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.viewportAnchorX=Number(m[1]),n.viewportAnchorY=Number(m[2]);else if(/^scroll:up$/.exec(p))n.scroll="up";else{m=!1;break a}m=!0}m||_.Mh("VTT parser encountered an invalid VTTRegion setting: ",l,Yw);dx(k);l=ex(k)}f.push(g)}}e=[];k=_.v(d);for(g=k.next();!g.done;g=k.next())if(g=g.value,/^style/.test(g.toLowerCase())){g=g.replace(/^style/i,"").replace(/\n/g," ");l=/[^{}]+{[^{}]*}/g;do(m=l.exec(g))&&
11
+ e.push(m[0]);while(m)}k=[];d=_.v(d);for(g=d.next();!g.done;g=d.next())if(g=g.value,g.includes("--\x3e")){p=g.split("\n");var q=c;if(1===p.length&&!p[0]||/^NOTE($|[ \t])/.test(p[0])||"STYLE"===p[0])g=null;else{g=null;p[0].includes("--\x3e")||(g=p[0],p.splice(0,1));l=new _.Vp(p[0]);m=lx(l);var t=_.Wp(l,/[ \t]+--\x3e[ \t]+/g);n=lx(l);if(null==m||null==t||null==n)throw new _.N(_.P,2,2001);m+=q;n+=q;p=p.slice(1).join("\n").trim();m=new _.Fp(m,n,p,_.Vg);g&&(m.id=g);dx(l);for(n=ex(l);n;)kx(m,n,f)||_.Mh(Zw,
12
+ n,Yw),dx(l),n=ex(l);null!=g&&(m.id=g);g=m}g&&k.push(g)}return{cues:k,styles:e}};_.w(mx,ix);mx.prototype.parseMedia=function(a,b){return ix.prototype.parseMedia.call(this,(new fx).a(a),b)};nx.prototype.parseInit=function(a){var b=this,c=!1;(new _.jr).N(_.Qe,_.kr).N(_.yg,_.kr).N(_.Le,_.kr).da("mdhd",function(d){0===d.version?(d.reader.skip(4),d.reader.skip(4),b.a=_.er(d.reader),d.reader.skip(4)):(d.reader.skip(8),d.reader.skip(8),b.a=_.er(d.reader),d.reader.skip(8));d.reader.skip(4)}).N(_.Pe,_.kr).N(_.hg,_.kr).da(_.jg,_.lr).N("wvtt",function(){c=!0}).parse(a);if(!this.a)throw new _.N(_.P,2,2008);if(!c)throw new _.N(_.P,2,2008);};
13
+ nx.prototype.parseMedia=function(a,b){if(!this.a)throw this.g.error("No init segment for MP4+VTT!"),new _.N(_.P,2,2008);var c=0,d=[],e,f=[],g=!1,k=!1,l=!1,m=null;(new _.jr).N("moof",_.kr).N("traf",_.kr).da("tfdt",function(C){g=!0;c=0===C.version?_.er(C.reader):_.gr(C.reader)}).da("tfhd",function(C){var J=C.flags;C=C.reader;C.skip(4);J&1&&C.skip(8);J&2&&C.skip(4);m=J&8?_.er(C):null}).da("trun",function(C){k=!0;var J=C.version,O=C.flags;C=C.reader;var S=_.er(C);O&1&&C.skip(4);O&4&&C.skip(4);for(var V=
14
+ [],na=0;na<S;na++){var za={duration:null,sampleSize:null,th:null};O&256&&(za.duration=_.er(C));O&512&&(za.sampleSize=_.er(C));O&1024&&C.skip(4);O&2048&&(za.th=0===J?_.er(C):_.fr(C));V.push(za)}d=V}).N(_.Ke,_.mr(function(C){l=!0;e=C})).parse(a);if(!l&&!g&&!k)throw new _.N(_.P,2,2008);var n=c,p=new DataView(e.buffer,e.byteOffset,e.byteLength);p=new _.$q(p,!1);for(var q=_.v(d),t=q.next();!t.done;t=q.next()){t=t.value;var u=t.duration||m,y=t.th?c+t.th:n;n=y+(u||0);var A=0;do{var D=_.er(p);A+=D;var B=
15
+ _.er(p);B=_.or(B);var E=null;"vttc"===B?8<D&&(E=_.ir(p,D-8)):("vtte"!==B&&this.g.error("Unknown box "+B+"! Skipping!"),p.skip(D-8));u?E&&f.push(px(E,b.periodStart+y/this.a,b.periodStart+n/this.a)):this.g.error("WVTT sample duration unknown, and no default found!")}while(t.sampleSize&&A<t.sampleSize)}return{cues:f.filter(_.gn),styles:[]}};_.w(qx,_.xu);qx.prototype.install=function(){_.iv(_.pg,ix);_.iv(bx,ix);_.iv(cx,ix);_.iv(_.Nc,nx);_.iv(ax,mx);_.iv($w,mx);_.sq.push(this.a)};qx.prototype.uninstall=function(){_.kv(_.pg);_.kv(bx);_.kv(cx);_.kv(_.Nc);_.kv(ax);_.kv($w);_.uq(this.a)};qx.prototype.id=function(){return"subtitles-vtt"};_.K("clpp.vtt.VttComponent",qx);};
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.yospace.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var nx="clpp.yospace.YospacePlugin",ox=function(){this.a=null;this.g=new _.M(nx)},px=function(){};_.w(ox,_.cw);ox.prototype.Ni=function(){return this.a};
3
- ox.prototype.onContentWillLoad=function(a,b){var c=this,d,e,f,g,k;return _.I(function(l){if(1==l.a){d=a.getConfiguration();e=d.yospace;if(!e.enabled)return l["return"]();if(typeof window.YospaceAdManagement!==_.$e)throw new _.O(_.P,9,7003,"Yospace SDK not found.");c.g.info("Yospace enabled.");f=e.streamType||qx;a:{var m=b.url;c.g.info("Creating Yospace session for stream type",f);switch(f){case qx:m=YospaceAdManagement.SessionVOD.create(m);break a;case rx:m=YospaceAdManagement.SessionLive.create(m);
4
- break a;default:m=YospaceAdManagement.SessionDVRLive.create(m)}}return _.x(l,m,2)}g=l.f;k=g.getSessionState();if(k!==YospaceAdManagement.SessionState.INITIALISED)throw c.g.error("Failed to initialize Yospace session. State:",k,"URL",b.url),new _.O(_.P,9,7003,"Yospace session failed to initialize.");a.trigger(new _.Q(_.mh,{detail:g}));b.url=g.getPlaybackUrl();c.g.info("Yospace session initialized. New URL:",b.url);c.a=g;_.A(l)})};
5
- ox.prototype.onPlayerWillRelease=function(a){if(this.a){this.g.info("Shutting down Yospace session.");var b=this.a;this.a.shutdown();this.a=null;a.trigger(new _.Q(_.lh,{detail:b}))}};ox.prototype.id=function(){return"yospace"};_.J(nx,ox);ox.prototype.getSession=ox.prototype.Ni;ox.Id="yospace";px.prototype.create=function(){return new ox};var qx=_.Vb,rx="LIVE";_.J("clpp.yospace.StreamType",{VOD:qx,LIVE:rx,DVR:"DVR"});_.bp(new px);};
2
+ var f=function(window){var Tw="clpp.yospace.YospacePlugin",Uw=function(){this.a=null;this.g=new _.L(Tw)},Vw=function(){};_.w(Uw,_.Pv);Uw.prototype.Ki=function(){return this.a};
3
+ Uw.prototype.onContentWillLoad=function(a,b){var c=this,d,e,f,g,k;return _.I(function(l){if(1==l.a){d=a.getConfiguration();e=d.yospace;if(!e.enabled)return l["return"]();if(typeof window.YospaceAdManagement!==_.Ve)throw new _.N(_.P,9,7003,"Yospace SDK not found.");c.g.info("Yospace enabled.");f=e.streamType||Ww;a:{var m=b.url;c.g.info("Creating Yospace session for stream type",f);switch(f){case Ww:m=YospaceAdManagement.SessionVOD.create(m);break a;case Xw:m=YospaceAdManagement.SessionLive.create(m);
4
+ break a;default:m=YospaceAdManagement.SessionDVRLive.create(m)}}return _.x(l,m,2)}g=l.f;k=g.getSessionState();if(k!==YospaceAdManagement.SessionState.INITIALISED)throw c.g.error("Failed to initialize Yospace session. State:",k,"URL",b.url),new _.N(_.P,9,7003,"Yospace session failed to initialize.");a.trigger(new _.Q(_.hh,{detail:g}));b.url=g.getPlaybackUrl();c.g.info("Yospace session initialized. New URL:",b.url);c.a=g;_.z(l)})};
5
+ Uw.prototype.onPlayerWillRelease=function(a){if(this.a){this.g.info("Shutting down Yospace session.");var b=this.a;this.a.shutdown();this.a=null;a.trigger(new _.Q(_.gh,{detail:b}))}};Uw.prototype.id=function(){return"yospace"};_.K(Tw,Uw);Uw.prototype.getSession=Uw.prototype.Ki;Uw.Id="yospace";Vw.prototype.create=function(){return new Uw};var Ww=_.Ub,Xw="LIVE";_.K("clpp.yospace.StreamType",{VOD:Ww,LIVE:Xw,DVR:"DVR"});_.To(new Vw);};
6
6
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
7
7
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
8
8
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.youbora.js CHANGED
@@ -1,44 +1,44 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var Lw='" event to NPAW',Mw='" event to Youbora',Nw='Reporting "',Ow="Unhandled state",Pw="ad break start",Qw="ad buffering ended",Rw="ad buffering started",Sw="ad click through url: ",Tw="ad timeline changed",Uw="clpp.npaw.NpawPlugin",Vw="clpp.npaw.YouboraPlugin",Ww="content.isLive",Xw="content.title",Yw="is container visible",Zw=function(a){return a.startsWith(_.Nd)?"Widevine":a.startsWith(_.Jd)?"FairPlay":a.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":a.startsWith(_.jf)?"ClearKey":
3
- a.startsWith(_.Id)?"Primetime":a},$w=function(a){return a&&a.errorFilter?a.errorFilter:function(b){return{code:""+b.code,message:b.message,severity:b.severity}}},ax=function(a,b,c,d){b=$w(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===a.code?"ad error":_.re;b.severity===_.P?(d.fireFatalError(b.code,b.message,b.metadata),c.debug('Reporting "fatal '+a+'" to Youbora',b.code,b)):(d.fireError(b.code,b.message,b.metadata),c.debug(Nw+a+'" to Youbora',b.code,b));return b},
4
- bx=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.m=c;d.a=new _.xi;d.g=new _.M("clpp.npaw.YouboraAdapter");d.o=!1;d.h=!1;d.B=!1;d.registerListeners();return d}_.w(b,youbora.Adapter);b.prototype.getPlayhead=function(){return this.getIsLive()?-1:this.m.getPosition()};b.prototype.getDuration=function(){return this.m.getDuration()};b.prototype.getRendition=function(){var c=this.m.getTrackManager();if(c&&(c=c.sa())){var d=c.width;var e=c.height;var f=c.bandwidth}d&&e&&f||(c=this.j(),
5
- d=d||c.width,e=e||c.height,f=f||c.streamBandwidth);return youbora.Util.buildRenditionString(d,e,f)};b.prototype.getIsLive=function(){return this.m.isLive()};b.prototype.getResource=function(){var c=this.m.$a();return c&&c.url};b.prototype.getBitrate=function(){return this.j().streamBandwidth};b.prototype.getThroughput=function(){return this.j().estimatedBandwidth};b.prototype.getPlayrate=function(){return this.m.Ec()};b.prototype.getFramesPerSecond=function(){var c=this.m.getTrackManager();return c&&
6
- (c=c.Qa())?c.frameRate:null};b.prototype.getPlayerName=function(){return _.ya};b.prototype.getVersion=function(){return"6.32.0-castlabsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ia};b.prototype.registerListeners=function(){this.m&&this.a&&(this.g.debug("registering listeners"),youbora.Util.logAllEvents(this.m),this.a.on(this.m,_.kg,this.K.bind(this)),this.a.on(this.m,_.re,this.H.bind(this)),this.a.on(this.m,_.Og,this.J.bind(this)),this.a.on(this.m,_.Ng,this.I.bind(this)),this.a.on(this.m,
7
- _.Fc,this.D.bind(this)),this.a.on(this.m,_.jd,this.G.bind(this)))};b.prototype.unregisterListeners=function(){this.g.debug(_.Qb);_.Ai(this.a)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.B=!0};b.prototype.j=function(){return this.m.getStats()||_.hu()};b.prototype.w=function(){return!!this.m.getConfiguration().autoplay};b.prototype.K=function(c){c=c.detail;this.l("state change",c);if(c)switch(c.currentState){case 1:this.w()&&this.f();break;case 3:this.f();this.A();
8
- this.fireResume();this.fireBufferEnd();break;case 4:this.w()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.iu:this.fireBufferEnd();this.fireStop();break;case 5:this.fireBufferEnd();this.o&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case 2:this.fireBufferBegin();break;default:this.g.debug(Ow,c)}};b.prototype.f=function(){this.plugin.isInitiated||(this.h=!1,this.fireInit())};b.prototype.A=function(){var c=this.m.getDrmInfo();c&&(c=Zw(c.keySystem))&&this.plugin.setOptions({"content.drm":c});
9
- this.fireJoin()};b.prototype.H=function(c){!(c=c.detail)||this.h||10003===c.code&&this.plugin.getAdsAdapter()||(c=ax(c,this.m.getConfiguration().youbora,this.g,this))&&c.severity===_.P&&(this.h=!0)};b.prototype.J=function(){this.m.isEnded()||(this.l(_.cg),this.f(),this.fireSeekBegin())};b.prototype.I=function(){this.l(_.bg);this.fireSeekEnd()};b.prototype.D=function(c){this.g.debug("adsTimeline",c);this.o=(c=c.adsTimeline)&&c.$b()};b.prototype.G=function(c){this.g.debug("Casting",c);this.fireCasted()};
10
- b.prototype.l=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.g.debug.apply(this.g,[Nw+c+Mw].concat(_.qh(e)))};return new b(a)},cx=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.m=c;d.a=null;d.j=null;d.f=new _.xi;d.g=new _.M("clpp.npaw.YouboraAdsAdapter");d.registerListeners();d.A=!1;d.l=!1;return d}_.w(b,youbora.Adapter);b.prototype.getDuration=function(){return this.a&&this.a.getDuration()};b.prototype.getRendition=function(){var c=null;this.a&&
11
- (c=youbora.Util.buildRenditionString(this.a.eb(),this.a.cb(),this.a.Ga()));return c};b.prototype.getBitrate=function(){return this.a&&this.a.Ga()};b.prototype.getPlayhead=function(){var c=this.m.getAdsManager();return c&&c.getPosition()};b.prototype.getResource=function(){return this.a&&this.a.getMediaUrl()};b.prototype.getTitle=function(){return this.a&&this.a.getTitle()};b.prototype.getProvider=function(){return this.a&&this.a.getAdvertiserName()};b.prototype.getCreativeId=function(){return this.a&&
2
+ var f=function(window){var qw='" event to NPAW',rw='" event to Youbora',sw='Reporting "',tw="Unhandled state",uw="ad break start",vw="ad buffering ended",ww="ad buffering started",xw="ad click through url: ",yw="ad timeline changed",zw="clpp.npaw.NpawPlugin",Aw="clpp.npaw.YouboraPlugin",Bw="content.isLive",Cw="content.title",Dw="is container visible",Ew=function(a){return a.startsWith(_.Kd)?"Widevine":a.startsWith(_.Gd)?"FairPlay":a.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":a.startsWith(_.df)?"ClearKey":
3
+ a.startsWith(_.Fd)?"Primetime":a},Fw=function(a){return a&&a.errorFilter?a.errorFilter:function(b){return{code:""+b.code,message:b.message,severity:b.severity}}},Gw=function(a,b,c,d){b=Fw(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===a.code?"ad error":_.me;b.severity===_.P?(d.fireFatalError(b.code,b.message,b.metadata),c.debug('Reporting "fatal '+a+'" to Youbora',b.code,b)):(d.fireError(b.code,b.message,b.metadata),c.debug(sw+a+'" to Youbora',b.code,b));return b},
4
+ Hw=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.m=c;d.a=new _.ti;d.g=new _.L("clpp.npaw.YouboraAdapter");d.o=!1;d.h=!1;d.B=!1;d.registerListeners();return d}_.w(b,youbora.Adapter);b.prototype.getPlayhead=function(){return this.getIsLive()?-1:this.m.getPosition()};b.prototype.getDuration=function(){return this.m.getDuration()};b.prototype.getRendition=function(){var c=this.m.getTrackManager();if(c&&(c=c.sa())){var d=c.width;var e=c.height;var f=c.bandwidth}d&&e&&f||(c=this.j(),
5
+ d=d||c.width,e=e||c.height,f=f||c.streamBandwidth);return youbora.Util.buildRenditionString(d,e,f)};b.prototype.getIsLive=function(){return this.m.isLive()};b.prototype.getResource=function(){var c=this.m.$a();return c&&c.url};b.prototype.getBitrate=function(){return this.j().streamBandwidth};b.prototype.getThroughput=function(){return this.j().estimatedBandwidth};b.prototype.getPlayrate=function(){return this.m.Cc()};b.prototype.getFramesPerSecond=function(){var c=this.m.getTrackManager();return c&&
6
+ (c=c.Qa())?c.frameRate:null};b.prototype.getPlayerName=function(){return _.Ba};b.prototype.getVersion=function(){return"6.33.0-beta.1-castlabsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ja};b.prototype.registerListeners=function(){this.m&&this.a&&(this.g.debug("registering listeners"),youbora.Util.logAllEvents(this.m),this.a.on(this.m,_.fg,this.K.bind(this)),this.a.on(this.m,_.me,this.H.bind(this)),this.a.on(this.m,_.Hg,this.J.bind(this)),this.a.on(this.m,_.Gg,this.I.bind(this)),
7
+ this.a.on(this.m,_.Ec,this.D.bind(this)),this.a.on(this.m,_.id,this.G.bind(this)))};b.prototype.unregisterListeners=function(){this.g.debug(_.Pb);_.wi(this.a)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.B=!0};b.prototype.j=function(){return this.m.getStats()||_.Jt()};b.prototype.w=function(){return!!this.m.getConfiguration().autoplay};b.prototype.K=function(c){c=c.detail;this.l("state change",c);if(c)switch(c.currentState){case 1:this.w()&&this.f();break;case 3:this.f();
8
+ this.A();this.fireResume();this.fireBufferEnd();break;case 4:this.w()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.Zo:this.fireBufferEnd();this.fireStop();break;case 5:this.fireBufferEnd();this.o&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case 2:this.fireBufferBegin();break;default:this.g.debug(tw,c)}};b.prototype.f=function(){this.plugin.isInitiated||(this.h=!1,this.fireInit())};b.prototype.A=function(){var c=this.m.getDrmInfo();c&&(c=Ew(c.keySystem))&&
9
+ this.plugin.setOptions({"content.drm":c});this.fireJoin()};b.prototype.H=function(c){!(c=c.detail)||this.h||10003===c.code&&this.plugin.getAdsAdapter()||(c=Gw(c,this.m.getConfiguration().youbora,this.g,this))&&c.severity===_.P&&(this.h=!0)};b.prototype.J=function(){this.m.isEnded()||(this.l(_.Yf),this.f(),this.fireSeekBegin())};b.prototype.I=function(){this.l(_.Xf);this.fireSeekEnd()};b.prototype.D=function(c){this.g.debug("adsTimeline",c);this.o=(c=c.adsTimeline)&&c.Zb()};b.prototype.G=function(c){this.g.debug("Casting",
10
+ c);this.fireCasted()};b.prototype.l=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.g.debug.apply(this.g,[sw+c+rw].concat(_.lh(e)))};return new b(a)},Iw=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.m=c;d.a=null;d.j=null;d.f=new _.ti;d.g=new _.L("clpp.npaw.YouboraAdsAdapter");d.registerListeners();d.A=!1;d.l=!1;return d}_.w(b,youbora.Adapter);b.prototype.getDuration=function(){return this.a&&this.a.getDuration()};b.prototype.getRendition=function(){var c=
11
+ null;this.a&&(c=youbora.Util.buildRenditionString(this.a.eb(),this.a.cb(),this.a.Ga()));return c};b.prototype.getBitrate=function(){return this.a&&this.a.Ga()};b.prototype.getPlayhead=function(){var c=this.m.getAdsManager();return c&&c.getPosition()};b.prototype.getResource=function(){return this.a&&this.a.getMediaUrl()};b.prototype.getTitle=function(){return this.a&&this.a.getTitle()};b.prototype.getProvider=function(){return this.a&&this.a.getAdvertiserName()};b.prototype.getCreativeId=function(){return this.a&&
12
12
  this.a.getCreativeId()};b.prototype.getPosition=function(){var c=youbora.Constants.AdPosition,d=null;if(this.a)switch(this.a.Ha()){case 0:d=c.Preroll;break;case 2:d=c.Postroll;break;case 1:d=c.Midroll}this.g.debug("Ad position",d);return d};b.prototype.getIsSkippable=function(){return this.a&&-1!==this.a.getSkipTimeOffset()};b.prototype.getAudioEnabled=function(){var c=this.m.getAdsManager();return c&&0<c.getAdVolume()};b.prototype.getExpectedBreaks=function(){return this.j&&this.j.getCuePoints().length};
13
13
  b.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};b.prototype.getExpectedAds=function(){return this.a&&this.a.fb()};b.prototype.getGivenAds=function(){return this.getExpectedAds()};b.prototype.getBreaksTime=function(){var c=this;return this.j&&this.j.getCuePoints().map(function(d){return-1===d?c.m.getDuration():d})};b.prototype.getIsFullscreen=function(){return this.m.getSurface().isFullscreen()};b.prototype.getIsVisible=function(){var c=this.m.getSurface().getContainer();c=youbora.Util.calculateAdViewability(c);
14
- this.g.debug(Yw,c);return c};b.prototype.getPlayerName=function(){return _.ya};b.prototype.getVersion=function(){return"6.32.0-castlabsadsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ia};b.prototype.registerListeners=function(){this.m&&this.f&&(this.f.on(this.m,_.Fc,this.T.bind(this)),this.f.on(this.m,_.Bc,this.P.bind(this)),this.f.on(this.m,_.xc,this.K.bind(this)),this.f.on(this.m,_.zc,this.L.bind(this)),this.f.on(this.m,_.mc,this.I.bind(this)),this.f.on(this.m,_.nc,this.o.bind(this,
15
- 1)),this.f.on(this.m,_.wc,this.o.bind(this,2)),this.f.on(this.m,_.Dc,this.o.bind(this,3)),this.f.on(this.m,_.lc,this.H.bind(this)),this.f.on(this.m,_.Ac,this.M.bind(this)),this.f.on(this.m,_.re,this.J.bind(this)),this.f.on(this.m,_.ic,this.B.bind(this)),this.f.on(this.m,_.jc,this.D.bind(this)),this.f.on(this.m,_.kc,this.G.bind(this)),this.f.on(this.m,_.yc,this.w.bind(this)))};b.prototype.unregisterListeners=function(){_.Ai(this.f)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);
16
- this.A=!0};b.prototype.T=function(c){this.g.debug(Tw,c);this.j=c.adsTimeline};b.prototype.P=function(c){this.a=c.ad;this.h("ad start",this.a);this.fireStart();this.fireJoin()};b.prototype.I=function(){this.h("ad ended");this.fireStop()};b.prototype.K=function(){this.h("ad pause");this.w();this.firePause()};b.prototype.L=function(){this.h("ad resume");this.w();this.fireResume()};b.prototype.G=function(){this.l=!0;this.h(Rw);this.fireBufferBegin()};b.prototype.w=function(){this.l&&(this.h(Qw),this.l=
17
- !1,this.fireBufferEnd())};b.prototype.o=function(c){this.h("ad quartile",c);this.fireQuartile(c)};b.prototype.H=function(){this.h("ad clicked");var c=this.a&&this.a.Za();this.g.debug(Sw,c);this.fireClick(c)};b.prototype.M=function(){this.h("ad skipped");this.fireSkip()};b.prototype.B=function(c){this.a=c.ad;this.h(Pw,this.a);this.fireBreakStart()};b.prototype.D=function(){this.h("ad break stop");this.fireBreakStop();if(this.getPosition()===youbora.Constants.AdPosition.Postroll){var c=this.plugin.getAdapter();
18
- c&&c.fireStop()}};b.prototype.J=function(c){(c=c.detail)&&10003===c.code&&ax(c,this.m.getConfiguration().youbora,this.g,this)};b.prototype.h=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.g.debug.apply(this.g,[Nw+c+Mw].concat(_.qh(e)))};return new b(a)},ex=function(){function a(){var b=NpawPluginAdapters.video.Shaka.call(this)||this;b.h=!1;b.f=!1;b.a=null;b.G=!1;return b}_.w(a,NpawPluginAdapters.video.Shaka);a.prototype.getPlayhead=function(){return this.getIsLive()?
14
+ this.g.debug(Dw,c);return c};b.prototype.getPlayerName=function(){return _.Ba};b.prototype.getVersion=function(){return"6.33.0-beta.1-castlabsadsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ja};b.prototype.registerListeners=function(){this.m&&this.f&&(this.f.on(this.m,_.Ec,this.T.bind(this)),this.f.on(this.m,_.Ac,this.P.bind(this)),this.f.on(this.m,_.vc,this.K.bind(this)),this.f.on(this.m,_.yc,this.L.bind(this)),this.f.on(this.m,_.lc,this.I.bind(this)),this.f.on(this.m,_.mc,this.o.bind(this,
15
+ 1)),this.f.on(this.m,_.tc,this.o.bind(this,2)),this.f.on(this.m,_.Cc,this.o.bind(this,3)),this.f.on(this.m,_.kc,this.H.bind(this)),this.f.on(this.m,_.zc,this.M.bind(this)),this.f.on(this.m,_.me,this.J.bind(this)),this.f.on(this.m,_.hc,this.B.bind(this)),this.f.on(this.m,_.ic,this.D.bind(this)),this.f.on(this.m,_.jc,this.G.bind(this)),this.f.on(this.m,_.xc,this.w.bind(this)))};b.prototype.unregisterListeners=function(){_.wi(this.f)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);
16
+ this.A=!0};b.prototype.T=function(c){this.g.debug(yw,c);this.j=c.adsTimeline};b.prototype.P=function(c){this.a=c.ad;this.h("ad start",this.a);this.fireStart();this.fireJoin()};b.prototype.I=function(){this.h("ad ended");this.fireStop()};b.prototype.K=function(){this.h("ad pause");this.w();this.firePause()};b.prototype.L=function(){this.h("ad resume");this.w();this.fireResume()};b.prototype.G=function(){this.l=!0;this.h(ww);this.fireBufferBegin()};b.prototype.w=function(){this.l&&(this.h(vw),this.l=
17
+ !1,this.fireBufferEnd())};b.prototype.o=function(c){this.h("ad quartile",c);this.fireQuartile(c)};b.prototype.H=function(){this.h("ad clicked");var c=this.a&&this.a.Za();this.g.debug(xw,c);this.fireClick(c)};b.prototype.M=function(){this.h("ad skipped");this.fireSkip()};b.prototype.B=function(c){this.a=c.ad;this.h(uw,this.a);this.fireBreakStart()};b.prototype.D=function(){this.h("ad break stop");this.fireBreakStop();if(this.getPosition()===youbora.Constants.AdPosition.Postroll){var c=this.plugin.getAdapter();
18
+ c&&c.fireStop()}};b.prototype.J=function(c){(c=c.detail)&&10003===c.code&&Gw(c,this.m.getConfiguration().youbora,this.g,this)};b.prototype.h=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.g.debug.apply(this.g,[sw+c+rw].concat(_.lh(e)))};return new b(a)},Kw=function(){function a(){var b=NpawPluginAdapters.video.Shaka.call(this)||this;b.h=!1;b.f=!1;b.a=null;b.G=!1;return b}_.w(a,NpawPluginAdapters.video.Shaka);a.prototype.getPlayhead=function(){return this.getIsLive()?
19
19
  -1:this.player.getPosition()};a.prototype.getDuration=function(){return this.player.getDuration()};a.prototype.getRendition=function(){var b=null,c=null,d=null,e=this.player.getTrackManager();e&&(e=e.sa())&&(b=e.width,c=e.height,d=e.bandwidth);b&&c&&d||(e=this.j(),b=b||e.width,c=c||e.height,d=d||e.streamBandwidth);return this.getNpawUtils().buildRenditionString(b,c,d)};a.prototype.getIsLive=function(){return this.player.isLive()};a.prototype.getResource=function(){var b=this.player.$a();return b&&
20
- b.url};a.prototype.getBitrate=function(){return this.j().streamBandwidth};a.prototype.getThroughput=function(){return this.j().estimatedBandwidth};a.prototype.getPlayrate=function(){return this.player.Ec()};a.prototype.getFramesPerSecond=function(){var b=this.player.getTrackManager();return b&&(b=b.Qa())?b.frameRate:null};a.prototype.getPlayerName=function(){return _.ya};a.prototype.getVersion=function(){return"castlabs-adapter-6.32.0-js"};a.prototype.getPlayerVersion=function(){return _.ia};a.prototype.registerListeners=
21
- function(){var b=this.w();this.player&&b&&(b.on(this.player,_.kg,this.M.bind(this)),b.on(this.player,_.re,this.J.bind(this)),b.on(this.player,_.cg,this.L.bind(this)),b.on(this.player,_.bg,this.K.bind(this)),b.on(this.player,_.Fc,this.H.bind(this)),b.on(this.player,_.jd,this.I.bind(this)),b.on(this.player,_.ad,this.P.bind(this)),b.on(this.player,_.wg,this.T.bind(this)))};a.prototype.unregisterListeners=function(){dx.debug(_.Qb);_.Ai(this.w())};a.prototype.dispose=function(){this.unregisterListeners();
22
- this.G=!0;this.f=this.h=!1;this.a=null};a.prototype.j=function(){return this.player.getStats()||_.hu()};a.prototype.o=function(){return!!this.player.getConfiguration().autoplay};a.prototype.M=function(b){b=b.detail;this.l("state change",b);if(b)switch(b.currentState){case 1:this.plugin.setVideoOptions({"content.subtitles":this.D()});this.o()&&this.fireStart();break;case 3:this.fireStart();this.A();this.fireResume();this.fireBufferEnd();break;case 4:this.o()&&this.fireStart();this.A();this.fireBufferEnd();
23
- this.firePause();break;case _.iu:this.fireBufferEnd();this.fireStop();break;case 5:this.fireBufferEnd();this.h&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case 2:this.fireBufferBegin();break;default:dx.debug(Ow,b)}};a.prototype.A=function(){this.fireJoin()};a.prototype.J=function(b){(b=b.detail)&&!this.f&&this.player&&10003!==b.code&&(b=ax(b,this.player.getConfiguration().npaw,dx,this))&&b.severity===_.P&&(this.f=!0)};a.prototype.L=function(){this.player.isEnded()||(this.l(_.cg),
24
- this.fireSeekBegin())};a.prototype.B=function(b){var c=this.player.getTrackManager();if(!c)return null;var d=null;b===_.tg&&(d=c.wa());b===_.Tc&&(d=c.qa());return d?d.language:null};a.prototype.P=function(){var b=this.B(_.Tc);this.plugin.setVideoOptions({"content.language":b})};a.prototype.T=function(){var b=this.B(_.tg),c=this.D();this.plugin.setVideoOptions({"content.subtitles":b||c})};a.prototype.w=function(){this.a||(this.a=new _.xi);return this.a};a.prototype.K=function(){this.l(_.bg);this.fireSeekEnd()};
25
- a.prototype.H=function(b){dx.debug("adsTimeline",b);this.h=(b=b.adsTimeline)&&b.$b()};a.prototype.I=function(b){dx.debug("Casting",b);this.fireCasted()};a.prototype.l=function(b,c){for(var d=[],e=1;e<arguments.length;++e)d[e-1]=arguments[e];dx.debug.apply(dx,[Nw+b+Lw].concat(_.qh(d)))};a.prototype.D=function(){var b=this.player.getConfiguration();return b.npaw&&b.npaw.disabledSubtitlesLabel?b.npaw.disabledSubtitlesLabel:"off"};return a},gx=function(){function a(){var b=NpawPluginAdapters.ads.Ima.call(this)||
20
+ b.url};a.prototype.getBitrate=function(){return this.j().streamBandwidth};a.prototype.getThroughput=function(){return this.j().estimatedBandwidth};a.prototype.getPlayrate=function(){return this.player.Cc()};a.prototype.getFramesPerSecond=function(){var b=this.player.getTrackManager();return b&&(b=b.Qa())?b.frameRate:null};a.prototype.getPlayerName=function(){return _.Ba};a.prototype.getVersion=function(){return"castlabs-adapter-6.33.0-beta.1-js"};a.prototype.getPlayerVersion=function(){return _.ja};
21
+ a.prototype.registerListeners=function(){var b=this.w();this.player&&b&&(b.on(this.player,_.fg,this.M.bind(this)),b.on(this.player,_.me,this.J.bind(this)),b.on(this.player,_.Yf,this.L.bind(this)),b.on(this.player,_.Xf,this.K.bind(this)),b.on(this.player,_.Ec,this.H.bind(this)),b.on(this.player,_.id,this.I.bind(this)),b.on(this.player,_.$c,this.P.bind(this)),b.on(this.player,_.rg,this.T.bind(this)))};a.prototype.unregisterListeners=function(){Jw.debug(_.Pb);_.wi(this.w())};a.prototype.dispose=function(){this.unregisterListeners();
22
+ this.G=!0;this.f=this.h=!1;this.a=null};a.prototype.j=function(){return this.player.getStats()||_.Jt()};a.prototype.o=function(){return!!this.player.getConfiguration().autoplay};a.prototype.M=function(b){b=b.detail;this.l("state change",b);if(b)switch(b.currentState){case 1:this.plugin.setVideoOptions({"content.subtitles":this.D()});this.o()&&this.fireStart();break;case 3:this.fireStart();this.A();this.fireResume();this.fireBufferEnd();break;case 4:this.o()&&this.fireStart();this.A();this.fireBufferEnd();
23
+ this.firePause();break;case _.Zo:this.fireBufferEnd();this.fireStop();break;case 5:this.fireBufferEnd();this.h&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case 2:this.fireBufferBegin();break;default:Jw.debug(tw,b)}};a.prototype.A=function(){this.fireJoin()};a.prototype.J=function(b){(b=b.detail)&&!this.f&&this.player&&10003!==b.code&&(b=Gw(b,this.player.getConfiguration().npaw,Jw,this))&&b.severity===_.P&&(this.f=!0)};a.prototype.L=function(){this.player.isEnded()||(this.l(_.Yf),
24
+ this.fireSeekBegin())};a.prototype.B=function(b){var c=this.player.getTrackManager();if(!c)return null;var d=null;b===_.og&&(d=c.wa());b===_.Tc&&(d=c.qa());return d?d.language:null};a.prototype.P=function(){var b=this.B(_.Tc);this.plugin.setVideoOptions({"content.language":b})};a.prototype.T=function(){var b=this.B(_.og),c=this.D();this.plugin.setVideoOptions({"content.subtitles":b||c})};a.prototype.w=function(){this.a||(this.a=new _.ti);return this.a};a.prototype.K=function(){this.l(_.Xf);this.fireSeekEnd()};
25
+ a.prototype.H=function(b){Jw.debug("adsTimeline",b);this.h=(b=b.adsTimeline)&&b.Zb()};a.prototype.I=function(b){Jw.debug("Casting",b);this.fireCasted()};a.prototype.l=function(b,c){for(var d=[],e=1;e<arguments.length;++e)d[e-1]=arguments[e];Jw.debug.apply(Jw,[sw+b+qw].concat(_.lh(d)))};a.prototype.D=function(){var b=this.player.getConfiguration();return b.npaw&&b.npaw.disabledSubtitlesLabel?b.npaw.disabledSubtitlesLabel:"off"};return a},Mw=function(){function a(){var b=NpawPluginAdapters.ads.Ima.call(this)||
26
26
  this;b.a=null;b.l=null;b.h=null;b.j=null;b.D=!1;b.o=!1;return b}_.w(a,NpawPluginAdapters.ads.Ima);a.prototype.getDuration=function(){return this.a?this.a.getDuration():null};a.prototype.getRendition=function(){var b=null;this.a&&(b=this.getNpawUtils().buildRenditionString(this.a.eb(),this.a.cb(),this.a.Ga()));return b};a.prototype.getBitrate=function(){var b=null;this.a&&(b=this.a.Ga());return b};a.prototype.getPlayhead=function(){var b=null,c=this.player.getAdsManager();c&&(b=c.getPosition());return b};
27
27
  a.prototype.getResource=function(){var b=null;this.a&&(b=this.a.getMediaUrl());return b};a.prototype.getTitle=function(){var b=null;this.a&&(b=this.a.getTitle());return b};a.prototype.getProvider=function(){var b=null;this.a&&(b=this.a.getAdvertiserName());return b};a.prototype.getCreativeId=function(){var b=null;this.a&&(b=this.a.getCreativeId());return b};a.prototype.dispose=function(){this.unregisterListeners();this.D=!0;this.j=this.h=this.a=null};a.prototype.getPosition=function(){var b=this.getNpawReference().Constants.AdPosition,
28
- c=null;if(this.a)switch(this.a.Ha()){case 0:c=b.Preroll;break;case 2:c=b.Postroll;break;case 1:c=b.Midroll}fx.debug("Ad position",c);return c};a.prototype.getIsSkippable=function(){return this.a&&-1!==this.a.getSkipTimeOffset()};a.prototype.getAudioEnabled=function(){var b=this.player.getAdsManager();return b&&0<b.getAdVolume()};a.prototype.getExpectedBreaks=function(){return this.h&&this.h.getCuePoints().length};a.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};a.prototype.getExpectedAds=
29
- function(){return this.a&&this.a.fb()};a.prototype.getGivenAds=function(){return this.getExpectedAds()};a.prototype.getBreaksTime=function(){var b=this;return this.h&&this.h.getCuePoints().map(function(c){return-1===c?b.player.getDuration():c})};a.prototype.getIsFullscreen=function(){return this.player.getSurface().isFullscreen()};a.prototype.getIsVisible=function(){var b=this.player.getSurface().getContainer();b=this.getNpawUtils().calculateAdViewability(b);fx.debug(Yw,b);return b};a.prototype.getPlayerName=
30
- function(){return _.ya};a.prototype.getVersion=function(){return"castlabs-ads-adapter-6.32.0-js"};a.prototype.getPlayerVersion=function(){return _.ia};a.prototype.B=function(){this.j||(this.j=new _.xi);return this.j};a.prototype.registerListeners=function(){var b=this.B();this.player&&b&&(b.on(this.player,_.Fc,this.X.bind(this)),b.on(this.player,_.Bc,this.W.bind(this)),b.on(this.player,_.xc,this.M.bind(this)),b.on(this.player,_.zc,this.P.bind(this)),b.on(this.player,_.mc,this.K.bind(this)),b.on(this.player,
31
- _.nc,this.w.bind(this,1)),b.on(this.player,_.wc,this.w.bind(this,2)),b.on(this.player,_.Dc,this.w.bind(this,3)),b.on(this.player,_.lc,this.J.bind(this)),b.on(this.player,_.Ac,this.T.bind(this)),b.on(this.player,_.re,this.L.bind(this)),b.on(this.player,_.ic,this.G.bind(this)),b.on(this.player,_.jc,this.H.bind(this)),b.on(this.player,_.kc,this.I.bind(this)),b.on(this.player,_.yc,this.ba.bind(this)))};a.prototype.unregisterListeners=function(){_.Ai(this.B())};a.prototype.X=function(b){fx.debug(Tw,b);
32
- this.h=b.adsTimeline};a.prototype.W=function(b){this.a=b.ad;this.f("ad start",this.a);this.fireStart();this.fireJoin()};a.prototype.K=function(){this.f("ad ended");this.fireStop({adPlayhead:this.l})};a.prototype.M=function(){this.f("ad pause");this.A();this.firePause()};a.prototype.P=function(){this.f("ad resume");this.A();this.fireResume()};a.prototype.I=function(){this.o=!0;this.f(Rw);this.fireBufferBegin()};a.prototype.ba=function(){this.l=this.getPlayhead();this.A()};a.prototype.A=function(){this.o&&
33
- (this.f(Qw),this.o=!1,this.fireBufferEnd())};a.prototype.w=function(b){this.f("ad quartile",b);this.fireQuartile(b)};a.prototype.J=function(){this.f("ad clicked");var b=this.a&&this.a.Za();fx.debug(Sw,b);this.fireClick(b)};a.prototype.T=function(){this.f("ad skipped");this.fireSkip()};a.prototype.G=function(b){this.a=b.ad;this.f(Pw,this.a);this.fireBreakStart()};a.prototype.H=function(){this.f("ad break stop");this.fireBreakStop({adPlayhead:this.l});this.getPosition()===this.getNpawReference().Constants.AdPosition.Postroll&&
34
- this.fireStop({adPlayhead:this.l})};a.prototype.L=function(b){(b=b.detail)&&10003===b.code&&ax(b,this.player.getConfiguration().npaw,fx,this)};a.prototype.f=function(b,c){for(var d=[],e=1;e<arguments.length;++e)d[e-1]=arguments[e];fx.debug.apply(fx,[Nw+b+Lw].concat(_.qh(d)))};return a},hx=function(){this.a=null;this.g=new _.M(Uw);this.m=null},ix=function(a,b){if(b.namespace()===_.yd)return a.g.info("NPAW does not report when casting."),!1;var c=b.getConfiguration().npaw;return _.N.Ng(c)?c.accountCode?
35
- _.N.R(window.NpawPlugin)||_.N.R(window.NpawPluginAdapters)?(a.g.warn("NPAW SDK not found."),b.onError(new _.O(1,9,9100)),!1):!0:(a.g.warn("accountCode key is missing in NPAW config"),b.onError(new _.O(1,9,9101)),!1):(a.g.warn("NPAW plugin is loaded but not configured. Will do nothing."),!1)},jx=function(a){a.a&&(a.g.info("Removing NPAW Plugins",a.a),a.a.removeAdsAdapter(),a.a.removeAdapter())},kx=function(){this.a=null;this.g=new _.M(Vw);this.m=null},lx=function(a,b){if(b.namespace()===_.yd)return a.g.info("Youbora does not report when casting."),
36
- !1;var c=b.getConfiguration().youbora;if(!_.N.Ng(c))return a.g.debug("Youbora plugin is loaded but not configured. Will do nothing."),!1;if(!c.accountCode)return a.g.warn("accountCode key is missing in Youbora config"),b.onError(new _.O(1,9,9101)),!1;if(_.N.R(window.youbora))return a.g.warn("Youbora SDK not found."),b.onError(new _.O(1,9,9100)),!1;"6.8.59"!==youbora.VERSION&&(a.g.warn("Youbora SDK version is not supported. The supported version is 6.8.59, found version "+(youbora.VERSION+". Some or all features of YouboraPlugin may not work correctly.")),
37
- b.onError(new _.O(1,9,9102)));return!0},mx=function(){};var dx=new _.M("clpp.npaw.NpawAdapter");var fx=new _.M("clpp.npaw.NpawAdsAdapter");_.w(hx,_.cw);_.r=hx.prototype;_.r.oh=function(a){jx(this);if(this.a=a)this.a.registerAdapterFromClass(this.m,ex()),this.a.registerAdsAdapterFromClass(this.m,gx())};_.r.Cm=function(){return this.a};_.r.getAdapter=function(){return this.a&&this.a.getAdapter()};_.r.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.r.onPlayerCreated=function(a){this.m=a;ix(this,a)&&(a=a.getConfiguration().npaw,this.oh(new NpawPlugin(a.accountCode)))};
38
- _.r.onContentWillLoad=function(a,b){if(ix(this,a)){var c=a.getConfiguration(),d=c.npaw;void 0===d[Ww]&&(d[Ww]=b.isLive);void 0===d[Xw]&&(d[Xw]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.oh(new NpawPlugin(d.accountCode));this.a.setAnalyticsOptions(d)}};_.r.onContentLoaded=function(a){var b={};(a=a.getDrmInfo())&&(a=Zw(a.keySystem))&&(b["content.drm"]=a);this.g.info(_.bf,b);this.a.setAnalyticsOptions(b)};_.r.onPlayerWillRelease=function(){};
39
- _.r.onPlayerWillDestroy=function(){jx(this);this.a&&this.a.destroy()};_.r.id=function(){return"npaw"};_.J(Uw,hx);hx.prototype.getAdsAdapter=hx.prototype.getAdsAdapter;hx.prototype.getAdapter=hx.prototype.getAdapter;hx.prototype.getNpawPlugin=hx.prototype.Cm;hx.prototype.setNpawPlugin=hx.prototype.oh;hx.Id="npaw";new _.M(Uw);_.w(kx,_.cw);_.r=kx.prototype;_.r.ph=function(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(bx(this.m)),this.a.setAdsAdapter(cx(this.m))};_.r.getAdapter=function(){return this.a&&this.a.getAdapter()};_.r.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.r.onPlayerCreated=function(a){this.m=a;lx(this,a)&&(a=a.getConfiguration().youbora,this.ph(new youbora.Plugin(a)))};
40
- _.r.onContentWillLoad=function(a,b){if(lx(this,a)){var c=a.getConfiguration(),d=c.youbora;void 0===d[Ww]&&(d[Ww]=b.isLive);void 0===d[Xw]&&(d[Xw]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.ph(new youbora.Plugin(d));this.a.setOptions(d)}};_.r.onPlayerWillRelease=function(){};_.r.onPlayerWillDestroy=function(){};_.r.id=function(){return"youbora"};_.J(Vw,kx);kx.prototype.getAdsAdapter=kx.prototype.getAdsAdapter;kx.prototype.getAdapter=kx.prototype.getAdapter;
41
- kx.prototype.setYouboraPlugin=kx.prototype.ph;kx.Id="youbora";mx.prototype.create=function(a){return a.npaw?new hx:a.youbora?new kx:null};_.bp(new mx);};
28
+ c=null;if(this.a)switch(this.a.Ha()){case 0:c=b.Preroll;break;case 2:c=b.Postroll;break;case 1:c=b.Midroll}Lw.debug("Ad position",c);return c};a.prototype.getIsSkippable=function(){return this.a&&-1!==this.a.getSkipTimeOffset()};a.prototype.getAudioEnabled=function(){var b=this.player.getAdsManager();return b&&0<b.getAdVolume()};a.prototype.getExpectedBreaks=function(){return this.h&&this.h.getCuePoints().length};a.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};a.prototype.getExpectedAds=
29
+ function(){return this.a&&this.a.fb()};a.prototype.getGivenAds=function(){return this.getExpectedAds()};a.prototype.getBreaksTime=function(){var b=this;return this.h&&this.h.getCuePoints().map(function(c){return-1===c?b.player.getDuration():c})};a.prototype.getIsFullscreen=function(){return this.player.getSurface().isFullscreen()};a.prototype.getIsVisible=function(){var b=this.player.getSurface().getContainer();b=this.getNpawUtils().calculateAdViewability(b);Lw.debug(Dw,b);return b};a.prototype.getPlayerName=
30
+ function(){return _.Ba};a.prototype.getVersion=function(){return"castlabs-ads-adapter-6.33.0-beta.1-js"};a.prototype.getPlayerVersion=function(){return _.ja};a.prototype.B=function(){this.j||(this.j=new _.ti);return this.j};a.prototype.registerListeners=function(){var b=this.B();this.player&&b&&(b.on(this.player,_.Ec,this.X.bind(this)),b.on(this.player,_.Ac,this.W.bind(this)),b.on(this.player,_.vc,this.M.bind(this)),b.on(this.player,_.yc,this.P.bind(this)),b.on(this.player,_.lc,this.K.bind(this)),
31
+ b.on(this.player,_.mc,this.w.bind(this,1)),b.on(this.player,_.tc,this.w.bind(this,2)),b.on(this.player,_.Cc,this.w.bind(this,3)),b.on(this.player,_.kc,this.J.bind(this)),b.on(this.player,_.zc,this.T.bind(this)),b.on(this.player,_.me,this.L.bind(this)),b.on(this.player,_.hc,this.G.bind(this)),b.on(this.player,_.ic,this.H.bind(this)),b.on(this.player,_.jc,this.I.bind(this)),b.on(this.player,_.xc,this.ba.bind(this)))};a.prototype.unregisterListeners=function(){_.wi(this.B())};a.prototype.X=function(b){Lw.debug(yw,
32
+ b);this.h=b.adsTimeline};a.prototype.W=function(b){this.a=b.ad;this.f("ad start",this.a);this.fireStart();this.fireJoin()};a.prototype.K=function(){this.f("ad ended");this.fireStop({adPlayhead:this.l})};a.prototype.M=function(){this.f("ad pause");this.A();this.firePause()};a.prototype.P=function(){this.f("ad resume");this.A();this.fireResume()};a.prototype.I=function(){this.o=!0;this.f(ww);this.fireBufferBegin()};a.prototype.ba=function(){this.l=this.getPlayhead();this.A()};a.prototype.A=function(){this.o&&
33
+ (this.f(vw),this.o=!1,this.fireBufferEnd())};a.prototype.w=function(b){this.f("ad quartile",b);this.fireQuartile(b)};a.prototype.J=function(){this.f("ad clicked");var b=this.a&&this.a.Za();Lw.debug(xw,b);this.fireClick(b)};a.prototype.T=function(){this.f("ad skipped");this.fireSkip()};a.prototype.G=function(b){this.a=b.ad;this.f(uw,this.a);this.fireBreakStart()};a.prototype.H=function(){this.f("ad break stop");this.fireBreakStop({adPlayhead:this.l});this.getPosition()===this.getNpawReference().Constants.AdPosition.Postroll&&
34
+ this.fireStop({adPlayhead:this.l})};a.prototype.L=function(b){(b=b.detail)&&10003===b.code&&Gw(b,this.player.getConfiguration().npaw,Lw,this)};a.prototype.f=function(b,c){for(var d=[],e=1;e<arguments.length;++e)d[e-1]=arguments[e];Lw.debug.apply(Lw,[sw+b+qw].concat(_.lh(d)))};return a},Nw=function(){this.a=null;this.g=new _.L(zw);this.m=null},Ow=function(a,b){if(b.namespace()===_.xd)return a.g.info("NPAW does not report when casting."),!1;var c=b.getConfiguration().npaw;return _.M.Mg(c)?c.accountCode?
35
+ _.M.R(window.NpawPlugin)||_.M.R(window.NpawPluginAdapters)?(a.g.warn("NPAW SDK not found."),b.onError(new _.N(1,9,9100)),!1):!0:(a.g.warn("accountCode key is missing in NPAW config"),b.onError(new _.N(1,9,9101)),!1):(a.g.warn("NPAW plugin is loaded but not configured. Will do nothing."),!1)},Pw=function(a){a.a&&(a.g.info("Removing NPAW Plugins",a.a),a.a.removeAdsAdapter(),a.a.removeAdapter())},Qw=function(){this.a=null;this.g=new _.L(Aw);this.m=null},Rw=function(a,b){if(b.namespace()===_.xd)return a.g.info("Youbora does not report when casting."),
36
+ !1;var c=b.getConfiguration().youbora;if(!_.M.Mg(c))return a.g.debug("Youbora plugin is loaded but not configured. Will do nothing."),!1;if(!c.accountCode)return a.g.warn("accountCode key is missing in Youbora config"),b.onError(new _.N(1,9,9101)),!1;if(_.M.R(window.youbora))return a.g.warn("Youbora SDK not found."),b.onError(new _.N(1,9,9100)),!1;"6.8.59"!==youbora.VERSION&&(a.g.warn("Youbora SDK version is not supported. The supported version is 6.8.59, found version "+(youbora.VERSION+". Some or all features of YouboraPlugin may not work correctly.")),
37
+ b.onError(new _.N(1,9,9102)));return!0},Sw=function(){};var Jw=new _.L("clpp.npaw.NpawAdapter");var Lw=new _.L("clpp.npaw.NpawAdsAdapter");_.w(Nw,_.Pv);_.r=Nw.prototype;_.r.nh=function(a){Pw(this);if(this.a=a)this.a.registerAdapterFromClass(this.m,Kw()),this.a.registerAdsAdapterFromClass(this.m,Mw())};_.r.Am=function(){return this.a};_.r.getAdapter=function(){return this.a&&this.a.getAdapter()};_.r.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.r.onPlayerCreated=function(a){this.m=a;Ow(this,a)&&(a=a.getConfiguration().npaw,this.nh(new NpawPlugin(a.accountCode)))};
38
+ _.r.onContentWillLoad=function(a,b){if(Ow(this,a)){var c=a.getConfiguration(),d=c.npaw;void 0===d[Bw]&&(d[Bw]=b.isLive);void 0===d[Cw]&&(d[Cw]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.nh(new NpawPlugin(d.accountCode));this.a.setAnalyticsOptions(d)}};_.r.onContentLoaded=function(a){var b={};(a=a.getDrmInfo())&&(a=Ew(a.keySystem))&&(b["content.drm"]=a);this.g.info(_.Xe,b);this.a.setAnalyticsOptions(b)};_.r.onPlayerWillRelease=function(){};
39
+ _.r.onPlayerWillDestroy=function(){Pw(this);this.a&&this.a.destroy()};_.r.id=function(){return"npaw"};_.K(zw,Nw);Nw.prototype.getAdsAdapter=Nw.prototype.getAdsAdapter;Nw.prototype.getAdapter=Nw.prototype.getAdapter;Nw.prototype.getNpawPlugin=Nw.prototype.Am;Nw.prototype.setNpawPlugin=Nw.prototype.nh;Nw.Id="npaw";new _.L(zw);_.w(Qw,_.Pv);_.r=Qw.prototype;_.r.oh=function(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(Hw(this.m)),this.a.setAdsAdapter(Iw(this.m))};_.r.getAdapter=function(){return this.a&&this.a.getAdapter()};_.r.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.r.onPlayerCreated=function(a){this.m=a;Rw(this,a)&&(a=a.getConfiguration().youbora,this.oh(new youbora.Plugin(a)))};
40
+ _.r.onContentWillLoad=function(a,b){if(Rw(this,a)){var c=a.getConfiguration(),d=c.youbora;void 0===d[Bw]&&(d[Bw]=b.isLive);void 0===d[Cw]&&(d[Cw]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.oh(new youbora.Plugin(d));this.a.setOptions(d)}};_.r.onPlayerWillRelease=function(){};_.r.onPlayerWillDestroy=function(){};_.r.id=function(){return"youbora"};_.K(Aw,Qw);Qw.prototype.getAdsAdapter=Qw.prototype.getAdsAdapter;Qw.prototype.getAdapter=Qw.prototype.getAdapter;
41
+ Qw.prototype.setYouboraPlugin=Qw.prototype.oh;Qw.Id="youbora";Sw.prototype.create=function(a){return a.npaw?new Nw:a.youbora?new Qw:null};_.To(new Sw);};
42
42
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
43
43
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
44
44
  else{_=this.clpp._;(f.call(g,this));}
package/cl.adobe.js CHANGED
@@ -1,3 +1,3 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var eX=function(a){a.f=new _.Qt;a.f.on(a.m,_.ug,()=>cX(a));a.f.on(a.m,_.tg,()=>{s.Media.play(a.a,a.m.getPosition())});a.f.on(a.m,_.se,()=>dX(a));a.f.on(a.m,_.Rf,b=>{b=b.detail;switch(b.currentState){case 3:a.a.length||dX(a);s.Media.play(a.a,a.m.getPosition());break;case 4:case 2:cX(a);break;case 5:case _.Fs:case _.vs:a.g.info(`Close session for ${a.a} `+`in player state ${b.currentState}.`),cX(a),s.Media.close(a.a),a.a=""}})},cX=function(a){s.Media.stop(a.a,a.m.getPosition())},dX=function(a){{const b=
2
- a.m.Ra();a.a=b?b.name||b.url:""}a.g.info(`Open session for ${a.a} `+`with duration ${a.m.getDuration()}`);s.Media.open(a.a,a.m.getDuration(),_.ra)},fX=class extends _.Uv{constructor(){super();this.m=this.f=null;this.a="";this.g=new _.T("clpp.adobe.AdobePlugin")}onPlayerCreated(a){var b=a.getConfiguration().adobe;(b=!b||!1!==b.enabled)?window.s&&s.Media?(this.m=a,eX(this)):this.g.warn("Adobe API not available."):this.g.debug("Adobe plugin is disabled.")}onPlayerWillDestroy(){this.f&&(this.f.release(),
3
- this.f=null);this.m=null;this.a=""}id(){return"adobe"}};_.x("clpp.adobe.AdobeAnalyticsPlugin",fX);fX.Id="adobe";_.Pn(new class{create(){return new fX}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var YW=function(a){a.f=new _.Bt;a.f.on(a.m,_.lg,()=>WW(a));a.f.on(a.m,_.kg,()=>{s.Media.play(a.a,a.m.getPosition())});a.f.on(a.m,_.me,()=>XW(a));a.f.on(a.m,_.Lf,b=>{b=b.detail;switch(b.currentState){case 3:a.a.length||XW(a);s.Media.play(a.a,a.m.getPosition());break;case 4:case 2:WW(a);break;case 5:case _.qo:case _.ko:a.g.info(`Close session for ${a.a} `+`in player state ${b.currentState}.`),WW(a),s.Media.close(a.a),a.a=""}})},WW=function(a){s.Media.stop(a.a,a.m.getPosition())},XW=function(a){{const b=
2
+ a.m.Qa();a.a=b?b.name||b.url:""}a.g.info(`Open session for ${a.a} `+`with duration ${a.m.getDuration()}`);s.Media.open(a.a,a.m.getDuration(),_.sa)},ZW=class extends _.Ev{constructor(){super();this.m=this.f=null;this.a="";this.g=new _.T("clpp.adobe.AdobePlugin")}onPlayerCreated(a){var b=a.getConfiguration().adobe;(b=!b||!1!==b.enabled)?window.s&&s.Media?(this.m=a,YW(this)):this.g.warn("Adobe API not available."):this.g.debug("Adobe plugin is disabled.")}onPlayerWillDestroy(){this.f&&(this.f.release(),
3
+ this.f=null);this.m=null;this.a=""}id(){return"adobe"}};_.w("clpp.adobe.AdobeAnalyticsPlugin",ZW);ZW.Id="adobe";_.En(new class{create(){return new ZW}});};f.call(g, window);
package/cl.airplay.js CHANGED
@@ -1,3 +1,3 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var bX=class extends _.Uv{constructor(){super();this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.Yt(()=>{this.m.play().catch(()=>{})});this.h=new _.Qt}onPlayerCreated(a){this.m=a;this.a=a.getSurface().getMedia()}onContentWillLoad(){this.a&&(this.h.on(this.a,"webkitplaybacktargetavailabilitychanged",this.w.bind(this)),this.h.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.A.bind(this)))}onPlayerWillRelease(){this.o.stop();this.h.release()}id(){return"airplay"}w(a){switch(a.availability){case "available":this.f=
2
- !0;break;case "not-available":this.f=!1}this.m.trigger(new _.H(_.tc,{canCast:this.f}))}A(){const a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.sc:_.rc;if(this.l||!this.m.isPaused()||3===this.m.getState())this.l?this.m.play().catch(()=>{}):this.o.la(.01);this.m.trigger(new _.H(a))}ya(){return this.j}Sc(){return this.f}aj(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())}};_.x("clpp.airplay.AirPlayPlugin",bX);bX.prototype.showCastMenu=bX.prototype.aj;
3
- bX.prototype.canCast=bX.prototype.Sc;bX.prototype.isCasting=bX.prototype.ya;bX.Id="airplay";_.Pn(new class{create(){return new bX}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var VW=class extends _.Ev{constructor(){super();this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.Jt(()=>{this.m.play().catch(()=>{})});this.h=new _.Bt}onPlayerCreated(a){this.m=a;this.a=a.getSurface().getMedia()}onContentWillLoad(){this.a&&(this.h.on(this.a,"webkitplaybacktargetavailabilitychanged",this.w.bind(this)),this.h.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.A.bind(this)))}onPlayerWillRelease(){this.o.stop();this.h.release()}id(){return"airplay"}w(a){switch(a.availability){case "available":this.f=
2
+ !0;break;case "not-available":this.f=!1}this.m.trigger(new _.H(_.rc,{canCast:this.f}))}A(){const a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.qc:_.pc;if(this.l||!this.m.isPaused()||3===this.m.getState())this.l?this.m.play().catch(()=>{}):this.o.la(.01);this.m.trigger(new _.H(a))}ya(){return this.j}Qc(){return this.f}$i(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())}};_.w("clpp.airplay.AirPlayPlugin",VW);VW.prototype.showCastMenu=VW.prototype.$i;
3
+ VW.prototype.canCast=VW.prototype.Qc;VW.prototype.isCasting=VW.prototype.ya;VW.Id="airplay";_.En(new class{create(){return new VW}});};f.call(g, window);
package/cl.broadpeak.js CHANGED
@@ -1,14 +1,14 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var RW=function(a){const b=a.m.getSurface().getMedia();b&&(a.l=a.H.bind(a),b.addEventListener("click",a.l))},SW=function(a){a.C.off(a.m,_.gg,a.F)},TW=function(a){class b extends GenericPlayerApi{constructor(c){super();this.m=c;this.f=_.lj();this.a=0}getPlayerName(){return _.ra}getVersion(){return _.ea}getOSName(){return this.f.os}getDeviceVersion(){return this.f.osVersion.name}getDeviceType(){return"browser"}getTotalDuration(){return this.m.isLive()?0:this.a=1E3*this.m.getDuration()}getCurrentPosition(){const c=
2
- 1E3*this.m.getPosition();return 5===this.m.getState()?Math.max(c,this.a):c}getCurrentBitrate(){const c=this.m.getStats();return(c?c.streamBandwidth:0)/1E3}getCapabilities(){return{adTracking:this.m.getConfiguration().broadpeak.adTracking}}}return new b(a)},UW=function(){return!window.SmartLib||!window.GenericPlayerApi},VW=function(a,b){const c=b.analyticsAddress||null,d=b.nanoCDNHost||null,e=b.broadpeakDomainNames||"";b=b.uuid||null;a.h||(a.h=SmartLib.getInstance(),a.h.init(c,d,e),typeof b===_.Uf&&
3
- a.h.setUUID(b))},WW=function(a,b,c){const d=c.customParameters||{};a.a=a.h.createStreamingSession();a.a.setOption(StreamingSessionOptions.SESSION_PRECACHE,!0);for(const e in d)a.a.setCustomParameter(e,d[e]);c.adTracking&&(a.j=b.getAdsManager(),a.j.initialize(a.a,c.adParameters||{}));a.w.on(b,_.Yd,a.A.bind(a));a.o=TW(b);a.a.attachPlayer(a.o)},XW=function(a,b){_.Xh(a.w);a.f&&(a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},Z=class{constructor(a,b,c){this.a=a||{};this.f=b||{};this.w=
4
- c||0;this.o=0;this.l=this.j=this.h=!1}cb(){return"Broadpeak"}eb(){return""}gb(){return 1}getId(){return this.a.adId}getCreativeId(){return this.a.creativeId}zb(){return null}getApiFramework(){return null}getAdSystem(){return""}getAdvertiserName(){return""}getTitle(){return""}getDuration(){return 0>=this.a.duration?-1:this.a.duration/1E3}getPosition(){return this.o}setPosition(a){this.o=a}getSkipTimeOffset(){return 0===this.a.skipPosition?-1:(this.a.skipPosition-this.a.startPosition)/1E3}Bb(){return!1}Qa(){return this.a.clickURL}getMediaUrl(){return null}Ua(){return 0}Ta(){return 0}Ba(){return 0}Ca(){return 0===
5
- this.f.startPosition?0:0<this.w&&this.f.startPosition+this.f.duration>=this.w?2:1}getPodIndex(){return 1}pb(){return this.f.startPosition/1E3}fb(){return this.a.index+1}Va(){return 0>=this.f.adCount?-1:this.f.adCount}getWrapperAdIds(){return[]}getWrapperAdSystems(){return[]}getWrapperCreativeIds(){return[]}Ab(){return null}canSeek(){return!1}};Z.prototype.canSeek=Z.prototype.canSeek;Z.prototype.getVideoElement=Z.prototype.Ab;Z.prototype.getWrapperCreativeIds=Z.prototype.getWrapperCreativeIds;
6
- Z.prototype.getWrapperAdSystems=Z.prototype.getWrapperAdSystems;Z.prototype.getWrapperAdIds=Z.prototype.getWrapperAdIds;Z.prototype.getSequenceLength=Z.prototype.Va;Z.prototype.getPositionInSequence=Z.prototype.fb;Z.prototype.getPodTimeOffset=Z.prototype.pb;Z.prototype.getPodIndex=Z.prototype.getPodIndex;Z.prototype.getPodType=Z.prototype.Ca;Z.prototype.getMediaBitrate=Z.prototype.Ba;Z.prototype.getMediaHeight=Z.prototype.Ta;Z.prototype.getMediaWidth=Z.prototype.Ua;Z.prototype.getMediaUrl=Z.prototype.getMediaUrl;
7
- Z.prototype.getClickThroughUrl=Z.prototype.Qa;Z.prototype.isBumper=Z.prototype.Bb;Z.prototype.getSkipTimeOffset=Z.prototype.getSkipTimeOffset;Z.prototype.getPosition=Z.prototype.getPosition;Z.prototype.getDuration=Z.prototype.getDuration;Z.prototype.getTitle=Z.prototype.getTitle;Z.prototype.getAdvertiserName=Z.prototype.getAdvertiserName;Z.prototype.getAdSystem=Z.prototype.getAdSystem;Z.prototype.getApiFramework=Z.prototype.getApiFramework;Z.prototype.getSourceId=Z.prototype.zb;
8
- Z.prototype.getCreativeId=Z.prototype.getCreativeId;Z.prototype.getId=Z.prototype.getId;Z.prototype.getTechnology=Z.prototype.gb;Z.prototype.getAdManagerVersion=Z.prototype.eb;Z.prototype.getAdManagerName=Z.prototype.cb;var YW=class{constructor(a,b){this.m=a;this.f=b;this.a=new _.Qt;this.h=!1}init(){const a=this.m,b=this.a;b.on(a,_.Rf,this.o.bind(this));b.on(a,_.Nc,this.j.bind(this));b.on(a,"seek",this.l.bind(this))}j(a){a=a.detail;typeof a.bandwidth===_.r&&this.f.notifyLayerSwitch(a.bandwidth/1E3)}o(a){const b=this.m,c=this.f;a=a.detail;const d=a.currentState;2===a.previousState&&c.notifyStallEnd(!b.isPaused());switch(d){case 2:c.notifyStallStart();break;case 3:this.h?c.notifyResume():(c.notifyFirstImage(),this.h=
9
- !0);break;case 4:c.notifyPause()}}l(){const a=1E3*this.m.getPosition();this.f.notifySeek(a)}release(){this.a&&(_.Xh(this.a),this.a=null)}};var ZW=class{constructor(a){this.m=a;this.C=new _.Qt;this.l=this.B=this.f=this.a=null;this.F=this.G.bind(this)}initialize(a,b){this.B=a;a.activateAdvertising();RW(this);for(const c in b)a.setAdParameter(c,b[c]);a.setAdEventsListener({onAdBreakBegin:()=>{this.m.trigger(new _.H(_.Ub,{ad:null}));this.C.on(this.m,_.gg,this.F)},onAdBegin:(c,d)=>{this.f=c;this.a=new Z(c,d,1E3*this.m.getDuration());this.m.trigger(new _.H(_.mc,{ad:this.a}))},onAdSkippable:()=>{},onAdEnd:()=>{if(this.a){const c={ad:this.a};
10
- this.m.trigger(new _.H(_.Yb,c));this.m.trigger(new _.H(_.nc,c));this.f=this.a=null}},onAdBreakEnd:()=>{SW(this);this.m.trigger(new _.H(_.Vb));this.a=null}})}H(){if(this.a&&this.B){var a=this.a.Qa();a&&(this.B.adUserInteraction("click"),this.m.trigger(new _.H(_.Xb,{ad:this.a})),this.m.pause(),(a=window.open(a,"_blank"))&&a.focus())}}G(){if(this.a&&this.f){var a=this.m.getPosition()-this.f.startPosition/1E3,b=this.a.getDuration();0<b&&a>b||(this.a.setPosition(a),this.m.trigger(new _.H(_.jc,{ad:this.a})),
11
- !this.a.h&&a>=b/4&&(this.a.h=!0,this.m.trigger(new _.H(_.Zb,{ad:this.a}))),!this.a.j&&a>=b/2&&(this.a.j=!0,this.m.trigger(new _.H(_.ec,{ad:this.a}))),!this.a.l&&a>=3*b/4&&(this.a.l=!0,this.m.trigger(new _.H(_.oc,{ad:this.a}))))}}load(){return Promise.resolve()}j(){return!0}A(){}w(){return!0}skip(){if(this.a){var a=this.a.getPosition(),b=this.a.getSkipTimeOffset();-1===b||a<b||(a=this.m.getPosition()-a+this.a.getDuration(),b=this.a,this.f=this.a=null,SW(this),this.m.trigger(new _.H(_.lc,{ad:b})),this.m.setPosition(a))}}ib(){}isPaused(){}pause(){}resume(){}getAdVolume(){return 0}h(){}getVolume(){return 0}setVolume(){}setMuted(){}isMuted(){return!1}qb(){return!1}getPosition(){return this.a?
12
- this.a.getPosition():-1}o(){SW(this);this.C.release();const a=this.m.getSurface().getMedia();a&&this.l&&(a.removeEventListener("click",this.l),this.l=null);this.B=this.f=this.a=null;return Promise.resolve()}};ZW.prototype.getPosition=ZW.prototype.getPosition;ZW.prototype.setVolume=ZW.prototype.setVolume;ZW.prototype.getVolume=ZW.prototype.getVolume;ZW.prototype.resume=ZW.prototype.resume;ZW.prototype.pause=ZW.prototype.pause;ZW.prototype.skip=ZW.prototype.skip;var $W=class extends _.Uv{constructor(){super();this.o=this.f=this.a=this.h=this.m=null;this.w=new _.Qt;this.l=!1;this.j=null}onPlayerCreated(a){this.m=a}onContentWillLoad(a,b){const c=a.getConfiguration().broadpeak;if(c){if(UW())return a.onError(new _.I(1,9,11E3));this.l=!0;VW(this,c);WW(this,a,c);return this.a.getURL(b.url).then(d=>{if(d.isError()){const e=d.getDetailedErrorCode();d=d.getDetailedErrorMessage();this.m.onError(new _.I(1,9,11001,{bpkErrorCode:e,message:d}));XW(this,void 0)}else b.url=
13
- d.getURL(),this.f=new YW(this.m,this.o),this.f.init()})}}onContentLoaded(){!1!==this.l&&this.a.precacheEnded()}A(a){a=a.detail;if(7003===a.code)XW(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.D)switch(a.category){case 3:XW(this,SmartLib.BPDecodingError);break;case 1:XW(this,SmartLib.BPNetworkingError);break;case 6:XW(this,SmartLib.BPAccessRightError);break;default:XW(this,SmartLib.BPUnspecifiedError)}}onPlayerWillRelease(){this.j=null;UW()||XW(this,SmartLib.BPSessionEndsNormally);
14
- this.l=!1}id(){return"broadpeak"}};_.x("clpp.broadpeak.BroadpeakPlugin",$W);$W.isSdkMissing=UW;$W.Id="broadpeak";var aX=class{name(){return"clpp.broadpeak.AdsManagerFactory"}a(a,b){return UW()?!1:!!(b&&b.broadpeak&&b.broadpeak.adTracking)}create(a){return new ZW(a)}};_.Pn(new class{create(){return new $W}});_.Gh(new aX);};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var KW=function(a){const b=a.m.getSurface().getMedia();b&&(a.l=a.H.bind(a),b.addEventListener("click",a.l))},LW=function(a){a.C.off(a.m,_.ag,a.F)},MW=function(a){class b extends GenericPlayerApi{constructor(c){super();this.m=c;this.f=_.ij();this.a=0}getPlayerName(){return _.sa}getVersion(){return _.ea}getOSName(){return this.f.os}getDeviceVersion(){return this.f.osVersion.name}getDeviceType(){return"browser"}getTotalDuration(){return this.m.isLive()?0:this.a=1E3*this.m.getDuration()}getCurrentPosition(){const c=
2
+ 1E3*this.m.getPosition();return 5===this.m.getState()?Math.max(c,this.a):c}getCurrentBitrate(){const c=this.m.getStats();return(c?c.streamBandwidth:0)/1E3}getCapabilities(){return{adTracking:this.m.getConfiguration().broadpeak.adTracking}}}return new b(a)},NW=function(){return!window.SmartLib||!window.GenericPlayerApi},OW=function(a,b){const c=b.analyticsAddress||null,d=b.nanoCDNHost||null,e=b.broadpeakDomainNames||"";b=b.uuid||null;a.h||(a.h=SmartLib.getInstance(),a.h.init(c,d,e),typeof b===_.Of&&
3
+ a.h.setUUID(b))},PW=function(a,b,c){const d=c.customParameters||{};a.a=a.h.createStreamingSession();a.a.setOption(StreamingSessionOptions.SESSION_PRECACHE,!0);for(const e in d)a.a.setCustomParameter(e,d[e]);c.adTracking&&(a.j=b.getAdsManager(),a.j.initialize(a.a,c.adParameters||{}));a.w.on(b,_.Sd,a.A.bind(a));a.o=MW(b);a.a.attachPlayer(a.o)},QW=function(a,b){_.Sh(a.w);a.f&&(a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},Z=class{constructor(a,b,c){this.a=a||{};this.f=b||{};this.w=
4
+ c||0;this.o=0;this.l=this.j=this.h=!1}cb(){return"Broadpeak"}eb(){return""}gb(){return 1}getId(){return this.a.adId}getCreativeId(){return this.a.creativeId}yb(){return null}getApiFramework(){return null}getAdSystem(){return""}getAdvertiserName(){return""}getTitle(){return""}getDuration(){return 0>=this.a.duration?-1:this.a.duration/1E3}getPosition(){return this.o}setPosition(a){this.o=a}getSkipTimeOffset(){return 0===this.a.skipPosition?-1:(this.a.skipPosition-this.a.startPosition)/1E3}Ab(){return!1}Pa(){return this.a.clickURL}getMediaUrl(){return null}Ta(){return 0}Sa(){return 0}Ba(){return 0}Ca(){return 0===
5
+ this.f.startPosition?0:0<this.w&&this.f.startPosition+this.f.duration>=this.w?2:1}getPodIndex(){return 1}ob(){return this.f.startPosition/1E3}fb(){return this.a.index+1}Ua(){return 0>=this.f.adCount?-1:this.f.adCount}getWrapperAdIds(){return[]}getWrapperAdSystems(){return[]}getWrapperCreativeIds(){return[]}zb(){return null}canSeek(){return!1}};Z.prototype.canSeek=Z.prototype.canSeek;Z.prototype.getVideoElement=Z.prototype.zb;Z.prototype.getWrapperCreativeIds=Z.prototype.getWrapperCreativeIds;
6
+ Z.prototype.getWrapperAdSystems=Z.prototype.getWrapperAdSystems;Z.prototype.getWrapperAdIds=Z.prototype.getWrapperAdIds;Z.prototype.getSequenceLength=Z.prototype.Ua;Z.prototype.getPositionInSequence=Z.prototype.fb;Z.prototype.getPodTimeOffset=Z.prototype.ob;Z.prototype.getPodIndex=Z.prototype.getPodIndex;Z.prototype.getPodType=Z.prototype.Ca;Z.prototype.getMediaBitrate=Z.prototype.Ba;Z.prototype.getMediaHeight=Z.prototype.Sa;Z.prototype.getMediaWidth=Z.prototype.Ta;Z.prototype.getMediaUrl=Z.prototype.getMediaUrl;
7
+ Z.prototype.getClickThroughUrl=Z.prototype.Pa;Z.prototype.isBumper=Z.prototype.Ab;Z.prototype.getSkipTimeOffset=Z.prototype.getSkipTimeOffset;Z.prototype.getPosition=Z.prototype.getPosition;Z.prototype.getDuration=Z.prototype.getDuration;Z.prototype.getTitle=Z.prototype.getTitle;Z.prototype.getAdvertiserName=Z.prototype.getAdvertiserName;Z.prototype.getAdSystem=Z.prototype.getAdSystem;Z.prototype.getApiFramework=Z.prototype.getApiFramework;Z.prototype.getSourceId=Z.prototype.yb;
8
+ Z.prototype.getCreativeId=Z.prototype.getCreativeId;Z.prototype.getId=Z.prototype.getId;Z.prototype.getTechnology=Z.prototype.gb;Z.prototype.getAdManagerVersion=Z.prototype.eb;Z.prototype.getAdManagerName=Z.prototype.cb;var RW=class{constructor(a,b){this.m=a;this.f=b;this.a=new _.Bt;this.h=!1}init(){const a=this.m,b=this.a;b.on(a,_.Lf,this.o.bind(this));b.on(a,_.Lc,this.j.bind(this));b.on(a,"seek",this.l.bind(this))}j(a){a=a.detail;typeof a.bandwidth===_.r&&this.f.notifyLayerSwitch(a.bandwidth/1E3)}o(a){const b=this.m,c=this.f;a=a.detail;const d=a.currentState;2===a.previousState&&c.notifyStallEnd(!b.isPaused());switch(d){case 2:c.notifyStallStart();break;case 3:this.h?c.notifyResume():(c.notifyFirstImage(),this.h=
9
+ !0);break;case 4:c.notifyPause()}}l(){const a=1E3*this.m.getPosition();this.f.notifySeek(a)}release(){this.a&&(_.Sh(this.a),this.a=null)}};var SW=class{constructor(a){this.m=a;this.C=new _.Bt;this.l=this.B=this.f=this.a=null;this.F=this.G.bind(this)}initialize(a,b){this.B=a;a.activateAdvertising();KW(this);for(const c in b)a.setAdParameter(c,b[c]);a.setAdEventsListener({onAdBreakBegin:()=>{this.m.trigger(new _.H(_.Sb,{ad:null}));this.C.on(this.m,_.ag,this.F)},onAdBegin:(c,d)=>{this.f=c;this.a=new Z(c,d,1E3*this.m.getDuration());this.m.trigger(new _.H(_.kc,{ad:this.a}))},onAdSkippable:()=>{},onAdEnd:()=>{if(this.a){const c={ad:this.a};
10
+ this.m.trigger(new _.H(_.Wb,c));this.m.trigger(new _.H(_.lc,c));this.f=this.a=null}},onAdBreakEnd:()=>{LW(this);this.m.trigger(new _.H(_.Tb));this.a=null}})}H(){if(this.a&&this.B){var a=this.a.Pa();a&&(this.B.adUserInteraction("click"),this.m.trigger(new _.H(_.Vb,{ad:this.a})),this.m.pause(),(a=window.open(a,"_blank"))&&a.focus())}}G(){if(this.a&&this.f){var a=this.m.getPosition()-this.f.startPosition/1E3,b=this.a.getDuration();0<b&&a>b||(this.a.setPosition(a),this.m.trigger(new _.H(_.ec,{ad:this.a})),
11
+ !this.a.h&&a>=b/4&&(this.a.h=!0,this.m.trigger(new _.H(_.Xb,{ad:this.a}))),!this.a.j&&a>=b/2&&(this.a.j=!0,this.m.trigger(new _.H(_.cc,{ad:this.a}))),!this.a.l&&a>=3*b/4&&(this.a.l=!0,this.m.trigger(new _.H(_.mc,{ad:this.a}))))}}load(){return Promise.resolve()}j(){return!0}A(){}w(){return!0}skip(){if(this.a){var a=this.a.getPosition(),b=this.a.getSkipTimeOffset();-1===b||a<b||(a=this.m.getPosition()-a+this.a.getDuration(),b=this.a,this.f=this.a=null,LW(this),this.m.trigger(new _.H(_.jc,{ad:b})),this.m.setPosition(a))}}ib(){}isPaused(){}pause(){}resume(){}getAdVolume(){return 0}h(){}getVolume(){return 0}setVolume(){}setMuted(){}isMuted(){return!1}pb(){return!1}getPosition(){return this.a?
12
+ this.a.getPosition():-1}o(){LW(this);this.C.release();const a=this.m.getSurface().getMedia();a&&this.l&&(a.removeEventListener("click",this.l),this.l=null);this.B=this.f=this.a=null;return Promise.resolve()}};SW.prototype.getPosition=SW.prototype.getPosition;SW.prototype.setVolume=SW.prototype.setVolume;SW.prototype.getVolume=SW.prototype.getVolume;SW.prototype.resume=SW.prototype.resume;SW.prototype.pause=SW.prototype.pause;SW.prototype.skip=SW.prototype.skip;var TW=class extends _.Ev{constructor(){super();this.o=this.f=this.a=this.h=this.m=null;this.w=new _.Bt;this.l=!1;this.j=null}onPlayerCreated(a){this.m=a}onContentWillLoad(a,b){const c=a.getConfiguration().broadpeak;if(c){if(NW())return a.onError(new _.I(1,9,11E3));this.l=!0;OW(this,c);PW(this,a,c);return this.a.getURL(b.url).then(d=>{if(d.isError()){const e=d.getDetailedErrorCode();d=d.getDetailedErrorMessage();this.m.onError(new _.I(1,9,11001,{bpkErrorCode:e,message:d}));QW(this,void 0)}else b.url=
13
+ d.getURL(),this.f=new RW(this.m,this.o),this.f.init()})}}onContentLoaded(){!1!==this.l&&this.a.precacheEnded()}A(a){a=a.detail;if(7003===a.code)QW(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.D)switch(a.category){case 3:QW(this,SmartLib.BPDecodingError);break;case 1:QW(this,SmartLib.BPNetworkingError);break;case 6:QW(this,SmartLib.BPAccessRightError);break;default:QW(this,SmartLib.BPUnspecifiedError)}}onPlayerWillRelease(){this.j=null;NW()||QW(this,SmartLib.BPSessionEndsNormally);
14
+ this.l=!1}id(){return"broadpeak"}};_.w("clpp.broadpeak.BroadpeakPlugin",TW);TW.isSdkMissing=NW;TW.Id="broadpeak";var UW=class{name(){return"clpp.broadpeak.AdsManagerFactory"}a(a,b){return NW()?!1:!!(b&&b.broadpeak&&b.broadpeak.adTracking)}create(a){return new SW(a)}};_.En(new class{create(){return new TW}});_.Ah(new UW);};f.call(g, window);