1
0
mirror of https://github.com/mifi/lossless-cut.git synced 2024-11-21 18:02:35 +01:00

fix types

This commit is contained in:
Mikael Finstad 2024-08-06 00:54:20 +02:00
parent fbd57b625b
commit 94df449d12
No known key found for this signature in database
GPG Key ID: 25AB36E3E81CBC26

View File

@ -297,7 +297,7 @@ function App() {
if (videoRef.current) videoRef.current.volume = playbackVolume;
}, [playbackVolume]);
const seekAbs = useCallback((val) => {
const seekAbs = useCallback((val: number | undefined) => {
const video = videoRef.current;
if (video == null || val == null || Number.isNaN(val)) return;
let outVal = val;
@ -438,19 +438,20 @@ function App() {
userSeekAbs(videoRef.current!.currentTime + val);
}, [userSeekAbs]);
const seekRelPercent = useCallback((val) => {
const seekRelPercent = useCallback((val: number) => {
if (!isDurationValid(zoomedDuration)) return;
seekRel(val * zoomedDuration);
}, [seekRel, zoomedDuration]);
const onTimelineWheel = useTimelineScroll({ wheelSensitivity, mouseWheelZoomModifierKey, invertTimelineScroll, zoomRel, seekRel });
const shortStep = useCallback((direction) => {
const shortStep = useCallback((direction: number) => {
// If we don't know fps, just assume 30 (for example if unknown audio file)
const fps = detectedFps || 30;
// try to align with frame
const currentTimeNearestFrameNumber = getFrameCountRaw(fps, videoRef.current!.currentTime);
invariant(currentTimeNearestFrameNumber != null);
const nextFrame = currentTimeNearestFrameNumber + direction;
userSeekAbs(nextFrame / fps);
}, [detectedFps, userSeekAbs]);