objc2_av_kit/generated/
AVPlayerView.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-app-kit")]
7#[cfg(target_os = "macos")]
8use objc2_app_kit::*;
9#[cfg(feature = "objc2-av-foundation")]
10use objc2_av_foundation::*;
11#[cfg(feature = "objc2-core-foundation")]
12use objc2_core_foundation::*;
13use objc2_foundation::*;
14
15use crate::*;
16
17/// No controls pane is associated with the view.
18///
19/// The inline controls pane is associated with the view.
20///
21/// The floating controls pane is associated with the view.
22///
23/// The minimal controls pane is associated with the view.
24///
25/// The default controls pane is associated with the view.
26///
27/// See also [Apple's documentation](https://developer.apple.com/documentation/avkit/avplayerviewcontrolsstyle?language=objc)
28// NS_ENUM
29#[repr(transparent)]
30#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
31pub struct AVPlayerViewControlsStyle(pub NSInteger);
32impl AVPlayerViewControlsStyle {
33    #[doc(alias = "AVPlayerViewControlsStyleNone")]
34    pub const None: Self = Self(0);
35    #[doc(alias = "AVPlayerViewControlsStyleInline")]
36    pub const Inline: Self = Self(1);
37    #[doc(alias = "AVPlayerViewControlsStyleFloating")]
38    pub const Floating: Self = Self(2);
39    #[doc(alias = "AVPlayerViewControlsStyleMinimal")]
40    pub const Minimal: Self = Self(3);
41    #[doc(alias = "AVPlayerViewControlsStyleDefault")]
42    pub const Default: Self = Self(AVPlayerViewControlsStyle::Inline.0);
43}
44
45unsafe impl Encode for AVPlayerViewControlsStyle {
46    const ENCODING: Encoding = NSInteger::ENCODING;
47}
48
49unsafe impl RefEncode for AVPlayerViewControlsStyle {
50    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
51}
52
53extern_class!(
54    /// AVPlayerView is a subclass of NSView that can be used to display the visual content of an AVPlayer object and the standard playback controls.
55    ///
56    /// See also [Apple's documentation](https://developer.apple.com/documentation/avkit/avplayerview?language=objc)
57    #[unsafe(super(NSView, NSResponder, NSObject))]
58    #[derive(Debug, PartialEq, Eq, Hash)]
59    #[cfg(feature = "objc2-app-kit")]
60    #[cfg(target_os = "macos")]
61    pub struct AVPlayerView;
62);
63
64#[cfg(feature = "objc2-app-kit")]
65#[cfg(target_os = "macos")]
66unsafe impl NSAccessibility for AVPlayerView {}
67
68#[cfg(feature = "objc2-app-kit")]
69#[cfg(target_os = "macos")]
70unsafe impl NSAccessibilityElementProtocol for AVPlayerView {}
71
72#[cfg(feature = "objc2-app-kit")]
73#[cfg(target_os = "macos")]
74unsafe impl NSAnimatablePropertyContainer for AVPlayerView {}
75
76#[cfg(feature = "objc2-app-kit")]
77#[cfg(target_os = "macos")]
78unsafe impl NSAppearanceCustomization for AVPlayerView {}
79
80#[cfg(feature = "objc2-app-kit")]
81#[cfg(target_os = "macos")]
82unsafe impl NSCoding for AVPlayerView {}
83
84#[cfg(feature = "objc2-app-kit")]
85#[cfg(target_os = "macos")]
86unsafe impl NSDraggingDestination for AVPlayerView {}
87
88#[cfg(feature = "objc2-app-kit")]
89#[cfg(target_os = "macos")]
90unsafe impl NSObjectProtocol for AVPlayerView {}
91
92#[cfg(feature = "objc2-app-kit")]
93#[cfg(target_os = "macos")]
94unsafe impl NSUserInterfaceItemIdentification for AVPlayerView {}
95
96#[cfg(feature = "objc2-app-kit")]
97#[cfg(target_os = "macos")]
98impl AVPlayerView {
99    extern_methods!(
100        #[cfg(feature = "objc2-av-foundation")]
101        /// The player from which to source the media content for the view.
102        #[unsafe(method(player))]
103        #[unsafe(method_family = none)]
104        pub unsafe fn player(&self) -> Option<Retained<AVPlayer>>;
105
106        #[cfg(feature = "objc2-av-foundation")]
107        /// Setter for [`player`][Self::player].
108        #[unsafe(method(setPlayer:))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn setPlayer(&self, player: Option<&AVPlayer>);
111
112        /// The style of the playback controls pane currently associated with the view.
113        ///
114        /// After macOS 11, the floating style controls will always be used when presenting in fullscreen and AVPlayerViewControlsStyleNone is not specified.
115        #[unsafe(method(controlsStyle))]
116        #[unsafe(method_family = none)]
117        pub unsafe fn controlsStyle(&self) -> AVPlayerViewControlsStyle;
118
119        /// Setter for [`controlsStyle`][Self::controlsStyle].
120        #[unsafe(method(setControlsStyle:))]
121        #[unsafe(method_family = none)]
122        pub unsafe fn setControlsStyle(&self, controls_style: AVPlayerViewControlsStyle);
123
124        #[cfg(feature = "objc2-av-foundation")]
125        /// A string defining how the video is displayed within an AVPlayerLayer bounds rect.
126        ///
127        /// Options are AVLayerVideoGravityResizeAspect, AVLayerVideoGravityResizeAspectFill and AVLayerVideoGravityResize. AVLayerVideoGravityResizeAspect is default.
128        #[unsafe(method(videoGravity))]
129        #[unsafe(method_family = none)]
130        pub unsafe fn videoGravity(&self) -> Retained<AVLayerVideoGravity>;
131
132        #[cfg(feature = "objc2-av-foundation")]
133        /// Setter for [`videoGravity`][Self::videoGravity].
134        #[unsafe(method(setVideoGravity:))]
135        #[unsafe(method_family = none)]
136        pub unsafe fn setVideoGravity(&self, video_gravity: &AVLayerVideoGravity);
137
138        /// Boolean indicating that the first video frame has been made ready for display for the current item of the associated AVPlayer.
139        #[unsafe(method(isReadyForDisplay))]
140        #[unsafe(method_family = none)]
141        pub unsafe fn isReadyForDisplay(&self) -> bool;
142
143        /// The current size and position of the video image as displayed within the receiver's view's bounds.
144        #[unsafe(method(videoBounds))]
145        #[unsafe(method_family = none)]
146        pub unsafe fn videoBounds(&self) -> NSRect;
147
148        /// Use the content overlay view to add additional custom views between the video content and the controls.
149        #[unsafe(method(contentOverlayView))]
150        #[unsafe(method_family = none)]
151        pub unsafe fn contentOverlayView(&self) -> Option<Retained<NSView>>;
152
153        /// Whether or not the now playing info center should be updated. Default is YES.
154        #[unsafe(method(updatesNowPlayingInfoCenter))]
155        #[unsafe(method_family = none)]
156        pub unsafe fn updatesNowPlayingInfoCenter(&self) -> bool;
157
158        /// Setter for [`updatesNowPlayingInfoCenter`][Self::updatesNowPlayingInfoCenter].
159        #[unsafe(method(setUpdatesNowPlayingInfoCenter:))]
160        #[unsafe(method_family = none)]
161        pub unsafe fn setUpdatesNowPlayingInfoCenter(&self, updates_now_playing_info_center: bool);
162
163        /// The receiver's delegate.
164        #[unsafe(method(delegate))]
165        #[unsafe(method_family = none)]
166        pub unsafe fn delegate(&self)
167            -> Option<Retained<ProtocolObject<dyn AVPlayerViewDelegate>>>;
168
169        /// This is a [weak property][objc2::topics::weak_property].
170        /// Setter for [`delegate`][Self::delegate].
171        #[unsafe(method(setDelegate:))]
172        #[unsafe(method_family = none)]
173        pub unsafe fn setDelegate(
174            &self,
175            delegate: Option<&ProtocolObject<dyn AVPlayerViewDelegate>>,
176        );
177
178        #[cfg(feature = "AVPlaybackSpeed")]
179        /// A list of user selectable playback speeds to be shown in the playback speed control.
180        ///
181        /// By default this property will be set to the systemDefaultSpeeds class property. Setting this property to nil will hide the playback speed selection UI.
182        ///
183        /// To set the currently selected playback speed programmatically, either set the defaultRate on the AVPlayer associated with this view controller or use the selectSpeed method on AVPlayerView.
184        #[unsafe(method(speeds))]
185        #[unsafe(method_family = none)]
186        pub unsafe fn speeds(&self) -> Retained<NSArray<AVPlaybackSpeed>>;
187
188        #[cfg(feature = "AVPlaybackSpeed")]
189        /// Setter for [`speeds`][Self::speeds].
190        #[unsafe(method(setSpeeds:))]
191        #[unsafe(method_family = none)]
192        pub unsafe fn setSpeeds(&self, speeds: &NSArray<AVPlaybackSpeed>);
193
194        #[cfg(feature = "AVPlaybackSpeed")]
195        /// The currently selected playback speed.
196        ///
197        /// Changes to the associated AVPlayer's defaultRate will be reflected in this property and vice versa. If the associated AVPlayer's defaultRate is set to a value that does not match a speed in the speeds list property, the selected speed will be nil.
198        #[unsafe(method(selectedSpeed))]
199        #[unsafe(method_family = none)]
200        pub unsafe fn selectedSpeed(&self) -> Option<Retained<AVPlaybackSpeed>>;
201
202        #[cfg(feature = "AVPlaybackSpeed")]
203        /// Parameter `speed`: The playback speed to select.
204        ///
205        /// Sets the input AVPlaybackSpeed as the selected speed.
206        ///
207        /// Calls to selectSpeed with AVPlaybackSpeeds not contained within the speeds property array will be ignored.
208        #[unsafe(method(selectSpeed:))]
209        #[unsafe(method_family = none)]
210        pub unsafe fn selectSpeed(&self, speed: &AVPlaybackSpeed);
211
212        /// When set to YES, the AVPlayerView will try to find objects, text and people while the media is paused. When an object is found, the user will be able to interact with it selecting and right clicking to present a context menu. Default is YES.
213        #[unsafe(method(allowsVideoFrameAnalysis))]
214        #[unsafe(method_family = none)]
215        pub unsafe fn allowsVideoFrameAnalysis(&self) -> bool;
216
217        /// Setter for [`allowsVideoFrameAnalysis`][Self::allowsVideoFrameAnalysis].
218        #[unsafe(method(setAllowsVideoFrameAnalysis:))]
219        #[unsafe(method_family = none)]
220        pub unsafe fn setAllowsVideoFrameAnalysis(&self, allows_video_frame_analysis: bool);
221
222        #[cfg(feature = "AVKitTypes")]
223        /// The types of items AVPlayerView looks for in a paused video frame.
224        #[unsafe(method(videoFrameAnalysisTypes))]
225        #[unsafe(method_family = none)]
226        pub unsafe fn videoFrameAnalysisTypes(&self) -> AVVideoFrameAnalysisType;
227
228        #[cfg(feature = "AVKitTypes")]
229        /// Setter for [`videoFrameAnalysisTypes`][Self::videoFrameAnalysisTypes].
230        #[unsafe(method(setVideoFrameAnalysisTypes:))]
231        #[unsafe(method_family = none)]
232        pub unsafe fn setVideoFrameAnalysisTypes(
233            &self,
234            video_frame_analysis_types: AVVideoFrameAnalysisType,
235        );
236
237        /// Whether the magnify gesture will change the video's view magnification.
238        ///
239        /// The default value is NO. This property only effects whether the magnify gesture triggers magnification. A client can still programmatically change magnification even when the value of this is NO. This behavior matches the behavior of NSScrollView.
240        #[unsafe(method(allowsMagnification))]
241        #[unsafe(method_family = none)]
242        pub unsafe fn allowsMagnification(&self) -> bool;
243
244        /// Setter for [`allowsMagnification`][Self::allowsMagnification].
245        #[unsafe(method(setAllowsMagnification:))]
246        #[unsafe(method_family = none)]
247        pub unsafe fn setAllowsMagnification(&self, allows_magnification: bool);
248
249        #[cfg(feature = "objc2-core-foundation")]
250        /// The factor by which the video's view is currently scaled.
251        ///
252        /// The default value is 1.0. The value cannot be smaller than 1.0 or larger 64.0. Nearest neighbor interpolation will be used once the content has been zoomed past a certain factor.
253        #[unsafe(method(magnification))]
254        #[unsafe(method_family = none)]
255        pub unsafe fn magnification(&self) -> CGFloat;
256
257        #[cfg(feature = "objc2-core-foundation")]
258        /// Setter for [`magnification`][Self::magnification].
259        #[unsafe(method(setMagnification:))]
260        #[unsafe(method_family = none)]
261        pub unsafe fn setMagnification(&self, magnification: CGFloat);
262
263        #[cfg(feature = "objc2-core-foundation")]
264        /// Scales the video's view by a specified factor and centers the result on a specified point.
265        ///
266        /// Parameter `magnification`: The factor by which to scale the video's view.
267        ///
268        /// Parameter `point`: The point (in view space) on which to center magnification.
269        ///
270        /// The magnification cannot be smaller than 1.0 or larger 64.0. Nearest neighbor interpolation will be used once the content has been zoomed past a certain factor.
271        #[unsafe(method(setMagnification:centeredAtPoint:))]
272        #[unsafe(method_family = none)]
273        pub unsafe fn setMagnification_centeredAtPoint(
274            &self,
275            magnification: CGFloat,
276            point: CGPoint,
277        );
278    );
279}
280
281/// Methods declared on superclass `NSView`.
282#[cfg(feature = "objc2-app-kit")]
283#[cfg(target_os = "macos")]
284impl AVPlayerView {
285    extern_methods!(
286        #[unsafe(method(initWithFrame:))]
287        #[unsafe(method_family = init)]
288        pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
289
290        #[unsafe(method(initWithCoder:))]
291        #[unsafe(method_family = init)]
292        pub unsafe fn initWithCoder(
293            this: Allocated<Self>,
294            coder: &NSCoder,
295        ) -> Option<Retained<Self>>;
296    );
297}
298
299/// Methods declared on superclass `NSResponder`.
300#[cfg(feature = "objc2-app-kit")]
301#[cfg(target_os = "macos")]
302impl AVPlayerView {
303    extern_methods!(
304        #[unsafe(method(init))]
305        #[unsafe(method_family = init)]
306        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
307    );
308}
309
310/// Methods declared on superclass `NSObject`.
311#[cfg(feature = "objc2-app-kit")]
312#[cfg(target_os = "macos")]
313impl AVPlayerView {
314    extern_methods!(
315        #[unsafe(method(new))]
316        #[unsafe(method_family = new)]
317        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
318    );
319}
320
321/// AVPlayerViewCustomization.
322#[cfg(feature = "objc2-app-kit")]
323#[cfg(target_os = "macos")]
324impl AVPlayerView {
325    extern_methods!(
326        /// Replace scanning controls in the playback UI with frame stepping buttons. Default is NO.
327        #[unsafe(method(showsFrameSteppingButtons))]
328        #[unsafe(method_family = none)]
329        pub unsafe fn showsFrameSteppingButtons(&self) -> bool;
330
331        /// Setter for [`showsFrameSteppingButtons`][Self::showsFrameSteppingButtons].
332        #[unsafe(method(setShowsFrameSteppingButtons:))]
333        #[unsafe(method_family = none)]
334        pub unsafe fn setShowsFrameSteppingButtons(&self, shows_frame_stepping_buttons: bool);
335
336        /// Whether or not the controls pane will show a sharing service button when the current player item can be shared. Default is NO.
337        #[unsafe(method(showsSharingServiceButton))]
338        #[unsafe(method_family = none)]
339        pub unsafe fn showsSharingServiceButton(&self) -> bool;
340
341        /// Setter for [`showsSharingServiceButton`][Self::showsSharingServiceButton].
342        #[unsafe(method(setShowsSharingServiceButton:))]
343        #[unsafe(method_family = none)]
344        pub unsafe fn setShowsSharingServiceButton(&self, shows_sharing_service_button: bool);
345
346        /// Clients can set this property in order to show an action pop up button. Default is nil.
347        #[unsafe(method(actionPopUpButtonMenu))]
348        #[unsafe(method_family = none)]
349        pub unsafe fn actionPopUpButtonMenu(&self) -> Option<Retained<NSMenu>>;
350
351        /// Setter for [`actionPopUpButtonMenu`][Self::actionPopUpButtonMenu].
352        #[unsafe(method(setActionPopUpButtonMenu:))]
353        #[unsafe(method_family = none)]
354        pub unsafe fn setActionPopUpButtonMenu(&self, action_pop_up_button_menu: Option<&NSMenu>);
355
356        /// Whether or not the controls pane will show a full screen toggle button. Default is NO.
357        #[unsafe(method(showsFullScreenToggleButton))]
358        #[unsafe(method_family = none)]
359        pub unsafe fn showsFullScreenToggleButton(&self) -> bool;
360
361        /// Setter for [`showsFullScreenToggleButton`][Self::showsFullScreenToggleButton].
362        #[unsafe(method(setShowsFullScreenToggleButton:))]
363        #[unsafe(method_family = none)]
364        pub unsafe fn setShowsFullScreenToggleButton(&self, shows_full_screen_toggle_button: bool);
365
366        /// If timecodes are available, allow the AVPlayerView controls to enter timecode mode. Default is NO.
367        #[unsafe(method(showsTimecodes))]
368        #[unsafe(method_family = none)]
369        pub unsafe fn showsTimecodes(&self) -> bool;
370
371        /// Setter for [`showsTimecodes`][Self::showsTimecodes].
372        #[unsafe(method(setShowsTimecodes:))]
373        #[unsafe(method_family = none)]
374        pub unsafe fn setShowsTimecodes(&self, shows_timecodes: bool);
375    );
376}
377
378/// The user selected the Trim button.
379///
380/// The user selected the Cancel button.
381///
382/// See also [Apple's documentation](https://developer.apple.com/documentation/avkit/avplayerviewtrimresult?language=objc)
383// NS_ENUM
384#[repr(transparent)]
385#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
386pub struct AVPlayerViewTrimResult(pub NSInteger);
387impl AVPlayerViewTrimResult {
388    #[doc(alias = "AVPlayerViewTrimOKButton")]
389    pub const OKButton: Self = Self(0);
390    #[doc(alias = "AVPlayerViewTrimCancelButton")]
391    pub const CancelButton: Self = Self(1);
392}
393
394unsafe impl Encode for AVPlayerViewTrimResult {
395    const ENCODING: Encoding = NSInteger::ENCODING;
396}
397
398unsafe impl RefEncode for AVPlayerViewTrimResult {
399    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
400}
401
402/// AVPlayerViewTrimming.
403#[cfg(feature = "objc2-app-kit")]
404#[cfg(target_os = "macos")]
405impl AVPlayerView {
406    extern_methods!(
407        /// Whether or not the current media can be trimmed.
408        #[unsafe(method(canBeginTrimming))]
409        #[unsafe(method_family = none)]
410        pub unsafe fn canBeginTrimming(&self) -> bool;
411
412        #[cfg(feature = "block2")]
413        /// Parameter `handler`: A completion handler that is executed when the user selects either the Trim or Cancel button in the trimming UI.
414        ///
415        /// Sets the controls panel into trimming mode and blocks until the user selects either the Trim or the Cancel button.
416        #[unsafe(method(beginTrimmingWithCompletionHandler:))]
417        #[unsafe(method_family = none)]
418        pub unsafe fn beginTrimmingWithCompletionHandler(
419            &self,
420            handler: Option<&block2::Block<dyn Fn(AVPlayerViewTrimResult)>>,
421        );
422    );
423}
424
425/// AVPlayerViewChapterIndicator.
426#[cfg(feature = "objc2-app-kit")]
427#[cfg(target_os = "macos")]
428impl AVPlayerView {
429    extern_methods!(
430        /// Parameter `chapterNumber`: The chapter number (required).
431        ///
432        /// Parameter `chapterTitle`: The chapter title (optional).
433        ///
434        /// Display the provided chapter number and title momentarily.
435        #[unsafe(method(flashChapterNumber:chapterTitle:))]
436        #[unsafe(method_family = none)]
437        pub unsafe fn flashChapterNumber_chapterTitle(
438            &self,
439            chapter_number: NSUInteger,
440            chapter_title: Option<&NSString>,
441        );
442    );
443}
444
445/// AVPlayerViewPictureInPictureSupport.
446#[cfg(feature = "objc2-app-kit")]
447#[cfg(target_os = "macos")]
448impl AVPlayerView {
449    extern_methods!(
450        /// Whether or not the receiver allows Picture in Picture playback. Default is NO.
451        #[unsafe(method(allowsPictureInPicturePlayback))]
452        #[unsafe(method_family = none)]
453        pub unsafe fn allowsPictureInPicturePlayback(&self) -> bool;
454
455        /// Setter for [`allowsPictureInPicturePlayback`][Self::allowsPictureInPicturePlayback].
456        #[unsafe(method(setAllowsPictureInPicturePlayback:))]
457        #[unsafe(method_family = none)]
458        pub unsafe fn setAllowsPictureInPicturePlayback(
459            &self,
460            allows_picture_in_picture_playback: bool,
461        );
462
463        /// A delegate for customizing Picture in Picture playback experience.
464        #[unsafe(method(pictureInPictureDelegate))]
465        #[unsafe(method_family = none)]
466        pub unsafe fn pictureInPictureDelegate(
467            &self,
468        ) -> Option<Retained<ProtocolObject<dyn AVPlayerViewPictureInPictureDelegate>>>;
469
470        /// This is a [weak property][objc2::topics::weak_property].
471        /// Setter for [`pictureInPictureDelegate`][Self::pictureInPictureDelegate].
472        #[unsafe(method(setPictureInPictureDelegate:))]
473        #[unsafe(method_family = none)]
474        pub unsafe fn setPictureInPictureDelegate(
475            &self,
476            picture_in_picture_delegate: Option<
477                &ProtocolObject<dyn AVPlayerViewPictureInPictureDelegate>,
478            >,
479        );
480    );
481}
482
483extern_protocol!(
484    /// A protocol for delegates of AVPlayerView.
485    ///
486    /// See also [Apple's documentation](https://developer.apple.com/documentation/avkit/avplayerviewdelegate?language=objc)
487    pub unsafe trait AVPlayerViewDelegate: NSObjectProtocol {
488        #[cfg(feature = "objc2-app-kit")]
489        #[cfg(target_os = "macos")]
490        /// Parameter `playerView`: The player view.
491        ///
492        /// The delegate can implement this method to be notified when the AVPlayerView will enter full screen.
493        #[optional]
494        #[unsafe(method(playerViewWillEnterFullScreen:))]
495        #[unsafe(method_family = none)]
496        unsafe fn playerViewWillEnterFullScreen(&self, player_view: &AVPlayerView);
497
498        #[cfg(feature = "objc2-app-kit")]
499        #[cfg(target_os = "macos")]
500        /// Parameter `playerView`: The player view.
501        ///
502        /// The delegate can implement this method to be notified when the AVPlayerView did enter full screen.
503        #[optional]
504        #[unsafe(method(playerViewDidEnterFullScreen:))]
505        #[unsafe(method_family = none)]
506        unsafe fn playerViewDidEnterFullScreen(&self, player_view: &AVPlayerView);
507
508        #[cfg(feature = "objc2-app-kit")]
509        #[cfg(target_os = "macos")]
510        /// Parameter `playerView`: The player view.
511        ///
512        /// The delegate can implement this method to be notified when the AVPlayerView will exit full screen.
513        #[optional]
514        #[unsafe(method(playerViewWillExitFullScreen:))]
515        #[unsafe(method_family = none)]
516        unsafe fn playerViewWillExitFullScreen(&self, player_view: &AVPlayerView);
517
518        #[cfg(feature = "objc2-app-kit")]
519        #[cfg(target_os = "macos")]
520        /// Parameter `playerView`: The player view.
521        ///
522        /// The delegate can implement this method to be notified when the AVPlayerView did exit full screen.
523        #[optional]
524        #[unsafe(method(playerViewDidExitFullScreen:))]
525        #[unsafe(method_family = none)]
526        unsafe fn playerViewDidExitFullScreen(&self, player_view: &AVPlayerView);
527
528        #[cfg(all(feature = "block2", feature = "objc2-app-kit"))]
529        #[cfg(target_os = "macos")]
530        /// Parameter `playerView`: The player view.
531        ///
532        /// Parameter `completionHandler`: The completion handler the delegate must call after restoring the interface for an exit full screen transition.
533        ///
534        /// The delegate can implement this method to restore the user interface before exiting fullscreen.
535        #[optional]
536        #[unsafe(method(playerView:restoreUserInterfaceForFullScreenExitWithCompletionHandler:))]
537        #[unsafe(method_family = none)]
538        unsafe fn playerView_restoreUserInterfaceForFullScreenExitWithCompletionHandler(
539            &self,
540            player_view: &AVPlayerView,
541            completion_handler: &block2::Block<dyn Fn(Bool)>,
542        );
543    }
544);
545
546extern_protocol!(
547    /// [Apple's documentation](https://developer.apple.com/documentation/avkit/avplayerviewpictureinpicturedelegate?language=objc)
548    pub unsafe trait AVPlayerViewPictureInPictureDelegate: NSObjectProtocol {
549        #[cfg(feature = "objc2-app-kit")]
550        #[cfg(target_os = "macos")]
551        /// Parameter `playerView`: The player view.
552        ///
553        /// Delegate can implement this method to be notified when Picture in Picture will start.
554        #[optional]
555        #[unsafe(method(playerViewWillStartPictureInPicture:))]
556        #[unsafe(method_family = none)]
557        unsafe fn playerViewWillStartPictureInPicture(&self, player_view: &AVPlayerView);
558
559        #[cfg(feature = "objc2-app-kit")]
560        #[cfg(target_os = "macos")]
561        /// Parameter `playerView`: The player view.
562        ///
563        /// Delegate can implement this method to be notified when Picture in Picture did start.
564        #[optional]
565        #[unsafe(method(playerViewDidStartPictureInPicture:))]
566        #[unsafe(method_family = none)]
567        unsafe fn playerViewDidStartPictureInPicture(&self, player_view: &AVPlayerView);
568
569        #[cfg(feature = "objc2-app-kit")]
570        #[cfg(target_os = "macos")]
571        /// Parameter `playerView`: The player view.
572        ///
573        /// Parameter `error`: An error describing why it failed.
574        ///
575        /// Delegate can implement this method to be notified when Picture in Picture failed to start.
576        #[optional]
577        #[unsafe(method(playerView:failedToStartPictureInPictureWithError:))]
578        #[unsafe(method_family = none)]
579        unsafe fn playerView_failedToStartPictureInPictureWithError(
580            &self,
581            player_view: &AVPlayerView,
582            error: &NSError,
583        );
584
585        #[cfg(feature = "objc2-app-kit")]
586        #[cfg(target_os = "macos")]
587        /// Parameter `playerView`: The player view.
588        ///
589        /// Delegate can implement this method to be notified when Picture in Picture will stop.
590        #[optional]
591        #[unsafe(method(playerViewWillStopPictureInPicture:))]
592        #[unsafe(method_family = none)]
593        unsafe fn playerViewWillStopPictureInPicture(&self, player_view: &AVPlayerView);
594
595        #[cfg(feature = "objc2-app-kit")]
596        #[cfg(target_os = "macos")]
597        /// Parameter `playerView`: The player view.
598        ///
599        /// Delegate can implement this method to be notified when Picture in Picture did stop.
600        #[optional]
601        #[unsafe(method(playerViewDidStopPictureInPicture:))]
602        #[unsafe(method_family = none)]
603        unsafe fn playerViewDidStopPictureInPicture(&self, player_view: &AVPlayerView);
604
605        #[cfg(all(feature = "block2", feature = "objc2-app-kit"))]
606        #[cfg(target_os = "macos")]
607        /// Parameter `playerView`: The player view.
608        ///
609        /// Parameter `completionHandler`: The completion handler the delegate needs to call after restore.
610        ///
611        /// Delegate can implement this method to restore the user interface before Picture in Picture stops.
612        #[optional]
613        #[unsafe(method(playerView:restoreUserInterfaceForPictureInPictureStopWithCompletionHandler:))]
614        #[unsafe(method_family = none)]
615        unsafe fn playerView_restoreUserInterfaceForPictureInPictureStopWithCompletionHandler(
616            &self,
617            player_view: &AVPlayerView,
618            completion_handler: &block2::Block<dyn Fn(Bool)>,
619        );
620
621        #[cfg(feature = "objc2-app-kit")]
622        #[cfg(target_os = "macos")]
623        /// Parameter `playerView`: The player view.
624        ///
625        /// Delegate can implement this method and return NO to prevent player view from automatically being miniaturized or losing focus when Picture in Picture starts.
626        #[optional]
627        #[unsafe(method(playerViewShouldAutomaticallyDismissAtPictureInPictureStart:))]
628        #[unsafe(method_family = none)]
629        unsafe fn playerViewShouldAutomaticallyDismissAtPictureInPictureStart(
630            &self,
631            player_view: &AVPlayerView,
632        ) -> bool;
633    }
634);