Merge pull request #18906 from Tainan404/hotfix-audio-captions
Hotfix: Audio captions not working properly
This commit is contained in:
commit
fd1a27fe21
@ -1,4 +1,3 @@
|
|||||||
import { throttle } from '/imports/utils/throttle';
|
|
||||||
import { diff } from '@mconf/bbb-diff';
|
import { diff } from '@mconf/bbb-diff';
|
||||||
import { Session } from 'meteor/session';
|
import { Session } from 'meteor/session';
|
||||||
import Auth from '/imports/ui/services/auth';
|
import Auth from '/imports/ui/services/auth';
|
||||||
@ -8,9 +7,9 @@ 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';
|
import { isLiveTranscriptionEnabled } from '/imports/ui/services/features';
|
||||||
import { unique } from 'radash';
|
import { unique, throttle } from 'radash';
|
||||||
|
|
||||||
const THROTTLE_TIMEOUT = 1000;
|
const THROTTLE_TIMEOUT = 200;
|
||||||
|
|
||||||
const CONFIG = Meteor.settings.public.app.audioCaptions;
|
const CONFIG = Meteor.settings.public.app.audioCaptions;
|
||||||
const ENABLED = CONFIG.enabled;
|
const ENABLED = CONFIG.enabled;
|
||||||
@ -105,17 +104,13 @@ const updateTranscript = (id, transcript, locale, isFinal) => {
|
|||||||
makeCall('updateTranscript', id, start, end, text, transcript, locale, isFinal);
|
makeCall('updateTranscript', id, start, end, text, transcript, locale, isFinal);
|
||||||
};
|
};
|
||||||
|
|
||||||
const throttledTranscriptUpdate = throttle(updateTranscript, THROTTLE_TIMEOUT, {
|
const throttledTranscriptUpdate = throttle({ interval: THROTTLE_TIMEOUT }, updateTranscript);
|
||||||
leading: false,
|
|
||||||
trailing: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
const updateInterimTranscript = (id, transcript, locale) => {
|
const updateInterimTranscript = (id, transcript, locale) => {
|
||||||
throttledTranscriptUpdate(id, transcript, locale, false);
|
throttledTranscriptUpdate(id, transcript, locale, false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateFinalTranscript = (id, transcript, locale) => {
|
const updateFinalTranscript = (id, transcript, locale) => {
|
||||||
throttledTranscriptUpdate.cancel();
|
|
||||||
updateTranscript(id, transcript, locale, true);
|
updateTranscript(id, transcript, locale, true);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user