直播:画质可选、只读 /live/info、弹幕 WS 透传;Nginx 弹幕路径
Made-with: Cursor
This commit is contained in:
@@ -32,7 +32,9 @@ type wsEnvelope struct {
|
||||
|
||||
func RegisterRoutes(r gin.IRoutes) {
|
||||
r.GET("/live/status", handleLiveStatus)
|
||||
r.GET("/live/info", handleLiveInfo)
|
||||
r.GET("/live/ws", handleLiveWS)
|
||||
r.GET("/live/danmaku/ws", handleDanmakuWS)
|
||||
}
|
||||
|
||||
func handleLiveStatus(c *gin.Context) {
|
||||
@@ -90,12 +92,14 @@ func handlePublisherWS(c *gin.Context, h *Hub) {
|
||||
return
|
||||
}
|
||||
h.publishConn = ws
|
||||
h.publishQuality = normalizeQuality(c.Query("quality"))
|
||||
h.mu.Unlock()
|
||||
|
||||
pc, err := h.api.NewPeerConnection(h.cfg)
|
||||
if err != nil {
|
||||
h.mu.Lock()
|
||||
h.publishConn = nil
|
||||
h.publishQuality = ""
|
||||
h.mu.Unlock()
|
||||
_ = ws.Close()
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user