fix mediasession play hotkey on after pause on web (#1758)

- chrome (and other browsers) determine that the audio element is inactive if the volume is set to 0 when paused, leading to the resume (play) mediasession event to no longer be available
This commit is contained in:
jeffvli
2026-02-26 01:11:21 -08:00
parent 0d1799cbf7
commit a78f5803a5
@@ -84,6 +84,7 @@ export function WebPlayer() {
if (status === PlayerStatus.PAUSED) {
await promise;
setLocalPlayerStatus(status);
playerRef.current?.setVolume(startVolume);
} else if (status === PlayerStatus.PLAYING) {
setLocalPlayerStatus(status);
await promise;
@@ -257,7 +258,7 @@ export function WebPlayer() {
}
} else {
if (status === PlayerStatus.PAUSED) {
playerRef.current?.setVolume(0);
playerRef.current?.setVolume(volume);
setLocalPlayerStatus(PlayerStatus.PAUSED);
} else if (status === PlayerStatus.PLAYING) {
playerRef.current?.setVolume(volume);