@castlabs/prestoplay 6.25.2 → 6.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +5 -5
  3. package/cjs/cl.adobe.js +3 -3
  4. package/cjs/cl.airplay.js +3 -3
  5. package/cjs/cl.broadpeak.js +7 -7
  6. package/cjs/cl.cast.js +115 -114
  7. package/cjs/cl.conviva.js +32 -32
  8. package/cjs/cl.core.js +620 -620
  9. package/cjs/cl.crypto.js +9 -9
  10. package/cjs/cl.dash.js +89 -88
  11. package/cjs/cl.externs.js +89 -51
  12. package/cjs/cl.freewheel.js +25 -25
  13. package/cjs/cl.hls.js +79 -77
  14. package/cjs/cl.hlssmpte.js +6 -6
  15. package/cjs/cl.htmlcue.js +30 -30
  16. package/cjs/cl.ima.js +24 -24
  17. package/cjs/cl.mediatailor.js +3 -3
  18. package/cjs/cl.mse.js +351 -336
  19. package/cjs/cl.muxdata.js +15 -15
  20. package/cjs/cl.onboard.js +3 -3
  21. package/cjs/cl.persistent.js +15 -15
  22. package/cjs/cl.playlist.js +6 -6
  23. package/cjs/cl.sessions.js +16 -16
  24. package/cjs/cl.simid.js +17 -17
  25. package/cjs/cl.smooth.js +72 -72
  26. package/cjs/cl.thumbnails.js +26 -26
  27. package/cjs/cl.tizen.js +73 -72
  28. package/cjs/cl.ttml.js +29 -29
  29. package/cjs/cl.verimatrix.js +5 -5
  30. package/cjs/cl.vimond.js +12 -12
  31. package/cjs/cl.vr.js +19 -19
  32. package/cjs/cl.vtt.js +14 -14
  33. package/cjs/cl.yospace.js +4 -4
  34. package/cjs/cl.youbora.js +39 -37
  35. package/cjs/polyfill.min.js +15 -3
  36. package/cl.adobe.js +3 -3
  37. package/cl.airplay.js +3 -3
  38. package/cl.broadpeak.js +5 -5
  39. package/cl.cast.js +92 -90
  40. package/cl.conviva.js +27 -27
  41. package/cl.core.js +496 -500
  42. package/cl.crypto.js +9 -9
  43. package/cl.dash.js +82 -82
  44. package/cl.externs.js +89 -51
  45. package/cl.freewheel.js +19 -19
  46. package/cl.hls.js +80 -80
  47. package/cl.hlssmpte.js +5 -5
  48. package/cl.htmlcue.js +26 -26
  49. package/cl.ima.js +17 -17
  50. package/cl.mediatailor.js +3 -3
  51. package/cl.mse.js +305 -294
  52. package/cl.muxdata.js +13 -13
  53. package/cl.onboard.js +4 -4
  54. package/cl.persistent.js +11 -11
  55. package/cl.playlist.js +5 -5
  56. package/cl.sessions.js +10 -10
  57. package/cl.simid.js +14 -14
  58. package/cl.smooth.js +60 -60
  59. package/cl.thumbnails.js +19 -19
  60. package/cl.tizen.js +57 -57
  61. package/cl.ttml.js +22 -22
  62. package/cl.verimatrix.js +4 -4
  63. package/cl.vimond.js +8 -8
  64. package/cl.vr.js +15 -15
  65. package/cl.vtt.js +12 -12
  66. package/cl.yospace.js +3 -3
  67. package/cl.youbora.js +29 -28
  68. package/package.json +3 -3
  69. package/typings.d.ts +124 -3
