<!--
{
  "availability" : [
    "iOS: 10.0.0 - 14.0.0",
    "iPadOS: 10.0.0 - 14.0.0",
    "macCatalyst: 13.1.0 - 14.0.0",
    "visionOS: 1.0.0 - 1.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "MediaPlayer",
  "identifier" : "/documentation/MediaPlayer/MPPlayableContentDataSource/contentItem(forIdentifier:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Media Player"
    ],
    "preciseIdentifier" : "c:objc(pl)MPPlayableContentDataSource(im)contentItemForIdentifier:completionHandler:"
  },
  "title" : "contentItem(forIdentifier:completionHandler:)"
}
-->

# contentItem(forIdentifier:completionHandler:)

Retrieves the content item associated with the provided identifier.

```
optional func contentItem(forIdentifier identifier: String, completionHandler: @escaping @Sendable (MPContentItem?, (any Error)?) -> Void)
```

## Parameters

`identifier`

The String that identifies a content item.

`completionHandler`

A block that is called after the content item has been loaded.

- contentItem: The content item associated with the identifier. If there is no content item, the value of this parameter is `nil`.
- error: If an error occurred, this parameter holds the error object that explains the error. Otherwise, the value of this parameter is `nil`.

## Discussion

Client apps should always call the completion handler after loading has finished.

---

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)