-
Notifications
You must be signed in to change notification settings - Fork 543
MediaPlayer iOS xcode26.0 b1
Alex Soto edited this page Jun 9, 2025
·
1 revision
#MediaPlayer.framework
diff -ruN /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaItem.h /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaItem.h
--- /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaItem.h 2025-04-19 03:59:16
+++ /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaItem.h 2025-05-25 02:11:13
@@ -250,5 +250,97 @@
@end
+//-----------------------------------------------------
+
+/// An animated image, such as an animated music album cover art, for a media item.
+///
+/// A single instance of animated artwork is comprised of two assets: an artwork video asset, and a
+/// preview image which should match the first frame of the artwork video. The preview image may be
+/// used when displaying the animated artwork whilst the video becomes available.
+///
+/// Both the preview image and artwork video can be fetched asynchronously and will only be
+/// requested when required at point of display. Aim to provide preview images as quickly as
+/// possible once requested, and ideally synchronously.
+///
+/// Video asset `URL`s you provide must be local file `URL`s. You should make the associated assets
+/// available locally before providing them via the relevant handler, for example by fetching the
+/// associated video asset over the network. The `URL`s should remain valid for the lifetime of the
+/// ``MPMediaItemAnimatedArtwork``, once provided.
+///
+/// ``MPMediaItemAnimatedArtwork`` should not be subclassed.
+MP_FINAL_CLASS
+MP_API(ios(19.0), tvos(19.0), macos(16.0), watchos(12.0), visionos(3.0))
+@interface MPMediaItemAnimatedArtwork : NSObject
+
+MP_INIT_UNAVAILABLE
+
+#if TARGET_OS_IPHONE
+
+/// Creates an animated artwork.
+///
+/// - Parameters:
+/// - artworkID: A unique identifier for this animated artwork. This identifier should encapsulate
+/// the identity of both the preview frame and video asset. If you change either, you should
+/// provide an ``MPMediaItemAnimatedArtwork`` with an updated `artworkID`.
+/// - previewImageRequestHandler: A handler to return a preview image for this artwork, for the
+/// requested `CGSize` in pixels. Once requested, you should pass the preview image to the
+/// provided completion handler, or you can pass `nil` if the preview image cannot be resolved
+/// for any reason. You can call the completion handler on an arbitrary queue, however it must
+/// only be called once. The `UIImage` you provide should ideally have a size equal to the
+/// requested `CGSize`, however an image of the same aspect ratio is acceptable. Images that
+/// diverge significantly from the requested aspect ratio may be rejected by the system. Aim to
+/// provide preview images quickly and ideally synchronously, and if possible you should preload
+/// these images in order to reduce perceived latency when displaying animated artwork to the
+/// user.
+/// - videoAssetFileURLRequestHandler: A handler to return a file `URL` for the artwork video
+/// asset for this artwork, for the requested `CGSize` in pixels. Once requested, you should pass
+/// the `URL` to the provided completion handler, or you can pass `nil` if the artwork video asset
+/// cannot be resolved for any reason. You can call the completion handler on an arbitrary queue,
+/// however it must only be called once. The `URL` you provide must reference a local asset,
+/// ideally with a size equal to the requested `CGSize`, however an asset with the same aspect
+/// ratio is acceptable. Assets that diverge significantly from the requested aspect ratio may be
+/// rejected by the system. The video assets you provide should loop cleanly, and should be
+/// available relatively quickly from this handler (particularly when re-fetched). It’s advised
+/// that assets are cached for subsequent fetches.
+- (instancetype)initWithArtworkID:(NSString *)artworkID
+ previewImageRequestHandler:(void (^)(CGSize size, void (^completion)(UIImage * _Nullable image)))previewImageRequestHandler
+ videoAssetFileURLRequestHandler:(void (^)(CGSize size, void (^completion)(NSURL * _Nullable url)))videoAssetFileURLRequestHandler MP_API(ios(19.0), tvos(19.0), watchos(12.0), visionos(3.0)) NS_DESIGNATED_INITIALIZER;
+
+#else
+
+/// Creates an animated artwork.
+///
+/// - Parameters:
+/// - artworkID: A unique identifier for this animated artwork. This identifier should encapsulate
+/// the identity of both the preview frame and video asset. If you change either, you should
+/// provide an ``MPMediaItemAnimatedArtwork`` with an updated `artworkID`.
+/// - previewImageRequestHandler: A handler to return a preview image for this artwork, for the
+/// requested `CGSize` in pixels. Once requested, you should pass the preview image to the
+/// provided completion handler, or you can pass `nil` if the preview image cannot be resolved
+/// for any reason. You can call the completion handler on an arbitrary queue, however it must
+/// only be called once. The `NSImage` you provide should ideally have a size equal to the
+/// requested `CGSize`, however an image of the same aspect ratio is acceptable. Images that
+/// diverge significantly from the requested aspect ratio may be rejected by the system. Aim to
+/// provide preview images quickly and ideally synchronously, and if possible you should preload
+/// these images in order to reduce perceived latency when displaying animated artwork to the
+/// user.
+/// - videoAssetFileURLRequestHandler: A handler to return a file `URL` for the artwork video
+/// asset for this artwork, for the requested `CGSize` in pixels. Once requested, you should pass
+/// the `URL` to the provided completion handler, or you can pass `nil` if the artwork video asset
+/// cannot be resolved for any reason. You can call the completion handler on an arbitrary queue,
+/// however it must only be called once. The `URL` you provide must reference a local asset,
+/// ideally with a size equal to the requested `CGSize`, however an asset with the same aspect
+/// ratio is acceptable. Assets that diverge significantly from the requested aspect ratio may be
+/// rejected by the system. The video assets you provide should loop cleanly, and should be
+/// available relatively quickly from this handler (particularly when re-fetched). It’s advised
+/// that assets are cached for subsequent fetches.
+- (instancetype)initWithArtworkID:(NSString *)artworkID
+ previewImageRequestHandler:(void (^)(CGSize size, void (^completion)(NSImage * _Nullable image)))previewImageRequestHandler
+ videoAssetFileURLRequestHandler:(void (^)(CGSize size, void (^completion)(NSURL * _Nullable url)))videoAssetFileURLRequestHandler MP_API(macos(16.0)) NS_DESIGNATED_INITIALIZER;
+
+#endif
+
+@end
+
NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MediaPlayer.framework/Headers/MPNowPlayingInfoCenter.h /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MediaPlayer.framework/Headers/MPNowPlayingInfoCenter.h
--- /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MediaPlayer.framework/Headers/MPNowPlayingInfoCenter.h 2025-04-19 03:53:42
+++ /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MediaPlayer.framework/Headers/MPNowPlayingInfoCenter.h 2025-05-25 08:45:35
@@ -69,6 +69,12 @@
/// not work as expected.
@property (nonatomic) MPNowPlayingPlaybackState playbackState MP_API(macos(10.12.2), ios(13.0), macCatalyst(13.0));
+/// Keys related to animated artwork that are supported by the current platform.
+///
+/// If you specify an instance of animated artwork (an `MPMediaItemAnimatedArtwork`) to
+/// `nowPlayingInfo` using any key not in this collection it will be ignored.
+@property (class, nonatomic, readonly) NSArray<NSString *> *supportedAnimatedArtworkKeys MP_API(ios(19.0), tvos(19.0), macos(16.0), watchos(12.0), visionos(3.0));
+
@end
// -----------------------------------------------------------------------------
@@ -177,5 +183,11 @@
// A boolean denoting whether the now playing item should be excluded from content suggestions.
MP_EXTERN NSString * const MPNowPlayingInfoPropertyExcludeFromSuggestions MP_API(ios(18.0), tvos(18.0), macos(15.0)); // NSNumber (BOOL)
+
+/// 1:1 (square) animated artwork for the current media item.
+MP_EXTERN NSString * const MPNowPlayingInfoProperty1x1AnimatedArtwork MP_API(ios(19.0), tvos(19.0), macos(16.0), watchos(12.0), visionos(3.0)); // MPMediaItemAnimatedArtwork
+
+/// 3:4 (tall) animated artwork for the current media item.
+MP_EXTERN NSString * const MPNowPlayingInfoProperty3x4AnimatedArtwork MP_API(ios(19.0), tvos(19.0), macos(16.0), watchos(12.0), visionos(3.0)); // MPMediaItemAnimatedArtwork
NS_ASSUME_NONNULL_END