Package com.twilio.video
Class Room
- java.lang.Object
-
- com.twilio.video.Room
-
- All Implemented Interfaces:
AudioProcessorSupportCheck
public class Room extends java.lang.Object implements AudioProcessorSupportCheck
A Room represents a media session with zero or more remote Participants. Media shared by any oneRemoteParticipantis distributed equally to all other Participants.A subset of Android devices provide an OpenSLES implementation. Although more efficient, the use of OpenSLES occasionally results in echo. As a result, the Video SDK disables OpenSLES by default unless explicitly enabled. To enable OpenSLES, execute the following before invoking
Video.connect(...)tvi.webrtc.voiceengine.WebRtcAudioManager.setBlacklistDeviceForOpenSLESUsage(false)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceRoom.ListenerListener definition of room related events.static classRoom.StateRepresents the current state of aRoom.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddisconnect()Disconnects from the room.RemoteParticipantgetDominantSpeaker()Returns the dominant speaker of theRoom.LocalParticipantgetLocalParticipant()Returns the current local participant.java.lang.StringgetMediaRegion()Returns the region where media is processed.java.lang.StringgetName()Returns the name of the current room.java.util.List<RemoteParticipant>getRemoteParticipants()Returns all currently connected participants.java.lang.StringgetSid()Returns the SID of the current room.Room.StategetState()Returns the current room state.voidgetStats(StatsListener statsListener)Retrieve stats for all media tracks and notifyStatsListenervia calling thread.booleanisAudioProcessorSupported(java.lang.String audioProcessorName)DO NOT USE, For internal use only, verifies if audio processor is supported.booleanisRecording()Returns whether any media in the Room is being recorded.
-
-
-
Method Detail
-
getName
@NonNull public java.lang.String getName()
Returns the name of the current room. This method will return the SID if the room was created without a name.
-
getSid
@NonNull public java.lang.String getSid()
Returns the SID of the current room.
-
getMediaRegion
@Nullable public java.lang.String getMediaRegion()
Returns the region where media is processed. This property is set in Group Rooms by the time theRoomreachesRoom.State.CONNECTED. This method returnsnullunder the following conditions:- The
Roomhas not reached theRoom.State.CONNECTEDstate. - The instance represents a peer-to-peer Room.
- The
-
getState
@NonNull public Room.State getState()
Returns the current room state.
-
getDominantSpeaker
@Nullable public RemoteParticipant getDominantSpeaker()
Returns the dominant speaker of theRoom.To enable this feature, add an invocation of
ConnectOptions.Builder.enableDominantSpeakerwithtruewhen building yourConnectOptions. This method returnsnullwhen one of the following conditions are true:- The
Roomtopology is P2P. - The dominant speaker feature was not enabled via
ConnectOptions.Builder.enableDominantSpeaker. - There is currently no dominant speaker.
- The
-
isRecording
public boolean isRecording()
Returns whether any media in the Room is being recorded.
-
getRemoteParticipants
@NonNull public java.util.List<RemoteParticipant> getRemoteParticipants()
Returns all currently connected participants.- Returns:
- list of participants.
-
getLocalParticipant
@Nullable public LocalParticipant getLocalParticipant()
Returns the current local participant. If the room has not reachedRoom.State.CONNECTEDthen this method will return null.
-
getStats
public void getStats(@NonNull StatsListener statsListener)Retrieve stats for all media tracks and notifyStatsListenervia calling thread. In case where room is inRoom.State.DISCONNECTEDstate, reports won't be delivered.- Parameters:
statsListener- listener that receives stats reports for all media tracks.
-
disconnect
public void disconnect()
Disconnects from the room.
-
isAudioProcessorSupported
public boolean isAudioProcessorSupported(java.lang.String audioProcessorName)
DO NOT USE, For internal use only, verifies if audio processor is supported.- Specified by:
isAudioProcessorSupportedin interfaceAudioProcessorSupportCheck
-
-