mirror of
https://github.com/gwuhaolin/livego.git
synced 2021-06-01 09:10:22 +03:00
Fixed reading from config
This commit is contained in:
24
main.go
24
main.go
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user