Merge pull request #1218 from MiepHD/fix-wrong-position-of-video-toggle-on-fullscreen

Fixes the video-toggle being displayed at the wrong position on fullscreen
This commit is contained in:
th-ch
2023-09-03 19:51:20 +02:00
committed by GitHub

View File

@ -38,7 +38,7 @@ function setup(e) {
player = $('ytmusic-player');
video = $('video');
$('#main-panel').append(switchButtonDiv);
$('#player').prepend(switchButtonDiv);
if (options.hideVideo) {
$('.video-switch-button-checkbox').checked = false;
@ -48,6 +48,11 @@ function setup(e) {
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) => {
options.hideVideo = !e.target.checked;