import React from 'react'; import { Trans } from '@lingui/macro'; import Grid from '@mui/material/Grid'; import MenuItem from '@mui/material/MenuItem'; import Typography from '@mui/material/Typography'; import Select from '../Select'; function init(settings) { const initSettings = { source: 'hls+memfs', ...settings, }; switch (initSettings.source) { case 'hls+diskfs': case 'rtmp': case 'srt': case 'whip-rtsp': break; default: initSettings.source = 'hls+memfs'; } return initSettings; } export default function Control(props) { const settings = init(props.settings); // Set the defaults React.useEffect(() => { props.onChange(settings, true); // eslint-disable-next-line react-hooks/exhaustive-deps }, []); const handleChange = (what) => (event) => { const value = event.target.value; settings[what] = value; props.onChange(settings, false); }; const items = []; items.push( HLS (memfs) ); items.push( HLS (diskfs) ); items.push( RTMP ); items.push( SRT ); items.push( WHIP RTSP relay ); return ( Stream source for publication service (experimental). ); } Control.defaulProps = { settings: {}, sources: [], onChange: function (settings, automatic) {}, };