SMeetingEngine.
Error conventions
The APIs on this page follow two shared rules for throwing errors, which aren’t repeated for each API below:
When the server rejects a request, the SDK always throws
SMeetingError.apiError(code:message:), where code and message come from the server. APIs with the admin prefix require the host (.host) or co-host (.coHost) role; regular members who call them get a permission error in the form of apiError.
APIs that return a value throw a decoding error when the data returned by the server can’t be parsed.
Room controls
The following APIs all require being in a meeting, and none of them return a value.adminDestroyRoom()
Ends the entire meeting; all members are disconnected.
adminUpdateRoomMicState(selfUnmuteMicDisabled:micDisabled:)
Sets mute all for the room.
adminUpdateRoomCameraState(selfUnmuteCameraDisabled:cameraDisabled:)
Sets camera off for everyone for the room.
adminUpdateRoomShareState(shareDisabled:)
adminUpdateRoomChatDisabled(_:)
adminUpdateRoomScreenshotDisabled(_:)
adminUpdateRoomWatermarkDisabled(_:)
adminUpdateRoomLocked(_:)
adminUpdateEnterBeforeHostDisabled(_:)
adminStopRoomShare()
Forcibly ends the sharing currently in progress.
Member management
The following APIs all require being in a meeting, and none of them return a value.adminUpdateUserName(targetId:nickname:)
adminUpdateUserRole(targetId:role:)
adminUpdateUserChatDisabled(targetId:chatDisabled:)
adminUpdateUserDrawDisabled(targetId:drawDisable:)
Read the current state from
MeetingUserInfo.drawDisabled; when it changes, all members receive meeting(_:userDrawDisabledDidChange:) (available since 1.3.6).
adminMoveHost(targetId:)
Transfers the host role.
All members first receive
meeting(_:userRoleDidChange:) once each for the new and former host (.host / .member), then meeting(_:roomHostDidMove:) (RoomHostMoveEventData, available since 1.5.0).
adminRequestUserOpenMic(targetId:) / adminRequestUserOpenCamera(targetId:)
Asks a member to turn on their microphone / camera.
adminCloseUserMic(targetId:) / adminCloseUserCamera(targetId:)
Turns off a member’s microphone / camera directly.
adminKickUserOut(targetId:joinDisabled:)
adminConfirmHandup(targetId:approve:code:)
Approves or rejects a raise-hand request.
Invitees and devices
adminUpdateConferee(meetingId:conferee:)
Updates the invitee list. Requires being logged in.
Returns: None
adminCallUsers(conferee:)
Calls people during the meeting. Requires being in a meeting.
Returns: None
meetNotEnter()
Queries the invitees who haven’t entered the meeting yet. Requires being in a meeting.
Returns: [NoEnterUserInfo]
adminMeetRemind(uids:useSms:)
Reminds people to enter the meeting. Requires being in a meeting.
Returns: None
adminListOnlineMember(page:perPage:)
Lists online members of the meeting you’re currently in. Requires being in a meeting.
Returns:
PageResult<OnlineMemberInfo>
adminListOnlineMember(meetingId:page:perPage:)
Lists online members of the specified meeting. Requires being logged in. Available since 1.5.0.
When the host is inside a sub-meeting, editing sub-meeting members needs the main meeting’s online members: pass RoomInfo.parent as meetingId.
Returns:
PageResult<OnlineMemberInfo>
agentList(type:name:page:perPage:)
Lists the devices that can be invited. Requires being logged in.
Returns:
PageResult<AgentInfo>
Since 1.5.0, AgentInfo.status values are 0 unknown / 1 online / 2 offline; see AgentStatus. The channel table of a GB28181 device is in AgentInfo.connSubjects.
adminInviteAgent(agents:no:)
Invites devices to the meeting. Requires being logged in.
Returns: None
Waiting room
adminUpdateWaitingRoomDisabled(_:)
Requires being in a meeting.
Returns: None
adminWaitingRoomUsers()
Requires being in a meeting.
Returns: [WaitingRoomUserInfo]
adminMoveInWaitingRoom(userId:nickname:)
Moves a member in the meeting back to the waiting room. Requires being in a meeting.
Returns: None
adminMoveOutWaitingRoom(userId:nickname:)
Admits a member from the waiting room into the meeting. Omit both parameters to admit everyone. Requires being in a meeting.
Returns: None
exitWaitingRoom(meetingId:roomNo:)
The member exits the waiting room on their own; provide either of the two parameters. Requires being logged in. It also removes the user from the waiting-for-host list (added when entry returned 2120), so call it when leaving either kind of waiting page.
Returns: None
Sub-meetings
Except foruserHelpSubMeeting(), the following APIs only require being logged in.
adminCreateSubMeeting(mainMeetingId:titles:)
Returns: None
adminSubMeetingList(mainMeetingId:)
Returns:
[SubMeetingInfo]
adminUpdateSubMeetingTitle(id:title:)
Returns: None
adminUpdateSubMeetingUsers(id:users:)
Returns: None
adminDeleteSubMeeting(ids:)
Returns: None
adminStartSubMeeting(ids:) / adminStopSubMeeting(ids:)
Returns: None
adminMoveSubMeetingUser(fromId:toId:userId:)
Returns: None
userHelpSubMeeting()
A member in a sub-meeting asks the main meeting for help. Requires being in a meeting.
Returns: None
Layout and recording
adminUpdateLayout(_:)
Updates the layout of a composite meeting. Requires being in a meeting.
Returns: None
mcuStart(meetingId:req:)
Starts a recording / stream mixing task. Requires being logged in.
Returns: None
mcuStop(meetingId:taskType:)
Requires being logged in.
Returns: None
mcuRecordConfig()
Requires being logged in.
Returns: McuRecordConfig
mcuRecordDetail(meetingId:)
Requires being logged in.
Returns:
McuRecordDetail
Resources
The following APIs all only require being logged in.presignedPutObject(type:meetingId:ext:)
Gets an upload URL.
Returns:
(url: String, key: String, ext: String)
presignedGetObject(id:resKey:)
Gets a download URL. Pass resKey; the server doesn’t support id yet.
Returns:
String (a signed download URL)
updateBgAndAttach(meetingId:background:attachments:)
Updates the meeting background and attachments (since 1.13.0). It replaces everything rather than appending: the attachment list you pass is the final list.
meetingBackgroundUrl(meetingId:)
Gets the meeting background image URL (since 1.13.0).
Returns:
String (a temporary signed URL; get it when you need it and don’t cache it for long)
Sign-in
The following APIs all require being in a meeting and act on the current meeting.signInCreate(dur:desc:)
Starts a round of sign-in.
Returns: None
signInFinish()
Ends the current round of sign-in early.
Returns: None
signInSign()
The member signs in.
Returns: None
signInList()
Returns: (list: [SignInfo]?, now: Int), where now is the server’s current time
signInCount(epoch:)
Returns:
Int (the number of members who have signed in)
signInDetail(epoch:nickname:)
Returns:
[SignDetailInfo]
signInExportDetail(epoch:destination:)
Exports the sign-in details of a round (Excel file) and writes it locally. Available since 1.5.0.
Returns:
URL, the URL of the file actually written (@discardableResult)
Throws: SMeetingError.notInMeeting, SMeetingError.apiError(code:message:), SMeetingError.httpError(status:message:), SMeetingError.responseParseFailed(_:) (the backend returned no file), SMeetingError.internalError(_:) (failed to write the file)