<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVPlayerItem/seek(to:toleranceBefore:toleranceAfter:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVPlayerItem(im)seekToTime:toleranceBefore:toleranceAfter:completionHandler:"
  },
  "title" : "seek(to:toleranceBefore:toleranceAfter:completionHandler:)"
}
-->

# seek(to: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.

```
nonisolated func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime, completionHandler: (@Sendable (Bool) -> Void)? = nil)
```

## Parameters

`time`

The time to which to seek.

`toleranceBefore`

The temporal tolerance before `time`.

    Pass     <doc://com.apple.documentation/documentation/CoreMedia/CMTime/zero>     to request sample accurate seeking (this may incur additional decoding delay).

`toleranceAfter`

The temporal tolerance after `time`.

    Pass     <doc://com.apple.documentation/documentation/CoreMedia/CMTime/zero>     to request sample accurate seeking (this may incur additional decoding delay).

`completionHandler`

The block to invoke when the seek operation has finished.

## Discussion

Use this method to seek to a specified time for the item.

The time seeked to will be within the range `[time-toleranceBefore, time+toleranceAfter]` and may differ from `time` for efficiency.

Invoking this method with <doc://com.apple.documentation/documentation/CoreMedia/CMTime/positiveInfinity> for `toleranceBefore` and `toleranceAfter` is the same as invoking [`seek(to:completionHandler:)`](/documentation/AVFoundation/AVPlayerItem/seek(to:completionHandler:)-91gnw) directly.

Seeking is constrained by the collection of seekable time ranges. If you seek to a time outside all of the seekable ranges, the seek will result in a current time within the seekable ranges.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)