个播滚动优化

This commit is contained in:
fengshuo
2022-08-11 11:33:38 +08:00
parent 1fa07e3f27
commit c37b6b9a64
8 changed files with 46 additions and 28 deletions

View File

@@ -114,7 +114,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
///
@property (nonatomic,strong) NSMutableArray<NSString *> *anchorRoomList;
///
@property (nonatomic,assign) BOOL anchorIndex;
@property (nonatomic,assign) NSInteger anchorIndex;
@end
@@ -468,6 +468,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
if (!self.stageView.superview) {
[self.anchorScrollView insertSubview:self.stageView belowSubview:self.roomHeaderView];
}
[self.stageView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(self.anchorScrollView.middleImageView);
make.top.mas_equalTo(self.roomHeaderView.mas_bottom);
@@ -780,21 +781,22 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
///)
- (void)getNextAnchorRoomSuccess:(RoomInfoModel *)roomInfo {
self.anchorScrollView.contentOffset = CGPointMake(0, KScreenHeight);
[self hideHUD];
if (roomInfo) { //
NSString * roomUid = [NSString stringWithFormat:@"%ld", roomInfo.uid];
if (![self.anchorRoomList containsObject:[NSString stringWithFormat:@"%ld", roomInfo.uid]]) {
[self.anchorRoomList addObject:roomUid];
if (![self.anchorRoomList containsObject:self.roomUid]) {
[self.anchorRoomList addObject:self.roomUid];
}
self.anchorIndex = self.anchorRoomList.count -1;
//1退
self.anchorScrollView.isCanScrollTop = YES;
self.anchorScrollView.contentOffset = CGPointMake(0, KScreenHeight);
self.isRequestSuperAdmin = NO;
[self exitOldRoom];
[self.presenter exitNIMRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId]];
[[XPRoomMiniManager shareManager] resetLocalMessage];
[[RtcManager instance] exitRoom];
[self.presenter reportUserOutRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.uid]];
[self.functionView onRoomChange];
//2
[self.backContainerView removeFromSuperview];
[self.stageView removeFromSuperview];
@@ -815,16 +817,19 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
///
[self.presenter getRoomSuperAdmin:self.roomUid];
} else {
if (self.anchorScrollView.isCanScrollTop) {
self.anchorScrollView.contentOffset = CGPointMake(0, KScreenHeight);
} else {
self.anchorScrollView.contentOffset = CGPointMake(0, 0);
}
[self showErrorToast:@"已经到底啦~自动为您返回当前房间"];
}
self.anchorScrollView.isScrollNext = NO;
}
- (void)getCurrentRoomInfo:(RoomInfoModel *)roomInfo {
- (void)getCurrentRoomInfoSuccess:(RoomInfoModel *)roomInfo {
[self hideHUD];
self.anchorScrollView.contentOffset = CGPointMake(0, KScreenHeight);
if (roomInfo && roomInfo.valid) {
//1退
self.isRequestSuperAdmin = NO;
[self exitOldRoom];