|class||AVFoundation||MBS AVFoundation Plugin||22.3||✅ Yes||❌ No||❌ No||✅ Yes||All|
// Create player and configure
Dim player As New AVQueuePlayerMBS
Dim playerLayer As New AVPlayerLayerMBS(player)
// Create looping item
Dim file As FolderItem = SpecialFolder.Desktop.Child("loop.mov")
Dim itemToLoop As New AVPlayerItemMBS(file)
// Create looping helper object. Loop item segment from 5sec to 7sec
Dim startTime As CMTimeMBS = CMTimeMBS.Make(5000, 1000)
Dim duration As CMTimeMBS = CMTimeMBS.Make(2000, 1000)
Dim timeRange As CMTimeRangeMBS = CMTimeRangeMBS.Make(startTime, duration)
Dim looper As New AVPlayerLooperMBS(player, itemToLoop, timeRange)
// Perform any other set up operations like setting AVPlayerItemDataOutputs on the looping item replicas
// Start playback
// itemToLoop between 5s and 7s plays repeatedly
// To end the looping
// Player will play through the end of the current looping item
The same result can be accomplished with AVQueuePlayer directly, but AVPlayerLooper provides a simpler interface to loop a single AVPlayerItem with an option to specify a time range. AVPlayerLooper only supports looping for forward playback (positive player rate). Behavior is undefined for negative player rate.
Note that the transition at the loop point is not guaranteed to be gapless.
Requires macOS 10.13, iOS 10.0 or newer.
- 5 properties
- 4 methods
- shared method available as boolean
- 4 constants
Indicates that the looper is no longer looping because -disableLooping was invoked.
Indicates that the looper is not able to perform looping playback because of an error. The error is described by the value of the error property.
Indicates that the looper is ready for looping playback.
Indicates that the status of the looper is not yet known.
This class has no sub classes.
The items on this page are in the following plugins: MBS AVFoundation Plugin.
Feedback: Report problem or ask question.