ButtonClickListeners. This listener provides callbacks when users tap buttons in the call UI, allowing you to implement custom behavior or show confirmation dialogs.
Prerequisites
- An active call session
- Access to the
CallSessioninstance
Register Listener
Register aButtonClickListeners to receive button click callbacks:
Callbacks
onLeaveSessionButtonClicked
Triggered when the user taps the leave session button.- Show confirmation dialog before leaving
- Log analytics event
- Perform cleanup before leaving
onToggleAudioButtonClicked
Triggered when the user taps the audio mute/unmute button.- Log analytics events
- Show tooltip on first use
- Implement custom audio toggle logic
onToggleVideoButtonClicked
Triggered when the user taps the video on/off button.- Log analytics events
- Check camera permissions
- Implement custom video toggle logic
onSwitchCameraButtonClicked
Triggered when the user taps the switch camera button.- Log analytics events
- Show camera switching animation
- Track front/back camera usage
onRaiseHandButtonClicked
Triggered when the user taps the raise hand button.- Show confirmation feedback
- Log analytics events
- Implement custom hand raise behavior
onShareInviteButtonClicked
Triggered when the user taps the share invite button.- Show custom share sheet
- Generate and share invite link
- Copy link to clipboard
onChangeLayoutButtonClicked
Triggered when the user taps the change layout button.- Show custom layout picker
- Log layout change analytics
- Implement custom layout switching
onParticipantListButtonClicked
Triggered when the user taps the participant list button.- Log analytics events
- Show custom participant list UI
- Track feature usage
onChatButtonClicked
Triggered when the user taps the chat button.- Open custom chat interface
- Show in-call messaging overlay
- Navigate to chat screen
onRecordingToggleButtonClicked
Triggered when the user taps the recording button.- Show recording consent dialog
- Check recording permissions
- Log recording analytics
Complete Example
Here’s a complete example handling all button click events:Remove Listener
Remove the listener in your widget’sdispose() method to prevent memory leaks:
Callbacks Summary
Hide Buttons
You can hide specific buttons using SessionSettings:Next Steps
Layout Listener
Handle layout change events
Session Settings
Configure button visibility