I wanted to inject a video into the WebRTC getUserMedia() in an Android device running Chrome. But the flag --use-file-for-fake-video-capture is not working (WebRTC is giving a NotFoundError) even though the path seems to be valid.
What I did:
- Enabled the flag "Enable command line on non-rooted devices" in
chrome://flags - Added the below flags to
/data/local/tmp/chrome-command-line
_
--use-fake-device-for-media-stream
--use-fake-ui-for-media-stream
--use-file-for-fake-video-capture=/sdcard/example.y4m
('_' is required for the flags to work)
- I also tried omitting permutations of the above flags. Didn't work.
--use-fake-device-for-media-streamand--use-fake-ui-for-media-streamalone work perfectly. - I tried changing path from
/sdcard/example.y4mto/storage/emulated/0/example.y4m. Didn't work - The file
example.y4mis working fine since I tested the same flags on Chrome running on my Mac. - I verified that the flags are being enabled in
chrome://version
Device Info: Pixel 5, Rooted & bootloader unlocked