Follow the instructions in this section to use Picture-in-Picture (PiP) on a supported iPad. To enable the video playback to support the picture-in-picture mode, make sure your Xcode project and App are configured as follows:
Next, choose the appropriate AVKit, AV Foundation, or WebKit class for video playback. The choice depends on the characteristics of your application and the user experience you want to provide.
If you support PiP with AVKit but want to opt out of a specific PiP video, set the player view controller’s allowsPictureInPicturePlayback property to NO.
The WebKit framework provides the WKWebView class, which supports the PiP feature of iOS 9. If you use WebKit to support PiP, but want to opt out of PiP for a specific video, set the allowsPictureInPictureMediaPlayback property of the associated web view instance to NO. (This property will be available in a future beta of iOS 9.) If you have an older app that uses the deprecated MPMoviePlayerViewController or MPMoviePlayerController to play videos, you must adopt the advanced iOS video playback framework to support picture-in-picture. Important: Apple wants the Picture-in-Picture feature to always be accessible to users, and only respond to explicit requests from users. In particular, apps that fail to respond immediately to user requests to invoke the Picture-in-Picture feature when backed up will be rejected by the App Store. iOS 9 automatically switches a full-screen video to PiP playback when the user presses the Home button or triggers a notification that takes them to another app. The requirements for video playback to use this feature are as follows:
Tip: Users can disable automatic PiP initiation in Settings > General > Multitasking > Persistent Video Overlay. If you think you have everything set up correctly but find that your video doesn’t go into PiP when you press the Home button, check this setting. When the video played by your app switches to picture-in-picture playback, the system manages the presentation of the video content while your app continues to run in the background. When your app runs in the background, make sure to discard unneeded resources such as view controllers, views, images, and data caches. In this case, you expect to perform appropriate and necessary operations such as video synthesis, audio processing, downloading the next content to play, etc., but you must be careful to consume as few resources as possible. If your app consumes too many resources in the background, the system will terminate it. |
<<: iOS 9 split-screen multitasking: Slide Over & Split View Quick Start (Chinese version)
>>: 【WOT2015】Highlights of the Mobile Internet Developer Conference
User growth strategies need to be changed accordi...
2021 Tik Tok Hot-selling Live Broadcast Room Crea...
For e-commerce platforms, accurately identifying ...
As mini programs become more and more sophisticat...
With the development of technology, the developme...
`UINavigationBar` and `UINavigationItem` are comm...
Recently, a survey conducted by Fudan University ...
Audiophile music listeners always have impeccable...
On May 10, Xiaohongshu announced the "Brand ...
Hot, hot, hot, the weather is so hot lately that ...
Chinese Internet companies generally do not set c...
The concept of User Growth (UG) originated from t...
As of today in 2020, with the rapid rise and matu...
The peak pollen season in Beijing this spring has...
The author of this article spent 6 hours to creat...