UNPKG

@glomex/vast-ima-player

Version:

Convenience wrapper for advertising video/audio content with Google IMA

3 lines (2 loc) 17.9 kB
var t=null,i=function(){t=null},s=function(){var s=window;return s.google&&s.google.ima?Promise.resolve(s.google.ima):t||((t=new Promise(function(t,i){var s=document.createElement("script");s.async=!0,s.src="https://imasdk.googleapis.com/js/sdkloader/ima3.js",s.onload=t,s.onerror=i,document.body.appendChild(s)}).then(function(){return s.google.ima})).then(i).catch(i),t)};function e(){return e=Object.assign||function(t){for(var i=1;i<arguments.length;i++){var s=arguments[i];for(var e in s)Object.prototype.hasOwnProperty.call(s,e)&&(t[e]=s[e])}return t},e.apply(this,arguments)}var h=0;function a(t){return"__private_"+h+++"_"+t}function n(t,i){if(!Object.prototype.hasOwnProperty.call(t,i))throw new TypeError("attempted to use private field on non-instance");return t}var r={};r.CustomEvent="function"==typeof CustomEvent?CustomEvent:function(t){return i[t]=new i("").constructor[t],i;function i(t,i){i||(i={});var s=document.createEvent("CustomEvent");return s.initCustomEvent(t,!!i.bubbles,!!i.cancelable,i.detail),s}}("prototype");var d=r.CustomEvent,o=a("mediaElement"),l=a("currentTime"),u=a("enabled");class c{constructor(t){Object.defineProperty(this,o,{writable:!0,value:void 0}),Object.defineProperty(this,l,{writable:!0,value:void 0}),Object.defineProperty(this,u,{writable:!0,value:void 0}),this.seeking=void 0,n(this,o)[o]=t,n(this,l)[l]=0,n(this,u)[u]=!1,this.seeking=!1,this.t=this.t.bind(this),this.i=this.i.bind(this),this.h=this.h.bind(this),this.enable()}i(){this.seeking=!0}h(){this.seeking=!1}t(){var t,i;this.seeking||null!=(t=n(this,o)[o])&&t.paused||(n(this,l)[l]=null==(i=n(this,o)[o])?void 0:i.currentTime)}get enabled(){return n(this,u)[u]}enable(){var t,i,s;n(this,u)[u]||(null==(t=n(this,o)[o])||t.addEventListener("seeking",this.i),null==(i=n(this,o)[o])||i.addEventListener("seeked",this.h),null==(s=n(this,o)[o])||s.addEventListener("timeupdate",this.t),n(this,u)[u]=!0)}disable(){var t,i,s;n(this,u)[u]&&(null==(t=n(this,o)[o])||t.removeEventListener("seeking",this.i),null==(i=n(this,o)[o])||i.removeEventListener("seeked",this.h),null==(s=n(this,o)[o])||s.removeEventListener("timeupdate",this.t),n(this,u)[u]=!1)}get currentTime(){return n(this,l)[l]}get duration(){var t;return null==(t=n(this,o)[o])?void 0:t.duration}get muted(){var t;return null==(t=n(this,o)[o])?void 0:t.muted}get volume(){var t;return null==(t=n(this,o)[o])?void 0:t.volume}play(){return new Promise(t=>{var i;t(null==(i=n(this,o)[o])?void 0:i.play())})}pause(){var t;null==(t=n(this,o)[o])||t.pause()}reset(){n(this,l)[l]=0,n(this,u)[u]=!1,this.seeking=!1,this.enable()}destroy(){n(this,l)[l]=0,n(this,u)[u]=!1,this.seeking=!1,this.disable(),n(this,o)[o]=void 0}}const v=["abort","canplay","canplaythrough","durationchange","emptied","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting"];var w,b;!function(t){t.MEDIA_START="MediaStart",t.MEDIA_IMPRESSION="MediaImpression",t.MEDIA_STOP="MediaStop",t.MEDIA_CUE_POINTS_CHANGE="MediaCuePointsChange",t.MEDIA_RESUMED="MediaResumed"}(w||(w={})),function(t){t.AD_ERROR="AdError",t.AD_BUFFERING="AdBuffering",t.LOADED="AdLoaded",t.IMPRESSION="AdImpression",t.STARTED="AdStarted",t.FIRST_QUARTILE="AdFirstQuartile",t.MIDPOINT="AdMidpoint",t.THIRD_QUARTILE="AdThirdQuartile",t.AD_PROGRESS="AdProgress",t.COMPLETE="AdComplete",t.CLICK="AdClick",t.PAUSED="AdPaused",t.RESUMED="AdResumed",t.SKIPPED="AdSkipped",t.SKIPPABLE_STATE_CHANGED="AdSkippableStateChanged",t.VOLUME_CHANGED="AdVolumeChanged",t.VOLUME_MUTED="AdMuted",t.AD_METADATA="AdMetadata",t.AD_BREAK_READY="AdBreakReady",t.CONTENT_PAUSE_REQUESTED="AdContentPauseRequested",t.CONTENT_RESUME_REQUESTED="AdContentResumeRequested",t.ALL_ADS_COMPLETED="AdAllAdsCompleted",t.DURATION_CHANGE="AdDurationChange",t.INTERACTION="AdInteraction",t.LINEAR_CHANGED="AdLinearChanged",t.LOG="AdLog",t.USER_CLOSE="AdUserClose",t.AD_CAN_PLAY="AdCanPlay",t.EXPANDED_CHANGED="AdExpandedChanged",t.VIEWABLE_IMPRESSION="AdViewableImpression"}(b||(b={}));const m=e({},b,w);class p{constructor(){this.disableCustomPlaybackForIOS10Plus=!1,this.autoResize=!0,this.clickTrackingElement=void 0}}class A extends Error{constructor(...t){super(...t),this.errorCode=void 0,this.innerError=void 0,this.type=void 0,this.vastErrorCode=void 0}}A.ERROR_CODE_ADS_MANAGER_LOADED_TIMEOUT=9e3,A.ERROR_CODE_REQUEST_ADS_TIMEOUT=9001;var g=a("mediaElement"),f=a("adElement"),O=a("customPlayhead"),j=a("adsRenderingSettings"),E=a("ima"),k=a("adDisplayContainer"),y=a("adsManager"),_=a("width"),C=a("height"),P=a("adsLoader"),M=a("playerOptions"),R=a("resizeObserver"),T=a("currentAd"),S=a("loadedAd"),L=a("mediaStartTriggered"),x=a("mediaImpressionTriggered"),I=a("mediaInActivation"),W=a("customPlaybackTimeAdjustedOnEnded"),B=a("cuePoints"),D=a("adCurrentTime"),q=a("adDuration"),z=a("startAdCallback"),V=a("adsManagerLoadedTimeout"),$=a("requestAdsTimeout"),N=a("wasExternallyPaused"),F=a("lastNonZeroAdVolume"),G=a("activatePromise");class H extends class{constructor(){this.delegate=document.createDocumentFragment()}addEventListener(...t){this.delegate.addEventListener.apply(this.delegate,t)}dispatchEvent(...t){return this.delegate.dispatchEvent.apply(this.delegate,t)}removeEventListener(...t){return this.delegate.removeEventListener.apply(this.delegate,t)}}{constructor(t,i,s,e=new t.AdsRenderingSettings,h=new p){super(),Object.defineProperty(this,g,{writable:!0,value:void 0}),Object.defineProperty(this,f,{writable:!0,value:void 0}),Object.defineProperty(this,O,{writable:!0,value:void 0}),Object.defineProperty(this,j,{writable:!0,value:void 0}),Object.defineProperty(this,E,{writable:!0,value:void 0}),Object.defineProperty(this,k,{writable:!0,value:void 0}),Object.defineProperty(this,y,{writable:!0,value:void 0}),Object.defineProperty(this,_,{writable:!0,value:void 0}),Object.defineProperty(this,C,{writable:!0,value:void 0}),Object.defineProperty(this,P,{writable:!0,value:void 0}),Object.defineProperty(this,M,{writable:!0,value:void 0}),Object.defineProperty(this,R,{writable:!0,value:void 0}),Object.defineProperty(this,T,{writable:!0,value:void 0}),Object.defineProperty(this,S,{writable:!0,value:void 0}),Object.defineProperty(this,L,{writable:!0,value:!1}),Object.defineProperty(this,x,{writable:!0,value:!1}),Object.defineProperty(this,I,{writable:!0,value:!1}),Object.defineProperty(this,W,{writable:!0,value:!1}),Object.defineProperty(this,B,{writable:!0,value:[]}),Object.defineProperty(this,D,{writable:!0,value:void 0}),Object.defineProperty(this,q,{writable:!0,value:void 0}),Object.defineProperty(this,z,{writable:!0,value:void 0}),Object.defineProperty(this,V,{writable:!0,value:void 0}),Object.defineProperty(this,$,{writable:!0,value:void 0}),Object.defineProperty(this,N,{writable:!0,value:!1}),Object.defineProperty(this,F,{writable:!0,value:1}),Object.defineProperty(this,G,{writable:!0,value:Promise.resolve()}),n(this,g)[g]=i,n(this,f)[f]=s,n(this,E)[E]=t,n(this,M)[M]=h,n(this,j)[j]=e,n(this,j)[j].restoreCustomPlaybackStateOnAdBreakComplete=!0,h.disableCustomPlaybackForIOS10Plus&&!n(this,g)[g].hasAttribute("playsinline")&&n(this,g)[g].setAttribute("playsinline",""),n(this,E)[E].settings.setDisableCustomPlaybackForIOS10Plus(h.disableCustomPlaybackForIOS10Plus),n(this,O)[O]=new c(n(this,g)[g]),this.o=this.o.bind(this),v.forEach(t=>{n(this,g)[g].addEventListener(t,this.o)}),this.l=this.l.bind(this),this.u=this.u.bind(this);const{offsetHeight:a,offsetWidth:r}=n(this,g)[g];n(this,_)[_]=r,n(this,C)[C]=a,h.autoResize&&window.ResizeObserver&&(n(this,R)[R]=new window.ResizeObserver(t=>this.v(t)),n(this,R)[R].observe(n(this,g)[g]))}activate(){if(!n(this,L)[L]&&!n(this,I)[I]&&(n(this,I)[I]=!0,n(this,g)[g].paused)){const t=()=>(n(this,g)[g].pause(),new Promise(t=>{setTimeout(()=>{n(this,I)[I]=!1,t()},1)}));n(this,G)[G]=new Promise(t=>t(n(this,g)[g].play())).then(t).catch(t)}}playAds(t){this.m(t)}loadAds(t,i){this.m(t,!1,i)}p(){return n(this,G)[G].then(()=>new Promise(t=>t(n(this,g)[g].play())))}m(t,i=!0,s){this.reset(),this.A(),n(this,E)[E].settings.setAutoPlayAdBreaks(i),n(this,g)[g].ended&&(n(this,O)[O].reset(),n(this,g)[g].currentTime=0),n(this,z)[z]=s,t.linearAdSlotWidth=n(this,_)[_],t.linearAdSlotHeight=n(this,C)[C],t.nonLinearAdSlotWidth=n(this,_)[_],t.nonLinearAdSlotHeight=n(this,C)[C],null==t.contentDuration&&(t.contentDuration=-3),n(this,V)[V]=window.setTimeout(()=>{const t=new A("No adsManagerLoadedEvent within 5000ms.");t.errorCode=A.ERROR_CODE_ADS_MANAGER_LOADED_TIMEOUT,this.g(t)},5e3),n(this,$)[$]=window.setTimeout(()=>{const t=new A("No response for ads-request within 10000ms.");t.errorCode=A.ERROR_CODE_REQUEST_ADS_TIMEOUT,this.g(t)},1e4),n(this,P)[P].requestAds(t)}A(){n(this,k)[k]=new(n(this,E)[E].AdDisplayContainer)(n(this,f)[f],n(this,M)[M].disableCustomPlaybackForIOS10Plus?void 0:n(this,g)[g],n(this,M)[M].clickTrackingElement),n(this,P)[P]=new(n(this,E)[E].AdsLoader)(n(this,k)[k]),n(this,P)[P].addEventListener(n(this,E)[E].AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.l,!1),n(this,P)[P].addEventListener(n(this,E)[E].AdErrorEvent.Type.AD_ERROR,this.u,!1)}skipAd(){n(this,y)[y]&&n(this,y)[y].skip()}discardAdBreak(){n(this,y)[y]&&n(this,y)[y].discardAdBreak()}play(){n(this,N)[N]=!1,!n(this,O)[O].enabled&&n(this,y)[y]?n(this,y)[y].resume():n(this,V)[V]||this.p().then(()=>{}).catch(()=>{this.dispatchEvent(new d("pause"))})}pause(){n(this,N)[N]=!0,!n(this,O)[O].enabled&&n(this,y)[y]?n(this,y)[y].pause():n(this,g)[g].pause()}set volume(t){!n(this,O)[O].enabled&&n(this,y)[y]&&n(this,y)[y].setVolume(t),n(this,g)[g].volume=t}get volume(){return!n(this,O)[O].enabled&&n(this,y)[y]?n(this,y)[y].getVolume():n(this,g)[g].volume}set muted(t){!n(this,O)[O].enabled&&n(this,y)[y]&&n(this,y)[y].setVolume(t?0:n(this,F)[F]),n(this,g)[g].muted=t}get muted(){return!n(this,O)[O].enabled&&n(this,y)[y]?0===n(this,y)[y].getVolume():n(this,g)[g].muted}set currentTime(t){n(this,O)[O].enabled&&(n(this,g)[g].currentTime=t)}get currentTime(){return void 0!==n(this,D)[D]?n(this,D)[D]:n(this,g)[g].currentTime}get duration(){return void 0!==n(this,q)[q]?n(this,q)[q]:n(this,g)[g].duration}get cuePoints(){return[...n(this,B)[B]]}O(t){n(this,B)[B]=[...t],this.dispatchEvent(new d(m.MEDIA_CUE_POINTS_CHANGE,{detail:{cuePoints:[...n(this,B)[B]]}}))}j(t){const i=this.cuePoints.indexOf(t);i>-1&&(n(this,B)[B].splice(i,1),this.O(n(this,B)[B]))}resizeAd(t,i){n(this,_)[_]=t,n(this,C)[C]=i,n(this,y)[y]&&n(this,y)[y].resize(t,i,this.k()),n(this,f)[f].style.width=`${t}px`,n(this,f)[f].style.height=`${i}px`}reset(t=!1){t&&(n(this,x)[x]=!1,n(this,L)[L]=!1,n(this,W)[W]=!1),this._(),n(this,B)[B]=[],n(this,N)[N]=!1,n(this,z)[z]=void 0,n(this,y)[y]&&n(this,y)[y].destroy(),n(this,y)[y]=void 0,n(this,E)[E].settings.setAutoPlayAdBreaks(!0),t&&this.C(),n(this,f)[f].style.display="none"}C(){n(this,P)[P]&&(n(this,P)[P].removeEventListener(n(this,E)[E].AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.l,!1),n(this,P)[P].removeEventListener(n(this,E)[E].AdErrorEvent.Type.AD_ERROR,this.u,!1),n(this,P)[P].destroy()),n(this,k)[k]&&n(this,k)[k].destroy()}destroy(){var t,i,s,e;this.reset(!0),n(this,O)[O].destroy(),v.forEach(t=>{n(this,g)[g].removeEventListener(t,this.o)}),null==(t=n(this,P)[P])||t.removeEventListener(n(this,E)[E].AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.l,!1),null==(i=n(this,k)[k])||i.destroy(),null==(s=n(this,P)[P])||s.destroy(),n(this,x)[x]=!1,n(this,W)[W]=!1,n(this,L)[L]=!1,null==(e=n(this,R)[R])||e.disconnect()}isCustomPlaybackUsed(){const{settings:t}=n(this,E)[E];return!1===t.getDisableCustomPlaybackForIOS10Plus()&&!n(this,f)[f].querySelector("video")}_(){window.clearTimeout(n(this,V)[V]),window.clearTimeout(n(this,$)[$]),n(this,V)[V]=void 0,n(this,$)[$]=void 0,n(this,T)[T]=void 0,n(this,D)[D]=void 0,n(this,q)[q]=void 0,n(this,f)[f].style.display="none",n(this,f)[f].classList.remove("nonlinear"),n(this,y)[y]&&this.P()}o(t){if(n(this,O)[O].enabled||"volumechange"===t.type){if("timeupdate"===t.type){if(n(this,y)[y]){const t=n(this,y)[y].getCuePoints().filter(t=>t>=0&&t<n(this,O)[O].currentTime).pop();this.j(t)}!n(this,x)[x]&&n(this,L)[L]&&n(this,g)[g].currentTime>=.5&&(this.dispatchEvent(new d(m.MEDIA_IMPRESSION)),n(this,x)[x]=!0)}if("play"!==t.type||n(this,L)[L]||n(this,I)[I]||(this.dispatchEvent(new d(m.MEDIA_START)),n(this,L)[L]=!0),"ended"===t.type&&(this.isCustomPlaybackUsed()&&n(this,g)[g].currentTime===n(this,g)[g].duration&&n(this,B)[B].indexOf(-1)>-1&&(n(this,g)[g].currentTime=n(this,g)[g].duration-1e-5,n(this,W)[W]=!0),n(this,P)[P].contentComplete(),n(this,y)[y]||this.M()),!window.ResizeObserver&&n(this,M)[M].autoResize&&"loadedmetadata"===t.type){const{offsetHeight:t,offsetWidth:i}=n(this,g)[g];n(this,_)[_]=i,n(this,C)[C]=t,this.P()}n(this,I)[I]&&"volumechange"!==t.type||this.dispatchEvent(new d(t.type))}}R(t){const{AdEvent:i}=n(this,E)[E];switch(t.type){case i.Type.LOADED:const s=t.getAd();n(this,z)[z]&&0===n(this,B)[B].length?n(this,z)[z]({ad:s,start:()=>{this.T(),n(this,z)[z]=void 0},startWithoutReset:()=>{this.T()}}):n(this,S)[S]=s;break;case i.Type.AD_BREAK_READY:this._(),n(this,z)[z]?(n(this,z)[z]({ad:n(this,S)[S],adBreakTime:t.getAdData().adBreakTime,start:()=>{this.T(),n(this,z)[z]=void 0},startWithoutReset:()=>{this.T()}}),n(this,S)[S]=void 0):this.T();break;case i.Type.STARTED:const e=n(this,T)[T]=t.getAd();e.getAdPodInfo().getAdPosition()>1&&n(this,y)[y].setVolume(n(this,y)[y].getVolume()),n(this,f)[f].classList.remove("nonlinear"),this.P(),e.isLinear()?(n(this,O)[O].disable(),n(this,q)[q]=e.getDuration(),n(this,D)[D]=0):(n(this,f)[f].classList.add("nonlinear"),this.S()),n(this,f)[f].style.display="",n(this,N)[N]&&(n(this,N)[N]=!1,n(this,y)[y].pause());break;case i.Type.ALL_ADS_COMPLETED:if(n(this,W)[W])return;this.isCustomPlaybackUsed()&&Boolean(n(this,T)[T])&&-1!==n(this,T)[T].getAdPodInfo().getTimeOffset()&&this.S(),this.reset();break;case i.Type.CONTENT_PAUSE_REQUESTED:this._(),n(this,T)[T]=t.getAd(),n(this,f)[f].style.display="",n(this,g)[g].pause(),this.P(),n(this,T)[T]&&this.j(n(this,T)[T].getAdPodInfo().getTimeOffset()),n(this,y)[y].setVolume(n(this,g)[g].muted?0:n(this,g)[g].volume),n(this,O)[O].disable(),n(this,q)[q]=n(this,T)[T].getDuration(),n(this,D)[D]=0;break;case i.Type.CONTENT_RESUME_REQUESTED:const h=Boolean(n(this,T)[T]);if(h){const t=n(this,y)[y].getVolume();n(this,g)[g].muted=0===t,n(this,g)[g].volume=n(this,F)[F]}n(this,W)[W]&&(n(this,g)[g].currentTime=n(this,g)[g].duration+1,n(this,W)[W]=!1),n(this,g)[g].ended?(this.reset(),this.M()):this._(),h&&(n(this,N)[N]=!1,this.S());break;case i.Type.AD_METADATA:this.O(n(this,y)[y].getCuePoints()),-1===n(this,B)[B].indexOf(0)&&(n(this,z)[z]?n(this,z)[z]({start:()=>{this.S(),n(this,z)[z]=void 0},startWithoutReset:()=>{this.S()}}):this.S());break;case i.Type.AD_PROGRESS:const a=t.getAdData();n(this,D)[D]=a.currentTime,n(this,q)[q]=a.duration;break;case i.Type.LOG:const r=t.getAdData();n(this,z)[z]?n(this,z)[z]({start:()=>{this.S(),n(this,z)[z]=void 0},startWithoutReset:()=>{this.S()}}):r.adError&&!n(this,T)[T]&&this.S();break;case i.Type.VOLUME_CHANGED:const d=n(this,y)[y].getVolume();d>0&&(n(this,F)[F]=d)}}u(t){this.g(this.L(t))}l(t){const{AdEvent:i,AdErrorEvent:{Type:{AD_ERROR:s}}}=n(this,E)[E];window.clearTimeout(n(this,V)[V]);const e=n(this,y)[y]=t.getAdsManager(n(this,O)[O],n(this,j)[j]);Object.keys(i.Type).forEach(t=>{e.addEventListener(i.Type[t],i=>{if(this.R(i),m[t]){const s=["LOG","AD_PROGRESS"].indexOf(t)>-1;this.dispatchEvent(new d(m[t],{detail:{ad:i.getAd()||n(this,T)[T],adData:s?i.getAdData():{}}}))}})}),e.addEventListener(s,t=>this.g(this.L(t)));try{var h;e.init(n(this,_)[_],n(this,C)[C],this.k()),e.setVolume(n(this,g)[g].muted?0:n(this,g)[g].volume),null==(h=n(this,k)[k])||h.initialize(),n(this,z)[z]||this.T()}catch(t){this.g(new A(t.message))}}T(){if(n(this,L)[L]||(this.dispatchEvent(new d(m.MEDIA_START)),n(this,L)[L]=!0),n(this,y)[y])try{n(this,y)[y].start()}catch(t){this.g(new A(t.message))}else this.S()}M(){setTimeout(()=>{n(this,x)[x]=!1,n(this,L)[L]=!1,n(this,W)[W]=!1,this.dispatchEvent(new d(m.MEDIA_STOP))},1)}v(t){for(const i of t)i.contentBoxSize&&1===i.contentBoxSize.length?(n(this,_)[_]=i.contentBoxSize[0].inlineSize,n(this,C)[C]=i.contentBoxSize[0].blockSize):i.contentBoxSize&&i.contentBoxSize.inlineSize?(n(this,_)[_]=i.contentBoxSize.inlineSize,n(this,C)[C]=i.contentBoxSize.blockSize):(n(this,_)[_]=i.contentRect.width,n(this,C)[C]=i.contentRect.height);this.P()}P(){if(!n(this,M)[M].autoResize||!n(this,y)[y])return;const t=n(this,T)[T],i=this.k();t&&!t.isLinear()?t&&(t.getWidth()>n(this,_)[_]||t.getHeight()>n(this,C)[C]?this.resizeAd(n(this,_)[_],n(this,C)[C]):(n(this,y)[y].resize(t.getWidth(),t.getHeight()+20,i),n(this,f)[f].style.width=`${t.getWidth()}px`,n(this,f)[f].style.height=`${t.getHeight()+20}px`)):this.resizeAd(n(this,_)[_],n(this,C)[C])}k(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||n(this,g)[g].webkitDisplayingFullscreen?n(this,E)[E].ViewMode.FULLSCREEN:n(this,E)[E].ViewMode.NORMAL}S(){n(this,f)[f].style.display="none",n(this,g)[g].ended||(n(this,O)[O].enable(),n(this,N)[N]?(n(this,g)[g].pause(),this.dispatchEvent(new d("pause"))):(this.p().then(()=>{}).catch(()=>{this.dispatchEvent(new d("pause"))}),this.dispatchEvent(new d("play")),this.dispatchEvent(new d(m.MEDIA_RESUMED))),n(this,N)[N]=!1)}L(t){const i=t.getError(),s=new A(i.getMessage());return s.type=i.getType(),s.errorCode=i.getErrorCode(),s.vastErrorCode=i.getVastErrorCode&&i.getVastErrorCode(),s.innerError=i.getInnerError(),s}g(t){this.dispatchEvent(new d(m.AD_ERROR,{detail:{error:t}})),this._(),n(this,z)[z]?n(this,z)[z]({start:()=>{this.S(),n(this,z)[z]=void 0},startWithoutReset:()=>{this.S()}}):this.S()}}export{H as Player,A as PlayerError,m as PlayerEvent,p as PlayerOptions,s as loadImaSdk}; //# sourceMappingURL=vast-ima-player.modern.js.map