@@ -2,7 +2,7 @@ import { pollTimestamp } from './get-current-timestamp.js';
22import { muteAudio } from './mute-audio.js' ;
33import { serpNotify } from './serp-notify.js' ;
44import { ErrorDetection } from './error-detection.js' ;
5- import { appendThumbnailOverlay } from './overlays/thumbnail-overlay.js' ;
5+ import { appendThumbnailOverlay as showThumbnailOverlay } from './overlays/thumbnail-overlay.js' ;
66import { stopVideoFromPlaying } from './pause-video.js' ;
77import { showError } from './custom-error/custom-error.js' ;
88import { Logger , SideEffects } from './util.js' ;
@@ -122,12 +122,14 @@ export function setupDuckPlayerForYouTube(selectors, playbackPaused, environment
122122 if ( targetElement ) {
123123 if ( pause ) {
124124 sideEffects . add ( 'stopping video from playing' , ( ) => stopVideoFromPlaying ( videoElement ) ) ;
125- sideEffects . add ( 'appending thumbnail' , ( ) =>
126- appendThumbnailOverlay ( /** @type {HTMLElement } */ ( targetElement ) , environment , ( ) => {
125+ sideEffects . add ( 'appending thumbnail' , ( ) => {
126+ const clickHandler = ( ) => {
127+ messages . notifyOverlayDismissed ( ) ;
127128 sideEffects . destroy ( 'stopping video from playing' ) ;
128129 sideEffects . destroy ( 'appending thumbnail' ) ;
129- } ) ,
130- ) ;
130+ } ;
131+ return showThumbnailOverlay ( /** @type {HTMLElement } */ ( targetElement ) , environment , clickHandler ) ;
132+ } ) ;
131133 } else {
132134 sideEffects . destroy ( 'stopping video from playing' ) ;
133135 sideEffects . destroy ( 'appending thumbnail' ) ;
0 commit comments