From 118936ab516bfdf21241d5b0fb14cd1dc11ee0b9 Mon Sep 17 00:00:00 2001 From: Anna Tsukanova Date: Fri, 13 Dec 2024 11:39:34 +0100 Subject: [PATCH 1/3] feat: add logic to sdk test app --- docs/samples/browser-plugin-meetings/app.js | 25 +++++++-- .../browser-plugin-meetings/index.html | 9 ---- .../samples/browser-plugin-meetings/style.css | 6 +-- .../plugin-meetings/src/member/index.ts | 9 ++++ .../plugin-meetings/src/member/types.ts | 8 +++ .../@webex/plugin-meetings/src/member/util.ts | 15 ++++++ .../test/unit/spec/member/util.js | 51 ++++++++++++++++++- 7 files changed, 106 insertions(+), 17 deletions(-) diff --git a/docs/samples/browser-plugin-meetings/app.js b/docs/samples/browser-plugin-meetings/app.js index 4745945daab..1c537348d6e 100644 --- a/docs/samples/browser-plugin-meetings/app.js +++ b/docs/samples/browser-plugin-meetings/app.js @@ -3052,6 +3052,11 @@ function moveFromDevice() { }); } +function isCurrentUser(member) { + const meeting = getCurrentMeeting(); + return meeting.selfId === member.id +} + function claimPersonalMeetingRoom() { console.log('DevicesControls#claimPersonalMeetingRoom()'); @@ -3094,7 +3099,7 @@ participantTable.addEventListener('click', (event) => { } const muteButton = document.getElementById('mute-participant-btn') if (selectedParticipant.isAudioMuted) { - muteButton.innerText = meeting.selfId === selectedParticipant.id ? 'Unmute' : 'Request to unmute'; + muteButton.innerText = isCurrentUser(selectedParticipant) ? 'Unmute' : 'Request to unmute'; } else { muteButton.innerText = 'Mute'; } @@ -3334,7 +3339,9 @@ async function toggleBrb() { const meeting = getCurrentMeeting(); if (meeting) { - const enabled = document.getElementById('brb').checked; + const brbButton = document.getElementById('brb-btn'); + const enabled = brbButton.innerText !== 'Remove away'; + try { const result = await meeting.beRightBack(enabled); console.log(`meeting.beRightBack(${enabled}): success. Result: ${result}`); @@ -3729,18 +3736,21 @@ function createMembersTable(members) { const th3 = document.createElement('th'); const th4 = document.createElement('th'); const th5 = document.createElement('th'); + const th6 = document.createElement('th'); th1.innerText = 'NAME'; th2.innerText = 'VIDEO'; th3.innerText = 'AUDIO'; th4.innerText = 'STATUS'; th5.innerText = 'SUPPORTS BREAKOUTS'; + th6.innerText = 'AWAY'; tr.appendChild(th1); tr.appendChild(th2); tr.appendChild(th3); tr.appendChild(th4); tr.appendChild(th5); + tr.appendChild(th6); return tr; } @@ -3752,6 +3762,7 @@ function createMembersTable(members) { const td3 = document.createElement('td'); const td4 = document.createElement('td'); const td5 = document.createElement('td'); + const td6 = document.createElement('td'); const label1 = createLabel(member.id); const label2 = createLabel(member.id, member.isVideoMuted ? 'NO' : 'YES'); const label3 = createLabel(member.id, member.isAudioMuted ? 'NO' : 'YES'); @@ -3780,11 +3791,19 @@ function createMembersTable(members) { td5.appendChild(label5); + + if (isCurrentUser(member)) { + td6.appendChild(createButton(member.isBrb ? 'Remove away' : 'Apply away', toggleBrb, {id: 'brb-btn'})); + } else { + td6.appendChild(createLabel(member.id, member.isBrb ? 'YES' : 'NO')); + } + tr.appendChild(td1); tr.appendChild(td2); tr.appendChild(td3); tr.appendChild(td4); tr.appendChild(td5); + tr.appendChild(td6); return tr; } @@ -3795,7 +3814,7 @@ function createMembersTable(members) { thead.appendChild(createHeadRow()); - Object.entries(members).forEach(([key, value]) => { + Object.entries(members).forEach(([_, value]) => { if (value.status !== 'NOT_IN_MEETING') { const row = createRow(value); diff --git a/docs/samples/browser-plugin-meetings/index.html b/docs/samples/browser-plugin-meetings/index.html index f6cad1470b0..ed4e4fd341e 100644 --- a/docs/samples/browser-plugin-meetings/index.html +++ b/docs/samples/browser-plugin-meetings/index.html @@ -216,15 +216,6 @@

- -
-
- Step Away - -
-
-
- diff --git a/docs/samples/browser-plugin-meetings/style.css b/docs/samples/browser-plugin-meetings/style.css index adb172f8cb3..8246de3e5ea 100644 --- a/docs/samples/browser-plugin-meetings/style.css +++ b/docs/samples/browser-plugin-meetings/style.css @@ -54,7 +54,7 @@ button.btn-code { } .box { - max-width: 70rem; + max-width: 70rem; margin-inline: auto; margin-bottom: 1rem; } @@ -93,7 +93,7 @@ button.btn-code { display: grid; grid-template-columns: 1fr 1fr 1fr; /* border: 10px solid black */ -} +} .video-section { display: flex; @@ -445,4 +445,4 @@ legend { background-color:lightgrey; border-radius:5px; padding: 0 2px; -} \ No newline at end of file +} diff --git a/packages/@webex/plugin-meetings/src/member/index.ts b/packages/@webex/plugin-meetings/src/member/index.ts index bff33659887..78bf2595cea 100644 --- a/packages/@webex/plugin-meetings/src/member/index.ts +++ b/packages/@webex/plugin-meetings/src/member/index.ts @@ -28,6 +28,7 @@ export default class Member { isRecording: any; isRemovable: any; isSelf: any; + isBrb: boolean; isUser: any; isVideoMuted: any; roles: IExternalRoles; @@ -227,6 +228,13 @@ export default class Member { * @memberof Member */ this.isRemovable = null; + /** + * @instance + * @type {Boolean} + * @public + * @memberof Member + */ + this.isBrb = false; /** * @instance * @type {String} @@ -295,6 +303,7 @@ export default class Member { this.supportsInterpretation = MemberUtil.isInterpretationSupported(participant); this.supportLiveAnnotation = MemberUtil.isLiveAnnotationSupported(participant); this.isGuest = MemberUtil.isGuest(participant); + this.isBrb = MemberUtil.isBrb(participant); this.isUser = MemberUtil.isUser(participant); this.isDevice = MemberUtil.isDevice(participant); this.isModerator = MemberUtil.isModerator(participant); diff --git a/packages/@webex/plugin-meetings/src/member/types.ts b/packages/@webex/plugin-meetings/src/member/types.ts index 8889d625e08..591c2d74881 100644 --- a/packages/@webex/plugin-meetings/src/member/types.ts +++ b/packages/@webex/plugin-meetings/src/member/types.ts @@ -23,6 +23,14 @@ export type ParticipantWithRoles = { }; }; +export type ParticipantWithBrb = { + controls?: { + brb?: { + enabled: boolean; + }; + }; +}; + // values are inherited from locus so don't update these export enum MediaStatus { RECVONLY = 'RECVONLY', // participant only receiving and not sending diff --git a/packages/@webex/plugin-meetings/src/member/util.ts b/packages/@webex/plugin-meetings/src/member/util.ts index b9b3e74ad5e..c1972e857f2 100644 --- a/packages/@webex/plugin-meetings/src/member/util.ts +++ b/packages/@webex/plugin-meetings/src/member/util.ts @@ -4,6 +4,7 @@ import { ServerRoles, ServerRoleShape, IMediaStatus, + ParticipantWithBrb, } from './types'; import { _USER_, @@ -49,6 +50,20 @@ MemberUtil.canReclaimHost = (participant) => { MemberUtil.getControlsRoles = (participant: ParticipantWithRoles): Array => participant?.controls?.role?.roles; +/** + * Checks if the participant has the brb status enabled. + * + * @param {ParticipantWithBrb} participant - the locus participant + * @returns {boolean} - True if the participant has brb enabled, false otherwise. + */ +MemberUtil.isBrb = (participant: ParticipantWithBrb): boolean => { + if (!participant) { + throw new ParameterError('isBrb could not be processed, participant is undefined.'); + } + + return participant.controls?.brb?.enabled || false; +}; + /** * @param {Object} participant the locus participant * @param {ServerRoles} controlRole the search role diff --git a/packages/@webex/plugin-meetings/test/unit/spec/member/util.js b/packages/@webex/plugin-meetings/test/unit/spec/member/util.js index 69d5869262e..1ff23a45ea3 100644 --- a/packages/@webex/plugin-meetings/test/unit/spec/member/util.js +++ b/packages/@webex/plugin-meetings/test/unit/spec/member/util.js @@ -352,6 +352,53 @@ describe('plugin-meetings', () => { }); }); + describe('MemberUtil.isBrb', () => { + it('returns true when brb is enabled', () => { + const participant = { + controls: { + brb: { + enabled: true, + }, + }, + }; + + assert.isTrue(MemberUtil.isBrb(participant)); + }); + + it('returns false when brb is disabled', () => { + const participant = { + controls: { + brb: { + enabled: false, + }, + }, + }; + + assert.isFalse(MemberUtil.isBrb(participant)); + }); + + + it('returns false when brb is not present', () => { + const participant = { + controls: {}, + }; + + assert.isFalse(MemberUtil.isBrb(participant)); + }); + + it('returns false when controls is not present', () => { + const participant = {}; + + assert.isFalse(MemberUtil.isBrb(participant)); + }); + + it('throws error when participant is undefined', () => { + assert.throws(() => { + MemberUtil.isBrb(undefined); + }, 'isBrb could not be processed, participant is undefined.'); + }); + }); + describe('MemberUtil.isBreakoutsSupported', () => { it('throws error when there is no participant', () => { assert.throws(() => { @@ -529,7 +576,7 @@ describe('extractMediaStatus', () => { const participant = { status: {} }; - + const mediaStatus = MemberUtil.extractMediaStatus(participant) assert.deepEqual(mediaStatus, {audio: undefined, video: undefined}); @@ -542,7 +589,7 @@ describe('extractMediaStatus', () => { videoStatus: 'SENDRECV' } }; - + const mediaStatus = MemberUtil.extractMediaStatus(participant) assert.deepEqual(mediaStatus, {audio: 'RECVONLY', video: 'SENDRECV'}); From 53df0d073ab8bcc835c12c8c1cee79993a643e6d Mon Sep 17 00:00:00 2001 From: Anna Tsukanova Date: Fri, 13 Dec 2024 15:02:17 +0100 Subject: [PATCH 2/3] fix: add fixes for PR --- docs/samples/browser-plugin-meetings/app.js | 18 +++---- .../@webex/plugin-meetings/src/member/util.ts | 52 +++++++++---------- .../test/unit/spec/member/util.js | 20 +++---- 3 files changed, 45 insertions(+), 45 deletions(-) diff --git a/docs/samples/browser-plugin-meetings/app.js b/docs/samples/browser-plugin-meetings/app.js index 1c537348d6e..978ce8cc4a9 100644 --- a/docs/samples/browser-plugin-meetings/app.js +++ b/docs/samples/browser-plugin-meetings/app.js @@ -3052,7 +3052,7 @@ function moveFromDevice() { }); } -function isCurrentUser(member) { +function isUserSelf(member) { const meeting = getCurrentMeeting(); return meeting.selfId === member.id } @@ -3099,7 +3099,7 @@ participantTable.addEventListener('click', (event) => { } const muteButton = document.getElementById('mute-participant-btn') if (selectedParticipant.isAudioMuted) { - muteButton.innerText = isCurrentUser(selectedParticipant) ? 'Unmute' : 'Request to unmute'; + muteButton.innerText = isUserSelf(selectedParticipant) ? 'Unmute' : 'Request to unmute'; } else { muteButton.innerText = 'Mute'; } @@ -3340,16 +3340,16 @@ async function toggleBrb() { if (meeting) { const brbButton = document.getElementById('brb-btn'); - const enabled = brbButton.innerText !== 'Remove away'; + const isBrbEnabled = brbButton.innerText === 'Apply away'; try { - const result = await meeting.beRightBack(enabled); - console.log(`meeting.beRightBack(${enabled}): success. Result: ${result}`); + const result = await meeting.beRightBack(isBrbEnabled); + console.log(`meeting.beRightBack(${isBrbEnabled}): success. Result: ${result}`); } catch (error) { - console.error(`meeting.beRightBack({${enabled}): error: `, error); + console.error(`meeting.beRightBack({${isBrbEnabled}): error: `, error); } finally { - localMedia?.microphoneStream?.setUserMuted(enabled); - localMedia?.cameraStream?.setUserMuted(enabled); + localMedia?.microphoneStream?.setUserMuted(isBrbEnabled); + localMedia?.cameraStream?.setUserMuted(isBrbEnabled); } } } @@ -3792,7 +3792,7 @@ function createMembersTable(members) { td5.appendChild(label5); - if (isCurrentUser(member)) { + if (isUserSelf(member) && member.isInMeeting) { td6.appendChild(createButton(member.isBrb ? 'Remove away' : 'Apply away', toggleBrb, {id: 'brb-btn'})); } else { td6.appendChild(createLabel(member.id, member.isBrb ? 'YES' : 'NO')); diff --git a/packages/@webex/plugin-meetings/src/member/util.ts b/packages/@webex/plugin-meetings/src/member/util.ts index c1972e857f2..4cdf9ea330e 100644 --- a/packages/@webex/plugin-meetings/src/member/util.ts +++ b/packages/@webex/plugin-meetings/src/member/util.ts @@ -30,7 +30,7 @@ import ParameterError from '../common/errors/parameter'; const MemberUtil: any = {}; /** - * @param {Object} participant the locus participant + * @param {Object} participant - The locus participant object. * @returns {Boolean} */ MemberUtil.canReclaimHost = (participant) => { @@ -44,7 +44,7 @@ MemberUtil.canReclaimHost = (participant) => { }; /** - * @param {Object} participant the locus participant + * @param {Object} participant - The locus participant object. * @returns {[ServerRoleShape]} */ MemberUtil.getControlsRoles = (participant: ParticipantWithRoles): Array => @@ -53,10 +53,10 @@ MemberUtil.getControlsRoles = (participant: ParticipantWithRoles): Array { +MemberUtil.isBrb = (participant?: ParticipantWithBrb): boolean => { if (!participant) { throw new ParameterError('isBrb could not be processed, participant is undefined.'); } @@ -65,7 +65,7 @@ MemberUtil.isBrb = (participant: ParticipantWithBrb): boolean => { }; /** - * @param {Object} participant the locus participant + * @param {Object} participant - The locus participant object. * @param {ServerRoles} controlRole the search role * @returns {Boolean} */ @@ -75,28 +75,28 @@ MemberUtil.hasRole = (participant: any, controlRole: ServerRoles): boolean => ); /** - * @param {Object} participant the locus participant + * @param {Object} participant - The locus participant object. * @returns {Boolean} */ MemberUtil.hasCohost = (participant: ParticipantWithRoles): boolean => MemberUtil.hasRole(participant, ServerRoles.Cohost) || false; /** - * @param {Object} participant the locus participant + * @param {Object} participant - The locus participant object. * @returns {Boolean} */ MemberUtil.hasModerator = (participant: ParticipantWithRoles): boolean => MemberUtil.hasRole(participant, ServerRoles.Moderator) || false; /** - * @param {Object} participant the locus participant + * @param {Object} participant - The locus participant object. * @returns {Boolean} */ MemberUtil.hasPresenter = (participant: ParticipantWithRoles): boolean => MemberUtil.hasRole(participant, ServerRoles.Presenter) || false; /** - * @param {Object} participant the locus participant + * @param {Object} participant - The locus participant object. * @returns {IExternalRoles} */ MemberUtil.extractControlRoles = (participant: ParticipantWithRoles): IExternalRoles => { @@ -110,7 +110,7 @@ MemberUtil.extractControlRoles = (participant: ParticipantWithRoles): IExternalR }; /** - * @param {Object} participant the locus participant + * @param {Object} participant - The locus participant object. * @returns {Boolean} */ MemberUtil.isUser = (participant: any) => participant && participant.type === _USER_; @@ -118,13 +118,13 @@ MemberUtil.isUser = (participant: any) => participant && participant.type === _U MemberUtil.isModerator = (participant) => participant && participant.moderator; /** - * @param {Object} participant the locus participant + * @param {Object} participant - The locus participant object. * @returns {Boolean} */ MemberUtil.isGuest = (participant: any) => participant && participant.guest; /** - * @param {Object} participant the locus participant + * @param {Object} participant - The locus participant object. * @returns {Boolean} */ MemberUtil.isDevice = (participant: any) => participant && participant.type === _RESOURCE_ROOM_; @@ -135,7 +135,7 @@ MemberUtil.isModeratorAssignmentProhibited = (participant) => /** * checks to see if the participant id is the same as the passed id * there are multiple ids that can be used - * @param {Object} participant the locus participant + * @param {Object} participant - The locus participant object. * @param {String} id * @returns {Boolean} */ @@ -145,7 +145,7 @@ MemberUtil.isSame = (participant: any, id: string) => /** * checks to see if the participant id is the same as the passed id for associated devices * there are multiple ids that can be used - * @param {Object} participant the locus participant + * @param {Object} participant - The locus participant object. * @param {String} id * @returns {Boolean} */ @@ -157,7 +157,7 @@ MemberUtil.isAssociatedSame = (participant: any, id: string) => ); /** - * @param {Object} participant the locus participant + * @param {Object} participant - The locus participant object. * @param {Boolean} isGuest * @param {String} status * @returns {Boolean} @@ -176,7 +176,7 @@ MemberUtil.isNotAdmitted = (participant: any, isGuest: boolean, status: string): !status === _IN_MEETING_); /** - * @param {Object} participant the locus participant + * @param {Object} participant - The locus participant object. * @returns {Boolean} */ MemberUtil.isAudioMuted = (participant: any) => { @@ -188,7 +188,7 @@ MemberUtil.isAudioMuted = (participant: any) => { }; /** - * @param {Object} participant the locus participant + * @param {Object} participant - The locus participant object. * @returns {Boolean} */ MemberUtil.isVideoMuted = (participant: any): boolean => { @@ -200,7 +200,7 @@ MemberUtil.isVideoMuted = (participant: any): boolean => { }; /** - * @param {Object} participant the locus participant + * @param {Object} participant - The locus participant object. * @returns {Boolean} */ MemberUtil.isHandRaised = (participant: any) => { @@ -212,7 +212,7 @@ MemberUtil.isHandRaised = (participant: any) => { }; /** - * @param {Object} participant the locus participant + * @param {Object} participant - The locus participant object. * @returns {Boolean} */ MemberUtil.isBreakoutsSupported = (participant) => { @@ -224,7 +224,7 @@ MemberUtil.isBreakoutsSupported = (participant) => { }; /** - * @param {Object} participant the locus participant + * @param {Object} participant - The locus participant object. * @returns {Boolean} */ MemberUtil.isInterpretationSupported = (participant) => { @@ -238,7 +238,7 @@ MemberUtil.isInterpretationSupported = (participant) => { }; /** - * @param {Object} participant the locus participant + * @param {Object} participant - The locus participant object. * @returns {Boolean} */ MemberUtil.isLiveAnnotationSupported = (participant) => { @@ -294,7 +294,7 @@ MemberUtil.getRecordingMember = (controls: any) => { }; /** - * @param {Object} participant the locus participant + * @param {Object} participant - The locus participant object. * @returns {Boolean} */ MemberUtil.isRecording = (participant: any) => { @@ -340,7 +340,7 @@ MemberUtil.isMutable = (isSelf, isDevice, isInMeeting, isMuted, type) => { }; /** - * @param {Object} participant the locus participant + * @param {Object} participant - The locus participant object. * @returns {String} */ MemberUtil.extractStatus = (participant: any) => { @@ -370,7 +370,7 @@ MemberUtil.extractStatus = (participant: any) => { }; /** - * @param {Object} participant the locus participant + * @param {Object} participant - The locus participant object. * @returns {String} */ MemberUtil.extractId = (participant: any) => { @@ -383,7 +383,7 @@ MemberUtil.extractId = (participant: any) => { /** * extracts the media status from nested participant object - * @param {Object} participant the locus participant + * @param {Object} participant - The locus participant object. * @returns {Object} */ MemberUtil.extractMediaStatus = (participant: any): IMediaStatus => { @@ -398,7 +398,7 @@ MemberUtil.extractMediaStatus = (participant: any): IMediaStatus => { }; /** - * @param {Object} participant the locus participant + * @param {Object} participant - The locus participant object. * @returns {String} */ MemberUtil.extractName = (participant: any) => { diff --git a/packages/@webex/plugin-meetings/test/unit/spec/member/util.js b/packages/@webex/plugin-meetings/test/unit/spec/member/util.js index 1ff23a45ea3..0ded4d34c11 100644 --- a/packages/@webex/plugin-meetings/test/unit/spec/member/util.js +++ b/packages/@webex/plugin-meetings/test/unit/spec/member/util.js @@ -5,13 +5,13 @@ import {_SEND_RECEIVE_, _RECEIVE_ONLY_} from '../../../../src/constants'; describe('plugin-meetings', () => { describe('isHandRaised', () => { - it('throws error when there is no participant', () => { + it('throws an error when there is no participant', () => { assert.throws(() => { MemberUtil.isHandRaised(); }, 'Raise hand could not be processed, participant is undefined.'); }); - it('returns false when controls is not there', () => { + it('returns false when controls are not present', () => { const participant = {}; assert.isFalse(MemberUtil.isHandRaised(participant)); @@ -51,7 +51,7 @@ describe('plugin-meetings', () => { }); describe('MemberUtil.canReclaimHost', () => { - it('throws error when there is no participant', () => { + it('throws an error when there is no participant', () => { assert.throws(() => { MemberUtil.canReclaimHost(); }, 'canReclaimHostRole could not be processed, participant is undefined.'); @@ -386,7 +386,7 @@ describe('plugin-meetings', () => { assert.isFalse(MemberUtil.isBrb(participant)); }); - it('returns false when controls is not present', () => { + it('returns false when controls are not present', () => { const participant = {}; assert.isFalse(MemberUtil.isBrb(participant)); @@ -400,7 +400,7 @@ describe('plugin-meetings', () => { }); describe('MemberUtil.isBreakoutsSupported', () => { - it('throws error when there is no participant', () => { + it('throws an error when there is no participant', () => { assert.throws(() => { MemberUtil.isBreakoutsSupported(); }, 'Breakout support could not be processed, participant is undefined.'); @@ -424,7 +424,7 @@ describe('plugin-meetings', () => { }); describe('MemberUtil.isLiveAnnotationSupported', () => { - it('throws error when there is no participant', () => { + it('throws an error when there is no participant', () => { assert.throws(() => { MemberUtil.isLiveAnnotationSupported(); }, 'LiveAnnotation support could not be processed, participant is undefined.'); @@ -448,7 +448,7 @@ describe('plugin-meetings', () => { }); describe('MemberUtil.isInterpretationSupported', () => { - it('throws error when there is no participant', () => { + it('throws an error when there is no participant', () => { assert.throws(() => { MemberUtil.isInterpretationSupported(); }, 'Interpretation support could not be processed, participant is undefined.'); @@ -479,7 +479,7 @@ describe('plugin-meetings', () => { }; describe('MemberUtil.isAudioMuted', () => { - it('throws error when there is no participant', () => { + it('throws an error when there is no participant', () => { assert.throws(() => { MemberUtil.isAudioMuted(); }, 'Audio could not be processed, participant is undefined.'); @@ -522,7 +522,7 @@ describe('plugin-meetings', () => { }); describe('MemberUtil.isVideoMuted', () => { - it('throws error when there is no participant', () => { + it('throws an error when there is no participant', () => { assert.throws(() => { MemberUtil.isVideoMuted(); }, 'Video could not be processed, participant is undefined.'); @@ -566,7 +566,7 @@ describe('plugin-meetings', () => { }); describe('extractMediaStatus', () => { - it('throws error when there is no participant', () => { + it('throws an error when there is no participant', () => { assert.throws(() => { MemberUtil.extractMediaStatus() }, 'Media status could not be extracted, participant is undefined.'); From c84ed07822e48a830eb5d425f0d1183d0105e7e7 Mon Sep 17 00:00:00 2001 From: Anna Tsukanova Date: Mon, 16 Dec 2024 19:45:02 +0100 Subject: [PATCH 3/3] chore: update isBrb --- docs/samples/browser-plugin-meetings/app.js | 4 ++-- packages/@webex/plugin-meetings/src/member/util.ts | 9 ++------- .../@webex/plugin-meetings/test/unit/spec/member/util.js | 6 ------ 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/docs/samples/browser-plugin-meetings/app.js b/docs/samples/browser-plugin-meetings/app.js index 978ce8cc4a9..c44e492c8fd 100644 --- a/docs/samples/browser-plugin-meetings/app.js +++ b/docs/samples/browser-plugin-meetings/app.js @@ -3340,7 +3340,7 @@ async function toggleBrb() { if (meeting) { const brbButton = document.getElementById('brb-btn'); - const isBrbEnabled = brbButton.innerText === 'Apply away'; + const isBrbEnabled = brbButton.innerText === 'Step away'; try { const result = await meeting.beRightBack(isBrbEnabled); @@ -3793,7 +3793,7 @@ function createMembersTable(members) { if (isUserSelf(member) && member.isInMeeting) { - td6.appendChild(createButton(member.isBrb ? 'Remove away' : 'Apply away', toggleBrb, {id: 'brb-btn'})); + td6.appendChild(createButton(member.isBrb ? 'Back to meeting' : 'Step away', toggleBrb, {id: 'brb-btn'})); } else { td6.appendChild(createLabel(member.id, member.isBrb ? 'YES' : 'NO')); } diff --git a/packages/@webex/plugin-meetings/src/member/util.ts b/packages/@webex/plugin-meetings/src/member/util.ts index 4cdf9ea330e..b53c5d204ca 100644 --- a/packages/@webex/plugin-meetings/src/member/util.ts +++ b/packages/@webex/plugin-meetings/src/member/util.ts @@ -56,13 +56,8 @@ MemberUtil.getControlsRoles = (participant: ParticipantWithRoles): Array { - if (!participant) { - throw new ParameterError('isBrb could not be processed, participant is undefined.'); - } - - return participant.controls?.brb?.enabled || false; -}; +MemberUtil.isBrb = (participant: ParticipantWithBrb): boolean => + participant.controls?.brb?.enabled || false; /** * @param {Object} participant - The locus participant object. diff --git a/packages/@webex/plugin-meetings/test/unit/spec/member/util.js b/packages/@webex/plugin-meetings/test/unit/spec/member/util.js index 0ded4d34c11..71b4713232e 100644 --- a/packages/@webex/plugin-meetings/test/unit/spec/member/util.js +++ b/packages/@webex/plugin-meetings/test/unit/spec/member/util.js @@ -391,12 +391,6 @@ describe('plugin-meetings', () => { assert.isFalse(MemberUtil.isBrb(participant)); }); - - it('throws error when participant is undefined', () => { - assert.throws(() => { - MemberUtil.isBrb(undefined); - }, 'isBrb could not be processed, participant is undefined.'); - }); }); describe('MemberUtil.isBreakoutsSupported', () => {