Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to load only one page in a webview #72

Open
dilawer opened this issue Mar 8, 2016 · 3 comments
Open

Need to load only one page in a webview #72

dilawer opened this issue Mar 8, 2016 · 3 comments

Comments

@dilawer
Copy link

dilawer commented Mar 8, 2016

Hi @danielweck ,

I am using readium sdk to make an iOS demo for my client. I am able to many of required things like, I made able to load page horizontally with pagination effect. I also did lazy loading of pages. I actually loaded more then one webviews and loaded required previous and next pages simultaneously. Everything is working according to my requirements but when epub loads for the first time it takes much time to load current, few previous and few next pages at the same time.

What I understand is I am using this code https://cloudup.com/ceXpYNmeShO to load a book in a single webview and opens the required page. This approach is taking much time because I am using "ReadiumSDK.reader.openBook" method.

I want to load only one page in a webview (I dont want it to swipe to load next or previous pages because I manage more webviews to load other pages). I think that will reduce the page loading time. I look the documentation here https://dl.dropboxusercontent.com/u/18642964/Readium/Shared-JS%20JSDoc/ReadiumSDK.Views.ReaderView.html and I hope following methods can help me in loading single page instead of entire book

  • openContentUrl
  • openPageIndex
  • openSpineItemPage

I do not find any test code to use these methods. I hope you understand my need, can you please let me know how I can use these methods or any other to load only single page contents/resources in a webview to reduce loading time for a single webview?

Thanks and waiting on your response.

Regards,
Dilawer Hussain

@danielweck
Copy link
Member

Hello, this is an interesting problem that other vendors (Readium integrators) have attempted to solve, in order to implement page pre-fetching + animations in fixed-layout EPUBs (one page = a single HTML spine item), and fast "chapter" loading in reflowable publications (single HTML spine item = many individual virtual pages).

You have already figured-out the pros/cons of loading a webview with an entire instance of Readium (just in order to load the sibling spine items), so now I would advise you to take a look at this feature branch:
https://github.com/readium/readium-shared-js/tree/feature/prefetch
(please contact the active developer if you need to learn more about it ... the source code is still experimental CC @jccr + DmitryM)

Note that the JSDoc you linked to in your comment is obsolete. Make sure to use the latest code from the develop branch to run your tests (there's even an npm run apidocs command to build with YUI-doc-JS):
https://github.com/readium/readium-shared-js/blob/develop/package.json#L69

I hope this helps. Regards, Daniel

@majidtbox
Copy link

@jccr @danielweck
We have looked into this feature branch: https://github.com/readium/readium-shared-js/tree/feature/prefetch
But we are unable to find solution for our mentioned problem. Please guide that how we can use this branch to achieve only next spine items loading in a webview instead of complete epub instance.

Thanks.

@danielweck
Copy link
Member

'feature/prefetch' is all there is at this point in time.
ReadiumJS is an open-source project that depends on voluntary contributions, so if you have any ideas on how to implement what you are suggesting, please let us know.
Many thanks, Daniel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants