Eyeson JavaScript SDK (EyesonJS)
The EyesonJS library serves as an interface layer between web browsers and the Eyeson API, providing developers with a streamlined toolkit for implementing video conferencing capabilities. This official SDK enables efficient communication with Eyeson services while abstracting the complexity of direct API interactions.
EyesonJS acts as communication client for an existing meeting room.
Setup
Use npm or yarn to add the package to your JavaScript project.
- npm
- Yarn
npm i --save @eyeson/js
yarn add @eyeson/js
To initialize a video conferencing application with EyesonJS, include the following code:
import eyeson from '@eyeson/js';
eyeson.onEvent(event => {
if (event.type === 'accept') {
// Note: Some iOS devices might require video to have autoplay attribute set.
const video = document.querySelector('video');
video.srcObject = event.remoteStream;
video.play();
}
});
eyeson.start('<access-key>');
Media options
The start function can also take an optional object with media settings.
eyeson.start('<access-key>', {
audio: true,
video: true,
eco: false,
audioPassthrough: false
});
Parameter | Description |
---|---|
audio | Enables or mutes audio transmission from the user's microphone |
video | Enables or mutes video transmission from the user's camera |
eco | When enabled makes the connection audio_only, overrides the video setting. |
audioPassthrough | When enabled, bypasses audio processing for raw audio transmission (also see the blog post on audioPassthrough) |
Example implementation of a Web GUI
You can find an example implementation on GitHub https://github.com/eyeson-team/react-web-gui-example
Contact us
If you have a question that's not answered in the documentation or you're not sure the Eyeson services will fit your particular needs, shoot us a message or open a GitHub issue. We're happy to help.