Skip to content

Fixed HTML media continuing to play after turning the page - #865

Merged
mickael-menu merged 4 commits into
developfrom
fix-issue-121
Aug 26, 2026
Merged

Fixed HTML media continuing to play after turning the page#865
mickael-menu merged 4 commits into
developfrom
fix-issue-121

Conversation

@mickael-menu

@mickael-menu mickael-menu commented Jul 17, 2026

Copy link
Copy Markdown
Member

Fixed

Navigator

  • #121 HTML <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.

Fixes #121.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mickael-menu
mickael-menu requested a lite review from Copilot August 26, 2026 13:18
@mickael-menu
mickael-menu marked this pull request as ready for review August 26, 2026 13:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() in EPUBSpreadView to pause all media playback in its WKWebView.
  • Documented the fix in CHANGELOG.md under 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.

Comment thread Sources/Navigator/EPUB/EPUBSpreadView.swift Outdated
Comment thread Sources/Navigator/EPUB/EPUBSpreadView.swift
Comment thread Sources/Navigator/Toolkit/PaginationView.swift
@mickael-menu mickael-menu linked an issue Aug 26, 2026 that may be closed by this pull request
@mickael-menu
mickael-menu merged commit 6691403 into develop Aug 26, 2026
5 checks passed
@mickael-menu
mickael-menu deleted the fix-issue-121 branch August 26, 2026 13:46
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

3 participants