@castlabs/prestoplay 6.34.0-beta.1 → 6.34.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.
- package/CHANGELOG.md +18 -2
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +18 -18
- package/cjs/cl.cast.js +127 -127
- package/cjs/cl.conviva.js +32 -32
- package/cjs/cl.core.js +608 -606
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +101 -101
- package/cjs/cl.externs.js +37 -38
- package/cjs/cl.freewheel.js +25 -25
- package/cjs/cl.hls.js +77 -77
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +24 -24
- package/cjs/cl.mediatailor.js +3 -3
- package/cjs/cl.mse.js +351 -355
- package/cjs/cl.muxdata.js +14 -14
- package/cjs/cl.onboard.js +4 -4
- package/cjs/cl.persistent.js +14 -14
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.simid.js +16 -16
- package/cjs/cl.smooth.js +71 -71
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +72 -72
- package/cjs/cl.ttml.js +29 -29
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +12 -12
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.yospace.js +4 -4
- package/cjs/cl.youbora.js +35 -35
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +11 -11
- package/cl.cast.js +98 -98
- package/cl.conviva.js +26 -26
- package/cl.core.js +438 -435
- package/cl.crypto.js +9 -9
- package/cl.dash.js +89 -89
- package/cl.externs.js +37 -38
- package/cl.freewheel.js +16 -16
- package/cl.hls.js +82 -82
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +17 -17
- package/cl.mediatailor.js +2 -2
- package/cl.mse.js +301 -305
- package/cl.muxdata.js +13 -13
- package/cl.onboard.js +5 -5
- package/cl.persistent.js +10 -10
- package/cl.playlist.js +5 -5
- package/cl.simid.js +14 -14
- package/cl.smooth.js +61 -61
- package/cl.thumbnails.js +19 -19
- package/cl.tizen.js +56 -56
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +7 -7
- package/cl.vr.js +14 -14
- package/cl.vtt.js +12 -12
- package/cl.yospace.js +3 -3
- package/cl.youbora.js +29 -29
- package/package.json +1 -1
- package/typings.d.ts +24 -136
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
|
|
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},
|
|
3
|
-
new
|
|
4
|
-
a.a.getShaderInfoLog(b));return b},
|
|
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 _.J(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
|
|
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
|
|
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.P=new
|
|
8
|
-
if(void 0!==d&&_.eh(d))this.H=d;else throw new _.J(1,7,7100,"fieldOfView configuration must be a number");if(void 0!==e&&_.eh(e)&&0<e)this.U=e;else throw new _.J(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",
|
|
9
|
-
|
|
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&&(
|
|
11
|
-
var b=this.f;this.o||a.readyState!==a.HAVE_ENOUGH_DATA||(this.o=new
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var Ww="touchmove",Xw="touchstart",Zw=function(a,b,c){c*=.5;const d=Math.sqrt(a*a+b*b),e=Math.sin(c);return new Yw(a/d*e,b/d*e,0/d*e,Math.cos(c))},$w=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)},ax=function(a,b){isFinite(b)?(a.x*=b,a.y*=b,a.a*=b):(a.x=0,a.y=0,a.a=0)},bx=function(a,b){return a.x*b.x+a.y*b.y+a.a*b.a},cx=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},dx=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},fx=function(a){var b=new ex(0,0,0),c=new ex(0,0,1);const d=new ex,e=new ex,f=new ex;a=a.a;var g=
|
|
3
|
+
new ex(0,1,0);f.x=b.x-g.x;f.y=b.y-g.y;f.a=b.a-g.a;g=f.length();ax(f,1/g);c=cx(d,c,f);g=c.length();ax(c,1/g);cx(e,f,d);a[0]=d.x;a[1]=d.y;a[2]=d.a;a[3]=-bx(d,b);a[4]=e.x;a[5]=e.y;a[6]=e.a;a[7]=-bx(e,b);a[8]=f.x;a[9]=f.y;a[10]=f.a;a[11]=-bx(f,b);a[12]=0;a[13]=0;a[14]=0;a[15]=1},gx=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 _.J(1,9,9004,"Unable to compile GL shader: "+
|
|
4
|
+
a.a.getShaderInfoLog(b));return b},hx=function(a){a.a&&(a.a.removeEventListener("mousemove",a.A,!1),a.a.removeEventListener(Ww,a.A,!1),a.a.removeEventListener("mouseup",a.B,!1),a.a.removeEventListener("touchend",a.B,!1))},ix=function(a){const b=Zw(1,0,a.l*Math.PI/180);$w(Zw(0,1,a.j*Math.PI/180),a.P);$w(b,a.R);fx(a.Z);dx(a.ba,a.P,a.Z);dx(a.G,a.R,a.ba)},Yw=class{constructor(a,b,c,d){this.x=a||0;this.y=b||0;this.a=c||0;this.f=d||1}};var ex=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 jx=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,x,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]=r;B[7]=u;B[11]=x;B[15]=y;return this}};var kx=class{constructor(a){this.a=a;this.f=a.createProgram();this.l=gx(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=gx(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 _.J(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 lx=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 mx=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 nx={alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!1,devicePixelRatio:1},ox=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.P=new jx;this.R=new jx;this.Z=new jx;this.ba=new jx;this.A=this.ja.bind(this);this.B=this.Aa.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&&_.eh(d))this.H=d;else throw new _.J(1,7,7100,"fieldOfView configuration must be a number");if(void 0!==e&&_.eh(e)&&0<e)this.U=e;else throw new _.J(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",nx)||this.a.getContext("experimental-webgl",
|
|
9
|
+
nx);if(!this.f)throw new _.J(1,9,9003,"Unable to create GL context");this.G=new jx;fx(this.G);this.W=new lx(this.f);this.C=new kx(this.f);this.I=new jx;this.K=new jx;this.o=this.w=null;this.a.addEventListener(_.wf,this.F)}a.addElementToContainer(this.a,!0,!0);a.hideMediaElement();b.vr.attachMouseListener&&(this.a.addEventListener("mousedown",this.J,!1),this.a.addEventListener(Xw,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&&(hx(this),this.a.removeEventListener(_.wf,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 _.v(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 mx(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=dx(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===
|
|
14
|
-
this.B,!1)}ja(a){a.preventDefault();var b=a.clientX;let c=a.clientY;a.type===
|
|
15
|
-
_.w("clpp.vr.VrPlugin",
|
|
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===Xw)a.type===Xw?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(Ww,this.A,!1),this.a.addEventListener("mouseup",this.B,!1),this.a.addEventListener("touchend",
|
|
14
|
+
this.B,!1)}ja(a){a.preventDefault();var b=a.clientX;let c=a.clientY;a.type===Ww&&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 {zh:e,Ah:f}={zh:a*b*(this.L?-1:1),Ah:d*b*(this.M?-1:1)};this.j+=e;this.l+=f;ix(this)}Aa(a){this.g.debug("Mouse Up. Removing mouse interaction listeners");a.preventDefault();hx(this)}ri(a,b){this.l=b;this.j=a;ix(this)}Uh(){return{x:this.j,y:this.l}}Si(a){this.H=a;this.F()}};
|
|
15
|
+
_.w("clpp.vr.VrPlugin",ox);ox.prototype.setCameraFieldOfView=ox.prototype.Si;ox.prototype.getCameraCoordinates=ox.prototype.Uh;ox.prototype.moveCamera=ox.prototype.ri;ox.Id="vr";_.Sr(new class{create(){return new ox}});};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
|
|
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},
|
|
3
|
-
c+60*b+3600*(Number(a[1])||0)},
|
|
4
|
-
_.he:_.Wc);else if(d=/^region:(.*)$/.exec(b)){if(b=
|
|
5
|
-
b," The region will be ignored."),null)},
|
|
6
|
-
"WEBVTT\n\n";for(const c of a)b+=
|
|
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 _.
|
|
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||_.A("VTT parser encountered an invalid VTTRegion setting: ",g,
|
|
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 _.
|
|
10
|
-
new _.J(_.C,2,2008);let c=0,d=[],e;const f=[];let g=!1,h=!1,k=!1,l=null;(new _.
|
|
11
|
-
_.P(
|
|
12
|
-
b.periodStart+a/this.a)):this.g.error("WVTT sample duration unknown, and no default found!")}while(
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var Dw=" The setting will be ignored.",Ew="VTT parser encountered an invalid VTT setting: ",Fw="application/x-subrip",Gw="text/srt",Hw='text/vtt; codecs\x3d"vtt"',Iw='text/vtt; codecs\x3d"wvtt"',Jw=function(a){return a.a===a.f.length?null:(a=_.pk(a,/[^ \t\n]*/gm))?a[0]:null},Kw=function(a){_.pk(a,/[ \t]+/gm)},Lw=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},Mw=function(a){a=_.pk(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)},Ow=function(a,b,c){let d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"===b?a.textAlign=_.$t:a.textAlign=_.fu[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"===d[1]?_.ng:_.og;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===_.ge||b===_.Kf?_.ge:b===_.he||b===_.Qd?
|
|
4
|
+
_.he:_.Wc);else if(d=/^region:(.*)$/.exec(b)){if(b=Nw(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=_.gu[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.bu,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.gu[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},Nw=function(a,b){a=a.filter(c=>c.id===b);return a.length?a[0]:(_.A("VTT parser could not find a region with id: ",
|
|
5
|
+
b," The region will be ignored."),null)},Qw=function(a,b,c){let d,e,f;(new _.Vm).N("payl",_.Qm(g=>{d=_.vi(g)})).N("iden",_.Qm(g=>{e=_.vi(g)})).N("sttg",_.Qm(g=>{f=_.vi(g)})).parse(a);return d?Pw(d,e,f,b,c):null},Pw=function(a,b,c,d,e){a=new _.eu(d,e,a,_.yg);b&&(a.id=b);if(c)for(b=new _.qk(c),c=Jw(b);c;)Ow(a,c,[])||_.A(Ew,c,Dw),Kw(b),c=Jw(b);return a},Rw=class{a(a){a=_.vi(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+=Lw(c)}return _.zi(b)}},Sw=class{create(){return new Rw}probe(a,b){return(a===Gw||a===Fw)&&b===_.Tf}};var Tw=class{constructor(a){this.a=a}parseInit(){}parseMedia(a,b){a=_.vi(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 _.J(_.C,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=Mw(new _.qk(d[1]));if(null==a)throw new _.J(_.C,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 _.qk(f.replace(/\n/g," "));d=new _.ju;Jw(e);Kw(e);for(var g=Jw(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||_.A("VTT parser encountered an invalid VTTRegion setting: ",g,Dw);Kw(e);g=Jw(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 _.qk(l[0]);g=Mw(d);const r=_.pk(d,/[ \t]+--\x3e[ \t]+/g);k=Mw(d);if(null==g||null==r||null==k)throw new _.J(_.C,2,2001);g+=h;k+=h;l=l.slice(1).join("\n").trim();g=new _.eu(g,k,l,_.yg);e&&(g.id=e);Kw(d);for(k=Jw(d);k;)Ow(g,k,c)||_.A(Ew,k,Dw),Kw(d),k=Jw(d);null!=e&&(g.id=e);c=g}c&&m.push(c)}return{cues:m,styles:f}}};var Uw=class extends Tw{parseMedia(a,b){return super.parseMedia((new Rw).a(a),b)}};var Vw=class{constructor(){this.a=null;this.g=new _.S("clpp.vtt.mp4")}parseInit(a){let b=!1;(new _.Vm).N(_.ue,_.Om).N(_.bg,_.Om).N(_.pe,_.Om).fa("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(_.te,_.Om).N(_.Nf,_.Om).fa(_.Pf,_.Pm).N("wvtt",()=>{b=!0}).parse(a);if(!this.a)throw new _.J(_.C,2,2008);if(!b)throw new _.J(_.C,2,2008);}parseMedia(a,b){if(!this.a)throw this.g.error("No init segment for MP4+VTT!"),
|
|
10
|
+
new _.J(_.C,2,2008);let c=0,d=[],e;const f=[];let g=!1,h=!1,k=!1,l=null;(new _.Vm).N("moof",_.Om).N("traf",_.Om).fa("tfdt",r=>{g=!0;c=0===r.version?_.P(r.reader):_.Jm(r.reader)}).fa("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}).fa("trun",r=>{h=!0;{var u=r.version,x=r.flags;r=r.reader;const y=_.P(r);x&1&&r.skip(4);x&4&&r.skip(4);const B=[];for(let F=0;F<y;F++){const G={duration:null,sampleSize:null,Ff:null};x&256&&(G.duration=_.P(r));x&512&&(G.sampleSize=
|
|
11
|
+
_.P(r));x&1024&&r.skip(4);x&2048&&(G.Ff=0===u?_.P(r):_.Fm(r));B.push(G)}d=B}}).N(_.oe,_.Qm(r=>{k=!0;e=r})).parse(a);if(!k&&!g&&!h)throw new _.J(_.C,2,2008);a=c;var m=new DataView(e.buffer,e.byteOffset,e.byteLength);m=new _.Cn(m,!1);for(const r of d){const u=r.duration||l,x=r.Ff?c+r.Ff:a;a=x+(u||0);let y=0;do{const B=_.P(m);y+=B;var n=_.P(m);n=_.Nm(n);let F=null;"vttc"===n?8<B&&(F=_.Lm(m,B-8)):("vtte"!==n&&this.g.error("Unknown box "+n+"! Skipping!"),m.skip(B-8));u?F&&f.push(Qw(F,b.periodStart+x/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(_.uj),styles:[]}}};_.w("clpp.vtt.VttComponent",class extends _.Ev{constructor(){super();this.a=new Sw}install(){_.Bt(_.Tf,Tw);_.Bt(Hw,Tw);_.Bt(Iw,Tw);_.Bt(_.yc,Vw);_.Bt(Gw,Uw);_.Bt(Fw,Uw);_.Ml.push(this.a)}uninstall(){_.Dt(_.Tf);_.Dt(Hw);_.Dt(Iw);_.Dt(_.yc);_.Dt(Gw);_.Dt(Fw);_.Ol(this.a)}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
|
|
2
|
-
break a;case
|
|
3
|
-
const b=this.a;this.a.shutdown();this.a=null;a.trigger(new _.H(_.Kg,{detail:b}))}}id(){return"yospace"}};_.w(
|
|
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 _.Zv{constructor(){super();this.a=null;this.g=new _.S(yw)}rg(){return this.a}onContentWillLoad(a,b){const c=this;return _.v(function*(){var d=a.getConfiguration().yospace;if(d.enabled){if(typeof window.YospaceAdManagement!==_.Ce)throw new _.J(_.C,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 _.J(_.C,9,7003,"Yospace session failed to initialize.");a.trigger(new _.H(_.Lg,{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 _.H(_.Kg,{detail:b}))}}id(){return"yospace"}};_.w(yw,Bw);Bw.prototype.getSession=Bw.prototype.rg;Bw.Id="yospace";var Cw=class{create(){return new Bw}},zw=_.Db,Aw="LIVE";_.w("clpp.yospace.StreamType",{VOD:zw,LIVE:Aw,DVR:"DVR"});_.Sr(new Cw);};f.call(g, window);
|
package/cl.youbora.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
this.m=c;this.a=new _.
|
|
3
|
-
return c&&c.url}getBitrate(){return this.j().streamBandwidth}getThroughput(){return this.j().estimatedBandwidth}getPlayrate(){return this.m.lc()}getFramesPerSecond(){var c=this.m.getTrackManager();return c&&(c=c.
|
|
4
|
-
_.Sd,this.F.bind(this)),this.a.on(this.m,_.kg,this.H.bind(this)),this.a.on(this.m,_.jg,this.G.bind(this)),this.a.on(this.m,_.oc,this.B.bind(this)),this.a.on(this.m,_.Rc,this.C.bind(this)))}unregisterListeners(){this.g.debug(_.yb);_.Fh(this.a)}dispose(){super.dispose()}j(){return this.m.getStats()||_.
|
|
5
|
-
break;case 10:this.w()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case 0:this.fireBufferEnd();this.fireStop();break;case 11:this.fireBufferEnd();this.o&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case 6:this.fireBufferBegin();break;default:this.g.debug(
|
|
6
|
-
10003===c.code&&this.plugin.getAdsAdapter()||(c=
|
|
7
|
-
this.m=c;this.j=this.a=null;this.f=new _.
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var $v="Unhandled state",aw="ad break start",bw="ad buffering ended",cw="ad buffering started",dw="ad click through url: ",ew="ad timeline changed",fw="clpp.npaw.NpawPlugin",gw="clpp.npaw.YouboraPlugin",hw="content.isLive",iw="content.title",jw="is container visible",kw=function(a){return a.startsWith(_.td)?"Widevine":a.startsWith(_.pd)?"FairPlay":a.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":a.startsWith(_.Le)?"ClearKey":a.startsWith(_.od)?"Primetime":a},mw=function(a){class b extends youbora.Adapter{constructor(c){super(c);
|
|
2
|
+
this.m=c;this.a=new _.Ut;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.ta())&&(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,d,e)}getIsLive(){return this.m.isLive()}getResource(){const c=this.m.Ra();
|
|
3
|
+
return c&&c.url}getBitrate(){return this.j().streamBandwidth}getThroughput(){return this.j().estimatedBandwidth}getPlayrate(){return this.m.lc()}getFramesPerSecond(){var c=this.m.getTrackManager();return c&&(c=c.Ia())?c.frameRate:null}getPlayerName(){return _.sa}getVersion(){return"6.34.1-castlabsadapter-js"}getPlayerVersion(){return _.ea}registerListeners(){this.m&&this.a&&(this.g.debug("registering listeners"),youbora.Util.logAllEvents(this.m),this.a.on(this.m,_.bf,this.I.bind(this)),this.a.on(this.m,
|
|
4
|
+
_.Sd,this.F.bind(this)),this.a.on(this.m,_.kg,this.H.bind(this)),this.a.on(this.m,_.jg,this.G.bind(this)),this.a.on(this.m,_.oc,this.B.bind(this)),this.a.on(this.m,_.Rc,this.C.bind(this)))}unregisterListeners(){this.g.debug(_.yb);_.Fh(this.a)}dispose(){super.dispose()}j(){return this.m.getStats()||_.Zo()}w(){return!!this.m.getConfiguration().autoplay}I(c){c=c.detail;this.l("state change",c);if(c)switch(c.currentState){case 2:this.w()&&this.f();break;case 8:this.f();this.A();this.fireResume();this.fireBufferEnd();
|
|
5
|
+
break;case 10:this.w()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case 0:this.fireBufferEnd();this.fireStop();break;case 11:this.fireBufferEnd();this.o&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case 6: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=kw(c.keySystem))&&this.plugin.setOptions({"content.drm":c});this.fireJoin()}F(c){!(c=c.detail)||this.h||
|
|
6
|
+
10003===c.code&&this.plugin.getAdsAdapter()||(c=lw(c,this.m.getConfiguration().youbora,this.g,this))&&c.severity===_.C&&(this.h=!0)}H(){this.m.isEnded()||(this.l(_.Df),this.f(),this.fireSeekBegin())}G(){this.l(_.Cf);this.fireSeekEnd()}B(c){this.g.debug("adsTimeline",c);this.o=(c=c.adsTimeline)&&c.Pb()}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)},nw=function(a){class b extends youbora.Adapter{constructor(c){super(c);
|
|
7
|
+
this.m=c;this.j=this.a=null;this.f=new _.Ut;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.Ua(),this.a.Ta(),this.a.Ba()));return c}getBitrate(){return this.a&&this.a.Ba()}getPlayhead(){const c=this.m.getAdsManager();return c&&c.getPosition()}getResource(){return this.a&&this.a.getMediaUrl()}getTitle(){return this.a&&this.a.getTitle()}getProvider(){return this.a&&
|
|
8
8
|
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.Ca()){case 0:d=c.Preroll;break;case _.Mj:d=c.Postroll;break;case _.Pj: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.getAdVolume()}getExpectedBreaks(){return this.j&&this.j.getCuePoints().length}getGivenBreaks(){return this.getExpectedBreaks()}getExpectedAds(){return this.a&&
|
|
9
|
-
this.a.Va()}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(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
this.
|
|
9
|
+
this.a.Va()}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(jw,c);return c}getPlayerName(){return _.sa}getVersion(){return"6.34.1-castlabsadsadapter-js"}getPlayerVersion(){return _.ea}registerListeners(){this.m&&this.f&&(this.f.on(this.m,_.oc,this.M.bind(this)),
|
|
10
|
+
this.f.on(this.m,_.kc,this.L.bind(this)),this.f.on(this.m,_.dc,this.I.bind(this)),this.f.on(this.m,_.hc,this.J.bind(this)),this.f.on(this.m,_.Wb,this.G.bind(this)),this.f.on(this.m,_.Xb,this.o.bind(this,1)),this.f.on(this.m,_.cc,this.o.bind(this,2)),this.f.on(this.m,_.mc,this.o.bind(this,3)),this.f.on(this.m,_.Vb,this.F.bind(this)),this.f.on(this.m,_.jc,this.K.bind(this)),this.f.on(this.m,_.Sd,this.H.bind(this)),this.f.on(this.m,_.Sb,this.A.bind(this)),this.f.on(this.m,_.Tb,this.B.bind(this)),this.f.on(this.m,
|
|
11
|
+
_.Ub,this.C.bind(this)),this.f.on(this.m,_.ec,this.w.bind(this)))}unregisterListeners(){_.Fh(this.f)}dispose(){super.dispose()}M(c){this.g.debug(ew,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(cw);this.fireBufferBegin()}w(){this.l&&(this.h(bw),this.l=!1,this.fireBufferEnd())}o(c){this.h("ad quartile",
|
|
12
|
+
c);this.fireQuartile(c)}F(){this.h("ad clicked");const c=this.a&&this.a.Qa();this.g.debug(dw,c);this.fireClick(c)}K(){this.h("ad skipped");this.fireSkip()}A(c){this.a=c.ad;this.h(aw,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&&lw(c,this.m.getConfiguration().youbora,this.g,this)}h(c,...d){this.g.debug(`Reporting "${c}" event to Youbora`,
|
|
13
|
+
...d)}}return new b(a)},pw=function(){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.ta())&&(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,
|
|
14
|
+
d)}getIsLive(){return this.player.isLive()}getResource(){const b=this.player.Ra();return b&&b.url}getBitrate(){return this.j().streamBandwidth}getThroughput(){return this.j().estimatedBandwidth}getPlayrate(){return this.player.lc()}getFramesPerSecond(){var b=this.player.getTrackManager();return b&&(b=b.Ia())?b.frameRate:null}getPlayerName(){return _.sa}getVersion(){return"castlabs-adapter-6.34.1-js"}getPlayerVersion(){return _.ea}registerListeners(){const b=this.w();this.player&&b&&(b.on(this.player,
|
|
15
|
+
_.bf,this.K.bind(this)),b.on(this.player,_.Sd,this.H.bind(this)),b.on(this.player,_.Df,this.J.bind(this)),b.on(this.player,_.Cf,this.I.bind(this)),b.on(this.player,_.oc,this.F.bind(this)),b.on(this.player,_.Rc,this.G.bind(this)),b.on(this.player,_.Jc,this.L.bind(this)),b.on(this.player,_.Vf,this.M.bind(this)))}unregisterListeners(){ow.debug(_.yb);_.Fh(this.w())}dispose(){this.unregisterListeners();this.f=this.h=!1;this.a=null}j(){return this.player.getStats()||_.Zo()}o(){return!!this.player.getConfiguration().autoplay}K(b){b=
|
|
16
|
+
b.detail;this.l("state change",b);if(b)switch(b.currentState){case 2:this.plugin.setVideoOptions({"content.subtitles":this.C()});this.o()&&this.fireStart();break;case 8:this.fireStart();this.A();this.fireResume();this.fireBufferEnd();break;case 10:this.o()&&this.fireStart();this.A();this.fireBufferEnd();this.firePause();break;case 0:this.fireBufferEnd();this.fireStop();break;case 11:this.fireBufferEnd();this.h&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case 6:this.fireBufferBegin();
|
|
17
|
+
break;default:ow.debug($v,b)}}A(){this.fireJoin()}H(b){(b=b.detail)&&!this.f&&this.player&&10003!==b.code&&(b=lw(b,this.player.getConfiguration().npaw,ow,this))&&b.severity===_.C&&(this.f=!0)}J(){this.player.isEnded()||(this.l(_.Df),this.fireSeekBegin())}B(b){const c=this.player.getTrackManager();if(!c)return null;let d=null;b===_.Sf&&(d=c.ua());b===_.p&&(d=c.ra());return d?d.language:null}L(){const b=this.B(_.p);this.plugin.setVideoOptions({"content.language":b})}M(){const b=this.B(_.Sf),c=this.C();
|
|
18
|
+
this.plugin.setVideoOptions({"content.subtitles":b||c})}w(){this.a||(this.a=new _.Ut);return this.a}I(){this.l(_.Cf);this.fireSeekEnd()}F(b){ow.debug("adsTimeline",b);this.h=(b=b.adsTimeline)&&b.Pb()}G(b){ow.debug("Casting",b);this.fireCasted()}l(b,...c){ow.debug(`Reporting "${b}" event to NPAW`,...c)}C(){const b=this.player.getConfiguration();return b.npaw&&b.npaw.disabledSubtitlesLabel?b.npaw.disabledSubtitlesLabel:"off"}}return a},rw=function(){class a extends NpawPluginAdapters.ads.Ima{constructor(){super();
|
|
19
19
|
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.Ua(),this.a.Ta(),this.a.Ba()));return b}getBitrate(){let b=null;this.a&&(b=this.a.Ba());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());return b}getTitle(){let b=null;this.a&&(b=this.a.getTitle());return b}getProvider(){let b=
|
|
20
|
-
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.Ca()){case 0:c=b.Preroll;break;case _.Mj:c=b.Postroll;break;case _.Pj:c=b.Midroll}
|
|
21
|
-
return b&&0<b.getAdVolume()}getExpectedBreaks(){return this.h&&this.h.getCuePoints().length}getGivenBreaks(){return this.getExpectedBreaks()}getExpectedAds(){return this.a&&this.a.Va()}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();b=this.getNpawUtils().calculateAdViewability(b);
|
|
22
|
-
b);return b}getPlayerName(){return _.sa}getVersion(){return"castlabs-ads-adapter-6.34.
|
|
23
|
-
2)),b.on(this.player,_.mc,this.w.bind(this,3)),b.on(this.player,_.Vb,this.H.bind(this)),b.on(this.player,_.
|
|
24
|
-
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(
|
|
25
|
-
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&&
|
|
26
|
-
!1;const c=b.getConfiguration().npaw;return _.ch(c)?c.accountCode?_.z(window.NpawPlugin)||_.z(window.NpawPluginAdapters)?(a.g.warn("NPAW SDK not found."),b.onError(new _.J(1,9,9100)),!1):!0:(a.g.warn("accountCode key is missing in NPAW config"),b.onError(new _.J(1,9,9101)),!1):(a.g.warn("NPAW plugin is loaded but not configured. Will do nothing."),!1)},
|
|
27
|
-
!1;if(!c.accountCode)return a.g.warn("accountCode key is missing in Youbora config"),b.onError(new _.J(1,9,9101)),!1;if(_.z(window.youbora))return a.g.warn("Youbora SDK not found."),b.onError(new _.J(1,9,9100)),!1;"6.8.59"!==youbora.VERSION&&(a.g.warn("Youbora SDK version is not supported. The supported version is 6.8.59, found "+`version ${youbora.VERSION}. Some or all features of YouboraPlugin `+"may not work correctly."),b.onError(new _.J(1,9,9102)));return!0},
|
|
28
|
-
b=>({code:`${b.code}`,message:b.message,severity:b.severity}),
|
|
29
|
-
var c=a.npaw;void 0===c[
|
|
30
|
-
|
|
31
|
-
a.youbora;void 0===c[
|
|
20
|
+
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.Ca()){case 0:c=b.Preroll;break;case _.Mj:c=b.Postroll;break;case _.Pj:c=b.Midroll}qw.debug("Ad position",c);return c}getIsSkippable(){return this.a&&-1!==this.a.getSkipTimeOffset()}getAudioEnabled(){const b=this.player.getAdsManager();
|
|
21
|
+
return b&&0<b.getAdVolume()}getExpectedBreaks(){return this.h&&this.h.getCuePoints().length}getGivenBreaks(){return this.getExpectedBreaks()}getExpectedAds(){return this.a&&this.a.Va()}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();b=this.getNpawUtils().calculateAdViewability(b);qw.debug(jw,
|
|
22
|
+
b);return b}getPlayerName(){return _.sa}getVersion(){return"castlabs-ads-adapter-6.34.1-js"}getPlayerVersion(){return _.ea}B(){this.j||(this.j=new _.Ut);return this.j}registerListeners(){const b=this.B();this.player&&b&&(b.on(this.player,_.oc,this.R.bind(this)),b.on(this.player,_.kc,this.P.bind(this)),b.on(this.player,_.dc,this.K.bind(this)),b.on(this.player,_.hc,this.L.bind(this)),b.on(this.player,_.Wb,this.I.bind(this)),b.on(this.player,_.Xb,this.w.bind(this,1)),b.on(this.player,_.cc,this.w.bind(this,
|
|
23
|
+
2)),b.on(this.player,_.mc,this.w.bind(this,3)),b.on(this.player,_.Vb,this.H.bind(this)),b.on(this.player,_.jc,this.M.bind(this)),b.on(this.player,_.Sd,this.J.bind(this)),b.on(this.player,_.Sb,this.C.bind(this)),b.on(this.player,_.Tb,this.F.bind(this)),b.on(this.player,_.Ub,this.G.bind(this)),b.on(this.player,_.ec,this.S.bind(this)))}unregisterListeners(){_.Fh(this.B())}R(b){qw.debug(ew,b);this.h=b.adsTimeline}P(b){this.a=b.ad;this.f("ad start",this.a);this.fireStart();this.fireJoin()}I(){this.f("ad ended");
|
|
24
|
+
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(cw);this.fireBufferBegin()}S(){this.l=this.getPlayhead();this.A()}A(){this.o&&(this.f(bw),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.Qa();qw.debug(dw,b);this.fireClick(b)}M(){this.f("ad skipped");this.fireSkip()}C(b){this.a=b.ad;this.f(aw,this.a);this.fireBreakStart()}F(){this.f("ad break stop");
|
|
25
|
+
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&&lw(b,this.player.getConfiguration().npaw,qw,this)}f(b,...c){qw.debug(`Reporting "${b}" event to NPAW`,...c)}}return a},sw=function(a){a.a&&(a.g.info("Removing NPAW Plugins",a.a),a.a.removeAdsAdapter(),a.a.removeAdapter())},tw=function(a,b){if(b.namespace()===_.gd)return a.g.info("NPAW does not report when casting."),
|
|
26
|
+
!1;const c=b.getConfiguration().npaw;return _.ch(c)?c.accountCode?_.z(window.NpawPlugin)||_.z(window.NpawPluginAdapters)?(a.g.warn("NPAW SDK not found."),b.onError(new _.J(1,9,9100)),!1):!0:(a.g.warn("accountCode key is missing in NPAW config"),b.onError(new _.J(1,9,9101)),!1):(a.g.warn("NPAW plugin is loaded but not configured. Will do nothing."),!1)},uw=function(a,b){if(b.namespace()===_.gd)return a.g.info("Youbora does not report when casting."),!1;const c=b.getConfiguration().youbora;if(!_.ch(c))return a.g.debug("Youbora plugin is loaded but not configured. Will do nothing."),
|
|
27
|
+
!1;if(!c.accountCode)return a.g.warn("accountCode key is missing in Youbora config"),b.onError(new _.J(1,9,9101)),!1;if(_.z(window.youbora))return a.g.warn("Youbora SDK not found."),b.onError(new _.J(1,9,9100)),!1;"6.8.59"!==youbora.VERSION&&(a.g.warn("Youbora SDK version is not supported. The supported version is 6.8.59, found "+`version ${youbora.VERSION}. Some or all features of YouboraPlugin `+"may not work correctly."),b.onError(new _.J(1,9,9102)));return!0},vw=a=>a&&a.errorFilter?a.errorFilter:
|
|
28
|
+
b=>({code:`${b.code}`,message:b.message,severity:b.severity}),lw=(a,b,c,d)=>{b=vw(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===a.code?"ad error":_.Sd;b.severity===_.C?(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 ow=new _.S("clpp.npaw.NpawAdapter");var qw=new _.S("clpp.npaw.NpawAdsAdapter");var ww=class extends _.Zv{constructor(){super();this.a=null;this.g=new _.S(fw);this.m=null}Af(a){sw(this);if(this.a=a)this.a.registerAdapterFromClass(this.m,pw()),this.a.registerAdsAdapterFromClass(this.m,rw())}Zh(){return this.a}getAdapter(){return this.a&&this.a.getAdapter()}getAdsAdapter(){return this.a&&this.a.getAdsAdapter()}onPlayerCreated(a){this.m=a;tw(this,a)&&(a=a.getConfiguration().npaw,this.Af(new NpawPlugin(a.accountCode)))}onContentWillLoad(a,b){if(tw(this,a)){a=a.getConfiguration();
|
|
29
|
+
var c=a.npaw;void 0===c[hw]&&(c[hw]=b.isLive);void 0===c[iw]&&(c[iw]=b.name);void 0===c.viewerId&&(c.viewerId=a.viewerId);this.a||this.Af(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(_.Ee,b);this.a.setAnalyticsOptions(b)}onPlayerWillRelease(){}onPlayerWillDestroy(){sw(this);this.a&&this.a.destroy()}id(){return"npaw"}};_.w(fw,ww);ww.prototype.getAdsAdapter=ww.prototype.getAdsAdapter;
|
|
30
|
+
ww.prototype.getAdapter=ww.prototype.getAdapter;ww.prototype.getNpawPlugin=ww.prototype.Zh;ww.prototype.setNpawPlugin=ww.prototype.Af;ww.Id="npaw";new _.S(fw);var xw=class extends _.Zv{constructor(){super();this.a=null;this.g=new _.S(gw);this.m=null}Bf(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(mw(this.m)),this.a.setAdsAdapter(nw(this.m))}getAdapter(){return this.a&&this.a.getAdapter()}getAdsAdapter(){return this.a&&this.a.getAdsAdapter()}onPlayerCreated(a){this.m=a;uw(this,a)&&(a=a.getConfiguration().youbora,this.Bf(new youbora.Plugin(a)))}onContentWillLoad(a,b){if(uw(this,a)){a=a.getConfiguration();var c=
|
|
31
|
+
a.youbora;void 0===c[hw]&&(c[hw]=b.isLive);void 0===c[iw]&&(c[iw]=b.name);void 0===c.viewerId&&(c.viewerId=a.viewerId);this.a||this.Bf(new youbora.Plugin(c));this.a.setOptions(c)}}onPlayerWillRelease(){}onPlayerWillDestroy(){}id(){return"youbora"}};_.w(gw,xw);xw.prototype.getAdsAdapter=xw.prototype.getAdsAdapter;xw.prototype.getAdapter=xw.prototype.getAdapter;xw.prototype.setYouboraPlugin=xw.prototype.Bf;xw.Id="youbora";_.Sr(new class{create(a){return a.npaw?new ww:a.youbora?new xw:null}});};f.call(g, window);
|
package/package.json
CHANGED
package/typings.d.ts
CHANGED
|
@@ -653,58 +653,6 @@ export namespace clpp {
|
|
|
653
653
|
persistentState: boolean;
|
|
654
654
|
}
|
|
655
655
|
|
|
656
|
-
/**
|
|
657
|
-
* Contains information about an EMSG MP4 box.
|
|
658
|
-
*/
|
|
659
|
-
export type EmsgInfo = {
|
|
660
|
-
/**
|
|
661
|
-
* The time that the event ends (in presentation time).
|
|
662
|
-
*/
|
|
663
|
-
endTime: number;
|
|
664
|
-
/**
|
|
665
|
-
* The duration of the event (in units of timescale).
|
|
666
|
-
*/
|
|
667
|
-
eventDuration: number;
|
|
668
|
-
/**
|
|
669
|
-
* A field identifying this instance of the message.
|
|
670
|
-
*/
|
|
671
|
-
id: number;
|
|
672
|
-
/**
|
|
673
|
-
* Body of the message.
|
|
674
|
-
*/
|
|
675
|
-
messageData: Uint8Array;
|
|
676
|
-
/**
|
|
677
|
-
* The absolute event presentation time (in units of timescale).
|
|
678
|
-
* Available for EMSG v1.
|
|
679
|
-
*/
|
|
680
|
-
presentationTime?: number;
|
|
681
|
-
/**
|
|
682
|
-
* The offset that the event starts, relative to the start of the segment
|
|
683
|
-
* this is contained in (in units of timescale). Available for EMSG v0.
|
|
684
|
-
*/
|
|
685
|
-
presentationTimeDelta?: number;
|
|
686
|
-
/**
|
|
687
|
-
* Identifies the message scheme.
|
|
688
|
-
*/
|
|
689
|
-
schemeIdUri: string;
|
|
690
|
-
/**
|
|
691
|
-
* The time that the event starts (in presentation time).
|
|
692
|
-
*/
|
|
693
|
-
startTime: number;
|
|
694
|
-
/**
|
|
695
|
-
* Provides the timescale, in ticks per second.
|
|
696
|
-
*/
|
|
697
|
-
timescale: number;
|
|
698
|
-
/**
|
|
699
|
-
* Specifies the value for the event.
|
|
700
|
-
*/
|
|
701
|
-
value: string;
|
|
702
|
-
/**
|
|
703
|
-
* Version of the EMSG box (0 or 1).
|
|
704
|
-
*/
|
|
705
|
-
version: number;
|
|
706
|
-
}
|
|
707
|
-
|
|
708
656
|
/**
|
|
709
657
|
* The type for event listener callback functions.
|
|
710
658
|
*/
|
|
@@ -811,11 +759,11 @@ export namespace clpp {
|
|
|
811
759
|
*/
|
|
812
760
|
id: string;
|
|
813
761
|
/**
|
|
814
|
-
* Maximum duration of the slot allowed.
|
|
762
|
+
* Maximum duration of the slot allowed in seconds.
|
|
815
763
|
*/
|
|
816
764
|
maxDuration?: number;
|
|
817
765
|
/**
|
|
818
|
-
* Minimum duration of the slot allowed.
|
|
766
|
+
* Minimum duration of the slot allowed in seconds.
|
|
819
767
|
*/
|
|
820
768
|
minDuration?: number;
|
|
821
769
|
/**
|
|
@@ -871,12 +819,12 @@ export namespace clpp {
|
|
|
871
819
|
* There are platforms where the video size is fixed (for example Smart TVs)
|
|
872
820
|
* and the resize observer might be disabled to not cause unnecessary load.
|
|
873
821
|
*/
|
|
874
|
-
enableResizeObserver
|
|
822
|
+
enableResizeObserver?: boolean;
|
|
875
823
|
/**
|
|
876
824
|
* Stretch a subtitle image (like SMPTE-TT or IMSC1) to fit the surrounding
|
|
877
825
|
* container.
|
|
878
826
|
*/
|
|
879
|
-
stretchSmpteImage
|
|
827
|
+
stretchSmpteImage?: boolean;
|
|
880
828
|
}
|
|
881
829
|
|
|
882
830
|
/**
|
|
@@ -1676,13 +1624,13 @@ export namespace clpp {
|
|
|
1676
1624
|
cropTimeline?: boolean;
|
|
1677
1625
|
/**
|
|
1678
1626
|
* This option applies to the single-controller playlist. It is the time
|
|
1679
|
-
* at which the playlist should stop. The time is relative to the
|
|
1627
|
+
* in seconds at which the playlist should stop. The time is relative to the
|
|
1680
1628
|
* start of the first playlist item and may span several items.
|
|
1681
1629
|
*/
|
|
1682
1630
|
endTime?: number;
|
|
1683
1631
|
/**
|
|
1684
1632
|
* This option applies to the single-controller playlist. IT is the time
|
|
1685
|
-
* within the first playlist item at which the playlist should start
|
|
1633
|
+
* in seconds within the first playlist item at which the playlist should start
|
|
1686
1634
|
* playback. The time is relative to the start of the first playlist item.
|
|
1687
1635
|
*/
|
|
1688
1636
|
startTime?: number;
|
|
@@ -2014,18 +1962,17 @@ export namespace clpp {
|
|
|
2014
1962
|
*/
|
|
2015
1963
|
adParameters?: string;
|
|
2016
1964
|
/**
|
|
2017
|
-
* The duration of the SIMID creative
|
|
1965
|
+
* The duration of the SIMID creative in seconds
|
|
2018
1966
|
*/
|
|
2019
1967
|
duration: number;
|
|
2020
1968
|
/**
|
|
2021
|
-
*
|
|
2022
|
-
*
|
|
2023
|
-
* player will load the creative at startTime-5.
|
|
1969
|
+
* The offset in seconds before the startTime at
|
|
1970
|
+
* which to preload the creative
|
|
2024
1971
|
*/
|
|
2025
|
-
preload
|
|
1972
|
+
preload?: number;
|
|
2026
1973
|
/**
|
|
2027
1974
|
* The start time in seconds relative to the main
|
|
2028
|
-
* content timeline
|
|
1975
|
+
* content timeline
|
|
2029
1976
|
*/
|
|
2030
1977
|
startTime: number;
|
|
2031
1978
|
/**
|
|
@@ -2430,17 +2377,6 @@ export namespace clpp {
|
|
|
2430
2377
|
* in a Player event and can be jumped.
|
|
2431
2378
|
*/
|
|
2432
2379
|
smallGapLimit: number;
|
|
2433
|
-
/**
|
|
2434
|
-
* When set to |true|, the stall detector logic will run, skipping forward
|
|
2435
|
-
* |stallSkip| seconds whenever the playhead stops moving for |stallThreshold|
|
|
2436
|
-
* seconds.
|
|
2437
|
-
*/
|
|
2438
|
-
stallEnabled: boolean;
|
|
2439
|
-
/**
|
|
2440
|
-
* The maximum number of seconds that the player will skip forward when a
|
|
2441
|
-
* stall has been detected.
|
|
2442
|
-
*/
|
|
2443
|
-
stallSkip: number;
|
|
2444
2380
|
/**
|
|
2445
2381
|
* The maximum number of seconds that may elapse without the playhead moving
|
|
2446
2382
|
* (when playback is expected) before it will be labeled as a stall.
|
|
@@ -3285,17 +3221,11 @@ export namespace clpp {
|
|
|
3285
3221
|
*/
|
|
3286
3222
|
LOADEDMETADATA = "loadedmetadata",
|
|
3287
3223
|
/**
|
|
3288
|
-
* Triggered when player
|
|
3289
|
-
* The detail will contains the
|
|
3290
|
-
* {@link clpp.events.BufferingDetails|BufferingDetails} that exposes the
|
|
3291
|
-
* reason for the buffering start.
|
|
3224
|
+
* Triggered when player finishes buffering.
|
|
3292
3225
|
*/
|
|
3293
3226
|
BUFFERING_ENDED = "bufferingended",
|
|
3294
3227
|
/**
|
|
3295
3228
|
* Triggered when player starts buffering.
|
|
3296
|
-
* The detail will contains the
|
|
3297
|
-
* {@link clpp.events.BufferingDetails|BufferingDetails} that exposes the
|
|
3298
|
-
* reason for the buffering start.
|
|
3299
3229
|
*/
|
|
3300
3230
|
BUFFERING_STARTED = "bufferingstarted",
|
|
3301
3231
|
/**
|
|
@@ -3362,11 +3292,6 @@ export namespace clpp {
|
|
|
3362
3292
|
* Triggered when an audio segment is appended or removed
|
|
3363
3293
|
*/
|
|
3364
3294
|
AUDIO_BUFFER_CHANGED = "audiobufferchanged",
|
|
3365
|
-
/**
|
|
3366
|
-
* Triggered when a video or audio segment was downloaded successfully
|
|
3367
|
-
* and considered by the players bandwidth estimation.
|
|
3368
|
-
*/
|
|
3369
|
-
DOWNLOAD_TRACE = "downloadtrace",
|
|
3370
3295
|
/**
|
|
3371
3296
|
* Triggered when the players DRM session is created.
|
|
3372
3297
|
*/
|
|
@@ -3714,7 +3639,7 @@ export namespace clpp {
|
|
|
3714
3639
|
* The default behavior includes gaps, meaning if the playhead is in a
|
|
3715
3640
|
* gap, it is considered buffered.
|
|
3716
3641
|
*
|
|
3717
|
-
* @param time
|
|
3642
|
+
* @param time time in seconds
|
|
3718
3643
|
* @param opt_includeGaps If false, gaps will not be
|
|
3719
3644
|
* included, meaning if the time is in a gap it will be considered
|
|
3720
3645
|
* un-buffered. The default is to consider gaps as buffered.
|
|
@@ -4979,7 +4904,7 @@ export namespace clpp {
|
|
|
4979
4904
|
/**
|
|
4980
4905
|
* The WebM header parser was unable to locate the Duration element.
|
|
4981
4906
|
* The init segment data may be corrupt or may have been incorrectly encoded.
|
|
4982
|
-
*
|
|
4907
|
+
* Duration information in WebM DASH content is required.
|
|
4983
4908
|
*/
|
|
4984
4909
|
WEBM_DURATION_ELEMENT_MISSING = 3011,
|
|
4985
4910
|
/**
|
|
@@ -6960,13 +6885,12 @@ export namespace clpp {
|
|
|
6960
6885
|
* Container object that contains meta-data for a buffering event.
|
|
6961
6886
|
* The object is send with
|
|
6962
6887
|
* {@link clpp.events.BUFFERING_STARTED|BUFFERING_STARTED} and
|
|
6963
|
-
* {@link clpp.events.BUFFERING_ENDED|BUFFERING_ENDED} events.
|
|
6964
|
-
* note that the bufferedTimeMs will be -1 for a CLPP_BUFFERING_STARTED event.
|
|
6888
|
+
* {@link clpp.events.BUFFERING_ENDED|BUFFERING_ENDED} events.
|
|
6965
6889
|
*/
|
|
6966
6890
|
export type BufferingDetails = {
|
|
6967
6891
|
/**
|
|
6968
|
-
* The time the player
|
|
6969
|
-
* BUFFERING_STARTED events
|
|
6892
|
+
* The time in milliseconds the player spent in buffering state or -1
|
|
6893
|
+
* in case of BUFFERING_STARTED events
|
|
6970
6894
|
*/
|
|
6971
6895
|
bufferedTimeMS: number;
|
|
6972
6896
|
/**
|
|
@@ -7003,13 +6927,13 @@ export namespace clpp {
|
|
|
7003
6927
|
*/
|
|
7004
6928
|
maxSuggestedBitrateKbps?: number;
|
|
7005
6929
|
/**
|
|
7006
|
-
* The time elapsed between the receipt of the request
|
|
6930
|
+
* The time in milliseconds elapsed between the receipt of the request
|
|
7007
6931
|
* and when the first byte of the body becomes available to send to the client.
|
|
7008
6932
|
* Header-Key: rd
|
|
7009
6933
|
*/
|
|
7010
6934
|
responseDelay?: number;
|
|
7011
6935
|
/**
|
|
7012
|
-
* Estimated round trip time between client and server.
|
|
6936
|
+
* Estimated round trip time in milliseconds between client and server.
|
|
7013
6937
|
* This estimate may be derived from the transport handshake.
|
|
7014
6938
|
* Header-Key: rtt
|
|
7015
6939
|
*/
|
|
@@ -7280,6 +7204,9 @@ export namespace clpp {
|
|
|
7280
7204
|
* to the presentation). |endTime| will be greater to equal to |startTime|.
|
|
7281
7205
|
* |remove| should only return |false| if the displayer has been destroyed. If
|
|
7282
7206
|
* the displayer has not been destroyed |remove| should return |true|.
|
|
7207
|
+
*
|
|
7208
|
+
* @param startTime start time in seconds
|
|
7209
|
+
* @param endTime end time in seconds
|
|
7283
7210
|
*/
|
|
7284
7211
|
remove(startTime: number, endTime: number): boolean;
|
|
7285
7212
|
/**
|
|
@@ -7632,45 +7559,6 @@ export namespace clpp {
|
|
|
7632
7559
|
timeout: number;
|
|
7633
7560
|
}
|
|
7634
7561
|
|
|
7635
|
-
/**
|
|
7636
|
-
* Container object that contains information about a single download trace.
|
|
7637
|
-
* The object is send with
|
|
7638
|
-
* {@link clpp.events.DOWNLOAD_TRACE|DOWNLOAD_TRACE} events.
|
|
7639
|
-
*/
|
|
7640
|
-
export type DownloadTrace = {
|
|
7641
|
-
/**
|
|
7642
|
-
* The current bandwidth estimation after the sample was pushed.
|
|
7643
|
-
*/
|
|
7644
|
-
bandwidthEstimate: number;
|
|
7645
|
-
/**
|
|
7646
|
-
* The calculated speed of the download in bps
|
|
7647
|
-
*/
|
|
7648
|
-
bitrate: number;
|
|
7649
|
-
/**
|
|
7650
|
-
* The type of the downloaded segment. One of 'audio', 'video', or 'text' if
|
|
7651
|
-
* known.
|
|
7652
|
-
*/
|
|
7653
|
-
contentType: string;
|
|
7654
|
-
/**
|
|
7655
|
-
* True if the downloaded segment was an init segment.
|
|
7656
|
-
*/
|
|
7657
|
-
initSegment: boolean;
|
|
7658
|
-
/**
|
|
7659
|
-
* The number of bytes downloaded
|
|
7660
|
-
*/
|
|
7661
|
-
size: number;
|
|
7662
|
-
/**
|
|
7663
|
-
* The download time in milliseconds
|
|
7664
|
-
*/
|
|
7665
|
-
time: number;
|
|
7666
|
-
/**
|
|
7667
|
-
* Either 'full' or 'partial'. Full trace events are posted after the entire
|
|
7668
|
-
* segment was downloaded while partial traces are posted during an ongoing
|
|
7669
|
-
* download.
|
|
7670
|
-
*/
|
|
7671
|
-
type: string;
|
|
7672
|
-
}
|
|
7673
|
-
|
|
7674
7562
|
export type Mp4Fragment = {
|
|
7675
7563
|
/**
|
|
7676
7564
|
* The number of mdat boxes in this fragment or
|
|
@@ -7756,7 +7644,7 @@ export namespace clpp {
|
|
|
7756
7644
|
*/
|
|
7757
7645
|
disableMergedFragments: boolean|null;
|
|
7758
7646
|
/**
|
|
7759
|
-
* The media end time or null
|
|
7647
|
+
* The media end time in seconds or null
|
|
7760
7648
|
*/
|
|
7761
7649
|
endTime: number|null;
|
|
7762
7650
|
/**
|
|
@@ -7830,7 +7718,7 @@ export namespace clpp {
|
|
|
7830
7718
|
*/
|
|
7831
7719
|
sessionId: string|null;
|
|
7832
7720
|
/**
|
|
7833
|
-
* The media start time or null
|
|
7721
|
+
* The media start time in seconds or null
|
|
7834
7722
|
*/
|
|
7835
7723
|
startTime: number|null;
|
|
7836
7724
|
/**
|