2017-05-31 05:31:00 +00:00
|
|
|
import { reload, replace } from '../../../modules/util/helpers';
|
|
|
|
|
2017-01-31 20:58:48 +00:00
|
|
|
import {
|
2017-02-19 00:42:11 +00:00
|
|
|
MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED,
|
|
|
|
SUSPEND_DETECTED
|
2017-01-31 20:58:48 +00:00
|
|
|
} from './actionTypes';
|
|
|
|
|
2017-05-31 05:31:00 +00:00
|
|
|
const logger = require('jitsi-meet-logger').getLogger(__filename);
|
|
|
|
|
2017-01-31 20:58:48 +00:00
|
|
|
/**
|
2017-02-19 00:42:11 +00:00
|
|
|
* Signals that the prompt for media permission is visible or not.
|
2017-01-31 20:58:48 +00:00
|
|
|
*
|
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
|
2017-01-31 20:58:48 +00:00
|
|
|
* @returns {{
|
2017-02-19 00:42:11 +00:00
|
|
|
* type: MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED,
|
|
|
|
* browser: {string},
|
|
|
|
* isVisible: {boolean}
|
2017-01-31 20:58:48 +00:00
|
|
|
* }}
|
|
|
|
*/
|
2017-02-19 00:42:11 +00:00
|
|
|
export function mediaPermissionPromptVisibilityChanged(isVisible, browser) {
|
2017-01-31 20:58:48 +00:00
|
|
|
return {
|
2017-02-19 00:42:11 +00:00
|
|
|
type: MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED,
|
|
|
|
browser,
|
|
|
|
isVisible
|
2017-01-31 20:58:48 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2017-05-31 05:31:00 +00:00
|
|
|
/**
|
|
|
|
* 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}`);
|
|
|
|
|
|
|
|
// In an iframe reload with the reload() utility because the replace()
|
|
|
|
// utility does not work on an iframe.
|
|
|
|
if (window.self === window.top) {
|
|
|
|
replace(locationURL);
|
|
|
|
} else {
|
|
|
|
reload();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2017-01-31 20:58:48 +00:00
|
|
|
/**
|
2017-02-19 00:42:11 +00:00
|
|
|
* Signals that suspend was detected.
|
2017-01-31 20:58:48 +00:00
|
|
|
*
|
2017-05-31 05:24:34 +00:00
|
|
|
* @public
|
2017-01-31 20:58:48 +00:00
|
|
|
* @returns {{
|
2017-02-19 00:42:11 +00:00
|
|
|
* type: SUSPEND_DETECTED
|
2017-01-31 20:58:48 +00:00
|
|
|
* }}
|
|
|
|
*/
|
2017-02-19 00:42:11 +00:00
|
|
|
export function suspendDetected() {
|
2017-01-31 20:58:48 +00:00
|
|
|
return {
|
2017-02-19 00:42:11 +00:00
|
|
|
type: SUSPEND_DETECTED
|
2017-01-31 20:58:48 +00:00
|
|
|
};
|
|
|
|
}
|