使用" com.android.camera.action.TRIM"进行视频修剪(Gallery2包)

时间:2014-09-16 12:33:17

标签: android video android-gallery

我需要对视频实施修剪操作。我正在使用this代码,它在Gallery2软件包安装的手机上完美运行。但是它不会返回onActivityResult(如果攻击成功,意图不会返回任何结果)。

代码:

Intent trimVideoIntent = new Intent("com.android.camera.action.TRIM");

            // The key for the extra has been discovered from com.android.gallery3d.app.PhotoPage.KEY_MEDIA_ITEM_PATH
            trimVideoIntent.putExtra("media-item-path", FilePath);
            trimVideoIntent.setData(videoUri);

            // Check if the device can handle the Intent
            List<ResolveInfo> list = getPackageManager().queryIntentActivities(trimVideoIntent, 0);
            if (null != list && list.size() > 0) {
                startActivityForResult(trimVideoIntent,2); // Fires TrimVideo activity into being active
            }else {
                Toast.makeText(this, "Video trimming not supported", 1).show();
            }

修剪并返回结果后有没有办法关闭gallery2?

0 个答案:

没有答案