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';
|
2021-08-20 08:53:11 +00:00
|
|
|
import JitsiThemeProvider from '../../base/ui/components/JitsiThemeProvider';
|
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> {
|
|
|
|
_init: Promise<*>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Navigates to {@link Prejoin} upon mount.
|
|
|
|
*
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
componentDidMount() {
|
|
|
|
super.componentDidMount();
|
|
|
|
|
|
|
|
this._init.then(async () => {
|
|
|
|
const { store } = this.state;
|
|
|
|
const { dispatch } = store;
|
2021-08-20 08:53:11 +00:00
|
|
|
const { styleType } = this.props;
|
2020-06-29 07:45:58 +00:00
|
|
|
|
|
|
|
super._navigate({
|
2021-08-20 08:53:11 +00:00
|
|
|
component: PrejoinThirdParty,
|
2020-06-29 07:45:58 +00:00
|
|
|
props: {
|
2021-08-20 08:53:11 +00:00
|
|
|
className: styleType
|
2020-06-29 07:45:58 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
const { startWithAudioMuted, startWithVideoMuted } = store.getState()['features/base/settings'];
|
|
|
|
|
|
|
|
dispatch(setConfig({
|
2021-12-08 07:53:19 +00:00
|
|
|
prejoinConfig: {
|
|
|
|
enabled: true
|
|
|
|
},
|
2020-06-29 07:45:58 +00:00
|
|
|
startWithAudioMuted,
|
|
|
|
startWithVideoMuted
|
|
|
|
}));
|
|
|
|
|
|
|
|
const { tryCreateLocalTracks, errors } = createPrejoinTracks();
|
|
|
|
|
|
|
|
const tracks = await tryCreateLocalTracks;
|
|
|
|
|
2020-09-30 11:50:39 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|