@castlabs/prestoplay 6.32.0-beta.3 → 6.32.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 (68) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +18 -18
  5. package/cjs/cl.cast.js +126 -126
  6. package/cjs/cl.conviva.js +32 -32
  7. package/cjs/cl.core.js +604 -604
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +101 -101
  10. package/cjs/cl.externs.js +1 -29
  11. package/cjs/cl.freewheel.js +26 -26
  12. package/cjs/cl.hls.js +77 -77
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +30 -30
  15. package/cjs/cl.ima.js +26 -26
  16. package/cjs/cl.mediatailor.js +3 -3
  17. package/cjs/cl.mse.js +352 -352
  18. package/cjs/cl.muxdata.js +14 -14
  19. package/cjs/cl.onboard.js +4 -4
  20. package/cjs/cl.persistent.js +14 -14
  21. package/cjs/cl.playlist.js +6 -6
  22. package/cjs/cl.simid.js +16 -16
  23. package/cjs/cl.smooth.js +71 -71
  24. package/cjs/cl.thumbnails.js +25 -25
  25. package/cjs/cl.tizen.js +71 -71
  26. package/cjs/cl.ttml.js +29 -29
  27. package/cjs/cl.verimatrix.js +5 -5
  28. package/cjs/cl.vimond.js +12 -12
  29. package/cjs/cl.vr.js +18 -18
  30. package/cjs/cl.vtt.js +14 -14
  31. package/cjs/cl.yospace.js +4 -4
  32. package/cjs/cl.youbora.js +38 -38
  33. package/cjs/polyfill.min.js +2 -2
  34. package/cl.adobe.js +3 -3
  35. package/cl.airplay.js +3 -3
  36. package/cl.broadpeak.js +14 -14
  37. package/cl.cast.js +100 -100
  38. package/cl.conviva.js +27 -27
  39. package/cl.core.js +488 -487
  40. package/cl.crypto.js +8 -8
  41. package/cl.dash.js +75 -75
  42. package/cl.externs.js +1 -25
  43. package/cl.freewheel.js +20 -20
  44. package/cl.hls.js +65 -65
  45. package/cl.hlssmpte.js +5 -5
  46. package/cl.htmlcue.js +26 -26
  47. package/cl.ima.js +19 -19
  48. package/cl.mediatailor.js +2 -2
  49. package/cl.mse.js +200 -200
  50. package/cl.muxdata.js +12 -12
  51. package/cl.onboard.js +3 -3
  52. package/cl.persistent.js +8 -8
  53. package/cl.playlist.js +4 -4
  54. package/cl.simid.js +2 -2
  55. package/cl.smooth.js +47 -47
  56. package/cl.thumbnails.js +12 -12
  57. package/cl.tizen.js +41 -41
  58. package/cl.ttml.js +10 -10
  59. package/cl.verimatrix.js +4 -4
  60. package/cl.vimond.js +8 -8
  61. package/cl.vr.js +3 -3
  62. package/cl.vtt.js +11 -11
  63. package/cl.yospace.js +3 -3
  64. package/cl.youbora.js +27 -27
  65. package/package.json +1 -1
  66. package/typings.d.ts +6 -22
  67. package/cjs/cl.cdn.js +0 -13
  68. package/cl.cdn.js +0 -7
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 _.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)},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 _.O(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 k=c/128,l=(.5+k)*Math.PI*2;128===c?(b.push(b[645*d]),b.push(b[645*d+1]),b.push(b[645*d+2])):(b.push(100*Math.cos(l)*g),b.push(100*Math.sin(l)*g),b.push(100*Math.sin(f)));0===d||70===d?b.push(.5):b.push(1-k);b.push(1-e)}}e=[];for(c=0;128>c;c++)for(d=0;70>d;d++)f=
8
- 5*(129*d+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*d+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*d+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]);this.h=e.length/5;this.f=a.createBuffer();b=new Float32Array(e);a.bindBuffer(a.ARRAY_BUFFER,this.f);a.bufferData(a.ARRAY_BUFFER,b,a.STATIC_DRAW)},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.ba=this.H=this.f=this.a=this.m=null;this.g=new _.M("clpp.vr");this.I=70;this.X=1;this.P=this.M=!1;this.G=function(){if(a.a&&a.f){a.f.viewport(0,0,a.a.width,a.a.height);var b=a.L.a,c=Math.tan(.5*a.I*Math.PI/180);b[0]=1/(a.a.width/a.a.height*c);b[1]=0;b[2]=0;b[3]=0;b[4]=0;b[5]=1/c;b[6]=0;b[7]=0;b[8]=0;b[9]=0;b[10]=2E3/-1999.9;b[11]=200/-1999.9;b[12]=0;b[13]=0;b[14]=-1;b[15]=1}};this.l=this.j=0;this.h={x:0,y:0};this.T=new Zx;this.W=new Zx;this.ha=new Zx;this.ma=new Zx;this.B=this.$n.bind(this);
11
- this.D=this.ao.bind(this);this.K=this.Zn.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.W);ay(a.ha);$x(a.ma,a.T,a.ha);$x(a.H,a.W,a.ma)},hy=function(a){a.a&&(a.a.removeEventListener("mousemove",a.B,!1),a.a.removeEventListener(Qx,a.B,!1),a.a.removeEventListener("mouseup",a.D,!1),a.a.removeEventListener("touchend",a.D,!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,k,l,m,n,p,q,t,u,z){var B=this.a;B[0]=a;B[4]=b;B[8]=c;B[12]=d;B[1]=e;B[5]=f;B[9]=g;B[13]=k;B[2]=l;B[6]=m;B[10]=n;B[14]=p;B[3]=q;B[7]=t;B[11]=u;B[15]=z;return this};var jy={alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!1,devicePixelRatio:1};_.w(fy,_.gw);_.r=fy.prototype;_.r.onPlayerCreated=function(a){this.g.info("Player created");this.m=a};
2
+ var f=function(window){var Mx="touchmove",Nx="touchstart",Ox=function(a,b,c,d){this.x=a||0;this.y=b||0;this.a=c||0;this.f=d||1},Px=function(a,b){var c=a.x,d=a.y,e=a.a,f=a.f;b.set(1-2*(d*d+e*e),2*(c*d-e*f),2*(c*e+d*f),0,2*(c*d+e*f),1-2*(c*c+e*e),2*(d*e-c*f),0,2*(c*e-d*f),2*(d*e+c*f),1-2*(c*c+d*d),0,0,0,0,1)},Qx=function(a,b,c){c*=.5;var d=Math.sqrt(a*a+b*b),e=Math.sin(c);return new Ox(a/d*e,b/d*e,0/d*e,Math.cos(c))},Rx=function(a,b,c){this.x=a||0;this.y=b||0;this.a=c||0},Sx=function(a,b){isFinite(b)?(a.x*=b,a.y*=b,a.a*=
3
+ b):(a.x=0,a.y=0,a.a=0)},Tx=function(a,b){return a.x*b.x+a.y*b.y+a.a*b.a},Ux=function(a,b,c){var d=b.x,e=b.y;b=b.a;var f=c.x,g=c.y;c=c.a;a.x=e*c-b*g;a.y=b*f-d*c;a.a=d*g-e*f;return a},Vx=function(){this.a=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])},Wx=function(a,b,c){b=b.a;c=c.a;var d=a.a,e=0;do d[4*e]=b[4*e]*c[0]+b[4*e+1]*c[4]+b[4*e+2]*c[8]+b[4*e+3]*c[12],d[4*e+1]=b[4*e]*c[1]+b[4*e+1]*c[5]+b[4*e+2]*c[9]+b[4*e+3]*c[13],d[4*e+2]=b[4*e]*c[2]+b[4*e+1]*c[6]+b[4*e+2]*c[10]+b[4*e+3]*c[14],d[4*e+
4
+ 3]=b[4*e]*c[3]+b[4*e+1]*c[7]+b[4*e+2]*c[11]+b[4*e+3]*c[15];while(4>++e);return a},Xx=function(a){var b=new Rx(0,0,0),c=new Rx(0,0,1),d=new Rx,e=new Rx,f=new Rx;a=a.a;var g=new Rx(0,1,0);f.x=b.x-g.x;f.y=b.y-g.y;f.a=b.a-g.a;g=f.length();Sx(f,1/g);c=Ux(d,c,f);g=c.length();Sx(c,1/g);Ux(e,f,d);a[0]=d.x;a[1]=d.y;a[2]=d.a;a[3]=-Tx(d,b);a[4]=e.x;a[5]=e.y;a[6]=e.a;a[7]=-Tx(e,b);a[8]=f.x;a[9]=f.y;a[10]=f.a;a[11]=-Tx(f,b);a[12]=0;a[13]=0;a[14]=0;a[15]=1},Zx=function(a){this.a=a;this.f=a.createProgram();this.l=
5
+ Yx(this,!1,"uniform highp mat4 Mvpm;\nattribute highp vec4 aPosition;\nattribute highp vec2 aTexCoord;\nvarying highp vec2 oTexCoord;\nvoid main()\n{\n gl_Position \x3d Mvpm * aPosition;\n oTexCoord \x3d aTexCoord;\n}\n");this.j=Yx(this,!0,"precision highp float;\nuniform sampler2D Texture0;\nvarying highp vec2 oTexCoord;\nvoid main()\n{\n gl_FragColor \x3d texture2D(Texture0, oTexCoord);\n gl_FragColor.w \x3d 1.0;\n}\n");a.attachShader(this.f,this.l);a.attachShader(this.f,this.j);a.bindAttribLocation(this.f,
6
+ 0,"aPosition");a.bindAttribLocation(this.f,1,"aTexCoord");a.linkProgram(this.f);if(!a.getProgramParameter(this.f,a.LINK_STATUS))throw new _.O(1,9,9004,"Unable to initialize shader");a.useProgram(this.f);this.h=a.getUniformLocation(this.f,"Mvpm");a.uniform1i(a.getUniformLocation(this.f,"Texture0"),0);a.useProgram(null)},Yx=function(a,b,c){b=a.a.createShader(b?a.a.FRAGMENT_SHADER:a.a.VERTEX_SHADER);a.a.shaderSource(b,c);a.a.compileShader(b);if(!a.a.getShaderParameter(b,a.a.COMPILE_STATUS))throw new _.O(1,
7
+ 9,9004,"Unable to compile GL shader: "+a.a.getShaderInfoLog(b));return b},$x=function(a){this.a=a;var b=[],c,d;for(d=0;70>=d;d++){var e=3>=d?d/4/64:67<=d?(63+(d-66)/4)/64:(d-3)/64;var f=(e-.5)*Math.PI,g=Math.cos(f);for(c=0;128>=c;c++){var k=c/128,l=(.5+k)*Math.PI*2;128===c?(b.push(b[645*d]),b.push(b[645*d+1]),b.push(b[645*d+2])):(b.push(100*Math.cos(l)*g),b.push(100*Math.sin(l)*g),b.push(100*Math.sin(f)));0===d||70===d?b.push(.5):b.push(1-k);b.push(1-e)}}e=[];for(c=0;128>c;c++)for(d=0;70>d;d++)f=
8
+ 5*(129*d+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*d+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*d+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]);this.h=e.length/5;this.f=a.createBuffer();b=new Float32Array(e);a.bindBuffer(a.ARRAY_BUFFER,this.f);a.bufferData(a.ARRAY_BUFFER,b,a.STATIC_DRAW)},ay=function(a,
9
+ b){this.a=b;this.f=this.a.createTexture();b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,this.f);b.texImage2D(b.TEXTURE_2D,0,b.RGB,b.RGB,b.UNSIGNED_BYTE,a);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.LINEAR);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.LINEAR);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.bindTexture(b.TEXTURE_2D,null)},by=function(){var a=this;this.o=this.w=this.L=this.J=this.A=
10
+ this.ba=this.H=this.f=this.a=this.m=null;this.g=new _.M("clpp.vr");this.I=70;this.X=1;this.P=this.M=!1;this.G=function(){if(a.a&&a.f){a.f.viewport(0,0,a.a.width,a.a.height);var b=a.L.a,c=Math.tan(.5*a.I*Math.PI/180);b[0]=1/(a.a.width/a.a.height*c);b[1]=0;b[2]=0;b[3]=0;b[4]=0;b[5]=1/c;b[6]=0;b[7]=0;b[8]=0;b[9]=0;b[10]=2E3/-1999.9;b[11]=200/-1999.9;b[12]=0;b[13]=0;b[14]=-1;b[15]=1}};this.l=this.j=0;this.h={x:0,y:0};this.T=new Vx;this.W=new Vx;this.ha=new Vx;this.ma=new Vx;this.B=this.Wn.bind(this);
11
+ this.D=this.Xn.bind(this);this.K=this.Vn.bind(this)},cy=function(a){var b=Qx(1,0,a.l*Math.PI/180);Px(Qx(0,1,a.j*Math.PI/180),a.T);Px(b,a.W);Xx(a.ha);Wx(a.ma,a.T,a.ha);Wx(a.H,a.W,a.ma)},dy=function(a){a.a&&(a.a.removeEventListener("mousemove",a.B,!1),a.a.removeEventListener(Mx,a.B,!1),a.a.removeEventListener("mouseup",a.D,!1),a.a.removeEventListener("touchend",a.D,!1))},ey=function(){};Rx.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.a*this.a)};Vx.prototype.set=function(a,b,c,d,e,f,g,k,l,m,n,p,q,t,u,y){var B=this.a;B[0]=a;B[4]=b;B[8]=c;B[12]=d;B[1]=e;B[5]=f;B[9]=g;B[13]=k;B[2]=l;B[6]=m;B[10]=n;B[14]=p;B[3]=q;B[7]=t;B[11]=u;B[15]=y;return this};var fy={alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!1,devicePixelRatio:1};_.w(by,_.cw);_.r=by.prototype;_.r.onPlayerCreated=function(a){this.g.info("Player created");this.m=a};
12
12
  _.r.onContentWillLoad=function(a){var b=a.getConfiguration();if(b.vr&&b.vr.enable){var c=b.vr,d=c.fieldOfView,e=c.sensitivity,f=c.invertHorizontalControl;c=c.invertVerticalControl;if(void 0!==d&&_.N.ya(d))this.I=d;else throw new _.O(1,7,7100,"fieldOfView configuration must be a number");if(void 0!==e&&_.N.ya(e)&&0<e)this.X=e;else throw new _.O(1,7,7100,"sensitivity configuration must be a positive number");this.M=!!f;this.P=!!c;if(a=a.getSurface())if((d=a.getMedia())&&d.tagName.toLowerCase()===_.Tg){this.g.info("Initialize VR Surface");
13
- if(!this.a){this.a=document.createElement("canvas");this.a.style.width="100%";this.f=this.a.getContext("webgl",jy)||this.a.getContext("experimental-webgl",jy);if(!this.f)throw new _.O(1,9,9003,"Unable to create GL context");this.H=new Zx;ay(this.H);this.ba=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(_.Vf,this.G)}a.addElementToContainer(this.a,!0,!0);a.hideMediaElement();b.vr.attachMouseListener&&(this.a.addEventListener("mousedown",this.K,
14
- !1),this.a.addEventListener(Rx,this.K,!1));this.G();this.Pj()}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(_.Vf,this.G),this.a.parentElement.removeChild(this.a),this.a.removeEventListener("mousedown",this.K,!1),delete this.a,this.a=null)};_.r.onPlayerWillDestroy=function(){var a=this;return _.I(function(b){a.m=null;_.A(b)})};_.r.id=function(){return"vr"};
16
- _.r.Pj=function(){if(this.m&&this.f){var a=this.m.getSurface();if(a&&(a=a.getMedia())&&a.tagName.toLowerCase()===_.Tg){this.w=requestAnimationFrame(this.Pj.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.ba;a.a.bindBuffer(a.a.ARRAY_BUFFER,
13
+ if(!this.a){this.a=document.createElement("canvas");this.a.style.width="100%";this.f=this.a.getContext("webgl",fy)||this.a.getContext("experimental-webgl",fy);if(!this.f)throw new _.O(1,9,9003,"Unable to create GL context");this.H=new Vx;Xx(this.H);this.ba=new $x(this.f);this.A=new Zx(this.f);this.J=new Vx;this.L=new Vx;this.o=this.w=null;this.a.addEventListener(_.Vf,this.G)}a.addElementToContainer(this.a,!0,!0);a.hideMediaElement();b.vr.attachMouseListener&&(this.a.addEventListener("mousedown",this.K,
14
+ !1),this.a.addEventListener(Nx,this.K,!1));this.G();this.Nj()}else this.g.info("No video element found, can not initialize VR plugin");else this.g.info("No surface found, can not initialize VR plugin")}};
15
+ _.r.onPlayerWillRelease=function(){this.g.info("Releasing VR plugin resources");this.w&&cancelAnimationFrame(this.w);this.h.x=0;this.l=this.j=this.h.y=0;this.f&&(delete this.f,this.f=null);this.a&&(dy(this),this.a.removeEventListener(_.Vf,this.G),this.a.parentElement.removeChild(this.a),this.a.removeEventListener("mousedown",this.K,!1),delete this.a,this.a=null)};_.r.onPlayerWillDestroy=function(){var a=this;return _.I(function(b){a.m=null;_.A(b)})};_.r.id=function(){return"vr"};
16
+ _.r.Nj=function(){if(this.m&&this.f){var a=this.m.getSurface();if(a&&(a=a.getMedia())&&a.tagName.toLowerCase()===_.Tg){this.w=requestAnimationFrame(this.Nj.bind(this));var b=this.f;this.o||a.readyState!==a.HAVE_ENOUGH_DATA||(this.o=new ay(a,b));b.clearColor(0,0,0,1);b.clearDepth(1);b.clearStencil(0);b.enable(b.DEPTH_TEST);b.depthFunc(b.LEQUAL);b.frontFace(b.CCW);b.cullFace(b.BACK);b.disable(b.CULL_FACE);b.enable(b.BLEND);b.blendFunc(b.SRC_ALPHA,b.ONE_MINUS_SRC_ALPHA);b.depthMask(!0);b.clearColor(0,
17
+ 0,0,1);b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT);if(this.o){var c=this.A;c.a.useProgram(c.f);c=Wx(this.J,this.L,this.H).a;var d=c[1];c[1]=c[4];c[4]=d;d=c[2];c[2]=c[8];c[8]=d;d=c[6];c[6]=c[9];c[9]=d;d=c[3];c[3]=c[12];c[12]=d;d=c[7];c[7]=c[13];c[13]=d;d=c[11];c[11]=c[14];c[14]=d;b.uniformMatrix4fv(this.A.h,!1,this.J.a);c=this.o;c.a.activeTexture(c.a.TEXTURE0);c.a.bindTexture(c.a.TEXTURE_2D,c.f);b.texImage2D(b.TEXTURE_2D,0,b.RGB,b.RGB,b.UNSIGNED_BYTE,a);a=this.ba;a.a.bindBuffer(a.a.ARRAY_BUFFER,
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.Zn=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.D,!1),this.a.addEventListener("touchend",this.D,!1)};
20
- _.r.$n=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.X;c=d*b*(this.P?-1:1);this.j+=a*b*(this.M?-1:1);this.l+=c;gy(this)};_.r.ao=function(a){this.g.debug("Mouse Up. Removing mouse interaction listeners");a.preventDefault();hy(this)};_.r.sn=function(a,b){this.l=b;this.j=a;gy(this)};_.r.wm=function(){return{x:this.j,y:this.l}};
21
- _.r.Wo=function(a){this.I=a;this.G()};_.K("clpp.vr.VrPlugin",fy);fy.prototype.setCameraFieldOfView=fy.prototype.Wo;fy.prototype.getCameraCoordinates=fy.prototype.wm;fy.prototype.moveCamera=fy.prototype.sn;fy.Id="vr";iy.prototype.create=function(){return new fy};_.fp(new iy);};
19
+ _.r.Vn=function(a){this.g.debug("Mouse Down. Enable VR mouse interaction");a.preventDefault();if(0===a.button||a.type===Nx)a.type===Nx?a.touches[0]&&(this.h.x=a.touches[0].clientX,this.h.y=a.touches[0].clientY):(this.h.x=a.clientX,this.h.y=a.clientY),this.g.debug("Mouse Start coordinates:",this.h,a),this.a.addEventListener("mousemove",this.B,!1),this.a.addEventListener(Mx,this.B,!1),this.a.addEventListener("mouseup",this.D,!1),this.a.addEventListener("touchend",this.D,!1)};
20
+ _.r.Wn=function(a){a.preventDefault();var b=a.clientX,c=a.clientY;a.type===Mx&&a.touches[0]&&(b=a.touches[0].clientX,c=a.touches[0].clientY);a=this.h.x-b;var d=this.h.y-c;this.h.x=b;this.h.y=c;b=this.X;c=d*b*(this.P?-1:1);this.j+=a*b*(this.M?-1:1);this.l+=c;cy(this)};_.r.Xn=function(a){this.g.debug("Mouse Up. Removing mouse interaction listeners");a.preventDefault();dy(this)};_.r.nn=function(a,b){this.l=b;this.j=a;cy(this)};_.r.sm=function(){return{x:this.j,y:this.l}};
21
+ _.r.So=function(a){this.I=a;this.G()};_.J("clpp.vr.VrPlugin",by);by.prototype.setCameraFieldOfView=by.prototype.So;by.prototype.getCameraCoordinates=by.prototype.sm;by.prototype.moveCamera=by.prototype.nn;by.Id="vr";ey.prototype.create=function(){return new by};_.bp(new ey);};
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){_.ft(a,/[ \t]+/gm)},Dx=function(a){return a.a===a.f.length?null:(a=_.ft(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=_.Ep:a.textAlign=
4
- _.qw[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"===d[1]?_.Rg:_.Sg;else if(d=/^size:([\d.]+)%$/.exec(b))a.size=Number(d[1]);else if(d=/^position:([\d.]+)%(?:,(line-left|line-right|center|start|end))?$/.exec(b))a.position=Number(d[1]),d[2]&&(b=d[2],a.positionAlign=b===_.He||b===_.jg?_.He:b===_.Ie||b===_.oe?_.Ie:_.nd);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=_.rw[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.Gp,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.rw[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]:(_.Vh("VTT parser could not find a region with id: ",b," The region will be ignored."),null)},Kx=function(a){a=_.ft(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 _.M("clpp.vtt.mp4")},Ox=function(a,b,c){var d,e,f;(new _.tq).N("payl",_.wq(function(g){d=_.R.ea(g)})).N("iden",_.wq(function(g){e=_.R.ea(g)})).N("sttg",_.wq(function(g){f=_.R.ea(g)})).parse(a);return d?Nx(d,e,f,b,c):null},Nx=function(a,b,c,d,e){a=new _.Jp(d,e,a,_.$g);b&&(a.id=b);if(c)for(b=new _.et(c),c=
7
- Dx(b);c;)Jx(a,c,[])||_.Vh(xx,c,wx),Cx(b),c=Dx(b);return a},Px=function(){this.a=new Gx};Ex.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+=Fx(c.value)}return _.R.ub(a)};Gx.prototype.create=function(){return new Ex};Gx.prototype.probe=function(a,b){return(a===zx||a===yx)&&b===_.ug};Hx.prototype.parseInit=function(){};
8
- Hx.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(_.P,2,2E3);c=b.periodStart;if(d[0].includes("X-TIMESTAMP-MAP")){var e=d[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),f=d[0].match(/MPEGTS:(\d+)/m);if(e&&f){c=Kx(new _.et(e[1]));if(null==c)throw new _.O(_.P,2,2E3);f=Number(f[1]);for(e=b.segmentStart;95443.7176888889<=e;)e-=95443.7176888889,f+=8589934592;c=b.periodStart+
9
- f/9E4-c}}else this.a.streaming.relativeTextTimestamp&&null!==b.segmentStart&&(c=b.segmentStart);f=[];e=_.v(d);for(var g=e.next();!g.done;g=e.next()){var k=g.value;if(/^region/.test(k.toLowerCase())){k=new _.et(k.replace(/\n/g," "));g=new _.Mp;Dx(k);Cx(k);for(var l=Dx(k);l;){var m;a:{var n=g,p=l;if(m=/^id:(.*)$/.exec(p))n.id=m[1];else if(m=/^width:(\d{1,2}|100)%$/.exec(p))n.width=Number(m[1]);else if(m=/^lines:(\d+)$/.exec(p))n.height=Number(m[1]),n.heightUnits=2;else if(m=/^regionanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.regionAnchorX=
10
- Number(m[1]),n.regionAnchorY=Number(m[2]);else if(m=/^viewportanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.viewportAnchorX=Number(m[1]),n.viewportAnchorY=Number(m[2]);else if(/^scroll:up$/.exec(p))n.scroll="up";else{m=!1;break a}m=!0}m||_.Vh("VTT parser encountered an invalid VTTRegion setting: ",l,wx);Cx(k);l=Dx(k)}f.push(g)}}e=[];k=_.v(d);for(g=k.next();!g.done;g=k.next())if(g=g.value,/^style/.test(g.toLowerCase())){g=g.replace(/^style/i,"").replace(/\n/g," ");l=/[^{}]+{[^{}]*}/g;do(m=l.exec(g))&&
11
- e.push(m[0]);while(m)}k=[];d=_.v(d);for(g=d.next();!g.done;g=d.next())if(g=g.value,g.includes("--\x3e")){p=g.split("\n");var q=c;if(1===p.length&&!p[0]||/^NOTE($|[ \t])/.test(p[0])||"STYLE"===p[0])g=null;else{g=null;p[0].includes("--\x3e")||(g=p[0],p.splice(0,1));l=new _.et(p[0]);m=Kx(l);var t=_.ft(l,/[ \t]+--\x3e[ \t]+/g);n=Kx(l);if(null==m||null==t||null==n)throw new _.O(_.P,2,2001);m+=q;n+=q;p=p.slice(1).join("\n").trim();m=new _.Jp(m,n,p,_.$g);g&&(m.id=g);Cx(l);for(n=Dx(l);n;)Jx(m,n,f)||_.Vh(xx,
12
- n,wx),Cx(l),n=Dx(l);null!=g&&(m.id=g);g=m}g&&k.push(g)}return{cues:k,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 _.tq).N(_.We,_.uq).N(_.Dg,_.uq).N(_.Qe,_.uq).da("mdhd",function(d){0===d.version?(d.reader.skip(4),d.reader.skip(4),b.a=_.oq(d.reader),d.reader.skip(4)):(d.reader.skip(8),d.reader.skip(8),b.a=_.oq(d.reader),d.reader.skip(8));d.reader.skip(4)}).N(_.Ve,_.uq).N(_.mg,_.uq).da(_.og,_.vq).N("wvtt",function(){c=!0}).parse(a);if(!this.a)throw new _.O(_.P,2,2008);if(!c)throw new _.O(_.P,2,2008);};
13
- Mx.prototype.parseMedia=function(a,b){if(!this.a)throw this.g.error("No init segment for MP4+VTT!"),new _.O(_.P,2,2008);var c=0,d=[],e,f=[],g=!1,k=!1,l=!1,m=null;(new _.tq).N("moof",_.uq).N("traf",_.uq).da("tfdt",function(x){g=!0;c=0===x.version?_.oq(x.reader):_.qq(x.reader)}).da("tfhd",function(x){var J=x.flags;x=x.reader;x.skip(4);J&1&&x.skip(8);J&2&&x.skip(4);m=J&8?_.oq(x):null}).da("trun",function(x){k=!0;var J=x.version,L=x.flags;x=x.reader;var U=_.oq(x);L&1&&x.skip(4);L&4&&x.skip(4);for(var V=
14
- [],ta=0;ta<U;ta++){var za={duration:null,sampleSize:null,yh:null};L&256&&(za.duration=_.oq(x));L&512&&(za.sampleSize=_.oq(x));L&1024&&x.skip(4);L&2048&&(za.yh=0===J?_.oq(x):_.pq(x));V.push(za)}d=V}).N(_.Pe,_.wq(function(x){l=!0;e=x})).parse(a);if(!l&&!g&&!k)throw new _.O(_.P,2,2008);var n=c,p=new DataView(e.buffer,e.byteOffset,e.byteLength);p=new _.jq(p,!1);for(var q=_.v(d),t=q.next();!t.done;t=q.next()){t=t.value;var u=t.duration||m,z=t.yh?c+t.yh:n;n=z+(u||0);var B=0;do{var D=_.oq(p);B+=D;var C=
15
- _.oq(p);C=_.yq(C);var E=null;"vttc"===C?8<D&&(E=_.sq(p,D-8)):("vtte"!==C&&this.g.error("Unknown box "+C+"! Skipping!"),p.skip(D-8));u?E&&f.push(Ox(E,b.periodStart+z/this.a,b.periodStart+n/this.a)):this.g.error("WVTT sample duration unknown, and no default found!")}while(t.sampleSize&&B<t.sampleSize)}return{cues:f.filter(_.wn),styles:[]}};_.w(Px,_.jv);Px.prototype.install=function(){_.Bv(_.ug,Hx);_.Bv(Ax,Hx);_.Bv(Bx,Hx);_.Bv(_.Oc,Mx);_.Bv(zx,Lx);_.Bv(yx,Lx);_.Ct.push(this.a)};Px.prototype.uninstall=function(){_.Dv(_.ug);_.Dv(Ax);_.Dv(Bx);_.Dv(_.Oc);_.Dv(zx);_.Dv(yx);_.Et(this.a)};Px.prototype.id=function(){return"subtitles-vtt"};_.K("clpp.vtt.VttComponent",Px);};
2
+ var f=function(window){var sx=" The setting will be ignored.",tx="VTT parser encountered an invalid VTT setting: ",ux="application/x-subrip",vx="text/srt",wx='text/vtt; codecs\x3d"vtt"',xx='text/vtt; codecs\x3d"wvtt"',yx=function(a){_.Ys(a,/[ \t]+/gm)},zx=function(a){return a.a===a.f.length?null:(a=_.Ys(a,/[^ \t\n]*/gm))?a[0]:null},Ax=function(){},Bx=function(a){var b="";for(a=a.split(/\n/);3<a.length;){for(var c=3;c<a.length;++c)a[2]+="\n"+a[c];a.splice(3,a.length-3)}if(3!==a.length)return"";c=0;!a[0].match(/\d+:\d+:\d+/)&&
3
+ a[1].match(/\d+:\d+:\d+/)&&(b+=a[0].match(/\w+/)+"\n",++c);if(a[c].match(/\d+:\d+:\d+/)){var d=a[1].match(/(\d+):(\d+):(\d+)(?:,(\d+))?\s*--?>\s*(\d+):(\d+):(\d+)(?:,(\d+))?/);if(d)b+=d[1]+":"+d[2]+":"+d[3]+"."+d[4]+" --\x3e ",b+=d[5]+":"+d[6]+":"+d[7]+"."+d[8]+"\n",++c;else return""}else return"";a[c]&&(b+=a[c]+"\n\n");return b},Cx=function(){},Dx=function(a){this.a=a},Fx=function(a,b,c){var d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"===b?a.textAlign=_.Ap:a.textAlign=
4
+ _.mw[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"===d[1]?_.Rg:_.Sg;else if(d=/^size:([\d.]+)%$/.exec(b))a.size=Number(d[1]);else if(d=/^position:([\d.]+)%(?:,(line-left|line-right|center|start|end))?$/.exec(b))a.position=Number(d[1]),d[2]&&(b=d[2],a.positionAlign=b===_.He||b===_.jg?_.He:b===_.Ie||b===_.pe?_.Ie:_.od);else if(d=/^region:(.*)$/.exec(b)){if(b=Ex(c,d[1]))a.region=b}else{a:{if(c=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=1,a.line=
5
+ Number(c[1]),c[2]&&(a.lineAlign=_.nw[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.Cp,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.nw[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},Ex=function(a,b){var c=a.filter(function(d){return d.id===b});return c.length?c[0]:(_.Rh("VTT parser could not find a region with id: ",b," The region will be ignored."),null)},Gx=function(a){a=_.Ys(a,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g);if(null==
6
+ a)return null;var b=Number(a[2]),c=Number(a[3]);return 59<b||59<c?null:Number(a[4])/1E3+c+60*b+3600*(Number(a[1])||0)},Hx=function(){Dx.apply(this,arguments)},Ix=function(){this.a=null;this.g=new _.M("clpp.vtt.mp4")},Kx=function(a,b,c){var d,e,f;(new _.oq).N("payl",_.rq(function(g){d=_.R.ga(g)})).N("iden",_.rq(function(g){e=_.R.ga(g)})).N("sttg",_.rq(function(g){f=_.R.ga(g)})).parse(a);return d?Jx(d,e,f,b,c):null},Jx=function(a,b,c,d,e){a=new _.Fp(d,e,a,_.$g);b&&(a.id=b);if(c)for(b=new _.Xs(c),c=
7
+ zx(b);c;)Fx(a,c,[])||_.Rh(tx,c,sx),yx(b),c=zx(b);return a},Lx=function(){this.a=new Cx};Ax.prototype.a=function(a){a=_.R.ga(a);a=a.replace(/\r+/g,"");a=a.replace(/^\s+|\s+$/g,"");a=a.replace(/<[a-zA-Z\\/][^>]*>/g,"");var b=a.split("\n\n");a="";if(0<b.length){a+="WEBVTT\n\n";b=_.v(b);for(var c=b.next();!c.done;c=b.next())a+=Bx(c.value)}return _.R.ub(a)};Cx.prototype.create=function(){return new Ax};Cx.prototype.probe=function(a,b){return(a===vx||a===ux)&&b===_.ug};Dx.prototype.parseInit=function(){};
8
+ Dx.prototype.parseMedia=function(a,b){var c=_.R.ga(a);c=c.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");var d=c.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(d[0]))throw new _.O(_.P,2,2E3);c=b.periodStart;if(d[0].includes("X-TIMESTAMP-MAP")){var e=d[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),f=d[0].match(/MPEGTS:(\d+)/m);if(e&&f){c=Gx(new _.Xs(e[1]));if(null==c)throw new _.O(_.P,2,2E3);f=Number(f[1]);for(e=b.segmentStart;95443.7176888889<=e;)e-=95443.7176888889,f+=8589934592;c=b.periodStart+
9
+ f/9E4-c}}else this.a.streaming.relativeTextTimestamp&&null!==b.segmentStart&&(c=b.segmentStart);f=[];e=_.v(d);for(var g=e.next();!g.done;g=e.next()){var k=g.value;if(/^region/.test(k.toLowerCase())){k=new _.Xs(k.replace(/\n/g," "));g=new _.Ip;zx(k);yx(k);for(var l=zx(k);l;){var m;a:{var n=g,p=l;if(m=/^id:(.*)$/.exec(p))n.id=m[1];else if(m=/^width:(\d{1,2}|100)%$/.exec(p))n.width=Number(m[1]);else if(m=/^lines:(\d+)$/.exec(p))n.height=Number(m[1]),n.heightUnits=2;else if(m=/^regionanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.regionAnchorX=
10
+ Number(m[1]),n.regionAnchorY=Number(m[2]);else if(m=/^viewportanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.viewportAnchorX=Number(m[1]),n.viewportAnchorY=Number(m[2]);else if(/^scroll:up$/.exec(p))n.scroll="up";else{m=!1;break a}m=!0}m||_.Rh("VTT parser encountered an invalid VTTRegion setting: ",l,sx);yx(k);l=zx(k)}f.push(g)}}e=[];k=_.v(d);for(g=k.next();!g.done;g=k.next())if(g=g.value,/^style/.test(g.toLowerCase())){g=g.replace(/^style/i,"").replace(/\n/g," ");l=/[^{}]+{[^{}]*}/g;do(m=l.exec(g))&&
11
+ e.push(m[0]);while(m)}k=[];d=_.v(d);for(g=d.next();!g.done;g=d.next())if(g=g.value,g.includes("--\x3e")){p=g.split("\n");var q=c;if(1===p.length&&!p[0]||/^NOTE($|[ \t])/.test(p[0])||"STYLE"===p[0])g=null;else{g=null;p[0].includes("--\x3e")||(g=p[0],p.splice(0,1));l=new _.Xs(p[0]);m=Gx(l);var t=_.Ys(l,/[ \t]+--\x3e[ \t]+/g);n=Gx(l);if(null==m||null==t||null==n)throw new _.O(_.P,2,2001);m+=q;n+=q;p=p.slice(1).join("\n").trim();m=new _.Fp(m,n,p,_.$g);g&&(m.id=g);yx(l);for(n=zx(l);n;)Fx(m,n,f)||_.Rh(tx,
12
+ n,sx),yx(l),n=zx(l);null!=g&&(m.id=g);g=m}g&&k.push(g)}return{cues:k,styles:e}};_.w(Hx,Dx);Hx.prototype.parseMedia=function(a,b){return Dx.prototype.parseMedia.call(this,(new Ax).a(a),b)};Ix.prototype.parseInit=function(a){var b=this,c=!1;(new _.oq).N(_.We,_.pq).N(_.Dg,_.pq).N(_.Qe,_.pq).da("mdhd",function(d){0===d.version?(d.reader.skip(4),d.reader.skip(4),b.a=_.jq(d.reader),d.reader.skip(4)):(d.reader.skip(8),d.reader.skip(8),b.a=_.jq(d.reader),d.reader.skip(8));d.reader.skip(4)}).N(_.Ve,_.pq).N(_.mg,_.pq).da(_.og,_.qq).N("wvtt",function(){c=!0}).parse(a);if(!this.a)throw new _.O(_.P,2,2008);if(!c)throw new _.O(_.P,2,2008);};
13
+ Ix.prototype.parseMedia=function(a,b){if(!this.a)throw this.g.error("No init segment for MP4+VTT!"),new _.O(_.P,2,2008);var c=0,d=[],e,f=[],g=!1,k=!1,l=!1,m=null;(new _.oq).N("moof",_.pq).N("traf",_.pq).da("tfdt",function(z){g=!0;c=0===z.version?_.jq(z.reader):_.lq(z.reader)}).da("tfhd",function(z){var K=z.flags;z=z.reader;z.skip(4);K&1&&z.skip(8);K&2&&z.skip(4);m=K&8?_.jq(z):null}).da("trun",function(z){k=!0;var K=z.version,L=z.flags;z=z.reader;var U=_.jq(z);L&1&&z.skip(4);L&4&&z.skip(4);for(var V=
14
+ [],ta=0;ta<U;ta++){var za={duration:null,sampleSize:null,uh:null};L&256&&(za.duration=_.jq(z));L&512&&(za.sampleSize=_.jq(z));L&1024&&z.skip(4);L&2048&&(za.uh=0===K?_.jq(z):_.kq(z));V.push(za)}d=V}).N(_.Pe,_.rq(function(z){l=!0;e=z})).parse(a);if(!l&&!g&&!k)throw new _.O(_.P,2,2008);var n=c,p=new DataView(e.buffer,e.byteOffset,e.byteLength);p=new _.eq(p,!1);for(var q=_.v(d),t=q.next();!t.done;t=q.next()){t=t.value;var u=t.duration||m,y=t.uh?c+t.uh:n;n=y+(u||0);var B=0;do{var D=_.jq(p);B+=D;var C=
15
+ _.jq(p);C=_.tq(C);var E=null;"vttc"===C?8<D&&(E=_.nq(p,D-8)):("vtte"!==C&&this.g.error("Unknown box "+C+"! Skipping!"),p.skip(D-8));u?E&&f.push(Kx(E,b.periodStart+y/this.a,b.periodStart+n/this.a)):this.g.error("WVTT sample duration unknown, and no default found!")}while(t.sampleSize&&B<t.sampleSize)}return{cues:f.filter(_.sn),styles:[]}};_.w(Lx,_.fv);Lx.prototype.install=function(){_.xv(_.ug,Dx);_.xv(wx,Dx);_.xv(xx,Dx);_.xv(_.Oc,Ix);_.xv(vx,Hx);_.xv(ux,Hx);_.ut.push(this.a)};Lx.prototype.uninstall=function(){_.zv(_.ug);_.zv(wx);_.zv(xx);_.zv(_.Oc);_.zv(vx);_.zv(ux);_.wt(this.a)};Lx.prototype.id=function(){return"subtitles-vtt"};_.J("clpp.vtt.VttComponent",Lx);};
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 _.M(rx)},tx=function(){};_.w(sx,_.gw);sx.prototype.Qi=function(){return this.a};
3
- sx.prototype.onContentWillLoad=function(a,b){var c=this,d,e,f,g,k;return _.I(function(l){if(1==l.a){d=a.getConfiguration();e=d.yospace;if(!e.enabled)return l["return"]();if(typeof window.YospaceAdManagement!==_.$e)throw new _.O(_.P,9,7003,"Yospace SDK not found.");c.g.info("Yospace enabled.");f=e.streamType||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 _.y(l,m,2)}g=l.f;k=g.getSessionState();if(k!==YospaceAdManagement.SessionState.INITIALISED)throw c.g.error("Failed to initialize Yospace session. State:",k,"URL",b.url),new _.O(_.P,9,7003,"Yospace session failed to initialize.");a.trigger(new _.Q(_.qh,{detail:g}));b.url=g.getPlaybackUrl();c.g.info("Yospace session initialized. New URL:",b.url);c.a=g;_.A(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 _.Q(_.ph,{detail:b}))}};sx.prototype.id=function(){return"yospace"};_.K(rx,sx);sx.prototype.getSession=sx.prototype.Qi;sx.Id="yospace";tx.prototype.create=function(){return new sx};var ux=_.Vb,vx="LIVE";_.K("clpp.yospace.StreamType",{VOD:ux,LIVE:vx,DVR:"DVR"});_.fp(new tx);};
2
+ var f=function(window){var nx="clpp.yospace.YospacePlugin",ox=function(){this.a=null;this.g=new _.M(nx)},px=function(){};_.w(ox,_.cw);ox.prototype.Ni=function(){return this.a};
3
+ ox.prototype.onContentWillLoad=function(a,b){var c=this,d,e,f,g,k;return _.I(function(l){if(1==l.a){d=a.getConfiguration();e=d.yospace;if(!e.enabled)return l["return"]();if(typeof window.YospaceAdManagement!==_.$e)throw new _.O(_.P,9,7003,"Yospace SDK not found.");c.g.info("Yospace enabled.");f=e.streamType||qx;a:{var m=b.url;c.g.info("Creating Yospace session for stream type",f);switch(f){case qx:m=YospaceAdManagement.SessionVOD.create(m);break a;case rx:m=YospaceAdManagement.SessionLive.create(m);
4
+ break a;default:m=YospaceAdManagement.SessionDVRLive.create(m)}}return _.x(l,m,2)}g=l.f;k=g.getSessionState();if(k!==YospaceAdManagement.SessionState.INITIALISED)throw c.g.error("Failed to initialize Yospace session. State:",k,"URL",b.url),new _.O(_.P,9,7003,"Yospace session failed to initialize.");a.trigger(new _.Q(_.mh,{detail:g}));b.url=g.getPlaybackUrl();c.g.info("Yospace session initialized. New URL:",b.url);c.a=g;_.A(l)})};
5
+ ox.prototype.onPlayerWillRelease=function(a){if(this.a){this.g.info("Shutting down Yospace session.");var b=this.a;this.a.shutdown();this.a=null;a.trigger(new _.Q(_.lh,{detail:b}))}};ox.prototype.id=function(){return"yospace"};_.J(nx,ox);ox.prototype.getSession=ox.prototype.Ni;ox.Id="yospace";px.prototype.create=function(){return new ox};var qx=_.Vb,rx="LIVE";_.J("clpp.yospace.StreamType",{VOD:qx,LIVE:rx,DVR:"DVR"});_.bp(new px);};
6
6
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
7
7
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
8
8
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.youbora.js CHANGED
@@ -1,44 +1,44 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var Pw='" event to NPAW',Qw='" event to Youbora',Rw='Reporting "',Sw="Unhandled state",Tw="ad break start",Uw="ad buffering ended",Vw="ad buffering started",Ww="ad click through url: ",Xw="ad timeline changed",Yw="clpp.npaw.NpawPlugin",Zw="clpp.npaw.YouboraPlugin",$w="content.isLive",ax="content.title",bx="is container visible",cx=function(a){return a.startsWith(_.Md)?"Widevine":a.startsWith(_.Id)?"FairPlay":a.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":a.startsWith(_.jf)?"ClearKey":
3
- a.startsWith(_.Hd)?"Primetime":a},dx=function(a){return a&&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":_.qe;b.severity===_.P?(d.fireFatalError(b.code,b.message,b.metadata),c.debug('Reporting "fatal '+a+'" to Youbora',b.code,b)):(d.fireError(b.code,b.message,b.metadata),c.debug(Rw+a+'" to Youbora',b.code,b));return b},
4
- fx=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.m=c;d.a=new _.Bi;d.g=new _.M("clpp.npaw.YouboraAdapter");d.o=!1;d.h=!1;d.B=!1;d.registerListeners();return d}_.w(b,youbora.Adapter);b.prototype.getPlayhead=function(){return this.getIsLive()?-1:this.m.getPosition()};b.prototype.getDuration=function(){return this.m.getDuration()};b.prototype.getRendition=function(){var c=this.m.getTrackManager();if(c&&(c=c.sa())){var d=c.width;var e=c.height;var f=c.bandwidth}d&&e&&f||(c=this.j(),
5
- d=d||c.width,e=e||c.height,f=f||c.streamBandwidth);return youbora.Util.buildRenditionString(d,e,f)};b.prototype.getIsLive=function(){return this.m.isLive()};b.prototype.getResource=function(){var c=this.m.ab();return c&&c.url};b.prototype.getBitrate=function(){return this.j().streamBandwidth};b.prototype.getThroughput=function(){return this.j().estimatedBandwidth};b.prototype.getPlayrate=function(){return this.m.Ec()};b.prototype.getFramesPerSecond=function(){var c=this.m.getTrackManager();return c&&
6
- (c=c.Ra())?c.frameRate:null};b.prototype.getPlayerName=function(){return _.ya};b.prototype.getVersion=function(){return"6.32.0-beta.3-castlabsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ia};b.prototype.registerListeners=function(){this.m&&this.a&&(this.g.debug("registering listeners"),youbora.Util.logAllEvents(this.m),this.a.on(this.m,_.kg,this.K.bind(this)),this.a.on(this.m,_.qe,this.H.bind(this)),this.a.on(this.m,_.Og,this.J.bind(this)),this.a.on(this.m,_.Ng,this.I.bind(this)),
7
- this.a.on(this.m,_.Fc,this.D.bind(this)),this.a.on(this.m,_.id,this.G.bind(this)))};b.prototype.unregisterListeners=function(){this.g.debug(_.Qb);_.Ei(this.a)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.B=!0};b.prototype.j=function(){return this.m.getStats()||_.lu()};b.prototype.w=function(){return!!this.m.getConfiguration().autoplay};b.prototype.K=function(c){c=c.detail;this.l("state change",c);if(c)switch(c.currentState){case 1:this.w()&&this.f();break;case 3:this.f();
8
- this.A();this.fireResume();this.fireBufferEnd();break;case 4:this.w()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.mu:this.fireBufferEnd();this.fireStop();break;case 5:this.fireBufferEnd();this.o&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case 2:this.fireBufferBegin();break;default:this.g.debug(Sw,c)}};b.prototype.f=function(){this.plugin.isInitiated||(this.h=!1,this.fireInit())};b.prototype.A=function(){var c=this.m.getDrmInfo();c&&(c=cx(c.keySystem))&&
9
- this.plugin.setOptions({"content.drm":c});this.fireJoin()};b.prototype.H=function(c){!(c=c.detail)||this.h||10003===c.code&&this.plugin.getAdsAdapter()||(c=ex(c,this.m.getConfiguration().youbora,this.g,this))&&c.severity===_.P&&(this.h=!0)};b.prototype.J=function(){this.m.isEnded()||(this.l(_.cg),this.f(),this.fireSeekBegin())};b.prototype.I=function(){this.l(_.bg);this.fireSeekEnd()};b.prototype.D=function(c){this.g.debug("adsTimeline",c);this.o=(c=c.adsTimeline)&&c.$b()};b.prototype.G=function(c){this.g.debug("Casting",
10
- c);this.fireCasted()};b.prototype.l=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.g.debug.apply(this.g,[Rw+c+Qw].concat(_.uh(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 _.Bi;d.g=new _.M("clpp.npaw.YouboraAdsAdapter");d.registerListeners();d.A=!1;d.l=!1;return d}_.w(b,youbora.Adapter);b.prototype.getDuration=function(){return this.a&&this.a.getDuration()};b.prototype.getRendition=function(){var c=
11
- null;this.a&&(c=youbora.Util.buildRenditionString(this.a.fb(),this.a.eb(),this.a.Ga()));return c};b.prototype.getBitrate=function(){return this.a&&this.a.Ga()};b.prototype.getPlayhead=function(){var c=this.m.getAdsManager();return c&&c.getPosition()};b.prototype.getResource=function(){return this.a&&this.a.getMediaUrl()};b.prototype.getTitle=function(){return this.a&&this.a.getTitle()};b.prototype.getProvider=function(){return this.a&&this.a.getAdvertiserName()};b.prototype.getCreativeId=function(){return this.a&&
2
+ var f=function(window){var Lw='" event to NPAW',Mw='" event to Youbora',Nw='Reporting "',Ow="Unhandled state",Pw="ad break start",Qw="ad buffering ended",Rw="ad buffering started",Sw="ad click through url: ",Tw="ad timeline changed",Uw="clpp.npaw.NpawPlugin",Vw="clpp.npaw.YouboraPlugin",Ww="content.isLive",Xw="content.title",Yw="is container visible",Zw=function(a){return a.startsWith(_.Nd)?"Widevine":a.startsWith(_.Jd)?"FairPlay":a.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":a.startsWith(_.jf)?"ClearKey":
3
+ a.startsWith(_.Id)?"Primetime":a},$w=function(a){return a&&a.errorFilter?a.errorFilter:function(b){return{code:""+b.code,message:b.message,severity:b.severity}}},ax=function(a,b,c,d){b=$w(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===a.code?"ad error":_.re;b.severity===_.P?(d.fireFatalError(b.code,b.message,b.metadata),c.debug('Reporting "fatal '+a+'" to Youbora',b.code,b)):(d.fireError(b.code,b.message,b.metadata),c.debug(Nw+a+'" to Youbora',b.code,b));return b},
4
+ bx=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.m=c;d.a=new _.xi;d.g=new _.M("clpp.npaw.YouboraAdapter");d.o=!1;d.h=!1;d.B=!1;d.registerListeners();return d}_.w(b,youbora.Adapter);b.prototype.getPlayhead=function(){return this.getIsLive()?-1:this.m.getPosition()};b.prototype.getDuration=function(){return this.m.getDuration()};b.prototype.getRendition=function(){var c=this.m.getTrackManager();if(c&&(c=c.sa())){var d=c.width;var e=c.height;var f=c.bandwidth}d&&e&&f||(c=this.j(),
5
+ d=d||c.width,e=e||c.height,f=f||c.streamBandwidth);return youbora.Util.buildRenditionString(d,e,f)};b.prototype.getIsLive=function(){return this.m.isLive()};b.prototype.getResource=function(){var c=this.m.$a();return c&&c.url};b.prototype.getBitrate=function(){return this.j().streamBandwidth};b.prototype.getThroughput=function(){return this.j().estimatedBandwidth};b.prototype.getPlayrate=function(){return this.m.Ec()};b.prototype.getFramesPerSecond=function(){var c=this.m.getTrackManager();return c&&
6
+ (c=c.Qa())?c.frameRate:null};b.prototype.getPlayerName=function(){return _.ya};b.prototype.getVersion=function(){return"6.32.0-castlabsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ia};b.prototype.registerListeners=function(){this.m&&this.a&&(this.g.debug("registering listeners"),youbora.Util.logAllEvents(this.m),this.a.on(this.m,_.kg,this.K.bind(this)),this.a.on(this.m,_.re,this.H.bind(this)),this.a.on(this.m,_.Og,this.J.bind(this)),this.a.on(this.m,_.Ng,this.I.bind(this)),this.a.on(this.m,
7
+ _.Fc,this.D.bind(this)),this.a.on(this.m,_.jd,this.G.bind(this)))};b.prototype.unregisterListeners=function(){this.g.debug(_.Qb);_.Ai(this.a)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.B=!0};b.prototype.j=function(){return this.m.getStats()||_.hu()};b.prototype.w=function(){return!!this.m.getConfiguration().autoplay};b.prototype.K=function(c){c=c.detail;this.l("state change",c);if(c)switch(c.currentState){case 1:this.w()&&this.f();break;case 3:this.f();this.A();
8
+ this.fireResume();this.fireBufferEnd();break;case 4:this.w()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.iu:this.fireBufferEnd();this.fireStop();break;case 5:this.fireBufferEnd();this.o&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case 2:this.fireBufferBegin();break;default:this.g.debug(Ow,c)}};b.prototype.f=function(){this.plugin.isInitiated||(this.h=!1,this.fireInit())};b.prototype.A=function(){var c=this.m.getDrmInfo();c&&(c=Zw(c.keySystem))&&this.plugin.setOptions({"content.drm":c});
9
+ this.fireJoin()};b.prototype.H=function(c){!(c=c.detail)||this.h||10003===c.code&&this.plugin.getAdsAdapter()||(c=ax(c,this.m.getConfiguration().youbora,this.g,this))&&c.severity===_.P&&(this.h=!0)};b.prototype.J=function(){this.m.isEnded()||(this.l(_.cg),this.f(),this.fireSeekBegin())};b.prototype.I=function(){this.l(_.bg);this.fireSeekEnd()};b.prototype.D=function(c){this.g.debug("adsTimeline",c);this.o=(c=c.adsTimeline)&&c.$b()};b.prototype.G=function(c){this.g.debug("Casting",c);this.fireCasted()};
10
+ b.prototype.l=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.g.debug.apply(this.g,[Nw+c+Mw].concat(_.qh(e)))};return new b(a)},cx=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.m=c;d.a=null;d.j=null;d.f=new _.xi;d.g=new _.M("clpp.npaw.YouboraAdsAdapter");d.registerListeners();d.A=!1;d.l=!1;return d}_.w(b,youbora.Adapter);b.prototype.getDuration=function(){return this.a&&this.a.getDuration()};b.prototype.getRendition=function(){var c=null;this.a&&
11
+ (c=youbora.Util.buildRenditionString(this.a.eb(),this.a.cb(),this.a.Ga()));return c};b.prototype.getBitrate=function(){return this.a&&this.a.Ga()};b.prototype.getPlayhead=function(){var c=this.m.getAdsManager();return c&&c.getPosition()};b.prototype.getResource=function(){return this.a&&this.a.getMediaUrl()};b.prototype.getTitle=function(){return this.a&&this.a.getTitle()};b.prototype.getProvider=function(){return this.a&&this.a.getAdvertiserName()};b.prototype.getCreativeId=function(){return this.a&&
12
12
  this.a.getCreativeId()};b.prototype.getPosition=function(){var c=youbora.Constants.AdPosition,d=null;if(this.a)switch(this.a.Ha()){case 0:d=c.Preroll;break;case 2:d=c.Postroll;break;case 1:d=c.Midroll}this.g.debug("Ad position",d);return d};b.prototype.getIsSkippable=function(){return this.a&&-1!==this.a.getSkipTimeOffset()};b.prototype.getAudioEnabled=function(){var c=this.m.getAdsManager();return c&&0<c.getAdVolume()};b.prototype.getExpectedBreaks=function(){return this.j&&this.j.getCuePoints().length};
13
- b.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};b.prototype.getExpectedAds=function(){return this.a&&this.a.gb()};b.prototype.getGivenAds=function(){return this.getExpectedAds()};b.prototype.getBreaksTime=function(){var c=this;return this.j&&this.j.getCuePoints().map(function(d){return-1===d?c.m.getDuration():d})};b.prototype.getIsFullscreen=function(){return this.m.getSurface().isFullscreen()};b.prototype.getIsVisible=function(){var c=this.m.getSurface().getContainer();c=youbora.Util.calculateAdViewability(c);
14
- this.g.debug(bx,c);return c};b.prototype.getPlayerName=function(){return _.ya};b.prototype.getVersion=function(){return"6.32.0-beta.3-castlabsadsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ia};b.prototype.registerListeners=function(){this.m&&this.f&&(this.f.on(this.m,_.Fc,this.T.bind(this)),this.f.on(this.m,_.Bc,this.P.bind(this)),this.f.on(this.m,_.xc,this.K.bind(this)),this.f.on(this.m,_.zc,this.L.bind(this)),this.f.on(this.m,_.mc,this.I.bind(this)),this.f.on(this.m,_.nc,this.o.bind(this,
15
- 1)),this.f.on(this.m,_.vc,this.o.bind(this,2)),this.f.on(this.m,_.Dc,this.o.bind(this,3)),this.f.on(this.m,_.lc,this.H.bind(this)),this.f.on(this.m,_.Ac,this.M.bind(this)),this.f.on(this.m,_.qe,this.J.bind(this)),this.f.on(this.m,_.ic,this.B.bind(this)),this.f.on(this.m,_.jc,this.D.bind(this)),this.f.on(this.m,_.kc,this.G.bind(this)),this.f.on(this.m,_.yc,this.w.bind(this)))};b.prototype.unregisterListeners=function(){_.Ei(this.f)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);
16
- this.A=!0};b.prototype.T=function(c){this.g.debug(Xw,c);this.j=c.adsTimeline};b.prototype.P=function(c){this.a=c.ad;this.h("ad start",this.a);this.fireStart();this.fireJoin()};b.prototype.I=function(){this.h("ad ended");this.fireStop()};b.prototype.K=function(){this.h("ad pause");this.w();this.firePause()};b.prototype.L=function(){this.h("ad resume");this.w();this.fireResume()};b.prototype.G=function(){this.l=!0;this.h(Vw);this.fireBufferBegin()};b.prototype.w=function(){this.l&&(this.h(Uw),this.l=
17
- !1,this.fireBufferEnd())};b.prototype.o=function(c){this.h("ad quartile",c);this.fireQuartile(c)};b.prototype.H=function(){this.h("ad clicked");var c=this.a&&this.a.$a();this.g.debug(Ww,c);this.fireClick(c)};b.prototype.M=function(){this.h("ad skipped");this.fireSkip()};b.prototype.B=function(c){this.a=c.ad;this.h(Tw,this.a);this.fireBreakStart()};b.prototype.D=function(){this.h("ad break stop");this.fireBreakStop();if(this.getPosition()===youbora.Constants.AdPosition.Postroll){var c=this.plugin.getAdapter();
18
- c&&c.fireStop()}};b.prototype.J=function(c){(c=c.detail)&&10003===c.code&&ex(c,this.m.getConfiguration().youbora,this.g,this)};b.prototype.h=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.g.debug.apply(this.g,[Rw+c+Qw].concat(_.uh(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.G=!1;return b}_.w(a,NpawPluginAdapters.video.Shaka);a.prototype.getPlayhead=function(){return this.getIsLive()?
19
- -1:this.player.getPosition()};a.prototype.getDuration=function(){return this.player.getDuration()};a.prototype.getRendition=function(){var b=null,c=null,d=null,e=this.player.getTrackManager();e&&(e=e.sa())&&(b=e.width,c=e.height,d=e.bandwidth);b&&c&&d||(e=this.j(),b=b||e.width,c=c||e.height,d=d||e.streamBandwidth);return this.getNpawUtils().buildRenditionString(b,c,d)};a.prototype.getIsLive=function(){return this.player.isLive()};a.prototype.getResource=function(){var b=this.player.ab();return b&&
20
- b.url};a.prototype.getBitrate=function(){return this.j().streamBandwidth};a.prototype.getThroughput=function(){return this.j().estimatedBandwidth};a.prototype.getPlayrate=function(){return this.player.Ec()};a.prototype.getFramesPerSecond=function(){var b=this.player.getTrackManager();return b&&(b=b.Ra())?b.frameRate:null};a.prototype.getPlayerName=function(){return _.ya};a.prototype.getVersion=function(){return"castlabs-adapter-6.32.0-beta.3-js"};a.prototype.getPlayerVersion=function(){return _.ia};
21
- a.prototype.registerListeners=function(){var b=this.w();this.player&&b&&(b.on(this.player,_.kg,this.M.bind(this)),b.on(this.player,_.qe,this.J.bind(this)),b.on(this.player,_.cg,this.L.bind(this)),b.on(this.player,_.bg,this.K.bind(this)),b.on(this.player,_.Fc,this.H.bind(this)),b.on(this.player,_.id,this.I.bind(this)),b.on(this.player,_.$c,this.P.bind(this)),b.on(this.player,_.wg,this.T.bind(this)))};a.prototype.unregisterListeners=function(){hx.debug(_.Qb);_.Ei(this.w())};a.prototype.dispose=function(){this.unregisterListeners();
22
- this.G=!0;this.f=this.h=!1;this.a=null};a.prototype.j=function(){return this.player.getStats()||_.lu()};a.prototype.o=function(){return!!this.player.getConfiguration().autoplay};a.prototype.M=function(b){b=b.detail;this.l("state change",b);if(b)switch(b.currentState){case 1:this.plugin.setVideoOptions({"content.subtitles":this.D()});this.o()&&this.fireStart();break;case 3:this.fireStart();this.A();this.fireResume();this.fireBufferEnd();break;case 4:this.o()&&this.fireStart();this.A();this.fireBufferEnd();
23
- this.firePause();break;case _.mu:this.fireBufferEnd();this.fireStop();break;case 5:this.fireBufferEnd();this.h&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case 2:this.fireBufferBegin();break;default:hx.debug(Sw,b)}};a.prototype.A=function(){this.fireJoin()};a.prototype.J=function(b){(b=b.detail)&&!this.f&&this.player&&10003!==b.code&&(b=ex(b,this.player.getConfiguration().npaw,hx,this))&&b.severity===_.P&&(this.f=!0)};a.prototype.L=function(){this.player.isEnded()||(this.l(_.cg),
24
- this.fireSeekBegin())};a.prototype.B=function(b){var c=this.player.getTrackManager();if(!c)return null;var d=null;b===_.tg&&(d=c.wa());b===_.Sc&&(d=c.qa());return d?d.language:null};a.prototype.P=function(){var b=this.B(_.Sc);this.plugin.setVideoOptions({"content.language":b})};a.prototype.T=function(){var b=this.B(_.tg),c=this.D();this.plugin.setVideoOptions({"content.subtitles":b||c})};a.prototype.w=function(){this.a||(this.a=new _.Bi);return this.a};a.prototype.K=function(){this.l(_.bg);this.fireSeekEnd()};
25
- a.prototype.H=function(b){hx.debug("adsTimeline",b);this.h=(b=b.adsTimeline)&&b.$b()};a.prototype.I=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,[Rw+b+Pw].concat(_.uh(d)))};a.prototype.D=function(){var b=this.player.getConfiguration();return b.npaw&&b.npaw.disabledSubtitlesLabel?b.npaw.disabledSubtitlesLabel:"off"};return a},kx=function(){function a(){var b=NpawPluginAdapters.ads.Ima.call(this)||
26
- this;b.a=null;b.l=null;b.h=null;b.j=null;b.D=!1;b.o=!1;return b}_.w(a,NpawPluginAdapters.ads.Ima);a.prototype.getDuration=function(){return this.a?this.a.getDuration():null};a.prototype.getRendition=function(){var b=null;this.a&&(b=this.getNpawUtils().buildRenditionString(this.a.fb(),this.a.eb(),this.a.Ga()));return b};a.prototype.getBitrate=function(){var b=null;this.a&&(b=this.a.Ga());return b};a.prototype.getPlayhead=function(){var b=null,c=this.player.getAdsManager();c&&(b=c.getPosition());return b};
13
+ b.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};b.prototype.getExpectedAds=function(){return this.a&&this.a.fb()};b.prototype.getGivenAds=function(){return this.getExpectedAds()};b.prototype.getBreaksTime=function(){var c=this;return this.j&&this.j.getCuePoints().map(function(d){return-1===d?c.m.getDuration():d})};b.prototype.getIsFullscreen=function(){return this.m.getSurface().isFullscreen()};b.prototype.getIsVisible=function(){var c=this.m.getSurface().getContainer();c=youbora.Util.calculateAdViewability(c);
14
+ this.g.debug(Yw,c);return c};b.prototype.getPlayerName=function(){return _.ya};b.prototype.getVersion=function(){return"6.32.0-castlabsadsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ia};b.prototype.registerListeners=function(){this.m&&this.f&&(this.f.on(this.m,_.Fc,this.T.bind(this)),this.f.on(this.m,_.Bc,this.P.bind(this)),this.f.on(this.m,_.xc,this.K.bind(this)),this.f.on(this.m,_.zc,this.L.bind(this)),this.f.on(this.m,_.mc,this.I.bind(this)),this.f.on(this.m,_.nc,this.o.bind(this,
15
+ 1)),this.f.on(this.m,_.wc,this.o.bind(this,2)),this.f.on(this.m,_.Dc,this.o.bind(this,3)),this.f.on(this.m,_.lc,this.H.bind(this)),this.f.on(this.m,_.Ac,this.M.bind(this)),this.f.on(this.m,_.re,this.J.bind(this)),this.f.on(this.m,_.ic,this.B.bind(this)),this.f.on(this.m,_.jc,this.D.bind(this)),this.f.on(this.m,_.kc,this.G.bind(this)),this.f.on(this.m,_.yc,this.w.bind(this)))};b.prototype.unregisterListeners=function(){_.Ai(this.f)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);
16
+ this.A=!0};b.prototype.T=function(c){this.g.debug(Tw,c);this.j=c.adsTimeline};b.prototype.P=function(c){this.a=c.ad;this.h("ad start",this.a);this.fireStart();this.fireJoin()};b.prototype.I=function(){this.h("ad ended");this.fireStop()};b.prototype.K=function(){this.h("ad pause");this.w();this.firePause()};b.prototype.L=function(){this.h("ad resume");this.w();this.fireResume()};b.prototype.G=function(){this.l=!0;this.h(Rw);this.fireBufferBegin()};b.prototype.w=function(){this.l&&(this.h(Qw),this.l=
17
+ !1,this.fireBufferEnd())};b.prototype.o=function(c){this.h("ad quartile",c);this.fireQuartile(c)};b.prototype.H=function(){this.h("ad clicked");var c=this.a&&this.a.Za();this.g.debug(Sw,c);this.fireClick(c)};b.prototype.M=function(){this.h("ad skipped");this.fireSkip()};b.prototype.B=function(c){this.a=c.ad;this.h(Pw,this.a);this.fireBreakStart()};b.prototype.D=function(){this.h("ad break stop");this.fireBreakStop();if(this.getPosition()===youbora.Constants.AdPosition.Postroll){var c=this.plugin.getAdapter();
18
+ c&&c.fireStop()}};b.prototype.J=function(c){(c=c.detail)&&10003===c.code&&ax(c,this.m.getConfiguration().youbora,this.g,this)};b.prototype.h=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.g.debug.apply(this.g,[Nw+c+Mw].concat(_.qh(e)))};return new b(a)},ex=function(){function a(){var b=NpawPluginAdapters.video.Shaka.call(this)||this;b.h=!1;b.f=!1;b.a=null;b.G=!1;return b}_.w(a,NpawPluginAdapters.video.Shaka);a.prototype.getPlayhead=function(){return this.getIsLive()?
19
+ -1:this.player.getPosition()};a.prototype.getDuration=function(){return this.player.getDuration()};a.prototype.getRendition=function(){var b=null,c=null,d=null,e=this.player.getTrackManager();e&&(e=e.sa())&&(b=e.width,c=e.height,d=e.bandwidth);b&&c&&d||(e=this.j(),b=b||e.width,c=c||e.height,d=d||e.streamBandwidth);return this.getNpawUtils().buildRenditionString(b,c,d)};a.prototype.getIsLive=function(){return this.player.isLive()};a.prototype.getResource=function(){var b=this.player.$a();return b&&
20
+ b.url};a.prototype.getBitrate=function(){return this.j().streamBandwidth};a.prototype.getThroughput=function(){return this.j().estimatedBandwidth};a.prototype.getPlayrate=function(){return this.player.Ec()};a.prototype.getFramesPerSecond=function(){var b=this.player.getTrackManager();return b&&(b=b.Qa())?b.frameRate:null};a.prototype.getPlayerName=function(){return _.ya};a.prototype.getVersion=function(){return"castlabs-adapter-6.32.0-js"};a.prototype.getPlayerVersion=function(){return _.ia};a.prototype.registerListeners=
21
+ function(){var b=this.w();this.player&&b&&(b.on(this.player,_.kg,this.M.bind(this)),b.on(this.player,_.re,this.J.bind(this)),b.on(this.player,_.cg,this.L.bind(this)),b.on(this.player,_.bg,this.K.bind(this)),b.on(this.player,_.Fc,this.H.bind(this)),b.on(this.player,_.jd,this.I.bind(this)),b.on(this.player,_.ad,this.P.bind(this)),b.on(this.player,_.wg,this.T.bind(this)))};a.prototype.unregisterListeners=function(){dx.debug(_.Qb);_.Ai(this.w())};a.prototype.dispose=function(){this.unregisterListeners();
22
+ this.G=!0;this.f=this.h=!1;this.a=null};a.prototype.j=function(){return this.player.getStats()||_.hu()};a.prototype.o=function(){return!!this.player.getConfiguration().autoplay};a.prototype.M=function(b){b=b.detail;this.l("state change",b);if(b)switch(b.currentState){case 1:this.plugin.setVideoOptions({"content.subtitles":this.D()});this.o()&&this.fireStart();break;case 3:this.fireStart();this.A();this.fireResume();this.fireBufferEnd();break;case 4:this.o()&&this.fireStart();this.A();this.fireBufferEnd();
23
+ this.firePause();break;case _.iu:this.fireBufferEnd();this.fireStop();break;case 5:this.fireBufferEnd();this.h&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case 2:this.fireBufferBegin();break;default:dx.debug(Ow,b)}};a.prototype.A=function(){this.fireJoin()};a.prototype.J=function(b){(b=b.detail)&&!this.f&&this.player&&10003!==b.code&&(b=ax(b,this.player.getConfiguration().npaw,dx,this))&&b.severity===_.P&&(this.f=!0)};a.prototype.L=function(){this.player.isEnded()||(this.l(_.cg),
24
+ this.fireSeekBegin())};a.prototype.B=function(b){var c=this.player.getTrackManager();if(!c)return null;var d=null;b===_.tg&&(d=c.wa());b===_.Tc&&(d=c.qa());return d?d.language:null};a.prototype.P=function(){var b=this.B(_.Tc);this.plugin.setVideoOptions({"content.language":b})};a.prototype.T=function(){var b=this.B(_.tg),c=this.D();this.plugin.setVideoOptions({"content.subtitles":b||c})};a.prototype.w=function(){this.a||(this.a=new _.xi);return this.a};a.prototype.K=function(){this.l(_.bg);this.fireSeekEnd()};
25
+ a.prototype.H=function(b){dx.debug("adsTimeline",b);this.h=(b=b.adsTimeline)&&b.$b()};a.prototype.I=function(b){dx.debug("Casting",b);this.fireCasted()};a.prototype.l=function(b,c){for(var d=[],e=1;e<arguments.length;++e)d[e-1]=arguments[e];dx.debug.apply(dx,[Nw+b+Lw].concat(_.qh(d)))};a.prototype.D=function(){var b=this.player.getConfiguration();return b.npaw&&b.npaw.disabledSubtitlesLabel?b.npaw.disabledSubtitlesLabel:"off"};return a},gx=function(){function a(){var b=NpawPluginAdapters.ads.Ima.call(this)||
26
+ this;b.a=null;b.l=null;b.h=null;b.j=null;b.D=!1;b.o=!1;return b}_.w(a,NpawPluginAdapters.ads.Ima);a.prototype.getDuration=function(){return this.a?this.a.getDuration():null};a.prototype.getRendition=function(){var b=null;this.a&&(b=this.getNpawUtils().buildRenditionString(this.a.eb(),this.a.cb(),this.a.Ga()));return b};a.prototype.getBitrate=function(){var b=null;this.a&&(b=this.a.Ga());return b};a.prototype.getPlayhead=function(){var b=null,c=this.player.getAdsManager();c&&(b=c.getPosition());return b};
27
27
  a.prototype.getResource=function(){var b=null;this.a&&(b=this.a.getMediaUrl());return b};a.prototype.getTitle=function(){var b=null;this.a&&(b=this.a.getTitle());return b};a.prototype.getProvider=function(){var b=null;this.a&&(b=this.a.getAdvertiserName());return b};a.prototype.getCreativeId=function(){var b=null;this.a&&(b=this.a.getCreativeId());return b};a.prototype.dispose=function(){this.unregisterListeners();this.D=!0;this.j=this.h=this.a=null};a.prototype.getPosition=function(){var b=this.getNpawReference().Constants.AdPosition,
28
- c=null;if(this.a)switch(this.a.Ha()){case 0:c=b.Preroll;break;case 2:c=b.Postroll;break;case 1:c=b.Midroll}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.getAdVolume()};a.prototype.getExpectedBreaks=function(){return this.h&&this.h.getCuePoints().length};a.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};a.prototype.getExpectedAds=
29
- function(){return this.a&&this.a.gb()};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(bx,b);return b};a.prototype.getPlayerName=
30
- function(){return _.ya};a.prototype.getVersion=function(){return"castlabs-ads-adapter-6.32.0-beta.3-js"};a.prototype.getPlayerVersion=function(){return _.ia};a.prototype.B=function(){this.j||(this.j=new _.Bi);return this.j};a.prototype.registerListeners=function(){var b=this.B();this.player&&b&&(b.on(this.player,_.Fc,this.X.bind(this)),b.on(this.player,_.Bc,this.W.bind(this)),b.on(this.player,_.xc,this.M.bind(this)),b.on(this.player,_.zc,this.P.bind(this)),b.on(this.player,_.mc,this.K.bind(this)),
31
- b.on(this.player,_.nc,this.w.bind(this,1)),b.on(this.player,_.vc,this.w.bind(this,2)),b.on(this.player,_.Dc,this.w.bind(this,3)),b.on(this.player,_.lc,this.J.bind(this)),b.on(this.player,_.Ac,this.T.bind(this)),b.on(this.player,_.qe,this.L.bind(this)),b.on(this.player,_.ic,this.G.bind(this)),b.on(this.player,_.jc,this.H.bind(this)),b.on(this.player,_.kc,this.I.bind(this)),b.on(this.player,_.yc,this.ba.bind(this)))};a.prototype.unregisterListeners=function(){_.Ei(this.B())};a.prototype.X=function(b){jx.debug(Xw,
32
- b);this.h=b.adsTimeline};a.prototype.W=function(b){this.a=b.ad;this.f("ad start",this.a);this.fireStart();this.fireJoin()};a.prototype.K=function(){this.f("ad ended");this.fireStop({adPlayhead:this.l})};a.prototype.M=function(){this.f("ad pause");this.A();this.firePause()};a.prototype.P=function(){this.f("ad resume");this.A();this.fireResume()};a.prototype.I=function(){this.o=!0;this.f(Vw);this.fireBufferBegin()};a.prototype.ba=function(){this.l=this.getPlayhead();this.A()};a.prototype.A=function(){this.o&&
33
- (this.f(Uw),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.$a();jx.debug(Ww,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(Tw,this.a);this.fireBreakStart()};a.prototype.H=function(){this.f("ad break stop");this.fireBreakStop({adPlayhead:this.l});this.getPosition()===this.getNpawReference().Constants.AdPosition.Postroll&&
34
- this.fireStop({adPlayhead:this.l})};a.prototype.L=function(b){(b=b.detail)&&10003===b.code&&ex(b,this.player.getConfiguration().npaw,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,[Rw+b+Pw].concat(_.uh(d)))};return a},lx=function(){this.a=null;this.g=new _.M(Yw);this.m=null},mx=function(a,b){if(b.namespace()===_.xd)return a.g.info("NPAW does not report when casting."),!1;var c=b.getConfiguration().npaw;return _.N.Qg(c)?c.accountCode?
35
- _.N.R(window.NpawPlugin)||_.N.R(window.NpawPluginAdapters)?(a.g.warn("NPAW SDK not found."),b.onError(new _.O(1,9,9100)),!1):!0:(a.g.warn("accountCode key is missing in NPAW config"),b.onError(new _.O(1,9,9101)),!1):(a.g.warn("NPAW plugin is loaded but not configured. Will do nothing."),!1)},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 _.M(Zw);this.m=null},px=function(a,b){if(b.namespace()===_.xd)return a.g.info("Youbora does not report when casting."),
36
- !1;var c=b.getConfiguration().youbora;if(!_.N.Qg(c))return a.g.debug("Youbora plugin is loaded but not configured. Will do nothing."),!1;if(!c.accountCode)return a.g.warn("accountCode key is missing in Youbora config"),b.onError(new _.O(1,9,9101)),!1;if(_.N.R(window.youbora))return a.g.warn("Youbora SDK not found."),b.onError(new _.O(1,9,9100)),!1;"6.8.59"!==youbora.VERSION&&(a.g.warn("Youbora SDK version is not supported. The supported version is 6.8.59, found version "+(youbora.VERSION+". Some or all features of YouboraPlugin may not work correctly.")),
37
- b.onError(new _.O(1,9,9102)));return!0},qx=function(){};var hx=new _.M("clpp.npaw.NpawAdapter");var jx=new _.M("clpp.npaw.NpawAdsAdapter");_.w(lx,_.gw);_.r=lx.prototype;_.r.sh=function(a){nx(this);if(this.a=a)this.a.registerAdapterFromClass(this.m,ix()),this.a.registerAdsAdapterFromClass(this.m,kx())};_.r.Gm=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().npaw,this.sh(new NpawPlugin(a.accountCode)))};
38
- _.r.onContentWillLoad=function(a,b){if(mx(this,a)){var c=a.getConfiguration(),d=c.npaw;void 0===d[$w]&&(d[$w]=b.isLive);void 0===d[ax]&&(d[ax]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.sh(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(_.bf,b);this.a.setAnalyticsOptions(b)};_.r.onPlayerWillRelease=function(){};
39
- _.r.onPlayerWillDestroy=function(){nx(this);this.a&&this.a.destroy()};_.r.id=function(){return"npaw"};_.K(Yw,lx);lx.prototype.getAdsAdapter=lx.prototype.getAdsAdapter;lx.prototype.getAdapter=lx.prototype.getAdapter;lx.prototype.getNpawPlugin=lx.prototype.Gm;lx.prototype.setNpawPlugin=lx.prototype.sh;lx.Id="npaw";new _.M(Yw);_.w(ox,_.gw);_.r=ox.prototype;_.r.th=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.th(new youbora.Plugin(a)))};
40
- _.r.onContentWillLoad=function(a,b){if(px(this,a)){var c=a.getConfiguration(),d=c.youbora;void 0===d[$w]&&(d[$w]=b.isLive);void 0===d[ax]&&(d[ax]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.th(new youbora.Plugin(d));this.a.setOptions(d)}};_.r.onPlayerWillRelease=function(){};_.r.onPlayerWillDestroy=function(){};_.r.id=function(){return"youbora"};_.K(Zw,ox);ox.prototype.getAdsAdapter=ox.prototype.getAdsAdapter;ox.prototype.getAdapter=ox.prototype.getAdapter;
41
- ox.prototype.setYouboraPlugin=ox.prototype.th;ox.Id="youbora";qx.prototype.create=function(a){return a.npaw?new lx:a.youbora?new ox:null};_.fp(new qx);};
28
+ c=null;if(this.a)switch(this.a.Ha()){case 0:c=b.Preroll;break;case 2:c=b.Postroll;break;case 1:c=b.Midroll}fx.debug("Ad position",c);return c};a.prototype.getIsSkippable=function(){return this.a&&-1!==this.a.getSkipTimeOffset()};a.prototype.getAudioEnabled=function(){var b=this.player.getAdsManager();return b&&0<b.getAdVolume()};a.prototype.getExpectedBreaks=function(){return this.h&&this.h.getCuePoints().length};a.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};a.prototype.getExpectedAds=
29
+ function(){return this.a&&this.a.fb()};a.prototype.getGivenAds=function(){return this.getExpectedAds()};a.prototype.getBreaksTime=function(){var b=this;return this.h&&this.h.getCuePoints().map(function(c){return-1===c?b.player.getDuration():c})};a.prototype.getIsFullscreen=function(){return this.player.getSurface().isFullscreen()};a.prototype.getIsVisible=function(){var b=this.player.getSurface().getContainer();b=this.getNpawUtils().calculateAdViewability(b);fx.debug(Yw,b);return b};a.prototype.getPlayerName=
30
+ function(){return _.ya};a.prototype.getVersion=function(){return"castlabs-ads-adapter-6.32.0-js"};a.prototype.getPlayerVersion=function(){return _.ia};a.prototype.B=function(){this.j||(this.j=new _.xi);return this.j};a.prototype.registerListeners=function(){var b=this.B();this.player&&b&&(b.on(this.player,_.Fc,this.X.bind(this)),b.on(this.player,_.Bc,this.W.bind(this)),b.on(this.player,_.xc,this.M.bind(this)),b.on(this.player,_.zc,this.P.bind(this)),b.on(this.player,_.mc,this.K.bind(this)),b.on(this.player,
31
+ _.nc,this.w.bind(this,1)),b.on(this.player,_.wc,this.w.bind(this,2)),b.on(this.player,_.Dc,this.w.bind(this,3)),b.on(this.player,_.lc,this.J.bind(this)),b.on(this.player,_.Ac,this.T.bind(this)),b.on(this.player,_.re,this.L.bind(this)),b.on(this.player,_.ic,this.G.bind(this)),b.on(this.player,_.jc,this.H.bind(this)),b.on(this.player,_.kc,this.I.bind(this)),b.on(this.player,_.yc,this.ba.bind(this)))};a.prototype.unregisterListeners=function(){_.Ai(this.B())};a.prototype.X=function(b){fx.debug(Tw,b);
32
+ this.h=b.adsTimeline};a.prototype.W=function(b){this.a=b.ad;this.f("ad start",this.a);this.fireStart();this.fireJoin()};a.prototype.K=function(){this.f("ad ended");this.fireStop({adPlayhead:this.l})};a.prototype.M=function(){this.f("ad pause");this.A();this.firePause()};a.prototype.P=function(){this.f("ad resume");this.A();this.fireResume()};a.prototype.I=function(){this.o=!0;this.f(Rw);this.fireBufferBegin()};a.prototype.ba=function(){this.l=this.getPlayhead();this.A()};a.prototype.A=function(){this.o&&
33
+ (this.f(Qw),this.o=!1,this.fireBufferEnd())};a.prototype.w=function(b){this.f("ad quartile",b);this.fireQuartile(b)};a.prototype.J=function(){this.f("ad clicked");var b=this.a&&this.a.Za();fx.debug(Sw,b);this.fireClick(b)};a.prototype.T=function(){this.f("ad skipped");this.fireSkip()};a.prototype.G=function(b){this.a=b.ad;this.f(Pw,this.a);this.fireBreakStart()};a.prototype.H=function(){this.f("ad break stop");this.fireBreakStop({adPlayhead:this.l});this.getPosition()===this.getNpawReference().Constants.AdPosition.Postroll&&
34
+ this.fireStop({adPlayhead:this.l})};a.prototype.L=function(b){(b=b.detail)&&10003===b.code&&ax(b,this.player.getConfiguration().npaw,fx,this)};a.prototype.f=function(b,c){for(var d=[],e=1;e<arguments.length;++e)d[e-1]=arguments[e];fx.debug.apply(fx,[Nw+b+Lw].concat(_.qh(d)))};return a},hx=function(){this.a=null;this.g=new _.M(Uw);this.m=null},ix=function(a,b){if(b.namespace()===_.yd)return a.g.info("NPAW does not report when casting."),!1;var c=b.getConfiguration().npaw;return _.N.Ng(c)?c.accountCode?
35
+ _.N.R(window.NpawPlugin)||_.N.R(window.NpawPluginAdapters)?(a.g.warn("NPAW SDK not found."),b.onError(new _.O(1,9,9100)),!1):!0:(a.g.warn("accountCode key is missing in NPAW config"),b.onError(new _.O(1,9,9101)),!1):(a.g.warn("NPAW plugin is loaded but not configured. Will do nothing."),!1)},jx=function(a){a.a&&(a.g.info("Removing NPAW Plugins",a.a),a.a.removeAdsAdapter(),a.a.removeAdapter())},kx=function(){this.a=null;this.g=new _.M(Vw);this.m=null},lx=function(a,b){if(b.namespace()===_.yd)return a.g.info("Youbora does not report when casting."),
36
+ !1;var c=b.getConfiguration().youbora;if(!_.N.Ng(c))return a.g.debug("Youbora plugin is loaded but not configured. Will do nothing."),!1;if(!c.accountCode)return a.g.warn("accountCode key is missing in Youbora config"),b.onError(new _.O(1,9,9101)),!1;if(_.N.R(window.youbora))return a.g.warn("Youbora SDK not found."),b.onError(new _.O(1,9,9100)),!1;"6.8.59"!==youbora.VERSION&&(a.g.warn("Youbora SDK version is not supported. The supported version is 6.8.59, found version "+(youbora.VERSION+". Some or all features of YouboraPlugin may not work correctly.")),
37
+ b.onError(new _.O(1,9,9102)));return!0},mx=function(){};var dx=new _.M("clpp.npaw.NpawAdapter");var fx=new _.M("clpp.npaw.NpawAdsAdapter");_.w(hx,_.cw);_.r=hx.prototype;_.r.oh=function(a){jx(this);if(this.a=a)this.a.registerAdapterFromClass(this.m,ex()),this.a.registerAdsAdapterFromClass(this.m,gx())};_.r.Cm=function(){return this.a};_.r.getAdapter=function(){return this.a&&this.a.getAdapter()};_.r.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.r.onPlayerCreated=function(a){this.m=a;ix(this,a)&&(a=a.getConfiguration().npaw,this.oh(new NpawPlugin(a.accountCode)))};
38
+ _.r.onContentWillLoad=function(a,b){if(ix(this,a)){var c=a.getConfiguration(),d=c.npaw;void 0===d[Ww]&&(d[Ww]=b.isLive);void 0===d[Xw]&&(d[Xw]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.oh(new NpawPlugin(d.accountCode));this.a.setAnalyticsOptions(d)}};_.r.onContentLoaded=function(a){var b={};(a=a.getDrmInfo())&&(a=Zw(a.keySystem))&&(b["content.drm"]=a);this.g.info(_.bf,b);this.a.setAnalyticsOptions(b)};_.r.onPlayerWillRelease=function(){};
39
+ _.r.onPlayerWillDestroy=function(){jx(this);this.a&&this.a.destroy()};_.r.id=function(){return"npaw"};_.J(Uw,hx);hx.prototype.getAdsAdapter=hx.prototype.getAdsAdapter;hx.prototype.getAdapter=hx.prototype.getAdapter;hx.prototype.getNpawPlugin=hx.prototype.Cm;hx.prototype.setNpawPlugin=hx.prototype.oh;hx.Id="npaw";new _.M(Uw);_.w(kx,_.cw);_.r=kx.prototype;_.r.ph=function(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(bx(this.m)),this.a.setAdsAdapter(cx(this.m))};_.r.getAdapter=function(){return this.a&&this.a.getAdapter()};_.r.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.r.onPlayerCreated=function(a){this.m=a;lx(this,a)&&(a=a.getConfiguration().youbora,this.ph(new youbora.Plugin(a)))};
40
+ _.r.onContentWillLoad=function(a,b){if(lx(this,a)){var c=a.getConfiguration(),d=c.youbora;void 0===d[Ww]&&(d[Ww]=b.isLive);void 0===d[Xw]&&(d[Xw]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.ph(new youbora.Plugin(d));this.a.setOptions(d)}};_.r.onPlayerWillRelease=function(){};_.r.onPlayerWillDestroy=function(){};_.r.id=function(){return"youbora"};_.J(Vw,kx);kx.prototype.getAdsAdapter=kx.prototype.getAdsAdapter;kx.prototype.getAdapter=kx.prototype.getAdapter;
41
+ kx.prototype.setYouboraPlugin=kx.prototype.ph;kx.Id="youbora";mx.prototype.create=function(a){return a.npaw?new hx:a.youbora?new kx:null};_.bp(new mx);};
42
42
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
43
43
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
44
44
  else{_=this.clpp._;(f.call(g,this));}
@@ -58,5 +58,5 @@ return"test"===t.get(e)&&!1===t["delete"](0)}return!1}catch(a){return!1}})()
58
58
  )) {!function(e){var t=Symbol("undef"),r=function a(){if(!(this instanceof a))throw new TypeError('Constructor WeakMap requires "new"');var e=OrdinaryCreateFromConstructor(this,a.prototype,{_keys:[],_values:[],_es6WeakMap:!0}),t=arguments.length>0?arguments[0]:undefined;if(null===t||t===undefined)return e;var r=Get(e,"set");if(!IsCallable(r))throw new TypeError("WeakMap.prototype.set is not a function");try{for(var o=GetIterator(t);;){var p=IteratorStep(o);if(!1===p)return e;var n=IteratorValue(p);if("object"!==Type(n))try{throw new TypeError("Iterator value "+n+" is not an entry object")}catch(s){return IteratorClose(o,s)}try{var i=Get(n,"0"),l=Get(n,"1");Call(r,e,[i,l])}catch(u){return IteratorClose(o,u)}}}catch(u){if(Array.isArray(t)||"[object Arguments]"===Object.prototype.toString.call(t)||t.callee){var y,c=t.length;for(y=0;y<c;y++)i=t[y][0],l=t[y][1],Call(r,e,[i,l])}}return e};Object.defineProperty(r,"prototype",{configurable:!1,enumerable:!1,writable:!1,value:{}}),CreateMethodProperty(r.prototype,"constructor",r),CreateMethodProperty(r.prototype,"delete",function(e){var r=this;if("object"!==Type(r))throw new TypeError("Method WeakMap.prototype.clear called on incompatible receiver "+Object.prototype.toString.call(r));if(!0!==r._es6WeakMap)throw new TypeError("Method WeakMap.prototype.clear called on incompatible receiver "+Object.prototype.toString.call(r));var o=r._keys;if("object"!==Type(e))return!1;for(var a=0;a<o.length;a++)if(r._keys[a]!==t&&SameValue(r._keys[a],e))return this._keys[a]=t,this._values[a]=t,this._size=--this._size,!0;return!1}),CreateMethodProperty(r.prototype,"get",function p(e){var r=this;if("object"!==Type(r))throw new TypeError("Method WeakMap.prototype.get called on incompatible receiver "+Object.prototype.toString.call(r));if(!0!==r._es6WeakMap)throw new TypeError("Method WeakMap.prototype.get called on incompatible receiver "+Object.prototype.toString.call(r));var o=r._keys;if("object"!==Type(e))return undefined;for(var a=0;a<o.length;a++)if(r._keys[a]!==t&&SameValue(r._keys[a],e))return r._values[a];return undefined}),CreateMethodProperty(r.prototype,"has",function n(e){var r=this;if("object"!=typeof r)throw new TypeError("Method WeakMap.prototype.has called on incompatible receiver "+Object.prototype.toString.call(r));if(!0!==r._es6WeakMap)throw new TypeError("Method WeakMap.prototype.has called on incompatible receiver "+Object.prototype.toString.call(r));var o=r._keys;if("object"!==Type(e))return!1;for(var a=0;a<o.length;a++)if(r._keys[a]!==t&&SameValue(r._keys[a],e))return!0;return!1}),CreateMethodProperty(r.prototype,"set",function i(e,r){var o=this;if("object"!==Type(o))throw new TypeError("Method WeakMap.prototype.set called on incompatible receiver "+Object.prototype.toString.call(o));if(!0!==o._es6WeakMap)throw new TypeError("Method WeakMap.prototype.set called on incompatible receiver "+Object.prototype.toString.call(o));var a=o._keys;if("object"!==Type(e))throw new TypeError("Invalid value used as weak map key");for(var p=0;p<a.length;p++)if(o._keys[p]!==t&&SameValue(o._keys[p],e))return o._values[p]=r,o;var n={"[[Key]]":e,"[[Value]]":r};return o._keys.push(n["[[Key]]"]),o._values.push(n["[[Value]]"]),o}),Object.defineProperty(r.prototype,Symbol.toStringTag,{configurable:!0,enumerable:!1,writable:!1,value:"WeakMap"}),"name"in r||Object.defineProperty(r,"name",{configurable:!0,enumerable:!1,writable:!1,value:"WeakMap"});try{CreateMethodProperty(e,"WeakMap",r)}catch(o){e.WeakMap=r}}(self);}function EnumerableOwnProperties(e,r){for(var t=Object.keys(e),n=[],s=t.length,a=0;a<s;a++){var i=t[a];if("string"===Type(i)){var u=Object.getOwnPropertyDescriptor(e,i);if(u&&u.enumerable)if("key"===r)n.push(i);else{var p=Get(e,i);if("value"===r)n.push(p);else{var f=[i,p];n.push(f)}}}}return n}if (!("entries"in Object
59
59
  )) {!function(){var e={}.toString,t="".split;CreateMethodProperty(Object,"entries",function r(n){var i=ToObject(n);return i=("string"===Type(i)||i instanceof String)&&"[object String]"==e.call(n)?t.call(n,""):Object(n),EnumerableOwnProperties(i,"key+value")})}();}if (!("devicePixelRatio"in self
60
60
  )) {self.devicePixelRatio=1;}if (!("requestAnimationFrame"in self
61
- )) {!function(n){var e,t=Date.now(),o=function(){return n.performance&&"function"==typeof n.performance.now?n.performance.now():Date.now()-t};if("mozRequestAnimationFrame"in n?e="moz":"webkitRequestAnimationFrame"in n&&(e="webkit"),e)n.requestAnimationFrame=function(t){return n[e+"RequestAnimationFrame"](function(){t(o())})},n.cancelAnimationFrame=n[e+"CancelAnimationFrame"];else{var i=Date.now();n.requestAnimationFrame=function(n){if("function"!=typeof n)throw new TypeError(n+" is not a function");var e=Date.now(),t=16+i-e;return t<0&&(t=0),i=e,setTimeout(function(){i=Date.now(),n(o())},t)},n.cancelAnimationFrame=function(n){clearTimeout(n)}}}(self);}if (!("ResizeObserver"in self
62
- )) {!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):(e="undefined"!=typeof globalThis?globalThis:e||self,t(e.ResizeObserver={}))}(this,function(e){"use strict";var t,n=[],r=function(){return n.some(function(e){return e.activeTargets.length>0})},i=function(){return n.some(function(e){return e.skippedTargets.length>0})},o="ResizeObserver loop completed with undelivered notifications.",s=function(){var e;"function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:o}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=o),window.dispatchEvent(e)};!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(t||(t={}));var c,a=function(e){return Object.freeze(e)},u=function(){function e(e,t){this.inlineSize=e,this.blockSize=t,a(this)}return e}(),f=function(){function e(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,a(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),h=function(e){return e instanceof SVGElement&&"getBBox"in e},d=function(e){if(h(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var i=e,o=i.offsetWidth,s=i.offsetHeight;return!(o||s||e.getClientRects().length)},v=function(e){var t,n;if(e instanceof Element)return!0;var r=null===(n=null===(t=e)||void 0===t?void 0:t.ownerDocument)||void 0===n?void 0:n.defaultView;return!!(r&&e instanceof r.Element)},l=function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},p="undefined"!=typeof window?window:{},b=new WeakMap,g=/auto|scroll/,w=/^tb|vertical/,E=/msie|trident/i.test(p.navigator&&p.navigator.userAgent),x=function(e){return parseFloat(e||"0")},y=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=!1),new u((n?t:e)||0,(n?e:t)||0)},z=a({devicePixelContentBoxSize:y(),borderBoxSize:y(),contentBoxSize:y(),contentRect:new f(0,0,0,0)}),T=function(e,t){if(void 0===t&&(t=!1),b.has(e)&&!t)return b.get(e);if(d(e))return b.set(e,z),z;var n=getComputedStyle(e),r=h(e)&&e.ownerSVGElement&&e.getBBox(),i=!E&&"border-box"===n.boxSizing,o=w.test(n.writingMode||""),s=!r&&g.test(n.overflowY||""),c=!r&&g.test(n.overflowX||""),u=r?0:x(n.paddingTop),v=r?0:x(n.paddingRight),l=r?0:x(n.paddingBottom),p=r?0:x(n.paddingLeft),T=r?0:x(n.borderTopWidth),m=r?0:x(n.borderRightWidth),O=r?0:x(n.borderBottomWidth),R=r?0:x(n.borderLeftWidth),S=p+v,B=u+l,C=R+m,k=T+O,N=c?e.offsetHeight-k-e.clientHeight:0,D=s?e.offsetWidth-C-e.clientWidth:0,M=i?S+C:0,_=i?B+k:0,I=r?r.width:x(n.width)-M-D,P=r?r.height:x(n.height)-_-N,F=I+S+D+C,L=P+B+N+k,W=a({devicePixelContentBoxSize:y(Math.round(I*devicePixelRatio),Math.round(P*devicePixelRatio),o),borderBoxSize:y(F,L,o),contentBoxSize:y(I,P,o),contentRect:new f(p,u,I,P)});return b.set(e,W),W},m=function(e,n,r){var i=T(e,r),o=i.borderBoxSize,s=i.contentBoxSize,c=i.devicePixelContentBoxSize;switch(n){case t.DEVICE_PIXEL_CONTENT_BOX:return c;case t.BORDER_BOX:return o;default:return s}},O=function(){function e(e){var t=T(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=a([t.borderBoxSize]),this.contentBoxSize=a([t.contentBoxSize]),this.devicePixelContentBoxSize=a([t.devicePixelContentBoxSize])}return e}(),R=function(e){if(d(e))return Infinity;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},S=function(){var e=Infinity,t=[];n.forEach(function o(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach(function i(t){var n=new O(t.target),i=R(t.target);r.push(n),t.lastReportedSize=m(t.target,t.observedBox),i<e&&(e=i)}),t.push(function o(){n.callback.call(n.observer,r,n.observer)}),n.activeTargets.splice(0,n.activeTargets.length)}});for(var r=0,i=t;r<i.length;r++){(0,i[r])()}return e},B=function(e){n.forEach(function t(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function r(t){t.isActive()&&(R(t.target)>e?n.activeTargets.push(t):n.skippedTargets.push(t))})})},C=function(){var e=0;for(B(e);r();)e=S(),B(e);return i()&&s(),e>0},k=[],N=function(){return k.splice(0).forEach(function(e){return e()})},D=function(e){if(!c){var t=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return N()}).observe(n,r),c=function(){n.textContent=""+(t?t--:t++)}}k.push(e),c()},M=function(e){D(function t(){requestAnimationFrame(e)})},_=0,I=function(){return!!_},P={attributes:!0,characterData:!0,childList:!0,subtree:!0},F=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],L=function(e){return void 0===e&&(e=0),Date.now()+e},W=!1,X=function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!W){W=!0;var n=L(e);M(function(){var r=!1;try{r=C()}finally{if(W=!1,e=n-L(),!I())return;r?t.run(1e3):e>0?t.run(e):t.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,P)};document.body?t():p.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),F.forEach(function(t){return p.addEventListener(t,e.listener,!0)}))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),F.forEach(function(t){return p.removeEventListener(t,e.listener,!0)}),this.stopped=!0)},e}(),A=new X,V=function(e){!_&&e>0&&A.start(),!(_+=e)&&A.stop()},q=function(e){return!h(e)&&!l(e)&&"inline"===getComputedStyle(e).display},j=function(){function e(e,n){this.target=e,this.observedBox=n||t.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e=m(this.target,this.observedBox,!0);return q(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},e}(),G=function(){function e(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t}return e}(),H=new WeakMap,J=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},U=function(){function e(){}return e.connect=function(e,t){var n=new G(e,t);H.set(e,n)},e.observe=function(e,t,r){var i=H.get(e),o=0===i.observationTargets.length;J(i.observationTargets,t)<0&&(o&&n.push(i),i.observationTargets.push(new j(t,r&&r.box)),V(1),A.schedule())},e.unobserve=function(e,t){var r=H.get(e),i=J(r.observationTargets,t),o=1===r.observationTargets.length;i>=0&&(o&&n.splice(n.indexOf(r),1),r.observationTargets.splice(i,1),V(-1))},e.disconnect=function(e){var t=this,n=H.get(e);n.observationTargets.slice().forEach(function(n){return t.unobserve(e,n.target)}),n.activeTargets.splice(0,n.activeTargets.length)},e}(),Y=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");U.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!v(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");U.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!v(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");U.unobserve(this,e)},e.prototype.disconnect=function(){U.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();e.ResizeObserver=Y,e.ResizeObserverEntry=O,e.ResizeObserverSize=u,Object.defineProperty(e,"__esModule",{value:!0})}),self.ResizeObserverEntry=ResizeObserver.ResizeObserverEntry,self.ResizeObserver=ResizeObserver.ResizeObserver;}})('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
61
+ )) {!function(n){var e,t=Date.now(),o=function(){return n.performance&&"function"==typeof n.performance.now?n.performance.now():Date.now()-t};if("mozRequestAnimationFrame"in n?e="moz":"webkitRequestAnimationFrame"in n&&(e="webkit"),e)n.requestAnimationFrame=function(t){return n[e+"RequestAnimationFrame"](function(){t(o())})},n.cancelAnimationFrame=n[e+"CancelAnimationFrame"];else{var i=Date.now();n.requestAnimationFrame=function(n){if("function"!=typeof n)throw new TypeError(n+" is not a function");var e=Date.now(),t=16+i-e;return t<0&&(t=0),i=e,setTimeout(function(){i=Date.now(),n(o())},t)},n.cancelAnimationFrame=function(n){clearTimeout(n)}}}(self);}})('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
62
+ "ResizeObserver"in window||function(){"use strict";var e,t=[],n="ResizeObserver loop completed with undelivered notifications.";!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(e||(e={}));var r,i=function(e){return Object.freeze(e)},o=function(){return function(e,t){this.inlineSize=e,this.blockSize=t,i(this)}}(),s=function(){function e(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,i(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),a=function(e){return e instanceof SVGElement&&"getBBox"in e},c=function(e){if(a(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var i=e,o=i.offsetWidth,s=i.offsetHeight;return!(o||s||e.getClientRects().length)},u=function(e){var t,n,r=null===(n=null===(t=e)||void 0===t?void 0:t.ownerDocument)||void 0===n?void 0:n.defaultView;return!!(r&&e instanceof r.Element)},h="undefined"!=typeof window?window:{},d=new WeakMap,f=/auto|scroll/,v=/^tb|vertical/,l=/msie|trident/i.test(h.navigator&&h.navigator.userAgent),p=function(e){return parseFloat(e||"0")},g=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=!1),new o((n?t:e)||0,(n?e:t)||0)},b=i({devicePixelContentBoxSize:g(),borderBoxSize:g(),contentBoxSize:g(),contentRect:new s(0,0,0,0)}),w=function(e,t){if(void 0===t&&(t=!1),d.has(e)&&!t)return d.get(e);if(c(e))return d.set(e,b),b;var n=getComputedStyle(e),r=a(e)&&e.ownerSVGElement&&e.getBBox(),o=!l&&"border-box"===n.boxSizing,u=v.test(n.writingMode||""),h=!r&&f.test(n.overflowY||""),w=!r&&f.test(n.overflowX||""),E=r?0:p(n.paddingTop),x=r?0:p(n.paddingRight),T=r?0:p(n.paddingBottom),z=r?0:p(n.paddingLeft),m=r?0:p(n.borderTopWidth),y=r?0:p(n.borderRightWidth),S=r?0:p(n.borderBottomWidth),B=z+x,O=E+T,R=(r?0:p(n.borderLeftWidth))+y,C=m+S,k=w?e.offsetHeight-C-e.clientHeight:0,N=h?e.offsetWidth-R-e.clientWidth:0,D=o?B+R:0,M=o?O+C:0,P=r?r.width:p(n.width)-D-N,_=r?r.height:p(n.height)-M-k,F=P+B+N+R,I=_+O+k+C,L=i({devicePixelContentBoxSize:g(Math.round(P*devicePixelRatio),Math.round(_*devicePixelRatio),u),borderBoxSize:g(F,I,u),contentBoxSize:g(P,_,u),contentRect:new s(z,E,P,_)});return d.set(e,L),L},E=function(t,n,r){var i=w(t,r),o=i.borderBoxSize,s=i.contentBoxSize,a=i.devicePixelContentBoxSize;switch(n){case e.DEVICE_PIXEL_CONTENT_BOX:return a;case e.BORDER_BOX:return o;default:return s}},x=function(){return function(e){var t=w(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=i([t.borderBoxSize]),this.contentBoxSize=i([t.contentBoxSize]),this.devicePixelContentBoxSize=i([t.devicePixelContentBoxSize])}}(),T=function(e){if(c(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},z=function(){var e=1/0,n=[];t.forEach(function(t){if(0!==t.activeTargets.length){var r=[];t.activeTargets.forEach(function(t){var n=new x(t.target),i=T(t.target);r.push(n),t.lastReportedSize=E(t.target,t.observedBox),i<e&&(e=i)}),n.push(function(){t.callback.call(t.observer,r,t.observer)}),t.activeTargets.splice(0,t.activeTargets.length)}});for(var r=0,i=n;r<i.length;r++){(0,i[r])()}return e},m=function(e){t.forEach(function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach(function(n){n.isActive()&&(T(n.target)>e?t.activeTargets.push(n):t.skippedTargets.push(n))})})},y=function(){var e,r=0;for(m(r);t.some(function(e){return e.activeTargets.length>0});)r=z(),m(r);return t.some(function(e){return e.skippedTargets.length>0})&&("function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:n}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=n),window.dispatchEvent(e)),r>0},S=[],B=function(e){if(!r){var t=0,n=document.createTextNode("");new MutationObserver(function(){return S.splice(0).forEach(function(e){return e()})}).observe(n,{characterData:!0}),r=function(){n.textContent=""+(t?t--:t++)}}S.push(e),r()},O=0,R={attributes:!0,characterData:!0,childList:!0,subtree:!0},C=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],k=function(e){return void 0===e&&(e=0),Date.now()+e},N=!1,D=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!N){N=!0;var n,r=k(e);n=function(){var n=!1;try{n=y()}finally{if(N=!1,e=r-k(),!O)return;n?t.run(1e3):e>0?t.run(e):t.start()}},B(function(){requestAnimationFrame(n)})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,R)};document.body?t():h.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),C.forEach(function(t){return h.addEventListener(t,e.listener,!0)}))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),C.forEach(function(t){return h.removeEventListener(t,e.listener,!0)}),this.stopped=!0)},e}()),M=function(e){!O&&e>0&&D.start(),!(O+=e)&&D.stop()},P=function(){function t(t,n){this.target=t,this.observedBox=n||e.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e,t=E(this.target,this.observedBox,!0);return e=this.target,a(e)||function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)||"inline"!==getComputedStyle(e).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},t}(),_=function(){return function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t}}(),F=new WeakMap,I=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},L=function(){function e(){}return e.connect=function(e,t){var n=new _(e,t);F.set(e,n)},e.observe=function(e,n,r){var i=F.get(e),o=0===i.observationTargets.length;I(i.observationTargets,n)<0&&(o&&t.push(i),i.observationTargets.push(new P(n,r&&r.box)),M(1),D.schedule())},e.unobserve=function(e,n){var r=F.get(e),i=I(r.observationTargets,n),o=1===r.observationTargets.length;i>=0&&(o&&t.splice(t.indexOf(r),1),r.observationTargets.splice(i,1),M(-1))},e.disconnect=function(e){var t=this,n=F.get(e);n.observationTargets.slice().forEach(function(n){return t.unobserve(e,n.target)}),n.activeTargets.splice(0,n.activeTargets.length)},e}(),W=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");L.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!u(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");L.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!u(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");L.unobserve(this,e)},e.prototype.disconnect=function(){L.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();window.ResizeObserver=W,window.ResizeObserverEntry=x,window.ResizeObserverSize=o}();
package/cl.adobe.js CHANGED
@@ -1,3 +1,3 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var kX=function(a){a.f=new _.Vt;a.f.on(a.m,_.ug,()=>iX(a));a.f.on(a.m,_.qg,()=>{s.Media.play(a.a,a.m.getPosition())});a.f.on(a.m,_.se,()=>jX(a));a.f.on(a.m,_.Rf,b=>{b=b.detail;switch(b.currentState){case 3:a.a.length||jX(a);s.Media.play(a.a,a.m.getPosition());break;case 4:case 2:iX(a);break;case 5:case _.Hs:case _.As:a.g.info(`Close session for ${a.a} `+`in player state ${b.currentState}.`),iX(a),s.Media.close(a.a),a.a=""}})},iX=function(a){s.Media.stop(a.a,a.m.getPosition())},jX=function(a){{const b=
2
- a.m.Sa();a.a=b?b.name||b.url:""}a.g.info(`Open session for ${a.a} `+`with duration ${a.m.getDuration()}`);s.Media.open(a.a,a.m.getDuration(),_.ra)},lX=class extends _.Uv{constructor(){super();this.m=this.f=null;this.a="";this.g=new _.T("clpp.adobe.AdobePlugin")}onPlayerCreated(a){var b=a.getConfiguration().adobe;(b=!b||!1!==b.enabled)?window.s&&s.Media?(this.m=a,kX(this)):this.g.warn("Adobe API not available."):this.g.debug("Adobe plugin is disabled.")}onPlayerWillDestroy(){this.f&&(this.f.release(),
3
- this.f=null);this.m=null;this.a=""}id(){return"adobe"}};_.x("clpp.adobe.AdobeAnalyticsPlugin",lX);lX.Id="adobe";_.Tn(new class{create(){return new lX}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var eX=function(a){a.f=new _.Qt;a.f.on(a.m,_.ug,()=>cX(a));a.f.on(a.m,_.tg,()=>{s.Media.play(a.a,a.m.getPosition())});a.f.on(a.m,_.se,()=>dX(a));a.f.on(a.m,_.Rf,b=>{b=b.detail;switch(b.currentState){case 3:a.a.length||dX(a);s.Media.play(a.a,a.m.getPosition());break;case 4:case 2:cX(a);break;case 5:case _.Fs:case _.vs:a.g.info(`Close session for ${a.a} `+`in player state ${b.currentState}.`),cX(a),s.Media.close(a.a),a.a=""}})},cX=function(a){s.Media.stop(a.a,a.m.getPosition())},dX=function(a){{const b=
2
+ a.m.Ra();a.a=b?b.name||b.url:""}a.g.info(`Open session for ${a.a} `+`with duration ${a.m.getDuration()}`);s.Media.open(a.a,a.m.getDuration(),_.ra)},fX=class extends _.Uv{constructor(){super();this.m=this.f=null;this.a="";this.g=new _.T("clpp.adobe.AdobePlugin")}onPlayerCreated(a){var b=a.getConfiguration().adobe;(b=!b||!1!==b.enabled)?window.s&&s.Media?(this.m=a,eX(this)):this.g.warn("Adobe API not available."):this.g.debug("Adobe plugin is disabled.")}onPlayerWillDestroy(){this.f&&(this.f.release(),
3
+ this.f=null);this.m=null;this.a=""}id(){return"adobe"}};_.x("clpp.adobe.AdobeAnalyticsPlugin",fX);fX.Id="adobe";_.Pn(new class{create(){return new fX}});};f.call(g, window);
package/cl.airplay.js CHANGED
@@ -1,3 +1,3 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var hX=class extends _.Uv{constructor(){super();this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.cu(()=>{this.m.play().catch(()=>{})});this.h=new _.Vt}onPlayerCreated(a){this.m=a;this.a=a.getSurface().getMedia()}onContentWillLoad(){this.a&&(this.h.on(this.a,"webkitplaybacktargetavailabilitychanged",this.w.bind(this)),this.h.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.A.bind(this)))}onPlayerWillRelease(){this.o.stop();this.h.release()}id(){return"airplay"}w(a){switch(a.availability){case "available":this.f=
2
- !0;break;case "not-available":this.f=!1}this.m.trigger(new _.H(_.tc,{canCast:this.f}))}A(){const a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.sc:_.rc;if(this.l||!this.m.isPaused()||3===this.m.getState())this.l?this.m.play().catch(()=>{}):this.o.la(.01);this.m.trigger(new _.H(a))}ya(){return this.j}Tc(){return this.f}fj(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())}};_.x("clpp.airplay.AirPlayPlugin",hX);hX.prototype.showCastMenu=hX.prototype.fj;
3
- hX.prototype.canCast=hX.prototype.Tc;hX.prototype.isCasting=hX.prototype.ya;hX.Id="airplay";_.Tn(new class{create(){return new hX}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var bX=class extends _.Uv{constructor(){super();this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.Yt(()=>{this.m.play().catch(()=>{})});this.h=new _.Qt}onPlayerCreated(a){this.m=a;this.a=a.getSurface().getMedia()}onContentWillLoad(){this.a&&(this.h.on(this.a,"webkitplaybacktargetavailabilitychanged",this.w.bind(this)),this.h.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.A.bind(this)))}onPlayerWillRelease(){this.o.stop();this.h.release()}id(){return"airplay"}w(a){switch(a.availability){case "available":this.f=
2
+ !0;break;case "not-available":this.f=!1}this.m.trigger(new _.H(_.tc,{canCast:this.f}))}A(){const a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.sc:_.rc;if(this.l||!this.m.isPaused()||3===this.m.getState())this.l?this.m.play().catch(()=>{}):this.o.la(.01);this.m.trigger(new _.H(a))}ya(){return this.j}Sc(){return this.f}aj(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())}};_.x("clpp.airplay.AirPlayPlugin",bX);bX.prototype.showCastMenu=bX.prototype.aj;
3
+ bX.prototype.canCast=bX.prototype.Sc;bX.prototype.isCasting=bX.prototype.ya;bX.Id="airplay";_.Pn(new class{create(){return new bX}});};f.call(g, window);
package/cl.broadpeak.js CHANGED
@@ -1,14 +1,14 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var XW=function(a){const b=a.m.getSurface().getMedia();b&&(a.l=a.H.bind(a),b.addEventListener("click",a.l))},YW=function(a){a.C.off(a.m,_.gg,a.F)},ZW=function(a){class b extends GenericPlayerApi{constructor(c){super();this.m=c;this.f=_.pj();this.a=0}getPlayerName(){return _.ra}getVersion(){return _.ea}getOSName(){return this.f.os}getDeviceVersion(){return this.f.osVersion.name}getDeviceType(){return"browser"}getTotalDuration(){return this.m.isLive()?0:this.a=1E3*this.m.getDuration()}getCurrentPosition(){const c=
2
- 1E3*this.m.getPosition();return 5===this.m.getState()?Math.max(c,this.a):c}getCurrentBitrate(){const c=this.m.getStats();return(c?c.streamBandwidth:0)/1E3}getCapabilities(){return{adTracking:this.m.getConfiguration().broadpeak.adTracking}}}return new b(a)},$W=function(){return!window.SmartLib||!window.GenericPlayerApi},aX=function(a,b){const c=b.analyticsAddress||null,d=b.nanoCDNHost||null,e=b.broadpeakDomainNames||"";b=b.uuid||null;a.h||(a.h=SmartLib.getInstance(),a.h.init(c,d,e),typeof b===_.Uf&&
3
- a.h.setUUID(b))},bX=function(a,b,c){const d=c.customParameters||{};a.a=a.h.createStreamingSession();a.a.setOption(StreamingSessionOptions.SESSION_PRECACHE,!0);for(const e in d)a.a.setCustomParameter(e,d[e]);c.adTracking&&(a.j=b.getAdsManager(),a.j.initialize(a.a,c.adParameters||{}));a.w.on(b,_.Xd,a.A.bind(a));a.o=ZW(b);a.a.attachPlayer(a.o)},cX=function(a,b){_.ai(a.w);a.f&&(a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},Z=class{constructor(a,b,c){this.a=a||{};this.f=b||{};this.w=
4
- c||0;this.o=0;this.l=this.j=this.h=!1}eb(){return"Broadpeak"}fb(){return""}hb(){return 1}getId(){return this.a.adId}getCreativeId(){return this.a.creativeId}zb(){return null}getApiFramework(){return null}getAdSystem(){return""}getAdvertiserName(){return""}getTitle(){return""}getDuration(){return 0>=this.a.duration?-1:this.a.duration/1E3}getPosition(){return this.o}setPosition(a){this.o=a}getSkipTimeOffset(){return 0===this.a.skipPosition?-1:(this.a.skipPosition-this.a.startPosition)/1E3}Bb(){return!1}Ra(){return this.a.clickURL}getMediaUrl(){return null}Va(){return 0}Ua(){return 0}Ba(){return 0}Ca(){return 0===
5
- this.f.startPosition?0:0<this.w&&this.f.startPosition+this.f.duration>=this.w?2:1}getPodIndex(){return 1}pb(){return this.f.startPosition/1E3}gb(){return this.a.index+1}Wa(){return 0>=this.f.adCount?-1:this.f.adCount}getWrapperAdIds(){return[]}getWrapperAdSystems(){return[]}getWrapperCreativeIds(){return[]}Ab(){return null}canSeek(){return!1}};Z.prototype.canSeek=Z.prototype.canSeek;Z.prototype.getVideoElement=Z.prototype.Ab;Z.prototype.getWrapperCreativeIds=Z.prototype.getWrapperCreativeIds;
6
- Z.prototype.getWrapperAdSystems=Z.prototype.getWrapperAdSystems;Z.prototype.getWrapperAdIds=Z.prototype.getWrapperAdIds;Z.prototype.getSequenceLength=Z.prototype.Wa;Z.prototype.getPositionInSequence=Z.prototype.gb;Z.prototype.getPodTimeOffset=Z.prototype.pb;Z.prototype.getPodIndex=Z.prototype.getPodIndex;Z.prototype.getPodType=Z.prototype.Ca;Z.prototype.getMediaBitrate=Z.prototype.Ba;Z.prototype.getMediaHeight=Z.prototype.Ua;Z.prototype.getMediaWidth=Z.prototype.Va;Z.prototype.getMediaUrl=Z.prototype.getMediaUrl;
7
- Z.prototype.getClickThroughUrl=Z.prototype.Ra;Z.prototype.isBumper=Z.prototype.Bb;Z.prototype.getSkipTimeOffset=Z.prototype.getSkipTimeOffset;Z.prototype.getPosition=Z.prototype.getPosition;Z.prototype.getDuration=Z.prototype.getDuration;Z.prototype.getTitle=Z.prototype.getTitle;Z.prototype.getAdvertiserName=Z.prototype.getAdvertiserName;Z.prototype.getAdSystem=Z.prototype.getAdSystem;Z.prototype.getApiFramework=Z.prototype.getApiFramework;Z.prototype.getSourceId=Z.prototype.zb;
8
- Z.prototype.getCreativeId=Z.prototype.getCreativeId;Z.prototype.getId=Z.prototype.getId;Z.prototype.getTechnology=Z.prototype.hb;Z.prototype.getAdManagerVersion=Z.prototype.fb;Z.prototype.getAdManagerName=Z.prototype.eb;var dX=class{constructor(a,b){this.m=a;this.f=b;this.a=new _.Vt;this.h=!1}init(){const a=this.m,b=this.a;b.on(a,_.Rf,this.o.bind(this));b.on(a,_.Mc,this.j.bind(this));b.on(a,"seek",this.l.bind(this))}j(a){a=a.detail;typeof a.bandwidth===_.r&&this.f.notifyLayerSwitch(a.bandwidth/1E3)}o(a){const b=this.m,c=this.f;a=a.detail;const d=a.currentState;2===a.previousState&&c.notifyStallEnd(!b.isPaused());switch(d){case 2:c.notifyStallStart();break;case 3:this.h?c.notifyResume():(c.notifyFirstImage(),this.h=
9
- !0);break;case 4:c.notifyPause()}}l(){const a=1E3*this.m.getPosition();this.f.notifySeek(a)}release(){this.a&&(_.ai(this.a),this.a=null)}};var eX=class{constructor(a){this.m=a;this.C=new _.Vt;this.l=this.B=this.f=this.a=null;this.F=this.G.bind(this)}initialize(a,b){this.B=a;a.activateAdvertising();XW(this);for(const c in b)a.setAdParameter(c,b[c]);a.setAdEventsListener({onAdBreakBegin:()=>{this.m.trigger(new _.H(_.Ub,{ad:null}));this.C.on(this.m,_.gg,this.F)},onAdBegin:(c,d)=>{this.f=c;this.a=new Z(c,d,1E3*this.m.getDuration());this.m.trigger(new _.H(_.mc,{ad:this.a}))},onAdSkippable:()=>{},onAdEnd:()=>{if(this.a){const c={ad:this.a};
10
- this.m.trigger(new _.H(_.Yb,c));this.m.trigger(new _.H(_.nc,c));this.f=this.a=null}},onAdBreakEnd:()=>{YW(this);this.m.trigger(new _.H(_.Vb));this.a=null}})}H(){if(this.a&&this.B){var a=this.a.Ra();a&&(this.B.adUserInteraction("click"),this.m.trigger(new _.H(_.Xb,{ad:this.a})),this.m.pause(),(a=window.open(a,"_blank"))&&a.focus())}}G(){if(this.a&&this.f){var a=this.m.getPosition()-this.f.startPosition/1E3,b=this.a.getDuration();0<b&&a>b||(this.a.setPosition(a),this.m.trigger(new _.H(_.jc,{ad:this.a})),
11
- !this.a.h&&a>=b/4&&(this.a.h=!0,this.m.trigger(new _.H(_.Zb,{ad:this.a}))),!this.a.j&&a>=b/2&&(this.a.j=!0,this.m.trigger(new _.H(_.ec,{ad:this.a}))),!this.a.l&&a>=3*b/4&&(this.a.l=!0,this.m.trigger(new _.H(_.oc,{ad:this.a}))))}}load(){return Promise.resolve()}j(){return!0}A(){}w(){return!0}skip(){if(this.a){var a=this.a.getPosition(),b=this.a.getSkipTimeOffset();-1===b||a<b||(a=this.m.getPosition()-a+this.a.getDuration(),b=this.a,this.f=this.a=null,YW(this),this.m.trigger(new _.H(_.lc,{ad:b})),this.m.setPosition(a))}}jb(){}isPaused(){}pause(){}resume(){}getAdVolume(){return 0}h(){}getVolume(){return 0}setVolume(){}setMuted(){}isMuted(){return!1}qb(){return!1}getPosition(){return this.a?
12
- this.a.getPosition():-1}o(){YW(this);this.C.release();const a=this.m.getSurface().getMedia();a&&this.l&&(a.removeEventListener("click",this.l),this.l=null);this.B=this.f=this.a=null;return Promise.resolve()}};eX.prototype.getPosition=eX.prototype.getPosition;eX.prototype.setVolume=eX.prototype.setVolume;eX.prototype.getVolume=eX.prototype.getVolume;eX.prototype.resume=eX.prototype.resume;eX.prototype.pause=eX.prototype.pause;eX.prototype.skip=eX.prototype.skip;var fX=class extends _.Uv{constructor(){super();this.o=this.f=this.a=this.h=this.m=null;this.w=new _.Vt;this.l=!1;this.j=null}onPlayerCreated(a){this.m=a}onContentWillLoad(a,b){const c=a.getConfiguration().broadpeak;if(c){if($W())return a.onError(new _.I(1,9,11E3));this.l=!0;aX(this,c);bX(this,a,c);return this.a.getURL(b.url).then(d=>{if(d.isError()){const e=d.getDetailedErrorCode();d=d.getDetailedErrorMessage();this.m.onError(new _.I(1,9,11001,{bpkErrorCode:e,message:d}));cX(this,void 0)}else b.url=
13
- d.getURL(),this.f=new dX(this.m,this.o),this.f.init()})}}onContentLoaded(){!1!==this.l&&this.a.precacheEnded()}A(a){a=a.detail;if(7003===a.code)cX(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.D)switch(a.category){case 3:cX(this,SmartLib.BPDecodingError);break;case 1:cX(this,SmartLib.BPNetworkingError);break;case 6:cX(this,SmartLib.BPAccessRightError);break;default:cX(this,SmartLib.BPUnspecifiedError)}}onPlayerWillRelease(){this.j=null;$W()||cX(this,SmartLib.BPSessionEndsNormally);
14
- this.l=!1}id(){return"broadpeak"}};_.x("clpp.broadpeak.BroadpeakPlugin",fX);fX.isSdkMissing=$W;fX.Id="broadpeak";var gX=class{name(){return"clpp.broadpeak.AdsManagerFactory"}a(a,b){return $W()?!1:!!(b&&b.broadpeak&&b.broadpeak.adTracking)}create(a){return new eX(a)}};_.Tn(new class{create(){return new fX}});_.Kh(new gX);};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var RW=function(a){const b=a.m.getSurface().getMedia();b&&(a.l=a.H.bind(a),b.addEventListener("click",a.l))},SW=function(a){a.C.off(a.m,_.gg,a.F)},TW=function(a){class b extends GenericPlayerApi{constructor(c){super();this.m=c;this.f=_.lj();this.a=0}getPlayerName(){return _.ra}getVersion(){return _.ea}getOSName(){return this.f.os}getDeviceVersion(){return this.f.osVersion.name}getDeviceType(){return"browser"}getTotalDuration(){return this.m.isLive()?0:this.a=1E3*this.m.getDuration()}getCurrentPosition(){const c=
2
+ 1E3*this.m.getPosition();return 5===this.m.getState()?Math.max(c,this.a):c}getCurrentBitrate(){const c=this.m.getStats();return(c?c.streamBandwidth:0)/1E3}getCapabilities(){return{adTracking:this.m.getConfiguration().broadpeak.adTracking}}}return new b(a)},UW=function(){return!window.SmartLib||!window.GenericPlayerApi},VW=function(a,b){const c=b.analyticsAddress||null,d=b.nanoCDNHost||null,e=b.broadpeakDomainNames||"";b=b.uuid||null;a.h||(a.h=SmartLib.getInstance(),a.h.init(c,d,e),typeof b===_.Uf&&
3
+ a.h.setUUID(b))},WW=function(a,b,c){const d=c.customParameters||{};a.a=a.h.createStreamingSession();a.a.setOption(StreamingSessionOptions.SESSION_PRECACHE,!0);for(const e in d)a.a.setCustomParameter(e,d[e]);c.adTracking&&(a.j=b.getAdsManager(),a.j.initialize(a.a,c.adParameters||{}));a.w.on(b,_.Yd,a.A.bind(a));a.o=TW(b);a.a.attachPlayer(a.o)},XW=function(a,b){_.Xh(a.w);a.f&&(a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},Z=class{constructor(a,b,c){this.a=a||{};this.f=b||{};this.w=
4
+ c||0;this.o=0;this.l=this.j=this.h=!1}cb(){return"Broadpeak"}eb(){return""}gb(){return 1}getId(){return this.a.adId}getCreativeId(){return this.a.creativeId}zb(){return null}getApiFramework(){return null}getAdSystem(){return""}getAdvertiserName(){return""}getTitle(){return""}getDuration(){return 0>=this.a.duration?-1:this.a.duration/1E3}getPosition(){return this.o}setPosition(a){this.o=a}getSkipTimeOffset(){return 0===this.a.skipPosition?-1:(this.a.skipPosition-this.a.startPosition)/1E3}Bb(){return!1}Qa(){return this.a.clickURL}getMediaUrl(){return null}Ua(){return 0}Ta(){return 0}Ba(){return 0}Ca(){return 0===
5
+ this.f.startPosition?0:0<this.w&&this.f.startPosition+this.f.duration>=this.w?2:1}getPodIndex(){return 1}pb(){return this.f.startPosition/1E3}fb(){return this.a.index+1}Va(){return 0>=this.f.adCount?-1:this.f.adCount}getWrapperAdIds(){return[]}getWrapperAdSystems(){return[]}getWrapperCreativeIds(){return[]}Ab(){return null}canSeek(){return!1}};Z.prototype.canSeek=Z.prototype.canSeek;Z.prototype.getVideoElement=Z.prototype.Ab;Z.prototype.getWrapperCreativeIds=Z.prototype.getWrapperCreativeIds;
6
+ Z.prototype.getWrapperAdSystems=Z.prototype.getWrapperAdSystems;Z.prototype.getWrapperAdIds=Z.prototype.getWrapperAdIds;Z.prototype.getSequenceLength=Z.prototype.Va;Z.prototype.getPositionInSequence=Z.prototype.fb;Z.prototype.getPodTimeOffset=Z.prototype.pb;Z.prototype.getPodIndex=Z.prototype.getPodIndex;Z.prototype.getPodType=Z.prototype.Ca;Z.prototype.getMediaBitrate=Z.prototype.Ba;Z.prototype.getMediaHeight=Z.prototype.Ta;Z.prototype.getMediaWidth=Z.prototype.Ua;Z.prototype.getMediaUrl=Z.prototype.getMediaUrl;
7
+ Z.prototype.getClickThroughUrl=Z.prototype.Qa;Z.prototype.isBumper=Z.prototype.Bb;Z.prototype.getSkipTimeOffset=Z.prototype.getSkipTimeOffset;Z.prototype.getPosition=Z.prototype.getPosition;Z.prototype.getDuration=Z.prototype.getDuration;Z.prototype.getTitle=Z.prototype.getTitle;Z.prototype.getAdvertiserName=Z.prototype.getAdvertiserName;Z.prototype.getAdSystem=Z.prototype.getAdSystem;Z.prototype.getApiFramework=Z.prototype.getApiFramework;Z.prototype.getSourceId=Z.prototype.zb;
8
+ Z.prototype.getCreativeId=Z.prototype.getCreativeId;Z.prototype.getId=Z.prototype.getId;Z.prototype.getTechnology=Z.prototype.gb;Z.prototype.getAdManagerVersion=Z.prototype.eb;Z.prototype.getAdManagerName=Z.prototype.cb;var YW=class{constructor(a,b){this.m=a;this.f=b;this.a=new _.Qt;this.h=!1}init(){const a=this.m,b=this.a;b.on(a,_.Rf,this.o.bind(this));b.on(a,_.Nc,this.j.bind(this));b.on(a,"seek",this.l.bind(this))}j(a){a=a.detail;typeof a.bandwidth===_.r&&this.f.notifyLayerSwitch(a.bandwidth/1E3)}o(a){const b=this.m,c=this.f;a=a.detail;const d=a.currentState;2===a.previousState&&c.notifyStallEnd(!b.isPaused());switch(d){case 2:c.notifyStallStart();break;case 3:this.h?c.notifyResume():(c.notifyFirstImage(),this.h=
9
+ !0);break;case 4:c.notifyPause()}}l(){const a=1E3*this.m.getPosition();this.f.notifySeek(a)}release(){this.a&&(_.Xh(this.a),this.a=null)}};var ZW=class{constructor(a){this.m=a;this.C=new _.Qt;this.l=this.B=this.f=this.a=null;this.F=this.G.bind(this)}initialize(a,b){this.B=a;a.activateAdvertising();RW(this);for(const c in b)a.setAdParameter(c,b[c]);a.setAdEventsListener({onAdBreakBegin:()=>{this.m.trigger(new _.H(_.Ub,{ad:null}));this.C.on(this.m,_.gg,this.F)},onAdBegin:(c,d)=>{this.f=c;this.a=new Z(c,d,1E3*this.m.getDuration());this.m.trigger(new _.H(_.mc,{ad:this.a}))},onAdSkippable:()=>{},onAdEnd:()=>{if(this.a){const c={ad:this.a};
10
+ this.m.trigger(new _.H(_.Yb,c));this.m.trigger(new _.H(_.nc,c));this.f=this.a=null}},onAdBreakEnd:()=>{SW(this);this.m.trigger(new _.H(_.Vb));this.a=null}})}H(){if(this.a&&this.B){var a=this.a.Qa();a&&(this.B.adUserInteraction("click"),this.m.trigger(new _.H(_.Xb,{ad:this.a})),this.m.pause(),(a=window.open(a,"_blank"))&&a.focus())}}G(){if(this.a&&this.f){var a=this.m.getPosition()-this.f.startPosition/1E3,b=this.a.getDuration();0<b&&a>b||(this.a.setPosition(a),this.m.trigger(new _.H(_.jc,{ad:this.a})),
11
+ !this.a.h&&a>=b/4&&(this.a.h=!0,this.m.trigger(new _.H(_.Zb,{ad:this.a}))),!this.a.j&&a>=b/2&&(this.a.j=!0,this.m.trigger(new _.H(_.ec,{ad:this.a}))),!this.a.l&&a>=3*b/4&&(this.a.l=!0,this.m.trigger(new _.H(_.oc,{ad:this.a}))))}}load(){return Promise.resolve()}j(){return!0}A(){}w(){return!0}skip(){if(this.a){var a=this.a.getPosition(),b=this.a.getSkipTimeOffset();-1===b||a<b||(a=this.m.getPosition()-a+this.a.getDuration(),b=this.a,this.f=this.a=null,SW(this),this.m.trigger(new _.H(_.lc,{ad:b})),this.m.setPosition(a))}}ib(){}isPaused(){}pause(){}resume(){}getAdVolume(){return 0}h(){}getVolume(){return 0}setVolume(){}setMuted(){}isMuted(){return!1}qb(){return!1}getPosition(){return this.a?
12
+ this.a.getPosition():-1}o(){SW(this);this.C.release();const a=this.m.getSurface().getMedia();a&&this.l&&(a.removeEventListener("click",this.l),this.l=null);this.B=this.f=this.a=null;return Promise.resolve()}};ZW.prototype.getPosition=ZW.prototype.getPosition;ZW.prototype.setVolume=ZW.prototype.setVolume;ZW.prototype.getVolume=ZW.prototype.getVolume;ZW.prototype.resume=ZW.prototype.resume;ZW.prototype.pause=ZW.prototype.pause;ZW.prototype.skip=ZW.prototype.skip;var $W=class extends _.Uv{constructor(){super();this.o=this.f=this.a=this.h=this.m=null;this.w=new _.Qt;this.l=!1;this.j=null}onPlayerCreated(a){this.m=a}onContentWillLoad(a,b){const c=a.getConfiguration().broadpeak;if(c){if(UW())return a.onError(new _.I(1,9,11E3));this.l=!0;VW(this,c);WW(this,a,c);return this.a.getURL(b.url).then(d=>{if(d.isError()){const e=d.getDetailedErrorCode();d=d.getDetailedErrorMessage();this.m.onError(new _.I(1,9,11001,{bpkErrorCode:e,message:d}));XW(this,void 0)}else b.url=
13
+ d.getURL(),this.f=new YW(this.m,this.o),this.f.init()})}}onContentLoaded(){!1!==this.l&&this.a.precacheEnded()}A(a){a=a.detail;if(7003===a.code)XW(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.D)switch(a.category){case 3:XW(this,SmartLib.BPDecodingError);break;case 1:XW(this,SmartLib.BPNetworkingError);break;case 6:XW(this,SmartLib.BPAccessRightError);break;default:XW(this,SmartLib.BPUnspecifiedError)}}onPlayerWillRelease(){this.j=null;UW()||XW(this,SmartLib.BPSessionEndsNormally);
14
+ this.l=!1}id(){return"broadpeak"}};_.x("clpp.broadpeak.BroadpeakPlugin",$W);$W.isSdkMissing=UW;$W.Id="broadpeak";var aX=class{name(){return"clpp.broadpeak.AdsManagerFactory"}a(a,b){return UW()?!1:!!(b&&b.broadpeak&&b.broadpeak.adTracking)}create(a){return new ZW(a)}};_.Pn(new class{create(){return new $W}});_.Gh(new aX);};f.call(g, window);