Snapcast.Server (Snapcast v0.1.1)

Copy Markdown View Source

The snapcast server: a TCP listener that accepts snapclients, plus the playback coordinator. Each connection becomes a Snapcast.Session (self-registers on Hello). play/3 (re)starts a Snapcast.Stream feeding the targeted clients, and the transport ops (pause/resume/seek/stop/volume) map onto it.

One active stream at a time. Client connect/disconnect and playback progress/ended are reported to the configured Snapcast.Listener, so a host app can drive a UI position, advance tracks, and refresh endpoint lists.

Summary

Functions

Returns a specification to start this module under a supervisor.

Play a source to the given client ids, from position_ms. opts: :endpoint, :duration_ms, :transport_codec.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

clients()

pause()

play(source, client_ids, opts \\ [])

Play a source to the given client ids, from position_ms. opts: :endpoint, :duration_ms, :transport_codec.

resume()

seek(position_ms, playback_gen \\ nil)

set_volume(client_id, volume)

start_link(opts)

stop_playback()