> ## 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.

# MeetingUserEvent

> Receive the current meeting's member enter/exit, role and permission, device state, request and reply, waiting room, meeting move, and track change events through MeetingEngine.userEvent. Read this when you maintain the member list or decide what to subscribe to.

`MeetingUserEvent` carries the current meeting's member, member permission, and member track events and is registered through `MeetingEngine.userEvent`. You can extend `MeetingUserSimpleEvent` and override only what you need.

## Usage notes

* Event parameters mainly provide the UID of the member that changed and the incremental state; when you need a full member or track snapshot, query it through `MeetingEngine.infosManager`.

* You can assign the listener before entering the meeting; it is cleared after you exit the meeting.

* `onUserEnter()` only provides the UID; when you need full information, query it through `MeetingEngine.infosManager.getMemberByUid(uid)`.

* The audience isn't included in the full member list; identity changes are reported through `onMeMembershipChanged()`.

## Member lifecycle

### onExitRoom(reason)

```kotlin theme={null}
fun onExitRoom(reason: LeaveMeetingReason)
```

Description: The current user exited the meeting because they were removed, replaced, timed out on heartbeat, or the channel was destroyed, among other reasons.

Parameters:

| Parameter | Description |
| - | - |
| `reason` | Exit reason as mapped by Meeting. |

Returns: None (`Unit`).

### onUserEnter(uid)

```kotlin theme={null}
fun onUserEnter(uid: String)
```

Description: A remote user entered the current meeting.

Parameters:

| Parameter | Description |
| - | - |
| `uid` | UID of the user who just entered. |

Returns: None (`Unit`).

### onUserExit(memberInfo)

```kotlin theme={null}
fun onUserExit(memberInfo: MemberInfo)
```

Description: A remote user exited the current meeting.

Parameters:

| Parameter | Description |
| - | - |
| `memberInfo` | The last available Meeting member snapshot of the user who exited. |

Returns: None (`Unit`).

### onMemberUpdated(memberInfo)

```kotlin theme={null}
fun onMemberUpdated(memberInfo: MemberInfo)
```

Description: The Meeting information of the specified member was refreshed.

Parameters:

| Parameter | Description |
| - | - |
| `memberInfo` | The updated member snapshot. |

Returns: None (`Unit`).

### onUserNameChanged(targetUid, nickname)

```kotlin theme={null}
fun onUserNameChanged(targetUid: String, nickname: String)
```

Description: A member's nickname changed.

Parameters:

| Parameter | Description |
| - | - |
| `targetUid` | Target member UID. |
| `nickname` | The member's new nickname. |

Returns: None (`Unit`).

### onUserRoleChanged(targetUid, roleType)

```kotlin theme={null}
fun onUserRoleChanged(targetUid: String, roleType: MemberRoleType)
```

Description: A member's role changed.

Parameters:

| Parameter | Description |
| - | - |
| `targetUid` | Target member UID. |
| `roleType` | The member's new role. |

Returns: None (`Unit`).

### onMeMembershipChanged(isMember)

```kotlin theme={null}
fun onMeMembershipChanged(isMember: Boolean)
```

Description: The current user's identity changed between full member and audience.

Parameters:

| Parameter | Description |
| - | - |
| `isMember` | `true` means full member, `false` means audience. |

Returns: None (`Unit`).

## Devices and permissions

### onUserCameraStateChanged(targetUid, cameraState, reason)

```kotlin theme={null}
fun onUserCameraStateChanged(
    targetUid: String,
    cameraState: DeviceState,
    reason: ChangeReason
)
```

Description: A member's camera state changed.

Parameters:

| Parameter | Description |
| - | - |
| `targetUid` | Target member UID. |
| `cameraState` | Open or closed state. |
| `reason` | Whether the member or the host made the change. |

Returns: None (`Unit`).

### onUserMicStateChanged(targetUid, micState, reason)

```kotlin theme={null}
fun onUserMicStateChanged(
    targetUid: String,
    micState: DeviceState,
    reason: ChangeReason
)
```

Description: A member's mic state changed.

Parameters:

| Parameter | Description |
| - | - |
| `targetUid` | Target member UID. |
| `micState` | Mic open or closed state. |
| `reason` | Whether the member or the host made the change. |

Returns: None (`Unit`).

### onUserDrawDisabledChange(operatorUid, targetUid, disabled)

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

Description: The specified member's whiteboard drawing permission changed.

Parameters:

| Parameter | Description |
| - | - |
| `operatorUid` | Nullable operator UID. |
| `targetUid` | Nullable target member UID. |
| `disabled` | `true` disables drawing; `null` when it can't be parsed. |

Returns: None (`Unit`).

### onUserChatDisabledChange(operatorUid, disabled)

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

Description: The current member's chat permission changed.

Parameters:

| Parameter | Description |
| - | - |
| `operatorUid` | Operator UID; may be `null` for system events. |
| `disabled` | `true` means the current member is not allowed to chat. |

Returns: None (`Unit`).

### onHandUpConfirm(operatorUid, targetUid, approved, handUpType)

```kotlin theme={null}
fun onHandUpConfirm(
    operatorUid: String?,
    targetUid: String,
    approved: Boolean,
    handUpType: HandUpType
)
```

Description: The host handled the specified member's raise hand request.

Parameters:

