Skip to content

Instantly share code, notes, and snippets.

@MHDYousuf
Created April 8, 2020 08:06
Show Gist options
  • Save MHDYousuf/9faceb3d70621f46d623381ef3d4cc16 to your computer and use it in GitHub Desktop.
Save MHDYousuf/9faceb3d70621f46d623381ef3d4cc16 to your computer and use it in GitHub Desktop.
ui for video calling
.container {
margin: 10px;
padding: 10px;
text-align: center;
}
.container input {
display: block;
text-align: center;
margin: 0.5em auto;
padding: 0.5em;
}
.stream {
width: 480px;
height: 320px;
}
function App() {
const [joined, setJoined] = useState(false);
const channelRef = useRef("");
const remoteRef = useRef("");
const leaveRef = useRef("");
return (
<>
<div className="container">
<input
type="text"
ref={channelRef}
id="channel"
placeholder="Enter Channel name"
/>
<input
type="submit"
value="Join"
onClick={handleSubmit}
disabled={joined ? true : false}
/>
<input
type="button"
ref={leaveRef}
value="Leave"
onClick={handleLeave}
disabled={joined ? false : true}
/>
</div>
{joined ? (
<>
<div id="local-stream" className="stream local-stream"></div>
<div
id="remote-stream"
ref={remoteRef}
className="stream remote-stream"
></div>
</>
) : null}
</>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment