diff --git a/lib/src/progress_callback/compress_mixin.dart b/lib/src/progress_callback/compress_mixin.dart index 916a8cb4..fab6e493 100644 --- a/lib/src/progress_callback/compress_mixin.dart +++ b/lib/src/progress_callback/compress_mixin.dart @@ -1,5 +1,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; + import 'subscription.dart'; class CompressMixin { @@ -13,15 +14,6 @@ class CompressMixin { MethodChannel get channel => _channel; - bool _isCompressing = false; - - bool get isCompressing => _isCompressing; - - @protected - void setProcessingStatus(bool status) { - _isCompressing = status; - } - Future _progressCallback(MethodCall call) async { switch (call.method) { case 'updateProgress': diff --git a/lib/src/video_compress/video_compressor.dart b/lib/src/video_compress/video_compressor.dart index 3b7b38e3..8fac3013 100644 --- a/lib/src/video_compress/video_compressor.dart +++ b/lib/src/video_compress/video_compressor.dart @@ -1,7 +1,6 @@ import 'dart:async'; import 'dart:convert'; import 'dart:io'; -import 'dart:typed_data'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -129,19 +128,11 @@ extension Compress on IVideoCompress { bool? includeAudio, int frameRate = 30, }) async { - if (isCompressing) { - throw StateError('''VideoCompress Error: - Method: compressVideo - Already have a compression process, you need to wait for the process to finish or stop it'''); - } - if (compressProgress$.notSubscribed) { debugPrint('''VideoCompress: You can try to subscribe to the compressProgress\$ stream to know the compressing state.'''); } - // ignore: invalid_use_of_protected_member - setProcessingStatus(true); final jsonStr = await _invoke('compressVideo', { 'path': path, 'quality': quality.index, @@ -152,9 +143,6 @@ extension Compress on IVideoCompress { 'frameRate': frameRate, }); - // ignore: invalid_use_of_protected_member - setProcessingStatus(false); - if (jsonStr != null) { final jsonMap = json.decode(jsonStr); return MediaInfo.fromJson(jsonMap);