| Parameter | Description |
| - | - |
| `operatorUid` | Nullable host UID. |
| `targetUid` | UID of the requesting member. |
| `approved` | `true` approves, `false` rejects. |
| `handUpType` | Raise hand request type. |

Returns: None (`Unit`).

## Host requests and member replies

### onRequestOpenCamera(operatorUid)

```kotlin theme={null}
fun onRequestOpenCamera(operatorUid: String?)
```

Description: The current user received a request to turn on the camera.

Parameters:

| Parameter | Description |
| - | - |
| `operatorUid` | Requester UID; may be `null` when it can't be determined. |

Returns: None (`Unit`). Reply with `confirmOpenCameraAgree()` / `confirmOpenCameraRefuse()`.

### onRequestOpenMic(operatorUid)

```kotlin theme={null}
fun onRequestOpenMic(operatorUid: String?)
```

Description: The current user received a request to turn on the mic.

Parameters:

| Parameter | Description |
| - | - |
| `operatorUid` | Requester UID; may be `null` when it can't be determined. |

Returns: None (`Unit`). Reply with `confirmOpenMicAgree()` / `confirmOpenMicRefuse()`.

### onRequestStartShare(operatorUid)

```kotlin theme={null}
fun onRequestStartShare(operatorUid: String?)
```

Description: The current user received a request to start screen sharing.

Parameters:

| Parameter | Description |
| - | - |
| `operatorUid` | Requester UID; may be `null` when it can't be determined. |

Returns: None (`Unit`). Reply with `confirmStartScreenShareAgree()` / `confirmStartScreenShareRefuse()`.

### onUserConfirmOpenCamera(operatorUid, approved)

```kotlin theme={null}
fun onUserConfirmOpenCamera(operatorUid: String, approved: Boolean)
```

Description: The target member replied to the request to turn on the camera.

Parameters:

| Parameter | Description |
| - | - |
| `operatorUid` | UID of the member who replied to the request. |
| `approved` | `true` means they agreed to turn on the camera, `false` means they declined. |

Returns: None (`Unit`).

### onUserConfirmOpenMic(operatorUid, approved)

```kotlin theme={null}
fun onUserConfirmOpenMic(operatorUid: String, approved: Boolean)
```

Description: The target member replied to the request to turn on the mic.

Parameters:

| Parameter | Description |
| - | - |
| `operatorUid` | UID of the member who replied to the request. |
| `approved` | `true` means they agreed to turn on the mic, `false` means they declined. |

Returns: None (`Unit`).

## Waiting room and meeting moves

### onMoveInWaitingRoom(operatorUid, nickname)

```kotlin theme={null}
fun onMoveInWaitingRoom(operatorUid: String?, nickname: String?)
```

Description: The current user was moved into the waiting room.

Parameters:

| Parameter | Description |
| - | - |
| `operatorUid` | Operator UID; may be `null` for system operations. |
| `nickname` | Operator nickname; may be `null` when it can't be determined. |

Returns: None (`Unit`).

### onUserEnterWaitingRoom(uid, nickname)

```kotlin theme={null}
fun onUserEnterWaitingRoom(uid: String, nickname: String)
```

Description: A user entered the waiting room.

Parameters:

| Parameter | Description |
| - | - |
| `uid` | UID of the user who entered the waiting room. |
| `nickname` | User nickname. |

Returns: None (`Unit`).

### onUserExitWaitingRoom(uid, nickname)

```kotlin theme={null}
fun onUserExitWaitingRoom(uid: String, nickname: String)
```

Description: A user exited the waiting room.

Parameters:

| Parameter | Description |
| - | - |
| `uid` | UID of the user who exited the waiting room. |
| `nickname` | User nickname. |

Returns: None (`Unit`).

### onRequestMoveToMainMeetOrSubMeet(targetMeetingId, targetMeetingTitle)

```kotlin theme={null}
fun onRequestMoveToMainMeetOrSubMeet(
    targetMeetingId: String?,
    targetMeetingTitle: String?
)
```

Description: The current user was asked to move to the main meeting or the specified sub-meeting.

Parameters:

| Parameter | Description |
| - | - |
| `targetMeetingId` | Nullable target meeting ID. |
| `targetMeetingTitle` | Nullable target meeting title. |

Returns: None (`Unit`).

## Track changes

### onTrackAdded(uid, trackInfo)

```kotlin theme={null}
fun onTrackAdded(uid: String, trackInfo: TrackInfo)
```

Description: A remote member added a media track.

Parameters:

| Parameter | Description |
| - | - |
| `uid` | UID of the member who added the track. |
| `trackInfo` | Information about the added track. |

Returns: None (`Unit`).

### onTrackUpdated(uid, trackInfo)

```kotlin theme={null}
fun onTrackUpdated(uid: String, trackInfo: TrackInfo)
```

Description: The information of one of a remote member's media tracks was updated.

Parameters:

| Parameter | Description |
| - | - |
| `uid` | UID of the member whose track was updated. |
| `trackInfo` | The updated track information. |

Returns: None (`Unit`).

### onTrackRemoved(uid, trackInfo)

```kotlin theme={null}
fun onTrackRemoved(uid: String, trackInfo: TrackInfo)
```

Description: A remote member removed a media track.

Parameters:

| Parameter | Description |
| - | - |
| `uid` | UID of the member who removed the track. |
| `trackInfo` | The last available snapshot of the removed track. |

Returns: None (`Unit`).
