SMeetingEngine is the SDK’s only public entry point. Create only one instance per app and hold it globally.
This page covers initialization, authentication, meeting management, entering and exiting meetings, state queries, in-meeting member actions, and out-of-meeting messages. For media APIs, see Media control; for devices, see Devices; for host and management APIs, see Meeting management.
Initialization
init(logLevel:)
Creates an SDK instance.
Properties
version
String; a static property.
srtc
The underlying RTC instance, of type SRTCEngine. An escape hatch for when the meeting layer’s APIs aren’t enough.
Always use this instance; don’t create a second SRTCEngine yourself—the meeting and the underlying layer share the same instance, and creating another one leads to split state, duplicate message connections, and devices being taken over.
delegates
The collection of event delegates, of type MulticastDelegate<SMeetingDelegate>. A weak-reference multicast that supports multiple observers.
currentUserId
The ID of the currently logged-in user, of type String?; nil when not logged in.
isInRoom
Whether you’re currently in a meeting, of type Bool.
cameraTrack / screenTrack / mcuTrack
The local camera track (LocalCameraTrack?), the local screen sharing track (LocalScreenTrack?), and the remote composite track (RemoteVideoTrack?). Each is nil when the corresponding capability isn’t on.
Authentication
login(token:)
Logs in to the conferencing SDK. You can call the other APIs only after logging in.
Returns: None
Throws:
SMeetingError.tokenInvalid—the token format can’t be parsedSMeetingError.tokenExpired—the token has expiredSMeetingError.apiError(code:message:)—the server rejected the loginSMeetingError.networkError(_:)
logout()
Logs out. If still in a meeting, it first exits the meeting automatically, and it disables the out-of-meeting message path.
Meeting management (before the meeting)
The following APIs require only login, not being in a meeting.createRoom(_:)
Creates a meeting.
Returns:
(roomNo: String, meetingId: String)
Throws: SMeetingError.notLoggedIn, SMeetingError.apiError(code:message:)
If meetingType isn’t set explicitly, an instant meeting is created.
updateRoom(meetingId:req:)
Updates a meeting (before the meeting).
Returns: None
Throws:
SMeetingError.notLoggedIn, SMeetingError.apiError(code:message:)
cancelRoom(meetingId:)
Cancels a meeting.
Returns: None
Throws:
SMeetingError.notLoggedIn, SMeetingError.apiError(code:message:)
detailRoom(meetingId:roomNo:)
Gets meeting details; provide one of the two parameters.
Returns:
MeetingInfo
Throws: SMeetingError.notLoggedIn, SMeetingError.apiError(code:message:)
attendeeRoom(page:)
Meetings you need to attend (not started yet or in progress).
Returns:
PageResult<MeetingInfo>
Throws: SMeetingError.notLoggedIn, SMeetingError.apiError(code:message:)
attendedRoom(page:)
Past meetings. Parameters and return value are the same as attendeeRoom(page:).
roomParticipant(meetingId:page:perPage:)
Attendance records of a meeting.
Returns:
PageResult<ParticipantInfo>
Throws: SMeetingError.notLoggedIn, SMeetingError.apiError(code:message:)
Enter / exit a meeting
enterRoom(_:)
Enters a meeting.
Returns: None
Throws:
SMeetingError.notLoggedInSMeetingError.alreadyInMeeting—already in a meeting; callexitRoom()firstSMeetingError.apiError(code:message:)—wrong password, meeting doesn’t exist, entry restricted, and so on- Errors thrown when the underlying connection fails to be set up
exitRoom()
Exits the current meeting; the login state is kept.
State queries
getRoomInfo()
Returns: RoomInfo?; nil when not in a meeting.
getWhiteBoard()
Returns: String?, the whiteboard URL of the current meeting; nil if there is none.
getUserInfo(_:)
Returns:
MeetingUserInfo
Throws: SMeetingError.notInMeeting, SMeetingError.internalError(_:) (no such member in the meeting)
getUsersInfo()
Returns: [String: MeetingUserInfo], a map from uid to member; an empty dictionary when not in a meeting.
getUsersInfoList()
Returns: [MeetingUserInfo]; an empty array when not in a meeting.
getRemoteVideoTrack(uid:desc:)
Looks up the track object of a given video track of a member, without subscribing.
Returns:
Track?; nil when the member doesn’t exist or hasn’t published that track.
In-meeting member actions
The following APIs all require being in a meeting; otherwise they throwSMeetingError.notInMeeting. When the server rejects the call, they throw SMeetingError.apiError(code:message:).
updateName(_:)
Changes your own in-meeting display name.
sendRoomChatMessage(_:type:targetId:)
Sends an in-meeting chat message.
sendRoomCustomMessage(_:targetId:)
Sends a custom message of your own.
requestHandup(_:) / cancelHandup(_:)
Raises a hand or cancels it.
rejectOpenMic(adminUid:) / rejectOpenCamera(adminUid:)
Declines the host’s request to turn on the microphone / camera.
rollCallAnswer(rollCallUserId:)
Answers a roll call.
Throws:
SMeetingError.notLoggedIn, SMeetingError.apiError(code:message:)
Out-of-meeting messages
enableIm()
Enables the out-of-meeting message path.
SMeetingError.notLoggedIn, SMeetingError.apiError(code:message:), and underlying errors when the connection fails to be set up
disableIm()
Disables the out-of-meeting message path.
logout() calls it internally.
Virtual background
This is a device-level setting (it applies to the single shared camera capture pipeline in the process), and it applies to all meetings at once. After switching cameras, turning the camera off and on again, or reconnecting after a disconnect during the meeting, your app doesn’t need to apply it again. For usage and tuning, see Virtual background.
Throws:
SRTCError.virtualBackgroundAlreadyInstalled, .virtualBackgroundNotInstalled, .virtualBackgroundModelNotFound(String), .virtualBackgroundSessionFailed(String)
This group forwards to the audio and video layer, and the meeting layer doesn’t keep a separate copy of the state, so it’s equivalent to calling through meeting.srtc directly; we recommend using the meeting layer’s methods.