2020-10-01 23:17:27 -07:00
|
|
|
package admin
|
2020-10-01 18:16:58 -07:00
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
2020-10-06 01:07:09 +08:00
|
|
|
"github.com/owncast/owncast/controllers"
|
|
|
|
"github.com/owncast/owncast/core"
|
2020-10-01 23:17:27 -07:00
|
|
|
|
2020-10-06 01:07:09 +08:00
|
|
|
"github.com/owncast/owncast/core/rtmp"
|
2020-10-01 18:16:58 -07:00
|
|
|
)
|
|
|
|
|
2020-11-13 00:14:59 +01:00
|
|
|
// DisconnectInboundConnection will force-disconnect an inbound stream.
|
2020-10-01 18:16:58 -07:00
|
|
|
func DisconnectInboundConnection(w http.ResponseWriter, r *http.Request) {
|
|
|
|
if !core.GetStatus().Online {
|
2020-10-01 23:17:27 -07:00
|
|
|
controllers.WriteSimpleResponse(w, false, "no inbound stream connected")
|
2020-10-01 18:16:58 -07:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
rtmp.Disconnect()
|
2020-10-01 23:17:27 -07:00
|
|
|
controllers.WriteSimpleResponse(w, true, "inbound stream disconnected")
|
2020-10-01 18:16:58 -07:00
|
|
|
}
|