从视图获取视频文件

时间:2018-06-22 08:16:44

标签: android view android-videoview fileoutputstream

我有一个包含videoview和imageview的视图。我想将此视图导出为内部存储中的视频。如果我没有videoview我正在使用此代码。此代码作为图像文件获取。但是我想要视频文件。

File file = new File(selectedOutputPath);
        mFile = file;
        try {
            FileOutputStream out = new FileOutputStream(file);

            if (parentView != null) {
                parentView.setDrawingCacheEnabled(true);
                parentView.getDrawingCache().compress(Bitmap.CompressFormat.JPEG, 80, out);
            }
            out.flush();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
        }

0 个答案:

没有答案