from static method

Future<MediaInformation?> from(
  1. String ffprobeJsonOutput
)

Extracts MediaInformation from the given FFprobe json output. Note that this method does not fail as fromWithError does and returns null on error.

Implementation

static Future<MediaInformation?> from(String ffprobeJsonOutput) async {
  try {
    await FFmpegKitConfig.init();
    return _platform
        .mediaInformationJsonParserFrom(ffprobeJsonOutput)
        .then((properties) {
      if (properties == null || properties.length == 0) {
        return null;
      } else {
        return new MediaInformation(properties);
      }
    });
  } on PlatformException catch (e, stack) {
    print("Plugin from error: ${e.message}");
    return Future.error("from failed.", stack);
  }
}