import React, { useState, useRef, useEffect } from 'react'; import { View, StyleSheet, Text, Platform, Modal, StatusBar, useWindowDimensions } from 'react-native'; import { Image } from 'expo-image'; // expo-screen-orientation requires a dev build; gracefully degrade in Expo Go let ScreenOrientation: typeof import('expo-screen-orientation') | null = null; try { ScreenOrientation = require('expo-screen-orientation'); } catch {} import { NativeVideoPlayer, type NativeVideoPlayerRef } from './NativeVideoPlayer'; import type { PlayUrlResponse, DanmakuItem } from '../services/types'; import { useTheme } from '../utils/theme'; interface Props { playData: PlayUrlResponse | null; qualities: { qn: number; desc: string }[]; currentQn: number; onQualityChange: (qn: number) => void; bvid?: string; cid?: number; danmakus?: DanmakuItem[]; onTimeUpdate?: (t: number) => void; initialTime?: number; /** 详情页将其挂到弹幕 Sheet 的打开动作。仅小窗口生效,全屏暂不显示。 */ onDanmakuListPress?: () => void; /** 播放器左上角返回按钮回调,跟随小窗口控制栏一起显隐。 */ onBack?: () => void; /** 视频封面 URL。playData 未到达 /