Skip to content

Commit abb5abe

Browse files
committed
release v0.3.0
1 parent 90797bf commit abb5abe

3 files changed

Lines changed: 11 additions & 10 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The package can be installed by adding `ex_rtmp` to your list of dependencies in
1212
```elixir
1313
def deps do
1414
[
15-
{:ex_rtmp, "~> 0.2.0"}
15+
{:ex_rtmp, "~> 0.3.0"}
1616
]
1717
end
1818
```

examples/save_to_flv.exs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Mix.install([:ex_rtmp, :ex_flv])
1+
Mix.install([:ex_rtmp])
22

33
defmodule Handler do
44
use ExRTMP.Server.Handler
@@ -13,27 +13,28 @@ defmodule Handler do
1313
end
1414

1515
@impl true
16-
def handle_publish(_stream_id, stream_key, state) do
16+
def handle_publish(stream_key, state) do
1717
file = File.open!("output_#{state.app}_#{stream_key}.flv", [:write, :binary, :raw])
1818
IO.binwrite(file, [ExFLV.Header.serialize(ExFLV.Header.new(1, true, true)), <<0::32>>])
1919
{:ok, %{state | file: file}}
2020
end
2121

2222
@impl true
23-
def handle_audio_data(_stream_id, timestamp, payload, state) do
24-
tag = %ExFLV.Tag{type: :audio, timestamp: timestamp, data: iodata}
23+
def handle_audio_data(timestamp, payload, state) do
24+
tag = %ExFLV.Tag{type: :audio, timestamp: timestamp, data: payload}
2525
write_tag(tag, state)
2626
end
2727

2828
@impl true
29-
def handle_video_data(_stream_id, timestamp, iodata, state) do
29+
def handle_video_data(timestamp, iodata, state) do
3030
tag = %ExFLV.Tag{type: :video, timestamp: timestamp, data: iodata}
3131
write_tag(tag, state)
3232
end
3333

3434
@impl true
35-
def handle_delete_stream(_stream_id, state) do
35+
def handle_delete_stream(state) do
3636
File.close(state.file)
37+
:close
3738
end
3839

3940
defp write_tag(tag, state) do
@@ -43,7 +44,7 @@ defmodule Handler do
4344
end
4445
end
4546

46-
{:ok, pid} = ExRTMP.Server.start_link(port: 1935, handler: Handler)
47+
{:ok, pid} = ExRTMP.Server.start_link(port: 1935, handler: Handler, demux: false)
4748
Process.monitor(pid)
4849

4950
receive do

mix.exs

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

4-
@version "0.2.0"
5-
@github_url "https://github.com/gBillal/ex_rtmp"
4+
@version "0.3.0"
5+
@github_url "https://github.com/elixir-streaming/ex_rtmp"
66

77
def project do
88
[

0 commit comments

Comments
 (0)