Advertisement
Guest User

Untitled

a guest
Apr 27th, 2015
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. - (void) handle_PlaybackStateChanged: (id) notification {
  2.  
  3. MPMusicPlaybackState playbackState = [self.player playbackState];
  4.  
  5.  
  6. if (playbackState == MPMusicPlaybackStatePaused) {
  7.  
  8. self.textLabel.text = @"play";
  9. [PlayButton setTitle:@"STOP" forState:UIControlStateNormal]; // To set the title
  10.  
  11. NSLog (@"This is paused");
  12. self.playBarButton.title = @"Play";
  13.  
  14. self.PlayButton = PlayButton;
  15.  
  16.  
  17. [self.PlayButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  18.  
  19.  
  20. } else if (playbackState == MPMusicPlaybackStatePlaying) {
  21.  
  22. self.textLabel.text = @"pause";
  23. [PlayButton setTitle:@"Pause" forState:UIControlStateNormal];
  24.  
  25. self.PlayButton = PauseButton;
  26. NSLog (@"This is playing");
  27.  
  28.  
  29.  
  30. } else if (playbackState == MPMusicPlaybackStateStopped) {
  31.  
  32. self.textLabel.text = @"Play";
  33. self.PlayButton = PlayButton;
  34.  
  35.  
  36. [self.player stop];
  37.  
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement