Device Simulation (Hardware Emulation)


This functionality is available since version

ZennoPoster has an API for emulating webrtc media devices, these are C# code methods:


instance.ShowWebRTCDevice(WebRtcDeviceItem device)

instance.HideWebRTCDevice(WebRtcDeviceItem device)

These methods allow you to customize the list of devices that will be shown to scripts on the page.

Starting from ZennoPoster, an alternative way of emulating webrtc media devices has appeared for the Chrome browser, it is based on fake devices built into the browser, which means that the page will be able to interact with devices fully.

To use fake devices, you need to add the following Chrome launch arguments:

--use-file-for-fake-video-capture="path_to_video_in_y4m_format" --use-fake-ui-for-media-stream --use-fake-device-for-media-stream --zl-default-audioutput-device-name="name_audioutput_device" --zl-default-audioinput-device-name="name_audioutput_device" --zl-default-videoinput-device-name="name_videoinput_device"

You can configure three fake devices: one videooutput device, one audiouotput device, and one audioinput device. In the places marked in bold, you must indicate your data. For the correct use of the videooutput device, you must use a video file in the .y4m format.

If you need an audio file to emulate the audio stream of a microphone, you must use the additional argument --use-file-for-fake-audio-capture = "path_to_audio_file"

.Wav audio files are supported. By default, the audio file will be played in a loop. To play a file once, add %noloop to the argument, for example --use-file-for-fake-audio-capture = "path_to_audio_file% noloop".