MCPcopy
hub / github.com/livekit/livekit / notifySession

Method notifySession

pkg/service/roommanager_service.go:167–192  ·  view source on GitHub ↗
(ctx context.Context, participant types.Participant)

Source from the content-addressed store, hash-verified

165}
166
167func (s whipService) notifySession(ctx context.Context, participant types.Participant) error {
168 ticker := time.NewTicker(whipSessionNotifyInterval)
169 defer ticker.Stop()
170
171 err := s.sendConnectionNotify(ctx, participant)
172 if err != nil {
173 if errors.Is(err, context.Canceled) {
174 return nil
175 }
176 }
177
178 for {
179 select {
180 case <-ticker.C:
181 err := s.sendConnectionNotify(ctx, participant)
182 if err != nil {
183 if errors.Is(err, context.Canceled) {
184 return nil
185 }
186 }
187
188 case <-ctx.Done():
189 return nil
190 }
191 }
192}
193
194func (s whipService) sendConnectionNotify(ctx context.Context, participant types.Participant) error {
195 video, audio := getMediaStateForParticipant(participant)

Callers 1

CreateMethod · 0.95

Calls 3

sendConnectionNotifyMethod · 0.95
DoneMethod · 0.80
StopMethod · 0.65

Tested by

no test coverage detected