0

Set some actual values in admin video forms

This commit is contained in:
Gabe Kangas 2021-02-03 10:26:46 -08:00
parent 5038992513
commit 5e2c1a42b0
3 changed files with 18 additions and 11 deletions

View File

@ -12,6 +12,14 @@ const SLIDER_MARKS = {
5: 'highest', 5: 'highest',
}; };
const TOOLTIPS = {
1: 'lowest',
2: 'low',
3: 'medium',
4: 'high',
5: 'highest',
};
export default function CPUUsageSelector({ defaultValue, onChange }) { export default function CPUUsageSelector({ defaultValue, onChange }) {
const [selectedOption, setSelectedOption] = useState(null); const [selectedOption, setSelectedOption] = useState(null);
@ -40,6 +48,7 @@ export default function CPUUsageSelector({ defaultValue, onChange }) {
<br /> <br />
<div className="segment-slider"> <div className="segment-slider">
<Slider <Slider
tipFormatter={value => TOOLTIPS[value] }
onChange={handleChange} onChange={handleChange}
min={1} min={1}
max={Object.keys(SLIDER_MARKS).length} max={Object.keys(SLIDER_MARKS).length}

View File

@ -11,12 +11,12 @@ import {
const { Title } = Typography; const { Title } = Typography;
const SLIDER_MARKS = { const SLIDER_MARKS = {
1: '1 - low', 1: 'low',
2: '2', 2: '',
3: '3', 3: '',
4: '4', 4: '',
5: '5', 5: '',
6: '6 - high', 6: 'high',
}; };
const SLIDER_COMMENTS = { const SLIDER_COMMENTS = {
@ -110,7 +110,6 @@ export default function VideoLatency() {
<br /> <br />
<div className="segment-slider"> <div className="segment-slider">
<Slider <Slider
tooltipVisible
tipFormatter={value => <SegmentToolTip value={SLIDER_COMMENTS[value]} />} tipFormatter={value => <SegmentToolTip value={SLIDER_COMMENTS[value]} />}
onChange={handleChange} onChange={handleChange}
min={1} min={1}

View File

@ -12,7 +12,7 @@ const { Panel } = Collapse;
const VIDEO_VARIANT_DEFAULTS = { const VIDEO_VARIANT_DEFAULTS = {
framerate: { framerate: {
min: 10, min: 10,
max: 80, max: 90,
defaultValue: 24, defaultValue: 24,
unit: 'fps', unit: 'fps',
incrementBy: 1, incrementBy: 1,
@ -20,8 +20,8 @@ const VIDEO_VARIANT_DEFAULTS = {
}, },
videoBitrate: { videoBitrate: {
min: 600, min: 600,
max: 1200, max: 6000,
defaultValue: 800, defaultValue: 1200,
unit: 'kbps', unit: 'kbps',
incrementBy: 100, incrementBy: 100,
tip: 'This is importatnt yo', tip: 'This is importatnt yo',
@ -138,7 +138,6 @@ export default function VideoVariantForm({
</p> </p>
<div className="form-component"> <div className="form-component">
<Slider <Slider
// tooltipVisible={dataState.videoPassthrough !== true}
tipFormatter={value => `${value} ${videoBRUnit}`} tipFormatter={value => `${value} ${videoBRUnit}`}
disabled={dataState.videoPassthrough === true} disabled={dataState.videoPassthrough === true}
defaultValue={dataState.videoBitrate} defaultValue={dataState.videoBitrate}