Instance Method

seekToTime:completionHandler:

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

Declaration

- (void)seekToTime:(CMTime)time completionHandler:(void (^)(BOOL finished))completionHandler;

Parameters

time

The time to which to seek.

completionHandler

The block to invoke when the seek operation has either been completed or been interrupted. The block takes one argument:

finished

Indicates whether the seek operation completed.

Discussion

Use this method to seek the current player item to the specified time and be notified when the operation completes. If the seek request completes without being interrupted (either by another seek request or by any other operation), the completion handler you provide is executed with the finished parameter set to YES.

If another seek request is already in progress when you call this method, the completion handler for the in-progress seek request is executed immediately with the finished parameter set to NO.

See Also

Managing Time

- currentTime

Returns the current time of the current player item.

- seekToTime:

Sets the current playback time to the specified time.

- seekToDate:

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

- seekToDate:completionHandler:

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

- seekToTime:toleranceBefore:toleranceAfter:

Sets the current playback time within a specified time bound.

- 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.