| Crates.io | hang |
| lib.rs | hang |
| version | 0.5.5 |
| created_at | 2025-03-24 00:09:59.801994+00 |
| updated_at | 2025-09-22 21:33:02.474514+00 |
| description | Media over QUIC |
| homepage | |
| repository | https://github.com/kixelated/moq |
| max_upload_size | |
| id | 1603218 |
| size | 114,756 |
A media library built on top of moq-lite for streaming audio and video.
hang provides media-specific functionality, split into a few components:
We most of the implement the WebCodecs specification.
There's also a cmaf module that can import fMP4/CMAF files into a hang broadcast.
It's crude and doesn't support all features, but it's a good starting point to ingest existing content.
use hang::{BroadcastProducer, Frame};
let mut broadcast = BroadcastProducer::new();
// Create a video track
let video = hang::catalog::Video {
track: moq_lite::Track { name: "video".to_string(), priority: 1 },
// Decoder configuration.
config: Default::default(),
};
let mut track = broadcast.create_video(video);
// NOTE: Unlike moq_lite, you don't create a group producer.
// One will be created automatically when you write a keyframe.
let frame = Frame {
timestamp: std::time::Duration::from_secs(1),
keyframe: true,
payload: b"video data".as_slice().into(),
};
track.write(frame);