update track settings (#77)
This commit is contained in:
@@ -116,6 +116,7 @@ class Room extends DisposableChangeNotifier with EventsEmittable<RoomEvent> {
|
||||
..on<EngineReconnectedEvent>((event) async {
|
||||
_connectionState = ConnectionState.connected;
|
||||
events.emit(const RoomReconnectedEvent());
|
||||
await _handlePostReconnect(false);
|
||||
})
|
||||
..on<EngineReconnectingEvent>((event) async {
|
||||
_connectionState = ConnectionState.reconnecting;
|
||||
@@ -472,6 +473,20 @@ class Room extends DisposableChangeNotifier with EventsEmittable<RoomEvent> {
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _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<void> simulateScenario({
|
||||
int? speakerUpdate,
|
||||
|
||||
Reference in New Issue
Block a user