|
@@ -1681,6 +1681,19 @@ export struct LocalMusic {
|
|
|
if (payload.lyricContent) {
|
|
if (payload.lyricContent) {
|
|
|
this.applyInlineLyricContent(payload.lyricContent);
|
|
this.applyInlineLyricContent(payload.lyricContent);
|
|
|
}
|
|
}
|
|
|
|
|
+ let avSessionDurationMs = this.duration;
|
|
|
|
|
+ if (payload.duration) {
|
|
|
|
|
+ const durationSeconds = Number(payload.duration);
|
|
|
|
|
+ if (!Number.isNaN(durationSeconds) && durationSeconds > 0) {
|
|
|
|
|
+ avSessionDurationMs = durationSeconds * 1000;
|
|
|
|
|
+ this.duration = avSessionDurationMs;
|
|
|
|
|
+ this.durationTime = Math.floor(avSessionDurationMs / 1000);
|
|
|
|
|
+ this.durationStringTime = secondToTime(this.durationTime);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (avSessionDurationMs > 0) {
|
|
|
|
|
+ this.avSessionController.setAVMetadataMusic(this.currentSong, avSessionDurationMs, this.lyricContent);
|
|
|
|
|
+ }
|
|
|
this.currentSong = cloneVideoItem(this.currentSong);
|
|
this.currentSong = cloneVideoItem(this.currentSong);
|
|
|
AppStorage.setOrCreate('currentSong', this.currentSong);
|
|
AppStorage.setOrCreate('currentSong', this.currentSong);
|
|
|
}
|
|
}
|
|
@@ -13517,10 +13530,18 @@ export struct LocalMusic {
|
|
|
|
|
|
|
|
await this.initLyric(lyricPath);
|
|
await this.initLyric(lyricPath);
|
|
|
|
|
|
|
|
|
|
+ const preparedDuration = this.mIjkMediaPlayer.getDuration();
|
|
|
|
|
+ if (preparedDuration > 0) {
|
|
|
|
|
+ this.duration = preparedDuration;
|
|
|
|
|
+ this.durationTime = Math.floor(preparedDuration / 1000);
|
|
|
|
|
+ this.durationStringTime = secondToTime(this.durationTime);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
this.avSessionController.initAvSession(false);
|
|
this.avSessionController.initAvSession(false);
|
|
|
- this.avSessionController.setAVMetadataMusic(this.songList[this.curIndex], this.duration, this.lyricContent);
|
|
|
|
|
|
|
+ if (this.duration > 0) {
|
|
|
|
|
+ this.avSessionController.setAVMetadataMusic(this.songList[this.curIndex], this.duration, this.lyricContent);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
this.setAvSessionListener();
|
|
this.setAvSessionListener();
|
|
|
|
|
|