-
Notifications
You must be signed in to change notification settings - Fork 2
RoomCall
String id()
RoomCallOptions options()
CallStatus status()
String name()
int duration()
Date joinTime()
Date leaveTime()
List<Participant> participants()
Map<String, RemoteVideo> remoteVideos()
void mute(boolean shouldMute) throws ActionFailedException
boolean muted()
void speakerphone(boolean enabled)
boolean speakerphone()
void sendDTMF(String dtmf) throws ActionFailedException
void cameraVideo(boolean cameraVideo) throws ActionFailedException
boolean hasCameraVideo()
void startScreenShare(ScreenCapturer screenCapturer) throws ActionFailedException
void stopScreenShare() throws ActionFailedException
boolean hasScreenShare()
RTCVideoTrack localCameraTrack()
RTCVideoTrack localScreenShareTrack()
void setEventListener(RoomCallEventListener roomCallEventListener)
RoomCallEventListener getEventListener()
void cameraOrientation(VideoOptions.CameraOrientation cameraOrientation
VideoOptions.CameraOrientation cameraOrientation()
void pauseIncomingVideo()
void resumeIncomingVideo()
void setNetworkQualityEventListener(NetworkQualityEventListener networkQualityEventListener)
NetworkQualityEventListener getNetworkQualityEventListener()
void setParticipantNetworkQualityEventListener(ParticipantNetworkQualityEventListener participantNetworkQualityEventListener)
ParticipantNetworkQualityEventListener getParticipantNetworkQualityEventListener()
AudioDeviceManager audioDeviceManager()
void audioQualityMode(AudioOptions.AudioQualityMode audioQualityMode)
DataChannel dataChannel()
VideoFilter getVideoFilter()
void setVideoFilter(VideoFilter videoFilter)
void clearVideoFilter()
void leave()
Returns a unique call identifier.
none
-
String
- Call ID.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
Toast.makeText(getApplicationContext(), "Call ID: " + roomCall.id(), Toast.LENGTH_LONG);
Getter for the options
field.
none
-
RoomCallOptions
- Value of theoptions
field representing the call options which the room is joined with.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
RoomCallOptions roomCallOptions = roomCall.options();
Toast.makeText(getApplicationContext(), "Call options: " + roomCallOptions, Toast.LENGTH_LONG);
Returns current call status.
none
-
CallStatus
- Value of thestatus
field representing the status of the call.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
CallStatus status = roomCall.status();
Toast.makeText(getApplicationContext(), "Call status: " + status, Toast.LENGTH_LONG);
Returns a room name.
none
-
String
- Value of thename
field representing a room name chosen by a room creator.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
String name = roomCall.name();
Toast.makeText(getApplicationContext(), "Room name: " + name, Toast.LENGTH_LONG);
Returns call duration in seconds calculated from the time of joining a room. Initially, duration is 0
.
none
-
int
- Call duration
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
int duration = roomCall.duration();
Toast.makeText(getApplicationContext(), "Call duration: " + duration, Toast.LENGTH_LONG);
Returns time when the user joined the room. Initially, joinTime is null
.
none
-
Date
- Time when user joined the room
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
Date joinTime = roomCall.joinTime();
Toast.makeText(getApplicationContext(), "Call duration: " + joinTime, Toast.LENGTH_LONG);
Returns time when the user left the room. Initially, joinTime is null
.
none
-
Date
- Time when user left the room
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
Date leaveTime = roomCall.leaveTime();
Toast.makeText(getApplicationContext(), "Call duration: " + leaveTime, Toast.LENGTH_LONG);
Returns the list of participants currently present in the room.
none
-
List<Participant>
- List of participants.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
List<Participant> participants = roomCall.participants();
Returns a map of other participants' videos who currently have their video(s) enabled in the room.
none
-
Map<String, RemoteVideo>
- Map that contains remote videos as values and participants' identifiers as keys.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
Map<String, RemoteVideo> remoteVideos = roomCall.remoteVideos();
Controls whether the user's audio in the room call should be muted after this action. Disabled by default.
-
shouldMute
:boolean
-true
if the audio should be muted, otherwisefalse
.
N/A
-
ActionFailedException
- if muting fails for any reason.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
roomCall.mute(true);
Returns information whether the user's audio in the room is muted.
none
-
boolean
- trueif the audio is muted, otherwise
false`.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
String muted = roomCall.muted() ? "muted" : "not muted";
Toast.makeText(getApplicationContext(), "Audio is " + muted , Toast.LENGTH_LONG);
Controls whether the audio should be played on the speakerphone. Disabled by default. If disabled, the audio will be played through the next available audio device based on the priority order.
-
enabled
:boolean
-true
if the audio should be played on speakerphone, otherwisefalse
.
N/A
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
roomCall.speakerphone(true);
Returns information whether speakerphone is enabled or not.
none
-
boolean
-true
if the speakerphone is enabled, otherwisefalse
.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
String speakerphoneOn = roomCall.speakerphone() ? "on" : "off";
Toast.makeText(getApplicationContext(), "Speakerphone is " + speakerphoneOn, Toast.LENGTH_LONG);
Simulates key-press by sending DTMF (Dual-Tone Multi-Frequency) entry.
-
dtmf
:String
- One of the allowed DTMF characters:- digits:
0
to9
- letters:
A
toD
- symbols:
*
and#
- digits:
N/A
-
ActionFailedException
- if sending DTMF fails for any reason.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
roomCall.sendDTMF("7");
Controls whether the local camera video should be enabled.
-
cameraVideo
:boolean
- Whether camera video should be enabled or not.
N/A
-
ActionFailedException
-true
if local camera video should be enabled, otherwisefalse
.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
roomCall.cameraVideo(true);
Returns information whether the user has local camera video enabled.
none
-
boolean
-true
if the user has local camera video enabled, otherwisefalse
.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
boolean hasCameraVideo = roomCall.hasCameraVideo();
Starts sharing screen with the active room call. Needs to be called after RoomJoinedEvent is received.
-
ScreenCapturer
- Screen capturer used for sharing.
N/A
-
ActionFailedException
- if starting screen share fails for any reason.
public class Foo extends AppCompatActivity {
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode != 1) {
return;
}
ScreenCapturer screenCapturer = new ScreenCapturer(resultCode, data);
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
roomCall.startScreenShare(screenCapturer);
}
}
Stops sharing screen with the room.
none
N/A
-
ActionFailedException
- if stopping screen share fails for any reason.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
roomCall.stopScreenShare();
Returns information whether the user has local screen share video enabled.
none
-
boolean
-true
if the user has local screen share video enabled, otherwisefalse
.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
Log.d("WebRTC", String.format("Has screen share: %s", roomCall.hasScreenShare()));
Returns video track for local camera video.
none
-
RTCVideoTrack
- Video track representing local camera stream.null
if there is no local camera video.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
RTCVideoTrack localCamera = roomCall.localCameraTrack();
if (localCamera != null) {
localCamera.addSink(localVideoRenderer);
}
Returns video track for local screen share.
none
-
RTCVideoTrack
- Video track representing local screen share stream.null
if there is no local screen share.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
RTCVideoTrack localScreenShare = roomCall.localScreenShareTrack();
if (localScreenShare != null) {
localScreenShare.addSink(localVideoRenderer);
}
Configures event handler for room call events.
-
roomCallEventListener
:RoomCallEventListener
- Interface with event methods that should be implemented, method per room call event to be handled.
N/A
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
roomCall.setEventListener(new DefaultRoomCallEventListener() {
@Override
public void onRoomJoined(RoomJoinedEvent roomJoinedEvent) {
Toast.makeText(getApplicationContext(), "Room joined!", Toast.LENGTH_LONG);
}
@Override
public void onParticipantJoined(ParticipantJoinedEvent participantJoinedEvent) {
Toast.makeText(getApplicationContext(), "Participant joined!", Toast.LENGTH_LONG);
}
@Override
public void onParticipantLeft(ParticipantLeftEvent participantLeftEvent) {
Toast.makeText(getApplicationContext(), "Participant left!", Toast.LENGTH_LONG);
}
});
Returns event handler for room call events.
none
-
RoomCallEventListener
- Interface that should be implemented in order to handle room call events properly.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
RoomCallEventListener roomCallEventListener = roomCall.getEventListener();
Change the local camera facing mode. No action will be performed if the current camera facing mode is the same as the
requested one. Default value is FRONT
.
-
none
:VideoOptions.CameraOrientation
- Camera facing mode.
N/A
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
roomCall.cameraOrientation(VideoOptions.CameraOrientation.BACK);
Returns the current camera facing mode.
none
-
VideoOptions.CameraOrientation
- Camera facing mode.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
String cameraOrientation = roomCall.cameraOrientation().name();
Toast.makeText(getApplicationContext(), "Camera orientation is " + cameraOrientation, Toast.LENGTH_LONG);
Pauses incoming video media.
none
N/A
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
roomCall.pauseIncomingVideo();
Resumes incoming video media.
none
N/A
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
roomCall.resumeIncomingVideo();
Configures event handler for local network quality events.
-
networkQualityEventListener
:networkQualityEventListener
- Interface that should be implemented in order to handle local network quality events properly.
N/A
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
roomCall.setNetworkQualityEventListener(new NetworkQualityEventListener() {
@Override
public void onNetworkQualityChanged(NetworkQualityChangedEvent networkQualityChangedEvent) {
NetworkQuality networkQuality = networkQualityChangedEvent.getNetworkQuality();
Log.d("WebRTC", String.format("Local network quality is: %s (score: %s)", networkQuality, networkQuality.getScore()));
}
});
Returns event handler for local network quality events.
none
-
NetworkQualityEventListener
- Interface that should be implemented in order to handle local network quality events properly.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
NetworkQualityEventListner networkQualityEventListner = roomCall.getNetworkQualityEventListener();
Configures event handler for other participant's network quality events.
-
participantNetworkQualityEventListener
:ParticipantNetworkQualityEventListener
- Interface that should be implemented in order to handle other participant's network quality events properly.
N/A
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
roomCall.setParticipantNetworkQualityEventListener(new ParticipantNetworkQualityEventListener() {
@Override
public void onParticipantNetworkQualityChanged(ParticipantNetworkQualityChangedEvent participantNetworkQualityChangedEvent) {
Participant participant = participantNetworkQualityChangedEvent.getParticipant();
NetworkQuality networkQuality = participantNetworkQualityChangedEvent.getNetworkQuality();
Log.d("WebRTC",String.format("%s's network quality changed to %s (value %s)", participant.getEndpoint().identifier(), networkQuality, networkQuality.getScore()));
}
});
Returns event handler for other participant's network quality events.
none
-
ParticipantNetworkQualityEventListener
- An interface that should be implemented in order to handle other participant's network quality events properly.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
ParticipantNetworkQualityEventListener participantNetworkQualityEventListener = roomCall.getParticipantNetworkQualityEventListener();
Returns the instance of AudioDeviceManager
that should be used to manage the audio devices in
the current call.
none
-
AudioDeviceManager
- An instance ofAudioDeviceManager
specifically designed for handling audio devices.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
AudioDeviceManager audioDeviceManager = roomCall.audioDeviceManager();
Sets the audio quality mode to a given enum value.
-
audioQualityMode
:AudioOptions.AudioQualityMode
- Enum value that corresponds to the audio quality mode.
N/A
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
roomCall.audioQualityMode(AudioOptions.AudioQualityMode.LOW_DATA);
Returns the instance of DataChannel
that should be used to send and receive data during the current
call.
none
-
DataChannel
- An instance ofDataChannel
specifically designed for handling actions on data channel.null
if data channel is not enabled in call options.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
DataChannel dataChannel = roomCall.dataChannel();
This method returns the instance of VideoFilter
currently in use.
none
-
VideoFilter
- An instance ofVideoFilter
.
// Retrieve the active room call and get the video filter
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
VideoFilter videoFilter = roomCall.getVideoFilter();
This method sets the video filter to be used during the video call. Passing null
will remove and release any already
existing video filter.
-
videoFilter
:VideoFilter
- An instance ofVideoFilter
.
N/A
// Create a video filter
VideoFilter videoFilter = createVideoFilter();
// Set the video filter for the active room call
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
roomCall.setVideoFilter(videoFilter);
This convenience method removes the video filter if it is present.
none
N/A
// Clear the video filter for the active room call
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
roomCall.clearVideoFilter();
Leaves the room, which results in the following events:
- user who left the room receives the
RoomLeftEvent
- all the other participants who remained in the room receive the
ParticipantLeftEvent
referencing the participant who left the room
none
N/A
InfobipRTC infobipRTC = InfobipRTC.getInstance();
RoomCall roomCall = infobipRTC.getActiveRoomCall();
roomCall.leave();