On / Off Camera - iOS
This feature enables hosts to turn their cameras on or off to share their video stream with other hosts and audience members during the meeting. Only hosts (in SEND_AND_RECV mode) can broadcast their camera feed, while audience members (in RECV_ONLY mode) can view it in real time.
enableWebcam()
-
By using
enableWebcam()function ofMeetingclass, the host can publish their video to to other hosts and audience members. -
You can also pass a customised video track in
enableWebcam()by using Custom Video Track. -
Video stream of the participant can be accessed from the
onStreamEnabledevent ofParticipantEventListener.
disableWebcam()
- By using
disableWebcam()function ofMeetingclass, the host can stop publishing their video to to other hosts and audience members.
Example
- Swift
@IBAction func videoButtonTapped(_ sender: Any) {
if !videoEnabled {
// enable webcam/camera
self.meeting?.enableWebcam()
} else {
// disable webcam/camera
self.meeting?.disableWebcam()
}
}
Events associated with enableWebcam
- Every Participant will receive a callback on
onStreamEnabled()of theParticipantwithStreamobject.
Events associated with disableWebcam
- Every Participant will receive a callback on
onStreamDisabled()of theParticipantwithStreamobject.
Video Permissions
User Readiness Check - iOS
Before a user can engage with an live stream, the system must ensure that all necessary permissions—such as microphone access—are granted. This prevents technical issues and ensures a seamless interaction over livestream.
Step 1:Begin by ensuring that your application has video/audio permission to access user's microphone and camera device. Utilize thegetVideoPermissionStatus()method of theVideoSDKclass to verify if permissions are granted. If the permissions are not granted, the method will request the required permissions.
In case permissions are blocked by the user, the app's permission request dialogue cannot be re-rendered programmatically. In such cases, consider providing guidance to users on manually adjusting their application settings.
- Swift
let audioPermission = VideoSDK.getVideoPermissionStatus(); // video permission status
Request Permissions (if necessary)
-
If permission status is
notDetermined, use thegetVideoPermission()methods of theVideoSDKclass to prompt users to grant access to their devices. -
Calling the above functions will automatically handle the notDetermined state and prompt the user to grant permission.
- Swift
class LiveStreamViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// UI Setup
setupUI()
// prompt user to grant permission when the app starts
VideoSDK.getVideoPermission()
}
func setupUI() {
// your UI code
}
}
API Reference
The API references for all the methods and events utilized in this guide are provided below.
Got a Question? Ask us on discord

