You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2022/06/26 09:29:08 UTC

[GitHub] [cordova-plugin-media] mario-van-zadel opened a new issue, #348: Detection of missing microphone access permission

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: issues-unsubscribe@cordova.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-media] sonicwong commented on issue #348: Detection of missing microphone access permission

Posted by GitBox <gi...@apache.org>.
sonicwong commented on issue #348:
URL: https://github.com/apache/cordova-plugin-media/issues/348#issuecomment-1334754325

   @mario-van-zadel 
   setTimeout solution is not working as when you called `this.mediaObject.startRecord();`.
   Permission popup is show, but app still running behind and if user don't accept more than 1sec.
   "if" checking already run.


-- 
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: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-media] PabbleDabble commented on issue #348: Detection of missing microphone access permission

Posted by "PabbleDabble (via GitHub)" <gi...@apache.org>.
PabbleDabble commented on issue #348:
URL: https://github.com/apache/cordova-plugin-media/issues/348#issuecomment-1589980790

   I'm having the same issue, but once permission is denied, the `mediaObject` does not do anything, I'm not able to get any subscriptions to fire (which may be intended?)
   I've tried
   * onStatusUpdate
   * successCallback
   * errorCallback
   * onSuccess
   * onError
   
   The last two do work when permissions are granted.  I was thinking about using getCurrentAmplitude (which resolves 0 when permissions not granted during record/play) to check if anything was happening, but not sure I like that or not.  


-- 
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: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org