Reputation: 167
I am using protractor and selenium with browser stack and trying to automate a webrtc web application, I need to get rid of browser asking for permission and using a fake stream instead of real camera and mic as available in chrome.
I have tried using these options they both do not work.
Option 1:
var capabilities = {
'browserName': 'iPhone',
'device': 'iPhone 6S',
'realMobile': 'true',
'os_version': '11.4',
"media.navigator.permission.disabled": true,
"media.navigator.streams.fake": true
};
Option 2
var capabilities = {
'browserName': 'iPhone',
'device': 'iPhone 6S',
'realMobile': 'true',
'os_version': '11.4',
'safariOptions': {
'args': ["--use-fake-ui-for-media-stream", '--use-fake-device-for-media-stream']
}
};
For building options I use:
var driver = new webdriver.Builder()
usingServer('http://hub-cloud.browserstack.com/wd/hub').
withCapabilities(capabilities).
build();
Upvotes: 1
Views: 2512
Reputation: 4445
I needed a smilar solution for my devleopment project. Turns out, the easiest way to do this is to install OBS Studio which is free - it is also available for Mac. Once installed, it can create a virtual web camera. Then web browsers will see it as a real camera. You can play any video and it will appear as a real camera input stream.
Upvotes: 0
Reputation: 1057
Currently, there is no such BrowserStack specific custom capability to pass fake media stream on Safari. Also, passing fake stream is not yet supported on Safari browsers. You can read about the issues below:
https://github.com/web-platform-tests/results-collection/issues/125
https://github.com/web-platform-tests/wpt/issues/7424
Also, there seem to be no such arguments supported for Safari browser. I reviewed the same in the sample SafariOptions examples here
Upvotes: 2