From 20ab63f87fd4b3b759a5dbcd692aad21862e2996 Mon Sep 17 00:00:00 2001 From: cloudwebrtc Date: Thu, 4 Aug 2022 13:31:33 +0800 Subject: [PATCH] chore: Hint to use MediaElement.setSinkId instead on browsers that don't implement selectAudioOutput. --- lib/src/mediadevices_impl.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/src/mediadevices_impl.dart b/lib/src/mediadevices_impl.dart index 6283f2a..b4079ac 100644 --- a/lib/src/mediadevices_impl.dart +++ b/lib/src/mediadevices_impl.dart @@ -1,5 +1,6 @@ import 'dart:async'; import 'dart:html' as html; +import 'dart:html_common'; import 'dart:js' as js; import 'dart:js_util' as jsutil; import 'package:webrtc_interface/webrtc_interface.dart'; @@ -160,7 +161,7 @@ class MediaDevicesWeb extends MediaDevices { throw UnimplementedError('selectAudioOutput is missing'); } } catch (e) { - throw 'Unable to selectAudioOutput: ${e.toString()}'; + throw 'Unable to selectAudioOutput: ${e.toString()}, Please try to use MediaElement.setSinkId instead.'; } } @@ -187,5 +188,6 @@ class MediaDevicesWeb extends MediaDevices { } catch (e) { throw 'Unable to get ondevicechange: ${e.toString()}'; } + return null; } }