Skip to content

hang: cross-broadcast track references in renditions#1371

Draft
kixelated wants to merge 1 commit intomainfrom
catalog-broadcast-override
Draft

hang: cross-broadcast track references in renditions#1371
kixelated wants to merge 1 commit intomainfrom
catalog-broadcast-override

Conversation

@kixelated
Copy link
Copy Markdown
Collaborator

Summary

  • Add optional broadcast field on video/audio rendition configs (e.g. "../source") so a downstream catalog can reference tracks published in another broadcast without republishing bytes.
  • New PathRelative type + Path::resolve in moq-lite (Rust) with full unit coverage; mirror resolveBroadcast helper for @moq/hang.
  • @moq/watch Broadcast.trackBroadcast(effect, configBroadcast) looks up the override broadcast on the same connection; audio/video decoder + MSE backends honor it. The Rust subscribe example demonstrates the consumer flow via OriginConsumer::announced_broadcast.

Test plan

  • cargo test --all-targets (incl. new PathRelative/resolve tests + serde round-trip in catalog::root)
  • bun run --filter='*' test
  • just check
  • Manually verify a worker-style flow: publish a source broadcast, publish a sidecar catalog with broadcast: "../source", watch via @moq/watch and confirm the watcher subscribes against the source broadcast

🤖 Generated with Claude Code

Add an optional `broadcast` field on video/audio renditions that points
at the broadcast publishing the track, expressed as a relative path
("../source", etc.). Lets a worker author a downstream catalog that
sidecars unchanged renditions against an upstream broadcast without
republishing the bytes. Watchers resolve the field against the catalog
broadcast's path and subscribe on the same connection.

- moq-lite: new `PathRelative` type and `Path::resolve` for `..`-aware
  resolution, with full unit coverage.
- @moq/hang: mirror `resolveBroadcast` helper for the browser side.
- @moq/watch: `Broadcast.trackBroadcast` looks up the override broadcast
  with lifetime tied to the calling Effect; audio/video decoder + MSE
  backends use it.
- rs/hang/examples/subscribe.rs: demonstrate consumer-side resolution
  via `OriginConsumer::announced_broadcast`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 2, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6dcb176a-2777-4590-bb87-62223b435b05

📥 Commits

Reviewing files that changed from the base of the PR and between 705a9fc and bc1c50c.

📒 Files selected for processing (23)
  • js/hang/src/catalog/audio.ts
  • js/hang/src/catalog/index.ts
  • js/hang/src/catalog/path.ts
  • js/hang/src/catalog/video.ts
  • js/watch/src/audio/decoder.ts
  • js/watch/src/audio/mse.ts
  • js/watch/src/broadcast.ts
  • js/watch/src/video/decoder.ts
  • js/watch/src/video/mse.ts
  • rs/hang/examples/subscribe.rs
  • rs/hang/examples/video.rs
  • rs/hang/src/catalog/audio/mod.rs
  • rs/hang/src/catalog/root.rs
  • rs/hang/src/catalog/video/mod.rs
  • rs/moq-lite/src/path.rs
  • rs/moq-mux/src/import/aac.rs
  • rs/moq-mux/src/import/av01.rs
  • rs/moq-mux/src/import/avc1.rs
  • rs/moq-mux/src/import/avc3.rs
  • rs/moq-mux/src/import/fmp4.rs
  • rs/moq-mux/src/import/hev1.rs
  • rs/moq-mux/src/import/opus.rs
  • rs/moq-mux/src/msf.rs

Walkthrough

This change adds optional broadcast reference support to audio and video track configurations. A new optional broadcast field allows specifying relative paths to alternative broadcasts that publish tracks, defaulting to the catalog's broadcast when omitted. New path resolution utilities (resolveBroadcast in JavaScript, PathRelative type and resolve method in Rust) handle relative broadcast path interpretation. Consumer code in player decoders and MSE implementations now use the broadcast resolution logic to select the correct source. Codec importers explicitly set the field to None by default, and tests verify the new serialization/deserialization behavior.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding support for cross-broadcast track references in renditions.
Description check ✅ Passed The description provides a clear and comprehensive overview of the changes, including new features, implementation details across multiple modules, and test plans.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch catalog-broadcast-override
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch catalog-broadcast-override

Tip

💬 Introducing [Slack Agent](https://www.coderabbit.ai/agent): Turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get your free trial and get 200 agent minutes per Slack user (a $50 value).


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
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@kixelated kixelated marked this pull request as draft May 5, 2026 16:07
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