mirror of
https://github.com/datarhei/core.git
synced 2025-10-24 08:23:32 +08:00
Always register rtmp and srt replacer templates
This commit is contained in:
@@ -447,7 +447,6 @@ func (a *api) start() error {
|
|||||||
a.replacer.RegisterTemplate("diskfs", a.diskfs.Base())
|
a.replacer.RegisterTemplate("diskfs", a.diskfs.Base())
|
||||||
a.replacer.RegisterTemplate("memfs", a.memfs.Base())
|
a.replacer.RegisterTemplate("memfs", a.memfs.Base())
|
||||||
|
|
||||||
if cfg.RTMP.Enable {
|
|
||||||
host, port, _ := gonet.SplitHostPort(cfg.RTMP.Address)
|
host, port, _ := gonet.SplitHostPort(cfg.RTMP.Address)
|
||||||
if len(host) == 0 {
|
if len(host) == 0 {
|
||||||
host = "localhost"
|
host = "localhost"
|
||||||
@@ -459,15 +458,13 @@ func (a *api) start() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
a.replacer.RegisterTemplate("rtmp", template)
|
a.replacer.RegisterTemplate("rtmp", template)
|
||||||
}
|
|
||||||
|
|
||||||
if cfg.SRT.Enable {
|
|
||||||
host, port, _ = gonet.SplitHostPort(cfg.SRT.Address)
|
host, port, _ = gonet.SplitHostPort(cfg.SRT.Address)
|
||||||
if len(host) == 0 {
|
if len(host) == 0 {
|
||||||
host = "localhost"
|
host = "localhost"
|
||||||
}
|
}
|
||||||
|
|
||||||
template := "srt://" + host + ":" + port + "?mode=caller&transtype=live&streamid=#!:m={mode},r={name}"
|
template = "srt://" + host + ":" + port + "?mode=caller&transtype=live&streamid=#!:m={mode},r={name}"
|
||||||
if len(cfg.SRT.Token) != 0 {
|
if len(cfg.SRT.Token) != 0 {
|
||||||
template += ",token=" + cfg.SRT.Token
|
template += ",token=" + cfg.SRT.Token
|
||||||
}
|
}
|
||||||
@@ -476,7 +473,6 @@ func (a *api) start() error {
|
|||||||
}
|
}
|
||||||
a.replacer.RegisterTemplate("srt", template)
|
a.replacer.RegisterTemplate("srt", template)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
restream, err := restream.New(restream.Config{
|
restream, err := restream.New(restream.Config{
|
||||||
ID: cfg.ID,
|
ID: cfg.ID,
|
||||||
|
|||||||
Reference in New Issue
Block a user