_disabled to _enabled
This commit is contained in:
@@ -32,7 +32,7 @@ class RendererVisibility {
|
|||||||
/// control if we should subscribe to the track, and its quality (for video).
|
/// control if we should subscribe to the track, and its quality (for video).
|
||||||
class RemoteTrackPublication extends TrackPublication {
|
class RemoteTrackPublication extends TrackPublication {
|
||||||
final RemoteParticipant _participant;
|
final RemoteParticipant _participant;
|
||||||
bool _disabled = false;
|
bool _enabled = true;
|
||||||
lk_rtc.VideoQuality _videoQuality = lk_rtc.VideoQuality.HIGH;
|
lk_rtc.VideoQuality _videoQuality = lk_rtc.VideoQuality.HIGH;
|
||||||
lk_rtc.VideoQuality get videoQuality => _videoQuality;
|
lk_rtc.VideoQuality get videoQuality => _videoQuality;
|
||||||
|
|
||||||
@@ -110,14 +110,14 @@ class RemoteTrackPublication extends TrackPublication {
|
|||||||
max(s1.height, s2.height),
|
max(s1.height, s2.height),
|
||||||
);
|
);
|
||||||
|
|
||||||
_disabled = !_hasVisibleRenderers();
|
_enabled = _hasVisibleRenderers();
|
||||||
|
|
||||||
final settings = lk_rtc.UpdateTrackSettings(
|
final settings = lk_rtc.UpdateTrackSettings(
|
||||||
trackSids: [sid],
|
trackSids: [sid],
|
||||||
disabled: _disabled,
|
disabled: !_enabled,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!_disabled) {
|
if (_enabled) {
|
||||||
final largest = _visibilities.values
|
final largest = _visibilities.values
|
||||||
.map((e) => e.size)
|
.map((e) => e.size)
|
||||||
.reduce((value, element) => maxSize(value, element));
|
.reduce((value, element) => maxSize(value, element));
|
||||||
@@ -162,10 +162,10 @@ class RemoteTrackPublication extends TrackPublication {
|
|||||||
_sendUpdateTrackSettings();
|
_sendUpdateTrackSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool get enabled => !_disabled;
|
bool get enabled => _enabled;
|
||||||
set enabled(bool val) {
|
set enabled(bool val) {
|
||||||
if (_disabled == !val) return;
|
if (_enabled == val) return;
|
||||||
_disabled = !val;
|
_enabled = val;
|
||||||
_sendUpdateTrackSettings();
|
_sendUpdateTrackSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -227,7 +227,7 @@ class RemoteTrackPublication extends TrackPublication {
|
|||||||
void _sendUpdateTrackSettings() {
|
void _sendUpdateTrackSettings() {
|
||||||
final settings = lk_rtc.UpdateTrackSettings(
|
final settings = lk_rtc.UpdateTrackSettings(
|
||||||
trackSids: [sid],
|
trackSids: [sid],
|
||||||
disabled: _disabled,
|
disabled: !_enabled,
|
||||||
);
|
);
|
||||||
if (kind == lk_models.TrackType.VIDEO) {
|
if (kind == lk_models.TrackType.VIDEO) {
|
||||||
settings.quality = _videoQuality;
|
settings.quality = _videoQuality;
|
||||||
|
|||||||
Reference in New Issue
Block a user