Package com.twilio.video
Interface Room.Listener
-
- Enclosing class:
- Room
public static interface Room.ListenerListener definition of room related events.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidonConnected(Room room)Called when a room has succeeded.voidonConnectFailure(Room room, TwilioException twilioException)Called when a connection to a room failed.voidonDisconnected(Room room, TwilioException twilioException)Called when a room has been disconnected from.default voidonDominantSpeakerChanged(Room room, RemoteParticipant remoteParticipant)This method is called when the dominant speaker in theRoomchanges.voidonParticipantConnected(Room room, RemoteParticipant remoteParticipant)Called when a participant has connected to a room.voidonParticipantDisconnected(Room room, RemoteParticipant remoteParticipant)Called when a participant has disconnected from a room.default voidonParticipantReconnected(Room room, RemoteParticipant remoteParticipant)Called when a participant has reconnected to the room after a signaling connection disruption.default voidonParticipantReconnecting(Room room, RemoteParticipant remoteParticipant)Called when a participant is reconnecting to the room after a signaling connection disruption.voidonReconnected(Room room)Called after theLocalParticipantreconnects to a room after a network disruption.voidonReconnecting(Room room, TwilioException twilioException)Called when theLocalParticipanthas experienced a network disruption and the client begins trying to reestablish a connection to a room.voidonRecordingStarted(Room room)This method is only called when aRoomwhich was not previously recording starts recording.voidonRecordingStopped(Room room)This method is only called when aRoomwhich was previously recording stops recording.
-
-
-
Method Detail
-
onConnected
void onConnected(@NonNull Room room)Called when a room has succeeded.- Parameters:
room- the connected room.
-
onConnectFailure
void onConnectFailure(@NonNull Room room, @NonNull TwilioException twilioException)Called when a connection to a room failed.- Parameters:
room- the room that failed to be connected to.twilioException- an exception describing why connect failed.
-
onReconnecting
void onReconnecting(@NonNull Room room, @NonNull TwilioException twilioException)Called when theLocalParticipanthas experienced a network disruption and the client begins trying to reestablish a connection to a room.The SDK groups network disruptions into two categories: signaling and media. The occurrence of either of these network disruptions will result in the onReconnecting callback. During a media reconnection signaling related methods may continue to be invoked.
- Parameters:
room- the room theLocalParticipantis attempting to reconnect to.twilioException- An error explaining why theLocalParticipantis reconnecting to a room. Errors are limited toTwilioException.SIGNALING_CONNECTION_DISCONNECTED_EXCEPTIONandTwilioException.MEDIA_CONNECTION_ERROR_EXCEPTION.
-
onReconnected
void onReconnected(@NonNull Room room)Called after theLocalParticipantreconnects to a room after a network disruption.- Parameters:
room- the room that was reconnected.
-
onDisconnected
void onDisconnected(@NonNull Room room, @Nullable TwilioException twilioException)Called when a room has been disconnected from.- Parameters:
room- the room that was disconnected from.twilioException- An exception if there was a problem that caused the room to be disconnected from. This value will be null is there were no problems disconnecting from the room.
-
onParticipantConnected
void onParticipantConnected(@NonNull Room room, @NonNull RemoteParticipant remoteParticipant)Called when a participant has connected to a room.- Parameters:
room- the room the participant connected to.remoteParticipant- the newly connected participant.
-
onParticipantDisconnected
void onParticipantDisconnected(@NonNull Room room, @NonNull RemoteParticipant remoteParticipant)Called when a participant has disconnected from a room. The disconnected participant's audio and video tracks will still be available in their last known state. Video tracks sinks are removed when a participant is disconnected.- Parameters:
room- the room the participant disconnected from.remoteParticipant- the disconnected participant.
-
onParticipantReconnecting
default void onParticipantReconnecting(@NonNull Room room, @NonNull RemoteParticipant remoteParticipant)Called when a participant is reconnecting to the room after a signaling connection disruption.Note: It can take up to 15 seconds for our signaling backend to detect that a RemoteParticipant's connection has been disrupted due to a network degradation or handoff.
- Parameters:
room- the room the participant is reconnecting to.remoteParticipant- the reconnecting participant.
-
onParticipantReconnected
default void onParticipantReconnected(@NonNull Room room, @NonNull RemoteParticipant remoteParticipant)Called when a participant has reconnected to the room after a signaling connection disruption.- Parameters:
room- the room the participant has reconnected to.remoteParticipant- the reconnected participant.
-
onDominantSpeakerChanged
default void onDominantSpeakerChanged(@NonNull Room room, @Nullable RemoteParticipant remoteParticipant)This method is called when the dominant speaker in theRoomchanges. Either there is a new dominant speaker, in which caseRoom.getDominantSpeaker()returns theRemoteParticipantincluded in the event or there is no longer a dominant speaker, in which caseRoom.getDominantSpeaker()returnsnull.This method will not be called when one of the following conditions are true:
- The
Roomtopology is P2P. - The dominant speaker feature was not enabled via
ConnectOptions.Builder.enableDominantSpeaker(boolean)
- Parameters:
room- TheRoomin which the dominant speaker changed.remoteParticipant- TheRemoteParticipantthat is currently the dominant speaker ornull.
- The
-
onRecordingStarted
void onRecordingStarted(@NonNull Room room)This method is only called when aRoomwhich was not previously recording starts recording. If you've joined aRoomwhich is already recording this event will not be fired.- Parameters:
room-
-
-