直播:画质可选、只读 /live/info、弹幕 WS 透传;Nginx 弹幕路径

Made-with: Cursor
This commit is contained in:
whm
2026-03-26 10:07:49 +08:00
parent 6b3210f714
commit 106e6e1f16
11 changed files with 417 additions and 8 deletions

View File

@@ -77,7 +77,9 @@ type Hub struct {
publishConn *websocket.Conn
pubPC *webrtc.PeerConnection
forwarders []*trackForwarder
// 开播 WebSocket 上 quality= 参数,供 GET /live/info 只读输出
publishQuality string
forwarders []*trackForwarder
viewers map[string]*viewerSession
}
@@ -128,6 +130,7 @@ func (h *Hub) clearPublisher() {
h.pubPC = nil
}
h.publishConn = nil
h.publishQuality = ""
}
func (h *Hub) removeViewer(id string) {