👩🚀 Editing Waiting in lobby when calling a PMR (Personal Meeting Room) - ponchotitlan/webex_web_calling_client GitHub Wiki
The project handles the scenario when a call is issued to a Personal Meeting Room and the host has not started the meeting yet. It this situation, it is necessary to provide the app with a mechanism that monitors the host's state change and acts accordingly when the meeting has finally begun.
The lobby waiting is handled by binding an event in the webex connection object. The binding occurs when a call is triggered, exactly after the following method is invoked:
webex.meetings.create(destination)
The async call then invokes a custom binding method:
...
bindMeetingEvents(meeting);
...
The following event listeners were added in order to monitor if the app is waiting in the lobby, or if the host has already started the meeting in the PMR:
function bindMeetingEvents(meeting) {
meeting.on('meeting:stateChange', (delta) => {
///The app is waiting in the lobby. You can show a banner with that notification in this state
if(meeting.meetingState == "ACTIVE") {
///The host has now started the PMR.
///Time to bind external media and proceed with the call. You can hide the Waiting in Lobby banner (if any)
const mediaSettings = {
receiveVideo: true,
receiveAudio: true,
receiveShare: false,
sendVideo: true,
sendAudio: true,
sendShare: false
};
return meeting.getMediaStreams(mediaSettings).then((mediaStreams) => {
. . . .