gen_rtmp_server v0.1.1 GenRtmpServer behaviour
A behaviour module for implementing an RTMP server.
A GenRtmpServer abstracts out the the handling of RTMP connection handling and data so that modules that implement this behaviour can focus on the business logic of the actual RTMP events that are received and should be sent.
Each client that connects is placed in it’s own process.
Summary
Functions
Signals a specific RTMP server process to send an RTMP message to its client
Starts the generic RTMP server using the provided RTMP options
Callbacks
Called when audio or video data has been received on a published stream
Called when an code change is ocurring
Called when the client is requesting a connection to the specified application name
Called when any BEAM message is received that is not handleable by the generic RTMP server, and is thus being passed along to the module adopting this behaviour
Called when a new RTMP client connects
Called when a client publishing a stream has changed the metadata information for that stream
Called when the client no longer wants to play the stream from the specified application name and stream key combination
Called when the client is wanting to play a stream from the specified application name and stream key combination
Called when the client is no longer publishing to the specified application name and stream key
Called when a client wants to publish a stream to the specified application name and stream key combination
Types
Functions
send_message(pid, outbound_data, stream_id, forced_timestamp) :: :ok
Signals a specific RTMP server process to send an RTMP message to its client
start_link(module, %GenRtmpServer.RtmpOptions{chunk_size: term, fms_version: term, log_mode: term, port: term}) :: Supervisor.on_start
Starts the generic RTMP server using the provided RTMP options
Callbacks
audio_video_data_received(Rtmp.ServerSession.Events.AudioVideoDataReceived.t, adopter_state) :: {:ok, adopter_state}
Called when audio or video data has been received on a published stream
code_change(any, adopter_state) :: {:ok, adopter_state} | {:error, String.t}
Called when an code change is ocurring
connection_requested(Rtmp.ServerSession.Events.ConnectionRequested.t, adopter_state) :: {request_result, adopter_state}
Called when the client is requesting a connection to the specified application name
Called when any BEAM message is received that is not handleable by the generic RTMP server, and is thus being passed along to the module adopting this behaviour.
Called when a new RTMP client connects
metadata_received(Rtmp.ServerSession.Events.StreamMetaDataChanged.t, adopter_state) :: {:ok, adopter_state}
Called when a client publishing a stream has changed the metadata information for that stream.
play_finished(Rtmp.ServerSession.Events.PlayStreamFinished.t, adopter_state) :: {:ok, adopter_state}
Called when the client no longer wants to play the stream from the specified application name and stream key combination
play_requested(Rtmp.ServerSession.Events.PlayStreamRequested.t, adopter_state) :: {request_result, adopter_state}
Called when the client is wanting to play a stream from the specified application name and stream key combination
publish_finished(Rtmp.ServerSession.Events.PublishingFinished.t, adopter_state) :: {:ok, adopter_state}
Called when the client is no longer publishing to the specified application name and stream key
publish_requested(Rtmp.ServerSession.Events.PublishStreamRequested.t, adopter_state) :: {request_result, adopter_state}
Called when a client wants to publish a stream to the specified application name and stream key combination