Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
Adds notifications for who stop/start recording/live streaming. (#4708)
Дамян Минковbb0036fdabd0
diff --git a/lang/main.json b/lang/main.jsonindex d767bcd89c..d614ae87ab 100644--- a/lang/main.json+++ b/lang/main.json@@ -362,7 +362,9 @@"getStreamKeyManually": "We weren’t able to fetch any live streams. Try getting your live stream key from YouTube.","invalidStreamKey": "Live stream key may be incorrect.","off": "Live Streaming stopped",+ "offBy": "{{name}} stopped the live streaming","on": "Live Streaming",+ "onBy": "{{name}} started the live streaming","pending": "Starting Live Stream...","serviceName": "Live Streaming service","signedInAs": "You are currently signed in as:",@@ -475,7 +477,9 @@"live": "LIVE","loggedIn": "Logged in as {{userName}}","off": "Recording stopped",+ "offBy": "{{name}} stopped the recording","on": "Recording",+ "onBy": "{{name}} started the recording","pending": "Preparing to record the meeting...","rec": "REC","serviceDescription": "Your recording will be saved by the recording service",diff --git a/package-lock.json b/package-lock.jsonindex b5b2c92374..535c72337c 100644--- a/package-lock.json+++ b/package-lock.json@@ -11681,8 +11681,8 @@}},"lib-jitsi-meet": {- "version": "github:jitsi/lib-jitsi-meet#3f7613748d7669cd3fd031bbdf9069e4309f6f56",- "from": "github:jitsi/lib-jitsi-meet#3f7613748d7669cd3fd031bbdf9069e4309f6f56",+ "version": "github:jitsi/lib-jitsi-meet#16e08408aa3fa8303e236b9ffdb0dfce65e79bb7",+ "from": "github:jitsi/lib-jitsi-meet#16e08408aa3fa8303e236b9ffdb0dfce65e79bb7","requires": {"@jitsi/sdp-interop": "0.1.14","@jitsi/sdp-simulcast": "0.2.2",diff --git a/package.json b/package.jsonindex d6d12a954c..d5d556d74c 100644--- a/package.json+++ b/package.json@@ -56,7 +56,7 @@"js-utils": "github:jitsi/js-utils#192b1c996e8c05530eb1f19e82a31069c3021e31","jsrsasign": "8.0.12","jwt-decode": "2.2.0",- "lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#3f7613748d7669cd3fd031bbdf9069e4309f6f56",+ "lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#16e08408aa3fa8303e236b9ffdb0dfce65e79bb7","libflacjs": "github:mmig/libflac.js#93d37e7f811f01cf7d8b6a603e38bd3c3810907d","lodash": "4.17.13","moment": "2.19.4",diff --git a/react/features/recording/actions.js b/react/features/recording/actions.jsindex 899f3018a5..c5d5f23102 100644--- a/react/features/recording/actions.js+++ b/react/features/recording/actions.js@@ -113,16 +113,46 @@ export function showRecordingError(props: Object) {** @param {string} streamType - The type of the stream ({@code file} or* {@code stream}).+ * @param {string?} participantName - The participant name stopping the recording.* @returns {showNotification}*/-export function showStoppedRecordingNotification(streamType: string) {+export function showStoppedRecordingNotification(streamType: string, participantName?: string) {const isLiveStreaming= streamType === JitsiMeetJS.constants.recording.mode.STREAM;+ const descriptionArguments = { name: participantName };const dialogProps = isLiveStreaming ? {- descriptionKey: 'liveStreaming.off',+ descriptionKey: participantName ? 'liveStreaming.offBy' : 'liveStreaming.off',+ descriptionArguments,titleKey: 'dialog.liveStreaming'} : {- descriptionKey: 'recording.off',+ descriptionKey: participantName ? 'recording.offBy' : 'recording.off',+ descriptionArguments,+ titleKey: 'dialog.recording'+ };++ return showNotification(dialogProps, NOTIFICATION_TIMEOUT);+}++/**+ * Signals that a started recording notification should be shown on the+ * screen for a given period.+ *+ * @param {string} streamType - The type of the stream ({@code file} or+ * {@code stream}).+ * @param {string} participantName - The participant name that started the recording.+ * @returns {showNotification}+ */+export function showStartedRecordingNotification(streamType: string, participantName: string) {+ const isLiveStreaming+ = streamType === JitsiMeetJS.constants.recording.mode.STREAM;+ const descriptionArguments = { name: participantName };+ const dialogProps = isLiveStreaming ? {+ descriptionKey: 'liveStreaming.onBy',+ descriptionArguments,+ titleKey: 'dialog.liveStreaming'+ } : {+ descriptionKey: 'recording.onBy',+ descriptionArguments,titleKey: 'dialog.recording'};@@ -151,9 +181,11 @@ export function updateRecordingSessionData(session: Object) {sessionData: {error: session.getError(),id: session.getID(),+ initiator: session.getInitiator(),liveStreamViewURL: session.getLiveStreamViewURL(),mode: session.getMode(),status,+ terminator: session.getTerminator(),timestamp}};diff --git a/react/features/recording/middleware.js b/react/features/recording/middleware.jsindex 23a90f7f90..8d4141b5f5 100644--- a/react/features/recording/middleware.js+++ b/react/features/recording/middleware.js@@ -11,6 +11,7 @@ import JitsiMeetJS, {JitsiConferenceEvents,JitsiRecordingConstants} from '../base/lib-jitsi-meet';+import { getParticipantDisplayName } from '../base/participants';import { MiddlewareRegistry, StateListenerRegistry } from '../base/redux';import {playSound,@@ -24,6 +25,7 @@ import {hidePendingRecordingNotification,showPendingRecordingNotification,showRecordingError,+ showStartedRecordingNotification,showStoppedRecordingNotification,updateRecordingSessionData} from './actions';@@ -131,7 +133,7 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {const updatedSessionData= getSessionById(getState(), action.sessionData.id);- const { mode } = updatedSessionData;+ const { initiator, mode, terminator } = updatedSessionData;const { PENDING, OFF, ON } = JitsiRecordingConstants.status;if (updatedSessionData.status === PENDING@@ -142,6 +144,10 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {if (updatedSessionData.status === ON&& (!oldSessionData || oldSessionData.status !== ON)) {+ const initiatorName = initiator && getParticipantDisplayName(getState, initiator.getId());++ initiatorName && dispatch(showStartedRecordingNotification(mode, initiatorName));+let soundID;if (mode === JitsiRecordingConstants.mode.FILE) {@@ -156,7 +162,8 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {}} else if (updatedSessionData.status === OFF&& (!oldSessionData || oldSessionData.status !== OFF)) {- dispatch(showStoppedRecordingNotification(mode));+ dispatch(showStoppedRecordingNotification(+ mode, terminator && getParticipantDisplayName(getState, terminator.getId())));let duration = 0, soundOff, soundOn;if (oldSessionData && oldSessionData.timestamp) {