@castlabs/prestoplay 6.24.0 → 6.25.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 (66) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +7 -7
  5. package/cjs/cl.cast.js +116 -116
  6. package/cjs/cl.conviva.js +32 -32
  7. package/cjs/cl.core.js +596 -597
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +88 -87
  10. package/cjs/cl.externs.js +42 -55
  11. package/cjs/cl.freewheel.js +25 -25
  12. package/cjs/cl.hls.js +77 -73
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +30 -30
  15. package/cjs/cl.ima.js +24 -23
  16. package/cjs/cl.mse.js +346 -341
  17. package/cjs/cl.muxdata.js +15 -15
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +15 -15
  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 +26 -26
  25. package/cjs/cl.tizen.js +72 -72
  26. package/cjs/cl.ttml.js +29 -29
  27. package/cjs/cl.verimatrix.js +5 -5
  28. package/cjs/cl.vimond.js +12 -12
  29. package/cjs/cl.vr.js +19 -19
  30. package/cjs/cl.vtt.js +14 -14
  31. package/cjs/cl.yospace.js +4 -4
  32. package/cjs/cl.youbora.js +31 -31
  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 +84 -84
  37. package/cl.conviva.js +27 -27
  38. package/cl.core.js +473 -474
  39. package/cl.crypto.js +9 -9
  40. package/cl.dash.js +75 -74
  41. package/cl.externs.js +42 -55
  42. package/cl.freewheel.js +15 -15
  43. package/cl.hls.js +79 -75
  44. package/cl.hlssmpte.js +5 -5
  45. package/cl.htmlcue.js +26 -26
  46. package/cl.ima.js +15 -14
  47. package/cl.mse.js +306 -304
  48. package/cl.muxdata.js +13 -13
  49. package/cl.onboard.js +4 -4
  50. package/cl.persistent.js +10 -10
  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 +60 -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 -3
  63. package/cl.youbora.js +26 -26
  64. package/clpp.styles.css +4 -0
  65. package/package.json +1 -1
  66. package/typings.d.ts +19 -26
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 Vw="touchmove",Ww="touchstart",Yw=function(a,b,c){c*=.5;const d=Math.sqrt(a*a+b*b),e=Math.sin(c);return new Xw(a/d*e,b/d*e,0/d*e,Math.cos(c))},Zw=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)},$w=function(a,b){isFinite(b)?(a.x*=b,a.y*=b,a.a*=b):(a.x=0,a.y=0,a.a=0)},ax=function(a,b){return a.x*b.x+a.y*b.y+a.a*b.a},bx=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},cx=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},ex=function(a){var b=new dx(0,0,0),c=new dx(0,0,1);const d=new dx,e=new dx,f=new dx;a=a.a;var g=
3
- new dx(0,1,0);f.x=b.x-g.x;f.y=b.y-g.y;f.a=b.a-g.a;g=f.length();$w(f,1/g);c=bx(d,c,f);g=c.length();$w(c,1/g);bx(e,f,d);a[0]=d.x;a[1]=d.y;a[2]=d.a;a[3]=-ax(d,b);a[4]=e.x;a[5]=e.y;a[6]=e.a;a[7]=-ax(e,b);a[8]=f.x;a[9]=f.y;a[10]=f.a;a[11]=-ax(f,b);a[12]=0;a[13]=0;a[14]=0;a[15]=1},fx=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 _.I(1,9,9004,"Unable to compile GL shader: "+
4
- a.a.getShaderInfoLog(b));return b},gx=function(a){a.a&&(a.a.removeEventListener("mousemove",a.A,!1),a.a.removeEventListener(Vw,a.A,!1),a.a.removeEventListener("mouseup",a.B,!1),a.a.removeEventListener("touchend",a.B,!1))},hx=function(a){const b=Yw(1,0,a.l*Math.PI/180);Zw(Yw(0,1,a.j*Math.PI/180),a.O);Zw(b,a.R);ex(a.Y);cx(a.$,a.O,a.Y);cx(a.G,a.R,a.$)},Xw=class{constructor(a,b,c,d){this.x=a||0;this.y=b||0;this.a=c||0;this.f=d||1}};var dx=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 ix=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 jx=class{constructor(a){this.a=a;this.f=a.createProgram();this.l=fx(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=fx(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 _.I(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 kx=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 lx=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 mx={alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!1,devicePixelRatio:1},nx=class extends _.Xv{constructor(){super();this.o=this.w=this.K=this.I=this.C=this.W=this.G=this.f=this.a=this.m=null;this.g=new _.S("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 ix;this.R=new ix;this.Y=new ix;this.$=new ix;this.A=this.ba.bind(this);this.B=this.ha.bind(this);this.J=this.da.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&&_.sh(d))this.H=d;else throw new _.I(1,7,7100,"fieldOfView configuration must be a number");if(void 0!==e&&_.sh(e)&&0<e)this.V=e;else throw new _.I(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()===_.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",mx)||this.a.getContext("experimental-webgl",
9
- mx);if(!this.f)throw new _.I(1,9,9003,"Unable to create GL context");this.G=new ix;ex(this.G);this.W=new kx(this.f);this.C=new jx(this.f);this.I=new ix;this.K=new ix;this.o=this.w=null;this.a.addEventListener(_.Kf,this.F)}a.addElementToContainer(this.a,!0,!0);a.hideMediaElement();b.vr.attachMouseListener&&(this.a.addEventListener("mousedown",this.J,!1),this.a.addEventListener(Ww,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&&(gx(this),this.a.removeEventListener(_.Kf,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"}S(){if(this.m&&this.f){var a=this.m.getSurface();if(a&&(a=a.getMedia())&&a.tagName.toLowerCase()===_.w){this.w=requestAnimationFrame(this.S.bind(this));
11
- var b=this.f;this.o||a.readyState!==a.HAVE_ENOUGH_DATA||(this.o=new lx(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=cx(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 Xw="touchmove",Yw="touchstart",$w=function(a,b,c){c*=.5;const 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))},ax=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)},bx=function(a,b){isFinite(b)?(a.x*=b,a.y*=b,a.a*=b):(a.x=0,a.y=0,a.a=0)},cx=function(a,b){return a.x*b.x+a.y*b.y+a.a*b.a},dx=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},ex=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},gx=function(a){var b=new fx(0,0,0),c=new fx(0,0,1);const d=new fx,e=new fx,f=new fx;a=a.a;var g=
3
+ new fx(0,1,0);f.x=b.x-g.x;f.y=b.y-g.y;f.a=b.a-g.a;g=f.length();bx(f,1/g);c=dx(d,c,f);g=c.length();bx(c,1/g);dx(e,f,d);a[0]=d.x;a[1]=d.y;a[2]=d.a;a[3]=-cx(d,b);a[4]=e.x;a[5]=e.y;a[6]=e.a;a[7]=-cx(e,b);a[8]=f.x;a[9]=f.y;a[10]=f.a;a[11]=-cx(f,b);a[12]=0;a[13]=0;a[14]=0;a[15]=1},hx=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 _.I(1,9,9004,"Unable to compile GL shader: "+
4
+ a.a.getShaderInfoLog(b));return b},ix=function(a){a.a&&(a.a.removeEventListener("mousemove",a.A,!1),a.a.removeEventListener(Xw,a.A,!1),a.a.removeEventListener("mouseup",a.B,!1),a.a.removeEventListener("touchend",a.B,!1))},jx=function(a){const b=$w(1,0,a.l*Math.PI/180);ax($w(0,1,a.j*Math.PI/180),a.O);ax(b,a.R);gx(a.Y);ex(a.$,a.O,a.Y);ex(a.G,a.R,a.$)},Zw=class{constructor(a,b,c,d){this.x=a||0;this.y=b||0;this.a=c||0;this.f=d||1}};var fx=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 kx=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,r,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]=r;A[7]=u;A[11]=v;A[15]=y;return this}};var lx=class{constructor(a){this.a=a;this.f=a.createProgram();this.l=hx(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=hx(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 _.I(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 mx=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 nx=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 ox={alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!1,devicePixelRatio:1},px=class extends _.Zv{constructor(){super();this.o=this.w=this.K=this.I=this.C=this.W=this.G=this.f=this.a=this.m=null;this.g=new _.S("clpp.vr");this.H=70;this.U=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 kx;this.R=new kx;this.Y=new kx;this.$=new kx;this.A=this.ba.bind(this);this.B=this.ja.bind(this);this.J=this.da.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&&_.th(d))this.H=d;else throw new _.I(1,7,7100,"fieldOfView configuration must be a number");if(void 0!==e&&_.th(e)&&0<e)this.U=e;else throw new _.I(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()===_.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",ox)||this.a.getContext("experimental-webgl",
9
+ ox);if(!this.f)throw new _.I(1,9,9003,"Unable to create GL context");this.G=new kx;gx(this.G);this.W=new mx(this.f);this.C=new lx(this.f);this.I=new kx;this.K=new kx;this.o=this.w=null;this.a.addEventListener(_.Lf,this.F)}a.addElementToContainer(this.a,!0,!0);a.hideMediaElement();b.vr.attachMouseListener&&(this.a.addEventListener("mousedown",this.J,!1),this.a.addEventListener(Yw,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&&(ix(this),this.a.removeEventListener(_.Lf,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"}S(){if(this.m&&this.f){var a=this.m.getSurface();if(a&&(a=a.getMedia())&&a.tagName.toLowerCase()===_.w){this.w=requestAnimationFrame(this.S.bind(this));
11
+ var b=this.f;this.o||a.readyState!==a.HAVE_ENOUGH_DATA||(this.o=new nx(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=ex(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.W;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)}}}}da(a){this.g.debug("Mouse Down. Enable VR mouse interaction");a.preventDefault();if(0===a.button||a.type===Ww)a.type===Ww?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(Vw,this.A,!1),this.a.addEventListener("mouseup",this.B,!1),this.a.addEventListener("touchend",
14
- this.B,!1)}ba(a){a.preventDefault();var b=a.clientX;let c=a.clientY;a.type===Vw&&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 {Ug:e,Vg:f}={Ug:a*b*(this.L?-1:1),Vg:d*b*(this.M?-1:1)};this.j+=e;this.l+=f;hx(this)}ha(a){this.g.debug("Mouse Up. Removing mouse interaction listeners");a.preventDefault();gx(this)}Oh(a,b){this.l=b;this.j=a;hx(this)}rh(){return{x:this.j,y:this.l}}hi(a){this.H=a;this.F()}};
15
- _.z("clpp.vr.VrPlugin",nx);nx.prototype.setCameraFieldOfView=nx.prototype.hi;nx.prototype.getCameraCoordinates=nx.prototype.rh;nx.prototype.moveCamera=nx.prototype.Oh;nx.Id="vr";_.Mr(new class{create(){return new nx}});};f.call(g, window);
13
+ 0,a.h);a=this.o;a.a.bindTexture(a.a.TEXTURE_2D,null);this.C.a.useProgram(null)}}}}da(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.A,!1),this.a.addEventListener(Xw,this.A,!1),this.a.addEventListener("mouseup",this.B,!1),this.a.addEventListener("touchend",
14
+ this.B,!1)}ba(a){a.preventDefault();var b=a.clientX;let c=a.clientY;a.type===Xw&&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.U;const {Ug:e,Vg:f}={Ug:a*b*(this.L?-1:1),Vg:d*b*(this.M?-1:1)};this.j+=e;this.l+=f;jx(this)}ja(a){this.g.debug("Mouse Up. Removing mouse interaction listeners");a.preventDefault();ix(this)}Ph(a,b){this.l=b;this.j=a;jx(this)}rh(){return{x:this.j,y:this.l}}ii(a){this.H=a;this.F()}};
15
+ _.z("clpp.vr.VrPlugin",px);px.prototype.setCameraFieldOfView=px.prototype.ii;px.prototype.getCameraCoordinates=px.prototype.rh;px.prototype.moveCamera=px.prototype.Ph;px.Id="vr";_.Nr(new class{create(){return new px}});};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 Cw=" The setting will be ignored.",Dw="VTT parser encountered an invalid VTT setting: ",Ew="application/x-subrip",Fw="text/srt",Gw='text/vtt; codecs\x3d"vtt"',Hw='text/vtt; codecs\x3d"wvtt"',Iw=function(a){return a.a===a.f.length?null:(a=_.xj(a,/[^ \t\n]*/gm))?a[0]:null},Jw=function(a){_.xj(a,/[ \t]+/gm)},Kw=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},Lw=function(a){a=_.xj(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)},Nw=function(a,b,c){let d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"===b?a.textAlign=_.Ut:a.textAlign=_.$t[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"===d[1]?_.Eg:_.Fg;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===_.we||b===_.Yf?_.we:b===_.Ae||b===_.he?
4
- _.Ae:_.kd);else if(d=/^region:(.*)$/.exec(b)){if(b=Mw(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=_.au[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.Wt,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.au[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},Mw=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)},Pw=function(a,b,c){let d,e,f;(new _.Cm).N("payl",_.xm(g=>{d=_.cj(g)})).N("iden",_.xm(g=>{e=_.cj(g)})).N("sttg",_.xm(g=>{f=_.cj(g)})).parse(a);return d?Ow(d,e,f,b,c):null},Ow=function(a,b,c,d,e){a=new _.Zt(d,e,a,_.Mg);b&&(a.id=b);if(c)for(b=new _.yj(c),c=Iw(b);c;)Nw(a,c,[])||_.C(Dw,c,Cw),Jw(b),c=Iw(b);return a},Qw=class{a(a){a=_.cj(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+=Kw(c)}return _.gj(b)}},Rw=class{create(){return new Qw}probe(a,b){return(a===Fw||a===Ew)&&b===_.gg}};var Sw=class{constructor(a){this.a=a}parseInit(){}parseMedia(a,b){a=_.cj(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 _.I(_.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=Lw(new _.yj(d[1]));if(null==a)throw new _.I(_.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 _.yj(f.replace(/\n/g," "));d=new _.du;Iw(e);Jw(e);for(var g=Iw(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,Cw);Jw(e);g=Iw(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 _.yj(l[0]);g=Lw(d);const q=_.xj(d,/[ \t]+--\x3e[ \t]+/g);k=Lw(d);if(null==g||null==q||null==k)throw new _.I(_.F,2,2001);g+=h;k+=h;l=l.slice(1).join("\n").trim();g=new _.Zt(g,k,l,_.Mg);e&&(g.id=e);Jw(d);for(k=Iw(d);k;)Nw(g,k,c)||_.C(Dw,k,Cw),Jw(d),k=Iw(d);null!=e&&(g.id=e);c=g}c&&m.push(c)}return{cues:m,styles:f}}};var Tw=class extends Sw{parseMedia(a,b){return super.parseMedia((new Qw).a(a),b)}};var Uw=class{constructor(){this.a=null;this.g=new _.S("clpp.vtt.mp4")}parseInit(a){let b=!1;(new _.Cm).N(_.Ne,_.vm).N(_.pg,_.vm).N(_.Ie,_.vm).ea("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)}).N(_.Me,_.vm).N(_.ag,_.vm).ea(_.cg,_.wm).N("wvtt",()=>{b=!0}).parse(a);if(!this.a)throw new _.I(_.F,2,2008);if(!b)throw new _.I(_.F,2,2008);}parseMedia(a,b){if(!this.a)throw this.g.error("No init segment for MP4+VTT!"),
10
- new _.I(_.F,2,2008);let c=0,d=[],e;const f=[];let g=!1,h=!1,k=!1,l=null;(new _.Cm).N("moof",_.vm).N("traf",_.vm).ea("tfdt",q=>{g=!0;c=0===q.version?_.P(q.reader):_.qm(q.reader)}).ea("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}).ea("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 A=[];for(let E=0;E<y;E++){const G={duration:null,sampleSize:null,gf:null};v&256&&(G.duration=_.P(q));v&512&&(G.sampleSize=
11
- _.P(q));v&1024&&q.skip(4);v&2048&&(G.gf=0===u?_.P(q):_.pm(q));A.push(G)}d=A}}).N(_.He,_.xm(q=>{k=!0;e=q})).parse(a);if(!k&&!g&&!h)throw new _.I(_.F,2,2008);a=c;var m=new DataView(e.buffer,e.byteOffset,e.byteLength);m=new _.zn(m,!1);for(const q of d){const u=q.duration||l,v=q.gf?c+q.gf:a;a=v+(u||0);let y=0;do{const A=_.P(m);y+=A;var n=_.P(m);n=_.um(n);let E=null;"vttc"===n?8<A&&(E=_.sm(m,A-8)):("vtte"!==n&&this.g.error("Unknown box "+n+"! Skipping!"),m.skip(A-8));u?E&&f.push(Pw(E,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(_.xi),styles:[]}}};_.z("clpp.vtt.VttComponent",class extends _.Iv{constructor(){super();this.j=new Rw}f(){_.Ct(_.gg,Sw);_.Ct(Gw,Sw);_.Ct(Hw,Sw);_.Ct(_.Mc,Uw);_.Ct(Fw,Tw);_.Ct(Ew,Tw);_.xk.push(this.j)}a(){_.Et(_.gg);_.Et(Gw);_.Et(Hw);_.Et(_.Mc);_.Et(Fw);_.Et(Ew);_.zk(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 Ew=" The setting will be ignored.",Fw="VTT parser encountered an invalid VTT setting: ",Gw="application/x-subrip",Hw="text/srt",Iw='text/vtt; codecs\x3d"vtt"',Jw='text/vtt; codecs\x3d"wvtt"',Kw=function(a){return a.a===a.f.length?null:(a=_.Ti(a,/[^ \t\n]*/gm))?a[0]:null},Lw=function(a){_.Ti(a,/[ \t]+/gm)},Mw=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},Nw=function(a){a=_.Ti(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)},Pw=function(a,b,c){let d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"===b?a.textAlign=_.Vt:a.textAlign=_.au[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"===d[1]?_.Fg:_.Gg;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===_.Ae||b===_.Zf?_.Ae:b===_.Be||b===_.ie?
4
+ _.Be:_.ld);else if(d=/^region:(.*)$/.exec(b)){if(b=Ow(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=_.bu[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.Xt,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.bu[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},Ow=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)},Rw=function(a,b,c){let d,e,f;(new _.Dm).N("payl",_.ym(g=>{d=_.ij(g)})).N("iden",_.ym(g=>{e=_.ij(g)})).N("sttg",_.ym(g=>{f=_.ij(g)})).parse(a);return d?Qw(d,e,f,b,c):null},Qw=function(a,b,c,d,e){a=new _.$t(d,e,a,_.Ng);b&&(a.id=b);if(c)for(b=new _.Ui(c),c=Kw(b);c;)Pw(a,c,[])||_.C(Fw,c,Ew),Lw(b),c=Kw(b);return a},Sw=class{a(a){a=_.ij(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+=Mw(c)}return _.mj(b)}},Tw=class{create(){return new Sw}probe(a,b){return(a===Hw||a===Gw)&&b===_.hg}};var Uw=class{constructor(a){this.a=a}parseInit(){}parseMedia(a,b){a=_.ij(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 _.I(_.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=Nw(new _.Ui(d[1]));if(null==a)throw new _.I(_.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 _.Ui(f.replace(/\n/g," "));d=new _.eu;Kw(e);Lw(e);for(var g=Kw(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,Ew);Lw(e);g=Kw(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 _.Ui(l[0]);g=Nw(d);const r=_.Ti(d,/[ \t]+--\x3e[ \t]+/g);k=Nw(d);if(null==g||null==r||null==k)throw new _.I(_.F,2,2001);g+=h;k+=h;l=l.slice(1).join("\n").trim();g=new _.$t(g,k,l,_.Ng);e&&(g.id=e);Lw(d);for(k=Kw(d);k;)Pw(g,k,c)||_.C(Fw,k,Ew),Lw(d),k=Kw(d);null!=e&&(g.id=e);c=g}c&&m.push(c)}return{cues:m,styles:f}}};var Vw=class extends Uw{parseMedia(a,b){return super.parseMedia((new Sw).a(a),b)}};var Ww=class{constructor(){this.a=null;this.g=new _.S("clpp.vtt.mp4")}parseInit(a){let b=!1;(new _.Dm).N(_.Oe,_.wm).N(_.qg,_.wm).N(_.Je,_.wm).ea("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)}).N(_.Ne,_.wm).N(_.bg,_.wm).ea(_.dg,_.xm).N("wvtt",()=>{b=!0}).parse(a);if(!this.a)throw new _.I(_.F,2,2008);if(!b)throw new _.I(_.F,2,2008);}parseMedia(a,b){if(!this.a)throw this.g.error("No init segment for MP4+VTT!"),
10
+ new _.I(_.F,2,2008);let c=0,d=[],e;const f=[];let g=!1,h=!1,k=!1,l=null;(new _.Dm).N("moof",_.wm).N("traf",_.wm).ea("tfdt",r=>{g=!0;c=0===r.version?_.P(r.reader):_.rm(r.reader)}).ea("tfhd",r=>{var u=r.flags;r=r.reader;r.skip(4);u&1&&r.skip(8);u&2&&r.skip(4);l=u&8?_.P(r):null}).ea("trun",r=>{h=!0;{var u=r.version,v=r.flags;r=r.reader;const y=_.P(r);v&1&&r.skip(4);v&4&&r.skip(4);const A=[];for(let E=0;E<y;E++){const G={duration:null,sampleSize:null,gf:null};v&256&&(G.duration=_.P(r));v&512&&(G.sampleSize=
11
+ _.P(r));v&1024&&r.skip(4);v&2048&&(G.gf=0===u?_.P(r):_.qm(r));A.push(G)}d=A}}).N(_.Ie,_.ym(r=>{k=!0;e=r})).parse(a);if(!k&&!g&&!h)throw new _.I(_.F,2,2008);a=c;var m=new DataView(e.buffer,e.byteOffset,e.byteLength);m=new _.An(m,!1);for(const r of d){const u=r.duration||l,v=r.gf?c+r.gf:a;a=v+(u||0);let y=0;do{const A=_.P(m);y+=A;var n=_.P(m);n=_.vm(n);let E=null;"vttc"===n?8<A&&(E=_.tm(m,A-8)):("vtte"!==n&&this.g.error("Unknown box "+n+"! Skipping!"),m.skip(A-8));u?E&&f.push(Rw(E,b.periodStart+v/this.a,
12
+ b.periodStart+a/this.a)):this.g.error("WVTT sample duration unknown, and no default found!")}while(r.sampleSize&&y<r.sampleSize)}return{cues:f.filter(_.yi),styles:[]}}};_.z("clpp.vtt.VttComponent",class extends _.Kv{constructor(){super();this.j=new Tw}f(){_.Dt(_.hg,Uw);_.Dt(Iw,Uw);_.Dt(Jw,Uw);_.Dt(_.Nc,Ww);_.Dt(Hw,Vw);_.Dt(Gw,Vw);_.rk.push(this.j)}a(){_.Ft(_.hg);_.Ft(Iw);_.Ft(Jw);_.Ft(_.Nc);_.Ft(Hw);_.Ft(Gw);_.tk(this.j)}id(){return"subtitles-vtt"}});};f.call(g, window);
package/cl.yospace.js CHANGED
@@ -1,3 +1,3 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var yw="clpp.yospace.YospacePlugin",Bw=class extends _.Xv{constructor(){super();this.a=null;this.g=new _.S(yw)}Vf(){return this.a}onContentWillLoad(a,b){const c=this;return _.x(function*(){var d=a.getConfiguration().yospace;if(d.enabled){if(typeof window.YospaceAdManagement!==_.Re)throw new _.I(_.F,9,7003,"Yospace SDK not found.");c.g.info("Yospace enabled.");a:{d=d.streamType||zw;var e=b.url;c.g.info("Creating Yospace session for stream type",d);switch(d){case zw:d=YospaceAdManagement.SessionVOD.create(e);
2
- break a;case Aw:d=YospaceAdManagement.SessionLive.create(e);break a;default:d=YospaceAdManagement.SessionDVRLive.create(e)}}d=yield d;e=d.getSessionState();if(e!==YospaceAdManagement.SessionState.INITIALISED)throw c.g.error("Failed to initialize Yospace session. State:",e,"URL",b.url),new _.I(_.F,9,7003,"Yospace session failed to initialize.");a.trigger(new _.D(_.Zg,{detail:d}));b.url=d.getPlaybackUrl();c.g.info("Yospace session initialized. New URL:",b.url);c.a=d}})}onPlayerWillRelease(a){if(this.a){this.g.info("Shutting down Yospace session.");
3
- const b=this.a;this.a.shutdown();this.a=null;a.trigger(new _.D(_.Yg,{detail:b}))}}id(){return"yospace"}};_.z(yw,Bw);Bw.prototype.getSession=Bw.prototype.Vf;Bw.Id="yospace";_.Mr(new class{create(){return new Bw}});var zw=_.Tb,Aw="LIVE";_.z("clpp.yospace.StreamType",{VOD:zw,LIVE:Aw,DVR:"DVR"});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var Aw="clpp.yospace.YospacePlugin",Dw=class extends _.Zv{constructor(){super();this.a=null;this.g=new _.S(Aw)}Vf(){return this.a}onContentWillLoad(a,b){const c=this;return _.x(function*(){var d=a.getConfiguration().yospace;if(d.enabled){if(typeof window.YospaceAdManagement!==_.Se)throw new _.I(_.F,9,7003,"Yospace SDK not found.");c.g.info("Yospace enabled.");a:{d=d.streamType||Bw;var e=b.url;c.g.info("Creating Yospace session for stream type",d);switch(d){case Bw:d=YospaceAdManagement.SessionVOD.create(e);
2
+ break a;case Cw:d=YospaceAdManagement.SessionLive.create(e);break a;default:d=YospaceAdManagement.SessionDVRLive.create(e)}}d=yield d;e=d.getSessionState();if(e!==YospaceAdManagement.SessionState.INITIALISED)throw c.g.error("Failed to initialize Yospace session. State:",e,"URL",b.url),new _.I(_.F,9,7003,"Yospace session failed to initialize.");a.trigger(new _.D(_.$g,{detail:d}));b.url=d.getPlaybackUrl();c.g.info("Yospace session initialized. New URL:",b.url);c.a=d}})}onPlayerWillRelease(a){if(this.a){this.g.info("Shutting down Yospace session.");
3
+ const b=this.a;this.a.shutdown();this.a=null;a.trigger(new _.D(_.Zg,{detail:b}))}}id(){return"yospace"}};_.z(Aw,Dw);Dw.prototype.getSession=Dw.prototype.Vf;Dw.Id="yospace";_.Nr(new class{create(){return new Dw}});var Bw=_.Ub,Cw="LIVE";_.z("clpp.yospace.StreamType",{VOD:Bw,LIVE:Cw,DVR:"DVR"});};f.call(g, window);
package/cl.youbora.js CHANGED
@@ -1,28 +1,28 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var Yv="Unhandled state",Zv="accountCode key is missing in Youbora config",$v="ad break start",aw="ad buffering ended",bw="ad buffering started",cw="ad click through url: ",dw="ad timeline changed",ew="clpp.npaw.NpawPlugin",fw="clpp.npaw.YouboraPlugin",gw="content.isLive",hw="content.title",iw="is container visible",jw="youbora",kw=function(a){return a.startsWith(_.Jd)?"Widevine":a.startsWith(_.Dd)?"FairPlay":a.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":a.startsWith(_.$e)?
2
- "ClearKey":a.startsWith(_.Cd)?"Primetime":a},lw=function(a){a.a&&(a.g.info("Removing NPAW Plugins",a.a),a.a.removeAdsAdapter(),a.a.removeAdapter())},mw=function(a,b){if(b.namespace()===_.td)return a.g.info("NPAW does not report when casting."),!1;const c=b.getConfiguration().youbora;return _.qh(c)?c.accountCode?_.B(window.NpawPlugin)||_.B(window.NpawPluginAdapters)?(a.g.warn("NPAW SDK not found."),b.onError(new _.I(1,9,9100)),!1):!0:(a.g.warn(Zv),b.onError(new _.I(1,9,9101)),!1):(a.g.warn("NPAW plugin is loaded but not configured. Will do nothing."),
3
- !1)},nw=function(a,b){if(b.namespace()===_.td)return a.g.info("Youbora does not report when casting."),!1;const c=b.getConfiguration().youbora;if(!_.qh(c))return a.g.debug("Youbora plugin is loaded but not configured. Will do nothing."),!1;if(!c.accountCode)return a.g.warn(Zv),b.onError(new _.I(1,9,9101)),!1;if(_.B(window.youbora))return a.g.warn("Youbora SDK not found."),b.onError(new _.I(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 "+
4
- `version ${youbora.VERSION}. Some or all features of YouboraPlugin `+"may not work correctly."),b.onError(new _.I(1,9,9102)));return!0},ow=a=>(a=a.getConfiguration().youbora)&&a.errorFilter?a.errorFilter:b=>({code:`${b.code}`,message:b.message,severity:b.severity}),pw=(a,b,c,d)=>{b=ow(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===a.code?"ad error":_.r;b.severity===_.F?(d.fireFatalError(b.code,b.message,b.metadata),c.debug(`Reporting "fatal ${a}" to Youbora`,
5
- b.code,b)):(d.fireError(b.code,b.message,b.metadata),c.debug(`Reporting "${a}" to Youbora`,b.code,b));return b};var qw=a=>{class b extends youbora.Adapter{constructor(c){super(c);this.m=c;this.a=new _.Rt;this.g=new _.S("clpp.npaw.YouboraAdapter");this.h=this.o=!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.j(),c=c||f.width,d=d||f.height,e=e||f.streamBandwidth);return youbora.Util.buildRenditionString(c,
6
- d,e)}getIsLive(){return this.m.isLive()}getResource(){const c=this.m.getLoadedSource();return c&&c.url}getBitrate(){return this.j().streamBandwidth}getThroughput(){return this.j().estimatedBandwidth}getPlayrate(){return this.m.getPlaybackRate()}getFramesPerSecond(){var c=this.m.getTrackManager();return c&&(c=c.Ia())?c.frameRate:null}getPlayerName(){return _.qa}getVersion(){return"6.24.0-castlabsadapter-js"}getPlayerVersion(){return _.ea}registerListeners(){this.m&&this.a&&(this.g.debug("registering listeners"),
7
- youbora.Util.logAllEvents(this.m),this.a.on(this.m,_.Zf,this.I.bind(this)),this.a.on(this.m,_.r,this.F.bind(this)),this.a.on(this.m,_.Bg,this.H.bind(this)),this.a.on(this.m,_.Ag,this.G.bind(this)),this.a.on(this.m,_.Ec,this.B.bind(this)),this.a.on(this.m,_.ed,this.C.bind(this)))}unregisterListeners(){this.g.debug(_.Ob);_.Sh(this.a)}dispose(){super.dispose()}j(){return this.m.getStats()||_.Wo()}w(){return!!this.m.getConfiguration().autoplay}I(c){c=c.detail;this.l("state change",c);if(c)switch(c.currentState){case _.hp:this.w()&&
8
- this.f();break;case _.jp:this.f();this.A();this.fireResume();this.fireBufferEnd();break;case _.ip:this.w()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.gp:this.fireBufferEnd();this.fireStop();break;case _.Zo:this.fireBufferEnd();this.o&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.cp:this.fireBufferBegin();break;default:this.g.debug(Yv,c)}}f(){this.plugin.isInitiated||(this.h=!1,this.fireInit())}A(){var c=this.m.getDrmInfo();c&&(c=kw(c.keySystem))&&
9
- this.plugin.setOptions({"content.drm":c});this.fireJoin()}F(c){!(c=c.detail)||this.h||10003===c.code&&this.plugin.getAdsAdapter()||(c=pw(c,this.m,this.g,this))&&c.severity===_.F&&(this.h=!0)}H(){this.m.isEnded()||(this.l(_.Rf),this.f(),this.fireSeekBegin())}G(){this.l(_.Qf);this.fireSeekEnd()}B(c){this.g.debug("adsTimeline",c);this.o=(c=c.adsTimeline)&&c.Kb()}C(c){this.g.debug("Casting",c);this.fireCasted()}l(c,...d){this.g.debug(`Reporting "${c}" event to Youbora`,...d)}}return new b(a)};var rw=a=>{class b extends youbora.Adapter{constructor(c){super(c);this.m=c;this.j=this.a=null;this.f=new _.Rt;this.g=new _.S("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.ib(),this.a.hb(),this.a.Ta()));return c}getBitrate(){return this.a&&this.a.Ta()}getPlayhead(){const c=this.m.getAdsManager();return c&&c.getPosition()}getResource(){return this.a&&this.a.getMediaUrl()}getTitle(){return this.a&&
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var $v="Unhandled state",aw="accountCode key is missing in Youbora config",bw="ad break start",cw="ad buffering ended",dw="ad buffering started",ew="ad click through url: ",fw="ad timeline changed",gw="clpp.npaw.NpawPlugin",hw="clpp.npaw.YouboraPlugin",iw="content.isLive",jw="content.title",kw="is container visible",lw="youbora",mw=function(a){return a.startsWith(_.Jd)?"Widevine":a.startsWith(_.Ed)?"FairPlay":a.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":a.startsWith(_.af)?
2
+ "ClearKey":a.startsWith(_.Dd)?"Primetime":a},nw=function(a){a.a&&(a.g.info("Removing NPAW Plugins",a.a),a.a.removeAdsAdapter(),a.a.removeAdapter())},ow=function(a,b){if(b.namespace()===_.ud)return a.g.info("NPAW does not report when casting."),!1;const c=b.getConfiguration().youbora;return _.rh(c)?c.accountCode?_.B(window.NpawPlugin)||_.B(window.NpawPluginAdapters)?(a.g.warn("NPAW SDK not found."),b.onError(new _.I(1,9,9100)),!1):!0:(a.g.warn(aw),b.onError(new _.I(1,9,9101)),!1):(a.g.warn("NPAW plugin is loaded but not configured. Will do nothing."),
3
+ !1)},pw=function(a,b){if(b.namespace()===_.ud)return a.g.info("Youbora does not report when casting."),!1;const c=b.getConfiguration().youbora;if(!_.rh(c))return a.g.debug("Youbora plugin is loaded but not configured. Will do nothing."),!1;if(!c.accountCode)return a.g.warn(aw),b.onError(new _.I(1,9,9101)),!1;if(_.B(window.youbora))return a.g.warn("Youbora SDK not found."),b.onError(new _.I(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 "+
4
+ `version ${youbora.VERSION}. Some or all features of YouboraPlugin `+"may not work correctly."),b.onError(new _.I(1,9,9102)));return!0},qw=a=>(a=a.getConfiguration().youbora)&&a.errorFilter?a.errorFilter:b=>({code:`${b.code}`,message:b.message,severity:b.severity}),rw=(a,b,c,d)=>{b=qw(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===a.code?"ad error":_.q;b.severity===_.F?(d.fireFatalError(b.code,b.message,b.metadata),c.debug(`Reporting "fatal ${a}" to Youbora`,
5
+ b.code,b)):(d.fireError(b.code,b.message,b.metadata),c.debug(`Reporting "${a}" to Youbora`,b.code,b));return b};var sw=a=>{class b extends youbora.Adapter{constructor(c){super(c);this.m=c;this.a=new _.St;this.g=new _.S("clpp.npaw.YouboraAdapter");this.h=this.o=!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.j(),c=c||f.width,d=d||f.height,e=e||f.streamBandwidth);return youbora.Util.buildRenditionString(c,
6
+ d,e)}getIsLive(){return this.m.isLive()}getResource(){const c=this.m.getLoadedSource();return c&&c.url}getBitrate(){return this.j().streamBandwidth}getThroughput(){return this.j().estimatedBandwidth}getPlayrate(){return this.m.getPlaybackRate()}getFramesPerSecond(){var c=this.m.getTrackManager();return c&&(c=c.Ia())?c.frameRate:null}getPlayerName(){return _.qa}getVersion(){return"6.25.1-castlabsadapter-js"}getPlayerVersion(){return _.ea}registerListeners(){this.m&&this.a&&(this.g.debug("registering listeners"),
7
+ youbora.Util.logAllEvents(this.m),this.a.on(this.m,_.$f,this.I.bind(this)),this.a.on(this.m,_.q,this.F.bind(this)),this.a.on(this.m,_.Cg,this.H.bind(this)),this.a.on(this.m,_.Bg,this.G.bind(this)),this.a.on(this.m,_.Fc,this.B.bind(this)),this.a.on(this.m,_.fd,this.C.bind(this)))}unregisterListeners(){this.g.debug(_.Pb);_.Th(this.a)}dispose(){super.dispose()}j(){return this.m.getStats()||_.Xo()}w(){return!!this.m.getConfiguration().autoplay}I(c){c=c.detail;this.l("state change",c);if(c)switch(c.currentState){case _.ip:this.w()&&
8
+ this.f();break;case _.kp:this.f();this.A();this.fireResume();this.fireBufferEnd();break;case _.jp:this.w()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.hp:this.fireBufferEnd();this.fireStop();break;case _.$o:this.fireBufferEnd();this.o&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.dp:this.fireBufferBegin();break;default:this.g.debug($v,c)}}f(){this.plugin.isInitiated||(this.h=!1,this.fireInit())}A(){var c=this.m.getDrmInfo();c&&(c=mw(c.keySystem))&&
9
+ this.plugin.setOptions({"content.drm":c});this.fireJoin()}F(c){!(c=c.detail)||this.h||10003===c.code&&this.plugin.getAdsAdapter()||(c=rw(c,this.m,this.g,this))&&c.severity===_.F&&(this.h=!0)}H(){this.m.isEnded()||(this.l(_.Sf),this.f(),this.fireSeekBegin())}G(){this.l(_.Rf);this.fireSeekEnd()}B(c){this.g.debug("adsTimeline",c);this.o=(c=c.adsTimeline)&&c.Kb()}C(c){this.g.debug("Casting",c);this.fireCasted()}l(c,...d){this.g.debug(`Reporting "${c}" event to Youbora`,...d)}}return new b(a)};var tw=a=>{class b extends youbora.Adapter{constructor(c){super(c);this.m=c;this.j=this.a=null;this.f=new _.St;this.g=new _.S("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.ib(),this.a.hb(),this.a.Ta()));return c}getBitrate(){return this.a&&this.a.Ta()}getPlayhead(){const c=this.m.getAdsManager();return c&&c.getPosition()}getResource(){return this.a&&this.a.getMediaUrl()}getTitle(){return this.a&&
10
10
  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&&
11
- this.j.getCuePoints().length}getGivenBreaks(){return this.getExpectedBreaks()}getExpectedAds(){return this.a&&this.a.jb()}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(iw,c);return c}getPlayerName(){return _.qa}getVersion(){return"6.24.0-castlabsadsadapter-js"}getPlayerVersion(){return _.ea}registerListeners(){this.m&&
12
- this.f&&(this.f.on(this.m,_.Ec,this.M.bind(this)),this.f.on(this.m,_.yc,this.L.bind(this)),this.f.on(this.m,_.tc,this.I.bind(this)),this.f.on(this.m,_.vc,this.J.bind(this)),this.f.on(this.m,_.lc,this.G.bind(this)),this.f.on(this.m,_.mc,this.o.bind(this,1)),this.f.on(this.m,_.sc,this.o.bind(this,2)),this.f.on(this.m,_.Cc,this.o.bind(this,3)),this.f.on(this.m,_.kc,this.F.bind(this)),this.f.on(this.m,_.xc,this.K.bind(this)),this.f.on(this.m,_.r,this.H.bind(this)),this.f.on(this.m,_.hc,this.A.bind(this)),
13
- this.f.on(this.m,_.ic,this.B.bind(this)),this.f.on(this.m,_.jc,this.C.bind(this)),this.f.on(this.m,_.uc,this.w.bind(this)))}unregisterListeners(){_.Sh(this.f)}dispose(){super.dispose()}M(c){this.g.debug(dw,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(bw);this.fireBufferBegin()}w(){this.l&&
14
- (this.h(aw),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.ub();this.g.debug(cw,c);this.fireClick(c)}K(){this.h("ad skipped");this.fireSkip()}A(c){this.a=c.ad;this.h($v,this.a);this.fireBreakStart()}B(){this.h("ad break stop");this.fireBreakStop();if(this.getPosition()===youbora.Constants.AdPosition.Postroll){const c=this.plugin.getAdapter();c&&c.fireStop()}}H(c){(c=c.detail)&&10003===c.code&&pw(c,this.m,this.g,this)}h(c,
15
- ...d){this.g.debug(`Reporting "${c}" event to Youbora`,...d)}}return new b(a)};var tw=()=>{class a extends NpawPluginAdapters.video.Shaka{constructor(){super();this.f=this.h=!1;this.a=null}getPlayhead(){return this.getIsLive()?-1:this.player.getPosition()}getDuration(){return this.player.getDuration()}getRendition(){let b=null,c=null,d=null;var e=this.player.getTrackManager();e&&(e=e.oa())&&(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)}getIsLive(){return this.player.isLive()}getResource(){const b=
16
- this.player.getLoadedSource();return b&&b.url}getBitrate(){return this.j().streamBandwidth}getThroughput(){return this.j().estimatedBandwidth}getPlayrate(){return this.player.getPlaybackRate()}getFramesPerSecond(){var b=this.player.getTrackManager();return b&&(b=b.Ia())?b.frameRate:null}getPlayerName(){return _.qa}getVersion(){return"castlabs-adapter-6.24.0-js"}getPlayerVersion(){return _.ea}registerListeners(){const b=this.w();this.player&&b&&(b.on(this.player,_.Zf,this.I.bind(this)),b.on(this.player,
17
- _.r,this.F.bind(this)),b.on(this.player,_.Rf,this.H.bind(this)),b.on(this.player,_.Qf,this.G.bind(this)),b.on(this.player,_.Ec,this.B.bind(this)),b.on(this.player,_.ed,this.C.bind(this)))}unregisterListeners(){sw.debug(_.Ob);_.Sh(this.w())}dispose(){this.unregisterListeners();this.f=this.h=!1;this.a=null}j(){return this.player.getStats()||_.Wo()}o(){return!!this.player.getConfiguration().autoplay}I(b){b=b.detail;this.l("state change",b);if(b)switch(b.currentState){case _.hp:this.o()&&this.fireStart();
18
- break;case _.jp:this.fireStart();this.A();this.fireResume();this.fireBufferEnd();break;case _.ip:this.o()&&this.fireStart();this.A();this.fireBufferEnd();this.firePause();break;case _.gp:this.fireBufferEnd();this.fireStop();break;case _.Zo:this.fireBufferEnd();this.h&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.cp:this.fireBufferBegin();break;default:sw.debug(Yv,b)}}A(){this.fireJoin()}F(b){(b=b.detail)&&!this.f&&this.player&&10003!==b.code&&(b=pw(b,this.player,sw,this))&&
19
- b.severity===_.F&&(this.f=!0)}H(){this.player.isEnded()||(this.l(_.Rf),this.fireSeekBegin())}w(){this.a||(this.a=new _.Rt);return this.a}G(){this.l(_.Qf);this.fireSeekEnd()}B(b){sw.debug("adsTimeline",b);this.h=(b=b.adsTimeline)&&b.Kb()}C(b){sw.debug("Casting",b);this.fireCasted()}l(b,...c){sw.debug(`Reporting "${b}" event to NPAW`,...c)}}return a},sw=new _.S("clpp.npaw.NpawAdapter");var vw=()=>{class a extends NpawPluginAdapters.ads.Ima{constructor(){super();this.j=this.h=this.l=this.a=null;this.o=!1}getDuration(){return this.a?this.a.getDuration():null}getRendition(){let b=null;this.a&&(b=this.getNpawUtils().buildRenditionString(this.a.ib(),this.a.hb(),this.a.Ta()));return b}getBitrate(){let b=null;this.a&&(b=this.a.Ta());return b}getPlayhead(){let b=null;const c=this.player.getAdsManager();c&&(b=c.getPosition());return b}getResource(){let b=null;this.a&&(b=this.a.getMediaUrl());
20
- return b}getTitle(){let b=null;this.a&&(b=this.a.getTitle());return b}getProvider(){let b=null;this.a&&(b=this.a.getAdvertiserName());return b}getCreativeId(){let b=null;this.a&&(b=this.a.getCreativeId());return b}dispose(){this.unregisterListeners();this.j=this.h=this.a=null}getPosition(){const b=this.getNpawReference().Constants.AdPosition;let c=null;if(this.a)switch(this.a.Ua()){case 0:c=b.Preroll;break;case 2:c=b.Postroll;break;case 1:c=b.Midroll}uw.debug("Ad position",c);return c}getIsSkippable(){return this.a&&
11
+ this.j.getCuePoints().length}getGivenBreaks(){return this.getExpectedBreaks()}getExpectedAds(){return this.a&&this.a.jb()}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(kw,c);return c}getPlayerName(){return _.qa}getVersion(){return"6.25.1-castlabsadsadapter-js"}getPlayerVersion(){return _.ea}registerListeners(){this.m&&
12
+ this.f&&(this.f.on(this.m,_.Fc,this.M.bind(this)),this.f.on(this.m,_.zc,this.L.bind(this)),this.f.on(this.m,_.vc,this.I.bind(this)),this.f.on(this.m,_.xc,this.J.bind(this)),this.f.on(this.m,_.nc,this.G.bind(this)),this.f.on(this.m,_.oc,this.o.bind(this,1)),this.f.on(this.m,_.uc,this.o.bind(this,2)),this.f.on(this.m,_.Dc,this.o.bind(this,3)),this.f.on(this.m,_.mc,this.F.bind(this)),this.f.on(this.m,_.yc,this.K.bind(this)),this.f.on(this.m,_.q,this.H.bind(this)),this.f.on(this.m,_.jc,this.A.bind(this)),
13
+ this.f.on(this.m,_.kc,this.B.bind(this)),this.f.on(this.m,_.lc,this.C.bind(this)),this.f.on(this.m,_.wc,this.w.bind(this)))}unregisterListeners(){_.Th(this.f)}dispose(){super.dispose()}M(c){this.g.debug(fw,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(dw);this.fireBufferBegin()}w(){this.l&&
14
+ (this.h(cw),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.ub();this.g.debug(ew,c);this.fireClick(c)}K(){this.h("ad skipped");this.fireSkip()}A(c){this.a=c.ad;this.h(bw,this.a);this.fireBreakStart()}B(){this.h("ad break stop");this.fireBreakStop();if(this.getPosition()===youbora.Constants.AdPosition.Postroll){const c=this.plugin.getAdapter();c&&c.fireStop()}}H(c){(c=c.detail)&&10003===c.code&&rw(c,this.m,this.g,this)}h(c,
15
+ ...d){this.g.debug(`Reporting "${c}" event to Youbora`,...d)}}return new b(a)};var vw=()=>{class a extends NpawPluginAdapters.video.Shaka{constructor(){super();this.f=this.h=!1;this.a=null}getPlayhead(){return this.getIsLive()?-1:this.player.getPosition()}getDuration(){return this.player.getDuration()}getRendition(){let b=null,c=null,d=null;var e=this.player.getTrackManager();e&&(e=e.oa())&&(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)}getIsLive(){return this.player.isLive()}getResource(){const b=
16
+ this.player.getLoadedSource();return b&&b.url}getBitrate(){return this.j().streamBandwidth}getThroughput(){return this.j().estimatedBandwidth}getPlayrate(){return this.player.getPlaybackRate()}getFramesPerSecond(){var b=this.player.getTrackManager();return b&&(b=b.Ia())?b.frameRate:null}getPlayerName(){return _.qa}getVersion(){return"castlabs-adapter-6.25.1-js"}getPlayerVersion(){return _.ea}registerListeners(){const b=this.w();this.player&&b&&(b.on(this.player,_.$f,this.I.bind(this)),b.on(this.player,
17
+ _.q,this.F.bind(this)),b.on(this.player,_.Sf,this.H.bind(this)),b.on(this.player,_.Rf,this.G.bind(this)),b.on(this.player,_.Fc,this.B.bind(this)),b.on(this.player,_.fd,this.C.bind(this)))}unregisterListeners(){uw.debug(_.Pb);_.Th(this.w())}dispose(){this.unregisterListeners();this.f=this.h=!1;this.a=null}j(){return this.player.getStats()||_.Xo()}o(){return!!this.player.getConfiguration().autoplay}I(b){b=b.detail;this.l("state change",b);if(b)switch(b.currentState){case _.ip:this.o()&&this.fireStart();
18
+ break;case _.kp:this.fireStart();this.A();this.fireResume();this.fireBufferEnd();break;case _.jp:this.o()&&this.fireStart();this.A();this.fireBufferEnd();this.firePause();break;case _.hp:this.fireBufferEnd();this.fireStop();break;case _.$o:this.fireBufferEnd();this.h&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.dp:this.fireBufferBegin();break;default:uw.debug($v,b)}}A(){this.fireJoin()}F(b){(b=b.detail)&&!this.f&&this.player&&10003!==b.code&&(b=rw(b,this.player,uw,this))&&
19
+ b.severity===_.F&&(this.f=!0)}H(){this.player.isEnded()||(this.l(_.Sf),this.fireSeekBegin())}w(){this.a||(this.a=new _.St);return this.a}G(){this.l(_.Rf);this.fireSeekEnd()}B(b){uw.debug("adsTimeline",b);this.h=(b=b.adsTimeline)&&b.Kb()}C(b){uw.debug("Casting",b);this.fireCasted()}l(b,...c){uw.debug(`Reporting "${b}" event to NPAW`,...c)}}return a},uw=new _.S("clpp.npaw.NpawAdapter");var xw=()=>{class a extends NpawPluginAdapters.ads.Ima{constructor(){super();this.j=this.h=this.l=this.a=null;this.o=!1}getDuration(){return this.a?this.a.getDuration():null}getRendition(){let b=null;this.a&&(b=this.getNpawUtils().buildRenditionString(this.a.ib(),this.a.hb(),this.a.Ta()));return b}getBitrate(){let b=null;this.a&&(b=this.a.Ta());return b}getPlayhead(){let b=null;const c=this.player.getAdsManager();c&&(b=c.getPosition());return b}getResource(){let b=null;this.a&&(b=this.a.getMediaUrl());
20
+ return b}getTitle(){let b=null;this.a&&(b=this.a.getTitle());return b}getProvider(){let b=null;this.a&&(b=this.a.getAdvertiserName());return b}getCreativeId(){let b=null;this.a&&(b=this.a.getCreativeId());return b}dispose(){this.unregisterListeners();this.j=this.h=this.a=null}getPosition(){const b=this.getNpawReference().Constants.AdPosition;let c=null;if(this.a)switch(this.a.Ua()){case 0:c=b.Preroll;break;case 2:c=b.Postroll;break;case 1:c=b.Midroll}ww.debug("Ad position",c);return c}getIsSkippable(){return this.a&&
21
21
  -1!==this.a.getSkipTimeOffset()}getAudioEnabled(){const b=this.player.getAdsManager();return b&&0<b.getVolume()}getExpectedBreaks(){return this.h&&this.h.getCuePoints().length}getGivenBreaks(){return this.getExpectedBreaks()}getExpectedAds(){return this.a&&this.a.jb()}getGivenAds(){return this.getExpectedAds()}getBreaksTime(){return this.h&&this.h.getCuePoints().map(b=>-1===b?this.player.getDuration():b)}getIsFullscreen(){return this.player.getSurface().isFullscreen()}getIsVisible(){var b=this.player.getSurface().getContainer();
22
- b=this.getNpawUtils().calculateAdViewability(b);uw.debug(iw,b);return b}getPlayerName(){return _.qa}getVersion(){return"castlabs-ads-adapter-6.24.0-js"}getPlayerVersion(){return _.ea}B(){this.j||(this.j=new _.Rt);return this.j}registerListeners(){const b=this.B();this.player&&b&&(b.on(this.player,_.Ec,this.R.bind(this)),b.on(this.player,_.yc,this.O.bind(this)),b.on(this.player,_.tc,this.K.bind(this)),b.on(this.player,_.vc,this.L.bind(this)),b.on(this.player,_.lc,this.I.bind(this)),b.on(this.player,
23
- _.mc,this.w.bind(this,1)),b.on(this.player,_.sc,this.w.bind(this,2)),b.on(this.player,_.Cc,this.w.bind(this,3)),b.on(this.player,_.kc,this.H.bind(this)),b.on(this.player,_.xc,this.M.bind(this)),b.on(this.player,_.r,this.J.bind(this)),b.on(this.player,_.hc,this.C.bind(this)),b.on(this.player,_.ic,this.F.bind(this)),b.on(this.player,_.jc,this.G.bind(this)),b.on(this.player,_.uc,this.S.bind(this)))}unregisterListeners(){_.Sh(this.B())}R(b){uw.debug(dw,b);this.h=b.adsTimeline}O(b){this.a=b.ad;this.f("ad start",
24
- this.a);this.fireStart();this.fireJoin()}I(){this.f("ad ended");this.fireStop({adPlayhead:this.l})}K(){this.f("ad pause");this.A();this.firePause()}L(){this.f("ad resume");this.A();this.fireResume()}G(){this.o=!0;this.f(bw);this.fireBufferBegin()}S(){this.l=this.getPlayhead();this.A()}A(){this.o&&(this.f(aw),this.o=!1,this.fireBufferEnd())}w(b){this.f("ad quartile",b);this.fireQuartile(b)}H(){this.f("ad clicked");const b=this.a&&this.a.ub();uw.debug(cw,b);this.fireClick(b)}M(){this.f("ad skipped");
25
- this.fireSkip()}C(b){this.a=b.ad;this.f($v,this.a);this.fireBreakStart()}F(){this.f("ad break stop");this.fireBreakStop({adPlayhead:this.l});this.getPosition()===this.getNpawReference().Constants.AdPosition.Postroll&&this.fireStop({adPlayhead:this.l})}J(b){(b=b.detail)&&10003===b.code&&pw(b,this.player,uw,this)}f(b,...c){uw.debug(`Reporting "${b}" event to NPAW`,...c)}}return a},uw=new _.S("clpp.npaw.NpawAdsAdapter");var ww=class extends _.Xv{constructor(){super();this.a=null;this.g=new _.S(ew);this.m=null}bf(a){lw(this);if(this.a=a)this.a.registerAdapterFromClass(this.m,tw()),this.a.registerAdsAdapterFromClass(this.m,vw())}uh(){return this.a}getAdapter(){return this.a&&this.a.getAdapter()}getAdsAdapter(){return this.a&&this.a.getAdsAdapter()}onPlayerCreated(a){this.m=a;mw(this,a)&&(a=a.getConfiguration().youbora,this.bf(new NpawPlugin(a.accountCode)))}onContentWillLoad(a,b){if(mw(this,a)){a=a.getConfiguration();
26
- var c=a.youbora;void 0===c[gw]&&(c[gw]=b.isLive);void 0===c[hw]&&(c[hw]=b.name);void 0===c.viewerId&&(c.viewerId=a.viewerId);this.a||this.bf(new NpawPlugin(c.accountCode));this.a.setAnalyticsOptions(c)}}onContentLoaded(a){const b={};(a=a.getDrmInfo())&&(a=kw(a.keySystem))&&(b["content.drm"]=a);this.g.info(_.Te,b);this.a.setAnalyticsOptions(b)}onPlayerWillRelease(){}onPlayerWillDestroy(){lw(this);this.a.destroy()}id(){return jw}};_.z(ew,ww);ww.prototype.getAdsAdapter=ww.prototype.getAdsAdapter;
27
- ww.prototype.getAdapter=ww.prototype.getAdapter;ww.prototype.getNpawPlugin=ww.prototype.uh;ww.prototype.setNpawPlugin=ww.prototype.bf;ww.Id=jw;new _.S(ew);var xw=class extends _.Xv{constructor(){super();this.a=null;this.g=new _.S(fw);this.m=null}cf(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(qw(this.m)),this.a.setAdsAdapter(rw(this.m))}getAdapter(){return this.a&&this.a.getAdapter()}getAdsAdapter(){return this.a&&this.a.getAdsAdapter()}onPlayerCreated(a){this.m=a;nw(this,a)&&(a=a.getConfiguration().youbora,this.cf(new youbora.Plugin(a)))}onContentWillLoad(a,b){if(nw(this,a)){a=a.getConfiguration();var c=
28
- a.youbora;void 0===c[gw]&&(c[gw]=b.isLive);void 0===c[hw]&&(c[hw]=b.name);void 0===c.viewerId&&(c.viewerId=a.viewerId);this.a||this.cf(new youbora.Plugin(c));this.a.setOptions(c)}}onPlayerWillRelease(){}onPlayerWillDestroy(){}id(){return jw}};_.z(fw,xw);xw.prototype.getAdsAdapter=xw.prototype.getAdsAdapter;xw.prototype.getAdapter=xw.prototype.getAdapter;xw.prototype.setYouboraPlugin=xw.prototype.cf;xw.Id=jw;_.Mr(new class{create(a){return a.youbora&&a.youbora.v7?new ww:new xw}});};f.call(g, window);
22
+ b=this.getNpawUtils().calculateAdViewability(b);ww.debug(kw,b);return b}getPlayerName(){return _.qa}getVersion(){return"castlabs-ads-adapter-6.25.1-js"}getPlayerVersion(){return _.ea}B(){this.j||(this.j=new _.St);return this.j}registerListeners(){const b=this.B();this.player&&b&&(b.on(this.player,_.Fc,this.R.bind(this)),b.on(this.player,_.zc,this.O.bind(this)),b.on(this.player,_.vc,this.K.bind(this)),b.on(this.player,_.xc,this.L.bind(this)),b.on(this.player,_.nc,this.I.bind(this)),b.on(this.player,
23
+ _.oc,this.w.bind(this,1)),b.on(this.player,_.uc,this.w.bind(this,2)),b.on(this.player,_.Dc,this.w.bind(this,3)),b.on(this.player,_.mc,this.H.bind(this)),b.on(this.player,_.yc,this.M.bind(this)),b.on(this.player,_.q,this.J.bind(this)),b.on(this.player,_.jc,this.C.bind(this)),b.on(this.player,_.kc,this.F.bind(this)),b.on(this.player,_.lc,this.G.bind(this)),b.on(this.player,_.wc,this.S.bind(this)))}unregisterListeners(){_.Th(this.B())}R(b){ww.debug(fw,b);this.h=b.adsTimeline}O(b){this.a=b.ad;this.f("ad start",
24
+ this.a);this.fireStart();this.fireJoin()}I(){this.f("ad ended");this.fireStop({adPlayhead:this.l})}K(){this.f("ad pause");this.A();this.firePause()}L(){this.f("ad resume");this.A();this.fireResume()}G(){this.o=!0;this.f(dw);this.fireBufferBegin()}S(){this.l=this.getPlayhead();this.A()}A(){this.o&&(this.f(cw),this.o=!1,this.fireBufferEnd())}w(b){this.f("ad quartile",b);this.fireQuartile(b)}H(){this.f("ad clicked");const b=this.a&&this.a.ub();ww.debug(ew,b);this.fireClick(b)}M(){this.f("ad skipped");
25
+ this.fireSkip()}C(b){this.a=b.ad;this.f(bw,this.a);this.fireBreakStart()}F(){this.f("ad break stop");this.fireBreakStop({adPlayhead:this.l});this.getPosition()===this.getNpawReference().Constants.AdPosition.Postroll&&this.fireStop({adPlayhead:this.l})}J(b){(b=b.detail)&&10003===b.code&&rw(b,this.player,ww,this)}f(b,...c){ww.debug(`Reporting "${b}" event to NPAW`,...c)}}return a},ww=new _.S("clpp.npaw.NpawAdsAdapter");var yw=class extends _.Zv{constructor(){super();this.a=null;this.g=new _.S(gw);this.m=null}bf(a){nw(this);if(this.a=a)this.a.registerAdapterFromClass(this.m,vw()),this.a.registerAdsAdapterFromClass(this.m,xw())}uh(){return this.a}getAdapter(){return this.a&&this.a.getAdapter()}getAdsAdapter(){return this.a&&this.a.getAdsAdapter()}onPlayerCreated(a){this.m=a;ow(this,a)&&(a=a.getConfiguration().youbora,this.bf(new NpawPlugin(a.accountCode)))}onContentWillLoad(a,b){if(ow(this,a)){a=a.getConfiguration();
26
+ var c=a.youbora;void 0===c[iw]&&(c[iw]=b.isLive);void 0===c[jw]&&(c[jw]=b.name);void 0===c.viewerId&&(c.viewerId=a.viewerId);this.a||this.bf(new NpawPlugin(c.accountCode));this.a.setAnalyticsOptions(c)}}onContentLoaded(a){const b={};(a=a.getDrmInfo())&&(a=mw(a.keySystem))&&(b["content.drm"]=a);this.g.info(_.Ue,b);this.a.setAnalyticsOptions(b)}onPlayerWillRelease(){}onPlayerWillDestroy(){nw(this);this.a.destroy()}id(){return lw}};_.z(gw,yw);yw.prototype.getAdsAdapter=yw.prototype.getAdsAdapter;
27
+ yw.prototype.getAdapter=yw.prototype.getAdapter;yw.prototype.getNpawPlugin=yw.prototype.uh;yw.prototype.setNpawPlugin=yw.prototype.bf;yw.Id=lw;new _.S(gw);var zw=class extends _.Zv{constructor(){super();this.a=null;this.g=new _.S(hw);this.m=null}cf(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(sw(this.m)),this.a.setAdsAdapter(tw(this.m))}getAdapter(){return this.a&&this.a.getAdapter()}getAdsAdapter(){return this.a&&this.a.getAdsAdapter()}onPlayerCreated(a){this.m=a;pw(this,a)&&(a=a.getConfiguration().youbora,this.cf(new youbora.Plugin(a)))}onContentWillLoad(a,b){if(pw(this,a)){a=a.getConfiguration();var c=
28
+ a.youbora;void 0===c[iw]&&(c[iw]=b.isLive);void 0===c[jw]&&(c[jw]=b.name);void 0===c.viewerId&&(c.viewerId=a.viewerId);this.a||this.cf(new youbora.Plugin(c));this.a.setOptions(c)}}onPlayerWillRelease(){}onPlayerWillDestroy(){}id(){return lw}};_.z(hw,zw);zw.prototype.getAdsAdapter=zw.prototype.getAdsAdapter;zw.prototype.getAdapter=zw.prototype.getAdapter;zw.prototype.setYouboraPlugin=zw.prototype.cf;zw.Id=lw;_.Nr(new class{create(a){return a.youbora&&a.youbora.v7?new yw:new zw}});};f.call(g, window);
package/clpp.styles.css CHANGED
@@ -45,6 +45,10 @@
45
45
  margin: 1.5%;
46
46
  }
47
47
 
48
+ .clpp-text-wrapper {
49
+ unicode-bidi: plaintext;
50
+ }
51
+
48
52
  .clpp-text-cue {
49
53
  display: inline;
50
54
  unicode-bidi: plaintext;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@castlabs/prestoplay",
3
3
  "description": "PRESTOplay Video Player",
4
- "version": "6.24.0",
4
+ "version": "6.25.1",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/castlabs/prestoplay-web.git"
package/typings.d.ts CHANGED
@@ -2152,6 +2152,14 @@ export namespace clpp {
2152
2152
  * Tizen that value defaults value is `0.5`
2153
2153
  */
2154
2154
  gapDetectionThreshold: number;
2155
+ /**
2156
+ * Based on media timestamps there may be small gaps of missing frames
2157
+ * typically between two media segments. MSE can tolerate gaps up to a certain
2158
+ * size, this may be platform-specific or specific to the stream.
2159
+ * Gap tolerance expresses in seconds the size of these gaps that are expected
2160
+ * to be tolerated by the MSE.
2161
+ */
2162
+ gapTolerance?: number;
2155
2163
  /**
2156
2164
  * Defaults to false.
2157
2165
  *
@@ -3979,21 +3987,19 @@ export namespace clpp {
3979
3987
  setCdnErrorCallback(callback: Function|null): void;
3980
3988
  /**
3981
3989
  * Sets the DRM custom data modifier.
3982
- * The callback is trigger
3983
- * when connecting to an AirPlay device and
3984
- * when disconnecting from it.
3985
- * This is especially useful when you want to generate
3986
- * a new auth token for the upcoming license acquisition.
3987
- * The AirPlay plugin has be enabled in order
3988
- * to track AirPlay status.
3990
+ * This modifier can be used to enable AirPlay of DRM-protected streams
3991
+ * with upfront authorization tokens where it is necessary to generate
3992
+ * and provide a new auth token for the AirPlay session.
3993
+ * The AirPlay plugin must be enabled, otherwise the modifier callback
3994
+ * won't trigger at all.
3989
3995
  *
3990
3996
  * @param modifier The callback which can adjust DRM custom data
3991
3997
  * before the upcoming license acquisition.
3992
3998
  *
3993
- * @example // New auth token
3999
+ * @example // Generate a new upfront auth token for AirPlay session
3994
4000
  *
3995
4001
  * player.setDrmCustomDataModifier(async customData => {
3996
- * customData.authToken = await generateNewAuthToken ();
4002
+ * customData.authToken = await generateNewAuthToken();
3997
4003
  * });
3998
4004
  */
3999
4005
  setDrmCustomDataModifier(modifier: Function): void;
@@ -4990,7 +4996,8 @@ export namespace clpp {
4990
4996
  */
4991
4997
  CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM = 4040,
4992
4998
  /**
4993
- * We do not support playing encrypted transport streams (TS) with MSE.
4999
+ * We do not support playing Fairplay-encrypted transport streams
5000
+ * (MPEG-TS) with MSE.
4994
5001
  */
4995
5002
  HLS_MSE_ENCRYPTED_TS_NOT_SUPPORTED = 4041,
4996
5003
  /**
@@ -8222,20 +8229,6 @@ export namespace clpp {
8222
8229
  }
8223
8230
  }
8224
8231
 
8225
- namespace polyfill {
8226
- /**
8227
- * Install all polyfills.
8228
- */
8229
- function installAll(): void;
8230
- /**
8231
- * Registers a new polyfill to be installed.
8232
- *
8233
- * @param polyfill
8234
- * @param priority An optional number priority. Higher priorities
8235
- * will be executed before lower priority ones. Default is 0.
8236
- */
8237
- function register(polyfill: Function, priority?: number): void;}
8238
-
8239
8232
  namespace smooth {
8240
8233
  export class SmoothComponent {
8241
8234
 
@@ -8453,8 +8446,8 @@ export namespace clpp {
8453
8446
  LEFT = "left",
8454
8447
  RIGHT = "right",
8455
8448
  CENTER = "center",
8456
- START = "left",
8457
- END = "right",
8449
+ START = "start",
8450
+ END = "end",
8458
8451
  }
8459
8452
 
8460
8453
  export enum writingMode {