Skip to content

Commit 65a1f4b

Browse files
makarandp0Tim Mendoza
and
Tim Mendoza
authored
WIP: Render hints (#506)
* renderHints + stage * set loglevel * add idleTrackSwitchOff setting * use rc3 * Add ability to change twilio environments * use twilio-video.js#2.14.0-rc4 * use [email protected] * Update app setting files and tests * Change order of settings * Install twilio-video 2.14.0 Co-authored-by: Tim Mendoza <[email protected]>
1 parent fa1f5db commit 65a1f4b

10 files changed

+156
-891
lines changed

package-lock.json

+51-229
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"strip-color": "^0.1.0",
4040
"ts-node": "^9.1.1",
4141
"twilio": "^3.57.0",
42-
"twilio-video": "^2.13.1",
42+
"twilio-video": "^2.14.0",
4343
"typescript": "^3.8.3"
4444
},
4545
"devDependencies": {

src/components/ConnectionOptionsDialog/ConnectionOptionsDialog.test.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,18 @@ describe('the ConnectionOptionsDialog component', () => {
3838
const wrapper = shallow(<ConnectionOptionsDialog open={true} onClose={() => {}} />);
3939
wrapper
4040
.find(TextField)
41-
.find({ name: 'maxTracks' })
42-
.simulate('change', { target: { value: '123456a', name: 'maxTracks' } });
41+
.find({ name: 'maxAudioBitrate' })
42+
.simulate('change', { target: { value: '123456a', name: 'maxAudioBitrate' } });
4343
expect(mockDispatchSetting).not.toHaveBeenCalled();
4444
});
4545

4646
it('should dispatch settings changes from a number field when there are only digits in the value', () => {
4747
const wrapper = shallow(<ConnectionOptionsDialog open={true} onClose={() => {}} />);
4848
wrapper
4949
.find(TextField)
50-
.find({ name: 'maxTracks' })
51-
.simulate('change', { target: { value: '123456', name: 'maxTracks' } });
52-
expect(mockDispatchSetting).toHaveBeenCalledWith({ value: '123456', name: 'maxTracks' });
50+
.find({ name: 'maxAudioBitrate' })
51+
.simulate('change', { target: { value: '123456', name: 'maxAudioBitrate' } });
52+
expect(mockDispatchSetting).toHaveBeenCalledWith({ value: '123456', name: 'maxAudioBitrate' });
5353
});
5454
});
5555

src/components/ConnectionOptionsDialog/ConnectionOptionsDialog.tsx

+26-62
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
} from '@material-ui/core';
1818
import { makeStyles } from '@material-ui/core/styles';
1919
import { inputLabels, Settings } from '../../state/settings/settingsReducer';
20-
import { RenderDimensions } from '../../state/settings/renderDimensions';
2120
import { useAppState } from '../../state';
2221
import useRoomState from '../../hooks/useRoomState/useRoomState';
2322

