@castlabs/prestoplay 6.32.0-beta.3 → 6.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +18 -18
- package/cjs/cl.cast.js +126 -126
- package/cjs/cl.conviva.js +32 -32
- package/cjs/cl.core.js +604 -604
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +101 -101
- package/cjs/cl.externs.js +1 -29
- package/cjs/cl.freewheel.js +26 -26
- package/cjs/cl.hls.js +77 -77
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +26 -26
- package/cjs/cl.mediatailor.js +3 -3
- package/cjs/cl.mse.js +352 -352
- package/cjs/cl.muxdata.js +14 -14
- package/cjs/cl.onboard.js +4 -4
- package/cjs/cl.persistent.js +14 -14
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.simid.js +16 -16
- package/cjs/cl.smooth.js +71 -71
- package/cjs/cl.thumbnails.js +25 -25
- package/cjs/cl.tizen.js +71 -71
- package/cjs/cl.ttml.js +29 -29
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +12 -12
- package/cjs/cl.vr.js +18 -18
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.yospace.js +4 -4
- package/cjs/cl.youbora.js +38 -38
- package/cjs/polyfill.min.js +2 -2
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +14 -14
- package/cl.cast.js +100 -100
- package/cl.conviva.js +27 -27
- package/cl.core.js +488 -487
- package/cl.crypto.js +8 -8
- package/cl.dash.js +75 -75
- package/cl.externs.js +1 -25
- package/cl.freewheel.js +20 -20
- package/cl.hls.js +65 -65
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +19 -19
- package/cl.mediatailor.js +2 -2
- package/cl.mse.js +200 -200
- package/cl.muxdata.js +12 -12
- package/cl.onboard.js +3 -3
- package/cl.persistent.js +8 -8
- package/cl.playlist.js +4 -4
- package/cl.simid.js +2 -2
- package/cl.smooth.js +47 -47
- package/cl.thumbnails.js +12 -12
- package/cl.tizen.js +41 -41
- package/cl.ttml.js +10 -10
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -8
- package/cl.vr.js +3 -3
- package/cl.vtt.js +11 -11
- package/cl.yospace.js +3 -3
- package/cl.youbora.js +27 -27
- package/package.json +1 -1
- package/typings.d.ts +6 -22
- package/cjs/cl.cdn.js +0 -13
- package/cl.cdn.js +0 -7
package/cl.youbora.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var Vv="Unhandled state",Wv="ad break start",Xv="ad buffering ended",Yv="ad buffering started",Zv="ad click through url: ",$v="ad timeline changed",aw="clpp.npaw.NpawPlugin",bw="clpp.npaw.YouboraPlugin",cw="content.isLive",dw="content.title",ew="is container visible",fw=function(a){return a.startsWith(_.
|
|
2
|
-
this.m=c;this.a=new _.
|
|
3
|
-
return c&&c.url}getBitrate(){return this.j().streamBandwidth}getThroughput(){return this.j().estimatedBandwidth}getPlayrate(){return this.m.nc()}getFramesPerSecond(){var c=this.m.getTrackManager();return c&&(c=c.
|
|
4
|
-
_.
|
|
5
|
-
break;case 4:this.w()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var Vv="Unhandled state",Wv="ad break start",Xv="ad buffering ended",Yv="ad buffering started",Zv="ad click through url: ",$v="ad timeline changed",aw="clpp.npaw.NpawPlugin",bw="clpp.npaw.YouboraPlugin",cw="content.isLive",dw="content.title",ew="is container visible",fw=function(a){return a.startsWith(_.xd)?"Widevine":a.startsWith(_.td)?"FairPlay":a.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":a.startsWith(_.Re)?"ClearKey":a.startsWith(_.sd)?"Primetime":a},hw=function(a){class b extends youbora.Adapter{constructor(c){super(c);
|
|
2
|
+
this.m=c;this.a=new _.Qt;this.g=new _.T("clpp.npaw.YouboraAdapter");this.h=this.o=!1;this.registerListeners()}getPlayhead(){return this.getIsLive()?-1:this.m.getPosition()}getDuration(){return this.m.getDuration()}getRendition(){let c,d,e;var f=this.m.getTrackManager();f&&(f=f.ta())&&(c=f.width,d=f.height,e=f.bandwidth);c&&d&&e||(f=this.j(),c=c||f.width,d=d||f.height,e=e||f.streamBandwidth);return youbora.Util.buildRenditionString(c,d,e)}getIsLive(){return this.m.isLive()}getResource(){const c=this.m.Ra();
|
|
3
|
+
return c&&c.url}getBitrate(){return this.j().streamBandwidth}getThroughput(){return this.j().estimatedBandwidth}getPlayrate(){return this.m.nc()}getFramesPerSecond(){var c=this.m.getTrackManager();return c&&(c=c.Ha())?c.frameRate:null}getPlayerName(){return _.ra}getVersion(){return"6.32.0-castlabsadapter-js"}getPlayerVersion(){return _.ea}registerListeners(){this.m&&this.a&&(this.g.debug("registering listeners"),youbora.Util.logAllEvents(this.m),this.a.on(this.m,_.Rf,this.I.bind(this)),this.a.on(this.m,
|
|
4
|
+
_.Yd,this.F.bind(this)),this.a.on(this.m,_.ug,this.H.bind(this)),this.a.on(this.m,_.tg,this.G.bind(this)),this.a.on(this.m,_.qc,this.B.bind(this)),this.a.on(this.m,_.Tc,this.C.bind(this)))}unregisterListeners(){this.g.debug(_.Ab);_.Xh(this.a)}dispose(){super.dispose()}j(){return this.m.getStats()||_.ss()}w(){return!!this.m.getConfiguration().autoplay}I(c){c=c.detail;this.l("state change",c);if(c)switch(c.currentState){case 1:this.w()&&this.f();break;case 3:this.f();this.A();this.fireResume();this.fireBufferEnd();
|
|
5
|
+
break;case 4:this.w()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.Fs:this.fireBufferEnd();this.fireStop();break;case 5:this.fireBufferEnd();this.o&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case 2:this.fireBufferBegin();break;default:this.g.debug(Vv,c)}}f(){this.plugin.isInitiated||(this.h=!1,this.fireInit())}A(){var c=this.m.getDrmInfo();c&&(c=fw(c.keySystem))&&this.plugin.setOptions({"content.drm":c});this.fireJoin()}F(c){!(c=c.detail)||this.h||
|
|
6
6
|
10003===c.code&&this.plugin.getAdsAdapter()||(c=gw(c,this.m.getConfiguration().youbora,this.g,this))&&c.severity===_.D&&(this.h=!0)}H(){this.m.isEnded()||(this.l(_.Jf),this.f(),this.fireSeekBegin())}G(){this.l(_.If);this.fireSeekEnd()}B(c){this.g.debug("adsTimeline",c);this.o=(c=c.adsTimeline)&&c.Pb()}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)},iw=function(a){class b extends youbora.Adapter{constructor(c){super(c);
|
|
7
|
-
this.m=c;this.j=this.a=null;this.f=new _.
|
|
7
|
+
this.m=c;this.j=this.a=null;this.f=new _.Qt;this.g=new _.T("clpp.npaw.YouboraAdsAdapter");this.registerListeners();this.l=!1}getDuration(){return this.a&&this.a.getDuration()}getRendition(){let c=null;this.a&&(c=youbora.Util.buildRenditionString(this.a.Ua(),this.a.Ta(),this.a.Ba()));return c}getBitrate(){return this.a&&this.a.Ba()}getPlayhead(){const c=this.m.getAdsManager();return c&&c.getPosition()}getResource(){return this.a&&this.a.getMediaUrl()}getTitle(){return this.a&&this.a.getTitle()}getProvider(){return this.a&&
|
|
8
8
|
this.a.getAdvertiserName()}getCreativeId(){return this.a&&this.a.getCreativeId()}getPosition(){const c=youbora.Constants.AdPosition;let d=null;if(this.a)switch(this.a.Ca()){case 0:d=c.Preroll;break;case 2:d=c.Postroll;break;case 1:d=c.Midroll}this.g.debug("Ad position",d);return d}getIsSkippable(){return this.a&&-1!==this.a.getSkipTimeOffset()}getAudioEnabled(){const c=this.m.getAdsManager();return c&&0<c.getAdVolume()}getExpectedBreaks(){return this.j&&this.j.getCuePoints().length}getGivenBreaks(){return this.getExpectedBreaks()}getExpectedAds(){return this.a&&
|
|
9
|
-
this.a.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
this.
|
|
19
|
-
this.j=this.h=this.l=this.a=null;this.o=!1}getDuration(){return this.a?this.a.getDuration():null}getRendition(){let b=null;this.a&&(b=this.getNpawUtils().buildRenditionString(this.a.
|
|
9
|
+
this.a.Va()}getGivenAds(){return this.getExpectedAds()}getBreaksTime(){return this.j&&this.j.getCuePoints().map(c=>-1===c?this.m.getDuration():c)}getIsFullscreen(){return this.m.getSurface().isFullscreen()}getIsVisible(){var c=this.m.getSurface().getContainer();c=youbora.Util.calculateAdViewability(c);this.g.debug(ew,c);return c}getPlayerName(){return _.ra}getVersion(){return"6.32.0-castlabsadsadapter-js"}getPlayerVersion(){return _.ea}registerListeners(){this.m&&this.f&&(this.f.on(this.m,_.qc,this.M.bind(this)),
|
|
10
|
+
this.f.on(this.m,_.mc,this.L.bind(this)),this.f.on(this.m,_.hc,this.I.bind(this)),this.f.on(this.m,_.kc,this.J.bind(this)),this.f.on(this.m,_.Yb,this.G.bind(this)),this.f.on(this.m,_.Zb,this.o.bind(this,1)),this.f.on(this.m,_.ec,this.o.bind(this,2)),this.f.on(this.m,_.oc,this.o.bind(this,3)),this.f.on(this.m,_.Xb,this.F.bind(this)),this.f.on(this.m,_.lc,this.K.bind(this)),this.f.on(this.m,_.Yd,this.H.bind(this)),this.f.on(this.m,_.Ub,this.A.bind(this)),this.f.on(this.m,_.Vb,this.B.bind(this)),this.f.on(this.m,
|
|
11
|
+
_.Wb,this.C.bind(this)),this.f.on(this.m,_.jc,this.w.bind(this)))}unregisterListeners(){_.Xh(this.f)}dispose(){super.dispose()}M(c){this.g.debug($v,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(Yv);this.fireBufferBegin()}w(){this.l&&(this.h(Xv),this.l=!1,this.fireBufferEnd())}o(c){this.h("ad quartile",
|
|
12
|
+
c);this.fireQuartile(c)}F(){this.h("ad clicked");const c=this.a&&this.a.Qa();this.g.debug(Zv,c);this.fireClick(c)}K(){this.h("ad skipped");this.fireSkip()}A(c){this.a=c.ad;this.h(Wv,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&&gw(c,this.m.getConfiguration().youbora,this.g,this)}h(c,...d){this.g.debug(`Reporting "${c}" event to Youbora`,
|
|
13
|
+
...d)}}return new b(a)},kw=function(){class a extends NpawPluginAdapters.video.Shaka{constructor(){super();this.f=this.h=!1;this.a=null}getPlayhead(){return this.getIsLive()?-1:this.player.getPosition()}getDuration(){return this.player.getDuration()}getRendition(){let b=null,c=null,d=null;var e=this.player.getTrackManager();e&&(e=e.ta())&&(b=e.width,c=e.height,d=e.bandwidth);b&&c&&d||(e=this.j(),b=b||e.width,c=c||e.height,d=d||e.streamBandwidth);return this.getNpawUtils().buildRenditionString(b,c,
|
|
14
|
+
d)}getIsLive(){return this.player.isLive()}getResource(){const b=this.player.Ra();return b&&b.url}getBitrate(){return this.j().streamBandwidth}getThroughput(){return this.j().estimatedBandwidth}getPlayrate(){return this.player.nc()}getFramesPerSecond(){var b=this.player.getTrackManager();return b&&(b=b.Ha())?b.frameRate:null}getPlayerName(){return _.ra}getVersion(){return"castlabs-adapter-6.32.0-js"}getPlayerVersion(){return _.ea}registerListeners(){const b=this.w();this.player&&b&&(b.on(this.player,
|
|
15
|
+
_.Rf,this.K.bind(this)),b.on(this.player,_.Yd,this.H.bind(this)),b.on(this.player,_.Jf,this.J.bind(this)),b.on(this.player,_.If,this.I.bind(this)),b.on(this.player,_.qc,this.F.bind(this)),b.on(this.player,_.Tc,this.G.bind(this)),b.on(this.player,_.Lc,this.L.bind(this)),b.on(this.player,_.bg,this.M.bind(this)))}unregisterListeners(){jw.debug(_.Ab);_.Xh(this.w())}dispose(){this.unregisterListeners();this.f=this.h=!1;this.a=null}j(){return this.player.getStats()||_.ss()}o(){return!!this.player.getConfiguration().autoplay}K(b){b=
|
|
16
|
+
b.detail;this.l("state change",b);if(b)switch(b.currentState){case 1:this.plugin.setVideoOptions({"content.subtitles":this.C()});this.o()&&this.fireStart();break;case 3:this.fireStart();this.A();this.fireResume();this.fireBufferEnd();break;case 4:this.o()&&this.fireStart();this.A();this.fireBufferEnd();this.firePause();break;case _.Fs:this.fireBufferEnd();this.fireStop();break;case 5:this.fireBufferEnd();this.h&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case 2:this.fireBufferBegin();
|
|
17
|
+
break;default:jw.debug(Vv,b)}}A(){this.fireJoin()}H(b){(b=b.detail)&&!this.f&&this.player&&10003!==b.code&&(b=gw(b,this.player.getConfiguration().npaw,jw,this))&&b.severity===_.D&&(this.f=!0)}J(){this.player.isEnded()||(this.l(_.Jf),this.fireSeekBegin())}B(b){const c=this.player.getTrackManager();if(!c)return null;let d=null;b===_.Zf&&(d=c.ua());b===_.q&&(d=c.ra());return d?d.language:null}L(){const b=this.B(_.q);this.plugin.setVideoOptions({"content.language":b})}M(){const b=this.B(_.Zf),c=this.C();
|
|
18
|
+
this.plugin.setVideoOptions({"content.subtitles":b||c})}w(){this.a||(this.a=new _.Qt);return this.a}I(){this.l(_.If);this.fireSeekEnd()}F(b){jw.debug("adsTimeline",b);this.h=(b=b.adsTimeline)&&b.Pb()}G(b){jw.debug("Casting",b);this.fireCasted()}l(b,...c){jw.debug(`Reporting "${b}" event to NPAW`,...c)}C(){const b=this.player.getConfiguration();return b.npaw&&b.npaw.disabledSubtitlesLabel?b.npaw.disabledSubtitlesLabel:"off"}}return a},mw=function(){class a extends NpawPluginAdapters.ads.Ima{constructor(){super();
|
|
19
|
+
this.j=this.h=this.l=this.a=null;this.o=!1}getDuration(){return this.a?this.a.getDuration():null}getRendition(){let b=null;this.a&&(b=this.getNpawUtils().buildRenditionString(this.a.Ua(),this.a.Ta(),this.a.Ba()));return b}getBitrate(){let b=null;this.a&&(b=this.a.Ba());return b}getPlayhead(){let b=null;const c=this.player.getAdsManager();c&&(b=c.getPosition());return b}getResource(){let b=null;this.a&&(b=this.a.getMediaUrl());return b}getTitle(){let b=null;this.a&&(b=this.a.getTitle());return b}getProvider(){let b=
|
|
20
20
|
null;this.a&&(b=this.a.getAdvertiserName());return b}getCreativeId(){let b=null;this.a&&(b=this.a.getCreativeId());return b}dispose(){this.unregisterListeners();this.j=this.h=this.a=null}getPosition(){const b=this.getNpawReference().Constants.AdPosition;let c=null;if(this.a)switch(this.a.Ca()){case 0:c=b.Preroll;break;case 2:c=b.Postroll;break;case 1:c=b.Midroll}lw.debug("Ad position",c);return c}getIsSkippable(){return this.a&&-1!==this.a.getSkipTimeOffset()}getAudioEnabled(){const b=this.player.getAdsManager();
|
|
21
|
-
return b&&0<b.getAdVolume()}getExpectedBreaks(){return this.h&&this.h.getCuePoints().length}getGivenBreaks(){return this.getExpectedBreaks()}getExpectedAds(){return this.a&&this.a.
|
|
22
|
-
b);return b}getPlayerName(){return _.ra}getVersion(){return"castlabs-ads-adapter-6.32.0-
|
|
23
|
-
2)),b.on(this.player,_.oc,this.w.bind(this,3)),b.on(this.player,_.Xb,this.H.bind(this)),b.on(this.player,_.lc,this.M.bind(this)),b.on(this.player,_.
|
|
24
|
-
this.fireStop({adPlayhead:this.l})}K(){this.f("ad pause");this.A();this.firePause()}L(){this.f("ad resume");this.A();this.fireResume()}G(){this.o=!0;this.f(Yv);this.fireBufferBegin()}S(){this.l=this.getPlayhead();this.A()}A(){this.o&&(this.f(Xv),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.
|
|
25
|
-
this.fireBreakStop({adPlayhead:this.l});this.getPosition()===this.getNpawReference().Constants.AdPosition.Postroll&&this.fireStop({adPlayhead:this.l})}J(b){(b=b.detail)&&10003===b.code&&gw(b,this.player.getConfiguration().npaw,lw,this)}f(b,...c){lw.debug(`Reporting "${b}" event to NPAW`,...c)}}return a},nw=function(a){a.a&&(a.g.info("Removing NPAW Plugins",a.a),a.a.removeAdsAdapter(),a.a.removeAdapter())},ow=function(a,b){if(b.namespace()===_.
|
|
26
|
-
!1;const c=b.getConfiguration().npaw;return _.
|
|
21
|
+
return b&&0<b.getAdVolume()}getExpectedBreaks(){return this.h&&this.h.getCuePoints().length}getGivenBreaks(){return this.getExpectedBreaks()}getExpectedAds(){return this.a&&this.a.Va()}getGivenAds(){return this.getExpectedAds()}getBreaksTime(){return this.h&&this.h.getCuePoints().map(b=>-1===b?this.player.getDuration():b)}getIsFullscreen(){return this.player.getSurface().isFullscreen()}getIsVisible(){var b=this.player.getSurface().getContainer();b=this.getNpawUtils().calculateAdViewability(b);lw.debug(ew,
|
|
22
|
+
b);return b}getPlayerName(){return _.ra}getVersion(){return"castlabs-ads-adapter-6.32.0-js"}getPlayerVersion(){return _.ea}B(){this.j||(this.j=new _.Qt);return this.j}registerListeners(){const b=this.B();this.player&&b&&(b.on(this.player,_.qc,this.R.bind(this)),b.on(this.player,_.mc,this.P.bind(this)),b.on(this.player,_.hc,this.K.bind(this)),b.on(this.player,_.kc,this.L.bind(this)),b.on(this.player,_.Yb,this.I.bind(this)),b.on(this.player,_.Zb,this.w.bind(this,1)),b.on(this.player,_.ec,this.w.bind(this,
|
|
23
|
+
2)),b.on(this.player,_.oc,this.w.bind(this,3)),b.on(this.player,_.Xb,this.H.bind(this)),b.on(this.player,_.lc,this.M.bind(this)),b.on(this.player,_.Yd,this.J.bind(this)),b.on(this.player,_.Ub,this.C.bind(this)),b.on(this.player,_.Vb,this.F.bind(this)),b.on(this.player,_.Wb,this.G.bind(this)),b.on(this.player,_.jc,this.S.bind(this)))}unregisterListeners(){_.Xh(this.B())}R(b){lw.debug($v,b);this.h=b.adsTimeline}P(b){this.a=b.ad;this.f("ad start",this.a);this.fireStart();this.fireJoin()}I(){this.f("ad ended");
|
|
24
|
+
this.fireStop({adPlayhead:this.l})}K(){this.f("ad pause");this.A();this.firePause()}L(){this.f("ad resume");this.A();this.fireResume()}G(){this.o=!0;this.f(Yv);this.fireBufferBegin()}S(){this.l=this.getPlayhead();this.A()}A(){this.o&&(this.f(Xv),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.Qa();lw.debug(Zv,b);this.fireClick(b)}M(){this.f("ad skipped");this.fireSkip()}C(b){this.a=b.ad;this.f(Wv,this.a);this.fireBreakStart()}F(){this.f("ad break stop");
|
|
25
|
+
this.fireBreakStop({adPlayhead:this.l});this.getPosition()===this.getNpawReference().Constants.AdPosition.Postroll&&this.fireStop({adPlayhead:this.l})}J(b){(b=b.detail)&&10003===b.code&&gw(b,this.player.getConfiguration().npaw,lw,this)}f(b,...c){lw.debug(`Reporting "${b}" event to NPAW`,...c)}}return a},nw=function(a){a.a&&(a.g.info("Removing NPAW Plugins",a.a),a.a.removeAdsAdapter(),a.a.removeAdapter())},ow=function(a,b){if(b.namespace()===_.id)return a.g.info("NPAW does not report when casting."),
|
|
26
|
+
!1;const c=b.getConfiguration().npaw;return _.jh(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("accountCode key is missing in NPAW config"),b.onError(new _.I(1,9,9101)),!1):(a.g.warn("NPAW plugin is loaded but not configured. Will do nothing."),!1)},pw=function(a,b){if(b.namespace()===_.id)return a.g.info("Youbora does not report when casting."),!1;const c=b.getConfiguration().youbora;if(!_.jh(c))return a.g.debug("Youbora plugin is loaded but not configured. Will do nothing."),
|
|
27
27
|
!1;if(!c.accountCode)return a.g.warn("accountCode key is missing in Youbora config"),b.onError(new _.I(1,9,9101)),!1;if(_.z(window.youbora))return a.g.warn("Youbora SDK not found."),b.onError(new _.I(1,9,9100)),!1;"6.8.59"!==youbora.VERSION&&(a.g.warn("Youbora SDK version is not supported. The supported version is 6.8.59, found "+`version ${youbora.VERSION}. Some or all features of YouboraPlugin `+"may not work correctly."),b.onError(new _.I(1,9,9102)));return!0},qw=a=>a&&a.errorFilter?a.errorFilter:
|
|
28
|
-
b=>({code:`${b.code}`,message:b.message,severity:b.severity}),gw=(a,b,c,d)=>{b=qw(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===a.code?"ad error":_.
|
|
29
|
-
var c=a.npaw;void 0===c[cw]&&(c[cw]=b.isLive);void 0===c[dw]&&(c[dw]=b.name);void 0===c.viewerId&&(c.viewerId=a.viewerId);this.a||this.
|
|
30
|
-
rw.prototype.getAdapter=rw.prototype.getAdapter;rw.prototype.getNpawPlugin=rw.prototype.
|
|
31
|
-
a.youbora;void 0===c[cw]&&(c[cw]=b.isLive);void 0===c[dw]&&(c[dw]=b.name);void 0===c.viewerId&&(c.viewerId=a.viewerId);this.a||this.
|
|
28
|
+
b=>({code:`${b.code}`,message:b.message,severity:b.severity}),gw=(a,b,c,d)=>{b=qw(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===a.code?"ad error":_.Yd;b.severity===_.D?(d.fireFatalError(b.code,b.message,b.metadata),c.debug(`Reporting "fatal ${a}" to Youbora`,b.code,b)):(d.fireError(b.code,b.message,b.metadata),c.debug(`Reporting "${a}" to Youbora`,b.code,b));return b};var jw=new _.T("clpp.npaw.NpawAdapter");var lw=new _.T("clpp.npaw.NpawAdsAdapter");var rw=class extends _.Uv{constructor(){super();this.a=null;this.g=new _.T(aw);this.m=null}Df(a){nw(this);if(this.a=a)this.a.registerAdapterFromClass(this.m,kw()),this.a.registerAdsAdapterFromClass(this.m,mw())}ci(){return this.a}getAdapter(){return this.a&&this.a.getAdapter()}getAdsAdapter(){return this.a&&this.a.getAdsAdapter()}onPlayerCreated(a){this.m=a;ow(this,a)&&(a=a.getConfiguration().npaw,this.Df(new NpawPlugin(a.accountCode)))}onContentWillLoad(a,b){if(ow(this,a)){a=a.getConfiguration();
|
|
29
|
+
var c=a.npaw;void 0===c[cw]&&(c[cw]=b.isLive);void 0===c[dw]&&(c[dw]=b.name);void 0===c.viewerId&&(c.viewerId=a.viewerId);this.a||this.Df(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(_.Ke,b);this.a.setAnalyticsOptions(b)}onPlayerWillRelease(){}onPlayerWillDestroy(){nw(this);this.a&&this.a.destroy()}id(){return"npaw"}};_.x(aw,rw);rw.prototype.getAdsAdapter=rw.prototype.getAdsAdapter;
|
|
30
|
+
rw.prototype.getAdapter=rw.prototype.getAdapter;rw.prototype.getNpawPlugin=rw.prototype.ci;rw.prototype.setNpawPlugin=rw.prototype.Df;rw.Id="npaw";new _.T(aw);var sw=class extends _.Uv{constructor(){super();this.a=null;this.g=new _.T(bw);this.m=null}Ef(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(hw(this.m)),this.a.setAdsAdapter(iw(this.m))}getAdapter(){return this.a&&this.a.getAdapter()}getAdsAdapter(){return this.a&&this.a.getAdsAdapter()}onPlayerCreated(a){this.m=a;pw(this,a)&&(a=a.getConfiguration().youbora,this.Ef(new youbora.Plugin(a)))}onContentWillLoad(a,b){if(pw(this,a)){a=a.getConfiguration();var c=
|
|
31
|
+
a.youbora;void 0===c[cw]&&(c[cw]=b.isLive);void 0===c[dw]&&(c[dw]=b.name);void 0===c.viewerId&&(c.viewerId=a.viewerId);this.a||this.Ef(new youbora.Plugin(c));this.a.setOptions(c)}}onPlayerWillRelease(){}onPlayerWillDestroy(){}id(){return"youbora"}};_.x(bw,sw);sw.prototype.getAdsAdapter=sw.prototype.getAdsAdapter;sw.prototype.getAdapter=sw.prototype.getAdapter;sw.prototype.setYouboraPlugin=sw.prototype.Ef;sw.Id="youbora";_.Pn(new class{create(a){return a.npaw?new rw:a.youbora?new sw:null}});};f.call(g, window);
|
package/package.json
CHANGED
package/typings.d.ts
CHANGED
|
@@ -3303,9 +3303,13 @@ export namespace clpp {
|
|
|
3303
3303
|
*/
|
|
3304
3304
|
BITRATE_CHANGED = "bitratechanged",
|
|
3305
3305
|
/**
|
|
3306
|
-
* Triggered when player adds new tracks
|
|
3306
|
+
* Triggered when player adds new tracks.
|
|
3307
3307
|
*/
|
|
3308
3308
|
TRACKS_ADDED = "tracksadded",
|
|
3309
|
+
/**
|
|
3310
|
+
* Triggered when player removes tracks.
|
|
3311
|
+
*/
|
|
3312
|
+
TRACKS_REMOVED = "tracksremoved",
|
|
3309
3313
|
/**
|
|
3310
3314
|
* Triggered when the player started to load the source.
|
|
3311
3315
|
*/
|
|
@@ -6497,12 +6501,6 @@ export namespace clpp {
|
|
|
6497
6501
|
}
|
|
6498
6502
|
}
|
|
6499
6503
|
|
|
6500
|
-
namespace cdn {
|
|
6501
|
-
export class CdnChallengeComponent {
|
|
6502
|
-
|
|
6503
|
-
}
|
|
6504
|
-
}
|
|
6505
|
-
|
|
6506
6504
|
namespace contentSteering {
|
|
6507
6505
|
/**
|
|
6508
6506
|
* Represents a Content Steering Location.
|
|
@@ -6770,21 +6768,7 @@ export namespace clpp {
|
|
|
6770
6768
|
}
|
|
6771
6769
|
|
|
6772
6770
|
export class DrmToday {
|
|
6773
|
-
|
|
6774
|
-
* Registers a custom DRMtoday environment with an arbitrary base URL.
|
|
6775
|
-
* Uses the same license request/response modifiers as standard DRMtoday
|
|
6776
|
-
* environments, so auth tokens, session tokens, and CSL all work
|
|
6777
|
-
* identically. This is useful for local testing against a DRMtoday
|
|
6778
|
-
* instance running on a custom host/port.
|
|
6779
|
-
*
|
|
6780
|
-
* @param name The environment name, e.g. 'DRMtoday_LOCAL'
|
|
6781
|
-
* @param baseUrl The base URL, e.g. 'http://localhost:8090/v4/orgId/'
|
|
6782
|
-
* @param opt_urls Optional per-key-system URL
|
|
6783
|
-
* overrides (keys: widevineUrl, playreadyUrl, fairplayUrl). Relative
|
|
6784
|
-
* paths are resolved against baseUrl; absolute URLs are used as-is.
|
|
6785
|
-
* Defaults to the standard DRMtoday suffixes.
|
|
6786
|
-
*/
|
|
6787
|
-
static registerCustom(name: string, baseUrl: string, opt_urls?: Record<string, string>): void;
|
|
6771
|
+
|
|
6788
6772
|
}
|
|
6789
6773
|
|
|
6790
6774
|
export class HeaderDrm {
|
package/cjs/cl.cdn.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var FV="clpp.cdn.CdnChallengeComponent",GV=function(){this.g=new _.M(FV);this.f=new WeakMap;this.a=null},KV=function(a,b,c){var d,e,f,g,k,l,m,n,p,q,t,u,z,B,D,C,E;return _.I(function(x){switch(x.a){case 1:d=b.headers["x-drm-challenge-data"];e=b.headers["x-drm-challenge-token"];if(!d||!e)throw a.g.warn("428 received but missing challenge headers"),Error("428 challenge headers missing");a.g.info("428 challenge received");f=c.xf.onChallengeStart;typeof f===_.ue&&f();g=HV(d);_.F(x,2);return _.y(x,IV(g),
|
|
3
|
-
4);case 4:k=x.f;_.G(x,3);break;case 2:throw l=_.H(x),a.g.error("Failed to create CDM challenge session",l),l;case 3:return m=b.uri||b.request.uris[0],_.F(x,5),_.y(x,c.xf.getAuthToken(),7);case 7:n=x.f;_.G(x,6);break;case 5:throw p=_.H(x),a.g.error("getAuthToken() failed",p),p;case 6:return _.F(x,8),_.y(x,window.fetch(m,{headers:{"x-drm-license-request":JV(k),"x-drm-challenge-token":e,Authorization:"Bearer "+n}}),10);case 10:q=x.f;_.G(x,9);break;case 8:throw t=_.H(x),a.g.error("Manifest retry fetch failed",
|
|
4
|
-
t),t;case 9:if(!q.ok)throw a.g.error("Manifest retry returned "+q.status),Error("CDN challenge retry failed: "+q.status);u=q.headers.get("x-cat");z=q.headers.get(_.oh);B=q.headers.get(_.nh);u&&(c.ef=u);D=c.xf.onCatReceived;u&&typeof D===_.ue&&D(u);C=c.xf.onChallengeComplete;typeof C===_.ue&&C({mq:z,lq:B,ef:u});E=b;return _.y(x,q.arrayBuffer(),11);case 11:return E.data=x.f,b.status=q.status,q.headers.forEach(function(J,L){b.headers[L.toLowerCase()]=J}),a.g.info("428 challenge complete"),x["return"](b)}})},
|
|
5
|
-
HV=function(a){a=atob(a.replace(/-/g,"+").replace(/_/g,"/"));for(var b=new Uint8Array(a.length),c=0;c<a.length;c++)b[c]=a.charCodeAt(c);return b.buffer},JV=function(a){var b="";_.Vi(a).forEach(function(c){b+=String.fromCharCode(c)});return btoa(b)},IV=function(a){var b,c,d,e,f,g,k;return _.I(function(l){switch(l.a){case 1:return b=[{initDataTypes:[_.md],videoCapabilities:[{contentType:'video/mp4; codecs\x3d"avc1.42E01E"',robustness:_.Cb}],audioCapabilities:[{contentType:'audio/mp4; codecs\x3d"mp4a.40.2"',
|
|
6
|
-
robustness:_.Cb}]}],_.F(l,2),_.y(l,navigator.requestMediaKeySystemAccess(_.Md,b),4);case 4:c=l.f;_.G(l,3);break;case 2:throw d=_.H(l),Error("CDN challenge requires Widevine but requestMediaKeySystemAccess failed: "+d.message);case 3:return _.y(l,c.createMediaKeys(),5);case 5:e=l.f;f=_.cq.V2;if(!f){l.C(6);break}return _.y(l,e.setServerCertificate(new Uint8Array(f)),6);case 6:return g=e.createSession(_.sg),_.y(l,new Promise(function(m,n){var p=window.setTimeout(function(){n(Error("CDM challenge session timed out"))},
|
|
7
|
-
1E4);g.addEventListener(_.Re,function(q){window.clearTimeout(p);m(q.message)});g.generateRequest(_.md,a)["catch"](function(q){window.clearTimeout(p);n(q)})}),8);case 8:return k=l.f,g.close()["catch"](function(){}),l["return"](k)}})};_.w(GV,_.jv);GV.prototype.id=function(){return"cdn-challenge"};
|
|
8
|
-
GV.prototype.beforeLoad=function(a){var b=this,c=a.getConfiguration(),d=c.drm&&c.drm.customData&&c.drm.customData.cdn;if(d&&typeof d.getAuthToken===_.ue){if(c=this.f.get(a)){var e=a.getNetworkEngine();c.gg&&e.lh(c.gg);c.hg&&e.Ve(c.hg);this.f["delete"](a)}var f={ef:null,xf:d,gg:null,hg:null};c=a.getNetworkEngine();f.gg=function(g){!f.ef||1!==g.type&&2!==g.type||(g.headers["x-cat"]=f.ef)};f.hg=function(g){if(428===g.status&&g.request&&1===g.request.type){if(b.a)return b.a;b.a=KV(b,g,f)["finally"](function(){b.a=
|
|
9
|
-
null});return b.a}if(g.request&&3===g.request.type&&(g=g.headers["x-cat"])){f.ef=g;var k=d.onCatReceived;typeof k===_.ue&&k(g)}};c.vg(f.gg);c.yd(f.hg);this.f.set(a,f)}};_.K(FV,GV);};
|
|
10
|
-
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
11
|
-
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
12
|
-
else{_=this.clpp._;(f.call(g,this));}
|
|
13
|
-
})();
|
package/cl.cdn.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var XU="clpp.cdn.CdnChallengeComponent",YU=function(a){a=atob(a.replace(/-/g,"+").replace(/_/g,"/"));const b=new Uint8Array(a.length);for(let c=0;c<a.length;c++)b[c]=a.charCodeAt(c);return b.buffer},ZU=function(a){return _.w(function*(){var b=[{initDataTypes:[_.Wc],videoCapabilities:[{contentType:'video/mp4; codecs\x3d"avc1.42E01E"',robustness:_.ob}],audioCapabilities:[{contentType:'audio/mp4; codecs\x3d"mp4a.40.2"',robustness:_.ob}]}];try{var c=yield navigator.requestMediaKeySystemAccess(_.wd,
|
|
2
|
-
b)}catch(e){throw Error("CDN challenge requires Widevine but requestMediaKeySystemAccess failed: "+e.message);}b=yield c.createMediaKeys();(c=_.So.V2)&&(yield b.setServerCertificate(new Uint8Array(c)));const d=b.createSession(_.Yf);b=yield new Promise((e,f)=>{const g=window.setTimeout(()=>{f(Error("CDM challenge session timed out"))},1E4);d.addEventListener(_.Ae,h=>{window.clearTimeout(g);e(h.message)});d.generateRequest(_.Wc,a).catch(h=>{window.clearTimeout(g);f(h)})});d.close().catch(()=>{});return b})},
|
|
3
|
-
$U=function(a){let b="";_.G(a).forEach(c=>{b+=String.fromCharCode(c)});return btoa(b)},aV=function(a,b,c){return _.w(function*(){var d=b.headers["x-drm-challenge-data"],e=b.headers["x-drm-challenge-token"];if(!d||!e)throw a.g.warn("428 received but missing challenge headers"),Error("428 challenge headers missing");a.g.info("428 challenge received");const f=c.ne.onChallengeStart;typeof f===_.ae&&f();d=YU(d);try{var g=yield ZU(d)}catch(l){throw a.g.error("Failed to create CDM challenge session",l),
|
|
4
|
-
l;}d=b.uri||b.request.uris[0];try{var h=yield c.ne.getAuthToken()}catch(l){throw a.g.error("getAuthToken() failed",l),l;}let k;try{k=yield window.fetch(d,{headers:{"x-drm-license-request":$U(g),"x-drm-challenge-token":e,Authorization:"Bearer "+h}})}catch(l){throw a.g.error("Manifest retry fetch failed",l),l;}if(!k.ok)throw a.g.error("Manifest retry returned "+k.status),Error("CDN challenge retry failed: "+k.status);e=k.headers.get("x-cat");g=k.headers.get(_.Ug);h=k.headers.get(_.Tg);e&&(c.ge=e);d=
|
|
5
|
-
c.ne.onCatReceived;e&&typeof d===_.ae&&d(e);d=c.ne.onChallengeComplete;typeof d===_.ae&&d({Tj:g,Sj:h,ge:e});b.data=yield k.arrayBuffer();b.status=k.status;k.headers.forEach((l,m)=>{b.headers[m.toLowerCase()]=l});a.g.info("428 challenge complete");return b})};
|
|
6
|
-
_.x(XU,class extends _.Ev{constructor(){super();this.g=new _.T(XU);this.f=new WeakMap;this.a=null}id(){return"cdn-challenge"}beforeLoad(a){var b=a.getConfiguration();const c=b.drm&&b.drm.customData&&b.drm.customData.cdn;if(c&&typeof c.getAuthToken===_.ae){if(b=this.f.get(a)){const e=a.getNetworkEngine();b.Me&&e.Cf(b.Me);b.Ne&&e.Xd(b.Ne);this.f.delete(a)}var d={ge:null,ne:c,Me:null,Ne:null};b=a.getNetworkEngine();d.Me=e=>{!d.ge||1!==e.type&&2!==e.type||(e.headers["x-cat"]=d.ge)};d.Ne=e=>{if(428===
|
|
7
|
-
e.status&&e.request&&1===e.request.type)return this.a?this.a:this.a=aV(this,e,d).finally(()=>{this.a=null});if(e.request&&3===e.request.type&&(e=e.headers["x-cat"])){d.ge=e;const f=c.onCatReceived;typeof f===_.ae&&f(e)}};b.Ue(d.Me);b.Sc(d.Ne);this.f.set(a,d)}}});};f.call(g, window);
|