My solution was to select the local file through this call:
chrome.fileSystem.chooseEntry({'type': 'openFile'}, function(fileEntry) {
// ...
});
With that in memory I got a directory in my sandboxed persistent area:
fileSystem.root.getDirectory('videos', { create : true }, function(dirEntry) {
// ...
}, $scope.errorHandler);
And copied the local file to that directory:
fileEntry.copyTo(dirEntry, fileEntry.name, function(newFileEntry) {
video.src = newFileEntry.toURL();
});
That worked perfectly and it's pretty clean, the feature I've not implemented in here but is important is the codec detection, because if you try to load videos that are not supported by Chrome you may think there is something wrong with the code but it's related to the codec/video player.
For further reference here is the complete code:
window.requestFileSystem(window.PERSISTENT, 300*1024*1024, function(fileSystem) {
console.log('A request to access the file system have been made.');
$scope.fileSystem = fileSystem;
}, $scope.errorHandler);
$scope.loadVideo = function() {
chrome.fileSystem.chooseEntry({'type': 'openFile'}, function(fileEntry) {
$scope.fileSystem.root.getDirectory('videos', { create : true }, function(dirEntry) {
fileEntry.copyTo(dirEntry, fileEntry.name, function(newFileEntry) {
video.src = newFileEntry.toURL();
});
}, $scope.errorHandler);
});
};