Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 3 additions & 16 deletions packages/stream_video/lib/src/call/call.dart
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,6 @@ class Call {

_observeEvents();
_observeState();
_observeReconnectEvents();
_observeUserId();
_observeNativeWebRtcEventStream();

Expand Down Expand Up @@ -419,20 +418,6 @@ class Call {
);
}

void _observeReconnectEvents() {
_subscriptions.add(
_idReconnect,
networkMonitor.onStatusChange.listen(
(status) {
if (status == InternetStatus.disconnected) {
_logger.d(() => '[observeReconnectEvents] network disconnected');
_reconnect(SfuReconnectionStrategy.fast);
}
},
),
);
}

void _observeUserId() {
_subscriptions.add(
_idUserId,
Expand Down Expand Up @@ -1650,7 +1635,9 @@ class Call {
});

final previousCheckInterval = networkMonitor.checkInterval;
networkMonitor.setIntervalAndResetTimer(const Duration(seconds: 1));
networkMonitor.setIntervalAndResetTimer(
_streamVideo.options.networkMonitorSettings.offlineCheckInterval,
);

final networkFuture = networkMonitor.onStatusChange
.startWithFuture(networkMonitor.internetStatus)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@ import 'package:internet_connection_checker_plus/internet_connection_checker_plu

class NetworkMonitorSettings {
const NetworkMonitorSettings({
this.checkInterval = const Duration(seconds: 2),
this.checkInterval = const Duration(seconds: 5),
this.offlineCheckInterval = const Duration(seconds: 2),
this.customEndpoints = const [],
this.internetConnectionInstance,
});

/// The interval between connection checks.
final Duration checkInterval;

/// The interval between connection checks when offline.
final Duration offlineCheckInterval;

/// A list of custom options for checking internet connectivity.
///
/// This allows you to specify custom URLs, headers, and timeout settings
Expand Down
Loading