Prerequisites
- An active call session
- Access to the
CallSessioninstance
Get CallSession Instance
Layout and UI methods are called on theCallSession singleton:
- Kotlin
- Java
Set Layout
Change the call layout during an active session.- Kotlin
- Java
LayoutType Enum
When the layout changes, the
onCallLayoutChanged(LayoutType) callback is triggered on your LayoutListener.Picture-in-Picture Mode
Enable Picture-in-Picture (PiP) mode to allow users to continue viewing the call while using other apps.Enable PiP
- Kotlin
- Java
Disable PiP
- Kotlin
- Java
Android PiP Integration
To fully support PiP on Android, you need to handle the activity lifecycle:- Kotlin
- Java
Don’t forget to add
android:supportsPictureInPicture="true" to your activity in the AndroidManifest.xml.Set Chat Button Unread Count
Update the badge count on the chat button to show unread messages.- Kotlin
- Java
The chat button must be visible (
hideChatButton(false)) for the badge to appear.Listen for Layout Events
Register aLayoutListener to receive callbacks when layout changes occur:
- Kotlin
- Java
Initial Layout Settings
Configure the initial layout when joining a session:- Kotlin
- Java
Hide UI Elements
Control the visibility of various UI elements:- Kotlin
- Java
Button Click Listeners
Listen for UI button clicks to implement custom behavior:- Kotlin
- Java
Next Steps
Session Control
Leave session and hand raise controls
Layout Listener
Handle all layout events