@castlabs/prestoplay 6.23.1 → 6.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +7 -7
- package/cjs/cl.cast.js +116 -116
- package/cjs/cl.conviva.js +32 -32
- package/cjs/cl.core.js +607 -591
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +88 -86
- package/cjs/cl.externs.js +105 -54
- package/cjs/cl.freewheel.js +25 -24
- package/cjs/cl.hls.js +77 -71
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +24 -23
- package/cjs/cl.mse.js +352 -342
- package/cjs/cl.muxdata.js +15 -15
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +15 -14
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.sessions.js +16 -16
- package/cjs/cl.simid.js +15 -15
- package/cjs/cl.smooth.js +72 -72
- 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 +37 -37
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +88 -88
- package/cl.conviva.js +27 -27
- package/cl.core.js +491 -478
- package/cl.crypto.js +9 -9
- package/cl.dash.js +82 -80
- package/cl.externs.js +105 -54
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +79 -74
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +18 -17
- package/cl.mse.js +310 -306
- 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.sessions.js +10 -10
- package/cl.simid.js +13 -13
- package/cl.smooth.js +60 -59
- package/cl.thumbnails.js +19 -19
- package/cl.tizen.js +57 -57
- 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 +28 -28
- package/package.json +1 -1
- package/typings.d.ts +54 -25
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 _.
|
|
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.da=this.H=this.f=this.a=this.m=null;this.g=new _.K("clpp.vr");this.I=70;this.ca=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.U=new
|
|
11
|
-
this.C=this.
|
|
12
|
-
_.
|
|
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
|
-
_.
|
|
16
|
-
_.
|
|
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 $x="touchmove",ay="touchstart",by=function(a,b,c,d){this.x=a||0;this.y=b||0;this.a=c||0;this.f=d||1},cy=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)},dy=function(a,b,c){c*=.5;var d=Math.sqrt(a*a+b*b),e=Math.sin(c);return new by(a/d*e,b/d*e,0/d*e,Math.cos(c))},ey=function(a,b,c){this.x=a||0;this.y=b||0;this.a=c||0},fy=function(a,b){isFinite(b)?(a.x*=b,a.y*=b,a.a*=
|
|
3
|
+
b):(a.x=0,a.y=0,a.a=0)},gy=function(a,b){return a.x*b.x+a.y*b.y+a.a*b.a},hy=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},iy=function(){this.a=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])},jy=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},ky=function(a){var b=new ey(0,0,0),c=new ey(0,0,1),d=new ey,e=new ey,f=new ey;a=a.a;var g=new ey(0,1,0);f.x=b.x-g.x;f.y=b.y-g.y;f.a=b.a-g.a;g=f.length();fy(f,1/g);c=hy(d,c,f);g=c.length();fy(c,1/g);hy(e,f,d);a[0]=d.x;a[1]=d.y;a[2]=d.a;a[3]=-gy(d,b);a[4]=e.x;a[5]=e.y;a[6]=e.a;a[7]=-gy(e,b);a[8]=f.x;a[9]=f.y;a[10]=f.a;a[11]=-gy(f,b);a[12]=0;a[13]=0;a[14]=0;a[15]=1},my=function(a){this.a=a;this.f=a.createProgram();this.l=
|
|
5
|
+
ly(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=ly(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)},ly=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},ny=function(a){this.a=a;var b=[],c,d;for(d=0;70>=d;d++){var e=3>=d?d/4/64:67<=d?(63+(d-66)/4)/64:(d-3)/64;var f=(e-.5)*Math.PI,g=Math.cos(f);for(c=0;128>=c;c++){var h=c/128,l=(.5+h)*Math.PI*2;128===c?(b.push(b[645*d]),b.push(b[645*d+1]),b.push(b[645*d+2])):(b.push(100*Math.cos(l)*g),b.push(100*Math.sin(l)*g),b.push(100*Math.sin(f)));0===d||70===d?b.push(.5):b.push(1-h);b.push(1-e)}}e=[];for(c=0;128>c;c++)for(d=0;70>d;d++)f=
|
|
8
|
+
5*(129*d+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*d+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*d+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]);this.h=e.length/5;this.f=a.createBuffer();b=new Float32Array(e);a.bindBuffer(a.ARRAY_BUFFER,this.f);a.bufferData(a.ARRAY_BUFFER,b,a.STATIC_DRAW)},oy=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)},py=function(){var a=this;this.o=this.w=this.L=this.J=this.A=
|
|
10
|
+
this.da=this.H=this.f=this.a=this.m=null;this.g=new _.K("clpp.vr");this.I=70;this.ca=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.U=new iy;this.Y=new iy;this.ga=new iy;this.ja=new iy;this.B=this.zn.bind(this);
|
|
11
|
+
this.C=this.An.bind(this);this.K=this.yn.bind(this)},qy=function(a){var b=dy(1,0,a.l*Math.PI/180);cy(dy(0,1,a.j*Math.PI/180),a.U);cy(b,a.Y);ky(a.ga);jy(a.ja,a.U,a.ga);jy(a.H,a.Y,a.ja)},ry=function(a){a.a&&(a.a.removeEventListener("mousemove",a.B,!1),a.a.removeEventListener($x,a.B,!1),a.a.removeEventListener("mouseup",a.C,!1),a.a.removeEventListener("touchend",a.C,!1))},sy=function(){};ey.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.a*this.a)};iy.prototype.set=function(a,b,c,d,e,f,g,h,l,m,n,p,q,t,v,z){var A=this.a;A[0]=a;A[4]=b;A[8]=c;A[12]=d;A[1]=e;A[5]=f;A[9]=g;A[13]=h;A[2]=l;A[6]=m;A[10]=n;A[14]=p;A[3]=q;A[7]=t;A[11]=v;A[15]=z;return this};var ty={alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!1,devicePixelRatio:1};_.x(py,_.gw);_.u=py.prototype;_.u.onPlayerCreated=function(a){this.g.info("Player created");this.m=a};
|
|
12
|
+
_.u.onContentWillLoad=function(a){var b=a.getConfiguration();if(b.vr&&b.vr.enable){var c=b.vr,d=c.fieldOfView,e=c.sensitivity,f=c.invertHorizontalControl;c=c.invertVerticalControl;if(void 0!==d&&_.N.xa(d))this.I=d;else throw new _.O(1,7,7100,"fieldOfView configuration must be a number");if(void 0!==e&&_.N.xa(e)&&0<e)this.ca=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()===_.r){this.g.info("Initialize VR Surface");
|
|
13
|
+
if(!this.a){this.a=document.createElement("canvas");this.a.style.width="100%";this.f=this.a.getContext("webgl",ty)||this.a.getContext("experimental-webgl",ty);if(!this.f)throw new _.O(1,9,9003,"Unable to create GL context");this.H=new iy;ky(this.H);this.da=new ny(this.f);this.A=new my(this.f);this.J=new iy;this.L=new iy;this.o=this.w=null;this.a.addEventListener(_.cg,this.G)}a.addElementToContainer(this.a,!0,!0);a.hideMediaElement();b.vr.attachMouseListener&&(this.a.addEventListener("mousedown",this.K,
|
|
14
|
+
!1),this.a.addEventListener(ay,this.K,!1));this.G();this.oj()}else this.g.info("No video element found, can not initialize VR plugin");else this.g.info("No surface found, can not initialize VR plugin")}};
|
|
15
|
+
_.u.onPlayerWillRelease=function(){this.g.info("Releasing VR plugin resources");this.w&&cancelAnimationFrame(this.w);this.h.x=0;this.l=this.j=this.h.y=0;this.f&&(delete this.f,this.f=null);this.a&&(ry(this),this.a.removeEventListener(_.cg,this.G),this.a.parentElement.removeChild(this.a),this.a.removeEventListener("mousedown",this.K,!1),delete this.a,this.a=null)};_.u.onPlayerWillDestroy=function(){var a=this;return _.I(function(b){a.m=null;_.C(b)})};_.u.id=function(){return"vr"};
|
|
16
|
+
_.u.oj=function(){if(this.m&&this.f){var a=this.m.getSurface();if(a&&(a=a.getMedia())&&a.tagName.toLowerCase()===_.r){this.w=requestAnimationFrame(this.oj.bind(this));var b=this.f;this.o||a.readyState!==a.HAVE_ENOUGH_DATA||(this.o=new oy(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=jy(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.da;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
|
-
_.
|
|
20
|
-
_.
|
|
21
|
-
_.
|
|
19
|
+
_.u.yn=function(a){this.g.debug("Mouse Down. Enable VR mouse interaction");a.preventDefault();if(0===a.button||a.type===ay)a.type===ay?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($x,this.B,!1),this.a.addEventListener("mouseup",this.C,!1),this.a.addEventListener("touchend",this.C,!1)};
|
|
20
|
+
_.u.zn=function(a){a.preventDefault();var b=a.clientX,c=a.clientY;a.type===$x&&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.ca;c=d*b*(this.P?-1:1);this.j+=a*b*(this.M?-1:1);this.l+=c;qy(this)};_.u.An=function(a){this.g.debug("Mouse Up. Removing mouse interaction listeners");a.preventDefault();ry(this)};_.u.Rm=function(a,b){this.l=b;this.j=a;qy(this)};_.u.Zl=function(){return{x:this.j,y:this.l}};
|
|
21
|
+
_.u.so=function(a){this.I=a;this.G()};_.J("clpp.vr.VrPlugin",py);py.prototype.setCameraFieldOfView=py.prototype.so;py.prototype.getCameraCoordinates=py.prototype.Zl;py.prototype.moveCamera=py.prototype.Rm;py.Id="vr";sy.prototype.create=function(){return new py};_.cu(new sy);};
|
|
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=_.w(d);for(var g=e.next();!g.done;g=e.next()){var h=g.value;if(/^region/.test(h.toLowerCase())){h=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)}h=[];d=_.w(d);for(g=d.next();!g.done;g=d.next())if(g=g.value,g.includes("--\x3e")){p=g.split("\n");var q=c;if(1===p.length&&!p[0]||/^NOTE($|[ \t])/.test(p[0])||"STYLE"===p[0])g=null;else{g=null;p[0].includes("--\x3e")||(g=p[0],p.splice(0,1));l=new _.
|
|
12
|
-
n,
|
|
13
|
-
|
|
14
|
-
[],ra=0;ra<
|
|
15
|
-
_.
|
|
2
|
+
var f=function(window){var Gx=" The setting will be ignored.",Hx="VTT parser encountered an invalid VTT setting: ",Ix="application/x-subrip",Jx="text/srt",Kx='text/vtt; codecs\x3d"vtt"',Lx='text/vtt; codecs\x3d"wvtt"',Mx=function(a){_.Wj(a,/[ \t]+/gm)},Nx=function(a){return a.a===a.f.length?null:(a=_.Wj(a,/[^ \t\n]*/gm))?a[0]:null},Ox=function(){},Px=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},Qx=function(){},Rx=function(a){this.a=a},Tx=function(a,b,c){var d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"===b?a.textAlign=_.bj:a.textAlign=
|
|
4
|
+
_.mw[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"===d[1]?_.Xg:_.Yg;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===_.Oe||b===_.qg?_.Oe:b===_.Qe||b===_.ye?_.Qe:_.yd);else if(d=/^region:(.*)$/.exec(b)){if(b=Sx(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=_.nw[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.dj,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.nw[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},Sx=function(a,b){var c=a.filter(function(d){return d.id===b});return c.length?c[0]:(_.Yh("VTT parser could not find a region with id: ",b," The region will be ignored."),null)},Ux=function(a){a=_.Wj(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)},Vx=function(){Rx.apply(this,arguments)},Wx=function(){this.a=null;this.g=new _.K("clpp.vtt.mp4")},Yx=function(a,b,c){var d,e,f;(new _.Dn).N("payl",_.Gn(function(g){d=_.T.ea(g)})).N("iden",_.Gn(function(g){e=_.T.ea(g)})).N("sttg",_.Gn(function(g){f=_.T.ea(g)})).parse(a);return d?Xx(d,e,f,b,c):null},Xx=function(a,b,c,d,e){a=new _.gj(d,e,a,_.eh);b&&(a.id=b);if(c)for(b=new _.Vj(c),c=
|
|
7
|
+
Nx(b);c;)Tx(a,c,[])||_.Yh(Hx,c,Gx),Mx(b),c=Nx(b);return a},Zx=function(){this.j=new Qx};Ox.prototype.a=function(a){a=_.T.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=_.w(b);for(var c=b.next();!c.done;c=b.next())a+=Px(c.value)}return _.T.ib(a)};Qx.prototype.create=function(){return new Ox};Qx.prototype.probe=function(a,b){return(a===Jx||a===Ix)&&b===_.Ag};Rx.prototype.parseInit=function(){};
|
|
8
|
+
Rx.prototype.parseMedia=function(a,b){var c=_.T.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=Ux(new _.Vj(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=_.w(d);for(var g=e.next();!g.done;g=e.next()){var h=g.value;if(/^region/.test(h.toLowerCase())){h=new _.Vj(h.replace(/\n/g," "));g=new _.jj;Nx(h);Mx(h);for(var l=Nx(h);l;){var m;a:{var n=g,p=l;if(m=/^id:(.*)$/.exec(p))n.id=m[1];else if(m=/^width:(\d{1,2}|100)%$/.exec(p))n.width=Number(m[1]);else if(m=/^lines:(\d+)$/.exec(p))n.height=Number(m[1]),n.heightUnits=2;else if(m=/^regionanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.regionAnchorX=
|
|
10
|
+
Number(m[1]),n.regionAnchorY=Number(m[2]);else if(m=/^viewportanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.viewportAnchorX=Number(m[1]),n.viewportAnchorY=Number(m[2]);else if(/^scroll:up$/.exec(p))n.scroll="up";else{m=!1;break a}m=!0}m||_.Yh("VTT parser encountered an invalid VTTRegion setting: ",l,Gx);Mx(h);l=Nx(h)}f.push(g)}}e=[];h=_.w(d);for(g=h.next();!g.done;g=h.next())if(g=g.value,/^style/.test(g.toLowerCase())){g=g.replace(/^style/i,"").replace(/\n/g," ");l=/[^{}]+{[^{}]*}/g;do(m=l.exec(g))&&
|
|
11
|
+
e.push(m[0]);while(m)}h=[];d=_.w(d);for(g=d.next();!g.done;g=d.next())if(g=g.value,g.includes("--\x3e")){p=g.split("\n");var q=c;if(1===p.length&&!p[0]||/^NOTE($|[ \t])/.test(p[0])||"STYLE"===p[0])g=null;else{g=null;p[0].includes("--\x3e")||(g=p[0],p.splice(0,1));l=new _.Vj(p[0]);m=Ux(l);var t=_.Wj(l,/[ \t]+--\x3e[ \t]+/g);n=Ux(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 _.gj(m,n,p,_.eh);g&&(m.id=g);Mx(l);for(n=Nx(l);n;)Tx(m,n,f)||_.Yh(Hx,
|
|
12
|
+
n,Gx),Mx(l),n=Nx(l);null!=g&&(m.id=g);g=m}g&&h.push(g)}return{cues:h,styles:e}};_.x(Vx,Rx);Vx.prototype.parseMedia=function(a,b){return Rx.prototype.parseMedia.call(this,(new Ox).a(a),b)};Wx.prototype.parseInit=function(a){var b=this,c=!1;(new _.Dn).N(_.cf,_.En).N(_.Jg,_.En).N(_.Ye,_.En).aa("mdhd",function(d){0===d.version?(d.reader.skip(4),d.reader.skip(4),b.a=_.yn(d.reader),d.reader.skip(4)):(d.reader.skip(8),d.reader.skip(8),b.a=_.yn(d.reader),d.reader.skip(8));d.reader.skip(4)}).N(_.bf,_.En).N(_.tg,_.En).aa(_.vg,_.Fn).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
|
+
Wx.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,h=!1,l=!1,m=null;(new _.Dn).N("moof",_.En).N("traf",_.En).aa("tfdt",function(F){g=!0;c=0===F.version?_.yn(F.reader):_.An(F.reader)}).aa("tfhd",function(F){var M=F.flags;F=F.reader;F.skip(4);M&1&&F.skip(8);M&2&&F.skip(4);m=M&8?_.yn(F):null}).aa("trun",function(F){h=!0;var M=F.version,R=F.flags;F=F.reader;var la=_.yn(F);R&1&&F.skip(4);R&4&&F.skip(4);for(var U=
|
|
14
|
+
[],ra=0;ra<la;ra++){var Ba={duration:null,sampleSize:null,Yg:null};R&256&&(Ba.duration=_.yn(F));R&512&&(Ba.sampleSize=_.yn(F));R&1024&&F.skip(4);R&2048&&(Ba.Yg=0===M?_.yn(F):_.zn(F));U.push(Ba)}d=U}).N(_.Xe,_.Gn(function(F){l=!0;e=F})).parse(a);if(!l&&!g&&!h)throw new _.O(_.P,2,2008);var n=c,p=new DataView(e.buffer,e.byteOffset,e.byteLength);p=new _.tn(p,!1);for(var q=_.w(d),t=q.next();!t.done;t=q.next()){t=t.value;var v=t.duration||m,z=t.Yg?c+t.Yg:n;n=z+(v||0);var A=0;do{var E=_.yn(p);A+=E;var G=
|
|
15
|
+
_.yn(p);G=_.In(G);var B=null;"vttc"===G?8<E&&(B=_.Cn(p,E-8)):("vtte"!==G&&this.g.error("Unknown box "+G+"! Skipping!"),p.skip(E-8));v?B&&f.push(Yx(B,b.periodStart+z/this.a,b.periodStart+n/this.a)):this.g.error("WVTT sample duration unknown, and no default found!")}while(t.sampleSize&&A<t.sampleSize)}return{cues:f.filter(_.pj),styles:[]}};_.x(Zx,_.Gu);Zx.prototype.f=function(){_.Fv(_.Ag,Rx);_.Fv(Kx,Rx);_.Fv(Lx,Rx);_.Fv(_.$c,Wx);_.Fv(Jx,Vx);_.Fv(Ix,Vx);_.rl.push(this.j)};Zx.prototype.a=function(){_.Hv(_.Ag);_.Hv(Kx);_.Hv(Lx);_.Hv(_.$c);_.Hv(Jx);_.Hv(Ix);_.tl(this.j)};Zx.prototype.id=function(){return"subtitles-vtt"};_.J("clpp.vtt.VttComponent",Zx);};
|
|
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 _.y(l,m,2)}g=l.f;h=g.getSessionState();if(h!==YospaceAdManagement.SessionState.INITIALISED)throw c.g.error("Failed to initialize Yospace session. State:",h,"URL",b.url),new _.
|
|
5
|
-
|
|
2
|
+
var f=function(window){var Bx="clpp.yospace.YospacePlugin",Cx=function(){this.a=null;this.g=new _.K(Bx)},Dx=function(){};_.x(Cx,_.gw);Cx.prototype.ri=function(){return this.a};
|
|
3
|
+
Cx.prototype.onContentWillLoad=function(a,b){var c=this,d,e,f,g,h;return _.I(function(l){if(1==l.a){d=a.getConfiguration();e=d.yospace;if(!e.enabled)return l["return"]();if(typeof window.YospaceAdManagement!==_.gf)throw new _.O(_.P,9,7003,"Yospace SDK not found.");c.g.info("Yospace enabled.");f=e.streamType||Ex;a:{var m=b.url;c.g.info("Creating Yospace session for stream type",f);switch(f){case Ex:m=YospaceAdManagement.SessionVOD.create(m);break a;case Fx:m=YospaceAdManagement.SessionLive.create(m);
|
|
4
|
+
break a;default:m=YospaceAdManagement.SessionDVRLive.create(m)}}return _.y(l,m,2)}g=l.f;h=g.getSessionState();if(h!==YospaceAdManagement.SessionState.INITIALISED)throw c.g.error("Failed to initialize Yospace session. State:",h,"URL",b.url),new _.O(_.P,9,7003,"Yospace session failed to initialize.");a.trigger(new _.L(_.rh,{detail:g}));b.url=g.getPlaybackUrl();c.g.info("Yospace session initialized. New URL:",b.url);c.a=g;_.C(l)})};
|
|
5
|
+
Cx.prototype.onPlayerWillRelease=function(a){if(this.a){this.g.info("Shutting down Yospace session.");var b=this.a;this.a.shutdown();this.a=null;a.trigger(new _.L(_.qh,{detail:b}))}};Cx.prototype.id=function(){return"yospace"};_.J(Bx,Cx);Cx.prototype.getSession=Cx.prototype.ri;Cx.Id="yospace";Dx.prototype.create=function(){return new Cx};_.cu(new Dx);var Ex=_.kc,Fx="LIVE";_.J("clpp.yospace.StreamType",{VOD:Ex,LIVE:Fx,DVR:"DVR"});};
|
|
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,42 +1,42 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
"PlayReady":a.startsWith(_.
|
|
4
|
-
b.message,b.metadata),c.debug(
|
|
2
|
+
var f=function(window){var Xw='" event to NPAW',Yw='" event to Youbora',Zw='Reporting "',$w="Unhandled state",ax="accountCode key is missing in Youbora config",bx="ad break start",cx="ad buffering ended",dx="ad buffering started",ex="ad click through url: ",fx="ad timeline changed",gx="clpp.npaw.NpawPlugin",hx="clpp.npaw.YouboraPlugin",ix="content.isLive",jx="content.title",kx="is container visible",lx="youbora",mx=function(a){return a.startsWith(_.Xd)?"Widevine":a.startsWith(_.Sd)?"FairPlay":a.match(/^com\.(microsoft|chromecast)\.playready/)?
|
|
3
|
+
"PlayReady":a.startsWith(_.qf)?"ClearKey":a.startsWith(_.Rd)?"Primetime":a},nx=function(a){return(a=a.getConfiguration().youbora)&&a.errorFilter?a.errorFilter:function(b){return{code:""+b.code,message:b.message,severity:b.severity}}},ox=function(a,b,c,d){b=nx(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===a.code?"ad error":_.Ae;b.severity===_.P?(d.fireFatalError(b.code,b.message,b.metadata),c.debug('Reporting "fatal '+a+'" to Youbora',b.code,b)):(d.fireError(b.code,
|
|
4
|
+
b.message,b.metadata),c.debug(Zw+a+'" to Youbora',b.code,b));return b},px=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.m=c;d.a=new _.wi;d.g=new _.K("clpp.npaw.YouboraAdapter");d.o=!1;d.h=!1;d.B=!1;d.registerListeners();return d}_.x(b,youbora.Adapter);b.prototype.getPlayhead=function(){return this.getIsLive()?-1:this.m.getPosition()};b.prototype.getDuration=function(){return this.m.getDuration()};b.prototype.getRendition=function(){var c=this.m.getTrackManager();if(c&&(c=c.na())){var d=
|
|
5
5
|
c.width;var e=c.height;var f=c.bandwidth}d&&e&&f||(c=this.j(),d=d||c.width,e=e||c.height,f=f||c.streamBandwidth);return youbora.Util.buildRenditionString(d,e,f)};b.prototype.getIsLive=function(){return this.m.isLive()};b.prototype.getResource=function(){var c=this.m.getLoadedSource();return c&&c.url};b.prototype.getBitrate=function(){return this.j().streamBandwidth};b.prototype.getThroughput=function(){return this.j().estimatedBandwidth};b.prototype.getPlayrate=function(){return this.m.getPlaybackRate()};
|
|
6
|
-
b.prototype.getFramesPerSecond=function(){var c=this.m.getTrackManager();return c&&(c=c.
|
|
7
|
-
_.
|
|
8
|
-
if(c)switch(c.currentState){case _.
|
|
9
|
-
!1,this.fireInit())};b.prototype.A=function(){var c=this.m.getDrmInfo();c&&(c=
|
|
10
|
-
c);this.o=(c=c.adsTimeline)&&c.
|
|
11
|
-
function(){return this.a&&this.a.getDuration()};b.prototype.getRendition=function(){var c=null;this.a&&(c=youbora.Util.buildRenditionString(this.a.
|
|
12
|
-
function(){return this.a&&this.a.getAdvertiserName()};b.prototype.getCreativeId=function(){return this.a&&this.a.getCreativeId()};b.prototype.getPosition=function(){var c=youbora.Constants.AdPosition,d=null;if(this.a)switch(this.a.
|
|
13
|
-
return c&&0<c.getVolume()};b.prototype.getExpectedBreaks=function(){return this.j&&this.j.getCuePoints().length};b.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};b.prototype.getExpectedAds=function(){return this.a&&this.a.
|
|
14
|
-
b.prototype.getIsVisible=function(){var c=this.m.getSurface().getContainer();c=youbora.Util.calculateAdViewability(c);this.g.debug(
|
|
15
|
-
this.f.on(this.m,_.
|
|
16
|
-
function(){_.
|
|
17
|
-
!0;this.h(
|
|
18
|
-
if(this.getPosition()===youbora.Constants.AdPosition.Postroll){var c=this.plugin.getAdapter();c&&c.fireStop()}};b.prototype.J=function(c){(c=c.detail)&&10003===c.code&&
|
|
19
|
-
a.prototype.getPlayhead=function(){return this.getIsLive()?-1:this.player.getPosition()};a.prototype.getDuration=function(){return this.player.getDuration()};a.prototype.getRendition=function(){var b=null,c=null,d=null,e=this.player.getTrackManager();e&&(e=e.
|
|
20
|
-
function(){var b=this.player.getLoadedSource();return b&&b.url};a.prototype.getBitrate=function(){return this.j().streamBandwidth};a.prototype.getThroughput=function(){return this.j().estimatedBandwidth};a.prototype.getPlayrate=function(){return this.player.getPlaybackRate()};a.prototype.getFramesPerSecond=function(){var b=this.player.getTrackManager();return b&&(b=b.
|
|
21
|
-
a.prototype.getPlayerVersion=function(){return _.ia};a.prototype.registerListeners=function(){var b=this.w();this.player&&b&&(b.on(this.player,_.
|
|
22
|
-
this.B=!0;this.f=this.h=!1;this.a=null};a.prototype.j=function(){return this.player.getStats()||_.
|
|
23
|
-
this.fireStop();break;case _.
|
|
24
|
-
return this.a};a.prototype.I=function(){this.l(_
|
|
25
|
-
_.x(a,NpawPluginAdapters.ads.Ima);a.prototype.getDuration=function(){return this.a?this.a.getDuration():null};a.prototype.getRendition=function(){var b=null;this.a&&(b=this.getNpawUtils().buildRenditionString(this.a.
|
|
26
|
-
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.C=!0;this.j=this.h=this.a=null};a.prototype.getPosition=function(){var b=this.getNpawReference().Constants.AdPosition,c=null;if(this.a)switch(this.a.
|
|
27
|
-
b.Preroll;break;case 2:c=b.Postroll;break;case 1:c=b.Midroll}
|
|
28
|
-
a.prototype.getGivenAds=function(){return this.getExpectedAds()};a.prototype.getBreaksTime=function(){var b=this;return this.h&&this.h.getCuePoints().map(function(c){return-1===c?b.player.getDuration():c})};a.prototype.getIsFullscreen=function(){return this.player.getSurface().isFullscreen()};a.prototype.getIsVisible=function(){var b=this.player.getSurface().getContainer();b=this.getNpawUtils().calculateAdViewability(b);
|
|
29
|
-
function(){return"castlabs-ads-adapter-6.
|
|
30
|
-
_.
|
|
31
|
-
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(
|
|
32
|
-
function(b){this.f("ad quartile",b);this.fireQuartile(b)};a.prototype.J=function(){this.f("ad clicked");var b=this.a&&this.a.
|
|
33
|
-
a.prototype.L=function(b){(b=b.detail)&&10003===b.code&&
|
|
34
|
-
(a.g.warn("NPAW SDK not found."),b.onError(new _.
|
|
35
|
-
!1;if(!c.accountCode)return a.g.warn(
|
|
36
|
-
_.
|
|
37
|
-
_.
|
|
38
|
-
_.
|
|
39
|
-
|
|
6
|
+
b.prototype.getFramesPerSecond=function(){var c=this.m.getTrackManager();return c&&(c=c.Na())?c.frameRate:null};b.prototype.getPlayerName=function(){return _.xa};b.prototype.getVersion=function(){return"6.25.0-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,_.rg,this.K.bind(this)),this.a.on(this.m,_.Ae,this.H.bind(this)),this.a.on(this.m,
|
|
7
|
+
_.Ug,this.J.bind(this)),this.a.on(this.m,_.Tg,this.I.bind(this)),this.a.on(this.m,_.Rc,this.C.bind(this)),this.a.on(this.m,_.ud,this.G.bind(this)))};b.prototype.unregisterListeners=function(){this.g.debug(_.fc);_.zi(this.a)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.B=!0};b.prototype.j=function(){return this.m.getStats()||_.Gq()};b.prototype.w=function(){return!!this.m.getConfiguration().autoplay};b.prototype.K=function(c){c=c.detail;this.l("state change",c);
|
|
8
|
+
if(c)switch(c.currentState){case _.Tq:this.w()&&this.f();break;case _.Vq:this.f();this.A();this.fireResume();this.fireBufferEnd();break;case _.Uq:this.w()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.Hq:this.fireBufferEnd();this.fireStop();break;case _.Oq:this.fireBufferEnd();this.o&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.Mq:this.fireBufferBegin();break;default:this.g.debug($w,c)}};b.prototype.f=function(){this.plugin.isInitiated||(this.h=
|
|
9
|
+
!1,this.fireInit())};b.prototype.A=function(){var c=this.m.getDrmInfo();c&&(c=mx(c.keySystem))&&this.plugin.setOptions({"content.drm":c});this.fireJoin()};b.prototype.H=function(c){!(c=c.detail)||this.h||10003===c.code&&this.plugin.getAdsAdapter()||(c=ox(c,this.m,this.g,this))&&c.severity===_.P&&(this.h=!0)};b.prototype.J=function(){this.m.isEnded()||(this.l(_.jg),this.f(),this.fireSeekBegin())};b.prototype.I=function(){this.l(_.ig);this.fireSeekEnd()};b.prototype.C=function(c){this.g.debug("adsTimeline",
|
|
10
|
+
c);this.o=(c=c.adsTimeline)&&c.Rb()};b.prototype.G=function(c){this.g.debug("Casting",c);this.fireCasted()};b.prototype.l=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.g.debug.apply(this.g,[Zw+c+Yw].concat(_.vh(e)))};return new b(a)},qx=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 _.wi;d.g=new _.K("clpp.npaw.YouboraAdsAdapter");d.registerListeners();d.A=!1;d.l=!1;return d}_.x(b,youbora.Adapter);b.prototype.getDuration=
|
|
11
|
+
function(){return this.a&&this.a.getDuration()};b.prototype.getRendition=function(){var c=null;this.a&&(c=youbora.Util.buildRenditionString(this.a.qb(),this.a.pb(),this.a.Xa()));return c};b.prototype.getBitrate=function(){return this.a&&this.a.Xa()};b.prototype.getPlayhead=function(){var c=this.m.getAdsManager();return c&&c.getPosition()};b.prototype.getResource=function(){return this.a&&this.a.getMediaUrl()};b.prototype.getTitle=function(){return this.a&&this.a.getTitle()};b.prototype.getProvider=
|
|
12
|
+
function(){return this.a&&this.a.getAdvertiserName()};b.prototype.getCreativeId=function(){return this.a&&this.a.getCreativeId()};b.prototype.getPosition=function(){var c=youbora.Constants.AdPosition,d=null;if(this.a)switch(this.a.Ya()){case 0:d=c.Preroll;break;case 2:d=c.Postroll;break;case 1:d=c.Midroll}this.g.debug("Ad position",d);return d};b.prototype.getIsSkippable=function(){return this.a&&-1!==this.a.getSkipTimeOffset()};b.prototype.getAudioEnabled=function(){var c=this.m.getAdsManager();
|
|
13
|
+
return c&&0<c.getVolume()};b.prototype.getExpectedBreaks=function(){return this.j&&this.j.getCuePoints().length};b.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};b.prototype.getExpectedAds=function(){return this.a&&this.a.rb()};b.prototype.getGivenAds=function(){return this.getExpectedAds()};b.prototype.getBreaksTime=function(){var c=this;return this.j&&this.j.getCuePoints().map(function(d){return-1===d?c.m.getDuration():d})};b.prototype.getIsFullscreen=function(){return this.m.getSurface().isFullscreen()};
|
|
14
|
+
b.prototype.getIsVisible=function(){var c=this.m.getSurface().getContainer();c=youbora.Util.calculateAdViewability(c);this.g.debug(kx,c);return c};b.prototype.getPlayerName=function(){return _.xa};b.prototype.getVersion=function(){return"6.25.0-castlabsadsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ia};b.prototype.registerListeners=function(){this.m&&this.f&&(this.f.on(this.m,_.Rc,this.U.bind(this)),this.f.on(this.m,_.Nc,this.P.bind(this)),this.f.on(this.m,_.Jc,this.K.bind(this)),
|
|
15
|
+
this.f.on(this.m,_.Lc,this.L.bind(this)),this.f.on(this.m,_.Bc,this.I.bind(this)),this.f.on(this.m,_.Cc,this.o.bind(this,1)),this.f.on(this.m,_.Ic,this.o.bind(this,2)),this.f.on(this.m,_.Pc,this.o.bind(this,3)),this.f.on(this.m,_.Ac,this.H.bind(this)),this.f.on(this.m,_.Mc,this.M.bind(this)),this.f.on(this.m,_.Ae,this.J.bind(this)),this.f.on(this.m,_.xc,this.B.bind(this)),this.f.on(this.m,_.yc,this.C.bind(this)),this.f.on(this.m,_.zc,this.G.bind(this)),this.f.on(this.m,_.Kc,this.w.bind(this)))};b.prototype.unregisterListeners=
|
|
16
|
+
function(){_.zi(this.f)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.A=!0};b.prototype.U=function(c){this.g.debug(fx,c);this.j=c.adsTimeline};b.prototype.P=function(c){this.a=c.ad;this.h("ad start",this.a);this.fireStart();this.fireJoin()};b.prototype.I=function(){this.h("ad ended");this.fireStop()};b.prototype.K=function(){this.h("ad pause");this.w();this.firePause()};b.prototype.L=function(){this.h("ad resume");this.w();this.fireResume()};b.prototype.G=function(){this.l=
|
|
17
|
+
!0;this.h(dx);this.fireBufferBegin()};b.prototype.w=function(){this.l&&(this.h(cx),this.l=!1,this.fireBufferEnd())};b.prototype.o=function(c){this.h("ad quartile",c);this.fireQuartile(c)};b.prototype.H=function(){this.h("ad clicked");var c=this.a&&this.a.Ab();this.g.debug(ex,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(bx,this.a);this.fireBreakStart()};b.prototype.C=function(){this.h("ad break stop");this.fireBreakStop();
|
|
18
|
+
if(this.getPosition()===youbora.Constants.AdPosition.Postroll){var c=this.plugin.getAdapter();c&&c.fireStop()}};b.prototype.J=function(c){(c=c.detail)&&10003===c.code&&ox(c,this.m,this.g,this)};b.prototype.h=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.g.debug.apply(this.g,[Zw+c+Yw].concat(_.vh(e)))};return new b(a)},sx=function(){function a(){var b=NpawPluginAdapters.video.Shaka.call(this)||this;b.h=!1;b.f=!1;b.a=null;b.B=!1;return b}_.x(a,NpawPluginAdapters.video.Shaka);
|
|
19
|
+
a.prototype.getPlayhead=function(){return this.getIsLive()?-1:this.player.getPosition()};a.prototype.getDuration=function(){return this.player.getDuration()};a.prototype.getRendition=function(){var b=null,c=null,d=null,e=this.player.getTrackManager();e&&(e=e.na())&&(b=e.width,c=e.height,d=e.bandwidth);b&&c&&d||(e=this.j(),b=b||e.width,c=c||e.height,d=d||e.streamBandwidth);return this.getNpawUtils().buildRenditionString(b,c,d)};a.prototype.getIsLive=function(){return this.player.isLive()};a.prototype.getResource=
|
|
20
|
+
function(){var b=this.player.getLoadedSource();return b&&b.url};a.prototype.getBitrate=function(){return this.j().streamBandwidth};a.prototype.getThroughput=function(){return this.j().estimatedBandwidth};a.prototype.getPlayrate=function(){return this.player.getPlaybackRate()};a.prototype.getFramesPerSecond=function(){var b=this.player.getTrackManager();return b&&(b=b.Na())?b.frameRate:null};a.prototype.getPlayerName=function(){return _.xa};a.prototype.getVersion=function(){return"castlabs-adapter-6.25.0-js"};
|
|
21
|
+
a.prototype.getPlayerVersion=function(){return _.ia};a.prototype.registerListeners=function(){var b=this.w();this.player&&b&&(b.on(this.player,_.rg,this.K.bind(this)),b.on(this.player,_.Ae,this.H.bind(this)),b.on(this.player,_.jg,this.J.bind(this)),b.on(this.player,_.ig,this.I.bind(this)),b.on(this.player,_.Rc,this.C.bind(this)),b.on(this.player,_.ud,this.G.bind(this)))};a.prototype.unregisterListeners=function(){rx.debug(_.fc);_.zi(this.w())};a.prototype.dispose=function(){this.unregisterListeners();
|
|
22
|
+
this.B=!0;this.f=this.h=!1;this.a=null};a.prototype.j=function(){return this.player.getStats()||_.Gq()};a.prototype.o=function(){return!!this.player.getConfiguration().autoplay};a.prototype.K=function(b){b=b.detail;this.l("state change",b);if(b)switch(b.currentState){case _.Tq:this.o()&&this.fireStart();break;case _.Vq:this.fireStart();this.A();this.fireResume();this.fireBufferEnd();break;case _.Uq:this.o()&&this.fireStart();this.A();this.fireBufferEnd();this.firePause();break;case _.Hq:this.fireBufferEnd();
|
|
23
|
+
this.fireStop();break;case _.Oq:this.fireBufferEnd();this.h&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.Mq:this.fireBufferBegin();break;default:rx.debug($w,b)}};a.prototype.A=function(){this.fireJoin()};a.prototype.H=function(b){(b=b.detail)&&!this.f&&this.player&&10003!==b.code&&(b=ox(b,this.player,rx,this))&&b.severity===_.P&&(this.f=!0)};a.prototype.J=function(){this.player.isEnded()||(this.l(_.jg),this.fireSeekBegin())};a.prototype.w=function(){this.a||(this.a=new _.wi);
|
|
24
|
+
return this.a};a.prototype.I=function(){this.l(_.ig);this.fireSeekEnd()};a.prototype.C=function(b){rx.debug("adsTimeline",b);this.h=(b=b.adsTimeline)&&b.Rb()};a.prototype.G=function(b){rx.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];rx.debug.apply(rx,[Zw+b+Xw].concat(_.vh(d)))};return a},ux=function(){function a(){var b=NpawPluginAdapters.ads.Ima.call(this)||this;b.a=null;b.l=null;b.h=null;b.j=null;b.C=!1;b.o=!1;return b}
|
|
25
|
+
_.x(a,NpawPluginAdapters.ads.Ima);a.prototype.getDuration=function(){return this.a?this.a.getDuration():null};a.prototype.getRendition=function(){var b=null;this.a&&(b=this.getNpawUtils().buildRenditionString(this.a.qb(),this.a.pb(),this.a.Xa()));return b};a.prototype.getBitrate=function(){var b=null;this.a&&(b=this.a.Xa());return b};a.prototype.getPlayhead=function(){var b=null,c=this.player.getAdsManager();c&&(b=c.getPosition());return b};a.prototype.getResource=function(){var b=null;this.a&&(b=
|
|
26
|
+
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.C=!0;this.j=this.h=this.a=null};a.prototype.getPosition=function(){var b=this.getNpawReference().Constants.AdPosition,c=null;if(this.a)switch(this.a.Ya()){case 0:c=
|
|
27
|
+
b.Preroll;break;case 2:c=b.Postroll;break;case 1:c=b.Midroll}tx.debug("Ad position",c);return c};a.prototype.getIsSkippable=function(){return this.a&&-1!==this.a.getSkipTimeOffset()};a.prototype.getAudioEnabled=function(){var b=this.player.getAdsManager();return b&&0<b.getVolume()};a.prototype.getExpectedBreaks=function(){return this.h&&this.h.getCuePoints().length};a.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};a.prototype.getExpectedAds=function(){return this.a&&this.a.rb()};
|
|
28
|
+
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);tx.debug(kx,b);return b};a.prototype.getPlayerName=function(){return _.xa};a.prototype.getVersion=
|
|
29
|
+
function(){return"castlabs-ads-adapter-6.25.0-js"};a.prototype.getPlayerVersion=function(){return _.ia};a.prototype.B=function(){this.j||(this.j=new _.wi);return this.j};a.prototype.registerListeners=function(){var b=this.B();this.player&&b&&(b.on(this.player,_.Rc,this.ca.bind(this)),b.on(this.player,_.Nc,this.Y.bind(this)),b.on(this.player,_.Jc,this.M.bind(this)),b.on(this.player,_.Lc,this.P.bind(this)),b.on(this.player,_.Bc,this.K.bind(this)),b.on(this.player,_.Cc,this.w.bind(this,1)),b.on(this.player,
|
|
30
|
+
_.Ic,this.w.bind(this,2)),b.on(this.player,_.Pc,this.w.bind(this,3)),b.on(this.player,_.Ac,this.J.bind(this)),b.on(this.player,_.Mc,this.U.bind(this)),b.on(this.player,_.Ae,this.L.bind(this)),b.on(this.player,_.xc,this.G.bind(this)),b.on(this.player,_.yc,this.H.bind(this)),b.on(this.player,_.zc,this.I.bind(this)),b.on(this.player,_.Kc,this.da.bind(this)))};a.prototype.unregisterListeners=function(){_.zi(this.B())};a.prototype.ca=function(b){tx.debug(fx,b);this.h=b.adsTimeline};a.prototype.Y=function(b){this.a=
|
|
31
|
+
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(dx);this.fireBufferBegin()};a.prototype.da=function(){this.l=this.getPlayhead();this.A()};a.prototype.A=function(){this.o&&(this.f(cx),this.o=!1,this.fireBufferEnd())};a.prototype.w=
|
|
32
|
+
function(b){this.f("ad quartile",b);this.fireQuartile(b)};a.prototype.J=function(){this.f("ad clicked");var b=this.a&&this.a.Ab();tx.debug(ex,b);this.fireClick(b)};a.prototype.U=function(){this.f("ad skipped");this.fireSkip()};a.prototype.G=function(b){this.a=b.ad;this.f(bx,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&&this.fireStop({adPlayhead:this.l})};
|
|
33
|
+
a.prototype.L=function(b){(b=b.detail)&&10003===b.code&&ox(b,this.player,tx,this)};a.prototype.f=function(b,c){for(var d=[],e=1;e<arguments.length;++e)d[e-1]=arguments[e];tx.debug.apply(tx,[Zw+b+Xw].concat(_.vh(d)))};return a},vx=function(){this.a=null;this.g=new _.K(gx);this.m=null},wx=function(a,b){if(b.namespace()===_.Hd)return a.g.info("NPAW does not report when casting."),!1;var c=b.getConfiguration().youbora;return _.N.pg(c)?c.accountCode?_.N.R(window.NpawPlugin)||_.N.R(window.NpawPluginAdapters)?
|
|
34
|
+
(a.g.warn("NPAW SDK not found."),b.onError(new _.O(1,9,9100)),!1):!0:(a.g.warn(ax),b.onError(new _.O(1,9,9101)),!1):(a.g.warn("NPAW plugin is loaded but not configured. Will do nothing."),!1)},xx=function(a){a.a&&(a.g.info("Removing NPAW Plugins",a.a),a.a.removeAdsAdapter(),a.a.removeAdapter())},yx=function(){this.a=null;this.g=new _.K(hx);this.m=null},zx=function(a,b){if(b.namespace()===_.Hd)return a.g.info("Youbora does not report when casting."),!1;var c=b.getConfiguration().youbora;if(!_.N.pg(c))return a.g.debug("Youbora plugin is loaded but not configured. Will do nothing."),
|
|
35
|
+
!1;if(!c.accountCode)return a.g.warn(ax),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.")),b.onError(new _.O(1,9,9102)));return!0},Ax=function(){};var rx=new _.K("clpp.npaw.NpawAdapter");var tx=new _.K("clpp.npaw.NpawAdsAdapter");_.x(vx,_.gw);_.u=vx.prototype;_.u.Sg=function(a){xx(this);if(this.a=a)this.a.registerAdapterFromClass(this.m,sx()),this.a.registerAdsAdapterFromClass(this.m,ux())};_.u.gm=function(){return this.a};_.u.getAdapter=function(){return this.a&&this.a.getAdapter()};_.u.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.u.onPlayerCreated=function(a){this.m=a;wx(this,a)&&(a=a.getConfiguration().youbora,this.Sg(new NpawPlugin(a.accountCode)))};
|
|
36
|
+
_.u.onContentWillLoad=function(a,b){if(wx(this,a)){var c=a.getConfiguration(),d=c.youbora;void 0===d[ix]&&(d[ix]=b.isLive);void 0===d[jx]&&(d[jx]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.Sg(new NpawPlugin(d.accountCode));this.a.setAnalyticsOptions(d)}};_.u.onContentLoaded=function(a){var b={};(a=a.getDrmInfo())&&(a=mx(a.keySystem))&&(b["content.drm"]=a);this.g.info(_.jf,b);this.a.setAnalyticsOptions(b)};_.u.onPlayerWillRelease=function(){};
|
|
37
|
+
_.u.onPlayerWillDestroy=function(){xx(this);this.a.destroy()};_.u.id=function(){return lx};_.J(gx,vx);vx.prototype.getAdsAdapter=vx.prototype.getAdsAdapter;vx.prototype.getAdapter=vx.prototype.getAdapter;vx.prototype.getNpawPlugin=vx.prototype.gm;vx.prototype.setNpawPlugin=vx.prototype.Sg;vx.Id=lx;new _.K(gx);_.x(yx,_.gw);_.u=yx.prototype;_.u.Tg=function(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(px(this.m)),this.a.setAdsAdapter(qx(this.m))};_.u.getAdapter=function(){return this.a&&this.a.getAdapter()};_.u.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.u.onPlayerCreated=function(a){this.m=a;zx(this,a)&&(a=a.getConfiguration().youbora,this.Tg(new youbora.Plugin(a)))};
|
|
38
|
+
_.u.onContentWillLoad=function(a,b){if(zx(this,a)){var c=a.getConfiguration(),d=c.youbora;void 0===d[ix]&&(d[ix]=b.isLive);void 0===d[jx]&&(d[jx]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.Tg(new youbora.Plugin(d));this.a.setOptions(d)}};_.u.onPlayerWillRelease=function(){};_.u.onPlayerWillDestroy=function(){};_.u.id=function(){return lx};_.J(hx,yx);yx.prototype.getAdsAdapter=yx.prototype.getAdsAdapter;yx.prototype.getAdapter=yx.prototype.getAdapter;
|
|
39
|
+
yx.prototype.setYouboraPlugin=yx.prototype.Tg;yx.Id=lx;Ax.prototype.create=function(a){return a.youbora&&a.youbora.v7?new vx:new yx};_.cu(new Ax);};
|
|
40
40
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
41
41
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
42
42
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cl.adobe.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
|
|
3
|
-
(this.f.release(),this.f=null);this.m=null;this.a=""}id(){return"adobe"}};_.z("clpp.adobe.AdobeAnalyticsPlugin",
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var bY=function(a){a.f=new _.St;a.f.on(a.m,_.Cg,()=>$X(a));a.f.on(a.m,_.Bg,()=>{s.Media.play(a.a,a.m.getPosition())});a.f.on(a.m,_.Fe,()=>aY(a));a.f.on(a.m,_.$f,b=>{b=b.detail;switch(b.currentState){case _.kp:a.a.length||aY(a);s.Media.play(a.a,a.m.getPosition());break;case _.jp:case _.dp:$X(a);break;case _.$o:case _.hp:case _.ap:a.g.info(`Close session for ${a.a} `+`in player state ${b.currentState}.`),$X(a),s.Media.close(a.a),a.a=""}})},$X=function(a){s.Media.stop(a.a,a.m.getPosition())},
|
|
2
|
+
aY=function(a){{const b=a.m.getLoadedSource();a.a=b?b.name||b.url:""}a.g.info(`Open session for ${a.a} `+`with duration ${a.m.getDuration()}`);s.Media.open(a.a,a.m.getDuration(),_.qa)},cY=class extends _.Zv{constructor(){super();this.m=this.f=null;this.a="";this.g=new _.S("clpp.adobe.AdobePlugin")}onPlayerCreated(a){var b=a.getConfiguration().adobe;(b=!b||!1!==b.enabled)?window.s&&s.Media?(this.m=a,bY(this)):this.g.warn("Adobe API not available."):this.g.debug("Adobe plugin is disabled.")}onPlayerWillDestroy(){this.f&&
|
|
3
|
+
(this.f.release(),this.f=null);this.m=null;this.a=""}id(){return"adobe"}};_.z("clpp.adobe.AdobeAnalyticsPlugin",cY);cY.Id="adobe";_.Nr(new class{create(){return new cY}});};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 _.
|
|
3
|
-
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var ZX=class extends _.Zv{constructor(){super();this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.Mt(()=>{this.m.play().catch(()=>{})});this.h=new _.St}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 _.D(_.Ic,{canCast:this.f}))}A(){const a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.Hc:_.Gc;if(this.l||!this.m.isPaused()||this.m.getState()===_.kp)this.l?this.m.play().catch(()=>{}):this.o.ia(.01);this.m.trigger(new _.D(a))}Nb(){return this.j}qe(){return this.f}pi(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())}};_.z("clpp.airplay.AirPlayPlugin",ZX);ZX.prototype.showCastMenu=ZX.prototype.pi;
|
|
3
|
+
ZX.prototype.canCast=ZX.prototype.qe;ZX.prototype.isCasting=ZX.prototype.Nb;ZX.Id="airplay";_.Nr(new class{create(){return new ZX}});};f.call(g, window);
|
package/cl.broadpeak.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
a.a.attachPlayer(a.l)},
|
|
3
|
-
switch(d){case _.
|
|
4
|
-
this.f=new
|
|
5
|
-
_.z("clpp.broadpeak.BroadpeakPlugin",
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var SX=function(){return!window.SmartLib||!window.GenericPlayerApi},TX=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===_.cg&&a.h.setUUID(b))},VX=function(a,b){b=b.customParameters||{};a.a=a.h.createStreamingSession();a.a.setOption(StreamingSessionOptions.SESSION_PRECACHE,!0);for(const c in b)a.a.setCustomParameter(c,b[c]);a.o.on(a.m,_.q,a.w.bind(a));a.l=UX(a.m);
|
|
2
|
+
a.a.attachPlayer(a.l)},WX=function(a,b){_.Th(a.o);a.f&&(a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},XX=class{constructor(a,b){this.m=a;this.f=b;this.a=new _.St;this.h=!1}init(){const a=this.m,b=this.a;b.on(a,_.$f,this.o.bind(this));b.on(a,_.Zc,this.j.bind(this));b.on(a,"seek",this.l.bind(this))}j(a){a=a.detail;typeof a.bandwidth===_.t&&this.f.notifyLayerSwitch(a.bandwidth/1E3)}o(a){const b=this.m,c=this.f;a=a.detail;const d=a.currentState;a.previousState===_.dp&&c.notifyStallEnd(!b.isPaused());
|
|
3
|
+
switch(d){case _.dp:c.notifyStallStart();break;case _.kp:this.h?c.notifyResume():(c.notifyFirstImage(),this.h=!0);break;case _.jp:c.notifyPause()}}l(){const a=1E3*this.m.getPosition();this.f.notifySeek(a)}release(){this.a&&(_.Th(this.a),this.a=null)}};var UX=a=>{class b extends GenericPlayerApi{constructor(c){super();this.m=c;this.a=_.il()}getPlayerName(){return _.qa}getVersion(){return _.ea}getOSName(){return this.a.os}getDeviceVersion(){return this.a.osVersion.name}getDeviceType(){return"browser"}getTotalDuration(){return this.m.isLive()?0:1E3*this.m.getDuration()}getCurrentPosition(){return 1E3*this.m.getPosition()}getCurrentBitrate(){const c=this.m.getStats();return(c?c.streamBandwidth:0)/1E3}}return new b(a)};var YX=class extends _.Zv{constructor(){super();this.l=this.f=this.a=this.h=this.m=null;this.o=new _.St;this.j=!1}onPlayerCreated(a){this.m=a}onContentWillLoad(a,b){const c=a.getConfiguration().broadpeak;if(c){if(SX())return a.onError(new _.I(1,9,11E3));this.j=!0;TX(this,c);VX(this,c);return this.a.getURL(b.url).then(d=>{if(d.isError()){const e=d.getDetailedErrorCode();d=d.getDetailedErrorMessage();this.m.onError(new _.I(1,9,11001,{bpkErrorCode:e,message:d}));WX(this,void 0)}else b.url=d.getURL(),
|
|
4
|
+
this.f=new XX(this.m,this.l),this.f.init()})}}onContentLoaded(){!1!==this.j&&this.a.precacheEnded()}w(a){a=a.detail;if(7003===a.code)WX(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.F)switch(a.category){case 3:WX(this,SmartLib.BPDecodingError);break;case 1:WX(this,SmartLib.BPNetworkingError);break;case 6:WX(this,SmartLib.BPAccessRightError);break;default:WX(this,SmartLib.BPUnspecifiedError)}}onPlayerWillRelease(){SX()||WX(this,SmartLib.BPSessionEndsNormally);this.j=!1}id(){return"broadpeak"}};
|
|
5
|
+
_.z("clpp.broadpeak.BroadpeakPlugin",YX);YX.isSdkMissing=SX;YX.Id="broadpeak";_.Nr(new class{create(){return new YX}});};f.call(g, window);
|