Picture-in-Picture (PiP) mode allows users to continue a video call while using other apps. This feature is useful for multitasking, such as taking notes or browsing the web during a call.
- Sign up on VideoSDK and visit the API Keys section to get your API key and Secret key.
- Get familiarized with API key and Secret key.
- Get familiarized with Token.
Before running the project, ensure you have the following:
- iOS 15.0+
- Xcode 15.0+
- Swift 5.0+
- Valid VideoSDK Account
-
Clone the repository:
git clone https://github.com/videosdk-live/videosdk-ios-pip-mode-example.git cd videosdk-ios-pip-mode-example
-
Open the project in Xcode:
open videosdk-ios-pip-mode-example.xcodeproj
-
Enable required capabilities:
- Go to Signing & Capabilities in Xcode.
- Enable Background Modes and check:
- Audio, AirPlay, and Picture in Picture
- Voice over IP
-
Inside
MeetingViewController.swift
, add the generated token in thevar token = "YOUR_TOKEN_HERE"
field. -
Run the project on a physical iOS device (PiP is not fully supported in the iOS Simulator).
- Launch the app on your device.
- Start a video call using the provided UI.
- Tap the Enable PiP button to activate Picture-in-Picture mode.
- The video window should shrink and remain visible while you switch apps.
- PiP mode will turn off when you return to the app from the background where PiP mode was previously active.