From 6cc04e64853a5cc7fd0f08392b62633da49f56ed Mon Sep 17 00:00:00 2001 From: caocan <1532643766@qq.com> Date: Fri, 28 Jan 2022 11:05:21 +0800 Subject: [PATCH] video support playback speed Signed-off-by: caocan <1532643766@qq.com> Change-Id: Ia0dea8fd837a0793120735c8555b3ee0d9e12cff --- api/@internal/component/ets/video.d.ts | 107 +++++++++++++++++++++++-- 1 file changed, 102 insertions(+), 5 deletions(-) diff --git a/api/@internal/component/ets/video.d.ts b/api/@internal/component/ets/video.d.ts index d03940300b..33fb3d3e82 100644 --- a/api/@internal/component/ets/video.d.ts +++ b/api/@internal/component/ets/video.d.ts @@ -43,6 +43,101 @@ declare enum SeekMode { Closest, } +/** + * playback speed. + * @since 8 + */ +declare enum PlaybackSpeed { + /** + * 0.75x speed playback. + * @since 8 + */ + Speed_Forward_0_75_X, + + /** + * 1.00x speed playback. + * @since 8 + */ + Speed_Forward_1_00_X, + + /** + * 1.25x speed playback. + * @since 8 + */ + Speed_Forward_1_25_X, + + /** + * 1.75x speed playback. + * @since 8 + */ + Speed_Forward_1_75_X, + + /** + * 2.00x speed playback. + * @since 8 + */ + Speed_Forward_2_00_X, + } + + /** + * @since 7 + * @deprecated since 8 + */ + interface VideoOptionPre { + /** + * src of video. + * @since 7 + */ + src?: string | Resource; + + /** + * playback rate of video. + * @since 7 + */ + currentProgressRate?: number | string; + + /** + * preview uri of video. + * @since 7 + */ + previewUri?: string; + + /** + * controller of video. + * @since 7 + */ + controller?: VideoController; + } + + /** + * @since 8 + */ + interface VideoOption { + /** + * src of video. + * @since 8 + */ + src?: string | Resource; + + /** + * playback rate of video. + * @since 8 + */ + currentProgressRate?: PlaybackSpeed; + + /** + * preview uri of video. + * @since 8 + */ + previewUri?: string | PixelMap | Resource; + + /** + * controller of video. + * @since 8 + */ + controller?: VideoController; + } + /** * @since 7 */ @@ -65,6 +160,12 @@ declare class VideoController { */ pause(); + /** + * Provides an event to stop playback. + * @since 6 + */ + stop(); + /** * Provide the progress method of video playback. * @since 7 @@ -86,11 +187,7 @@ interface VideoInterface { * Set the value. * @since 7 */ - (value: { - src?: string | Resource; - previewUri?: string | PixelMap | Resource; - controller?: VideoController; - }): VideoAttribute; + (value: VideoOptionPre | VideoOption): VideoAttribute; } /** -- Gitee