From db3b9e6c80bb8fa9659a5018b7de18c8be4e732a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Menu?= Date: Fri, 17 Jul 2026 19:36:21 +0200 Subject: [PATCH] Fix HTML media continuing to play after turning the page Ports readium/swift-toolkit#865 to the legacy EPUB navigator: when a resource page stops being the visible page in the pager, the previously visible fragment is notified and pauses all HTML audio/video elements through a new readium.pauseAllMedia() script, for both reflowable and fixed-layout publications. Android's WebView has no pauseAllMediaPlayback() equivalent, so the pause happens in JavaScript. Fixes #145 Co-Authored-By: Claude Fable 5 --- CHANGELOG.md | 4 ++++ .../navigator/src/main/assets/_scripts/src/index.js | 2 ++ .../navigator/src/main/assets/_scripts/src/utils.js | 9 +++++++++ .../src/main/assets/readium/scripts/readium-fixed.js | 2 +- .../assets/readium/scripts/readium-reflowable.js | 2 +- .../java/org/readium/r2/navigator/R2BasicWebView.kt | 7 +++++++ .../readium/r2/navigator/pager/R2EpubPageFragment.kt | 10 ++++++++++ .../readium/r2/navigator/pager/R2FXLPageFragment.kt | 12 ++++++++++++ .../org/readium/r2/navigator/pager/R2PagerAdapter.kt | 9 +++++++++ 9 files changed, 55 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c2cd1908ef..2992322e2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ All notable changes to this project will be documented in this file. Take a look ### Fixed +#### Navigator + +* [#145](https://github.com/readium/kotlin-toolkit/issues/145) HTML `