From 3e3e41ff409d95de9b26ed666866eebaad4fdcc2 Mon Sep 17 00:00:00 2001 From: Feng Lin Date: Sat, 12 Apr 2025 10:15:58 +0000 Subject: [PATCH 1/6] =?UTF-8?q?avPlayer.prepare()=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=9C=80=E4=BD=B3=E5=AE=9E=E8=B7=B5=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Feng Lin --- api/@ohos.multimedia.media.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/@ohos.multimedia.media.d.ts b/api/@ohos.multimedia.media.d.ts index 029bf05d5a..e7e5dc95e2 100755 --- a/api/@ohos.multimedia.media.d.ts +++ b/api/@ohos.multimedia.media.d.ts @@ -1755,6 +1755,9 @@ declare namespace media { */ /** * Prepare audio/video playback, it will request resource for playing. + *

If a long delay occurs during fast switching between short videos within an application, follow the steps in [Smooth Switchover Between Online Short Videos]{ + * https://developer.huawei.com/consumer/en/doc/best-practices/bpta-smooth-switching}

+ * * @returns { Promise } A Promise instance used to return when prepare completed. * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. * @throws { BusinessError } 5400106 - Unsupported format. Return by promise. -- Gitee From f9bbf39d5c508d526aed2ad8f22e329b80979127 Mon Sep 17 00:00:00 2001 From: Feng Lin Date: Sat, 12 Apr 2025 10:16:19 +0000 Subject: [PATCH 2/6] add Signed-off-by: Feng Lin --- api/@ohos.multimedia.media.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/api/@ohos.multimedia.media.d.ts b/api/@ohos.multimedia.media.d.ts index e7e5dc95e2..f610d86f14 100755 --- a/api/@ohos.multimedia.media.d.ts +++ b/api/@ohos.multimedia.media.d.ts @@ -1755,6 +1755,7 @@ declare namespace media { */ /** * Prepare audio/video playback, it will request resource for playing. + * *

If a long delay occurs during fast switching between short videos within an application, follow the steps in [Smooth Switchover Between Online Short Videos]{ * https://developer.huawei.com/consumer/en/doc/best-practices/bpta-smooth-switching}

* -- Gitee From 85be0dda4e79f17c6c0b7b0e9169825875abacb5 Mon Sep 17 00:00:00 2001 From: Feng Lin Date: Mon, 14 Apr 2025 12:28:32 +0000 Subject: [PATCH 3/6] add Signed-off-by: Feng Lin --- api/@ohos.multimedia.media.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.multimedia.media.d.ts b/api/@ohos.multimedia.media.d.ts index f610d86f14..2a5de9eb1a 100755 --- a/api/@ohos.multimedia.media.d.ts +++ b/api/@ohos.multimedia.media.d.ts @@ -1756,7 +1756,7 @@ declare namespace media { /** * Prepare audio/video playback, it will request resource for playing. * - *

If a long delay occurs during fast switching between short videos within an application, follow the steps in [Smooth Switchover Between Online Short Videos]{ + *

If a long delay occurs during fast switching between short videos within an application, follow the steps in [Smooth Switchover Between Online Short Videos]{@link * https://developer.huawei.com/consumer/en/doc/best-practices/bpta-smooth-switching}

* * @returns { Promise } A Promise instance used to return when prepare completed. -- Gitee From ade8977546babe637d8c8b5e7fbfd8df801c8e7f Mon Sep 17 00:00:00 2001 From: Feng Lin Date: Mon, 14 Apr 2025 13:00:15 +0000 Subject: [PATCH 4/6] add description Signed-off-by: Feng Lin --- api/@ohos.multimedia.media.d.ts | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/api/@ohos.multimedia.media.d.ts b/api/@ohos.multimedia.media.d.ts index 2a5de9eb1a..e05a86504c 100755 --- a/api/@ohos.multimedia.media.d.ts +++ b/api/@ohos.multimedia.media.d.ts @@ -1725,7 +1725,7 @@ declare namespace media { * @since 11 */ /** - * Prepare audio/video playback, it will request resource for playing. + * Prepare audio/video playback, it will request resource for playing. This API can be called only when the AVplayer is in the initialized state. * @param { AsyncCallback } callback - instance used to return when prepare completed. * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. * @throws { BusinessError } 5400106 - Unsupported format. Return by callback. @@ -1754,7 +1754,7 @@ declare namespace media { * @since 11 */ /** - * Prepare audio/video playback, it will request resource for playing. + * Prepare audio/video playback, it will request resource for playing. This API can be called only when the AVplayer is in the initialized state. * *

If a long delay occurs during fast switching between short videos within an application, follow the steps in [Smooth Switchover Between Online Short Videos]{@link * https://developer.huawei.com/consumer/en/doc/best-practices/bpta-smooth-switching}

@@ -1785,7 +1785,7 @@ declare namespace media { * @since 11 */ /** - * Play audio/video playback. + * Play audio/video playback. This API can be called only when the AVplayer is in the prepared, paused or completed state. * @param { AsyncCallback } callback - instance used to return when play completed. * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. * @syscap SystemCapability.Multimedia.Media.AVPlayer @@ -1811,7 +1811,7 @@ declare namespace media { * @since 11 */ /** - * Play audio/video playback. + * Play audio/video playback. This API can be called only when the AVplayer is in the prepared, paused or completed state. * @returns { Promise } A Promise instance used to return when play completed. * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVPlayer @@ -1837,7 +1837,7 @@ declare namespace media { * @since 11 */ /** - * Pause audio/video playback. + * Pause audio/video playback. This API can be called only when the AVplayer is in the playing state. * @param { AsyncCallback } callback - instance used to return when pause completed. * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. * @syscap SystemCapability.Multimedia.Media.AVPlayer @@ -1863,7 +1863,7 @@ declare namespace media { * @since 11 */ /** - * Pause audio/video playback. + * Pause audio/video playback. This API can be called only when the AVplayer is in the playing state. * @returns { Promise } A Promise instance used to return when pause completed. * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVPlayer @@ -1889,7 +1889,7 @@ declare namespace media { * @since 11 */ /** - * Stop audio/video playback. + * Stop audio/video playback. This API can be called only when the AVplayer is in the prepared, playing, paused or completed state. * @param { AsyncCallback } callback - instance used to return when stop completed. * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. * @syscap SystemCapability.Multimedia.Media.AVPlayer @@ -1915,7 +1915,7 @@ declare namespace media { * @since 11 */ /** - * Stop audio/video playback. + * Stop audio/video playback. This API can be called only when the AVplayer is in the prepared, playing, paused or completed state. * @returns { Promise } A Promise instance used to return when stop completed. * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVPlayer @@ -1941,7 +1941,7 @@ declare namespace media { * @since 11 */ /** - * Reset AVPlayer, it will to idle state and can set src again. + * Reset AVPlayer, it will to idle state and can set src again. This API can be called only when the AVplayer is in the initialized, prepared, playing, paused, completed, stopped or error state. * @param { AsyncCallback } callback - instance used to return when reset completed. * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. * @syscap SystemCapability.Multimedia.Media.AVPlayer @@ -1967,7 +1967,7 @@ declare namespace media { * @since 11 */ /** - * Reset AVPlayer, it will to idle state and can set src again. + * Reset AVPlayer, it will to idle state and can set src again. This API can be called only when the AVplayer is in the initialized, prepared, playing, paused, completed, stopped or error state. * @returns { Promise } A Promise instance used to return when reset completed. * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVPlayer @@ -1993,7 +1993,7 @@ declare namespace media { * @since 11 */ /** - * Releases resources used for AVPlayer. + * Releases resources used for AVPlayer. This API can be called when the AVplayer is in any state except released. * @param { AsyncCallback } callback - instance used to return when release completed. * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. * @syscap SystemCapability.Multimedia.Media.AVPlayer @@ -2019,7 +2019,7 @@ declare namespace media { * @since 11 */ /** - * Releases resources used for AVPlayer. + * Releases resources used for AVPlayer. This API can be called when the AVplayer is in any state except released. * @returns { Promise } A Promise instance used to return when release completed. * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVPlayer @@ -2045,7 +2045,7 @@ declare namespace media { * @since 11 */ /** - * Jumps to the specified playback position. + * Jumps to the specified playback position. This API can be called only when the AVplayer is in the prepared, playing, paused, or completed state. * @param { number } timeMs - Playback position to jump, should be in [0, duration]. * @param { SeekMode } mode - See @SeekMode . * @syscap SystemCapability.Multimedia.Media.AVPlayer -- Gitee From a0cf4fb73386c67c7bee39b46b91d63b4a230747 Mon Sep 17 00:00:00 2001 From: Feng Lin Date: Mon, 14 Apr 2025 13:09:45 +0000 Subject: [PATCH 5/6] re Signed-off-by: Feng Lin --- api/@ohos.multimedia.media.d.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/api/@ohos.multimedia.media.d.ts b/api/@ohos.multimedia.media.d.ts index e05a86504c..47d8aae6d0 100755 --- a/api/@ohos.multimedia.media.d.ts +++ b/api/@ohos.multimedia.media.d.ts @@ -1725,7 +1725,7 @@ declare namespace media { * @since 11 */ /** - * Prepare audio/video playback, it will request resource for playing. This API can be called only when the AVplayer is in the initialized state. + * Prepare audio/video playback, it will request resource for playing. * @param { AsyncCallback } callback - instance used to return when prepare completed. * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. * @throws { BusinessError } 5400106 - Unsupported format. Return by callback. @@ -1754,7 +1754,7 @@ declare namespace media { * @since 11 */ /** - * Prepare audio/video playback, it will request resource for playing. This API can be called only when the AVplayer is in the initialized state. + * Prepare audio/video playback, it will request resource for playing. * *

If a long delay occurs during fast switching between short videos within an application, follow the steps in [Smooth Switchover Between Online Short Videos]{@link * https://developer.huawei.com/consumer/en/doc/best-practices/bpta-smooth-switching}

@@ -1785,7 +1785,7 @@ declare namespace media { * @since 11 */ /** - * Play audio/video playback. This API can be called only when the AVplayer is in the prepared, paused or completed state. + * Play audio/video playback. * @param { AsyncCallback } callback - instance used to return when play completed. * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. * @syscap SystemCapability.Multimedia.Media.AVPlayer @@ -1837,7 +1837,7 @@ declare namespace media { * @since 11 */ /** - * Pause audio/video playback. This API can be called only when the AVplayer is in the playing state. + * Pause audio/video playback. * @param { AsyncCallback } callback - instance used to return when pause completed. * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. * @syscap SystemCapability.Multimedia.Media.AVPlayer @@ -1863,7 +1863,7 @@ declare namespace media { * @since 11 */ /** - * Pause audio/video playback. This API can be called only when the AVplayer is in the playing state. + * Pause audio/video playback. * @returns { Promise } A Promise instance used to return when pause completed. * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVPlayer @@ -1889,7 +1889,7 @@ declare namespace media { * @since 11 */ /** - * Stop audio/video playback. This API can be called only when the AVplayer is in the prepared, playing, paused or completed state. + * Stop audio/video playback. * @param { AsyncCallback } callback - instance used to return when stop completed. * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. * @syscap SystemCapability.Multimedia.Media.AVPlayer @@ -1915,7 +1915,7 @@ declare namespace media { * @since 11 */ /** - * Stop audio/video playback. This API can be called only when the AVplayer is in the prepared, playing, paused or completed state. + * Stop audio/video playback. * @returns { Promise } A Promise instance used to return when stop completed. * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVPlayer @@ -1941,7 +1941,7 @@ declare namespace media { * @since 11 */ /** - * Reset AVPlayer, it will to idle state and can set src again. This API can be called only when the AVplayer is in the initialized, prepared, playing, paused, completed, stopped or error state. + * Reset AVPlayer, it will to idle state and can set src again. * @param { AsyncCallback } callback - instance used to return when reset completed. * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. * @syscap SystemCapability.Multimedia.Media.AVPlayer @@ -1967,7 +1967,7 @@ declare namespace media { * @since 11 */ /** - * Reset AVPlayer, it will to idle state and can set src again. This API can be called only when the AVplayer is in the initialized, prepared, playing, paused, completed, stopped or error state. + * Reset AVPlayer, it will to idle state and can set src again. * @returns { Promise } A Promise instance used to return when reset completed. * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVPlayer @@ -1993,7 +1993,7 @@ declare namespace media { * @since 11 */ /** - * Releases resources used for AVPlayer. This API can be called when the AVplayer is in any state except released. + * Releases resources used for AVPlayer. * @param { AsyncCallback } callback - instance used to return when release completed. * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. * @syscap SystemCapability.Multimedia.Media.AVPlayer @@ -2019,7 +2019,7 @@ declare namespace media { * @since 11 */ /** - * Releases resources used for AVPlayer. This API can be called when the AVplayer is in any state except released. + * Releases resources used for AVPlayer. * @returns { Promise } A Promise instance used to return when release completed. * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVPlayer @@ -2045,7 +2045,7 @@ declare namespace media { * @since 11 */ /** - * Jumps to the specified playback position. This API can be called only when the AVplayer is in the prepared, playing, paused, or completed state. + * Jumps to the specified playback position. * @param { number } timeMs - Playback position to jump, should be in [0, duration]. * @param { SeekMode } mode - See @SeekMode . * @syscap SystemCapability.Multimedia.Media.AVPlayer -- Gitee From 60741dc2a974017bb2ea78813fa8645f8bf985c1 Mon Sep 17 00:00:00 2001 From: Feng Lin Date: Tue, 15 Apr 2025 08:52:55 +0000 Subject: [PATCH 6/6] ad Signed-off-by: Feng Lin --- api/@ohos.multimedia.media.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.multimedia.media.d.ts b/api/@ohos.multimedia.media.d.ts index 47d8aae6d0..2a5de9eb1a 100755 --- a/api/@ohos.multimedia.media.d.ts +++ b/api/@ohos.multimedia.media.d.ts @@ -1811,7 +1811,7 @@ declare namespace media { * @since 11 */ /** - * Play audio/video playback. This API can be called only when the AVplayer is in the prepared, paused or completed state. + * Play audio/video playback. * @returns { Promise } A Promise instance used to return when play completed. * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVPlayer -- Gitee