2020-10-02 09:17:27 +03:00
|
|
|
package admin
|
2020-10-02 04:16:58 +03:00
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
2020-10-05 20:07:09 +03:00
|
|
|
"github.com/owncast/owncast/core"
|
2024-07-02 07:44:37 +03:00
|
|
|
webutils "github.com/owncast/owncast/webserver/utils"
|
2020-10-02 09:17:27 +03:00
|
|
|
|
2020-10-05 20:07:09 +03:00
|
|
|
"github.com/owncast/owncast/core/rtmp"
|
2020-10-02 04:16:58 +03:00
|
|
|
)
|
|
|
|
|
2020-11-13 02:14:59 +03:00
|
|
|
// DisconnectInboundConnection will force-disconnect an inbound stream.
|
2020-10-02 04:16:58 +03:00
|
|
|
func DisconnectInboundConnection(w http.ResponseWriter, r *http.Request) {
|
|
|
|
if !core.GetStatus().Online {
|
2024-07-02 07:44:37 +03:00
|
|
|
webutils.WriteSimpleResponse(w, false, "no inbound stream connected")
|
2020-10-02 04:16:58 +03:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
rtmp.Disconnect()
|
2024-07-02 07:44:37 +03:00
|
|
|
webutils.WriteSimpleResponse(w, true, "inbound stream disconnected")
|
2020-10-02 04:16:58 +03:00
|
|
|
}
|