---
title: "stepByDecodeTime(_:completionHandler:)"
framework: MediaExtension
role: symbol
role_heading: Instance Method
platforms: [macOS 14.0+]
path: "mediaextension/mesamplecursor/stepbydecodetime(_:completionhandler:)"
---

# stepByDecodeTime(_:completionHandler:)

Moves the cursor on the decode timeline by the delta decode time that you specify.

## Declaration

```swift
func stepByDecodeTime(_ deltaDecodeTime: CMTime, completionHandler: @escaping @Sendable (CMTime, Bool, (any Error)?) -> Void)
```

```swift
func stepByDecodeTime(_ deltaDecodeTime: CMTime) async throws -> (CMTime, Bool)
```

## Parameters

- `deltaDecodeTime`: The decode time to move the sample cursor to.
- `completionHandler`: The completion block to execute when the move operation finishes.

## Discussion

Discussion The value for actualDecodeTime is the final cursor decode time. Because sample cursors snap to sample boundaries when stepped, this value may not be equal to the current sample decode time + deltaDecodeTime, even if the cursor isn’t pinned. If the request would advance the cursor past the end of the last sample or before the first sample, this method sets the cursor to point to that limiting sample, and sets positionWasPinned to true. Otherwise, it sets positionWasPinned to false.

## See Also

### Stepping through samples

- [samplesWithEarlierDTSsMayHaveLaterPTSs(than:)](mediaextension/mesamplecursor/sampleswithearlierdtssmayhavelaterptss(than:).md)
- [samplesWithLaterDTSsMayHaveEarlierPTSs(than:)](mediaextension/mesamplecursor/sampleswithlaterdtssmayhaveearlierptss(than:).md)
- [estimatedSampleLocation()](mediaextension/mesamplecursor/estimatedsamplelocation().md)
- [refineSampleLocation(_:refinementData:refinementDataLength:refinedLocation:)](mediaextension/mesamplecursor/refinesamplelocation(_:refinementdata:refinementdatalength:refinedlocation:).md)
- [stepByPresentationTime(_:completionHandler:)](mediaextension/mesamplecursor/stepbypresentationtime(_:completionhandler:).md)
- [stepInDecodeOrder(by:completionHandler:)](mediaextension/mesamplecursor/stepindecodeorder(by:completionhandler:).md)
- [stepInPresentationOrder(by:completionHandler:)](mediaextension/mesamplecursor/stepinpresentationorder(by:completionhandler:).md)
