Commit 6e9aadd8 by ludi

初步完成ffpkhelper对接

parent cf41be93
Showing with 307 additions and 339 deletions
......@@ -243,10 +243,6 @@ NS_ASSUME_NONNULL_BEGIN
// 改变PK按钮状态
+ (NSString *)fus_FUS_LIVE_ROOM_CHANGE_PKBTN_STATUS;
// PK状态改变
+ (NSString *)fus_FUS_LIVE_ROOM_PK_STATUS;
+ (NSString *)fus_FUS_REFRESH_ONLINEMIC;
+ (NSString *)fus_FUS_CLEAN_MICDATA;
......
......@@ -397,12 +397,6 @@
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 {
return @"FUS_REFRESH_ONLINEMIC";
}
......
......@@ -21,7 +21,9 @@ typedef enum : NSUInteger {
liveLoadingDismiss,
liveLoadingEntering,
liveLoadingPause,
liveLoadingBuffering
liveLoadingBuffering,
liveLoadingOBSInterupt,// OBS 推流中断
liveLoadingPushReconnecting,// 推流重连中
} LiveLoadingType;
@interface FUSLiveMainViewController : FUSBaseViewController
......
......@@ -332,7 +332,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
}
if ([FUSLiveHelper shareInstance].streamModel.isPauseLive
&& weakSelf.liveFunctionView.pkHelper.pkLiveState == FUSPKLiveStateNone) {
&& FUSSwiftLiveHelper.shared.pkHelper.ocViewModel.currentPKState != FFPKStateNone) {
[weakSelf fus_showLiveLoadingViewWithType:liveLoadingPause];
} else {
FUSLogInfo(@"pierce:AFNetworkReachabilityStatusReachableViaWWAN");
......@@ -373,7 +373,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
return;
}
if ([FUSLiveHelper shareInstance].streamModel.isPauseLive
&& _liveFunctionView.pkHelper.pkLiveState == FUSPKLiveStateNone) {
&& FUSSwiftLiveHelper.shared.pkHelper.ocViewModel.currentPKState != FFPKStateNone) {
[weakSelf fus_showLiveLoadingViewWithType:liveLoadingPause];
} else {
FUSLogInfo(@"pierce:AFNetworkReachabilityStatusReachableViaWiFi");
......@@ -719,15 +719,19 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
if (pkInfo.integerValue == 1) { //在pk中
// 审核下不显示PK
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) {
if (![roomInfoModel.roomId isEqualToString:[FUSLiveHelper shareInstance].roomInfoModel.roomId]) {
FUSLogInfo(@"不是当前包房");
return ;
}
[[FUSLiveHelper shareInstance].currentFunctionView fus_setupContentViewWithStatus:status remainTime:remainTime winner:winner content:content userlistArray:userlistArray isShowEntrance:YES];
} failure:^(NSString *msg, int code) {
FUSLogInfo(@"@%",msg);
}];
// [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(@"不是当前包房");
// return ;
// }
// [[FUSLiveHelper shareInstance].currentFunctionView fus_setupContentViewWithStatus:status remainTime:remainTime winner:winner content:content userlistArray:userlistArray isShowEntrance:YES];
// } failure:^(NSString *msg, int code) {
// FUSLogInfo(@"@%",msg);
// }];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[FUSSwiftLiveHelper.shared.pkHelper getRoomPKInfoWithRoomId:FUSSwiftLiveHelper.shared.roomInfoModel.roomId reconnect:1];
});
}
......@@ -800,7 +804,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
MJWeakSelf
[FUSLiveHttpHelper fus_requestEndLiveWithRoomId:[[[FUSLiveHelper shareInstance] roomInfoModel] roomId] channelId:[[[FUSLiveHelper shareInstance] roomInfoModel] channelId] succeed:^(NSDictionary *dataDict) {
[[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_removeAllNotification];
[FUSSwiftLiveHelper.shared.pkHelper ff_removeAndCleanHelper];
[weakSelf initLiveEndViewWithInfoDict:dataDict];
} failure:^(NSString *msg, NSInteger code) {
[FUSDialogView fus_showDialog:msg];
......@@ -829,7 +833,8 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
// 直播端
[FUSLiveHttpHelper fus_requestEndLiveWithRoomId:[[[FUSLiveHelper shareInstance] roomInfoModel] roomId] channelId:[[[FUSLiveHelper shareInstance] roomInfoModel] channelId] succeed:^(NSDictionary *dataDict) {
[[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_removeAllNotification];
// [[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_removeAllNotification];
[FUSSwiftLiveHelper.shared.pkHelper ff_removeAndCleanHelper];
[weakSelf initLiveEndViewWithInfoDict:dataDict];
[FUSLiveHelper shareInstance].roomInfoModel = nil;
[FUSLiveHelper shareInstance].liveType = FUSLiveTypeNone;
......@@ -845,7 +850,8 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
}];
}else {
[FUSLiveHttpHelper fus_exitRoomWithRoomId:[[[FUSLiveHelper shareInstance] roomInfoModel] roomId] livingType:@"0" vdoid:[[[FUSLiveHelper shareInstance] streamModel] vdoid] success:^(NSDictionary *dataDict) {
[[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_removeAllNotification];
// [[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_removeAllNotification];
[FUSSwiftLiveHelper.shared.pkHelper ff_removeAndCleanHelper];
[weakSelf initLiveEndViewWithInfoDict:dataDict];
[FUSLiveHelper shareInstance].roomInfoModel = nil;
[FUSLiveHelper shareInstance].liveType = FUSLiveTypeNone;
......@@ -863,7 +869,8 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
}
}else{
[FUSLiveHttpHelper fus_exitLinkMicRoomWithFid:[[[FUSLiveHelper shareInstance] roomInfoModel] roomId] vdoid:[[[FUSLiveHelper shareInstance] streamModel] vdoid] success:^(NSDictionary *dataDict) {
[[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_removeAllNotification];
// [[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_removeAllNotification];
[FUSSwiftLiveHelper.shared.pkHelper ff_removeAndCleanHelper];
[FUSLiveHelper shareInstance].roomInfoModel = nil;
[self fus_cleanEndView];
......@@ -997,7 +1004,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
}
//pk 状态下不显示单人直播时的暂停画面
if (_liveFunctionView.pkHelper.pkLiveState != FUSPKLiveStateNone) {
if (FUSSwiftLiveHelper.shared.pkHelper.ocViewModel.currentPKState != FFPKStateNone) {
FUSLogInfo(@"pierce:fus_setupLiveStateIsPause");
[self fus_showLiveLoadingViewWithType:liveLoadingDismiss];
_streamView.playView.hidden = NO;
......@@ -1009,7 +1016,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
}
dict[@"roomid"] = [[[FUSLiveHelper shareInstance]roomInfoModel]roomId];
[[NSNotificationCenter defaultCenter] postNotificationName:kStreamPKPlayViewLiveStateNotification object:dict];
[[NSNotificationCenter defaultCenter] postNotificationName:FFPKNotification.playViewDidChanged object:dict];
return;
}
......@@ -1018,7 +1025,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
_streamView.playView.hidden = isPause;
if (isPause) {
if (_liveFunctionView.pkHelper.pkLiveState == FUSPKLiveStateNone) {
if (FUSSwiftLiveHelper.shared.pkHelper.ocViewModel.currentPKState == FFPKStateNone) {
[self fus_showLiveLoadingViewWithType:liveLoadingPause];
[_backgroundImageView fus_setWebImageWithSubURLString:[FUSLiveHelper shareInstance].roomInfoModel.face placeholder:UIImage.fus_defaultIcon];
......@@ -1392,11 +1399,12 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
NSString *liveType = @"0";
[FUSLiveHttpHelper fus_exitRoomWithRoomId:[[[FUSLiveHelper shareInstance] roomInfoModel] roomId] livingType:liveType vdoid:[[[FUSLiveHelper shareInstance] streamModel] vdoid] success:^(NSDictionary *dataDict) {
[[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_removeAllNotification];
} failure:^(NSString *msg, int code, NSDictionary *errorDict) {
}];
[FUSSwiftLiveHelper.shared fus_requestReconnectRoomWithNeedResp:YES];
// [FUSLiveHttpHelper fus_exitRoomWithRoomId:[[[FUSLiveHelper shareInstance] roomInfoModel] roomId] livingType:liveType vdoid:[[[FUSLiveHelper shareInstance] streamModel] vdoid] success:^(NSDictionary *dataDict) {
// [[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_removeAllNotification];
// } failure:^(NSString *msg, int code, NSDictionary *errorDict) {
//
// }];
}
......@@ -1456,8 +1464,8 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
// 添加ID
__block UILabel *IDLabel;
IDLabel = [[UILabel alloc] initWithFrame:CGRectMake(UIView.fus_screenW - 80 - 15, 100 + UIView.fus_SafeTop + 20, 80, 20)];
if ([FUSLiveHelper shareInstance].currentFunctionView.pkContentView) {
IDLabel.y = [FUSLiveHelper shareInstance].currentFunctionView.pkContentView.y + 23;
if (FUSSwiftLiveHelper.shared.pkHelper.ocViewModel.currentPKState != FFPKStateNone) {
IDLabel.y = FUSStreamKitPKConfig.fus_pkViewYPosition + 23;
IDLabel.x = UIView.fus_screenW - 80 - 5;
}
IDLabel.font = [UIFont fus_themeFont:14];
......@@ -2014,7 +2022,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
*/
- (void)fus_reloadBgImageView
{
if (self.liveFunctionView.pkHelper.pkLiveState != FUSPKLiveStateNone) {
if (FUSSwiftLiveHelper.shared.pkHelper.ocViewModel.currentPKState != FFPKStateNone) {
[self.backgroundImageView fus_setImageWithName:@"live_pk_background_image" blur:NO];
} else {
if (![NSString isNull:[FUSLiveHelper shareInstance].roomInfoModel.face]) {
......@@ -2088,10 +2096,10 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
}
//这里的拉流失败只处理当前直播的状态,防止 PK 结束的流回调的影响
if (_liveFunctionView.pkHelper.pkLiveState == FUSPKLiveStateNone && [[FUSLiveHelper shareInstance].roomInfoModel.roomId isEqualToString:uid]) {
if (FUSSwiftLiveHelper.shared.pkHelper.ocViewModel.currentPKState == FFPKStateNone && [[FUSLiveHelper shareInstance].roomInfoModel.roomId isEqualToString:uid]) {
// [self fus_setupLiveStateIsPause:YES];
[self fus_showLiveLoadingViewWithType:liveLoadingBuffering];
} else if (_liveFunctionView.pkHelper.pkLiveState != FUSPKLiveStateNone) {
} else if (FUSSwiftLiveHelper.shared.pkHelper.ocViewModel.currentPKState != FFPKStateNone) {
[[NSNotificationCenter defaultCenter] postNotificationName:kStreamPlayViewDidLoadingPlayNotification object:dict];
}
}
......@@ -2107,10 +2115,13 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
_streamView.playView.hidden = NO;
[self fus_dismissLoadingView];
if (_liveFunctionView.pkHelper.pkLiveState == FUSPKLiveStateNone && [FUSLiveHelper shareInstance].streamModel.isPauseLive) {
[self fus_setupLiveStateIsPause:YES];
}else if (_liveFunctionView.pkHelper.pkLiveState == FUSPKLiveStateNone){
[self fus_setupLiveStateIsPause:NO];
if (FUSSwiftLiveHelper.shared.pkHelper.ocViewModel.currentPKState == FFPKStateNone) {
if ([FUSLiveHelper shareInstance].streamModel.isPauseLive) {
[self fus_setupLiveStateIsPause:YES];
}
else {
[self fus_setupLiveStateIsPause:NO];
}
}
}
......@@ -2127,7 +2138,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
dict = ((NSNotification *)dict).object;
}
if (_liveFunctionView.pkHelper.pkLiveState == FUSPKLiveStateNone) {
if (FUSSwiftLiveHelper.shared.pkHelper.ocViewModel.currentPKState == FFPKStateNone) {
if (![NSDictionary isNull:dict]) {
// 只有当前直播间才响应
......@@ -2257,7 +2268,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
case liveLoadingBuffering:
FUSLogInfo(@"pierce:liveLoadingBuffering");
if (![FUSLiveHelper shareInstance].currentFunctionView.pkContentView) {
if (FUSSwiftLiveHelper.shared.pkHelper.ocViewModel.currentPKState == FFPKStateNone) {
[_liveLoadingView fus_showLiveStreamLoading];
}
break;
......
......@@ -666,12 +666,11 @@
}
+ (void)fus_setPKUser:(NSString *)uid mute:(BOOL)mute{
// TODO: V57 需要完成这个
// if (FUSSwiftLiveHelper.shared.liveType == FUSLiveTypeAnchor) {
// [FUSLiveHelper.shareInstance.liveVC.pushView fus_setPKUser:uid mute:mute];
// } else {
// [FFLiveHelper.shareInstance.liveVC.playView fus_setPKUser:uid mute:mute];
// }
if (FUSSwiftLiveHelper.shared.liveType == FUSLiveTypeAnchor) {
[FUSLiveHelper.shareInstance.liveVC.pushView fus_setPKUser:uid mute:mute];
} else {
[FUSLiveHelper.shareInstance.liveVC.playView fus_setPKUser:uid mute:mute];
}
}
/**
......@@ -1395,17 +1394,18 @@
if (pkInfo.integerValue == 1) { //在pk中
// 审核下不显示PK
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) {
if (![roomInfoModel.roomId isEqualToString:[FUSLiveHelper shareInstance].roomInfoModel.roomId]) {
FUSLogInfo(@"不是当前包房");
return ;
}
[[FUSLiveHelper shareInstance].currentFunctionView fus_setupContentViewWithStatus:status remainTime:remainTime winner:winner content:content userlistArray:userlistArray isShowEntrance:YES];
} failure:^(NSString *msg, int code) {
FUSLogInfo(@"@%",msg);
}];
[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(@"不是当前包房");
// return ;
// }
//
// [[FUSLiveHelper shareInstance].currentFunctionView fus_setupContentViewWithStatus:status remainTime:remainTime winner:winner content:content userlistArray:userlistArray isShowEntrance:YES];
// } failure:^(NSString *msg, int code) {
// FUSLogInfo(@"@%",msg);
// }];
}
[FUSLiveHelper shareInstance].streamModel.url = streamUrl;
......@@ -1427,7 +1427,8 @@
// [[FUSLiveGiftView shareGiftView] fus_requestGiftDataWithType:ReadDatabaseBegin success:nil failure:nil];
[[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");
[weakSelf.liveVC fus_setupLiveStateIsPause:YES];
FUSLogDebug(@"FUSStreamPlayView==== 暂停2");
......
......@@ -687,16 +687,16 @@ NS_ASSUME_NONNULL_BEGIN
*/
+ (void)fus_requestCharacterHyperlinkData;
/**
获取pk房间信息
@param roomId 房间号
@param success 成功回调
@param failure 失败回调
*/
+ (void)fus_getRoomPKInfoWithRoomId:(NSString *)roomId
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;
///**
// 获取pk房间信息
//
// @param roomId 房间号
// @param success 成功回调
// @param failure 失败回调
// */
//+ (void)fus_getRoomPKInfoWithRoomId:(NSString *)roomId
// 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;
/// 引流数据统计
/// @param toRoomId 所在直播间
......
......@@ -2131,51 +2131,51 @@
}
/**
获取pk房间信息
@param roomId 房间号
@param success 成功回调
@param failure 失败回调
*/
+ (void)fus_getRoomPKInfoWithRoomId:(NSString *)roomId
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 {
if ([NSString isNull:roomId]) {
FUSLogInfo(@"PK房间信息参数为空");
return;
}
NSDictionary *params = @{@"roomid":roomId};
[FUSHttpHelper postRequestBinaryWithUrl:FUSShowRoomURLs.fus_URL_LIVE_PK_ROOM_PK_INFO params:params success:^(NSDictionary *dataDict, int code) {
NSDictionary *dict = dataDict[@"data"];
NSString *status = dict[@"status"];
NSString *remaintime = dict[@"remaintime"];
NSArray *userlist = dict[@"userlist"];
NSString *winner = dict[@"winner"];
NSString *content = dict[@"content"];
NSString *isLikePk = dict[@"isLikePk"];
NSString *matchId = [dict[@"matchid"] description];
NSInteger winTotal = [dict[@"winTotal"] integerValue];
[[NSUserDefaults standardUserDefaults] setObject:[isLikePk description] forKey:FUSLiveUDKeys.fus_PK_IS_FOCUS_OPPOSITE_ANCHOR];
[FUSLiveHelper shareInstance].currentFunctionView.pkHelper.matchId = matchId;
[FUSLiveHelper shareInstance].currentFunctionView.pkHelper.winTotal = winTotal;
NSMutableArray *userMutArray = [NSMutableArray arrayWithCapacity:userlist.count];
for (NSDictionary *userDict in userlist) {
FUSPKRoomPKInfoModel *roomPKInfoModel = [FUSPKRoomPKInfoModel fus_modelWithDict:userDict];
[userMutArray addObject:roomPKInfoModel];
}
if (success) {
dispatch_async(dispatch_get_main_queue(), ^{
success(status,remaintime,winner,content,isLikePk,userMutArray,matchId);
});
}
} failure:^(NSDictionary *dataDict, int code) {
if (failure) {
failure(FAILURE_MESSAGE, code);
}
}];
}
///**
// 获取pk房间信息
//
// @param roomId 房间号
// @param success 成功回调
// @param failure 失败回调
// */
//+ (void)fus_getRoomPKInfoWithRoomId:(NSString *)roomId
// 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 {
// if ([NSString isNull:roomId]) {
// FUSLogInfo(@"PK房间信息参数为空");
// return;
// }
// NSDictionary *params = @{@"roomid":roomId};
//
// [FUSHttpHelper postRequestBinaryWithUrl:FUSShowRoomURLs.fus_URL_LIVE_PK_ROOM_PK_INFO params:params success:^(NSDictionary *dataDict, int code) {
// NSDictionary *dict = dataDict[@"data"];
// NSString *status = dict[@"status"];
// NSString *remaintime = dict[@"remaintime"];
// NSArray *userlist = dict[@"userlist"];
// NSString *winner = dict[@"winner"];
// NSString *content = dict[@"content"];
// NSString *isLikePk = dict[@"isLikePk"];
// NSString *matchId = [dict[@"matchid"] description];
// NSInteger winTotal = [dict[@"winTotal"] integerValue];
// [[NSUserDefaults standardUserDefaults] setObject:[isLikePk description] forKey:FUSLiveUDKeys.fus_PK_IS_FOCUS_OPPOSITE_ANCHOR];
// [FUSLiveHelper shareInstance].currentFunctionView.pkHelper.matchId = matchId;
// [FUSLiveHelper shareInstance].currentFunctionView.pkHelper.winTotal = winTotal;
// NSMutableArray *userMutArray = [NSMutableArray arrayWithCapacity:userlist.count];
// for (NSDictionary *userDict in userlist) {
// FUSPKRoomPKInfoModel *roomPKInfoModel = [FUSPKRoomPKInfoModel fus_modelWithDict:userDict];
// [userMutArray addObject:roomPKInfoModel];
// }
// if (success) {
// dispatch_async(dispatch_get_main_queue(), ^{
// success(status,remaintime,winner,content,isLikePk,userMutArray,matchId);
// });
// }
// } failure:^(NSDictionary *dataDict, int code) {
// if (failure) {
// failure(FAILURE_MESSAGE, code);
// }
// }];
//}
/// 直播间同步用户权益信息
......
......@@ -279,8 +279,8 @@
// 添加ID
__block UILabel *IDLabel;
IDLabel = [[UILabel alloc] initWithFrame:CGRectMake(UIView.fus_screenW - 80 - 15, 100 + UIView.fus_SafeTop + 20, 80, 20)];
if ([FUSLiveHelper shareInstance].currentFunctionView.pkContentView) {
IDLabel.y = [FUSLiveHelper shareInstance].currentFunctionView.pkContentView.y + 23;
if (FUSSwiftLiveHelper.shared.pkHelper.ocViewModel.currentPKState != FFPKStateNone) {
IDLabel.y = FUSStreamKitPKConfig.fus_pkViewYPosition + 23;
IDLabel.x = UIView.fus_screenW - 80 - 5;
}
IDLabel.font = [UIFont fus_themeFont:14];
......@@ -526,21 +526,34 @@
}
- (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) {
[self.toolView2 showItemWithTypesWithToolTypes:@[@(FUSLiveBottomToolTypeLiveSetting),@(FUSLiveBottomToolTypeRoomSetting)/*,@(FUSLiveBottomToolTypeRoomScope), @(FUSLiveBottomToolTypeNovaBuild)*/]];
[toolTypesList appendObjects:@[@(FUSLiveBottomToolTypeLiveSetting),@(FUSLiveBottomToolTypeRoomSetting)/*,@(FFLiveBottomToolTypeRoomScope), @(FFLiveBottomToolTypeNovaBuild)*/]];
} else {
if (FUSLiveHelper.shareInstance.roomScopeType == FUSLiveRoomScopeTypePassword) {
[self.toolView2 showItemWithTypesWithToolTypes:@[@(FUSLiveBottomToolTypeLiveSetting),@(FUSLiveBottomToolTypeRoomSetting), /*@(FUSLiveBottomToolTypeRoomScope),@(FUSLiveBottomToolTypePK), @(FUSLiveBottomToolTypeNovaBuild)*/]];
} else {
[self.toolView2 showItemWithTypesWithToolTypes:@[@(FUSLiveBottomToolTypeLiveSetting),@(FUSLiveBottomToolTypeRoomSetting), /*@(FUSLiveBottomToolTypeRoomScope),*/@(FUSLiveBottomToolTypePK)/*, @(FUSLiveBottomToolTypeNovaBuild)*/]];
[toolTypesList appendObjects:@[@(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 - 其他
......
......@@ -424,26 +424,28 @@
- (void)fus_bottomToolViewDidClickPKBtn:(FUSLiveBottomToolView *)bottomToolView livePkBtnState:(FUSLiveChatToolPKBtnState)livePkBtnState{
switch (livePkBtnState) {
case FUSLiveChatToolPKBtnStateStart:
[[FUSLiveHelper shareInstance].currentFunctionView fus_showPKStyleViewWithLivePkBtnState:FUSLivePKBtnStateStartPK];
break;
case FUSLiveChatToolPKBtnStateCancel:
[[FUSLiveHelper shareInstance].currentFunctionView fus_showPKStyleViewWithLivePkBtnState:FUSLivePKBtnStateStartPK];
break;
case FUSLiveChatToolPKBtnStateStop:
[[FUSLiveHelper shareInstance].currentFunctionView fus_showPKStyleViewWithLivePkBtnState:FUSLivePKBtnStateStartPK];
break;
case FUSLiveChatToolPKBtnStateTimeOver:
{
[FUSDialogView fus_showDialog:[NSString fus_localString:@"PK匹配失败,请稍后再试"]];
[[FUSLiveHelper shareInstance].currentFunctionView fus_dismissPKStyleViewAnimated:YES];
[[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_cancelPKWithType:[FUSLiveHelper shareInstance].currentFunctionView.pkHelper.pkType];
}
break;
default:
break;
}
// switch (livePkBtnState) {
// case FUSLiveChatToolPKBtnStateStart:
// [[FUSLiveHelper shareInstance].currentFunctionView fus_showPKStyleViewWithLivePkBtnState:FUSLivePKBtnStateStartPK];
// break;
// case FUSLiveChatToolPKBtnStateCancel:
// [[FUSLiveHelper shareInstance].currentFunctionView fus_showPKStyleViewWithLivePkBtnState:FUSLivePKBtnStateStartPK];
// break;
// case FUSLiveChatToolPKBtnStateStop:
// [[FUSLiveHelper shareInstance].currentFunctionView fus_showPKStyleViewWithLivePkBtnState:FUSLivePKBtnStateStartPK];
// break;
// case FUSLiveChatToolPKBtnStateTimeOver:
// {
// [FUSDialogView fus_showDialog:[NSString fus_localString:@"PK匹配失败,请稍后再试"]];
// [[FUSLiveHelper shareInstance].currentFunctionView fus_dismissPKStyleViewAnimated:YES];
// [[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_cancelPKWithType:[FUSLiveHelper shareInstance].currentFunctionView.pkHelper.pkType];
// }
// break;
// default:
// break;
// }
[[FUSLiveHelper shareInstance].currentFunctionView fus_showPKControlViewWithShowType:FFPKControlViewTypeBase];
}
- (void)fus_bottomToolViewDidBeautySetting:(FUSLiveBottomToolView *)bottomToolView beautyType:(FUSLiveChatToolBeautyType)type{
......
......@@ -1029,8 +1029,8 @@
// 添加ID
__block UILabel *IDLabel = [[UILabel alloc] initWithFrame:CGRectMake(UIView.fus_screenW - 80 - 15, 100 + UIView.fus_SafeTop + 20, 80, 20)];
if ([FUSLiveHelper shareInstance].currentFunctionView.pkContentView) {
IDLabel.y = [FUSLiveHelper shareInstance].currentFunctionView.pkContentView.y + 23;
if (FUSSwiftLiveHelper.shared.pkHelper.ocViewModel.currentPKState != FFPKStateNone) {
IDLabel.y = FUSStreamKitPKConfig.fus_pkViewYPosition + 23;
IDLabel.x = UIView.fus_screenW - 80 - 5;
}
IDLabel.font = [UIFont fus_themeFont:14];
......
......@@ -9,9 +9,7 @@
#import <UIKit/UIKit.h>
#import "FUSRoomInfoModel.h"
#import "FUSLiveChatModel.h"
#import "FUSPKHelper.h"
#import "FUSPKStyleView.h"
#import "FUSPKMainView.h"
#import "FUSPKBottomUserHeaderView.h"
#import "FUSLiveChatTableView.h"
#import "FUSContentView.h"
......@@ -88,10 +86,6 @@ typedef NS_ENUM(NSInteger, FUSFunctionMode) {
@end
@interface FUSLiveFunctionView : UIView
// PK相关处理
@property (nonatomic, strong) FUSPKHelper *pkHelper;
// PK内容View
@property (nonatomic, strong) FUSPKMainView *pkContentView;
/**
聊天信息 TableView
......@@ -330,68 +324,17 @@ typedef NS_ENUM(NSInteger, FUSFunctionMode) {
- (void)fus_showAllFunctionLayersWithAnimate:(BOOL)animate;
#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
- (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
@param 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;
......
......@@ -264,8 +264,6 @@
#pragma - 声网
[[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];
......@@ -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 {
[self changeSelfMicStatus:YES];
}
......
......@@ -37,6 +37,7 @@ NSString * const kStreamPKPlayViewLiveStateNotification = @"kStreamPKPlayViewLiv
@end
@implementation FUSPKHelper
#if 0
- (instancetype)init {
self = [super init];
if (self) {
......@@ -1017,4 +1018,5 @@ NSString * const kStreamPKPlayViewLiveStateNotification = @"kStreamPKPlayViewLiv
FUSLogInfo(@"%@ dealloc",[self class]);
[self removeNotification];
}
#endif
@end
......@@ -6,6 +6,8 @@
// Copyright © 2024年 FusiYa. All rights reserved.
//
// TODO: V57 需要完成这个 废弃
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
......
......@@ -84,7 +84,7 @@ NSInteger const kPKMainResultViewHeight = 150;
self.PKRightResultImageView.hidden = YES;
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.userInteractionEnabled = NO;
......
......@@ -5,6 +5,7 @@
// Created by 方磊 on 2019/4/2.
// Copyright © 2024年 FusiYa. All rights reserved.
//
// TODO: V57 需要完成这个 废弃
#import <UIKit/UIKit.h>
......
......@@ -46,6 +46,7 @@ NSInteger const kPKMainTopViewHeight = 23;
@end
@implementation FUSPKMainTopView
#if 0
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
......@@ -429,4 +430,5 @@ NSInteger const kPKMainTopViewHeight = 23;
}
}
#endif
@end
......@@ -6,6 +6,8 @@
// Copyright © 2024年 FusiYa. All rights reserved.
//
// TODO: V57 需要完成这个 废弃
#import <UIKit/UIKit.h>
#import "FUSPKMainTopView.h"
#import "FUSPKMainResultView.h"
......@@ -14,7 +16,6 @@ NS_ASSUME_NONNULL_BEGIN
extern NSInteger const kPKMainViewAdditionHeight;
@class FUSPKHelper;
@class FUSPKInfoModel;
@class FUSPKRoomPKInfoModel;
@class FUSPKNextStepModel;
......
......@@ -60,6 +60,8 @@ NSInteger const kPKMainViewAdditionHeight = 51;
@implementation FUSPKMainView
#if 0
/**
构造
......@@ -1197,4 +1199,6 @@ NSInteger const kPKMainViewAdditionHeight = 51;
FUSLogInfo(@"===%@ delloc",[self class]);
}
#endif
@end
......@@ -6,6 +6,8 @@
// Copyright © 2024年 FusiYa. All rights reserved.
//
// TODO: V57 需要完成这个 废弃
#import <UIKit/UIKit.h>
#import "FUSPKHttpHelper.h"
#import "FUSPKBtnStateModel.h"
......
......@@ -81,9 +81,9 @@ typedef NS_ENUM(NSUInteger, FUSPKStyleViewShowType) {
};
_homeView.homeViewCancelMatchingStateBlock = ^{
// 改变pk按钮状态
[[FUSLiveHelper shareInstance].currentFunctionView fus_changeLivePKBtnState:(FUSLivePKBtnStateStartPK)];
[weakSelf fus_removeTimer];
[[FUSLiveHelper shareInstance].currentFunctionView fus_stopPKMatchingTimer];
// [[FUSLiveHelper shareInstance].currentFunctionView fus_changeLivePKBtnState:(FUSLivePKBtnStateStartPK)];
// [weakSelf fus_removeTimer];
// [[FUSLiveHelper shareInstance].currentFunctionView fus_stopPKMatchingTimer];
};
[self addSubview:_homeView];
}
......@@ -261,98 +261,98 @@ typedef NS_ENUM(NSUInteger, FUSPKStyleViewShowType) {
*/
- (void)startInviteAnchorPKWithPKId:(NSString *)pkId type:(FUSPKType)type nickName:(NSString *)nickName {
[[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_invitePKWithPKid:pkId type:type status:@"1" renew:@"0" success:^(NSString *renewStatus, NSString *nickName) {
NSLog(@"---===---Success");
[[FUSLiveHelper shareInstance].currentFunctionView fus_dismissPKStyleViewAnimated:YES];
if (renewStatus.integerValue == 0) { // 没有再次邀请
[FUSDialogView fus_showDialog:[NSString fus_localString:@"已发送邀请"]];
// 改变pk按钮状态
[[FUSLiveHelper shareInstance].currentFunctionView fus_changeLivePKBtnState:(FUSLivePKBtnStateCancelPK)];
}else if (renewStatus.integerValue == 1) { // 再次邀请
[FUSAlertView showAlertWithTitle:@"" message:[NSString stringWithFormat:[NSString fus_localString:@"你已邀请了%@进行PK,继续将取消之前的邀请,是否确定发起邀请?"],nickName] cancelButtonTitle:[NSString fus_localString:@"取消"] otherButtonTitles:@[[NSString fus_localString:@"确定"]] clickBlock:^(NSInteger buttonIndex) {
if (buttonIndex == 1) { // 邀请
[[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_invitePKWithPKid:pkId type:type status:@"1" renew:@"1" success:^(NSString * _Nonnull renewStatus, NSString * _Nonnull nickName) {
[FUSDialogView fus_showDialog:[NSString fus_localString:@"已发送邀请"]];
// 改变pk按钮状态
[[FUSLiveHelper shareInstance].currentFunctionView fus_changeLivePKBtnState:(FUSLivePKBtnStateCancelPK)];
} failure:^(NSString * _Nonnull msg, int code) {
// 邀请失败 刷新数据
switch (code) {
case -5100: // 对方不接受任何人PK邀请
case -5102://对方只接受好友PK邀请
case -5111: // 主播在这次的时间当中拒绝和您PK
case -5113: // 对方版本过低,无法接受邀请
{
[self.PKAnchorListView refreshClickedItemWithStatus:@"1"];
}
break;
case -5101://对方正在PK中,请稍后再邀请
{
[self.PKAnchorListView refreshClickedItemWithStatus:@"2"];
}
break;
case -5112://对方结束直播
{
[self.PKAnchorListView removeClickedItem];
}
break;
default:
break;
}
[FUSDialogView fus_showDialog:msg];
}];
}
}];
}
} failure:^(NSString * _Nonnull msg, int code) {
NSLog(@"---===---Failure%@-%d",msg,code);
// 邀请失败 刷新数据
switch (code) {
case -5100: // 对方不接受任何人PK邀请
case -5102://对方只接受好友PK邀请
case -5111: // 主播在这次的时间当中拒绝和您PK
case -5113: // 对方版本过低,无法接受邀请
{
[self.PKAnchorListView refreshClickedItemWithStatus:@"1"];
}
break;
case -5101://对方正在PK中,请稍后再邀请
{
[self.PKAnchorListView refreshClickedItemWithStatus:@"2"];
}
break;
case -5112://对方结束直播
{
[self.PKAnchorListView removeClickedItem];
}
break;
default:
break;
}
[FUSDialogView fus_showDialog:msg];
}];
// [[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_invitePKWithPKid:pkId type:type status:@"1" renew:@"0" success:^(NSString *renewStatus, NSString *nickName) {
// NSLog(@"---===---Success");
// [[FUSLiveHelper shareInstance].currentFunctionView fus_dismissPKStyleViewAnimated:YES];
// if (renewStatus.integerValue == 0) { // 没有再次邀请
// [FUSDialogView fus_showDialog:[NSString fus_localString:@"已发送邀请"]];
// // 改变pk按钮状态
// [[FUSLiveHelper shareInstance].currentFunctionView fus_changeLivePKBtnState:(FUSLivePKBtnStateCancelPK)];
// }else if (renewStatus.integerValue == 1) { // 再次邀请
// [FUSAlertView showAlertWithTitle:@"" message:[NSString stringWithFormat:[NSString fus_localString:@"你已邀请了%@进行PK,继续将取消之前的邀请,是否确定发起邀请?"],nickName] cancelButtonTitle:[NSString fus_localString:@"取消"] otherButtonTitles:@[[NSString fus_localString:@"确定"]] clickBlock:^(NSInteger buttonIndex) {
// if (buttonIndex == 1) { // 邀请
// [[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_invitePKWithPKid:pkId type:type status:@"1" renew:@"1" success:^(NSString * _Nonnull renewStatus, NSString * _Nonnull nickName) {
// [FUSDialogView fus_showDialog:[NSString fus_localString:@"已发送邀请"]];
// // 改变pk按钮状态
// [[FUSLiveHelper shareInstance].currentFunctionView fus_changeLivePKBtnState:(FUSLivePKBtnStateCancelPK)];
// } failure:^(NSString * _Nonnull msg, int code) {
// // 邀请失败 刷新数据
// switch (code) {
// case -5100: // 对方不接受任何人PK邀请
// case -5102://对方只接受好友PK邀请
// case -5111: // 主播在这次的时间当中拒绝和您PK
// case -5113: // 对方版本过低,无法接受邀请
// {
// [self.PKAnchorListView refreshClickedItemWithStatus:@"1"];
// }
// break;
// case -5101://对方正在PK中,请稍后再邀请
// {
// [self.PKAnchorListView refreshClickedItemWithStatus:@"2"];
// }
// break;
// case -5112://对方结束直播
// {
// [self.PKAnchorListView removeClickedItem];
// }
// break;
// default:
// break;
// }
// [FUSDialogView fus_showDialog:msg];
// }];
// }
// }];
// }
// } failure:^(NSString * _Nonnull msg, int code) {
// NSLog(@"---===---Failure%@-%d",msg,code);
// // 邀请失败 刷新数据
// switch (code) {
// case -5100: // 对方不接受任何人PK邀请
// case -5102://对方只接受好友PK邀请
// case -5111: // 主播在这次的时间当中拒绝和您PK
// case -5113: // 对方版本过低,无法接受邀请
// {
// [self.PKAnchorListView refreshClickedItemWithStatus:@"1"];
// }
// break;
// case -5101://对方正在PK中,请稍后再邀请
// {
// [self.PKAnchorListView refreshClickedItemWithStatus:@"2"];
// }
// break;
// case -5112://对方结束直播
// {
// [self.PKAnchorListView removeClickedItem];
// }
// break;
// default:
// break;
// }
// [FUSDialogView fus_showDialog:msg];
// }];
}
/**
开始全寨主播pk
*/
- (void)startPKAllAnchor {
[[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_startPKWithType:FUSPKTypeAllAnchor success:^(NSString * _Nonnull timeout) {
[self fus_dismissWithAnimate:YES];
} failure:^(NSString * _Nonnull msg, int code) {
[FUSDialogView fus_showDialog:msg];
}];
// [[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_startPKWithType:FUSPKTypeAllAnchor success:^(NSString * _Nonnull timeout) {
// [self fus_dismissWithAnimate:YES];
// } failure:^(NSString * _Nonnull msg, int code) {
// [FUSDialogView fus_showDialog:msg];
// }];
}
/**
开始活动pk
*/
- (void)startActivityPK {
[[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_startPKWithType:FUSPKTypeActivity success:^(NSString * _Nonnull timeout) {
[self fus_dismissWithAnimate:YES];
} failure:^(NSString * _Nonnull msg, int code) {
[FUSDialogView fus_showDialog:msg];
}];
// [[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_startPKWithType:FUSPKTypeActivity success:^(NSString * _Nonnull timeout) {
// [self fus_dismissWithAnimate:YES];
// } failure:^(NSString * _Nonnull msg, int code) {
// [FUSDialogView fus_showDialog:msg];
// }];
}
/**
......@@ -665,9 +665,9 @@ typedef NS_ENUM(NSUInteger, FUSPKStyleViewShowType) {
} else {
height = 305;
}
if ([FUSLiveHelper shareInstance].currentFunctionView.pkHelper.pkLiveState == FUSPKLiveStateConnectting) {
PKBtnStateModel.status = @"-1";
}
// if ([FUSLiveHelper shareInstance].currentFunctionView.pkHelper.pkLiveState == FUSPKLiveStateConnectting) {
// PKBtnStateModel.status = @"-1";
// }
self.RandomActivityPKView = [FUSRandomActivityPKView RandomActivityPKView];
self.RandomActivityPKView.frame = CGRectMake(0, self.height, self.width, height);
self.RandomActivityPKView.title = PKBtnStateModel.curPkname;
......
......@@ -6,6 +6,8 @@
// Copyright © 2024年 FusiYa. All rights reserved.
//
// TODO: V57 需要完成这个 废弃,后续删除
#import <UIKit/UIKit.h>
#import "FUSPKStyleModel.h"
#import "FUSPKBtnStateModel.h"
......
......@@ -45,6 +45,7 @@
@end
@implementation FUSRandomActivityPKView
#if 0
// 构造方法
+ (instancetype)RandomActivityPKView {
return [[[FUSShowRoomCenterBunble bundle] loadNibNamed:NSStringFromClass([FUSRandomActivityPKView class]) owner:self options:nil] firstObject];
......@@ -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) {
// 结束PK
// [[FUSLiveHelper shareInstance].currentFunctionView fus_showPKStyleViewWithLivePkBtnState:FUSLivePKBtnStateStopPK];
[[FUSLiveHelper shareInstance].currentFunctionView fus_changeLivePKBtnState:(FUSLivePKBtnStateStartPK)];
// [[FUSLiveHelper shareInstance].currentFunctionView fus_changeLivePKBtnState:(FUSLivePKBtnStateStartPK)];
switch (self.PKBtnStateModel.status.integerValue) {
case -1:
[self fus_stopPKWithPKState:FUSPKLiveStateConnectting];
......@@ -193,29 +194,29 @@
取消pk
*/
- (void)fus_cancelPK {
[[FUSLiveHelper shareInstance].currentFunctionView fus_dismissPKStyleViewAnimated:YES];
// 改变按钮状态
[[FUSLiveHelper shareInstance].currentFunctionView fus_changeLivePKBtnState:FUSLivePKBtnStateStartPK];
// 取消PKfus_cancelPKWithType
if (self.PKBtnStateModel.curType.integerValue == 3) {
[FUSTalkingData fus_trackEvent:FUSLiveEventTrackParams.fus_EVENT_LIVEROOM_PK_CANCEL_PK label:@"" parameters:@{@"type":@"randommatch"}];
[[FUSLiveHelper shareInstance].currentFunctionView fus_stopPKMatchingTimer];
[[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_cancelPKWithType:FUSPKTypeAllAnchor];
} else if (self.PKBtnStateModel.curType.integerValue == 4) {
[FUSTalkingData fus_trackEvent:FUSLiveEventTrackParams.fus_EVENT_LIVEROOM_PK_CANCEL_PK label:@"" parameters:@{@"type":@"activity"}];
[[FUSLiveHelper shareInstance].currentFunctionView fus_stopPKMatchingTimer];
[[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_cancelPKWithType:FUSPKTypeActivity];
} else if (self.PKBtnStateModel.curType.integerValue == 1) {
} else if (self.PKBtnStateModel.curType.integerValue == 2) {
[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) {
// 改变pk按钮状态
[[FUSLiveHelper shareInstance].currentFunctionView fus_changeLivePKBtnState:(FUSLivePKBtnStateStartPK)];
} failure:^(NSString * _Nonnull msg, int code) {
}];
}
// [[FUSLiveHelper shareInstance].currentFunctionView fus_dismissPKStyleViewAnimated:YES];
// // 改变按钮状态
// [[FUSLiveHelper shareInstance].currentFunctionView fus_changeLivePKBtnState:FUSLivePKBtnStateStartPK];
// // 取消PKfus_cancelPKWithType
// if (self.PKBtnStateModel.curType.integerValue == 3) {
// [FUSTalkingData fus_trackEvent:FUSLiveEventTrackParams.fus_EVENT_LIVEROOM_PK_CANCEL_PK label:@"" parameters:@{@"type":@"randommatch"}];
// [[FUSLiveHelper shareInstance].currentFunctionView fus_stopPKMatchingTimer];
// [[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_cancelPKWithType:FUSPKTypeAllAnchor];
// } else if (self.PKBtnStateModel.curType.integerValue == 4) {
// [FUSTalkingData fus_trackEvent:FUSLiveEventTrackParams.fus_EVENT_LIVEROOM_PK_CANCEL_PK label:@"" parameters:@{@"type":@"activity"}];
// [[FUSLiveHelper shareInstance].currentFunctionView fus_stopPKMatchingTimer];
// [[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_cancelPKWithType:FUSPKTypeActivity];
// } else if (self.PKBtnStateModel.curType.integerValue == 1) {
//
// } else if (self.PKBtnStateModel.curType.integerValue == 2) {
// [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) {
// // 改变pk按钮状态
// [[FUSLiveHelper shareInstance].currentFunctionView fus_changeLivePKBtnState:(FUSLivePKBtnStateStartPK)];
// } failure:^(NSString * _Nonnull msg, int code) {
//
// }];
// }
}
// 取消定时器
- (void)fus_cancelTimer {
......@@ -236,7 +237,7 @@
} else if (self.PKBtnStateModel.curType.integerValue == 4) {
[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 - 赋值
......@@ -338,4 +339,5 @@
self.backBtn.hidden = NO;
}
}
#endif
@end
......@@ -13,6 +13,7 @@
#import "FUSPaymentManager.h"
#import "FUSRechargeViewController.h"
#import <FUSShowRoomModule/FUSShowRoomModule-Swift.h>
@interface FUSRoomFirstChargeAlertView ()
......@@ -85,7 +86,7 @@
/// 判断是否可以弹窗
+ (BOOL)fus_canDailyShow {
if ([FUSLiveHelper shareInstance].currentFunctionView.pkHelper.pkLiveState == FUSPKLiveStatePK) {
if (FUSSwiftLiveHelper.shared.pkHelper.ocViewModel.currentPKState != FFPKStateNone) {
return NO;
}
......
......@@ -328,8 +328,8 @@ NS_ASSUME_NONNULL_BEGIN
+ (NSString *)fus_URL_Live_Popularity_Contribute_List;
#pragma mark -- PK
// 房间PK信息
+ (NSString *)fus_URL_LIVE_PK_ROOM_PK_INFO;
//// 房间PK信息
//+ (NSString *)fus_URL_LIVE_PK_ROOM_PK_INFO;
// PK信息
+ (NSString *)fus_URL_LIVE_PK_INFO;
......
......@@ -603,10 +603,10 @@
}
#pragma mark -- PK
// 房间PK信息
+ (NSString *)fus_URL_LIVE_PK_ROOM_PK_INFO {
return [FUSConfig.sharedInstanced.pathConfigs apiUrl:@"/pk/roompkinfo.html"];
}
//// 房间PK信息
//+ (NSString *)fus_URL_LIVE_PK_ROOM_PK_INFO {
// return [FUSConfig.sharedInstanced.pathConfigs apiUrl:@"/pk/roompkinfo.html"];
//}
// PK信息
+ (NSString *)fus_URL_LIVE_PK_INFO {
......
......@@ -601,7 +601,7 @@
NSString *liveType = @"0";
[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) {
}];
......
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