<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVPlayerLooper/init(player:templateItem:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVPlayerLooper(cm)playerLooperWithPlayer:templateItem:"
  },
  "title" : "init(player:templateItem:)"
}
-->

# init(player:templateItem:)

Creates a player looper that continuously plays the full duration of a player item.

```
convenience init(player: AVQueuePlayer, templateItem itemToLoop: AVPlayerItem)
```

## Parameters

`player`

The queue player to use for playback. The player must not be `nil`.

`itemToLoop`

The player item to loop, which must not be `nil`.

## Return Value

An new instance of `AVPlayerLooper`.

## Discussion

Creating an instance of this class using this method is equivalent to calling [`init(player:templateItem:timeRange:)`](/documentation/AVFoundation/AVPlayerLooper/init(player:templateItem:timeRange:)) and passing a value of <doc://com.apple.documentation/documentation/CoreMedia/CMTimeRange/invalid> for the `timeRange` parameter.

---

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)