直播:status 返回观看人数,后台开播页轮询展示
Made-with: Cursor
This commit is contained in:
@@ -45,8 +45,9 @@ func handleLiveStatus(c *gin.Context) {
|
||||
}
|
||||
h.mu.RLock()
|
||||
live := h.publishConn != nil && h.pubPC != nil && len(h.forwarders) > 0
|
||||
viewers := len(h.viewers)
|
||||
h.mu.RUnlock()
|
||||
c.JSON(http.StatusOK, gin.H{"live": live})
|
||||
c.JSON(http.StatusOK, gin.H{"live": live, "viewers": viewers})
|
||||
}
|
||||
|
||||
func handleLiveWS(c *gin.Context) {
|
||||
|
||||
Reference in New Issue
Block a user