feat: add push regexp config

This commit is contained in:
langhuihui
2023-11-10 18:17:02 +08:00
parent c0c7577ab1
commit 4a3c25424c

View File

@@ -41,9 +41,9 @@ func (c *RTMPConfig) OnEvent(event any) {
go c.ListenTCP(RTMPPlugin, c)
}
case SEpublish:
if url, ok := c.PushList[v.Target.Path]; ok {
if err := RTMPPlugin.Push(v.Target.Path, url, new(RTMPPusher), false); err != nil {
RTMPPlugin.Error("push", zap.String("streamPath", v.Target.Path), zap.String("url", url), zap.Error(err))
if remoteURL := conf.CheckPush(v.Target.Path); remoteURL != "" {
if err := RTMPPlugin.Push(v.Target.Path, remoteURL, new(RTMPPusher), false); err != nil {
RTMPPlugin.Error("push", zap.String("streamPath", v.Target.Path), zap.String("url", remoteURL), zap.Error(err))
}
}
case InvitePublish: //按需拉流