2020-07-28 10:03:53 +08:00
|
|
|
---
|
|
|
|
title: Audio 音频
|
2021-01-07 23:35:03 +08:00
|
|
|
description:
|
2020-07-28 10:03:53 +08:00
|
|
|
type: 0
|
|
|
|
group: ⚙ 组件
|
|
|
|
menuName: Audio 音频
|
2021-01-07 23:35:03 +08:00
|
|
|
icon:
|
2020-07-28 10:03:53 +08:00
|
|
|
order: 28
|
|
|
|
---
|
2021-01-07 23:35:03 +08:00
|
|
|
|
2020-07-28 10:03:53 +08:00
|
|
|
## 基本使用
|
|
|
|
|
2021-01-07 23:35:03 +08:00
|
|
|
```schema: scope="body"
|
2019-05-08 22:55:41 +08:00
|
|
|
{
|
|
|
|
"type": "audio",
|
2019-07-03 16:05:49 +08:00
|
|
|
"src": "https://amis.bj.bcebos.com/amis/2019-7/1562137295708/chicane-poppiholla-original-radio-edit%20(1).mp3"
|
2019-05-08 22:55:41 +08:00
|
|
|
}
|
|
|
|
```
|
2020-07-28 10:03:53 +08:00
|
|
|
|
|
|
|
## 属性表
|
|
|
|
|
|
|
|
| 属性名 | 类型 | 默认值 | 说明 |
|
|
|
|
| --------- | --------- | ------------------------------------------------ | --------------------------------------- |
|
|
|
|
| type | `string` | `"audio"` | 指定为 audio 渲染器 |
|
|
|
|
| className | `string` | | 外层 Dom 的类名 |
|
|
|
|
| inline | `boolean` | true | 是否是内联模式 |
|
|
|
|
| src | `string` | | 音频地址 |
|
|
|
|
| loop | `boolean` | false | 是否循环播放 |
|
|
|
|
| autoPlay | `boolean` | false | 是否自动播放 |
|
|
|
|
| rates | `array` | `[]` | 可配置音频播放倍速如:`[1.0, 1.5, 2.0]` |
|
|
|
|
| controls | `array` | `['rates', 'play', 'time', 'process', 'volume']` | 内部模块定制化 |
|