fix participant updates (#23)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user