<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVPlayerItem/init(url:)-1xrtk",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVPlayerItem(im)initWithURL:"
  },
  "title" : "init(url:)"
}
-->

# init(url:)

Creates a player item with a specified URL.

```
nonisolated convenience init(url URL: URL)
```

## Parameters

`URL`

A URL identifying the media resource to be played.

## Return Value

A new player item, prepared to use `URL`.

## Discussion

This method immediately returns the item, but with the status [`AVPlayerItem.Status.unknown`](/documentation/AVFoundation/AVPlayerItem/Status-swift.enum/unknown).

Associating the player item with an [`AVPlayer`](/documentation/AVFoundation/AVPlayer) immediately begins enqueuing its media and preparing it for playback. If the URL contains valid data that can be used by the player item, its status later changes to [`AVPlayerItem.Status.readyToPlay`](/documentation/AVFoundation/AVPlayerItem/Status-swift.enum/readyToPlay). If the URL contains no valid data or otherwise can’t be used by the player item, its status later changes to [`AVPlayerItem.Status.failed`](/documentation/AVFoundation/AVPlayerItem/Status-swift.enum/failed). You can determine the nature of the failure by querying the player item’s [`error`](/documentation/AVFoundation/AVPlayerItem/error) property.

---

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)