|
@@ -1,7 +1,7 @@
|
1
|
1
|
// @flow
|
2
|
2
|
|
3
|
3
|
import { getFeatureFlag, FILMSTRIP_ENABLED } from '../base/flags';
|
4
|
|
-import { getParticipantCountWithFake } from '../base/participants';
|
|
4
|
+import { getParticipantCountWithFake, getPinnedParticipant } from '../base/participants';
|
5
|
5
|
import { toState } from '../base/redux';
|
6
|
6
|
|
7
|
7
|
/**
|
|
@@ -26,3 +26,34 @@ export function isFilmstripVisible(stateful: Object | Function) {
|
26
|
26
|
return getParticipantCountWithFake(state) > 1;
|
27
|
27
|
}
|
28
|
28
|
|
|
29
|
+/**
|
|
30
|
+ * Determines whether the remote video thumbnails should be displayed/visible in
|
|
31
|
+ * the filmstrip.
|
|
32
|
+ *
|
|
33
|
+ * @param {Object} state - The full redux state.
|
|
34
|
+ * @returns {boolean} - If remote video thumbnails should be displayed/visible
|
|
35
|
+ * in the filmstrip, then {@code true}; otherwise, {@code false}.
|
|
36
|
+ */
|
|
37
|
+export function shouldRemoteVideosBeVisible(state: Object) {
|
|
38
|
+ if (state['features/invite'].calleeInfoVisible) {
|
|
39
|
+ return false;
|
|
40
|
+ }
|
|
41
|
+
|
|
42
|
+ // Include fake participants to derive how many thumbnails are dispalyed,
|
|
43
|
+ // as it is assumed all participants, including fake, will be displayed
|
|
44
|
+ // in the filmstrip.
|
|
45
|
+ const participantCount = getParticipantCountWithFake(state);
|
|
46
|
+ const pinnedParticipant = getPinnedParticipant(state);
|
|
47
|
+ const { disable1On1Mode } = state['features/base/config'];
|
|
48
|
+
|
|
49
|
+ return Boolean(
|
|
50
|
+ participantCount > 2
|
|
51
|
+
|
|
52
|
+ // Always show the filmstrip when there is another participant to
|
|
53
|
+ // show and the local video is pinned. Note we are not taking the
|
|
54
|
+ // toolbar visibility into account here (unlike web) because
|
|
55
|
+ // showing / hiding views in quick succession on mobile is taxing.
|
|
56
|
+ || (participantCount > 1 && pinnedParticipant?.local)
|
|
57
|
+
|
|
58
|
+ || disable1On1Mode);
|
|
59
|
+}
|