diff --git a/modules/API/API.js b/modules/API/API.js index 0e19c5031..5bd918aa3 100644 --- a/modules/API/API.js +++ b/modules/API/API.js @@ -441,6 +441,23 @@ function initCommands() { }); break; } + case 'get-livestream-url': { + const state = APP.store.getState(); + const conference = getCurrentConference(state); + let livestreamUrl; + + if (conference) { + const activeSession = getActiveSession(state, JitsiRecordingConstants.mode.STREAM); + + livestreamUrl = activeSession?.liveStreamViewURL; + } else { + logger.error('Conference is not defined'); + } + callback({ + livestreamUrl + }); + break; + } default: return false; } diff --git a/modules/API/external/external_api.js b/modules/API/external/external_api.js index 78f6103fb..4ede252df 100644 --- a/modules/API/external/external_api.js +++ b/modules/API/external/external_api.js @@ -753,6 +753,18 @@ export default class JitsiMeetExternalAPI extends EventEmitter { return getCurrentDevices(this._transport); } + /** + * Returns the current livestream url. + * + * @returns {Promise} - Resolves with the current livestream URL if exists, with + * undefined if not and rejects on failure. + */ + getLivestreamUrl() { + return this._transport.sendRequest({ + name: 'get-livestream-url' + }); + } + /** * Returns the conference participants information. *