Conversation
|
💖 Thanks for opening this pull request! 💖 Things that will help get your PR across the finish line:
We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can. |
manNomi
marked this pull request as ready for review
September 30, 2026 07:55
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1614 +/- ##
==========================================
+ Coverage 84.00% 84.04% +0.03%
==========================================
Files 44 44
Lines 11713 11715 +2
Branches 2625 2626 +1
==========================================
+ Hits 9840 9846 +6
+ Misses 1873 1869 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
Description
Adds
useSegmentMetadataTrackso applications can opt out of the internalsegment-metadatatext track. The default istrueand retains the existing hidden track and segment metadata cues.We encountered the Safari/iOS playback stall reported in #1600. We currently work around it in our application with an event listener for track additions. Every time a track is added we check whether its label is
segment-metadataand immediately remove the corresponding<track>element from the video element. This option lets us skip creating the track instead of maintaining that removal listener.Related work:
hiddento support cues andcuechangeevents.WebKit cause and version scope
WebKit bug 302828 was fixed by 16667e0251. In
HTMLTrackElement::scheduleLoad()the old code returned early whensrcwas absent. The fix removes that return so the empty URL reaches the failed-load path. WebKit also added a regression test for a track withoutsrc.The WebKit commit explains why the media element can remain at
HAVE_CURRENT_DATAand leaveplay()pending. VHS creates a native track withoutsrcand sets it tohiddenin the configuration below. Our recordings show the corresponding playback stall.The official Safari 26.4 release notes list this fix as 164125914. The compatibility target is Safari/iOS versions before 26.4 that still contain this WebKit bug. The issue is not limited to 26.3: we reproduced it on iOS 18.0 and iOS 26.3.1. Older versions without the fix may be affected when this native-track path is used. We have not established the earliest affected release or tested every earlier version. Safari 26.4 is the documented fixed release and is excluded from that target.
This is an explicit opt-out for applications supporting affected browsers. It does not automatically disable metadata for Safari users. Applications that rely on segment metadata should keep the default.
Specific Changes proposed
useSegmentMetadataTrackas an initialization and source option. A source option takes precedence.false. Existing segment cue insertion and removal code already handles an absent track.Live browser reproduction
Open the live reproduction in the Safari version you want to test. No installation is required. Each link starts a fresh player:
useSegmentMetadataTrack: false.Tap Start playback test and observe for at least 20 seconds. The page displays actual media state and lets you download telemetry as JSONL. It runs in your browser and does not emulate an affected Safari version. Network or player errors are reported separately.
Reproduction source at the verified commit. This static adaptation uses the same four pinned player assets as the original fixture below. Bundle provenance and SHA-256 checksums are included. It does not upload telemetry or remove tracks through an event listener.
The hosted pages were also checked in Safari on the iOS 26.3.1 (23D8133) Simulator. The baseline and default-control runs remained at 0 seconds after more than 20 seconds with
readyState=2andplay()pending. The opt-out run advanced beyond 30 seconds withreadyState=4.Simulator verification
The recordings use Safari in Xcode's iPhone 16 Pro Simulator with Video.js 8.24.1 core and locally built VHS. The baseline is unmodified commit
a9f9d7ac0264b373f14da1bb2f2e7fe8f2775c4f(VHS 3.17.5). The patched build is commitdb62124a387621f88321cd4e07c30e24af4e2827from this PR.Both variants use the same public Apple BipBop VOD rendition and the following settings:
Playback is requested with a button click. The page displays elapsed time and actual media state. Telemetry confirms that VHS and ManagedMediaSource are active.
falsereadyState=2andplay()remains pending.play()resolves and video advances beyond 20 seconds withreadyState=4.readyState=2andplay()remains pending.play()resolves and video advances beyond 20 seconds withreadyState=4.In each video the unmodified baseline is on the left and the patched opt-out is on the right. These are separate Simulator captures placed side by side. Initial idle time is trimmed and resolution is reduced without changing playback speed.
iOS 18.0
ios18-before-after.mp4
iOS 18.0 comparison screenshot
Still frame from the recording above. Baseline on the left and patched opt-out on the right.
iOS 26.3.1
ios263-before-after.mp4
iOS 26.3.1 comparison screenshot
Still frame from the recording above. Baseline on the left and patched opt-out on the right.
Download the reproduction fixture and telemetry. Extract it and run
node server.cjs. The README includes the baseline, patched and default-control URLs. The archive includes pinned bundles and SHA-256 checksums. It does not remove tracks through an event listener.The iOS 26.3.1 runtime was verified independently with
simctl. Its Safari user agent contains a frozeniPhone OS 18_7token.These are simulator results for the listed runtimes. They do not establish the behavior of every older Safari/iOS release.
Validation
npm run lint -- --errors: passed. Fullnpm run lintreports 0 errors and 410 warnings.CI_TEST_TYPE=unit npm run build-testandCI_TEST_TYPE=unit npx karma start scripts/karma.conf.js --browsers ChromeHeadless --single-run: 1,408 passed and 7 skipped on Chrome Headless 154.CI_TEST_TYPE=unit npm run build-prod: passed.GitHub Actions currently requires maintainer approval for this external contribution. The local results above are separate from CI.
AI tools assisted with the implementation and translation of this PR description into English.
Requirements Checklist