December 2015
Intermediate to advanced
350 pages
6h 32m
English
iOS 9 added some really cool multitasking functionalities to select devices, such as the latest iPads. One of these functionalities is PiP, or Picture in Picture. In this chapter, we’ll have a look at some of these exciting features.
You want to let a user shrink a video to occupy a portion of the screen, so that she can view and interact with other content in other apps.
I’ll break the process down into small and digestible steps:
AVPlayerLayer. This layer will be used by a view controller to display the video.VPlayerItem that represents the video.AVPlayer.play() function on the player to start normal playback.currentItem.status property of your player and wait until the status becomes ReadyToPlay, at which point you create an instance of the AVPictureInPictureController class.pictureInPicturePossible property of your controller. Once this value becomes true, let the user know that she can now go into Picture in Picture mode.Read now
Unlock full access