round volume, update all clients

This commit is contained in:
Kendall Garner
2023-05-23 18:14:05 -07:00
committed by Jeff
parent 97ccf3bc6d
commit f83639d5f8
@@ -754,7 +754,7 @@ export const useCenterControls = (args: { playersRef: any }) => {
});
mpris.requestVolume((_e: any, data: { volume: number }) => {
let newVolume = data.volume * 100;
let newVolume = Math.round(data.volume * 100);
if (newVolume > 100) {
newVolume = 100;
@@ -763,6 +763,7 @@ export const useCenterControls = (args: { playersRef: any }) => {
}
usePlayerStore.getState().actions.setVolume(newVolume);
mpris.updateVolume(data.volume);
if (isMpvPlayer) {
mpvPlayer.volume(newVolume);