Adding video calls to messaging

How to add video call capabilities to the messaging components

Video call SDK dependency

To add video calls capability to the messaging module, add the following line to your build.gradle:

implementation 'com.nabla.nabla-android:video-call:1.1.3'

Set up video call module

The next step is to set up the NablaVideoCallModule when you init the NablaClient:

class MyApp : Application() {
    override fun onCreate() {
        super.onCreate()

        NablaClient.initialize(
            modules = listOf(
                NablaMessagingModule(),
                NablaVideoCallModule(), // Add this line
            )
        )
    }
}

Build and run your app, you should now be able to receive video call CTAs in a conversation and answer them.

Your first video call

Preview of the video call

From the Nabla Console, a provider can now send a video call CTA that the patient can tap to join the call.

The patient will have to accept the Microphone and Camera permissions and will then be able to join the call.

Theming

You can override Video call specific attributes by providing your own Nabla.ThemeOverlay.VideoCall. Here's how it works:

<style name="Theme.Example.Blue" parent="Theme.Material3.Light.NoActionBar">
    <!-- Rest of your theme -->

    <item name="nablaVideoCallThemeOverlay">@style/NablaOverlay.Example.VideoCall</item>
</style>

<style name="NablaOverlay.Example.VideoCall" parent="Nabla.ThemeOverlay.VideoCall">
    <item name="nablaVideoCall_micIcon">@drawable/customMicIcon</item>
</style>

Attributes list

Here are all the attributes you can customise:

Theme attributeDescriptionDefault value
nablaVideoCall_micIconDrawable to be shown in the button to disable or enable the microphone during the call.@drawable/nabla_video_call_ic_mic
nablaVideoCall_cameraIconDrawable to be shown in the button to disable or enable camera during the call.@drawable/nabla_video_call_ic_camera
nablaVideoCall_flipIconDrawable to be shown in the button to flip cameras during the call.@drawable/nabla_video_call_ic_flip_camera
nablaVideoCall_hangupIconDrawable to be shown in the button to hang up the call.@drawable/nabla_video_call_ic_hang_up