Classroom Videoplayer kısımları düzeltildi
This commit is contained in:
parent
25da8570e0
commit
04b57e6a92
1 changed files with 3 additions and 5 deletions
|
|
@ -301,18 +301,16 @@ const RoomDetail: React.FC = () => {
|
||||||
|
|
||||||
if (webRTCServiceRef.current) {
|
if (webRTCServiceRef.current) {
|
||||||
for (const p of existing) {
|
for (const p of existing) {
|
||||||
// Peer connection oluştur
|
await webRTCServiceRef.current.createPeerConnection(p.userId)
|
||||||
await webRTCServiceRef.current?.createPeerConnection(p.userId)
|
|
||||||
|
|
||||||
// Eğer ben öğretmensem → herkese offer gönder
|
// ✅ Eğer ben öğrenci isem → mevcut öğretmene offer gönderirim
|
||||||
if (user.role === 'teacher') {
|
if (user.role === 'student' && p.isTeacher) {
|
||||||
const offer = await webRTCServiceRef.current.createOffer(p.userId)
|
const offer = await webRTCServiceRef.current.createOffer(p.userId)
|
||||||
await signalRServiceRef.current?.sendOffer(classSession.id, p.userId, offer)
|
await signalRServiceRef.current?.sendOffer(classSession.id, p.userId, offer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// State güncelle
|
|
||||||
setParticipants((prev) => [
|
setParticipants((prev) => [
|
||||||
...prev,
|
...prev,
|
||||||
...existing.map((p) => ({
|
...existing.map((p) => ({
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue