@castlabs/prestoplay 6.28.0 → 6.30.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 +37 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +7 -7
- package/cjs/cl.cast.js +128 -116
- package/cjs/cl.conviva.js +32 -32
- package/cjs/cl.core.js +619 -614
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +92 -89
- package/cjs/cl.externs.js +154 -60
- package/cjs/cl.freewheel.js +25 -25
- 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 +25 -23
- package/cjs/cl.mediatailor.js +3 -3
- package/cjs/cl.mse.js +350 -349
- package/cjs/cl.muxdata.js +14 -14
- package/cjs/cl.onboard.js +4 -4
- package/cjs/cl.persistent.js +15 -15
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.simid.js +16 -16
- package/cjs/cl.smooth.js +57 -58
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +60 -60
- 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 +19 -19
- 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 +6 -6
- package/cl.cast.js +101 -92
- package/cl.conviva.js +27 -27
- package/cl.core.js +500 -496
- package/cl.crypto.js +9 -9
- package/cl.dash.js +84 -83
- package/cl.externs.js +150 -60
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +82 -80
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +19 -17
- package/cl.mediatailor.js +2 -2
- package/cl.mse.js +304 -305
- package/cl.muxdata.js +13 -13
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +11 -11
- package/cl.playlist.js +5 -5
- package/cl.simid.js +14 -14
- package/cl.smooth.js +60 -60
- package/cl.thumbnails.js +19 -19
- package/cl.tizen.js +56 -56
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -8
- package/cl.vr.js +14 -14
- package/cl.vtt.js +12 -12
- package/cl.yospace.js +3 -3
- package/cl.youbora.js +31 -31
- package/package.json +1 -1
- package/typings.d.ts +198 -88
package/cl.freewheel.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
if(b.length)throw new _.
|
|
3
|
-
tv.freewheel.SDK.EVENT_SLOT_ENDED,a.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
0}getPosition(){return 0}getSkipTimeOffset(){return 0}
|
|
7
|
-
case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:return 2;default:return 1}}getPodIndex(){switch(this.
|
|
8
|
-
X.prototype.getVideoElement=X.prototype.
|
|
9
|
-
X.prototype.getMediaBitrate=X.prototype.
|
|
10
|
-
X.prototype.getAdSystem=X.prototype.getAdSystem;X.prototype.getApiFramework=X.prototype.getApiFramework;X.prototype.getSourceId=X.prototype.
|
|
11
|
-
|
|
12
|
-
_.r||a.a.setSiteSection(b.siteSectionId);const c=yield
|
|
13
|
-
if(Array.isArray(b.parameters))for(const d of b.parameters)a.a.setParameter(d.name,d.value,d.level);
|
|
14
|
-
a.w&&(a.w.stop(),a.w=null);
|
|
15
|
-
9,10003,{errorType:0},void 0));this.
|
|
16
|
-
_.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var ST="clpp-freewheel",TT="clpp.freewheel.AdsManagerFactory",UT="freewheel",VT=function(a){switch(a){case 0:return tv.freewheel.SDK.ADUNIT_PREROLL;case 1:return tv.freewheel.SDK.ADUNIT_MIDROLL;case 2:return tv.freewheel.SDK.ADUNIT_POSTROLL;default:return""}},WT=function(a){const b=[];typeof a.networkId!==_.r&&b.push("networkId");typeof a.serverUrl!==_.Tf&&b.push("serverUrl");typeof a.profileId!==_.Tf&&b.push("profileId");typeof a.videoAssetId!==_.Tf&&typeof a.videoAssetId!==_.r&&b.push("videoAssetId");
|
|
2
|
+
if(b.length)throw new _.I(1,9,12001,{missingKeys:b.join(", ")});},XT=function(){return _.w(function*(){var a=new _.Ev;let b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_NONE;const c=yield a.canPlay(!1);a=yield a.canPlay(!0);c?b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_ATTENDED:a&&(b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_UNATTENDED);return b})},YT=function(a){a.h.on(a.a,tv.freewheel.SDK.EVENT_REQUEST_COMPLETE,a.L.bind(a));a.h.on(a.a,tv.freewheel.SDK.EVENT_SLOT_STARTED,a.P.bind(a));a.h.on(a.a,
|
|
3
|
+
tv.freewheel.SDK.EVENT_SLOT_ENDED,a.M.bind(a));a.h.on(a.a,tv.freewheel.SDK.EVENT_AD,a.K.bind(a));a.h.on(a.m,_.fg,a.J.bind(a));a.h.on(a.m,_.Qf,a.I.bind(a))},ZT=function(a){const b=a.m.md(UT).Pc();b&&a.m.getSurface().hide(b);a.m.getSurface().showMediaElement()},$T=function(a){const b=a.m.md(UT).Pc();b&&(a.m.getSurface().show(b),a.m.getSurface().hideMediaElement(),a.a.registerVideoDisplayBase(ST),a.m.isMuted()?a.setVolume(0):a.setVolume(a.m.getVolume()||1))},aU=function(a,b,c){var d=null;a.a&&c&&(c.adInstance||
|
|
4
|
+
c.slot)&&(c=(d=c.adInstance||null)?d.getSlot():c.slot,d={ad:new X(a.a,c,d)});a.m.trigger(new _.H(b,d))},bU=class extends _.Ov{constructor(){super();this.f=this.a=null}onPlayerCreated(a){if(window.tv&&tv.freewheel&&tv.freewheel.SDK)this.a=_.Bi(_.Fd,{id:ST}),this.f=_.Bi(_.t,{"class":_.cd}),this.a.appendChild(this.f),a.getSurface().addElementToContainer(this.a,!0),a.getSurface().hide(this.a);else a.onError(new _.I(1,9,12E3))}onPlayerWillDestroy(a){this.a&&(a.getSurface().removeElementFromContainer(this.a),
|
|
5
|
+
this.f=this.a=null)}id(){return UT}Pc(){return this.a}Qh(){return this.f}};_.x("clpp.freewheel.FreeWheelPlugin",bU);bU.prototype.getAdVideo=bU.prototype.Qh;bU.prototype.getAdContainer=bU.prototype.Pc;bU.Id=UT;bU.AD_CONTAINER_ID=ST;var cU=class{create(){return new bU}};var X=class{constructor(a,b,c){this.h=a;this.f=b;this.a=c}nb(){return"FreeWheel AdManager SDK"}ob(){return tv.freewheel.SDK.version}ub(){return 0}getId(){return this.a?this.a.getAdId():""}getCreativeId(){const a=(this.a||{})._creativeId;return typeof a===_.Tf?a:""}Qb(){return""}getApiFramework(){return this.a?this.a.getActiveCreativeRendition().getCreativeApi():""}getAdSystem(){return""}getAdvertiserName(){return""}getTitle(){return""}getDuration(){return this.a?this.a.getActiveCreativeRendition().getDuration():
|
|
6
|
+
0}getPosition(){return 0}getSkipTimeOffset(){return 0}Ub(){return!1}pb(){return this.a&&this.a.getEventCallbackUrls(tv.freewheel.SDK.EVENT_AD_CLICK,tv.freewheel.SDK.EVENT_TYPE_CLICK)[0]||""}getMediaUrl(){return this.a?this.a.getActiveCreativeRendition().getPrimaryCreativeRenditionAsset().getUrl():""}eb(){return this.a?this.a.getActiveCreativeRendition().getWidth():0}cb(){return this.a?this.a.getActiveCreativeRendition().getHeight():0}Pa(){return 0}Qa(){switch(this.f.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:return 0;
|
|
7
|
+
case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:return 2;default:return 1}}getPodIndex(){switch(this.Qa()){case 0:return 0;case 2:return-1}return this.h.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL).indexOf(this.f)+1}Hb(){switch(this.Qa()){case 0:return 0;case 2:return-1;default:return this.f.getTimePosition()}}rb(){return this.a?this.f.getAdInstances().indexOf(this.a)+1:1}fb(){return this.f.getAdCount()}getWrapperAdIds(){return[]}canSeek(){return!1}getWrapperAdSystems(){return[]}getWrapperCreativeIds(){return[]}Sb(){return null}};
|
|
8
|
+
X.prototype.getVideoElement=X.prototype.Sb;X.prototype.getWrapperCreativeIds=X.prototype.getWrapperCreativeIds;X.prototype.getWrapperAdSystems=X.prototype.getWrapperAdSystems;X.prototype.canSeek=X.prototype.canSeek;X.prototype.getWrapperAdIds=X.prototype.getWrapperAdIds;X.prototype.getSequenceLength=X.prototype.fb;X.prototype.getPositionInSequence=X.prototype.rb;X.prototype.getPodTimeOffset=X.prototype.Hb;X.prototype.getPodIndex=X.prototype.getPodIndex;X.prototype.getPodType=X.prototype.Qa;
|
|
9
|
+
X.prototype.getMediaBitrate=X.prototype.Pa;X.prototype.getMediaHeight=X.prototype.cb;X.prototype.getMediaWidth=X.prototype.eb;X.prototype.getMediaUrl=X.prototype.getMediaUrl;X.prototype.getClickThroughUrl=X.prototype.pb;X.prototype.isBumper=X.prototype.Ub;X.prototype.getSkipTimeOffset=X.prototype.getSkipTimeOffset;X.prototype.getPosition=X.prototype.getPosition;X.prototype.getDuration=X.prototype.getDuration;X.prototype.getTitle=X.prototype.getTitle;X.prototype.getAdvertiserName=X.prototype.getAdvertiserName;
|
|
10
|
+
X.prototype.getAdSystem=X.prototype.getAdSystem;X.prototype.getApiFramework=X.prototype.getApiFramework;X.prototype.getSourceId=X.prototype.Qb;X.prototype.getCreativeId=X.prototype.getCreativeId;X.prototype.getId=X.prototype.getId;X.prototype.getTechnology=X.prototype.ub;X.prototype.getAdManagerVersion=X.prototype.ob;X.prototype.getAdManagerName=X.prototype.nb;var dU=class{constructor(a){this.a=a}getCuePoints(){return this.a.getTemporalSlots().map(a=>{switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:return 0;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:return-1;default:return a.getTimePosition()}})}Jb(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL).length}Ib(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL).length}};
|
|
11
|
+
dU.prototype.hasPostroll=dU.prototype.Ib;dU.prototype.hasPreroll=dU.prototype.Jb;dU.prototype.getCuePoints=dU.prototype.getCuePoints;var eU=class{constructor(a){this.g=new _.T("clpp.freewheel.AdsManager");this.m=a;this.h=new _.Kt;this.F=new tv.freewheel.SDK.AdManager;this.f=this.a=null;this.H=[];this.C=[];this.G=[];this.B=new _.Hl;this.w=null}load(){const a=this;return _.w(function*(){const b=a.m.getConfiguration().freewheel||{};try{WT(b)}catch(d){return a.m.onError(d),a.B.resolve(),a.B}a.F.setNetwork(b.networkId);a.F.setServer(b.serverUrl);a.a=a.F.newContext();a.a.setProfile(b.profileId);typeof b.siteSectionId!==_.Tf&&typeof b.siteSectionId!==
|
|
12
|
+
_.r||a.a.setSiteSection(b.siteSectionId);const c=yield XT();a.a.setVideoAsset(b.videoAssetId,a.m.getDuration(),void 0,void 0,c);if(Array.isArray(b.pods))for(const d of b.pods)a.a.addTemporalSlot(d.id,VT(d.type),d.position,d.slotProfile,d.cuepointSequence,d.maxDuration,d.minDuration,d.acceptContentType);b.keyValues&&typeof b.keyValues===_.He&&Object.keys(b.keyValues).forEach(d=>a.a.addKeyValue(d,b.keyValues[d]));a.a.setParameter(tv.freewheel.SDK.PARAMETER_EXTENSION_CONTENT_VIDEO_ENABLED,!1,tv.freewheel.SDK.PARAMETER_LEVEL_GLOBAL);
|
|
13
|
+
if(Array.isArray(b.parameters))for(const d of b.parameters)a.a.setParameter(d.name,d.value,d.level);YT(a);a.a.submitRequest();return a.B})}A(){if(this.H.length){$T(this);this.f=this.H.shift();this.f.play();var a=!1}else ZT(this),a=!0;return a}o(){}resume(){this.f&&this.f.resume()}pause(){this.f&&this.f.pause()}skip(){this.f&&this.f.skipCurrentAd()}getVolume(){return this.a?this.a.getAdVolume():1}setVolume(a){this.a&&this.a.setAdVolume(a)}getPosition(){return this.f?this.f.getPlayheadTime():-1}l(){return!0}j(){const a=
|
|
14
|
+
this;return _.w(function*(){a.h.release();a.w&&(a.w.stop(),a.w=null);ZT(a);a.a&&(a.a.dispose(),a.a=null)})}L(a){if(a.success)this.H=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL),this.C=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL),this.G=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL),this.m.trigger(new _.H(_.pc,{adsTimeline:new dU(this.a)})),this.w=new _.Cv(this.m.getSurface(),(b,c)=>this.a.resize(b,
|
|
15
|
+
c),this.m.md(UT).f);else this.m.onError(new _.I(1,9,10003,{errorType:0},void 0));this.B.resolve()}P(a){aU(this,_.Tb,a);this.w.start()}M(a){this.f=null;a=a.slot;aU(this,_.Ub);this.w.stop();ZT(this);a&&a.getTimePositionClass()===tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL||this.m.play()}K(a){const b=a.subType;this.g.debug("ad event",b);switch(b){case tv.freewheel.SDK.EVENT_AD_IMPRESSION:aU(this,_.lc,a);aU(this,_.bc,a);break;case tv.freewheel.SDK.EVENT_AD_IMPRESSION_END:aU(this,_.mc,a);break;case tv.freewheel.SDK.EVENT_AD_FIRST_QUARTILE:aU(this,
|
|
16
|
+
_.Yb,a);break;case tv.freewheel.SDK.EVENT_AD_MIDPOINT:aU(this,_.gc,a);break;case tv.freewheel.SDK.EVENT_AD_THIRD_QUARTILE:aU(this,_.nc,a);break;case tv.freewheel.SDK.EVENT_AD_COMPLETE:aU(this,_.Xb,a);break;case tv.freewheel.SDK.EVENT_AD_CLICK:aU(this,_.Wb,a);break;case tv.freewheel.SDK.EVENT_AD_PAUSE:aU(this,_.hc,a);break;case tv.freewheel.SDK.EVENT_AD_RESUME:aU(this,_.jc,a);break;case tv.freewheel.SDK.EVENT_AD_SKIPPED:aU(this,_.kc,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_START:aU(this,_.Vb,
|
|
17
|
+
a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_END:aU(this,_.ic,a);break;case tv.freewheel.SDK.EVENT_ERROR:this.m.onError(new _.I(1,9,10003,{errorType:1},{fwCode:a[tv.freewheel.SDK.INFO_KEY_ERROR_CODE],fwInfo:a[tv.freewheel.SDK.INFO_KEY_ERROR_INFO],fwModule:a[tv.freewheel.SDK.INFO_KEY_ERROR_MODULE]}))}}J(){if(!this.f){var a=this.m.getPosition();if(this.f=this.C.find(b=>.5>Math.abs(a-b.getTimePosition()))||null){const b=this.C.findIndex(c=>c===this.f);this.C.splice(b,1);this.m.pause();$T(this);
|
|
18
|
+
this.f.play()}}}I(a){if((a=a.detail)&&this.a)switch(a.currentState){case 3:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PLAYING);break;case 4:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PAUSED);break;case 5:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_COMPLETED);this.G.length?($T(this),this.f=this.G.shift(),this.f.play()):ZT(this);break;case _.zs:case _.ps:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_STOPPED)}}};eU.prototype.getPosition=eU.prototype.getPosition;
|
|
19
|
+
eU.prototype.setVolume=eU.prototype.setVolume;eU.prototype.getVolume=eU.prototype.getVolume;eU.prototype.skip=eU.prototype.skip;eU.prototype.pause=eU.prototype.pause;eU.prototype.resume=eU.prototype.resume;_.Fh(new class{constructor(){this.Sa=new _.T(TT)}name(){return TT}a(a,b){return a.namespace()!==_.hd&&b&&b.freewheel?window.tv&&tv.freewheel&&tv.freewheel.SDK?!0:(this.Sa.warn("FreeWheel SDK is not loaded."),!1):!1}create(a){return new eU(a)}});_.Qn(new cU);};f.call(g, window);
|