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

# Device checks (pre-meeting / in-meeting preview)

> Check the camera, microphone, and speaker before or during a meeting: list devices with getDevices, capture without publishing via publish: false on requestOpenCamera / requestOpenMic, read the mic level with getVolume, decide whether to close with isCameraOpened / isMicOpened, and test speakers with <audio> + setSinkId

### Overview

A pre-meeting device check page and an in-meeting settings page both need to "turn the device on to see and hear it without sending it to anyone". How each check works on the Web meeting layer:

| Check | How |
| - | - |
| Device list | `getDevices(kind)` |
| Camera preview | `requestOpenCamera(container, deviceId, preset, false, undefined, false)` (`publish: false`) |
| Mic level | `getVolume()` on the track returned by `requestOpenMic(deviceId, preset, false, undefined, false)` |
| Speaker test | The SDK has no API; play a test sound yourself with `<audio>` + `setSinkId` |

`publish: false` is available since `0.3.5`: it only captures and previews, without asking the meeting for permission, publishing, or firing state events, and you can call it before or during a meeting. The host turning off your device or disabling it for everyone doesn't affect a preview-only track.

***

### Device list

```typescript theme={null}
const cameras = await meeting.getDevices("videoinput");
const microphones = await meeting.getDevices("audioinput");
const speakers = await meeting.getDevices("audiooutput");
```

Browsers don't return device names before permission is granted, so when the names are empty the SDK first requests camera / microphone permission once. Pass `false` as the second argument if you don't want to trigger the permission prompt.

***

### Camera preview

```typescript theme={null}
// Open the preview: pass false as the last argument, publish
const camTrack = await meeting.requestOpenCamera(previewEl, cameraId, undefined, false, undefined, false);

// Switch cameras: call it again with the new deviceId
await meeting.requestOpenCamera(previewEl, newCameraId, undefined, false, undefined, false);

// Close the preview
if (!meeting.isCameraOpened()) {
  await meeting.closeCamera();           // Close only a preview-only camera
} else {
  camTrack.removePlayView(previewEl);    // The meeting camera is on: remove only the preview container you added
}
```

* **Deciding to turn the camera on after previewing**: call `requestOpenCamera()` again with the default `publish: true`. It asks the meeting for permission and publishes **the same track**, without restarting capture.
* **Opening a preview while the meeting camera is already on**: `publish: false` just returns the track in use and adds the `container` you pass as a preview, without starting another capture.
* **A camera opened with default parameters before entering a meeting**: calling `requestOpenCamera()` again after entering publishes it to the meeting.

***

### Mic level

```typescript theme={null}
const micTrack = await meeting.requestOpenMic(micId, undefined, false, undefined, false);

const timer = setInterval(() => {
  volumeBar.style.width = `${micTrack.getVolume()}%`;   // getVolume() returns 0–100
}, 100);

// When the check ends
clearInterval(timer);
if (!meeting.isMicOpened()) {
  await meeting.closeMic();
}
```

* Processors set with [`setAudioProcessor()`](https://docs.stmlink.com/en/meeting/web/advanced/deepfilternet) (such as AI noise suppression) are attached during capture-only too, so you can hear and see the result after noise suppression directly.
* Deciding to open the mic after testing, the meeting mic already being on, and opening before entering a meeting follow the same rules as the camera; use `isMicOpened()` to decide whether to close it.

***

### Speaker test

The SDK has no API for playing a test sound. Play it with the browser's `<audio>`, and choose the output device with `setSinkId` (some browsers don't support `setSinkId`; there you can only use the system default output):

```typescript theme={null}
const audio = new Audio("/assets/test-tone.mp3");
if ("setSinkId" in audio) {
  await (audio as any).setSinkId(speakerId);
}
await audio.play();
```

To use the chosen speaker for remote audio in the meeting, pass it through `toggleRemoteAudioMute(false, { deviceId: speakerId })`.

***

### Related pages

* [SMeeting API](https://docs.stmlink.com/en/meeting/web/api-reference/SMeeting.md)
* [AI noise suppression](https://docs.stmlink.com/en/meeting/web/advanced/deepfilternet.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.