Skip to content

Commit

Permalink
feat/make-transcription-configurable (#195)
Browse files Browse the repository at this point in the history
* add option to disable transcription from config

* Fix typo

* remove blank line

* rm dir
  • Loading branch information
flowdnb authored Oct 28, 2024
1 parent e6a120a commit 7c5094c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,6 @@ can be found here: [config.example.js](public/config/config.example.js).
| logo | If not null, it shows the logo loaded from the specified URL, otherwise it shows the title. | `"url"` | ``"images/logo.edumeet.svg"`` |
| title | The title to show if the logo is not specified. | `"string"` | ``"edumeet"`` |
| randomizeOnBlank | Enable or disable randomize room name when it is blank. | `"boolean"` | ``true`` |
| transcriptionEnabled | Enable or disable transcription. | `"boolean"` | ``true`` |

---
3 changes: 3 additions & 0 deletions public/config/config.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ var config = {
// otherwise, it will remain empty and users will have to enter a room name.
randomizeOnBlank: true,

// Enable or disable transcription.
transcriptionEnabled: true,

// Client theme. Take a look at mui theme documentation.
theme: {
palette: {
Expand Down
3 changes: 2 additions & 1 deletion src/services/mediaService.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { ProducerSource } from '../utils/types';
import { MediaSender } from '../utils/mediaSender';
import type { ClientMonitor } from '@observertc/client-monitor-js';
import { Logger } from '../utils/Logger';
import edumeetConfig from '../utils/edumeetConfig';

const logger = new Logger('MediaService');

Expand Down Expand Up @@ -665,7 +666,7 @@ export class MediaService extends EventEmitter {
get localCapabilities(): LocalCapabilities {
return {
canRecord: Boolean(MediaRecorder),
canTranscribe: Boolean(window.webkitSpeechRecognition),
canTranscribe: Boolean(window.webkitSpeechRecognition) && edumeetConfig.transcriptionEnabled,
};
}

Expand Down
2 changes: 2 additions & 0 deletions src/utils/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export const defaultEdumeetConfig: EdumeetConfig = {
},
title: 'edumeet',
randomizeOnBlank: true,
transcriptionEnabled: true,
theme: {
background: 'linear-gradient(135deg, rgba(1,42,74,1) 0%, rgba(1,58,99,1) 50%, rgba(1,73,124,1) 100%)',
appBarColor: 'rgba(0, 0, 0, 0.4)',
Expand Down Expand Up @@ -129,6 +130,7 @@ export interface EdumeetConfig {
notificationSounds: Record<NotificationType, NotificationSound>;
title: string;
randomizeOnBlank: boolean;
transcriptionEnabled: boolean;
theme: ThemeOptions;
reduxLoggingEnabled: boolean;
}
Expand Down
3 changes: 1 addition & 2 deletions src/views/landingpage/LandingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { QRCode } from 'react-qrcode-logo';
import ImpressumButton from '../../components/controlbuttons/ImpressumButton';
import edumeetConfig from '../../utils/edumeetConfig';


const LandingPage = (): JSX.Element => {
const navigate = useNavigate();
const randomizeOnBlank = edumeetConfig.randomizeOnBlank;
Expand Down Expand Up @@ -53,4 +52,4 @@ const LandingPage = (): JSX.Element => {
);
};

export default LandingPage;
export default LandingPage;

0 comments on commit 7c5094c

Please sign in to comment.