feat: tickets

This commit is contained in:
2025-12-12 09:21:09 +01:00
parent b1ab6a549f
commit c39aaf3f15
6 changed files with 62 additions and 58 deletions
+31 -30
View File
@@ -51,7 +51,7 @@ const pickRecorderMimeType = () => {
for (const mimeType of candidates) {
try {
if (MediaRecorder.isTypeSupported(mimeType)) return mimeType;
} catch {}
} catch { }
}
return undefined;
@@ -135,7 +135,7 @@ const RecordPlayback = ({ route }) => {
progressTimerRef.current =
listenTimerRef.current =
countdownTimerRef.current =
null;
null;
};
const resetUI = () => {
@@ -176,7 +176,7 @@ const RecordPlayback = ({ route }) => {
) {
mediaRecorderRef.current.stop();
}
} catch (e) {}
} catch (e) { }
recordedChunksRef.current = [];
releaseRecordingUrl();
@@ -262,7 +262,7 @@ const RecordPlayback = ({ route }) => {
}
recorder.stop();
}
} catch (e) {}
} catch (e) { }
if (!waitPromise) {
return recordedUrlRef.current || null;
@@ -286,10 +286,10 @@ const RecordPlayback = ({ route }) => {
try {
await player?.pause?.();
await player?.seekTo?.(0);
} catch (e) {}
} catch (e) { }
try {
await stopRecorderAndGetUrl();
} catch (e) {}
} catch (e) { }
if (!preserveRecordingForNextScreenRef.current) {
releaseRecordingUrl();
}
@@ -337,7 +337,7 @@ const RecordPlayback = ({ route }) => {
if (!cameraPermission?.granted) {
await requestCameraPermission();
}
} catch (e) {}
} catch (e) { }
})();
return () => {
clearAllTimers();
@@ -404,13 +404,13 @@ const RecordPlayback = ({ route }) => {
}
const playPromise = video.play?.();
if (playPromise && typeof playPromise.catch === "function") {
playPromise.catch(() => {});
playPromise.catch(() => { });
}
} catch (e) {}
} catch (e) { }
} else {
try {
video.srcObject = null;
} catch {}
} catch { }
}
}, [mediaReady, mediaError]);
@@ -423,7 +423,7 @@ const RecordPlayback = ({ route }) => {
) {
mediaRecorderRef.current.stop();
}
} catch {}
} catch { }
if (mediaStreamRef.current) {
mediaStreamRef.current.getTracks().forEach((track) => track.stop());
mediaStreamRef.current = null;
@@ -439,7 +439,7 @@ const RecordPlayback = ({ route }) => {
clearAllTimers();
try {
await player?.pause?.();
} catch (e) {}
} catch (e) { }
let videoUrl = null;
try {
@@ -447,7 +447,7 @@ const RecordPlayback = ({ route }) => {
if (!videoUrl) {
videoUrl = recordedUrlRef.current || null;
}
} catch (e) {}
} catch (e) { }
setIsRecording(false);
setIsPaused(false);
@@ -473,9 +473,9 @@ const RecordPlayback = ({ route }) => {
const fallback =
perfStartRef.current != null
? Math.max(
0,
(performance.now() - perfStartRef.current - pausedTotal) / 1000,
)
0,
(performance.now() - perfStartRef.current - pausedTotal) / 1000,
)
: 0;
let nextDur = rawDur > 0 ? rawDur : dur || 0;
@@ -492,7 +492,7 @@ const RecordPlayback = ({ route }) => {
await player?.seekTo?.(0);
correctedInitialJumpRef.current = true;
nextPos = 0;
} catch (e) {}
} catch (e) { }
}
const timeSinceStart =
@@ -543,11 +543,11 @@ const RecordPlayback = ({ route }) => {
await projectsRef
.doc(project.id)
.set({ views: increment(1) }, { merge: true });
} catch (e) {}
} catch (e) { }
}
}
}
} catch (e) {}
} catch (e) { }
}, 500);
}, [player, project?.id]);
@@ -585,7 +585,7 @@ const RecordPlayback = ({ route }) => {
onPress: () => {
try {
goBack();
} catch {}
} catch { }
},
},
],
@@ -630,13 +630,13 @@ const RecordPlayback = ({ route }) => {
pausedAtRef.current = performance.now();
try {
await player?.pause?.();
} catch (e) {}
} catch (e) { }
try {
const recorder = mediaRecorderRef.current;
if (recorder && recorder.state === "recording") {
recorder.pause?.();
}
} catch (e) {}
} catch (e) { }
return;
}
const pausedAt = pausedAtRef.current;
@@ -651,17 +651,17 @@ const RecordPlayback = ({ route }) => {
if (recorder && recorder.state === "paused") {
recorder.resume?.();
}
} catch (e) {}
} catch (e) { }
try {
await player?.play?.();
} catch (e) {}
} catch (e) {}
} catch (e) { }
} catch (e) { }
}, [isRecording, player]);
const handleRestartRecording = useCallback(async () => {
try {
await startCountdownThenRecord();
} catch (e) {}
} catch (e) { }
}, [startCountdownThenRecord]);
const progressRatio = dur > 0 ? Math.min(1, pos / dur) : 0;
@@ -669,9 +669,10 @@ const RecordPlayback = ({ route }) => {
return (
<Page
style={{ flex: 1 }}
containerStyle={{ backgroundColor: Palette.tran }}
// containerStyle={{ backgroundColor: Palette.gray }}
headerType="NONE"
backgroundImg={background.playbackBG2}
backgroundColor={Palette.grayMid}
// backgroundImg={background.playbackBG2}
>
<MusicLandHeader progress={9} onPressBack={goBack} />
@@ -895,7 +896,7 @@ const RecordPlayback = ({ route }) => {
try {
if (!cameraPermission?.granted)
await requestCameraPermission();
} catch {}
} catch { }
}}
/>
</View>
@@ -909,7 +910,7 @@ const RecordPlayback = ({ route }) => {
position: "absolute",
left: 0,
right: 0,
bottom: bottom + 130,
bottom: bottom + 180,
paddingHorizontal: gutters,
}}
>