Remove onEndGestureHandler
This commit is contained in:
parent
92942bc07e
commit
5899dc890f
|
@ -40,7 +40,6 @@ const Seek = ({ currentTime, duration, loaded = false, onChangeTime }: ISeek) =>
|
||||||
const timePosition = useSharedValue(0);
|
const timePosition = useSharedValue(0);
|
||||||
const timeLabel = useSharedValue(DEFAULT_TIME_LABEL);
|
const timeLabel = useSharedValue(DEFAULT_TIME_LABEL);
|
||||||
const scale = useSharedValue(1);
|
const scale = useSharedValue(1);
|
||||||
const onEndGestureHandler = useSharedValue(false);
|
|
||||||
const isTimeChanged = useSharedValue(false);
|
const isTimeChanged = useSharedValue(false);
|
||||||
|
|
||||||
const styleLine = useAnimatedStyle(() => ({
|
const styleLine = useAnimatedStyle(() => ({
|
||||||
|
@ -68,18 +67,7 @@ const Seek = ({ currentTime, duration, loaded = false, onChangeTime }: ISeek) =>
|
||||||
},
|
},
|
||||||
onEnd: () => {
|
onEnd: () => {
|
||||||
scale.value = 1;
|
scale.value = 1;
|
||||||
onEndGestureHandler.value = true;
|
runOnJS(onChangeTime)(Math.round(currentTime.value * 1000));
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const wrapper = async (time: number) => {
|
|
||||||
await onChangeTime(Math.round(time * 1000));
|
|
||||||
onEndGestureHandler.value = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
useDerivedValue(() => {
|
|
||||||
if (onEndGestureHandler.value) {
|
|
||||||
runOnJS(wrapper)(currentTime.value);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue