Added feature to prefetch trick-play images on video start rather than downloading it while scrubbing

This commit is contained in:
Alex Kim
2024-12-06 17:41:42 +11:00
parent 40bdb10653
commit 6ec6c6daa0
2 changed files with 47 additions and 6 deletions

View File

@@ -113,10 +113,12 @@ export const Controls: React.FC<Props> = ({
const insets = useSafeAreaInsets();
const { previousItem, nextItem } = useAdjacentItems({ item });
const { trickPlayUrl, calculateTrickplayUrl, trickplayInfo } = useTrickplay(
item,
!offline && enableTrickplay
);
const {
trickPlayUrl,
calculateTrickplayUrl,
trickplayInfo,
prefetchAllTrickplayImages,
} = useTrickplay(item, !offline && enableTrickplay);
const [currentTime, setCurrentTime] = useState(0);
const [remainingTime, setRemainingTime] = useState(0);
@@ -239,6 +241,10 @@ export const Controls: React.FC<Props> = ({
}
}, [item, isVlc]);
useEffect(() => {
prefetchAllTrickplayImages();
}, []);
const toggleControls = () => setShowControls(!showControls);
const handleSliderComplete = useCallback(