Add joined sound effect when new participants join the room

This commit is contained in:
Mikayla Maki 2023-07-03 13:36:03 -07:00
parent d2127825e3
commit 0e4c904091
No known key found for this signature in database
2 changed files with 9 additions and 8 deletions

View File

@ -10,19 +10,15 @@ use futures::{future::Shared, FutureExt};
use postage::watch;
use gpui::{
AppContext, AsyncAppContext, Entity, ModelContext, ModelHandle, Subscription,
Task, WeakModelHandle,
AppContext, AsyncAppContext, Entity, ModelContext, ModelHandle, Subscription, Task,
WeakModelHandle,
};
use project::Project;
pub use participant::ParticipantLocation;
pub use room::Room;
pub fn init(
client: Arc<Client>,
user_store: ModelHandle<UserStore>,
cx: &mut AppContext,
) {
pub fn init(client: Arc<Client>, user_store: ModelHandle<UserStore>, cx: &mut AppContext) {
let active_call = cx.add_model(|cx| ActiveCall::new(client, user_store, cx));
cx.set_global(active_call);
}

View File

@ -663,6 +663,8 @@ impl Room {
},
);
Audio::play_sound(Sound::Joined, cx);
if let Some(live_kit) = this.live_kit.as_ref() {
let video_tracks =
live_kit.room.remote_video_tracks(&user.id.to_string());
@ -1363,7 +1365,10 @@ impl LiveKitRoom {
let old_muted = *muted;
*muted = should_mute;
cx.notify();
Ok((cx.background().spawn(track_publication.set_mute(*muted)), old_muted))
Ok((
cx.background().spawn(track_publication.set_mute(*muted)),
old_muted,
))
}
}?;