-
Notifications
You must be signed in to change notification settings - Fork 384
Introduction to Webex Meetings
This document helps in understanding the Webex Meetings instance in the Web SDK. It explains multiple APIs related to meeting creation and fetching and related events.
The meetings instance is part of the Webex Meetings SDK that contains a list of meetings created using the SDK and APIs to perform specific operations or listen to certain events. A detailed explanation and code examples of how to use each of them are mentioned further down this document.
After importing and initializing the Web SDK, the meetings instance will be accessible in the webex object as mentioned below,
const webex = new Webex.init();
const meetings = webex.meetings;This meetings constant will hold the Webex Meetings instance
Once we have the meetings instance, it can be used to register a device as follows,
const webex = new Webex.init();
await webex.meetings.register();| Asynchronous | Yes |
| Parameters | No parameters required |
| Returns | Promise<undefined> |
Once the registration is done, we can use the meetings instance to create a meeting as follows,
const meeting = await webex.meetings.create(destination,type);| Asynchronous | Yes | |||||||||||||||
| Parameters |
|
|||||||||||||||
| Returns | Promise<Meeting> |
The meeting object returned by this create method can be used to perform actions on a meeting like mute/unmute, switch audio, lock meeting and so on.
The SDK can have more than one meeting created at the same time and the list of all the current meetings can be obtained as follows,
const meetingList = webex.meetings.getAllMeetings();| Asynchronous | No |
| Parameters | No parameters required |
| Returns | Map<MeetingId,Meeting> |
An example of what would be set to the meetingList constant is:
{
"3c9628aa-b51d-45c4-9166-1b9f7dafe95e" : { id: "3c9628aa-b51d-45c4-9166-1b9f7dafe95e", ...otherMeetingObjectAttributes },
"c7d69b95-c9c6-40c1-9138-c6005b8be554": { id: "c7d69b95-c9c6-40c1-9138-c6005b8be554", ...otherMeetingObjectAttributesAndMethods },
}If the registered user of the SDK already has a meeting scheduled and is running, this API can be used to fetch such meeting objects
await webex.meetings.syncMeetings();| Asynchronous | Yes |
| Parameters | No parameters required |
| Returns | Promise<undefined> |
Once this call succeeds, we shall be able to get the synced meetings with getAllMeetings method as mentioned below,
await webex.meetings.syncMeetings();
const meetingList = webex.meetings.getAllMeetings();This API will be helpful if you want to fetch a meeting by any other attribute of the meeting object.
For instance, if you need to fetch a meeting by destination whose value is https://cisco.webex.com/meet/kmadavan :
const meeting = webex.meetings.getMeetingByType("destination","https://cisco.webex.com/meet/kmadavan");| Asynchronous | No | ||||||||||||
| Parameters |
|
||||||||||||
| Returns | Object<Meeting> |
PMR a.k.a Personal Meeting Room. This is a meeting with a static URL associated with each user's Webex account. This API will help fetch the current user's PMR information using which one can create and join the same.
const pmr = await webex.meetings.getPersonalMeetingRoom().get();| Asynchronous | Yes |
| Parameters | No parameters required |
| Returns | Object |
This event is fired when a meetings instance is ready. (i.e) The meetings instance will be ready once Webex is ready and the event is fired once all the Meetings instance parameters are set. This can be subscribed to after immediately Webex.init as follows,
webex.meetings.on('meetings:ready',() => {
console.log('Meetings object is ready for device registration');
// Perform device registration operation
});This event listener won't receive any payload. Any API call via the Meetings instance should be made only upon receiving this event.
This event is fired when a meetings instance is registered after firing the webex.meetings.register() method. It can be listened to as follows,
webex.meetings.on('meetings:registered',() => {
console.log('Meetings object is ready to perform other operations');
// Perform operations on meetings object like create, sync etc.,
});This event is fired when a meeting is added to the Meetings instance and can be subscribed to as mentioned below,
webex.meetings.on('meeting:added',({type,meeting}) => {
//Perform operations needed to be done on the specific meeting
});This event receives an object with two attributes in the payload as stated:
| Sl. No | Attribute Name | Value | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | type |
One of the following,
|
||||||||||||
| 2 | meeting | The Meeting object which can perform several operations on a meeting |
This event is fired when a meeting is removed from the Meetings instance and it can be listened to like:
webex.meetings.on('meeting:removed',({meetingId,reason}) => {
//Perform operations to cleanup the UI that is related to a Meeting
});This event receives an object with two of the following attributes as payload:
| Sl. No | Attribute Name | Value | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | meetingId | The Correlation ID of a meeting |
|||||||||||||||||||||||||||
| 2 | reason |
The meeting could have been removed due to one of the following reasons,
|
This event is fired when the meetings instance is disconnected from the Webex cloud server or when the browser network is disconnected and it can be subscribed as follows:
webex.meetings.on('network:disconnected',() => {
//Perform operations to cleanup the UI that is related to a Meeting Leave
});This event is fired when the meetings instance is connected when the network is already disconnected and it can be subscribed as follows:
webex.meetings.on('network:connected',() => {
//Perform operations to reconnect Meeting
});Caution
- Introducing the Webex Web Calling SDK
- Core Concepts
- Quickstart guide
- Authorization
- Basic Features
- Advanced Features
- Introduction
- Quickstart Guide
- Basic Features
- Advanced Features
- Multistream
- Migrating SDK version 1 or 2 to version 3