Fixed HTML media continuing to play after turning the page - #865
Merged
Conversation
Fixes #121. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
stevenzeck
approved these changes
Aug 14, 2026
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #121 in the EPUB navigator where HTML <audio>/<video> could continue playing after a page turn, by notifying the previously visible page view when it is no longer current and pausing media playback in the EPUB spread web view.
Changes:
- Added a new
PageView.pageDidDisappear()lifecycle callback (main-actor isolated) and invoked it when the current page changes. - Implemented
pageDidDisappear()inEPUBSpreadViewto pause all media playback in itsWKWebView. - Documented the fix in
CHANGELOG.mdunder the Unreleased “Fixed” section.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| Sources/Navigator/Toolkit/PaginationView.swift | Introduces a main-actor PageView lifecycle hook and calls it when switching the current page. |
| Sources/Navigator/EPUB/EPUBSpreadView.swift | Implements the lifecycle hook to pause HTML media playback when a spread is no longer visible. |
| CHANGELOG.md | Adds an Unreleased entry documenting the fix for continued HTML media playback after page turns. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
mickael-menu
force-pushed
the
fix-issue-121
branch
from
August 26, 2026 13:32
716f9a2 to
62f7a80
Compare
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.
Fixed
Navigator
<audio>and<video>elements are now paused when the resource moves off-screen in the EPUB navigator, rather than continuing to play in the background.