Nevo
Nevo
  • 发布:2015-10-14 16:03
  • 更新:2015-10-14 16:03
  • 阅读:1242

android 调用下载接口pause时ANR

分类:HTML5+

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 
2015-10-14 16:03 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复