Skip to content

Fix HTML media continuing to play after turning the page - #818

Draft
mickael-menu wants to merge 1 commit into
developfrom
fix-issue-145
Draft

mickael-menu wants to merge 1 commit into
developfrom
fix-issue-145

Conversation

@mickael-menu

Copy link
Copy Markdown
Member

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's PaginationView.setCurrentIndex), the previously visible fragment is notified via onPageBecameInvisible() and pauses all HTML <audio>/<video> elements through a new readium.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 with make scripts.

Fixes #145

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HTML <media> elements keep playing after turning pages

1 participant