HLS.Playlist.Tag behaviour (HTTP Live Streaming (HLS) library v2.5.13)

View Source

Summary

Functions

Parses an attribute list string as specified in RFC 8216, section 4.2 Optimized version using binary pattern matching instead of codepoints

Types

attribute_list_t()

@type attribute_list_t() :: %{required(atom()) => any()}

behaviour_t()

@type behaviour_t() :: module()

group_id_t()

@type group_id_t() :: String.t()

t()

@type t() :: %HLS.Playlist.Tag{
  attributes: attribute_list_t(),
  class: tag_class_t(),
  id: tag_id_t(),
  sequence: pos_integer(),
  value: any()
}

tag_class_t()

@type tag_class_t() ::
  :media_segment
  | :media_playlist
  | :master_playlist
  | :playlist
  | :master_or_media_playlist

tag_id_t()

@type tag_id_t() ::
  :ext_m3u
  | :ext_x_version
  | :extinf
  | :ext_x_byterange
  | :ext_x_discontinuity
  | :ext_x_key
  | :ext_x_map
  | :ext_x_program_date_time
  | :ext_x_daterange
  | :ext_x_targetduration
  | :ext_x_media_sequence
  | :ext_x_discontinuity_sequence
  | :ext_x_endlist
  | :ext_x_playlist_type
  | :ext_x_i_frames_only
  | :ext_x_media
  | :ext_x_stream_inf
  | :ext_x_i_frame_stream_inf
  | :ext_x_session_data
  | :ext_x_session_key
  | :ext_x_independent_segments
  | :ext_x_start

Callbacks

has_uri?()

@callback has_uri?() :: boolean()

id()

@callback id() :: tag_id_t()

init(arg1, pos_integer)

@callback init(attribute_list_t() | any(), pos_integer()) :: t()

is_multiline?()

@callback is_multiline?() :: boolean()

match?(t)

@callback match?(String.t()) :: boolean()

unmarshal(arg1)

@callback unmarshal(String.t() | [String.t()]) :: attribute_list_t() | any()

Functions

capture_attribute_list!(data, tag_id, field_parser_fun)

@spec capture_attribute_list!(
  String.t(),
  tag_id_t(),
  (String.t(), String.t() -> :skip | {atom(), any()})
) :: %{required(atom()) => any()}

capture_value!(data, tag_id, match_pattern, parser_fun)

@spec capture_value!(String.t(), tag_id_t(), String.t(), (String.t() -> any())) ::
  any()

class_from_id(atom)

@spec class_from_id(tag_id_t()) :: tag_class_t()

marshal(tag)

@spec marshal(t()) :: String.t()

marshal(tag, value)

@spec marshal(t(), any()) :: String.t()

marshal_id(id)

@spec marshal_id(tag_id_t()) :: String.t()

parse_attribute_list(data)

@spec parse_attribute_list(String.t()) :: %{required(String.t()) => String.t()}

Parses an attribute list string as specified in RFC 8216, section 4.2 Optimized version using binary pattern matching instead of codepoints