Skip to main content
Version: 4.x.x

Media Events - iOS

VideoSDK provides events that tell you the participant's media status in the room.

You can implement all the methods of the ParticipantEventListener protocol and add the listener to Participant class using the addEventListener() method of Participant Class. Add it to room.localParticipant for your own streams, and to each remote participant when it joins, for example in onParticipantJoined.

Here are the events which specifically relate to the stream.

onStreamEnabled​

  • This event is triggered whenever a participant's video, audio or screen share stream is enabled.

onStreamDisabled​

  • This event is triggered whenever a participant's video, audio or screen share stream is disabled.

Example​

Here is the usage of all the events mentioned in this page.

extension RoomViewController: ParticipantEventListener {

func onStreamEnabled(_ stream: RTCStream, forParticipant participant: Participant) {
print("Media Stream enabled for :", participant.displayName)
}

func onStreamDisabled(_ stream: RTCStream, forParticipant participant: Participant) {
print("Media Stream disabled for :", participant.displayName)
}
}

API Reference​

The API references for all the methods and events utilised in this guide are provided below.

Got a Question? Ask us on discord