Telemetry: send video layers in TrackPublishedUpdate event (#500)

Signed-off-by: shishir gowda <shishir@livekit.io>
This commit is contained in:
shishirng
2022-03-10 14:49:01 -05:00
committed by GitHub
parent c34b907d58
commit cd2a7c2447
2 changed files with 20 additions and 17 deletions
+8 -11
View File
@@ -75,17 +75,14 @@ func NewMediaTrack(params MediaTrackParams) *MediaTrack {
}
})
t.MediaTrackReceiver.OnVideoLayerUpdate(func(layers []*livekit.VideoLayer) {
for _, layer := range layers {
t.params.Telemetry.TrackPublishedUpdate(context.Background(), t.PublisherID(),
&livekit.TrackInfo{
Sid: string(t.ID()),
Type: livekit.TrackType_VIDEO,
Muted: t.IsMuted(),
Width: layer.Width,
Height: layer.Height,
Simulcast: t.IsSimulcast(),
})
}
t.params.Telemetry.TrackPublishedUpdate(context.Background(), t.PublisherID(),
&livekit.TrackInfo{
Sid: string(t.ID()),
Type: livekit.TrackType_VIDEO,
Muted: t.IsMuted(),
Simulcast: t.IsSimulcast(),
Layers: layers,
})
})
return t