Overall model
The object model of the SMeeting Swift SDK is compact:SMeetingEngine: the only public class; login, meeting management, entering and exiting meetings, media control, and host operations are all on itRoomInfo: room-level state of the current meeting (title, mute all / camera off for everyone, lock, sharing status, etc.)MeetingUserInfo: the state of one member in the meeting (nickname, role, microphone, camera, sharing)SMeetingDelegate: the callback entry point for all meeting eventsSMeetingRemoteVideoView/SRTCVideoView: the entry points for video rendering
Terminology: meeting layer vs. RTC layer
SMeeting is built on top of SRTC, and the two layers use different terms; mixing them up will keep tripping you up when reading the APIs:
In the SMeeting APIs, you only see meeting-semantic names such as
enterRoom / exitRoom / createRoom.
Meeting lifecycle
A complete integration unfolds in the following order:
To check whether you’re currently in a meeting, use
meeting.isInRoom.
Meeting ID and room number
The two identifiers often appear together but mean different things:
In
MeetingEnterReq, provide either meetingId or roomNo.
Meeting type and meeting mode
Creating a meeting involves two orthogonal dimensions:MeetingType:.instantinstant meeting /.appointmentscheduled meeting. A scheduled meeting also requiresplanTime(timestamp in seconds) andplanDur(minutes)MeetingMode:.normalnormal,.mixcomposite,.voicevoice meeting,.trainingtraining,.subMeetingsub-meeting
AttendType: password-protected entry also requires password, and invitation-only entry also requires conferee.
In-meeting state: RoomInfo and MeetingUserInfo
After you enter a meeting, the SDK continuously maintains a snapshot of the in-meeting state that you can read at any time:SMeetingDelegate events, and you just read it again in the event callback. Don’t cache stale member objects.
Frequently used fields in MeetingUserInfo:
Roles and permissions
To check whether you have meeting control permissions, read your own
MeetingUserInfo.role:
admin prefix succeed only when called by the host / a co-host; regular members who call them get a permission error from the server.
Track descriptions: TrackDesc
Every media stream in a meeting has a fixed description, used to locate the target when subscribing to remote video:
To see which tracks a member is currently publishing, read
MeetingUserInfo.trackDescs.
Naming rules for media control
- Turning on uses
requestOpenMic/requestOpenCamera/requestShare—they includerequestbecause these actions first ask the meeting for permission (subject to room policies such as mute all, camera off for everyone, and sharing disabled) and then start the local stream - Turning off uses
closeMic/closeCamera/stopShare—they stop the local stream directly, with no request step, and never throw
byAdmin: true and adminUid to the turn-on API; the SDK then takes the “confirm the host’s request” path instead of “request on your own.”
Video rendering entry points
For details, see Video rendering (Chinese).
Audio subscription semantics
Remote audio and remote video are handled differently:- Audio: subscribed automatically after you enter the meeting; you don’t need to subscribe member by member. The speaker (remote audio playback) switch is
toggleRemoteAudioMute(_:)—it only toggles playback and doesn’t touch subscriptions - Video: subscribed on demand. In a large meeting, subscribing to everyone’s video makes bandwidth and decoding costs uncontrollable, so you decide which streams the current layout needs to pull
Event model
All meeting events are reported throughSMeetingDelegate. To register:
delegatesis a weak-reference multicast, so you can register multiple observers; registering doesn’t extend your object’s lifetime- Every method in the protocol has a default empty implementation, so you only implement the events you care about
- Event callbacks are always dispatched on the main thread, so you can update the UI directly
@MainActor type (for example, a SwiftUI ObservableObject), declare the protocol methods as nonisolated, then hop back to the main actor context inside them:
Out-of-meeting messages (IM)
enableIm() sets up a notification path independent of the meeting, used to receive notifications such as calls and meeting reminders when you haven’t entered a meeting. It is separate from in-meeting chat messages: in-meeting chat goes through sendRoomChatMessage and works only inside the meeting.
See Out-of-meeting messages (Chinese).
Underlying RTC capabilities
When the meeting layer’s high-level APIs aren’t enough (for example, you need raw frame processing or custom encoding parameters that only SRTC provides), you can access the underlying instance throughmeeting.srtc.
Always use meeting.srtc; don’t create another SRTCEngine instance 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.
Further reading
- Media control (Chinese)
- Video rendering (Chinese)
- Screen sharing (Chinese)
- Host controls (Chinese)
- Types (Chinese)