1

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.

ᄂ ᄀ
  • 5,669
  • 6
  • 43
  • 57
vivi
  • 11
  • 3

2 Answers2

1

I found this answer on StackOverflow: How to choose input video device for webrtc? .

It looks like you can select the input device from the browser configurations if you need a quick solution.

It also looks like there is a programmatic way to do this using the WebRTC MediaStreamTrack API. We need to look into exposing this through angular-rtcomm and the rtcomm client.js.

I opened an issue for this in the rtcomm GitHub repositories listed below. If you want to take a stab at it yourself, fork us and modify the open source in your own branch and we can merge it back into the master when your done.

https://github.com/WASdev/lib.angular-rtcomm

https://github.com/WASdev/lib.rtcomm.clientjs

Community
  • 1
  • 1
bpulito
  • 646
  • 4
  • 7
1

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:

var constraints = { video: { facingMode: "environment" } };

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:

var constraints = { video: { facingMode: { exact: "environment" } } };

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 the deviceId constraint.

jib
  • 40,579
  • 17
  • 100
  • 158
  • Thanks for the reply. I think this is an `angular-rtcomm` issue. I also tried to use the piece of code suggested here (https://simpl.info/getusermedia/sources/). I'm able to retrieve the stream of the rear camera but I'm not able to use this stream in the video chat. There is no way to set this stream in video chat. I saw the answer of @bpulito and now I wait for any his update. – vivi Jun 10 '15 at 08:17
  • Makes sense. I hope this info is helpful to them in implementing a fix. – jib Jun 10 '15 at 22:06