From 25c895f92a852607270ff7eb4b2d2ab7053ace0c Mon Sep 17 00:00:00 2001 From: Jayesh Nirve Date: Tue, 28 Dec 2021 01:31:17 +0530 Subject: [PATCH 1/2] chore: export media_stream_impl.dart --- CHANGELOG.md | 4 ++++ lib/dart_webrtc.dart | 1 + pubspec.yaml | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e2e4b1..4406707 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog -------------------------------------------- +[1.0.3] - 2021-12-28 + +* export media_stream_impl.dart to fix do not import impl files. + [1.0.2] - 2021-11-27 * Fix the type error of minified function in release mode. diff --git a/lib/dart_webrtc.dart b/lib/dart_webrtc.dart index 687d4a4..744176d 100644 --- a/lib/dart_webrtc.dart +++ b/lib/dart_webrtc.dart @@ -6,4 +6,5 @@ export 'package:webrtc_interface/webrtc_interface.dart' export 'src/factory_impl.dart'; export 'src/media_devices.dart'; export 'src/media_recorder.dart'; +export 'src/media_stream_impl.dart'; export 'src/rtc_video_element.dart'; diff --git a/pubspec.yaml b/pubspec.yaml index 21a4935..b11fe2c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: dart_webrtc description: Use the dart/js library to re-wrap the webrtc js interface of the browser, to adapted common browsers. -version: 1.0.2 +version: 1.0.3 homepage: https://github.com/flutter-webrtc/dart-webrtc environment: From f5318dfdf532c5f992273982b3872c68d15ce03a Mon Sep 17 00:00:00 2001 From: Georg Wechslberger Date: Sat, 8 Jan 2022 17:17:50 +0100 Subject: [PATCH 2/2] switch to promise version of addIceCandidate --- lib/src/rtc_peerconnection_impl.dart | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/lib/src/rtc_peerconnection_impl.dart b/lib/src/rtc_peerconnection_impl.dart index 8778146..8afcb26 100644 --- a/lib/src/rtc_peerconnection_impl.dart +++ b/lib/src/rtc_peerconnection_impl.dart @@ -227,18 +227,9 @@ class RTCPeerConnectionWeb extends RTCPeerConnection { } @override - Future addCandidate(RTCIceCandidate candidate) async { - try { - Completer completer = Completer(); - var success = js.allowInterop(() => completer.complete()); - var failure = js.allowInterop((e) => completer.completeError(e)); - jsutil.callMethod( - _jsPc, 'addIceCandidate', [_iceToJs(candidate), success, failure]); - - return completer.future; - } catch (e) { - print(e.toString()); - } + Future addCandidate(RTCIceCandidate candidate) { + return jsutil.promiseToFuture( + jsutil.callMethod(_jsPc, 'addIceCandidate', [_iceToJs(candidate)])); } @override