@castlabs/prestoplay 6.17.1 → 6.19.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 +55 -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 +115 -114
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +575 -565
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +77 -74
- package/cjs/cl.externs.js +175 -293
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +70 -69
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +29 -29
- package/cjs/cl.ima.js +24 -24
- package/cjs/cl.mse.js +315 -314
- 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 +16 -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 +71 -71
- package/cjs/cl.ttml.js +29 -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 +90 -89
- package/cl.conviva.js +27 -27
- package/cl.core.js +473 -466
- package/cl.crypto.js +9 -9
- package/cl.dash.js +72 -70
- package/cl.externs.js +172 -294
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +74 -72
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +17 -17
- package/cl.mse.js +276 -273
- 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.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/clpp.styles.css +14 -0
- package/package.json +2 -2
- package/typings.d.ts +406 -377
package/cl.vtt.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
a[1].match(/\d+:\d+:\d+/)&&(b+=`${a[0].match(/\w+/)}\n`,++c);if(a[c].match(/\d+:\d+:\d+/)){const d=a[1].match(/(\d+):(\d+):(\d+)(?:,(\d+))?\s*--?>\s*(\d+):(\d+):(\d+)(?:,(\d+))?/);if(d)b+=`${d[1]}:${d[2]}:${d[3]}.${d[4]} --> `,b+=`${d[5]}:${d[6]}:${d[7]}.${d[8]}\n`,++c;else return""}else return"";a[c]&&(b+=`${a[c]}\n\n`);return b},
|
|
3
|
-
c+60*b+3600*(Number(a[1])||0)},
|
|
4
|
-
_.
|
|
5
|
-
b," The region will be ignored."),null)},
|
|
6
|
-
"WEBVTT\n\n";for(const c of a)b+=
|
|
7
|
-
8589934592;a=b.periodStart+e/9E4-a}}else this.a.streaming.relativeTextTimestamp&&null!==b.segmentStart&&(a=b.segmentStart);b=[];for(var f of c)if(/^region/.test(f.toLowerCase())){e=new _.
|
|
8
|
-
Number(h[1]),k.regionAnchorY=Number(h[2]);else if(h=/^viewportanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(l))k.viewportAnchorX=Number(h[1]),k.viewportAnchorY=Number(h[2]);else if(/^scroll:up$/.exec(l))k.scroll="up";else{k=!1;break a}k=!0}k||_.
|
|
9
|
-
n.split("\n");h=a;c=b;if(1===l.length&&!l[0]||/^NOTE($|[ \t])/.test(l[0])||"STYLE"===l[0]){c=null;break a}e=null;l[0].includes("--\x3e")||(e=l[0],l.splice(0,1));d=new _.
|
|
10
|
-
new _.
|
|
11
|
-
_.
|
|
12
|
-
b.periodStart+a/this.a)):this.
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var Ku=" The setting will be ignored.",Lu="VTT parser encountered an invalid VTT setting: ",Mu="application/x-subrip",Nu="text/srt",Ou='text/vtt; codecs\x3d"vtt"',Pu='text/vtt; codecs\x3d"wvtt"',Qu=function(a){return a.a===a.f.length?null:(a=_.Ni(a,/[^ \t\n]*/gm))?a[0]:null},Ru=function(a){_.Ni(a,/[ \t]+/gm)},Su=function(a){let b="";for(a=a.split(/\n/);3<a.length;){for(var c=3;c<a.length;++c)a[2]+=`\n${a[c]}`;a.splice(3,a.length-3)}if(3!==a.length)return"";c=0;!a[0].match(/\d+:\d+:\d+/)&&
|
|
2
|
+
a[1].match(/\d+:\d+:\d+/)&&(b+=`${a[0].match(/\w+/)}\n`,++c);if(a[c].match(/\d+:\d+:\d+/)){const d=a[1].match(/(\d+):(\d+):(\d+)(?:,(\d+))?\s*--?>\s*(\d+):(\d+):(\d+)(?:,(\d+))?/);if(d)b+=`${d[1]}:${d[2]}:${d[3]}.${d[4]} --> `,b+=`${d[5]}:${d[6]}:${d[7]}.${d[8]}\n`,++c;else return""}else return"";a[c]&&(b+=`${a[c]}\n\n`);return b},Tu=function(a){a=_.Ni(a,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g);if(null==a)return null;const b=Number(a[2]),c=Number(a[3]);return 59<b||59<c?null:Number(a[4])/1E3+
|
|
3
|
+
c+60*b+3600*(Number(a[1])||0)},Vu=function(a,b,c){let d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"===b?a.textAlign=_.Es:a.textAlign=_.Ks[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"===d[1]?_.kg:_.lg;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===_.je||b===_.Lf?_.je:b===_.le||b===_.Td?
|
|
4
|
+
_.le:_.cd);else if(d=/^region:(.*)$/.exec(b)){if(b=Uu(c,d[1]))a.region=b}else{a:{if(c=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=1,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.Ls[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.Gs,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.Ls[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},Uu=function(a,b){a=a.filter(c=>c.id===b);return a.length?a[0]:(_.B("VTT parser could not find a region with id: ",
|
|
5
|
+
b," The region will be ignored."),null)},Xu=function(a,b,c){let d,e,f;(new _.Pl).N("payl",_.Kl(g=>{d=_.si(g)})).N("iden",_.Kl(g=>{e=_.si(g)})).N("sttg",_.Kl(g=>{f=_.si(g)})).parse(a);return d?Wu(d,e,f,b,c):null},Wu=function(a,b,c,d,e){a=new _.Js(d,e,a,_.vg);b&&(a.id=b);if(c)for(b=new _.Oi(c),c=Qu(b);c;)Vu(a,c,[])||_.B(Lu,c,Ku),Ru(b),c=Qu(b);return a},Yu=class{a(a){a=_.si(a);a=a.replace(/\r+/g,"");a=a.replace(/^\s+|\s+$/g,"");a=a.replace(/<[a-zA-Z\\/][^>]*>/g,"");a=a.split("\n\n");let b="";if(0<a.length){b+=
|
|
6
|
+
"WEBVTT\n\n";for(const c of a)b+=Su(c)}return _.wi(b)}},Zu=class{create(){return new Yu}probe(a,b){return(a===Nu||a===Mu)&&b===_.Uf}};var $u=class{constructor(a){this.a=a}parseInit(){}parseMedia(a,b){a=_.si(a);a=a.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");var c=a.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(c[0]))throw new _.G(_.E,2,2E3);a=b.periodStart;if(c[0].includes("X-TIMESTAMP-MAP")){var d=c[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),e=c[0].match(/MPEGTS:(\d+)/m);if(d&&e){a=Tu(new _.Oi(d[1]));if(null==a)throw new _.G(_.E,2,2E3);e=Number(e[1]);for(d=b.segmentStart;95443.7176888889<=d;)d-=95443.7176888889,e+=
|
|
7
|
+
8589934592;a=b.periodStart+e/9E4-a}}else this.a.streaming.relativeTextTimestamp&&null!==b.segmentStart&&(a=b.segmentStart);b=[];for(var f of c)if(/^region/.test(f.toLowerCase())){e=new _.Oi(f.replace(/\n/g," "));d=new _.Os;Qu(e);Ru(e);for(var g=Qu(e);g;){a:{var h;var k=d;var l=g;if(h=/^id:(.*)$/.exec(l))k.id=h[1];else if(h=/^width:(\d{1,2}|100)%$/.exec(l))k.width=Number(h[1]);else if(h=/^lines:(\d+)$/.exec(l))k.height=Number(h[1]),k.heightUnits=2;else if(h=/^regionanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(l))k.regionAnchorX=
|
|
8
|
+
Number(h[1]),k.regionAnchorY=Number(h[2]);else if(h=/^viewportanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(l))k.viewportAnchorX=Number(h[1]),k.viewportAnchorY=Number(h[2]);else if(/^scroll:up$/.exec(l))k.scroll="up";else{k=!1;break a}k=!0}k||_.B("VTT parser encountered an invalid VTTRegion setting: ",g,Ku);Ru(e);g=Qu(e)}e=d;b.push(e)}f=[];for(var m of c)if(/^style/.test(m.toLowerCase())){e=m.replace(/^style/i,"").replace(/\n/g," ");d=/[^{}]+{[^{}]*}/g;do(g=d.exec(e))&&f.push(g[0]);while(g)}m=[];for(const n of c)if(n.includes("--\x3e")){a:{l=
|
|
9
|
+
n.split("\n");h=a;c=b;if(1===l.length&&!l[0]||/^NOTE($|[ \t])/.test(l[0])||"STYLE"===l[0]){c=null;break a}e=null;l[0].includes("--\x3e")||(e=l[0],l.splice(0,1));d=new _.Oi(l[0]);g=Tu(d);const q=_.Ni(d,/[ \t]+--\x3e[ \t]+/g);k=Tu(d);if(null==g||null==q||null==k)throw new _.G(_.E,2,2001);g+=h;k+=h;l=l.slice(1).join("\n").trim();g=new _.Js(g,k,l,_.vg);e&&(g.id=e);Ru(d);for(k=Qu(d);k;)Vu(g,k,c)||_.B(Lu,k,Ku),Ru(d),k=Qu(d);null!=e&&(g.id=e);c=g}c&&m.push(c)}return{cues:m,styles:f}}};var av=class extends $u{parseMedia(a,b){return super.parseMedia((new Yu).a(a),b)}};var bv=class{constructor(){this.a=null;this.g=new _.R("clpp.vtt.mp4")}parseInit(a){let b=!1;(new _.Pl).N(_.Be,_.Il).N(_.Yf,_.Il).N(_.we,_.Il).ca("mdhd",c=>{0===c.version?(c.reader.skip(4),c.reader.skip(4),this.a=_.O(c.reader),c.reader.skip(4)):(c.reader.skip(8),c.reader.skip(8),this.a=_.O(c.reader),c.reader.skip(8));c.reader.skip(4)}).N(_.Ae,_.Il).N(_.Of,_.Il).ca(_.Qf,_.Jl).N("wvtt",()=>{b=!0}).parse(a);if(!this.a)throw new _.G(_.E,2,2008);if(!b)throw new _.G(_.E,2,2008);}parseMedia(a,b){if(!this.a)throw this.g.error("No init segment for MP4+VTT!"),
|
|
10
|
+
new _.G(_.E,2,2008);let c=0,d=[],e;const f=[];let g=!1,h=!1,k=!1,l=null;(new _.Pl).N("moof",_.Il).N("traf",_.Il).ca("tfdt",q=>{g=!0;c=0===q.version?_.O(q.reader):_.Dl(q.reader)}).ca("tfhd",q=>{var u=q.flags;q=q.reader;q.skip(4);u&1&&q.skip(8);u&2&&q.skip(4);l=u&8?_.O(q):null}).ca("trun",q=>{h=!0;{var u=q.version,v=q.flags;q=q.reader;const y=_.O(q);v&1&&q.skip(4);v&4&&q.skip(4);const A=[];for(let D=0;D<y;D++){const M={duration:null,sampleSize:null,Ke:null};v&256&&(M.duration=_.O(q));v&512&&(M.sampleSize=
|
|
11
|
+
_.O(q));v&1024&&q.skip(4);v&2048&&(M.Ke=0===u?_.O(q):_.Cl(q));A.push(M)}d=A}}).N(_.ve,_.Kl(q=>{k=!0;e=q})).parse(a);if(!k&&!g&&!h)throw new _.G(_.E,2,2008);a=c;var m=new DataView(e.buffer,e.byteOffset,e.byteLength);m=new _.Bm(m,!1);for(const q of d){const u=q.duration||l,v=q.Ke?c+q.Ke:a;a=v+(u||0);let y=0;do{const A=_.O(m);y+=A;var n=_.O(m);n=_.Hl(n);let D=null;"vttc"===n?8<A&&(D=_.Fl(m,A-8)):("vtte"!==n&&this.g.error("Unknown box "+n+"! Skipping!"),m.skip(A-8));u?D&&f.push(Xu(D,b.periodStart+v/this.a,
|
|
12
|
+
b.periodStart+a/this.a)):this.g.error("WVTT sample duration unknown, and no default found!")}while(q.sampleSize&&y<q.sampleSize)}return{cues:f.filter(_.Nh),styles:[]}}};_.x("clpp.vtt.VttComponent",class extends _.au{constructor(){super();this.j=new Zu}f(){_.os(_.Uf,$u);_.os(Ou,$u);_.os(Pu,$u);_.os(_.Ec,bv);_.os(Nu,av);_.os(Mu,av);_.Gj.push(this.j)}a(){_.qs(_.Uf);_.qs(Ou);_.qs(Pu);_.qs(_.Ec);_.qs(Nu);_.qs(Mu);_.Ij(this.j)}id(){return"subtitles-vtt"}});};f.call(g, window);
|
package/cl.youbora.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
9100)),!1;"6.8.
|
|
3
|
-
a.code?"ad error":_.
|
|
4
|
-
d,e)}getIsLive(){return this.m.isLive()}getResource(){const c=this.m.getLoadedSource();return c&&c.url}getBitrate(){return this.l().streamBandwidth}getThroughput(){return this.l().estimatedBandwidth}getPlayrate(){return this.m.getPlaybackRate()}getFramesPerSecond(){var c=this.m.getTrackManager();return c&&(c=c.
|
|
5
|
-
youbora.Util.logAllEvents(this.m),this.a.on(this.m,_.
|
|
6
|
-
this.f();break;case _.
|
|
7
|
-
(c=c.keySystem,(c=c.startsWith(_.yd)?"Widevine":c.startsWith(_.ud)?"FairPlay":c.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":c.startsWith(_.
|
|
8
|
-
c);c=c.adsTimeline;this.w=!!c&&c.
|
|
9
|
-
this.a.getTitle()}getProvider(){return this.a&&this.a.getAdvertiserName()}getCreativeId(){return this.a&&this.a.getCreativeId()}getPosition(){const c=youbora.Constants.AdPosition;let d=null;if(this.a)switch(this.a.
|
|
10
|
-
this.j.getCuePoints().length}getGivenBreaks(){return this.getExpectedBreaks()}getExpectedAds(){return this.a&&this.a.
|
|
11
|
-
this.f&&(this.f.on(this.m,_.
|
|
12
|
-
this.f.on(this.m,_.
|
|
13
|
-
this.fireBufferBegin()}w(){this.l&&(this.
|
|
14
|
-
c&&c.fireStop()}}H(c){(c=c.detail)&&10003===c.code&&
|
|
15
|
-
a.youbora;void 0===c[
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var Cu="clpp.npaw.YouboraPlugin",Du="content.isLive",Eu=function(a,b){if(b.namespace()===_.kd)return a.g.info("Youbora does not report when casting."),!1;const c=b.getConfiguration().youbora;if(!_.Wg(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"),b.onError(new _.G(1,9,9101)),!1;if(_.z(window.youbora))return a.g.warn("Youbora SDK not found."),b.onError(new _.G(1,9,
|
|
2
|
+
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 _.G(1,9,9102)));return!0},Fu=a=>(a=a.getConfiguration().youbora)&&a.errorFilter?a.errorFilter:b=>({code:`${b.code}`,message:b.message,severity:b.severity}),Gu=(a,b,c,d)=>{b=Fu(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===
|
|
3
|
+
a.code?"ad error":_.Vd;b.severity===_.E?(d.fireFatalError(b.code,b.message,b.metadata),c.debug(`Reporting "fatal ${a}" to Youbora`,b.code,b)):(d.fireError(b.code,b.message,b.metadata),c.debug(`Reporting "${a}" to Youbora`,b.code,b));return b};var Hu=a=>{class b extends youbora.Adapter{constructor(c){super(c);this.m=c;this.a=new _.Bs;this.g=new _.R("clpp.npaw.YouboraAdapter");this.h=this.w=!1;this.registerListeners()}getPlayhead(){return this.getIsLive()?-1:this.m.getPosition()}getDuration(){return this.m.getDuration()}getRendition(){let c,d,e;var f=this.m.getTrackManager();f&&(f=f.ma())&&(c=f.width,d=f.height,e=f.bandwidth);c&&d&&e||(f=this.l(),c=c||f.width,d=d||f.height,e=e||f.streamBandwidth);return youbora.Util.buildRenditionString(c,
|
|
4
|
+
d,e)}getIsLive(){return this.m.isLive()}getResource(){const c=this.m.getLoadedSource();return c&&c.url}getBitrate(){return this.l().streamBandwidth}getThroughput(){return this.l().estimatedBandwidth}getPlayrate(){return this.m.getPlaybackRate()}getFramesPerSecond(){var c=this.m.getTrackManager();return c&&(c=c.La())?c.frameRate:null}getPlayerName(){return _.ra}getVersion(){return"6.19.0-castlabsadapter-js"}getPlayerVersion(){return _.da}registerListeners(){this.m&&this.a&&(this.g.debug("registering listeners"),
|
|
5
|
+
youbora.Util.logAllEvents(this.m),this.a.on(this.m,_.Mf,this.I.bind(this)),this.a.on(this.m,_.Vd,this.F.bind(this)),this.a.on(this.m,_.gg,this.H.bind(this)),this.a.on(this.m,_.fg,this.G.bind(this)),this.a.on(this.m,_.wc,this.B.bind(this)),this.a.on(this.m,_.Zc,this.C.bind(this)))}unregisterListeners(){this.g.debug(_.Pb);_.rh(this.a)}dispose(){super.dispose()}l(){return this.m.getStats()||_.Mn()}o(){return!!this.m.getConfiguration().autoplay}I(c){c=c.detail;this.j("state change",c);if(c)switch(c.currentState){case _.$n:this.o()&&
|
|
6
|
+
this.f();break;case _.bo:this.f();this.A();this.fireResume();this.fireBufferEnd();break;case _.ao:this.o()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.Zn:this.fireBufferEnd();this.fireStop();break;case _.Rn:this.fireBufferEnd();this.w&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.Un:this.fireBufferBegin();break;default:this.g.debug("Unhandled state",c)}}f(){this.plugin.isInitiated||(this.h=!1,this.fireInit())}A(){var c=this.m.getDrmInfo();c&&
|
|
7
|
+
(c=c.keySystem,(c=c.startsWith(_.yd)?"Widevine":c.startsWith(_.ud)?"FairPlay":c.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":c.startsWith(_.Ne)?"ClearKey":c.startsWith(_.td)?"Primetime":c)&&this.plugin.setOptions({"content.drm":c}));this.fireJoin()}F(c){!(c=c.detail)||this.h||10003===c.code&&this.plugin.getAdsAdapter()||(c=Gu(c,this.m,this.g,this))&&c.severity===_.E&&(this.h=!0)}H(){this.m.isEnded()||(this.j(_.Ef),this.f(),this.fireSeekBegin())}G(){this.j(_.Df);this.fireSeekEnd()}B(c){this.g.debug("adsTimeline",
|
|
8
|
+
c);c=c.adsTimeline;this.w=!!c&&c.Db()}C(c){this.g.debug("Casting",c);this.fireCasted()}j(c,...d){this.g.debug(`Reporting "${c}" event to Youbora`,...d)}}return new b(a)};var Iu=a=>{class b extends youbora.Adapter{constructor(c){super(c);this.m=c;this.j=this.a=null;this.f=new _.Bs;this.g=new _.R("clpp.npaw.YouboraAdsAdapter");this.registerListeners();this.l=!1}getDuration(){return this.a&&this.a.getDuration()}getRendition(){let c=null;this.a&&(c=youbora.Util.buildRenditionString(this.a.lb(),this.a.kb(),this.a.Za()));return c}getBitrate(){return this.a&&this.a.Za()}getPlayhead(){const c=this.m.getAdsManager();return c&&c.getPosition()}getResource(){return this.a&&this.a.getMediaUrl()}getTitle(){return this.a&&
|
|
9
|
+
this.a.getTitle()}getProvider(){return this.a&&this.a.getAdvertiserName()}getCreativeId(){return this.a&&this.a.getCreativeId()}getPosition(){const c=youbora.Constants.AdPosition;let d=null;if(this.a)switch(this.a.Ua()){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}getIsSkippable(){return this.a&&-1!==this.a.getSkipTimeOffset()}getAudioEnabled(){const c=this.m.getAdsManager();return c&&0<c.getVolume()}getExpectedBreaks(){return this.j&&
|
|
10
|
+
this.j.getCuePoints().length}getGivenBreaks(){return this.getExpectedBreaks()}getExpectedAds(){return this.a&&this.a.nb()}getGivenAds(){return this.getExpectedAds()}getBreaksTime(){return this.j&&this.j.getCuePoints().map(c=>-1===c?this.m.getDuration():c)}getIsFullscreen(){return this.m.getSurface().isFullscreen()}getIsVisible(){var c=this.m.getSurface().getContainer();c=youbora.Util.calculateAdViewability(c);this.g.debug("is container visible",c);return c}getPlayerName(){return _.ra}getVersion(){return"6.19.0-castlabsadsadapter-js"}getPlayerVersion(){return _.da}registerListeners(){this.m&&
|
|
11
|
+
this.f&&(this.f.on(this.m,_.wc,this.M.bind(this)),this.f.on(this.m,_.sc,this.L.bind(this)),this.f.on(this.m,_.oc,this.I.bind(this)),this.f.on(this.m,_.qc,this.J.bind(this)),this.f.on(this.m,_.gc,this.G.bind(this)),this.f.on(this.m,_.hc,this.o.bind(this,1)),this.f.on(this.m,_.nc,this.o.bind(this,2)),this.f.on(this.m,_.uc,this.o.bind(this,3)),this.f.on(this.m,_.fc,this.F.bind(this)),this.f.on(this.m,_.rc,this.K.bind(this)),this.f.on(this.m,_.Vd,this.H.bind(this)),this.f.on(this.m,_.cc,this.A.bind(this)),
|
|
12
|
+
this.f.on(this.m,_.dc,this.B.bind(this)),this.f.on(this.m,_.ec,this.C.bind(this)),this.f.on(this.m,_.pc,this.w.bind(this)))}unregisterListeners(){_.rh(this.f)}dispose(){super.dispose()}M(c){this.g.debug("ad timeline changed",c);this.j=c.adsTimeline}L(c){this.a=c.ad;this.h("ad start",this.a);this.fireStart();this.fireJoin()}G(){this.h("ad ended");this.fireStop()}I(){this.h("ad pause");this.w();this.firePause()}J(){this.h("ad resume");this.w();this.fireResume()}C(){this.l=!0;this.h("ad buffering started");
|
|
13
|
+
this.fireBufferBegin()}w(){this.l&&(this.h("ad buffering ended"),this.l=!1,this.fireBufferEnd())}o(c){this.h("ad quartile",c);this.fireQuartile(c)}F(){this.h("ad clicked");const c=this.a&&this.a.xb();this.g.debug("ad click through url: ",c);this.fireClick(c)}K(){this.h("ad skipped");this.fireSkip()}A(c){this.a=c.ad;this.h("ad break start",this.a);this.fireBreakStart()}B(){this.h("ad break stop");this.fireBreakStop();if(this.getPosition()===youbora.Constants.AdPosition.Postroll){const c=this.plugin.getAdapter();
|
|
14
|
+
c&&c.fireStop()}}H(c){(c=c.detail)&&10003===c.code&&Gu(c,this.m,this.g,this)}h(c,...d){this.g.debug(`Reporting "${c}" event to Youbora`,...d)}}return new b(a)};var Ju=class extends _.Bu{constructor(){super();this.a=null;this.g=new _.R(Cu);this.m=null}Fe(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(Hu(this.m)),this.a.setAdsAdapter(Iu(this.m))}getAdapter(){return this.a&&this.a.getAdapter()}getAdsAdapter(){return this.a&&this.a.getAdsAdapter()}onPlayerCreated(a){this.m=a;Eu(this,a)&&(a=a.getConfiguration().youbora,this.Fe(new youbora.Plugin(a)))}onContentWillLoad(a,b){if(Eu(this,a)){a=a.getConfiguration();var c=
|
|
15
|
+
a.youbora;void 0===c[Du]&&(c[Du]=b.isLive);void 0===c["content.title"]&&(c["content.title"]=b.name);void 0===c.viewerId&&(c.viewerId=a.viewerId);this.a||this.Fe(new youbora.Plugin(c));this.a.setOptions(c)}}onPlayerWillRelease(){}onPlayerWillDestroy(){}id(){return"youbora"}};_.x(Cu,Ju);Ju.prototype.getAdsAdapter=Ju.prototype.getAdsAdapter;Ju.prototype.getAdapter=Ju.prototype.getAdapter;Ju.prototype.setYouboraPlugin=Ju.prototype.Fe;Ju.Id="youbora";_.rq(new class{create(){return new Ju}});};f.call(g, window);
|
package/clpp.styles.css
CHANGED
|
@@ -150,6 +150,20 @@
|
|
|
150
150
|
background-color: rgba(0, 0, 0, 1);
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
+
.clpp-container .secondary {
|
|
154
|
+
position: absolute;
|
|
155
|
+
width: 100%;
|
|
156
|
+
height: 100%;
|
|
157
|
+
}
|
|
158
|
+
.clpp-container .secondary {
|
|
159
|
+
z-index: 0;
|
|
160
|
+
opacity: 0;
|
|
161
|
+
}
|
|
162
|
+
.clpp-container .secondary {
|
|
163
|
+
z-index: 1;
|
|
164
|
+
opacity: 1;
|
|
165
|
+
}
|
|
166
|
+
|
|
153
167
|
.clpp-mc-playlist {
|
|
154
168
|
position: absolute;
|
|
155
169
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@castlabs/prestoplay",
|
|
3
3
|
"description": "PRESTOplay Video Player",
|
|
4
|
-
"version": "6.
|
|
4
|
+
"version": "6.19.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/castlabs/prestoplay-web.git"
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@broadpeak/smartlib-all-compatibility": "5.0.1-4c69e21",
|
|
27
27
|
"@broadpeak/smartlib-analytics": "5.0.1-4c69e21",
|
|
28
28
|
"mux.js": "^5.14.1",
|
|
29
|
-
"youboralib": "6.8.
|
|
29
|
+
"youboralib": "6.8.59"
|
|
30
30
|
},
|
|
31
31
|
"peerDependenciesMeta": {
|
|
32
32
|
"mux.js": {
|