mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-14 20:01:47 +00:00
fix: Fixes the video-toggle being displayed at the wrong position on fullscreen (#1218)
Co-authored-by: MiepHD <63968466+MiepHD@users.noreply.github.com>
This commit is contained in:
@ -52,7 +52,7 @@ function setup(e: CustomEvent<YoutubePlayer>) {
|
|||||||
player = $('ytmusic-player') as typeof player;
|
player = $('ytmusic-player') as typeof player;
|
||||||
video = $('video') as HTMLVideoElement;
|
video = $('video') as HTMLVideoElement;
|
||||||
|
|
||||||
($('#main-panel') as HTMLVideoElement).append(switchButtonDiv);
|
($('#player') as HTMLVideoElement).prepend(switchButtonDiv);
|
||||||
|
|
||||||
if (options.hideVideo) {
|
if (options.hideVideo) {
|
||||||
($('.video-switch-button-checkbox') as HTMLInputElement).checked = false;
|
($('.video-switch-button-checkbox') as HTMLInputElement).checked = false;
|
||||||
@ -62,6 +62,11 @@ function setup(e: CustomEvent<YoutubePlayer>) {
|
|||||||
video.style.height = 'auto';
|
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
|
// Button checked = show video
|
||||||
switchButtonDiv.addEventListener('change', (e) => {
|
switchButtonDiv.addEventListener('change', (e) => {
|
||||||
const target = e.target as HTMLInputElement;
|
const target = e.target as HTMLInputElement;
|
||||||
|
|||||||
Reference in New Issue
Block a user