From 2d132d7b66ea7354729cce46ab59d42e318152e2 Mon Sep 17 00:00:00 2001 From: mtvpls Date: Sun, 28 Dec 2025 23:08:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BD=91=E9=A1=B5=E5=85=A8?= =?UTF-8?q?=E5=B1=8F=E8=BF=98=E6=98=BE=E7=A4=BA=E9=A1=B6=E9=83=A8=E5=92=8C?= =?UTF-8?q?=E5=BA=95=E9=83=A8=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/play/page.tsx | 15 +++++++++++--- src/components/PageLayout.tsx | 37 ++++++++++++++++++++++------------- 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/src/app/play/page.tsx b/src/app/play/page.tsx index aa370d0..99e394e 100644 --- a/src/app/play/page.tsx +++ b/src/app/play/page.tsx @@ -104,6 +104,9 @@ function PlayPageClient() { // 网盘搜索弹窗状态 const [showPansouDialog, setShowPansouDialog] = useState(false); + // 网页全屏状态 - 控制导航栏的显示隐藏 + const [isWebFullscreen, setIsWebFullscreen] = useState(false); + // 跳过片头片尾配置 const [skipConfig, setSkipConfig] = useState<{ enable: boolean; @@ -4248,6 +4251,12 @@ function PlayPageClient() { lastPlaybackRateRef.current = artPlayerRef.current.playbackRate; }); + // 监听网页全屏事件,控制导航栏显示隐藏 + artPlayerRef.current.on('fullscreenWeb', (isFullscreen: boolean) => { + console.log('网页全屏状态变化:', isFullscreen); + setIsWebFullscreen(isFullscreen); + }); + // 监听视频可播放事件,这时恢复播放进度更可靠 artPlayerRef.current.on('video:canplay', () => { // 若存在需要恢复的播放进度,则跳转 @@ -4509,7 +4518,7 @@ function PlayPageClient() { if (loading) { return ( - +
{/* 动画影院图标 */} @@ -4601,7 +4610,7 @@ function PlayPageClient() { if (error) { return ( - +
{/* 错误图标 */} @@ -4668,7 +4677,7 @@ function PlayPageClient() { } return ( - + {/* TMDB背景图 */} {tmdbBackdrop && (
{ +const PageLayout = ({ children, activePath = '/', hideNavigation = false }: PageLayoutProps) => { return (
{/* 移动端头部 */} - + {!hideNavigation && ( + + )} {/* 主要布局容器 */}
{/* 侧边栏 - 桌面端显示,移动端隐藏 */} -
- -
+ {!hideNavigation && ( +
+ +
+ )} {/* 主内容区域 */}
{/* 桌面端左上角返回按钮 */} - {['/play', '/live'].includes(activePath) && ( + {!hideNavigation && ['/play', '/live'].includes(activePath) && (
)} {/* 桌面端顶部按钮 */} -
- - - -
+ {!hideNavigation && ( +
+ + + +
+ )} {/* 主内容 */}
{
{/* 移动端底部导航 */} -
- -
+ {!hideNavigation && ( +
+ +
+ )}
);