我正在尝试播放有关离子的视频。当我启动我的应用程序时,我在控制台上遇到上述错误,该错误引用了这行代码
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSystem){
这是js文件的代码块
//Function for fetch video files from ionicrecorder folder from memory and set in list
$scope.func = function(){
//$rootScope.show('Accessing Videos.. Please wait');
$window.requestFileSystem($window.LocalFileSystem.PERSISTENT, 0, function(fs) {
fs.root.getDirectory('ionicrecorder', {create: true}, function(dirEntry){
var dirReader = dirEntry.createReader();
dirReader.readEntries(function(entries) {
if(entries.length === 0){
alert("No Videos available...");
$rootScope.hide();
}
var arr = [];
processEntries(entries, arr, function(arr) {
$scope.files = $scope.dup;
$rootScope.hide();
}); // arr is pass by refrence
}, onError);
}, onError);
//Error
function onError(error) {
alert("Failed to list directory contents: " + error.code);
}
},
function(error) {
console.log(error);
});
}
============== EDITTED ===================== 我目前有错误
-master>cordova plugin add github.com/apache/cordova-plugin-file
Fetching plugin "github.com/apache/cordova-plugin-file" via plugin registry
npm ERR! addLocal Could not install github.com/apache/cordova-plugin-file
Error: ENOENT, stat
on\IonicVideoRecorder-master\github.com\apache\cordova-plugin-file'
at Error (native)
答案 0 :(得分:0)
$window.requestFileSystem($window.PERSISTENT, 0, function (fs) {