|
@@ -7479,8 +7479,12 @@ export struct LocalMusic {
|
|
|
await this.hydrateRemoteSongFromDb(this.currentSong);
|
|
await this.hydrateRemoteSongFromDb(this.currentSong);
|
|
|
AppStorage.setOrCreate('currentSong', this.currentSong);
|
|
AppStorage.setOrCreate('currentSong', this.currentSong);
|
|
|
|
|
|
|
|
|
|
+ const remotePlayLoading = this.beginRemoteSongSwitchLoading(this.currentSong);
|
|
|
const playbackUrl = await this.resolvePlaybackUrlForCurrentSong('doPlay-remote');
|
|
const playbackUrl = await this.resolvePlaybackUrlForCurrentSong('doPlay-remote');
|
|
|
if (!playbackUrl) {
|
|
if (!playbackUrl) {
|
|
|
|
|
+ if (remotePlayLoading) {
|
|
|
|
|
+ this.hideLoadIng();
|
|
|
|
|
+ }
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
this.videoUrl = playbackUrl;
|
|
this.videoUrl = playbackUrl;
|
|
@@ -12168,8 +12172,8 @@ export struct LocalMusic {
|
|
|
this.PlayOrPauseButton()
|
|
this.PlayOrPauseButton()
|
|
|
},
|
|
},
|
|
|
isPx: false,
|
|
isPx: false,
|
|
|
- builderHeight: this.isPhoneLan()?38:42,
|
|
|
|
|
- builderWidth: this.isPhoneLan()?38:42,
|
|
|
|
|
|
|
+ builderHeight: this.isPhoneLan()?40:43,
|
|
|
|
|
+ builderWidth: this.isPhoneLan()?40:43,
|
|
|
})
|
|
})
|
|
|
.onClick(() =>{
|
|
.onClick(() =>{
|
|
|
this.playOrPause()
|
|
this.playOrPause()
|
|
@@ -12218,7 +12222,7 @@ export struct LocalMusic {
|
|
|
Image(this.CONTROL_PlayStatus === PlayStatus.PLAY ?
|
|
Image(this.CONTROL_PlayStatus === PlayStatus.PLAY ?
|
|
|
(this.isCircleBtn?$r('app.media.hm_pause'):$r('app.media.ic_public_play'))
|
|
(this.isCircleBtn?$r('app.media.hm_pause'):$r('app.media.ic_public_play'))
|
|
|
: (this.isCircleBtn?$r('app.media.hm_play2'):$r('app.media.ic_public_pause')))
|
|
: (this.isCircleBtn?$r('app.media.hm_play2'):$r('app.media.ic_public_pause')))
|
|
|
- .width(this.isPhoneLan()?38:42)
|
|
|
|
|
|
|
+ .width(this.isPhoneLan()?38:40)
|
|
|
.clickEffect({level:ClickEffectLevel.LIGHT, scale: 0.5})
|
|
.clickEffect({level:ClickEffectLevel.LIGHT, scale: 0.5})
|
|
|
.fillColor(Color.White)
|
|
.fillColor(Color.White)
|
|
|
.aspectRatio(CommonConstants.ASPECT_RATIO)
|
|
.aspectRatio(CommonConstants.ASPECT_RATIO)
|
|
@@ -12227,14 +12231,14 @@ export struct LocalMusic {
|
|
|
// 加载进度圈
|
|
// 加载进度圈
|
|
|
if (this.isPlayerLoading) {
|
|
if (this.isPlayerLoading) {
|
|
|
Progress({value:0,total:100,type:ProgressType.Ring })
|
|
Progress({value:0,total:100,type:ProgressType.Ring })
|
|
|
- .width(this.isPhoneLan()?40:44)
|
|
|
|
|
- .height(this.isPhoneLan()?40:44)
|
|
|
|
|
|
|
+ .width(this.isPhoneLan()?40:43)
|
|
|
|
|
+ .height(this.isPhoneLan()?40:43)
|
|
|
.color(Color.White)
|
|
.color(Color.White)
|
|
|
- .style({ strokeWidth: 4, status: ProgressStatus.LOADING })
|
|
|
|
|
|
|
+ .style({ strokeWidth: 5, status: ProgressStatus.LOADING })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- .width(this.isPhoneLan()?39:43)
|
|
|
|
|
- .height(this.isPhoneLan()?39:43)
|
|
|
|
|
|
|
+ .width(this.isPhoneLan()?40:43)
|
|
|
|
|
+ .height(this.isPhoneLan()?40:43)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -14592,7 +14596,7 @@ export struct LocalMusic {
|
|
|
|
|
|
|
|
{ id: 25, image: $r('sys.symbol.ranking'), title: '音乐频谱' },
|
|
{ id: 25, image: $r('sys.symbol.ranking'), title: '音乐频谱' },
|
|
|
{ id: 26, image: $r('sys.symbol.eight_diagram'), title: '频谱类型' },
|
|
{ id: 26, image: $r('sys.symbol.eight_diagram'), title: '频谱类型' },
|
|
|
- // { id: 6, image: $r('app.media.memory'), title: '记忆播放' },
|
|
|
|
|
|
|
+ { id: 6, image: $r('app.media.memory'), title: '记忆播放' },
|
|
|
|
|
|
|
|
|
|
|
|
|
{ id: 13, image: $r('app.media.rectangle'), title: '封面方形' },
|
|
{ id: 13, image: $r('app.media.rectangle'), title: '封面方形' },
|
|
@@ -15407,8 +15411,8 @@ export struct LocalMusic {
|
|
|
const isRemoteStreamSong = this.currentSong && isRemoteCloudType(this.currentSong.type) &&
|
|
const isRemoteStreamSong = this.currentSong && isRemoteCloudType(this.currentSong.type) &&
|
|
|
this.videoUrl.includes('://');
|
|
this.videoUrl.includes('://');
|
|
|
this.waitInitialSeekBeforeStart = !!isRemoteStreamSong && this.pendingMemorySeekPosition > 0;
|
|
this.waitInitialSeekBeforeStart = !!isRemoteStreamSong && this.pendingMemorySeekPosition > 0;
|
|
|
- // 判断是否是HTTP或在线网盘视频,显示加载进度
|
|
|
|
|
- this.isPlayerLoading = this.waitInitialSeekBeforeStart;
|
|
|
|
|
|
|
+ // 网盘歌曲起播阶段统一显示加载圈,prepared/首帧后再收起
|
|
|
|
|
+ this.isPlayerLoading = !!isRemoteStreamSong;
|
|
|
if (this.currentSong && isRemoteCloudType(this.currentSong.type)) {
|
|
if (this.currentSong && isRemoteCloudType(this.currentSong.type)) {
|
|
|
Logger.info(
|
|
Logger.info(
|
|
|
TAG,
|
|
TAG,
|
|
@@ -15767,20 +15771,31 @@ export struct LocalMusic {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private showLoadIng() {
|
|
private showLoadIng() {
|
|
|
|
|
+ this.isPlayerLoading = true;
|
|
|
this.loadingVisible = Visibility.Visible;
|
|
this.loadingVisible = Visibility.Visible;
|
|
|
this.replayVisible = Visibility.None;
|
|
this.replayVisible = Visibility.None;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private hideLoadIng() {
|
|
private hideLoadIng() {
|
|
|
|
|
+ this.isPlayerLoading = false;
|
|
|
this.loadingVisible = Visibility.None;
|
|
this.loadingVisible = Visibility.None;
|
|
|
this.replayVisible = Visibility.None;
|
|
this.replayVisible = Visibility.None;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private showRePlay() {
|
|
private showRePlay() {
|
|
|
|
|
+ this.isPlayerLoading = false;
|
|
|
this.loadingVisible = Visibility.None;
|
|
this.loadingVisible = Visibility.None;
|
|
|
this.replayVisible = Visibility.Visible;
|
|
this.replayVisible = Visibility.Visible;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private beginRemoteSongSwitchLoading(song?: VideoItem): boolean {
|
|
|
|
|
+ const shouldShow = !!song && isRemoteCloudType(song.type);
|
|
|
|
|
+ if (shouldShow) {
|
|
|
|
|
+ this.showLoadIng();
|
|
|
|
|
+ }
|
|
|
|
|
+ return shouldShow;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private clearInitialSeekGuardTimer(): void {
|
|
private clearInitialSeekGuardTimer(): void {
|
|
|
if (this.initialSeekGuardTimer) {
|
|
if (this.initialSeekGuardTimer) {
|
|
|
clearTimeout(this.initialSeekGuardTimer);
|
|
clearTimeout(this.initialSeekGuardTimer);
|
|
@@ -17645,8 +17660,12 @@ export struct LocalMusic {
|
|
|
// 直接使用歌曲列表中的歌曲信息,songList中的数据已经是完整的
|
|
// 直接使用歌曲列表中的歌曲信息,songList中的数据已经是完整的
|
|
|
this.currentSong = this.songList[this.curIndex];
|
|
this.currentSong = this.songList[this.curIndex];
|
|
|
console.info('heanup playNext', `直接使用歌曲列表中的信息: ${this.currentSong.name}, type: ${this.currentSong.type}`);
|
|
console.info('heanup playNext', `直接使用歌曲列表中的信息: ${this.currentSong.name}, type: ${this.currentSong.type}`);
|
|
|
|
|
+ const nextLoading = this.beginRemoteSongSwitchLoading(this.currentSong);
|
|
|
const nextUrl = await this.resolvePlaybackUrlForCurrentSong('playNext');
|
|
const nextUrl = await this.resolvePlaybackUrlForCurrentSong('playNext');
|
|
|
if (!nextUrl) {
|
|
if (!nextUrl) {
|
|
|
|
|
+ if (nextLoading) {
|
|
|
|
|
+ this.hideLoadIng();
|
|
|
|
|
+ }
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
this.videoUrl = nextUrl;
|
|
this.videoUrl = nextUrl;
|
|
@@ -17672,6 +17691,9 @@ export struct LocalMusic {
|
|
|
this.updateCastProgress(0);
|
|
this.updateCastProgress(0);
|
|
|
await this.castControllerWrapper.playNext(this.songList, this.curIndex, this.videoUrl, nextDuration);
|
|
await this.castControllerWrapper.playNext(this.songList, this.curIndex, this.videoUrl, nextDuration);
|
|
|
this.isCastPlaying = this.castControllerWrapper.getIsCastPlaying();
|
|
this.isCastPlaying = this.castControllerWrapper.getIsCastPlaying();
|
|
|
|
|
+ if (nextLoading) {
|
|
|
|
|
+ this.hideLoadIng();
|
|
|
|
|
+ }
|
|
|
console.info('heanup playNext', 'CastController 播放下一首成功');
|
|
console.info('heanup playNext', 'CastController 播放下一首成功');
|
|
|
return;
|
|
return;
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
@@ -17684,6 +17706,9 @@ export struct LocalMusic {
|
|
|
// 本地播放器模式,需要先stop
|
|
// 本地播放器模式,需要先stop
|
|
|
this.CONTROL_PlayStatus = PlayStatus.INIT;
|
|
this.CONTROL_PlayStatus = PlayStatus.INIT;
|
|
|
this.stop();
|
|
this.stop();
|
|
|
|
|
+ if (nextLoading) {
|
|
|
|
|
+ this.showLoadIng();
|
|
|
|
|
+ }
|
|
|
this.changeImageAnimation()
|
|
this.changeImageAnimation()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -17846,8 +17871,12 @@ export struct LocalMusic {
|
|
|
this.stop();
|
|
this.stop();
|
|
|
this.currentSong = randomSong;
|
|
this.currentSong = randomSong;
|
|
|
|
|
|
|
|
|
|
+ const randomRemoteListLoading = this.beginRemoteSongSwitchLoading(this.currentSong);
|
|
|
const randomRemoteListUrl = await this.resolvePlaybackUrlForCurrentSong('randomPlay-remote-list');
|
|
const randomRemoteListUrl = await this.resolvePlaybackUrlForCurrentSong('randomPlay-remote-list');
|
|
|
if (!randomRemoteListUrl) {
|
|
if (!randomRemoteListUrl) {
|
|
|
|
|
+ if (randomRemoteListLoading) {
|
|
|
|
|
+ this.hideLoadIng();
|
|
|
|
|
+ }
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
this.videoUrl = randomRemoteListUrl;
|
|
this.videoUrl = randomRemoteListUrl;
|
|
@@ -17916,8 +17945,12 @@ export struct LocalMusic {
|
|
|
this.CONTROL_PlayStatus = PlayStatus.INIT;
|
|
this.CONTROL_PlayStatus = PlayStatus.INIT;
|
|
|
this.stop();
|
|
this.stop();
|
|
|
this.currentSong = randomRemoteSong;
|
|
this.currentSong = randomRemoteSong;
|
|
|
|
|
+ const randomRemoteDbLoading = this.beginRemoteSongSwitchLoading(this.currentSong);
|
|
|
const randomRemoteUrl = await this.resolvePlaybackUrlForCurrentSong('randomPlay-remote-db');
|
|
const randomRemoteUrl = await this.resolvePlaybackUrlForCurrentSong('randomPlay-remote-db');
|
|
|
if (!randomRemoteUrl) {
|
|
if (!randomRemoteUrl) {
|
|
|
|
|
+ if (randomRemoteDbLoading) {
|
|
|
|
|
+ this.hideLoadIng();
|
|
|
|
|
+ }
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
this.videoUrl = randomRemoteUrl;
|
|
this.videoUrl = randomRemoteUrl;
|
|
@@ -18054,8 +18087,12 @@ export struct LocalMusic {
|
|
|
this.stop();
|
|
this.stop();
|
|
|
this.currentSong = this.songList[this.curIndex];
|
|
this.currentSong = this.songList[this.curIndex];
|
|
|
|
|
|
|
|
|
|
+ const randomFallbackLoading = this.beginRemoteSongSwitchLoading(this.currentSong);
|
|
|
const randomFallbackUrl = await this.resolvePlaybackUrlForCurrentSong('randomPlay-fallback');
|
|
const randomFallbackUrl = await this.resolvePlaybackUrlForCurrentSong('randomPlay-fallback');
|
|
|
if (!randomFallbackUrl) {
|
|
if (!randomFallbackUrl) {
|
|
|
|
|
+ if (randomFallbackLoading) {
|
|
|
|
|
+ this.hideLoadIng();
|
|
|
|
|
+ }
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
this.videoUrl = randomFallbackUrl;
|
|
this.videoUrl = randomFallbackUrl;
|
|
@@ -18078,8 +18115,12 @@ export struct LocalMusic {
|
|
|
this.curIndex = index;
|
|
this.curIndex = index;
|
|
|
this.currentSong = this.songList[index];
|
|
this.currentSong = this.songList[index];
|
|
|
|
|
|
|
|
|
|
+ const playIndexLoading = this.beginRemoteSongSwitchLoading(this.currentSong);
|
|
|
const playIndexUrl = await this.resolvePlaybackUrlForCurrentSong('playIndex');
|
|
const playIndexUrl = await this.resolvePlaybackUrlForCurrentSong('playIndex');
|
|
|
if (!playIndexUrl) {
|
|
if (!playIndexUrl) {
|
|
|
|
|
+ if (playIndexLoading) {
|
|
|
|
|
+ this.hideLoadIng();
|
|
|
|
|
+ }
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
this.videoUrl = playIndexUrl;
|
|
this.videoUrl = playIndexUrl;
|
|
@@ -18092,6 +18133,9 @@ export struct LocalMusic {
|
|
|
Logger.info('heanup playIndex', '投播模式播放指定歌曲,不调用本地stop()');
|
|
Logger.info('heanup playIndex', '投播模式播放指定歌曲,不调用本地stop()');
|
|
|
this.initQueueItem();
|
|
this.initQueueItem();
|
|
|
await this.prepare();
|
|
await this.prepare();
|
|
|
|
|
+ if (playIndexLoading) {
|
|
|
|
|
+ this.hideLoadIng();
|
|
|
|
|
+ }
|
|
|
this.cover = this.currentSong.pixelMapPath;
|
|
this.cover = this.currentSong.pixelMapPath;
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -18099,6 +18143,9 @@ export struct LocalMusic {
|
|
|
// 本地播放器模式,需要先stop
|
|
// 本地播放器模式,需要先stop
|
|
|
this.CONTROL_PlayStatus = PlayStatus.INIT;
|
|
this.CONTROL_PlayStatus = PlayStatus.INIT;
|
|
|
this.stop();
|
|
this.stop();
|
|
|
|
|
+ if (playIndexLoading) {
|
|
|
|
|
+ this.showLoadIng();
|
|
|
|
|
+ }
|
|
|
this.changeImageAnimation()
|
|
this.changeImageAnimation()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -18158,8 +18205,12 @@ export struct LocalMusic {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ const previousLoading = this.beginRemoteSongSwitchLoading(this.currentSong);
|
|
|
const previousUrl = await this.resolvePlaybackUrlForCurrentSong('playPrevious');
|
|
const previousUrl = await this.resolvePlaybackUrlForCurrentSong('playPrevious');
|
|
|
if (!previousUrl) {
|
|
if (!previousUrl) {
|
|
|
|
|
+ if (previousLoading) {
|
|
|
|
|
+ this.hideLoadIng();
|
|
|
|
|
+ }
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
this.videoUrl = previousUrl;
|
|
this.videoUrl = previousUrl;
|
|
@@ -18181,6 +18232,9 @@ export struct LocalMusic {
|
|
|
this.updateCastProgress(0);
|
|
this.updateCastProgress(0);
|
|
|
await this.castControllerWrapper.playPrevious(this.songList, this.curIndex, this.videoUrl, prevDuration);
|
|
await this.castControllerWrapper.playPrevious(this.songList, this.curIndex, this.videoUrl, prevDuration);
|
|
|
this.isCastPlaying = this.castControllerWrapper.getIsCastPlaying();
|
|
this.isCastPlaying = this.castControllerWrapper.getIsCastPlaying();
|
|
|
|
|
+ if (previousLoading) {
|
|
|
|
|
+ this.hideLoadIng();
|
|
|
|
|
+ }
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
Logger.error('heanup playPrevious', `CastController 播放上一首失败: ${error}`);
|
|
Logger.error('heanup playPrevious', `CastController 播放上一首失败: ${error}`);
|
|
|
this.isCastPlaying = false;
|
|
this.isCastPlaying = false;
|
|
@@ -18192,6 +18246,9 @@ export struct LocalMusic {
|
|
|
// 本地播放器模式,需要先stop
|
|
// 本地播放器模式,需要先stop
|
|
|
this.CONTROL_PlayStatus = PlayStatus.INIT;
|
|
this.CONTROL_PlayStatus = PlayStatus.INIT;
|
|
|
this.stop();
|
|
this.stop();
|
|
|
|
|
+ if (previousLoading) {
|
|
|
|
|
+ this.showLoadIng();
|
|
|
|
|
+ }
|
|
|
this.changeImageAnimation()
|
|
this.changeImageAnimation()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -18244,8 +18301,12 @@ export struct LocalMusic {
|
|
|
|
|
|
|
|
this.currentSong = prevSong;
|
|
this.currentSong = prevSong;
|
|
|
|
|
|
|
|
|
|
+ const historyLoading = this.beginRemoteSongSwitchLoading(this.currentSong);
|
|
|
const historyUrl = await this.resolvePlaybackUrlForCurrentSong('randomPlay-history');
|
|
const historyUrl = await this.resolvePlaybackUrlForCurrentSong('randomPlay-history');
|
|
|
if (!historyUrl) {
|
|
if (!historyUrl) {
|
|
|
|
|
+ if (historyLoading) {
|
|
|
|
|
+ this.hideLoadIng();
|
|
|
|
|
+ }
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
this.videoUrl = historyUrl;
|
|
this.videoUrl = historyUrl;
|