<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ImmersiveMediaSupport",
  "identifier" : "/documentation/ImmersiveMediaSupport/PresentationDescriptorReader/metadataItem(frameTimeRange:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Immersive Media Support"
    ],
    "preciseIdentifier" : "s:21ImmersiveMediaSupport28PresentationDescriptorReaderC12metadataItem14frameTimeRangeSo010AVMetadataH0CSgSo06CMTimeK0a_tKF"
  },
  "title" : "metadataItem(frameTimeRange:)"
}
-->

# metadataItem(frameTimeRange:)

Builds a metadata item containing the presentation commands active at the start of
the specified frame’s time range.

```
func metadataItem(frameTimeRange: CMTimeRange) throws -> AVMetadataItem?
```

## Parameters

`frameTimeRange`

The frame’s presentation time range. Its `start` is
used to resolve which commands are active; the returned item is stamped with the
full range.

## Return Value

An `AVMetadataItem` whose value encodes the active presentation commands
for that frame, or `nil` if none are active.

## Discussion

This is intended to be called once per video frame. The returned item’s `time` and
`duration` are set directly from `frameTimeRange`, so the caller can write it into
a per-frame metadata track without further clipping or stamping. Returns `nil` if
no presentation commands are active at `frameTimeRange.start`.

---

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)