Skip to content

Commit

Permalink
Store users' names under video tags
Browse files Browse the repository at this point in the history
  • Loading branch information
JANKROL123 committed Mar 1, 2024
1 parent 9005977 commit dfa2f68
Showing 1 changed file with 30 additions and 23 deletions.
53 changes: 30 additions & 23 deletions frontend/src/pages/VideoCallPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faPhoneSlash, faMicrophone, faMicrophoneSlash, faVideo, faVideoSlash } from "@fortawesome/free-solid-svg-icons";

function VideoCallPage() {
const { userId, socket, meeting, leaveMeeting } = useUser();
const { user, userId, socket, meeting, leaveMeeting } = useUser();
const [stream, setStream] = useState<MediaStream | null>(null);
const firstRefresh = useRef<boolean>(true);
const navigate = useNavigate();
Expand Down Expand Up @@ -115,7 +115,6 @@ function VideoCallPage() {
const peerConnection = getPeerConnection();
if (!peerConnection) return;

console.log("SOCKET: description");
const offerCollision =
description.type === "offer" &&
(makingOffer || peerConnection.signalingState !== "stable");
Expand All @@ -135,7 +134,6 @@ function VideoCallPage() {
const peerConnection = getPeerConnection();
if (!peerConnection) return;

console.log("SOCKET: iceCandidate");
try {
await peerConnection.addIceCandidate(candidate);
} catch (err) {
Expand Down Expand Up @@ -196,27 +194,36 @@ function VideoCallPage() {
playsInline
></video>
</div>
<div className="flex">
<span className="flex-1 text-center">{user?.first_name+" "+user?.last_name}</span>
<span className="flex-1 text-center"></span>
</div>
</div>
<div className=" flex justify-center">
<button className="btn p-6" onClick={startStopAudio}>
{audio
? <FontAwesomeIcon icon={faMicrophone} />
: <FontAwesomeIcon icon={faMicrophoneSlash} />
}
</button>
<button className="btn p-6" onClick={startStopVideo}>
{video
? <FontAwesomeIcon icon={faVideo} />
: <FontAwesomeIcon icon={faVideoSlash} />
}
</button>
<button
onClick={() => handleLeaveMeeting()}
className="btn bg-my-red p-6"
>
<FontAwesomeIcon icon={faPhoneSlash}></FontAwesomeIcon>
<span className="ml-2">Leave</span>
</button>
<div className="flex px-10">
<div className="flex-1"></div>
<div className="flex flex-1 justify-center">
<button className="btn p-6" onClick={startStopAudio}>
{audio
? <FontAwesomeIcon icon={faMicrophone} />
: <FontAwesomeIcon icon={faMicrophoneSlash} />
}
</button>
<button className="btn p-6" onClick={startStopVideo}>
{video
? <FontAwesomeIcon icon={faVideo} />
: <FontAwesomeIcon icon={faVideoSlash} />
}
</button>
</div>
<div className="flex flex-1 justify-end">
<button
onClick={() => handleLeaveMeeting()}
className="btn bg-my-red p-6"
>
<FontAwesomeIcon icon={faPhoneSlash}></FontAwesomeIcon>
<span className="ml-2">Leave</span>
</button>
</div>
</div>
<Footer />
</>
Expand Down

0 comments on commit dfa2f68

Please sign in to comment.