@castlabs/prestoplay 6.20.0 → 6.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +7 -7
  5. package/cjs/cl.cast.js +109 -110
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +553 -550
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +78 -77
  10. package/cjs/cl.externs.js +81 -97
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +69 -69
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +29 -29
  15. package/cjs/cl.ima.js +22 -24
  16. package/cjs/cl.mse.js +305 -305
  17. package/cjs/cl.muxdata.js +15 -15
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +13 -13
  20. package/cjs/cl.playlist.js +6 -6
  21. package/cjs/cl.sessions.js +16 -16
  22. package/cjs/cl.simid.js +15 -15
  23. package/cjs/cl.smooth.js +72 -72
  24. package/cjs/cl.thumbnails.js +25 -25
  25. package/cjs/cl.tizen.js +70 -69
  26. package/cjs/cl.ttml.js +29 -29
  27. package/cjs/cl.verimatrix.js +5 -5
  28. package/cjs/cl.vimond.js +13 -13
  29. package/cjs/cl.vr.js +18 -18
  30. package/cjs/cl.vtt.js +14 -14
  31. package/cjs/cl.yospace.js +9 -0
  32. package/cjs/cl.youbora.js +38 -20
  33. package/cl.adobe.js +3 -3
  34. package/cl.airplay.js +3 -3
  35. package/cl.broadpeak.js +5 -5
  36. package/cl.cast.js +88 -89
  37. package/cl.conviva.js +27 -27
  38. package/cl.core.js +471 -468
  39. package/cl.crypto.js +8 -8
  40. package/cl.dash.js +74 -72
  41. package/cl.externs.js +71 -99
  42. package/cl.freewheel.js +19 -19
  43. package/cl.hls.js +74 -74
  44. package/cl.hlssmpte.js +5 -5
  45. package/cl.htmlcue.js +26 -26
  46. package/cl.ima.js +16 -17
  47. package/cl.mse.js +276 -276
  48. package/cl.muxdata.js +13 -13
  49. package/cl.onboard.js +4 -4
  50. package/cl.persistent.js +11 -11
  51. package/cl.playlist.js +5 -5
  52. package/cl.sessions.js +10 -10
  53. package/cl.simid.js +13 -13
  54. package/cl.smooth.js +59 -59
  55. package/cl.thumbnails.js +19 -19
  56. package/cl.tizen.js +57 -57
  57. package/cl.ttml.js +22 -22
  58. package/cl.verimatrix.js +4 -4
  59. package/cl.vimond.js +8 -8
  60. package/cl.vr.js +14 -14
  61. package/cl.vtt.js +12 -12
  62. package/cl.yospace.js +3 -0
  63. package/cl.youbora.js +27 -15
  64. package/package.json +3 -1
  65. package/typings.d.ts +123 -24
package/cjs/cl.vr.js CHANGED
@@ -1,24 +1,24 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var xw="touchmove",yw="touchstart",zw=function(a,b,c,d){this.x=a||0;this.y=b||0;this.a=c||0;this.f=d||1},Aw=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)},Bw=function(a,b,c){c*=.5;var d=Math.sqrt(a*a+b*b),e=Math.sin(c);return new zw(a/d*e,b/d*e,0/d*e,Math.cos(c))},Cw=function(a,b,c){this.x=a||0;this.y=b||0;this.a=c||0},Dw=function(a,b){isFinite(b)?(a.x*=b,a.y*=b,a.a*=
3
- b):(a.x=0,a.y=0,a.a=0)},Ew=function(a,b){return a.x*b.x+a.y*b.y+a.a*b.a},Fw=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},Gw=function(){this.a=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])},Hw=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},Iw=function(a){var b=new Cw(0,0,0),c=new Cw(0,0,1),d=new Cw,e=new Cw,f=new Cw;a=a.a;var g=new Cw(0,1,0);f.x=b.x-g.x;f.y=b.y-g.y;f.a=b.a-g.a;g=f.length();Dw(f,1/g);c=Fw(d,c,f);g=c.length();Dw(c,1/g);Fw(e,f,d);a[0]=d.x;a[1]=d.y;a[2]=d.a;a[3]=-Ew(d,b);a[4]=e.x;a[5]=e.y;a[6]=e.a;a[7]=-Ew(e,b);a[8]=f.x;a[9]=f.y;a[10]=f.a;a[11]=-Ew(f,b);a[12]=0;a[13]=0;a[14]=0;a[15]=1},Kw=function(a){this.a=a;this.f=a.createProgram();this.l=
5
- Jw(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=Jw(this,!0,"precision highp float;\nuniform sampler2D Texture0;\nvarying highp vec2 oTexCoord;\nvoid main()\n{\n gl_FragColor \x3d texture2D(Texture0, oTexCoord);\n gl_FragColor.w \x3d 1.0;\n}\n");a.attachShader(this.f,this.l);a.attachShader(this.f,this.j);a.bindAttribLocation(this.f,
6
- 0,"aPosition");a.bindAttribLocation(this.f,1,"aTexCoord");a.linkProgram(this.f);if(!a.getProgramParameter(this.f,a.LINK_STATUS))throw new _.N(1,9,9004,"Unable to initialize shader");a.useProgram(this.f);this.h=a.getUniformLocation(this.f,"Mvpm");a.uniform1i(a.getUniformLocation(this.f,"Texture0"),0);a.useProgram(null)},Jw=function(a,b,c){b=a.a.createShader(b?a.a.FRAGMENT_SHADER:a.a.VERTEX_SHADER);a.a.shaderSource(b,c);a.a.compileShader(b);if(!a.a.getShaderParameter(b,a.a.COMPILE_STATUS))throw new _.N(1,
7
- 9,9004,"Unable to compile GL shader: "+a.a.getShaderInfoLog(b));return b},Lw=function(a){this.a=a;var b=[],c,d;for(d=0;70>=d;d++){var e=3>=d?d/4/64:67<=d?(63+(d-66)/4)/64:(d-3)/64;var f=(e-.5)*Math.PI,g=Math.cos(f);for(c=0;128>=c;c++){var h=c/128,l=(.5+h)*Math.PI*2;128===c?(b.push(b[645*d]),b.push(b[645*d+1]),b.push(b[645*d+2])):(b.push(100*Math.cos(l)*g),b.push(100*Math.sin(l)*g),b.push(100*Math.sin(f)));0===d||70===d?b.push(.5):b.push(1-h);b.push(1-e)}}e=[];for(c=0;128>c;c++)for(d=0;70>d;d++)f=
8
- 5*(129*d+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*d+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*d+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]);this.h=e.length/5;this.f=a.createBuffer();b=new Float32Array(e);a.bindBuffer(a.ARRAY_BUFFER,this.f);a.bufferData(a.ARRAY_BUFFER,b,a.STATIC_DRAW)},Mw=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)},Nw=function(){var a=this;this.o=this.w=this.L=this.J=this.A=
10
- this.ca=this.H=this.f=this.a=this.m=null;this.g=new _.K("clpp.vr");this.I=70;this.ba=1;this.P=this.N=!1;this.G=function(){if(a.a&&a.f){a.f.viewport(0,0,a.a.width,a.a.height);var b=a.L.a,c=Math.tan(.5*a.I*Math.PI/180);b[0]=1/(a.a.width/a.a.height*c);b[1]=0;b[2]=0;b[3]=0;b[4]=0;b[5]=1/c;b[6]=0;b[7]=0;b[8]=0;b[9]=0;b[10]=2E3/-1999.9;b[11]=200/-1999.9;b[12]=0;b[13]=0;b[14]=-1;b[15]=1}};this.l=this.j=0;this.h={x:0,y:0};this.V=new Gw;this.$=new Gw;this.fa=new Gw;this.ga=new Gw;this.B=this.ym.bind(this);
11
- this.C=this.zm.bind(this);this.K=this.xm.bind(this)},Ow=function(a){var b=Bw(1,0,a.l*Math.PI/180);Aw(Bw(0,1,a.j*Math.PI/180),a.V);Aw(b,a.$);Iw(a.fa);Hw(a.ga,a.V,a.fa);Hw(a.H,a.$,a.ga)},Pw=function(a){a.a&&(a.a.removeEventListener("mousemove",a.B,!1),a.a.removeEventListener(xw,a.B,!1),a.a.removeEventListener("mouseup",a.C,!1),a.a.removeEventListener("touchend",a.C,!1))},Qw=function(){};Cw.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.a*this.a)};Gw.prototype.set=function(a,b,c,d,e,f,g,h,l,m,n,p,q,t,v,z){var C=this.a;C[0]=a;C[4]=b;C[8]=c;C[12]=d;C[1]=e;C[5]=f;C[9]=g;C[13]=h;C[2]=l;C[6]=m;C[10]=n;C[14]=p;C[3]=q;C[7]=t;C[11]=v;C[15]=z;return this};var Rw={alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!1,devicePixelRatio:1};_.x(Nw,_.ev);_.u=Nw.prototype;_.u.onPlayerCreated=function(a){this.g.info("Player created");this.m=a};
2
+ var f=function(window){var ex="touchmove",fx="touchstart",gx=function(a,b,c,d){this.x=a||0;this.y=b||0;this.a=c||0;this.f=d||1},hx=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)},ix=function(a,b,c){c*=.5;var d=Math.sqrt(a*a+b*b),e=Math.sin(c);return new gx(a/d*e,b/d*e,0/d*e,Math.cos(c))},jx=function(a,b,c){this.x=a||0;this.y=b||0;this.a=c||0},kx=function(a,b){isFinite(b)?(a.x*=b,a.y*=b,a.a*=
3
+ b):(a.x=0,a.y=0,a.a=0)},lx=function(a,b){return a.x*b.x+a.y*b.y+a.a*b.a},mx=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},nx=function(){this.a=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])},ox=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},px=function(a){var b=new jx(0,0,0),c=new jx(0,0,1),d=new jx,e=new jx,f=new jx;a=a.a;var g=new jx(0,1,0);f.x=b.x-g.x;f.y=b.y-g.y;f.a=b.a-g.a;g=f.length();kx(f,1/g);c=mx(d,c,f);g=c.length();kx(c,1/g);mx(e,f,d);a[0]=d.x;a[1]=d.y;a[2]=d.a;a[3]=-lx(d,b);a[4]=e.x;a[5]=e.y;a[6]=e.a;a[7]=-lx(e,b);a[8]=f.x;a[9]=f.y;a[10]=f.a;a[11]=-lx(f,b);a[12]=0;a[13]=0;a[14]=0;a[15]=1},rx=function(a){this.a=a;this.f=a.createProgram();this.l=
5
+ qx(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=qx(this,!0,"precision highp float;\nuniform sampler2D Texture0;\nvarying highp vec2 oTexCoord;\nvoid main()\n{\n gl_FragColor \x3d texture2D(Texture0, oTexCoord);\n gl_FragColor.w \x3d 1.0;\n}\n");a.attachShader(this.f,this.l);a.attachShader(this.f,this.j);a.bindAttribLocation(this.f,
6
+ 0,"aPosition");a.bindAttribLocation(this.f,1,"aTexCoord");a.linkProgram(this.f);if(!a.getProgramParameter(this.f,a.LINK_STATUS))throw new _.N(1,9,9004,"Unable to initialize shader");a.useProgram(this.f);this.h=a.getUniformLocation(this.f,"Mvpm");a.uniform1i(a.getUniformLocation(this.f,"Texture0"),0);a.useProgram(null)},qx=function(a,b,c){b=a.a.createShader(b?a.a.FRAGMENT_SHADER:a.a.VERTEX_SHADER);a.a.shaderSource(b,c);a.a.compileShader(b);if(!a.a.getShaderParameter(b,a.a.COMPILE_STATUS))throw new _.N(1,
7
+ 9,9004,"Unable to compile GL shader: "+a.a.getShaderInfoLog(b));return b},sx=function(a){this.a=a;var b=[],c,d;for(d=0;70>=d;d++){var e=3>=d?d/4/64:67<=d?(63+(d-66)/4)/64:(d-3)/64;var f=(e-.5)*Math.PI,g=Math.cos(f);for(c=0;128>=c;c++){var h=c/128,l=(.5+h)*Math.PI*2;128===c?(b.push(b[645*d]),b.push(b[645*d+1]),b.push(b[645*d+2])):(b.push(100*Math.cos(l)*g),b.push(100*Math.sin(l)*g),b.push(100*Math.sin(f)));0===d||70===d?b.push(.5):b.push(1-h);b.push(1-e)}}e=[];for(c=0;128>c;c++)for(d=0;70>d;d++)f=
8
+ 5*(129*d+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*d+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*d+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]);this.h=e.length/5;this.f=a.createBuffer();b=new Float32Array(e);a.bindBuffer(a.ARRAY_BUFFER,this.f);a.bufferData(a.ARRAY_BUFFER,b,a.STATIC_DRAW)},tx=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)},ux=function(){var a=this;this.o=this.w=this.L=this.J=this.A=
10
+ this.ca=this.H=this.f=this.a=this.m=null;this.g=new _.K("clpp.vr");this.I=70;this.ba=1;this.P=this.N=!1;this.G=function(){if(a.a&&a.f){a.f.viewport(0,0,a.a.width,a.a.height);var b=a.L.a,c=Math.tan(.5*a.I*Math.PI/180);b[0]=1/(a.a.width/a.a.height*c);b[1]=0;b[2]=0;b[3]=0;b[4]=0;b[5]=1/c;b[6]=0;b[7]=0;b[8]=0;b[9]=0;b[10]=2E3/-1999.9;b[11]=200/-1999.9;b[12]=0;b[13]=0;b[14]=-1;b[15]=1}};this.l=this.j=0;this.h={x:0,y:0};this.V=new nx;this.Z=new nx;this.fa=new nx;this.ga=new nx;this.B=this.Am.bind(this);
11
+ this.C=this.Bm.bind(this);this.K=this.zm.bind(this)},vx=function(a){var b=ix(1,0,a.l*Math.PI/180);hx(ix(0,1,a.j*Math.PI/180),a.V);hx(b,a.Z);px(a.fa);ox(a.ga,a.V,a.fa);ox(a.H,a.Z,a.ga)},wx=function(a){a.a&&(a.a.removeEventListener("mousemove",a.B,!1),a.a.removeEventListener(ex,a.B,!1),a.a.removeEventListener("mouseup",a.C,!1),a.a.removeEventListener("touchend",a.C,!1))},xx=function(){};jx.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.a*this.a)};nx.prototype.set=function(a,b,c,d,e,f,g,h,l,m,n,p,q,t,v,z){var C=this.a;C[0]=a;C[4]=b;C[8]=c;C[12]=d;C[1]=e;C[5]=f;C[9]=g;C[13]=h;C[2]=l;C[6]=m;C[10]=n;C[14]=p;C[3]=q;C[7]=t;C[11]=v;C[15]=z;return this};var yx={alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!1,devicePixelRatio:1};_.x(ux,_.pv);_.u=ux.prototype;_.u.onPlayerCreated=function(a){this.g.info("Player created");this.m=a};
12
12
  _.u.onContentWillLoad=function(a){var b=a.getConfiguration();if(b.vr&&b.vr.enable){var c=b.vr,d=c.fieldOfView,e=c.sensitivity,f=c.invertHorizontalControl;c=c.invertVerticalControl;if(void 0!==d&&_.M.sa(d))this.I=d;else throw new _.N(1,7,7100,"fieldOfView configuration must be a number");if(void 0!==e&&_.M.sa(e)&&0<e)this.ba=e;else throw new _.N(1,7,7100,"sensitivity configuration must be a positive number");this.N=!!f;this.P=!!c;if(a=a.getSurface())if((d=a.getMedia())&&d.tagName.toLowerCase()===_.r){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",Rw)||this.a.getContext("experimental-webgl",Rw);if(!this.f)throw new _.N(1,9,9003,"Unable to create GL context");this.H=new Gw;Iw(this.H);this.ca=new Lw(this.f);this.A=new Kw(this.f);this.J=new Gw;this.L=new Gw;this.o=this.w=null;this.a.addEventListener(_.Of,this.G)}a.addElementToContainer(this.a,!0,!0);a.hideMediaElement();b.vr.attachMouseListener&&(this.a.addEventListener("mousedown",this.K,
14
- !1),this.a.addEventListener(yw,this.K,!1));this.G();this.Di()}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
- _.u.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&&(Pw(this),this.a.removeEventListener(_.Of,this.G),this.a.parentElement.removeChild(this.a),this.a.removeEventListener("mousedown",this.K,!1),delete this.a,this.a=null)};_.u.onPlayerWillDestroy=function(){var a=this;return _.I(function(b){a.m=null;_.B(b)})};_.u.id=function(){return"vr"};
16
- _.u.Di=function(){if(this.m&&this.f){var a=this.m.getSurface();if(a&&(a=a.getMedia())&&a.tagName.toLowerCase()===_.r){this.w=requestAnimationFrame(this.Di.bind(this));var b=this.f;this.o||a.readyState!==a.HAVE_ENOUGH_DATA||(this.o=new Mw(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=Hw(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.ca;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",yx)||this.a.getContext("experimental-webgl",yx);if(!this.f)throw new _.N(1,9,9003,"Unable to create GL context");this.H=new nx;px(this.H);this.ca=new sx(this.f);this.A=new rx(this.f);this.J=new nx;this.L=new nx;this.o=this.w=null;this.a.addEventListener(_.Of,this.G)}a.addElementToContainer(this.a,!0,!0);a.hideMediaElement();b.vr.attachMouseListener&&(this.a.addEventListener("mousedown",this.K,
14
+ !1),this.a.addEventListener(fx,this.K,!1));this.G();this.Hi()}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
+ _.u.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&&(wx(this),this.a.removeEventListener(_.Of,this.G),this.a.parentElement.removeChild(this.a),this.a.removeEventListener("mousedown",this.K,!1),delete this.a,this.a=null)};_.u.onPlayerWillDestroy=function(){var a=this;return _.I(function(b){a.m=null;_.A(b)})};_.u.id=function(){return"vr"};
16
+ _.u.Hi=function(){if(this.m&&this.f){var a=this.m.getSurface();if(a&&(a=a.getMedia())&&a.tagName.toLowerCase()===_.r){this.w=requestAnimationFrame(this.Hi.bind(this));var b=this.f;this.o||a.readyState!==a.HAVE_ENOUGH_DATA||(this.o=new tx(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=ox(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.ca;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
- _.u.xm=function(a){this.g.debug("Mouse Down. Enable VR mouse interaction");a.preventDefault();if(0===a.button||a.type===yw)a.type===yw?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(xw,this.B,!1),this.a.addEventListener("mouseup",this.C,!1),this.a.addEventListener("touchend",this.C,!1)};
20
- _.u.ym=function(a){a.preventDefault();var b=a.clientX,c=a.clientY;a.type===xw&&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.ba;c=d*b*(this.P?-1:1);this.j+=a*b*(this.N?-1:1);this.l+=c;Ow(this)};_.u.zm=function(a){this.g.debug("Mouse Up. Removing mouse interaction listeners");a.preventDefault();Pw(this)};_.u.Ql=function(a,b){this.l=b;this.j=a;Ow(this)};_.u.$k=function(){return{x:this.j,y:this.l}};
21
- _.u.rn=function(a){this.I=a;this.G()};_.J("clpp.vr.VrPlugin",Nw);Nw.prototype.setCameraFieldOfView=Nw.prototype.rn;Nw.prototype.getCameraCoordinates=Nw.prototype.$k;Nw.prototype.moveCamera=Nw.prototype.Ql;Nw.Id="vr";Qw.prototype.create=function(){return new Nw};_.Fs(new Qw);};
19
+ _.u.zm=function(a){this.g.debug("Mouse Down. Enable VR mouse interaction");a.preventDefault();if(0===a.button||a.type===fx)a.type===fx?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(ex,this.B,!1),this.a.addEventListener("mouseup",this.C,!1),this.a.addEventListener("touchend",this.C,!1)};
20
+ _.u.Am=function(a){a.preventDefault();var b=a.clientX,c=a.clientY;a.type===ex&&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.ba;c=d*b*(this.P?-1:1);this.j+=a*b*(this.N?-1:1);this.l+=c;vx(this)};_.u.Bm=function(a){this.g.debug("Mouse Up. Removing mouse interaction listeners");a.preventDefault();wx(this)};_.u.Tl=function(a,b){this.l=b;this.j=a;vx(this)};_.u.cl=function(){return{x:this.j,y:this.l}};
21
+ _.u.un=function(a){this.I=a;this.G()};_.J("clpp.vr.VrPlugin",ux);ux.prototype.setCameraFieldOfView=ux.prototype.un;ux.prototype.getCameraCoordinates=ux.prototype.cl;ux.prototype.moveCamera=ux.prototype.Tl;ux.Id="vr";xx.prototype.create=function(){return new ux};_.Qs(new xx);};
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 dw=" The setting will be ignored.",ew="VTT parser encountered an invalid VTT setting: ",fw="application/x-subrip",gw="text/srt",hw='text/vtt; codecs\x3d"vtt"',iw='text/vtt; codecs\x3d"wvtt"',jw=function(a){_.Pj(a,/[ \t]+/gm)},kw=function(a){return a.a===a.f.length?null:(a=_.Pj(a,/[^ \t\n]*/gm))?a[0]:null},lw=function(){},mw=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},nw=function(){},ow=function(a){this.a=a},qw=function(a,b,c){var d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"===b?a.textAlign=_.Ai:a.textAlign=
4
- _.kv[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"===d[1]?_.Bg:_.Cg;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===_.Be||b===_.bg?_.Be:b===_.Ce||b===_.le?_.Ce:_.sd);else if(d=/^region:(.*)$/.exec(b)){if(b=pw(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=_.lv[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.Ci,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.lv[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},pw=function(a,b){var c=a.filter(function(d){return d.id===b});return c.length?c[0]:(_.Bh("VTT parser could not find a region with id: ",b," The region will be ignored."),null)},rw=function(a){a=_.Pj(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)},sw=function(){ow.apply(this,arguments)},tw=function(){this.a=null;this.g=new _.K("clpp.vtt.mp4")},vw=function(a,b,c){var d,e,f;(new _.cn).M("payl",_.fn(function(g){d=_.R.aa(g)})).M("iden",_.fn(function(g){e=_.R.aa(g)})).M("sttg",_.fn(function(g){f=_.R.aa(g)})).parse(a);return d?uw(d,e,f,b,c):null},uw=function(a,b,c,d,e){a=new _.Fi(d,e,a,_.Kg);b&&(a.id=b);if(c)for(b=new _.Oj(c),c=
7
- kw(b);c;)qw(a,c,[])||_.Bh(ew,c,dw),jw(b),c=kw(b);return a},ww=function(){this.j=new nw};lw.prototype.a=function(a){a=_.R.aa(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=_.w(b);for(var c=b.next();!c.done;c=b.next())a+=mw(c.value)}return _.R.Ya(a)};nw.prototype.create=function(){return new lw};nw.prototype.probe=function(a,b){return(a===gw||a===fw)&&b===_.lg};ow.prototype.parseInit=function(){};
8
- ow.prototype.parseMedia=function(a,b){var c=_.R.aa(a);c=c.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");var d=c.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(d[0]))throw new _.N(_.P,2,2E3);c=b.periodStart;if(d[0].includes("X-TIMESTAMP-MAP")){var e=d[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),f=d[0].match(/MPEGTS:(\d+)/m);if(e&&f){c=rw(new _.Oj(e[1]));if(null==c)throw new _.N(_.P,2,2E3);f=Number(f[1]);for(e=b.segmentStart;95443.7176888889<=e;)e-=95443.7176888889,f+=8589934592;c=b.periodStart+
9
- f/9E4-c}}else this.a.streaming.relativeTextTimestamp&&null!==b.segmentStart&&(c=b.segmentStart);f=[];e=_.w(d);for(var g=e.next();!g.done;g=e.next()){var h=g.value;if(/^region/.test(h.toLowerCase())){h=new _.Oj(h.replace(/\n/g," "));g=new _.Ii;kw(h);jw(h);for(var l=kw(h);l;){var m;a:{var n=g,p=l;if(m=/^id:(.*)$/.exec(p))n.id=m[1];else if(m=/^width:(\d{1,2}|100)%$/.exec(p))n.width=Number(m[1]);else if(m=/^lines:(\d+)$/.exec(p))n.height=Number(m[1]),n.heightUnits=2;else if(m=/^regionanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.regionAnchorX=
10
- Number(m[1]),n.regionAnchorY=Number(m[2]);else if(m=/^viewportanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.viewportAnchorX=Number(m[1]),n.viewportAnchorY=Number(m[2]);else if(/^scroll:up$/.exec(p))n.scroll="up";else{m=!1;break a}m=!0}m||_.Bh("VTT parser encountered an invalid VTTRegion setting: ",l,dw);jw(h);l=kw(h)}f.push(g)}}e=[];h=_.w(d);for(g=h.next();!g.done;g=h.next())if(g=g.value,/^style/.test(g.toLowerCase())){g=g.replace(/^style/i,"").replace(/\n/g," ");l=/[^{}]+{[^{}]*}/g;do(m=l.exec(g))&&
11
- e.push(m[0]);while(m)}h=[];d=_.w(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 _.Oj(p[0]);m=rw(l);var t=_.Pj(l,/[ \t]+--\x3e[ \t]+/g);n=rw(l);if(null==m||null==t||null==n)throw new _.N(_.P,2,2001);m+=q;n+=q;p=p.slice(1).join("\n").trim();m=new _.Fi(m,n,p,_.Kg);g&&(m.id=g);jw(l);for(n=kw(l);n;)qw(m,n,f)||_.Bh(ew,
12
- n,dw),jw(l),n=kw(l);null!=g&&(m.id=g);g=m}g&&h.push(g)}return{cues:h,styles:e}};_.x(sw,ow);sw.prototype.parseMedia=function(a,b){return ow.prototype.parseMedia.call(this,(new lw).a(a),b)};tw.prototype.parseInit=function(a){var b=this,c=!1;(new _.cn).M(_.Qe,_.dn).M(_.og,_.dn).M(_.Le,_.dn).Y("mdhd",function(d){0===d.version?(d.reader.skip(4),d.reader.skip(4),b.a=_.W(d.reader),d.reader.skip(4)):(d.reader.skip(8),d.reader.skip(8),b.a=_.W(d.reader),d.reader.skip(8));d.reader.skip(4)}).M(_.Pe,_.dn).M(_.eg,_.dn).Y(_.gg,_.en).M("wvtt",function(){c=!0}).parse(a);if(!this.a)throw new _.N(_.P,2,2008);if(!c)throw new _.N(_.P,2,2008);};
13
- tw.prototype.parseMedia=function(a,b){if(!this.a)throw this.g.error("No init segment for MP4+VTT!"),new _.N(_.P,2,2008);var c=0,d=[],e,f=[],g=!1,h=!1,l=!1,m=null;(new _.cn).M("moof",_.dn).M("traf",_.dn).Y("tfdt",function(H){g=!0;c=0===H.version?_.W(H.reader):_.$m(H.reader)}).Y("tfhd",function(H){var O=H.flags;H=H.reader;H.skip(4);O&1&&H.skip(8);O&2&&H.skip(4);m=O&8?_.W(H):null}).Y("trun",function(H){h=!0;var O=H.version,T=H.flags;H=H.reader;var da=_.W(H);T&1&&H.skip(4);T&4&&H.skip(4);for(var aa=[],
14
- wa=0;wa<da;wa++){var Va={duration:null,sampleSize:null,xg:null};T&256&&(Va.duration=_.W(H));T&512&&(Va.sampleSize=_.W(H));T&1024&&H.skip(4);T&2048&&(Va.xg=0===O?_.W(H):_.Zm(H));aa.push(Va)}d=aa}).M(_.Ke,_.fn(function(H){l=!0;e=H})).parse(a);if(!l&&!g&&!h)throw new _.N(_.P,2,2008);var n=c,p=new DataView(e.buffer,e.byteOffset,e.byteLength);p=new _.Um(p,!1);for(var q=_.w(d),t=q.next();!t.done;t=q.next()){t=t.value;var v=t.duration||m,z=t.xg?c+t.xg:n;n=z+(v||0);var C=0;do{var F=_.W(p);C+=F;var G=_.W(p);
15
- G=_.hn(G);var A=null;"vttc"===G?8<F&&(A=_.bn(p,F-8)):("vtte"!==G&&this.g.error("Unknown box "+G+"! Skipping!"),p.skip(F-8));v?A&&f.push(vw(A,b.periodStart+z/this.a,b.periodStart+n/this.a)):this.g.error("WVTT sample duration unknown, and no default found!")}while(t.sampleSize&&C<t.sampleSize)}return{cues:f.filter(_.Oi),styles:[]}};_.x(ww,_.it);ww.prototype.f=function(){_.Lu(_.lg,ow);_.Lu(hw,ow);_.Lu(iw,ow);_.Lu(_.Wc,tw);_.Lu(gw,sw);_.Lu(fw,sw);_.Wk.push(this.j)};ww.prototype.a=function(){_.Uu(_.lg);_.Uu(hw);_.Uu(iw);_.Uu(_.Wc);_.Uu(gw);_.Uu(fw);_.Yk(this.j)};ww.prototype.id=function(){return"subtitles-vtt"};_.J("clpp.vtt.VttComponent",ww);};
2
+ var f=function(window){var Lw=" The setting will be ignored.",Mw="VTT parser encountered an invalid VTT setting: ",Nw="application/x-subrip",Ow="text/srt",Pw='text/vtt; codecs\x3d"vtt"',Qw='text/vtt; codecs\x3d"wvtt"',Rw=function(a){_.Rj(a,/[ \t]+/gm)},Sw=function(a){return a.a===a.f.length?null:(a=_.Rj(a,/[^ \t\n]*/gm))?a[0]:null},Tw=function(){},Uw=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},Vw=function(){},Ww=function(a){this.a=a},Yw=function(a,b,c){var d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"===b?a.textAlign=_.Ci:a.textAlign=
4
+ _.wv[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"===d[1]?_.Ag:_.Bg;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===_.Be||b===_.bg?_.Be:b===_.Ce||b===_.le?_.Ce:_.sd);else if(d=/^region:(.*)$/.exec(b)){if(b=Xw(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=_.xv[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.Ei,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.xv[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},Xw=function(a,b){var c=a.filter(function(d){return d.id===b});return c.length?c[0]:(_.Dh("VTT parser could not find a region with id: ",b," The region will be ignored."),null)},Zw=function(a){a=_.Rj(a,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g);if(null==
6
+ a)return null;var b=Number(a[2]),c=Number(a[3]);return 59<b||59<c?null:Number(a[4])/1E3+c+60*b+3600*(Number(a[1])||0)},$w=function(){Ww.apply(this,arguments)},ax=function(){this.a=null;this.g=new _.K("clpp.vtt.mp4")},cx=function(a,b,c){var d,e,f;(new _.gn).M("payl",_.kn(function(g){d=_.R.aa(g)})).M("iden",_.kn(function(g){e=_.R.aa(g)})).M("sttg",_.kn(function(g){f=_.R.aa(g)})).parse(a);return d?bx(d,e,f,b,c):null},bx=function(a,b,c,d,e){a=new _.Hi(d,e,a,_.Kg);b&&(a.id=b);if(c)for(b=new _.Qj(c),c=
7
+ Sw(b);c;)Yw(a,c,[])||_.Dh(Mw,c,Lw),Rw(b),c=Sw(b);return a},dx=function(){this.j=new Vw};Tw.prototype.a=function(a){a=_.R.aa(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=_.w(b);for(var c=b.next();!c.done;c=b.next())a+=Uw(c.value)}return _.R.$a(a)};Vw.prototype.create=function(){return new Tw};Vw.prototype.probe=function(a,b){return(a===Ow||a===Nw)&&b===_.lg};Ww.prototype.parseInit=function(){};
8
+ Ww.prototype.parseMedia=function(a,b){var c=_.R.aa(a);c=c.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");var d=c.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(d[0]))throw new _.N(_.P,2,2E3);c=b.periodStart;if(d[0].includes("X-TIMESTAMP-MAP")){var e=d[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),f=d[0].match(/MPEGTS:(\d+)/m);if(e&&f){c=Zw(new _.Qj(e[1]));if(null==c)throw new _.N(_.P,2,2E3);f=Number(f[1]);for(e=b.segmentStart;95443.7176888889<=e;)e-=95443.7176888889,f+=8589934592;c=b.periodStart+
9
+ f/9E4-c}}else this.a.streaming.relativeTextTimestamp&&null!==b.segmentStart&&(c=b.segmentStart);f=[];e=_.w(d);for(var g=e.next();!g.done;g=e.next()){var h=g.value;if(/^region/.test(h.toLowerCase())){h=new _.Qj(h.replace(/\n/g," "));g=new _.Ki;Sw(h);Rw(h);for(var l=Sw(h);l;){var m;a:{var n=g,p=l;if(m=/^id:(.*)$/.exec(p))n.id=m[1];else if(m=/^width:(\d{1,2}|100)%$/.exec(p))n.width=Number(m[1]);else if(m=/^lines:(\d+)$/.exec(p))n.height=Number(m[1]),n.heightUnits=2;else if(m=/^regionanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.regionAnchorX=
10
+ Number(m[1]),n.regionAnchorY=Number(m[2]);else if(m=/^viewportanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.viewportAnchorX=Number(m[1]),n.viewportAnchorY=Number(m[2]);else if(/^scroll:up$/.exec(p))n.scroll="up";else{m=!1;break a}m=!0}m||_.Dh("VTT parser encountered an invalid VTTRegion setting: ",l,Lw);Rw(h);l=Sw(h)}f.push(g)}}e=[];h=_.w(d);for(g=h.next();!g.done;g=h.next())if(g=g.value,/^style/.test(g.toLowerCase())){g=g.replace(/^style/i,"").replace(/\n/g," ");l=/[^{}]+{[^{}]*}/g;do(m=l.exec(g))&&
11
+ e.push(m[0]);while(m)}h=[];d=_.w(d);for(g=d.next();!g.done;g=d.next())if(g=g.value,g.includes("--\x3e")){p=g.split("\n");var q=c;if(1===p.length&&!p[0]||/^NOTE($|[ \t])/.test(p[0])||"STYLE"===p[0])g=null;else{g=null;p[0].includes("--\x3e")||(g=p[0],p.splice(0,1));l=new _.Qj(p[0]);m=Zw(l);var t=_.Rj(l,/[ \t]+--\x3e[ \t]+/g);n=Zw(l);if(null==m||null==t||null==n)throw new _.N(_.P,2,2001);m+=q;n+=q;p=p.slice(1).join("\n").trim();m=new _.Hi(m,n,p,_.Kg);g&&(m.id=g);Rw(l);for(n=Sw(l);n;)Yw(m,n,f)||_.Dh(Mw,
12
+ n,Lw),Rw(l),n=Sw(l);null!=g&&(m.id=g);g=m}g&&h.push(g)}return{cues:h,styles:e}};_.x($w,Ww);$w.prototype.parseMedia=function(a,b){return Ww.prototype.parseMedia.call(this,(new Tw).a(a),b)};ax.prototype.parseInit=function(a){var b=this,c=!1;(new _.gn).M(_.Qe,_.hn).M(_.og,_.hn).M(_.Le,_.hn).Y("mdhd",function(d){0===d.version?(d.reader.skip(4),d.reader.skip(4),b.a=_.W(d.reader),d.reader.skip(4)):(d.reader.skip(8),d.reader.skip(8),b.a=_.W(d.reader),d.reader.skip(8));d.reader.skip(4)}).M(_.Pe,_.hn).M(_.eg,_.hn).Y(_.gg,_.jn).M("wvtt",function(){c=!0}).parse(a);if(!this.a)throw new _.N(_.P,2,2008);if(!c)throw new _.N(_.P,2,2008);};
13
+ ax.prototype.parseMedia=function(a,b){if(!this.a)throw this.g.error("No init segment for MP4+VTT!"),new _.N(_.P,2,2008);var c=0,d=[],e,f=[],g=!1,h=!1,l=!1,m=null;(new _.gn).M("moof",_.hn).M("traf",_.hn).Y("tfdt",function(H){g=!0;c=0===H.version?_.W(H.reader):_.dn(H.reader)}).Y("tfhd",function(H){var O=H.flags;H=H.reader;H.skip(4);O&1&&H.skip(8);O&2&&H.skip(4);m=O&8?_.W(H):null}).Y("trun",function(H){h=!0;var O=H.version,T=H.flags;H=H.reader;var da=_.W(H);T&1&&H.skip(4);T&4&&H.skip(4);for(var aa=[],
14
+ ya=0;ya<da;ya++){var Va={duration:null,sampleSize:null,zg:null};T&256&&(Va.duration=_.W(H));T&512&&(Va.sampleSize=_.W(H));T&1024&&H.skip(4);T&2048&&(Va.zg=0===O?_.W(H):_.cn(H));aa.push(Va)}d=aa}).M(_.Je,_.kn(function(H){l=!0;e=H})).parse(a);if(!l&&!g&&!h)throw new _.N(_.P,2,2008);var n=c,p=new DataView(e.buffer,e.byteOffset,e.byteLength);p=new _.Ym(p,!1);for(var q=_.w(d),t=q.next();!t.done;t=q.next()){t=t.value;var v=t.duration||m,z=t.zg?c+t.zg:n;n=z+(v||0);var C=0;do{var F=_.W(p);C+=F;var G=_.W(p);
15
+ G=_.mn(G);var B=null;"vttc"===G?8<F&&(B=_.fn(p,F-8)):("vtte"!==G&&this.g.error("Unknown box "+G+"! Skipping!"),p.skip(F-8));v?B&&f.push(cx(B,b.periodStart+z/this.a,b.periodStart+n/this.a)):this.g.error("WVTT sample duration unknown, and no default found!")}while(t.sampleSize&&C<t.sampleSize)}return{cues:f.filter(_.Qi),styles:[]}};_.x(dx,_.tt);dx.prototype.f=function(){_.cv(_.lg,Ww);_.cv(Pw,Ww);_.cv(Qw,Ww);_.cv(_.Wc,ax);_.cv(Ow,$w);_.cv(Nw,$w);_.$k.push(this.j)};dx.prototype.a=function(){_.ev(_.lg);_.ev(Pw);_.ev(Qw);_.ev(_.Wc);_.ev(Ow);_.ev(Nw);_.bl(this.j)};dx.prototype.id=function(){return"subtitles-vtt"};_.J("clpp.vtt.VttComponent",dx);};
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));}
@@ -0,0 +1,9 @@
1
+ (function(){var g={}; var _ = _ || {}
2
+ var f=function(window){var Gw="clpp.yospace.YospacePlugin",Hw=function(){this.a=null;this.g=new _.K(Gw)},Iw=function(){};_.x(Hw,_.pv);Hw.prototype.Lh=function(){return this.a};
3
+ Hw.prototype.onContentWillLoad=function(a,b){var c=this,d,e,f,g,h;return _.I(function(l){if(1==l.a){d=a.getConfiguration();e=d.yospace;if(!e.enabled)return l["return"]();if(typeof window.YospaceAdManagement!==_.Ue)return c.g.error("Yospace enabled but SDK not found."),a.onError(new _.N(_.P,9,7003,"Yospace SDK not found.")),l["return"]();c.g.info("Yospace enabled.");f=a.isLive()?Jw:Kw;a:{var m=b.url;switch(f){case Kw:m=YospaceAdManagement.SessionVOD.create(m);break a;case Jw:m=YospaceAdManagement.SessionLive.create(m);
4
+ break a;default:m=YospaceAdManagement.SessionDVRLive.create(m)}}return _.y(l,m,2)}g=l.f;h=g.getSessionState();if(h!==YospaceAdManagement.SessionState.INITIALISED)return c.g.error("Failed to initialize Yospace session. State:",h,"URL",b.url),a.onError(new _.N(_.P,9,7003,"Yospace session failed to initialize")),l["return"]();a.trigger(new _.L(_.Xg,{detail:g}));b.url=g.getPlaybackUrl();c.g.info("Yospace session initialized. New URL:",b.url);c.a=g;_.A(l)})};
5
+ Hw.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 _.L(_.Wg,{detail:b}))}};Hw.prototype.id=function(){return"yospace"};_.J(Gw,Hw);Hw.prototype.getSession=Hw.prototype.Lh;Hw.Id="yospace";Iw.prototype.create=function(){return new Hw};_.Qs(new Iw);var Kw=_.kc,Jw="LIVE";};
6
+ if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
7
+ else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
8
+ else{_=this.clpp._;(f.call(g,this));}
9
+ })();
package/cjs/cl.youbora.js CHANGED
@@ -1,24 +1,42 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var Tv='" event to Youbora',Uv='Reporting "',Vv="clpp.npaw.YouboraPlugin",Wv="content.isLive",Xv=function(a){return(a=a.getConfiguration().youbora)&&a.errorFilter?a.errorFilter:function(b){return{code:""+b.code,message:b.message,severity:b.severity}}},Yv=function(a,b,c,d){b=Xv(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===a.code?"ad error":_.ne;b.severity===_.P?(d.fireFatalError(b.code,b.message,b.metadata),c.debug('Reporting "fatal '+a+'" to Youbora',b.code,
3
- b)):(d.fireError(b.code,b.message,b.metadata),c.debug(Uv+a+'" to Youbora',b.code,b));return b},Zv=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.m=c;d.a=new _.Qh;d.g=new _.K("clpp.npaw.YouboraAdapter");d.w=!1;d.h=!1;d.registerListeners();d.B=!1;return d}_.x(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();
4
- if(c&&(c=c.na())){var d=c.width;var e=c.height;var f=c.bandwidth}d&&e&&f||(c=this.l(),d=d||c.width,e=e||c.height,f=f||c.streamBandwidth);return youbora.Util.buildRenditionString(d,e,f)};b.prototype.getIsLive=function(){return this.m.isLive()};b.prototype.getResource=function(){var c=this.m.getLoadedSource();return c&&c.url};b.prototype.getBitrate=function(){return this.l().streamBandwidth};b.prototype.getThroughput=function(){return this.l().estimatedBandwidth};b.prototype.getPlayrate=function(){return this.m.getPlaybackRate()};
5
- b.prototype.getFramesPerSecond=function(){var c=this.m.getTrackManager();return c&&(c=c.Oa())?c.frameRate:null};b.prototype.getPlayerName=function(){return _.va};b.prototype.getVersion=function(){return"6.20.0-castlabsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ja};b.prototype.registerListeners=function(){this.m&&this.a&&(this.g.debug("registering listeners"),youbora.Util.logAllEvents(this.m),this.a.on(this.m,_.cg,this.K.bind(this)),this.a.on(this.m,_.ne,this.H.bind(this)),this.a.on(this.m,
6
- _.xg,this.J.bind(this)),this.a.on(this.m,_.wg,this.I.bind(this)),this.a.on(this.m,_.Nc,this.C.bind(this)),this.a.on(this.m,_.od,this.G.bind(this)))};b.prototype.unregisterListeners=function(){this.g.debug(_.gc);_.Th(this.a)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.B=!0};b.prototype.l=function(){return this.m.getStats()||_.up()};b.prototype.o=function(){return!!this.m.getConfiguration().autoplay};b.prototype.K=function(c){c=c.detail;this.j("state change",c);
7
- if(c)switch(c.currentState){case _.Kp:this.o()&&this.f();break;case _.Mp:this.f();this.A();this.fireResume();this.fireBufferEnd();break;case _.Lp:this.o()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.yp:this.fireBufferEnd();this.fireStop();break;case _.Fp:this.fireBufferEnd();this.w&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.Dp:this.fireBufferBegin();break;default:this.g.debug("Unhandled state",c)}};b.prototype.f=function(){this.plugin.isInitiated||
8
- (this.h=!1,this.fireInit())};b.prototype.A=function(){var c=this.m.getDrmInfo();c&&(c=c.keySystem,(c=c.startsWith(_.Pd)?"Widevine":c.startsWith(_.Kd)?"FairPlay":c.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":c.startsWith(_.bf)?"ClearKey":c.startsWith(_.Jd)?"Primetime":c)&&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=Yv(c,this.m,this.g,this))&&c.severity===_.P&&(this.h=!0)};
9
- b.prototype.J=function(){this.m.isEnded()||(this.j(_.Vf),this.f(),this.fireSeekBegin())};b.prototype.I=function(){this.j(_.Uf);this.fireSeekEnd()};b.prototype.C=function(c){this.g.debug("adsTimeline",c);c=c.adsTimeline;this.w=!!c&&c.Eb()};b.prototype.G=function(c){this.g.debug("Casting",c);this.fireCasted()};b.prototype.j=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.g.debug.apply(this.g,[Uv+c+Tv].concat(_.Zg(e)))};return new b(a)},$v=function(a){function b(c){var d=
10
- youbora.Adapter.call(this,c)||this;d.m=c;d.a=null;d.j=null;d.f=new _.Qh;d.g=new _.K("clpp.npaw.YouboraAdsAdapter");d.registerListeners();d.A=!1;d.l=!1;return d}_.x(b,youbora.Adapter);b.prototype.getDuration=function(){return this.a&&this.a.getDuration()};b.prototype.getRendition=function(){var c=null;this.a&&(c=youbora.Util.buildRenditionString(this.a.ob(),this.a.nb(),this.a.ab()));return c};b.prototype.getBitrate=function(){return this.a&&this.a.ab()};b.prototype.getPlayhead=function(){var c=this.m.getAdsManager();
11
- 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&&this.a.getCreativeId()};b.prototype.getPosition=function(){var c=youbora.Constants.AdPosition,d=null;if(this.a)switch(this.a.Ua()){case 0:d=c.Preroll;break;case 2:d=c.Postroll;break;case 1:d=c.Midroll}this.g.debug("Ad position",
12
- 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.getVolume()};b.prototype.getExpectedBreaks=function(){return this.j&&this.j.getCuePoints().length};b.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};b.prototype.getExpectedAds=function(){return this.a&&this.a.pb()};b.prototype.getGivenAds=function(){return this.getExpectedAds()};b.prototype.getBreaksTime=
13
- 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);this.g.debug("is container visible",c);return c};b.prototype.getPlayerName=function(){return _.va};b.prototype.getVersion=function(){return"6.20.0-castlabsadsadapter-js"};b.prototype.getPlayerVersion=
14
- function(){return _.ja};b.prototype.registerListeners=function(){this.m&&this.f&&(this.f.on(this.m,_.Nc,this.V.bind(this)),this.f.on(this.m,_.Jc,this.P.bind(this)),this.f.on(this.m,_.Fc,this.K.bind(this)),this.f.on(this.m,_.Hc,this.L.bind(this)),this.f.on(this.m,_.yc,this.I.bind(this)),this.f.on(this.m,_.zc,this.o.bind(this,1)),this.f.on(this.m,_.Ec,this.o.bind(this,2)),this.f.on(this.m,_.Lc,this.o.bind(this,3)),this.f.on(this.m,_.xc,this.H.bind(this)),this.f.on(this.m,_.Ic,this.N.bind(this)),this.f.on(this.m,
15
- _.ne,this.J.bind(this)),this.f.on(this.m,_.uc,this.B.bind(this)),this.f.on(this.m,_.vc,this.C.bind(this)),this.f.on(this.m,_.wc,this.G.bind(this)),this.f.on(this.m,_.Gc,this.w.bind(this)))};b.prototype.unregisterListeners=function(){_.Th(this.f)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.A=!0};b.prototype.V=function(c){this.g.debug("ad timeline changed",c);this.j=c.adsTimeline};b.prototype.P=function(c){this.a=c.ad;this.h("ad start",this.a);this.fireStart();
16
- 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("ad buffering started");this.fireBufferBegin()};b.prototype.w=function(){this.l&&(this.h("ad buffering ended"),this.l=!1,this.fireBufferEnd())};b.prototype.o=function(c){this.h("ad quartile",c);this.fireQuartile(c)};b.prototype.H=function(){this.h("ad clicked");
17
- var c=this.a&&this.a.yb();this.g.debug("ad click through url: ",c);this.fireClick(c)};b.prototype.N=function(){this.h("ad skipped");this.fireSkip()};b.prototype.B=function(c){this.a=c.ad;this.h("ad break start",this.a);this.fireBreakStart()};b.prototype.C=function(){this.h("ad break stop");this.fireBreakStop();if(this.getPosition()===youbora.Constants.AdPosition.Postroll){var c=this.plugin.getAdapter();c&&c.fireStop()}};b.prototype.J=function(c){(c=c.detail)&&10003===c.code&&Yv(c,this.m,this.g,this)};
18
- 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,[Uv+c+Tv].concat(_.Zg(e)))};return new b(a)},aw=function(){this.a=null;this.g=new _.K(Vv);this.m=null},bw=function(a,b){if(b.namespace()===_.Ad)return a.g.info("Youbora does not report when casting."),!1;var c=b.getConfiguration().youbora;if(!_.M.Th(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"),
19
- b.onError(new _.N(1,9,9101)),!1;if(_.M.R(window.youbora))return a.g.warn("Youbora SDK not found."),b.onError(new _.N(1,9,9100)),!1;"6.8.59"!==youbora.VERSION&&(a.g.warn("Youbora SDK version is not supported. The supported version is 6.8.59, found version "+(youbora.VERSION+". Some or all features of YouboraPlugin may not work correctly.")),b.onError(new _.N(1,9,9102)));return!0},cw=function(){};_.x(aw,_.ev);_.u=aw.prototype;_.u.rg=function(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(Zv(this.m)),this.a.setAdsAdapter($v(this.m))};_.u.getAdapter=function(){return this.a&&this.a.getAdapter()};_.u.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.u.onPlayerCreated=function(a){this.m=a;bw(this,a)&&(a=a.getConfiguration().youbora,this.rg(new youbora.Plugin(a)))};
20
- _.u.onContentWillLoad=function(a,b){if(bw(this,a)){var c=a.getConfiguration(),d=c.youbora;void 0===d[Wv]&&(d[Wv]=b.isLive);void 0===d["content.title"]&&(d["content.title"]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.rg(new youbora.Plugin(d));this.a.setOptions(d)}};_.u.onPlayerWillRelease=function(){};_.u.onPlayerWillDestroy=function(){};_.u.id=function(){return"youbora"};_.J(Vv,aw);aw.prototype.getAdsAdapter=aw.prototype.getAdsAdapter;aw.prototype.getAdapter=aw.prototype.getAdapter;
21
- aw.prototype.setYouboraPlugin=aw.prototype.rg;aw.Id="youbora";cw.prototype.create=function(){return new aw};_.Fs(new cw);};
2
+ var f=function(window){var dw='" event to NPAW',ew='" event to Youbora',fw='Reporting "',gw="Unhandled state",hw="accountCode key is missing in Youbora config",iw="ad break start",jw="ad buffering ended",kw="ad buffering started",lw="ad click through url: ",mw="ad timeline changed",nw="clpp.npaw.NpawPlugin",ow="clpp.npaw.YouboraPlugin",pw="content.isLive",qw="content.title",rw="is container visible",sw="youbora",tw=function(a){return a.startsWith(_.Pd)?"Widevine":a.startsWith(_.Kd)?"FairPlay":a.match(/^com\.(microsoft|chromecast)\.playready/)?
3
+ "PlayReady":a.startsWith(_.bf)?"ClearKey":a.startsWith(_.Id)?"Primetime":a},uw=function(a){return(a=a.getConfiguration().youbora)&&a.errorFilter?a.errorFilter:function(b){return{code:""+b.code,message:b.message,severity:b.severity}}},vw=function(a,b,c,d){b=uw(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===a.code?"ad error":_.ne;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,
4
+ b.message,b.metadata),c.debug(fw+a+'" to Youbora',b.code,b));return b},ww=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.m=c;d.a=new _.Sh;d.g=new _.K("clpp.npaw.YouboraAdapter");d.o=!1;d.h=!1;d.B=!1;d.registerListeners();return d}_.x(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.ja())){var d=
5
+ c.width;var e=c.height;var f=c.bandwidth}d&&e&&f||(c=this.j(),d=d||c.width,e=e||c.height,f=f||c.streamBandwidth);return youbora.Util.buildRenditionString(d,e,f)};b.prototype.getIsLive=function(){return this.m.isLive()};b.prototype.getResource=function(){var c=this.m.getLoadedSource();return c&&c.url};b.prototype.getBitrate=function(){return this.j().streamBandwidth};b.prototype.getThroughput=function(){return this.j().estimatedBandwidth};b.prototype.getPlayrate=function(){return this.m.getPlaybackRate()};
6
+ b.prototype.getFramesPerSecond=function(){var c=this.m.getTrackManager();return c&&(c=c.Ga())?c.frameRate:null};b.prototype.getPlayerName=function(){return _.va};b.prototype.getVersion=function(){return"6.21.0-castlabsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ja};b.prototype.registerListeners=function(){this.m&&this.a&&(this.g.debug("registering listeners"),youbora.Util.logAllEvents(this.m),this.a.on(this.m,_.cg,this.K.bind(this)),this.a.on(this.m,_.ne,this.H.bind(this)),this.a.on(this.m,
7
+ _.xg,this.J.bind(this)),this.a.on(this.m,_.wg,this.I.bind(this)),this.a.on(this.m,_.Nc,this.C.bind(this)),this.a.on(this.m,_.od,this.G.bind(this)))};b.prototype.unregisterListeners=function(){this.g.debug(_.gc);_.Vh(this.a)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.B=!0};b.prototype.j=function(){return this.m.getStats()||_.Cp()};b.prototype.w=function(){return!!this.m.getConfiguration().autoplay};b.prototype.K=function(c){c=c.detail;this.l("state change",c);
8
+ if(c)switch(c.currentState){case _.Sp:this.w()&&this.f();break;case _.Up:this.f();this.A();this.fireResume();this.fireBufferEnd();break;case _.Tp:this.w()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.Gp:this.fireBufferEnd();this.fireStop();break;case _.Np:this.fireBufferEnd();this.o&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.Lp:this.fireBufferBegin();break;default:this.g.debug(gw,c)}};b.prototype.f=function(){this.plugin.isInitiated||(this.h=
9
+ !1,this.fireInit())};b.prototype.A=function(){var c=this.m.getDrmInfo();c&&(c=tw(c.keySystem))&&this.plugin.setOptions({"content.drm":c});this.fireJoin()};b.prototype.H=function(c){!(c=c.detail)||this.h||10003===c.code&&this.plugin.getAdsAdapter()||(c=vw(c,this.m,this.g,this))&&c.severity===_.P&&(this.h=!0)};b.prototype.J=function(){this.m.isEnded()||(this.l(_.Vf),this.f(),this.fireSeekBegin())};b.prototype.I=function(){this.l(_.Uf);this.fireSeekEnd()};b.prototype.C=function(c){this.g.debug("adsTimeline",
10
+ c);this.o=(c=c.adsTimeline)&&c.Eb()};b.prototype.G=function(c){this.g.debug("Casting",c);this.fireCasted()};b.prototype.l=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.g.debug.apply(this.g,[fw+c+ew].concat(_.ah(e)))};return new b(a)},xw=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 _.Sh;d.g=new _.K("clpp.npaw.YouboraAdsAdapter");d.registerListeners();d.A=!1;d.l=!1;return d}_.x(b,youbora.Adapter);b.prototype.getDuration=
11
+ function(){return this.a&&this.a.getDuration()};b.prototype.getRendition=function(){var c=null;this.a&&(c=youbora.Util.buildRenditionString(this.a.eb(),this.a.cb(),this.a.Pa()));return c};b.prototype.getBitrate=function(){return this.a&&this.a.Pa()};b.prototype.getPlayhead=function(){var c=this.m.getAdsManager();return c&&c.getPosition()};b.prototype.getResource=function(){return this.a&&this.a.getMediaUrl()};b.prototype.getTitle=function(){return this.a&&this.a.getTitle()};b.prototype.getProvider=
12
+ function(){return this.a&&this.a.getAdvertiserName()};b.prototype.getCreativeId=function(){return this.a&&this.a.getCreativeId()};b.prototype.getPosition=function(){var c=youbora.Constants.AdPosition,d=null;if(this.a)switch(this.a.Qa()){case 0:d=c.Preroll;break;case 2:d=c.Postroll;break;case 1:d=c.Midroll}this.g.debug("Ad position",d);return d};b.prototype.getIsSkippable=function(){return this.a&&-1!==this.a.getSkipTimeOffset()};b.prototype.getAudioEnabled=function(){var c=this.m.getAdsManager();
13
+ return c&&0<c.getVolume()};b.prototype.getExpectedBreaks=function(){return this.j&&this.j.getCuePoints().length};b.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};b.prototype.getExpectedAds=function(){return this.a&&this.a.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()};
14
+ b.prototype.getIsVisible=function(){var c=this.m.getSurface().getContainer();c=youbora.Util.calculateAdViewability(c);this.g.debug(rw,c);return c};b.prototype.getPlayerName=function(){return _.va};b.prototype.getVersion=function(){return"6.21.0-castlabsadsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ja};b.prototype.registerListeners=function(){this.m&&this.f&&(this.f.on(this.m,_.Nc,this.V.bind(this)),this.f.on(this.m,_.Jc,this.P.bind(this)),this.f.on(this.m,_.Fc,this.K.bind(this)),
15
+ this.f.on(this.m,_.Hc,this.L.bind(this)),this.f.on(this.m,_.yc,this.I.bind(this)),this.f.on(this.m,_.zc,this.o.bind(this,1)),this.f.on(this.m,_.Ec,this.o.bind(this,2)),this.f.on(this.m,_.Lc,this.o.bind(this,3)),this.f.on(this.m,_.xc,this.H.bind(this)),this.f.on(this.m,_.Ic,this.N.bind(this)),this.f.on(this.m,_.ne,this.J.bind(this)),this.f.on(this.m,_.uc,this.B.bind(this)),this.f.on(this.m,_.vc,this.C.bind(this)),this.f.on(this.m,_.wc,this.G.bind(this)),this.f.on(this.m,_.Gc,this.w.bind(this)))};b.prototype.unregisterListeners=
16
+ function(){_.Vh(this.f)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.A=!0};b.prototype.V=function(c){this.g.debug(mw,c);this.j=c.adsTimeline};b.prototype.P=function(c){this.a=c.ad;this.h("ad start",this.a);this.fireStart();this.fireJoin()};b.prototype.I=function(){this.h("ad ended");this.fireStop()};b.prototype.K=function(){this.h("ad pause");this.w();this.firePause()};b.prototype.L=function(){this.h("ad resume");this.w();this.fireResume()};b.prototype.G=function(){this.l=
17
+ !0;this.h(kw);this.fireBufferBegin()};b.prototype.w=function(){this.l&&(this.h(jw),this.l=!1,this.fireBufferEnd())};b.prototype.o=function(c){this.h("ad quartile",c);this.fireQuartile(c)};b.prototype.H=function(){this.h("ad clicked");var c=this.a&&this.a.pb();this.g.debug(lw,c);this.fireClick(c)};b.prototype.N=function(){this.h("ad skipped");this.fireSkip()};b.prototype.B=function(c){this.a=c.ad;this.h(iw,this.a);this.fireBreakStart()};b.prototype.C=function(){this.h("ad break stop");this.fireBreakStop();
18
+ if(this.getPosition()===youbora.Constants.AdPosition.Postroll){var c=this.plugin.getAdapter();c&&c.fireStop()}};b.prototype.J=function(c){(c=c.detail)&&10003===c.code&&vw(c,this.m,this.g,this)};b.prototype.h=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.g.debug.apply(this.g,[fw+c+ew].concat(_.ah(e)))};return new b(a)},yw=function(){function a(){var b=NpawPluginAdapters.video.Shaka.call(this)||this;b.h=!1;b.f=!1;b.a=null;b.B=!1;return b}_.x(a,NpawPluginAdapters.video.Shaka);
19
+ a.prototype.getPlayhead=function(){return this.getIsLive()?-1:this.player.getPosition()};a.prototype.getDuration=function(){return this.player.getDuration()};a.prototype.getRendition=function(){var b=null,c=null,d=null,e=this.player.getTrackManager();e&&(e=e.ja())&&(b=e.width,c=e.height,d=e.bandwidth);b&&c&&d||(e=this.j(),b=b||e.width,c=c||e.height,d=d||e.streamBandwidth);return this.getNpawUtils().buildRenditionString(b,c,d)};a.prototype.getIsLive=function(){return this.player.isLive()};a.prototype.getResource=
20
+ function(){var b=this.player.getLoadedSource();return b&&b.url};a.prototype.getBitrate=function(){return this.j().streamBandwidth};a.prototype.getThroughput=function(){return this.j().estimatedBandwidth};a.prototype.getPlayrate=function(){return this.player.getPlaybackRate()};a.prototype.getFramesPerSecond=function(){var b=this.player.getTrackManager();return b&&(b=b.Ga())?b.frameRate:null};a.prototype.getPlayerName=function(){return _.va};a.prototype.getVersion=function(){return"castlabs-adapter-6.21.0-js"};
21
+ a.prototype.getPlayerVersion=function(){return _.ja};a.prototype.registerListeners=function(){var b=this.w();this.player&&b&&(b.on(this.player,_.cg,this.K.bind(this)),b.on(this.player,_.ne,this.H.bind(this)),b.on(this.player,_.xg,this.J.bind(this)),b.on(this.player,_.wg,this.I.bind(this)),b.on(this.player,_.Nc,this.C.bind(this)),b.on(this.player,_.od,this.G.bind(this)))};a.prototype.unregisterListeners=function(){yw.g.debug(_.gc);_.Vh(this.w())};a.prototype.dispose=function(){this.unregisterListeners();
22
+ this.B=!0;this.f=this.h=!1;this.a=null};a.prototype.j=function(){return this.player.getStats()||_.Cp()};a.prototype.o=function(){return!!this.player.getConfiguration().autoplay};a.prototype.K=function(b){b=b.detail;this.l("state change",b);if(b)switch(b.currentState){case _.Sp:this.o()&&this.fireInit();break;case _.Up:this.fireInit();this.A();this.fireResume();this.fireBufferEnd();break;case _.Tp:this.o()&&this.fireInit();this.A();this.fireBufferEnd();this.firePause();break;case _.Gp:this.fireBufferEnd();
23
+ this.fireStop();break;case _.Np:this.fireBufferEnd();this.h&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.Lp:this.fireBufferBegin();break;default:yw.g.debug(gw,b)}};a.prototype.A=function(){var b=this.player.getDrmInfo();b&&(b=tw(b.keySystem))&&this.plugin.setAnalyticsOptions({"content.drm":b});this.fireJoin()};a.prototype.H=function(b){(b=b.detail)&&!this.f&&this.player&&10003!==b.code&&(b=vw(b,this.player,yw.g,this))&&b.severity===_.P&&(this.f=!0)};a.prototype.J=function(){this.player.isEnded()||
24
+ (this.l(_.Vf),this.fireInit(),this.fireSeekBegin())};a.prototype.w=function(){this.a||(this.a=new _.Sh);return this.a};a.prototype.I=function(){this.l(_.Uf);this.fireSeekEnd()};a.prototype.C=function(b){yw.g.debug("adsTimeline",b);this.h=(b=b.adsTimeline)&&b.Eb()};a.prototype.G=function(b){yw.g.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];yw.g.debug.apply(yw.g,[fw+b+dw].concat(_.ah(d)))};return new a},zw=function(){function a(){var b=
25
+ NpawPluginAdapters.ads.Ima.call(this)||this;b.a=null;b.h=null;b.j=null;b.B=!1;b.l=!1;return b}_.x(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.Pa()));return b};a.prototype.getBitrate=function(){var b=null;this.a&&(b=this.a.Pa());return b};a.prototype.getPlayhead=function(){var b=null,c=this.player.getAdsManager();
26
+ c&&(b=c.getPosition());return b};a.prototype.getResource=function(){var b=null;this.a&&(b=this.a.getMediaUrl());return b};a.prototype.getTitle=function(){var b=null;this.a&&(b=this.a.getTitle());return b};a.prototype.getProvider=function(){var b=null;this.a&&(b=this.a.getAdvertiserName());return b};a.prototype.getCreativeId=function(){var b=null;this.a&&(b=this.a.getCreativeId());return b};a.prototype.dispose=function(){this.unregisterListeners();this.B=!0;this.j=this.h=this.a=null};a.prototype.getPosition=
27
+ function(){var b=this.getNpawReference().Constants.AdPosition,c=null;if(this.a)switch(this.a.Qa()){case 0:c=b.Preroll;break;case 2:c=b.Postroll;break;case 1:c=b.Midroll}zw.g.debug("Ad position",c);return c};a.prototype.getIsSkippable=function(){return this.a&&-1!==this.a.getSkipTimeOffset()};a.prototype.getAudioEnabled=function(){var b=this.player.getAdsManager();return b&&0<b.getVolume()};a.prototype.getExpectedBreaks=function(){return this.h&&this.h.getCuePoints().length};a.prototype.getGivenBreaks=
28
+ function(){return this.getExpectedBreaks()};a.prototype.getExpectedAds=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);
29
+ zw.g.debug(rw,b);return b};a.prototype.getPlayerName=function(){return _.va};a.prototype.getVersion=function(){return"castlabs-ads-adapter-6.21.0-js"};a.prototype.getPlayerVersion=function(){return _.ja};a.prototype.A=function(){this.j||(this.j=new _.Sh);return this.j};a.prototype.registerListeners=function(){var b=this.A();this.player&&b&&(b.on(this.player,_.Nc,this.Z.bind(this)),b.on(this.player,_.Jc,this.V.bind(this)),b.on(this.player,_.Fc,this.L.bind(this)),b.on(this.player,_.Hc,this.N.bind(this)),
30
+ b.on(this.player,_.yc,this.J.bind(this)),b.on(this.player,_.zc,this.o.bind(this,1)),b.on(this.player,_.Ec,this.o.bind(this,2)),b.on(this.player,_.Lc,this.o.bind(this,3)),b.on(this.player,_.xc,this.I.bind(this)),b.on(this.player,_.Ic,this.P.bind(this)),b.on(this.player,_.ne,this.K.bind(this)),b.on(this.player,_.uc,this.C.bind(this)),b.on(this.player,_.vc,this.G.bind(this)),b.on(this.player,_.wc,this.H.bind(this)),b.on(this.player,_.Gc,this.w.bind(this)))};a.prototype.unregisterListeners=function(){_.Vh(this.A())};
31
+ a.prototype.Z=function(b){zw.g.debug(mw,b);this.h=b.adsTimeline};a.prototype.V=function(b){this.a=b.ad;this.f("ad start",this.a);this.fireStart();this.fireJoin()};a.prototype.J=function(){this.f("ad ended");this.fireStop()};a.prototype.L=function(){this.f("ad pause");this.w();this.firePause()};a.prototype.N=function(){this.f("ad resume");this.w();this.fireResume()};a.prototype.H=function(){this.l=!0;this.f(kw);this.fireBufferBegin()};a.prototype.w=function(){this.l&&(this.f(jw),this.l=!1,this.fireBufferEnd())};
32
+ a.prototype.o=function(b){this.f("ad quartile",b);this.fireQuartile(b)};a.prototype.I=function(){this.f("ad clicked");var b=this.a&&this.a.pb();zw.g.debug(lw,b);this.fireClick(b)};a.prototype.P=function(){this.f("ad skipped");this.fireSkip()};a.prototype.C=function(b){this.a=b.ad;this.f(iw,this.a);this.fireBreakStart()};a.prototype.G=function(){this.f("ad break stop");this.fireBreakStop();this.getPosition()===this.getNpawReference().Constants.AdPosition.Postroll&&this.fireStop()};a.prototype.K=function(b){(b=
33
+ b.detail)&&10003===b.code&&vw(b,this.player,zw.g,this)};a.prototype.f=function(b,c){for(var d=[],e=1;e<arguments.length;++e)d[e-1]=arguments[e];zw.g.debug.apply(zw.g,[fw+b+dw].concat(_.ah(d)))};return new a},Aw=function(){this.a=null;this.g=new _.K(nw);this.m=null},Bw=function(a,b){if(b.namespace()===_.Ad)return a.g.info("NPAW does not report when casting."),!1;var c=b.getConfiguration().youbora;return _.M.Nf(c)?c.accountCode?_.M.R(window.NpawPlugin)||_.M.R(window.NpawPluginAdapters)?(a.g.warn("NPAW SDK not found."),
34
+ b.onError(new _.N(1,9,9100)),!1):!0:(a.g.warn(hw),b.onError(new _.N(1,9,9101)),!1):(a.g.warn("NPAW plugin is loaded but not configured. Will do nothing."),!1)},Cw=function(a){a.a&&(a.g.info("Removing NPAW Plugins",a.a),a.a.removeAdsAdapter(),a.a.removeAdapter())},Dw=function(){this.a=null;this.g=new _.K(ow);this.m=null},Ew=function(a,b){if(b.namespace()===_.Ad)return a.g.info("Youbora does not report when casting."),!1;var c=b.getConfiguration().youbora;if(!_.M.Nf(c))return a.g.debug("Youbora plugin is loaded but not configured. Will do nothing."),
35
+ !1;if(!c.accountCode)return a.g.warn(hw),b.onError(new _.N(1,9,9101)),!1;if(_.M.R(window.youbora))return a.g.warn("Youbora SDK not found."),b.onError(new _.N(1,9,9100)),!1;"6.8.59"!==youbora.VERSION&&(a.g.warn("Youbora SDK version is not supported. The supported version is 6.8.59, found version "+(youbora.VERSION+". Some or all features of YouboraPlugin may not work correctly.")),b.onError(new _.N(1,9,9102)));return!0},Fw=function(){};yw.g=new _.K("clpp.npaw.NpawAdapter");zw.g=new _.K("clpp.npaw.NpawAdsAdapter");_.x(Aw,_.pv);_.u=Aw.prototype;_.u.sg=function(a){Cw(this);if(this.a=a)this.a.registerAdapterFromClass(this.m,yw),this.a.registerAdsAdapterFromClass(this.m,zw)};_.u.getAdapter=function(){return this.a&&this.a.getAdapter()};_.u.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.u.onPlayerCreated=function(a){this.m=a;Bw(this,a)&&(a=a.getConfiguration().youbora,this.sg(new NpawPlugin(a.accountCode)))};
36
+ _.u.onContentWillLoad=function(a,b){if(Bw(this,a)){var c=a.getConfiguration(),d=c.youbora;void 0===d[pw]&&(d[pw]=b.isLive);void 0===d[qw]&&(d[qw]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.sg(new NpawPlugin(d.accountCode));this.a.setAnalyticsOptions(d)}};_.u.onPlayerWillRelease=function(){};_.u.onPlayerWillDestroy=function(){Cw(this);this.a.destroy()};_.u.id=function(){return sw};_.J(nw,Aw);Aw.prototype.getAdsAdapter=Aw.prototype.getAdsAdapter;Aw.prototype.getAdapter=Aw.prototype.getAdapter;
37
+ Aw.prototype.setNpawPlugin=Aw.prototype.sg;Aw.Id=sw;new _.K(nw);_.x(Dw,_.pv);_.u=Dw.prototype;_.u.tg=function(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(ww(this.m)),this.a.setAdsAdapter(xw(this.m))};_.u.getAdapter=function(){return this.a&&this.a.getAdapter()};_.u.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.u.onPlayerCreated=function(a){this.m=a;Ew(this,a)&&(a=a.getConfiguration().youbora,this.tg(new youbora.Plugin(a)))};
38
+ _.u.onContentWillLoad=function(a,b){if(Ew(this,a)){var c=a.getConfiguration(),d=c.youbora;void 0===d[pw]&&(d[pw]=b.isLive);void 0===d[qw]&&(d[qw]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.tg(new youbora.Plugin(d));this.a.setOptions(d)}};_.u.onPlayerWillRelease=function(){};_.u.onPlayerWillDestroy=function(){};_.u.id=function(){return sw};_.J(ow,Dw);Dw.prototype.getAdsAdapter=Dw.prototype.getAdsAdapter;Dw.prototype.getAdapter=Dw.prototype.getAdapter;
39
+ Dw.prototype.setYouboraPlugin=Dw.prototype.tg;Dw.Id=sw;Fw.prototype.create=function(a){return a.youbora&&a.youbora.v7?new Aw:new Dw};_.Qs(new Fw);};
22
40
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
23
41
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
24
42
  else{_=this.clpp._;(f.call(g,this));}
package/cl.adobe.js CHANGED
@@ -1,3 +1,3 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var nV=function(a){a.f=new _.Rs;a.f.on(a.m,_.fg,()=>lV(a));a.f.on(a.m,_.eg,()=>{s.Media.play(a.a,a.m.getPosition())});a.f.on(a.m,_.qe,()=>mV(a));a.f.on(a.m,_.Mf,b=>{b=b.detail;switch(b.currentState){case _.so:a.a.length||mV(a);s.Media.play(a.a,a.m.getPosition());break;case _.ro:case _.ko:lV(a);break;case _.ho:case _.po:case _.oo:a.g.info(`Close session for ${a.a} `+`in player state ${b.currentState}.`),lV(a),s.Media.close(a.a),a.a=""}})},lV=function(a){s.Media.stop(a.a,a.m.getPosition())},
2
- mV=function(a){{const b=a.m.getLoadedSource();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(),_.pa)},oV=class extends _.Ru{constructor(){super();this.m=this.f=null;this.a="";this.g=new _.R("clpp.adobe.AdobePlugin")}onPlayerCreated(a){var b=a.getConfiguration().adobe;(b=!b||!1!==b.enabled)?window.s&&s.Media?(this.m=a,nV(this)):this.g.warn("Adobe API not available."):this.g.debug("Adobe plugin is disabled.")}onPlayerWillDestroy(){this.f&&
3
- (this.f.release(),this.f=null);this.m=null;this.a=""}id(){return"adobe"}};_.x("clpp.adobe.AdobeAnalyticsPlugin",oV);oV.Id="adobe";_.Hq(new class{create(){return new oV}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var WV=function(a){a.f=new _.bt;a.f.on(a.m,_.eg,()=>UV(a));a.f.on(a.m,_.dg,()=>{s.Media.play(a.a,a.m.getPosition())});a.f.on(a.m,_.le,()=>VV(a));a.f.on(a.m,_.Lf,b=>{b=b.detail;switch(b.currentState){case _.zo:a.a.length||VV(a);s.Media.play(a.a,a.m.getPosition());break;case _.yo:case _.ro:UV(a);break;case _.oo:case _.wo:case _.vo:a.g.info(`Close session for ${a.a} `+`in player state ${b.currentState}.`),UV(a),s.Media.close(a.a),a.a=""}})},UV=function(a){s.Media.stop(a.a,a.m.getPosition())},
2
+ VV=function(a){{const b=a.m.getLoadedSource();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(),_.pa)},XV=class extends _.av{constructor(){super();this.m=this.f=null;this.a="";this.g=new _.S("clpp.adobe.AdobePlugin")}onPlayerCreated(a){var b=a.getConfiguration().adobe;(b=!b||!1!==b.enabled)?window.s&&s.Media?(this.m=a,WV(this)):this.g.warn("Adobe API not available."):this.g.debug("Adobe plugin is disabled.")}onPlayerWillDestroy(){this.f&&
3
+ (this.f.release(),this.f=null);this.m=null;this.a=""}id(){return"adobe"}};_.z("clpp.adobe.AdobeAnalyticsPlugin",XV);XV.Id="adobe";_.Qq(new class{create(){return new XV}});};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 kV=class extends _.Ru{constructor(){super();this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.zt(()=>{this.m.play().catch(()=>{})});this.h=new _.Rs}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 _.C(_.yc,{canCast:this.f}))}A(){const a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.xc:_.wc;if(this.l||!this.m.isPaused()||this.m.getState()===_.so)this.l?this.m.play().catch(()=>{}):this.o.fa(.01);this.m.trigger(new _.C(a))}Gb(){return this.j}Rd(){return this.f}Bh(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())}};_.x("clpp.airplay.AirPlayPlugin",kV);kV.prototype.showCastMenu=kV.prototype.Bh;
3
- kV.prototype.canCast=kV.prototype.Rd;kV.prototype.isCasting=kV.prototype.Gb;kV.Id="airplay";_.Hq(new class{create(){return new kV}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var TV=class extends _.av{constructor(){super();this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.Kt(()=>{this.m.play().catch(()=>{})});this.h=new _.bt}onPlayerCreated(a){this.m=a;this.a=a.getSurface().getMedia()}onContentWillLoad(){this.a&&(this.h.on(this.a,"webkitplaybacktargetavailabilitychanged",this.w.bind(this)),this.h.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.A.bind(this)))}onPlayerWillRelease(){this.o.stop();this.h.release()}id(){return"airplay"}w(a){switch(a.availability){case "available":this.f=
2
+ !0;break;case "not-available":this.f=!1}this.m.trigger(new _.E(_.yc,{canCast:this.f}))}A(){const a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.xc:_.wc;if(this.l||!this.m.isPaused()||this.m.getState()===_.zo)this.l?this.m.play().catch(()=>{}):this.o.fa(.01);this.m.trigger(new _.E(a))}Gb(){return this.j}Rd(){return this.f}Fh(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())}};_.z("clpp.airplay.AirPlayPlugin",TV);TV.prototype.showCastMenu=TV.prototype.Fh;
3
+ TV.prototype.canCast=TV.prototype.Rd;TV.prototype.isCasting=TV.prototype.Gb;TV.Id="airplay";_.Qq(new class{create(){return new TV}});};f.call(g, window);
package/cl.broadpeak.js CHANGED
@@ -1,5 +1,5 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var dV=function(){return!window.SmartLib||!window.GenericPlayerApi},eV=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===_.Pf&&a.h.setUUID(b))},gV=function(a,b){b=b.customParameters||{};a.a=a.h.createStreamingSession();a.a.setOption(StreamingSessionOptions.SESSION_PRECACHE,!0);for(const c in b)a.a.setCustomParameter(c,b[c]);a.o.on(a.m,_.Ud,a.T.bind(a));a.l=fV(a.m);
2
- a.a.attachPlayer(a.l)},hV=function(a,b){_.ph(a.o);a.f&&(a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},iV=class{constructor(a,b){this.m=a;this.f=b;this.a=new _.Rs;this.h=!1}init(){const a=this.m,b=this.a;b.on(a,_.Mf,this.o.bind(this));b.on(a,_.Oc,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;a.previousState===_.ko&&c.notifyStallEnd(!b.isPaused());
3
- switch(d){case _.ko:c.notifyStallStart();break;case _.so:this.h?c.notifyResume():(c.notifyFirstImage(),this.h=!0);break;case _.ro:c.notifyPause()}}l(){const a=1E3*this.m.getPosition();this.f.notifySeek(a)}release(){this.a&&(_.ph(this.a),this.a=null)}};var fV=a=>{class b extends GenericPlayerApi{constructor(c){super();this.m=c;this.a=_.Ok()}getPlayerName(){return _.pa}getVersion(){return _.da}getOSName(){return this.a.os}getDeviceVersion(){return this.a.osVersion.name}getDeviceType(){return"browser"}getTotalDuration(){return this.m.isLive()?0:1E3*this.m.getDuration()}getCurrentPosition(){return 1E3*this.m.getPosition()}getCurrentBitrate(){const c=this.m.getStats();return(c?c.streamBandwidth:0)/1E3}}return new b(a)};var jV=class extends _.Ru{constructor(){super();this.l=this.f=this.a=this.h=this.m=null;this.o=new _.Rs;this.j=!1}onPlayerCreated(a){this.m=a}onContentWillLoad(a,b){const c=a.getConfiguration().broadpeak;if(c){if(dV())return a.onError(new _.G(1,9,11E3));this.j=!0;eV(this,c);gV(this,c);return this.a.getURL(b.url).then(d=>{if(d.isError()){const e=d.getDetailedErrorCode();d=d.getDetailedErrorMessage();this.m.onError(new _.G(1,9,11001,{bpkErrorCode:e,message:d}));hV(this,void 0)}else b.url=d.getURL(),
4
- this.f=new iV(this.m,this.l),this.f.init()})}}onContentLoaded(){!1!==this.j&&this.a.precacheEnded()}T(a){a=a.detail;if(7003===a.code)hV(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.E)switch(a.category){case 3:hV(this,SmartLib.BPDecodingError);break;case 1:hV(this,SmartLib.BPNetworkingError);break;case 6:hV(this,SmartLib.BPAccessRightError);break;default:hV(this,SmartLib.BPUnspecifiedError)}}onPlayerWillRelease(){dV()||hV(this,SmartLib.BPSessionEndsNormally);this.j=!1}id(){return"broadpeak"}};
5
- _.x("clpp.broadpeak.BroadpeakPlugin",jV);jV.isSdkMissing=dV;jV.Id="broadpeak";_.Hq(new class{create(){return new jV}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var MV=function(){return!window.SmartLib||!window.GenericPlayerApi},NV=function(a,b){const c=b.analyticsAddress||null,d=b.nanoCDNHost||null,e=b.broadpeakDomainNames||"";b=b.uuid||null;a.h||(a.h=SmartLib.getInstance(),a.h.init(c,d,e),typeof b===_.Of&&a.h.setUUID(b))},PV=function(a,b){b=b.customParameters||{};a.a=a.h.createStreamingSession();a.a.setOption(StreamingSessionOptions.SESSION_PRECACHE,!0);for(const c in b)a.a.setCustomParameter(c,b[c]);a.o.on(a.m,_.r,a.T.bind(a));a.l=OV(a.m);
2
+ a.a.attachPlayer(a.l)},QV=function(a,b){_.qh(a.o);a.f&&(a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},RV=class{constructor(a,b){this.m=a;this.f=b;this.a=new _.bt;this.h=!1}init(){const a=this.m,b=this.a;b.on(a,_.Lf,this.o.bind(this));b.on(a,_.Oc,this.j.bind(this));b.on(a,"seek",this.l.bind(this))}j(a){a=a.detail;typeof a.bandwidth===_.t&&this.f.notifyLayerSwitch(a.bandwidth/1E3)}o(a){const b=this.m,c=this.f;a=a.detail;const d=a.currentState;a.previousState===_.ro&&c.notifyStallEnd(!b.isPaused());
3
+ switch(d){case _.ro:c.notifyStallStart();break;case _.zo:this.h?c.notifyResume():(c.notifyFirstImage(),this.h=!0);break;case _.yo:c.notifyPause()}}l(){const a=1E3*this.m.getPosition();this.f.notifySeek(a)}release(){this.a&&(_.qh(this.a),this.a=null)}};var OV=a=>{class b extends GenericPlayerApi{constructor(c){super();this.m=c;this.a=_.Rk()}getPlayerName(){return _.pa}getVersion(){return _.da}getOSName(){return this.a.os}getDeviceVersion(){return this.a.osVersion.name}getDeviceType(){return"browser"}getTotalDuration(){return this.m.isLive()?0:1E3*this.m.getDuration()}getCurrentPosition(){return 1E3*this.m.getPosition()}getCurrentBitrate(){const c=this.m.getStats();return(c?c.streamBandwidth:0)/1E3}}return new b(a)};var SV=class extends _.av{constructor(){super();this.l=this.f=this.a=this.h=this.m=null;this.o=new _.bt;this.j=!1}onPlayerCreated(a){this.m=a}onContentWillLoad(a,b){const c=a.getConfiguration().broadpeak;if(c){if(MV())return a.onError(new _.I(1,9,11E3));this.j=!0;NV(this,c);PV(this,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}));QV(this,void 0)}else b.url=d.getURL(),
4
+ this.f=new RV(this.m,this.l),this.f.init()})}}onContentLoaded(){!1!==this.j&&this.a.precacheEnded()}T(a){a=a.detail;if(7003===a.code)QV(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.F)switch(a.category){case 3:QV(this,SmartLib.BPDecodingError);break;case 1:QV(this,SmartLib.BPNetworkingError);break;case 6:QV(this,SmartLib.BPAccessRightError);break;default:QV(this,SmartLib.BPUnspecifiedError)}}onPlayerWillRelease(){MV()||QV(this,SmartLib.BPSessionEndsNormally);this.j=!1}id(){return"broadpeak"}};
5
+ _.z("clpp.broadpeak.BroadpeakPlugin",SV);SV.isSdkMissing=MV;SV.Id="broadpeak";_.Qq(new class{create(){return new SV}});};f.call(g, window);