---
name: "VideoContext.sendDanmu"
mode: "api"
versionRequirements:
  - { name: "基础库", version: "2.21.8" }
title: "VideoContext.sendDanmu - 发送弹幕"
---

## VideoContext.sendDanmu

> [VERSION] 基础库 >= 2.21.8

### 描述

发送弹幕

### 参数

`Params`

| 参数 | 类型 | 必填 | 描述 |
| --- | --- | --- | --- |
| `option` | `SendDanmuOption` | 是 | 弹幕配置 |

### 返回值

无


### 引用对象

##### `interface` SendDanmuOption

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `text` | `string` | 弹幕文字 |
| `color` | `string` | 弹幕颜色 |


### 示例代码

#### 发送弹幕

```ts
const videoCtx = ty.createNativeVideoContext('myVideo');
videoCtx.sendDanmu({
  text: '精彩！',
  color: '#FF0000',
});
```
