Adopting Picture in Picture in a Standard Player

Add Picture in Picture (PiP) playback to your app using a player view controller.


The simplest way to add PiP playback to your apps is with AVPlayerViewController. In fact, after you’ve configured your audio session and set the project capabilities as described in Configuring iOS and tvOS Audio Playback Behavior, your player automatically supports PiP playback. If your app is running on a supported device, you’ll see a new button in the lower-right corner of your player.

Standard player with Picture in Picture option highlighted in the bottom right.

Familiarize Yourself with the Picture in Picture Controls

Picture in Picture playback starts when the user taps the PiP button in the player interface. Playback also starts automatically if your video is playing in full-screen mode and you exit the app by pressing the Home button. In either case, the player window is minimized to a movable, floating window.

Picture in Picture window overlay showing fullscreen, play, and close options.

While the video is playing in PiP mode, the user has basic controls to play and pause the video as well as exit playback. Tapping the leftmost button in this interface exits Picture in Picture and returns control to your app, but by default immediately terminates video playback. AVKit can’t make assumptions about how your app is designed and is unaware of how to properly restore your video playback interface. Instead, it delegates that responsibility to you.

Restore Your Video Playback Interface

To handle the restore process, your code must adopt the AVPlayerViewControllerDelegate protocol and implement the playerViewController:restoreUserInterfaceForPictureInPictureStopWithCompletionHandler: method. The framework calls this method when control returns to your app, giving you the opportunity to determine how to properly restore your video player’s interface. If you originally presented your video player using the presentViewController:animated:completion: method of UIViewController, restore your player interface in the same way in the delegate callback method.

func playerViewController(_ playerViewController: AVPlayerViewController,
                          restoreUserInterfaceForPictureInPictureStopWithCompletionHandler completionHandler: @escaping (Bool) -> Void) {
    present(playerViewController, animated: true) {

See Also

Media Playback

Adopting Picture in Picture in a Custom Player

Add controls to your custom player user interface to invoke Picture in Picture (PiP) playback.

Working with Interstitial Content in tvOS

Present additional content such as legal text, content warnings, or advertisements alongside your main media presentation.

Adopting Custom Interactive Overlays, Channel Flipping, and Parental Controls in tvOS Video Playback

This sample demonstrates support for custom interactive overlays, and parental controls, using AVPlayerViewController.

Adding Information to the Info Panel (tvOS)

Add metadata information and navigation markers to the Info panel in Apple TV.


A view controller that displays the video content from a player object along with system-supplied playback controls.


A macOS-only object that displays the video content from a player object along with system-supplied playback controls.


A controller that responds to user-initiated Picture in Picture playback of video in a floating, resizable window.


A time range in an audiovisual presentation designated as interstitial content, such as advertisements or legal notices.


A set of markers for navigating playback of an audiovisual presentation.