Support for screen sharing in CEF

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.

Support for screen sharing in CEF

Postby linuxcef9 » Tue Jul 30, 2019 2:09 pm

Hi,

I wanted to know if screensharing using getDisplayMedia is supported in CEF ? I am currently on branch 3729 on windows.
I could see this issue : https://bitbucket.org/chromiumembedded/ ... dling/diff but not sure what's the status of it.
linuxcef9
Expert
 
Posts: 143
Joined: Tue Nov 06, 2018 3:08 pm

Re: Support for screen sharing in CEF

Postby linuxcef9 » Fri Aug 16, 2019 1:38 pm

Bump
linuxcef9
Expert
 
Posts: 143
Joined: Tue Nov 06, 2018 3:08 pm

Re: Support for screen sharing in CEF

Postby magreenblatt » Fri Aug 16, 2019 2:14 pm

Have you tried it?
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: Support for screen sharing in CEF

Postby linuxcef9 » Fri Aug 16, 2019 4:03 pm

Hi marshall,

Yes I tried https://janus.conf.meetecho.com/screensharingtest.html with cef 3729 version on windows but I got WebRtc error {} .

Doesn't work with openspotify build cef_binary_76.1.9+g2cf916e+chromium-76.0.3809.87_windows64_client too

Also tried with https://webrtc.github.io/samples/src/co ... playmedia/ . It works with chrome but doesn't work with cef 3809 branch.

https://github.com/webrtc/samples/blob/ ... ain.js#L64 all those navigator objects are undefined.

(edited to add 3809 branch)
linuxcef9
Expert
 
Posts: 143
Joined: Tue Nov 06, 2018 3:08 pm

Re: Support for screen sharing in CEF

Postby Czarek » Fri Aug 16, 2019 8:51 pm

Are you passing the --enable-media-stream flag?
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: Support for screen sharing in CEF

Postby salvadordf » Sat Aug 17, 2019 2:43 am

You need to use these switches to share your screen :
Code: Select all
cefclient.exe --enable-media-stream --use-fake-ui-for-media-stream


There's no selection UI in CEF and the second switch is used to bypass that selection panel.
Maintainer of the CEF4Delphi, WebView4Delphi, WebUI4Delphi and WebUI4CSharp projects.
User avatar
salvadordf
Expert
 
Posts: 129
Joined: Sun Dec 18, 2016 8:39 am
Location: Spain

Re: Support for screen sharing in CEF

Postby JasonLP » Mon Aug 19, 2019 1:41 pm

I've gotten screen sharing with getDisplayMedia() to work, but only sharing the default screen. I cannot seem to figure out the right params to pass into that method to share a specific screen or window like I can with getUserMedia().
JasonLP
Mentor
 
Posts: 98
Joined: Fri Jul 25, 2014 10:10 am

Re: Support for screen sharing in CEF

Postby linuxcef9 » Mon Aug 19, 2019 5:45 pm

Thanks czarek and salvadordf. Your suggestion worked!

@jasonLP, how did you share specific screen with getUserMedia?

Also, even I'd like to know how we can share any other screen besides default screen via getDisplayMedia.

(Edited due to typo)
linuxcef9
Expert
 
Posts: 143
Joined: Tue Nov 06, 2018 3:08 pm

Re: Support for screen sharing in CEF

Postby linuxcef9 » Tue Aug 20, 2019 2:19 pm

So I did some minor digging.

First of all,CefBrowserHostImpl::RequestMediaAccessPermission( https://github.com/chromiumembedded/cef ... l.cc#L2433 )
is never invoked, when you pass in --enable-media-stream and --use-fake-ui-for-media-stream flag. I verified it using debugger.

So most probably, we somehow end up in chromium code here : https://cs.chromium.org/chromium/src/co ... c42&l=1183
and the default screen is selected here : https://cs.chromium.org/chromium/src/co ... 2149&l=203

Now, getDisplayData spec doesn't allow you to specify the screen/window/monitor you want in constraints. So I don't see how we can get a specific window/screen to be shared when using both --enable-media-stream and --use-fake-ui-for-media-stream flags.

@marshall, is my above understanding correct?
Also, I am curious to know, what's the current limitation in CEF which prevents us from showing a popup window to select screen/window etc similar to chrome ?
linuxcef9
Expert
 
Posts: 143
Joined: Tue Nov 06, 2018 3:08 pm

Re: Support for screen sharing in CEF

Postby callum » Tue Aug 20, 2019 5:01 pm

Those WebRTC demos are very neat - surprised to see they appear to work in Chrome 76 without any extensions installed locally but not across the wider internet - is that expected? Can they be made to work remotely too?
callum
Expert
 
Posts: 323
Joined: Mon Feb 23, 2015 6:19 pm

Next

Return to Support Forum

Who is online

Users browsing this forum: Majestic-12 [Bot] and 40 guests