Comments (7)
can you share a code snippet?
from videouikit-reactnative.
@EkaanshArora I have been facing issues customizing design view with the default import of the package, So, I used separate components to customize the design accordingly to requirements. Everything is working fine except some callbacks.
Working callbacks are EndCall, UserJoined, UserOffline. But UserMuteVideo,RemoteVideoStateChanged and UserEnableVideo are not triggered when the remote user is pausing/resuming the video.
You can see the code snippet in other comment.
from videouikit-reactnative.
const props = {
rtcProps: {
appId: config.appId,
layout: 1, //pinned layout
channel: roomId ? roomId.toString() : null,
},
callbacks: {
EndCall: () => handleEndCall(),
Warning: (warning) => console.log('WARNING:::', warning),
Error: (error) => console.log('ERROR:::', error),
ConnectionStateChanged: (e) => console.log('CONNECTION STATE CHANGED:::', e),
JoinChannelSuccess: (e) => console.log('JOIN CHANNEL SUCCESS:::', e),
RtcStats: (e) => console.log('RTC STATS:::', e),
ConnectionBanned: () => console.log('CONNECTION BANNED'),
ConnectionInterrupted: () => console.log('CONNECTION INTERRUPTED'),
RequestToken: () => console.log('REQUEST TOKEN'),
TokenPrivilegeWillExpire: () => console.log('TOKEN PRIVILEGE WILL EXPIRE'),
ConnectionLost: () => console.log('CONNECTION LOST'),
ApiCallExecuted: () => console.log('API CALL EXECUTED'),
UserJoined: () => handleStartCall(),
UserOffline: () => callEnded(),
UserMuteVideo: (uid, muted) => console.log({ uid, muted }),
RemoteVideoStateChanged: (uid, state, reason, elapsed) => console.log({ uid, state, reason, elapsed }),
UserEnableVideo: (uid, enabled) => console.log({ uid, enabled }),
},
};
<PropsProvider value={props}>
<View style={{ flex: 1 }}>
{showEndCallAnimation && (
<Image
source={require('@assets/img/VideoToNoVideoTransition.gif')}
style={styles.animatedAbsoluteContainerView}
/>
)}
<PermissionModal
showPermissionsModal={showPermissionsModal}
setShowPermissionsModal={setShowPermissionsModal}
/>
<CallStatus callConnected={callConnected.current} />
<View style={{ flex: 1 }}>
<RtcConfigure>
<QuestionnaireModal questions={questions} />
{showQuestionPopup && <QuestionPopUp questions={questions} />}
<MaxUidConsumer>
{(maxUsers) => (maxUsers[0] ? <MaxVideoView user={maxUsers[0]} key={maxUsers[0].uid} /> : null)}
</MaxUidConsumer>
<View style={styles.videoContainer}>
<MinUidConsumer>
{(minUsers) =>
minUsers.map((user) =>
user.video ? (
<>
<MinVideoView user={user} key={user.uid} />
<LocalUserContextComponent>
<SwitchCamera />
</LocalUserContextComponent>
</>
) : (
<View
style={{
width: 120,
height: 200,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#161C24',
}}>
<Image
source={{
uri: authUser?.profile?.photos?.length
? authUser?.profile?.photos[0]
: DEFAULT_PROFILE_IMAGE,
}}
resizeMode='cover'
style={{ height: 75, width: 75, borderRadius: 100 }}
/>
<LocalUserContextComponent>
<SwitchCamera />
</LocalUserContextComponent>
</View>
)
)
}
</MinUidConsumer>
</View>
<LocalControls />
</RtcConfigure>
</View>
<View style={styles.parent}>
<View style={styles.innerChild1}>
<Image
source={{ uri: receiverImage }}
resizeMode='cover'
style={{ height: 30, width: 30, borderRadius: 15 }}
/>
<Text style={styles.innerChild1Text}>{receiverName && age ? `${receiverName}, ${age}` : ''}</Text>
</View>
{callConnected.current && roomData && mixerId ? (
<View style={styles.innerChild2}>
<ProgressBar stopCallAutomatically={handleEndCall} roomData={roomData} />
</View>
) : (
<ActivityIndicator color={'#281E48'} size={30} />
)}
</View>
</View>
</PropsProvider>
from videouikit-reactnative.
This looks like a bug, Iām out of office so I can try and fix this next week. In the meantime you can access the engine from the RtcContext and attach the event listener manually.
from videouikit-reactnative.
@EkaanshArora Can you share any example for How can I attach a listener manually from RtcContext?
from videouikit-reactnative.
@EkaanshArora Can you share any update or steps so that I can use RTC event in my application?
from videouikit-reactnative.
You can look at this file for an example of how to access the rtcEngine.
Here's a snippet to listen for an event:
function AddEvent() {
const {RtcEngine} = useContext(RtcContext);
useEffect(()=>{
RtcEngine.addListener('RemoteVideoStateChanged', (uid, state, reason, elapsed) => {
// do things
})
},[])
return null
}
// render it in your tree
...
<AddEvent />
</MinUidConsumer>
</View>
I'll try and fix this in the coming week, so you can just use the callbacks object.
from videouikit-reactnative.
Related Issues (20)
- [Question] - How to move the minView container towards left or right in landscape mode when using pinned layout? HOT 1
- Support for react-native-agora 4.0.0 HOT 1
- Crash when tearing down AgoraUIKit component HOT 3
- Min view container (own camera preview) UI Issue HOT 2
- Screen Share HOT 3
- Other users cannot Join video stream with token gotten from agora-web-services such as Render & Railway. Only displaying a video screen. HOT 1
- Receiver User immediate offline after Join HOT 2
- How to show audio only when call gets started? HOT 1
- Quick start example not working react-native 0.7 HOT 4
- `new NativeEventEmitter()` was called with a non-null argument without the required `addListener` method. HOT 4
- Error when ending call HOT 1
- layout is not changing. HOT 1
- How to make a voice call using Agora.io in react native? HOT 2
- Import EndCall, MuteAudio, MuteVideo functions HOT 2
- Customizing style HOT 2
- unable to start rtm CHANNEL_MESSAGE_ERR_USER_NOT_LOGGED_IN HOT 7
- onUserJoined callback not working? HOT 1
- RtmToken is not used in RtmConfigure.tsx file in LoginV2 function
- 'connection-state-change' as React UI Kit HOT 1
- By using this package, I integrated the audio functionality. However, the voice is currently coming through the speaker. How can we enable the audio to use the earpiece instead?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from videouikit-reactnative.