From 3eccf9b56c0536d265d98c30a1bd7742cea12e68 Mon Sep 17 00:00:00 2001 From: cloudwebrtc Date: Mon, 23 Oct 2023 11:29:05 +0800 Subject: [PATCH 1/2] fix: video rendering flickers for safari. --- example/lib/pages/room.dart | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/example/lib/pages/room.dart b/example/lib/pages/room.dart index 95e7cec7..9823267b 100644 --- a/example/lib/pages/room.dart +++ b/example/lib/pages/room.dart @@ -68,16 +68,13 @@ class _RoomPageState extends State { WidgetsBindingCompatible.instance ?.addPostFrameCallback((timeStamp) => Navigator.pop(context)); }) - ..on((event) { - print('Participant event'); - // sort participants on many track events as noted in documentation linked above - _sortParticipants(); - }) ..on((event) { context.showRecordingStatusChangedDialog(event.activeRecording); }) ..on((_) => _sortParticipants()) ..on((_) => _sortParticipants()) + ..on((_) => _sortParticipants()) + ..on((_) => _sortParticipants()) ..on(_onE2EEStateEvent) ..on((event) { print( From 7dc614f6cc4897c509f2814df20561bf84577446 Mon Sep 17 00:00:00 2001 From: cloudwebrtc Date: Mon, 23 Oct 2023 15:58:56 +0800 Subject: [PATCH 2/2] update. --- example/lib/pages/room.dart | 7 ------- 1 file changed, 7 deletions(-) diff --git a/example/lib/pages/room.dart b/example/lib/pages/room.dart index 9823267b..3aaa6e95 100644 --- a/example/lib/pages/room.dart +++ b/example/lib/pages/room.dart @@ -32,8 +32,6 @@ class _RoomPageState extends State { @override void initState() { super.initState(); - // add callback for a `RoomEvent` as opposed to a `ParticipantEvent` - widget.room.addListener(_onRoomDidUpdate); // add callbacks for finer grained events _setUpListeners(); _sortParticipants(); @@ -52,7 +50,6 @@ class _RoomPageState extends State { void dispose() { // always dispose listener (() async { - widget.room.removeListener(_onRoomDidUpdate); await _listener.dispose(); await widget.room.dispose(); })(); @@ -117,10 +114,6 @@ class _RoomPageState extends State { } } - void _onRoomDidUpdate() { - _sortParticipants(); - } - void _onE2EEStateEvent(TrackE2EEStateEvent e2eeState) { print('e2ee state: $e2eeState'); }