picture-in-picture

Enable and disable PiP layout for active iOS calls during background transitions.

31|9|Updated Mar 10, 2023
One-click install
npx skills add https://github.com/cometchat/calls-sdk-ios --skill picture-in-picture
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: picture-in-picture
Source: https://github.com/cometchat/calls-sdk-ios/tree/main/skills/picture-in-picture
Command: npx skills add https://github.com/cometchat/calls-sdk-ios --skill picture-in-picture

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Picture-in-Picture (PiP) mode lets users continue an active voice or video call while switching to other apps, instead of forcing them to stay in the call screen.

Core Features & Use Cases

  • Enable/Disable PiP Optimized Layout: Switch the Calls SDK UI into and out of a PiP-friendly layout by using CallSession methods.
  • Backgrounding-Aware Activation: Automatically enable PiP when the app enters the background, and revert when returning to the foreground.
  • Use Case: When a user taps the home button during a call, your app keeps the conversation visible in a small floating window without breaking the call flow.

Quick Start

Enable PiP layout when the call is active and the app goes to the background, then disable it again when the app returns to the foreground.

Frequently Asked Questions about picture-in-picture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I keep a WebRTC video call running when the iOS app is backgrounded?

To keep a WebRTC call running during iOS app backgrounding, enable Picture-in-Picture mode to switch the Calls SDK UI into a floating PiP-optimized layout. This allows the active call session to remain visible without breaking the call flow.

How does Picture-in-Picture mode work during iOS app lifecycle transitions?

Picture-in-Picture mode works by detecting app backgrounding and foregrounding transitions. It enables a PiP-optimized layout when the app enters the background and reverts to the standard UI when the app returns to the foreground for active call sessions.

How do I enable a floating call window for an active iOS call session?

To enable a floating call window, verify the call is active using the isCallSessionActive() check, then call enablePictureInPictureLayout() during app backgrounding. Call disablePictureInPictureLayout() when the app returns to the foreground.

When should I disable the PiP layout in my iOS calling app?

You should disable the PiP layout when the app returns to the foreground. Use the disablePictureInPictureLayout() method during app foreground transitions to revert the Calls SDK UI from the floating window back to the standard call screen view.

Can I use PiP layout for voice calls or is it limited to video?

You can use PiP layout for both voice and video calls. The Picture-in-Picture mode allows users to continue any active call session in a small floating window while switching to other apps, ensuring the conversation remains visible.

Does enabling Picture-in-Picture require checking call session state?

Yes, enabling Picture-in-Picture requires checking call session state. You must verify an ongoing call using the isCallSessionActive() method before calling enablePictureInPictureLayout() to ensure PiP is only applied during active call sessions.