Instance Method

seekToTime:toleranceBefore:toleranceAfter:

Sets the current playback time within a specified time bound.

Declaration

- (void)seekToTime:(CMTime)time toleranceBefore:(CMTime)toleranceBefore toleranceAfter:(CMTime)toleranceAfter;

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 seekToTime: directly.

See Also

Moving the Playhead

- stepByCount:

Moves the player item’s current time forward or backward by a specified number of steps.

seekableTimeRanges

An array of time ranges within which it is possible to seek.

- seekToTime:completionHandler:

Sets the current playback time to the specified time and executes the specified block when the seek operation completes or is interrupted.

- seekToDate:completionHandler:

Sets the current playback time to the time specified by the date object.

- seekToTime:toleranceBefore:toleranceAfter:completionHandler:

Sets the current playback time within a specified time bound and invokes the specified block when the seek operation completes or is interrupted.

- cancelPendingSeeks

Cancels any pending seek requests and invokes the corresponding completion handlers if present.

- seekToDate:

Sets the current playback time to the time specified by the date object.

Deprecated
- seekToTime:

Sets the current playback time to the specified time.

Deprecated