playbackCoordinator(_:didIssue:completionHandler:)
Tells the delegate to expect playback soon and to start buffering media data in preparation.
Declaration
func playbackCoordinator(_ coordinator: AVDelegatingPlaybackCoordinator, didIssue bufferingCommand: AVDelegatingPlaybackCoordinatorBufferingCommand, completionHandler: @escaping @Sendable () -> Void)func playbackCoordinator(_ coordinator: AVDelegatingPlaybackCoordinator, didIssue bufferingCommand: AVDelegatingPlaybackCoordinatorBufferingCommand) asyncParameters
- coordinator:
The playback coordinator that issues the command.
- bufferingCommand:
The command to execute. Before performing it, verify that its Expectedcurrentitemidentifier property value matches the item that you’re currently playing. If the command isn’t valid for the current item, ignore it and call the completion handler.
- completionHandler:
A completion handler that your app must call when it finishes handling the command, either successfully or after beginning a suspension if it can’t handle the command currently.
If the value of the command’s Shouldbufferinanticipationofplayback property is True, call the completion handler only after the player is ready for playback.
Discussion
The coordinator issues this command when playback is currently in a paused state and the coordinator is expecting playback to start soon. It provides an appropriate opportunity to update your player UI to indicate that playback is in a waiting state.