@castlabs/prestoplay 6.26.0 → 6.27.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.
Files changed (68) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +7 -7
  5. package/cjs/cl.cast.js +114 -113
  6. package/cjs/cl.conviva.js +29 -29
  7. package/cjs/cl.core.js +620 -621
  8. package/cjs/cl.crypto.js +7 -7
  9. package/cjs/cl.dash.js +84 -84
  10. package/cjs/cl.externs.js +83 -51
  11. package/cjs/cl.freewheel.js +25 -25
  12. package/cjs/cl.hls.js +79 -77
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +23 -23
  15. package/cjs/cl.ima.js +24 -24
  16. package/cjs/cl.mediatailor.js +3 -3
  17. package/cjs/cl.mse.js +350 -342
  18. package/cjs/cl.muxdata.js +15 -15
  19. package/cjs/cl.onboard.js +3 -3
  20. package/cjs/cl.persistent.js +15 -15
  21. package/cjs/cl.playlist.js +6 -6
  22. package/cjs/cl.sessions.js +16 -16
  23. package/cjs/cl.simid.js +17 -17
  24. package/cjs/cl.smooth.js +67 -67
  25. package/cjs/cl.thumbnails.js +26 -26
  26. package/cjs/cl.tizen.js +69 -68
  27. package/cjs/cl.ttml.js +29 -29
  28. package/cjs/cl.verimatrix.js +5 -5
  29. package/cjs/cl.vimond.js +12 -12
  30. package/cjs/cl.vr.js +19 -19
  31. package/cjs/cl.vtt.js +14 -14
  32. package/cjs/cl.yospace.js +4 -4
  33. package/cjs/cl.youbora.js +37 -37
  34. package/cjs/polyfill.min.js +15 -3
  35. package/cl.adobe.js +3 -3
  36. package/cl.airplay.js +3 -3
  37. package/cl.broadpeak.js +5 -5
  38. package/cl.cast.js +92 -90
  39. package/cl.conviva.js +27 -27
  40. package/cl.core.js +498 -503
  41. package/cl.crypto.js +9 -9
  42. package/cl.dash.js +82 -82
  43. package/cl.externs.js +83 -51
  44. package/cl.freewheel.js +19 -19
  45. package/cl.hls.js +80 -79
  46. package/cl.hlssmpte.js +5 -5
  47. package/cl.htmlcue.js +26 -26
  48. package/cl.ima.js +17 -17
  49. package/cl.mediatailor.js +3 -3
  50. package/cl.mse.js +305 -301
  51. package/cl.muxdata.js +13 -13
  52. package/cl.onboard.js +4 -4
  53. package/cl.persistent.js +11 -11
  54. package/cl.playlist.js +5 -5
  55. package/cl.sessions.js +10 -10
  56. package/cl.simid.js +14 -14
  57. package/cl.smooth.js +60 -60
  58. package/cl.thumbnails.js +19 -19
  59. package/cl.tizen.js +57 -57
  60. package/cl.ttml.js +22 -22
  61. package/cl.verimatrix.js +4 -4
  62. package/cl.vimond.js +8 -8
  63. package/cl.vr.js +15 -15
  64. package/cl.vtt.js +12 -12
  65. package/cl.yospace.js +3 -3
  66. package/cl.youbora.js +29 -29
  67. package/package.json +1 -1
  68. package/typings.d.ts +83 -0
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 xw=" The setting will be ignored.",yw="VTT parser encountered an invalid VTT setting: ",zw="application/x-subrip",Aw="text/srt",Bw='text/vtt; codecs\x3d"vtt"',Cw='text/vtt; codecs\x3d"wvtt"',Dw=function(a){return a.a===a.f.length?null:(a=_.Gi(a,/[^ \t\n]*/gm))?a[0]:null},Ew=function(a){_.Gi(a,/[ \t]+/gm)},Fw=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},Gw=function(a){a=_.Gi(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)},Iw=function(a,b,c){let d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"===b?a.textAlign=_.Ut:a.textAlign=_.$t[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"===d[1]?_.og:_.pg;else if(d=/^size:([\d.]+)%$/.exec(b))a.size=Number(d[1]);else if(d=/^position:([\d.]+)%(?:,(line-left|line-right|center|start|end))?$/.exec(b))a.position=Number(d[1]),d[2]&&(b=d[2],a.positionAlign=b===_.ie||b===_.Lf?_.ie:b===_.je||b===_.Rd?
4
- _.je:_.Vc);else if(d=/^region:(.*)$/.exec(b)){if(b=Hw(c,d[1]))a.region=b}else{a:{if(c=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=1,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.au[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.Wt,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.au[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},Hw=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)},Kw=function(a,b,c){let d,e,f;(new _.tm).N("payl",_.om(g=>{d=_.Si(g)})).N("iden",_.om(g=>{e=_.Si(g)})).N("sttg",_.om(g=>{f=_.Si(g)})).parse(a);return d?Jw(d,e,f,b,c):null},Jw=function(a,b,c,d,e){a=new _.Zt(d,e,a,_.zg);b&&(a.id=b);if(c)for(b=new _.jj(c),c=Dw(b);c;)Iw(a,c,[])||_.C(yw,c,xw),Ew(b),c=Dw(b);return a},Lw=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+=Fw(c)}return _.Wi(b)}},Mw=class{create(){return new Lw}probe(a,b){return(a===Aw||a===zw)&&b===_.Uf}};var Nw=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 _.I(_.G,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=Gw(new _.jj(d[1]));if(null==a)throw new _.I(_.G,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 _.jj(f.replace(/\n/g," "));d=new _.du;Dw(e);Ew(e);for(var g=Dw(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,xw);Ew(e);g=Dw(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 _.jj(l[0]);g=Gw(d);const q=_.Gi(d,/[ \t]+--\x3e[ \t]+/g);k=Gw(d);if(null==g||null==q||null==k)throw new _.I(_.G,2,2001);g+=h;k+=h;l=l.slice(1).join("\n").trim();g=new _.Zt(g,k,l,_.zg);e&&(g.id=e);Ew(d);for(k=Dw(d);k;)Iw(g,k,c)||_.C(yw,k,xw),Ew(d),k=Dw(d);null!=e&&(g.id=e);c=g}c&&m.push(c)}return{cues:m,styles:f}}};var Ow=class extends Nw{parseMedia(a,b){return super.parseMedia((new Lw).a(a),b)}};var Pw=class{constructor(){this.a=null;this.g=new _.T("clpp.vtt.mp4")}parseInit(a){let b=!1;(new _.tm).N(_.Ae,_.mm).N(_.cg,_.mm).N(_.re,_.mm).ea("mdhd",c=>{0===c.version?(c.reader.skip(4),c.reader.skip(4),this.a=_.P(c.reader),c.reader.skip(4)):(c.reader.skip(8),c.reader.skip(8),this.a=_.P(c.reader),c.reader.skip(8));c.reader.skip(4)}).N(_.ze,_.mm).N(_.Of,_.mm).ea(_.Qf,_.nm).N("wvtt",()=>{b=!0}).parse(a);if(!this.a)throw new _.I(_.G,2,2008);if(!b)throw new _.I(_.G,2,2008);}parseMedia(a,b){if(!this.a)throw this.g.error("No init segment for MP4+VTT!"),
10
- new _.I(_.G,2,2008);let c=0,d=[],e;const f=[];let g=!1,h=!1,k=!1,l=null;(new _.tm).N("moof",_.mm).N("traf",_.mm).ea("tfdt",q=>{g=!0;c=0===q.version?_.P(q.reader):_.hm(q.reader)}).ea("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?_.P(q):null}).ea("trun",q=>{h=!0;{var u=q.version,v=q.flags;q=q.reader;const y=_.P(q);v&1&&q.skip(4);v&4&&q.skip(4);const A=[];for(let D=0;D<y;D++){const E={duration:null,sampleSize:null,mf:null};v&256&&(E.duration=_.P(q));v&512&&(E.sampleSize=
11
- _.P(q));v&1024&&q.skip(4);v&2048&&(E.mf=0===u?_.P(q):_.gm(q));A.push(E)}d=A}}).N(_.qe,_.om(q=>{k=!0;e=q})).parse(a);if(!k&&!g&&!h)throw new _.I(_.G,2,2008);a=c;var m=new DataView(e.buffer,e.byteOffset,e.byteLength);m=new _.pn(m,!1);for(const q of d){const u=q.duration||l,v=q.mf?c+q.mf:a;a=v+(u||0);let y=0;do{const A=_.P(m);y+=A;var n=_.P(m);n=_.lm(n);let D=null;"vttc"===n?8<A&&(D=_.jm(m,A-8)):("vtte"!==n&&this.g.error("Unknown box "+n+"! Skipping!"),m.skip(A-8));u?D&&f.push(Kw(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(_.ki),styles:[]}}};_.z("clpp.vtt.VttComponent",class extends _.Dv{constructor(){super();this.j=new Mw}f(){_.Ct(_.Uf,Nw);_.Ct(Bw,Nw);_.Ct(Cw,Nw);_.Ct(_.xc,Pw);_.Ct(Aw,Ow);_.Ct(zw,Ow);_.hk.push(this.j)}a(){_.Et(_.Uf);_.Et(Bw);_.Et(Cw);_.Et(_.xc);_.Et(Aw);_.Et(zw);_.jk(this.j)}id(){return"subtitles-vtt"}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var nw=" The setting will be ignored.",ow="VTT parser encountered an invalid VTT setting: ",pw="application/x-subrip",qw="text/srt",rw='text/vtt; codecs\x3d"vtt"',sw='text/vtt; codecs\x3d"wvtt"',tw=function(a){return a.a===a.f.length?null:(a=_.cj(a,/[^ \t\n]*/gm))?a[0]:null},uw=function(a){_.cj(a,/[ \t]+/gm)},vw=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},ww=function(a){a=_.cj(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)},yw=function(a,b,c){let d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"===b?a.textAlign=_.Nt:a.textAlign=_.Tt[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===_.ke||b===_.Mf?_.ke:b===_.le||b===_.Sd?
4
+ _.le:_.Vc);else if(d=/^region:(.*)$/.exec(b)){if(b=xw(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=_.Ut[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.Pt,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.Ut[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},xw=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)},Aw=function(a,b,c){let d,e,f;(new _.Nm).N("payl",_.Im(g=>{d=_.Bi(g)})).N("iden",_.Im(g=>{e=_.Bi(g)})).N("sttg",_.Im(g=>{f=_.Bi(g)})).parse(a);return d?zw(d,e,f,b,c):null},zw=function(a,b,c,d,e){a=new _.St(d,e,a,_.Bg);b&&(a.id=b);if(c)for(b=new _.dj(c),c=tw(b);c;)yw(a,c,[])||_.B(ow,c,nw),uw(b),c=tw(b);return a},Bw=class{a(a){a=_.Bi(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+=vw(c)}return _.Fi(b)}},Cw=class{create(){return new Bw}probe(a,b){return(a===qw||a===pw)&&b===_.Wf}};var Dw=class{constructor(a){this.a=a}parseInit(){}parseMedia(a,b){a=_.Bi(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(_.F,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=ww(new _.dj(d[1]));if(null==a)throw new _.I(_.F,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 _.dj(f.replace(/\n/g," "));d=new _.Xt;tw(e);uw(e);for(var g=tw(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,nw);uw(e);g=tw(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 _.dj(l[0]);g=ww(d);const p=_.cj(d,/[ \t]+--\x3e[ \t]+/g);k=ww(d);if(null==g||null==p||null==k)throw new _.I(_.F,2,2001);g+=h;k+=h;l=l.slice(1).join("\n").trim();g=new _.St(g,k,l,_.Bg);e&&(g.id=e);uw(d);for(k=tw(d);k;)yw(g,k,c)||_.B(ow,k,nw),uw(d),k=tw(d);null!=e&&(g.id=e);c=g}c&&m.push(c)}return{cues:m,styles:f}}};var Ew=class extends Dw{parseMedia(a,b){return super.parseMedia((new Bw).a(a),b)}};var Fw=class{constructor(){this.a=null;this.g=new _.S("clpp.vtt.mp4")}parseInit(a){let b=!1;(new _.Nm).N(_.Be,_.Gm).N(_.eg,_.Gm).N(_.te,_.Gm).fa("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,_.Gm).N(_.Pf,_.Gm).fa(_.Rf,_.Hm).N("wvtt",()=>{b=!0}).parse(a);if(!this.a)throw new _.I(_.F,2,2008);if(!b)throw new _.I(_.F,2,2008);}parseMedia(a,b){if(!this.a)throw this.g.error("No init segment for MP4+VTT!"),
10
+ new _.I(_.F,2,2008);let c=0,d=[],e;const f=[];let g=!1,h=!1,k=!1,l=null;(new _.Nm).N("moof",_.Gm).N("traf",_.Gm).fa("tfdt",p=>{g=!0;c=0===p.version?_.O(p.reader):_.Bm(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?_.O(p):null}).fa("trun",p=>{h=!0;{var u=p.version,v=p.flags;p=p.reader;const y=_.O(p);v&1&&p.skip(4);v&4&&p.skip(4);const A=[];for(let D=0;D<y;D++){const E={duration:null,sampleSize:null,cf:null};v&256&&(E.duration=_.O(p));v&512&&(E.sampleSize=
11
+ _.O(p));v&1024&&p.skip(4);v&2048&&(E.cf=0===u?_.O(p):_.Am(p));A.push(E)}d=A}}).N(_.se,_.Im(p=>{k=!0;e=p})).parse(a);if(!k&&!g&&!h)throw new _.I(_.F,2,2008);a=c;var m=new DataView(e.buffer,e.byteOffset,e.byteLength);m=new _.Jn(m,!1);for(const p of d){const u=p.duration||l,v=p.cf?c+p.cf:a;a=v+(u||0);let y=0;do{const A=_.O(m);y+=A;var n=_.O(m);n=_.Fm(n);let D=null;"vttc"===n?8<A&&(D=_.Dm(m,A-8)):("vtte"!==n&&this.g.error("Unknown box "+n+"! Skipping!"),m.skip(A-8));u?D&&f.push(Aw(D,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(_.mi),styles:[]}}};_.x("clpp.vtt.VttComponent",class extends _.uv{constructor(){super();this.j=new Cw}f(){_.vt(_.Wf,Dw);_.vt(rw,Dw);_.vt(sw,Dw);_.vt(_.xc,Fw);_.vt(qw,Ew);_.vt(pw,Ew);_.xl.push(this.j)}a(){_.xt(_.Wf);_.xt(rw);_.xt(sw);_.xt(_.xc);_.xt(qw);_.xt(pw);_.zl(this.j)}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 tw="clpp.yospace.YospacePlugin",ww=class extends _.Sv{constructor(){super();this.a=null;this.g=new _.T(tw)}cg(){return this.a}onContentWillLoad(a,b){const c=this;return _.x(function*(){var d=a.getConfiguration().yospace;if(d.enabled){if(typeof window.YospaceAdManagement!==_.Ee)throw new _.I(_.G,9,7003,"Yospace SDK not found.");c.g.info("Yospace enabled.");a:{d=d.streamType||uw;var e=b.url;c.g.info("Creating Yospace session for stream type",d);switch(d){case uw:d=YospaceAdManagement.SessionVOD.create(e);
2
- break a;case vw: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(_.G,9,7003,"Yospace session failed to initialize.");a.trigger(new _.F(_.Mg,{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 _.F(_.Lg,{detail:b}))}}id(){return"yospace"}};_.z(tw,ww);ww.prototype.getSession=ww.prototype.cg;ww.Id="yospace";_.Mr(new class{create(){return new ww}});var uw=_.Db,vw="LIVE";_.z("clpp.yospace.StreamType",{VOD:uw,LIVE:vw,DVR:"DVR"});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var jw="clpp.yospace.YospacePlugin",mw=class extends _.Iv{constructor(){super();this.a=null;this.g=new _.S(jw)}Tf(){return this.a}onContentWillLoad(a,b){const c=this;return _.w(function*(){var d=a.getConfiguration().yospace;if(d.enabled){if(typeof window.YospaceAdManagement!==_.Fe)throw new _.I(_.F,9,7003,"Yospace SDK not found.");c.g.info("Yospace enabled.");a:{d=d.streamType||kw;var e=b.url;c.g.info("Creating Yospace session for stream type",d);switch(d){case kw:d=YospaceAdManagement.SessionVOD.create(e);
2
+ break a;case lw: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(_.F,9,7003,"Yospace session failed to initialize.");a.trigger(new _.C(_.Og,{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 _.C(_.Ng,{detail:b}))}}id(){return"yospace"}};_.x(jw,mw);mw.prototype.getSession=mw.prototype.Tf;mw.Id="yospace";_.fs(new class{create(){return new mw}});var kw=_.Db,lw="LIVE";_.x("clpp.yospace.StreamType",{VOD:kw,LIVE:lw,DVR:"DVR"});};f.call(g, window);
package/cl.youbora.js CHANGED
@@ -1,29 +1,29 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var Tv="Unhandled state",Uv="accountCode key is missing in Youbora config",Vv="ad break start",Wv="ad buffering ended",Xv="ad buffering started",Yv="ad click through url: ",Zv="ad timeline changed",$v="clpp.npaw.NpawPlugin",aw="clpp.npaw.YouboraPlugin",bw="content.isLive",cw="content.title",dw="is container visible",ew="youbora",fw=function(a){return a.startsWith(_.td)?"Widevine":a.startsWith(_.pd)?"FairPlay":a.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":a.startsWith(_.Ne)?
2
- "ClearKey":a.startsWith(_.od)?"Primetime":a},gw=function(a){a.a&&(a.g.info("Removing NPAW Plugins",a.a),a.a.removeAdsAdapter(),a.a.removeAdapter())},hw=function(a,b){if(b.namespace()===_.dd)return a.g.info("NPAW does not report when casting."),!1;const c=b.getConfiguration().youbora;return _.dh(c)?c.accountCode?_.B(window.NpawPlugin)||_.B(window.NpawPluginAdapters)?(a.g.warn("NPAW SDK not found."),b.onError(new _.I(1,9,9100)),!1):!0:(a.g.warn(Uv),b.onError(new _.I(1,9,9101)),!1):(a.g.warn("NPAW plugin is loaded but not configured. Will do nothing."),
3
- !1)},iw=function(a,b){if(b.namespace()===_.dd)return a.g.info("Youbora does not report when casting."),!1;const c=b.getConfiguration().youbora;if(!_.dh(c))return a.g.debug("Youbora plugin is loaded but not configured. Will do nothing."),!1;if(!c.accountCode)return a.g.warn(Uv),b.onError(new _.I(1,9,9101)),!1;if(_.B(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 "+
4
- `version ${youbora.VERSION}. Some or all features of YouboraPlugin `+"may not work correctly."),b.onError(new _.I(1,9,9102)));return!0},jw=a=>(a=a.getConfiguration().youbora)&&a.errorFilter?a.errorFilter:b=>({code:`${b.code}`,message:b.message,severity:b.severity}),kw=(a,b,c,d)=>{b=jw(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===a.code?"ad error":_.r;b.severity===_.G?(d.fireFatalError(b.code,b.message,b.metadata),c.debug(`Reporting "fatal ${a}" to Youbora`,
5
- b.code,b)):(d.fireError(b.code,b.message,b.metadata),c.debug(`Reporting "${a}" to Youbora`,b.code,b));return b};var lw=a=>{class b extends youbora.Adapter{constructor(c){super(c);this.m=c;this.a=new _.Rt;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.qa())&&(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);return youbora.Util.buildRenditionString(c,
6
- 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.Fa())?c.frameRate:null}getPlayerName(){return _.ra}getVersion(){return"6.26.0-castlabsadapter-js"}getPlayerVersion(){return _.ea}registerListeners(){this.m&&this.a&&(this.g.debug("registering listeners"),
7
- youbora.Util.logAllEvents(this.m),this.a.on(this.m,_.Mf,this.I.bind(this)),this.a.on(this.m,_.r,this.F.bind(this)),this.a.on(this.m,_.lg,this.H.bind(this)),this.a.on(this.m,_.kg,this.G.bind(this)),this.a.on(this.m,_.pc,this.B.bind(this)),this.a.on(this.m,_.Rc,this.C.bind(this)))}unregisterListeners(){this.g.debug(_.xb);_.Fh(this.a)}dispose(){super.dispose()}j(){return this.m.getStats()||_.Lo()}w(){return!!this.m.getConfiguration().autoplay}I(c){c=c.detail;this.l("state change",c);if(c)switch(c.currentState){case _.Xo:this.w()&&
8
- this.f();break;case _.Zo:this.f();this.A();this.fireResume();this.fireBufferEnd();break;case _.Yo:this.w()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.Wo:this.fireBufferEnd();this.fireStop();break;case _.Oo:this.fireBufferEnd();this.o&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.So:this.fireBufferBegin();break;default:this.g.debug(Tv,c)}}f(){this.plugin.isInitiated||(this.h=!1,this.fireInit())}A(){var c=this.m.getDrmInfo();c&&(c=fw(c.keySystem))&&
9
- this.plugin.setOptions({"content.drm":c});this.fireJoin()}F(c){!(c=c.detail)||this.h||10003===c.code&&this.plugin.getAdsAdapter()||(c=kw(c,this.m,this.g,this))&&c.severity===_.G&&(this.h=!0)}H(){this.m.isEnded()||(this.l(_.Ef),this.f(),this.fireSeekBegin())}G(){this.l(_.Df);this.fireSeekEnd()}B(c){this.g.debug("adsTimeline",c);this.o=(c=c.adsTimeline)&&c.Jb()}C(c){this.g.debug("Casting",c);this.fireCasted()}l(c,...d){this.g.debug(`Reporting "${c}" event to Youbora`,...d)}}return new b(a)};var mw=a=>{class b extends youbora.Adapter{constructor(c){super(c);this.m=c;this.j=this.a=null;this.f=new _.Rt;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.fb(),this.a.eb(),this.a.Qa()));return c}getBitrate(){return this.a&&this.a.Qa()}getPlayhead(){const c=this.m.getAdsManager();return c&&c.getPosition()}getResource(){return this.a&&this.a.getMediaUrl()}getTitle(){return this.a&&
10
- 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.Ra()){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&&
11
- this.j.getCuePoints().length}getGivenBreaks(){return this.getExpectedBreaks()}getExpectedAds(){return this.a&&this.a.gb()}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(dw,c);return c}getPlayerName(){return _.ra}getVersion(){return"6.26.0-castlabsadsadapter-js"}getPlayerVersion(){return _.ea}registerListeners(){this.m&&
12
- this.f&&(this.f.on(this.m,_.pc,this.M.bind(this)),this.f.on(this.m,_.hc,this.L.bind(this)),this.f.on(this.m,_.dc,this.I.bind(this)),this.f.on(this.m,_.fc,this.J.bind(this)),this.f.on(this.m,_.Wb,this.G.bind(this)),this.f.on(this.m,_.Xb,this.o.bind(this,1)),this.f.on(this.m,_.cc,this.o.bind(this,2)),this.f.on(this.m,_.nc,this.o.bind(this,3)),this.f.on(this.m,_.Vb,this.F.bind(this)),this.f.on(this.m,_.gc,this.K.bind(this)),this.f.on(this.m,_.r,this.H.bind(this)),this.f.on(this.m,_.Sb,this.A.bind(this)),
13
- this.f.on(this.m,_.Tb,this.B.bind(this)),this.f.on(this.m,_.Ub,this.C.bind(this)),this.f.on(this.m,_.ec,this.w.bind(this)))}unregisterListeners(){_.Fh(this.f)}dispose(){super.dispose()}M(c){this.g.debug(Zv,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(Xv);this.fireBufferBegin()}w(){this.l&&
14
- (this.h(Wv),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.qb();this.g.debug(Yv,c);this.fireClick(c)}K(){this.h("ad skipped");this.fireSkip()}A(c){this.a=c.ad;this.h(Vv,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&&kw(c,this.m,this.g,this)}h(c,
15
- ...d){this.g.debug(`Reporting "${c}" event to Youbora`,...d)}}return new b(a)};var ow=()=>{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.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)}getIsLive(){return this.player.isLive()}getResource(){const b=
16
- 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.Fa())?b.frameRate:null}getPlayerName(){return _.ra}getVersion(){return"castlabs-adapter-6.26.0-js"}getPlayerVersion(){return _.ea}registerListeners(){const b=this.w();this.player&&b&&(b.on(this.player,_.Mf,this.K.bind(this)),b.on(this.player,
17
- _.r,this.H.bind(this)),b.on(this.player,_.Ef,this.J.bind(this)),b.on(this.player,_.Df,this.I.bind(this)),b.on(this.player,_.pc,this.F.bind(this)),b.on(this.player,_.Rc,this.G.bind(this)),b.on(this.player,_.Jc,this.L.bind(this)),b.on(this.player,_.Wf,this.M.bind(this)))}unregisterListeners(){nw.debug(_.xb);_.Fh(this.w())}dispose(){this.unregisterListeners();this.f=this.h=!1;this.a=null}j(){return this.player.getStats()||_.Lo()}o(){return!!this.player.getConfiguration().autoplay}K(b){b=b.detail;this.l("state change",
18
- b);if(b)switch(b.currentState){case _.Xo:this.plugin.setVideoOptions({"content.subtitles":this.C()});this.o()&&this.fireStart();break;case _.Zo:this.fireStart();this.A();this.fireResume();this.fireBufferEnd();break;case _.Yo:this.o()&&this.fireStart();this.A();this.fireBufferEnd();this.firePause();break;case _.Wo:this.fireBufferEnd();this.fireStop();break;case _.Oo:this.fireBufferEnd();this.h&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.So:this.fireBufferBegin();break;
19
- default:nw.debug(Tv,b)}}A(){this.fireJoin()}H(b){(b=b.detail)&&!this.f&&this.player&&10003!==b.code&&(b=kw(b,this.player,nw,this))&&b.severity===_.G&&(this.f=!0)}J(){this.player.isEnded()||(this.l(_.Ef),this.fireSeekBegin())}B(b){const c=this.player.getTrackManager();if(!c)return null;let d=null;"text"===b&&(d=c.ta());b===_.p&&(d=c.oa());return d?d.language:null}L(){const b=this.B(_.p);this.plugin.setVideoOptions({"content.language":b})}M(){const b=this.B("text"),c=this.C();this.plugin.setVideoOptions({"content.subtitles":b||
20
- c})}w(){this.a||(this.a=new _.Rt);return this.a}I(){this.l(_.Df);this.fireSeekEnd()}F(b){nw.debug("adsTimeline",b);this.h=(b=b.adsTimeline)&&b.Jb()}G(b){nw.debug("Casting",b);this.fireCasted()}l(b,...c){nw.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},nw=new _.T("clpp.npaw.NpawAdapter");var qw=()=>{class a extends NpawPluginAdapters.ads.Ima{constructor(){super();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.fb(),this.a.eb(),this.a.Qa()));return b}getBitrate(){let b=null;this.a&&(b=this.a.Qa());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());
21
- return b}getTitle(){let b=null;this.a&&(b=this.a.getTitle());return b}getProvider(){let b=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.Ra()){case 0:c=b.Preroll;break;case 2:c=b.Postroll;break;case 1:c=b.Midroll}pw.debug("Ad position",c);return c}getIsSkippable(){return this.a&&
22
- -1!==this.a.getSkipTimeOffset()}getAudioEnabled(){const b=this.player.getAdsManager();return b&&0<b.getVolume()}getExpectedBreaks(){return this.h&&this.h.getCuePoints().length}getGivenBreaks(){return this.getExpectedBreaks()}getExpectedAds(){return this.a&&this.a.gb()}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();
23
- b=this.getNpawUtils().calculateAdViewability(b);pw.debug(dw,b);return b}getPlayerName(){return _.ra}getVersion(){return"castlabs-ads-adapter-6.26.0-js"}getPlayerVersion(){return _.ea}B(){this.j||(this.j=new _.Rt);return this.j}registerListeners(){const b=this.B();this.player&&b&&(b.on(this.player,_.pc,this.R.bind(this)),b.on(this.player,_.hc,this.P.bind(this)),b.on(this.player,_.dc,this.K.bind(this)),b.on(this.player,_.fc,this.L.bind(this)),b.on(this.player,_.Wb,this.I.bind(this)),b.on(this.player,
24
- _.Xb,this.w.bind(this,1)),b.on(this.player,_.cc,this.w.bind(this,2)),b.on(this.player,_.nc,this.w.bind(this,3)),b.on(this.player,_.Vb,this.H.bind(this)),b.on(this.player,_.gc,this.M.bind(this)),b.on(this.player,_.r,this.J.bind(this)),b.on(this.player,_.Sb,this.C.bind(this)),b.on(this.player,_.Tb,this.F.bind(this)),b.on(this.player,_.Ub,this.G.bind(this)),b.on(this.player,_.ec,this.S.bind(this)))}unregisterListeners(){_.Fh(this.B())}R(b){pw.debug(Zv,b);this.h=b.adsTimeline}P(b){this.a=b.ad;this.f("ad start",
25
- this.a);this.fireStart();this.fireJoin()}I(){this.f("ad ended");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(Xv);this.fireBufferBegin()}S(){this.l=this.getPlayhead();this.A()}A(){this.o&&(this.f(Wv),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.qb();pw.debug(Yv,b);this.fireClick(b)}M(){this.f("ad skipped");
26
- this.fireSkip()}C(b){this.a=b.ad;this.f(Vv,this.a);this.fireBreakStart()}F(){this.f("ad break stop");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&&kw(b,this.player,pw,this)}f(b,...c){pw.debug(`Reporting "${b}" event to NPAW`,...c)}}return a},pw=new _.T("clpp.npaw.NpawAdsAdapter");var rw=class extends _.Sv{constructor(){super();this.a=null;this.g=new _.T($v);this.m=null}gf(a){gw(this);if(this.a=a)this.a.registerAdapterFromClass(this.m,ow()),this.a.registerAdsAdapterFromClass(this.m,qw())}Dh(){return this.a}getAdapter(){return this.a&&this.a.getAdapter()}getAdsAdapter(){return this.a&&this.a.getAdsAdapter()}onPlayerCreated(a){this.m=a;hw(this,a)&&(a=a.getConfiguration().youbora,this.gf(new NpawPlugin(a.accountCode)))}onContentWillLoad(a,b){if(hw(this,a)){a=a.getConfiguration();
27
- var c=a.youbora;void 0===c[bw]&&(c[bw]=b.isLive);void 0===c[cw]&&(c[cw]=b.name);void 0===c.viewerId&&(c.viewerId=a.viewerId);this.a||this.gf(new NpawPlugin(c.accountCode));this.a.setAnalyticsOptions(c)}}onContentLoaded(a){const b={};(a=a.getDrmInfo())&&(a=fw(a.keySystem))&&(b["content.drm"]=a);this.g.info(_.Ge,b);this.a.setAnalyticsOptions(b)}onPlayerWillRelease(){}onPlayerWillDestroy(){gw(this);this.a.destroy()}id(){return ew}};_.z($v,rw);rw.prototype.getAdsAdapter=rw.prototype.getAdsAdapter;
28
- rw.prototype.getAdapter=rw.prototype.getAdapter;rw.prototype.getNpawPlugin=rw.prototype.Dh;rw.prototype.setNpawPlugin=rw.prototype.gf;rw.Id=ew;new _.T($v);var sw=class extends _.Sv{constructor(){super();this.a=null;this.g=new _.T(aw);this.m=null}hf(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(lw(this.m)),this.a.setAdsAdapter(mw(this.m))}getAdapter(){return this.a&&this.a.getAdapter()}getAdsAdapter(){return this.a&&this.a.getAdsAdapter()}onPlayerCreated(a){this.m=a;iw(this,a)&&(a=a.getConfiguration().youbora,this.hf(new youbora.Plugin(a)))}onContentWillLoad(a,b){if(iw(this,a)){a=a.getConfiguration();var c=
29
- a.youbora;void 0===c[bw]&&(c[bw]=b.isLive);void 0===c[cw]&&(c[cw]=b.name);void 0===c.viewerId&&(c.viewerId=a.viewerId);this.a||this.hf(new youbora.Plugin(c));this.a.setOptions(c)}}onPlayerWillRelease(){}onPlayerWillDestroy(){}id(){return ew}};_.z(aw,sw);sw.prototype.getAdsAdapter=sw.prototype.getAdsAdapter;sw.prototype.getAdapter=sw.prototype.getAdapter;sw.prototype.setYouboraPlugin=sw.prototype.hf;sw.Id=ew;_.Mr(new class{create(a){return a.youbora&&a.youbora.v7?new rw:new sw}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var Jv="Unhandled state",Kv="accountCode key is missing in Youbora config",Lv="ad break start",Mv="ad buffering ended",Nv="ad buffering started",Ov="ad click through url: ",Pv="ad timeline changed",Qv="clpp.npaw.NpawPlugin",Rv="clpp.npaw.YouboraPlugin",Sv="content.isLive",Tv="content.title",Uv="is container visible",Vv="youbora",Wv=function(a){return a.startsWith(_.ud)?"Widevine":a.startsWith(_.qd)?"FairPlay":a.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":a.startsWith(_.Oe)?
2
+ "ClearKey":a.startsWith(_.pd)?"Primetime":a},Xv=function(a){a.a&&(a.g.info("Removing NPAW Plugins",a.a),a.a.removeAdsAdapter(),a.a.removeAdapter())},Yv=function(a,b){if(b.namespace()===_.ed)return a.g.info("NPAW does not report when casting."),!1;const c=b.getConfiguration().youbora;return _.fh(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(Kv),b.onError(new _.I(1,9,9101)),!1):(a.g.warn("NPAW plugin is loaded but not configured. Will do nothing."),
3
+ !1)},Zv=function(a,b){if(b.namespace()===_.ed)return a.g.info("Youbora does not report when casting."),!1;const c=b.getConfiguration().youbora;if(!_.fh(c))return a.g.debug("Youbora plugin is loaded but not configured. Will do nothing."),!1;if(!c.accountCode)return a.g.warn(Kv),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 "+
4
+ `version ${youbora.VERSION}. Some or all features of YouboraPlugin `+"may not work correctly."),b.onError(new _.I(1,9,9102)));return!0},$v=a=>(a=a.getConfiguration().youbora)&&a.errorFilter?a.errorFilter:b=>({code:`${b.code}`,message:b.message,severity:b.severity}),aw=(a,b,c,d)=>{b=$v(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===a.code?"ad error":_.Ud;b.severity===_.F?(d.fireFatalError(b.code,b.message,b.metadata),c.debug(`Reporting "fatal ${a}" to Youbora`,
5
+ b.code,b)):(d.fireError(b.code,b.message,b.metadata),c.debug(`Reporting "${a}" to Youbora`,b.code,b));return b};var bw=a=>{class b extends youbora.Adapter{constructor(c){super(c);this.m=c;this.a=new _.Kt;this.g=new _.S("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.qa())&&(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);return youbora.Util.buildRenditionString(c,
6
+ 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.Ea())?c.frameRate:null}getPlayerName(){return _.ra}getVersion(){return"6.27.0-castlabsadapter-js"}getPlayerVersion(){return _.ea}registerListeners(){this.m&&this.a&&(this.g.debug("registering listeners"),
7
+ youbora.Util.logAllEvents(this.m),this.a.on(this.m,_.Nf,this.I.bind(this)),this.a.on(this.m,_.Ud,this.F.bind(this)),this.a.on(this.m,_.ng,this.H.bind(this)),this.a.on(this.m,_.mg,this.G.bind(this)),this.a.on(this.m,_.pc,this.B.bind(this)),this.a.on(this.m,_.Rc,this.C.bind(this)))}unregisterListeners(){this.g.debug(_.xb);_.Hh(this.a)}dispose(){super.dispose()}j(){return this.m.getStats()||_.ep()}w(){return!!this.m.getConfiguration().autoplay}I(c){c=c.detail;this.l("state change",c);if(c)switch(c.currentState){case _.qp:this.w()&&
8
+ this.f();break;case _.sp:this.f();this.A();this.fireResume();this.fireBufferEnd();break;case _.rp:this.w()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.pp:this.fireBufferEnd();this.fireStop();break;case _.hp:this.fireBufferEnd();this.o&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.lp:this.fireBufferBegin();break;default:this.g.debug(Jv,c)}}f(){this.plugin.isInitiated||(this.h=!1,this.fireInit())}A(){var c=this.m.getDrmInfo();c&&(c=Wv(c.keySystem))&&
9
+ this.plugin.setOptions({"content.drm":c});this.fireJoin()}F(c){!(c=c.detail)||this.h||10003===c.code&&this.plugin.getAdsAdapter()||(c=aw(c,this.m,this.g,this))&&c.severity===_.F&&(this.h=!0)}H(){this.m.isEnded()||(this.l(_.Ff),this.f(),this.fireSeekBegin())}G(){this.l(_.Ef);this.fireSeekEnd()}B(c){this.g.debug("adsTimeline",c);this.o=(c=c.adsTimeline)&&c.Fb()}C(c){this.g.debug("Casting",c);this.fireCasted()}l(c,...d){this.g.debug(`Reporting "${c}" event to Youbora`,...d)}}return new b(a)};var cw=a=>{class b extends youbora.Adapter{constructor(c){super(c);this.m=c;this.j=this.a=null;this.f=new _.Kt;this.g=new _.S("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.bb(),this.a.ab(),this.a.Na()));return c}getBitrate(){return this.a&&this.a.Na()}getPlayhead(){const c=this.m.getAdsManager();return c&&c.getPosition()}getResource(){return this.a&&this.a.getMediaUrl()}getTitle(){return this.a&&
10
+ 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.Oa()){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&&
11
+ this.j.getCuePoints().length}getGivenBreaks(){return this.getExpectedBreaks()}getExpectedAds(){return this.a&&this.a.cb()}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(Uv,c);return c}getPlayerName(){return _.ra}getVersion(){return"6.27.0-castlabsadsadapter-js"}getPlayerVersion(){return _.ea}registerListeners(){this.m&&
12
+ this.f&&(this.f.on(this.m,_.pc,this.M.bind(this)),this.f.on(this.m,_.kc,this.L.bind(this)),this.f.on(this.m,_.dc,this.I.bind(this)),this.f.on(this.m,_.fc,this.J.bind(this)),this.f.on(this.m,_.Wb,this.G.bind(this)),this.f.on(this.m,_.Xb,this.o.bind(this,1)),this.f.on(this.m,_.cc,this.o.bind(this,2)),this.f.on(this.m,_.nc,this.o.bind(this,3)),this.f.on(this.m,_.Vb,this.F.bind(this)),this.f.on(this.m,_.gc,this.K.bind(this)),this.f.on(this.m,_.Ud,this.H.bind(this)),this.f.on(this.m,_.Sb,this.A.bind(this)),
13
+ this.f.on(this.m,_.Tb,this.B.bind(this)),this.f.on(this.m,_.Ub,this.C.bind(this)),this.f.on(this.m,_.ec,this.w.bind(this)))}unregisterListeners(){_.Hh(this.f)}dispose(){super.dispose()}M(c){this.g.debug(Pv,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(Nv);this.fireBufferBegin()}w(){this.l&&
14
+ (this.h(Mv),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.nb();this.g.debug(Ov,c);this.fireClick(c)}K(){this.h("ad skipped");this.fireSkip()}A(c){this.a=c.ad;this.h(Lv,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&&aw(c,this.m,this.g,this)}h(c,
15
+ ...d){this.g.debug(`Reporting "${c}" event to Youbora`,...d)}}return new b(a)};var ew=()=>{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.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)}getIsLive(){return this.player.isLive()}getResource(){const b=
16
+ 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.Ea())?b.frameRate:null}getPlayerName(){return _.ra}getVersion(){return"castlabs-adapter-6.27.0-js"}getPlayerVersion(){return _.ea}registerListeners(){const b=this.w();this.player&&b&&(b.on(this.player,_.Nf,this.K.bind(this)),b.on(this.player,
17
+ _.Ud,this.H.bind(this)),b.on(this.player,_.Ff,this.J.bind(this)),b.on(this.player,_.Ef,this.I.bind(this)),b.on(this.player,_.pc,this.F.bind(this)),b.on(this.player,_.Rc,this.G.bind(this)),b.on(this.player,_.Jc,this.L.bind(this)),b.on(this.player,_.Yf,this.M.bind(this)))}unregisterListeners(){dw.debug(_.xb);_.Hh(this.w())}dispose(){this.unregisterListeners();this.f=this.h=!1;this.a=null}j(){return this.player.getStats()||_.ep()}o(){return!!this.player.getConfiguration().autoplay}K(b){b=b.detail;this.l("state change",
18
+ b);if(b)switch(b.currentState){case _.qp:this.plugin.setVideoOptions({"content.subtitles":this.C()});this.o()&&this.fireStart();break;case _.sp:this.fireStart();this.A();this.fireResume();this.fireBufferEnd();break;case _.rp:this.o()&&this.fireStart();this.A();this.fireBufferEnd();this.firePause();break;case _.pp:this.fireBufferEnd();this.fireStop();break;case _.hp:this.fireBufferEnd();this.h&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.lp:this.fireBufferBegin();break;
19
+ default:dw.debug(Jv,b)}}A(){this.fireJoin()}H(b){(b=b.detail)&&!this.f&&this.player&&10003!==b.code&&(b=aw(b,this.player,dw,this))&&b.severity===_.F&&(this.f=!0)}J(){this.player.isEnded()||(this.l(_.Ff),this.fireSeekBegin())}B(b){const c=this.player.getTrackManager();if(!c)return null;let d=null;b===_.Vf&&(d=c.ta());b===_.q&&(d=c.oa());return d?d.language:null}L(){const b=this.B(_.q);this.plugin.setVideoOptions({"content.language":b})}M(){const b=this.B(_.Vf),c=this.C();this.plugin.setVideoOptions({"content.subtitles":b||
20
+ c})}w(){this.a||(this.a=new _.Kt);return this.a}I(){this.l(_.Ef);this.fireSeekEnd()}F(b){dw.debug("adsTimeline",b);this.h=(b=b.adsTimeline)&&b.Fb()}G(b){dw.debug("Casting",b);this.fireCasted()}l(b,...c){dw.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},dw=new _.S("clpp.npaw.NpawAdapter");var gw=()=>{class a extends NpawPluginAdapters.ads.Ima{constructor(){super();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.bb(),this.a.ab(),this.a.Na()));return b}getBitrate(){let b=null;this.a&&(b=this.a.Na());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());
21
+ return b}getTitle(){let b=null;this.a&&(b=this.a.getTitle());return b}getProvider(){let b=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.Oa()){case 0:c=b.Preroll;break;case 2:c=b.Postroll;break;case 1:c=b.Midroll}fw.debug("Ad position",c);return c}getIsSkippable(){return this.a&&
22
+ -1!==this.a.getSkipTimeOffset()}getAudioEnabled(){const b=this.player.getAdsManager();return b&&0<b.getVolume()}getExpectedBreaks(){return this.h&&this.h.getCuePoints().length}getGivenBreaks(){return this.getExpectedBreaks()}getExpectedAds(){return this.a&&this.a.cb()}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();
23
+ b=this.getNpawUtils().calculateAdViewability(b);fw.debug(Uv,b);return b}getPlayerName(){return _.ra}getVersion(){return"castlabs-ads-adapter-6.27.0-js"}getPlayerVersion(){return _.ea}B(){this.j||(this.j=new _.Kt);return this.j}registerListeners(){const b=this.B();this.player&&b&&(b.on(this.player,_.pc,this.R.bind(this)),b.on(this.player,_.kc,this.P.bind(this)),b.on(this.player,_.dc,this.K.bind(this)),b.on(this.player,_.fc,this.L.bind(this)),b.on(this.player,_.Wb,this.I.bind(this)),b.on(this.player,
24
+ _.Xb,this.w.bind(this,1)),b.on(this.player,_.cc,this.w.bind(this,2)),b.on(this.player,_.nc,this.w.bind(this,3)),b.on(this.player,_.Vb,this.H.bind(this)),b.on(this.player,_.gc,this.M.bind(this)),b.on(this.player,_.Ud,this.J.bind(this)),b.on(this.player,_.Sb,this.C.bind(this)),b.on(this.player,_.Tb,this.F.bind(this)),b.on(this.player,_.Ub,this.G.bind(this)),b.on(this.player,_.ec,this.T.bind(this)))}unregisterListeners(){_.Hh(this.B())}R(b){fw.debug(Pv,b);this.h=b.adsTimeline}P(b){this.a=b.ad;this.f("ad start",
25
+ this.a);this.fireStart();this.fireJoin()}I(){this.f("ad ended");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(Nv);this.fireBufferBegin()}T(){this.l=this.getPlayhead();this.A()}A(){this.o&&(this.f(Mv),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.nb();fw.debug(Ov,b);this.fireClick(b)}M(){this.f("ad skipped");
26
+ this.fireSkip()}C(b){this.a=b.ad;this.f(Lv,this.a);this.fireBreakStart()}F(){this.f("ad break stop");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&&aw(b,this.player,fw,this)}f(b,...c){fw.debug(`Reporting "${b}" event to NPAW`,...c)}}return a},fw=new _.S("clpp.npaw.NpawAdsAdapter");var hw=class extends _.Iv{constructor(){super();this.a=null;this.g=new _.S(Qv);this.m=null}Ye(a){Xv(this);if(this.a=a)this.a.registerAdapterFromClass(this.m,ew()),this.a.registerAdsAdapterFromClass(this.m,gw())}uh(){return this.a}getAdapter(){return this.a&&this.a.getAdapter()}getAdsAdapter(){return this.a&&this.a.getAdsAdapter()}onPlayerCreated(a){this.m=a;Yv(this,a)&&(a=a.getConfiguration().youbora,this.Ye(new NpawPlugin(a.accountCode)))}onContentWillLoad(a,b){if(Yv(this,a)){a=a.getConfiguration();
27
+ var c=a.youbora;void 0===c[Sv]&&(c[Sv]=b.isLive);void 0===c[Tv]&&(c[Tv]=b.name);void 0===c.viewerId&&(c.viewerId=a.viewerId);this.a||this.Ye(new NpawPlugin(c.accountCode));this.a.setAnalyticsOptions(c)}}onContentLoaded(a){const b={};(a=a.getDrmInfo())&&(a=Wv(a.keySystem))&&(b["content.drm"]=a);this.g.info(_.He,b);this.a.setAnalyticsOptions(b)}onPlayerWillRelease(){}onPlayerWillDestroy(){Xv(this);this.a.destroy()}id(){return Vv}};_.x(Qv,hw);hw.prototype.getAdsAdapter=hw.prototype.getAdsAdapter;
28
+ hw.prototype.getAdapter=hw.prototype.getAdapter;hw.prototype.getNpawPlugin=hw.prototype.uh;hw.prototype.setNpawPlugin=hw.prototype.Ye;hw.Id=Vv;new _.S(Qv);var iw=class extends _.Iv{constructor(){super();this.a=null;this.g=new _.S(Rv);this.m=null}Ze(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(bw(this.m)),this.a.setAdsAdapter(cw(this.m))}getAdapter(){return this.a&&this.a.getAdapter()}getAdsAdapter(){return this.a&&this.a.getAdsAdapter()}onPlayerCreated(a){this.m=a;Zv(this,a)&&(a=a.getConfiguration().youbora,this.Ze(new youbora.Plugin(a)))}onContentWillLoad(a,b){if(Zv(this,a)){a=a.getConfiguration();var c=
29
+ a.youbora;void 0===c[Sv]&&(c[Sv]=b.isLive);void 0===c[Tv]&&(c[Tv]=b.name);void 0===c.viewerId&&(c.viewerId=a.viewerId);this.a||this.Ze(new youbora.Plugin(c));this.a.setOptions(c)}}onPlayerWillRelease(){}onPlayerWillDestroy(){}id(){return Vv}};_.x(Rv,iw);iw.prototype.getAdsAdapter=iw.prototype.getAdsAdapter;iw.prototype.getAdapter=iw.prototype.getAdapter;iw.prototype.setYouboraPlugin=iw.prototype.Ze;iw.Id=Vv;_.fs(new class{create(a){return a.youbora&&a.youbora.v7?new hw:new iw}});};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.26.0",
4
+ "version": "6.27.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/castlabs/prestoplay-web.git"
package/typings.d.ts CHANGED
@@ -304,6 +304,45 @@ export namespace clpp {
304
304
  uuid: string;
305
305
  }
306
306
 
307
+ /**
308
+ * Common Media Client Data (CMCD) configuration.
309
+ */
310
+ export type CmcdConfiguration = {
311
+ /**
312
+ * A unique string identifying the current content.
313
+ * Maximum length is 64 characters. This value is
314
+ * consistent across multiple different sessions and
315
+ * devices and is defined and updated at the
316
+ * discretion of the service provider.
317
+ */
318
+ contentId?: string;
319
+ /**
320
+ * Defines how CMCD data is transmitted. Use 'query' to send data via URL
321
+ * query parameter or 'headers' to send it via HTTP headers.
322
+ */
323
+ deliveryMode?: string;
324
+ /**
325
+ * If true, CMCD is enabled.
326
+ */
327
+ enabled?: boolean;
328
+ /**
329
+ * A coefficient which multiplies the value of rtp (requested maximum
330
+ * throughput) property. If rtpMultiplier=1 the value of rtp is calculated
331
+ * by the SDK as the min value needed to avoid buffering.
332
+ */
333
+ rtpMultiplier?: number;
334
+ /**
335
+ * Session ID to be sent in the CMCD headers. If undefined,
336
+ * the player will use its internal session ID.
337
+ */
338
+ sessionId?: string;
339
+ /**
340
+ * The only available version is 1. Changing this field
341
+ * will not change anything.
342
+ */
343
+ version?: number;
344
+ }
345
+
307
346
  /**
308
347
  * The purpose of companion SDK info is to be able to send info about
309
348
  * react-native SDK to our analytics
@@ -4595,6 +4634,12 @@ export namespace clpp {
4595
4634
  * This is an internal error and shouldn't be propagated.
4596
4635
  */
4597
4636
  ATTEMPTS_EXHAUSTED = 1010,
4637
+ /**
4638
+ * A network request was made with a malformed URL.
4639
+ * The {@link clpp.Error#data|data} property contains an object with the
4640
+ * following properties:
4641
+ */
4642
+ MALFORMED_URL = 1011,
4598
4643
  /**
4599
4644
  * The text parser failed to parse a text stream due to an invalid header.
4600
4645
  */
@@ -5050,6 +5095,11 @@ export namespace clpp {
5050
5095
  * after an update.
5051
5096
  */
5052
5097
  HLS_INCOMPATIBLE_PLAYLIST_UPDATE = 4047,
5098
+ /**
5099
+ * Media playlists for selected tracks in live represent disjoint time ranges
5100
+ * and therefore cannot be played together.
5101
+ */
5102
+ HLS_DISJOINT_PLAYLISTS = 4048,
5053
5103
  /**
5054
5104
  * The StreamingEngine called onChooseStreams() but the callback receiver
5055
5105
  * did not return the correct number or type of Streams.
@@ -5811,6 +5861,10 @@ export namespace clpp {
5811
5861
  }
5812
5862
 
5813
5863
  namespace cast {
5864
+ /**
5865
+ * Returns instance of Queue.
5866
+ */
5867
+ function createCastQueue(): clpp.cast.Queue;
5814
5868
  export class CastProxy {
5815
5869
  /**
5816
5870
  * @param player player instance to use. This instance will be
@@ -5871,6 +5925,20 @@ export namespace clpp {
5871
5925
  * Checks if we are currently casting.
5872
5926
  */
5873
5927
  isCasting(): boolean;
5928
+ /**
5929
+ * Add items to the receiver queue.
5930
+ *
5931
+ * @param items queue items
5932
+ */
5933
+ queueAddItems(items: Array<any>): Promise<void>;
5934
+ /**
5935
+ * Requests the receiver to advance to the next queue item.
5936
+ */
5937
+ queueNextItem(): Promise<void>;
5938
+ /**
5939
+ * Requests the receiver to move to the previous queue item.
5940
+ */
5941
+ queuePreviousItem(): Promise<void>;
5874
5942
  /**
5875
5943
  * Remove message listener to 'urn:x-cast:castlabs' namespace.
5876
5944
  */
@@ -5938,6 +6006,10 @@ export namespace clpp {
5938
6006
 
5939
6007
  }
5940
6008
 
6009
+ export class Queue {
6010
+
6011
+ }
6012
+
5941
6013
  export class Receiver {
5942
6014
  /**
5943
6015
  * Add custom message listener to 'urn:x-cast:castlabs' namespace.
@@ -5954,6 +6026,11 @@ export namespace clpp {
5954
6026
  * Returns singleton instance of cast receiver.
5955
6027
  */
5956
6028
  static getInstance(): clpp.cast.Receiver;
6029
+ /**
6030
+ * Returns the Cast queue manager which exposes queue manipulation APIs for
6031
+ * the active receiver session.
6032
+ */
6033
+ getQueueManager(): any|undefined;
5957
6034
  /**
5958
6035
  * Binds instance of player to cast receiver. Ideally this should be called
5959
6036
  * before invoking `start()`.
@@ -6062,6 +6139,12 @@ export namespace clpp {
6062
6139
  * });
6063
6140
  */
6064
6141
  setPlayerConfigInterceptor(interceptor: clpp.cast.utils.PlayerConfigInterceptor|null): void;
6142
+ /**
6143
+ * Sets the queue instance.
6144
+ *
6145
+ * @param queue queue instance
6146
+ */
6147
+ setQueue(queue: any): void;
6065
6148
  /**
6066
6149
  * Starts receiver application.
6067
6150
  */