AVFoundationPiPPlayer: Picture-in-Picture Playback with AVKit

Last Revision:
Version 1.4, 2018-02-08
Updated for Swift 4 and iOS 11.2 SDK.
(Full Revision History)
Build Requirements:
Xcode 9.2, iOS 11.2 SDK
Runtime Requirements:
iOS 9.0

Demonstrates how to use the AVPictureInPictureController class to implement picture-in-picture video playback. It shows the steps required to start and stop picture-in-picture mode and to setup a delegate to receive event callbacks. Clients of AVFoundation using the AVPlayerLayer class for media playback must use the AVPictureInPictureController class, whereas clients of AVKit who use the AVPlayerViewController class get picture-in-picture mode without any additional setup.