Commit 624572f3 by pidan

1、修复用户空间签名播放的问题

2、修复用户公屏欢迎消息的问题
parent 918b707e
...@@ -1704,8 +1704,8 @@ ...@@ -1704,8 +1704,8 @@
NSString *shownStr = [remindStr stringByReplacingOccurrencesOfString:@"{anchornick}" withString:anchornick]; NSString *shownStr = [remindStr stringByReplacingOccurrencesOfString:@"{anchornick}" withString:anchornick];
shownStr = [shownStr stringByReplacingOccurrencesOfString:@"{usernick}" withString:usernick]; shownStr = [shownStr stringByReplacingOccurrencesOfString:@"{usernick}" withString:usernick];
if (![NSString isNullWithString:remindStr]) { if (![NSString isNullWithString:shownStr]) {
[message appendString:remindStr]; [message appendString:shownStr];
[message appendString:@"<br>"]; [message appendString:@"<br>"];
} }
} }
......
...@@ -732,7 +732,7 @@ ...@@ -732,7 +732,7 @@
}else{ }else{
// 获取自己空间的数据 // 获取自己空间的数据
[FUSZoneCacheOperate fus_getMyZoneInfosWithType:type success:^(FUSZoneInfosModel *zoneModel){ [FUSZoneCacheOperate fus_getMyZoneInfosWithType:type success:^(FUSZoneInfosModel *zoneModel){
zoneModel.userimgs = self.zoneUserImgs; zoneModel.userimgs = weakSelf.zoneUserImgs;
weakSelf.zoneModel = zoneModel; weakSelf.zoneModel = zoneModel;
[weakSelf fus_setTopView]; [weakSelf fus_setTopView];
[weakSelf.myZoneBottomView fus_updateBottomViewWithModel:zoneModel]; [weakSelf.myZoneBottomView fus_updateBottomViewWithModel:zoneModel];
......
...@@ -175,7 +175,7 @@ typedef NS_ENUM(NSUInteger, FUSMyZoneSectionType) { ...@@ -175,7 +175,7 @@ typedef NS_ENUM(NSUInteger, FUSMyZoneSectionType) {
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(fus_cellManager:pushToController:)]) { if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(fus_cellManager:pushToController:)]) {
FUSFollowViewController *followVC = [[FUSFollowViewController alloc] init]; FUSFollowViewController *followVC = [[FUSFollowViewController alloc] init];
followVC.uid = weakSelf.zoneModel.uid; followVC.uid = weakSelf.zoneModel.uid;
[weakSelf.delegate fus_cellManager:self pushToController:followVC]; [weakSelf.delegate fus_cellManager:weakSelf pushToController:followVC];
} }
} }
break; break;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#import "FUSVideoPlayer.h" #import "FUSVideoPlayer.h"
#import "FUSVoiceSignRecordViewController.h" #import "FUSVoiceSignRecordViewController.h"
#import <Masonry/Masonry.h> #import <Masonry/Masonry.h>
@interface FUSMyZoneInfoCell ()<FUSVideoPlayerDelegate> @interface FUSMyZoneInfoCell ()
@property (strong, nonatomic) IBOutlet UILabel *nickNameLabel; @property (strong, nonatomic) IBOutlet UILabel *nickNameLabel;
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
@property (nonatomic, strong) UIButton *liveRecordBtn; @property (nonatomic, strong) UIButton *liveRecordBtn;
// 播放器 // 播放器
@property (nonatomic, strong) FUSVideoPlayer *audioPlayer; @property (nonatomic, strong) AVPlayer *audioPlayer;
// 粉丝数量 // 粉丝数量
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
@implementation FUSMyZoneInfoCell @implementation FUSMyZoneInfoCell
- (void)dealloc { - (void)dealloc {
[_audioPlayer fus_stopPlayer]; [_audioPlayer pause];
_audioPlayer = nil; _audioPlayer = nil;
} }
...@@ -247,50 +247,34 @@ ...@@ -247,50 +247,34 @@
[FUSDialogView fus_showDialog:[NSString fus_localString:@"语音审核中,请耐心等待"]]; [FUSDialogView fus_showDialog:[NSString fus_localString:@"语音审核中,请耐心等待"]];
} else { } else {
// 审核通过。可以播放 // 审核通过。可以播放
if (!_audioPlayer) { [self.recordOrPlayBtn setImage:[FUSUserCenterBunble animatedImageNamed:@"zone_voice_sign_play_btn_icon_anim_" duration:1] forState:UIControlStateNormal];
_audioPlayer = [[FUSVideoPlayer alloc] initWithPlayView:nil];
_audioPlayer.delegate = self; [self.audioPlayer pause];
} self.audioPlayer = nil;
// [self fus_setPlayProgress:0]; [[NSNotificationCenter defaultCenter] removeObserver:self];
if (_audioPlayer.fus_isPlaying) {
[_audioPlayer fus_seekToTime:kCMTimeZero]; NSString *playUrl = [FUSConfig.sharedInstanced.pathConfigs webImagePath:self.zoneModel.voiceChat[@"url"]];
} else { AVPlayerItem *playItem = [AVPlayerItem playerItemWithURL:[NSURL URLWithString:playUrl]];
NSString *playUrl = [FUSConfig.sharedInstanced.pathConfigs webImagePath:self.zoneModel.voiceChat[@"url"]]; self.audioPlayer = [AVPlayer playerWithPlayerItem:playItem];
AVPlayerItem *playItem = [AVPlayerItem playerItemWithURL:[NSURL URLWithString:playUrl]]; [self.audioPlayer play];
[_audioPlayer fus_playVideoWithPlayItem:playItem]; [[NSNotificationCenter defaultCenter] addObserver:self
} selector:@selector(playbackFinished:)
name:AVPlayerItemDidPlayToEndTimeNotification
object:self.audioPlayer.currentItem];
} }
} }
#pragma mark other method - (void)playbackFinished:(NSNotification *)notification {
- (void)fus_stopAudioPlayer { [self.recordOrPlayBtn setImage:[FUSUserCenterBunble imageNamed:@"zone_voice_sign_play_btn_icon_anim_11"] forState:UIControlStateNormal];
[_audioPlayer fus_stopPlayer];
_audioPlayer = nil;
// [self fus_setPlayProgress:0];
} }
#pragma mark - FUSVideoPlayerDelegate
/** #pragma mark other method
进度改变的接口 - (void)fus_stopAudioPlayer {
[_audioPlayer pause];
@param videoPlayer 当前视频播放器 _audioPlayer = nil;
@param currentTime 当前视频进度
@param duration 当前视频的总时长
*/
- (void)fus_videoPlayer:(FUSVideoPlayer *)videoPlayer
progressDidChanged:(CGFloat)currentTime
duration:(CGFloat)duration {
// [self fus_setPlayProgress:currentTime / duration];
} }
- (void)fus_videoPlayer:(FUSVideoPlayer *)videoPlayer playStateDidChanged:(FUSPlayState)playState {
if (playState == FUSPlayStatePlaying) {
[self.recordOrPlayBtn setImage:[FUSUserCenterBunble animatedImageNamed:@"zone_voice_sign_play_btn_icon_anim_" duration:1] forState:UIControlStateNormal];
} else {
[self.recordOrPlayBtn setImage:[FUSUserCenterBunble imageNamed:@"zone_voice_sign_play_btn_icon_anim_11"] forState:UIControlStateNormal];
}
}
@end @end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment