Calling: Device Selection

This commit is contained in:
Josh Perez 2020-08-26 20:03:42 -04:00 committed by Josh Perez
parent 8b34294c97
commit 8ab1013f70
17 changed files with 1038 additions and 135 deletions

View file

@ -1,20 +1,26 @@
import { RefObject } from 'react';
import React from 'react';
import { connect } from 'react-redux';
import { CanvasVideoRenderer, GumVideoCapturer } from 'ringrtc';
import { mapDispatchToProps } from '../actions';
import { CallManager } from '../../components/CallManager';
import { StateType } from '../reducer';
import { getIntl } from '../selectors/user';
import { SmartCallingDeviceSelection } from './CallingDeviceSelection';
// Workaround: A react component's required properties are filtering up through connect()
// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/31363
const FilteredCallingDeviceSelection = SmartCallingDeviceSelection as any;
function renderDeviceSelection(): JSX.Element {
return <FilteredCallingDeviceSelection />;
}
const mapStateToProps = (state: StateType) => {
return {
...state.calling,
i18n: getIntl(state),
getVideoCapturer: (localVideoRef: RefObject<HTMLVideoElement>) =>
new GumVideoCapturer(640, 480, 30, localVideoRef),
getVideoRenderer: (remoteVideoRef: RefObject<HTMLCanvasElement>) =>
new CanvasVideoRenderer(remoteVideoRef),
renderDeviceSelection,
};
};