Skip to main content

Unity device permissions and media controls

Use com.mediasfu.unity 0.1.0-preview.2 to request host approval when the room policy restricts microphone or camera access, then enable those tracks through the configured media backend. This is a room-level approval request; it does not replace the operating system's microphone or camera permission.

var audioApproval = await client.RequestMediaPermissionAsync(MediaSfuTrackKind.Audio);
if (!audioApproval.Success)
{
UnityEngine.Debug.Log(audioApproval.Detail);
return;
}
UnityEngine.Debug.Log("Audio approval request sent; wait for the room's approval state before enabling capture.");

Request only the approvals required by the active room policy. Separately request Android/iOS operating-system permissions through your Unity platform integration, then enable capture only after both platform permission and room approval are in place. With a media backend attached, call SetMicrophoneEnabledAsync(true) to enable the microphone; inspect its result for a denied room policy or missing backend before updating your UI. The same client exposes SetCameraEnabledAsync(true) for camera control. Approval alone does not start either track.

The package does not publish a generic device picker, virtual-background processor, captions, or translation operation. Device enumeration and routes belong to the selected media backend and Unity target. Add those experiences only when that integration documents and supports them; keep permission denial recoverable.

For the Unity client lifecycle, see Unity room operations and Unity media recovery.