直播:转发音频、观众 recv audio、全屏与开声音按钮、后台采集麦克风

Made-with: Cursor
This commit is contained in:
whm
2026-03-26 09:55:27 +08:00
parent 2295410e1b
commit 6b3210f714
5 changed files with 86 additions and 16 deletions

View File

@@ -146,8 +146,7 @@ func (h *Hub) removeViewer(id string) {
}
func (h *Hub) onPublisherTrack(track *webrtc.TrackRemote) {
// 仅转发视频轨,降低协商复杂度
if track.Kind() != webrtc.RTPCodecTypeVideo {
if track.Kind() != webrtc.RTPCodecTypeVideo && track.Kind() != webrtc.RTPCodecTypeAudio {
return
}
tf := newTrackForwarder(track)