fix(rn,welcome-page) don't create video track unnecessarily
We are no longer rendering it, so skip creating it altogether and make sure it's destroyed on meeting end.
This commit is contained in:
parent
9fbbcbbd31
commit
2e7c06d045
|
@ -118,7 +118,7 @@ function _maybeSetAudioOnly(
|
||||||
{ dispatch },
|
{ dispatch },
|
||||||
{ settings: { startAudioOnly } }) {
|
{ settings: { startAudioOnly } }) {
|
||||||
if (typeof startAudioOnly === 'boolean') {
|
if (typeof startAudioOnly === 'boolean') {
|
||||||
dispatch(setAudioOnly(startAudioOnly, true));
|
dispatch(setAudioOnly(startAudioOnly));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,15 +15,10 @@ import { getName } from '../../app/functions';
|
||||||
import { ColorSchemeRegistry } from '../../base/color-scheme';
|
import { ColorSchemeRegistry } from '../../base/color-scheme';
|
||||||
import { translate } from '../../base/i18n';
|
import { translate } from '../../base/i18n';
|
||||||
import { Icon, IconMenu, IconWarning } from '../../base/icons';
|
import { Icon, IconMenu, IconWarning } from '../../base/icons';
|
||||||
import { MEDIA_TYPE } from '../../base/media';
|
|
||||||
import JitsiStatusBar from '../../base/modal/components/JitsiStatusBar';
|
import JitsiStatusBar from '../../base/modal/components/JitsiStatusBar';
|
||||||
import { LoadingIndicator, Text } from '../../base/react';
|
import { LoadingIndicator, Text } from '../../base/react';
|
||||||
import { connect } from '../../base/redux';
|
import { connect } from '../../base/redux';
|
||||||
import {
|
import { destroyLocalTracks } from '../../base/tracks';
|
||||||
createDesiredLocalTracks,
|
|
||||||
destroyLocalDesktopTrackIfExists,
|
|
||||||
destroyLocalTracks
|
|
||||||
} from '../../base/tracks';
|
|
||||||
import BaseTheme from '../../base/ui/components/BaseTheme.native';
|
import BaseTheme from '../../base/ui/components/BaseTheme.native';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
@ -135,19 +130,7 @@ class WelcomePage extends AbstractWelcomePage<*> {
|
||||||
<VideoSwitch />
|
<VideoSwitch />
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.props._settings.startAudioOnly) {
|
|
||||||
dispatch(destroyLocalTracks());
|
dispatch(destroyLocalTracks());
|
||||||
} else {
|
|
||||||
dispatch(destroyLocalDesktopTrackIfExists());
|
|
||||||
|
|
||||||
// Make sure we don't request the permission for the camera from
|
|
||||||
// the start. We will, however, create a video track iff the user
|
|
||||||
// already granted the permission.
|
|
||||||
navigator.permissions.query({ name: 'camera' }).then(response => {
|
|
||||||
response === 'granted'
|
|
||||||
&& dispatch(createDesiredLocalTracks(MEDIA_TYPE.VIDEO));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue