Spotify on iOS has a very interesting Control Center integration. Notice the hamburger button below.
The same thing is on the lock screen!
How do they do those? Is there an API in MPMediaCenter or something?
Go to Home > Settings > Playback > Equalizer and switch it on. Then, tap one of the presets available to you or customize it by dragging the dots yourself. If you're an Android user, the option to use the Spotify equalizer may depend on your device manufacturer.
Check the toggle button next to the 'Explicit content' option on the 'Settings' screen. If it is green, click to turn it grey. A grey toggle suggests that playback of explicit-rated content is OFF. Green represents enabling explicit content playback on Spotify.
How to Make Spotify Sound Better: 6 Settings to Tweak. 1 1. Normalize Volume Level. We’ve all experienced that moment when a new song plays a lot louder than the previous one. With Normalize, Spotify adjusts ... 2 2. Audio Quality Control. 3 3. Equalizer. 4 4. Crossfade. 5 5. Gapless. More items
Here are the top Spotify settings that you can change to make the most difference. 1. Normalize Volume Level. We’ve all experienced that moment when a new song plays a lot louder than the previous one. With Normalize, Spotify adjusts the volume levels for you to prevent this from happening. To change this, go to Home > Settings > Normalize.
If you’re an Android user, the option to equalize on Spotify may depend on your device manufacturer. To know if your device can handle it, you can check the option at Home > Settings > Audio Quality.
We’ve all experienced that moment when a new song plays a lot louder than the previous one. With Normalize, Spotify adjusts the volume levels for you to prevent this from happening. To change this, go to Home > Settings > Normalize. Then, you can select the Volume Level that automatically adjusts all Spotify tracks to your environment.
Yes, there is an API for that
Looking at the instructions found in the apple docs regarding remote control events you get two classes MPRemoteCommand
and MPRemoteCommandCenter
highlighted. Looking up MPRemoteCommandCenter will show you there are a multitude of commands like likeCommand
or dislikeCommand
you can add handlers for. Adding handlers to those commands causes them beeing displayed in the control center.
Below is some all-in-one code achieving pretty much exactly the same results shown on your screenshots:
- (void)showCustomizedControlCenter {
/* basic audio initialization */
NSString *soundFilePath = [NSString stringWithFormat:@"%@/test.mp3", [[NSBundle mainBundle] resourcePath]];
NSURL *soundFileURL = [NSURL fileURLWithPath:soundFilePath];
self.player = [[AVAudioPlayer alloc] initWithContentsOfURL:soundFileURL error:nil];
self.player.numberOfLoops = -1;
[self.player play];
/* registering as global audio playback */
[[AVAudioSession sharedInstance] setActive:YES error:nil];
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
/* the cool control center registration */
MPRemoteCommandCenter *commandCenter = [MPRemoteCommandCenter sharedCommandCenter];
[commandCenter.playCommand addTargetWithHandler:^MPRemoteCommandHandlerStatus(MPRemoteCommandEvent *event) {
return MPRemoteCommandHandlerStatusSuccess;
}];
[commandCenter.dislikeCommand addTargetWithHandler:^MPRemoteCommandHandlerStatus(MPRemoteCommandEvent *event) {
return MPRemoteCommandHandlerStatusSuccess;
}];
[commandCenter.likeCommand addTargetWithHandler:^MPRemoteCommandHandlerStatus(MPRemoteCommandEvent *event) {
return MPRemoteCommandHandlerStatusSuccess;
}];
[commandCenter.nextTrackCommand addTargetWithHandler:^MPRemoteCommandHandlerStatus(MPRemoteCommandEvent *event) {
return MPRemoteCommandHandlerStatusSuccess;
}];
/* setting the track title, album title and button texts to match the screenshot */
commandCenter.likeCommand.localizedTitle = @"Thumb Up";
commandCenter.dislikeCommand.localizedTitle = @"Thumb down";
MPNowPlayingInfoCenter* info = [MPNowPlayingInfoCenter defaultCenter];
NSMutableDictionary* newInfo = [NSMutableDictionary dictionary];
[newInfo setObject:@"Mixtape" forKey:MPMediaItemPropertyTitle];
[newInfo setObject:@"Jamie Cullum" forKey:MPMediaItemPropertyArtist];
info.nowPlayingInfo = newInfo;
}
In addition to writing the code you need to
AVFoundation
to your project#import <AVFoundation/AVFoundation.h>
and #import <MediaPlayer/MediaPlayer.h>
"Audio and AirPlay"
in the app settings.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With