@@ -301,14 +301,21 @@ public void onMethodCall(MethodCall call, Result notSafeResult) {
301
301
302
302
FlutterRTCVideoRenderer render = renders .get (textureId );
303
303
304
- if (render == null ) {
304
+ if (render == null ) {
305
305
result .error ("FlutterRTCVideoRendererNotFound" , "render [" + textureId + "] not found !" , null );
306
306
return ;
307
307
}
308
308
309
309
MediaStream stream = getStreamForId (streamId );
310
310
render .setStream (stream );
311
311
result .success (null );
312
+ } else if (call .method .equals ("mediaStreamTrackHasTorch" )) {
313
+ String trackId = call .argument ("trackId" );
314
+ getUserMediaImpl .hasTorch (trackId , result );
315
+ } else if (call .method .equals ("mediaStreamTrackSetTorch" )) {
316
+ String trackId = call .argument ("trackId" );
317
+ boolean torch = call .argument ("torch" );
318
+ getUserMediaImpl .setTorch (trackId , torch , result );
312
319
} else if (call .method .equals ("mediaStreamTrackSwitchCamera" )) {
313
320
String trackId = call .argument ("trackId" );
314
321
getUserMediaImpl .switchCamera (trackId , result );
@@ -368,9 +375,9 @@ public void onMethodCall(MethodCall call, Result notSafeResult) {
368
375
if (track instanceof VideoTrack )
369
376
new FrameCapturer ((VideoTrack ) track , new File (path ), result );
370
377
else
371
- result .error ("It's not video track" , null , null );
378
+ result .error (null , "It's not video track" , null );
372
379
} else {
373
- result .error ("Track is null" , null , null );
380
+ result .error (null , "Track is null" , null );
374
381
}
375
382
} else if (call .method .equals ("getLocalDescription" )) {
376
383
String peerConnectionId = call .argument ("peerConnectionId" );
0 commit comments