Bläddra i källkod

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

j8
niteshletxsoft 4 år sedan
förälder
incheckning
bca9a12df1
Inget konto är kopplat till bidragsgivarens mejladress
2 ändrade filer med 29 tillägg och 0 borttagningar
  1. 17
    0
      modules/API/API.js
  2. 12
    0
      modules/API/external/external_api.js

+ 17
- 0
modules/API/API.js Visa fil

@@ -441,6 +441,23 @@ function initCommands() {
441 441
             });
442 442
             break;
443 443
         }
444
+        case 'get-livestream-url': {
445
+            const state = APP.store.getState();
446
+            const conference = getCurrentConference(state);
447
+            let livestreamUrl;
448
+
449
+            if (conference) {
450
+                const activeSession = getActiveSession(state, JitsiRecordingConstants.mode.STREAM);
451
+
452
+                livestreamUrl = activeSession?.liveStreamViewURL;
453
+            } else {
454
+                logger.error('Conference is not defined');
455
+            }
456
+            callback({
457
+                livestreamUrl
458
+            });
459
+            break;
460
+        }
444 461
         default:
445 462
             return false;
446 463
         }

+ 12
- 0
modules/API/external/external_api.js Visa fil

@@ -753,6 +753,18 @@ export default class JitsiMeetExternalAPI extends EventEmitter {
753 753
         return getCurrentDevices(this._transport);
754 754
     }
755 755
 
756
+    /**
757
+     * Returns the current livestream url.
758
+     *
759
+     * @returns {Promise} - Resolves with the current livestream URL if exists, with
760
+     * undefined if not and rejects on failure.
761
+     */
762
+    getLivestreamUrl() {
763
+        return this._transport.sendRequest({
764
+            name: 'get-livestream-url'
765
+        });
766
+    }
767
+
756 768
     /**
757 769
      * Returns the conference participants information.
758 770
      *

Laddar…
Avbryt
Spara