The state read-only property of the MediaRecorder interface returns the current state of the current MediaRecorder object.
A string containing one of the following values:
inactiveRecording is not occurring — it has either not been started yet, or it has been started and then stopped.
recordingRecording has been started and the user agent is capturing data.
pausedRecording has been started, then paused, but not yet stopped or resumed.
record.onclick = () => {
mediaRecorder.start();
console.log(mediaRecorder.state);
// Will return "recording"
console.log("recorder started");
};Navigator.getUserMedia()