From 71ffbf358579c69aa8f77ffedf2014c84fe3093a Mon Sep 17 00:00:00 2001 From: Developer Date: Wed, 11 Mar 2026 10:30:59 +0800 Subject: [PATCH] fix: simulate landscape via CSS transform when expo-screen-orientation unavailable --- components/VideoPlayer.tsx | 39 ++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/components/VideoPlayer.tsx b/components/VideoPlayer.tsx index 1f2bdb3..3808e25 100644 --- a/components/VideoPlayer.tsx +++ b/components/VideoPlayer.tsx @@ -20,8 +20,10 @@ interface Props { export function VideoPlayer({ playData, qualities, currentQn, onQualityChange, onMiniPlayer, bvid, cid, danmakus, onTimeUpdate }: Props) { const [fullscreen, setFullscreen] = useState(false); - const { width } = useWindowDimensions(); + const { width, height } = useWindowDimensions(); const VIDEO_HEIGHT = width * 0.5625; + // When ScreenOrientation is unavailable (Expo Go), simulate landscape via transform + const needsRotation = !ScreenOrientation && fullscreen; const lastTimeRef = useRef(0); const handleEnterFullscreen = async () => { @@ -85,21 +87,26 @@ export function VideoPlayer({ playData, qualities, currentQn, onQualityChange, o