Selaa lähdekoodia

ref(video-quality): rename receiveVideoQuality to preferredReceiverVideoQuality

- "preferred" is being appended because in tile view there is a
  concept of what the user prefers to be the maximum video quality
  but there is also a maximum respected internall. For example,
  the user may prefer HD, but in tile view the tiles may be small
  so internall the preferred would be set to LD.
- "receive" is being renamed to "receiver" to be consistent with
  the naming in lib-jitsi-meet.
master
Leonard Kim 6 vuotta sitten
vanhempi
commit
4d3383c620

+ 4
- 3
react/features/base/conference/actionTypes.js Näytä tiedosto

181
  * received from remote participants.
181
  * received from remote participants.
182
  *
182
  *
183
  * {
183
  * {
184
- *     type: SET_RECEIVE_VIDEO_QUALITY,
185
- *     receiveVideoQuality: number
184
+ *     type: SET_PREFERRED_RECEIVER_VIDEO_QUALITY,
185
+ *     preferredReceiverVideoQuality: number
186
  * }
186
  * }
187
  */
187
  */
188
-export const SET_RECEIVE_VIDEO_QUALITY = Symbol('SET_RECEIVE_VIDEO_QUALITY');
188
+export const SET_PREFERRED_RECEIVER_VIDEO_QUALITY
189
+    = Symbol('SET_PREFERRED_RECEIVER_VIDEO_QUALITY');
189
 
190
 
190
 /**
191
 /**
191
  * The type of (redux) action which sets the name of the room of the
192
  * The type of (redux) action which sets the name of the room of the

+ 9
- 7
react/features/base/conference/actions.js Näytä tiedosto

39
     SET_LASTN,
39
     SET_LASTN,
40
     SET_PASSWORD,
40
     SET_PASSWORD,
41
     SET_PASSWORD_FAILED,
41
     SET_PASSWORD_FAILED,
42
-    SET_RECEIVE_VIDEO_QUALITY,
42
+    SET_PREFERRED_RECEIVER_VIDEO_QUALITY,
43
     SET_ROOM,
43
     SET_ROOM,
44
     SET_START_MUTED_POLICY
44
     SET_START_MUTED_POLICY
45
 } from './actionTypes';
45
 } from './actionTypes';
643
 /**
643
 /**
644
  * Sets the max frame height to receive from remote participant videos.
644
  * Sets the max frame height to receive from remote participant videos.
645
  *
645
  *
646
- * @param {number} receiveVideoQuality - The max video resolution to receive.
646
+ * @param {number} preferredReceiverVideoQuality - The max video resolution to
647
+ * receive.
647
  * @returns {{
648
  * @returns {{
648
- *     type: SET_RECEIVE_VIDEO_QUALITY,
649
- *     receiveVideoQuality: number
649
+ *     type: SET_PREFERRED_RECEIVER_VIDEO_QUALITY,
650
+ *     preferredReceiverVideoQuality: number
650
  * }}
651
  * }}
651
  */
652
  */
652
-export function setReceiveVideoQuality(receiveVideoQuality: number) {
653
+export function setPreferredReceiverVideoQuality(
654
+        preferredReceiverVideoQuality: number) {
653
     return {
655
     return {
654
-        type: SET_RECEIVE_VIDEO_QUALITY,
655
-        receiveVideoQuality
656
+        type: SET_PREFERRED_RECEIVER_VIDEO_QUALITY,
657
+        preferredReceiverVideoQuality
656
     };
658
     };
657
 }
659
 }
658
 
660
 

+ 16
- 9
react/features/base/conference/middleware.js Näytä tiedosto

34
     DATA_CHANNEL_OPENED,
34
     DATA_CHANNEL_OPENED,
35
     SET_AUDIO_ONLY,
35
     SET_AUDIO_ONLY,
36
     SET_LASTN,
36
     SET_LASTN,
37
-    SET_RECEIVE_VIDEO_QUALITY,
37
+    SET_PREFERRED_RECEIVER_VIDEO_QUALITY,
38
     SET_ROOM
