update track settings (#77)
This commit is contained in:
@@ -116,6 +116,7 @@ class Room extends DisposableChangeNotifier with EventsEmittable<RoomEvent> {
|
|||||||
..on<EngineReconnectedEvent>((event) async {
|
..on<EngineReconnectedEvent>((event) async {
|
||||||
_connectionState = ConnectionState.connected;
|
_connectionState = ConnectionState.connected;
|
||||||
events.emit(const RoomReconnectedEvent());
|
events.emit(const RoomReconnectedEvent());
|
||||||
|
await _handlePostReconnect(false);
|
||||||
})
|
})
|
||||||
..on<EngineReconnectingEvent>((event) async {
|
..on<EngineReconnectingEvent>((event) async {
|
||||||
_connectionState = ConnectionState.reconnecting;
|
_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.
|
/// To be used for internal testing purposes only.
|
||||||
Future<void> simulateScenario({
|
Future<void> simulateScenario({
|
||||||
int? speakerUpdate,
|
int? speakerUpdate,
|
||||||
|
|||||||
@@ -220,19 +220,19 @@ class RemoteTrackPublication<T extends RemoteTrack>
|
|||||||
set videoQuality(lk_models.VideoQuality newValue) {
|
set videoQuality(lk_models.VideoQuality newValue) {
|
||||||
if (newValue == _videoQuality) return;
|
if (newValue == _videoQuality) return;
|
||||||
_videoQuality = newValue;
|
_videoQuality = newValue;
|
||||||
_sendUpdateTrackSettings();
|
sendUpdateTrackSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> enable() async {
|
Future<void> enable() async {
|
||||||
if (_enabled) return;
|
if (_enabled) return;
|
||||||
_enabled = true;
|
_enabled = true;
|
||||||
_sendUpdateTrackSettings();
|
sendUpdateTrackSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> disable() async {
|
Future<void> disable() async {
|
||||||
if (!_enabled) return;
|
if (!_enabled) return;
|
||||||
_enabled = false;
|
_enabled = false;
|
||||||
_sendUpdateTrackSettings();
|
sendUpdateTrackSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> subscribe() async {
|
Future<void> subscribe() async {
|
||||||
@@ -277,7 +277,8 @@ class RemoteTrackPublication<T extends RemoteTrack>
|
|||||||
participant.room.engine.signalClient.sendUpdateSubscription(subscription);
|
participant.room.engine.signalClient.sendUpdateSubscription(subscription);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _sendUpdateTrackSettings() {
|
@internal
|
||||||
|
void sendUpdateTrackSettings() {
|
||||||
final settings = lk_rtc.UpdateTrackSettings(
|
final settings = lk_rtc.UpdateTrackSettings(
|
||||||
trackSids: [sid],
|
trackSids: [sid],
|
||||||
disabled: !_enabled,
|
disabled: !_enabled,
|
||||||
|
|||||||
Reference in New Issue
Block a user