Skip to content

Instantly share code, notes, and snippets.

@saiday
Created March 14, 2014 19:56
Show Gist options
  • Select an option

  • Save saiday/9555548 to your computer and use it in GitHub Desktop.

Select an option

Save saiday/9555548 to your computer and use it in GitHub Desktop.
HysteriaPlayerDelegate protocl
- (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