|
@@ -3,11 +3,17 @@
|
3
|
3
|
import Filmstrip from '../../../modules/UI/videolayout/Filmstrip';
|
4
|
4
|
import VideoLayout from '../../../modules/UI/videolayout/VideoLayout';
|
5
|
5
|
import { StateListenerRegistry, equals } from '../base/redux';
|
|
6
|
+import { setFilmstripVisible } from '../filmstrip/actions';
|
6
|
7
|
import { setOverflowDrawer } from '../toolbox/actions.web';
|
7
|
8
|
import { getCurrentLayout, getTileViewGridDimensions, shouldDisplayTileView, LAYOUTS } from '../video-layout';
|
8
|
9
|
|
9
|
10
|
import { setHorizontalViewDimensions, setTileViewDimensions } from './actions.web';
|
10
|
|
-import { DISPLAY_DRAWER_THRESHOLD } from './constants';
|
|
11
|
+import {
|
|
12
|
+ ASPECT_RATIO_BREAKPOINT,
|
|
13
|
+ DISPLAY_DRAWER_THRESHOLD,
|
|
14
|
+ SINGLE_COLUMN_BREAKPOINT,
|
|
15
|
+ TWO_COLUMN_BREAKPOINT
|
|
16
|
+} from './constants';
|
11
|
17
|
|
12
|
18
|
/**
|
13
|
19
|
* Listens for changes in the number of participants to calculate the dimensions of the tile view grid and the tiles.
|
|
@@ -134,3 +140,67 @@ StateListenerRegistry.register(
|
134
|
140
|
/* listener */ (widthBelowThreshold, store) => {
|
135
|
141
|
store.dispatch(setOverflowDrawer(widthBelowThreshold));
|
136
|
142
|
});
|
|
143
|
+
|
|
144
|
+/**
|
|
145
|
+ * Gracefully hide/show the filmstrip when going past threshold.
|
|
146
|
+ */
|
|
147
|
+StateListenerRegistry.register(
|
|
148
|
+ /* selector */ state => state['features/base/responsive-ui'].clientWidth < ASPECT_RATIO_BREAKPOINT,
|
|
149
|
+ /* listener */ (widthBelowThreshold, store) => {
|
|
150
|
+ store.dispatch(setFilmstripVisible(!widthBelowThreshold));
|
|
151
|
+ });
|
|
152
|
+
|
|
153
|
+/**
|
|
154
|
+ * Symbol mapping used for the tile view responsiveness computation.
|
|
155
|
+ */
|
|
156
|
+const responsiveColumnMapping = {
|
|
157
|
+ singleColumn: Symbol('singleColumn'),
|
|
158
|
+ twoColumns: Symbol('twoColumns'),
|
|
159
|
+ twoParticipantsSingleColumn: Symbol('twoParticipantsSingleColumn')
|
|
160
|
+};
|
|
161
|
+
|
|
162
|
+/**
|
|
163
|
+ * Listens for changes in the screen size to recompute
|
|
164
|
+ * the dimensions of the tile view grid and the tiles for responsiveness.
|
|
165
|
+ */
|
|
166
|
+StateListenerRegistry.register(
|
|
167
|
+ /* selector */ state => {
|
|
168
|
+ const { clientWidth } = state['features/base/responsive-ui'];
|
|
169
|
+
|
|
170
|
+ if (clientWidth < TWO_COLUMN_BREAKPOINT && clientWidth >= ASPECT_RATIO_BREAKPOINT) {
|
|
171
|
+ // Forcing the recomputation of tiles when screen switches in or out of
|
|
172
|
+ // the (TWO_COLUMN_BREAKPOINT, ASPECT_RATIO_BREAKPOINT] interval.
|
|
173
|
+ return responsiveColumnMapping.twoColumns;
|
|
174
|
+ } else if (clientWidth < ASPECT_RATIO_BREAKPOINT && clientWidth >= SINGLE_COLUMN_BREAKPOINT) {
|
|
175
|
+ // Forcing the recomputation of tiles when screen switches in or out of
|
|
176
|
+ // the (ASPECT_RATIO_BREAKPOINT, SINGLE_COLUMN_BREAKPOINT] interval.
|
|
177
|
+ return responsiveColumnMapping.twoParticipantsSingleColumn;
|
|
178
|
+ }
|
|
179
|
+
|
|
180
|
+ /**
|
|
181
|
+ * This gets called either when the width of the screen is above {@code TWO_COLUMN_BREAKPOINT}
|
|
182
|
+ * or below {@CODE SINGLE_COLUMN_BREAKPOINT}, however, the internal logic from {@code getMaxColumnCount}
|
|
183
|
+ * only takes the second case into consideration.
|
|
184
|
+ */
|
|
185
|
+ return responsiveColumnMapping.singleColumn;
|
|
186
|
+ },
|
|
187
|
+ /* listener */ (_, store) => {
|
|
188
|
+ const state = store.getState();
|
|
189
|
+
|
|
190
|
+ if (shouldDisplayTileView(state)) {
|
|
191
|
+ const gridDimensions = getTileViewGridDimensions(state);
|
|
192
|
+ const { clientHeight, clientWidth } = state['features/base/responsive-ui'];
|
|
193
|
+ const { isOpen } = state['features/chat'];
|
|
194
|
+
|
|
195
|
+ store.dispatch(
|
|
196
|
+ setTileViewDimensions(
|
|
197
|
+ gridDimensions,
|
|
198
|
+ {
|
|
199
|
+ clientHeight,
|
|
200
|
+ clientWidth
|
|
201
|
+ },
|
|
202
|
+ isOpen
|
|
203
|
+ )
|
|
204
|
+ );
|
|
205
|
+ }
|
|
206
|
+ });
|