38
     SET_ROOM
39
 } from './actionTypes';
39
 } from './actionTypes';
40
 import {
40
 import {
80
     case SET_LASTN:
80
     case SET_LASTN:
81
         return _setLastN(store, next, action);
81
         return _setLastN(store, next, action);
82
 
82
 
83
-    case SET_RECEIVE_VIDEO_QUALITY:
84
-        return _setReceiveVideoQuality(store, next, action);
83
+    case SET_PREFERRED_RECEIVER_VIDEO_QUALITY:
84
+        return _setPreferredReceiverVideoQuality(store, next, action);
85
 
85
 
86
     case SET_ROOM:
86
     case SET_ROOM:
87
         return _setRoom(store, next, action);
87
         return _setRoom(store, next, action);
441
  * is being dispatched.
441
  * is being dispatched.
442
  * @param {Dispatch} next - The redux {@code dispatch} function to dispatch the
442
  * @param {Dispatch} next - The redux {@code dispatch} function to dispatch the
443
  * specified {@code action} to the specified {@code store}.
443
  * specified {@code action} to the specified {@code store}.
444
- * @param {Action} action - The redux action {@code SET_RECEIVE_VIDEO_QUALITY}
445
- * which is being dispatched in the specified {@code store}.
444
+ * @param {Action} action - The redux action
445
+ * {@code SET_PREFERRED_RECEIVER_VIDEO_QUALITY} which is being dispatched in the
446
+ * specified {@code store}.
446
  * @private
447
  * @private
447
  * @returns {Object} The value returned by {@code next(action)}.
448
  * @returns {Object} The value returned by {@code next(action)}.
448
  */
449
  */
449
-function _setReceiveVideoQuality({ dispatch, getState }, next, action) {
450
-    const { audioOnly, conference } = getState()['features/base/conference'];
450
+function _setPreferredReceiverVideoQuality(
451
+        { dispatch, getState },
452
+        next,
453
+        action) {
454
+    const { audioOnly, conference }
455
+        = getState()['features/base/conference'];
451
 
456
 
452
     if (conference) {
457
     if (conference) {
453
-        conference.setReceiverVideoConstraint(action.receiveVideoQuality);
458
+        conference.setReceiverVideoConstraint(
459
+            action.preferredReceiverVideoQuality);
454
         audioOnly && dispatch(toggleAudioOnly());
460
         audioOnly && dispatch(toggleAudioOnly());
455
     }
461
     }
456
 
462
 
546
 function _syncReceiveVideoQuality({ getState }, next, action) {
552
 function _syncReceiveVideoQuality({ getState }, next, action) {
547
     const state = getState()['features/base/conference'];
553
     const state = getState()['features/base/conference'];
548
 
554
 
549
-    state.conference.setReceiverVideoConstraint(state.receiveVideoQuality);
555
+    state.conference.setReceiverVideoConstraint(
556
+        state.preferredReceiverVideoQuality);
550
 
557
 
551
     return next(action);
558
     return next(action);
552
 }
559
 }

+ 13
- 10
react/features/base/conference/reducer.js Näytä tiedosto

18
     SET_DESKTOP_SHARING_ENABLED,
18
     SET_DESKTOP_SHARING_ENABLED,
19
     SET_FOLLOW_ME,
19
     SET_FOLLOW_ME,
20
     SET_PASSWORD,
20
     SET_PASSWORD,
21
-    SET_RECEIVE_VIDEO_QUALITY,
21
+    SET_PREFERRED_RECEIVER_VIDEO_QUALITY,
22
     SET_ROOM,
22
     SET_ROOM,
23
     SET_SIP_GATEWAY_ENABLED,
23
     SET_SIP_GATEWAY_ENABLED,
24
     SET_START_MUTED_POLICY
24
     SET_START_MUTED_POLICY
72
     case SET_PASSWORD:
72
     case SET_PASSWORD:
73
         return _setPassword(state, action);
73
         return _setPassword(state, action);
74
 
74
 
75
-    case SET_RECEIVE_VIDEO_QUALITY:
76
-        return _setReceiveVideoQuality(state, action);
75
+    case SET_PREFERRED_RECEIVER_VIDEO_QUALITY:
76
+        return _setPreferredReceiverVideoQuality(state, action);
77
 
77
 
78
     case SET_ROOM:
78
     case SET_ROOM:
79
         return _setRoom(state, action);
79
         return _setRoom(state, action);
211
          *
211
          *
212
          * @type number
212
          * @type number
213
          */
213
          */
214
-        receiveVideoQuality: VIDEO_QUALITY_LEVELS.HIGH
214
+        preferredReceiverVideoQuality: VIDEO_QUALITY_LEVELS.HIGH
215
     });
215
     });
