agora-appbuilder-core 4.1.6-beta.2 → 4.1.6-beta.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.6-beta.2",
3
+ "version": "4.1.6-beta.4",
4
4
  "description": "React Native template for RTE app builder",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -797,8 +797,11 @@ export default class RtcEngine {
797
797
  mediaType,
798
798
  );
799
799
  if (mediaType === 'audio') {
800
- const {audio, ...rest} = this.remoteStreams.get(user.uid);
801
- this.remoteStreams.set(user.uid, rest);
800
+ const data = this.remoteStreams.get(user.uid);
801
+ try {
802
+ delete data['audio'];
803
+ } catch (error) {}
804
+ this.remoteStreams.set(user.uid, {...data});
802
805
  (this.eventsMap.get('onRemoteAudioStateChanged') as callbackType)(
803
806
  {},
804
807
  user.uid,
@@ -807,8 +810,11 @@ export default class RtcEngine {
807
810
  0,
808
811
  );
809
812
  } else {
810
- const {video, ...rest} = this.remoteStreams.get(user.uid);
811
- this.remoteStreams.set(user.uid, rest);
813
+ const data = this.remoteStreams.get(user.uid);
814
+ try {
815
+ delete data['video'];
816
+ } catch (error) {}
817
+ this.remoteStreams.set(user.uid, {...data});
812
818
  (this.eventsMap.get('onRemoteVideoStateChanged') as callbackType)(
813
819
  {},
814
820
  user.uid,
@@ -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.6-beta.2',
81
- CORE_VERSION: '4.1.6-beta.2',
80
+ CLI_VERSION: '3.1.6-beta.4',
81
+ CORE_VERSION: '4.1.6-beta.4',
82
82
  DISABLE_LANDSCAPE_MODE: false,
83
83
  STT_AUTO_START: false,
84
84
  CLOUD_RECORDING_AUTO_START: false,
@@ -23,6 +23,17 @@ const AI_ANIMATION_VIDEO = {
23
23
  DISCONNECTING: DisconnectingMp4,
24
24
  };
25
25
 
26
+ const cssHideVideoControls = `
27
+ video {
28
+ -webkit-appearance: none; /* Remove default styling */
29
+ }
30
+ video::-webkit-media-controls {
31
+ display: none !important; /* Hide the controls */
32
+ }
33
+ video::-webkit-media-controls-enclosure {
34
+ display:none !important;
35
+ }`;
36
+
26
37
  export default function AiAgentCustomView({
27
38
  connectionState,
28
39
  }: CustomAgentInterfaceProps) {
@@ -99,20 +110,42 @@ export default function AiAgentCustomView({
99
110
  <Text style={styles.nativeText}>AI Agent...</Text>
100
111
  </View>
101
112
  ) : (
102
- <video
103
- autoPlay
104
- style={{pointerEvents: 'none'}}
105
- loop
106
- src={AI_ANIMATION_VIDEO[animation]}
107
- width="40%"
108
- height="40%"
109
- />
113
+ <div style={styles.videoContainer}>
114
+ <style type="text/css">{cssHideVideoControls}</style>
115
+ <video
116
+ disablePictureInPicture
117
+ playsInline
118
+ id="animation-video"
119
+ autoPlay
120
+ style={{pointerEvents: 'none'}}
121
+ loop
122
+ src={AI_ANIMATION_VIDEO[animation]}
123
+ width="40%"
124
+ height="40%"
125
+ />
126
+ <div style={styles.overlay} />
127
+ </div>
110
128
  )}
111
129
  </View>
112
130
  );
113
131
  }
114
132
 
115
133
  const styles = StyleSheet.create({
134
+ videoContainer: {
135
+ flex: 1,
136
+ position: 'relative',
137
+ display: 'flex',
138
+ alignItems: 'center',
139
+ justifyContent: 'center',
140
+ },
141
+ overlay: {
142
+ position: 'absolute',
143
+ top: 0,
144
+ left: 0,
145
+ width: '100%',
146
+ height: '100%',
147
+ zIndex: 1,
148
+ },
116
149
  nativeTextContainer: {
117
150
  flex: 1,
118
151
  justifyContent: 'center',
@@ -17,7 +17,7 @@ import TranscriptIcon from '../assets/transcript.png';
17
17
  //@ts-ignore
18
18
  import SettingsIcon from '../assets/settings.png';
19
19
  //@ts-ignore
20
- import DisconnectIcon from '../assets/close.png';
20
+ import LeaveCallIcon from '../assets/leave-call.png';
21
21
 
22
22
  export const MicButton = () => {
23
23
  const {audio} = useLocalUserInfo();
@@ -117,7 +117,7 @@ export const DisconnectButton = () => {
117
117
  }}>
118
118
  <Image
119
119
  style={[styles.iconStyle, {tintColor: $config.FONT_COLOR}]}
120
- source={DisconnectIcon}
120
+ source={LeaveCallIcon}
121
121
  />
122
122
  </TouchableOpacity>
123
123
  );
@@ -2,13 +2,20 @@ import React from 'react';
2
2
  import {ToolbarPreset} from 'customization-api';
3
3
  import {AgentControl} from '../AgentControls';
4
4
  import {CustomSettingButton, CustomTranscriptButton} from '../Bottombar';
5
+ import {isAndroid, isIOS} from '../../../utils/common';
5
6
 
6
7
  const Bottombar = () => {
7
8
  const AI_LAYOUT = $config.AI_LAYOUT ? $config.AI_LAYOUT : 'LAYOUT_TYPE_1';
8
9
  return (
9
10
  <ToolbarPreset
10
11
  align="bottom"
11
- snapPointsMinMax={AI_LAYOUT === 'LAYOUT_TYPE_2' ? [100, 100] : [0, 0]}
12
+ snapPointsMinMax={
13
+ isAndroid() || isIOS()
14
+ ? [100, 100]
15
+ : AI_LAYOUT === 'LAYOUT_TYPE_2'
16
+ ? [100, 100]
17
+ : [0, 0]
18
+ }
12
19
  items={{
13
20
  layout: {hide: true},
14
21
  invite: {hide: true},
@@ -2,16 +2,26 @@ import React from 'react';
2
2
  import {View, StyleSheet, Text} from 'react-native';
3
3
  import {useRoomInfo} from 'customization-api';
4
4
  import ThemeConfig from '../../../theme';
5
+ import {SettingButton} from '../ControlButtons';
6
+ import {getAILayoutType} from '../../utils';
5
7
 
6
8
  const MobileTopbar = () => {
7
9
  const {
8
10
  data: {meetingTitle},
9
11
  } = useRoomInfo();
12
+
10
13
  return (
11
14
  <View style={style.rootStyle}>
12
15
  <View style={style.containerStyle}>
13
16
  <Text style={style.textStyle}>{meetingTitle}</Text>
14
17
  </View>
18
+ {getAILayoutType() !== 'LAYOUT_TYPE_2' ? (
19
+ <View>
20
+ <SettingButton />
21
+ </View>
22
+ ) : (
23
+ <></>
24
+ )}
15
25
  </View>
16
26
  );
17
27
  };
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import {CustomizationApiInterface} from 'customization-api';
3
- import {isMobileUA} from '../utils/common';
3
+ import {isIOS, isAndroid, isMobileUA} from '../utils/common';
4
4
  import Bottombar from './components/Bottombar';
5
5
  import CustomCreate from './components/CustomCreate';
6
6
  import MobileTopBar from './components/mobile/Topbar';
@@ -8,7 +8,7 @@ import MobileBottombar from './components/mobile/Bottombar';
8
8
  import CustomChatPanel from './components/CustomChatPanel';
9
9
  import CustomSettingsPanel from './components/CustomSettingsPanel';
10
10
  import {AgentProvider} from './components/AgentControls/AgentContext';
11
-
11
+ import {getAILayoutType} from './utils';
12
12
  //LAYOUT_TYPE_1
13
13
  import NewAnimationLayout from './layout/NewAnimation';
14
14
  //LAYOUT_TYPE_2
@@ -20,10 +20,6 @@ const DummyComponent = () => {
20
20
  return <></>;
21
21
  };
22
22
 
23
- const getAILayoutType = () => {
24
- return $config.AI_LAYOUT ? $config.AI_LAYOUT : 'LAYOUT_TYPE_1';
25
- };
26
-
27
23
  const getTopBarComponent = () => {
28
24
  return isMobileUA() || getAILayoutType() !== 'LAYOUT_TYPE_2'
29
25
  ? MobileTopBar
@@ -39,7 +35,9 @@ const getBottombarComponent = () => {
39
35
  };
40
36
 
41
37
  const getCustomLayoutComponent = () => {
42
- return getAILayoutType() === 'LAYOUT_TYPE_3'
38
+ return isAndroid() || isIOS()
39
+ ? AIWithLocalUser
40
+ : getAILayoutType() === 'LAYOUT_TYPE_3'
43
41
  ? ConversationalAILayout
44
42
  : getAILayoutType() === 'LAYOUT_TYPE_2'
45
43
  ? AIWithLocalUser
@@ -7,18 +7,17 @@ import {
7
7
  Image,
8
8
  ActivityIndicator,
9
9
  } from 'react-native';
10
- import {useSidePanel, isAndroid, isIOS} from 'customization-api';
10
+ import {useSidePanel} from 'customization-api';
11
11
  import ThemeConfig from '../../theme';
12
12
  import {AgentContext} from '../components/AgentControls/AgentContext';
13
13
  import {AgentState} from '../components/AgentControls/const';
14
14
  import {useIsAgentAvailable} from '../components/utils';
15
- import {isMobileUA} from '../../utils/common';
15
+ import {isMobileUA, isAndroid, isIOS} from '../../utils/common';
16
16
  //@ts-ignore
17
17
  import JoinCallIcon from '../assets/join-call.png';
18
18
  import {
19
19
  DisconnectButton,
20
20
  MicButton,
21
- SettingButton,
22
21
  TranscriptButton,
23
22
  } from '../components/ControlButtons';
24
23
 
@@ -83,7 +82,6 @@ export default function ConversationalAI() {
83
82
  <View style={styles.controlsContainer}>
84
83
  <MicButton />
85
84
  <TranscriptButton />
86
- <SettingButton />
87
85
  <DisconnectButton />
88
86
  </View>
89
87
  ) : (
@@ -15,7 +15,6 @@ import AiAgentCustomView from '../ai-interface/AIAgentInterface';
15
15
  import {
16
16
  DisconnectButton,
17
17
  MicButton,
18
- SettingButton,
19
18
  TranscriptButton,
20
19
  } from '../components/ControlButtons';
21
20
  import {isMobileUA} from '../../utils/common';
@@ -56,7 +55,6 @@ export default function NewAnimation() {
56
55
  <View style={styles.controlsContainer}>
57
56
  <MicButton />
58
57
  <TranscriptButton />
59
- <SettingButton />
60
58
  <DisconnectButton />
61
59
  </View>
62
60
  ) : (
@@ -153,6 +151,7 @@ const styles = StyleSheet.create({
153
151
  marginRight: 'auto',
154
152
  maxWidth: 500,
155
153
  bottom: 50,
154
+ zIndex: 999,
156
155
  },
157
156
  container: {
158
157
  flex: 1,
@@ -1,5 +1,7 @@
1
1
  import {IMicrophoneAudioTrack} from 'agora-rtc-sdk-ng';
2
2
  import {useState, useEffect} from 'react';
3
+ import {isAndroid, isIOS} from '../utils/common';
4
+
3
5
  //for native its require text decoder to be imported
4
6
  const TextDecoder = require('text-encoding').TextDecoder;
5
7
  export const useMultibandTrackVolume = (
@@ -131,3 +133,11 @@ export const Base64 = {
131
133
  return output;
132
134
  },
133
135
  };
136
+
137
+ export const getAILayoutType = () => {
138
+ return isAndroid() || isIOS()
139
+ ? 'LAYOUT_TYPE_2'
140
+ : $config.AI_LAYOUT
141
+ ? $config.AI_LAYOUT
142
+ : 'LAYOUT_TYPE_1';
143
+ };
@@ -52,7 +52,7 @@ const useSpeechToText = () => {
52
52
  useEffect(() => {
53
53
  if (!$config.ENABLE_STT) {
54
54
  //throw new Error('Speech To Text is not enabled');
55
- console.error('Speech To Text is not enabled');
55
+ console.log('Speech To Text is not enabled');
56
56
  }
57
57
  }, []);
58
58