> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stmlink.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> 对外开放的服务端接口有两组前缀，都用同一套鉴权：`/server/v1/...`（SRTC 与 SMeeting 的主接口）和 `/stm/srvapi/v1/...`（SMeeting 的用户体系，服务端极简对接会用到）。鉴权是 app_id + nonce + timestamp + signature 四个请求头，用 app_key 做 HMAC-SHA256 签名，只能从业务方自己的后端调用。除这两组前缀外的接口均为内部接口，不要建议客户调用。 Public server APIs use two path prefixes with the same authentication: `/server/v1/...` (the main APIs of both SRTC and SMeeting) and `/stm/srvapi/v1/...` (the SMeeting user system, used by server-side low-code integration). Authenticate with four request headers, app_id + nonce + timestamp + signature, where signature is HMAC-SHA256 keyed with app_key; call these APIs only from the customer's own backend. Any other path is internal: never suggest calling it.
> app_key 是服务端密钥，绝不能出现在客户端代码、前端配置或移动 App 里。客户端加入频道用的 token 必须由业务方后端签发后下发（SRTC 走 `/server/v1/channel/grant`，SMeeting 走 `/stm/srvapi/v1/member/grant`）。 app_key is a server-side secret and must never appear in client code, frontend config, or a mobile app. The token a client uses to join must be issued by the customer's backend and passed down to the client (SRTC: `/server/v1/channel/grant`; SMeeting: `/stm/srvapi/v1/member/grant`).
> SRTC 与 SMeeting 是上下两层不同的产品，术语不通用：SRTC 是音视频底座，说「频道 channel」「加入 / 退出」；SMeeting 建在 SRTC 之上，说「房间 room」「会议 meeting」「进入 / 退出」。回答时按用户所在的层用对应术语，不要把「房间」「会议」安到 SRTC 的接口上，也不要用「频道」「加入 / 离开」描述 SMeeting 的概念（接口标识符原样保留）。 SRTC and SMeeting are two separate layers with different terminology. SRTC is the audio/video foundation: it has channels, and users join and leave a channel. SMeeting is built on top of SRTC: it has rooms and meetings, and members enter and exit a meeting. Answer in the terms of the layer the user is working with: never apply "room" or "meeting" to SRTC APIs, and never describe SMeeting concepts in prose with "channel", "join", or "leave" (API identifiers such as `force_join` keep their literal names).
> 同一能力在各端 SDK 里的包名、类名、方法名并不相同。写示例代码时请使用文档中该端自己的 API，不要把一个端的写法套到另一个端上。苹果平台每个产品都有两套 SDK（Swift 原生与 Objective-C），两套 API 不能混用。 Package, class, and method names differ between platform SDKs for the same capability. In sample code, use the API documented for that platform; never carry one platform's code over to another. On Apple platforms each product ships two SDKs (native Swift and Objective-C) whose APIs must not be mixed.

# MeetingRoomEvent

> Receive the current meeting's room configuration, connection, host, recording, sharing, raise hand, sub-meeting, and sign-in events through MeetingEngine.roomEvent. Read this when you track meeting-wide state or handle disconnects and reconnects.

`MeetingRoomEvent` carries the overall room state and connection lifecycle of the current meeting and is registered through `MeetingEngine.roomEvent`. You can extend `MeetingRoomSimpleEvent` and override only what you need.

## Usage notes

* Room-level events describe the shared state, configuration, and lifecycle of the whole meeting; device, permission, or track changes of a specific member are dispatched by `MeetingUserEvent`.

* You can assign the listener before entering the meeting to receive the initial room state; it is cleared after you exit the meeting.

* Callbacks stay on the actual source thread. `onDisconnected()` means the underlying connection is actually disconnected; calling `exitMeeting()` yourself isn't guaranteed to produce this callback.

## Room and connection

### onMeetingUpdated(meetingInfo)

```kotlin theme={null}
fun onMeetingUpdated(meetingInfo: MeetingInfo?)
```

Description: The current meeting's room information was refreshed.

Parameters:

| Parameter | Description |
| - | - |
| `meetingInfo` | The updated room snapshot; may be `null` at parsing or lifecycle boundaries. |

Returns: None (`Unit`).

### onDisconnected(reason, statusCode, message)

```kotlin theme={null}
fun onDisconnected(reason: LeaveReason, statusCode: Int, message: String?)
```

Description: The current meeting is actually disconnected.

Parameters:

| Parameter | Description |
| - | - |
| `reason` | SRTC disconnect reason. |
| `statusCode` | Underlying status code. |
| `message` | Nullable diagnostic information. |

Returns: None (`Unit`).

### onReconnecting()

```kotlin theme={null}
fun onReconnecting()
```

