Skip to content
This repository has been archived by the owner on Aug 23, 2024. It is now read-only.

Commit

Permalink
Reset player volume when resetting song (#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffvli committed Feb 11, 2022
1 parent d897629 commit f2ed0e7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/hooks/usePlayerControls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const usePlayerControls = (
dispatch(fixPlayer2Index());
} else if (currentPlayer === 1) {
playersRef.current.player1.audioEl.current.currentTime = 0;
playersRef.current.player1.audioEl.current.volume = playQueue.volume;

// Reset the alt player if reset during fade
playersRef.current.player2.audioEl.current.currentTime = 0;
Expand All @@ -83,6 +84,7 @@ const usePlayerControls = (
}
} else {
playersRef.current.player2.audioEl.current.currentTime = 0;
playersRef.current.player2.audioEl.current.volume = playQueue.volume;

// Reset the alt player if reset during fade
playersRef.current.player1.audioEl.current.currentTime = 0;
Expand Down

0 comments on commit f2ed0e7

Please sign in to comment.