Code Block let applicationMusicPlayer = MPMusicPlayerController.applicationMusicPlayer applicationMusicPlayer.setQueue(with: [trackID]) applicationMusicPlayer.prepareToPlay(completionHandler:{ error in if let error = error { print(error.localizedDescription) return } DispatchQueue.main.async{ applicationMusicPlayer.play() } }
These are the various errors I'm getting:
[SDKPlayback] Failed to prepareToPlay error: Error Domain=MPMusicPlayerControllerErrorDomain Code=2 "Queue was interrupted by another queue" UserInfo={NSDebugDescription=Queue was interrupted by another queue}
[SDKPlayback] Failed to prepareToPlay error: Error Domain=MPMusicPlayerControllerErrorDomain Code=9 "Preparing queue timed out" UserInfo={NSDebugDescription=Preparing queue timed out}
[SDKPlayback] Failed to prepareToPlay error: Error Domain=MPMusicPlayerControllerErrorDomain Code=6 "Failed to prepare to play" UserInfo={NSDebugDescription=Failed to prepare to play}
[SDKPlayback] applicationQueuePlayer _establishConnectionIfNeeded timeout [ping did not pong]
I have the same issue when running the iPad version on my M1 Mac, and it's blocking the main thread.
[SDKPlayback] systemMusicPlayer _establishConnectionIfNeeded timeout [ping did not pong] [SDKPlayback] SYNC-WATCHDOG-1: Attempting to wake up the remote process [SDKPlayback] systemMusicPlayer _establishConnectionIfNeeded timeout [ping did not pong] [SDKPlayback] SYNC-WATCHDOG-2: Tearing down connection
This drives me crazy.