readium/readium-js — pull request #82 by johanpoirier (2014-09-26 15:18:24+00:00)
Title: Enable Readium to open File objects directly

Readium can now open a [File](https://developer.mozilla.org/en-US/docs/Web/API/File) object ([Blob](https://developer.mozilla.org/fr/docs/Web/API/Blob)) directly.

For example, if you're using the DeviceStorage API, you can read an epub file from the sdcard of a device :

var sdcard = navigator.getDeviceStorage('sdcard');
var request = sdcard.get("9782019111281.epub");
request.onsuccess = function () {
var file = this.result;
var readium = new Readium({ jsLibRoot: './libs/' }, { el: '#reader-frame' });
readium.openPackageDocument(file, function (packageDocument, options) {
// do whatever you want with your packageDocument...
});
};