objc2_av_foundation/generated/
AVPlayer.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/// These constants are returned by the AVPlayer status property to indicate whether it can successfully play items.
13///
14///
15/// Indicates that the status of the player is not yet known because it has not tried to load new media resources for
16/// playback.
17///
18/// Indicates that the player is ready to play AVPlayerItem instances.
19///
20/// Indicates that the player can no longer play AVPlayerItem instances because of an error. The error is described by
21/// the value of the player's error property.
22///
23/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avplayerstatus?language=objc)
24// NS_ENUM
25#[repr(transparent)]
26#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
27pub struct AVPlayerStatus(pub NSInteger);
28impl AVPlayerStatus {
29    #[doc(alias = "AVPlayerStatusUnknown")]
30    pub const Unknown: Self = Self(0);
31    #[doc(alias = "AVPlayerStatusReadyToPlay")]
32    pub const ReadyToPlay: Self = Self(1);
33    #[doc(alias = "AVPlayerStatusFailed")]
34    pub const Failed: Self = Self(2);
35}
36
37unsafe impl Encode for AVPlayerStatus {
38    const ENCODING: Encoding = NSInteger::ENCODING;
39}
40
41unsafe impl RefEncode for AVPlayerStatus {
42    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
43}
44
45extern_class!(
46    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avplayer?language=objc)
47    #[unsafe(super(NSObject))]
48    #[thread_kind = MainThreadOnly]
49    #[derive(Debug, PartialEq, Eq, Hash)]
50    pub struct AVPlayer;
51);
52
53unsafe impl NSObjectProtocol for AVPlayer {}
54
55impl AVPlayer {
56    extern_methods!(
57        /// Initializes an AVPlayer with no player items.
58        #[unsafe(method(init))]
59        #[unsafe(method_family = init)]
60        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
61
62        /// Returns an instance of AVPlayer that plays a single audiovisual resource referenced by URL.
63        ///
64        /// Parameter `URL`:
65        /// Returns: An instance of AVPlayer
66        ///
67        /// Implicitly creates an AVPlayerItem. Clients can obtain the AVPlayerItem as it becomes the player's currentItem.
68        #[unsafe(method(playerWithURL:))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn playerWithURL(url: &NSURL, mtm: MainThreadMarker) -> Retained<Self>;
71
72        #[cfg(feature = "AVPlayerItem")]
73        /// Create an AVPlayer that plays a single audiovisual item.
74        ///
75        /// Parameter `item`:
76        /// Returns: An instance of AVPlayer
77        ///
78        /// Useful in order to play items for which an AVAsset has previously been created. See -[AVPlayerItem initWithAsset:].
79        #[unsafe(method(playerWithPlayerItem:))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn playerWithPlayerItem(
82            item: Option<&AVPlayerItem>,
83            mtm: MainThreadMarker,
84        ) -> Retained<Self>;
85
86        /// Initializes an AVPlayer that plays a single audiovisual resource referenced by URL.
87        ///
88        /// Parameter `URL`:
89        /// Returns: An instance of AVPlayer
90        ///
91        /// Implicitly creates an AVPlayerItem. Clients can obtain the AVPlayerItem as it becomes the player's currentItem.
92        #[unsafe(method(initWithURL:))]
93        #[unsafe(method_family = init)]
94        pub unsafe fn initWithURL(this: Allocated<Self>, url: &NSURL) -> Retained<Self>;
95
96        #[cfg(feature = "AVPlayerItem")]
97        /// Create an AVPlayer that plays a single audiovisual item.
98        ///
99        /// Parameter `item`:
100        /// Returns: An instance of AVPlayer
101        ///
102        /// Useful in order to play items for which an AVAsset has previously been created. See -[AVPlayerItem initWithAsset:].
103        /// This method throws an exception if the item is not an AVPlayerItem, or if the item is
104        /// associated with another AVPlayer.
105        #[unsafe(method(initWithPlayerItem:))]
106        #[unsafe(method_family = init)]
107        pub unsafe fn initWithPlayerItem(
108            this: Allocated<Self>,
109            item: Option<&AVPlayerItem>,
110        ) -> Retained<Self>;
111
112        /// The ability of the receiver to be used for playback.
113        ///
114        ///
115        /// The value of this property is an AVPlayerStatus that indicates whether the receiver can be used for playback. When
116        /// the value of this property is AVPlayerStatusFailed, the receiver can no longer be used for playback and a new
117        /// instance needs to be created in its place. When this happens, clients can check the value of the error property to
118        /// determine the nature of the failure. This property is key value observable.
119        #[unsafe(method(status))]
120        #[unsafe(method_family = none)]
121        pub unsafe fn status(&self) -> AVPlayerStatus;
122
123        /// If the receiver's status is AVPlayerStatusFailed, this describes the error that caused the failure.
124        ///
125        ///
126        /// The value of this property is an NSError that describes what caused the receiver to no longer be able to play items.
127        /// If the receiver's status is not AVPlayerStatusFailed, the value of this property is nil.
128        #[unsafe(method(error))]
129        #[unsafe(method_family = none)]
130        pub unsafe fn error(&self) -> Option<Retained<NSError>>;
131    );
132}
133
134/// Methods declared on superclass `NSObject`.
135impl AVPlayer {
136    extern_methods!(
137        #[unsafe(method(new))]
138        #[unsafe(method_family = new)]
139        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
140    );
141}
142
143extern "C" {
144    /// Indicates a player rate change.
145    ///
146    /// Posted by the player when its rate changes. Similar to KVO of AVPlayer.rate, but providing additional information about the rate change in the userInfo. See keys below.
147    ///
148    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avplayerratedidchangenotification?language=objc)
149    pub static AVPlayerRateDidChangeNotification: &'static NSNotificationName;
150}
151
152extern "C" {
153    /// Indicates a reason for the rate change notification.
154    ///
155    /// The value corresponding to this key is of type AVPlayerRateDidChangeReason.
156    ///
157    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avplayerratedidchangereasonkey?language=objc)
158    pub static AVPlayerRateDidChangeReasonKey: &'static NSString;
159}
160
161extern "C" {
162    /// Indicates a rate change was caused by another participant connected through AVPlayerPlaybackCoordinator.
163    ///
164    /// Informs the receiver of an AVPlayerRateDidChangeNotification about a rate change originated from another AVCoordinatedPlaybackParticipant connected through AVPlayerPlaybackCoordinator. This can be used to inform UI showing why the playback rate changed. The type of the value for this key is an AVCoordinatedPlaybackParticipant, which is part of the AVPlayerPlaybackCoordinator.otherParticipants array.
165    ///
166    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avplayerratedidchangeoriginatingparticipantkey?language=objc)
167    pub static AVPlayerRateDidChangeOriginatingParticipantKey: &'static NSString;
168}
169
170/// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avplayerratedidchangereason?language=objc)
171// NS_TYPED_ENUM
172pub type AVPlayerRateDidChangeReason = NSString;
173
174extern "C" {
175    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avplayerratedidchangereasonsetratecalled?language=objc)
176    pub static AVPlayerRateDidChangeReasonSetRateCalled: &'static AVPlayerRateDidChangeReason;
177}
178
179extern "C" {
180    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avplayerratedidchangereasonsetratefailed?language=objc)
181    pub static AVPlayerRateDidChangeReasonSetRateFailed: &'static AVPlayerRateDidChangeReason;
182}
183
184extern "C" {
185    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avplayerratedidchangereasonaudiosessioninterrupted?language=objc)
186    pub static AVPlayerRateDidChangeReasonAudioSessionInterrupted:
187        &'static AVPlayerRateDidChangeReason;
188}
189
190extern "C" {
191    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avplayerratedidchangereasonappbackgrounded?language=objc)
192    pub static AVPlayerRateDidChangeReasonAppBackgrounded: &'static AVPlayerRateDidChangeReason;
193}
194
195/// These constants are the allowable values of AVPlayer's timeControlStatus property. This discussion pertains when automaticallyWaitsToMinimizeStalling is YES, the default setting, and exceptions are discussed in connection with automaticallyWaitsToMinimizeStalling.
196///
197///
198/// This state is entered upon receipt of a -pause message, an invocation of -setRate: with a value of 0.0, when a change in overall state requires playback to be halted, such as when an interruption occurs on iOS, as announced by AVAudioSession.
199/// In this state, playback is paused indefinitely and will not resume until 1) a subsequent -play message is received or 2) a -setRate: or -playImmediatelyAtRate: message with a non-zero value for rate is received and sufficient media data has been buffered for playback to proceed.
200///
201/// This state is entered when 1) the playback buffer becomes empty and playback stalls in AVPlayerTimeControlStatusPlaying, 2) when rate is set from zero to non-zero in AVPlayerTimeControlStatusPaused and insufficient media data has been buffered for playback to occur, or 3) when the player has no item to play, i.e. when the receiver's currentItem is nil.
202/// In this state, the value of the rate property is not currently effective but instead indicates the rate at which playback will start or resume. Refer to the value of reasonForWaitingToPlay for details about why the receiver is waiting and the conditions that allow waitStatus to change to AVPlayerWaitStatusPlaying.
203/// While waiting for buffering, you can attempt to start playback of any available media data via -playImmediatelyAtRate:.
204///
205/// In this state, playback is currently progressing and rate changes will take effect immediately. Should playback stall because of insufficient media data, timeControlStatus will change to AVPlayerTimeControlStatusWaitingToPlayAtSpecifiedRate.
206///
207/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avplayertimecontrolstatus?language=objc)
208// NS_ENUM
209#[repr(transparent)]
210#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
211pub struct AVPlayerTimeControlStatus(pub NSInteger);
212impl AVPlayerTimeControlStatus {
213    #[doc(alias = "AVPlayerTimeControlStatusPaused")]
214    pub const Paused: Self = Self(0);
215    #[doc(alias = "AVPlayerTimeControlStatusWaitingToPlayAtSpecifiedRate")]
216    pub const WaitingToPlayAtSpecifiedRate: Self = Self(1);
217    #[doc(alias = "AVPlayerTimeControlStatusPlaying")]
218    pub const Playing: Self = Self(2);
219}
220
221unsafe impl Encode for AVPlayerTimeControlStatus {
222    const ENCODING: Encoding = NSInteger::ENCODING;
223}
224
225unsafe impl RefEncode for AVPlayerTimeControlStatus {
226    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
227}
228
229/// The type of reason that a player is waiting for playback.
230///
231/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avplayerwaitingreason?language=objc)
232// NS_TYPED_ENUM
233pub type AVPlayerWaitingReason = NSString;
234
235extern "C" {
236    /// Indicates that the player is waiting for appropriate playback buffer conditions before starting playback
237    ///
238    /// The player is waiting for playback because automaticallyWaitToMinimizeStalling is YES and playback at the specified rate would likely cause the playback buffer to become empty before playback completes. Playback will resume when 1) playback at the specified rate will likely complete without a stall or 2) the playback buffer becomes full, meaning no forther buffering of media data is possible.
239    /// When the value of automaticallyWaitsToMinimizeStalling is NO, timeControlStatus cannot become AVPlayerTimeControlStatusWaitingToPlayAtSpecifiedRate for this reason.
240    ///
241    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avplayerwaitingtominimizestallsreason?language=objc)
242    pub static AVPlayerWaitingToMinimizeStallsReason: &'static AVPlayerWaitingReason;
243}
244
245extern "C" {
246    /// Indicates that the player is monitoring the playback buffer fill rate to determine if playback is likely to complete without interruptions.
247    ///
248    /// The player is waiting for playback because automaticallyWaitToMinimizeStalling is YES and it has not yet determined if starting playback at the specified rate would likely cause the buffer to become empty. When the brief initial monitoring period is over, either playback will begin or the value of reasonForWaitingToPlayAtSpecifiedRate will switch to AVPlayerWaitingToMinimizeStallsReason.
249    /// Recommended practice is not to show UI indicating the waiting state to the user while the value of reasonForWaitingToPlayAtSpecifiedRate is AVPlayerWaitingWhileEvaluatingBufferingRateReason.
250    ///
251    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avplayerwaitingwhileevaluatingbufferingratereason?language=objc)
252    pub static AVPlayerWaitingWhileEvaluatingBufferingRateReason: &'static AVPlayerWaitingReason;
253}
254
255extern "C" {
256    /// Indicates that the AVPlayer is waiting because its currentItem is nil
257    ///
258    /// The player is waiting for playback because automaticallyWaitToMinimizeStalling is YES and the value of currentItem is nil. When an item becomes available, either because of a call to -replaceCurrentItemWithPlayerItem: or  -insertItem: afterItem:, playback will begin or the value of reasonForWaitingToPlay will change.
259    ///
260    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avplayerwaitingwithnoitemtoplayreason?language=objc)
261    pub static AVPlayerWaitingWithNoItemToPlayReason: &'static AVPlayerWaitingReason;
262}
263
264extern "C" {
265    /// Indicates that the player is waiting for another participant connected through its AVPlayerPlaybackCoordinator.
266    ///
267    /// The player is waiting for playback because its connected AVPlayerPlaybackCoordinator requires information from one of the other participants before playback can start.
268    ///
269    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avplayerwaitingforcoordinatedplaybackreason?language=objc)
270    pub static AVPlayerWaitingForCoordinatedPlaybackReason: &'static AVPlayerWaitingReason;
271}
272
273/// AVPlayerPlaybackControl.
274impl AVPlayer {
275    extern_methods!(
276        /// Indicates the desired rate of playback; 0.0 means "paused", 1.0 indicates a desire to play at the natural rate of the current item.
277        ///
278        /// Setting the value of rate to 0.0 pauses playback, causing the value of timeControlStatus to change to AVPlayerTimeControlStatusPaused.
279        /// Setting the rate to a non-zero value causes the value of timeControlStatus to become either AVPlayerTimeControlStatusWaitingToPlayAtSpecifiedRate or AVPlayerTimeControlStatusPlaying, depending on whether sufficient media data has been buffered for playback to occur and whether the player's default behavior of waiting in order to minimize stalling is permitted. See discussion of AVPlayerTimeControlStatus for more details.
280        ///
281        /// AVPlayer can reset the desired rate to 0.0 when a change in overall state requires playback to be halted, such as when an interruption occurs on iOS, as announced by AVAudioSession, or when the playback buffer becomes empty and playback stalls while automaticallyWaitsToMinimizeStalling is NO.
282        ///
283        /// The effective rate of playback may differ from the desired rate even while timeControlStatus is AVPlayerTimeControlStatusPlaying, if the processing algorithm in use for managing audio pitch requires quantization of playback rate. For information about quantization of rates for audio processing, see AVAudioProcessingSettings.h. You can always obtain the effective rate of playback from the currentItem's timebase; see the timebase property of AVPlayerItem.
284        ///
285        /// Before macOS 13, iOS 16, tvOS 16, and watchOS 9, this property must be accessed on the main thread/queue.
286        #[unsafe(method(rate))]
287        #[unsafe(method_family = none)]
288        pub unsafe fn rate(&self) -> c_float;
289
290        /// Setter for [`rate`][Self::rate].
291        #[unsafe(method(setRate:))]
292        #[unsafe(method_family = none)]
293        pub unsafe fn setRate(&self, rate: c_float);
294
295        /// Indicates the rate at which to start playback when play is called; defaults to 1.0.
296        ///
297        /// Setting this property does not imply playback starts automatically at this rate. Clients still have to kick off playback using `play`. Note that using setRate to start playback will skip using the value in this property nor would it update this property. Therefore, `setRate:1.0` is no longer recommended as a means to start playback. Use `play` instead. Use `setRate` for operations like scanning where the rate is to be updated instantaneously. Invoking `play` again would restore playback at the rate set in this property.
298        ///
299        /// The effective rate of playback may still differ from the default rate subject to restrictions imposed by the system. See documentation for the rate property for a discussion on when the desired rate does not translate to effective rate.
300        #[unsafe(method(defaultRate))]
301        #[unsafe(method_family = none)]
302        pub unsafe fn defaultRate(&self) -> c_float;
303
304        /// Setter for [`defaultRate`][Self::defaultRate].
305        #[unsafe(method(setDefaultRate:))]
306        #[unsafe(method_family = none)]
307        pub unsafe fn setDefaultRate(&self, default_rate: c_float);
308
309        /// Signals the desire to begin playback at the rate set in the defaultRate.
310        ///
311        /// For releases up to iOS version 16.0, macOS versions 13.0, tvOS 16.0 and watchOS 9.0, this is equivalent to setting the value of rate to `1.0`. Starting from iOS version 16.0, macOS versions 13.0, tvOS 16.0 and watchOS 9.0, this will attempt to use the rate set in the `defaultRate` property. The effective rate of playback may differ from the `defaultRate` due to the reasons mentioned in the documentation of the `rate` property. Clients interested in knowing the effective rate can listen for `AVPlayerRateDidChangeNotification` notification.
312        ///
313        /// Before macOS 13, iOS 16, tvOS 16, and watchOS 9, this method must be invoked on the main thread/queue.
314        #[unsafe(method(play))]
315        #[unsafe(method_family = none)]
316        pub unsafe fn play(&self);
317
318        /// Pauses playback.
319        ///
320        /// Equivalent to setting the value of rate to 0.0.
321        ///
322        /// Before macOS 13, iOS 16, tvOS 16, and watchOS 9, this method must be invoked on the main thread/queue.
323        #[unsafe(method(pause))]
324        #[unsafe(method_family = none)]
325        pub unsafe fn pause(&self);
326
327        /// Indicates whether playback is currently paused indefinitely, suspended while waiting for appropriate conditions, or in progress.
328        ///
329        /// For possible values and discussion, see AVPlayerTimeControlStatus.
330        ///
331        /// When automaticallyWaitsToMinimizeStalling is YES, absent intervention in the form of invocations of -setRate: or -pause or, on iOS, an interruption that requires user intervention before playback can resume, the value of the property timeControlStatus automatically changes between AVPlayerTimeControlStatusPlaying and AVPlayerTimeControlStatusWaitingToPlayAtSpecifiedRate depending on whether sufficient media data is available to continue playback. This property is key value observable.
332        #[unsafe(method(timeControlStatus))]
333        #[unsafe(method_family = none)]
334        pub unsafe fn timeControlStatus(&self) -> AVPlayerTimeControlStatus;
335
336        /// Indicates the reason for waiting when the value of timeControlStatus is AVPlayerTimeControlStatusWaitingToPlayAtSpecifiedRate
337        ///
338        /// When the value of timeControlStatus is AVPlayerTimeControlStatusWaitingToPlayAtSpecifiedRate, this property describes why the player is currently waiting. It is nil otherwise.
339        /// You can use the value of reasonForWaitingToPlay to show UI indicating the player's waiting state conditionally.
340        /// This property is key value observable.
341        /// Possible values are AVPlayerWaitingWithNoItemToPlayReason, AVPlayerWaitingWhileEvaluatingBufferingRateReason, and AVPlayerWaitingToMinimizeStallsReason.
342        #[unsafe(method(reasonForWaitingToPlay))]
343        #[unsafe(method_family = none)]
344        pub unsafe fn reasonForWaitingToPlay(&self) -> Option<Retained<AVPlayerWaitingReason>>;
345
346        /// Immediately plays the available media data at the specified rate.
347        ///
348        /// When the player's currentItem has a value of NO for playbackBufferEmpty, this method causes the value of rate to change to the specified rate, the value of timeControlStatus to change to AVPlayerTimeControlStatusPlaying, and the receiver to play the available media immediately, whether or not prior buffering of media data is sufficient to ensure smooth playback.
349        /// If insufficient media data is buffered for playback to start (e.g. if the current item has a value of YES for playbackBufferEmpty), the receiver will act as if the buffer became empty during playback, except that no AVPlayerItemPlaybackStalledNotification will be posted.
350        ///
351        /// Before macOS 13, iOS 16, tvOS 16, and watchOS 9, this method must be invoked on the main thread/queue.
352        #[unsafe(method(playImmediatelyAtRate:))]
353        #[unsafe(method_family = none)]
354        pub unsafe fn playImmediatelyAtRate(&self, rate: c_float);
355    );
356}
357
358/// These constants are the allowable values of AVPlayer's actionAtItemEnd property.
359///
360///
361/// Indicates that when an AVPlayerItem reaches its end time the player will automatically advance to the next item in its queue.
362/// This value is supported only for players of class AVQueuePlayer. An AVPlayer that's not an AVQueuePlayer will raise an NSInvalidArgumentException if an attempt is made to set its actionAtItemEnd to AVPlayerActionAtItemEndAdvance.
363///
364/// Indicates that when an AVPlayerItem reaches its end time the player will automatically pause (which is to say, the player's
365/// rate will automatically be set to 0).
366///
367/// Indicates that when an AVPlayerItem reaches its end time the player will take no action (which is to say, the player's rate
368/// will not change, its currentItem will not change, and its currentTime will continue to be incremented or decremented as time
369/// elapses, according to its rate). After this, if the player's actionAtItemEnd is set to a value other than AVPlayerActionAtItemEndNone,
370/// the player will immediately take the action appropriate to that value.
371///
372/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avplayeractionatitemend?language=objc)
373// NS_ENUM
374#[repr(transparent)]
375#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
376pub struct AVPlayerActionAtItemEnd(pub NSInteger);
377impl AVPlayerActionAtItemEnd {
378    #[doc(alias = "AVPlayerActionAtItemEndAdvance")]
379    pub const Advance: Self = Self(0);
380    #[doc(alias = "AVPlayerActionAtItemEndPause")]
381    pub const Pause: Self = Self(1);
382    #[doc(alias = "AVPlayerActionAtItemEndNone")]
383    pub const None: Self = Self(2);
384}
385
386unsafe impl Encode for AVPlayerActionAtItemEnd {
387    const ENCODING: Encoding = NSInteger::ENCODING;
388}
389
390unsafe impl RefEncode for AVPlayerActionAtItemEnd {
391    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
392}
393
394/// AVPlayerItemControl.
395impl AVPlayer {
396    extern_methods!(
397        #[cfg(feature = "AVPlayerItem")]
398        #[unsafe(method(currentItem))]
399        #[unsafe(method_family = none)]
400        pub unsafe fn currentItem(&self) -> Option<Retained<AVPlayerItem>>;
401
402        #[cfg(feature = "AVPlayerItem")]
403        /// Replaces the player's current item with the specified player item.
404        ///
405        /// Parameter `item`: The AVPlayerItem that will become the player's current item.
406        ///
407        /// In all releases of iOS 4, invoking replaceCurrentItemWithPlayerItem: with an AVPlayerItem that's already the receiver's currentItem results in an exception being raised. Starting with iOS 5, it's a no-op.
408        /// This method throws an exception if the item already exists in the play queue.
409        #[unsafe(method(replaceCurrentItemWithPlayerItem:))]
410        #[unsafe(method_family = none)]
411        pub unsafe fn replaceCurrentItemWithPlayerItem(&self, item: Option<&AVPlayerItem>);
412
413        /// Indicates the action that the player should perform when playback of an item reaches its end time.
414        ///
415        /// This property throws an exception if set to AVPlayerActionAtItemEndAdvance on an AVPlayer which is not an AVQueuePlayer.
416        #[unsafe(method(actionAtItemEnd))]
417        #[unsafe(method_family = none)]
418        pub unsafe fn actionAtItemEnd(&self) -> AVPlayerActionAtItemEnd;
419
420        /// Setter for [`actionAtItemEnd`][Self::actionAtItemEnd].
421        #[unsafe(method(setActionAtItemEnd:))]
422        #[unsafe(method_family = none)]
423        pub unsafe fn setActionAtItemEnd(&self, action_at_item_end: AVPlayerActionAtItemEnd);
424    );
425}
426
427/// AVPlayerTimeControl.
428impl AVPlayer {
429    extern_methods!(
430        #[cfg(feature = "objc2-core-media")]
431        /// Returns the current time of the current item.
432        ///
433        /// Returns: A CMTime
434        ///
435        /// Returns the current time of the current item. Not key-value observable; use -addPeriodicTimeObserverForInterval:queue:usingBlock: instead.
436        #[unsafe(method(currentTime))]
437        #[unsafe(method_family = none)]
438        pub unsafe fn currentTime(&self) -> CMTime;
439
440        /// Moves the playback cursor.
441        ///
442        /// Parameter `date`:
443        /// Use this method to seek to a specified time for the current player item.
444        /// The time seeked to may differ from the specified time for efficiency. For sample accurate seeking see seekToTime:toleranceBefore:toleranceAfter:.
445        #[unsafe(method(seekToDate:))]
446        #[unsafe(method_family = none)]
447        pub unsafe fn seekToDate(&self, date: &NSDate);
448
449        #[cfg(feature = "block2")]
450        /// Moves the playback cursor and invokes the specified block when the seek operation has either been completed or been interrupted.
451        ///
452        /// Parameter `date`:
453        /// Parameter `completionHandler`:
454        /// Use this method to seek to a specified time for the current player item and to be notified when the seek operation is complete.
455        /// The completion handler for any prior seek request that is still in process will be invoked immediately with the finished parameter
456        /// set to NO. If the new request completes without being interrupted by another seek request or by any other operation the specified
457        /// completion handler will be invoked with the finished parameter set to YES.  If no item is attached, the completion handler will be
458        /// invoked immediately with the finished parameter set to NO.
459        #[unsafe(method(seekToDate:completionHandler:))]
460        #[unsafe(method_family = none)]
461        pub unsafe fn seekToDate_completionHandler(
462            &self,
463            date: &NSDate,
464            completion_handler: &block2::Block<dyn Fn(Bool)>,
465        );
466
467        #[cfg(feature = "objc2-core-media")]
468        /// Moves the playback cursor.
469        ///
470        /// Parameter `time`:
471        /// Use this method to seek to a specified time for the current player item.
472        /// The time seeked to may differ from the specified time for efficiency. For sample accurate seeking see seekToTime:toleranceBefore:toleranceAfter:.
473        #[unsafe(method(seekToTime:))]
474        #[unsafe(method_family = none)]
475        pub unsafe fn seekToTime(&self, time: CMTime);
476
477        #[cfg(feature = "objc2-core-media")]
478        /// Moves the playback cursor within a specified time bound.
479        ///
480        /// Parameter `time`:
481        /// Parameter `toleranceBefore`:
482        /// Parameter `toleranceAfter`:
483        /// Use this method to seek to a specified time for the current player item.
484        /// The time seeked to will be within the range [time-toleranceBefore, time+toleranceAfter] and may differ from the specified time for efficiency.
485        /// Pass kCMTimeZero for both toleranceBefore and toleranceAfter to request sample accurate seeking which may incur additional decoding delay.
486        /// Messaging this method with beforeTolerance:kCMTimePositiveInfinity and afterTolerance:kCMTimePositiveInfinity is the same as messaging seekToTime: directly.
487        #[unsafe(method(seekToTime:toleranceBefore:toleranceAfter:))]
488        #[unsafe(method_family = none)]
489        pub unsafe fn seekToTime_toleranceBefore_toleranceAfter(
490            &self,
491            time: CMTime,
492            tolerance_before: CMTime,
493            tolerance_after: CMTime,
494        );
495
496        #[cfg(all(feature = "block2", feature = "objc2-core-media"))]
497        /// Moves the playback cursor and invokes the specified block when the seek operation has either been completed or been interrupted.
498        ///
499        /// Parameter `time`:
500        /// Parameter `completionHandler`:
501        /// Use this method to seek to a specified time for the current player item and to be notified when the seek operation is complete.
502        /// The completion handler for any prior seek request that is still in process will be invoked immediately with the finished parameter
503        /// set to NO. If the new request completes without being interrupted by another seek request or by any other operation the specified
504        /// completion handler will be invoked with the finished parameter set to YES.  If no item is attached, the completion handler will be
505        /// invoked immediately with the finished parameter set to NO.
506        #[unsafe(method(seekToTime:completionHandler:))]
507        #[unsafe(method_family = none)]
508        pub unsafe fn seekToTime_completionHandler(
509            &self,
510            time: CMTime,
511            completion_handler: &block2::Block<dyn Fn(Bool)>,
512        );
513
514        #[cfg(all(feature = "block2", feature = "objc2-core-media"))]
515        /// Moves the playback cursor within a specified time bound and invokes the specified block when the seek operation has either been completed or been interrupted.
516        ///
517        /// Parameter `time`:
518        /// Parameter `toleranceBefore`:
519        /// Parameter `toleranceAfter`:
520        /// Use this method to seek to a specified time for the current player item and to be notified when the seek operation is complete.
521        /// The time seeked to will be within the range [time-toleranceBefore, time+toleranceAfter] and may differ from the specified time for efficiency.
522        /// Pass kCMTimeZero for both toleranceBefore and toleranceAfter to request sample accurate seeking which may incur additional decoding delay.
523        /// Messaging this method with beforeTolerance:kCMTimePositiveInfinity and afterTolerance:kCMTimePositiveInfinity is the same as messaging seekToTime: directly.
524        /// The completion handler for any prior seek request that is still in process will be invoked immediately with the finished parameter set to NO. If the new
525        /// request completes without being interrupted by another seek request or by any other operation the specified completion handler will be invoked with the
526        /// finished parameter set to YES.  If no item is attached, the completion handler will be invoked immediately with the finished parameter set to NO.
527        #[unsafe(method(seekToTime:toleranceBefore:toleranceAfter:completionHandler:))]
528        #[unsafe(method_family = none)]
529        pub unsafe fn seekToTime_toleranceBefore_toleranceAfter_completionHandler(
530            &self,
531            time: CMTime,
532            tolerance_before: CMTime,
533            tolerance_after: CMTime,
534            completion_handler: &block2::Block<dyn Fn(Bool)>,
535        );
536    );
537}
538
539/// AVPlayerAdvancedRateControl.
540impl AVPlayer {
541    extern_methods!(
542        /// Indicates that the player is allowed to delay playback at the specified rate in order to minimize stalling
543        ///
544        ///
545        /// When this property is YES, whenever 1) the rate is set from zero to non-zero or 2) the playback buffer becomes empty and playback stalls, the player will attempt to determine if, at the specified rate, its currentItem will play to the end without interruptions. Should it determine that such interruptions would occur and these interruptions can be avoided by delaying the start or resumption of playback, the value of timeControlStatus will become AVPlayerTimeControlStatusWaitingToPlayAtSpecifiedRate and playback will start automatically when the likelihood of stalling has been minimized.
546        ///
547        /// You may want to set this property to NO when you need precise control over playback start times, e.g., when synchronizing multiple instances of AVPlayer, and you should set it to NO if you use an AVAssetResourceLoader delegate to load media data (more on this below). If the value of this property is NO, reasonForWaitingToPlay cannot assume a value of AVPlayerWaitingToMinimizeStallsReason.
548        /// This implies that setting rate to a non-zero value in AVPlayerTimeControlStatusPaused will cause playback to start immediately as long as the playback buffer is not empty. When the playback buffer becomes empty during AVPlayerTimeControlStatusPlaying and playback stalls, playback state will switch to AVPlayerTimeControlStatusPaused and the rate will become 0.0.
549        ///
550        /// Changing the value of this property to NO while the value of timeControlStatus is AVPlayerTimeControlStatusWaitingToPlayAtSpecifiedRate with a reasonForWaitingToPlay of AVPlayerWaitingToMinimizeStallsReason will cause the player to attempt playback at the specified rate immediately.
551        ///
552        /// For clients linked against iOS 10.0 and running on that version or later or linked against macOS 10.12 and running on that version or later, the default value of this property is YES.
553        /// In versions of iOS prior to iOS 10.0 and versions of macOS prior to 10.12, this property is unavailable, and the behavior of the AVPlayer corresponds to the type of content being played. For streaming content, including HTTP Live Streaming, the AVPlayer acts as if automaticallyWaitsToMinimizeStalling is YES. For file-based content, including file-based content accessed via progressive http download, the AVPlayer acts as if automaticallyWaitsToMinimizeStalling is NO.
554        ///
555        /// If you employ an AVAssetResourceLoader delegate that loads media data for playback, you should set the value of your AVPlayer’s automaticallyWaitsToMinimizeStalling property to NO. Allowing the value of automaticallyWaitsToMinimizeStalling to remain YES when an AVAssetResourceLoader delegate is used for the loading of media data can result in poor start-up times for playback and poor recovery from stalls, because the behaviors provided by AVPlayer when automaticallyWaitsToMinimizeStalling has a value of YES depend on predictions of the future availability of media data that that do not function as expected when data is loaded via a client-controlled means, using the AVAssetResourceLoader delegate interface.
556        ///
557        /// You can allow the value of automaticallyWaitsToMinimizeStalling to remain YES if you use an AVAssetResourceLoader delegate to manage content keys for FairPlay Streaming, to provide dynamically-generated master playlists for HTTP Live Streaming, or to respond to authentication challenges, but not to load media data for playback.
558        ///
559        /// Before macOS 13, iOS 16, tvOS 16, and watchOS 9, this property must be accessed on the main thread/queue.
560        #[unsafe(method(automaticallyWaitsToMinimizeStalling))]
561        #[unsafe(method_family = none)]
562        pub unsafe fn automaticallyWaitsToMinimizeStalling(&self) -> bool;
563
564        /// Setter for [`automaticallyWaitsToMinimizeStalling`][Self::automaticallyWaitsToMinimizeStalling].
565        #[unsafe(method(setAutomaticallyWaitsToMinimizeStalling:))]
566        #[unsafe(method_family = none)]
567        pub unsafe fn setAutomaticallyWaitsToMinimizeStalling(
568            &self,
569            automatically_waits_to_minimize_stalling: bool,
570        );
571
572        #[cfg(feature = "objc2-core-media")]
573        /// Simultaneously sets the playback rate and the relationship between the current item's current time and host time.
574        ///
575        /// You can use this function to synchronize playback with an external activity.
576        ///
577        /// The current item's timebase is adjusted so that its time will be (or was) itemTime when host time is (or was) hostClockTime.
578        /// In other words: if hostClockTime is in the past, the timebase's time will be interpolated as though the timebase has been running at the requested rate since that time.  If hostClockTime is in the future, the timebase will immediately start running at the requested rate from an earlier time so that it will reach the requested itemTime at the requested hostClockTime.  (Note that the item's time will not jump backwards, but instead will sit at itemTime until the timebase reaches that time.)
579        ///
580        /// Note that setRate:time:atHostTime: is not supported when automaticallyWaitsToMinimizeStalling is YES. For clients linked against iOS 10.0 and later or macOS 12.0 and later, invoking setRate:time:atHostTime: when automaticallyWaitsToMinimizeStalling is YES will raise an NSInvalidArgument exception. Support for HTTP Live Streaming content requires iOS 11, tvOS 11, macOS 10.13 or later.
581        ///
582        /// Before macOS 13, iOS 16, tvOS 16, and watchOS 9, this method must be invoked on the main thread/queue.
583        ///
584        ///
585        /// Parameter `itemTime`: The time to start playback from, specified precisely (i.e., with zero tolerance).
586        /// Pass kCMTimeInvalid to use the current item's current time.
587        ///
588        /// Parameter `hostClockTime`: The host time at which to start playback.
589        /// If hostClockTime is specified, the player will not ensure that media data is loaded before the timebase starts moving.
590        /// If hostClockTime is kCMTimeInvalid, the rate and time will be set together, but without external synchronization;
591        /// a host time in the near future will be used, allowing some time for media data loading.
592        #[unsafe(method(setRate:time:atHostTime:))]
593        #[unsafe(method_family = none)]
594        pub unsafe fn setRate_time_atHostTime(
595            &self,
596            rate: c_float,
597            item_time: CMTime,
598            host_clock_time: CMTime,
599        );
600
601        #[cfg(feature = "block2")]
602        /// Begins loading media data to prime the render pipelines for playback from the current time with the given rate.
603        ///
604        /// Once the completion handler is called with YES, the player's rate can be set with minimal latency.
605        /// The completion handler will be called with NO if the preroll is interrupted by a time change or incompatible rate change, or if preroll is not possible for some other reason.
606        /// Call this method only when the rate is currently zero and only after the AVPlayer's status has become AVPlayerStatusReadyToPlay.
607        /// This method throws an exception if the status is not AVPlayerStatusReadyToPlay.
608        ///
609        /// Parameter `rate`: The intended rate for subsequent playback.
610        ///
611        /// Parameter `completionHandler`: The block that will be called when the preroll is either completed or is interrupted.
612        #[unsafe(method(prerollAtRate:completionHandler:))]
613        #[unsafe(method_family = none)]
614        pub unsafe fn prerollAtRate_completionHandler(
615            &self,
616            rate: c_float,
617            completion_handler: Option<&block2::Block<dyn Fn(Bool)>>,
618        );
619
620        /// Cancel any pending preroll requests and invoke the corresponding completion handlers if present.
621        ///
622        /// Use this method to cancel and release the completion handlers for pending prerolls. The finished parameter of the completion handlers will be set to NO.
623        #[unsafe(method(cancelPendingPrerolls))]
624        #[unsafe(method_family = none)]
625        pub unsafe fn cancelPendingPrerolls(&self);
626
627        #[cfg(feature = "objc2-core-media")]
628        /// Set to override the automatic choice of source clock for item timebases.
629        ///
630        /// NULL by default. This is most useful for synchronizing video-only movies with audio played via other means. IMPORTANT NOTE: If you specify a source clock other than the appropriate audio device clock, audio may drift out of sync.
631        #[unsafe(method(sourceClock))]
632        #[unsafe(method_family = none)]
633        pub unsafe fn sourceClock(&self) -> Option<Retained<CMClock>>;
634
635        #[cfg(feature = "objc2-core-media")]
636        /// Setter for [`sourceClock`][Self::sourceClock].
637        #[unsafe(method(setSourceClock:))]
638        #[unsafe(method_family = none)]
639        pub unsafe fn setSourceClock(&self, source_clock: Option<&CMClock>);
640    );
641}
642
643/// AVPlayerTimeObservation.
644impl AVPlayer {
645    extern_methods!(
646        /// Cancels a previously registered time observer.
647        ///
648        /// Parameter `observer`: An object returned by a previous call to -addPeriodicTimeObserverForInterval:queue:usingBlock: or -addBoundaryTimeObserverForTimes:queue:usingBlock:.
649        ///
650        /// Upon return, the caller is guaranteed that no new time observer blocks will begin executing.  Depending on the calling thread and the queue
651        /// used to add the time observer, an in-flight block may continue to execute after this method returns.  You can guarantee synchronous time
652        /// observer removal by enqueuing the call to -removeTimeObserver: on that queue.  Alternatively, call dispatch_sync(queue, ^{}) after
653        /// -removeTimeObserver: to wait for any in-flight blocks to finish executing.
654        /// -removeTimeObserver: should be used to explicitly cancel each time observer added using -addPeriodicTimeObserverForInterval:queue:usingBlock:
655        /// and -addBoundaryTimeObserverForTimes:queue:usingBlock:.
656        ///
657        /// This method throws an exception for any of the following reasons:
658        /// - observer was added by a different instance of AVPlayer
659        /// - observer was not returned by -addPeriodicTimeObserverForInterval:queue:usingBlock:
660        /// - observer was not returned by -addBoundaryTimeObserverForTimes:queue:usingBlock:
661        #[unsafe(method(removeTimeObserver:))]
662        #[unsafe(method_family = none)]
663        pub unsafe fn removeTimeObserver(&self, observer: &AnyObject);
664    );
665}
666
667/// AVPlayerMediaControl.
668impl AVPlayer {
669    extern_methods!(
670        #[unsafe(method(volume))]
671        #[unsafe(method_family = none)]
672        pub unsafe fn volume(&self) -> c_float;
673
674        /// Setter for [`volume`][Self::volume].
675        #[unsafe(method(setVolume:))]
676        #[unsafe(method_family = none)]
677        pub unsafe fn setVolume(&self, volume: c_float);
678
679        #[unsafe(method(isMuted))]
680        #[unsafe(method_family = none)]
681        pub unsafe fn isMuted(&self) -> bool;
682
683        /// Setter for [`isMuted`][Self::isMuted].
684        #[unsafe(method(setMuted:))]
685        #[unsafe(method_family = none)]
686        pub unsafe fn setMuted(&self, muted: bool);
687    );
688}
689
690/// AVPlayerAutomaticMediaSelection.
691impl AVPlayer {
692    extern_methods!(
693        #[unsafe(method(appliesMediaSelectionCriteriaAutomatically))]
694        #[unsafe(method_family = none)]
695        pub unsafe fn appliesMediaSelectionCriteriaAutomatically(&self) -> bool;
696
697        /// Setter for [`appliesMediaSelectionCriteriaAutomatically`][Self::appliesMediaSelectionCriteriaAutomatically].
698        #[unsafe(method(setAppliesMediaSelectionCriteriaAutomatically:))]
699        #[unsafe(method_family = none)]
700        pub unsafe fn setAppliesMediaSelectionCriteriaAutomatically(
701            &self,
702            applies_media_selection_criteria_automatically: bool,
703        );
704
705        #[cfg(all(feature = "AVMediaFormat", feature = "AVPlayerMediaSelectionCriteria"))]
706        /// Applies automatic selection criteria for media that has the specified media characteristic.
707        ///
708        /// Parameter `criteria`: An instance of AVPlayerMediaSelectionCriteria.
709        ///
710        /// Parameter `mediaCharacteristic`: The media characteristic for which the selection criteria are to be applied. Supported values include AVMediaCharacteristicAudible, AVMediaCharacteristicLegible, and AVMediaCharacteristicVisual.
711        ///
712        /// Criteria will be applied to an AVPlayerItem when:
713        /// a) It is made ready to play
714        /// b) Specific media selections are made by -[AVPlayerItem selectMediaOption:inMediaSelectionGroup:] in a different group. The automatic choice in one group may be influenced by a specific selection in another group.
715        /// c) Underlying system preferences change, e.g. system language, accessibility captions.
716        ///
717        /// Specific selections made by -[AVPlayerItem selectMediaOption:inMediaSelectionGroup:] within any group will override automatic selection in that group until -[AVPlayerItem selectMediaOptionAutomaticallyInMediaSelectionGroup:] is received.
718        ///
719        /// Before macOS 13, iOS 16, tvOS 16, and watchOS 9, this method must be invoked on the main thread/queue.
720        #[unsafe(method(setMediaSelectionCriteria:forMediaCharacteristic:))]
721        #[unsafe(method_family = none)]
722        pub unsafe fn setMediaSelectionCriteria_forMediaCharacteristic(
723            &self,
724            criteria: Option<&AVPlayerMediaSelectionCriteria>,
725            media_characteristic: &AVMediaCharacteristic,
726        );
727
728        #[cfg(all(feature = "AVMediaFormat", feature = "AVPlayerMediaSelectionCriteria"))]
729        /// Returns the automatic selection criteria for media that has the specified media characteristic.
730        ///
731        /// Parameter `mediaCharacteristic`: The media characteristic for which the selection criteria is to be returned. Supported values include AVMediaCharacteristicAudible, AVMediaCharacteristicLegible, and AVMediaCharacteristicVisual.
732        ///
733        /// Before macOS 13, iOS 16, tvOS 16, and watchOS 9, this method must be invoked on the main thread/queue.
734        #[unsafe(method(mediaSelectionCriteriaForMediaCharacteristic:))]
735        #[unsafe(method_family = none)]
736        pub unsafe fn mediaSelectionCriteriaForMediaCharacteristic(
737            &self,
738            media_characteristic: &AVMediaCharacteristic,
739        ) -> Option<Retained<AVPlayerMediaSelectionCriteria>>;
740    );
741}
742
743/// AVPlayerAudioDeviceSupport.
744impl AVPlayer {
745    extern_methods!(
746        /// Specifies the unique ID of the Core Audio output device used to play audio.
747        ///
748        /// By default, the value of this property is nil, indicating that the default audio output device is used. Otherwise the value of this property is an NSString containing the unique ID of the Core Audio output device to be used for audio output.
749        ///
750        /// Core Audio's kAudioDevicePropertyDeviceUID is a suitable source of audio output device unique IDs.
751        #[unsafe(method(audioOutputDeviceUniqueID))]
752        #[unsafe(method_family = none)]
753        pub unsafe fn audioOutputDeviceUniqueID(&self) -> Option<Retained<NSString>>;
754
755        /// Setter for [`audioOutputDeviceUniqueID`][Self::audioOutputDeviceUniqueID].
756        #[unsafe(method(setAudioOutputDeviceUniqueID:))]
757        #[unsafe(method_family = none)]
758        pub unsafe fn setAudioOutputDeviceUniqueID(
759            &self,
760            audio_output_device_unique_id: Option<&NSString>,
761        );
762    );
763}
764
765/// AVPlayerExternalPlaybackSupport.
766impl AVPlayer {
767    extern_methods!(
768        #[unsafe(method(allowsExternalPlayback))]
769        #[unsafe(method_family = none)]
770        pub unsafe fn allowsExternalPlayback(&self) -> bool;
771
772        /// Setter for [`allowsExternalPlayback`][Self::allowsExternalPlayback].
773        #[unsafe(method(setAllowsExternalPlayback:))]
774        #[unsafe(method_family = none)]
775        pub unsafe fn setAllowsExternalPlayback(&self, allows_external_playback: bool);
776
777        #[unsafe(method(isExternalPlaybackActive))]
778        #[unsafe(method_family = none)]
779        pub unsafe fn isExternalPlaybackActive(&self) -> bool;
780
781        #[unsafe(method(usesExternalPlaybackWhileExternalScreenIsActive))]
782        #[unsafe(method_family = none)]
783        pub unsafe fn usesExternalPlaybackWhileExternalScreenIsActive(&self) -> bool;
784
785        /// Setter for [`usesExternalPlaybackWhileExternalScreenIsActive`][Self::usesExternalPlaybackWhileExternalScreenIsActive].
786        #[unsafe(method(setUsesExternalPlaybackWhileExternalScreenIsActive:))]
787        #[unsafe(method_family = none)]
788        pub unsafe fn setUsesExternalPlaybackWhileExternalScreenIsActive(
789            &self,
790            uses_external_playback_while_external_screen_is_active: bool,
791        );
792
793        #[cfg(feature = "AVAnimation")]
794        #[unsafe(method(externalPlaybackVideoGravity))]
795        #[unsafe(method_family = none)]
796        pub unsafe fn externalPlaybackVideoGravity(&self) -> Retained<AVLayerVideoGravity>;
797
798        #[cfg(feature = "AVAnimation")]
799        /// Setter for [`externalPlaybackVideoGravity`][Self::externalPlaybackVideoGravity].
800        #[unsafe(method(setExternalPlaybackVideoGravity:))]
801        #[unsafe(method_family = none)]
802        pub unsafe fn setExternalPlaybackVideoGravity(
803            &self,
804            external_playback_video_gravity: &AVLayerVideoGravity,
805        );
806    );
807}
808
809/// AVPlayerProtectedContent.
810impl AVPlayer {
811    extern_methods!(
812        /// Whether or not decoded output is being obscured due to insufficient external protection.
813        ///
814        ///
815        /// The value of this property indicates whether the player is purposefully obscuring the visual output
816        /// of the current item because the requirement for an external protection mechanism is not met by the
817        /// current device configuration. It is highly recommended that clients whose content requires external
818        /// protection observe this property and set the playback rate to zero and display an appropriate user
819        /// interface when the value changes to YES. This property is key value observable.
820        ///
821        /// Note that the value of this property is dependent on the external protection requirements of the
822        /// current item. These requirements are inherent to the content itself and cannot be externally specified.
823        /// If the current item does not require external protection, the value of this property will be NO.
824        #[unsafe(method(outputObscuredDueToInsufficientExternalProtection))]
825        #[unsafe(method_family = none)]
826        pub unsafe fn outputObscuredDueToInsufficientExternalProtection(&self) -> bool;
827    );
828}
829
830/// A bitfield type that specifies an HDR mode.
831///
832///
833///
834/// Indicates that HLG (Hybrid Log-Gamma) HDR mode is available.
835///
836///
837/// Indicates that HDR10 HDR mode is available.
838///
839///
840/// Indicates that Dolby Vision HDR mode is available.
841///
842/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avplayerhdrmode?language=objc)
843// NS_OPTIONS
844#[deprecated = "The deprecated availableHDRModes uses this enum. Use eligibleForHDRPlayback instead"]
845#[repr(transparent)]
846#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
847pub struct AVPlayerHDRMode(pub NSInteger);
848bitflags::bitflags! {
849    impl AVPlayerHDRMode: NSInteger {
850#[deprecated = "The deprecated availableHDRModes uses this enum. Use eligibleForHDRPlayback instead"]
851        #[doc(alias = "AVPlayerHDRModeHLG")]
852        const HLG = 0x1;
853#[deprecated = "The deprecated availableHDRModes uses this enum. Use eligibleForHDRPlayback instead"]
854        #[doc(alias = "AVPlayerHDRModeHDR10")]
855        const HDR10 = 0x2;
856#[deprecated = "The deprecated availableHDRModes uses this enum. Use eligibleForHDRPlayback instead"]
857        #[doc(alias = "AVPlayerHDRModeDolbyVision")]
858        const DolbyVision = 0x4;
859    }
860}
861
862unsafe impl Encode for AVPlayerHDRMode {
863    const ENCODING: Encoding = NSInteger::ENCODING;
864}
865
866unsafe impl RefEncode for AVPlayerHDRMode {
867    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
868}
869
870extern "C" {
871    /// A notification that fires whenever availableHDRModes changes.
872    ///
873    ///
874    /// This notification fires when a value is added or removed from the list of availableHDRModes.  This can be caused by display connection/disconnection or resource changes.
875    ///
876    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avplayeravailablehdrmodesdidchangenotification?language=objc)
877    pub static AVPlayerAvailableHDRModesDidChangeNotification: &'static NSNotificationName;
878}
879
880extern "C" {
881    /// A notification that fires whenever eligibleForHDRPlayback changes.
882    ///
883    ///
884    /// This notification fires when eligibleForHDRPlayback changes.  This can be caused by display connection/disconnection or resource changes.
885    ///
886    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avplayereligibleforhdrplaybackdidchangenotification?language=objc)
887    pub static AVPlayerEligibleForHDRPlaybackDidChangeNotification: &'static NSNotificationName;
888}
889
890/// AVPlayerPlaybackCapabilities.
891impl AVPlayer {
892    extern_methods!(
893        /// An AVPlayerHDRMode value that indicates the HDR modes the device can play to an appropriate display.   A value of 0 indicates that no HDR modes are supported.
894        ///
895        ///
896        /// This property indicates all of the HDR modes that the device can play.  Each value indicates that an appropriate HDR display is available for the specified HDR mode.  Additionally, the device must be capable of playing the specified HDR type.  This property does not indicate whether video contains HDR content, whether HDR video is currently playing, or whether video is playing on an HDR display.
897        #[deprecated = "Use eligibleForHDRPlayback instead"]
898        #[unsafe(method(availableHDRModes))]
899        #[unsafe(method_family = none)]
900        pub unsafe fn availableHDRModes(mtm: MainThreadMarker) -> AVPlayerHDRMode;
901
902        /// Indicates whether HDR content can be played to an appropriate display.
903        ///
904        ///
905        /// This property is YES if an HDR display is available and the device is capable of playing HDR content from an appropriate AVAsset, NO otherwise.  This property does not indicate whether video contains HDR content, whether HDR video is currently playing, or whether video is playing on an HDR display.  This property is not KVO observable.
906        #[unsafe(method(eligibleForHDRPlayback))]
907        #[unsafe(method_family = none)]
908        pub unsafe fn eligibleForHDRPlayback(mtm: MainThreadMarker) -> bool;
909    );
910}
911
912/// AVPlayerVideoDecoderGPUSupport.
913impl AVPlayer {
914    extern_methods!(
915        /// Specifies a registryID associated with a GPU that should be used for video decode.
916        ///
917        ///
918        /// By default, whenever possible, video decode will be performed on the GPU associated with the display on which the presenting CALayer is located.  Decode will be transitioned to a new GPU if appropriate when the CALayer moves to a new display.  This property overrides this default behavior, forcing decode to prefer an affinity to the GPU specified regardless of which GPU is being used to display the associated CALayer.
919        ///
920        /// The GPU registryID can be obtained from the GPU MTLDevice using [MTLDevice registryID] or can be obtained from OpenGL or OpenCL.
921        #[unsafe(method(preferredVideoDecoderGPURegistryID))]
922        #[unsafe(method_family = none)]
923        pub unsafe fn preferredVideoDecoderGPURegistryID(&self) -> u64;
924
925        /// Setter for [`preferredVideoDecoderGPURegistryID`][Self::preferredVideoDecoderGPURegistryID].
926        #[unsafe(method(setPreferredVideoDecoderGPURegistryID:))]
927        #[unsafe(method_family = none)]
928        pub unsafe fn setPreferredVideoDecoderGPURegistryID(
929            &self,
930            preferred_video_decoder_gpu_registry_id: u64,
931        );
932    );
933}
934
935/// AVPlayerVideoDisplaySleepPrevention.
936impl AVPlayer {
937    extern_methods!(
938        /// Indicates whether video playback prevents display and device sleep.
939        ///
940        /// Default is YES on iOS, tvOS and in Mac Catalyst apps.  Default is NO on macOS.
941        /// Setting this property to NO does not force the display to sleep, it simply stops preventing display sleep.  Other apps or frameworks within your app may still be preventing display sleep for various reasons.
942        ///
943        /// Before macOS 13, iOS 16, tvOS 16, and watchOS 9, this property must be accessed on the main thread/queue.
944        #[unsafe(method(preventsDisplaySleepDuringVideoPlayback))]
945        #[unsafe(method_family = none)]
946        pub unsafe fn preventsDisplaySleepDuringVideoPlayback(&self) -> bool;
947
948        /// Setter for [`preventsDisplaySleepDuringVideoPlayback`][Self::preventsDisplaySleepDuringVideoPlayback].
949        #[unsafe(method(setPreventsDisplaySleepDuringVideoPlayback:))]
950        #[unsafe(method_family = none)]
951        pub unsafe fn setPreventsDisplaySleepDuringVideoPlayback(
952            &self,
953            prevents_display_sleep_during_video_playback: bool,
954        );
955    );
956}
957
958/// AVPlayerAutomaticBackgroundPrevention.
959impl AVPlayer {
960    extern_methods!(
961        /// Indicates whether video playback prevents the app from automatically getting backgrounded.
962        ///
963        /// Default value is YES.
964        /// Setting this property to YES prevents an application that is playing video from automatically getting backgrounded.  This property does not prevent the user from backgrounding the application.
965        #[unsafe(method(preventsAutomaticBackgroundingDuringVideoPlayback))]
966        #[unsafe(method_family = none)]
967        pub unsafe fn preventsAutomaticBackgroundingDuringVideoPlayback(&self) -> bool;
968
969        /// Setter for [`preventsAutomaticBackgroundingDuringVideoPlayback`][Self::preventsAutomaticBackgroundingDuringVideoPlayback].
970        #[unsafe(method(setPreventsAutomaticBackgroundingDuringVideoPlayback:))]
971        #[unsafe(method_family = none)]
972        pub unsafe fn setPreventsAutomaticBackgroundingDuringVideoPlayback(
973            &self,
974            prevents_automatic_backgrounding_during_video_playback: bool,
975        );
976    );
977}
978
979/// This policy describes how AVPlayer behaves when the application transitions to UIApplicationStateBackground while playing video.
980///
981///
982/// Indicates that the system is free to decide. This is the default policy.
983///
984///
985/// Indicates that the player must be paused on going to background.
986///
987///
988/// Indicates that the player continues to play if possible in background.
989///
990/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avplayeraudiovisualbackgroundplaybackpolicy?language=objc)
991// NS_ENUM
992#[repr(transparent)]
993#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
994pub struct AVPlayerAudiovisualBackgroundPlaybackPolicy(pub NSInteger);
995impl AVPlayerAudiovisualBackgroundPlaybackPolicy {
996    #[doc(alias = "AVPlayerAudiovisualBackgroundPlaybackPolicyAutomatic")]
997    pub const Automatic: Self = Self(1);
998    #[doc(alias = "AVPlayerAudiovisualBackgroundPlaybackPolicyPauses")]
999    pub const Pauses: Self = Self(2);
1000    #[doc(alias = "AVPlayerAudiovisualBackgroundPlaybackPolicyContinuesIfPossible")]
1001    pub const ContinuesIfPossible: Self = Self(3);
1002}
1003
1004unsafe impl Encode for AVPlayerAudiovisualBackgroundPlaybackPolicy {
1005    const ENCODING: Encoding = NSInteger::ENCODING;
1006}
1007
1008unsafe impl RefEncode for AVPlayerAudiovisualBackgroundPlaybackPolicy {
1009    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1010}
1011
1012/// AVPlayerBackgroundSupport.
1013impl AVPlayer {
1014    extern_methods!(
1015        /// Controls the policy to be used in deciding how playback of audiovisual content should continue while the application transitions to background.
1016        ///
1017        /// By default, the system is free to decide the background playback policy (AVPlayerAudiovisualBackgroundPlaybackPolicyAutomatic).
1018        /// If set to AVPlayerAudiovisualBackgroundPlaybackPolicyPauses, player will be paused on entering background.
1019        /// If set to AVPlayerAudiovisualBackgroundPlaybackPolicyContinuesIfPossible, the system makes the best effort to continue playback but the app also needs appropriate UIBackgroundModes for the system to let it continue running in the background. Note that this policy only applies to items with enabled video.
1020        #[unsafe(method(audiovisualBackgroundPlaybackPolicy))]
1021        #[unsafe(method_family = none)]
1022        pub unsafe fn audiovisualBackgroundPlaybackPolicy(
1023            &self,
1024        ) -> AVPlayerAudiovisualBackgroundPlaybackPolicy;
1025
1026        /// Setter for [`audiovisualBackgroundPlaybackPolicy`][Self::audiovisualBackgroundPlaybackPolicy].
1027        #[unsafe(method(setAudiovisualBackgroundPlaybackPolicy:))]
1028        #[unsafe(method_family = none)]
1029        pub unsafe fn setAudiovisualBackgroundPlaybackPolicy(
1030            &self,
1031            audiovisual_background_playback_policy: AVPlayerAudiovisualBackgroundPlaybackPolicy,
1032        );
1033    );
1034}
1035
1036/// PlaybackCoordination.
1037impl AVPlayer {
1038    extern_methods!(
1039        #[cfg(feature = "AVPlaybackCoordinator")]
1040        /// The playback coordinator for this player.
1041        ///
1042        /// If the playback coordinator is connected to other participants, rate changes and seeks on the current item will be automatically mirrored to all connected participants.
1043        /// Depending on policies, the coordinator may also intercept rate changes to non-zero to coordinate playback start with the rest of the group.
1044        /// Use [AVPlayer playImmediatelyAtRate:] to override the coordinated startup behavior and start playback immediately. This is useful to give users an opportunity to override waiting caused by other participants' suspensions.
1045        /// Player configuration other than rate and seeks are not communicated to other participants and can be configured independently by each participant.
1046        /// A player with a connected playbackCoordinator will change behavior in situations that require the player to pause for internal reasons, such as a route change or a stall.
1047        /// When resuming after these events, the player will not resume at the stop time. Instead, it will attempt to rejoin the group, potentially seeking to match the other participant's progress.
1048        /// It is left to the owner of the AVPlayer to ensure that all participants are playing the same item. See the discussion of AVPlaybackCoordinator for considerations about item transitions.
1049        #[unsafe(method(playbackCoordinator))]
1050        #[unsafe(method_family = none)]
1051        pub unsafe fn playbackCoordinator(&self) -> Retained<AVPlayerPlaybackCoordinator>;
1052    );
1053}
1054
1055/// AVPlayerOutputSupport.
1056impl AVPlayer {
1057    extern_methods!(
1058        #[cfg(feature = "AVPlayerOutput")]
1059        /// The video output for this player, if one was set.
1060        ///
1061        /// When an AVPlayerVideoOutput is associated with an AVPlayer, the AVPlayerVideoOutput can then be used to receive video-related samples during playback.
1062        ///
1063        /// Note: If an output is set while AVPlayer has a current item it may cause different data channels to be selected for that item, which can have a performance impact.
1064        /// As a result, when possible, it is best to set an output before setting items on an AVPlayer.
1065        #[unsafe(method(videoOutput))]
1066        #[unsafe(method_family = none)]
1067        pub unsafe fn videoOutput(&self) -> Option<Retained<AVPlayerVideoOutput>>;
1068
1069        #[cfg(feature = "AVPlayerOutput")]
1070        /// Setter for [`videoOutput`][Self::videoOutput].
1071        #[unsafe(method(setVideoOutput:))]
1072        #[unsafe(method_family = none)]
1073        pub unsafe fn setVideoOutput(&self, video_output: Option<&AVPlayerVideoOutput>);
1074    );
1075}
1076
1077/// AVPlayerDeprecated.
1078impl AVPlayer {
1079    extern_methods!(
1080        /// Indicates whether display of closed captions is enabled.
1081        ///
1082        ///
1083        /// This property is deprecated.
1084        ///
1085        /// When the value of appliesMediaSelectionCriteriaAutomatically is YES, the receiver will enable closed captions automatically either according to user preferences or, if you provide them, according to AVPlayerMediaSelectionCriteria for the media characteristic AVMediaCharacteristicLegible.
1086        ///
1087        /// If you want to determine whether closed captions may be available for a given AVPlayerItem, you can examine the AVMediaSelectionOptions in the AVMediaSelectionGroup for the characteristic AVMediaCharacteristicLegible, as vended by -[AVAsset mediaSelectionGroupForMediaCharacteristic:]. See AVMediaCharacteristicTranscribesSpokenDialogForAccessibility and AVMediaCharacteristicDescribesMusicAndSoundForAccessibility as documented in AVMediaFormat.h for information about how to identify legible media selection options that offer the features of closed captions for accessibility purposes.
1088        ///
1089        /// You can select or deselect a specific AVMediaSelectionOption via -[AVPlayerItem selectMediaOption:inMediaSelectionGroup:].
1090        ///
1091        /// For further information about Media Accessibility preferences, see MediaAccessibility framework documentation.
1092        #[deprecated = "Allow AVPlayer to enable closed captions automatically according to user preferences by ensuring that the value of appliesMediaSelectionCriteriaAutomatically is YES."]
1093        #[unsafe(method(isClosedCaptionDisplayEnabled))]
1094        #[unsafe(method_family = none)]
1095        pub unsafe fn isClosedCaptionDisplayEnabled(&self) -> bool;
1096
1097        /// Setter for [`isClosedCaptionDisplayEnabled`][Self::isClosedCaptionDisplayEnabled].
1098        #[deprecated = "Allow AVPlayer to enable closed captions automatically according to user preferences by ensuring that the value of appliesMediaSelectionCriteriaAutomatically is YES."]
1099        #[unsafe(method(setClosedCaptionDisplayEnabled:))]
1100        #[unsafe(method_family = none)]
1101        pub unsafe fn setClosedCaptionDisplayEnabled(&self, closed_caption_display_enabled: bool);
1102
1103        #[cfg(feature = "objc2-core-media")]
1104        #[deprecated]
1105        #[unsafe(method(masterClock))]
1106        #[unsafe(method_family = none)]
1107        pub unsafe fn masterClock(&self) -> Option<Retained<CMClock>>;
1108
1109        #[cfg(feature = "objc2-core-media")]
1110        /// Setter for [`masterClock`][Self::masterClock].
1111        #[deprecated]
1112        #[unsafe(method(setMasterClock:))]
1113        #[unsafe(method_family = none)]
1114        pub unsafe fn setMasterClock(&self, master_clock: Option<&CMClock>);
1115    );
1116}
1117
1118extern_class!(
1119    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avqueueplayer?language=objc)
1120    #[unsafe(super(AVPlayer, NSObject))]
1121    #[derive(Debug, PartialEq, Eq, Hash)]
1122    pub struct AVQueuePlayer;
1123);
1124
1125unsafe impl NSObjectProtocol for AVQueuePlayer {}
1126
1127impl AVQueuePlayer {
1128    extern_methods!(
1129        #[cfg(feature = "AVPlayerItem")]
1130        /// Creates an instance of AVQueuePlayer and enqueues the AVPlayerItems from the specified array.
1131        ///
1132        /// Parameter `items`: An NSArray of AVPlayerItems with which to populate the player's queue initially.
1133        ///
1134        /// Returns: An instance of AVQueuePlayer.
1135        #[unsafe(method(queuePlayerWithItems:))]
1136        #[unsafe(method_family = none)]
1137        pub unsafe fn queuePlayerWithItems(
1138            items: &NSArray<AVPlayerItem>,
1139            mtm: MainThreadMarker,
1140        ) -> Retained<Self>;
1141
1142        #[cfg(feature = "AVPlayerItem")]
1143        /// Initializes an instance of AVQueuePlayer by enqueueing the AVPlayerItems from the specified array.
1144        ///
1145        /// Parameter `items`: An NSArray of AVPlayerItems with which to populate the player's queue initially.
1146        ///
1147        /// Returns: An instance of AVQueuePlayer.
1148        ///
1149        /// This method throws an exception if items contains duplicated values or values associated with another AVPlayer.
1150        #[unsafe(method(initWithItems:))]
1151        #[unsafe(method_family = init)]
1152        pub unsafe fn initWithItems(
1153            this: Allocated<Self>,
1154            items: &NSArray<AVPlayerItem>,
1155        ) -> Retained<AVQueuePlayer>;
1156
1157        #[cfg(feature = "AVPlayerItem")]
1158        /// Provides an array of the currently enqueued items.
1159        ///
1160        /// Returns: An NSArray containing the enqueued AVPlayerItems.
1161        #[unsafe(method(items))]
1162        #[unsafe(method_family = none)]
1163        pub unsafe fn items(&self) -> Retained<NSArray<AVPlayerItem>>;
1164
1165        /// Ends playback of the current item and initiates playback of the next item in the player's queue.
1166        ///
1167        /// Removes the current item from the play queue.
1168        #[unsafe(method(advanceToNextItem))]
1169        #[unsafe(method_family = none)]
1170        pub unsafe fn advanceToNextItem(&self);
1171
1172        #[cfg(feature = "AVPlayerItem")]
1173        /// Tests whether an AVPlayerItem can be inserted into the player's queue.
1174        ///
1175        /// Parameter `item`: The AVPlayerItem to be tested.
1176        ///
1177        /// Parameter `afterItem`: The item that the item to be tested is to follow in the queue. Pass nil to test whether the item can be appended to the queue.
1178        ///
1179        /// Returns: An indication of whether the item can be inserted into the queue after the specified item.
1180        ///
1181        /// Note that adding the same AVPlayerItem to an AVQueuePlayer at more than one position in the queue is not supported.
1182        #[unsafe(method(canInsertItem:afterItem:))]
1183        #[unsafe(method_family = none)]
1184        pub unsafe fn canInsertItem_afterItem(
1185            &self,
1186            item: &AVPlayerItem,
1187            after_item: Option<&AVPlayerItem>,
1188        ) -> bool;
1189
1190        #[cfg(feature = "AVPlayerItem")]
1191        /// Places an AVPlayerItem after the specified item in the queue.
1192        ///
1193        /// Parameter `item`: The item to be inserted.
1194        ///
1195        /// Parameter `afterItem`: The item that the newly inserted item should follow in the queue. Pass nil to append the item to the queue.
1196        ///
1197        /// This method throws an exception if item already exists in the queue.
1198        #[unsafe(method(insertItem:afterItem:))]
1199        #[unsafe(method_family = none)]
1200        pub unsafe fn insertItem_afterItem(
1201            &self,
1202            item: &AVPlayerItem,
1203            after_item: Option<&AVPlayerItem>,
1204        );
1205
1206        #[cfg(feature = "AVPlayerItem")]
1207        /// Removes an AVPlayerItem from the queue.
1208        ///
1209        /// Parameter `item`: The item to be removed.
1210        ///
1211        /// If the item to be removed is currently playing, has the same effect as -advanceToNextItem.
1212        #[unsafe(method(removeItem:))]
1213        #[unsafe(method_family = none)]
1214        pub unsafe fn removeItem(&self, item: &AVPlayerItem);
1215
1216        /// Removes all items from the queue.
1217        ///
1218        /// Stops playback by the target.
1219        #[unsafe(method(removeAllItems))]
1220        #[unsafe(method_family = none)]
1221        pub unsafe fn removeAllItems(&self);
1222    );
1223}
1224
1225/// Methods declared on superclass `AVPlayer`.
1226impl AVQueuePlayer {
1227    extern_methods!(
1228        /// Initializes an AVPlayer with no player items.
1229        #[unsafe(method(init))]
1230        #[unsafe(method_family = init)]
1231        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1232
1233        /// Returns an instance of AVPlayer that plays a single audiovisual resource referenced by URL.
1234        ///
1235        /// Parameter `URL`:
1236        /// Returns: An instance of AVPlayer
1237        ///
1238        /// Implicitly creates an AVPlayerItem. Clients can obtain the AVPlayerItem as it becomes the player's currentItem.
1239        #[unsafe(method(playerWithURL:))]
1240        #[unsafe(method_family = none)]
1241        pub unsafe fn playerWithURL(url: &NSURL, mtm: MainThreadMarker) -> Retained<Self>;
1242
1243        #[cfg(feature = "AVPlayerItem")]
1244        /// Create an AVPlayer that plays a single audiovisual item.
1245        ///
1246        /// Parameter `item`:
1247        /// Returns: An instance of AVPlayer
1248        ///
1249        /// Useful in order to play items for which an AVAsset has previously been created. See -[AVPlayerItem initWithAsset:].
1250        #[unsafe(method(playerWithPlayerItem:))]
1251        #[unsafe(method_family = none)]
1252        pub unsafe fn playerWithPlayerItem(
1253            item: Option<&AVPlayerItem>,
1254            mtm: MainThreadMarker,
1255        ) -> Retained<Self>;
1256
1257        /// Initializes an AVPlayer that plays a single audiovisual resource referenced by URL.
1258        ///
1259        /// Parameter `URL`:
1260        /// Returns: An instance of AVPlayer
1261        ///
1262        /// Implicitly creates an AVPlayerItem. Clients can obtain the AVPlayerItem as it becomes the player's currentItem.
1263        #[unsafe(method(initWithURL:))]
1264        #[unsafe(method_family = init)]
1265        pub unsafe fn initWithURL(this: Allocated<Self>, url: &NSURL) -> Retained<Self>;
1266
1267        #[cfg(feature = "AVPlayerItem")]
1268        /// Create an AVPlayer that plays a single audiovisual item.
1269        ///
1270        /// Parameter `item`:
1271        /// Returns: An instance of AVPlayer
1272        ///
1273        /// Useful in order to play items for which an AVAsset has previously been created. See -[AVPlayerItem initWithAsset:].
1274        /// This method throws an exception if the item is not an AVPlayerItem, or if the item is
1275        /// associated with another AVPlayer.
1276        #[unsafe(method(initWithPlayerItem:))]
1277        #[unsafe(method_family = init)]
1278        pub unsafe fn initWithPlayerItem(
1279            this: Allocated<Self>,
1280            item: Option<&AVPlayerItem>,
1281        ) -> Retained<Self>;
1282    );
1283}
1284
1285/// Methods declared on superclass `NSObject`.
1286impl AVQueuePlayer {
1287    extern_methods!(
1288        #[unsafe(method(new))]
1289        #[unsafe(method_family = new)]
1290        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
1291    );
1292}