---
title: "init(player:templateItem:)"
framework: avfoundation
role: symbol
role_heading: Initializer
path: "avfoundation/avplayerlooper/init(player:templateitem:)"
---

# init(player:templateItem:)

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

## Declaration

```swift
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

Return Value An new instance of AVPlayerLooper.

## Discussion

Discussion Creating an instance of this class using this method is equivalent to calling init(player:templateItem:timeRange:) and passing a value of invalid for the timeRange parameter.

## See Also

### Creating a player looper

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