6

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.

nickd717
  • 181
  • 2
  • 12

4 Answers4

14

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 :)

Ahmad Al-Attal
  • 435
  • 4
  • 13
  • 1
    Great. worked for me. 1 upvote for you. I didn't understand why deviceInput can't be added. Please enlight me. Thanks – Abdul Yasin Jan 09 '15 at 13:35
  • 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 – Ahmad Al-Attal Aug 12 '15 at 17:10
7

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

rednic
  • 71
  • 1
  • 3
0

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!

songz
  • 2,082
  • 1
  • 14
  • 18
0

Don't run on simulator. Just run on iPhone.

Gurjinder Singh
  • 9,221
  • 1
  • 66
  • 58