Browse Source

fix(filmstrip): show thumbnails in 1-on-1 with a fake participant

Filmstrip remote thumbnails display under certain conditions, as
defined in filmstrip/functions.web.js. Previously the raw
participant count was used, which included fake participants.
Using the selector getParticipantCount excludes fake participants,
causing YouTube thumbnails to remain hidden in a 1-on-1 call.
master
Leonard Kim 6 years ago
parent
commit
769a2c7c94

+ 14
- 0
react/features/base/participants/functions.js View File

125
     return getParticipants(stateful).length;
125
     return getParticipants(stateful).length;
126
 }
126
 }
127
 
127
 
128
+/**
129
+ * Returns a count of the known participants in the passed in redux state,
130
+ * including fake participants.
131
+ *
132
+ * @param {(Function|Object|Participant[])} stateful - The redux state
133
+ * features/base/participants, the (whole) redux state, or redux's
134
+ * {@code getState} function to be used to retrieve the state
135
+ * features/base/participants.
136
+ * @returns {number}
137
+ */
138
+export function getParticipantCountWithFake(stateful: Object | Function) {
139
+    return _getAllParticipants(stateful).length;
140
+}
141
+
128
 /**
142
 /**
129
  * Returns participant's display name.
143
  * Returns participant's display name.
130
  *
144
  *

+ 5
- 2
react/features/filmstrip/functions.web.js View File

1
 // @flow
1
 // @flow
2
 
2
 
3
 import {
3
 import {
4
-    getParticipantCount,
4
+    getParticipantCountWithFake,
5
     getPinnedParticipant
5
     getPinnedParticipant
6
 } from '../base/participants';
6
 } from '../base/participants';
7
 import { toState } from '../base/redux';
7
 import { toState } from '../base/redux';
36
         return false;
36
         return false;
37
     }
37
     }
38
 
38
 
39
-    const participantCount = getParticipantCount(state);
39
+    // Include fake participants to derive how many thumbnails are dispalyed,
40
+    // as it is assumed all participants, including fake, will be displayed
41
+    // in the filmstrip.
42
+    const participantCount = getParticipantCountWithFake(state);
40
     let pinnedParticipant;
43
     let pinnedParticipant;
41
 
44
 
42
     return Boolean(
45
     return Boolean(

Loading…
Cancel
Save