From c982bd39f4ef9efef62b8e73e2ddf1fdf1bfcd6a Mon Sep 17 00:00:00 2001 From: langhuihui <178529795@qq.com> Date: Sun, 8 Oct 2023 13:01:51 +0800 Subject: [PATCH] fix: setTracks filter media --- publisher.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/publisher.go b/publisher.go index 6114f52..59109de 100644 --- a/publisher.go +++ b/publisher.go @@ -27,6 +27,9 @@ func (p *RTSPPublisher) OnEvent(event any) { func (p *RTSPPublisher) setTracks() { for _, m := range p.Conn.Medias { + if m.Direction != core.DirectionRecvonly { + continue + } for _, c := range m.Codecs { var handler core.HandlerFunc switch c.Name {