我想知道是否可以取消媒体录制。所谓取消指的是不保存该录制。目前我通过以下方式开始录制:
protected void startRecording() throws IOException
{
mrec = new MediaRecorder(); // Works well
mCamera.unlock();
mrec.setCamera(mCamera);
mrec.setPreviewDisplay(surfaceHolder.getSurface());
mrec.setVideoSource(MediaRecorder.VideoSource.CAMERA);
mrec.setAudioSource(MediaRecorder.AudioSource.MIC);
mrec.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH));
mrec.setPreviewDisplay(surfaceHolder.getSurface());
File picDirectory = new File(Environment.getExternalStorageDirectory() +"/TrouwApp");
picDirectory.mkdirs();
mrec.setOutputFile( Environment.getExternalStorageDirectory() +"/TrouwApp/" + date + "_" + videonr+ ".3gp");
mrec.prepare();
mrec.start();
Log.d(TAG, "Recording started!!");
}
并通过以下方式保存并停止它:
protected void stopRecording() {
mrec.stop();
mrec.release();
mCamera.release();
}
我想制作两个按钮。一个用于保存媒体文件(调用stopRecording())。另一个用于取消并删除媒体录制。这是否可能?如果是,怎么做?