Browse Source

Add recording file sharing switch

master
Bettenbuk Zoltan 5 years ago
parent
commit
b7198ba4b3

BIN
images/icon-users.png View File


+ 1
- 0
lang/main.json View File

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

+ 5
- 0
react/features/base/dialog/components/native/styles.js View File

@@ -243,5 +243,10 @@ ColorSchemeRegistry.register('Dialog', {
243 243
 
244 244
     text: {
245 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 View File

@@ -31,6 +31,12 @@ type Props = {
31 31
      */
32 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 41
      * If true the dropbox integration is enabled, otherwise - disabled.
36 42
      */
@@ -69,6 +75,11 @@ type State = {
69 75
      */
70 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 84
      * Number of MiB of available space in user's Dropbox account.
74 85
      */
@@ -96,6 +107,7 @@ class AbstractStartRecordingDialog extends Component<Props, State> {
96 107
         this._onSubmit = this._onSubmit.bind(this);
97 108
         this._onSelectedRecordingServiceChanged
98 109
             = this._onSelectedRecordingServiceChanged.bind(this);
110
+        this._onSharingSettingChanged = this._onSharingSettingChanged.bind(this);
99 111
 
100 112
         let selectedRecordingService;
101 113
 
@@ -112,6 +124,7 @@ class AbstractStartRecordingDialog extends Component<Props, State> {
112 124
             isTokenValid: false,
113 125
             isValidating: false,
114 126
             userName: undefined,
127
+            sharingEnabled: true,
115 128
             spaceLeft: undefined,
116 129
             selectedRecordingService
117 130
         };
@@ -154,6 +167,19 @@ class AbstractStartRecordingDialog extends Component<Props, State> {
154 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 183
     _onSelectedRecordingServiceChanged: (string) => void;
158 184
 
159 185
     /**
@@ -233,6 +259,11 @@ class AbstractStartRecordingDialog extends Component<Props, State> {
233 259
             });
234 260
             attributes.type = RECORDING_TYPES.DROPBOX;
235 261
         } else {
262
+            appData = JSON.stringify({
263
+                'file_recording_metadata': {
264
+                    'share': this.state.sharingEnabled
265
+                }
266
+            });
236 267
             attributes.type = RECORDING_TYPES.JITSI_REC_SERVICE;
237 268
         }
238 269
 
@@ -266,12 +297,16 @@ class AbstractStartRecordingDialog extends Component<Props, State> {
266 297
  * @returns {{
267 298
  *     _appKey: string,
268 299
  *     _conference: JitsiConference,
300
+ *     _fileRecordingsServiceEnabled: boolean,
301
+ *     _fileRecordingsServiceSharingEnabled: boolean,
302
+ *     _isDropboxEnabled: boolean,
269 303
  *     _token: string
270 304
  * }}
271 305
  */
272 306
 export function mapStateToProps(state: Object) {
273 307
     const {
274 308
         fileRecordingsServiceEnabled = false,
309
+        fileRecordingsServiceSharingEnabled = false,
275 310
         dropbox = {}
276 311
     } = state['features/base/config'];
277 312
 
@@ -279,6 +314,7 @@ export function mapStateToProps(state: Object) {
279 314
         _appKey: dropbox.appKey,
280 315
         _conference: state['features/base/conference'].conference,
281 316
         _fileRecordingsServiceEnabled: fileRecordingsServiceEnabled,
317
+        _fileRecordingsServiceSharingEnabled: fileRecordingsServiceSharingEnabled,
282 318
         _isDropboxEnabled: isDropboxEnabled(state),
283 319
         _token: state['features/dropbox'].token
284 320
     };

+ 77
- 3
react/features/recording/components/Recording/StartRecordingDialogContent.js View File

@@ -25,6 +25,7 @@ import { authorizeDropbox, updateDropboxToken } from '../../../dropbox';
25 25
 import {
26 26
     default as styles,
27 27
     DROPBOX_LOGO,
28
+    ICON_SHARE,
28 29
     JITSI_LOGO
29 30
 } from './styles';
30 31
 
@@ -49,6 +50,12 @@ type Props = {
49 50
      */
50 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 60
      * If true the content related to the integrations will be shown.
54 61
      */
@@ -70,11 +77,21 @@ type Props = {
70 77
      */
71 78
     onChange: Function,
72 79
 
80
+    /**
81
+     * Callback to be invoked on sharing setting change.
82
+     */
83
+    onSharingSettingChanged: Function,
84
+
73 85
     /**
74 86
      * The currently selected recording service of type: RECORDING_TYPES.
75 87
      */
76 88
     selectedRecordingService: ?string,
77 89
 
90
+    /**
91
+     * Boolean to set file recording sharing on or off.
92
+     */
93
+    sharingSetting: boolean,
94
+
78 95
     /**
79 96
      * Number of MiB of available space in user's Dropbox account.
80 97
      */
@@ -131,6 +148,60 @@ class StartRecordingDialogContent extends Component<Props> {
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 206
      * Renders the content in case no integrations were enabled.
136 207
      *
@@ -162,9 +233,10 @@ class StartRecordingDialogContent extends Component<Props> {
162 233
                                 === RECORDING_TYPES.JITSI_REC_SERVICE } />
163 234
                 ) : null;
164 235
 
165
-        return (
236
+        return [
166 237
             <Container
167 238
                 className = 'recording-header'
239
+                key = 'noIntegrationSetting'
168 240
                 style = { styles.header }>
169 241
                 <Container className = 'recording-icon-container'>
170 242
                     <Image
@@ -181,8 +253,9 @@ class StartRecordingDialogContent extends Component<Props> {
181 253
                     { t('recording.serviceDescription') }
182 254
                 </Text>
183 255
                 { switchContent }
184
-            </Container>
185
-        );
256
+            </Container>,
257
+            this._renderFileSharingContent()
258
+        ];
186 259
     }
187 260
 
188 261
     /**
@@ -267,6 +340,7 @@ class StartRecordingDialogContent extends Component<Props> {
267 340
                     className = 'authorization-panel'>
268 341
                     { content }
269 342
                 </Container>
343
+                { this._renderFileSharingContent() }
270 344
             </Container>
271 345
         );
272 346
     }

+ 11
- 3
react/features/recording/components/Recording/native/StartRecordingDialog.js View File

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

+ 11
- 7
react/features/recording/components/Recording/styles.native.js View File

@@ -1,26 +1,30 @@
1 1
 // @flow
2 2
 
3
-import { BoxModel, createStyleSheet, ColorPalette } from '../../../base/styles';
3
+import { BoxModel, ColorPalette } from '../../../base/styles';
4 4
 
5 5
 // XXX The "standard" {@code BoxModel.padding} has been deemed insufficient in
6 6
 // the special case(s) of the recording feature bellow.
7 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 16
  * The styles of the React {@code Components} of the feature recording.
17 17
  */
18
-export default createStyleSheet({
18
+export default {
19 19
     container: {
20 20
         flex: 0,
21 21
         flexDirection: 'column'
22 22
     },
23 23
 
24
+    controlDisabled: {
25
+        opacity: 0.5
26
+    },
27
+
24 28
     header: {
25 29
         alignItems: 'center',
26 30
         flex: 0,
@@ -62,4 +66,4 @@ export default createStyleSheet({
62 66
     text: {
63 67
         color: ColorPalette.white
64 68
     }
65
-});
69
+};

+ 2
- 0
react/features/recording/components/Recording/styles.web.js View File

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

+ 7
- 3
react/features/recording/components/Recording/web/StartRecordingDialog.js View File

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

Loading…
Cancel
Save