hide sendstream button on connection
Signed-off-by: heyhiru <hirentimbadiya74@gmail.com>
Este commit está contenido en:
@@ -11,6 +11,7 @@ const RoomPage = () => {
|
|||||||
const [isAudioMute, setIsAudioMute] = useState(false);
|
const [isAudioMute, setIsAudioMute] = useState(false);
|
||||||
const [isVideoOnHold, setIsVideoOnHold] = useState(false);
|
const [isVideoOnHold, setIsVideoOnHold] = useState(false);
|
||||||
const [callButton, setCallButton] = useState(true);
|
const [callButton, setCallButton] = useState(true);
|
||||||
|
const [isSendButtonVisible, setIsSendButtonVisible] = useState(true);
|
||||||
|
|
||||||
const handleUserJoined = useCallback(({ email, id }) => {
|
const handleUserJoined = useCallback(({ email, id }) => {
|
||||||
//! console.log(`Email ${email} joined the room!`);
|
//! console.log(`Email ${email} joined the room!`);
|
||||||
@@ -34,6 +35,7 @@ const RoomPage = () => {
|
|||||||
for (const track of myStream.getTracks()) {
|
for (const track of myStream.getTracks()) {
|
||||||
peer.peer.addTrack(track, myStream);
|
peer.peer.addTrack(track, myStream);
|
||||||
}
|
}
|
||||||
|
setIsSendButtonVisible(false);
|
||||||
}, [myStream]);
|
}, [myStream]);
|
||||||
|
|
||||||
const handleCallAccepted = useCallback(({ from, ans }) => {
|
const handleCallAccepted = useCallback(({ from, ans }) => {
|
||||||
@@ -195,7 +197,7 @@ const RoomPage = () => {
|
|||||||
<div className='flex flex-col items-center justify-center h-screen'>
|
<div className='flex flex-col items-center justify-center h-screen'>
|
||||||
<h1 className='font-bold text-7xl md:text-5xl p-3'>RoomPage</h1>
|
<h1 className='font-bold text-7xl md:text-5xl p-3'>RoomPage</h1>
|
||||||
<h4 className='font-bold text-4xl md:text-xl p-3 mb-4'>{remoteSocketId ? "Connected" : "No One In Room"}</h4>
|
<h4 className='font-bold text-4xl md:text-xl p-3 mb-4'>{remoteSocketId ? "Connected" : "No One In Room"}</h4>
|
||||||
{(myStream || remoteStream) &&
|
{(remoteStream && remoteSocketId && isSendButtonVisible) &&
|
||||||
<button className='bg-green-500 hover:bg-green-600' onClick={sendStreams}>
|
<button className='bg-green-500 hover:bg-green-600' onClick={sendStreams}>
|
||||||
Send Stream
|
Send Stream
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
Referencia en una nueva incidencia
Block a user