Dependencies for browser
For the library to work, you need to include a webrtc-adapter in your html beforequickblox-multiparty-video-conferencing-client-0.8.6.min.js.
JavaScript
Initialize
In order to start working with Multiparty Video Conferencing API, you need to initialize a client.JavaScript
config object:
To request your server endpoint, contact us by mail: enterprise@quickblox.com.
Create session
Once the library has been initialized, you can start creating a session. Typically, each browser tab will need a single session with the server. Once the session is created, you can interact with a Video Conferencing API.JavaScript
Attach video conferencing plugin
Video conferencing allows you to exploit features of the plugin to manipulate the media sent and/or received by peer connection on your web page. This method will create a plugin handle that you can subscribe to and handle events. You also have to attach the plugin to each remote user.JavaScript
To attach the plugin to a local user plugin, set
userId to null and isRemote to false.JavaScript
Join video room
To jump into a video conference room, join it using thejoin() method.
JavaScript
joinParams object:
To check the current video room you are joined to, use the following property of the
QBVideoConferencingClient.
JavaScript
QBVideoConferencingClient has the following properties:
List online participants
To list online users in a video conference room, use thelistOnlineParticipants() method.
JavaScript
Events
There is a number of events you can subscribe to. You can inspect the propertyevents to check the list of supported events. To assign an event handler, you can use the same API as for NodeJS EventEmitter.
JavaScript
To remove all listeners the following code can be used.
JavaScript
Mute remote audio
You also can mute/unmute a remote user’s audio.JavaScript
Disable local video
You can enable/disable your own video.JavaScript
Disable remote video
You also can enable/disable a remote user’s video.JavaScript
Display bitrate
There is a way to show a video bitrate of a remote user. It will start updating theinnerText of the video element every second with the bitrate in ‘kbps’ for the remote user (if found by userId). Thus, the following string will be shown in the video element: 180 kbits/sec.
JavaScript
innerText of the video element and stop updating the bitrate.
JavaScript
List video input devices
To get a list of all video input devices (cameras), use the following code snippet.JavaScript
List audio input devices
To get a list of all audio input devices (microphones), use the following code snippet.JavaScript
Switch video input device
In order to switch a video camera, you have to obtain a list of currently plugged video cameras withlistVideoInputDevices() method. See this section to learn how to list video input devices. Then, call the switchVideoInput().
JavaScript
Switch audio input device
In order to switch a microphone, you have to obtain a list of currently plugged microphones with thelistAudioInputDevices() method. See this section to learn how to list audio input devices. Then, call the switchAudioInput().
JavaScript
Screen sharing
In order to start sharing your screen call thetoggleScreenSharing() method.
JavaScript
screenSharingEnabled() method.
JavaScript
ICE Restart
Initiate ICE restart for a peer. This is typically needed whenever something in your network changes. For example, you move from Wi-Fi to a mobile or a different Wi-Fi but want to keep the conversation going. In this case, an ICE restart needs to take place, as peers need to exchange new candidates they can be reached on.JavaScript
Leave video room
To leave the video room, use theleave() method.
JavaScript
Detach video conferencing plugin
When the job is done, you should detach the video conferencing plugin. ThedetachVideoConferencingPlugin() method detaches the plugin and destroys the handle tearing down to the related peer connection if it exists.
JavaScript
Destroy session
To destroy a session, use thedestroySession() method.
JavaScript
Camera resolution
Set a camera resolution when joining a video room using thevideo property of the joinParams object.
JavaScript
video property are the following: