我有一个视频捕捉代码,可以在potrait和横向模式下捕捉视频。我想在android中以横向模式捕捉视频。请帮助我。
public void startRecordingVideo() {
if (getActivity().getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_FRONT)) {
Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
File mediaFile = new File(
Environment.getExternalStorageDirectory().getAbsolutePath() + "/myvideo.mp4");
videoUri = Uri.fromFile(mediaFile);
intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);
intent.putExtra(MediaStore.EXTRA_OUTPUT, videoUri);
intent.putExtra(MediaStore.EXTRA_FULL_SCREEN,true);
startActivityForResult(intent, VIDEO_CAPTURE);
} else {
Toast.makeText(this.getActivity(), "No camera on device", Toast.LENGTH_LONG).show();
}
}