Merge pull request #16170 from GuiLeme/disabled-transcriptions

This commit is contained in:
Gustavo Trott 2023-01-11 13:54:05 -03:00 committed by GitHub
commit 734221676e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 4 deletions

View File

@ -40,7 +40,9 @@ trait UpdateTranscriptPubMsgHdlr {
bus.outGW.send(msgEvent) bus.outGW.send(msgEvent)
} }
if (AudioCaptions.isFloor(liveMeeting.audioCaptions, msg.header.userId)) { val isTranscriptionEnabled = !liveMeeting.props.meetingProp.disabledFeatures.contains("liveTranscription")
if (AudioCaptions.isFloor(liveMeeting.audioCaptions, msg.header.userId) && isTranscriptionEnabled) {
val (start, end, text) = AudioCaptions.editTranscript( val (start, end, text) = AudioCaptions.editTranscript(
liveMeeting.audioCaptions, liveMeeting.audioCaptions,
msg.body.transcriptId, msg.body.transcriptId,

View File

@ -7,11 +7,11 @@ import logger from '/imports/startup/client/logger';
import Users from '/imports/api/users'; import Users from '/imports/api/users';
import AudioService from '/imports/ui/components/audio/service'; import AudioService from '/imports/ui/components/audio/service';
import deviceInfo from '/imports/utils/deviceInfo'; import deviceInfo from '/imports/utils/deviceInfo';
import { isLiveTranscriptionEnabled } from '/imports/ui/services/features';
const THROTTLE_TIMEOUT = 1000; const THROTTLE_TIMEOUT = 1000;
const CONFIG = Meteor.settings.public.app.audioCaptions; const CONFIG = Meteor.settings.public.app.audioCaptions;
const ENABLED = CONFIG.enabled;
const LANGUAGES = CONFIG.language.available; const LANGUAGES = CONFIG.language.available;
const VALID_ENVIRONMENT = !deviceInfo.isMobile || CONFIG.mobile; const VALID_ENVIRONMENT = !deviceInfo.isMobile || CONFIG.mobile;
@ -126,7 +126,7 @@ const hasSpeechLocale = (userId = Auth.userID) => getSpeechLocale(userId) !== ''
const isLocaleValid = (locale) => LANGUAGES.includes(locale); const isLocaleValid = (locale) => LANGUAGES.includes(locale);
const isEnabled = () => ENABLED; const isEnabled = () => isLiveTranscriptionEnabled();
const isActive = () => isEnabled() && hasSpeechRecognitionSupport() && hasSpeechLocale(); const isActive = () => isEnabled() && hasSpeechRecognitionSupport() && hasSpeechLocale();

View File

@ -40,6 +40,10 @@ export function isCaptionsEnabled() {
return getDisabledFeatures().indexOf('captions') === -1 && Meteor.settings.public.captions.enabled; return getDisabledFeatures().indexOf('captions') === -1 && Meteor.settings.public.captions.enabled;
} }
export function isLiveTranscriptionEnabled() {
return getDisabledFeatures().indexOf('liveTranscription') === -1 && Meteor.settings.public.app.audioCaptions.enabled;
}
export function isBreakoutRoomsEnabled() { export function isBreakoutRoomsEnabled() {
return getDisabledFeatures().indexOf('breakoutRooms') === -1; return getDisabledFeatures().indexOf('breakoutRooms') === -1;
} }

View File

@ -413,7 +413,7 @@ endWhenNoModerator=false
endWhenNoModeratorDelayInMinutes=1 endWhenNoModeratorDelayInMinutes=1
# List of features to disable (comma-separated) # List of features to disable (comma-separated)
# Available options: breakoutRooms, captions, chat, externalVideos, layouts, learningDashboard, polls, screenshare, # Available options: breakoutRooms, liveTranscription, captions, chat, externalVideos, layouts, learningDashboard, polls, screenshare,
# sharedNotes, virtualBackgrounds, downloadPresentationWithAnnotations, importPresentationWithAnnotationsFromBreakoutRooms, importSharedNotesFromBreakoutRooms # sharedNotes, virtualBackgrounds, downloadPresentationWithAnnotations, importPresentationWithAnnotationsFromBreakoutRooms, importSharedNotesFromBreakoutRooms
# disabledFeatures= # disabledFeatures=