jiti-meet/react/features/overlay/actions.js

65 lines
1.5 KiB
JavaScript
Raw Normal View History

import { appNavigate, reloadWithStoredParams } from '../app';
import { toURLString } from '../base/util';
import {
2017-02-19 00:42:11 +00:00
MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED,
SUSPEND_DETECTED
} from './actionTypes';
const logger = require('jitsi-meet-logger').getLogger(__filename);
/**
2017-02-19 00:42:11 +00:00
* Signals that the prompt for media permission is visible or not.
*
2017-02-19 00:42:11 +00:00
* @param {boolean} isVisible - If the value is true - the prompt for media
* permission is visible otherwise the value is false/undefined.
* @param {string} browser - The name of the current browser.
2017-05-31 05:24:34 +00:00
* @public
* @returns {{
2017-02-19 00:42:11 +00:00
* type: MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED,
* browser: {string},
* isVisible: {boolean}
* }}
*/
2017-02-19 00:42:11 +00:00
export function mediaPermissionPromptVisibilityChanged(isVisible, browser) {
return {
2017-02-19 00:42:11 +00:00
type: MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED,
browser,
isVisible
};
}
/**
* Reloads the page.
*
* @protected
* @returns {Function}
*/
export function _reloadNow() {
return (dispatch, getState) => {
const { locationURL } = getState()['features/base/connection'];
logger.info(`Reloading the conference using URL: ${locationURL}`);
if (navigator.product === 'ReactNative') {
dispatch(appNavigate(toURLString(locationURL)));
} else {
dispatch(reloadWithStoredParams());
}
};
}
/**
2017-02-19 00:42:11 +00:00
* Signals that suspend was detected.
*
2017-05-31 05:24:34 +00:00
* @public
* @returns {{
2017-02-19 00:42:11 +00:00
* type: SUSPEND_DETECTED
* }}
*/
2017-02-19 00:42:11 +00:00
export function suspendDetected() {
return {
2017-02-19 00:42:11 +00:00
type: SUSPEND_DETECTED
};
}