objc2_av_foundation/generated/
AVPlaybackCoordinator.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-media")]
7use objc2_core_media::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12/// Describes why an AVCoordinatedPlaybackParticipant is not currently available to participate in coordinated playback.
13///
14/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcoordinatedplaybacksuspensionreason?language=objc)
15// NS_TYPED_EXTENSIBLE_ENUM
16pub type AVCoordinatedPlaybackSuspensionReason = NSString;
17
18extern "C" {
19    /// The participant's audio session was interrupted.
20    ///
21    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcoordinatedplaybacksuspensionreasonaudiosessioninterrupted?language=objc)
22    pub static AVCoordinatedPlaybackSuspensionReasonAudioSessionInterrupted:
23        &'static AVCoordinatedPlaybackSuspensionReason;
24}
25
26extern "C" {
27    /// The player is buffering data after a stall.
28    ///
29    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcoordinatedplaybacksuspensionreasonstallrecovery?language=objc)
30    pub static AVCoordinatedPlaybackSuspensionReasonStallRecovery:
31        &'static AVCoordinatedPlaybackSuspensionReason;
32}
33
34extern "C" {
35    /// The participant is presented with interstitial content instead of the main player.
36    ///
37    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcoordinatedplaybacksuspensionreasonplayinginterstitial?language=objc)
38    pub static AVCoordinatedPlaybackSuspensionReasonPlayingInterstitial:
39        &'static AVCoordinatedPlaybackSuspensionReason;
40}
41
42extern "C" {
43    /// The participant cannot participate in coordinated playback.
44    ///
45    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcoordinatedplaybacksuspensionreasoncoordinatedplaybacknotpossible?language=objc)
46    pub static AVCoordinatedPlaybackSuspensionReasonCoordinatedPlaybackNotPossible:
47        &'static AVCoordinatedPlaybackSuspensionReason;
48}
49
50extern "C" {
51    /// The participant's playback object is in a state that requires manual intervention by the user to resume playback.
52    ///
53    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcoordinatedplaybacksuspensionreasonuseractionrequired?language=objc)
54    pub static AVCoordinatedPlaybackSuspensionReasonUserActionRequired:
55        &'static AVCoordinatedPlaybackSuspensionReason;
56}
57
58extern "C" {
59    /// The participant is actively changing current time.
60    ///
61    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcoordinatedplaybacksuspensionreasonuserischangingcurrenttime?language=objc)
62    pub static AVCoordinatedPlaybackSuspensionReasonUserIsChangingCurrentTime:
63        &'static AVCoordinatedPlaybackSuspensionReason;
64}
65
66extern_class!(
67    /// A representation of a temporary break in participation.
68    ///
69    /// Note: See AVPlaybackCoordinator's beginSuspensionForReason: method for details on use.
70    ///
71    /// Subclasses of this type that are used from Swift must fulfill the requirements of a Sendable type.
72    ///
73    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcoordinatedplaybacksuspension?language=objc)
74    #[unsafe(super(NSObject))]
75    #[derive(Debug, PartialEq, Eq, Hash)]
76    pub struct AVCoordinatedPlaybackSuspension;
77);
78
79unsafe impl NSObjectProtocol for AVCoordinatedPlaybackSuspension {}
80
81impl AVCoordinatedPlaybackSuspension {
82    extern_methods!(
83        #[unsafe(method(init))]
84        #[unsafe(method_family = init)]
85        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
86
87        #[unsafe(method(new))]
88        #[unsafe(method_family = new)]
89        pub unsafe fn new() -> Retained<Self>;
90
91        /// The reason for the suspension. This will be communicated to other participants while coordination is suspended.
92        #[unsafe(method(reason))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn reason(&self) -> Retained<AVCoordinatedPlaybackSuspensionReason>;
95
96        /// The begin time of the suspension.
97        #[unsafe(method(beginDate))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn beginDate(&self) -> Retained<NSDate>;
100
101        /// Ends the suspension.
102        ///
103        /// If this is the last suspension, the coordinator will adjust timing of its playback object to match the group.
104        /// Also see endProposingNewTime: for a way to end a suspension and simultaneously proposing a new time to the group.
105        #[unsafe(method(end))]
106        #[unsafe(method_family = none)]
107        pub unsafe fn end(&self);
108
109        #[cfg(feature = "objc2-core-media")]
110        /// Ends the suspension and proposes a new time that everyone should seek to.
111        ///
112        /// If this is the last suspension, the coordinator will propose the new time to the group without changing the groups playback rate.
113        /// If this is not the last suspension, the time will be ignored.
114        /// If the time is not numeric, this will behave like a call to [suspension end].
115        #[unsafe(method(endProposingNewTime:))]
116        #[unsafe(method_family = none)]
117        pub unsafe fn endProposingNewTime(&self, time: CMTime);
118    );
119}
120
121extern "C" {
122    /// Posted by the playback coordinator when its otherParticipants property changes.
123    ///
124    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avplaybackcoordinatorotherparticipantsdidchangenotification?language=objc)
125    pub static AVPlaybackCoordinatorOtherParticipantsDidChangeNotification:
126        &'static NSNotificationName;
127}
128
129extern "C" {
130    /// Posted by the playback coordinator when its suspensionReasons property changes.
131    ///
132    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avplaybackcoordinatorsuspensionreasonsdidchangenotification?language=objc)
133    pub static AVPlaybackCoordinatorSuspensionReasonsDidChangeNotification:
134        &'static NSNotificationName;
135}
136
137extern_class!(
138    /// The playback coordinator negotiates playback state between a player, such as AVPlayer or a custom playback object represented by an implementation of the AVPlaybackCoordinatorPlaybackControlDelegate protocol, and a group of other connected players.
139    ///
140    /// AVPlaybackCoordinator will match rate and time of all connected players. This means that a local rate change or seek will be reflected in all connected players. Equally, a rate change or seek in any of the connected players will be reflected locally.
141    /// AVPlaybackCoordinator does not manage the items in the play queue of the connected players, so it is up to player's owner to share and match the play queue across participants.
142    /// The coordinator does, however, keep track of the identity of items enqueued in each player. This means that for one player's current time and rate to be applied on another player, both players must be playing the same item. If two players are playing different items, they each have independent playback states. When one of the two players transitions to the other's item later, it will match the time and rate of that other player.
143    ///
144    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avplaybackcoordinator?language=objc)
145    #[unsafe(super(NSObject))]
146    #[derive(Debug, PartialEq, Eq, Hash)]
147    pub struct AVPlaybackCoordinator;
148);
149
150unsafe impl NSObjectProtocol for AVPlaybackCoordinator {}
151
152impl AVPlaybackCoordinator {
153    extern_methods!(
154        #[unsafe(method(init))]
155        #[unsafe(method_family = init)]
156        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
157
158        #[unsafe(method(new))]
159        #[unsafe(method_family = new)]
160        pub unsafe fn new() -> Retained<Self>;
161
162        /// The playback states of the other participants in the group.
163        ///
164        /// Use this property to create UI informing the local user about the state of other participants in the group.
165        ///
166        /// Note: The coordinator posts AVPlaybackCoordinatorOtherParticipantsDidChangeNotification when the contents of the array changes.
167        #[unsafe(method(otherParticipants))]
168        #[unsafe(method_family = none)]
169        pub unsafe fn otherParticipants(
170            &self,
171        ) -> Retained<NSArray<AVCoordinatedPlaybackParticipant>>;
172
173        /// Describes why the coordinator is currently not able to participate in group playback.
174        ///
175        /// If the list of reasons is non-empty, the coordinator will not react to any changes of group playback state.
176        #[unsafe(method(suspensionReasons))]
177        #[unsafe(method_family = none)]
178        pub unsafe fn suspensionReasons(
179            &self,
180        ) -> Retained<NSArray<AVCoordinatedPlaybackSuspensionReason>>;
181
182        /// Informs the coordinator that its playback object is detached from the group for some reason and should not receive any playback commands from the coordinator.
183        ///
184        /// Use this to tell the coordinator that its player cannot, or should not, participate in coordinated playback temporarily.
185        /// The coordinator will not respond to playback commands coming from the group and it will also not send any commands to the group.
186        /// To resume in group playback, end a suspension by calling one of the suspension's end methods.
187        ///
188        /// Note: See the description of AVPlaybackCoordinator subclasses for suspensions automatically begun on behalf of their playback objects, if any.
189        ///
190        /// Parameter `suspensionReason`: Indicates the reason for the suspension that is shared with other participants. Can be a system-defined reason (see AVCoordinatedPlaybackSuspensionReason*) or a custom string.
191        #[unsafe(method(beginSuspensionForReason:))]
192        #[unsafe(method_family = none)]
193        pub unsafe fn beginSuspensionForReason(
194            &self,
195            suspension_reason: &AVCoordinatedPlaybackSuspensionReason,
196        ) -> Retained<AVCoordinatedPlaybackSuspension>;
197
198        #[cfg(feature = "objc2-core-media")]
199        /// Returns the item time (for the current item) that the coordinator expects to be playing at a given host clock time.
200        ///
201        /// This method is useful to decide if it is appropriate to end a suspension, e.g. a suspension with AVCoordinatedPlaybackSuspensionReasonStallRecovery, while other participants are continuing playback.
202        #[unsafe(method(expectedItemTimeAtHostTime:))]
203        #[unsafe(method_family = none)]
204        pub unsafe fn expectedItemTimeAtHostTime(&self, host_clock_time: CMTime) -> CMTime;
205    );
206}
207
208extern_class!(
209    /// A participant in a coordinated playback group connected through AVPlaybackCoordinator.
210    ///
211    /// Subclasses of this type that are used from Swift must fulfill the requirements of a Sendable type.
212    ///
213    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcoordinatedplaybackparticipant?language=objc)
214    #[unsafe(super(NSObject))]
215    #[derive(Debug, PartialEq, Eq, Hash)]
216    pub struct AVCoordinatedPlaybackParticipant;
217);
218
219unsafe impl Send for AVCoordinatedPlaybackParticipant {}
220
221unsafe impl Sync for AVCoordinatedPlaybackParticipant {}
222
223unsafe impl NSObjectProtocol for AVCoordinatedPlaybackParticipant {}
224
225impl AVCoordinatedPlaybackParticipant {
226    extern_methods!(
227        /// The reason, if any, this participant is currently not participating in coordinated playback.
228        #[unsafe(method(suspensionReasons))]
229        #[unsafe(method_family = none)]
230        pub unsafe fn suspensionReasons(
231            &self,
232        ) -> Retained<NSArray<AVCoordinatedPlaybackSuspensionReason>>;
233
234        /// YES if the participant is ready to play.
235        #[unsafe(method(isReadyToPlay))]
236        #[unsafe(method_family = none)]
237        pub unsafe fn isReadyToPlay(&self) -> bool;
238
239        /// A unique id for the participant.
240        ///
241        /// Use this identifier to distinguish participants.
242        #[unsafe(method(identifier))]
243        #[unsafe(method_family = none)]
244        pub unsafe fn identifier(&self) -> Retained<NSUUID>;
245    );
246}
247
248/// Methods declared on superclass `NSObject`.
249impl AVCoordinatedPlaybackParticipant {
250    extern_methods!(
251        #[unsafe(method(init))]
252        #[unsafe(method_family = init)]
253        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
254
255        #[unsafe(method(new))]
256        #[unsafe(method_family = new)]
257        pub unsafe fn new() -> Retained<Self>;
258    );
259}
260
261/// AVCoordinatedPlaybackPolicies.
262/// Policies used by AVPlaybackCoordinator to determine how to interact with the group.
263impl AVPlaybackCoordinator {
264    extern_methods!(
265        /// Sets the amount of participants that can join a group before the coordinator stops waiting for this particular suspension reason.
266        ///
267        /// This allows additional configuration for suspension reasons in the suspensionReasonsThatTriggerWaiting array.
268        /// When the coordinator decides whether one participant's suspensions should cause others to wait, it will also consider this limit of participants currently in the group.
269        #[unsafe(method(setParticipantLimit:forWaitingOutSuspensionsWithReason:))]
270        #[unsafe(method_family = none)]
271        pub unsafe fn setParticipantLimit_forWaitingOutSuspensionsWithReason(
272            &self,
273            participant_limit: NSInteger,
274            reason: &AVCoordinatedPlaybackSuspensionReason,
275        );
276
277        /// Returns the maximum number of participants that can be in a group before the coordinator stops waiting out this particular suspensions reason. Default value is NSIntegerMax.
278        #[unsafe(method(participantLimitForWaitingOutSuspensionsWithReason:))]
279        #[unsafe(method_family = none)]
280        pub unsafe fn participantLimitForWaitingOutSuspensionsWithReason(
281            &self,
282            reason: &AVCoordinatedPlaybackSuspensionReason,
283        ) -> NSInteger;
284
285        /// If the coordinator decides to delay playback to wait for others, it will wait out these reasons, but not others.
286        #[unsafe(method(suspensionReasonsThatTriggerWaiting))]
287        #[unsafe(method_family = none)]
288        pub unsafe fn suspensionReasonsThatTriggerWaiting(
289            &self,
290        ) -> Retained<NSArray<AVCoordinatedPlaybackSuspensionReason>>;
291
292        /// Setter for [`suspensionReasonsThatTriggerWaiting`][Self::suspensionReasonsThatTriggerWaiting].
293        #[unsafe(method(setSuspensionReasonsThatTriggerWaiting:))]
294        #[unsafe(method_family = none)]
295        pub unsafe fn setSuspensionReasonsThatTriggerWaiting(
296            &self,
297            suspension_reasons_that_trigger_waiting: &NSArray<
298                AVCoordinatedPlaybackSuspensionReason,
299            >,
300        );
301
302        /// Determines if participants should mirror the originator's stop time when pausing.
303        ///
304        /// If YES, all participants will seek to the originator's stop time after they pause. Use this if it is desirable to counteract any network delay incurred by communicating the originator's pause to the other participants.
305        /// If NO, it's acceptable for participants to stop at slightly different offsets and a pause will not cause other participants' time to jump back.
306        #[unsafe(method(pauseSnapsToMediaTimeOfOriginator))]
307        #[unsafe(method_family = none)]
308        pub unsafe fn pauseSnapsToMediaTimeOfOriginator(&self) -> bool;
309
310        /// Setter for [`pauseSnapsToMediaTimeOfOriginator`][Self::pauseSnapsToMediaTimeOfOriginator].
311        #[unsafe(method(setPauseSnapsToMediaTimeOfOriginator:))]
312        #[unsafe(method_family = none)]
313        pub unsafe fn setPauseSnapsToMediaTimeOfOriginator(
314            &self,
315            pause_snaps_to_media_time_of_originator: bool,
316        );
317    );
318}
319
320extern_class!(
321    /// An AVPlaybackCoordinator subclass for controlling an AVPlayer
322    ///
323    /// While the coordinator is connected to other participants, it will intercept rate changes and seeks issued to the player to share these with other participants if appropriate.
324    /// Clients of AVPlayer can thus use the AVPlayer interfaces to modify the playback state of connected participants. When appropriate, the coordinator will also impose rate changes and seeks from other participants on the player. If this occurs, the corresponding notifications will carry an originating participant in their payload.
325    /// See AVPlayer's playbackCoordinator property for more details about player behavior changes.
326    /// AVPlayerPlaybackCoordinator may begin suspensions on behalf of the player when the player's timeControlStatus changes from AVPlayerTimeControlStatusPlaying to AVPlayerTimeControlStatusWaitingToPlayAtSpecifiedRate or AVPlayerTimeControlStatusPaused. These suspensions will end when the player's timeControlStatus changes back to AVPlayerTimeControlStatusPlaying. This means that a suspension that begun because the player entered a waiting state, will end automatically when the player is done waiting. A suspension that begun because the player paused, will only end once the player's rate changes back to non-zero.
327    ///
328    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avplayerplaybackcoordinator?language=objc)
329    #[unsafe(super(AVPlaybackCoordinator, NSObject))]
330    #[derive(Debug, PartialEq, Eq, Hash)]
331    pub struct AVPlayerPlaybackCoordinator;
332);
333
334unsafe impl NSObjectProtocol for AVPlayerPlaybackCoordinator {}
335
336impl AVPlayerPlaybackCoordinator {
337    extern_methods!(
338        #[unsafe(method(init))]
339        #[unsafe(method_family = init)]
340        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
341
342        #[unsafe(method(new))]
343        #[unsafe(method_family = new)]
344        pub unsafe fn new() -> Retained<Self>;
345
346        #[cfg(feature = "AVPlayer")]
347        /// The AVPlayer this coordinator is controlling.
348        #[unsafe(method(player))]
349        #[unsafe(method_family = none)]
350        pub unsafe fn player(&self, mtm: MainThreadMarker) -> Option<Retained<AVPlayer>>;
351
352        /// An object implementing the AVPlaybackCoordinatorDelegate protocol.
353        #[unsafe(method(delegate))]
354        #[unsafe(method_family = none)]
355        pub unsafe fn delegate(
356            &self,
357        ) -> Option<Retained<ProtocolObject<dyn AVPlayerPlaybackCoordinatorDelegate>>>;
358
359        /// This is a [weak property][objc2::topics::weak_property].
360        /// Setter for [`delegate`][Self::delegate].
361        #[unsafe(method(setDelegate:))]
362        #[unsafe(method_family = none)]
363        pub unsafe fn setDelegate(
364            &self,
365            delegate: Option<&ProtocolObject<dyn AVPlayerPlaybackCoordinatorDelegate>>,
366        );
367    );
368}
369
370extern_protocol!(
371    /// Delegate protocol for AVPlayerPlaybackCoordinator.
372    ///
373    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avplayerplaybackcoordinatordelegate?language=objc)
374    pub unsafe trait AVPlayerPlaybackCoordinatorDelegate: NSObjectProtocol {
375        #[cfg(feature = "AVPlayerItem")]
376        /// Called by the coordinator to identify AVPlayerItems played by the coordinator's AVPlayer.
377        ///
378        /// Implementing this method allows the coordinator to establish identity of two items created from different URLs, e.g., because one participant is using a local cache and the other a remote URL.
379        /// If the method is not implemented, the coordinator will derive the identifier from the item's asset.
380        #[optional]
381        #[unsafe(method(playbackCoordinator:identifierForPlayerItem:))]
382        #[unsafe(method_family = none)]
383        unsafe fn playbackCoordinator_identifierForPlayerItem(
384            &self,
385            coordinator: &AVPlayerPlaybackCoordinator,
386            player_item: &AVPlayerItem,
387        ) -> Retained<NSString>;
388
389        #[cfg(feature = "AVPlayerItem")]
390        /// Called by the coordinator to obtain time ranges in the AVPlayerItem that do not correspond to the primary content.
391        ///
392        /// Implement this method to provide the coordinator a list of sample accurate time ranges that represent interstitials in the player item.
393        /// The coordinator would use this along with the waiting policy for the playingInterstitial suspension to coordinate playback across the group.
394        /// If the playingInterstitial suspension is part of AVPlaybackCoordinator.suspensionReasonsThatTriggerWaiting, then the coordinator would wait for other participants to complete the interstitial before proceeding with playback.
395        /// And if the playingInterstitial suspension is not a part of AVPlaybackCoordinator.suspensionReasonsThatTriggerWaiting then the coordinator will not wait for the participant playing the interstitial.
396        /// Instead, that participant would jump to catch up with the rest of the group when they finish playing the interstitial.
397        /// This delegate method is expected to return an array of NSValues with each value containing a CMTimeRange that represents the interstitial.
398        /// If the method is not implemented, the coordinator would assume that the entire item corresponds to the primary content.
399        #[optional]
400        #[unsafe(method(playbackCoordinator:interstitialTimeRangesForPlayerItem:))]
401        #[unsafe(method_family = none)]
402        unsafe fn playbackCoordinator_interstitialTimeRangesForPlayerItem(
403            &self,
404            coordinator: &AVPlayerPlaybackCoordinator,
405            player_item: &AVPlayerItem,
406        ) -> Retained<NSArray<NSValue>>;
407    }
408);
409
410/// Configuration for a call to [AVDelegatingPlaybackCoordinator coordinateRateChangeToRate:options:].
411///
412///
413/// Requests that the coordinator begin playback as soon as possible and ignore other participant's readiness and suspensions.
414///
415/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinatorratechangeoptions?language=objc)
416// NS_OPTIONS
417#[repr(transparent)]
418#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
419pub struct AVDelegatingPlaybackCoordinatorRateChangeOptions(pub NSUInteger);
420bitflags::bitflags! {
421    impl AVDelegatingPlaybackCoordinatorRateChangeOptions: NSUInteger {
422        #[doc(alias = "AVDelegatingPlaybackCoordinatorRateChangeOptionPlayImmediately")]
423        const PlayImmediately = 1<<0;
424    }
425}
426
427unsafe impl Encode for AVDelegatingPlaybackCoordinatorRateChangeOptions {
428    const ENCODING: Encoding = NSUInteger::ENCODING;
429}
430
431unsafe impl RefEncode for AVDelegatingPlaybackCoordinatorRateChangeOptions {
432    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
433}
434
435/// Configuration for a call to [AVDelegatingPlaybackCoordinator coordinateSeekToTime:options:].
436///
437///
438/// Requests that the coordinator resume playback as soon as possible after the seek is complete and ignore other participant's readiness and suspensions.
439///
440/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinatorseekoptions?language=objc)
441// NS_OPTIONS
442#[repr(transparent)]
443#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
444pub struct AVDelegatingPlaybackCoordinatorSeekOptions(pub NSUInteger);
445bitflags::bitflags! {
446    impl AVDelegatingPlaybackCoordinatorSeekOptions: NSUInteger {
447        #[doc(alias = "AVDelegatingPlaybackCoordinatorSeekOptionResumeImmediately")]
448        const ResumeImmediately = 1<<0;
449    }
450}
451
452unsafe impl Encode for AVDelegatingPlaybackCoordinatorSeekOptions {
453    const ENCODING: Encoding = NSUInteger::ENCODING;
454}
455
456unsafe impl RefEncode for AVDelegatingPlaybackCoordinatorSeekOptions {
457    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
458}
459
460extern_class!(
461    /// An AVPlaybackCoordinator subclass for controlling a custom playback object.
462    ///
463    /// Note: Use AVPlayer's playbackCoordinator property to get an AVPlaybackCoordinator for an AVPlayer.
464    ///
465    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinator?language=objc)
466    #[unsafe(super(AVPlaybackCoordinator, NSObject))]
467    #[derive(Debug, PartialEq, Eq, Hash)]
468    pub struct AVDelegatingPlaybackCoordinator;
469);
470
471unsafe impl NSObjectProtocol for AVDelegatingPlaybackCoordinator {}
472
473impl AVDelegatingPlaybackCoordinator {
474    extern_methods!(
475        /// Creates an AVPlaybackCoordinator for a custom playback object.
476        ///
477        /// Use this to create an AVPlaybackCoordinator when playback is not driven by an AVPlayer.
478        ///
479        /// Parameter `playbackControlDelegate`: An object conforming to the AVPlaybackCoordinatorPlaybackControlDelegate protocol representing a custom playback object.
480        /// The coordinator will only hold a weak reference to its delegate.
481        ///
482        /// Note: See AVPlayer's playbackCoordinator property to get an AVPlaybackCoordinator for an AVPlayer.
483        #[unsafe(method(initWithPlaybackControlDelegate:))]
484        #[unsafe(method_family = init)]
485        pub unsafe fn initWithPlaybackControlDelegate(
486            this: Allocated<Self>,
487            playback_control_delegate: &ProtocolObject<
488                dyn AVPlaybackCoordinatorPlaybackControlDelegate,
489            >,
490        ) -> Retained<Self>;
491
492        /// The custom player implementation controlled by the coordinator.
493        #[unsafe(method(playbackControlDelegate))]
494        #[unsafe(method_family = none)]
495        pub unsafe fn playbackControlDelegate(
496            &self,
497        ) -> Option<Retained<ProtocolObject<dyn AVPlaybackCoordinatorPlaybackControlDelegate>>>;
498
499        /// Coordinaties a rate change across the group of connected participants, waiting for other participants to become ready if necessary.
500        ///
501        /// The coordinator will request a coordinated rate change from all other connected participants.
502        /// When changing the rate from zero to non-zero, it may also wait out other participant's suspensions as configured by the suspensionReasonsThatTriggerWaiting property.
503        ///
504        /// This method should not be called when the rate change should not affect the group, or the group should not have control over local playback temporarily, e.g. a pause because of an audio session interruption.
505        /// In those cases, the coordinator should be informed by beginning a suspension with the appropriate reason instead. If other participants pause is dependent on the coordinator's configuration.
506        /// The suspension will stop the coordinator from issuing further commands to its playbackControlDelegate. After beginning the suspension, the playback object can be reconfigured as necessary.
507        ///
508        /// Note: Calling this method while the coordinator is suspended affects only the local playback object. The group state will not be affected, even after the suspension ends.
509        ///
510        /// Parameter `rate`: The playback rate the group should be using.
511        ///
512        /// Parameter `options`: Additional configuration of the rate change. For details see AVDelegatingPlaybackCoordinatorRateChangeOptions.
513        #[unsafe(method(coordinateRateChangeToRate:options:))]
514        #[unsafe(method_family = none)]
515        pub unsafe fn coordinateRateChangeToRate_options(
516            &self,
517            rate: c_float,
518            options: AVDelegatingPlaybackCoordinatorRateChangeOptions,
519        );
520
521        #[cfg(feature = "objc2-core-media")]
522        /// Triggers a seek to the requested time for all connected participants.
523        ///
524        /// For behavior around resuming playback after the seek is complete and suspensions, see the discussion of coordinateRateChangeToRate:options.
525        ///
526        /// Note: Calling this method while the coordinator is suspended affects only the local playback object. The group state will not be affected, even after the suspension ends.
527        /// To end a suspension and also affect the group timing see -[AVCoordinatedPlaybackSuspension endProposingNewTime:]
528        ///
529        /// Parameter `time`: The time the group should seek to when the command ends.
530        ///
531        /// Parameter `options`: Additional configuration of the seek. For details see AVDelegatingPlaybackCoordinatorSeekOptions.
532        #[unsafe(method(coordinateSeekToTime:options:))]
533        #[unsafe(method_family = none)]
534        pub unsafe fn coordinateSeekToTime_options(
535            &self,
536            time: CMTime,
537            options: AVDelegatingPlaybackCoordinatorSeekOptions,
538        );
539
540        #[cfg(feature = "objc2-core-media")]
541        /// Informs the coordinator to transition to a new current item.
542        ///
543        /// The coordinator will stop sending commands for any previous item identifier and begin sending commands for the new identifier.
544        /// The proposed timing will either be used as the new referece timing for the group, or it will be compared to an already existing reference timing.
545        /// If the proposed timing doesn't match such an existing reference timing, the coordinator will use the playbackControlDelegate to issue appropriate commands to match up the timing.
546        ///
547        /// Note: This is not a way to affect the play queue of other participants. All other participants must do this independently, e.g. as a side-effect of an automatic item transition or an out-of-band communication requesting a similar item change.
548        ///
549        /// Parameter `itemIdentifier`: The identifier for the new current item. May be nil if nothing is playing.
550        ///
551        /// Parameter `snapshotTimebase`: A timebase used to communicate the initial playback state of the new item. If NULL, the coordinator will assume that playback is paused at kCMTimeZero.
552        /// An appropriate timebase to pass to the completion handler may be retreived from AVFoundation playback objects such as AVSampleBufferRenderSynchronizer.
553        /// It can also be created manually using CMTimebaseCreateWithSourceClock. The timebase will only be used to take a snapshot of its immediate timing. It will not be observed further.
554        #[unsafe(method(transitionToItemWithIdentifier:proposingInitialTimingBasedOnTimebase:))]
555        #[unsafe(method_family = none)]
556        pub unsafe fn transitionToItemWithIdentifier_proposingInitialTimingBasedOnTimebase(
557            &self,
558            item_identifier: Option<&NSString>,
559            snapshot_timebase: Option<&CMTimebase>,
560        );
561
562        /// The item identifier of the current item. Previously set by a call to transitionToItemWithIdentifier:proposingInitialTimingBasedOnTimebase:
563        #[unsafe(method(currentItemIdentifier))]
564        #[unsafe(method_family = none)]
565        pub unsafe fn currentItemIdentifier(&self) -> Option<Retained<NSString>>;
566
567        /// Instructs the coordinator to re-issue commands to synchronize the current item back to the state of the other participants.
568        ///
569        /// Use this method when the playback object is in a state that doesn't match the group for some reason and should be re-synchronized.
570        #[unsafe(method(reapplyCurrentItemStateToPlaybackControlDelegate))]
571        #[unsafe(method_family = none)]
572        pub unsafe fn reapplyCurrentItemStateToPlaybackControlDelegate(&self);
573    );
574}
575
576/// Methods declared on superclass `AVPlaybackCoordinator`.
577impl AVDelegatingPlaybackCoordinator {
578    extern_methods!(
579        #[unsafe(method(init))]
580        #[unsafe(method_family = init)]
581        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
582
583        #[unsafe(method(new))]
584        #[unsafe(method_family = new)]
585        pub unsafe fn new() -> Retained<Self>;
586    );
587}
588
589extern_protocol!(
590    /// A custom player implementation
591    ///
592    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avplaybackcoordinatorplaybackcontroldelegate?language=objc)
593    pub unsafe trait AVPlaybackCoordinatorPlaybackControlDelegate: NSObjectProtocol {
594        #[cfg(feature = "block2")]
595        /// Called by the coordinator to match the playback rate of the control delegate to the group, when the target rate is non-zero.
596        ///
597        /// The coordinator issues this command when the desired playback timeline has changed. This may mean that the rate has changed, but it can also mean that the anchor time has changed.
598        /// Play commands are only issued when the desired playback rate is non-zero.
599        ///
600        /// Parameter `coordinator`: The coordinator requesting a change in playback rate.
601        ///
602        /// Parameter `playCommand`: A play command object. See AVDelegatingPlaybackCoordinatorPlayCommand.
603        /// The receiver should verify that the command is still valid by inspecting the expectedCurrentItemIdentifier property before applying the command.
604        ///
605        /// Parameter `completionHandler`: The receiver must call the completion handler when done, either when the command has been handled succesfully or when the receiver has indicated its inability
606        /// to handle the command by beginning a suspension with an appropriate reason.
607        #[unsafe(method(playbackCoordinator:didIssuePlayCommand:completionHandler:))]
608        #[unsafe(method_family = none)]
609        unsafe fn playbackCoordinator_didIssuePlayCommand_completionHandler(
610            &self,
611            coordinator: &AVDelegatingPlaybackCoordinator,
612            play_command: &AVDelegatingPlaybackCoordinatorPlayCommand,
613            completion_handler: &block2::Block<dyn Fn()>,
614        );
615
616        #[cfg(feature = "block2")]
617        /// Called by the coordinator to pause playback.
618        ///
619        /// Parameter `coordinator`: The coordinator requesting playback to pause.
620        ///
621        /// Parameter `pauseCommand`: A pause command object. See AVDelegatingPlaybackCoordinatorPauseCommand.
622        /// The receiver should verify that the command is still valid by inspecting the expectedCurrentItemIdentifier property before applying the command.
623        ///
624        /// Parameter `completionHandler`: The receiver must call the completion handler when done, either when the command has been handled succesfully or when the receiver has indicated its inability
625        /// to handle the command by beginning a suspension with an appropriate reason.
626        /// If the command's shouldBufferInAnticipationOfPlayback is YES, the completion handler should also only be called once the playback object is ready to receive a subsequent play command.
627        #[unsafe(method(playbackCoordinator:didIssuePauseCommand:completionHandler:))]
628        #[unsafe(method_family = none)]
629        unsafe fn playbackCoordinator_didIssuePauseCommand_completionHandler(
630            &self,
631            coordinator: &AVDelegatingPlaybackCoordinator,
632            pause_command: &AVDelegatingPlaybackCoordinatorPauseCommand,
633            completion_handler: &block2::Block<dyn Fn()>,
634        );
635
636        #[cfg(feature = "block2")]
637        /// Called by the coordinator to seek to a new time.
638        ///
639        /// The coordinator issues this command when the playback object current time changes, potentially also pausing playback.
640        ///
641        /// Parameter `coordinator`: The coordinator requesting the seek.
642        ///
643        /// Parameter `seekCommand`: A seek command object. See AVDelegatingPlaybackCoordinatorSeekCommand.
644        /// The receiver should verify that the command is still valid by inspecting the expectedCurrentItemIdentifier property before applying the command.
645        ///
646        /// Parameter `completionHandler`: The receiver must call the completion handler when done, either when the command has been handled succesfully or when the receiver has indicated its inability
647        /// to handle the command by beginning a suspension with an appropriate reason.
648        /// If the command's shouldBufferInAnticipationOfPlayback is YES, the completion handler should also only be called once the playback object is ready to receive a subsequent play command.
649        #[unsafe(method(playbackCoordinator:didIssueSeekCommand:completionHandler:))]
650        #[unsafe(method_family = none)]
651        unsafe fn playbackCoordinator_didIssueSeekCommand_completionHandler(
652            &self,
653            coordinator: &AVDelegatingPlaybackCoordinator,
654            seek_command: &AVDelegatingPlaybackCoordinatorSeekCommand,
655            completion_handler: &block2::Block<dyn Fn()>,
656        );
657
658        #[cfg(feature = "block2")]
659        /// Called by the coordinator to indicate that playback is expected to begin soon and the playback object should begin buffering.
660        ///
661        /// The coordinator issues this command when playback is currently paused and the coordinator is expecting playback to start soon.
662        /// In response to this command, it is appropriate to update playback UI to indicate playback in a waiting state.
663        /// The expected start can be cancelled by calling -[AVDelegatingPlaybackCoordinator coordinateRateChangeTo:0].
664        ///
665        /// Parameter `coordinator`: The coordinator requesting buffering to begin.
666        ///
667        /// Parameter `bufferingCommand`: A buffering command object. See AVDelegatingPlaybackCoordinatorBufferingCommand.
668        /// The receiver should verify that the command is still valid by inspecting the expectedCurrentItemIdentifier property before applying the command.
669        ///
670        /// Parameter `completionHandler`: The receiver must call the completion handler when done, either when the command has been handled succesfully or when the receiver has indicated its inability
671        /// to handle the command by beginning a suspension with an appropriate reason.
672        /// For buffering commands, the command should only be considered complete once the playback object is ready to receive a subsequent play command.
673        #[unsafe(method(playbackCoordinator:didIssueBufferingCommand:completionHandler:))]
674        #[unsafe(method_family = none)]
675        unsafe fn playbackCoordinator_didIssueBufferingCommand_completionHandler(
676            &self,
677            coordinator: &AVDelegatingPlaybackCoordinator,
678            buffering_command: &AVDelegatingPlaybackCoordinatorBufferingCommand,
679            completion_handler: &block2::Block<dyn Fn()>,
680        );
681    }
682);
683
684extern_class!(
685    /// Abstract superclass for playback commands
686    ///
687    /// Subclasses of this type that are used from Swift must fulfill the requirements of a Sendable type.
688    ///
689    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinatorplaybackcontrolcommand?language=objc)
690    #[unsafe(super(NSObject))]
691    #[derive(Debug, PartialEq, Eq, Hash)]
692    pub struct AVDelegatingPlaybackCoordinatorPlaybackControlCommand;
693);
694
695unsafe impl Send for AVDelegatingPlaybackCoordinatorPlaybackControlCommand {}
696
697unsafe impl Sync for AVDelegatingPlaybackCoordinatorPlaybackControlCommand {}
698
699unsafe impl NSObjectProtocol for AVDelegatingPlaybackCoordinatorPlaybackControlCommand {}
700
701impl AVDelegatingPlaybackCoordinatorPlaybackControlCommand {
702    extern_methods!(
703        #[unsafe(method(init))]
704        #[unsafe(method_family = init)]
705        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
706
707        #[unsafe(method(new))]
708        #[unsafe(method_family = new)]
709        pub unsafe fn new() -> Retained<Self>;
710
711        /// The participant causing this command to be issued.
712        ///
713        /// Only commands issued on behalf of another participant will contain an originator.
714        /// Commands caused by local requests, e.g., requests to coordinate a rate change, will not contain an originator.
715        /// Similarly, re-application of older commands, e.g., in response to a call to [AVDelegatingPlaybackCoordinator reapplyCurrentItemStateToPlaybackControlDelegate], will not contain an originator.
716        /// If the originator is non-nil, it may be appropriate to show UI indicating someone else's action.
717        #[unsafe(method(originator))]
718        #[unsafe(method_family = none)]
719        pub unsafe fn originator(&self) -> Option<Retained<AVCoordinatedPlaybackParticipant>>;
720
721        /// Indicates the item this command was issued for.
722        ///
723        /// Commands are always meant for the current item. A command handler should verify that the identifier of its current item matches this identifier.
724        /// If it doesn't this command is obsolete and should be ignored. Note that any completion handler of the delegate method issuing the command must still be invoked.
725        #[unsafe(method(expectedCurrentItemIdentifier))]
726        #[unsafe(method_family = none)]
727        pub unsafe fn expectedCurrentItemIdentifier(&self) -> Retained<NSString>;
728    );
729}
730
731extern_class!(
732    /// A playback command requesting playback with specific timing.
733    ///
734    /// Subclasses of this type that are used from Swift must fulfill the requirements of a Sendable type.
735    ///
736    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinatorplaycommand?language=objc)
737    #[unsafe(super(AVDelegatingPlaybackCoordinatorPlaybackControlCommand, NSObject))]
738    #[derive(Debug, PartialEq, Eq, Hash)]
739    pub struct AVDelegatingPlaybackCoordinatorPlayCommand;
740);
741
742unsafe impl Send for AVDelegatingPlaybackCoordinatorPlayCommand {}
743
744unsafe impl Sync for AVDelegatingPlaybackCoordinatorPlayCommand {}
745
746unsafe impl NSObjectProtocol for AVDelegatingPlaybackCoordinatorPlayCommand {}
747
748impl AVDelegatingPlaybackCoordinatorPlayCommand {
749    extern_methods!(
750        #[unsafe(method(init))]
751        #[unsafe(method_family = init)]
752        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
753
754        #[unsafe(method(new))]
755        #[unsafe(method_family = new)]
756        pub unsafe fn new() -> Retained<Self>;
757
758        /// Playback rate. Will always be non-zero.
759        #[unsafe(method(rate))]
760        #[unsafe(method_family = none)]
761        pub unsafe fn rate(&self) -> c_float;
762
763        #[cfg(feature = "objc2-core-media")]
764        /// The itemTime that playback should begin at.
765        ///
766        /// The receiver of this command should verify that data is loaded for the requested time and potentially begin loading it before beginning playback.
767        /// It is not important to load data for time exactly. If data "similar" to time is already loaded, it is acceptable to start playback with the loaded data. Playback should still start with the requested timing.
768        /// Should the receiver be unable to start with the exact requested timing, playback will be out of sync with the group.
769        /// If data for the requested time cannot be loaded, or playback stalls later, the command handler may want to indicate this to the coordinator by beginning a suspension with AVCoordinatedPlaybackSuspensionReasonStallRecovery.
770        #[unsafe(method(itemTime))]
771        #[unsafe(method_family = none)]
772        pub unsafe fn itemTime(&self) -> CMTime;
773
774        #[cfg(feature = "objc2-core-media")]
775        /// This is the host clock time (see CMClockGetHostTimeClock()) defining when playback should start (or should have started) at the given itemTime.
776        #[unsafe(method(hostClockTime))]
777        #[unsafe(method_family = none)]
778        pub unsafe fn hostClockTime(&self) -> CMTime;
779    );
780}
781
782extern_class!(
783    /// A playback command requesting buffering in anticipation of playback.
784    ///
785    /// Receiving this command should be reflected to the user as playback in a buffering state.
786    /// To cancel the group intent to begin playback and move back into a paused state, call [AVDelegatingPlaybackCoordinator coordinateRateChangeToRate:0 options: 0]
787    ///
788    /// Subclasses of this type that are used from Swift must fulfill the requirements of a Sendable type.
789    ///
790    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinatorbufferingcommand?language=objc)
791    #[unsafe(super(AVDelegatingPlaybackCoordinatorPlaybackControlCommand, NSObject))]
792    #[derive(Debug, PartialEq, Eq, Hash)]
793    pub struct AVDelegatingPlaybackCoordinatorBufferingCommand;
794);
795
796unsafe impl Send for AVDelegatingPlaybackCoordinatorBufferingCommand {}
797
798unsafe impl Sync for AVDelegatingPlaybackCoordinatorBufferingCommand {}
799
800unsafe impl NSObjectProtocol for AVDelegatingPlaybackCoordinatorBufferingCommand {}
801
802impl AVDelegatingPlaybackCoordinatorBufferingCommand {
803    extern_methods!(
804        #[unsafe(method(init))]
805        #[unsafe(method_family = init)]
806        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
807
808        #[unsafe(method(new))]
809        #[unsafe(method_family = new)]
810        pub unsafe fn new() -> Retained<Self>;
811
812        /// The rate to prepare playback for.
813        ///
814        /// The command should only be considered complete once the player is ready to receive an AVDelegatingPlaybackCoordinatorPlayCommand with the indicated rate.
815        #[unsafe(method(anticipatedPlaybackRate))]
816        #[unsafe(method_family = none)]
817        pub unsafe fn anticipatedPlaybackRate(&self) -> c_float;
818
819        /// Communicates when the coordinator expects the command's completion handler at the latest.
820        ///
821        /// A receiver of a buffering command should fire the completion handler by this date at the latest. This is useful in buffering situations where the receiver
822        /// has not yet buffered enough data to be considered ready to play by the due date. The receiver should then decide to either complete the command as is
823        /// to try and keep up with the group, or alternatively begin a stall recovery suspension to communicate the situation to the other participants.
824        /// Completing the command after this date means that the coordinator will likely send a play command for a later time than the receiver buffered for.
825        #[unsafe(method(completionDueDate))]
826        #[unsafe(method_family = none)]
827        pub unsafe fn completionDueDate(&self) -> Option<Retained<NSDate>>;
828    );
829}
830
831extern_class!(
832    /// A playback command requesting a pause
833    ///
834    /// Subclasses of this type that are used from Swift must fulfill the requirements of a Sendable type.
835    ///
836    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinatorpausecommand?language=objc)
837    #[unsafe(super(AVDelegatingPlaybackCoordinatorPlaybackControlCommand, NSObject))]
838    #[derive(Debug, PartialEq, Eq, Hash)]
839    pub struct AVDelegatingPlaybackCoordinatorPauseCommand;
840);
841
842unsafe impl Send for AVDelegatingPlaybackCoordinatorPauseCommand {}
843
844unsafe impl Sync for AVDelegatingPlaybackCoordinatorPauseCommand {}
845
846unsafe impl NSObjectProtocol for AVDelegatingPlaybackCoordinatorPauseCommand {}
847
848impl AVDelegatingPlaybackCoordinatorPauseCommand {
849    extern_methods!(
850        #[unsafe(method(init))]
851        #[unsafe(method_family = init)]
852        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
853
854        #[unsafe(method(new))]
855        #[unsafe(method_family = new)]
856        pub unsafe fn new() -> Retained<Self>;
857
858        /// Indicates that playback is anticipated and the player should begin buffering if necessary.
859        ///
860        /// When shouldBufferInAnticipationOfPlayback is YES, some participant wants to resume playback at the rate indicated by the anticipatedPlaybackRate property.
861        /// This should be treated similar to receiving a separate AVDelegatingPlaybackCoordinatorBufferingCommand.
862        /// If YES, the command should only be considered complete once the player is ready to receive an AVDelegatingPlaybackCoordinatorPlayCommand with the indicated rate.
863        #[unsafe(method(shouldBufferInAnticipationOfPlayback))]
864        #[unsafe(method_family = none)]
865        pub unsafe fn shouldBufferInAnticipationOfPlayback(&self) -> bool;
866
867        /// The rate to prepare for if shouldBufferInAnticipationOfPlayback is YES.
868        #[unsafe(method(anticipatedPlaybackRate))]
869        #[unsafe(method_family = none)]
870        pub unsafe fn anticipatedPlaybackRate(&self) -> c_float;
871    );
872}
873
874extern_class!(
875    /// A playback command requesting a seek.
876    ///
877    /// If the current playback rate is non-zero, playback should not automatically resume after the seek. Instead the delegate should pause and wait for the coordinator to issue another PlayCommand.
878    ///
879    /// Subclasses of this type that are used from Swift must fulfill the requirements of a Sendable type.
880    ///
881    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinatorseekcommand?language=objc)
882    #[unsafe(super(AVDelegatingPlaybackCoordinatorPlaybackControlCommand, NSObject))]
883    #[derive(Debug, PartialEq, Eq, Hash)]
884    pub struct AVDelegatingPlaybackCoordinatorSeekCommand;
885);
886
887unsafe impl Send for AVDelegatingPlaybackCoordinatorSeekCommand {}
888
889unsafe impl Sync for AVDelegatingPlaybackCoordinatorSeekCommand {}
890
891unsafe impl NSObjectProtocol for AVDelegatingPlaybackCoordinatorSeekCommand {}
892
893impl AVDelegatingPlaybackCoordinatorSeekCommand {
894    extern_methods!(
895        #[unsafe(method(init))]
896        #[unsafe(method_family = init)]
897        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
898
899        #[unsafe(method(new))]
900        #[unsafe(method_family = new)]
901        pub unsafe fn new() -> Retained<Self>;
902
903        #[cfg(feature = "objc2-core-media")]
904        /// The time to seek the currentItem to.
905        ///
906        /// Playback should never automatically resume after seeking to this time. The coordinator will issue a new PlayCommand when everyone else is ready to resume.
907        #[unsafe(method(itemTime))]
908        #[unsafe(method_family = none)]
909        pub unsafe fn itemTime(&self) -> CMTime;
910
911        /// Indicates that playback is anticipated and the player should begin buffering if necessary.
912        ///
913        /// When shouldBufferInAnticipationOfPlayback, playback is expected to eventually resume at the rate indicated by the anticipatedPlaybackRate property.
914        /// This should be treated similar to receiving a separate AVDelegatingPlaybackCoordinatorBufferingCommand.
915        /// If YES, the command should only be considered complete once the player is ready to receive an AVDelegatingPlaybackCoordinatorPlayCommand with the indicated rate.
916        #[unsafe(method(shouldBufferInAnticipationOfPlayback))]
917        #[unsafe(method_family = none)]
918        pub unsafe fn shouldBufferInAnticipationOfPlayback(&self) -> bool;
919
920        /// The rate to prepare for if shouldBufferInAnticipationOfPlayback is YES.
921        #[unsafe(method(anticipatedPlaybackRate))]
922        #[unsafe(method_family = none)]
923        pub unsafe fn anticipatedPlaybackRate(&self) -> c_float;
924
925        /// Communicates when the coordinator expects the command's completion handler at the latest.
926        ///
927        /// A seek command expecting buffering in anticipation of playback does expect the receiver to fire the completion handler by this date at the latest.
928        /// This is useful in buffering situations where the receiver has not yet buffered enough data to be considered ready to play by the due date.
929        /// The receiver should then decide to either complete the command as is to try and keep up with the group, or alternatively begin a stall recovery
930        /// suspension to communicate the situation to the other participants.
931        /// Completing the command after this date means that the coordinator will likely send a play command for a later time than the receiver buffered for.
932        #[unsafe(method(completionDueDate))]
933        #[unsafe(method_family = none)]
934        pub unsafe fn completionDueDate(&self) -> Option<Retained<NSDate>>;
935    );
936}