Skip to content

fix(mobile): HTML file previews play video inline on iPhone - #32343

Open
juliusmarminge wants to merge 4 commits into
mainfrom
fix/issue-32338
Open

juliusmarminge wants to merge 4 commits into
mainfrom
fix/issue-32338

Conversation

@juliusmarminge

Copy link
Copy Markdown
Member

Problem

On iPhone, an HTML file opened in the mobile file viewer could not play video inline. A video the page marked playsinline still jumped into the native fullscreen player on Play, which covered the page's own controls (pause, seek, voice switching). Reproduced on main (33f8584) in T3 Code Dev on an iPhone 17 Pro simulator: open a self-contained HTML player from the thread's file tree, tap its Play button, and the video goes fullscreen. A following tap on the page's "Voice B" button never reaches the page.

Change

The file viewer's WebView (WorkspaceFileWebPreview) now passes allowsInlineMediaPlayback, matching the inline HTML renderer (HtmlRenderWebView). WKWebView defaults this to false on iPhone, which ignores playsinline. The prop is iOS-only, so Android and web are unchanged. Autoplay, sandboxing and URL handling are untouched. A video without playsinline still opens native fullscreen, as before.

Scope and approval

Fixes #32338

Verification

The same driver ran on a fresh isolated dev server, against T3 Code Dev on an iPhone 17 Pro simulator. It opens a synthetic self-contained player from the thread file tree: a muted playsinline MP4, two AAC tracks routed through Web Audio gain nodes, an explicit Play button, and a status line reading video.webkitDisplayingFullscreen. It then taps Play, waits 4 s, taps Voice B and waits 3 s.

Step Before (main 33f8584) After (5403bca)
Open t=0.00 paused fullscreen=false t=0.00 paused fullscreen=false
Play +4 s t=5.78 playing fullscreen=true fullscreenEntries=1 audio=running t=5.17 playing fullscreen=false fullscreenEntries=0 audio=running
Voice B +3 s t=12.10 fullscreen=true voice=A (tap covered by the native player) t=12.02 playing fullscreen=false voice=B

Other checks:

  • Same fix, a video without playsinline: Play still enters native fullscreen (fullscreen=true), unchanged from main.
  • Android (Pixel 9 emulator) file viewer on main: already inline (fullscreen=false, audio running). The prop does not apply on Android.
  • Web (Chromium) file viewer on main: already inline (video advancing, AudioContext running, voice switch kept position).
  • No automated test: the change is a native WKWebView configuration flag that only WebKit on a device exercises.
  • Before/after screenshots and recordings of the iPhone runs are to be attached.
  • Not checked: a physical iPhone, an iPad (WKWebView already allows inline playback there), and audible speaker output.

AI-assisted; verified with the tests and tools listed above.

juliusmarminge and others added 2 commits November 7, 2026 05:56
The file viewer's WebView left allowsInlineMediaPlayback at WKWebView's
iPhone default (false), so every <video> play went to the native
fullscreen player and covered the page's own controls. Opt in like the
inline HTML renderer already does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 7, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs Human Approval

Macroscope's review found this PR requires human approval — Mobile document previews now allow eligible iPhone videos to play inline while retaining fullscreen support. This changes the default preview behavior and requires human confirmation of the intended playback experience.

No code changes detected at 9cddbf0. Prior analysis still applies.

You can add or adjust custom eligibility rules. Learn more.

@juliusmarminge juliusmarminge added bugfix Fix PR opened by an issue lead; enters the PR loop pr:gate-failed A land gate failed labels Nov 7, 2026
@coderabbitai

coderabbitai Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 94ba77f and 9cddbf0.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The document preview WebView now enables inline media playback.

Changes: Inline media playback

Layer / File(s) Summary
Allow inline media playback
apps/mobile/src/features/files/WorkspaceFileWebPreview.tsx
The WebView configuration enables inline media playback.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Merge Risk: Minimal · previous review 431ea

