@castlabs/prestoplay 6.4.0 → 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.
Files changed (58) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +6 -6
  5. package/cjs/cl.cast.js +110 -110
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +421 -402
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +72 -72
  10. package/cjs/cl.externs.js +54 -133
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +47 -49
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +31 -32
  15. package/cjs/cl.ima.js +22 -22
  16. package/cjs/cl.mse.js +258 -255
  17. package/cjs/cl.muxdata.js +12 -12
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +14 -14
  20. package/cjs/cl.playlist.js +6 -6
  21. package/cjs/cl.smooth.js +69 -69
  22. package/cjs/cl.thumbnails.js +24 -24
  23. package/cjs/cl.tizen.js +71 -71
  24. package/cjs/cl.ttml.js +27 -27
  25. package/cjs/cl.verimatrix.js +5 -5
  26. package/cjs/cl.vimond.js +13 -13
  27. package/cjs/cl.vr.js +19 -18
  28. package/cjs/cl.vtt.js +14 -14
  29. package/cjs/cl.youbora.js +20 -20
  30. package/cl.adobe.js +3 -3
  31. package/cl.airplay.js +3 -3
  32. package/cl.broadpeak.js +5 -5
  33. package/cl.cast.js +88 -88
  34. package/cl.conviva.js +27 -27
  35. package/cl.core.js +363 -351
  36. package/cl.crypto.js +8 -8
  37. package/cl.dash.js +67 -67
  38. package/cl.externs.js +49 -132
  39. package/cl.freewheel.js +19 -19
  40. package/cl.hls.js +40 -40
  41. package/cl.hlssmpte.js +5 -5
  42. package/cl.htmlcue.js +25 -25
  43. package/cl.ima.js +16 -16
  44. package/cl.mse.js +230 -231
  45. package/cl.muxdata.js +8 -8
  46. package/cl.onboard.js +4 -4
  47. package/cl.persistent.js +9 -9
  48. package/cl.playlist.js +5 -5
  49. package/cl.smooth.js +58 -58
  50. package/cl.thumbnails.js +17 -17
  51. package/cl.tizen.js +57 -57
  52. package/cl.ttml.js +22 -22
  53. package/cl.verimatrix.js +4 -4
  54. package/cl.vimond.js +8 -8
  55. package/cl.vr.js +15 -14
  56. package/cl.vtt.js +12 -12
  57. package/cl.youbora.js +15 -16
  58. package/package.json +8 -2
