agora-appbuilder-core 2.0.0 → 2.0.1
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 +3 -2
- package/template/_package-lock.json +22850 -0
- package/template/agora-rn-uikit/.git/HEAD +1 -1
- package/template/agora-rn-uikit/.git/index +0 -0
- package/template/agora-rn-uikit/.git/logs/HEAD +2 -3
- package/template/agora-rn-uikit/.git/logs/refs/heads/ab-dev-auto +1 -1
- package/template/agora-rn-uikit/.git/logs/refs/heads/master +1 -1
- package/template/agora-rn-uikit/.git/logs/refs/remotes/origin/HEAD +1 -1
- package/template/agora-rn-uikit/.git/objects/pack/pack-f379286d0537eb68377220b4929979324b8d5d1c.idx +0 -0
- package/template/agora-rn-uikit/.git/objects/pack/{pack-19a65e0782e617d79275088a06e668496d6e2d73.pack → pack-f379286d0537eb68377220b4929979324b8d5d1c.pack} +0 -0
- package/template/agora-rn-uikit/.git/packed-refs +3 -2
- package/template/agora-rn-uikit/.git/refs/heads/ab-dev-auto +1 -1
- package/template/agora-rn-uikit/package.json +1 -0
- package/template/agora-rn-uikit/src/AgoraUIKit.tsx +8 -8
- package/template/agora-rn-uikit/src/{LocalUserContext.tsx → Contexts/LocalUserContext.tsx} +1 -1
- package/template/agora-rn-uikit/src/{MaxUidContext.tsx → Contexts/MaxUidContext.tsx} +0 -0
- package/template/agora-rn-uikit/src/{MinUidContext.tsx → Contexts/MinUidContext.tsx} +0 -0
- package/template/agora-rn-uikit/src/{PropsContext.tsx → Contexts/PropsContext.tsx} +34 -16
- package/template/agora-rn-uikit/src/{RtcContext.tsx → Contexts/RtcContext.tsx} +12 -21
- package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +25 -15
- package/template/agora-rn-uikit/src/Controls/Icons.ts +53 -3
- package/template/agora-rn-uikit/src/Controls/ImageIcon.tsx +53 -0
- package/template/agora-rn-uikit/src/Controls/Local/EndCall.tsx +4 -3
- package/template/agora-rn-uikit/src/Controls/Local/FullScreen.tsx +3 -3
- package/template/agora-rn-uikit/src/Controls/Local/LocalAudioMute.tsx +58 -14
- package/template/agora-rn-uikit/src/Controls/Local/LocalVideoMute.tsx +60 -14
- package/template/agora-rn-uikit/src/Controls/Local/Recording.tsx +2 -2
- package/template/agora-rn-uikit/src/Controls/Local/Screenshare.tsx +2 -2
- package/template/agora-rn-uikit/src/Controls/Local/SwitchCamera.tsx +9 -9
- package/template/agora-rn-uikit/src/Controls/LocalControls.tsx +20 -17
- package/template/agora-rn-uikit/src/Controls/Remote/RemoteAudioMute.tsx +8 -8
- package/template/agora-rn-uikit/src/Controls/Remote/RemoteSwap.tsx +3 -3
- package/template/agora-rn-uikit/src/Controls/Remote/RemoteVideoMute.tsx +13 -8
- package/template/agora-rn-uikit/src/Controls/RemoteControls.tsx +1 -2
- package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +20 -0
- package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +20 -0
- package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +26 -0
- package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +26 -0
- package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +46 -0
- package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +47 -0
- package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +20 -0
- package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +20 -0
- package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +21 -0
- package/template/agora-rn-uikit/src/Reducer/index.ts +9 -0
- package/template/agora-rn-uikit/src/Rtc/Create.tsx +138 -0
- package/template/agora-rn-uikit/src/Rtc/Join.tsx +100 -0
- package/template/agora-rn-uikit/src/RtcConfigure.tsx +197 -0
- package/template/agora-rn-uikit/src/Style.ts +3 -3
- package/template/agora-rn-uikit/src/Utils/actionTypeGuard.tsx +9 -0
- package/template/agora-rn-uikit/src/{events.ts → Utils/events.ts} +0 -0
- package/template/agora-rn-uikit/src/{permission.ts → Utils/permission.ts} +0 -0
- package/template/agora-rn-uikit/src/{quality.tsx → Utils/quality.tsx} +0 -0
- package/template/agora-rn-uikit/src/{MaxVideoView.native.tsx → Views/MaxVideoView.native.tsx} +3 -4
- package/template/agora-rn-uikit/src/{MaxVideoView.tsx → Views/MaxVideoView.tsx} +3 -4
- package/template/agora-rn-uikit/src/Views/MinVideoView.tsx +86 -0
- package/template/agora-rn-uikit/src/index.ts +67 -0
- package/template/bridge/rtc/webNg/RtcEngine.ts +23 -6
- package/template/package-lock.json +22850 -0
- package/template/package.json +6 -5
- package/template/src/assets/icons.ts +35 -6
- package/template/src/atoms/SecondaryButton.tsx +6 -5
- package/template/src/atoms/TextInput.tsx +6 -1
- package/template/src/components/Chat.tsx +50 -21
- package/template/src/components/ChatContext.ts +22 -1
- package/template/src/components/Controls.native.tsx +2 -2
- package/template/src/components/Controls.tsx +2 -2
- package/template/src/components/DeviceConfigure.tsx +1 -1
- package/template/src/components/GridVideo.tsx +69 -31
- package/template/src/components/Navbar.tsx +136 -113
- package/template/src/components/NetworkQualityContext.tsx +134 -0
- package/template/src/components/ParticipantsView.tsx +105 -49
- package/template/src/components/PinnedVideo.tsx +112 -71
- package/template/src/components/Precall.native.tsx +20 -9
- package/template/src/components/Precall.tsx +35 -32
- package/template/src/components/RTMConfigure.tsx +331 -181
- package/template/src/components/RTMEvents.tsx +84 -0
- package/template/src/components/Settings.tsx +19 -16
- package/template/src/components/Share.tsx +131 -62
- package/template/src/hooks/useImageDelay.tsx +28 -0
- package/template/src/pages/Create.tsx +9 -3
- package/template/src/pages/VideoCall.tsx +124 -98
- package/template/src/subComponents/ChatContainer.tsx +40 -28
- package/template/src/subComponents/CopyJoinInfo.tsx +9 -12
- package/template/src/subComponents/LocalAudioMute.tsx +9 -9
- package/template/src/subComponents/LocalVideoMute.tsx +9 -9
- package/template/src/subComponents/NetworkQualityPill.tsx +161 -0
- package/template/src/subComponents/Recording.tsx +12 -16
- package/template/src/subComponents/RemoteAudioMute.tsx +23 -27
- package/template/src/subComponents/RemoteEndCall.tsx +7 -15
- package/template/src/subComponents/RemoteVideoMute.tsx +15 -28
- package/template/src/subComponents/ScreenShareNotice.tsx +61 -0
- package/template/src/subComponents/ScreenshareButton.tsx +74 -75
- package/template/src/subComponents/SwitchCamera.tsx +5 -2
- package/template/src/subComponents/TextWithTooltip.native.tsx +128 -0
- package/template/src/subComponents/TextWithTooltip.tsx +44 -0
- package/template/src/subComponents/toastConfig.tsx +2 -2
- package/template/src/utils/isSafariBrowser.tsx +22 -0
- package/template/agora-rn-uikit/.git/objects/pack/pack-19a65e0782e617d79275088a06e668496d6e2d73.idx +0 -0
- package/template/agora-rn-uikit/Components.js +0 -35
- package/template/agora-rn-uikit/Contexts.js +0 -7
- package/template/agora-rn-uikit/index.js +0 -12
- package/template/agora-rn-uikit/src/MinVideoView.tsx +0 -87
- package/template/agora-rn-uikit/src/RTCConfigure.tsx +0 -520
|
@@ -28,7 +28,7 @@ import type {
|
|
|
28
28
|
RtcEngineEvents,
|
|
29
29
|
Subscription,
|
|
30
30
|
} from 'react-native-agora/lib/typescript/src/common/RtcEvents';
|
|
31
|
-
import {VideoProfile} from '../quality';
|
|
31
|
+
import { VideoProfile } from '../quality';
|
|
32
32
|
|
|
33
33
|
interface MediaDeviceInfo {
|
|
34
34
|
readonly deviceId: string;
|
|
@@ -150,6 +150,7 @@ export default class RtcEngine {
|
|
|
150
150
|
['ScreenshareStopped', () => null],
|
|
151
151
|
['RemoteAudioStateChanged', () => null],
|
|
152
152
|
['RemoteVideoStateChanged', () => null],
|
|
153
|
+
['NetworkQuality', () => null],
|
|
153
154
|
]);
|
|
154
155
|
public localStream: LocalStream = {};
|
|
155
156
|
public screenStream: ScreenStream = {};
|
|
@@ -221,7 +222,7 @@ export default class RtcEngine {
|
|
|
221
222
|
let [localAudio, localVideo] =
|
|
222
223
|
await AgoraRTC.createMicrophoneAndCameraTracks(
|
|
223
224
|
{},
|
|
224
|
-
{encoderConfig: this.videoProfile},
|
|
225
|
+
{ encoderConfig: this.videoProfile },
|
|
225
226
|
);
|
|
226
227
|
// localVideo.setEncoderConfiguration(this.videoProfile);
|
|
227
228
|
this.localStream.audio = localAudio;
|
|
@@ -366,7 +367,7 @@ export default class RtcEngine {
|
|
|
366
367
|
});
|
|
367
368
|
this.client.on('user-unpublished', async (user, mediaType) => {
|
|
368
369
|
if (mediaType === 'audio') {
|
|
369
|
-
const {audio, ...rest} = this.remoteStreams.get(user.uid);
|
|
370
|
+
const { audio, ...rest } = this.remoteStreams.get(user.uid);
|
|
370
371
|
this.remoteStreams.set(user.uid, rest);
|
|
371
372
|
(this.eventsMap.get('RemoteAudioStateChanged') as callbackType)(
|
|
372
373
|
user.uid,
|
|
@@ -375,7 +376,7 @@ export default class RtcEngine {
|
|
|
375
376
|
0,
|
|
376
377
|
);
|
|
377
378
|
} else {
|
|
378
|
-
const {video, ...rest} = this.remoteStreams.get(user.uid);
|
|
379
|
+
const { video, ...rest } = this.remoteStreams.get(user.uid);
|
|
379
380
|
this.remoteStreams.set(user.uid, rest);
|
|
380
381
|
(this.eventsMap.get('RemoteVideoStateChanged') as callbackType)(
|
|
381
382
|
user.uid,
|
|
@@ -387,9 +388,23 @@ export default class RtcEngine {
|
|
|
387
388
|
});
|
|
388
389
|
|
|
389
390
|
// this.client.on('stream-fallback', (evt))
|
|
390
|
-
this.client.on('stream-type-changed', function
|
|
391
|
+
this.client.on('stream-type-changed', function(uid, streamType) {
|
|
391
392
|
console.log('[fallback]: ', uid, streamType);
|
|
392
393
|
});
|
|
394
|
+
|
|
395
|
+
this.client.on('network-quality', async ({ downlinkNetworkQuality, uplinkNetworkQuality }) => {
|
|
396
|
+
const networkQualityIndicatorCallback = this.eventsMap.get('NetworkQuality') as callbackType;
|
|
397
|
+
|
|
398
|
+
networkQualityIndicatorCallback(0, downlinkNetworkQuality, uplinkNetworkQuality)
|
|
399
|
+
|
|
400
|
+
const remoteUserNetworkQualities = this.client.getRemoteNetworkQuality();
|
|
401
|
+
|
|
402
|
+
Object.keys(remoteUserNetworkQualities).forEach((uid) => {
|
|
403
|
+
networkQualityIndicatorCallback(uid, remoteUserNetworkQualities[uid].downlinkNetworkQuality, remoteUserNetworkQualities[uid].uplinkNetworkQuality)
|
|
404
|
+
})
|
|
405
|
+
|
|
406
|
+
})
|
|
407
|
+
|
|
393
408
|
await this.client.join(
|
|
394
409
|
this.appId,
|
|
395
410
|
channelName,
|
|
@@ -400,6 +415,7 @@ export default class RtcEngine {
|
|
|
400
415
|
await this.publish();
|
|
401
416
|
}
|
|
402
417
|
|
|
418
|
+
|
|
403
419
|
async leaveChannel(): Promise<void> {
|
|
404
420
|
this.client.leave();
|
|
405
421
|
this.remoteStreams.forEach((stream, uid, map) => {
|
|
@@ -419,7 +435,8 @@ export default class RtcEngine {
|
|
|
419
435
|
event === 'JoinChannelSuccess' ||
|
|
420
436
|
event === 'ScreenshareStopped' ||
|
|
421
437
|
event === 'RemoteAudioStateChanged' ||
|
|
422
|
-
event === 'RemoteVideoStateChanged'
|
|
438
|
+
event === 'RemoteVideoStateChanged' ||
|
|
439
|
+
event === 'NetworkQuality'
|
|
423
440
|
) {
|
|
424
441
|
this.eventsMap.set(event, listener as callbackType);
|
|
425
442
|
}
|