Customize the UI
You can customise different parts of the video UI by referring to the following examples:
Initiation Process
Joining Button Label
You can customize the label of joining button by using setJoinText
function. It' optional, use it to overwrite default label.
val setting = EnxSetting.getInstance(this)setting.setJoinText("Go Live")
Switching Camera before joining
You can switch Camera to join with the finally selected camera by using setCameraPosition
function. Set it to true
for camera and false
for rear camera. User can override the flag from confirmation screen too.
val setting = EnxSetting.getInstance(this)setting.setCameraPosition(true) // Setting front camerasetting.setCameraPosition(false) // Setting back camera
Preview Camera before joining
You can preview a selected Camera feed before joinining by using isPreScreening
function. Set it to true
to show preview and false
to hide preview.
val setting = EnxSetting.getInstance(this)setting.isPreScreening(true) // Previewsetting.isPreScreening(false) // Hide Preview
Go for Audio Only Call
You can intiate an Audio Only call without any Video Option, you can do so by using isAudioOnlyCall
function. Set it to true
for Audio Only call and false
for Audio+Video call.
This is an optional function. Use if in case you want to get into an Audio Only call. Audio & Video support comes by default, based on Subscription.
val setting = EnxSetting.getInstance(this)setting.isAudioOnlyCall(true) // Audio onlysetting.isAudioOnlyCall(false) // Audio & Video
Join with Video muted
You can join a call with Video muted by using joinAsVideoMute
function. Set it to true
for Video-muted entry.
This is an optional function. Use if in case you want to join with video-muted. Audio & Video support comes by default given related device permission.
val setting = EnxSetting.getInstance(this)setting.joinAsVideoMute(true) // Video Muted entrysetting.joinAsVideoMute(false) // Entry with Audio & Video
Join with Audio muted
You can join a call with Audio muted by using joinAsAudioMute
function. Set it to true
for Audio-muted entry.
This is an optional function. Use if in case you want to join with audio-muted. Audio & Video support comes by default given related device permission.
val setting = EnxSetting.getInstance(this)setting.joinAsAudioMute(true) // Video Muted entrysetting.joinAsAudioMute(false) // Entry with Audio & Video
Join to start RTMP Live Streaming
You can initiate RTMP Live Streaming just after joining automatically by using startLiveStreaming
function. Set it to true
for start RTMP Live Streaming on joining.
This is an optional function. Use if in case you want to start live streaming automatically on joining. This also requires that you pass RTMP Streaming Endpoint and Access Key; and optionally pass any Custom-built UI View for the Stream.
val setting = EnxSetting.getInstance(this)setting.startLiveStreaming(true) // Start Streaming on joiningsetting.startLiveStreaming(false) // Not to start streaming on joining// Pass RTMP Streaming Infomrationsetting.liveStreaming( ["rtmpDetails":[ "rtmpUrl" : "rtmpURL"],"urlDetails" : ["url" : "URL"]])
Set the Background Color of Bottom Bar
You can update the background color of the Bottom Bar by passing the resource id of the color to updateBottomOptionView
function.
val setting = EnxSetting.getInstance(this)setting.updateBottomOptionView(R.color.white)
Customize Participant List Options
You can add additional action against each participant in the participant list.
val setting = EnxSetting.getInstance(this)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<EnxButton>(audioButton,videoButton,chatButton, dissButton))// Following Enumerated data may also be used to creation action buttons// in Participant list, viz. AUDIO, VIDEO, CHAT, DISCONNECT
Handle Disconnection and Correction Error
Here you need to create an instance of EnxVideoView
class which is the subclass of RelativeLayout
. You also need to pass a reference of Activity, a valid Token, and an Observer to receive a callback.
There are 2 callbacks for you to clear instance or for any other UI/UX implementation. You need to override these functions below:
- For Disconnection: You get notified when the user gets disconnected from the Video Room. The JSON you receive shows the reason for the disconnection.
override fun disconnect(jsonObject: JSONObject?)
- For Connection Error: You get notified if the user doesn't get connected to the Video Room. The JSON you receive shows a related error.
override fun connectError(jsonObject: JSONObject?)
Customise Features
Setup conferencing features via APIs
Enhance your video conferencing application by deciding which features are required. The provided APIs allow you to specify and customize essential video conferencing features like audio, video, camera, etc.... controls. EnableX provides powerful APIs to customize the required features in your Android UI kit:
Passing a list of required events as a tag argument
Method:
fun configureRequiredEventList(requiredEventList: MutableList<EnxRequiredEventsOption>)
Syntex:
EnxSetting.getInstance(this).configureRequiredEventList(mutableListOf(EnxSetting.EnxRequiredEventsOption.AUDIO,EnxSetting.EnxRequiredEventsOption.VIDEO))
Specify Required Features
Pass the EnableX customized tag value for each required feature.
EnxSetting.getInstance(this).configureRequiredEventList(mutableListOf(EnxSetting.EnxRequiredEventsOption.AUDIO,EnxSetting.EnxRequiredEventsOption.VIDEOEnxSetting.EnxRequiredEventsOption.CAMERA_SWITCH…..…..))
Passing a list of required events as a model as argument
Method:
fun configureRequiredEventsOptionList(enxRequiredList:MutableList<EnxRequiredEventsOptionModel>)
Syntex:
EnxSetting.getInstance(this).configureRequiredEventsOptionList(mutableListOf(enxRequiredEventsOptionModelAudio, enxRequiredEventsOptionModelVideo, enxRequiredEventsOptionModelCameraSwitch))
Create configurations for individual features:
Each feature can be further customized in terms of behaviour and appearance.
- Audio
var enxRequiredEventsOptionModelAudio = EnxRequiredEventsOptionModel(name: "Audio"isSelected = false,optionTag = EnxSetting.EnxRequiredEventsOption.AUDIO,isSwitch = false,eventImageNormal = R.drawable.audio_on,eventImageSelected = R.drawable.audio_off)
- Video
var enxRequiredEventsOptionModelVideo = EnxRequiredEventsOptionModel(name: "Video"isSelected = false,optionTag = EnxSetting.EnxRequiredEventsOption.VIDEO,isSwitch = false,eventImageNormal = R.drawable.video_on,eventImageSelected = R.drawable.video_off)
- Camera Switch
var enxRequiredEventsOptionModelCameraSwitch = EnxRequiredEventsOptionModel(name: "Camera Switch"isSelected = false,optionTag = EnxSetting.EnxRequiredEventsOption.SWITCH_CAMERA,isSwitch = false,eventImageNormal = R.drawable.camera_rotaion_off,eventImageSelected = R.drawable.camera_rotaion_on)
Manage Send User Data over Session via APIs
Interactions in video conferencing go beyond just video and audio. With the chat page management features, you can control how users interact via chat, providing a seamless communication experience.
Observer: To manage features such as polling, QnA, or any other customised events, instantiate an Observer. This observer monitors the opening and closing of pages, allowing it to handle subsequent events effectively.
override fun onUserDataReceived(jsonObject: JSONObject)
This function listens for any data sent by users in the session using the APIs sendUserData()
, ensuring all participants receive the shared information.
close chat page
Call close chat page API to close the chat page. For more detail, please refer to below code snippet:
EnxSetting.getInstance(this).closeChatPage()
Observe Page Slides
fun onPageSlide(pageName: EnxSetting.EnxPageSlideEventName, isShow: Boolean)
Send User Data
Interactive elements like polls or Q&As enhance user engagement. Use these APIs to send custom data, creating a more interactive and engaging environment for your users.
var enxSendUserDataModel = EnxSendUserDataModel(broadcast = false,/ true for all, false for listed receipentrecipients = listOf(clientId), / this is require once broadcase if falseuserData = jsonObject/ Data information going to send to other end)EnxSetting.getInstance(this).sendUserData(enxSendUserDataModel)
Room and User Information APIs
Keeping track of room information and user-specific details is crucial for maintaining a controlled and productive conferencing environment. These APIs give you insight into the room's mode, user roles, and other essential details, ensuring you always have control.
Get participants list
Retrieve the list of individuals currently in the room.
EnxSetting.getInstance(this).getParticipantsList()
Get current room mode (group/lecture)
Identify if the room is in group mode or lecture mode.
public fun getRoomMode()
Get user role (moderator/participant)
Identify if a user is acting as a moderator or a participant.
public fun getCurrentRole()
Get self-client ID
Fetch the unique ID associated with the client.
public fun getClientID()
Get the room instance
Retrieve the current room's instance.
public fun getRoom()
Check if the room has the Knock feature enabled
Verify if the Knock feature is enabled in the room.
public fun getiSKnockRoom()
Check if the user is waiting
Check if a user is currently waiting for access.
public fun getisUserAwaited()
Check if the user requested the floor
Check if a user has made a request for the floor.
public fun getisUserInReq()
Start/Stop RTMP Live Streaming
By using following methods, you can start/stop RTMP Live Streaming within a session anytime you want. The startStreaming
needs RTMP Streaming information like RTMP Endpoint, Access Key and any Customer UI to use as View for the Stream.
You can use the method without JSON parameter. In this case, the Stream Infomration passed while joining will be used for streaming.
val setting = EnxSetting.getInstance(this)// Start Streaming with Stream Informationsetting.startStreaming(["rtmpDetails" :[ "rtmpUrl" : "rtmpURL"],"urlDetails" : ["url" : "URL"]])// Stop Streamingsetting.stopStreaming()
Show Live Indicator
By using following methods, you can enable "Live" indicataor showing on Video UI when Streaming starts.
val setting = EnxSetting.getInstance(this)setting.getInstance(this) .isShowGoLiveIndicator(true)