feat(external-api): enhance recordingLinkAvailable to provide ttl info

This commit is contained in:
Mihaela Dumitru 2021-12-06 16:11:16 +02:00 committed by Saúl Ibarra Corretgé
parent 822850d888
commit 0fb29a0c7a
3 changed files with 8 additions and 5 deletions

View File

@ -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
});
}

View File

@ -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

View File

@ -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);
}
/**