openEditor static method

Future<VideoEditorResult?> openEditor(
  1. Video video,
  2. {Configuration? configuration,
  3. Map<String, dynamic>? serialization}
)

Opens a new video editor.

Modally opens the editor with the given video. The editor can be customized with the configuration The serialization restores a previous state of the editor by re-applying all modifications to the video. Once finished, the editor either returns a VideoEditorResult or null if the editor was dismissed without exporting the video.

Implementation

static Future<VideoEditorResult?> openEditor(Video video,
    {Configuration? configuration,
    Map<String, dynamic>? serialization}) async {
  final result = await _channel.invokeMethod('openEditor', <String, dynamic>{
    'video': video._toJson(),
    'configuration': configuration?.toJson(),
    'serialization': serialization == null
        ? null
        : Platform.isIOS
            ? serialization
            : jsonEncode(serialization)
  });
  final segmentsEnabled = configuration?.export?.video?.segments == true;
  final release = segmentsEnabled && Platform.isAndroid
      ? () => _channel.invokeMethod(
          'release', <String, dynamic>{"identifier": result["identifier"]})
      : () => null;
  return result == null
      ? null
      : VideoEditorResult._fromJson(Map<String, dynamic>.from(result),
          release: release);
}