mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 10:23:24 +00:00
fix slider not triggering idle
This commit is contained in:
@@ -34,6 +34,7 @@ const VideoSlider = ({ onSlidingComplete }: VideoSliderProps) => {
|
|||||||
const tapRef = useRef<TapGestureHandler>(null);
|
const tapRef = useRef<TapGestureHandler>(null);
|
||||||
const panRef = useRef<PanGestureHandler>(null);
|
const panRef = useRef<PanGestureHandler>(null);
|
||||||
const status = usePlayerStore((state) => state.status);
|
const status = usePlayerStore((state) => state.status);
|
||||||
|
const setIsIdle = usePlayerStore((state) => state.setIsIdle);
|
||||||
|
|
||||||
const width = Dimensions.get("screen").width - 200;
|
const width = Dimensions.get("screen").width - 200;
|
||||||
const knobSize_ = 20;
|
const knobSize_ = 20;
|
||||||
@@ -66,6 +67,7 @@ const VideoSlider = ({ onSlidingComplete }: VideoSliderProps) => {
|
|||||||
const _onActive = (value: number) => {
|
const _onActive = (value: number) => {
|
||||||
"worklet";
|
"worklet";
|
||||||
translateX.value = clamp(value, 0, width - knobSize_);
|
translateX.value = clamp(value, 0, width - knobSize_);
|
||||||
|
runOnJS(setIsIdle)(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const onGestureEvent = useAnimatedGestureHandler<
|
const onGestureEvent = useAnimatedGestureHandler<
|
||||||
|
Reference in New Issue
Block a user