I’m new to this site so forgive me if the question is not well expressed.
I’m implementing a video chat application based on WebRTC
, angular-rtcomm
and WebSphere
Liberty Profile.
I started from the sample HelpDesk application on GitHub (https://github.com/WASdev/sample.rtcomm.helpdesk).It works fine and users can see each other.
My question: is it possible to select the rear camera stream instead of the front camera (when rear camera is available)?
The RtcommVideoController
used in video element initialize the stream with front camera and I did not found where change this behavior, if possible.
Thanks in advance.
For
angular-rtcomm
-specific help, see the other answer. For general WebRTC:facingMode
The specification answer is the
facingMode
constraint, but currently only Firefox for Android supports it:This will make
getUserMedia
prefer the rear camera if there is one, but not fail over it. Use"user"
for the front one.To require the rear camera, use:
For help with the constraint syntax see MDN.
Where
facingMode
is not available, enumerateDevices will let you detect how many cameras are available, and let you choose between them using thedeviceId
constraint.