-
Notifications
You must be signed in to change notification settings - Fork 2
ApplicationCall
String id()
ApplicationCallOptions options()
Map<String, String> customData()
CallStatus status()
int duration()
Date startTime()
Date establishTime()
Date endTime()
String callsConfigurationId()
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 resetScreenShare()
void stopScreenShare() throws ActionFailedException
boolean hasScreenShare()
RTCVideoTrack localCameraTrack()
RTCVideoTrack localScreenShareTrack()
void setEventListener(ApplicationCallEventListener applicationCallEventListener)
ApplicationCallEventListener getEventListener()
void cameraOrientation(VideoOptions.CameraOrientation cameraOrientation
VideoOptions.CameraOrientation cameraOrientation()
void pauseIncomingVideo() throws ActionFailedException
void resumeIncomingVideo() throws ActionFailedException
void setNetworkQualityEventListener(NetworkQualityEventListener networkQualityEventListener)
NetworkQualityEventListener getNetworkQualityEventListener()
void setParticipantNetworkQualityEventListener(ParticipantNetworkQualityEventListener participantNetworkQualityEventListener)
ParticipantNetworkQualityEventListener getParticipantNetworkQualityEventListener()
AudioDeviceManager audioDeviceManager()
void audioQualityMode(AudioOptions.AudioQualityMode audioQualityMode)
AudioOptions.AudioQualityMode audioQualityMode()
DataChannel dataChannel()
VideoFilter getVideoFilter()
void setVideoFilter(VideoFilter videoFilter)
void clearVideoFilter()
void hangup()
RecordingState getRecordingState()
Returns a unique call identifier.
none
-
String
- Call ID.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
String id = applicationCall.id();
Returns call options used to construct an application call.
none
-
ApplicationCallOptions
- Call options.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
ApplicationCallOptions applicationCallOptions = applicationCall.options();
Getter for the customData
field.
none
-
Map<String, String>
- The value of thecustomData
.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
Map<String, String> customData = applicationCall.customData();
Returns current call status.
none
-
CallStatus
- Call status.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
CallStatus callStatus = applicationCall.status();
Returns call duration in seconds calculated from the time call was established. Initially, duration is 0
.
none
-
int
- Call duration
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
int callDuration = applicationCall.duration();
Returns the time when the call started (but was not yet established).
none
-
Date
- Time when the call was initiated.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
Date startTime = applicationCall.startTime();
Returns the time when the call was established. Initially, establishTime is null
.
none
-
Date
- Time when the call was established.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
Date establishTime = applicationCall.establishTime();
Returns the time when the call finished. Initially, endTime is null
.
none
-
Date
- Time when the call finished
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
Date endTime = applicationCall.endTime();
Returns a unique Calls Configuration identifier associated with your Calls Configuration logical entity created through our Calls API.
none
String
- Represents the Calls Configuration ID
which is
configured using
the Calls Configuration API
.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
String callsConfigurationId = applicationCall.callsConfigurationId();
Returns the list of participants currently connected with this application call.
none
-
List<Participant>
- List of participants.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
List<Participant> participants = applicationCall.participants();
Returns a list of participant's camera videos and screen shares.
none
-
Map<String, RemoteVideo>
- List of participant's camera videos and screen shares. Can be accessed by participant identifier.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
Map<String, RemoteVideo> remoteVideos = applicationCall.remoteVideos();
Toggles mute option.
-
shouldMute
:boolean
- Whether call should be muted after action or not.
N/A
-
ActionFailedException
- if muting fails for any reason.
private void example() {
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
try {
applicationCall.mute(true);
} catch (ActionFailedException e) {
Log.w("App", String.format("Failed to execute action. Error: %s", e.getErrorCode().getDescription()));
}
}
Returns information whether audio is muted or not.
none
-
boolean
- Is audio muted.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
boolean muted = applicationCall.muted();
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
- Whether sound should be played on the speakerphone or not.
N/A
private void example() {
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
applicationCall.speakerphone(true);
}
Returns information whether speakerphone is enabled or not.
none
-
boolean
- Is speakerphone on
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
boolean speakerphone = applicationCall.speakerphone();
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.
private void example() {
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
try {
applicationCall.sendDTMF("1");
} catch (ActionFailedException e) {
Log.w("App", String.format("Failed to execute action. Error: %s", e.getErrorCode().getDescription()));
}
}
Toggles whether camera video should be enabled or not. For video calls it is enabled by default.
-
cameraVideo
:boolean
- Whether camera video should be enabled or not.
N/A
-
ActionFailedException
- if toggling camera video fails for any reason.
private void example() {
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
try {
applicationCall.cameraVideo(true);
} catch (ActionFailedException e) {
Log.w("App", String.format("Failed to execute action. Error: %s", e.getErrorCode().getDescription()));
}
}
Returns information whether the current application call has camera video or not.
none
-
boolean
- Represents whether the application call has camera video.true
if it does, otherwisefalse
.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
boolean hasCameraVideo = applicationCall.hasCameraVideo();
Starts sharing screen with the remote peer. Needs to be called after CallEstablishedEvent is received.
Note: Starting from Android 14, screen share must be started from a foreground service. For more information, please refer to the Screen Share tutorial.
-
screenCapturer
:ScreenCapturer
- Screen capturer used for sharing.
N/A
-
ActionFailedException
- if starting screen share fails for any reason.
private void startScreenShare(int resultCode, Intent data) {
try {
ScreenCapturer screenCapturer = new ScreenCapturer(resultCode, data);
ApplicationCall applicationCall = InfobipRTC.getInstance().getActiveApplicationCall();
if (applicationCall != null) {
applicationCall.startScreenShare(screenCapturer);
}
} catch (ActionFailedException e) {
Log.e("ScreenShareService", "Failed to start screen share", e);
}
}
The size of the media projection can change when the device is rotated or the user selects an app window as the capture region in app screen sharing. The media projection might be letterboxed if the captured content differs from the window size obtained when screen sharing started.
To prevent this and ensure the projection matches the captured content’s size and aspect ratio, use this method to resize the capture whenever the content changes - whether due to rotation or a different windowing mode.
Note: On Android 14 and later, the system automatically handles resizing, so you only need to call this method on earlier versions. If called on Android 14 or later, it has no effect as it is ignored.
none
N/A
Specify the configuration changes your app handles by setting the android:configChanges
attribute of the <activity>
element in your AndroidManifest.xml
file.
Note: Android handles any configuration changes you don't specify in
configChanges
; that is, the system destroys and recreates your app's activities.
For example, enable your app to handle screen size and orientation changes:
<activity
android:name=".MainActivity"
android:configChanges="orientation|screenSize"/>
public class MainActivity extends AppCompatActivity {
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
// Check for screen size or orientation changes
if ((newConfig.configChanges & (Configuration.CONFIG_SCREEN_SIZE | Configuration.CONFIG_ORIENTATION)) != 0) {
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
applicationCall.resetScreenShare();
}
}
}
Stops sharing screen with the remote peer.
none
N/A
-
ActionFailedException
- if stopping screen share fails for any reason.
private void example() {
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
try {
applicationCall.stopScreenShare();
} catch (ActionFailedException e) {
Log.w("App", String.format("Failed to execute action. Error: %s", e.getErrorCode().getDescription()));
}
}
Returns true
if screen is being shared, otherwise else false
.
none
-
boolean
- Whether screen is being shared or not
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
boolean hasScreenShare = applicationCall.hasScreenShare();
Returns video track for local camera video.
none
-
RTCVideoTrack
- Represents participant's camera video track.
private void example() {
VideoRenderer localCameraVideoRenderer = findViewById(R.id.local_camera_video);
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
RTCVideoTrack localCamera = applicationCall.localCameraTrack();
if (localCamera != null) {
localCamera.addSink(localCameraVideoRenderer);
}
}
Returns video track for local screen share.
none
-
RTCVideoTrack
- Represents participant's screen share video track.
private void example() {
VideoRenderer localScreenShareVideoRenderer = findViewById(R.id.local_screen_share_video);
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
RTCVideoTrack localScreenShare = applicationCall.localScreenShareTrack();
if (localScreenShare != null) {
localScreenShare.addSink(localScreenShareVideoRenderer);
}
}
Configures event handler for application call events.
-
applicationCallEventListener
:ApplicationCallEventListener
- Interface with event methods that should be implemented, method per application call event to be handled.
N/A
private void example() {
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
applicationCall.setEventListener(new DefaultApplicationCallEventListener() {
@Override
public void onRinging(CallRingingEvent callRingingEvent) {
Toast.makeText(getApplicationContext(), "Ringing!", Toast.LENGTH_LONG);
}
@Override
public void onEstablished(CallEstablishedEvent callEstablishedEvent) {
Toast.makeText(getApplicationContext(), "Established!", Toast.LENGTH_LONG);
}
@Override
public void onHangup(CallHangupEvent callHangupEvent) {
Toast.makeText(getApplicationContext(), "Hangup!", Toast.LENGTH_LONG);
}
@Override
public void onError(ErrorEvent errorEvent) {
Toast.makeText(getApplicationContext(), "Error!", Toast.LENGTH_LONG);
}
});
}
Returns event handler for application call events.
none
-
ApplicationCallEventListener
- Interface that should be implemented in order to handle application call events properly.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
ApplicationCallEventListener applicationCallEventListener = applicationall.getEventListener();
Change local camera orientation.
-
cameraOrientation
:VideoOptions.CameraOrientation
- Camera orientation.
N/A
private void example() {
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
applicationCall.cameraOrientation(VideoOptions.CameraOrientation.BACK);
}
Get current camera orientation.
none
-
VideoOptions.CameraOrientation
- Camera orientation.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
VideoOptions.CameraOrientation cameraOrientation = applicationCall.cameraOrientation();
Pauses incoming video media.
none
N/A
-
ActionFailedException
- if a method is called while the call is in the process of reconnecting
private void example() {
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
try {
applicationCall.pauseIncomingVideo();
} catch (ActionFailedException e) {
Log.w("App", String.format("Failed to execute action. Error: %s", e.getErrorCode().getDescription()));
}
}
Resumes incoming video media.
none
N/A
-
ActionFailedException
- if a method is called while the call is in the process of reconnecting
private void example() {
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
try {
applicationCall.resumeIncomingVideo();
} catch (ActionFailedException e) {
Log.w("App", String.format("Failed to execute action. Error: %s", e.getErrorCode().getDescription()));
}
}
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
private void example() {
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
applicationCall.setNetworkQualityEventListener(networkQualityChangedEvent -> {
NetworkQuality networkQuality = networkQualityChangedEvent.getNetworkQuality();
Log.i("App", String.format("Local network quality is: %s (score: %s)", networkQuality, networkQuality.getScore()));
});
}
Returns event handler for local network quality events.
none
-
NetworkQualityEventListener
- An interface that should be implemented in order to handle local network quality events properly.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
NetworkQualityEventListner networkQualityEventListner = applicationCall.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
private void example() {
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
applicationCall.setParticipantNetworkQualityEventListener(participantNetworkQualityChangedEvent -> {
Participant participant = participantNetworkQualityChangedEvent.getParticipant();
NetworkQuality networkQuality = participantNetworkQualityChangedEvent.getNetworkQuality();
Log.i("App", 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();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
ParticipantNetworkQualityEventListener participantNetworkQualityEventListener = applicationCall.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();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
AudioDeviceManager audioDeviceManager = applicationCall.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
private void example() {
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
applicationCall.audioQualityMode(AudioOptions.AudioQualityMode.LOW_DATA);
}
Returns the audio quality mode that is used during the call.
none
-
AudioQualityMode
- Enum value that corresponds to the audio quality mode.
private void example() {
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
AudioOptions.AudioQualityMode audioQualityMode = applicationCall.audioQualityMode();
}
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();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
DataChannel dataChannel = applicationCall.dataChannel();
This method returns the instance of VideoFilter
currently in use.
none
-
VideoFilter
- An instance ofVideoFilter
.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
VideoFilter videoFilter = applicationCall.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
private void example() {
VideoFilter videoFilter = createVideoFilter();
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
applicationCall.setVideoFilter(videoFilter);
}
This convenience method removes the video filter if it is present.
none
N/A
private void example() {
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
applicationCall.clearVideoFilter();
}
Hangs up call.
none
N/A
private void example() {
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
applicationCall.hangup();
}
Returns the instance of the current RecordingState
.
none
-
RecordingState
- An instance ofRecordingState
representing the recording state of the currently active call/conference/dialog.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
RecordingState recordingState = applicationCall.getRecordingState();