From 9e1b2c2b4b618326b4ed7bdd7f8fc6c9c87a7254 Mon Sep 17 00:00:00 2001 From: ZGaetano Date: Wed, 6 May 2026 16:17:40 -0400 Subject: [PATCH] feat: add WHEP control, WHEPStatus badge, Wild Dragon Logo components: WHEP.js --- overlay/src/misc/controls/WHEP.js | 47 +++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 overlay/src/misc/controls/WHEP.js diff --git a/overlay/src/misc/controls/WHEP.js b/overlay/src/misc/controls/WHEP.js new file mode 100644 index 0000000..81b2c8e --- /dev/null +++ b/overlay/src/misc/controls/WHEP.js @@ -0,0 +1,47 @@ +import React from 'react'; + +import { Trans } from '@lingui/macro'; +import Grid from '@mui/material/Grid'; +import Typography from '@mui/material/Typography'; + +import Checkbox from '../Checkbox'; + +function init(settings) { + return { enable: false, ...settings }; +} + +export default function Control(props) { + const settings = init(props.settings); + + React.useEffect(() => { + props.onChange(settings, true); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + const handleChange = (what) => () => { + if (what === 'enable') { + settings[what] = !settings[what]; + } + props.onChange(settings, false); + }; + + return ( + + + Enable} + checked={settings.enable} + onChange={handleChange('enable')} + /> + + Make the channel available as a low-latency WebRTC stream via WHEP. + + + + ); +} + +Control.defaultProps = { + settings: {}, + onChange: function (settings, automatic) {}, +};