Skip to content
5 changes: 5 additions & 0 deletions src/avfoundation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
using CoreVideo;
using UniformTypeIdentifiers;
using ImageIO;
using MediaPlayer;
using System;

#if MONOMAC
Expand Down Expand Up @@ -12392,6 +12393,10 @@ interface AVPlayerItem : NSCopying {
[TV (15, 0), NoWatch, NoMac, NoiOS, NoMacCatalyst]
[Export ("translatesPlayerInterstitialEvents")]
bool TranslatesPlayerInterstitialEvents { get; set; }

[Watch (9, 0), TV (16, 0), Mac (13, 0), iOS (16, 0)]
[NullAllowed, Export ("nowPlayingInfo", ArgumentSemantic.Copy)]
NSDictionary<NSString, NSObject> NowPlayingInfo { get; set; }
}

[Watch (7,4), TV (14,5), Mac (11,3), iOS (14,5)]
Expand Down
45 changes: 40 additions & 5 deletions src/mediaplayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using CoreFoundation;
using CoreGraphics;
using CoreLocation;
using CoreMedia;
#if MONOMAC
using AppKit;
#else
Expand Down Expand Up @@ -285,6 +286,7 @@ interface MPMediaItemArtwork {

[NoMac]
[Deprecated (PlatformName.iOS, 10, 0)]
[Deprecated (PlatformName.TvOS, 10, 0)]
[Export ("initWithImage:")]
NativeHandle Constructor (UIImage image);

Expand All @@ -297,6 +299,7 @@ interface MPMediaItemArtwork {

[NoMac]
[Deprecated (PlatformName.iOS, 10, 0)]
[Deprecated (PlatformName.TvOS, 10, 0)]
[Export ("imageCropRect")]
CGRect ImageCropRectangle { get; }
}
Expand Down Expand Up @@ -768,7 +771,7 @@ interface MPMoviePlayerTimedMetadataEventArgs {
[NoMac]
#if NET
[NoWatch] // marked as unavailable in xcode 12 beta 1
[NoTV]
[TV (16,0)]
#else
[Watch (5,0)]
[Obsoleted (PlatformName.TvOS, 14,0, message: "Removed in Xcode 12.")]
Expand Down Expand Up @@ -1306,6 +1309,7 @@ interface MPVolumeView {
NativeHandle Constructor (CGRect frame);

[Deprecated (PlatformName.iOS, 13, 0, message: "Use 'AVRoutePickerView' instead.")]
[Deprecated (PlatformName.TvOS, 13, 0, message: "Use 'AVRoutePickerView' instead.")]
[Export ("showsRouteButton")]
bool ShowsRouteButton { get; set; }

Expand Down Expand Up @@ -1342,25 +1346,30 @@ interface MPVolumeView {
CGRect GetVolumeThumbRect (CGRect bounds, CGRect columeSliderRect, float /* float, not CGFloat */ value);

[Deprecated (PlatformName.iOS, 13, 0, message: "Use 'AVRoutePickerView.RoutePickerButtonStyle' instead.")]
[Deprecated (PlatformName.TvOS, 13, 0, message: "Use 'AVRoutePickerView.RoutePickerButtonStyle' instead.")]
[Export ("setRouteButtonImage:forState:")]
void SetRouteButtonImage ([NullAllowed] UIImage image, UIControlState state);

[Deprecated (PlatformName.iOS, 13, 0, message: "See 'AVRoutePickerView' for possible replacements.")]
[Deprecated (PlatformName.TvOS, 13, 0, message: "See 'AVRoutePickerView' for possible replacements.")]
[return: NullAllowed]
[Export ("routeButtonImageForState:")]
UIImage GetRouteButtonImage (UIControlState state);

[Deprecated (PlatformName.iOS, 13, 0, message: "See 'AVRoutePickerView' for possible replacements.")]
[Deprecated (PlatformName.TvOS, 13, 0, message: "See 'AVRoutePickerView' for possible replacements.")]
[Export ("routeButtonRectForBounds:")]
CGRect GetRouteButtonRect (CGRect bounds);

[iOS (7,0)]
[Deprecated (PlatformName.iOS, 13, 0, message: "Use 'AVRouteDetector.MultipleRoutesDetected' instead.")]
[Deprecated (PlatformName.TvOS, 13, 0, message: "Use 'AVRouteDetector.MultipleRoutesDetected' instead.")]
[Export ("wirelessRoutesAvailable")]
bool AreWirelessRoutesAvailable { [Bind ("areWirelessRoutesAvailable")] get; }

[iOS (7,0)]
[Deprecated (PlatformName.iOS, 13, 0, message: "Use 'AVPlayer.ExternalPlaybackActive' instead.")]
[Deprecated (PlatformName.TvOS, 13, 0, message: "Use 'AVPlayer.ExternalPlaybackActive' instead.")]
[Export ("wirelessRouteActive")]
bool IsWirelessRouteActive { [Bind ("isWirelessRouteActive")] get; }

Expand Down Expand Up @@ -1499,6 +1508,14 @@ interface MPNowPlayingInfoCenter {
[Internal]
[Field ("MPNowPlayingInfoPropertyCurrentPlaybackDate")]
NSString PropertyCurrentPlaybackDate { get; }

[TV (16, 0), Mac (13, 0), iOS (16, 0), MacCatalyst (16,0), Watch (9,0)]
[Field ("MPNowPlayingInfoPropertyAdTimeRanges")]
NSString PropertyAdTimeRanges { get; }

[TV (16, 0), Mac (13, 0), iOS (16, 0), MacCatalyst (16,0), Watch (9,0)]
[Field ("MPNowPlayingInfoPropertyCreditsStartTime")]
NSString MPNowPlayingInfoPropertyCreditsStartTime { get; }
}

[Mac (10,12,2)]
Expand Down Expand Up @@ -2280,8 +2297,8 @@ interface AVMediaSelectionGroup_MPNowPlayingInfoLanguageOptionAdditions {

interface IMPNowPlayingSessionDelegate {}

[TV (14,0)]
[NoWatch, NoMac, NoiOS]
[TV (14,0), iOS (16,0)]
[NoWatch, NoMac, NoMacCatalyst]
#if NET
[Protocol, Model]
#else
Expand All @@ -2297,8 +2314,8 @@ interface MPNowPlayingSessionDelegate {
void DidChangeCanBecomeActive (MPNowPlayingSession nowPlayingSession);
}

[TV (14,0)]
[NoWatch, NoMac, NoiOS]
[TV (14,0), iOS (16,0)]
[NoWatch, NoMac, NoMacCatalyst]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface MPNowPlayingSession {
Expand Down Expand Up @@ -2337,5 +2354,23 @@ interface MPNowPlayingSession {

[Export ("removePlayer:")]
void RemovePlayer (AVPlayer player);

[TV (16, 0), NoWatch, NoMacCatalyst, NoMac]
[Export ("automaticallyPublishNowPlayingInfo")]
bool AutomaticallyPublishNowPlayingInfo { get; set; }
}

[TV (16,0), NoWatch, NoMacCatalyst, NoMac, iOS (16,0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface MPAdTimeRange : NSCopying
{
[Export ("timeRange", ArgumentSemantic.Assign)]
CMTimeRange TimeRange { get; set; }

[Export ("initWithTimeRange:")]
NativeHandle Constructor (CMTimeRange timeRange);
}


}
23 changes: 0 additions & 23 deletions tests/xtro-sharpie/api-annotations-dotnet/iOS-MediaPlayer.todo

This file was deleted.

This file was deleted.

21 changes: 0 additions & 21 deletions tests/xtro-sharpie/api-annotations-dotnet/tvOS-MediaPlayer.todo

This file was deleted.

23 changes: 0 additions & 23 deletions tests/xtro-sharpie/iOS-MediaPlayer.todo

This file was deleted.

4 changes: 0 additions & 4 deletions tests/xtro-sharpie/macOS-MediaPlayer.todo

This file was deleted.

10 changes: 0 additions & 10 deletions tests/xtro-sharpie/tvOS-MediaPlayer.todo

This file was deleted.

4 changes: 0 additions & 4 deletions tests/xtro-sharpie/watchOS-MediaPlayer.todo

This file was deleted.