From e273a05dd0910464795283633c448ed3280b037e Mon Sep 17 00:00:00 2001 From: Horatiu Muresan <39557534+horymury@users.noreply.github.com> Date: Fri, 22 Oct 2021 11:53:22 +0300 Subject: [PATCH] feat(external-api): Add recording download link available event (#10229) --- modules/API/API.js | 14 ++++++++++++++ modules/API/external/external_api.js | 1 + react/features/recording/actions.any.js | 6 ++++++ 3 files changed, 21 insertions(+) diff --git a/modules/API/API.js b/modules/API/API.js index 2e20ff44c..41f1cb28e 100644 --- a/modules/API/API.js +++ b/modules/API/API.js @@ -1462,6 +1462,20 @@ class API { }); } + /** + * Notify external application (if API is enabled) that the current recording link is + * available. + * + * @param {string} link - The recording download link. + * @returns {void} + */ + notifyRecordingLinkAvailable(link: string) { + this._sendEvent({ + name: 'recording-link-available', + link + }); + } + /** * Notify external application (if API is enabled) that a participant is knocking in the lobby. * diff --git a/modules/API/external/external_api.js b/modules/API/external/external_api.js index 112555a8a..140376bc5 100644 --- a/modules/API/external/external_api.js +++ b/modules/API/external/external_api.js @@ -112,6 +112,7 @@ const events = { 'password-required': 'passwordRequired', 'proxy-connection-event': 'proxyConnectionEvent', 'raise-hand-updated': 'raiseHandUpdated', + 'recording-link-available': 'recordingLinkAvailable', 'recording-status-changed': 'recordingStatusChanged', 'video-ready-to-close': 'readyToClose', 'video-conference-joined': 'videoConferenceJoined', diff --git a/react/features/recording/actions.any.js b/react/features/recording/actions.any.js index 9502d83c4..5c9551fdc 100644 --- a/react/features/recording/actions.any.js +++ b/react/features/recording/actions.any.js @@ -22,6 +22,8 @@ import { import { getRecordingLink, getResourceId, isSavingRecordingOnDropbox } from './functions'; import logger from './logger'; +declare var APP: Object; + /** * Clears the data of every recording sessions. * @@ -188,6 +190,10 @@ export function showStartedRecordingNotification( try { const link = await getRecordingLink(recordingSharingUrl, sessionId, region, tenant); + if (typeof APP === 'object') { + APP.API.notifyRecordingLinkAvailable(link); + } + // add the option to copy recording link dialogProps.customActionNameKey = 'recording.copyLink'; dialogProps.customActionHandler = () => copyText(link);