The Flutter Calls SDK provides
enterPipMode() and isPipSupported() methods on CallSession to manage PiP mode. The SDK handles the PiP layout adjustments automatically when PiP is activated.Platform Differences
PiP behavior differs between Android and iOS:| Platform | Behavior |
|---|---|
| Android | Uses the system PiP API. The call UI shrinks into a floating window managed by the OS. Requires supportsPictureInPicture in AndroidManifest.xml. |
| iOS | Uses a custom overlay approach. The call continues in a compact overlay view within the app. No additional manifest configuration required. |
Check PiP Support
Check whether the current device supports Picture-in-Picture mode:Enter PiP Mode
Enter Picture-in-Picture mode programmatically:Enable PiP Layout
You can also use the layout-level PiP methods to adjust the call UI for a PiP-sized window:Disable PiP Layout
Exit PiP layout and return to the full-screen call interface:Listen for PiP Events
Monitor PiP mode transitions usingLayoutListener to update your UI accordingly:
Remember to set the
layoutListener to null in your widget’s dispose() method to prevent memory leaks.Android Manifest Configuration
For Android, add PiP support to your Activity inAndroidManifest.xml:
| Attribute | Description |
|---|---|
supportsPictureInPicture | Enables PiP support for the activity |
configChanges | Prevents activity restart during PiP transitions |