MCPcopy
hub / github.com/livekit/livekit / TrackSubscribed

Method TrackSubscribed

pkg/telemetry/events.go:326–347  ·  view source on GitHub ↗
(
	ctx context.Context,
	roomID livekit.RoomID,
	roomName livekit.RoomName,
	participantID livekit.ParticipantID,
	track *livekit.TrackInfo,
	publisher *livekit.ParticipantInfo,
	shouldSendEvent bool,
)

Source from the content-addressed store, hash-verified

324}
325
326func (t *telemetryService) TrackSubscribed(
327 ctx context.Context,
328 roomID livekit.RoomID,
329 roomName livekit.RoomName,
330 participantID livekit.ParticipantID,
331 track *livekit.TrackInfo,
332 publisher *livekit.ParticipantInfo,
333 shouldSendEvent bool,
334) {
335 t.enqueue(func() {
336 prometheus.RecordTrackSubscribeSuccess(track.Type.String())
337
338 if !shouldSendEvent {
339 return
340 }
341
342 room := toMinimalRoomProto(roomID, roomName)
343 ev := newTrackEvent(livekit.AnalyticsEventType_TRACK_SUBSCRIBED, room, participantID, track)
344 ev.Publisher = publisher
345 t.SendEvent(ctx, ev)
346 })
347}
348
349func (t *telemetryService) TrackSubscribeFailed(
350 ctx context.Context,

Callers

nothing calls this directly

Calls 6

enqueueMethod · 0.95
toMinimalRoomProtoFunction · 0.85
newTrackEventFunction · 0.85
SendEventMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected