Using --enable-media-stream, choose the default camera?

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Using --enable-media-stream, choose the default camera?

Postby derektran » Wed Mar 18, 2015 1:51 am

The computer I'm on has a few webcams connected to it. Using CEF3 building a Mac OSX app, how do I set the default camera? I'm building a WebRTC Kiosk application and the code given by the Web RTC API works in choosing the correct camera when using a regular browser, but CEF seems to do the same thing running Chrome by inputting in terminal: /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --use-fake-ui-for-media-stream
It uses my computers primary camera, not the one I chose via the TokBox WebRTC API.

Everything else seems to be running OK and I've successfully gotten it to not ask to allow the camera by using --enable-media-stream launch argument.

Thanks!
derektran
Newbie
 
Posts: 5
Joined: Tue Mar 10, 2015 1:24 pm

Re: Using --enable-media-stream, choose the default camera?

Postby magreenblatt » Wed Mar 18, 2015 11:01 am

You can set the camera via JavaScript, but you need the fix from https://bitbucket.org/chromiumembedded/ ... -selection
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Using --enable-media-stream, choose the default camera?

Postby derektran » Wed Mar 18, 2015 11:37 am

Thanks! I downloaded the patch file, but have no idea what to do with it! I did a project wide Find and couldn't find any references to a file resembling browser_host_impl. Closest I've found was Sources/libcef_dll_wrapper/libcef_dll/ctocpp/browser_host_ctocpp.cc and .h

Truth be told not much of a C/C++ dev, so dummy instructions would be great! For this project, I managed to just barely get by enough to get this working with Obj-C and then using Apple's mix & match, instantiated a ViewController in swift and am doing the rest of the project in Swift! (Minus a little bridge I wrote to allow my Swift to communicate with the CEF stuff).

Also, I'm using: cef_binary_3.2272.2068_macosx64
derektran
Newbie
 
Posts: 5
Joined: Tue Mar 10, 2015 1:24 pm

Re: Using --enable-media-stream, choose the default camera?

Postby magreenblatt » Wed Mar 18, 2015 11:58 am

derektran wrote:Also, I'm using: cef_binary_3.2272.2068_macosx64

This binary distribution version should already include the fix. See https://simpl.info/getusermedia/sources/ for an example of selecting the camera via JavaScript.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 47 guests