feat: add enableLocalEcho flag to setDisplayMediaRequestHandler() callback (#37315)

This commit is contained in:
Theo Gravity 2023-03-01 02:37:19 -08:00 committed by GitHub
parent 5e25d23794
commit 49df19214e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 7 deletions

View file

@ -501,13 +501,16 @@ void ElectronBrowserContext::DisplayMediaDeviceChosen(
devices.audio_device =
blink::MediaStreamDevice(request.audio_type, id, name);
} else if (result_dict.Get("audio", &rfh)) {
devices.audio_device = blink::MediaStreamDevice(
request.audio_type,
content::WebContentsMediaCaptureId(rfh->GetProcess()->GetID(),
rfh->GetRoutingID(),
/* disable_local_echo= */ true)
.ToString(),
"Tab audio");
bool enable_local_echo = false;
result_dict.Get("enableLocalEcho", &enable_local_echo);
bool disable_local_echo = !enable_local_echo;
devices.audio_device =
blink::MediaStreamDevice(request.audio_type,
content::WebContentsMediaCaptureId(
rfh->GetProcess()->GetID(),
rfh->GetRoutingID(), disable_local_echo)
.ToString(),
"Tab audio");
} else if (result_dict.Get("audio", &id)) {
devices.audio_device =
blink::MediaStreamDevice(request.audio_type, id, "System audio");