From 5ff4febf75ffb848bda85926dff8e4007e71b0c3 Mon Sep 17 00:00:00 2001 From: cloudwebrtc Date: Thu, 17 Oct 2024 18:00:36 +0800 Subject: [PATCH 1/3] fix: fix monitorStats not start when sender == null. --- lib/src/track/local/audio.dart | 2 +- lib/src/track/local/video.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/track/local/audio.dart b/lib/src/track/local/audio.dart index 0e7f9622c..abc70773b 100644 --- a/lib/src/track/local/audio.dart +++ b/lib/src/track/local/audio.dart @@ -52,7 +52,7 @@ class LocalAudioTrack extends LocalTrack @override Future monitorStats() async { - if (sender == null || events.isDisposed || !isActive) { + if (events.isDisposed || !isActive) { _currentBitrate = 0; return false; } diff --git a/lib/src/track/local/video.dart b/lib/src/track/local/video.dart index c07ee1016..b7c0fc20f 100644 --- a/lib/src/track/local/video.dart +++ b/lib/src/track/local/video.dart @@ -67,7 +67,7 @@ class LocalVideoTrack extends LocalTrack with VideoTrack { @override Future monitorStats() async { - if (sender == null || events.isDisposed || !isActive) { + if (events.isDisposed || !isActive) { _currentBitrate = 0; return false; } From 649c32e7b4f427372fdb32ce2586432ccf8d7119 Mon Sep 17 00:00:00 2001 From: cloudwebrtc Date: Thu, 17 Oct 2024 22:56:30 +0800 Subject: [PATCH 2/3] set some log levels to lower. --- lib/src/core/room.dart | 2 +- lib/src/participant/participant.dart | 2 +- lib/src/publication/remote.dart | 2 +- lib/src/track/track.dart | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/src/core/room.dart b/lib/src/core/room.dart index 201e12c21..969785011 100644 --- a/lib/src/core/room.dart +++ b/lib/src/core/room.dart @@ -137,7 +137,7 @@ class Room extends DisposableChangeNotifier with EventsEmittable { // Any event emitted will trigger ChangeNotifier events.listen((event) { - logger.fine('[RoomEvent] $event, will notifyListeners()'); + logger.finer('[RoomEvent] $event, will notifyListeners()'); notifyListeners(); }); diff --git a/lib/src/participant/participant.dart b/lib/src/participant/participant.dart index 33e5501fa..96941419d 100644 --- a/lib/src/participant/participant.dart +++ b/lib/src/participant/participant.dart @@ -140,7 +140,7 @@ abstract class Participant }) : _name = name { // Any event emitted will trigger ChangeNotifier events.listen((event) { - logger.fine('[ParticipantEvent] $event, will notifyListeners()'); + logger.finer('[ParticipantEvent] $event, will notifyListeners()'); notifyListeners(); }); diff --git a/lib/src/publication/remote.dart b/lib/src/publication/remote.dart index dc20cd88e..bcb03d6c5 100644 --- a/lib/src/publication/remote.dart +++ b/lib/src/publication/remote.dart @@ -213,7 +213,7 @@ class RemoteTrackPublication ); newValue.onVideoViewBuild = (_) { - logger.fine('[Visibility] VideoView did build'); + logger.finer('[Visibility] VideoView did build'); if (_lastSentTrackSettings?.disabled == true) { // quick enable _cancelPendingTrackSettingsUpdateRequest?.call(); diff --git a/lib/src/track/track.dart b/lib/src/track/track.dart index bac22e2d6..ee4ca53ff 100644 --- a/lib/src/track/track.dart +++ b/lib/src/track/track.dart @@ -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(); }); From c65122a397c6554e064890903823c9636ea74f79 Mon Sep 17 00:00:00 2001 From: cloudwebrtc Date: Thu, 17 Oct 2024 22:58:47 +0800 Subject: [PATCH 3/3] update. --- example/lib/pages/room.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/example/lib/pages/room.dart b/example/lib/pages/room.dart index e9c6ee6df..3cbec9efd 100644 --- a/example/lib/pages/room.dart +++ b/example/lib/pages/room.dart @@ -87,7 +87,6 @@ class _RoomPageState extends State { (timeStamp) => Navigator.popUntil(context, (route) => route.isFirst)); }) ..on((event) { - print('Participant event'); // sort participants on many track events as noted in documentation linked above _sortParticipants(); })