2020-06-29 07:45:58 +00:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import { AtlasKitThemeProvider } from '@atlaskit/theme';
|
|
|
|
import React from 'react';
|
2020-09-30 11:50:39 +00:00
|
|
|
import { batch } from 'react-redux';
|
2020-06-29 07:45:58 +00:00
|
|
|
|
|
|
|
import { BaseApp } from '../../../features/base/app';
|
2021-08-04 10:56:07 +00:00
|
|
|
import { getConferenceOptions } from '../../base/conference/functions';
|
2020-06-29 07:45:58 +00:00
|
|
|
import { setConfig } from '../../base/config';
|
2021-04-19 14:06:27 +00:00
|
|
|
import { DialogContainer } from '../../base/dialog';
|
2020-06-29 07:45:58 +00:00
|
|
|
import { createPrejoinTracks } from '../../base/tracks';
|
2021-11-23 09:06:20 +00:00
|
|
|
import GlobalStyles from '../../base/ui/components/GlobalStyles';
|
2022-08-01 07:04:23 +00:00
|
|
|
import JitsiThemeProvider from '../../base/ui/components/JitsiThemeProvider.web';
|
2020-09-30 11:50:39 +00:00
|
|
|
import { initPrejoin, makePrecallTest } from '../actions';
|
2020-06-29 07:45:58 +00:00
|
|
|
|
2021-08-20 08:53:11 +00:00
|
|
|
import PrejoinThirdParty from './PrejoinThirdParty';
|
2020-06-29 07:45:58 +00:00
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
|
|
|
/**
|
2021-08-20 08:53:11 +00:00
|
|
|
* Indicates the style type that needs to be applied.
|
2020-06-29 07:45:58 +00:00
|
|
|
*/
|
2021-08-20 08:53:11 +00:00
|
|
|
styleType: string
|
|
|
|
}
|
2020-06-29 07:45:58 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Wrapper application for prejoin.
|
|
|
|
*
|
2021-11-04 21:10:43 +00:00
|
|
|
* @augments BaseApp
|
2020-06-29 07:45:58 +00:00
|
|
|
*/
|
|
|
|
export default class PrejoinApp extends BaseApp<Props> {
|
2022-01-11 15:03:42 +00:00
|
|
|
/**
|
|
|
|
* The deferred for the initialisation {{promise, resolve, reject}}.
|
|
|
|
*/
|
|
|
|
_init: Object;
|
2020-06-29 07:45:58 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Navigates to {@link Prejoin} upon mount.
|
|
|
|
*
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
2022-01-07 13:18:24 +00:00
|
|
|
async componentDidMount() {
|
|
|
|
await super.componentDidMount();
|
|
|
|
|
|
|
|
const { store } = this.state;
|
|
|
|
const { dispatch } = store;
|
|
|
|
const { styleType } = this.props;
|
|
|
|
|
|
|
|
super._navigate({
|
|
|
|
component: PrejoinThirdParty,
|
|
|
|
props: {
|
|
|
|
className: styleType
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
const { startWithAudioMuted, startWithVideoMuted } = store.getState()['features/base/settings'];
|
|
|
|
|
|
|
|
dispatch(setConfig({
|
|
|
|
prejoinConfig: {
|
|
|
|
enabled: true
|
|
|
|
},
|
|
|
|
startWithAudioMuted,
|
|
|
|
startWithVideoMuted
|
|
|
|
}));
|
|
|
|
|
|
|
|
const { tryCreateLocalTracks, errors } = createPrejoinTracks();
|
|
|
|
|
|
|
|
const tracks = await tryCreateLocalTracks;
|
|
|
|
|
|
|
|
batch(() => {
|
|
|
|
dispatch(initPrejoin(tracks, errors));
|
|
|
|
dispatch(makePrecallTest(getConferenceOptions(store.getState())));
|
2020-06-29 07:45:58 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Overrides the parent method to inject {@link AtlasKitThemeProvider} as
|
|
|
|
* the top most component.
|
|
|
|
*
|
|
|
|
* @override
|
|
|
|
*/
|
|
|
|
_createMainElement(component, props) {
|
|
|
|
return (
|
2021-08-20 08:53:11 +00:00
|
|
|
<JitsiThemeProvider>
|
|
|
|
<AtlasKitThemeProvider mode = 'dark'>
|
2021-11-23 09:06:20 +00:00
|
|
|
<GlobalStyles />
|
2021-08-20 08:53:11 +00:00
|
|
|
{ super._createMainElement(component, props) }
|
|
|
|
</AtlasKitThemeProvider>
|
|
|
|
</JitsiThemeProvider>
|
2020-06-29 07:45:58 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Renders the platform specific dialog container.
|
|
|
|
*
|
|
|
|
* @returns {React$Element}
|
|
|
|
*/
|
|
|
|
_renderDialogContainer() {
|
2021-04-19 14:06:27 +00:00
|
|
|
return (
|
2021-08-20 08:53:11 +00:00
|
|
|
<JitsiThemeProvider>
|
|
|
|
<AtlasKitThemeProvider mode = 'dark'>
|
|
|
|
<DialogContainer />
|
|
|
|
</AtlasKitThemeProvider>
|
|
|
|
</JitsiThemeProvider>
|
2021-04-19 14:06:27 +00:00
|
|
|
);
|
2020-06-29 07:45:58 +00:00
|
|
|
}
|
|
|
|
}
|