I have a beta tester getting this error when trying to start a video session on our iPad app using the OpenTok iOS WebRTC SDK. The app crashes every time. User is on an iPad 2 with iOS 6.1.3. Does anyone have a clue what could be causing such an error? My best guess is something involving camera access, but I'm at a loss for what it could be.
Can't add a nil AVCaptureInput
What version of the iOS SDK was this? Has it been fixed in the later releases? –
Buy
i think you can prevent the crash by checking the availability of the AVCaptureInput object before you add it to the AVCaptureSession.
to simplify it check the below code:
if ([session canAddInput: backCameraDeviceInput])
{
[session addInput: backCameraDeviceInput];
}
i wish this was helpful :)
Great. worked for me. 1 upvote for you. I didn't understand why deviceInput can't be added. Please enlight me. Thanks –
Bulletin
first is first, thanks for the upvote :) usually the availability of the camera depends on the user permission to use it, as you know the user can decline or revoke the permission. this is from the device perspective, but as for the simulators, there is no camera to start with. wish it was helpful –
Atman
This occurs when the user has not acquired permission to use the camera or the user has turned it off (my cause). Best to check and remind user to give permission to use camera. Settings->privacy->camera
I just tested the iOS WebRTC SDK on my iPad 2 with iOS 6.1.4 and I do not experience any crashes. If you can, I would suggest updating the SDK and your iPad version.
If you continue to experience crashing, posting logs here will be super useful!
© 2022 - 2024 — McMap. All rights reserved.