Open janoskranczler opened 1 year ago
The onDeviceChange event should be fired when a new device is connected or an old device is disconnected.
Strange, it should be listened to when FlutterWebRTCEventChannel.instace is obtained for the first time.
Hardware.onDeviceChange
StreamController is only updated occasionally.I've debugged it and found that for some reason the
FlutterWebRTCEventChannel.handleEvents
StreamController not updated on every audio device change: https://github.com/flutter-webrtc/flutter-webrtc/blob/1dcb8223355dc58db0852e2df19f8514e9b4cd0d/lib/src/native/event_channel.dart#L15-L16To Reproduce
Hardware.instance.onDeviceChange.stream.listen()
) with a listener method.Expected behavior The onDeviceChange listener method is called for every new audio connected or disconnected.
Platform information
Flutter version: [✓] Flutter (Channel stable, 3.3.7, on macOS 13.0 22A380 darwin-arm, locale en-HU) • Flutter version 3.3.7 on channel stable at /Users/janoskranczler/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision e99c9c7cd9 (9 days ago), 2022-11-01 16:59:00 -0700 • Engine revision 857bd6b74c • Dart version 2.18.4 • DevTools version 2.15.0
Plugin version: 1.1.7 - https://github.com/livekit/client-sdk-flutter/commit/22a18d3e9cff352c56870aa723567777855bbf2b
Flutter target OS: iOS
Flutter target OS version: 16.1