File tree 1 file changed +5
-8
lines changed
1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -72,11 +72,10 @@ class RTCPeerConnectionWeb extends RTCPeerConnection {
72
72
onIceConnectionState? .call (_iceConnectionState);
73
73
});
74
74
75
- js.JsObject .fromBrowserObject (_jsPc)['onicegatheringstatechange' ] =
76
- js.JsFunction .withThis ((_) {
75
+ jsutil.setProperty (_jsPc, 'onicegatheringstatechange' , js.allowInterop ((_) {
77
76
_iceGatheringState = iceGatheringStateforString (_jsPc.iceGatheringState);
78
77
onIceGatheringState? .call (_iceGatheringState);
79
- });
78
+ })) ;
80
79
81
80
_jsPc.onRemoveStream.listen ((mediaStreamEvent) {
82
81
final _remoteStream = _remoteStreams.remove (mediaStreamEvent.stream.id);
@@ -88,14 +87,12 @@ class RTCPeerConnectionWeb extends RTCPeerConnection {
88
87
onSignalingState? .call (_signalingState);
89
88
});
90
89
91
- js.JsObject .fromBrowserObject (_jsPc)['connectionstatechange' ] =
92
- js.JsFunction .withThis ((_, state) {
93
- _connectionState = peerConnectionStateForString (state);
90
+ _jsPc.onIceConnectionStateChange.listen ((_) {
91
+ _connectionState = peerConnectionStateForString (_jsPc.iceConnectionState);
94
92
onConnectionState? .call (_connectionState);
95
93
});
96
94
97
- js.JsObject .fromBrowserObject (_jsPc)['negotiationneeded' ] =
98
- js.JsFunction .withThis (() {
95
+ _jsPc.onNegotiationNeeded.listen ((_) {
99
96
onRenegotiationNeeded? .call ();
100
97
});
101
98
You can’t perform that action at this time.
0 commit comments