refactor(ui): remove video compression
Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import 'dart:async';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:synchronized/synchronized.dart';
|
||||
import 'package:video_compress/video_compress.dart';
|
||||
import 'package:video_thumbnail/video_thumbnail.dart';
|
||||
|
||||
///
|
||||
@@ -12,32 +10,6 @@ class _IVideoService {
|
||||
|
||||
/// Singleton instance of [_IVideoService]
|
||||
static final _IVideoService instance = _IVideoService._();
|
||||
final _lock = Lock();
|
||||
|
||||
/// compress video from [path]
|
||||
/// compress video from [path] return [Future<MediaInfo>]
|
||||
///
|
||||
/// you can choose its [quality] and [frameRate]
|
||||
///
|
||||
/// ## example
|
||||
/// ```dart
|
||||
/// final info = await _flutterVideoCompress.compressVideo(
|
||||
/// file.path,
|
||||
/// );
|
||||
/// debugPrint(info.toJson());
|
||||
/// ```
|
||||
Future<MediaInfo?> compressVideo(
|
||||
String path, {
|
||||
int frameRate = 30,
|
||||
VideoQuality quality = VideoQuality.DefaultQuality,
|
||||
}) async =>
|
||||
_lock.synchronized(
|
||||
() => VideoCompress.compressVideo(
|
||||
path,
|
||||
frameRate: frameRate,
|
||||
quality: quality,
|
||||
),
|
||||
);
|
||||
|
||||
/// Generates a thumbnail image data in memory as UInt8List,
|
||||
/// it can be easily used by Image.memory(...).
|
||||
|
||||
Reference in New Issue
Block a user