录制优化

This commit is contained in:
yj 2024-08-19 13:47:02 +08:00
parent eee009ab9f
commit 70f15b2666
1 changed files with 8 additions and 4 deletions

View File

@ -624,10 +624,14 @@ const Meeting: React.FC = () => {
} }
} as any } as any
}).then(async (steam) => { }).then(async (steam) => {
const audioTracks = await navigator.mediaDevices try {
.getUserMedia({ audio: true, video: false }) const audioTracks = await navigator.mediaDevices
.then(audioStream => audioStream.getAudioTracks()[0]); .getUserMedia({ audio: true, video: false })
steam.addTrack(audioTracks); .then(audioStream => audioStream.getAudioTracks()[0]);
steam.addTrack(audioTracks);
} catch (error) {
}
setMediaStream(steam) setMediaStream(steam)
setRecorder(new MediaRecorder(steam)) setRecorder(new MediaRecorder(steam))
}) })