iPod Volume Slider That's Not Linked To Master Volume
What is the code that works for the UISlider that changes the volume for the iPod controls but doesn't link with the master iPhone volume?
__________________
My new app that was recently featured in the App Store section: Soundsations
Creator of the most awesome app iWasted
Also Created the Audience app
- (void)viewDidLoad {
[super viewDidLoad];
self.musicPlayer = [MPMusicPlayerController iPodMusicPlayer];
// Initial sync of display with music player state
[self handleNowPlayingItemChanged:nil];
[self handlePlaybackStateChanged:nil];
[self handleExternalVolumeChanged:nil];
// Register for music player notifications
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
[notificationCenter addObserver:self
selector:@selector(handleNowPlayingItemChanged:)
name:MPMusicPlayerControllerNowPlayingItemDidChangeNotification
object:self.musicPlayer];
[notificationCenter addObserver:self
selector:@selector(handlePlaybackStateChanged:)
name:MPMusicPlayerControllerPlaybackStateDidChangeNotification
object:self.musicPlayer];
[notificationCenter addObserver:self
selector:@selector(handleExternalVolumeChanged:)
name:MPMusicPlayerControllerVolumeDidChangeNotification
object:self.musicPlayer];
[self.musicPlayer beginGeneratingPlaybackNotifications];
- (void)viewDidUnload {
// Stop music player notifications
[[NSNotificationCenter defaultCenter] removeObserver:self
name:MPMusicPlayerControllerNowPlayingItemDidChangeNotification
object:self.musicPlayer];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:MPMusicPlayerControllerPlaybackStateDidChangeNotification
object:self.musicPlayer];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:MPMusicPlayerControllerVolumeDidChangeNotification
object:self.musicPlayer];
[self.musicPlayer endGeneratingPlaybackNotifications];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
self.musicPlayer = nil;
self.playPauseButton = nil;
self.songLabel = nil;
self.artistLabel = nil;
self.albumLabel = nil;
self.artworkImageView = nil;
self.volumeSlider = nil;
}
// When the volume changes, sync the volume slider
- (void)handleExternalVolumeChanged:(id)notification {
// self.volumeSlider is a UISlider used to display music volume.
// self.musicPlayer.volume ranges from 0.0 to 1.0.
[self.volumeSlider setValue:self.musicPlayer.volume animated:YES];
}
- (IBAction)volumeSliderChanged:(id)sender {
self.musicPlayer.volume = self.volumeSlider.value;
}
Here is the code, what am I do I need to change???
__________________
My new app that was recently featured in the App Store section: Soundsations
Creator of the most awesome app iWasted
Also Created the Audience app
__________________
My new app that was recently featured in the App Store section: Soundsations
Creator of the most awesome app iWasted
Also Created the Audience app
__________________
My new app that was recently featured in the App Store section: Soundsations
Creator of the most awesome app iWasted
Also Created the Audience app
What do u mean by system volume? ipod's volume or the ringer? I can help...
I'm talking about the system volume. I have music and sounds playing in the background but when the background music volume is lowered I don't want the music from the iPod to be effected.
__________________
My new app that was recently featured in the App Store section: Soundsations
Creator of the most awesome app iWasted
Also Created the Audience app