Fix/tv interface android (#1576)

Signed-off-by: Lance Chant <13349722+lancechant@users.noreply.github.com>
This commit is contained in:
lance chant
2026-05-22 09:43:04 +02:00
committed by GitHub
parent 11a4f14732
commit f8a84e34fd
10 changed files with 115 additions and 37 deletions

View File

@@ -543,11 +543,6 @@ export default function page() {
],
);
/** Gets the initial playback position in seconds. */
const _startPosition = useMemo(() => {
return ticksToSeconds(getInitialPlaybackTicks());
}, [getInitialPlaybackTicks]);
/** Build video source config for MPV */
const videoSource = useMemo<MpvVideoSource | undefined>(() => {
if (!stream?.url) return undefined;
@@ -1104,6 +1099,13 @@ export default function page() {
applySubtitleSettings();
}, [isVideoLoaded, settings]);
// Seek to resume position after file is loaded (MPV_EVENT_FILE_LOADED)
useEffect(() => {
if (!tracksReady || !videoRef.current) return;
const ticks = getInitialPlaybackTicks();
videoRef.current?.seekTo?.(ticksToSeconds(ticks));
}, [tracksReady, getInitialPlaybackTicks]);
// Apply initial playback speed when video loads
useEffect(() => {
if (!isVideoLoaded || !videoRef.current) return;