Skip to content

Commit e53eccc

Browse files
authored
Merge branch 'main' into feat-mgmt-client
2 parents 3885427 + cdeeb71 commit e53eccc

File tree

14 files changed

+208
-67
lines changed

14 files changed

+208
-67
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,8 @@ can be found here: [config.example.js](public/config/config.example.js).
7777
| logo | If not null, it shows the logo loaded from the specified URL, otherwise it shows the title. | `"url"` | ``"images/logo.edumeet.svg"`` |
7878
| title | The title to show if the logo is not specified. | `"string"` | ``"edumeet"`` |
7979
| randomizeOnBlank | Enable or disable randomize room name when it is blank. | `"boolean"` | ``true`` |
80+
| transcriptionEnabled | Enable or disable transcription. | `"boolean"` | ``true`` |
81+
| imprintUrl | Show a link to an imprint in the edumeet UI, keep blank to not show a link | `"string"` | ``""`` |
82+
| privacyUrl | Show a link to a privacy notice in the edumeet UI, keep blank to not show a link | `"string"` | ``""`` |
8083

8184
---

public/config/config.example.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,15 @@ var config = {
146146
// otherwise, it will remain empty and users will have to enter a room name.
147147
randomizeOnBlank: true,
148148

149+
// Enable or disable transcription.
150+
transcriptionEnabled: true,
151+
152+
// Imprint. If you want to link your imprint, please provide a URL in this variable. If it is empty, no link will be shown.
153+
imprintUrl: '',
154+
155+
// Privacy notice. If you want to link your privacy notices, please provide a URL in this variable. If it is empty, no link will be shown.
156+
privacyUrl: '',
157+
149158
// Client theme. Take a look at mui theme documentation.
150159
theme: {
151160
palette: {

src/App.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ const App = (): JSX.Element => {
6969
if (roomState ==='left') {
7070
dispatch(roomActions.setState('new'));
7171
navigate('/');
72+
setTimeout(() => {
73+
window.location.reload();
74+
}, 0);
7275
}
7376
}, [ roomState ]);
7477

src/components/controlbuttons/ImpressumButton.tsx

Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { Button } from '@mui/material';
1+
import { Button, Box, Link, Typography } from '@mui/material';
22
import { Close } from '@mui/icons-material';
33
import { useAppDispatch, useAppSelector } from '../../store/hooks';
44
import { uiActions } from '../../store/slices/uiSlice';
5-
import { closeLabel } from '../translated/translatedComponents';
5+
import { closeLabel, imprintLabel, privacyLabel } from '../translated/translatedComponents';
66
import ShortcutKeys from './ShortcutKeys';
77
import GenericDialog from '../genericdialog/GenericDialog';
8-
import ImpressumButton from '../controlbuttons/ImpressumButton';
8+
import edumeetConfig from '../../utils/edumeetConfig';
99

1010
const HelpDialog = (): JSX.Element => {
1111
const dispatch = useAppDispatch();
@@ -17,24 +17,41 @@ const HelpDialog = (): JSX.Element => {
1717
}));
1818
};
1919

20+
const privacyUrl = edumeetConfig.privacyUrl ?? '';
21+
const imprintUrl = edumeetConfig.imprintUrl ?? '';
22+
2023
return (
2124
<GenericDialog
2225
open={ helpOpen }
2326
onClose={ handleCloseHelp }
2427
maxWidth='xs'
25-
content={ <><ShortcutKeys /><ImpressumButton /></> }
28+
content={ <><ShortcutKeys /></> }
2629
actions={
27-
<Button
28-
onClick={ handleCloseHelp }
29-
startIcon={ <Close /> }
30-
variant='contained'
31-
size='small'
32-
>
33-
{ closeLabel() }
34-
</Button>
30+
<Box display="flex" alignItems="center" justifyContent="space-between" width="100%">
31+
<Box display="flex" alignItems="left">
32+
{imprintUrl.trim() !== '' && (
33+
<Link href={imprintUrl} target="_blank" color="inherit" underline="none">
34+
<Typography variant="body2">{ imprintLabel() }</Typography>
35+
</Link>
36+
)}
37+
{privacyUrl.trim() !== '' && (
38+
<Link href={privacyUrl} target="_blank" color="inherit" underline="none" style={{ marginLeft: '16px' }}>
39+
<Typography variant="body2">{ privacyLabel() }</Typography>
40+
</Link>
41+
)}
42+
</Box>
43+
<Button
44+
onClick={ handleCloseHelp }
45+
startIcon={ <Close /> }
46+
variant='contained'
47+
size='small'
48+
>
49+
{ closeLabel() }
50+
</Button>
51+
</Box>
3552
}
3653
/>
3754
);
3855
};
3956

40-
export default HelpDialog;
57+
export default HelpDialog;

