seek(to:toleranceBefore:toleranceAfter:)
Requests that the player seek to a specified time with the amount of accuracy specified by the time tolerance values.
Declaration
nonisolated func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime)Parameters
- time:
A time to seek to.
- toleranceBefore:
A tolerance before the target time to allow.
- toleranceAfter:
A tolerance after the target time to allow.
Mentioned in
Discussion
The player seeks within the range [time-beforeTolerance, time+afterTolerance], and may differ from the specified time for efficiency. You can request sample accurate seeking by passing a time value ofkCMTimeZero for both toleranceBefore and toleranceAfter. Sample accurate seeking may incur additional decoding delay which can impact seeking performance.
Passing kCMTimePositiveInfinity for both toleranceBefore and toleranceAfter is the same as messaging seek(to:) directly.