Skip to content

Commit

Permalink
Restore volume when playing a song...
Browse files Browse the repository at this point in the history
... or continuing to play a paused one
  • Loading branch information
deluan committed Jul 5, 2021
1 parent 1922eaa commit 189d0c0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ui/src/audioplayer/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -136,7 +139,7 @@ const Player = () => {
}
}
},
[dispatch, showNotifications]
[dispatch, showNotifications, audioInstance, playerState.volume]
)

const onAudioPause = useCallback(
Expand Down

0 comments on commit 189d0c0

Please sign in to comment.