Преглед на файлове

Add recording file sharing switch

master
Bettenbuk Zoltan преди 6 години
родител
ревизия
b7198ba4b3

Двоични данни
images/icon-users.png Целия файл


+ 1
- 0
lang/main.json Целия файл

515
         "expandedOn": "The meeting is currently being recorded.",
515
         "expandedOn": "The meeting is currently being recorded.",
516
         "expandedPending": "Recording is being started...",
516
         "expandedPending": "Recording is being started...",
517
         "failedToStart": "Recording failed to start",
517
         "failedToStart": "Recording failed to start",
518
+        "fileSharingdescription": "Share recording with meeting participants",
518
         "live": "LIVE",
519
         "live": "LIVE",
519
         "loggedIn": "Logged in as __userName__",
520
         "loggedIn": "Logged in as __userName__",
520
         "off": "Recording stopped",
521
         "off": "Recording stopped",

+ 5
- 0
react/features/base/dialog/components/native/styles.js Целия файл

243
 
243
 
244
     text: {
244
     text: {
245
         ...brandedDialogText
245
         ...brandedDialogText
246
+    },
247
+
248
+    topBorderContainer: {
249
+        borderTopColor: schemeColor('border'),
250
+        borderTopWidth: 1
246
     }
251
     }
247
 });
252
 });

+ 36
- 0
react/features/recording/components/Recording/AbstractStartRecordingDialog.js Целия файл

31
      */
31
      */
32
     _fileRecordingsServiceEnabled: boolean,
32
     _fileRecordingsServiceEnabled: boolean,
33
 
33
 
34
+    /**
35
+     * Whether to show the possibility to share file recording with other people (e.g. meeting participants), based on
36
+     * the actual implementation on the backend.
37
+     */
38
+    _fileRecordingsServiceSharingEnabled: boolean,
39
+
34
     /**
40
     /**
35
      * If true the dropbox integration is enabled, otherwise - disabled.
41
      * If true the dropbox integration is enabled, otherwise - disabled.
36
      */
42
      */
69
      */
75
      */
70
     selectedRecordingService: ?string,
76
     selectedRecordingService: ?string,
71
 
77
 
78
+    /**
79
+     * True if the user requested the service to share the recording with others.
80
+     */
81
+    sharingEnabled: boolean,
82
+
72
     /**
83
     /**
73
      * Number of MiB of available space in user's Dropbox account.
84
      * Number of MiB of available space in user's Dropbox account.
74
      */
85
      */
96
         this._onSubmit = this._onSubmit.bind(this);
107
         this._onSubmit = this._onSubmit.bind(this);
97
         this._onSelectedRecordingServiceChanged
108
         this._onSelectedRecordingServiceChanged
98
             = this._onSelectedRecordingServiceChanged.bind(this);
109
             = this._onSelectedRecordingServiceChanged.bind(this);
110
+        this._onSharingSettingChanged = this._onSharingSettingChanged.bind(this);
99
 
111
 
100
         let selectedRecordingService;
112
         let selectedRecordingService;
101
 
113
 
112
             isTokenValid: false,
124
             isTokenValid: false,
113
             isValidating: false,
125
             isValidating: false,
114
             userName: undefined,
126
             userName: undefined,
127
+            sharingEnabled: true,
115
             spaceLeft: undefined,
128
             spaceLeft: undefined,
116
             selectedRecordingService
129
             selectedRecordingService
117
         };
130
         };
154
         return this.props._isDropboxEnabled;
167
         return this.props._isDropboxEnabled;
155
     }
168
     }
156
 
169
 
170
+    _onSharingSettingChanged: () => void;
171
+
172
+    /**
173
+     * Callback to handle sharing setting change from the dialog.
174
+     *
175
+     * @returns {void}
176
+     */
177
+    _onSharingSettingChanged() {
178
+        this.setState({
179
+            sharingEnabled: !this.state.sharingEnabled
180
+        });
181
+    }
182
+
157
     _onSelectedRecordingServiceChanged: (string) => void;
183
     _onSelectedRecordingServiceChanged: (string) => void;
158
 
184
 
