@@ -8,22 +8,23 @@ import { useStore } from "@/store/useStore";
88const RealTimeVideoPage = ( ) => {
99 // 수험자 실시간 화면이 담기는 공간
1010 const videoRef = useRef < HTMLVideoElement > ( null ) ;
11+
1112 // 캠버스에서 프레임을 캡쳐
1213 const canvasRef = useRef < HTMLCanvasElement > ( null ) ;
1314
1415 // 웹소켓 연결 관리
1516 const socketRef = useRef < WebSocket | null > ( null ) ;
17+
1618 // 실시간 비디오 녹화
1719 const mediaRecorderRef = useRef < MediaRecorder | null > ( null ) ;
20+
1821 // 미디어 스트림을 저장
1922 const streamRef = useRef < MediaStream | null > ( null ) ;
2023
2124 // 녹화된 비디오 데이터를 청크 단위로 저장
2225 const recordedChunksRef = useRef < Blob [ ] > ( [ ] ) ;
2326 const captureIntervalRef = useRef < number | null > ( null ) ;
2427
25- const [ isProcessing , setIsProcessing ] = useState ( false ) ;
26-
2728 const userId = useStore ( useUserStore , ( state ) => state . userId ) ;
2829 const examId = useStore ( useUserStore , ( state ) => state . examId ) ;
2930
@@ -120,8 +121,6 @@ const RealTimeVideoPage = () => {
120121
121122 const startRecordingForCheating = async ( ) => {
122123 try {
123- setIsProcessing ( true ) ;
124-
125124 // 이미 녹화 중이면 기존 녹화 중지
126125 if ( mediaRecorderRef . current ) {
127126 mediaRecorderRef . current . stop ( ) ;
@@ -138,11 +137,9 @@ const RealTimeVideoPage = () => {
138137 if ( mediaRecorderRef . current ) {
139138 mediaRecorderRef . current . stop ( ) ;
140139 }
141- setIsProcessing ( false ) ;
142140 } , 5000 ) ;
143141 } catch ( error ) {
144142 console . error ( "부정행위 이벤트 처리 중 오류" , error ) ;
145- setIsProcessing ( false ) ;
146143 }
147144 } ;
148145
0 commit comments