getMetadata static method

Future<MediaFile?> getMetadata(
  1. String filePath,
  2. MediaType type
)

Get metadata for a media file

Implementation

static Future<MediaFile?> getMetadata(String filePath, MediaType type) async {
  try {
    final result = await _channel.invokeMethod('getMetadata', {
      'filePath': filePath,
      'type': type.name,
    });

    if (result is Map<String, dynamic>) {
      return MediaFile.fromMetadata(result);
    }
    return null;
  } catch (e) {
    return null;
  }
}