mirror of
https://github.com/getrebuild/rebuild.git
synced 2024-11-10 08:55:31 +08:00
audio
This commit is contained in:
parent
04cd311600
commit
ca2b9b9ee9
1 changed files with 3 additions and 3 deletions
|
@ -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 })
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue