quintodrome/ui/src/SharePlayer.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
698 B
JavaScript
Raw Normal View History

2023-01-19 18:52:55 -09:00
import ReactJkMusicPlayer from 'navidrome-music-player'
import config, { shareInfo } from './config'
2023-01-21 17:01:50 -09:00
import { baseUrl, shareCoverUrl, shareStreamUrl } from './utils'
2023-01-19 18:52:55 -09:00
2023-01-20 15:53:53 -09:00
const SharePlayer = () => {
2023-01-19 18:52:55 -09:00
const list = shareInfo?.tracks.map((s) => {
return {
name: s.title,
2023-01-21 17:01:50 -09:00
musicSrc: shareStreamUrl(s.id),
cover: shareCoverUrl(s.id),
2023-01-19 18:52:55 -09:00
singer: s.artist,
duration: s.duration,
}
})
const options = {
audioLists: list,
mode: 'full',
mobileMediaQuery: '',
showDownload: false,
showReload: false,
showMediaSession: true,
2023-01-20 15:53:53 -09:00
theme: 'auto',
showThemeSwitch: false,
2023-01-19 18:52:55 -09:00
}
return <ReactJkMusicPlayer {...options} />
}
2023-01-20 15:53:53 -09:00
export default SharePlayer