feat(prejoin_page): Add prejoin page

This commit is contained in:
Vlad Piersec
2020-04-16 13:47:10 +03:00
committed by Saúl Ibarra Corretgé
parent 5b53232964
commit a45cbf41ef
36 changed files with 2274 additions and 147 deletions

View File

@@ -1,5 +1,12 @@
// @flow
import {
isAudioDisabled,
isPrejoinPageVisible,
isPrejoinVideoDisabled
} from '../prejoin';
import { hasAvailableDevices } from '../base/devices';
declare var interfaceConfig: Object;
/**
@@ -45,3 +52,32 @@ export function isToolboxVisible(state: Object) {
return Boolean(!iAmSipGateway && (timeoutID || visible || alwaysVisible
|| audioSettingsVisible || videoSettingsVisible));
}
/**
* Indicates if the audio settings button is disabled or not.
*
* @param {string} state - The state from the Redux store.
* @returns {boolean}
*/
export function isAudioSettingsButtonDisabled(state: Object) {
const devicesMissing = !hasAvailableDevices(state, 'audioInput')
&& !hasAvailableDevices(state, 'audioOutput');
return isPrejoinPageVisible(state)
? devicesMissing || isAudioDisabled(state)
: devicesMissing;
}
/**
* Indicates if the video settings button is disabled or not.
*
* @param {string} state - The state from the Redux store.
* @returns {boolean}
*/
export function isVideoSettingsButtonDisabled(state: Object) {
const devicesMissing = !hasAvailableDevices(state, 'videoInput');
return isPrejoinPageVisible(state)
? devicesMissing || isPrejoinVideoDisabled(state)
: devicesMissing;
}