bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/audio/captions/service.js
Pedro Beschorner Marin 307ab6ea40 feat(captions): add author avatar
Include captions' author avatar at the live feedback to improve identification.
2022-07-20 17:20:50 +00:00

39 lines
842 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 });
if (audioCaptions) {
return {
transcriptId: audioCaptions.transcriptId,
transcript: audioCaptions.transcript,
};
}
return {
transcriptId: '',
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,
};