import React, { useEffect, useRef } from 'react'; import { View, StyleSheet, TouchableOpacity, ActivityIndicator } from 'react-native'; import { useLocalSearchParams } from 'expo-router'; import { Video, ResizeMode } from 'expo-av'; import { useKeepAwake } from 'expo-keep-awake'; import { ThemedView } from '@/components/ThemedView'; import { PlayerControls } from '@/components/PlayerControls'; import { EpisodeSelectionModal } from '@/components/EpisodeSelectionModal'; import { NextEpisodeOverlay } from '@/components/NextEpisodeOverlay'; import { LoadingOverlay } from '@/components/LoadingOverlay'; import usePlayerStore from '@/stores/playerStore'; import { useTVRemoteHandler } from '@/hooks/useTVRemoteHandler'; export default function PlayScreen() { const videoRef = useRef