Enable Camera
UsesetCamera(enabled:) to publish or unpublish the camera track:
Camera Capture Options
Configure camera capture settings usingCameraCaptureOptions:
Camera Publish Options
Control how the camera track is published usingVideoPublishOptions:
Enable Microphone
UsesetMicrophone(enabled:) to publish or unpublish the microphone track:
Audio Capture Options
Configure audio capture usingAudioCaptureOptions:
Audio Publish Options
Control how audio is published usingAudioPublishOptions:
Setting Default Options
Set default capture and publish options when creating a room:Mute and Unmute
For camera and microphone tracks, callingsetCamera(enabled: false) or setMicrophone(enabled: false) will mute the track without unpublishing it:
Advanced: Manual Track Publishing
For more control, create and publish tracks manually:Checking Track State
Check if camera or microphone is currently enabled:See Also
- LocalParticipant.swift:322 (
setCamera(enabled:captureOptions:publishOptions:)) - LocalParticipant.swift:334 (
setMicrophone(enabled:captureOptions:publishOptions:))