-
Notifications
You must be signed in to change notification settings - Fork 344
Introduction to Webex Meetings
Caution
This documentation may no longer be current. Click here to view the updated content on our Developer Portal.
This article provides a detailed introduction to the Webex Web SDK meetings
object. It covers multiple methods and events related to meeting creation and retrieval.
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 are provided in this article.
After importing and initializing the Web SDK, the Meetings
object is accessible from the webex
object:
const webex = new Webex.init();
const meetings = webex.meetings;
The meetings
constant contains an instance of the Webex Meetings
object.
Once the Meetings
object is instantiated, you can register a device using its register()
method:
const webex = new Webex.init();
await webex.meetings.register();
Asynchronous | Yes |
Parameters | No parameters required |
Returns | Promise<undefined> |
When registration has been completed, use the Meetings
object's create()
method to create a new meeting
object:
const meeting = await webex.meetings.create(destination, type);
The create()
method particulars are detailed below:
Asynchronous | Yes | |||||||||||||||
Parameters |
|
|||||||||||||||
Returns | Promise<Meeting> |
The Meetings
object returns a meeting
object which can be used to perform actions on the meeting such as mute, unmute, switch audio, etc.
You can create more than one meeting at a time. To obtain a list of all current meetings, use the Meetings
object's getAllMeetings()
method:
const meetingList = webex.meetings.getAllMeetings();
Asynchronous | No |
Parameters | No parameters required |
Returns | Map<MeetingId,Meeting> |
Here's an example of a returned list of meetings:
{
"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 your application is running on behalf of a registered Webex user, and that user has meetings running, you can use the Meetings
object's syncMeetings()
method to synchronize and then retrieve a list of those meetings.
await webex.meetings.syncMeetings();
Asynchronous | Yes |
Parameters | No parameters required |
Returns | Promise<undefined> |
After the syncMeetings()
call is successful, use the getAllMeetings
method to retrieve the list of meetings:
await webex.meetings.syncMeetings();
const meetingList = webex.meetings.getAllMeetings();
You can narrow down the list of meetings returned by choosing specific meeting attributes via the getMeetingByType()
method.
For instance, to return a meeting whose destination
property is https://cisco.webex.com/meet/alice:
const meeting = webex.meetings.getMeetingByType(
'destination',
'https://cisco.webex.com/meet/alice'
);
The getMeetingByType()
method particulars are detailed below:
Asynchronous | No | ||||||||||||
Parameters |
|
||||||||||||
Returns | Object<Meeting> |
A meetings:ready
event fires when a meetings
object is ready for use. A meetings
object instance is ready once the containing Webex
object is ready, and all the meetings
object's instance parameters are set. You can subscribe to the ready event immediately following Webex.init
:
webex.meetings.on('meetings:ready',() => {
console.log('Meetings object is ready for device registration');
// Register a new device...
});
The ready event returns no payload.
The meetings:registered
event is emitted by a Meetings object after you call the register()
method:
webex.meetings.on('meetings:registered',() => {
console.log('Meetings object is ready to perform other operations');
// Perform meeting operations such as create, sync, etc.
});
The meeting:added
event fires when a new meeting
object is added to the meetings
object:
webex.meetings.on('meeting:added', ({ type, meeting }) => {
// Perform operations on a specific meeting...
});
This event provides an object with two attributes in its payload:
Sl. No | Attribute Name | Value | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | type |
One of the following:
|
||||||||||||
2 | meeting | The Meeting object itself. |
The meeting:removed
event fires when a meeting
object is removed from the meetings
object:
webex.meetings.on('meeting:removed', ({ meetingId, reason }) => {
// Perform operations such as updating the UI to remove the defunct meeting...
});
This event returns an object with two of the following attributes as a payload:
Sl. No | Attribute Name | Value</th> | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | meetingId | The Correlation ID of a meeting | |||||||||||||||||||||
2 | reason |
One of the following removal reasons:
|
The network:disconnected
event fires when a meeting instance is disconnected from the Webex Cloud server or when the browser's local network is disconnected:
webex.meetings.on('network:disconnected', () => {
// Perform operations to cleanup the UI that is related to a Meeting Leave
});
The network:connected
event fires when the meetings instance is reconnected to the network after being disconnected:
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