Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(calling): join/leave sound #762

Merged
merged 2 commits into from
Oct 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/lib/media/Voice.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { playSound, Sounds } from "$lib/components/utils/SoundHandler"
import { CallDirection } from "$lib/enums"
import { Store } from "$lib/state/Store"
import { create_cancellable_handler, type Cancellable } from "$lib/utils/CancellablePromise"
Expand Down Expand Up @@ -194,6 +195,7 @@ export class CallRoom {
let stream = await VoiceRTCInstance.getLocalStream()
log.debug(`Sending local stream ${stream} to ${peer}`)
room.addStream(stream, peer)
playSound(Sounds.Joined)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kevin, I think we can move it to other place, because here, is just when person is really inside the room, and not when person accept call

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this is fine because its when the user then is actually inside the room. accepting the call doesnt mean at that moment the user is actually in the call

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, you are correct.

if (!this.start) {
this.start = new Date()
}
Expand All @@ -205,6 +207,7 @@ export class CallRoom {
VoiceRTCInstance.remoteVideoCreator.delete(participant[0])
delete this.participants[participant[0]]
}
playSound(Sounds.Disconnect)
if (this.empty) {
VoiceRTCInstance.leaveCall(true)
}
Expand Down