Description: The current meeting connection started reconnecting automatically.

Parameters: None.

Returns: None (`Unit`).

### onReconnected()

```kotlin theme={null}
fun onReconnected()
```

Description: The current meeting connection reconnected automatically.

Parameters: None.

Returns: None (`Unit`).

## Room configuration

### onRoomCameraStateChanged(operatorUid, selfUnMuteCameraDisabled, disabled)

```kotlin theme={null}
fun onRoomCameraStateChanged(
    operatorUid: String?,
    selfUnMuteCameraDisabled: Boolean,
    disabled: Boolean
)
```

Description: The room's camera-off setting or the policy on whether members can turn their cameras back on themselves changed.

Parameters:

| Parameter | Description |
| - | - |
| `operatorUid` | Operator UID; may be `null` for system events. |
| `selfUnMuteCameraDisabled` | Whether members are prevented from turning their cameras back on themselves. |
| `disabled` | Whether camera off for everyone is on. |

Returns: None (`Unit`).

### onRoomMicStateChanged(operatorUid, selfUnMuteMicDisabled, disabled)

```kotlin theme={null}
fun onRoomMicStateChanged(
    operatorUid: String?,
    selfUnMuteMicDisabled: Boolean,
    disabled: Boolean
)
```

Description: The room's mic mute setting or the policy on whether members can unmute themselves changed.

Parameters:

| Parameter | Description |
| - | - |
| `operatorUid` | Nullable operator UID. |
| `selfUnMuteMicDisabled` | Whether members are prevented from unmuting themselves. |
| `disabled` | Whether mute all is on. |

Returns: None (`Unit`).

### onRoomChatDisabledChanged(operatorUid, disabled)

```kotlin theme={null}
fun onRoomChatDisabledChanged(operatorUid: String?, disabled: Boolean)
```

Description: The room's chat-disabled state changed.

Parameters:

| Parameter | Description |
| - | - |
| `operatorUid` | Operator UID; may be `null` for system events. |
| `disabled` | `true` means room members are not allowed to chat. |

Returns: None (`Unit`).

### onRoomScreenshotDisabledChanged(operatorUid, disabled)

```kotlin theme={null}
fun onRoomScreenshotDisabledChanged(operatorUid: String?, disabled: Boolean)
```

Description: The room's screenshot-disabled state changed.

Parameters:

| Parameter | Description |
| - | - |
| `operatorUid` | Operator UID; may be `null` for system events. |
| `disabled` | `true` means room members are not allowed to take screenshots. |

Returns: None (`Unit`).

### onRoomWatermarkDisabledChanged(operatorUid, disabled)

```kotlin theme={null}
fun onRoomWatermarkDisabledChanged(operatorUid: String?, disabled: Boolean)
```

Description: The room's watermark-disabled state changed.

Parameters:

| Parameter | Description |
| - | - |
| `operatorUid` | Operator UID; may be `null` for system events. |
| `disabled` | `true` means the room watermark is disabled. |

Returns: None (`Unit`).

### onRoomLockedChanged(operatorUid, locked)

```kotlin theme={null}
fun onRoomLockedChanged(operatorUid: String?, locked: Boolean)
```

Description: The room's locked state changed.

Parameters:

| Parameter | Description |
| - | - |
| `operatorUid` | Operator UID; may be `null` for system events. |
| `locked` | `true` means the room is locked. |

Returns: None (`Unit`).

### onWaitingRoomDisabledChanged(operatorUid, disabled)

```kotlin theme={null}
fun onWaitingRoomDisabledChanged(operatorUid: String?, disabled: Boolean)
```

Description: The waiting room was enabled or disabled.

Parameters:

| Parameter | Description |
| - | - |
| `operatorUid` | Operator UID; may be `null` for system events. |
| `disabled` | `true` means the waiting room is disabled. |

Returns: None (`Unit`).

### onRoomHostMove(sourceUid, targetUid)

```kotlin theme={null}
fun onRoomHostMove(sourceUid: String?, targetUid: String?)
```

Description: The host role was transferred from the original member to the target member.

Parameters:

| Parameter | Description |
| - | - |
| `sourceUid` | Original host UID; may be `null`. |
| `targetUid` | New host UID; may be `null`. |

Returns: None (`Unit`).

## Recording, sharing, and raise hand

### onCloudRecordStatusChange(type, status, errorMessage)

```kotlin theme={null}
fun onCloudRecordStatusChange(
    type: CloudRecordType,
    status: CloudRecordStatus,
    errorMessage: String
)
```

Description: The status of a cloud recording task changed.

Parameters:

