Skip to content

Commit e0e2373

Browse files
authored
Release v0.0.1 (#7)
1 parent 703b405 commit e0e2373

File tree

3 files changed

+40
-7
lines changed

3 files changed

+40
-7
lines changed

README.md

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![API Docs](https://img.shields.io/badge/api-docs-yellow.svg?style=flat)](https://hexdocs.pm/ex_hls)
55
[![CircleCI](https://circleci.com/gh/membraneframework/ex_hls.svg?style=svg)](https://circleci.com/gh/membraneframework/ex_hls)
66

7-
This repository contains ExHLS - an Elixir package for handling HLS streams
7+
This repository contains ExHLS - an Elixir package for handling HLS streams.
88

99
It's a part of the [Membrane Framework](https://membrane.stream).
1010

@@ -15,14 +15,47 @@ The package can be installed by adding `ex_hls` to your list of dependencies in
1515
```elixir
1616
def deps do
1717
[
18-
{:ex_hls, "~> 0.1.0"}
18+
{:ex_hls, "~> 0.0.1"}
1919
]
2020
end
2121
```
2222

2323
## Usage
2424

25-
TODO
25+
To read HLS stream from the `.m3u8 playlist`, start the client with:
26+
```elixir
27+
client = ExHLS.Client.new(<URI of the .m3u8 playlist>)
28+
```
29+
30+
Then you can inspect the variants available in your playlist:
31+
```elixir
32+
ExHLS.Client.get_variants(client)
33+
# Returns:
34+
# %{
35+
# 0 => %{
36+
# id: 0,
37+
# name: "720",
38+
# uri: "url_0/193039199_mp4_h264_aac_hd_7.m3u8",
39+
# codecs: "mp4a.40.2,avc1.64001f",
40+
# bandwidth: 2149280,
41+
# resolution: {1280, 720},
42+
# frame_rate: nil
43+
# },
44+
# ...
45+
# }
46+
```
47+
48+
If there are multiple variants available, you need to choose one of them with:
49+
```elixir
50+
ExHLS.Client.choose_variant(<id>)
51+
```
52+
where `<id>` is the `id` field of the entry returned by `ExHLS.Client.get_variants/1`.
53+
54+
Now you can start reading media with the following functions:
55+
```elixir
56+
{video_chunk, client} = ExHLS.Client.read_video_chunk(client)
57+
{audio_chunk, client} = ExHLS.Client.read_audio_chunk(client)
58+
```
2659

2760
## Copyright and License
2861

mix.exs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
defmodule ExHLS.Mixfile do
22
use Mix.Project
33

4-
@version "0.1.0"
5-
@github_url "https://github.com/membraneframework-labs/ex_hls"
4+
@version "0.0.1"
5+
@github_url "https://github.com/membraneframework/ex_hls"
66

77
def project do
88
[
@@ -42,7 +42,7 @@ defmodule ExHLS.Mixfile do
4242
{:qex, "~> 0.5.1"},
4343
{:membrane_mp4_plugin, "~> 0.36.0"},
4444
{:membrane_h26x_plugin, "~> 0.10.2"},
45-
{:mpeg_ts, github: "kim-company/kim_mpeg_ts"},
45+
{:mpeg_ts, "~> 2.0.0"},
4646
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false},
4747
{:dialyxir, ">= 0.0.0", only: :dev, runtime: false},
4848
{:credo, ">= 0.0.0", only: :dev, runtime: false}

mix.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"membrane_timestamp_queue": {:hex, :membrane_timestamp_queue, "0.2.2", "1c831b2273d018a6548654aa9f7fa7c4b683f71d96ffe164934ef55f9d11f693", [:mix], [{:heap, "~> 2.0", [hex: :heap, repo: "hexpm", optional: false]}, {:membrane_core, "~> 1.0", [hex: :membrane_core, repo: "hexpm", optional: false]}], "hexpm", "7c830e760baaced0988421671cd2c83c7cda8d1bd2b61fd05332711675d1204f"},
3232
"mime": {:hex, :mime, "2.0.7", "b8d739037be7cd402aee1ba0306edfdef982687ee7e9859bee6198c1e7e2f128", [:mix], [], "hexpm", "6171188e399ee16023ffc5b76ce445eb6d9672e2e241d2df6050f3c771e80ccd"},
3333
"mint": {:hex, :mint, "1.7.1", "113fdb2b2f3b59e47c7955971854641c61f378549d73e829e1768de90fc1abf1", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:hpax, "~> 0.1.1 or ~> 0.2.0 or ~> 1.0", [hex: :hpax, repo: "hexpm", optional: false]}], "hexpm", "fceba0a4d0f24301ddee3024ae116df1c3f4bb7a563a731f45fdfeb9d39a231b"},
34-
"mpeg_ts": {:git, "https://github.com/kim-company/kim_mpeg_ts.git", "ebde017bf639a9d57d068f029f2e43562ae78746", []},
34+
"mpeg_ts": {:hex, :mpeg_ts, "2.0.2", "87f7d3b38c962fc367edbb4b1419f5f314be41a0d512b95437f11c4f60c931f4", [:mix], [], "hexpm", "5b7f1245a945de647c29abc9453e3d9d7eca1b0001d3d582f4feb11fc09b2792"},
3535
"nimble_options": {:hex, :nimble_options, "1.1.1", "e3a492d54d85fc3fd7c5baf411d9d2852922f66e69476317787a7b2bb000a61b", [:mix], [], "hexpm", "821b2470ca9442c4b6984882fe9bb0389371b8ddec4d45a9504f00a66f650b44"},
3636
"nimble_parsec": {:hex, :nimble_parsec, "1.4.2", "8efba0122db06df95bfaa78f791344a89352ba04baedd3849593bfce4d0dc1c6", [:mix], [], "hexpm", "4b21398942dda052b403bbe1da991ccd03a053668d147d53fb8c4e0efe09c973"},
3737
"nimble_pool": {:hex, :nimble_pool, "1.1.0", "bf9c29fbdcba3564a8b800d1eeb5a3c58f36e1e11d7b7fb2e084a643f645f06b", [:mix], [], "hexpm", "af2e4e6b34197db81f7aad230c1118eac993acc0dae6bc83bac0126d4ae0813a"},

0 commit comments

Comments
 (0)