private void startRecording() { mRecordableSurfaceView.startRecording(); mIsRecording = true; mRecordBtn.setText("Stop"); }
private void startRecording() { /** * hack for the spamming record button bug where if u tap the button quickly shit goes wrong * disable button on click then wait 250ms and re-enable it to stop. */ mRecordBtn.setEnabled(false); mBitmapHandler.postDelayed(new Runnable() { @Override public void run() { mRecordBtn.setEnabled(true); } }, 250); mRecordableSurfaceView.startRecording(); mIsRecording = true; }
mRecordableSurfaceView.startRecording();
@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; }