Skip to main content

XR8.MediaRecorder.requestMicrophone()

XR8.MediaRecorder.requestMicrophone()

Description

Enables recording of audio (if not enabled automatically), requesting permissions if needed.

Returns a promise that lets the client know when the stream is ready. If you begin recording before the audio stream is ready, then you may miss the user's microphone output at the beginning of the recording.

Parameters

None

Returns

A Promise.

Example

XR8.MediaRecorder.requestMicrophone()
.then(() => {
console.log('Microphone requested!')
})
.catch((err) => {
console.log('Hit an error: ', err)
})