> 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 a custom seek bar

> Learn how to add a custom seek bar to your FastPix iOS Player using `FastPixSeekBar` and `FastPixSeekManager`.

Learn how to add a custom seek bar to your FastPix iOS Player using `FastPixSeekBar` and `FastPixSeekManager`.

## Add the seek bar

Create and position a `FastPixSeekBar` in your player view. Connect its `onSeekEnd` handler to the player's `seek` method:

```swift
private func setupSeekBar() {
    seekBar.translatesAutoresizingMaskIntoConstraints = false
    seekBar.layer.cornerRadius = 3
    playerView.addSubview(seekBar)

    NSLayoutConstraint.activate([
        seekBar.leadingAnchor.constraint(equalTo: playerView.leadingAnchor, constant: 16),
        seekBar.trailingAnchor.constraint(equalTo: playerView.trailingAnchor, constant: -16),
        seekBar.bottomAnchor.constraint(equalTo: playerView.bottomAnchor, constant: -20),
        seekBar.heightAnchor.constraint(equalToConstant: 28)
    ])

    seekBar.onSeekEnd = { [weak self] time in
        self?.playerViewController.seek(to: time)
    }
}
```

## Implement the seek delegate

Conform to `FastPixSeekDelegate` to receive real-time updates for buffered time and current playback position. Use these callbacks to keep the seek bar in sync with the player:

```swift
extension VideoPlayerViewController: FastPixSeekDelegate {

    func onBufferedTimeUpdate(loaded: TimeInterval, duration: TimeInterval) {
        seekBar.updateBuffer(loaded: loaded, duration: duration)
    }

    func onTimeUpdate(currentTime: TimeInterval, duration: TimeInterval) {
        seekBar.updateTime(current: currentTime, duration: duration)
    }

    func onSeekStart(at time: TimeInterval) {}
    func onSeekEnd(at time: TimeInterval) {}
}
```

## What's next

* [Add seek preview thumbnails](/docs/ios-player/add-seek-preview-thumbnails) to show spritesheet-based previews during scrubbing.
* [Add forward and rewind controls](/docs/ios-player/add-forward-and-rewind-controls) for skip buttons.