我在QuickBlox视频中遇到一个与localCameraView有关的问题,每当一个用户打电话给我时,我的LocalCameraView都会先捕获一些视图,然后像冻结一样变成黑色。
@property (strong, nonatomic) IBOutlet UIView *localVideoView;
@property (strong, nonatomic) QBRTCCameraCapture *videoCapture;
QBRTCVideoFormat *videoFormat = [[QBRTCVideoFormat alloc] init];
videoFormat.frameRate = 30;
videoFormat.pixelFormat = QBRTCPixelFormat420f;
videoFormat.width = 640;
videoFormat.height = 480;
self.videoCapture = [[QBRTCCameraCapture alloc] initWithVideoFormat:videoFormat position:AVCaptureDevicePositionFront];
self.session.localMediaStream.videoTrack.videoCapture = self.videoCapture;
self.videoCapture.previewLayer.frame = self.localVideoView.bounds;
[self.videoCapture startSession:nil];
[self.localVideoView.layer insertSublayer:self.videoCapture.previewLayer atIndex:0];