agora-appbuilder-core 1.0.8 → 1.0.9

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 (51) hide show
  1. package/package.json +1 -1
  2. package/template/agora-rn-uikit/.git/HEAD +1 -0
  3. package/template/agora-rn-uikit/.git/config +16 -0
  4. package/template/agora-rn-uikit/.git/description +1 -0
  5. package/template/agora-rn-uikit/.git/hooks/applypatch-msg.sample +15 -0
  6. package/template/agora-rn-uikit/.git/hooks/commit-msg.sample +24 -0
  7. package/template/agora-rn-uikit/.git/hooks/fsmonitor-watchman.sample +173 -0
  8. package/template/agora-rn-uikit/.git/hooks/post-update.sample +8 -0
  9. package/template/agora-rn-uikit/.git/hooks/pre-applypatch.sample +14 -0
  10. package/template/agora-rn-uikit/.git/hooks/pre-commit.sample +49 -0
  11. package/template/agora-rn-uikit/.git/hooks/pre-merge-commit.sample +13 -0
  12. package/template/agora-rn-uikit/.git/hooks/pre-push.sample +53 -0
  13. package/template/agora-rn-uikit/.git/hooks/pre-rebase.sample +169 -0
  14. package/template/agora-rn-uikit/.git/hooks/pre-receive.sample +24 -0
  15. package/template/agora-rn-uikit/.git/hooks/prepare-commit-msg.sample +42 -0
  16. package/template/agora-rn-uikit/.git/hooks/push-to-checkout.sample +78 -0
  17. package/template/agora-rn-uikit/.git/hooks/update.sample +128 -0
  18. package/template/agora-rn-uikit/.git/index +0 -0
  19. package/template/agora-rn-uikit/.git/info/exclude +6 -0
  20. package/template/agora-rn-uikit/.git/logs/HEAD +2 -0
  21. package/template/agora-rn-uikit/.git/logs/refs/heads/ab-dev-auto +1 -0
  22. package/template/agora-rn-uikit/.git/logs/refs/heads/master +1 -0
  23. package/template/agora-rn-uikit/.git/logs/refs/remotes/origin/HEAD +1 -0
  24. package/template/agora-rn-uikit/.git/objects/pack/pack-eb3b4c374d6e79553b5bbcc78b4399cc766e97cf.idx +0 -0
  25. package/template/agora-rn-uikit/.git/objects/pack/pack-eb3b4c374d6e79553b5bbcc78b4399cc766e97cf.pack +0 -0
  26. package/template/agora-rn-uikit/.git/packed-refs +12 -0
  27. package/template/agora-rn-uikit/.git/refs/heads/ab-dev-auto +1 -0
  28. package/template/agora-rn-uikit/.git/refs/heads/master +1 -0
  29. package/template/agora-rn-uikit/.git/refs/remotes/origin/HEAD +1 -0
  30. package/template/agora-rn-uikit/.gitignore +63 -0
  31. package/template/agora-rn-uikit/package-lock.json +7612 -0
  32. package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +20 -30
  33. package/template/agora-rn-uikit/src/Controls/Local/EndCall.tsx +0 -1
  34. package/template/agora-rn-uikit/src/Controls/Local/LocalAudioMute.tsx +0 -1
  35. package/template/agora-rn-uikit/src/Controls/Local/LocalVideoMute.tsx +0 -1
  36. package/template/agora-rn-uikit/src/Controls/Local/SwitchCamera.tsx +0 -1
  37. package/template/agora-rn-uikit/src/RTCConfigure.tsx +49 -4
  38. package/template/package.json +3 -2
  39. package/template/react-native-toast-message/.gitignore +5 -0
  40. package/template/react-native-toast-message/.npmignore +5 -0
  41. package/template/react-native-toast-message/package-lock.json +10553 -0
  42. package/template/src/.DS_Store +0 -0
  43. package/template/src/components/Precall.native.tsx +22 -14
  44. package/template/src/components/Precall.tsx +19 -18
  45. package/template/src/components/StorageContext.tsx +2 -0
  46. package/template/src/pages/Create.tsx +17 -14
  47. package/template/src/pages/Join.tsx +11 -29
  48. package/template/src/pages/VideoCall.tsx +68 -49
  49. package/template/src/subComponents/.DS_Store +0 -0
  50. package/template/src/subComponents/LogoutButton.tsx +1 -1
  51. package/template/webpack.commons.js +1 -0
@@ -5,8 +5,6 @@ import {
5
5
  StyleProp,
6
6
  TouchableOpacityProps,
7
7
  ViewStyle,
8
- Text,
9
- View,
10
8
  } from 'react-native';
11
9
  import PropsContext from './../PropsContext';
12
10
  import styles from '../Style';
@@ -17,7 +15,6 @@ interface BtnTemplateInterface {
17
15
  color?: string;
18
16
  onPress?: TouchableOpacityProps['onPress'];
19
17
  style?: StyleProp<ViewStyle>;
20
- btnText?: string;
21
18
  }
22
19
 
23
20
  const BtnTemplate: React.FC<BtnTemplateInterface> = (props) => {
@@ -25,37 +22,30 @@ const BtnTemplate: React.FC<BtnTemplateInterface> = (props) => {
25
22
  const {BtnTemplateStyles, theme} = styleProps || {};
26
23
 
27
24
  return (
28
- <TouchableOpacity onPress={props.onPress}>
29
- <View
25
+ <TouchableOpacity
26
+ style={{
27
+ ...styles.controlBtn,
28
+ ...(BtnTemplateStyles as object),
29
+ ...(props.style as object),
30
+ }}
31
+ // onPress={props.onPress}
32
+ onPress={() => {
33
+ console.log('pressed mute')
34
+ props.onPress()
35
+ }}
36
+ >
37
+ <Image
30
38
  style={{
31
- ...styles.controlBtn,
32
- ...(BtnTemplateStyles as object),
33
- ...(props.style as object),
34
- }}>
35
- <Image
36
- style={{
37
- width: '100%',
38
- height: '100%',
39
- tintColor:
40
- props.name !== 'callEnd'
41
- ? theme || props.color || '#fff'
42
- : '#FD0845',
43
- }}
44
- resizeMode={'contain'}
45
- source={{uri: icons[props.name]}}
46
- />
47
- </View>
48
- <Text
49
- style={{
50
- textAlign: 'center',
51
- marginTop: 5,
52
- color:
39
+ width: '100%',
40
+ height: '100%',
41
+ tintColor:
53
42
  props.name !== 'callEnd'
54
43
  ? theme || props.color || '#fff'
55
44
  : '#FD0845',
56
- }}>
57
- {props.btnText}
58
- </Text>
45
+ }}
46
+ resizeMode={'contain'}
47
+ source={{uri: icons[props.name]}}
48
+ />
59
49
  </TouchableOpacity>
60
50
  );
61
51
  };
@@ -13,7 +13,6 @@ function EndCall() {
13
13
  return (
14
14
  <BtnTemplate
15
15
  name={'callEnd'}
16
- btnText={'Hang Up'}
17
16
  style={{...styles.endCall, ...(endCall as object)}}
18
17
  onPress={() =>
19
18
  (dispatch as DispatchType<'EndCall'>)({
@@ -15,7 +15,6 @@ function LocalAudioMute() {
15
15
  return (
16
16
  <BtnTemplate
17
17
  name={local.audio ? 'mic' : 'micOff'}
18
- btnText={'Audio'}
19
18
  style={{...styles.localBtn, ...(muteLocalAudio as object)}}
20
19
  onPress={() => {
21
20
  (dispatch as DispatchType<'LocalMuteAudio'>)({
@@ -15,7 +15,6 @@ function LocalVideoMute() {
15
15
  return (
16
16
  <BtnTemplate
17
17
  name={local.video ? 'videocam' : 'videocamOff'}
18
- btnText={'Video'}
19
18
  style={{...styles.localBtn, ...(muteLocalVideo as object)}}
20
19
  onPress={() => {
21
20
  (dispatch as DispatchType<'LocalMuteVideo'>)({
@@ -13,7 +13,6 @@ function SwitchCamera() {
13
13
  <BtnTemplate
14
14
  name={'switchCamera'}
15
15
  style={{...styles.localBtn, ...(switchCamera as object)}}
16
- btnText={'Switch'}
17
16
  onPress={() => {
18
17
  // RtcEngine.switchCamera();
19
18
  (dispatch as DispatchType<'SwitchCamera'>)({
@@ -201,6 +201,7 @@ const RtcConfigure: React.FC<Partial<RtcPropsInterface>> = (props) => {
201
201
  };
202
202
  break;
203
203
  case 'LocalMuteVideo':
204
+ console.log('Switch: Local mute video', {value: action.value}, {state});
204
205
  (engine.current as RtcEngine).muteLocalVideoStream(
205
206
  (action as ActionType<'LocalMuteAudio'>).value[0],
206
207
  );
@@ -307,6 +308,49 @@ const RtcConfigure: React.FC<Partial<RtcPropsInterface>> = (props) => {
307
308
  },
308
309
  [dualStreamMode],
309
310
  );
311
+
312
+ const getRemoteVolume = () => {
313
+ console.log('getting remote user track');
314
+ // console.log(engine.current.client.remoteUsers);
315
+ const client = engine?.current?.client;
316
+ if (client) {
317
+ const {remoteUsers} = client;
318
+
319
+ const userVolume = remoteUsers.map(
320
+ (remoteUser: {uid: any; audioTrack: any; hasAudio: boolean}) => {
321
+ const {uid, audioTrack, hasAudio} = remoteUser;
322
+ console.log({remoteUser}, {hasAudio});
323
+ return {
324
+ uid,
325
+ volumeLevel: hasAudio ? audioTrack.getVolumeLevel() : 0,
326
+ };
327
+ },
328
+ );
329
+ console.log({userVolume});
330
+ const highestvolumeObj = volumes.reduce(
331
+ (highestVolume, volume, index) => {
332
+ if (highestVolume === null) {
333
+ return volume;
334
+ } else {
335
+ if (volume.level > highestVolume.level) {
336
+ return volume;
337
+ }
338
+ return highestVolume;
339
+ }
340
+ // console.log(`${index} UID ${volume.uid} Level ${volume.level}`);
341
+ },
342
+ null,
343
+ );
344
+ const activeSpeaker = highestvolumeObj ? highestvolumeObj.uid : undefined;
345
+ }
346
+ };
347
+ // useEffect(() => {
348
+ // const timer = setInterval(getRemoteVolume, 1000);
349
+ // return () => {
350
+ // clearInterval(timer);
351
+ // };
352
+ // }, []);
353
+
310
354
  const [uidState, dispatch] = useReducer(reducer, initialState);
311
355
 
312
356
  // When mode is updated, reducer is triggered to update the individual states
@@ -460,20 +504,21 @@ const RtcConfigure: React.FC<Partial<RtcPropsInterface>> = (props) => {
460
504
  });
461
505
  }
462
506
  if (engine.current) {
463
- if(uidState.max[0].video){
507
+ if (uidState.max[0].video) {
508
+ console.log('another place 1');
464
509
  await engine.current.muteLocalVideoStream(true);
465
510
  }
466
-
511
+
467
512
  await engine.current.joinChannel(
468
513
  rtcProps.token || null,
469
514
  rtcProps.channel,
470
515
  null,
471
516
  rtcProps.uid || 0,
472
517
  );
473
- if(uidState.max[0].video){
518
+ if (uidState.max[0].video) {
519
+ console.log('another place 2');
474
520
  await engine.current.muteLocalVideoStream(false);
475
521
  }
476
-
477
522
  } else {
478
523
  console.error('trying to join before RTC Engine was initialized');
479
524
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "HelloWorld",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "private": true,
5
5
  "main": ".electron/index.js",
6
6
  "scripts": {
@@ -71,6 +71,7 @@
71
71
  "devDependencies": {
72
72
  "@babel/core": "7.14.3",
73
73
  "@babel/plugin-proposal-class-properties": "7.14.5",
74
+ "@babel/plugin-proposal-optional-chaining": "^7.16.0",
74
75
  "@babel/preset-env": "7.14.4",
75
76
  "@babel/preset-react": "7.13.13",
76
77
  "@babel/preset-typescript": "7.13.0",
@@ -92,7 +93,7 @@
92
93
  "babel-plugin-transform-define": "2.0.0",
93
94
  "cross-env": "7.0.3",
94
95
  "del": "5.1.0",
95
- "electron": "5.0.8",
96
+ "electron": "16.0.1",
96
97
  "electron-builder": "22.10.5",
97
98
  "electron-notarize": "1.0.0",
98
99
  "eslint": "6.8.0",
@@ -0,0 +1,5 @@
1
+ .DS_Store
2
+ .git
3
+ node_modules
4
+ .idea
5
+ coverage
@@ -0,0 +1,5 @@
1
+ __tests__
2
+ coverage
3
+ .eslintrc.js
4
+ .prettierrc.js
5
+ success-toast.gif