omnimeet

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package omnimeet provides a LiveKit implementation of the OmniMeet provider interface.

Package omnimeet provides a LiveKit implementation of the OmniMeet provider interface.

Package omnimeet provides a LiveKit implementation of the OmniMeet provider interface.

This package implements both MeetingProvider (control plane) and AgentParticipant (media plane) interfaces for LiveKit.

Usage

Import this package to register the LiveKit provider:

import (
    "github.com/plexusone/omnimeet-core"
    _ "github.com/plexusone/omni-livekit/omnimeet"
)

func main() {
    provider, _ := omnimeet.GetMeetingProvider("livekit",
        omnimeet.WithAPIKey("your-api-key"),
        omnimeet.WithAPISecret("your-api-secret"),
        omnimeet.WithServerURL("wss://your-server.livekit.cloud"),
    )

    // Create a meeting
    meeting, _ := provider.CreateMeeting(ctx, omnimeet.CreateMeetingRequest{
        Name: "My Meeting",
    })

    // Generate join token
    token, _ := provider.CreateJoinToken(ctx, omnimeet.CreateJoinTokenRequest{
        MeetingID: meeting.ID,
        Participant: omnimeet.ParticipantInfo{
            Name: "AI Assistant",
            Kind: omnimeet.ParticipantKindAgent,
        },
    })
}

Agent Participation

For AI agents that need to join meetings and process audio:

factory := provider.(omnimeet.AgentParticipantFactory)
agent, _ := factory.CreateAgentParticipant(omnimeet.AgentParticipantOptions{
    AutoSubscribe: true,
})

agent.JoinMeeting(ctx, meeting.ID, token)
defer agent.LeaveMeeting(ctx)

audioCh, _ := agent.SubscribeToAllAudio(ctx)
for frame := range audioCh {
    // Process audio
}

Configuration

The provider can be configured with the following options:

  • api_key: LiveKit API key
  • api_secret: LiveKit API secret
  • server_url: LiveKit server URL (e.g., "wss://your-server.livekit.cloud")
  • webhook_secret: Secret for validating webhooks

Package omnimeet provides a LiveKit implementation of the OmniMeet provider interface.

Package omnimeet provides a LiveKit implementation of the OmniMeet provider interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProviderFromConfig

func NewProviderFromConfig(config map[string]any) (provider.MeetingProvider, error)

NewProviderFromConfig creates a provider from a generic config map.

Types

type AgentParticipant

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

AgentParticipant implements the OmniMeet AgentParticipant interface for LiveKit.

func NewAgentParticipant

func NewAgentParticipant(cfg Config, opts provider.AgentParticipantOptions) (*AgentParticipant, error)

NewAgentParticipant creates a new AgentParticipant.

func (*AgentParticipant) ConnectionState

func (a *AgentParticipant) ConnectionState() provider.ConnectionState

ConnectionState returns the current connection state.

func (*AgentParticipant) Events

func (a *AgentParticipant) Events() <-chan event.Event

Events returns a channel of real-time events.

func (*AgentParticipant) GetParticipant

func (a *AgentParticipant) GetParticipant(participantID string) *participant.Participant

GetParticipant returns a specific participant by ID.

func (*AgentParticipant) JoinMeeting

func (a *AgentParticipant) JoinMeeting(ctx context.Context, meetingID string, tok *token.JoinToken) error

JoinMeeting joins the meeting as an agent participant.

func (*AgentParticipant) LeaveMeeting

func (a *AgentParticipant) LeaveMeeting(ctx context.Context) error

LeaveMeeting leaves the current meeting.

func (*AgentParticipant) LocalParticipant

func (a *AgentParticipant) LocalParticipant() *participant.Participant

LocalParticipant returns the local (agent) participant.

func (*AgentParticipant) Meeting

func (a *AgentParticipant) Meeting() *meeting.Meeting

Meeting returns the current meeting.

func (*AgentParticipant) OnActiveSpeakerChanged

func (a *AgentParticipant) OnActiveSpeakerChanged(handler func([]participant.Participant))

OnActiveSpeakerChanged registers a handler for active speaker changes.

func (*AgentParticipant) OnDataMessage

func (a *AgentParticipant) OnDataMessage(handler func(provider.DataMessage))

OnDataMessage registers a handler for incoming data messages.

func (*AgentParticipant) OnParticipantJoined

func (a *AgentParticipant) OnParticipantJoined(handler func(participant.Participant))

OnParticipantJoined registers a handler for participant join events.

func (*AgentParticipant) OnParticipantLeft

func (a *AgentParticipant) OnParticipantLeft(handler func(participant.Participant))

OnParticipantLeft registers a handler for participant leave events.

func (*AgentParticipant) OnTrackPublished

func (a *AgentParticipant) OnTrackPublished(handler func(participant.Participant, track.Track))

OnTrackPublished registers a handler for track publish events.

func (*AgentParticipant) OnTrackUnpublished

func (a *AgentParticipant) OnTrackUnpublished(handler func(participant.Participant, track.Track))

OnTrackUnpublished registers a handler for track unpublish events.

