mirror of
https://github.com/langhuihui/monibuca.git
synced 2025-10-04 07:26:45 +08:00
feat: add pullproxy support gb28181 type
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"net/url"
|
"net/url"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -287,6 +288,12 @@ func (s *Server) AddPullProxy(ctx context.Context, req *pb.PullProxyInfo) (res *
|
|||||||
pullProxyConfig.Type = "flv"
|
pullProxyConfig.Type = "flv"
|
||||||
case ".mp4":
|
case ".mp4":
|
||||||
pullProxyConfig.Type = "mp4"
|
pullProxyConfig.Type = "mp4"
|
||||||
|
default:
|
||||||
|
pattern := `^\d{20}/\d{20}$`
|
||||||
|
re := regexp.MustCompile(pattern)
|
||||||
|
if re.MatchString(u.Path) {
|
||||||
|
pullProxyConfig.Type = "gb28181"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -489,4 +496,4 @@ func (p *PullProxyManager) CheckToPull(streamPath string) {
|
|||||||
pullProxy.Pull()
|
pullProxy.Pull()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user