I am trying to automate a website that has a webcam stream in it. In order to automate it, I need some way to fake a webcam.
I know the option -use-fake-device-for-media-stream
simulates a webcam in Chrome. This is working for me in Chrome. Now I need to get the same working in Firefox.
I got the following information from internet while researching on this.
"In Firefox, a special fake:true
variable in the getUserMedia()
calls will achieve this".
I did not understand how to code this up. Can anyone advice please? I am using java based selenium.
This can be done in Firefox at various levels:
Set following props in either user.js, pref.js or channel-prefs.js
pref("media.navigator.permission.disabled", true);
pref("media.navigator.streams.fake", true);
OR
user_pref("media.navigator.permission.disabled", true);
user_pref("media.navigator.streams.fake", true);
Then reboot your machine or restart firefox service.
After that call your URL which invokes getUserMedia()
Firefox will display Fake Audio/Video.
You can use:
profile.setPreference('media.navigator.streams.fake', true);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With