pub enum Event {
RoomJoined {
member_id: MemberId,
},
RoomLeft {
close_reason: CloseReason,
},
PeerCreated {
peer_id: PeerId,
negotiation_role: NegotiationRole,
connection_mode: ConnectionMode,
tracks: Vec<Track>,
ice_servers: Vec<IceServer>,
force_relay: bool,
},
SdpAnswerMade {
peer_id: PeerId,
sdp_answer: String,
},
LocalDescriptionApplied {
peer_id: PeerId,
sdp_offer: String,
},
IceCandidateDiscovered {
peer_id: PeerId,
candidate: IceCandidate,
},
PeersRemoved {
peer_ids: Vec<PeerId>,
},
PeerUpdated {
peer_id: PeerId,
updates: Vec<PeerUpdate>,
negotiation_role: Option<NegotiationRole>,
},
ConnectionQualityUpdated {
partner_member_id: MemberId,
quality_score: ConnectionQualityScore,
},
StateSynchronized {
state: Room,
},
}Expand description
Possible WebSocket messages sent from Media Server to Web Client.
Variants§
RoomJoined
Media Server notifies Web Client that a Member joined a Room.
RoomLeft
Media Server notifies Web Client that a Member left a Room.
Fields
close_reason: CloseReasonCloseReason with which the Member left the Room.
PeerCreated
Media Server notifies Web Client about necessity of RTCPeerConnection creation.
Fields
negotiation_role: NegotiationRoleNegotiationRole of the Peer.
connection_mode: ConnectionModeSdpAnswerMade
Media Server notifies Web Client about necessity to apply the specified SDP Answer to Web Client’s RTCPeerConnection.
Fields
LocalDescriptionApplied
Media Server notifies Web Client that his SDP offer was applied.
Fields
IceCandidateDiscovered
Media Server notifies Web Client about necessity to apply the specified ICE Candidate.
Fields
candidate: IceCandidateICE Candidate to be applied.
PeersRemoved
Media Server notifies Web Client about necessity of RTCPeerConnection close.
PeerUpdated
Media Server notifies about necessity to update Tracks in a Peer.
Fields
updates: Vec<PeerUpdate>List of PeerUpdates which should be applied.
negotiation_role: Option<NegotiationRole>Negotiation role basing on which should be sent
Command::MakeSdpOffer or Command::MakeSdpAnswer.
If None then no (re)negotiation should be done.
ConnectionQualityUpdated
Media Server notifies about connection quality score update.
Fields
quality_score: ConnectionQualityScoreEstimated connection quality.
StateSynchronized
Media Server synchronizes Web Client state and reports the proper one.
Implementations§
Source§impl Event
impl Event
Sourcepub async fn dispatch_with<T: EventHandler>(
self,
handler: &T,
) -> <T as EventHandler>::Output
pub async fn dispatch_with<T: EventHandler>( self, handler: &T, ) -> <T as EventHandler>::Output
Dispatches Event with given EventHandler.