package/cjs/cl.vimond.js CHANGED
@@ -1,16 +1,16 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var ky="Registering listeners",ly="clpp.vimond.VimondPlugin",my=function(a,b,c,d,e){this.G=a;this.H=b;this.I=c;this.m=d;this.C=e;this.a=new _.gi;this.l=!0;this.f=this.j=this.A=!1;this.B=null;this.h=new _.Xh(this.Rh.bind(this));this.g=new _.J("clpp.vimond.VimondDispatcher");this.o=this.w=0;this.m&&this.a&&(this.g.debug(ky),this.a.on(this.m,_.bg,this.ll.bind(this)),this.a.on(this.m,_.rg,this.ml.bind(this)),this.a.on(this.m,_.hc,this.jl.bind(this)),this.a.on(this.m,_.ic,this.kl.bind(this)))},ny=function(a,
3
- b){a.m.trigger(new _.K(_.Og,{detail:b}))},oy=function(a,b,c){b&&(a.A=!0,a.h.stop());a.m.onError(new _.N(b?_.O:1,9,9201,c))},py=function(a,b,c,d,e){this.l=a;this.o=c;this.h=b;this.a=d;this.j=e;this.g=new _.J("clpp.vimond.VimondService");this.f=0},qy=function(a){this.m=a;this.a=new _.gi;this.g=new _.J("clpp.vimond.VimondAdapter");this.f=this.h=!1;this.m&&this.a&&(this.g.debug(ky),this.a.on(this.m,_.Kf,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
- ry=function(a,b){var c=a.m.getState();if(1===b)return["str-start",_.rf];if(a.h)return[_.ge,_.bf];if(c===_.Aq)return[_.ge,null];if(c===_.Eq)return[_.ie,_.bf];var d=_.bf;if(c===_.yq||c===_.Hq||a.f)d=_.rf;return["period",d]},sy=function(){this.a=!1;this.g=new _.J(ly);this.j=this.h=this.f=null},ty=function(){};_.r=my.prototype;_.r.ml=function(){this.f||(this.f=1<Math.abs(this.w-this.m.getPosition()));this.w=this.m.getPosition()};_.r.jl=function(){this.g.debug("Ad break started");this.j=!0};
5
- _.r.kl=function(){this.g.debug("Ad break stopped");this.j=!1};
6
- _.r.ll=function(a){var b=this,c,d,e,f,g;return _.H(function(h){if(1==h.a){c=a.detail;d=_.Cq;e=c.currentState;f=c.previousState;b.g.debug("State changed, prev: "+f+" curr: "+e);if(b.A||b.j)return h["return"]();if(e===b.B&&!b.f)return b.g.debug("Ignore transition"),h["return"]();if(b.l&&e!==d.PLAYING)return h["return"]();if(b.f&&[d.PAUSED,d.BUFFERING].includes(e))return b.g.debug("Seeking"),h["return"]();b.f&&e===d.PLAYING&&(b.g.debug("Seeked"),b.f=!1);g=[d.PLAYING,d.PAUSED,d.ERROR,d.ENDED];if(!g.includes(e))return h.D(0);
7
- b.B=e;return _.x(h,b.Rh(),3)}e===d.ENDED&&b.h.stop();_.y(h)})};
8
- _.r.Rh=function(){var a=this,b,c,d,e,f,g;return _.H(function(h){if(1==h.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.h.stop();a.h.ga(a.l?10:a.G);a.l=!1;_.C(h,2);return _.x(h,a.C.fireEvent(),4)}if(2!=h.a)return b=h.f,ny(a,b),_.uh(h,0);d=c=_.E(h);e=d.code;f=d.data;g=[1002,1003];g.includes(e)?(a.g.debug("Unreachable service"),ny(a,f),oy(a,a.H,f)):1001===e?(a.g.debug("Generic service error"),ny(a,f),oy(a,a.I,f)):a.g.error(c.toString());_.y(h)})};py.prototype.fireEvent=function(){this.f++;var a=_.L.ta(this.o);a.client.buildName=_.xa;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.getLoadedSource().url;a.client.userAgent=navigator.userAgent;a.client.videoFormat=this.a.m.getLoadedSource().type||"";b=a.client;c=this.a.m.getLoadedSource();c=((new _.Mk(c.url)).scheme||"").replace(":","");b.videoProtocol=c;b=ry(this.a,this.f);a.client.playerEvent=
9
- b[0]||"";a.client.playerState=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!==_.Zc&&(b.liveResumePossible=!0)}a.progress.eventNumber=this.f;a.timestamp=(new Date).toISOString();this.g.debug("Fire an event");b=_.ck(this.l);
10
- b.method=_.sb;b.contentType="application/json";b.headers.Authorization="Bearer "+this.h;b.body=_.Q.Fd(JSON.stringify(a));return this.j.fetch(b).S};py.prototype.Xg=function(a){this.h=a};qy.prototype.getPosition=function(){return Math.floor(this.m.getPosition())};qy.prototype.o=function(){this.h=!0};qy.prototype.j=function(){this.f=!0};qy.prototype.l=function(){this.f=!1};_.w(sy,_.bw);_.r=sy.prototype;_.r.onPlayerCreated=function(){};
11
- _.r.onContentWillLoad=function(a){var b=a.getConfiguration();(this.a=!_.L.R(b.vimond)&&typeof b.vimond===_.Re)?a.namespace()===_.sd&&(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=_.u(["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(_.ya);
12
- c=b.failIfUnreachable;typeof c!==_.Zc&&(c=!0);d=b.failOnError;typeof d!==_.Zc&&(d=!0);this.f=new qy(a);this.h=new py(b.playerEventRequest.uri,b.authToken,b.playerEventRequest.body,this.f,a.getNetworkEngine());this.j=new my(b.playerEventRequest.eventInterval,c,d,a,this.h)}};_.r.onPlayerWillRelease=function(){if(this.a){if(this.f){var a=this.f;a.g.debug(_.Rb);_.ki(a.a)}this.j&&(a=this.j,a.g.debug(_.Rb),_.ki(a.a),a.h.stop());this.j=this.h=this.f=null}};_.r.onPlayerWillDestroy=function(){};_.r.id=function(){return"vimond"};
13
- _.r.Xg=function(a){this.a&&this.h&&this.h.Xg(a)};_.I(ly,sy);sy.prototype.updateAuthToken=sy.prototype.Xg;sy.Id="vimond";ty.prototype.create=function(){return new sy};_.Yt(new ty);};
2
+ var f=function(window){var cy="Registering listeners",dy="clpp.vimond.VimondPlugin",ey=function(a,b,c,d,e){this.G=a;this.H=b;this.I=c;this.m=d;this.F=e;this.a=new _.gi;this.l=!0;this.f=this.j=this.A=!1;this.B=null;this.h=new _.Xh(this.Lh.bind(this));this.g=new _.K("clpp.vimond.VimondDispatcher");this.o=this.w=0;this.m&&this.a&&(this.g.debug(cy),this.a.on(this.m,_.bg,this.gl.bind(this)),this.a.on(this.m,_.sg,this.hl.bind(this)),this.a.on(this.m,_.gc,this.el.bind(this)),this.a.on(this.m,_.hc,this.fl.bind(this)))},fy=function(a,
3
+ b){a.m.trigger(new _.M(_.Pg,{detail:b}))},gy=function(a,b,c){b&&(a.A=!0,a.h.stop());a.m.onError(new _.O(b?_.Q:1,9,9201,c))},hy=function(a,b,c,d,e){this.l=a;this.o=c;this.h=b;this.a=d;this.j=e;this.g=new _.K("clpp.vimond.VimondService");this.f=0},iy=function(a){this.m=a;this.a=new _.gi;this.g=new _.K("clpp.vimond.VimondAdapter");this.f=this.h=!1;this.m&&this.a&&(this.g.debug(cy),this.a.on(this.m,_.Kf,this.o.bind(this)),this.a.on(this.m,_.gc,this.j.bind(this)),this.a.on(this.m,_.hc,this.l.bind(this)))},
4
+ jy=function(a,b){var c=a.m.getState();if(1===b)return["str-start",_.rf];if(a.h)return[_.fe,_.bf];if(c===_.Sq)return[_.fe,null];if(c===_.Wq)return[_.he,_.bf];var d=_.bf;if(c===_.Qq||c===_.Zq||a.f)d=_.rf;return["period",d]},ky=function(){this.a=!1;this.g=new _.K(dy);this.j=this.h=this.f=null},ly=function(){};_.r=ey.prototype;_.r.hl=function(){this.f||(this.f=1<Math.abs(this.w-this.m.getPosition()));this.w=this.m.getPosition()};_.r.el=function(){this.g.debug("Ad break started");this.j=!0};
5
+ _.r.fl=function(){this.g.debug("Ad break stopped");this.j=!1};
6
+ _.r.gl=function(a){var b=this,c,d,e,f,g;return _.I(function(h){if(1==h.a){c=a.detail;d=_.Uq;e=c.currentState;f=c.previousState;b.g.debug("State changed, prev: "+f+" curr: "+e);if(b.A||b.j)return h["return"]();if(e===b.B&&!b.f)return b.g.debug("Ignore transition"),h["return"]();if(b.l&&e!==d.PLAYING)return h["return"]();if(b.f&&[d.PAUSED,d.BUFFERING].includes(e))return b.g.debug("Seeking"),h["return"]();b.f&&e===d.PLAYING&&(b.g.debug("Seeked"),b.f=!1);g=[d.PLAYING,d.PAUSED,d.ERROR,d.ENDED];if(!g.includes(e))return h.C(0);
7
+ b.B=e;return _.x(h,b.Lh(),3)}e===d.ENDED&&b.h.stop();_.z(h)})};
8
+ _.r.Lh=function(){var a=this,b,c,d,e,f,g;return _.I(function(h){if(1==h.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.h.stop();a.h.ha(a.l?10:a.G);a.l=!1;_.F(h,2);return _.x(h,a.F.fireEvent(),4)}if(2!=h.a)return b=h.f,fy(a,b),_.G(h,0);d=c=_.H(h);e=d.code;f=d.data;g=[1002,1003];g.includes(e)?(a.g.debug("Unreachable service"),fy(a,f),gy(a,a.H,f)):1001===e?(a.g.debug("Generic service error"),fy(a,f),gy(a,a.I,f)):a.g.error(c.toString());_.z(h)})};hy.prototype.fireEvent=function(){this.f++;var a=_.N.ua(this.o);a.client.buildName=_.xa;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.getLoadedSource().url;a.client.userAgent=navigator.userAgent;a.client.videoFormat=this.a.m.getLoadedSource().type||"";b=a.client;c=this.a.m.getLoadedSource();c=((new _.rj(c.url)).scheme||"").replace(":","");b.videoProtocol=c;b=jy(this.a,this.f);a.client.playerEvent=
9
+ b[0]||"";a.client.playerState=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!==_.Yc&&(b.liveResumePossible=!0)}a.progress.eventNumber=this.f;a.timestamp=(new Date).toISOString();this.g.debug("Fire an event");b=_.Yj(this.l);
10
+ b.method=_.rb;b.contentType="application/json";b.headers.Authorization="Bearer "+this.h;b.body=_.R.xd(JSON.stringify(a));return this.j.fetch(b).T};hy.prototype.Rg=function(a){this.h=a};iy.prototype.getPosition=function(){return Math.floor(this.m.getPosition())};iy.prototype.o=function(){this.h=!0};iy.prototype.j=function(){this.f=!0};iy.prototype.l=function(){this.f=!1};_.w(ky,_.Hv);_.r=ky.prototype;_.r.onPlayerCreated=function(){};
11
+ _.r.onContentWillLoad=function(a){var b=a.getConfiguration();(this.a=!_.N.R(b.vimond)&&typeof b.vimond===_.Re)?a.namespace()===_.rd&&(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(_.ya);
12
+ c=b.failIfUnreachable;typeof c!==_.Yc&&(c=!0);d=b.failOnError;typeof d!==_.Yc&&(d=!0);this.f=new iy(a);this.h=new hy(b.playerEventRequest.uri,b.authToken,b.playerEventRequest.body,this.f,a.getNetworkEngine());this.j=new ey(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);_.ji(a.a)}this.j&&(a=this.j,a.g.debug(_.Qb),_.ji(a.a),a.h.stop());this.j=this.h=this.f=null}};_.r.onPlayerWillDestroy=function(){};_.r.id=function(){return"vimond"};
13
+ _.r.Rg=function(a){this.a&&this.h&&this.h.Rg(a)};_.J(dy,ky);ky.prototype.updateAuthToken=ky.prototype.Rg;ky.Id="vimond";ly.prototype.create=function(){return new ky};_.ru(new ly);};
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 Qx="touchmove",Rx="touchstart",Sx=function(a,b,c,d){this.x=a||0;this.y=b||0;this.a=c||0;this.f=d||1},Tx=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)},Ux=function(a,b,c){c*=.5;var d=Math.sqrt(a*a+b*b),e=Math.sin(c);return new Sx(a/d*e,b/d*e,0/d*e,Math.cos(c))},Vx=function(a,b,c){this.x=a||0;this.y=b||0;this.a=c||0},Wx=function(a,b){isFinite(b)?(a.x*=b,a.y*=b,a.a*=
3
- b):(a.x=0,a.y=0,a.a=0)},Xx=function(a,b){return a.x*b.x+a.y*b.y+a.a*b.a},Yx=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},Zx=function(){this.a=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])},$x=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},ay=function(a){var b=new Vx(0,0,0),c=new Vx(0,0,1),d=new Vx,e=new Vx,f=new Vx;a=a.a;var g=new Vx(0,1,0);f.x=b.x-g.x;f.y=b.y-g.y;f.a=b.a-g.a;g=f.length();Wx(f,1/g);c=Yx(d,c,f);g=c.length();Wx(c,1/g);Yx(e,f,d);a[0]=d.x;a[1]=d.y;a[2]=d.a;a[3]=-Xx(d,b);a[4]=e.x;a[5]=e.y;a[6]=e.a;a[7]=-Xx(e,b);a[8]=f.x;a[9]=f.y;a[10]=f.a;a[11]=-Xx(f,b);a[12]=0;a[13]=0;a[14]=0;a[15]=1},cy=function(a){this.a=a;this.f=a.createProgram();this.l=
5
- by(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=by(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)},by=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},dy=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 h=c/128,l=(.5+h)*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-h);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)},ey=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)},fy=function(){var a=this;this.o=this.w=this.L=this.J=this.A=
10
- this.da=this.H=this.f=this.a=this.m=null;this.g=new _.J("clpp.vr");this.I=70;this.ca=1;this.P=this.N=!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 Zx;this.Y=new Zx;this.ha=new Zx;this.ja=new Zx;this.B=this.tn.bind(this);
11
- this.C=this.un.bind(this);this.K=this.sn.bind(this)},gy=function(a){var b=Ux(1,0,a.l*Math.PI/180);Tx(Ux(0,1,a.j*Math.PI/180),a.T);Tx(b,a.Y);ay(a.ha);$x(a.ja,a.T,a.ha);$x(a.H,a.Y,a.ja)},hy=function(a){a.a&&(a.a.removeEventListener("mousemove",a.B,!1),a.a.removeEventListener(Qx,a.B,!1),a.a.removeEventListener("mouseup",a.C,!1),a.a.removeEventListener("touchend",a.C,!1))},iy=function(){};Vx.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.a*this.a)};Zx.prototype.set=function(a,b,c,d,e,f,g,h,l,m,n,p,q,t,v,z){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]=h;A[2]=l;A[6]=m;A[10]=n;A[14]=p;A[3]=q;A[7]=t;A[11]=v;A[15]=z;return this};var jy={alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!1,devicePixelRatio:1};_.w(fy,_.bw);_.r=fy.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&&_.L.wa(d))this.I=d;else throw new _.N(1,7,7100,"fieldOfView configuration must be a number");if(void 0!==e&&_.L.wa(e)&&0<e)this.ca=e;else throw new _.N(1,7,7100,"sensitivity configuration must be a positive number");this.N=!!f;this.P=!!c;if(a=a.getSurface())if((d=a.getMedia())&&d.tagName.toLowerCase()===_.Jg){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",jy)||this.a.getContext("experimental-webgl",jy);if(!this.f)throw new _.N(1,9,9003,"Unable to create GL context");this.H=new Zx;ay(this.H);this.da=new dy(this.f);this.A=new cy(this.f);this.J=new Zx;this.L=new Zx;this.o=this.w=null;this.a.addEventListener(_.Nf,this.G)}a.addElementToContainer(this.a,!0,!0);a.hideMediaElement();b.vr.attachMouseListener&&(this.a.addEventListener("mousedown",this.K,
14
- !1),this.a.addEventListener(Rx,this.K,!1));this.G();this.fj()}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&&(hy(this),this.a.removeEventListener(_.Nf,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 _.H(function(b){a.m=null;_.y(b)})};_.r.id=function(){return"vr"};
16
- _.r.fj=function(){if(this.m&&this.f){var a=this.m.getSurface();if(a&&(a=a.getMedia())&&a.tagName.toLowerCase()===_.Jg){this.w=requestAnimationFrame(this.fj.bind(this));var b=this.f;this.o||a.readyState!==a.HAVE_ENOUGH_DATA||(this.o=new ey(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=$x(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.da;a.a.bindBuffer(a.a.ARRAY_BUFFER,
2
+ var f=function(window){var Ix="touchmove",Jx="touchstart",Kx=function(a,b,c,d){this.x=a||0;this.y=b||0;this.a=c||0;this.f=d||1},Lx=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)},Mx=function(a,b,c){c*=.5;var d=Math.sqrt(a*a+b*b),e=Math.sin(c);return new Kx(a/d*e,b/d*e,0/d*e,Math.cos(c))},Nx=function(a,b,c){this.x=a||0;this.y=b||0;this.a=c||0},Ox=function(a,b){isFinite(b)?(a.x*=b,a.y*=b,a.a*=
3
+ b):(a.x=0,a.y=0,a.a=0)},Px=function(a,b){return a.x*b.x+a.y*b.y+a.a*b.a},Qx=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},Rx=function(){this.a=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])},Sx=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},Tx=function(a){var b=new Nx(0,0,0),c=new Nx(0,0,1),d=new Nx,e=new Nx,f=new Nx;a=a.a;var g=new Nx(0,1,0);f.x=b.x-g.x;f.y=b.y-g.y;f.a=b.a-g.a;g=f.length();Ox(f,1/g);c=Qx(d,c,f);g=c.length();Ox(c,1/g);Qx(e,f,d);a[0]=d.x;a[1]=d.y;a[2]=d.a;a[3]=-Px(d,b);a[4]=e.x;a[5]=e.y;a[6]=e.a;a[7]=-Px(e,b);a[8]=f.x;a[9]=f.y;a[10]=f.a;a[11]=-Px(f,b);a[12]=0;a[13]=0;a[14]=0;a[15]=1},Vx=function(a){this.a=a;this.f=a.createProgram();this.l=
5
+ Ux(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=Ux(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)},Ux=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},Wx=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 h=c/128,l=(.5+h)*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-h);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)},Xx=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)},Yx=function(){var a=this;this.o=this.w=this.L=this.J=this.A=
10
+ this.fa=this.H=this.f=this.a=this.m=null;this.g=new _.K("clpp.vr");this.I=70;this.da=1;this.P=this.N=!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.U=new Rx;this.Z=new Rx;this.ja=new Rx;this.ka=new Rx;this.B=this.ln.bind(this);
11
+ this.F=this.mn.bind(this);this.K=this.kn.bind(this)},Zx=function(a){var b=Mx(1,0,a.l*Math.PI/180);Lx(Mx(0,1,a.j*Math.PI/180),a.U);Lx(b,a.Z);Tx(a.ja);Sx(a.ka,a.U,a.ja);Sx(a.H,a.Z,a.ka)},$x=function(a){a.a&&(a.a.removeEventListener("mousemove",a.B,!1),a.a.removeEventListener(Ix,a.B,!1),a.a.removeEventListener("mouseup",a.F,!1),a.a.removeEventListener("touchend",a.F,!1))},ay=function(){};Nx.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.a*this.a)};Rx.prototype.set=function(a,b,c,d,e,f,g,h,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]=h;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 by={alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!1,devicePixelRatio:1};_.w(Yx,_.Hv);_.r=Yx.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.xa(d))this.I=d;else throw new _.O(1,7,7100,"fieldOfView configuration must be a number");if(void 0!==e&&_.N.xa(e)&&0<e)this.da=e;else throw new _.O(1,7,7100,"sensitivity configuration must be a positive number");this.N=!!f;this.P=!!c;if(a=a.getSurface())if((d=a.getMedia())&&d.tagName.toLowerCase()===_.Jg){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",by)||this.a.getContext("experimental-webgl",by);if(!this.f)throw new _.O(1,9,9003,"Unable to create GL context");this.H=new Rx;Tx(this.H);this.fa=new Wx(this.f);this.A=new Vx(this.f);this.J=new Rx;this.L=new Rx;this.o=this.w=null;this.a.addEventListener(_.Nf,this.G)}a.addElementToContainer(this.a,!0,!0);a.hideMediaElement();b.vr.attachMouseListener&&(this.a.addEventListener("mousedown",this.K,
14
+ !1),this.a.addEventListener(Jx,this.K,!1));this.G();this.bj()}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&&($x(this),this.a.removeEventListener(_.Nf,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.bj=function(){if(this.m&&this.f){var a=this.m.getSurface();if(a&&(a=a.getMedia())&&a.tagName.toLowerCase()===_.Jg){this.w=requestAnimationFrame(this.bj.bind(this));var b=this.f;this.o||a.readyState!==a.HAVE_ENOUGH_DATA||(this.o=new Xx(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=Sx(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.fa;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.sn=function(a){this.g.debug("Mouse Down. Enable VR mouse interaction");a.preventDefault();if(0===a.button||a.type===Rx)a.type===Rx?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(Qx,this.B,!1),this.a.addEventListener("mouseup",this.C,!1),this.a.addEventListener("touchend",this.C,!1)};
20
- _.r.tn=function(a){a.preventDefault();var b=a.clientX,c=a.clientY;a.type===Qx&&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.ca;c=d*b*(this.P?-1:1);this.j+=a*b*(this.N?-1:1);this.l+=c;gy(this)};_.r.un=function(a){this.g.debug("Mouse Up. Removing mouse interaction listeners");a.preventDefault();hy(this)};_.r.Lm=function(a,b){this.l=b;this.j=a;gy(this)};_.r.Pl=function(){return{x:this.j,y:this.l}};
21
- _.r.no=function(a){this.I=a;this.G()};_.I("clpp.vr.VrPlugin",fy);fy.prototype.setCameraFieldOfView=fy.prototype.no;fy.prototype.getCameraCoordinates=fy.prototype.Pl;fy.prototype.moveCamera=fy.prototype.Lm;fy.Id="vr";iy.prototype.create=function(){return new fy};_.Yt(new iy);};
19
+ _.r.kn=function(a){this.g.debug("Mouse Down. Enable VR mouse interaction");a.preventDefault();if(0===a.button||a.type===Jx)a.type===Jx?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(Ix,this.B,!1),this.a.addEventListener("mouseup",this.F,!1),this.a.addEventListener("touchend",this.F,!1)};
20
+ _.r.ln=function(a){a.preventDefault();var b=a.clientX,c=a.clientY;a.type===Ix&&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.da;c=d*b*(this.P?-1:1);this.j+=a*b*(this.N?-1:1);this.l+=c;Zx(this)};_.r.mn=function(a){this.g.debug("Mouse Up. Removing mouse interaction listeners");a.preventDefault();$x(this)};_.r.Dm=function(a,b){this.l=b;this.j=a;Zx(this)};_.r.Jl=function(){return{x:this.j,y:this.l}};
21
+ _.r.ho=function(a){this.I=a;this.G()};_.J("clpp.vr.VrPlugin",Yx);Yx.prototype.setCameraFieldOfView=Yx.prototype.ho;Yx.prototype.getCameraCoordinates=Yx.prototype.Jl;Yx.prototype.moveCamera=Yx.prototype.Dm;Yx.Id="vr";ay.prototype.create=function(){return new Yx};_.ru(new ay);};
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 wx=" The setting will be ignored.",xx="VTT parser encountered an invalid VTT setting: ",yx="application/x-subrip",zx="text/srt",Ax='text/vtt; codecs\x3d"vtt"',Bx='text/vtt; codecs\x3d"wvtt"',Cx=function(a){_.Jj(a,/[ \t]+/gm)},Dx=function(a){return a.a===a.f.length?null:(a=_.Jj(a,/[^ \t\n]*/gm))?a[0]:null},Ex=function(){},Fx=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},Gx=function(){},Hx=function(a){this.a=a},Jx=function(a,b,c){var d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"===b?a.textAlign=_.Ni:a.textAlign=
4
- _.hw[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"===d[1]?_.Gg:_.Hg;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===_.ye||b===_.ag?_.ye:b===_.ze||b===_.ge?_.ze:_.id);else if(d=/^region:(.*)$/.exec(b)){if(b=Ix(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=_.iw[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.Pi,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.iw[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},Ix=function(a,b){var c=a.filter(function(d){return d.id===b});return c.length?c[0]:(_.Jh("VTT parser could not find a region with id: ",b," The region will be ignored."),null)},Kx=function(a){a=_.Jj(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)},Lx=function(){Hx.apply(this,arguments)},Mx=function(){this.a=null;this.g=new _.J("clpp.vtt.mp4")},Ox=function(a,b,c){var d,e,f;(new _.pn).M("payl",_.sn(function(g){d=_.Q.ea(g)})).M("iden",_.sn(function(g){e=_.Q.ea(g)})).M("sttg",_.sn(function(g){f=_.Q.ea(g)})).parse(a);return d?Nx(d,e,f,b,c):null},Nx=function(a,b,c,d,e){a=new _.Si(d,e,a,_.Qg);b&&(a.id=b);if(c)for(b=new _.Ij(c),c=
7
- Dx(b);c;)Jx(a,c,[])||_.Jh(xx,c,wx),Cx(b),c=Dx(b);return a},Px=function(){this.j=new Gx};Ex.prototype.a=function(a){a=_.Q.ea(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=_.u(b);for(var c=b.next();!c.done;c=b.next())a+=Fx(c.value)}return _.Q.hb(a)};Gx.prototype.create=function(){return new Ex};Gx.prototype.probe=function(a,b){return(a===zx||a===yx)&&b===_.kg};Hx.prototype.parseInit=function(){};
8
- Hx.prototype.parseMedia=function(a,b){var c=_.Q.ea(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(_.O,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=Kx(new _.Ij(e[1]));if(null==c)throw new _.N(_.O,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=_.u(d);for(var g=e.next();!g.done;g=e.next()){var h=g.value;if(/^region/.test(h.toLowerCase())){h=new _.Ij(h.replace(/\n/g," "));g=new _.Vi;Dx(h);Cx(h);for(var l=Dx(h);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||_.Jh("VTT parser encountered an invalid VTTRegion setting: ",l,wx);Cx(h);l=Dx(h)}f.push(g)}}e=[];h=_.u(d);for(g=h.next();!g.done;g=h.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)}h=[];d=_.u(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 _.Ij(p[0]);m=Kx(l);var t=_.Jj(l,/[ \t]+--\x3e[ \t]+/g);n=Kx(l);if(null==m||null==t||null==n)throw new _.N(_.O,2,2001);m+=q;n+=q;p=p.slice(1).join("\n").trim();m=new _.Si(m,n,p,_.Qg);g&&(m.id=g);Cx(l);for(n=Dx(l);n;)Jx(m,n,f)||_.Jh(xx,
12
- n,wx),Cx(l),n=Dx(l);null!=g&&(m.id=g);g=m}g&&h.push(g)}return{cues:h,styles:e}};_.w(Lx,Hx);Lx.prototype.parseMedia=function(a,b){return Hx.prototype.parseMedia.call(this,(new Ex).a(a),b)};Mx.prototype.parseInit=function(a){var b=this,c=!1;(new _.pn).M(_.Ne,_.qn).M(_.tg,_.qn).M(_.He,_.qn).aa("mdhd",function(d){0===d.version?(d.reader.skip(4),d.reader.skip(4),b.a=_.kn(d.reader),d.reader.skip(4)):(d.reader.skip(8),d.reader.skip(8),b.a=_.kn(d.reader),d.reader.skip(8));d.reader.skip(4)}).M(_.Le,_.qn).M(_.dg,_.qn).aa(_.fg,_.rn).M("wvtt",function(){c=!0}).parse(a);if(!this.a)throw new _.N(_.O,2,2008);if(!c)throw new _.N(_.O,2,2008);};
13
- Mx.prototype.parseMedia=function(a,b){if(!this.a)throw this.g.error("No init segment for MP4+VTT!"),new _.N(_.O,2,2008);var c=0,d=[],e,f=[],g=!1,h=!1,l=!1,m=null;(new _.pn).M("moof",_.qn).M("traf",_.qn).aa("tfdt",function(F){g=!0;c=0===F.version?_.kn(F.reader):_.mn(F.reader)}).aa("tfhd",function(F){var M=F.flags;F=F.reader;F.skip(4);M&1&&F.skip(8);M&2&&F.skip(4);m=M&8?_.kn(F):null}).aa("trun",function(F){h=!0;var M=F.version,R=F.flags;F=F.reader;var ka=_.kn(F);R&1&&F.skip(4);R&4&&F.skip(4);for(var U=
14
- [],qa=0;qa<ka;qa++){var Ba={duration:null,sampleSize:null,Tg:null};R&256&&(Ba.duration=_.kn(F));R&512&&(Ba.sampleSize=_.kn(F));R&1024&&F.skip(4);R&2048&&(Ba.Tg=0===M?_.kn(F):_.ln(F));U.push(Ba)}d=U}).M(_.Ge,_.sn(function(F){l=!0;e=F})).parse(a);if(!l&&!g&&!h)throw new _.N(_.O,2,2008);var n=c,p=new DataView(e.buffer,e.byteOffset,e.byteLength);p=new _.en(p,!1);for(var q=_.u(d),t=q.next();!t.done;t=q.next()){t=t.value;var v=t.duration||m,z=t.Tg?c+t.Tg:n;n=z+(v||0);var A=0;do{var D=_.kn(p);A+=D;var G=
15
- _.kn(p);G=_.un(G);var B=null;"vttc"===G?8<D&&(B=_.on(p,D-8)):("vtte"!==G&&this.g.error("Unknown box "+G+"! Skipping!"),p.skip(D-8));v?B&&f.push(Ox(B,b.periodStart+z/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(_.aj),styles:[]}};_.w(Px,_.Bu);Px.prototype.f=function(){_.Av(_.kg,Hx);_.Av(Ax,Hx);_.Av(Bx,Hx);_.Av(_.Lc,Mx);_.Av(zx,Lx);_.Av(yx,Lx);_.dl.push(this.j)};Px.prototype.a=function(){_.Cv(_.kg);_.Cv(Ax);_.Cv(Bx);_.Cv(_.Lc);_.Cv(zx);_.Cv(yx);_.fl(this.j)};Px.prototype.id=function(){return"subtitles-vtt"};_.I("clpp.vtt.VttComponent",Px);};
2
+ var f=function(window){var ox=" The setting will be ignored.",px="VTT parser encountered an invalid VTT setting: ",qx="application/x-subrip",rx="text/srt",sx='text/vtt; codecs\x3d"vtt"',tx='text/vtt; codecs\x3d"wvtt"',ux=function(a){_.Rj(a,/[ \t]+/gm)},vx=function(a){return a.a===a.f.length?null:(a=_.Rj(a,/[^ \t\n]*/gm))?a[0]:null},wx=function(){},xx=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},yx=function(){},zx=function(a){this.a=a},Bx=function(a,b,c){var d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"===b?a.textAlign=_.Ni:a.textAlign=
4
+ _.bw[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"===d[1]?_.Gg:_.Ig;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===_.ye||b===_.ag?_.ye:b===_.ze||b===_.fe?_.ze:_.hd);else if(d=/^region:(.*)$/.exec(b)){if(b=Ax(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=_.cw[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.Pi,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.cw[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},Ax=function(a,b){var c=a.filter(function(d){return d.id===b});return c.length?c[0]:(_.Jh("VTT parser could not find a region with id: ",b," The region will be ignored."),null)},Cx=function(a){a=_.Rj(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)},Dx=function(){zx.apply(this,arguments)},Ex=function(){this.a=null;this.g=new _.K("clpp.vtt.mp4")},Gx=function(a,b,c){var d,e,f;(new _.Hn).M("payl",_.Kn(function(g){d=_.R.ea(g)})).M("iden",_.Kn(function(g){e=_.R.ea(g)})).M("sttg",_.Kn(function(g){f=_.R.ea(g)})).parse(a);return d?Fx(d,e,f,b,c):null},Fx=function(a,b,c,d,e){a=new _.Si(d,e,a,_.Rg);b&&(a.id=b);if(c)for(b=new _.Qj(c),c=
7
+ vx(b);c;)Bx(a,c,[])||_.Jh(px,c,ox),ux(b),c=vx(b);return a},Hx=function(){this.j=new yx};wx.prototype.a=function(a){a=_.R.ea(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+=xx(c.value)}return _.R.eb(a)};yx.prototype.create=function(){return new wx};yx.prototype.probe=function(a,b){return(a===rx||a===qx)&&b===_.lg};zx.prototype.parseInit=function(){};
8
+ zx.prototype.parseMedia=function(a,b){var c=_.R.ea(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(_.Q,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=Cx(new _.Qj(e[1]));if(null==c)throw new _.O(_.Q,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 h=g.value;if(/^region/.test(h.toLowerCase())){h=new _.Qj(h.replace(/\n/g," "));g=new _.Vi;vx(h);ux(h);for(var l=vx(h);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||_.Jh("VTT parser encountered an invalid VTTRegion setting: ",l,ox);ux(h);l=vx(h)}f.push(g)}}e=[];h=_.v(d);for(g=h.next();!g.done;g=h.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)}h=[];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 _.Qj(p[0]);m=Cx(l);var t=_.Rj(l,/[ \t]+--\x3e[ \t]+/g);n=Cx(l);if(null==m||null==t||null==n)throw new _.O(_.Q,2,2001);m+=q;n+=q;p=p.slice(1).join("\n").trim();m=new _.Si(m,n,p,_.Rg);g&&(m.id=g);ux(l);for(n=vx(l);n;)Bx(m,n,f)||_.Jh(px,
12
+ n,ox),ux(l),n=vx(l);null!=g&&(m.id=g);g=m}g&&h.push(g)}return{cues:h,styles:e}};_.w(Dx,zx);Dx.prototype.parseMedia=function(a,b){return zx.prototype.parseMedia.call(this,(new wx).a(a),b)};Ex.prototype.parseInit=function(a){var b=this,c=!1;(new _.Hn).M(_.Me,_.In).M(_.ug,_.In).M(_.He,_.In).ba("mdhd",function(d){0===d.version?(d.reader.skip(4),d.reader.skip(4),b.a=_.Cn(d.reader),d.reader.skip(4)):(d.reader.skip(8),d.reader.skip(8),b.a=_.Cn(d.reader),d.reader.skip(8));d.reader.skip(4)}).M(_.Le,_.In).M(_.dg,_.In).ba(_.fg,_.Jn).M("wvtt",function(){c=!0}).parse(a);if(!this.a)throw new _.O(_.Q,2,2008);if(!c)throw new _.O(_.Q,2,2008);};
13
+ Ex.prototype.parseMedia=function(a,b){if(!this.a)throw this.g.error("No init segment for MP4+VTT!"),new _.O(_.Q,2,2008);var c=0,d=[],e,f=[],g=!1,h=!1,l=!1,m=null;(new _.Hn).M("moof",_.In).M("traf",_.In).ba("tfdt",function(D){g=!0;c=0===D.version?_.Cn(D.reader):_.En(D.reader)}).ba("tfhd",function(D){var L=D.flags;D=D.reader;D.skip(4);L&1&&D.skip(8);L&2&&D.skip(4);m=L&8?_.Cn(D):null}).ba("trun",function(D){h=!0;var L=D.version,P=D.flags;D=D.reader;var U=_.Cn(D);P&1&&D.skip(4);P&4&&D.skip(4);for(var V=
14
+ [],ra=0;ra<U;ra++){var Da={duration:null,sampleSize:null,Ng:null};P&256&&(Da.duration=_.Cn(D));P&512&&(Da.sampleSize=_.Cn(D));P&1024&&D.skip(4);P&2048&&(Da.Ng=0===L?_.Cn(D):_.Dn(D));V.push(Da)}d=V}).M(_.Ge,_.Kn(function(D){l=!0;e=D})).parse(a);if(!l&&!g&&!h)throw new _.O(_.Q,2,2008);var n=c,p=new DataView(e.buffer,e.byteOffset,e.byteLength);p=new _.xn(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.Ng?c+t.Ng:n;n=y+(u||0);var A=0;do{var B=_.Cn(p);A+=B;var C=
15
+ _.Cn(p);C=_.Mn(C);var E=null;"vttc"===C?8<B&&(E=_.Gn(p,B-8)):("vtte"!==C&&this.g.error("Unknown box "+C+"! Skipping!"),p.skip(B-8));u?E&&f.push(Gx(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(_.aj),styles:[]}};_.w(Hx,_.Wu);Hx.prototype.f=function(){_.uv(_.lg,zx);_.uv(sx,zx);_.uv(tx,zx);_.uv(_.Kc,Ex);_.uv(rx,Dx);_.uv(qx,Dx);_.om.push(this.j)};Hx.prototype.a=function(){_.wv(_.lg);_.wv(sx);_.wv(tx);_.wv(_.Kc);_.wv(rx);_.wv(qx);_.qm(this.j)};Hx.prototype.id=function(){return"subtitles-vtt"};_.J("clpp.vtt.VttComponent",Hx);};
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 rx="clpp.yospace.YospacePlugin",sx=function(){this.a=null;this.g=new _.J(rx)},tx=function(){};_.w(sx,_.bw);sx.prototype.ii=function(){return this.a};
3
- sx.prototype.onContentWillLoad=function(a,b){var c=this,d,e,f,g,h;return _.H(function(l){if(1==l.a){d=a.getConfiguration();e=d.yospace;if(!e.enabled)return l["return"]();if(typeof window.YospaceAdManagement!==_.Re)throw new _.N(_.O,9,7003,"Yospace SDK not found.");c.g.info("Yospace enabled.");f=e.streamType||ux;a:{var m=b.url;c.g.info("Creating Yospace session for stream type",f);switch(f){case ux:m=YospaceAdManagement.SessionVOD.create(m);break a;case vx:m=YospaceAdManagement.SessionLive.create(m);
4
- break a;default:m=YospaceAdManagement.SessionDVRLive.create(m)}}return _.x(l,m,2)}g=l.f;h=g.getSessionState();if(h!==YospaceAdManagement.SessionState.INITIALISED)throw c.g.error("Failed to initialize Yospace session. State:",h,"URL",b.url),new _.N(_.O,9,7003,"Yospace session failed to initialize.");a.trigger(new _.K(_.ch,{detail:g}));b.url=g.getPlaybackUrl();c.g.info("Yospace session initialized. New URL:",b.url);c.a=g;_.y(l)})};
5
- sx.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 _.K(_.bh,{detail:b}))}};sx.prototype.id=function(){return"yospace"};_.I(rx,sx);sx.prototype.getSession=sx.prototype.ii;sx.Id="yospace";tx.prototype.create=function(){return new sx};_.Yt(new tx);var ux=_.Wb,vx="LIVE";_.I("clpp.yospace.StreamType",{VOD:ux,LIVE:vx,DVR:"DVR"});};
2
+ var f=function(window){var jx="clpp.yospace.YospacePlugin",kx=function(){this.a=null;this.g=new _.K(jx)},lx=function(){};_.w(kx,_.Hv);kx.prototype.ci=function(){return this.a};
3
+ kx.prototype.onContentWillLoad=function(a,b){var c=this,d,e,f,g,h;return _.I(function(l){if(1==l.a){d=a.getConfiguration();e=d.yospace;if(!e.enabled)return l["return"]();if(typeof window.YospaceAdManagement!==_.Re)throw new _.O(_.Q,9,7003,"Yospace SDK not found.");c.g.info("Yospace enabled.");f=e.streamType||mx;a:{var m=b.url;c.g.info("Creating Yospace session for stream type",f);switch(f){case mx:m=YospaceAdManagement.SessionVOD.create(m);break a;case nx:m=YospaceAdManagement.SessionLive.create(m);
4
+ break a;default:m=YospaceAdManagement.SessionDVRLive.create(m)}}return _.x(l,m,2)}g=l.f;h=g.getSessionState();if(h!==YospaceAdManagement.SessionState.INITIALISED)throw c.g.error("Failed to initialize Yospace session. State:",h,"URL",b.url),new _.O(_.Q,9,7003,"Yospace session failed to initialize.");a.trigger(new _.M(_.dh,{detail:g}));b.url=g.getPlaybackUrl();c.g.info("Yospace session initialized. New URL:",b.url);c.a=g;_.z(l)})};
5
+ kx.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 _.M(_.ch,{detail:b}))}};kx.prototype.id=function(){return"yospace"};_.J(jx,kx);kx.prototype.getSession=kx.prototype.ci;kx.Id="yospace";lx.prototype.create=function(){return new kx};_.ru(new lx);var mx=_.Vb,nx="LIVE";_.J("clpp.yospace.StreamType",{VOD:mx,LIVE:nx,DVR:"DVR"});};
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,42 +1,44 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var Nw='" event to NPAW',Ow='" event to Youbora',Pw='Reporting "',Qw="Unhandled state",Rw="accountCode key is missing in Youbora config",Sw="ad break start",Tw="ad buffering ended",Uw="ad buffering started",Vw="ad click through url: ",Ww="ad timeline changed",Xw="clpp.npaw.NpawPlugin",Yw="clpp.npaw.YouboraPlugin",Zw="content.isLive",$w="content.title",ax="is container visible",bx="youbora",cx=function(a){return a.startsWith(_.Gd)?"Widevine":a.startsWith(_.Cd)?"FairPlay":a.match(/^com\.(microsoft|chromecast)\.playready/)?
3
- "PlayReady":a.startsWith(_.$e)?"ClearKey":a.startsWith(_.Bd)?"Primetime":a},dx=function(a){return(a=a.getConfiguration().youbora)&&a.errorFilter?a.errorFilter:function(b){return{code:""+b.code,message:b.message,severity:b.severity}}},ex=function(a,b,c,d){b=dx(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===a.code?"ad error":_.ie;b.severity===_.O?(d.fireFatalError(b.code,b.message,b.metadata),c.debug('Reporting "fatal '+a+'" to Youbora',b.code,b)):(d.fireError(b.code,
4
- b.message,b.metadata),c.debug(Pw+a+'" to Youbora',b.code,b));return b},fx=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.m=c;d.a=new _.gi;d.g=new _.J("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.ma())){var d=
2
+ var f=function(window){var Fw='" event to NPAW',Gw='" event to Youbora',Hw='Reporting "',Iw="Unhandled state",Jw="accountCode key is missing in Youbora config",Kw="ad break start",Lw="ad buffering ended",Mw="ad buffering started",Nw="ad click through url: ",Ow="ad timeline changed",Pw="clpp.npaw.NpawPlugin",Qw="clpp.npaw.YouboraPlugin",Rw="content.isLive",Sw="content.title",Tw="is container visible",Uw="youbora",Vw=function(a){return a.startsWith(_.Fd)?"Widevine":a.startsWith(_.Bd)?"FairPlay":a.match(/^com\.(microsoft|chromecast)\.playready/)?
3
+ "PlayReady":a.startsWith(_.$e)?"ClearKey":a.startsWith(_.Ad)?"Primetime":a},Ww=function(a){return(a=a.getConfiguration().youbora)&&a.errorFilter?a.errorFilter:function(b){return{code:""+b.code,message:b.message,severity:b.severity}}},Xw=function(a,b,c,d){b=Ww(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===a.code?"ad error":_.he;b.severity===_.Q?(d.fireFatalError(b.code,b.message,b.metadata),c.debug('Reporting "fatal '+a+'" to Youbora',b.code,b)):(d.fireError(b.code,
4
+ b.message,b.metadata),c.debug(Hw+a+'" to Youbora',b.code,b));return b},Yw=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.m=c;d.a=new _.gi;d.g=new _.K("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.pa())){var d=
5
5
  c.width;var e=c.height;var f=c.bandwidth}d&&e&&f||(c=this.j(),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.getLoadedSource();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.getPlaybackRate()};
6
- b.prototype.getFramesPerSecond=function(){var c=this.m.getTrackManager();return c&&(c=c.La())?c.frameRate:null};b.prototype.getPlayerName=function(){return _.xa};b.prototype.getVersion=function(){return"6.25.2-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,_.bg,this.K.bind(this)),this.a.on(this.m,_.ie,this.H.bind(this)),this.a.on(this.m,
7
- _.Cg,this.J.bind(this)),this.a.on(this.m,_.Bg,this.I.bind(this)),this.a.on(this.m,_.Cc,this.C.bind(this)),this.a.on(this.m,_.ed,this.G.bind(this)))};b.prototype.unregisterListeners=function(){this.g.debug(_.Rb);_.ki(this.a)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.B=!0};b.prototype.j=function(){return this.m.getStats()||_.sq()};b.prototype.w=function(){return!!this.m.getConfiguration().autoplay};b.prototype.K=function(c){c=c.detail;this.l("state change",c);
8
- if(c)switch(c.currentState){case _.Fq:this.w()&&this.f();break;case _.Hq:this.f();this.A();this.fireResume();this.fireBufferEnd();break;case _.Gq:this.w()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.tq:this.fireBufferEnd();this.fireStop();break;case _.Aq:this.fireBufferEnd();this.o&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.yq:this.fireBufferBegin();break;default:this.g.debug(Qw,c)}};b.prototype.f=function(){this.plugin.isInitiated||(this.h=
9
- !1,this.fireInit())};b.prototype.A=function(){var c=this.m.getDrmInfo();c&&(c=cx(c.keySystem))&&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=ex(c,this.m,this.g,this))&&c.severity===_.O&&(this.h=!0)};b.prototype.J=function(){this.m.isEnded()||(this.l(_.Uf),this.f(),this.fireSeekBegin())};b.prototype.I=function(){this.l(_.Tf);this.fireSeekEnd()};b.prototype.C=function(c){this.g.debug("adsTimeline",
10
- c);this.o=(c=c.adsTimeline)&&c.Qb()};b.prototype.G=function(c){this.g.debug("Casting",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,[Pw+c+Ow].concat(_.gh(e)))};return new b(a)},gx=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 _.gi;d.g=new _.J("clpp.npaw.YouboraAdsAdapter");d.registerListeners();d.A=!1;d.l=!1;return d}_.w(b,youbora.Adapter);b.prototype.getDuration=
11
- function(){return this.a&&this.a.getDuration()};b.prototype.getRendition=function(){var c=null;this.a&&(c=youbora.Util.buildRenditionString(this.a.ob(),this.a.nb(),this.a.Ua()));return c};b.prototype.getBitrate=function(){return this.a&&this.a.Ua()};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=
12
- function(){return this.a&&this.a.getAdvertiserName()};b.prototype.getCreativeId=function(){return this.a&&this.a.getCreativeId()};b.prototype.getPosition=function(){var c=youbora.Constants.AdPosition,d=null;if(this.a)switch(this.a.Va()){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();
13
- return c&&0<c.getVolume()};b.prototype.getExpectedBreaks=function(){return this.j&&this.j.getCuePoints().length};b.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};b.prototype.getExpectedAds=function(){return this.a&&this.a.pb()};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()};
14
- b.prototype.getIsVisible=function(){var c=this.m.getSurface().getContainer();c=youbora.Util.calculateAdViewability(c);this.g.debug(ax,c);return c};b.prototype.getPlayerName=function(){return _.xa};b.prototype.getVersion=function(){return"6.25.2-castlabsadsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ia};b.prototype.registerListeners=function(){this.m&&this.f&&(this.f.on(this.m,_.Cc,this.T.bind(this)),this.f.on(this.m,_.xc,this.P.bind(this)),this.f.on(this.m,_.tc,this.K.bind(this)),
15
- this.f.on(this.m,_.vc,this.L.bind(this)),this.f.on(this.m,_.lc,this.I.bind(this)),this.f.on(this.m,_.mc,this.o.bind(this,1)),this.f.on(this.m,_.sc,this.o.bind(this,2)),this.f.on(this.m,_.Ac,this.o.bind(this,3)),this.f.on(this.m,_.kc,this.H.bind(this)),this.f.on(this.m,_.wc,this.N.bind(this)),this.f.on(this.m,_.ie,this.J.bind(this)),this.f.on(this.m,_.hc,this.B.bind(this)),this.f.on(this.m,_.ic,this.C.bind(this)),this.f.on(this.m,_.jc,this.G.bind(this)),this.f.on(this.m,_.uc,this.w.bind(this)))};b.prototype.unregisterListeners=
16
- function(){_.ki(this.f)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.A=!0};b.prototype.T=function(c){this.g.debug(Ww,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=
17
- !0;this.h(Uw);this.fireBufferBegin()};b.prototype.w=function(){this.l&&(this.h(Tw),this.l=!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.zb();this.g.debug(Vw,c);this.fireClick(c)};b.prototype.N=function(){this.h("ad skipped");this.fireSkip()};b.prototype.B=function(c){this.a=c.ad;this.h(Sw,this.a);this.fireBreakStart()};b.prototype.C=function(){this.h("ad break stop");this.fireBreakStop();
18
- if(this.getPosition()===youbora.Constants.AdPosition.Postroll){var c=this.plugin.getAdapter();c&&c.fireStop()}};b.prototype.J=function(c){(c=c.detail)&&10003===c.code&&ex(c,this.m,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,[Pw+c+Ow].concat(_.gh(e)))};return new b(a)},ix=function(){function a(){var b=NpawPluginAdapters.video.Shaka.call(this)||this;b.h=!1;b.f=!1;b.a=null;b.B=!1;return b}_.w(a,NpawPluginAdapters.video.Shaka);
19
- a.prototype.getPlayhead=function(){return this.getIsLive()?-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.ma())&&(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=
20
- function(){var b=this.player.getLoadedSource();return b&&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.getPlaybackRate()};a.prototype.getFramesPerSecond=function(){var b=this.player.getTrackManager();return b&&(b=b.La())?b.frameRate:null};a.prototype.getPlayerName=function(){return _.xa};a.prototype.getVersion=function(){return"castlabs-adapter-6.25.2-js"};
21
- a.prototype.getPlayerVersion=function(){return _.ia};a.prototype.registerListeners=function(){var b=this.w();this.player&&b&&(b.on(this.player,_.bg,this.K.bind(this)),b.on(this.player,_.ie,this.H.bind(this)),b.on(this.player,_.Uf,this.J.bind(this)),b.on(this.player,_.Tf,this.I.bind(this)),b.on(this.player,_.Cc,this.C.bind(this)),b.on(this.player,_.ed,this.G.bind(this)))};a.prototype.unregisterListeners=function(){hx.debug(_.Rb);_.ki(this.w())};a.prototype.dispose=function(){this.unregisterListeners();
22
- this.B=!0;this.f=this.h=!1;this.a=null};a.prototype.j=function(){return this.player.getStats()||_.sq()};a.prototype.o=function(){return!!this.player.getConfiguration().autoplay};a.prototype.K=function(b){b=b.detail;this.l("state change",b);if(b)switch(b.currentState){case _.Fq:this.o()&&this.fireStart();break;case _.Hq:this.fireStart();this.A();this.fireResume();this.fireBufferEnd();break;case _.Gq:this.o()&&this.fireStart();this.A();this.fireBufferEnd();this.firePause();break;case _.tq:this.fireBufferEnd();
23
- this.fireStop();break;case _.Aq:this.fireBufferEnd();this.h&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.yq:this.fireBufferBegin();break;default:hx.debug(Qw,b)}};a.prototype.A=function(){this.fireJoin()};a.prototype.H=function(b){(b=b.detail)&&!this.f&&this.player&&10003!==b.code&&(b=ex(b,this.player,hx,this))&&b.severity===_.O&&(this.f=!0)};a.prototype.J=function(){this.player.isEnded()||(this.l(_.Uf),this.fireSeekBegin())};a.prototype.w=function(){this.a||(this.a=new _.gi);
24
- return this.a};a.prototype.I=function(){this.l(_.Tf);this.fireSeekEnd()};a.prototype.C=function(b){hx.debug("adsTimeline",b);this.h=(b=b.adsTimeline)&&b.Qb()};a.prototype.G=function(b){hx.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];hx.debug.apply(hx,[Pw+b+Nw].concat(_.gh(d)))};return a},kx=function(){function a(){var b=NpawPluginAdapters.ads.Ima.call(this)||this;b.a=null;b.l=null;b.h=null;b.j=null;b.C=!1;b.o=!1;return b}
25
- _.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.ob(),this.a.nb(),this.a.Ua()));return b};a.prototype.getBitrate=function(){var b=null;this.a&&(b=this.a.Ua());return b};a.prototype.getPlayhead=function(){var b=null,c=this.player.getAdsManager();c&&(b=c.getPosition());return b};a.prototype.getResource=function(){var b=null;this.a&&(b=
26
- 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.C=!0;this.j=this.h=this.a=null};a.prototype.getPosition=function(){var b=this.getNpawReference().Constants.AdPosition,c=null;if(this.a)switch(this.a.Va()){case 0:c=
27
- b.Preroll;break;case 2:c=b.Postroll;break;case 1:c=b.Midroll}jx.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.getVolume()};a.prototype.getExpectedBreaks=function(){return this.h&&this.h.getCuePoints().length};a.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};a.prototype.getExpectedAds=function(){return this.a&&this.a.pb()};
28
- 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);jx.debug(ax,b);return b};a.prototype.getPlayerName=function(){return _.xa};a.prototype.getVersion=
29
- function(){return"castlabs-ads-adapter-6.25.2-js"};a.prototype.getPlayerVersion=function(){return _.ia};a.prototype.B=function(){this.j||(this.j=new _.gi);return this.j};a.prototype.registerListeners=function(){var b=this.B();this.player&&b&&(b.on(this.player,_.Cc,this.ca.bind(this)),b.on(this.player,_.xc,this.Y.bind(this)),b.on(this.player,_.tc,this.N.bind(this)),b.on(this.player,_.vc,this.P.bind(this)),b.on(this.player,_.lc,this.K.bind(this)),b.on(this.player,_.mc,this.w.bind(this,1)),b.on(this.player,
30
- _.sc,this.w.bind(this,2)),b.on(this.player,_.Ac,this.w.bind(this,3)),b.on(this.player,_.kc,this.J.bind(this)),b.on(this.player,_.wc,this.T.bind(this)),b.on(this.player,_.ie,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,_.uc,this.da.bind(this)))};a.prototype.unregisterListeners=function(){_.ki(this.B())};a.prototype.ca=function(b){jx.debug(Ww,b);this.h=b.adsTimeline};a.prototype.Y=function(b){this.a=
31
- 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.N=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(Uw);this.fireBufferBegin()};a.prototype.da=function(){this.l=this.getPlayhead();this.A()};a.prototype.A=function(){this.o&&(this.f(Tw),this.o=!1,this.fireBufferEnd())};a.prototype.w=
32
- function(b){this.f("ad quartile",b);this.fireQuartile(b)};a.prototype.J=function(){this.f("ad clicked");var b=this.a&&this.a.zb();jx.debug(Vw,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(Sw,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&&this.fireStop({adPlayhead:this.l})};
33
- a.prototype.L=function(b){(b=b.detail)&&10003===b.code&&ex(b,this.player,jx,this)};a.prototype.f=function(b,c){for(var d=[],e=1;e<arguments.length;++e)d[e-1]=arguments[e];jx.debug.apply(jx,[Pw+b+Nw].concat(_.gh(d)))};return a},lx=function(){this.a=null;this.g=new _.J(Xw);this.m=null},mx=function(a,b){if(b.namespace()===_.sd)return a.g.info("NPAW does not report when casting."),!1;var c=b.getConfiguration().youbora;return _.L.mg(c)?c.accountCode?_.L.R(window.NpawPlugin)||_.L.R(window.NpawPluginAdapters)?
34
- (a.g.warn("NPAW SDK not found."),b.onError(new _.N(1,9,9100)),!1):!0:(a.g.warn(Rw),b.onError(new _.N(1,9,9101)),!1):(a.g.warn("NPAW plugin is loaded but not configured. Will do nothing."),!1)},nx=function(a){a.a&&(a.g.info("Removing NPAW Plugins",a.a),a.a.removeAdsAdapter(),a.a.removeAdapter())},ox=function(){this.a=null;this.g=new _.J(Yw);this.m=null},px=function(a,b){if(b.namespace()===_.sd)return a.g.info("Youbora does not report when casting."),!1;var c=b.getConfiguration().youbora;if(!_.L.mg(c))return a.g.debug("Youbora plugin is loaded but not configured. Will do nothing."),
35
- !1;if(!c.accountCode)return a.g.warn(Rw),b.onError(new _.N(1,9,9101)),!1;if(_.L.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.")),b.onError(new _.N(1,9,9102)));return!0},qx=function(){};var hx=new _.J("clpp.npaw.NpawAdapter");var jx=new _.J("clpp.npaw.NpawAdsAdapter");_.w(lx,_.bw);_.r=lx.prototype;_.r.Ng=function(a){nx(this);if(this.a=a)this.a.registerAdapterFromClass(this.m,ix()),this.a.registerAdsAdapterFromClass(this.m,kx())};_.r.Yl=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;mx(this,a)&&(a=a.getConfiguration().youbora,this.Ng(new NpawPlugin(a.accountCode)))};
36
- _.r.onContentWillLoad=function(a,b){if(mx(this,a)){var c=a.getConfiguration(),d=c.youbora;void 0===d[Zw]&&(d[Zw]=b.isLive);void 0===d[$w]&&(d[$w]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.Ng(new NpawPlugin(d.accountCode));this.a.setAnalyticsOptions(d)}};_.r.onContentLoaded=function(a){var b={};(a=a.getDrmInfo())&&(a=cx(a.keySystem))&&(b["content.drm"]=a);this.g.info(_.Te,b);this.a.setAnalyticsOptions(b)};_.r.onPlayerWillRelease=function(){};
37
- _.r.onPlayerWillDestroy=function(){nx(this);this.a.destroy()};_.r.id=function(){return bx};_.I(Xw,lx);lx.prototype.getAdsAdapter=lx.prototype.getAdsAdapter;lx.prototype.getAdapter=lx.prototype.getAdapter;lx.prototype.getNpawPlugin=lx.prototype.Yl;lx.prototype.setNpawPlugin=lx.prototype.Ng;lx.Id=bx;new _.J(Xw);_.w(ox,_.bw);_.r=ox.prototype;_.r.Og=function(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(fx(this.m)),this.a.setAdsAdapter(gx(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;px(this,a)&&(a=a.getConfiguration().youbora,this.Og(new youbora.Plugin(a)))};
38
- _.r.onContentWillLoad=function(a,b){if(px(this,a)){var c=a.getConfiguration(),d=c.youbora;void 0===d[Zw]&&(d[Zw]=b.isLive);void 0===d[$w]&&(d[$w]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.Og(new youbora.Plugin(d));this.a.setOptions(d)}};_.r.onPlayerWillRelease=function(){};_.r.onPlayerWillDestroy=function(){};_.r.id=function(){return bx};_.I(Yw,ox);ox.prototype.getAdsAdapter=ox.prototype.getAdsAdapter;ox.prototype.getAdapter=ox.prototype.getAdapter;
39
- ox.prototype.setYouboraPlugin=ox.prototype.Og;ox.Id=bx;qx.prototype.create=function(a){return a.youbora&&a.youbora.v7?new lx:new ox};_.Yt(new qx);};
6
+ b.prototype.getFramesPerSecond=function(){var c=this.m.getTrackManager();return c&&(c=c.La())?c.frameRate:null};b.prototype.getPlayerName=function(){return _.xa};b.prototype.getVersion=function(){return"6.27.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,_.bg,this.K.bind(this)),this.a.on(this.m,_.he,this.H.bind(this)),this.a.on(this.m,
7
+ _.Dg,this.J.bind(this)),this.a.on(this.m,_.Cg,this.I.bind(this)),this.a.on(this.m,_.Bc,this.F.bind(this)),this.a.on(this.m,_.dd,this.G.bind(this)))};b.prototype.unregisterListeners=function(){this.g.debug(_.Qb);_.ji(this.a)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.B=!0};b.prototype.j=function(){return this.m.getStats()||_.Kq()};b.prototype.w=function(){return!!this.m.getConfiguration().autoplay};b.prototype.K=function(c){c=c.detail;this.l("state change",c);
8
+ if(c)switch(c.currentState){case _.Xq:this.w()&&this.f();break;case _.Zq:this.f();this.A();this.fireResume();this.fireBufferEnd();break;case _.Yq:this.w()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.Lq:this.fireBufferEnd();this.fireStop();break;case _.Sq:this.fireBufferEnd();this.o&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.Qq:this.fireBufferBegin();break;default:this.g.debug(Iw,c)}};b.prototype.f=function(){this.plugin.isInitiated||(this.h=
9
+ !1,this.fireInit())};b.prototype.A=function(){var c=this.m.getDrmInfo();c&&(c=Vw(c.keySystem))&&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=Xw(c,this.m,this.g,this))&&c.severity===_.Q&&(this.h=!0)};b.prototype.J=function(){this.m.isEnded()||(this.l(_.Uf),this.f(),this.fireSeekBegin())};b.prototype.I=function(){this.l(_.Tf);this.fireSeekEnd()};b.prototype.F=function(c){this.g.debug("adsTimeline",
10
+ c);this.o=(c=c.adsTimeline)&&c.Mb()};b.prototype.G=function(c){this.g.debug("Casting",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,[Hw+c+Gw].concat(_.hh(e)))};return new b(a)},Zw=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 _.gi;d.g=new _.K("clpp.npaw.YouboraAdsAdapter");d.registerListeners();d.A=!1;d.l=!1;return d}_.w(b,youbora.Adapter);b.prototype.getDuration=
11
+ function(){return this.a&&this.a.getDuration()};b.prototype.getRendition=function(){var c=null;this.a&&(c=youbora.Util.buildRenditionString(this.a.kb(),this.a.jb(),this.a.Va()));return c};b.prototype.getBitrate=function(){return this.a&&this.a.Va()};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=
12
+ function(){return this.a&&this.a.getAdvertiserName()};b.prototype.getCreativeId=function(){return this.a&&this.a.getCreativeId()};b.prototype.getPosition=function(){var c=youbora.Constants.AdPosition,d=null;if(this.a)switch(this.a.Wa()){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();
13
+ return c&&0<c.getVolume()};b.prototype.getExpectedBreaks=function(){return this.j&&this.j.getCuePoints().length};b.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};b.prototype.getExpectedAds=function(){return this.a&&this.a.lb()};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()};
14
+ b.prototype.getIsVisible=function(){var c=this.m.getSurface().getContainer();c=youbora.Util.calculateAdViewability(c);this.g.debug(Tw,c);return c};b.prototype.getPlayerName=function(){return _.xa};b.prototype.getVersion=function(){return"6.27.0-castlabsadsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ia};b.prototype.registerListeners=function(){this.m&&this.f&&(this.f.on(this.m,_.Bc,this.U.bind(this)),this.f.on(this.m,_.wc,this.P.bind(this)),this.f.on(this.m,_.sc,this.K.bind(this)),
15
+ this.f.on(this.m,_.uc,this.L.bind(this)),this.f.on(this.m,_.kc,this.I.bind(this)),this.f.on(this.m,_.lc,this.o.bind(this,1)),this.f.on(this.m,_.rc,this.o.bind(this,2)),this.f.on(this.m,_.zc,this.o.bind(this,3)),this.f.on(this.m,_.jc,this.H.bind(this)),this.f.on(this.m,_.vc,this.N.bind(this)),this.f.on(this.m,_.he,this.J.bind(this)),this.f.on(this.m,_.gc,this.B.bind(this)),this.f.on(this.m,_.hc,this.F.bind(this)),this.f.on(this.m,_.ic,this.G.bind(this)),this.f.on(this.m,_.tc,this.w.bind(this)))};b.prototype.unregisterListeners=
16
+ function(){_.ji(this.f)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.A=!0};b.prototype.U=function(c){this.g.debug(Ow,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=
17
+ !0;this.h(Mw);this.fireBufferBegin()};b.prototype.w=function(){this.l&&(this.h(Lw),this.l=!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.wb();this.g.debug(Nw,c);this.fireClick(c)};b.prototype.N=function(){this.h("ad skipped");this.fireSkip()};b.prototype.B=function(c){this.a=c.ad;this.h(Kw,this.a);this.fireBreakStart()};b.prototype.F=function(){this.h("ad break stop");this.fireBreakStop();
18
+ if(this.getPosition()===youbora.Constants.AdPosition.Postroll){var c=this.plugin.getAdapter();c&&c.fireStop()}};b.prototype.J=function(c){(c=c.detail)&&10003===c.code&&Xw(c,this.m,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,[Hw+c+Gw].concat(_.hh(e)))};return new b(a)},ax=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);
19
+ a.prototype.getPlayhead=function(){return this.getIsLive()?-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.pa())&&(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=
20
+ function(){var b=this.player.getLoadedSource();return b&&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.getPlaybackRate()};a.prototype.getFramesPerSecond=function(){var b=this.player.getTrackManager();return b&&(b=b.La())?b.frameRate:null};a.prototype.getPlayerName=function(){return _.xa};a.prototype.getVersion=function(){return"castlabs-adapter-6.27.0-js"};
21
+ a.prototype.getPlayerVersion=function(){return _.ia};a.prototype.registerListeners=function(){var b=this.w();this.player&&b&&(b.on(this.player,_.bg,this.N.bind(this)),b.on(this.player,_.he,this.J.bind(this)),b.on(this.player,_.Uf,this.L.bind(this)),b.on(this.player,_.Tf,this.K.bind(this)),b.on(this.player,_.Bc,this.H.bind(this)),b.on(this.player,_.dd,this.I.bind(this)),b.on(this.player,_.Vc,this.P.bind(this)),b.on(this.player,_.ng,this.U.bind(this)))};a.prototype.unregisterListeners=function(){$w.debug(_.Qb);
22
+ _.ji(this.w())};a.prototype.dispose=function(){this.unregisterListeners();this.G=!0;this.f=this.h=!1;this.a=null};a.prototype.j=function(){return this.player.getStats()||_.Kq()};a.prototype.o=function(){return!!this.player.getConfiguration().autoplay};a.prototype.N=function(b){b=b.detail;this.l("state change",b);if(b)switch(b.currentState){case _.Xq:this.plugin.setVideoOptions({"content.subtitles":this.F()});this.o()&&this.fireStart();break;case _.Zq:this.fireStart();this.A();this.fireResume();this.fireBufferEnd();
23
+ break;case _.Yq:this.o()&&this.fireStart();this.A();this.fireBufferEnd();this.firePause();break;case _.Lq:this.fireBufferEnd();this.fireStop();break;case _.Sq:this.fireBufferEnd();this.h&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.Qq:this.fireBufferBegin();break;default:$w.debug(Iw,b)}};a.prototype.A=function(){this.fireJoin()};a.prototype.J=function(b){(b=b.detail)&&!this.f&&this.player&&10003!==b.code&&(b=Xw(b,this.player,$w,this))&&b.severity===_.Q&&(this.f=!0)};
24
+ a.prototype.L=function(){this.player.isEnded()||(this.l(_.Uf),this.fireSeekBegin())};a.prototype.B=function(b){var c=this.player.getTrackManager();if(!c)return null;var d=null;b===_.kg&&(d=c.va());b===_.Oc&&(d=c.na());return d?d.language:null};a.prototype.P=function(){var b=this.B(_.Oc);this.plugin.setVideoOptions({"content.language":b})};a.prototype.U=function(){var b=this.B(_.kg),c=this.F();this.plugin.setVideoOptions({"content.subtitles":b||c})};a.prototype.w=function(){this.a||(this.a=new _.gi);
25
+ return this.a};a.prototype.K=function(){this.l(_.Tf);this.fireSeekEnd()};a.prototype.H=function(b){$w.debug("adsTimeline",b);this.h=(b=b.adsTimeline)&&b.Mb()};a.prototype.I=function(b){$w.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];$w.debug.apply($w,[Hw+b+Fw].concat(_.hh(d)))};a.prototype.F=function(){var b=this.player.getConfiguration();return b.youbora&&b.youbora.disabledSubtitlesLabel?b.youbora.disabledSubtitlesLabel:
26
+ "off"};return a},cx=function(){function a(){var b=NpawPluginAdapters.ads.Ima.call(this)||this;b.a=null;b.l=null;b.h=null;b.j=null;b.F=!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.kb(),this.a.jb(),this.a.Va()));return b};a.prototype.getBitrate=function(){var b=null;this.a&&(b=this.a.Va());return b};a.prototype.getPlayhead=
27
+ function(){var b=null,c=this.player.getAdsManager();c&&(b=c.getPosition());return b};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();
28
+ this.F=!0;this.j=this.h=this.a=null};a.prototype.getPosition=function(){var b=this.getNpawReference().Constants.AdPosition,c=null;if(this.a)switch(this.a.Wa()){case 0:c=b.Preroll;break;case 2:c=b.Postroll;break;case 1:c=b.Midroll}bx.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.getVolume()};a.prototype.getExpectedBreaks=function(){return this.h&&
29
+ this.h.getCuePoints().length};a.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};a.prototype.getExpectedAds=function(){return this.a&&this.a.lb()};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=
30
+ this.player.getSurface().getContainer();b=this.getNpawUtils().calculateAdViewability(b);bx.debug(Tw,b);return b};a.prototype.getPlayerName=function(){return _.xa};a.prototype.getVersion=function(){return"castlabs-ads-adapter-6.27.0-js"};a.prototype.getPlayerVersion=function(){return _.ia};a.prototype.B=function(){this.j||(this.j=new _.gi);return this.j};a.prototype.registerListeners=function(){var b=this.B();this.player&&b&&(b.on(this.player,_.Bc,this.da.bind(this)),b.on(this.player,_.wc,this.Z.bind(this)),
31
+ b.on(this.player,_.sc,this.N.bind(this)),b.on(this.player,_.uc,this.P.bind(this)),b.on(this.player,_.kc,this.K.bind(this)),b.on(this.player,_.lc,this.w.bind(this,1)),b.on(this.player,_.rc,this.w.bind(this,2)),b.on(this.player,_.zc,this.w.bind(this,3)),b.on(this.player,_.jc,this.J.bind(this)),b.on(this.player,_.vc,this.U.bind(this)),b.on(this.player,_.he,this.L.bind(this)),b.on(this.player,_.gc,this.G.bind(this)),b.on(this.player,_.hc,this.H.bind(this)),b.on(this.player,_.ic,this.I.bind(this)),b.on(this.player,
32
+ _.tc,this.fa.bind(this)))};a.prototype.unregisterListeners=function(){_.ji(this.B())};a.prototype.da=function(b){bx.debug(Ow,b);this.h=b.adsTimeline};a.prototype.Z=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.N=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=
33
+ !0;this.f(Mw);this.fireBufferBegin()};a.prototype.fa=function(){this.l=this.getPlayhead();this.A()};a.prototype.A=function(){this.o&&(this.f(Lw),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.wb();bx.debug(Nw,b);this.fireClick(b)};a.prototype.U=function(){this.f("ad skipped");this.fireSkip()};a.prototype.G=function(b){this.a=b.ad;this.f(Kw,this.a);this.fireBreakStart()};a.prototype.H=
34
+ function(){this.f("ad break stop");this.fireBreakStop({adPlayhead:this.l});this.getPosition()===this.getNpawReference().Constants.AdPosition.Postroll&&this.fireStop({adPlayhead:this.l})};a.prototype.L=function(b){(b=b.detail)&&10003===b.code&&Xw(b,this.player,bx,this)};a.prototype.f=function(b,c){for(var d=[],e=1;e<arguments.length;++e)d[e-1]=arguments[e];bx.debug.apply(bx,[Hw+b+Fw].concat(_.hh(d)))};return a},dx=function(){this.a=null;this.g=new _.K(Pw);this.m=null},ex=function(a,b){if(b.namespace()===
35
+ _.rd)return a.g.info("NPAW does not report when casting."),!1;var c=b.getConfiguration().youbora;return _.N.ig(c)?c.accountCode?_.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(Jw),b.onError(new _.O(1,9,9101)),!1):(a.g.warn("NPAW plugin is loaded but not configured. Will do nothing."),!1)},fx=function(a){a.a&&(a.g.info("Removing NPAW Plugins",a.a),a.a.removeAdsAdapter(),a.a.removeAdapter())},gx=function(){this.a=
36
+ null;this.g=new _.K(Qw);this.m=null},hx=function(a,b){if(b.namespace()===_.rd)return a.g.info("Youbora does not report when casting."),!1;var c=b.getConfiguration().youbora;if(!_.N.ig(c))return a.g.debug("Youbora plugin is loaded but not configured. Will do nothing."),!1;if(!c.accountCode)return a.g.warn(Jw),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 "+
37
+ (youbora.VERSION+". Some or all features of YouboraPlugin may not work correctly.")),b.onError(new _.O(1,9,9102)));return!0},ix=function(){};var $w=new _.K("clpp.npaw.NpawAdapter");var bx=new _.K("clpp.npaw.NpawAdsAdapter");_.w(dx,_.Hv);_.r=dx.prototype;_.r.Hg=function(a){fx(this);if(this.a=a)this.a.registerAdapterFromClass(this.m,ax()),this.a.registerAdsAdapterFromClass(this.m,cx())};_.r.Sl=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;ex(this,a)&&(a=a.getConfiguration().youbora,this.Hg(new NpawPlugin(a.accountCode)))};
38
+ _.r.onContentWillLoad=function(a,b){if(ex(this,a)){var c=a.getConfiguration(),d=c.youbora;void 0===d[Rw]&&(d[Rw]=b.isLive);void 0===d[Sw]&&(d[Sw]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.Hg(new NpawPlugin(d.accountCode));this.a.setAnalyticsOptions(d)}};_.r.onContentLoaded=function(a){var b={};(a=a.getDrmInfo())&&(a=Vw(a.keySystem))&&(b["content.drm"]=a);this.g.info(_.Te,b);this.a.setAnalyticsOptions(b)};_.r.onPlayerWillRelease=function(){};
39
+ _.r.onPlayerWillDestroy=function(){fx(this);this.a.destroy()};_.r.id=function(){return Uw};_.J(Pw,dx);dx.prototype.getAdsAdapter=dx.prototype.getAdsAdapter;dx.prototype.getAdapter=dx.prototype.getAdapter;dx.prototype.getNpawPlugin=dx.prototype.Sl;dx.prototype.setNpawPlugin=dx.prototype.Hg;dx.Id=Uw;new _.K(Pw);_.w(gx,_.Hv);_.r=gx.prototype;_.r.Ig=function(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(Yw(this.m)),this.a.setAdsAdapter(Zw(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;hx(this,a)&&(a=a.getConfiguration().youbora,this.Ig(new youbora.Plugin(a)))};
40
+ _.r.onContentWillLoad=function(a,b){if(hx(this,a)){var c=a.getConfiguration(),d=c.youbora;void 0===d[Rw]&&(d[Rw]=b.isLive);void 0===d[Sw]&&(d[Sw]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.Ig(new youbora.Plugin(d));this.a.setOptions(d)}};_.r.onPlayerWillRelease=function(){};_.r.onPlayerWillDestroy=function(){};_.r.id=function(){return Uw};_.J(Qw,gx);gx.prototype.getAdsAdapter=gx.prototype.getAdsAdapter;gx.prototype.getAdapter=gx.prototype.getAdapter;
41
+ gx.prototype.setYouboraPlugin=gx.prototype.Ig;gx.Id=Uw;ix.prototype.create=function(a){return a.youbora&&a.youbora.v7?new dx:new gx};_.ru(new ix);};
40
42
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
41
43
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
42
44
  else{_=this.clpp._;(f.call(g,this));}