diff --git a/.changes/video-degradation-default b/.changes/video-degradation-default new file mode 100644 index 000000000..f3edc2c76 --- /dev/null +++ b/.changes/video-degradation-default @@ -0,0 +1 @@ +patch type="fixed" "Use maintain-resolution as the default video degradation preference for local video publishing" diff --git a/lib/src/participant/local.dart b/lib/src/participant/local.dart index e785b72fa..1d2781d91 100644 --- a/lib/src/participant/local.dart +++ b/lib/src/participant/local.dart @@ -386,10 +386,7 @@ class LocalParticipant extends Participant { } if ([TrackSource.camera, TrackSource.screenShareVideo].contains(track.source)) { - final degradationPreference = publishOptions.degradationPreference ?? - getDefaultDegradationPreference( - track, - ); + final degradationPreference = publishOptions.degradationPreference ?? DegradationPreference.maintainResolution; await track.setDegradationPreference(degradationPreference); } @@ -487,10 +484,7 @@ class LocalParticipant extends Participant { } if ([TrackSource.camera, TrackSource.screenShareVideo].contains(track.source)) { - final degradationPreference = publishOptions.degradationPreference ?? - getDefaultDegradationPreference( - track, - ); + final degradationPreference = publishOptions.degradationPreference ?? DegradationPreference.maintainResolution; await track.setDegradationPreference(degradationPreference); } @@ -593,17 +587,6 @@ class LocalParticipant extends Participant { await pub.dispose(); } - DegradationPreference getDefaultDegradationPreference(LocalVideoTrack track) { - // a few of reasons we have different default paths: - // 1. without this, Chrome seems to aggressively resize the SVC video stating `quality-limitation: bandwidth` even when BW isn't an issue - // 2. since we are overriding contentHint to motion (to workaround L1T3 publishing), it overrides the default degradationPreference to `balanced` - final VideoDimensions dimensions = track.currentOptions.params.dimensions; - if (track.source == TrackSource.screenShareVideo || dimensions.height >= 1080) { - return DegradationPreference.maintainResolution; - } - return DegradationPreference.balanced; - } - /// Convenience method to unpublish all tracks. Future unpublishAllTracks({bool notify = true, bool? stopOnUnpublish}) async { final trackSids = trackPublications.keys.toSet();