159
     /**
185
     /**
233
             });
259
             });
234
             attributes.type = RECORDING_TYPES.DROPBOX;
260
             attributes.type = RECORDING_TYPES.DROPBOX;
235
         } else {
261
         } else {
262
+            appData = JSON.stringify({
263
+                'file_recording_metadata': {
264
+                    'share': this.state.sharingEnabled
265
+                }
266
+            });
236
             attributes.type = RECORDING_TYPES.JITSI_REC_SERVICE;
267
             attributes.type = RECORDING_TYPES.JITSI_REC_SERVICE;
237
         }
268
         }
238
 
269
 
266
  * @returns {{
297
  * @returns {{
267
  *     _appKey: string,
298
  *     _appKey: string,
268
  *     _conference: JitsiConference,
299
  *     _conference: JitsiConference,
300
+ *     _fileRecordingsServiceEnabled: boolean,
301
+ *     _fileRecordingsServiceSharingEnabled: boolean,
302
+ *     _isDropboxEnabled: boolean,
269
  *     _token: string
303
  *     _token: string
270
  * }}
304
  * }}
271
  */
305
  */
272
 export function mapStateToProps(state: Object) {
306
 export function mapStateToProps(state: Object) {
273
     const {
307
     const {
274
         fileRecordingsServiceEnabled = false,
308
         fileRecordingsServiceEnabled = false,
309
+        fileRecordingsServiceSharingEnabled = false,
275
         dropbox = {}
310
         dropbox = {}
276
     } = state['features/base/config'];
311
     } = state['features/base/config'];
277
 
312
 
279
         _appKey: dropbox.appKey,
314
         _appKey: dropbox.appKey,
280
         _conference: state['features/base/conference'].conference,
315
         _conference: state['features/base/conference'].conference,
281
         _fileRecordingsServiceEnabled: fileRecordingsServiceEnabled,
316
         _fileRecordingsServiceEnabled: fileRecordingsServiceEnabled,
317
+        _fileRecordingsServiceSharingEnabled: fileRecordingsServiceSharingEnabled,
282
         _isDropboxEnabled: isDropboxEnabled(state),
318
         _isDropboxEnabled: isDropboxEnabled(state),
283
         _token: state['features/dropbox'].token
319
         _token: state['features/dropbox'].token
284
     };
320
     };

+ 77
- 3
react/features/recording/components/Recording/StartRecordingDialogContent.js Целия файл

25
 import {
25
 import {
26
     default as styles,
26
     default as styles,
27
     DROPBOX_LOGO,
27
     DROPBOX_LOGO,
28
+    ICON_SHARE,
28
     JITSI_LOGO
29
     JITSI_LOGO
29
 } from './styles';
30
 } from './styles';
30
 
31
 
49
      */
50
      */
50
     fileRecordingsServiceEnabled: boolean,
51
     fileRecordingsServiceEnabled: boolean,
51
 
52
 
53
+    /**
54
+     * Whether to show the possibility to share file recording with other people (e.g. meeting participants), based on
55
+     * the actual implementation on the backend.
56
+     */
57
+    fileRecordingsServiceSharingEnabled: boolean,
58
+
52
     /**
59
     /**
53
      * If true the content related to the integrations will be shown.
60
      * If true the content related to the integrations will be shown.
54
      */
61
      */
70
      */
77
      */
71
     onChange: Function,
78
     onChange: Function,
72
 
79
 
80
+    /**
81
+     * Callback to be invoked on sharing setting change.
82
+     */
83
+    onSharingSettingChanged: Function,
84
+
73
     /**
85
     /**
74
      * The currently selected recording service of type: RECORDING_TYPES.
86
      * The currently selected recording service of type: RECORDING_TYPES.
75
      */
87
      */
76
     selectedRecordingService: ?string,
88
     selectedRecordingService: ?string,
77
 
89
 
90
+    /**
91
+     * Boolean to set file recording sharing on or off.
92
+     */
93
+    sharingSetting: boolean,
94
+
78
     /**
95
     /**
79
      * Number of MiB of available space in user's Dropbox account.
96
      * Number of MiB of available space in user's Dropbox account.
80
      */
