agora-appbuilder-core 4.1.10-beta.1 → 4.1.11

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 (132) hide show
  1. package/package.json +2 -2
  2. package/template/agora-rn-uikit/src/Utils/isBotUser.ts +1 -1
  3. package/template/android/app/build.gradle +0 -7
  4. package/template/bridge/rtc/webNg/RtcEngine.ts +2 -2
  5. package/template/bridge/rtm/web/Types.ts +0 -183
  6. package/template/bridge/rtm/web/index.ts +488 -450
  7. package/template/customization-api/typeDefinition.ts +0 -1
  8. package/template/defaultConfig.js +3 -4
  9. package/template/global.d.ts +0 -1
  10. package/template/ios/Podfile +0 -41
  11. package/template/package.json +5 -5
  12. package/template/src/AppRoutes.tsx +3 -3
  13. package/template/src/ai-agent/components/ControlButtons.tsx +1 -1
  14. package/template/src/assets/font-styles.css +1 -33
  15. package/template/src/assets/fonts/icomoon.ttf +0 -0
  16. package/template/src/assets/selection.json +1 -1
  17. package/template/src/atoms/ActionMenu.tsx +93 -13
  18. package/template/src/atoms/CustomIcon.tsx +1 -8
  19. package/template/src/atoms/DropDownMulti.tsx +80 -29
  20. package/template/src/atoms/Dropdown.tsx +0 -5
  21. package/template/src/atoms/Input.tsx +2 -1
  22. package/template/src/atoms/TertiaryButton.tsx +1 -1
  23. package/template/src/atoms/UserAvatar.tsx +1 -1
  24. package/template/src/components/ChatContext.ts +3 -5
  25. package/template/src/components/Controls.tsx +167 -208
  26. package/template/src/components/DeviceConfigure.tsx +1 -1
  27. package/template/src/components/EventsConfigure.tsx +168 -118
  28. package/template/src/components/Navbar.tsx +11 -14
  29. package/template/src/components/RTMConfigure.tsx +819 -32
  30. package/template/src/components/beauty-effect/useBeautyEffects.tsx +13 -50
  31. package/template/src/components/chat/chatConfigure.tsx +1 -7
  32. package/template/src/components/chat-messages/useChatMessages.tsx +11 -43
  33. package/template/src/components/controls/useControlPermissionMatrix.tsx +4 -32
  34. package/template/src/components/participants/AllHostParticipants.tsx +2 -10
  35. package/template/src/components/participants/Participant.tsx +1 -7
  36. package/template/src/components/participants/UserActionMenuOptions.tsx +2 -12
  37. package/template/src/components/precall/joinCallBtn.native.tsx +7 -2
  38. package/template/src/components/precall/joinCallBtn.tsx +7 -2
  39. package/template/src/components/precall/joinWaitingRoomBtn.native.tsx +16 -15
  40. package/template/src/components/precall/joinWaitingRoomBtn.tsx +31 -17
  41. package/template/src/components/precall/textInput.tsx +45 -22
  42. package/template/src/components/precall/usePreCall.tsx +7 -0
  43. package/template/src/components/recordings/RecordingsDateTable.tsx +2 -3
  44. package/template/src/components/room-info/useRoomInfo.tsx +5 -0
  45. package/template/src/components/useUserPreference.tsx +12 -39
  46. package/template/src/components/virtual-background/useVB.tsx +0 -18
  47. package/template/src/components/whiteboard/WhiteboardConfigure.tsx +0 -27
  48. package/template/src/language/default-labels/videoCallScreenLabels.ts +27 -11
  49. package/template/src/logger/AppBuilderLogger.tsx +3 -11
  50. package/template/src/pages/VideoCall.tsx +518 -171
  51. package/template/src/pages/video-call/ActionSheetContent.tsx +77 -77
  52. package/template/src/pages/video-call/SidePanelHeader.tsx +81 -53
  53. package/template/src/pages/video-call/VideoCallScreen.tsx +0 -18
  54. package/template/src/pages/video-call/VideoCallScreenWrapper.tsx +1 -0
  55. package/template/src/rtm/RTMEngine.ts +37 -262
  56. package/template/src/rtm/utils.ts +1 -68
  57. package/template/src/rtm-events/constants.ts +7 -40
  58. package/template/src/rtm-events-api/Events.ts +39 -158
  59. package/template/src/subComponents/ChatBubble.tsx +3 -3
  60. package/template/src/subComponents/ChatContainer.tsx +9 -19
  61. package/template/src/subComponents/LocalAudioMute.tsx +2 -2
  62. package/template/src/subComponents/LocalVideoMute.tsx +2 -2
  63. package/template/src/subComponents/SidePanelEnum.tsx +0 -1
  64. package/template/src/subComponents/caption/Caption.tsx +48 -7
  65. package/template/src/subComponents/caption/CaptionContainer.tsx +324 -51
  66. package/template/src/subComponents/caption/CaptionIcon.tsx +35 -34
  67. package/template/src/subComponents/caption/CaptionText.tsx +103 -2
  68. package/template/src/subComponents/caption/LanguageSelectorPopup.tsx +179 -69
  69. package/template/src/subComponents/caption/Transcript.tsx +46 -11
  70. package/template/src/subComponents/caption/TranscriptIcon.tsx +27 -35
  71. package/template/src/subComponents/caption/TranscriptText.tsx +78 -3
  72. package/template/src/subComponents/caption/proto/ptoto.js +38 -4
  73. package/template/src/subComponents/caption/proto/test.proto +34 -19
  74. package/template/src/subComponents/caption/useCaption.tsx +754 -11
  75. package/template/src/subComponents/caption/useSTTAPI.tsx +118 -205
  76. package/template/src/subComponents/caption/useStreamMessageUtils.native.ts +152 -33
  77. package/template/src/subComponents/caption/useStreamMessageUtils.ts +165 -34
  78. package/template/src/subComponents/caption/utils.ts +171 -3
  79. package/template/src/subComponents/chat/ChatSendButton.tsx +0 -1
  80. package/template/src/subComponents/screenshare/ScreenshareButton.tsx +0 -16
  81. package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +1 -1
  82. package/template/src/subComponents/waiting-rooms/WaitingRoomControls.tsx +4 -7
  83. package/template/src/utils/SdkEvents.ts +3 -0
  84. package/template/src/utils/useEndCall.ts +4 -4
  85. package/template/src/utils/useMuteToggleLocal.ts +10 -14
  86. package/template/src/utils/useSpeechToText.ts +31 -20
  87. package/template/bridge/rtm/web/index-legacy.ts +0 -540
  88. package/template/src/components/RTMConfigure-legacy.tsx +0 -848
  89. package/template/src/components/UserGlobalPreferenceProvider.tsx +0 -227
  90. package/template/src/components/breakout-room/BreakoutRoomPanel.tsx +0 -58
  91. package/template/src/components/breakout-room/context/BreakoutRoomContext.tsx +0 -2508
  92. package/template/src/components/breakout-room/events/BreakoutRoomEventsConfigure.tsx +0 -272
  93. package/template/src/components/breakout-room/events/constants.ts +0 -17
  94. package/template/src/components/breakout-room/hoc/BreakoutRoomNameRenderer.tsx +0 -68
  95. package/template/src/components/breakout-room/hooks/useBreakoutRoomExit.ts +0 -49
  96. package/template/src/components/breakout-room/state/reducer.ts +0 -522
  97. package/template/src/components/breakout-room/state/types.ts +0 -54
  98. package/template/src/components/breakout-room/ui/BreakoutMeetingTitle.tsx +0 -60
  99. package/template/src/components/breakout-room/ui/BreakoutRoomActionMenu.tsx +0 -136
  100. package/template/src/components/breakout-room/ui/BreakoutRoomAnnouncementModal.tsx +0 -135
  101. package/template/src/components/breakout-room/ui/BreakoutRoomGroupSettings.tsx +0 -588
  102. package/template/src/components/breakout-room/ui/BreakoutRoomMainRoomUsers.tsx +0 -142
  103. package/template/src/components/breakout-room/ui/BreakoutRoomMemberActionMenu.tsx +0 -122
  104. package/template/src/components/breakout-room/ui/BreakoutRoomParticipants.tsx +0 -124
  105. package/template/src/components/breakout-room/ui/BreakoutRoomRaiseHand.tsx +0 -65
  106. package/template/src/components/breakout-room/ui/BreakoutRoomRenameModal.tsx +0 -227
  107. package/template/src/components/breakout-room/ui/BreakoutRoomSettings.tsx +0 -140
  108. package/template/src/components/breakout-room/ui/BreakoutRoomTransition.tsx +0 -52
  109. package/template/src/components/breakout-room/ui/BreakoutRoomView.tsx +0 -193
  110. package/template/src/components/breakout-room/ui/ExitBreakoutRoomIconButton.tsx +0 -79
  111. package/template/src/components/breakout-room/ui/ParticipantManualAssignmentModal.tsx +0 -638
  112. package/template/src/components/breakout-room/ui/SelectParticipantAssignmentStrategy.tsx +0 -57
  113. package/template/src/components/common/Dividers.tsx +0 -53
  114. package/template/src/components/controls/toolbar-items/ExitBreakoutRoomToolbarItem.tsx +0 -13
  115. package/template/src/components/raise-hand/RaiseHandButton.tsx +0 -50
  116. package/template/src/components/raise-hand/RaiseHandProvider.tsx +0 -308
  117. package/template/src/components/raise-hand/index.ts +0 -14
  118. package/template/src/components/room-info/useCurrentRoomInfo.tsx +0 -42
  119. package/template/src/components/room-info/useSetBreakoutRoomInfo.tsx +0 -64
  120. package/template/src/pages/video-call/BreakoutVideoCall.tsx +0 -213
  121. package/template/src/pages/video-call/VideoCallContent.tsx +0 -211
  122. package/template/src/pages/video-call/VideoCallStateWrapper.tsx +0 -495
  123. package/template/src/rtm/RTMConfigureBreakoutRoomProvider.tsx +0 -882
  124. package/template/src/rtm/RTMConfigureMainRoomProvider.tsx +0 -757
  125. package/template/src/rtm/RTMCoreProvider.tsx +0 -419
  126. package/template/src/rtm/RTMGlobalStateProvider.tsx +0 -706
  127. package/template/src/rtm/RTMStatusBanner.tsx +0 -99
  128. package/template/src/rtm/constants.ts +0 -12
  129. package/template/src/rtm/hooks/useMainRoomUserDisplayName.ts +0 -45
  130. package/template/src/rtm/rtm-presence-utils.ts +0 -344
  131. package/template/src/subComponents/chat/ChatAnnouncementView.tsx +0 -65
  132. package/template/src/utils/useDebouncedCallback.tsx +0 -20
