I am currently using twilio_video.js V 1.6.0 for mobile safari. I am able to render the video using the front camera but unable to make it works on the rear camera using the following codes:
publisherElem = document.getElementById('mobile-publisher')
video = publisherElem.querySelector('video')
Twilio.Video.createLocalVideoTrack(
deviceId: source.deviceID
).then (localTrack) ->
localTrack.attach video
return
here is the screenshot

Hi @vsrboth,
Can you please try specifying the facingMode constraint? It can have one of two values, e.g.
You can use it as follows in your code snippet:
Twilio.Video.createLocalVideoTrack({
facingMode: "rear" // or "user"
});
There was some similar discussion for the LG G5 SE here.
Best,
Mark
Just a friendly heads up - the non-user camera constraint should be
Twilio.Video.createLocalVideoTrack({
facingMode: "environment"
});
instead of
Twilio.Video.createLocalVideoTrack({
facingMode: "rear"
});
Source: https://www.w3.org/TR/mediacapture-streams/#def-constraint-facingMode
I think this question is answered, as far as constraints go. For anyone struggling with switching between front and back cameras, though, please be aware of this issue and the associated WebKit Bug 188606.
Best,
Mark
Most helpful comment
Just a friendly heads up - the non-user camera constraint should be
instead of
Source: https://www.w3.org/TR/mediacapture-streams/#def-constraint-facingMode