|
[BUG]
downloadManager模块下载50%时断开手机网络,重新连接网络继续...
[复制链接]
本帖最后由 Carson.Leung 于 2018-8-16 12:09 编辑
前端模块调用enqueue开启allowResume断点续传为true,服务器支持断点续传新建1个下载,下载50%时断开手机网络,重新连接网络继续下载,模块会把已下载50%的文件重新从0%开始下载var downloadManager = api.require('downloadManager');downloadManager.enqueue({
url: 'http://192.168.199.102:10008/test.mp4',
savePath: 'fs://doanload/test.mp4',
cache: true,
allowResume: true,
title: 'test',
networkTypes: 'all'}, function(ret, err) {
if (ret) {
alert(JSON.stringify(ret));
} else {
alert(JSON.stringify(err));
}});
downloadManager.resume({
id: '1'
}, function(ret, err) {
if (ret.status) {
alert(JSON.stringify(ret));
} else {
alert(JSON.stringify(err));
}});
测试型号: ios6(10.3.2) 三星note8(8.0.0)
|
|