fix(player): always enable MP2 software decoding#569
Conversation
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-569.eastasia.1.azurestaticapps.net |
3c56bf1 to
d91ff0e
Compare
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-569.eastasia.1.azurestaticapps.net |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d91ff0e4a0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const activeId = getActiveSlotId(); | ||
| const activePlayer = slotPlayerRef(activeId).current; | ||
| if (!newSegments.length || !activePlayer) return; | ||
| const activePlayer = slotPlayerRef(activeId).current ?? createPlayerForSlot(activeId); |
There was a problem hiding this comment.
Create the initial player before loading segments
On a fresh /player mount, the segments effect below still returns when the active slot has no player, but this commit removed the mount-time decoder effect that used to create slot A. That means the first non-empty segments update after loading a playlist never calls handleLoadSegments, so this new lazy createPlayerForSlot fallback is never reached and no MediaSource/player is created until some unrelated path creates one.
Useful? React with 👍 / 👎.
Summary
Why
Recent Chrome builds switched the default audio decoding path from FFmpeg to Symphonia, which means MPEG-1 Layer 2 / MP2 audio may no longer be decoded natively. Keeping the MP2 software decoder always enabled prevents no-audio playback on affected Chrome versions and avoids relying on browser UA detection for the default behavior.
Related
Related issue: #568
Notes
src/embedded_web_data.his intentionally not included in this PR.Validation
pnpm run type-check:tscpnpm run lint:biomepnpm run docs:build