agora-appbuilder-core 4.1.12 → 4.1.13-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/package.json +1 -1
  2. package/template/defaultConfig.js +2 -2
  3. package/template/src/assets/font-styles.css +4 -0
  4. package/template/src/assets/fonts/icomoon.ttf +0 -0
  5. package/template/src/assets/selection.json +1 -1
  6. package/template/src/atoms/ActionMenu.tsx +1 -1
  7. package/template/src/atoms/CustomIcon.tsx +1 -0
  8. package/template/src/atoms/Popup.tsx +1 -1
  9. package/template/src/components/Controls.tsx +21 -32
  10. package/template/src/language/default-labels/videoCallScreenLabels.ts +9 -9
  11. package/template/src/pages/VideoCall.tsx +2 -1
  12. package/template/src/pages/video-call/ActionSheetContent.tsx +0 -7
  13. package/template/src/pages/video-call/SidePanelHeader.tsx +80 -63
  14. package/template/src/rtm-events/constants.ts +9 -0
  15. package/template/src/subComponents/caption/Caption.tsx +4 -20
  16. package/template/src/subComponents/caption/CaptionContainer.tsx +262 -250
  17. package/template/src/subComponents/caption/CaptionIcon.tsx +6 -4
  18. package/template/src/subComponents/caption/CaptionText.tsx +26 -20
  19. package/template/src/subComponents/caption/LanguageSelectorPopup.tsx +30 -142
  20. package/template/src/subComponents/caption/Transcript.tsx +77 -32
  21. package/template/src/subComponents/caption/TranscriptIcon.tsx +7 -6
  22. package/template/src/subComponents/caption/TranslateActionMenu.tsx +128 -0
  23. package/template/src/subComponents/caption/useCaption.tsx +666 -480
  24. package/template/src/subComponents/caption/useSTTAPI.tsx +25 -4
  25. package/template/src/subComponents/caption/useStreamMessageUtils.native.ts +1 -1
  26. package/template/src/subComponents/caption/useStreamMessageUtils.ts +1 -1
  27. package/template/src/subComponents/caption/utils.ts +48 -40
