Control playback speed

Learn how to adjust video playback speed dynamically in the FastPix iOS Player.

The FastPix iOS Player SDK lets you change the playback speed during playback without interrupting the video or reloading the stream. Changes take effect immediately and don’t affect video quality, buffering, or audio sync.

Available playback speeds

The SDK supports the following speeds:

  • 0.25x — Quarter speed (slow motion)
  • 0.5x — Half speed
  • 0.75x — Three-quarter speed
  • 1.0x — Normal speed (default)
  • 1.25x
  • 1.5x
  • 1.75x
  • 2.0x — Double speed

Set a specific playback speed

1// Set the playback speed to a specific value
2playerViewController.setPlaybackSpeed(.1x)

Increment and decrement speed

Step through the available speeds one level at a time:

1// Increase speed: 1x → 1.25x → 1.5x → 2x
2playerViewController.incrementPlaybackRate()
3
4// Decrease speed: 2x → 1.5x → 1.25x → 1x
5playerViewController.decrementPlaybackRate()

Get the current playback speed

1// Returns the active playback rate (for example, 1.0, 1.5)
2let currentRate = playerViewController.currentPlaybackRate()

Listen to speed changes

Implement this delegate method to respond when the playback speed changes:

1func onPlaybackRateChanged(
2 _ player: AVPlayerViewController,
3 rate: Float
4) {
5 print("[PlaybackRate] Playback speed changed to \(rate)x")
6}