Device Emulation (Hardware Emulation)
🔗 Original page — Source of this material
Description
This feature is available starting from version 7.3.2.0
ZennoPoster provides an API for emulating webrtc media devices through C# methods:
> > instance.GetWebRTCDevices() > > instance.ShowWebRTCDevice(WebRtcDeviceItem device) > > instance.HideWebRTCDevice(WebRtcDeviceItem device)
These methods allow you to set up a list of devices that will be available to scripts on the page.
Starting with ZennoPoster version 7.3.2.0, an alternative way to emulate webrtc media devices was introduced for the Chrome browser. It is based on the browser's built-in fake devices, which means the page can interact with the devices fully.
To use fake devices, 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="audioutput_device_name" --zl-default-audioinput-device-name="audioinput_device_name" --zl-default-videoinput-device-name="videoinput_device_name"
You can configure three fake devices: one videooutput device, one audiououtput device, and one audioinput device. You need to enter your own data in the highlighted sections. To use a videooutput device correctly, you must provide a video file in .y4m format.
If you need an audio file to emulate a microphone stream, use the additional argument --use-file-for-fake-audio-capture=”path_to_audio_file”
Audio files in .wav format are supported. By default, the audio file will play in a loop. To play the file only once, add %noloop to the argument, for example: --use-file-for-fake-audio-capture=”path_to_audio_file%noloop”.