fix(web): record browser previews as H.264 MP4 so mobile can play them - #9249
fix(web): record browser previews as H.264 MP4 so mobile can play them#9249jakeleventhal wants to merge 2 commits into
Conversation
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR changes the default browser-recording format for browsers supporting both H.264 MP4 and WebM, affecting the artifacts shared across clients. The implementation is narrow and preserves fallbacks, but product-default changes require human review. You can add or adjust custom eligibility rules. Learn more. |
Browser recordings preferred WebM/AV1, which iOS cannot decode, so the mobile app showed "Video unavailable" for previews that played fine on web and desktop. Reorder the MediaRecorder MIME preferences to try H.264 MP4 first and keep WebM as the fallback. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
4fb33e3 to
2103ff0
Compare
|
have you tested the file size implications here at all? |
Forgot to publish initially, but yes:
Definitely a hit... but how else to get it working on iPhone app? video_mp4_codecs_avc1_42e01e.mp4video_mp4_codecs_avc1_640028.mp4video_webm_codecs_av1.webm |
|
Superseded by #10403, which landed the H.264-first |
|
Closed as superseded by #10403. |
What Changed
ScreenRecording_09-02-2026.14-17-18_1.MP4
Reordered
preferredMimeTypesinapps/web/src/browser/browserRecording.tssoMediaRecordertries H.264 MP4 (avc1.640028, thenavc1.42e01e) before the WebM codecs. AV1, VP9, VP8, and plain WebM stay in the list as fallbacks in their original order.Updated the recorder test that asserted AV1 won to assert H.264 MP4 wins when both are supported, and added a test for the WebM fallback when the browser has no MP4 encoder.
Why
Browser preview recordings came out as WebM/AV1. iOS cannot decode that, so the mobile app showed "Video unavailable" for recordings that played fine on web and desktop. Recordings are shared across every client, so the encoder should target the format all of them can play.
The desktop artifact path already maps MP4 MIME types to a
.mp4extension, so nothing downstream needed to change.Checklist
Written by Claude Fable 5.1 via Claude Code.
🤖 Generated with Claude Code
Note
Low Risk
Narrow change to MediaRecorder MIME preference and tests; no auth, persistence, or API surface changes.
Overview
Browser preview recordings will use H.264 MP4 when the browser supports it, instead of defaulting to WebM/AV1. The
preferredMimeTypesorder inbrowserRecording.tsnow triesavc1MP4 profiles first, with WebM codecs kept as fallbacks.Tests were updated to assert MP4 wins when both MP4 and WebM are available, and a new case covers WebM-only browsers still recording with VP9.
Reviewed by Cursor Bugbot for commit 19ad17a. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
[!NOTE]
Prefer H.264 MP4 for browser recordings to support mobile playback
preferredMimeTypeslist in browserRecording.ts to try H.264 MP4 before AV1 and VP9 WebM, keeping WebM as a fallbackMacroscope summarized 19ad17a.