Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
xugenyuan
2024-07-18 17:32:37 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
769712b7cb05a9984189fbeaad9eac89358a8613
769712b7
1 parent
34cc9334
ref |> 调整播控中心进度条显示拖拽问题
Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
sight_harmony/features/wdPlayer/src/main/ets/controller/BackgroundAudioController.ets
sight_harmony/features/wdPlayer/src/main/ets/controller/WDPlayerController.ets
sight_harmony/features/wdPlayer/src/main/ets/controller/BackgroundAudioController.ets
View file @
769712b
...
...
@@ -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)
...
...
sight_harmony/features/wdPlayer/src/main/ets/controller/WDPlayerController.ets
View file @
769712b
...
...
@@ -342,6 +342,10 @@ export class WDPlayerController {
return;
}
this.avPlayer?.seek(value);
if (this.status == PlayerConstants.STATUS_PAUSE) {
this.avPlayer?.play()
}
}
setBright() {
...
...
Please
register
or
login
to post a comment