Auto-collapse inactive YouTube panel

This commit is contained in:
codex
2026-06-09 22:58:34 +02:00
parent 9f67be21fa
commit 1c61bbbb62
+6 -1
View File
@@ -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;