From 0fb29a0c7ac7ff5913a8e251db3c84410fd30c67 Mon Sep 17 00:00:00 2001 From: Mihaela Dumitru Date: Mon, 6 Dec 2021 16:11:16 +0200 Subject: [PATCH] feat(external-api): enhance recordingLinkAvailable to provide ttl info --- modules/API/API.js | 6 ++++-- react/features/recording/actions.any.js | 5 +++-- react/features/recording/functions.js | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/API/API.js b/modules/API/API.js index eeddba6af..9a8621f44 100644 --- a/modules/API/API.js +++ b/modules/API/API.js @@ -1470,12 +1470,14 @@ class API { * available. * * @param {string} link - The recording download link. + * @param {number} ttl - The recording download link time to live. * @returns {void} */ - notifyRecordingLinkAvailable(link: string) { + notifyRecordingLinkAvailable(link: string, ttl: number) { this._sendEvent({ name: 'recording-link-available', - link + link, + ttl }); } diff --git a/react/features/recording/actions.any.js b/react/features/recording/actions.any.js index 96c65102b..47365c275 100644 --- a/react/features/recording/actions.any.js +++ b/react/features/recording/actions.any.js @@ -198,10 +198,11 @@ export function showStartedRecordingNotification( const tenant = getVpaasTenant(state); try { - const link = await getRecordingLink(recordingSharingUrl, sessionId, region, tenant); + const response = await getRecordingLink(recordingSharingUrl, sessionId, region, tenant); + const { url: link, urlExpirationTimeMillis: ttl } = response; if (typeof APP === 'object') { - APP.API.notifyRecordingLinkAvailable(link); + APP.API.notifyRecordingLinkAvailable(link, ttl); } // add the option to copy recording link diff --git a/react/features/recording/functions.js b/react/features/recording/functions.js index 7206f5115..82592e333 100644 --- a/react/features/recording/functions.js +++ b/react/features/recording/functions.js @@ -65,7 +65,7 @@ export async function getRecordingLink(url: string, recordingSessionId: string, }); const json = await res.json(); - return res.ok ? json.url : Promise.reject(json); + return res.ok ? json : Promise.reject(json); } /**