Browse Source

Adds live streaming sound notification. (#4532)

* Adds live streaming sound notification.

* Adds ios resources for the new files.
j8
Дамян Минков 5 years ago
parent
commit
8800cb4580
No account linked to committer's email address

+ 2
- 0
android/sdk/build.gradle View File

149
             from("${projectDir}/../../sounds/incomingMessage.wav")
149
             from("${projectDir}/../../sounds/incomingMessage.wav")
150
             from("${projectDir}/../../sounds/joined.wav")
150
             from("${projectDir}/../../sounds/joined.wav")
151
             from("${projectDir}/../../sounds/left.wav")
151
             from("${projectDir}/../../sounds/left.wav")
152
+            from("${projectDir}/../../sounds/liveStreamingOn.mp3")
153
+            from("${projectDir}/../../sounds/liveStreamingOff.mp3")
152
             from("${projectDir}/../../sounds/outgoingRinging.wav")
154
             from("${projectDir}/../../sounds/outgoingRinging.wav")
153
             from("${projectDir}/../../sounds/outgoingStart.wav")
155
             from("${projectDir}/../../sounds/outgoingStart.wav")
154
             from("${projectDir}/../../sounds/recordingOn.mp3")
156
             from("${projectDir}/../../sounds/recordingOn.mp3")

+ 8
- 0
ios/sdk/sdk.xcodeproj/project.pbxproj View File

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

+ 17
- 4
react/features/recording/constants.js View File

2
 
2
 
3
 import { JitsiRecordingConstants } from '../base/lib-jitsi-meet';
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
  * @type {string}
23
  * @type {string}
10
  */
24
  */
11
 export const RECORDING_OFF_SOUND_ID = 'RECORDING_OFF_SOUND';
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
  * @type {string}
30
  * @type {string}
18
  */
31
  */

+ 54
- 27
react/features/recording/middleware.js View File

28
     updateRecordingSessionData
28
     updateRecordingSessionData
29
 } from './actions';
29
 } from './actions';
30
 import { RECORDING_SESSION_UPDATED } from './actionTypes';
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
 import { getSessionById } from './functions';
37
 import { getSessionById } from './functions';
33
 import {
38
 import {
39
+    LIVE_STREAMING_OFF_SOUND_FILE,
40
+    LIVE_STREAMING_ON_SOUND_FILE,
34
     RECORDING_OFF_SOUND_FILE,
41
     RECORDING_OFF_SOUND_FILE,
35
     RECORDING_ON_SOUND_FILE
42
     RECORDING_ON_SOUND_FILE
36
 } from './sounds';
43
 } from './sounds';
66
 
73
 
67
     switch (action.type) {
74
     switch (action.type) {
68
     case APP_WILL_MOUNT:
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
         dispatch(registerSound(
84
         dispatch(registerSound(
70
             RECORDING_OFF_SOUND_ID,
85
             RECORDING_OFF_SOUND_ID,
71
             RECORDING_OFF_SOUND_FILE));
86
             RECORDING_OFF_SOUND_FILE));
77
         break;
92
         break;
78
 
93
 
79
     case APP_WILL_UNMOUNT:
94
     case APP_WILL_UNMOUNT:
95
+        dispatch(unregisterSound(LIVE_STREAMING_OFF_SOUND_ID));
96
+        dispatch(unregisterSound(LIVE_STREAMING_ON_SOUND_ID));
80
         dispatch(unregisterSound(RECORDING_OFF_SOUND_ID));
97
         dispatch(unregisterSound(RECORDING_OFF_SOUND_ID));
81
         dispatch(unregisterSound(RECORDING_ON_SOUND_ID));
98
         dispatch(unregisterSound(RECORDING_ON_SOUND_ID));
82
 
99
 
114
 
131
 
115
         const updatedSessionData
132
         const updatedSessionData
116
             = getSessionById(getState(), action.sessionData.id);
133
             = getSessionById(getState(), action.sessionData.id);
134
+        const { mode } = updatedSessionData;
117
         const { PENDING, OFF, ON } = JitsiRecordingConstants.status;
135
         const { PENDING, OFF, ON } = JitsiRecordingConstants.status;
118
 
136
 
119
         if (updatedSessionData.status === PENDING
137
         if (updatedSessionData.status === PENDING
120
             && (!oldSessionData || oldSessionData.status !== PENDING)) {
138
             && (!oldSessionData || oldSessionData.status !== PENDING)) {
121
-            dispatch(
122
-                showPendingRecordingNotification(updatedSessionData.mode));
139
+            dispatch(showPendingRecordingNotification(mode));
123
         } else if (updatedSessionData.status !== PENDING) {
140
         } else if (updatedSessionData.status !== PENDING) {
124
-            dispatch(
125
-                hidePendingRecordingNotification(updatedSessionData.mode));
141
+            dispatch(hidePendingRecordingNotification(mode));
126
 
142
 
127
             if (updatedSessionData.status === ON
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
             } else if (updatedSessionData.status === OFF
157
             } else if (updatedSessionData.status === OFF
134
                 && (!oldSessionData || oldSessionData.status !== OFF)) {
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 View File

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
  * @type {string}
18
  * @type {string}
6
  */
19
  */
7
 export const RECORDING_OFF_SOUND_FILE = 'recordingOff.mp3';
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
  * @type {string}
25
  * @type {string}
14
  */
26
  */

BIN
sounds/liveStreamingOff.mp3 View File


BIN
sounds/liveStreamingOn.mp3 View File


Loading…
Cancel
Save