ios和android都按照文档和DEMO接入了对应的七牛连麦SDK.
推流/播放皆正常,android端主播与android/ios副主播连麦正常,一旦ios是主播,与其他副主播连麦以后,主播端声音采集就出问题了,只能听到副主播的声音,主播完全静音了。
以下是IOS主播端相关代码:
//配置
PLVideoCaptureConfiguration *videoCaptureConfiguration = [PLVideoCaptureConfiguration defaultConfiguration];
videoCaptureConfiguration.videoFrameRate=30;
videoCaptureConfiguration.sessionPreset= AVCaptureSessionPreset1280x720;
PLAudioCaptureConfiguration *audioCaptureConfiguration = [PLAudioCaptureConfiguration defaultConfiguration];
PLVideoStreamingConfiguration *videoStreamingConfiguration = [PLVideoStreamingConfiguration defaultConfiguration];
PLAudioStreamingConfiguration *audioStreamingConfiguration = [PLAudioStreamingConfiguration defaultConfiguration];
self.session = [[PLMediaStreamingSession alloc] initWithVideoCaptureConfiguration:videoCaptureConfiguration audioCaptureConfiguration:audioCaptureConfiguration videoStreamingConfiguration:videoStreamingConfiguration audioStreamingConfiguration:audioStreamingConfiguration stream:nil];
//连麦部分
PLRTCConferenceType conferenceType = PLRTCConferenceTypeAudioAndVideo;
//PLRTCConfiguration *configuration = [PLRTCConfiguration defaultConfiguration];
PLRTCConfiguration *configuration = [[PLRTCConfiguration alloc] initWithVideoSize:PLRTCVideoSizePreset480x640 conferenceType:conferenceType];
[self.session closeCurrentAudio];
[self.session startConferenceWithRoomName:[Config getOwnID] userID:[Config getOwnID]roomToken:token rtcConfiguration:configuration];
NSDictionary *option = @{kPLRTCRejoinTimesKey:@(2), kPLRTCConnetTimeoutKey:@(3000)};
self.session.rtcOption = option;
self.session.rtcMinVideoBitrate= 100 * 1000;
self.session.rtcMaxVideoBitrate= 300 * 1000;
self.session.rtcMixOverlayRectArray = [NSArray arrayWithObjects:[NSValue valueWithCGRect:CGRectMake(244, 448, 108, 192)], [NSValue valueWithCGRect:CGRectMake(244, 256, 108, 192)], nil];
可以使用七牛的demo测试下,是否可以复现问题呢。