xugenyuan

ref |> 调整播控中心进度条显示拖拽问题

Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
... ... @@ -95,7 +95,7 @@ export class BackgroundAudioController {
let metadata: AVSessionManager.AVMetadata = {
assetId: assetId.length > 0 ? assetId : "fake-asset-id",
title: title.length > 0 ? title : " ",
mediaImage: pixelMapImage ?? ("file://" + mediaImage.id),
mediaImage: "https://cdnjdphoto.aikan.pdnews.cn/WapApi/800/launcher_icon.png" ,//pixelMapImage ?? ("file://" + mediaImage.id),
artist: artist.length > 0 ? artist : "人日日报",
duration: duration
};
... ... @@ -155,11 +155,14 @@ export class BackgroundAudioController {
//设置进度,单位ms
async setSessionPlayProgress(progressDuration: number, totalDuration: number) {
this.setSessionPlayProgressForce(progressDuration, totalDuration, false)
}
async setSessionPlayProgressForce(progressDuration: number, totalDuration: number, force: boolean) {
if (totalDuration <= 0) {
return
}
let newProgress = progressDuration / totalDuration
if (Math.abs(newProgress - this.lastProgress) < 0.01) {
if (force == false && Math.abs(newProgress - this.lastProgress) < 0.01) {
return
}
// Logger.debug(TAG, `set progress: ` + progressDuration + " duration: " + totalDuration);
... ... @@ -177,7 +180,7 @@ export class BackgroundAudioController {
this.lastItemAssetId = undefined
}
if (this.hasSetupProgress) {
if (force == false && this.hasSetupProgress) {
return
}
this.hasSetupProgress = true
... ... @@ -255,9 +258,9 @@ export class BackgroundAudioController {
} else {
Logger.debug(TAG, `SetAVPlaybackState seek buffering`);
}
// 应用响应seek命令,使用应用内播放器完成seek实现
this.avplayerController?.setSeekMicroSecondsTime(position)
this.setSessionPlayProgressForce(position, this.lastItemTotalDuration, true)
setTimeout(() => {
this.hasSetupProgress = false
}, 1000)
... ...
... ... @@ -342,6 +342,10 @@ export class WDPlayerController {
return;
}
this.avPlayer?.seek(value);
if (this.status == PlayerConstants.STATUS_PAUSE) {
this.avPlayer?.play()
}
}
setBright() {
... ...