MCPcopy
hub / github.com/livekit/livekit / TrackUnsubscribed

Method TrackUnsubscribed

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

Source from the content-addressed store, hash-verified

368}
369
370func (t *telemetryService) TrackUnsubscribed(
371 ctx context.Context,
372 roomID livekit.RoomID,
373 roomName livekit.RoomName,
374 participantID livekit.ParticipantID,
375 track *livekit.TrackInfo,
376 shouldSendEvent bool,
377) {
378 t.enqueue(func() {
379 prometheus.RecordTrackUnsubscribed(track.Type.String())
380
381 if shouldSendEvent {
382 room := toMinimalRoomProto(roomID, roomName)
383 t.SendEvent(ctx, newTrackEvent(livekit.AnalyticsEventType_TRACK_UNSUBSCRIBED, room, participantID, track))
384 }
385 })
386}
387
388func (t *telemetryService) TrackUnpublished(
389 ctx context.Context,

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected