Tag Archives: Uncaught InvalidStateError: Failed to execute ‘stop’ on ‘MediaRecorder’: The MediaRecorder’s state is ‘inactive’

Uncaught InvalidStateError: Failed to execute ‘stop’ on ‘MediaRecorder’: The MediaRecorder’s state is ‘inactive’

      
The state is already inactive, add a state determination
              console.log(mediaRecorder.state);
                        if(mediaRecorder.state!="inactive"){
                            mediaRecorder.stop();
                        }