Is there any possibilities to hide pause button from camera in android

时间:2016-12-02 05:21:30

标签: android

I want to record the video along with timer.I have implementing to record the video by using the below coding.And also set the timer limit.All of them working fine.But i don't want to stop or pause the timer after it starts.Is there any possibilities to hide the pause button or not to stop the timer during recording.

 public void getPhotoFromCamera() {

        if (!marshMallowPermission.checkPermissionForCamera()&&!marshMallowPermission.checkPermissionForRecord()) {
            marshMallowPermission.requestPermissionForCamera();

            marshMallowPermission. requestPermissionForRecord();
        } else {
            if (!marshMallowPermission.checkPermissionForExternalStorage()) {
                marshMallowPermission.requestPermissionForExternalStorage();
            } else {
                Intent takeVideoIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);

                takeVideoIntent.putExtra("android.intent.extras.LENS_FACING_FRONT", 1);
                takeVideoIntent.putExtra("android.intent.extras.CAMERA_FACING", android.hardware.Camera.CameraInfo.CAMERA_FACING_FRONT);
                takeVideoIntent.putExtra("android.intent.extra.USE_FRONT_CAMERA", true);
                takeVideoIntent.putExtra(MediaStore.EXTRA_DURATION_LIMIT, 60);

       /* imgag1.setVisibility(View.VISIBLE);
        imgag1.startAnimation(animFadein);*/

                if (takeVideoIntent.resolveActivity(getPackageManager()) != null) {
                    startActivityForResult(takeVideoIntent, REQUEST_VIDEO_CAPTURE);
                }


            }
        }
    }

1 个答案:

答案 0 :(得分:0)

No, you cannot do so using the video capture intent. The reason is that the intent is starting an Activity in an app. Its not a built in part of the framework, its whatever app says it can capture video. It can and does differ between OEMs. So they would all need to agree on a set of extras to implement those behaviors, and that's never happened. ANd at this point in time even if they did it would take years before it could be counted on working most of the time.

You could however write a custom video capture activity if you wanted to. I wouldn't suggest it unless its a really important feature for you, its a lot of work to get right.

相关问题