|
@@ -7,6 +7,7 @@ import {
|
7
|
7
|
setMaxReceiverVideoQuality,
|
8
|
8
|
setPreferredVideoQuality
|
9
|
9
|
} from '../base/conference';
|
|
10
|
+import { getParticipantCount } from '../base/participants';
|
10
|
11
|
import { MiddlewareRegistry, StateListenerRegistry } from '../base/redux';
|
11
|
12
|
import { shouldDisplayTileView } from '../video-layout';
|
12
|
13
|
|
|
@@ -46,21 +47,42 @@ StateListenerRegistry.register(
|
46
|
47
|
const { reducedUI } = state['features/base/responsive-ui'];
|
47
|
48
|
const _shouldDisplayTileView = shouldDisplayTileView(state);
|
48
|
49
|
const thumbnailSize = state['features/filmstrip']?.tileViewDimensions?.thumbnailSize;
|
|
50
|
+ const participantCount = getParticipantCount(state);
|
49
|
51
|
|
50
|
52
|
return {
|
51
|
53
|
displayTileView: _shouldDisplayTileView,
|
|
54
|
+ participantCount,
|
52
|
55
|
reducedUI,
|
53
|
56
|
thumbnailHeight: thumbnailSize?.height
|
54
|
57
|
};
|
55
|
58
|
},
|
56
|
|
- /* listener */ ({ displayTileView, reducedUI, thumbnailHeight }, { dispatch, getState }) => {
|
57
|
|
- const { maxReceiverVideoQuality } = getState()['features/base/conference'];
|
|
59
|
+ /* listener */ ({ displayTileView, participantCount, reducedUI, thumbnailHeight }, { dispatch, getState }) => {
|
|
60
|
+ const state = getState();
|
|
61
|
+ const { maxReceiverVideoQuality } = state['features/base/conference'];
|
|
62
|
+ const { maxFullResolutionParticipants = 2 } = state['features/base/config'];
|
|
63
|
+
|
58
|
64
|
let newMaxRecvVideoQuality = VIDEO_QUALITY_LEVELS.HIGH;
|
59
|
65
|
|
60
|
66
|
if (reducedUI) {
|
61
|
67
|
newMaxRecvVideoQuality = VIDEO_QUALITY_LEVELS.LOW;
|
62
|
68
|
} else if (displayTileView && !Number.isNaN(thumbnailHeight)) {
|
63
|
69
|
newMaxRecvVideoQuality = getNearestReceiverVideoQualityLevel(thumbnailHeight);
|
|
70
|
+
|
|
71
|
+ // Override HD level calculated for the thumbnail height when # of participants threshold is exceeded
|
|
72
|
+ if (maxReceiverVideoQuality !== newMaxRecvVideoQuality && maxFullResolutionParticipants !== -1) {
|
|
73
|
+ const override
|
|
74
|
+ = participantCount > maxFullResolutionParticipants
|
|
75
|
+ && newMaxRecvVideoQuality > VIDEO_QUALITY_LEVELS.STANDARD;
|
|
76
|
+
|
|
77
|
+ logger.info(`The nearest receiver video quality level for thumbnail height: ${thumbnailHeight}, `
|
|
78
|
+ + `is: ${newMaxRecvVideoQuality}, `
|
|
79
|
+ + `override: ${String(override)}, `
|
|
80
|
+ + `max full res N: ${maxFullResolutionParticipants}`);
|
|
81
|
+
|
|
82
|
+ if (override) {
|
|
83
|
+ newMaxRecvVideoQuality = VIDEO_QUALITY_LEVELS.STANDARD;
|
|
84
|
+ }
|
|
85
|
+ }
|
64
|
86
|
}
|
65
|
87
|
|
66
|
88
|
if (maxReceiverVideoQuality !== newMaxRecvVideoQuality) {
|