Quellcode durchsuchen

Adds live streaming sound notification. (#4532)

* Adds live streaming sound notification.

* Adds ios resources for the new files.
master
Дамян Минков vor 5 Jahren
Ursprung
Commit
8800cb4580
Es ist kein Account mit der E-Mail-Adresse des Committers verbunden

+ 2
- 0
android/sdk/build.gradle Datei anzeigen

@@ -149,6 +149,8 @@ android.libraryVariants.all { def variant ->
149 149
             from("${projectDir}/../../sounds/incomingMessage.wav")
150 150
             from("${projectDir}/../../sounds/joined.wav")
151 151
             from("${projectDir}/../../sounds/left.wav")
152
+            from("${projectDir}/../../sounds/liveStreamingOn.mp3")
153
+            from("${projectDir}/../../sounds/liveStreamingOff.mp3")
152 154
             from("${projectDir}/../../sounds/outgoingRinging.wav")
153 155
             from("${projectDir}/../../sounds/outgoingStart.wav")
154 156
             from("${projectDir}/../../sounds/recordingOn.mp3")

+ 8
- 0
ios/sdk/sdk.xcodeproj/project.pbxproj Datei anzeigen

@@ -27,6 +27,8 @@
27 27
 		0BCA496C1EC4BBF900B793EE /* jitsi.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 0BCA496B1EC4BBF900B793EE /* jitsi.ttf */; };
28 28
 		0BD906EA1EC0C00300C8C18E /* JitsiMeet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0BD906E81EC0C00300C8C18E /* JitsiMeet.h */; settings = {ATTRIBUTES = (Public, ); }; };
29 29
 		0F65EECE1D95DA94561BB47E /* libPods-JitsiMeet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 03F2ADC957FF109849B7FCA1 /* libPods-JitsiMeet.a */; };
30
+		C30F88D0CB0F4F5593216D24 /* liveStreamingOff.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = C30F88D1CB0F4F5593216D24 /* liveStreamingOff.mp3 */; };
31
+		C30F88D2CB0F4F5593216D24 /* liveStreamingOn.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = C30F88D3CB0F4F5593216D24 /* liveStreamingOn.mp3 */; };
30 32
 		6C31EDC820C06D490089C899 /* recordingOn.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 6C31EDC720C06D490089C899 /* recordingOn.mp3 */; };
31 33
 		6C31EDCA20C06D530089C899 /* recordingOff.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 6C31EDC920C06D530089C899 /* recordingOff.mp3 */; };
32 34
 		75635B0A20751D6D00F29C9F /* joined.wav in Resources */ = {isa = PBXBuildFile; fileRef = 75635B0820751D6D00F29C9F /* joined.wav */; };
@@ -77,6 +79,8 @@
77 79
 		0BD906E51EC0C00300C8C18E /* JitsiMeet.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = JitsiMeet.framework; sourceTree = BUILT_PRODUCTS_DIR; };
78 80
 		0BD906E81EC0C00300C8C18E /* JitsiMeet.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JitsiMeet.h; sourceTree = "<group>"; };
79 81
 		0BD906E91EC0C00300C8C18E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
82
+		C30F88D1CB0F4F5593216D24 /* liveStreamingOff.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; name = liveStreamingOff.mp3; path = ../../sounds/liveStreamingOff.mp3; sourceTree = "<group>"; };
83
+		C30F88D3CB0F4F5593216D24 /* liveStreamingOn.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; name = liveStreamingOn.mp3; path = ../../sounds/liveStreamingOn.mp3; sourceTree = "<group>"; };
80 84
 		6C31EDC720C06D490089C899 /* recordingOn.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; name = recordingOn.mp3; path = ../../sounds/recordingOn.mp3; sourceTree = "<group>"; };
81 85
 		6C31EDC920C06D530089C899 /* recordingOff.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; name = recordingOff.mp3; path = ../../sounds/recordingOff.mp3; sourceTree = "<group>"; };
82 86
 		75635B0820751D6D00F29C9F /* joined.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = joined.wav; path = ../../sounds/joined.wav; sourceTree = "<group>"; };
@@ -135,6 +139,8 @@
135 139
 				0BCA496B1EC4BBF900B793EE /* jitsi.ttf */,
136 140
 				75635B0820751D6D00F29C9F /* joined.wav */,
137 141
 				75635B0920751D6D00F29C9F /* left.wav */,
142
+				C30F88D1CB0F4F5593216D24 /* liveStreamingOff.mp3 */,
143
+				C30F88D3CB0F4F5593216D24 /* liveStreamingOn.mp3 */,
138 144
 				0B49424420AD8DBD00BD2DE0 /* outgoingRinging.wav */,
139 145
 				0B49424320AD8DBD00BD2DE0 /* outgoingStart.wav */,
140 146
 				6C31EDC920C06D530089C899 /* recordingOff.mp3 */,
