From 4b70edac8388a06780d1f8be1ad9733c931dfc06 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Mon, 26 Oct 2020 09:14:05 -0700 Subject: [PATCH] Fill in all the values for the admin config api --- controllers/admin/serverConfig.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/controllers/admin/serverConfig.go b/controllers/admin/serverConfig.go index 724eb037a..abb2b1c12 100644 --- a/controllers/admin/serverConfig.go +++ b/controllers/admin/serverConfig.go @@ -9,13 +9,24 @@ import ( // GetServerConfig gets the config details of the server func GetServerConfig(w http.ResponseWriter, r *http.Request) { + var videoQualityVariants = make([]config.StreamQuality, 0) + for _, variant := range config.Config.GetVideoStreamQualities() { + videoQualityVariants = append(videoQualityVariants, config.StreamQuality{ + IsAudioPassthrough: variant.IsAudioPassthrough, + IsVideoPassthrough: variant.IsVideoPassthrough, + Framerate: variant.GetFramerate(), + EncoderPreset: variant.GetEncoderPreset(), + VideoBitrate: variant.VideoBitrate, + AudioBitrate: variant.AudioBitrate, + }) + } response := serverConfigAdminResponse{ InstanceDetails: config.Config.InstanceDetails, FFmpegPath: config.Config.GetFFMpegPath(), StreamKey: config.Config.VideoSettings.StreamingKey, WebServerPort: config.Config.GetPublicWebServerPort(), VideoSettings: videoSettings{ - VideoQualityVariants: config.Config.GetVideoStreamQualities(), + VideoQualityVariants: videoQualityVariants, SegmentLengthSeconds: config.Config.GetVideoSegmentSecondsLength(), NumberOfPlaylistItems: config.Config.GetMaxNumberOfReferencedSegmentsInPlaylist(), },