Documentation
¶
Overview ¶
Package room provides utilities for working with LiveKit rooms.
Index ¶
- type Client
- func (c *Client) CreateRoom(ctx context.Context, name string) (*livekit.Room, error)
- func (c *Client) DeleteRoom(ctx context.Context, name string) error
- func (c *Client) GenerateAgentToken(roomName, identity, name string) (string, error)
- func (c *Client) GenerateClientToken(roomName, identity, name string) (string, error)
- func (c *Client) GenerateToken(opts TokenOptions) (string, error)
- func (c *Client) ListParticipants(ctx context.Context, roomName string) ([]*livekit.ParticipantInfo, error)
- func (c *Client) ListRooms(ctx context.Context) ([]*livekit.Room, error)
- type Config
- type RecordingClient
- type RecordingConfig
- type RecordingFormat
- type RecordingInfo
- type RecordingLayout
- type S3Config
- type TokenOptions
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 (*Client) CreateRoom ¶
CreateRoom creates a new room.
func (*Client) DeleteRoom ¶
DeleteRoom deletes a room.
func (*Client) GenerateAgentToken ¶
GenerateAgentToken creates a token for the AI agent to join a room.
func (*Client) GenerateClientToken ¶
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.
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" )