Group call
This page describes the public group calling capabilities in Nexconn Call SDK for Android, including how to start a group call, join a call, invite participants, and handle call type upgrades.
Related APIs
| Capability | API |
|---|---|
| Start a group call | startCall(List<String>, NCCallType.MULTI, NCCallMediaType) |
Start a group call with push or extra | startCall(List<String>, NCCallType.MULTI, NCCallMediaType, INCCallPushConfig, String) |
| Join an existing group call | joinCall(String callId) |
| Invite participants | inviteToCall(List<String>) |
Invite participants with push or extra | inviteToCall(List<String>, INCCallPushConfig, String) |
| End or leave a call | endCall(String callId) or endCall() |
Start a group call
Set callType to NCCallType.MULTI for group calls.
List<String> userIds = Arrays.asList("user_a", "user_b");
NCCallEngine.getInstance().startCall(
userIds,
NCCallType.MULTI,
NCCallMediaType.VIDEO
);
The asynchronous result is returned through INCCallAPIResultListener#onStartCall(...):
NCCallEngine.getInstance().setAPIResultListener(new INCCallAPIResultListener() {
@Override
public void onStartCall(
NCCallCode code,
String callId,
List<INCCallUser> busyLineUserList
) {
// code == NCCallCode.SUCCESS means the call started successfully
// busyLineUserList contains users who are already on another call
}
});
Receive and join a group call
Invited users receive the incoming call through INCCallEventsListener#onCallReceived(...). After that, they can:
- Call
acceptCall(callId)to accept the current invitation. - Call
joinCall(callId)to join an ongoing group call whencallIdis already known. - Call
endCall(callId)to reject the invitation or leave the current call.
@Override
public void onCallReceived(INCCallSession callSession, String extra) {
String callId = callSession.getCallId();
// Example: accept the current group call
NCCallEngine.getInstance().acceptCall(callId);
}
Invite additional users
After a 1-to-1 call or a group call is established, you can invite more users:
NCCallEngine.getInstance().inviteToCall(
Arrays.asList("user_c", "user_d")
);
The result is returned through onInviteToCall(...). Other participants receive the invitation event through onRemoteUserInvited(...).
@Override
public void onRemoteUserInvited(
String callId,
ArrayList<String> inviteeUserList,
String inviterUserId
) {
// Invitation event broadcast received
}
Upgrade a 1-to-1 call to a group call
When a third participant is successfully invited into a 1-to-1 call, the current call can be upgraded to a group call. The SDK reports this through onCallTypeChanged(...):
@Override
public void onCallTypeChanged(String callId, NCCallType callType) {
if (callType == NCCallType.MULTI) {
// The current call session has been upgraded to a group call
}
}
Video views in a group call
In a group call, you usually create a separate remote view for each participant:
List<INCCallRemoteVideoView> remoteViews = new ArrayList<>();
remoteViews.add(new NCCallRemoteVideoView(context, "user_a", false));
remoteViews.add(new NCCallRemoteVideoView(context, "user_b", true));
NCCallEngine.getInstance().setVideoView(remoteViews);
If a participant leaves or you no longer need to show that participant's video, call removeVideoView(List<String> userIds) to remove the corresponding remote view.
End the call and manage call logs
- To leave the current group call, call
endCall()orendCall(callId). - The end result is returned through
onEndCall(...). - The final server-side call log is returned through
onServerCallLogReceived(INCCallLog). - Query call history with
getHistoryCallLogs(long syncTime, int count, NCCallLogOrder order).