MCPcopy
hub / github.com/livekit/livekit / createJoinResponseLocked

Method createJoinResponseLocked

pkg/rtc/room.go:1041–1070  ·  view source on GitHub ↗
(
	participant types.LocalParticipant,
	iceServers []*livekit.ICEServer,
)

Source from the content-addressed store, hash-verified

1039}
1040
1041func (r *Room) createJoinResponseLocked(
1042 participant types.LocalParticipant,
1043 iceServers []*livekit.ICEServer,
1044) *livekit.JoinResponse {
1045 iceConfig := participant.GetICEConfig()
1046 hasICEFallback := iceConfig.GetPreferencePublisher() != livekit.ICECandidateType_ICT_NONE || iceConfig.GetPreferenceSubscriber() != livekit.ICECandidateType_ICT_NONE
1047 return &livekit.JoinResponse{
1048 Room: r.ToProto(),
1049 Participant: participant.ToProto(),
1050 OtherParticipants: GetOtherParticipantInfo(
1051 participant,
1052 false, // isMigratingIn
1053 toParticipants(slices.Collect(maps.Values(r.participants))),
1054 false, // skipSubscriberBroadcast
1055 ),
1056 IceServers: iceServers,
1057 // indicates both server and client support subscriber as primary
1058 SubscriberPrimary: participant.SubscriberAsPrimary(),
1059 ClientConfiguration: participant.GetClientConfiguration(),
1060 // sane defaults for ping interval & timeout
1061 PingInterval: PingIntervalSeconds,
1062 PingTimeout: PingTimeoutSeconds,
1063 ServerInfo: r.serverInfo,
1064 ServerVersion: r.serverInfo.Version,
1065 ServerRegion: r.serverInfo.Region,
1066 SifTrailer: r.trailer,
1067 EnabledPublishCodecs: participant.GetEnabledPublishCodecs(),
1068 FastPublish: participant.CanPublish() && !hasICEFallback,
1069 }
1070}
1071
1072// a ParticipantImpl in the room added a new track, subscribe other participants to it
1073func (r *Room) onTrackPublished(participant types.Participant, track types.MediaTrack) {

Callers 1

JoinMethod · 0.95

Calls 9

ToProtoMethod · 0.95
GetOtherParticipantInfoFunction · 0.85
toParticipantsFunction · 0.85
GetICEConfigMethod · 0.65
ToProtoMethod · 0.65
SubscriberAsPrimaryMethod · 0.65
CanPublishMethod · 0.65

Tested by

no test coverage detected