您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

actions.js 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import { appNavigate, reloadWithStoredParams } from '../app';
  2. import { toURLString } from '../base/util';
  3. import {
  4. MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED,
  5. SUSPEND_DETECTED
  6. } from './actionTypes';
  7. const logger = require('jitsi-meet-logger').getLogger(__filename);
  8. /**
  9. * Signals that the prompt for media permission is visible or not.
  10. *
  11. * @param {boolean} isVisible - If the value is true - the prompt for media
  12. * permission is visible otherwise the value is false/undefined.
  13. * @param {string} browser - The name of the current browser.
  14. * @public
  15. * @returns {{
  16. * type: MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED,
  17. * browser: {string},
  18. * isVisible: {boolean}
  19. * }}
  20. */
  21. export function mediaPermissionPromptVisibilityChanged(isVisible, browser) {
  22. return {
  23. type: MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED,
  24. browser,
  25. isVisible
  26. };
  27. }
  28. /**
  29. * Reloads the page.
  30. *
  31. * @protected
  32. * @returns {Function}
  33. */
  34. export function _reloadNow() {
  35. return (dispatch, getState) => {
  36. const { locationURL } = getState()['features/base/connection'];
  37. logger.info(`Reloading the conference using URL: ${locationURL}`);
  38. if (navigator.product === 'ReactNative') {
  39. dispatch(appNavigate(toURLString(locationURL)));
  40. } else {
  41. dispatch(reloadWithStoredParams());
  42. }
  43. };
  44. }
  45. /**
  46. * Signals that suspend was detected.
  47. *
  48. * @public
  49. * @returns {{
  50. * type: SUSPEND_DETECTED
  51. * }}
  52. */
  53. export function suspendDetected() {
  54. return {
  55. type: SUSPEND_DETECTED
  56. };
  57. }