11"use client" ;
22
3- import React , { useEffect , useRef } from "react" ;
3+ import React , { useEffect , useRef , useState } from "react" ;
44import { api } from "@/apis" ;
55import NextButton from "@/components/common/NextButton" ;
66import { useUserIdStore } from "@/store/useUserIdStore" ;
7+ import { useStore } from "@/store/useStore" ;
78
89const RealTimeVideoPage = ( ) => {
910 const { userId } = useUserIdStore ( ) ;
@@ -15,10 +16,10 @@ const RealTimeVideoPage = () => {
1516 // WebSocket 연결 설정
1617 const setupWebSocket = ( ) => {
1718 // TODO: 웹소캣 서버
19+ console . log ( userId ) ;
1820 const socket = new WebSocket (
19- // "ws://43.201.224.93:8000/ws/1"
2021 // `${process.env.NEXT_PUBLIC_WEBSOCKET_KEY}/${userId}`
21- `ws ://43.201.224.93:8000 /ws/${ userId } `
22+ `wss ://43.201.224.93.nip.io /ws/${ userId } `
2223 ) ;
2324 socket . onopen = ( ) => {
2425 console . log ( "WebSocket 연결 성공" ) ;
@@ -48,7 +49,8 @@ const RealTimeVideoPage = () => {
4849 }
4950 } ;
5051
51- // 시작 시점에 API 호출
52+ // 시작 시점에 API 호출 - 추후 추가 예정
53+ /*
5254 const callStartRecordingApi = async () => {
5355 // JSON 데이터 생성
5456 const examData = {
@@ -64,7 +66,7 @@ const RealTimeVideoPage = () => {
6466 console.error("시작 API 호출 실패:", error);
6567 }
6668 };
67-
69+ */
6870 // Canvas를 사용해 비디오 프레임을 WebSocket으로 전송
6971 const captureAndSendFrame = ( ) => {
7072 if (
@@ -99,7 +101,7 @@ const RealTimeVideoPage = () => {
99101 // 초기화 작업: WebSocket 연결, 비디오 스트리밍 시작, 시작 API 호출
100102 useEffect ( ( ) => {
101103 const initialize = async ( ) => {
102- await callStartRecordingApi ( ) ; // 시작 API 호출
104+ // await callStartRecordingApi(); // 시작 API 호출
103105 setupWebSocket ( ) ;
104106 await startStreaming ( ) ;
105107
0 commit comments