Fix HTML media continuing to play after turning the page - #818
Draft
mickael-menu wants to merge 1 commit into
Draft
mickael-menu wants to merge 1 commit into
mickael-menu wants to merge 1 commit into
Conversation
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 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports readium/swift-toolkit#865 to the legacy EPUB navigator: when a resource page stops being the visible page in the pager (
R2PagerAdapter.setPrimaryItem, the analog of Swift'sPaginationView.setCurrentIndex), the previously visible fragment is notified viaonPageBecameInvisible()and pauses all HTML<audio>/<video>elements through a newreadium.pauseAllMedia()script — for both reflowable and fixed-layout publications (both web views of an FXL spread).Android's WebView has no
pauseAllMediaPlayback()equivalent, so the pause happens in JavaScript. Semantics match the Swift PR: media pauses on resource/spread change, not when paginating within a resource (the spread stays visible). JS bundles regenerated withmake scripts.Fixes #145
🤖 Generated with Claude Code