| Parameter | Description |
| - | - |
| `type` | Recording task type. |
| `status` | Current task status. |
| `errorMessage` | Error information; usually an empty string when there is no error. |

Returns: None (`Unit`).

### onMcuAlarmReceived(operatorUid, alarm)

```kotlin theme={null}
fun onMcuAlarmReceived(operatorUid: String, alarm: McuAlarm)
```

Description: Received an MCU alarm sent privately to this user.

Parameters:

| Parameter | Description |
| - | - |
| `operatorUid` | Message sender UID. |
| `alarm` | Task, gateway, time, and summary information. |

Returns: None (`Unit`).

### onRoomShareStart(shareUid, shareType)

```kotlin theme={null}
fun onRoomShareStart(shareUid: String?, shareType: ShareType)
```

Description: The specified member started screen or whiteboard sharing.

Parameters:

| Parameter | Description |
| - | - |
| `shareUid` | Sharer UID; may be `null` when it can't be determined. |
| `shareType` | The type of sharing that started. |

Returns: None (`Unit`).

### onRoomShareStop(shareUid, shareType)

```kotlin theme={null}
fun onRoomShareStop(shareUid: String?, shareType: ShareType)
```

Description: The specified member stopped screen or whiteboard sharing.

Parameters:

| Parameter | Description |
| - | - |
| `shareUid` | Sharer UID; may be `null` when it can't be determined. |
| `shareType` | The type of sharing that stopped. |

Returns: None (`Unit`).

### onAdminRoomShareStop(shareUid, shareType)

```kotlin theme={null}
fun onAdminRoomShareStop(shareUid: String, shareType: ShareType)
```

Description: The host forcibly stopped the specified member's sharing.

Parameters:

| Parameter | Description |
| - | - |
| `shareUid` | UID of the member whose sharing was stopped. |
| `shareType` | The type of sharing that was stopped. |

Returns: None (`Unit`).

### onRoomHandUpChanged(operatorUid, enabled, handUpType)

```kotlin theme={null}
fun onRoomHandUpChanged(
    operatorUid: String?,
    enabled: Boolean?,
    handUpType: HandUpType?
)
```

Description: A room member's raise hand state changed.

Parameters:

| Parameter | Description |
| - | - |
| `operatorUid` | Nullable member UID. |
| `enabled` | `true` raises the hand, `false` lowers it; `null` when it can't be parsed. |
| `handUpType` | Raise hand type; `null` when it can't be parsed. |

Returns: None (`Unit`).

## Sub-meetings and sign-in

### onAdminRoomStartSubMeeting(subMeetingId, subTitle, uids)

```kotlin theme={null}
fun onAdminRoomStartSubMeeting(
    subMeetingId: String,
    subTitle: String,
    uids: List<String>
)
```

Description: The host started the specified sub-meeting.

Parameters:

| Parameter | Description |
| - | - |
| `subMeetingId` | Meeting ID of the sub-meeting that started. |
| `subTitle` | Sub-meeting title. |
| `uids` | UIDs of the members assigned to this sub-meeting. |

Returns: None (`Unit`).

### onAdminRoomStopSubMeeting(mainMeetingId, subMeetingId, subTitle)

```kotlin theme={null}
fun onAdminRoomStopSubMeeting(
    mainMeetingId: String,
    subMeetingId: String,
    subTitle: String
)
```

Description: The host ended the specified sub-meeting.

Parameters:

| Parameter | Description |
| - | - |
| `mainMeetingId` | Main meeting ID. |
| `subMeetingId` | Meeting ID of the sub-meeting that ended. |
| `subTitle` | Sub-meeting title. |

Returns: None (`Unit`).

### onSignInActivity(hostName, epoch, beginAt, duration, endAt, description)

```kotlin theme={null}
fun onSignInActivity(
    hostName: String,
    epoch: Int,
    beginAt: Long,
    duration: Int,
    endAt: Long,
    description: String
)
```

Description: Received a message that an in-meeting sign-in activity started.

Parameters:

| Parameter | Description |
| - | - |
| `hostName` | Initiator nickname. |
| `epoch` | Sign-in round. |
| `beginAt` | Start time, Unix timestamp in seconds. |
| `duration` | Duration in minutes; `0` means no time limit. |
| `endAt` | End time, Unix timestamp in seconds. |
| `description` | Sign-in description. |

Returns: None (`Unit`).

### onSignInFinish(hostName, epoch)

```kotlin theme={null}
fun onSignInFinish(hostName: String, epoch: Int)
```

Description: Received a message that an in-meeting sign-in activity ended.

Parameters:

| Parameter | Description |
| - | - |
| `hostName` | Nickname of the host who ended the activity. |
| `epoch` | Sign-in round. |

Returns: None (`Unit`).
