Dyte's browser media devices emulation toolkit
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
For a WebRTC based solution like Dyte, having integration tests that can test multi-user call with Audio/Video on is necessary. Part of the integration tests is the ability to attest different media behaviours.
These are not straightforward as Media devices are usually not available in virtualised / testing environments, these interfaces (getUserMedia
) are a reflection of actual hardware connected to the device, and therefore it is difficult to test real world scenarios in a software test run.
Even if you have devices available, scenarios such as
- A new microphone device is plugged in, does my application switch the input to the new device
- How does my application handle hardware failure
become difficult to test automatically
Dyte's Device Emulator is a solution for the above problems. It provides ways to add, remove media devices and mimic specific real world behaviour. By using this emulation toolkit, QA engineers, developers, and testers can ensure that WebRTC applications deliver a consistent and high-quality user experience across different hardware setups.
npm i
npm run dev
NOTE: This demo app currently expects dyte authtokens for legacy reasons, while running locally you can just remove the part where the dyte sdk is initalized and run the commands you want to from the console
navigator.mediaDevices.addEmulatedDevice('videoinput');
navigator.mediaDevices.failDevice(deviceId, true);
navigator.mediaDevices.silenceDevice(deviceId, true);
Checkout the docs for complete guides and examples https://docs.dyte.io/community-packages/device-emulator
- Canvas
- MediaDevices interface
- Typescript
See the open issues for a list of proposed features (and known issues).
Few upcoming features are:
- Use any video file as a feed instead of default video feed.
- Audio file support
- Browser-like constraints
- Custom device names
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated. Sincere thanks to all our contributors. Thank you, contributors!
You are requested to follow the contribution guidelines specified in CONTRIBUTING.md and code of conduct at CODE_OF_CONDUCT.md while contributing to the project 😄.
Contributions, issues, and feature requests are welcome! Give a ⭐️ if you like this project!
Distributed under the Apache License, Version 2.0. See LICENSE
for more information.
device-emulator
is created & maintained by dyte, Inc. You can find us on Twitter - @dyte_io or write to us at dev [at] dyte.io
.
The names and logos for Dyte are trademarks of dyte, Inc.
We love open source software! See our other projects and our products.