@ -7,6 +7,7 @@ import {
setMaxReceiverVideoQuality ,
setPreferredVideoQuality
} from '../base/conference' ;
import { getParticipantCount } from '../base/participants' ;
import { MiddlewareRegistry , StateListenerRegistry } from '../base/redux' ;
import { shouldDisplayTileView } from '../video-layout' ;
@ -46,21 +47,42 @@ StateListenerRegistry.register(
const { reducedUI } = state [ 'features/base/responsive-ui' ] ;
const _shouldDisplayTileView = shouldDisplayTileView ( state ) ;
const thumbnailSize = state [ 'features/filmstrip' ] ? . tileViewDimensions ? . thumbnailSize ;
const participantCount = getParticipantCount ( state ) ;
return {
displayTileView : _shouldDisplayTileView ,
participantCount ,
reducedUI ,
thumbnailHeight : thumbnailSize ? . height
} ;
} ,
/* listener */ ( { displayTileView , reducedUI , thumbnailHeight } , { dispatch , getState } ) => {
const { maxReceiverVideoQuality } = getState ( ) [ 'features/base/conference' ] ;
/* listener */ ( { displayTileView , participantCount , reducedUI , thumbnailHeight } , { dispatch , getState } ) => {
const state = getState ( ) ;
const { maxReceiverVideoQuality } = state [ 'features/base/conference' ] ;
const { maxFullResolutionParticipants = 2 } = state [ 'features/base/config' ] ;
let newMaxRecvVideoQuality = VIDEO _QUALITY _LEVELS . HIGH ;
if ( reducedUI ) {
newMaxRecvVideoQuality = VIDEO _QUALITY _LEVELS . LOW ;
} else if ( displayTileView && ! Number . isNaN ( thumbnailHeight ) ) {
newMaxRecvVideoQuality = getNearestReceiverVideoQualityLevel ( thumbnailHeight ) ;
// Override HD level calculated for the thumbnail height when # of participants threshold is exceeded
if ( maxReceiverVideoQuality !== newMaxRecvVideoQuality && maxFullResolutionParticipants !== - 1 ) {
const override
= participantCount > maxFullResolutionParticipants
&& newMaxRecvVideoQuality > VIDEO _QUALITY _LEVELS . STANDARD ;
logger . info ( ` The nearest receiver video quality level for thumbnail height: ${ thumbnailHeight } , `
+ ` is: ${ newMaxRecvVideoQuality } , `
+ ` override: ${ String ( override ) } , `
+ ` max full res N: ${ maxFullResolutionParticipants } ` ) ;
if ( override ) {
newMaxRecvVideoQuality = VIDEO _QUALITY _LEVELS . STANDARD ;
}
}
}
if ( maxReceiverVideoQuality !== newMaxRecvVideoQuality ) {