@@ -3,8 +3,8 @@ import React, { useEffect, useRef, useState } from 'react';
3
3
4
4
import { getUserId } from '@/api/users' ;
5
5
import { useChannelActionStore } from '@/stores/channelAction' ;
6
- import { tokenAxios } from '@/utils/axios' ;
7
6
import { useUserInfoStore } from '@/stores/userInfo' ;
7
+ import { tokenAxios } from '@/utils/axios' ;
8
8
9
9
const SERVER_URL = import . meta. env . VITE_SIGNALING ;
10
10
@@ -124,6 +124,11 @@ const WebRTC = () => {
124
124
} ) ;
125
125
} ) ;
126
126
127
+ client . subscribe ( `/topic/removed/${ roomId } ` , ( message ) => {
128
+ const recentUsers = JSON . parse ( message . body ) ;
129
+ console . log ( 'recentUsers' , recentUsers ) ;
130
+ } ) ;
131
+
127
132
console . log ( `✅ 구독 성공 하였습니다.` ) ;
128
133
} ,
129
134
onDisconnect : ( ) => {
@@ -223,9 +228,9 @@ const WebRTC = () => {
223
228
} ;
224
229
225
230
// ✅ kurento ice 수집 요청
226
- const sendGetherIceCandidate = async ( ) => {
231
+ const sendGatherIceCandidate = async ( ) => {
227
232
if ( ! stompClient . current ) {
228
- alert ( 'gether STOMP WebSocket이 연결되지 않았습니다.' ) ;
233
+ alert ( 'gather STOMP WebSocket이 연결되지 않았습니다.' ) ;
229
234
return ;
230
235
}
231
236
@@ -235,15 +240,14 @@ const WebRTC = () => {
235
240
destination : '/gather/candidate' ,
236
241
body : JSON . stringify ( {
237
242
data : {
238
- // ✅ data 내부에 room_id 포함
239
243
room_id : roomId ,
240
244
} ,
241
245
} ) ,
242
246
} ) ;
243
247
244
248
sendIceCandidates ( ) ; // 🔥 SDP Answer 수신 후 ICE Candidate 전송
245
249
} catch ( error ) {
246
- console . error ( 'Gether 요청 실패:' , error ) ;
250
+ console . error ( 'gather 요청 실패:' , error ) ;
247
251
}
248
252
} ;
249
253
@@ -261,19 +265,8 @@ const WebRTC = () => {
261
265
} catch ( error ) {
262
266
console . error ( 'Answer 요청 실패:' , error ) ;
263
267
} finally {
264
- sendGetherIceCandidate ( ) ;
265
- // sendIceCandidates();
268
+ sendGatherIceCandidate ( ) ;
266
269
}
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
- } ) ) ;
277
270
} ;
278
271
279
272
// ✅ WebRTC Users 처리
0 commit comments