Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

feat(external_ap) add api call to get live stream url

niteshletxsoftbca9a12df1b5
diff --git a/modules/API/API.js b/modules/API/API.js
index 0e19c50315..5bd918aa33 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 78f6103fbc..4ede252dfd 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.
*