> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://fastpix.com/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://fastpix.com/docs/_mcp/server.

# 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.

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

```swift
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:

```swift
playerViewController.togglePiP()
```

## Check PiP state

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

```swift
if playerViewController.isPiPActive() {
    return
}
```

## Observe PiP state changes

Listen for PiP state and availability changes using notifications:

```swift
// Notified when PiP starts or stops
FastPixPiPStateChangedNotification

// Notified when PiP availability changes
FastPixPiPAvailabilityChangedNotification
```