( participant types.LocalParticipant, iceServers []*livekit.ICEServer, )
| 1039 | } |
| 1040 | |
| 1041 | func (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 |
| 1073 | func (r *Room) onTrackPublished(participant types.Participant, track types.MediaTrack) { |
no test coverage detected