diff --git a/plugins/video-toggle/front.ts b/plugins/video-toggle/front.ts index 839b899f..bac2d9da 100644 --- a/plugins/video-toggle/front.ts +++ b/plugins/video-toggle/front.ts @@ -52,7 +52,7 @@ function setup(e: CustomEvent) { player = $('ytmusic-player') as typeof player; video = $('video') as HTMLVideoElement; - ($('#main-panel') as HTMLVideoElement).append(switchButtonDiv); + ($('#player') as HTMLVideoElement).prepend(switchButtonDiv); if (options.hideVideo) { ($('.video-switch-button-checkbox') as HTMLInputElement).checked = false; @@ -62,6 +62,11 @@ function setup(e: CustomEvent) { video.style.height = 'auto'; } + //Prevents bubbling to the player which causes it to stop or resume + switchButtonDiv.addEventListener('click', (e) => { + e.stopPropagation(); + }); + // Button checked = show video switchButtonDiv.addEventListener('change', (e) => { const target = e.target as HTMLInputElement;