我也有同樣的問題。您擁有的臨時路徑是應用程序緩存文件夾的URL。我通過保存本地選擇的文件並使用其後的結果路徑解決了我的應用程序中的這個問題。
我使用下面的代碼來解決這個問題。
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, failrequestFileSystem);
function gotFS(fileSystem) {
fileSystem.root.getDirectory("vids", {create: true}, gotDir);
}
function gotDir(dirEntry) {
dirEntry.getFile("video.MOV", {create: true, exclusive: false}, gotFile);
}
function gotFile(fileEntry) {
var localPath = fileEntry.fullPath;
var localUrl = fileEntry.toURL();
var fileTransfer = new FileTransfer();
var uri = encodeURI(<temp path that u have>);
fileTransfer.download(
uri,
localUrl,
function(entry) {
uralToUse = entry.nativeURL; // use this url to play video
var videoNode = document.querySelector('video');
videoNode.src = entry.toNativeURL();
},
function(error) { }
);
}
function failrequestFileSystem(error) { }
乾杯。
LOL ...它的工作.. :-)謝謝! –