@@ -54,12 +53,6 @@ const useStyles = makeStyles((theme: Theme) => ({
5453

5554
const withDefault = (val?: string) => (typeof val === 'undefined' ? 'default' : val);
5655

57-
const RenderDimensionItems = RenderDimensions.map(({ label, value }) => (
58-
<MenuItem value={value} key={value}>
59-
{label}
60-
</MenuItem>
61-
));
62-
6356
export default function ConnectionOptionsDialog({ open, onClose }: { open: boolean; onClose: () => void }) {
6457
const classes = useStyles();
6558
const { settings, dispatchSetting } = useAppState();
@@ -143,80 +136,51 @@ export default function ConnectionOptionsDialog({ open, onClose }: { open: boole
143136
<MenuItem value="default">Server Default</MenuItem>
144137
</Select>
145138
</FormControl>
146-
147-
<FormControl className={classes.formControl}>
148-
<TextField
149-
disabled={isDisabled}
150-
fullWidth
151-
id={inputLabels.maxTracks}
152-
label="Max Tracks"
153-
placeholder="Leave blank for no limit"
154-
name={inputLabels.maxTracks}
155-
value={withDefault(settings.maxTracks)}
156-
onChange={handleNumberChange}
157-
/>
158-
</FormControl>
159-
160-
<FormControl className={classes.formControl}>
161-
<TextField
162-
disabled={isDisabled}
163-
fullWidth
164-
id={inputLabels.maxAudioBitrate}
165-
label="Max Audio Bitrate"
166-
placeholder="Leave blank for no limit"
167-
name={inputLabels.maxAudioBitrate}
168-
value={withDefault(settings.maxAudioBitrate)}
169-
onChange={handleNumberChange}
170-
/>
171-
</FormControl>
172139
</Grid>
173140
<Grid item sm={6} xs={12}>
174-
<FormControl fullWidth className={classes.formControl}>
175-
<InputLabel id={inputLabels.renderDimensionLow} className={classes.label}>
176-
Render Dimension (Low Priority):
177-
</InputLabel>
141+
<FormControl className={classes.formControl}>
142+
<InputLabel id={inputLabels.clientTrackSwitchOffControl}>Client Track Switch Off Control:</InputLabel>
178143
<Select
179144
fullWidth
180145
disabled={isDisabled}
181-
name={inputLabels.renderDimensionLow}
182-
label={inputLabels.renderDimensionLow}
183-
value={withDefault(settings.renderDimensionLow)}
146+
name={inputLabels.clientTrackSwitchOffControl}
147+
label={inputLabels.clientTrackSwitchOffControl}
148+
value={withDefault(settings.clientTrackSwitchOffControl)}
184149
onChange={handleChange}
185150
>
186-
{RenderDimensionItems}
151+
<MenuItem value="auto">Auto</MenuItem>
152+
<MenuItem value="manual">Manual</MenuItem>
153+
<MenuItem value="default">Default</MenuItem>
187154
</Select>
188155
</FormControl>
189156

190-
<FormControl fullWidth className={classes.formControl}>
191-
<InputLabel id={inputLabels.renderDimensionStandard} className={classes.label}>
192-
Render Dimension (Standard Priority):
193-
</InputLabel>
157+
<FormControl className={classes.formControl}>
158+
<InputLabel id={inputLabels.contentPreferencesMode}>Content Preferences Mode:</InputLabel>
194159
<Select
195160
fullWidth
196161
disabled={isDisabled}
197-
name={inputLabels.renderDimensionStandard}
198-
label={inputLabels.renderDimensionStandard}
199-
value={withDefault(settings.renderDimensionStandard)}
162+
name={inputLabels.contentPreferencesMode}
163+
label={inputLabels.contentPreferencesMode}
164+
value={withDefault(settings.contentPreferencesMode)}
200165
onChange={handleChange}
201166
>
202-
{RenderDimensionItems}
167+
<MenuItem value="auto">Auto</MenuItem>
168+
<MenuItem value="manual">Manual</MenuItem>
169+
<MenuItem value="default">Default</MenuItem>
203170
</Select>
204171
</FormControl>
205172

206-
<FormControl fullWidth className={classes.formControl}>
207-
<InputLabel id={inputLabels.renderDimensionHigh} className={classes.label}>
208-
Render Dimension (High Priority):
209-
</InputLabel>
210-
<Select
211-
fullWidth
173+
<FormControl className={classes.formControl}>
174+
<TextField
212175
disabled={isDisabled}
213-
name={inputLabels.renderDimensionHigh}
214-
label={inputLabels.renderDimensionHigh}
215-
value={withDefault(settings.renderDimensionHigh)}
216-
onChange={handleChange}
217-
>
218-
{RenderDimensionItems}
219-
</Select>
176+
fullWidth
177+
id={inputLabels.maxAudioBitrate}
178+
label="Max Audio Bitrate"
179+
placeholder="Leave blank for no limit"
180+
name={inputLabels.maxAudioBitrate}
181+
value={withDefault(settings.maxAudioBitrate)}
182+
onChange={handleNumberChange}
183+
/>
220184
</FormControl>
221185
</Grid>
222186
</Grid>

0 commit comments

Comments
 (0)