Skip to navigation

Enable Picture-in-Picture

Learn how to enable Picture-in-Picture (PiP) in the FastPix iOS Player so playback continues when the app goes to the background.

The FastPix iOS Player supports system Picture-in-Picture on iOS 14 and later.

Enable PiP

playerViewController.enablePiP = true
playerViewController.setupPiP(parent: self)

Note: Call setupPiP(parent:) after the view appears. Don’t release the player while PiP is active.

Start and stop PiP

Toggle PiP programmatically:

playerViewController.togglePiP()

Check PiP state

Check whether PiP is currently active before performing actions that might conflict:

if playerViewController.isPiPActive() {
return
}

Observe PiP state changes

Listen for PiP state and availability changes using notifications:

// Notified when PiP starts or stops
FastPixPiPStateChangedNotification
// Notified when PiP availability changes
FastPixPiPAvailabilityChangedNotification