@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.
- package/CHANGELOG.md +35 -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 +110 -110
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +419 -416
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +72 -72
- package/cjs/cl.externs.js +26 -26
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +47 -47
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +31 -31
- package/cjs/cl.ima.js +22 -22
- package/cjs/cl.mse.js +258 -255
- package/cjs/cl.muxdata.js +12 -12
- 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 +69 -69
- 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 -18
- 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 +354 -351
- package/cl.crypto.js +8 -8
- package/cl.dash.js +66 -66
- package/cl.externs.js +26 -26
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +40 -39
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +25 -25
- package/cl.ima.js +16 -16
- package/cl.mse.js +230 -231
- package/cl.muxdata.js +8 -8
- 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 +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 +15 -14
- package/cl.vtt.js +12 -12
- package/cl.youbora.js +15 -16
- package/package.json +6 -2
package/cjs/cl.ima.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
null;a=this.w;var b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.o,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.
|
|
4
|
-
a.
|
|
5
|
-
a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.rc?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.k&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.k&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===_.rc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},
|
|
6
|
-
function(a){_.
|
|
7
|
-
c.a)return a.
|
|
8
|
-
_.t.getCreativeId=function(){return this.a.getCreativeId()};_.t.getApiFramework=function(){return this.a.getApiFramework()};_.t.getAdSystem=function(){return this.a.getAdSystem()};_.t.getAdvertiserName=function(){return this.a.getAdvertiserName()};_.t.getTitle=function(){return this.a.getTitle()};_.t.getDuration=function(){return this.a.getDuration()};_.t.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.t.
|
|
9
|
-
_.t.
|
|
10
|
-
_.t.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
_.t.
|
|
15
|
-
_.t.
|
|
16
|
-
_.t.
|
|
17
|
-
_.t.
|
|
18
|
-
_.t.load=function(){var a=this,b,c,d,e,f;return _.
|
|
19
|
-
_.t.start=function(a){var b=this;return _.
|
|
2
|
+
var f=function(window){var vI="clpp.ima.AdsManagerFactory",wI=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.h=b;this.g=c},xI=function(){},yI=function(a){this.a=a},zI=function(a){this.l=a;this.j=a.getSurface().getMedia();a=this.l.getConfiguration();this.L=_.K.Na(a.ima||{});this.m=this.l.bc("ima").Fc();this.K=this.l.bc("ima").g;this.o=this.l.bc("ima").a;this.I=new _.tp;this.R=new _.H("clpp.ima");this.h=this.a=null;this.f=new _.Nh;this.F=!1;this.w=new _.dg;this.T=new xI;this.A=null;this.J=this.D=this.N=this.B=!1;this.g=
|
|
3
|
+
null;a=this.w;var b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.o,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.Pi.bind(this));a.on(this.o,b,this.Oi.bind(this));a.one(this.j,_.fd,this.Wi.bind(this))},AI=function(a){var b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.LOADED,a.sh.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.Xi.bind(a));c.on(b,d.STARTED,a.uh.bind(a));c.on(b,d.LOG,a.Ii.bind(a));c.on(b,d.AD_PROGRESS,a.Mi.bind(a));c.on(b,d.AD_BUFFERING,a.Fi.bind(a));c.on(b,d.FIRST_QUARTILE,
|
|
4
|
+
a.qh.bind(a));c.on(b,d.MIDPOINT,a.Ji.bind(a));c.on(b,d.THIRD_QUARTILE,a.vh.bind(a));c.on(b,d.PAUSED,a.Li.bind(a));c.on(b,d.RESUMED,a.Ni.bind(a));c.on(b,d.CLICK,a.ph.bind(a));c.on(b,d.SKIPPED,a.th.bind(a));c.on(b,d.IMPRESSION,a.rh.bind(a));c.on(b,d.COMPLETE,a.Gi.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.Yi.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.Ri.bind(a))},BI=function(a){a=a.L;var b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.k&&(b.bitrate=
|
|
5
|
+
a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.rc?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.k&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.k&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===_.rc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},DI=function(a){a.A=null;CI(a,_.Tb);a.m&&a.l.getSurface().hide(a.m)},EI=
|
|
6
|
+
function(a){_.Bn(a.j,{visibility:"visible"})},CI=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new wI(c,a.B,a.N)});a.l.trigger(new _.J(b,d))},FI=function(a,b){var c=b?a.T.create(b.getErrorCode()):null;a.l.onError(new _.L(1,9,10003,{errorType:c},b))},HI=function(a){var b,c;return _.B(function(d){if(1==d.a)return a.K.initialize(),b=!!a.l.getConfiguration().muted,_.x(d,a.I.canPlay(b),2);c=d.f;if(!c)return CI(a,_.pc),a.R.warn(_.ma),d["return"]();GI(a);_.z(d)})},II=function(a,b){return _.B(function(c){if(1==
|
|
7
|
+
c.a)return a.K.initialize(),_.x(c,b.play(),2);GI(a);_.z(c)})},GI=function(a){a.a.init(a.j.offsetWidth,a.j.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();a.F=!0},JI=function(){this.a=this.g=this.f=null},KI=function(){return!window.google||!google.ima||!google.ima.AdsLoader},LI=function(){},MI=function(){this.a=new _.H(vI)};_.t=wI.prototype;_.t.sb=function(){return"Google IMA SDK"};_.t.tb=function(){return google.ima.VERSION};_.t.yb=function(){return 0};_.t.getId=function(){return this.a.getAdId()};
|
|
8
|
+
_.t.getCreativeId=function(){return this.a.getCreativeId()};_.t.getApiFramework=function(){return this.a.getApiFramework()};_.t.getAdSystem=function(){return this.a.getAdSystem()};_.t.getAdvertiserName=function(){return this.a.getAdvertiserName()};_.t.getTitle=function(){return this.a.getTitle()};_.t.getDuration=function(){return this.a.getDuration()};_.t.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.t.fc=function(){return this.f?this.f.getIsBumper():!1};
|
|
9
|
+
_.t.Kb=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Jd&&typeof b[d].clickThroughUrl===_.ue});c&&(a=b[c].clickThroughUrl);return a};_.t.getMediaUrl=function(){return this.a.getMediaUrl()};_.t.vb=function(){return this.a.getVastMediaWidth()};_.t.ub=function(){return this.a.getVastMediaHeight()};_.t.hb=function(){return this.a.getVastMediaBitrate()};_.t.Va=function(){return this.g?2:this.h?1:0};_.t.getPodIndex=function(){return this.f?this.f.getPodIndex():0};
|
|
10
|
+
_.t.Lb=function(){return this.f?this.f.getTimeOffset():0};_.t.Mb=function(){return this.f?this.f.getAdPosition():1};_.t.xb=function(){return this.f?this.f.getTotalAds():1};_.t.getWrapperAdIds=function(){return this.a.getWrapperAdIds()};_.t.getWrapperAdSystems=function(){return this.a.getWrapperAdSystems()};_.t.getWrapperCreativeIds=function(){return this.a.getWrapperCreativeIds()};wI.prototype.getWrapperCreativeIds=wI.prototype.getWrapperCreativeIds;wI.prototype.getWrapperAdSystems=wI.prototype.getWrapperAdSystems;
|
|
11
|
+
wI.prototype.getWrapperAdIds=wI.prototype.getWrapperAdIds;wI.prototype.getSequenceLength=wI.prototype.xb;wI.prototype.getPositionInSequence=wI.prototype.Mb;wI.prototype.getPodTimeOffset=wI.prototype.Lb;wI.prototype.getPodIndex=wI.prototype.getPodIndex;wI.prototype.getPodType=wI.prototype.Va;wI.prototype.getMediaBitrate=wI.prototype.hb;wI.prototype.getMediaHeight=wI.prototype.ub;wI.prototype.getMediaWidth=wI.prototype.vb;wI.prototype.getMediaUrl=wI.prototype.getMediaUrl;
|
|
12
|
+
wI.prototype.getClickThroughUrl=wI.prototype.Kb;wI.prototype.isBumper=wI.prototype.fc;wI.prototype.getSkipTimeOffset=wI.prototype.getSkipTimeOffset;wI.prototype.getDuration=wI.prototype.getDuration;wI.prototype.getTitle=wI.prototype.getTitle;wI.prototype.getAdvertiserName=wI.prototype.getAdvertiserName;wI.prototype.getAdSystem=wI.prototype.getAdSystem;wI.prototype.getApiFramework=wI.prototype.getApiFramework;wI.prototype.getCreativeId=wI.prototype.getCreativeId;wI.prototype.getId=wI.prototype.getId;
|
|
13
|
+
wI.prototype.getTechnology=wI.prototype.yb;wI.prototype.getAdManagerVersion=wI.prototype.tb;wI.prototype.getAdManagerName=wI.prototype.sb;xI.prototype.create=function(a){var b=google.ima.AdError.ErrorCode;switch(a){case b.VAST_LOAD_TIMEOUT:case b.VAST_MEDIA_LOAD_TIMEOUT:case b.FAILED_TO_REQUEST_ADS:return 0;case b.VIDEO_PLAY_ERROR:return 1;default:return 2}};yI.prototype.getCuePoints=function(){return this.a};yI.prototype.Nb=function(){return 0<=this.a.indexOf(0)||0===this.a.length};yI.prototype.ib=function(){return 0<=this.a.indexOf(-1)};yI.prototype.hasPostroll=yI.prototype.ib;yI.prototype.hasPreroll=yI.prototype.Nb;yI.prototype.getCuePoints=yI.prototype.getCuePoints;_.t=zI.prototype;
|
|
14
|
+
_.t.Pi=function(a){var b=this;this.a=a.getAdsManager(this.j,BI(this));this.a.isCustomPlaybackUsed()?(this.R.warn("IMA plugin does not work correctly right now on platforms with single video element. Disposing."),this.l.onError(new _.L(1,9,10002)),this.dispose()):(this.h=new _.rp(this.l.getSurface(),function(c,d,e){b.a.resize(c,d,e?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.g=new yI(a),this.l.trigger(new _.J(_.Wb,{adsTimeline:this.g})),AI(this));this.f.resolve()};
|
|
15
|
+
_.t.Oi=function(a){FI(this,a.getError());this.f.resolve()};_.t.Xi=function(a){var b=this;return _.B(function(c){if(1==c.a)return b.D=!0,_.x(c,b.l.pause(),2);_.Bn(b.j,{visibility:_.kd});CI(b,_.Fb,a);b.h.start();_.z(c)})};_.t.sh=function(a){a.getAd().isLinear()?CI(this,_.Mb,a):(this.a.discardAdBreak(),this.B||(this.B=!0,this.l.play()))};_.t.uh=function(a){this.A=a.getAd().getDuration();CI(this,_.Sb,a);this.l.getSurface().show(this.m)};_.t.Ii=function(a){a=a.getAdData();FI(this,a?a.adError:null);DI(this)};
|
|
16
|
+
_.t.Mi=function(a){CI(this,_.Pb,a)};_.t.Fi=function(a){CI(this,_.Hb,a)};_.t.qh=function(a){CI(this,_.Kb,a)};_.t.Ji=function(a){CI(this,_.Nb,a)};_.t.vh=function(a){CI(this,_.Ub,a)};_.t.Li=function(a){CI(this,_.Ob,a)};_.t.Ni=function(a){CI(this,_.Qb,a)};_.t.ph=function(a){this.pause();CI(this,_.Ib,a)};_.t.th=function(a){CI(this,_.Rb,a);DI(this)};_.t.rh=function(a){CI(this,_.Lb,a)};_.t.Gi=function(a){CI(this,_.Jb,a);DI(this)};
|
|
17
|
+
_.t.Yi=function(){this.B=!0;if(!this.D)return this.l.play();this.D=!1;this.h.stop();this.l.isEnded()||this.l.play();CI(this,_.Gb);EI(this)};_.t.Ri=function(){this.J=!0};_.t.Wi=function(){this.N=!0;this.o.contentComplete()};
|
|
18
|
+
_.t.load=function(){var a=this,b,c,d,e,f;return _.B(function(g){if(1==g.a){b=a.l;c=a.L;try{if(typeof c.adTagUrl!==_.ue)throw new _.L(1,9,10001,{missingKeys:"adTagUrl"});}catch(h){return b.onError(h),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.x(g,a.I.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.x(g,a.I.canPlay(!0),3);e=g.f;f=new google.ima.AdsRequest;f.adTagUrl=c.adTagUrl;f.setAdWillAutoPlay(d);f.setAdWillPlayMuted(e);a.o.requestAds(f);return g["return"](a.f)})};
|
|
19
|
+
_.t.start=function(a){var b=this;return _.B(function(c){return b.a&&b.g&&!b.F?b.g.Nb()?_.x(c,HI(b),0):_.x(c,II(b,a),0):_.x(c,a.play(),0)})};_.t.resume=function(){this.a&&this.a.resume()};_.t.pause=function(){this.a&&this.a.pause()};_.t.skip=function(){this.a&&this.a.skip()};_.t.getVolume=function(){return this.a?this.a.getVolume():1};_.t.setVolume=function(a){this.a&&this.a.setVolume(a)};
|
|
20
20
|
_.t.getPosition=function(){if(!this.a||null===this.A)return-1;var a=this.a.getRemainingTime();return 0>a?0:this.A-a};
|
|
21
|
-
_.t.dispose=function(){var a=this;return(new Promise(function(b){a.
|
|
22
|
-
|
|
23
|
-
_.t.onPlayerWillDestroy=function(a){this.a&&(this.a.destroy(),this.a=null);this.g&&(this.g.destroy(),this.g=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)};_.t.
|
|
24
|
-
|
|
21
|
+
_.t.dispose=function(){var a=this;return(new Promise(function(b){a.F&&a.g&&a.g.ib()&&!a.J?(a.w.one(a.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,function(){b();a.m&&a.l.getSurface().hide(a.m)}),_.eg(a.w,a.a,[google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.STARTED],function(){a.a&&a.a.discardAdBreak()})):b();a.a.discardAdBreak();a.o.contentComplete()})).then(function(){EI(a);a.w.release();a.h&&(a.h.stop(),a.h=null);a.a&&(a.a.destroy(),a.a=null)})};zI.prototype.getPosition=zI.prototype.getPosition;
|
|
22
|
+
zI.prototype.setVolume=zI.prototype.setVolume;zI.prototype.getVolume=zI.prototype.getVolume;zI.prototype.skip=zI.prototype.skip;zI.prototype.pause=zI.prototype.pause;zI.prototype.resume=zI.prototype.resume;_.v(JI,_.eq);_.t=JI.prototype;_.t.onPlayerCreated=function(a){if(KI())return a.onError(new _.L(1,9,1E4));this.f=_.zn(_.Wc,{"class":"clpp-ima clpp-hidden"});a.getSurface().addElementToContainer(this.f);this.g=new google.ima.AdDisplayContainer(this.f,a.getSurface().getMedia());this.a=new google.ima.AdsLoader(this.g);this.a.getSettings().setPlayerType(_.ta);this.a.getSettings().setPlayerVersion(_.ea);this.a.getSettings().setAutoPlayAdBreaks(!0)};
|
|
23
|
+
_.t.onPlayerWillDestroy=function(a){this.a&&(this.a.destroy(),this.a=null);this.g&&(this.g.destroy(),this.g=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)};_.t.gi=function(){return this.a};_.t.ei=function(){return this.g};_.t.Fc=function(){return this.f};_.t.id=function(){return"ima"};_.C("clpp.ima.ImaPlugin",JI);JI.prototype.getAdContainer=JI.prototype.Fc;JI.prototype.getAdDisplayContainer=JI.prototype.ei;JI.prototype.getAdsLoader=JI.prototype.gi;JI.Id="ima";
|
|
24
|
+
JI.isSdkMissing=KI;LI.prototype.create=function(){return new JI};_.wo(new LI);MI.prototype.name=function(){return vI};MI.prototype.ca=function(a,b){return a.namespace()===_.Gc?!1:KI()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};MI.prototype.create=function(a){return new zI(a)};MI.prototype.create=MI.prototype.create;MI.prototype.isSupported=MI.prototype.ca;MI.prototype.name=MI.prototype.name;_.wn(new MI);};
|
|
25
25
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
26
26
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
27
27
|
else{_=this.clpp._;(f.call(g,this));}
|