@@ -343,6 +349,8 @@
343 349
 			files = (
344 350
 				87FE6F3321E52437004A5DC7 /* incomingMessage.wav in Resources */,
345 351
 				0B49424520AD8DBD00BD2DE0 /* outgoingStart.wav in Resources */,
352
+				C30F88D0CB0F4F5593216D24 /* liveStreamingOff.mp3 in Resources */,
353
+				C30F88D2CB0F4F5593216D24 /* liveStreamingOn.mp3 in Resources */,
346 354
 				6C31EDCA20C06D530089C899 /* recordingOff.mp3 in Resources */,
347 355
 				A4414AE020B37F1A003546E6 /* rejected.wav in Resources */,
348 356
 				0B49424620AD8DBD00BD2DE0 /* outgoingRinging.wav in Resources */,

+ 17
- 4
react/features/recording/constants.js Datei anzeigen

@@ -2,17 +2,30 @@
2 2
 
3 3
 import { JitsiRecordingConstants } from '../base/lib-jitsi-meet';
4 4
 
5
+
6
+/**
7
+ * The identifier of the sound to be played when a live streaming session is stopped.
8
+ *
9
+ * @type {string}
10
+ */
11
+export const LIVE_STREAMING_OFF_SOUND_ID = 'LIVE_STREAMING_OFF_SOUND';
12
+
13
+/**
14
+ * The identifier of the sound to be played when a live streaming session is started.
15
+ *
16
+ * @type {string}
17
+ */
18
+export const LIVE_STREAMING_ON_SOUND_ID = 'LIVE_STREAMING_ON_SOUND';
19
+
5 20
 /**
6
- * The identifier of the sound to be played when a recording or live streaming
7
- * session is stopped.
21
+ * The identifier of the sound to be played when a recording session is stopped.
8 22
  *
9 23
  * @type {string}
10 24
  */
11 25
 export const RECORDING_OFF_SOUND_ID = 'RECORDING_OFF_SOUND';
12 26
 
13 27
 /**
14
- * The identifier of the sound to be played when a recording or live streaming
15
- * session is started.
28
+ * The identifier of the sound to be played when a recording session is started.
16 29
  *
17 30
  * @type {string}
18 31
  */

+ 54
- 27
react/features/recording/middleware.js Datei anzeigen

@@ -28,9 +28,16 @@ import {
28 28
     updateRecordingSessionData
29 29
 } from './actions';
30 30
 import { RECORDING_SESSION_UPDATED } from './actionTypes';
31
-import { RECORDING_OFF_SOUND_ID, RECORDING_ON_SOUND_ID } from './constants';
31
+import {
32
+    LIVE_STREAMING_OFF_SOUND_ID,
33
+    LIVE_STREAMING_ON_SOUND_ID,
34
+    RECORDING_OFF_SOUND_ID,
35
+    RECORDING_ON_SOUND_ID
36
+} from './constants';
32 37
 import { getSessionById } from './functions';
33 38
 import {
39
+    LIVE_STREAMING_OFF_SOUND_FILE,
40
+    LIVE_STREAMING_ON_SOUND_FILE,
34 41
     RECORDING_OFF_SOUND_FILE,
35 42
     RECORDING_ON_SOUND_FILE
36 43
 } from './sounds';
@@ -66,6 +73,14 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
66 73
 
67 74
     switch (action.type) {
68 75
     case APP_WILL_MOUNT:
76
+        dispatch(registerSound(
77
+            LIVE_STREAMING_OFF_SOUND_ID,
78
+            LIVE_STREAMING_OFF_SOUND_FILE));
79
+
80
+        dispatch(registerSound(
81
+            LIVE_STREAMING_ON_SOUND_ID,
82
+            LIVE_STREAMING_ON_SOUND_FILE));
83
+
69 84
         dispatch(registerSound(
70 85
             RECORDING_OFF_SOUND_ID,
71 86
             RECORDING_OFF_SOUND_FILE));
@@ -77,6 +92,8 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
77 92
         break;
78 93
 
79 94
     case APP_WILL_UNMOUNT:
95
+        dispatch(unregisterSound(LIVE_STREAMING_OFF_SOUND_ID));
96
+        dispatch(unregisterSound(LIVE_STREAMING_ON_SOUND_ID));
80 97
         dispatch(unregisterSound(RECORDING_OFF_SOUND_ID));
81 98
         dispatch(unregisterSound(RECORDING_ON_SOUND_ID));
82 99
 
@@ -114,41 +131,51 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
114 131
 
115 132
         const updatedSessionData
116 133
             = getSessionById(getState(), action.sessionData.id);
134
+        const { mode } = updatedSessionData;
117 135
         const { PENDING, OFF, ON } = JitsiRecordingConstants.status;
118 136
 
119 137
         if (updatedSessionData.status === PENDING
120 138
             && (!oldSessionData || oldSessionData.status !== PENDING)) {
121
-            dispatch(
122
-                showPendingRecordingNotification(updatedSessionData.mode));
139
+            dispatch(showPendingRecordingNotification(mode));
123 140
         } else if (updatedSessionData.status !== PENDING) {
124
-            dispatch(
125
-                hidePendingRecordingNotification(updatedSessionData.mode));
141
+            dispatch(hidePendingRecordingNotification(mode));
126 142
 
127 143
             if (updatedSessionData.status === ON
128
-                && (!oldSessionData || oldSessionData.status !== ON)
129
-                && updatedSessionData.mode
130
-                    === JitsiRecordingConstants.mode.FILE) {
131
-                sendAnalytics(createRecordingEvent('start', 'file'));
132
-                dispatch(playSound(RECORDING_ON_SOUND_ID));
144
+                && (!oldSessionData || oldSessionData.status !== ON)) {
145
+                let soundID;
146
+
147
+                if (mode === JitsiRecordingConstants.mode.FILE) {
148
+                    soundID = RECORDING_ON_SOUND_ID;
149
+                } else if (mode === JitsiRecordingConstants.mode.STREAM) {
150
+                    soundID = LIVE_STREAMING_ON_SOUND_ID;
151
+                }
152
+
153
+                if (soundID) {
154
+                    sendAnalytics(createRecordingEvent('start', mode));
155
+                    dispatch(playSound(soundID));
156
+                }
133 157
             } else if (updatedSessionData.status === OFF
134 158
                 && (!oldSessionData || oldSessionData.status !== OFF)) {
135
-                dispatch(
136
-                    showStoppedRecordingNotification(
137
-                        updatedSessionData.mode));
138
-
139
-                if (updatedSessionData.mode
140
-                        === JitsiRecordingConstants.mode.FILE) {
141
-                    let duration = 0;
142
-
143
-                    // eslint-disable-next-line max-depth
144
-                    if (oldSessionData && oldSessionData.timestamp) {
145
-                        duration
146
-                            = (Date.now() / 1000) - oldSessionData.timestamp;
147
-                    }
148
-                    sendAnalytics(
149
-                        createRecordingEvent('stop', 'file', duration));
150
-                    dispatch(stopSound(RECORDING_ON_SOUND_ID));
151
-                    dispatch(playSound(RECORDING_OFF_SOUND_ID));
159
+                dispatch(showStoppedRecordingNotification(mode));
160
+                let duration = 0, soundOff, soundOn;
161
+
162
+                if (oldSessionData && oldSessionData.timestamp) {
163
+                    duration
164
+                        = (Date.now() / 1000) - oldSessionData.timestamp;
165
+                }
166
+
167
+                if (mode === JitsiRecordingConstants.mode.FILE) {
168
+                    soundOff = RECORDING_OFF_SOUND_ID;
169
+                    soundOn = RECORDING_ON_SOUND_ID;
170
+                } else if (mode === JitsiRecordingConstants.mode.STREAM) {
171
+                    soundOff = LIVE_STREAMING_OFF_SOUND_ID;
172
+                    soundOn = LIVE_STREAMING_ON_SOUND_ID;
173
+                }
174
+
175
+                if (soundOff && soundOn) {
176
+                    sendAnalytics(createRecordingEvent('stop', mode, duration));
177
+                    dispatch(stopSound(soundOn));
178
+                    dispatch(playSound(soundOff));
152 179
                 }
153 180
             }
154 181
         }

+ 16
- 4
react/features/recording/sounds.js Datei anzeigen

@@ -1,14 +1,26 @@
1 1
 /**
2
- * The name of the bundled audio file which will be played for when a recording
3
- * or live streaming is stopped.
2
+ * The name of the bundled audio file which will be played for when live streaming is stopped.
3
+ *
4
+ * @type {string}
5
+ */
6
+export const LIVE_STREAMING_OFF_SOUND_FILE = 'liveStreamingOff.mp3';
7
+
8
+/**
9
+ * The name of the bundled audio file which will be played for when a live streaming is started.
10
+ *
11
+ * @type {string}
12
+ */
13
+export const LIVE_STREAMING_ON_SOUND_FILE = 'liveStreamingOn.mp3';
14
+
15
+/**
16
+ * The name of the bundled audio file which will be played for when a recording is stopped.
4 17
  *
5 18
  * @type {string}
6 19
  */
7 20
 export const RECORDING_OFF_SOUND_FILE = 'recordingOff.mp3';
8 21
 
9 22
 /**
10
- * The name of the bundled audio file which will be played for when a recording
11
- * or live streaming is started.
23
+ * The name of the bundled audio file which will be played for when a recording is started.
12 24
  *
13 25
  * @type {string}
14 26
  */

BIN
sounds/liveStreamingOff.mp3 Datei anzeigen


BIN
sounds/liveStreamingOn.mp3 Datei anzeigen


Laden…
Abbrechen
Speichern