Screensharing the browser instead of the whole screen

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.

Screensharing the browser instead of the whole screen

Postby alextusinean » Sun Dec 31, 2023 7:32 pm

Hello and Happy New Year!

I'm using CEF through Unreal Engine to render web content but I'm having issues making javascript's getDisplayMedia screenshare only the browser. I switched "use-fake-ui-for-media-stream" and tried various combinations of getDisplayMedia options, including "preferCurrentTab: true", but no luck.
On my Chrome browser, "preferCurrentTab: true" leaves me with only the current tab as an option. Isn't it the same for CEF behind the scenes? If so, shouldn't "use-fake-ui-for-media-stream" cause that only option to be used?

I tried looking over the source code but I have very little experience with CEF or Chromium so I found it to be pretty overwhelming :D

Windows 11 x64
Unreal Engine 5.2.1 with CEF 90.6.7+g19ba721+chromium-90.0.4430.212
alextusinean
Techie
 
Posts: 17
Joined: Thu Jan 07, 2021 3:23 pm

Re: Screensharing the browser instead of the whole screen

Postby alextusinean » Tue Jan 02, 2024 4:42 pm

In the meantime I noticed how EpicGames don't like updating their CEF very often. I managed to build UE from source and update CEF to 120.1 myself and now preferCurrentTab works.
alextusinean
Techie
 
Posts: 17
Joined: Thu Jan 07, 2021 3:23 pm

Re: Screensharing the browser instead of the whole screen

Postby alextusinean » Tue Jan 02, 2024 8:14 pm

Nevermind, it was working with --use-fake-ui-for-media-stream but I actually need OnRequestMediaAccessPermission. It does get called but requested_permissions is CEF_MEDIA_PERMISSION_NONE and even if I return true and execute the callback I get permission denied.
alextusinean
Techie
 
Posts: 17
Joined: Thu Jan 07, 2021 3:23 pm

Re: Screensharing the browser instead of the whole screen

Postby alextusinean » Tue Jan 02, 2024 9:46 pm

I looked into it and I noticed that cef_media_access_permission_types_t doesn't have GUM_TAB_AUDIO_CAPTURE and GUM_TAB_VIDEO_CAPTURE so in media_access_query.cc, when a GUM_TAB_* request is made, requested_permissions will be CEF_MEDIA_PERMISSION_NONE. void ExecuteCallback(uint32_t allowed_permissions) checks if allowed_permissions == requested_permissions but it's useless since it checks for allowed_permissions == CEF_MEDIA_PERMISSION_NONE before that.

I've made a pull request regarding this.
https://bitbucket.org/chromiumembedded/cef/pull-requests/705
alextusinean
Techie
 
Posts: 17
Joined: Thu Jan 07, 2021 3:23 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 205 guests

cron