The preview enables inline playback on iPhone. No actionable merge-blocking risk is identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: HTML file previews on iPhone now play video inline. It uses the conventional commit form and matches the one-line change that sets allowsInlineMediaPlayback in Workspa…
Description check Passed The description follows the template well. It has Problem, Change, Scope and approval, and Verification sections. The Problem section gives the symptom, the reproduction steps, and the environment. Th…
Linked Issues check Passed [#32338] The issue asks for a reproducible iOS/WebKit failure and a repair for the local HTML file viewer. The issue names the missing allowsInlineMediaPlayback setting in WorkspaceFileWebPreview.tsx …
Out of Scope Changes check Passed The whole-PR diff against the merge base changes one file and adds one prop line: allowsInlineMediaPlayback in apps/mobile/src/features/files/WorkspaceFileWebPreview.tsx. This prop directly implements…
Full details: Title check

Explanation

The title names the main change: HTML file previews on iPhone now play video inline. It uses the conventional commit form and matches the one-line change that sets allowsInlineMediaPlayback in WorkspaceFileWebPreview. The title is specific and accurate, and it fits the raw summary and PR objectives.

Full details: Description check

Explanation

The description follows the template well. It has Problem, Change, Scope and approval, and Verification sections. The Problem section gives the symptom, the reproduction steps, and the environment. The Change section explains the prop, why it is needed, and that Android and web are unaffected. The Verification section gives before and after results, the checks not run, and the lack of an automated test. It links the issue (fixes #32338). Gaps: the Scope and approval section gives only a bare issue link and does not point to a maintainer approval comment or triage, which the template asks for. The before and after screenshots and recordings are still to be attached, and the template asks for them on UI changes. The template's HTML comments were left in place, and the model and harness line is not clearly stated. These gaps are non-critical, so the description is mostly complete.

Full details: Linked Issues check

Explanation

[#32338] The issue asks for a reproducible iOS/WebKit failure and a repair for the local HTML file viewer. The issue names the missing allowsInlineMediaPlayback setting in WorkspaceFileWebPreview.tsx as the lead to test. The diff adds allowsInlineMediaPlayback to the WebView in DocumentWebPreview at the reviewed head (431ea25). This is the only code change between merge base d4247a5 and head. The PR reports an iPhone 17 Pro simulator run. Before the change, Play entered native fullscreen and covered the page's Voice B control. After the change, the video stayed inline and Voice B switched voice while playback continued (t=12.02, playing, fullscreen=false). The audio route reported audio=running in both runs. The opaque-origin sandbox, originWhitelist, and URL handling are unchanged in the diff, as the issue requires. Coding requirements for pause and seek on iPhone are not directly exercised in the PR's run. The issue reports pause and seek working in the Chromium file viewer, and the code change enables the same inline playback path. Audible speaker output and physical-device behavior are not verified. The issue does not make these coding requirements. No automated test is required by the issue.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff against the merge base changes one file and adds one prop line: allowsInlineMediaPlayback in apps/mobile/src/features/files/WorkspaceFileWebPreview.tsx. This prop directly implements the iOS inline-playback lead named in #32338 for the local HTML file viewer. No unrelated files, sandbox settings, autoplay settings, or URL handling changed. The prop is iOS-only in effect, so Android and web behavior is not changed by this line, as the PR states.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between d4247a5 and 431ea25.

Files selected for processing: 1

  • apps/mobile/src/features/files/WorkspaceFileWebPreview.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@juliusmarminge juliusmarminge added pr:in-progress A lead is working on this PR and removed pr:gate-failed A land gate failed labels Nov 10, 2026
@juliusmarminge juliusmarminge added pr:gate-failed A land gate failed and removed pr:in-progress A lead is working on this PR labels Nov 10, 2026

Copy link
Copy Markdown
Member Author

Evidence

Environment for both recordings: real iOS development app on the same pooled iPhone 17 Pro simulator, portrait 402×874 points, light theme. Separate worktrees, Metro servers, and fresh databases; byte-identical synthetic HTML fixture.

Steps: open the thread’s Files → player.html; tap Play; wait four seconds; tap the Voice B button’s position; wait four seconds. The same script and coordinates were used on both sides.

Before After
d756fed7aa 9cddbf0977
Before recording After recording
Playback enters native fullscreen, covering the HTML controls. Playback stays inline. Voice B changes the visible soundtrack state while video time continues without resetting.

Reproduction artifacts: seed, interaction driver, synthetic MP4.

AI-assisted; verified with the tests and tools listed above.

Not shown:

  • Audible soundtrack switching was not verified: simulator recordings contain video only. The head recording shows the Voice B handler changing the visible state during uninterrupted video playback.
  • Physical iPhone behavior was not checked; both runs used the same pooled iPhone simulator.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fix PR opened by an issue lead; enters the PR loop pr:gate-failed A land gate failed size:XS 0-9 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate HTML video and audio playback in document viewers

1 participant