8000 feat: Add restartIce for Windows. · dontcryme/flutter-webrtc@cc96251 · GitHub
[go: up one dir, main page]

8000 Skip to content

Commit cc96251

Browse files
committed
feat: Add restartIce for Windows.
1 parent e4c2283 commit cc96251

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

common/cpp/src/flutter_webrtc.cc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,22 @@ void FlutterWebRTC::HandleMethodCall(
307307
GetValue<EncodableMap>(*method_call.arguments());
308308
const std::string track_id = findString(params, "trackId");
309309
MediaStreamTrackDispose(track_id, std::move(result));
310+
} else if (method_call.method_name().compare("restartIce") == 0) {
311+
if (!method_call.arguments()) {
312+
result->Error("Bad Arguments", "Null constraints arguments received");
313+
return;
314+
}
315+
const EncodableMap params =
316+
GetValue<EncodableMap>(*method_call.arguments());
317+
const std::string peerConnectionId = findString(params, "peerConnectionId");
318+
RTCPeerConnection* pc = PeerConnectionForId(peerConnectionId);
319+
if (pc == nullptr) {
320+
result->Error("restartIceFailed",
321+
"restartIce() peerConnection is null");
322+
return;
323+
}
324+
pc->RestartIce();
325+
result->Success();
310326
} else if (method_call.method_name().compare("peerConnectionClose") == 0) {
311327
if (!method_call.arguments()) {
312328
result->Error("Bad Arguments", "Null constraints arguments received");

third_party/libwebrtc/include/rtc_peerconnection.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ class RTCPeerConnection : public RefCountInterface {
158158
OnSdpCreateFailure failure,
159159
scoped_refptr<RTCMediaConstraints> constraints) = 0;
160160

161+
virtual void RestartIce() = 0;
162+
161163
virtual void Close() = 0;
162164

163165
virtual void SetLocalDescription(const string sdp,
Binary file not shown.

0 commit comments

Comments
 (0)
0