Add endpoint for returning stream status

This commit is contained in:
Gabe Kangas
2020-06-02 00:27:54 -07:00
parent 020ace7ddd
commit 4cb282040b
3 changed files with 123 additions and 62 deletions

View File

@@ -38,7 +38,6 @@ func (h *Handler) OnCreateStream(timestamp uint32, cmd *rtmpmsg.NetConnectionCre
func (h *Handler) OnPublish(timestamp uint32, cmd *rtmpmsg.NetStreamPublish) error {
// log.Printf("OnPublish: %#v", cmd)
log.Println("Incoming stream connected.")
if cmd.PublishingName != configuration.VideoSettings.StreamingKey {
@@ -68,6 +67,8 @@ func (h *Handler) OnPublish(timestamp uint32, cmd *rtmpmsg.NetStreamPublish) err
go startFfmpeg(configuration)
streamConnected()
return nil
}
@@ -164,4 +165,6 @@ func (h *Handler) OnClose() {
if h.flvFile != nil {
_ = h.flvFile.Close()
}
streamDisconnected()
}