jiti-meet/react/features/local-recording/actions.js

60 lines
1.4 KiB
JavaScript
Raw Normal View History

/* @flow */
import {
LOCAL_RECORDING_ENGAGED,
LOCAL_RECORDING_UNENGAGED,
LOCAL_RECORDING_STATS_UPDATE
} from './actionTypes';
2018-07-09 18:09:14 +00:00
// The following two actions signal state changes in local recording engagement.
// In other words, the events of the local WebWorker / MediaRecorder starting to
// record and finishing recording.
// Note that this is not the event fired when the users tries to start the
// recording in the UI.
/**
2018-07-10 14:26:16 +00:00
* Signals that local recording has been engaged.
*
2018-07-10 14:26:16 +00:00
* @param {Date} startTime - Time when the recording is engaged.
* @returns {{
2018-07-10 14:26:16 +00:00
* type: LOCAL_RECORDING_ENGAGED,
* recordingEngagedAt: Date
2018-07-09 18:09:14 +00:00
* }}
*/
2018-07-10 14:26:16 +00:00
export function localRecordingEngaged(startTime: Date) {
2018-07-09 18:09:14 +00:00
return {
2018-07-10 14:26:16 +00:00
type: LOCAL_RECORDING_ENGAGED,
recordingEngagedAt: startTime
2018-07-09 18:09:14 +00:00
};
}
/**
* Signals that local recording has finished.
*
* @returns {{
* type: LOCAL_RECORDING_UNENGAGED
* }}
*/
2018-07-09 18:09:14 +00:00
export function localRecordingUnengaged() {
return {
2018-07-09 18:09:14 +00:00
type: LOCAL_RECORDING_UNENGAGED
};
}
/**
* Updates the the local recording stats from each client,
* to be displayed on {@code LocalRecordingInfoDialog}.
*
* @param {*} stats - The stats object.
* @returns {{
* type: LOCAL_RECORDING_STATS_UPDATE,
* stats: Object
* }}
*/
export function statsUpdate(stats: Object) {
return {
type: LOCAL_RECORDING_STATS_UPDATE,
stats
};
}