Instance Method

seek(to:)

Sets the current playback time to the specified time.

Declaration

func seek(to time: CMTime)

Parameters

time

The time to which to seek.

Discussion

The time to which the player is seeked may differ from the specified time for efficiency. For sample accurate seeking see seek(to:toleranceBefore:toleranceAfter:).

See Also

Managing Time

func currentTime() -> CMTime

Returns the current time of the current player item.

func seek(to: Date)

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

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)

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: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime)

Sets the current playback time within a specified time bound.

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.