216
 }
216
 }
217
 
217
 
403
 }
403
 }
404
 
404
 
405
 /**
405
 /**
406
- * Reduces a specific Redux action SET_RECEIVE_VIDEO_QUALITY of the feature
407
- * base/conference.
406
+ * Reduces a specific Redux action {@code SET_PREFERRED_RECEIVER_VIDEO_QUALITY}
407
+ * of the feature base/conference.
408
  *
408
  *
409
  * @param {Object} state - The Redux state of the feature base/conference.
409
  * @param {Object} state - The Redux state of the feature base/conference.
410
- * @param {Action} action - The Redux action SET_RECEIVE_VIDEO_QUALITY to
411
- * reduce.
410
+ * @param {Action} action - The Redux action of type
411
+ * {@code SET_PREFERRED_RECEIVER_VIDEO_QUALITY} to reduce.
412
  * @private
412
  * @private
413
  * @returns {Object} The new state of the feature base/conference after the
413
  * @returns {Object} The new state of the feature base/conference after the
414
  * reduction of the specified action.
414
  * reduction of the specified action.
415
  */
415
  */
416
-function _setReceiveVideoQuality(state, action) {
417
-    return set(state, 'receiveVideoQuality', action.receiveVideoQuality);
416
+function _setPreferredReceiverVideoQuality(state, action) {
417
+    return set(
418
+        state,
419
+        'preferredReceiverVideoQuality',
420
+        action.preferredReceiverVideoQuality);
418
 }
421
 }
419
 
422
 
420
 /**
423
 /**

+ 2
- 2
react/features/conference/middleware.js Näytä tiedosto

6
     KICKED_OUT,
6
     KICKED_OUT,
7
     VIDEO_QUALITY_LEVELS,
7
     VIDEO_QUALITY_LEVELS,
8
     conferenceFailed,
8
     conferenceFailed,
9
-    setReceiveVideoQuality
9
+    setPreferredReceiverVideoQuality
10
 } from '../base/conference';
10
 } from '../base/conference';
11
 import { JitsiConferenceEvents } from '../base/lib-jitsi-meet';
11
 import { JitsiConferenceEvents } from '../base/lib-jitsi-meet';
12
 import { SET_REDUCED_UI } from '../base/responsive-ui';
12
 import { SET_REDUCED_UI } from '../base/responsive-ui';
32
         // audio-only mode if engaged, that's why we check for it here.
32
         // audio-only mode if engaged, that's why we check for it here.
33
         audioOnly
33
         audioOnly
34
             || dispatch(
34
             || dispatch(
35
-                setReceiveVideoQuality(
35
+                setPreferredReceiverVideoQuality(
36
                     reducedUI
36
                     reducedUI
37
                         ? VIDEO_QUALITY_LEVELS.LOW
37
                         ? VIDEO_QUALITY_LEVELS.LOW
38
                         : VIDEO_QUALITY_LEVELS.HIGH));
38
                         : VIDEO_QUALITY_LEVELS.HIGH));

+ 7
- 7
react/features/video-quality/components/OverflowMenuVideoQualityItem.web.js Näytä tiedosto

33
      * The currently configured maximum quality resolution to be received from
33
      * The currently configured maximum quality resolution to be received from
34
      * remote participants.
34
      * remote participants.
35
      */