97
      */
131
         );
148
         );
132
     }
149
     }
133
 
150
 
151
+    /**
152
+     * Renders the file recording service sharing options, if enabled.
153
+     *
154
+     * @returns {React$Component}
155
+     */
156
+    _renderFileSharingContent() {
157
+        if (!this.props.fileRecordingsServiceSharingEnabled) {
158
+            return null;
159
+        }
160
+
161
+        const {
162
+            _dialogStyles,
163
+            isValidating,
164
+            onSharingSettingChanged,
165
+            selectedRecordingService,
166
+            sharingSetting, t } = this.props;
167
+
168
+        const controlDisabled = selectedRecordingService !== RECORDING_TYPES.JITSI_REC_SERVICE;
169
+
170
+        return (
171
+            <Container
172
+                className = 'recording-header'
173
+                key = 'fileSharingSetting'
174
+                style = { [
175
+                    styles.header,
176
+                    _dialogStyles.topBorderContainer,
177
+                    controlDisabled ? styles.controlDisabled : null
178
+                ] }>
179
+                <Container className = 'recording-icon-container'>
180
+                    <Image
181
+                        className = 'recording-icon'
182
+                        src = { ICON_SHARE }
183
+                        style = { styles.recordingIcon } />
184
+                </Container>
185
+                <Text
186
+                    className = 'recording-title'
187
+                    style = {{
188
+                        ..._dialogStyles.text,
189
+                        ...styles.title
190
+                    }}>
191
+                    { t('recording.fileSharingdescription') }
192
+                </Text>
193
+                <Switch
194
+                    className = 'recording-switch'
195
+                    disabled = { controlDisabled || isValidating }
196
+                    onValueChange
197
+                        = { onSharingSettingChanged }
198
+                    style = { styles.switch }
199
+                    trackColor = {{ false: ColorPalette.lightGrey }}
200
+                    value = { !controlDisabled && sharingSetting } />
201
+            </Container>
202
+        );
203
+    }
204
+
134
     /**
205
     /**
135
      * Renders the content in case no integrations were enabled.
206
      * Renders the content in case no integrations were enabled.
136
      *
207
      *
162
                                 === RECORDING_TYPES.JITSI_REC_SERVICE } />
233
                                 === RECORDING_TYPES.JITSI_REC_SERVICE } />
163
                 ) : null;
234
                 ) : null;
164
 
235
 
165
-        return (
236
+        return [
166
             <Container
237
             <Container
167
                 className = 'recording-header'
238
                 className = 'recording-header'
239
+                key = 'noIntegrationSetting'
168
                 style = { styles.header }>
240
                 style = { styles.header }>
169
                 <Container className = 'recording-icon-container'>
241
                 <Container className = 'recording-icon-container'>
170
                     <Image
242
                     <Image
181
                     { t('recording.serviceDescription') }
253
                     { t('recording.serviceDescription') }
182
                 </Text>
254
                 </Text>
183
                 { switchContent }
255
                 { switchContent }
184
-            </Container>
185
-        );
256
+            </Container>,
257
+            this._renderFileSharingContent()
258
+        ];
186
     }
259
     }
187
 
260
 
188
     /**
261
     /**
267
                     className = 'authorization-panel'>
340
                     className = 'authorization-panel'>
268
                     { content }
341
                     { content }
269
                 </Container>
342
                 </Container>
343
+                { this._renderFileSharingContent() }
270
             </Container>
344
             </Container>
271
         );
345
         );
272
     }
346
     }

+ 11
- 3
react/features/recording/components/Recording/native/StartRecordingDialog.js Целия файл

28
             isTokenValid,
28
             isTokenValid,
29
             isValidating,
29
             isValidating,
30
             selectedRecordingService,
30
             selectedRecordingService,
31
+            sharingEnabled,
31
             spaceLeft,
32
             spaceLeft,
32
             userName
33
             userName
33
         } = this.state;
34
         } = this.state;
34
-        const { _fileRecordingsServiceEnabled, _isDropboxEnabled } = this.props;
35
+        const {
36
+            _fileRecordingsServiceEnabled,
37
+            _fileRecordingsServiceSharingEnabled,
38
+            _isDropboxEnabled
39
+        } = this.props;
35
 
40
 
36
         // disable ok button id recording service is shown only, when
41
         // disable ok button id recording service is shown only, when
37
         // validating dropbox token, if that is not enabled we either always
42
         // validating dropbox token, if that is not enabled we either always
46
                 okDisabled = { isOkDisabled }
51
                 okDisabled = { isOkDisabled }
47
                 onSubmit = { this._onSubmit } >
52
                 onSubmit = { this._onSubmit } >
48
                 <StartRecordingDialogContent
53
                 <StartRecordingDialogContent
49
-                    fileRecordingsServiceEnabled
50
-                        = { _fileRecordingsServiceEnabled }
54
+                    fileRecordingsServiceEnabled = { _fileRecordingsServiceEnabled }
55
+                    fileRecordingsServiceSharingEnabled = { _fileRecordingsServiceSharingEnabled }
51
                     integrationsEnabled = { this._areIntegrationsEnabled() }
56
                     integrationsEnabled = { this._areIntegrationsEnabled() }
52
                     isTokenValid = { isTokenValid }
57
                     isTokenValid = { isTokenValid }
53
                     isValidating = { isValidating }
58
                     isValidating = { isValidating }
54
                     onChange = { this._onSelectedRecordingServiceChanged }
59
                     onChange = { this._onSelectedRecordingServiceChanged }
60
+                    onSharingSettingChanged = { this._onSharingSettingChanged }
55
                     selectedRecordingService = { selectedRecordingService }
61
                     selectedRecordingService = { selectedRecordingService }
62
+                    sharingSetting = { sharingEnabled }
56
                     spaceLeft = { spaceLeft }
63
                     spaceLeft = { spaceLeft }
57
                     userName = { userName } />
64
                     userName = { userName } />
58
             </CustomSubmitDialog>
65
             </CustomSubmitDialog>
62
     _areIntegrationsEnabled: () => boolean;
69
     _areIntegrationsEnabled: () => boolean;
63
     _onSubmit: () => boolean
70
     _onSubmit: () => boolean
64
     _onSelectedRecordingServiceChanged: (string) => void;
71
     _onSelectedRecordingServiceChanged: (string) => void;
72
+    _onSharingSettingChanged: () => void;
65
 }
73
 }
66
 
74
 
67
 export default translate(connect(mapStateToProps)(StartRecordingDialog));
75
 export default translate(connect(mapStateToProps)(StartRecordingDialog));

+ 11
- 7
react/features/recording/components/Recording/styles.native.js Целия файл

1
 // @flow
1
 // @flow
2
 
2
 
3
-import { BoxModel, createStyleSheet, ColorPalette } from '../../../base/styles';
3
+import { BoxModel, ColorPalette } from '../../../base/styles';
4
 
4
 
5
 // XXX The "standard" {@code BoxModel.padding} has been deemed insufficient in
5
 // XXX The "standard" {@code BoxModel.padding} has been deemed insufficient in
6
 // the special case(s) of the recording feature bellow.
6
 // the special case(s) of the recording feature bellow.
7
 const _PADDING = BoxModel.padding * 1.5;
7
 const _PADDING = BoxModel.padding * 1.5;
8
 
8
 
9
-export const DROPBOX_LOGO
10
-    = require('../../../../../images/dropboxLogo_square.png');
9
+export const DROPBOX_LOGO = require('../../../../../images/dropboxLogo_square.png');
11
 
10
 
12
-export const JITSI_LOGO
13
-    = require('../../../../../images/jitsiLogo_square.png');
11
+export const ICON_SHARE = require('../../../../../images/icon-users.png');
12
+
13
+export const JITSI_LOGO = require('../../../../../images/jitsiLogo_square.png');
14
 
14
 
15
 /**
15
 /**
16
  * The styles of the React {@code Components} of the feature recording.
16
  * The styles of the React {@code Components} of the feature recording.
17
  */
17
  */
18
-export default createStyleSheet({
18
+export default {
19
     container: {
19
     container: {
20
         flex: 0,
20
         flex: 0,
21
         flexDirection: 'column'
21
         flexDirection: 'column'
22
     },
22
     },
23
 
23
 
24
+    controlDisabled: {
25
+        opacity: 0.5
26
+    },
27
+
24
     header: {
28
     header: {
25
         alignItems: 'center',
29
         alignItems: 'center',
26
         flex: 0,
30
         flex: 0,
62
     text: {
66
     text: {
63
         color: ColorPalette.white
67
         color: ColorPalette.white
64
     }
68
     }
65
-});
69
+};

+ 2
- 0
react/features/recording/components/Recording/styles.web.js Целия файл

4
 
4
 
5
 export const DROPBOX_LOGO = 'images/dropboxLogo_square.png';
5
 export const DROPBOX_LOGO = 'images/dropboxLogo_square.png';
6
 
6
 
7
+export const ICON_SHARE = 'images/icon-users.png';
8
+
7
 export const JITSI_LOGO = 'images/jitsiLogo_square.png';
9
 export const JITSI_LOGO = 'images/jitsiLogo_square.png';

+ 7
- 3
react/features/recording/components/Recording/web/StartRecordingDialog.js Целия файл

28
             isTokenValid,
28
             isTokenValid,
29
             isValidating,
29
             isValidating,
30
             selectedRecordingService,
30
             selectedRecordingService,
31
+            sharingEnabled,
31
             spaceLeft,
32
             spaceLeft,
32
             userName
33
             userName
33
         } = this.state;
34
         } = this.state;
