@castlabs/prestoplay 6.18.0 → 6.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/CHANGELOG.md +32 -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 +115 -114
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +581 -577
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +77 -75
  10. package/cjs/cl.externs.js +175 -293
  11. package/cjs/cl.freewheel.js +23 -24
  12. package/cjs/cl.hls.js +70 -71
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +28 -29
  15. package/cjs/cl.ima.js +24 -24
  16. package/cjs/cl.mse.js +313 -314
  17. package/cjs/cl.muxdata.js +15 -15
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +14 -14
  20. package/cjs/cl.playlist.js +6 -6
  21. package/cjs/cl.sessions.js +16 -15
  22. package/cjs/cl.simid.js +15 -15
  23. package/cjs/cl.smooth.js +71 -72
  24. package/cjs/cl.thumbnails.js +26 -26
  25. package/cjs/cl.tizen.js +71 -71
  26. package/cjs/cl.ttml.js +27 -27
  27. package/cjs/cl.verimatrix.js +5 -5
  28. package/cjs/cl.vimond.js +12 -13
  29. package/cjs/cl.vr.js +19 -19
  30. package/cjs/cl.vtt.js +14 -14
  31. package/cjs/cl.youbora.js +18 -18
  32. package/cl.adobe.js +3 -3
  33. package/cl.airplay.js +3 -3
  34. package/cl.broadpeak.js +5 -5
  35. package/cl.cast.js +90 -89
  36. package/cl.conviva.js +27 -27
  37. package/cl.core.js +475 -474
  38. package/cl.crypto.js +9 -9
  39. package/cl.dash.js +72 -71
  40. package/cl.externs.js +172 -294
  41. package/cl.freewheel.js +19 -19
  42. package/cl.hls.js +74 -72
  43. package/cl.hlssmpte.js +5 -5
  44. package/cl.htmlcue.js +25 -26
  45. package/cl.ima.js +17 -17
  46. package/cl.mse.js +277 -274
  47. package/cl.muxdata.js +13 -13
  48. package/cl.onboard.js +4 -4
  49. package/cl.persistent.js +11 -11
  50. package/cl.playlist.js +5 -5
  51. package/cl.sessions.js +10 -10
  52. package/cl.simid.js +13 -13
  53. package/cl.smooth.js +59 -59
  54. package/cl.thumbnails.js +19 -19
  55. package/cl.tizen.js +57 -57
  56. package/cl.ttml.js +22 -22
  57. package/cl.verimatrix.js +4 -4
  58. package/cl.vimond.js +9 -8
  59. package/cl.vr.js +14 -14
  60. package/cl.vtt.js +12 -12
  61. package/cl.youbora.js +15 -15
  62. package/clpp.styles.css +14 -0
  63. package/package.json +1 -1
  64. package/typings.d.ts +379 -384
