|
@@ -9,9 +9,12 @@ import {
|
9
|
9
|
} from '../../../analytics';
|
10
|
10
|
import { Dialog } from '../../../base/dialog';
|
11
|
11
|
import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
|
|
12
|
+import {
|
|
13
|
+ getDropboxData,
|
|
14
|
+ isEnabled as isDropboxEnabled
|
|
15
|
+} from '../../../dropbox';
|
12
|
16
|
|
13
|
17
|
import StartRecordingDialogContent from './StartRecordingDialogContent';
|
14
|
|
-import { getDropboxData } from '../../../dropbox';
|
15
|
18
|
|
16
|
19
|
type Props = {
|
17
|
20
|
|
|
@@ -25,6 +28,11 @@ type Props = {
|
25
|
28
|
*/
|
26
|
29
|
_appKey: string,
|
27
|
30
|
|
|
31
|
+ /**
|
|
32
|
+ * If true the dropbox integration is enabled, otherwise - disabled.
|
|
33
|
+ */
|
|
34
|
+ _isDropboxEnabled: boolean,
|
|
35
|
+
|
28
|
36
|
/**
|
29
|
37
|
* The dropbox access token.
|
30
|
38
|
*/
|
|
@@ -117,7 +125,11 @@ class StartRecordingDialog extends Component<Props, State> {
|
117
|
125
|
* @returns {void}
|
118
|
126
|
*/
|
119
|
127
|
_onTokenUpdated() {
|
120
|
|
- const { _appKey, _token } = this.props;
|
|
128
|
+ const { _appKey, _isDropboxEnabled, _token } = this.props;
|
|
129
|
+
|
|
130
|
+ if (!_isDropboxEnabled) {
|
|
131
|
+ return;
|
|
132
|
+ }
|
121
|
133
|
|
122
|
134
|
if (typeof _token === 'undefined') {
|
123
|
135
|
this.setState({
|
|
@@ -154,15 +166,17 @@ class StartRecordingDialog extends Component<Props, State> {
|
154
|
166
|
*/
|
155
|
167
|
render() {
|
156
|
168
|
const { isTokenValid, isValidating, spaceLeft, userName } = this.state;
|
|
169
|
+ const { _isDropboxEnabled } = this.props;
|
157
|
170
|
|
158
|
171
|
return (
|
159
|
172
|
<Dialog
|
160
|
|
- okDisabled = { !isTokenValid }
|
|
173
|
+ okDisabled = { !isTokenValid && _isDropboxEnabled }
|
161
|
174
|
okTitleKey = 'dialog.confirm'
|
162
|
175
|
onSubmit = { this._onSubmit }
|
163
|
176
|
titleKey = 'dialog.recording'
|
164
|
177
|
width = 'small'>
|
165
|
178
|
<StartRecordingDialogContent
|
|
179
|
+ integrationsEnabled = { _isDropboxEnabled }
|
166
|
180
|
isTokenValid = { isTokenValid }
|
167
|
181
|
isValidating = { isValidating }
|
168
|
182
|
spaceLeft = { spaceLeft }
|
|
@@ -183,18 +197,23 @@ class StartRecordingDialog extends Component<Props, State> {
|
183
|
197
|
sendAnalytics(
|
184
|
198
|
createRecordingDialogEvent('start', 'confirm.button')
|
185
|
199
|
);
|
186
|
|
- const { _conference, _token } = this.props;
|
|
200
|
+ const { _conference, _isDropboxEnabled, _token } = this.props;
|
|
201
|
+ let appData;
|
187
|
202
|
|
188
|
|
- _conference.startRecording({
|
189
|
|
- mode: JitsiRecordingConstants.mode.FILE,
|
190
|
|
- appData: JSON.stringify({
|
|
203
|
+ if (_isDropboxEnabled) {
|
|
204
|
+ appData = JSON.stringify({
|
191
|
205
|
'file_recording_metadata': {
|
192
|
206
|
'upload_credentials': {
|
193
|
207
|
'service_name': 'dropbox',
|
194
|
208
|
'token': _token
|
195
|
209
|
}
|
196
|
210
|
}
|
197
|
|
- })
|
|
211
|
+ });
|
|
212
|
+ }
|
|
213
|
+
|
|
214
|
+ _conference.startRecording({
|
|
215
|
+ mode: JitsiRecordingConstants.mode.FILE,
|
|
216
|
+ appData
|
198
|
217
|
});
|
199
|
218
|
|
200
|
219
|
return true;
|
|
@@ -227,6 +246,7 @@ function mapStateToProps(state: Object) {
|
227
|
246
|
return {
|
228
|
247
|
_appKey: dropbox.appKey,
|
229
|
248
|
_conference: state['features/base/conference'].conference,
|
|
249
|
+ _isDropboxEnabled: isDropboxEnabled(state),
|
230
|
250
|
_token: state['features/dropbox'].token
|
231
|
251
|
};
|
232
|
252
|
}
|