mirror of
https://github.com/ikun0014/lx-music-mobile.git
synced 2025-07-05 03:08:56 +08:00
修复
This commit is contained in:
parent
918069f415
commit
3bfe0623b3
@ -174,7 +174,7 @@ export const playMusic = (musicInfo: LX.Player.PlayMusic, url: string, time: num
|
|||||||
|
|
||||||
// let musicId = null
|
// let musicId = null
|
||||||
// let duration = 0
|
// let duration = 0
|
||||||
// let artwork = null
|
let prevArtwork: string | undefined
|
||||||
const updateMetaInfo = async(mInfo: LX.Player.MusicInfo) => {
|
const updateMetaInfo = async(mInfo: LX.Player.MusicInfo) => {
|
||||||
const isShowNotificationImage = settingState.setting['player.isShowNotificationImage']
|
const isShowNotificationImage = settingState.setting['player.isShowNotificationImage']
|
||||||
// const mInfo = formatMusicInfo(musicInfo)
|
// const mInfo = formatMusicInfo(musicInfo)
|
||||||
@ -190,11 +190,13 @@ const updateMetaInfo = async(mInfo: LX.Player.MusicInfo) => {
|
|||||||
// }
|
// }
|
||||||
// console.log('+++++updateMetaInfo+++++', mInfo.name)
|
// console.log('+++++updateMetaInfo+++++', mInfo.name)
|
||||||
isPlaying = await TrackPlayer.getState() == State.Playing
|
isPlaying = await TrackPlayer.getState() == State.Playing
|
||||||
|
let artwork = isShowNotificationImage ? mInfo.pic ?? prevArtwork : undefined
|
||||||
|
if (mInfo.pic) prevArtwork = mInfo.pic
|
||||||
await TrackPlayer.updateNowPlayingMetadata({
|
await TrackPlayer.updateNowPlayingMetadata({
|
||||||
title: mInfo.name ?? 'Unknow',
|
title: mInfo.name ?? 'Unknow',
|
||||||
artist: mInfo.singer ?? 'Unknow',
|
artist: mInfo.singer ?? 'Unknow',
|
||||||
album: mInfo.album ?? undefined,
|
album: mInfo.album ?? undefined,
|
||||||
artwork: isShowNotificationImage ? mInfo.pic ?? undefined : undefined,
|
artwork,
|
||||||
duration: prevDuration || 0,
|
duration: prevDuration || 0,
|
||||||
}, isPlaying)
|
}, isPlaying)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user