Commit 624572f3 by pidan

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

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