ezequielc
ezequielc

Reputation: 235

How to capture video using intent in Galaxy Tab?

I have an intent that calls the 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 fine on my SE X8, but on Galaxy Tab the video capture activity never quits. After I stop recording, there is no button to quit the video capture. Is there any extra parameter I need to set?

Upvotes: 5

Views: 1476

Answers (3)

ElYeante
ElYeante

Reputation: 1755

Removing

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

works, but then you will have to capture the 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 is the functionality you need.

The crazy thing is that MediaStore.EXTRA_OUTPUT works perfectly with ACTION_IMAGE_CAPTURE.

Upvotes: 1

Praveenkumar
Praveenkumar

Reputation: 24506

You can prepare your own SurfaceHolder class for this. Just try this link It's wokring perfectly.

Upvotes: 0

ararog
ararog

Reputation: 1092

Just remove this line:

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

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

Upvotes: 2

Related Questions