0

Fill in all the values for the admin config api

This commit is contained in:
Gabe Kangas 2020-10-26 09:14:05 -07:00
parent 34fe55b5a3
commit 4b70edac83

View File

@ -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(),
},