---
title: "sample(forHostTime:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avplayervideooutput/sample(forhosttime:)"
---

# sample(forHostTime:)

Retrieves a video sample along with auxiliary information for display at the specified host time.

## Declaration

```swift
func sample(forHostTime hostTime: CMTime) -> AVPlayerVideoOutput.Sample?
```

## Parameters

- `hostTime`: A CMTime that expresses a desired host time.

## Return Value

Return Value A sample containing the frame, presentation timestamp, and active configuration for the specified host time, or nil if no sample was available for that host time.

## See Also

### Accessing video data

- [AVPlayerVideoOutput.Sample](avfoundation/avplayervideooutput/sample.md)
- [taggedBuffers(forHostTime:)](avfoundation/avplayervideooutput/taggedbuffers(forhosttime:).md)
- [AVPlayerVideoOutput.Configuration](avfoundation/avplayervideooutput/configuration.md)
