Spaces:
Running
Running
Update youtube.html
Browse files89 unmodified lines909192939495961 unmodified line9899100101102103920 unmodified lines102410251026102710281029103010311032103310341035103610379 unmodified lines1047104810491050105110527 unmodified lines10601061106210631064106510661067106810699 unmodified lines107910801081108210831084108510861087143 unmodified lines123112321233123412351236123789 unmodified lines.modal-header-actions { display: flex; flex-wrap: wrap; gap: clamp(5px, 2vw, 10px); margin-bottom: 15px; padding-right: clamp(30px, 8vw, 40px); align-items: center; }.modal-header-actions .btn-action { flex: 1 1 auto; }/* PLAYER OVERLAY & UNFREEZE FIX */#player-overlay {display: none;position: fixed;1 unmodified linebackground: #000;z-index: 9999;pointer-events: auto;}#player-menu-btn {920 unmodified lineslet currentOrientationIsLandscape = true;async function syncPlayerOrientation() {if (document.getElementById('player-overlay').style.display !== 'block') return;if (!screen.orientation || !screen.orientation.lock) return;const target = currentOrientationIsLandscape ? 'landscape' : 'portrait';try {await screen.orientation.lock(target).catch(()=>{});} catch(e) {console.log("Re-lock orientation note:", e);}}9 unmodified linescurrentOrientationIsLandscape = (targetOrientation === 'landscape');if (!screen.orientation || !screen.orientation.lock) return;try {7 unmodified linesfor (let i = 1; i < sequenceCount; i++) {await new Promise(r => setTimeout(r, 400));const nextOrient = (i % 2 === 1) ? oppositeOrientation : targetOrientation;await screen.orientation.lock(nextOrient).catch(()=>{});}currentOrientationIsLandscape = (sequenceCount % 2 === 1) ? (targetOrientation === 'landscape') : (targetOrientation !== 'landscape');}} catch(e) {console.log("Orientation sequence notice:", e);9 unmodified lines}document.addEventListener('fullscreenchange', () => {if (!document.fullscreenElement && screen.orientation && screen.orientation.unlock) {screen.orientation.unlock();} else if (document.fullscreenElement) {syncPlayerOrientation();}});143 unmodified lines}function closePlayer() {document.getElementById('player-overlay').style.display = 'none';hidePlayerMenu();if(ytPlayer) { try { ytPlayer.stopVideo(); ytPlayer.destroy(); } catch(e){} ytPlayer = null; }if (saveInterval) clearTimeout(saveInterval);89 unmodified lines909192939495961 unmodified line9899100101102103104105106107108109110111112113114115920 unmodified lines1036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810599 unmodified lines10691070107110721073107410751076107710781079108010817 unmodified lines108910901091109210931094109510961097109810999 unmodified lines1109111011111112111311141115143 unmodified lines12591260126112621263126412651266126789 unmodified lines.modal-header-actions { display: flex; flex-wrap: wrap; gap: clamp(5px, 2vw, 10px); margin-bottom: 15px; padding-right: clamp(30px, 8vw, 40px); align-items: center; }.modal-header-actions .btn-action { flex: 1 1 auto; }/* PLAYER OVERLAY & ROTATION FIX */#player-overlay {display: none;position: fixed;1 unmodified linebackground: #000;z-index: 9999;pointer-events: auto;transition: transform 0.3s ease;}#player-overlay.rotated-portrait {transform: rotate(90deg);transform-origin: center center;width: 100vh !important;height: 100vw !important;top: 50% !important;left: 50% !important;margin-top: -50vw !important;margin-left: -50vh !important;}#player-menu-btn {920 unmodified lineslet currentOrientationIsLandscape = true;async function syncPlayerOrientation() {const overlay = document.getElementById('player-overlay');if (!overlay || overlay.style.display !== 'block') return;const target = currentOrientationIsLandscape ? 'landscape' : 'portrait';// Apply CSS rotation class if portrait mode is forced on a landscape playerif (!currentOrientationIsLandscape) {overlay.classList.add('rotated-portrait');} else {overlay.classList.remove('rotated-portrait');}if (screen.orientation && screen.orientation.lock) {try {await screen.orientation.lock(target).catch(()=>{});} catch(e) {console.log("Re-lock orientation note:", e);}}}9 unmodified linescurrentOrientationIsLandscape = (targetOrientation === 'landscape');const overlay = document.getElementById('player-overlay');if (!currentOrientationIsLandscape) {overlay.classList.add('rotated-portrait');} else {overlay.classList.remove('rotated-portrait');}if (!screen.orientation || !screen.orientation.lock) return;try {7 unmodified linesfor (let i = 1; i < sequenceCount; i++) {await new Promise(r => setTimeout(r, 400));const nextOrient = (i % 2 === 1) ? oppositeOrientation : targetOrientation;currentOrientationIsLandscape = (nextOrient === 'landscape');if (!currentOrientationIsLandscape) overlay.classList.add('rotated-portrait');else overlay.classList.remove('rotated-portrait');await screen.orientation.lock(nextOrient).catch(()=>{});}}} catch(e) {console.log("Orientation sequence notice:", e);9 unmodified lines}document.addEventListener('fullscreenchange', () => {if (document.fullscreenElement) {syncPlayerOrientation();}});143 unmodified lines}function closePlayer() {const overlay = document.getElementById('player-overlay');overlay.style.display = 'none';overlay.classList.remove('rotated-portrait');hidePlayerMenu();if(ytPlayer) { try { ytPlayer.stopVideo(); ytPlayer.destroy(); } catch(e){} ytPlayer = null; }if (saveInterval) clearTimeout(saveInterval);
youtube.html+43-13