Camera Controls - iOS
Whenever any participant wants to start/stop broadcasting their video to other participant in a meeting, they can simply do it with VideoSDK Meeting.
This guide will provide an overview of how to implement enable, disable and switch webcam features in a meeting.
- Enable Camera - By using
enableWebcam()
function, a participant can publish camera stream to other participants. - Disable Camera - By using
disableWebcam()
function, a participant can stop publishing camera stream to other participants. - Switch Camera - By using
changeWebcam()
function, a participant can stream from front / rear camera during the meeting.This function is only applicable for Mobile devices.
Enable, Disable And Switch Webcam
@IBAction func videoButtonTapped(_ sender: Any) {
if !videoEnabled {
// enable webcam/camera
self.meeting?.enableWebcam()
} else {
// disable webcam/camera
self.meeting?.disableWebcam()
}
}
/// keep track of camera position
private var cameraPosition = CameraPosition.front
@IBAction func cameraButtonTapped(_ sender: Any) {
cameraPosition.toggle()
// switch camera to front/back
// Values: .front, .back
self.meeting?.switchWebcam(position: cameraPosition)
}
API Reference
The API references for all the methods and events utilised in this guide are provided below.
Got a Question? Ask us on discord