plus.downloader.createDownload pause android手机ANR(手机小米3),iphones无问题:
function createDownload() {
mDownloadTask = plus.downloader.createDownload(app.getIMGURL() mDownloadUrl, {
filename: mDownloadUrl '.mp4'
}, function ( d, status ) {
console.log("6666");
if ( status == 200 ) {
console.log( "Download success: " d.filename );
if (mui.os.android) {
plus.runtime.openFile('_downloads/' mDownloadUrl '.mp4');
} else if (mui.os.ios){
var path = plus.io.convertLocalFileSystemURL( '_downloads/' mDownloadUrl '.mp4' );
ui.physical.video.innerHTML = '<video style="width:100%; height:160px;" controls="controls" src="' path '"></video>';
}
} else {
console.log( "Download failed: " status );
mPerUIID.innerHTML = '下载失败';
}
mISDownloading = false;
mDownloadTask =null;
});
mDownloadTask.addEventListener( "statechanged", onStateChanged, false );
mDownloadTask.start();
}
function onClickDownload() {
mPerUIID = document.getElementById('download_per');
mDownloadButton = document.getElementById('download_button');
console.log("111");
console.log(mISDownloading);
if (true == mISDownloading
0 个回复