我使用SiliCompressor library并且我在结果中大部分只获得了611个确切字节,显然压缩在任何情况下都不起作用。我的代码有问题吗?
new AsyncTask<Void, Void, Uri>() {
@Override
protected Uri doInBackground(Void... voids) {
Uri newFileUri = null;
try {
File f = getDir("Videos", Context.MODE_PRIVATE); //Creating an internal dir;
if (f.mkdirs() || f.isDirectory()) {
//compress and output new video specs
String filePath = SiliCompressor.with(UploadPostActivity.this).compressVideo(mVideoUri, f.getPath());
newFileUri = Uri.fromFile(new File(filePath));
}
} catch (Exception e) {
e.printStackTrace();
}
return newFileUri;
}
@Override
protected void onPostExecute(Uri videoUri) {
super.onPostExecute(videoUri);
mVideoView.setVideoURI(videoUri);
}
}.execute();