Ver código fonte

Revert "feat(prejoin_page) Add settings buttons" (#5424)

This reverts commit 08f55ccb94.
j8
Saúl Ibarra Corretgé 5 anos atrás
pai
commit
faf24ca7ec
Nenhuma conta vinculada ao e-mail do autor do commit
40 arquivos alterados com 11 adições e 2070 exclusões
  1. 0
    5
      config.js
  2. 0
    16
      css/_atlaskit_overrides.scss
  3. 0
    124
      css/_audio-preview.css
  4. 0
    33
      css/_meter.css
  5. 0
    76
      css/_settings-button.scss
  6. 0
    43
      css/_video-preview.css
  7. 0
    4
      css/main.scss
  8. 1
    2
      lang/main.json
  9. 0
    12
      react/features/base/devices/actions.js
  10. 0
    54
      react/features/base/devices/functions.js
  11. 0
    3
      react/features/base/icons/svg/arrow_down.svg
  12. 0
    3
      react/features/base/icons/svg/exclamation-solid.svg
  13. 0
    3
      react/features/base/icons/svg/exclamation.svg
  14. 0
    6
      react/features/base/icons/svg/index.js
  15. 0
    10
      react/features/base/icons/svg/meter.svg
  16. 0
    3
      react/features/base/icons/svg/microphone-empty.svg
  17. 0
    3
      react/features/base/icons/svg/volume-empty.svg
  18. 0
    30
      react/features/base/settings/functions.web.js
  19. 0
    66
      react/features/base/toolbox/components/ToolboxButtonWithIcon.js
  20. 0
    1
      react/features/base/toolbox/components/index.js
  21. 0
    6
      react/features/settings/actionTypes.js
  22. 1
    56
      react/features/settings/actions.js
  23. 1
    3
      react/features/settings/components/web/SettingsDialog.js
  24. 0
    262
      react/features/settings/components/web/audio/AudioSettingsContent.js
  25. 0
    53
      react/features/settings/components/web/audio/AudioSettingsEntry.js
  26. 0
    39
      react/features/settings/components/web/audio/AudioSettingsHeader.js
  27. 0
    97
      react/features/settings/components/web/audio/AudioSettingsPopup.js
  28. 0
    45
      react/features/settings/components/web/audio/Meter.js
  29. 0
    172
      react/features/settings/components/web/audio/MicrophoneEntry.js
  30. 0
    119
      react/features/settings/components/web/audio/SpeakerEntry.js
  31. 0
    26
      react/features/settings/components/web/audio/TestButton.js
  32. 0
    2
      react/features/settings/components/web/index.js
  33. 0
    220
      react/features/settings/components/web/video/VideoSettingsContent.js
  34. 0
    85
      react/features/settings/components/web/video/VideoSettingsPopup.js
  35. 0
    71
      react/features/settings/functions.js
  36. 1
    15
      react/features/settings/reducer.js
  37. 0
    127
      react/features/toolbox/components/web/AudioSettingsButton.js
  38. 6
    48
      react/features/toolbox/components/web/Toolbox.js
  39. 0
    124
      react/features/toolbox/components/web/VideoSettingsButton.js
  40. 1
    3
      react/features/toolbox/functions.web.js

+ 0
- 5
config.js Ver arquivo

@@ -264,11 +264,6 @@ var config = {
264 264
     // a call is hangup.
265 265
     // enableClosePage: false,
266 266
 
267
-    // Enabling pre join page will add an additional step before starting the meeting,
268
-    // where the user can configure its devices and choose the way he
269
-    // joins audio (by phone/or web).
270
-    // prejoinPageEnabled: false,
271
-
272 267
     // Disable hiding of remote thumbnails when in a 1-on-1 conference call.
273 268
     // disable1On1Mode: false,
274 269
 

+ 0
- 16
css/_atlaskit_overrides.scss Ver arquivo

@@ -48,19 +48,3 @@
48 48
 .toolbox-button-wth-dialog .eYJELv {
49 49
     max-height: initial;
50 50
 }
51
-
52
-/**
53
- * Override @atlaskit/InlineDialog styling for the video preview
54
- */
55
-.video-preview .eYJELv {
56
-    outline: none;
57
-    padding: 16px;
58
-}
59
-
60
-/**
61
- * Override @atlaskit/InlineDialog styling for the audio preview
62
- */
63
-.audio-preview .eYJELv {
64
-    outline: none;
65
-    padding: 0;
66
-}

+ 0
- 124
css/_audio-preview.css Ver arquivo

@@ -1,124 +0,0 @@
1
-.audio-preview {
2
-    &-content {
3
-        font-size: 15px;
4
-        line-height: 24px;
5
-        max-height: 456px;
6
-        overflow: auto;
7
-        width: 328px;
8
-    }
9
-
10
-    &-header {
11
-        color: #fff;
12
-        display: flex;
13
-        padding: 16px;
14
-
15
-        &-icon {
16
-            display: inline-block;
17
-        }
18
-
19
-        &-text {
20
-            font-weight: bold;
21
-            margin-left: 8px;
22
-        }
23
-    }
24
-
25
-    &-entry {
26
-        align-items: center;
27
-        color: #fff;
28
-        cursor: pointer;
29
-        display: flex;
30
-        padding: 12px 0;
31
-        margin-left: 48px;
32
-
33
-        &--selected {
34
-            background: rgba(28,32,37,0.5);
35
-            cursor: initial;
36
-            margin-left: 0;
37
-            padding-left: 21px;
38
-        }
39
-
40
-        &-text {
41
-            color: #fff;
42
-            font-size: 15px;
43
-            display: inline-block;
44
-            line-height: 24px;
45
-            text-overflow: ellipsis;
46
-            max-width: 213px;
47
-            overflow: hidden;
48
-            white-space: nowrap;
49
-        }
50
-    }
51
-
52
-    &-speaker {
53
-        position: relative;
54
-
55
-        &:hover {
56
-            .audio-preview-entry {
57
-                background: rgba(255,255,255, 0.2);
58
-                margin-left: 0;
59
-                padding-left: 48px;
60
-
61
-                &--selected {
62
-                    padding-left: 21px;
63
-                }
64
-            }
65
-
66
-            .audio-preview-test-button {
67
-                display: inline-block;
68
-            }
69
-        }
70
-
71
-        .audio-preview-entry-text {
72
-            max-width: 256px;
73
-        }
74
-    }
75
-
76
-    &-microphone {
77
-        position: relative;
78
-    }
79
-
80
-
81
-    &-icon {
82
-        border-radius: 50%;
83
-        display: inline-block;
84
-        width: 14px;
85
-
86
-        & svg {
87
-            fill: #1C2025;
88
-        }
89
-
90
-        &--check {
91
-            background: #31B76A;
92
-            margin-right: 13px;
93
-        }
94
-
95
-        &--exclamation {
96
-            margin-left: 6px;
97
-            & svg {
98
-                fill: #E54B4B;
99
-            }
100
-        }
101
-    }
102
-
103
-    &-test-button {
104
-        display: none;
105
-        background: #FFF;
106
-        border: 1px solid #D1DBE8;
107
-        border-radius: 3px;
108
-        color: #1C2025;
109
-        cursor: pointer;
110
-        font-weight: 600;
111
-        font-size: 15px;
112
-        line-height: 24px;
113
-        padding: 4px 16px;
114
-        position: absolute;
115
-        right: 16px;
116
-        top: 8px;
117
-    }
118
-
119
-    &-meter-mic {
120
-        position: absolute;
121
-        right: 16px;
122
-        top: 18px;
123
-    }
124
-}

+ 0
- 33
css/_meter.css Ver arquivo

@@ -1,33 +0,0 @@
1
-.jitsi-icon {
2
-    &.metr {
3
-        display: inline-block;
4
-
5
-        & > svg {
6
-            fill: #76CF9C;
7
-            width: 38px;
8
-        }
9
-    }
10
-
11
-    &.metr--disabled {
12
-        & > svg {
13
-            fill: #5E6D7A;
14
-        }
15
-    }
16
-}
17
-
18
-.metr-l-0 {
19
-    rect:first-child {
20
-        fill: #279255;
21
-    }
22
-}
23
-
24
-@for $i from 1 through 7 {
25
-    .metr-l-#{$i} {
26
-        rect:nth-child(-n+#{$i+1}) {
27
-            fill: #31B76A;
28
-        }
29
-        rect:first-child {
30
-            fill: #279255;
31
-        }
32
-    }
33
-}

+ 0
- 76
css/_settings-button.scss Ver arquivo

@@ -1,76 +0,0 @@
1
-.settings-button {
2
-    &-container {
3
-        position: relative;
4
-
5
-        .toolbox-icon {
6
-            align-items: center;
7
-            cursor: pointer;
8
-            display: flex;
9
-            background-color: #fff;
10
-            border-radius: 50%;
11
-            border: 1px solid #d1dbe8;
12
-            justify-content: center;
13
-            width: 38px;
14
-            height: 38px;
15
-
16
-            &:hover {
17
-                background-color: #daebfa;
18
-                border: 1px solid #daebfa;
19
-            }
20
-
21
-            &.toggled {
22
-                background: #2a3a4b;
23
-                border: 1px solid #5e6d7a;
24
-
25
-                svg {
26
-                    fill: #fff;
27
-                }
28
-
29
-                &:hover {
30
-                    background-color: #5e6d7a;
31
-                }
32
-            }
33
-
34
-            &.disabled, .disabled & {
35
-                cursor: initial;
36
-                color: #fff;
37
-                background-color: #a4b8d1;
38
-            }
39
-
40
-            svg {
41
-                fill: #5e6d7a;
42
-            }
43
-        }
44
-    }
45
-
46
-    &-small-icon {
47
-        background: #FFF;
48
-        border: 1px solid rgba(0, 0, 0, 0.2);
49
-        border-radius: 50%;
50
-        bottom: 0;
51
-        box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.25);
52
-        cursor: pointer;
53
-        height: 18px;
54
-        position: absolute;
55
-        text-align: center;
56
-        right: 2px;
57
-        width: 18px;
58
-
59
-        &:hover {
60
-            background-color: #daebfa;
61
-        }
62
-
63
-        &> svg {
64
-            margin-top: 5px;
65
-        }
66
-
67
-        &--disabled {
68
-            background-color: #a4b8d1;
69
-            cursor: default;
70
-
71
-            &:hover {
72
-                background-color: #a4b8d1;
73
-            }
74
-        }
75
-    }
76
-}

+ 0
- 43
css/_video-preview.css Ver arquivo

