From 9f721c22d5927743df47e9386638c7890b5005f4 Mon Sep 17 00:00:00 2001 From: zimplexing Date: Tue, 8 Jul 2025 17:03:15 +0800 Subject: [PATCH] Implement back navigation and control visibility in PlayScreen - Added back navigation functionality using the router in PlayScreen. - Implemented hardware back button handling to toggle controls visibility. - Updated useTVRemoteHandler to show controls on down key press. --- app/play.tsx | 20 ++++++++++++++++++-- hooks/useTVRemoteHandler.ts | 3 +++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/app/play.tsx b/app/play.tsx index 834dd8d..e14b75d 100644 --- a/app/play.tsx +++ b/app/play.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useRef } from "react"; -import { View, StyleSheet, TouchableOpacity, ActivityIndicator } from "react-native"; -import { useLocalSearchParams } from "expo-router"; +import { View, StyleSheet, TouchableOpacity, ActivityIndicator, BackHandler } from "react-native"; +import { useLocalSearchParams, useRouter } from "expo-router"; import { Video, ResizeMode } from "expo-av"; import { useKeepAwake } from "expo-keep-awake"; import { ThemedView } from "@/components/ThemedView"; @@ -14,6 +14,7 @@ import { useTVRemoteHandler } from "@/hooks/useTVRemoteHandler"; export default function PlayScreen() { const videoRef = useRef