|
@@ -10,8 +10,6 @@ import {
|
10
|
10
|
getLocalParticipant
|
11
|
11
|
} from '../../../base/participants';
|
12
|
12
|
|
13
|
|
-import { updateDialInNumbers } from '../../actions';
|
14
|
|
-
|
15
|
13
|
import DialInNumber from './DialInNumber';
|
16
|
14
|
import PasswordForm from './PasswordForm';
|
17
|
15
|
|
|
@@ -24,15 +22,6 @@ const logger = require('jitsi-meet-logger').getLogger(__filename);
|
24
|
22
|
* @extends Component
|
25
|
23
|
*/
|
26
|
24
|
class InfoDialog extends Component {
|
27
|
|
- /**
|
28
|
|
- * Default values for {@code InfoDialog} component's properties.
|
29
|
|
- *
|
30
|
|
- * @static
|
31
|
|
- */
|
32
|
|
- static defaultProps = {
|
33
|
|
- autoUpdateNumbers: true
|
34
|
|
- };
|
35
|
|
-
|
36
|
25
|
/**
|
37
|
26
|
* {@code InfoDialog} component's property types.
|
38
|
27
|
*
|
|
@@ -57,11 +46,6 @@ class InfoDialog extends Component {
|
57
|
46
|
*/
|
58
|
47
|
_conferenceName: PropTypes.string,
|
59
|
48
|
|
60
|
|
- /**
|
61
|
|
- * The redux state representing the dial-in numbers feature.
|
62
|
|
- */
|
63
|
|
- _dialIn: PropTypes.object,
|
64
|
|
-
|
65
|
49
|
/**
|
66
|
50
|
* The current url of the conference to be copied onto the clipboard.
|
67
|
51
|
*/
|
|
@@ -79,17 +63,20 @@ class InfoDialog extends Component {
|
79
|
63
|
_password: PropTypes.string,
|
80
|
64
|
|
81
|
65
|
/**
|
82
|
|
- * Whether or not this component should make a request for dial-in
|
83
|
|
- * numbers. If false, this component will rely on an outside source
|
84
|
|
- * updating and passing in numbers through the _dialIn prop.
|
|
66
|
+ * The object representing the dialIn feature.
|
85
|
67
|
*/
|
86
|
|
- autoUpdateNumbers: PropTypes.bool,
|
|
68
|
+ dialIn: PropTypes.object,
|
87
|
69
|
|
88
|
70
|
/**
|
89
|
71
|
* Invoked to open a dialog for adding participants to the conference.
|
90
|
72
|
*/
|
91
|
73
|
dispatch: PropTypes.func,
|
92
|
74
|
|
|
75
|
+ /**
|
|
76
|
+ * The current known URL for a live stream in progress.
|
|
77
|
+ */
|
|
78
|
+ liveStreamViewURL: PropTypes.string,
|
|
79
|
+
|
93
|
80
|
/**
|
94
|
81
|
* Callback invoked when the dialog should be closed.
|
95
|
82
|
*/
|
|
@@ -129,7 +116,7 @@ class InfoDialog extends Component {
|
129
|
116
|
constructor(props) {
|
130
|
117
|
super(props);
|
131
|
118
|
|
132
|
|
- const { defaultCountry, numbers } = props._dialIn;
|
|
119
|
+ const { defaultCountry, numbers } = props.dialIn;
|
133
|
120
|
|
134
|
121
|
if (numbers) {
|
135
|
122
|
this.state.phoneNumber
|
|
@@ -147,7 +134,7 @@ class InfoDialog extends Component {
|
147
|
134
|
this._copyElement = null;
|
148
|
135
|
|
149
|
136
|
// Bind event handlers so they are only bound once for every instance.
|
150
|
|
- this._onClickInviteURL = this._onClickInviteURL.bind(this);
|
|
137
|
+ this._onClickURLText = this._onClickURLText.bind(this);
|
151
|
138
|
this._onCopyInviteURL = this._onCopyInviteURL.bind(this);
|
152
|
139
|
this._onPasswordRemove = this._onPasswordRemove.bind(this);
|
153
|
140
|
this._onPasswordSubmit = this._onPasswordSubmit.bind(this);
|
|
@@ -156,20 +143,6 @@ class InfoDialog extends Component {
|
156
|
143
|
this._setCopyElement = this._setCopyElement.bind(this);
|
157
|
144
|
}
|
158
|
145
|
|
159
|
|
- /**
|
160
|
|
- * Implements {@link Component#componentDidMount()}. Invoked immediately
|
161
|
|
- * after this component is mounted. Requests dial-in numbers if not
|
162
|
|
- * already known.
|
163
|
|
- *
|
164
|
|
- * @inheritdoc
|
165
|
|
- * @returns {void}
|
166
|
|
- */
|
167
|
|
- componentDidMount() {
|
168
|
|
- if (!this.state.phoneNumber && this.props.autoUpdateNumbers) {
|
169
|
|
- this.props.dispatch(updateDialInNumbers());
|
170
|
|
- }
|
171
|
|
- }
|
172
|
|
-
|
173
|
146
|
/**
|
174
|
147
|
* Implements React's {@link Component#componentWillReceiveProps()}. Invoked
|
175
|
148
|
* before this mounted component receives new props.
|
|
@@ -182,8 +155,8 @@ class InfoDialog extends Component {
|
182
|
155
|
this.setState({ passwordEditEnabled: false });
|
183
|
156
|
}
|
184
|
157
|
|
185
|
|
- if (!this.state.phoneNumber && nextProps._dialIn.numbers) {
|
186
|
|
- const { defaultCountry, numbers } = nextProps._dialIn;
|
|
158
|
+ if (!this.state.phoneNumber && nextProps.dialIn.numbers) {
|
|
159
|
+ const { defaultCountry, numbers } = nextProps.dialIn;
|
187
|
160
|
|
188
|
161
|
this.setState({
|
189
|
162
|
phoneNumber:
|
|
@@ -199,7 +172,7 @@ class InfoDialog extends Component {
|
199
|
172
|
* @returns {ReactElement}
|
200
|
173
|
*/
|
201
|
174
|
render() {
|
202
|
|
- const { onMouseOver, t } = this.props;
|
|
175
|
+ const { liveStreamViewURL, onMouseOver, t } = this.props;
|
203
|
176
|
|
204
|
177
|
return (
|
205
|
178
|
<div
|
|
@@ -221,9 +194,9 @@ class InfoDialog extends Component {
|
221
|
194
|
<span className = 'spacer'> </span>
|
222
|
195
|
<span className = 'info-value'>
|
223
|
196
|
<a
|
224
|
|
- className = 'info-dialog-invite-link'
|
|
197
|
+ className = 'info-dialog-url-text'
|
225
|
198
|
href = { this.props._inviteURL }
|
226
|
|
- onClick = { this._onClickInviteURL } >
|
|
199
|
+ onClick = { this._onClickURLText } >
|
227
|
200
|
{ this._getURLToDisplay() }
|
228
|
201
|
</a>
|
229
|
202
|
</span>
|
|
@@ -231,6 +204,7 @@ class InfoDialog extends Component {
|
231
|
204
|
<div className = 'info-dialog-dial-in'>
|
232
|
205
|
{ this._renderDialInDisplay() }
|
233
|
206
|
</div>
|
|
207
|
+ { liveStreamViewURL && this._renderLiveStreamURL() }
|
234
|
208
|
<div className = 'info-dialog-password'>
|
235
|
209
|
<PasswordForm
|
236
|
210
|
editEnabled = { this.state.passwordEditEnabled }
|
|
@@ -321,16 +295,24 @@ class InfoDialog extends Component {
|
321
|
295
|
* @returns {string}
|
322
|
296
|
*/
|
323
|
297
|
_getTextToCopy() {
|
324
|
|
- const { t } = this.props;
|
|
298
|
+ const { liveStreamViewURL, t } = this.props;
|
325
|
299
|
|
326
|
300
|
let invite = t('info.inviteURL', {
|
327
|
301
|
url: this.props._inviteURL
|
328
|
302
|
});
|
329
|
303
|
|
|
304
|
+ if (liveStreamViewURL) {
|
|
305
|
+ const liveStream = t('info.inviteLiveStream', {
|
|
306
|
+ url: liveStreamViewURL
|
|
307
|
+ });
|
|
308
|
+
|
|
309
|
+ invite = `${invite}\n${liveStream}`;
|
|
310
|
+ }
|
|
311
|
+
|
330
|
312
|
if (this._shouldDisplayDialIn()) {
|
331
|
313
|
const dial = t('info.invitePhone', {
|
332
|
314
|
number: this.state.phoneNumber,
|
333
|
|
- conferenceID: this.props._dialIn.conferenceID
|
|
315
|
+ conferenceID: this.props.dialIn.conferenceID
|
334
|
316
|
});
|
335
|
317
|
const moreNumbers = t('info.invitePhoneAlternatives', {
|
336
|
318
|
url: this._getDialInfoPageURL()
|
|
@@ -353,16 +335,16 @@ class InfoDialog extends Component {
|
353
|
335
|
}
|
354
|
336
|
|
355
|
337
|
/**
|
356
|
|
- * Callback invoked when the displayed invite URL link is clicked to prevent
|
357
|
|
- * actual navigation from happening. The invite URL link has an href to
|
358
|
|
- * display "Copy Link Address" in the context menu but otherwise it should
|
359
|
|
- * not behave like a link.
|
|
338
|
+ * Callback invoked when a displayed URL link is clicked to prevent actual
|
|
339
|
+ * navigation from happening. The URL links have an href to display "Copy
|
|
340
|
+ * Link Address" in the context menu but otherwise it should not behave like
|
|
341
|
+ * links.
|
360
|
342
|
*
|
361
|
343
|
* @param {Object} event - The click event from clicking on the link.
|
362
|
344
|
* @private
|
363
|
345
|
* @returns {void}
|
364
|
346
|
*/
|
365
|
|
- _onClickInviteURL(event) {
|
|
347
|
+ _onClickURLText(event) {
|
366
|
348
|
event.preventDefault();
|
367
|
349
|
}
|
368
|
350
|
|
|
@@ -439,7 +421,7 @@ class InfoDialog extends Component {
|
439
|
421
|
return (
|
440
|
422
|
<div>
|
441
|
423
|
<DialInNumber
|
442
|
|
- conferenceID = { this.props._dialIn.conferenceID }
|
|
424
|
+ conferenceID = { this.props.dialIn.conferenceID }
|
443
|
425
|
phoneNumber = { this.state.phoneNumber } />
|
444
|
426
|
<a
|
445
|
427
|
className = 'more-numbers'
|
|
@@ -490,6 +472,34 @@ class InfoDialog extends Component {
|
490
|
472
|
: null;
|
491
|
473
|
}
|
492
|
474
|
|
|
475
|
+ /**
|
|
476
|
+ * Returns a ReactElement for display a link to the current url of a
|
|
477
|
+ * live stream in progress.
|
|
478
|
+ *
|
|
479
|
+ * @private
|
|
480
|
+ * @returns {null|ReactElement}
|
|
481
|
+ */
|
|
482
|
+ _renderLiveStreamURL() {
|
|
483
|
+ const { liveStreamViewURL, t } = this.props;
|
|
484
|
+
|
|
485
|
+ return (
|
|
486
|
+ <div className = 'info-dialog-live-stream-url'>
|
|
487
|
+ <span className = 'info-label'>
|
|
488
|
+ { t('info.liveStreamURL') }
|
|
489
|
+ </span>
|
|
490
|
+ <span className = 'spacer'> </span>
|
|
491
|
+ <span className = 'info-value'>
|
|
492
|
+ <a
|
|
493
|
+ className = 'info-dialog-url-text'
|
|
494
|
+ href = { liveStreamViewURL }
|
|
495
|
+ onClick = { this._onClickURLText } >
|
|
496
|
+ { liveStreamViewURL }
|
|
497
|
+ </a>
|
|
498
|
+ </span>
|
|
499
|
+ </div>
|
|
500
|
+ );
|
|
501
|
+ }
|
|
502
|
+
|
493
|
503
|
/**
|
494
|
504
|
* Returns whether or not dial-in related UI should be displayed.
|
495
|
505
|
*
|
|
@@ -497,7 +507,7 @@ class InfoDialog extends Component {
|
497
|
507
|
* @returns {boolean}
|
498
|
508
|
*/
|
499
|
509
|
_shouldDisplayDialIn() {
|
500
|
|
- const { conferenceID, numbers, numbersEnabled } = this.props._dialIn;
|
|
510
|
+ const { conferenceID, numbers, numbersEnabled } = this.props.dialIn;
|
501
|
511
|
const { phoneNumber } = this.state;
|
502
|
512
|
|
503
|
513
|
return Boolean(
|
|
@@ -531,7 +541,6 @@ class InfoDialog extends Component {
|
531
|
541
|
* _canEditPassword: boolean,
|
532
|
542
|
* _conference: Object,
|
533
|
543
|
* _conferenceName: string,
|
534
|
|
- * _dialIn: Object,
|
535
|
544
|
* _inviteURL: string,
|
536
|
545
|
* _locked: string,
|
537
|
546
|
* _password: string
|
|
@@ -558,7 +567,6 @@ function _mapStateToProps(state) {
|
558
|
567
|
_canEditPassword: canEditPassword,
|
559
|
568
|
_conference: conference,
|
560
|
569
|
_conferenceName: room,
|
561
|
|
- _dialIn: state['features/invite'],
|
562
|
570
|
_inviteURL: getInviteURL(state),
|
563
|
571
|
_locked: locked,
|
564
|
572
|
_password: password
|