@@ -1,43 +0,0 @@
1
-.video-preview {
2
-    &-entry {
3
-        cursor: pointer;
4
-        height: 135px;
5
-        margin-bottom: 16px;
6
-        position: relative;
7
-        width: 240px;
8
-
9
-        &:last-child {
10
-            margin-bottom: 0;
11
-        }
12
-
13
-        &--selected {
14
-            border: 3px solid #31B76A;
15
-            cursor: default;
16
-            height: 129px;
17
-            width: 234px;
18
-        }
19
-    }
20
-
21
-    &-video {
22
-        height: 100%;
23
-        object-fit: cover;
24
-        width: 100%;
25
-    }
26
-
27
-    &-overlay {
28
-        background: rgba(42, 58, 75, 0.6);
29
-        height: 100%;
30
-        position: absolute;
31
-        width: 100%;
32
-        z-index: 1;
33
-    }
34
-
35
-    &-error {
36
-        align-items: center;
37
-        display: flex;
38
-        height: 100%;
39
-        justify-content: center;
40
-        position: absolute;
41
-        width: 100%;
42
-    }
43
-}

+ 0
- 4
css/main.scss Ver arquivo

@@ -86,9 +86,5 @@ $flagsImagePath: "../images/";
86 86
 @import 'avatar';
87 87
 @import 'promotional-footer';
88 88
 @import 'chrome-extension-banner';
89
-@import 'settings-button';
90
-@import 'meter';
91
-@import 'audio-preview';
92
-@import 'video-preview';
93 89
 
94 90
 /* Modules END */

+ 1
- 2
lang/main.json Ver arquivo

@@ -532,7 +532,6 @@
532 532
         "selectAudioOutput": "Audio output",
533 533
         "selectCamera": "Camera",
534 534
         "selectMic": "Microphone",
535
-        "speakers": "Speakers",
536 535
         "startAudioMuted": "Everyone starts muted",
537 536
         "startVideoMuted": "Everyone starts hidden",
538 537
         "title": "Settings"
@@ -648,7 +647,7 @@
648 647
         "noAudioSignalDesc": "If you did not purposely mute it from system settings or hardware, consider switching the device.",
649 648
         "noAudioSignalDescSuggestion": "If you did not purposely mute it from system settings or hardware, consider switching to the suggested device.",
650 649
         "noAudioSignalDialInDesc": "You can also dial-in using:",
651
-        "noAudioSignalDialInLinkDesc": "Dial-in numbers",
650
+        "noAudioSignalDialInLinkDesc" : "Dial-in numbers",
652 651
         "noisyAudioInputTitle": "Your microphone appears to be noisy!",
653 652
         "noisyAudioInputDesc": "It sounds like your microphone is making noise, please consider muting or changing the device.",
654 653
         "openChat": "Open chat",

+ 0
- 12
react/features/base/devices/actions.js Ver arquivo

@@ -216,18 +216,6 @@ export function setAudioInputDevice(deviceId) {
216 216
     };
217 217
 }
218 218
 
219
-/**
220
- * Updates the output device id.
221
- *
222
- * @param {string} deviceId - The id of the new output device.
223
- * @returns {Function}
224
- */
225
-export function setAudioOutputDevice(deviceId) {
226
-    return function(dispatch) {
227
-        return setAudioOutputDeviceId(deviceId, dispatch);
228
-    };
229
-}
230
-
231 219
 /**
232 220
  * Signals to update the currently used video input device.
233 221
  *

+ 0
- 54
react/features/base/devices/functions.js Ver arquivo

@@ -174,60 +174,6 @@ export function formatDeviceLabel(label: string) {
174 174
     return formattedLabel;
175 175
 }
176 176
 
177
-/**
178
- * Returns a list of objects containing all the microphone device ids and labels.
179
- *
180
- * @param {Object} state - The state of the application.
181
- * @returns {Object[]}
182
- */
183
-export function getAudioInputDeviceData(state: Object) {
184
-    return state['features/base/devices'].availableDevices.audioInput.map(
185
-        ({ deviceId, label }) => {
186
-            return {
187
-                deviceId,
188
-                label
189
-            };
190
-        });
191
-}
192
-
193
-/**
194
- * Returns a list of objectes containing all the output device ids and labels.
195
- *
196
- * @param {Object} state - The state of the application.
197
- * @returns {Object[]}
198
- */
199
-export function getAudioOutputDeviceData(state: Object) {
200
-    return state['features/base/devices'].availableDevices.audioOutput.map(
201
-        ({ deviceId, label }) => {
202
-            return {
203
-                deviceId,
204
-                label
205
-            };
206
-        });
207
-}
208
-
209
-/**
210
- * Returns a list of all the camera device ids.
211
- *
212
- * @param {Object} state - The state of the application.
213
- * @returns {string[]}
214
- */
215
-export function getVideoDeviceIds(state: Object) {
216
-    return state['features/base/devices'].availableDevices.videoInput.map(({ deviceId }) => deviceId);
217
-}
218
-
219
-/**
220
- * Returns true if there are devices of a specific type.
221
- *
222
- * @param {Object} state - The state of the application.
223
- * @param {string} type - The type of device: VideoOutput | audioOutput | audioInput.
224
- *
225
- * @returns {boolean}
226
- */
227
-export function hasAvailableDevices(state: Object, type: string) {
228
-    return state['features/base/devices'].availableDevices[type].length > 0;
229
-}
230
-
231 177
 /**
232 178
  * Set device id of the audio output device which is currently in use.
233 179
  * Empty string stands for default device.

+ 0
- 3
react/features/base/icons/svg/arrow_down.svg Ver arquivo

@@ -1,3 +0,0 @@
1
-<svg width="10" height="6" viewBox="0 0 10 6" fill="none" xmlns="http://www.w3.org/2000/svg">
2
-<path fill-rule="evenodd" clip-rule="evenodd" d="M8.07001 0.248238C8.3471 -0.0596449 8.82132 -0.0846038 9.1292 0.192491C9.43709 0.469585 9.46205 0.943802 9.18495 1.25168L5.65622 5.19348C5.35829 5.52451 4.83922 5.52451 4.54128 5.19348L1.06752 1.25168C0.79043 0.943802 0.81539 0.469585 1.12327 0.192491C1.43115 -0.0846038 1.90537 -0.0596449 2.18247 0.248238L5.09875 3.57062L8.07001 0.248238Z" fill="#5E6D7A"/>
3
-</svg>

+ 0
- 3
react/features/base/icons/svg/exclamation-solid.svg Ver arquivo

@@ -1,3 +0,0 @@
1
-<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
2
-<path fill-rule="evenodd" clip-rule="evenodd" d="M8 14.6667C4.3181 14.6667 1.33333 11.682 1.33333 8.00007C1.33333 4.31817 4.3181 1.3334 8 1.3334C11.6819 1.3334 14.6667 4.31817 14.6667 8.00007C14.6667 11.682 11.6819 14.6667 8 14.6667ZM7.33333 4.66676C7.33333 4.29857 7.6318 4.00009 8 4.00009C8.36819 4.00009 8.66666 4.29857 8.66666 4.66676V8.00009C8.66666 8.36828 8.36819 8.66676 8 8.66676C7.6318 8.66676 7.33333 8.36828 7.33333 8.00009V4.66676ZM8 10.0001C7.63181 10.0001 7.33333 10.2985 7.33333 10.6667C7.33333 11.0349 7.63181 11.3334 8 11.3334C8.36818 11.3334 8.66666 11.0349 8.66666 10.6667C8.66666 10.2985 8.36818 10.0001 8 10.0001Z" />
3
-</svg>

+ 0
- 3
react/features/base/icons/svg/exclamation.svg Ver arquivo

@@ -1,3 +0,0 @@
1
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
-<path fill-rule="evenodd" clip-rule="evenodd" d="M1.33331 8.00004C1.33331 11.6819 4.31808 14.6667 7.99998 14.6667C11.6819 14.6667 14.6666 11.6819 14.6666 8.00004C14.6666 4.31814 11.6819 1.33337 7.99998 1.33337C4.31808 1.33337 1.33331 4.31814 1.33331 8.00004ZM13.3333 8.00005C13.3333 10.9456 10.9455 13.3334 7.99998 13.3334C5.05446 13.3334 2.66665 10.9456 2.66665 8.00005C2.66665 5.05453 5.05446 2.66672 7.99998 2.66672C10.9455 2.66672 13.3333 5.05453 13.3333 8.00005ZM7.33331 4.66673C7.33331 4.29854 7.63179 4.00006 7.99998 4.00006C8.36817 4.00006 8.66665 4.29854 8.66665 4.66673V8.00006C8.66665 8.36825 8.36817 8.66673 7.99998 8.66673C7.63179 8.66673 7.33331 8.36825 7.33331 8.00006V4.66673ZM7.99998 10C7.63179 10 7.33331 10.2985 7.33331 10.6667C7.33331 11.0349 7.63179 11.3334 7.99998 11.3334C8.36817 11.3334 8.66665 11.0349 8.66665 10.6667C8.66665 10.2985 8.36817 10 7.99998 10Z" fill="white"/>
3
-</svg>

+ 0
- 6
react/features/base/icons/svg/index.js Ver arquivo

@@ -3,7 +3,6 @@
3 3
 export { default as IconAdd } from './add.svg';
4 4
 export { default as IconAddPeople } from './link.svg';
5 5
 export { default as IconArrowBack } from './arrow_back.svg';
6
-export { default as IconArrowDown } from './arrow_down.svg';
7 6
 export { default as IconAudioOnly } from './visibility.svg';
8 7
 export { default as IconAudioOnlyOff } from './visibility-off.svg';
9 8
 export { default as IconAudioRoute } from './volume.svg';
@@ -28,8 +27,6 @@ export { default as IconDominantSpeaker } from './dominant-speaker.svg';
28 27
 export { default as IconDownload } from './download.svg';
29 28
 export { default as IconDragHandle } from './drag-handle.svg';
30 29
 export { default as IconEventNote } from './event_note.svg';
31
-export { default as IconExclamation } from './exclamation.svg';
32
-export { default as IconExclamationSolid } from './exclamation-solid.svg';
33 30
 export { default as IconExitFullScreen } from './exit-full-screen.svg';
34 31
 export { default as IconFeedback } from './feedback.svg';
35 32
 export { default as IconFullScreen } from './full-screen.svg';
@@ -44,10 +41,8 @@ export { default as IconMenuDown } from './menu-down.svg';
44 41
 export { default as IconMenuThumb } from './thumb-menu.svg';
45 42
 export { default as IconMenuUp } from './menu-up.svg';
46 43
 export { default as IconMessage } from './message.svg';
47
-export { default as IconMeter } from './meter.svg';
48 44
 export { default as IconMicDisabled } from './mic-disabled.svg';
49 45
 export { default as IconMicrophone } from './microphone.svg';
50
-export { default as IconMicrophoneEmpty } from './microphone-empty.svg';
51 46
 export { default as IconModerator } from './star.svg';
52 47
 export { default as IconMuteEveryone } from './mute-everyone.svg';
53 48
 export { default as IconMuteEveryoneElse } from './mute-everyone-else.svg';
@@ -80,4 +75,3 @@ export { default as IconVideoQualityHD } from './HD.svg';
80 75
 export { default as IconVideoQualityLD } from './LD.svg';
81 76
 export { default as IconVideoQualitySD } from './SD.svg';
82 77
 export { default as IconVolume } from './volume.svg';
83
-export { default as IconVolumeEmpty } from './volume-empty.svg';

+ 0
- 10
react/features/base/icons/svg/meter.svg Ver arquivo

@@ -1,10 +0,0 @@
1
-<svg width="38" height="12" viewBox="0 0 38 12" fill="#5E6D7A" xmlns="http://www.w3.org/2000/svg">
2
-<rect width="3" height="12" rx="1"/>
3
-<rect x="5" width="3" height="12" rx="1" />
4
-<rect x="10" width="3" height="12" rx="1" />
5
-<rect x="15" width="3" height="12" rx="1" />
6
-<rect x="20" width="3" height="12" rx="1" />
7
-<rect x="25" width="3" height="12" rx="1" />
8
-<rect x="30" width="3" height="12" rx="1" />
9
-<rect x="35" width="3" height="12" rx="1" />
10
-</svg>

+ 0
- 3
react/features/base/icons/svg/microphone-empty.svg Ver arquivo

@@ -1,3 +0,0 @@
1
-<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
-<path fill-rule="evenodd" clip-rule="evenodd" d="M16 6C16 3.79086 14.2091 2 12 2C9.79086 2 8 3.79086 8 6V12C8 13.8666 9.27853 15.4346 11.0076 15.8759C11.0026 15.9166 11 15.958 11 16V17.917C8.16229 17.441 6 14.973 6 12C6 11.4477 5.55228 11 5 11C4.44772 11 4 11.4477 4 12C4 16.0796 7.05369 19.446 11 19.9381V21C11 21.5523 11.4477 22 12 22C12.5523 22 13 21.5523 13 21V19.9381C16.9463 19.446 20 16.0796 20 12C20 11.4477 19.5523 11 19 11C18.4477 11 18 11.4477 18 12C18 14.973 15.8377 17.441 13 17.917V16C13 15.958 12.9974 15.9166 12.9924 15.8759C14.7215 15.4346 16 13.8666 16 12V6ZM12 4C10.8954 4 10 4.89543 10 6V12C10 13.1046 10.8954 14 12 14C13.1046 14 14 13.1046 14 12V6C14 4.89543 13.1046 4 12 4Z" fill="#A4B8D1"/>
3
-</svg>

+ 0
- 3
react/features/base/icons/svg/volume-empty.svg Ver arquivo

@@ -1,3 +0,0 @@
1
-<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
-<path fill-rule="evenodd" clip-rule="evenodd" d="M11.1799 3.68341L6 8H3C2.44772 8 2 8.44771 2 9V15C2 15.5523 2.44772 16 3 16H6L11.1799 20.3166C11.2698 20.3915 11.383 20.4325 11.5 20.4325C11.7761 20.4325 12 20.2086 12 19.9325V4.06752C12 3.95055 11.959 3.83728 11.8841 3.74743C11.7073 3.53529 11.392 3.50662 11.1799 3.68341ZM4 10H6.7241L10 7.27008V16.7299L6.7241 14H4V10ZM14 8C16.2091 8 18 9.79086 18 12C18 14.2091 16.2091 16 14 16V14C15.1046 14 16 13.1046 16 12C16 10.8954 15.1046 10 14 10V8ZM14 4C18.4183 4 22 7.58172 22 12C22 16.4183 18.4183 20 14 20V18C17.3137 18 20 15.3137 20 12C20 8.68629 17.3137 6 14 6V4Z" fill="#A4B8D1"/>
3
-</svg>

+ 0
- 30
react/features/base/settings/functions.web.js Ver arquivo

@@ -2,36 +2,6 @@
2 2
 
3 3
 export * from './functions.any';
4 4
 
5
-/**
6
- * Returns the deviceId for the currently used camera.
7
- *
8
- * @param {Object} state - The state of the application.
9
- * @returns {void}
10
- */
11
-export function getCurrentCameraDeviceId(state: Object) {
12
-    return state['features/base/settings'].cameraDeviceId;
13
-}
14
-
15
-/**
16
- * Returns the deviceId for the currently used microphone.
17
- *
18
- * @param {Object} state - The state of the application.
19
- * @returns {void}
20
- */
21
-export function getCurrentMicDeviceId(state: Object) {
22
-    return state['features/base/settings'].micDeviceId;
23
-}
24
-
25
-/**
26
- * Returns the deviceId for the currently used speaker.
27
- *
28
- * @param {Object} state - The state of the application.
29
- * @returns {void}
30
- */
31
-export function getCurrentOutputDeviceId(state: Object) {
32
-    return state['features/base/settings'].audioOutputDeviceId;
33
-}
34
-
35 5
 /**
36 6
  * Handles changes to the `disableCallIntegration` setting.
37 7
  * Noop on web.

+ 0
- 66
react/features/base/toolbox/components/ToolboxButtonWithIcon.js Ver arquivo

@@ -1,66 +0,0 @@
1
-// @flow
2
-
3
-import React from 'react';
4
-import { Icon } from '../../icons';
5
-
6
-type Props = {
7
-
8
-    /**
9
-     * The decorated component (ToolboxButton).
10
-     */
11
-    children: React$Node,
12
-
13
-    /**
14
-     * Icon of the button.
15
-     */
16
-    icon: Function,
17
-
18
-    /**
19
-     * Flag used for disabling the small icon.
20
-     */
21
-    iconDisabled: boolean,
22
-
23
-    /**
24
-     * Click handler for the small icon.
25
-     */
26
-    onIconClick: Function,
27
-
28
-    /**
29
-     * Additional styles.
30
-     */
31
-    styles?: Object,
32
-}
33
-
34
-/**
35
- * Displayes the `ToolboxButtonWithIcon` component.
36
- *
37
- * @returns {ReactElement}
38
- */
39
-export default function ToolboxButtonWithIcon({
40
-    children,
41
-    icon,
42
-    iconDisabled,
43
-    onIconClick,
44
-    styles
45
-}: Props) {
46
-    const iconProps = {};
47
-
48
-    if (iconDisabled) {
49
-        iconProps.className = 'settings-button-small-icon settings-button-small-icon--disabled';
50
-    } else {
51
-        iconProps.className = 'settings-button-small-icon';
52
-        iconProps.onClick = onIconClick;
53
-    }
54
-
55
-    return (
56
-        <div
57
-            className = 'settings-button-container'
58
-            styles = { styles }>
59
-            { children }
60
-            <Icon
61
-                { ...iconProps }
62
-                size = { 9 }
63
-                src = { icon } />
64
-        </div>
65
-    );
66
-}

