xugenyuan

ref |> 处理音频播控中心暂停后再播放问题

Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
... ... @@ -224,7 +224,7 @@ export class BackgroundAudioController {
listenPlayEvents() {
this.lastSession?.on('play', () => {
Logger.debug(TAG, `on play `);
this.avplayerController?.play()
this.avplayerController?.resume()
this.hasSetupProgress = false
});
this.lastSession?.on('pause', () => {
... ...
... ... @@ -249,6 +249,21 @@ export class WDPlayerController {
this.avPlayer?.pause();
}
async resume() {
if (this.status == PlayerConstants.STATUS_PAUSE) {
Logger.debug(TAG, "start resume")
this.avPlayer?.play();
return
}
if (this.status == PlayerConstants.STATUS_COMPLETION) {
Logger.debug(TAG, "start resume")
this.avPlayer?.seek(0);
this.avPlayer?.play();
return
}
this.play()
}
async play() {
// if (this.avPlayer == null) {
// await this.initPromise;
... ...