Created
March 14, 2014 19:56
-
-
Save saiday/9555548 to your computer and use it in GitHub Desktop.
HysteriaPlayerDelegate protocl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (void)hysteriaPlayerCurrentItemChanged:(AVPlayerItem *)item | |
| { | |
| [self updateCurrentItem]; | |
| } | |
| - (void)hysteriaPlayerRateChanged:(BOOL)isPlaying | |
| { | |
| [self updateInterfaceState:isPlaying]; | |
| } | |
| - (void)updateCurrentItem | |
| { | |
| Song *currentItem = [[PlayingItems sharedInstance] getCurrentSong]; | |
| [[SDWebImageManager sharedManager] downloadWithURL:[NSURL URLWithString:currentItem.artworkURL] options:0 progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished) { | |
| [self.spinningDiskView setImage:image]; | |
| }]; | |
| self.navigationItem.title = currentItem.title; | |
| } | |
| - (void)updateInterfaceState:(BOOL)isPlaying | |
| { | |
| [playButton setSelected:isPlaying]; | |
| [self.spinningDiskView setRotaion:isPlaying]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment