Browse Source

feat(native-participants-pane) fixed comment typos and reworks on volume slider

master
Calin Chitu 4 years ago
parent
commit
9b220f3870

+ 1
- 1
react/features/filmstrip/actions.web.js View File

137
 }
137
 }
138
 
138
 
139
 /**
139
 /**
140
- * Sets the volume for a thumnail's audio.
140
+ * Sets the volume for a thumbnail's audio.
141
  *
141
  *
142
  * @param {string} participantId - The participant ID asociated with the audio.
142
  * @param {string} participantId - The participant ID asociated with the audio.
143
  * @param {string} volume - The volume level.
143
  * @param {string} volume - The volume level.

+ 10
- 0
react/features/filmstrip/functions.native.js View File

25
 
25
 
26
     return getParticipantCountWithFake(state) > 1;
26
     return getParticipantCountWithFake(state) > 1;
27
 }
27
 }
28
+
29
+/**
30
+ * Selector used to get participants volume
31
+ *
32
+ * @param {Object} state - The global state.
33
+ * @returns {string}
34
+ */
35
+export function getParticipantsVolume(state: Object) {
36
+    return state['features/filmstrip'].participantsVolume;
37
+}

+ 1
- 1
react/features/filmstrip/reducer.js View File

31
     horizontalViewDimensions: {},
31
     horizontalViewDimensions: {},
32
 
32
 
33
     /**
33
     /**
34
-     * The custom audio volume levels per perticipant.
34
+     * The custom audio volume levels per participant.
35
      *
35
      *
36
      * @type {Object}
36
      * @type {Object}
37
      */
37
      */

+ 10
- 4
react/features/participants-pane/components/native/ContextMenuMeetingParticipantDetails.js View File

15
     IconMicrophoneEmptySlash,
15
     IconMicrophoneEmptySlash,
16
     IconMuteEveryoneElse, IconVideoOff
16
     IconMuteEveryoneElse, IconVideoOff
17
 } from '../../../base/icons';
17
 } from '../../../base/icons';
18
-import { isLocalParticipantModerator } from '../../../base/participants';
18
+import {
19
+    isLocalParticipantModerator
20
+} from '../../../base/participants';
19
 import { getIsParticipantVideoMuted } from '../../../base/tracks';
21
 import { getIsParticipantVideoMuted } from '../../../base/tracks';
20
 import { openChat } from '../../../chat/actions.native';
22
 import { openChat } from '../../../chat/actions.native';
23
+import { getParticipantsVolume } from '../../../filmstrip';
21
 import {
24
 import {
22
     KickRemoteParticipantDialog,
25
     KickRemoteParticipantDialog,
23
     MuteEveryoneDialog,
26
     MuteEveryoneDialog,
37
 };
40
 };
38
 
41
 
39
 export const ContextMenuMeetingParticipantDetails = ({ participant: p }: Props) => {
42
 export const ContextMenuMeetingParticipantDetails = ({ participant: p }: Props) => {
40
-    const [ volume, setVolume ] = useState(undefined);
43
+    const [ volume, setVolume ] = useState(0);
41
     const dispatch = useDispatch();
44
     const dispatch = useDispatch();
42
     const cancel = useCallback(() => dispatch(hideDialog()), [ dispatch ]);
45
     const cancel = useCallback(() => dispatch(hideDialog()), [ dispatch ]);
43
-    const changeVolume = useCallback(() => setVolume(volume), [ setVolume, volume ]);
46
+    const participantsVolume = useSelector(getParticipantsVolume)[p.id];
47
+    const changeVolume = useCallback(() => {
48
+        setVolume(volume + 1);
49
+    }, [ volume ]);
44
     const displayName = p.name;
50
     const displayName = p.name;
45
     const isLocalModerator = useSelector(isLocalParticipantModerator);
51
     const isLocalModerator = useSelector(isLocalParticipantModerator);
46
     const isParticipantVideoMuted = useSelector(getIsParticipantVideoMuted(p));
52
     const isParticipantVideoMuted = useSelector(getIsParticipantVideoMuted(p));
171
             {/* </TouchableOpacity>*/}
177
             {/* </TouchableOpacity>*/}
172
             <Divider style = { styles.divider } />
178
             <Divider style = { styles.divider } />
173
             <VolumeSlider
179
             <VolumeSlider
174
-                initialValue = { volume }
180
+                initialValue = { participantsVolume }
175
                 onChange = { onVolumeChange } />
181
                 onChange = { onVolumeChange } />
176
         </BottomSheet>
182
         </BottomSheet>
177
     );
183
     );

+ 5
- 4
react/features/participants-pane/components/native/LobbyParticipantList.js View File

10
 import { getLobbyState } from '../../../lobby/functions';
10
 import { getLobbyState } from '../../../lobby/functions';
11
 
11
 
12
 import { LobbyParticipantItem } from './LobbyParticipantItem';
12
 import { LobbyParticipantItem } from './LobbyParticipantItem';
13
+import { participants } from './participants';
13
 import styles from './styles';
14
 import styles from './styles';
14
 
15
 
15
 export const LobbyParticipantList = () => {
16
 export const LobbyParticipantList = () => {
16
     const {
17
     const {
17
         lobbyEnabled,
18
         lobbyEnabled,
18
-        knockingParticipants: participants
19
+        knockingParticipants
19
     } = useSelector(getLobbyState);
20
     } = useSelector(getLobbyState);
20
 
21
 
21
     const dispatch = useDispatch();
22
     const dispatch = useDispatch();
24
         [ dispatch ]);
25
         [ dispatch ]);
25
     const { t } = useTranslation();
26
     const { t } = useTranslation();
26
 
27
 
27
-    if (!lobbyEnabled || !participants.length) {
28
-        return null;
29
-    }
28
+    // if (!lobbyEnabled || !participants.length) {
29
+    //     return null;
30
+    // }
30
 
31
 
