@castlabs/prestoplay 6.8.0 → 6.9.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 +27 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +6 -6
- package/cjs/cl.cast.js +109 -109
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +407 -407
- package/cjs/cl.crypto.js +8 -8
- package/cjs/cl.dash.js +72 -72
- package/cjs/cl.externs.js +25 -25
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +72 -67
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +31 -31
- package/cjs/cl.ima.js +23 -23
- package/cjs/cl.mse.js +272 -272
- package/cjs/cl.muxdata.js +15 -15
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +13 -13
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.smooth.js +71 -71
- package/cjs/cl.thumbnails.js +24 -24
- package/cjs/cl.tizen.js +71 -71
- package/cjs/cl.ttml.js +27 -27
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +13 -13
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.youbora.js +19 -19
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +88 -88
- package/cl.conviva.js +26 -26
- package/cl.core.js +259 -259
- package/cl.crypto.js +8 -8
- package/cl.dash.js +67 -67
- package/cl.externs.js +25 -25
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +61 -58
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +25 -25
- package/cl.ima.js +17 -17
- package/cl.mse.js +199 -199
- package/cl.muxdata.js +11 -11
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +9 -9
- package/cl.playlist.js +5 -5
- package/cl.smooth.js +58 -58
- package/cl.thumbnails.js +16 -16
- package/cl.tizen.js +57 -57
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +7 -7
- package/cl.vr.js +14 -14
- package/cl.vtt.js +12 -12
- package/cl.youbora.js +14 -14
- package/package.json +1 -1
- package/typings.d.ts +27 -0
package/cl.youbora.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
9100)),!1;"6.8.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},
|
|
3
|
-
a.code?"ad error":_
|
|
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.
|
|
5
|
-
youbora.Util.logAllEvents(this.l),this.a.on(this.l,_.je,this.I.bind(this)),this.a.on(this.l,_
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var aq="clpp.npaw.YouboraPlugin",bq="content.isLive",cq=function(a,b){if(b.namespace()===_.yc)return a.f.info("Youbora does not report when casting."),!1;const c=b.getConfiguration().youbora;if(!_.of(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(_.C(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},dq=a=>(a=a.getConfiguration().youbora)&&a.errorFilter?a.errorFilter:b=>({code:`${b.code}`,message:b.message,severity:b.severity}),eq=(a,b,c,d)=>{b=dq(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===
|
|
3
|
+
a.code?"ad error":_.Yc;b.severity===_.G?(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 fq=a=>{class b extends youbora.Adapter{constructor(c){super(c);this.l=c;this.a=new _.jo;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.ia())&&(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.Ia())?c.frameRate:null}getPlayerName(){return _.ma}getVersion(){return"6.9.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.I.bind(this)),this.a.on(this.l,_.Yc,this.F.bind(this)),this.a.on(this.l,_.Ce,this.H.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,_.oc,this.C.bind(this)))}unregisterListeners(){this.f.debug(_.nb);_.Mf(this.a)}dispose(){super.dispose()}m(){return this.l.getStats()||_.rl()}o(){return!!this.l.getConfiguration().autoplay}I(c){c=c.detail;this.j("state change",c);if(c)switch(c.currentState){case _.Fl:this.o()&&
|
|
6
6
|
this.g();break;case _.Hl:this.g();this.A();this.fireResume();this.fireBufferEnd();break;case _.Gl:this.o()&&this.g();this.A();this.fireBufferEnd();this.firePause();break;case _.El:this.fireBufferEnd();this.fireStop();break;case _.wl:this.fireBufferEnd();this.w&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.zl: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(_.
|
|
8
|
-
c);c=c.adsTimeline;this.w=!!c&&c.
|
|
9
|
-
this.a.getTitle()}getProvider(){return this.a&&this.a.getAdvertiserName()}getCreativeId(){return this.a&&this.a.getCreativeId()}getPosition(){const c=youbora.Constants.AdPosition;let d=null;if(this.a)switch(this.a.
|
|
10
|
-
this.j.getCuePoints().length}getGivenBreaks(){return this.getExpectedBreaks()}getExpectedAds(){return this.a&&this.a.
|
|
11
|
-
this.f&&(this.f.on(this.l,_.
|
|
12
|
-
this.f.on(this.l,_.
|
|
13
|
-
this.fireBufferBegin()}w(){this.m&&(this.g("ad buffering ended"),this.m=!1,this.fireBufferEnd())}o(c){this.g("ad quartile",c);this.fireQuartile(c)}F(){this.g("ad clicked");const c=this.a&&this.a.
|
|
14
|
-
c&&c.fireStop()}}H(c){(c=c.detail)&&10003===c.code&&
|
|
15
|
-
a.youbora;void 0===c[
|
|
7
|
+
(c=c.keySystem,(c=c.startsWith(_.Ic)?"Widevine":c.startsWith(_.Gc)?"FairPlay":c.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":c.startsWith(_.Jd)?"ClearKey":c.startsWith(_.Fc)?"Primetime":c)&&this.plugin.setOptions({"content.drm":c}));this.fireJoin()}F(c){!(c=c.detail)||this.h||10003===c.code&&this.plugin.getAdsAdapter()||(c=eq(c,this.l,this.f,this))&&c.severity===_.G&&(this.h=!0)}H(){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.hb()}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 gq=a=>{class b extends youbora.Adapter{constructor(c){super(c);this.l=c;this.j=this.a=null;this.f=new _.jo;this.h=new _.O("clpp.npaw.YouboraAdsAdapter");this.registerListeners();this.m=!1}getDuration(){return this.a&&this.a.getDuration()}getRendition(){let c=null;this.a&&(c=youbora.Util.buildRenditionString(this.a.sb(),this.a.rb(),this.a.gb()));return c}getBitrate(){return this.a&&this.a.gb()}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.Sa()){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.ub()}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 _.ma}getVersion(){return"6.9.0-castlabsadsadapter-js"}getPlayerVersion(){return _.da}registerListeners(){this.l&&
|
|
11
|
+
this.f&&(this.f.on(this.l,_.Lb,this.N.bind(this)),this.f.on(this.l,_.Hb,this.M.bind(this)),this.f.on(this.l,_.Db,this.I.bind(this)),this.f.on(this.l,_.Fb,this.J.bind(this)),this.f.on(this.l,_.yb,this.G.bind(this)),this.f.on(this.l,_.zb,this.o.bind(this,1)),this.f.on(this.l,_.Cb,this.o.bind(this,2)),this.f.on(this.l,_.Jb,this.o.bind(this,3)),this.f.on(this.l,_.xb,this.F.bind(this)),this.f.on(this.l,_.Gb,this.K.bind(this)),this.f.on(this.l,_.Yc,this.H.bind(this)),this.f.on(this.l,_.ub,this.A.bind(this)),
|
|
12
|
+
this.f.on(this.l,_.vb,this.B.bind(this)),this.f.on(this.l,_.wb,this.C.bind(this)),this.f.on(this.l,_.Eb,this.w.bind(this)))}unregisterListeners(){_.Mf(this.f)}dispose(){super.dispose()}N(c){this.h.debug("ad timeline changed",c);this.j=c.adsTimeline}M(c){this.a=c.ad;this.g("ad start",this.a);this.fireStart();this.fireJoin()}G(){this.g("ad ended");this.fireStop()}I(){this.g("ad pause");this.w();this.firePause()}J(){this.g("ad resume");this.w();this.fireResume()}C(){this.m=!0;this.g("ad buffering started");
|
|
13
|
+
this.fireBufferBegin()}w(){this.m&&(this.g("ad buffering ended"),this.m=!1,this.fireBufferEnd())}o(c){this.g("ad quartile",c);this.fireQuartile(c)}F(){this.g("ad clicked");const c=this.a&&this.a.Hb();this.h.debug("ad click through url: ",c);this.fireClick(c)}K(){this.g("ad skipped");this.fireSkip()}A(c){this.a=c.ad;this.g("ad break start",this.a);this.fireBreakStart()}B(){this.g("ad break stop");this.fireBreakStop();if(this.getPosition()===youbora.Constants.AdPosition.Postroll){const c=this.plugin.getAdapter();
|
|
14
|
+
c&&c.fireStop()}}H(c){(c=c.detail)&&10003===c.code&&eq(c,this.l,this.h,this)}g(c,...d){this.h.debug(`Reporting "${c}" event to Youbora`,...d)}}return new b(a)};var hq=class extends _.$p{constructor(){super();this.a=null;this.f=new _.O(aq);this.l=null}be(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(fq(this.l)),this.a.setAdsAdapter(gq(this.l))}getAdapter(){return this.a&&this.a.getAdapter()}getAdsAdapter(){return this.a&&this.a.getAdsAdapter()}onPlayerCreated(a){this.l=a;cq(this,a)&&(a=a.getConfiguration().youbora,this.be(new youbora.Plugin(a)))}onContentWillLoad(a,b){if(cq(this,a)){a=a.getConfiguration();var c=
|
|
15
|
+
a.youbora;void 0===c[bq]&&(c[bq]=b.isLive);void 0===c["content.title"]&&(c["content.title"]=b.name);void 0===c.viewerId&&(c.viewerId=a.viewerId);this.a||this.be(new youbora.Plugin(c));this.a.setOptions(c)}}onPlayerWillRelease(){}onPlayerWillDestroy(){}id(){return"youbora"}};_.z(aq,hq);hq.prototype.getAdsAdapter=hq.prototype.getAdsAdapter;hq.prototype.getAdapter=hq.prototype.getAdapter;hq.prototype.setYouboraPlugin=hq.prototype.be;hq.Id="youbora";_.Hm(new class{create(){return new hq}});};f.call(g, window);
|
package/package.json
CHANGED
package/typings.d.ts
CHANGED
|
@@ -1576,6 +1576,11 @@ export namespace clpp {
|
|
|
1576
1576
|
* Note that in order for this feature to work, NAME attributes of
|
|
1577
1577
|
* #EXT-X-MEDIA tags must be unique per type (i.e. no two audio tracks
|
|
1578
1578
|
* share the same name, no two text tracks share the same name).
|
|
1579
|
+
*
|
|
1580
|
+
*
|
|
1581
|
+
* Note that this requires an additional load of the manifest since
|
|
1582
|
+
* this information is currently not exposed directly by Safaris native
|
|
1583
|
+
* player. For this reason, fetching additional meta-data is off by default.
|
|
1579
1584
|
*/
|
|
1580
1585
|
enableMetadata?: boolean;
|
|
1581
1586
|
}
|
|
@@ -1887,6 +1892,28 @@ export namespace clpp {
|
|
|
1887
1892
|
* that the manifest times and the segment media times are in alignment
|
|
1888
1893
|
*/
|
|
1889
1894
|
ignoreDrift: boolean;
|
|
1895
|
+
/**
|
|
1896
|
+
* Defaults to false.
|
|
1897
|
+
*
|
|
1898
|
+
* The option allows the player to ignore the Managed Media Source (MMS)
|
|
1899
|
+
* `startstreaming` and `endstreaming` events. These events are normally used
|
|
1900
|
+
* as hints from the User Agent to optimize streaming performance in relation
|
|
1901
|
+
* to network conditions and device power management.
|
|
1902
|
+
* When this option is set to `true`, the application will ignore these hints,
|
|
1903
|
+
* enabling continuous streaming regardless of the underlying network
|
|
1904
|
+
* conditions or device constraints. This can be particularly useful in
|
|
1905
|
+
* scenarios where consistent streaming is prioritized over battery and
|
|
1906
|
+
* bandwidth optimization.
|
|
1907
|
+
* Setting this option to `false` (default) will allow the application to
|
|
1908
|
+
* adhere to the `startstreaming` and `endstreaming` events. This is
|
|
1909
|
+
* recommended for general use cases to ensure an optimal balance between
|
|
1910
|
+
* streaming performance and resource utilization.
|
|
1911
|
+
* Note:
|
|
1912
|
+
* Use this option judiciously, as ignoring these hints can impact device
|
|
1913
|
+
* battery life and network efficiency, especially in varying network
|
|
1914
|
+
* conditions or on constrained devices.
|
|
1915
|
+
*/
|
|
1916
|
+
ignoreManagedMediaSourceStreamingHints?: boolean;
|
|
1890
1917
|
/**
|
|
1891
1918
|
* Defaults to false.
|
|
1892
1919
|
*
|