Enum medea_client_api_proto::Event
source · 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
Fields
close_reason: CloseReason
CloseReason
with which the Member
left the Room
.
Media Server notifies Web Client that a Member
left a Room
.
PeerCreated
Fields
negotiation_role: NegotiationRole
NegotiationRole
of the Peer
.
connection_mode: ConnectionMode
Media Server notifies Web Client about necessity of RTCPeerConnection creation.
SdpAnswerMade
Fields
Media Server notifies Web Client about necessity to apply the specified SDP Answer to Web Client’s RTCPeerConnection.
LocalDescriptionApplied
Fields
Media Server notifies Web Client that his SDP offer was applied.
IceCandidateDiscovered
Fields
candidate: IceCandidate
ICE Candidate to be applied.
Media Server notifies Web Client about necessity to apply the specified ICE Candidate.
PeersRemoved
Media Server notifies Web Client about necessity of RTCPeerConnection close.
PeerUpdated
Fields
updates: Vec<PeerUpdate>
List of PeerUpdate
s 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.
Media Server notifies about necessity to update Track
s in a Peer
.
ConnectionQualityUpdated
Fields
quality_score: ConnectionQualityScore
Estimated connection quality.
Media Server notifies about connection quality score update.
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
.