Customization

The Android UI Kit provides a rich set of APIs via EnxSetting to control the join experience, customize the UI, enable or disable specific features, and manage session behavior programmatically. This gives you fine-grained control without needing to rebuild any UI components from scratch.

All customization is done through the EnxSetting singleton. Obtain the instance and configure it before calling EnxVideoView:

val setting = EnxSetting.getInstance(this)
Configure Before Joining

All EnxSetting configuration must be applied before you initialize EnxVideoView. Settings changed after the view is created and the session has started will not take effect.

Join Configuration

Join configuration options control how participants enter the room — what the join button says, which camera activates first, whether a preview is shown, and whether audio or video starts muted.

Custom Join Button Label

Replace the default "Join" button text with any string that fits your product's language — for example "Go Live", "Start Session", or a localized string.

setting.setJoinText("Go Live")

Set Default Camera

Specify which camera should be active when the participant first enters the room. Pass true for the front-facing camera or false for the rear camera.

setting.setCameraPosition(true)   // Front camera (default)
setting.setCameraPosition(false)  // Rear camera

Show Camera Preview Before Joining

When enabled, participants see their own camera feed on a pre-join screen before they enter the room. This allows them to check their appearance and audio device before others can see them.

setting.isPreScreening(true)   // Show preview screen
setting.isPreScreening(false)  // Skip preview and join directly

Audio-Only Call

Enable audio-only mode for calls where video is not needed or not supported by the use case. When enabled, the camera is disabled entirely and no video tile is shown for the local participant.

setting.isAudioOnlyCall(true)   // Audio only — camera disabled
setting.isAudioOnlyCall(false)  // Audio and video (default)

Join with Video Muted

Allow participants to join with their camera off by default. The camera permission is still granted, but the video track starts muted. The participant can unmute manually during the session.

setting.joinAsVideoMute(true)   // Join with camera off
setting.joinAsVideoMute(false)  // Join with camera on (default)

Join with Audio Muted

Allow participants to join with their microphone muted by default. Useful for large sessions (webinars, all-hands) where background noise from many participants joining simultaneously needs to be controlled.

setting.joinAsAudioMute(true)   // Join muted
setting.joinAsAudioMute(false)  // Join with audio on (default)
Audio View Mode — 1-to-1 Audio Calls

When a session is used for a 1-to-1 voice call — where neither participant publishes video — the default video grid is replaced by a purpose-built calling screen. It shows the remote participant's name and initials avatar over a gradient background, with overlay buttons for microphone toggle and exit.

Two APIs on EnxSetting control this mode. Both must be called before the session connects — they have no effect once the session is active.

Enable the Audio View Overlay

Call isAudioViewMode(false) to activate the audio call UI. This replaces the standard video grid with the calling screen whenever no video is being published:

EnxSetting.getInstance(this).isAudioViewMode(false);

Customise the Audio View Appearance

Use configureAudioViewConfig() with an EnxAudioViewConfig object to define the gradient background colours, the remote participant's name text colour, and the initials avatar colours:

EnxSetting.getInstance(this).configureAudioViewConfig(
    new EnxAudioViewConfig(
        Color.parseColor("#0A3733"),   // gradientLayer1   — top gradient colour
        Color.parseColor("#031412"),   // gradientLayer2   — bottom gradient colour
        Color.WHITE,                   // nameTextColor    — remote participant name
        Color.WHITE,                   // sortNameTextColor — initials text colour
        Color.parseColor("#128C7E")    // sortNameBGColor  — initials avatar background
    )
);
ParameterTypeDescription
gradientLayer1int (Color)Top colour of the background gradient.
gradientLayer2int (Color)Bottom colour of the background gradient.
nameTextColorint (Color)Colour of the remote participant's display name.
sortNameTextColorint (Color)Colour of the initials text inside the avatar circle.
sortNameBGColorint (Color)Background colour of the avatar/initials circle.
Must be called before the session starts

Both isAudioViewMode and configureAudioViewConfig must be configured before EnxVideoView connects to the room. Changes applied after the session starts have no effect.

UI Customization

The UI Kit exposes APIs for adjusting the visual appearance of the bottom toolbar and the participant list action buttons, letting you align the look and feel with your app's design system.

Bottom Bar Background Color

Change the background color of the bottom toolbar by passing a color resource reference:

setting.updateBottomOptionView(R.color.white)

Customize Participant List Actions

The participant list supports configurable action buttons displayed for each participant entry. You define each button by specifying its action tag and custom on/off icon drawables, then register the list with EnxSetting.

The following example configures four action buttons — audio mute toggle, video mute toggle, private chat, and disconnect:

val audioButton = EnxButton(this, EnxSetting.PartcipantList.AUDIO.tag)
audioButton.setImage(R.drawable.audio_on, R.drawable.audio_off)

val videoButton = EnxButton(this, EnxSetting.PartcipantList.VIDEO.tag)
videoButton.setImage(R.drawable.video_on, R.drawable.video_off)

val chatButton = EnxButton(this, EnxSetting.PartcipantList.CHAT.tag)
chatButton.setImage(R.drawable.chat_icon)

val dissButton = EnxButton(this, EnxSetting.PartcipantList.DISCONNECT.tag)
dissButton.setImage(R.drawable.end_call_new)

setting.configureParticipantList(listOf(audioButton, videoButton, chatButton, dissButton))
Feature Configuration

