麦位优化:云信麦位更新回调;更新麦位信息
This commit is contained in:
@@ -110,16 +110,17 @@
|
||||
* **Note:** 也即意味着其他的方法(回调),仅更新 self.micQueue 数据。
|
||||
*/
|
||||
- (void)microQueueUpdated {
|
||||
bool selfOnMicro = NO;
|
||||
bool selfNeedBroadcast = NO;
|
||||
for (int i = 0; i < self.countOfMircoView; i++) {
|
||||
UIView<MicroViewProtocol> * view = [self findMicroViewByIndex:i];
|
||||
MicroQueueModel * model = [self.micQueue objectForKey:[self indexToPosition:i]];
|
||||
[view configMicroView:model];
|
||||
if (model.userInfo.uid == self.hostDelegate.getUserInfo.uid) {
|
||||
selfOnMicro = YES;
|
||||
if (self.hostDelegate.getUserInfo.uid && model.userInfo.uid == self.hostDelegate.getUserInfo.uid) {
|
||||
// 当前用户在麦上,且该麦位未锁麦
|
||||
selfNeedBroadcast = model.microState.micState == MicroMicStateType_Open;
|
||||
}
|
||||
}
|
||||
[[RtcManager instance] broadcast:selfOnMicro];
|
||||
[[RtcManager instance] broadcast:selfNeedBroadcast];
|
||||
}
|
||||
|
||||
#pragma mark - RoomGuestDelegate
|
||||
@@ -159,16 +160,21 @@
|
||||
{
|
||||
NSDictionary *data = [content.notifyExt toJSONObject];
|
||||
int type = [data[@"type"] intValue];
|
||||
NSArray* microStates;
|
||||
switch (type) {
|
||||
case 2:
|
||||
microStates = @[[MicroStateModel modelWithJSON:data[@"micInfo"]]];
|
||||
break;
|
||||
case 3: ///更新了某一个麦序信息
|
||||
{
|
||||
MicroStateModel *microState = [MicroStateModel modelWithJSON:data[@"micInfo"]];
|
||||
microStates = [MicroStateModel modelsWithArray:data[@"micInfo"]];
|
||||
break;
|
||||
}
|
||||
if (microStates && microStates.count > 0) {
|
||||
for (MicroStateModel *microState in microStates) {
|
||||
MicroQueueModel *micSequence = [self.micQueue objectForKey:[NSString stringWithFormat:@"%d", microState.position]];
|
||||
micSequence.microState = microState;
|
||||
microQueueChanged = YES;
|
||||
}
|
||||
break;
|
||||
microQueueChanged = YES;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
Reference in New Issue
Block a user