Restore volume when playing a song...

... or continuing to play a paused one
This commit is contained in:
Deluan 2021-07-04 21:33:13 -04:00
parent 1922eaaab2
commit 189d0c0ab3
1 changed files with 4 additions and 1 deletions

View File

@ -113,6 +113,9 @@ const Player = () => {
const onAudioPlay = useCallback(
(info) => {
if (audioInstance) {
audioInstance.volume = playerState.volume
}
dispatch(currentPlaying(info))
setStartTime(Date.now())
if (info.duration) {
@ -136,7 +139,7 @@ const Player = () => {
}
}
},
[dispatch, showNotifications]
[dispatch, showNotifications, audioInstance, playerState.volume]
)
const onAudioPause = useCallback(