You can control which in-session features are shown in the toolbar. This is useful when your use case does not require all controls — for example, a one-on-one call that does not need screen sharing or canvas streaming.

Enable/Disable Controls Using a Tag List

Pass a list of EnxRequiredEventsOption enum values to specify exactly which toolbar controls should be visible. Only the listed options will be shown.

EnxSetting.getInstance(this).configureRequiredEventList(
    mutableListOf(
        EnxSetting.EnxRequiredEventsOption.AUDIO,
        EnxSetting.EnxRequiredEventsOption.VIDEO,
        EnxSetting.EnxRequiredEventsOption.CAMERA_SWITCH
        // Add further options as needed for your use case
    )
)

Enable/Disable with Custom Icons Per Feature

For full control over both visibility and icon appearance, build an EnxRequiredEventsOptionModel for each feature. This lets you supply custom normal and selected-state drawables for each button, in addition to specifying which features are active.

val audioModel = EnxRequiredEventsOptionModel(
    name = "Audio",
    isSelected = false,
    optionTag = EnxSetting.EnxRequiredEventsOption.AUDIO,
    isSwitch = false,
    eventImageNormal = R.drawable.audio_on,
    eventImageSelected = R.drawable.audio_off
)

// Define similar models for video, camera switch, etc.

EnxSetting.getInstance(this).configureRequiredEventsOptionList(
    mutableListOf(audioModel, videoModel, cameraSwitchModel)
)
RTMP Live Streaming

The UI Kit has built-in support for RTMP live streaming, which lets you push the session to a CDN or streaming platform (YouTube Live, Facebook Live, custom RTMP endpoint, etc.) directly from within the session.

Auto-Start Streaming on Join

When this option is enabled, RTMP streaming begins automatically as soon as the moderator joins the room. You must also provide the RTMP and CDN URL details:

setting.startLiveStreaming(true)

setting.liveStreaming(
    mapOf(
        "rtmpDetails" to mapOf("rtmpUrl" to "YOUR_RTMP_URL"),
        "urlDetails" to mapOf("url" to "YOUR_CDN_URL")
    )
)

Start/Stop Streaming During a Session

If you prefer manual control rather than auto-start, you can start and stop RTMP streaming at any point during the session:

// Start streaming to the specified RTMP endpoint
setting.startStreaming(
    mapOf("rtmpDetails" to mapOf("rtmpUrl" to "YOUR_RTMP_URL"))
)

// Stop the active stream
setting.stopStreaming()

Show Live Indicator

When enabled, a "Live" badge is displayed in the UI while the stream is active, so participants know the session is being broadcast:

setting.getInstance(this).isShowGoLiveIndicator(true)
User Data and Room Information

The UI Kit provides APIs for sending arbitrary structured data between participants during a session (useful for polls, Q&A, reactions, and other interactive features), as well as for querying real-time room state.

Send Custom Data to Participants

Use EnxSendUserDataModel to broadcast a custom JSON payload to all participants or to a specific list of recipients. This is the mechanism for building interactive overlays like polls, raise-hand indicators, or Q&A flows on top of the UI Kit.

val model = EnxSendUserDataModel(
    broadcast = false,             // false = send to specific recipients only
    recipients = listOf(clientId), // List of recipient client IDs
    userData = jsonObject          // Your custom JSON payload
)
EnxSetting.getInstance(this).sendUserData(model)

Receive User Data

Implement the following callback in your Activity to receive incoming user data payloads sent by other participants:

override fun onUserDataReceived(jsonObject: JSONObject) {
    // Parse jsonObject and handle the incoming payload
    // e.g., update poll UI, display a Q&A answer, etc.
}

Close the Chat Panel

Programmatically dismiss the chat panel at any time — for example, when navigating away or when a moderator action requires closing it:

EnxSetting.getInstance(this).closeChatPage()

Observe Panel Open/Close Events

The onPageSlide callback fires whenever a panel (chat, polling, Q&A, screen share) opens or closes. Use it to update your own state or coordinate with other UI elements in your Activity.

fun onPageSlide(
    pageName: EnxSetting.EnxPageSlideEventName,
    isShow: Boolean
) {
    // pageName identifies the panel:
    //   EnxChat, EnxPolling, EnxQnA, EnxScreenShare, etc.
    // isShow: true = panel opened, false = panel closed
}

Room and User Info APIs

Query the current state of the room and the local user at any time using the following APIs on EnxSetting:

// All participants currently in the room
EnxSetting.getInstance(this).getParticipantsList()

// Room mode: "group" or "lecture"
EnxSetting.getInstance(this).getRoomMode()

// Current user's role: "moderator" or "participant"
EnxSetting.getInstance(this).getCurrentRole()

// Self client ID for this session
EnxSetting.getInstance(this).getClientID()

// The underlying Room instance (for advanced SDK-level access)
EnxSetting.getInstance(this).getRoom()

// Whether the room has knock/lobby mode enabled
EnxSetting.getInstance(this).getiSKnockRoom()

// Whether the current user is waiting in the lobby
EnxSetting.getInstance(this).getisUserAwaited()

// Whether the current user has requested floor access
EnxSetting.getInstance(this).getisUserInReq()
Use Room Info for Conditional UI

getCurrentRole() and getRoomMode() are particularly useful for building role-aware UI outside the UI Kit's built-in controls — for example, showing a custom moderator dashboard or adapting your app's own navigation based on whether the user is a moderator or participant.