Restore volume when playing a song...
... or continuing to play a paused one
This commit is contained in:
parent
1922eaaab2
commit
189d0c0ab3
1 changed files with 4 additions and 1 deletions
|
|
@ -113,6 +113,9 @@ const Player = () => {
|
||||||
|
|
||||||
const onAudioPlay = useCallback(
|
const onAudioPlay = useCallback(
|
||||||
(info) => {
|
(info) => {
|
||||||
|
if (audioInstance) {
|
||||||
|
audioInstance.volume = playerState.volume
|
||||||
|
}
|
||||||
dispatch(currentPlaying(info))
|
dispatch(currentPlaying(info))
|
||||||
setStartTime(Date.now())
|
setStartTime(Date.now())
|
||||||
if (info.duration) {
|
if (info.duration) {
|
||||||
|
|
@ -136,7 +139,7 @@ const Player = () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[dispatch, showNotifications]
|
[dispatch, showNotifications, audioInstance, playerState.volume]
|
||||||
)
|
)
|
||||||
|
|
||||||
const onAudioPause = useCallback(
|
const onAudioPause = useCallback(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue