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
When managing their weight, some people specifica...
Kitchen and bathroom renovation is the most commo...
Come, before we get started, let’s do a test to s...
How come my face becomes sensitive? Whenever this...
Regarding mobile promotion , we always say that t...
Today's article would like to share with you ...
Speaking of dark circles It seems that many peopl...
The dilemma of constipation, We all have encounte...
In the past two years, domestic brands have been ...
In 2022, there are 3.7 billion social media users...
This article shares with you the "Baidu Sear...
Large and medium-sized websites refer to those wi...
The factors that affect the quotation of Huizhou ...