@castlabs/prestoplay 6.4.1 → 6.5.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 (58) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +6 -6
  5. package/cjs/cl.cast.js +110 -110
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +419 -416
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +72 -72
  10. package/cjs/cl.externs.js +26 -26
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +47 -47
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +31 -31
  15. package/cjs/cl.ima.js +22 -22
  16. package/cjs/cl.mse.js +258 -255
  17. package/cjs/cl.muxdata.js +12 -12
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +14 -14
  20. package/cjs/cl.playlist.js +6 -6
  21. package/cjs/cl.smooth.js +69 -69
  22. package/cjs/cl.thumbnails.js +24 -24
  23. package/cjs/cl.tizen.js +71 -71
  24. package/cjs/cl.ttml.js +27 -27
  25. package/cjs/cl.verimatrix.js +5 -5
  26. package/cjs/cl.vimond.js +13 -13
  27. package/cjs/cl.vr.js +19 -18
  28. package/cjs/cl.vtt.js +14 -14
  29. package/cjs/cl.youbora.js +20 -20
  30. package/cl.adobe.js +3 -3
  31. package/cl.airplay.js +3 -3
  32. package/cl.broadpeak.js +5 -5
  33. package/cl.cast.js +88 -88
  34. package/cl.conviva.js +27 -27
  35. package/cl.core.js +354 -351
  36. package/cl.crypto.js +8 -8
  37. package/cl.dash.js +66 -66
  38. package/cl.externs.js +26 -26
  39. package/cl.freewheel.js +19 -19
  40. package/cl.hls.js +40 -39
  41. package/cl.hlssmpte.js +5 -5
  42. package/cl.htmlcue.js +25 -25
  43. package/cl.ima.js +16 -16
  44. package/cl.mse.js +230 -231
  45. package/cl.muxdata.js +8 -8
  46. package/cl.onboard.js +4 -4
  47. package/cl.persistent.js +9 -9
  48. package/cl.playlist.js +5 -5
  49. package/cl.smooth.js +58 -58
  50. package/cl.thumbnails.js +17 -17
  51. package/cl.tizen.js +57 -57
  52. package/cl.ttml.js +22 -22
  53. package/cl.verimatrix.js +4 -4
  54. package/cl.vimond.js +8 -8
  55. package/cl.vr.js +15 -14
  56. package/cl.vtt.js +12 -12
  57. package/cl.youbora.js +15 -16
  58. package/package.json +6 -2
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 hq=" The setting will be ignored.",iq="VTT parser encountered an invalid VTT setting: ",jq="application/x-subrip",kq="text/srt",lq='text/vtt; codecs\x3d"vtt"',mq='text/vtt; codecs\x3d"wvtt"',nq=function(a){return a.a==a.f.length?null:(a=_.og(a,/[^ \t\n]*/gm))?a[0]:null},oq=function(a){_.og(a,/[ \t]+/gm)},pq=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},qq=function(a){a=_.og(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)},sq=function(a,b,c){let d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"==b?a.textAlign=_.po:a.textAlign=_.vo[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"==d[1]?_.De:_.Ee;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==_.kd||b==_.he?_.kd:b==_.ld||b==_.Uc?_.ld:
4
- _.rc);else if(d=/^region:(.*)$/.exec(b)){if(b=rq(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=_.wo[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.ro,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.wo[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},rq=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)},uq=function(a,b,c){let d,e,f;(new _.Fj).L("payl",_.Aj(g=>{d=_.yg(g)})).L("iden",_.Aj(g=>{e=_.yg(g)})).L("sttg",_.Aj(g=>{f=_.yg(g)})).parse(a);return d?tq(d,e,f,b,c):null},tq=function(a,b,c,d,e){a=new _.uo(d,e,a);b&&(a.id=b);if(c)for(b=new _.Mg(c),c=nq(b);c;)sq(a,c,[])||_.B(iq,c,hq),oq(b),c=nq(b);return a},vq=class{a(a){a=_.yg(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+=pq(c)}return _.Cg(b)}},wq=class{create(){return new vq}probe(a,b){return(a===kq||a===jq)&&b===_.re}};var xq=class{constructor(a){this.a=a}parseInit(){}parseMedia(a,b){a=_.yg(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 _.H(_.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=qq(new _.Mg(d[1]));if(null==a)throw new _.H(_.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 _.Mg(f.replace(/\n/g," "));d=new _.zo;nq(e);oq(e);for(var g=nq(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,hq);oq(e);g=nq(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 _.Mg(l[0]);g=qq(d);const q=_.og(d,/[ \t]+--\x3e[ \t]+/g);k=qq(d);if(null==g||null==q||null==k)throw new _.H(_.F,2,2001);g+=h;k+=h;l=l.slice(1).join("\n").trim();g=new _.uo(g,k,l,_.Me);e&&(g.id=e);oq(d);for(k=nq(d);k;)sq(g,k,c)||_.B(iq,k,hq),oq(d),k=nq(d);null!=e&&(g.id=e);c=g}c&&m.push(c)}return{cues:m,styles:f}}};var yq=class extends xq{parseMedia(a,b){return super.parseMedia((new vq).a(a),b)}};var zq=class{constructor(){this.a=null;this.f=new _.O("clpp.vtt.mp4")}parseInit(a){let b=!1;(new _.Fj).L(_.vd,_.N).L(_.ue,_.N).L(_.qd,_.N).X("mdhd",c=>{0==c.version?(c.G.skip(4),c.G.skip(4),this.a=_.M(c.G),c.G.skip(4)):(c.G.skip(8),c.G.skip(8),this.a=_.M(c.G),c.G.skip(8));c.G.skip(4)}).L(_.ud,_.N).L(_.ke,_.N).X(_.me,_.zj).L("wvtt",()=>{b=!0}).parse(a);if(!this.a)throw new _.H(_.F,2,2008);if(!b)throw new _.H(_.F,2,2008);}parseMedia(a,b){if(!this.a)throw this.f.error("No init segment for MP4+VTT!"),
10
- new _.H(_.F,2,2008);let c=0,d=[],e;const f=[];let g=!1,h=!1,k=!1,l=null;(new _.Fj).L("moof",_.N).L("traf",_.N).X("tfdt",q=>{g=!0;c=0==q.version?_.M(q.G):_.vj(q.G)}).X("tfhd",q=>{var t=q.flags;q=q.G;q.skip(4);t&1&&q.skip(8);t&2&&q.skip(4);l=t&8?_.M(q):null}).X("trun",q=>{h=!0;{var t=q.version,u=q.flags;q=q.G;const y=_.M(q);u&1&&q.skip(4);u&4&&q.skip(4);const A=[];for(let E=0;E<y;E++){const D={duration:null,sampleSize:null,Yd:null};u&256&&(D.duration=_.M(q));u&512&&(D.sampleSize=_.M(q));u&1024&&q.skip(4);
11
- u&2048&&(D.Yd=0==t?_.M(q):_.tj(q));A.push(D)}d=A}}).L(_.pd,_.Aj(q=>{k=!0;e=q})).parse(a);if(!k&&!g&&!h)throw new _.H(_.F,2,2008);a=c;var m=new DataView(e.buffer,e.byteOffset,e.byteLength);m=new _.ok(m,!1);for(const q of d){const t=q.duration||l,u=q.Yd?c+q.Yd:a;a=u+(t||0);let y=0;do{const A=_.M(m);y+=A;var n=_.M(m);n=_.yj(n);let E=null;"vttc"==n?8<A&&(E=_.wj(m,A-8)):("vtte"!=n&&this.f.error("Unknown box "+n+"! Skipping!"),m.skip(A-8));t?E&&f.push(uq(E,b.periodStart+u/this.a,b.periodStart+a/this.a)):
12
- this.f.error("WVTT sample duration unknown, and no default found!")}while(q.sampleSize&&y<q.sampleSize)}return{cues:f.filter(_.Yf),styles:[]}}};_.x("clpp.vtt.VttComponent",class extends _.Bp{constructor(){super();this.h=new wq}f(){_.$n[_.re]=xq;_.$n[lq]=xq;_.$n[mq]=xq;_.$n[_.Ub]=zq;_.$n[kq]=yq;_.$n[jq]=yq;_.Eh.push(this.h)}a(){_.ao(_.re);_.ao(lq);_.ao(mq);_.ao(_.Ub);_.ao(kq);_.ao(jq);_.Gh(this.h)}id(){return _.pe}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var kq=" The setting will be ignored.",lq="VTT parser encountered an invalid VTT setting: ",mq="application/x-subrip",nq="text/srt",oq='text/vtt; codecs\x3d"vtt"',pq='text/vtt; codecs\x3d"wvtt"',qq=function(a){return a.a==a.f.length?null:(a=_.qg(a,/[^ \t\n]*/gm))?a[0]:null},rq=function(a){_.qg(a,/[ \t]+/gm)},sq=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},tq=function(a){a=_.qg(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)},vq=function(a,b,c){let d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"==b?a.textAlign=_.so:a.textAlign=_.yo[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"==d[1]?_.Ee:_.Ge;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==_.ld||b==_.ie?_.ld:b==_.md||b==_.Vc?_.md:
4
+ _.rc);else if(d=/^region:(.*)$/.exec(b)){if(b=uq(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=_.zo[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.uo,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.zo[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},uq=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)},xq=function(a,b,c){let d,e,f;(new _.Hj).N("payl",_.Cj(g=>{d=_.Ag(g)})).N("iden",_.Cj(g=>{e=_.Ag(g)})).N("sttg",_.Cj(g=>{f=_.Ag(g)})).parse(a);return d?wq(d,e,f,b,c):null},wq=function(a,b,c,d,e){a=new _.xo(d,e,a);b&&(a.id=b);if(c)for(b=new _.Og(c),c=qq(b);c;)vq(a,c,[])||_.B(lq,c,kq),rq(b),c=qq(b);return a},yq=class{a(a){a=_.Ag(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+=sq(c)}return _.Eg(b)}},zq=class{create(){return new yq}probe(a,b){return(a===nq||a===mq)&&b===_.se}};var Aq=class{constructor(a){this.a=a}parseInit(){}parseMedia(a,b){a=_.Ag(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 _.H(_.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=tq(new _.Og(d[1]));if(null==a)throw new _.H(_.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 _.Og(f.replace(/\n/g," "));d=new _.Co;qq(e);rq(e);for(var g=qq(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,kq);rq(e);g=qq(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 _.Og(l[0]);g=tq(d);const q=_.qg(d,/[ \t]+--\x3e[ \t]+/g);k=tq(d);if(null==g||null==q||null==k)throw new _.H(_.F,2,2001);g+=h;k+=h;l=l.slice(1).join("\n").trim();g=new _.xo(g,k,l,_.Ne);e&&(g.id=e);rq(d);for(k=qq(d);k;)vq(g,k,c)||_.B(lq,k,kq),rq(d),k=qq(d);null!=e&&(g.id=e);c=g}c&&m.push(c)}return{cues:m,styles:f}}};var Bq=class extends Aq{parseMedia(a,b){return super.parseMedia((new yq).a(a),b)}};var Cq=class{constructor(){this.a=null;this.f=new _.O("clpp.vtt.mp4")}parseInit(a){let b=!1;(new _.Hj).N(_.wd,_.N).N(_.ve,_.N).N(_.rd,_.N).Y("mdhd",c=>{0==c.version?(c.H.skip(4),c.H.skip(4),this.a=_.M(c.H),c.H.skip(4)):(c.H.skip(8),c.H.skip(8),this.a=_.M(c.H),c.H.skip(8));c.H.skip(4)}).N(_.vd,_.N).N(_.le,_.N).Y(_.ne,_.Bj).N("wvtt",()=>{b=!0}).parse(a);if(!this.a)throw new _.H(_.F,2,2008);if(!b)throw new _.H(_.F,2,2008);}parseMedia(a,b){if(!this.a)throw this.f.error("No init segment for MP4+VTT!"),
10
+ new _.H(_.F,2,2008);let c=0,d=[],e;const f=[];let g=!1,h=!1,k=!1,l=null;(new _.Hj).N("moof",_.N).N("traf",_.N).Y("tfdt",q=>{g=!0;c=0==q.version?_.M(q.H):_.xj(q.H)}).Y("tfhd",q=>{var t=q.flags;q=q.H;q.skip(4);t&1&&q.skip(8);t&2&&q.skip(4);l=t&8?_.M(q):null}).Y("trun",q=>{h=!0;{var t=q.version,u=q.flags;q=q.H;const y=_.M(q);u&1&&q.skip(4);u&4&&q.skip(4);const A=[];for(let E=0;E<y;E++){const D={duration:null,sampleSize:null,$d:null};u&256&&(D.duration=_.M(q));u&512&&(D.sampleSize=_.M(q));u&1024&&q.skip(4);
11
+ u&2048&&(D.$d=0==t?_.M(q):_.vj(q));A.push(D)}d=A}}).N(_.qd,_.Cj(q=>{k=!0;e=q})).parse(a);if(!k&&!g&&!h)throw new _.H(_.F,2,2008);a=c;var m=new DataView(e.buffer,e.byteOffset,e.byteLength);m=new _.qk(m,!1);for(const q of d){const t=q.duration||l,u=q.$d?c+q.$d:a;a=u+(t||0);let y=0;do{const A=_.M(m);y+=A;var n=_.M(m);n=_.Aj(n);let E=null;"vttc"==n?8<A&&(E=_.yj(m,A-8)):("vtte"!=n&&this.f.error("Unknown box "+n+"! Skipping!"),m.skip(A-8));t?E&&f.push(xq(E,b.periodStart+u/this.a,b.periodStart+a/this.a)):
12
+ this.f.error("WVTT sample duration unknown, and no default found!")}while(q.sampleSize&&y<q.sampleSize)}return{cues:f.filter(_.$f),styles:[]}}};_.x("clpp.vtt.VttComponent",class extends _.Ep{constructor(){super();this.h=new zq}f(){_.co[_.se]=Aq;_.co[oq]=Aq;_.co[pq]=Aq;_.co[_.Ub]=Cq;_.co[nq]=Bq;_.co[mq]=Bq;_.Gh.push(this.h)}a(){_.eo(_.se);_.eo(oq);_.eo(pq);_.eo(_.Ub);_.eo(nq);_.eo(mq);_.Ih(this.h)}id(){return _.qe}});};f.call(g, window);
package/cl.youbora.js CHANGED
@@ -1,16 +1,15 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var $p="accountCode key is missing in Youbora config",aq="clpp.npaw.YouboraPlugin",bq="content.isLive",cq=function(a,b){a=a.split(".");b=b.split(".");for(let c=0;c<a.length;c++){const d=parseInt(a[c],10),e=parseInt(b[c],10);if(d<e)return!0;if(d>e)break}return!1},dq=function(a,b){var c=b.getConfiguration();a.f=!_.z(c.youbora)&&typeof c.youbora===_.Ad;if(a.f)if(null==window.youbora)a.f=!1,a.g.warn("Youbora SDK not found."),b.onError(new _.H(1,9,9100));else{c=youbora.VERSION;var d;if(typeof c===
2
- _.le&&null!=c.match(/^\d+\.\d+\.\d+$/)){if(d=!cq(c,"6.8.12"))d="6.8.25"===c||cq(c,"6.8.25")}else d=!1;d||(a.g.warn("Youbora SDK version is not supported. Supported versions are 6.8.12 - 6.8.25, found "+`version ${c}. Some or all features of YouboraPlugin may not `+"work correctly."),b.onError(new _.H(1,9,9102)));b.namespace()===_.wc&&(a.f=!1,a.g.info("Youbora does not report when casting."))}else a.g.warn("Youbora plugin is loaded but not configured. Will do nothing.")},eq=a=>{class b extends youbora.Adapter{constructor(c){super(c);
3
- this.l=c;this.f=new _.mo;this.a=new _.O("clpp.npaw.YouboraAdapter");this.h=this.o=!1;this.registerListeners()}getPlayhead(){return this.l.getPosition()}getDuration(){return this.l.getDuration()}getRendition(){let c,d,e;var f=this.l.getTrackManager();f&&(f=f.da())&&(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,d,e)}getIsLive(){return this.l.isLive()}getResource(){const c=this.l.getLoadedSource();
4
- return c&&c.url}getBitrate(){return this.j().streamBandwidth}getThroughput(){return this.j().estimatedBandwidth}getPlayrate(){return this.l.getPlaybackRate()}getFramesPerSecond(){var c=this.l.getTrackManager();return c&&(c=c.Fa())?c.frameRate:null}getPlayerName(){return _.pa}getVersion(){return"6.4.1-castlabsadapter-js"}getPlayerVersion(){return _.da}registerListeners(){this.l&&this.f&&(this.a.debug("registering listeners"),youbora.Util.logAllEvents(this.l),this.f.on(this.l,_.ie,this.H.bind(this)),
5
- this.f.on(this.l,_.Wc,this.C.bind(this)),this.f.on(this.l,_.Be,this.F.bind(this)),this.f.on(this.l,_.Ae,this.D.bind(this)),this.f.on(this.l,_.Lb,this.A.bind(this)),this.f.on(this.l,_.nc,this.B.bind(this)))}unregisterListeners(){this.a.debug(_.ob);_.Mf(this.f)}dispose(){super.dispose()}j(){return this.l.getStats()||_.vl()}m(){return!!this.l.getConfiguration().autoplay}H(c){this.a.debug("State changed",c);if(c=c.detail)switch(c.currentState){case _.Jl:this.m()&&this.g();break;case _.Ll:this.g();this.w();
6
- this.fireResume();this.fireBufferEnd();break;case _.Kl:this.m()&&this.g();this.w();this.fireBufferEnd();this.firePause();break;case _.Il:this.fireBufferEnd();this.fireStop();break;case _.Al:this.fireBufferEnd();this.o&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.Dl:this.fireBufferBegin();break;default:this.a.debug("Unhandled state",c)}}g(){this.plugin.isInitiated||(this.h=!1,this.fireInit())}w(){var c=this.l.getDrmInfo();c&&(c=c.keySystem,(c=c.startsWith(_.Gc)?"Widevine":
7
- c.startsWith(_.Ec)?"FairPlay":c.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":c.startsWith(_.Id)?"ClearKey":c.startsWith(_.Dc)?"Primetime":c)&&this.plugin.setOptions({"content.drm":c}));this.fireJoin()}C(c){this.a.debug("Fire error",c);!(c=c.detail)||this.h||10003===c.code&&this.plugin.getAdsAdapter()||(c.severity===_.F?(this.h=!0,this.fireFatalError(`${c.code}`,c.message)):this.fireError(`${c.code}`,c.message))}F(c){this.a.debug("Seeking",c);this.l.isEnded()||(this.g(),this.fireSeekBegin())}D(c){this.a.debug("Seeked",
8
- c);this.fireSeekEnd()}A(c){this.a.debug("adsTimeline",c);c=c.adsTimeline;this.o=!!c&&c.eb()}B(c){this.a.debug("Casting",c);this.fireCasted()}}return new b(a)};var fq=a=>{class b extends youbora.Adapter{constructor(c){super(c);this.l=c;this.h=this.a=null;this.f=new _.mo;this.g=new _.O("clpp.npaw.YouboraAdsAdapter");this.registerListeners()}getDuration(){return this.a&&this.a.getDuration()}getRendition(){let c=null;this.a&&(c=youbora.Util.buildRenditionString(this.a.pb(),this.a.ob(),this.a.cb()));return c}getBitrate(){return this.a&&this.a.cb()}getPlayhead(){const c=this.l.getAdsManager();return c&&c.getPosition()}getResource(){return this.a&&this.a.getMediaUrl()}getTitle(){return this.a&&
9
- this.a.getTitle()}getProvider(){return this.a&&this.a.getAdvertiserName()}getCreativeId(){return this.a&&this.a.getCreativeId()}getPosition(){const c=youbora.Constants.AdPosition;let d=null;if(this.a)switch(this.a.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.l.getAdsManager();return c&&0<c.getVolume()}getExpectedBreaks(){return this.h&&
10
- this.h.getCuePoints().length}getGivenBreaks(){return this.getExpectedBreaks()}getExpectedAds(){return this.a&&this.a.rb()}getGivenAds(){return this.getExpectedAds()}getBreaksTime(){return this.h&&this.h.getCuePoints().map(c=>-1===c?this.l.getDuration():c)}getIsFullscreen(){return this.l.getSurface().isFullscreen()}getIsVisible(){var c=this.l.getSurface().getContainer();c=youbora.Util.calculateAdViewability(c);this.g.debug("is container visible",c);return c}getPlayerName(){return _.pa}getVersion(){return"6.4.1-castlabsadsadapter-js"}getPlayerVersion(){return _.da}registerListeners(){this.l&&
11
- this.f&&(this.f.on(this.l,_.Lb,this.F.bind(this)),this.f.on(this.l,_.Hb,this.D.bind(this)),this.f.on(this.l,_.Db,this.A.bind(this)),this.f.on(this.l,_.Fb,this.B.bind(this)),this.f.on(this.l,_.yb,this.o.bind(this)),this.f.on(this.l,_.zb,this.j.bind(this,1)),this.f.on(this.l,_.Cb,this.j.bind(this,2)),this.f.on(this.l,_.Jb,this.j.bind(this,3)),this.f.on(this.l,_.xb,this.m.bind(this)),this.f.on(this.l,_.Gb,this.C.bind(this)),this.f.on(this.l,_.Wc,this.w.bind(this)),this.f.on(this.l,_.ub,this.H.bind(this)),
12
- this.f.on(this.l,_.vb,this.I.bind(this)),this.f.on(this.l,_.wb,this.J.bind(this)),this.f.on(this.l,_.Eb,this.K.bind(this)))}unregisterListeners(){_.Mf(this.f)}dispose(){super.dispose()}F(c){this.g.debug("ad timeline changed",c);this.h=c.adsTimeline}D(c){this.g.debug("ad start",c);this.a=c.ad;this.fireStart();this.fireJoin()}o(c){this.g.debug("ad end",c);this.fireStop()}A(c){this.g.debug("ad pause",c);this.firePause()}B(c){this.g.debug("ad resume",c);this.fireResume()}J(c){this.g.debug("on buffering",
13
- c);this.fireBufferBegin()}K(c){this.g.debug("on progress",c);this.fireBufferEnd()}j(c,d){this.g.debug("ad quartile",c,d);this.fireQuartile(c)}m(c){this.g.debug("ad clicked",c);c=this.a&&this.a.Bb();this.g.debug("ad click through url: ",c);this.fireClick(c)}C(c){this.g.debug("ad skipped",c);this.fireSkip()}H(c){this.g.debug("break start",c);this.a=c.ad;this.fireBreakStart()}I(c){this.g.debug("ad break stop",c);this.fireBreakStop();this.getPosition()===youbora.Constants.AdPosition.Postroll&&(c=this.plugin.getAdapter())&&
14
- c.fireStop()}w(c){this.g.warn("ad error",c);(c=c.detail)&&10003===c.code&&(c.severity===_.F?this.fireFatalError(`${c.code}`,c.message):this.fireError(`${c.code}`,c.message))}}return new b(a)};var gq=class extends _.Zp{constructor(){super();this.a=null;this.f=!1;this.g=new _.O(aq);this.l=null}Ud(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(eq(this.l)),this.a.setAdsAdapter(fq(this.l))}getAdapter(){return this.a&&this.a.getAdapter()}getAdsAdapter(){return this.a&&this.a.getAdsAdapter()}onPlayerCreated(a){this.l=a;dq(this,a);if(this.f){var b=a.getConfiguration().youbora;b.accountCode?this.Ud(new youbora.Plugin(b)):(this.g.warn($p),a.onError(new _.H(1,
15
- 9,9101)))}}onContentWillLoad(a,b){dq(this,a);if(this.f){var c=a.getConfiguration(),d=c.youbora;d.accountCode?(void 0===d[bq]&&(d[bq]=b.isLive),void 0===d["content.title"]&&(d["content.title"]=b.name),void 0===d.viewerId&&(d.viewerId=c.viewerId),this.a||this.Ud(new youbora.Plugin(d)),this.a.setOptions(d)):(this.g.warn($p),a.onError(new _.H(1,9,9101)))}}onPlayerWillRelease(){}onPlayerWillDestroy(){}id(){return"youbora"}};_.x(aq,gq);gq.prototype.getAdsAdapter=gq.prototype.getAdsAdapter;
16
- gq.prototype.getAdapter=gq.prototype.getAdapter;gq.prototype.setYouboraPlugin=gq.prototype.Ud;gq.Id="youbora";_.Km(new class{create(){return new gq}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var cq="clpp.npaw.YouboraPlugin",dq="content.isLive",eq=function(a,b){if(b.namespace()===_.xc)return a.f.info("Youbora does not report when casting."),!1;const c=b.getConfiguration().youbora;if(!_.nf(c))return a.f.warn("Youbora plugin is loaded but not configured. Will do nothing."),!1;if(!c.accountCode)return a.f.warn("accountCode key is missing in Youbora config"),b.onError(new _.H(1,9,9101)),!1;if(_.z(window.youbora))return a.f.warn("Youbora SDK not found."),b.onError(new _.H(1,9,
2
+ 9100)),!1;"6.8.49"!==youbora.VERSION&&(a.f.warn("Youbora SDK version is not supported. The supported version is 6.8.49, found "+`version ${youbora.VERSION}. Some or all features of YouboraPlugin `+"may not work correctly."),b.onError(new _.H(1,9,9102)));return!0},fq=a=>(a=a.getConfiguration().youbora)&&a.errorFilter?a.errorFilter:b=>({code:`${b.code}`,message:b.message,severity:b.severity}),gq=(a,b,c,d)=>{b=fq(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===
3
+ a.code?"ad error":_.Xc;b.severity===_.F?(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 hq=a=>{class b extends youbora.Adapter{constructor(c){super(c);this.l=c;this.a=new _.po;this.f=new _.O("clpp.npaw.YouboraAdapter");this.h=this.w=!1;this.registerListeners()}getPlayhead(){return this.getIsLive()?-1:this.l.getPosition()}getDuration(){return this.l.getDuration()}getRendition(){let c,d,e;var f=this.l.getTrackManager();f&&(f=f.fa())&&(c=f.width,d=f.height,e=f.bandwidth);c&&d&&e||(f=this.m(),c=c||f.width,d=d||f.height,e=e||f.streamBandwidth);return youbora.Util.buildRenditionString(c,
4
+ d,e)}getIsLive(){return this.l.isLive()}getResource(){const c=this.l.getLoadedSource();return c&&c.url}getBitrate(){return this.m().streamBandwidth}getThroughput(){return this.m().estimatedBandwidth}getPlayrate(){return this.l.getPlaybackRate()}getFramesPerSecond(){var c=this.l.getTrackManager();return c&&(c=c.Fa())?c.frameRate:null}getPlayerName(){return _.pa}getVersion(){return"6.5.0-castlabsadapter-js"}getPlayerVersion(){return _.da}registerListeners(){this.l&&this.a&&(this.f.debug("registering listeners"),
5
+ youbora.Util.logAllEvents(this.l),this.a.on(this.l,_.je,this.J.bind(this)),this.a.on(this.l,_.Xc,this.F.bind(this)),this.a.on(this.l,_.Ce,this.I.bind(this)),this.a.on(this.l,_.Be,this.G.bind(this)),this.a.on(this.l,_.Lb,this.B.bind(this)),this.a.on(this.l,_.nc,this.C.bind(this)))}unregisterListeners(){this.f.debug(_.ob);_.Of(this.a)}dispose(){super.dispose()}m(){return this.l.getStats()||_.xl()}o(){return!!this.l.getConfiguration().autoplay}J(c){c=c.detail;this.j("state change",c);if(c)switch(c.currentState){case _.Ll:this.o()&&
6
+ this.g();break;case _.Nl:this.g();this.A();this.fireResume();this.fireBufferEnd();break;case _.Ml:this.o()&&this.g();this.A();this.fireBufferEnd();this.firePause();break;case _.Kl:this.fireBufferEnd();this.fireStop();break;case _.Cl:this.fireBufferEnd();this.w&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.Fl:this.fireBufferBegin();break;default:this.f.debug("Unhandled state",c)}}g(){this.plugin.isInitiated||(this.h=!1,this.fireInit())}A(){var c=this.l.getDrmInfo();c&&
7
+ (c=c.keySystem,(c=c.startsWith(_.Hc)?"Widevine":c.startsWith(_.Fc)?"FairPlay":c.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":c.startsWith(_.Jd)?"ClearKey":c.startsWith(_.Ec)?"Primetime":c)&&this.plugin.setOptions({"content.drm":c}));this.fireJoin()}F(c){!(c=c.detail)||this.h||10003===c.code&&this.plugin.getAdsAdapter()||(c=gq(c,this.l,this.f,this))&&c.severity===_.F&&(this.h=!0)}I(){this.j(_.ee);this.l.isEnded()||(this.g(),this.fireSeekBegin())}G(){this.j(_.de);this.fireSeekEnd()}B(c){this.f.debug("adsTimeline",
8
+ c);c=c.adsTimeline;this.w=!!c&&c.fb()}C(c){this.f.debug("Casting",c);this.fireCasted()}j(c,...d){this.f.debug(`Reporting "${c}" event to Youbora`,...d)}}return new b(a)};var iq=a=>{class b extends youbora.Adapter{constructor(c){super(c);this.l=c;this.j=this.a=null;this.f=new _.po;this.h=new _.O("clpp.npaw.YouboraAdsAdapter");this.registerListeners()}getDuration(){return this.a&&this.a.getDuration()}getRendition(){let c=null;this.a&&(c=youbora.Util.buildRenditionString(this.a.qb(),this.a.pb(),this.a.eb()));return c}getBitrate(){return this.a&&this.a.eb()}getPlayhead(){const c=this.l.getAdsManager();return c&&c.getPosition()}getResource(){return this.a&&this.a.getMediaUrl()}getTitle(){return this.a&&
9
+ this.a.getTitle()}getProvider(){return this.a&&this.a.getAdvertiserName()}getCreativeId(){return this.a&&this.a.getCreativeId()}getPosition(){const c=youbora.Constants.AdPosition;let d=null;if(this.a)switch(this.a.Pa()){case 0:d=c.Preroll;break;case 2:d=c.Postroll;break;case 1:d=c.Midroll}this.h.debug("Ad position",d);return d}getIsSkippable(){return this.a&&-1!==this.a.getSkipTimeOffset()}getAudioEnabled(){const c=this.l.getAdsManager();return c&&0<c.getVolume()}getExpectedBreaks(){return this.j&&
10
+ this.j.getCuePoints().length}getGivenBreaks(){return this.getExpectedBreaks()}getExpectedAds(){return this.a&&this.a.sb()}getGivenAds(){return this.getExpectedAds()}getBreaksTime(){return this.j&&this.j.getCuePoints().map(c=>-1===c?this.l.getDuration():c)}getIsFullscreen(){return this.l.getSurface().isFullscreen()}getIsVisible(){var c=this.l.getSurface().getContainer();c=youbora.Util.calculateAdViewability(c);this.h.debug("is container visible",c);return c}getPlayerName(){return _.pa}getVersion(){return"6.5.0-castlabsadsadapter-js"}getPlayerVersion(){return _.da}registerListeners(){this.l&&
11
+ this.f&&(this.f.on(this.l,_.Lb,this.M.bind(this)),this.f.on(this.l,_.Hb,this.L.bind(this)),this.f.on(this.l,_.Db,this.G.bind(this)),this.f.on(this.l,_.Fb,this.J.bind(this)),this.f.on(this.l,_.yb,this.C.bind(this)),this.f.on(this.l,_.zb,this.m.bind(this,1)),this.f.on(this.l,_.Cb,this.m.bind(this,2)),this.f.on(this.l,_.Jb,this.m.bind(this,3)),this.f.on(this.l,_.xb,this.B.bind(this)),this.f.on(this.l,_.Gb,this.K.bind(this)),this.f.on(this.l,_.Xc,this.F.bind(this)),this.f.on(this.l,_.ub,this.o.bind(this)),
12
+ this.f.on(this.l,_.vb,this.w.bind(this)),this.f.on(this.l,_.wb,this.A.bind(this)),this.f.on(this.l,_.Eb,this.I.bind(this)))}unregisterListeners(){_.Of(this.f)}dispose(){super.dispose()}M(c){this.h.debug("ad timeline changed",c);this.j=c.adsTimeline}L(c){this.a=c.ad;this.g("ad start",this.a);this.fireStart();this.fireJoin()}C(){this.g("ad ended");this.fireStop()}G(){this.g("ad pause");this.firePause()}J(){this.g("ad resume");this.fireResume()}A(){this.g("ad buffering started");this.fireBufferBegin()}I(){this.g("ad buffering ended");
13
+ this.fireBufferEnd()}m(c){this.g("ad quartile",c);this.fireQuartile(c)}B(){this.g("ad clicked");const c=this.a&&this.a.Eb();this.h.debug("ad click through url: ",c);this.fireClick(c)}K(){this.g("ad skipped");this.fireSkip()}o(c){this.a=c.ad;this.g("ad break start",this.a);this.fireBreakStart()}w(){this.g("ad break stop");this.fireBreakStop();if(this.getPosition()===youbora.Constants.AdPosition.Postroll){const c=this.plugin.getAdapter();c&&c.fireStop()}}F(c){(c=c.detail)&&10003===c.code&&gq(c,this.l,
14
+ this.h,this)}g(c,...d){this.h.debug(`Reporting "${c}" event to Youbora`,...d)}}return new b(a)};var jq=class extends _.bq{constructor(){super();this.a=null;this.f=new _.O(cq);this.l=null}Wd(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(hq(this.l)),this.a.setAdsAdapter(iq(this.l))}getAdapter(){return this.a&&this.a.getAdapter()}getAdsAdapter(){return this.a&&this.a.getAdsAdapter()}onPlayerCreated(a){this.l=a;eq(this,a)&&(a=a.getConfiguration().youbora,this.Wd(new youbora.Plugin(a)))}onContentWillLoad(a,b){if(eq(this,a)){a=a.getConfiguration();var c=
15
+ a.youbora;void 0===c[dq]&&(c[dq]=b.isLive);void 0===c["content.title"]&&(c["content.title"]=b.name);void 0===c.viewerId&&(c.viewerId=a.viewerId);this.a||this.Wd(new youbora.Plugin(c));this.a.setOptions(c)}}onPlayerWillRelease(){}onPlayerWillDestroy(){}id(){return"youbora"}};_.x(cq,jq);jq.prototype.getAdsAdapter=jq.prototype.getAdsAdapter;jq.prototype.getAdapter=jq.prototype.getAdapter;jq.prototype.setYouboraPlugin=jq.prototype.Wd;jq.Id="youbora";_.Nm(new class{create(){return new jq}});};f.call(g, window);
package/package.json CHANGED
@@ -1,7 +1,11 @@
1
1
  {
2
2
  "name": "@castlabs/prestoplay",
3
3
  "description": "PRESTOplay Video Player",
4
- "version": "6.4.1",
4
+ "version": "6.5.0",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/castlabs/prestoplay-web.git"
8
+ },
5
9
  "homepage": "https://castlabs.com/prestoplay/",
6
10
  "bugs": {
7
11
  "url": "https://castlabs.com/support/"
@@ -19,7 +23,7 @@
19
23
  ],
20
24
  "peerDependencies": {
21
25
  "mux.js": "^5.14.1",
22
- "youboralib": "6.8.12 - 6.8.25"
26
+ "youboralib": "6.8.49"
23
27
  },
24
28
  "peerDependenciesMeta": {
25
29
  "mux.js": {