AbedElazizShe / light_compressor

A powerful and easy-to-use video compression plugin for Flutter.
MIT License
59 stars 32 forks source link

Please add feature to resize videos #34

Open parmeetmaster opened 1 year ago

parmeetmaster commented 1 year ago

Hello sir,

Can you add sample to resize the video.Like your other dependency in android .If that is already exist kindly add inside sample.

return when (quality) { VideoQuality.VERY_LOW -> (bitrate 0.1).roundToInt() VideoQuality.LOW -> (bitrate 0.2).roundToInt() VideoQuality.MEDIUM -> (bitrate 0.3).roundToInt() VideoQuality.HIGH -> (bitrate 0.4).roundToInt() VideoQuality.VERY_HIGH -> (bitrate * 0.6).roundToInt() }

when { width >= 1920 || height >= 1920 -> { newWidth = (((width 0.5) / 16).roundToInt() 16) newHeight = (((height 0.5) / 16f).roundToInt() 16) } width >= 1280 || height >= 1280 -> { newWidth = (((width 0.75) / 16).roundToInt() 16) newHeight = (((height 0.75) / 16).roundToInt() 16) } width >= 960 || height >= 960 -> { newWidth = (((width 0.95) / 16).roundToInt() 16) newHeight = (((height 0.95) / 16).roundToInt() 16) } else -> { newWidth = (((width 0.9) / 16).roundToInt() 16) newHeight = (((height 0.9) / 16).roundToInt() 16) } }