Repository navigation
feat(spf): render MoQ audio through the @caprid/moq-media worklet core - #72
Conversation
The AudioWorklet player core is now published, so the worklet renderer becomes the only audio renderer and the AudioBufferSourceNode path is removed. The latency controller's playout rate reaches the core as the input's playbackRate (clamped to its 0.5-2 range), and the clock is rebased on each change so it advances at the rate in effect. The renderer defaults to the core on the render context's baseContext; the engine's createAudioPlayer option stays as an override. @caprid/* joins minimumReleaseAgeExclude. Closes #66 Claude-Session: https://claude.ai/code/session_01DaH4ihf1LLPqmXShYkvBat
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
📦 Bundle Size Report🎨 @videojs/html
Presets (7)
Media (19)
Players (5)
Skins (29)
UI Components (62)
⚛️ @videojs/react — no changesPresets (7)
Media (22)
Extensions (2)
Players (5)
Skins (18)
UI Components (39)
🧩 @videojs/core — no changesEntries (76)
🏷️ @videojs/element — no changesEntries (2)
📦 @videojs/store — no changesEntries (3)
🔧 @videojs/utils — no changesEntries (13)
📦 @videojs/cdn — no changes📦 @videojs/cloudflare-video — no changes📦 @videojs/dash-video — no changes📦 @videojs/google-cast — no changes📦 @videojs/hlsjs-video — no changes📦 @videojs/media — no changesEntries (3)
📦 @videojs/mux — no changes📦 @videojs/mux-audio — no changesEntries (2)
📦 @videojs/mux-data — no changes📦 @videojs/mux-video — no changesEntries (2)
📦 @videojs/native-hls-video — no changes📦 @videojs/shaka-video — no changes📦 @videojs/spf
Entries (8)
📦 @videojs/spotify-audio — no changes📦 @videojs/tiktok-video — no changes📦 @videojs/twitch-video — no changes📦 @videojs/other — no changesEntries (3)
📦 @videojs/vimeo-video — no changes📦 @videojs/wistia-video — no changesEntries (2)
📦 @videojs/youtube-video — no changesℹ️ How to interpretEach entry is independently bundled, minified, and brotli-compressed. Initial size includes its static import graph; lazy dynamic chunks are reported separately. Entries are not additive because their dependency graphs overlap. Preset rows represent realistic combined bundles. Changes of 300 B or less across initial, lazy, and total size are collapsed, not discarded. Run |
There was a problem hiding this comment.
All reported issues were addressed across 15 files
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.
View guided diff | Turn on auto-fix | Re-trigger cubic
Measured from the timeline's first frame, packets that resume past a gap landed beyond the fill horizon and reached the core one per 100 ms stall rescue, holding the clock for up to the core's jitter ceiling over again. Claude-Session: https://claude.ai/code/session_01DaH4ihf1LLPqmXShYkvBat
Brings in #72 (worklet audio core), #75 (player on @caprid/moq-core, moqt-22) and #77 (moq-media pinned to 0.1.0). The publisher keeps its own draft-20 copy of network/moqt until its publish session moves onto @caprid/moq-core; the player side uses the package. The cross-engine relay hub now speaks each engine's draft: draft-20 upstream to the publisher, moqt-22 (via moqt-wire) to the player, whose Location Filters draft-22 encodes differently. The cross-engine harness hands the engine a context with `baseContext`, as the adapter does, so the worklet audio core can start. Claude-Session: https://claude.ai/code/session_01DaH4ihcQ4LStE1f1zbDuZm
Closes #66
Summary
The relay SDKs are now on npm as
@caprid/*, so this makes the AudioWorklet player core from@caprid/moq-mediathe only MoQ audio renderer and deletes theAudioBufferSourceNodepath. The latency controller's rate nudges now reach the core, which was the last reason the core was opt-in.Changes
@caprid/moq-media^0.1.0is now a dependency of@videojs/spf.@caprid/*is added tominimumReleaseAgeExclude, because 0.1.0 was published the day before.audio-renderer.tsand keeps thecreateAudioRendererActorname. The source-node renderer and its tests are removed.playoutRatereaches the core as the input'splaybackRate, clamped to the 0.5–2 range the core accepts. A new input starts at the current rate. On each change the clock first saves its position at the old speed, so it always moves at the rate in effect. The output-latency term is converted to media time at the current rate.baseContext. Without one, the renderer goes to anerrorstatus. The engine'screateAudioPlayeroption stays, but only as an override.AudioContextLikedropscreateBuffer/createBufferSource, and so do the adapter's render context and the test fakes.opusPacketDurationUs. Comments that referred to@mux/moq-mediaor "the relay SDKs" now name the@capridpackages.Testing
pnpm -F @videojs/spf test: 2414 passed.pnpm typecheck, format andpnpm check:workspacepass. Thesimple-moq-videohtml tests pass.baseContext, and goes to an error status without one.AudioContext, and 6 s of Opus encoded with WebCodecs:moqentry, esbuild, minified): 102.9 → 111.6 KB, 33.1 → 36.5 KB gzipped.pnpm -F @videojs/spf sizeis broken onmmcc/moq(it callspnpm build, which the Vite+ migration removed), so I measured with esbuild instead.Follow-up, not in this PR: the dry and hold detection could read the core's
dryAtUsandplayStartsstats instead of working them out from timestamps.🤖 Generated with Claude Code
https://claude.ai/code/session_01DaH4ihf1LLPqmXShYkvBat
Summary by cubic
Makes
@caprid/moq-media's AudioWorklet player core the only MoQ audio renderer, deleting theAudioBufferSourceNodepath, and sends the latency controller's playout rate into the core, which was the last reason the worklet renderer was opt-in.@caprid/moq-media^0.1.0 as a dependency and@caprid/*tominimumReleaseAgeExclude.audio-renderer.ts; the source-node renderer and its tests are removed.playoutRatereaches the core asplaybackRate, clamped to the 0.5–2 range, and the clock rebases on each change so it advances at the rate in effect.baseContext; without one it goes to an error status. The engine'screateAudioPlayeroption stays as an override.AudioContextLikedropscreateBuffer/createBufferSource, and the local Opus duration helper is replaced by the package'sopusPacketDurationUs.Written for commit d75c164. Summary will update on new commits.