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

# Add skip controls

> Learn how to add OTT-style skip controls (Skip Intro, Skip Song, Skip Credits) to the FastPix iOS Player.

Learn how to add OTT-style skip controls (Skip Intro, Skip Song, Skip Credits) to the FastPix iOS Player.

The FastPix iOS Player SDK supports time-based skip segments that let users skip intros, songs, and credits during playback. The SDK manages skip logic and timing—you're responsible for rendering the skip UI.

## Key behaviors

* Skip segments can be configured per playlist item.
* The SDK automatically validates and applies skip ranges during playback.
* Skip button visibility is managed based on the current playback time.
* Skip state resets automatically during playlist transitions.
* Fully compatible with custom player UIs.

## Configure skip segments

Define skip segments when creating a playlist item:

```swift
let item = FastPixPlaylistItem(
    playbackId: "<PLAYBACK_ID>",
    title: "Episode 1",
    skipSegments: [
        // Skip Intro from 10s to 90s
        SkipSegment(startTime: 10, endTime: 90, type: .intro),

        // Skip Song section from 6:00 to 8:00
        SkipSegment(startTime: 360, endTime: 480, type: .song),

        // Skip Credits from 9:00 to 9:56
        SkipSegment(startTime: 540, endTime: 596, type: .credits)
    ]
)
```

## Initialize the skip manager

Initialize the skip manager after the player is ready. This is recommended inside `viewDidAppear`:

```swift
override func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)

    DispatchQueue.main.async {
        // Make sure the AVPlayer instance is initialized
        guard self.playerViewController.player != nil else { return }

        // Attach the skip manager and set the delegate
        self.playerViewController.setupSkipManager(delegate: self)

        // Set up your custom skip button UI
        self.setupSkipButton()
    }
}
```

## Handle skip button visibility

The SDK calls this delegate method when playback enters or exits a skip segment:

```swift
func onSkipVisibilityChanged(isVisible: Bool) {
    // Show skip button when a skip segment is active
    // Hide it when playback is outside skip ranges
    skipButton.isHidden = !isVisible
}
```

> **Note:** The SDK manages skip logic and timing. You're responsible for rendering the skip button UI.