feat: video 组件支持配置循环播放 (#6808)

This commit is contained in:
liaoxuezhi 2023-05-08 14:03:58 +08:00 committed by GitHub
parent 0ed57be2f0
commit f299743428
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -73,6 +73,7 @@ order: 71
| videoType | `string` | | 指定直播视频格式 |
| poster | `string` | | 视频封面地址 |
| muted | `boolean` | | 是否静音 |
| loop | `boolean` | | 是否循环播放 |
| autoPlay | `boolean` | | 是否自动播放 |
| rates | `array` | | 倍数,格式为`[1.0, 1.5, 2.0]` |
| frames | `object` | | key 是时刻信息value 可以可以为空,可有设置为图片地址,请看上方示例 |

View File

@ -78,6 +78,11 @@ export interface VideoSchema extends BaseSchema {
*/
muted?: boolean;
/**
*
*/
loop?: boolean;
/**
* className
*/
@ -636,8 +641,7 @@ export default class Video extends React.Component<VideoProps, VideoState> {
muted,
name,
data,
amisConfig,
locals,
loop,
isLive,
minVideoDuration,
videoType,
@ -690,6 +694,7 @@ export default class Video extends React.Component<VideoProps, VideoState> {
autoPlay={autoPlay}
muted={muted}
aspectRatio={aspectRatio}
loop={loop}
>
{rates && rates.length ? (
<ControlBar>