pub struct HlsPlaylist { /* private fields */ }hls only.Expand description
A sliding-window HLS media playlist.
Holds the most recent window segments and renders a spec-compliant
#EXTM3U document. Set low_latency to emit #EXT-X-PART hints and the
LL-HLS preload/blocking tags (the segmenter supplies parts).
Implementations§
Source§impl HlsPlaylist
impl HlsPlaylist
Sourcepub fn new(target_duration: u64, window: usize) -> Self
pub fn new(target_duration: u64, window: usize) -> Self
A live playlist holding window segments of up to target_duration secs.
Sourcepub fn low_latency(self, part_target: f64) -> Self
pub fn low_latency(self, part_target: f64) -> Self
Enable LL-HLS output with the given partial-segment target duration.
Sourcepub fn set_map(&mut self, uri: impl Into<String>)
pub fn set_map(&mut self, uri: impl Into<String>)
Set the fMP4 initialization-segment URI, emitted as #EXT-X-MAP.
Required for fragmented-MP4 renditions (HEVC, AV1, VVC).
Sourcepub fn push(&mut self, seg: Segment)
pub fn push(&mut self, seg: Segment)
Append a segment, evicting the oldest if the window is full.
Sourcepub fn add_pending_part(&mut self, part: Part)
pub fn add_pending_part(&mut self, part: Part)
Append a partial segment to the in-progress (live-edge) segment.
Sourcepub fn set_preload_hint(&mut self, uri: impl Into<String>)
pub fn set_preload_hint(&mut self, uri: impl Into<String>)
Advertise the next not-yet-available part via #EXT-X-PRELOAD-HINT.
Sourcepub fn commit_segment(&mut self, seg: Segment)
pub fn commit_segment(&mut self, seg: Segment)
Complete the in-progress segment: push it carrying the parts accumulated
via add_pending_part, then clear the pending
state for the next segment.
Trait Implementations§
Source§impl Clone for HlsPlaylist
impl Clone for HlsPlaylist
Source§fn clone(&self) -> HlsPlaylist
fn clone(&self) -> HlsPlaylist
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more