seek(to:toleranceBefore:toleranceAfter:)
Sets the current playback time within a specified time bound.
Declaration
func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime)Parameters
- time:
The time to which you would like to move the playback cursor.
- toleranceBefore:
The tolerance allowed before
time. - toleranceAfter:
The tolerance allowed after
time.
Discussion
The time seeked to will be within the range [time-beforeTolerance, time+afterTolerance], and may differ from the specified time for efficiency. If you pass kCMTimeZero for both toleranceBefore and toleranceAfter (to request sample accurate seeking), you may incur additional decoding delay that impacts seeking performance.
Passing kCMTimePositiveInfinity for both toleranceBefore and toleranceAfter is the same as messaging seek(to:) directly.