---
title: AVPlayerLooper
framework: avfoundation
role: symbol
role_heading: Class
path: avfoundation/avplayerlooper
---

# AVPlayerLooper

An object that loops media content using a queue player.

## Declaration

```swift
class AVPlayerLooper
```

## Overview

Overview You can manually implement looping playback in your app using AVQueuePlayer, but AVPlayerLooper provides a much simpler interface to loop a single AVPlayerItem. You create a player looper by passing it a reference to your AVQueuePlayer and a template AVPlayerItem and the looper automatically manages the looping playback of this content (see example). let asset = // AVAsset with its 'duration' property value loaded let playerItem = AVPlayerItem(asset: asset)   // Create a new player looper with the queue player and template item playerLooper = AVPlayerLooper(player: queuePlayer, templateItem: playerItem)   // Begin looping playback queuePlayer.play()

## Topics

### Creating a player looper

- [init(player:templateItem:timeRange:existingItemsOrdering:)](avfoundation/avplayerlooper/init(player:templateitem:timerange:existingitemsordering:).md)
- [init(player:templateItem:)](avfoundation/avplayerlooper/init(player:templateitem:).md)
- [init(player:templateItem:timeRange:)](avfoundation/avplayerlooper/init(player:templateitem:timerange:).md)

### Configuring looping

- [loopingPlayerItems](avfoundation/avplayerlooper/loopingplayeritems.md)
- [disableLooping()](avfoundation/avplayerlooper/disablelooping().md)

### Observing looping state

- [loopCount](avfoundation/avplayerlooper/loopcount.md)
- [status](avfoundation/avplayerlooper/status-swift.property.md)
- [AVPlayerLooper.Status](avfoundation/avplayerlooper/status-swift.enum.md)

### Monitoring errors

- [error](avfoundation/avplayerlooper/error.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Playback control

- [Observing playback state in SwiftUI](avfoundation/observing-playback-state-in-swiftui.md)
- [Controlling the transport behavior of a player](avfoundation/controlling-the-transport-behavior-of-a-player.md)
- [Creating a seamless multiview playback experience](avfoundation/creating-a-seamless-multiview-playback-experience.md)
- [AVPlayer](avfoundation/avplayer.md)
- [AVPlayerItem](avfoundation/avplayeritem.md)
- [AVPlayerItemTrack](avfoundation/avplayeritemtrack.md)
- [AVQueuePlayer](avfoundation/avqueueplayer.md)
