Quellcode durchsuchen

Adds notifications for who stop/start recording/live streaming. (#4708)

* Adds notifications for who stop/start recording/live streaming.

* Updates to latest lib-jitsi-meet.
master
Дамян Минков vor 5 Jahren
Ursprung
Commit
bb0036fdab
Es ist kein Account mit der E-Mail-Adresse des Committers verbunden

+ 4
- 0
lang/main.json Datei anzeigen

@@ -362,7 +362,9 @@
362 362
         "getStreamKeyManually": "We weren’t able to fetch any live streams. Try getting your live stream key from YouTube.",
363 363
         "invalidStreamKey": "Live stream key may be incorrect.",
364 364
         "off": "Live Streaming stopped",
365
+        "offBy": "{{name}} stopped the live streaming",
365 366
         "on": "Live Streaming",
367
+        "onBy": "{{name}} started the live streaming",
366 368
         "pending": "Starting Live Stream...",
367 369
         "serviceName": "Live Streaming service",
368 370
         "signedInAs": "You are currently signed in as:",
@@ -475,7 +477,9 @@
475 477
         "live": "LIVE",
476 478
         "loggedIn": "Logged in as {{userName}}",
477 479
         "off": "Recording stopped",
480
+        "offBy": "{{name}} stopped the recording",
478 481
         "on": "Recording",
482
+        "onBy": "{{name}} started the recording",
479 483
         "pending": "Preparing to record the meeting...",
480 484
         "rec": "REC",
481 485
         "serviceDescription": "Your recording will be saved by the recording service",

+ 2
- 2
package-lock.json Datei anzeigen

@@ -11681,8 +11681,8 @@
11681 11681
       }
11682 11682
     },
