<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVPlayerItem/init(asset:automaticallyLoadedAssetKeys:)-5czjh",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "s:So12AVPlayerItemC12AVFoundationE5asset28automaticallyLoadedAssetKeysABSo7AVAssetC_SayAC22AVPartialAsyncPropertyCyAGGGtcfc"
  },
  "title" : "init(asset:automaticallyLoadedAssetKeys:)"
}
-->

# init(asset:automaticallyLoadedAssetKeys:)

Creates a player item for the asset, and automatically loads values for the specified properties.

```
@MainActor @preconcurrency convenience init(asset: AVAsset, automaticallyLoadedAssetKeys: [AVPartialAsyncProperty<AVAsset>] = [])
```

## Parameters

`asset`

The asset to play.

`automaticallyLoadedAssetKeys`

An array of property identifiers for which the system automatically loads a value.

## Discussion

The system automatically loads values for the specified property identifiers before the player item reaches an [`AVPlayerItem.Status.readyToPlay`](/documentation/AVFoundation/AVPlayerItem/Status-swift.enum/readyToPlay) state. In this state, calling [`status(of:)`](/documentation/AVFoundation/AVAsynchronousKeyValueLoading/status(of:)) on a specified property identifier returns a value of [`AVAsyncProperty.Status.loaded(_:)`](/documentation/AVFoundation/AVAsyncProperty/Status/loaded(_:)) or [`AVAsyncProperty.Status.failed(_:)`](/documentation/AVFoundation/AVAsyncProperty/Status/failed(_:)).

---

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)