diff --git a/src/views/Edit/Wizard/Sources/InternalSRT.js b/src/views/Edit/Wizard/Sources/InternalSRT.js
index c5e0bbd..0341c6c 100644
--- a/src/views/Edit/Wizard/Sources/InternalSRT.js
+++ b/src/views/Edit/Wizard/Sources/InternalSRT.js
@@ -1,14 +1,18 @@
import React from 'react';
import { useNavigate } from 'react-router-dom';
-import { Trans } from '@lingui/macro';
+import { Trans, t } from '@lingui/macro';
+import { useLingui } from '@lingui/react';
import Button from '@mui/material/Button';
import Grid from '@mui/material/Grid';
import Icon from '@mui/icons-material/KeyboardTab';
+import MenuItem from '@mui/material/MenuItem';
+import RefreshIcon from '@mui/icons-material/Refresh';
import Typography from '@mui/material/Typography';
import * as S from '../../Sources/Network';
import BoxTextarea from '../../../../misc/BoxTextarea';
+import Select from '../../../../misc/Select';
import Textarea from '../../../../misc/Textarea';
const initSettings = (initialSettings, config) => {
@@ -23,6 +27,7 @@ const initSettings = (initialSettings, config) => {
};
function Source(props) {
+ const { i18n } = useLingui();
const navigate = useNavigate();
const config = S.func.initConfig(props.config);
const settings = initSettings(props.settings, config);
@@ -37,13 +42,32 @@ function Source(props) {
props.onChange(S.id, newSettings, inputs, config.srt.enabled);
};
+ const handleRefresh = () => {
+ props.onRefresh();
+ };
+
+ const update = (what) => (event) => {
+ const value = event.target.value;
+ const newSettings = {
+ ...settings,
+ };
+
+ if (what in newSettings.push) {
+ newSettings.push[what] = value;
+ }
+
+ handleChange(newSettings);
+ };
+
React.useEffect(() => {
handleChange();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
+ let form = null;
+
if (config.srt.enabled === false) {
- return (
+ form = (
@@ -57,24 +81,59 @@ function Source(props) {
);
+ } else {
+ const filteredDevices = props.knownDevices.filter((device) => device.media === 'srt');
+ const options = filteredDevices.map((device) => {
+ return (
+
+ );
+ });
+
+ options.unshift(
+ ,
+ );
+
+ options.push(
+ ,
+ );
+
+ const SRT = S.func.getSRT(config, settings.push.name);
+
+ form = (
+
+
+
+ } onClick={handleRefresh} sx={{ float: 'right' }}>
+ Refresh
+
+
+ {settings.push.name === config.channelid && (
+
+
+
+ Address:
+
+
+
+
+
+
+
+
+ )}
+
+ );
}
- const SRT = S.func.getSRT(config, settings.push.name);
-
- return (
-
-
-
- Send stream to this address:
-
-
-
-
-
-
-
-
- );
+ return form;
}
Source.defaultProps = {