@@ -4,7 +4,6 @@ import 'dart:js_interop';
44import 'dart:js_interop_unsafe' ;
55
66import 'package:dart_webrtc/dart_webrtc.dart' ;
7- import 'package:platform_detect/platform_detect.dart' ;
87import 'package:web/web.dart' as web;
98
109import 'media_stream_track_impl.dart' ;
@@ -44,7 +43,7 @@ class RTCPeerConnectionWeb extends RTCPeerConnection {
4443 iceConnectionStateForString (_jsPc.iceConnectionState);
4544 onIceConnectionState? .call (_iceConnectionState! );
4645
47- if (browser .isFirefox) {
46+ if (web. Device .isFirefox) {
4847 switch (_iceConnectionState! ) {
4948 case RTCIceConnectionState .RTCIceConnectionStateNew :
5049 _connectionState = RTCPeerConnectionState .RTCPeerConnectionStateNew ;
@@ -93,7 +92,7 @@ class RTCPeerConnectionWeb extends RTCPeerConnection {
9392
9493 _jsPc.addEventListener ('signalingstatechange' , onSignalingStateChange.toJS);
9594
96- if (! browser .isFirefox) {
95+ if (! web. Device .isFirefox) {
9796 final void Function (JSAny ) onConnectionStateChange = (_) {
9897 _connectionState = peerConnectionStateForString (_jsPc.connectionState);
9998 onConnectionState? .call (_connectionState! );
@@ -159,7 +158,7 @@ class RTCPeerConnectionWeb extends RTCPeerConnection {
159158 @override
160159 Future <RTCIceConnectionState ?> getIceConnectionState () async {
161160 _iceConnectionState = iceConnectionStateForString (_jsPc.iceConnectionState);
162- if (browser .isFirefox) {
161+ if (web. Device .isFirefox) {
163162 switch (_iceConnectionState! ) {
164163 case RTCIceConnectionState .RTCIceConnectionStateNew :
165164 _connectionState = RTCPeerConnectionState .RTCPeerConnectionStateNew ;
@@ -196,7 +195,8 @@ class RTCPeerConnectionWeb extends RTCPeerConnection {
196195
197196 @override
198197 Future <RTCPeerConnectionState ?> getConnectionState () async {
199- if (browser.isFirefox) {
198+ /// platform is Firefox
199+ if (web.Device .isFirefox) {
200200 await getIceConnectionState ();
201201 } else {
202202 _connectionState = peerConnectionStateForString (_jsPc.connectionState);
0 commit comments