diff --git a/docs/changelog.md b/docs/changelog.md index 93cb93d..db58b15 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -9,6 +9,7 @@ - Added `m1k1o/neko:microsoft-edge` tag. - Fixed clipboard sync in chromium based browsers. - Added support for implicit control (using `NEKO_IMPLICITCONTROL=1`). That means, users do not need to request control prior usage. +- Automatically start broadcasting using `NEKO_BROADCAST_URL=rtmp://your-rtmp-endpoint/live` (thanks @konsti). ### Misc - Automatic WebRTC SDP negotiation using onnegotiationneeded handlers. This allows adding/removing track on demand in a session. diff --git a/docs/getting-started/configuration.md b/docs/getting-started/configuration.md index 270648c..33fbc32 100644 --- a/docs/getting-started/configuration.md +++ b/docs/getting-started/configuration.md @@ -71,6 +71,8 @@ NEKO_LOCKS: NEKO_CONTROL_PROTECTION: - Control protection means, users can gain control only if at least one admin is in the room. - e.g. false +NEKO_BROADCAST_URL: + - Set a default URL for broadcast streams. Setting this value will automatically enable broadcasting when n.eko starts. It can be disabled/changed later in GUI. ``` ## Agruments @@ -86,7 +88,9 @@ Flags: --audio_bitrate int audio bitrate in kbit/s (default 128) --bind string address/port/socket to serve neko (default "127.0.0.1:8080") --broadcast_pipeline string custom gst pipeline used for broadcasting, strings {url} {device} {display} will be replaced + --broadcast_url string URL for broadcasting, setting this value will automatically enable broadcasting --cert string path to the SSL cert used to secure the neko server + --control_protection control protection means, users can gain control only if at least one admin is in the room --device string audio device to capture (default "auto_null.monitor") --display string XDisplay to capture (default ":99.0") --epr string limits the pool of ephemeral ports that ICE UDP connections can allocate from (default "59000-59100") @@ -96,8 +100,10 @@ Flags: --icelite configures whether or not the ice agent should be a lite agent --iceserver strings describes a single STUN and TURN server that can be used by the ICEAgent to establish a connection with a peer (default [stun:stun.l.google.com:19302]) --iceservers string describes a single STUN and TURN server that can be used by the ICEAgent to establish a connection with a peer + --implicit_control if enabled members can gain control implicitly --ipfetch string automatically fetch IP address from given URL when nat1to1 is not present (default "http://checkip.amazonaws.com") --key string path to the SSL key used to secure the neko server + --locks strings resources, that will be locked when starting (control, login) --max_fps int maximum fps delivered via WebRTC, 0 is for no maximum (default 25) --nat1to1 strings sets a list of external IP addresses of 1:1 (D)NAT and a candidate type for which the external IP address is used --opus use Opus audio codec @@ -108,6 +114,8 @@ Flags: --proxy enable reverse proxy mode --screen string default screen resolution and framerate (default "1280x720@30") --static string path to neko client files to serve (default "./www") + --tcpmux int single TCP mux port for all peers + --udpmux int single UDP mux port for all peers --video string video codec parameters to use for streaming --video_bitrate int video bitrate in kbit/s (default 3072) --vp8 use VP8 video codec diff --git a/server/internal/broadcast/manager.go b/server/internal/broadcast/manager.go index 98b5ab1..aff55ec 100644 --- a/server/internal/broadcast/manager.go +++ b/server/internal/broadcast/manager.go @@ -25,8 +25,8 @@ func New(remote *config.Remote, config *config.Broadcast) *BroadcastManager { logger: log.With().Str("module", "remote").Logger(), remote: remote, config: config, - enabled: false, - url: "", + enabled: config.Enabled, + url: config.URL, } } diff --git a/server/internal/types/config/broadcast.go b/server/internal/types/config/broadcast.go index 53cef49..df29c8b 100644 --- a/server/internal/types/config/broadcast.go +++ b/server/internal/types/config/broadcast.go @@ -7,6 +7,8 @@ import ( type Broadcast struct { Pipeline string + URL string + Enabled bool } func (Broadcast) Init(cmd *cobra.Command) error { @@ -15,9 +17,16 @@ func (Broadcast) Init(cmd *cobra.Command) error { return err } + cmd.PersistentFlags().String("broadcast_url", "", "URL for broadcasting, setting this value will automatically enable broadcasting") + if err := viper.BindPFlag("broadcast_url", cmd.PersistentFlags().Lookup("broadcast_url")); err != nil { + return err + } + return nil } func (s *Broadcast) Set() { s.Pipeline = viper.GetString("broadcast_pipeline") + s.URL = viper.GetString("broadcast_url") + s.Enabled = s.URL != "" }