-
Notifications
You must be signed in to change notification settings - Fork 2
Conference
id(): string
leave(): void
on(eventName: string, eventHandler: any)
muted(): boolean
hasCameraVideo(): boolean
hasScreenShare(): boolean
mute(shouldMute: boolean): Promise<void>
cameraVideo(cameraVideo: boolean): Promise<void>
screenShare(screenShare: boolean): Promise<void>
setAudioInputDevice(deviceId: string): Promise<void>
setVideoInputDevice(deviceId: string): Promise<void>
pauseIncomingVideo(): void;
-
resumeIncomingVideo(): void;
Returns a unique identifier of the conference room on Infobip RTC platform.
none
-
string
- Conference ID.
let infobipRTC = new InfobipRTC('2e29c3a0-730a-4526-93ce-cda44556dab5', {debug: true});
let conference = infobipRTC.joinConference('conference-id', ConferenceOptions.builder().setAudio(true).build());
console.log(`Conference ID: ${conference.id()}`);
Leaves the conference room, which results in the left
event on the side that left the conference, and all other
participants in conference receive the user-left
event.
none
none
let infobipRTC = new InfobipRTC('2e29c3a0-730a-4526-93ce-cda44556dab5', {debug: true});
let conference = infobipRTC.joinConference('conference-id', ConferenceOptions.builder().setAudio(true).build());
conference.leave();
Configures the event handler for conference events.
-
eventName
:string
- Name of call event. Allowed values are:joined
,left
,error
,reconnecting
,reconnected
,user-joined
,user-left
,user-muted
,user-unmuted
,local-video-added
,local-video-removed
,local-video-updated
,user-video-added
anduser-video-removed
. -
eventHandler
:any
- Function that will be called when specified event occurs, with exactly one parameter being passed to the function containing event information. Depending on the event, the passed parameter will contain a set of fields that will describe the event, namely:-
joined
- Fires when user joins the conference room. Other conference participants receiveuser-joined
events in that case. It containsstream
with audio media stream andusers
list (instances ofConferenceUser
class) with already joined users in the conference room.event = {stream: streamObject, users: [{identity: 'alice', muted: false, talking: false}]}
-
left
- Fires when user leaves the conference room. Other conference participants receiveuser-left
events in that case. It contains no fields.event = {}
-
error
- Fires whenever any error occurs. It contains no fields.event = {}
-
reconnecting
- Fires when user leaves the conference room due to issues with the connectivity, and the platform itself will try to reconnect him to the same conference room. It contains no fields.event = {}
-
reconnected
- Fires when user is reconnected to the conference room. Other conference participants receiveuser-joined
events in that case. It containsstream
with audio media stream andusers
list (instances ofConferenceUser
class) with already joined users in the conference room.event = {stream: streamObject, users: [{identity: 'alice', muted: false, talking: false}]}
-
user-joined
- Fires when another user joins the conference room. It containsuser
(instance ofConferenceUser
class) field.event = {user: {identity: 'alice', muted: false, talking: false}}
-
user-left
- Fires when another user leaves the conference room. It containsuser
(instance ofConferenceUser
class) field.event = {user: {identity: 'alice', muted: false, talking: false}}
-
user-muted
- Fires when another user mutes themselves. It containsuser
(instance ofConferenceUser
class) field.event = {user: {identity: 'alice', muted: false, talking: false}}
-
user-unmuted
- Fires when another user unmutes themselves. It containsuser
(instance ofConferenceUser
class) field.event = {user: {identity: 'alice', muted: false, talking: false}}
-
user-talking
- Fires when another user starts talking. It containsuser
(instance ofConferenceUser
class) field.event = {user: {identity: 'alice', muted: false, talking: false}}
-
user-stopped-talking
- Fires when another user stops talking. It containsuser
(instance ofConferenceUser
class) field.event = {user: {identity: 'alice', muted: false, talking: false}}
-
local-camera-video-added
- Fires when user turns on camera video. Other conference participants receiveuser-camera-video-added
event in that case. It containsstream
field with local video media stream.event = {stream: streamObject}
-
local-camera-video-updated
- Fires when user changes video input device. It containsstream
field with local video media stream.event = {stream: streamObject}
-
local-camera-video-removed
- Fires when user turns off camera video. Other conference participants receiveuser-camera-video-removed
event in that case. It contains no fields.event = {}
-
local-screenshare-added
- Fires when user starts sharing screen. Other conference participants receiveuser-screenshare-added
event in that case. It containsstream
field with local video media stream.event = {stream: streamObject}
-
local-screenshare-removed
- Fires when user stops sharing screen. Other conference participants receiveuser-screenshare-removed
event in that case. It contains no fields.event = {}
-
user-camera-video-added
- Fires when another user turns on camera video. It containsuser
(instance ofConferenceUser
class) field and thestream
with remote video media stream.event = {user: {identity: 'alice', muted: false, talking: false}, stream: streamObject}
-
user-camera-video-removed
- Fires when another user turns off camera video. It containsuser
(instance ofConferenceUser
class) field.event = {user: {identity: 'alice', muted: false, talking: false}}
-
user-screenshare-added
- Fires when another user starts sharing screen. It containsuser
(instance ofConferenceUser
class) field and thestream
with remote video media stream.event = {user: {identity: 'alice', muted: false, talking: false}, stream: streamObject}
-
user-screenshare-removed
- Fires when another user stops sharing screen. It containsuser
(instance ofConferenceUser
class) field.event = {user: {identity: 'alice', muted: false, talking: false}}
-
none
Let's assume you have an audio HTML element with the id conferenceAudio
and video HTML elements with the
ids localVideo
and localScreenShare
.
When you receive the joined
event from our SDK, you will have audio stream in this event, which you need to set as a
source on your corresponding HTML element.
Upon turning your local video on (camera or screen share), you will receive the local-camera-video-added
/local-screenshare-added
event from our SDK with local video streams in it, which you need to set as a source on your
corresponding HTML elements.
let infobipRTC = new InfobipRTC('2e29c3a0-730a-4526-93ce-cda44556dab5', {debug: true});
let conference = infobipRTC.joinConference('conference-demo', ConferenceOptions.builder().audio(true).video(false).build());
conference.on('joined', function (event) {
$('#conferenceAudio').srcObject = event.stream;
var users = event.users.map(user => user.identity).join(", ");
console.log(`You have joined the conference with ${event.users.length} more participants: ${users}`);
});
conference.on('left', function (event) {
console.log('You have left the conference.');
});
conference.on('error', function (event) {
console.log('Error!');
});
conference.on('user-joined', function (event) {
console.log(`${event.user.identity} joined the conference.`);
});
conference.on('user-left', function (event) {
console.log(`${event.user.identity} left the conference.`);
});
conference.on('user-muted', function (event) {
console.log(`${event.user.identity} muted.`);
});
conference.on('user-unmuted', function (event) {
console.log(`${event.user.identity} unmuted.`);
});
conference.on('local-camera-video-added', function (event) {
$('#localVideo').srcObject = event.stream;
});
conference.on('local-camera-video-removed', function (event) {
$('#localVideo').srcObject = null;
});
conference.on('local-screenshare-added', function (event) {
$('#localScreenShare').srcObject = event.stream;
});
conference.on('local-screenshare-removed', function (event) {
$('#localScreenShare').srcObject = null;
});
The next four events are fired when another user adds or removes the video or starts or stops sharing screen. You should implement these event handlers in order to set and/or remove video stream as a source on corresponding HTML video elements.
conference.on('user-camera-video-added', function (event) {
$('#remoteVideo-' + event.identity).srcObject = event.stream;
});
conference.on('user-camera-video-removed', function (event) {
$('#remoteVideo-' + event.identity).srcObject = null;
});
conference.on('user-screenshare-added', function (event) {
$('#remoteScreenShare-' + event.identity).srcObject = event.stream;
});
conference.on('user-screenshare-removed', function (event) {
$('#remoteScreenShare-' + event.identity).srcObject = null;
});
Returns information whether the audio is muted.
none
-
boolean
-true
if audio is muted, otherwisefalse
.
let infobipRTC = new InfobipRTC('2e29c3a0-730a-4526-93ce-cda44556dab5', {debug: true});
let conference = infobipRTC.joinConference('conference-demo', ConferenceOptions.builder().audio(true).video(false).build());
conference.on('joined', function (event) {
conference.mute(true);
let muted = conference.muted() ? "muted" : "not muted";
console.log(`Audio is ${muted}`);
});
Returns information whether the user has local camera video.
none
-
boolean
-true
if the user has local camera video, otherwisefalse
.
let infobipRTC = new InfobipRTC('2e29c3a0-730a-4526-93ce-cda44556dab5', {debug: true});
let conference = infobipRTC.joinConference('conference-demo', ConferenceOptions.builder().setAudio(true).build());
conference.on('joined', function (event) {
conference.cameraVideo(true)
.then(() => resolve())
.catch(() => reject());
let hasCameraVideo = conference.hasCameraVideo() ? "on" : "off";
console.log(`Video is turned ${hasCameraVideo}.`);
});
Returns information whether the user is sharing the screen.
none
-
boolean
-true
if screen is being share, otherwisefalse
.
let infobipRTC = new InfobipRTC('2e29c3a0-730a-4526-93ce-cda44556dab5', {debug: true});
let conference = infobipRTC.joinConference('conference-demo', ConferenceOptions.builder().audio(true).video(false).build());
conference.on('joined', function (event) {
conference.screenShare(true)
.then(() => resolve())
.catch(() => reject());
let hasScreenShare = conference.hasScreenShare() ? "shared." : "not shared.";
console.log(`Screen is ${hasScreenShare}.`);
});
Toggles mute option.
-
shouldMute
:boolean
- Whether the audio should be muted after this action.
-
Promise<void>
- Promise that resolves tovoid
.
let infobipRTC = new InfobipRTC('2e29c3a0-730a-4526-93ce-cda44556dab5', {debug: true});
let conference = infobipRTC.joinConference('conference-demo', ConferenceOptions.builder().audio(true).video(false).build());
conference.on('joined', function (event) {
conference.mute(true)
.then(() => resolve())
.catch(() => reject());
});
Controls whether the local camera video should be enabled. For video calls it is enabled by default.
-
cameraVideo
:boolean
- Whether local camera video should be enabled.
-
Promise<void>
- Promise that resolves tovoid
.
let infobipRTC = new InfobipRTC('2e29c3a0-730a-4526-93ce-cda44556dab5', {debug: true});
let conference = infobipRTC.joinConference('conference-demo', ConferenceOptions.builder().setAudio(true).build());
conference.on('joined', function (event) {
conference.cameraVideo(true)
.then(() => resolve())
.catch(() => reject());
});
Toggles sharing the screen during the conference.
-
screenShare
:boolean
- Controls whether the screen sharing should be started or stopped.
-
Promise<void>
- Promise that resolves tovoid
.
let infobipRTC = new InfobipRTC('2e29c3a0-730a-4526-93ce-cda44556dab5', {debug: true});
let conference = infobipRTC.joinConference('conference-demo', ConferenceOptions.builder().audio(true).video(false).build());
conference.on('joined', function (event) {
conference.screenShare(true)
.then(() => resolve())
.catch(() => reject());
});
Sets the audio input device with the given id to be used during the conference call.
-
deviceId
:string
- Audio input device identifier.
-
Promise<void>
- Promise that resolves tovoid
.
let conference = infobipRTC.joinConference('conference-demo', ConferenceOptions.builder().audio(true).video(false).build());
conference.on('joined', _ => {
conference.setAudioInputDevice('audioDeviceId')
.then(() => resolve())
.catch(() => reject());
});
Sets the video input device with the given id to be used during the conference call.
-
deviceId
:string
- Video input device identifier.
-
Promise<void>
- Promise that resolves tovoid
.
let conference = infobipRTC.joinConference('conference-demo', ConferenceOptions.builder().audio(true).video(true).build());
conference.on('joined', _ => {
conference.setVideoInputDevice('videoDeviceId')
.then(() => resolve())
.catch(() => reject());
});
Stop receiving the video media of other participants.
none
none
let conference = infobipRTC.joinConference('conference-demo', ConferenceOptions.builder().audio(true).video(true).build());
conference.on('joined', _ => {
document.addEventListener("visibilitychange", () => {
if (document.visibilityState !== 'visible') {
console.log('Browser lost focus, stop showing remote video media.');
activeConference.pauseIncomingVideo();
}
});
});
Start receiving the video media of other participants.
none
none
let conference = infobipRTC.joinConference('conference-demo', ConferenceOptions.builder().audio(true).video(true).build());
conference.on('joined', _ => {
document.addEventListener("visibilitychange", () => {
if (document.visibilityState === 'visible') {
console.log('Browser got focus back, start showing remote video media again.');
activeConference.resumeIncomingVideo();
}
});
});
- InfobipRTC
- Call
- IncomingCall
- OutgoingCall
- CallOptions
- CallOptionsBuilder
- RecordingOptions
- RecordingOptionsBuilder
- VideoOptions
- VideoOptionsBuilder
- CameraOrientation
- CallPhoneNumberOptions
- CallPhoneNumberOptionsBuilder
- DeclineOptions
- DeclineOptionsBuilder
- CallStatus
- HangupStatus
- User
- IncomingCallEvent
- Conference
- ConferenceOptions
- ConferenceOptionsBuilder
- ConferenceUser
- NetworkQuality
- ApplicationCall
- IncomingApplicationCall
- ApplicationCallApiEvents
- IncomingApplicationCallEvent
- Participant
- State
- Media
- Audio
- Endpoint
- EndpointType
- WebrtcEndpoint
- PhoneEndpoint
- SipEndpoint
- AudioOptions
- AudioOptionsBuilder
- AudioFilter
- AudioFilterFactory
- VideoFilter
- VideoFilterFactory