diff --git a/lib/src/hardware/hardware.dart b/lib/src/hardware/hardware.dart index a9b7fee2..705645c3 100644 --- a/lib/src/hardware/hardware.dart +++ b/lib/src/hardware/hardware.dart @@ -24,11 +24,12 @@ import '../support/platform.dart'; import '../track/audio_management.dart'; class MediaDevice { - const MediaDevice(this.deviceId, this.label, this.kind); + const MediaDevice(this.deviceId, this.label, this.kind, this.groupId); final String deviceId; final String label; final String kind; + final String? groupId; @override bool operator ==(covariant MediaDevice other) { @@ -36,7 +37,8 @@ class MediaDevice { return other.deviceId == deviceId && other.kind == kind && - other.label == label; + other.label == label && + other.groupId == groupId; } @override @@ -46,7 +48,7 @@ class MediaDevice { @override String toString() { - return 'MediaDevice{deviceId: $deviceId, label: $label, kind: $kind}'; + return 'MediaDevice{deviceId: $deviceId, label: $label, kind: $kind, groupId: $groupId}'; } } @@ -81,8 +83,9 @@ class Hardware { Future> enumerateDevices({String? type}) async { var infos = await rtc.navigator.mediaDevices.enumerateDevices(); - var devices = - infos.map((e) => MediaDevice(e.deviceId, e.label, e.kind!)).toList(); + var devices = infos + .map((e) => MediaDevice(e.deviceId, e.label, e.kind!, e.groupId)) + .toList(); if (type != null && type.isNotEmpty) { devices = devices.where((d) => d.kind == type).toList(); } diff --git a/pubspec.yaml b/pubspec.yaml index 07553756..9585a36f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -38,7 +38,7 @@ dependencies: uuid: '>=3.0.6' synchronized: ^3.0.0+3 protobuf: ^3.0.0 - flutter_webrtc: ^0.10.4 + flutter_webrtc: ^0.10.5 device_info_plus: '>=8.0.0' js: ^0.6.4 platform_detect: ^2.0.7