removeMetadata method

  1. @override
Future<String> removeMetadata({
  1. required String inputPath,
  2. required String outputPath,
  3. required Set<VideoMetadataField> fields,
})
override

Removes metadata for the provided fields from the source video found at inputPath, writing the resulting video to outputPath. The returned string should resolve to the final output path on disk.

Implementation

@override
Future<String> removeMetadata({
  required String inputPath,
  required String outputPath,
  required Set<VideoMetadataField> fields,
}) async {
  final payload = <String, dynamic>{
    'inputPath': inputPath,
    'outputPath': outputPath,
    'fields': fields.map((field) => field.wireValue).toList(),
  };

  final result = await _channel.invokeMapMethod<String, dynamic>(
    'removeMetadata',
    payload,
  );

  final resolvedPath = result?['outputPath'] as String?;
  if (resolvedPath == null || resolvedPath.isEmpty) {
    throw PlatformException(
      code: 'metadata_removal_failed',
      message: 'The platform implementation did not return an output path.',
      details: result,
    );
  }

  return resolvedPath;
}