Open ktech0 opened 7 months ago
播放器的on事件自己处理一下吧,项目好像不更新了。
ap.on('play', () => {
const currentPlayMeta = ap.list.audios[ap.list.index]
navigator.mediaSession.metadata = new MediaMetadata({
title: currentPlayMeta.name,
artist: currentPlayMeta.artist,
album: currentPlayMeta.artist,
artwork: [{ src: currentPlayMeta.cover || '' }]
})
})