Skip to content

Instantly share code, notes, and snippets.

@shaps80
shaps80 / AVPlayer+Scrubbing.swift
Last active October 22, 2024 07:48
Enables smooth frame-by-frame scrubbing (in both directions) – similar to Apple's applications.
public enum Direction {
case forward
case backward
}
internal var player: AVPlayer?
private var isSeekInProgress = false
private var chaseTime = kCMTimeZero
private var preferredFrameRate: Float = 23.98