Skip to content

fix(player): register native HLS readiness before load - #546

Merged
hoangsvit merged 3 commits into
stagingfrom
fix/native-hls-metadata-listener-order-20261123
Nov 23, 2026
Merged

hoangsvit merged 3 commits into
stagingfrom
fix/native-hls-metadata-listener-order-20261123

Conversation

@hoangsvit

Copy link
Copy Markdown
Member

Reproduction / impact

In the native HLS fallback (hls.js unsupported, e.g. iOS Safari), media.load() was called before registering the one-shot loadedmetadata listener. A fast/cached manifest may dispatch readiness before the listener is attached, leaving an explicit Play request waiting for a callback that never arrives.

Fix

Register loadedmetadata before media.load(). Keep the existing source-version/user-pause guard, metadata integration, and bounded fallback probe. No change to autoplay policy.

Verification

  • Added tests/player-hls-startup.test.mjs regression assertion for listener-before-load ordering.
  • Connector-based check on committed branch: PASS (listener position precedes load; test present).
  • npm test and Safari browser QA: not run in this environment; CI and manual iOS Safari QA required.

Acceptance criteria

  1. Native HLS loadedmetadata is subscribed before load starts.
  2. Explicit Play works on iOS Safari with a quickly cached HLS manifest; pause/stale station selection still cannot trigger playback.
  3. npm test and PR CI pass; no regression for hls.js/MSE playback.

Risk

Low, localized ordering change. Event delivery and actual Safari behavior still require browser QA. Independent of open PRs #542–#545; based on staging HEAD 40c33f6dcec5df051fde0b03bdc366a61a7e200f.

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

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
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

ePlus OnAir — PR Preview

🗃️ Preview expired. This PR is closed; the Preview link is hidden.

View build status

Preview is noindex; the full catalog is available on Staging after merge.

@hoangsvit
hoangsvit marked this pull request as ready for review November 23, 2026 11:15
@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@hoangsvit
hoangsvit merged commit ff71eec into staging Nov 23, 2026
5 checks passed
@hoangsvit
hoangsvit deleted the fix/native-hls-metadata-listener-order-20261123 branch November 23, 2026 11:15

This branch was successfully deployed

1 active deployment
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.

1 participant