@@ -4,7 +4,6 @@ import 'dart:js_interop';
4
4
import 'dart:js_interop_unsafe' ;
5
5
6
6
import 'package:dart_webrtc/dart_webrtc.dart' ;
7
- import 'package:platform_detect/platform_detect.dart' ;
8
7
import 'package:web/web.dart' as web;
9
8
10
9
import 'media_stream_track_impl.dart' ;
@@ -44,7 +43,7 @@ class RTCPeerConnectionWeb extends RTCPeerConnection {
44
43
iceConnectionStateForString (_jsPc.iceConnectionState);
45
44
onIceConnectionState? .call (_iceConnectionState! );
46
45
47
- if (browser .isFirefox) {
46
+ if (web. Device .isFirefox) {
48
47
switch (_iceConnectionState! ) {
49
48
case RTCIceConnectionState .RTCIceConnectionStateNew :
50
49
_connectionState = RTCPeerConnectionState .RTCPeerConnectionStateNew ;
@@ -93,7 +92,7 @@ class RTCPeerConnectionWeb extends RTCPeerConnection {
93
92
94
93
_jsPc.addEventListener ('signalingstatechange' , onSignalingStateChange.toJS);
95
94
96
- if (! browser .isFirefox) {
95
+ if (! web. Device .isFirefox) {
97
96
final void Function (JSAny ) onConnectionStateChange = (_) {
98
97
_connectionState = peerConnectionStateForString (_jsPc.connectionState);
99
98
onConnectionState? .call (_connectionState! );
@@ -159,7 +158,7 @@ class RTCPeerConnectionWeb extends RTCPeerConnection {
159
158
@override
160
159
Future <RTCIceConnectionState ?> getIceConnectionState () async {
161
160
_iceConnectionState = iceConnectionStateForString (_jsPc.iceConnectionState);
162
- if (browser .isFirefox) {
161
+ if (web. Device .isFirefox) {
163
162
switch (_iceConnectionState! ) {
164
163
case RTCIceConnectionState .RTCIceConnectionStateNew :
165
164
_connectionState = RTCPeerConnectionState .RTCPeerConnectionStateNew ;
@@ -196,7 +195,8 @@ class RTCPeerConnectionWeb extends RTCPeerConnection {
196
195
197
196
@override
198
197
Future <RTCPeerConnectionState ?> getConnectionState () async {
199
- if (browser.isFirefox) {
198
+ /// platform is Firefox
199
+ if (web.Device .isFirefox) {
200
200
await getIceConnectionState ();
201
201
} else {
202
202
_connectionState = peerConnectionStateForString (_jsPc.connectionState);
0 commit comments