diff --git a/lib/src/core/room.dart b/lib/src/core/room.dart index be372e3..cb0a14b 100644 --- a/lib/src/core/room.dart +++ b/lib/src/core/room.dart @@ -116,6 +116,7 @@ class Room extends DisposableChangeNotifier with EventsEmittable { ..on((event) async { _connectionState = ConnectionState.connected; events.emit(const RoomReconnectedEvent()); + await _handlePostReconnect(false); }) ..on((event) async { _connectionState = ConnectionState.reconnecting; @@ -472,6 +473,20 @@ class Room extends DisposableChangeNotifier with EventsEmittable { ); } + Future _handlePostReconnect(bool isFullReconnect) async { + if (isFullReconnect) { + // TODO republish tracks on full reconnect + } else { + for (var participant in participants.values) { + for (var pub in participant.trackPublications.values) { + if (pub.subscribed) { + pub.sendUpdateTrackSettings(); + } + } + } + } + } + /// To be used for internal testing purposes only. Future simulateScenario({ int? speakerUpdate, diff --git a/lib/src/publication/remote.dart b/lib/src/publication/remote.dart index e27ba19..5ac09b9 100644 --- a/lib/src/publication/remote.dart +++ b/lib/src/publication/remote.dart @@ -220,19 +220,19 @@ class RemoteTrackPublication set videoQuality(lk_models.VideoQuality newValue) { if (newValue == _videoQuality) return; _videoQuality = newValue; - _sendUpdateTrackSettings(); + sendUpdateTrackSettings(); } Future enable() async { if (_enabled) return; _enabled = true; - _sendUpdateTrackSettings(); + sendUpdateTrackSettings(); } Future disable() async { if (!_enabled) return; _enabled = false; - _sendUpdateTrackSettings(); + sendUpdateTrackSettings(); } Future subscribe() async { @@ -277,7 +277,8 @@ class RemoteTrackPublication participant.room.engine.signalClient.sendUpdateSubscription(subscription); } - void _sendUpdateTrackSettings() { + @internal + void sendUpdateTrackSettings() { final settings = lk_rtc.UpdateTrackSettings( trackSids: [sid], disabled: !_enabled,