搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

How to fake a media device/stream similar to chrome's '--use-fake-device-for-media-stream'

more options

Hi,

I am developing a java/selenium based application and need to fake a microphone/cam and pass media i.e. audio and/or video files to the browser.

I have been able to successfully do this in Chrome using the below code snippet:

          DesiredCapabilities capabilities = DesiredCapabilities.chrome(); 
          ChromeOptions options = new ChromeOptions();
          options.addArguments("--allow-file-access-from-files",
                                                 "--use-fake-ui-for-media-stream",
                                                 "--allow-file-access",
                                                 "--use-file-for-fake-audio-capture=D:\\PATH\\TO\\WAV\\xxx.wav",
                                                 "--use-fake-device-for-media-stream");
           capabilities.setCapability(ChromeOptions.CAPABILITY, options);
           ChromeDriver driver = new ChromeDriver(capabilities);


Are there similar options available in Firefox to achieve the same capability? If not, how can this be done? Any help will be helpful.

Thanks, John

Hi, I am developing a java/selenium based application and need to fake a microphone/cam and pass media i.e. audio and/or video files to the browser. I have been able to successfully do this in Chrome using the below code snippet: DesiredCapabilities capabilities = DesiredCapabilities.chrome(); ChromeOptions options = new ChromeOptions(); options.addArguments("--allow-file-access-from-files", "--use-fake-ui-for-media-stream", "--allow-file-access", "--use-file-for-fake-audio-capture=D:\\PATH\\TO\\WAV\\xxx.wav", "--use-fake-device-for-media-stream"); capabilities.setCapability(ChromeOptions.CAPABILITY, options); ChromeDriver driver = new ChromeDriver(capabilities); Are there similar options available in Firefox to achieve the same capability? If not, how can this be done? Any help will be helpful. Thanks, John

由 jonsylvester87 於 修改

所有回覆 (1)

more options