import { useCallback, useEffect, useRef, useState } from 'react' import { createPortal } from 'react-dom' import { Captions, CaptionsOff, Check, ChevronDown, FastForward, Layers, ListVideo, Loader2, Lock, Maximize, Minimize, Pause, PictureInPicture, Play, Rewind, Rotate3d, Settings2, SkipBack, SkipForward, Timer, Volume2, VolumeX, } from 'lucide-react' import type { SubtitleTrack } from '../api/subtitles' import type { PlaybackQuality } from '../types' import type { Vr360Profile } from '../utils/vr360' import { formatPlaybackRate, normalizePlaybackRate, PLAYBACK_RATE_OPTIONS, stepPlaybackRate, } from '../utils/playbackRate' import type { SubtitleChineseMode } from '../utils/subtitleChinese' import { SUBTITLE_POSITION_OPTIONS, SUBTITLE_STYLE_OPTIONS, type SubtitlePosition, type SubtitleStylePreset, } from '../utils/subtitleDisplay' import { PLAYER_ICON_BUTTON, PLAYER_MENU_DIVIDER, PLAYER_MENU_ITEM, PLAYER_MENU_LABEL, PLAYER_POPOVER, PLAYER_RANGE_OVERLAY, PLAYER_SHEET, PLAYER_SHEET_BODY, PLAYER_SHEET_HEADER, PLAYER_TEXT_BUTTON, PLAYER_TRACK, PLAYER_TRACK_FILL, } from './playerTheme' // PlayerControls — 底部操作栏(自绘,替代原生