From 6ca354f44ffc395d00d81f861a95e2eeaa29929a Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Mon, 9 Nov 2020 17:31:58 +0100 Subject: [PATCH] Web handler adapts its configuration wherever OME support is enabled or not --- web/handler.go | 5 +++-- web/template/player.html | 22 +++++++++++++++------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/web/handler.go b/web/handler.go index 0cb527e..8a30ffb 100644 --- a/web/handler.go +++ b/web/handler.go @@ -13,6 +13,7 @@ import ( "github.com/markbates/pkger" "gitlab.crans.org/nounous/ghostream/internal/monitoring" + "gitlab.crans.org/nounous/ghostream/stream/ovenmediaengine" "gitlab.crans.org/nounous/ghostream/stream/webrtc" ) @@ -61,8 +62,8 @@ func viewerHandler(w http.ResponseWriter, r *http.Request) { Cfg *Options Path string WidgetURL string - OMEApp string - }{Path: path, Cfg: cfg, WidgetURL: "", OMEApp: omeCfg.App} + OMECfg *ovenmediaengine.Options + }{Path: path, Cfg: cfg, WidgetURL: "", OMECfg: omeCfg} // Load widget is user does not disable it with ?nowidget if _, ok := r.URL.Query()["nowidget"]; !ok { diff --git a/web/template/player.html b/web/template/player.html index 118ee4b..f280d43 100644 --- a/web/template/player.html +++ b/web/template/player.html @@ -34,13 +34,17 @@ {{end}} - - - - +{{if .OMECfg.Enabled}} + + + +{{end}} {{end}}