From ca2b9b9ee93b7d1ac9a6c342441017276e1ace93 Mon Sep 17 00:00:00 2001 From: RB Date: Mon, 4 Mar 2024 17:30:55 +0800 Subject: [PATCH] audio --- src/main/resources/web/assets/js/media-capturer.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/web/assets/js/media-capturer.js b/src/main/resources/web/assets/js/media-capturer.js index a9af771d2..fb2fa746c 100644 --- a/src/main/resources/web/assets/js/media-capturer.js +++ b/src/main/resources/web/assets/js/media-capturer.js @@ -129,7 +129,8 @@ class MediaCapturer extends RbModal { return } - const ps = { video: true } + // https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia + const ps = { video: true, audio: true } if (deviceId) ps.video = { deviceId: deviceId } navigator.mediaDevices .getUserMedia(ps) @@ -143,8 +144,7 @@ class MediaCapturer extends RbModal { }) this._mediaRecorder.addEventListener('stop', () => { this._capturedData = new Blob(this._blobs, { type: 'video/mp4' }) - const videoBlobURL = URL.createObjectURL(this._capturedData) - this._$resVideo.src = videoBlobURL + this._$resVideo.src = URL.createObjectURL(this._capturedData) this.setState({ captured: true, initMsg: null }) }) }