34
-        const { _fileRecordingsServiceEnabled, _isDropboxEnabled } = this.props;
35
+        const { _fileRecordingsServiceEnabled, _fileRecordingsServiceSharingEnabled, _isDropboxEnabled } = this.props;
35
 
36
 
36
         // disable ok button id recording service is shown only, when
37
         // disable ok button id recording service is shown only, when
37
         // validating dropbox token, if that is not enabled we either always
38
         // validating dropbox token, if that is not enabled we either always
49
                 titleKey = 'dialog.startRecording'
50
                 titleKey = 'dialog.startRecording'
50
                 width = 'small'>
51
                 width = 'small'>
51
                 <StartRecordingDialogContent
52
                 <StartRecordingDialogContent
52
-                    fileRecordingsServiceEnabled
53
-                        = { _fileRecordingsServiceEnabled }
53
+                    fileRecordingsServiceEnabled = { _fileRecordingsServiceEnabled }
54
+                    fileRecordingsServiceSharingEnabled = { _fileRecordingsServiceSharingEnabled }
54
                     integrationsEnabled = { this._areIntegrationsEnabled() }
55
                     integrationsEnabled = { this._areIntegrationsEnabled() }
55
                     isTokenValid = { isTokenValid }
56
                     isTokenValid = { isTokenValid }
56
                     isValidating = { isValidating }
57
                     isValidating = { isValidating }
57
                     onChange = { this._onSelectedRecordingServiceChanged }
58
                     onChange = { this._onSelectedRecordingServiceChanged }
59
+                    onSharingSettingChanged = { this._onSharingSettingChanged }
58
                     selectedRecordingService = { selectedRecordingService }
60
                     selectedRecordingService = { selectedRecordingService }
61
+                    sharingSetting = { sharingEnabled }
59
                     spaceLeft = { spaceLeft }
62
                     spaceLeft = { spaceLeft }
60
                     userName = { userName } />
63
                     userName = { userName } />
61
             </Dialog>
64
             </Dialog>
65
     _areIntegrationsEnabled: () => boolean;
68
     _areIntegrationsEnabled: () => boolean;
66
     _onSubmit: () => boolean;
69
     _onSubmit: () => boolean;
67
     _onSelectedRecordingServiceChanged: (string) => void;
70
     _onSelectedRecordingServiceChanged: (string) => void;
71
+    _onSharingSettingChanged: () => void;
68
 }
72
 }
69
 
73
 
70
 export default translate(connect(mapStateToProps)(StartRecordingDialog));
74
 export default translate(connect(mapStateToProps)(StartRecordingDialog));

Loading…
Отказ
Запис