Skip to content

Commit a6683b2

Browse files
Half-Shotrobintown
authored andcommitted
Ensure hand raised uses the same volume
1 parent 06a02b4 commit a6683b2

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/room/InCallView.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ import handSoundOgg from "../sound/raise_hand.ogg?url";
8585
import handSoundMp3 from "../sound/raise_hand.mp3?url";
8686
import { ReactionsAudioRenderer } from "./ReactionAudioRenderer";
8787
import { useSwitchCamera } from "./useSwitchCamera";
88-
import { showReactions, useSetting } from "../settings/settings";
88+
import {
89+
soundEffectVolumeSetting,
90+
showReactions,
91+
useSetting,
92+
} from "../settings/settings";
8993

9094
const canScreenshare = "getDisplayMedia" in (navigator.mediaDevices ?? {});
9195

@@ -182,6 +186,7 @@ export const InCallView: FC<InCallViewProps> = ({
182186
onShareClick,
183187
}) => {
184188
const [shouldShowReactions] = useSetting(showReactions);
189+
const [soundEffectVolume] = useSetting(soundEffectVolumeSetting);
185190
const { supportsReactions, raisedHands, reactions } = useReactions();
186191
const raisedHandCount = useMemo(
187192
() => Object.keys(raisedHands).length,
@@ -344,11 +349,17 @@ export const InCallView: FC<InCallViewProps> = ({
344349
return;
345350
}
346351
if (previousRaisedHandCount < raisedHandCount) {
352+
handRaisePlayer.current.volume = soundEffectVolume;
347353
handRaisePlayer.current.play().catch((ex) => {
348354
logger.warn("Failed to play raise hand sound", ex);
349355
});
350356
}
351-
}, [raisedHandCount, handRaisePlayer, previousRaisedHandCount]);
357+
}, [
358+
raisedHandCount,
359+
handRaisePlayer,
360+
previousRaisedHandCount,
361+
soundEffectVolume,
362+
]);
352363

353364
useEffect(() => {
354365
widget?.api.transport

0 commit comments

Comments
 (0)