瀏覽代碼

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

master
Calin Chitu 3 年之前
父節點
當前提交
9b220f3870

+ 1
- 1
react/features/filmstrip/actions.web.js 查看文件

@@ -137,7 +137,7 @@ export function clickOnVideo(n: number) {
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 142
  * @param {string} participantId - The participant ID asociated with the audio.
143 143
  * @param {string} volume - The volume level.

+ 10
- 0
react/features/filmstrip/functions.native.js 查看文件

@@ -25,3 +25,13 @@ export function isFilmstripVisible(stateful: Object | Function) {
25 25
 
26 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 查看文件

@@ -31,7 +31,7 @@ const DEFAULT_STATE = {
31 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 36
      * @type {Object}
37 37
      */

+ 10
- 4
react/features/participants-pane/components/native/ContextMenuMeetingParticipantDetails.js 查看文件

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

+ 5
- 4
react/features/participants-pane/components/native/LobbyParticipantList.js 查看文件

@@ -10,12 +10,13 @@ import { admitMultiple } from '../../../lobby/actions.native';
10 10
 import { getLobbyState } from '../../../lobby/functions';
11 11
 
12 12
 import { LobbyParticipantItem } from './LobbyParticipantItem';
13
+import { participants } from './participants';
13 14
 import styles from './styles';
14 15
 
15 16
 export const LobbyParticipantList = () => {
16 17
     const {
17 18
         lobbyEnabled,
18
-        knockingParticipants: participants
19
+        knockingParticipants
19 20
     } = useSelector(getLobbyState);
20 21
 
21 22
     const dispatch = useDispatch();
@@ -24,9 +25,9 @@ export const LobbyParticipantList = () => {
24 25
         [ dispatch ]);
25 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 32
     return (
32 33
         <View style = { styles.lobbyList }>

+ 102
- 0
react/features/participants-pane/components/native/participants.js 查看文件

@@ -0,0 +1,102 @@
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 查看文件

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

Loading…
取消
儲存