diff --git a/src/js/ads.js b/src/js/ads.js index bca3bab..bb2ac91 100644 --- a/src/js/ads.js +++ b/src/js/ads.js @@ -43,7 +43,7 @@ class VideoAds { }); googleSdkScript.addEventListener('error', (e) => { - reportError(e); + this.reportError(e); reject(e); }); } @@ -209,7 +209,7 @@ class VideoAds { this.adsManager.start(); } catch (adError) { // An error may be thrown if there was a problem with the VAST response. - reportError(adError); + this.reportError(adError); this.video.videoEl.play(); } } @@ -329,7 +329,7 @@ class VideoAds { // convert the Google Ad error to a JS one const message = `${adError.getErrorCode()}, ${adError.getType()}, ${adError.getMessage()}, ${adError.getVastErrorCode()}`; - reportError(new Error(message)); + this.reportError(new Error(message)); this.adsManager && this.adsManager.destroy(); this.video.containerEl.removeChild(this.adContainerEl);