Fixed reading from config

This commit is contained in:
Mauro
2021-01-14 22:43:43 +01:00
committed by GitHub
parent 68f9542004
commit c7b6336d2a

24
main.go
View File

@@ -134,13 +134,21 @@ func main() {
version: %s
`, VERSION)
stream := rtmp.NewRtmpStream()
var hlsServer *hls.Server
if configure.Config.GetBool("hls") {
hlsServer = startHls()
}
startHTTPFlv(stream)
startAPI(stream)
apps := configure.Applications{}
configure.Config.UnmarshalKey("server", &apps)
for _, app := range apps {
stream := rtmp.NewRtmpStream()
var hlsServer *hls.Server
if app.Hls {
hlsServer = startHls()
}
if app.Flv {
startHTTPFlv(stream)
}
if app.Api {
startAPI(stream)
}
startRtmp(stream, hlsServer)
startRtmp(stream, hlsServer)
}
}