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.

actions.js 1.6KB

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