let cloudServiceController = SKCloudServiceController()
let musicPlayer = MPMusicPlayerController.systemMusicPlayer
self.cloudServiceController.requestCapabilities { capabilities, error in
guard capabilities.contains(.musicCatalogPlayback) else { return }
self.canMusicCatalogPlayback = true
}
let tracks = album!.relationships!.tracks!
let trackIDs = tracks.map { $0.id! }
let startTrackID = tracks[indexPath.row].id!
let descriptor = MPMusicPlayerStoreQueueDescriptor(storeIDs: trackIDs)
descriptor.startItemID = startTrackID
musicPlayer.setQueue(with: descriptor)
musicPlayer.play()
I working on MediaPlayer and I got an error as below.
MPMusicPlayerController play] completed error: Error Domain=MPCPlayerRequestErrorDomain Code=1000 "Failed to send command 0" UserInfo={NSDebugDescription=Failed to send command 0, NSUnderlyingError=0x280670f00 {Error Domain=MPCPlayerRequestErrorDomain Code=1000 "Failed to send command 0 (MRSendCommandError = 4)" UserInfo={NSDebugDescription=Failed to send command 0 (MRSendCommandError = 4)}}}
I went through below link but I need to resolve this issue.
https://forums.developer.apple.com/thread/100476
please help me