'How to use SiliCompressor to compress videos and image?
Hi I am a new android developer working on a project that involves uploading images and videos. I need to compress files and I've seen the library SiliCompressor but the documentation and other explanations is too vague for me. Can you tell me how to use it? But in an easy to understand way. Thanks!
Solution 1:[1]
private class CompressVideo extends AsyncTask<String,String,String> {
Dialog dialog;
@Override
protected void onPreExecute() {
super.onPreExecute();
dialog = ProgressDialog.show(AddPostActivity.this, "", "Compressing...");
}
@Override
protected String doInBackground(String... strings) {
String videoPath = null;
try {
Uri uri = Uri.parse(strings[1]);
videoPath = SiliCompressor.with(AddPostActivity.this)
.compressVideo(uri,strings[2]);
} catch (URISyntaxException e) {
e.printStackTrace();
}
return videoPath;
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | OneKe |
