diff --git a/CHANGELOG.md b/CHANGELOG.md index caf5c73..fb43052 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ -------------------------------------------- +[1.5.2+hotfix.1] - 2025-02-23. + +* remove platform_detect. + [1.5.2] - 2025-02-23. * fix stats for web. diff --git a/lib/src/rtc_peerconnection_impl.dart b/lib/src/rtc_peerconnection_impl.dart index 8d171a0..458d007 100644 --- a/lib/src/rtc_peerconnection_impl.dart +++ b/lib/src/rtc_peerconnection_impl.dart @@ -4,7 +4,6 @@ import 'dart:js_interop'; import 'dart:js_interop_unsafe'; import 'package:dart_webrtc/dart_webrtc.dart'; -import 'package:platform_detect/platform_detect.dart'; import 'package:web/web.dart' as web; import 'media_stream_track_impl.dart'; @@ -44,7 +43,7 @@ class RTCPeerConnectionWeb extends RTCPeerConnection { iceConnectionStateForString(_jsPc.iceConnectionState); onIceConnectionState?.call(_iceConnectionState!); - if (browser.isFirefox) { + if (web.Device.isFirefox) { switch (_iceConnectionState!) { case RTCIceConnectionState.RTCIceConnectionStateNew: _connectionState = RTCPeerConnectionState.RTCPeerConnectionStateNew; @@ -93,7 +92,7 @@ class RTCPeerConnectionWeb extends RTCPeerConnection { _jsPc.addEventListener('signalingstatechange', onSignalingStateChange.toJS); - if (!browser.isFirefox) { + if (!web.Device.isFirefox) { final void Function(JSAny) onConnectionStateChange = (_) { _connectionState = peerConnectionStateForString(_jsPc.connectionState); onConnectionState?.call(_connectionState!); @@ -159,7 +158,7 @@ class RTCPeerConnectionWeb extends RTCPeerConnection { @override Future getIceConnectionState() async { _iceConnectionState = iceConnectionStateForString(_jsPc.iceConnectionState); - if (browser.isFirefox) { + if (web.Device.isFirefox) { switch (_iceConnectionState!) { case RTCIceConnectionState.RTCIceConnectionStateNew: _connectionState = RTCPeerConnectionState.RTCPeerConnectionStateNew; @@ -196,7 +195,8 @@ class RTCPeerConnectionWeb extends RTCPeerConnection { @override Future getConnectionState() async { - if (browser.isFirefox) { + /// platform is Firefox + if (web.Device.isFirefox) { await getIceConnectionState(); } else { _connectionState = peerConnectionStateForString(_jsPc.connectionState); diff --git a/pubspec.yaml b/pubspec.yaml index 94364ce..5c762d1 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.5.2 +version: 1.5.2+hotfix.1 homepage: https://github.com/flutter-webrtc/dart-webrtc environment: @@ -11,7 +11,6 @@ dependencies: js: ">0.6.0 <0.8.0" logging: ^1.1.0 meta: ^1.8.0 - platform_detect: ^2.1.5 synchronized: ^3.0.0+3 web: ^1.0.0 webrtc_interface: ^1.2.1