+ 0
- 1
react/features/base/toolbox/components/index.js Ver arquivo

@@ -7,4 +7,3 @@ export { default as AbstractHangupButton } from './AbstractHangupButton';
7 7
 export { default as AbstractVideoMuteButton } from './AbstractVideoMuteButton';
8 8
 export { default as BetaTag } from './BetaTag';
9 9
 export { default as OverflowMenuItem } from './OverflowMenuItem';
10
-export { default as ToolboxButtonWithIcon } from './ToolboxButtonWithIcon';

+ 0
- 6
react/features/settings/actionTypes.js Ver arquivo

@@ -1,6 +1,3 @@
1
-// The type of (redux) action which sets the visibility of the audio settings popup.
2
-export const SET_AUDIO_SETTINGS_VISIBILITY = 'SET_AUDIO_SETTINGS_VISIBILITY';
3
-
4 1
 /**
5 2
  * The type of (redux) action which sets the visibility of the view/UI rendering
6 3
  * the app's settings.
@@ -11,6 +8,3 @@ export const SET_AUDIO_SETTINGS_VISIBILITY = 'SET_AUDIO_SETTINGS_VISIBILITY';
11 8
  * }
12 9
  */
13 10
 export const SET_SETTINGS_VIEW_VISIBLE = 'SET_SETTINGS_VIEW_VISIBLE';
14
-
15
-// The type of (redux) action which sets the visibility of the video settings popup.
16
-export const SET_VIDEO_SETTINGS_VISIBILITY = 'SET_VIDEO_SETTINGS_VISIBILITY';

+ 1
- 56
react/features/settings/actions.js Ver arquivo

@@ -4,11 +4,7 @@ import { setFollowMe, setStartMutedPolicy } from '../base/conference';
4 4
 import { openDialog } from '../base/dialog';
5 5
 import { i18next } from '../base/i18n';
6 6
 
7
-import {
8
-    SET_AUDIO_SETTINGS_VISIBILITY,
9
-    SET_SETTINGS_VIEW_VISIBLE,
10
-    SET_VIDEO_SETTINGS_VISIBILITY
11
-} from './actionTypes';
7
+import { SET_SETTINGS_VIEW_VISIBLE } from './actionTypes';
12 8
 import { SettingsDialog } from './components';
13 9
 import { getMoreTabProps, getProfileTabProps } from './functions';
14 10
 
@@ -42,31 +38,6 @@ export function openSettingsDialog(defaultTab: string) {
42 38
     return openDialog(SettingsDialog, { defaultTab });
43 39
 }
44 40
 
45
-/**
46
- * Sets the visiblity of the audio settings.
47
- *
48
- * @param {boolean} value - The new value.
49
- * @returns {Function}
50
- */
51
-function setAudioSettingsVisibility(value: boolean) {
52
-    return {
53
-        type: SET_AUDIO_SETTINGS_VISIBILITY,
54
-        value
55
-    };
56
-}
57
-
58
-/**
59
- * Sets the visiblity of the video settings.
60
- *
61
- * @param {boolean} value - The new value.
62
- * @returns {Function}
63
- */
64
-function setVideoSettingsVisibility(value: boolean) {
65
-    return {
66
-        type: SET_VIDEO_SETTINGS_VISIBILITY,
67
-        value
68
-    };
69
-}
70 41
 
71 42
 /**
72 43
  * Submits the settings from the "More" tab of the settings dialog.
@@ -113,29 +84,3 @@ export function submitProfileTab(newState: Object): Function {
113 84
         }
114 85
     };
115 86
 }
116
-
117
-/**
118
- * Toggles the visiblity of the audio settings.
119
- *
120
- * @returns {void}
121
- */
122
-export function toggleAudioSettings() {
123
-    return (dispatch: Function, getState: Function) => {
124
-        const value = getState()['features/settings'].audioSettingsVisible;
125
-
126
-        dispatch(setAudioSettingsVisibility(!value));
127
-    };
128
-}
129
-
130
-/**
131
- * Toggles the visiblity of the video settings.
132
- *
133
- * @returns {void}
134
- */
135
-export function toggleVideoSettings() {
136
-    return (dispatch: Function, getState: Function) => {
137
-        const value = getState()['features/settings'].videoSettingsVisible;
138
-
139
-        dispatch(setVideoSettingsVisibility(!value));
140
-    };
141
-}

+ 1
- 3
react/features/settings/components/web/SettingsDialog.js Ver arquivo

