fix xem nhieu video
All checks were successful
Deploy on Master Change / deploy (push) Successful in 47s
All checks were successful
Deploy on Master Change / deploy (push) Successful in 47s
This commit is contained in:
@@ -106,6 +106,11 @@ func (h *WsHub) Register(c *SocketClient) {
|
||||
if c.Role == "student" {
|
||||
h.students[c.StudentID] = c
|
||||
log.Printf("[WS] Student %d registered (Address: %s, Class: %d)", c.StudentID, c.Addr, c.ClassID)
|
||||
if subs, exists := h.subscribers[c.StudentID]; exists && len(subs) > 0 {
|
||||
_ = c.Conn.WriteJSON(SocketMsg{Event: "start_screenshot_stream"})
|
||||
_ = c.Conn.WriteJSON(SocketMsg{Event: "start_webcam_stream"})
|
||||
log.Printf("[WS] Student %d has active subscribers. Sent start stream commands.", c.StudentID)
|
||||
}
|
||||
} else if c.Role == "teacher" {
|
||||
h.teachers[c.Addr] = c
|
||||
if c.StaffID > 0 {
|
||||
|
||||
Reference in New Issue
Block a user