PresentationSettings
class. This class allows you to set the various parameters for the Presentation Mode. In order to set the various parameters of the PresentationSettings
class, you need to use the PresentationSettingsBuilder
class. Below are the various options available with the PresentationSettings
class.
PresentationSettingsBuilder
class takes the 1 mandatory parameter as a part of the constructor:
Presenter
& Participant
, You can set this PresentationSettingsBuilder
by using the following method isPresenter(true/false)
A basic example of how to start a Presentation:
Parameter | Description |
---|---|
activityContext | The activity in which you want to show the calling view. |
videoContainer | An object of the RelativeLayout class in which CometChatCalls can load the calling views. |
CometChatCallsEventsListener
listener provides you with the below callback methods:
Callback Method | Description |
---|---|
onCallEnded() | This method is called when the call is successfully ended. The call details can be obtained from the Call object provided. |
onCallEndButtonPressed() | This method is called when the user presses the end call button. |
onUserJoined(user: RTCUser) | This method is called when any other user joins the call. The user details can be obtained from the User object provided. |
onUserLeft(user: RTCUser) | This method is called when a user leaves the call. The details of the user can be obtained from the provided User object. |
onUserListChanged(users: ArrayList<RTCUser?>) | This method is triggered every time a participant joins or leaves the call, providing the list of users active in the call. |
onAudioModeChanged(devices: ArrayList<AudioMode?>) | This callback is triggered if any new audio output source is available or becomes unavailable. |
onCallSwitchedToVideo(callSwitchRequestInfo: CallSwitchRequestInfo) | This callback is triggered when an audio call is converted into a video call. |
onUserMuted(muteObj: RTCMutedUser) | This method is triggered when a user is muted in the ongoing call. |
onRecordingToggled(recordingInfo: RTCRecordingInfo) | This method is triggered when a recording starts/stops. |
onError(e: CometChatException) | This method is called when there is some error in establishing the call. |
PresentationSettings
class is the most important class when it comes to the implementation of the Calling feature. This is the class that allows you to customize the overall calling experience. The properties for the call/conference can be set using the PresentationSettingsBuilder
class. This will eventually give you and object of the PresentationSettings
class which you can pass to the joinPresentation() method to start the call.
The mandatory parameters that are required to be present for any call/conference to work are:
Context - context of the activity/application RelativeLayout - A RelativeLayout object in which the calling UI is loaded. The options available for customization of calls are:
Setting | Description |
---|---|
setIsPresenter(boolean value) | If set to true , the user will join the call as a presenter. If set to false , the user will join the call as an audience member. Default value = false |
setDefaultLayoutEnable(boolean value) | If set to true enables the default layout for handling the call operations. If set to false , it hides the button layout and just displays the Call View. Default value = true |
setIsAudioOnly(boolean value) | If set to true , the call is supposed to be an audio call. If set to false , the call is supposed to be a video call. Default value = false |
showEndCallButton(boolean value) | If set to true , it displays the End Call Button in the Button Layout. If set to false , it hides the End Call Button in the Button Layout. Default value = true |
showSwitchCameraButton(boolean value) | If set to true , it displays the Switch Camera Button in the Button Layout. If set to false , it hides the Switch Camera Button in the Button Layout. Default value = true |
showMuteAudioButton(boolean value) | If set to true , it displays the Mute Audio Button in the Button Layout. If set to false , it hides the Mute Audio Button in the Button Layout. Default value = true |
showPauseVideoButton(boolean value) | If set to true , it displays the Pause Video Button in the Button Layout. If set to false , it hides the Pause Video Button in the Button Layout. Default value = true |
showAudioModeButton(boolean value) | If set to true , it displays the Audio Mode Button in the Button Layout. If set to false , it hides the Audio Mode Button in the Button Layout. Default value = true |
startWithAudioMuted(boolean value) | This ensures the call is started with the audio muted if set to true . Default value = false |
startWithVideoMuted(boolean value) | This ensures the call is started with the video muted if set to true . Default value = false |
setDefaultAudioMode(boolean value) | This method can be used if you wish to start the call with a specific audio mode. The available options are CometChatCallsConstants.AUDIO_MODE_SPEAKER , CometChatCallsConstants.AUDIO_MODE_EARPIECE , CometChatCallsConstants.AUDIO_MODE_BLUETOOTH , CometChatCallsConstants.AUDIO_MODE_HEADPHONES . Default value = false |
showRecordingButton(boolean value) | If set to true , it displays the Recording Button. If set to false , it hides the Recording Button. Default value = false |
setEventListener(new CometChatCallsEventsListener()) | The CometChatCallsEventsListener listener provides you callbacks. |