@@ -127,11 +127,9 @@ class SettingsDialog extends Component<Props> {
127 127
 function _mapStateToProps(state) {
128 128
     const configuredTabs = interfaceConfig.SETTINGS_SECTIONS || [];
129 129
     const jwt = state['features/base/jwt'];
130
-    const { prejoinPageEnabled } = state['features/base/config'];
131 130
 
132 131
     // The settings sections to display.
133
-    const showDeviceSettings = !prejoinPageEnabled
134
-          && configuredTabs.includes('devices');
132
+    const showDeviceSettings = configuredTabs.includes('devices');
135 133
     const moreTabProps = getMoreTabProps(state);
136 134
     const { showModeratorSettings, showLanguageSettings } = moreTabProps;
137 135
     const showProfileSettings

+ 0
- 262
react/features/settings/components/web/audio/AudioSettingsContent.js Ver arquivo

@@ -1,262 +0,0 @@
1
-// @flow
2
-
3
-import React, { Component } from 'react';
4
-
5
-import AudioSettingsHeader from './AudioSettingsHeader';
6
-import { translate } from '../../../../base/i18n';
7
-import { IconMicrophoneEmpty, IconVolumeEmpty } from '../../../../base/icons';
8
-import { createLocalAudioTrack } from '../../../functions';
9
-import MicrophoneEntry from './MicrophoneEntry';
10
-import SpeakerEntry from './SpeakerEntry';
11
-
12
-export type Props = {
13
-
14
-   /**
15
-    * The deviceId of the microphone in use.
16
-    */
17
-    currentMicDeviceId: string,
18
-
19
-   /**
20
-    * The deviceId of the output device in use.
21
-    */
22
-    currentOutputDeviceId: string,
23
-
24
-   /**
25
-    * Used to set a new microphone as the current one.
26
-    */
27
-    setAudioInputDevice: Function,
28
-
29
-   /**
30
-    * Used to set a new output device as the current one.
31
-    */
32
-    setAudioOutputDevice: Function,
33
-
34
-   /**
35
-    * A list of objects containing the labels and deviceIds
36
-    * of all the output devices.
37
-    */
38
-    outputDevices: Object[],
39
-
40
-   /**
41
-    * A list with objects containing the labels and deviceIds
42
-    * of all the input devices.
43
-    */
44
-    microphoneDevices: Object[],
45
-
46
-    /**
47
-     * Invoked to obtain translated strings.
48
-     */
49
-    t: Function
50
-};
51
-
52
-type State = {
53
-
54
-   /**
55
-    * An object containing the jitsiTrack and the error (if the case)
56
-    * for the microphone that is in use.
57
-    */
58
-    currentMicData: Object
59
-}
60
-
61
-/**
62
- * Implements a React {@link Component} which displayes a list of all
63
- * the audio input & output devices to choose from.
64
- *
65
- * @extends Component
66
- */
67
-class AudioSettingsContent extends Component<Props, State> {
68
-    _componentWasUnmounted: boolean;
69
-
70
-    /**
71
-     * Initializes a new {@code AudioSettingsContent} instance.
72
-     *
73
-     * @param {Object} props - The read-only properties with which the new
74
-     * instance is to be initialized.
75
-     */
76
-    constructor(props) {
77
-        super(props);
78
-
79
-        this._onMicrophoneEntryClick = this._onMicrophoneEntryClick.bind(this);
80
-        this._onSpeakerEntryClick = this._onSpeakerEntryClick.bind(this);
81
-
82
-        this.state = {
83
-            currentMicData: {
84
-                error: false,
85
-                jitsiTrack: null
86
-            }
87
-        };
88
-    }
89
-
90
-    _onMicrophoneEntryClick: (string) => void;
91
-
92
-    /**
93
-     * Click handler for the microphone entries.
94
-     *
95
-     * @param {string} deviceId - The deviceId for the clicked microphone.
96
-     * @returns {void}
97
-     */
98
-    _onMicrophoneEntryClick(deviceId) {
99
-        this.props.setAudioInputDevice(deviceId);
100
-    }
101
-
102
-    _onSpeakerEntryClick: (string) => void;
103
-
104
-    /**
105
-     * Click handler for the speaker entries.
106
-     *
107
-     * @param {string} deviceId - The deviceId for the clicked speaker.
108
-     * @returns {void}
109
-     */
110
-    _onSpeakerEntryClick(deviceId) {
111
-        this.props.setAudioOutputDevice(deviceId);
112
-    }
113
-
114
-    /**
115
-     * Renders a single microphone entry.
116
-     *
117
-     * @param {Object} data - An object with the deviceId and label of the microphone.
118
-     * @param {number} index - The index of the element, used for creating a key.
119
-     * @returns {React$Node}
120
-     */
121
-    _renderMicrophoneEntry(data, index) {
122
-        const { deviceId, label } = data;
123
-        const key = `me-${index}`;
124
-        const isSelected = deviceId === this.props.currentMicDeviceId;
125
-        let jitsiTrack = null;
126
-        let hasError = false;
127
-
128
-        if (isSelected) {
129
-            ({ jitsiTrack, hasError } = this.state.currentMicData);
130
-        }
131
-
132
-        return (
133
-            <MicrophoneEntry
134
-                deviceId = { deviceId }
135
-                hasError = { hasError }
136
-                isSelected = { isSelected }
137
-                jitsiTrack = { jitsiTrack }
138
-                key = { key }
139
-                onClick = { this._onMicrophoneEntryClick }>
140
-                {label}
141
-            </MicrophoneEntry>
142
-        );
143
-    }
144
-
145
-    /**
146
-     * Renders a single speaker entry.
147
-     *
148
-     * @param {Object} data - An object with the deviceId and label of the speaker.
149
-     * @param {number} index - The index of the element, used for creating a key.
150
-     * @returns {React$Node}
151
-     */
152
-    _renderSpeakerEntry(data, index) {
153
-        const { deviceId, label } = data;
154
-        const key = `se-${index}`;
155
-
156
-        return (
157
-            <SpeakerEntry
158
-                deviceId = { deviceId }
159
-                isSelected = { deviceId === this.props.currentOutputDeviceId }
160
-                key = { key }
161
-                onClick = { this._onSpeakerEntryClick }>
162
-                {label}
163
-            </SpeakerEntry>
164
-        );
165
-    }
166
-
167
-    /**
168
-     * Disposes the audio track for a given micData object.
169
-     *
170
-     * @param {Object} micData - The object holding the track.
171
-     * @returns {Promise<void>}
172
-     */
173
-    _disposeTrack(micData) {
174
-        const { jitsiTrack } = micData;
175
-
176
-        return jitsiTrack ? jitsiTrack.dispose() : Promise.resolve();
177
-    }
178
-
179
-    /**
180
-     * Updates the current microphone data.
181
-     * Disposes previously created track and creates a new one.
182
-     *
183
-     * @returns {void}
184
-     */
185
-    async _updateCurrentMicData() {
186
-        await this._disposeTrack(this.state.currentMicData);
187
-
188
-        const currentMicData = await createLocalAudioTrack(
189
-            this.props.currentMicDeviceId,
190
-        );
191
-
192
-        // In case the component gets unmounted before the track is created
193
-        // avoid a leak by not setting the state
194
-        if (this._componentWasUnmounted) {
195
-            this._disposeTrack(currentMicData);
196
-        } else {
197
-            this.setState({
198
-                currentMicData
199
-            });
200
-        }
201
-    }
202
-
203
-    /**
204
-     * Implements React's {@link Component#componentDidUpdate}.
205
-     *
206
-     * @inheritdoc
207
-     */
208
-    componentDidUpdate(prevProps) {
209
-        if (prevProps.currentMicDeviceId !== this.props.currentMicDeviceId) {
210
-            this._updateCurrentMicData();
211
-        }
212
-    }
213
-
214
-    /**
215
-     * Implements React's {@link Component#componentDidMount}.
216
-     *
217
-     * @inheritdoc
218
-     */
219
-    componentDidMount() {
220
-        this._updateCurrentMicData();
221
-    }
222
-
223
-    /**
224
-     * Implements React's {@link Component#componentWillUnmount}.
225
-     *
226
-     * @inheritdoc
227
-     */
228
-    componentWillUnmount() {
229
-        this._componentWasUnmounted = true;
230
-        this._disposeTrack(this.state.currentMicData);
231
-    }
232
-
233
-    /**
234
-     * Implements React's {@link Component#render}.
235
-     *
236
-     * @inheritdoc
237
-     */
238
-    render() {
239
-        const { microphoneDevices, outputDevices, t } = this.props;
240
-
241
-        return (
242
-            <div>
243
-                <div className = 'audio-preview-content'>
244
-                    <AudioSettingsHeader
245
-                        IconComponent = { IconMicrophoneEmpty }
246
-                        text = { t('settings.selectMic') } />
247
-                    {microphoneDevices.map((data, i) =>
248
-                        this._renderMicrophoneEntry(data, i),
249
-                    )}
250
-                    <AudioSettingsHeader
251
-                        IconComponent = { IconVolumeEmpty }
252
-                        text = { t('settings.speakers') } />
253
-                    {outputDevices.map((data, i) =>
254
-                        this._renderSpeakerEntry(data, i),
255
-                    )}
256
-                </div>
257
-            </div>
258
-        );
259
-    }
260
-}
261
-
262
-export default translate(AudioSettingsContent);

+ 0
- 53
react/features/settings/components/web/audio/AudioSettingsEntry.js Ver arquivo

@@ -1,53 +0,0 @@
1
-// @flow
2
-
3
-import React from 'react';
4
-
5
-import { Icon, IconCheck, IconExclamationSolid } from '../../../../base/icons';
6
-
7
-/**
8
- * The type of the React {@code Component} props of {@link AudioSettingsEntry}.
9
- */
10
-export type Props = {
11
-
12
-    /**
13
-     * The text for this component.
14
-     */
15
-    children: React$Node,
16
-
17
-    /**
18
-     * Flag indicating an error.
19
-     */
20
-    hasError?: boolean,
21
-
22
-    /**
23
-     * Flag indicating the selection state.
24
-     */
25
-    isSelected: boolean,
26
-};
27
-
28
-/**
29
- * React {@code Component} representing an entry for the audio settings.
30
- *
31
- * @returns { ReactElement}
32
- */
33
-export default function AudioSettingsEntry({ children, hasError, isSelected }: Props) {
34
-    const className = `audio-preview-entry ${isSelected
35
-        ? 'audio-preview-entry--selected' : ''}`;
36
-
37
-    return (
38
-        <div className = { className }>
39
-            {isSelected && (
40
-                <Icon
41
-                    className = 'audio-preview-icon audio-preview-icon--check'
42
-                    color = '#1C2025'
43
-                    size = { 14 }
44
-                    src = { IconCheck } />
45
-            )}
46
-            <span className = 'audio-preview-entry-text'>{children}</span>
47
-            {hasError && <Icon
48
-                className = 'audio-preview-icon audio-preview-icon--exclamation'
49
-                size = { 16 }
50
-                src = { IconExclamationSolid } />}
51
-        </div>
52
-    );
53
-}

+ 0
- 39
react/features/settings/components/web/audio/AudioSettingsHeader.js Ver arquivo

@@ -1,39 +0,0 @@
1
-// @flow
2
-
3
-import React from 'react';
4
-import { Icon } from '../../../../base/icons';
5
-
6
-/**
7
- * The type of the React {@code Component} props of {@link AudioSettingsHeader}.
8
- */
9
-type Props = {
10
-
11
-    /**
12
-     * The Icon used for the Header.
13
-     */
14
-    IconComponent: Function,
15
-
16
-    /**
17
-     * The text of the Header.
18
-     */
19
-    text: string,
20
-};
21
-
22
-/**
23
- * React {@code Component} representing the Header of an audio option group.
24
- *
25
- * @returns { ReactElement}
26
- */
27
-export default function AudioSettingsHeader({ IconComponent, text }: Props) {
28
-    return (
29
-        <div className = 'audio-preview-header'>
30
-            <div className = 'audio-preview-header-icon'>
31
-                { <Icon
32
-                    color = '#A4B8D1'
33
-                    size = { 24 }
34
-                    src = { IconComponent } />}
35
-            </div>
36
-            <div className = 'audio-preview-header-text'>{text}</div>
37
-        </div>
38
-    );
39
-}

+ 0
- 97
react/features/settings/components/web/audio/AudioSettingsPopup.js Ver arquivo

@@ -1,97 +0,0 @@
1
-// @flow
2
-
3
-import React from 'react';
4
-import InlineDialog from '@atlaskit/inline-dialog';
5
-
6
-import AudioSettingsContent, { type Props as AudioSettingsContentProps } from './AudioSettingsContent';
7
-import { toggleAudioSettings } from '../../../actions';
8
-import {
9
-    getAudioInputDeviceData,
10
-    getAudioOutputDeviceData,
11
-    setAudioInputDevice as setAudioInputDeviceAction,
12
-    setAudioOutputDevice as setAudioOutputDeviceAction
13
-} from '../../../../base/devices';
14
-import { connect } from '../../../../base/redux';
15
-import { getAudioSettingsVisibility } from '../../../functions';
16
-import {
17
-    getCurrentMicDeviceId,
18
-    getCurrentOutputDeviceId
19
-} from '../../../../base/settings';
20
-
21
-
22
-type Props = AudioSettingsContentProps & {
23
-
24
-   /**
25
-    * Component's children (the audio button).
26
-    */
27
-    children: React$Node,
28
-
29
-   /**
30
-    * Flag controlling the visibility of the popup.
31
-    */
32
-    isOpen: boolean,
33
-
34
-   /**
35
-    * Callback executed when the popup closes.
36
-    */
37
-    onClose: Function,
38
-}
39
-
40
-/**
41
- * Popup with audio settings.
42
- *
43
- * @returns {ReactElement}
44
- */
45
-function AudioSettingsPopup({
46
-    children,
47
-    currentMicDeviceId,
48
-    currentOutputDeviceId,
49
-    isOpen,
50
-    microphoneDevices,
51
-    setAudioInputDevice,
52
-    setAudioOutputDevice,
53
-    onClose,
54
-    outputDevices
55
-}: Props) {
56
-    return (
57
-        <div className = 'audio-preview'>
58
-            <InlineDialog
59
-                content = { <AudioSettingsContent
60
-                    currentMicDeviceId = { currentMicDeviceId }
61
-                    currentOutputDeviceId = { currentOutputDeviceId }
62
-                    microphoneDevices = { microphoneDevices }
63
-                    outputDevices = { outputDevices }
64
-                    setAudioInputDevice = { setAudioInputDevice }
65
-                    setAudioOutputDevice = { setAudioOutputDevice } /> }
66
-                isOpen = { isOpen }
67
-                onClose = { onClose }
68
-                position = 'top left'>
69
-                {children}
70
-            </InlineDialog>
71
-        </div>
72
-    );
73
-}
74
-
75
-/**
76
- * Function that maps parts of Redux state tree into component props.
77
- *
78
- * @param {Object} state - Redux state.
79
- * @returns {Object}
80
- */
81
-function mapStateToProps(state) {
82
-    return {
83
-        currentMicDeviceId: getCurrentMicDeviceId(state),
84
-        currentOutputDeviceId: getCurrentOutputDeviceId(state),
85
-        isOpen: getAudioSettingsVisibility(state),
86
-        microphoneDevices: getAudioInputDeviceData(state),
87
-        outputDevices: getAudioOutputDeviceData(state)
88
-    };
89
-}
90
-
91
-const mapDispatchToProps = {
92
-    onClose: toggleAudioSettings,
93
-    setAudioInputDevice: setAudioInputDeviceAction,
94
-    setAudioOutputDevice: setAudioOutputDeviceAction
95
-};
96
-
97
-export default connect(mapStateToProps, mapDispatchToProps)(AudioSettingsPopup);

+ 0
- 45
react/features/settings/components/web/audio/Meter.js Ver arquivo

@@ -1,45 +0,0 @@
1
-// @flow
2
-
3
-import React from 'react';
4
-import { Icon, IconMeter } from '../../../../base/icons';
5
-
6
-type Props = {
7
-
8
-    /**
9
-     * Own class name for the component.
10
-     */
11
-    className: string,
12
-
13
-    /**
14
-     * Flag indicating whether the component is greyed out/disabled.
15
-     */
16
-    isDisabled?: boolean,
17
-
18
-    /**
19
-     * The level of the meter.
20
-     * Should be between 0 and 7 as per the used SVG.
21
-     */
22
-    level: number,
23
-};
24
-
25
-/**
26
- * React {@code Component} representing an audio level meter.
27
- *
28
- * @returns { ReactElement}
29
- */
30
-export default function({ className, isDisabled, level }: Props) {
31
-    let ownClassName;
32
-
33
-    if (level > -1) {
34
-        ownClassName = `metr metr-l-${level}`;
35
-    } else {
36
-        ownClassName = `metr ${isDisabled ? 'metr--disabled' : ''}`;
37
-    }
38
-
39
-    return (
40
-        <Icon
41
-            className = { `${ownClassName} ${className}` }
42
-            size = { 12 }
43
-            src = { IconMeter } />
44
-    );
45
-}

+ 0
- 172
react/features/settings/components/web/audio/MicrophoneEntry.js Ver arquivo

@@ -1,172 +0,0 @@
1
-// @flow
2
-
3
-import React, { Component } from 'react';
4
-
5
-import AudioSettingsEntry, { type Props as AudioSettingsEntryProps } from './AudioSettingsEntry';
6
-import JitsiMeetJS from '../../../../base/lib-jitsi-meet/_';
7
-import Meter from './Meter';
8
-
9
-const JitsiTrackEvents = JitsiMeetJS.events.track;
10
-
11
-type Props = AudioSettingsEntryProps & {
12
-
13
-    /**
14
-     * The deviceId of the microphone.
15
-     */
16
-    deviceId: string,
17
-
18
-    /**
19
-     * Flag indicating if there is a problem with the device.
20
-     */
21
-    hasError?: boolean,
22
-
23
-    /**
24
-     * The audio track for the current entry.
25
-     */
26
-    jitsiTrack: Object,
27
-
28
-    /**
29
-     * Click handler for component.
30
-     */
31
-    onClick: Function,
32
-}
33
-
34
-type State = {
35
-
36
-    /**
37
-     * The audio level.
38
-     */
39
-    level: number,
40
-}
41
-
42
-/**
43
- * React {@code Component} representing an entry for the microphone audio settings.
44
- *
45
- * @param {Props} props - The props of the component.
46
- * @returns { ReactElement}
47
- */
48
-export default class MicrophoneEntry extends Component<Props, State> {
49
-    /**
50
-     * Initializes a new {@code MicrophoneEntry} instance.
51
-     *
52
-     * @param {Object} props - The read-only properties with which the new
53
-     * instance is to be initialized.
54
-     */
55
-    constructor(props: Props) {
56
-        super(props);
57
-
58
-        this.state = {
59
-            level: -1
60
-        };
61
-        this._onClick = this._onClick.bind(this);
62
-        this._updateLevel = this._updateLevel.bind(this);
63
-    }
64
-
65
-    _onClick: () => void;
66
-
67
-    /**
68
-     * Click handler for the entry.
69
-     *
70
-     * @returns {void}
71
-     */
72
-    _onClick() {
73
-        this.props.onClick(this.props.deviceId);
74
-    }
75
-
76
-    _updateLevel: (number) => void;
77
-
78
-    /**
79
-     * Updates the level of the meter.
80
-     *
81
-     * @param {number} num - The audio level provided by the jitsiTrack.
82
-     * @returns {void}
83
-     */
84
-    _updateLevel(num) {
85
-        this.setState({
86
-            level: Math.floor(num / 0.125)
87
-        });
88
-    }
89
-
90
-    /**
91
-     * Subscribes to audio level chanages comming from the jitsiTrack.
92
-     *
93
-     * @returns {void}
94
-     */
95
-    _startListening() {
96
-        const { jitsiTrack } = this.props;
97
-
98
-        jitsiTrack && jitsiTrack.on(
99
-            JitsiTrackEvents.TRACK_AUDIO_LEVEL_CHANGED,
100
-            this._updateLevel);
101
-    }
102
-
103
-    /**
104
-     * Unsubscribes from chanages comming from the jitsiTrack.
105
-     *
106
-     * @param {Object} jitsiTrack - The jitsiTrack to unsubscribe from.
107
-     * @returns {void}
108
-     */
109
-    _stopListening(jitsiTrack) {
110
-        jitsiTrack && jitsiTrack.off(
111
-            JitsiTrackEvents.TRACK_AUDIO_LEVEL_CHANGED,
112
-            this._updateLevel);
113
-        this.setState({
114
-            level: -1
115
-        });
116
-    }
117
-
118
-    /**
119
-     * Implements React's {@link Component#componentDidUpdate}.
120
-     *
121
-     * @inheritdoc
122
-     */
123
-    componentDidUpdate(prevProps: Props) {
124
-        if (prevProps.jitsiTrack !== this.props.jitsiTrack) {
125
-            this._stopListening(prevProps.jitsiTrack);
126
-            this._startListening();
127
-        }
128
-    }
129
-
130
-    /**
131
-     * Implements React's {@link Component#componentDidMount}.
132
-     *
133
-     * @inheritdoc
134
-     */
135
-    componentDidMount() {
136
-        this._startListening();
137
-    }
138
-
139
-    /**
140
-     * Implements React's {@link Component#componentWillUnmount}.
141
-     *
142
-     * @inheritdoc
143
-     */
144
-    compmonentWillUnmount() {
145
-        this._stopListening(this.props.jitsiTrack);
146
-    }
147
-
148
-    /**
149
-     * Implements React's {@link Component#render}.
150
-     *
151
-     * @inheritdoc
152
-     */
153
-    render() {
154
-        const { children, hasError, isSelected } = this.props;
155
-
156
-        return (
157
-            <div
158
-                className = 'audio-preview-microphone'
159
-                onClick = { this._onClick }>
160
-                <AudioSettingsEntry
161
-                    hasError = { hasError }
162
-                    isSelected = { isSelected }>
163
-                    {children}
164
-                </AudioSettingsEntry>
165
-                <Meter
166
-                    className = 'audio-preview-meter-mic'
167
-                    isDisabled = { hasError }
168
-                    level = { this.state.level } />
169
-            </div>
170
-        );
171
-    }
172
-}

+ 0
- 119
react/features/settings/components/web/audio/SpeakerEntry.js Ver arquivo

@@ -1,119 +0,0 @@
1
-// @flow
2
-
3
-import React, { Component } from 'react';
4
-
5
-import AudioSettingsEntry from './AudioSettingsEntry';
6
-import logger from '../../../logger';
7
-import TestButton from './TestButton';
8
-
9
-const TEST_SOUND_PATH = 'sounds/ring.wav';
10
-
11
-/**
12
- * The type of the React {@code Component} props of {@link SpeakerEntry}.
13
- */
14
-type Props = {
15
-
16
-    /**
17
-     * The text label for the entry.
18
-     */
19
-    children: React$Node,
20
-
21
-    /**
22
-     * Flag controlling the selection state of the entry.
23
-     */
24
-    isSelected: boolean,
25
-
26
-    /**
27
-     * The deviceId of the speaker.
28
-     */
29
-    deviceId: string,
30
-
31
-    /**
32
-     * Click handler for the component.
33
-     */
34
-    onClick: Function,
35
-};
36
-
37
-/**
38
- * Implements a React {@link Component} which displays an audio
39
- * output settings entry. The user can click and play a test sound.
40
- *
41
- * @extends Component
42
- */
43
-export default class SpeakerEntry extends Component<Props> {
44
-    /**
45
-     * A React ref to the HTML element containing the {@code audio} instance.
46
-     */
47
-    audioRef: Object;
48
-
49
-    /**
50
-     * Initializes a new {@code SpeakerEntry} instance.
51
-     *
52
-     * @param {Object} props - The read-only properties with which the new
53
-     * instance is to be initialized.
54
-     */
55
-    constructor(props: Props) {
56
-        super(props);
57
-
58
-        this.audioRef = React.createRef();
59
-        this._onTestButtonClick = this._onTestButtonClick.bind(this);
60
-        this._onClick = this._onClick.bind(this);
61
-    }
62
-
63
-    _onClick: () => void;
64
-
65
-    /**
66
-     * Click handler for the entry.
67
-     *
68
-     * @returns {void}
69
-     */
70
-    _onClick() {
71
-        this.props.onClick(this.props.deviceId);
72
-    }
73
-
74
-    _onTestButtonClick: Object => void;
75
-
76
-    /**
77
-     * Click handler for Test button.
78
-     * Sets the current audio output id and plays a sound.
79
-     *
80
-     * @param {Object} e - The sythetic event.
81
-     * @returns {void}
82
-     */
83
-    async _onTestButtonClick(e) {
84
-        e.stopPropagation();
85
-
86
-        try {
87
-            await this.audioRef.current.setSinkId(this.props.deviceId);
88
-            this.audioRef.current.play();
89
-        } catch (err) {
90
-            logger.log('Could not set sink id', err);
91
-        }
92
-    }
93
-
94
-    /**
95
-     * Implements React's {@link Component#render}.
96
-     *
97
-     * @inheritdoc
98
-     */
99
-    render() {
100
-        const { children, isSelected, deviceId } = this.props;
101
-
102
-        return (
103
-            <div
104
-                className = 'audio-preview-speaker'
105
-                onClick = { this._onClick }>
106
-                <AudioSettingsEntry
107
-                    isSelected = { isSelected }
108
-                    key = { deviceId }>
109
-                    {children}
110
-                </AudioSettingsEntry>
111
-                <TestButton onClick = { this._onTestButtonClick } />
112
-                <audio
113
-                    preload = 'auto'
114
-                    ref = { this.audioRef }
115
-                    src = { TEST_SOUND_PATH } />
116
-            </div>
117
-        );
118
-    }
119
-}

+ 0
- 26
react/features/settings/components/web/audio/TestButton.js Ver arquivo

@@ -1,26 +0,0 @@
1
-// @flow
2
-
3
-import React from 'react';
4
-
5
-type Props = {
6
-
7
-    /**
8
-     * Click handler for the button.
9
-     */
10
-    onClick: Function,
11
-};
12
-
13
-/**
14
- * React {@code Component} representing an button used for testing output sound.
15
- *
16
- * @returns { ReactElement}
17
- */
18
-export default function TestButton({ onClick }: Props) {
19
-    return (
20
-        <div
21
-            className = 'audio-preview-test-button'
22
-            onClick = { onClick }>
23
-            Test
24
-        </div>
25
-    );
26
-}

+ 0
- 2
react/features/settings/components/web/index.js Ver arquivo

@@ -1,4 +1,2 @@
1 1
 export { default as SettingsButton } from './SettingsButton';
2 2
 export { default as SettingsDialog } from './SettingsDialog';
3
-export { default as AudioSettingsPopup } from './audio/AudioSettingsPopup';
4
-export { default as VideoSettingsPopup } from './video/VideoSettingsPopup';

+ 0
- 220
react/features/settings/components/web/video/VideoSettingsContent.js Ver arquivo

@@ -1,220 +0,0 @@
1
-// @flow
2
-
3
-import React, { Component } from 'react';
4
-
5
-import { translate } from '../../../../base/i18n';
6
-import { equals } from '../../../../base/redux';
7
-import Video from '../../../../base/media/components/Video';
8
-import { createLocalVideoTracks } from '../../../functions';
9
-
10
-
11
-const videoClassName = 'video-preview-video flipVideoX';
12
-
13
-/**
14
- * The type of the React {@code Component} props of {@link VideoSettingsContent}.
15
- */
16
-export type Props = {
17
-
18
-    /**
19
-     * The deviceId of the camera device currently being used.
20
-     */
21
-    currentCameraDeviceId: string,
22
-
23
-    /**
24
-     * Callback invoked to change current camera.
25
-     */
26
-    setVideoInputDevice: Function,
27
-
28
-    /**
29
-     * Invoked to obtain translated strings.
30
-     */
31
-    t: Function,
32
-
33
-    /**
34
-     * Callback invoked to toggle the settings popup visibility.
35
-     */
36
-    toggleVideoSettings: Function,
37
-
38
-    /**
39
-     * All the camera device ids currently connected.
40
-     */
41
-    videoDeviceIds: string[],
42
-};
43
-
44
-/**
45
- * The type of the React {@code Component} state of {@link VideoSettingsContent}.
46
- */
47
-type State = {
48
-
49
-    /**
50
-     * An array of all the jitsiTracks and eventual errors.
51
-     */
52
-    trackData: Object[],
53
-};
54
-
55
-/**
56
- * Implements a React {@link Component} which displays a list of video
57
- * previews to choose from.
58
- *
59
- * @extends Component
60
- */
61
-class VideoSettingsContent extends Component<Props, State> {
62
-    _componentWasUnmounted: boolean;
63
-
64
-    /**
65
-     * Initializes a new {@code VideoSettingsContent} instance.
66
-     *
67
-     * @param {Object} props - The read-only properties with which the new
68
-     * instance is to be initialized.
69
-     */
70
-    constructor(props) {
71
-        super(props);
72
-
73
-        this.state = {
74
-            trackData: new Array(props.videoDeviceIds.length).fill({
75
-                jitsiTrack: null
76
-            })
77
-        };
78
-    }
79
-
80
-    /**
81
-     * Creates and updates the track data.
82
-     *
83
-     * @returns {void}
84
-     */
85
-    async _setTracks() {
86
-        this._disposeTracks(this.state.trackData);
87
-
88
-        const trackData = await createLocalVideoTracks(
89
-            this.props.videoDeviceIds,
90
-        );
91
-
92
-        // In case the component gets unmounted before the tracks are created
93
-        // avoid a leak by not setting the state
94
-        if (this._componentWasUnmounted) {
95
-            this._disposeTracks(trackData);
96
-        } else {
97
-            this.setState({
98
-                trackData
99
-            });
100
-        }
101
-    }
102
-
103
-    /**
104
-     * Destroys all the tracks from trackData object.
105
-     *
106
-     * @param {Object[]} trackData - An array of tracks that are to be disposed.
107
-     * @returns {Promise<void>}
108
-     */
109
-    _disposeTracks(trackData) {
110
-        trackData.forEach(({ jitsiTrack }) => {
111
-            jitsiTrack && jitsiTrack.dispose();
112
-        });
113
-    }
114
-
115
-    /**
116
-     * Returns the click handler used when selecting the video preview.
117
-     *
118
-     * @param {string} deviceId - The id of the camera device.
119
-     * @returns {Function}
120
-     */
121
-    _onEntryClick(deviceId) {
122
-        return () => {
123
-            this.props.setVideoInputDevice(deviceId);
124
-            this.props.toggleVideoSettings();
125
-        };
126
-    }
127
-
128
-    /**
129
-     * Renders a preview entry.
130
-     *
131
-     * @param {Object} data - The track data.
132
-     * @param {number} index - The index of the entry.
133
-     * @returns {React$Node}
134
-     */
135
-    _renderPreviewEntry(data, index) {
136
-        const { error, jitsiTrack, deviceId } = data;
137
-        const { currentCameraDeviceId, t } = this.props;
138
-        const isSelected = deviceId === currentCameraDeviceId;
139
-        const key = `vp-${index}`;
140
-        const className = 'video-preview-entry';
141
-
142
-        if (error) {
143
-            return (
144
-                <div
145
-                    className = { className }
146
-                    key = { key }>
147
-                    <div className = 'video-preview-error'>{t(error)}</div>
148
-                </div>
149
-            );
150
-        }
151
-
152
-        const props: Object = {
153
-            className,
154
-            key
155
-        };
156
-
157
-        if (isSelected) {
158
-            props.className = `${className} video-preview-entry--selected`;
159
-        } else {
160
-            props.onClick = this._onEntryClick(deviceId);
161
-        }
162
-
163
-        return (
164
-            <div { ...props }>
165
-                <div className = 'video-preview-overlay' />
166
-                <Video
167
-                    className = { videoClassName }
168
-                    videoTrack = {{ jitsiTrack }} />
169
-            </div>
170
-        );
171
-    }
172
-
173
-    /**
174
-     * Implements React's {@link Component#componentDidMount}.
175
-     *
176
-     * @inheritdoc
177
-     */
178
-    componentDidMount() {
179
-        this._setTracks();
180
-    }
181
-
182
-    /**
183
-     * Implements React's {@link Component#componentWillUnmount}.
184
-     *
185
-     * @inheritdoc
186
-     */
187
-    componentWillUnmount() {
188
-        this._componentWasUnmounted = true;
189
-        this._disposeTracks(this.state.trackData);
190
-    }
191
-
192
-    /**
193
-     * Implements React's {@link Component#componentDidUpdate}.
194
-     *
195
-     * @inheritdoc
196
-     */
197
-    componentDidUpdate(prevProps) {
198
-        if (!equals(this.props.videoDeviceIds, prevProps.videoDeviceIds)) {
199
-            this._setTracks();
200
-        }
201
-    }
202
-
203
-    /**
204
-     * Implements React's {@link Component#render}.
205
-     *
206
-     * @inheritdoc
207
-     */
208
-    render() {
209
-        const { trackData } = this.state;
210
-
211
-        return (
212
-            <div>
213
-                {trackData.map((data, i) => this._renderPreviewEntry(data, i))}
214
-            </div>
215
-        );
216
-    }
217
-}
218
-
219
-
220
-export default translate(VideoSettingsContent);

+ 0
- 85
react/features/settings/components/web/video/VideoSettingsPopup.js Ver arquivo

@@ -1,85 +0,0 @@
1
-// @flow
2
-
3
-import React from 'react';
4
-import InlineDialog from '@atlaskit/inline-dialog';
5
-
6
-import { toggleVideoSettings } from '../../../actions';
7
-import {
8
-    getVideoDeviceIds,
9
-    setVideoInputDevice as setVideoInputDeviceAction
10
-} from '../../../../base/devices';
11
-import { getVideoSettingsVisibility } from '../../../functions';
12
-import { connect } from '../../../../base/redux';
13
-import { getCurrentCameraDeviceId } from '../../../../base/settings';
14
-import VideoSettingsContent, { type Props as VideoSettingsProps } from './VideoSettingsContent';
15
-
16
-
17
-type Props = VideoSettingsProps & {
18
-
19
-   /**
20
-    * Component children (the Video button).
21
-    */
22
-    children: React$Node,
23
-
24
-   /**
25
-    * Flag controlling the visibility of the popup.
26
-    */
27
-    isOpen: boolean,
28
-
29
-   /**
30
-    * Callback executed when the popup closes.
31
-    */
32
-    onClose: Function,
33
-}
34
-
35
-/**
36
- * Popup with a preview of all the video devices.
37
- *
38
- * @returns {ReactElement}
39
- */
40
-function VideoSettingsPopup({
41
-    currentCameraDeviceId,
42
-    children,
43
-    isOpen,
44
-    onClose,
45
-    setVideoInputDevice,
46
-    videoDeviceIds
47
-}: Props) {
48
-    return (
49
-        <div className = 'video-preview'>
50
-            <InlineDialog
51
-                content = { <VideoSettingsContent
52
-                    currentCameraDeviceId = { currentCameraDeviceId }
53
-                    setVideoInputDevice = { setVideoInputDevice }
54
-                    toggleVideoSettings = { onClose }
55
-                    videoDeviceIds = { videoDeviceIds } /> }
56
-                isOpen = { isOpen }
57
-                onClose = { onClose }
58
-                position = 'top right'>
59
-                { children }
60
-            </InlineDialog>
61
-        </div>
62
-    );
63
-}
64
-
65
-/**
66
- * Maps (parts of) the redux state to the associated {@code VideoSettingsPopup}'s
67
- * props.
68
- *
69
- * @param {Object} state - Redux state.
70
- * @returns {Object}
71
- */
72
-function mapStateToProps(state) {
73
-    return {
74
-        currentCameraDeviceId: getCurrentCameraDeviceId(state),
75
-        isOpen: getVideoSettingsVisibility(state),
76
-        videoDeviceIds: getVideoDeviceIds(state)
77
-    };
78
-}
79
-
80
-const mapDispatchToProps = {
81
-    onClose: toggleVideoSettings,
82
-    setVideoInputDevice: setVideoInputDeviceAction
83
-};
84
-
85
-export default connect(mapStateToProps, mapDispatchToProps)(VideoSettingsPopup);

+ 0
- 71
react/features/settings/functions.js Ver arquivo

@@ -2,7 +2,6 @@
2 2
 import { toState } from '../base/redux';
3 3
 import { parseStandardURIString } from '../base/util';
4 4
 import { i18next, DEFAULT_LANGUAGE, LANGUAGES } from '../base/i18n';
5
-import { createLocalTrack } from '../base/lib-jitsi-meet/functions';
6 5
 import {
7 6
     getLocalParticipant,
8 7
     isLocalParticipantModerator
@@ -131,73 +130,3 @@ export function getProfileTabProps(stateful: Object | Function) {
131 130
         email: localParticipant.email
132 131
     };
133 132
 }
134
-
135
-/**
136
- * Returns a promise which resolves with a list of objects containing
137
- * all the video jitsiTracks and appropriate errors for the given device ids.
138
- *
139
- * @param {string[]} ids - The list of the camera ids for wich to create tracks.
140
- *
141
- * @returns {Promise<Object[]>}
142
- */
143
-export function createLocalVideoTracks(ids: string[]) {
144
-    return Promise.all(ids.map(deviceId => createLocalTrack('video', deviceId)
145
-                   .then(jitsiTrack => {
146
-                       return {
147
-                           jitsiTrack,
148
-                           deviceId
149
-                       };
150
-                   })
151
-                   .catch(() => {
152
-                       return {
153
-                           jitsiTrack: null,
154
-                           deviceId,
155
-                           error: 'deviceSelection.previewUnavailable'
156
-                       };
157
-                   })));
158
-}
159
-
160
-
161
-/**
162
- * Returns a promise which resolves with an object containing the corresponding
163
- * the audio jitsiTrack/error.
164
- *
165
- * @param {string} deviceId - The deviceId for the current microphone.
166
- *
167
- * @returns {Promise<Object>}
168
- */
169
-export function createLocalAudioTrack(deviceId: string) {
170
-    return createLocalTrack('audio', deviceId)
171
-                   .then(jitsiTrack => {
172
-                       return {
173
-                           hasError: false,
174
-                           jitsiTrack
175
-                       };
176
-                   })
177
-                   .catch(() => {
178
-                       return {
179
-                           hasError: true,
180
-                           jitsiTrack: null
181
-                       };
182
-                   });
183
-}
184
-
185
-/**
186
- * Returns the visibility state of the audio settings.
187
- *
188
- * @param {Object} state - The state of the application.
189
- * @returns {boolean}
190
- */
191
-export function getAudioSettingsVisibility(state: Object) {
192
-    return state['features/settings'].audioSettingsVisible;
193
-}
194
-
195
-/**
196
- * Returns the visibility state of the video settings.
197
- *
198
- * @param {Object} state - The state of the application.
199
- * @returns {boolean}
200
- */
201
-export function getVideoSettingsVisibility(state: Object) {
202
-    return state['features/settings'].videoSettingsVisible;
203
-}

+ 1
- 15
react/features/settings/reducer.js Ver arquivo

@@ -2,11 +2,7 @@
2 2
 
3 3
 import { ReducerRegistry } from '../base/redux';
4 4
 
5
-import {
6
-    SET_AUDIO_SETTINGS_VISIBILITY,
7
-    SET_SETTINGS_VIEW_VISIBLE,
8
-    SET_VIDEO_SETTINGS_VISIBILITY
9
-} from './actionTypes';
5
+import { SET_SETTINGS_VIEW_VISIBLE } from './actionTypes';
10 6
 
11 7
 ReducerRegistry.register('features/settings', (state = {}, action) => {
12 8
     switch (action.type) {
@@ -15,16 +11,6 @@ ReducerRegistry.register('features/settings', (state = {}, action) => {
15 11
             ...state,
16 12
             visible: action.visible
17 13
         };
18
-    case SET_AUDIO_SETTINGS_VISIBILITY:
19
-        return {
20
-            ...state,
21
-            audioSettingsVisible: action.value
22
-        };
23
-    case SET_VIDEO_SETTINGS_VISIBILITY:
24
-        return {
25
-            ...state,
26
-            videoSettingsVisible: action.value
27
-        };
28 14
     }
29 15
 
30 16
     return state;

+ 0
- 127
react/features/toolbox/components/web/AudioSettingsButton.js Ver arquivo

@@ -1,127 +0,0 @@
1
-// @flow
2
-
3
-import React, { Component } from 'react';
4
-
5
-import AudioMuteButton from '../AudioMuteButton';
6
-import { hasAvailableDevices } from '../../../base/devices';
7
-import { IconArrowDown } from '../../../base/icons';
8
-import JitsiMeetJS from '../../../base/lib-jitsi-meet/_';
9
-import { ToolboxButtonWithIcon } from '../../../base/toolbox';
10
-import { connect } from '../../../base/redux';
11
-
12
-import { AudioSettingsPopup, toggleAudioSettings } from '../../../settings';
13
-
14
-type Props = {
15
-
16
-    /**
17
-     * Click handler for the small icon. Opens audio options.
18
-     */
19
-    onAudioOptionsClick: Function,
20
-
21
-    /**
22
-     * If the user has audio input or audio output devices.
23
-     */
24
-    hasDevices: boolean,
25
-
26
-    /**
27
-     * Flag controlling the visibility of the button.
28
-     */
29
-    visible: boolean,
30
-};
31
-
32
-type State = {
33
-
34
-    /**
35
-     * If there are permissions for audio devices.
36
-     */
37
-    hasPermissions: boolean,
38
-}
39
-
40
-/**
41
- * Button used for audio & audio settings.
42
- *
43
- * @returns {ReactElement}
44
- */
45
-class AudioSettingsButton extends Component<Props, State> {
46
-    /**
47
-     * Initializes a new {@code AudioSettingsButton} instance.
48
-     *
49
-     * @param {Object} props - The read-only properties with which the new
50
-     * instance is to be initialized.
51
-     */
52
-    constructor(props) {
53
-        super(props);
54
-
55
-        this.state = {
56
-            hasPermissions: false
57
-        };
58
-    }
59
-
60
-    /**
61
-     * Updates device permissions.
62
-     *
63
-     * @returns {Promise<void>}
64
-     */
65
-    async _updatePermissions() {
66
-        const hasPermissions = await JitsiMeetJS.mediaDevices.isDevicePermissionGranted(
67
-            'audio',
68
-        );
69
-
70
-        this.setState({
71
-            hasPermissions
72
-        });
73
-    }
74
-
75
-    /**
76
-     * Implements React's {@link Component#componentDidMount}.
77
-     *
78
-     * @inheritdoc
79
-     */
80
-    componentDidMount() {
81
-        this._updatePermissions();
82
-    }
83
-
84
-    /**
85
-     * Implements React's {@link Component#render}.
86
-     *
87
-     * @inheritdoc
88
-     */
89
-    render() {
90
-        const { hasDevices, onAudioOptionsClick, visible } = this.props;
91
-        const settingsDisabled = !this.state.hasPermissions || !hasDevices;
92
-
93
-        return visible ? (
94
-            <AudioSettingsPopup>
95
-                <ToolboxButtonWithIcon
96
-                    icon = { IconArrowDown }
97
-                    iconDisabled = { settingsDisabled }
98
-                    onIconClick = { onAudioOptionsClick }>
99
-                    <AudioMuteButton />
100
-                </ToolboxButtonWithIcon>
101
-            </AudioSettingsPopup>
102
-        ) : null;
103
-    }
104
-}
105
-
106
-/**
107
- * Function that maps parts of Redux state tree into component props.
108
- *
109
- * @param {Object} state - Redux state.
110
- * @returns {Object}
111
- */
112
-function mapStateToProps(state) {
113
-    return {
114
-        hasDevices:
115
-            hasAvailableDevices(state, 'audioInput')
116
-            || hasAvailableDevices(state, 'audioOutput')
117
-    };
118
-}
119
-
120
-const mapDispatchToProps = {
121
-    onAudioOptionsClick: toggleAudioSettings
122
-};
123
-
124
-export default connect(
125
-    mapStateToProps,
126
-    mapDispatchToProps,
127
-)(AudioSettingsButton);

+ 6
- 48
react/features/toolbox/components/web/Toolbox.js Ver arquivo

@@ -72,7 +72,6 @@ import {
72 72
     setToolbarHovered
73 73
 } from '../../actions';
74 74
 import AudioMuteButton from '../AudioMuteButton';
75
-import AudioSettingsButton from './AudioSettingsButton';
76 75
 import DownloadButton from '../DownloadButton';
77 76
 import { isToolboxVisible } from '../../functions';
78 77
 import HangupButton from '../HangupButton';
@@ -82,7 +81,6 @@ import OverflowMenuProfileItem from './OverflowMenuProfileItem';
82 81
 import MuteEveryoneButton from './MuteEveryoneButton';
83 82
 import ToolbarButton from './ToolbarButton';
84 83
 import VideoMuteButton from '../VideoMuteButton';
85
-import VideoSettingsButton from './VideoSettingsButton';
86 84
 import {
87 85
     ClosedCaptionButton
88 86
 } from '../../../subtitles';
@@ -128,11 +126,6 @@ type Props = {
128 126
      */
129 127
     _fullScreen: boolean,
130 128
 
131
-    /**
132
-     * Whether or not the prejoin page is enabled.
133
-     */
134
-    _prejoinPageEnabled: boolean,
135
-
136 129
     /**
137 130
      * Whether or not the tile view is enabled.
138 131
      */
@@ -1123,40 +1116,6 @@ class Toolbox extends Component<Props, State> {
1123 1116
         });
1124 1117
     }
1125 1118
 
1126
-    /**
1127
-     * Renders the Audio controlling button.
1128
-     *
1129
-     * @returns {ReactElement}
1130
-     */
1131
-    _renderAudioButton() {
1132
-        return this._shouldShowButton('microphone')
1133
-            ? this.props._prejoinPageEnabled
1134
-                ? <AudioSettingsButton
1135
-                    key = 'asb'
1136
-                    visible = { true } />
1137
-                : <AudioMuteButton
1138
-                    key = 'amb'
1139
-                    visible = { true } />
1140
-            : null;
1141
-    }
1142
-
1143
-    /**
1144
-     * Renders the Video controlling button.
1145
-     *
1146
-     * @returns {ReactElement}
1147
-     */
1148
-    _renderVideoButton() {
1149
-        return this._shouldShowButton('camera')
1150
-            ? this.props._prejoinPageEnabled
1151
-                ? <VideoSettingsButton
1152
-                    key = 'vsb'
1153
-                    visible = { true } />
1154
-                : <VideoMuteButton
1155
-                    key = 'vmb'
1156
-                    visible = { true } />
1157
-            : null;
1158
-    }
1159
-
1160 1119
     /**
1161 1120
      * Renders the toolbox content.
1162 1121
      *
@@ -1275,10 +1234,12 @@ class Toolbox extends Component<Props, State> {
1275 1234
                     }
1276 1235
                 </div>
1277 1236
                 <div className = 'button-group-center'>
1278
-                    { this._renderAudioButton() }
1237
+                    <AudioMuteButton
1238
+                        visible = { this._shouldShowButton('microphone') } />
1279 1239
                     <HangupButton
1280 1240
                         visible = { this._shouldShowButton('hangup') } />
1281
-                    { this._renderVideoButton() }
1241
+                    <VideoMuteButton
1242
+                        visible = { this._shouldShowButton('camera') } />
1282 1243
                 </div>
1283 1244
                 <div className = 'button-group-right'>
1284 1245
                     { buttonsRight.indexOf('localrecording') !== -1
@@ -1342,9 +1303,7 @@ function _mapStateToProps(state) {
1342 1303
     let { desktopSharingEnabled } = state['features/base/conference'];
1343 1304
     const {
1344 1305
         callStatsID,
1345
-        enableFeaturesBasedOnToken,
1346
-        iAmRecorder,
1347
-        prejoinPageEnabled
1306
+        iAmRecorder
1348 1307
     } = state['features/base/config'];
1349 1308
     const sharedVideoStatus = state['features/shared-video'].status;
1350 1309
     const {
@@ -1359,7 +1318,7 @@ function _mapStateToProps(state) {
1359 1318
 
1360 1319
     let desktopSharingDisabledTooltipKey;
1361 1320
 
1362
-    if (enableFeaturesBasedOnToken) {
1321
+    if (state['features/base/config'].enableFeaturesBasedOnToken) {
1363 1322
         // we enable desktop sharing if any participant already have this
1364 1323
         // feature enabled
1365 1324
         desktopSharingEnabled = getParticipants(state)
@@ -1395,7 +1354,6 @@ function _mapStateToProps(state) {
1395 1354
         _localParticipantID: localParticipant.id,
1396 1355
         _localRecState: localRecordingStates,
1397 1356
         _overflowMenuVisible: overflowMenuVisible,
1398
-        _prejoinPageEnabled: prejoinPageEnabled,
1399 1357
         _raisedHand: localParticipant.raisedHand,
1400 1358
         _screensharing: localVideo && localVideo.videoType === 'desktop',
1401 1359
         _sharingVideo: sharedVideoStatus === 'playing'

+ 0
- 124
react/features/toolbox/components/web/VideoSettingsButton.js Ver arquivo

@@ -1,124 +0,0 @@
1
-// @flow
2
-
3
-import React, { Component } from 'react';
4
-
5
-import { toggleVideoSettings, VideoSettingsPopup } from '../../../settings';
6
-import VideoMuteButton from '../VideoMuteButton';
7
-import JitsiMeetJS from '../../../base/lib-jitsi-meet/_';
8
-import { hasAvailableDevices } from '../../../base/devices';
9
-import { IconArrowDown } from '../../../base/icons';
10
-import { connect } from '../../../base/redux';
11
-import { ToolboxButtonWithIcon } from '../../../base/toolbox';
12
-
13
-type Props = {
14
-
15
-    /**
16
-     * Click handler for the small icon. Opens video options.
17
-     */
18
-    onVideoOptionsClick: Function,
19
-
20
-    /**
21
-     * If the user has any video devices.
22
-     */
23
-    hasDevices: boolean,
24
-
25
-    /**
26
-     * Flag controlling the visibility of the button.
27
-     */
28
-    visible: boolean,
29
-};
30
-
31
-type State = {
32
-
33
-    /**
34
-     * Whether the app has video permissions or not.
35
-     */
36
-    hasPermissions: boolean,
37
-};
38
-
39
-/**
40
- * Button used for video & video settings.
41
- *
42
- * @returns {ReactElement}
43
- */
44
-class VideoSettingsButton extends Component<Props, State> {
45
-    /**
46
-     * Initializes a new {@code VideoSettingsButton} instance.
47
-     *
48
-     * @param {Object} props - The read-only properties with which the new
49
-     * instance is to be initialized.
50
-     */
51
-    constructor(props) {
52
-        super(props);
53
-
54
-        this.state = {
55
-            hasPermissions: false
56
-        };
57
-    }
58
-
59
-    /**
60
-     * Updates device permissions.
61
-     *
62
-     * @returns {Promise<void>}
63
-     */
64
-    async _updatePermissions() {
65
-        const hasPermissions = await JitsiMeetJS.mediaDevices.isDevicePermissionGranted(
66
-            'video',
67
-        );
68
-
69
-        this.setState({
70
-            hasPermissions
71
-        });
72
-    }
73
-
74
-    /**
75
-     * Implements React's {@link Component#componentDidMount}.
76
-     *
77
-     * @inheritdoc
78
-     */
79
-    componentDidMount() {
80
-        this._updatePermissions();
81
-    }
82
-
83
-    /**
84
-     * Implements React's {@link Component#render}.
85
-     *
86
-     * @inheritdoc
87
-     */
88
-    render() {
89
-        const { hasDevices, onVideoOptionsClick, visible } = this.props;
90
-        const iconDisabled = !this.state.hasPermissions || !hasDevices;
91
-
92
-        return visible ? (
93
-            <VideoSettingsPopup>
94
-                <ToolboxButtonWithIcon
95
-                    icon = { IconArrowDown }
96
-                    iconDisabled = { iconDisabled }
97
-                    onIconClick = { onVideoOptionsClick }>
98
-                    <VideoMuteButton />
99
-                </ToolboxButtonWithIcon>
100
-            </VideoSettingsPopup>
101
-        ) : null;
102
-    }
103
-}
104
-
105
-/**
106
- * Function that maps parts of Redux state tree into component props.
107
- *
108
- * @param {Object} state - Redux state.
109
- * @returns {Object}
110
- */
111
-function mapStateToProps(state) {
112
-    return {
113
-        hasDevices: hasAvailableDevices(state, 'videoInput')
114
-    };
115
-}
116
-
117
-const mapDispatchToProps = {
118
-    onVideoOptionsClick: toggleVideoSettings
119
-};
120
-
121
-export default connect(
122
-    mapStateToProps,
123
-    mapDispatchToProps,
124
-)(VideoSettingsButton);

+ 1
- 3
react/features/toolbox/functions.web.js Ver arquivo

@@ -40,8 +40,6 @@ export function isToolboxVisible(state: Object) {
40 40
         timeoutID,
41 41
         visible
42 42
     } = state['features/toolbox'];
43
-    const { audioSettingsVisible, videoSettingsVisible } = state['features/settings'];
44 43
 
45
-    return Boolean(!iAmSipGateway && (timeoutID || visible || alwaysVisible
46
-                                      || audioSettingsVisible || videoSettingsVisible));
44
+    return Boolean(!iAmSipGateway && (timeoutID || visible || alwaysVisible));
47 45
 }

Carregando…
Cancelar
Salvar