1

Is it possible to capture system screen & audio with chromium embedded framework using getUserMedia or getDisplayMedia? I've managed to get a video only stream of the system so far, but i cannot get audio capture to work.

In standard Chrome you can get the system audio by using:

navigator.mediaDevices.getDisplayMedia({ video: true, audio: true })

This results in a popup where you can tick a checkbox to enable audio capture. The stream has an audio track labeled as "System Audio".

In cef this popup-dialog does not exist (but can be skipped using a launch-config flag). When calling getDisplayMedia in the web-application, you get an audio track aswell, but the track is labeled as "Fake audio". It seems that this track is actually the sound of a microphone and not the system audio.

Any idea why this does not work? Is it actually implemented in the Cef core? I wasn't able to find any info on this. Thanks in advance!

NickG
  • 550
  • 4
  • 18

1 Answers1

1

This is supported with the Chrome runtime.

Run your app with the key --enable-chrome-runtime or set chrome_runtime CEF setting to true (1).

273K
  • 29,503
  • 10
  • 41
  • 64
  • It's best to explain your answer rather than just providing a link. – O. Jones May 12 '22 at 18:17
  • When we add this flag, the window just renders a white page. We currently don't know why this is happening, but we'll keep experimenting. Thank you for your answer. – NickG May 13 '22 at 07:31
  • Blank screen? You might using offscreen rendering, not working with chrome runtime. – 273K May 13 '22 at 07:33
  • Thank you for your input, we managed to fix the issue by updating cef. However it seems that using chrome_runtime comes with some limitations. We currently wrap the CEF-Window in a native C++ Application. It seems that some functionalties we currently use are missing in the chrome runtime implementation. – NickG May 13 '22 at 10:54