For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
StatusSupportDiscussionsLog inSign Up
Docs HomeAPI ReferenceVideo on DemandAI FeaturesLive StreamingVideo PlayerVideo DataCloud PlayoutRecipes
Docs HomeAPI ReferenceVideo on DemandAI FeaturesLive StreamingVideo PlayerVideo DataCloud PlayoutRecipes
  • Player SDKs
    • Introduction
  • Web player
    • Install the FastPix web player
    • Play uploaded videos
    • Handle playback errors
  • Android player
    • Install FastPix Android player
    • Set up the player
    • Play uploaded videos
    • Handle playback errors
  • iOS player
    • Install FastPix iOS player
    • Play uploaded videos
    • Handle playback errors
      • Build a custom player UI
      • Add a custom seek bar
      • Add forward and rewind controls
      • Handle orientation changes
  • Flutter player
    • Install FastPix Flutter player
    • Play uploaded videos
    • Handle playback errors
LogoLogo
StatusSupportDiscussionsLog inSign Up
On this page
  • Add the seek bar
  • Implement the seek delegate
  • What’s next
iOS playerPlayer UI

Add a custom seek bar

Was this page helpful?
Previous

Add forward and rewind controls

Next
Built with

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:

1private func setupSeekBar() {
2 seekBar.translatesAutoresizingMaskIntoConstraints = false
3 seekBar.layer.cornerRadius = 3
4 playerView.addSubview(seekBar)
5
6 NSLayoutConstraint.activate([
7 seekBar.leadingAnchor.constraint(equalTo: playerView.leadingAnchor, constant: 16),
8 seekBar.trailingAnchor.constraint(equalTo: playerView.trailingAnchor, constant: -16),
9 seekBar.bottomAnchor.constraint(equalTo: playerView.bottomAnchor, constant: -20),
10 seekBar.heightAnchor.constraint(equalToConstant: 28)
11 ])
12
13 seekBar.onSeekEnd = { [weak self] time in
14 self?.playerViewController.seek(to: time)
15 }
16}

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:

1extension VideoPlayerViewController: FastPixSeekDelegate {
2
3 func onBufferedTimeUpdate(loaded: TimeInterval, duration: TimeInterval) {
4 seekBar.updateBuffer(loaded: loaded, duration: duration)
5 }
6
7 func onTimeUpdate(currentTime: TimeInterval, duration: TimeInterval) {
8 seekBar.updateTime(current: currentTime, duration: duration)
9 }
10
11 func onSeekStart(at time: TimeInterval) {}
12 func onSeekEnd(at time: TimeInterval) {}
13}

What’s next

  • Add seek preview thumbnails to show spritesheet-based previews during scrubbing.
  • Add forward and rewind controls for skip buttons.