我有一个videoView,它从与Android图库中的视频文件对应的路径播放视频。
现在,我需要以某种方式将此VideoView中的视频私密地存储到应用程序的内部存储中。我已经成功地使用以下方法对照片进行了处理。
VideoView videoView1 = (VideoView)promptsView.findViewById(R.id.videoView09);
String SrcPath = "/storage/emulated/0/DCIM/Camera/20150824_210148.mp4";
videoView1.setVideoPath(SrcPath);
videoView1.requestFocus();
videoView1.start();
现在,我需要以某种方式将此VideoView中的视频私密地存储到应用程序的内部存储中。我已经成功地使用以下方法对照片进行了处理。
public String saveImageToInternalStorage(Bitmap image, String imgRequestedName) {
ContextWrapper cw = new ContextWrapper(getActivity());
File directory = cw.getDir("imageDir", Context.MODE_PRIVATE);
File mypath=new File(directory,imgRequestedName+".jpg");
String loc = mypath.getAbsolutePath();
FileOutputStream fos = null;
try {
fos = new FileOutputStream(mypath);
image.compress(Bitmap.CompressFormat.JPEG, 70, fos);
SharedPreferences pref = getActivity().getApplicationContext().getSharedPreferences("MyPref", Context.MODE_PRIVATE);
final SharedPreferences.Editor editor = pref.edit();
editor.putInt("totalImageCount",(pref.getInt("totalImageCount",0))+1);
editor.commit();
fos.close();
} catch (Exception e) {
e.printStackTrace();
}
return mypath.getAbsolutePath();
}
如何做到视频的等效处理?
如何从内部存储器中读取视频?