Add track/artist being played to the page title. Closes #317
This commit is contained in:
@@ -93,12 +93,17 @@ const Player = () => {
|
|||||||
|
|
||||||
const OnAudioPlay = (info) => {
|
const OnAudioPlay = (info) => {
|
||||||
if (info.duration) {
|
if (info.duration) {
|
||||||
|
document.title = `${info.name} - ${info.singer} - Navidrome`
|
||||||
dispatch(scrobble(info.trackId, false))
|
dispatch(scrobble(info.trackId, false))
|
||||||
subsonic.scrobble(info.trackId, false)
|
subsonic.scrobble(info.trackId, false)
|
||||||
dataProvider.getOne('keepalive', { id: info.trackId })
|
dataProvider.getOne('keepalive', { id: info.trackId })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const onAudioEnded = () => {
|
||||||
|
document.title = 'Navidrome'
|
||||||
|
}
|
||||||
|
|
||||||
if (authenticated && options.audioLists.length > 0) {
|
if (authenticated && options.audioLists.length > 0) {
|
||||||
return (
|
return (
|
||||||
<ReactJkMusicPlayer
|
<ReactJkMusicPlayer
|
||||||
@@ -106,9 +111,11 @@ const Player = () => {
|
|||||||
onAudioListsChange={OnAudioListsChange}
|
onAudioListsChange={OnAudioListsChange}
|
||||||
onAudioProgress={OnAudioProgress}
|
onAudioProgress={OnAudioProgress}
|
||||||
onAudioPlay={OnAudioPlay}
|
onAudioPlay={OnAudioPlay}
|
||||||
|
onAudioEnded={onAudioEnded}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
document.title = 'Navidrome'
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user