Unable to add nil AVCaptureInput

I have a beta tester who received this error when trying to start a video session in our iPad application using the OpenTok iOS WebRTC SDK. The application crashes every time. The user is on an iPad 2 with iOS 6.1.3. Does anyone know what might cause such an error? My best guess is something related to camera access, but I don't understand what it might be.

+6
source share
3 answers

I think you can prevent a crash by checking the availability of the AVCaptureInput object before adding it to AVCaptureSession.

to simplify it, check the code below:

if ([session canAddInput: backCameraDeviceInput]) { [session addInput: backCameraDeviceInput]; } 

I would like it to be useful :)

+14
source

This happens when the user has not received permission to use the camera, or the user has disabled it (my reason). It is best to check and remind the user to give permission to use the camera. Settings-> privacy-> cameras

+6
source

I just tested the IOS WebRTC SDK on my iPad 2 with iOS 6.1.4 and I am not experiencing any glitches. If possible, I would suggest updating the SDK and version of your iPad.

If you still experience glitches, logging here will be very helpful!

0
source

Source: https://habr.com/ru/post/944578/


All Articles