Commit 9b414a1a authored by Kim, Chaerin's avatar Kim, Chaerin
Browse files

시연2

parent 8ae18a67
...@@ -9,6 +9,7 @@ const Screen = () => { ...@@ -9,6 +9,7 @@ const Screen = () => {
const [socket, setSocket] = useState(null); const [socket, setSocket] = useState(null);
const [users, setUsers] = useState([]); const [users, setUsers] = useState([]);
const { roomId, channelId } = useParams(); const { roomId, channelId } = useParams();
const url = `${roomId}/${channelId}`;
const user = "00"; const user = "00";
let localVideoRef = useRef(null); let localVideoRef = useRef(null);
...@@ -118,7 +119,7 @@ const Screen = () => { ...@@ -118,7 +119,7 @@ const Screen = () => {
newSocket.emit("joinRoom", { newSocket.emit("joinRoom", {
id: newSocket.id, id: newSocket.id,
roomID: roomId, roomID: url,
}); });
}) })
.catch((error) => { .catch((error) => {
...@@ -148,7 +149,7 @@ const Screen = () => { ...@@ -148,7 +149,7 @@ const Screen = () => {
newSocket.emit("senderOffer", { newSocket.emit("senderOffer", {
sdp, sdp,
senderSocketID: newSocket.id, senderSocketID: newSocket.id,
roomID: roomId, roomID: url,
}); });
} catch (error) { } catch (error) {
console.log(error); console.log(error);
...@@ -168,7 +169,7 @@ const Screen = () => { ...@@ -168,7 +169,7 @@ const Screen = () => {
sdp, sdp,
receiverSocketID: newSocket.id, receiverSocketID: newSocket.id,
senderSocketID, senderSocketID,
roomID: roomId, roomID: url,
}); });
} catch (error) { } catch (error) {
console.log(error); console.log(error);
......
...@@ -2,6 +2,7 @@ import axios from 'axios' ...@@ -2,6 +2,7 @@ import axios from 'axios'
export function handleLogin(userId) { export function handleLogin(userId) {
sessionStorage.setItem("user", userId) sessionStorage.setItem("user", userId)
localStorage.setItem("user", userId)
} }
export async function handleLogout() { export async function handleLogout() {
......
...@@ -14,7 +14,7 @@ const INIT_PROFILE = { ...@@ -14,7 +14,7 @@ const INIT_PROFILE = {
const InvitePage = () => { const InvitePage = () => {
const [profile, setProfile] = useState([INIT_PROFILE]); const [profile, setProfile] = useState([INIT_PROFILE]);
const [error, setError] = useState(""); const [error, setError] = useState("");
const usercheck = sessionStorage.getItem("user"); const usercheck = localStorage.getItem("user");
const { roomId } = useParams(); const { roomId } = useParams();
async function getProfile(userID) { async function getProfile(userID) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment