listExecutions method
Lists ongoing FFmpeg executions.
Implementation
Future<List<FFmpegExecution>> listExecutions() async {
try {
return await _methodChannel.invokeMethod('listExecutions').then((value) {
var mapList = value as List<dynamic>;
List<FFmpegExecution> executions =
List<FFmpegExecution>.empty(growable: true);
for (int i = 0; i < mapList.length; i++) {
var execution = new FFmpegExecution(
command: mapList[i]["command"],
executionId: mapList[i]["executionId"],
startTime: DateTime.fromMillisecondsSinceEpoch(
mapList[i]["startTime"].toInt()));
executions.add(execution);
}
return executions;
});
} on PlatformException catch (e, stack) {
print("Plugin listExecutions error: ${e.message}");
return Future.error("listExecutions failed.", stack);
}
}