Fix: resp err when creat hls without enable hls player

pull/21/head
zijiren233 1 year ago
parent a3a0fff3df
commit a3ef679f18

@ -21,7 +21,7 @@ require (
github.com/zijiren233/gencontainer v0.0.0-20230930135658-e410015e13cc
github.com/zijiren233/go-colorable v0.0.0-20230930131441-997304c961cb
github.com/zijiren233/ksync v0.2.0
github.com/zijiren233/livelib v0.1.2-0.20231010021513-5130877d6f5e
github.com/zijiren233/livelib v0.1.2-0.20231010145337-1651f7b4be26
github.com/zijiren233/stream v0.5.1
github.com/zijiren233/yaml-comment v0.2.0
golang.org/x/crypto v0.14.0

@ -163,6 +163,8 @@ github.com/zijiren233/livelib v0.1.1 h1:PjGqQXgJw2sqWWBp5JEtwqnpNplWqX5BY3yo+5U9
github.com/zijiren233/livelib v0.1.1/go.mod h1:2wrAAqNIdMZjQrdbO7ERQfqK4VS5fzgUj2xXwrJ8/uo=
github.com/zijiren233/livelib v0.1.2-0.20231010021513-5130877d6f5e h1:x1KhyR/CIaZ2Yfb1mGwX0nUhRVOJnFPUFNN+AVqv7VA=
github.com/zijiren233/livelib v0.1.2-0.20231010021513-5130877d6f5e/go.mod h1:2wrAAqNIdMZjQrdbO7ERQfqK4VS5fzgUj2xXwrJ8/uo=
github.com/zijiren233/livelib v0.1.2-0.20231010145337-1651f7b4be26 h1:h7cw3cPQX3VheviU0y0bUVV0CnQ8fJegJgZMBpb/tfw=
github.com/zijiren233/livelib v0.1.2-0.20231010145337-1651f7b4be26/go.mod h1:2wrAAqNIdMZjQrdbO7ERQfqK4VS5fzgUj2xXwrJ8/uo=
github.com/zijiren233/stream v0.5.1 h1:9SUwM/fpET6frtBRT5WZBHnan0Hyzkezk/P8N78cgZQ=
github.com/zijiren233/stream v0.5.1/go.mod h1:iIrOm3qgIepQFmptD/HDY+YzamSSzQOtPjpVcK7FCOw=
github.com/zijiren233/yaml-comment v0.2.0 h1:xGcmpFsjK+IIK1InHtl+rKxYVKQ9rne/aRP1gkczZt4=

@ -126,6 +126,9 @@ func PushMovie(ctx *gin.Context) {
if !conf.Conf.Rtmp.Enable {
ctx.AbortWithStatusJSON(http.StatusBadRequest, NewApiErrorStringResp("rtmp source is not enabled"))
return
} else if movie.Type == "m3u8" && !conf.Conf.Rtmp.HlsPlayer {
ctx.AbortWithStatusJSON(http.StatusBadRequest, NewApiErrorStringResp("hls player is not enabled"))
return
}
movie.PullKey = uuid.New().String()
c, err := user.Room().NewLiveChannel(movie.PullKey)

Loading…
Cancel
Save