getSessions static method

Future<List<Session>> getSessions()

Returns all sessions in the session history.

Implementation

static Future<List<Session>> getSessions() async {
  try {
    await init();
    return _platform.ffmpegKitConfigGetSessions().then((sessions) {
      if (sessions == null) {
        return List.empty();
      } else {
        return sessions
            .map((dynamic sessionObject) => FFmpegKitFactory.mapToSession(
                sessionObject as Map<dynamic, dynamic>))
            .toList();
      }
    });
  } on PlatformException catch (e, stack) {
    print("Plugin getSessions error: ${e.message}");
    return Future.error("getSessions failed.", stack);
  }
}