block global audio from screens
This commit is contained in:
@@ -2,21 +2,19 @@ import React, { useCallback, useState } from "react";
|
||||
import { Image, StyleSheet, View } from "react-native";
|
||||
import { ai, background } from "../../assets";
|
||||
import BorderGradientButton from "../../components/BorderGradientButton";
|
||||
import FullscreenIntroVideo from "../../components/FullscreenIntroVideo";
|
||||
import GradientButton from "../../components/GradientButton";
|
||||
import MusicLandHeader from "../../components/MusicLandHeader";
|
||||
import Page from "../../layouts/Page";
|
||||
import { Routes } from "../../navigation";
|
||||
import { goBack, navigate } from "../../navigation/NavigationService";
|
||||
import { gutters } from "../../styles";
|
||||
import FullscreenIntroVideo from "../../components/FullscreenIntroVideo";
|
||||
|
||||
const Playback = ({ route }) => {
|
||||
const { project } = route.params;
|
||||
const [showIntro, setShowIntro] = useState(true);
|
||||
|
||||
const onPressRecord = useCallback(() => {
|
||||
// Les timestamps sont désormais générés automatiquement côté serveur
|
||||
// lors de la mise à jour du document (si songUrl existe).
|
||||
navigate(Routes.RecordPlayback, { project });
|
||||
}, [project]);
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { useFocusEffect } from "@react-navigation/native";
|
||||
import useSharedAudioPlayer from "../../hooks/useSharedAudioPlayer";
|
||||
import { CameraView, useCameraPermissions } from "expo-camera";
|
||||
import React, {
|
||||
useCallback,
|
||||
@@ -11,11 +10,12 @@ import React, {
|
||||
import { Text, View } from "react-native";
|
||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||
import Svg, { Circle } from "react-native-svg";
|
||||
import alert from "../../components/Alert";
|
||||
import GradientButton from "../../components/GradientButton";
|
||||
import KaraokeLyrics from "../../components/KaraokeLyrics";
|
||||
import MusicLandHeader from "../../components/MusicLandHeader";
|
||||
import alert from "../../components/Alert";
|
||||
import { increment, projectsRef } from "../../config/firebase";
|
||||
import useSharedAudioPlayer from "../../hooks/useSharedAudioPlayer";
|
||||
import { Routes } from "../../navigation";
|
||||
import { goBack, navigate } from "../../navigation/NavigationService";
|
||||
import { gutters, Palette } from "../../styles";
|
||||
@@ -27,6 +27,7 @@ const TIME_BEFORE_INCREMENT_MS = 20000; // 20s
|
||||
const RecordPlayback = ({ route }) => {
|
||||
const { top, bottom } = useSafeAreaInsets();
|
||||
const { project } = route.params || {};
|
||||
console.log("project is : ", JSON.stringify(project, null, 2));
|
||||
const projectId = project?.id;
|
||||
const songIndex = project?.songIndex;
|
||||
// Permissions
|
||||
@@ -55,9 +56,14 @@ const RecordPlayback = ({ route }) => {
|
||||
// Musique
|
||||
const songUrl = project?.songUrl || null;
|
||||
const player = useSharedAudioPlayer(songUrl ? { uri: songUrl } : undefined, {
|
||||
id: projectId ? `record-${projectId}` : songUrl ? `record-${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",
|
||||
artist:
|
||||
typeof project?.userName === "string" ? project.userName : "MusicLand",
|
||||
artwork: project?.coverUrl || null,
|
||||
coverUrl: project?.coverUrl || null,
|
||||
metadata: { projectId, screen: "RecordPlayback" },
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { useFocusEffect } from "@react-navigation/native";
|
||||
import useSharedAudioPlayer from "../../hooks/useSharedAudioPlayer";
|
||||
import { useCameraPermissions } from "expo-camera";
|
||||
import React, {
|
||||
useCallback,
|
||||
@@ -11,12 +10,13 @@ import React, {
|
||||
import { Text, View } from "react-native";
|
||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||
import Svg, { Circle } from "react-native-svg";
|
||||
import alert from "../../components/Alert";
|
||||
import GradientButton from "../../components/GradientButton";
|
||||
import KaraokeLyrics from "../../components/KaraokeLyrics";
|
||||
import MusicLandHeader from "../../components/MusicLandHeader";
|
||||
import alert from "../../components/Alert";
|
||||
import { increment, projectsRef } from "../../config/firebase";
|
||||
import { isWeb } from "../../hooks/useLayoutType";
|
||||
import useSharedAudioPlayer from "../../hooks/useSharedAudioPlayer";
|
||||
import Page from "../../layouts/Page";
|
||||
import { Routes } from "../../navigation";
|
||||
import { goBack, navigate } from "../../navigation/NavigationService";
|
||||
@@ -62,12 +62,13 @@ const RecordPlayback = ({ route }) => {
|
||||
// Player
|
||||
const songUrl = project?.songUrl || null;
|
||||
const player = useSharedAudioPlayer(songUrl ? { uri: songUrl } : undefined, {
|
||||
id: projectId ? `record-${projectId}` : songUrl ? `record-${songUrl}` : undefined,
|
||||
id: project?.id,
|
||||
title: typeof project?.title === "string" ? project.title : "Sans titre",
|
||||
artist: typeof project?.userName === "string" ? project.userName : "MusicLand",
|
||||
artist:
|
||||
typeof project?.userName === "string" ? project.userName : "MusicLand",
|
||||
artwork: project?.coverUrl || null,
|
||||
coverUrl: project?.coverUrl || null,
|
||||
metadata: { projectId, screen: "RecordPlayback" },
|
||||
metadata: { projectId: project?.id, screen: "RecordPlayback" },
|
||||
});
|
||||
|
||||
// MediaStream / Recorder (web only)
|
||||
|
||||
Reference in New Issue
Block a user