提交
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
@property (nonatomic,strong)NSString*channel;
|
||||
@property (nonatomic,strong)AgoraRtcConnection *connection;
|
||||
@property (nonatomic,strong)AgoraRtcChannelMediaOptions *option;
|
||||
@property (nonatomic,strong)NSString *pkUserId;
|
||||
@end
|
||||
@implementation QXAgoraEngineEx
|
||||
|
||||
@@ -22,18 +23,25 @@
|
||||
});
|
||||
return instance;
|
||||
}
|
||||
-(void)joinExWithAgora_token:(NSString*)agora_token channel:(NSString*)channel{
|
||||
-(void)joinExWithAgora_token:(NSString*)agora_token channel:(NSString*)channel pkUserId:(NSString*)pkUserId{
|
||||
// AgoraRtcChannelMediaOptions *option = [AgoraRtcChannelMediaOptions new];
|
||||
// option.publishMicrophoneTrack = YES;
|
||||
// option.publishMediaPlayerAudioTrack = YES;
|
||||
// option.enableAudioRecordingOrPlayout = YES;
|
||||
_pkUserId = pkUserId;
|
||||
AgoraRtcConnection *connection = [[AgoraRtcConnection alloc] initWithChannelId:channel localUid:QXGlobal.shareGlobal.loginModel.user_id.longLongValue];
|
||||
_channel = channel;
|
||||
_connection = connection;
|
||||
MJWeakSelf
|
||||
int result = [[QXAgoraEngine sharedEngine].agoraKit joinChannelExByToken:agora_token connection:connection delegate:self mediaOptions:self.option joinSuccess:^(NSString * _Nonnull channel, NSUInteger uid, NSInteger elapsed) {
|
||||
/// 此处为:声网加入扩展流成功回调
|
||||
|
||||
/// 打开自己在扩展流的推流权限
|
||||
[[QXAgoraEngine sharedEngine].agoraKit muteLocalAudioStreamEx:NO connection:connection];
|
||||
[[QXAgoraEngine sharedEngine].agoraKit muteAllRemoteAudioStreamsEx:NO connection:connection];;
|
||||
/// 屏蔽扩展流中所有人的流
|
||||
[[QXAgoraEngine sharedEngine].agoraKit muteAllRemoteAudioStreamsEx:YES connection:connection];;
|
||||
/// 只接收扩展流中对方主持的流 pkUserId
|
||||
[[QXAgoraEngine sharedEngine].agoraKit muteRemoteAudioStreamEx:pkUserId.longLongValue mute:NO connection:connection];;
|
||||
}];
|
||||
QXLOG(@"声网加入扩展流result---->%d",result)
|
||||
}
|
||||
@@ -67,8 +75,8 @@
|
||||
|
||||
}
|
||||
-(void)muteRemoteEXAudioStream:(BOOL)mute{
|
||||
int result = [[QXAgoraEngine sharedEngine].agoraKit muteAllRemoteAudioStreamsEx:mute connection:_connection];;
|
||||
|
||||
// int result = [[QXAgoraEngine sharedEngine].agoraKit muteAllRemoteAudioStreamsEx:mute connection:_connection];;
|
||||
int result = [[QXAgoraEngine sharedEngine].agoraKit muteRemoteAudioStreamEx:_pkUserId.longLongValue mute:mute connection:_connection];;
|
||||
QXLOG(@"声网屏蔽远端声音result---->%d",result)
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user