> For the complete documentation index, see [llms.txt](https://docs.convai.com/api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-pixel-streaming-embed/api-reference.md).

# API 参考

## PixelStreamComponent 属性（React）

| 属性                            | 类型                | 必需  | 说明                                  |
| ----------------------------- | ----------------- | --- | ----------------------------------- |
| `expId`                       | `string`          | ✅ 是 | 您要加载的体验的唯一体验 ID。                    |
| `初始屏幕`                        | `React.ReactNode` | ❌ 否 | 在流加载前显示的可选自定义加载屏幕组件。                |
| `serviceUrls`                 | `对象`              | ❌ 否 | 覆盖默认服务端点（适用于本地部署或自定义配置）。            |
| `serviceUrls.sessionFetch`    | `string`          | ❌ 否 | 用于获取会话数据的自定义 URL。                   |
| `serviceUrls.pixelStreamBase` | `string`          | ❌ 否 | 用于连接 Pixel Streaming 服务器的自定义基础 URL。 |

***

## PixelStreamComponentHandles 方法（React）

这些方法通过 `ref` 向组件暴露：

| 方法                        | 说明             |
| ------------------------- | -------------- |
| `enableCamera()`          | 启用用户的摄像头。      |
| `disableCamera()`         | 禁用用户的摄像头。      |
| `enableCharacterAudio()`  | 取消角色音频静音。      |
| `disableCharacterAudio()` | 将角色音频静音。       |
| `initializeExperience()`  | 如果未自动启动，则开始体验。 |

***

## PixelStreamClient 选项（原生 / TS / CDN）

| 选项                            | 类型            | 必需  | 说明                            |
| ----------------------------- | ------------- | --- | ----------------------------- |
| `容器`                          | `HTMLElement` | ✅ 是 | pixel stream 将挂载到的 DOM 元素。    |
| `expId`                       | `string`      | ✅ 是 | 用于加载体验的体验 ID。                 |
| `初始屏幕`                        | `HTMLElement` | ❌ 否 | 在体验初始化期间显示的可选加载屏幕。            |
| `serviceUrls`                 | `对象`          | ❌ 否 | 用于覆盖默认端点的对象（适用于本地部署或自定义后端）。   |
| `serviceUrls.sessionFetch`    | `string`      | ❌ 否 | 会话获取 API 的自定义端点。              |
| `serviceUrls.pixelStreamBase` | `string`      | ❌ 否 | Pixel Streaming 后端服务器的基础 URL。 |

***

## PixelStreamClient 方法

这些可在 `pixelStream` 在原生/TS/CDN 配置中的实例上使用：

| 方法                        | 说明                     |
| ------------------------- | ---------------------- |
| `enableCamera()`          | 启用用户的摄像头。返回一个 Promise。 |
| `disableCamera()`         | 禁用用户的摄像头。返回一个 Promise。 |
| `enableCharacterAudio()`  | 启用角色音频输出。              |
| `disableCharacterAudio()` | 禁用角色音频输出。              |
| `initializeExperience()`  | 手动启动体验。                |
| `destroy()`               | 清理流和 DOM 元素。           |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-pixel-streaming-embed/api-reference.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
