This commit is contained in:
josc146
2023-11-29 21:21:14 +08:00
parent 04fbb38861
commit 0d0a3f15cc
4 changed files with 25 additions and 3 deletions

View File

@@ -482,6 +482,12 @@ export function getHfDownloadUrl(url: string) {
}
export function refreshTracksTotalTime() {
if (commonStore.tracks.length === 0) {
commonStore.setTrackTotalTime(tracksMinimalTotalTime);
commonStore.setTrackCurrentTime(0);
commonStore.setTrackPlayStartTime(0);
return;
}
const endTimes = commonStore.tracks.map(t => t.offsetTime + t.contentTime);
const totalTime = Math.max(...endTimes) + tracksMinimalTotalTime;
if (commonStore.trackPlayStartTime > totalTime)