You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Crash on opening android app when permission to record audio is not requested in manifest.
Crash also occurs when permission is requested, but user denies permission.
If the user does not give the permission, then CaptureBase.HasUserAuthorisationToCaptureAudio() returns NotDetermined, this most likely should be Denied. NotDetermined causes the crash when the recording is started.
Your Setup (please complete the following information):
Unity version: 2021.3.13f1
AVPro Movie Capture version: AVPro Movie Capture 5.1.0.0f1
Operating system version: Android
Capture component used: CaptureWithScreen and CaptureWithCamera
In CaptureBase.cs, Permission.RequestUserPermission() is used to trigger the permission dialog. This call is not synchronous and the execution continues.
On the next line: call RequestUserAuthorisationToCaptureAudioCallback() which sets _waitingForAudioCaptureDeviceAuthorisation = false; This results in the permission to be immediately resolved to NotDetermined.
Possible solution is to use callbacks, as stated in the Unity Documentation. That way _waitingForAudioCaptureDeviceAuthorisation is set to false only after user has made their choice.
The audio recording permission is now checked on the native side before creating the recorder so will no longer crash.
Audio permissions have been reworked to use the newer callback system (Unity 2020.2 and later), however the problem remains for older Unity's where there is no way to tell if permission has been requested and denied.
(Submitted via email)
Describe the bug
Crash on opening android app when permission to record audio is not requested in manifest.
Crash also occurs when permission is requested, but user denies permission.
If the user does not give the permission, then CaptureBase.HasUserAuthorisationToCaptureAudio() returns NotDetermined, this most likely should be Denied. NotDetermined causes the crash when the recording is started.
Your Setup (please complete the following information):
Logs
[AVProMovieCapture] Failed to create recorder
The text was updated successfully, but these errors were encountered: