When adaptive-simulcast is used, allow subscribers to switch to the next available layer (#55)

This commit is contained in:
David Zhao
2021-07-16 14:24:00 -07:00
committed by GitHub
parent e3fc3397ce
commit 55eb654a1b
+5 -1
View File
@@ -52,7 +52,11 @@ func (t *SubscribedTrack) UpdateSubscriberSettings(enabled bool, quality livekit
t.subMuted.TrySet(!enabled)
t.updateDownTrackMute()
if enabled && t.dt.Kind() == webrtc.RTPCodecTypeVideo {
_ = t.dt.SwitchSpatialLayer(spatialLayerForQuality(quality), true)
err := t.dt.SwitchSpatialLayer(spatialLayerForQuality(quality), true)
if err == sfu.ErrSpatialLayerNotFound && quality != livekit.VideoQuality_MEDIUM {
// try to switch to middle layer
_ = t.dt.SwitchSpatialLayer(spatialLayerForQuality(livekit.VideoQuality_MEDIUM), true)
}
}
})
}