Post

Replies

Boosts

Views

Activity

Reply to Unable to prepareToPlay() only on release build
func addItemsToQueue<T>( items: MusicItemCollection<T>, at position: ApplicationMusicPlayer.Queue.EntryInsertionPosition ) async where T: PlayableMusicItem { do { if player.queue.entries.isEmpty { player.queue = .init(for: items) } else { try await player.queue.insert(items, position: position) } } catch { await logger?.error( "Unable to add songs to player queue: \(error.localizedDescription)" ) return } do { if !player.isPreparedToPlay { await logger?.trace("Preparing player...") try await player.prepareToPlay() } } catch { await logger?.critical("Unable to prepare player: \(error.localizedDescription)") } } This is a snippet which produces this error. For some insane reason it only works on release builds. I am completely frustrated and there is no way to check what is going wrong inside the MusicKit library
Topic: Media Technologies SubTopic: General Tags:
Oct ’24
Reply to Unable to prepareToPlay() only on release build
Solved: Since my project is a SwiftPM package, the release binary has to be manually codesigned so that MediaPlayer can work properly.
Topic: Media Technologies SubTopic: General Tags:
Replies
Boosts
Views
Activity
Nov ’24
Reply to Unable to prepareToPlay() only on release build
func addItemsToQueue<T>( items: MusicItemCollection<T>, at position: ApplicationMusicPlayer.Queue.EntryInsertionPosition ) async where T: PlayableMusicItem { do { if player.queue.entries.isEmpty { player.queue = .init(for: items) } else { try await player.queue.insert(items, position: position) } } catch { await logger?.error( "Unable to add songs to player queue: \(error.localizedDescription)" ) return } do { if !player.isPreparedToPlay { await logger?.trace("Preparing player...") try await player.prepareToPlay() } } catch { await logger?.critical("Unable to prepare player: \(error.localizedDescription)") } } This is a snippet which produces this error. For some insane reason it only works on release builds. I am completely frustrated and there is no way to check what is going wrong inside the MusicKit library
Topic: Media Technologies SubTopic: General Tags:
Replies
Boosts
Views
Activity
Oct ’24
Reply to MPMusicPlayerControllerErrorDomain error 6
Having the same issue but on macOS 15.0.1 only on release builds of the app. The debug version works perfectly.
Topic: Media Technologies SubTopic: Audio Tags:
Replies
Boosts
Views
Activity
Oct ’24