|
@@ -254,6 +254,17 @@
|
|
|
[self.rtcRoom subscribeAVStream:nil tinyStreams:remoteUser.remoteAVStreams completion:^(BOOL isSuccess, RongRTCCode desc) {
|
|
|
if (isSuccess) {
|
|
|
[[KSRemoteUserManager shareInstance] addUser:remoteUser.userId];
|
|
|
+ RoomMember *curMember = [ClassroomService sharedService].currentRoom.currentMember;
|
|
|
+ NSString *shieldUserId = curMember.shieldUserId;
|
|
|
+ NSArray *memberIdArray = [shieldUserId componentsSeparatedByString:@","];
|
|
|
+ // 在屏蔽状态下,进入后订阅自动屏蔽对应成员声音
|
|
|
+ if ([memberIdArray containsObject:curMember.userId]) {
|
|
|
+ for (RongRTCAVInputStream *stream in remoteUser.remoteAVStreams) {
|
|
|
+ if (stream.streamType == RTCMediaTypeAudio) {
|
|
|
+ stream.disable = YES;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
NSLog(@"订阅流 %@ success:%@ code:%@",remoteUser.userId,@(isSuccess),@(desc));
|
|
|
}];
|
|
@@ -346,6 +357,31 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+- (void)unPlayRemoteUserAudioStream:(NSArray *)userIdArray {
|
|
|
+ if(!self.rtcRoom) {
|
|
|
+ NSLog(@"尚未加入 rtc room,不能取消订阅音视频流");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ for (RongRTCRemoteUser *remoteUser in self.rtcRoom.remoteUsers) {
|
|
|
+ if ([[KSRemoteUserManager shareInstance] isContentUser:remoteUser.userId]) {
|
|
|
+ if ([userIdArray containsObject:remoteUser.userId]) { // 在屏蔽列表中的不播放
|
|
|
+ for (RongRTCAVInputStream *stream in remoteUser.remoteAVStreams) {
|
|
|
+ if (stream.streamType == RTCMediaTypeAudio) {
|
|
|
+ stream.disable = YES;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else { // 不在列表中的播放
|
|
|
+ for (RongRTCAVInputStream *stream in remoteUser.remoteAVStreams) {
|
|
|
+ if (stream.streamType == RTCMediaTypeAudio) {
|
|
|
+ stream.disable = NO;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
- (void)playAllRemoteUserAudioStream {
|
|
|
if(!self.rtcRoom) {
|
|
|
NSLog(@"尚未加入 rtc room,不能取消订阅音视频流");
|