cleanup
This commit is contained in:
@@ -106,8 +106,8 @@ export default function VideoSegmentsEditor() {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const selectedOption = findSelectedOption(videoSettings);
|
|
||||||
|
|
||||||
|
const selectedOption = findSelectedOption(videoSettings);
|
||||||
const resetStates = () => {
|
const resetStates = () => {
|
||||||
setSubmitStatus(null);
|
setSubmitStatus(null);
|
||||||
setSubmitStatusMessage('');
|
setSubmitStatusMessage('');
|
||||||
@@ -175,7 +175,7 @@ export default function VideoSegmentsEditor() {
|
|||||||
min={0}
|
min={0}
|
||||||
max={SLIDER_OPTIONS.length - 1}
|
max={SLIDER_OPTIONS.length - 1}
|
||||||
marks={SLIDER_MARKS}
|
marks={SLIDER_MARKS}
|
||||||
defaultValue={DEFAULT_OPTION}
|
defaultValue={selectedOption}
|
||||||
value={selectedOption}
|
value={selectedOption}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -49,7 +49,17 @@ interface VideoVariantFormProps {
|
|||||||
dataState: VideoVariant;
|
dataState: VideoVariant;
|
||||||
onUpdateField: FieldUpdaterFunc;
|
onUpdateField: FieldUpdaterFunc;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
CPU Usage slider
|
||||||
|
{
|
||||||
|
'ultrafast': 'lowest cpu, lowest quality',
|
||||||
|
'superfast': 'lower cpu, lower quality',
|
||||||
|
'veryfast': 'medium cpu, medium quality',
|
||||||
|
'faster': 'higher cpu, higher quality',
|
||||||
|
'fast': 'highest cpu, highest quality'
|
||||||
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
export default function VideoVariantForm({ dataState = DEFAULT_VARIANT_STATE, onUpdateField }: VideoVariantFormProps) {
|
export default function VideoVariantForm({ dataState = DEFAULT_VARIANT_STATE, onUpdateField }: VideoVariantFormProps) {
|
||||||
|
|
||||||
const handleFramerateChange = (value: number) => {
|
const handleFramerateChange = (value: number) => {
|
||||||
|
|||||||
@@ -1,44 +1,17 @@
|
|||||||
import React, { useContext, useEffect } from 'react';
|
import React, { useContext } from 'react';
|
||||||
import { Typography, Form, Slider } from 'antd';
|
import { Typography } from 'antd';
|
||||||
import { ServerStatusContext } from '../utils/server-status-context';
|
import { ServerStatusContext } from '../utils/server-status-context';
|
||||||
|
|
||||||
import VideoVariantsTable from './components/config/video-variants-table';
|
import VideoVariantsTable from './components/config/video-variants-table';
|
||||||
import TextField, { TEXTFIELD_TYPE_NUMBER } from './components/config/form-textfield';
|
|
||||||
import { TEXTFIELD_DEFAULTS } from './components/config/constants';
|
|
||||||
import VideoSegmentsEditor from './components/config/video-segments-editor';
|
import VideoSegmentsEditor from './components/config/video-segments-editor';
|
||||||
|
|
||||||
const { Title } = Typography;
|
const { Title } = Typography;
|
||||||
|
|
||||||
export default function VideoConfig() {
|
export default function VideoConfig() {
|
||||||
// const [form] = Form.useForm();
|
// const [form] = Form.useForm();
|
||||||
const serverStatusData = useContext(ServerStatusContext);
|
// const serverStatusData = useContext(ServerStatusContext);
|
||||||
const { serverConfig } = serverStatusData || {};
|
// const { serverConfig } = serverStatusData || {};
|
||||||
const { videoSettings } = serverConfig || {};
|
// const { videoSettings } = serverConfig || {};
|
||||||
// const { numberOfPlaylistItems, segmentLengthSeconds } = videoSettings || {};
|
|
||||||
|
|
||||||
// const videoSettings = serverStatusData?.serverConfig?.videoSettings;
|
|
||||||
// const { numberOfPlaylistItems, segmentLengthSeconds } = videoSettings || {};
|
|
||||||
// const initialValues = {
|
|
||||||
// numberOfPlaylistItems,
|
|
||||||
// segmentLengthSeconds,
|
|
||||||
// };
|
|
||||||
|
|
||||||
// useEffect(() => {
|
|
||||||
// form.setFieldsValue(initialValues);
|
|
||||||
// }, [serverStatusData]);
|
|
||||||
|
|
||||||
// const handleResetValue = (fieldName: string) => {
|
|
||||||
// const defaultValue = TEXTFIELD_DEFAULTS.videoSettings[fieldName] && TEXTFIELD_DEFAULTS.videoSettings[fieldName].defaultValue || '';
|
|
||||||
|
|
||||||
// form.setFieldsValue({ [fieldName]: initialValues[fieldName] || defaultValue });
|
|
||||||
// }
|
|
||||||
|
|
||||||
// const extraProps = {
|
|
||||||
// handleResetValue,
|
|
||||||
// initialValues: videoSettings,
|
|
||||||
// configPath: 'videoSettings',
|
|
||||||
// };
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="config-video-variants">
|
<div className="config-video-variants">
|
||||||
<Title level={2}>Video configuration</Title>
|
<Title level={2}>Video configuration</Title>
|
||||||
@@ -51,15 +24,6 @@ export default function VideoConfig() {
|
|||||||
<VideoSegmentsEditor />
|
<VideoSegmentsEditor />
|
||||||
|
|
||||||
<br /><br />
|
<br /><br />
|
||||||
{/* <div className="config-video-misc">
|
|
||||||
<Form
|
|
||||||
form={form}
|
|
||||||
layout="vertical"
|
|
||||||
>
|
|
||||||
<TextField fieldName="numberOfPlaylistItems" type={TEXTFIELD_TYPE_NUMBER} {...extraProps} />
|
|
||||||
<TextField fieldName="segmentLengthSeconds" type={TEXTFIELD_TYPE_NUMBER} {...extraProps} />
|
|
||||||
</Form>
|
|
||||||
</div> */}
|
|
||||||
|
|
||||||
<VideoVariantsTable />
|
<VideoVariantsTable />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -88,7 +88,6 @@ const ServerStatusProvider = ({ children }) => {
|
|||||||
...config,
|
...config,
|
||||||
[fieldName]: value,
|
[fieldName]: value,
|
||||||
};
|
};
|
||||||
|
|
||||||
setConfig(updatedConfig);
|
setConfig(updatedConfig);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user