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