Comments (10)
Thanks for raising these issues @hyperbeans.
For the first issue with the Black bars, that is a scaling issue. The default is to contain
where the video scales down to fit the entire height/width video. You are looking to fit
the video where it scales up to fit the view. Please take a look at the documentation for Customising UI with StyleProps
For the second issue it sounds like the audience is joining as a host not an audience. Please take a look at the Customising functionality with RtcProps to ensure you are setting the roles correctly.
Communication mode is the default. To use live-streaming mode you can set the mode: mode.LiveBroadcasting in rtcProps. You can then select role: role.Audience or role:role.Broadcaster (mode and role are enums exported by the library).
from videouikit-reactnative.
Hello ,
Thanks for your response. I have added the code you shared, but it didn't work. Please check the attached screenshot for details.
Thanks
from videouikit-reactnative.
Hi @hyperbeans,
- Looking at your style code and diving deeper into the UIKit code, it appears that this mode is not available through the style props. To resolve the issue in the short term you will need to edit the Agora UIKit code directly.
- Open Views/MaxVideoView.tsx and on Line 36 change
RenderModeType.RenderModeFit
toRenderModeTypeRenderModeHidden
,
renderMode: RenderModeType.RenderModeHidden,
- In order to support you in resolving your issue regarding audience I need more information. Please share the code where you set the user role to
role: role.Audience
in theRtcProps
from videouikit-reactnative.
Hello,
thanks for your response we have also try below code please check
import React, { useEffect, useState } from "react";
import AgoraUIKit, { renderMode } from "agora-rn-uikit";
import {RenderModeType, RtcSurfaceView} from 'react-native-agora';
// import AgoraUIKit from 'agora-rn-uikit';
// {
// RtcLocalView,
// RtcRemoteView,
// AgoraUIKit,
// }
// RenderModeType, VideoRenderMode , {RenderModeType }
// import {RenderModeType} from 'react-native-agora';
import {
Text,
PermissionsAndroid,
Alert,
SafeAreaView,
View,
StyleSheet,
Dimensions,
} from "react-native";
const { width, height } = Dimensions.get("window");
const Videocall = ({ navigation }) => {
const [videoCall, setVideoCall] = useState(false);
const [buttonsState, setButtonState] = useState("flex");
const [remoteUsers, setRemoteUsers] = useState([]);
const [userCount, setUserCount] = useState(1);
const [isHost, setIsHost] = useState(true);
// const styleProps = {
// // usernameText: { padding: 10, right: 0 },
// // localBtnContainer: { display: buttonsState },
// // UIKitContainer: {height: '50%', width: '100%'}
// // renderMode:VideoRenderMode.Hidden,
// // videoMode:"fullscreen"
// };
const styleProps = {
RtcLocalView:
{
containerStyle: styles.localContainer,
videoStyle: styles.localVideo,
renderMode: RenderModeType.RenderModeHidden,
},
RtcRemoteView:
{
containerStyle: styles.remoteContainer,
videoStyle: styles.remoteVideo,
renderMode: RenderModeType.RenderModeHidden,
},
Button:
{
buttonStyle: styles.button,
textStyle: styles.buttonText,
iconStyle: styles.buttonIcon,
},
};
const props = {
connectionData: {
appId: "a23018a93",
channel: "agt",
layout: 0,
displayUsername: true,
username: "vikash",
role: isHost ? 1 : 2,
},
rtcCallbacks: {
EndCall: () => {
setVideoCall(false);
setRemoteUsers([]);
},
UserJoined: (uid, elapsed) => {
setRemoteUsers((prevUsers) => [...prevUsers, { uid, role: 2 }]);
setUserCount((prevCount) => prevCount + 1);
},
UserOffline: (uid, reason) => {
setRemoteUsers((prevUsers) =>
prevUsers.filter((user) => user.uid !== uid)
);
setUserCount((prevCount) => prevCount - 1);
},
},
};
useEffect(() => {
console.log('Remote Users:', remoteUsers);
console.log('Filtered Users:', filteredRemoteUsers);
}, [remoteUsers]);
const filteredRemoteUsers = isHost
? remoteUsers.filter((user) => user.role !== 2).map((user) => user.uid)
: remoteUsers.map((user) => user.uid);
return videoCall ? (
//
<AgoraUIKit
connectionData={props.connectionData}
rtcCallbacks={props.rtcCallbacks}
styleProps={styleProps}
videoPlaceholderProps={{ showButtons: false }}
remoteUsers={filteredRemoteUsers}
/>
Connected Users: {userCount}
//
) : (
<>
<Text
style={styles.startCallText}
onPress={() => {
setVideoCall(true);
setUserCount(1);
}}
>
Start Call
<Text
style={styles.LiveStreamText}
onPress={() => navigation.navigate("Livestream")}
>
{" "}
Live Stream
</Text>
<Text
style={styles.rtcStreamText}
onPress={() => navigation.navigate("Rtc")}
>
{" "}
RTC Stream
</Text>
</>
);
};
const styles = StyleSheet.create({
max: {
flex: 1,
},
fullView: {
width: width,
height: height,
},
fullView1: {
width: width,
height: height,
},
userCountText: {
position: "absolute",
top: 10,
left: 10,
color: "white",
fontSize: 16,
},
startCallText: {
marginTop: "10%",
textAlign: "center",
},
LiveStreamText: {
marginTop: "10%",
textAlign: "center",
},
rtcStreamText: {
marginTop: "10%",
textAlign: "center",
},
container:
{
flex: 1,
backgroundColor: '#fff',
},
localContainer:
{
position: 'absolute',
top: 10,
left: 10,
width: 100,
height: 150,
borderWidth: 1,
borderColor: 'black',
},
localVideo:
{
width: '100%',
height: '100%',
},
remoteContainer:
{
flex: 1,
},
remoteVideo:
{
width: '100%',
height: '100%',
},
button:
{
backgroundColor: '#007bff',
padding: 10,
borderRadius: 5,
},
buttonText:
{
color: '#fff',
fontSize: 16,
},
buttonIcon:
{
color: '#fff',
},
});
export default Videocall;
host ==1
audience ==2 use kiya h to run ho raha h but
when we use this role: role.Audience then my application was cursed
we have also try this
videoMode:{
max:RenderModeType.RenderModeHidden,
min:RenderModeType.RenderModeHidden,
},
from videouikit-reactnative.
The code you send above, which user is that for?
const [isHost, setIsHost] = useState(true);
this line sets the user to host which means they can broadcast into the channel.
RE: exported video call :
Could you please elaborate on use kiya h tor ho raha h
?
Re: videoMode:{ max:RenderModeType.RenderModeHidden, min:RenderModeType.RenderModeHidden, }
Where did you try this?
from videouikit-reactnative.
Hello ,
we have try below code please check
import React, { useEffect, useState } from "react";
import AgoraUIKit, { renderMode } from "agora-rn-uikit";
import {RenderModeType, RtcSurfaceView} from 'react-native-agora';
// import AgoraUIKit from 'agora-rn-uikit';
// {
// RtcLocalView,
// RtcRemoteView,
// AgoraUIKit,
// }
// RenderModeType, VideoRenderMode , {RenderModeType }
// import {RenderModeType} from 'react-native-agora';
import {
Text,
PermissionsAndroid,
Alert,
SafeAreaView,
View,
StyleSheet,
Dimensions,
} from "react-native";
const { width, height } = Dimensions.get("window");
const Videocall = ({ navigation }) => {
const [videoCall, setVideoCall] = useState(false);
const [buttonsState, setButtonState] = useState("flex");
const [remoteUsers, setRemoteUsers] = useState([]);
const [userCount, setUserCount] = useState(1);
const [isHost, setIsHost] = useState(true);
// const styleProps = {
// // usernameText: { padding: 10, right: 0 },
// // localBtnContainer: { display: buttonsState },
// // UIKitContainer: {height: '50%', width: '100%'}
// // renderMode:VideoRenderMode.Hidden,
// // videoMode:"fullscreen"
// };
const styleProps = {
videoMode:{
max:RenderModeType.RenderModeHidden,
min:RenderModeType.RenderModeHidden,
},
RtcLocalView:
{
containerStyle: styles.localContainer,
videoStyle: styles.localVideo,
renderMode: RenderModeType.RenderModeHidden,
},
RtcRemoteView:
{
containerStyle: styles.remoteContainer,
videoStyle: styles.remoteVideo,
renderMode: RenderModeType.RenderModeHidden,
},
Button:
{
buttonStyle: styles.button,
textStyle: styles.buttonText,
iconStyle: styles.buttonIcon,
},
};
const props = {
connectionData: {
appId: "a233f454a3f64ce19d6b480aaa018a93",
channel: "agoratest",
layout: 0,
displayUsername: true,
username: "vikash",
role: isHost ? 1 : 2,
},
rtcCallbacks: {
EndCall: () => {
setVideoCall(false);
setRemoteUsers([]);
},
UserJoined: (uid, elapsed) => {
setRemoteUsers((prevUsers) => [...prevUsers, { uid, role: 2 }]);
setUserCount((prevCount) => prevCount + 1);
},
UserOffline: (uid, reason) => {
setRemoteUsers((prevUsers) =>
prevUsers.filter((user) => user.uid !== uid)
);
setUserCount((prevCount) => prevCount - 1);
},
},
};
useEffect(() => {
console.log('Remote Users:', remoteUsers);
console.log('Filtered Users:', filteredRemoteUsers);
}, [remoteUsers]);
const filteredRemoteUsers = isHost
? remoteUsers.filter((user) => user.role !== 2).map((user) => user.uid)
: remoteUsers.map((user) => user.uid);
return videoCall ? (
//
<AgoraUIKit
connectionData={props.connectionData}
rtcCallbacks={props.rtcCallbacks}
styleProps={styleProps}
videoPlaceholderProps={{ showButtons: false }}
remoteUsers={filteredRemoteUsers}
/>
Connected Users: {userCount}
//
) : (
<>
<Text
style={styles.startCallText}
onPress={() => {
setVideoCall(true);
setUserCount(1);
}}
>
Start Call
<Text
style={styles.LiveStreamText}
onPress={() => navigation.navigate("Livestream")}
>
{" "}
Live Stream
</Text>
<Text
style={styles.rtcStreamText}
onPress={() => navigation.navigate("Rtc")}
>
{" "}
RTC Stream
</Text>
</>
);
};
const styles = StyleSheet.create({
max: {
flex: 1,
},
fullView: {
width: width,
height: height,
},
fullView1: {
width: width,
height: height,
},
userCountText: {
position: "absolute",
top: 10,
left: 10,
color: "white",
fontSize: 16,
},
startCallText: {
marginTop: "10%",
textAlign: "center",
},
LiveStreamText: {
marginTop: "10%",
textAlign: "center",
},
rtcStreamText: {
marginTop: "10%",
textAlign: "center",
},
container:
{
flex: 1,
backgroundColor: '#fff',
},
localContainer:
{
position: 'absolute',
top: 10,
left: 10,
width: 100,
height: 150,
borderWidth: 1,
borderColor: 'black',
},
localVideo:
{
width: '100%',
height: '100%',
},
remoteContainer:
{
flex: 1,
},
remoteVideo:
{
width: '100%',
height: '100%',
},
button:
{
backgroundColor: '#007bff',
padding: 10,
borderRadius: 5,
},
buttonText:
{
color: '#fff',
fontSize: 16,
},
buttonIcon:
{
color: '#fff',
},
});
export default Videocall;
from videouikit-reactnative.
The code you send above, which user is that for?
const [isHost, setIsHost] = useState(true);
this line sets the user to host which means they can broadcast into the channel.
answer:- User is broadcaster, We are trying in our team only, I am hosting & my frined is receiving it.
RE: exported video call :
Could you please elaborate on use kiya h tor ho raha h ?
Re: videoMode:{ max:RenderModeType.RenderModeHidden, min:RenderModeType.RenderModeHidden, }
answer :- It is used in RTC localview & RTC remote view.
Where did you try this?
answer:- It is used in the style props but nothing changes, still black spaces are coming.
from videouikit-reactnative.
If you tried my suggestions and are still not getting the desired result then I will need to have a look at more of the code (in context). Are you able to add me to the repo?
from videouikit-reactnative.
Hi,
you can access the code from below repo
https://github.com/hyperbeans/agora_demo.git
thank you
from videouikit-reactnative.
Hello @digitallysavvy
These issues have been pending for a very long time, and we have not received any updates from your end. We have tried all the solutions you suggested, but we are still facing issues. Could you please provide an estimated timeline for when these issues will be resolved?
from videouikit-reactnative.
Related Issues (20)
- 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?
- Invariant Violation: "main" has not been registered
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.