public static interface Room.Listener
Modifier and Type | Method and Description |
---|---|
void |
onConnected(Room room)
Called when a room has succeeded.
|
void |
onConnectFailure(Room room,
TwilioException twilioException)
Called when a connection to a room failed.
|
void |
onDisconnected(Room room,
TwilioException twilioException)
Called when a room has been disconnected from.
|
default void |
onDominantSpeakerChanged(Room room,
RemoteParticipant remoteParticipant)
This method is called when the dominant speaker in the
Room changes. |
void |
onParticipantConnected(Room room,
RemoteParticipant remoteParticipant)
Called when a participant has connected to a room.
|
void |
onParticipantDisconnected(Room room,
RemoteParticipant remoteParticipant)
Called when a participant has disconnected from a room.
|
default void |
onParticipantReconnected(Room room,
RemoteParticipant remoteParticipant)
Called when a participant has reconnected to the room after a signaling connection
disruption.
|
default void |
onParticipantReconnecting(Room room,
RemoteParticipant remoteParticipant)
Called when a participant is reconnecting to the room after a signaling connection
disruption.
|
void |
onReconnected(Room room)
Called after the
LocalParticipant reconnects to a room after a network
disruption. |
void |
onReconnecting(Room room,
TwilioException twilioException)
Called when the
LocalParticipant has experienced a network disruption and the
client begins trying to reestablish a connection to a room. |
void |
onRecordingStarted(Room room)
This method is only called when a
Room which was not previously recording starts
recording. |
void |
onRecordingStopped(Room room)
This method is only called when a
Room which was previously recording stops
recording. |
void onConnected(@NonNull Room room)
room
- the connected room.void onConnectFailure(@NonNull Room room, @NonNull TwilioException twilioException)
room
- the room that failed to be connected to.twilioException
- an exception describing why connect failed.void onReconnecting(@NonNull Room room, @NonNull TwilioException twilioException)
LocalParticipant
has 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.
room
- the room the LocalParticipant
is attempting to reconnect to.twilioException
- An error explaining why the LocalParticipant
is
reconnecting to a room. Errors are limited to TwilioException.SIGNALING_CONNECTION_DISCONNECTED_EXCEPTION
and TwilioException.MEDIA_CONNECTION_ERROR_EXCEPTION
.void onReconnected(@NonNull Room room)
LocalParticipant
reconnects to a room after a network
disruption.room
- the room that was reconnected.void onDisconnected(@NonNull Room room, @Nullable TwilioException twilioException)
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.void onParticipantConnected(@NonNull Room room, @NonNull RemoteParticipant remoteParticipant)
room
- the room the participant connected to.remoteParticipant
- the newly connected participant.void onParticipantDisconnected(@NonNull Room room, @NonNull RemoteParticipant remoteParticipant)
room
- the room the participant disconnected from.remoteParticipant
- the disconnected participant.default void onParticipantReconnecting(@NonNull Room room, @NonNull RemoteParticipant remoteParticipant)
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.
room
- the room the participant is reconnecting to.remoteParticipant
- the reconnecting participant.default void onParticipantReconnected(@NonNull Room room, @NonNull RemoteParticipant remoteParticipant)
room
- the room the participant has reconnected to.remoteParticipant
- the reconnected participant.default void onDominantSpeakerChanged(@NonNull Room room, @Nullable RemoteParticipant remoteParticipant)
Room
changes. Either there
is a new dominant speaker, in which case Room.getDominantSpeaker()
returns the
RemoteParticipant
included in the event or there is no longer a dominant speaker,
in which case Room.getDominantSpeaker()
returns null
.
This method will not be called when one of the following conditions are true:
Room
topology is P2P.
ConnectOptions.Builder.enableDominantSpeaker(boolean)
room
- The Room
in which the dominant speaker changed.remoteParticipant
- The RemoteParticipant
that is currently the dominant
speaker or null
.void onRecordingStarted(@NonNull Room room)
Room
which was not previously recording starts
recording. If you've joined a Room
which is already recording this event will not
be fired.room
- 6.0.0