File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 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 {
7272 onIceConnectionState? .call (_iceConnectionState);
7373 });
7474
75- js.JsObject .fromBrowserObject (_jsPc)['onicegatheringstatechange' ] =
76- js.JsFunction .withThis ((_) {
75+ jsutil.setProperty (_jsPc, 'onicegatheringstatechange' , js.allowInterop ((_) {
7776 _iceGatheringState = iceGatheringStateforString (_jsPc.iceGatheringState);
7877 onIceGatheringState? .call (_iceGatheringState);
79- });
78+ })) ;
8079
8180 _jsPc.onRemoveStream.listen ((mediaStreamEvent) {
8281 final _remoteStream = _remoteStreams.remove (mediaStreamEvent.stream.id);
@@ -88,14 +87,12 @@ class RTCPeerConnectionWeb extends RTCPeerConnection {
8887 onSignalingState? .call (_signalingState);
8988 });
9089
91- js.JsObject .fromBrowserObject (_jsPc)['connectionstatechange' ] =
92- js.JsFunction .withThis ((_, state) {
93- _connectionState = peerConnectionStateForString (state);
90+ _jsPc.onIceConnectionStateChange.listen ((_) {
91+ _connectionState = peerConnectionStateForString (_jsPc.iceConnectionState);
9492 onConnectionState? .call (_connectionState);
9593 });
9694
97- js.JsObject .fromBrowserObject (_jsPc)['negotiationneeded' ] =
98- js.JsFunction .withThis (() {
95+ _jsPc.onNegotiationNeeded.listen ((_) {
9996 onRenegotiationNeeded? .call ();
10097 });
10198
You can’t perform that action at this time.
0 commit comments