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
Request microphone permission before audio capture starts
webrtc-sdk/webrtc#265 (m144.7559.12 and later) removed the blocking mic
permission request from the AudioEngine device. It now only checks the
status and fails with kAudioEngineErrorInsufficientDevicePermission, so
requesting permission is the SDK's job.
The native plugin gains ensureMicrophoneAccess: authorized passes,
denied or restricted fails, and notDetermined requests access, on iOS
only while the app is active. An inactive or backgrounded app has the
alert deferred by the system, and waiting on it would suspend
getUserMedia and the publish queue behind it, so it fails fast instead
and the next foreground attempt prompts normally.
LocalTrack.createStream calls it for audio on Apple platforms before
getUserMedia, which covers publishing, restartTrack on unmute, and
pre-connect audio. Failures surface as TrackCreateException through the
existing audio engine error mapping.
patch type="fixed" "iOS/macOS: request microphone permission before audio capture starts, failing fast with TrackCreateException while the app is not in the foreground"
denied("Microphone permission could not be requested because the app is not in the foreground. Request it while the app is active before enabling recording.")
569
+
return
570
+
}
571
+
#endif
572
+
AVCaptureDevice.requestAccess(for:.audio){ granted in
0 commit comments