@@ -460,7 +460,7 @@ const styles = StyleSheet.create({
460
460
  marginLeft: 12,
461
461
  },
462
462
  iconContainerEnd: {
463
- marginLeft: 10,
463
+ marginLeft: 'auto',
464
464
  display: 'flex',
465
465
  justifyContent: 'center',
466
466
  alignItems: 'center',
@@ -25,6 +25,7 @@ export interface IconsInterface {
25
25
  clipboard: string;
26
26
  tick: string;
27
27
  'tick-fill': string;
28
+ 'arrow-right': string;
28
29
  'arrow-down': string;
29
30
  'arrow-up': string;
30
31
  'screen-share': string;
@@ -106,7 +106,7 @@ const Popup = (props: PopupProps) => {
106
106
  <></>
107
107
  )}
108
108
 
109
- {title ? <Spacer size={32} /> : null}
109
+ {title ? <Spacer size={24} /> : null}
110
110
  </>
111
111
  ) : (
112
112
  <></>
@@ -320,9 +320,9 @@ const MoreButton = (props: {fields: ToolbarMoreButtonDefaultFields}) => {
320
320
  setIsCaptionON,
321
321
  // language: prevLang,
322
322
  isSTTActive,
323
- // setIsSTTActive,
323
+ sttDepsReady,
324
324
  isSTTError,
325
- handleTranslateConfigChange,
325
+ confirmSpokenLanguageChange,
326
326
  } = useCaption();
327
327
 
328
328
  const isTranscriptON = sidePanel === SidePanelType.Transcript;
@@ -538,7 +538,13 @@ const MoreButton = (props: {fields: ToolbarMoreButtonDefaultFields}) => {
538
538
  icon: `${isCaptionON ? 'captions-off' : 'captions'}`,
539
539
  iconColor: $config.SECONDARY_ACTION_COLOR,
540
540
  textColor: $config.FONT_COLOR,
541
- disabled: !($config.ENABLE_STT && $config.ENABLE_CAPTION),
541
+ disabled:
542
+ !sttDepsReady ||
543
+ !(
544
+ $config.ENABLE_STT &&
545
+ $config.ENABLE_CAPTION &&
546
+ (isHost || isSTTActive)
547
+ ),
542
548
  title: captionLabel(isCaptionON),
543
549
  onPress: () => {
544
550
  setActionMenuVisible(false);
@@ -560,11 +566,14 @@ const MoreButton = (props: {fields: ToolbarMoreButtonDefaultFields}) => {
560
566
  icon: 'transcript',
561
567
  iconColor: $config.SECONDARY_ACTION_COLOR,
562
568
  textColor: $config.FONT_COLOR,
563
- disabled: !(
564
- $config.ENABLE_STT &&
565
- $config.ENABLE_CAPTION &&
566
- $config.ENABLE_MEETING_TRANSCRIPT
567
- ),
569
+ disabled:
570
+ !sttDepsReady ||
571
+ !(
572
+ $config.ENABLE_STT &&
573
+ $config.ENABLE_CAPTION &&
574
+ $config.ENABLE_MEETING_TRANSCRIPT &&
575
+ (isHost || isSTTActive)
576
+ ),
568
577
  title: transcriptLabel(isTranscriptON),
569
578
  onPress: () => {
570
579
  setActionMenuVisible(false);
@@ -837,30 +846,15 @@ const MoreButton = (props: {fields: ToolbarMoreButtonDefaultFields}) => {
837
846
  setActionMenuVisible(false);
838
847
  }, [currentLayout]);
839
848
 
840
- const onConfirm = async (inputTranslateConfig: LanguageTranslationConfig) => {
849
+ const onConfirm = async (newSpokenLang: LanguageType) => {
841
850
  console.log(
842
- '[STT_PER_USER_BOT] Controls onConfirm called',
843
- inputTranslateConfig,
851
+ '[STT_GLOBAL] spoken language changed confirm called',
852
+ newSpokenLang,
844
853
  );
845
854
  const isCaptionClicked = STT_clicked.current === 'caption';
846
855
  const isTranscriptClicked = STT_clicked.current === 'transcript';
847
856
  setLanguagePopup(false);
848
- // isFirstTimePopupOpen.current = false;
849
- // const method = isCaptionClicked
850
- // ? isCaptionON
851
- // : isTranscriptON
852
- // ? 'stop'
853
- // : 'start';
854
-
855
- // if (method === 'stop') return; // not closing the stt service as it will stop for whole channel
856
- // if (method === 'start' && isSTTActive === true) return; // not triggering the start service if STT Service already started by anyone else in the channel
857
-
858
857
  try {
859
- // const res = await start(language, language);
860
- // if (res?.message.includes('STARTED')) {
861
- // // channel is already started now restart
862
- // await restart(language, language);
863
- // }
864
858
  if (isTranscriptClicked) {
865
859
  if (!isTranscriptON) {
866
860
  setSidePanel(SidePanelType.Transcript);
@@ -872,7 +866,7 @@ const MoreButton = (props: {fields: ToolbarMoreButtonDefaultFields}) => {
872
866
  setIsCaptionON(prev => !prev);
873
867
  } else {
874
868
  }
875
- await handleTranslateConfigChange(inputTranslateConfig);
869
+ await confirmSpokenLanguageChange(newSpokenLang);
876
870
  } catch (error) {
877
871
  setIsCaptionON(false);
878
872
  setSidePanel(SidePanelType.None);
@@ -1271,11 +1265,6 @@ const Controls = (props: ControlsProps) => {
1271
1265
  // addStreamMessageListener();
1272
1266
  // }, [sttLanguage]);
1273
1267
 
1274
- // Ask bhupendra
1275
- // React.useEffect(() => {
1276
- // setIsSTTActive(isSTTActive);
1277
- // }, [isSTTActive]);
1278
-
1279
1268
  const isHidden = (hide: ToolbarItemHide = false) => {
1280
1269
  try {
1281
1270
  return typeof hide === 'boolean'
@@ -10,7 +10,7 @@ export type sttSpokenLanguageToastHeadingDataType = 'Set' | 'Changed';
10
10
  export interface sttSpokenLanguageToastSubHeadingDataInterface {
11
11
  action: sttSpokenLanguageToastHeadingDataType;
12
12
  newLanguage: string;
13
- oldLanguage: string;
13
+ oldLanguage?: string;
14
14
  username: string;
15
15
  }
16
16
 
@@ -581,7 +581,7 @@ export interface I18nVideoCallScreenLabelsInterface {
581
581
  [toolbarItemNoiseCancellationText]?: I18nBaseType;
582
582
  [toolbarItemWhiteboardText]?: I18nConditionalType;
583
583
  [toolbarItemCaptionText]?: I18nConditionalType;
584
- [toolbarItemTranscriptText]?: I18nConditionalType;
584
+ [toolbarItemTranscriptText]?: I18nBaseType;
585
585
  [toolbarItemManageTextTracksText]?: I18nConditionalType;
586
586
  [toolbarItemVirtualBackgroundText]?: I18nBaseType;
587
587
  [toolbarItemViewRecordingText]?: I18nConditionalType;
@@ -955,7 +955,7 @@ export const VideoCallScreenLabels: I18nVideoCallScreenLabelsInterface = {
955
955
  [toolbarItemCaptionText]: active =>
956
956
  active ? 'Hide Caption' : 'Show Caption',
957
957
  [toolbarItemTranscriptText]: active =>
958
- active ? 'Hide Transcript' : 'Show Transcript',
958
+ active ? 'Hide Meeting Transcript' : 'Show Meeting Transcript',
959
959
  [toolbarItemViewRecordingText]: 'View Recordings',
960
960
  [toolbarItemManageTextTracksText]: 'View Text-tracks',
961
961
 
@@ -1043,8 +1043,8 @@ export const VideoCallScreenLabels: I18nVideoCallScreenLabelsInterface = {
1043
1043
  [textTrackModalTitleIntn]: 'Text Tracks',
1044
1044
  [sttChangeLanguagePopupHeading]: isFirstTimeOpened =>
1045
1045
  isFirstTimeOpened
1046
- ? 'Setup Captions & Translation'
1047
- : 'Modify Captions & Translation',
1046
+ ? 'Setup Captions & Transcript'
1047
+ : 'Update Spoken Language',
1048
1048
  [sttChangeLanguagePopupSubHeading]:
1049
1049
  'Please select your preferred language as the source language and up to 10 target languages to translate into. You can update these settings at any time by returning to this page.',
1050
1050
  [sttChangeLanguagePopupPrimaryBtnText]: 'CONFIRM',
@@ -1052,9 +1052,9 @@ export const VideoCallScreenLabels: I18nVideoCallScreenLabelsInterface = {
1052
1052
  'You can choose a maximum of ten languages',
1053
1053
  [sttChangeLanguagePopupDropdownError]:
1054
1054
  'Choose at least one language to proceed',
1055
- [sttChangeSpokenLanguageText]: 'Change Spoken Language',
1055
+ [sttChangeSpokenLanguageText]: 'Update Spoken Language',
1056
1056
  [sttStopTranslationText]: 'Stop Translation',
1057
- [sttOriginalTranslatedText]: 'Show Original and translated',
1057
+ [sttOriginalTranslatedText]: 'Show original and translated',
1058
1058
  [sttTranscriptPanelHeaderText]: 'Meeting Transcript',
1059
1059
  [sttDownloadBtnText]: 'Download',
1060
1060
  [sttDownloadTranscriptBtnText]: 'Download Transcript',
@@ -1289,8 +1289,8 @@ export const VideoCallScreenLabels: I18nVideoCallScreenLabelsInterface = {
1289
1289
  username,
1290
1290
  }) =>
1291
1291
  action === 'Set'
1292
- ? `${username} has set the spoken language to "${newLanguage}"`
1293
- : `${username} changed the spoken language from "${oldLanguage}" to ${newLanguage}`,
1292
+ ? `${username} set the spoken language to "${newLanguage}".`
1293
+ : `${username} changed the spoken language from "${oldLanguage}" to "${newLanguage}".`,
1294
1294
 
1295
1295
  [deviceDetectionToastHeading]: name => `New ${name} detected`,
1296
1296
  [deviceDetectionToastSubHeading]: ({name, label}) =>
@@ -491,7 +491,8 @@ const VideoCall: React.FC = () => {
491
491
  <RtmConfigure callActive={callActive}>
492
492
  <UserPreferenceProvider
493
493
  callActive={callActive}>
494
- <CaptionProvider>
494
+ <CaptionProvider
495
+ callActive={callActive}>
495
496
  <WaitingRoomProvider>
496
497
  <EventsConfigure
497
498
  setSttAutoStarted={
@@ -216,7 +216,6 @@ const ActionSheetContent = props => {
216
216
  const {isPendingRequestToReview, raiseHandList} =
217
217
  useContext(LiveStreamContext);
218
218
  const {totalUnreadCount} = useChatNotification();
219
- // const {setIsSTTActive, setLanguage, setMeetingTranscript} = useCaption();
220
219
  const {defaultContent} = useContent();
221
220
  const {waitingRoomUids} = useWaitingRoomContext();
222
221
  const defaultContentRef = React.useRef(defaultContent);
@@ -226,12 +225,6 @@ const ActionSheetContent = props => {
226
225
  defaultContentRef.current = defaultContent;
227
226
  }, [defaultContent]);
228
227
 
229
- // STT events on mount
230
-
231
- // React.useEffect(() => {
232
- // setIsSTTActive(isSTTActive);
233
- // }, [isSTTActive]);
234
-
235
228
  // React.useEffect(() => {
236
229
  // // for mobile events are set in ActionSheetContent
237
230
  // if (!sttLanguage) return;
@@ -30,6 +30,7 @@ import LanguageSelectorPopup from '../../subComponents/caption/LanguageSelectorP
30
30
  import useSTTAPI from '../../subComponents/caption/useSTTAPI';
31
31
  import useGetName from '../../utils/useGetName';
32
32
  import {
33
+ getLanguageLabel,
33
34
  LanguageType,
34
35
  mergeTranslationConfigs,
35
36
  TranslateConfig,
@@ -53,9 +54,9 @@ import {
53
54
  sttDownloadTranscriptBtnText,
54
55
  sttStopTranslationText,
55
56
  sttTranscriptPanelHeaderText,
57
+ sttOriginalTranslatedText,
56
58
  } from '../../language/default-labels/videoCallScreenLabels';
57
- import {logger, LogSource} from '../../logger/AppBuilderLogger';
58
- import {TranslateActionMenu} from '../../subComponents/caption/CaptionContainer';
59
+ import {TranslateActionMenu} from '../../subComponents/caption/TranslateActionMenu';
59
60
 
60
61
  export const SettingsHeader = props => {
61
62
  const {setSidePanel} = useSidePanel();
@@ -269,10 +270,11 @@ interface TranscriptHeaderActionMenuProps {
269
270
  const TranscriptHeaderActionMenu = (props: TranscriptHeaderActionMenuProps) => {
270
271
  const {actionMenuVisible, setActionMenuVisible, btnRef} = props;
271
272
  const {
272
- language: prevLang,
273
273
  meetingTranscript,
274
274
  isLangChangeInProgress,
275
275
  selectedTranslationLanguage,
276
+ transcriptViewMode,
277
+ setTranscriptViewMode,
276
278
  } = useCaption();
277
279
  const {downloadTranscript} = useTranscriptDownload();
278
280
  const [modalPosition, setModalPosition] = React.useState({});
@@ -282,89 +284,99 @@ const TranscriptHeaderActionMenu = (props: TranscriptHeaderActionMenuProps) => {
282
284
  React.useState<boolean>(false);
283
285
  const [isTranslateMenuOpen, setTranslateMenuOpen] =
284
286
  React.useState<boolean>(false);
285
- const {restart} = useSTTAPI();
286
- const username = useGetName();
287
+ // const {restart} = useSTTAPI();
288
+ // const username = useGetName();
287
289
  const actionMenuitems: ActionMenuItem[] = [];
288
290
  const {
289
291
  data: {isHost},
290
- sttLanguage,
291
292
  } = useRoomInfo();
292
- const {handleTranslateConfigChange, updateSTTBotSession, translationConfig} =
293
- useCaption();
293
+ const {confirmSpokenLanguageChange} = useCaption();
294
294
  const downloadTranscriptLabel = useString(sttDownloadTranscriptBtnText)();
295
- const changeSpokenLanguage = useString<boolean>(
295
+ const updateSpokenLanguageLabel = useString<boolean>(
296
296
  sttChangeSpokenLanguageText,
297
297
  )();
298
- const sttStopTranslationLabel = useString<boolean>(sttStopTranslationText)();
299
- const changeTranslationLanguage = useString<boolean>(
300
- sttChangeTranslationLanguageText,
301
- )();
298
+ // const sttStopTranslationLabel = useString<boolean>(sttStopTranslationText)();
299
+ // const changeTranslationLanguage = useString<boolean>(
300
+ // sttChangeTranslationLanguageText,
301
+ // )();
302
+ const sttOriginalTranslatedLabel = useString(sttOriginalTranslatedText)();
302
303
 
303
- // isHost &&
304
- actionMenuitems.push({
305
- icon: 'globe',
306
- iconColor: $config.SECONDARY_ACTION_COLOR,
307
- textColor: $config.FONT_COLOR,
308
- title: changeSpokenLanguage + ' ',
309
- disabled: isLangChangeInProgress,
310
- onPress: () => {
311
- setActionMenuVisible(false);
312
- setLanguagePopup(true);
313
- },
314
- });
315
-
316
- // actionMenuitems.push({
317
- // icon: 'lang-select',
318
- // iconColor: $config.SECONDARY_ACTION_COLOR,
319
- // textColor: $config.FONT_COLOR,
320
- // title: changeTranslationLanguage,
321
- // disabled: false,
322
- // onPress: () => {
323
- // setActionMenuVisible(false);
324
- // setTranslateMenuOpen(true);
325
- // },
326
- // });
304
+ // Update Spoken language
305
+ isHost &&
306
+ actionMenuitems.push({
307
+ icon: 'globe',
308
+ iconColor: $config.SECONDARY_ACTION_COLOR,
309
+ textColor: $config.FONT_COLOR,
310
+ title: updateSpokenLanguageLabel + ' ',
311
+ disabled: isLangChangeInProgress,
312
+ onPress: () => {
313
+ setActionMenuVisible(false);
314
+ setLanguagePopup(true);
315
+ },
316
+ });
327
317
 
328
318
  actionMenuitems.push({
329
319
  icon: 'lang-select',
330
320
  iconColor: $config.SECONDARY_ACTION_COLOR,
331
321
  textColor: $config.FONT_COLOR,
332
- title: sttStopTranslationLabel,
333
- disabled: false,
334
- onPress: async () => {
322
+ title: `Translate to: ${
323
+ selectedTranslationLanguage
324
+ ? getLanguageLabel([selectedTranslationLanguage])
325
+ : 'OFF'
326
+ }`,
327
+ endIcon: 'arrow-right',
328
+ endIconColor: $config.SECONDARY_ACTION_COLOR,
329
+ disabled: isLangChangeInProgress,
330
+ onPress: () => {
335
331
  setActionMenuVisible(false);
336
- // Keep source language same, just clear target languages
337
- // This stops translation but keeps transcription running
338
- await updateSTTBotSession({
339
- source: translationConfig.source, // Keep current source
340
- targets: [], // Empty targets = no translation
341
- });
332
+ setTranslateMenuOpen(true);
342
333
  },
343
334
  });
344
335
 
336
+ // View Mode Options
337
+ selectedTranslationLanguage &&
338
+ actionMenuitems.push({
339
+ icon: 'lang-translate',
340
+ iconColor: $config.SECONDARY_ACTION_COLOR,
341
+ endIcon:
342
+ transcriptViewMode === 'original-and-translated'
343
+ ? 'tick-fill'
344
+ : undefined,
345
+ endIconColor: $config.SEMANTIC_SUCCESS,
346
+ textColor: $config.FONT_COLOR,
347
+ title: sttOriginalTranslatedLabel,
348
+ disabled: isLangChangeInProgress,
349
+ onPress: () => {
350
+ setTranscriptViewMode(
351
+ transcriptViewMode === 'translated'
352
+ ? 'original-and-translated'
353
+ : 'translated',
354
+ );
355
+ setActionMenuVisible(false);
356
+ },
357
+ });
358
+ // Download transcript
345
359
  actionMenuitems.push({
346
360
  icon: 'download',
347
361
  iconColor: $config.SECONDARY_ACTION_COLOR,
348
362
  textColor: $config.FONT_COLOR,
349
363
  title: downloadTranscriptLabel,
350
- disabled: meetingTranscript.length === 0,
364
+ disabled: meetingTranscript.length === 0 || isLangChangeInProgress,
351
365
  onPress: () => {
352
366
  downloadTranscript();
353
367
  setActionMenuVisible(false);
354
368
  },
355
369
  });
356
370
 
357
- const onLanguageChange = async (
358
- inputTranslateConfig: LanguageTranslationConfig,
359
- ) => {
371
+ const onLanguageChange = async (newSpokenLang: LanguageType) => {
360
372
  console.log(
361
- '[STT_PER_USER_BOT] SidePanelHeader TranscriptHeaderActionMenu - onLanguageChange - sourceLanguage , targetLanguage:',
362
- inputTranslateConfig,
373
+ '[STT_GLOBAL] SidePanelHeader TranscriptHeaderActionMenu onSpokenLang changed called:',
374
+ newSpokenLang,
363
375
  );
364
376
  setLanguagePopup(false);
365
377
  // Update caption with new language configuration\
366
378
  try {
367
- await handleTranslateConfigChange(inputTranslateConfig);
379
+ await confirmSpokenLanguageChange(newSpokenLang);
368
380
  } catch (error) {}
369
381
  };
370
382
 
@@ -394,6 +406,7 @@ const TranscriptHeaderActionMenu = (props: TranscriptHeaderActionMenuProps) => {
394
406
  );
395
407
  }
396
408
  }, [actionMenuVisible]);
409
+
397
410
  return (
398
411
  <>
399
412
  <ActionMenu
@@ -404,17 +417,21 @@ const TranscriptHeaderActionMenu = (props: TranscriptHeaderActionMenuProps) => {
404
417
  items={actionMenuitems}
405
418
  />
406
419
 
407
- <LanguageSelectorPopup
408
- modalVisible={isLanguagePopupOpen}
409
- setModalVisible={setLanguagePopup}
410
- onConfirm={onLanguageChange}
411
- />
420
+ {isLanguagePopupOpen && (
421
+ <LanguageSelectorPopup
422
+ modalVisible={isLanguagePopupOpen}
423
+ setModalVisible={setLanguagePopup}
424
+ onConfirm={onLanguageChange}
425
+ />
426
+ )}
412
427
 
413
- <TranslateActionMenu
414
- actionMenuVisible={isTranslateMenuOpen}
415
- setActionMenuVisible={setTranslateMenuOpen}
416
- btnRef={btnRef}
417
- />
428
+ {isTranslateMenuOpen && (
429
+ <TranslateActionMenu
430
+ actionMenuVisible={isTranslateMenuOpen}
431
+ setActionMenuVisible={setTranslateMenuOpen}
432
+ btnRef={btnRef}
433
+ />
434
+ )}
418
435
  </>
419
436
  );
420
437
  };
@@ -33,6 +33,10 @@ const STT_LANGUAGE = 'STT_LANGUAGE_CHANGED';
33
33
  const STT_TRANSLATE_LANGUAGE = 'STT_TRANSLATE_LANGUAGE_CHANGED';
34
34
  const STT_SPOKEN_LANGUAGE = 'STT_SPOKEN_LANGUAGE';
35
35
  const USER_STOPPED_TRANSLATION = 'USER_STOPPED_TRANSLATION';
36
+ const STT_GLOBAL_STATE = 'STT_GLOBAL_STATE';
37
+ const STT_GLOBAL_SOURCE_LANGUAGE_UPDATED = 'STT_GLOBAL_SOURCE_LANGUAGE_UPDATED';
38
+ const STT_GLOBAL_TARGET_LANGUAGES_UPDATED =
39
+ 'STT_GLOBAL_TARGET_LANGUAGES_UPDATED';
36
40
  // 7. WAITING ROOM
37
41
  const WAITING_ROOM_REQUEST = 'WAITING_ROOM_REQUEST';
38
42
  const WAITING_ROOM_RESPONSE = 'WAITING_ROOM_RESPONSE';
@@ -54,11 +58,16 @@ const EventNames = {
54
58
  NAME_ATTRIBUTE,
55
59
  VIDEO_MEETING_HOST,
56
60
  VIDEO_MEETING_ATTENDEE,
61
+ // STT
57
62
  STT_ACTIVE,
63
+ STT_GLOBAL_STATE,
64
+ STT_GLOBAL_SOURCE_LANGUAGE_UPDATED,
65
+ STT_GLOBAL_TARGET_LANGUAGES_UPDATED,
58
66
  STT_LANGUAGE,
59
67
  STT_TRANSLATE_LANGUAGE,
60
68
  STT_SPOKEN_LANGUAGE,
61
69
  USER_STOPPED_TRANSLATION,
70
+ // Waiting room
62
71
  WAITING_ROOM_REQUEST,
63
72
  WAITING_ROOM_RESPONSE,
64
73
  WAITING_ROOM_STATUS_UPDATE,
@@ -37,7 +37,6 @@ const Caption: React.FC<CaptionProps> = ({
37
37
  const {RtcEngineUnsafe} = useRtc();
38
38
  const {
39
39
  isLangChangeInProgress,
40
- isTranslationChangeInProgress,
41
40
  captionObj, //state for current live caption for all users
42
41
  isSTTListenerAdded,
43
42
  setIsSTTListenerAdded,
@@ -45,7 +44,6 @@ const Caption: React.FC<CaptionProps> = ({
45
44
  prevSpeakerRef,
46
45
  getBotOwnerUid,
47
46
  isSTTActive,
48
- translationConfig,
49
47
  remoteSpokenLanguages,
50
48
  } = useCaption();
51
49
  const currentUserUid = useLocalUid();
@@ -79,7 +77,7 @@ const Caption: React.FC<CaptionProps> = ({
79
77
  // eslint-disable-next-line react-hooks/exhaustive-deps
80
78
  }, []);
81
79
 
82
- if (isLangChangeInProgress || isTranslationChangeInProgress) {
80
+ if (isLangChangeInProgress) {
83
81
  return (
84
82
  <Loading
85
83
  text={stLabel}
@@ -90,9 +88,9 @@ const Caption: React.FC<CaptionProps> = ({
90
88
  );
91
89
  }
92
90
 
93
- console.log('[STT_PER_USER_BOT] speaker uid', activeSpeakerRef.current);
94
- console.log('[STT_PER_USER_BOT] prev current uid ', prevSpeakerRef.current);
95
- console.log('[STT_PER_USER_BOT] captionObj ', captionObj);
91
+ console.log('[STT_GLOBAL] speaker uid', activeSpeakerRef.current);
92
+ console.log('[STT_GLOBAL] prev current uid ', prevSpeakerRef.current);
93
+ console.log('[STT_GLOBAL] captionObj ', captionObj);
96
94
 
97
95
  const speakerCount = prevSpeakerRef.current === '' ? 1 : 2;
98
96
 
@@ -135,13 +133,6 @@ const Caption: React.FC<CaptionProps> = ({
135
133
  captionTextStyle={captionTextStyle}
136
134
  speakerUid={getBotOwnerUid(prevSpeakerRef.current)}
137
135
  userLocalUid={currentUserUid}
138
- spokenLanguageCode={
139
- getBotOwnerUid(prevSpeakerRef.current) === currentUserUid
140
- ? translationConfig.source[0]
141
- : remoteSpokenLanguages[
142
- getBotOwnerUid(prevSpeakerRef.current)
143
- ]
144
- }
145
136
  />
146
137
  ) : (
147
138
  <></>
@@ -165,13 +156,6 @@ const Caption: React.FC<CaptionProps> = ({
165
156
  captionTextStyle={captionTextStyle}
166
157
  speakerUid={getBotOwnerUid(activeSpeakerRef.current)}
167
158
  userLocalUid={currentUserUid}
168
- spokenLanguageCode={
169
- getBotOwnerUid(activeSpeakerRef.current) === currentUserUid
170
- ? translationConfig.source[0]
171
- : remoteSpokenLanguages[
172
- getBotOwnerUid(activeSpeakerRef.current)
173
- ]
174
- }
175
159
  />
176
160
  ) : (
177
161
  <></>