fix participant updates (#23)

This commit is contained in:
Théo Monnom
2023-01-04 20:14:09 +01:00
committed by GitHub
parent 9656c73027
commit 27475af410
5 changed files with 40 additions and 19 deletions
+9 -1
View File
@@ -69,7 +69,9 @@ pub enum EngineError {
#[derive(Debug)]
pub enum EngineEvent {
ParticipantUpdate(ParticipantUpdate),
ParticipantUpdate {
updates: Vec<proto::ParticipantInfo>,
},
MediaTrack {
track: MediaStreamTrackHandle,
stream: MediaStream,
@@ -282,6 +284,12 @@ impl EngineInner {
})
.await;
}
SessionEvent::ParticipantUpdate { updates } => {
let _ = self
.engine_emitter
.send(EngineEvent::ParticipantUpdate { updates })
.await;
}
SessionEvent::SpeakersChanged { speakers } => {
let _ = self
.engine_emitter
+8
View File
@@ -43,6 +43,9 @@ pub type SessionEvents = mpsc::UnboundedReceiver<SessionEvent>;
#[derive(Debug)]
pub enum SessionEvent {
ParticipantUpdate {
updates: Vec<proto::ParticipantInfo>,
},
Data {
participant_sid: String,
payload: Vec<u8>,
@@ -421,6 +424,11 @@ impl SessionInner {
true,
);
}
signal_response::Message::Update(update) => {
let _ = self.emitter.send(SessionEvent::ParticipantUpdate {
updates: update.participants,
});
}
signal_response::Message::SpeakersChanged(speaker) => {
let _ = self.emitter.send(SessionEvent::SpeakersChanged {
speakers: speaker.speakers,