Skip to main content

moq_hls/
lib.rs

1//! HLS / LL-HLS <-> MoQ gateway.
2//!
3//! Bridges HLS (and Low-Latency HLS) and [`moq_net`] broadcasts in both
4//! directions, mirroring the WHIP/WHEP split in `moq-rtc`:
5//!
6//! - [`import`] pulls a remote HLS master/media playlist and publishes its CMAF
7//!   segments into MoQ (an HTTP *client* that *publishes*).
8//! - [`server`] serves HLS playlists, DASH manifests, and CMAF segments over
9//!   HTTP for MoQ broadcasts (an HTTP *server*). It subscribes only to each
10//!   broadcast's catalog and timeline tracks; media bytes are FETCHed from
11//!   the relay one group at a time, only when a segment is actually requested.
12//!   It serves every request; gate access by layering your own middleware onto
13//!   [`Server::router`](server::Server::router), or parse and authorize each request
14//!   yourself and answer it with [`Server::respond`](server::Server::respond).
15//!
16//! All CMAF byte handling (import via [`moq_mux::container::fmp4::Import`],
17//! export via [`moq_mux::container::fmp4::Muxer`]) lives in `moq-mux`; this
18//! crate owns the HLS playlist and DASH manifest generation, the
19//! timeline-driven playlist window, and the HTTP surface.
20
21#![warn(missing_docs)]
22
23mod error;
24pub mod export;
25pub mod import;
26#[cfg(feature = "server")]
27pub mod server;
28
29pub(crate) use error::status_retryable;
30pub use error::*;
31#[cfg(feature = "server")]
32pub use server::Server;
33
34/// Re-export of the HTTP stack behind the export server, so consumers can name the
35/// types that surface through [`Server::router`] (and layer their own middleware on
36/// it) without adding their own axum dependency and risking a version mismatch.
37/// `axum::http` covers the `http` crate types too. A major axum bump is therefore a
38/// breaking change for this crate.
39#[cfg(feature = "server")]
40pub use axum;