mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-09 17:51:46 +00:00
fix: maybe fix #3613
This commit is contained in:
@ -314,38 +314,37 @@ export default createPlugin({
|
||||
};
|
||||
|
||||
if (config.mode !== 'native' && config.mode != 'disabled') {
|
||||
document
|
||||
.querySelector<HTMLVideoElement>('#player')
|
||||
?.prepend(switchButtonContainer);
|
||||
setTimeout(() => {
|
||||
const playerSelector =
|
||||
document.querySelector<HTMLVideoElement>('#player');
|
||||
if (!playerSelector) return;
|
||||
|
||||
setVideoState(!config.hideVideo);
|
||||
forcePlaybackMode();
|
||||
// Fix black video
|
||||
if (video) {
|
||||
video.style.height = 'auto';
|
||||
}
|
||||
|
||||
video?.addEventListener('ytmd:src-changed', videoStarted);
|
||||
|
||||
observeThumbnail();
|
||||
videoStarted();
|
||||
|
||||
switch (config.align) {
|
||||
case 'right': {
|
||||
switchButtonContainer.style.justifyContent = 'flex-end';
|
||||
return;
|
||||
playerSelector.prepend(switchButtonContainer);
|
||||
setVideoState(!config.hideVideo);
|
||||
forcePlaybackMode();
|
||||
if (video) {
|
||||
video.style.height = 'auto';
|
||||
}
|
||||
video?.addEventListener('ytmd:src-changed', videoStarted);
|
||||
observeThumbnail();
|
||||
videoStarted();
|
||||
switch (config.align) {
|
||||
case 'right': {
|
||||
switchButtonContainer.style.justifyContent = 'flex-end';
|
||||
return;
|
||||
}
|
||||
|
||||
case 'middle': {
|
||||
switchButtonContainer.style.justifyContent = 'center';
|
||||
return;
|
||||
}
|
||||
case 'middle': {
|
||||
switchButtonContainer.style.justifyContent = 'center';
|
||||
return;
|
||||
}
|
||||
|
||||
default:
|
||||
case 'left': {
|
||||
switchButtonContainer.style.justifyContent = 'flex-start';
|
||||
default:
|
||||
case 'left': {
|
||||
switchButtonContainer.style.justifyContent = 'flex-start';
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 0);
|
||||
}
|
||||
},
|
||||
onConfigChange(newConfig) {
|
||||
|
||||
Reference in New Issue
Block a user