Turn the transmuxing worker back off: it is webpack-only - #16
Merged
Conversation
Every stream stopped playing. `enableWorker: true` was copied from media-streamer's live TV player in the previous commit, and it cannot be copied. mpegts.js builds its worker by stringifying `__webpack_modules__` -- webpack's internal module registry -- in `utils/webworkify-webpack.js`. That global exists in media-streamer, which is Next.js and therefore webpack. This bundle is built by Bun, where there is no such global, so the worker it assembles is broken. It then fails in the worst available way. `Transmuxer` does wrap the worker setup in a try/catch and fall back to inline transmuxing, but only a SYNCHRONOUS throw reaches that catch. A Worker that constructs from a blob whose body then fails is an asynchronous failure: nothing throws, nothing falls back, no init segment ever arrives, and the player sits there having reported no error at all -- so it is not even a message the reader can act on, just a channel that does nothing. Everything else in that commit came over from the television's profile, which had been running in production for weeks: stash on at 384KB, chasing off, the cleanup bounds, lazyLoad off. This was the single line that had never run anywhere except under webpack, which is why it is the only one reverted. The restart-budget fix -- the one that stops streams dying after a minute or two -- is untouched, as is fullscreen on Play. The test that asserted the worker was on now asserts it is off, and carries the reason so nobody re-enables it without changing how this file is bundled. 939 tests pass. `vendor-mpegts.js` rebuilt. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S5KxNHPQPY9Do9eWfJnGP4
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.
Every stream stopped playing after #15.
enableWorker: truewas copied from media-streamer's live TV player, and it cannot be copied.Why
mpegts.js builds its worker by stringifying
__webpack_modules__— webpack's internal module registry — inutils/webworkify-webpack.js:That global exists in media-streamer, which is Next.js and therefore webpack. This bundle is built by Bun, where there is no such global, so the worker it assembles is broken.
Why it was silent
Transmuxerdoes guard it:But only a synchronous throw reaches that catch. A Worker that constructs from a blob whose body then fails is an asynchronous failure: nothing throws, nothing falls back, no init segment ever arrives, and the player reports no error at all. Not a dropped frame, not a message the reader can act on — just a channel that does nothing.
Scope of the revert
One line. Everything else in #15 came from the television's profile, which had been running in production for weeks — stash on at 384KB, chasing off, the cleanup bounds, lazyLoad off.
enableWorkerwas the only setting that had never run anywhere except under webpack, which is why it is the only one reverted.Untouched: the restart-budget fix (refill on
playing) that stops streams dying after a minute or two, and fullscreen + sound on Play.Test
The test that asserted the worker was on now asserts it is off and carries the reason, so nobody re-enables it without first changing how this file is bundled. 939 pass.
vendor-mpegts.jsrebuilt —enableWorker:!1, noenableWorker:!0.🤖 Generated with Claude Code
https://claude.ai/code/session_01S5KxNHPQPY9Do9eWfJnGP4