<!--
{
  "documentType" : "article",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/implementing-simple-enhanced-buffering-for-your-content",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "Implementing simple enhanced buffering for your content"
}
-->

# Implementing simple enhanced buffering for your content

Configure your app for simple enhanced buffering to stream content faster to AirPlay-enabled devices and supported CarPlay vehicles.

## Discussion

The [`AVPlayer`](/documentation/AVFoundation/AVPlayer) and [`AVQueuePlayer`](/documentation/AVFoundation/AVQueuePlayer) classes provide the simplest way to enhance buffering for your content with AirPlay 2.

To implement simple enhanced buffering, complete the following steps.

1. Create a player.

```swift
let player = AVQueuePlayer()
```

1. Identify a URL that points to local or cloud content that you want to play.
2. Create an [`AVAsset`](/documentation/AVFoundation/AVAsset) instance with a URL, and then create an [`AVPlayerItem`](/documentation/AVFoundation/AVPlayerItem) instance with that asset.

```swift
let url = URL(string: "http://www.examplecontenturl.com")!
let asset = AVAsset(url: url)
let item = AVPlayerItem(asset: asset)
```

1. Give the player item to the player.

```swift
player.insert(item, after: nil)
```

1. Start playback.

```swift
player.play()
```

---

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)