Enable microphone and webcam

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.

Enable microphone and webcam

Postby winapiwrapper » Sun Feb 25, 2018 7:24 am

Hello,

I'd like to activate the microphone for speech input on this page: https://www.google.com/intl/en/chrome/demos/speech.html (the Google's Web Speech API Demo).

I tried to pass --enable-media-stream via command line and handling OnBeforeCommandLineProcessing, but the microphone still doesn't work.

Code: Select all
void OnBeforeCommandLineProcessing(const CefString& process_type, CefRefPtr<CefCommandLine> command_line) OVERRIDE {
   command_line->AppendArgument("enable-media-stream");
}


So my question, how to actually enable the microphone and the webcam for CEF?

Thank you in advance.
winapiwrapper
Techie
 
Posts: 35
Joined: Sat Feb 24, 2018 10:27 am

Re: Enable microphone and webcam

Postby magreenblatt » Sun Feb 25, 2018 10:43 am

Web Speech API is only available in Google Chrome. See https://www.chromium.org/developers/how-tos/api-keys
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Enable microphone and webcam

Postby winapiwrapper » Sun Feb 25, 2018 6:20 pm

Thank you for your answer!

I tried with other websites by passing --enable-media-stream directly to CEF and it works fine, but is there a way to do it with OnBeforeCommandLineProcessing? Seems that appended arguments in this method are not passed to CEF.
winapiwrapper
Techie
 
Posts: 35
Joined: Sat Feb 24, 2018 10:27 am

Re: Enable microphone and webcam

Postby magreenblatt » Sun Feb 25, 2018 7:42 pm

Use AppendSwitch instead of AppendArgument.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Enable microphone and webcam

Postby winapiwrapper » Sun Feb 25, 2018 8:07 pm

Thank you very much, it works like a charm!
winapiwrapper
Techie
 
Posts: 35
Joined: Sat Feb 24, 2018 10:27 am

Re: Enable microphone and webcam

Postby vaishnavi » Wed Aug 12, 2020 2:47 pm

Hi I am trying to enable the microphone functionality on unity with CEF and enabled --enable-media-stream as well but it does not work. May i get some help on this. Hoping to hear from you soon. Thanks in advance
vaishnavi
Newbie
 
Posts: 1
Joined: Wed Aug 12, 2020 2:39 pm

Re: Enable microphone and webcam

Postby rjxray » Thu Aug 13, 2020 7:20 am

Setting the chromium option --use-fake-ui-for-media-stream worked for me.

If you are using Microsoft Windows you also have to turn microphone access on and allow desktop apps to access it in windows settings.
Then for each site you want to allow access to, visit it first in chrome and allow it via the popup prompt.

A convenient site for testing is https://www.onlinemictest.com/
rjxray
Expert
 
Posts: 115
Joined: Wed Jun 07, 2017 4:31 am

Re: Enable microphone and webcam

Postby edgardog » Thu Aug 13, 2020 12:26 pm

rjxray wrote:Setting the chromium option --use-fake-ui-for-media-stream worked for me.

If you are using Microsoft Windows you also have to turn microphone access on and allow desktop apps to access it in windows settings.
Then for each site you want to allow access to, visit it first in chrome and allow it via the popup prompt.

A convenient site for testing is https://www.onlinemictest.com/


Thanks for this.. this fix the problem I had with web.skype.com.
edgardog
Expert
 
Posts: 111
Joined: Mon Feb 01, 2016 2:05 pm

Re: Enable microphone and webcam

Postby Scottaka » Tue Aug 18, 2020 10:03 pm

after use --use-fake-ui-for-media-stream option,mircrophone work fine, but cant display any webcam stream on remote site, i test with cefclient.exe. but test with google chrome ,it work fine,remote site can display webcam stream well. May i get some help for this?
Scottaka
Newbie
 
Posts: 3
Joined: Tue Aug 18, 2020 4:47 am

Re: Enable microphone and webcam

Postby ssaraf » Tue Nov 09, 2021 7:47 am

I tried using "enable-media-stream" which works good for me but is there a way to enable microphone & webcam separately instead of enabling both using a single flag?
ssaraf
Techie
 
Posts: 32
Joined: Mon Nov 09, 2020 2:18 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 58 guests