bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/audio/captions/service.js
Pedro Beschorner Marin f726cb0ad5 refactor(captions): UX improvements
Parse the audio transcript before broadcasting it's content back to the
client and the recording actor. Limiting by 8 words per line and max of
2 lines to avoid CPU intensive operations over this recurring event.

Replace Calibri font family with Verdana to improve character spacing,
add relative sizing to the text content and a background padding.
2022-07-20 17:20:49 +00:00

29 lines
700 B
JavaScript

import AudioCaptions from '/imports/api/audio-captions';
import Auth from '/imports/ui/services/auth';
const getAudioCaptionsData = () => {
const audioCaptions = AudioCaptions.findOne({ meetingId: Auth.meetingID });
return audioCaptions ? audioCaptions.transcript : '';
};
const getAudioCaptions = () => Session.get('audioCaptions') || false;
const setAudioCaptions = (value) => Session.set('audioCaptions', value);
const hasAudioCaptions = () => {
const audioCaptions = AudioCaptions.findOne(
{ meetingId: Auth.meetingID },
{ fields: {} },
);
return !!audioCaptions;
};
export default {
getAudioCaptionsData,
getAudioCaptions,
setAudioCaptions,
hasAudioCaptions,
};