How to capture video using intention in Galaxy Tab?

I have an intent that triggers video capture activity:

Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
            intent.putExtra(MediaStore.EXTRA_OUTPUT,  Uri.fromFile(videoFile));
            intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);
            startActivityForResult(intent,CAPTURE_VIDEO_ACTIVITY_REQUEST_CODE);

It works great on my SE X8, but on the Galaxy Tab, video capture activity never stops. After I stopped recording, there is no button to exit the video capture. Is there any additional parameter that I need to set?

+5
source share
3 answers

Just delete this line:

intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(videoFile));

After that, everything worked as expected for me on the Galaxy Tab.

+2
source

Delete

intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(videoFile));

works, but then you have to grab uri with

public void onActivityResult(int requestCode, int resultCode, Intent intent) {
    super.onActivityResult(requestCode, resultCode, intent);

    if ((requestCode == VIDEO_REQUEST_CODE) && (resultCode == RESULT_OK)) {

        // The URI string is in intent.getData());
    }
}

and move the video to another location if necessary functionality.

: MediaStore.EXTRA_OUTPUT ACTION_IMAGE_CAPTURE.

+1

To do this, you can prepare your own class SurfaceHolder. Just try the link. She wakes up perfectly.

0
source

All Articles