Ability to set name on Participant (#293)
This commit is contained in:
@@ -28,6 +28,7 @@ type MessageSource interface {
|
||||
|
||||
type ParticipantInit struct {
|
||||
Identity string
|
||||
Name string
|
||||
Metadata string
|
||||
Reconnect bool
|
||||
Permission *livekit.ParticipantPermission
|
||||
|
||||
@@ -151,6 +151,7 @@ func (r *RedisRouter) StartParticipantSignal(ctx context.Context, roomName strin
|
||||
RoomName: roomName,
|
||||
Identity: pi.Identity,
|
||||
Metadata: pi.Metadata,
|
||||
Name: pi.Name,
|
||||
// connection id is to allow the RTC node to identify where to route the message back to
|
||||
ConnectionId: connectionID,
|
||||
Reconnect: pi.Reconnect,
|
||||
@@ -240,6 +241,7 @@ func (r *RedisRouter) startParticipantRTC(ss *livekit.StartSession, participantK
|
||||
pi := ParticipantInit{
|
||||
Identity: ss.Identity,
|
||||
Metadata: ss.Metadata,
|
||||
Name: ss.Name,
|
||||
Reconnect: ss.Reconnect,
|
||||
Permission: ss.Permission,
|
||||
Client: ss.Client,
|
||||
|
||||
@@ -37,6 +37,7 @@ const (
|
||||
|
||||
type ParticipantParams struct {
|
||||
Identity string
|
||||
Name string
|
||||
SID string
|
||||
Config *WebRTCConfig
|
||||
Sink routing.MessageSink
|
||||
@@ -226,6 +227,7 @@ func (p *ParticipantImpl) ToProto() *livekit.ParticipantInfo {
|
||||
info := &livekit.ParticipantInfo{
|
||||
Sid: p.params.SID,
|
||||
Identity: p.params.Identity,
|
||||
Name: p.params.Name,
|
||||
Metadata: p.metadata,
|
||||
State: p.State(),
|
||||
JoinedAt: p.ConnectedAt().Unix(),
|
||||
|
||||
@@ -230,6 +230,7 @@ func (r *RoomManager) StartSession(ctx context.Context, roomName string, pi rout
|
||||
pLogger := rtc.LoggerWithParticipant(room.Logger, pi.Identity, sid)
|
||||
participant, err = rtc.NewParticipant(rtc.ParticipantParams{
|
||||
Identity: pi.Identity,
|
||||
Name: pi.Name,
|
||||
SID: sid,
|
||||
Config: &rtcConf,
|
||||
Sink: responseSink,
|
||||
|
||||
@@ -100,6 +100,7 @@ func (s *RTCService) validate(r *http.Request) (string, routing.ParticipantInit,
|
||||
pi := routing.ParticipantInit{
|
||||
Reconnect: boolValue(reconnectParam),
|
||||
Identity: claims.Identity,
|
||||
Name: claims.Name,
|
||||
AutoSubscribe: true,
|
||||
Metadata: claims.Metadata,
|
||||
Hidden: claims.Video.Hidden,
|
||||
|
||||
Reference in New Issue
Block a user