mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 14:33:26 +00:00
fix: play/pause gesture should affect alternate audio tracks
This commit is contained in:
@@ -64,6 +64,8 @@ export const VideoPlayer = () => {
|
|||||||
const setVideoRef = usePlayerStore((state) => state.setVideoRef);
|
const setVideoRef = usePlayerStore((state) => state.setVideoRef);
|
||||||
const setStatus = usePlayerStore((state) => state.setStatus);
|
const setStatus = usePlayerStore((state) => state.setStatus);
|
||||||
const setIsIdle = usePlayerStore((state) => state.setIsIdle);
|
const setIsIdle = usePlayerStore((state) => state.setIsIdle);
|
||||||
|
const playAudio = usePlayerStore((state) => state.playAudio);
|
||||||
|
const pauseAudio = usePlayerStore((state) => state.pauseAudio);
|
||||||
|
|
||||||
const checkGestureInSliderVicinity = (x: number, y: number) => {
|
const checkGestureInSliderVicinity = (x: number, y: number) => {
|
||||||
isGestureInSliderVicinity.value = isPointInSliderVicinity(x, y);
|
isGestureInSliderVicinity.value = isPointInSliderVicinity(x, y);
|
||||||
@@ -85,6 +87,11 @@ export const VideoPlayer = () => {
|
|||||||
|
|
||||||
const togglePlayback = () => {
|
const togglePlayback = () => {
|
||||||
setShouldPlay(!shouldPlay);
|
setShouldPlay(!shouldPlay);
|
||||||
|
if (shouldPlay) {
|
||||||
|
void pauseAudio();
|
||||||
|
} else {
|
||||||
|
void playAudio();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const doubleTapGesture = Gesture.Tap()
|
const doubleTapGesture = Gesture.Tap()
|
||||||
|
Reference in New Issue
Block a user