Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
feat(api): add toolbarVisibilityChanged event to the IFrame API (#16659)
Vishal Malyan77b89ece4ae0
diff --git a/modules/API/API.js b/modules/API/API.jsindex 5450fcb2a8..4a8d892ebf 100755--- a/modules/API/API.js+++ b/modules/API/API.js@@ -1242,6 +1242,20 @@ class API {});}+ /**+ * Notify external application (if API is enabled) that the in-page toolbox+ * visibility changed.+ *+ * @param {boolean} visible - True if the toolbox is visible, false otherwise.+ * @returns {void}+ */+ notifyToolbarVisibilityChanged(visible) {+ this._sendEvent({+ name: 'toolbar-visibility-changed',+ visible+ });+ }+/*** Notifies the external application (spot) that the local jitsi-participant* has a status update.diff --git a/modules/API/external/external_api.js b/modules/API/external/external_api.jsindex 4c2e01a5b5..9a821e2739 100644--- a/modules/API/external/external_api.js+++ b/modules/API/external/external_api.js@@ -167,6 +167,7 @@ const events = {'suspend-detected': 'suspendDetected','tile-view-changed': 'tileViewChanged','toolbar-button-clicked': 'toolbarButtonClicked',+ 'toolbar-visibility-changed': 'toolbarVisibilityChanged','transcribing-status-changed': 'transcribingStatusChanged','transcription-chunk-received': 'transcriptionChunkReceived','whiteboard-status-changed': 'whiteboardStatusChanged'diff --git a/react/features/toolbox/actions.any.ts b/react/features/toolbox/actions.any.tsindex 7e257cbb86..72fcd7b2aa 100644--- a/react/features/toolbox/actions.any.ts+++ b/react/features/toolbox/actions.any.ts@@ -50,6 +50,13 @@ export function setToolboxVisible(visible: boolean) {type: SET_TOOLBOX_VISIBLE,visible});+ // Notify external API consumers about the change in toolbox visibility+ // if the old legacy APP.API bridge is available.+ /* eslint-disable no-undef */+ if (typeof APP !== 'undefined' && APP.API && typeof APP.API.notifyToolbarVisibilityChanged === 'function') {+ APP.API.notifyToolbarVisibilityChanged(visible);+ }+ /* eslint-enable no-undef */};}@@ -72,6 +79,18 @@ export function toggleToolboxVisible() {dispatch({type: TOGGLE_TOOLBOX_VISIBLE});++ // After toggling, read the updated state and notify external API+ // about the current visibility. This mirrors the behavior of+ // setToolboxVisible and ensures consumers are informed when the+ // visibility changes via toggle.+ /* eslint-disable no-undef */+ if (typeof APP !== 'undefined' && APP.API && typeof APP.API.notifyToolbarVisibilityChanged === 'function') {+ const { visible: newVisible } = getState()['features/toolbox'];++ APP.API.notifyToolbarVisibilityChanged(newVisible);+ }+ /* eslint-enable no-undef */};}