@castlabs/prestoplay 6.31.0 → 6.32.0-beta.2
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 +38 -0
- package/README.md +2 -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 -125
- package/cjs/cl.cdn.js +13 -0
- package/cjs/cl.conviva.js +32 -32
- package/cjs/cl.core.js +615 -610
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +101 -95
- package/cjs/cl.externs.js +113 -44
- package/cjs/cl.freewheel.js +26 -26
- package/cjs/cl.hls.js +78 -78
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +26 -26
- package/cjs/cl.mediatailor.js +3 -3
- package/cjs/cl.mse.js +351 -350
- 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 +71 -71
- package/cjs/cl.ttml.js +29 -29
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +11 -11
- 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 +40 -40
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +14 -14
- package/cl.cast.js +102 -101
- package/cl.cdn.js +7 -0
- package/cl.conviva.js +27 -27
- package/cl.core.js +498 -495
- package/cl.crypto.js +9 -9
- package/cl.dash.js +91 -87
- package/cl.externs.js +109 -44
- package/cl.freewheel.js +20 -20
- package/cl.hls.js +82 -82
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +20 -20
- package/cl.mediatailor.js +2 -2
- package/cl.mse.js +301 -300
- package/cl.muxdata.js +13 -13
- package/cl.onboard.js +4 -4
- 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 +8 -8
- package/cl.vr.js +14 -14
- package/cl.vtt.js +12 -12
- package/cl.yospace.js +3 -3
- package/cl.youbora.js +31 -31
- package/package.json +10 -1
- package/typings.d.ts +328 -114
package/cjs/cl.vr.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
b):(a.x=0,a.y=0,a.a=0)},
|
|
4
|
-
3]=b[4*e]*c[3]+b[4*e+1]*c[7]+b[4*e+2]*c[11]+b[4*e+3]*c[15];while(4>++e);return a},
|
|
5
|
-
|
|
6
|
-
0,"aPosition");a.bindAttribLocation(this.f,1,"aTexCoord");a.linkProgram(this.f);if(!a.getProgramParameter(this.f,a.LINK_STATUS))throw new _.O(1,9,9004,"Unable to initialize shader");a.useProgram(this.f);this.h=a.getUniformLocation(this.f,"Mvpm");a.uniform1i(a.getUniformLocation(this.f,"Texture0"),0);a.useProgram(null)},
|
|
7
|
-
9,9004,"Unable to compile GL shader: "+a.a.getShaderInfoLog(b));return b},
|
|
8
|
-
5*(129*d+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*d+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*d+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]);this.h=e.length/5;this.f=a.createBuffer();b=new Float32Array(e);a.bindBuffer(a.ARRAY_BUFFER,this.f);a.bufferData(a.ARRAY_BUFFER,b,a.STATIC_DRAW)},
|
|
9
|
-
b){this.a=b;this.f=this.a.createTexture();b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,this.f);b.texImage2D(b.TEXTURE_2D,0,b.RGB,b.RGB,b.UNSIGNED_BYTE,a);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.LINEAR);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.LINEAR);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.bindTexture(b.TEXTURE_2D,null)},
|
|
10
|
-
this.ba=this.H=this.f=this.a=this.m=null;this.g=new _.M("clpp.vr");this.I=70;this.X=1;this.P=this.M=!1;this.G=function(){if(a.a&&a.f){a.f.viewport(0,0,a.a.width,a.a.height);var b=a.L.a,c=Math.tan(.5*a.I*Math.PI/180);b[0]=1/(a.a.width/a.a.height*c);b[1]=0;b[2]=0;b[3]=0;b[4]=0;b[5]=1/c;b[6]=0;b[7]=0;b[8]=0;b[9]=0;b[10]=2E3/-1999.9;b[11]=200/-1999.9;b[12]=0;b[13]=0;b[14]=-1;b[15]=1}};this.l=this.j=0;this.h={x:0,y:0};this.T=new
|
|
11
|
-
this.D=this.
|
|
12
|
-
_.r.onContentWillLoad=function(a){var b=a.getConfiguration();if(b.vr&&b.vr.enable){var c=b.vr,d=c.fieldOfView,e=c.sensitivity,f=c.invertHorizontalControl;c=c.invertVerticalControl;if(void 0!==d&&_.N.
|
|
13
|
-
if(!this.a){this.a=document.createElement("canvas");this.a.style.width="100%";this.f=this.a.getContext("webgl",
|
|
14
|
-
!1),this.a.addEventListener(
|
|
15
|
-
_.r.onPlayerWillRelease=function(){this.g.info("Releasing VR plugin resources");this.w&&cancelAnimationFrame(this.w);this.h.x=0;this.l=this.j=this.h.y=0;this.f&&(delete this.f,this.f=null);this.a&&(
|
|
16
|
-
_.r.
|
|
17
|
-
0,0,1);b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT);if(this.o){var c=this.A;c.a.useProgram(c.f);c
|
|
2
|
+
var f=function(window){var Qx="touchmove",Rx="touchstart",Sx=function(a,b,c,d){this.x=a||0;this.y=b||0;this.a=c||0;this.f=d||1},Tx=function(a,b){var c=a.x,d=a.y,e=a.a,f=a.f;b.set(1-2*(d*d+e*e),2*(c*d-e*f),2*(c*e+d*f),0,2*(c*d+e*f),1-2*(c*c+e*e),2*(d*e-c*f),0,2*(c*e-d*f),2*(d*e+c*f),1-2*(c*c+d*d),0,0,0,0,1)},Ux=function(a,b,c){c*=.5;var d=Math.sqrt(a*a+b*b),e=Math.sin(c);return new Sx(a/d*e,b/d*e,0/d*e,Math.cos(c))},Vx=function(a,b,c){this.x=a||0;this.y=b||0;this.a=c||0},Wx=function(a,b){isFinite(b)?(a.x*=b,a.y*=b,a.a*=
|
|
3
|
+
b):(a.x=0,a.y=0,a.a=0)},Xx=function(a,b){return a.x*b.x+a.y*b.y+a.a*b.a},Yx=function(a,b,c){var d=b.x,e=b.y;b=b.a;var f=c.x,g=c.y;c=c.a;a.x=e*c-b*g;a.y=b*f-d*c;a.a=d*g-e*f;return a},Zx=function(){this.a=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])},$x=function(a,b,c){b=b.a;c=c.a;var d=a.a,e=0;do d[4*e]=b[4*e]*c[0]+b[4*e+1]*c[4]+b[4*e+2]*c[8]+b[4*e+3]*c[12],d[4*e+1]=b[4*e]*c[1]+b[4*e+1]*c[5]+b[4*e+2]*c[9]+b[4*e+3]*c[13],d[4*e+2]=b[4*e]*c[2]+b[4*e+1]*c[6]+b[4*e+2]*c[10]+b[4*e+3]*c[14],d[4*e+
|
|
4
|
+
3]=b[4*e]*c[3]+b[4*e+1]*c[7]+b[4*e+2]*c[11]+b[4*e+3]*c[15];while(4>++e);return a},ay=function(a){var b=new Vx(0,0,0),c=new Vx(0,0,1),d=new Vx,e=new Vx,f=new Vx;a=a.a;var g=new Vx(0,1,0);f.x=b.x-g.x;f.y=b.y-g.y;f.a=b.a-g.a;g=f.length();Wx(f,1/g);c=Yx(d,c,f);g=c.length();Wx(c,1/g);Yx(e,f,d);a[0]=d.x;a[1]=d.y;a[2]=d.a;a[3]=-Xx(d,b);a[4]=e.x;a[5]=e.y;a[6]=e.a;a[7]=-Xx(e,b);a[8]=f.x;a[9]=f.y;a[10]=f.a;a[11]=-Xx(f,b);a[12]=0;a[13]=0;a[14]=0;a[15]=1},cy=function(a){this.a=a;this.f=a.createProgram();this.l=
|
|
5
|
+
by(this,!1,"uniform highp mat4 Mvpm;\nattribute highp vec4 aPosition;\nattribute highp vec2 aTexCoord;\nvarying highp vec2 oTexCoord;\nvoid main()\n{\n gl_Position \x3d Mvpm * aPosition;\n oTexCoord \x3d aTexCoord;\n}\n");this.j=by(this,!0,"precision highp float;\nuniform sampler2D Texture0;\nvarying highp vec2 oTexCoord;\nvoid main()\n{\n gl_FragColor \x3d texture2D(Texture0, oTexCoord);\n gl_FragColor.w \x3d 1.0;\n}\n");a.attachShader(this.f,this.l);a.attachShader(this.f,this.j);a.bindAttribLocation(this.f,
|
|
6
|
+
0,"aPosition");a.bindAttribLocation(this.f,1,"aTexCoord");a.linkProgram(this.f);if(!a.getProgramParameter(this.f,a.LINK_STATUS))throw new _.O(1,9,9004,"Unable to initialize shader");a.useProgram(this.f);this.h=a.getUniformLocation(this.f,"Mvpm");a.uniform1i(a.getUniformLocation(this.f,"Texture0"),0);a.useProgram(null)},by=function(a,b,c){b=a.a.createShader(b?a.a.FRAGMENT_SHADER:a.a.VERTEX_SHADER);a.a.shaderSource(b,c);a.a.compileShader(b);if(!a.a.getShaderParameter(b,a.a.COMPILE_STATUS))throw new _.O(1,
|
|
7
|
+
9,9004,"Unable to compile GL shader: "+a.a.getShaderInfoLog(b));return b},dy=function(a){this.a=a;var b=[],c,d;for(d=0;70>=d;d++){var e=3>=d?d/4/64:67<=d?(63+(d-66)/4)/64:(d-3)/64;var f=(e-.5)*Math.PI,g=Math.cos(f);for(c=0;128>=c;c++){var k=c/128,l=(.5+k)*Math.PI*2;128===c?(b.push(b[645*d]),b.push(b[645*d+1]),b.push(b[645*d+2])):(b.push(100*Math.cos(l)*g),b.push(100*Math.sin(l)*g),b.push(100*Math.sin(f)));0===d||70===d?b.push(.5):b.push(1-k);b.push(1-e)}}e=[];for(c=0;128>c;c++)for(d=0;70>d;d++)f=
|
|
8
|
+
5*(129*d+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*d+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*d+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]);this.h=e.length/5;this.f=a.createBuffer();b=new Float32Array(e);a.bindBuffer(a.ARRAY_BUFFER,this.f);a.bufferData(a.ARRAY_BUFFER,b,a.STATIC_DRAW)},ey=function(a,
|
|
9
|
+
b){this.a=b;this.f=this.a.createTexture();b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,this.f);b.texImage2D(b.TEXTURE_2D,0,b.RGB,b.RGB,b.UNSIGNED_BYTE,a);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.LINEAR);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.LINEAR);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.bindTexture(b.TEXTURE_2D,null)},fy=function(){var a=this;this.o=this.w=this.L=this.J=this.A=
|
|
10
|
+
this.ba=this.H=this.f=this.a=this.m=null;this.g=new _.M("clpp.vr");this.I=70;this.X=1;this.P=this.M=!1;this.G=function(){if(a.a&&a.f){a.f.viewport(0,0,a.a.width,a.a.height);var b=a.L.a,c=Math.tan(.5*a.I*Math.PI/180);b[0]=1/(a.a.width/a.a.height*c);b[1]=0;b[2]=0;b[3]=0;b[4]=0;b[5]=1/c;b[6]=0;b[7]=0;b[8]=0;b[9]=0;b[10]=2E3/-1999.9;b[11]=200/-1999.9;b[12]=0;b[13]=0;b[14]=-1;b[15]=1}};this.l=this.j=0;this.h={x:0,y:0};this.T=new Zx;this.W=new Zx;this.ha=new Zx;this.ma=new Zx;this.B=this.$n.bind(this);
|
|
11
|
+
this.D=this.ao.bind(this);this.K=this.Zn.bind(this)},gy=function(a){var b=Ux(1,0,a.l*Math.PI/180);Tx(Ux(0,1,a.j*Math.PI/180),a.T);Tx(b,a.W);ay(a.ha);$x(a.ma,a.T,a.ha);$x(a.H,a.W,a.ma)},hy=function(a){a.a&&(a.a.removeEventListener("mousemove",a.B,!1),a.a.removeEventListener(Qx,a.B,!1),a.a.removeEventListener("mouseup",a.D,!1),a.a.removeEventListener("touchend",a.D,!1))},iy=function(){};Vx.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.a*this.a)};Zx.prototype.set=function(a,b,c,d,e,f,g,k,l,m,n,p,q,t,u,z){var B=this.a;B[0]=a;B[4]=b;B[8]=c;B[12]=d;B[1]=e;B[5]=f;B[9]=g;B[13]=k;B[2]=l;B[6]=m;B[10]=n;B[14]=p;B[3]=q;B[7]=t;B[11]=u;B[15]=z;return this};var jy={alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!1,devicePixelRatio:1};_.w(fy,_.gw);_.r=fy.prototype;_.r.onPlayerCreated=function(a){this.g.info("Player created");this.m=a};
|
|
12
|
+
_.r.onContentWillLoad=function(a){var b=a.getConfiguration();if(b.vr&&b.vr.enable){var c=b.vr,d=c.fieldOfView,e=c.sensitivity,f=c.invertHorizontalControl;c=c.invertVerticalControl;if(void 0!==d&&_.N.ya(d))this.I=d;else throw new _.O(1,7,7100,"fieldOfView configuration must be a number");if(void 0!==e&&_.N.ya(e)&&0<e)this.X=e;else throw new _.O(1,7,7100,"sensitivity configuration must be a positive number");this.M=!!f;this.P=!!c;if(a=a.getSurface())if((d=a.getMedia())&&d.tagName.toLowerCase()===_.Tg){this.g.info("Initialize VR Surface");
|
|
13
|
+
if(!this.a){this.a=document.createElement("canvas");this.a.style.width="100%";this.f=this.a.getContext("webgl",jy)||this.a.getContext("experimental-webgl",jy);if(!this.f)throw new _.O(1,9,9003,"Unable to create GL context");this.H=new Zx;ay(this.H);this.ba=new dy(this.f);this.A=new cy(this.f);this.J=new Zx;this.L=new Zx;this.o=this.w=null;this.a.addEventListener(_.Vf,this.G)}a.addElementToContainer(this.a,!0,!0);a.hideMediaElement();b.vr.attachMouseListener&&(this.a.addEventListener("mousedown",this.K,
|
|
14
|
+
!1),this.a.addEventListener(Rx,this.K,!1));this.G();this.Pj()}else this.g.info("No video element found, can not initialize VR plugin");else this.g.info("No surface found, can not initialize VR plugin")}};
|
|
15
|
+
_.r.onPlayerWillRelease=function(){this.g.info("Releasing VR plugin resources");this.w&&cancelAnimationFrame(this.w);this.h.x=0;this.l=this.j=this.h.y=0;this.f&&(delete this.f,this.f=null);this.a&&(hy(this),this.a.removeEventListener(_.Vf,this.G),this.a.parentElement.removeChild(this.a),this.a.removeEventListener("mousedown",this.K,!1),delete this.a,this.a=null)};_.r.onPlayerWillDestroy=function(){var a=this;return _.I(function(b){a.m=null;_.A(b)})};_.r.id=function(){return"vr"};
|
|
16
|
+
_.r.Pj=function(){if(this.m&&this.f){var a=this.m.getSurface();if(a&&(a=a.getMedia())&&a.tagName.toLowerCase()===_.Tg){this.w=requestAnimationFrame(this.Pj.bind(this));var b=this.f;this.o||a.readyState!==a.HAVE_ENOUGH_DATA||(this.o=new ey(a,b));b.clearColor(0,0,0,1);b.clearDepth(1);b.clearStencil(0);b.enable(b.DEPTH_TEST);b.depthFunc(b.LEQUAL);b.frontFace(b.CCW);b.cullFace(b.BACK);b.disable(b.CULL_FACE);b.enable(b.BLEND);b.blendFunc(b.SRC_ALPHA,b.ONE_MINUS_SRC_ALPHA);b.depthMask(!0);b.clearColor(0,
|
|
17
|
+
0,0,1);b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT);if(this.o){var c=this.A;c.a.useProgram(c.f);c=$x(this.J,this.L,this.H).a;var d=c[1];c[1]=c[4];c[4]=d;d=c[2];c[2]=c[8];c[8]=d;d=c[6];c[6]=c[9];c[9]=d;d=c[3];c[3]=c[12];c[12]=d;d=c[7];c[7]=c[13];c[13]=d;d=c[11];c[11]=c[14];c[14]=d;b.uniformMatrix4fv(this.A.h,!1,this.J.a);c=this.o;c.a.activeTexture(c.a.TEXTURE0);c.a.bindTexture(c.a.TEXTURE_2D,c.f);b.texImage2D(b.TEXTURE_2D,0,b.RGB,b.RGB,b.UNSIGNED_BYTE,a);a=this.ba;a.a.bindBuffer(a.a.ARRAY_BUFFER,
|
|
18
18
|
a.f);a.a.vertexAttribPointer(0,3,a.a.FLOAT,!1,20,0);a.a.vertexAttribPointer(1,2,a.a.FLOAT,!1,20,12);a.a.enableVertexAttribArray(0);a.a.enableVertexAttribArray(1);a.a.drawArrays(a.a.TRIANGLES,0,a.h);a=this.o;a.a.bindTexture(a.a.TEXTURE_2D,null);this.A.a.useProgram(null)}}}};
|
|
19
|
-
_.r.
|
|
20
|
-
_.r
|
|
21
|
-
_.r.
|
|
19
|
+
_.r.Zn=function(a){this.g.debug("Mouse Down. Enable VR mouse interaction");a.preventDefault();if(0===a.button||a.type===Rx)a.type===Rx?a.touches[0]&&(this.h.x=a.touches[0].clientX,this.h.y=a.touches[0].clientY):(this.h.x=a.clientX,this.h.y=a.clientY),this.g.debug("Mouse Start coordinates:",this.h,a),this.a.addEventListener("mousemove",this.B,!1),this.a.addEventListener(Qx,this.B,!1),this.a.addEventListener("mouseup",this.D,!1),this.a.addEventListener("touchend",this.D,!1)};
|
|
20
|
+
_.r.$n=function(a){a.preventDefault();var b=a.clientX,c=a.clientY;a.type===Qx&&a.touches[0]&&(b=a.touches[0].clientX,c=a.touches[0].clientY);a=this.h.x-b;var d=this.h.y-c;this.h.x=b;this.h.y=c;b=this.X;c=d*b*(this.P?-1:1);this.j+=a*b*(this.M?-1:1);this.l+=c;gy(this)};_.r.ao=function(a){this.g.debug("Mouse Up. Removing mouse interaction listeners");a.preventDefault();hy(this)};_.r.sn=function(a,b){this.l=b;this.j=a;gy(this)};_.r.wm=function(){return{x:this.j,y:this.l}};
|
|
21
|
+
_.r.Wo=function(a){this.I=a;this.G()};_.K("clpp.vr.VrPlugin",fy);fy.prototype.setCameraFieldOfView=fy.prototype.Wo;fy.prototype.getCameraCoordinates=fy.prototype.wm;fy.prototype.moveCamera=fy.prototype.sn;fy.Id="vr";iy.prototype.create=function(){return new fy};_.fp(new iy);};
|
|
22
22
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
23
23
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
24
24
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.vtt.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
a[1].match(/\d+:\d+:\d+/)&&(b+=a[0].match(/\w+/)+"\n",++c);if(a[c].match(/\d+:\d+:\d+/)){var d=a[1].match(/(\d+):(\d+):(\d+)(?:,(\d+))?\s*--?>\s*(\d+):(\d+):(\d+)(?:,(\d+))?/);if(d)b+=d[1]+":"+d[2]+":"+d[3]+"."+d[4]+" --\x3e ",b+=d[5]+":"+d[6]+":"+d[7]+"."+d[8]+"\n",++c;else return""}else return"";a[c]&&(b+=a[c]+"\n\n");return b},
|
|
4
|
-
_.
|
|
5
|
-
Number(c[1]),c[2]&&(a.lineAlign=_.
|
|
6
|
-
a)return null;var b=Number(a[2]),c=Number(a[3]);return 59<b||59<c?null:Number(a[4])/1E3+c+60*b+3600*(Number(a[1])||0)},
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
f/9E4-c}}else this.a.streaming.relativeTextTimestamp&&null!==b.segmentStart&&(c=b.segmentStart);f=[];e=_.v(d);for(var g=e.next();!g.done;g=e.next()){var k=g.value;if(/^region/.test(k.toLowerCase())){k=new _.
|
|
10
|
-
Number(m[1]),n.regionAnchorY=Number(m[2]);else if(m=/^viewportanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.viewportAnchorX=Number(m[1]),n.viewportAnchorY=Number(m[2]);else if(/^scroll:up$/.exec(p))n.scroll="up";else{m=!1;break a}m=!0}m||_.
|
|
11
|
-
e.push(m[0]);while(m)}k=[];d=_.v(d);for(g=d.next();!g.done;g=d.next())if(g=g.value,g.includes("--\x3e")){p=g.split("\n");var q=c;if(1===p.length&&!p[0]||/^NOTE($|[ \t])/.test(p[0])||"STYLE"===p[0])g=null;else{g=null;p[0].includes("--\x3e")||(g=p[0],p.splice(0,1));l=new _.
|
|
12
|
-
n,
|
|
13
|
-
|
|
14
|
-
[],ta=0;ta<
|
|
15
|
-
_.
|
|
2
|
+
var f=function(window){var wx=" The setting will be ignored.",xx="VTT parser encountered an invalid VTT setting: ",yx="application/x-subrip",zx="text/srt",Ax='text/vtt; codecs\x3d"vtt"',Bx='text/vtt; codecs\x3d"wvtt"',Cx=function(a){_.ft(a,/[ \t]+/gm)},Dx=function(a){return a.a===a.f.length?null:(a=_.ft(a,/[^ \t\n]*/gm))?a[0]:null},Ex=function(){},Fx=function(a){var b="";for(a=a.split(/\n/);3<a.length;){for(var c=3;c<a.length;++c)a[2]+="\n"+a[c];a.splice(3,a.length-3)}if(3!==a.length)return"";c=0;!a[0].match(/\d+:\d+:\d+/)&&
|
|
3
|
+
a[1].match(/\d+:\d+:\d+/)&&(b+=a[0].match(/\w+/)+"\n",++c);if(a[c].match(/\d+:\d+:\d+/)){var d=a[1].match(/(\d+):(\d+):(\d+)(?:,(\d+))?\s*--?>\s*(\d+):(\d+):(\d+)(?:,(\d+))?/);if(d)b+=d[1]+":"+d[2]+":"+d[3]+"."+d[4]+" --\x3e ",b+=d[5]+":"+d[6]+":"+d[7]+"."+d[8]+"\n",++c;else return""}else return"";a[c]&&(b+=a[c]+"\n\n");return b},Gx=function(){},Hx=function(a){this.a=a},Jx=function(a,b,c){var d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"===b?a.textAlign=_.Ep:a.textAlign=
|
|
4
|
+
_.qw[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"===d[1]?_.Rg:_.Sg;else if(d=/^size:([\d.]+)%$/.exec(b))a.size=Number(d[1]);else if(d=/^position:([\d.]+)%(?:,(line-left|line-right|center|start|end))?$/.exec(b))a.position=Number(d[1]),d[2]&&(b=d[2],a.positionAlign=b===_.He||b===_.jg?_.He:b===_.Ie||b===_.oe?_.Ie:_.nd);else if(d=/^region:(.*)$/.exec(b)){if(b=Ix(c,d[1]))a.region=b}else{a:{if(c=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=1,a.line=
|
|
5
|
+
Number(c[1]),c[2]&&(a.lineAlign=_.rw[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.Gp,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.rw[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},Ix=function(a,b){var c=a.filter(function(d){return d.id===b});return c.length?c[0]:(_.Vh("VTT parser could not find a region with id: ",b," The region will be ignored."),null)},Kx=function(a){a=_.ft(a,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g);if(null==
|
|
6
|
+
a)return null;var b=Number(a[2]),c=Number(a[3]);return 59<b||59<c?null:Number(a[4])/1E3+c+60*b+3600*(Number(a[1])||0)},Lx=function(){Hx.apply(this,arguments)},Mx=function(){this.a=null;this.g=new _.M("clpp.vtt.mp4")},Ox=function(a,b,c){var d,e,f;(new _.tq).N("payl",_.wq(function(g){d=_.R.ea(g)})).N("iden",_.wq(function(g){e=_.R.ea(g)})).N("sttg",_.wq(function(g){f=_.R.ea(g)})).parse(a);return d?Nx(d,e,f,b,c):null},Nx=function(a,b,c,d,e){a=new _.Jp(d,e,a,_.$g);b&&(a.id=b);if(c)for(b=new _.et(c),c=
|
|
7
|
+
Dx(b);c;)Jx(a,c,[])||_.Vh(xx,c,wx),Cx(b),c=Dx(b);return a},Px=function(){this.a=new Gx};Ex.prototype.a=function(a){a=_.R.ea(a);a=a.replace(/\r+/g,"");a=a.replace(/^\s+|\s+$/g,"");a=a.replace(/<[a-zA-Z\\/][^>]*>/g,"");var b=a.split("\n\n");a="";if(0<b.length){a+="WEBVTT\n\n";b=_.v(b);for(var c=b.next();!c.done;c=b.next())a+=Fx(c.value)}return _.R.ub(a)};Gx.prototype.create=function(){return new Ex};Gx.prototype.probe=function(a,b){return(a===zx||a===yx)&&b===_.ug};Hx.prototype.parseInit=function(){};
|
|
8
|
+
Hx.prototype.parseMedia=function(a,b){var c=_.R.ea(a);c=c.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");var d=c.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(d[0]))throw new _.O(_.P,2,2E3);c=b.periodStart;if(d[0].includes("X-TIMESTAMP-MAP")){var e=d[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),f=d[0].match(/MPEGTS:(\d+)/m);if(e&&f){c=Kx(new _.et(e[1]));if(null==c)throw new _.O(_.P,2,2E3);f=Number(f[1]);for(e=b.segmentStart;95443.7176888889<=e;)e-=95443.7176888889,f+=8589934592;c=b.periodStart+
|
|
9
|
+
f/9E4-c}}else this.a.streaming.relativeTextTimestamp&&null!==b.segmentStart&&(c=b.segmentStart);f=[];e=_.v(d);for(var g=e.next();!g.done;g=e.next()){var k=g.value;if(/^region/.test(k.toLowerCase())){k=new _.et(k.replace(/\n/g," "));g=new _.Mp;Dx(k);Cx(k);for(var l=Dx(k);l;){var m;a:{var n=g,p=l;if(m=/^id:(.*)$/.exec(p))n.id=m[1];else if(m=/^width:(\d{1,2}|100)%$/.exec(p))n.width=Number(m[1]);else if(m=/^lines:(\d+)$/.exec(p))n.height=Number(m[1]),n.heightUnits=2;else if(m=/^regionanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.regionAnchorX=
|
|
10
|
+
Number(m[1]),n.regionAnchorY=Number(m[2]);else if(m=/^viewportanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.viewportAnchorX=Number(m[1]),n.viewportAnchorY=Number(m[2]);else if(/^scroll:up$/.exec(p))n.scroll="up";else{m=!1;break a}m=!0}m||_.Vh("VTT parser encountered an invalid VTTRegion setting: ",l,wx);Cx(k);l=Dx(k)}f.push(g)}}e=[];k=_.v(d);for(g=k.next();!g.done;g=k.next())if(g=g.value,/^style/.test(g.toLowerCase())){g=g.replace(/^style/i,"").replace(/\n/g," ");l=/[^{}]+{[^{}]*}/g;do(m=l.exec(g))&&
|
|
11
|
+
e.push(m[0]);while(m)}k=[];d=_.v(d);for(g=d.next();!g.done;g=d.next())if(g=g.value,g.includes("--\x3e")){p=g.split("\n");var q=c;if(1===p.length&&!p[0]||/^NOTE($|[ \t])/.test(p[0])||"STYLE"===p[0])g=null;else{g=null;p[0].includes("--\x3e")||(g=p[0],p.splice(0,1));l=new _.et(p[0]);m=Kx(l);var t=_.ft(l,/[ \t]+--\x3e[ \t]+/g);n=Kx(l);if(null==m||null==t||null==n)throw new _.O(_.P,2,2001);m+=q;n+=q;p=p.slice(1).join("\n").trim();m=new _.Jp(m,n,p,_.$g);g&&(m.id=g);Cx(l);for(n=Dx(l);n;)Jx(m,n,f)||_.Vh(xx,
|
|
12
|
+
n,wx),Cx(l),n=Dx(l);null!=g&&(m.id=g);g=m}g&&k.push(g)}return{cues:k,styles:e}};_.w(Lx,Hx);Lx.prototype.parseMedia=function(a,b){return Hx.prototype.parseMedia.call(this,(new Ex).a(a),b)};Mx.prototype.parseInit=function(a){var b=this,c=!1;(new _.tq).N(_.We,_.uq).N(_.Dg,_.uq).N(_.Qe,_.uq).da("mdhd",function(d){0===d.version?(d.reader.skip(4),d.reader.skip(4),b.a=_.oq(d.reader),d.reader.skip(4)):(d.reader.skip(8),d.reader.skip(8),b.a=_.oq(d.reader),d.reader.skip(8));d.reader.skip(4)}).N(_.Ve,_.uq).N(_.mg,_.uq).da(_.og,_.vq).N("wvtt",function(){c=!0}).parse(a);if(!this.a)throw new _.O(_.P,2,2008);if(!c)throw new _.O(_.P,2,2008);};
|
|
13
|
+
Mx.prototype.parseMedia=function(a,b){if(!this.a)throw this.g.error("No init segment for MP4+VTT!"),new _.O(_.P,2,2008);var c=0,d=[],e,f=[],g=!1,k=!1,l=!1,m=null;(new _.tq).N("moof",_.uq).N("traf",_.uq).da("tfdt",function(x){g=!0;c=0===x.version?_.oq(x.reader):_.qq(x.reader)}).da("tfhd",function(x){var J=x.flags;x=x.reader;x.skip(4);J&1&&x.skip(8);J&2&&x.skip(4);m=J&8?_.oq(x):null}).da("trun",function(x){k=!0;var J=x.version,L=x.flags;x=x.reader;var U=_.oq(x);L&1&&x.skip(4);L&4&&x.skip(4);for(var V=
|
|
14
|
+
[],ta=0;ta<U;ta++){var za={duration:null,sampleSize:null,yh:null};L&256&&(za.duration=_.oq(x));L&512&&(za.sampleSize=_.oq(x));L&1024&&x.skip(4);L&2048&&(za.yh=0===J?_.oq(x):_.pq(x));V.push(za)}d=V}).N(_.Pe,_.wq(function(x){l=!0;e=x})).parse(a);if(!l&&!g&&!k)throw new _.O(_.P,2,2008);var n=c,p=new DataView(e.buffer,e.byteOffset,e.byteLength);p=new _.jq(p,!1);for(var q=_.v(d),t=q.next();!t.done;t=q.next()){t=t.value;var u=t.duration||m,z=t.yh?c+t.yh:n;n=z+(u||0);var B=0;do{var D=_.oq(p);B+=D;var C=
|
|
15
|
+
_.oq(p);C=_.yq(C);var E=null;"vttc"===C?8<D&&(E=_.sq(p,D-8)):("vtte"!==C&&this.g.error("Unknown box "+C+"! Skipping!"),p.skip(D-8));u?E&&f.push(Ox(E,b.periodStart+z/this.a,b.periodStart+n/this.a)):this.g.error("WVTT sample duration unknown, and no default found!")}while(t.sampleSize&&B<t.sampleSize)}return{cues:f.filter(_.wn),styles:[]}};_.w(Px,_.jv);Px.prototype.install=function(){_.Bv(_.ug,Hx);_.Bv(Ax,Hx);_.Bv(Bx,Hx);_.Bv(_.Oc,Mx);_.Bv(zx,Lx);_.Bv(yx,Lx);_.Ct.push(this.a)};Px.prototype.uninstall=function(){_.Dv(_.ug);_.Dv(Ax);_.Dv(Bx);_.Dv(_.Oc);_.Dv(zx);_.Dv(yx);_.Et(this.a)};Px.prototype.id=function(){return"subtitles-vtt"};_.K("clpp.vtt.VttComponent",Px);};
|
|
16
16
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
17
17
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
18
18
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.yospace.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
|
|
4
|
-
break a;default:m=YospaceAdManagement.SessionDVRLive.create(m)}}return _.
|
|
5
|
-
|
|
2
|
+
var f=function(window){var rx="clpp.yospace.YospacePlugin",sx=function(){this.a=null;this.g=new _.M(rx)},tx=function(){};_.w(sx,_.gw);sx.prototype.Qi=function(){return this.a};
|
|
3
|
+
sx.prototype.onContentWillLoad=function(a,b){var c=this,d,e,f,g,k;return _.I(function(l){if(1==l.a){d=a.getConfiguration();e=d.yospace;if(!e.enabled)return l["return"]();if(typeof window.YospaceAdManagement!==_.$e)throw new _.O(_.P,9,7003,"Yospace SDK not found.");c.g.info("Yospace enabled.");f=e.streamType||ux;a:{var m=b.url;c.g.info("Creating Yospace session for stream type",f);switch(f){case ux:m=YospaceAdManagement.SessionVOD.create(m);break a;case vx:m=YospaceAdManagement.SessionLive.create(m);
|
|
4
|
+
break a;default:m=YospaceAdManagement.SessionDVRLive.create(m)}}return _.y(l,m,2)}g=l.f;k=g.getSessionState();if(k!==YospaceAdManagement.SessionState.INITIALISED)throw c.g.error("Failed to initialize Yospace session. State:",k,"URL",b.url),new _.O(_.P,9,7003,"Yospace session failed to initialize.");a.trigger(new _.Q(_.qh,{detail:g}));b.url=g.getPlaybackUrl();c.g.info("Yospace session initialized. New URL:",b.url);c.a=g;_.A(l)})};
|
|
5
|
+
sx.prototype.onPlayerWillRelease=function(a){if(this.a){this.g.info("Shutting down Yospace session.");var b=this.a;this.a.shutdown();this.a=null;a.trigger(new _.Q(_.ph,{detail:b}))}};sx.prototype.id=function(){return"yospace"};_.K(rx,sx);sx.prototype.getSession=sx.prototype.Qi;sx.Id="yospace";tx.prototype.create=function(){return new sx};var ux=_.Vb,vx="LIVE";_.K("clpp.yospace.StreamType",{VOD:ux,LIVE:vx,DVR:"DVR"});_.fp(new tx);};
|
|
6
6
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
7
7
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
8
8
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.youbora.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
c
|
|
11
|
-
|
|
12
|
-
this.a.
|
|
13
|
-
b.prototype.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
!
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
a.prototype.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
a.prototype.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
b.on(this.player,_.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
this.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
_.r.onContentWillLoad=function(a,b){if(
|
|
39
|
-
_.r.onPlayerWillDestroy=function(){
|
|
40
|
-
_.r.onContentWillLoad=function(a,b){if(
|
|
41
|
-
|
|
2
|
+
var f=function(window){var Pw='" event to NPAW',Qw='" event to Youbora',Rw='Reporting "',Sw="Unhandled state",Tw="ad break start",Uw="ad buffering ended",Vw="ad buffering started",Ww="ad click through url: ",Xw="ad timeline changed",Yw="clpp.npaw.NpawPlugin",Zw="clpp.npaw.YouboraPlugin",$w="content.isLive",ax="content.title",bx="is container visible",cx=function(a){return a.startsWith(_.Md)?"Widevine":a.startsWith(_.Id)?"FairPlay":a.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":a.startsWith(_.jf)?"ClearKey":
|
|
3
|
+
a.startsWith(_.Hd)?"Primetime":a},dx=function(a){return a&&a.errorFilter?a.errorFilter:function(b){return{code:""+b.code,message:b.message,severity:b.severity}}},ex=function(a,b,c,d){b=dx(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===a.code?"ad error":_.qe;b.severity===_.P?(d.fireFatalError(b.code,b.message,b.metadata),c.debug('Reporting "fatal '+a+'" to Youbora',b.code,b)):(d.fireError(b.code,b.message,b.metadata),c.debug(Rw+a+'" to Youbora',b.code,b));return b},
|
|
4
|
+
fx=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.m=c;d.a=new _.Bi;d.g=new _.M("clpp.npaw.YouboraAdapter");d.o=!1;d.h=!1;d.B=!1;d.registerListeners();return d}_.w(b,youbora.Adapter);b.prototype.getPlayhead=function(){return this.getIsLive()?-1:this.m.getPosition()};b.prototype.getDuration=function(){return this.m.getDuration()};b.prototype.getRendition=function(){var c=this.m.getTrackManager();if(c&&(c=c.sa())){var d=c.width;var e=c.height;var f=c.bandwidth}d&&e&&f||(c=this.j(),
|
|
5
|
+
d=d||c.width,e=e||c.height,f=f||c.streamBandwidth);return youbora.Util.buildRenditionString(d,e,f)};b.prototype.getIsLive=function(){return this.m.isLive()};b.prototype.getResource=function(){var c=this.m.ab();return c&&c.url};b.prototype.getBitrate=function(){return this.j().streamBandwidth};b.prototype.getThroughput=function(){return this.j().estimatedBandwidth};b.prototype.getPlayrate=function(){return this.m.Ec()};b.prototype.getFramesPerSecond=function(){var c=this.m.getTrackManager();return c&&
|
|
6
|
+
(c=c.Ra())?c.frameRate:null};b.prototype.getPlayerName=function(){return _.ya};b.prototype.getVersion=function(){return"6.32.0-beta.2-castlabsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ia};b.prototype.registerListeners=function(){this.m&&this.a&&(this.g.debug("registering listeners"),youbora.Util.logAllEvents(this.m),this.a.on(this.m,_.kg,this.K.bind(this)),this.a.on(this.m,_.qe,this.H.bind(this)),this.a.on(this.m,_.Og,this.J.bind(this)),this.a.on(this.m,_.Ng,this.I.bind(this)),
|
|
7
|
+
this.a.on(this.m,_.Fc,this.D.bind(this)),this.a.on(this.m,_.id,this.G.bind(this)))};b.prototype.unregisterListeners=function(){this.g.debug(_.Qb);_.Ei(this.a)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.B=!0};b.prototype.j=function(){return this.m.getStats()||_.lu()};b.prototype.w=function(){return!!this.m.getConfiguration().autoplay};b.prototype.K=function(c){c=c.detail;this.l("state change",c);if(c)switch(c.currentState){case 1:this.w()&&this.f();break;case 3:this.f();
|
|
8
|
+
this.A();this.fireResume();this.fireBufferEnd();break;case 4:this.w()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.mu:this.fireBufferEnd();this.fireStop();break;case 5:this.fireBufferEnd();this.o&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case 2:this.fireBufferBegin();break;default:this.g.debug(Sw,c)}};b.prototype.f=function(){this.plugin.isInitiated||(this.h=!1,this.fireInit())};b.prototype.A=function(){var c=this.m.getDrmInfo();c&&(c=cx(c.keySystem))&&
|
|
9
|
+
this.plugin.setOptions({"content.drm":c});this.fireJoin()};b.prototype.H=function(c){!(c=c.detail)||this.h||10003===c.code&&this.plugin.getAdsAdapter()||(c=ex(c,this.m.getConfiguration().youbora,this.g,this))&&c.severity===_.P&&(this.h=!0)};b.prototype.J=function(){this.m.isEnded()||(this.l(_.cg),this.f(),this.fireSeekBegin())};b.prototype.I=function(){this.l(_.bg);this.fireSeekEnd()};b.prototype.D=function(c){this.g.debug("adsTimeline",c);this.o=(c=c.adsTimeline)&&c.$b()};b.prototype.G=function(c){this.g.debug("Casting",
|
|
10
|
+
c);this.fireCasted()};b.prototype.l=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.g.debug.apply(this.g,[Rw+c+Qw].concat(_.uh(e)))};return new b(a)},gx=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.m=c;d.a=null;d.j=null;d.f=new _.Bi;d.g=new _.M("clpp.npaw.YouboraAdsAdapter");d.registerListeners();d.A=!1;d.l=!1;return d}_.w(b,youbora.Adapter);b.prototype.getDuration=function(){return this.a&&this.a.getDuration()};b.prototype.getRendition=function(){var c=
|
|
11
|
+
null;this.a&&(c=youbora.Util.buildRenditionString(this.a.fb(),this.a.eb(),this.a.Ga()));return c};b.prototype.getBitrate=function(){return this.a&&this.a.Ga()};b.prototype.getPlayhead=function(){var c=this.m.getAdsManager();return c&&c.getPosition()};b.prototype.getResource=function(){return this.a&&this.a.getMediaUrl()};b.prototype.getTitle=function(){return this.a&&this.a.getTitle()};b.prototype.getProvider=function(){return this.a&&this.a.getAdvertiserName()};b.prototype.getCreativeId=function(){return this.a&&
|
|
12
|
+
this.a.getCreativeId()};b.prototype.getPosition=function(){var c=youbora.Constants.AdPosition,d=null;if(this.a)switch(this.a.Ha()){case 0:d=c.Preroll;break;case 2:d=c.Postroll;break;case 1:d=c.Midroll}this.g.debug("Ad position",d);return d};b.prototype.getIsSkippable=function(){return this.a&&-1!==this.a.getSkipTimeOffset()};b.prototype.getAudioEnabled=function(){var c=this.m.getAdsManager();return c&&0<c.getAdVolume()};b.prototype.getExpectedBreaks=function(){return this.j&&this.j.getCuePoints().length};
|
|
13
|
+
b.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};b.prototype.getExpectedAds=function(){return this.a&&this.a.gb()};b.prototype.getGivenAds=function(){return this.getExpectedAds()};b.prototype.getBreaksTime=function(){var c=this;return this.j&&this.j.getCuePoints().map(function(d){return-1===d?c.m.getDuration():d})};b.prototype.getIsFullscreen=function(){return this.m.getSurface().isFullscreen()};b.prototype.getIsVisible=function(){var c=this.m.getSurface().getContainer();c=youbora.Util.calculateAdViewability(c);
|
|
14
|
+
this.g.debug(bx,c);return c};b.prototype.getPlayerName=function(){return _.ya};b.prototype.getVersion=function(){return"6.32.0-beta.2-castlabsadsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ia};b.prototype.registerListeners=function(){this.m&&this.f&&(this.f.on(this.m,_.Fc,this.T.bind(this)),this.f.on(this.m,_.Bc,this.P.bind(this)),this.f.on(this.m,_.xc,this.K.bind(this)),this.f.on(this.m,_.zc,this.L.bind(this)),this.f.on(this.m,_.mc,this.I.bind(this)),this.f.on(this.m,_.nc,this.o.bind(this,
|
|
15
|
+
1)),this.f.on(this.m,_.vc,this.o.bind(this,2)),this.f.on(this.m,_.Dc,this.o.bind(this,3)),this.f.on(this.m,_.lc,this.H.bind(this)),this.f.on(this.m,_.Ac,this.M.bind(this)),this.f.on(this.m,_.qe,this.J.bind(this)),this.f.on(this.m,_.ic,this.B.bind(this)),this.f.on(this.m,_.jc,this.D.bind(this)),this.f.on(this.m,_.kc,this.G.bind(this)),this.f.on(this.m,_.yc,this.w.bind(this)))};b.prototype.unregisterListeners=function(){_.Ei(this.f)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);
|
|
16
|
+
this.A=!0};b.prototype.T=function(c){this.g.debug(Xw,c);this.j=c.adsTimeline};b.prototype.P=function(c){this.a=c.ad;this.h("ad start",this.a);this.fireStart();this.fireJoin()};b.prototype.I=function(){this.h("ad ended");this.fireStop()};b.prototype.K=function(){this.h("ad pause");this.w();this.firePause()};b.prototype.L=function(){this.h("ad resume");this.w();this.fireResume()};b.prototype.G=function(){this.l=!0;this.h(Vw);this.fireBufferBegin()};b.prototype.w=function(){this.l&&(this.h(Uw),this.l=
|
|
17
|
+
!1,this.fireBufferEnd())};b.prototype.o=function(c){this.h("ad quartile",c);this.fireQuartile(c)};b.prototype.H=function(){this.h("ad clicked");var c=this.a&&this.a.$a();this.g.debug(Ww,c);this.fireClick(c)};b.prototype.M=function(){this.h("ad skipped");this.fireSkip()};b.prototype.B=function(c){this.a=c.ad;this.h(Tw,this.a);this.fireBreakStart()};b.prototype.D=function(){this.h("ad break stop");this.fireBreakStop();if(this.getPosition()===youbora.Constants.AdPosition.Postroll){var c=this.plugin.getAdapter();
|
|
18
|
+
c&&c.fireStop()}};b.prototype.J=function(c){(c=c.detail)&&10003===c.code&&ex(c,this.m.getConfiguration().youbora,this.g,this)};b.prototype.h=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.g.debug.apply(this.g,[Rw+c+Qw].concat(_.uh(e)))};return new b(a)},ix=function(){function a(){var b=NpawPluginAdapters.video.Shaka.call(this)||this;b.h=!1;b.f=!1;b.a=null;b.G=!1;return b}_.w(a,NpawPluginAdapters.video.Shaka);a.prototype.getPlayhead=function(){return this.getIsLive()?
|
|
19
|
+
-1:this.player.getPosition()};a.prototype.getDuration=function(){return this.player.getDuration()};a.prototype.getRendition=function(){var b=null,c=null,d=null,e=this.player.getTrackManager();e&&(e=e.sa())&&(b=e.width,c=e.height,d=e.bandwidth);b&&c&&d||(e=this.j(),b=b||e.width,c=c||e.height,d=d||e.streamBandwidth);return this.getNpawUtils().buildRenditionString(b,c,d)};a.prototype.getIsLive=function(){return this.player.isLive()};a.prototype.getResource=function(){var b=this.player.ab();return b&&
|
|
20
|
+
b.url};a.prototype.getBitrate=function(){return this.j().streamBandwidth};a.prototype.getThroughput=function(){return this.j().estimatedBandwidth};a.prototype.getPlayrate=function(){return this.player.Ec()};a.prototype.getFramesPerSecond=function(){var b=this.player.getTrackManager();return b&&(b=b.Ra())?b.frameRate:null};a.prototype.getPlayerName=function(){return _.ya};a.prototype.getVersion=function(){return"castlabs-adapter-6.32.0-beta.2-js"};a.prototype.getPlayerVersion=function(){return _.ia};
|
|
21
|
+
a.prototype.registerListeners=function(){var b=this.w();this.player&&b&&(b.on(this.player,_.kg,this.M.bind(this)),b.on(this.player,_.qe,this.J.bind(this)),b.on(this.player,_.cg,this.L.bind(this)),b.on(this.player,_.bg,this.K.bind(this)),b.on(this.player,_.Fc,this.H.bind(this)),b.on(this.player,_.id,this.I.bind(this)),b.on(this.player,_.$c,this.P.bind(this)),b.on(this.player,_.wg,this.T.bind(this)))};a.prototype.unregisterListeners=function(){hx.debug(_.Qb);_.Ei(this.w())};a.prototype.dispose=function(){this.unregisterListeners();
|
|
22
|
+
this.G=!0;this.f=this.h=!1;this.a=null};a.prototype.j=function(){return this.player.getStats()||_.lu()};a.prototype.o=function(){return!!this.player.getConfiguration().autoplay};a.prototype.M=function(b){b=b.detail;this.l("state change",b);if(b)switch(b.currentState){case 1:this.plugin.setVideoOptions({"content.subtitles":this.D()});this.o()&&this.fireStart();break;case 3:this.fireStart();this.A();this.fireResume();this.fireBufferEnd();break;case 4:this.o()&&this.fireStart();this.A();this.fireBufferEnd();
|
|
23
|
+
this.firePause();break;case _.mu:this.fireBufferEnd();this.fireStop();break;case 5:this.fireBufferEnd();this.h&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case 2:this.fireBufferBegin();break;default:hx.debug(Sw,b)}};a.prototype.A=function(){this.fireJoin()};a.prototype.J=function(b){(b=b.detail)&&!this.f&&this.player&&10003!==b.code&&(b=ex(b,this.player.getConfiguration().npaw,hx,this))&&b.severity===_.P&&(this.f=!0)};a.prototype.L=function(){this.player.isEnded()||(this.l(_.cg),
|
|
24
|
+
this.fireSeekBegin())};a.prototype.B=function(b){var c=this.player.getTrackManager();if(!c)return null;var d=null;b===_.tg&&(d=c.wa());b===_.Sc&&(d=c.qa());return d?d.language:null};a.prototype.P=function(){var b=this.B(_.Sc);this.plugin.setVideoOptions({"content.language":b})};a.prototype.T=function(){var b=this.B(_.tg),c=this.D();this.plugin.setVideoOptions({"content.subtitles":b||c})};a.prototype.w=function(){this.a||(this.a=new _.Bi);return this.a};a.prototype.K=function(){this.l(_.bg);this.fireSeekEnd()};
|
|
25
|
+
a.prototype.H=function(b){hx.debug("adsTimeline",b);this.h=(b=b.adsTimeline)&&b.$b()};a.prototype.I=function(b){hx.debug("Casting",b);this.fireCasted()};a.prototype.l=function(b,c){for(var d=[],e=1;e<arguments.length;++e)d[e-1]=arguments[e];hx.debug.apply(hx,[Rw+b+Pw].concat(_.uh(d)))};a.prototype.D=function(){var b=this.player.getConfiguration();return b.npaw&&b.npaw.disabledSubtitlesLabel?b.npaw.disabledSubtitlesLabel:"off"};return a},kx=function(){function a(){var b=NpawPluginAdapters.ads.Ima.call(this)||
|
|
26
|
+
this;b.a=null;b.l=null;b.h=null;b.j=null;b.D=!1;b.o=!1;return b}_.w(a,NpawPluginAdapters.ads.Ima);a.prototype.getDuration=function(){return this.a?this.a.getDuration():null};a.prototype.getRendition=function(){var b=null;this.a&&(b=this.getNpawUtils().buildRenditionString(this.a.fb(),this.a.eb(),this.a.Ga()));return b};a.prototype.getBitrate=function(){var b=null;this.a&&(b=this.a.Ga());return b};a.prototype.getPlayhead=function(){var b=null,c=this.player.getAdsManager();c&&(b=c.getPosition());return b};
|
|
27
|
+
a.prototype.getResource=function(){var b=null;this.a&&(b=this.a.getMediaUrl());return b};a.prototype.getTitle=function(){var b=null;this.a&&(b=this.a.getTitle());return b};a.prototype.getProvider=function(){var b=null;this.a&&(b=this.a.getAdvertiserName());return b};a.prototype.getCreativeId=function(){var b=null;this.a&&(b=this.a.getCreativeId());return b};a.prototype.dispose=function(){this.unregisterListeners();this.D=!0;this.j=this.h=this.a=null};a.prototype.getPosition=function(){var b=this.getNpawReference().Constants.AdPosition,
|
|
28
|
+
c=null;if(this.a)switch(this.a.Ha()){case 0:c=b.Preroll;break;case 2:c=b.Postroll;break;case 1:c=b.Midroll}jx.debug("Ad position",c);return c};a.prototype.getIsSkippable=function(){return this.a&&-1!==this.a.getSkipTimeOffset()};a.prototype.getAudioEnabled=function(){var b=this.player.getAdsManager();return b&&0<b.getAdVolume()};a.prototype.getExpectedBreaks=function(){return this.h&&this.h.getCuePoints().length};a.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};a.prototype.getExpectedAds=
|
|
29
|
+
function(){return this.a&&this.a.gb()};a.prototype.getGivenAds=function(){return this.getExpectedAds()};a.prototype.getBreaksTime=function(){var b=this;return this.h&&this.h.getCuePoints().map(function(c){return-1===c?b.player.getDuration():c})};a.prototype.getIsFullscreen=function(){return this.player.getSurface().isFullscreen()};a.prototype.getIsVisible=function(){var b=this.player.getSurface().getContainer();b=this.getNpawUtils().calculateAdViewability(b);jx.debug(bx,b);return b};a.prototype.getPlayerName=
|
|
30
|
+
function(){return _.ya};a.prototype.getVersion=function(){return"castlabs-ads-adapter-6.32.0-beta.2-js"};a.prototype.getPlayerVersion=function(){return _.ia};a.prototype.B=function(){this.j||(this.j=new _.Bi);return this.j};a.prototype.registerListeners=function(){var b=this.B();this.player&&b&&(b.on(this.player,_.Fc,this.X.bind(this)),b.on(this.player,_.Bc,this.W.bind(this)),b.on(this.player,_.xc,this.M.bind(this)),b.on(this.player,_.zc,this.P.bind(this)),b.on(this.player,_.mc,this.K.bind(this)),
|
|
31
|
+
b.on(this.player,_.nc,this.w.bind(this,1)),b.on(this.player,_.vc,this.w.bind(this,2)),b.on(this.player,_.Dc,this.w.bind(this,3)),b.on(this.player,_.lc,this.J.bind(this)),b.on(this.player,_.Ac,this.T.bind(this)),b.on(this.player,_.qe,this.L.bind(this)),b.on(this.player,_.ic,this.G.bind(this)),b.on(this.player,_.jc,this.H.bind(this)),b.on(this.player,_.kc,this.I.bind(this)),b.on(this.player,_.yc,this.ba.bind(this)))};a.prototype.unregisterListeners=function(){_.Ei(this.B())};a.prototype.X=function(b){jx.debug(Xw,
|
|
32
|
+
b);this.h=b.adsTimeline};a.prototype.W=function(b){this.a=b.ad;this.f("ad start",this.a);this.fireStart();this.fireJoin()};a.prototype.K=function(){this.f("ad ended");this.fireStop({adPlayhead:this.l})};a.prototype.M=function(){this.f("ad pause");this.A();this.firePause()};a.prototype.P=function(){this.f("ad resume");this.A();this.fireResume()};a.prototype.I=function(){this.o=!0;this.f(Vw);this.fireBufferBegin()};a.prototype.ba=function(){this.l=this.getPlayhead();this.A()};a.prototype.A=function(){this.o&&
|
|
33
|
+
(this.f(Uw),this.o=!1,this.fireBufferEnd())};a.prototype.w=function(b){this.f("ad quartile",b);this.fireQuartile(b)};a.prototype.J=function(){this.f("ad clicked");var b=this.a&&this.a.$a();jx.debug(Ww,b);this.fireClick(b)};a.prototype.T=function(){this.f("ad skipped");this.fireSkip()};a.prototype.G=function(b){this.a=b.ad;this.f(Tw,this.a);this.fireBreakStart()};a.prototype.H=function(){this.f("ad break stop");this.fireBreakStop({adPlayhead:this.l});this.getPosition()===this.getNpawReference().Constants.AdPosition.Postroll&&
|
|
34
|
+
this.fireStop({adPlayhead:this.l})};a.prototype.L=function(b){(b=b.detail)&&10003===b.code&&ex(b,this.player.getConfiguration().npaw,jx,this)};a.prototype.f=function(b,c){for(var d=[],e=1;e<arguments.length;++e)d[e-1]=arguments[e];jx.debug.apply(jx,[Rw+b+Pw].concat(_.uh(d)))};return a},lx=function(){this.a=null;this.g=new _.M(Yw);this.m=null},mx=function(a,b){if(b.namespace()===_.xd)return a.g.info("NPAW does not report when casting."),!1;var c=b.getConfiguration().npaw;return _.N.Qg(c)?c.accountCode?
|
|
35
|
+
_.N.R(window.NpawPlugin)||_.N.R(window.NpawPluginAdapters)?(a.g.warn("NPAW SDK not found."),b.onError(new _.O(1,9,9100)),!1):!0:(a.g.warn("accountCode key is missing in NPAW config"),b.onError(new _.O(1,9,9101)),!1):(a.g.warn("NPAW plugin is loaded but not configured. Will do nothing."),!1)},nx=function(a){a.a&&(a.g.info("Removing NPAW Plugins",a.a),a.a.removeAdsAdapter(),a.a.removeAdapter())},ox=function(){this.a=null;this.g=new _.M(Zw);this.m=null},px=function(a,b){if(b.namespace()===_.xd)return a.g.info("Youbora does not report when casting."),
|
|
36
|
+
!1;var c=b.getConfiguration().youbora;if(!_.N.Qg(c))return a.g.debug("Youbora plugin is loaded but not configured. Will do nothing."),!1;if(!c.accountCode)return a.g.warn("accountCode key is missing in Youbora config"),b.onError(new _.O(1,9,9101)),!1;if(_.N.R(window.youbora))return a.g.warn("Youbora SDK not found."),b.onError(new _.O(1,9,9100)),!1;"6.8.59"!==youbora.VERSION&&(a.g.warn("Youbora SDK version is not supported. The supported version is 6.8.59, found version "+(youbora.VERSION+". Some or all features of YouboraPlugin may not work correctly.")),
|
|
37
|
+
b.onError(new _.O(1,9,9102)));return!0},qx=function(){};var hx=new _.M("clpp.npaw.NpawAdapter");var jx=new _.M("clpp.npaw.NpawAdsAdapter");_.w(lx,_.gw);_.r=lx.prototype;_.r.sh=function(a){nx(this);if(this.a=a)this.a.registerAdapterFromClass(this.m,ix()),this.a.registerAdsAdapterFromClass(this.m,kx())};_.r.Gm=function(){return this.a};_.r.getAdapter=function(){return this.a&&this.a.getAdapter()};_.r.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.r.onPlayerCreated=function(a){this.m=a;mx(this,a)&&(a=a.getConfiguration().npaw,this.sh(new NpawPlugin(a.accountCode)))};
|
|
38
|
+
_.r.onContentWillLoad=function(a,b){if(mx(this,a)){var c=a.getConfiguration(),d=c.npaw;void 0===d[$w]&&(d[$w]=b.isLive);void 0===d[ax]&&(d[ax]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.sh(new NpawPlugin(d.accountCode));this.a.setAnalyticsOptions(d)}};_.r.onContentLoaded=function(a){var b={};(a=a.getDrmInfo())&&(a=cx(a.keySystem))&&(b["content.drm"]=a);this.g.info(_.bf,b);this.a.setAnalyticsOptions(b)};_.r.onPlayerWillRelease=function(){};
|
|
39
|
+
_.r.onPlayerWillDestroy=function(){nx(this);this.a&&this.a.destroy()};_.r.id=function(){return"npaw"};_.K(Yw,lx);lx.prototype.getAdsAdapter=lx.prototype.getAdsAdapter;lx.prototype.getAdapter=lx.prototype.getAdapter;lx.prototype.getNpawPlugin=lx.prototype.Gm;lx.prototype.setNpawPlugin=lx.prototype.sh;lx.Id="npaw";new _.M(Yw);_.w(ox,_.gw);_.r=ox.prototype;_.r.th=function(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(fx(this.m)),this.a.setAdsAdapter(gx(this.m))};_.r.getAdapter=function(){return this.a&&this.a.getAdapter()};_.r.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.r.onPlayerCreated=function(a){this.m=a;px(this,a)&&(a=a.getConfiguration().youbora,this.th(new youbora.Plugin(a)))};
|
|
40
|
+
_.r.onContentWillLoad=function(a,b){if(px(this,a)){var c=a.getConfiguration(),d=c.youbora;void 0===d[$w]&&(d[$w]=b.isLive);void 0===d[ax]&&(d[ax]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.th(new youbora.Plugin(d));this.a.setOptions(d)}};_.r.onPlayerWillRelease=function(){};_.r.onPlayerWillDestroy=function(){};_.r.id=function(){return"youbora"};_.K(Zw,ox);ox.prototype.getAdsAdapter=ox.prototype.getAdsAdapter;ox.prototype.getAdapter=ox.prototype.getAdapter;
|
|
41
|
+
ox.prototype.setYouboraPlugin=ox.prototype.th;ox.Id="youbora";qx.prototype.create=function(a){return a.npaw?new lx:a.youbora?new ox:null};_.fp(new qx);};
|
|
42
42
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
43
43
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
44
44
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cl.adobe.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
a.m.
|
|
3
|
-
this.f=null);this.m=null;this.a=""}id(){return"adobe"}};_.x("clpp.adobe.AdobeAnalyticsPlugin",
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var kX=function(a){a.f=new _.Vt;a.f.on(a.m,_.ug,()=>iX(a));a.f.on(a.m,_.qg,()=>{s.Media.play(a.a,a.m.getPosition())});a.f.on(a.m,_.se,()=>jX(a));a.f.on(a.m,_.Rf,b=>{b=b.detail;switch(b.currentState){case 3:a.a.length||jX(a);s.Media.play(a.a,a.m.getPosition());break;case 4:case 2:iX(a);break;case 5:case _.Hs:case _.As:a.g.info(`Close session for ${a.a} `+`in player state ${b.currentState}.`),iX(a),s.Media.close(a.a),a.a=""}})},iX=function(a){s.Media.stop(a.a,a.m.getPosition())},jX=function(a){{const b=
|
|
2
|
+
a.m.Sa();a.a=b?b.name||b.url:""}a.g.info(`Open session for ${a.a} `+`with duration ${a.m.getDuration()}`);s.Media.open(a.a,a.m.getDuration(),_.ra)},lX=class extends _.Uv{constructor(){super();this.m=this.f=null;this.a="";this.g=new _.T("clpp.adobe.AdobePlugin")}onPlayerCreated(a){var b=a.getConfiguration().adobe;(b=!b||!1!==b.enabled)?window.s&&s.Media?(this.m=a,kX(this)):this.g.warn("Adobe API not available."):this.g.debug("Adobe plugin is disabled.")}onPlayerWillDestroy(){this.f&&(this.f.release(),
|
|
3
|
+
this.f=null);this.m=null;this.a=""}id(){return"adobe"}};_.x("clpp.adobe.AdobeAnalyticsPlugin",lX);lX.Id="adobe";_.Tn(new class{create(){return new lX}});};f.call(g, window);
|
package/cl.airplay.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
!0;break;case "not-available":this.f=!1}this.m.trigger(new _.H(_.
|
|
3
|
-
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var hX=class extends _.Uv{constructor(){super();this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.cu(()=>{this.m.play().catch(()=>{})});this.h=new _.Vt}onPlayerCreated(a){this.m=a;this.a=a.getSurface().getMedia()}onContentWillLoad(){this.a&&(this.h.on(this.a,"webkitplaybacktargetavailabilitychanged",this.w.bind(this)),this.h.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.A.bind(this)))}onPlayerWillRelease(){this.o.stop();this.h.release()}id(){return"airplay"}w(a){switch(a.availability){case "available":this.f=
|
|
2
|
+
!0;break;case "not-available":this.f=!1}this.m.trigger(new _.H(_.tc,{canCast:this.f}))}A(){const a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.sc:_.rc;if(this.l||!this.m.isPaused()||3===this.m.getState())this.l?this.m.play().catch(()=>{}):this.o.la(.01);this.m.trigger(new _.H(a))}ya(){return this.j}Tc(){return this.f}fj(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())}};_.x("clpp.airplay.AirPlayPlugin",hX);hX.prototype.showCastMenu=hX.prototype.fj;
|
|
3
|
+
hX.prototype.canCast=hX.prototype.Tc;hX.prototype.isCasting=hX.prototype.ya;hX.Id="airplay";_.Tn(new class{create(){return new hX}});};f.call(g, window);
|
package/cl.broadpeak.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
1E3*this.m.getPosition();return 5===this.m.getState()?Math.max(c,this.a):c}getCurrentBitrate(){const c=this.m.getStats();return(c?c.streamBandwidth:0)/1E3}getCapabilities(){return{adTracking:this.m.getConfiguration().broadpeak.adTracking}}}return new b(a)}
|
|
3
|
-
a.h.setUUID(b))},
|
|
4
|
-
c||0;this.o=0;this.l=this.j=this.h=!1}
|
|
5
|
-
this.f.startPosition?0:0<this.w&&this.f.startPosition+this.f.duration>=this.w?2:1}getPodIndex(){return 1}
|
|
6
|
-
Z.prototype.getWrapperAdSystems=Z.prototype.getWrapperAdSystems;Z.prototype.getWrapperAdIds=Z.prototype.getWrapperAdIds;Z.prototype.getSequenceLength=Z.prototype.
|
|
7
|
-
Z.prototype.getClickThroughUrl=Z.prototype.Ra;Z.prototype.isBumper=Z.prototype.
|
|
8
|
-
Z.prototype.getCreativeId=Z.prototype.getCreativeId;Z.prototype.getId=Z.prototype.getId;Z.prototype.getTechnology=Z.prototype.
|
|
9
|
-
!0);break;case 4:c.notifyPause()}}l(){const a=1E3*this.m.getPosition();this.f.notifySeek(a)}release(){this.a&&(_.
|
|
10
|
-
this.m.trigger(new _.H(_.
|
|
11
|
-
a>=b/4&&(this.a.h=!0,this.m.trigger(new _.H(_.
|
|
12
|
-
this.a.getPosition():-1}
|
|
13
|
-
d.getURL(),this.f=new
|
|
14
|
-
this.l=!1}id(){return"broadpeak"}};_.x("clpp.broadpeak.BroadpeakPlugin",
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var XW=function(a){const b=a.m.getSurface().getMedia();b&&(a.l=a.H.bind(a),b.addEventListener("click",a.l))},YW=function(a){a.C.off(a.m,_.gg,a.F)},ZW=function(a){class b extends GenericPlayerApi{constructor(c){super();this.m=c;this.f=_.pj();this.a=0}getPlayerName(){return _.ra}getVersion(){return _.ea}getOSName(){return this.f.os}getDeviceVersion(){return this.f.osVersion.name}getDeviceType(){return"browser"}getTotalDuration(){return this.m.isLive()?0:this.a=1E3*this.m.getDuration()}getCurrentPosition(){const c=
|
|
2
|
+
1E3*this.m.getPosition();return 5===this.m.getState()?Math.max(c,this.a):c}getCurrentBitrate(){const c=this.m.getStats();return(c?c.streamBandwidth:0)/1E3}getCapabilities(){return{adTracking:this.m.getConfiguration().broadpeak.adTracking}}}return new b(a)},$W=function(){return!window.SmartLib||!window.GenericPlayerApi},aX=function(a,b){const c=b.analyticsAddress||null,d=b.nanoCDNHost||null,e=b.broadpeakDomainNames||"";b=b.uuid||null;a.h||(a.h=SmartLib.getInstance(),a.h.init(c,d,e),typeof b===_.Uf&&
|
|
3
|
+
a.h.setUUID(b))},bX=function(a,b,c){const d=c.customParameters||{};a.a=a.h.createStreamingSession();a.a.setOption(StreamingSessionOptions.SESSION_PRECACHE,!0);for(const e in d)a.a.setCustomParameter(e,d[e]);c.adTracking&&(a.j=b.getAdsManager(),a.j.initialize(a.a,c.adParameters||{}));a.w.on(b,_.Xd,a.A.bind(a));a.o=ZW(b);a.a.attachPlayer(a.o)},cX=function(a,b){_.ai(a.w);a.f&&(a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},Z=class{constructor(a,b,c){this.a=a||{};this.f=b||{};this.w=
|
|
4
|
+
c||0;this.o=0;this.l=this.j=this.h=!1}eb(){return"Broadpeak"}fb(){return""}hb(){return 1}getId(){return this.a.adId}getCreativeId(){return this.a.creativeId}zb(){return null}getApiFramework(){return null}getAdSystem(){return""}getAdvertiserName(){return""}getTitle(){return""}getDuration(){return 0>=this.a.duration?-1:this.a.duration/1E3}getPosition(){return this.o}setPosition(a){this.o=a}getSkipTimeOffset(){return 0===this.a.skipPosition?-1:(this.a.skipPosition-this.a.startPosition)/1E3}Bb(){return!1}Ra(){return this.a.clickURL}getMediaUrl(){return null}Va(){return 0}Ua(){return 0}Ba(){return 0}Ca(){return 0===
|
|
5
|
+
this.f.startPosition?0:0<this.w&&this.f.startPosition+this.f.duration>=this.w?2:1}getPodIndex(){return 1}pb(){return this.f.startPosition/1E3}gb(){return this.a.index+1}Wa(){return 0>=this.f.adCount?-1:this.f.adCount}getWrapperAdIds(){return[]}getWrapperAdSystems(){return[]}getWrapperCreativeIds(){return[]}Ab(){return null}canSeek(){return!1}};Z.prototype.canSeek=Z.prototype.canSeek;Z.prototype.getVideoElement=Z.prototype.Ab;Z.prototype.getWrapperCreativeIds=Z.prototype.getWrapperCreativeIds;
|
|
6
|
+
Z.prototype.getWrapperAdSystems=Z.prototype.getWrapperAdSystems;Z.prototype.getWrapperAdIds=Z.prototype.getWrapperAdIds;Z.prototype.getSequenceLength=Z.prototype.Wa;Z.prototype.getPositionInSequence=Z.prototype.gb;Z.prototype.getPodTimeOffset=Z.prototype.pb;Z.prototype.getPodIndex=Z.prototype.getPodIndex;Z.prototype.getPodType=Z.prototype.Ca;Z.prototype.getMediaBitrate=Z.prototype.Ba;Z.prototype.getMediaHeight=Z.prototype.Ua;Z.prototype.getMediaWidth=Z.prototype.Va;Z.prototype.getMediaUrl=Z.prototype.getMediaUrl;
|
|
7
|
+
Z.prototype.getClickThroughUrl=Z.prototype.Ra;Z.prototype.isBumper=Z.prototype.Bb;Z.prototype.getSkipTimeOffset=Z.prototype.getSkipTimeOffset;Z.prototype.getPosition=Z.prototype.getPosition;Z.prototype.getDuration=Z.prototype.getDuration;Z.prototype.getTitle=Z.prototype.getTitle;Z.prototype.getAdvertiserName=Z.prototype.getAdvertiserName;Z.prototype.getAdSystem=Z.prototype.getAdSystem;Z.prototype.getApiFramework=Z.prototype.getApiFramework;Z.prototype.getSourceId=Z.prototype.zb;
|
|
8
|
+
Z.prototype.getCreativeId=Z.prototype.getCreativeId;Z.prototype.getId=Z.prototype.getId;Z.prototype.getTechnology=Z.prototype.hb;Z.prototype.getAdManagerVersion=Z.prototype.fb;Z.prototype.getAdManagerName=Z.prototype.eb;var dX=class{constructor(a,b){this.m=a;this.f=b;this.a=new _.Vt;this.h=!1}init(){const a=this.m,b=this.a;b.on(a,_.Rf,this.o.bind(this));b.on(a,_.Mc,this.j.bind(this));b.on(a,"seek",this.l.bind(this))}j(a){a=a.detail;typeof a.bandwidth===_.r&&this.f.notifyLayerSwitch(a.bandwidth/1E3)}o(a){const b=this.m,c=this.f;a=a.detail;const d=a.currentState;2===a.previousState&&c.notifyStallEnd(!b.isPaused());switch(d){case 2:c.notifyStallStart();break;case 3:this.h?c.notifyResume():(c.notifyFirstImage(),this.h=
|
|
9
|
+
!0);break;case 4:c.notifyPause()}}l(){const a=1E3*this.m.getPosition();this.f.notifySeek(a)}release(){this.a&&(_.ai(this.a),this.a=null)}};var eX=class{constructor(a){this.m=a;this.C=new _.Vt;this.l=this.B=this.f=this.a=null;this.F=this.G.bind(this)}initialize(a,b){this.B=a;a.activateAdvertising();XW(this);for(const c in b)a.setAdParameter(c,b[c]);a.setAdEventsListener({onAdBreakBegin:()=>{this.m.trigger(new _.H(_.Ub,{ad:null}));this.C.on(this.m,_.gg,this.F)},onAdBegin:(c,d)=>{this.f=c;this.a=new Z(c,d,1E3*this.m.getDuration());this.m.trigger(new _.H(_.mc,{ad:this.a}))},onAdSkippable:()=>{},onAdEnd:()=>{if(this.a){const c={ad:this.a};
|
|
10
|
+
this.m.trigger(new _.H(_.Yb,c));this.m.trigger(new _.H(_.nc,c));this.f=this.a=null}},onAdBreakEnd:()=>{YW(this);this.m.trigger(new _.H(_.Vb));this.a=null}})}H(){if(this.a&&this.B){var a=this.a.Ra();a&&(this.B.adUserInteraction("click"),this.m.trigger(new _.H(_.Xb,{ad:this.a})),this.m.pause(),(a=window.open(a,"_blank"))&&a.focus())}}G(){if(this.a&&this.f){var a=this.m.getPosition()-this.f.startPosition/1E3,b=this.a.getDuration();0<b&&a>b||(this.a.setPosition(a),this.m.trigger(new _.H(_.jc,{ad:this.a})),
|
|
11
|
+
!this.a.h&&a>=b/4&&(this.a.h=!0,this.m.trigger(new _.H(_.Zb,{ad:this.a}))),!this.a.j&&a>=b/2&&(this.a.j=!0,this.m.trigger(new _.H(_.ec,{ad:this.a}))),!this.a.l&&a>=3*b/4&&(this.a.l=!0,this.m.trigger(new _.H(_.oc,{ad:this.a}))))}}load(){return Promise.resolve()}j(){return!0}A(){}w(){return!0}skip(){if(this.a){var a=this.a.getPosition(),b=this.a.getSkipTimeOffset();-1===b||a<b||(a=this.m.getPosition()-a+this.a.getDuration(),b=this.a,this.f=this.a=null,YW(this),this.m.trigger(new _.H(_.lc,{ad:b})),this.m.setPosition(a))}}jb(){}isPaused(){}pause(){}resume(){}getAdVolume(){return 0}h(){}getVolume(){return 0}setVolume(){}setMuted(){}isMuted(){return!1}qb(){return!1}getPosition(){return this.a?
|
|
12
|
+
this.a.getPosition():-1}o(){YW(this);this.C.release();const a=this.m.getSurface().getMedia();a&&this.l&&(a.removeEventListener("click",this.l),this.l=null);this.B=this.f=this.a=null;return Promise.resolve()}};eX.prototype.getPosition=eX.prototype.getPosition;eX.prototype.setVolume=eX.prototype.setVolume;eX.prototype.getVolume=eX.prototype.getVolume;eX.prototype.resume=eX.prototype.resume;eX.prototype.pause=eX.prototype.pause;eX.prototype.skip=eX.prototype.skip;var fX=class extends _.Uv{constructor(){super();this.o=this.f=this.a=this.h=this.m=null;this.w=new _.Vt;this.l=!1;this.j=null}onPlayerCreated(a){this.m=a}onContentWillLoad(a,b){const c=a.getConfiguration().broadpeak;if(c){if($W())return a.onError(new _.I(1,9,11E3));this.l=!0;aX(this,c);bX(this,a,c);return this.a.getURL(b.url).then(d=>{if(d.isError()){const e=d.getDetailedErrorCode();d=d.getDetailedErrorMessage();this.m.onError(new _.I(1,9,11001,{bpkErrorCode:e,message:d}));cX(this,void 0)}else b.url=
|
|
13
|
+
d.getURL(),this.f=new dX(this.m,this.o),this.f.init()})}}onContentLoaded(){!1!==this.l&&this.a.precacheEnded()}A(a){a=a.detail;if(7003===a.code)cX(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.D)switch(a.category){case 3:cX(this,SmartLib.BPDecodingError);break;case 1:cX(this,SmartLib.BPNetworkingError);break;case 6:cX(this,SmartLib.BPAccessRightError);break;default:cX(this,SmartLib.BPUnspecifiedError)}}onPlayerWillRelease(){this.j=null;$W()||cX(this,SmartLib.BPSessionEndsNormally);
|
|
14
|
+
this.l=!1}id(){return"broadpeak"}};_.x("clpp.broadpeak.BroadpeakPlugin",fX);fX.isSdkMissing=$W;fX.Id="broadpeak";var gX=class{name(){return"clpp.broadpeak.AdsManagerFactory"}a(a,b){return $W()?!1:!!(b&&b.broadpeak&&b.broadpeak.adTracking)}create(a){return new eX(a)}};_.Tn(new class{create(){return new fX}});_.Kh(new gX);};f.call(g, window);
|