Skip to navigation

Add skip controls

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:

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:

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:

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.