diff --git a/bigbluebutton-html5/imports/api/audio-captions/server/handlers/transcriptUpdated.js b/bigbluebutton-html5/imports/api/audio-captions/server/handlers/transcriptUpdated.js index a57d84f0a6..538de9ca3e 100644 --- a/bigbluebutton-html5/imports/api/audio-captions/server/handlers/transcriptUpdated.js +++ b/bigbluebutton-html5/imports/api/audio-captions/server/handlers/transcriptUpdated.js @@ -1,26 +1,14 @@ import setTranscript from '/imports/api/audio-captions/server/modifiers/setTranscript'; -import updatePad from '/imports/api/pads/server/methods/updatePad'; -import Users from '/imports/api/users'; export default function transcriptUpdated({ header, body }) { const { meetingId, - userId, } = header; const { transcriptId, transcript, - locale, - result, } = body; - if (result) { - const user = Users.findOne({ userId }, { fields: { name: 1 } }); - const datetime = new Date(Date.now()); - const userSpoke = `\n ${user.name} (${datetime.getHours()}:${datetime.getMinutes()}): ${transcript}`; - updatePad(meetingId, userId, 'en', userSpoke); - } - setTranscript(meetingId, transcriptId, transcript); } diff --git a/bigbluebutton-html5/imports/ui/components/actions-bar/component.jsx b/bigbluebutton-html5/imports/ui/components/actions-bar/component.jsx index 9b5aa82ea8..084932c544 100755 --- a/bigbluebutton-html5/imports/ui/components/actions-bar/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/actions-bar/component.jsx @@ -1,4 +1,5 @@ import React, { PureComponent } from 'react'; +import CaptionsButtonContainer from '/imports/ui/components/captions/button/container'; import withShortcutHelper from '/imports/ui/components/shortcut-help/service'; import deviceInfo from '/imports/utils/deviceInfo'; import Styled from './styles'; @@ -67,6 +68,11 @@ class ActionsBar extends PureComponent { showPushLayout, }} /> + { isCaptionsAvailable + ? ( + + ) + : null } { !deviceInfo.isMobile ? ( diff --git a/bigbluebutton-html5/imports/ui/components/audio/captions/button/component.jsx b/bigbluebutton-html5/imports/ui/components/audio/captions/button/component.jsx index c8fe1209a9..326bd995b3 100644 --- a/bigbluebutton-html5/imports/ui/components/audio/captions/button/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/audio/captions/button/component.jsx @@ -3,11 +3,9 @@ import PropTypes from 'prop-types'; import { defineMessages, injectIntl } from 'react-intl'; import Service from '/imports/ui/components/audio/captions/service'; import SpeechService from '/imports/ui/components/audio/captions/speech/service'; -import ServiceOldCaptions from '/imports/ui/components/captions/service'; import ButtonEmoji from '/imports/ui/components/common/button/button-emoji/ButtonEmoji'; import BBBMenu from '/imports/ui/components/common/menu/component'; import Styled from './styles'; -import OldCaptionsService from '/imports/ui/components/captions/service'; const intlMessages = defineMessages({ start: { @@ -90,16 +88,7 @@ const CaptionsButton = ({ availableVoices, isSupported, isVoiceUser, - mountModal, }) => { - const usePrevious = (value) => { - const ref = useRef(); - useEffect(() => { - ref.current = value; - }); - return ref.current; - } - const isTranscriptionDisabled = () => ( currentSpeechLocale === DISABLED ); @@ -115,12 +104,7 @@ const CaptionsButton = ({ if (!isTranscriptionDisabled()) selectedLocale.current = getSelectedLocaleValue; }, [currentSpeechLocale]); - const prevEnabled = usePrevious(enabled); - - if (!enabled) return null; - if (!prevEnabled && enabled) { - OldCaptionsService.createCaptions('en'); - } + if (!enabled) return null; const shouldRenderChevron = isSupported && isVoiceUser; diff --git a/bigbluebutton-html5/imports/ui/components/audio/captions/button/container.jsx b/bigbluebutton-html5/imports/ui/components/audio/captions/button/container.jsx index d5c017afa9..c755ca9a70 100644 --- a/bigbluebutton-html5/imports/ui/components/audio/captions/button/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/audio/captions/button/container.jsx @@ -8,7 +8,7 @@ import AudioService from '/imports/ui/components/audio/service'; const Container = (props) =>