src/components/translated/translatedComponents.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,4 +805,13 @@ export const managementExtraSettingsLabel = (): string => intl.formatMessage({
805805
export const ruleSettingsLabel = (): string => intl.formatMessage({
806806
id: 'label.managementRuleSettings',
807807
defaultMessage: 'Rule settings'
808+
809+
export const imprintLabel = (): string => intl.formatMessage({
810+
id: 'label.imprint',
811+
defaultMessage: 'Imprint'
812+
});
813+
814+
export const privacyLabel = (): string => intl.formatMessage({
815+
id: 'label.privacy',
816+
defaultMessage: 'Privacy'
808817
});
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import LinearProgress from '@mui/material/LinearProgress';
2+
import { useContext, useEffect, useState } from 'react';
3+
import { ServiceContext } from '../../store/store';
4+
import { VolumeWatcher } from '../../utils/volumeWatcher';
5+
import hark from 'hark';
6+
7+
const MicVolume = (): JSX.Element => {
8+
const { mediaService } = useContext(ServiceContext);
9+
const [ volumeLevel, setVolume ] = useState<number>(0);
10+
11+
useEffect(() => {
12+
let volumeWatcher: VolumeWatcher | undefined;
13+
14+
// Add hark for mic
15+
if (mediaService.previewMicTrack) {
16+
const harkStream = new MediaStream();
17+
18+
harkStream.addTrack(mediaService.previewMicTrack.clone());
19+
20+
const micHark = hark(harkStream, {
21+
play: false,
22+
interval: 100,
23+
threshold: -60,
24+
history: 100
25+
});
26+
27+
volumeWatcher = new VolumeWatcher({ hark: micHark });
28+
}
29+
30+
const onVolumeChange = ({ scaledVolume }: { scaledVolume: number }): void => {
31+
setVolume(scaledVolume*10); // Range: 0-100
32+
};
33+
34+
volumeWatcher?.on('volumeChange', onVolumeChange);
35+
36+
return () => {
37+
volumeWatcher?.off('volumeChange', onVolumeChange);
38+
};
39+
}, [ mediaService.previewMicTrack ]);
40+
41+
return (
42+
<LinearProgress color='success' variant="determinate" value={volumeLevel} />
43+
);
44+
};
45+
46+
export default MicVolume;

src/services/mediaService.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { ProducerSource } from '../utils/types';
1717
import { MediaSender } from '../utils/mediaSender';
1818
import type { ClientMonitor } from '@observertc/client-monitor-js';
1919
import { Logger } from '../utils/Logger';
20+
import edumeetConfig from '../utils/edumeetConfig';
2021

2122
const logger = new Logger('MediaService');
2223

@@ -665,7 +666,7 @@ export class MediaService extends EventEmitter {
665666
get localCapabilities(): LocalCapabilities {
666667
return {
667668
canRecord: Boolean(MediaRecorder),
668-
canTranscribe: Boolean(window.webkitSpeechRecognition),
669+
canTranscribe: Boolean(window.webkitSpeechRecognition) && edumeetConfig.transcriptionEnabled,
669670
};
670671
}
671672

src/translations/de.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"label.fullscreen": "Vollbild",
6060
"label.guest": null,
6161
"label.high": "Hoch (HD)",
62+
"label.imprint": "Impressum",
6263
"label.italic": "kursiv",
6364
"label.join": "Eintreten",
6465
"label.joinBreakoutRoom": null,
@@ -77,6 +78,7 @@
7778
"label.openSettings": null,
7879
"label.participants": "Teilnehmer",
7980
"label.password": "Passwort",
81+
"label.privacy": "Datenschutz",
8082
"label.promoteAllPeers": "Alle Teilnehmer reinlassen",
8183
"label.recordingInProgress": "Aufnahme läuft...",
8284
"label.removeBreakoutRoom": null,

src/utils/types.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { TFLite } from '../services/effectsService';
33

44
export const defaultEdumeetConfig: EdumeetConfig = {
55
managementUrl: undefined,
6-
impressumUrl: '/privacy/privacy.html',
76
p2penabled: false,
87
loginEnabled: false,
98
developmentPort: 8443,
@@ -78,6 +77,7 @@ export const defaultEdumeetConfig: EdumeetConfig = {
7877
},
7978
title: 'edumeet',
8079
randomizeOnBlank: true,
80+
transcriptionEnabled: true,
8181
theme: {
8282
background: 'linear-gradient(135deg, rgba(1,42,74,1) 0%, rgba(1,58,99,1) 50%, rgba(1,73,124,1) 100%)',
8383
appBarColor: 'rgba(0, 0, 0, 0.4)',
@@ -91,12 +91,13 @@ export const defaultEdumeetConfig: EdumeetConfig = {
9191
sideContentItemDarkColor: 'rgba(150, 150, 150, 0.4)',
9292
sideContainerBackgroundColor: 'rgba(255, 255, 255, 0.7)',
9393
},
94-
reduxLoggingEnabled: false
94+
reduxLoggingEnabled: false,
95+
imprintUrl: '',
96+
privacyUrl: ''
9597
};
9698

9799
export interface EdumeetConfig {
98100
managementUrl?: string;
99-
impressumUrl: string;
100101
p2penabled: boolean;
101102
loginEnabled: boolean;
102103
developmentPort: number;
@@ -129,8 +130,11 @@ export interface EdumeetConfig {
129130
notificationSounds: Record<NotificationType, NotificationSound>;
130131
title: string;
131132
randomizeOnBlank: boolean;
133+
transcriptionEnabled: boolean;
132134
theme: ThemeOptions;
133135
reduxLoggingEnabled: boolean;
136+
imprintUrl: string;
137+
privacyUrl: string;
134138
}
135139

136140
export interface HTMLMediaElementWithSink extends HTMLMediaElement {

0 commit comments

Comments
 (0)