-
Notifications
You must be signed in to change notification settings - Fork 33
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
Navigator API: Did we reach the last screen page yet? #115
Comments
Another solution suggested by Hadrien, which is better in my opinion: Broadcasting a |
Should we start a vote? |
I like the event approach the best, since it doesn't break current implementations of Readium, and it is easy to subscribe to the events that are of interest. |
I like the broadcast approach, but how do we know the user really reached the end of the publication? Obviously if they navigated to the last screen (and I use that term deliberately) we can't know if they actually read the text (or images) but we can't solve everything. But do we know, unambiguously, that the user navigated to the last screen? |
Indeed, it's a very imperfect approach. It's even worse than that because most books have extra chapters after the actual content (indexes, bibliography, etc.), so there's little chance that the reader will actually reach the last screen. As far as I know, EPUB doesn't provide a way to mark the end of the content. Maybe that could be something to be added in the evolution of the spec? I'm pretty sure Amazon is adding this manually to its Kindle books to present the "Rate this book" dialog after the user turns the last page of content.
Yes, this we can know. |
At least in some EPUB3 files, you should have I know how imperfect it is because we had this issue (for preprocessing) and obviously some files won’t have that. |
That's interesting. Unfortunately it's not part of the OPF, so it requires to parse the documents. So I'm not so sure that Readium should do that, but it could be useful to think about how a reading app would extend Readium to figure out the backmatter. Maybe a simple JS injection would be enough, if it detects I wonder how frequent is this added in EPUB authoring. |
I can recall finding it in the landmarks (nav doc) on a few occasions, although I wouldn’t say it’s the norm. So that could be the priority, and then parsing the docs. And well another important detail is that The best I could see happening is some heuristics as, by tradition, some parts are more or less guaranteed to be backmatter in, at least, some cultures (e.g. index, acknowledgements, etc. in western books). That said, my knowledge on this matter isn’t anything close to what one could call expertise so I’ll appreciate to be proven wrong. :-) |
This latest point is already being discussed in another repo: readium/webpub-manifest#50 |
Mickaël said that the toolkit knows when the user IS on the last screen (I suppose the use case is a paginated view). In a scroll view, the user will try to move down until it reaches the bottom of the resource, therefore the toolkit knows he bumps to the bottom of the last resource in the reading order. If there is a backmatter indication in the landmarks (i.e. an annex, usually as a new resource), the toolkit knows when the user moves to this new resource. If the backmatter indication is an epub:type, the toolkit is aware of its presence once the user has moved to it. In these 4 situations, the toolkit is therefore able to send an event of type It seems sufficient for the app to decide it should do something specific with this event, isn't it? |
Yes we could do that, unless there's a need to really get the last screen page of the publication, in which case we could have two events. I would rename the event to |
Being able to know when the navigator reached the last screen page came up at least 3 times (e.g. readium/r2-testapp-kotlin#292 (comment)) already. This can be used, for example, to present a rating dialog when the user reaches the end of the publication.
The current implementation of the
Locator
/positionList
doesn't work for that, because the last position doesn't have atotalProgression
of 100%, since the progression is located at the start of the location. Moreover, a single position can actually contain several screen pages on smaller devices. It's not a guarantee we reached the end of the publication.I can think of three different ways to tackle this:
Publication.positionList
) but with thetotalProgression
set to 100%. This is the less disruptive, but also it breaks a bit the coherence oftotalProgression
which so far points to the start of the page, not the end.Locator.locations
to handle this extra information, such as an enum of generic locations (start
,end
) that would be set for these special locations.LocationChanged
event, which would contain this information. This could be useful if we need to add other information that won't fit our current models.cc @Bolling88
The text was updated successfully, but these errors were encountered: