agora-appbuilder-core 4.0.0-beta.44 → 4.0.0-beta.45
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 +2 -2
- package/template/Gulpfile.js +3 -3
- package/template/_package-lock.json +0 -65
- package/template/agora-rn-uikit/src/Contexts/PropsContext.tsx +3 -18
- package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +0 -1
- package/template/agora-rn-uikit/src/Controls/Icons.ts +1 -1
- package/template/agora-rn-uikit/src/Controls/Local/EndCall.tsx +4 -6
- package/template/agora-rn-uikit/src/Controls/Local/FullScreen.tsx +1 -3
- package/template/agora-rn-uikit/src/Controls/Local/LocalAudioMute.tsx +0 -1
- package/template/agora-rn-uikit/src/Controls/Local/LocalVideoMute.tsx +0 -1
- package/template/agora-rn-uikit/src/Controls/Local/SwitchCamera.tsx +0 -1
- package/template/agora-rn-uikit/src/Controls/Remote/RemoteAudioMute.tsx +0 -1
- package/template/agora-rn-uikit/src/Controls/Remote/RemoteSwap.tsx +1 -3
- package/template/agora-rn-uikit/src/Controls/Remote/RemoteVideoMute.tsx +0 -1
- package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/LocalPermissionState.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +3 -3
- package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +4 -5
- package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +5 -8
- package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +1 -1
- package/template/agora-rn-uikit/src/Rtc/Create.tsx +15 -31
- package/template/agora-rn-uikit/src/Rtc/Join.tsx +0 -2
- package/template/agora-rn-uikit/src/Views/MaxVideoView.native.tsx +2 -8
- package/template/agora-rn-uikit/src/Views/MaxVideoView.tsx +5 -4
- package/template/agora-rn-uikit/src/Views/MinVideoView.tsx +0 -2
- package/template/android/app/src/main/AndroidManifest.xml +18 -6
- package/template/android/app/src/main/assets/fonts/icomoon.ttf +0 -0
- package/template/bridge/rtc/webNg/index.ts +1 -72
- package/template/customization-api/typeDefinition.ts +0 -1
- package/template/customization-implementation/index.ts +1 -0
- package/template/global.d.ts +0 -1
- package/template/package.json +1 -3
- package/template/src/App.tsx +10 -10
- package/template/src/AppWrapper.tsx +2 -4
- package/template/src/SDKAppWrapper.tsx +4 -4
- package/template/src/assets/font-styles.css +0 -92
- package/template/src/assets/fonts/icomoon.ttf +0 -0
- package/template/src/assets/selection.json +1 -1
- package/template/src/atoms/Carousel.native.tsx +3 -3
- package/template/src/atoms/Carousel.tsx +3 -2
- package/template/src/atoms/CircularProgress.tsx +1 -0
- package/template/src/atoms/CustomIcon.tsx +0 -24
- package/template/src/atoms/IconButton.tsx +8 -50
- package/template/src/atoms/ImageIcon.tsx +3 -6
- package/template/src/atoms/InlineNotification.tsx +15 -49
- package/template/src/atoms/PrimaryButton.tsx +2 -3
- package/template/src/atoms/SecondaryButton.tsx +0 -2
- package/template/src/atoms/Spacer.tsx +0 -1
- package/template/src/atoms/TextInput.tsx +1 -2
- package/template/src/atoms/Toolbar.tsx +1 -5
- package/template/src/atoms/ToolbarItem.tsx +4 -4
- package/template/src/atoms/Tooltip.tsx +4 -26
- package/template/src/auth/AuthProvider.tsx +8 -0
- package/template/src/auth/IDPAuth.electron.tsx +1 -0
- package/template/src/auth/useTokenAuth.tsx +8 -10
- package/template/src/components/Chat.tsx +0 -1
- package/template/src/components/ColorConfigure.tsx +1 -0
- package/template/src/components/Controls.tsx +56 -50
- package/template/src/components/DeviceConfigure.tsx +4 -8
- package/template/src/components/EventsConfigure.tsx +26 -72
- package/template/src/components/GraphQLProvider.tsx +3 -5
- package/template/src/components/JoinPhrase.tsx +1 -0
- package/template/src/components/ParticipantsView.tsx +0 -1
- package/template/src/components/PinnedVideo.tsx +6 -9
- package/template/src/components/Precall.native.tsx +60 -128
- package/template/src/components/Precall.tsx +50 -54
- package/template/src/components/RTMConfigure.tsx +19 -38
- package/template/src/components/SessionContext.tsx +1 -0
- package/template/src/components/SettingsView.tsx +6 -30
- package/template/src/components/chat-messages/useChatMessages.tsx +1 -9
- package/template/src/components/contexts/ScreenShareContext.tsx +0 -1
- package/template/src/components/contexts/WaitingRoomContext.tsx +0 -1
- package/template/src/components/livestream/LiveStreamContext.tsx +0 -1
- package/template/src/components/livestream/views/LiveStreamAttendeeLandingTile.tsx +1 -2
- package/template/src/components/participants/UserActionMenuOptions.tsx +0 -6
- package/template/src/components/precall/LocalMute.tsx +34 -17
- package/template/src/components/precall/PermissionHelper.tsx +3 -9
- package/template/src/components/precall/PreCallSettings.tsx +0 -1
- package/template/src/components/precall/VideoPreview.native.tsx +50 -16
- package/template/src/components/precall/VideoPreview.tsx +300 -26
- package/template/src/components/precall/meetingTitle.tsx +10 -30
- package/template/src/components/precall/selectDevice.tsx +1 -4
- package/template/src/components/precall/textInput.tsx +1 -1
- package/template/src/components/room-info/useRoomInfo.tsx +0 -5
- package/template/src/components/useShareLink.tsx +1 -4
- package/template/src/components/useVideoCall.tsx +0 -10
- package/template/src/components/virtual-background/VBButton.tsx +24 -51
- package/template/src/components/virtual-background/VBPanel.tsx +287 -125
- package/template/src/components/virtual-background/VideoPreview.tsx +94 -51
- package/template/src/components/virtual-background/useVB.native.tsx +37 -157
- package/template/src/components/virtual-background/useVB.tsx +114 -57
- package/template/src/components/whiteboard/WhiteboardButton.tsx +11 -6
- package/template/src/components/whiteboard/WhiteboardCanvas.tsx +13 -24
- package/template/src/components/whiteboard/WhiteboardConfigure.native.tsx +4 -95
- package/template/src/components/whiteboard/WhiteboardConfigure.tsx +6 -276
- package/template/src/components/whiteboard/WhiteboardToolBox.tsx +577 -1113
- package/template/src/components/whiteboard/WhiteboardView.tsx +2 -2
- package/template/src/components/whiteboard/WhiteboardWrapper.tsx +14 -26
- package/template/src/pages/video-call/ActionSheet.native.tsx +1 -1
- package/template/src/pages/video-call/ActionSheet.tsx +1 -1
- package/template/src/pages/video-call/ActionSheetContent.tsx +76 -79
- package/template/src/pages/video-call/NameWithMicIcon.tsx +1 -7
- package/template/src/pages/video-call/RenderComponent.tsx +0 -1
- package/template/src/pages/video-call/SidePanelHeader.tsx +1 -1
- package/template/src/pages/video-call/VideoCallMobileView.tsx +24 -40
- package/template/src/pages/video-call/VideoCallScreen.tsx +6 -16
- package/template/src/pages/video-call/VideoRenderer.tsx +13 -60
- package/template/src/rtm-events/constants.ts +0 -7
- package/template/src/rtm-events-api/Events.ts +0 -2
- package/template/src/rtm-events-api/LocalEvents.ts +0 -5
- package/template/src/subComponents/ChatContainer.tsx +1 -4
- package/template/src/subComponents/Checkbox.native.tsx +46 -46
- package/template/src/subComponents/Checkbox.tsx +6 -7
- package/template/src/subComponents/LanguageSelector.tsx +4 -5
- package/template/src/subComponents/LayoutIconButton.tsx +0 -1
- package/template/src/subComponents/LocalEndCall.tsx +1 -1
- package/template/src/subComponents/LocalSwitchCamera.tsx +2 -16
- package/template/src/subComponents/SelectDevice.tsx +2 -14
- package/template/src/subComponents/SidePanelHeader.tsx +1 -1
- package/template/src/subComponents/caption/CaptionContainer.tsx +0 -1
- package/template/src/subComponents/caption/Transcript.tsx +0 -1
- package/template/src/subComponents/livestream/controls/RemoteLiveStreamApprovedRequestRecall.tsx +0 -1
- package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +11 -0
- package/template/src/utils/SdkMethodEvents.ts +5 -5
- package/template/src/utils/common.tsx +0 -28
- package/template/src/utils/useFindActiveSpeaker.ts +0 -1
- package/template/src/utils/useIsLocalUserSpeaking.ts +5 -14
- package/template/src/utils/useMuteToggleLocal.ts +1 -2
- package/template/src/components/popups/WhiteboardClearAllPopup.tsx +0 -113
- package/template/src/components/precall/VideoFallback.tsx +0 -167
- package/template/src/components/virtual-background/VBCard.native.tsx +0 -258
- package/template/src/components/virtual-background/VBCard.tsx +0 -248
- package/template/src/components/virtual-background/VButils.native.ts +0 -37
- package/template/src/components/virtual-background/VButils.ts +0 -104
- package/template/src/components/virtual-background/VideoPreview.native.tsx +0 -42
- package/template/src/components/virtual-background/imagePaths.ts +0 -63
- package/template/src/components/whiteboard/StrokeWidthTool.tsx +0 -135
- package/template/src/components/whiteboard/WhiteboardCursor.tsx +0 -152
- package/template/src/components/whiteboard/WhiteboardWidget.tsx +0 -549
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agora-appbuilder-core",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.45",
|
|
4
4
|
"description": "React Native template for RTE app builder",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
],
|
|
10
10
|
"scripts": {
|
|
11
11
|
"vercel-build": "npm run dev-setup && cd template && npm run web:build && cd .. && npm run copy-vercel",
|
|
12
|
-
"uikit": "rm -rf template/agora-rn-uikit && git clone https://github.com/AgoraIO-Community/ReactNative-UIKit.git template/agora-rn-uikit && cd template/agora-rn-uikit && git checkout
|
|
12
|
+
"uikit": "rm -rf template/agora-rn-uikit && git clone https://github.com/AgoraIO-Community/ReactNative-UIKit.git template/agora-rn-uikit && cd template/agora-rn-uikit && git checkout active-speaker-layout-change",
|
|
13
13
|
"deps": "cd template && npm i",
|
|
14
14
|
"dev-setup": "npm run uikit && npm run deps && node devSetup.js",
|
|
15
15
|
"web-build": "cd template && npm run web:build && cd .. && npm run copy-vercel",
|
package/template/Gulpfile.js
CHANGED
|
@@ -251,12 +251,12 @@ const reactSdk = {
|
|
|
251
251
|
const cli = debugFlag ? runCli : runCliNoOutput;
|
|
252
252
|
cli(
|
|
253
253
|
//'npx -p typescript tsc index.rsdk.tsx --declaration --emitDeclarationOnly --noResolve --outFile ../Builds/temp.d.ts',
|
|
254
|
-
'npx -p typescript tsc --project tsconfig_rsdk_index.json --outFile ../Builds/reactSdk.d.ts',
|
|
254
|
+
'npx -p typescript tsc --project tsconfig_rsdk_index.json --noResolve --outFile ../Builds/reactSdk.d.ts',
|
|
255
255
|
() => cb(),
|
|
256
256
|
);
|
|
257
257
|
},
|
|
258
258
|
bundleSdkTypedefs: () => {
|
|
259
|
-
return src(['../Builds/customization-api.d.ts', '
|
|
259
|
+
return src(['../Builds/customization-api.d.ts', './static.d.ts'])
|
|
260
260
|
.pipe(concat('index.d.ts'))
|
|
261
261
|
.pipe(
|
|
262
262
|
replace(
|
|
@@ -358,7 +358,7 @@ module.exports.reactSdk = series(
|
|
|
358
358
|
reactSdk.webpack,
|
|
359
359
|
general.generateApiTypedefs,
|
|
360
360
|
general.bundleApiTypedefs,
|
|
361
|
-
reactSdk.generateSdkTypedefs,
|
|
361
|
+
// reactSdk.generateSdkTypedefs,
|
|
362
362
|
reactSdk.bundleSdkTypedefs,
|
|
363
363
|
general.cleanTempFiles,
|
|
364
364
|
general.generateNpmPackage,
|
|
@@ -40,9 +40,7 @@
|
|
|
40
40
|
"react-is": "18.0.0",
|
|
41
41
|
"react-native": "0.72.4",
|
|
42
42
|
"react-native-agora": "3.7.2-rc.3",
|
|
43
|
-
"react-native-document-picker": "^9.1.0",
|
|
44
43
|
"react-native-exit-app": "1.1.0",
|
|
45
|
-
"react-native-fs": "^2.20.0",
|
|
46
44
|
"react-native-gesture-handler": "2.8.0",
|
|
47
45
|
"react-native-hyperlink": "0.0.19",
|
|
48
46
|
"react-native-inappbrowser-reborn": "3.5.1",
|
|
@@ -25736,47 +25734,11 @@
|
|
|
25736
25734
|
"ieee754": "^1.2.1"
|
|
25737
25735
|
}
|
|
25738
25736
|
},
|
|
25739
|
-
"node_modules/react-native-document-picker": {
|
|
25740
|
-
"version": "9.1.0",
|
|
25741
|
-
"resolved": "https://registry.npmjs.org/react-native-document-picker/-/react-native-document-picker-9.1.0.tgz",
|
|
25742
|
-
"integrity": "sha512-SRKPIAzUtcPDUstLRhQeebVVM+x+1I24iSvoy5mFp1KAD+6+UyDEle0SoD96k7MxVH5o46wPifWCYOA3FuQOyw==",
|
|
25743
|
-
"dependencies": {
|
|
25744
|
-
"invariant": "^2.2.4"
|
|
25745
|
-
},
|
|
25746
|
-
"peerDependencies": {
|
|
25747
|
-
"react": "*",
|
|
25748
|
-
"react-native": "*",
|
|
25749
|
-
"react-native-windows": "*"
|
|
25750
|
-
},
|
|
25751
|
-
"peerDependenciesMeta": {
|
|
25752
|
-
"react-native-windows": {
|
|
25753
|
-
"optional": true
|
|
25754
|
-
}
|
|
25755
|
-
}
|
|
25756
|
-
},
|
|
25757
25737
|
"node_modules/react-native-exit-app": {
|
|
25758
25738
|
"version": "1.1.0",
|
|
25759
25739
|
"resolved": "https://registry.npmjs.org/react-native-exit-app/-/react-native-exit-app-1.1.0.tgz",
|
|
25760
25740
|
"integrity": "sha512-Spne19zfMfJvnUTX909EHUqWMk69rATtLJq9XMBGpNSHhx0M7v5yetx2Z87egBhLOqQm+CWfD/oxWzDG8rbIQA=="
|
|
25761
25741
|
},
|
|
25762
|
-
"node_modules/react-native-fs": {
|
|
25763
|
-
"version": "2.20.0",
|
|
25764
|
-
"resolved": "https://registry.npmjs.org/react-native-fs/-/react-native-fs-2.20.0.tgz",
|
|
25765
|
-
"integrity": "sha512-VkTBzs7fIDUiy/XajOSNk0XazFE9l+QlMAce7lGuebZcag5CnjszB+u4BdqzwaQOdcYb5wsJIsqq4kxInIRpJQ==",
|
|
25766
|
-
"dependencies": {
|
|
25767
|
-
"base-64": "^0.1.0",
|
|
25768
|
-
"utf8": "^3.0.0"
|
|
25769
|
-
},
|
|
25770
|
-
"peerDependencies": {
|
|
25771
|
-
"react-native": "*",
|
|
25772
|
-
"react-native-windows": "*"
|
|
25773
|
-
},
|
|
25774
|
-
"peerDependenciesMeta": {
|
|
25775
|
-
"react-native-windows": {
|
|
25776
|
-
"optional": true
|
|
25777
|
-
}
|
|
25778
|
-
}
|
|
25779
|
-
},
|
|
25780
25742
|
"node_modules/react-native-gesture-handler": {
|
|
25781
25743
|
"version": "2.8.0",
|
|
25782
25744
|
"resolved": "https://registry.npmjs.org/react-native-gesture-handler/-/react-native-gesture-handler-2.8.0.tgz",
|
|
@@ -30239,11 +30201,6 @@
|
|
|
30239
30201
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
|
30240
30202
|
}
|
|
30241
30203
|
},
|
|
30242
|
-
"node_modules/utf8": {
|
|
30243
|
-
"version": "3.0.0",
|
|
30244
|
-
"resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz",
|
|
30245
|
-
"integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ=="
|
|
30246
|
-
},
|
|
30247
30204
|
"node_modules/utf8-byte-length": {
|
|
30248
30205
|
"version": "1.0.4",
|
|
30249
30206
|
"resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.4.tgz",
|
|
@@ -50754,28 +50711,11 @@
|
|
|
50754
50711
|
}
|
|
50755
50712
|
}
|
|
50756
50713
|
},
|
|
50757
|
-
"react-native-document-picker": {
|
|
50758
|
-
"version": "9.1.0",
|
|
50759
|
-
"resolved": "https://registry.npmjs.org/react-native-document-picker/-/react-native-document-picker-9.1.0.tgz",
|
|
50760
|
-
"integrity": "sha512-SRKPIAzUtcPDUstLRhQeebVVM+x+1I24iSvoy5mFp1KAD+6+UyDEle0SoD96k7MxVH5o46wPifWCYOA3FuQOyw==",
|
|
50761
|
-
"requires": {
|
|
50762
|
-
"invariant": "^2.2.4"
|
|
50763
|
-
}
|
|
50764
|
-
},
|
|
50765
50714
|
"react-native-exit-app": {
|
|
50766
50715
|
"version": "1.1.0",
|
|
50767
50716
|
"resolved": "https://registry.npmjs.org/react-native-exit-app/-/react-native-exit-app-1.1.0.tgz",
|
|
50768
50717
|
"integrity": "sha512-Spne19zfMfJvnUTX909EHUqWMk69rATtLJq9XMBGpNSHhx0M7v5yetx2Z87egBhLOqQm+CWfD/oxWzDG8rbIQA=="
|
|
50769
50718
|
},
|
|
50770
|
-
"react-native-fs": {
|
|
50771
|
-
"version": "2.20.0",
|
|
50772
|
-
"resolved": "https://registry.npmjs.org/react-native-fs/-/react-native-fs-2.20.0.tgz",
|
|
50773
|
-
"integrity": "sha512-VkTBzs7fIDUiy/XajOSNk0XazFE9l+QlMAce7lGuebZcag5CnjszB+u4BdqzwaQOdcYb5wsJIsqq4kxInIRpJQ==",
|
|
50774
|
-
"requires": {
|
|
50775
|
-
"base-64": "^0.1.0",
|
|
50776
|
-
"utf8": "^3.0.0"
|
|
50777
|
-
}
|
|
50778
|
-
},
|
|
50779
50719
|
"react-native-gesture-handler": {
|
|
50780
50720
|
"version": "2.8.0",
|
|
50781
50721
|
"resolved": "https://registry.npmjs.org/react-native-gesture-handler/-/react-native-gesture-handler-2.8.0.tgz",
|
|
@@ -54120,11 +54060,6 @@
|
|
|
54120
54060
|
"integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==",
|
|
54121
54061
|
"requires": {}
|
|
54122
54062
|
},
|
|
54123
|
-
"utf8": {
|
|
54124
|
-
"version": "3.0.0",
|
|
54125
|
-
"resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz",
|
|
54126
|
-
"integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ=="
|
|
54127
|
-
},
|
|
54128
54063
|
"utf8-byte-length": {
|
|
54129
54064
|
"version": "1.0.4",
|
|
54130
54065
|
"resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.4.tgz",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {StyleProp, ViewStyle} from 'react-native';
|
|
3
|
-
import {RtcEngineEvents} from 'react-native-agora/lib/typescript/common/RtcEvents';
|
|
3
|
+
import {RtcEngineEvents} from 'react-native-agora/lib/typescript/src/common/RtcEvents';
|
|
4
4
|
import {EncryptionMode} from 'react-native-agora';
|
|
5
5
|
import {VideoProfile} from '../Utils/quality';
|
|
6
6
|
import {UidType} from './RtcContext';
|
|
@@ -46,7 +46,6 @@ export const toggleHelper = (state: ToggleState) =>
|
|
|
46
46
|
state === ToggleState.enabled ? ToggleState.disabled : ToggleState.enabled;
|
|
47
47
|
|
|
48
48
|
export interface DefaultContentInterface {
|
|
49
|
-
//uikit and core
|
|
50
49
|
uid: UidType;
|
|
51
50
|
audio: ToggleState;
|
|
52
51
|
video: ToggleState;
|
|
@@ -55,15 +54,6 @@ export interface DefaultContentInterface {
|
|
|
55
54
|
permissionStatus?: PermissionState;
|
|
56
55
|
//applicable only to the screenshare
|
|
57
56
|
parentUid?: UidType;
|
|
58
|
-
//uikit and core
|
|
59
|
-
|
|
60
|
-
//core only
|
|
61
|
-
name: string;
|
|
62
|
-
screenUid: number;
|
|
63
|
-
offline: boolean;
|
|
64
|
-
lastMessageTimeStamp: number;
|
|
65
|
-
isInWaitingRoom?: boolean;
|
|
66
|
-
//core only
|
|
67
57
|
}
|
|
68
58
|
export interface CustomContentInterface<T> {
|
|
69
59
|
type: T extends DefaultContentInterface['type'] ? never : T;
|
|
@@ -133,11 +123,6 @@ export interface RtcPropsInterface {
|
|
|
133
123
|
geoFencing?: boolean;
|
|
134
124
|
audioRoom?: boolean;
|
|
135
125
|
activeSpeaker?: boolean;
|
|
136
|
-
|
|
137
|
-
//core only
|
|
138
|
-
screenShareUid?: number;
|
|
139
|
-
screenShareToken?: string;
|
|
140
|
-
//core only
|
|
141
126
|
}
|
|
142
127
|
|
|
143
128
|
export interface CallbacksInterface {
|
|
@@ -176,7 +161,7 @@ export interface PropsInterface {
|
|
|
176
161
|
mode?: ChannelProfile;
|
|
177
162
|
}
|
|
178
163
|
|
|
179
|
-
const initialValue:
|
|
164
|
+
const initialValue: PropsInterface = {
|
|
180
165
|
rtcProps: {
|
|
181
166
|
appId: '',
|
|
182
167
|
channel: '',
|
|
@@ -185,7 +170,7 @@ const initialValue: Partial<PropsInterface> = {
|
|
|
185
170
|
},
|
|
186
171
|
};
|
|
187
172
|
|
|
188
|
-
const PropsContext = React.createContext<
|
|
173
|
+
const PropsContext = React.createContext<PropsInterface>(initialValue);
|
|
189
174
|
|
|
190
175
|
export const PropsProvider = PropsContext.Provider;
|
|
191
176
|
export const PropsConsumer = PropsContext.Consumer;
|
|
@@ -26,7 +26,6 @@ interface BtnTemplateBasicInterface {
|
|
|
26
26
|
disabled?: boolean;
|
|
27
27
|
}
|
|
28
28
|
interface BtnTemplateInterfaceWithName extends BtnTemplateBasicInterface {
|
|
29
|
-
//@ts-ignore
|
|
30
29
|
name?: keyof IconsInterface;
|
|
31
30
|
}
|
|
32
31
|
interface BtnTemplateInterfaceWithIcon extends BtnTemplateBasicInterface {
|
|
@@ -29,7 +29,7 @@ const icons: IconsInterface = {
|
|
|
29
29
|
'noise-cancellation':
|
|
30
30
|
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAANxSURBVHgB7ZvxddowEMaPvv5fRlA2yAjuBMkGYYPSCeJMAJ0AMkGyAWzQdAKzAXSCr6dafjjGtiRbxgLu9949g5Fk+8vJOukUIkEQBEEQBEEQ/JlQBACY8uGRTZlTH9omk8mObhkWRrFt0MxKl/Fsc8G2N6JfLvwA92wZ7Ogy945tqlKbKV0qlQdxIbN5kmlzXaqjveiJxoRvYGZu5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hE/aE2I29G/jjyO5m42igzyMSvqedjvKJOF3jT6kr2+SLW1Td53p6iQUppVW0BD4CPUV4DagVqDViNNb/VOrAAWLaDlrqWtWvU7qsb6g31aMQN9V7MD6mv46mXGfwVjz4/qA6o827FfNR74qAtqUNdxUM0L95WJ3NzY9ExY4U1FzNx9VwVk/3qLePKqAr1bPGgpQ7ElFIyOuo0cAo4BowAfcA68AVoAy+A59EcJ4GRlNKjMoM+4DZwEzgAfAeWgM8xbgCjwPEYf2Oz66ZSSt2vijCYiR85p06ovR14vTE/F/yHRU6nHfwEFoGrpW/zD7PAeEppsIpB98PSBSmlLZrbbh24/r8Gu9gx/gBohhCCgI16xQAAAABJRU5ErkJggg==',
|
|
@@ -3,24 +3,22 @@ import PropsContext from '../../Contexts/PropsContext';
|
|
|
3
3
|
import RtcContext from '../../Contexts/RtcContext';
|
|
4
4
|
import BtnTemplate from '../BtnTemplate';
|
|
5
5
|
import styles from '../../Style';
|
|
6
|
-
import DispatchContext from '../../Contexts/DispatchContext';
|
|
7
6
|
|
|
8
|
-
interface EndCallProps
|
|
9
|
-
btnText?: string
|
|
7
|
+
interface EndCallProps{
|
|
8
|
+
btnText?: string
|
|
10
9
|
}
|
|
11
10
|
|
|
12
11
|
function EndCall(props?: EndCallProps) {
|
|
13
12
|
const {styleProps} = useContext(PropsContext);
|
|
14
13
|
const {localBtnStyles} = styleProps || {};
|
|
15
14
|
const {endCall} = localBtnStyles || {};
|
|
16
|
-
const {dispatch} = useContext(
|
|
15
|
+
const {dispatch} = useContext(RtcContext);
|
|
17
16
|
|
|
18
17
|
return (
|
|
19
18
|
<BtnTemplate
|
|
20
|
-
//@ts-ignore
|
|
21
19
|
name={'callEnd'}
|
|
22
20
|
btnText={props?.btnText || 'Hang Up'}
|
|
23
|
-
color=
|
|
21
|
+
color='#FD0845'
|
|
24
22
|
style={{...styles.endCall, ...(endCall as object)}}
|
|
25
23
|
onPress={() =>
|
|
26
24
|
dispatch({
|
|
@@ -3,16 +3,14 @@ import PropsContext from '../../Contexts/PropsContext';
|
|
|
3
3
|
import RtcContext from '../../Contexts/RtcContext';
|
|
4
4
|
import BtnTemplate from '../BtnTemplate';
|
|
5
5
|
import styles from '../../Style';
|
|
6
|
-
import DispatchContext from '../../Contexts/DispatchContext';
|
|
7
6
|
|
|
8
7
|
function FullScreen() {
|
|
9
8
|
const {styleProps} = useContext(PropsContext);
|
|
10
9
|
const {localBtnStyles} = styleProps || {};
|
|
11
10
|
const {fullScreen} = localBtnStyles || {};
|
|
12
|
-
const {dispatch} = useContext(
|
|
11
|
+
const {dispatch} = useContext(RtcContext);
|
|
13
12
|
return (
|
|
14
13
|
<BtnTemplate
|
|
15
|
-
//@ts-ignore
|
|
16
14
|
name={'fullscreen'}
|
|
17
15
|
style={{...styles.localBtn, ...(fullScreen as object)}}
|
|
18
16
|
onPress={() => {
|
|
@@ -20,7 +20,6 @@ const RemoteAudioMute: React.FC<RemoteAudioMuteInterface> = (props) => {
|
|
|
20
20
|
const localUid = useLocalUid();
|
|
21
21
|
return props.user.uid !== localUid ? (
|
|
22
22
|
<BtnTemplate
|
|
23
|
-
//@ts-ignore
|
|
24
23
|
name={props.user.audio === ToggleState.enabled ? 'mic' : 'micOff'}
|
|
25
24
|
style={{...styles.leftRemoteBtn, ...(muteRemoteAudio as object)}}
|
|
26
25
|
onPress={() => {
|
|
@@ -4,21 +4,19 @@ import BtnTemplate from '../BtnTemplate';
|
|
|
4
4
|
import styles from '../../Style';
|
|
5
5
|
import PropsContext from '../../Contexts/PropsContext';
|
|
6
6
|
import useLocalUid from '../../Utils/useLocalUid';
|
|
7
|
-
import DispatchContext from '../../Contexts/DispatchContext';
|
|
8
7
|
|
|
9
8
|
interface RemoteSwapInterface {
|
|
10
9
|
uid: UidType;
|
|
11
10
|
}
|
|
12
11
|
|
|
13
12
|
const RemoteSwap: React.FC<RemoteSwapInterface> = (props) => {
|
|
14
|
-
const {dispatch} = useContext(
|
|
13
|
+
const {dispatch} = useContext(RtcContext);
|
|
15
14
|
const {styleProps} = useContext(PropsContext);
|
|
16
15
|
const {remoteBtnStyles} = styleProps || {};
|
|
17
16
|
const {remoteSwap} = remoteBtnStyles || {};
|
|
18
17
|
const localUid = useLocalUid();
|
|
19
18
|
return (
|
|
20
19
|
<BtnTemplate
|
|
21
|
-
//@ts-ignore
|
|
22
20
|
name={'remoteSwap'}
|
|
23
21
|
style={
|
|
24
22
|
props.uid !== localUid
|
|
@@ -21,7 +21,6 @@ const RemoteVideoMute: React.FC<RemoteVideoMuteInterface> = (props) => {
|
|
|
21
21
|
const localUid = useLocalUid();
|
|
22
22
|
return props.user.uid !== localUid ? (
|
|
23
23
|
<BtnTemplate
|
|
24
|
-
//@ts-ignore
|
|
25
24
|
name={
|
|
26
25
|
props.user.video === ToggleState.enabled ? 'videocam' : 'videocamOff'
|
|
27
26
|
}
|
|
@@ -9,7 +9,7 @@ export default function LocalMuteAudio(
|
|
|
9
9
|
action: ActionType<'LocalMuteAudio'>,
|
|
10
10
|
localUid: UidType,
|
|
11
11
|
) {
|
|
12
|
-
let stateUpdate:
|
|
12
|
+
let stateUpdate: ContentStateInterface = {
|
|
13
13
|
defaultContent: {
|
|
14
14
|
...state.defaultContent,
|
|
15
15
|
[localUid]: {
|
|
@@ -9,7 +9,7 @@ export default function LocalMuteVideo(
|
|
|
9
9
|
action: ActionType<'LocalMuteVideo'>,
|
|
10
10
|
localUid: UidType,
|
|
11
11
|
) {
|
|
12
|
-
let stateUpdate:
|
|
12
|
+
let stateUpdate: ContentStateInterface = {
|
|
13
13
|
defaultContent: {
|
|
14
14
|
...state.defaultContent,
|
|
15
15
|
[localUid]: {
|
|
@@ -9,7 +9,7 @@ export default function LocalPermissionState(
|
|
|
9
9
|
action: ActionType<'LocalPermissionState'>,
|
|
10
10
|
localUid: UidType,
|
|
11
11
|
) {
|
|
12
|
-
let stateUpdate:
|
|
12
|
+
let stateUpdate: ContentStateInterface = {
|
|
13
13
|
defaultContent: {
|
|
14
14
|
...state.defaultContent,
|
|
15
15
|
[localUid]: {
|
|
@@ -12,11 +12,11 @@ export default function RemoteAudioStateChanged(
|
|
|
12
12
|
audioState = ToggleState.disabled;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
const stateUpdate:
|
|
15
|
+
const stateUpdate: ContentStateInterface = {
|
|
16
16
|
defaultContent: {
|
|
17
17
|
...state.defaultContent,
|
|
18
|
-
[action.value[0]
|
|
19
|
-
...state.defaultContent[action.value[0]
|
|
18
|
+
[action.value[0]]: {
|
|
19
|
+
...state.defaultContent[action.value[0]],
|
|
20
20
|
audio: audioState,
|
|
21
21
|
},
|
|
22
22
|
},
|
|
@@ -12,16 +12,15 @@ export default function RemoteVideoStateChanged(
|
|
|
12
12
|
videoState = ToggleState.enabled;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
const stateUpdate:
|
|
15
|
+
const stateUpdate: ContentStateInterface = {
|
|
16
16
|
defaultContent: {
|
|
17
17
|
...state.defaultContent,
|
|
18
|
-
[action.value[0]
|
|
19
|
-
...state.defaultContent[action.value[0]
|
|
18
|
+
[action.value[0]]: {
|
|
19
|
+
...state.defaultContent[action.value[0]],
|
|
20
20
|
video:
|
|
21
|
-
//@ts-ignore
|
|
22
21
|
videoState !== undefined
|
|
23
22
|
? videoState
|
|
24
|
-
: state.defaultContent[action.value[0]
|
|
23
|
+
: state.defaultContent[action.value[0]].video,
|
|
25
24
|
},
|
|
26
25
|
},
|
|
27
26
|
activeUids: [...state.activeUids],
|
|
@@ -11,7 +11,7 @@ export default function UpdateDualStreamMode(
|
|
|
11
11
|
) {
|
|
12
12
|
const newMode = action.value[0];
|
|
13
13
|
let defaultContent = {...state.defaultContent};
|
|
14
|
-
let stateUpdate:
|
|
14
|
+
let stateUpdate: ContentStateInterface;
|
|
15
15
|
const setHighStreamType = (uid: UidType) => {
|
|
16
16
|
defaultContent[uid].streamType = 'high';
|
|
17
17
|
};
|
|
@@ -17,17 +17,14 @@ export default function UserJoined(
|
|
|
17
17
|
let typeData = {
|
|
18
18
|
type: 'rtc',
|
|
19
19
|
};
|
|
20
|
-
if (
|
|
21
|
-
state.defaultContent[newUid
|
|
22
|
-
'type' in state.defaultContent[newUid as unknown as number]
|
|
23
|
-
) {
|
|
24
|
-
typeData.type = state.defaultContent[newUid as unknown as number].type;
|
|
20
|
+
if (state.defaultContent[newUid] && 'type' in state.defaultContent[newUid]) {
|
|
21
|
+
typeData.type = state.defaultContent[newUid].type;
|
|
25
22
|
}
|
|
26
23
|
|
|
27
24
|
let defaultContent: ContentStateInterface['defaultContent'] = {
|
|
28
25
|
...state.defaultContent,
|
|
29
|
-
[newUid
|
|
30
|
-
...state.defaultContent[newUid
|
|
26
|
+
[newUid]: {
|
|
27
|
+
...state.defaultContent[newUid],
|
|
31
28
|
uid: newUid,
|
|
32
29
|
audio: ToggleState.disabled,
|
|
33
30
|
video: ToggleState.disabled,
|
|
@@ -43,7 +40,7 @@ export default function UserJoined(
|
|
|
43
40
|
//Only one remote and local is maximized
|
|
44
41
|
//Change stream type to high if dualStreaMode is DYNAMIC
|
|
45
42
|
if (dualStreamMode === DualStreamMode.DYNAMIC) {
|
|
46
|
-
defaultContent[newUid
|
|
43
|
+
defaultContent[newUid].streamType = 'high';
|
|
47
44
|
}
|
|
48
45
|
//Swap render positions
|
|
49
46
|
stateUpdate = {
|
|
@@ -4,7 +4,7 @@ export default function UserMuteRemoteAudio(
|
|
|
4
4
|
state: ContentStateInterface,
|
|
5
5
|
action: ActionType<'UserMuteRemoteAudio'>,
|
|
6
6
|
) {
|
|
7
|
-
let stateUpdate:
|
|
7
|
+
let stateUpdate: ContentStateInterface = {
|
|
8
8
|
defaultContent: {
|
|
9
9
|
...state.defaultContent,
|
|
10
10
|
[action.value[0]]: {
|
|
@@ -4,7 +4,7 @@ export default function UserMuteRemoteVideo(
|
|
|
4
4
|
state: ContentStateInterface,
|
|
5
5
|
action: ActionType<'UserMuteRemoteVideo'>,
|
|
6
6
|
) {
|
|
7
|
-
let stateUpdate:
|
|
7
|
+
let stateUpdate: ContentStateInterface = {
|
|
8
8
|
defaultContent: {
|
|
9
9
|
...state.defaultContent,
|
|
10
10
|
[action.value[0]]: {
|
|
@@ -15,7 +15,7 @@ export default function UserOffline(
|
|
|
15
15
|
const updatedActiveUids = [...state.activeUids].filter(
|
|
16
16
|
(uid) => uid !== action.value[0],
|
|
17
17
|
);
|
|
18
|
-
const stateUpdate:
|
|
18
|
+
const stateUpdate: ContentStateInterface = {
|
|
19
19
|
defaultContent: state.defaultContent,
|
|
20
20
|
activeUids: updatedActiveUids,
|
|
21
21
|
};
|
|
@@ -217,19 +217,13 @@ const Create = ({
|
|
|
217
217
|
geoFencing === true &&
|
|
218
218
|
(Platform.OS === 'android' || Platform.OS === 'ios')
|
|
219
219
|
) {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
//@ts-ignore
|
|
226
|
-
AreaCode.GLOB ^ AreaCode.CN,
|
|
227
|
-
);
|
|
228
|
-
}
|
|
220
|
+
engine.current = await RtcEngine.createWithAreaCode(
|
|
221
|
+
rtcProps.appId,
|
|
222
|
+
// eslint-disable-next-line no-bitwise
|
|
223
|
+
AreaCode.GLOB ^ AreaCode.CN,
|
|
224
|
+
);
|
|
229
225
|
} else {
|
|
230
|
-
|
|
231
|
-
engine.current = await RtcEngine.create(rtcProps.appId);
|
|
232
|
-
}
|
|
226
|
+
engine.current = await RtcEngine.create(rtcProps.appId);
|
|
233
227
|
}
|
|
234
228
|
/* Live Streaming */
|
|
235
229
|
if (mode == ChannelProfile.LiveBroadcasting) {
|
|
@@ -248,28 +242,24 @@ const Create = ({
|
|
|
248
242
|
await engine.current.enableAudioVolumeIndication(100, 3, true);
|
|
249
243
|
}
|
|
250
244
|
if (!audioRoom) {
|
|
251
|
-
if (rtcProps
|
|
245
|
+
if (rtcProps.profile) {
|
|
252
246
|
if (Platform.OS === 'web') {
|
|
253
247
|
// move this to bridge?
|
|
254
248
|
// @ts-ignore
|
|
255
249
|
await engine.current.setVideoProfile(rtcProps.profile);
|
|
256
250
|
} else {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
bitrate: 0,
|
|
264
|
-
});
|
|
265
|
-
}
|
|
251
|
+
const config: VideoEncoderConfiguration =
|
|
252
|
+
quality[rtcProps.profile];
|
|
253
|
+
await engine.current.setVideoEncoderConfiguration({
|
|
254
|
+
...config,
|
|
255
|
+
bitrate: 0,
|
|
256
|
+
});
|
|
266
257
|
}
|
|
267
258
|
}
|
|
268
259
|
} else {
|
|
269
260
|
//web will work even without audio profile
|
|
270
261
|
//but native need to set audio profile otherwise user will experience low audio issue
|
|
271
262
|
if (Platform.OS === 'android' || Platform.OS === 'ios') {
|
|
272
|
-
//@ts-ignore
|
|
273
263
|
await engine.current.setAudioProfile(
|
|
274
264
|
AudioProfile.Default,
|
|
275
265
|
AudioScenario.Default,
|
|
@@ -279,7 +269,6 @@ const Create = ({
|
|
|
279
269
|
//ref - https://docs.agora.io/en/help/integration-issues/profile_difference/#audio-route
|
|
280
270
|
//so setting into phone speaker manually as requested
|
|
281
271
|
if (mode == ChannelProfile.Communication) {
|
|
282
|
-
//@ts-ignore
|
|
283
272
|
await engine.current.setEnableSpeakerphone(true);
|
|
284
273
|
}
|
|
285
274
|
}
|
|
@@ -310,8 +299,8 @@ const Create = ({
|
|
|
310
299
|
'JoinChannelSuccess',
|
|
311
300
|
async (channel, uid, elapsed) => {
|
|
312
301
|
//Invoke the callback
|
|
313
|
-
console.log('UIkit enabling dual stream', rtcProps
|
|
314
|
-
if (rtcProps
|
|
302
|
+
console.log('UIkit enabling dual stream', rtcProps.dual);
|
|
303
|
+
if (rtcProps.dual) {
|
|
315
304
|
console.log('UIkit enabled dual stream');
|
|
316
305
|
await engine.current!.enableDualStreamMode(rtcProps.dual);
|
|
317
306
|
// await engine.current.setRemoteSubscribeFallbackOption(1);
|
|
@@ -323,14 +312,12 @@ const Create = ({
|
|
|
323
312
|
|
|
324
313
|
engine.current.addListener('UserJoined', async (...args) => {
|
|
325
314
|
// preventing STT pusher bot in renderlist
|
|
326
|
-
//@ts-ignore
|
|
327
315
|
if (args[0] === 111111) {
|
|
328
316
|
return;
|
|
329
317
|
}
|
|
330
318
|
//Get current peer IDs
|
|
331
319
|
dispatch({
|
|
332
320
|
type: 'UserJoined',
|
|
333
|
-
//@ts-ignore
|
|
334
321
|
value: args,
|
|
335
322
|
});
|
|
336
323
|
});
|
|
@@ -339,7 +326,6 @@ const Create = ({
|
|
|
339
326
|
//If user leaves
|
|
340
327
|
dispatch({
|
|
341
328
|
type: 'UserOffline',
|
|
342
|
-
//@ts-ignore
|
|
343
329
|
value: args,
|
|
344
330
|
});
|
|
345
331
|
});
|
|
@@ -347,7 +333,6 @@ const Create = ({
|
|
|
347
333
|
engine.current.addListener('RemoteAudioStateChanged', (...args) => {
|
|
348
334
|
dispatch({
|
|
349
335
|
type: 'RemoteAudioStateChanged',
|
|
350
|
-
//@ts-ignore
|
|
351
336
|
value: args,
|
|
352
337
|
});
|
|
353
338
|
});
|
|
@@ -359,7 +344,6 @@ const Create = ({
|
|
|
359
344
|
engine.current.addListener('RemoteVideoStateChanged', (...args) => {
|
|
360
345
|
dispatch({
|
|
361
346
|
type: 'RemoteVideoStateChanged',
|
|
362
|
-
//@ts-ignore
|
|
363
347
|
value: args,
|
|
364
348
|
});
|
|
365
349
|
});
|
|
@@ -48,7 +48,6 @@ const Join: React.FC<{
|
|
|
48
48
|
rtcProps.encryption.key &&
|
|
49
49
|
rtcProps.encryption.mode
|
|
50
50
|
) {
|
|
51
|
-
console.log('using channel encryption', rtcProps.encryption);
|
|
52
51
|
await engine.enableEncryption(true, {
|
|
53
52
|
encryptionKey: rtcProps.encryption.key,
|
|
54
53
|
encryptionMode: rtcProps.encryption.mode,
|
|
@@ -109,7 +108,6 @@ const Join: React.FC<{
|
|
|
109
108
|
await leave();
|
|
110
109
|
await join();
|
|
111
110
|
}
|
|
112
|
-
console.log('Attempted join: ', rtcProps.channel);
|
|
113
111
|
} else {
|
|
114
112
|
console.log('In precall - waiting to join');
|
|
115
113
|
}
|