【问题标题】:Move video file captured by camera using cordova (phonegap) is not refreshing gallery thumbnail使用cordova(phonegap)移动相机拍摄的视频文件不刷新画廊缩略图
【发布时间】:2017-03-04 12:43:34
【问题描述】:

cordova (android) 刷新图库有插件吗?

  • 使用cordova插件cordova-plugin-media-capture捕获视频,它将视频保存到默认sdcard路径(画廊)。

  • 现在我将文件从 sdcard 路径移动到我的应用程序目录路径 (com.test.app)。

  • 文件移动成功,我的应用程序和功能工作正常。

问题: 移动文件后仍有一个名为No thumbnail 的视频缩略图。当我单击缩略图时,会显示警报The file can not be reproduced 这是因为它已从图库路径移动到应用程序路径。如果我重新启动手机,则没有视频缩略图,因为它正在刷新 sdcard/图库。 我想要的是在移动文件后刷新图库。

移动文件代码

使用的插件: cordova-plugin-file

var fileURI="file:/storage/emulated/0/DCIM/Camera/VID_20161022_121221.mp4";
var newFileUri='file:///mnt/sdcard/Android/data/com.test.app/myvideo/'; 
var newFileName='uservideoname.mp4';        
        window.resolveLocalFileSystemURL(fileURI, 
        function (fileEntry) {
            window.resolveLocalFileSystemURL(newFileUri,
                function (dirEntry) {
                    // move the file to a new directory and rename it
                    fileEntry.moveTo(dirEntry, newFileName, function () {
                     // successfully moved
                    },
                    function (e) {
                    console.log(e);
                    });
                },
                function (e) {
                console.log(e);
                });

        },
        function (e){ 
            console.log(e);
        });
        }

【问题讨论】:

标签: android jquery ios cordova video


【解决方案1】:

希望这会对你有所帮助。快乐的编码

https://build.phonegap.com/plugins/2725

【讨论】:

  • 已经试过了,不适合我。缩略图预览仍然存在
猜你喜欢
  • 2017-03-03
  • 1970-01-01
  • 1970-01-01
  • 2014-02-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-05-23
相关资源
最近更新 更多