Auto-collapse inactive YouTube panel
This commit is contained in:
+6
-1
@@ -56,7 +56,7 @@ function applyStoredWatchHeight() {
|
||||
if (savedHeight > 0) {
|
||||
stage.style.setProperty("--watch-panel-height", `${savedHeight}px`);
|
||||
}
|
||||
setWatchCollapsed(localStorage.getItem(watchCollapsedStorageKey) === "true");
|
||||
setWatchCollapsed(true);
|
||||
}
|
||||
|
||||
function setWatchCollapsed(collapsed) {
|
||||
@@ -327,9 +327,14 @@ async function applyWatchState(state) {
|
||||
if (!currentYoutubeVideoId) {
|
||||
youtubePlayer?.stopVideo?.();
|
||||
youtubeShell.classList.remove("is-active");
|
||||
setWatchCollapsed(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (state.playing) {
|
||||
setWatchCollapsed(false);
|
||||
}
|
||||
|
||||
youtubeShell.classList.add("is-active");
|
||||
const player = await ensureYoutubePlayer();
|
||||
applyingWatchStateUntil = Date.now() + 1200;
|
||||
|
||||
Reference in New Issue
Block a user