Kotlin
Managing PiP Mode Changes
1. Update the UI When PiP Mode Changes
Override onPictureInPictureModeChanged to track PiP state and hide the local preview in the floating window (subscriber video remains):
Expose isInPipMode to Compose (for example with mutableStateOf) so the PiP button hides automatically.
2. Keep the Session Alive in PiP
Do not call session.onPause() while in PiP, or the call may pause when the user leaves the full-screen activity:
3. Clean Up Views in onStop
Remove publisher and subscriber views when the activity stops:
Picture in Picture
Learn how add Picture in Picture functionality to your app using Vonage Video SDK.
Available on:
Steps
1
Introduction2
Getting Started3
Creating a New Project4
Adding the Android SDK5
Setting Up Authentication6
Requesting Permissions7
Enable Picture-in-Picture on Your Activity8
Provide Containers for Video Views9
Launching Picture-in-Picture10
Managing PiP Mode Changes11
Running the App12
Conclusion