Browse Source

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
Дамян Минков 6 years ago
parent
commit
bb0036fdab
No account linked to committer's email address

+ 4
- 0
lang/main.json View File

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

+ 2
- 2
package-lock.json View File

11681
       }
11681
       }
11682
     },
11682
     },
11683
     "lib-jitsi-meet": {
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
       "requires": {
11686
       "requires": {
11687
         "@jitsi/sdp-interop": "0.1.14",
11687
         "@jitsi/sdp-interop": "0.1.14",
11688
         "@jitsi/sdp-simulcast": "0.2.2",
11688
         "@jitsi/sdp-simulcast": "0.2.2",

+ 1
- 1
package.json View File

56
     "js-utils": "github:jitsi/js-utils#192b1c996e8c05530eb1f19e82a31069c3021e31",
56
     "js-utils": "github:jitsi/js-utils#192b1c996e8c05530eb1f19e82a31069c3021e31",
57
     "jsrsasign": "8.0.12",
57
     "jsrsasign": "8.0.12",
58
     "jwt-decode": "2.2.0",
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
     "libflacjs": "github:mmig/libflac.js#93d37e7f811f01cf7d8b6a603e38bd3c3810907d",
60
     "libflacjs": "github:mmig/libflac.js#93d37e7f811f01cf7d8b6a603e38bd3c3810907d",
61
     "lodash": "4.17.13",
61
     "lodash": "4.17.13",
62
     "moment": "2.19.4",
62
     "moment": "2.19.4",

+ 35
- 3
react/features/recording/actions.js View File

113
  *
113
  *
114
  * @param {string} streamType - The type of the stream ({@code file} or
114
  * @param {string} streamType - The type of the stream ({@code file} or
115
  * {@code stream}).
115
  * {@code stream}).
116
+ * @param {string?} participantName - The participant name stopping the recording.
116
  * @returns {showNotification}
117
  * @returns {showNotification}
117
  */
118
  */
118
-export function showStoppedRecordingNotification(streamType: string) {
119
+export function showStoppedRecordingNotification(streamType: string, participantName?: string) {
119
     const isLiveStreaming
120
     const isLiveStreaming
120
         = streamType === JitsiMeetJS.constants.recording.mode.STREAM;
121
         = streamType === JitsiMeetJS.constants.recording.mode.STREAM;
122
+    const descriptionArguments = { name: participantName };
121
     const dialogProps = isLiveStreaming ? {
123
     const dialogProps = isLiveStreaming ? {
122
-        descriptionKey: 'liveStreaming.off',
124
+        descriptionKey: participantName ? 'liveStreaming.offBy' : 'liveStreaming.off',
125
+        descriptionArguments,
123
         titleKey: 'dialog.liveStreaming'
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
         titleKey: 'dialog.recording'
156
         titleKey: 'dialog.recording'
127
     };
157
     };
128
 
158
 
151
         sessionData: {
181
         sessionData: {
152
             error: session.getError(),
182
             error: session.getError(),
153
             id: session.getID(),
183
             id: session.getID(),
184
+            initiator: session.getInitiator(),
154
             liveStreamViewURL: session.getLiveStreamViewURL(),
185
             liveStreamViewURL: session.getLiveStreamViewURL(),
155
             mode: session.getMode(),
186
             mode: session.getMode(),
156
             status,
187
             status,
188
+            terminator: session.getTerminator(),
157
             timestamp
189
             timestamp
158
         }
190
         }
159
     };
191
     };

+ 9
- 2
react/features/recording/middleware.js View File

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

Loading…
Cancel
Save