|
@@ -1,13 +1,11 @@
|
1
|
1
|
// @flow
|
2
|
2
|
|
3
|
|
-import InlineMessage from '@atlaskit/inline-message';
|
4
|
3
|
import React, { Component } from 'react';
|
5
|
4
|
import type { Dispatch } from 'redux';
|
6
|
5
|
|
7
|
6
|
import { createToolbarEvent, sendAnalytics } from '../../analytics';
|
8
|
7
|
import { setAudioOnly } from '../../base/audio-only';
|
9
|
8
|
import { translate } from '../../base/i18n';
|
10
|
|
-import JitsiMeetJS from '../../base/lib-jitsi-meet';
|
11
|
9
|
import { connect } from '../../base/redux';
|
12
|
10
|
import { setPreferredVideoQuality } from '../actions';
|
13
|
11
|
import { VIDEO_QUALITY_LEVELS } from '../constants';
|
|
@@ -57,12 +55,6 @@ type Props = {
|
57
|
55
|
*/
|
58
|
56
|
_sendrecvVideoQuality: Number,
|
59
|
57
|
|
60
|
|
- /**
|
61
|
|
- * Whether or not displaying video is supported in the current
|
62
|
|
- * environment. If false, the slider will be disabled.
|
63
|
|
- */
|
64
|
|
- _videoSupported: Boolean,
|
65
|
|
-
|
66
|
58
|
/**
|
67
|
59
|
* Invoked to request toggling of audio only mode.
|
68
|
60
|
*/
|
|
@@ -141,25 +133,14 @@ class VideoQualitySlider extends Component<Props> {
|
141
|
133
|
* @returns {ReactElement}
|
142
|
134
|
*/
|
143
|
135
|
render() {
|
144
|
|
- const { _videoSupported, t } = this.props;
|
|
136
|
+ const { t } = this.props;
|
145
|
137
|
const activeSliderOption = this._mapCurrentQualityToSliderValue();
|
146
|
138
|
|
147
|
|
- let classNames = 'video-quality-dialog';
|
148
|
|
- let warning = null;
|
149
|
|
-
|
150
|
|
- if (!_videoSupported) {
|
151
|
|
- classNames += ' video-not-supported';
|
152
|
|
- warning = this._renderAudioOnlyLockedMessage();
|
153
|
|
- }
|
154
|
|
-
|
155
|
139
|
return (
|
156
|
|
- <div className = { classNames }>
|
|
140
|
+ <div className = { 'video-quality-dialog' }>
|
157
|
141
|
<h3 className = 'video-quality-dialog-title'>
|
158
|
142
|
{ t('videoStatus.callQuality') }
|
159
|
143
|
</h3>
|
160
|
|
- <div className = { warning ? '' : 'hide-warning' }>
|
161
|
|
- { warning }
|
162
|
|
- </div>
|
163
|
144
|
<div className = 'video-quality-dialog-contents'>
|
164
|
145
|
<div className = 'video-quality-dialog-slider-container'>
|
165
|
146
|
{ /* FIXME: onChange and onMouseUp are both used for
|
|
@@ -168,7 +149,6 @@ class VideoQualitySlider extends Component<Props> {
|
168
|
149
|
*/ }
|
169
|
150
|
<input
|
170
|
151
|
className = 'video-quality-dialog-slider'
|
171
|
|
- disabled = { !_videoSupported }
|
172
|
152
|
max = { this._sliderOptions.length - 1 }
|
173
|
153
|
min = '0'
|
174
|
154
|
onChange = { this._onSliderChange }
|
|
@@ -187,24 +167,6 @@ class VideoQualitySlider extends Component<Props> {
|
187
|
167
|
);
|
188
|
168
|
}
|
189
|
169
|
|
190
|
|
- /**
|
191
|
|
- * Creates a React Element for notifying that the browser is in audio only
|
192
|
|
- * and cannot be changed.
|
193
|
|
- *
|
194
|
|
- * @private
|
195
|
|
- * @returns {ReactElement}
|
196
|
|
- */
|
197
|
|
- _renderAudioOnlyLockedMessage() {
|
198
|
|
- const { t } = this.props;
|
199
|
|
-
|
200
|
|
- return (
|
201
|
|
- <InlineMessage
|
202
|
|
- title = { t('videoStatus.onlyAudioAvailable') }>
|
203
|
|
- { t('videoStatus.onlyAudioSupported') }
|
204
|
|
- </InlineMessage>
|
205
|
|
- );
|
206
|
|
- }
|
207
|
|
-
|
208
|
170
|
/**
|
209
|
171
|
* Creates React Elements to display mock tick marks with associated labels.
|
210
|
172
|
*
|
|
@@ -393,11 +355,7 @@ class VideoQualitySlider extends Component<Props> {
|
393
|
355
|
*
|
394
|
356
|
* @param {Object} state - The Redux state.
|
395
|
357
|
* @private
|
396
|
|
- * @returns {{
|
397
|
|
- * _audioOnly: boolean,
|
398
|
|
- * _p2p: boolean,
|
399
|
|
- * _sendrecvVideoQuality: number
|
400
|
|
- * }}
|
|
358
|
+ * @returns {Props}
|
401
|
359
|
*/
|
402
|
360
|
function _mapStateToProps(state) {
|
403
|
361
|
const { enabled: audioOnly } = state['features/base/audio-only'];
|
|
@@ -407,8 +365,7 @@ function _mapStateToProps(state) {
|
407
|
365
|
return {
|
408
|
366
|
_audioOnly: audioOnly,
|
409
|
367
|
_p2p: p2p,
|
410
|
|
- _sendrecvVideoQuality: preferredVideoQuality,
|
411
|
|
- _videoSupported: JitsiMeetJS.mediaDevices.supportsVideo()
|
|
368
|
+ _sendrecvVideoQuality: preferredVideoQuality
|
412
|
369
|
};
|
413
|
370
|
}
|
414
|
371
|
|