global player
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useFocusEffect } from "@react-navigation/native";
|
||||
import { useAudioPlayer } from "expo-audio";
|
||||
import useSharedAudioPlayer from "../../hooks/useSharedAudioPlayer";
|
||||
import { useCameraPermissions } from "expo-camera";
|
||||
import React, {
|
||||
useCallback,
|
||||
@@ -61,7 +61,14 @@ const RecordPlayback = ({ route }) => {
|
||||
|
||||
// Player
|
||||
const songUrl = project?.songUrl || null;
|
||||
const player = useAudioPlayer(songUrl ? { uri: songUrl } : undefined);
|
||||
const player = useSharedAudioPlayer(songUrl ? { uri: songUrl } : undefined, {
|
||||
id: projectId ? `record-${projectId}` : songUrl ? `record-${songUrl}` : undefined,
|
||||
title: typeof project?.title === "string" ? project.title : "Sans titre",
|
||||
artist: typeof project?.userName === "string" ? project.userName : "MusicLand",
|
||||
artwork: project?.coverUrl || null,
|
||||
coverUrl: project?.coverUrl || null,
|
||||
metadata: { projectId, screen: "RecordPlayback" },
|
||||
});
|
||||
|
||||
// MediaStream / Recorder (web only)
|
||||
const previewVideoRef = useRef(null);
|
||||
|
||||
Reference in New Issue
Block a user