-
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 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()
void resumeIncomingVideo()
void setNetworkQualityEventListener(NetworkQualityEventListener networkQualityEventListener)
NetworkQualityEventListener getNetworkQualityEventListener()
void setParticipantNetworkQualityEventListener(ParticipantNetworkQualityEventListener participantNetworkQualityEventListener)
ParticipantNetworkQualityEventListener getParticipantNetworkQualityEventListener()
AudioDeviceManager audioDeviceManager()
void audioQualityMode(AudioOptions.AudioQualityMode audioQualityMode)
DataChannel dataChannel()
void setReconnectHandler(ReconnectHandler reconnectHandler)
ReconnectHandler getReconnectHandler()
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();
Toast.makeText(getApplicationContext(), "Call ID: " + applicationCall.id(), Toast.LENGTH_LONG);
Returns call options used to construct an application call.
none
-
ApplicationCallOptions
- Call options.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
Toast.makeText(getApplicationContext(), "Call options: " + applicationCall.options(), Toast.LENGTH_LONG);
Getter for the customData
field
none
-
Map<String, String>
- Value of thecustomData
.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
Toast.makeText(getApplicationContext(), "Custom data: " + applicationCall.customData(), Toast.LENGTH_LONG);
Returns current call status.
none
-
CallStatus
- Call status.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
Toast.makeText(getApplicationContext(), "Call status: " + applicationCal.status(), Toast.LENGTH_LONG);
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();
applicationCall.setEventListener(new DefaultApplicationCallEventListener() {
@Override
public void onHangup(CallHangupEvent callHangupEvent) {
int durationInSeconds = applicationCall.duration();
int seconds = durationInSeconds % 60;
long minutes = durationInSeconds / 60 % 60;
long hours = durationInSeconds / 3600;
String duration = String.format(Locale.getDefault(), "%02d:%02d:%02d", hours, minutes, seconds);
Toast.makeText(getApplicationContext(), "Duration: " + duration, Toast.LENGTH_LONG);
}
});
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();
Toast.makeText(getApplicationContext(), "Start time: " + applicationCal.startTime(), Toast.LENGTH_LONG).show();
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();
applicationCall.setEventListener(new DefaultApplicationCallEventListener() {
@Override
public void onEstablished(CallEstablishedEvent callEstablishedEvent) {
Toast.makeText(getApplicationContext(), "Establish time: " + applicationCall.establishTime(), Toast.LENGTH_LONG);
}
});
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();
applicationCall.setEventListener(new DefaultApplicationCallEventListener() {
@Override
public void onHangup(CallHangupEvent callHangupEvent) {
Toast.makeText(getApplicationContext(), "End time: " + applicationCall.endTime(), Toast.LENGTH_LONG);
}
});
applicationCall.hangup();
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();
Toast.makeText(getApplicationContext(), "Calls Configuration ID: " + applicatioCall.callsConfigurationId(), Toast.LENGTH_LONG);
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();
for (Participant participant : applicationCall.participants()) {
Log.d("WebRTC", String.format("Participant name: %s", participant.endpoint.displayIdentifier()));
}
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.
Toggles mute option.
-
shouldMute
:boolean
- Whether call should be muted after action or not.
N/A
-
ActionFailedException
- if muting fails for any reason.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
applicationCall.mute(true);
Returns information whether audio is muted or not.
none
-
boolean
- Is audio muted
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
String muted = applicationCall.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
- Whether sound should be played on the speakerphone or not.
N/A
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();
String speakerphoneOn = applicationCall.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();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
applicationCall.sendDTMF("1");
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.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
applicationCall.cameraVideo(true);
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();
String hasCameraVideo = applicationCall.hasCameraVideo() ? "has" : "doesn't have";
Toast.makeText(getApplicationContext(), "Call " + hasCameraVideo + " camera video", Toast.LENGTH_LONG);
Starts sharing screen with the remote peer. Needs to be called after CallEstablishedEvent is received.
-
screenCapturer
: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();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
applicationCall.startScreenShare(screenCapturer);
}
public void startScreenShare() {
MediaProjectionManager mediaProjectionManager = (MediaProjectionManager) getApplication().getSystemService(Context.MEDIA_PROJECTION_SERVICE);
startActivityForResult(mediaProjectionManager.createScreenCaptureIntent(), 1);
}
}
Stops sharing screen with the remote peer.
none
N/A
-
ActionFailedException
- if stopping screen share fails for any reason.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
applicationCall.stopScreenShare();
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();
Log.d("WebRTC", String.format("Application call %s is sharing screen: %s", applicationCall.id(), applicationCall.hasScreenShare()));
Returns video track for local camera video.
none
-
RTCVideoTrack
- Represents participant's camera video track.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
RTCVideoTrack localCamera = applicationCall.localCameraTrack();
if (localCamera != null) {
localCamera.addSink(localVideoRenderer);
}
Returns video track for local screen share.
none
-
RTCVideoTrack
- Represents participant's camera video track.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
RTCVideoTrack localScreenShare = applicationCall.localScreenShareTrack();
if (localScreenShare != null) {
localScreenShare.addSink(localVideoRenderer);
}
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
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
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();
String cameraOrientation = applicationCall.cameraOrientation().name();
Toast.makeText(getApplicationContext(),"Camera orientation is " + cameraOrientation, Toast.LENGTH_LONG);
Pauses incoming video media.
none
N/A
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
applicationCall.pauseIncomingVideo();
Resumes incoming video media.
none
N/A
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
applicationCall.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();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
applicationCall.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
- 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
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
applicationCall.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();
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
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
applicationCall.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();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
DataChannel dataChannel = applicationCall.dataChannel();
Setter for the reconnectHandler
field. If you want to receive ReconnectingEvent
and ReconnectedEvent
, you must set the custom implementation of the
ReconnectHandler
.
-
reconnectHandler
:ReconnectHandler
- Interface that should be implemented in order to enable the reconnection of the call when the connection is lost.
N/A
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
applicationCall.setReconnectHandler(new ReconnectHandler() {
@Override
public ApplicationCallOptions prepareForReconnect(String reconnectingCallId, ApplicationCallOptions reconnectingCallOptions) {
Log.d("WebRTC", String.format("Preparing room call for reconnect, reconnecting call id is: %s", reconnectingCallId));
// Add any custom data that will help you handle the reconnect flow on your backend application
reconnectingCallOptions.getCustomData().put("reconnectingCallId", reconnectingCallId);
return reconnectingCallOptions;
}
});
Returns the instance of ReconnectHandler
that should be used to manage the reconnection of the
current call when the connection is lost.
none
-
ReconnectHandler
- An instance ofReconnectHandler
specifically designed for handling the process of reconnecting the call.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
ReconnectHandler reconnectHandler = applicationCall.getReconnectHandler();
This method returns the instance of VideoFilter
currently in use.
none
-
VideoFilter
- An instance ofVideoFilter
.
// Retrieve the active application call and get the video filter
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
// Create a video filter
VideoFilter videoFilter = createVideoFilter();
// Set the video filter for the active application call
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
// Clear the video filter for the active application call
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ApplicationCall applicationCall = infobipRTC.getActiveApplicationCall();
applicationCall.clearVideoFilter();
Hangs up call.
none
N/A
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().getCallRecording();