Commit 6e9aadd8 by ludi

初步完成ffpkhelper对接

parent cf41be93
Showing with 176 additions and 219 deletions
...@@ -243,10 +243,6 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -243,10 +243,6 @@ NS_ASSUME_NONNULL_BEGIN
// 改变PK按钮状态 // 改变PK按钮状态
+ (NSString *)fus_FUS_LIVE_ROOM_CHANGE_PKBTN_STATUS; + (NSString *)fus_FUS_LIVE_ROOM_CHANGE_PKBTN_STATUS;
// PK状态改变
+ (NSString *)fus_FUS_LIVE_ROOM_PK_STATUS;
+ (NSString *)fus_FUS_REFRESH_ONLINEMIC; + (NSString *)fus_FUS_REFRESH_ONLINEMIC;
+ (NSString *)fus_FUS_CLEAN_MICDATA; + (NSString *)fus_FUS_CLEAN_MICDATA;
......
...@@ -397,12 +397,6 @@ ...@@ -397,12 +397,6 @@
return @"FUS_LIVE_ROOM_CHANGE_PKBTN_STATUS"; return @"FUS_LIVE_ROOM_CHANGE_PKBTN_STATUS";
} }
// PK状态改变
+ (NSString *)fus_FUS_LIVE_ROOM_PK_STATUS {
return @"FUS_LIVE_ROOM_PK_STATUS";
}
+ (NSString *)fus_FUS_REFRESH_ONLINEMIC { + (NSString *)fus_FUS_REFRESH_ONLINEMIC {
return @"FUS_REFRESH_ONLINEMIC"; return @"FUS_REFRESH_ONLINEMIC";
} }
......
...@@ -21,7 +21,9 @@ typedef enum : NSUInteger { ...@@ -21,7 +21,9 @@ typedef enum : NSUInteger {
liveLoadingDismiss, liveLoadingDismiss,
liveLoadingEntering, liveLoadingEntering,
liveLoadingPause, liveLoadingPause,
liveLoadingBuffering liveLoadingBuffering,
liveLoadingOBSInterupt,// OBS 推流中断
liveLoadingPushReconnecting,// 推流重连中
} LiveLoadingType; } LiveLoadingType;
@interface FUSLiveMainViewController : FUSBaseViewController @interface FUSLiveMainViewController : FUSBaseViewController
......
...@@ -666,12 +666,11 @@ ...@@ -666,12 +666,11 @@
} }
+ (void)fus_setPKUser:(NSString *)uid mute:(BOOL)mute{ + (void)fus_setPKUser:(NSString *)uid mute:(BOOL)mute{
// TODO: V57 需要完成这个 if (FUSSwiftLiveHelper.shared.liveType == FUSLiveTypeAnchor) {
// if (FUSSwiftLiveHelper.shared.liveType == FUSLiveTypeAnchor) { [FUSLiveHelper.shareInstance.liveVC.pushView fus_setPKUser:uid mute:mute];
// [FUSLiveHelper.shareInstance.liveVC.pushView fus_setPKUser:uid mute:mute]; } else {
// } else { [FUSLiveHelper.shareInstance.liveVC.playView fus_setPKUser:uid mute:mute];
// [FFLiveHelper.shareInstance.liveVC.playView fus_setPKUser:uid mute:mute]; }
// }
} }
/** /**
...@@ -1395,17 +1394,18 @@ ...@@ -1395,17 +1394,18 @@
if (pkInfo.integerValue == 1) { //在pk中 if (pkInfo.integerValue == 1) { //在pk中
// 审核下不显示PK // 审核下不显示PK
if(FUSConfig.sharedInstanced.devConfigs.appStatus) return; if(FUSConfig.sharedInstanced.devConfigs.appStatus) return;
[FUSLiveHttpHelper fus_getRoomPKInfoWithRoomId:[FUSLiveHelper shareInstance].roomInfoModel.roomId success:^(NSString *status, NSString *remainTime, NSString *winner, NSString *content,NSString *isLikePk,NSArray<FUSPKRoomPKInfoModel *> *userlistArray,NSString *matchId) { [FUSSwiftLiveHelper.shared.pkHelper getRoomPKInfoWithRoomId:FUSSwiftLiveHelper.shared.roomInfoModel.roomId reconnect:0];
// [FUSLiveHttpHelper fus_getRoomPKInfoWithRoomId:[FUSLiveHelper shareInstance].roomInfoModel.roomId success:^(NSString *status, NSString *remainTime, NSString *winner, NSString *content,NSString *isLikePk,NSArray<FUSPKRoomPKInfoModel *> *userlistArray,NSString *matchId) {
if (![roomInfoModel.roomId isEqualToString:[FUSLiveHelper shareInstance].roomInfoModel.roomId]) { //
FUSLogInfo(@"不是当前包房"); // if (![roomInfoModel.roomId isEqualToString:[FUSLiveHelper shareInstance].roomInfoModel.roomId]) {
return ; // FUSLogInfo(@"不是当前包房");
} // return ;
// }
[[FUSLiveHelper shareInstance].currentFunctionView fus_setupContentViewWithStatus:status remainTime:remainTime winner:winner content:content userlistArray:userlistArray isShowEntrance:YES]; //
} failure:^(NSString *msg, int code) { // [[FUSLiveHelper shareInstance].currentFunctionView fus_setupContentViewWithStatus:status remainTime:remainTime winner:winner content:content userlistArray:userlistArray isShowEntrance:YES];
FUSLogInfo(@"@%",msg); // } failure:^(NSString *msg, int code) {
}]; // FUSLogInfo(@"@%",msg);
// }];
} }
[FUSLiveHelper shareInstance].streamModel.url = streamUrl; [FUSLiveHelper shareInstance].streamModel.url = streamUrl;
...@@ -1427,7 +1427,8 @@ ...@@ -1427,7 +1427,8 @@
// [[FUSLiveGiftView shareGiftView] fus_requestGiftDataWithType:ReadDatabaseBegin success:nil failure:nil]; // [[FUSLiveGiftView shareGiftView] fus_requestGiftDataWithType:ReadDatabaseBegin success:nil failure:nil];
[[FUSLiveHelper shareInstance].liveVC.playView fus_setVideoframeCallBackOpen:self.autoStartPictureInPicture forUid:[FUSLiveHelper shareInstance].liveVC.playView.mainUID]; [[FUSLiveHelper shareInstance].liveVC.playView fus_setVideoframeCallBackOpen:self.autoStartPictureInPicture forUid:[FUSLiveHelper shareInstance].liveVC.playView.mainUID];
if (roomInfoModel.livestate.intValue == 1) { // byteRTC不暂停播放
if (roomInfoModel.livestate.intValue == 1 && weakSelf.rtcType.integerValue == 1) {
FUSLogDebug(@"FUSStreamPlayView==== 暂停1"); FUSLogDebug(@"FUSStreamPlayView==== 暂停1");
[weakSelf.liveVC fus_setupLiveStateIsPause:YES]; [weakSelf.liveVC fus_setupLiveStateIsPause:YES];
FUSLogDebug(@"FUSStreamPlayView==== 暂停2"); FUSLogDebug(@"FUSStreamPlayView==== 暂停2");
......
...@@ -687,16 +687,16 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -687,16 +687,16 @@ NS_ASSUME_NONNULL_BEGIN
*/ */
+ (void)fus_requestCharacterHyperlinkData; + (void)fus_requestCharacterHyperlinkData;
/** ///**
获取pk房间信息 // 获取pk房间信息
//
@param roomId 房间号 // @param roomId 房间号
@param success 成功回调 // @param success 成功回调
@param failure 失败回调 // @param failure 失败回调
*/ // */
+ (void)fus_getRoomPKInfoWithRoomId:(NSString *)roomId //+ (void)fus_getRoomPKInfoWithRoomId:(NSString *)roomId
success:(void(^)(NSString *status,NSString *remainTime, NSString *winner,NSString *content,NSString *isLikePk,NSArray <FUSPKRoomPKInfoModel *>*userlistArray, NSString *matchId))success // success:(void(^)(NSString *status,NSString *remainTime, NSString *winner,NSString *content,NSString *isLikePk,NSArray <FUSPKRoomPKInfoModel *>*userlistArray, NSString *matchId))success
failure:(void(^)(NSString *msg, int code))failure; // failure:(void(^)(NSString *msg, int code))failure;
/// 引流数据统计 /// 引流数据统计
/// @param toRoomId 所在直播间 /// @param toRoomId 所在直播间
......
...@@ -2131,51 +2131,51 @@ ...@@ -2131,51 +2131,51 @@
} }
/** ///**
获取pk房间信息 // 获取pk房间信息
//
@param roomId 房间号 // @param roomId 房间号
@param success 成功回调 // @param success 成功回调
@param failure 失败回调 // @param failure 失败回调
*/ // */
+ (void)fus_getRoomPKInfoWithRoomId:(NSString *)roomId //+ (void)fus_getRoomPKInfoWithRoomId:(NSString *)roomId
success:(void(^)(NSString *status,NSString *remainTime, NSString *winner,NSString *content,NSString *isLikePk,NSArray <FUSPKRoomPKInfoModel *>*userlistArray,NSString *matchId))success // success:(void(^)(NSString *status,NSString *remainTime, NSString *winner,NSString *content,NSString *isLikePk,NSArray <FUSPKRoomPKInfoModel *>*userlistArray,NSString *matchId))success
failure:(void(^)(NSString *msg, int code))failure { // failure:(void(^)(NSString *msg, int code))failure {
if ([NSString isNull:roomId]) { // if ([NSString isNull:roomId]) {
FUSLogInfo(@"PK房间信息参数为空"); // FUSLogInfo(@"PK房间信息参数为空");
return; // return;
} // }
NSDictionary *params = @{@"roomid":roomId}; // NSDictionary *params = @{@"roomid":roomId};
//
[FUSHttpHelper postRequestBinaryWithUrl:FUSShowRoomURLs.fus_URL_LIVE_PK_ROOM_PK_INFO params:params success:^(NSDictionary *dataDict, int code) { // [FUSHttpHelper postRequestBinaryWithUrl:FUSShowRoomURLs.fus_URL_LIVE_PK_ROOM_PK_INFO params:params success:^(NSDictionary *dataDict, int code) {
NSDictionary *dict = dataDict[@"data"]; // NSDictionary *dict = dataDict[@"data"];
NSString *status = dict[@"status"]; // NSString *status = dict[@"status"];
NSString *remaintime = dict[@"remaintime"]; // NSString *remaintime = dict[@"remaintime"];
NSArray *userlist = dict[@"userlist"]; // NSArray *userlist = dict[@"userlist"];
NSString *winner = dict[@"winner"]; // NSString *winner = dict[@"winner"];
NSString *content = dict[@"content"]; // NSString *content = dict[@"content"];
NSString *isLikePk = dict[@"isLikePk"]; // NSString *isLikePk = dict[@"isLikePk"];
NSString *matchId = [dict[@"matchid"] description]; // NSString *matchId = [dict[@"matchid"] description];
NSInteger winTotal = [dict[@"winTotal"] integerValue]; // NSInteger winTotal = [dict[@"winTotal"] integerValue];
[[NSUserDefaults standardUserDefaults] setObject:[isLikePk description] forKey:FUSLiveUDKeys.fus_PK_IS_FOCUS_OPPOSITE_ANCHOR]; // [[NSUserDefaults standardUserDefaults] setObject:[isLikePk description] forKey:FUSLiveUDKeys.fus_PK_IS_FOCUS_OPPOSITE_ANCHOR];
[FUSLiveHelper shareInstance].currentFunctionView.pkHelper.matchId = matchId; // [FUSLiveHelper shareInstance].currentFunctionView.pkHelper.matchId = matchId;
[FUSLiveHelper shareInstance].currentFunctionView.pkHelper.winTotal = winTotal; // [FUSLiveHelper shareInstance].currentFunctionView.pkHelper.winTotal = winTotal;
NSMutableArray *userMutArray = [NSMutableArray arrayWithCapacity:userlist.count]; // NSMutableArray *userMutArray = [NSMutableArray arrayWithCapacity:userlist.count];
for (NSDictionary *userDict in userlist) { // for (NSDictionary *userDict in userlist) {
FUSPKRoomPKInfoModel *roomPKInfoModel = [FUSPKRoomPKInfoModel fus_modelWithDict:userDict]; // FUSPKRoomPKInfoModel *roomPKInfoModel = [FUSPKRoomPKInfoModel fus_modelWithDict:userDict];
[userMutArray addObject:roomPKInfoModel]; // [userMutArray addObject:roomPKInfoModel];
} // }
if (success) { // if (success) {
dispatch_async(dispatch_get_main_queue(), ^{ // dispatch_async(dispatch_get_main_queue(), ^{
success(status,remaintime,winner,content,isLikePk,userMutArray,matchId); // success(status,remaintime,winner,content,isLikePk,userMutArray,matchId);
}); // });
} // }
} failure:^(NSDictionary *dataDict, int code) { // } failure:^(NSDictionary *dataDict, int code) {
if (failure) { // if (failure) {
failure(FAILURE_MESSAGE, code); // failure(FAILURE_MESSAGE, code);
} // }
}]; // }];
} //}
/// 直播间同步用户权益信息 /// 直播间同步用户权益信息
......
...@@ -279,8 +279,8 @@ ...@@ -279,8 +279,8 @@
// 添加ID // 添加ID
__block UILabel *IDLabel; __block UILabel *IDLabel;
IDLabel = [[UILabel alloc] initWithFrame:CGRectMake(UIView.fus_screenW - 80 - 15, 100 + UIView.fus_SafeTop + 20, 80, 20)]; IDLabel = [[UILabel alloc] initWithFrame:CGRectMake(UIView.fus_screenW - 80 - 15, 100 + UIView.fus_SafeTop + 20, 80, 20)];
if ([FUSLiveHelper shareInstance].currentFunctionView.pkContentView) { if (FUSSwiftLiveHelper.shared.pkHelper.ocViewModel.currentPKState != FFPKStateNone) {
IDLabel.y = [FUSLiveHelper shareInstance].currentFunctionView.pkContentView.y + 23; IDLabel.y = FUSStreamKitPKConfig.fus_pkViewYPosition + 23;
IDLabel.x = UIView.fus_screenW - 80 - 5; IDLabel.x = UIView.fus_screenW - 80 - 5;
} }
IDLabel.font = [UIFont fus_themeFont:14]; IDLabel.font = [UIFont fus_themeFont:14];
...@@ -526,21 +526,34 @@ ...@@ -526,21 +526,34 @@
} }
- (void)fus_updateToolView2Types { - (void)fus_updateToolView2Types {
[self ffupdateToolView2TypesPKState:FUSLiveHelper.shareInstance.currentFunctionView.pkHelper.pkLiveState]; [self ffupdateToolView2TypesPKState:FUSSwiftLiveHelper.shared.pkHelper.ocViewModel.currentPKState];
} }
- (void)ffupdateToolView2TypesPKState:(FUSPKLiveState)pkState { - (void)ffupdateToolView2TypesPKState:(FFPKState)pkState {
NSMutableArray *toolTypesList = [[NSMutableArray alloc] init];
if (FUSLiveHelper.shareInstance.liveRoomType == FUSRoomTypeLinkMic) { if (FUSLiveHelper.shareInstance.liveRoomType == FUSRoomTypeLinkMic) {
[self.toolView2 showItemWithTypesWithToolTypes:@[@(FUSLiveBottomToolTypeLiveSetting),@(FUSLiveBottomToolTypeRoomSetting)/*,@(FUSLiveBottomToolTypeRoomScope), @(FUSLiveBottomToolTypeNovaBuild)*/]]; [toolTypesList appendObjects:@[@(FUSLiveBottomToolTypeLiveSetting),@(FUSLiveBottomToolTypeRoomSetting)/*,@(FFLiveBottomToolTypeRoomScope), @(FFLiveBottomToolTypeNovaBuild)*/]];
} else { } else {
if (FUSLiveHelper.shareInstance.roomScopeType == FUSLiveRoomScopeTypePassword) { if (FUSLiveHelper.shareInstance.roomScopeType == FUSLiveRoomScopeTypePassword) {
[self.toolView2 showItemWithTypesWithToolTypes:@[@(FUSLiveBottomToolTypeLiveSetting),@(FUSLiveBottomToolTypeRoomSetting), /*@(FUSLiveBottomToolTypeRoomScope),@(FUSLiveBottomToolTypePK), @(FUSLiveBottomToolTypeNovaBuild)*/]]; [toolTypesList appendObjects:@[@(FUSLiveBottomToolTypeLiveSetting),@(FUSLiveBottomToolTypeRoomSetting), /*@(FUSLiveBottomToolTypeRoomScope),@(FUSLiveBottomToolTypePK), @(FUSLiveBottomToolTypeNovaBuild)*/]];
} else { }
[self.toolView2 showItemWithTypesWithToolTypes:@[@(FUSLiveBottomToolTypeLiveSetting),@(FUSLiveBottomToolTypeRoomSetting), /*@(FUSLiveBottomToolTypeRoomScope),*/@(FUSLiveBottomToolTypePK)/*, @(FUSLiveBottomToolTypeNovaBuild)*/]]; else {
[toolTypesList appendObjects:@[@(FUSLiveBottomToolTypeLiveSetting),@(FUSLiveBottomToolTypeRoomSetting), /*@(FUSLiveBottomToolTypeRoomScope),*/@(FUSLiveBottomToolTypePK)/*, @(FUSLiveBottomToolTypeNovaBuild)*/]];
} }
// [toolTypesList appendObjects:@[@(FFLiveBottomToolTypeLiveSetting),@(FFLiveBottomToolTypeRoomSetting), @(FFLiveBottomToolTypeRoomScope),@(FFLiveBottomToolTypeBeautySticker), @(FFLiveBottomToolTypeNovaBuild)]];
} }
// TODO: V57 需要完成这个
// 是主播或者场控
// BOOL isAnchorOrLiveControl = FFLiveHelper.shareInstance.liveType == FFLiveTypeAnchor
// || FFSwiftLiveHelper.shared.roomInfoModel.liveControl.boolValue
// || FFSwiftLiveHelper.shared.roomInfoModel.fansGroup.groupHead == 1;
// if (isAnchorOrLiveControl) {
// [toolTypesList appendObject:@(FFLiveBottomToolTypeLiveManage)];
// }
[self.toolView2 showItemWithTypesWithToolTypes:toolTypesList];
} }
#pragma mark - 其他 #pragma mark - 其他
......
...@@ -424,26 +424,28 @@ ...@@ -424,26 +424,28 @@
- (void)fus_bottomToolViewDidClickPKBtn:(FUSLiveBottomToolView *)bottomToolView livePkBtnState:(FUSLiveChatToolPKBtnState)livePkBtnState{ - (void)fus_bottomToolViewDidClickPKBtn:(FUSLiveBottomToolView *)bottomToolView livePkBtnState:(FUSLiveChatToolPKBtnState)livePkBtnState{
switch (livePkBtnState) { // switch (livePkBtnState) {
case FUSLiveChatToolPKBtnStateStart: // case FUSLiveChatToolPKBtnStateStart:
[[FUSLiveHelper shareInstance].currentFunctionView fus_showPKStyleViewWithLivePkBtnState:FUSLivePKBtnStateStartPK]; // [[FUSLiveHelper shareInstance].currentFunctionView fus_showPKStyleViewWithLivePkBtnState:FUSLivePKBtnStateStartPK];
break; // break;
case FUSLiveChatToolPKBtnStateCancel: // case FUSLiveChatToolPKBtnStateCancel:
[[FUSLiveHelper shareInstance].currentFunctionView fus_showPKStyleViewWithLivePkBtnState:FUSLivePKBtnStateStartPK]; // [[FUSLiveHelper shareInstance].currentFunctionView fus_showPKStyleViewWithLivePkBtnState:FUSLivePKBtnStateStartPK];
break; // break;
case FUSLiveChatToolPKBtnStateStop: // case FUSLiveChatToolPKBtnStateStop:
[[FUSLiveHelper shareInstance].currentFunctionView fus_showPKStyleViewWithLivePkBtnState:FUSLivePKBtnStateStartPK]; // [[FUSLiveHelper shareInstance].currentFunctionView fus_showPKStyleViewWithLivePkBtnState:FUSLivePKBtnStateStartPK];
break; // break;
case FUSLiveChatToolPKBtnStateTimeOver: // case FUSLiveChatToolPKBtnStateTimeOver:
{ // {
[FUSDialogView fus_showDialog:[NSString fus_localString:@"PK匹配失败,请稍后再试"]]; // [FUSDialogView fus_showDialog:[NSString fus_localString:@"PK匹配失败,请稍后再试"]];
[[FUSLiveHelper shareInstance].currentFunctionView fus_dismissPKStyleViewAnimated:YES]; // [[FUSLiveHelper shareInstance].currentFunctionView fus_dismissPKStyleViewAnimated:YES];
[[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_cancelPKWithType:[FUSLiveHelper shareInstance].currentFunctionView.pkHelper.pkType]; // [[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_cancelPKWithType:[FUSLiveHelper shareInstance].currentFunctionView.pkHelper.pkType];
} // }
break; // break;
default: // default:
break; // break;
} // }
[[FUSLiveHelper shareInstance].currentFunctionView fus_showPKControlViewWithShowType:FFPKControlViewTypeBase];
} }
- (void)fus_bottomToolViewDidBeautySetting:(FUSLiveBottomToolView *)bottomToolView beautyType:(FUSLiveChatToolBeautyType)type{ - (void)fus_bottomToolViewDidBeautySetting:(FUSLiveBottomToolView *)bottomToolView beautyType:(FUSLiveChatToolBeautyType)type{
......
...@@ -1029,8 +1029,8 @@ ...@@ -1029,8 +1029,8 @@
// 添加ID // 添加ID
__block UILabel *IDLabel = [[UILabel alloc] initWithFrame:CGRectMake(UIView.fus_screenW - 80 - 15, 100 + UIView.fus_SafeTop + 20, 80, 20)]; __block UILabel *IDLabel = [[UILabel alloc] initWithFrame:CGRectMake(UIView.fus_screenW - 80 - 15, 100 + UIView.fus_SafeTop + 20, 80, 20)];
if ([FUSLiveHelper shareInstance].currentFunctionView.pkContentView) { if (FUSSwiftLiveHelper.shared.pkHelper.ocViewModel.currentPKState != FFPKStateNone) {
IDLabel.y = [FUSLiveHelper shareInstance].currentFunctionView.pkContentView.y + 23; IDLabel.y = FUSStreamKitPKConfig.fus_pkViewYPosition + 23;
IDLabel.x = UIView.fus_screenW - 80 - 5; IDLabel.x = UIView.fus_screenW - 80 - 5;
} }
IDLabel.font = [UIFont fus_themeFont:14]; IDLabel.font = [UIFont fus_themeFont:14];
......
...@@ -9,9 +9,7 @@ ...@@ -9,9 +9,7 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "FUSRoomInfoModel.h" #import "FUSRoomInfoModel.h"
#import "FUSLiveChatModel.h" #import "FUSLiveChatModel.h"
#import "FUSPKHelper.h"
#import "FUSPKStyleView.h" #import "FUSPKStyleView.h"
#import "FUSPKMainView.h"
#import "FUSPKBottomUserHeaderView.h" #import "FUSPKBottomUserHeaderView.h"
#import "FUSLiveChatTableView.h" #import "FUSLiveChatTableView.h"
#import "FUSContentView.h" #import "FUSContentView.h"
...@@ -88,10 +86,6 @@ typedef NS_ENUM(NSInteger, FUSFunctionMode) { ...@@ -88,10 +86,6 @@ typedef NS_ENUM(NSInteger, FUSFunctionMode) {
@end @end
@interface FUSLiveFunctionView : UIView @interface FUSLiveFunctionView : UIView
// PK相关处理
@property (nonatomic, strong) FUSPKHelper *pkHelper;
// PK内容View
@property (nonatomic, strong) FUSPKMainView *pkContentView;
/** /**
聊天信息 TableView 聊天信息 TableView
...@@ -330,68 +324,17 @@ typedef NS_ENUM(NSInteger, FUSFunctionMode) { ...@@ -330,68 +324,17 @@ typedef NS_ENUM(NSInteger, FUSFunctionMode) {
- (void)fus_showAllFunctionLayersWithAnimate:(BOOL)animate; - (void)fus_showAllFunctionLayersWithAnimate:(BOOL)animate;
#pragma mark -- PK #pragma mark -- PK
/**
创建观众端pkcontentView
@param status 当前的PK状态
@param remainTime 当前剩余时间
@param userlistArray 当前的主播信息和送礼信息
*/
- (void)fus_setupContentViewWithStatus:(NSString *)status
remainTime:(NSString *)remainTime
winner:(NSString *)winner
content:(NSString *)content
userlistArray:(NSArray <FUSPKRoomPKInfoModel *>*)userlistArray
isShowEntrance:(BOOL)isShowEntrance;
/// 自动根据pkhelper里的状态显示pk控制的view /// 自动根据pkhelper里的状态显示pk控制的view
- (void)fus_showPKControlViewWithShowType:(FFPKControlViewType)type; - (void)fus_showPKControlViewWithShowType:(FFPKControlViewType)type;
/**
根据状态显示PKStyleView
@param livePkBtnState PKbtn的状态
*/
- (void)fus_showPKStyleViewWithLivePkBtnState:(FUSLivePKBtnState)livePkBtnState;
/** /**
根据服务器返回的状态停止PK
@param livePkBtnState pk状态
*/
- (void)fus_stopPKMatchingAccordingServerData:(FUSPKLiveState)livePkBtnState PKId:(NSString *)pkId matchId:(NSString *)matchId;
/**
消失pkstyleView 消失pkstyleView
@param animated 是否动画 @param animated 是否动画
*/ */
- (void)fus_dismissPKStyleViewAnimated:(BOOL)animated; - (void)fus_dismissPKStyleViewAnimated:(BOOL)animated;
/**
改变PK按钮的状态
@param livePKBtnState 按钮状态枚举
*/
- (void)fus_changeLivePKBtnState:(FUSLivePKBtnState)livePKBtnState;
/**
显示styleview默认的 view
*/
- (void)fus_showStyleViewWithHomeViewDefaultShowType:(FUSPKHomeViewDefaultShowType)homeViewDefaultShowType;
/**
开启pk匹配计时器
*/
- (void)fus_startPKMatchingTimer:(NSString *)timeout;
/**
停止pk匹配计时器
*/
- (void)fus_stopPKMatchingTimer;
/**
收到对方整个直播拒绝邀请PK
*/
- (void)fus_receiveRemoteRefusePKWholeLiveTimeWithUid:(NSString *)uid;
/// 清除所有半屏弹窗 /// 清除所有半屏弹窗
-(void)fus_clearHalfWebView; -(void)fus_clearHalfWebView;
......
...@@ -264,8 +264,6 @@ ...@@ -264,8 +264,6 @@
#pragma - 声网 #pragma - 声网
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveUserLinkMicRoleChange:) name:kLiveLinkMicRoleDidChanged object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveUserLinkMicRoleChange:) name:kLiveLinkMicRoleDidChanged object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(fus_refreshLinkMicViewWithPKState:) name:FUSLiveNotificationKeys.fus_FUS_LIVE_ROOM_PK_STATUS object:nil];
// 接收到即将连接视讯声讯,通知停止连麦 // 接收到即将连接视讯声讯,通知停止连麦
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(fus_stopLinkMic) name:FUSChatNotificationKeys.fus_CHAT_READY_CONNECT_VOICE object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(fus_stopLinkMic) name:FUSChatNotificationKeys.fus_CHAT_READY_CONNECT_VOICE object:nil];
...@@ -787,17 +785,6 @@ ...@@ -787,17 +785,6 @@
} }
} }
- (void)fus_refreshLinkMicViewWithPKState:(NSNotification *)noti {
FUSPKLiveState pkState = (FUSPKLiveState)[noti.object integerValue];
if (pkState == FUSPKLiveStateNone) {
self.hidden = NO;
}else{
self.hidden = YES;
self.selfCloseMic = NO;
}
}
- (void)enterForeground:(NSNotification *)noti { - (void)enterForeground:(NSNotification *)noti {
[self changeSelfMicStatus:YES]; [self changeSelfMicStatus:YES];
} }
......
...@@ -37,6 +37,7 @@ NSString * const kStreamPKPlayViewLiveStateNotification = @"kStreamPKPlayViewLiv ...@@ -37,6 +37,7 @@ NSString * const kStreamPKPlayViewLiveStateNotification = @"kStreamPKPlayViewLiv
@end @end
@implementation FUSPKHelper @implementation FUSPKHelper
#if 0
- (instancetype)init { - (instancetype)init {
self = [super init]; self = [super init];
if (self) { if (self) {
...@@ -1017,4 +1018,5 @@ NSString * const kStreamPKPlayViewLiveStateNotification = @"kStreamPKPlayViewLiv ...@@ -1017,4 +1018,5 @@ NSString * const kStreamPKPlayViewLiveStateNotification = @"kStreamPKPlayViewLiv
FUSLogInfo(@"%@ dealloc",[self class]); FUSLogInfo(@"%@ dealloc",[self class]);
[self removeNotification]; [self removeNotification];
} }
#endif
@end @end
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
// Copyright © 2024年 FusiYa. All rights reserved. // Copyright © 2024年 FusiYa. All rights reserved.
// //
// TODO: V57 需要完成这个 废弃
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
......
...@@ -84,7 +84,7 @@ NSInteger const kPKMainResultViewHeight = 150; ...@@ -84,7 +84,7 @@ NSInteger const kPKMainResultViewHeight = 150;
self.PKRightResultImageView.hidden = YES; self.PKRightResultImageView.hidden = YES;
self.winningStreakView = [[FUSPkWinningStreakView alloc] initWithFrame:CGRectMake(0, 0, 48, 42)]; self.winningStreakView = [[FUSPkWinningStreakView alloc] initWithFrame:CGRectMake(0, 0, 48, 42)];
[self.winningStreakView fus_setNumber:[FUSLiveHelper shareInstance].currentFunctionView.pkHelper.winTotal anim:NO]; // [self.winningStreakView fus_setNumber:[FUSLiveHelper shareInstance].currentFunctionView.pkHelper.winTotal anim:NO];
[self addSubview:self.winningStreakView]; [self addSubview:self.winningStreakView];
self.userInteractionEnabled = NO; self.userInteractionEnabled = NO;
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
// Created by 方磊 on 2019/4/2. // Created by 方磊 on 2019/4/2.
// Copyright © 2024年 FusiYa. All rights reserved. // Copyright © 2024年 FusiYa. All rights reserved.
// //
// TODO: V57 需要完成这个 废弃
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
......
...@@ -46,6 +46,7 @@ NSInteger const kPKMainTopViewHeight = 23; ...@@ -46,6 +46,7 @@ NSInteger const kPKMainTopViewHeight = 23;
@end @end
@implementation FUSPKMainTopView @implementation FUSPKMainTopView
#if 0
- (instancetype)initWithFrame:(CGRect)frame { - (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame]; self = [super initWithFrame:frame];
...@@ -429,4 +430,5 @@ NSInteger const kPKMainTopViewHeight = 23; ...@@ -429,4 +430,5 @@ NSInteger const kPKMainTopViewHeight = 23;
} }
} }
#endif
@end @end
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
// Copyright © 2024年 FusiYa. All rights reserved. // Copyright © 2024年 FusiYa. All rights reserved.
// //
// TODO: V57 需要完成这个 废弃
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "FUSPKMainTopView.h" #import "FUSPKMainTopView.h"
#import "FUSPKMainResultView.h" #import "FUSPKMainResultView.h"
...@@ -14,7 +16,6 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -14,7 +16,6 @@ NS_ASSUME_NONNULL_BEGIN
extern NSInteger const kPKMainViewAdditionHeight; extern NSInteger const kPKMainViewAdditionHeight;
@class FUSPKHelper;
@class FUSPKInfoModel; @class FUSPKInfoModel;
@class FUSPKRoomPKInfoModel; @class FUSPKRoomPKInfoModel;
@class FUSPKNextStepModel; @class FUSPKNextStepModel;
......
...@@ -60,6 +60,8 @@ NSInteger const kPKMainViewAdditionHeight = 51; ...@@ -60,6 +60,8 @@ NSInteger const kPKMainViewAdditionHeight = 51;
@implementation FUSPKMainView @implementation FUSPKMainView
#if 0
/** /**
构造 构造
...@@ -1197,4 +1199,6 @@ NSInteger const kPKMainViewAdditionHeight = 51; ...@@ -1197,4 +1199,6 @@ NSInteger const kPKMainViewAdditionHeight = 51;
FUSLogInfo(@"===%@ delloc",[self class]); FUSLogInfo(@"===%@ delloc",[self class]);
} }
#endif
@end @end
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
// Copyright © 2024年 FusiYa. All rights reserved. // Copyright © 2024年 FusiYa. All rights reserved.
// //
// TODO: V57 需要完成这个 废弃
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "FUSPKHttpHelper.h" #import "FUSPKHttpHelper.h"
#import "FUSPKBtnStateModel.h" #import "FUSPKBtnStateModel.h"
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
// Copyright © 2024年 FusiYa. All rights reserved. // Copyright © 2024年 FusiYa. All rights reserved.
// //
// TODO: V57 需要完成这个 废弃,后续删除
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "FUSPKStyleModel.h" #import "FUSPKStyleModel.h"
#import "FUSPKBtnStateModel.h" #import "FUSPKBtnStateModel.h"
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
@end @end
@implementation FUSRandomActivityPKView @implementation FUSRandomActivityPKView
#if 0
// 构造方法 // 构造方法
+ (instancetype)RandomActivityPKView { + (instancetype)RandomActivityPKView {
return [[[FUSShowRoomCenterBunble bundle] loadNibNamed:NSStringFromClass([FUSRandomActivityPKView class]) owner:self options:nil] firstObject]; return [[[FUSShowRoomCenterBunble bundle] loadNibNamed:NSStringFromClass([FUSRandomActivityPKView class]) owner:self options:nil] firstObject];
...@@ -116,7 +117,7 @@ ...@@ -116,7 +117,7 @@
} else if (self.PKBtnStateModel.status.integerValue == 2 || self.PKBtnStateModel.status.integerValue == 3 || self.PKBtnStateModel.status.integerValue == 4 || self.PKBtnStateModel.status.integerValue == 5 || self.PKBtnStateModel.status.integerValue == -1) { } else if (self.PKBtnStateModel.status.integerValue == 2 || self.PKBtnStateModel.status.integerValue == 3 || self.PKBtnStateModel.status.integerValue == 4 || self.PKBtnStateModel.status.integerValue == 5 || self.PKBtnStateModel.status.integerValue == -1) {
// 结束PK // 结束PK
// [[FUSLiveHelper shareInstance].currentFunctionView fus_showPKStyleViewWithLivePkBtnState:FUSLivePKBtnStateStopPK]; // [[FUSLiveHelper shareInstance].currentFunctionView fus_showPKStyleViewWithLivePkBtnState:FUSLivePKBtnStateStopPK];
[[FUSLiveHelper shareInstance].currentFunctionView fus_changeLivePKBtnState:(FUSLivePKBtnStateStartPK)]; // [[FUSLiveHelper shareInstance].currentFunctionView fus_changeLivePKBtnState:(FUSLivePKBtnStateStartPK)];
switch (self.PKBtnStateModel.status.integerValue) { switch (self.PKBtnStateModel.status.integerValue) {
case -1: case -1:
[self fus_stopPKWithPKState:FUSPKLiveStateConnectting]; [self fus_stopPKWithPKState:FUSPKLiveStateConnectting];
...@@ -193,29 +194,29 @@ ...@@ -193,29 +194,29 @@
取消pk 取消pk
*/ */
- (void)fus_cancelPK { - (void)fus_cancelPK {
[[FUSLiveHelper shareInstance].currentFunctionView fus_dismissPKStyleViewAnimated:YES]; // [[FUSLiveHelper shareInstance].currentFunctionView fus_dismissPKStyleViewAnimated:YES];
// 改变按钮状态 // // 改变按钮状态
[[FUSLiveHelper shareInstance].currentFunctionView fus_changeLivePKBtnState:FUSLivePKBtnStateStartPK]; // [[FUSLiveHelper shareInstance].currentFunctionView fus_changeLivePKBtnState:FUSLivePKBtnStateStartPK];
// 取消PKfus_cancelPKWithType // // 取消PKfus_cancelPKWithType
if (self.PKBtnStateModel.curType.integerValue == 3) { // if (self.PKBtnStateModel.curType.integerValue == 3) {
[FUSTalkingData fus_trackEvent:FUSLiveEventTrackParams.fus_EVENT_LIVEROOM_PK_CANCEL_PK label:@"" parameters:@{@"type":@"randommatch"}]; // [FUSTalkingData fus_trackEvent:FUSLiveEventTrackParams.fus_EVENT_LIVEROOM_PK_CANCEL_PK label:@"" parameters:@{@"type":@"randommatch"}];
[[FUSLiveHelper shareInstance].currentFunctionView fus_stopPKMatchingTimer]; // [[FUSLiveHelper shareInstance].currentFunctionView fus_stopPKMatchingTimer];
[[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_cancelPKWithType:FUSPKTypeAllAnchor]; // [[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_cancelPKWithType:FUSPKTypeAllAnchor];
} else if (self.PKBtnStateModel.curType.integerValue == 4) { // } else if (self.PKBtnStateModel.curType.integerValue == 4) {
[FUSTalkingData fus_trackEvent:FUSLiveEventTrackParams.fus_EVENT_LIVEROOM_PK_CANCEL_PK label:@"" parameters:@{@"type":@"activity"}]; // [FUSTalkingData fus_trackEvent:FUSLiveEventTrackParams.fus_EVENT_LIVEROOM_PK_CANCEL_PK label:@"" parameters:@{@"type":@"activity"}];
[[FUSLiveHelper shareInstance].currentFunctionView fus_stopPKMatchingTimer]; // [[FUSLiveHelper shareInstance].currentFunctionView fus_stopPKMatchingTimer];
[[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_cancelPKWithType:FUSPKTypeActivity]; // [[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_cancelPKWithType:FUSPKTypeActivity];
} else if (self.PKBtnStateModel.curType.integerValue == 1) { // } else if (self.PKBtnStateModel.curType.integerValue == 1) {
//
} else if (self.PKBtnStateModel.curType.integerValue == 2) { // } else if (self.PKBtnStateModel.curType.integerValue == 2) {
[FUSTalkingData fus_trackEvent:FUSLiveEventTrackParams.fus_EVENT_LIVEROOM_PK_CANCEL_PK label:@"" parameters:@{@"type":@"hotlist"}]; // [FUSTalkingData fus_trackEvent:FUSLiveEventTrackParams.fus_EVENT_LIVEROOM_PK_CANCEL_PK label:@"" parameters:@{@"type":@"hotlist"}];
[[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_invitePKWithPKid:self.PKBtnStateModel.pkid type:FUSPKTypeHotAnchor status:@"2" renew:@"0" success:^(NSString * _Nonnull renewStatus, NSString * _Nonnull nickName) { // [[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_invitePKWithPKid:self.PKBtnStateModel.pkid type:FUSPKTypeHotAnchor status:@"2" renew:@"0" success:^(NSString * _Nonnull renewStatus, NSString * _Nonnull nickName) {
// 改变pk按钮状态 // // 改变pk按钮状态
[[FUSLiveHelper shareInstance].currentFunctionView fus_changeLivePKBtnState:(FUSLivePKBtnStateStartPK)]; // [[FUSLiveHelper shareInstance].currentFunctionView fus_changeLivePKBtnState:(FUSLivePKBtnStateStartPK)];
} failure:^(NSString * _Nonnull msg, int code) { // } failure:^(NSString * _Nonnull msg, int code) {
//
}]; // }];
} // }
} }
// 取消定时器 // 取消定时器
- (void)fus_cancelTimer { - (void)fus_cancelTimer {
...@@ -236,7 +237,7 @@ ...@@ -236,7 +237,7 @@
} else if (self.PKBtnStateModel.curType.integerValue == 4) { } else if (self.PKBtnStateModel.curType.integerValue == 4) {
[FUSTalkingData fus_trackEvent:FUSLiveEventTrackParams.fus_EVENT_LIVEROOM_PK_CLOSE_PK label:@"" parameters:@{@"type":@"activity"}]; [FUSTalkingData fus_trackEvent:FUSLiveEventTrackParams.fus_EVENT_LIVEROOM_PK_CLOSE_PK label:@"" parameters:@{@"type":@"activity"}];
} }
[[FUSLiveHelper shareInstance].currentFunctionView fus_stopPKMatchingAccordingServerData:state PKId:self.PKBtnStateModel.pkid matchId:self.PKBtnStateModel.matchid]; // [[FUSLiveHelper shareInstance].currentFunctionView fus_stopPKMatchingAccordingServerData:state PKId:self.PKBtnStateModel.pkid matchId:self.PKBtnStateModel.matchid];
} }
#pragma mark - 赋值 #pragma mark - 赋值
...@@ -338,4 +339,5 @@ ...@@ -338,4 +339,5 @@
self.backBtn.hidden = NO; self.backBtn.hidden = NO;
} }
} }
#endif
@end @end
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#import "FUSPaymentManager.h" #import "FUSPaymentManager.h"
#import "FUSRechargeViewController.h" #import "FUSRechargeViewController.h"
#import <FUSShowRoomModule/FUSShowRoomModule-Swift.h>
@interface FUSRoomFirstChargeAlertView () @interface FUSRoomFirstChargeAlertView ()
...@@ -85,7 +86,7 @@ ...@@ -85,7 +86,7 @@
/// 判断是否可以弹窗 /// 判断是否可以弹窗
+ (BOOL)fus_canDailyShow { + (BOOL)fus_canDailyShow {
if ([FUSLiveHelper shareInstance].currentFunctionView.pkHelper.pkLiveState == FUSPKLiveStatePK) { if (FUSSwiftLiveHelper.shared.pkHelper.ocViewModel.currentPKState != FFPKStateNone) {
return NO; return NO;
} }
......
...@@ -328,8 +328,8 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -328,8 +328,8 @@ NS_ASSUME_NONNULL_BEGIN
+ (NSString *)fus_URL_Live_Popularity_Contribute_List; + (NSString *)fus_URL_Live_Popularity_Contribute_List;
#pragma mark -- PK #pragma mark -- PK
// 房间PK信息 //// 房间PK信息
+ (NSString *)fus_URL_LIVE_PK_ROOM_PK_INFO; //+ (NSString *)fus_URL_LIVE_PK_ROOM_PK_INFO;
// PK信息 // PK信息
+ (NSString *)fus_URL_LIVE_PK_INFO; + (NSString *)fus_URL_LIVE_PK_INFO;
......
...@@ -603,10 +603,10 @@ ...@@ -603,10 +603,10 @@
} }
#pragma mark -- PK #pragma mark -- PK
// 房间PK信息 //// 房间PK信息
+ (NSString *)fus_URL_LIVE_PK_ROOM_PK_INFO { //+ (NSString *)fus_URL_LIVE_PK_ROOM_PK_INFO {
return [FUSConfig.sharedInstanced.pathConfigs apiUrl:@"/pk/roompkinfo.html"]; // return [FUSConfig.sharedInstanced.pathConfigs apiUrl:@"/pk/roompkinfo.html"];
} //}
// PK信息 // PK信息
+ (NSString *)fus_URL_LIVE_PK_INFO { + (NSString *)fus_URL_LIVE_PK_INFO {
......
...@@ -601,7 +601,7 @@ ...@@ -601,7 +601,7 @@
NSString *liveType = @"0"; NSString *liveType = @"0";
[FUSLiveHttpHelper fus_exitRoomWithRoomId:[[[FUSLiveHelper shareInstance] roomInfoModel] roomId] livingType:liveType vdoid:[[[FUSLiveHelper shareInstance] streamModel] vdoid] success:^(NSDictionary *dataDict) { [FUSLiveHttpHelper fus_exitRoomWithRoomId:[[[FUSLiveHelper shareInstance] roomInfoModel] roomId] livingType:liveType vdoid:[[[FUSLiveHelper shareInstance] streamModel] vdoid] success:^(NSDictionary *dataDict) {
[[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_removeAllNotification]; [[[FUSSwiftLiveHelper shared] pkHelper] ff_removeAndCleanHelper];
} failure:^(NSString *msg, int code, NSDictionary *errorDict) { } failure:^(NSString *msg, int code, NSDictionary *errorDict) {
}]; }];
......
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