readium / readium-js-viewer

👁 ReadiumJS viewer: default web app for Readium.js library
BSD 3-Clause "New" or "Revised" License
551 stars 186 forks source link

readium-js-viewer: Upload of books hangs #765

Open mrichtarsky opened 1 year ago

mrichtarsky commented 1 year ago

This issue is a Bug

Expected Behaviour

Book is displayed

Observed behaviour

Dialog hangs at "Examining EPUB content..."

Reason seems to be failure of this request: GET https://readium-master.surge.sh/READIUMWORKER.js Status 404 Not Found

Steps to reproduce

  1. Go to https://readium.firebaseapp.com or https://readium-master.surge.sh
  2. Click on '+' and upload a local epub file (affects all I tested)

Product

readium-js-viewer Tested with Chrome on Windows and Android

Additional information

I'm looking for an epub reader that integrates with Hypothesis, and works on Android. Readium fits the bill. Everything works as expected, except for uploading my own epub books. I realize that this app here is no longer maintained, but still wonder whether I could make that work, even via self hosting? From my understanding, there is no Readium-based alternative to it yet. From the architecture repo I gather that you are working on new versions for mobile and web, but there's nothing consumable yet. I found a list of apps for Android that are based on readium but all of these are apps for public libraries and do not appear to support uploading my own epub books.

Any help/pointers would be appreciated!

danielweck commented 1 year ago

Hello, I don't have a clear answer but here are code pointers:

https://github.com/readium/readium-js-viewer/blob/c56abf1f810fde0315bc06412028f40b09bd254b/src/js/ModuleConfig.js#L19

https://github.com/readium/readium-js-viewer/blob/c56abf1f810fde0315bc06412028f40b09bd254b/dev/RequireJS_config.js#L96

https://github.com/readium/readium-js-viewer/blob/c56abf1f810fde0315bc06412028f40b09bd254b/src/chrome-app/requirejs-config.js#L62

https://github.com/readium/readium-js-viewer/blob/c56abf1f810fde0315bc06412028f40b09bd254b/src/cloud-reader-lite/index.html#L72

https://github.com/readium/readium-js-viewer/blob/c56abf1f810fde0315bc06412028f40b09bd254b/src/cloud-reader/index.html#L109

danielweck commented 1 year ago

Ah, it's coming back to me! The "+" ("plus") button import is functional only in the now-defunct Google Chrome App which had a storage backend (HTML FileSystem API). Conversely, drag & drop works but this is an extremely limited service because the whole EPUB archive is loaded in memory which breaks a number of web APIs such as the ability to stream audio playback etc. There are also caveats with obfuscated fonts but I can't remember the details from the top of my head. Ideally you would need to write a proper storage backend adapter for your Android app and expose it via hooks similar to the ones implemented in the Chrome App.