11683 11683
     "lib-jitsi-meet": {
11684
-      "version": "github:jitsi/lib-jitsi-meet#3f7613748d7669cd3fd031bbdf9069e4309f6f56",
11685
-      "from": "github:jitsi/lib-jitsi-meet#3f7613748d7669cd3fd031bbdf9069e4309f6f56",
11684
+      "version": "github:jitsi/lib-jitsi-meet#16e08408aa3fa8303e236b9ffdb0dfce65e79bb7",
11685
+      "from": "github:jitsi/lib-jitsi-meet#16e08408aa3fa8303e236b9ffdb0dfce65e79bb7",
11686 11686
       "requires": {
11687 11687
         "@jitsi/sdp-interop": "0.1.14",
11688 11688
         "@jitsi/sdp-simulcast": "0.2.2",

+ 1
- 1
package.json Datei anzeigen

@@ -56,7 +56,7 @@
56 56
     "js-utils": "github:jitsi/js-utils#192b1c996e8c05530eb1f19e82a31069c3021e31",
57 57
     "jsrsasign": "8.0.12",
58 58
     "jwt-decode": "2.2.0",
59
-    "lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#3f7613748d7669cd3fd031bbdf9069e4309f6f56",
59
+    "lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#16e08408aa3fa8303e236b9ffdb0dfce65e79bb7",
60 60
     "libflacjs": "github:mmig/libflac.js#93d37e7f811f01cf7d8b6a603e38bd3c3810907d",
61 61
     "lodash": "4.17.13",
62 62
     "moment": "2.19.4",

+ 35
- 3
react/features/recording/actions.js Datei anzeigen

@@ -113,16 +113,46 @@ export function showRecordingError(props: Object) {
113 113
  *
114 114
  * @param {string} streamType - The type of the stream ({@code file} or
115 115
  * {@code stream}).
116
+ * @param {string?} participantName - The participant name stopping the recording.
116 117
  * @returns {showNotification}
117 118
  */
118
-export function showStoppedRecordingNotification(streamType: string) {
119
+export function showStoppedRecordingNotification(streamType: string, participantName?: string) {
119 120
     const isLiveStreaming
120 121
         = streamType === JitsiMeetJS.constants.recording.mode.STREAM;
122
+    const descriptionArguments = { name: participantName };
121 123
     const dialogProps = isLiveStreaming ? {
122
-        descriptionKey: 'liveStreaming.off',
124
+        descriptionKey: participantName ? 'liveStreaming.offBy' : 'liveStreaming.off',
125
+        descriptionArguments,
123 126
         titleKey: 'dialog.liveStreaming'
124 127
     } : {
125
-        descriptionKey: 'recording.off',
128
+        descriptionKey: participantName ? 'recording.offBy' : 'recording.off',
129
+        descriptionArguments,
130
+        titleKey: 'dialog.recording'
131
+    };
132
+
133
+    return showNotification(dialogProps, NOTIFICATION_TIMEOUT);
134
+}
135
+
136
+/**
137
+ * Signals that a started recording notification should be shown on the
138
+ * screen for a given period.
139
+ *
140
+ * @param {string} streamType - The type of the stream ({@code file} or
141
+ * {@code stream}).
142
+ * @param {string} participantName - The participant name that started the recording.
143
+ * @returns {showNotification}
144
+ */
145
+export function showStartedRecordingNotification(streamType: string, participantName: string) {
146
+    const isLiveStreaming
147
+        = streamType === JitsiMeetJS.constants.recording.mode.STREAM;
148
+    const descriptionArguments = { name: participantName };
149
+    const dialogProps = isLiveStreaming ? {
150
+        descriptionKey: 'liveStreaming.onBy',
151
+        descriptionArguments,
152
+        titleKey: 'dialog.liveStreaming'
153
+    } : {
154
+        descriptionKey: 'recording.onBy',
155
+        descriptionArguments,
126 156
         titleKey: 'dialog.recording'
127 157
     };
128 158
 
@@ -151,9 +181,11 @@ export function updateRecordingSessionData(session: Object) {
151 181
         sessionData: {
152 182
             error: session.getError(),
153 183
             id: session.getID(),
184
+            initiator: session.getInitiator(),
154 185
             liveStreamViewURL: session.getLiveStreamViewURL(),
155 186
             mode: session.getMode(),
156 187
             status,
188
+            terminator: session.getTerminator(),
157 189
             timestamp
158 190
         }
159 191
     };

+ 9
- 2
react/features/recording/middleware.js Datei anzeigen

@@ -11,6 +11,7 @@ import JitsiMeetJS, {
11 11
     JitsiConferenceEvents,
12 12
     JitsiRecordingConstants
13 13
 } from '../base/lib-jitsi-meet';
14
+import { getParticipantDisplayName } from '../base/participants';
14 15
 import { MiddlewareRegistry, StateListenerRegistry } from '../base/redux';
15 16
 import {
16 17
     playSound,
@@ -24,6 +25,7 @@ import {
24 25
     hidePendingRecordingNotification,
25 26
     showPendingRecordingNotification,
26 27
     showRecordingError,
28
+    showStartedRecordingNotification,
27 29
     showStoppedRecordingNotification,
28 30
     updateRecordingSessionData
29 31
 } from './actions';
@@ -131,7 +133,7 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
131 133
 
132 134
         const updatedSessionData
133 135
             = getSessionById(getState(), action.sessionData.id);
134
-        const { mode } = updatedSessionData;
136
+        const { initiator, mode, terminator } = updatedSessionData;
135 137
         const { PENDING, OFF, ON } = JitsiRecordingConstants.status;
136 138
 
137 139
         if (updatedSessionData.status === PENDING
@@ -142,6 +144,10 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
142 144
 
143 145
             if (updatedSessionData.status === ON
144 146
                 && (!oldSessionData || oldSessionData.status !== ON)) {
147
+                const initiatorName = initiator && getParticipantDisplayName(getState, initiator.getId());
148
+
149
+                initiatorName && dispatch(showStartedRecordingNotification(mode, initiatorName));
150
+
145 151
                 let soundID;
146 152
 
147 153
                 if (mode === JitsiRecordingConstants.mode.FILE) {
@@ -156,7 +162,8 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
156 162
                 }
157 163
             } else if (updatedSessionData.status === OFF
158 164
                 && (!oldSessionData || oldSessionData.status !== OFF)) {
159
-                dispatch(showStoppedRecordingNotification(mode));
165
+                dispatch(showStoppedRecordingNotification(
166
+                    mode, terminator && getParticipantDisplayName(getState, terminator.getId())));
160 167
                 let duration = 0, soundOff, soundOn;
161 168
 
162 169
                 if (oldSessionData && oldSessionData.timestamp) {

Laden…
Abbrechen
Speichern