peachsim 0.1.1808 → 0.1.1812

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (236) hide show
  1. package/README.md +4 -2
  2. package/cli/app-bundle-resources.ts +15 -2
  3. package/cli/cloud-box-artifact.ts +115 -0
  4. package/cli/cloud-client.ts +148 -76
  5. package/cli/cloud-dispatch.ts +4 -4
  6. package/cli/cloud-session.ts +60 -22
  7. package/cli/commands/box.ts +8 -2
  8. package/cli/commands/compat.ts +7 -4
  9. package/cli/commands/control.ts +69 -3
  10. package/cli/commands/coverage.ts +14 -4
  11. package/cli/commands/daemon.ts +41 -0
  12. package/cli/commands/no-bridge-hint.ts +9 -0
  13. package/cli/commands/package.ts +31 -56
  14. package/cli/commands/platform.ts +71 -60
  15. package/cli/commands/preview.ts +73 -24
  16. package/cli/commands/record.ts +10 -2
  17. package/cli/commands/screenshot.ts +17 -60
  18. package/cli/commands/setup.ts +3 -1
  19. package/cli/commands/three-mode.ts +22 -12
  20. package/cli/commands/upload.ts +2 -1
  21. package/cli/desktop-companion.ts +6 -1
  22. package/cli/drivers/desktop.ts +4 -1
  23. package/cli/main.ts +12 -2
  24. package/cli/metro-bundle-assets.ts +14 -4
  25. package/cli/outbound-endpoints.ts +7 -3
  26. package/cli/output-redaction.ts +38 -0
  27. package/cli/privacy.ts +2 -2
  28. package/cli/recording-access.ts +5 -0
  29. package/cli/remote-project-bundle.ts +83 -0
  30. package/cli/shell-init.ts +7 -11
  31. package/cli/telemetry.ts +41 -4
  32. package/cli/usage-error.ts +3 -0
  33. package/cli/ws-bridge.ts +42 -6
  34. package/dist-lib/agent-daemon-client.cjs +1 -1
  35. package/dist-lib/agent-events.cjs +1 -1
  36. package/dist-lib/attached-projects.cjs +1 -1
  37. package/dist-lib/auth/shared-session.cjs +1 -1
  38. package/dist-lib/backend-origin.cjs +1 -1
  39. package/dist-lib/beta.cjs +1 -1
  40. package/dist-lib/beta.mjs +1 -1
  41. package/dist-lib/bridge-constants.cjs +1 -1
  42. package/dist-lib/bridge-contract-input.cjs +1 -1
  43. package/dist-lib/bridge-contract-input.mjs +1 -1
  44. package/dist-lib/bridge-contract.cjs +1 -1
  45. package/dist-lib/bridge-contract.mjs +1 -1
  46. package/dist-lib/bundle-channel.cjs +42897 -40755
  47. package/dist-lib/capture-contract.cjs +7 -8
  48. package/dist-lib/capture-contract.mjs +7 -8
  49. package/dist-lib/cloud-contract.cjs +1 -1
  50. package/dist-lib/cloud-contract.mjs +1 -1
  51. package/dist-lib/cloud-test-args.cjs +1 -1
  52. package/dist-lib/cloud-test-args.mjs +1 -1
  53. package/dist-lib/cloud.cjs +1 -1
  54. package/dist-lib/cloud.mjs +1 -1
  55. package/dist-lib/config.cjs +1 -1
  56. package/dist-lib/config.mjs +1 -1
  57. package/dist-lib/detox/index.cjs +13 -7
  58. package/dist-lib/dev-bundle-resolution.cjs +10 -4
  59. package/dist-lib/expo-swift-bundle.cjs +15889 -15553
  60. package/dist-lib/expo-swift-metadata.cjs +2 -1
  61. package/dist-lib/expo-swift-metadata.mjs +2 -1
  62. package/dist-lib/home-paths.cjs +2 -33
  63. package/dist-lib/host/bridge-host.cjs +20891 -18714
  64. package/dist-lib/host/fetch-proxy-handler.cjs +10 -11
  65. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  66. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  67. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  68. package/dist-lib/host/websocket-proxy.cjs +1 -1
  69. package/dist-lib/index.cjs +620 -553
  70. package/dist-lib/jump-to-source-babel.cjs +1 -1
  71. package/dist-lib/jump-to-source-native.cjs +1 -1
  72. package/dist-lib/kotlin-host.cjs +1 -1
  73. package/dist-lib/menu.cjs +1 -1
  74. package/dist-lib/menu.mjs +1 -1
  75. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  76. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  77. package/dist-lib/metro-production-bundle.cjs +1 -1
  78. package/dist-lib/metro-production-bundle.mjs +1 -1
  79. package/dist-lib/metro.cjs +57 -28
  80. package/dist-lib/native-app-identity-project.cjs +47 -14
  81. package/dist-lib/native-app-identity-project.mjs +55 -20
  82. package/dist-lib/native-app-identity.cjs +1 -1
  83. package/dist-lib/native-app-identity.mjs +1 -1
  84. package/dist-lib/native-firebase-metadata.cjs +1 -1
  85. package/dist-lib/native-firebase-metadata.mjs +1 -1
  86. package/dist-lib/pdfium-raster.cjs +1 -1
  87. package/dist-lib/pdfium-raster.mjs +1 -1
  88. package/dist-lib/plist.cjs +1 -1
  89. package/dist-lib/plist.mjs +1 -1
  90. package/dist-lib/profiles.cjs +1 -1
  91. package/dist-lib/public-brand.cjs +1 -1
  92. package/dist-lib/public-origins-lib-esm.json +27 -26
  93. package/dist-lib/public-origins-lib.json +104 -81
  94. package/dist-lib/react-native-host-modules.cjs +1 -1
  95. package/dist-lib/react-native-host-modules.mjs +1 -1
  96. package/dist-lib/reap-browser.cjs +1 -1
  97. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  98. package/dist-lib/sdk.cjs +1 -1
  99. package/dist-lib/sdk.mjs +1 -1
  100. package/dist-lib/skills.cjs +30700 -24410
  101. package/dist-lib/swift-compile.cjs +336 -222
  102. package/dist-lib/swift-compile.mjs +378 -263
  103. package/dist-lib/swift-package.cjs +19 -7
  104. package/dist-lib/swift-package.mjs +16 -6
  105. package/dist-lib/swift-submit.cjs +1 -1
  106. package/dist-lib/swift-submit.mjs +1 -1
  107. package/dist-lib/swift-toolchain.cjs +49 -1
  108. package/dist-lib/swift.cjs +1 -1
  109. package/dist-lib/vite-swift.cjs +19213 -18937
  110. package/dist-lib/vite.cjs +11 -12
  111. package/dist-lib/worklet-executable.cjs +1 -1
  112. package/dist-lib/worklet-executable.mjs +1 -1
  113. package/dist-types/packages/peach-engine/src/engine/animated.d.ts +4 -0
  114. package/dist-types/packages/peach-engine/src/engine/animation-graph.d.ts +1 -0
  115. package/dist-types/packages/peach-engine/src/engine/expo-manifest.d.ts +1 -0
  116. package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +1 -1
  117. package/dist-types/packages/peach-engine/src/preview/upload-protocol.d.ts +1 -0
  118. package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +8 -1
  119. package/dist-types/packages/peach-globals/src/electronBridgeContract.d.ts +2 -1
  120. package/dist-types/packages/peach-kit/src/capabilities.d.ts +1 -0
  121. package/kotlin/sdk.tar.gz +0 -0
  122. package/package.json +1 -1
  123. package/runtime-companion.json +1 -1
  124. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCall.h +1 -1
  125. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCallCenter.h +1 -1
  126. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCarrier.h +1 -1
  127. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTSubscriber.h +1 -1
  128. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTSubscriberInfo.h +1 -1
  129. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h +1 -1
  130. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSDictionary.h +1 -1
  131. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSExtensionItem.h +1 -1
  132. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/AVFoundation+MPNowPlayingInfoLanguageOptionAdditions.h +39 -0
  133. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/AVPlayerItem+MediaPlayerAdditions.h +26 -0
  134. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPContentItem.h +67 -0
  135. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPError.h +33 -0
  136. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaEntity.h +53 -0
  137. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaItem.h +346 -0
  138. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaItemCollection.h +42 -0
  139. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaLibrary.h +76 -0
  140. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaPickerController.h +64 -0
  141. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaPlayback.h +47 -0
  142. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaPlaylist.h +82 -0
  143. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaQuery.h +120 -0
  144. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaQuerySection.h +26 -0
  145. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMoviePlayerController.h +444 -0
  146. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMoviePlayerViewController.h +43 -0
  147. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMusicPlayerApplicationController.h +47 -0
  148. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMusicPlayerController.h +147 -0
  149. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMusicPlayerQueueDescriptor.h +75 -0
  150. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPNowPlayingInfoCenter.h +197 -0
  151. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPNowPlayingInfoLanguageOption.h +107 -0
  152. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPNowPlayingSession.h +89 -0
  153. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPPlayableContentDataSource.h +59 -0
  154. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPPlayableContentDelegate.h +64 -0
  155. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPPlayableContentManager.h +46 -0
  156. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPPlayableContentManagerContext.h +32 -0
  157. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPRemoteCommand.h +143 -0
  158. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPRemoteCommandCenter.h +66 -0
  159. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPRemoteCommandEvent.h +128 -0
  160. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPRemoteControlTypes.h +27 -0
  161. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPVolumeSettings.h +20 -0
  162. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPVolumeView.h +82 -0
  163. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MediaPlayer.apinotes +74 -0
  164. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MediaPlayer.h +40 -0
  165. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MediaPlayerDefines.h +84 -0
  166. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/NSUserActivity+MediaPlayerAdditions.h +20 -0
  167. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Modules/module.modulemap +5 -0
  168. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityCustomRotor.h +2 -2
  169. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIAction.h +1 -1
  170. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIBackgroundConfiguration.h +1 -1
  171. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIButtonConfiguration.h +1 -1
  172. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIContextMenuConfiguration.h +1 -1
  173. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIContextMenuInteraction.h +1 -1
  174. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDeferredMenuElement.h +1 -1
  175. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIMenu.h +1 -1
  176. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPointerStyle.h +5 -5
  177. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISlider.h +1 -1
  178. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISplitViewController.h +12 -50
  179. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISplitViewControllerLayoutEnvironment.h +2 -8
  180. package/sdk/ios/System/Library/Frameworks/UIKitTypes.framework/Headers/UIKitTypes.h +62 -0
  181. package/sdk/ios/usr/include/dispatch.modulemap +22 -0
  182. package/sdk/ios/usr/include/module.modulemap +8 -3
  183. package/sdk/ios/usr/include/net/if.h +24 -0
  184. package/sdk/ios/usr/include/sys/time.h +1 -1
  185. package/sdk/ios/usr/lib/swift/Foundation.swiftmodule/arm64-apple-ios-simulator.swiftinterface +265 -0
  186. package/sdk/ios/usr/lib/swift/ObjectiveC.swiftmodule/arm64-apple-ios-simulator.swiftinterface +2 -0
  187. package/sdk/ios/wasm/include/fcntl.h +2 -0
  188. package/sdk/ios/wasm/include/pthread.h +3 -0
  189. package/sdk/ios/wasm/include/stdlib.h +2 -0
  190. package/sdk/ios/wasm/include/unistd.h +2 -2
  191. package/skills/contrast/SKILL.md +2 -2
  192. package/src/bundle-channel.mjs +9 -72
  193. package/src/capture-contract.ts +12 -9
  194. package/src/desktop-host-delivery.ts +16 -2
  195. package/src/dev-bundle-resolution.ts +12 -3
  196. package/src/expo-native-workspace.ts +113 -46
  197. package/src/expo-swift-host.ts +17 -12
  198. package/src/expo-swift-ready.ts +4 -1
  199. package/src/expoSwiftContract.ts +1 -0
  200. package/src/home-paths.ts +4 -48
  201. package/src/host/bridge-host.ts +1 -0
  202. package/src/installed-native-libraries.ts +2 -8
  203. package/src/metro-project-root.ts +2 -1
  204. package/src/native-bundles.ts +122 -0
  205. package/src/native-static-libraries.ts +65 -8
  206. package/src/nitro-adapter.lock.json +272 -272
  207. package/src/nitro-bundle.ts +2 -2
  208. package/src/nitro-compile.ts +68 -28
  209. package/src/nitro-source.ts +24 -6
  210. package/src/nitro-superset.lock.json +94 -34
  211. package/src/nitroContract.ts +3 -0
  212. package/src/podspec-sources.ts +1966 -0
  213. package/src/storageSnapshotContract.ts +40 -0
  214. package/src/swift-compile.ts +77 -26
  215. package/src/swift-design-time.ts +18 -1
  216. package/src/swift-distribution.lock.json +12 -12
  217. package/src/swift-distribution.ts +9 -6
  218. package/src/swift-host.ts +1 -2
  219. package/src/swift-link-roots.ts +13 -2
  220. package/src/swift-objc-compile.ts +12 -0
  221. package/src/swift-objc-standin.ts +321 -114
  222. package/src/swift-package-manifest.ts +4 -3
  223. package/src/swift-package.ts +31 -4
  224. package/src/swift-root-lock.ts +11 -0
  225. package/src/swift-shared-sdk.ts +10 -9
  226. package/src/swift-source-pods.ts +2 -2
  227. package/src/swift-standins.ts +40 -143
  228. package/src/swift-toolchain.ts +59 -0
  229. package/src/swift-wasm-prune.ts +53 -21
  230. package/src/turbo-bundle.ts +4 -5
  231. package/src/turbo-codegen-intake.ts +111 -108
  232. package/src/turbo-compile.ts +63 -33
  233. package/src/turbo-runtime.lock.json +22 -22
  234. package/src/turbo-source.ts +171 -76
  235. package/src/wasm-optimize.ts +31 -2
  236. package/src/xcode-project.ts +65 -15
