Instance Method

seek(to:)

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

Declaration

func seek(to date: Date) -> Bool

Parameters

date

The time to which to seek.

Return Value

true if the playhead was moved to date, otherwise false.

Discussion

For playback content that is associated with a range of dates, this method moves the playhead to point within that range. This method will fail (return false) if date is outside the range or if the content is not associated with a range of dates.

See Also

Moving the Playhead

func step(byCount: Int)

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

var seekableTimeRanges: [NSValue]

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

func seek(to: CMTime, completionHandler: ((Bool) -> Void)?)

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

func seek(to: Date, completionHandler: ((Bool) -> Void)?) -> Bool

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

func seek(to: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime, completionHandler: ((Bool) -> Void)?)

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

func cancelPendingSeeks()

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

func seek(to: CMTime)

Sets the current playback time to the specified time.

Deprecated
func seek(to: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime)

Sets the current playback time within a specified time bound.

Deprecated