@@ -1,5 +1,6 @@
1
1
  import {createHook} from 'customization-implementation';
2
- import React, {useState, useEffect, useRef} from 'react';
2
+ import React, {useState} from 'react';
3
+ import {useEffect, useRef} from 'react';
3
4
  import AgoraRTC, {ILocalVideoTrack} from 'agora-rtc-sdk-ng';
4
5
  import BeautyExtension from 'agora-extension-beauty-effect';
5
6
  import {useRoomInfo, useRtc} from 'customization-api';
@@ -76,45 +77,19 @@ const BeautyEffectProvider: React.FC = ({children}) => {
76
77
 
77
78
  const {RtcEngineUnsafe} = useRtc();
78
79
  //@ts-ignore
79
- const localVideoTrack: ILocalVideoTrack | undefined =
80
- RtcEngineUnsafe?.localStream?.video;
81
-
82
- // ✅ useRef to persist timeout across renders
83
- const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
84
-
85
- if (timeoutRef.current) {
86
- clearTimeout(timeoutRef.current);
87
- timeoutRef.current = null;
88
- }
80
+ const localVideoTrack = RtcEngineUnsafe?.localStream?.video;
89
81
 
90
82
  if (!roomPreference?.disableVideoProcessors) {
91
- /**
92
- * Small delay to ensure the new track is stable
93
- * when we move from main room to breakout room the track changes
94
- * from live to ended instantly as the user audio or video preferences are applied
95
- * It solves the error 'MediaStreamTrackProcessor': Input track cannot be ended'
96
- */
97
- timeoutRef.current = setTimeout(() => {
98
- const trackStatus = localVideoTrack?.getMediaStreamTrack()?.readyState;
99
- if (trackStatus === 'live') {
100
- try {
101
- if ($config.ENABLE_VIRTUAL_BACKGROUND) {
102
- localVideoTrack
103
- ?.pipe(beautyProcessor)
104
- .pipe(vbProcessor)
105
- .pipe(localVideoTrack?.processorDestination);
106
- } else {
107
- localVideoTrack
108
- ?.pipe(beautyProcessor)
109
- .pipe(localVideoTrack?.processorDestination);
110
- }
111
- } catch (err) {
112
- console.error('Error applying processors:', err);
113
- }
114
- } else {
115
- console.warn('Track not live after delay, skipping pipe');
116
- }
117
- }, 300);
83
+ if ($config.ENABLE_VIRTUAL_BACKGROUND) {
84
+ localVideoTrack
85
+ ?.pipe(beautyProcessor)
86
+ .pipe(vbProcessor)
87
+ .pipe(localVideoTrack?.processorDestination);
88
+ } else {
89
+ localVideoTrack
90
+ ?.pipe(beautyProcessor)
91
+ .pipe(localVideoTrack?.processorDestination);
92
+ }
118
93
  }
119
94
 
120
95
  useEffect(() => {
@@ -138,18 +113,6 @@ const BeautyEffectProvider: React.FC = ({children}) => {
138
113
  lighteningContrastLevel,
139
114
  ]);
140
115
 
141
- // Proper cleanup for both processor and timeout
142
- useEffect(() => {
143
- return () => {
144
- beautyProcessor?.disable();
145
- beautyProcessor?.unpipe?.();
146
- if (timeoutRef.current) {
147
- clearTimeout(timeoutRef.current);
148
- timeoutRef.current = null;
149
- }
150
- };
151
- }, []);
152
-
153
116
  const removeBeautyEffect = async () => {
154
117
  await beautyProcessor.disable();
155
118
  };
@@ -7,7 +7,6 @@ import {useLocalUid} from '../../../agora-rn-uikit';
7
7
  import {UidType, useContent} from 'customization-api';
8
8
  import {
9
9
  ChatMessageType,
10
- ChatNotificationType,
11
10
  ChatOption,
12
11
  SDKChatType,
13
12
  useChatMessages,
@@ -256,7 +255,7 @@ const ChatConfigure = ({children}) => {
256
255
  );
257
256
  }
258
257
  },
259
- // Text message is recieved, update receiver side ui
258
+ // text message is recieved
260
259
  onTextMessage: message => {
261
260
  if (message?.ext?.channel !== data?.channel) {
262
261
  return;
@@ -273,14 +272,11 @@ const ChatConfigure = ({children}) => {
273
272
 
274
273
  if (message.chatType === SDKChatType.GROUP_CHAT) {
275
274
  // show to notifcation- group msg received
276
-
277
275
  showMessageNotification(
278
276
  message.msg,
279
277
  fromUser,
280
278
  false,
281
279
  message.type,
282
- false,
283
- message.ext?.announcement,
284
280
  );
285
281
  addMessageToStore(Number(fromUser), {
286
282
  msg: message.msg.replace(/^(\n)+|(\n)+$/g, ''),
@@ -289,7 +285,6 @@ const ChatConfigure = ({children}) => {
289
285
  isDeleted: false,
290
286
  type: ChatMessageType.TXT,
291
287
  replyToMsgId: message.ext?.replyToMsgId,
292
- announcement: message.ext?.announcement,
293
288
  });
294
289
  }
295
290
 
@@ -423,7 +418,6 @@ const ChatConfigure = ({children}) => {
423
418
  ext: option?.ext?.file_ext,
424
419
  fileName: option?.ext?.file_name,
425
420
  replyToMsgId: option?.ext?.replyToMsgId,
426
- announcement: option?.ext?.announcement,
427
421
  };
428
422
 
429
423
  // update local user message store
@@ -46,11 +46,6 @@ interface ChatMessagesProviderProps {
46
46
  children: React.ReactNode;
47
47
  callActive: boolean;
48
48
  }
49
-
50
- export enum ChatNotificationType {
51
- ANNOUNCEMENT = 'ANNOUNCEMENT',
52
- }
53
-
54
49
  export enum ChatMessageType {
55
50
  /**
56
51
  * Text message.
@@ -90,10 +85,6 @@ export enum ChatMessageType {
90
85
  COMBINE = 'combine',
91
86
  }
92
87
 
93
- export interface AnnouncementMessage {
94
- sender: string;
95
- heading: string;
96
- }
97
88
  export interface messageInterface {
98
89
  createdTimestamp: number;
99
90
  updatedTimestamp?: number;
@@ -108,7 +99,6 @@ export interface messageInterface {
108
99
  reactions?: Reaction[];
109
100
  replyToMsgId?: string;
110
101
  hide?: boolean;
111
- announcement?: AnnouncementMessage;
112
102
  }
113
103
 
114
104
  export enum SDKChatType {
@@ -132,7 +122,6 @@ export interface ChatOption {
132
122
  channel?: string;
133
123
  msg?: string;
134
124
  replyToMsgId?: string;
135
- announcement?: AnnouncementMessage;
136
125
  };
137
126
  url?: string;
138
127
  }
@@ -189,8 +178,6 @@ interface ChatMessagesInterface {
189
178
  uid: string,
190
179
  isPrivateMessage?: boolean,
191
180
  msgType?: ChatMessageType,
192
- forceStop?: boolean,
193
- notificationType?: ChatNotificationType,
194
181
  ) => void;
195
182
  openPrivateChat: (toUid: UidType) => void;
196
183
  removeMessageFromStore: (msgId: string, isMsgRecalled: boolean) => void;
@@ -290,20 +277,11 @@ const ChatMessagesProvider = (props: ChatMessagesProviderProps) => {
290
277
 
291
278
  //commented for v1 release
292
279
  //const fromText = useString('messageSenderNotificationLabel');
293
- const fromText = (
294
- name: string,
295
- msgType: ChatMessageType,
296
- announcement?: AnnouncementText,
297
- ) => {
280
+ const fromText = (name: string, msgType: ChatMessageType) => {
298
281
  let text = '';
299
282
  switch (msgType) {
300
283
  case ChatMessageType.TXT:
301
- if (announcement?.text) {
302
- text = `${announcement.sender}: made an announcement in public chat`;
303
- } else {
304
- text = txtToastHeading?.current(name);
305
- }
306
-
284
+ text = txtToastHeading?.current(name);
307
285
  break;
308
286
  case ChatMessageType.IMAGE:
309
287
  text = imgToastHeading?.current(name);
@@ -351,15 +329,12 @@ const ChatMessagesProvider = (props: ChatMessagesProviderProps) => {
351
329
 
352
330
  //TODO: check why need
353
331
 
354
- // If this is needed use syncUserState
355
- //
356
- // const updateRenderListState = (
357
- // uid: number,
358
- // data: Partial<ContentInterface>,
359
- // ) => {
360
- // dispatch({type: 'UpdateRenderList', value: [uid, data]});
361
- // };
362
- //
332
+ const updateRenderListState = (
333
+ uid: number,
334
+ data: Partial<ContentInterface>,
335
+ ) => {
336
+ dispatch({type: 'UpdateRenderList', value: [uid, data]});
337
+ };
363
338
 
364
339
  const addMessageToStore = (uid: UidType, body: messageInterface) => {
365
340
  setMessageStore((m: messageStoreInterface[]) => {
@@ -378,7 +353,6 @@ const ChatMessagesProvider = (props: ChatMessagesProviderProps) => {
378
353
  fileName: body?.fileName,
379
354
  replyToMsgId: body?.replyToMsgId,
380
355
  hide: false,
381
- announcement: body?.announcement,
382
356
  },
383
357
  ];
384
358
  });
@@ -546,7 +520,6 @@ const ChatMessagesProvider = (props: ChatMessagesProviderProps) => {
546
520
  isPrivateMessage: boolean = false,
547
521
  msgType: ChatMessageType,
548
522
  forceStop: boolean = false,
549
- announcement: AnnouncementMessage,
550
523
  ) => {
551
524
  if (isUserBanedRef.current.isUserBaned) {
552
525
  return;
@@ -711,22 +684,17 @@ const ChatMessagesProvider = (props: ChatMessagesProviderProps) => {
711
684
  primaryBtn: null,
712
685
  secondaryBtn: null,
713
686
  type: 'info',
714
- leadingIconName: announcement ? 'announcement' : 'chat-nav',
715
- text1: announcement
716
- ? announcement.heading
717
- : isPrivateMessage
687
+ leadingIconName: 'chat-nav',
688
+ text1: isPrivateMessage
718
689
  ? privateMessageLabel?.current()
719
690
  : //@ts-ignore
720
- announcement?.sender
721
- ? announcement.sender
722
- : defaultContentRef.current.defaultContent[uidAsNumber]?.name
691
+ defaultContentRef.current.defaultContent[uidAsNumber]?.name
723
692
  ? fromText(
724
693
  trimText(
725
694
  //@ts-ignore
726
695
  defaultContentRef.current.defaultContent[uidAsNumber]?.name,
727
696
  ),
728
697
  msgType,
729
- announcement,
730
698
  )
731
699
  : '',
732
700
  text2: isPrivateMessage
@@ -3,9 +3,7 @@ import {useContext} from 'react';
3
3
  import {ClientRoleType, PropsContext} from '../../../agora-rn-uikit/src';
4
4
  import {useRoomInfo} from '../room-info/useRoomInfo';
5
5
  import {joinRoomPreference} from '../../utils/useJoinRoom';
6
- import {isWeb, isWebInternal} from '../../utils/common';
7
- import {ENABLE_AUTH} from '../../auth/config';
8
- import {useBreakoutRoomInfo} from '../room-info/useSetBreakoutRoomInfo';
6
+ import {isWeb} from '../../utils/common';
9
7
 
10
8
  /**
11
9
  * ControlPermissionKey represents the different keys
@@ -17,12 +15,7 @@ export type ControlPermissionKey =
17
15
  | 'participantControl'
18
16
  | 'screenshareControl'
19
17
  | 'settingsControl'
20
- | 'viewAllTextTracksControl'
21
- | 'breakoutRoomControl'
22
- | 'whiteboardControl'
23
- | 'recordingControl'
24
- | 'captionsControl'
25
- | 'transcriptsControl';
18
+ | 'viewAllTextTracks';
26
19
 
27
20
  /**
28
21
  * ControlPermissionRule defines the properties used to evaluate permission rules.
@@ -31,7 +24,6 @@ export type ControlPermissionRule = {
31
24
  isHost: boolean;
32
25
  role: ClientRoleType;
33
26
  preference: joinRoomPreference;
34
- isInBreakoutRoom: boolean;
35
27
  };
36
28
 
37
29
  export const controlPermissionMatrix: Record<
@@ -44,30 +36,12 @@ export const controlPermissionMatrix: Record<
44
36
  settingsControl: ({preference}) => !preference.disableSettings,
45
37
  screenshareControl: ({preference}) =>
46
38
  $config.SCREEN_SHARING && !preference.disableScreenShare,
47
-
48
- viewAllTextTracksControl: ({isHost, isInBreakoutRoom}) =>
39
+ viewAllTextTracks: ({isHost}) =>
49
40
  isHost &&
50
41
  $config.ENABLE_STT &&
51
42
  $config.ENABLE_MEETING_TRANSCRIPT &&
52
43
  $config.ENABLE_TEXT_TRACKS &&
53
- isWeb() &&
54
- !isInBreakoutRoom,
55
- whiteboardControl: ({isHost, isInBreakoutRoom}) =>
56
- isHost && $config.ENABLE_WHITEBOARD && isWebInternal() && !isInBreakoutRoom,
57
- recordingControl: ({isHost, isInBreakoutRoom}) =>
58
- isHost && $config.CLOUD_RECORDING && !isInBreakoutRoom,
59
- captionsControl: ({isInBreakoutRoom}) =>
60
- $config.ENABLE_STT && $config.ENABLE_CAPTION && !isInBreakoutRoom,
61
- transcriptsControl: ({isInBreakoutRoom}) =>
62
- $config.ENABLE_MEETING_TRANSCRIPT && !isInBreakoutRoom,
63
- breakoutRoomControl: () =>
64
- isWeb() &&
65
- $config.ENABLE_BREAKOUT_ROOM &&
66
- ENABLE_AUTH &&
67
- !$config.ENABLE_CONVERSATIONAL_AI &&
68
- !$config.EVENT_MODE &&
69
- !$config.RAISE_HAND &&
70
- !$config.ENABLE_WAITING_ROOM,
44
+ isWeb(),
71
45
  };
72
46
 
73
47
  export const useControlPermissionMatrix = (
@@ -75,14 +49,12 @@ export const useControlPermissionMatrix = (
75
49
  ): boolean => {
76
50
  const {data: roomData, roomPreference} = useRoomInfo();
77
51
  const {rtcProps} = useContext(PropsContext);
78
- const {breakoutRoomChannelData} = useBreakoutRoomInfo();
79
52
 
80
53
  // Build the permission rule context for the current user.
81
54
  const rule: ControlPermissionRule = {
82
55
  isHost: roomData?.isHost || false,
83
56
  role: rtcProps.role,
84
57
  preference: {...roomPreference},
85
- isInBreakoutRoom: breakoutRoomChannelData?.isBreakoutMode || false,
86
58
  };
87
59
  // Retrieve the permission function for the given key and evaluate it.
88
60
  const permissionFn = controlPermissionMatrix[key];
@@ -73,14 +73,12 @@ export default function AllHostParticipants(props: any) {
73
73
  isAudienceUser={false}
74
74
  name={getParticipantName(localUid)}
75
75
  user={defaultContent[localUid]}
76
- showControls={props?.hideControls ? false : true}
76
+ showControls={true}
77
77
  isHostUser={hostUids.indexOf(localUid) !== -1}
78
78
  key={localUid}
79
79
  isMobile={isMobile}
80
80
  handleClose={handleClose}
81
81
  updateActionSheet={updateActionSheet}
82
- showBreakoutRoomMenu={props?.showBreakoutRoomMenu}
83
- from={props?.from}
84
82
  />
85
83
  {renderScreenShare(defaultContent[localUid])}
86
84
  </>
@@ -106,18 +104,12 @@ export default function AllHostParticipants(props: any) {
106
104
  isAudienceUser={false}
107
105
  name={getParticipantName(uid)}
108
106
  user={defaultContent[uid]}
109
- showControls={
110
- defaultContent[uid]?.type === 'rtc' &&
111
- isHost &&
112
- (props?.hideControls ? false : true)
113
- }
107
+ showControls={defaultContent[uid]?.type === 'rtc' && isHost}
114
108
  isHostUser={hostUids.indexOf(uid) !== -1}
115
109
  key={uid}
116
110
  isMobile={isMobile}
117
111
  handleClose={handleClose}
118
112
  updateActionSheet={updateActionSheet}
119
- showBreakoutRoomMenu={props?.showBreakoutRoomMenu}
120
- from={props?.from}
121
113
  />
122
114
  {renderScreenShare(defaultContent[uid])}
123
115
  </>
@@ -66,12 +66,6 @@ interface ParticipantInterface {
66
66
  updateActionSheet: (screenName: 'chat' | 'participants' | 'settings') => {};
67
67
  uid?: UidType;
68
68
  screenUid?: UidType;
69
- showBreakoutRoomMenu?: boolean;
70
- from?:
71
- | 'breakout-room'
72
- | 'partcipant'
73
- | 'screenshare-participant'
74
- | 'video-tile';
75
69
  }
76
70
 
77
71
  const Participant = (props: ParticipantInterface) => {
@@ -112,7 +106,7 @@ const Participant = (props: ParticipantInterface) => {
112
106
  setActionMenuVisible={setActionMenuVisible}
113
107
  user={props.user}
114
108
  btnRef={moreIconRef}
115
- from={props?.from || 'partcipant'}
109
+ from={'partcipant'}
116
110
  spotlightUid={spotlightUid}
117
111
  setSpotlightUid={setSpotlightUid}
118
112
  />
@@ -77,21 +77,13 @@ import {
77
77
  DEFAULT_ACTION_KEYS,
78
78
  UserActionMenuItemsConfig,
79
79
  } from '../../atoms/UserActionMenuPreset';
80
- import {
81
- MemberDropdownOption,
82
- useBreakoutRoom,
83
- } from '../breakout-room/context/BreakoutRoomContext';
84
80
 
85
81
  interface UserActionMenuOptionsOptionsProps {
86
82
  user: ContentInterface;
87
83
  actionMenuVisible: boolean;
88
84
  setActionMenuVisible: (actionMenuVisible: boolean) => void;
89
85
  btnRef: any;
90
- from:
91
- | 'partcipant'
92
- | 'screenshare-participant'
93
- | 'video-tile'
94
- | 'breakout-room';
86
+ from: 'partcipant' | 'screenshare-participant' | 'video-tile';
95
87
  spotlightUid?: UidType;
96
88
  setSpotlightUid?: (uid: UidType) => void;
97
89
  items?: UserActionMenuItemsConfig;
@@ -110,8 +102,7 @@ export default function UserActionMenuOptionsOptions(
110
102
  useState(false);
111
103
  const [actionMenuitems, setActionMenuitems] = useState<ActionMenuItem[]>([]);
112
104
  const {setSidePanel} = useSidePanel();
113
- const {user, actionMenuVisible, setActionMenuVisible, spotlightUid, from} =
114
- props;
105
+ const {user, actionMenuVisible, setActionMenuVisible, spotlightUid} = props;
115
106
  const {currentLayout} = useLayout();
116
107
  const {pinnedUid, activeUids, customContent, secondaryPinnedUid} =
117
108
  useContent();
@@ -738,7 +729,6 @@ export default function UserActionMenuOptionsOptions(
738
729
  secondaryPinnedUid,
739
730
  currentLayout,
740
731
  spotlightUid,
741
- from,
742
732
  ]);
743
733
 
744
734
  const {width: globalWidth, height: globalHeight} = useWindowDimensions();
@@ -33,7 +33,7 @@ export interface PreCallJoinCallBtnProps {
33
33
 
34
34
  const JoinCallBtn = (props: PreCallJoinCallBtnProps) => {
35
35
  const {rtcProps} = useContext(PropsContext);
36
- const {setCallActive} = usePreCall();
36
+ const {setCallActive, setIsNameIsEmpty} = usePreCall();
37
37
  const username = useGetName();
38
38
  const {isJoinDataFetched} = useRoomInfo();
39
39
  const joinRoomButton =
@@ -58,12 +58,17 @@ const JoinCallBtn = (props: PreCallJoinCallBtnProps) => {
58
58
  }, [rtcProps?.role]);
59
59
 
60
60
  const onSubmit = () => {
61
+ if (!username || (username && username?.trim() === '')) {
62
+ setIsNameIsEmpty(true);
63
+ return;
64
+ }
65
+ setIsNameIsEmpty(false);
61
66
  setCallActive(true);
62
67
  };
63
68
 
64
69
  const title = buttonText;
65
70
  const onPress = () => onSubmit();
66
- const disabled = !isJoinDataFetched || username === '';
71
+ const disabled = !isJoinDataFetched;
67
72
  return props?.render ? (
68
73
  props.render(onPress, title, disabled)
69
74
  ) : (
@@ -42,7 +42,7 @@ export interface PreCallJoinCallBtnProps {
42
42
 
43
43
  const JoinCallBtn = (props: PreCallJoinCallBtnProps) => {
44
44
  const {rtcProps} = useContext(PropsContext);
45
- const {setCallActive} = usePreCall();
45
+ const {setCallActive, setIsNameIsEmpty} = usePreCall();
46
46
  const username = useGetName();
47
47
  const setUsername = useSetName();
48
48
  const {isJoinDataFetched} = useRoomInfo();
@@ -59,6 +59,11 @@ const JoinCallBtn = (props: PreCallJoinCallBtnProps) => {
59
59
  );
60
60
 
61
61
  const onSubmit = () => {
62
+ if (!username || (username && username?.trim() === '')) {
63
+ setIsNameIsEmpty(true);
64
+ return;
65
+ }
66
+ setIsNameIsEmpty(false);
62
67
  logger.log(
63
68
  LogSource.Internals,
64
69
  'PRECALL_SCREEN',
@@ -95,7 +100,7 @@ const JoinCallBtn = (props: PreCallJoinCallBtnProps) => {
95
100
 
96
101
  const title = buttonText;
97
102
  const onPress = () => onSubmit();
98
- const disabled = !isJoinDataFetched || username?.trim() === '';
103
+ const disabled = !isJoinDataFetched;
99
104
  return props?.render ? (
100
105
  props.render(onPress, title, disabled)
101
106
  ) : (
@@ -39,7 +39,6 @@ import {
39
39
  waitingRoomHostNotJoined,
40
40
  waitingRoomUsersInCall,
41
41
  } from '../../language/default-labels/videoCallScreenLabels';
42
- import ChatContext from '../ChatContext';
43
42
 
44
43
  export interface PreCallJoinWaitingRoomBtnProps {
45
44
  render?: (
@@ -59,8 +58,7 @@ const JoinWaitingRoomBtn = (props: PreCallJoinWaitingRoomBtnProps) => {
59
58
  const waitingRoomUsersInCallText = useString(waitingRoomUsersInCall);
60
59
  let pollingTimeout = React.useRef(null);
61
60
  const {rtcProps} = useContext(PropsContext);
62
- const {syncUserState} = useContext(ChatContext);
63
- const {setCallActive, callActive} = usePreCall();
61
+ const {setCallActive, callActive, setIsNameIsEmpty} = usePreCall();
64
62
  const username = useGetName();
65
63
  const {isJoinDataFetched, isInWaitingRoom} = useRoomInfo();
66
64
  const {setRoomInfo} = useSetRoomInfo();
@@ -141,11 +139,10 @@ const JoinWaitingRoomBtn = (props: PreCallJoinWaitingRoomBtnProps) => {
141
139
  if (callActive) return;
142
140
  // on approve/reject response from host, waiting room permission is reset
143
141
  // update waitinng room status on uid
144
- // dispatch({
145
- // type: 'UpdateRenderList',
146
- // value: [localUid, {isInWaitingRoom: false}],
147
- // });
148
- syncUserState(localUid, {isInWaitingRoom: false});
142
+ dispatch({
143
+ type: 'UpdateRenderList',
144
+ value: [localUid, {isInWaitingRoom: false}],
145
+ });
149
146
 
150
147
  if (approved) {
151
148
  setRoomInfo(prev => {
@@ -215,6 +212,11 @@ const JoinWaitingRoomBtn = (props: PreCallJoinWaitingRoomBtnProps) => {
215
212
  };
216
213
 
217
214
  const onSubmit = () => {
215
+ if (!username || (username && username?.trim() === '')) {
216
+ setIsNameIsEmpty(true);
217
+ return;
218
+ }
219
+ setIsNameIsEmpty(false);
218
220
  shouldWaitingRoomPoll = true;
219
221
  // Enter waiting rooom;
220
222
  setRoomInfo(prev => {
@@ -222,11 +224,10 @@ const JoinWaitingRoomBtn = (props: PreCallJoinWaitingRoomBtnProps) => {
222
224
  });
223
225
 
224
226
  // add the waitingRoomStatus to the uid
225
- // dispatch({
226
- // type: 'UpdateRenderList',
227
- // value: [localUid, {isInWaitingRoom: true}],
228
- // });
229
- syncUserState(localUid, {isInWaitingRoom: true});
227
+ dispatch({
228
+ type: 'UpdateRenderList',
229
+ value: [localUid, {isInWaitingRoom: true}],
230
+ });
230
231
 
231
232
  // join request API to server, server will send RTM message to all hosts regarding request from this user,
232
233
  requestServerToJoinRoom();
@@ -236,8 +237,8 @@ const JoinWaitingRoomBtn = (props: PreCallJoinWaitingRoomBtnProps) => {
236
237
  const title = buttonText;
237
238
  const onPress = () => onSubmit();
238
239
  const disabled = $config.ENABLE_WAITING_ROOM_AUTO_REQUEST
239
- ? !hasHostJoined || isInWaitingRoom || username?.trim() === ''
240
- : isInWaitingRoom || username?.trim() === '';
240
+ ? !hasHostJoined || isInWaitingRoom
241
+ : isInWaitingRoom;
241
242
  return props?.render ? (
242
243
  props.render(onPress, title, disabled)
243
244
  ) : (
@@ -45,7 +45,8 @@ import {
45
45
  waitingRoomHostNotJoined,
46
46
  waitingRoomUsersInCall,
47
47
  } from '../../language/default-labels/videoCallScreenLabels';
48
- import ChatContext from '../ChatContext';
48
+ import SDKEvents from '../../utils/SdkEvents';
49
+ import isSDK from '../../utils/isSDK';
49
50
 
50
51
  const audio = new Audio(
51
52
  'https://dl.dropboxusercontent.com/s/1cdwpm3gca9mlo0/kick.mp3',
@@ -70,7 +71,7 @@ const JoinWaitingRoomBtn = (props: PreCallJoinWaitingRoomBtnProps) => {
70
71
  const waitingRoomUsersInCallText = useString(waitingRoomUsersInCall);
71
72
  let pollingTimeout = React.useRef(null);
72
73
  const {rtcProps} = useContext(PropsContext);
73
- const {setCallActive, callActive} = usePreCall();
74
+ const {setCallActive, callActive, setIsNameIsEmpty} = usePreCall();
74
75
  const username = useGetName();
75
76
  const setUsername = useSetName();
76
77
  const {isJoinDataFetched, isInWaitingRoom} = useRoomInfo();
@@ -85,7 +86,7 @@ const JoinWaitingRoomBtn = (props: PreCallJoinWaitingRoomBtnProps) => {
85
86
 
86
87
  const localUid = useLocalUid();
87
88
  const {dispatch} = useContext(DispatchContext);
88
- const {syncUserState} = useContext(ChatContext);
89
+
89
90
  const [buttonText, setButtonText] = React.useState(
90
91
  waitingRoomButton({
91
92
  ready: isInWaitingRoom,
@@ -145,13 +146,16 @@ const JoinWaitingRoomBtn = (props: PreCallJoinWaitingRoomBtnProps) => {
145
146
  if (callActive) return;
146
147
  // on approve/reject response from host, waiting room permission is reset
147
148
  // update waitinng room status on uid
148
- // dispatch({
149
- // type: 'UpdateRenderList',
150
- // value: [localUid, {isInWaitingRoom: false}],
151
- // });
152
- syncUserState(localUid, {isInWaitingRoom: false});
149
+ dispatch({
150
+ type: 'UpdateRenderList',
151
+ value: [localUid, {isInWaitingRoom: false}],
152
+ });
153
153
 
154
154
  if (approved) {
155
+ if (isSDK()) {
156
+ //emit SDKEvent waiting-room-approval-granted
157
+ SDKEvents.emit('waiting-room-approval-granted');
158
+ }
155
159
  setRoomInfo(prev => {
156
160
  return {
157
161
  ...prev,
@@ -191,6 +195,10 @@ const JoinWaitingRoomBtn = (props: PreCallJoinWaitingRoomBtnProps) => {
191
195
  };
192
196
  });
193
197
  } else {
198
+ if (isSDK()) {
199
+ //emit SDKEvent waiting-room-approval-rejected
200
+ SDKEvents.emit('waiting-room-approval-rejected');
201
+ }
194
202
  setRoomInfo(prev => {
195
203
  return {
196
204
  ...prev,
@@ -238,17 +246,20 @@ const JoinWaitingRoomBtn = (props: PreCallJoinWaitingRoomBtnProps) => {
238
246
  };
239
247
 
240
248
  const onSubmit = () => {
249
+ if (!username || (username && username?.trim() === '')) {
250
+ setIsNameIsEmpty(true);
251
+ return;
252
+ }
253
+ setIsNameIsEmpty(false);
241
254
  shouldWaitingRoomPoll = true;
242
255
  setUsername(username.trim());
243
256
  //setCallActive(true);
244
257
 
245
258
  // add the waitingRoomStatus to the uid
246
- // dispatch({
247
- // type: 'UpdateRenderList',
248
- // value: [localUid, {isInWaitingRoom: true}],
249
- // });
250
- syncUserState(localUid, {isInWaitingRoom: true});
251
-
259
+ dispatch({
260
+ type: 'UpdateRenderList',
261
+ value: [localUid, {isInWaitingRoom: true}],
262
+ });
252
263
  // Enter waiting rooom;
253
264
  setRoomInfo(prev => {
254
265
  return {...prev, isInWaitingRoom: true};
@@ -256,7 +267,10 @@ const JoinWaitingRoomBtn = (props: PreCallJoinWaitingRoomBtnProps) => {
256
267
 
257
268
  // join request API to server, server will send RTM message to all hosts regarding request from this user,
258
269
  requestServerToJoinRoom();
259
-
270
+ if (isSDK()) {
271
+ //emit SDKEvent waiting for approval
272
+ SDKEvents.emit('waiting-room-approval-requested');
273
+ }
260
274
  // Play a sound to avoid autoblocking in safari
261
275
  if (isWebInternal() || isMobileOrTablet()) {
262
276
  audio.volume = 0;
@@ -285,8 +299,8 @@ const JoinWaitingRoomBtn = (props: PreCallJoinWaitingRoomBtnProps) => {
285
299
  const title = buttonText;
286
300
  const onPress = () => onSubmit();
287
301
  const disabled = $config.ENABLE_WAITING_ROOM_AUTO_REQUEST
288
- ? !hasHostJoined || isInWaitingRoom || username?.trim() === ''
289
- : isInWaitingRoom || username?.trim() === '';
302
+ ? !hasHostJoined || isInWaitingRoom
303
+ : isInWaitingRoom;
290
304
  return props?.render ? (
291
305
  props.render(onPress, title, disabled)
292
306
  ) : (