fix: app not reporting playback started on first start

This commit is contained in:
Fredrik Burmester
2024-09-29 14:48:51 +02:00
parent c7e10a13b5
commit 1c2578477a
2 changed files with 8 additions and 7 deletions

View File

@@ -29,6 +29,7 @@ import {
parseM3U8ForSubtitles,
SubtitleTrack,
} from "@/utils/hls/parseM3U8ForSubtitles";
import { useRouter } from "expo-router";
export type CurrentlyPlayingState = {
url: string;
@@ -70,6 +71,8 @@ export const PlaybackProvider: React.FC<{ children: ReactNode }> = ({
const [api] = useAtom(apiAtom);
const [user] = useAtom(userAtom);
const router = useRouter();
const videoRef = useRef<VideoRef | null>(null);
const [settings] = useSettings();
@@ -326,6 +329,7 @@ export const PlaybackProvider: React.FC<{ children: ReactNode }> = ({
} else if (command === "Stop") {
console.log("Command ~ Stop");
stopPlayback();
router.canGoBack() && router.back();
} else if (command === "Mute") {
console.log("Command ~ Mute");
setVolume(0);