@castlabs/prestoplay 6.9.0 → 6.11.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 +66 -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 +112 -111
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +467 -432
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +72 -72
- package/cjs/cl.externs.js +143 -45
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +78 -73
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +29 -31
- package/cjs/cl.ima.js +24 -24
- package/cjs/cl.mse.js +276 -275
- package/cjs/cl.muxdata.js +14 -15
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +14 -14
- 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 +29 -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 +20 -20
- 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 +27 -27
- package/cl.core.js +396 -365
- package/cl.crypto.js +9 -9
- package/cl.dash.js +68 -67
- package/cl.externs.js +139 -45
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +64 -61
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -25
- package/cl.ima.js +17 -17
- package/cl.mse.js +240 -242
- package/cl.muxdata.js +12 -12
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +11 -11
- package/cl.playlist.js +5 -5
- package/cl.smooth.js +59 -58
- package/cl.thumbnails.js +17 -17
- package/cl.tizen.js +57 -57
- 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.youbora.js +15 -15
- package/clpp.styles.css +15 -0
- package/package.json +1 -1
- package/typings.d.ts +249 -21
package/cjs/cl.freewheel.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
this.f=this.a=null;this.B=[];this.o=[];this.A=[];this.
|
|
4
|
-
_.x(e,a.canPlay(!1),2);if(3!=e.a)return c=e.f,_.x(e,a.canPlay(!0),3);d=e.f;c?b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_ATTENDED:d&&(b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_UNATTENDED);return e["return"](b)})},
|
|
5
|
-
a.a.registerVideoDisplayBase(
|
|
6
|
-
_.
|
|
7
|
-
_.
|
|
8
|
-
_.
|
|
9
|
-
_.
|
|
10
|
-
_.
|
|
11
|
-
_.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
_.
|
|
16
|
-
_.u(b.pods),e=d.next();!e.done;e=d.next())f=e.value,a.a.addTemporalSlot(f.id,
|
|
17
|
-
g.next())l=h.value,a.a.setParameter(l.name,l.value,l.level);a.g.on(a.a,tv.freewheel.SDK.EVENT_REQUEST_COMPLETE,a.
|
|
18
|
-
_.
|
|
19
|
-
_.
|
|
20
|
-
void 0));this.
|
|
21
|
-
_.
|
|
22
|
-
_.
|
|
23
|
-
fwModule:a[tv.freewheel.SDK.INFO_KEY_ERROR_MODULE]}))}};_.
|
|
24
|
-
_.
|
|
25
|
-
|
|
2
|
+
var f=function(window){var YM="clpp-freewheel",ZM="clpp.freewheel.AdsManagerFactory",$M="freewheel",aN=function(){this.f=this.a=null},bN=function(){},cN=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""}},dN=function(a,b,c){this.g=a;this.f=b;this.a=c},eN=function(a){this.a=a},fN=function(a){this.h=new _.K("clpp.freewheel.AdsManager");this.m=a;this.g=new _.Eg;this.w=new tv.freewheel.SDK.AdManager;
|
|
3
|
+
this.f=this.a=null;this.B=[];this.o=[];this.A=[];this.l=new _.Fi;this.j=null},gN=function(a){var b=[];typeof a.networkId!==_.k&&b.push("networkId");typeof a.serverUrl!==_.Ue&&b.push("serverUrl");typeof a.profileId!==_.Ue&&b.push("profileId");typeof a.videoAssetId!==_.Ue&&typeof a.videoAssetId!==_.k&&b.push("videoAssetId");if(b.length)throw new _.N(1,9,12001,{missingKeys:b.join(", ")});},hN=function(){var a,b,c,d;return _.G(function(e){if(1==e.a)return a=new _.Eq,b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_NONE,
|
|
4
|
+
_.x(e,a.canPlay(!1),2);if(3!=e.a)return c=e.f,_.x(e,a.canPlay(!0),3);d=e.f;c?b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_ATTENDED:d&&(b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_UNATTENDED);return e["return"](b)})},kN=function(a){return _.G(function(b){if(a.B.length)return iN(a),a.f=a.B.shift(),a.f.play(),b.G(0);jN(a);return _.x(b,a.m.a.play(),0)})},lN=function(a){a.A.length?(iN(a),a.f=a.A.shift(),a.f.play()):jN(a)},iN=function(a){var b=a.m.cc($M).Ic();b&&(a.m.getSurface().show(b),a.m.getSurface().hideMediaElement(),
|
|
5
|
+
a.a.registerVideoDisplayBase(YM),a.m.isMuted()?a.setVolume(0):a.setVolume(a.m.getVolume()||1))},jN=function(a){var b=a.m.cc($M).Ic();b&&a.m.getSurface().hide(b);a.m.getSurface().showMediaElement()},mN=function(a,b,c){var d=null;a.a&&c&&(c.adInstance||c.slot)&&(c=(d=c.adInstance||null)?d.getSlot():c.slot,d={ad:new dN(a.a,c,d)});a.m.trigger(new _.L(b,d))},nN=function(){this.a=new _.K(ZM)};_.w(aN,_.rr);_.r=aN.prototype;
|
|
6
|
+
_.r.onPlayerCreated=function(a){if(window.tv&&tv.freewheel&&tv.freewheel.SDK)this.a=_.to(_.gd,{id:YM}),this.f=_.to(_.uf,{"class":_.Mc}),this.a.appendChild(this.f),a.getSurface().addElementToContainer(this.a,!0),a.getSurface().hide(this.a);else a.onError(new _.N(1,9,12E3))};_.r.onPlayerWillDestroy=function(a){this.a&&(a.getSurface().removeElementFromContainer(this.a),this.f=this.a=null)};_.r.id=function(){return $M};_.r.Ic=function(){return this.a};_.r.rj=function(){return this.f};
|
|
7
|
+
_.I("clpp.freewheel.FreeWheelPlugin",aN);aN.prototype.getAdVideo=aN.prototype.rj;aN.prototype.getAdContainer=aN.prototype.Ic;aN.Id=$M;aN.AD_CONTAINER_ID=YM;bN.prototype.create=function(){return new aN};_.qp(new bN);_.r=dN.prototype;_.r.ub=function(){return"FreeWheel AdManager SDK"};_.r.vb=function(){return tv.freewheel.SDK.version};_.r.Ab=function(){return 0};_.r.getId=function(){return this.a?this.a.getAdId():""};_.r.getCreativeId=function(){var a=(this.a||{})._creativeId;return typeof a===_.Ue?a:""};_.r.getApiFramework=function(){return this.a?this.a.getActiveCreativeRendition().getCreativeApi():""};_.r.getAdSystem=function(){return""};_.r.getAdvertiserName=function(){return""};_.r.getTitle=function(){return""};
|
|
8
|
+
_.r.getDuration=function(){return this.a?this.a.getActiveCreativeRendition().getDuration():0};_.r.getSkipTimeOffset=function(){return 0};_.r.gc=function(){return!1};_.r.Lb=function(){return this.a&&this.a.getEventCallbackUrls(tv.freewheel.SDK.EVENT_AD_CLICK,tv.freewheel.SDK.EVENT_TYPE_CLICK)[0]||""};_.r.getMediaUrl=function(){return this.a?this.a.getActiveCreativeRendition().getPrimaryCreativeRenditionAsset().getUrl():""};
|
|
9
|
+
_.r.xb=function(){return this.a?this.a.getActiveCreativeRendition().getWidth():0};_.r.wb=function(){return this.a?this.a.getActiveCreativeRendition().getHeight():0};_.r.jb=function(){return 0};_.r.Za=function(){switch(this.f.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:return 0;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:return 2;default:return 1}};
|
|
10
|
+
_.r.getPodIndex=function(){switch(this.Za()){case 0:return 0;case 2:return-1}return this.g.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL).indexOf(this.f)+1};_.r.Mb=function(){switch(this.Za()){case 0:return 0;case 2:return-1;default:return this.f.getTimePosition()}};_.r.Nb=function(){return this.a?this.f.getAdInstances().indexOf(this.a)+1:1};_.r.zb=function(){return this.f.getAdCount()};_.r.getWrapperAdIds=function(){return[]};_.r.getWrapperAdSystems=function(){return[]};
|
|
11
|
+
_.r.getWrapperCreativeIds=function(){return[]};dN.prototype.getWrapperCreativeIds=dN.prototype.getWrapperCreativeIds;dN.prototype.getWrapperAdSystems=dN.prototype.getWrapperAdSystems;dN.prototype.getWrapperAdIds=dN.prototype.getWrapperAdIds;dN.prototype.getSequenceLength=dN.prototype.zb;dN.prototype.getPositionInSequence=dN.prototype.Nb;dN.prototype.getPodTimeOffset=dN.prototype.Mb;dN.prototype.getPodIndex=dN.prototype.getPodIndex;dN.prototype.getPodType=dN.prototype.Za;
|
|
12
|
+
dN.prototype.getMediaBitrate=dN.prototype.jb;dN.prototype.getMediaHeight=dN.prototype.wb;dN.prototype.getMediaWidth=dN.prototype.xb;dN.prototype.getMediaUrl=dN.prototype.getMediaUrl;dN.prototype.getClickThroughUrl=dN.prototype.Lb;dN.prototype.isBumper=dN.prototype.gc;dN.prototype.getSkipTimeOffset=dN.prototype.getSkipTimeOffset;dN.prototype.getDuration=dN.prototype.getDuration;dN.prototype.getTitle=dN.prototype.getTitle;dN.prototype.getAdvertiserName=dN.prototype.getAdvertiserName;
|
|
13
|
+
dN.prototype.getAdSystem=dN.prototype.getAdSystem;dN.prototype.getApiFramework=dN.prototype.getApiFramework;dN.prototype.getCreativeId=dN.prototype.getCreativeId;dN.prototype.getId=dN.prototype.getId;dN.prototype.getTechnology=dN.prototype.Ab;dN.prototype.getAdManagerVersion=dN.prototype.vb;dN.prototype.getAdManagerName=dN.prototype.ub;eN.prototype.getCuePoints=function(){return this.a.getTemporalSlots().map(function(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()}})};eN.prototype.Ob=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL).length};eN.prototype.kb=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL).length};
|
|
14
|
+
eN.prototype.hasPostroll=eN.prototype.kb;eN.prototype.hasPreroll=eN.prototype.Ob;eN.prototype.getCuePoints=eN.prototype.getCuePoints;_.r=fN.prototype;
|
|
15
|
+
_.r.load=function(){var a=this,b,c,d,e,f,g,h,l;return _.G(function(m){if(1==m.a){b=a.m.getConfiguration().freewheel||{};try{gN(b)}catch(n){return a.m.onError(n),a.l.resolve(),m["return"](a.l)}a.w.setNetwork(b.networkId);a.w.setServer(b.serverUrl);a.a=a.w.newContext();a.a.setProfile(b.profileId);typeof b.siteSectionId!==_.Ue&&typeof b.siteSectionId!==_.k||a.a.setSiteSection(b.siteSectionId);return _.x(m,hN(),2)}c=m.f;a.a.setVideoAsset(b.videoAssetId,a.m.getDuration(),void 0,void 0,c);if(Array.isArray(b.pods))for(d=
|
|
16
|
+
_.u(b.pods),e=d.next();!e.done;e=d.next())f=e.value,a.a.addTemporalSlot(f.id,cN(f.type),f.position,f.slotProfile,f.cuepointSequence,f.maxDuration,f.minDuration,f.acceptContentType);b.keyValues&&typeof b.keyValues===_.ae&&Object.keys(b.keyValues).forEach(function(n){return a.a.addKeyValue(n,b.keyValues[n])});a.a.setParameter(tv.freewheel.SDK.PARAMETER_EXTENSION_CONTENT_VIDEO_ENABLED,!1,tv.freewheel.SDK.PARAMETER_LEVEL_GLOBAL);if(Array.isArray(b.parameters))for(g=_.u(b.parameters),h=g.next();!h.done;h=
|
|
17
|
+
g.next())l=h.value,a.a.setParameter(l.name,l.value,l.level);a.g.on(a.a,tv.freewheel.SDK.EVENT_REQUEST_COMPLETE,a.Ok.bind(a));a.g.on(a.a,tv.freewheel.SDK.EVENT_SLOT_STARTED,a.Sk.bind(a));a.g.on(a.a,tv.freewheel.SDK.EVENT_SLOT_ENDED,a.Rk.bind(a));a.g.on(a.a,tv.freewheel.SDK.EVENT_AD,a.ik.bind(a));a.g.on(a.m,_.cf,a.oi.bind(a));a.g.on(a.m,_.Re,a.ni.bind(a));a.a.submitRequest();return m["return"](a.l)})};_.r.start=function(){var a=this;return _.G(function(b){return _.x(b,kN(a),0)})};
|
|
18
|
+
_.r.resume=function(){this.f&&this.f.resume()};_.r.pause=function(){this.f&&this.f.pause()};_.r.skip=function(){this.f&&this.f.skipCurrentAd()};_.r.getVolume=function(){return this.a?this.a.getAdVolume():1};_.r.setVolume=function(a){this.a&&this.a.setAdVolume(a)};_.r.getPosition=function(){return this.f?this.f.getPlayheadTime():-1};_.r.dispose=function(){var a=this;return _.G(function(b){a.g.release();a.j&&(a.j.stop(),a.j=null);jN(a);a.a&&(a.a.dispose(),a.a=null);_.y(b)})};
|
|
19
|
+
_.r.Ok=function(a){var b=this;if(a.success)this.B=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL),this.o=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL),this.A=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL),this.m.trigger(new _.L(_.dc,{adsTimeline:new eN(this.a)})),this.j=new _.Cq(this.m.getSurface(),function(c,d){return b.a.resize(c,d)},this.m.cc($M).f);else this.m.onError(new _.N(1,9,10003,{errorType:0},
|
|
20
|
+
void 0));this.l.resolve()};_.r.Sk=function(a){mN(this,_.Mb,a);this.j.start()};_.r.Rk=function(a){this.f=null;a=a.slot;mN(this,_.Nb);this.j.stop();if(a)switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:kN(this);break;case tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL:jN(this);this.m.play();break;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:lN(this)}};
|
|
21
|
+
_.r.ik=function(a){var b=a.subType;this.h.debug("ad event",b);switch(b){case tv.freewheel.SDK.EVENT_AD_IMPRESSION:mN(this,_.$b,a);mN(this,_.Sb,a);break;case tv.freewheel.SDK.EVENT_AD_IMPRESSION_END:mN(this,_.ac,a);break;case tv.freewheel.SDK.EVENT_AD_FIRST_QUARTILE:mN(this,_.Rb,a);break;case tv.freewheel.SDK.EVENT_AD_MIDPOINT:mN(this,_.Ub,a);break;case tv.freewheel.SDK.EVENT_AD_THIRD_QUARTILE:mN(this,_.bc,a);break;case tv.freewheel.SDK.EVENT_AD_COMPLETE:mN(this,_.Qb,a);break;case tv.freewheel.SDK.EVENT_AD_CLICK:mN(this,
|
|
22
|
+
_.Pb,a);break;case tv.freewheel.SDK.EVENT_AD_PAUSE:mN(this,_.Vb,a);break;case tv.freewheel.SDK.EVENT_AD_RESUME:mN(this,_.Yb,a);break;case tv.freewheel.SDK.EVENT_AD_SKIPPED:mN(this,_.Zb,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_START:mN(this,_.Ob,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_END:mN(this,_.Xb,a);break;case tv.freewheel.SDK.EVENT_ERROR:this.m.onError(new _.N(1,9,10003,{errorType:1},{fwCode:a[tv.freewheel.SDK.INFO_KEY_ERROR_CODE],fwInfo:a[tv.freewheel.SDK.INFO_KEY_ERROR_INFO],
|
|
23
|
+
fwModule:a[tv.freewheel.SDK.INFO_KEY_ERROR_MODULE]}))}};_.r.oi=function(){var a=this;if(!this.f){var b=this.m.getPosition();if(this.f=this.o.find(function(d){return.5>Math.abs(b-d.getTimePosition())})||null){var c=this.o.findIndex(function(d){return d===a.f});this.o.splice(c,1);this.m.pause();iN(this);this.f.play()}}};
|
|
24
|
+
_.r.ni=function(a){if((a=a.detail)&&this.a)switch(a.currentState){case _.Xn:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PLAYING);break;case _.Wn:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PAUSED);break;case _.Qn:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_COMPLETED);lN(this);break;case _.Jn:case _.Un:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_STOPPED)}};fN.prototype.getPosition=fN.prototype.getPosition;fN.prototype.setVolume=fN.prototype.setVolume;
|
|
25
|
+
fN.prototype.getVolume=fN.prototype.getVolume;fN.prototype.skip=fN.prototype.skip;fN.prototype.pause=fN.prototype.pause;fN.prototype.resume=fN.prototype.resume;fN.prototype.start=fN.prototype.start;nN.prototype.name=function(){return ZM};nN.prototype.aa=function(a,b){return a.namespace()===_.Pc?!1:window.tv&&tv.freewheel&&tv.freewheel.SDK?!(!b||!b.freewheel):(this.a.warn("FreeWheel SDK is not loaded."),!1)};nN.prototype.create=function(a){return new fN(a)};nN.prototype.create=nN.prototype.create;nN.prototype.isSupported=nN.prototype.aa;nN.prototype.name=nN.prototype.name;_.qo(new nN);};
|
|
26
26
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
27
27
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
28
28
|
else{_=this.clpp._;(f.call(g,this));}
|