mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-02-23 12:32:26 +00:00
fix(tv): implement remote control seeking on tv interface
This commit is contained in:
@@ -114,6 +114,25 @@ export const Controls: FC<Props> = ({
|
||||
setShowControls(!showControls);
|
||||
}, [showControls, setShowControls]);
|
||||
|
||||
// Long press seek handlers for continuous seeking
|
||||
const handleSeekForward = useCallback(
|
||||
(seconds: number) => {
|
||||
const newPosition = Math.min(max.value, progress.value + seconds * 1000);
|
||||
progress.value = newPosition;
|
||||
seek(newPosition);
|
||||
},
|
||||
[progress, max, seek],
|
||||
);
|
||||
|
||||
const handleSeekBackward = useCallback(
|
||||
(seconds: number) => {
|
||||
const newPosition = Math.max(min.value, progress.value - seconds * 1000);
|
||||
progress.value = newPosition;
|
||||
seek(newPosition);
|
||||
},
|
||||
[progress, min, seek],
|
||||
);
|
||||
|
||||
// Remote control hook for TV navigation
|
||||
const {
|
||||
remoteScrubProgress,
|
||||
@@ -132,8 +151,8 @@ export const Controls: FC<Props> = ({
|
||||
togglePlay,
|
||||
toggleControls,
|
||||
calculateTrickplayUrl,
|
||||
handleSeekForward: () => {},
|
||||
handleSeekBackward: () => {},
|
||||
handleSeekForward,
|
||||
handleSeekBackward,
|
||||
});
|
||||
|
||||
// Slider hook
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
export const CONTROLS_CONSTANTS = {
|
||||
TIMEOUT: 4000,
|
||||
SCRUB_INTERVAL_MS: 10 * 1000, // 10 seconds in ms
|
||||
SCRUB_INTERVAL_MS: 30 * 1000, // 30 seconds in ms
|
||||
SCRUB_INTERVAL_TICKS: 10 * 10000000, // 10 seconds in ticks
|
||||
TILE_WIDTH: 150,
|
||||
PROGRESS_UNIT_MS: 1000, // 1 second in ms
|
||||
|
||||
Reference in New Issue
Block a user