Add toast notifications for intro and outro time settings, update player store and media button for new time tracking

This commit is contained in:
zimplexing
2025-07-08 22:07:14 +08:00
parent 5043b33222
commit 30724a1e19
10 changed files with 135 additions and 32 deletions

View File

@@ -4,6 +4,7 @@ import { Stack } from "expo-router";
import * as SplashScreen from "expo-splash-screen";
import { useEffect } from "react";
import { Platform } from "react-native";
import Toast from "react-native-toast-message";
import { useSettingsStore } from "@/stores/settingsStore";
@@ -43,6 +44,7 @@ export default function RootLayout() {
<Stack.Screen name="search" options={{ headerShown: false }} />
<Stack.Screen name="+not-found" />
</Stack>
<Toast />
</ThemeProvider>
);
}

View File

@@ -34,6 +34,7 @@ export default function PlayScreen() {
showSourceModal,
showNextEpisodeOverlay,
initialPosition,
introEndTime,
setVideoRef,
loadVideo,
playEpisode,
@@ -102,8 +103,9 @@ export default function PlayScreen() {
resizeMode={ResizeMode.CONTAIN}
onPlaybackStatusUpdate={handlePlaybackStatusUpdate}
onLoad={() => {
if (initialPosition > 0) {
videoRef.current?.setPositionAsync(initialPosition);
const jumpPosition = introEndTime || initialPosition;
if (jumpPosition > 0) {
videoRef.current?.setPositionAsync(jumpPosition);
}
usePlayerStore.setState({ isLoading: false });
}}