Picture-in-Picture implementation is handled at the app level using iOS’s PiP APIs. The Calls SDK only adjusts the call UI layout to fit the PiP window - it does not manage the PiP window itself.
How It Works
- Your app enters PiP mode using iOS’s AVPictureInPictureController API
- You notify the Calls SDK by calling
enablePictureInPictureLayout() - The SDK adjusts the call UI to fit the smaller PiP window (hides controls, optimizes layout)
- When exiting PiP, call
disablePictureInPictureLayout()to restore the full UI
Enable Picture-in-Picture
Enter PiP mode programmatically using theenablePictureInPictureLayout() action:
- Swift
- Objective-C
Disable Picture-in-Picture
Exit PiP mode and return to the full-screen call interface:- Swift
- Objective-C
Listen for PiP Events
Monitor PiP mode transitions usingLayoutListener to update your UI accordingly:
- Swift
- Objective-C
iOS PiP Setup
To enable PiP in your iOS app: 1. Enable Background Modes In your project’s Signing & Capabilities, add the Background Modes capability and enable:- Audio, AirPlay, and Picture in Picture
- Swift
- Objective-C
PiP mode is available on iOS 14.0 and later for iPhones, and iOS 9.0 and later for iPads.