changeEncoding method

  1. @override
Future<void> changeEncoding({
  1. required String? videoUri,
  2. required String? outputPath,
  3. required OnEditResult onResult,
  4. required OnEditError onError,
  5. int? width,
  6. int? height,
  7. TruvideoSdkVideoFrameRate frameRate = TruvideoSdkVideoFrameRate.defaultFrameRate,
})
override

Implementation

@override
Future<void> changeEncoding({
  required String? videoUri,
  required String? outputPath,
  required OnEditResult onResult,
  required OnEditError onError,
  int? width,
  int? height,
  TruvideoSdkVideoFrameRate frameRate =
      TruvideoSdkVideoFrameRate.defaultFrameRate,
}) async {
  try {
    final config = jsonEncode({
      'height': height,
      'width': width,
      'framesRate': frameRate.name,
    });
    final result = await methodChannel.invokeMethod('encodeVideo', {
      'videoUri': videoUri,
      'resultPath': outputPath,
      'config': config,
    });
    onResult(result.toString());
  } on PlatformException catch (e) {
    onError(e.message);
  }
}