getGifBytesFromVideo function
Implementation
Future<Uint8List> getGifBytesFromVideo(
String path, {
int fps = 1,
int? width,
int? height,
bool forceOriginalAspectRatio = true,
String? textMessagesJsonString,
}) async {
String basePath = 'assets/packages/gify/assets/web/js';
// web worker
final worker = Worker('$basePath/gif_repository_web_video_worker.dart.js');
worker.postMessage({
'path': path,
'fps': fps,
'width': width,
'height': height,
'forceOriginalAspectRatio': forceOriginalAspectRatio,
'textMessages': textMessagesJsonString,
});
final result = await worker.onMessage.first;
return Uint8List.fromList(result.data);
}