Handle room configuration that's set in the grant itself (#3120)

* Handle room configuration that's set in the grant itself

* ensure refresh token contains updates

* deps

* dep

---------

Co-authored-by: Paul Wells <paulwe@gmail.com>
This commit is contained in:
David Zhao
2024-10-21 23:31:12 -07:00
committed by GitHub
co-authored by Paul Wells
parent d751f209d5
commit dd7cd7eafc
14 changed files with 65 additions and 73 deletions
+15
View File
@@ -22,6 +22,7 @@ import (
"regexp"
"strings"
"github.com/livekit/protocol/livekit"
"github.com/livekit/protocol/logger"
)
@@ -67,3 +68,17 @@ func GetClientIP(r *http.Request) string {
ip, _, _ := net.SplitHostPort(r.RemoteAddr)
return ip
}
func SetRoomConfiguration(createRequest *livekit.CreateRoomRequest, conf *livekit.RoomConfiguration) {
if conf == nil {
return
}
createRequest.Agents = conf.Agents
createRequest.Egress = conf.Egress
createRequest.EmptyTimeout = conf.EmptyTimeout
createRequest.DepartureTimeout = conf.DepartureTimeout
createRequest.MaxParticipants = conf.MaxParticipants
createRequest.MinPlayoutDelay = conf.MinPlayoutDelay
createRequest.MaxPlayoutDelay = conf.MaxPlayoutDelay
createRequest.SyncStreams = conf.SyncStreams
}