moonbitstack/moonmedia/m3u8 does not have a README file

    PlaylistError

    pub(all) suberror PlaylistError {
    Malformed(at~ : Int, want~ : String, got~ : String)
    }

    Why a playlist could not be read.

    at is the line the parser stopped on, counting from one; got is what was there and want what the grammar allows.

    PlaylistError::output

    fn PlaylistError::output(self : PlaylistError, logger : &Logger) -> Unit

    The one-line account of a failure.

    PlaylistError::to_string

    fn PlaylistError::to_string(self : PlaylistError) -> String

    The one-line account of a failure.

    ByteRange

    pub(all) struct ByteRange {
    length : Int64
    offset : Int64?
    } derive(Eq,
    Debug
    )

    A byte range inside a resource (RFC 8216 §4.3.2.2).

    offset absent means "immediately after the previous range", which is what the tag itself means when the @ clause is left out. Keeping the two apart matters: a reader that filled in zero would fetch the wrong bytes.

    ByteRange::equal

    fn ByteRange::equal(ByteRange, ByteRange) -> Bool

    ByteRange::new

    fn ByteRange::new(length : Int64, offset? : Int64) -> ByteRange

    One range, length@offset.

    ByteRange::not_equal

    fn ByteRange::not_equal(x : ByteRange, y : ByteRange) -> Bool

    Cipher

    pub(all) enum Cipher {
    None
    Aes128
    SampleAes
    Other(String)
    } derive(Eq,
    Debug
    )

    The encryption method EXT-X-KEY names (RFC 8216 §4.3.2.4).

    Other carries a method this release does not implement, so a playlist that uses one is read and written back unchanged rather than refused.

    Cipher::code

    fn Cipher::code(self : Cipher) -> String

    The method as it appears on the wire.

    Cipher::equal

    fn Cipher::equal(Cipher, Cipher) -> Bool

    Cipher::not_equal

    fn Cipher::not_equal(x : Cipher, y : Cipher) -> Bool

    Cipher::of

    fn Cipher::of(code : StringView) -> Cipher

    The method a wire value names; Other for one this release does not know.

    Cipher::to_repr

    DateRange

    pub(all) struct DateRange {
    id : String
    class_ : String?
    start_date : String?
    end_date : String?
    duration : Double?
    planned_duration : Double?
    scte35_cmd : String?
    scte35_out : String?
    scte35_in : String?
    end_on_next : Bool
    extra : Array[String]
    } derive(Eq,
    Debug
    )

    A wall-clock interval the stream marks, EXT-X-DATERANGE (RFC 8216 §4.3.2.7).

    DateRange::equal

    fn DateRange::equal(DateRange, DateRange) -> Bool

    DateRange::new

    fn DateRange::new(id : String, start_date? : String) -> DateRange

    The interval named id.

    DateRange::not_equal

    fn DateRange::not_equal(x : DateRange, y : DateRange) -> Bool

    Define

    pub(all) struct Define {
    name : String?
    value : String?
    import_ : String?
    queryparam : String?
    } derive(Eq,
    Debug
    )

    A variable the playlist defines, EXT-X-DEFINE (RFC 8216bis §4.4.2.3).

    Define::equal

    fn Define::equal(Define, Define) -> Bool

    Define::new

    fn Define::new(name : String, value : String) -> Define

    A variable set to value.

    Define::not_equal

    fn Define::not_equal(x : Define, y : Define) -> Bool

    Define::to_repr

    IFrameStream

    pub(all) struct IFrameStream {
    uri : String
    bandwidth : Int?
    average_bandwidth : Int?
    codecs : String?
    resolution : Resolution?
    hdcp_level : String?
    video_range : String?
    pathway_id : String?
    stable_variant_id : String?
    extra : Array[String]
    } derive(Eq,
    Debug
    )

    An I-frame only rendition, EXT-X-I-FRAME-STREAM-INF (RFC 8216 §4.3.4.3).

    IFrameStream::equal

    IFrameStream::new

    fn IFrameStream::new(uri : String, bandwidth? : Int) -> IFrameStream

    I-frame streams served from uri.

    IFrameStream::not_equal

    fn IFrameStream::not_equal(x : IFrameStream, y : IFrameStream) -> Bool

    InitSection

    pub(all) struct InitSection {
    uri : String
    byte_range : ByteRange?
    } derive(Eq,
    Debug
    )

    The initialisation section a segment needs before it can be decoded, the EXT-X-MAP tag (RFC 8216 §4.3.2.5).

    InitSection::equal

    fn InitSection::equal(InitSection, InitSection) -> Bool

    InitSection::new

    fn InitSection::new(uri : String, byte_range? : ByteRange) -> InitSection

    An initialisation section served from uri.

    InitSection::not_equal

    fn InitSection::not_equal(x : InitSection, y : InitSection) -> Bool

    Key

    pub(all) struct Key {
    cipher : Cipher
    uri : String?
    iv : String?
    key_format : String?
    key_format_versions : String?
    extra : Array[String]
    } derive(Eq,
    Debug
    )

    A key a segment is encrypted with (RFC 8216 §4.3.2.4).

    Segments carry the key that was in force when they were written, not the tag that introduced it: a tag applies to every following segment until it is replaced, and a caller hunting for "what encrypts this segment" should not have to replay the file to find out.

    Key::equal

    fn Key::equal(Key, Key) -> Bool

    Key::is_plain

    fn Key::is_plain(self : Key) -> Bool

    Whether the key leaves the stream in the clear.

    Key::new

    fn Key::new(uri : String, cipher? : Cipher, iv? : String, key_format? : String, key_format_versions? : String) -> Key

    A key, with the URI that serves it.

    Key::not_equal

    fn Key::not_equal(x : Key, y : Key) -> Bool

    Key::to_repr

    Master

    pub(all) struct Master {
    version : Int?
    independent_segments : Bool
    start : Start?
    defines : Array[Define]
    session_data : Array[SessionData]
    session_keys : Array[Key]
    renditions : Array[Rendition]
    variants : Array[Variant]
    i_frame_streams : Array[IFrameStream]
    unknown : Array[String]
    } derive(Eq,
    Debug
    )

    A master playlist: which renditions exist and how to reach them (RFC 8216 §4.3.4).

    Master::encode

    fn Master::encode(self : Master) -> String

    Master::equal

    fn Master::equal(Master, Master) -> Bool

    Master::new

    fn Master::new() -> Master

    An empty master playlist.

    Master::not_equal

    fn Master::not_equal(x : Master, y : Master) -> Bool

    Master::to_repr

    MediaKind

    pub(all) enum MediaKind {
    Audio
    Video
    Subtitles
    ClosedCaptions
    Other(String)
    } derive(Eq,
    Debug
    )

    What an EXT-X-MEDIA rendition carries (RFC 8216 §4.3.4.1).

    MediaKind::code

    fn MediaKind::code(self : MediaKind) -> String

    The kind as it appears on the wire.

    MediaKind::equal

    fn MediaKind::equal(MediaKind, MediaKind) -> Bool

    MediaKind::not_equal

    fn MediaKind::not_equal(x : MediaKind, y : MediaKind) -> Bool

    MediaKind::of

    fn MediaKind::of(code : StringView) -> MediaKind

    The kind a wire value names.

    MediaPlaylist

    pub(all) struct MediaPlaylist {
    version : Int?
    target_duration : Int
    media_sequence : Int64
    discontinuity_sequence : Int64
    playlist_type : PlaylistType?
    i_frames_only : Bool
    independent_segments : Bool
    allow_cache : Bool?
    end_list : Bool
    start : Start?
    server_control : ServerControl?
    part_inf : Double?
    skip : Int?
    defines : Array[Define]
    date_ranges : Array[DateRange]
    segments : Array[Segment]
    next_parts : Array[Part]
    preload_hint : PreloadHint?
    rendition_reports : Array[RenditionReport]
    unknown : Array[String]
    } derive(Eq,
    Debug
    )

    A media playlist: the segments of one rendition (RFC 8216 §4.3.3).

    MediaPlaylist::encode

    fn MediaPlaylist::encode(self : MediaPlaylist) -> String

    MediaPlaylist::equal

    MediaPlaylist::new

    fn MediaPlaylist::new(target_duration : Int) -> MediaPlaylist

    An empty media playlist whose segments are at most target_duration seconds long, which the specification requires to be present.

    MediaPlaylist::not_equal

    fn MediaPlaylist::not_equal(x : MediaPlaylist, y : MediaPlaylist) -> Bool

    Part

    pub(all) struct Part {
    uri : String
    duration : Double
    independent : Bool
    byte_range : ByteRange?
    gap : Bool
    } derive(Eq,
    Debug
    )

    A partial segment, the unit low-latency HLS publishes before a segment is complete (RFC 8216bis §4.4.4.9).

    Part::equal

    fn Part::equal(Part, Part) -> Bool

    Part::new

    fn Part::new(uri : String, duration : Double, independent? : Bool, byte_range? : ByteRange, gap? : Bool) -> Part

    A part of the segment at uri lasting duration seconds.

    Part::not_equal

    fn Part::not_equal(x : Part, y : Part) -> Bool

    Part::to_repr

    Playlist

    pub(all) enum Playlist {
    MasterPlaylist(Master)
    MediaPlaylist(MediaPlaylist)
    } derive(Eq,
    Debug
    )

    A playlist, of one kind or the other.

    Playlist::encode

    fn Playlist::encode(self : Playlist) -> String

    Write a playlist back out.

    Tags are written in the order the specification lists them rather than the order they were read, except inside a segment, where the order the file had is the order players expect to see: the key and the map apply to the segment that follows, so they come first, and #EXTINF immediately precedes its URI.

    Playlist::equal

    fn Playlist::equal(Playlist, Playlist) -> Bool

    Playlist::is_master

    fn Playlist::is_master(self : Playlist) -> Bool

    Whether this is a master playlist.

    Playlist::master

    fn Playlist::master(self : Playlist) -> Master?

    The master playlist, when this is one.

    Playlist::media

    fn Playlist::media(self : Playlist) -> MediaPlaylist?

    The media playlist, when this is one.

    Playlist::not_equal

    fn Playlist::not_equal(x : Playlist, y : Playlist) -> Bool

    Playlist::parse

    fn Playlist::parse(text : StringView) -> Playlist raise PlaylistError

    Read a playlist.

    A master playlist and a media playlist are told apart by what the file contains, not by a declaration: the presence of a variant stream or a rendition makes it a master. Anything the release does not model is kept in unknown and written back, so a playlist using a tag from a later revision survives a round trip.

    Playlist::to_repr

    PlaylistType

    pub(all) enum PlaylistType {
    Event
    Vod
    Other(String)
    } derive(Eq,
    Debug
    )

    What kind of playlist a media playlist is (RFC 8216 §4.3.3.5).

    PlaylistType::equal

    PlaylistType::not_equal

    fn PlaylistType::not_equal(x : PlaylistType, y : PlaylistType) -> Bool

    PreloadHint

    pub(all) struct PreloadHint {
    kind : String
    uri : String
    byte_range : ByteRange?
    start : Int64?
    extra : Array[String]
    } derive(Eq,
    Debug
    )

    What to fetch next before it is listed, EXT-X-PRELOAD-HINT (RFC 8216bis §4.4.4.10).

    PreloadHint::equal

    fn PreloadHint::equal(PreloadHint, PreloadHint) -> Bool

    PreloadHint::new

    fn PreloadHint::new(kind : String, uri : String, byte_range? : ByteRange, start? : Int64) -> PreloadHint

    A hint that uri will hold the next kind (PART or MAP).

    PreloadHint::not_equal

    fn PreloadHint::not_equal(x : PreloadHint, y : PreloadHint) -> Bool

    Rendition

    pub(all) struct Rendition {
    kind : MediaKind
    group_id : String
    name : String
    uri : String?
    language : String?
    assoc_language : String?
    characteristics : String?
    channels : String?
    instream_id : String?
    stable_rendition_id : String?
    pathway_id : String?
    default : Bool
    autoselect : Bool
    forced : Bool
    extra : Array[String]
    } derive(Eq,
    Debug
    )

    An alternative rendition a variant can switch to (RFC 8216 §4.3.4.1).

    Rendition::equal

    fn Rendition::equal(Rendition, Rendition) -> Bool

    Rendition::new

    fn Rendition::new(kind : MediaKind, group_id : String, name : String, uri? : String) -> Rendition

    A rendition called name in the group group_id.

    Rendition::not_equal

    fn Rendition::not_equal(x : Rendition, y : Rendition) -> Bool

    RenditionReport

    pub(all) struct RenditionReport {
    uri : String
    last_msn : Int64?
    last_part : Int?
    extra : Array[String]
    } derive(Eq,
    Debug
    )

    How far along a sibling rendition is, EXT-X-RENDITION-REPORT (RFC 8216bis §4.4.4.11).

    RenditionReport::equal

    RenditionReport::new

    fn RenditionReport::new(uri : String, last_msn? : Int64, last_part? : Int) -> RenditionReport

    A report on the rendition at uri.

    RenditionReport::not_equal

    fn RenditionReport::not_equal(x : RenditionReport, y : RenditionReport) -> Bool

    Resolution

    pub(all) struct Resolution {
    width : Int
    height : Int
    } derive(Eq,
    Debug
    )

    A frame size, 1920x1080.

    Resolution::equal

    fn Resolution::equal(Resolution, Resolution) -> Bool

    Resolution::new

    fn Resolution::new(width : Int, height : Int) -> Resolution

    A video size in pixels.

    Resolution::not_equal

    fn Resolution::not_equal(x : Resolution, y : Resolution) -> Bool

    Segment

    pub(all) struct Segment {
    uri : String
    duration : Double
    title : String?
    byte_range : ByteRange?
    discontinuity : Bool
    program_date_time : String?
    gap : Bool
    key : Key?
    map : InitSection?
    parts : Array[Part]
    } derive(Eq,
    Debug
    )

    One media segment: the URI a player fetches and everything the playlist says about it.

    Segment::equal

    fn Segment::equal(Segment, Segment) -> Bool

    Segment::new

    fn Segment::new(uri : String, duration : Double, title? : String) -> Segment

    A segment at uri lasting duration seconds.

    Segment::not_equal

    fn Segment::not_equal(x : Segment, y : Segment) -> Bool

    Segment::to_repr

    ServerControl

    pub(all) struct ServerControl {
    can_skip_until : Double?
    can_skip_date_ranges : Bool
    hold_back : Double?
    part_hold_back : Double?
    can_block_reload : Bool
    extra : Array[String]
    } derive(Eq,
    Debug
    )

    The reload advice a low-latency server gives, EXT-X-SERVER-CONTROL (RFC 8216bis §4.4.3.8).

    ServerControl::equal

    ServerControl::new

    The reload advice with nothing set.

    ServerControl::not_equal

    fn ServerControl::not_equal(x : ServerControl, y : ServerControl) -> Bool

    SessionData

    pub(all) struct SessionData {
    data_id : String
    value : String?
    uri : String?
    language : String?
    extra : Array[String]
    } derive(Eq,
    Debug
    )

    A piece of session metadata, EXT-X-SESSION-DATA (RFC 8216 §4.3.4.4).

    SessionData::equal

    fn SessionData::equal(SessionData, SessionData) -> Bool

    SessionData::new

    fn SessionData::new(data_id : String, value? : String, uri? : String, language? : String) -> SessionData

    The metadata named data_id, carried inline as value or by uri.

    SessionData::not_equal

    fn SessionData::not_equal(x : SessionData, y : SessionData) -> Bool

    Start

    pub(all) struct Start {
    time_offset : Double
    precise : Bool
    } derive(Eq,
    Debug
    )

    Where playback should start, EXT-X-START (RFC 8216 §4.3.5.2).

    Start::equal

    fn Start::equal(Start, Start) -> Bool

    Start::new

    fn Start::new(time_offset : Double, precise? : Bool) -> Start

    Start time_offset seconds from the beginning.

    Start::not_equal

    fn Start::not_equal(x : Start, y : Start) -> Bool

    Start::to_repr

    Variant

    pub(all) struct Variant {
    uri : String
    bandwidth : Int?
    average_bandwidth : Int?
    codecs : String?
    resolution : Resolution?
    frame_rate : Double?
    hdcp_level : String?
    audio : String?
    video : String?
    subtitles : String?
    closed_captions : String?
    video_range : String?
    pathway_id : String?
    stable_variant_id : String?
    extra : Array[String]
    } derive(Eq,
    Debug
    )

    One rendition of a master playlist, the body of EXT-X-STREAM-INF (RFC 8216 §4.3.4.2).

    Variant::equal

    fn Variant::equal(Variant, Variant) -> Bool

    Variant::new

    fn Variant::new(uri : String, bandwidth? : Int, codecs? : String) -> Variant

    A variant streaming uri, using bandwidth bits per second.

    Variant::not_equal

    fn Variant::not_equal(x : Variant, y : Variant) -> Bool

    Variant::to_repr