View Source HLS (HLS v0.0.8)

HLS is a simple and fast library for parsing and building HLS manifests.

examples

Examples

master_playlist = """
#EXTM3U
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=240000,RESOLUTION=396x224
media.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=40000
media1.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=440000,RESOLUTION=396x224
media2.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1928000,RESOLUTION=960x540
media3.m3u8
"""

HLS.parse(master_playlist)
#=> %HLS.Manifest{type: :master, variants: [%HLS.Variant{}], ...}

The result of HLS.parse/1 will be an HLS.Manifest struct. This struct will contain all the data from the .m3u8 files, parsed into elixir data types.

installation

Installation

Add hls to your list of dependencies in mix.exs.

def deps do
  [
    {:hls, "~> 0.0.7"}
  ]
end

Link to this section Summary

Functions

Parses an HLS manifest (.m3u8) with the provided URL.

Turns a Manifest struct into its m3u8 text representation.

Link to this section Functions

Parses an HLS manifest (.m3u8) with the provided URL.

This can be the Master Playlist or a Media Playlist.

Turns a Manifest struct into its m3u8 text representation.