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