Creates a player looper instance to repeat the specified time range of a player item using a queue player.
- iOS 10.0+
- macOS 10.12+
- Mac Catalyst 13.0+
- tvOS 10.0+
The queue player to use for playback. The player must not be
The player item to loop, which must not be
The player item time range to loop. Passing a value of
invalidis equivalent to a time range of [0, player item’s duration].
An new instance of
The player item you specify will be used as a template to generate at least 3 player item replicas that will be inserted into the specified player’s queue to accomplish the looping playback. As the player item will only be used as a template, and not for actual playback, any changes you make to the player item after initialization will not be reflected in the replicas. If you need to explicitly configure the replica player items, such as adding instances of
AVPlayer to them, you can access them through the
You should not modify the player’s queue while
AVPlayer is performing looping playback. If you need to perform any additional configuration of the player prior to playback, you should set its
0, perform the required configuration, and then begin playback once the configuration is complete.
CMTime you specify will limit each item’s loop iteration to playing within the specified time range. To loop the full duration of the asset, specify a time range value of
invalid for the
time parameter. Time range looping will be accomplished by seeking to the time range’s start time and setting player item’s
forward property on the looping item replicas.