Skip to content

Commit

Permalink
Add client_timeout option in source_bin
Browse files Browse the repository at this point in the history
  • Loading branch information
varsill committed Feb 14, 2025
1 parent b645caf commit e7e5ba4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/membrane_rtmp_plugin/rtmp/source/source_bin.ex
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,23 @@ defmodule Membrane.RTMP.SourceBin do
An URL on which the client is expected to connect, for example:
rtmp://127.0.0.1:1935/app/stream_key
"""
],
client_timeout: [
default: Membrane.Time.seconds(5),
spec: Membrane.Time.t(),
description: """
Time after which an unused client connection is automatically closed. Defaults to 5 seconds.
"""
]


@impl true
def handle_init(_ctx, %__MODULE__{} = opts) do
spec =
child(:src, %RTMP.Source{
client_ref: opts.client_ref,
url: opts.url
url: opts.url,
client_timeout: opts.client_timeout
})
|> child(:demuxer, Membrane.FLV.Demuxer)

Expand Down

0 comments on commit e7e5ba4

Please sign in to comment.