This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function downloadBook(URL, id) { | |
var sdcard = navigator.getDeviceStorage("sdcard"); | |
var progress_callback = function (event) { | |
if(event.lengthComputable){ | |
var percentage = (event.loaded / event.total) * 100; | |
$("#downloadProgress").val(percentage).slider('refresh'); | |
} | |
} | |
getBlob(URL, function(xhr) { | |
var filename = URL.substring(URL.lastIndexOf('/')+1); | |
sdcard.addNamed(xhr.response, filename); // folder with id name | |
}, {'progress_callback': progress_callback}); | |
} |
A quick note on a topic unrelated to this post:
ReplyDeleteI visited the github repo for this project today:
https://github.com/fccardiff/LibriFox/
The description you have there, "LibriFox is a port of LibriVox for FirefoxOS" is inaccurate. LibriVox is a website that serves up audio books. What are are creating is a "player" for audio books on the LibriVox site.
How about:
LibriFox is a Firefox OS audio book player for LibriVox audio books.