Instance Method


Plays the sequence.


func play(_ completionHandler: AVMIDIPlayerCompletionHandler? = nil)



A block that is executed when playback is completed.


If prepareToPlay() has not been invoked, play may be delayed while the events are prerolled.

See Also

Playing Content

func prepareToPlay()

Prepares to play the sequence by prerolling all events.

var isPlaying: Bool

A Boolean value that indicates whether the sequence is playing.

func stop()

Stops playing the sequence.

var duration: TimeInterval

The length of the currently loaded file, in seconds.

var currentPosition: TimeInterval

The current playback position, in seconds.

var rate: Float

The playback rate of the player.