File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -307,6 +307,22 @@ void FlutterWebRTC::HandleMethodCall(
307
307
GetValue<EncodableMap>(*method_call.arguments ());
308
308
const std::string track_id = findString (params, " trackId" );
309
309
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 ();
310
326
} else if (method_call.method_name ().compare (" peerConnectionClose" ) == 0 ) {
311
327
if (!method_call.arguments ()) {
312
328
result->Error (" Bad Arguments" , " Null constraints arguments received" );
Original file line number Diff line number Diff line change @@ -158,6 +158,8 @@ class RTCPeerConnection : public RefCountInterface {
158
158
OnSdpCreateFailure failure,
159
159
scoped_refptr<RTCMediaConstraints> constraints) = 0;
160
160
161
+ virtual void RestartIce () = 0;
162
+
161
163
virtual void Close () = 0;
162
164
163
165
virtual void SetLocalDescription (const string sdp,
You can’t perform that action at this time.
0 commit comments