48
48
import io .flutter .plugin .common .MethodChannel ;
49
49
import io .flutter .plugin .common .MethodChannel .MethodCallHandler ;
50
50
import io .flutter .plugin .common .MethodChannel .Result ;
51
- import io .flutter .plugin .common .PluginRegistry .Registrar ;
52
51
53
52
/**
54
53
* <h3>Flutter FFmpeg Plugin</h3>
@@ -90,15 +89,17 @@ public class FlutterFFmpegPlugin implements MethodCallHandler, EventChannel.Stre
90
89
public static final String EVENT_EXECUTE = "FlutterFFmpegExecuteCallback" ;
91
90
92
91
private EventChannel .EventSink eventSink ;
93
- private final Registrar registrar ;
92
+ @ SuppressWarnings ("deprecation" )
93
+ private final io .flutter .plugin .common .PluginRegistry .Registrar registrar ;
94
94
private final FlutterFFmpegResultHandler flutterFFmpegResultHandler ;
95
95
96
96
/**
97
97
* Registers plugin to registry.
98
98
*
99
99
* @param registrar receiver of plugin registration
100
100
*/
101
- public static void registerWith (final Registrar registrar ) {
101
+ @ SuppressWarnings ("deprecation" )
102
+ public static void registerWith (final io .flutter .plugin .common .PluginRegistry .Registrar registrar ) {
102
103
FlutterFFmpegPlugin flutterFFmpegPlugin = new FlutterFFmpegPlugin (registrar );
103
104
104
105
final MethodChannel channel = new MethodChannel (registrar .messenger (), "flutter_ffmpeg" );
@@ -108,7 +109,8 @@ public static void registerWith(final Registrar registrar) {
108
109
eventChannel .setStreamHandler (flutterFFmpegPlugin );
109
110
}
110
111
111
- private FlutterFFmpegPlugin (Registrar registrar ) {
112
+ @ SuppressWarnings ("deprecation" )
113
+ private FlutterFFmpegPlugin (io .flutter .plugin .common .PluginRegistry .Registrar registrar ) {
112
114
this .registrar = registrar ;
113
115
114
116
this .flutterFFmpegResultHandler = new FlutterFFmpegResultHandler ();
@@ -286,6 +288,11 @@ public void apply(final Statistics statistics) {
286
288
final String pipe = Config .registerNewFFmpegPipe (getActiveContext ());
287
289
flutterFFmpegResultHandler .success (result , toStringMap (KEY_PIPE , pipe ));
288
290
291
+ } else if (call .method .equals ("closeFFmpegPipe" )) {
292
+ String ffmpegPipePath = call .argument ("ffmpegPipePath" );
293
+
294
+ Config .closeFFmpegPipe (ffmpegPipePath );
295
+
289
296
} else if (call .method .equals ("setEnvironmentVariable" )) {
290
297
String variableName = call .argument ("variableName" );
291
298
String variableValue = call .argument ("variableValue" );
0 commit comments