Call Features

Mute audio in call#

Whenever you are in the audio/video call, you can able to mute the mic so that receiver don't hear your voice or surrounding noise. In order the use the mute faeture you can utilise the method below:

await Mirrorfly.muteAudio(MUTE_AUDIO));
ArgumentTypeDescription
MUTE_AUDIObooleanPass true, if you want to disable audio else pass false

Mute video in call#

Whenever you are in the video call, you can able to turn off the camera so that receiver don't see your video. In order the use the video mute faeture you can utilise the method below:

await Mirrorfly.muteVideo(MUTE_VIDEO);
ArgumentTypeDescription
MUTE_VIDEObooleanPass true,if you want to disable audio else pass false

Check mute status of user in call#

At any time during a call, you can check the audio/video mute status of the end user.

Check Audio mute status#

To check the audio muted status, call the below method:

var muteStatus = await Mirrorfly.isUserAudioMuted(USER_JID);
ArgumentTypeDescription
USER_JIDStringUserJid of the user, optional param default Current User JID

Check Video mute status#

To check the video muted status, call the below method:

var videoMuteStatus = await Mirrorfly.isUserVideoMuted(USER_JID);
ArgumentTypeDescription
USER_JIDStringUserJid of the user, optional param default Current User JID

Audio device types#

To get the Available Audio Devices from Plugin, you can use the below method

Mirrorfly.getAllAvailableAudioInput().then((value) {
List<AudioDevices> availableList = audioDevicesFromJson(value);
});
Param NamesDescription
idDevice ID
typeDevice Type
nameDevice Name

Route audio via another device#

To route audio to another output device, call the below method and pass the device of your choice.

await Mirrorfly.routeAudioTo(routeType: ROUTE_TYPE);
ROUTE_TYPEDescription
bluetoothTo route Audio to Connected Bluetooth Device
headsetTo route Audio to Connected Headset
receiverTo route Audio to Device Receiver
speakerTo route Audio to Device speaker

Note: whenever you are connected to bluetooth headset while using sdk call, if the gsm call arrives and if you attends it then gsm call will take priority for the bluetooth headset.so, even if you disconnect the gsm call, bluetooth headset will not connect back to the sdk call.

Switching between camera in video call#

Whenever you are in video call, you can able to switch between camera's by using the below method.

await Mirrorfly.switchCamera();

switch audio call to video call#

Whenever you are in one to one audio call, you can able to switch to video call by using the below method.

await Mirrorfly.requestVideoCallSwitch();

Handling audio call to video call switch requests#

You need to check the below boolean flag using below method

await Mirrorfly.isCallConversionRequestAvailable();

If the above method returns true, you may need to show call switch requesting dialog with ACCEPT and REJECT buttons.

if the user accepts call switch then you need to call the below method to notify the call switch requested user.

await Mirrorfly.acceptVideoCallSwitchRequest();

If the user rejects call switch then you need to call the below method to notify the call switch requested user.

await Mirrorfly.declineVideoCallSwitchRequest();

Getting call logs from the sdk#

Call sdk keeps a local db for storing call logs which inlcudes all types of call logs with required information for the each and every call log. you can able to retrieve the call logs by using the below sdk method.

Mirrorfly.getCallLogsList(pageNumber).then((callLogList) {
if (callLogList != null) {
var data = json.decode(callLogList.toString());
}
}).catchError((error) {
});
ArgumentTypeDescription
PAGE_NUMBERIntnumber of the page

Note : To get a call logs of respective page, pass the page number pageNumber parameter.

Observing call logs changes from the sdk#

In order to observe the call log changes in sdk, you can set the below listener. Whenever a call log is updated in the db you will get notified by the onCallLogsUpdated() callback.

Mirrorfly.onCallLogsUpdated.listen((event) {
});

Getting missed call count#

The plugin maintains a local database for storing missed call logs, including the necessary information for each call log. You can retrieve the count of unread missed calls using the following method.

await Mirrorfly.getUnreadMissedCallCount();

Reset Missed Call Count#

When the user reads the missed calls in the UI, you need to notify the plugin using the below method to keep track of the actual unread missed call count.

await Mirrorfly.markAllUnreadMissedCallsAsRead();

Delete call log#

The plugin maintains a local database for storing call logs, which includes all types of call logs with the necessary information for each entry. You can delete a single or all call logs using the following method.

Mirrorfly.deleteCallLog(CALL_LOG_ID, IS_CLEAR_ALL).then((isSuccess) {
});
ArgumentTypeDescription
CALL_LOG_ID<String>Ids of the call log
IS_CLEAR_ALLBooleanPass true for clear all logs else false

Sync all call logs#

The plugin keeps a local database for storing call logs, including all types of call logs with the required information for each entry. You can synchronize all call logs to the API using the following method.

await Mirrorfly.syncCallLogs();