Search code examples
opentoktokbox

Unable to get camera access for iPhone/iPad


Using the web (JS) version of opentok 2.14.8 with H.264 video codec in a relayed session. I am used the opentok reactJS accelerator sample app as the base.

Currently the allow access to camera/audio popup works well on Android (Chrome), PC/Mac (Chrome/Firefox/Safari). Note that I manually trigger a button to get access to the camera and show the feed.

When trying to access camera on iPhone/iPad I grab this error.

VM537:19721 OT.Publisher.onStreamAvailableError 

OT_CONSTRAINTS_NOT_SATISFIED: It's not possible to satisfy one or more constraints passed into the getUserMedia function (getUserMedia error: OverconstrainedError)(anonymous function)

@ VM537:19721onStreamAvailableError 
@ VM537:15233emit 
@ VM537:5669trigger 
@ VM537:1799(anonymous function) 
@ VM537:56679tryCatch 
@ VM537:498invokeCallback 
@ VM537:513publish 
@ VM537:487publishRejection 
@ VM537:428flush 
@ VM537:217
VM537:19721 Received connectivity event: "Failure" without "Attempt"
VM537:19721 OT.exception :: title: Unable to Publish (1500) msg: 

GetUserMedia(anonymous function) 
@ VM537:19721handleJsException 
@ VM537:6811onStreamAvailableError 
@ VM537:15250emit 
@ VM537:5669trigger 
@ VM537:1799(anonymous function) 
@ VM537:56679tryCatch @ VM537:498invokeCallback 
@ VM537:513publish @ VM537:487publishRejection 
@ VM537:428flush 
@ VM537:217
VM537:19721 OT.Publisher.publish failed to getUserMedia: 
OT_CONSTRAINTS_NOT_SATISFIED: It's not possible to satisfy one or more constraints passed into the getUserMedia function (getUserMedia error: OverconstrainedError)(anonymous function) 
@ VM537:19721(anonymous function) @ VM537:16130promiseReactionJob

How can I force the 'access to camera' popup on iPhone/iPad? Note: I have tested the https://safari.opentokrtc.com/ on the same devices and they work well.


Solution

  • My guess is that you are setting the resolution to a low value like 320x240. There is an issue where iOS cannot give this resolution. https://bugs.webkit.org/show_bug.cgi?id=176349

    If you update your code to use 640x480 instead for iOS you should be OK.