mirror of https://github.com/jitsi/jitsi-meet
parent
371ca4eef1
commit
70921bb6ef
@ -0,0 +1,11 @@ |
||||
// @flow
|
||||
|
||||
/** |
||||
* The type of (redux) action which signals that local media duration has changed. |
||||
* |
||||
* { |
||||
* type: UPDATE_LOCAL_TRACKS_DURATION, |
||||
* localTracksDuration: Object |
||||
* } |
||||
*/ |
||||
export const UPDATE_LOCAL_TRACKS_DURATION = 'UPDATE_LOCAL_TRACKS_DURATION'; |
@ -0,0 +1,51 @@ |
||||
// @flow
|
||||
|
||||
import { ReducerRegistry } from '../base/redux'; |
||||
|
||||
import { UPDATE_LOCAL_TRACKS_DURATION } from './actionTypes'; |
||||
|
||||
/** |
||||
* Initial state. |
||||
*/ |
||||
const DEFAULT_STATE = { |
||||
localTracksDuration: { |
||||
audio: { |
||||
startedTime: -1, |
||||
value: 0 |
||||
}, |
||||
video: { |
||||
camera: { |
||||
startedTime: -1, |
||||
value: 0 |
||||
}, |
||||
desktop: { |
||||
startedTime: -1, |
||||
value: 0 |
||||
} |
||||
}, |
||||
conference: { |
||||
startedTime: -1, |
||||
value: 0 |
||||
} |
||||
} |
||||
}; |
||||
|
||||
/** |
||||
* Listen for actions which changes the state of the analytics feature. |
||||
* |
||||
* @param {Object} state - The Redux state of the feature features/analytics. |
||||
* @param {Object} action - Action object. |
||||
* @param {string} action.type - Type of action. |
||||
* @returns {Object} |
||||
*/ |
||||
ReducerRegistry.register('features/analytics', (state = DEFAULT_STATE, action) => { |
||||
switch (action.type) { |
||||
case UPDATE_LOCAL_TRACKS_DURATION: |
||||
return { |
||||
...state, |
||||
localTracksDuration: action.localTracksDuration |
||||
}; |
||||
default: |
||||
return state; |
||||
} |
||||
}); |
Loading…
Reference in new issue