From 6e7169f486d8e45fc775daf1fc43263cdc7e74e2 Mon Sep 17 00:00:00 2001 From: feng <1362134550@qq.com> Date: Mon, 26 May 2025 12:21:28 +0000 Subject: [PATCH] =?UTF-8?q?update=20common/mediaCommon/src/main/ets/utils/?= =?UTF-8?q?MediaService.ets.=20=E6=9A=82=E5=81=9C=E9=9F=B3=E4=B9=90?= =?UTF-8?q?=E6=92=AD=E6=94=BE=E6=97=B6=E5=85=B3=E9=97=AD=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E8=BF=9B=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: feng <1362134550@qq.com> --- common/mediaCommon/src/main/ets/utils/MediaService.ets | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/mediaCommon/src/main/ets/utils/MediaService.ets b/common/mediaCommon/src/main/ets/utils/MediaService.ets index 9519769..4242684 100644 --- a/common/mediaCommon/src/main/ets/utils/MediaService.ets +++ b/common/mediaCommon/src/main/ets/utils/MediaService.ets @@ -407,6 +407,9 @@ export class MediaService { this.avPlayer.pause().then(() => { this.state = AudioPlayerState.PAUSE; this.updateIsPlay(false); + if (this.context) { + BackgroundUtil.stopContinuousTask(this.context); + } }); } } @@ -489,6 +492,9 @@ export class MediaService { await this.avPlayer.stop(); this.updateIsPlay(false); this.state = AudioPlayerState.PAUSE; + if (this.context) { + BackgroundUtil.stopContinuousTask(this.context); + } } } -- Gitee