I have an url. It is a direct link to the video. How to convert it to the File?
I found a solution how to convert an image
Bitmap bitmap = null;
InputStream input = new URL(imgUrl).openStream();
bitmap = BitmapFactory.decodeStream(input);
File file = new File(getCacheDir(), "1");
file.createNewFile();
ByteArrayOutputStream bos = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 0 /*ignored for PNG*/, bos);
byte[] bitmapdata = bos.toByteArray();
FileOutputStream fos = new FileOutputStream(file);
fos.write(bitmapdata);
fos.flush();
fos.close();
But I can't find how to convert a video?