@moq/hang
v0.2.0
Published
Media over QUIC library
Downloads
757
Readme
@moq/hang
Core media library for Media over QUIC (MoQ). Provides shared primitives used by @moq/watch and @moq/publish, built on top of @moq/lite.
Features
- Catalog — JSON track describing other tracks and their codec properties (audio, video, chat, location, etc.)
- Container — Media framing in two formats: CMAF (fMP4) and Legacy (varint-timestamp + raw codec bitstream)
- Utilities — Hex encoding, Opus audio polyfill (libav), latency computation, browser detection workarounds
Browser support detection is provided by <moq-watch-support> and <moq-publish-support>.
Installation
npm add @moq/hang
# or
pnpm add @moq/hang
yarn add @moq/hang
bun add @moq/hangJavaScript API
import * as Hang from "@moq/hang";
// Catalog — describes tracks and their codec properties
import * as Catalog from "@moq/hang/catalog";
// Container — media framing (CMAF and Legacy formats)
import * as Container from "@moq/hang/container";
// CMAF (fMP4) and Legacy (varint-timestamp + raw bitstream) are both available:
// Container.Cmaf — createVideoInitSegment, createAudioInitSegment, encodeDataSegment, decodeDataSegment, etc.
// Container.Legacy — Producer / Consumer classesFor watching and publishing, use the dedicated packages:
import * as Watch from "@moq/watch";
import * as Publish from "@moq/publish";Related Packages
- @moq/watch — Subscribe to and render MoQ broadcasts
- @moq/publish — Publish media to MoQ broadcasts
- @moq/ui-core — Shared UI components
- @moq/lite — Core pub/sub transport protocol
- @moq/signals — Reactive signals library
License
Licensed under either:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
