Membrane.HTTPAdaptiveStream.Manifest behaviour (Membrane HTTP Adaptive Stream plugin v0.3.0) View Source

Behaviour for manifest serialization.

Link to this section Summary

Functions

Adds a track to the manifest.

Returns stale and current segments' names from all tracks

Restores all the stale segments in all tracks.

Link to this section Types

Specs

t() :: %Membrane.HTTPAdaptiveStream.Manifest{
  module: module(),
  name: String.t(),
  tracks: %{
    required(id :: any()) => Membrane.HTTPAdaptiveStream.Manifest.Track.t()
  }
}

Link to this section Functions

Link to this function

add_segment(manifest, track_id, duration)

View Source

Specs

add_segment(
  t(),
  track_id :: Membrane.HTTPAdaptiveStream.Manifest.Track.id_t(),
  Membrane.HTTPAdaptiveStream.Manifest.Track.segment_duration_t()
) :: {{to_add_name :: String.t(), to_remove_names :: [String.t()]}, t()}
Link to this function

add_track(manifest, config)

View Source

Specs

add_track(t(), Membrane.HTTPAdaptiveStream.Manifest.Track.Config.t()) ::
  {header_name :: String.t(), t()}

Adds a track to the manifest.

Returns the name under which the header file should be stored.

Returns stale and current segments' names from all tracks

Link to this function

finish(manifest, track_id)

View Source

Specs

Link to this function

from_beginning(manifest)

View Source

Restores all the stale segments in all tracks.

All the tracks must be configured to be 'persist'ed.

Specs

serialize(t()) :: [{name :: String.t(), manifest :: String.t()}]

Link to this section Callbacks

Specs

serialize(t()) :: [
  {manifest_name :: String.t(), manifest_content :: String.t()}
]