Skip to content

Commit

Permalink
Merge branch 'rm/339020' into 'master'
Browse files Browse the repository at this point in the history
fix(call): Updated ringtone

See merge request kchat/webapp!853
  • Loading branch information
antonbuks committed Jul 24, 2024
2 parents bac2e01 + 4402805 commit 714c031
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion webapp/channels/src/components/kmeet_modal/kmeet_modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const KmeetModal: FC<Props> = ({channel, conference, caller, users, user}) => {
}, [onHandleDecline]);

useEffect(() => {
ringing('Ring');
ringing(isCallerCurrentUser ? 'OutgoingRing' : 'Ring');

return () => {
stopRing();
Expand Down
Binary file added webapp/channels/src/sounds/outgoing_ring.mp3
Binary file not shown.
1 change: 1 addition & 0 deletions webapp/channels/src/types/sounds.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ declare module 'sounds/calls_calm.mp3';
declare module 'sounds/calls_urgent.mp3';
declare module 'sounds/calls_cheerful.mp3';
declare module 'sounds/ring.mp3';
declare module 'sounds/outgoing_ring.mp3';
4 changes: 3 additions & 1 deletion webapp/channels/src/utils/notification_sounds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import bing from 'sounds/bing.mp3';
import crackle from 'sounds/crackle.mp3';
import down from 'sounds/down.mp3';
import hello from 'sounds/hello.mp3';
import outgoingRing from 'sounds/outgoing_ring.mp3';
import ring from 'sounds/ring.mp3';
import ripple from 'sounds/ripple.mp3';

Expand All @@ -21,6 +22,7 @@ export const notificationSounds = new Map([

export const callsNotificationSounds = new Map([
['Ring', ring],
['OutgoingRing', outgoingRing],
]);

let currentRing: HTMLAudioElement | null = null;
Expand All @@ -34,7 +36,7 @@ export function ringing(name: string) {
currentRing.muted = false;
const promise = currentRing.play();

if (name === 'Ring') {
if (name === 'Ring' || name === 'OutgoingRing') {
currentRing.volume = 0.6;
}

Expand Down

0 comments on commit 714c031

Please sign in to comment.