Skip to main content
Version: v4

Video View Customisation

This section will guide you to customise the main video container.

Implementation

Once you have decided to implement Default Calling or Direct Calling calling and followed the steps to implement them. Just few additional methods will help you quickly customize the main video container.

Please make sure your callSettings is configured accordingly for Default Calling or Direct Calling.

Main Video Container Setting

The MainVideoContainerSetting Class is the required in case you want to customise the main video view. You need to pass the Object of the MainVideoContainerSetting Class in the setMainVideoContainerSetting() method of the CallSettingsBuilder.

SettingDescription
setMainVideoAspectRatio(aspectRatio: string)This method is used to set the aspect ratio of main video.
The default value is contain.
Possible Values:
1. CometChat.CallSettings. ASPECT_RATIO_CONTAIN****2. CometChat.CallSettings. ASPECT_RATIO_COVER
setFullScreenButtonParams(position: string, visibility: boolean)This method is used to set the position & visibility parameter of the full screen button.
By default the full screen button is visible in the bottom-right position.Possible Values for POSITION:
1. CometChat.CallSettings. POSITION_TOP_LEFT
2. CometChat.CallSettings. POSITION_TOP_RIGHT3. CometChat.CallSettings. POSITION_BOTTOM_LEFT
4. CometChat.CallSettings. POSITION_BOTTOM_RIGHTPossible Values for VISIBILITY:
1. true
2. false
setNameLabelParams(position: string, visibility: boolean, backgroundColor: string)This method is used to set the position, visibility & background color of the name label.
By default the name label is visible in the bottom-left position with a background-color **rgba(27, 27, 27, 0.4)**Possible Values for POSITION:
1. CometChat.CallSettings. POSITION_TOP_LEFT
2. CometChat.CallSettings. POSITION_TOP_RIGHT3. CometChat.CallSettings. POSITION_BOTTOM_LEFT
4. CometChat.CallSettings. POSITION_BOTTOM_RIGHTPossible Values for VISIBILITY:
1. true
2. false
setNetworkLabelParams(position: string, visibility: boolean)This method is used to set the position, visibility of the network label.
By default the network label is visible in the bottom-right position.Possible Values for POSITION:
1. CometChat.CallSettings. POSITION_TOP_LEFT
2. CometChat.CallSettings. POSITION_TOP_RIGHT3. CometChat.CallSettings. POSITION_BOTTOM_LEFT
4. CometChat.CallSettings. POSITION_BOTTOM_RIGHTPossible Values for VISIBILITY:
1. true
2. false

Example:

let videoSettings = new CometChat.MainVideoContainerSetting();

videoSettings.setMainVideoAspectRatio(CometChat.CallSettings.ASPECT_RATIO_CONTAIN);
videoSettings.setFullScreenButtonParams(CometChat.CallSettings.POSITION_BOTTOM_RIGHT, true);
videoSettings.setNameLabelParams(CometChat.CallSettings.POSITION_BOTTOM_LEFT, true, "rgba(27, 27, 27, 0.4)");
videoSettings.setNetworkLabelParams(CometChat.CallSettings.POSITION_BOTTOM_RIGHT, true);