Browse Source

feat(external-api): Add recording download link available event (#10229)

master
Horatiu Muresan 2 years ago
parent
commit
e273a05dd0
No account linked to committer's email address

+ 14
- 0
modules/API/API.js View File

@@ -1462,6 +1462,20 @@ class API {
1462 1462
         });
1463 1463
     }
1464 1464
 
1465
+    /**
1466
+     * Notify external application (if API is enabled) that the current recording link is
1467
+     * available.
1468
+     *
1469
+     * @param {string} link - The recording download link.
1470
+     * @returns {void}
1471
+     */
1472
+    notifyRecordingLinkAvailable(link: string) {
1473
+        this._sendEvent({
1474
+            name: 'recording-link-available',
1475
+            link
1476
+        });
1477
+    }
1478
+
1465 1479
     /**
1466 1480
      * Notify external application (if API is enabled) that a participant is knocking in the lobby.
1467 1481
      *

+ 1
- 0
modules/API/external/external_api.js View File

@@ -112,6 +112,7 @@ const events = {
112 112
     'password-required': 'passwordRequired',
113 113
     'proxy-connection-event': 'proxyConnectionEvent',
114 114
     'raise-hand-updated': 'raiseHandUpdated',
115
+    'recording-link-available': 'recordingLinkAvailable',
115 116
     'recording-status-changed': 'recordingStatusChanged',
116 117
     'video-ready-to-close': 'readyToClose',
117 118
     'video-conference-joined': 'videoConferenceJoined',

+ 6
- 0
react/features/recording/actions.any.js View File

@@ -22,6 +22,8 @@ import {
22 22
 import { getRecordingLink, getResourceId, isSavingRecordingOnDropbox } from './functions';
23 23
 import logger from './logger';
24 24
 
25
+declare var APP: Object;
26
+
25 27
 /**
26 28
  * Clears the data of every recording sessions.
27 29
  *
@@ -188,6 +190,10 @@ export function showStartedRecordingNotification(
188 190
                 try {
189 191
                     const link = await getRecordingLink(recordingSharingUrl, sessionId, region, tenant);
190 192
 
193
+                    if (typeof APP === 'object') {
194
+                        APP.API.notifyRecordingLinkAvailable(link);
195
+                    }
196
+
191 197
                     // add the option to copy recording link
192 198
                     dialogProps.customActionNameKey = 'recording.copyLink';
193 199
                     dialogProps.customActionHandler = () => copyText(link);

Loading…
Cancel
Save