listSessions static method
Lists all FFmpeg sessions in the session history.
Implementation
static Future<List<FFmpegSession>> listSessions() async {
try {
await FFmpegKitConfig.init();
return _platform.ffmpegKitListSessions().then((sessions) {
if (sessions == null) {
return List.empty();
} else {
return sessions
.map((dynamic sessionObject) => FFmpegKitFactory.mapToSession(
sessionObject as Map<dynamic, dynamic>))
.map((session) => session as FFmpegSession)
.toList();
}
});
} on PlatformException catch (e, stack) {
print("Plugin listSessions error: ${e.message}");
return Future.error("listSessions failed.", stack);
}
}