@@ -46,14 +46,12 @@ export class GoogleImaAdsProvider {
4646 this . #adDisplayContainer = new google . ima . AdDisplayContainer ( this . #adContainer, this . #videoElement) ;
4747
4848 this . #adsLoader = new google . ima . AdsLoader ( this . #adDisplayContainer) ;
49- console . log ( 'adsLoader' , this . #adsLoader ) ;
49+
5050 this . #adsLoader. addEventListener (
5151 google . ima . AdsManagerLoadedEvent . Type . ADS_MANAGER_LOADED ,
5252 ( adsManagerLoadedEvent : google . ima . AdsManagerLoadedEvent ) => {
53- console . log ( 'Ad Manager loaded' , adsManagerLoadedEvent ) ;
5453 const adsRenderingSettings = new google . ima . AdsRenderingSettings ( ) ;
5554 this . #adsManager = adsManagerLoadedEvent . getAdsManager ( this . #videoElement, adsRenderingSettings ) ;
56- console . log ( 'adsManager' , this . #adsManager) ;
5755 this . #startAdsManager( ) ;
5856 } ,
5957 false
@@ -71,9 +69,7 @@ export class GoogleImaAdsProvider {
7169 }
7270
7371 #startAdsManager( ) {
74- console . log ( 'startAdsManager' , this . #adsManager) ;
7572 this . #adsManager?. addEventListener ( google . ima . AdEvent . Type . CONTENT_PAUSE_REQUESTED , ( ) => {
76- console . log ( 'CONTENT_PAUSE_REQUESTED' ) ;
7773 const currentTime = this . #customVideoElement. currentTime ;
7874 const wasPlaying = ! this . #customVideoElement. paused ;
7975
@@ -101,7 +97,6 @@ export class GoogleImaAdsProvider {
10197 this . #adsManager?. addEventListener (
10298 google . ima . AdEvent . Type . CONTENT_RESUME_REQUESTED ,
10399 ( ) => {
104- console . log ( 'CONTENT_RESUME_REQUESTED' ) ;
105100 if ( this . #videoBackup && this . isUsingSameVideoElement ( ) ) {
106101 this . #customVideoElement. muxDataKeepSession = true ;
107102 this . #customVideoElement. load ( ) ;
@@ -126,11 +121,7 @@ export class GoogleImaAdsProvider {
126121 false
127122 ) ;
128123
129- this . #adsManager?. addEventListener (
130- google . ima . AdErrorEvent . Type . AD_ERROR ,
131- console . log . bind ( null , 'AD_ERROR Manager' ) ,
132- false
133- ) ;
124+ this . #adsManager?. addEventListener ( google . ima . AdErrorEvent . Type . AD_ERROR , console . error , false ) ;
134125
135126 this . #adsManager?. addEventListener (
136127 google . ima . AdEvent . Type . CLICK ,
@@ -143,7 +134,6 @@ export class GoogleImaAdsProvider {
143134 this . #adsManager?. addEventListener (
144135 google . ima . AdEvent . Type . LOADED ,
145136 ( adEvent : google . ima . AdEvent ) => {
146- console . log ( 'loaded' , adEvent ) ;
147137 this . #ad = adEvent . getAd ( ) ;
148138 this . #customVideoElement. dispatchEvent ( new Event ( 'durationchange' ) ) ;
149139 this . #customVideoElement. dispatchEvent ( new Event ( 'timeupdate' ) ) ;
@@ -155,7 +145,6 @@ export class GoogleImaAdsProvider {
155145 this . #adsManager?. addEventListener (
156146 google . ima . AdEvent . Type . STARTED ,
157147 ( adEvent : google . ima . AdEvent ) => {
158- console . log ( 'started' , adEvent ) ;
159148 this . #ad = adEvent . getAd ( ) ;
160149 this . #customVideoElement. dispatchEvent ( new Event ( 'playing' ) ) ;
161150 this . #customVideoElement. dispatchEvent ( new Event ( 'adbreakadpositionchange' ) ) ;
@@ -164,13 +153,11 @@ export class GoogleImaAdsProvider {
164153 ) ;
165154
166155 this . #adsManager?. addEventListener ( google . ima . AdEvent . Type . PAUSED , ( ) => {
167- console . log ( 'Ads paused' ) ;
168156 this . #adPaused = true ;
169157 this . #customVideoElement. dispatchEvent ( new Event ( 'pause' ) ) ;
170158 } ) ;
171159
172160 this . #adsManager?. addEventListener ( google . ima . AdEvent . Type . RESUMED , ( ) => {
173- console . log ( 'Ads resumed' ) ;
174161 this . #adPaused = false ;
175162 } ) ;
176163
@@ -190,20 +177,11 @@ export class GoogleImaAdsProvider {
190177 this . #adsManager?. addEventListener (
191178 google . ima . AdEvent . Type . VOLUME_CHANGED ,
192179 ( ) => {
193- console . log ( 'volumeChanged' ) ;
194180 this . #customVideoElement. dispatchEvent ( new Event ( 'volumechange' ) ) ;
195181 } ,
196182 false
197183 ) ;
198184
199- this . #adsManager?. addEventListener (
200- google . ima . AdEvent . Type . ALL_ADS_COMPLETED ,
201- ( ) => {
202- console . log ( 'allAdsCompleted' ) ;
203- } ,
204- false
205- ) ;
206-
207185 this . #adsManager?. init ( this . #originalSize. width , this . #originalSize. height , this . #viewMode) ;
208186 this . #adsManager?. start ( ) ;
209187 }
@@ -234,7 +212,6 @@ export class GoogleImaAdsProvider {
234212 }
235213
236214 requestAds ( adTagUrl : string ) {
237- console . log ( 'requestAds' , adTagUrl ) ;
238215 const adsRequest = new google . ima . AdsRequest ( ) ;
239216 adsRequest . adTagUrl = adTagUrl ;
240217 this . #adsLoader?. requestAds ( adsRequest ) ;
@@ -277,7 +254,6 @@ export class GoogleImaAdsProvider {
277254
278255 isUsingSameVideoElement ( ) : boolean {
279256 const videoElements = this . #adContainer. querySelectorAll ( 'video' ) ;
280- console . log ( 'videoElements' , videoElements . length , videoElements ) ;
281257 return videoElements . length === 0 ;
282258 }
283259
0 commit comments