executeAsyncWithArguments method

Future<int> executeAsyncWithArguments(
  1. List<String> arguments,
  2. ExecuteCallback executeCallback
)

Executes FFmpeg asynchronously with commandArguments provided. This method starts the execution and does not wait the execution to complete. It returns immediately with executionId created for this execution.

Implementation

Future<int> executeAsyncWithArguments(
    List<String> arguments, ExecuteCallback executeCallback) async {
  try {
    return await _methodChannel.invokeMethod(
        'executeFFmpegAsyncWithArguments',
        {'arguments': arguments}).then((map) {
      var executionId = map['executionId'];
      FlutterSoundFFmpegConfig._executeCallbackMap[executionId] =
          executeCallback;
      return executionId;
    });
  } on PlatformException catch (e, stack) {
    logger.e('Plugin executeFFmpegAsyncWithArguments error: ${e.message}');
    return Future.error('executeFFmpegAsyncWithArguments failed.', stack);
  }
}