@castlabs/prestoplay 6.28.0 → 6.30.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 +37 -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 +128 -116
- package/cjs/cl.conviva.js +32 -32
- package/cjs/cl.core.js +619 -614
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +92 -89
- package/cjs/cl.externs.js +154 -60
- package/cjs/cl.freewheel.js +25 -25
- package/cjs/cl.hls.js +77 -77
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +25 -23
- package/cjs/cl.mediatailor.js +3 -3
- package/cjs/cl.mse.js +350 -349
- package/cjs/cl.muxdata.js +14 -14
- package/cjs/cl.onboard.js +4 -4
- package/cjs/cl.persistent.js +15 -15
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.simid.js +16 -16
- package/cjs/cl.smooth.js +57 -58
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +60 -60
- 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 +38 -38
- package/cjs/polyfill.min.js +2 -2
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +6 -6
- package/cl.cast.js +101 -92
- package/cl.conviva.js +27 -27
- package/cl.core.js +500 -496
- package/cl.crypto.js +9 -9
- package/cl.dash.js +84 -83
- package/cl.externs.js +150 -60
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +82 -80
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +19 -17
- package/cl.mediatailor.js +2 -2
- package/cl.mse.js +304 -305
- package/cl.muxdata.js +13 -13
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +11 -11
- package/cl.playlist.js +5 -5
- package/cl.simid.js +14 -14
- package/cl.smooth.js +60 -60
- package/cl.thumbnails.js +19 -19
- package/cl.tizen.js +56 -56
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -8
- package/cl.vr.js +14 -14
- package/cl.vtt.js +12 -12
- package/cl.yospace.js +3 -3
- package/cl.youbora.js +31 -31
- package/package.json +1 -1
- package/typings.d.ts +198 -88
package/cjs/cl.vimond.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
b){a.m.trigger(new _.Q(_.
|
|
4
|
-
|
|
5
|
-
_.r.
|
|
6
|
-
_.r.
|
|
7
|
-
b.B=e;return _.x(h,b.
|
|
8
|
-
_.r.
|
|
9
|
-
b[0]||"";a.client.playerState=b[1]||"";a.progress.vod&&(a.progress.vod.position=this.a.getPosition());if(b=a.progress.live){c=this.a;var d=c.m.getPresentationStartTime()||0;c=Math.floor(d+c.m.getPosition());c=(new Date(1E3*c)).toISOString();b.position=c;d=this.a;c=d.m.getPosition();d=d.m.getSeekRange().end;b.onLiveEdge=30>Math.abs(d-c);typeof b.liveResumePossible!==_.
|
|
10
|
-
b.method=_.
|
|
11
|
-
_.r.onContentWillLoad=function(a){var b=a.getConfiguration();(this.a=!_.M.R(b.vimond)&&typeof b.vimond===_
|
|
12
|
-
c=b.failIfUnreachable;typeof c!==_.
|
|
13
|
-
_.r.
|
|
2
|
+
var f=function(window){var dy="Registering listeners",ey="clpp.vimond.VimondPlugin",fy=function(a,b,c,d,e){this.G=a;this.H=b;this.I=c;this.m=d;this.F=e;this.a=new _.wi;this.l=!0;this.h=this.j=this.A=!1;this.B=null;this.f=new _.gj(this.ii.bind(this));this.g=new _.L("clpp.vimond.VimondDispatcher");this.o=this.w=0;this.m&&this.a&&(this.g.debug(dy),this.a.on(this.m,_.ig,this.Jl.bind(this)),this.a.on(this.m,_.zg,this.Kl.bind(this)),this.a.on(this.m,_.jc,this.Hl.bind(this)),this.a.on(this.m,_.kc,this.Il.bind(this)))},gy=function(a,
|
|
3
|
+
b){a.m.trigger(new _.Q(_.Xg,{detail:b}))},hy=function(a,b,c){b&&(a.A=!0,a.f.stop());a.m.onError(new _.O(b?_.P:1,9,9201,c))},iy=function(a,b,c,d,e){this.l=a;this.o=c;this.h=b;this.a=d;this.j=e;this.g=new _.L("clpp.vimond.VimondService");this.f=0},jy=function(a){this.m=a;this.a=new _.wi;this.g=new _.L("clpp.vimond.VimondAdapter");this.f=this.h=!1;this.m&&this.a&&(this.g.debug(dy),this.a.on(this.m,_.Qf,this.o.bind(this)),this.a.on(this.m,_.jc,this.j.bind(this)),this.a.on(this.m,_.kc,this.l.bind(this)))},
|
|
4
|
+
ky=function(a,b){var c=a.m.getState();if(1===b)return["str-start",_.Af];if(a.h)return[_.oe,_.lf];if(5===c)return[_.oe,null];if(c===_.Co)return[_.qe,_.lf];var d=_.lf;if(2===c||3===c||a.f)d=_.Af;return["period",d]},ly=function(){this.a=!1;this.g=new _.L(ey);this.j=this.h=this.f=null},my=function(){};_.r=fy.prototype;_.r.Kl=function(){this.h||(this.h=1<Math.abs(this.w-this.m.getPosition()));this.w=this.m.getPosition()};_.r.Hl=function(){this.g.debug("Ad break started");this.j=!0};
|
|
5
|
+
_.r.Il=function(){this.g.debug("Ad break stopped");this.j=!1};
|
|
6
|
+
_.r.Jl=function(a){var b=this,c,d,e,f,g;return _.I(function(h){if(1==h.a){c=a.detail;d=_.lu;e=c.currentState;f=c.previousState;b.g.debug("State changed, prev: "+f+" curr: "+e);if(b.A||b.j)return h["return"]();if(e===b.B&&!b.h)return b.g.debug("Ignore transition"),h["return"]();if(b.l&&e!==d.PLAYING)return h["return"]();if(b.h&&[d.PAUSED,d.BUFFERING].includes(e))return b.g.debug("Seeking"),h["return"]();b.h&&e===d.PLAYING&&(b.g.debug("Seeked"),b.h=!1);g=[d.PLAYING,d.PAUSED,d.ERROR,d.ENDED];if(!g.includes(e))return h.C(0);
|
|
7
|
+
b.B=e;return _.x(h,b.ii(),3)}e===d.ENDED&&b.f.stop();_.z(h)})};
|
|
8
|
+
_.r.ii=function(){var a=this,b,c,d,e,f,g;return _.I(function(h){if(1==h.a){var l=Math.floor(Date.now()/1E3);0<a.o&&a.g.debug("Last event was "+(l-a.o)+" seconds ago");a.o=l;a.f.stop();a.f.ha(a.l?10:a.G);a.l=!1;_.F(h,2);return _.x(h,a.F.fireEvent(),4)}if(2!=h.a)return b=h.f,gy(a,b),_.G(h,0);d=c=_.H(h);e=d.code;f=d.data;g=[1002,1003];g.includes(e)?(a.g.debug("Unreachable service"),gy(a,f),hy(a,a.H,f)):1001===e?(a.g.debug("Generic service error"),gy(a,f),hy(a,a.I,f)):a.g.error(c.toString());_.z(h)})};iy.prototype.fireEvent=function(){this.f++;var a=_.M.ra(this.o);a.client.buildName=_.ya;a.client.buildVersion=_.ia;var b=a.client,c=this.a.m.getDrmInfo();b.drm=c?c.keySystem:"";a.client.pageUrl=document.location.href;a.client.streamUrl=this.a.m.getLoadedSource().url;a.client.userAgent=navigator.userAgent;a.client.videoFormat=this.a.m.getLoadedSource().type||"";b=a.client;c=this.a.m.getLoadedSource();c=((new _.wn(c.url)).scheme||"").replace(":","");b.videoProtocol=c;b=ky(this.a,this.f);a.client.playerEvent=
|
|
9
|
+
b[0]||"";a.client.playerState=b[1]||"";a.progress.vod&&(a.progress.vod.position=this.a.getPosition());if(b=a.progress.live){c=this.a;var d=c.m.getPresentationStartTime()||0;c=Math.floor(d+c.m.getPosition());c=(new Date(1E3*c)).toISOString();b.position=c;d=this.a;c=d.m.getPosition();d=d.m.getSeekRange().end;b.onLiveEdge=30>Math.abs(d-c);typeof b.liveResumePossible!==_.bd&&(b.liveResumePossible=!0)}a.progress.eventNumber=this.f;a.timestamp=(new Date).toISOString();this.g.debug("Fire an event");b=_.$k(this.l);
|
|
10
|
+
b.method=_.rb;b.contentType="application/json";b.headers.Authorization="Bearer "+this.h;b.body=_.R.Gd(JSON.stringify(a));return this.j.fetch(b).U};iy.prototype.nh=function(a){this.h=a};jy.prototype.getPosition=function(){return Math.floor(this.m.getPosition())};jy.prototype.o=function(){this.h=!0};jy.prototype.j=function(){this.f=!0};jy.prototype.l=function(){this.f=!1};_.w(ly,_.Zv);_.r=ly.prototype;_.r.onPlayerCreated=function(){};
|
|
11
|
+
_.r.onContentWillLoad=function(a){var b=a.getConfiguration();(this.a=!_.M.R(b.vimond)&&typeof b.vimond===_.$e)?a.namespace()===_.xd&&(this.a=!1,this.g.info("Vimond does not report when casting.")):this.g.debug("Vimond plugin is loaded but not configured. Will do nothing.");if(this.a){b=a.getConfiguration().vimond;for(var c=_.v(["authToken","playerEventRequest"]),d=c.next();!d.done;d=c.next())if(d=d.value,!b[d]){this.g.warn(d+" key is missing");a.onError(new _.O(1,9,9200));return}this.g.debug("Configuration is valid");
|
|
12
|
+
c=b.failIfUnreachable;typeof c!==_.bd&&(c=!0);d=b.failOnError;typeof d!==_.bd&&(d=!0);this.f=new jy(a);this.h=new iy(b.playerEventRequest.uri,b.authToken,b.playerEventRequest.body,this.f,a.getNetworkEngine());this.j=new fy(b.playerEventRequest.eventInterval,c,d,a,this.h)}};_.r.onPlayerWillRelease=function(){if(this.a){if(this.f){var a=this.f;a.g.debug(_.Pb);_.zi(a.a)}this.j&&(a=this.j,a.g.debug(_.Pb),_.zi(a.a),a.f.stop());this.j=this.h=this.f=null}};_.r.onPlayerWillDestroy=function(){};_.r.id=function(){return"vimond"};
|
|
13
|
+
_.r.nh=function(a){this.a&&this.h&&this.h.nh(a)};_.K(ey,ly);ly.prototype.updateAuthToken=ly.prototype.nh;ly.Id="vimond";my.prototype.create=function(){return new ly};_.bp(new my);};
|
|
14
14
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
15
15
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
16
16
|
else{_=this.clpp._;(f.call(g,this));}
|
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.fa=this.H=this.f=this.a=this.m=null;this.g=new _.L("clpp.vr");this.I=70;this.da=1;this.P=this.O=!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.
|
|
11
|
-
this.F=this.
|
|
12
|
-
_.r.onContentWillLoad=function(a){var b=a.getConfiguration();if(b.vr&&b.vr.enable){var c=b.vr,d=c.fieldOfView,e=c.sensitivity,f=c.invertHorizontalControl;c=c.invertVerticalControl;if(void 0!==d&&_.M.
|
|
13
|
-
if(!this.a){this.a=document.createElement("canvas");this.a.style.width="100%";this.f=this.a.getContext("webgl",
|
|
14
|
-
!1),this.a.addEventListener(
|
|
15
|
-
_.r.onPlayerWillRelease=function(){this.g.info("Releasing VR plugin resources");this.w&&cancelAnimationFrame(this.w);this.h.x=0;this.l=this.j=this.h.y=0;this.f&&(delete this.f,this.f=null);this.a&&(
|
|
16
|
-
_.r.
|
|
17
|
-
0,0,1);b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT);if(this.o){var c=this.A;c.a.useProgram(c.f);c=
|
|
2
|
+
var f=function(window){var Jx="touchmove",Kx="touchstart",Lx=function(a,b,c,d){this.x=a||0;this.y=b||0;this.a=c||0;this.f=d||1},Mx=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)},Nx=function(a,b,c){c*=.5;var d=Math.sqrt(a*a+b*b),e=Math.sin(c);return new Lx(a/d*e,b/d*e,0/d*e,Math.cos(c))},Ox=function(a,b,c){this.x=a||0;this.y=b||0;this.a=c||0},Px=function(a,b){isFinite(b)?(a.x*=b,a.y*=b,a.a*=
|
|
3
|
+
b):(a.x=0,a.y=0,a.a=0)},Qx=function(a,b){return a.x*b.x+a.y*b.y+a.a*b.a},Rx=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},Sx=function(){this.a=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])},Tx=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},Ux=function(a){var b=new Ox(0,0,0),c=new Ox(0,0,1),d=new Ox,e=new Ox,f=new Ox;a=a.a;var g=new Ox(0,1,0);f.x=b.x-g.x;f.y=b.y-g.y;f.a=b.a-g.a;g=f.length();Px(f,1/g);c=Rx(d,c,f);g=c.length();Px(c,1/g);Rx(e,f,d);a[0]=d.x;a[1]=d.y;a[2]=d.a;a[3]=-Qx(d,b);a[4]=e.x;a[5]=e.y;a[6]=e.a;a[7]=-Qx(e,b);a[8]=f.x;a[9]=f.y;a[10]=f.a;a[11]=-Qx(f,b);a[12]=0;a[13]=0;a[14]=0;a[15]=1},Wx=function(a){this.a=a;this.f=a.createProgram();this.l=
|
|
5
|
+
Vx(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=Vx(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)},Vx=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},Xx=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)},Yx=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)},Zx=function(){var a=this;this.o=this.w=this.L=this.J=this.A=
|
|
10
|
+
this.fa=this.H=this.f=this.a=this.m=null;this.g=new _.L("clpp.vr");this.I=70;this.da=1;this.P=this.O=!1;this.G=function(){if(a.a&&a.f){a.f.viewport(0,0,a.a.width,a.a.height);var b=a.L.a,c=Math.tan(.5*a.I*Math.PI/180);b[0]=1/(a.a.width/a.a.height*c);b[1]=0;b[2]=0;b[3]=0;b[4]=0;b[5]=1/c;b[6]=0;b[7]=0;b[8]=0;b[9]=0;b[10]=2E3/-1999.9;b[11]=200/-1999.9;b[12]=0;b[13]=0;b[14]=-1;b[15]=1}};this.l=this.j=0;this.h={x:0,y:0};this.T=new Sx;this.Z=new Sx;this.ja=new Sx;this.ka=new Sx;this.B=this.On.bind(this);
|
|
11
|
+
this.F=this.Pn.bind(this);this.K=this.Nn.bind(this)},$x=function(a){var b=Nx(1,0,a.l*Math.PI/180);Mx(Nx(0,1,a.j*Math.PI/180),a.T);Mx(b,a.Z);Ux(a.ja);Tx(a.ka,a.T,a.ja);Tx(a.H,a.Z,a.ka)},ay=function(a){a.a&&(a.a.removeEventListener("mousemove",a.B,!1),a.a.removeEventListener(Jx,a.B,!1),a.a.removeEventListener("mouseup",a.F,!1),a.a.removeEventListener("touchend",a.F,!1))},by=function(){};Ox.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.a*this.a)};Sx.prototype.set=function(a,b,c,d,e,f,g,h,l,m,n,p,q,t,u,y){var D=this.a;D[0]=a;D[4]=b;D[8]=c;D[12]=d;D[1]=e;D[5]=f;D[9]=g;D[13]=h;D[2]=l;D[6]=m;D[10]=n;D[14]=p;D[3]=q;D[7]=t;D[11]=u;D[15]=y;return this};var cy={alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!1,devicePixelRatio:1};_.w(Zx,_.Zv);_.r=Zx.prototype;_.r.onPlayerCreated=function(a){this.g.info("Player created");this.m=a};
|
|
12
|
+
_.r.onContentWillLoad=function(a){var b=a.getConfiguration();if(b.vr&&b.vr.enable){var c=b.vr,d=c.fieldOfView,e=c.sensitivity,f=c.invertHorizontalControl;c=c.invertVerticalControl;if(void 0!==d&&_.M.za(d))this.I=d;else throw new _.O(1,7,7100,"fieldOfView configuration must be a number");if(void 0!==e&&_.M.za(e)&&0<e)this.da=e;else throw new _.O(1,7,7100,"sensitivity configuration must be a positive number");this.O=!!f;this.P=!!c;if(a=a.getSurface())if((d=a.getMedia())&&d.tagName.toLowerCase()===_.Sg){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",cy)||this.a.getContext("experimental-webgl",cy);if(!this.f)throw new _.O(1,9,9003,"Unable to create GL context");this.H=new Sx;Ux(this.H);this.fa=new Xx(this.f);this.A=new Wx(this.f);this.J=new Sx;this.L=new Sx;this.o=this.w=null;this.a.addEventListener(_.Tf,this.G)}a.addElementToContainer(this.a,!0,!0);a.hideMediaElement();b.vr.attachMouseListener&&(this.a.addEventListener("mousedown",this.K,
|
|
14
|
+
!1),this.a.addEventListener(Kx,this.K,!1));this.G();this.Fj()}else this.g.info("No video element found, can not initialize VR plugin");else this.g.info("No surface found, can not initialize VR plugin")}};
|
|
15
|
+
_.r.onPlayerWillRelease=function(){this.g.info("Releasing VR plugin resources");this.w&&cancelAnimationFrame(this.w);this.h.x=0;this.l=this.j=this.h.y=0;this.f&&(delete this.f,this.f=null);this.a&&(ay(this),this.a.removeEventListener(_.Tf,this.G),this.a.parentElement.removeChild(this.a),this.a.removeEventListener("mousedown",this.K,!1),delete this.a,this.a=null)};_.r.onPlayerWillDestroy=function(){var a=this;return _.I(function(b){a.m=null;_.z(b)})};_.r.id=function(){return"vr"};
|
|
16
|
+
_.r.Fj=function(){if(this.m&&this.f){var a=this.m.getSurface();if(a&&(a=a.getMedia())&&a.tagName.toLowerCase()===_.Sg){this.w=requestAnimationFrame(this.Fj.bind(this));var b=this.f;this.o||a.readyState!==a.HAVE_ENOUGH_DATA||(this.o=new Yx(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=Tx(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.fa;a.a.bindBuffer(a.a.ARRAY_BUFFER,
|
|
18
18
|
a.f);a.a.vertexAttribPointer(0,3,a.a.FLOAT,!1,20,0);a.a.vertexAttribPointer(1,2,a.a.FLOAT,!1,20,12);a.a.enableVertexAttribArray(0);a.a.enableVertexAttribArray(1);a.a.drawArrays(a.a.TRIANGLES,0,a.h);a=this.o;a.a.bindTexture(a.a.TEXTURE_2D,null);this.A.a.useProgram(null)}}}};
|
|
19
|
-
_.r.
|
|
20
|
-
_.r.
|
|
21
|
-
_.r.
|
|
19
|
+
_.r.Nn=function(a){this.g.debug("Mouse Down. Enable VR mouse interaction");a.preventDefault();if(0===a.button||a.type===Kx)a.type===Kx?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(Jx,this.B,!1),this.a.addEventListener("mouseup",this.F,!1),this.a.addEventListener("touchend",this.F,!1)};
|
|
20
|
+
_.r.On=function(a){a.preventDefault();var b=a.clientX,c=a.clientY;a.type===Jx&&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.da;c=d*b*(this.P?-1:1);this.j+=a*b*(this.O?-1:1);this.l+=c;$x(this)};_.r.Pn=function(a){this.g.debug("Mouse Up. Removing mouse interaction listeners");a.preventDefault();ay(this)};_.r.fn=function(a,b){this.l=b;this.j=a;$x(this)};_.r.lm=function(){return{x:this.j,y:this.l}};
|
|
21
|
+
_.r.Io=function(a){this.I=a;this.G()};_.K("clpp.vr.VrPlugin",Zx);Zx.prototype.setCameraFieldOfView=Zx.prototype.Io;Zx.prototype.getCameraCoordinates=Zx.prototype.lm;Zx.prototype.moveCamera=Zx.prototype.fn;Zx.Id="vr";by.prototype.create=function(){return new Zx};_.bp(new by);};
|
|
22
22
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
23
23
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
24
24
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.vtt.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
a[1].match(/\d+:\d+:\d+/)&&(b+=a[0].match(/\w+/)+"\n",++c);if(a[c].match(/\d+:\d+:\d+/)){var d=a[1].match(/(\d+):(\d+):(\d+)(?:,(\d+))?\s*--?>\s*(\d+):(\d+):(\d+)(?:,(\d+))?/);if(d)b+=d[1]+":"+d[2]+":"+d[3]+"."+d[4]+" --\x3e ",b+=d[5]+":"+d[6]+":"+d[7]+"."+d[8]+"\n",++c;else return""}else return"";a[c]&&(b+=a[c]+"\n\n");return b},
|
|
4
|
-
_.
|
|
5
|
-
Number(c[1]),c[2]&&(a.lineAlign=_.
|
|
6
|
-
a)return null;var b=Number(a[2]),c=Number(a[3]);return 59<b||59<c?null:Number(a[4])/1E3+c+60*b+3600*(Number(a[1])||0)},
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
f/9E4-c}}else this.a.streaming.relativeTextTimestamp&&null!==b.segmentStart&&(c=b.segmentStart);f=[];e=_.v(d);for(var g=e.next();!g.done;g=e.next()){var 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=_.v(d);for(g=d.next();!g.done;g=d.next())if(g=g.value,g.includes("--\x3e")){p=g.split("\n");var q=c;if(1===p.length&&!p[0]||/^NOTE($|[ \t])/.test(p[0])||"STYLE"===p[0])g=null;else{g=null;p[0].includes("--\x3e")||(g=p[0],p.splice(0,1));l=new _.
|
|
12
|
-
n,
|
|
13
|
-
|
|
14
|
-
[],
|
|
15
|
-
_.
|
|
2
|
+
var f=function(window){var px=" The setting will be ignored.",qx="VTT parser encountered an invalid VTT setting: ",rx="application/x-subrip",sx="text/srt",tx='text/vtt; codecs\x3d"vtt"',ux='text/vtt; codecs\x3d"wvtt"',vx=function(a){_.Xs(a,/[ \t]+/gm)},wx=function(a){return a.a===a.f.length?null:(a=_.Xs(a,/[^ \t\n]*/gm))?a[0]:null},xx=function(){},yx=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},zx=function(){},Ax=function(a){this.a=a},Cx=function(a,b,c){var d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"===b?a.textAlign=_.Ap:a.textAlign=
|
|
4
|
+
_.iw[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"===d[1]?_.Qg:_.Rg;else if(d=/^size:([\d.]+)%$/.exec(b))a.size=Number(d[1]);else if(d=/^position:([\d.]+)%(?:,(line-left|line-right|center|start|end))?$/.exec(b))a.position=Number(d[1]),d[2]&&(b=d[2],a.positionAlign=b===_.Ge||b===_.hg?_.Ge:b===_.He||b===_.oe?_.He:_.od);else if(d=/^region:(.*)$/.exec(b)){if(b=Bx(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=_.jw[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.Cp,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.jw[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},Bx=function(a,b){var c=a.filter(function(d){return d.id===b});return c.length?c[0]:(_.Qh("VTT parser could not find a region with id: ",b," The region will be ignored."),null)},Dx=function(a){a=_.Xs(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)},Ex=function(){Ax.apply(this,arguments)},Fx=function(){this.a=null;this.g=new _.L("clpp.vtt.mp4")},Hx=function(a,b,c){var d,e,f;(new _.oq).M("payl",_.rq(function(g){d=_.R.ea(g)})).M("iden",_.rq(function(g){e=_.R.ea(g)})).M("sttg",_.rq(function(g){f=_.R.ea(g)})).parse(a);return d?Gx(d,e,f,b,c):null},Gx=function(a,b,c,d,e){a=new _.Fp(d,e,a,_.Zg);b&&(a.id=b);if(c)for(b=new _.Ws(c),c=
|
|
7
|
+
wx(b);c;)Cx(a,c,[])||_.Qh(qx,c,px),vx(b),c=wx(b);return a},Ix=function(){this.a=new zx};xx.prototype.a=function(a){a=_.R.ea(a);a=a.replace(/\r+/g,"");a=a.replace(/^\s+|\s+$/g,"");a=a.replace(/<[a-zA-Z\\/][^>]*>/g,"");var b=a.split("\n\n");a="";if(0<b.length){a+="WEBVTT\n\n";b=_.v(b);for(var c=b.next();!c.done;c=b.next())a+=yx(c.value)}return _.R.gb(a)};zx.prototype.create=function(){return new xx};zx.prototype.probe=function(a,b){return(a===sx||a===rx)&&b===_.sg};Ax.prototype.parseInit=function(){};
|
|
8
|
+
Ax.prototype.parseMedia=function(a,b){var c=_.R.ea(a);c=c.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");var d=c.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(d[0]))throw new _.O(_.P,2,2E3);c=b.periodStart;if(d[0].includes("X-TIMESTAMP-MAP")){var e=d[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),f=d[0].match(/MPEGTS:(\d+)/m);if(e&&f){c=Dx(new _.Ws(e[1]));if(null==c)throw new _.O(_.P,2,2E3);f=Number(f[1]);for(e=b.segmentStart;95443.7176888889<=e;)e-=95443.7176888889,f+=8589934592;c=b.periodStart+
|
|
9
|
+
f/9E4-c}}else this.a.streaming.relativeTextTimestamp&&null!==b.segmentStart&&(c=b.segmentStart);f=[];e=_.v(d);for(var g=e.next();!g.done;g=e.next()){var h=g.value;if(/^region/.test(h.toLowerCase())){h=new _.Ws(h.replace(/\n/g," "));g=new _.Ip;wx(h);vx(h);for(var l=wx(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||_.Qh("VTT parser encountered an invalid VTTRegion setting: ",l,px);vx(h);l=wx(h)}f.push(g)}}e=[];h=_.v(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=_.v(d);for(g=d.next();!g.done;g=d.next())if(g=g.value,g.includes("--\x3e")){p=g.split("\n");var q=c;if(1===p.length&&!p[0]||/^NOTE($|[ \t])/.test(p[0])||"STYLE"===p[0])g=null;else{g=null;p[0].includes("--\x3e")||(g=p[0],p.splice(0,1));l=new _.Ws(p[0]);m=Dx(l);var t=_.Xs(l,/[ \t]+--\x3e[ \t]+/g);n=Dx(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 _.Fp(m,n,p,_.Zg);g&&(m.id=g);vx(l);for(n=wx(l);n;)Cx(m,n,f)||_.Qh(qx,
|
|
12
|
+
n,px),vx(l),n=wx(l);null!=g&&(m.id=g);g=m}g&&h.push(g)}return{cues:h,styles:e}};_.w(Ex,Ax);Ex.prototype.parseMedia=function(a,b){return Ax.prototype.parseMedia.call(this,(new xx).a(a),b)};Fx.prototype.parseInit=function(a){var b=this,c=!1;(new _.oq).M(_.We,_.pq).M(_.Bg,_.pq).M(_.Re,_.pq).ba("mdhd",function(d){0===d.version?(d.reader.skip(4),d.reader.skip(4),b.a=_.jq(d.reader),d.reader.skip(4)):(d.reader.skip(8),d.reader.skip(8),b.a=_.jq(d.reader),d.reader.skip(8));d.reader.skip(4)}).M(_.Ve,_.pq).M(_.kg,_.pq).ba(_.mg,_.qq).M("wvtt",function(){c=!0}).parse(a);if(!this.a)throw new _.O(_.P,2,2008);if(!c)throw new _.O(_.P,2,2008);};
|
|
13
|
+
Fx.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 _.oq).M("moof",_.pq).M("traf",_.pq).ba("tfdt",function(A){g=!0;c=0===A.version?_.jq(A.reader):_.lq(A.reader)}).ba("tfhd",function(A){var J=A.flags;A=A.reader;A.skip(4);J&1&&A.skip(8);J&2&&A.skip(4);m=J&8?_.jq(A):null}).ba("trun",function(A){h=!0;var J=A.version,N=A.flags;A=A.reader;var V=_.jq(A);N&1&&A.skip(4);N&4&&A.skip(4);for(var U=
|
|
14
|
+
[],qa=0;qa<V;qa++){var wa={duration:null,sampleSize:null,jh:null};N&256&&(wa.duration=_.jq(A));N&512&&(wa.sampleSize=_.jq(A));N&1024&&A.skip(4);N&2048&&(wa.jh=0===J?_.jq(A):_.kq(A));U.push(wa)}d=U}).M(_.Qe,_.rq(function(A){l=!0;e=A})).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 _.eq(p,!1);for(var q=_.v(d),t=q.next();!t.done;t=q.next()){t=t.value;var u=t.duration||m,y=t.jh?c+t.jh:n;n=y+(u||0);var D=0;do{var C=_.jq(p);D+=C;var B=
|
|
15
|
+
_.jq(p);B=_.tq(B);var E=null;"vttc"===B?8<C&&(E=_.nq(p,C-8)):("vtte"!==B&&this.g.error("Unknown box "+B+"! Skipping!"),p.skip(C-8));u?E&&f.push(Hx(E,b.periodStart+y/this.a,b.periodStart+n/this.a)):this.g.error("WVTT sample duration unknown, and no default found!")}while(t.sampleSize&&D<t.sampleSize)}return{cues:f.filter(_.tn),styles:[]}};_.w(Ix,_.bv);Ix.prototype.install=function(){_.sv(_.sg,Ax);_.sv(tx,Ax);_.sv(ux,Ax);_.sv(_.Oc,Fx);_.sv(sx,Ex);_.sv(rx,Ex);_.ut.push(this.a)};Ix.prototype.uninstall=function(){_.Hv(_.sg);_.Hv(tx);_.Hv(ux);_.Hv(_.Oc);_.Hv(sx);_.Hv(rx);_.wt(this.a)};Ix.prototype.id=function(){return"subtitles-vtt"};_.K("clpp.vtt.VttComponent",Ix);};
|
|
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 _.x(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 kx="clpp.yospace.YospacePlugin",lx=function(){this.a=null;this.g=new _.L(kx)},mx=function(){};_.w(lx,_.Zv);lx.prototype.Di=function(){return this.a};
|
|
3
|
+
lx.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!==_.$e)throw new _.O(_.P,9,7003,"Yospace SDK not found.");c.g.info("Yospace enabled.");f=e.streamType||nx;a:{var m=b.url;c.g.info("Creating Yospace session for stream type",f);switch(f){case nx:m=YospaceAdManagement.SessionVOD.create(m);break a;case ox:m=YospaceAdManagement.SessionLive.create(m);
|
|
4
|
+
break a;default:m=YospaceAdManagement.SessionDVRLive.create(m)}}return _.x(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 _.Q(_.lh,{detail:g}));b.url=g.getPlaybackUrl();c.g.info("Yospace session initialized. New URL:",b.url);c.a=g;_.z(l)})};
|
|
5
|
+
lx.prototype.onPlayerWillRelease=function(a){if(this.a){this.g.info("Shutting down Yospace session.");var b=this.a;this.a.shutdown();this.a=null;a.trigger(new _.Q(_.kh,{detail:b}))}};lx.prototype.id=function(){return"yospace"};_.K(kx,lx);lx.prototype.getSession=lx.prototype.Di;lx.Id="yospace";mx.prototype.create=function(){return new lx};var nx=_.Ub,ox="LIVE";_.K("clpp.yospace.StreamType",{VOD:nx,LIVE:ox,DVR:"DVR"});_.bp(new mx);};
|
|
6
6
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
7
7
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
8
8
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.youbora.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
"PlayReady":a.startsWith(_.
|
|
4
|
-
b.message,b.metadata),c.debug(
|
|
2
|
+
var f=function(window){var Gw='" event to NPAW',Hw='" event to Youbora',Iw='Reporting "',Jw="Unhandled state",Kw="accountCode key is missing in Youbora config",Lw="ad break start",Mw="ad buffering ended",Nw="ad buffering started",Ow="ad click through url: ",Pw="ad timeline changed",Qw="clpp.npaw.NpawPlugin",Rw="clpp.npaw.YouboraPlugin",Sw="content.isLive",Tw="content.title",Uw="is container visible",Vw="youbora",Ww=function(a){return a.startsWith(_.Md)?"Widevine":a.startsWith(_.Id)?"FairPlay":a.match(/^com\.(microsoft|chromecast)\.playready/)?
|
|
3
|
+
"PlayReady":a.startsWith(_.jf)?"ClearKey":a.startsWith(_.Hd)?"Primetime":a},Xw=function(a){return(a=a.getConfiguration().youbora)&&a.errorFilter?a.errorFilter:function(b){return{code:""+b.code,message:b.message,severity:b.severity}}},Yw=function(a,b,c,d){b=Xw(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===a.code?"ad error":_.qe;b.severity===_.P?(d.fireFatalError(b.code,b.message,b.metadata),c.debug('Reporting "fatal '+a+'" to Youbora',b.code,b)):(d.fireError(b.code,
|
|
4
|
+
b.message,b.metadata),c.debug(Iw+a+'" to Youbora',b.code,b));return b},Zw=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.m=c;d.a=new _.wi;d.g=new _.L("clpp.npaw.YouboraAdapter");d.o=!1;d.h=!1;d.B=!1;d.registerListeners();return d}_.w(b,youbora.Adapter);b.prototype.getPlayhead=function(){return this.getIsLive()?-1:this.m.getPosition()};b.prototype.getDuration=function(){return this.m.getDuration()};b.prototype.getRendition=function(){var c=this.m.getTrackManager();if(c&&(c=c.qa())){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 1:this.w()&&this.f();break;case 3:this.f();this.A();this.fireResume();this.fireBufferEnd();break;case 4:this.w()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.
|
|
9
|
-
b.prototype.A=function(){var c=this.m.getDrmInfo();c&&(c=
|
|
10
|
-
c.adsTimeline)&&c.
|
|
11
|
-
this.a.getDuration()};b.prototype.getRendition=function(){var c=null;this.a&&(c=youbora.Util.buildRenditionString(this.a.
|
|
12
|
-
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
|
-
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
|
-
_.
|
|
23
|
-
break;case 4:this.o()&&this.fireStart();this.A();this.fireBufferEnd();this.firePause();break;case _.
|
|
24
|
-
function(){this.player.isEnded()||(this.l(_.
|
|
25
|
-
a.prototype.K=function(){this.l(_
|
|
26
|
-
|
|
6
|
+
b.prototype.getFramesPerSecond=function(){var c=this.m.getTrackManager();return c&&(c=c.Ma())?c.frameRate:null};b.prototype.getPlayerName=function(){return _.ya};b.prototype.getVersion=function(){return"6.30.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,_.ig,this.K.bind(this)),this.a.on(this.m,_.qe,this.H.bind(this)),this.a.on(this.m,
|
|
7
|
+
_.Ng,this.J.bind(this)),this.a.on(this.m,_.Mg,this.I.bind(this)),this.a.on(this.m,_.Fc,this.F.bind(this)),this.a.on(this.m,_.hd,this.G.bind(this)))};b.prototype.unregisterListeners=function(){this.g.debug(_.Pb);_.zi(this.a)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.B=!0};b.prototype.j=function(){return this.m.getStats()||_.du()};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 1:this.w()&&this.f();break;case 3:this.f();this.A();this.fireResume();this.fireBufferEnd();break;case 4:this.w()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.eu:this.fireBufferEnd();this.fireStop();break;case 5:this.fireBufferEnd();this.o&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case 2:this.fireBufferBegin();break;default:this.g.debug(Jw,c)}};b.prototype.f=function(){this.plugin.isInitiated||(this.h=!1,this.fireInit())};
|
|
9
|
+
b.prototype.A=function(){var c=this.m.getDrmInfo();c&&(c=Ww(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=Yw(c,this.m,this.g,this))&&c.severity===_.P&&(this.h=!0)};b.prototype.J=function(){this.m.isEnded()||(this.l(_.ag),this.f(),this.fireSeekBegin())};b.prototype.I=function(){this.l(_.$f);this.fireSeekEnd()};b.prototype.F=function(c){this.g.debug("adsTimeline",c);this.o=(c=
|
|
10
|
+
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,[Iw+c+Hw].concat(_.ph(e)))};return new b(a)},$w=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 _.L("clpp.npaw.YouboraAdsAdapter");d.registerListeners();d.A=!1;d.l=!1;return d}_.w(b,youbora.Adapter);b.prototype.getDuration=function(){return this.a&&
|
|
11
|
+
this.a.getDuration()};b.prototype.getRendition=function(){var c=null;this.a&&(c=youbora.Util.buildRenditionString(this.a.nb(),this.a.lb(),this.a.Ya()));return c};b.prototype.getBitrate=function(){return this.a&&this.a.Ya()};b.prototype.getPlayhead=function(){var c=this.m.getAdsManager();return c&&c.getPosition()};b.prototype.getResource=function(){return this.a&&this.a.getMediaUrl()};b.prototype.getTitle=function(){return this.a&&this.a.getTitle()};b.prototype.getProvider=function(){return this.a&&
|
|
12
|
+
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.Za()){case 0:d=c.Preroll;break;case 2:d=c.Postroll;break;case 1:d=c.Midroll}this.g.debug("Ad position",d);return d};b.prototype.getIsSkippable=function(){return this.a&&-1!==this.a.getSkipTimeOffset()};b.prototype.getAudioEnabled=function(){var c=this.m.getAdsManager();return c&&0<c.getVolume()};
|
|
13
|
+
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.ob()};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(Uw,c);return c};b.prototype.getPlayerName=function(){return _.ya};b.prototype.getVersion=function(){return"6.30.0-castlabsadsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ia};b.prototype.registerListeners=function(){this.m&&this.f&&(this.f.on(this.m,_.Fc,this.T.bind(this)),this.f.on(this.m,_.Bc,this.P.bind(this)),this.f.on(this.m,_.xc,this.K.bind(this)),
|
|
15
|
+
this.f.on(this.m,_.zc,this.L.bind(this)),this.f.on(this.m,_.nc,this.I.bind(this)),this.f.on(this.m,_.oc,this.o.bind(this,1)),this.f.on(this.m,_.wc,this.o.bind(this,2)),this.f.on(this.m,_.Dc,this.o.bind(this,3)),this.f.on(this.m,_.mc,this.H.bind(this)),this.f.on(this.m,_.Ac,this.O.bind(this)),this.f.on(this.m,_.qe,this.J.bind(this)),this.f.on(this.m,_.jc,this.B.bind(this)),this.f.on(this.m,_.kc,this.F.bind(this)),this.f.on(this.m,_.lc,this.G.bind(this)),this.f.on(this.m,_.yc,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.T=function(c){this.g.debug(Pw,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(Nw);this.fireBufferBegin()};b.prototype.w=function(){this.l&&(this.h(Mw),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.yb();this.g.debug(Ow,c);this.fireClick(c)};b.prototype.O=function(){this.h("ad skipped");this.fireSkip()};b.prototype.B=function(c){this.a=c.ad;this.h(Lw,this.a);this.fireBreakStart()};b.prototype.F=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&&Yw(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,[Iw+c+Hw].concat(_.ph(e)))};return new b(a)},bx=function(){function a(){var b=NpawPluginAdapters.video.Shaka.call(this)||this;b.h=!1;b.f=!1;b.a=null;b.G=!1;return b}_.w(a,NpawPluginAdapters.video.Shaka);
|
|
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.qa())&&(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.Ma())?b.frameRate:null};a.prototype.getPlayerName=function(){return _.ya};a.prototype.getVersion=function(){return"castlabs-adapter-6.30.0-js"};
|
|
21
|
+
a.prototype.getPlayerVersion=function(){return _.ia};a.prototype.registerListeners=function(){var b=this.w();this.player&&b&&(b.on(this.player,_.ig,this.O.bind(this)),b.on(this.player,_.qe,this.J.bind(this)),b.on(this.player,_.ag,this.L.bind(this)),b.on(this.player,_.$f,this.K.bind(this)),b.on(this.player,_.Fc,this.H.bind(this)),b.on(this.player,_.hd,this.I.bind(this)),b.on(this.player,_.Zc,this.P.bind(this)),b.on(this.player,_.ug,this.T.bind(this)))};a.prototype.unregisterListeners=function(){ax.debug(_.Pb);
|
|
22
|
+
_.zi(this.w())};a.prototype.dispose=function(){this.unregisterListeners();this.G=!0;this.f=this.h=!1;this.a=null};a.prototype.j=function(){return this.player.getStats()||_.du()};a.prototype.o=function(){return!!this.player.getConfiguration().autoplay};a.prototype.O=function(b){b=b.detail;this.l("state change",b);if(b)switch(b.currentState){case 1:this.plugin.setVideoOptions({"content.subtitles":this.F()});this.o()&&this.fireStart();break;case 3:this.fireStart();this.A();this.fireResume();this.fireBufferEnd();
|
|
23
|
+
break;case 4:this.o()&&this.fireStart();this.A();this.fireBufferEnd();this.firePause();break;case _.eu:this.fireBufferEnd();this.fireStop();break;case 5:this.fireBufferEnd();this.h&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case 2:this.fireBufferBegin();break;default:ax.debug(Jw,b)}};a.prototype.A=function(){this.fireJoin()};a.prototype.J=function(b){(b=b.detail)&&!this.f&&this.player&&10003!==b.code&&(b=Yw(b,this.player,ax,this))&&b.severity===_.P&&(this.f=!0)};a.prototype.L=
|
|
24
|
+
function(){this.player.isEnded()||(this.l(_.ag),this.fireSeekBegin())};a.prototype.B=function(b){var c=this.player.getTrackManager();if(!c)return null;var d=null;b===_.rg&&(d=c.xa());b===_.Sc&&(d=c.oa());return d?d.language:null};a.prototype.P=function(){var b=this.B(_.Sc);this.plugin.setVideoOptions({"content.language":b})};a.prototype.T=function(){var b=this.B(_.rg),c=this.F();this.plugin.setVideoOptions({"content.subtitles":b||c})};a.prototype.w=function(){this.a||(this.a=new _.wi);return this.a};
|
|
25
|
+
a.prototype.K=function(){this.l(_.$f);this.fireSeekEnd()};a.prototype.H=function(b){ax.debug("adsTimeline",b);this.h=(b=b.adsTimeline)&&b.Rb()};a.prototype.I=function(b){ax.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];ax.debug.apply(ax,[Iw+b+Gw].concat(_.ph(d)))};a.prototype.F=function(){var b=this.player.getConfiguration();return b.youbora&&b.youbora.disabledSubtitlesLabel?b.youbora.disabledSubtitlesLabel:"off"};return a},
|
|
26
|
+
dx=function(){function a(){var b=NpawPluginAdapters.ads.Ima.call(this)||this;b.a=null;b.l=null;b.h=null;b.j=null;b.F=!1;b.o=!1;return b}_.w(a,NpawPluginAdapters.ads.Ima);a.prototype.getDuration=function(){return this.a?this.a.getDuration():null};a.prototype.getRendition=function(){var b=null;this.a&&(b=this.getNpawUtils().buildRenditionString(this.a.nb(),this.a.lb(),this.a.Ya()));return b};a.prototype.getBitrate=function(){var b=null;this.a&&(b=this.a.Ya());return b};a.prototype.getPlayhead=function(){var b=
|
|
27
27
|
null,c=this.player.getAdsManager();c&&(b=c.getPosition());return b};a.prototype.getResource=function(){var b=null;this.a&&(b=this.a.getMediaUrl());return b};a.prototype.getTitle=function(){var b=null;this.a&&(b=this.a.getTitle());return b};a.prototype.getProvider=function(){var b=null;this.a&&(b=this.a.getAdvertiserName());return b};a.prototype.getCreativeId=function(){var b=null;this.a&&(b=this.a.getCreativeId());return b};a.prototype.dispose=function(){this.unregisterListeners();this.F=!0;this.j=
|
|
28
|
-
this.h=this.a=null};a.prototype.getPosition=function(){var b=this.getNpawReference().Constants.AdPosition,c=null;if(this.a)switch(this.a.
|
|
29
|
-
a.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};a.prototype.getExpectedAds=function(){return this.a&&this.a.
|
|
30
|
-
b=this.getNpawUtils().calculateAdViewability(b);
|
|
31
|
-
b.on(this.player,_.
|
|
32
|
-
a.prototype.unregisterListeners=function(){_.
|
|
33
|
-
a.prototype.fa=function(){this.l=this.getPlayhead();this.A()};a.prototype.A=function(){this.o&&(this.f(
|
|
34
|
-
this.fireBreakStop({adPlayhead:this.l});this.getPosition()===this.getNpawReference().Constants.AdPosition.Postroll&&this.fireStop({adPlayhead:this.l})};a.prototype.L=function(b){(b=b.detail)&&10003===b.code&&
|
|
35
|
-
!1;var c=b.getConfiguration().youbora;return _.M.
|
|
36
|
-
_.
|
|
37
|
-
". Some or all features of YouboraPlugin may not work correctly.")),b.onError(new _.
|
|
38
|
-
_.r.onContentWillLoad=function(a,b){if(
|
|
39
|
-
_.r.onPlayerWillDestroy=function(){
|
|
40
|
-
_.r.onContentWillLoad=function(a,b){if(
|
|
41
|
-
|
|
28
|
+
this.h=this.a=null};a.prototype.getPosition=function(){var b=this.getNpawReference().Constants.AdPosition,c=null;if(this.a)switch(this.a.Za()){case 0:c=b.Preroll;break;case 2:c=b.Postroll;break;case 1:c=b.Midroll}cx.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};
|
|
29
|
+
a.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};a.prototype.getExpectedAds=function(){return this.a&&this.a.ob()};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();
|
|
30
|
+
b=this.getNpawUtils().calculateAdViewability(b);cx.debug(Uw,b);return b};a.prototype.getPlayerName=function(){return _.ya};a.prototype.getVersion=function(){return"castlabs-ads-adapter-6.30.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,_.Fc,this.da.bind(this)),b.on(this.player,_.Bc,this.Z.bind(this)),b.on(this.player,_.xc,this.O.bind(this)),
|
|
31
|
+
b.on(this.player,_.zc,this.P.bind(this)),b.on(this.player,_.nc,this.K.bind(this)),b.on(this.player,_.oc,this.w.bind(this,1)),b.on(this.player,_.wc,this.w.bind(this,2)),b.on(this.player,_.Dc,this.w.bind(this,3)),b.on(this.player,_.mc,this.J.bind(this)),b.on(this.player,_.Ac,this.T.bind(this)),b.on(this.player,_.qe,this.L.bind(this)),b.on(this.player,_.jc,this.G.bind(this)),b.on(this.player,_.kc,this.H.bind(this)),b.on(this.player,_.lc,this.I.bind(this)),b.on(this.player,_.yc,this.fa.bind(this)))};
|
|
32
|
+
a.prototype.unregisterListeners=function(){_.zi(this.B())};a.prototype.da=function(b){cx.debug(Pw,b);this.h=b.adsTimeline};a.prototype.Z=function(b){this.a=b.ad;this.f("ad start",this.a);this.fireStart();this.fireJoin()};a.prototype.K=function(){this.f("ad ended");this.fireStop({adPlayhead:this.l})};a.prototype.O=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(Nw);this.fireBufferBegin()};
|
|
33
|
+
a.prototype.fa=function(){this.l=this.getPlayhead();this.A()};a.prototype.A=function(){this.o&&(this.f(Mw),this.o=!1,this.fireBufferEnd())};a.prototype.w=function(b){this.f("ad quartile",b);this.fireQuartile(b)};a.prototype.J=function(){this.f("ad clicked");var b=this.a&&this.a.yb();cx.debug(Ow,b);this.fireClick(b)};a.prototype.T=function(){this.f("ad skipped");this.fireSkip()};a.prototype.G=function(b){this.a=b.ad;this.f(Lw,this.a);this.fireBreakStart()};a.prototype.H=function(){this.f("ad break stop");
|
|
34
|
+
this.fireBreakStop({adPlayhead:this.l});this.getPosition()===this.getNpawReference().Constants.AdPosition.Postroll&&this.fireStop({adPlayhead:this.l})};a.prototype.L=function(b){(b=b.detail)&&10003===b.code&&Yw(b,this.player,cx,this)};a.prototype.f=function(b,c){for(var d=[],e=1;e<arguments.length;++e)d[e-1]=arguments[e];cx.debug.apply(cx,[Iw+b+Gw].concat(_.ph(d)))};return a},ex=function(){this.a=null;this.g=new _.L(Qw);this.m=null},fx=function(a,b){if(b.namespace()===_.xd)return a.g.info("NPAW does not report when casting."),
|
|
35
|
+
!1;var c=b.getConfiguration().youbora;return _.M.Cg(c)?c.accountCode?_.M.R(window.NpawPlugin)||_.M.R(window.NpawPluginAdapters)?(a.g.warn("NPAW SDK not found."),b.onError(new _.O(1,9,9100)),!1):!0:(a.g.warn(Kw),b.onError(new _.O(1,9,9101)),!1):(a.g.warn("NPAW plugin is loaded but not configured. Will do nothing."),!1)},gx=function(a){a.a&&(a.g.info("Removing NPAW Plugins",a.a),a.a.removeAdsAdapter(),a.a.removeAdapter())},hx=function(){this.a=null;this.g=new _.L(Rw);this.m=null},ix=function(a,b){if(b.namespace()===
|
|
36
|
+
_.xd)return a.g.info("Youbora does not report when casting."),!1;var c=b.getConfiguration().youbora;if(!_.M.Cg(c))return a.g.debug("Youbora plugin is loaded but not configured. Will do nothing."),!1;if(!c.accountCode)return a.g.warn(Kw),b.onError(new _.O(1,9,9101)),!1;if(_.M.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+
|
|
37
|
+
". Some or all features of YouboraPlugin may not work correctly.")),b.onError(new _.O(1,9,9102)));return!0},jx=function(){};var ax=new _.L("clpp.npaw.NpawAdapter");var cx=new _.L("clpp.npaw.NpawAdsAdapter");_.w(ex,_.Zv);_.r=ex.prototype;_.r.dh=function(a){gx(this);if(this.a=a)this.a.registerAdapterFromClass(this.m,bx()),this.a.registerAdsAdapterFromClass(this.m,dx())};_.r.vm=function(){return this.a};_.r.getAdapter=function(){return this.a&&this.a.getAdapter()};_.r.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.r.onPlayerCreated=function(a){this.m=a;fx(this,a)&&(a=a.getConfiguration().youbora,this.dh(new NpawPlugin(a.accountCode)))};
|
|
38
|
+
_.r.onContentWillLoad=function(a,b){if(fx(this,a)){var c=a.getConfiguration(),d=c.youbora;void 0===d[Sw]&&(d[Sw]=b.isLive);void 0===d[Tw]&&(d[Tw]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.dh(new NpawPlugin(d.accountCode));this.a.setAnalyticsOptions(d)}};_.r.onContentLoaded=function(a){var b={};(a=a.getDrmInfo())&&(a=Ww(a.keySystem))&&(b["content.drm"]=a);this.g.info(_.bf,b);this.a.setAnalyticsOptions(b)};_.r.onPlayerWillRelease=function(){};
|
|
39
|
+
_.r.onPlayerWillDestroy=function(){gx(this);this.a.destroy()};_.r.id=function(){return Vw};_.K(Qw,ex);ex.prototype.getAdsAdapter=ex.prototype.getAdsAdapter;ex.prototype.getAdapter=ex.prototype.getAdapter;ex.prototype.getNpawPlugin=ex.prototype.vm;ex.prototype.setNpawPlugin=ex.prototype.dh;ex.Id=Vw;new _.L(Qw);_.w(hx,_.Zv);_.r=hx.prototype;_.r.eh=function(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(Zw(this.m)),this.a.setAdsAdapter($w(this.m))};_.r.getAdapter=function(){return this.a&&this.a.getAdapter()};_.r.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.r.onPlayerCreated=function(a){this.m=a;ix(this,a)&&(a=a.getConfiguration().youbora,this.eh(new youbora.Plugin(a)))};
|
|
40
|
+
_.r.onContentWillLoad=function(a,b){if(ix(this,a)){var c=a.getConfiguration(),d=c.youbora;void 0===d[Sw]&&(d[Sw]=b.isLive);void 0===d[Tw]&&(d[Tw]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.eh(new youbora.Plugin(d));this.a.setOptions(d)}};_.r.onPlayerWillRelease=function(){};_.r.onPlayerWillDestroy=function(){};_.r.id=function(){return Vw};_.K(Rw,hx);hx.prototype.getAdsAdapter=hx.prototype.getAdsAdapter;hx.prototype.getAdapter=hx.prototype.getAdapter;
|
|
41
|
+
hx.prototype.setYouboraPlugin=hx.prototype.eh;hx.Id=Vw;jx.prototype.create=function(a){return a.youbora&&a.youbora.v7?new ex:new hx};_.bp(new jx);};
|
|
42
42
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
43
43
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
44
44
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/polyfill.min.js
CHANGED
|
@@ -58,5 +58,5 @@ return"test"===t.get(e)&&!1===t["delete"](0)}return!1}catch(a){return!1}})()
|
|
|
58
58
|
)) {!function(e){var t=Symbol("undef"),r=function a(){if(!(this instanceof a))throw new TypeError('Constructor WeakMap requires "new"');var e=OrdinaryCreateFromConstructor(this,a.prototype,{_keys:[],_values:[],_es6WeakMap:!0}),t=arguments.length>0?arguments[0]:undefined;if(null===t||t===undefined)return e;var r=Get(e,"set");if(!IsCallable(r))throw new TypeError("WeakMap.prototype.set is not a function");try{for(var o=GetIterator(t);;){var p=IteratorStep(o);if(!1===p)return e;var n=IteratorValue(p);if("object"!==Type(n))try{throw new TypeError("Iterator value "+n+" is not an entry object")}catch(s){return IteratorClose(o,s)}try{var i=Get(n,"0"),l=Get(n,"1");Call(r,e,[i,l])}catch(u){return IteratorClose(o,u)}}}catch(u){if(Array.isArray(t)||"[object Arguments]"===Object.prototype.toString.call(t)||t.callee){var y,c=t.length;for(y=0;y<c;y++)i=t[y][0],l=t[y][1],Call(r,e,[i,l])}}return e};Object.defineProperty(r,"prototype",{configurable:!1,enumerable:!1,writable:!1,value:{}}),CreateMethodProperty(r.prototype,"constructor",r),CreateMethodProperty(r.prototype,"delete",function(e){var r=this;if("object"!==Type(r))throw new TypeError("Method WeakMap.prototype.clear called on incompatible receiver "+Object.prototype.toString.call(r));if(!0!==r._es6WeakMap)throw new TypeError("Method WeakMap.prototype.clear called on incompatible receiver "+Object.prototype.toString.call(r));var o=r._keys;if("object"!==Type(e))return!1;for(var a=0;a<o.length;a++)if(r._keys[a]!==t&&SameValue(r._keys[a],e))return this._keys[a]=t,this._values[a]=t,this._size=--this._size,!0;return!1}),CreateMethodProperty(r.prototype,"get",function p(e){var r=this;if("object"!==Type(r))throw new TypeError("Method WeakMap.prototype.get called on incompatible receiver "+Object.prototype.toString.call(r));if(!0!==r._es6WeakMap)throw new TypeError("Method WeakMap.prototype.get called on incompatible receiver "+Object.prototype.toString.call(r));var o=r._keys;if("object"!==Type(e))return undefined;for(var a=0;a<o.length;a++)if(r._keys[a]!==t&&SameValue(r._keys[a],e))return r._values[a];return undefined}),CreateMethodProperty(r.prototype,"has",function n(e){var r=this;if("object"!=typeof r)throw new TypeError("Method WeakMap.prototype.has called on incompatible receiver "+Object.prototype.toString.call(r));if(!0!==r._es6WeakMap)throw new TypeError("Method WeakMap.prototype.has called on incompatible receiver "+Object.prototype.toString.call(r));var o=r._keys;if("object"!==Type(e))return!1;for(var a=0;a<o.length;a++)if(r._keys[a]!==t&&SameValue(r._keys[a],e))return!0;return!1}),CreateMethodProperty(r.prototype,"set",function i(e,r){var o=this;if("object"!==Type(o))throw new TypeError("Method WeakMap.prototype.set called on incompatible receiver "+Object.prototype.toString.call(o));if(!0!==o._es6WeakMap)throw new TypeError("Method WeakMap.prototype.set called on incompatible receiver "+Object.prototype.toString.call(o));var a=o._keys;if("object"!==Type(e))throw new TypeError("Invalid value used as weak map key");for(var p=0;p<a.length;p++)if(o._keys[p]!==t&&SameValue(o._keys[p],e))return o._values[p]=r,o;var n={"[[Key]]":e,"[[Value]]":r};return o._keys.push(n["[[Key]]"]),o._values.push(n["[[Value]]"]),o}),Object.defineProperty(r.prototype,Symbol.toStringTag,{configurable:!0,enumerable:!1,writable:!1,value:"WeakMap"}),"name"in r||Object.defineProperty(r,"name",{configurable:!0,enumerable:!1,writable:!1,value:"WeakMap"});try{CreateMethodProperty(e,"WeakMap",r)}catch(o){e.WeakMap=r}}(self);}function EnumerableOwnProperties(e,r){for(var t=Object.keys(e),n=[],s=t.length,a=0;a<s;a++){var i=t[a];if("string"===Type(i)){var u=Object.getOwnPropertyDescriptor(e,i);if(u&&u.enumerable)if("key"===r)n.push(i);else{var p=Get(e,i);if("value"===r)n.push(p);else{var f=[i,p];n.push(f)}}}}return n}if (!("entries"in Object
|
|
59
59
|
)) {!function(){var e={}.toString,t="".split;CreateMethodProperty(Object,"entries",function r(n){var i=ToObject(n);return i=("string"===Type(i)||i instanceof String)&&"[object String]"==e.call(n)?t.call(n,""):Object(n),EnumerableOwnProperties(i,"key+value")})}();}if (!("devicePixelRatio"in self
|
|
60
60
|
)) {self.devicePixelRatio=1;}if (!("requestAnimationFrame"in self
|
|
61
|
-
)) {!function(n){var e,t=Date.now(),o=function(){return n.performance&&"function"==typeof n.performance.now?n.performance.now():Date.now()-t};if("mozRequestAnimationFrame"in n?e="moz":"webkitRequestAnimationFrame"in n&&(e="webkit"),e)n.requestAnimationFrame=function(t){return n[e+"RequestAnimationFrame"](function(){t(o())})},n.cancelAnimationFrame=n[e+"CancelAnimationFrame"];else{var i=Date.now();n.requestAnimationFrame=function(n){if("function"!=typeof n)throw new TypeError(n+" is not a function");var e=Date.now(),t=16+i-e;return t<0&&(t=0),i=e,setTimeout(function(){i=Date.now(),n(o())},t)},n.cancelAnimationFrame=function(n){clearTimeout(n)}}}(self);}
|
|
62
|
-
"
|
|
61
|
+
)) {!function(n){var e,t=Date.now(),o=function(){return n.performance&&"function"==typeof n.performance.now?n.performance.now():Date.now()-t};if("mozRequestAnimationFrame"in n?e="moz":"webkitRequestAnimationFrame"in n&&(e="webkit"),e)n.requestAnimationFrame=function(t){return n[e+"RequestAnimationFrame"](function(){t(o())})},n.cancelAnimationFrame=n[e+"CancelAnimationFrame"];else{var i=Date.now();n.requestAnimationFrame=function(n){if("function"!=typeof n)throw new TypeError(n+" is not a function");var e=Date.now(),t=16+i-e;return t<0&&(t=0),i=e,setTimeout(function(){i=Date.now(),n(o())},t)},n.cancelAnimationFrame=function(n){clearTimeout(n)}}}(self);}if (!("ResizeObserver"in self
|
|
62
|
+
)) {!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):(e="undefined"!=typeof globalThis?globalThis:e||self,t(e.ResizeObserver={}))}(this,function(e){"use strict";var t,n=[],r=function(){return n.some(function(e){return e.activeTargets.length>0})},i=function(){return n.some(function(e){return e.skippedTargets.length>0})},o="ResizeObserver loop completed with undelivered notifications.",s=function(){var e;"function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:o}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=o),window.dispatchEvent(e)};!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(t||(t={}));var c,a=function(e){return Object.freeze(e)},u=function(){function e(e,t){this.inlineSize=e,this.blockSize=t,a(this)}return e}(),f=function(){function e(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,a(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),h=function(e){return e instanceof SVGElement&&"getBBox"in e},d=function(e){if(h(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var i=e,o=i.offsetWidth,s=i.offsetHeight;return!(o||s||e.getClientRects().length)},v=function(e){var t,n;if(e instanceof Element)return!0;var r=null===(n=null===(t=e)||void 0===t?void 0:t.ownerDocument)||void 0===n?void 0:n.defaultView;return!!(r&&e instanceof r.Element)},l=function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},p="undefined"!=typeof window?window:{},b=new WeakMap,g=/auto|scroll/,w=/^tb|vertical/,E=/msie|trident/i.test(p.navigator&&p.navigator.userAgent),x=function(e){return parseFloat(e||"0")},y=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=!1),new u((n?t:e)||0,(n?e:t)||0)},z=a({devicePixelContentBoxSize:y(),borderBoxSize:y(),contentBoxSize:y(),contentRect:new f(0,0,0,0)}),T=function(e,t){if(void 0===t&&(t=!1),b.has(e)&&!t)return b.get(e);if(d(e))return b.set(e,z),z;var n=getComputedStyle(e),r=h(e)&&e.ownerSVGElement&&e.getBBox(),i=!E&&"border-box"===n.boxSizing,o=w.test(n.writingMode||""),s=!r&&g.test(n.overflowY||""),c=!r&&g.test(n.overflowX||""),u=r?0:x(n.paddingTop),v=r?0:x(n.paddingRight),l=r?0:x(n.paddingBottom),p=r?0:x(n.paddingLeft),T=r?0:x(n.borderTopWidth),m=r?0:x(n.borderRightWidth),O=r?0:x(n.borderBottomWidth),R=r?0:x(n.borderLeftWidth),S=p+v,B=u+l,C=R+m,k=T+O,N=c?e.offsetHeight-k-e.clientHeight:0,D=s?e.offsetWidth-C-e.clientWidth:0,M=i?S+C:0,_=i?B+k:0,I=r?r.width:x(n.width)-M-D,P=r?r.height:x(n.height)-_-N,F=I+S+D+C,L=P+B+N+k,W=a({devicePixelContentBoxSize:y(Math.round(I*devicePixelRatio),Math.round(P*devicePixelRatio),o),borderBoxSize:y(F,L,o),contentBoxSize:y(I,P,o),contentRect:new f(p,u,I,P)});return b.set(e,W),W},m=function(e,n,r){var i=T(e,r),o=i.borderBoxSize,s=i.contentBoxSize,c=i.devicePixelContentBoxSize;switch(n){case t.DEVICE_PIXEL_CONTENT_BOX:return c;case t.BORDER_BOX:return o;default:return s}},O=function(){function e(e){var t=T(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=a([t.borderBoxSize]),this.contentBoxSize=a([t.contentBoxSize]),this.devicePixelContentBoxSize=a([t.devicePixelContentBoxSize])}return e}(),R=function(e){if(d(e))return Infinity;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},S=function(){var e=Infinity,t=[];n.forEach(function o(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach(function i(t){var n=new O(t.target),i=R(t.target);r.push(n),t.lastReportedSize=m(t.target,t.observedBox),i<e&&(e=i)}),t.push(function o(){n.callback.call(n.observer,r,n.observer)}),n.activeTargets.splice(0,n.activeTargets.length)}});for(var r=0,i=t;r<i.length;r++){(0,i[r])()}return e},B=function(e){n.forEach(function t(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function r(t){t.isActive()&&(R(t.target)>e?n.activeTargets.push(t):n.skippedTargets.push(t))})})},C=function(){var e=0;for(B(e);r();)e=S(),B(e);return i()&&s(),e>0},k=[],N=function(){return k.splice(0).forEach(function(e){return e()})},D=function(e){if(!c){var t=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return N()}).observe(n,r),c=function(){n.textContent=""+(t?t--:t++)}}k.push(e),c()},M=function(e){D(function t(){requestAnimationFrame(e)})},_=0,I=function(){return!!_},P={attributes:!0,characterData:!0,childList:!0,subtree:!0},F=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],L=function(e){return void 0===e&&(e=0),Date.now()+e},W=!1,X=function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!W){W=!0;var n=L(e);M(function(){var r=!1;try{r=C()}finally{if(W=!1,e=n-L(),!I())return;r?t.run(1e3):e>0?t.run(e):t.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,P)};document.body?t():p.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),F.forEach(function(t){return p.addEventListener(t,e.listener,!0)}))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),F.forEach(function(t){return p.removeEventListener(t,e.listener,!0)}),this.stopped=!0)},e}(),A=new X,V=function(e){!_&&e>0&&A.start(),!(_+=e)&&A.stop()},q=function(e){return!h(e)&&!l(e)&&"inline"===getComputedStyle(e).display},j=function(){function e(e,n){this.target=e,this.observedBox=n||t.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e=m(this.target,this.observedBox,!0);return q(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},e}(),G=function(){function e(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t}return e}(),H=new WeakMap,J=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},U=function(){function e(){}return e.connect=function(e,t){var n=new G(e,t);H.set(e,n)},e.observe=function(e,t,r){var i=H.get(e),o=0===i.observationTargets.length;J(i.observationTargets,t)<0&&(o&&n.push(i),i.observationTargets.push(new j(t,r&&r.box)),V(1),A.schedule())},e.unobserve=function(e,t){var r=H.get(e),i=J(r.observationTargets,t),o=1===r.observationTargets.length;i>=0&&(o&&n.splice(n.indexOf(r),1),r.observationTargets.splice(i,1),V(-1))},e.disconnect=function(e){var t=this,n=H.get(e);n.observationTargets.slice().forEach(function(n){return t.unobserve(e,n.target)}),n.activeTargets.splice(0,n.activeTargets.length)},e}(),Y=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");U.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!v(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");U.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!v(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");U.unobserve(this,e)},e.prototype.disconnect=function(){U.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();e.ResizeObserver=Y,e.ResizeObserverEntry=O,e.ResizeObserverSize=u,Object.defineProperty(e,"__esModule",{value:!0})}),self.ResizeObserverEntry=ResizeObserver.ResizeObserverEntry,self.ResizeObserver=ResizeObserver.ResizeObserver;}})('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
|
package/cl.adobe.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
a.m.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)},
|
|
3
|
-
this.f=null);this.m=null;this.a=""}id(){return"adobe"}};_.x("clpp.adobe.AdobeAnalyticsPlugin",
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var QW=function(a){a.f=new _.Kt;a.f.on(a.m,_.tg,()=>OW(a));a.f.on(a.m,_.sg,()=>{s.Media.play(a.a,a.m.getPosition())});a.f.on(a.m,_.ue,()=>PW(a));a.f.on(a.m,_.Qf,b=>{b=b.detail;switch(b.currentState){case 3:a.a.length||PW(a);s.Media.play(a.a,a.m.getPosition());break;case 4:case 2:OW(a);break;case 5:case _.zs:case _.ps:a.g.info(`Close session for ${a.a} `+`in player state ${b.currentState}.`),OW(a),s.Media.close(a.a),a.a=""}})},OW=function(a){s.Media.stop(a.a,a.m.getPosition())},PW=function(a){{const b=
|
|
2
|
+
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)},RW=class extends _.Ov{constructor(){super();this.m=this.f=null;this.a="";this.g=new _.T("clpp.adobe.AdobePlugin")}onPlayerCreated(a){var b=a.getConfiguration().adobe;(b=!b||!1!==b.enabled)?window.s&&s.Media?(this.m=a,QW(this)):this.g.warn("Adobe API not available."):this.g.debug("Adobe plugin is disabled.")}onPlayerWillDestroy(){this.f&&(this.f.release(),
|
|
3
|
+
this.f=null);this.m=null;this.a=""}id(){return"adobe"}};_.x("clpp.adobe.AdobeAnalyticsPlugin",RW);RW.Id="adobe";_.Qn(new class{create(){return new RW}});};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 NW=class extends _.Ov{constructor(){super();this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.St(()=>{this.m.play().catch(()=>{})});this.h=new _.Kt}onPlayerCreated(a){this.m=a;this.a=a.getSurface().getMedia()}onContentWillLoad(){this.a&&(this.h.on(this.a,"webkitplaybacktargetavailabilitychanged",this.w.bind(this)),this.h.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.A.bind(this)))}onPlayerWillRelease(){this.o.stop();this.h.release()}id(){return"airplay"}w(a){switch(a.availability){case "available":this.f=
|
|
2
|
+
!0;break;case "not-available":this.f=!1}this.m.trigger(new _.H(_.tc,{canCast:this.f}))}A(){const a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.sc:_.qc;if(this.l||!this.m.isPaused()||3===this.m.getState())this.l?this.m.play().catch(()=>{}):this.o.la(.01);this.m.trigger(new _.H(a))}ya(){return this.j}Ic(){return this.f}Vi(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())}};_.x("clpp.airplay.AirPlayPlugin",NW);NW.prototype.showCastMenu=NW.prototype.Vi;
|
|
3
|
+
NW.prototype.canCast=NW.prototype.Ic;NW.prototype.isCasting=NW.prototype.ya;NW.Id="airplay";_.Qn(new class{create(){return new NW}});};f.call(g, window);
|
package/cl.broadpeak.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
!window.GenericPlayerApi},
|
|
3
|
-
(a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},
|
|
4
|
-
break;case 3:this.h?c.notifyResume():(c.notifyFirstImage(),this.h=!0);break;case 4:c.notifyPause()}}l(){const a=1E3*this.m.getPosition();this.f.notifySeek(a)}release(){this.a&&(_.
|
|
5
|
-
this.f=new
|
|
6
|
-
_.x("clpp.broadpeak.BroadpeakPlugin",
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var GW=function(a){class b extends GenericPlayerApi{constructor(c){super();this.m=c;this.a=_.mj()}getPlayerName(){return _.ra}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)},HW=function(){return!window.SmartLib||
|
|
2
|
+
!window.GenericPlayerApi},IW=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===_.Tf&&a.h.setUUID(b))},JW=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,_.Xd,a.w.bind(a));a.l=GW(a.m);a.a.attachPlayer(a.l)},KW=function(a,b){_.Xh(a.o);a.f&&
|
|
3
|
+
(a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},LW=class{constructor(a,b){this.m=a;this.f=b;this.a=new _.Kt;this.h=!1}init(){const a=this.m,b=this.a;b.on(a,_.Qf,this.o.bind(this));b.on(a,_.Mc,this.j.bind(this));b.on(a,"seek",this.l.bind(this))}j(a){a=a.detail;typeof a.bandwidth===_.r&&this.f.notifyLayerSwitch(a.bandwidth/1E3)}o(a){const b=this.m,c=this.f;a=a.detail;const d=a.currentState;2===a.previousState&&c.notifyStallEnd(!b.isPaused());switch(d){case 2:c.notifyStallStart();
|
|
4
|
+
break;case 3:this.h?c.notifyResume():(c.notifyFirstImage(),this.h=!0);break;case 4:c.notifyPause()}}l(){const a=1E3*this.m.getPosition();this.f.notifySeek(a)}release(){this.a&&(_.Xh(this.a),this.a=null)}};var MW=class extends _.Ov{constructor(){super();this.l=this.f=this.a=this.h=this.m=null;this.o=new _.Kt;this.j=!1}onPlayerCreated(a){this.m=a}onContentWillLoad(a,b){const c=a.getConfiguration().broadpeak;if(c){if(HW())return a.onError(new _.I(1,9,11E3));this.j=!0;IW(this,c);JW(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}));KW(this,void 0)}else b.url=d.getURL(),
|
|
5
|
+
this.f=new LW(this.m,this.l),this.f.init()})}}onContentLoaded(){!1!==this.j&&this.a.precacheEnded()}w(a){a=a.detail;if(7003===a.code)KW(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.D)switch(a.category){case 3:KW(this,SmartLib.BPDecodingError);break;case 1:KW(this,SmartLib.BPNetworkingError);break;case 6:KW(this,SmartLib.BPAccessRightError);break;default:KW(this,SmartLib.BPUnspecifiedError)}}onPlayerWillRelease(){HW()||KW(this,SmartLib.BPSessionEndsNormally);this.j=!1}id(){return"broadpeak"}};
|
|
6
|
+
_.x("clpp.broadpeak.BroadpeakPlugin",MW);MW.isSdkMissing=HW;MW.Id="broadpeak";_.Qn(new class{create(){return new MW}});};f.call(g, window);
|