diff --git a/src/avfoundation.cs b/src/avfoundation.cs index 6064b4873396..e96978d078e8 100644 --- a/src/avfoundation.cs +++ b/src/avfoundation.cs @@ -11736,6 +11736,10 @@ interface AVPlayerItem : NSCopying { [NoWatch] [Export ("appliesPerFrameHDRDisplayMetadata")] bool AppliesPerFrameHdrDisplayMetadata { get; set; } + + [TV (15, 0), NoWatch, NoMac, NoiOS, NoMacCatalyst] + [Export ("translatesPlayerInterstitialEvents")] + bool TranslatesPlayerInterstitialEvents { get; set; } } [Watch (7,4), TV (14,5), Mac (11,3), iOS (14,5)] diff --git a/src/avkit.cs b/src/avkit.cs index 22349dea9dd4..4a357efd38eb 100644 --- a/src/avkit.cs +++ b/src/avkit.cs @@ -34,6 +34,8 @@ using UIView = AppKit.NSView; using UIViewController = Foundation.NSObject; using UIWindow = Foundation.NSObject; +using UIAction = Foundation.NSObject; +using UIMenuElement = Foundation.NSObject; #endif // !MONOMAC namespace AVKit { @@ -52,8 +54,12 @@ interface AVPictureInPictureController bool IsPictureInPictureSupported { get; } [Export ("initWithPlayerLayer:")] - [DesignatedInitializer] IntPtr Constructor (AVPlayerLayer playerLayer); + + [TV (15,0), NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Export ("initWithContentSource:")] + [DesignatedInitializer] + IntPtr Constructor (AVPictureInPictureControllerContentSource contentSource); [Export ("playerLayer")] AVPlayerLayer PlayerLayer { get; } @@ -104,15 +110,23 @@ interface AVPictureInPictureController [Export ("requiresLinearPlayback")] bool RequiresLinearPlayback { get; set; } - [NoWatch, NoMac, NoiOS] + [NoWatch, NoMac, NoiOS, MacCatalyst (15,0)] [Export ("canStopPictureInPicture")] bool CanStopPictureInPicture { get; } [iOS (14,2)] - [NoWatch, NoTV, NoMac] - [NoMacCatalyst] + [NoWatch, NoTV, NoMac, MacCatalyst (15,0)] [Export ("canStartPictureInPictureAutomaticallyFromInline")] bool CanStartPictureInPictureAutomaticallyFromInline { get; set; } + + [TV (15,0), NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Export ("invalidatePlaybackState")] + void InvalidatePlaybackState (); + + [NullAllowed] + [TV (15,0), NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Export ("contentSource", ArgumentSemantic.Strong)] + AVPictureInPictureControllerContentSource ContentSource { get; set; } } interface IAVPictureInPictureControllerDelegate {} @@ -250,6 +264,7 @@ interface AVPlayerViewController { [NullAllowed] [NoiOS, TV (11, 0), NoWatch, NoMac] + [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'CustomInfoViewControllers' instead.")] [Export ("customInfoViewController", ArgumentSemantic.Assign)] UIViewController CustomInfoViewController { get; set; } @@ -270,10 +285,29 @@ interface AVPlayerViewController { bool ShowsTimecodes { get; set; } [iOS (14,2)] - [NoWatch, NoTV] - [NoMacCatalyst] + [NoWatch, NoTV, MacCatalyst (15,0)] [Export ("canStartPictureInPictureAutomaticallyFromInline")] bool CanStartPictureInPictureAutomaticallyFromInline { get; set; } + + [TV (15,0), NoWatch, NoMac, NoiOS, NoMacCatalyst] + [Export ("contextualActions", ArgumentSemantic.Copy)] + UIAction[] ContextualActions { get; set; } + + [TV (15,0), NoWatch, NoMac, NoiOS, NoMacCatalyst] + [Export ("infoViewActions", ArgumentSemantic.Copy)] + UIAction[] InfoViewActions { get; set; } + + [TV (15,0), NoWatch, NoMac, NoiOS, NoMacCatalyst] + [Export ("customInfoViewControllers", ArgumentSemantic.Copy)] + UIViewController[] CustomInfoViewControllers { get; set; } + + [TV (15,0), NoWatch, NoMac, NoiOS, NoMacCatalyst] + [Export ("transportBarCustomMenuItems", ArgumentSemantic.Copy)] + UIMenuElement[] TransportBarCustomMenuItems { get; set; } + + [TV (15,0), NoWatch, NoMac, NoiOS, NoMacCatalyst] + [Export ("transportBarIncludesTitleView")] + bool TransportBarIncludesTitleView { get; set; } } [NoMac] @@ -400,6 +434,10 @@ interface AVPlayerViewControllerDelegate [TV (13,0), NoiOS, NoWatch, NoMac] [Export ("previousChannelInterstitialViewControllerForPlayerViewController:")] UIViewController GetPreviousChannelInterstitialViewController (AVPlayerViewController playerViewController); + + [iOS (15,0), NoTV, NoMac, NoWatch, MacCatalyst (15,0)] + [Export ("playerViewController:restoreUserInterfaceForFullScreenExitWithCompletionHandler:")] + void RestoreUserInterfaceForFullScreenExit (AVPlayerViewController playerViewController, Action completionHandler); } [NoWatch, NoTV, NoMac, iOS (13,0)] @@ -497,6 +535,15 @@ interface AVPlayerView { [Mac (10,15)] [Export ("showsTimecodes")] bool ShowsTimecodes { get; set; } + + [Mac (12,0)] + [Wrap ("WeakDelegate")] + [Protocolize] + AVPlayerViewDelegate Delegate { get; set; } + + [Mac (12,0)] + [NullAllowed, Export ("delegate", ArgumentSemantic.Weak)] + NSObject WeakDelegate { get; set; } } interface IAVPlayerViewPictureInPictureDelegate {} @@ -684,7 +731,7 @@ interface AVRoutePickerView { UIColor ActiveTintColor { get; set; } [NoiOS] - [NoMac, NoWatch] + [NoMac, NoWatch, MacCatalyst (15,0)] [Export ("routePickerButtonStyle", ArgumentSemantic.Assign)] AVRoutePickerViewButtonStyle RoutePickerButtonStyle { get; set; } @@ -711,7 +758,7 @@ interface AVRoutePickerView { } [NoMac] - [TV (11,0), NoiOS] + [TV (11,0), NoiOS, MacCatalyst (15,0)] [Native] public enum AVRoutePickerViewButtonStyle : long { System, @@ -773,4 +820,105 @@ interface UIWindow_AVAdditions { [Export ("avDisplayManager")] AVDisplayManager GetAVDisplayManager (); } + + [NoTV, NoWatch, NoMac, iOS (15,0), MacCatalyst (15,0)] + [BaseType (typeof (UIViewController))] + interface AVPictureInPictureVideoCallViewController { + [DesignatedInitializer] + [Export ("initWithNibName:bundle:")] + IntPtr Constructor ([NullAllowed] string nibName, [NullAllowed] NSBundle bundle); + } + + [TV (15,0), NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [BaseType (typeof (NSObject))] + [DisableDefaultCtor] + interface AVPictureInPictureControllerContentSource + { + [Export ("initWithPlayerLayer:")] + IntPtr Constructor (AVPlayerLayer playerLayer); + + [NullAllowed, Export ("playerLayer")] + AVPlayerLayer PlayerLayer { get; } + + // interface AVPictureInPictureControllerContentSource_VideoCallSupport + [NoWatch, NoTV, NoMac] + [Export ("initWithActiveVideoCallSourceView:contentViewController:")] + IntPtr Constructor (UIView sourceView, AVPictureInPictureVideoCallViewController contentViewController); + + [NullAllowed] + [NoWatch, NoTV, NoMac] + [Export ("activeVideoCallSourceView", ArgumentSemantic.Weak)] + UIView ActiveVideoCallSourceView { get; } + + [NoWatch, NoTV, NoMac] + [Export ("activeVideoCallContentViewController")] + AVPictureInPictureVideoCallViewController ActiveVideoCallContentViewController { get; } + + // interface AVPictureInPictureControllerContentSource_AVSampleBufferDisplayLayerSupport + [Export ("initWithSampleBufferDisplayLayer:playbackDelegate:")] + IntPtr Constructor (AVSampleBufferDisplayLayer sampleBufferDisplayLayer, IAVPictureInPictureSampleBufferPlaybackDelegate playbackDelegate); + + [NullAllowed, Export ("sampleBufferDisplayLayer")] + AVSampleBufferDisplayLayer SampleBufferDisplayLayer { get; } + + [Wrap ("WeakSampleBufferPlaybackDelegate")] + [NullAllowed] + IAVPictureInPictureSampleBufferPlaybackDelegate SampleBufferPlaybackDelegate { get; } + + [NullAllowed, Export ("sampleBufferPlaybackDelegate", ArgumentSemantic.Weak)] + NSObject WeakSampleBufferPlaybackDelegate { get; } + } + + interface IAVPictureInPictureSampleBufferPlaybackDelegate {} + + [TV (15,0), NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Protocol, Model (AutoGeneratedName = true)] + [BaseType (typeof(NSObject))] + interface AVPictureInPictureSampleBufferPlaybackDelegate + { + [Abstract] + [Export ("pictureInPictureController:setPlaying:")] + void SetPlaying (AVPictureInPictureController pictureInPictureController, bool playing); + + [Abstract] + [Export ("pictureInPictureControllerTimeRangeForPlayback:")] + CMTimeRange GetTimeRange (AVPictureInPictureController pictureInPictureController); + + [Abstract] + [Export ("pictureInPictureControllerIsPlaybackPaused:")] + bool IsPlaybackPaused (AVPictureInPictureController pictureInPictureController); + + [Abstract] + [Export ("pictureInPictureController:didTransitionToRenderSize:")] + void DidTransitionToRenderSize (AVPictureInPictureController pictureInPictureController, CMVideoDimensions newRenderSize); + + [Abstract] + [Export ("pictureInPictureController:skipByInterval:completionHandler:")] + void SkipByInterval (AVPictureInPictureController pictureInPictureController, CMTime skipInterval, Action completionHandler); + + [Export ("pictureInPictureControllerShouldProhibitBackgroundAudioPlayback:")] + bool ShouldProhibitBackgroundAudioPlayback (AVPictureInPictureController pictureInPictureController); + } + + [Mac (12,0), NoiOS, NoTV, NoMacCatalyst] + [Protocol, Model (AutoGeneratedName = true)] + [BaseType (typeof(NSObject))] + interface AVPlayerViewDelegate + { + [Export ("playerViewWillEnterFullScreen:")] + void WillEnterFullScreen (AVPlayerView playerView); + + [Export ("playerViewDidEnterFullScreen:")] + void DidEnterFullScreen (AVPlayerView playerView); + + [Export ("playerViewWillExitFullScreen:")] + void WillExitFullScreen (AVPlayerView playerView); + + [Export ("playerViewDidExitFullScreen:")] + void DidExitFullScreen (AVPlayerView playerView); + + [Export ("playerView:restoreUserInterfaceForFullScreenExitWithCompletionHandler:")] + void RestoreUserInterfaceForFullScreenExit (AVPlayerView playerView, Action completionHandler); + } + } diff --git a/tests/xtro-sharpie/MacCatalyst-AVKit.todo b/tests/xtro-sharpie/MacCatalyst-AVKit.todo deleted file mode 100644 index 714e65288c9a..000000000000 --- a/tests/xtro-sharpie/MacCatalyst-AVKit.todo +++ /dev/null @@ -1,26 +0,0 @@ -!missing-enum! AVRoutePickerViewButtonStyle not bound -!missing-selector! AVPictureInPictureController::canStopPictureInPicture not bound -!missing-selector! AVRoutePickerView::routePickerButtonStyle not bound -!missing-selector! AVRoutePickerView::setRoutePickerButtonStyle: not bound -## appended from unclassified file -!extra-designated-initializer! AVPictureInPictureController::initWithPlayerLayer: is incorrectly decorated with an [DesignatedInitializer] attribute -!missing-protocol! AVPictureInPictureSampleBufferPlaybackDelegate not bound -!missing-protocol-member! AVPlayerViewControllerDelegate::playerViewController:restoreUserInterfaceForFullScreenExitWithCompletionHandler: not found -!missing-selector! AVPictureInPictureController::canStartPictureInPictureAutomaticallyFromInline not bound -!missing-selector! AVPictureInPictureController::contentSource not bound -!missing-selector! AVPictureInPictureController::initWithContentSource: not bound -!missing-selector! AVPictureInPictureController::setCanStartPictureInPictureAutomaticallyFromInline: not bound -!missing-selector! AVPictureInPictureController::setContentSource: not bound -!missing-selector! AVPictureInPictureControllerAVPictureInPictureController::invalidatePlaybackState not bound -!missing-selector! AVPictureInPictureControllerContentSource::activeVideoCallContentViewController not bound -!missing-selector! AVPictureInPictureControllerContentSource::activeVideoCallSourceView not bound -!missing-selector! AVPictureInPictureControllerContentSource::initWithActiveVideoCallSourceView:contentViewController: not bound -!missing-selector! AVPictureInPictureControllerContentSource::initWithPlayerLayer: not bound -!missing-selector! AVPictureInPictureControllerContentSource::initWithSampleBufferDisplayLayer:playbackDelegate: not bound -!missing-selector! AVPictureInPictureControllerContentSource::playerLayer not bound -!missing-selector! AVPictureInPictureControllerContentSource::sampleBufferDisplayLayer not bound -!missing-selector! AVPictureInPictureControllerContentSource::sampleBufferPlaybackDelegate not bound -!missing-selector! AVPlayerViewController::canStartPictureInPictureAutomaticallyFromInline not bound -!missing-selector! AVPlayerViewController::setCanStartPictureInPictureAutomaticallyFromInline: not bound -!missing-type! AVPictureInPictureControllerContentSource not bound -!missing-type! AVPictureInPictureVideoCallViewController not bound diff --git a/tests/xtro-sharpie/iOS-AVKit.todo b/tests/xtro-sharpie/iOS-AVKit.todo deleted file mode 100644 index 9dbc5f72f10e..000000000000 --- a/tests/xtro-sharpie/iOS-AVKit.todo +++ /dev/null @@ -1,17 +0,0 @@ -!extra-designated-initializer! AVPictureInPictureController::initWithPlayerLayer: is incorrectly decorated with an [DesignatedInitializer] attribute -!missing-protocol! AVPictureInPictureSampleBufferPlaybackDelegate not bound -!missing-protocol-member! AVPlayerViewControllerDelegate::playerViewController:restoreUserInterfaceForFullScreenExitWithCompletionHandler: not found -!missing-selector! AVPictureInPictureController::contentSource not bound -!missing-selector! AVPictureInPictureController::initWithContentSource: not bound -!missing-selector! AVPictureInPictureController::setContentSource: not bound -!missing-selector! AVPictureInPictureControllerAVPictureInPictureController::invalidatePlaybackState not bound -!missing-selector! AVPictureInPictureControllerContentSource::activeVideoCallContentViewController not bound -!missing-selector! AVPictureInPictureControllerContentSource::activeVideoCallSourceView not bound -!missing-selector! AVPictureInPictureControllerContentSource::initWithActiveVideoCallSourceView:contentViewController: not bound -!missing-selector! AVPictureInPictureControllerContentSource::initWithPlayerLayer: not bound -!missing-selector! AVPictureInPictureControllerContentSource::initWithSampleBufferDisplayLayer:playbackDelegate: not bound -!missing-selector! AVPictureInPictureControllerContentSource::playerLayer not bound -!missing-selector! AVPictureInPictureControllerContentSource::sampleBufferDisplayLayer not bound -!missing-selector! AVPictureInPictureControllerContentSource::sampleBufferPlaybackDelegate not bound -!missing-type! AVPictureInPictureControllerContentSource not bound -!missing-type! AVPictureInPictureVideoCallViewController not bound diff --git a/tests/xtro-sharpie/macOS-AVKit.todo b/tests/xtro-sharpie/macOS-AVKit.todo deleted file mode 100644 index cf420002ab24..000000000000 --- a/tests/xtro-sharpie/macOS-AVKit.todo +++ /dev/null @@ -1,15 +0,0 @@ -!extra-designated-initializer! AVPictureInPictureController::initWithPlayerLayer: is incorrectly decorated with an [DesignatedInitializer] attribute -!missing-protocol! AVPictureInPictureSampleBufferPlaybackDelegate not bound -!missing-protocol! AVPlayerViewDelegate not bound -!missing-selector! AVPictureInPictureController::contentSource not bound -!missing-selector! AVPictureInPictureController::initWithContentSource: not bound -!missing-selector! AVPictureInPictureController::setContentSource: not bound -!missing-selector! AVPictureInPictureControllerAVPictureInPictureController::invalidatePlaybackState not bound -!missing-selector! AVPictureInPictureControllerContentSource::initWithPlayerLayer: not bound -!missing-selector! AVPictureInPictureControllerContentSource::initWithSampleBufferDisplayLayer:playbackDelegate: not bound -!missing-selector! AVPictureInPictureControllerContentSource::playerLayer not bound -!missing-selector! AVPictureInPictureControllerContentSource::sampleBufferDisplayLayer not bound -!missing-selector! AVPictureInPictureControllerContentSource::sampleBufferPlaybackDelegate not bound -!missing-selector! AVPlayerView::delegate not bound -!missing-selector! AVPlayerView::setDelegate: not bound -!missing-type! AVPictureInPictureControllerContentSource not bound diff --git a/tests/xtro-sharpie/tvOS-AVKit.todo b/tests/xtro-sharpie/tvOS-AVKit.todo deleted file mode 100644 index 106bdaf3b1fd..000000000000 --- a/tests/xtro-sharpie/tvOS-AVKit.todo +++ /dev/null @@ -1,26 +0,0 @@ -!deprecated-attribute-missing! AVPlayerViewController::customInfoViewController missing a [Deprecated] attribute -!deprecated-attribute-missing! AVPlayerViewController::setCustomInfoViewController: missing a [Deprecated] attribute -!extra-designated-initializer! AVPictureInPictureController::initWithPlayerLayer: is incorrectly decorated with an [DesignatedInitializer] attribute -!missing-protocol! AVPictureInPictureSampleBufferPlaybackDelegate not bound -!missing-selector! AVPictureInPictureController::contentSource not bound -!missing-selector! AVPictureInPictureController::initWithContentSource: not bound -!missing-selector! AVPictureInPictureController::setContentSource: not bound -!missing-selector! AVPictureInPictureControllerAVPictureInPictureController::invalidatePlaybackState not bound -!missing-selector! AVPictureInPictureControllerContentSource::initWithPlayerLayer: not bound -!missing-selector! AVPictureInPictureControllerContentSource::initWithSampleBufferDisplayLayer:playbackDelegate: not bound -!missing-selector! AVPictureInPictureControllerContentSource::playerLayer not bound -!missing-selector! AVPictureInPictureControllerContentSource::sampleBufferDisplayLayer not bound -!missing-selector! AVPictureInPictureControllerContentSource::sampleBufferPlaybackDelegate not bound -!missing-selector! AVPlayerItem::setTranslatesPlayerInterstitialEvents: not bound -!missing-selector! AVPlayerItem::translatesPlayerInterstitialEvents not bound -!missing-selector! AVPlayerViewController::contextualActions not bound -!missing-selector! AVPlayerViewController::customInfoViewControllers not bound -!missing-selector! AVPlayerViewController::setContextualActions: not bound -!missing-selector! AVPlayerViewController::setCustomInfoViewControllers: not bound -!missing-selector! AVPlayerViewController::setTransportBarCustomMenuItems: not bound -!missing-selector! AVPlayerViewController::setTransportBarIncludesTitleView: not bound -!missing-selector! AVPlayerViewController::transportBarCustomMenuItems not bound -!missing-selector! AVPlayerViewController::transportBarIncludesTitleView not bound -!missing-type! AVPictureInPictureControllerContentSource not bound -!missing-selector! AVPlayerViewController::infoViewActions not bound -!missing-selector! AVPlayerViewController::setInfoViewActions: not bound