You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

functions.js 1.1KB

12345678910111213141516171819202122232425262728293031
  1. import { JitsiRecordingConstants } from '../base/lib-jitsi-meet';
  2. /**
  3. * Searches in the passed in redux state for an active recording session of the
  4. * passed in mode.
  5. *
  6. * @param {Object} state - The redux state to search in.
  7. * @param {string} mode - Find an active recording session of the given mode.
  8. * @returns {Object|undefined}
  9. */
  10. export function getActiveSession(state, mode) {
  11. const { sessionDatas } = state['features/recording'];
  12. const { status: statusConstants } = JitsiRecordingConstants;
  13. return sessionDatas.find(sessionData => sessionData.mode === mode
  14. && (sessionData.status === statusConstants.ON
  15. || sessionData.status === statusConstants.PENDING));
  16. }
  17. /**
  18. * Searches in the passed in redux state for a recording session that matches
  19. * the passed in recording session ID.
  20. *
  21. * @param {Object} state - The redux state to search in.
  22. * @param {string} id - The ID of the recording session to find.
  23. * @returns {Object|undefined}
  24. */
  25. export function getSessionById(state, id) {
  26. return state['features/recording'].sessionDatas.find(
  27. sessionData => sessionData.id === id);
  28. }