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

1playerViewController.enablePiP = true
2playerViewController.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:

1playerViewController.togglePiP()

Check PiP state

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

1if playerViewController.isPiPActive() {
2 return
3}

Observe PiP state changes

Listen for PiP state and availability changes using notifications:

1// Notified when PiP starts or stops
2FastPixPiPStateChangedNotification
3
4// Notified when PiP availability changes
5FastPixPiPAvailabilityChangedNotification