// import 'package:camera/camera.dart';
// //import 'package:image_picker_web/image_picker_web.dart';
// import '../interfaces/camara_interface.dart';
// import '../models/media_model.dart';
// import "package:universal_html/html.dart" as html;

// class CamaraPlugin implements CamaraInterface {
//   XFile? _currentImage;
//   List<XFile>? _currentImageList;

//   @override
//   Future<Media?> imageFromCamera() async {
//     /* _currentImage = await ImagePickerWeb().pickImage(
//         source: ImageSource.camera, maxWidth: 1024.0, maxHeight: 768.0
//       );
//     if (_currentImage == null) return Future.value(null);
//     String directorio = (await getApplicationDocumentsDirectory()).path;
//     String fecha = DateTime.now().millisecondsSinceEpoch.toString();
//     await _currentImage!.saveTo("$directorio/$fecha.jpg");

//     return Media(
//       ruta: _currentImage?.path,
//       tipo: 'imagen',
//     ); */
//   }

//   @override
//   Future<Media?> imageFromGallery() async {
//     /* _currentImage = await ImagePicker().pickImage(source: ImageSource.gallery);
//     if (_currentImage == null) return Future.value(null);

//     return Media(
//       ruta: _currentImage?.path,
//       tipo: 'imagen',
//     ); */
//   }

//   @override
//   Future<List<Media>?> multiImageFromGallery() async {
//     /* _currentImageList = await ImagePicker().pickMultiImage();
//     if (_currentImageList == null) return Future.value(null);
//     final List<Media> mediaList = [];

//     for (var media in _currentImageList!) {
//       mediaList.add(Media(
//         ruta: media.path,
//         tipo: 'imagen',
//       ));
//     }
//     return mediaList; */
//   }

//   @override
//   Future<Media?> videoFromCamera() async {
//     //html.File? videoFile = await ImagePickerWeb.getVideoAsFile();
//     /* ImagePicker picker = ImagePicker();
//     _currentImage = await picker.pickVideo(source: ImageSource.camera, maxDuration:const Duration(seconds: 15));
//     if (_currentImage == null) return Future.value(null);
//     //FlutterFFmpeg _flutterFFmpeg = FlutterFFmpeg();
//     String directorio = (await getApplicationDocumentsDirectory()).path;
//     String fecha = DateTime.now().millisecondsSinceEpoch.toString();
//     String laruta = "$directorio/$fecha.mp4";
//     await _currentImage!.saveTo(laruta); */


//    /*  String inputPath = laruta;//'path/to/your/original/video.mp4';
//     String outputPath =laruta;// 'path/to/your/compressed/video.mp4';

//     String command = '-i $inputPath -c:v libx264 -preset ultrafast $outputPath';
//     int rc = await _flutterFFmpeg.execute(command); */

//     /* var thumbnailFile = await VideoCompress.getFileThumbnail(
//       laruta.toString(),
//       quality: 50, // default(100)
//       position: -1 // default(-1)
//     ); */

//     /* MediaInfo? info = await VideoCompress.compressVideo(
//       laruta.toString(),
//       //quality: VideoQuality.DefaultQuality,
//       quality: VideoQuality.LowQuality,
//       //quality: VideoQuality.Res640x480Quality,
//       deleteOrigin: false,
//     );
    
//     await info!.file!.copy(laruta);
//     print("que onda con el path");
//     print(info.file!.path);
//     print(laruta);
//     //info!.file;

//     return Media(
//       ruta: laruta,
//       tipo: 'video',
//     ); */
//   }
// }
