Skip to content

Customize Configuration

kristiyan-petrov edited this page Feb 27, 2024 · 15 revisions

SimpleCallConfiguration

This is a utility class which defines that all available tools (whiteboard, screen share etc.) will be used, as well as the chat tool will be set with SimpleChatConfiguration.

SimpleChatConfiguration

This is a utility class which adds audioUpgradable and audioVideo options in the chat ui app bar menu and defines that all tools (whiteboard, screen share etc.) will be used in calls launched by the chat ui app bar menu items.

Customize CallConfiguration

A call can have a different set of capabilities and options. Following an example with all the capabilities and options.

For call recording documentation please refer to room rest documentation.

Please note that when a call is created by the Bandyer Android SDK with manual recording passing CallRecordingType.MANUAL to the call options, the recording can only be started from start room recording rest API and stopped via stop room recording rest API.

CallOptions callOptions = new CallOptions()
	.withRecordingEnabled(CallRecordingType.AUTOMATIC) // or .withRecordingEnabled(CallRecordingType.MANUAL)  
	.withBackCameraAsDefault()
	.withProximitySensorDisabled()
	.withFeedbackEnabled();

CustomCallConfiguration.CustomCapabilitySet callCapabilitySet = new CustomCallConfiguration.CustomCapabilitySet(
        new CustomChatConfiguration(), // this configuration will not set any capability or option in the chat.
        new CustomFileShareConfiguration(), // this configuration will not set any capability or option in the file share.
        new CustomScreenShareConfiguration(), // this configuration will not set any capability or option in the screen share.
        new CustomWhiteboardConfiguration() // this configuration will not set any capability  or option in the whiteboard.
);

CustomCallConfiguration callConfiguration = new CustomCallConfiguration(callCapabilitySet, callOptions);

A custom call configuration can be provided to a call via BandyerSDKConfigurationBuilder withCall callback. This callback will be called when a new call is starting.

BandyerSDK.getInstance().configure(new BandyerSDKConfiguration.Builder(configuration.getAppId(), environment, region)
	 .tools(builder -> {
                // Set call configuration created above
		builder.withCall(configurableCall -> {
			configurableCall.setCallConfiguration(callConfiguration);}
         );
}));

Customize ChatConfiguration

A chat can have different set of capabilities. Following an example with all the capabilities.

CustomChatConfiguration chatConfiguration = new CustomChatConfiguration(
        new CustomChatConfiguration.CustomCapabilitySet(
                getCallConfiguration(), // this adds the audio only option in the app bar and  allows you to customize its configuration
                getCallConfiguration(), // this adds the audio upgradable option in the app bar and allows you to customize its configuration
                getCallConfiguration() // this adds the audio video option in the app bar and allows you to customize its configuration
        )
);

private CustomChatConfiguration.CustomCapabilitySet.CustomCallConfiguration getCallConfiguration(){
	CallOptions callOptions = new CallOptions()
                .withRecordingEnabled(CallRecordingType.AUTOMATIC) // or .withRecordingEnabled(CallRecordingType.MANUAL)  
                .withBackCameraAsDefault()
                .withProximitySensorDisabled()
                .withFeedbackEnabled();

	return new CustomChatConfiguration.CustomCapabilitySet.CustomCallConfiguration(
	        new CustomChatConfiguration.CustomCapabilitySet.CustomCallConfiguration.CustomCapabilitySet(
	                new CustomFileShareConfiguration(),
	                new CustomScreenShareConfiguration(),
	                new CustomWhiteboardConfiguration()
	        ),
	        callOptions
	);
}

A custom chat configuration can be provided to a chat via BandyerSDKConfigurationBuilder withChat callback. This callback will be called when a new chat is starting.

BandyerSDK.getInstance().configure(new BandyerSDKConfiguration.Builder(configuration.getAppId(), environment, region)
        .tools(builder -> { 
               // Set chat configuration created above
               builder.withChat(configurableChat -> {
		     configurableChat.setChatConfiguration(chatConfiguration);
               } 
         );
}));

Customize ScreenShareConfiguration

A screen share can have different set of options. Following an example with all the options.

CustomScreenShareConfiguration.Options screenShareOptionSet = new CustomScreenShareConfiguration.Options(ScreenShareOptionSet.USER_SELECTION);
                                                                            // or ScreenShareOptionSet.APP_ONLY
                                                                            // or ScreenShareOptionSet.WHOLE_DEVICE
CustomScreenShareConfiguration.CapabilitySet screenShareCapabilitySet = new CustomScreenShareConfiguration.CapabilitySet(), // there are currently no capability in the screen share available to be set.
CustomScreenShareConfiguration screenShareConfiguration = new CustomScreenShareConfiguration(screenShareCapabilitySet, screenShareOptionSet); 

Obtain recordings

To obtain call recordings on your backend a web hook for the event on_recording_available must be registered.

For further details about registering webhooks for recording events please refer to the webhook configuration documentation.

Obtain feedbacks

To obtain call feedbacks on your backend from the user base a web hook for the event on_room_new_feedback must be registered.

For further details about registering webhooks for new feedbacks available please refer to the webhook configuration documentation.

Clone this wiki locally