Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

建议添加Chrome的MediaSession全局媒体控件样式的支持 #792

Open
ktech0 opened this issue Apr 4, 2024 · 1 comment
Open

Comments

@ktech0
Copy link

ktech0 commented Apr 4, 2024

swappy-20240404_201503

@track23
Copy link

track23 commented Apr 28, 2024

播放器的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 || '' }]
      })
    })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants