private void stopRecording() { mRecordableSurfaceView.stopRecording(); mIsRecording = false; mBitmapHandler.postDelayed(new Runnable() { @Override public void run() { showRecordedFile(mOutputFile.getAbsolutePath()); } }, 250); }
private void stopRecording() { mRecordBtn.setText("Record"); Log.e(TAG, "Stopping"); mRecordableSurfaceView.stopRecording(); try { mOutputFile = getVideoFile(); android.graphics.Point size = new android.graphics.Point(); getWindowManager().getDefaultDisplay().getRealSize(size); mRecordableSurfaceView.initRecorder(mOutputFile, size.x, size.y, null, null); } catch (IOException ioex) { Log.e(TAG, "Couldn't re-init recording", ioex); } mIsRecording = false; Toast.makeText(this, "File recording complete: " + getVideoFile().getAbsolutePath(), Toast.LENGTH_LONG).show(); }
private void stopRecording() { if (mIsRecording) { mTimeElapsedTextView.setText("0:00"); mRecordableSurfaceView.stopRecording(); try { mCurrentVideoFile = getVideoFile(); android.graphics.Point size = new android.graphics.Point(); getWindowManager().getDefaultDisplay().getRealSize(size); mRecordableSurfaceView.initRecorder(mCurrentVideoFile, size.x, size.y, null, null); } catch (IOException ioex) { Log.e(TAG, "Couldn't re-init recording", ioex); } mIsRecording = false; } mRecordButton.setBackgroundResource(R.drawable.record_off); mRecordButton.setEnabled(true); //restart the camera with anew surface Toast.makeText(this, "File recording complete: " + getVideoFile().getAbsolutePath(), Toast.LENGTH_LONG).show(); }
@Override public boolean onOptionsItemSelected(MenuItem item) { if (mIsRecording) { mGLView.stopRecording(); Uri contentUri = FileProvider.getUriForFile(this, "com.example.android.opengl.fileprovider", mOutputFile); share(contentUri); mIsRecording = false; mIsRecording = false; mOutputFile = createVideoOutputFile(); try { int screenWidth = mGLView.getWidth(); int screenHeight = mGLView.getHeight(); mGLView.initRecorder(mOutputFile, (int) screenWidth, (int) screenHeight, null, null); } catch (IOException ioex) { Log.e(TAG, "Couldn't re-init recording", ioex); } item.setTitle("Record"); } else { mGLView.startRecording(); Log.v(TAG, "Recording Started"); item.setTitle("Stop"); mIsRecording = true; } return true; }
@Override protected void onPause() { mIsPaused = true; if (mRenderer != null && mIsRecording) { mRecordableSurfaceView.stopRecording(); } mRecordableSurfaceView.pause(); mRecordButton.setBackgroundResource(R.drawable.record_off); shutdownCamera(); AndroidUtils.cleanUpFileStubs(); mIsRecording = false; super.onPause(); }