@@ -3,8 +3,8 @@ import React, { useEffect, useRef, useState } from 'react';
33
44import { getUserId } from '@/api/users' ;
55import { useChannelActionStore } from '@/stores/channelAction' ;
6- import { tokenAxios } from '@/utils/axios' ;
76import { useUserInfoStore } from '@/stores/userInfo' ;
7+ import { tokenAxios } from '@/utils/axios' ;
88
99const SERVER_URL = import . meta. env . VITE_SIGNALING ;
1010
@@ -124,6 +124,11 @@ const WebRTC = () => {
124124 } ) ;
125125 } ) ;
126126
127+ client . subscribe ( `/topic/removed/${ roomId } ` , ( message ) => {
128+ const recentUsers = JSON . parse ( message . body ) ;
129+ console . log ( 'recentUsers' , recentUsers ) ;
130+ } ) ;
131+
127132 console . log ( `✅ 구독 성공 하였습니다.` ) ;
128133 } ,
129134 onDisconnect : ( ) => {
@@ -223,9 +228,9 @@ const WebRTC = () => {
223228 } ;
224229
225230 // ✅ kurento ice 수집 요청
226- const sendGetherIceCandidate = async ( ) => {
231+ const sendGatherIceCandidate = async ( ) => {
227232 if ( ! stompClient . current ) {
228- alert ( 'gether STOMP WebSocket이 연결되지 않았습니다.' ) ;
233+ alert ( 'gather STOMP WebSocket이 연결되지 않았습니다.' ) ;
229234 return ;
230235 }
231236
@@ -235,15 +240,14 @@ const WebRTC = () => {
235240 destination : '/gather/candidate' ,
236241 body : JSON . stringify ( {
237242 data : {
238- // ✅ data 내부에 room_id 포함
239243 room_id : roomId ,
240244 } ,
241245 } ) ,
242246 } ) ;
243247
244248 sendIceCandidates ( ) ; // 🔥 SDP Answer 수신 후 ICE Candidate 전송
245249 } catch ( error ) {
246- console . error ( 'Gether 요청 실패:' , error ) ;
250+ console . error ( 'gather 요청 실패:' , error ) ;
247251 }
248252 } ;
249253
@@ -261,19 +265,8 @@ const WebRTC = () => {
261265 } catch ( error ) {
262266 console . error ( 'Answer 요청 실패:' , error ) ;
263267 } finally {
264- sendGetherIceCandidate ( ) ;
265- // sendIceCandidates();
268+ sendGatherIceCandidate ( ) ;
266269 }
267-
268- // sendGetherIceCandidate();
269- } ;
270-
271- // 예시: 특정 사용자(userId)의 remote stream을 업데이트
272- const handleRemoteStream = ( userId : string , stream : MediaStream ) => {
273- setRemoteStreams ( ( prev ) => ( {
274- ...prev ,
275- [ userId ] : stream ,
276- } ) ) ;
277270 } ;
278271
279272 // ✅ WebRTC Users 처리
0 commit comments