Add support for loading the owncast URL in mpv (#1356)

* redirect players to hls link

* add VLC to players list
This commit is contained in:
Meisam
2021-08-31 23:49:04 +02:00
committed by GitHub
parent 7278ce8f26
commit e8e21ca45b
2 changed files with 26 additions and 0 deletions

View File

@@ -44,6 +44,11 @@ func IndexHandler(w http.ResponseWriter, r *http.Request) {
return
}
if utils.IsUserAgentAPlayer(r.UserAgent()) && isIndexRequest {
http.Redirect(w, r, "/hls/stream.m3u8", http.StatusTemporaryRedirect)
return
}
// If the ETags match then return a StatusNotModified
if responseCode := middleware.ProcessEtags(w, r); responseCode != 0 {
w.WriteHeader(responseCode)