Joining a Meet

Prerequisites#

Meet sdk should be initialised, group call feature has to be enabled for the current plan and a valid Meetlink should be available.

info

Calling CallManager.createMeetlink() method will provide a unique meet id everytime.

For better user experience, users could be presented with a preview screen to observe the meet events, render local preview video, option to switch camera and mute the audio or video even before joining the meet. We can make use of the below methods for preview screen UI implementations.

Setup#

We must establish a connection to the meet server for further subscription, for that we need to call the below method before calling any other methods related to meet.

CallManager.setupJoinCallViaLink()
caution

Make sure to clean up meet data by the calling this Unsubscribe method before joining or to cancel a meet.

Subscribe#

SDK require the User to subscribe the link before joining the meet SDK requires the User to subscribe the link before joining the meet.Successful subscription will let us know of the participants of the ongoing meet and provide realtime updates of newly joined and recently left participates too. Also let the developers restrict the participants to a meet based on the requirements.

CallManager.subscribeCallEvents(callLink,userName, new JoinCallActionListener() {
@Override
public void onSuccess() {
}
@Override
public void onFailure(@NonNull Error error) {
}
});
caution

Make sure to ask for the Camera and Microphone access in th UI before joining/subscribing to a meet. Without Microphone permission SDK won't let users join a meet.

Observe#

When you are in the meet UI, you might need to observe the meet events to update the UI. You can use the below method to set the observer for the meet events from meet sdk.

ArgumentTypeDescription
joinCallListenerJoinCallListenerListener to observe the events
CallManager.setJoinCallEventsListener(new JoinCallListener(){
@Override
public void onSubscribeSuccess(){
//enable join call UI button here
}
@Override
public void onLocalTrack(@Nullable VideoTrack videoTrack){
if (videoTrack != null) {
videoTrack.addSink(CallManager.getLocalProxyVideoSink())
}
}
@Override
public void onUsersUpdated(@NonNull List<String> usersList){
// update the users list in ui here
}
@Override
public void onError(@NonNull String reason){
// show the error and close the ui here
}
});

onSubscribeSuccessevent will be fired once subscribeCallEvents() called and there is no failures, in this event only you need to enable the join call button in the UI.

onLocalTrack event will be fired once you called startVideoCapture() from the sdk and all the required permissions are already granted.

onUsersUpdated event will be fired whenever there is a changes in users list for the call, you can use this to update the users list in the join call UI screen as well as you can notify the user that call has been ended when there is no users in the list

onError event will be fired whenever there is a error occurred while joining the call.

info

onUsersUpdated event will be fired with an empty list if the call has been ended you can notify the ui by checking the users count in the list

Unsubscribe#

Whenever you are leaving from the the meet call UI, you should call the below method to cleanup the meet data. you can preferably call the below method from your activity onDestroy.

CallManager.cleanUpJoinCallViaLink();

Join#

When you are in the join meet UI, you can call the below method to start joining in the ongoing meet.

CallManager.joinCall(new JoinCallActionListener() {
@Override
public void onSuccess() {
}
@Override
public void onFailure(@NonNull Error error) {
}
});

End#

If you want to disconnect an ongoing meet at the end of conversation or when the user presses the end button of your meet UI , you need to call the below sdk method to disconnect the meet.

CallManager.disconnectCall();