Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(meetings): add meeting join time marker #3877

Merged
merged 2 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions packages/@webex/plugin-meetings/src/meeting/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ export default class Meeting extends StatelessWebexPlugin {
id: string;
isMultistream: boolean;
locusUrl: string;
#isoLocalClientMeetingJoinTime?: string;
mediaConnections: any[];
mediaId?: string;
meetingFiniteStateMachine: any;
Expand Down Expand Up @@ -1521,6 +1522,17 @@ export default class Meeting extends StatelessWebexPlugin {
* @memberof Meeting
*/
this.iceCandidatesCount = 0;

/**
* Start time of meeting as an ISO string
* based on browser time, so can only be used to compute durations client side
* undefined if meeting has not been joined, set once on meeting join, and not updated again
* @instance
* @type {string}
* @private
* @memberof Meeting
*/
this.#isoLocalClientMeetingJoinTime = undefined;
}

/**
Expand Down Expand Up @@ -1569,6 +1581,15 @@ export default class Meeting extends StatelessWebexPlugin {
this.callStateForMetrics.correlationId = correlationId;
}

/**
* Getter - Returns isoLocalClientMeetingJoinTime
* This will be set once on meeting join, and not updated again
* @returns {string | undefined}
*/
get isoLocalClientMeetingJoinTime(): string | undefined {
return this.#isoLocalClientMeetingJoinTime;
}

/**
* Set meeting info and trigger `MEETING_INFO_AVAILABLE` event
* @param {any} info
Expand Down Expand Up @@ -5235,6 +5256,8 @@ export default class Meeting extends StatelessWebexPlugin {
// @ts-ignore
this.webex.internal.device.meetingStarted();

this.#isoLocalClientMeetingJoinTime = new Date().toISOString();

LoggerProxy.logger.log('Meeting:index#join --> Success');

Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.JOIN_SUCCESS, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ describe('plugin-meetings', () => {
assert.isNull(meeting.partner);
assert.isNull(meeting.type);
assert.isNull(meeting.owner);
assert.isUndefined(meeting.isoLocalClientMeetingJoinTime);
assert.isNull(meeting.hostId);
assert.isNull(meeting.policy);
assert.instanceOf(meeting.meetingRequest, MeetingRequest);
Expand Down Expand Up @@ -1587,6 +1588,10 @@ describe('plugin-meetings', () => {
sandbox.stub(MeetingUtil, 'joinMeeting').returns(Promise.resolve(joinMeetingResult));
});

afterEach(() => {
assert.exists(meeting.isoLocalClientMeetingJoinTime);
});

it('should join the meeting and return promise', async () => {
const join = meeting.join({pstnAudioType: 'dial-in'});
meeting.config.enableAutomaticLLM = true;
Expand Down
Loading