room

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package room provides utilities for working with LiveKit rooms.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client provides room management operations.

func NewClient

func NewClient(cfg Config) (*Client, error)

NewClient creates a new room client.

func (*Client) CreateRoom

func (c *Client) CreateRoom(ctx context.Context, name string) (*livekit.Room, error)

CreateRoom creates a new room.

func (*Client) DeleteRoom

func (c *Client) DeleteRoom(ctx context.Context, name string) error

DeleteRoom deletes a room.

func (*Client) GenerateAgentToken

func (c *Client) GenerateAgentToken(roomName, identity, name string) (string, error)

GenerateAgentToken creates a token for the AI agent to join a room.

func (*Client) GenerateClientToken

func (c *Client) GenerateClientToken(roomName, identity, name string) (string, error)

GenerateClientToken creates a token for a client to join a room.

func (*Client) GenerateToken

func (c *Client) GenerateToken(opts TokenOptions) (string, error)

GenerateToken creates a JWT token for joining a room.

func (*Client) ListParticipants

func (c *Client) ListParticipants(ctx context.Context, roomName string) ([]*livekit.ParticipantInfo, error)

ListParticipants lists participants in a room.

func (*Client) ListRooms

func (c *Client) ListRooms(ctx context.Context) ([]*livekit.Room, error)

ListRooms lists all rooms.

type Config

type Config struct {
	APIKey    string
	APISecret string
	URL       string
}

Config configures room creation and token generation.

type RecordingClient added in v0.5.0

type RecordingClient struct {
	// contains filtered or unexported fields
}

RecordingClient provides recording operations.

func NewRecordingClient added in v0.5.0

func NewRecordingClient(serverURL, apiKey, apiSecret string) *RecordingClient

NewRecordingClient creates a new recording client.

func (*RecordingClient) ListRecordings added in v0.5.0

func (c *RecordingClient) ListRecordings(ctx context.Context, roomName string) ([]*RecordingInfo, error)

ListRecordings lists active recordings for a room.

func (*RecordingClient) StartRecording added in v0.5.0

func (c *RecordingClient) StartRecording(ctx context.Context, cfg RecordingConfig) (*RecordingInfo, error)

StartRecording starts recording a room.

func (*RecordingClient) StopRecording added in v0.5.0

func (c *RecordingClient) StopRecording(ctx context.Context, egressID string) error

StopRecording stops an active recording.

type RecordingConfig added in v0.5.0

type RecordingConfig struct {
	// RoomName is the room to record.
	RoomName string

	// Layout determines participant arrangement.
	Layout RecordingLayout

	// Format is the output file format.
	Format RecordingFormat

	// FilePath is the local file path for the recording.
	// Use this for local file output.
	FilePath string

	// S3 configures S3 upload (optional).
	S3 *S3Config

	// Width is the video width (default: 1920).
	Width int

	// Height is the video height (default: 1080).
	Height int

	// AudioOnly records audio only (no video).
	AudioOnly bool
}

RecordingConfig configures room recording.

type RecordingFormat added in v0.5.0

type RecordingFormat string

RecordingFormat specifies the output file format.

const (
	FormatMP4 RecordingFormat = "mp4"
	FormatOGG RecordingFormat = "ogg"
)

type RecordingInfo added in v0.5.0

type RecordingInfo struct {
	// EgressID is the unique identifier for this recording.
	EgressID string

	// RoomName is the room being recorded.
	RoomName string

	// Status is the current recording status.
	Status string

	// StartedAt is when the recording started (Unix timestamp).
	StartedAt int64
}

RecordingInfo contains information about an active recording.

type RecordingLayout added in v0.5.0

type RecordingLayout string

RecordingLayout specifies how participants are arranged in the recording.

const (
	// LayoutGrid shows all participants in a grid.
	LayoutGrid RecordingLayout = "grid"
	// LayoutSpeaker focuses on the active speaker.
	LayoutSpeaker RecordingLayout = "speaker"
	// LayoutSingleSpeaker shows only the active speaker.
	LayoutSingleSpeaker RecordingLayout = "single-speaker"
)

type S3Config added in v0.5.0

type S3Config struct {
	AccessKey string
	Secret    string
	Region    string
	Bucket    string
	Endpoint  string // Optional, for S3-compatible services
}

S3Config configures S3 upload for recordings.

type TokenOptions

type TokenOptions struct {
	Identity   string
	Name       string
	RoomName   string
	CanPublish bool
	TTL        time.Duration
	Metadata   string
}

TokenOptions configures token generation.

Jump to

Keyboard shortcuts

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