MusicKit

RSS for tag

Let users play Apple Music and their local music library from your app using MusicKit.

Posts under MusicKit tag

200 Posts

Post

Replies

Boosts

Views

Activity

Supported MusicKit APIs for vinyl-style speed, pitch and reverse playback of subscription songs on iOS?
I am building a personal iPhone prototype with an on-screen record platter. Before enrolling in the Apple Developer Program or developing the Apple Music integration further, I would like to establish whether the core interaction is supported by public APIs. The intended interaction is: Tap the platter to play or pause an Apple Music subscription song. Hold the platter to stop playback at its current position. Move the platter forward or backward to control the direction and speed of audible playback continuously. Change pitch together with speed, like a physical record, rather than preserving the original pitch. Release the platter to smoothly return to normal playback. Hold a separate control to listen continuously at a faster speed. A prototype using an AVAudioEngine-based renderer works with unprotected local audio. I have NOT verified these behaviors with Apple Music subscription content. I understand that this local renderer does not establish feasibility for MusicKit, and I am not seeking to extract protected audio or bypass content protection. MusicPlayer.State.playbackRate is documented as settable, with positive values for forward playback and negative values for reverse playback: https://developer.apple.com/documentation/musickit/musicplayer/state-swift.class/playbackrate For ApplicationMusicPlayer on iOS, is this vinyl-style interaction supported for full Apple Music subscription songs, rather than previews or user-owned unprotected files? In particular: What playback-rate range is supported for subscription songs? Do negative rates produce audible reverse playback, and how should zero-speed holding be implemented? Is there a documented public API to make pitch follow playback speed, or to disable pitch preservation? Are frequent rate and direction changes supported for interactive scratching? Are there documented limitations on update frequency, buffering, seeking precision or responsiveness? If this interaction is outside public MusicKit capabilities, is there an official channel where an individual developer can ask about eligibility for an approved Apple Music DJ integration? I am asking for the supported API path and its limitations, not implementation details of another app. If only ordinary variable-speed playback or seeking is supported, a clear distinction from continuous vinyl-style scratching would be very helpful. The initial goal is personal use; possible App Store distribution is undecided. I have an active Apple Music subscription but am not currently enrolled in the paid Apple Developer Program. Thank you.
0
0
241
2d
Building a library playlist on macOS that mixes catalog songs and the user's own uploads in a fixed order – supported route, and how to know when an upload is registered?
Our sandboxed macOS app digitises audio cassettes and builds one playlist per cassette in the user's Apple Music library that follows the tape's order: catalog songs where a title was recognised, and the user's own recordings (AAC files the app exported from the tape) where it was not. The user has an Apple Music subscription and Sync Library on. On macOS every write on MusicLibrary is marked @available(macOS, unavailable) in the 26.5 SDK – add, add(_:to:), createPlaylist and edit (see thread 844114, which got no answer). So we build the playlist through Music.app's scripting interface: make new user playlist, duplicate <library track> to <playlist> for catalog songs, add <file> to <playlist> for own recordings. That works, with one exception that leads to our questions. What we observe Reproducible on macOS 26.6.2 / Music 26; a standalone AppleScript is at the end. A playlist built in one go from 14 subscription tracks keeps all 14. The same playlist with one local file added after the second track: all 15 entries are there right after the build and one second later. About 15 s later the playlist has 3 entries – the two catalog entries before the file, the file, and nothing that was added after it. No error anywhere. If the file has been in the library for several minutes before the playlist is built, everything stays. Adding it to the library and waiting 45 s is not enough. Meanwhile the track's cloud status stays unknown, and GET /v1/me/library/search?types=library-songs does not list it (checked for 10 minutes). Emptying the playlist and building it again ~30 s after the entries were removed keeps everything, every time. That is what we do today; it costs 30–40 s per import, and we have to tell the user that entries were removed and put back. Our reading: while the freshly added file is not yet registered in iCloud Music Library, the playlist as pushed to the server is cut at the first item the server cannot reference, and the next sync adopts the shorter list for cloud items while keeping the local-only item in place. Questions Is there a supported way for a macOS app to create a library playlist and add tracks to it? Specifically: is the Apple Music API (POST /v1/me/library/playlists with relationships.tracks, and POST /v1/me/library/playlists/{id}/tracks) the intended route from a macOS app holding a MusicKit user token, and can such a playlist reference the user's own uploaded songs by their library id (i.…)? After a local file has been added to the library (via Music.app's add, or any other supported way), how can an app learn that iCloud Music Library has registered it, and what its library song id is? A notification, a MusicKit property, an Apple Music API endpoint? We would wait on that signal instead of rebuilding. Is the removal described above expected behaviour? Catalog ids are re-resolved at import time via id, ISRC and search as recommended in thread 122110, so stale catalog ids are not the cause. Reproduction Needs Sync Library on, at least 14 subscription tracks in the library, and a local audio file the library does not know yet. Prints the counts after 1 s, 21 s and 41 s, then cleans up. on run argv set localFile to POSIX file (item 1 of argv) tell application "Music" set cloudTracks to (every track of library playlist 1 whose cloud status is subscription) set idsBefore to persistent ID of every track of library playlist 1 set pl to make new user playlist with properties {name:"Reconciliation repro"} repeat with i from 1 to 2 duplicate (item i of cloudTracks) to pl end repeat set fileTrack to add localFile to pl set fileID to persistent ID of fileTrack repeat with i from 3 to 14 duplicate (item i of cloudTracks) to pl end repeat set n0 to count of tracks of pl delay 1 set n1 to count of tracks of pl delay 20 set n2 to count of tracks of pl delay 20 set n3 to count of tracks of pl delete pl if fileID is not in idsBefore then delete (first track of library playlist 1 whose persistent ID is fileID) return "after build: " & n0 & ", after 1 s: " & n1 & ", after 21 s: " & n2 & ", after 41 s: " & n3 end tell end run Output here: after build: 15, after 1 s: 15, after 21 s: 3, after 41 s: 3.
0
0
220
3d
Musickit SDK for Android broken after Apple Music app update
Hi, The Musickit SDK for Android seems to be broken after the Apple Music app update from last week. We are launching the intent like this: AuthIntentBuilder aib = authManager.createIntentBuilder(appleTokenProvider.getDeveloperToken()); Intent intent = aib.build(); authLauncher.launch(intent); A new Apple Music UI is shown. The user is asked to login with email and password. However, after succesfull login the intent returns the error USER_CANCELLED for authManager.handleTokenResult(data); This was not the case before the latest Apple Music app update. The only workaround is to logout in the Apple Music app, then retry to launch the intent in our app. This has to be done every time the music user token expires. Any ETA on fixing this issue?
10
4
2.5k
5d
MusicKit on HarmonyOS — playback approach for a platform without an official SDK, licensing question
Hello Apple Developer community, I'm building an Apple Music client for HarmonyOS (Huawei's operating system) and would like to clarify the licensing and technical approach before submitting to a third-party app store (Huawei AppGallery). I've read the Apple Developer Program License Agreement and App Store Review Guideline 4.5.2, but there are platform-specific constraints I'd like to discuss. Background Apple currently does not provide a MusicKit SDK for HarmonyOS. The available options are: MusicKit for iOS/macOS — not applicable (different OS) MusicKit for Android — ships as proprietary .aar binaries that cannot be redistributed and are not compatible with HarmonyOS's runtime MusicKit JS — available, but HarmonyOS WebView does not support FairPlay or Widevine EME, so full-song DRM playback through MusicKit JS does not work on this platform The only Apple Music API access path available to a HarmonyOS app is the REST API (api.music.apple.com) with a Developer Token (JWT, ES256) and a Music User Token obtained through the MusicKit JS authorization flow running inside a WebView. The technical constraint To deliver full-song playback for subscribed Apple Music users on HarmonyOS, our app retrieves the HLS playback URL via the Apple Music API, downloads the encrypted media segments, and decrypts them using HarmonyOS's native DRM system (WisePlay, the only CDM available on the platform). MusicKit JS's FairPlay/Widevine CDM is not compatible with HarmonyOS — WisePlay is the sole DRM implementation the OS exposes. We are aware that Section 4.5.2 states: "You may not, and You may not permit Your end users to, download, upload, or modify any MusicKit Content" and "You may play MusicKit Content only as rendered by the MusicKit APIs or MusicKit JS" What we want to clarify Our playback implementation works as follows, and we want to confirm whether it is acceptable under the license terms: No download service is offered to users. The download is purely an internal playback mechanism — the app fetches encrypted segments, decrypts them in memory / a protected sandbox, and plays them via the system AVPlayer. There is no "download button," no offline library, no user-facing download feature. Decrypted files are ephemeral and protected. Decrypted media is written to the app's private sandbox (not accessible to users or other apps), played immediately, and deleted as soon as playback ends or the song is skipped. The decrypted file never persists beyond the current playback session. No file leakage. The decrypted content is never exposed via any sharing mechanism, file picker, or external storage. It exists only within the app's protected data directory for the duration of playback. Standard playback controls are preserved. Users initiate playback and can use play / pause / skip / seek — the same controls required by 4.5.2(i). No monetization of Apple Music access. The app does not charge for Apple Music playback, does not show ads around it, and does not collect or share user data. Our question Given that: Apple has no SDK presence on HarmonyOS, MusicKit JS DRM is technically non-functional on HarmonyOS WebView, the only way to deliver full-song playback to Apple Music subscribers on this platform is to decrypt the stream using the OS's native DRM (WisePlay) with strict ephemeral handling, is this playback approach acceptable under the Apple Developer Program License Agreement, provided that: decrypted content is never persisted, shared, or exposed to users, the app only serves subscribed Apple Music users with valid Music User Tokens, all usage remains within the scope of facilitating access to the user's own Apple Music subscription? We fully respect Apple's content protection requirements and are happy to adjust the implementation (e.g., stricter deletion timing, additional sandboxing, attestation) to comply. We just want to understand whether the fundamental approach — decrypting via the host OS's DRM because Apple's own CDMs are unavailable on this platform — is permissible, or whether Apple considers HarmonyOS out of scope for full-song playback entirely. Any guidance from the MusicKit team or community members who have dealt with non-Apple-platform constraints would be greatly appreciated. Thank you.
0
0
257
1w
Can a MusicKit app add to the library without being the player?
Our macOS app uses MusicKit to search the Apple Music catalog and browse the customer's library. We are not using ApplicationMusicPlayer for playback. The customer's own Music app is the player, and our app is acting as a browser and remote for it. When the customer picks a catalog search result that is not already in their library, we would like to add it to their library, or to a playlist we create and clearly label as belonging to our app, so that it becomes playable from their library. Is using MusicLibrary to add a catalog item to the user's library a supported use of MusicKit in an app that does not itself play the content? Is creating and writing to a clearly labelled playlist of our own preferable to adding to the top-level library, or is either fine? Is there any supported way to hand a catalog item to the Music app for playback without adding it to the library first? We have tried open location with a music.apple.com URL, which opens the item's page but does not begin playback.
1
0
242
1w
Is MusicKit supported in a Mac app distributed outside the Mac App Store?
We are building a macOS application that we distribute directly from our website, signed with a Developer ID certificate and notarized. It is not on the Mac App Store and we do not plan to put it there. We want to add MusicKit so a customer can browse and play their own Apple Music library inside our app. We have the MusicKit App Service available to enable on an explicit App ID matching the app's bundle identifier, and we understand that MusicKit is not gated by an entitlement and that no private key is needed on Apple platforms. What we cannot find addressed anywhere is the distribution channel itself. Will MusicAuthorization.request and MusicLibraryRequest work in a Developer ID signed and notarized app distributed outside the Mac App Store, or does MusicKit require Mac App Store distribution?
0
0
226
1w
Apple Music real-time DJ mixing: is there an API or entitlement beyond MusicKit?
Hello, I am developing an iOS app that uses MusicKit and ApplicationMusicPlayer to create automatic transitions between songs from Apple Music. The app already analyzes tracks using BPM, musical key and danceability, orders them for compatible transitions, and uses MusicPlayer.Transition.crossfade for playback. With the public MusicKit APIs, however, I have reached a limitation. ApplicationMusicPlayer manages the playback queue and crossfade internally. I cannot independently control the outgoing and incoming Apple Music tracks as two decks, which would be required for DJ-style transitions (for example, starting the incoming track while independently controlling the outgoing track, choosing precise mix points, and managing the two playback positions during the overlap). I experimented with MusicPlayer.Queue.Entry startTime and endTime, but changing the end point is not equivalent to having independent deck control and can result in the current track ending before the desired transition. I understand that Apple Music content is protected and that direct access to decoded audio samples may intentionally not be available through the public MusicKit APIs. I am not looking to download, extract, record, or export Apple Music audio. My use case is real-time playback only, for authenticated Apple Music subscribers. My questions are: Is there a public API that allows two Apple Music tracks to be independently controlled and mixed in real time? If not, is there a restricted entitlement, API, or developer program available for DJ/mixing applications? If this capability requires a commercial or technical partnership with Apple Music rather than a public API, is there an official channel through which a developer can request or discuss such access? I am aware that some third-party DJ applications provide real-time mixing with Apple Music, so I would like to understand whether there is an officially supported integration path for other developers, rather than trying to work around the limitations of ApplicationMusicPlayer. Thank you.
0
0
513
2w
Apple Music / MusicKit Commercial Integration Enquiry – Multiplayer Music Game
Hello, Could this please be forwarded to the team responsible for Apple Music / MusicKit commercial integrations, developer partnerships and licensing? I am currently assessing the feasibility of developing a commercial browser-based multiplayer music game and would like to understand whether Apple Music and MusicKit could support the proposed use case. At a high level, players would privately select tracks from the Apple Music catalogue within the game. Once selections are complete, the application would arrange the selected tracks for sequential playback through a shared host account/device. Players would then interact with those tracks through the game. The application would provide the game functionality and would not download, store or independently redistribute full music recordings. Before progressing with development, I would appreciate clarification on the following: Commercial game use: Is integration of the Apple Music catalogue and MusicKit playback functionality into a commercial multiplayer game permitted? If specific approval, licensing or a commercial agreement with Apple is required, what is the appropriate process? Monetisation: Can the game itself be monetised through subscriptions, one-off purchases/party passes or advertising, provided users are paying for the game functionality rather than access to Apple Music or its catalogue? Apple Music subscription requirements: Would the account providing full-track playback need an active Apple Music subscription? If so, would only the host/playback account require a subscription, while other participants could join the game, search/select tracks and vote without having an Apple Music subscription themselves? Commercial playback alternative: If an Apple Music subscription is required for full-track playback, does Apple offer any commercial, licensing or partnership arrangement whereby the game operator could fund the necessary playback rights directly, rather than requiring the host to hold an individual Apple Music subscription? Catalogue access: Can players search the Apple Music catalogue and select tracks from within the application without every participant individually authenticating with Apple Music or holding an Apple Music subscription? Track availability: Can MusicKit/API functionality confirm whether a selected track is available for playback in the host's storefront/territory before accepting the selection? Playback control: Can the application create and manage a temporary playback queue containing the selected tracks and initiate sequential playback through an authorised host account/device without requiring the host to manually locate and play each track in the Apple Music application? Audio previews: Are short audio previews available through Apple Music/MusicKit, and may these be used within a commercial multiplayer game to help users identify a track before selecting it? If so, are there restrictions on preview duration or monetised use? Multi-provider support: Would Apple's terms permit Apple Music to be offered as one of several supported music playback providers within the same application, allowing a host to choose Apple Music or another supported streaming service? Additional licensing: If full recordings continue to be delivered and played through Apple Music/MusicKit, would the game developer require any additional master recording, publishing, public-performance or other music licences directly from rights-holders or collecting societies? Web/browser implementation: As the initial product is intended to be browser-based rather than a native iOS application, can the above catalogue, authentication and playback functionality be implemented through MusicKit on the Web? Are there any material differences in commercial permissions or capabilities compared with a native MusicKit implementation? Scaling: Are there different MusicKit/API access, approval, rate-limit or commercial requirements if the application progresses from development/testing to a publicly available commercial product with a significant user base? At this stage I am primarily trying to establish whether a compliant technical and commercial model exists before investing in development. If this enquiry would be better directed to an Apple Music partnership, MusicKit, licensing or business-development team, I would appreciate being pointed towards the appropriate contact. I would be happy to provide further technical details about the proposed integration if required. Kind regards, Errol Brinkman
0
0
316
3w
Apple-supported alternative to MusicKit JS authorization for child accounts
I’m developing a dedicated children’s audio player using MusicKit JS. Ideally, a child would have access to their own Apple Music library and listening history while remaining managed through Family Sharing. Apple Developer Support confirmed that MusicKit cannot be authorized for an under-13 Apple Account due to age restrictions. Is there an Apple-supported alternative, such as parent authorization with access to a child’s library through any other SDK/API path?
0
0
413
Aug ’26
Fetch tracks from a playlist
If an app allows people to create a playlist and add more songs to that created playlist, it would make sense to guard them from accidentally adding the same song to the playlist more than once. In this code, even though it is successfully receiving the existing playlist from the request, its tracks and entries always show as nil even when there are songs in the playlist. Any suggestions for how to guard against adding duplicates to a playlist? Thank you! var request = MusicLibraryRequest<Playlist>() request.filter(matching: \.name, equalTo: "AppGeneratedPlaylist") let response = try await request.response() if let existingPlaylist = response.items.first { if let tracks = existingPlaylist.entries, tracks.contains(where: { $0.id == song.id }) { print("Song is already in the playlist, so don't add again") return } else { try await MusicLibrary.shared.add(song, to: existingPlaylist) print("Added song to existing playlist: \(existingPlaylist.name)") print("Count of tracks: \(existingPlaylist.tracks?.count)") print("Count of entries: \(existingPlaylist.entries?.count)") print("Current tracks: \(existingPlaylist.tracks?.map(\.id))") print("Current entries: \(existingPlaylist.entries?.map(\.id))") } }
1
0
659
Aug ’26
Apple Music API - What am I missing?
So I'm digging through the Apple Music API trying to implement it into a music app. I feel like I have to be missing a huge piece of the puzzle. Did Apple really miss something this big?Let's take Apple Curators for instance, catalog/{storefront}/apple-curators/{id} Where do I get the list of all available Apple Curators? Same can be said for stations, artists, curators and activities. catalog/{storefront}/search looked promising for a second, until you realize you're required to supply a search term.At first glance, Top Chart Genres catalog/{storefront}/genres looked promising. Returns a full list of available Genres, but you then take one of those items and hit catalog/{storefront}/genres/{id} with it and you end up with the same exact json. Huh? Shouldn't that return me a list of albums and songs from that genre or at the very least, a link to get that information?Thus far the only thing that seems to return anything useful is /me/recent/played and /me/recommendations. /me/history/heavy-rotation is returning an empty data set, but I assume that's due to my lack of use of Apple Music (signed up a few weeks ago).Someone, please, tell me what I'm missing here. Is the API this lacking in functionality?
7
0
3.2k
Jul ’26
MusicKit JS: clarification on 3.3.6(D) for a shared listening web app
Hi, I'm an individual developer in Japan planning a web app with MusicKit JS, and I'd like to confirm my reading of the Apple Developer Program License Agreement, section 3.3.6(D) (MusicKit), before I start building. The design A "host" picks a song. Other people in the same room hear that same song. Every user plays it on their own device, through their own Apple Music subscription, in their own MusicKit JS instance. My server never receives, stores, caches, transcodes, or transmits any audio. My server only relays control metadata: a song identifier and an approximate playback position, so each client can start near the same point. Each user explicitly taps to start playback in their own browser. Standard play / pause / skip controls are available to every user. Apple Music playback is free for everyone in the app. No paywall, no ads, and no requirement to hand over personal information in order to listen. My questions 3.3.6(D) says "MusicKit Content cannot be synchronized with any other content." I read this as referring to synchronization with other media (for example, using a song as a soundtrack for video or images), and not as prohibiting multiple users independently playing the same song at roughly the same time through their own subscriptions. Is that reading correct? 3.3.6(D) says I must not "require payment for or indirectly monetize access to the Apple Music service." If Apple Music playback stays entirely free for all users, and I separately charge hosts for features unrelated to playback (for example audience analytics, custom branding for their room page, and scheduling tools), would that count as indirect monetization of access to the Apple Music service? 3.3.6(D) says "users must initiate playback." If a user taps play once and a queue then continues to the next track automatically (ordinary continuous playback), is that acceptable? Or does the user need to tap for each track individually when the host changes the selection? I'd like to build this correctly from the start, so any guidance is appreciated. If these are better directed to another channel, a pointer would be very welcome. Thanks, Sho
0
0
474
Jul ’26
MusicKit – Significant Gap Between Tracks
We’ve worked extensively on beatsinspace.net/mixes, where authenticated users with an Apple Music subscription can listen to full Beats in Space mixes through MusicKit JS on the web. https://www.beatsinspace.net/mixes Each mix is published as an Apple Music album, with the tracks acting as chapters within one continuous DJ mix. However, there is a noticeable gap between every track when listening through the website. The same mixes play seamlessly in the native Apple Music app. We’ve tested this across Chrome and Safari, as well as in a standalone prototype, and the issue appears to happen specifically with MusicKit JS playback. Do we know why this is happening and whether there is a supported way to prevent it? Would deeply appreciate any pointers here. Thank you!
0
1
482
Jul ’26
Issue setting a queue with library and non-library items at the same time (plus a couple more MusicKit issues)
As the summer continues, I have been diving deeper and deeper into MusicKit, largely with great results. A few issues have arisen that I've outlined here, feedbacks already filed and numbers included here. All of this happens on the lasted developer beta and latest Xcode beta. Thanks! FB10967343 - Setting the queue with library and non-library items at the same time doesn't work correctly In my app, I am working on a feature that lets a user shuffle songs from a collection of albums that may or may not be in their library. However, I’ve discovered an issue where the queue does not seem to work correctly when mixing these types. I’ve attempted to load ApplicationMusicPlayer by creating a Queue and to load applicationQueuePlayer using a MPMusicPlayerPlayParametersQueueDescriptor, but the same issue occurs each time. The queue is able to play songs from the same source, but if it’s been playing a library song and tries to move to a non-library song, the queue stops.  The first thing I do is pick random songs from each album, using a MusicLibraryRequest or a MusicCatalogResourceRequest as appropriate, then taking a randomElement() from the ensuing MusicItemCollection for the album.  I append each track to an array, which I then cast to MusicItemCollection so I’ve now got a MusicItemCollection consisting of the tracks I want. If I’m in MusicKit land, I simply set the queue as follows:  player.queue = ApplicationMusicPlayer.Queue(for: tracks) It takes a bit more doing in MediaPlayer, but in theory this should also work, right?    do {         let paramObjects = tracks.compactMap {             $0.playParameters         }         let params = try paramObjects.map({try JSONEncoder().encode($0)}) let dicts = try params.compactMap {               try JSONSerialization.jsonObject(with: $0, options: []) as? [String:Any]           }           let finalParams = dicts.compactMap {                 MPMusicPlayerPlayParameters(dictionary: $0)             } let descriptor = MPMusicPlayerPlayParametersQueueDescriptor(playParametersQueue: finalParams) mediaPlayer.setQueue(with: descriptor) } catch { print(error) } In either case, the following issue occurs: say that I end up with a queue made up of one library song, then one non-library song. The player will play just the first song, then it acts as if the queue has ended. Say that it has two non-library songs, then one library song. Just the two non-library songs play. Indeed, printing queue.entries shows just the number of items that were from the same source type. FB10967076 - Publishing changes from background thread error when inserting queue items When using the .insert method on ApplicationMusicPlayer.Queue on the last iOS 16 and Xcode betas, it returns a “Publishing changes from background thread” error even though the function I’m doing in is marked as a @MainActor and the stacktace indicates it was on the main thread. FB10967277 - song.with([.albums], preferredSource: .library) generates thousands of lines of EntityQueries in the console I’ve noticed that when using the preferredSource: .library when requesting additional properties on a library item creates ~6,000 of “EntityQuery” entries in the console, all in the span of a second. This doesn’t seem to be leading to any major performance issues, but it sure seems like something isn't right. let request = MusicLibraryRequest<Song>.init() do { let response = try await request.response() guard let song = response.items.first else { return } let songWithAlbums = try await song.with([.albums], preferredSource: .library) } catch { print(error) } generates the following output (except... 6,000 of them) 2022-07-31 13:02:07.729003-0400 MusicKitFutzing[9405:2192606] [EntityQuery] Finished fetching results in 0s 2022-07-31 13:02:07.729047-0400 MusicKitFutzing[9405:2192605] [EntityQuery] Finished executing query in 0.00100017s 2022-07-31 13:02:07.729202-0400 MusicKitFutzing[9405:2192611] [EntityQuery] Finished executing query in 0s 2022-07-31 13:02:07.729240-0400 MusicKitFutzing[9405:2192605] [EntityQuery] Finished fetching results in 0s
2
1
2.3k
Jul ’26
Is preview-only playback (no user authentication) permitted for a web game?
I'm building a free web-based music trivia game (guess the release year of a song). I'd like to use the Apple Music API in the following way and want to confirm it complies with the Apple Music API / MusicKit terms: The app requests only 30-second preview clips (previews[].url from the Catalog API), played through a standard HTML element. No user ever signs in with an Apple ID — there is no Music User Token; only my developer token is used, server-side, to query the catalog. The app is free, does not gate playback behind any payment, and displays "Music previews via Apple Music" attribution. Full-track playback and user subscriptions are not used at all. The Apple Music API terms describe the purpose as facilitating access to end users' Apple Music subscriptions — since a preview-only integration never touches a subscription, I want to make sure this usage is sanctioned before launching publicly. Is preview-only, unauthenticated playback of catalog previews permitted in this scenario?
0
0
602
Jul ’26
Does Android MusicKit work offline?
On the MusicKit page it says This library prompts the user to sign in to Apple Music and, if Apple Music isn’t installed on the device, helps the user download it before returning to your app. Does this mean it plays the music through the Apple Music app so it will work offline if the songs have been downloaded in the Apple Music app? I would test this myself, but it's insane that I have to pay $142 AUD for a developer account just to see if it works! Absolutely insane. Hopefully someone else can test it for me.
0
0
360
Jun ’26
Slow MusicKit library performance in Golden Gate beta 1
Hello friends! Happy WWDC. Thanks very much for all your work on MusicKit this year! I figure I’ll start things off with a bug report (sorry!). I filed a Feedback earlier today that music library operations in MusicKit are significantly slower in macOS Golden Gate beta 1 than in Tahoe. For example, a .with([.tracks]) operation on an Album takes 4-5 seconds rather than the 95ms it did in Tahoe. Sample project, traces, and sysdiagnoses in FB23037115.
2
1
510
Jun ’26
Supported MusicKit APIs for vinyl-style speed, pitch and reverse playback of subscription songs on iOS?
I am building a personal iPhone prototype with an on-screen record platter. Before enrolling in the Apple Developer Program or developing the Apple Music integration further, I would like to establish whether the core interaction is supported by public APIs. The intended interaction is: Tap the platter to play or pause an Apple Music subscription song. Hold the platter to stop playback at its current position. Move the platter forward or backward to control the direction and speed of audible playback continuously. Change pitch together with speed, like a physical record, rather than preserving the original pitch. Release the platter to smoothly return to normal playback. Hold a separate control to listen continuously at a faster speed. A prototype using an AVAudioEngine-based renderer works with unprotected local audio. I have NOT verified these behaviors with Apple Music subscription content. I understand that this local renderer does not establish feasibility for MusicKit, and I am not seeking to extract protected audio or bypass content protection. MusicPlayer.State.playbackRate is documented as settable, with positive values for forward playback and negative values for reverse playback: https://developer.apple.com/documentation/musickit/musicplayer/state-swift.class/playbackrate For ApplicationMusicPlayer on iOS, is this vinyl-style interaction supported for full Apple Music subscription songs, rather than previews or user-owned unprotected files? In particular: What playback-rate range is supported for subscription songs? Do negative rates produce audible reverse playback, and how should zero-speed holding be implemented? Is there a documented public API to make pitch follow playback speed, or to disable pitch preservation? Are frequent rate and direction changes supported for interactive scratching? Are there documented limitations on update frequency, buffering, seeking precision or responsiveness? If this interaction is outside public MusicKit capabilities, is there an official channel where an individual developer can ask about eligibility for an approved Apple Music DJ integration? I am asking for the supported API path and its limitations, not implementation details of another app. If only ordinary variable-speed playback or seeking is supported, a clear distinction from continuous vinyl-style scratching would be very helpful. The initial goal is personal use; possible App Store distribution is undecided. I have an active Apple Music subscription but am not currently enrolled in the paid Apple Developer Program. Thank you.
Replies
0
Boosts
0
Views
241
Activity
2d
Building a library playlist on macOS that mixes catalog songs and the user's own uploads in a fixed order – supported route, and how to know when an upload is registered?
Our sandboxed macOS app digitises audio cassettes and builds one playlist per cassette in the user's Apple Music library that follows the tape's order: catalog songs where a title was recognised, and the user's own recordings (AAC files the app exported from the tape) where it was not. The user has an Apple Music subscription and Sync Library on. On macOS every write on MusicLibrary is marked @available(macOS, unavailable) in the 26.5 SDK – add, add(_:to:), createPlaylist and edit (see thread 844114, which got no answer). So we build the playlist through Music.app's scripting interface: make new user playlist, duplicate <library track> to <playlist> for catalog songs, add <file> to <playlist> for own recordings. That works, with one exception that leads to our questions. What we observe Reproducible on macOS 26.6.2 / Music 26; a standalone AppleScript is at the end. A playlist built in one go from 14 subscription tracks keeps all 14. The same playlist with one local file added after the second track: all 15 entries are there right after the build and one second later. About 15 s later the playlist has 3 entries – the two catalog entries before the file, the file, and nothing that was added after it. No error anywhere. If the file has been in the library for several minutes before the playlist is built, everything stays. Adding it to the library and waiting 45 s is not enough. Meanwhile the track's cloud status stays unknown, and GET /v1/me/library/search?types=library-songs does not list it (checked for 10 minutes). Emptying the playlist and building it again ~30 s after the entries were removed keeps everything, every time. That is what we do today; it costs 30–40 s per import, and we have to tell the user that entries were removed and put back. Our reading: while the freshly added file is not yet registered in iCloud Music Library, the playlist as pushed to the server is cut at the first item the server cannot reference, and the next sync adopts the shorter list for cloud items while keeping the local-only item in place. Questions Is there a supported way for a macOS app to create a library playlist and add tracks to it? Specifically: is the Apple Music API (POST /v1/me/library/playlists with relationships.tracks, and POST /v1/me/library/playlists/{id}/tracks) the intended route from a macOS app holding a MusicKit user token, and can such a playlist reference the user's own uploaded songs by their library id (i.…)? After a local file has been added to the library (via Music.app's add, or any other supported way), how can an app learn that iCloud Music Library has registered it, and what its library song id is? A notification, a MusicKit property, an Apple Music API endpoint? We would wait on that signal instead of rebuilding. Is the removal described above expected behaviour? Catalog ids are re-resolved at import time via id, ISRC and search as recommended in thread 122110, so stale catalog ids are not the cause. Reproduction Needs Sync Library on, at least 14 subscription tracks in the library, and a local audio file the library does not know yet. Prints the counts after 1 s, 21 s and 41 s, then cleans up. on run argv set localFile to POSIX file (item 1 of argv) tell application "Music" set cloudTracks to (every track of library playlist 1 whose cloud status is subscription) set idsBefore to persistent ID of every track of library playlist 1 set pl to make new user playlist with properties {name:"Reconciliation repro"} repeat with i from 1 to 2 duplicate (item i of cloudTracks) to pl end repeat set fileTrack to add localFile to pl set fileID to persistent ID of fileTrack repeat with i from 3 to 14 duplicate (item i of cloudTracks) to pl end repeat set n0 to count of tracks of pl delay 1 set n1 to count of tracks of pl delay 20 set n2 to count of tracks of pl delay 20 set n3 to count of tracks of pl delete pl if fileID is not in idsBefore then delete (first track of library playlist 1 whose persistent ID is fileID) return "after build: " & n0 & ", after 1 s: " & n1 & ", after 21 s: " & n2 & ", after 41 s: " & n3 end tell end run Output here: after build: 15, after 1 s: 15, after 21 s: 3, after 41 s: 3.
Replies
0
Boosts
0
Views
220
Activity
3d
Musickit SDK for Android broken after Apple Music app update
Hi, The Musickit SDK for Android seems to be broken after the Apple Music app update from last week. We are launching the intent like this: AuthIntentBuilder aib = authManager.createIntentBuilder(appleTokenProvider.getDeveloperToken()); Intent intent = aib.build(); authLauncher.launch(intent); A new Apple Music UI is shown. The user is asked to login with email and password. However, after succesfull login the intent returns the error USER_CANCELLED for authManager.handleTokenResult(data); This was not the case before the latest Apple Music app update. The only workaround is to logout in the Apple Music app, then retry to launch the intent in our app. This has to be done every time the music user token expires. Any ETA on fixing this issue?
Replies
10
Boosts
4
Views
2.5k
Activity
5d
MusicKit on HarmonyOS — playback approach for a platform without an official SDK, licensing question
Hello Apple Developer community, I'm building an Apple Music client for HarmonyOS (Huawei's operating system) and would like to clarify the licensing and technical approach before submitting to a third-party app store (Huawei AppGallery). I've read the Apple Developer Program License Agreement and App Store Review Guideline 4.5.2, but there are platform-specific constraints I'd like to discuss. Background Apple currently does not provide a MusicKit SDK for HarmonyOS. The available options are: MusicKit for iOS/macOS — not applicable (different OS) MusicKit for Android — ships as proprietary .aar binaries that cannot be redistributed and are not compatible with HarmonyOS's runtime MusicKit JS — available, but HarmonyOS WebView does not support FairPlay or Widevine EME, so full-song DRM playback through MusicKit JS does not work on this platform The only Apple Music API access path available to a HarmonyOS app is the REST API (api.music.apple.com) with a Developer Token (JWT, ES256) and a Music User Token obtained through the MusicKit JS authorization flow running inside a WebView. The technical constraint To deliver full-song playback for subscribed Apple Music users on HarmonyOS, our app retrieves the HLS playback URL via the Apple Music API, downloads the encrypted media segments, and decrypts them using HarmonyOS's native DRM system (WisePlay, the only CDM available on the platform). MusicKit JS's FairPlay/Widevine CDM is not compatible with HarmonyOS — WisePlay is the sole DRM implementation the OS exposes. We are aware that Section 4.5.2 states: "You may not, and You may not permit Your end users to, download, upload, or modify any MusicKit Content" and "You may play MusicKit Content only as rendered by the MusicKit APIs or MusicKit JS" What we want to clarify Our playback implementation works as follows, and we want to confirm whether it is acceptable under the license terms: No download service is offered to users. The download is purely an internal playback mechanism — the app fetches encrypted segments, decrypts them in memory / a protected sandbox, and plays them via the system AVPlayer. There is no "download button," no offline library, no user-facing download feature. Decrypted files are ephemeral and protected. Decrypted media is written to the app's private sandbox (not accessible to users or other apps), played immediately, and deleted as soon as playback ends or the song is skipped. The decrypted file never persists beyond the current playback session. No file leakage. The decrypted content is never exposed via any sharing mechanism, file picker, or external storage. It exists only within the app's protected data directory for the duration of playback. Standard playback controls are preserved. Users initiate playback and can use play / pause / skip / seek — the same controls required by 4.5.2(i). No monetization of Apple Music access. The app does not charge for Apple Music playback, does not show ads around it, and does not collect or share user data. Our question Given that: Apple has no SDK presence on HarmonyOS, MusicKit JS DRM is technically non-functional on HarmonyOS WebView, the only way to deliver full-song playback to Apple Music subscribers on this platform is to decrypt the stream using the OS's native DRM (WisePlay) with strict ephemeral handling, is this playback approach acceptable under the Apple Developer Program License Agreement, provided that: decrypted content is never persisted, shared, or exposed to users, the app only serves subscribed Apple Music users with valid Music User Tokens, all usage remains within the scope of facilitating access to the user's own Apple Music subscription? We fully respect Apple's content protection requirements and are happy to adjust the implementation (e.g., stricter deletion timing, additional sandboxing, attestation) to comply. We just want to understand whether the fundamental approach — decrypting via the host OS's DRM because Apple's own CDMs are unavailable on this platform — is permissible, or whether Apple considers HarmonyOS out of scope for full-song playback entirely. Any guidance from the MusicKit team or community members who have dealt with non-Apple-platform constraints would be greatly appreciated. Thank you.
Replies
0
Boosts
0
Views
257
Activity
1w
Can a MusicKit app add to the library without being the player?
Our macOS app uses MusicKit to search the Apple Music catalog and browse the customer's library. We are not using ApplicationMusicPlayer for playback. The customer's own Music app is the player, and our app is acting as a browser and remote for it. When the customer picks a catalog search result that is not already in their library, we would like to add it to their library, or to a playlist we create and clearly label as belonging to our app, so that it becomes playable from their library. Is using MusicLibrary to add a catalog item to the user's library a supported use of MusicKit in an app that does not itself play the content? Is creating and writing to a clearly labelled playlist of our own preferable to adding to the top-level library, or is either fine? Is there any supported way to hand a catalog item to the Music app for playback without adding it to the library first? We have tried open location with a music.apple.com URL, which opens the item's page but does not begin playback.
Replies
1
Boosts
0
Views
242
Activity
1w
Is MusicKit supported in a Mac app distributed outside the Mac App Store?
We are building a macOS application that we distribute directly from our website, signed with a Developer ID certificate and notarized. It is not on the Mac App Store and we do not plan to put it there. We want to add MusicKit so a customer can browse and play their own Apple Music library inside our app. We have the MusicKit App Service available to enable on an explicit App ID matching the app's bundle identifier, and we understand that MusicKit is not gated by an entitlement and that no private key is needed on Apple platforms. What we cannot find addressed anywhere is the distribution channel itself. Will MusicAuthorization.request and MusicLibraryRequest work in a Developer ID signed and notarized app distributed outside the Mac App Store, or does MusicKit require Mac App Store distribution?
Replies
0
Boosts
0
Views
226
Activity
1w
Apple Music real-time DJ mixing: is there an API or entitlement beyond MusicKit?
Hello, I am developing an iOS app that uses MusicKit and ApplicationMusicPlayer to create automatic transitions between songs from Apple Music. The app already analyzes tracks using BPM, musical key and danceability, orders them for compatible transitions, and uses MusicPlayer.Transition.crossfade for playback. With the public MusicKit APIs, however, I have reached a limitation. ApplicationMusicPlayer manages the playback queue and crossfade internally. I cannot independently control the outgoing and incoming Apple Music tracks as two decks, which would be required for DJ-style transitions (for example, starting the incoming track while independently controlling the outgoing track, choosing precise mix points, and managing the two playback positions during the overlap). I experimented with MusicPlayer.Queue.Entry startTime and endTime, but changing the end point is not equivalent to having independent deck control and can result in the current track ending before the desired transition. I understand that Apple Music content is protected and that direct access to decoded audio samples may intentionally not be available through the public MusicKit APIs. I am not looking to download, extract, record, or export Apple Music audio. My use case is real-time playback only, for authenticated Apple Music subscribers. My questions are: Is there a public API that allows two Apple Music tracks to be independently controlled and mixed in real time? If not, is there a restricted entitlement, API, or developer program available for DJ/mixing applications? If this capability requires a commercial or technical partnership with Apple Music rather than a public API, is there an official channel through which a developer can request or discuss such access? I am aware that some third-party DJ applications provide real-time mixing with Apple Music, so I would like to understand whether there is an officially supported integration path for other developers, rather than trying to work around the limitations of ApplicationMusicPlayer. Thank you.
Replies
0
Boosts
0
Views
513
Activity
2w
Apple Music for DJ App
Hi there, I recently launched a dj app to the mac app store, and was wondering how I could access songs for mixing purposes via Apple Music just like how serato, rekordbox, djay, and other DJ apps do? Thanks, Gunek
Replies
1
Boosts
0
Views
1.5k
Activity
2w
can I listen to music from the spotify app on the apple watch?
I don't use itune for my music usually. Instead I use an app called spotify. Can I add this to the apple watch and listen to my music while running?
Replies
2
Boosts
0
Views
514
Activity
3w
Apple Music / MusicKit Commercial Integration Enquiry – Multiplayer Music Game
Hello, Could this please be forwarded to the team responsible for Apple Music / MusicKit commercial integrations, developer partnerships and licensing? I am currently assessing the feasibility of developing a commercial browser-based multiplayer music game and would like to understand whether Apple Music and MusicKit could support the proposed use case. At a high level, players would privately select tracks from the Apple Music catalogue within the game. Once selections are complete, the application would arrange the selected tracks for sequential playback through a shared host account/device. Players would then interact with those tracks through the game. The application would provide the game functionality and would not download, store or independently redistribute full music recordings. Before progressing with development, I would appreciate clarification on the following: Commercial game use: Is integration of the Apple Music catalogue and MusicKit playback functionality into a commercial multiplayer game permitted? If specific approval, licensing or a commercial agreement with Apple is required, what is the appropriate process? Monetisation: Can the game itself be monetised through subscriptions, one-off purchases/party passes or advertising, provided users are paying for the game functionality rather than access to Apple Music or its catalogue? Apple Music subscription requirements: Would the account providing full-track playback need an active Apple Music subscription? If so, would only the host/playback account require a subscription, while other participants could join the game, search/select tracks and vote without having an Apple Music subscription themselves? Commercial playback alternative: If an Apple Music subscription is required for full-track playback, does Apple offer any commercial, licensing or partnership arrangement whereby the game operator could fund the necessary playback rights directly, rather than requiring the host to hold an individual Apple Music subscription? Catalogue access: Can players search the Apple Music catalogue and select tracks from within the application without every participant individually authenticating with Apple Music or holding an Apple Music subscription? Track availability: Can MusicKit/API functionality confirm whether a selected track is available for playback in the host's storefront/territory before accepting the selection? Playback control: Can the application create and manage a temporary playback queue containing the selected tracks and initiate sequential playback through an authorised host account/device without requiring the host to manually locate and play each track in the Apple Music application? Audio previews: Are short audio previews available through Apple Music/MusicKit, and may these be used within a commercial multiplayer game to help users identify a track before selecting it? If so, are there restrictions on preview duration or monetised use? Multi-provider support: Would Apple's terms permit Apple Music to be offered as one of several supported music playback providers within the same application, allowing a host to choose Apple Music or another supported streaming service? Additional licensing: If full recordings continue to be delivered and played through Apple Music/MusicKit, would the game developer require any additional master recording, publishing, public-performance or other music licences directly from rights-holders or collecting societies? Web/browser implementation: As the initial product is intended to be browser-based rather than a native iOS application, can the above catalogue, authentication and playback functionality be implemented through MusicKit on the Web? Are there any material differences in commercial permissions or capabilities compared with a native MusicKit implementation? Scaling: Are there different MusicKit/API access, approval, rate-limit or commercial requirements if the application progresses from development/testing to a publicly available commercial product with a significant user base? At this stage I am primarily trying to establish whether a compliant technical and commercial model exists before investing in development. If this enquiry would be better directed to an Apple Music partnership, MusicKit, licensing or business-development team, I would appreciate being pointed towards the appropriate contact. I would be happy to provide further technical details about the proposed integration if required. Kind regards, Errol Brinkman
Replies
0
Boosts
0
Views
316
Activity
3w
Apple-supported alternative to MusicKit JS authorization for child accounts
I’m developing a dedicated children’s audio player using MusicKit JS. Ideally, a child would have access to their own Apple Music library and listening history while remaining managed through Family Sharing. Apple Developer Support confirmed that MusicKit cannot be authorized for an under-13 Apple Account due to age restrictions. Is there an Apple-supported alternative, such as parent authorization with access to a child’s library through any other SDK/API path?
Replies
0
Boosts
0
Views
413
Activity
Aug ’26
Fetch tracks from a playlist
If an app allows people to create a playlist and add more songs to that created playlist, it would make sense to guard them from accidentally adding the same song to the playlist more than once. In this code, even though it is successfully receiving the existing playlist from the request, its tracks and entries always show as nil even when there are songs in the playlist. Any suggestions for how to guard against adding duplicates to a playlist? Thank you! var request = MusicLibraryRequest<Playlist>() request.filter(matching: \.name, equalTo: "AppGeneratedPlaylist") let response = try await request.response() if let existingPlaylist = response.items.first { if let tracks = existingPlaylist.entries, tracks.contains(where: { $0.id == song.id }) { print("Song is already in the playlist, so don't add again") return } else { try await MusicLibrary.shared.add(song, to: existingPlaylist) print("Added song to existing playlist: \(existingPlaylist.name)") print("Count of tracks: \(existingPlaylist.tracks?.count)") print("Count of entries: \(existingPlaylist.entries?.count)") print("Current tracks: \(existingPlaylist.tracks?.map(\.id))") print("Current entries: \(existingPlaylist.entries?.map(\.id))") } }
Replies
1
Boosts
0
Views
659
Activity
Aug ’26
Apple Music API - Heavy Rotation Endpoint Broken?
The endpoint: https://api.music.apple.com/v1/me/history/heavy-rotation seems to just be returning an empty data array. Is this a bug, or is the endpoint not supported anymore? I would like to display a user's recent listening history for my app, is there another way to do this?
Replies
4
Boosts
1
Views
1.5k
Activity
Jul ’26
Apple Music API - What am I missing?
So I'm digging through the Apple Music API trying to implement it into a music app. I feel like I have to be missing a huge piece of the puzzle. Did Apple really miss something this big?Let's take Apple Curators for instance, catalog/{storefront}/apple-curators/{id} Where do I get the list of all available Apple Curators? Same can be said for stations, artists, curators and activities. catalog/{storefront}/search looked promising for a second, until you realize you're required to supply a search term.At first glance, Top Chart Genres catalog/{storefront}/genres looked promising. Returns a full list of available Genres, but you then take one of those items and hit catalog/{storefront}/genres/{id} with it and you end up with the same exact json. Huh? Shouldn't that return me a list of albums and songs from that genre or at the very least, a link to get that information?Thus far the only thing that seems to return anything useful is /me/recent/played and /me/recommendations. /me/history/heavy-rotation is returning an empty data set, but I assume that's due to my lack of use of Apple Music (signed up a few weeks ago).Someone, please, tell me what I'm missing here. Is the API this lacking in functionality?
Replies
7
Boosts
0
Views
3.2k
Activity
Jul ’26
MusicKit JS: clarification on 3.3.6(D) for a shared listening web app
Hi, I'm an individual developer in Japan planning a web app with MusicKit JS, and I'd like to confirm my reading of the Apple Developer Program License Agreement, section 3.3.6(D) (MusicKit), before I start building. The design A "host" picks a song. Other people in the same room hear that same song. Every user plays it on their own device, through their own Apple Music subscription, in their own MusicKit JS instance. My server never receives, stores, caches, transcodes, or transmits any audio. My server only relays control metadata: a song identifier and an approximate playback position, so each client can start near the same point. Each user explicitly taps to start playback in their own browser. Standard play / pause / skip controls are available to every user. Apple Music playback is free for everyone in the app. No paywall, no ads, and no requirement to hand over personal information in order to listen. My questions 3.3.6(D) says "MusicKit Content cannot be synchronized with any other content." I read this as referring to synchronization with other media (for example, using a song as a soundtrack for video or images), and not as prohibiting multiple users independently playing the same song at roughly the same time through their own subscriptions. Is that reading correct? 3.3.6(D) says I must not "require payment for or indirectly monetize access to the Apple Music service." If Apple Music playback stays entirely free for all users, and I separately charge hosts for features unrelated to playback (for example audience analytics, custom branding for their room page, and scheduling tools), would that count as indirect monetization of access to the Apple Music service? 3.3.6(D) says "users must initiate playback." If a user taps play once and a queue then continues to the next track automatically (ordinary continuous playback), is that acceptable? Or does the user need to tap for each track individually when the host changes the selection? I'd like to build this correctly from the start, so any guidance is appreciated. If these are better directed to another channel, a pointer would be very welcome. Thanks, Sho
Replies
0
Boosts
0
Views
474
Activity
Jul ’26
MusicKit – Significant Gap Between Tracks
We’ve worked extensively on beatsinspace.net/mixes, where authenticated users with an Apple Music subscription can listen to full Beats in Space mixes through MusicKit JS on the web. https://www.beatsinspace.net/mixes Each mix is published as an Apple Music album, with the tracks acting as chapters within one continuous DJ mix. However, there is a noticeable gap between every track when listening through the website. The same mixes play seamlessly in the native Apple Music app. We’ve tested this across Chrome and Safari, as well as in a standalone prototype, and the issue appears to happen specifically with MusicKit JS playback. Do we know why this is happening and whether there is a supported way to prevent it? Would deeply appreciate any pointers here. Thank you!
Replies
0
Boosts
1
Views
482
Activity
Jul ’26
Issue setting a queue with library and non-library items at the same time (plus a couple more MusicKit issues)
As the summer continues, I have been diving deeper and deeper into MusicKit, largely with great results. A few issues have arisen that I've outlined here, feedbacks already filed and numbers included here. All of this happens on the lasted developer beta and latest Xcode beta. Thanks! FB10967343 - Setting the queue with library and non-library items at the same time doesn't work correctly In my app, I am working on a feature that lets a user shuffle songs from a collection of albums that may or may not be in their library. However, I’ve discovered an issue where the queue does not seem to work correctly when mixing these types. I’ve attempted to load ApplicationMusicPlayer by creating a Queue and to load applicationQueuePlayer using a MPMusicPlayerPlayParametersQueueDescriptor, but the same issue occurs each time. The queue is able to play songs from the same source, but if it’s been playing a library song and tries to move to a non-library song, the queue stops.  The first thing I do is pick random songs from each album, using a MusicLibraryRequest or a MusicCatalogResourceRequest as appropriate, then taking a randomElement() from the ensuing MusicItemCollection for the album.  I append each track to an array, which I then cast to MusicItemCollection so I’ve now got a MusicItemCollection consisting of the tracks I want. If I’m in MusicKit land, I simply set the queue as follows:  player.queue = ApplicationMusicPlayer.Queue(for: tracks) It takes a bit more doing in MediaPlayer, but in theory this should also work, right?    do {         let paramObjects = tracks.compactMap {             $0.playParameters         }         let params = try paramObjects.map({try JSONEncoder().encode($0)}) let dicts = try params.compactMap {               try JSONSerialization.jsonObject(with: $0, options: []) as? [String:Any]           }           let finalParams = dicts.compactMap {                 MPMusicPlayerPlayParameters(dictionary: $0)             } let descriptor = MPMusicPlayerPlayParametersQueueDescriptor(playParametersQueue: finalParams) mediaPlayer.setQueue(with: descriptor) } catch { print(error) } In either case, the following issue occurs: say that I end up with a queue made up of one library song, then one non-library song. The player will play just the first song, then it acts as if the queue has ended. Say that it has two non-library songs, then one library song. Just the two non-library songs play. Indeed, printing queue.entries shows just the number of items that were from the same source type. FB10967076 - Publishing changes from background thread error when inserting queue items When using the .insert method on ApplicationMusicPlayer.Queue on the last iOS 16 and Xcode betas, it returns a “Publishing changes from background thread” error even though the function I’m doing in is marked as a @MainActor and the stacktace indicates it was on the main thread. FB10967277 - song.with([.albums], preferredSource: .library) generates thousands of lines of EntityQueries in the console I’ve noticed that when using the preferredSource: .library when requesting additional properties on a library item creates ~6,000 of “EntityQuery” entries in the console, all in the span of a second. This doesn’t seem to be leading to any major performance issues, but it sure seems like something isn't right. let request = MusicLibraryRequest<Song>.init() do { let response = try await request.response() guard let song = response.items.first else { return } let songWithAlbums = try await song.with([.albums], preferredSource: .library) } catch { print(error) } generates the following output (except... 6,000 of them) 2022-07-31 13:02:07.729003-0400 MusicKitFutzing[9405:2192606] [EntityQuery] Finished fetching results in 0s 2022-07-31 13:02:07.729047-0400 MusicKitFutzing[9405:2192605] [EntityQuery] Finished executing query in 0.00100017s 2022-07-31 13:02:07.729202-0400 MusicKitFutzing[9405:2192611] [EntityQuery] Finished executing query in 0s 2022-07-31 13:02:07.729240-0400 MusicKitFutzing[9405:2192605] [EntityQuery] Finished fetching results in 0s
Replies
2
Boosts
1
Views
2.3k
Activity
Jul ’26
Is preview-only playback (no user authentication) permitted for a web game?
I'm building a free web-based music trivia game (guess the release year of a song). I'd like to use the Apple Music API in the following way and want to confirm it complies with the Apple Music API / MusicKit terms: The app requests only 30-second preview clips (previews[].url from the Catalog API), played through a standard HTML element. No user ever signs in with an Apple ID — there is no Music User Token; only my developer token is used, server-side, to query the catalog. The app is free, does not gate playback behind any payment, and displays "Music previews via Apple Music" attribution. Full-track playback and user subscriptions are not used at all. The Apple Music API terms describe the purpose as facilitating access to end users' Apple Music subscriptions — since a preview-only integration never touches a subscription, I want to make sure this usage is sanctioned before launching publicly. Is preview-only, unauthenticated playback of catalog previews permitted in this scenario?
Replies
0
Boosts
0
Views
602
Activity
Jul ’26
Does Android MusicKit work offline?
On the MusicKit page it says This library prompts the user to sign in to Apple Music and, if Apple Music isn’t installed on the device, helps the user download it before returning to your app. Does this mean it plays the music through the Apple Music app so it will work offline if the songs have been downloaded in the Apple Music app? I would test this myself, but it's insane that I have to pay $142 AUD for a developer account just to see if it works! Absolutely insane. Hopefully someone else can test it for me.
Replies
0
Boosts
0
Views
360
Activity
Jun ’26
Slow MusicKit library performance in Golden Gate beta 1
Hello friends! Happy WWDC. Thanks very much for all your work on MusicKit this year! I figure I’ll start things off with a bug report (sorry!). I filed a Feedback earlier today that music library operations in MusicKit are significantly slower in macOS Golden Gate beta 1 than in Tahoe. For example, a .with([.tracks]) operation on an Album takes 4-5 seconds rather than the 95ms it did in Tahoe. Sample project, traces, and sysdiagnoses in FB23037115.
Replies
2
Boosts
1
Views
510
Activity
Jun ’26