readium-js-viewer icon indicating copy to clipboard operation
readium-js-viewer copied to clipboard

Save and track reading progress

Open rayssafs opened this issue 4 years ago • 1 comments

Hello, I would like to know if there is a way to save and track the reading progress, without saving this information in local storage/ browser. For example, if the users use the reading channel in different devices, they should be able to start on the same page they stop the reading.

rayssafs avatar Aug 07 '19 01:08 rayssafs

The functionality you are describing is currently not implemented, but you can of course replace the LocalStorage code with an alternative method. There is currently no "extensibility" API to introduce such feature, so you would have to modify the existing code.

From the top of my head, I would suggest looking into the savePlace() function: https://github.com/readium/readium-js-viewer/blob/a9f48eb30da5ef5fea5c5261067caefa5517ec9b/src/js/EpubReader.js#L758-L791

...more specifically reader.bookmarkCurrentPage() and Settings.put() which you could use as a hook / extension point for your distributed / remote storage facility:

https://github.com/readium/readium-js-viewer/blob/a9f48eb30da5ef5fea5c5261067caefa5517ec9b/src/js/EpubReader.js#L760-L763

https://github.com/readium/readium-js-viewer/blob/4ab8dab28e7ae0a74f2b1716ea09d90f7cf399a4/src/js/storage/Settings.js#L23-L36

I hope this helps.

danielweck avatar Aug 07 '19 17:08 danielweck