createEdit method

Future<Video> createEdit(
  1. CreateVideoEditRequest request
)

Creates a new video edit from an existing video.

References an existing video by ID. Direct video file uploads via multipart are not yet supported.

Implementation

Future<Video> createEdit(CreateVideoEditRequest request) async {
  ensureNotClosed?.call();
  final url = requestBuilder.buildUrl('$_endpoint/edits');
  final headers = requestBuilder.buildHeaders();
  final httpRequest = http.Request('POST', url)
    ..headers.addAll(headers)
    ..body = jsonEncode(request.toJson());
  final response = await interceptorChain.execute(httpRequest);
  return Video.fromJson(jsonDecode(response.body) as Map<String, dynamic>);
}