Hi Chromium people,
Probably a turbo-stupid question, but is there an option, or will there be one, for using separate video files for fake video feed from a camera and fake screen share feed?
A bit of context: I'm working on test automation in Playwright and a subset of that automation includes passing fake video/audio and screen share feeds to one of our products (a Chrome extension).
Currently I'm in a Catch-22 type of situation where in order to pass fake video/audio feeds to Chromium I have to pass the following Chromium launch flags:
"--use-fake-device-for-media-stream"
file locations for the feed itself
--use-file-for-fake-video-capture=
--use-file-for-fake-audio-capture=
and the permissions flag:
"--use-fake-ui-for-media-stream"
The catch is that I have to use that permissions flag because it also enables screen sharing. I'm aware that there are separate flags for allowing camera and/or video, but for screen sharing that would seem like the only option; at least without manually fiddling with OS-level permissions, which I'd like to avoid due to either running tests in CI or on local machines by other automation engineers.
Furthermore, in order to pass a fake video feed, I have to use the --use-fake-device-for-media-stream flag. When I do that, I get the fake video feed as intended (news lady on the left in the attached screenshot), however for the screen share feed I get the default RTC mask/test screen which originates from Chromium (on the right side of the attached screenshot).
In simpler terms the Catch-22:
If I don't use --use-fake-device-for-media-stream, I can't get fake video/audio feeds.
If I don't use --use-fake-ui-for-media-stream, I can't get permissions for sharing the screen "natively" during Chromium launch, and Playwright by design can't interact with system prompts.
If I am not able to pass fake feeds for both video and screen, I don't get deterministic results.
In an ideal world I'd like Chromium to have an option for separate permissions and feeds for each "media type", audio and video from a webcam for example, and screen sharing from a, well, screen.
If I'd missed something I'd really like your input, if not I'd like to move this to a suggestion for a future Chromium feature.
Screenshots attached for your convenience.
Best wishes!