35
      */
36
-    _receiveVideoQuality: number,
36
+    _receiverVideoQuality: number,
37
 
37
 
38
     /**
38
     /**
39
      * Callback to invoke when {@link OverflowMenuVideoQualityItem} is clicked.
39
      * Callback to invoke when {@link OverflowMenuVideoQualityItem} is clicked.
61
      * @returns {ReactElement}
61
      * @returns {ReactElement}
62
      */
62
      */
63
     render() {
63
     render() {
64
-        const { _audioOnly, _receiveVideoQuality } = this.props;
65
-        const icon = _audioOnly || !_receiveVideoQuality
64
+        const { _audioOnly, _receiverVideoQuality } = this.props;
65
+        const icon = _audioOnly || !_receiverVideoQuality
66
             ? 'icon-AUD'
66
             ? 'icon-AUD'
67
-            : VIDEO_QUALITY_TO_ICON[_receiveVideoQuality];
67
+            : VIDEO_QUALITY_TO_ICON[_receiverVideoQuality];
68
 
68
 
69
         return (
69
         return (
70
             <li
70
             <li
91
  * @private
91
  * @private
92
  * @returns {{
92
  * @returns {{
93
  *     _audioOnly: boolean,
93
  *     _audioOnly: boolean,
94
- *     _receiveVideoQuality: number
94
+ *     _receiverVideoQuality: number
95
  * }}
95
  * }}
96
  */
96
  */
97
 function _mapStateToProps(state) {
97
 function _mapStateToProps(state) {
98
     return {
98
     return {
99
         _audioOnly: state['features/base/conference'].audioOnly,
99
         _audioOnly: state['features/base/conference'].audioOnly,
100
-        _receiveVideoQuality:
101
-            state['features/base/conference'].receiveVideoQuality
100
+        _receiverVideoQuality:
101
+            state['features/base/conference'].preferredReceiverVideoQuality
102
     };
102
     };
103
 }
103
 }
104
 
104
 

+ 12
- 12
react/features/video-quality/components/VideoQualitySlider.web.js Näytä tiedosto

10
 import {
10
 import {
11
     VIDEO_QUALITY_LEVELS,
11
     VIDEO_QUALITY_LEVELS,
12
     setAudioOnly,
12
     setAudioOnly,
13
-    setReceiveVideoQuality
13
+    setPreferredReceiverVideoQuality
14
 } from '../../base/conference';
14
 } from '../../base/conference';
15
 import { translate } from '../../base/i18n';
15
 import { translate } from '../../base/i18n';
16
 import JitsiMeetJS from '../../base/lib-jitsi-meet';
16
 import JitsiMeetJS from '../../base/lib-jitsi-meet';
66
          * The currently configured maximum quality resolution to be received
66
          * The currently configured maximum quality resolution to be received
67
          * from remote participants.
67
          * from remote participants.
68
          */
68
          */
69
-        _receiveVideoQuality: PropTypes.number,
69
+        _receiverVideoQuality: PropTypes.number,
70
 
70
 
71
         /**
71
         /**
72
          * Whether or not displaying video is supported in the current
72
          * Whether or not displaying video is supported in the current
284
     _enableHighDefinition() {
284
     _enableHighDefinition() {
285
         sendAnalytics(createEvent('high'));
285
         sendAnalytics(createEvent('high'));
286
         logger.log('Video quality: high enabled');
286
         logger.log('Video quality: high enabled');
287
-        this.props.dispatch(setReceiveVideoQuality(HIGH));
287
+        this.props.dispatch(setPreferredReceiverVideoQuality(HIGH));
288
     }
288
     }
289
 
289
 
290
     /**
290
     /**
297
     _enableLowDefinition() {
297
     _enableLowDefinition() {
298
         sendAnalytics(createEvent('low'));
298
         sendAnalytics(createEvent('low'));
299
         logger.log('Video quality: low enabled');
299
         logger.log('Video quality: low enabled');
300
-        this.props.dispatch(setReceiveVideoQuality(LOW));
300
+        this.props.dispatch(setPreferredReceiverVideoQuality(LOW));
301
     }
301
     }
302
 
302
 
303
     /**
303
     /**
310
     _enableStandardDefinition() {
310
     _enableStandardDefinition() {
311
         sendAnalytics(createEvent('standard'));
311
         sendAnalytics(createEvent('standard'));
312
         logger.log('Video quality: standard enabled');
312
         logger.log('Video quality: standard enabled');
313
-        this.props.dispatch(setReceiveVideoQuality(STANDARD));
313
+        this.props.dispatch(setPreferredReceiverVideoQuality(STANDARD));
314
     }
314
     }
315
 
315
 
316
     /**
316
     /**
321
      * @returns {void}
321
      * @returns {void}
322
      */
322
      */
323
     _mapCurrentQualityToSliderValue() {
323
     _mapCurrentQualityToSliderValue() {
324
-        const { _audioOnly, _receiveVideoQuality } = this.props;
324
+        const { _audioOnly, _receiverVideoQuality } = this.props;
325
         const { _sliderOptions } = this;
325
         const { _sliderOptions } = this;
326
 
326
 
327
         if (_audioOnly) {
327
         if (_audioOnly) {
332
         }
332
         }
333
 
333
 
334
         const matchingOption = _sliderOptions.find(
334
         const matchingOption = _sliderOptions.find(
335
-            ({ videoQuality }) => videoQuality === _receiveVideoQuality);
335
+            ({ videoQuality }) => videoQuality === _receiverVideoQuality);
336
 
336
 
337
         return _sliderOptions.indexOf(matchingOption);
337
         return _sliderOptions.indexOf(matchingOption);
338
     }
338
     }
345
      * @returns {void}
345
      * @returns {void}
346
      */
346
      */
347
     _onSliderChange(event) {
347
     _onSliderChange(event) {
348
-        const { _audioOnly, _receiveVideoQuality } = this.props;
348
+        const { _audioOnly, _receiverVideoQuality } = this.props;
349
         const {
349
         const {
350
             audioOnly,
350
             audioOnly,
351
             onSelect,
351
             onSelect,
355
         // Take no action if the newly chosen option does not change audio only
355
         // Take no action if the newly chosen option does not change audio only
356
         // or video quality state.
356
         // or video quality state.
357
         if ((_audioOnly && audioOnly)
357
         if ((_audioOnly && audioOnly)
358
-            || (!_audioOnly && videoQuality === _receiveVideoQuality)) {
358
+            || (!_audioOnly && videoQuality === _receiverVideoQuality)) {
359
             return;
359
             return;
360
         }
360
         }
361
 
361
 
372
  * @returns {{
372
  * @returns {{
373
  *     _audioOnly: boolean,
373
  *     _audioOnly: boolean,
374
  *     _p2p: boolean,
374
  *     _p2p: boolean,
375
- *     _receiveVideoQuality: boolean
375
+ *     _receiverVideoQuality: boolean
376
  * }}
376
  * }}
377
  */
377
  */
378
 function _mapStateToProps(state) {
378
 function _mapStateToProps(state) {
379
     const {
379
     const {
380
         audioOnly,
380
         audioOnly,
381
         p2p,
381
         p2p,
382
-        receiveVideoQuality
382
+        preferredReceiverVideoQuality
383
     } = state['features/base/conference'];
383
     } = state['features/base/conference'];
384
 
384
 
385
     return {
385
     return {
386
         _audioOnly: audioOnly,
386
         _audioOnly: audioOnly,
387
         _p2p: p2p,
387
         _p2p: p2p,
388
-        _receiveVideoQuality: receiveVideoQuality,
388
+        _receiverVideoQuality: preferredReceiverVideoQuality,
389
         _videoSupported: JitsiMeetJS.mediaDevices.supportsVideo()
389
         _videoSupported: JitsiMeetJS.mediaDevices.supportsVideo()
390
     };
390
     };
391
 }
391
 }

Loading…
Peruuta
Tallenna