|
@@ -411,17 +411,9 @@ typedef NS_ENUM(NSInteger, LIVEPAGE) {
|
|
|
self.likeCount = [source integerValueForKey:@"likeNum"]; // 点赞数
|
|
|
NSInteger lookCount = [source integerValueForKey:@"lookNum"];
|
|
|
self.totalCount = lookCount; // 观看人数
|
|
|
- NSString *roomConfig = [source stringValueForKey:@"roomConfig"];
|
|
|
- NSData *jsonData = [roomConfig dataUsingEncoding:NSUTF8StringEncoding];
|
|
|
- NSError *err;
|
|
|
- NSDictionary *configDic = [NSJSONSerialization JSONObjectWithData:jsonData
|
|
|
- options:NSJSONReadingMutableContainers
|
|
|
- error:&err];
|
|
|
- if (configDic) {
|
|
|
- self.enableChat = ![configDic boolValueForKey:@"whether_chat"];
|
|
|
- self.enableSeat = ![configDic boolValueForKey:@"whether_mic"];
|
|
|
- self.enableLike = ![configDic boolValueForKey:@"whether_like"];
|
|
|
- }
|
|
|
+
|
|
|
+ self.enableSeat = ![source boolValueForKey:@"whether_mic"];
|
|
|
+
|
|
|
BOOL isTemp = [[source stringValueForKey:@"roomType"] isEqualToString:@"TEMP"];
|
|
|
self.isTempRoom = isTemp;
|
|
|
if (isTemp == NO) {
|
|
@@ -432,8 +424,6 @@ typedef NS_ENUM(NSInteger, LIVEPAGE) {
|
|
|
self.liveEndTime = [source stringValueForKey:@"liveEndTime"];
|
|
|
self.expiredCloseMinute = 0;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
- (void)createLivePageViewDisplay {
|
|
@@ -1846,6 +1836,7 @@ typedef NS_ENUM(NSInteger, LIVEPAGE) {
|
|
|
[_seatActionView opreationCallback:^(LIVESECONTROL action, LiveSeatMember * _Nonnull member) {
|
|
|
[weakSelf opreationSeatApplyAction:action member:member];
|
|
|
}];
|
|
|
+ _seatActionView.isForbiddenApply = !self.enableSeat;
|
|
|
}
|
|
|
return _seatActionView;
|
|
|
}
|
|
@@ -1854,18 +1845,12 @@ typedef NS_ENUM(NSInteger, LIVEPAGE) {
|
|
|
switch (control) {
|
|
|
case LIVESECONTROL_ALLOW: // 允许连麦
|
|
|
{
|
|
|
- RCChatroomSeatsControl *message = [[RCChatroomSeatsControl alloc] init];
|
|
|
- message.userId = self.createrId;
|
|
|
- message.userName = self.createrName;
|
|
|
- message.seatBan = NO;
|
|
|
- [self sendMessage:message displayMessage:NO callback:^(BOOL success) {
|
|
|
-
|
|
|
- }];
|
|
|
+ [self sendMicStatusRequest:0];
|
|
|
}
|
|
|
break;
|
|
|
case LIVESECONTROL_FORBIDDEN: // 禁止连麦
|
|
|
{
|
|
|
- [self forceSeatAction];
|
|
|
+ [self sendMicStatusRequest:1];
|
|
|
}
|
|
|
break;
|
|
|
case LIVESECONTROL_APPROVE: // 上麦
|
|
@@ -1935,6 +1920,39 @@ typedef NS_ENUM(NSInteger, LIVEPAGE) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// 是否允许连麦 0:是 1否
|
|
|
+- (void)sendMicStatusRequest:(NSInteger)whetherMic {
|
|
|
+ [self showhud];
|
|
|
+ [KSNetworkingManager liveRoomSetMicApplyEnable:KS_GET roomUid:self.roomId whetherMic:whetherMic success:^(NSDictionary * _Nonnull dic) {
|
|
|
+ [self removehub];
|
|
|
+ if ([dic integerValueForKey:@"code"] == 200 && [dic boolValueForKey:@"status"]) {
|
|
|
+ if (whetherMic == 0) {
|
|
|
+ self.seatActionView.isForbiddenApply = NO;
|
|
|
+ [self enableSeatAction];
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ self.seatActionView.isForbiddenApply = YES;
|
|
|
+ [self forceSeatAction];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ [self MBPShow:MESSAGEKEY];
|
|
|
+ }
|
|
|
+ } faliure:^(NSError * _Nonnull error) {
|
|
|
+ [self removehub];
|
|
|
+ }];
|
|
|
+}
|
|
|
+
|
|
|
+- (void)enableSeatAction {
|
|
|
+ RCChatroomSeatsControl *message = [[RCChatroomSeatsControl alloc] init];
|
|
|
+ message.userId = self.createrId;
|
|
|
+ message.userName = self.createrName;
|
|
|
+ message.seatBan = NO;
|
|
|
+ [self sendMessage:message displayMessage:NO callback:^(BOOL success) {
|
|
|
+
|
|
|
+ }];
|
|
|
+}
|
|
|
+
|
|
|
// 禁止连麦
|
|
|
- (void)forceSeatAction {
|
|
|
RCChatroomSeatsControl *message = [[RCChatroomSeatsControl alloc] init];
|