mpmusicplayercontroller

Lock Screen iPod Controls Not Working With Spotify Music Player

大兔子大兔子 提交于 2019-12-05 06:04:18
I added the Spotify player to my app which also plays music using the MPMusicPlayerController. When music is playing from Spotify and the screen is locked, the remote control events are not received for play/pause and FFW/RWD when the user presses these buttons on the locked screen. If music is playing from the MPMusicPlayerController, I am able to receive the remote control events based on the following code: -(void) ViewDidLoad { ... [[UIApplication sharedApplication] beginReceivingRemoteControlEvents]; [self becomeFirstResponder]; ... } and - (BOOL) canBecomeFirstResponder { return YES; } -

iOS - get programmatically queue of items currently playing

一世执手 提交于 2019-12-05 01:40:05
I want to get programmatically queue currently played in native Music App. I can use MPMusicPlayerController to get currently playing item but I want to get not only the item but whole playing queue. Is it possible to do it using AVFoundation or any other library? I'm afraid this is not possible. Apple does not give us access to this information from any libraries. bugloaf I'm pretty sure this is not possible through any public API. The Ecoute app that @sooper mentions must be using private APIs. I did a little experiment in the codebase of my own music app. First I used this code to list all

Audio Session “Ducking” Broken in iOS 4…?

怎甘沉沦 提交于 2019-12-04 22:03:00
问题 I've an app which uses the MPAudioPlayerController to access the iPod music library, and an AVAudioPlayer to overlay audio on top of the music. I've used this documentation as a guide. Specifically: Finally, you can enhance a category to automatically lower the volume of other audio when your audio is playing. This could be used, for example, in an exercise application. Say the user is exercising along to their iPod when your application wants to overlay a verbal message—for instance, “You’ve

MPMusicPlayerControllerMutableQueue insert an Apple Music song not working

送分小仙女□ 提交于 2019-12-04 14:08:15
问题 So I have been trying to use the MusicKit APIs for a few days now. I have been attempting to use the MPMusicPlayerApplicationController and MutableQueue APIs. I have queue initialized already using setQueue(with: [String]) with an array of store identifiers for Apple Music songs. Then I want to allow the user to reorder the songs in the queue. I use the following code to attempt that. let musicPlayerController = MPMusicPlayerController.applicationQueuePlayer musicPlayerController.perform

How can we control bass of music in iPhone sdk? [closed]

这一生的挚爱 提交于 2019-12-04 06:12:05
I want to control the bass of song played by user from iPod music library. I've searched on Google and got some AudioMixer samples which were of no help, but now I have got bass library i.e. libbass.a from http://www.un4seen.com/ which I think is quite useful. But I don't know how I should adjust the bass of the song using slider. Recently I got one more sample regarding this. But here the issue in this sample is I'm getting all equalizer's types like Dance, Pop, Rock, Bass, Jazz, Acoustic, Classical etc preset/predefined in an array given by AudioUnit Framework. But I want implement only bass

MPMusicPlayerController breaks lock screen controls

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-03 20:56:51
I'm attempting to use MPMusicPlayerController to play apple music songs, but I can't get the lock screen controls to work. It seems as though MPMusicPlayerController overridess the remoteControlReceivedWithEvent listener. Here is how I set up my controller: self.player = [MPMusicPlayerController applicationMusicPlayer]; self.player.repeatMode = MPMusicRepeatModeNone; self.player.shuffleMode = MPMusicShuffleModeOff; [self.player beginGeneratingPlaybackNotifications]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handlePlaybackStateChanged:) name

beginReceivingRemoteControlEvents not triggering events for Apple Music

我与影子孤独终老i 提交于 2019-12-03 13:08:44
I am playing Apple Music from my application , the apple music player code is as - -(void) submitAppleMusicTrackWithProductID: (NSString *) productID // productID in US is the last numbers after i= in the share URL from Apple Music { [SKCloudServiceController requestAuthorization:^(SKCloudServiceAuthorizationStatus status) { NSLog(@"status is %ld", (long)status); SKCloudServiceController *cloudServiceController; cloudServiceController = [[SKCloudServiceController alloc] init]; [cloudServiceController requestCapabilitiesWithCompletionHandler:^(SKCloudServiceCapability capabilities, NSError *

Audio Session “Ducking” Broken in iOS 4…?

风流意气都作罢 提交于 2019-12-03 13:08:19
I've an app which uses the MPAudioPlayerController to access the iPod music library, and an AVAudioPlayer to overlay audio on top of the music. I've used this documentation as a guide. Specifically: Finally, you can enhance a category to automatically lower the volume of other audio when your audio is playing. This could be used, for example, in an exercise application. Say the user is exercising along to their iPod when your application wants to overlay a verbal message—for instance, “You’ve been rowing for 10 minutes.” To ensure that the message from your application is intelligible, apply

MPMusicPlayerControllerMutableQueue insert an Apple Music song not working

那年仲夏 提交于 2019-12-03 09:32:31
So I have been trying to use the MusicKit APIs for a few days now. I have been attempting to use the MPMusicPlayerApplicationController and MutableQueue APIs. I have queue initialized already using setQueue(with: [String]) with an array of store identifiers for Apple Music songs. Then I want to allow the user to reorder the songs in the queue. I use the following code to attempt that. let musicPlayerController = MPMusicPlayerController.applicationQueuePlayer musicPlayerController.perform(queueTransaction: { queue in let afterItem = queue.items.first(where: { $0.playbackStoreID == predecessorId

Background Audio and Remote Control Support using MPMusicPlayerController on iOS 4. Is this even possible?

拥有回忆 提交于 2019-12-03 08:40:18
问题 I've spent two days on this and have gotten nowhere. I'm trying to use [MPMusicPlayerController applicationMusicPlayer] to play audio chosen from the user's iPod library and have it run in the background as well as support remote events. Now getting the music actually playing is the easy part. Get the instance, pick the songs, assign the music queue and play. Done and done. BUT... a) I can't get it to play in the background, and b) even when in the foreground I can't get the remote control