王士厅

fix: 对稿件进行语音播放并暂停后,点击关闭按钮后,手机下拉中的播放组件没有删除

... ... @@ -27,7 +27,7 @@ export class BackgroundAudioController {
public gotContextFunc?: () => Context
public avplayerController?: WDPlayerController
private lastSession?: AVSessionManager.AVSession
private lastSession?: AVSessionManager.AVSession | null
private applyedLongTaskPlay: boolean = false
... ... @@ -64,6 +64,7 @@ export class BackgroundAudioController {
if (this.lastSession) {
this.lastSession.deactivate();
this.lastSession.destroy();
this.lastSession = null
}
}
... ...
import { AudioSuspensionModel } from 'wdComponent'
import { PlayerConstants, DateFormatUtil } from 'wdPlayer'
import { PlayerConstants, DateFormatUtil, BackgroundAudioController } from 'wdPlayer'
import { EmitterEventId, EmitterUtils, SPHelper } from 'wdKit/Index'
import window from '@ohos.window';
import lottie from '@ohos/lottie';
... ... @@ -195,6 +195,7 @@ struct Index {
if (this.AudioSuspension.playerController) {
this.AudioSuspension.playerController.get().pause()
this.AudioSuspension.minimize()
BackgroundAudioController.sharedController().destorySession()
}
}))
}
... ...