@@ -0,0 +1,346 @@
1
+ //
2
+ // MPMediaItem.h
3
+ // MediaPlayer
4
+ //
5
+ // Copyright 2008 Apple, Inc. All rights reserved.
6
+ //
7
+
8
+ #import <MediaPlayer/MediaPlayerDefines.h>
9
+ #import <CoreGraphics/CoreGraphics.h>
10
+ #import <Foundation/Foundation.h>
11
+ #import <MediaPlayer/MPMediaEntity.h>
12
+
13
+ NS_ASSUME_NONNULL_BEGIN
14
+
15
+ @class MPMediaItemArtwork;
16
+
17
+ typedef NS_OPTIONS(NSUInteger, MPMediaType) {
18
+ // audio
19
+ MPMediaTypeMusic = 1 << 0,
20
+ MPMediaTypePodcast = 1 << 1,
21
+ MPMediaTypeAudioBook = 1 << 2,
22
+ MPMediaTypeAudioITunesU MP_API(ios(5.0), tvos(9.0), watchos(5.0), macos(10.12.2)) = 1 << 3,
23
+ MPMediaTypeAnyAudio = 0x00ff,
24
+
25
+ // video
26
+ MPMediaTypeMovie MP_API(ios(5.0), tvos(9.0), watchos(5.0), macos(10.12.2)) = 1 << 8,
27
+ MPMediaTypeTVShow MP_API(ios(5.0), tvos(9.0), watchos(5.0), macos(10.12.2)) = 1 << 9,
28
+ MPMediaTypeVideoPodcast MP_API(ios(5.0), tvos(9.0), watchos(5.0), macos(10.12.2)) = 1 << 10,
29
+ MPMediaTypeMusicVideo MP_API(ios(5.0), tvos(9.0), watchos(5.0), macos(10.12.2)) = 1 << 11,
30
+ MPMediaTypeVideoITunesU MP_API(ios(5.0), tvos(9.0), watchos(5.0), macos(10.12.2)) = 1 << 12,
31
+ MPMediaTypeHomeVideo MP_API(ios(7.0), tvos(9.0), watchos(5.0), macos(10.12.2)) = 1 << 13,
32
+ MPMediaTypeAnyVideo MP_API(ios(5.0), tvos(9.0), watchos(5.0), macos(10.12.2)) = 0xff00,
33
+
34
+ MPMediaTypeAny = ~0UL
35
+ } MP_API(ios(3.0), tvos(9.0), watchos(5.0), macos(10.12.2));
36
+
37
+ // An MPMediaItem represents a single piece of media in an MPMediaLibrary.
38
+ // Media items have a unique identifier which persists across application launches.
39
+
40
+ MP_API(ios(3.0), tvos(14.0))
41
+ API_UNAVAILABLE(watchos, macos)
42
+ @interface MPMediaItem : MPMediaEntity
43
+
44
+ #pragma mark - Properties
45
+
46
+ // Properties marked filterable can also be used to build MPMediaPropertyPredicates (see MPMediaQuery.h).
47
+
48
+ MP_EXTERN NSString * const MPMediaItemPropertyPersistentID // filterable
49
+ MP_API(ios(4.2), tvos(9.0), watchos(5.0), macos(10.12.2));
50
+ @property (nonatomic, readonly) MPMediaEntityPersistentID persistentID MP_API(ios(5.0));
51
+
52
+ MP_EXTERN NSString * const MPMediaItemPropertyMediaType // filterable
53
+ MP_API(ios(3.0), tvos(9.0), watchos(5.0), macos(10.12.2));
54
+ @property (nonatomic, readonly) MPMediaType mediaType MP_API(ios(7.0));
55
+
56
+ MP_EXTERN NSString * const MPMediaItemPropertyTitle // filterable
57
+ MP_API(ios(3.0), tvos(9.0), watchos(5.0), macos(10.12.2));
58
+ @property (nonatomic, readonly, nullable) NSString *title MP_API(ios(7.0));
59
+
60
+ MP_EXTERN NSString * const MPMediaItemPropertyAlbumTitle
61
+ MP_API(ios(3.0), tvos(9.0), watchos(5.0), macos(10.12.2)); // filterable
62
+ @property (nonatomic, readonly, nullable) NSString *albumTitle MP_API(ios(7.0));
63
+
64
+ MP_EXTERN NSString * const MPMediaItemPropertyAlbumPersistentID // filterable
65
+ MP_API(ios(4.2), tvos(9.0), watchos(5.0), macos(10.12.2));
66
+ @property (nonatomic, readonly) MPMediaEntityPersistentID albumPersistentID MP_API(ios(8.0));
67
+
68
+ MP_EXTERN NSString * const MPMediaItemPropertyArtist // filterable
69
+ MP_API(ios(3.0), tvos(9.0), watchos(5.0), macos(10.12.2));
70
+ @property (nonatomic, readonly, nullable) NSString *artist MP_API(ios(7.0));
71
+
72
+ MP_EXTERN NSString * const MPMediaItemPropertyArtistPersistentID // filterable
73
+ MP_API(ios(4.2), tvos(9.0), watchos(5.0), macos(10.12.2));
74
+ @property (nonatomic, readonly) MPMediaEntityPersistentID artistPersistentID MP_API(ios(8.0));
75
+
76
+ MP_EXTERN NSString * const MPMediaItemPropertyAlbumArtist // filterable
77
+ MP_API(ios(3.0), tvos(9.0), watchos(5.0), macos(10.12.2));
78
+ @property (nonatomic, readonly, nullable) NSString *albumArtist MP_API(ios(7.0));
79
+
80
+ MP_EXTERN NSString * const MPMediaItemPropertyAlbumArtistPersistentID // filterable
81
+ MP_API(ios(4.2), tvos(9.0), watchos(5.0), macos(10.12.2));
82
+ @property (nonatomic, readonly) MPMediaEntityPersistentID albumArtistPersistentID MP_API(ios(8.0));
83
+
84
+ MP_EXTERN NSString * const MPMediaItemPropertyGenre // filterable
85
+ MP_API(ios(3.0), tvos(9.0), watchos(5.0), macos(10.12.2));
86
+ @property (nonatomic, readonly, nullable) NSString *genre MP_API(ios(7.0));
87
+
88
+ MP_EXTERN NSString * const MPMediaItemPropertyGenrePersistentID // filterable
89
+ MP_API(ios(4.2), tvos(9.0), watchos(5.0), macos(10.12.2));
90
+ @property (nonatomic, readonly) MPMediaEntityPersistentID genrePersistentID MP_API(ios(8.0));
91
+
92
+ MP_EXTERN NSString * const MPMediaItemPropertyComposer // filterable
93
+ MP_API(ios(3.0), tvos(9.0), watchos(5.0), macos(10.12.2));
94
+ @property (nonatomic, readonly, nullable) NSString *composer MP_API(ios(7.0));
95
+
96
+ MP_EXTERN NSString * const MPMediaItemPropertyComposerPersistentID // filterable
97
+ MP_API(ios(4.2), tvos(9.0), watchos(5.0), macos(10.12.2));
98
+ @property (nonatomic, readonly) MPMediaEntityPersistentID composerPersistentID MP_API(ios(8.0));
99
+
100
+ MP_EXTERN NSString * const MPMediaItemPropertyPlaybackDuration
101
+ MP_API(ios(3.0), tvos(9.0), watchos(5.0), macos(10.12.2));
102
+ @property (nonatomic, readonly) NSTimeInterval playbackDuration MP_API(ios(7.0));
103
+
104
+ MP_EXTERN NSString * const MPMediaItemPropertyAlbumTrackNumber
105
+ MP_API(ios(3.0), tvos(9.0), watchos(5.0), macos(10.12.2));
106
+ @property (nonatomic, readonly) NSUInteger albumTrackNumber MP_API(ios(7.0));
107
+
108
+ MP_EXTERN NSString * const MPMediaItemPropertyAlbumTrackCount
109
+ MP_API(ios(3.0), tvos(9.0), watchos(5.0), macos(10.12.2));
110
+ @property (nonatomic, readonly) NSUInteger albumTrackCount MP_API(ios(8.0));
111
+
112
+ MP_EXTERN NSString * const MPMediaItemPropertyDiscNumber
113
+ MP_API(ios(3.0), tvos(9.0), watchos(5.0), macos(10.12.2));
114
+ @property (nonatomic, readonly) NSUInteger discNumber MP_API(ios(7.0));
115
+
116
+ MP_EXTERN NSString * const MPMediaItemPropertyDiscCount
117
+ MP_API(ios(3.0), tvos(9.0), watchos(5.0), macos(10.12.2));
118
+ @property (nonatomic, readonly) NSUInteger discCount MP_API(ios(8.0));
119
+
120
+ MP_EXTERN NSString * const MPMediaItemPropertyArtwork
121
+ MP_API(ios(3.0), tvos(9.0), watchos(5.0), macos(10.13.2));
122
+ @property (nonatomic, readonly, nullable) MPMediaItemArtwork *artwork MP_API(ios(7.0));
123
+
124
+ MP_EXTERN NSString * const MPMediaItemPropertyIsExplicit
125
+ MP_API(ios(7.0), tvos(9.0), watchos(5.0), macos(10.12.2));
126
+ @property (nonatomic, readonly, getter = isExplicitItem) BOOL explicitItem MP_API(ios(10.0));
127
+
128
+ MP_EXTERN NSString * const MPMediaItemPropertyLyrics
129
+ MP_API(ios(3.0), tvos(9.0), watchos(5.0), macos(10.12.2));
130
+ @property (nonatomic, readonly, nullable) NSString *lyrics MP_API(ios(8.0));
131
+
132
+ MP_EXTERN NSString * const MPMediaItemPropertyIsCompilation // filterable
133
+ MP_API(ios(3.0), tvos(9.0), watchos(5.0), macos(10.12.2));
134
+ @property (nonatomic, readonly, getter = isCompilation) BOOL compilation MP_API(ios(8.0));
135
+
136
+ MP_EXTERN NSString * const MPMediaItemPropertyReleaseDate
137
+ MP_API(ios(4.0), tvos(9.0), watchos(5.0), macos(10.12.2));
138
+ @property (nonatomic, readonly, nullable) NSDate *releaseDate MP_API(ios(7.0));
139
+
140
+ MP_EXTERN NSString * const MPMediaItemPropertyBeatsPerMinute
141
+ MP_API(ios(4.0), tvos(9.0), watchos(5.0), macos(10.12.2));
142
+ @property (nonatomic, readonly) NSUInteger beatsPerMinute MP_API(ios(8.0));
143
+
144
+ MP_EXTERN NSString * const MPMediaItemPropertyComments
145
+ MP_API(ios(4.0), tvos(9.0), watchos(5.0), macos(10.12.2));
146
+ @property (nonatomic, readonly, nullable) NSString *comments MP_API(ios(8.0));
147
+
148
+ MP_EXTERN NSString * const MPMediaItemPropertyAssetURL
149
+ MP_API(ios(4.0), tvos(9.0), watchos(5.0), macos(10.12.2));
150
+ @property (nonatomic, readonly, nullable) NSURL *assetURL MP_API(ios(8.0));
151
+
152
+ MP_EXTERN NSString * const MPMediaItemPropertyIsCloudItem // filterable
153
+ MP_API(ios(6.0), tvos(9.0), watchos(5.0), macos(10.12.2));
154
+ @property (nonatomic, readonly, getter = isCloudItem) BOOL cloudItem MP_API(ios(8.0));
155
+
156
+ MP_EXTERN NSString * const MPMediaItemPropertyHasProtectedAsset // filterable
157
+ MP_API(ios(9.2), tvos(9.2), watchos(5.0), macos(10.12.2));
158
+ @property (nonatomic, readonly, getter = hasProtectedAsset) BOOL protectedAsset MP_API(ios(9.2));
159
+
160
+ MP_EXTERN NSString * const MPMediaItemPropertyPodcastTitle // filterable
161
+ MP_API(ios(3.0), tvos(9.0), watchos(5.0), macos(10.12.2));
162
+ @property (nonatomic, readonly, nullable) NSString *podcastTitle MP_API(ios(7.0));
163
+
164
+ MP_EXTERN NSString * const MPMediaItemPropertyPodcastPersistentID // filterable
165
+ MP_API(ios(4.2), tvos(9.0), watchos(5.0), macos(10.12.2));
166
+ @property (nonatomic, readonly) MPMediaEntityPersistentID podcastPersistentID MP_API(ios(8.0));
167
+
168
+ MP_EXTERN NSString * const MPMediaItemPropertyPlayCount // filterable
169
+ MP_API(ios(3.0), tvos(9.0), watchos(5.0), macos(10.12.2));
170
+ @property (nonatomic, readonly) NSUInteger playCount MP_API(ios(7.0));
171
+
172
+ MP_EXTERN NSString * const MPMediaItemPropertySkipCount
173
+ MP_API(ios(3.0), tvos(9.0), watchos(5.0), macos(10.12.2));
174
+ @property (nonatomic, readonly) NSUInteger skipCount MP_API(ios(7.0));
175
+
176
+ MP_EXTERN NSString * const MPMediaItemPropertyRating
177
+ MP_API(ios(3.0), tvos(9.0), watchos(5.0), macos(10.12.2));
178
+ @property (nonatomic, readonly) NSUInteger rating MP_API(ios(7.0));
179
+
180
+ MP_EXTERN NSString * const MPMediaItemPropertyLastPlayedDate
181
+ MP_API(ios(3.0), tvos(9.0), watchos(5.0), macos(10.12.2));
182
+ @property (nonatomic, readonly, nullable) NSDate *lastPlayedDate MP_API(ios(7.0));
183
+
184
+ MP_EXTERN NSString * const MPMediaItemPropertyUserGrouping
185
+ MP_API(ios(4.0), tvos(9.0), watchos(5.0), macos(10.12.2));
186
+ @property (nonatomic, readonly, nullable) NSString *userGrouping MP_API(ios(8.0));
187
+
188
+ MP_EXTERN NSString * const MPMediaItemPropertyBookmarkTime
189
+ MP_API(ios(6.0), tvos(9.0), watchos(5.0), macos(10.12.2));
190
+ @property (nonatomic, readonly) NSTimeInterval bookmarkTime MP_API(ios(7.0));
191
+
192
+ MP_EXTERN NSString * const MPMediaItemPropertyDateAdded
193
+ MP_API(ios(10.0), tvos(10.0), watchos(5.0), macos(10.12.2));
194
+ @property (nonatomic, readonly) NSDate *dateAdded MP_API(ios(10.0));
195
+
196
+ // Matches the id used by MPMusicPlayerController to enqueue store tracks
197
+ MP_EXTERN NSString * const MPMediaItemPropertyPlaybackStoreID
198
+ MP_API(ios(10.3), tvos(10.3), watchos(5.0), macos(10.13));
199
+ @property (nonatomic, readonly) NSString *playbackStoreID MP_API(ios(10.3));
200
+
201
+ MP_EXTERN NSString * const MPMediaItemPropertyIsPreorder
202
+ MP_API(ios(14.5), tvos(14.5), watchos(7.3), macos(11.3));
203
+ @property (nonatomic, readonly, getter=isPreorder) BOOL preorder MP_API(ios(10.3));
204
+
205
+ @end
206
+
207
+ //-----------------------------------------------------
208
+
209
+ #if TARGET_OS_OSX
210
+ @class NSImage;
211
+ #else
212
+ @class UIImage;
213
+ #endif
214
+
215
+ MP_API(ios(3.0), tvos(9.0), macos(10.12.2), watchos(5.0))
216
+ @interface MPMediaItemArtwork : NSObject
217
+
218
+ MP_INIT_UNAVAILABLE
219
+
220
+ #if TARGET_OS_IPHONE
221
+
222
+ - (instancetype)initWithBoundsSize:(CGSize)boundsSize requestHandler:(UIImage *(^)(CGSize size))requestHandler
223
+ MP_API(ios(10.0), tvos(10.0), watchos(5.0))
224
+ NS_DESIGNATED_INITIALIZER;
225
+
226
+ // Returns the artwork image for an item at a given size (in points).
227
+ - (nullable UIImage *)imageWithSize:(CGSize)size;
228
+
229
+ #else
230
+
231
+ - (instancetype)initWithBoundsSize:(CGSize)boundsSize requestHandler:(NSImage *(^)(CGSize size))requestHandler
232
+ MP_API(macos(10.12.2))
233
+ NS_DESIGNATED_INITIALIZER;
234
+
235
+ // Returns the artwork image for an item at a given size (in points).
236
+ - (nullable NSImage *)imageWithSize:(CGSize)size
237
+ MP_API(macos(10.12.2));
238
+
239
+ #endif
240
+
241
+ @property (nonatomic, readonly) CGRect bounds; // The bounds of the full size image (in points).
242
+
243
+ // MARK: - Deprecated
244
+
245
+ @property (nonatomic, readonly) CGRect imageCropRect MP_DEPRECATED("cropRect is no longer used", ios(3.0, 10.0));
246
+
247
+ #if TARGET_OS_IPHONE
248
+ - (instancetype)initWithImage:(UIImage *)image MP_DEPRECATED("Use -initWithBoundsSize:requestHandler:", ios(5.0, 10.0));
249
+ #endif
250
+
251
+ @end
252
+
253
+ //-----------------------------------------------------
254
+
255
+ /// An animated image, such as an animated music album cover art, for a media item.
256
+ ///
257
+ /// A single instance of animated artwork is comprised of two assets: an artwork video asset, and a
258
+ /// preview image which should match the first frame of the artwork video. The preview image may be
259
+ /// used when displaying the animated artwork whilst the video becomes available.
260
+ ///
261
+ /// Both the preview image and artwork video can be fetched asynchronously and will only be
262
+ /// requested when required at point of display. Aim to provide preview images as quickly as
263
+ /// possible once requested, and ideally synchronously.
264
+ ///
265
+ /// Video asset `URL`s you provide must be local file `URL`s. You should make the associated assets
266
+ /// available locally before providing them via the relevant handler, for example by fetching the
267
+ /// associated video asset over the network. The `URL`s should remain valid for the lifetime of the
268
+ /// ``MPMediaItemAnimatedArtwork``, once provided.
269
+ ///
270
+ /// ``MPMediaItemAnimatedArtwork`` should not be subclassed.
271
+ MP_FINAL_CLASS
272
+ MP_API(ios(19.0), tvos(19.0), macos(16.0), watchos(12.0), visionos(3.0))
273
+ @interface MPMediaItemAnimatedArtwork : NSObject
274
+
275
+ MP_INIT_UNAVAILABLE
276
+
277
+ #if TARGET_OS_IPHONE
278
+
279
+ /// Creates an animated artwork.
280
+ ///
281
+ /// - Parameters:
282
+ /// - artworkID: A unique identifier for this animated artwork. This identifier should encapsulate
283
+ /// the identity of both the preview frame and video asset. If you change either, you should
284
+ /// provide an ``MPMediaItemAnimatedArtwork`` with an updated `artworkID`.
285
+ /// - previewImageRequestHandler: A handler to return a preview image for this artwork, for the
286
+ /// requested `CGSize` in pixels. Once requested, you should pass the preview image to the
287
+ /// provided completion handler, or you can pass `nil` if the preview image cannot be resolved
288
+ /// for any reason. You can call the completion handler on an arbitrary queue, however it must
289
+ /// only be called once. The `UIImage` you provide should ideally have a size equal to the
290
+ /// requested `CGSize`, however an image of the same aspect ratio is acceptable. Images that
291
+ /// diverge significantly from the requested aspect ratio may be rejected by the system. Aim to
292
+ /// provide preview images quickly and ideally synchronously, and if possible you should preload
293
+ /// these images in order to reduce perceived latency when displaying animated artwork to the
294
+ /// user.
295
+ /// - videoAssetFileURLRequestHandler: A handler to return a file `URL` for the artwork video
296
+ /// asset for this artwork, for the requested `CGSize` in pixels. Once requested, you should pass
297
+ /// the `URL` to the provided completion handler, or you can pass `nil` if the artwork video asset
298
+ /// cannot be resolved for any reason. You can call the completion handler on an arbitrary queue,
299
+ /// however it must only be called once. The `URL` you provide must reference a local asset,
300
+ /// ideally with a size equal to the requested `CGSize`, however an asset with the same aspect
301
+ /// ratio is acceptable. Assets that diverge significantly from the requested aspect ratio may be
302
+ /// rejected by the system. The video assets you provide should loop cleanly, and should be
303
+ /// available relatively quickly from this handler (particularly when re-fetched). It’s advised
304
+ /// that assets are cached for subsequent fetches.
305
+ - (instancetype)initWithArtworkID:(NSString *)artworkID
306
+ previewImageRequestHandler:(void (^)(CGSize size, void (^completion)(UIImage * _Nullable image)))previewImageRequestHandler
307
+ 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;
308
+
309
+ #else
310
+
311
+ /// Creates an animated artwork.
312
+ ///
313
+ /// - Parameters:
314
+ /// - artworkID: A unique identifier for this animated artwork. This identifier should encapsulate
315
+ /// the identity of both the preview frame and video asset. If you change either, you should
316
+ /// provide an ``MPMediaItemAnimatedArtwork`` with an updated `artworkID`.
317
+ /// - previewImageRequestHandler: A handler to return a preview image for this artwork, for the
318
+ /// requested `CGSize` in pixels. Once requested, you should pass the preview image to the
319
+ /// provided completion handler, or you can pass `nil` if the preview image cannot be resolved
320
+ /// for any reason. You can call the completion handler on an arbitrary queue, however it must
321
+ /// only be called once. The `NSImage` you provide should ideally have a size equal to the
322
+ /// requested `CGSize`, however an image of the same aspect ratio is acceptable. Images that
323
+ /// diverge significantly from the requested aspect ratio may be rejected by the system. Aim to
324
+ /// provide preview images quickly and ideally synchronously, and if possible you should preload
325
+ /// these images in order to reduce perceived latency when displaying animated artwork to the
326
+ /// user.
327
+ /// - videoAssetFileURLRequestHandler: A handler to return a file `URL` for the artwork video
328
+ /// asset for this artwork, for the requested `CGSize` in pixels. Once requested, you should pass
329
+ /// the `URL` to the provided completion handler, or you can pass `nil` if the artwork video asset
330
+ /// cannot be resolved for any reason. You can call the completion handler on an arbitrary queue,
331
+ /// however it must only be called once. The `URL` you provide must reference a local asset,
332
+ /// ideally with a size equal to the requested `CGSize`, however an asset with the same aspect
333
+ /// ratio is acceptable. Assets that diverge significantly from the requested aspect ratio may be
334
+ /// rejected by the system. The video assets you provide should loop cleanly, and should be
335
+ /// available relatively quickly from this handler (particularly when re-fetched). It’s advised
336
+ /// that assets are cached for subsequent fetches.
337
+ - (instancetype)initWithArtworkID:(NSString *)artworkID
338
+ previewImageRequestHandler:(void (^)(CGSize size, void (^completion)(NSImage * _Nullable image)))previewImageRequestHandler
339
+ videoAssetFileURLRequestHandler:(void (^)(CGSize size, void (^completion)(NSURL * _Nullable url)))videoAssetFileURLRequestHandler MP_API(macos(16.0)) NS_DESIGNATED_INITIALIZER;
340
+
341
+ #endif
342
+
343
+ @end
344
+
345
+ NS_ASSUME_NONNULL_END
346
+
@@ -0,0 +1,42 @@
1
+ //
2
+ // MPMediaItemCollection.h
3
+ // MediaPlayer
4
+ //
5
+ // Copyright 2008 Apple, Inc. All rights reserved.
6
+ //
7
+
8
+ #import <MediaPlayer/MediaPlayerDefines.h>
9
+ #import <Foundation/Foundation.h>
10
+ #import <MediaPlayer/MPMediaEntity.h>
11
+ #import <MediaPlayer/MPMediaItem.h>
12
+
13
+ NS_ASSUME_NONNULL_BEGIN
14
+
15
+ // An MPMediaItemCollection is a collection of related MPMediaItems in a media library.
16
+
17
+ MP_API(ios(3.0))
18
+ API_UNAVAILABLE(tvos, watchos, macos)
19
+ @interface MPMediaItemCollection : MPMediaEntity
20
+
21
+ // Creates a media item collection by copying an array of MPMediaItems.
22
+ + (MPMediaItemCollection *)collectionWithItems:(NSArray<MPMediaItem *> *)items;
23
+
24
+ - (instancetype)initWithItems:(NSArray<MPMediaItem *> *)items NS_DESIGNATED_INITIALIZER;
25
+
26
+ // Returns the MPMediaItems in the collection.
27
+ @property (nonatomic, readonly) NSArray<MPMediaItem *> *items;
28
+
29
+ // Returns an item representative of other items in the collection.
30
+ // This item can be used for common item properties in the collection, often more efficiently than fetching an item out of the items array.
31
+ @property (nonatomic, readonly, nullable) MPMediaItem *representativeItem;
32
+
33
+ // Returns the number of items in the collection.
34
+ // In some cases, this is more efficient than fetching the items array and asking for the count.
35
+ @property (nonatomic, readonly) NSUInteger count;
36
+
37
+ // Returns the types of media which the collection holds.
38
+ @property (nonatomic, readonly) MPMediaType mediaTypes;
39
+
40
+ @end
41
+
42
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,76 @@
1
+ //
2
+ // MPMediaLibrary.h
3
+ // MediaPlayer
4
+ //
5
+ // Copyright 2008 Apple, Inc. All rights reserved.
6
+ //
7
+
8
+ #import <MediaPlayer/MediaPlayerDefines.h>
9
+ #import <Foundation/Foundation.h>
10
+
11
+ NS_ASSUME_NONNULL_BEGIN
12
+
13
+ @class MPMediaEntity;
14
+ @class MPMediaQuery;
15
+ @class MPMediaPlaylist;
16
+ @class MPMediaPlaylistCreationMetadata;
17
+
18
+ // MPMediaLibrary represents a collection of media on a device, and can be used
19
+ // to fetch items and playlists from the user's synced iTunes library.
20
+ //
21
+ // See MPMediaQuery.h for a list of common queries or to build a custom query
22
+ // from a chain of filter predicates.
23
+
24
+ // -----------------------------------------------------------------------------
25
+
26
+ typedef NS_ENUM(NSInteger, MPMediaLibraryAuthorizationStatus) {
27
+ MPMediaLibraryAuthorizationStatusNotDetermined = 0,
28
+ MPMediaLibraryAuthorizationStatusDenied,
29
+ MPMediaLibraryAuthorizationStatusRestricted,
30
+ MPMediaLibraryAuthorizationStatusAuthorized,
31
+ } MP_API(ios(9.3)) API_UNAVAILABLE(tvos, watchos, macos);
32
+
33
+ MP_API(ios(3.0))
34
+ API_UNAVAILABLE(tvos, watchos, macos)
35
+ @interface MPMediaLibrary : NSObject <NSSecureCoding>
36
+
37
+ + (MPMediaLibrary *)defaultMediaLibrary;
38
+
39
+ /*!
40
+ * Returns the date at which the media library database was last written to disk.
41
+ *
42
+ * @discussion This property reflects database persistence, not library content changes.
43
+ * On macOS, it requires Music.app to have been opened at least once to initialize the
44
+ * library; before that, it returns the current date as a fallback.
45
+ */
46
+ @property (nonatomic, readonly) NSDate *lastModifiedDate;
47
+
48
+ // MPMediaLibraryDidChangeNotification will be posted when a sync happens.
49
+ - (void)beginGeneratingLibraryChangeNotifications;
50
+ - (void)endGeneratingLibraryChangeNotifications;
51
+
52
+ + (MPMediaLibraryAuthorizationStatus)authorizationStatus MP_API(ios(9.3));
53
+ + (void)requestAuthorization:(void (^)(MPMediaLibraryAuthorizationStatus status))completionHandler MP_API(ios(9.3));
54
+
55
+ - (void)addItemWithProductID:(NSString *)productID completionHandler:(nullable void (^)(NSArray <__kindof MPMediaEntity *> *entities, NSError * __nullable error))completionHandler MP_API(ios(9.3));
56
+
57
+ /*!
58
+ * Finds the playlist associated with the UUID.
59
+ * If the playlist exists, the creation metadata is ignored.
60
+ * If no such playlist exists and creation metadata is valid, a playlist associated the UUID will be created.
61
+ *
62
+ * @discussion The UUID should typically be pre-generated to avoid creating a new playlist with every call.
63
+ */
64
+
65
+ - (void)getPlaylistWithUUID:(NSUUID *)uuid creationMetadata:(nullable MPMediaPlaylistCreationMetadata *)creationMetadata completionHandler:(void (^)(MPMediaPlaylist * __nullable playlist, NSError * __nullable error))completionHandler MP_API(ios(9.3));
66
+
67
+ @end
68
+
69
+
70
+ // -----------------------------------------------------------------------------
71
+ // Notifications
72
+
73
+ // Any items or playlists which were previously cached should be re-evaluated from queries when MPMediaLibraryDidChangeNotification is posted.
74
+ MP_EXTERN NSString * const MPMediaLibraryDidChangeNotification API_UNAVAILABLE(tvos, watchos, macos);
75
+
76
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,64 @@
1
+ //
2
+ // MPMediaPickerController.h
3
+ // MediaPlayer
4
+ //
5
+ // Copyright 2008 Apple, Inc. All rights reserved.
6
+ //
7
+
8
+ #import <MediaPlayer/MediaPlayerDefines.h>
9
+
10
+ #if MP_HAS_HEADER(UIKit, UIViewController.h)
11
+
12
+ #import <UIKit/UIKit.h>
13
+ #import <MediaPlayer/MPMediaItem.h>
14
+ #import <MediaPlayer/MPMediaItemCollection.h>
15
+
16
+ NS_ASSUME_NONNULL_BEGIN
17
+
18
+ @protocol MPMediaPickerControllerDelegate;
19
+
20
+ // MPMediaPickerController is a UIViewController for visually selecting media items.
21
+ // To display it, present it modally on an existing view controller.
22
+ MP_API(ios(3.0))
23
+ #if defined(TARGET_OS_VISION) && TARGET_OS_VISION
24
+ API_UNAVAILABLE(watchos, visionos)
25
+ #else
26
+ API_UNAVAILABLE(watchos)
27
+ #endif
28
+ MP_UNAVAILABLE(tvos, macos)
29
+ @interface MPMediaPickerController : UIViewController
30
+
31
+ - (instancetype)initWithMediaTypes:(MPMediaType)mediaTypes NS_DESIGNATED_INITIALIZER;
32
+ @property (nonatomic, readonly) MPMediaType mediaTypes;
33
+
34
+ @property (nonatomic, weak, nullable) id<MPMediaPickerControllerDelegate> delegate;
35
+
36
+ @property (nonatomic) BOOL allowsPickingMultipleItems; // default is NO
37
+
38
+ @property (nonatomic) BOOL showsCloudItems MP_API(ios(6.0)); // default is YES
39
+
40
+ @property (nonatomic) BOOL showsItemsWithProtectedAssets MP_API(ios(9.2)); // default is YES
41
+
42
+ @property (nonatomic, copy, nullable) NSString *prompt; // displays a prompt for the user above the navigation bar buttons
43
+
44
+ @end
45
+
46
+ MP_UNAVAILABLE(tvos, macos)
47
+ #if defined(TARGET_OS_VISION) && TARGET_OS_VISION
48
+ API_UNAVAILABLE(watchos, visionos)
49
+ #else
50
+ API_UNAVAILABLE(watchos)
51
+ #endif
52
+ @protocol MPMediaPickerControllerDelegate<NSObject>
53
+ @optional
54
+
55
+ // It is the delegate's responsibility to dismiss the modal view controller on the parent view controller.
56
+
57
+ - (void)mediaPicker:(MPMediaPickerController *)mediaPicker didPickMediaItems:(MPMediaItemCollection *)mediaItemCollection;
58
+ - (void)mediaPickerDidCancel:(MPMediaPickerController *)mediaPicker;
59
+
60
+ @end
61
+
62
+ NS_ASSUME_NONNULL_END
63
+
64
+ #endif
@@ -0,0 +1,47 @@
1
+ //
2
+ // MPMediaPlayback.h
3
+ // MediaPlayer
4
+ //
5
+ // Copyright 2009-2010 Apple, Inc. All rights reserved.
6
+ //
7
+
8
+ #import <MediaPlayer/MediaPlayerDefines.h>
9
+ #import <Foundation/Foundation.h>
10
+
11
+ MP_API(ios(3.0), tvos(14.0))
12
+ API_UNAVAILABLE(watchos, macos)
13
+ @protocol MPMediaPlayback
14
+
15
+ // Prepares the current queue for playback, interrupting any active (non-mixible) audio sessions.
16
+ // Automatically invoked when -play is called if the player is not already prepared.
17
+ - (void)prepareToPlay;
18
+
19
+ // Returns YES if prepared for playback.
20
+ @property(nonatomic, readonly) BOOL isPreparedToPlay;
21
+
22
+ // Plays items from the current queue, resuming paused playback if possible.
23
+ - (void)play;
24
+
25
+ // Pauses playback if playing.
26
+ - (void)pause;
27
+
28
+ // Ends playback. Calling -play again will start from the beginnning of the queue.
29
+ - (void)stop;
30
+
31
+ // The current playback time of the now playing item in seconds.
32
+ @property(nonatomic) NSTimeInterval currentPlaybackTime;
33
+
34
+ // The current playback rate of the now playing item. Default is 1.0 (normal speed).
35
+ // Pausing will set the rate to 0.0. Setting the rate to non-zero implies playing.
36
+ @property(nonatomic) float currentPlaybackRate;
37
+
38
+ // The seeking rate will increase the longer scanning is active.
39
+ - (void)beginSeekingForward;
40
+ - (void)beginSeekingBackward;
41
+ - (void)endSeeking;
42
+
43
+ @end
44
+
45
+ // Posted when the prepared state changes of an object conforming to the MPMediaPlayback protocol changes.
46
+ // This supersedes MPMoviePlayerContentPreloadDidFinishNotification.
47
+ MP_EXTERN NSString * const MPMediaPlaybackIsPreparedToPlayDidChangeNotification MP_DEPRECATED("Use AVPlayerViewController in AVKit.", ios(3.2, 9.0));
@@ -0,0 +1,82 @@
1
+ //
2
+ // MPMediaPlaylist.h
3
+ // MediaPlayer
4
+ //
5
+ // Copyright 2008 Apple, Inc. All rights reserved.
6
+ //
7
+
8
+ #import <MediaPlayer/MediaPlayerDefines.h>
9
+ #import <Foundation/Foundation.h>
10
+ #import <MediaPlayer/MPMediaItemCollection.h>
11
+
12
+ NS_ASSUME_NONNULL_BEGIN
13
+
14
+ @class MPMediaItem;
15
+
16
+ // A playlist may have any number of MPMediaPlaylistAttributes associated.
17
+ typedef NS_OPTIONS(NSUInteger, MPMediaPlaylistAttribute) {
18
+ MPMediaPlaylistAttributeNone = 0,
19
+ MPMediaPlaylistAttributeOnTheGo = (1 << 0), // if set, the playlist was created on a device rather than synced from iTunes
20
+ MPMediaPlaylistAttributeSmart = (1 << 1),
21
+ MPMediaPlaylistAttributeGenius = (1 << 2),
22
+ } MP_API(ios(3.0)) API_UNAVAILABLE(tvos, watchos, macos);
23
+
24
+ // An MPMediaPlaylist is a collection of related MPMediaItems in an MPMediaLibrary.
25
+ // Playlists have a unique identifier which persists across application launches.
26
+ MP_API(ios(3.0))
27
+ API_UNAVAILABLE(tvos, watchos, macos)
28
+ @interface MPMediaPlaylist : MPMediaItemCollection
29
+
30
+ #pragma mark - Properties
31
+
32
+ // Properties marked filterable can also be used to build MPMediaPropertyPredicates (see MPMediaQuery.h).
33
+
34
+ MP_EXTERN NSString * const MPMediaPlaylistPropertyPersistentID; // filterable
35
+ @property (nonatomic, readonly) MPMediaEntityPersistentID persistentID MP_API(ios(7.0));
36
+
37
+ MP_EXTERN NSString * const MPMediaPlaylistPropertyCloudGlobalID MP_API(ios(9.0)); // filterable
38
+ @property (nonatomic, readonly, nullable) NSString *cloudGlobalID MP_API(ios(14.0));
39
+
40
+ MP_EXTERN NSString * const MPMediaPlaylistPropertyName; // filterable
41
+ @property (nonatomic, readonly, nullable) NSString *name MP_API(ios(7.0));
42
+
43
+ MP_EXTERN NSString * const MPMediaPlaylistPropertyPlaylistAttributes; // filterable
44
+ @property (nonatomic, readonly) MPMediaPlaylistAttribute playlistAttributes MP_API(ios(7.0));
45
+
46
+ // For playlists with attribute MPMediaPlaylistAttributeGenius, the seedItems are the MPMediaItems which were used to the generate the playlist.
47
+ // Returns nil for playlists without MPMediaPlaylistAttributeGenius set.
48
+ MP_EXTERN NSString * const MPMediaPlaylistPropertySeedItems;
49
+ @property (nonatomic, readonly, nullable) NSArray<MPMediaItem *> *seedItems MP_API(ios(8.0));
50
+
51
+ MP_EXTERN NSString * const MPMediaPlaylistPropertyDescriptionText MP_API(ios(9.3));
52
+ @property (nonatomic, readonly, nullable) NSString *descriptionText MP_API(ios(9.3));
53
+
54
+ MP_EXTERN NSString * const MPMediaPlaylistPropertyAuthorDisplayName MP_API(ios(9.3));
55
+ @property (nonatomic, readonly, nullable) NSString *authorDisplayName MP_API(ios(9.3));
56
+
57
+ - (void)addItemWithProductID:(NSString *)productID completionHandler:(nullable void (^)(NSError * __nullable error))completionHandler
58
+ MP_API(ios(9.3))
59
+ API_UNAVAILABLE(macos);
60
+ - (void)addMediaItems:(NSArray<MPMediaItem *> *)mediaItems completionHandler:(nullable void (^)(NSError * __nullable error))completionHandler
61
+ MP_API(ios(9.3))
62
+ API_UNAVAILABLE(macos);
63
+
64
+ @end
65
+
66
+ MP_API(ios(9.3))
67
+ API_UNAVAILABLE(tvos, watchos, macos)
68
+ @interface MPMediaPlaylistCreationMetadata : NSObject
69
+
70
+ MP_INIT_UNAVAILABLE
71
+
72
+ - (instancetype)initWithName:(NSString *)name NS_DESIGNATED_INITIALIZER;
73
+
74
+ /// The display name of the playlist.
75
+ @property (nonatomic, readonly, copy) NSString *name;
76
+ /// Defaults to the requesting app's display name.
77
+ @property (null_resettable, nonatomic, copy) NSString *authorDisplayName;
78
+ @property (nonatomic, copy) NSString *descriptionText;
79
+
80
+ @end
81
+
82
+ NS_ASSUME_NONNULL_END