From 8f7ab33508661eb2bf5966f3bbd9759a877a8a4a Mon Sep 17 00:00:00 2001 From: garysmith058 Date: Sat, 11 May 2024 00:49:47 +1000 Subject: [PATCH] feat(external-api) Forward CONFERENCE_CREATED_TIMESTAMP to iframe --- conference.js | 6 +++++- modules/API/API.js | 15 +++++++++++++++ modules/API/external/external_api.js | 1 + 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/conference.js b/conference.js index 05fdd62e1d..f776cddb21 100644 --- a/conference.js +++ b/conference.js @@ -1637,7 +1637,11 @@ export default { room.on( JitsiConferenceEvents.CONFERENCE_CREATED_TIMESTAMP, - conferenceTimestamp => APP.store.dispatch(conferenceTimestampChanged(conferenceTimestamp))); + conferenceTimestamp => { + APP.store.dispatch(conferenceTimestampChanged(conferenceTimestamp)); + APP.API.notifyConferenceCreatedTimestamp(conferenceTimestamp); + } + ); room.on( JitsiConferenceEvents.DISPLAY_NAME_CHANGED, diff --git a/modules/API/API.js b/modules/API/API.js index 40872dd585..2166faf7a5 100644 --- a/modules/API/API.js +++ b/modules/API/API.js @@ -2138,6 +2138,21 @@ class API { } + /** + * Notify external application (if API is enabled) the conference + * start time. + * + * @param {number} timestamp - Timestamp conference was created. + * @returns {void} + */ + notifyConferenceCreatedTimestamp(timestamp) { + this._sendEvent({ + name: 'conference-created-timestamp', + timestamp + }); + } + + /** * Notify the external application (if API is enabled) if the connection type changed. * diff --git a/modules/API/external/external_api.js b/modules/API/external/external_api.js index 0938cf9d24..399f56d8be 100644 --- a/modules/API/external/external_api.js +++ b/modules/API/external/external_api.js @@ -108,6 +108,7 @@ const events = { 'camera-error': 'cameraError', 'chat-updated': 'chatUpdated', 'compute-pressure-changed': 'computePressureChanged', + 'conference-created-timestamp': 'conferenceCreatedTimestamp', 'content-sharing-participants-changed': 'contentSharingParticipantsChanged', 'data-channel-closed': 'dataChannelClosed', 'data-channel-opened': 'dataChannelOpened',