mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 13:13:25 +00:00
feat: finish audiotrack switching
This commit is contained in:
@@ -5,6 +5,8 @@ import { usePlayerStore } from "~/stores/player/store";
|
||||
export const PlayButton = () => {
|
||||
const videoRef = usePlayerStore((state) => state.videoRef);
|
||||
const status = usePlayerStore((state) => state.status);
|
||||
const playAudio = usePlayerStore((state) => state.playAudio);
|
||||
const pauseAudio = usePlayerStore((state) => state.pauseAudio);
|
||||
|
||||
return (
|
||||
<FontAwesome
|
||||
@@ -17,10 +19,12 @@ export const PlayButton = () => {
|
||||
videoRef?.pauseAsync().catch(() => {
|
||||
console.log("Error pausing video");
|
||||
});
|
||||
void pauseAudio();
|
||||
} else {
|
||||
videoRef?.playAsync().catch(() => {
|
||||
console.log("Error playing video");
|
||||
});
|
||||
void playAudio();
|
||||
}
|
||||
}
|
||||
}}
|
||||
|
Reference in New Issue
Block a user