diff --git a/ZYChat-EaseMob/ZYChat/MusicShare/GJGCMusicPlayerBar.m b/ZYChat-EaseMob/ZYChat/MusicShare/GJGCMusicPlayerBar.m index 173c9f6..fb9dbf5 100644 --- a/ZYChat-EaseMob/ZYChat/MusicShare/GJGCMusicPlayerBar.m +++ b/ZYChat-EaseMob/ZYChat/MusicShare/GJGCMusicPlayerBar.m @@ -101,17 +101,18 @@ - (void)stopAction #pragma mark - GJCFAudioPlayer Delegate - (void)audioPlayer:(GJCFAudioPlayer *)audioPlay didFinishPlayAudio:(GJCFAudioModel *)audioFile { + self.playButton.selected = !self.playButton.isSelected; [self.titleLabel.layer removeAnimationForKey:@"moveX"]; } - (void)audioPlayer:(GJCFAudioPlayer *)audioPlay didOccusError:(NSError *)error { + self.playButton.selected = !self.playButton.isSelected; [self.titleLabel.layer removeAnimationForKey:@"moveX"]; } - (void)audioPlayer:(GJCFAudioPlayer *)audioPlay didUpdateSoundMouter:(CGFloat)soundMouter { - } + (GJGCMusicPlayerBar *)currentMusicBar diff --git a/ZYChat-EaseMob/ZYChat/MusicShare/GJGCMusicPlayingViewController.m b/ZYChat-EaseMob/ZYChat/MusicShare/GJGCMusicPlayingViewController.m index 34751db..8e5f274 100644 --- a/ZYChat-EaseMob/ZYChat/MusicShare/GJGCMusicPlayingViewController.m +++ b/ZYChat-EaseMob/ZYChat/MusicShare/GJGCMusicPlayingViewController.m @@ -42,6 +42,8 @@ @interface GJGCMusicPlayingViewController () @property (nonatomic,strong)NSString *currentSongImgUrl; +@property (nonatomic,strong)NSString *currentSongId; + @property (nonatomic,strong)UIActivityIndicatorView *downloadIndicator; @property (nonatomic,strong)UIButton *forwardButton; @@ -57,6 +59,7 @@ - (instancetype)initWithMusicContent:(GJGCChatFriendContentModel*)contentModel self.currentSongAuthor = contentModel.musicSongAuthor; self.currentSongMp3Url = contentModel.musicSongUrl; self.currentSongImgUrl = contentModel.musicSongImgUrl; + self.currentSongId = contentModel.musicSongId; [self.albumImageView sd_setImageWithURL:[NSURL URLWithString:self.currentSongImgUrl]]; GJCFWeakSelf weakSelf = self; @@ -186,10 +189,6 @@ - (void)viewWillAppear:(BOOL)animated - (void)forwardAction { - if (self.songList.count == 0) { - return; - } - GJGCRecentChatForwardContentModel *forwardContentModel = [[GJGCRecentChatForwardContentModel alloc]init]; forwardContentModel.title = self.nameLabel.text; if (GJCFStringIsNull(self.currentSongAuthor)) { @@ -197,8 +196,9 @@ - (void)forwardAction } forwardContentModel.sumary = self.currentSongAuthor; forwardContentModel.webUrl = self.currentSongMp3Url; - forwardContentModel.songId = self.songList[self.currentIndex]; + forwardContentModel.songId = self.currentSongId; forwardContentModel.contentType = GJGCChatFriendContentTypeMusicShare; + forwardContentModel.imageUrl = self.currentSongImgUrl; GJGCRecentContactListViewController *recentList = [[GJGCRecentContactListViewController alloc]initWithForwardContent:forwardContentModel]; diff --git a/ZYChat-EaseMob/ZYChat/MusicShare/GJGCMusicSharePlayer.m b/ZYChat-EaseMob/ZYChat/MusicShare/GJGCMusicSharePlayer.m index 6d6bc95..c32000f 100644 --- a/ZYChat-EaseMob/ZYChat/MusicShare/GJGCMusicSharePlayer.m +++ b/ZYChat-EaseMob/ZYChat/MusicShare/GJGCMusicSharePlayer.m @@ -62,6 +62,9 @@ - (void)removePlayObserver:(id)observer #pragma mark - GJCFAudioPlayer Delegate - (void)audioPlayer:(GJCFAudioPlayer *)audioPlay didFinishPlayAudio:(GJCFAudioModel *)audioFile { + self.musicChatId = nil; + self.musicMsgId = nil; + dispatch_async(dispatch_get_main_queue(), ^{ for (id observer in self.observers) { @@ -76,6 +79,8 @@ - (void)audioPlayer:(GJCFAudioPlayer *)audioPlay didFinishPlayAudio:(GJCFAudioMo - (void)audioPlayer:(GJCFAudioPlayer *)audioPlay didOccusError:(NSError *)error { NSLog(@"play error:%@",error); + self.musicChatId = nil; + self.musicMsgId = nil; dispatch_async(dispatch_get_main_queue(), ^{