SMeetingEngine. For usage, see Media control and Video rendering.
NativeVideoView is an alias the SDK defines for rendering views; the actual type is SRTC’s SRTCVideoRenderer.
Camera
requestOpenCamera(view:deviceId:preset:byAdmin:adminUid:)
Turns on the camera: asks the meeting for permission → starts capture → publishes.
Returns:
LocalCameraTrack (you can ignore it, or read meeting.cameraTrack at any time)
Throws:
SMeetingError.unauthorized—the room has camera off for everyone with members not allowed to turn cameras back on themselves, and you’re not the host / a co-hostSMeetingError.apiError(code:message:)- Underlying errors when capture or publishing fails (the SDK has already rolled back automatically, so you don’t need to call
closeCamera())
deviceId, it switches to the target device.
closeCamera()
userCameraStateDidChange.
switchCamera(deviceId:)
Returns: None
Throws:
SMeetingError.deviceError(_:)—the camera isn’t on yet
Microphone
requestOpenMic(deviceId:preset:byAdmin:adminUid:)
Returns: None
Throws:
SMeetingError.unauthorized—the room has mute all on with members not allowed to unmute themselves, and you’re not the host / a co-hostSMeetingError.apiError(code:message:)- Underlying errors when capture or publishing fails (the SDK rolls back automatically)
closeMic()
userMicStateDidChange.
Screen sharing
Change in 1.3.5: themessageOnlyparameter and its mode have been removed fromrequestShare. To broadcast only the sharing status, userequestShare(shareType: .whiteBoard); screen sharing still performs normal media capture and publishing. RemovemessageOnly: truefrom old code or switch to whiteboard sharing.
requestShare(shareType:preset:view:byAdmin:adminUid:)
Returns: None
Throws:
SMeetingError.unauthorized—the room has sharing disabled, and you’re not the host / a co-hostSMeetingError.internalError(_:)—you’re already sharingSMeetingError.apiError(code:message:)- Underlying errors when capture fails (for example, the user denied screen recording permission)
shareType is .whiteBoard, no media stream is created; it only broadcasts the sharing status and triggers roomShareDidStart.
requestShare(source:preset:view:byAdmin:adminUid:excludedWindowIds:excludesCurrentApplication:)
An overload that specifies the capture source, macOS 12.3 and later only.
Returns: None
Throws: Same as the previous overload.
stopShare()
View capture
The following APIs are available since 1.3.4. The caller is responsible for rendering the view intoCVPixelBuffers and pushing frames continuously; the SDK only creates and publishes the video track, and doesn’t grab frames from the view itself or save a local recording file.
startViewCaptureShare()
LocalVideoTrack, with the track description screen and a degradation preference that maintains resolution. Calling it again returns the existing track.
Throws:
SMeetingError.notInMeeting—you haven’t entered a meeting yet.SMeetingError.internalError(_:)—a screen sharing track already exists, including a broadcast listening track that’s been prepared but not yet published.- Underlying track publishing errors.
requestShare()’s flow of asking the meeting backend and notifying the sharing status. The caller should manage the sharing status according to its own business logic and make sure view capture and screen sharing are mutually exclusive; to switch to screen sharing, stop view capture first.
stopViewCaptureShare()
stopShare() can’t be used instead.
iOS full-screen sharing
The following APIs are available on iOS only and are used to share the entire system screen (on iOS,requestShare() can capture only your own app’s content). You must integrate a Broadcast Upload Extension first; for the full steps, see Screen sharing.
prepareBroadcastShare(appGroup:preset:)
Sets up the listener for full-screen capture and waits for the user to start broadcasting from the system UI. It doesn’t notify the meeting backend or publish a track—sharing hasn’t started yet at this point. Just call it after entering the meeting; it returns idempotently if already listening or already sharing.
Returns: None
Throws: Underlying errors when the capture listener fails to be set up (for example, an incorrect App Group configuration).
publishBroadcastShare(view:byAdmin:adminUid:)
Publishes the full-screen capture that’s already producing frames to the meeting (backend + underlying SRTC channel). Call it after receiving
shareBroadcastDidStart—that’s the moment the user actually starts sharing. It returns idempotently if already published.
Returns: None
Throws:
SMeetingError.internalError(_:)—prepareBroadcastSharehasn’t been called yetSMeetingError.unauthorized—the room has sharing disabled, and you’re not the host / a co-hostSMeetingError.apiError(code:message:)
stopBroadcastListening()
stopShare(), and the listener won’t be set up again automatically afterward. exitRoom() calls it automatically.
Returns: None; doesn’t throw.
requestShare(broadcastAppGroup:preset:view:byAdmin:adminUid:)
isShareBroadcastActive
Bool (read-only)
Whether iOS full-screen sharing is actually producing frames right now. After prepareBroadcastShare, this property stays false until the user taps “Start Broadcast” in the system pill. It’s always false in in-app capture mode.
Remote video
subscribeRemoteVideoTrack(uid:trackDesc:)
Subscribes to a remote video track without binding a renderer view.
Returns:
RemoteVideoTrack
Throws:
SMeetingError.notInMeetingSMeetingError.internalError(_:)—the member doesn’t have this track
unsubscribeRemoteVideoTrack(uid:trackDesc:)
Unsubscribes unconditionally, regardless of whether any renderer view is still using it.
Returns: None
Throws:
SMeetingError.notInMeeting. Returns silently when the track doesn’t exist.
startPlayRemoteVideo(view:uid:trackDesc:)
Subscribes and binds the video to the renderer view you pass in; suited to UIKit / AppKit.
Returns:
RemoteVideoTrack
Throws: Same as subscribeRemoteVideoTrack(uid:trackDesc:)
stopPlayRemoteVideo(view:uid:trackDesc:)
Unbinds the renderer view. It actually unsubscribes only when the track no longer has any renderer view.
Returns: None
Throws:
SMeetingError.notInMeeting
Remote audio
Remote audio is already subscribed automatically when you enter the meeting; the following APIs are for scenarios that need fine-grained control.subscribeRemoteAudioTrack(uid:trackDesc:)
Returns: None
Throws:
SMeetingError.notInMeeting, SMeetingError.internalError(_:)
unsubscribeRemoteAudioTrack(uid:trackDesc:)
Same parameters as above. Returns silently when the track doesn’t exist.
toggleRemoteAudioMute(_:)
The master switch for remote audio playback; it only toggles playback and doesn’t change subscriptions.
Returns: None; doesn’t throw.
Composite video (MCU)
startPlayRemoteVideoMcu(view:uid:)
Subscribes to and plays the server-side composite video. Requires the server to have a composite task set up.
Returns:
RemoteVideoTrack
Throws: SMeetingError.notInMeeting, SMeetingError.internalError(_:) (composite video track not found)
stopPlayRemoteVideoMcu(view:)
Returns: None