agora-appbuilder-core 4.1.8-2 → 4.1.8-4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agora-appbuilder-core",
3
- "version": "4.1.8-2",
3
+ "version": "4.1.8-4",
4
4
  "description": "React Native template for RTE app builder",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -77,8 +77,8 @@ const DefaultConfig = {
77
77
  CHAT_ORG_NAME: '',
78
78
  CHAT_APP_NAME: '',
79
79
  CHAT_URL: '',
80
- CLI_VERSION: '3.1.8-2',
81
- CORE_VERSION: '4.1.8-2',
80
+ CLI_VERSION: '3.1.8-4',
81
+ CORE_VERSION: '4.1.8-4',
82
82
  DISABLE_LANDSCAPE_MODE: false,
83
83
  STT_AUTO_START: false,
84
84
  CLOUD_RECORDING_AUTO_START: false,
@@ -60,7 +60,7 @@ const styles = StyleSheet.create({
60
60
  // height: 60, //causes text cut off in android
61
61
  width: '100%',
62
62
  borderWidth: 1,
63
- paddingVertical: 21,
63
+ paddingVertical: 12,
64
64
  paddingHorizontal: 16,
65
65
  borderColor: $config.INPUT_FIELD_BORDER_COLOR,
66
66
  color: $config.FONT_COLOR,
@@ -71,6 +71,7 @@ const styles = StyleSheet.create({
71
71
  ...Platform.select({
72
72
  web: {
73
73
  outlineStyle: 'none',
74
+ lineHeight: '26px',
74
75
  },
75
76
  }),
76
77
  },
@@ -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
  ) : (
@@ -58,7 +58,7 @@ const JoinWaitingRoomBtn = (props: PreCallJoinWaitingRoomBtnProps) => {
58
58
  const waitingRoomUsersInCallText = useString(waitingRoomUsersInCall);
59
59
  let pollingTimeout = React.useRef(null);
60
60
  const {rtcProps} = useContext(PropsContext);
61
- const {setCallActive, callActive} = usePreCall();
61
+ const {setCallActive, callActive, setIsNameIsEmpty} = usePreCall();
62
62
  const username = useGetName();
63
63
  const {isJoinDataFetched, isInWaitingRoom} = useRoomInfo();
64
64
  const {setRoomInfo} = useSetRoomInfo();
@@ -212,6 +212,11 @@ const JoinWaitingRoomBtn = (props: PreCallJoinWaitingRoomBtnProps) => {
212
212
  };
213
213
 
214
214
  const onSubmit = () => {
215
+ if (!username || (username && username?.trim() === '')) {
216
+ setIsNameIsEmpty(true);
217
+ return;
218
+ }
219
+ setIsNameIsEmpty(false);
215
220
  shouldWaitingRoomPoll = true;
216
221
  // Enter waiting rooom;
217
222
  setRoomInfo(prev => {
@@ -232,8 +237,8 @@ const JoinWaitingRoomBtn = (props: PreCallJoinWaitingRoomBtnProps) => {
232
237
  const title = buttonText;
233
238
  const onPress = () => onSubmit();
234
239
  const disabled = $config.ENABLE_WAITING_ROOM_AUTO_REQUEST
235
- ? !hasHostJoined || isInWaitingRoom || username?.trim() === ''
236
- : isInWaitingRoom || username?.trim() === '';
240
+ ? !hasHostJoined || isInWaitingRoom
241
+ : isInWaitingRoom;
237
242
  return props?.render ? (
238
243
  props.render(onPress, title, disabled)
239
244
  ) : (
@@ -45,6 +45,8 @@ import {
45
45
  waitingRoomHostNotJoined,
46
46
  waitingRoomUsersInCall,
47
47
  } from '../../language/default-labels/videoCallScreenLabels';
48
+ import SDKEvents from '../../utils/SdkEvents';
49
+ import isSDK from '../../utils/isSDK';
48
50
 
49
51
  const audio = new Audio(
50
52
  'https://dl.dropboxusercontent.com/s/1cdwpm3gca9mlo0/kick.mp3',
@@ -69,7 +71,7 @@ const JoinWaitingRoomBtn = (props: PreCallJoinWaitingRoomBtnProps) => {
69
71
  const waitingRoomUsersInCallText = useString(waitingRoomUsersInCall);
70
72
  let pollingTimeout = React.useRef(null);
71
73
  const {rtcProps} = useContext(PropsContext);
72
- const {setCallActive, callActive} = usePreCall();
74
+ const {setCallActive, callActive, setIsNameIsEmpty} = usePreCall();
73
75
  const username = useGetName();
74
76
  const setUsername = useSetName();
75
77
  const {isJoinDataFetched, isInWaitingRoom} = useRoomInfo();
@@ -150,6 +152,10 @@ const JoinWaitingRoomBtn = (props: PreCallJoinWaitingRoomBtnProps) => {
150
152
  });
151
153
 
152
154
  if (approved) {
155
+ if (isSDK()) {
156
+ //emit SDKEvent waiting-room-approval-granted
157
+ SDKEvents.emit('waiting-room-approval-granted');
158
+ }
153
159
  setRoomInfo(prev => {
154
160
  return {
155
161
  ...prev,
@@ -189,6 +195,10 @@ const JoinWaitingRoomBtn = (props: PreCallJoinWaitingRoomBtnProps) => {
189
195
  };
190
196
  });
191
197
  } else {
198
+ if (isSDK()) {
199
+ //emit SDKEvent waiting-room-approval-rejected
200
+ SDKEvents.emit('waiting-room-approval-rejected');
201
+ }
192
202
  setRoomInfo(prev => {
193
203
  return {
194
204
  ...prev,
@@ -236,6 +246,11 @@ const JoinWaitingRoomBtn = (props: PreCallJoinWaitingRoomBtnProps) => {
236
246
  };
237
247
 
238
248
  const onSubmit = () => {
249
+ if (!username || (username && username?.trim() === '')) {
250
+ setIsNameIsEmpty(true);
251
+ return;
252
+ }
253
+ setIsNameIsEmpty(false);
239
254
  shouldWaitingRoomPoll = true;
240
255
  setUsername(username.trim());
241
256
  //setCallActive(true);
@@ -252,7 +267,10 @@ const JoinWaitingRoomBtn = (props: PreCallJoinWaitingRoomBtnProps) => {
252
267
 
253
268
  // join request API to server, server will send RTM message to all hosts regarding request from this user,
254
269
  requestServerToJoinRoom();
255
-
270
+ if (isSDK()) {
271
+ //emit SDKEvent waiting for approval
272
+ SDKEvents.emit('waiting-room-approval-requested');
273
+ }
256
274
  // Play a sound to avoid autoblocking in safari
257
275
  if (isWebInternal() || isMobileOrTablet()) {
258
276
  audio.volume = 0;
@@ -281,8 +299,8 @@ const JoinWaitingRoomBtn = (props: PreCallJoinWaitingRoomBtnProps) => {
281
299
  const title = buttonText;
282
300
  const onPress = () => onSubmit();
283
301
  const disabled = $config.ENABLE_WAITING_ROOM_AUTO_REQUEST
284
- ? !hasHostJoined || isInWaitingRoom || username?.trim() === ''
285
- : isInWaitingRoom || username?.trim() === '';
302
+ ? !hasHostJoined || isInWaitingRoom
303
+ : isInWaitingRoom;
286
304
  return props?.render ? (
287
305
  props.render(onPress, title, disabled)
288
306
  ) : (
@@ -11,7 +11,7 @@
11
11
  */
12
12
 
13
13
  import React from 'react';
14
- import {TextStyle} from 'react-native';
14
+ import {TextStyle, Text} from 'react-native';
15
15
  import TextInput from '../../atoms/TextInput';
16
16
  import {useString} from '../../utils/useString';
17
17
  import {useRoomInfo} from '../room-info/useRoomInfo';
@@ -25,6 +25,7 @@ import {
25
25
  precallNameInputPlaceholderText,
26
26
  precallYouAreJoiningAsHeading,
27
27
  } from '../../language/default-labels/precallScreenLabels';
28
+ import {usePreCall} from './usePreCall';
28
29
 
29
30
  export interface PreCallTextInputProps {
30
31
  labelStyle?: TextStyle;
@@ -39,30 +40,52 @@ const PreCallTextInput = (props?: PreCallTextInputProps) => {
39
40
  const username = useGetName();
40
41
  const setUsername = useSetName();
41
42
  const {isJoinDataFetched, isInWaitingRoom} = useRoomInfo();
43
+ const {isNameIsEmpty, setIsNameIsEmpty} = usePreCall();
42
44
  const {isDesktop = false, isOnPrecall = false} = props;
43
45
 
44
46
  return (
45
- <Input
46
- maxLength={maxInputLimit}
47
- label={isOnPrecall ? '' : isDesktop ? joiningAs : ''}
48
- labelStyle={
49
- props?.labelStyle
50
- ? props.labelStyle
51
- : {
52
- fontFamily: ThemeConfig.FontFamily.sansPro,
53
- fontWeight: '400',
54
- fontSize: ThemeConfig.FontSize.small,
55
- lineHeight: ThemeConfig.FontSize.small,
56
- color: $config.FONT_COLOR,
57
- }
58
- }
59
- value={username}
60
- autoFocus
61
- onChangeText={text => setUsername(text ? text : '')}
62
- onSubmitEditing={() => {}}
63
- placeholder={isJoinDataFetched ? placeHolder : fetchingNamePlaceholder}
64
- editable={!isInWaitingRoom && isJoinDataFetched}
65
- />
47
+ <>
48
+ <Input
49
+ maxLength={maxInputLimit}
50
+ label={isOnPrecall ? '' : isDesktop ? joiningAs : ''}
51
+ labelStyle={
52
+ props?.labelStyle
53
+ ? props.labelStyle
54
+ : {
55
+ fontFamily: ThemeConfig.FontFamily.sansPro,
56
+ fontWeight: '400',
57
+ fontSize: ThemeConfig.FontSize.small,
58
+ lineHeight: ThemeConfig.FontSize.small,
59
+ color: $config.FONT_COLOR,
60
+ }
61
+ }
62
+ value={username}
63
+ autoFocus
64
+ onChangeText={text => {
65
+ setUsername(text ? text : '');
66
+ if (text && text.trim() === '') {
67
+ setIsNameIsEmpty(true);
68
+ } else {
69
+ setIsNameIsEmpty(false);
70
+ }
71
+ }}
72
+ onSubmitEditing={() => {}}
73
+ placeholder={isJoinDataFetched ? placeHolder : fetchingNamePlaceholder}
74
+ editable={!isInWaitingRoom && isJoinDataFetched}
75
+ style={isNameIsEmpty ? {borderColor: $config.SEMANTIC_ERROR} : {}}
76
+ />
77
+ {isNameIsEmpty && (
78
+ <Text
79
+ style={{
80
+ color: $config.SEMANTIC_ERROR,
81
+ fontFamily: ThemeConfig.FontFamily.sansPro,
82
+ marginTop: 4,
83
+ marginLeft: 4,
84
+ }}>
85
+ {'Name is required'}
86
+ </Text>
87
+ )}
88
+ </>
66
89
  );
67
90
  };
68
91
 
@@ -29,6 +29,8 @@ export interface PreCallContextInterface {
29
29
  setSpeakerAvailable: React.Dispatch<React.SetStateAction<boolean>>;
30
30
  isPermissionRequested: boolean;
31
31
  setIsPermissionRequested: React.Dispatch<React.SetStateAction<boolean>>;
32
+ isNameIsEmpty: boolean;
33
+ setIsNameIsEmpty: React.Dispatch<React.SetStateAction<boolean>>;
32
34
  }
33
35
 
34
36
  const PreCallContext = createContext<PreCallContextInterface>({
@@ -42,6 +44,8 @@ const PreCallContext = createContext<PreCallContextInterface>({
42
44
  setSpeakerAvailable: () => {},
43
45
  isPermissionRequested: false,
44
46
  setIsPermissionRequested: () => {},
47
+ isNameIsEmpty: false,
48
+ setIsNameIsEmpty: () => {},
45
49
  });
46
50
 
47
51
  interface PreCallProviderProps {
@@ -54,6 +58,7 @@ const PreCallProvider = (props: PreCallProviderProps) => {
54
58
  const roomInfo = useRoomInfo();
55
59
  const {deviceList} = useContext(DeviceContext);
56
60
  const setUsername = useSetName();
61
+ const [isNameIsEmpty, setIsNameIsEmpty] = useState(false);
57
62
  const [isCameraAvailable, setCameraAvailable] = useState(false);
58
63
  const [isMicAvailable, setMicAvailable] = useState(false);
59
64
  const [isSpeakerAvailable, setSpeakerAvailable] = useState(false);
@@ -69,6 +74,8 @@ const PreCallProvider = (props: PreCallProviderProps) => {
69
74
  setSpeakerAvailable,
70
75
  isPermissionRequested,
71
76
  setIsPermissionRequested,
77
+ isNameIsEmpty,
78
+ setIsNameIsEmpty,
72
79
  };
73
80
 
74
81
  useEffect(() => {
@@ -121,7 +121,7 @@ const useSTTAPI = (): IuseSTTAPI => {
121
121
  const start = async (lang: LanguageType[]) => {
122
122
  try {
123
123
  setIsLangChangeInProgress(true);
124
- const res = await apiCall('start', lang);
124
+ const res = await apiCall('startv7', lang);
125
125
  // null means stt startred successfully
126
126
  const isSTTAlreadyActive =
127
127
  res?.error?.message
@@ -209,7 +209,7 @@ const useSTTAPI = (): IuseSTTAPI => {
209
209
 
210
210
  const stop = async () => {
211
211
  try {
212
- const res = await apiCall('stop');
212
+ const res = await apiCall('stopv7');
213
213
  // once STT is non-active in the channel , notify others so that they dont' trigger start again
214
214
  // events.send(
215
215
  // EventNames.STT_ACTIVE,
@@ -12,20 +12,38 @@ export function formatTime(timestamp: number): string {
12
12
  }
13
13
 
14
14
  export type LanguageType =
15
- | 'en-US'
16
- | 'hi-IN'
15
+ | 'ar-EG'
16
+ | 'ar-JO'
17
+ | 'ar-SA'
18
+ | 'ar-AE'
19
+ | 'bn-IN'
17
20
  | 'zh-CN'
18
21
  | 'zh-HK'
22
+ | 'zh-TW'
23
+ | 'nl-NL'
24
+ | 'en-IN'
25
+ | 'en-US'
26
+ | 'fil-PH'
19
27
  | 'fr-FR'
20
28
  | 'de-DE'
21
- | 'ko-KR'
22
- | 'en-IN'
23
- | 'ar'
29
+ | 'gu-IN'
30
+ | 'he-IL'
31
+ | 'hi-IN'
32
+ | 'id-ID'
33
+ | 'it-IT'
24
34
  | 'ja-JP'
35
+ | 'kn-IN'
36
+ | 'ko-KR'
37
+ | 'ms-MY'
38
+ | 'fa-IR'
25
39
  | 'pt-PT'
40
+ | 'ru-RU'
26
41
  | 'es-ES'
27
- | 'it-IT'
28
- | 'id-ID'
42
+ | 'ta-IN'
43
+ | 'te-IN'
44
+ | 'th-TH'
45
+ | 'tr-TR'
46
+ | 'vi-VN'
29
47
  | '';
30
48
 
31
49
  interface LanguageData {
@@ -34,20 +52,38 @@ interface LanguageData {
34
52
  }
35
53
 
36
54
  export const langData: LanguageData[] = [
55
+ {label: 'Arabic (EG)', value: 'ar-EG'},
56
+ {label: 'Arabic (JO)', value: 'ar-JO'},
57
+ {label: 'Arabic (SA)', value: 'ar-SA'},
58
+ {label: 'Arabic (UAE)', value: 'ar-AE'},
59
+ {label: 'Bengali (IN)', value: 'bn-IN'},
60
+ {label: 'Chinese', value: 'zh-CN'},
61
+ {label: 'Chinese (HK)', value: 'zh-HK'},
62
+ {label: 'Chinese (TW)', value: 'zh-TW'},
63
+ {label: 'Dutch', value: 'nl-NL'},
64
+ {label: 'English (IN)', value: 'en-IN'},
37
65
  {label: 'English (US)', value: 'en-US'},
38
- {label: 'English (India)', value: 'en-IN'},
39
- {label: 'Hindi', value: 'hi-IN'},
40
- {label: 'Chinese (Simplified)', value: 'zh-CN'},
41
- {label: 'Chinese (Traditional)', value: 'zh-HK'},
42
- {label: 'Arabic', value: 'ar'},
66
+ {label: 'Filipino', value: 'fil-PH'},
43
67
  {label: 'French', value: 'fr-FR'},
44
68
  {label: 'German', value: 'de-DE'},
69
+ {label: 'Gujarati', value: 'gu-IN'},
70
+ {label: 'Hebrew', value: 'he-IL'},
71
+ {label: 'Hindi', value: 'hi-IN'},
72
+ {label: 'Indonesian', value: 'id-ID'},
73
+ {label: 'Italian', value: 'it-IT'},
45
74
  {label: 'Japanese', value: 'ja-JP'},
75
+ {label: 'Kannada', value: 'kn-IN'},
46
76
  {label: 'Korean', value: 'ko-KR'},
77
+ {label: 'Malay', value: 'ms-MY'},
78
+ {label: 'Persian', value: 'fa-IR'},
47
79
  {label: 'Portuguese', value: 'pt-PT'},
80
+ {label: 'Russian', value: 'ru-RU'},
48
81
  {label: 'Spanish', value: 'es-ES'},
49
- {label: 'Italian', value: 'it-IT'},
50
- {label: 'Indonesian', value: 'id-ID'},
82
+ {label: 'Tamil', value: 'ta-IN'},
83
+ {label: 'Telugu', value: 'te-IN'},
84
+ {label: 'Thai', value: 'th-TH'},
85
+ {label: 'Turkish', value: 'tr-TR'},
86
+ {label: 'Vietnamese', value: 'vi-VN'},
51
87
  ];
52
88
 
53
89
  export function getLanguageLabel(
@@ -51,6 +51,9 @@ export interface userEventsMapInterface {
51
51
  'token-refreshed': () => void;
52
52
  'rtc-user-removed': (uid: UidType, channel: string) => void;
53
53
  unauthorized: (errorMessage) => void;
54
+ 'waiting-room-approval-requested': () => void;
55
+ 'waiting-room-approval-granted': () => void;
56
+ 'waiting-room-approval-rejected': () => void;
54
57
  }
55
58
 
56
59
  const SDKEvents = createNanoEvents<userEventsMapInterface>();