Join call via link

Prerequisites#

Call should be initialised for the join call feature.

Get Call link#

When you are in ongoing audio/video call, you can get the call link by using the below method, that you can share with other users to join the call.

var callLink = await Mirrorfly.getCallLink();

This method will return a call link as String.

Initialisation#

Whenever you are in the join call UI, you need to initialise the join call setup in the call sdk by calling the below method.

Mirrorfly.initializeMeet(callLinkId: callLinkId,userName: userName,flyCallback: (res) {
if(res.isSuccess){
}
});
ArgumentTypeDescription
callLinkIdStringCall link ID for the ongoing call
userNameStringusername of the current user
flyCallbackFlyResponsecallback to observe the action status

Starting video capture#

When you are in the join call UI, you can call the below method to start the video capture.

Required permissions:

Manifest.permission.RECORD_AUDIO
Manifest.permission.CAMERA
Manifest.permission.READ_PHONE_STATE
Mirrorfly.startVideoCapture(flyCallback: (res) async {
if (res.isSuccess) {
}
});

Observing join call events#

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

ArgumentTypeDescription
callLinkEventListenersCallLinkEventListenersListener to observe the events
Mirrorfly.setCallLinkEventListener(callLinkEventListeners());

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

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

Joining the call#

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

Mirrorfly.joinCall(flyCallback: (res) {
if (res.isSuccess) {
} else {
}
});

clearing join call data#

Whenever you are leaving from the the join call UI, you should call the below method to cleanup the call data. you can preferably call the below method from your view onDispose.

Mirrorfly.disposePreview();

Note: you can use the same mute functions for the preview screen from call features link.