mario-van-zadel opened a new issue, #348:
URL: https://github.com/apache/cordova-plugin-media/issues/348

   # Feature Request
   
   ## Motivation Behind Feature
   When using the plugin for recording some audio, the user probably denied 
accessing the microphone (by using the operation system's permission system). 
Currently there seems to be no explicit way to detect his. `onError` doesn't 
inform the developer about the denied permission request.
   
   ## Feature Description
   When accessing the microphone, the user get's a permission request from by 
the OS. If the user denies the request, the `onError` observable should inform 
the user about the issue when trying to use the device's microphone.
   
   ## Workaround
   To detect issues with recording the audio, it's possible to check the 
media's status after e.g. 1 second.
   If there are some issues with starting the recording, the status stays at 
`MEDIA_NONE` (instead of switching to `MEDIA_RUNNING`).
   
   ```js
   this.mediaObject.onStatusUpdate.subscribe(status => {
       this.mediaObjectStatus = status;
   });
   
   this.mediaObject.startRecord();
   
   // Check the media's status after 1 second.
   setTimeout(() => {
       if (this.mediaObjectStatus === this.media.MEDIA_NONE) {
           alert('Recording failed. Please check the permissions for accessing 
the microphone');
       }
   }, 1000);
   ```
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to