File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -290,7 +290,14 @@ void FlutterWebRTC::HandleMethodCall(
290290 const EncodableMap params =
291291 GetValue<EncodableMap>(*method_call.arguments ());
292292 const std::string track_id = findString (params, " trackId" );
293- MediaStreamTrackSetEnable (track_id, std::move (result));
293+ const EncodableValue enable = findEncodableValue (params, " enabled" );
294+ RTCMediaTrack* track = MediaTrackForId (track_id);
295+ if (nullptr == track) {
296+ result->Error (" mediaStreamTrackSetEnableFailed" , " mediaStreamTrackSetEnable() track is null" );
297+ return ;
298+ }
299+ track->set_enabled (GetValue<bool >(enable));
300+ result->Success ();
294301 } else if (method_call.method_name ().compare (" trackDispose" ) == 0 ) {
295302 if (!method_call.arguments ()) {
296303 result->Error (" Bad Arguments" , " Null constraints arguments received" );
You can’t perform that action at this time.
0 commit comments