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
This article is 1,300 words long and is recommend...
According to the new product release rules of the ...
=================================================...
The article analyzes and explains the universal g...
Those great advertisements often come from the bra...
Suzhou's smart transportation construction ha...
100 Golden Problem-solving Models for High School...
Ling'er Investment Research Diary "T+0 Pr...
Introduction In this book, we invited Nagai Kafu,...
The moon is the closest celestial body to the ear...
How much is the price for developing a Harbin nai...
01. CNZZ -UDplus Website: udplus.umeng.com Note: ...
Introduction: In the recent Double Eleven e-comme...