From bca9a12df1b5effbc48904303567670552b8bd29 Mon Sep 17 00:00:00 2001 From: niteshletxsoft <53343579+niteshletxsoft@users.noreply.github.com> Date: Tue, 9 Feb 2021 17:13:38 +0530 Subject: [PATCH] feat(external_ap) add api call to get live stream url --- modules/API/API.js | 17 +++++++++++++++++ modules/API/external/external_api.js | 12 ++++++++++++ 2 files changed, 29 insertions(+) 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. *