Commit 6554957a by pierce

fixed bugs

parent db59709e
Showing with 379 additions and 219 deletions
{
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
......@@ -5,18 +5,18 @@
"scale" : "1x"
},
{
"filename" : "气@2x.png",
"idiom" : "universal",
"filename" : "直播间-观众人数icon@2x.png",
"scale" : "2x"
},
{
"filename" : "气@3x.png",
"idiom" : "universal",
"filename" : "直播间-观众人数icon@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
......@@ -757,7 +757,7 @@
#define URL_BOARD_GUIRENRANK DNS_FUS_API(@"/rank/guard.html")
// 热力值榜单
#define URL_BOARD_HEATING_POWER DNS_FUS_API(@"/rank/hot.html")
#define URL_BOARD_HEATING_POWER DNS_FUS_API(@"/rank/popular/list")
// 热力榜榜单说明
#define URL_BOARD_README_HEATING_POWER DNS_WEB(@"/Nesting/help/hot.html")
......
......@@ -86,7 +86,7 @@
#define ROOM_CID_LIVE_SCOPE_DID_CHANGED 11008 // 切换直播范围
#define ROOM_CID_LIVE_ROOM_TYPE_CHANGED 11009 // 切换直播类型
#define ROOM_CID_BECOME_FANS_GROUP_MEMBER 11010 // 用户成为粉丝团成员
#define ROOM_CID_RoomPopularChanged 11015 // 人气值变化消息
#define ROOM_CID_RoomPopularChanged 11019 // 人气值变化消息
#define ROOM_CID_LINKMIC_SENDINVIT 30001 // 主播发送连麦邀请
#define ROOM_CID_LINKMIC_REPLYINVIT 30002 // 用户回复连麦邀请
......
......@@ -67,8 +67,8 @@
/// 人气指数
@property (nonatomic, assign) NSInteger popularScore;
// 时长计时器集合(单位:秒),珍爱任务相关,如果有返回数据,就开启倒计时,倒计时结束请求接口提醒后台
@property (nonatomic, copy) NSArray<NSNumber *> *onlineSync;
/// 人气排名
@property (nonatomic, assign) NSInteger popularRank;
- (void)fus_setModelWithMyRoomInfos;
......
......@@ -17,6 +17,7 @@
#import "FUSLiveStickerModel.h"
#import "FUSPKRoomPKInfoModel.h"
#import "FUSBoardModel.h"
#import "FUSLivePopularRankModel.h"
#import "FUSLiveHelper.h"
@class FUSBarrageCardModel;
......@@ -787,8 +788,9 @@
@param success 成功回调
@param failure 失败回调
*/
+ (void)fus_requestHeatingPowerDataWithRoomID:(NSString *)roomID
success:(void(^)(NSArray<FUSBoardModel *> *heatingPowerArr))success
+ (void)fus_requestPopularDataWithRoomID:(NSString *)roomID
channelId:(NSString *)channelId
success:(void(^)(NSArray<FUSLivePopularRankModel *> *popularArr))success
failure:(void(^)(NSString *, int))failure;
@end
......@@ -435,9 +435,9 @@
roomInfoModel.monGuard = [dataDict[@"room"][@"monGuard"] description];
roomInfoModel.micMode = micMode;
roomInfoModel.livetime = [dataDict[@"livetime"] integerValue];
roomInfoModel.onlineSync = dataDict[@"onlineSync"];
roomInfoModel.popular = dataDict[@"popular"];
roomInfoModel.popularScore = [dataDict[@"popularScore"] integerValue];
roomInfoModel.popularRank = [dataDict[@"popularRank"] integerValue];
[FUSLiveHelper shareInstance].richValue = roomDict[@"rich"];
......@@ -2528,28 +2528,31 @@
@param success 成功回调
@param failure 失败回调
*/
+ (void)fus_requestHeatingPowerDataWithRoomID:(NSString *)roomID success:(void(^)(NSArray<FUSBoardModel *> *heatingPowerArr))success
+ (void)fus_requestPopularDataWithRoomID:(NSString *)roomID
channelId:(NSString *)channelId
success:(void(^)(NSArray<FUSLivePopularRankModel *> *popularArr))success
failure:(void(^)(NSString *, int))failure
{
NSDictionary *params = @{@"roomid":roomID};
NSDictionary *params = @{@"roomid":roomID,
@"channelId":channelId};
[FUSHttpHelper postRequestBinaryWithUrl:URL_BOARD_HEATING_POWER params:params success:^(NSDictionary *dataDict, int code) {
if (dataDict[@"hotResult"]) {
[FUSLiveHelper shareInstance].roomInfoModel.hotScore = [NSString stringWithObject:dataDict[@"hotResult"][@"score"]];
[FUSLiveHelper shareInstance].roomInfoModel.hotRank = [NSString stringWithObject:dataDict[@"hotResult"][@"rank"]];
if (dataDict[@"rankList"]) {
[[NSNotificationCenter defaultCenter] postNotificationName:kDidHotScoreChangeNotification object:nil];
}
NSArray *popularArr = dataDict[@"rankList"];
if (dataDict[@"ranklist"]) {
if (popularArr.count) {
NSArray *heatingPowerArr = dataDict[@"ranklist"];
NSMutableArray *muArr = [NSMutableArray array];
for (NSDictionary *dict in popularArr) {
FUSLivePopularRankModel *areaModel = [FUSLivePopularRankModel fus_modelWithDict:dict];
if (areaModel.uid.integerValue == FUSLiveHelper.shareInstance.roomInfoModel.roomId.integerValue) {
if (heatingPowerArr.count) {
[FUSLiveHelper shareInstance].roomInfoModel.hotScore = @(areaModel.score).description;
[FUSLiveHelper shareInstance].roomInfoModel.hotRank = @(areaModel.rankId).description;
NSMutableArray *muArr = [NSMutableArray array];
for (NSDictionary *dict in heatingPowerArr) {
FUSBoardModel *areaModel = [FUSBoardModel fus_modelWithDict:dict];
[[NSNotificationCenter defaultCenter] postNotificationName:kDidHotScoreChangeNotification object:nil];
}
[muArr addObject:areaModel];
}
......
......@@ -940,7 +940,7 @@
}
// 新用户标签
if (model.msgType.integerValue != 1 && !model.isHide.boolValue) {
if (model.msgType.integerValue != 1 && !model.isHide.boolValue && model.barrageType.integerValue == 0) {
UIImage *image = nil;
CGRect frame = CGRectZero;
......@@ -1290,8 +1290,6 @@
__weak typeof(self) weakSelf = self;
CGSize imageSize = CGSizeMake(45, 20);
// 弹幕都不显示在线等级,FuSi5.5.0的需求
message.lev = nil;
NSMutableAttributedString *bulletAttr = [self createContentAttributedStringWithModel:message imageSize:imageSize fontSize:14];
dispatch_async(dispatch_get_main_queue(), ^{
......
......@@ -86,6 +86,8 @@
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
NSInteger page = scrollView.contentOffset.x / scrollView.width;
self.segmentView.selectedType = self.typeList[page].integerValue;
[self.myContributeView setListModel:self.listViews[@(page)].listModel];
}
@end
......@@ -7,6 +7,8 @@
#import "FUSMyContributeView.h"
#import "FUSGiftDataCenter.h"
@interface FUSMyContributeView ()
/// 排名
......@@ -34,7 +36,13 @@
@property (nonatomic, strong) UILabel *sendGiftLabel;
/// 礼物图标+文案按钮
@property (nonatomic, strong) UIButton *giftBtn;
@property (nonatomic, strong) UIView *giftView;
/// 礼物图标
@property (nonatomic, strong) UIImageView *giftImageView;
/// 礼物数量
@property (nonatomic, strong) UILabel *giftLabel;
/// 赠送点击响应的按钮
@property (nonatomic, strong) UIButton *sendBtn;
......@@ -99,10 +107,18 @@
self.sendGiftLabel.textAlignment = NSTextAlignmentCenter;
[self.sendGiftView addSubview:self.sendGiftLabel];
self.giftBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[self.giftBtn setTitleColor:UIColor.fus_textColorDeep forState:UIControlStateNormal];
self.giftBtn.titleLabel.font = [UIFont fus_themeMediumFont:12];
[self.sendGiftView addSubview:self.giftBtn];
self.giftView = [[UIView alloc] init];
self.giftView.backgroundColor = [UIColor clearColor];
[self.sendGiftView addSubview:self.giftView];
self.giftImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 20, 20)];
self.giftImageView.contentMode = UIViewContentModeScaleAspectFit;
[self.giftView addSubview:self.giftImageView];
self.giftLabel = [[UILabel alloc] init];
self.giftLabel.textColor = UIColor.fus_textColorDeep;
self.giftLabel.font = [UIFont fus_themeMediumFont:12];
[self.giftView addSubview:self.giftLabel];
self.sendBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[self.sendBtn addTarget:self action:@selector(fus_clickSendGiftAction:) forControlEvents:UIControlEventTouchUpInside];
......@@ -156,10 +172,21 @@
make.top.equalTo(self.sendGiftView).offset(5);
}];
[self.giftBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self.sendGiftView);
[self.giftView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.sendGiftLabel.mas_bottom).offset(-3);
make.height.equalTo(self.sendGiftView).multipliedBy(0.5);
make.centerX.equalTo(self.sendGiftView);
make.height.mas_equalTo(18);
}];
[self.giftImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.top.bottom.equalTo(self.giftView);
make.width.mas_equalTo(18);
}];
[self.giftLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.giftImageView.mas_right).mas_offset(3);
make.right.equalTo(self.giftView).mas_offset(-3);
make.top.bottom.equalTo(self.giftView);
}];
[self.sendBtn mas_makeConstraints:^(MASConstraintMaker *make) {
......@@ -199,8 +226,14 @@
[self.faceImageView setWebImageWithSubURLString:FUSCacheDataShare.shareStore.userDetailInfo.face];
self.nicknameLabel.text = FUSCacheDataShare.shareStore.userDetailInfo.nickname;
[self.giftBtn setWebImageWithSubURLString:listModel.sendData.icon placeholder:nil];
[self.giftBtn setTitle:[NSString stringWithFormat:@"x%@",listModel.sendData.num] forState:UIControlStateNormal];
if (listModel.sendData.num.integerValue > 0) {
self.sendGiftView.hidden = NO;
FUSLiveGiftDataModel *giftModel = [FUSGiftDataCenter sharedCenter].liveGiftDict[listModel.sendData.gid];
[self.giftImageView setWebImageWithSubURLString:giftModel.resource];
self.giftLabel.text = [NSString stringWithFormat:@"x%@",listModel.sendData.num];
} else {
self.sendGiftView.hidden = YES;
}
}
- (void)fus_clickSendGiftAction:(UIButton *)sender {
......
......@@ -16,7 +16,7 @@
#import "FUSBulletsScreenView.h"
#import "FUSMotorsView.h"
#import "FUSLiveHeadPusherView.h"
#import "FUSHeatingPowerListView.h"
#import "FUSPopularListView.h"
#import "FUSLiveChatInputHelper.h"
#import "FUSLiveChatDataSourceHelper.h"
#import "FUSLiveHttpHelper.h"
......@@ -95,7 +95,7 @@
#import "EventTrackParams.h"
#import "FUSAudiencePopView.h"
#import "FUSHeatingProgressView.h"
#import "FUSPopularProgressView.h"
// 粒子发射器 cell 重用标识符
#define EMITTER_REUSE_IDENTIFIER @"emitterReuseIdentifier"
......@@ -133,7 +133,7 @@ FUSLinkMicUserListDelegate
@property (nonatomic, strong) FUSLiveHeadView *headView;
/// 人气值 View
@property (nonatomic, strong) FUSHeatingProgressView *popularView;
@property (nonatomic, strong) FUSPopularProgressView *popularView;
/// 用户数据
@property (nonatomic, strong) FUSLiveHeaderUserListViewModel *userListViewModel;
......@@ -146,7 +146,7 @@ FUSLinkMicUserListDelegate
/**
热力值榜单弹出视图
*/
@property (nonatomic, strong) FUSHeatingPowerListView *heatingPowerPopView;
@property (nonatomic, strong) FUSPopularListView *popularPopView;
/**
活动 View
......@@ -603,11 +603,14 @@ FUSLinkMicUserListDelegate
_headView.delegate = self;
[[self fus_viewWithLayer:FUSLiveFunctionLayerRoomInfos] addSubview:_headView];
self.popularView = [[FUSHeatingProgressView alloc] initWithFrame:CGRectMake(12, self.headView.bottom, 48, 48)];
self.popularView = [[FUSPopularProgressView alloc] initWithFrame:CGRectMake(12, self.headView.bottom, 48, 48)];
[[self fus_viewWithLayer:FUSLiveFunctionLayerRoomInfos] addSubview:self.popularView];
__weak typeof(self) weakSelf = self;
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithActionBlock:^(id _Nonnull sender) {
[weakSelf fus_headViewClickHeatPower];
FUSWKWebViewController *webVc = [[FUSWKWebViewController alloc] init];
webVc.webUrlString = FUSCacheDataShare.shareStore.settingInitDataModel.fusiConfig.popularAddress;
webVc.shouldIncludeIdentifyInfo = YES;
[FUSLiveHelper.shareInstance.fus_getTargetViewController.navigationController pushViewController:webVc animated:YES];
}];
tapGesture.numberOfTapsRequired = 1;
[self.popularView addGestureRecognizer:tapGesture];
......@@ -1740,7 +1743,7 @@ FUSLinkMicUserListDelegate
}
[weakSelf.userInfoView fus_dismissUserInfoViewWithAnimate:YES];
[weakSelf.heatingPowerPopView fus_dismissViewAnimation:YES];
[weakSelf.popularPopView fus_dismissViewAnimation:YES];
[weakSelf.bottomToolView fus_dismissMessageBoxView];
[weakSelf.liveFireCountView removeFromSuperview];
weakSelf.liveFireCountView = nil;
......@@ -1966,15 +1969,9 @@ FUSLinkMicUserListDelegate
return;
}
// 更新围观人数
[self.headView fus_setupAudience:num];
[self.userListViewModel recieveSomeoneEnterRoomWithSocketModel:messageModel messageDict:dict];
self.heatingPowerPopView.roomModel = [FUSLiveHelper shareInstance].roomInfoModel;
if (self.pusherHeadView) {
[self.pusherHeadView fus_setupAudience:num];
}
self.popularPopView.roomModel = [FUSLiveHelper shareInstance].roomInfoModel;
}
/**
......@@ -2006,13 +2003,7 @@ FUSLinkMicUserListDelegate
[_headView fus_headViewAnchorOffline:YES];
}
// 更新围观人数
[self.headView fus_setupAudience:num];
self.heatingPowerPopView.roomModel = [FUSLiveHelper shareInstance].roomInfoModel;
if (self.pusherHeadView) {
[self.pusherHeadView fus_setupAudience:num];
}
self.popularPopView.roomModel = [FUSLiveHelper shareInstance].roomInfoModel;
}
/**
......@@ -2983,7 +2974,7 @@ FUSLinkMicUserListDelegate
// 人气值变化消息
- (void)fus_roomPopularChanged:(NSNotification *)notification {
NSDictionary *dict = [notification.object fus_getJsonDict];
NSString *roomId = dict[@"roomid"];
NSString *roomId = dict[@"roomId"];
// 直播间ID
if (![NSString isNull:roomId]
......@@ -2993,13 +2984,15 @@ FUSLinkMicUserListDelegate
return;
}
NSDictionary *popular = dict[@"popular"];
NSString *score = [dict[@"popular"] description];
NSString *popularRank = [dict[@"popularRank"] description];
[self.headView fus_setupHotScore:score hotRank:popularRank];
[self.popularView fus_setNumber:[score integerValue]];
[self.headView fus_setupAudience:score];
if ([NSDictionary isNull:popular]) {
return;
if (self.pusherHeadView) {
[self.pusherHeadView fus_setupAudience:score];
}
[self.popularView fus_setNumber:[popular[@"score"] integerValue]];
}
- (void)fus_receiveBroadcastNotification:(NSNotification *)notification {
......@@ -4509,11 +4502,14 @@ FUSLinkMicUserListDelegate
[self.headView fus_setupPortraitViewWithRoomOwnerModel:[[FUSLiveHelper shareInstance] roomInfoModel] animate:YES];
// 设置债券 View
[self.headView fus_setupCoinTicket:[[[FUSLiveHelper shareInstance] roomInfoModel] bonds]];
NSString *score = [@([[FUSLiveHelper shareInstance] roomInfoModel].popularScore) description];
NSString *popularRank = [@([[FUSLiveHelper shareInstance] roomInfoModel].popularRank) description];
// 设置热力值
[self.headView fus_setupHotScore:[FUSLiveHelper shareInstance].roomInfoModel.hotScore hotRank:[FUSLiveHelper shareInstance].roomInfoModel.hotRank];
[self.headView fus_setupHotScore:score hotRank:popularRank];
[self.headView fus_startheatPowerViewTimer];
// 设置围观人数
[self.headView fus_setupAudience:[[[FUSLiveHelper shareInstance] roomInfoModel] num]];
[self.headView fus_setupAudience:score];
[self.popularView fus_setNumber:[score integerValue]];
if ([FUSLiveHelper shareInstance].liveType == FUSLiveTypeAnchor) {
[self fus_startRecordLiveTimeWithTime:[NSString stringWithFormat:@"%ld", model.livetime]];
......@@ -4524,7 +4520,7 @@ FUSLinkMicUserListDelegate
if (_pusherHeadView) {
// 设置主播模式数据
[_pusherHeadView fus_setupAudience:[[[FUSLiveHelper shareInstance] roomInfoModel] num]];
[_pusherHeadView fus_setupAudience:score];
[_pusherHeadView fus_setupCoinTicket:[[[FUSLiveHelper shareInstance] roomInfoModel] bonds]];
[_pusherHeadView fus_startheatPowerViewTimer];
}
......@@ -4559,8 +4555,10 @@ FUSLinkMicUserListDelegate
});
[self fus_resetNormalLiveUI];
self.popularView.hidden = NO;
if (model.roomType.integerValue == 2) {
[self fus_setLinkMicUI];
self.popularView.hidden = YES;
}
}
......@@ -4701,7 +4699,7 @@ FUSLinkMicUserListDelegate
[[FUSLiveGiftView shareGiftView] fus_dismissWithAnimate:NO needUpload:NO];
// [[FUSLiveGiftView shareGiftView] fus_resetGiftView]; //放到setup functionview上面
[_heatingPowerPopView fus_dismissViewAnimation:NO];
[_popularPopView fus_dismissViewAnimation:NO];
[self.activityView fus_cleanActivityView];
[self.activityView fus_updateActivityViewHeight:0];
......@@ -5853,19 +5851,19 @@ FUSLinkMicUserListDelegate
[FUSTalkingData fus_trackEvent:EVENT_ROOM_HOTRANK label:nil parameters:nil];
// 避免重复显示
if (_heatingPowerPopView.isOnShow == YES) return;
_heatingPowerPopView = [[FUSHeatingPowerListView alloc] initWithFrame:UIView.fus_screenFrame];
if (_popularPopView.isOnShow == YES) return;
_popularPopView = [[FUSPopularListView alloc] initWithFrame:UIView.fus_screenFrame];
// 为弹出框的控件赋值
_heatingPowerPopView.roomModel = [[FUSLiveHelper shareInstance] roomInfoModel];
_popularPopView.roomModel = [[FUSLiveHelper shareInstance] roomInfoModel];
// 点击用户跳转到对应空间
_heatingPowerPopView.userClickBlock = ^(NSString *uid){
_popularPopView.userClickBlock = ^(NSString *uid){
if ([FUSLiveHelper shareInstance].liveType == FUSLiveTypeAnchor) return;
FUSMyZoneViewController *zoneVc = [[FUSMyZoneViewController alloc] init];
zoneVc.zoneUid = uid;
[[weakSelf getViewController].navigationController pushViewController:zoneVc animated:YES];
};
// 点击自己弹出资料卡
_heatingPowerPopView.selfClickBlock = ^{
_popularPopView.selfClickBlock = ^{
if ([FUSLiveHelper shareInstance].liveType == FUSLiveTypeAnchor) return;
FUSRoomUserInfoModel *userInfoModel = [[FUSRoomUserInfoModel alloc] init];
[userInfoModel fus_setValueWithModel:[FUSLiveHelper shareInstance].roomInfoModel];
......@@ -5873,7 +5871,7 @@ FUSLinkMicUserListDelegate
[weakSelf.userInfoView fus_showUserInfoViewWithUserInfoViewType:FUSUserInfoViewTypeLive userInfoModel:userInfoModel shouldRequestData:YES];
};
// 点击榜单说明
_heatingPowerPopView.boardDescriptionClickBlock = ^{
_popularPopView.boardDescriptionClickBlock = ^{
[FUSTalkingData fus_trackEvent:EVENT_ROOM_HOT_RANK_EXPLAINATION];
FUSWKWebViewController *boardDescriptionVc = [[FUSWKWebViewController alloc]init];
NSString *lang = FUSLocalizationHelper.fus_currentLanguage.languageID;
......@@ -5883,11 +5881,11 @@ FUSLinkMicUserListDelegate
};
// 实现 dismiss 回调
[_heatingPowerPopView setDismissHandler:^{
[_popularPopView setDismissHandler:^{
[[FUSLiveHelper shareInstance] fus_setupScrollToSwitchRoomEnable:YES];
}];
[[FUSLiveHelper shareInstance] fus_setupScrollToSwitchRoomEnable:NO];
[_heatingPowerPopView fus_showViewWithSuperView:[self fus_viewWithLayer:FUSLiveFunctionLayerManualPopView]];
[_popularPopView fus_showViewWithSuperView:[self fus_viewWithLayer:FUSLiveFunctionLayerManualPopView]];
}
- (void)fus_headViewLikeSucceed {
......
......@@ -253,14 +253,14 @@
/// 开启热力值的轮播计时器
- (void)fus_startheatPowerViewTimer {
[self.heatPowerView fus_startChangeTimer];
// [self.heatPowerView fus_startChangeTimer];
}
/**
收到热力值相关的的广播消息
*/
- (void)fus_receiveHeatPowerBroadcast:(FUSBroadcastModel *)broadcastModel {
[self.heatPowerView fus_addHeatBroadcast:broadcastModel.languageContent];
// [self.heatPowerView fus_addHeatBroadcast:broadcastModel.languageContent];
}
/**
......@@ -274,7 +274,7 @@
}
self.portraitView.audience = audience;
[self.heatPowerView fus_startChangeTimer];
// [self.heatPowerView fus_startChangeTimer];
}
/**
......@@ -340,7 +340,7 @@
- (void)fus_cleanHeadView;
{
[_userListView fus_cleanAllOnlineUsers];
[_heatPowerView fus_endChangeTimer];
// [_heatPowerView fus_endChangeTimer];
[_coinTicketView fus_cleanCoinTicketView];
}
......
......@@ -37,8 +37,8 @@ NSString * const kDidHotScoreChangeNotification = @"kDidHotScoreChangeNotificati
@property (nonatomic, strong) FUSLiveHotPowerView *heatPowerView;
/**
// 显示在线人数的 ColoectionView
// */
// 显示在线人数的 ColoectionView
// */
@property (nonatomic, strong) FUSLiveHeaderUserListView *userListView;
/**
显示在线人数的 ColoectionView
......@@ -280,7 +280,7 @@ NSString * const kDidHotScoreChangeNotification = @"kDidHotScoreChangeNotificati
收到热力值相关的的广播消息
*/
- (void)fus_receiveHeatPowerBroadcast:(FUSBroadcastModel *)broadcastModel {
[self.heatPowerView fus_addHeatBroadcast:broadcastModel.languageContent];
// [self.heatPowerView fus_addHeatBroadcast:broadcastModel.languageContent];
}
/**
......@@ -499,12 +499,13 @@ NSString * const kDidHotScoreChangeNotification = @"kDidHotScoreChangeNotificati
}
[_portraitView fus_setupWithModel:model animate:animate];
_userInfoLabel.text = [NSString stringWithFormat:@"%@ %@",FUSLiveHelper.shareInstance.roomInfoModel.roomId,[[NSDate date] stringWithFormat:@"dd-MM-yyyy"]];
_userInfoLabel.text = [NSString stringWithFormat:@"%@ %@",FUSLiveHelper.shareInstance.roomInfoModel.roomId,[[NSDate date] stringWithFormat:@"dd/MM/yyyy"]];
[_userInfoLabel sizeToFit];
_userInfoLabel.height = 20;
_userInfoLabel.x = self.width - self.userInfoLabel.width - 10;
_userInfoLabel.y = 0;
_waterMark.centerX = _userInfoLabel.centerX;
_userInfoLabel.centerY = self.coinTicketView.centerY;
_waterMark.centerY = _userInfoLabel.centerY;
_waterMark.right = _userInfoLabel.left - 4;
}
/**
......@@ -652,7 +653,7 @@ NSString * const kDidHotScoreChangeNotification = @"kDidHotScoreChangeNotificati
*/
- (void)fus_cleanHeadView
{
[_heatPowerView fus_endChangeTimer];
// [_heatPowerView fus_endChangeTimer];
[_portraitView fus_cleanPortraitView];
[_userListView fus_cleanAllOnlineUsers];
......@@ -678,7 +679,7 @@ NSString * const kDidHotScoreChangeNotification = @"kDidHotScoreChangeNotificati
/// 开启热力值的轮播计时器
- (void)fus_startheatPowerViewTimer {
[self.heatPowerView fus_startChangeTimer];
// [self.heatPowerView fus_startChangeTimer];
}
- (void)fus_startHeadViewReceiveGiftAnimWithImgUrl:(NSString *)url{
......
......@@ -30,15 +30,15 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (void)fus_setupHeatScore:(NSString *)heatScore rank:(NSString *)rank;
/// 设置热力值广播
/// @param broadcast 广播的内容
- (void)fus_addHeatBroadcast:(NSString *)broadcast;
///// 设置热力值广播
///// @param broadcast 广播的内容
//- (void)fus_addHeatBroadcast:(NSString *)broadcast;
/// 开启热力值排行榜切换的计时器
- (void)fus_startChangeTimer;
/// 关闭热力值排行榜切换的计时器
- (void)fus_endChangeTimer;
///// 开启热力值排行榜切换的计时器
//- (void)fus_startChangeTimer;
//
///// 关闭热力值排行榜切换的计时器
//- (void)fus_endChangeTimer;
@end
......
......@@ -382,8 +382,14 @@
_autoScrollNicknameLabel.width = MAX_NICKNAME_WIDTH;
}
if (![NSDictionary isNull:model.popular[@"score"]]) {
// 赋值文字内容
[_audienceBtn setTitle:model.num forState:UIControlStateNormal];
[_audienceBtn setTitle:model.popular[@"score"] forState:UIControlStateNormal];
} else {
// 赋值文字内容
[_audienceBtn setTitle:0 forState:UIControlStateNormal];
}
// 更新 Frame
[_audienceBtn sizeToFit];
_audienceBtn.height = 13;
......
......@@ -15,7 +15,7 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange";
@class FUSAgoraHelper;
@interface FUSAgoraHelper () <AgoraRtcEngineDelegate>
@interface FUSAgoraHelper () <AgoraRtcEngineDelegate, AgoraVideoFrameDelegate>
// 声网引擎
@property (nonatomic, strong) AgoraRtcEngineKit *agoraEngine;
......@@ -27,6 +27,9 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange";
// 重连的次数
@property (nonatomic, assign) NSInteger reconnectCount;
// 是否正在加入
@property (nonatomic, assign) BOOL isJoining;
// 自己是否在麦上
@property (nonatomic, assign) BOOL myselfIsOnMic;
......@@ -91,8 +94,27 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange";
[[NSNotificationCenter defaultCenter] removeObserver:self];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(fus_becomeActiveNotification:) name:UIApplicationDidBecomeActiveNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(fus_resignActiveNotification:) name:UIApplicationWillResignActiveNotification object:nil];
//添加对AVAudioSessionRouteChange的监听
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleRouteChangeNotification:) name:AVAudioSessionRouteChangeNotification object:nil];
}
- (void)handleRouteChangeNotification:(NSNotification *)notification {
NSNumber* reasonNumber =
notification.userInfo[AVAudioSessionRouteChangeReasonKey];
AVAudioSessionRouteChangeReason reason =
(AVAudioSessionRouteChangeReason)reasonNumber.unsignedIntegerValue;
if (reason == AVAudioSessionRouteChangeReasonCategoryChange) {
AVAudioSessionCategoryOptions currentCategoryOptions = [AVAudioSession sharedInstance].categoryOptions;
AVAudioSessionCategory currentCategory = [AVAudioSession sharedInstance].category;
//在需要进行对audioSession进行修正的场景下(RTC直播),修改category时options未包含mixWithOther,则给options追加mixWithOther
if (!(currentCategoryOptions & AVAudioSessionCategoryOptionMixWithOthers)) {
[[AVAudioSession sharedInstance] setCategory:currentCategory withOptions:currentCategoryOptions | AVAudioSessionCategoryOptionMixWithOthers error:nil];
}
}
}
- (void)fus_switchRole:(AgoraClientRole)role{
if (_role == role) {
......@@ -143,14 +165,21 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange";
return;
}
if (self.isJoining) {
return;
}
self.isJoining = YES;
_currentChannelId = channelId.integerValue;
AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeAudio];
if (authStatus == AVAuthorizationStatusDenied || authStatus == AVAuthorizationStatusRestricted){
[FUSDialogView fus_showDialog:FUSLocalizationHelper.localString(@"未获得麦克风权限,上麦失败!")];
if (failure) {
failure();
}
self.isJoining = NO;
return;
}
......@@ -173,6 +202,7 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange";
failure();
}
self.isJoining = NO;
return;
}
......@@ -208,6 +238,7 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange";
}else if([FUSLiveHelper shareInstance].liveRoomType != FUSRoomTypeLinkMic){
[weakSelf.captureHelper fus_stopStreamPush];
[weakSelf.agoraEngine startRtmpStreamWithoutTranscoding:FUSLiveHelper.shareInstance.streamView.pushView.streamUrl];
}
FUSLogDebug(@"pp===准备进入成功 %@", channel);
......@@ -220,6 +251,7 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange";
if (success) {
success();
}
weakSelf.isJoining = NO;
}];
if (code < 0) {
......@@ -294,6 +326,8 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange";
[weakSelf.captureHelper fus_restartStreamPush];
[weakSelf.agoraEngine stopRtmpStream:[FUSLiveHelper shareInstance].streamView.pushView.streamUrl];
weakSelf.captureHelper.videoFrameCallBackHandler = nil;
[weakSelf.agoraEngine setVideoFrameDelegate:nil];
} else if ([FUSLiveHelper shareInstance].liveType == FUSLiveTypeAudience && oldRoomType == FUSRoomTypeVideoLinkMic) {
[weakSelf.agoraEngine setVideoFrameDelegate:nil];
......@@ -326,7 +360,7 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange";
- (void)fus_destroy{
[self fus_stopRTCStreamingWithCompletion:^{
// [AgoraRtcEngineKit destroy];
[AgoraRtcEngineKit destroy];
self.agoraEngine = nil;
}];
}
......@@ -432,7 +466,7 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange";
[_agoraEngine enableLocalAudio:YES];
[_agoraEngine enableLocalVideo:YES];
_agoraEngine.delegate = self;
[_agoraEngine setAudioSessionOperationRestriction:AgoraAudioSessionOperationRestrictionDeactivateSession];
// [_agoraEngine setAudioSessionOperationRestriction:AgoraAudioSessionOperationRestrictionDeactivateSession];
// [_agoraEngine setEnableSpeakerphone:YES];
// [_agoraEngine disableExternalAudioSource];
......@@ -661,7 +695,7 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange";
}
}
- (void)rtcEngine:(AgoraRtcEngineKit *)engine didClientRoleChanged:(AgoraClientRole)oldRole newRole:(AgoraClientRole)newRole{
- (void)rtcEngine:(AgoraRtcEngineKit *)engine didClientRoleChanged:(AgoraClientRole)oldRole newRole:(AgoraClientRole)newRole newRoleOptions:(AgoraClientRoleOptions *)newRoleOptions {
if (ENABLE_TEST_VIEW) {
if (newRole == AgoraClientRoleBroadcaster) {
......@@ -737,23 +771,6 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange";
}
/**
* Event of the first frame of remote user is decoded successfully.
*
* @param engine The engine kit
* @param uid The remote user id
* @param size The size of video stream
* @param elapsed The elapsed time(ms) from the beginning of the session.
*/
- (void)rtcEngine:(AgoraRtcEngineKit *)engine firstRemoteVideoDecodedOfUid:(NSUInteger)uid size:(CGSize)size elapsed:(NSInteger)elapsed
{
if (ENABLE_TEST_VIEW) {
FUSLogInfo(@"=======>Agora First Remote Video Did Decoded");
[[NSNotificationCenter defaultCenter] postNotificationName:kStreamPlayViewDidStartPlayNotification object:@{@"uid":@(uid)}];
}
}
/**
* Event of remote user offlined
*
* @param engine The engine kit
......@@ -965,36 +982,6 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange";
FUSLogVerbose(@"FUSStreamPushView:第一帧来了");
}
/** Enables/disables the local video function of a specified user.
This method is only applicable to the scenario when the specified user only wants to watch the remote video without sending any video stream to the other user.
@param engine AgoraRtcEngineKit object.
@param enabled Enable or disable the local video function of a specified user:
* YES: Enabled. Other users in the channel can see the video of the specified user.
* NO: Disabled. Other users in the channel do not receive the video stream from the specified user, while the specified user can still receive the video streams from other users.
@param uid ID of the specified user.
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine didLocalVideoEnabled:(BOOL)enabled byUid:(NSUInteger)uid
{
FUSLogVerbose(@"%s",__func__);
}
/** The video size or rotation of a specified remote user has changed.
@param engine AgoraRtcEngineKit object
@param uid User ID of the remote user or local user (0) whose video size or rotation has changed
@param size New video size
@param rotation New rotation of the video (0 to 360)
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine videoSizeChangedOfUid:(NSUInteger)uid size:(CGSize)size rotation:(NSInteger)rotation
{
FUSLogVerbose(@"%s",__func__);
}
/** The remote video stream state has changed.
@param engine AgoraRtcEngineKit object
......@@ -1060,18 +1047,6 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange";
FUSLogVerbose(@"%s",__func__);
}
/** The statistics of the uploading local video streams.
Same as [localVideoStatBlock]([AgoraRtcEngineKit localVideoStatBlock:]). This method reports the statistics of the local video streams once every two seconds.
@param engine AgoraRtcEngineKit object.
@param stats Statistics of the uploading local video streams: AgoraRtcLocalVideoStats
*/
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine localVideoStats:(AgoraRtcLocalVideoStats * _Nonnull)stats
{
FUSLogVerbose(@"%s",__func__);
}
/** The statistics of the receiving remote video streams.
The SDK updates the application on the statistics of receiving remote video streams for each user/host once every 2 seconds.
......
......@@ -335,6 +335,10 @@
arr = [NSMutableArray arrayWithArray:userModels];
// }
if (userModels.count == 0) {
FUSLogInfo(@"test");
}
[_models removeAllObjects];
[_models addObjectsFromArray:arr];
......
//
// FUSHeatingPowerTableViewCell.m
// FUSPopularTableViewCell.m
// FusiLive
//
// Created by Xiang Liu on 2017/6/8.
// Copyright © 2024年 FuSiLive. All rights reserved.
//
#import "FUSHeatingPowerTableViewCell.h"
#import "FUSPopularTableViewCell.h"
#import "FUSNameLevelView.h"
#import "FUSCacheDataShare.h"
#import "FUSLiveHelper.h"
@interface FUSHeatingPowerTableViewCell ()
@interface FUSPopularTableViewCell ()
@property (weak, nonatomic) IBOutlet UILabel *rankingNumLabel;
@property (strong, nonatomic) IBOutlet UIImageView *rankImageView;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *rankingNumLabelWidth;
@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;
@property (weak, nonatomic) IBOutlet FUSNameLevelView *nickNameLabel;
@property (weak, nonatomic) IBOutlet FUSLabel *heatingPowerLabel;
@property (weak, nonatomic) IBOutlet FUSLabel *popularLabel;
@end
@implementation FUSHeatingPowerTableViewCell
@implementation FUSPopularTableViewCell
- (void)awakeFromNib
{
......@@ -33,22 +33,22 @@
// 头像圆角
_iconImageView.layer.cornerRadius = 45.f/2;
_heatingPowerLabel.adjustsFontSizeToFitWidth = YES;
_popularLabel.adjustsFontSizeToFitWidth = YES;
self.selectedBackgroundView = [[UIView alloc] init];
self.selectedBackgroundView.backgroundColor = UIColor.fus_appBGPressColor;
}
- (void)setModel:(FUSBoardModel *)model
- (void)setModel:(FUSLivePopularRankModel *)model
{
_model = model;
_rankingNumLabel.text = model.rankId;
_rankingNumLabel.text = @(model.rankId).description;
_rankingNumLabel.adjustsFontSizeToFitWidth = YES;
if (model.rankId.integerValue <= 3) {
if (model.rankId <= 3) {
self.rankingNumLabel.hidden = YES;
self.rankImageView.hidden = NO;
self.rankImageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"live_contribute_rank_%@",model.rankId]];
self.rankImageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"live_contribute_rank_%zd",model.rankId]];
} else {
self.rankingNumLabel.hidden = NO;
self.rankImageView.hidden = YES;
......@@ -64,12 +64,12 @@
NSString *level = @"0";
if ([model.privilege[@"richPower"] integerValue] == 1) {
level = model.level;
level = @(model.level).description;
}
// 昵称
[_nickNameLabel fus_setDataWithName:model.nickname level:level number:nil defaultNameColor:UIColor.fus_textColorRich];
// 热力值
_heatingPowerLabel.text = model.score;
_popularLabel.text = @(model.score).description;
}
@end
//
// FUSHeatingProgressView.h
// FUSPopularProgressView.h
// FuSiLive
//
// Created by pierce on 2024/6/19.
......@@ -9,7 +9,7 @@
NS_ASSUME_NONNULL_BEGIN
@interface FUSHeatingProgressView : UIView
@interface FUSPopularProgressView : UIView
- (void)fus_setNumber:(NSInteger)number;
......
//
// FUSHeatingProgressView.m
// FUSPopularProgressView.m
// FuSiLive
//
// Created by pierce on 2024/6/19.
//
#import "FUSHeatingProgressView.h"
#import "FUSPopularProgressView.h"
#import <FUSFoundation/XLWave.h>
@interface FUSHeatingProgressView ()
@interface FUSPopularProgressView ()
/// 波纹动画
@property (nonatomic, strong) UIView *progressBGView;
......@@ -21,7 +21,7 @@
@end
@implementation FUSHeatingProgressView
@implementation FUSPopularProgressView
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
......@@ -60,6 +60,7 @@
}
- (void)fus_setNumber:(NSInteger)number {
/// 需求规定,以1500位分母,分为6档,我就不分档了。
CGFloat progress = number / 1500.0;
if (progress <= 0) {
......
//
// FUSLivePopularRankModel.h
// FuSiLive
//
// Created by pierce on 2024/6/26.
//
#import <FUSFoundation/FUSFoundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface FUSLivePopularRankModel : FUSBaseModel
/// 年龄
@property (nonatomic, assign) NSInteger age;
/// 头像
@property (nonatomic, copy) NSString *face;
/// 是否在线
@property (nonatomic, assign) BOOL inOnline;
/// 是否付费用户
@property (nonatomic, assign) BOOL inPay;
/// 是否关注
@property (nonatomic, assign) BOOL isFollow;
/// 是否神秘人
@property (nonatomic, assign) BOOL isHide;
/// 是否新用户
@property (nonatomic, assign) BOOL isnew;
/// 在线等级
@property (nonatomic, assign) NSInteger lev;
/// 富豪等级
@property (nonatomic, assign) NSInteger level;
/// 直播状态
@property (nonatomic, assign) NSInteger liveState;
/// 昵称
@property (nonatomic, copy) NSString *nickname;
/// 富豪权益
@property (nonatomic, copy) NSDictionary *privilege;
/// 排名
@property (nonatomic, assign) NSInteger rankId;
/// 分数
@property (nonatomic, assign) NSInteger score;
/// 性别
@property (nonatomic, assign) NSInteger sex;
/// 用户id
@property (nonatomic, copy) NSString *uid;
@end
NS_ASSUME_NONNULL_END
//
// FUSLivePopularRankModel.m
// FuSiLive
//
// Created by pierce on 2024/6/26.
//
#import "FUSLivePopularRankModel.h"
@implementation FUSLivePopularRankModel
@end
//
// FUSHeatingPowerListView.h
// FUSPopularListView.h
// FusiLive
//
// Created by Xiang Liu on 2017/6/8.
......@@ -9,7 +9,7 @@
#import <UIKit/UIKit.h>
#import "FUSRoomInfoModel.h"
@interface FUSHeatingPowerListView : UIView
@interface FUSPopularListView : UIView
/**
房主的信息model
......
......@@ -10,7 +10,7 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="FUSHeatingPowerListView">
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="FUSPopularListView">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
......@@ -36,7 +36,7 @@
<color key="titleColor" red="0.80000000000000004" green="0.80000000000000004" blue="0.80000000000000004" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<action selector="onTapHeatingPowerExplanationBtnAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="e0c-xd-Twm"/>
<action selector="onTapPopularExplanationBtnAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="e0c-xd-Twm"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="热门榜" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XEc-zv-0VG">
......@@ -128,8 +128,8 @@
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="live_heatingPower_hot" translatesAutoresizingMaskIntoConstraints="NO" id="Noo-0c-BBA">
<rect key="frame" x="98.5" y="40" width="12.5" height="12.5"/>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="live_popular_hot" translatesAutoresizingMaskIntoConstraints="NO" id="Noo-0c-BBA">
<rect key="frame" x="98.5" y="40" width="128" height="128"/>
<color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" secondItem="Noo-0c-BBA" secondAttribute="height" multiplier="1:1" id="Y6U-hc-qYS"/>
......@@ -138,11 +138,11 @@
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="dCA-60-yaU">
<rect key="frame" x="0.0" y="0.0" width="375" height="65"/>
<connections>
<action selector="clickSelfHeatingPowerBtn:" destination="iN0-l3-epB" eventType="touchUpInside" id="gIe-Ne-Gx9"/>
<action selector="clickSelfPopularBtn:" destination="iN0-l3-epB" eventType="touchUpInside" id="gIe-Ne-Gx9"/>
</connections>
</button>
<label opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="BgM-jW-rQL" customClass="FUSLabel">
<rect key="frame" x="116" y="39" width="7.5" height="17"/>
<rect key="frame" x="231.5" y="39" width="7.5" height="17"/>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="12"/>
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
......@@ -213,15 +213,15 @@
<connections>
<outlet property="bottomBgView" destination="CrJ-BJ-q5L" id="Gwb-yY-Pk4"/>
<outlet property="contentView" destination="DlR-3B-K33" id="0cd-9h-s61"/>
<outlet property="heatingPowerExplanationBtn" destination="8MG-Kp-rCX" id="BXS-bb-CAC"/>
<outlet property="heatingPowerTableView" destination="0uU-G0-BQg" id="xQs-Il-vAd"/>
<outlet property="heatingPowerTitle" destination="XEc-zv-0VG" id="n0A-Pd-hwS"/>
<outlet property="mainBgView" destination="0K4-qu-piz" id="I8z-2E-32H"/>
<outlet property="myHeatingPowerLabel" destination="BgM-jW-rQL" id="2ps-ve-z6L"/>
<outlet property="myIconImageView" destination="lLs-a5-3U1" id="BEr-1Y-BMp"/>
<outlet property="myNicknameLabel" destination="Vn7-jU-7Kf" id="8YL-QC-64u"/>
<outlet property="myPopularLabel" destination="BgM-jW-rQL" id="2ps-ve-z6L"/>
<outlet property="myRankingLabel" destination="5ow-AJ-Hxg" id="8nt-ZP-epy"/>
<outlet property="myrankImageView" destination="ajw-7N-O82" id="Uri-fb-xDh"/>
<outlet property="popularExplanationBtn" destination="8MG-Kp-rCX" id="BXS-bb-CAC"/>
<outlet property="popularTableView" destination="0uU-G0-BQg" id="xQs-Il-vAd"/>
<outlet property="popularTitle" destination="XEc-zv-0VG" id="n0A-Pd-hwS"/>
<outlet property="tableViewBottomConstraint" destination="nkd-Il-0Ib" id="fYB-CA-Iim"/>
</connections>
<point key="canvasLocation" x="-728.79999999999995" y="-23.838080959520241"/>
......@@ -229,6 +229,6 @@
</objects>
<resources>
<image name="common_help_icon" width="17.5" height="17.5"/>
<image name="live_heatingPower_hot" width="12.5" height="12.5"/>
<image name="live_popular_hot" width="128" height="128"/>
</resources>
</document>
//
// FUSHeatingPowerTableViewCell.h
// FUSPopularTableViewCell.h
// FusiLive
//
// Created by Xiang Liu on 2017/6/8.
......@@ -7,10 +7,10 @@
//
#import <UIKit/UIKit.h>
#import "FUSBoardModel.h"
#import "FUSLivePopularRankModel.h"
@interface FUSHeatingPowerTableViewCell : UITableViewCell
@interface FUSPopularTableViewCell : UITableViewCell
@property (nonatomic,strong) FUSBoardModel *model;
@property (nonatomic,strong) FUSLivePopularRankModel *model;
@end
......@@ -9,7 +9,7 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="FUSHeatingPowerTableViewCell">
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="FUSPopularTableViewCell">
<rect key="frame" x="0.0" y="0.0" width="320" height="65"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
......@@ -58,14 +58,14 @@
</userDefinedRuntimeAttributes>
</view>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Nnz-Qr-1JP" customClass="FUSLabel">
<rect key="frame" x="114.5" y="38" width="7.5" height="17"/>
<rect key="frame" x="230" y="38" width="7.5" height="17"/>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="12"/>
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
<size key="shadowOffset" width="0.0" height="0.0"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="live_heatingPower_hot" translatesAutoresizingMaskIntoConstraints="NO" id="8Wm-NY-C9H">
<rect key="frame" x="97" y="39" width="12.5" height="12.5"/>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="live_popular_hot" translatesAutoresizingMaskIntoConstraints="NO" id="8Wm-NY-C9H">
<rect key="frame" x="97" y="39" width="128" height="128"/>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="tPE-Th-gvf">
<rect key="frame" x="0.0" y="64.5" width="320" height="0.5"/>
......@@ -98,9 +98,9 @@
</tableViewCellContentView>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<connections>
<outlet property="heatingPowerLabel" destination="Nnz-Qr-1JP" id="4sy-FK-1Fq"/>
<outlet property="iconImageView" destination="fM0-ex-fyt" id="hgb-AK-0rn"/>
<outlet property="nickNameLabel" destination="6wI-Bd-29E" id="Sr6-JA-1jn"/>
<outlet property="popularLabel" destination="Nnz-Qr-1JP" id="4sy-FK-1Fq"/>
<outlet property="rankImageView" destination="S3D-jB-dHc" id="0FM-eK-dlY"/>
<outlet property="rankingNumLabel" destination="BYH-xW-6Mn" id="yDh-wA-aHS"/>
<outlet property="rankingNumLabelWidth" destination="Uuz-bC-jSa" id="z8e-BV-qju"/>
......@@ -109,6 +109,6 @@
</tableViewCell>
</objects>
<resources>
<image name="live_heatingPower_hot" width="12.5" height="12.5"/>
<image name="live_popular_hot" width="128" height="128"/>
</resources>
</document>
......@@ -32,6 +32,9 @@ typedef NS_ENUM(NSInteger,FUSLiveMinimizeViewLevelType) {
// PK头像上面显示的logo
@property (nonatomic, strong) UIImageView *pkUserLogoImageView;
/// 连麦房背景头像
@property (nonatomic, strong) UIImageView *linkMicImageView;
// 内容
@property (nonatomic, strong) UIView *contentView;
......@@ -143,6 +146,8 @@ typedef NS_ENUM(NSInteger,FUSLiveMinimizeViewLevelType) {
[self.pkUserBgImageView addSubview:self.pkUserLogoImageView];
[self addSubview:self.roomUserBgImageView];
[self.roomUserBgImageView addSubview:self.roomUserlogoImageView];
[self addSubview:self.linkMicImageView];
[self addSubview:self.contentView];
[self.contentView addSubview:self.animImageView];
[self addSubview:self.closeBtn];
......@@ -161,8 +166,13 @@ typedef NS_ENUM(NSInteger,FUSLiveMinimizeViewLevelType) {
_type = type;
switch (type) {
case FUSLiveMinimizeViewTypeNormalLive:
[self.animImageView stopAnimating];
self.animImageView.hidden = YES;
self.linkMicImageView.hidden = YES;
self.pkUserBgImageView.hidden = YES;
self.roomUserBgImageView.hidden = NO;
[_roomUserBgImageView fus_setWebImageWithSubURLString:FUSLiveHelper.shareInstance.roomInfoModel.face placeholder:UIImage.fus_defaultIcon];
_roomUserBgImageView.layer.cornerRadius = 0;
self.roomUserlogoImageView.centerY = self.roomUserlogoImageView.height / 2.0 - 10;
......@@ -175,6 +185,10 @@ typedef NS_ENUM(NSInteger,FUSLiveMinimizeViewLevelType) {
case FUSLiveMinimizeViewTypePK:
[self.animImageView stopAnimating];
self.animImageView.hidden = YES;
self.linkMicImageView.hidden = YES;
self.pkUserBgImageView.hidden = NO;
self.roomUserBgImageView.hidden = NO;
[_roomUserBgImageView fus_setWebImageWithSubURLString:FUSLiveHelper.shareInstance.roomInfoModel.face placeholder:UIImage.fus_defaultIcon];
[_pkUserBgImageView fus_setWebImageWithSubURLString:FUSLiveHelper.shareInstance.roomInfoModel.face placeholder:UIImage.fus_defaultIcon];
self.roomUserlogoImageView.centerY = self.roomUserlogoImageView.height / 2.0 - 10;
......@@ -191,9 +205,15 @@ typedef NS_ENUM(NSInteger,FUSLiveMinimizeViewLevelType) {
case FUSLiveMinimizeViewTypeLinkMicRoom:
[self.animImageView startAnimating];
self.animImageView.hidden = NO;
[_roomUserBgImageView fus_setWebImageWithSubURLString:FUSLiveHelper.shareInstance.roomInfoModel.face placeholder:UIImage.fus_defaultIcon];
_roomUserBgImageView.layer.cornerRadius = _roomUserBgImageView.width / 2.0f;
_roomUserBgImageView.layer.masksToBounds = YES;
self.linkMicImageView.hidden = NO;
self.pkUserBgImageView.hidden = YES;
self.roomUserBgImageView.hidden = YES;
[_linkMicImageView setWebImageWithSubURLString:FUSLiveHelper.shareInstance.roomInfoModel.face];
_linkMicImageView.layer.cornerRadius = _linkMicImageView.width / 2.0f;
_linkMicImageView.layer.masksToBounds = YES;
self.closeBtn.origin = CGPointMake(self.contentView.right - self.closeBtn.width - 4, 4);
[self.closeBtn setImage:nil forState:UIControlStateNormal];
self.layer.cornerRadius = 0;
......@@ -246,9 +266,29 @@ typedef NS_ENUM(NSInteger,FUSLiveMinimizeViewLevelType) {
CGRect bounds = CGRectZero;
bounds.size = size;
switch (self.type) {
case FUSLiveMinimizeViewTypeNormalLive:
if (self.type != FUSLiveMinimizeViewTypeLinkMicRoom) {
self.roomUserBgImageView.hidden = NO;
self.pkUserBgImageView.hidden = YES;
self.linkMicImageView.hidden = YES;
break;
case FUSLiveMinimizeViewTypePK:
self.roomUserBgImageView.hidden = NO;
self.pkUserBgImageView.hidden = NO;
self.linkMicImageView.hidden = YES;
break;
case FUSLiveMinimizeViewTypeLinkMicRoom:
self.roomUserBgImageView.hidden = YES;
self.pkUserBgImageView.hidden = YES;
self.linkMicImageView.hidden = NO;
break;
}
if (self.type != FUSLiveMinimizeViewTypeLinkMicRoom) {
}
/// playerView 内部是有做动画的
......@@ -258,7 +298,8 @@ typedef NS_ENUM(NSInteger,FUSLiveMinimizeViewLevelType) {
switch (self.type) {
case FUSLiveMinimizeViewTypeNormalLive:
self.roomUserBgImageView.frame = bounds;
self.pkUserBgImageView.hidden = YES;
self.roomUserlogoImageView.centerY = self.roomUserBgImageView.height / 2.0 - 10;
self.roomUserlogoImageView.centerX = self.roomUserBgImageView.width / 2.0;
break;
case FUSLiveMinimizeViewTypePK: {
CGRect frame = bounds;
......@@ -266,12 +307,16 @@ typedef NS_ENUM(NSInteger,FUSLiveMinimizeViewLevelType) {
self.roomUserBgImageView.frame = frame;
frame.origin.x = frame.size.width;
self.pkUserBgImageView.frame = frame;
self.pkUserBgImageView.hidden = NO;
self.roomUserlogoImageView.centerY = self.roomUserBgImageView.height / 2.0 - 10;
self.roomUserlogoImageView.centerX = self.roomUserBgImageView.width / 2.0;
self.pkUserLogoImageView.centerY = self.pkUserBgImageView.height / 2.0 - 10;
self.pkUserLogoImageView.centerX = self.pkUserBgImageView.width / 2.0;
break;
}
case FUSLiveMinimizeViewTypeLinkMicRoom:
self.roomUserBgImageView.frame = CGRectInset(bounds, kFaceInset, kFaceInset);
self.pkUserBgImageView.hidden = YES;
self.linkMicImageView.frame = CGRectInset(bounds, kFaceInset, kFaceInset);
self.linkMicImageView.layer.cornerRadius = self.linkMicImageView.width / 2.0;
self.layer.masksToBounds = YES;
break;
}
......@@ -281,7 +326,6 @@ typedef NS_ENUM(NSInteger,FUSLiveMinimizeViewLevelType) {
} completion:^(BOOL finished) {
self.contentView.userInteractionEnabled = YES;
self.roomUserBgImageView.hidden = NO;
}];
}
......@@ -467,6 +511,17 @@ typedef NS_ENUM(NSInteger,FUSLiveMinimizeViewLevelType) {
}
- (UIImageView *)linkMicImageView {
if (!_linkMicImageView) {
_linkMicImageView = [[UIImageView alloc] init];
_linkMicImageView.contentMode = UIViewContentModeScaleAspectFill;
}
return _linkMicImageView;
}
- (UIView *)contentView {
if (!_contentView) {
_contentView = [[UIView alloc] initWithFrame:self.bounds];
......
......@@ -121,7 +121,7 @@ NSString * const kStreamRTCDidOfflineNotification = @"kStreamRTCDidOfflineNotifi
NSInteger targetBitrate = [agoraConfig[kLivePushConfigTargetBitrateKey] integerValue];
if (targetBitrate <= 0) {
targetBitrate = 500;
targetBitrate = 1000;
}
__block CGSize videoSize;
......@@ -167,7 +167,7 @@ NSString * const kStreamRTCDidOfflineNotification = @"kStreamRTCDidOfflineNotifi
[_agoraEngine enableVideo];
[_agoraEngine enableAudio];
[_agoraEngine enableLocalVideo:YES];
[_agoraEngine setAudioSessionOperationRestriction:AgoraAudioSessionOperationRestrictionAll];
// [_agoraEngine setAudioSessionOperationRestriction:AgoraAudioSessionOperationRestrictionAll];
[_agoraEngine setParameters:@"{\"che.audio.keep.audiosession\":true}"];
// [_agoraEngine disableExternalAudioSource];
......@@ -219,6 +219,12 @@ NSString * const kStreamRTCDidOfflineNotification = @"kStreamRTCDidOfflineNotifi
_agoraOtherPreview.backgroundColor = [UIColor clearColor];
_agoraOtherPreview.clipsToBounds = YES;
[self addSubview:_agoraOtherPreview];
[_agoraOtherPreview mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(floor(self.width / 2.0));
make.top.mas_equalTo(STREAM_VIEW_Y_POSITION);
make.width.mas_equalTo(ceil(self.width / 2.0));
make.height.mas_equalTo(height);
}];
self.localPreviewFrame = CGRectMake(0, STREAM_VIEW_Y_POSITION, ceil(self.width / 2.0), height);
......@@ -562,7 +568,7 @@ NSString * const kStreamRTCDidOfflineNotification = @"kStreamRTCDidOfflineNotifi
[FUSDeviceHelper fus_checkOldIPhoneDeviceHandler:^(BOOL oldDev) {
if (oldDev) {
[self.captureHelper fus_stopStreamPush];
[self.agoraEngine startRtmpStreamWithTranscoding:_captureHelper.pushUrl transcoding:NO];
[self.agoraEngine startRtmpStreamWithTranscoding:self.captureHelper.pushUrl transcoding:NO];
}
}];
......@@ -588,7 +594,7 @@ NSString * const kStreamRTCDidOfflineNotification = @"kStreamRTCDidOfflineNotifi
{
[FUSDeviceHelper fus_checkOldIPhoneDeviceHandler:^(BOOL oldDev) {
if (!oldDev && [FUSLiveHelper shareInstance].liveType == FUSLiveTypeAnchor) {
[_captureHelper fus_stopStreamPush];
[self.captureHelper fus_stopStreamPush];
}
}];
}
......@@ -601,7 +607,7 @@ NSString * const kStreamRTCDidOfflineNotification = @"kStreamRTCDidOfflineNotifi
{// 推流到自己的 CDN v6.3改为和安卓一样使用旁路推流
// [FUSDeviceHelper fus_checkOldIPhoneDeviceHandler:^(BOOL oldDev) {
if ([FUSLiveHelper shareInstance].liveType == FUSLiveTypeAnchor) {
[_captureHelper fus_restartStreamPush];
[self.captureHelper fus_restartStreamPush];
}
// }];
}
......@@ -627,8 +633,8 @@ NSString * const kStreamRTCDidOfflineNotification = @"kStreamRTCDidOfflineNotifi
if (oldDev && [FUSLiveHelper shareInstance].liveType == FUSLiveTypeAnchor) {
// 移除旁路推流
[_agoraEngine stopRtmpStream:_streamUrl];
[_captureHelper fus_restartStreamPush];
[self.agoraEngine stopRtmpStream:self.streamUrl];
[self.captureHelper fus_restartStreamPush];
}
}];
......
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