func (*AgentParticipant) PublishAudio

func (a *AgentParticipant) PublishAudio(ctx context.Context, frame provider.AudioFrame) error

PublishAudio publishes an audio frame to the meeting.

func (*AgentParticipant) RemoteParticipants

func (a *AgentParticipant) RemoteParticipants() []participant.Participant

RemoteParticipants returns all remote participants.

func (*AgentParticipant) SendDataMessage

func (a *AgentParticipant) SendDataMessage(ctx context.Context, msg provider.DataMessage) error

SendDataMessage sends a data message.

func (*AgentParticipant) StartAudioTrack

StartAudioTrack starts publishing audio and returns a writer.

func (*AgentParticipant) StopAudioTrack

func (a *AgentParticipant) StopAudioTrack(ctx context.Context) error

StopAudioTrack stops publishing audio.

func (*AgentParticipant) SubscribeToAllAudio

func (a *AgentParticipant) SubscribeToAllAudio(ctx context.Context) (<-chan provider.AudioFrame, error)

SubscribeToAllAudio subscribes to all participants' audio.

func (*AgentParticipant) SubscribeToAudio

func (a *AgentParticipant) SubscribeToAudio(ctx context.Context, participantID string) (<-chan provider.AudioFrame, error)

SubscribeToAudio subscribes to a specific participant's audio.

func (*AgentParticipant) SubscribeToTrack

func (a *AgentParticipant) SubscribeToTrack(ctx context.Context, trackID string, opts track.SubscribeOptions) error

SubscribeToTrack subscribes to a specific track.

func (*AgentParticipant) UnsubscribeFromTrack

func (a *AgentParticipant) UnsubscribeFromTrack(ctx context.Context, trackID string) error

UnsubscribeFromTrack unsubscribes from a track.

type Config

type Config struct {
	// APIKey is the LiveKit API key.
	APIKey string
	// APISecret is the LiveKit API secret.
	APISecret string
	// ServerURL is the LiveKit server URL (e.g., "wss://your-server.livekit.cloud").
	ServerURL string
	// WebhookSecret is the secret for validating webhooks.
	WebhookSecret string
}

Config configures the LiveKit provider.

type Provider

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

Provider implements the OmniMeet MeetingProvider interface for LiveKit.

func NewProvider

func NewProvider(cfg Config) (*Provider, error)

NewProvider creates a new LiveKit provider.

func (*Provider) Close

func (p *Provider) Close() error

Close releases resources held by the provider.

func (*Provider) CreateAgentParticipant

func (p *Provider) CreateAgentParticipant(opts provider.AgentParticipantOptions) (provider.AgentParticipant, error)

CreateAgentParticipant creates a new AgentParticipant.

func (*Provider) CreateJoinToken

func (p *Provider) CreateJoinToken(ctx context.Context, req token.CreateRequest) (*token.JoinToken, error)

CreateJoinToken generates a token for a participant to join a meeting.

func (*Provider) CreateMeeting

func (p *Provider) CreateMeeting(ctx context.Context, req meeting.CreateRequest) (*meeting.Meeting, error)

CreateMeeting creates a new meeting (LiveKit room).

func (*Provider) DeleteMeeting

func (p *Provider) DeleteMeeting(ctx context.Context, meetingID string) error

DeleteMeeting deletes a meeting (same as EndMeeting for LiveKit).

func (*Provider) EndMeeting

func (p *Provider) EndMeeting(ctx context.Context, meetingID string) error

EndMeeting ends a meeting.

func (*Provider) GetMeeting

func (p *Provider) GetMeeting(ctx context.Context, meetingID string) (*meeting.Meeting, error)

GetMeeting retrieves a meeting by ID (room name in LiveKit).

func (*Provider) GetParticipant

func (p *Provider) GetParticipant(ctx context.Context, meetingID, participantID string) (*participant.Participant, error)

GetParticipant retrieves a specific participant.

func (*Provider) ListMeetings

func (p *Provider) ListMeetings(ctx context.Context, opts meeting.ListOptions) ([]meeting.Meeting, error)

ListMeetings returns a list of active meetings.

func (*Provider) ListParticipants

func (p *Provider) ListParticipants(ctx context.Context, meetingID string) ([]participant.Participant, error)

ListParticipants returns the current participants in a meeting.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

func (*Provider) OnEvent

func (p *Provider) OnEvent(handler event.Handler)

OnEvent registers a handler for meeting events.

func (*Provider) RemoveParticipant

func (p *Provider) RemoveParticipant(ctx context.Context, meetingID, participantID string) error

RemoveParticipant removes a participant from a meeting.

func (*Provider) SupportsAgentParticipation

func (p *Provider) SupportsAgentParticipation() bool

SupportsAgentParticipation returns true (LiveKit supports agent participation).

func (*Provider) UpdateParticipant

func (p *Provider) UpdateParticipant(ctx context.Context, meetingID, participantID string, update provider.ParticipantUpdate) error

UpdateParticipant updates participant metadata or permissions.

Jump to

Keyboard shortcuts

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