-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If startRecorder fails, the recorder is left in an invalid, unrecover…
…able state (#625) It's common for either `MediaRecorder.start()` or `MediaRecorder.prepare()` to fail if the device doesn't support the requested codec, or there is some problem with the arguments. Currently, if this happens, the recorder is left in an invalid state: ### `index.ts` If an error occurs, this._isRecording is still set to `true`, which is incorrect. This PR will catch an error and reset this boolean to `false` ### `RNAudioRecorderPlayerModule.kt` If an error occurs, `this.mediaRecorder` will be set to partially or incorrectly initialized object. The next time `startRecord()` is called, this stale object will be reused, which caused a secondary (and more confusing) error. To fix this, `startRecord` will catch any initialization error and reset `this.mediaRecorder` to null.
- Loading branch information
Showing
2 changed files
with
48 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters