capacitor-plugins icon indicating copy to clipboard operation
capacitor-plugins copied to clipboard

feat: video compression with file compressor

Open Slavrix opened this issue 8 months ago • 1 comments

Plugin(s)

  • [ ] Android Foreground Service
  • [ ] Android Battery Optimization
  • [ ] App Update
  • [ ] Background Task
  • [ ] Badge
  • [ ] Bluetooth Low Energy
  • [ ] Cloudinary
  • [ ] Datetime Picker
  • [X] File Compressor
  • [ ] File Opener
  • [ ] File Picker
  • [ ] Live Update
  • [ ] Managed Configurations
  • [ ] NFC
  • [ ] Photo Editor
  • [ ] Printer
  • [ ] Screen Orientation
  • [ ] Zip

Current problem

The file compressor plugin currently only supports images. Extending this to handle other file types, primarily video would be awesome.

Preferred solution

Extend the plugin in have compressVideo method.

eg const compressVideo = async () => { const { path } = await FileCompressor.compressVideo({ mimeType: 'video/mp4', path: 'content://...', quality: 0.7 }); return path; };

Alternative options

maybe transcodeVideo instead

const transcodeVideo = async () => { const { path } = await FileCompressor.transcodeVideo({ mimeType: 'video/mp4', path: 'content://...', quality: 0.7, maintainAspect: true, height: 480 }); return path; };

Additional context

Ability to use webp and webm would be great too

Before submitting

  • [X] I have read and followed the feature request guidelines.
  • [X] I have attached links to possibly related issues and discussions.

Slavrix avatar Jun 26 '24 04:06 Slavrix