View Source HLS.Playlist.Tag behaviour (HTTP Live Streaming (HLS) library v2.0.0)

Summary

Types

@type attribute_list_t() :: %{required(atom()) => any()}
@type behaviour_t() :: module()
@type group_id_t() :: String.t()
@type t() :: %HLS.Playlist.Tag{
  attributes: attribute_list_t(),
  class: tag_class_t(),
  id: tag_id_t(),
  sequence: pos_integer(),
  value: any()
}
@type tag_class_t() ::
  :media_segment
  | :media_playlist
  | :master_playlist
  | :playlist
  | :master_or_media_playlist
@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

@callback has_uri?() :: boolean()
@callback id() :: tag_id_t()
@callback init(attribute_list_t() | any(), pos_integer()) :: t()
@callback is_multiline?() :: boolean()
@callback match?(String.t()) :: boolean()
@callback unmarshal(String.t() | [String.t()]) :: attribute_list_t() | any()

Functions

Link to this function

capture_attribute_list!(data, tag_id, field_parser_fun)

View Source
@spec capture_attribute_list!(
  String.t(),
  tag_id_t(),
  (String.t(), String.t() -> :skip | {atom(), any()})
) :: %{required(atom()) => any()}
Link to this function

capture_value!(data, tag_id, match_pattern, parser_fun)

View Source
@spec capture_value!(String.t(), tag_id_t(), String.t(), (String.t() -> any())) ::
  any()
@spec class_from_id(tag_id_t()) :: tag_class_t()
@spec marshal(t()) :: String.t()
@spec marshal(t(), any()) :: String.t()
@spec marshal_id(tag_id_t()) :: String.t()
Link to this function

parse_attribute_list(data)

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

Parses an attribute list string as specified in RFC 8216, section 4.2