@castlabs/prestoplay 6.17.1 → 6.18.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 +30 -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 +111 -111
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +566 -558
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +75 -74
- package/cjs/cl.externs.js +46 -46
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +71 -69
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +29 -29
- package/cjs/cl.ima.js +23 -23
- package/cjs/cl.mse.js +311 -311
- package/cjs/cl.muxdata.js +15 -15
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +14 -14
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.sessions.js +15 -15
- 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 +69 -69
- package/cjs/cl.ttml.js +28 -28
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +13 -13
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.youbora.js +18 -18
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +87 -87
- package/cl.conviva.js +27 -27
- package/cl.core.js +456 -450
- package/cl.crypto.js +8 -8
- package/cl.dash.js +70 -69
- package/cl.externs.js +46 -46
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +72 -72
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +17 -17
- package/cl.mse.js +274 -273
- 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 +59 -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 +15 -15
- package/cl.vtt.js +12 -12
- package/cl.youbora.js +15 -15
- package/package.json +2 -2
- package/typings.d.ts +37 -3
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.ea=this.H=this.f=this.a=this.m=null;this.g=new _.K("clpp.vr");this.I=70;this.aa=1;this.
|
|
11
|
-
this.D=this.
|
|
12
|
-
_.t.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&&_.
|
|
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
|
-
_.t.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
|
-
_.t.
|
|
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 pw="touchmove",qw="touchstart",rw=function(a,b,c,d){this.x=a||0;this.y=b||0;this.a=c||0;this.f=d||1},sw=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)},tw=function(a,b,c){c*=.5;var d=Math.sqrt(a*a+b*b),e=Math.sin(c);return new rw(a/d*e,b/d*e,0/d*e,Math.cos(c))},uw=function(a,b,c){this.x=a||0;this.y=b||0;this.a=c||0},vw=function(a,b){isFinite(b)?(a.x*=b,a.y*=b,a.a*=
|
|
3
|
+
b):(a.x=0,a.y=0,a.a=0)},ww=function(a,b){return a.x*b.x+a.y*b.y+a.a*b.a},xw=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},yw=function(){this.a=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])},zw=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},Aw=function(a){var b=new uw(0,0,0),c=new uw(0,0,1),d=new uw,e=new uw,f=new uw;a=a.a;var g=new uw(0,1,0);f.x=b.x-g.x;f.y=b.y-g.y;f.a=b.a-g.a;g=f.length();vw(f,1/g);c=xw(d,c,f);g=c.length();vw(c,1/g);xw(e,f,d);a[0]=d.x;a[1]=d.y;a[2]=d.a;a[3]=-ww(d,b);a[4]=e.x;a[5]=e.y;a[6]=e.a;a[7]=-ww(e,b);a[8]=f.x;a[9]=f.y;a[10]=f.a;a[11]=-ww(f,b);a[12]=0;a[13]=0;a[14]=0;a[15]=1},Cw=function(a){this.a=a;this.f=a.createProgram();this.l=
|
|
5
|
+
Bw(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=Bw(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 _.N(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)},Bw=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 _.N(1,
|
|
7
|
+
9,9004,"Unable to compile GL shader: "+a.a.getShaderInfoLog(b));return b},Dw=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)},Ew=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)},Fw=function(){var a=this;this.o=this.w=this.L=this.J=this.A=
|
|
10
|
+
this.ea=this.H=this.f=this.a=this.m=null;this.g=new _.K("clpp.vr");this.I=70;this.aa=1;this.R=this.N=!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.V=new yw;this.$=new yw;this.fa=new yw;this.ja=new yw;this.B=this.pm.bind(this);
|
|
11
|
+
this.D=this.qm.bind(this);this.K=this.om.bind(this)},Gw=function(a){var b=tw(1,0,a.l*Math.PI/180);sw(tw(0,1,a.j*Math.PI/180),a.V);sw(b,a.$);Aw(a.fa);zw(a.ja,a.V,a.fa);zw(a.H,a.$,a.ja)},Hw=function(a){a.a&&(a.a.removeEventListener("mousemove",a.B,!1),a.a.removeEventListener(pw,a.B,!1),a.a.removeEventListener("mouseup",a.D,!1),a.a.removeEventListener("touchend",a.D,!1))},Iw=function(){};uw.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.a*this.a)};yw.prototype.set=function(a,b,c,d,e,f,g,h,l,m,n,p,q,u,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]=u;A[11]=v;A[15]=z;return this};var Jw={alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!1,devicePixelRatio:1};_.x(Fw,_.Gu);_.t=Fw.prototype;_.t.onPlayerCreated=function(a){this.g.info("Player created");this.m=a};
|
|
12
|
+
_.t.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&&_.M.sa(d))this.I=d;else throw new _.N(1,7,7100,"fieldOfView configuration must be a number");if(void 0!==e&&_.M.sa(e)&&0<e)this.aa=e;else throw new _.N(1,7,7100,"sensitivity configuration must be a positive number");this.N=!!f;this.R=!!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",Jw)||this.a.getContext("experimental-webgl",Jw);if(!this.f)throw new _.N(1,9,9003,"Unable to create GL context");this.H=new yw;Aw(this.H);this.ea=new Dw(this.f);this.A=new Cw(this.f);this.J=new yw;this.L=new yw;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(qw,this.K,!1));this.G();this.ni()}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
|
+
_.t.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&&(Hw(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)};_.t.onPlayerWillDestroy=function(){var a=this;return _.I(function(b){a.m=null;_.B(b)})};_.t.id=function(){return"vr"};
|
|
16
|
+
_.t.ni=function(){if(this.m&&this.f){var a=this.m.getSurface();if(a&&(a=a.getMedia())&&a.tagName.toLowerCase()===_.r){this.w=requestAnimationFrame(this.ni.bind(this));var b=this.f;this.o||a.readyState!==a.HAVE_ENOUGH_DATA||(this.o=new Ew(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=zw(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.ea;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
|
-
_.t.
|
|
20
|
-
_.t.
|
|
21
|
-
_.t.
|
|
19
|
+
_.t.om=function(a){this.g.debug("Mouse Down. Enable VR mouse interaction");a.preventDefault();if(0===a.button||a.type===qw)a.type===qw?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(pw,this.B,!1),this.a.addEventListener("mouseup",this.D,!1),this.a.addEventListener("touchend",this.D,!1)};
|
|
20
|
+
_.t.pm=function(a){a.preventDefault();var b=a.clientX,c=a.clientY;a.type===pw&&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.aa;c=d*b*(this.R?-1:1);this.j+=a*b*(this.N?-1:1);this.l+=c;Gw(this)};_.t.qm=function(a){this.g.debug("Mouse Up. Removing mouse interaction listeners");a.preventDefault();Hw(this)};_.t.Il=function(a,b){this.l=b;this.j=a;Gw(this)};_.t.Ok=function(){return{x:this.j,y:this.l}};
|
|
21
|
+
_.t.cn=function(a){this.I=a;this.G()};_.J("clpp.vr.VrPlugin",Fw);Fw.prototype.setCameraFieldOfView=Fw.prototype.cn;Fw.prototype.getCameraCoordinates=Fw.prototype.Ok;Fw.prototype.moveCamera=Fw.prototype.Il;Fw.Id="vr";Iw.prototype.create=function(){return new Fw};_.br(new Iw);};
|
|
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
|
-
|
|
15
|
-
|
|
2
|
+
var f=function(window){var Wv=" The setting will be ignored.",Xv="VTT parser encountered an invalid VTT setting: ",Yv="application/x-subrip",Zv="text/srt",$v='text/vtt; codecs\x3d"vtt"',aw='text/vtt; codecs\x3d"wvtt"',bw=function(a){_.Gj(a,/[ \t]+/gm)},cw=function(a){return a.a===a.f.length?null:(a=_.Gj(a,/[^ \t\n]*/gm))?a[0]:null},dw=function(){},ew=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},fw=function(){},gw=function(a){this.a=a},iw=function(a,b,c){var d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"===b?a.textAlign=_.si:a.textAlign=
|
|
4
|
+
_.Mu[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"===d[1]?_.Jg:_.Kg;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===_.Ie||b===_.ig?_.Ie:b===_.Je||b===_.re?_.Je:_.wd);else if(d=/^region:(.*)$/.exec(b)){if(b=hw(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=_.Nu[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.ui,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.Nu[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},hw=function(a,b){var c=a.filter(function(d){return d.id===b});return c.length?c[0]:(_.Ih("VTT parser could not find a region with id: ",b," The region will be ignored."),null)},jw=function(a){a=_.Gj(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)},kw=function(){gw.apply(this,arguments)},lw=function(){this.a=null;this.g=new _.K("clpp.vtt.mp4")},nw=function(a,b,c){var d,e,f;(new _.Rm).M("payl",_.Um(function(g){d=_.S.ba(g)})).M("iden",_.Um(function(g){e=_.S.ba(g)})).M("sttg",_.Um(function(g){f=_.S.ba(g)})).parse(a);return d?mw(d,e,f,b,c):null},mw=function(a,b,c,d,e){a=new _.xi(d,e,a,_.Rg);b&&(a.id=b);if(c)for(b=new _.Fj(c),c=
|
|
7
|
+
cw(b);c;)iw(a,c,[])||_.Ih(Xv,c,Wv),bw(b),c=cw(b);return a},ow=function(){this.j=new fw};dw.prototype.a=function(a){a=_.S.ba(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+=ew(c.value)}return _.S.Wa(a)};fw.prototype.create=function(){return new dw};fw.prototype.probe=function(a,b){return(a===Zv||a===Yv)&&b===_.sg};gw.prototype.parseInit=function(){};
|
|
8
|
+
gw.prototype.parseMedia=function(a,b){var c=_.S.ba(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 _.N(_.O,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=jw(new _.Fj(e[1]));if(null==c)throw new _.N(_.O,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 _.Fj(h.replace(/\n/g," "));g=new _.Ai;cw(h);bw(h);for(var l=cw(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||_.Ih("VTT parser encountered an invalid VTTRegion setting: ",l,Wv);bw(h);l=cw(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 _.Fj(p[0]);m=jw(l);var u=_.Gj(l,/[ \t]+--\x3e[ \t]+/g);n=jw(l);if(null==m||null==u||null==n)throw new _.N(_.O,2,2001);m+=q;n+=q;p=p.slice(1).join("\n").trim();m=new _.xi(m,n,p,_.Rg);g&&(m.id=g);bw(l);for(n=cw(l);n;)iw(m,n,f)||_.Ih(Xv,
|
|
12
|
+
n,Wv),bw(l),n=cw(l);null!=g&&(m.id=g);g=m}g&&h.push(g)}return{cues:h,styles:e}};_.x(kw,gw);kw.prototype.parseMedia=function(a,b){return gw.prototype.parseMedia.call(this,(new dw).a(a),b)};lw.prototype.parseInit=function(a){var b=this,c=!1;(new _.Rm).M(_.We,_.Sm).M(_.vg,_.Sm).M(_.Re,_.Sm).Y("mdhd",function(d){0===d.version?(d.reader.skip(4),d.reader.skip(4),b.a=_.W(d.reader),d.reader.skip(4)):(d.reader.skip(8),d.reader.skip(8),b.a=_.W(d.reader),d.reader.skip(8));d.reader.skip(4)}).M(_.Ve,_.Sm).M(_.lg,_.Sm).Y(_.ng,_.Tm).M("wvtt",function(){c=!0}).parse(a);if(!this.a)throw new _.N(_.O,2,2008);if(!c)throw new _.N(_.O,2,2008);};
|
|
13
|
+
lw.prototype.parseMedia=function(a,b){if(!this.a)throw this.g.error("No init segment for MP4+VTT!"),new _.N(_.O,2,2008);var c=0,d=[],e,f=[],g=!1,h=!1,l=!1,m=null;(new _.Rm).M("moof",_.Sm).M("traf",_.Sm).Y("tfdt",function(H){g=!0;c=0===H.version?_.W(H.reader):_.Om(H.reader)}).Y("tfhd",function(H){var Q=H.flags;H=H.reader;H.skip(4);Q&1&&H.skip(8);Q&2&&H.skip(4);m=Q&8?_.W(H):null}).Y("trun",function(H){h=!0;var Q=H.version,R=H.flags;H=H.reader;var na=_.W(H);R&1&&H.skip(4);R&4&&H.skip(4);for(var da=[],
|
|
14
|
+
Ba=0;Ba<na;Ba++){var ab={duration:null,sampleSize:null,og:null};R&256&&(ab.duration=_.W(H));R&512&&(ab.sampleSize=_.W(H));R&1024&&H.skip(4);R&2048&&(ab.og=0===Q?_.W(H):_.Nm(H));da.push(ab)}d=da}).M(_.Qe,_.Um(function(H){l=!0;e=H})).parse(a);if(!l&&!g&&!h)throw new _.N(_.O,2,2008);var n=c,p=new DataView(e.buffer,e.byteOffset,e.byteLength);p=new _.Im(p,!1);for(var q=_.w(d),u=q.next();!u.done;u=q.next()){u=u.value;var v=u.duration||m,z=u.og?c+u.og:n;n=z+(v||0);var A=0;do{var G=_.W(p);A+=G;var F=_.W(p);
|
|
15
|
+
F=_.Wm(F);var C=null;"vttc"===F?8<G&&(C=_.Qm(p,G-8)):("vtte"!==F&&this.g.error("Unknown box "+F+"! Skipping!"),p.skip(G-8));v?C&&f.push(nw(C,b.periodStart+z/this.a,b.periodStart+n/this.a)):this.g.error("WVTT sample duration unknown, and no default found!")}while(u.sampleSize&&A<u.sampleSize)}return{cues:f.filter(_.Gi),styles:[]}};_.x(ow,_.Ts);ow.prototype.f=function(){_.tu(_.sg,gw);_.tu($v,gw);_.tu(aw,gw);_.tu(_.Zc,lw);_.tu(Zv,kw);_.tu(Yv,kw);_.Kk.push(this.j)};ow.prototype.a=function(){_.vu(_.sg);_.vu($v);_.vu(aw);_.vu(_.Zc);_.vu(Zv);_.vu(Yv);_.Mk(this.j)};ow.prototype.id=function(){return"subtitles-vtt"};_.J("clpp.vtt.VttComponent",ow);};
|
|
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.youbora.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
b)):(d.fireError(b.code,b.message,b.metadata),c.debug(
|
|
2
|
+
var f=function(window){var Lv='" event to Youbora',Mv='Reporting "',Nv="clpp.npaw.YouboraPlugin",Ov="content.isLive",Pv=function(a){return(a=a.getConfiguration().youbora)&&a.errorFilter?a.errorFilter:function(b){return{code:""+b.code,message:b.message,severity:b.severity}}},Qv=function(a,b,c,d){b=Pv(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===a.code?"ad error":_.te;b.severity===_.O?(d.fireFatalError(b.code,b.message,b.metadata),c.debug('Reporting "fatal '+a+'" to Youbora',b.code,
|
|
3
|
+
b)):(d.fireError(b.code,b.message,b.metadata),c.debug(Mv+a+'" to Youbora',b.code,b));return b},Rv=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.m=c;d.a=new _.Xh;d.g=new _.K("clpp.npaw.YouboraAdapter");d.w=!1;d.h=!1;d.registerListeners();d.B=!1;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();
|
|
4
4
|
if(c&&(c=c.na())){var d=c.width;var e=c.height;var f=c.bandwidth}d&&e&&f||(c=this.l(),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.l().streamBandwidth};b.prototype.getThroughput=function(){return this.l().estimatedBandwidth};b.prototype.getPlayrate=function(){return this.m.getPlaybackRate()};
|
|
5
|
-
b.prototype.getFramesPerSecond=function(){var c=this.m.getTrackManager();return c&&(c=c.
|
|
6
|
-
_.
|
|
7
|
-
if(c)switch(c.currentState){case _.
|
|
8
|
-
(this.h=!1,this.fireInit())};b.prototype.A=function(){var c=this.m.getDrmInfo();c&&(c=c.keySystem,(c=c.startsWith(_.
|
|
9
|
-
b.prototype.J=function(){this.m.isEnded()||(this.j(_.
|
|
10
|
-
youbora.Adapter.call(this,c)||this;d.m=c;d.a=null;d.j=null;d.f=new _.
|
|
11
|
-
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&&this.a.getCreativeId()};b.prototype.getPosition=function(){var c=youbora.Constants.AdPosition,d=null;if(this.a)switch(this.a.
|
|
12
|
-
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.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.
|
|
13
|
-
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);this.g.debug("is container visible",c);return c};b.prototype.getPlayerName=function(){return _.
|
|
14
|
-
function(){return _.
|
|
15
|
-
_.
|
|
5
|
+
b.prototype.getFramesPerSecond=function(){var c=this.m.getTrackManager();return c&&(c=c.Ka())?c.frameRate:null};b.prototype.getPlayerName=function(){return _.wa};b.prototype.getVersion=function(){return"6.18.0-castlabsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ja};b.prototype.registerListeners=function(){this.m&&this.a&&(this.g.debug("registering listeners"),youbora.Util.logAllEvents(this.m),this.a.on(this.m,_.jg,this.K.bind(this)),this.a.on(this.m,_.te,this.H.bind(this)),this.a.on(this.m,
|
|
6
|
+
_.Gg,this.J.bind(this)),this.a.on(this.m,_.Dg,this.I.bind(this)),this.a.on(this.m,_.Qc,this.D.bind(this)),this.a.on(this.m,_.sd,this.G.bind(this)))};b.prototype.unregisterListeners=function(){this.g.debug(_.kc);_.$h(this.a)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.B=!0};b.prototype.l=function(){return this.m.getStats()||_.jp()};b.prototype.o=function(){return!!this.m.getConfiguration().autoplay};b.prototype.K=function(c){c=c.detail;this.j("state change",c);
|
|
7
|
+
if(c)switch(c.currentState){case _.zp:this.o()&&this.f();break;case _.Bp:this.f();this.A();this.fireResume();this.fireBufferEnd();break;case _.Ap:this.o()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.np:this.fireBufferEnd();this.fireStop();break;case _.up:this.fireBufferEnd();this.w&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.sp:this.fireBufferBegin();break;default:this.g.debug("Unhandled state",c)}};b.prototype.f=function(){this.plugin.isInitiated||
|
|
8
|
+
(this.h=!1,this.fireInit())};b.prototype.A=function(){var c=this.m.getDrmInfo();c&&(c=c.keySystem,(c=c.startsWith(_.Vd)?"Widevine":c.startsWith(_.Rd)?"FairPlay":c.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":c.startsWith(_.hf)?"ClearKey":c.startsWith(_.Qd)?"Primetime":c)&&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=Qv(c,this.m,this.g,this))&&c.severity===_.O&&(this.h=!0)};
|
|
9
|
+
b.prototype.J=function(){this.m.isEnded()||(this.j(_.bg),this.f(),this.fireSeekBegin())};b.prototype.I=function(){this.j(_.ag);this.fireSeekEnd()};b.prototype.D=function(c){this.g.debug("adsTimeline",c);c=c.adsTimeline;this.w=!!c&&c.sb()};b.prototype.G=function(c){this.g.debug("Casting",c);this.fireCasted()};b.prototype.j=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.g.debug.apply(this.g,[Mv+c+Lv].concat(_.fh(e)))};return new b(a)},Sv=function(a){function b(c){var d=
|
|
10
|
+
youbora.Adapter.call(this,c)||this;d.m=c;d.a=null;d.j=null;d.f=new _.Xh;d.g=new _.K("clpp.npaw.YouboraAdsAdapter");d.registerListeners();d.A=!1;d.l=!1;return d}_.x(b,youbora.Adapter);b.prototype.getDuration=function(){return this.a&&this.a.getDuration()};b.prototype.getRendition=function(){var c=null;this.a&&(c=youbora.Util.buildRenditionString(this.a.Gb(),this.a.Fb(),this.a.qb()));return c};b.prototype.getBitrate=function(){return this.a&&this.a.qb()};b.prototype.getPlayhead=function(){var c=this.m.getAdsManager();
|
|
11
|
+
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&&this.a.getCreativeId()};b.prototype.getPosition=function(){var c=youbora.Constants.AdPosition,d=null;if(this.a)switch(this.a.gb()){case 0:d=c.Preroll;break;case 2:d=c.Postroll;break;case 1:d=c.Midroll}this.g.debug("Ad position",
|
|
12
|
+
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.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.Ib()};b.prototype.getGivenAds=function(){return this.getExpectedAds()};b.prototype.getBreaksTime=
|
|
13
|
+
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);this.g.debug("is container visible",c);return c};b.prototype.getPlayerName=function(){return _.wa};b.prototype.getVersion=function(){return"6.18.0-castlabsadsadapter-js"};b.prototype.getPlayerVersion=
|
|
14
|
+
function(){return _.ja};b.prototype.registerListeners=function(){this.m&&this.f&&(this.f.on(this.m,_.Qc,this.V.bind(this)),this.f.on(this.m,_.Mc,this.R.bind(this)),this.f.on(this.m,_.Ic,this.K.bind(this)),this.f.on(this.m,_.Kc,this.L.bind(this)),this.f.on(this.m,_.Dc,this.I.bind(this)),this.f.on(this.m,_.Ec,this.o.bind(this,1)),this.f.on(this.m,_.Hc,this.o.bind(this,2)),this.f.on(this.m,_.Oc,this.o.bind(this,3)),this.f.on(this.m,_.Cc,this.H.bind(this)),this.f.on(this.m,_.Lc,this.N.bind(this)),this.f.on(this.m,
|
|
15
|
+
_.te,this.J.bind(this)),this.f.on(this.m,_.zc,this.B.bind(this)),this.f.on(this.m,_.Ac,this.D.bind(this)),this.f.on(this.m,_.Bc,this.G.bind(this)),this.f.on(this.m,_.Jc,this.w.bind(this)))};b.prototype.unregisterListeners=function(){_.$h(this.f)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.A=!0};b.prototype.V=function(c){this.g.debug("ad timeline changed",c);this.j=c.adsTimeline};b.prototype.R=function(c){this.a=c.ad;this.h("ad start",this.a);this.fireStart();
|
|
16
16
|
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("ad buffering started");this.fireBufferBegin()};b.prototype.w=function(){this.l&&(this.h("ad buffering ended"),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");
|
|
17
|
-
var c=this.a&&this.a.
|
|
18
|
-
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,[
|
|
19
|
-
b.onError(new _.
|
|
20
|
-
_.t.onContentWillLoad=function(a,b){if(
|
|
21
|
-
|
|
17
|
+
var c=this.a&&this.a.Wb();this.g.debug("ad click through url: ",c);this.fireClick(c)};b.prototype.N=function(){this.h("ad skipped");this.fireSkip()};b.prototype.B=function(c){this.a=c.ad;this.h("ad break start",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();c&&c.fireStop()}};b.prototype.J=function(c){(c=c.detail)&&10003===c.code&&Qv(c,this.m,this.g,this)};
|
|
18
|
+
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,[Mv+c+Lv].concat(_.fh(e)))};return new b(a)},Tv=function(){this.a=null;this.g=new _.K(Nv);this.m=null},Uv=function(a,b){if(b.namespace()===_.Hd)return a.g.info("Youbora does not report when casting."),!1;var c=b.getConfiguration().youbora;if(!_.M.Ih(c))return a.g.warn("Youbora plugin is loaded but not configured. Will do nothing."),!1;if(!c.accountCode)return a.g.warn("accountCode key is missing in Youbora config"),
|
|
19
|
+
b.onError(new _.N(1,9,9101)),!1;if(_.M.S(window.youbora))return a.g.warn("Youbora SDK not found."),b.onError(new _.N(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 _.N(1,9,9102)));return!0},Vv=function(){};_.x(Tv,_.Gu);_.t=Tv.prototype;_.t.ig=function(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(Rv(this.m)),this.a.setAdsAdapter(Sv(this.m))};_.t.getAdapter=function(){return this.a&&this.a.getAdapter()};_.t.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.t.onPlayerCreated=function(a){this.m=a;Uv(this,a)&&(a=a.getConfiguration().youbora,this.ig(new youbora.Plugin(a)))};
|
|
20
|
+
_.t.onContentWillLoad=function(a,b){if(Uv(this,a)){var c=a.getConfiguration(),d=c.youbora;void 0===d[Ov]&&(d[Ov]=b.isLive);void 0===d["content.title"]&&(d["content.title"]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.ig(new youbora.Plugin(d));this.a.setOptions(d)}};_.t.onPlayerWillRelease=function(){};_.t.onPlayerWillDestroy=function(){};_.t.id=function(){return"youbora"};_.J(Nv,Tv);Tv.prototype.getAdsAdapter=Tv.prototype.getAdsAdapter;Tv.prototype.getAdapter=Tv.prototype.getAdapter;
|
|
21
|
+
Tv.prototype.setYouboraPlugin=Tv.prototype.ig;Tv.Id="youbora";Vv.prototype.create=function(){return new Tv};_.br(new Vv);};
|
|
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/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
|
-
_.z("clpp.adobe.AdobeAnalyticsPlugin",
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var IU=function(a){a.f=new _.ts;a.f.on(a.m,_.gg,()=>GU(a));a.f.on(a.m,_.fg,()=>{s.Media.play(a.a,a.m.getPosition())});a.f.on(a.m,_.se,()=>HU(a));a.f.on(a.m,_.Nf,b=>{b=b.detail;switch(b.currentState){case _.Zn:a.a.length||HU(a);s.Media.play(a.a,a.m.getPosition());break;case _.Yn:case _.Rn:GU(a);break;case _.On:case _.Wn:case _.Vn:a.g.info(`Close session for ${a.a} `+`in player state ${b.currentState}.`),GU(a),s.Media.close(a.a),a.a=""}})},GU=function(a){s.Media.stop(a.a,a.m.getPosition())},
|
|
2
|
+
HU=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(),_.ra)},JU=class extends _.Au{constructor(){super();this.m=this.f=null;this.a="";this.g=new _.R("clpp.adobe.AdobePlugin")}onPlayerCreated(a){window.s&&s.Media?(this.m=a,IU(this)):this.g.warn("Adobe API not available.")}onPlayerWillDestroy(){this.f&&(this.f.release(),this.f=null);this.m=null;this.a=""}id(){return"adobe"}};
|
|
3
|
+
_.z("clpp.adobe.AdobeAnalyticsPlugin",JU);JU.Id="adobe";_.dp(new class{create(){return new JU}});};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 _.E(_.
|
|
3
|
-
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var FU=class extends _.Au{constructor(){super();this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.bt(()=>{this.m.play().catch(()=>{})});this.h=new _.ts}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 _.E(_.xc,{canCast:this.f}))}A(){const a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.wc:_.vc;if(this.l||!this.m.isPaused()||this.m.getState()===_.Zn)this.l?this.m.play().catch(()=>{}):this.o.ha(.01);this.m.trigger(new _.E(a))}ub(){return this.j}Ud(){return this.f}th(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())}};_.z("clpp.airplay.AirPlayPlugin",FU);FU.prototype.showCastMenu=FU.prototype.th;
|
|
3
|
+
FU.prototype.canCast=FU.prototype.Ud;FU.prototype.isCasting=FU.prototype.ub;FU.Id="airplay";_.dp(new class{create(){return new FU}});};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 yU=function(){return!window.SmartLib||!window.GenericPlayerApi},zU=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===_.Qf&&a.h.setUUID(b))},BU=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,_.r,a.U.bind(a));a.l=AU(a.m);
|
|
2
|
+
a.a.attachPlayer(a.l)},CU=function(a,b){_.ph(a.o);a.f&&(a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},DU=class{constructor(a,b){this.m=a;this.f=b;this.a=new _.ts;this.h=!1}init(){const a=this.m,b=this.a;b.on(a,_.Nf,this.o.bind(this));b.on(a,_.Nc,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===_.Rn&&c.notifyStallEnd(!b.isPaused());
|
|
3
|
+
switch(d){case _.Rn:c.notifyStallStart();break;case _.Zn:this.h?c.notifyResume():(c.notifyFirstImage(),this.h=!0);break;case _.Yn:c.notifyPause()}}l(){const a=1E3*this.m.getPosition();this.f.notifySeek(a)}release(){this.a&&(_.ph(this.a),this.a=null)}};var AU=a=>{class b extends GenericPlayerApi{constructor(c){super();this.m=c;this.a=_.vk()}getPlayerName(){return _.ra}getVersion(){return _.fa}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 EU=class extends _.Au{constructor(){super();this.l=this.f=this.a=this.h=this.m=null;this.o=new _.ts;this.j=!1}onPlayerCreated(a){this.m=a}onContentWillLoad(a,b){const c=a.getConfiguration().broadpeak;if(c){if(yU())return a.onError(new _.H(1,9,11E3));this.j=!0;zU(this,c);BU(this,c);return this.a.getURL(b.url).then(d=>{if(d.isError()){const e=d.getDetailedErrorCode();d=d.getDetailedErrorMessage();this.m.onError(new _.H(1,9,11001,{bpkErrorCode:e,message:d}));CU(this,void 0)}else b.url=d.getURL(),
|
|
4
|
+
this.f=new DU(this.m,this.l),this.f.init()})}}onContentLoaded(){!1!==this.j&&this.a.precacheEnded()}U(a){a=a.detail;if(7003===a.code)CU(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.F)switch(a.category){case 3:CU(this,SmartLib.BPDecodingError);break;case 1:CU(this,SmartLib.BPNetworkingError);break;case 6:CU(this,SmartLib.BPAccessRightError);break;default:CU(this,SmartLib.BPUnspecifiedError)}}onPlayerWillRelease(){yU()||CU(this,SmartLib.BPSessionEndsNormally);this.j=!1}id(){return"broadpeak"}};
|
|
5
|
+
_.z("clpp.broadpeak.BroadpeakPlugin",EU);EU.isSdkMissing=yU;EU.Id="broadpeak";_.dp(new class{create(){return new EU}});};f.call(g, window);
|