@castlabs/prestoplay 6.17.0 → 6.17.1

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 (63) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +7 -7
  5. package/cjs/cl.cast.js +98 -98
  6. package/cjs/cl.conviva.js +31 -31
  7. package/cjs/cl.core.js +372 -369
  8. package/cjs/cl.crypto.js +8 -8
  9. package/cjs/cl.dash.js +71 -71
  10. package/cjs/cl.externs.js +1 -1
  11. package/cjs/cl.freewheel.js +21 -21
  12. package/cjs/cl.hls.js +67 -67
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +29 -29
  15. package/cjs/cl.ima.js +22 -22
  16. package/cjs/cl.mse.js +302 -302
  17. package/cjs/cl.muxdata.js +14 -14
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +13 -13
  20. package/cjs/cl.playlist.js +6 -6
  21. package/cjs/cl.sessions.js +15 -15
  22. package/cjs/cl.simid.js +15 -15
  23. package/cjs/cl.smooth.js +71 -71
  24. package/cjs/cl.thumbnails.js +26 -26
  25. package/cjs/cl.tizen.js +64 -64
  26. package/cjs/cl.ttml.js +28 -28
  27. package/cjs/cl.verimatrix.js +5 -5
  28. package/cjs/cl.vimond.js +9 -9
  29. package/cjs/cl.vr.js +18 -18
  30. package/cjs/cl.vtt.js +14 -14
  31. package/cjs/cl.youbora.js +14 -14
  32. package/cl.adobe.js +3 -3
  33. package/cl.airplay.js +3 -3
  34. package/cl.broadpeak.js +5 -5
  35. package/cl.cast.js +83 -83
  36. package/cl.conviva.js +26 -26
  37. package/cl.core.js +324 -323
  38. package/cl.crypto.js +8 -8
  39. package/cl.dash.js +69 -69
  40. package/cl.externs.js +1 -1
  41. package/cl.freewheel.js +15 -15
  42. package/cl.hls.js +72 -72
  43. package/cl.hlssmpte.js +5 -5
  44. package/cl.htmlcue.js +26 -26
  45. package/cl.ima.js +15 -15
  46. package/cl.mse.js +267 -268
  47. package/cl.muxdata.js +11 -11
  48. package/cl.onboard.js +4 -4
  49. package/cl.persistent.js +10 -10
  50. package/cl.playlist.js +5 -5
  51. package/cl.sessions.js +10 -10
  52. package/cl.simid.js +13 -13
  53. package/cl.smooth.js +59 -59
  54. package/cl.thumbnails.js +19 -19
  55. package/cl.tizen.js +54 -54
  56. package/cl.ttml.js +22 -22
  57. package/cl.verimatrix.js +4 -4
  58. package/cl.vimond.js +6 -6
  59. package/cl.vr.js +14 -14
  60. package/cl.vtt.js +11 -11
  61. package/cl.youbora.js +12 -12
  62. package/package.json +1 -1
  63. package/typings.d.ts +3 -2