package/cl.ima.js CHANGED
@@ -1,16 +1,16 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var wG="clpp.ima.AdsManagerFactory",xG=function(a){a=a.J;const b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.p&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.cc?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.p&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.p&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===
2
- _.cc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},yG=function(a){const b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.LOADED,a.T.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.hc.bind(a));c.on(b,d.STARTED,a.W.bind(a));c.on(b,d.LOG,a.za.bind(a));c.on(b,d.AD_PROGRESS,a.Xa.bind(a));c.on(b,d.AD_BUFFERING,a.ha.bind(a));c.on(b,d.FIRST_QUARTILE,a.R.bind(a));c.on(b,d.MIDPOINT,a.Va.bind(a));c.on(b,d.THIRD_QUARTILE,a.$.bind(a));c.on(b,d.PAUSED,
3
- a.Wa.bind(a));c.on(b,d.RESUMED,a.Ya.bind(a));c.on(b,d.CLICK,a.N.bind(a));c.on(b,d.SKIPPED,a.V.bind(a));c.on(b,d.IMPRESSION,a.S.bind(a));c.on(b,d.COMPLETE,a.sa.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.kc.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.Mb.bind(a))},zG=function(a,b){const c=b?a.aa.create(b.getErrorCode()):null;a.l.onError(new _.G(1,9,10003,{errorType:c},b))},AG=function(a,b,c){c=c&&c.getAd();let d=null;c&&(d={ad:new V(c,a.B,a.K)});a.l.trigger(new _.C(b,d))},BG=function(a){a.A=null;AG(a,_.Eb);
4
- a.m&&a.l.getSurface().hide(a.m)},CG=function(a){_.Gl(a.j,{visibility:"visible"})},EG=function(a){return _.w(function*(){a.I.initialize();const b=!!a.l.getConfiguration().muted;(yield a.F.canPlay(b))?DG(a):(AG(a,_.ac),a.M.warn(_.ja))})},FG=function(a,b){return _.w(function*(){a.I.initialize();yield b.play();DG(a)})},DG=function(a){a.a.init(a.j.offsetWidth,a.j.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();a.D=!0},GG=function(){return!window.google||!google.ima||!google.ima.AdsLoader},V=class{constructor(a,
5
- b,c){this.a=a;this.f=a.getAdPodInfo();this.h=b;this.g=c}mb(){return"Google IMA SDK"}nb(){return google.ima.VERSION}sb(){return 0}getId(){return this.a.getAdId()}getCreativeId(){return this.a.getCreativeId()}getApiFramework(){return this.a.getApiFramework()}getAdSystem(){return this.a.getAdSystem()}getAdvertiserName(){return this.a.getAdvertiserName()}getTitle(){return this.a.getTitle()}getDuration(){return this.a.getDuration()}getSkipTimeOffset(){return this.a.getSkipTimeOffset()}Vb(){return this.f?
6
- this.f.getIsBumper():!1}Bb(){let a=null;const b=this.a,c=Object.keys(b).find(d=>typeof b[d]===_.xd&&typeof b[d].clickThroughUrl===_.je);c&&(a=b[c].clickThroughUrl);return a}getMediaUrl(){return this.a.getMediaUrl()}pb(){return this.a.getVastMediaWidth()}ob(){return this.a.getVastMediaHeight()}cb(){return this.a.getVastMediaBitrate()}Oa(){return this.g?2:this.h?1:0}getPodIndex(){return this.f?this.f.getPodIndex():0}Cb(){return this.f?this.f.getTimeOffset():0}Db(){return this.f?this.f.getAdPosition():
7
- 1}rb(){return this.f?this.f.getTotalAds():1}getWrapperAdIds(){return this.a.getWrapperAdIds()}getWrapperAdSystems(){return this.a.getWrapperAdSystems()}getWrapperCreativeIds(){return this.a.getWrapperCreativeIds()}};V.prototype.getWrapperCreativeIds=V.prototype.getWrapperCreativeIds;V.prototype.getWrapperAdSystems=V.prototype.getWrapperAdSystems;V.prototype.getWrapperAdIds=V.prototype.getWrapperAdIds;V.prototype.getSequenceLength=V.prototype.rb;V.prototype.getPositionInSequence=V.prototype.Db;
8
- V.prototype.getPodTimeOffset=V.prototype.Cb;V.prototype.getPodIndex=V.prototype.getPodIndex;V.prototype.getPodType=V.prototype.Oa;V.prototype.getMediaBitrate=V.prototype.cb;V.prototype.getMediaHeight=V.prototype.ob;V.prototype.getMediaWidth=V.prototype.pb;V.prototype.getMediaUrl=V.prototype.getMediaUrl;V.prototype.getClickThroughUrl=V.prototype.Bb;V.prototype.isBumper=V.prototype.Vb;V.prototype.getSkipTimeOffset=V.prototype.getSkipTimeOffset;V.prototype.getDuration=V.prototype.getDuration;
9
- V.prototype.getTitle=V.prototype.getTitle;V.prototype.getAdvertiserName=V.prototype.getAdvertiserName;V.prototype.getAdSystem=V.prototype.getAdSystem;V.prototype.getApiFramework=V.prototype.getApiFramework;V.prototype.getCreativeId=V.prototype.getCreativeId;V.prototype.getId=V.prototype.getId;V.prototype.getTechnology=V.prototype.sb;V.prototype.getAdManagerVersion=V.prototype.nb;V.prototype.getAdManagerName=V.prototype.mb;var HG=class{create(a){const 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}}};var IG=class{constructor(a){this.a=a}getCuePoints(){return this.a}Eb(){return 0<=this.a.indexOf(0)||0===this.a.length}eb(){return 0<=this.a.indexOf(-1)}};IG.prototype.hasPostroll=IG.prototype.eb;IG.prototype.hasPreroll=IG.prototype.Eb;IG.prototype.getCuePoints=IG.prototype.getCuePoints;var JG=class{constructor(a){this.l=a;this.j=a.getSurface().getMedia();a=this.l.getConfiguration();this.J=a=_.ff(a.ima||{});this.m=this.l.Rb("ima").lc();this.I=this.l.Rb("ima").g;this.o=this.l.Rb("ima").a;this.F=new _.xp;this.M=new _.N("clpp.ima");this.h=this.a=null;this.f=new _.mk;this.D=!1;this.w=new _.Nn;this.aa=new HG;this.A=null;this.H=this.C=this.K=this.B=!1;this.g=null;{a=this.w;const b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.o,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
10
- this.Lb.bind(this));a.on(this.o,b,this.yb.bind(this));a.one(this.j,_.Sc,this.ec.bind(this))}}Lb(a){this.a=a.getAdsManager(this.j,xG(this));this.a.isCustomPlaybackUsed()?(this.M.warn("IMA plugin does not work correctly right now on platforms with single video element. Disposing."),this.l.onError(new _.G(1,9,10002)),this.dispose()):(this.h=new _.vp(this.l.getSurface(),(b,c,d)=>{this.a.resize(b,c,d?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.g=new IG(a),
11
- this.l.trigger(new _.C(_.Hb,{adsTimeline:this.g})),yG(this));this.f.resolve()}yb(a){zG(this,a.getError());this.f.resolve()}hc(a){const b=this;return _.w(function*(){b.C=!0;yield b.l.pause();_.Gl(b.j,{visibility:_.Xc});AG(b,_.qb,a);b.h.start()})}T(a){a.getAd().isLinear()?AG(this,_.xb,a):(this.a.discardAdBreak(),this.B||(this.B=!0,this.l.play()))}W(a){this.A=a.getAd().getDuration();AG(this,_.Db,a);this.l.getSurface().show(this.m)}za(a){a=a.getAdData();zG(this,a?a.adError:null);BG(this)}Xa(a){AG(this,
12
- _.Ab,a)}ha(a){AG(this,_.sb,a)}R(a){AG(this,_.vb,a)}Va(a){AG(this,_.yb,a)}$(a){AG(this,_.Fb,a)}Wa(a){AG(this,_.zb,a)}Ya(a){AG(this,_.Bb,a)}N(a){this.pause();AG(this,_.tb,a)}V(a){AG(this,_.Cb,a);BG(this)}S(a){AG(this,_.wb,a)}sa(a){AG(this,_.ub,a);BG(this)}kc(){this.B=!0;if(!this.C)return this.l.play();this.C=!1;this.h.stop();this.l.isEnded()||this.l.play();AG(this,_.rb);CG(this)}Mb(){this.H=!0}ec(){this.K=!0;this.o.contentComplete()}load(){const a=this;return _.w(function*(){var b=a.l;const c=a.J;try{if(typeof c.adTagUrl!==
13
- _.je)throw new _.G(1,9,10001,{missingKeys:"adTagUrl"});}catch(f){return b.onError(f),a.f.resolve(),a.f}if(!c.adTagUrl)return a.f.resolve(),a.f;b=yield a.F.canPlay(!1);const d=yield a.F.canPlay(!0),e=new google.ima.AdsRequest;e.adTagUrl=c.adTagUrl;e.setAdWillAutoPlay(b);e.setAdWillPlayMuted(d);a.o.requestAds(e);return a.f})}start(a){const b=this;return _.w(function*(){b.a&&b.g&&!b.D?b.g.Eb()?yield EG(b):yield FG(b,a):yield a.play()})}resume(){this.a&&this.a.resume()}pause(){this.a&&this.a.pause()}skip(){this.a&&
14
- this.a.skip()}getVolume(){return this.a?this.a.getVolume():1}setVolume(a){this.a&&this.a.setVolume(a)}getPosition(){if(!this.a||null===this.A)return-1;const a=this.a.getRemainingTime();return 0>a?0:this.A-a}dispose(){return(new Promise(a=>{this.D&&this.g&&this.g.eb()&&!this.H?(this.w.one(this.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,()=>{a();this.m&&this.l.getSurface().hide(this.m)}),_.Lf(this.w,this.a,[google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.STARTED],()=>{this.a&&this.a.discardAdBreak()})):
15
- a();this.a.discardAdBreak();this.o.contentComplete()})).then(()=>{CG(this);this.w.release();this.h&&(this.h.stop(),this.h=null);this.a&&(this.a.destroy(),this.a=null)})}};JG.prototype.getPosition=JG.prototype.getPosition;JG.prototype.setVolume=JG.prototype.setVolume;JG.prototype.getVolume=JG.prototype.getVolume;JG.prototype.skip=JG.prototype.skip;JG.prototype.pause=JG.prototype.pause;JG.prototype.resume=JG.prototype.resume;var KG=class extends _.Ep{constructor(){super();this.a=this.g=this.f=null}onPlayerCreated(a){if(GG())return a.onError(new _.G(1,9,1E4));this.f=_.El(_.Jc,{"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(_.na);this.a.getSettings().setPlayerVersion(_.da);this.a.getSettings().setAutoPlayAdBreaks(!0)}onPlayerWillDestroy(a){this.a&&
16
- (this.a.destroy(),this.a=null);this.g&&(this.g.destroy(),this.g=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)}kf(){return this.a}hf(){return this.g}lc(){return this.f}id(){return"ima"}};_.y("clpp.ima.ImaPlugin",KG);KG.prototype.getAdContainer=KG.prototype.lc;KG.prototype.getAdDisplayContainer=KG.prototype.hf;KG.prototype.getAdsLoader=KG.prototype.kf;KG.Id="ima";KG.isSdkMissing=GG;_.km(new class{create(){return new KG}});var LG=class{constructor(){this.a=new _.N(wG)}name(){return wG}Y(a,b){return a.namespace()===_.tc?!1:GG()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new JG(a)}};LG.prototype.create=LG.prototype.create;LG.prototype.isSupported=LG.prototype.Y;LG.prototype.name=LG.prototype.name;_.Bl(new LG);};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var RG="clpp.ima.AdsManagerFactory",SG=function(a){a=a.K;const b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.p&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.fc?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.p&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.p&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===
2
+ _.fc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},TG=function(a){const b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.LOADED,a.V.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.jc.bind(a));c.on(b,d.STARTED,a.X.bind(a));c.on(b,d.LOG,a.Ia.bind(a));c.on(b,d.AD_PROGRESS,a.Ya.bind(a));c.on(b,d.AD_BUFFERING,a.ea.bind(a));c.on(b,d.FIRST_QUARTILE,a.S.bind(a));c.on(b,d.MIDPOINT,a.Wa.bind(a));c.on(b,d.THIRD_QUARTILE,a.$.bind(a));c.on(b,d.PAUSED,
3
+ a.Xa.bind(a));c.on(b,d.RESUMED,a.Za.bind(a));c.on(b,d.CLICK,a.O.bind(a));c.on(b,d.SKIPPED,a.W.bind(a));c.on(b,d.IMPRESSION,a.T.bind(a));c.on(b,d.COMPLETE,a.ja.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.mc.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.Pb.bind(a))},UG=function(a,b){const c=b?a.ca.create(b.getErrorCode()):null;a.l.onError(new _.H(1,9,10003,{errorType:c},b))},VG=function(a,b,c){c=c&&c.getAd();let d=null;c&&(d={ad:new V(c,a.B,a.L)});a.l.trigger(new _.C(b,d))},WG=function(a){a.A=null;VG(a,_.Ib);
4
+ a.m&&a.l.getSurface().hide(a.m)},XG=function(a){_.im(a.j,{visibility:"visible"})},ZG=function(a){return _.w(function*(){a.J.initialize();const b=!!a.l.getConfiguration().muted;(yield a.G.canPlay(b))?YG(a):(VG(a,_.dc),a.M.warn(_.ia))})},$G=function(a,b){return _.w(function*(){a.J.initialize();yield b.play();YG(a)})},YG=function(a){a.a.init(a.j.offsetWidth,a.j.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();a.F=!0},aH=function(){return!window.google||!google.ima||!google.ima.AdsLoader},V=class{constructor(a,
5
+ b,c){this.a=a;this.f=a.getAdPodInfo();this.h=b;this.g=c}nb(){return"Google IMA SDK"}ob(){return google.ima.VERSION}tb(){return 0}getId(){return this.a.getAdId()}getCreativeId(){return this.a.getCreativeId()}getApiFramework(){return this.a.getApiFramework()}getAdSystem(){return this.a.getAdSystem()}getAdvertiserName(){return this.a.getAdvertiserName()}getTitle(){return this.a.getTitle()}getDuration(){return this.a.getDuration()}getSkipTimeOffset(){return this.a.getSkipTimeOffset()}Zb(){return this.f?
6
+ this.f.getIsBumper():!1}Eb(){let a=null;const b=this.a,c=Object.keys(b).find(d=>typeof b[d]===_.Bd&&typeof b[d].clickThroughUrl===_.me);c&&(a=b[c].clickThroughUrl);return a}getMediaUrl(){return this.a.getMediaUrl()}qb(){return this.a.getVastMediaWidth()}pb(){return this.a.getVastMediaHeight()}eb(){return this.a.getVastMediaBitrate()}Pa(){return this.g?2:this.h?1:0}getPodIndex(){return this.f?this.f.getPodIndex():0}Fb(){return this.f?this.f.getTimeOffset():0}Gb(){return this.f?this.f.getAdPosition():
7
+ 1}sb(){return this.f?this.f.getTotalAds():1}getWrapperAdIds(){return this.a.getWrapperAdIds()}getWrapperAdSystems(){return this.a.getWrapperAdSystems()}getWrapperCreativeIds(){return this.a.getWrapperCreativeIds()}};V.prototype.getWrapperCreativeIds=V.prototype.getWrapperCreativeIds;V.prototype.getWrapperAdSystems=V.prototype.getWrapperAdSystems;V.prototype.getWrapperAdIds=V.prototype.getWrapperAdIds;V.prototype.getSequenceLength=V.prototype.sb;V.prototype.getPositionInSequence=V.prototype.Gb;
8
+ V.prototype.getPodTimeOffset=V.prototype.Fb;V.prototype.getPodIndex=V.prototype.getPodIndex;V.prototype.getPodType=V.prototype.Pa;V.prototype.getMediaBitrate=V.prototype.eb;V.prototype.getMediaHeight=V.prototype.pb;V.prototype.getMediaWidth=V.prototype.qb;V.prototype.getMediaUrl=V.prototype.getMediaUrl;V.prototype.getClickThroughUrl=V.prototype.Eb;V.prototype.isBumper=V.prototype.Zb;V.prototype.getSkipTimeOffset=V.prototype.getSkipTimeOffset;V.prototype.getDuration=V.prototype.getDuration;
9
+ V.prototype.getTitle=V.prototype.getTitle;V.prototype.getAdvertiserName=V.prototype.getAdvertiserName;V.prototype.getAdSystem=V.prototype.getAdSystem;V.prototype.getApiFramework=V.prototype.getApiFramework;V.prototype.getCreativeId=V.prototype.getCreativeId;V.prototype.getId=V.prototype.getId;V.prototype.getTechnology=V.prototype.tb;V.prototype.getAdManagerVersion=V.prototype.ob;V.prototype.getAdManagerName=V.prototype.nb;var bH=class{create(a){const 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}}};var cH=class{constructor(a){this.a=a}getCuePoints(){return this.a}Hb(){return 0<=this.a.indexOf(0)||0===this.a.length}fb(){return 0<=this.a.indexOf(-1)}};cH.prototype.hasPostroll=cH.prototype.fb;cH.prototype.hasPreroll=cH.prototype.Hb;cH.prototype.getCuePoints=cH.prototype.getCuePoints;var dH=class{constructor(a){this.l=a;this.j=a.getSurface().getMedia();a=this.l.getConfiguration();this.K=a=_.jf(a.ima||{});this.m=this.l.Vb("ima").nc();this.J=this.l.Vb("ima").g;this.o=this.l.Vb("ima").a;this.G=new _.Xp;this.M=new _.O("clpp.ima");this.h=this.a=null;this.f=new _.Sk;this.F=!1;this.w=new _.po;this.ca=new bH;this.A=null;this.I=this.C=this.L=this.B=!1;this.g=null;{a=this.w;const b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.o,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
10
+ this.Ob.bind(this));a.on(this.o,b,this.Bb.bind(this));a.one(this.j,_.Wc,this.Qb.bind(this))}}Ob(a){this.a=a.getAdsManager(this.j,SG(this));this.a.isCustomPlaybackUsed()?(this.M.warn("IMA plugin does not work correctly right now on platforms with single video element. Disposing."),this.l.onError(new _.H(1,9,10002)),this.dispose()):(this.h=new _.Vp(this.l.getSurface(),(b,c,d)=>{this.a.resize(b,c,d?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.g=new cH(a),
11
+ this.l.trigger(new _.C(_.Lb,{adsTimeline:this.g})),TG(this));this.f.resolve()}Bb(a){UG(this,a.getError());this.f.resolve()}jc(a){const b=this;return _.w(function*(){b.C=!0;yield b.l.pause();_.im(b.j,{visibility:_.ad});VG(b,_.ub,a);b.h.start()})}V(a){a.getAd().isLinear()?VG(this,_.Bb,a):(this.a.discardAdBreak(),this.B||(this.B=!0,this.l.play()))}X(a){this.A=a.getAd().getDuration();VG(this,_.Hb,a);this.l.getSurface().show(this.m)}Ia(a){a=a.getAdData();UG(this,a?a.adError:null);WG(this)}Ya(a){VG(this,
12
+ _.Eb,a)}ea(a){VG(this,_.wb,a)}S(a){VG(this,_.zb,a)}Wa(a){VG(this,_.Cb,a)}$(a){VG(this,_.Jb,a)}Xa(a){VG(this,_.Db,a)}Za(a){VG(this,_.Fb,a)}O(a){this.pause();VG(this,_.xb,a)}W(a){VG(this,_.Gb,a);WG(this)}T(a){VG(this,_.Ab,a)}ja(a){VG(this,_.yb,a);WG(this)}mc(){this.B=!0;if(!this.C)return this.l.play();this.C=!1;this.h.stop();this.l.isEnded()||this.l.play();VG(this,_.vb);XG(this)}Pb(){this.I=!0}Qb(){this.L=!0;this.o.contentComplete()}load(){const a=this;return _.w(function*(){var b=a.l;const c=a.K;try{if(typeof c.adTagUrl!==
13
+ _.me)throw new _.H(1,9,10001,{missingKeys:"adTagUrl"});}catch(f){return b.onError(f),a.f.resolve(),a.f}if(!c.adTagUrl)return a.f.resolve(),a.f;b=yield a.G.canPlay(!1);const d=yield a.G.canPlay(!0),e=new google.ima.AdsRequest;e.adTagUrl=c.adTagUrl;e.setAdWillAutoPlay(b);e.setAdWillPlayMuted(d);a.o.requestAds(e);return a.f})}start(a){const b=this;return _.w(function*(){b.a&&b.g&&!b.F?b.g.Hb()?yield ZG(b):yield $G(b,a):yield a.play()})}resume(){this.a&&this.a.resume()}pause(){this.a&&this.a.pause()}skip(){this.a&&
14
+ this.a.skip()}getVolume(){return this.a?this.a.getVolume():1}setVolume(a){this.a&&this.a.setVolume(a)}getPosition(){if(!this.a||null===this.A)return-1;const a=this.a.getRemainingTime();return 0>a?0:this.A-a}dispose(){return(new Promise(a=>{this.F&&this.g&&this.g.fb()&&!this.I?(this.w.one(this.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,()=>{a();this.m&&this.l.getSurface().hide(this.m)}),_.Pf(this.w,this.a,[google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.STARTED],()=>{this.a&&this.a.discardAdBreak()})):
15
+ a();this.a.discardAdBreak();this.o.contentComplete()})).then(()=>{XG(this);this.w.release();this.h&&(this.h.stop(),this.h=null);this.a&&(this.a.destroy(),this.a=null)})}};dH.prototype.getPosition=dH.prototype.getPosition;dH.prototype.setVolume=dH.prototype.setVolume;dH.prototype.getVolume=dH.prototype.getVolume;dH.prototype.skip=dH.prototype.skip;dH.prototype.pause=dH.prototype.pause;dH.prototype.resume=dH.prototype.resume;var eH=class extends _.bq{constructor(){super();this.a=this.g=this.f=null}onPlayerCreated(a){if(aH())return a.onError(new _.H(1,9,1E4));this.f=_.gm(_.Nc,{"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(_.pa);this.a.getSettings().setPlayerVersion(_.da);this.a.getSettings().setAutoPlayAdBreaks(!0)}onPlayerWillDestroy(a){this.a&&
16
+ (this.a.destroy(),this.a=null);this.g&&(this.g.destroy(),this.g=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)}rf(){return this.a}pf(){return this.g}nc(){return this.f}id(){return"ima"}};_.x("clpp.ima.ImaPlugin",eH);eH.prototype.getAdContainer=eH.prototype.nc;eH.prototype.getAdDisplayContainer=eH.prototype.pf;eH.prototype.getAdsLoader=eH.prototype.rf;eH.Id="ima";eH.isSdkMissing=aH;_.Nm(new class{create(){return new eH}});var fH=class{constructor(){this.a=new _.O(RG)}name(){return RG}ba(a,b){return a.namespace()===_.xc?!1:aH()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new dH(a)}};fH.prototype.create=fH.prototype.create;fH.prototype.isSupported=fH.prototype.ba;fH.prototype.name=fH.prototype.name;_.dm(new fH);};f.call(g, window);