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
Analysis and application of commonly used brushes...
People who often pay attention to health know tha...
This is a question raised by a friend. He couldn&...
This is the 3883rd article of Da Yi Xiao Hu Summe...
On April 22, 2023, the Science Popularization Chi...
Nowadays, the popularity of APP is almost as high...
Mastering "core technology" is the capi...
Source code introduction: Share a beautiful pictu...
Q: Is it difficult to make your own WeChat mini p...
Are you a person who gets excited after only thre...
Operation status of national electric vehicle cha...
[[145188]] What is big data? The phone rang at a ...
When developing an APP, we must first understand ...
I believe everyone knows the power of Cordyceps a...
On April 13, the "2017 International Quantum...