Documentation
¶
Overview ¶
package mediaserver is responsible for managing the media server, which is currently an instance of MediaMTX.
Index ¶
Constants ¶
const DefaultImageNameMediaMTX = "ghcr.io/rfwatson/mediamtx-alpine:latest"
DefaultImageNameMediaMTX is the default Docker image name for the MediaMTX server.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Actor ¶
type Actor struct {
// contains filtered or unexported fields
}
Actor is responsible for managing the media server.
func NewActor ¶ added in v0.0.4
func NewActor(ctx context.Context, params NewActorParams) (_ *Actor, err error)
NewActor creates a new media server actor.
Callers must consume the state channel exposed via [C].
func (*Actor) RTMPInternalURL ¶ added in v0.0.4
RTMPInternalURL returns the RTMP URL for the media server, accessible from the app network.
func (*Actor) RTMPSURL ¶ added in v0.0.8
RTMPSURL returns the RTMPS URL for the media server, accessible from the host.
type Config ¶
type Config struct { LogLevel string `yaml:"logLevel,omitempty"` LogDestinations []string `yaml:"logDestinations,omitempty"` ReadTimeout string `yaml:"readTimeout,omitempty"` WriteTimeout string `yaml:"writeTimeout,omitempty"` WriteQueueSize int `yaml:"writeQueueSize,omitempty"` UDPMaxPayloadSize int `yaml:"udpMaxPayloadSize,omitempty"` AuthMethod string `yaml:"authMethod,omitempty"` AuthInternalUsers []User `yaml:"authInternalUsers,omitempty"` Metrics bool `yaml:"metrics,omitempty"` MetricsAddress string `yaml:"metricsAddress,omitempty"` API bool `yaml:"api,omitempty"` APIAddress string `yaml:"apiAddress,omitempty"` APIEncryption bool `yaml:"apiEncryption,omitempty"` APIServerCert string `yaml:"apiServerCert,omitempty"` APIServerKey string `yaml:"apiServerKey,omitempty"` RTMP bool `yaml:"rtmp"` RTMPEncryption string `yaml:"rtmpEncryption,omitempty"` RTMPAddress string `yaml:"rtmpAddress,omitempty"` RTMPSAddress string `yaml:"rtmpsAddress,omitempty"` RTMPServerCert string `yaml:"rtmpServerCert,omitempty"` RTMPServerKey string `yaml:"rtmpServerKey,omitempty"` HLS bool `yaml:"hls"` RTSP bool `yaml:"rtsp"` WebRTC bool `yaml:"webrtc"` SRT bool `yaml:"srt"` Paths map[string]Path `yaml:"paths,omitempty"` }
Config represents the MediaMTX configuration file.
type NewActorParams ¶ added in v0.0.5
type NewActorParams struct { RTMPAddr OptionalNetAddr // defaults to disabled, or 127.0.0.1:1935 RTMPSAddr OptionalNetAddr // defaults to disabled, or 127.0.0.1:1936 APIPort int // defaults to 9997 Host string // defaults to "localhost" StreamKey StreamKey // defaults to "live" ImageName string // defaults to "ghcr.io/rfwatson/mediamtx-alpine:latest" ChanSize int // defaults to 64 UpdateStateInterval time.Duration // defaults to 5 seconds KeyPairs domain.KeyPairs ContainerClient *container.Client InDocker bool Logger *slog.Logger }
NewActorParams contains the parameters for building a new media server actor.
type OptionalNetAddr ¶ added in v0.0.8
OptionalNetAddr is a wrapper around domain.NetAddr that indicates whether it is enabled or not.
type Path ¶
type Path struct {
Source string `yaml:"source,omitempty"`
}
Path represents a path configuration in MediaMTX.
type StreamKey ¶
type StreamKey string
StreamKey is the stream key for the media server, which forms the RTMP path component and can be used as a basic form of authentication.
It defaults to "live", in which case the full RTMP URL would be: `rtmp://localhost:1935/live`.
type User ¶
type User struct { User string `yaml:"user,omitempty"` Pass string `yaml:"pass,omitempty"` IPs []string `yaml:"ips,omitempty"` Permissions []UserPermission `yaml:"permissions,omitempty"` }
User represents a user configuration in MediaMTX.
type UserPermission ¶
type UserPermission struct {
Action string `yaml:"action,omitempty"`
}
UserPermission represents a user permission in MediaMTX.