fix(player): replace public stream URL with internal proxy path
CD — Kai-Sa-Cam Deployment / deploy (push) Successful in 11s
CD — Kai-Sa-Cam Deployment / deploy (push) Successful in 11s
This commit is contained in:
@@ -18,6 +18,26 @@ export function useRecorder({
|
||||
const isRecordingRef = useRef(isRecording);
|
||||
isRecordingRef.current = isRecording;
|
||||
|
||||
useEffect(() => {
|
||||
fetch("/api/recordings/status")
|
||||
.then((res) => res.json())
|
||||
.then((data) => {
|
||||
if (data.isRecording) {
|
||||
setIsRecording(true);
|
||||
startTimeRef.current = data.startTime || Date.now();
|
||||
onStart?.();
|
||||
intervalRef.current = window.setInterval(() => {
|
||||
onTimeUpdate?.(
|
||||
Math.floor(
|
||||
(Date.now() - (startTimeRef.current || Date.now())) / 1000,
|
||||
),
|
||||
);
|
||||
}, 1000);
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
}, [onStart, onTimeUpdate]);
|
||||
|
||||
const stopRecording = useCallback(async () => {
|
||||
setError(null);
|
||||
try {
|
||||
|
||||
@@ -65,7 +65,7 @@ export function useTalk({ gain = 1 }: UseTalkOptions = {}) {
|
||||
|
||||
const source = audioContext.createMediaStreamSource(stream);
|
||||
const gainNode = audioContext.createGain();
|
||||
gainNode.gain.value = gain;
|
||||
gainNode.gain.value = gain * 2;
|
||||
gainNodeRef.current = gainNode;
|
||||
|
||||
source.connect(gainNode);
|
||||
|
||||
Reference in New Issue
Block a user