Disables body scroll when in fullscreen mode

Prevents the body from scrolling when the player is in fullscreen mode, enhancing the user experience.

Re-enables body scroll when exiting fullscreen.
This commit is contained in:
JSC
2025-08-09 21:53:17 +02:00
parent 0ddad5010a
commit 59f160609b

View File

@@ -79,6 +79,22 @@ export function Player({ className }: PlayerProps) {
} }
}, []) }, [])
// Handle body scroll when in fullscreen
useEffect(() => {
if (displayMode === 'maximized') {
// Disable body scroll
document.body.style.overflow = 'hidden'
} else {
// Re-enable body scroll
document.body.style.overflow = 'unset'
}
// Cleanup when component unmounts
return () => {
document.body.style.overflow = 'unset'
}
}, [displayMode])
const executeAction = useCallback(async (action: () => Promise<void | MessageResponse>, actionName: string) => { const executeAction = useCallback(async (action: () => Promise<void | MessageResponse>, actionName: string) => {
setIsLoading(true) setIsLoading(true)
try { try {