@ -9,6 +9,7 @@ import { MiddlewareRegistry } from '../redux';
import { TRACK _ADDED , TRACK _REMOVED } from '../tracks' ;
import { TRACK _ADDED , TRACK _REMOVED } from '../tracks' ;
import { createConference } from './actions' ;
import { createConference } from './actions' ;
import { SET _LASTN } from './actionTypes' ;
import {
import {
_addLocalTracksToConference ,
_addLocalTracksToConference ,
_handleParticipantError ,
_handleParticipantError ,
@ -29,6 +30,9 @@ MiddlewareRegistry.register(store => next => action => {
case PIN _PARTICIPANT :
case PIN _PARTICIPANT :
return _pinParticipant ( store , next , action ) ;
return _pinParticipant ( store , next , action ) ;
case SET _LASTN :
return _setLastN ( store , next , action ) ;
case TRACK _ADDED :
case TRACK _ADDED :
case TRACK _REMOVED :
case TRACK _REMOVED :
return _trackAddedOrRemoved ( store , next , action ) ;
return _trackAddedOrRemoved ( store , next , action ) ;
@ -112,6 +116,33 @@ function _pinParticipant(store, next, action) {
return next ( action ) ;
return next ( action ) ;
}
}
/ * *
* Sets the last N ( value ) of the video channel in the conference .
*
* @ param { Store } store - The Redux store in which the specified action is being
* dispatched .
* @ param { Dispatch } next - The Redux dispatch function to dispatch the
* specified action to the specified store .
* @ param { Action } action - The Redux action SET _LASTN which is being dispatched
* in the specified store .
* @ private
* @ returns { Object } The new state that is the result of the reduction of the
* specified action .
* /
function _setLastN ( store , next , action ) {
const { conference } = store . getState ( ) [ 'features/base/conference' ] ;
if ( conference ) {
try {
conference . setLastN ( action . lastN ) ;
} catch ( err ) {
console . error ( ` Failed to set lastN: ${ err } ` ) ;
}
}
return next ( action ) ;
}
/ * *
/ * *
* Synchronizes local tracks from state with local tracks in JitsiConference
* Synchronizes local tracks from state with local tracks in JitsiConference
* instance .
* instance .