Skip to content

Commit

Permalink
fix: fix monitorStats not started when sender == null. (#606)
Browse files Browse the repository at this point in the history
* fix: fix monitorStats not start when sender == null.

* set some log levels to lower.

* update.
  • Loading branch information
cloudwebrtc authored Oct 21, 2024
1 parent 588e898 commit cd05869
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion example/lib/pages/room.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ class _RoomPageState extends State<RoomPage> {
(timeStamp) => Navigator.popUntil(context, (route) => route.isFirst));
})
..on<ParticipantEvent>((event) {
print('Participant event');
// sort participants on many track events as noted in documentation linked above
_sortParticipants();
})
Expand Down
2 changes: 1 addition & 1 deletion lib/src/core/room.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class Room extends DisposableChangeNotifier with EventsEmittable<RoomEvent> {

// Any event emitted will trigger ChangeNotifier
events.listen((event) {
logger.fine('[RoomEvent] $event, will notifyListeners()');
logger.finer('[RoomEvent] $event, will notifyListeners()');
notifyListeners();
});

Expand Down
2 changes: 1 addition & 1 deletion lib/src/participant/participant.dart
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ abstract class Participant<T extends TrackPublication>
}) : _name = name {
// Any event emitted will trigger ChangeNotifier
events.listen((event) {
logger.fine('[ParticipantEvent] $event, will notifyListeners()');
logger.finer('[ParticipantEvent] $event, will notifyListeners()');
notifyListeners();
});

Expand Down
2 changes: 1 addition & 1 deletion lib/src/publication/remote.dart
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class RemoteTrackPublication<T extends RemoteTrack>
);

newValue.onVideoViewBuild = (_) {
logger.fine('[Visibility] VideoView did build');
logger.finer('[Visibility] VideoView did build');
if (_lastSentTrackSettings?.disabled == true) {
// quick enable
_cancelPendingTrackSettingsUpdateRequest?.call();
Expand Down
2 changes: 1 addition & 1 deletion lib/src/track/local/audio.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class LocalAudioTrack extends LocalTrack

@override
Future<bool> monitorStats() async {
if (sender == null || events.isDisposed || !isActive) {
if (events.isDisposed || !isActive) {
_currentBitrate = 0;
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/track/local/video.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class LocalVideoTrack extends LocalTrack with VideoTrack {

@override
Future<bool> monitorStats() async {
if (sender == null || events.isDisposed || !isActive) {
if (events.isDisposed || !isActive) {
_currentBitrate = 0;
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/track/track.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ abstract class Track extends DisposableChangeNotifier
{this.receiver}) {
// Any event emitted will trigger ChangeNotifier
events.listen((event) {
logger.fine('[TrackEvent] $event, will notifyListeners()');
logger.finer('[TrackEvent] $event, will notifyListeners()');
notifyListeners();
});

Expand Down

0 comments on commit cd05869

Please sign in to comment.