Make the volume slider less silly

Previously, dragging it all the way to the left would *not* mute the participant but rather bottom out at 10% volume, and people have found this unintuitive. Let's make it less silly by giving the slider a range of 0% to 100%, and making the mute toggle button have the same effect as dragging the slider to zero. When unmuting, it will reset to the last non-zero "committed" volume, similar to how the volume sliders in desktop environments work.
This commit is contained in:
Robin
2024-10-18 17:51:37 -04:00
parent 75c7516f0a
commit 0c6e53cda4
4 changed files with 85 additions and 41 deletions

View File

@@ -227,6 +227,7 @@ const RemoteUserMediaTile = forwardRef<
(v: number) => vm.setLocalVolume(v),
[vm],
);
const onCommitLocalVolume = useCallback(() => vm.commitLocalVolume(), [vm]);
const VolumeIcon = locallyMuted ? VolumeOffIcon : VolumeOnIcon;
@@ -250,10 +251,10 @@ const RemoteUserMediaTile = forwardRef<
label={t("video_tile.volume")}
value={localVolume}
onValueChange={onChangeLocalVolume}
min={0.1}
onValueCommit={onCommitLocalVolume}
min={0}
max={1}
step={0.01}
disabled={locallyMuted}
/>
</MenuItem>
</>