3

tvOS 13 now supports picture-in-picture mode, and it works well in the official Apple TV app - the video player has a specific PiP button.

I thought that this PiP button would be present by default in all applications that use the native player. But this is not at all. Perhaps that the developer must apply this support PiP in his application. But I did not find documentation on how to do implement.

Has anyone already faced this problem?

sinoroc
  • 18,409
  • 2
  • 39
  • 70
Alexander
  • 131
  • 2

2 Answers2

2

tvOS 14

With the tvOS 14, now you can use Picture in Picture (PiP) in your tvOS application. You will need to add the Picture in Picture capability to your application in Xcode.

To do so, you select Background Modes in the Add Capabilities window. It is then as easy as checking the Picture in Picture box in the Signing and Capabilities tab of your project.

Note

The AVPlayerLayer passed to AVPictureInPictureController isn’t used by the PiP display, so AVFoundation stops vending video frames to it while PiP mode is active.

Very Important Tips

  • Only begin Picture in Picture playback in response to user interaction and never programmatically. The App Store review team rejects apps that fail to follow this requirement.

  • A user can disable automatic invocation of Picture in Picture in Settings > Home Screen & Dock > Multitasking > Picture in Picture. Check this setting if you think you’ve set up everything correctly but find that your video doesn't enter PiP mode when you press the Home button.

Also, check these documents:

Best.

My Old Answer

Open Your Xcode (My Xcode Version is 11.0 (11A420a)) and click on your project and select your target under the TARGETS then click on the Signing & Capabilities tab, you can see the option "Audio, AirPlay, and Picture in Picture" under background modes. Also, you can watch this WWDC session to fully understand the concept.

But when I select that option and re-run my tvOS application nothing happens. This article says:

For now, picture-in-picture is said to be limited to the Apple TV app...

MGY
  • 7,245
  • 5
  • 41
  • 74
  • Let me know if your app capable to play Picture and Picture with that check box selection. – MGY Oct 08 '19 at 11:55
  • @Alexander Kindly, if this answer is correct, please sign as the correct answer. Best – MGY Jan 15 '21 at 08:46
1

With tvOS 14, Apple rolled out the PiP feature to everyone. I highly recommend you to have a look to "Master Picture in Picture on tvOS" from the WWDC 20.

Pietro Messineo
  • 777
  • 8
  • 28