@castlabs/prestoplay 6.30.0 → 6.31.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 +247 -179
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +19 -7
- package/cjs/cl.cast.js +120 -120
- package/cjs/cl.conviva.js +31 -31
- package/cjs/cl.core.js +567 -566
- package/cjs/cl.crypto.js +10 -10
- package/cjs/cl.dash.js +95 -92
- package/cjs/cl.externs.js +224 -40
- package/cjs/cl.freewheel.js +26 -25
- package/cjs/cl.hls.js +79 -78
- package/cjs/cl.hlssmpte.js +4 -4
- package/cjs/cl.htmlcue.js +19 -19
- package/cjs/cl.ima.js +26 -25
- package/cjs/cl.mediatailor.js +3 -3
- package/cjs/cl.mse.js +352 -350
- package/cjs/cl.muxdata.js +13 -13
- package/cjs/cl.onboard.js +2 -2
- package/cjs/cl.persistent.js +13 -13
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.simid.js +10 -10
- package/cjs/cl.smooth.js +71 -71
- package/cjs/cl.thumbnails.js +16 -16
- package/cjs/cl.tizen.js +72 -72
- package/cjs/cl.ttml.js +15 -15
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +11 -11
- package/cjs/cl.vr.js +12 -12
- package/cjs/cl.vtt.js +12 -12
- package/cjs/cl.yospace.js +4 -4
- package/cjs/cl.youbora.js +35 -35
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +14 -6
- package/cl.cast.js +99 -98
- package/cl.conviva.js +26 -26
- package/cl.core.js +413 -412
- package/cl.crypto.js +8 -8
- package/cl.dash.js +87 -84
- package/cl.externs.js +225 -37
- package/cl.freewheel.js +20 -19
- package/cl.hls.js +76 -76
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +20 -19
- package/cl.mediatailor.js +2 -2
- package/cl.mse.js +299 -300
- package/cl.muxdata.js +12 -12
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +10 -10
- package/cl.playlist.js +5 -5
- package/cl.simid.js +14 -14
- package/cl.smooth.js +62 -60
- package/cl.thumbnails.js +17 -17
- package/cl.tizen.js +55 -55
- 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.yospace.js +3 -3
- package/cl.youbora.js +31 -31
- package/package.json +8 -7
- package/typings.d.ts +85 -61
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
|
-
_.ne:_.Xc);else if(d=/^region:(.*)$/.exec(b)){if(b=
|
|
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 _.kr(f.replace(/\n/g," "));d=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||_.C("VTT parser encountered an invalid VTTRegion setting: ",g,
|
|
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 _.kr(l[0]);g=
|
|
10
|
-
new _.I(_.D,2,2008);let c=0,d=[],e;const f=[];let g=!1,h=!1,k=!1,l=null;(new _.ip).
|
|
11
|
-
_.N(p));v&1024&&p.skip(4);v&2048&&(B.
|
|
12
|
-
b.periodStart+a/this.a)):this.g.error("WVTT sample duration unknown, and no default found!")}while(p.sampleSize&&y<p.sampleSize)}return{cues:f.filter(_.
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var vw=" The setting will be ignored.",ww="VTT parser encountered an invalid VTT setting: ",xw="application/x-subrip",yw="text/srt",zw='text/vtt; codecs\x3d"vtt"',Aw='text/vtt; codecs\x3d"wvtt"',Bw=function(a){return a.a===a.f.length?null:(a=_.jr(a,/[^ \t\n]*/gm))?a[0]:null},Cw=function(a){_.jr(a,/[ \t]+/gm)},Dw=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},Ew=function(a){a=_.jr(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)},Gw=function(a,b,c){let d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"===b?a.textAlign=_.ku:a.textAlign=_.qu[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"===d[1]?_.wg:_.xg;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===_.me||b===_.Pf?_.me:b===_.ne||b===_.Vd?
|
|
4
|
+
_.ne:_.Xc);else if(d=/^region:(.*)$/.exec(b)){if(b=Fw(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=_.ru[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.mu,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.ru[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},Fw=function(a,b){a=a.filter(c=>c.id===b);return a.length?a[0]:(_.C("VTT parser could not find a region with id: ",
|
|
5
|
+
b," The region will be ignored."),null)},Iw=function(a,b,c){let d,e,f;(new _.ip).O("payl",_.dp(g=>{d=_.ni(g)})).O("iden",_.dp(g=>{e=_.ni(g)})).O("sttg",_.dp(g=>{f=_.ni(g)})).parse(a);return d?Hw(d,e,f,b,c):null},Hw=function(a,b,c,d,e){a=new _.pu(d,e,a,_.Eg);b&&(a.id=b);if(c)for(b=new _.kr(c),c=Bw(b);c;)Gw(a,c,[])||_.C(ww,c,vw),Cw(b),c=Bw(b);return a},Jw=class{a(a){a=_.ni(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+=Dw(c)}return _.ri(b)}},Kw=class{create(){return new Jw}probe(a,b){return(a===yw||a===xw)&&b===_.Zf}};var Lw=class{constructor(a){this.a=a}parseInit(){}parseMedia(a,b){a=_.ni(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 _.I(_.D,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=Ew(new _.kr(d[1]));if(null==a)throw new _.I(_.D,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 _.kr(f.replace(/\n/g," "));d=new _.uu;Bw(e);Cw(e);for(var g=Bw(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||_.C("VTT parser encountered an invalid VTTRegion setting: ",g,vw);Cw(e);g=Bw(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 _.kr(l[0]);g=Ew(d);const p=_.jr(d,/[ \t]+--\x3e[ \t]+/g);k=Ew(d);if(null==g||null==p||null==k)throw new _.I(_.D,2,2001);g+=h;k+=h;l=l.slice(1).join("\n").trim();g=new _.pu(g,k,l,_.Eg);e&&(g.id=e);Cw(d);for(k=Bw(d);k;)Gw(g,k,c)||_.C(ww,k,vw),Cw(d),k=Bw(d);null!=e&&(g.id=e);c=g}c&&m.push(c)}return{cues:m,styles:f}}};var Mw=class extends Lw{parseMedia(a,b){return super.parseMedia((new Jw).a(a),b)}};var Nw=class{constructor(){this.a=null;this.g=new _.T("clpp.vtt.mp4")}parseInit(a){let b=!1;(new _.ip).O(_.De,_.bp).O(_.hg,_.bp).O(_.ye,_.bp).fa("mdhd",c=>{0===c.version?(c.reader.skip(4),c.reader.skip(4),this.a=_.N(c.reader),c.reader.skip(4)):(c.reader.skip(8),c.reader.skip(8),this.a=_.N(c.reader),c.reader.skip(8));c.reader.skip(4)}).O(_.Ce,_.bp).O(_.Sf,_.bp).fa(_.Uf,_.cp).O("wvtt",()=>{b=!0}).parse(a);if(!this.a)throw new _.I(_.D,2,2008);if(!b)throw new _.I(_.D,2,2008);}parseMedia(a,b){if(!this.a)throw this.g.error("No init segment for MP4+VTT!"),
|
|
10
|
+
new _.I(_.D,2,2008);let c=0,d=[],e;const f=[];let g=!1,h=!1,k=!1,l=null;(new _.ip).O("moof",_.bp).O("traf",_.bp).fa("tfdt",p=>{g=!0;c=0===p.version?_.N(p.reader):_.Xo(p.reader)}).fa("tfhd",p=>{var u=p.flags;p=p.reader;p.skip(4);u&1&&p.skip(8);u&2&&p.skip(4);l=u&8?_.N(p):null}).fa("trun",p=>{h=!0;{var u=p.version,v=p.flags;p=p.reader;const y=_.N(p);v&1&&p.skip(4);v&4&&p.skip(4);const A=[];for(let E=0;E<y;E++){const B={duration:null,sampleSize:null,Bf:null};v&256&&(B.duration=_.N(p));v&512&&(B.sampleSize=
|
|
11
|
+
_.N(p));v&1024&&p.skip(4);v&2048&&(B.Bf=0===u?_.N(p):_.Wo(p));A.push(B)}d=A}}).O(_.xe,_.dp(p=>{k=!0;e=p})).parse(a);if(!k&&!g&&!h)throw new _.I(_.D,2,2008);a=c;var m=new DataView(e.buffer,e.byteOffset,e.byteLength);m=new _.aq(m,!1);for(const p of d){const u=p.duration||l,v=p.Bf?c+p.Bf:a;a=v+(u||0);let y=0;do{const A=_.N(m);y+=A;var n=_.N(m);n=_.ap(n);let E=null;"vttc"===n?8<A&&(E=_.Zo(m,A-8)):("vtte"!==n&&this.g.error("Unknown box "+n+"! Skipping!"),m.skip(A-8));u?E&&f.push(Iw(E,b.periodStart+v/this.a,
|
|
12
|
+
b.periodStart+a/this.a)):this.g.error("WVTT sample duration unknown, and no default found!")}while(p.sampleSize&&y<p.sampleSize)}return{cues:f.filter(_.Jm),styles:[]}}};_.x("clpp.vtt.VttComponent",class extends _.zv{constructor(){super();this.a=new Kw}install(){_.ut(_.Zf,Lw);_.ut(zw,Lw);_.ut(Aw,Lw);_.ut(_.Ac,Nw);_.ut(yw,Mw);_.ut(xw,Mw);_.Ir.push(this.a)}uninstall(){_.wt(_.Zf);_.wt(zw);_.wt(Aw);_.wt(_.Ac);_.wt(yw);_.wt(xw);_.Kr(this.a)}id(){return"subtitles-vtt"}});};f.call(g, window);
|
package/cl.yospace.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
|
-
break a;case
|
|
3
|
-
const b=this.a;this.a.shutdown();this.a=null;a.trigger(new _.H(_.Qg,{detail:b}))}}id(){return"yospace"}};_.x(
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var qw="clpp.yospace.YospacePlugin",tw=class extends _.Pv{constructor(){super();this.a=null;this.g=new _.T(qw)}qg(){return this.a}onContentWillLoad(a,b){const c=this;return _.w(function*(){var d=a.getConfiguration().yospace;if(d.enabled){if(typeof window.YospaceAdManagement!==_.He)throw new _.I(_.D,9,7003,"Yospace SDK not found.");c.g.info("Yospace enabled.");a:{d=d.streamType||rw;var e=b.url;c.g.info("Creating Yospace session for stream type",d);switch(d){case rw:d=YospaceAdManagement.SessionVOD.create(e);
|
|
2
|
+
break a;case sw:d=YospaceAdManagement.SessionLive.create(e);break a;default:d=YospaceAdManagement.SessionDVRLive.create(e)}}d=yield d;e=d.getSessionState();if(e!==YospaceAdManagement.SessionState.INITIALISED)throw c.g.error("Failed to initialize Yospace session. State:",e,"URL",b.url),new _.I(_.D,9,7003,"Yospace session failed to initialize.");a.trigger(new _.H(_.Rg,{detail:d}));b.url=d.getPlaybackUrl();c.g.info("Yospace session initialized. New URL:",b.url);c.a=d}})}onPlayerWillRelease(a){if(this.a){this.g.info("Shutting down Yospace session.");
|
|
3
|
+
const b=this.a;this.a.shutdown();this.a=null;a.trigger(new _.H(_.Qg,{detail:b}))}}id(){return"yospace"}};_.x(qw,tw);tw.prototype.getSession=tw.prototype.qg;tw.Id="yospace";var uw=class{create(){return new tw}},rw=_.Eb,sw="LIVE";_.x("clpp.yospace.StreamType",{VOD:rw,LIVE:sw,DVR:"DVR"});_.Pn(new uw);};f.call(g, window);
|
package/cl.youbora.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
"ClearKey":a.startsWith(_.rd)?"Primetime":a},
|
|
3
|
-
return youbora.Util.buildRenditionString(c,d,e)}getIsLive(){return this.m.isLive()}getResource(){const c=this.m.getLoadedSource();return c&&c.url}getBitrate(){return this.j().streamBandwidth}getThroughput(){return this.j().estimatedBandwidth}getPlayrate(){return this.m.getPlaybackRate()}getFramesPerSecond(){var c=this.m.getTrackManager();return c&&(c=c.
|
|
4
|
-
this.a&&(this.g.debug("registering listeners"),youbora.Util.logAllEvents(this.m),this.a.on(this.m,_.Qf,this.I.bind(this)),this.a.on(this.m,_.Xd,this.F.bind(this)),this.a.on(this.m,_.tg,this.H.bind(this)),this.a.on(this.m,_.sg,this.G.bind(this)),this.a.on(this.m,_.pc,this.B.bind(this)),this.a.on(this.m,_.Sc,this.C.bind(this)))}unregisterListeners(){this.g.debug(_.zb);_.Xh(this.a)}dispose(){super.dispose()}j(){return this.m.getStats()||_.
|
|
5
|
-
this.l("state change",c);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 _.
|
|
6
|
-
this.m.getDrmInfo();c&&(c=
|
|
7
|
-
...d)}}return new b(a)},
|
|
8
|
-
this.a.getMediaUrl()}getTitle(){return this.a&&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.
|
|
9
|
-
c.
|
|
10
|
-
this.f&&(this.f.on(this.m,_.pc,this.M.bind(this)),this.f.on(this.m,_.lc,this.L.bind(this)),this.f.on(this.m,_.
|
|
11
|
-
this.f.on(this.m,_.Ub,this.B.bind(this)),this.f.on(this.m,_.Vb,this.C.bind(this)),this.f.on(this.m,_.ic,this.w.bind(this)))}unregisterListeners(){_.Xh(this.f)}dispose(){super.dispose()}M(c){this.g.debug(
|
|
12
|
-
(this.h(
|
|
13
|
-
...d){this.g.debug(`Reporting "${c}" event to Youbora`,...d)}}return new b(a)},
|
|
14
|
-
return this.getNpawUtils().buildRenditionString(b,c,d)}getIsLive(){return this.player.isLive()}getResource(){const b=this.player.getLoadedSource();return b&&b.url}getBitrate(){return this.j().streamBandwidth}getThroughput(){return this.j().estimatedBandwidth}getPlayrate(){return this.player.getPlaybackRate()}getFramesPerSecond(){var b=this.player.getTrackManager();return b&&(b=b.
|
|
15
|
-
this.w();this.player&&b&&(b.on(this.player,_.Qf,this.K.bind(this)),b.on(this.player,_.Xd,this.H.bind(this)),b.on(this.player,_.If,this.J.bind(this)),b.on(this.player,_.Hf,this.I.bind(this)),b.on(this.player,_.pc,this.F.bind(this)),b.on(this.player,_.Sc,this.G.bind(this)),b.on(this.player,_.Kc,this.L.bind(this)),b.on(this.player,_.ag,this.M.bind(this)))}unregisterListeners(){
|
|
16
|
-
_.
|
|
17
|
-
this.firePause():this.fireStop();break;case 2:this.fireBufferBegin();break;default:
|
|
18
|
-
this.B(_.Yf),c=this.C();this.plugin.setVideoOptions({"content.subtitles":b||c})}w(){this.a||(this.a=new _.
|
|
19
|
-
this.j=this.h=this.l=this.a=null;this.o=!1}getDuration(){return this.a?this.a.getDuration():null}getRendition(){let b=null;this.a&&(b=this.getNpawUtils().buildRenditionString(this.a.
|
|
20
|
-
null;this.a&&(b=this.a.getAdvertiserName());return b}getCreativeId(){let b=null;this.a&&(b=this.a.getCreativeId());return b}dispose(){this.unregisterListeners();this.j=this.h=this.a=null}getPosition(){const b=this.getNpawReference().Constants.AdPosition;let c=null;if(this.a)switch(this.a.
|
|
21
|
-
return b&&0<b.
|
|
22
|
-
b);return b}getPlayerName(){return _.ra}getVersion(){return"castlabs-ads-adapter-6.
|
|
23
|
-
2)),b.on(this.player,_.nc,this.w.bind(this,3)),b.on(this.player,_.Wb,this.H.bind(this)),b.on(this.player,_.kc,this.M.bind(this)),b.on(this.player,_.Xd,this.J.bind(this)),b.on(this.player,_.Tb,this.C.bind(this)),b.on(this.player,_.Ub,this.F.bind(this)),b.on(this.player,_.Vb,this.G.bind(this)),b.on(this.player,_.ic,this.
|
|
24
|
-
this.fireStop({adPlayhead:this.l})}K(){this.f("ad pause");this.A();this.firePause()}L(){this.f("ad resume");this.A();this.fireResume()}G(){this.o=!0;this.f(
|
|
25
|
-
this.fireBreakStop({adPlayhead:this.l});this.getPosition()===this.getNpawReference().Constants.AdPosition.Postroll&&this.fireStop({adPlayhead:this.l})}J(b){(b=b.detail)&&10003===b.code&&
|
|
26
|
-
return _.ih(c)?c.accountCode?_.z(window.NpawPlugin)||_.z(window.NpawPluginAdapters)?(a.g.warn("NPAW SDK not found."),b.onError(new _.I(1,9,9100)),!1):!0:(a.g.warn(
|
|
27
|
-
!1;if(!c.accountCode)return a.g.warn(
|
|
28
|
-
message:b.message,severity:b.severity}),
|
|
29
|
-
var c=a.youbora;void 0===c[
|
|
30
|
-
|
|
31
|
-
a.youbora;void 0===c[
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var Qv="Unhandled state",Rv="accountCode key is missing in Youbora config",Sv="ad break start",Tv="ad buffering ended",Uv="ad buffering started",Vv="ad click through url: ",Wv="ad timeline changed",Xv="clpp.npaw.NpawPlugin",Yv="clpp.npaw.YouboraPlugin",Zv="content.isLive",$v="content.title",aw="is container visible",bw="youbora",cw=function(a){return a.startsWith(_.wd)?"Widevine":a.startsWith(_.sd)?"FairPlay":a.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":a.startsWith(_.Qe)?
|
|
2
|
+
"ClearKey":a.startsWith(_.rd)?"Primetime":a},ew=function(a){class b extends youbora.Adapter{constructor(c){super(c);this.m=c;this.a=new _.Lt;this.g=new _.T("clpp.npaw.YouboraAdapter");this.h=this.o=!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.ta())&&(c=f.width,d=f.height,e=f.bandwidth);c&&d&&e||(f=this.j(),c=c||f.width,d=d||f.height,e=e||f.streamBandwidth);
|
|
3
|
+
return youbora.Util.buildRenditionString(c,d,e)}getIsLive(){return this.m.isLive()}getResource(){const c=this.m.getLoadedSource();return c&&c.url}getBitrate(){return this.j().streamBandwidth}getThroughput(){return this.j().estimatedBandwidth}getPlayrate(){return this.m.getPlaybackRate()}getFramesPerSecond(){var c=this.m.getTrackManager();return c&&(c=c.Ha())?c.frameRate:null}getPlayerName(){return _.ra}getVersion(){return"6.31.0-castlabsadapter-js"}getPlayerVersion(){return _.ea}registerListeners(){this.m&&
|
|
4
|
+
this.a&&(this.g.debug("registering listeners"),youbora.Util.logAllEvents(this.m),this.a.on(this.m,_.Qf,this.I.bind(this)),this.a.on(this.m,_.Xd,this.F.bind(this)),this.a.on(this.m,_.tg,this.H.bind(this)),this.a.on(this.m,_.sg,this.G.bind(this)),this.a.on(this.m,_.pc,this.B.bind(this)),this.a.on(this.m,_.Sc,this.C.bind(this)))}unregisterListeners(){this.g.debug(_.zb);_.Xh(this.a)}dispose(){super.dispose()}j(){return this.m.getStats()||_.ns()}w(){return!!this.m.getConfiguration().autoplay}I(c){c=c.detail;
|
|
5
|
+
this.l("state change",c);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 _.xs: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(Qv,c)}}f(){this.plugin.isInitiated||(this.h=!1,this.fireInit())}A(){var c=
|
|
6
|
+
this.m.getDrmInfo();c&&(c=cw(c.keySystem))&&this.plugin.setOptions({"content.drm":c});this.fireJoin()}F(c){!(c=c.detail)||this.h||10003===c.code&&this.plugin.getAdsAdapter()||(c=dw(c,this.m,this.g,this))&&c.severity===_.D&&(this.h=!0)}H(){this.m.isEnded()||(this.l(_.If),this.f(),this.fireSeekBegin())}G(){this.l(_.Hf);this.fireSeekEnd()}B(c){this.g.debug("adsTimeline",c);this.o=(c=c.adsTimeline)&&c.Mb()}C(c){this.g.debug("Casting",c);this.fireCasted()}l(c,...d){this.g.debug(`Reporting "${c}" event to Youbora`,
|
|
7
|
+
...d)}}return new b(a)},fw=function(a){class b extends youbora.Adapter{constructor(c){super(c);this.m=c;this.j=this.a=null;this.f=new _.Lt;this.g=new _.T("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.Ua(),this.a.Ta(),this.a.Ba()));return c}getBitrate(){return this.a&&this.a.Ba()}getPlayhead(){const c=this.m.getAdsManager();return c&&c.getPosition()}getResource(){return this.a&&
|
|
8
|
+
this.a.getMediaUrl()}getTitle(){return this.a&&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.Ca()){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<
|
|
9
|
+
c.getAdVolume()}getExpectedBreaks(){return this.j&&this.j.getCuePoints().length}getGivenBreaks(){return this.getExpectedBreaks()}getExpectedAds(){return this.a&&this.a.Va()}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(aw,c);return c}getPlayerName(){return _.ra}getVersion(){return"6.31.0-castlabsadsadapter-js"}getPlayerVersion(){return _.ea}registerListeners(){this.m&&
|
|
10
|
+
this.f&&(this.f.on(this.m,_.pc,this.M.bind(this)),this.f.on(this.m,_.lc,this.L.bind(this)),this.f.on(this.m,_.gc,this.I.bind(this)),this.f.on(this.m,_.jc,this.J.bind(this)),this.f.on(this.m,_.Xb,this.G.bind(this)),this.f.on(this.m,_.Yb,this.o.bind(this,1)),this.f.on(this.m,_.dc,this.o.bind(this,2)),this.f.on(this.m,_.nc,this.o.bind(this,3)),this.f.on(this.m,_.Wb,this.F.bind(this)),this.f.on(this.m,_.kc,this.K.bind(this)),this.f.on(this.m,_.Xd,this.H.bind(this)),this.f.on(this.m,_.Tb,this.A.bind(this)),
|
|
11
|
+
this.f.on(this.m,_.Ub,this.B.bind(this)),this.f.on(this.m,_.Vb,this.C.bind(this)),this.f.on(this.m,_.ic,this.w.bind(this)))}unregisterListeners(){_.Xh(this.f)}dispose(){super.dispose()}M(c){this.g.debug(Wv,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(Uv);this.fireBufferBegin()}w(){this.l&&
|
|
12
|
+
(this.h(Tv),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.Ra();this.g.debug(Vv,c);this.fireClick(c)}K(){this.h("ad skipped");this.fireSkip()}A(c){this.a=c.ad;this.h(Sv,this.a);this.fireBreakStart()}B(){this.h("ad break stop");this.fireBreakStop();if(this.getPosition()===youbora.Constants.AdPosition.Postroll){const c=this.plugin.getAdapter();c&&c.fireStop()}}H(c){(c=c.detail)&&10003===c.code&&dw(c,this.m,this.g,this)}h(c,
|
|
13
|
+
...d){this.g.debug(`Reporting "${c}" event to Youbora`,...d)}}return new b(a)},hw=function(){class a extends NpawPluginAdapters.video.Shaka{constructor(){super();this.f=this.h=!1;this.a=null}getPlayhead(){return this.getIsLive()?-1:this.player.getPosition()}getDuration(){return this.player.getDuration()}getRendition(){let b=null,c=null,d=null;var e=this.player.getTrackManager();e&&(e=e.ta())&&(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);
|
|
14
|
+
return this.getNpawUtils().buildRenditionString(b,c,d)}getIsLive(){return this.player.isLive()}getResource(){const b=this.player.getLoadedSource();return b&&b.url}getBitrate(){return this.j().streamBandwidth}getThroughput(){return this.j().estimatedBandwidth}getPlayrate(){return this.player.getPlaybackRate()}getFramesPerSecond(){var b=this.player.getTrackManager();return b&&(b=b.Ha())?b.frameRate:null}getPlayerName(){return _.ra}getVersion(){return"castlabs-adapter-6.31.0-js"}getPlayerVersion(){return _.ea}registerListeners(){const b=
|
|
15
|
+
this.w();this.player&&b&&(b.on(this.player,_.Qf,this.K.bind(this)),b.on(this.player,_.Xd,this.H.bind(this)),b.on(this.player,_.If,this.J.bind(this)),b.on(this.player,_.Hf,this.I.bind(this)),b.on(this.player,_.pc,this.F.bind(this)),b.on(this.player,_.Sc,this.G.bind(this)),b.on(this.player,_.Kc,this.L.bind(this)),b.on(this.player,_.ag,this.M.bind(this)))}unregisterListeners(){gw.debug(_.zb);_.Xh(this.w())}dispose(){this.unregisterListeners();this.f=this.h=!1;this.a=null}j(){return this.player.getStats()||
|
|
16
|
+
_.ns()}o(){return!!this.player.getConfiguration().autoplay}K(b){b=b.detail;this.l("state change",b);if(b)switch(b.currentState){case 1:this.plugin.setVideoOptions({"content.subtitles":this.C()});this.o()&&this.fireStart();break;case 3:this.fireStart();this.A();this.fireResume();this.fireBufferEnd();break;case 4:this.o()&&this.fireStart();this.A();this.fireBufferEnd();this.firePause();break;case _.xs:this.fireBufferEnd();this.fireStop();break;case 5:this.fireBufferEnd();this.h&&this.plugin.getAdsAdapter()?
|
|
17
|
+
this.firePause():this.fireStop();break;case 2:this.fireBufferBegin();break;default:gw.debug(Qv,b)}}A(){this.fireJoin()}H(b){(b=b.detail)&&!this.f&&this.player&&10003!==b.code&&(b=dw(b,this.player,gw,this))&&b.severity===_.D&&(this.f=!0)}J(){this.player.isEnded()||(this.l(_.If),this.fireSeekBegin())}B(b){const c=this.player.getTrackManager();if(!c)return null;let d=null;b===_.Yf&&(d=c.va());b===_.q&&(d=c.ra());return d?d.language:null}L(){const b=this.B(_.q);this.plugin.setVideoOptions({"content.language":b})}M(){const b=
|
|
18
|
+
this.B(_.Yf),c=this.C();this.plugin.setVideoOptions({"content.subtitles":b||c})}w(){this.a||(this.a=new _.Lt);return this.a}I(){this.l(_.Hf);this.fireSeekEnd()}F(b){gw.debug("adsTimeline",b);this.h=(b=b.adsTimeline)&&b.Mb()}G(b){gw.debug("Casting",b);this.fireCasted()}l(b,...c){gw.debug(`Reporting "${b}" event to NPAW`,...c)}C(){const b=this.player.getConfiguration();return b.youbora&&b.youbora.disabledSubtitlesLabel?b.youbora.disabledSubtitlesLabel:"off"}}return a},jw=function(){class a extends NpawPluginAdapters.ads.Ima{constructor(){super();
|
|
19
|
+
this.j=this.h=this.l=this.a=null;this.o=!1}getDuration(){return this.a?this.a.getDuration():null}getRendition(){let b=null;this.a&&(b=this.getNpawUtils().buildRenditionString(this.a.Ua(),this.a.Ta(),this.a.Ba()));return b}getBitrate(){let b=null;this.a&&(b=this.a.Ba());return b}getPlayhead(){let b=null;const c=this.player.getAdsManager();c&&(b=c.getPosition());return b}getResource(){let b=null;this.a&&(b=this.a.getMediaUrl());return b}getTitle(){let b=null;this.a&&(b=this.a.getTitle());return b}getProvider(){let b=
|
|
20
|
+
null;this.a&&(b=this.a.getAdvertiserName());return b}getCreativeId(){let b=null;this.a&&(b=this.a.getCreativeId());return b}dispose(){this.unregisterListeners();this.j=this.h=this.a=null}getPosition(){const b=this.getNpawReference().Constants.AdPosition;let c=null;if(this.a)switch(this.a.Ca()){case 0:c=b.Preroll;break;case 2:c=b.Postroll;break;case 1:c=b.Midroll}iw.debug("Ad position",c);return c}getIsSkippable(){return this.a&&-1!==this.a.getSkipTimeOffset()}getAudioEnabled(){const b=this.player.getAdsManager();
|
|
21
|
+
return b&&0<b.getAdVolume()}getExpectedBreaks(){return this.h&&this.h.getCuePoints().length}getGivenBreaks(){return this.getExpectedBreaks()}getExpectedAds(){return this.a&&this.a.Va()}getGivenAds(){return this.getExpectedAds()}getBreaksTime(){return this.h&&this.h.getCuePoints().map(b=>-1===b?this.player.getDuration():b)}getIsFullscreen(){return this.player.getSurface().isFullscreen()}getIsVisible(){var b=this.player.getSurface().getContainer();b=this.getNpawUtils().calculateAdViewability(b);iw.debug(aw,
|
|
22
|
+
b);return b}getPlayerName(){return _.ra}getVersion(){return"castlabs-ads-adapter-6.31.0-js"}getPlayerVersion(){return _.ea}B(){this.j||(this.j=new _.Lt);return this.j}registerListeners(){const b=this.B();this.player&&b&&(b.on(this.player,_.pc,this.R.bind(this)),b.on(this.player,_.lc,this.N.bind(this)),b.on(this.player,_.gc,this.K.bind(this)),b.on(this.player,_.jc,this.L.bind(this)),b.on(this.player,_.Xb,this.I.bind(this)),b.on(this.player,_.Yb,this.w.bind(this,1)),b.on(this.player,_.dc,this.w.bind(this,
|
|
23
|
+
2)),b.on(this.player,_.nc,this.w.bind(this,3)),b.on(this.player,_.Wb,this.H.bind(this)),b.on(this.player,_.kc,this.M.bind(this)),b.on(this.player,_.Xd,this.J.bind(this)),b.on(this.player,_.Tb,this.C.bind(this)),b.on(this.player,_.Ub,this.F.bind(this)),b.on(this.player,_.Vb,this.G.bind(this)),b.on(this.player,_.ic,this.S.bind(this)))}unregisterListeners(){_.Xh(this.B())}R(b){iw.debug(Wv,b);this.h=b.adsTimeline}N(b){this.a=b.ad;this.f("ad start",this.a);this.fireStart();this.fireJoin()}I(){this.f("ad ended");
|
|
24
|
+
this.fireStop({adPlayhead:this.l})}K(){this.f("ad pause");this.A();this.firePause()}L(){this.f("ad resume");this.A();this.fireResume()}G(){this.o=!0;this.f(Uv);this.fireBufferBegin()}S(){this.l=this.getPlayhead();this.A()}A(){this.o&&(this.f(Tv),this.o=!1,this.fireBufferEnd())}w(b){this.f("ad quartile",b);this.fireQuartile(b)}H(){this.f("ad clicked");const b=this.a&&this.a.Ra();iw.debug(Vv,b);this.fireClick(b)}M(){this.f("ad skipped");this.fireSkip()}C(b){this.a=b.ad;this.f(Sv,this.a);this.fireBreakStart()}F(){this.f("ad break stop");
|
|
25
|
+
this.fireBreakStop({adPlayhead:this.l});this.getPosition()===this.getNpawReference().Constants.AdPosition.Postroll&&this.fireStop({adPlayhead:this.l})}J(b){(b=b.detail)&&10003===b.code&&dw(b,this.player,iw,this)}f(b,...c){iw.debug(`Reporting "${b}" event to NPAW`,...c)}}return a},kw=function(a){a.a&&(a.g.info("Removing NPAW Plugins",a.a),a.a.removeAdsAdapter(),a.a.removeAdapter())},lw=function(a,b){if(b.namespace()===_.hd)return a.g.info("NPAW does not report when casting."),!1;const c=b.getConfiguration().youbora;
|
|
26
|
+
return _.ih(c)?c.accountCode?_.z(window.NpawPlugin)||_.z(window.NpawPluginAdapters)?(a.g.warn("NPAW SDK not found."),b.onError(new _.I(1,9,9100)),!1):!0:(a.g.warn(Rv),b.onError(new _.I(1,9,9101)),!1):(a.g.warn("NPAW plugin is loaded but not configured. Will do nothing."),!1)},mw=function(a,b){if(b.namespace()===_.hd)return a.g.info("Youbora does not report when casting."),!1;const c=b.getConfiguration().youbora;if(!_.ih(c))return a.g.debug("Youbora plugin is loaded but not configured. Will do nothing."),
|
|
27
|
+
!1;if(!c.accountCode)return a.g.warn(Rv),b.onError(new _.I(1,9,9101)),!1;if(_.z(window.youbora))return a.g.warn("Youbora SDK not found."),b.onError(new _.I(1,9,9100)),!1;"6.8.59"!==youbora.VERSION&&(a.g.warn("Youbora SDK version is not supported. The supported version is 6.8.59, found "+`version ${youbora.VERSION}. Some or all features of YouboraPlugin `+"may not work correctly."),b.onError(new _.I(1,9,9102)));return!0},nw=a=>(a=a.getConfiguration().youbora)&&a.errorFilter?a.errorFilter:b=>({code:`${b.code}`,
|
|
28
|
+
message:b.message,severity:b.severity}),dw=(a,b,c,d)=>{b=nw(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===a.code?"ad error":_.Xd;b.severity===_.D?(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 gw=new _.T("clpp.npaw.NpawAdapter");var iw=new _.T("clpp.npaw.NpawAdsAdapter");var ow=class extends _.Pv{constructor(){super();this.a=null;this.g=new _.T(Xv);this.m=null}wf(a){kw(this);if(this.a=a)this.a.registerAdapterFromClass(this.m,hw()),this.a.registerAdsAdapterFromClass(this.m,jw())}Xh(){return this.a}getAdapter(){return this.a&&this.a.getAdapter()}getAdsAdapter(){return this.a&&this.a.getAdsAdapter()}onPlayerCreated(a){this.m=a;lw(this,a)&&(a=a.getConfiguration().youbora,this.wf(new NpawPlugin(a.accountCode)))}onContentWillLoad(a,b){if(lw(this,a)){a=a.getConfiguration();
|
|
29
|
+
var c=a.youbora;void 0===c[Zv]&&(c[Zv]=b.isLive);void 0===c[$v]&&(c[$v]=b.name);void 0===c.viewerId&&(c.viewerId=a.viewerId);this.a||this.wf(new NpawPlugin(c.accountCode));this.a.setAnalyticsOptions(c)}}onContentLoaded(a){const b={};(a=a.getDrmInfo())&&(a=cw(a.keySystem))&&(b["content.drm"]=a);this.g.info(_.Je,b);this.a.setAnalyticsOptions(b)}onPlayerWillRelease(){}onPlayerWillDestroy(){kw(this);this.a.destroy()}id(){return bw}};_.x(Xv,ow);ow.prototype.getAdsAdapter=ow.prototype.getAdsAdapter;
|
|
30
|
+
ow.prototype.getAdapter=ow.prototype.getAdapter;ow.prototype.getNpawPlugin=ow.prototype.Xh;ow.prototype.setNpawPlugin=ow.prototype.wf;ow.Id=bw;new _.T(Xv);var pw=class extends _.Pv{constructor(){super();this.a=null;this.g=new _.T(Yv);this.m=null}xf(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(ew(this.m)),this.a.setAdsAdapter(fw(this.m))}getAdapter(){return this.a&&this.a.getAdapter()}getAdsAdapter(){return this.a&&this.a.getAdsAdapter()}onPlayerCreated(a){this.m=a;mw(this,a)&&(a=a.getConfiguration().youbora,this.xf(new youbora.Plugin(a)))}onContentWillLoad(a,b){if(mw(this,a)){a=a.getConfiguration();var c=
|
|
31
|
+
a.youbora;void 0===c[Zv]&&(c[Zv]=b.isLive);void 0===c[$v]&&(c[$v]=b.name);void 0===c.viewerId&&(c.viewerId=a.viewerId);this.a||this.xf(new youbora.Plugin(c));this.a.setOptions(c)}}onPlayerWillRelease(){}onPlayerWillDestroy(){}id(){return bw}};_.x(Yv,pw);pw.prototype.getAdsAdapter=pw.prototype.getAdsAdapter;pw.prototype.getAdapter=pw.prototype.getAdapter;pw.prototype.setYouboraPlugin=pw.prototype.xf;pw.Id=bw;_.Pn(new class{create(a){return a.youbora&&a.youbora.v7?new ow:new pw}});};f.call(g, window);
|
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.31.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/castlabs/prestoplay-web.git"
|
|
@@ -22,12 +22,13 @@
|
|
|
22
22
|
"CHANGELOG.md"
|
|
23
23
|
],
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@broadpeak/smartlib": "5.
|
|
26
|
-
"@broadpeak/smartlib-
|
|
27
|
-
"@broadpeak/smartlib-
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"npaw-plugin
|
|
25
|
+
"@broadpeak/smartlib": "5.4.4-808048b",
|
|
26
|
+
"@broadpeak/smartlib-ad": "5.4.4-808048b",
|
|
27
|
+
"@broadpeak/smartlib-all-compatibility": "5.4.4-808048b",
|
|
28
|
+
"@broadpeak/smartlib-analytics": "5.4.4-808048b",
|
|
29
|
+
"mux.js": "^6.0.0",
|
|
30
|
+
"npaw-plugin": "7.3.21",
|
|
31
|
+
"npaw-plugin-adapters": "7.3.21",
|
|
31
32
|
"youboralib": "6.8.59"
|
|
32
33
|
},
|
|
33
34
|
"peerDependenciesMeta": {
|
package/typings.d.ts
CHANGED
|
@@ -276,6 +276,14 @@ export namespace clpp {
|
|
|
276
276
|
* Broadpeak plugin configuration.
|
|
277
277
|
*/
|
|
278
278
|
export type BroadpeakConfiguration = {
|
|
279
|
+
/**
|
|
280
|
+
* Ad parameters for SSAI.
|
|
281
|
+
*/
|
|
282
|
+
adParameters?: Record<string, any>;
|
|
283
|
+
/**
|
|
284
|
+
* Enable SSAI ad tracking.
|
|
285
|
+
*/
|
|
286
|
+
adTracking?: boolean;
|
|
279
287
|
/**
|
|
280
288
|
* The address of the analytics server to send metrics to.
|
|
281
289
|
*/
|
|
@@ -865,10 +873,9 @@ export namespace clpp {
|
|
|
865
873
|
*/
|
|
866
874
|
bitrate: number;
|
|
867
875
|
/**
|
|
868
|
-
*
|
|
869
|
-
*
|
|
870
|
-
*
|
|
871
|
-
* This can be useful in case of any issues with ad playback.
|
|
876
|
+
* Disables IMA SDK on devices which run in custom playback mode. These are
|
|
877
|
+
* Samsung TV, LG TV and iPhone.
|
|
878
|
+
* This can be useful in case of any issues with ad playback on those platforms.
|
|
872
879
|
*/
|
|
873
880
|
disableCustomPlayback?: boolean;
|
|
874
881
|
/**
|
|
@@ -1589,7 +1596,7 @@ export namespace clpp {
|
|
|
1589
1596
|
* in order to reduce startup time by setting
|
|
1590
1597
|
* 'controls' attribute on the video element.
|
|
1591
1598
|
*/
|
|
1592
|
-
webOSStartupPatch
|
|
1599
|
+
webOSStartupPatch?: boolean;
|
|
1593
1600
|
}
|
|
1594
1601
|
|
|
1595
1602
|
/**
|
|
@@ -5639,7 +5646,7 @@ export namespace clpp {
|
|
|
5639
5646
|
/**
|
|
5640
5647
|
* The content time offset at which the current ad pod was scheduled.
|
|
5641
5648
|
* For preroll pod, 0 is returned.
|
|
5642
|
-
* For midrolls, the scheduled time is returned.
|
|
5649
|
+
* For midrolls, the scheduled time is returned in seconds.
|
|
5643
5650
|
* For postroll, -1 is returned.
|
|
5644
5651
|
* Defaults to 0 if this ad is not part of a pod,
|
|
5645
5652
|
* or the pod is not part of an ad playlist.
|
|
@@ -5655,6 +5662,7 @@ export namespace clpp {
|
|
|
5655
5662
|
getPosition(): number;
|
|
5656
5663
|
/**
|
|
5657
5664
|
* The position of the ad within the ad pod.
|
|
5665
|
+
* Starts at 1.
|
|
5658
5666
|
*/
|
|
5659
5667
|
getPositionInSequence(): number;
|
|
5660
5668
|
/**
|
|
@@ -5848,9 +5856,8 @@ export namespace clpp {
|
|
|
5848
5856
|
function createCastQueue(): clpp.cast.Queue;
|
|
5849
5857
|
export class CastProxy {
|
|
5850
5858
|
/**
|
|
5851
|
-
* @param player player instance
|
|
5852
|
-
*
|
|
5853
|
-
* @param receiverAppId id of receiver application. If blank, casting
|
|
5859
|
+
* @param player a player instance
|
|
5860
|
+
* @param receiverAppId ID of receiver application. If blank, casting
|
|
5854
5861
|
* will not be available, but the proxy will still function otherwise.
|
|
5855
5862
|
* @param onResumeLocal Callback function to add specific logic that should be
|
|
5856
5863
|
* executed after session ends. If not provided, default callback
|
|
@@ -5858,28 +5865,34 @@ export namespace clpp {
|
|
|
5858
5865
|
*/
|
|
5859
5866
|
constructor(player: clpp.Player, receiverAppId: string, onResumeLocal?: Function);
|
|
5860
5867
|
/**
|
|
5861
|
-
* Add
|
|
5868
|
+
* Add a listener for messages from Receiver App.
|
|
5869
|
+
* The message listener is registered under the 'urn:x-cast:castlabs' namespace.
|
|
5862
5870
|
*/
|
|
5863
5871
|
addMessageListener(listener: Function): void;
|
|
5864
5872
|
/**
|
|
5865
|
-
* Checks if
|
|
5866
|
-
*
|
|
5873
|
+
* Checks if it is possible to cast to a Receiver App.
|
|
5874
|
+
* For this the `receiverAppId` supplied in the constructor must be correct,
|
|
5875
|
+
* it must point to a published Receiver App and a Chromecast target device
|
|
5876
|
+
* must be available for connection on your WiFi network.
|
|
5867
5877
|
*/
|
|
5868
5878
|
canCast(): boolean;
|
|
5869
5879
|
/**
|
|
5870
|
-
* Start casting.
|
|
5871
|
-
*
|
|
5880
|
+
* Start casting.
|
|
5881
|
+
* If the player has some loaded content, it will be casted. Otherwise,
|
|
5882
|
+
* the casting session will start empty and wait for a call to
|
|
5883
|
+
* {@link clpp.Player#load}.
|
|
5872
5884
|
*
|
|
5873
5885
|
* @param opt_playerConfig optional
|
|
5874
5886
|
* configuration to cast. If omitted, player will try to cast current
|
|
5875
|
-
* content
|
|
5876
|
-
* @param opt_queueOptions optional queue items and starting index to load
|
|
5887
|
+
* content
|
|
5888
|
+
* @param opt_queueOptions optional queue items and starting index to load
|
|
5877
5889
|
*/
|
|
5878
5890
|
cast(opt_playerConfig?: clpp.PlayerConfiguration, opt_queueOptions?: Record<string, any>): Promise<void>;
|
|
5879
5891
|
/**
|
|
5880
|
-
* Change receiver
|
|
5892
|
+
* Change the receiver ID.
|
|
5893
|
+
* If a casting session is in progress it will be closed first.
|
|
5881
5894
|
*
|
|
5882
|
-
* @param newAppId new receiver application
|
|
5895
|
+
* @param newAppId new receiver application ID
|
|
5883
5896
|
*/
|
|
5884
5897
|
changeReceiverId(newAppId: string): Promise<void>;
|
|
5885
5898
|
/**
|
|
@@ -5887,16 +5900,15 @@ export namespace clpp {
|
|
|
5887
5900
|
*/
|
|
5888
5901
|
clearContentMetadata(): void;
|
|
5889
5902
|
/**
|
|
5890
|
-
* Destroys proxy.
|
|
5891
|
-
* functional.
|
|
5903
|
+
* Destroys the proxy.
|
|
5892
5904
|
*/
|
|
5893
5905
|
destroy(): Promise<void>;
|
|
5894
5906
|
/**
|
|
5895
|
-
*
|
|
5907
|
+
* Stop the receiver application.
|
|
5896
5908
|
*/
|
|
5897
5909
|
forceDisconnect(): void;
|
|
5898
5910
|
/**
|
|
5899
|
-
* Gets
|
|
5911
|
+
* Gets current Cast content metadata.
|
|
5900
5912
|
*/
|
|
5901
5913
|
getContentMetadata(): clpp.cast.utils.SenderMetadataObject|null;
|
|
5902
5914
|
/**
|
|
@@ -5904,7 +5916,7 @@ export namespace clpp {
|
|
|
5904
5916
|
*/
|
|
5905
5917
|
getReceiverName(): string;
|
|
5906
5918
|
/**
|
|
5907
|
-
* Checks if
|
|
5919
|
+
* Checks if a casting session is in progress.
|
|
5908
5920
|
*/
|
|
5909
5921
|
isCasting(): boolean;
|
|
5910
5922
|
/**
|
|
@@ -5922,13 +5934,14 @@ export namespace clpp {
|
|
|
5922
5934
|
*/
|
|
5923
5935
|
queuePreviousItem(): Promise<void>;
|
|
5924
5936
|
/**
|
|
5925
|
-
* Remove
|
|
5937
|
+
* Remove a listener for messages from Receiver App.
|
|
5938
|
+
* The message listener is unregistered from the 'urn:x-cast:castlabs' namespace.
|
|
5926
5939
|
*/
|
|
5927
5940
|
removeMessageListener(listener: Function): void;
|
|
5928
5941
|
/**
|
|
5929
|
-
* Sends custom message to
|
|
5942
|
+
* Sends a custom message to the Receiver App.
|
|
5930
5943
|
*
|
|
5931
|
-
* @param message message
|
|
5944
|
+
* @param message a message object
|
|
5932
5945
|
*/
|
|
5933
5946
|
sendMessage(message: Record<string, any>|string): Promise<void>;
|
|
5934
5947
|
/**
|
|
@@ -5943,6 +5956,7 @@ export namespace clpp {
|
|
|
5943
5956
|
*/
|
|
5944
5957
|
setContentImage(imageUrl: string): void;
|
|
5945
5958
|
/**
|
|
5959
|
+
* Sets Cast content metadata.
|
|
5946
5960
|
* Set Cast content metadata to one of the `chrome.cast.media.*Metadata`
|
|
5947
5961
|
* objects (See {@link https://developers.google.com/cast/docs/reference/web_sender/chrome.cast.media#.MetadataType}),
|
|
5948
5962
|
* or clear it by passing `null`.
|
|
@@ -5962,15 +5976,19 @@ export namespace clpp {
|
|
|
5962
5976
|
*/
|
|
5963
5977
|
setContentReleaseDate(date: string): void;
|
|
5964
5978
|
/**
|
|
5965
|
-
* Set the Cast content
|
|
5979
|
+
* Set the Cast content title.
|
|
5966
5980
|
* You should set metadata before calling cast/load.
|
|
5967
5981
|
*/
|
|
5968
5982
|
setContentTitle(title: string): void;
|
|
5969
5983
|
/**
|
|
5984
|
+
* Set player configuration interceptor.
|
|
5970
5985
|
* Gives a possibility to intercept player configuration during casting to
|
|
5971
|
-
* modify it if necessary.
|
|
5972
|
-
* argument.
|
|
5973
|
-
* asynchronous way. If nothing is returned, player will use original config.
|
|
5986
|
+
* modify it if necessary. The interceptor callback takes player config as an
|
|
5987
|
+
* argument. The function should return a new configuration in synchronous or
|
|
5988
|
+
* asynchronous way. If nothing is returned, the player will use the original config.
|
|
5989
|
+
*
|
|
5990
|
+
* @param interceptor a callback
|
|
5991
|
+
* which modifies the configuration object
|
|
5974
5992
|
*
|
|
5975
5993
|
* @example
|
|
5976
5994
|
*
|
|
@@ -5994,76 +6012,83 @@ export namespace clpp {
|
|
|
5994
6012
|
|
|
5995
6013
|
export class Receiver {
|
|
5996
6014
|
/**
|
|
5997
|
-
* Add
|
|
6015
|
+
* Add a listener for messages from {@link clpp.cast.CastProxy}.
|
|
6016
|
+
* Add a custom message listener to 'urn:x-cast:castlabs' namespace.
|
|
5998
6017
|
*
|
|
5999
6018
|
* @param listener custom message listener.
|
|
6000
6019
|
*/
|
|
6001
6020
|
addMessageListener(listener: Function): void;
|
|
6002
6021
|
/**
|
|
6003
|
-
* Get
|
|
6022
|
+
* Get content metadata.
|
|
6023
|
+
* Get content metadata object set by user, one of the
|
|
6004
6024
|
* `cast.framework.messages.*MediaMetadata` objects.
|
|
6005
6025
|
*/
|
|
6006
6026
|
getContentMetadata(): clpp.cast.utils.ReceiverMetadataObject|null;
|
|
6007
6027
|
/**
|
|
6008
|
-
* Returns singleton instance of
|
|
6028
|
+
* Returns the singleton instance of the Cast Receiver.
|
|
6009
6029
|
*/
|
|
6010
6030
|
static getInstance(): clpp.cast.Receiver;
|
|
6011
6031
|
/**
|
|
6032
|
+
* Gets the queue manager.
|
|
6012
6033
|
* Returns the Cast queue manager which exposes queue manipulation APIs for
|
|
6013
6034
|
* the active receiver session.
|
|
6014
6035
|
*/
|
|
6015
6036
|
getQueueManager(): any|undefined;
|
|
6016
6037
|
/**
|
|
6017
|
-
*
|
|
6018
|
-
* before
|
|
6038
|
+
* Initializes the receiver.
|
|
6039
|
+
* This must be called before calling {@link start()}.
|
|
6019
6040
|
*
|
|
6020
|
-
* @param player player instance
|
|
6041
|
+
* @param player a player instance
|
|
6021
6042
|
*/
|
|
6022
6043
|
init(player: clpp.Player): void;
|
|
6023
6044
|
/**
|
|
6024
|
-
* Checks
|
|
6045
|
+
* Checks whether the receiver is ready.
|
|
6025
6046
|
*/
|
|
6026
6047
|
isApiReady(): boolean;
|
|
6027
6048
|
/**
|
|
6028
|
-
* Remove listener to
|
|
6049
|
+
* Remove listener to events coming from Chromecast Receiver SDK.
|
|
6029
6050
|
* Event type should be one of {@link https://developers.google.com/cast/docs/reference/web_receiver/cast.framework.system#.EventType | cast.framework.system.EventType}.
|
|
6030
6051
|
*/
|
|
6031
6052
|
off(type: any, handler: Function): void;
|
|
6032
6053
|
/**
|
|
6033
|
-
* Add listener to
|
|
6054
|
+
* Add listener to events coming from Chromecast Receiver SDK.
|
|
6034
6055
|
* Event type should be one of {@link https://developers.google.com/cast/docs/reference/web_receiver/cast.framework.system#.EventType | cast.framework.system.EventType}.
|
|
6035
6056
|
*/
|
|
6036
6057
|
on(type: any, handler: Function): void;
|
|
6037
6058
|
/**
|
|
6038
|
-
* Remove
|
|
6059
|
+
* Remove a listener for messages from {@link clpp.cast.CastProxy}.
|
|
6060
|
+
* Remove a custom message listener to 'urn:x-cast:castlabs' namespace.
|
|
6039
6061
|
*
|
|
6040
6062
|
* @param listener custom message listener.
|
|
6041
6063
|
*/
|
|
6042
6064
|
removeMessageListener(listener: Function): void;
|
|
6043
6065
|
/**
|
|
6044
|
-
* Send
|
|
6066
|
+
* Send a message to {@link clpp.cast.CastProxy}.
|
|
6067
|
+
* Send a custom message through 'urn:x-cast:castlabs' namespace.
|
|
6045
6068
|
*
|
|
6046
|
-
* @param message message
|
|
6047
|
-
* @param senderId sender
|
|
6069
|
+
* @param message a message object
|
|
6070
|
+
* @param senderId sender ID. If not set, message will be
|
|
6048
6071
|
* broadcasted to all connected senders.
|
|
6049
6072
|
*/
|
|
6050
6073
|
sendMessage(message: any, senderId?: string): void;
|
|
6051
6074
|
/**
|
|
6052
|
-
* Set
|
|
6075
|
+
* Set content metadata.
|
|
6076
|
+
* Set content metadata object to be displayed on the Cast receiver and
|
|
6053
6077
|
* broadcast it to all senders. This will overwrite any existing metadata or
|
|
6054
6078
|
* remove it if `null` is passed.
|
|
6055
6079
|
*/
|
|
6056
6080
|
setContentMetadata(metadata: clpp.cast.utils.ReceiverMetadataObject|null): void;
|
|
6057
6081
|
/**
|
|
6058
|
-
*
|
|
6059
|
-
*
|
|
6060
|
-
*
|
|
6061
|
-
* or asynchronous way. If nothing is returned, player will use original
|
|
6062
|
-
* reference.
|
|
6082
|
+
* Set an interceptor for load request data.
|
|
6083
|
+
* Gives a possibility to intercept {@link https://developers.google.com/cast/docs/reference/web_receiver/cast.framework.messages.LoadRequestData | LoadRequestData}
|
|
6084
|
+
* before passing it to the Chromecast Receiver SDK.
|
|
6063
6085
|
*
|
|
6064
|
-
* @
|
|
6086
|
+
* @param interceptor a callback which takes load request data as its argument. It may return
|
|
6087
|
+
* modified load request data in synchronous or asynchronous way. If nothing
|
|
6088
|
+
* is returned, the player will use the original data.
|
|
6089
|
+
*
|
|
6090
|
+
* @example // Add embedded ads to media
|
|
6065
6091
|
*
|
|
6066
|
-
* // Add embedded ads to media
|
|
6067
6092
|
* receiver.setLoadRequestDataInterceptor((loadRequestData) => {
|
|
6068
6093
|
* const mediaInfo = loadRequestData.media;
|
|
6069
6094
|
* mediaInfo.breakClips = [
|
|
@@ -6106,12 +6131,13 @@ export namespace clpp {
|
|
|
6106
6131
|
*/
|
|
6107
6132
|
setLoadRequestDataInterceptor(interceptor: clpp.cast.utils.LoadRequestDataInterceptor|null): void;
|
|
6108
6133
|
/**
|
|
6134
|
+
* Set an interceptor for player configuration.
|
|
6109
6135
|
* Gives a possibility to intercept player configuration during casting to
|
|
6110
|
-
* modify it if necessary.
|
|
6111
|
-
* argument.
|
|
6112
|
-
* asynchronous way. If nothing is returned, player will use original config.
|
|
6136
|
+
* modify it if necessary. The interceptor callback takes player config as the
|
|
6137
|
+
* argument. The callback should return new configuration in synchronous or
|
|
6138
|
+
* asynchronous way. If nothing is returned, the player will use the original config.
|
|
6113
6139
|
*
|
|
6114
|
-
* @example
|
|
6140
|
+
* @example // Generate a new DRM auth token before loading content
|
|
6115
6141
|
*
|
|
6116
6142
|
* receiver.setPlayerConfigInterceptor(async (config) => {
|
|
6117
6143
|
* // use your business logic to obtain new authToken
|
|
@@ -6128,14 +6154,16 @@ export namespace clpp {
|
|
|
6128
6154
|
*/
|
|
6129
6155
|
setQueue(queue: any): void;
|
|
6130
6156
|
/**
|
|
6131
|
-
* Starts
|
|
6157
|
+
* Starts listening to commands coming in from the sender.
|
|
6132
6158
|
*/
|
|
6133
6159
|
start(): void;
|
|
6134
6160
|
/**
|
|
6135
|
-
*
|
|
6161
|
+
* Shuts down the Cast Receiver.
|
|
6162
|
+
* Stops listening to cast session requests and releases resources.
|
|
6136
6163
|
*/
|
|
6137
6164
|
stop(): void;
|
|
6138
6165
|
/**
|
|
6166
|
+
* Update content metadata.
|
|
6139
6167
|
* Updates the Cast metadata object with new values. Any existing metadata
|
|
6140
6168
|
* properties will be updated or replaced with the values provided in the
|
|
6141
6169
|
* `metadata` object. If the `metadata` object is `null` or not provided, the
|
|
@@ -7838,10 +7866,6 @@ export namespace clpp {
|
|
|
7838
7866
|
|
|
7839
7867
|
namespace npaw {
|
|
7840
7868
|
export class NpawPlugin {
|
|
7841
|
-
/**
|
|
7842
|
-
* We do keep youbora id for now, until we migrate to v7 as default
|
|
7843
|
-
* and change also the naming.
|
|
7844
|
-
*/
|
|
7845
7869
|
static Id: string;
|
|
7846
7870
|
/**
|
|
7847
7871
|
* Gives access to the underlying NPAW Plugin Video Adapter.
|