31
     return (
32
     return (
32
         <View style = { styles.lobbyList }>
33
         <View style = { styles.lobbyList }>

+ 102
- 0
react/features/participants-pane/components/native/participants.js View File

1
+export const participants = [
2
+    {
3
+        audioOutputDeviceId: 'default',
4
+        avatarURL: undefined,
5
+        botType: undefined,
6
+        conference: undefined,
7
+        connectionStatus: undefined,
8
+        dominantSpeaker: false,
9
+        email: undefined,
10
+        id: 'd0816677',
11
+        isFakeParticipant: undefined,
12
+        isJigasi: undefined,
13
+        loadableAvatarUrl: undefined,
14
+        local: true,
15
+        name: 'testuser2',
16
+        pinned: false,
17
+        presence: undefined,
18
+        role: 'moderator',
19
+        startWithAudioMuted: true,
20
+        startWithVideoMuted: true
21
+    },
22
+    {
23
+        audioOutputDeviceId: 'default',
24
+        avatarURL: undefined,
25
+        botType: undefined,
26
+        conference: undefined,
27
+        connectionStatus: undefined,
28
+        dominantSpeaker: false,
29
+        email: undefined,
30
+        id: 'a0496597',
31
+        isFakeParticipant: undefined,
32
+        isJigasi: undefined,
33
+        loadableAvatarUrl: undefined,
34
+        local: true,
35
+        name: 'me',
36
+        pinned: false,
37
+        presence: undefined,
38
+        role: 'participant',
39
+        startWithAudioMuted: true,
40
+        startWithVideoMuted: false
41
+    },
42
+    {
43
+        audioOutputDeviceId: 'default',
44
+        avatarURL: undefined,
45
+        botType: undefined,
46
+        conference: undefined,
47
+        connectionStatus: undefined,
48
+        dominantSpeaker: false,
49
+        email: undefined,
50
+        id: 'b01081018',
51
+        isFakeParticipant: undefined,
52
+        isJigasi: undefined,
53
+        loadableAvatarUrl: undefined,
54
+        local: true,
55
+        name: 'Tom',
56
+        pinned: false,
57
+        presence: undefined,
58
+        role: 'participant',
59
+        startWithAudioMuted: true,
60
+        startWithVideoMuted: false
61
+    },
62
+    {
63
+        audioOutputDeviceId: 'default',
64
+        avatarURL: undefined,
65
+        botType: undefined,
66
+        conference: undefined,
67
+        connectionStatus: undefined,
68
+        dominantSpeaker: false,
69
+        email: undefined,
70
+        id: 'b0aad221e1',
71
+        isFakeParticipant: undefined,
72
+        isJigasi: undefined,
73
+        loadableAvatarUrl: undefined,
74
+        local: true,
75
+        name: 'George',
76
+        pinned: false,
77
+        presence: undefined,
78
+        role: 'participant',
79
+        startWithAudioMuted: true,
80
+        startWithVideoMuted: false
81
+    },
82
+    {
83
+        audioOutputDeviceId: 'default',
84
+        avatarURL: undefined,
85
+        botType: undefined,
86
+        conference: undefined,
87
+        connectionStatus: undefined,
88
+        dominantSpeaker: false,
89
+        email: undefined,
90
+        id: 'c0108301',
91
+        isFakeParticipant: undefined,
92
+        isJigasi: undefined,
93
+        loadableAvatarUrl: undefined,
94
+        local: true,
95
+        name: 'Carlin',
96
+        pinned: false,
97
+        presence: undefined,
98
+        role: 'participant',
99
+        startWithAudioMuted: true,
100
+        startWithVideoMuted: false
101
+    }
102
+];

+ 2
- 6
react/features/video-menu/components/native/VolumeSlider.js View File

8
 import { Icon, IconVolumeEmpty } from '../../../base/icons';
8
 import { Icon, IconVolumeEmpty } from '../../../base/icons';
9
 import { VOLUME_SLIDER_SCALE } from '../../constants';
9
 import { VOLUME_SLIDER_SCALE } from '../../constants';
10
 
10
 
11
-import styles from './styles';
12
-
13
 /**
11
 /**
14
  * The type of the React {@code Component} props of {@link VolumeSlider}.
12
  * The type of the React {@code Component} props of {@link VolumeSlider}.
15
  */
13
  */
81
         const { palette } = theme;
79
         const { palette } = theme;
82
 
80
 
83
         return (
81
         return (
84
-            <View style = { styles.volumeSliderContainer }>
82
+            <View>
85
                 <Icon
83
                 <Icon
86
                     size = { 24 }
84
                     size = { 24 }
87
-                    src = { IconVolumeEmpty }
88
-                    style = { styles.volumeIcon } />
85
+                    src = { IconVolumeEmpty } />
89
                 <Slider
86
                 <Slider
90
                     maximumTrackTintColor = { palette.field02 }
87
                     maximumTrackTintColor = { palette.field02 }
91
                     maximumValue = { VOLUME_SLIDER_SCALE }
88
                     maximumValue = { VOLUME_SLIDER_SCALE }
92
                     minimumTrackTintColor = { palette.action01 }
89
                     minimumTrackTintColor = { palette.action01 }
93
                     minimumValue = { 0 }
90
                     minimumValue = { 0 }
94
                     onValueChange = { this._onVolumeChange }
91
                     onValueChange = { this._onVolumeChange }
95
-                    style = { styles.sliderContainer }
96
                     thumbTintColor = { palette.field02 }
92
                     thumbTintColor = { palette.field02 }
97
                     value = { volumeLevel } />
93
                     value = { volumeLevel } />
98
             </View>
94
             </View>

Loading…
Cancel
Save