File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
readium/navigator/src/main/java/org/readium/r2/navigator/epub Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file. Take a look
1111#### Navigator
1212
1313* Fixed computing the total progression of audiobook locators.
14+ * Fixed starting the TTS from the current resource in a fixed-layout EPUB.
1415
1516
1617## [ 3.0.0-beta.2]
Original file line number Diff line number Diff line change @@ -1008,12 +1008,19 @@ public class EpubNavigatorFragment internal constructor(
10081008 override suspend fun firstVisibleElementLocator (): Locator ? {
10091009 if (! ::resourcePager.isInitialized) return null
10101010
1011- val resource = readingOrder[resourcePager.currentItem]
1012- return currentReflowablePageFragment?.webView?.findFirstVisibleLocator()
1013- ?.copy(
1014- href = resource.url(),
1015- mediaType = resource.mediaType ? : MediaType .XHTML
1016- )
1011+ return when (viewModel.layout) {
1012+ EpubLayout .FIXED ->
1013+ currentLocator.value
1014+
1015+ EpubLayout .REFLOWABLE -> {
1016+ val resource = readingOrder[resourcePager.currentItem]
1017+ currentReflowablePageFragment?.webView?.findFirstVisibleLocator()
1018+ ?.copy(
1019+ href = resource.url(),
1020+ mediaType = resource.mediaType ? : MediaType .XHTML
1021+ )
1022+ }
1023+ }
10171024 }
10181025
10191026 /* *
You can’t perform that action at this time.
0 commit comments