events

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2025 License: LGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StartRecordingKey            = "startRecording"
	StartRecordingResponseKey    = "startRecordingResponse"
	RecordingRtpStatusChangedKey = "recordingRtpStatusChanged"
	StopRecordingKey             = "stopRecording"
	RecordingStoppedKey          = "recordingStopped"
	RecorderStatusKey            = "recorderStatus"
	GetRecorderStatusKey         = "getRecorderStatus"
)
View Source
const (
	StopReasonAppShutdown = "application_shutdown"
	StopReasonNormal      = "stopped"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AdapterOptions

type AdapterOptions struct {
	Mediasoup *MediasoupConfig `json:"mediasoup,omitempty"`
	LiveKit   *LiveKitConfig   `json:"livekit,omitempty"`
}

type AdapterType

type AdapterType string
const (
	AdapterMediasoup AdapterType = "mediasoup"
	AdapterLiveKit   AdapterType = "livekit"
)

type Event

type Event struct {
	Id   string
	Data interface{}
}

func Decode

func Decode(message []byte) *Event

func (*Event) GetRecorderStatus

func (e *Event) GetRecorderStatus() *GetRecorderStatus

func (*Event) IsValid

func (e *Event) IsValid() bool

func (*Event) StartRecording

func (e *Event) StartRecording() *StartRecording

func (*Event) StartRecordingResponse

func (e *Event) StartRecordingResponse() *StartRecordingResponse

func (*Event) StopRecording

func (e *Event) StopRecording() *StopRecording

type GetRecorderStatus

type GetRecorderStatus struct {
	Id string `json:"id,omitempty"`
}

func (*GetRecorderStatus) Status

func (e *GetRecorderStatus) Status(appVersion string, instanceId string) *RecorderStatus

type LiveKitConfig

type LiveKitConfig struct {
	Room     string   `json:"room,omitempty"`
	TrackIDs []string `json:"trackIds,omitempty"`
}

type MediasoupConfig

type MediasoupConfig struct {
	SDP string `json:"sdp,omitempty"`
}

type RecorderStatus

type RecorderStatus struct {
	Id         string `json:"id,omitempty"`
	AppVersion string `json:"appVersion,omitempty"`
	InstanceId string `json:"instanceId,omitempty"`
	Timestamp  int64  `json:"timestamp,omitempty"`
}

func NewRecorderStatus

func NewRecorderStatus(appVersion string, instanceId string) *RecorderStatus

type RecordingRtpStatusChanged

type RecordingRtpStatusChanged struct {
	Id           string        `json:"id,omitempty"`
	SessionId    string        `json:"recordingSessionId,omitempty"`
	Status       string        `json:"status,omitempty"`
	TimestampUTC time.Time     `json:"timestampUTC"`
	TimestampHR  time.Duration `json:"timestampHR"`
}

func NewRecordingRtpStatusChanged

func NewRecordingRtpStatusChanged(id string, status bool, ts time.Duration) *RecordingRtpStatusChanged

type RecordingStopped

type RecordingStopped struct {
	Id           string        `json:"id,omitempty"`
	SessionId    string        `json:"recordingSessionId,omitempty"`
	Reason       string        `json:"reason,omitempty"`
	TimestampUTC time.Time     `json:"timestampUTC,omitempty"`
	TimestampHR  time.Duration `json:"timestampHR,omitempty"`
}

func NewRecordingStopped

func NewRecordingStopped(id, reason string, ts time.Duration) *RecordingStopped

type StartRecording

type StartRecording struct {
	Id             string          `json:"id,omitempty"`
	SessionId      string          `json:"recordingSessionId,omitempty"`
	FileName       string          `json:"fileName,omitempty"`
	Adapter        AdapterType     `json:"adapter,omitempty"` // "mediasoup" or "livekit"
	AdapterOptions *AdapterOptions `json:"adapterOptions,omitempty"`
	// Legacy field for backward compatibility - check AdapterOptions#Mediasoup#SDP
	// for the new format
	SDP string `json:"sdp,omitempty"`
}

startRecording (SFU -> Recorder) ```JSON5

{
	id: 'startRecording',
	recordingSessionId: <String> // requester-defined - error out if collision.
	sdp?: <String>, // offer
	fileName: <String>, // file name INCLUDING format (.webm)
	adapter: <String>, // "mediasoup" or "livekit"
	adapterOptions: <Object>, // adapter-specific configuration
}

```

func (*StartRecording) Fail

func (*StartRecording) GetSDP

func (e *StartRecording) GetSDP() string

func (*StartRecording) Success

func (e *StartRecording) Success(sdp, fileName string) *StartRecordingResponse

func (*StartRecording) Validate

func (e *StartRecording) Validate() error

type StartRecordingResponse

type StartRecordingResponse struct {
	Id        string  `json:"id,omitempty"`
	SessionId string  `json:"recordingSessionId,omitempty"`
	Status    string  `json:"status,omitempty"`
	Error     *string `json:"error,omitempty"`
	SDP       *string `json:"sdp,omitempty"`
	FileName  *string `json:"fileName,omitempty"`
	Adapter   *string `json:"adapter,omitempty"`
}

func (*StartRecordingResponse) Validate

func (e *StartRecordingResponse) Validate() error

type StopRecording

type StopRecording struct {
	Id        string `json:"id,omitempty"`
	SessionId string `json:"recordingSessionId,omitempty"`
}

func (*StopRecording) Stopped

func (e *StopRecording) Stopped(reason string, ts time.Duration) *RecordingStopped

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL