Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void) handle_PlaybackStateChanged: (id) notification {
- MPMusicPlaybackState playbackState = [self.player playbackState];
- if (playbackState == MPMusicPlaybackStatePaused) {
- self.textLabel.text = @"play";
- [PlayButton setTitle:@"STOP" forState:UIControlStateNormal]; // To set the title
- NSLog (@"This is paused");
- self.playBarButton.title = @"Play";
- self.PlayButton = PlayButton;
- [self.PlayButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
- } else if (playbackState == MPMusicPlaybackStatePlaying) {
- self.textLabel.text = @"pause";
- [PlayButton setTitle:@"Pause" forState:UIControlStateNormal];
- self.PlayButton = PauseButton;
- NSLog (@"This is playing");
- } else if (playbackState == MPMusicPlaybackStateStopped) {
- self.textLabel.text = @"Play";
- self.PlayButton = PlayButton;
- [self.player stop];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement