changeEncoding method
Future<void>
changeEncoding({
- required String? videoUri,
- required String? outputPath,
- int? width,
- int? height,
- TruvideoSdkVideoFrameRate frameRate = TruvideoSdkVideoFrameRate.defaultFrameRate,
- required dynamic onResult(),
- required dynamic onError(
- String? message
override
Implementation
@override
Future<void> changeEncoding(
{required String? videoUri,
required String? outputPath,
int? width,
int? height,
TruvideoSdkVideoFrameRate frameRate =
TruvideoSdkVideoFrameRate.defaultFrameRate,
required Function(String?) onResult,
required Function(String? message) onError}) 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);
} on PlatformException catch (e) {
onError(e.message);
}
}