I have manually binding a singleton downloader for lua
Downloader is not exported for lua in the official release branch
The C++ path of Downloader is (cocos/network/Downloader)
It’s useful for multithreads downloads !
Github -
Example :
local downloader = Require("[Your Path].Downloader")
local taskId = downloader.downloadData(
“https://httpbin.org/get”,
function (result, data)
print("download ended – ", result, data)
end
)
downloader.setProgressCallBack(taskId,
function (bytesRec, totalBytesRec, totalBytesExpected)
print("download progress – ", totalBytesRec*100/totalBytesExpected)
end)
Any suggestions is welcomed !