package/cl.ima.js CHANGED
@@ -1,17 +1,17 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var iQ="clpp.ima.AdsManagerFactory",jQ=function(a){a=a.I;const b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.t&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.Pc?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.t&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.t&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===
2
- _.Pc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},kQ=function(a){return!1===a.I.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.Uj()},lQ=function(a){const b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.da.bind(a));c.on(b,d.LOADED,a.W.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.Zb.bind(a));c.on(b,d.STARTED,a.Y.bind(a));c.on(b,d.LOG,a.Ja.bind(a));c.on(b,d.AD_PROGRESS,a.Sa.bind(a));c.on(b,d.AD_BUFFERING,a.ja.bind(a));
3
- c.on(b,d.FIRST_QUARTILE,a.S.bind(a));c.on(b,d.MIDPOINT,a.Ka.bind(a));c.on(b,d.THIRD_QUARTILE,a.aa.bind(a));c.on(b,d.PAUSED,a.La.bind(a));c.on(b,d.RESUMED,a.ib.bind(a));c.on(b,d.CLICK,a.R.bind(a));c.on(b,d.SKIPPED,a.X.bind(a));c.on(b,d.IMPRESSION,a.T.bind(a));c.on(b,d.COMPLETE,a.Ia.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.ac.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.Wb.bind(a))},mQ=function(a,b){const c=b?a.ea.create(b.getErrorCode()):null;a.m.onError(new _.H(1,9,10003,{errorType:c},b))},nQ=function(a,
4
- b,c){c=c&&c.getAd();let d=null;c&&(d={ad:new X(c,a.F,a.C)});a.m.trigger(new _.E(b,d))},oQ=function(a){a.B=null;nQ(a,_.rc);a.o&&a.m.getSurface().hide(a.o)},pQ=function(a){_.to(a.A,{visibility:"visible"})},rQ=function(a){return _.x(function*(){a.N.initialize();const b=!!a.m.getConfiguration().muted;(yield a.K.canPlay(b))||kQ(a)?qQ(a):(nQ(a,_.Mc),a.h.warn(_.ka))})},sQ=function(a,b){return _.x(function*(){a.N.initialize();yield b.play();qQ(a)})},qQ=function(a){a.a.init(a.A.offsetWidth,a.A.offsetHeight,
5
- google.ima.ViewMode.NORMAL);a.a.start();a.H=!0},tQ=function(){return!window.google||!google.ima||!google.ima.AdsLoader},X=class{constructor(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.g=c}vb(){return"Google IMA SDK"}wb(){return google.ima.VERSION}Cb(){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()}gc(){return this.f?
6
- this.f.getIsBumper():!1}Mb(){let a=null;const b=this.a,c=Object.keys(b).find(d=>typeof b[d]===_.De&&typeof b[d].clickThroughUrl===_.Nf);c&&(a=b[c].clickThroughUrl);return a}getMediaUrl(){return this.a.getMediaUrl()}zb(){return this.a.getVastMediaWidth()}yb(){return this.a.getVastMediaHeight()}nb(){return this.a.getVastMediaBitrate()}ab(){return this.g?2:this.j?1:0}getPodIndex(){return this.f?this.f.getPodIndex():0}Nb(){return this.f?this.f.getTimeOffset():0}Ob(){return this.f?this.f.getAdPosition():
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var kQ="clpp.ima.AdsManagerFactory",lQ=function(a){a=a.I;const b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.t&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.Nc?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.t&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.t&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===
2
+ _.Nc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},mQ=function(a){return!1===a.I.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.Uj()},nQ=function(a){const b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.da.bind(a));c.on(b,d.LOADED,a.W.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.Zb.bind(a));c.on(b,d.STARTED,a.Y.bind(a));c.on(b,d.LOG,a.Ja.bind(a));c.on(b,d.AD_PROGRESS,a.Sa.bind(a));c.on(b,d.AD_BUFFERING,a.ja.bind(a));
3
+ c.on(b,d.FIRST_QUARTILE,a.S.bind(a));c.on(b,d.MIDPOINT,a.Ka.bind(a));c.on(b,d.THIRD_QUARTILE,a.aa.bind(a));c.on(b,d.PAUSED,a.La.bind(a));c.on(b,d.RESUMED,a.ib.bind(a));c.on(b,d.CLICK,a.R.bind(a));c.on(b,d.SKIPPED,a.X.bind(a));c.on(b,d.IMPRESSION,a.T.bind(a));c.on(b,d.COMPLETE,a.Ia.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.ac.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.Wb.bind(a))},oQ=function(a,b){const c=b?a.ea.create(b.getErrorCode()):null;a.m.onError(new _.H(1,9,10003,{errorType:c},b))},pQ=function(a,
4
+ b,c){c=c&&c.getAd();let d=null;c&&(d={ad:new X(c,a.F,a.C)});a.m.trigger(new _.E(b,d))},qQ=function(a){a.B=null;pQ(a,_.qc);a.o&&a.m.getSurface().hide(a.o)},rQ=function(a){_.to(a.A,{visibility:"visible"})},tQ=function(a){return _.x(function*(){a.N.initialize();const b=!!a.m.getConfiguration().muted;(yield a.K.canPlay(b))||mQ(a)?sQ(a):(pQ(a,_.Lc),a.h.warn(_.ka))})},uQ=function(a,b){return _.x(function*(){a.N.initialize();yield b.play();sQ(a)})},sQ=function(a){a.a.init(a.A.offsetWidth,a.A.offsetHeight,
5
+ google.ima.ViewMode.NORMAL);a.a.start();a.H=!0},vQ=function(){return!window.google||!google.ima||!google.ima.AdsLoader},X=class{constructor(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.g=c}vb(){return"Google IMA SDK"}wb(){return google.ima.VERSION}Cb(){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()}gc(){return this.f?
6
+ this.f.getIsBumper():!1}Mb(){let a=null;const b=this.a,c=Object.keys(b).find(d=>typeof b[d]===_.Ce&&typeof b[d].clickThroughUrl===_.Mf);c&&(a=b[c].clickThroughUrl);return a}getMediaUrl(){return this.a.getMediaUrl()}zb(){return this.a.getVastMediaWidth()}yb(){return this.a.getVastMediaHeight()}nb(){return this.a.getVastMediaBitrate()}ab(){return this.g?2:this.j?1:0}getPodIndex(){return this.f?this.f.getPodIndex():0}Nb(){return this.f?this.f.getTimeOffset():0}Ob(){return this.f?this.f.getAdPosition():
7
7
  1}Bb(){return this.f?this.f.getTotalAds():1}getWrapperAdIds(){return this.a.getWrapperAdIds()}getWrapperAdSystems(){return this.a.getWrapperAdSystems()}getWrapperCreativeIds(){return this.a.getWrapperCreativeIds()}};X.prototype.getWrapperCreativeIds=X.prototype.getWrapperCreativeIds;X.prototype.getWrapperAdSystems=X.prototype.getWrapperAdSystems;X.prototype.getWrapperAdIds=X.prototype.getWrapperAdIds;X.prototype.getSequenceLength=X.prototype.Bb;X.prototype.getPositionInSequence=X.prototype.Ob;
8
8
  X.prototype.getPodTimeOffset=X.prototype.Nb;X.prototype.getPodIndex=X.prototype.getPodIndex;X.prototype.getPodType=X.prototype.ab;X.prototype.getMediaBitrate=X.prototype.nb;X.prototype.getMediaHeight=X.prototype.yb;X.prototype.getMediaWidth=X.prototype.zb;X.prototype.getMediaUrl=X.prototype.getMediaUrl;X.prototype.getClickThroughUrl=X.prototype.Mb;X.prototype.isBumper=X.prototype.gc;X.prototype.getSkipTimeOffset=X.prototype.getSkipTimeOffset;X.prototype.getDuration=X.prototype.getDuration;
9
- X.prototype.getTitle=X.prototype.getTitle;X.prototype.getAdvertiserName=X.prototype.getAdvertiserName;X.prototype.getAdSystem=X.prototype.getAdSystem;X.prototype.getApiFramework=X.prototype.getApiFramework;X.prototype.getCreativeId=X.prototype.getCreativeId;X.prototype.getId=X.prototype.getId;X.prototype.getTechnology=X.prototype.Cb;X.prototype.getAdManagerVersion=X.prototype.wb;X.prototype.getAdManagerName=X.prototype.vb;var uQ=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 vQ=class{constructor(a){this.a=a}getCuePoints(){return this.a}Pb(){return 0<=this.a.indexOf(0)||0===this.a.length}pb(){return 0<=this.a.indexOf(-1)}};vQ.prototype.hasPostroll=vQ.prototype.pb;vQ.prototype.hasPreroll=vQ.prototype.Pb;vQ.prototype.getCuePoints=vQ.prototype.getCuePoints;var wQ=class{constructor(a){this.m=a;this.A=a.getSurface().getMedia();a=this.m.getConfiguration();a=_.Ng(a.ima||{});this.I=a=_.Mg({disableCustomPlayback:!1},a);this.o=this.m.cc("ima").xc();this.N=this.m.cc("ima").g;this.l=this.m.cc("ima").a;this.K=new _.fu;this.h=new _.R("clpp.ima");this.g=this.a=null;this.f=new _.an;this.H=!1;this.w=new _.hs;this.ea=new uQ;this.B=null;this.L=this.G=this.C=this.F=!1;this.J=this.j=null;{a=this.w;const b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.l,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
10
- this.Kb.bind(this));a.on(this.l,b,this.jb.bind(this));a.on(this.m,_.Vd,this.Yb.bind(this))}}Kb(a){this.a=a.getAdsManager(this.A,jQ(this));this.a.isCustomPlaybackUsed()&&!kQ(this)?(this.h.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.H(1,9,10002)),this.dispose()):(this.g=new _.du(this.m.getSurface(),(b,c,d)=>{this.a.resize(b,c,d?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.j=new vQ(a),this.m.trigger(new _.E(_.uc,
11
- {adsTimeline:this.j})),lQ(this));this.f.resolve()}jb(a){mQ(this,a.getError());this.f.resolve()}Zb(a){const b=this;return _.x(function*(){b.G=!0;if(kQ(b)){b.J=b.m.getPosition();yield b.m.detach();var c=b.m;c.a&&c.a.stopForwardingEventsTo(c)}else yield b.m.pause(),_.to(b.A,{visibility:_.$d});nQ(b,_.cc,a);b.g.start()})}da(){const a=this;return _.x(function*(){a.a.start()})}W(a){a.getAd().isLinear()?nQ(this,_.jc,a):(this.a.discardAdBreak(),this.F||(this.F=!0,this.m.play()))}Y(a){this.B=a.getAd().getDuration();
12
- nQ(this,_.qc,a);this.m.getSurface().show(this.o)}Ja(a){a=a.getAdData();mQ(this,a?a.adError:null);oQ(this)}Sa(a){nQ(this,_.nc,a)}ja(a){nQ(this,_.ec,a)}S(a){nQ(this,_.hc,a)}Ka(a){nQ(this,_.lc,a)}aa(a){nQ(this,_.sc,a)}La(a){nQ(this,_.mc,a)}ib(a){nQ(this,_.oc,a)}R(a){this.pause();nQ(this,_.fc,a)}X(a){nQ(this,_.pc,a);oQ(this)}T(a){nQ(this,_.ic,a)}Ia(a){nQ(this,_.gc,a);oQ(this)}ac(){const a=this;return _.x(function*(){a.F=!0;if(kQ(a)&&null!==a.J){var b=a.m;b.a&&b.a.forwardEventsTo(b);yield _.np(a.m);a.C||
13
- (yield a.m.seek(a.J))}else{if(!a.G)return a.m.play();pQ(a)}a.G=!1;a.g&&a.g.stop();a.C||(yield a.m.play());nQ(a,_.dc)})}Wb(){this.L=!0}Yb(){this.C=!0;this.l.contentComplete()}load(){const a=this;return _.x(function*(){var b=a.m;const c=a.I;try{if(typeof c.adTagUrl!==_.Nf)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.K.canPlay(!1);const d=yield a.K.canPlay(!0),e=new google.ima.AdsRequest;e.adTagUrl=
14
- c.adTagUrl;e.setAdWillAutoPlay(b);e.setAdWillPlayMuted(d);a.l.getSettings().setAutoPlayAdBreaks(!1);a.l.requestAds(e);return a.f})}start(a){const b=this;return _.x(function*(){b.a&&b.j&&!b.H?b.j.Pb()?yield rQ(b):yield sQ(b,a):yield a.play()})}resume(){this.a&&this.a.resume()}pause(){this.a&&this.a.pause()}skip(){this.a&&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.B)return-1;const a=this.a.getRemainingTime();
15
- return 0>a?0:this.B-a}dispose(){return(new Promise(a=>{this.H&&this.j&&this.j.pb()&&!this.L?(this.w.one(this.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,()=>{a();this.o&&this.m.getSurface().hide(this.o)}),_.nh(this.w,this.a,[google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.STARTED],()=>{this.a&&this.a.discardAdBreak()})):a();this.a.discardAdBreak();this.l.contentComplete()})).then(()=>{pQ(this);this.w.release();this.g&&(this.g.stop(),this.g=null);this.a&&(this.a.destroy(),this.a=null)})}};
16
- wQ.prototype.getPosition=wQ.prototype.getPosition;wQ.prototype.setVolume=wQ.prototype.setVolume;wQ.prototype.getVolume=wQ.prototype.getVolume;wQ.prototype.skip=wQ.prototype.skip;wQ.prototype.pause=wQ.prototype.pause;wQ.prototype.resume=wQ.prototype.resume;var xQ=class extends _.pu{constructor(){super();this.a=this.g=this.f=null}onPlayerCreated(a){if(tQ())return a.onError(new _.H(1,9,1E4));this.f=_.ro(_.Gd,{"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(_.ra);this.a.getSettings().setPlayerVersion(_.fa);this.a.getSettings().setAutoPlayAdBreaks(!0)}onPlayerWillDestroy(a){this.a&&
17
- (this.a.destroy(),this.a=null);this.g&&(this.g.destroy(),this.g=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)}xg(){return this.a}vg(){return this.g}xc(){return this.f}id(){return"ima"}};_.z("clpp.ima.ImaPlugin",xQ);xQ.prototype.getAdContainer=xQ.prototype.xc;xQ.prototype.getAdDisplayContainer=xQ.prototype.vg;xQ.prototype.getAdsLoader=xQ.prototype.xg;xQ.Id="ima";xQ.isSdkMissing=tQ;_.Yo(new class{create(){return new xQ}});var yQ=class{constructor(){this.a=new _.R(iQ)}name(){return iQ}isSupported(a,b){return a.namespace()===_.kd?!1:tQ()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new wQ(a)}};yQ.prototype.create=yQ.prototype.create;yQ.prototype.isSupported=yQ.prototype.isSupported;yQ.prototype.name=yQ.prototype.name;_.oo(new yQ);};f.call(g, window);
9
+ X.prototype.getTitle=X.prototype.getTitle;X.prototype.getAdvertiserName=X.prototype.getAdvertiserName;X.prototype.getAdSystem=X.prototype.getAdSystem;X.prototype.getApiFramework=X.prototype.getApiFramework;X.prototype.getCreativeId=X.prototype.getCreativeId;X.prototype.getId=X.prototype.getId;X.prototype.getTechnology=X.prototype.Cb;X.prototype.getAdManagerVersion=X.prototype.wb;X.prototype.getAdManagerName=X.prototype.vb;var wQ=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 xQ=class{constructor(a){this.a=a}getCuePoints(){return this.a}Pb(){return 0<=this.a.indexOf(0)||0===this.a.length}pb(){return 0<=this.a.indexOf(-1)}};xQ.prototype.hasPostroll=xQ.prototype.pb;xQ.prototype.hasPreroll=xQ.prototype.Pb;xQ.prototype.getCuePoints=xQ.prototype.getCuePoints;var yQ=class{constructor(a){this.m=a;this.A=a.getSurface().getMedia();a=this.m.getConfiguration();a=_.Ng(a.ima||{});this.I=a=_.Mg({disableCustomPlayback:!1},a);this.o=this.m.cc("ima").xc();this.N=this.m.cc("ima").g;this.l=this.m.cc("ima").a;this.K=new _.hu;this.h=new _.R("clpp.ima");this.g=this.a=null;this.f=new _.an;this.H=!1;this.w=new _.ks;this.ea=new wQ;this.B=null;this.L=this.G=this.C=this.F=!1;this.J=this.j=null;{a=this.w;const b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.l,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
10
+ this.Kb.bind(this));a.on(this.l,b,this.jb.bind(this));a.on(this.m,_.Ud,this.Yb.bind(this))}}Kb(a){this.a=a.getAdsManager(this.A,lQ(this));this.a.isCustomPlaybackUsed()&&!mQ(this)?(this.h.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.H(1,9,10002)),this.dispose()):(this.g=new _.fu(this.m.getSurface(),(b,c,d)=>{this.a.resize(b,c,d?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.j=new xQ(a),this.m.trigger(new _.E(_.tc,
11
+ {adsTimeline:this.j})),nQ(this));this.f.resolve()}jb(a){oQ(this,a.getError());this.f.resolve()}Zb(a){const b=this;return _.x(function*(){b.G=!0;if(mQ(b)){b.J=b.m.getPosition();yield b.m.detach();var c=b.m;c.a&&c.a.stopForwardingEventsTo(c)}else yield b.m.pause(),_.to(b.A,{visibility:_.Zd});pQ(b,_.bc,a);b.g.start()})}da(){const a=this;return _.x(function*(){a.a.start()})}W(a){a.getAd().isLinear()?pQ(this,_.ic,a):(this.a.discardAdBreak(),this.F||(this.F=!0,this.m.play()))}Y(a){this.B=a.getAd().getDuration();
12
+ pQ(this,_.pc,a);this.m.getSurface().show(this.o)}Ja(a){a=a.getAdData();oQ(this,a?a.adError:null);qQ(this)}Sa(a){pQ(this,_.mc,a)}ja(a){pQ(this,_.dc,a)}S(a){pQ(this,_.gc,a)}Ka(a){pQ(this,_.jc,a)}aa(a){pQ(this,_.rc,a)}La(a){pQ(this,_.lc,a)}ib(a){pQ(this,_.nc,a)}R(a){this.pause();pQ(this,_.ec,a)}X(a){pQ(this,_.oc,a);qQ(this)}T(a){pQ(this,_.hc,a)}Ia(a){pQ(this,_.fc,a);qQ(this)}ac(){const a=this;return _.x(function*(){a.F=!0;if(mQ(a)&&null!==a.J){var b=a.m;b.a&&b.a.forwardEventsTo(b);yield _.qp(a.m);a.C||
13
+ (yield a.m.seek(a.J))}else{if(!a.G)return a.m.play();rQ(a)}a.G=!1;a.g&&a.g.stop();a.C||(yield a.m.play());pQ(a,_.cc)})}Wb(){this.L=!0}Yb(){this.C=!0;this.l.contentComplete()}load(){const a=this;return _.x(function*(){var b=a.m;const c=a.I;try{if(typeof c.adTagUrl!==_.Mf)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.K.canPlay(!1);const d=yield a.K.canPlay(!0),e=new google.ima.AdsRequest;e.adTagUrl=
14
+ c.adTagUrl;e.setAdWillAutoPlay(b);e.setAdWillPlayMuted(d);a.l.getSettings().setAutoPlayAdBreaks(!1);a.l.requestAds(e);return a.f})}start(a){const b=this;return _.x(function*(){b.a&&b.j&&!b.H?b.j.Pb()?yield tQ(b):yield uQ(b,a):yield a.play()})}resume(){this.a&&this.a.resume()}pause(){this.a&&this.a.pause()}skip(){this.a&&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.B)return-1;const a=this.a.getRemainingTime();
15
+ return 0>a?0:this.B-a}dispose(){return(new Promise(a=>{this.H&&this.j&&this.j.pb()&&!this.L?(this.w.one(this.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,()=>{a();this.o&&this.m.getSurface().hide(this.o)}),_.nh(this.w,this.a,[google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.STARTED],()=>{this.a&&this.a.discardAdBreak()})):a();this.a.discardAdBreak();this.l.contentComplete()})).then(()=>{rQ(this);this.w.release();this.g&&(this.g.stop(),this.g=null);this.a&&(this.a.destroy(),this.a=null)})}};
16
+ yQ.prototype.getPosition=yQ.prototype.getPosition;yQ.prototype.setVolume=yQ.prototype.setVolume;yQ.prototype.getVolume=yQ.prototype.getVolume;yQ.prototype.skip=yQ.prototype.skip;yQ.prototype.pause=yQ.prototype.pause;yQ.prototype.resume=yQ.prototype.resume;var zQ=class extends _.ru{constructor(){super();this.a=this.g=this.f=null}onPlayerCreated(a){if(vQ())return a.onError(new _.H(1,9,1E4));this.f=_.ro(_.Fd,{"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(_.ra);this.a.getSettings().setPlayerVersion(_.fa);this.a.getSettings().setAutoPlayAdBreaks(!0)}onPlayerWillDestroy(a){this.a&&
17
+ (this.a.destroy(),this.a=null);this.g&&(this.g.destroy(),this.g=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)}xg(){return this.a}vg(){return this.g}xc(){return this.f}id(){return"ima"}};_.z("clpp.ima.ImaPlugin",zQ);zQ.prototype.getAdContainer=zQ.prototype.xc;zQ.prototype.getAdDisplayContainer=zQ.prototype.vg;zQ.prototype.getAdsLoader=zQ.prototype.xg;zQ.Id="ima";zQ.isSdkMissing=vQ;_.ap(new class{create(){return new zQ}});var AQ=class{constructor(){this.a=new _.R(kQ)}name(){return kQ}isSupported(a,b){return a.namespace()===_.jd?!1:vQ()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new yQ(a)}};AQ.prototype.create=AQ.prototype.create;AQ.prototype.isSupported=AQ.prototype.isSupported;AQ.prototype.name=AQ.prototype.name;_.oo(new AQ);};f.call(g, window);