Membrane.HLS.Source (Membrane HLS Plugin v3.0.10)

Copy Markdown View Source

Source element that reads a single media playlist and emits segment payloads.

Operation

  • For VOD playlists (#EXT-X-ENDLIST or :vod type), segments are served on demand until the playlist is exhausted, then EOS is emitted.
  • For live/event playlists, the playlist is polled and new segments are enqueued as they appear. Demand still controls when segments are downloaded and sent downstream.

Stream format

This element does not parse media; it forwards raw segment payloads. Callers must provide stream_format describing the segment container:

  • %Membrane.HLS.Format.MPEG{} for MPEG-TS
  • %Membrane.HLS.Format.PackedAudio{} for packed AAC
  • %Membrane.HLS.Format.WebVTT{} for WebVTT

Notes

  • Segment metadata (HLS.Segment) is attached to each buffer.
  • poll_interval_ms is intended for tests; production should rely on playlist target duration.

Element options

Passed via struct Membrane.HLS.Source.t/0

  • storage

    Storage.t()

    Required
    HLS.Storage implementation used to obtain playlist contents

  • media_playlist_uri

    URI.t()

    Required
    URI of the media playlist

  • stream_format

    struct()

    Required
    Stream format describing the media playlist contents (%Membrane.HLS.Format.PackedAudio{}, %Membrane.HLS.Format.WebVTT{}, or %Membrane.HLS.Format.MPEG{})

  • poll_interval_ms

    non_neg_integer() | nil

    Default value: nil
    Optional poll interval override (milliseconds) for live playlists. When nil, the target duration derived from the playlist is used.

Pads

:output

Accepted formats:

%Membrane.RemoteStream{content_format: %format{}}
when format in [Format.PackedAudio, Format.WebVTT, Format.MPEG]
Direction::output
Availability::always
Flow control::manual
Demand unit:nil

Summary

Types

t()

Struct containing options for Membrane.HLS.Source

Functions

Returns description of options available for this module

Types

t()

@type t() :: %Membrane.HLS.Source{
  media_playlist_uri: URI.t(),
  poll_interval_ms: non_neg_integer() | nil,
  storage: HLS.Storage.t(),
  stream_format: struct()
}

Struct containing options for Membrane.HLS.Source

Functions

options()

@spec options() :: keyword()

Returns description of options available for this module