package/cl.vr.js CHANGED
@@ -1,15 +1,15 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var bv="touchmove",cv="touchstart",ev=function(a,b,c){c*=.5;const d=Math.sqrt(a*a+b*b),e=Math.sin(c);return new dv(a/d*e,b/d*e,0/d*e,Math.cos(c))},fv=function(a,b){const c=a.x,d=a.y,e=a.a;a=a.f;b.set(1-2*(d*d+e*e),2*(c*d-e*a),2*(c*e+d*a),0,2*(c*d+e*a),1-2*(c*c+e*e),2*(d*e-c*a),0,2*(c*e-d*a),2*(d*e+c*a),1-2*(c*c+d*d),0,0,0,0,1)},gv=function(a,b){isFinite(b)?(a.x*=b,a.y*=b,a.a*=b):(a.x=0,a.y=0,a.a=0)},hv=function(a,b){return a.x*b.x+a.y*b.y+a.a*b.a},iv=function(a,b,c){const d=b.x,e=b.y;
2
- b=b.a;const 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},jv=function(a,b,c){b=b.a;c=c.a;const d=a.a;let 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+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},lv=function(a){var b=new kv(0,0,0),c=new kv(0,0,1);const d=new kv,e=new kv,f=new kv;a=a.a;var g=
3
- new kv(0,1,0);f.x=b.x-g.x;f.y=b.y-g.y;f.a=b.a-g.a;g=f.length();gv(f,1/g);c=iv(d,c,f);g=c.length();gv(c,1/g);iv(e,f,d);a[0]=d.x;a[1]=d.y;a[2]=d.a;a[3]=-hv(d,b);a[4]=e.x;a[5]=e.y;a[6]=e.a;a[7]=-hv(e,b);a[8]=f.x;a[9]=f.y;a[10]=f.a;a[11]=-hv(f,b);a[12]=0;a[13]=0;a[14]=0;a[15]=1},mv=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 _.H(1,9,9004,"Unable to compile GL shader: "+
4
- a.a.getShaderInfoLog(b));return b},nv=function(a){a.a&&(a.a.removeEventListener("mousemove",a.A,!1),a.a.removeEventListener(bv,a.A,!1),a.a.removeEventListener("mouseup",a.B,!1),a.a.removeEventListener("touchend",a.B,!1))},ov=function(a){const b=ev(1,0,a.l*Math.PI/180);fv(ev(0,1,a.j*Math.PI/180),a.O);fv(b,a.S);lv(a.Z);jv(a.aa,a.O,a.Z);jv(a.G,a.S,a.aa)},dv=class{constructor(a,b,c,d){this.x=a||0;this.y=b||0;this.a=c||0;this.f=d||1}};var kv=class{constructor(a,b,c){this.x=a||0;this.y=b||0;this.a=c||0}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.a*this.a)}};var pv=class{constructor(){this.a=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}set(a,b,c,d,e,f,g,h,k,l,m,n,q,u,v,y){const 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]=h;B[2]=k;B[6]=l;B[10]=m;B[14]=n;B[3]=q;B[7]=u;B[11]=v;B[15]=y;return this}};var qv=class{constructor(a){this.a=a;this.f=a.createProgram();this.l=mv(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=mv(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");
5
- a.attachShader(this.f,this.l);a.attachShader(this.f,this.j);a.bindAttribLocation(this.f,0,"aPosition");a.bindAttribLocation(this.f,1,"aTexCoord");a.linkProgram(this.f);if(!a.getProgramParameter(this.f,a.LINK_STATUS))throw new _.H(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)}};var rv=class{constructor(a){this.a=a;var b=[];let 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;const g=Math.cos(f);for(c=0;128>=c;c++){const h=c/128,k=(.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(k)*g),b.push(100*Math.sin(k)*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=5*(129*d+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+
6
- 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)}};var sv=class{constructor(a,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)}};var uv={alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!1,devicePixelRatio:1},vv=class extends _.Au{constructor(){super();this.o=this.w=this.K=this.I=this.C=this.X=this.G=this.f=this.a=this.m=null;this.g=new _.R("clpp.vr");this.H=70;this.W=1;this.N=this.L=!1;this.F=()=>{if(this.a&&this.f){this.f.viewport(0,0,this.a.width,this.a.height);{const a=this.K.a,b=Math.tan(.5*this.H*Math.PI/180);a[0]=1/(this.a.width/this.a.height*b);a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1/
7
- b;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=2E3/-1999.9;a[11]=200/-1999.9;a[12]=0;a[13]=0;a[14]=-1;a[15]=1}}};this.l=this.j=0;this.h={x:0,y:0};this.O=new pv;this.S=new pv;this.Z=new pv;this.aa=new pv;this.A=this.ea.bind(this);this.B=this.la.bind(this);this.J=this.ga.bind(this)}onPlayerCreated(a){this.g.info("Player created");this.m=a}onContentWillLoad(a){const b=a.getConfiguration();if(b.vr&&b.vr.enable){{var c=b.vr,d=c.fieldOfView;const e=c.sensitivity,f=c.invertHorizontalControl;c=c.invertVerticalControl;
8
- if(void 0!==d&&_.Xg(d))this.H=d;else throw new _.H(1,7,7100,"fieldOfView configuration must be a number");if(void 0!==e&&_.Xg(e)&&0<e)this.W=e;else throw new _.H(1,7,7100,"sensitivity configuration must be a positive number");this.L=!!f;this.N=!!c}if(a=a.getSurface())if((d=a.getMedia())&&d.tagName.toLowerCase()===_.w){this.g.info("Initialize VR Surface");if(!this.a){this.a=document.createElement("canvas");this.a.style.width="100%";this.f=this.a.getContext("webgl",uv)||this.a.getContext("experimental-webgl",
9
- uv);if(!this.f)throw new _.H(1,9,9003,"Unable to create GL context");this.G=new pv;lv(this.G);this.X=new rv(this.f);this.C=new qv(this.f);this.I=new pv;this.K=new pv;this.o=this.w=null;this.a.addEventListener(_.yf,this.F)}a.addElementToContainer(this.a,!0,!0);a.hideMediaElement();b.vr.attachMouseListener&&(this.a.addEventListener("mousedown",this.J,!1),this.a.addEventListener(cv,this.J,!1));this.F();this.T()}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")}}onPlayerWillRelease(){this.g.info("Releasing VR plugin resources");
10
- 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&&(nv(this),this.a.removeEventListener(_.yf,this.F),this.a.parentElement.removeChild(this.a),this.a.removeEventListener("mousedown",this.J,!1),delete this.a,this.a=null)}onPlayerWillDestroy(){const a=this;return _.x(function*(){a.m=null})}id(){return"vr"}T(){if(this.m&&this.f){var a=this.m.getSurface();if(a&&(a=a.getMedia())&&a.tagName.toLowerCase()===_.w){this.w=requestAnimationFrame(this.T.bind(this));
11
- var b=this.f;this.o||a.readyState!==a.HAVE_ENOUGH_DATA||(this.o=new sv(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,0,0,1);b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT);if(this.o){var c=this.C;c.a.useProgram(c.f);{c=jv(this.I,this.K,this.G).a;let d;d=c[1];c[1]=c[4];c[4]=d;d=c[2];c[2]=
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var gv="touchmove",hv="touchstart",iv=function(a,b){isFinite(b)?(a.x*=b,a.y*=b,a.a*=b):(a.x=0,a.y=0,a.a=0)},jv=function(a,b){return a.x*b.x+a.y*b.y+a.a*b.a},kv=function(a,b,c){const d=b.x,e=b.y;b=b.a;const 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},lv=function(a,b,c){b=b.a;c=c.a;const d=a.a;let 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*
2
+ e+2]*c[10]+b[4*e+3]*c[14],d[4*e+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},nv=function(a){var b=new mv(0,0,0),c=new mv(0,0,1);const d=new mv,e=new mv,f=new mv;a=a.a;var g=new mv(0,1,0);f.x=b.x-g.x;f.y=b.y-g.y;f.a=b.a-g.a;g=f.length();iv(f,1/g);c=kv(d,c,f);g=c.length();iv(c,1/g);kv(e,f,d);a[0]=d.x;a[1]=d.y;a[2]=d.a;a[3]=-jv(d,b);a[4]=e.x;a[5]=e.y;a[6]=e.a;a[7]=-jv(e,b);a[8]=f.x;a[9]=f.y;a[10]=f.a;a[11]=-jv(f,b);a[12]=0;a[13]=0;a[14]=0;a[15]=1},ov=function(a,b,
3
+ 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 _.G(1,9,9004,"Unable to compile GL shader: "+a.a.getShaderInfoLog(b));return b},qv=function(a,b,c){c*=.5;const d=Math.sqrt(a*a+b*b),e=Math.sin(c);return new pv(a/d*e,b/d*e,0/d*e,Math.cos(c))},rv=function(a,b){const c=a.x,d=a.y,e=a.a;a=a.f;b.set(1-2*(d*d+e*e),2*(c*d-e*a),2*(c*e+d*a),0,2*(c*d+e*a),1-2*(c*c+e*e),2*(d*e-c*a),0,2*(c*e-d*a),
4
+ 2*(d*e+c*a),1-2*(c*c+d*d),0,0,0,0,1)},sv=function(a){a.a&&(a.a.removeEventListener("mousemove",a.A,!1),a.a.removeEventListener(gv,a.A,!1),a.a.removeEventListener("mouseup",a.B,!1),a.a.removeEventListener("touchend",a.B,!1))},uv=function(a){const b=qv(1,0,a.l*Math.PI/180);rv(qv(0,1,a.j*Math.PI/180),a.O);rv(b,a.R);nv(a.Y);lv(a.Z,a.O,a.Y);lv(a.G,a.R,a.Z)},mv=class{constructor(a,b,c){this.x=a||0;this.y=b||0;this.a=c||0}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.a*this.a)}};var vv=class{constructor(){this.a=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}set(a,b,c,d,e,f,g,h,k,l,m,n,q,u,v,y){const A=this.a;A[0]=a;A[4]=b;A[8]=c;A[12]=d;A[1]=e;A[5]=f;A[9]=g;A[13]=h;A[2]=k;A[6]=l;A[10]=m;A[14]=n;A[3]=q;A[7]=u;A[11]=v;A[15]=y;return this}};var wv=class{constructor(a){this.a=a;var b=[];let 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;const g=Math.cos(f);for(c=0;128>=c;c++){const h=c/128,k=(.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(k)*g),b.push(100*Math.sin(k)*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=5*(129*d+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+
5
+ 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)}};var xv=class{constructor(a){this.a=a;this.f=a.createProgram();this.l=ov(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=ov(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");
6
+ a.attachShader(this.f,this.l);a.attachShader(this.f,this.j);a.bindAttribLocation(this.f,0,"aPosition");a.bindAttribLocation(this.f,1,"aTexCoord");a.linkProgram(this.f);if(!a.getProgramParameter(this.f,a.LINK_STATUS))throw new _.G(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)}};var yv=class{constructor(a,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)}};var pv=class{constructor(a,b,c,d){this.x=a||0;this.y=b||0;this.a=c||0;this.f=d||1}};var zv={alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!1,devicePixelRatio:1},Av=class extends _.Fu{constructor(){super();this.o=this.w=this.K=this.I=this.C=this.X=this.G=this.f=this.a=this.m=null;this.g=new _.R("clpp.vr");this.H=70;this.V=1;this.M=this.L=!1;this.F=()=>{if(this.a&&this.f){this.f.viewport(0,0,this.a.width,this.a.height);{const a=this.K.a,b=Math.tan(.5*this.H*Math.PI/180);a[0]=1/(this.a.width/this.a.height*b);a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1/
7
+ b;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=2E3/-1999.9;a[11]=200/-1999.9;a[12]=0;a[13]=0;a[14]=-1;a[15]=1}}};this.l=this.j=0;this.h={x:0,y:0};this.O=new vv;this.R=new vv;this.Y=new vv;this.Z=new vv;this.A=this.da.bind(this);this.B=this.ia.bind(this);this.J=this.ba.bind(this)}onPlayerCreated(a){this.g.info("Player created");this.m=a}onContentWillLoad(a){const b=a.getConfiguration();if(b.vr&&b.vr.enable){{var c=b.vr,d=c.fieldOfView;const e=c.sensitivity,f=c.invertHorizontalControl;c=c.invertVerticalControl;
8
+ if(void 0!==d&&_.Yg(d))this.H=d;else throw new _.G(1,7,7100,"fieldOfView configuration must be a number");if(void 0!==e&&_.Yg(e)&&0<e)this.V=e;else throw new _.G(1,7,7100,"sensitivity configuration must be a positive number");this.L=!!f;this.M=!!c}if(a=a.getSurface())if((d=a.getMedia())&&d.tagName.toLowerCase()===_.t){this.g.info("Initialize VR Surface");if(!this.a){this.a=document.createElement("canvas");this.a.style.width="100%";this.f=this.a.getContext("webgl",zv)||this.a.getContext("experimental-webgl",
9
+ zv);if(!this.f)throw new _.G(1,9,9003,"Unable to create GL context");this.G=new vv;nv(this.G);this.X=new wv(this.f);this.C=new xv(this.f);this.I=new vv;this.K=new vv;this.o=this.w=null;this.a.addEventListener(_.xf,this.F)}a.addElementToContainer(this.a,!0,!0);a.hideMediaElement();b.vr.attachMouseListener&&(this.a.addEventListener("mousedown",this.J,!1),this.a.addEventListener(hv,this.J,!1));this.F();this.S()}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")}}onPlayerWillRelease(){this.g.info("Releasing VR plugin resources");
10
+ 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&&(sv(this),this.a.removeEventListener(_.xf,this.F),this.a.parentElement.removeChild(this.a),this.a.removeEventListener("mousedown",this.J,!1),delete this.a,this.a=null)}onPlayerWillDestroy(){const a=this;return _.w(function*(){a.m=null})}id(){return"vr"}S(){if(this.m&&this.f){var a=this.m.getSurface();if(a&&(a=a.getMedia())&&a.tagName.toLowerCase()===_.t){this.w=requestAnimationFrame(this.S.bind(this));
11
+ var b=this.f;this.o||a.readyState!==a.HAVE_ENOUGH_DATA||(this.o=new yv(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,0,0,1);b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT);if(this.o){var c=this.C;c.a.useProgram(c.f);{c=lv(this.I,this.K,this.G).a;let d;d=c[1];c[1]=c[4];c[4]=d;d=c[2];c[2]=
12
12
  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.C.h,!1,this.I.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.X;a.a.bindBuffer(a.a.ARRAY_BUFFER,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,
13
- 0,a.h);a=this.o;a.a.bindTexture(a.a.TEXTURE_2D,null);this.C.a.useProgram(null)}}}}ga(a){this.g.debug("Mouse Down. Enable VR mouse interaction");a.preventDefault();if(0===a.button||a.type===cv)a.type===cv?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.A,!1),this.a.addEventListener(bv,this.A,!1),this.a.addEventListener("mouseup",this.B,!1),this.a.addEventListener("touchend",
14
- this.B,!1)}ea(a){a.preventDefault();var b=a.clientX;let c=a.clientY;a.type===bv&&a.touches[0]&&(b=a.touches[0].clientX,c=a.touches[0].clientY);a=this.h.x-b;const d=this.h.y-c;this.h.x=b;this.h.y=c;b=this.W;const {gg:e,hg:f}={gg:a*b*(this.L?-1:1),hg:d*b*(this.N?-1:1)};this.j+=e;this.l+=f;ov(this)}la(a){this.g.debug("Mouse Up. Removing mouse interaction listeners");a.preventDefault();nv(this)}Zg(a,b){this.l=b;this.j=a;ov(this)}Ag(){return{x:this.j,y:this.l}}nh(a){this.H=a;this.F()}};
15
- _.z("clpp.vr.VrPlugin",vv);vv.prototype.setCameraFieldOfView=vv.prototype.nh;vv.prototype.getCameraCoordinates=vv.prototype.Ag;vv.prototype.moveCamera=vv.prototype.Zg;vv.Id="vr";_.dp(new class{create(){return new vv}});};f.call(g, window);
13
+ 0,a.h);a=this.o;a.a.bindTexture(a.a.TEXTURE_2D,null);this.C.a.useProgram(null)}}}}ba(a){this.g.debug("Mouse Down. Enable VR mouse interaction");a.preventDefault();if(0===a.button||a.type===hv)a.type===hv?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.A,!1),this.a.addEventListener(gv,this.A,!1),this.a.addEventListener("mouseup",this.B,!1),this.a.addEventListener("touchend",
14
+ this.B,!1)}da(a){a.preventDefault();var b=a.clientX;let c=a.clientY;a.type===gv&&a.touches[0]&&(b=a.touches[0].clientX,c=a.touches[0].clientY);a=this.h.x-b;const d=this.h.y-c;this.h.x=b;this.h.y=c;b=this.V;const {jg:e,kg:f}={jg:a*b*(this.L?-1:1),kg:d*b*(this.M?-1:1)};this.j+=e;this.l+=f;uv(this)}ia(a){this.g.debug("Mouse Up. Removing mouse interaction listeners");a.preventDefault();sv(this)}Zg(a,b){this.l=b;this.j=a;uv(this)}Dg(){return{x:this.j,y:this.l}}rh(a){this.H=a;this.F()}};
15
+ _.x("clpp.vr.VrPlugin",Av);Av.prototype.setCameraFieldOfView=Av.prototype.rh;Av.prototype.getCameraCoordinates=Av.prototype.Dg;Av.prototype.moveCamera=Av.prototype.Zg;Av.Id="vr";_.jr(new class{create(){return new Av}});};f.call(g, window);
package/cl.vtt.js CHANGED
@@ -1,12 +1,12 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var Ju=" The setting will be ignored.",Ku="VTT parser encountered an invalid VTT setting: ",Lu="application/x-subrip",Mu="text/srt",Nu='text/vtt; codecs\x3d"vtt"',Ou='text/vtt; codecs\x3d"wvtt"',Pu=function(a){return a.a===a.f.length?null:(a=_.Ji(a,/[^ \t\n]*/gm))?a[0]:null},Qu=function(a){_.Ji(a,/[ \t]+/gm)},Ru=function(a){let 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+/)&&
2
- a[1].match(/\d+:\d+:\d+/)&&(b+=`${a[0].match(/\w+/)}\n`,++c);if(a[c].match(/\d+:\d+:\d+/)){const 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]} --> `,b+=`${d[5]}:${d[6]}:${d[7]}.${d[8]}\n`,++c;else return""}else return"";a[c]&&(b+=`${a[c]}\n\n`);return b},Su=function(a){a=_.Ji(a,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g);if(null==a)return null;const b=Number(a[2]),c=Number(a[3]);return 59<b||59<c?null:Number(a[4])/1E3+
3
- c+60*b+3600*(Number(a[1])||0)},Uu=function(a,b,c){let d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"===b?a.textAlign=_.ws:a.textAlign=_.Cs[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"===d[1]?_.ig:_.jg;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===_.ke||b===_.Mf?_.ke:b===_.me||b===_.Ud?
4
- _.me:_.ad);else if(d=/^region:(.*)$/.exec(b)){if(b=Tu(c,d[1]))a.region=b}else{a:{if(c=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=1,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.Ds[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.ys,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.Ds[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},Tu=function(a,b){a=a.filter(c=>c.id===b);return a.length?a[0]:(_.C("VTT parser could not find a region with id: ",
5
- b," The region will be ignored."),null)},Wu=function(a,b,c){let d,e,f;(new _.Ml).M("payl",_.Hl(g=>{d=_.oi(g)})).M("iden",_.Hl(g=>{e=_.oi(g)})).M("sttg",_.Hl(g=>{f=_.oi(g)})).parse(a);return d?Vu(d,e,f,b,c):null},Vu=function(a,b,c,d,e){a=new _.Bs(d,e,a,_.ug);b&&(a.id=b);if(c)for(b=new _.Ki(c),c=Pu(b);c;)Uu(a,c,[])||_.C(Ku,c,Ju),Qu(b),c=Pu(b);return a},Xu=class{a(a){a=_.oi(a);a=a.replace(/\r+/g,"");a=a.replace(/^\s+|\s+$/g,"");a=a.replace(/<[a-zA-Z\\/][^>]*>/g,"");a=a.split("\n\n");let b="";if(0<a.length){b+=
6
- "WEBVTT\n\n";for(const c of a)b+=Ru(c)}return _.si(b)}},Yu=class{create(){return new Xu}probe(a,b){return(a===Mu||a===Lu)&&b===_.Vf}};var Zu=class{constructor(a){this.a=a}parseInit(){}parseMedia(a,b){a=_.oi(a);a=a.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");var c=a.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(c[0]))throw new _.H(_.F,2,2E3);a=b.periodStart;if(c[0].includes("X-TIMESTAMP-MAP")){var d=c[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),e=c[0].match(/MPEGTS:(\d+)/m);if(d&&e){a=Su(new _.Ki(d[1]));if(null==a)throw new _.H(_.F,2,2E3);e=Number(e[1]);for(d=b.segmentStart;95443.7176888889<=d;)d-=95443.7176888889,e+=
7
- 8589934592;a=b.periodStart+e/9E4-a}}else this.a.streaming.relativeTextTimestamp&&null!==b.segmentStart&&(a=b.segmentStart);b=[];for(var f of c)if(/^region/.test(f.toLowerCase())){e=new _.Ki(f.replace(/\n/g," "));d=new _.Gs;Pu(e);Qu(e);for(var g=Pu(e);g;){a:{var h;var k=d;var l=g;if(h=/^id:(.*)$/.exec(l))k.id=h[1];else if(h=/^width:(\d{1,2}|100)%$/.exec(l))k.width=Number(h[1]);else if(h=/^lines:(\d+)$/.exec(l))k.height=Number(h[1]),k.heightUnits=2;else if(h=/^regionanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(l))k.regionAnchorX=
8
- Number(h[1]),k.regionAnchorY=Number(h[2]);else if(h=/^viewportanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(l))k.viewportAnchorX=Number(h[1]),k.viewportAnchorY=Number(h[2]);else if(/^scroll:up$/.exec(l))k.scroll="up";else{k=!1;break a}k=!0}k||_.C("VTT parser encountered an invalid VTTRegion setting: ",g,Ju);Qu(e);g=Pu(e)}e=d;b.push(e)}f=[];for(var m of c)if(/^style/.test(m.toLowerCase())){e=m.replace(/^style/i,"").replace(/\n/g," ");d=/[^{}]+{[^{}]*}/g;do(g=d.exec(e))&&f.push(g[0]);while(g)}m=[];for(const n of c)if(n.includes("--\x3e")){a:{l=
9
- n.split("\n");h=a;c=b;if(1===l.length&&!l[0]||/^NOTE($|[ \t])/.test(l[0])||"STYLE"===l[0]){c=null;break a}e=null;l[0].includes("--\x3e")||(e=l[0],l.splice(0,1));d=new _.Ki(l[0]);g=Su(d);const q=_.Ji(d,/[ \t]+--\x3e[ \t]+/g);k=Su(d);if(null==g||null==q||null==k)throw new _.H(_.F,2,2001);g+=h;k+=h;l=l.slice(1).join("\n").trim();g=new _.Bs(g,k,l,_.ug);e&&(g.id=e);Qu(d);for(k=Pu(d);k;)Uu(g,k,c)||_.C(Ku,k,Ju),Qu(d),k=Pu(d);null!=e&&(g.id=e);c=g}c&&m.push(c)}return{cues:m,styles:f}}};var $u=class extends Zu{parseMedia(a,b){return super.parseMedia((new Xu).a(a),b)}};var av=class{constructor(){this.a=null;this.g=new _.R("clpp.vtt.mp4")}parseInit(a){let b=!1;(new _.Ml).M(_.Be,_.Fl).M(_.Yf,_.Fl).M(_.we,_.Fl).ca("mdhd",c=>{0===c.version?(c.reader.skip(4),c.reader.skip(4),this.a=_.P(c.reader),c.reader.skip(4)):(c.reader.skip(8),c.reader.skip(8),this.a=_.P(c.reader),c.reader.skip(8));c.reader.skip(4)}).M(_.Ae,_.Fl).M(_.Pf,_.Fl).ca(_.Rf,_.Gl).M("wvtt",()=>{b=!0}).parse(a);if(!this.a)throw new _.H(_.F,2,2008);if(!b)throw new _.H(_.F,2,2008);}parseMedia(a,b){if(!this.a)throw this.g.error("No init segment for MP4+VTT!"),
10
- new _.H(_.F,2,2008);let c=0,d=[],e;const f=[];let g=!1,h=!1,k=!1,l=null;(new _.Ml).M("moof",_.Fl).M("traf",_.Fl).ca("tfdt",q=>{g=!0;c=0===q.version?_.P(q.reader):_.Al(q.reader)}).ca("tfhd",q=>{var u=q.flags;q=q.reader;q.skip(4);u&1&&q.skip(8);u&2&&q.skip(4);l=u&8?_.P(q):null}).ca("trun",q=>{h=!0;{var u=q.version,v=q.flags;q=q.reader;const y=_.P(q);v&1&&q.skip(4);v&4&&q.skip(4);const B=[];for(let D=0;D<y;D++){const M={duration:null,sampleSize:null,Je:null};v&256&&(M.duration=_.P(q));v&512&&(M.sampleSize=
11
- _.P(q));v&1024&&q.skip(4);v&2048&&(M.Je=0===u?_.P(q):_.zl(q));B.push(M)}d=B}}).M(_.ve,_.Hl(q=>{k=!0;e=q})).parse(a);if(!k&&!g&&!h)throw new _.H(_.F,2,2008);a=c;var m=new DataView(e.buffer,e.byteOffset,e.byteLength);m=new _.ym(m,!1);for(const q of d){const u=q.duration||l,v=q.Je?c+q.Je:a;a=v+(u||0);let y=0;do{const B=_.P(m);y+=B;var n=_.P(m);n=_.El(n);let D=null;"vttc"===n?8<B&&(D=_.Cl(m,B-8)):("vtte"!==n&&this.g.error("Unknown box "+n+"! Skipping!"),m.skip(B-8));u?D&&f.push(Wu(D,b.periodStart+v/this.a,
12
- b.periodStart+a/this.a)):this.g.error("WVTT sample duration unknown, and no default found!")}while(q.sampleSize&&y<q.sampleSize)}return{cues:f.filter(_.Ih),styles:[]}}};_.z("clpp.vtt.VttComponent",class extends _.Yt{constructor(){super();this.j=new Yu}f(){_.gs(_.Vf,Zu);_.gs(Nu,Zu);_.gs(Ou,Zu);_.gs(_.Cc,av);_.gs(Mu,$u);_.gs(Lu,$u);_.Dj.push(this.j)}a(){_.is(_.Vf);_.is(Nu);_.is(Ou);_.is(_.Cc);_.is(Mu);_.is(Lu);_.Fj(this.j)}id(){return"subtitles-vtt"}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var Ou=" The setting will be ignored.",Pu="VTT parser encountered an invalid VTT setting: ",Qu="application/x-subrip",Ru="text/srt",Su='text/vtt; codecs\x3d"vtt"',Tu='text/vtt; codecs\x3d"wvtt"',Uu=function(a){return a.a===a.f.length?null:(a=_.Ii(a,/[^ \t\n]*/gm))?a[0]:null},Vu=function(a){_.Ii(a,/[ \t]+/gm)},Wu=function(a){let 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+/)&&
2
+ a[1].match(/\d+:\d+:\d+/)&&(b+=`${a[0].match(/\w+/)}\n`,++c);if(a[c].match(/\d+:\d+:\d+/)){const 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]} --> `,b+=`${d[5]}:${d[6]}:${d[7]}.${d[8]}\n`,++c;else return""}else return"";a[c]&&(b+=`${a[c]}\n\n`);return b},Xu=function(a){a=_.Ii(a,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g);if(null==a)return null;const b=Number(a[2]),c=Number(a[3]);return 59<b||59<c?null:Number(a[4])/1E3+
3
+ c+60*b+3600*(Number(a[1])||0)},Zu=function(a,b,c){let d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"===b?a.textAlign=_.at:a.textAlign=_.gt[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"===d[1]?_.kg:_.lg;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===_.je||b===_.Lf?_.je:b===_.le||b===_.Td?
4
+ _.le:_.cd);else if(d=/^region:(.*)$/.exec(b)){if(b=Yu(c,d[1]))a.region=b}else{a:{if(c=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=1,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.ht[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.ct,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.ht[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},Yu=function(a,b){a=a.filter(c=>c.id===b);return a.length?a[0]:(_.B("VTT parser could not find a region with id: ",
5
+ b," The region will be ignored."),null)},av=function(a,b,c){let d,e,f;(new _.Tl).N("payl",_.Ol(g=>{d=_.ni(g)})).N("iden",_.Ol(g=>{e=_.ni(g)})).N("sttg",_.Ol(g=>{f=_.ni(g)})).parse(a);return d?$u(d,e,f,b,c):null},$u=function(a,b,c,d,e){a=new _.ft(d,e,a,_.vg);b&&(a.id=b);if(c)for(b=new _.Ji(c),c=Uu(b);c;)Zu(a,c,[])||_.B(Pu,c,Ou),Vu(b),c=Uu(b);return a},bv=class{a(a){a=_.ni(a);a=a.replace(/\r+/g,"");a=a.replace(/^\s+|\s+$/g,"");a=a.replace(/<[a-zA-Z\\/][^>]*>/g,"");a=a.split("\n\n");let b="";if(0<a.length){b+=
6
+ "WEBVTT\n\n";for(const c of a)b+=Wu(c)}return _.ri(b)}},cv=class{create(){return new bv}probe(a,b){return(a===Ru||a===Qu)&&b===_.Uf}};var dv=class{constructor(a){this.a=a}parseInit(){}parseMedia(a,b){a=_.ni(a);a=a.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");var c=a.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(c[0]))throw new _.G(_.E,2,2E3);a=b.periodStart;if(c[0].includes("X-TIMESTAMP-MAP")){var d=c[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),e=c[0].match(/MPEGTS:(\d+)/m);if(d&&e){a=Xu(new _.Ji(d[1]));if(null==a)throw new _.G(_.E,2,2E3);e=Number(e[1]);for(d=b.segmentStart;95443.7176888889<=d;)d-=95443.7176888889,e+=
7
+ 8589934592;a=b.periodStart+e/9E4-a}}else this.a.streaming.relativeTextTimestamp&&null!==b.segmentStart&&(a=b.segmentStart);b=[];for(var f of c)if(/^region/.test(f.toLowerCase())){e=new _.Ji(f.replace(/\n/g," "));d=new _.kt;Uu(e);Vu(e);for(var g=Uu(e);g;){a:{var h;var k=d;var l=g;if(h=/^id:(.*)$/.exec(l))k.id=h[1];else if(h=/^width:(\d{1,2}|100)%$/.exec(l))k.width=Number(h[1]);else if(h=/^lines:(\d+)$/.exec(l))k.height=Number(h[1]),k.heightUnits=2;else if(h=/^regionanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(l))k.regionAnchorX=
8
+ Number(h[1]),k.regionAnchorY=Number(h[2]);else if(h=/^viewportanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(l))k.viewportAnchorX=Number(h[1]),k.viewportAnchorY=Number(h[2]);else if(/^scroll:up$/.exec(l))k.scroll="up";else{k=!1;break a}k=!0}k||_.B("VTT parser encountered an invalid VTTRegion setting: ",g,Ou);Vu(e);g=Uu(e)}e=d;b.push(e)}f=[];for(var m of c)if(/^style/.test(m.toLowerCase())){e=m.replace(/^style/i,"").replace(/\n/g," ");d=/[^{}]+{[^{}]*}/g;do(g=d.exec(e))&&f.push(g[0]);while(g)}m=[];for(const n of c)if(n.includes("--\x3e")){a:{l=
9
+ n.split("\n");h=a;c=b;if(1===l.length&&!l[0]||/^NOTE($|[ \t])/.test(l[0])||"STYLE"===l[0]){c=null;break a}e=null;l[0].includes("--\x3e")||(e=l[0],l.splice(0,1));d=new _.Ji(l[0]);g=Xu(d);const q=_.Ii(d,/[ \t]+--\x3e[ \t]+/g);k=Xu(d);if(null==g||null==q||null==k)throw new _.G(_.E,2,2001);g+=h;k+=h;l=l.slice(1).join("\n").trim();g=new _.ft(g,k,l,_.vg);e&&(g.id=e);Vu(d);for(k=Uu(d);k;)Zu(g,k,c)||_.B(Pu,k,Ou),Vu(d),k=Uu(d);null!=e&&(g.id=e);c=g}c&&m.push(c)}return{cues:m,styles:f}}};var ev=class{constructor(){this.a=null;this.g=new _.R("clpp.vtt.mp4")}parseInit(a){let b=!1;(new _.Tl).N(_.Be,_.Ml).N(_.Yf,_.Ml).N(_.we,_.Ml).ca("mdhd",c=>{0===c.version?(c.reader.skip(4),c.reader.skip(4),this.a=_.O(c.reader),c.reader.skip(4)):(c.reader.skip(8),c.reader.skip(8),this.a=_.O(c.reader),c.reader.skip(8));c.reader.skip(4)}).N(_.Ae,_.Ml).N(_.Of,_.Ml).ca(_.Qf,_.Nl).N("wvtt",()=>{b=!0}).parse(a);if(!this.a)throw new _.G(_.E,2,2008);if(!b)throw new _.G(_.E,2,2008);}parseMedia(a,b){if(!this.a)throw this.g.error("No init segment for MP4+VTT!"),
10
+ new _.G(_.E,2,2008);let c=0,d=[],e;const f=[];let g=!1,h=!1,k=!1,l=null;(new _.Tl).N("moof",_.Ml).N("traf",_.Ml).ca("tfdt",q=>{g=!0;c=0===q.version?_.O(q.reader):_.Hl(q.reader)}).ca("tfhd",q=>{var u=q.flags;q=q.reader;q.skip(4);u&1&&q.skip(8);u&2&&q.skip(4);l=u&8?_.O(q):null}).ca("trun",q=>{h=!0;{var u=q.version,v=q.flags;q=q.reader;const y=_.O(q);v&1&&q.skip(4);v&4&&q.skip(4);const A=[];for(let D=0;D<y;D++){const M={duration:null,sampleSize:null,Ke:null};v&256&&(M.duration=_.O(q));v&512&&(M.sampleSize=
11
+ _.O(q));v&1024&&q.skip(4);v&2048&&(M.Ke=0===u?_.O(q):_.Gl(q));A.push(M)}d=A}}).N(_.ve,_.Ol(q=>{k=!0;e=q})).parse(a);if(!k&&!g&&!h)throw new _.G(_.E,2,2008);a=c;var m=new DataView(e.buffer,e.byteOffset,e.byteLength);m=new _.Fm(m,!1);for(const q of d){const u=q.duration||l,v=q.Ke?c+q.Ke:a;a=v+(u||0);let y=0;do{const A=_.O(m);y+=A;var n=_.O(m);n=_.Ll(n);let D=null;"vttc"===n?8<A&&(D=_.Jl(m,A-8)):("vtte"!==n&&this.g.error("Unknown box "+n+"! Skipping!"),m.skip(A-8));u?D&&f.push(av(D,b.periodStart+v/this.a,
12
+ b.periodStart+a/this.a)):this.g.error("WVTT sample duration unknown, and no default found!")}while(q.sampleSize&&y<q.sampleSize)}return{cues:f.filter(_.Gh),styles:[]}}};var fv=class extends dv{parseMedia(a,b){return super.parseMedia((new bv).a(a),b)}};_.x("clpp.vtt.VttComponent",class extends _.su{constructor(){super();this.j=new cv}f(){_.bs(_.Uf,dv);_.bs(Su,dv);_.bs(Tu,dv);_.bs(_.Ec,ev);_.bs(Ru,fv);_.bs(Qu,fv);_.Gj.push(this.j)}a(){_.ds(_.Uf);_.ds(Su);_.ds(Tu);_.ds(_.Ec);_.ds(Ru);_.ds(Qu);_.Ij(this.j)}id(){return"subtitles-vtt"}});};f.call(g, window);
package/cl.youbora.js CHANGED
@@ -1,15 +1,15 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var Bu="clpp.npaw.YouboraPlugin",Cu="content.isLive",Du=function(a,b){if(b.namespace()===_.kd)return a.g.info("Youbora does not report when casting."),!1;const c=b.getConfiguration().youbora;if(!_.Vg(c))return a.g.warn("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 _.H(1,9,9101)),!1;if(_.A(window.youbora))return a.g.warn("Youbora SDK not found."),b.onError(new _.H(1,9,
2
- 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 _.H(1,9,9102)));return!0},Eu=a=>(a=a.getConfiguration().youbora)&&a.errorFilter?a.errorFilter:b=>({code:`${b.code}`,message:b.message,severity:b.severity}),Fu=(a,b,c,d)=>{b=Eu(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===
3
- a.code?"ad error":_.r;b.severity===_.F?(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(`Reporting "${a}" to Youbora`,b.code,b));return b};var Gu=a=>{class b extends youbora.Adapter{constructor(c){super(c);this.m=c;this.a=new _.ts;this.g=new _.R("clpp.npaw.YouboraAdapter");this.h=this.w=!1;this.registerListeners()}getPlayhead(){return this.getIsLive()?-1:this.m.getPosition()}getDuration(){return this.m.getDuration()}getRendition(){let c,d,e;var f=this.m.getTrackManager();f&&(f=f.oa())&&(c=f.width,d=f.height,e=f.bandwidth);c&&d&&e||(f=this.l(),c=c||f.width,d=d||f.height,e=e||f.streamBandwidth);return youbora.Util.buildRenditionString(c,
4
- d,e)}getIsLive(){return this.m.isLive()}getResource(){const c=this.m.getLoadedSource();return c&&c.url}getBitrate(){return this.l().streamBandwidth}getThroughput(){return this.l().estimatedBandwidth}getPlayrate(){return this.m.getPlaybackRate()}getFramesPerSecond(){var c=this.m.getTrackManager();return c&&(c=c.Ja())?c.frameRate:null}getPlayerName(){return _.ra}getVersion(){return"6.18.0-castlabsadapter-js"}getPlayerVersion(){return _.fa}registerListeners(){this.m&&this.a&&(this.g.debug("registering listeners"),
5
- youbora.Util.logAllEvents(this.m),this.a.on(this.m,_.Nf,this.I.bind(this)),this.a.on(this.m,_.r,this.F.bind(this)),this.a.on(this.m,_.gg,this.H.bind(this)),this.a.on(this.m,_.fg,this.G.bind(this)),this.a.on(this.m,_.uc,this.B.bind(this)),this.a.on(this.m,_.Xc,this.C.bind(this)))}unregisterListeners(){this.g.debug(_.Pb);_.ph(this.a)}dispose(){super.dispose()}l(){return this.m.getStats()||_.Jn()}o(){return!!this.m.getConfiguration().autoplay}I(c){c=c.detail;this.j("state change",c);if(c)switch(c.currentState){case _.Xn:this.o()&&
6
- this.f();break;case _.Zn:this.f();this.A();this.fireResume();this.fireBufferEnd();break;case _.Yn:this.o()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.Wn:this.fireBufferEnd();this.fireStop();break;case _.On:this.fireBufferEnd();this.w&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.Rn:this.fireBufferBegin();break;default:this.g.debug("Unhandled state",c)}}f(){this.plugin.isInitiated||(this.h=!1,this.fireInit())}A(){var c=this.m.getDrmInfo();c&&
7
- (c=c.keySystem,(c=c.startsWith(_.zd)?"Widevine":c.startsWith(_.vd)?"FairPlay":c.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":c.startsWith(_.Ne)?"ClearKey":c.startsWith(_.ud)?"Primetime":c)&&this.plugin.setOptions({"content.drm":c}));this.fireJoin()}F(c){!(c=c.detail)||this.h||10003===c.code&&this.plugin.getAdsAdapter()||(c=Fu(c,this.m,this.g,this))&&c.severity===_.F&&(this.h=!0)}H(){this.m.isEnded()||(this.j(_.Ff),this.f(),this.fireSeekBegin())}G(){this.j(_.Ef);this.fireSeekEnd()}B(c){this.g.debug("adsTimeline",
8
- c);c=c.adsTimeline;this.w=!!c&&c.sb()}C(c){this.g.debug("Casting",c);this.fireCasted()}j(c,...d){this.g.debug(`Reporting "${c}" event to Youbora`,...d)}}return new b(a)};var Hu=a=>{class b extends youbora.Adapter{constructor(c){super(c);this.m=c;this.j=this.a=null;this.f=new _.ts;this.g=new _.R("clpp.npaw.YouboraAdsAdapter");this.registerListeners();this.l=!1}getDuration(){return this.a&&this.a.getDuration()}getRendition(){let c=null;this.a&&(c=youbora.Util.buildRenditionString(this.a.Cb(),this.a.Bb(),this.a.qb()));return c}getBitrate(){return this.a&&this.a.qb()}getPlayhead(){const c=this.m.getAdsManager();return c&&c.getPosition()}getResource(){return this.a&&this.a.getMediaUrl()}getTitle(){return this.a&&
9
- this.a.getTitle()}getProvider(){return this.a&&this.a.getAdvertiserName()}getCreativeId(){return this.a&&this.a.getCreativeId()}getPosition(){const c=youbora.Constants.AdPosition;let d=null;if(this.a)switch(this.a.eb()){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}getIsSkippable(){return this.a&&-1!==this.a.getSkipTimeOffset()}getAudioEnabled(){const c=this.m.getAdsManager();return c&&0<c.getVolume()}getExpectedBreaks(){return this.j&&
10
- this.j.getCuePoints().length}getGivenBreaks(){return this.getExpectedBreaks()}getExpectedAds(){return this.a&&this.a.Eb()}getGivenAds(){return this.getExpectedAds()}getBreaksTime(){return this.j&&this.j.getCuePoints().map(c=>-1===c?this.m.getDuration():c)}getIsFullscreen(){return this.m.getSurface().isFullscreen()}getIsVisible(){var c=this.m.getSurface().getContainer();c=youbora.Util.calculateAdViewability(c);this.g.debug("is container visible",c);return c}getPlayerName(){return _.ra}getVersion(){return"6.18.0-castlabsadsadapter-js"}getPlayerVersion(){return _.fa}registerListeners(){this.m&&
11
- this.f&&(this.f.on(this.m,_.uc,this.N.bind(this)),this.f.on(this.m,_.qc,this.L.bind(this)),this.f.on(this.m,_.mc,this.I.bind(this)),this.f.on(this.m,_.oc,this.J.bind(this)),this.f.on(this.m,_.gc,this.G.bind(this)),this.f.on(this.m,_.hc,this.o.bind(this,1)),this.f.on(this.m,_.lc,this.o.bind(this,2)),this.f.on(this.m,_.sc,this.o.bind(this,3)),this.f.on(this.m,_.fc,this.F.bind(this)),this.f.on(this.m,_.pc,this.K.bind(this)),this.f.on(this.m,_.r,this.H.bind(this)),this.f.on(this.m,_.cc,this.A.bind(this)),
12
- this.f.on(this.m,_.dc,this.B.bind(this)),this.f.on(this.m,_.ec,this.C.bind(this)),this.f.on(this.m,_.nc,this.w.bind(this)))}unregisterListeners(){_.ph(this.f)}dispose(){super.dispose()}N(c){this.g.debug("ad timeline changed",c);this.j=c.adsTimeline}L(c){this.a=c.ad;this.h("ad start",this.a);this.fireStart();this.fireJoin()}G(){this.h("ad ended");this.fireStop()}I(){this.h("ad pause");this.w();this.firePause()}J(){this.h("ad resume");this.w();this.fireResume()}C(){this.l=!0;this.h("ad buffering started");
13
- this.fireBufferBegin()}w(){this.l&&(this.h("ad buffering ended"),this.l=!1,this.fireBufferEnd())}o(c){this.h("ad quartile",c);this.fireQuartile(c)}F(){this.h("ad clicked");const c=this.a&&this.a.Qb();this.g.debug("ad click through url: ",c);this.fireClick(c)}K(){this.h("ad skipped");this.fireSkip()}A(c){this.a=c.ad;this.h("ad break start",this.a);this.fireBreakStart()}B(){this.h("ad break stop");this.fireBreakStop();if(this.getPosition()===youbora.Constants.AdPosition.Postroll){const c=this.plugin.getAdapter();
14
- c&&c.fireStop()}}H(c){(c=c.detail)&&10003===c.code&&Fu(c,this.m,this.g,this)}h(c,...d){this.g.debug(`Reporting "${c}" event to Youbora`,...d)}}return new b(a)};var Iu=class extends _.Au{constructor(){super();this.a=null;this.g=new _.R(Bu);this.m=null}Ee(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(Gu(this.m)),this.a.setAdsAdapter(Hu(this.m))}getAdapter(){return this.a&&this.a.getAdapter()}getAdsAdapter(){return this.a&&this.a.getAdsAdapter()}onPlayerCreated(a){this.m=a;Du(this,a)&&(a=a.getConfiguration().youbora,this.Ee(new youbora.Plugin(a)))}onContentWillLoad(a,b){if(Du(this,a)){a=a.getConfiguration();var c=
15
- a.youbora;void 0===c[Cu]&&(c[Cu]=b.isLive);void 0===c["content.title"]&&(c["content.title"]=b.name);void 0===c.viewerId&&(c.viewerId=a.viewerId);this.a||this.Ee(new youbora.Plugin(c));this.a.setOptions(c)}}onPlayerWillRelease(){}onPlayerWillDestroy(){}id(){return"youbora"}};_.z(Bu,Iu);Iu.prototype.getAdsAdapter=Iu.prototype.getAdsAdapter;Iu.prototype.getAdapter=Iu.prototype.getAdapter;Iu.prototype.setYouboraPlugin=Iu.prototype.Ee;Iu.Id="youbora";_.dp(new class{create(){return new Iu}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var Gu="clpp.npaw.YouboraPlugin",Hu="content.isLive",Iu=function(a,b){if(b.namespace()===_.kd)return a.g.info("Youbora does not report when casting."),!1;const c=b.getConfiguration().youbora;if(!_.Wg(c))return a.g.warn("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 _.G(1,9,9101)),!1;if(_.z(window.youbora))return a.g.warn("Youbora SDK not found."),b.onError(new _.G(1,9,
2
+ 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 _.G(1,9,9102)));return!0},Ju=a=>(a=a.getConfiguration().youbora)&&a.errorFilter?a.errorFilter:b=>({code:`${b.code}`,message:b.message,severity:b.severity}),Ku=(a,b,c,d)=>{b=Ju(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===
3
+ a.code?"ad error":_.Vd;b.severity===_.E?(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(`Reporting "${a}" to Youbora`,b.code,b));return b};var Lu=a=>{class b extends youbora.Adapter{constructor(c){super(c);this.m=c;this.a=new _.Fs;this.g=new _.R("clpp.npaw.YouboraAdapter");this.h=this.w=!1;this.registerListeners()}getPlayhead(){return this.getIsLive()?-1:this.m.getPosition()}getDuration(){return this.m.getDuration()}getRendition(){let c,d,e;var f=this.m.getTrackManager();f&&(f=f.ma())&&(c=f.width,d=f.height,e=f.bandwidth);c&&d&&e||(f=this.l(),c=c||f.width,d=d||f.height,e=e||f.streamBandwidth);return youbora.Util.buildRenditionString(c,
4
+ d,e)}getIsLive(){return this.m.isLive()}getResource(){const c=this.m.getLoadedSource();return c&&c.url}getBitrate(){return this.l().streamBandwidth}getThroughput(){return this.l().estimatedBandwidth}getPlayrate(){return this.m.getPlaybackRate()}getFramesPerSecond(){var c=this.m.getTrackManager();return c&&(c=c.La())?c.frameRate:null}getPlayerName(){return _.ra}getVersion(){return"6.19.1-castlabsadapter-js"}getPlayerVersion(){return _.da}registerListeners(){this.m&&this.a&&(this.g.debug("registering listeners"),
5
+ youbora.Util.logAllEvents(this.m),this.a.on(this.m,_.Mf,this.I.bind(this)),this.a.on(this.m,_.Vd,this.F.bind(this)),this.a.on(this.m,_.gg,this.H.bind(this)),this.a.on(this.m,_.fg,this.G.bind(this)),this.a.on(this.m,_.wc,this.B.bind(this)),this.a.on(this.m,_.Zc,this.C.bind(this)))}unregisterListeners(){this.g.debug(_.Pb);_.nh(this.a)}dispose(){super.dispose()}l(){return this.m.getStats()||_.Qn()}o(){return!!this.m.getConfiguration().autoplay}I(c){c=c.detail;this.j("state change",c);if(c)switch(c.currentState){case _.eo:this.o()&&
6
+ this.f();break;case _.go:this.f();this.A();this.fireResume();this.fireBufferEnd();break;case _.fo:this.o()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.co:this.fireBufferEnd();this.fireStop();break;case _.Vn:this.fireBufferEnd();this.w&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.Yn:this.fireBufferBegin();break;default:this.g.debug("Unhandled state",c)}}f(){this.plugin.isInitiated||(this.h=!1,this.fireInit())}A(){var c=this.m.getDrmInfo();c&&
7
+ (c=c.keySystem,(c=c.startsWith(_.yd)?"Widevine":c.startsWith(_.ud)?"FairPlay":c.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":c.startsWith(_.Ne)?"ClearKey":c.startsWith(_.td)?"Primetime":c)&&this.plugin.setOptions({"content.drm":c}));this.fireJoin()}F(c){!(c=c.detail)||this.h||10003===c.code&&this.plugin.getAdsAdapter()||(c=Ku(c,this.m,this.g,this))&&c.severity===_.E&&(this.h=!0)}H(){this.m.isEnded()||(this.j(_.Ef),this.f(),this.fireSeekBegin())}G(){this.j(_.Df);this.fireSeekEnd()}B(c){this.g.debug("adsTimeline",
8
+ c);c=c.adsTimeline;this.w=!!c&&c.Db()}C(c){this.g.debug("Casting",c);this.fireCasted()}j(c,...d){this.g.debug(`Reporting "${c}" event to Youbora`,...d)}}return new b(a)};var Mu=a=>{class b extends youbora.Adapter{constructor(c){super(c);this.m=c;this.j=this.a=null;this.f=new _.Fs;this.g=new _.R("clpp.npaw.YouboraAdsAdapter");this.registerListeners();this.l=!1}getDuration(){return this.a&&this.a.getDuration()}getRendition(){let c=null;this.a&&(c=youbora.Util.buildRenditionString(this.a.lb(),this.a.kb(),this.a.Za()));return c}getBitrate(){return this.a&&this.a.Za()}getPlayhead(){const c=this.m.getAdsManager();return c&&c.getPosition()}getResource(){return this.a&&this.a.getMediaUrl()}getTitle(){return this.a&&
9
+ this.a.getTitle()}getProvider(){return this.a&&this.a.getAdvertiserName()}getCreativeId(){return this.a&&this.a.getCreativeId()}getPosition(){const c=youbora.Constants.AdPosition;let 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",d);return d}getIsSkippable(){return this.a&&-1!==this.a.getSkipTimeOffset()}getAudioEnabled(){const c=this.m.getAdsManager();return c&&0<c.getVolume()}getExpectedBreaks(){return this.j&&
10
+ this.j.getCuePoints().length}getGivenBreaks(){return this.getExpectedBreaks()}getExpectedAds(){return this.a&&this.a.nb()}getGivenAds(){return this.getExpectedAds()}getBreaksTime(){return this.j&&this.j.getCuePoints().map(c=>-1===c?this.m.getDuration():c)}getIsFullscreen(){return this.m.getSurface().isFullscreen()}getIsVisible(){var c=this.m.getSurface().getContainer();c=youbora.Util.calculateAdViewability(c);this.g.debug("is container visible",c);return c}getPlayerName(){return _.ra}getVersion(){return"6.19.1-castlabsadsadapter-js"}getPlayerVersion(){return _.da}registerListeners(){this.m&&
11
+ this.f&&(this.f.on(this.m,_.wc,this.M.bind(this)),this.f.on(this.m,_.sc,this.L.bind(this)),this.f.on(this.m,_.oc,this.I.bind(this)),this.f.on(this.m,_.qc,this.J.bind(this)),this.f.on(this.m,_.gc,this.G.bind(this)),this.f.on(this.m,_.hc,this.o.bind(this,1)),this.f.on(this.m,_.nc,this.o.bind(this,2)),this.f.on(this.m,_.uc,this.o.bind(this,3)),this.f.on(this.m,_.fc,this.F.bind(this)),this.f.on(this.m,_.rc,this.K.bind(this)),this.f.on(this.m,_.Vd,this.H.bind(this)),this.f.on(this.m,_.cc,this.A.bind(this)),
12
+ this.f.on(this.m,_.dc,this.B.bind(this)),this.f.on(this.m,_.ec,this.C.bind(this)),this.f.on(this.m,_.pc,this.w.bind(this)))}unregisterListeners(){_.nh(this.f)}dispose(){super.dispose()}M(c){this.g.debug("ad timeline changed",c);this.j=c.adsTimeline}L(c){this.a=c.ad;this.h("ad start",this.a);this.fireStart();this.fireJoin()}G(){this.h("ad ended");this.fireStop()}I(){this.h("ad pause");this.w();this.firePause()}J(){this.h("ad resume");this.w();this.fireResume()}C(){this.l=!0;this.h("ad buffering started");
13
+ this.fireBufferBegin()}w(){this.l&&(this.h("ad buffering ended"),this.l=!1,this.fireBufferEnd())}o(c){this.h("ad quartile",c);this.fireQuartile(c)}F(){this.h("ad clicked");const c=this.a&&this.a.xb();this.g.debug("ad click through url: ",c);this.fireClick(c)}K(){this.h("ad skipped");this.fireSkip()}A(c){this.a=c.ad;this.h("ad break start",this.a);this.fireBreakStart()}B(){this.h("ad break stop");this.fireBreakStop();if(this.getPosition()===youbora.Constants.AdPosition.Postroll){const c=this.plugin.getAdapter();
14
+ c&&c.fireStop()}}H(c){(c=c.detail)&&10003===c.code&&Ku(c,this.m,this.g,this)}h(c,...d){this.g.debug(`Reporting "${c}" event to Youbora`,...d)}}return new b(a)};var Nu=class extends _.Fu{constructor(){super();this.a=null;this.g=new _.R(Gu);this.m=null}Fe(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(Lu(this.m)),this.a.setAdsAdapter(Mu(this.m))}getAdapter(){return this.a&&this.a.getAdapter()}getAdsAdapter(){return this.a&&this.a.getAdsAdapter()}onPlayerCreated(a){this.m=a;Iu(this,a)&&(a=a.getConfiguration().youbora,this.Fe(new youbora.Plugin(a)))}onContentWillLoad(a,b){if(Iu(this,a)){a=a.getConfiguration();var c=
15
+ a.youbora;void 0===c[Hu]&&(c[Hu]=b.isLive);void 0===c["content.title"]&&(c["content.title"]=b.name);void 0===c.viewerId&&(c.viewerId=a.viewerId);this.a||this.Fe(new youbora.Plugin(c));this.a.setOptions(c)}}onPlayerWillRelease(){}onPlayerWillDestroy(){}id(){return"youbora"}};_.x(Gu,Nu);Nu.prototype.getAdsAdapter=Nu.prototype.getAdsAdapter;Nu.prototype.getAdapter=Nu.prototype.getAdapter;Nu.prototype.setYouboraPlugin=Nu.prototype.Fe;Nu.Id="youbora";_.jr(new class{create(){return new Nu}});};f.call(g, window);
package/clpp.styles.css CHANGED
@@ -150,6 +150,20 @@
150
150
  background-color: rgba(0, 0, 0, 1);
151
151
  }
152
152
 
153
+ .clpp-container .secondary {
154
+ position: absolute;
155
+ width: 100%;
156
+ height: 100%;
157
+ }
158
+ .clpp-container .secondary {
159
+ z-index: 0;
160
+ opacity: 0;
161
+ }
162
+ .clpp-container .secondary {
163
+ z-index: 1;
164
+ opacity: 1;
165
+ }
166
+
153
167
  .clpp-mc-playlist {
154
168
  position: absolute;
155
169
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@castlabs/prestoplay",
3
3
  "description": "PRESTOplay Video Player",
4
- "version": "6.18.0",
4
+ "version": "6.19.1",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/castlabs/prestoplay-web.git"