Documentation ¶
Index ¶
- Constants
- Variables
- func FromProtoIceServers(iceservers []*livekit.ICEServer) []webrtc.ICEServer
- func FromProtoSessionDescription(sd *livekit.SessionDescription) webrtc.SessionDescription
- func FromProtoTrickle(trickle *livekit.TrickleRequest) webrtc.ICECandidateInit
- func ReaderTrackWithFrameDuration(duration time.Duration) func(provider *ReaderSampleProvider)
- func ReaderTrackWithMime(mime string) func(provider *ReaderSampleProvider)
- func ReaderTrackWithOnWriteComplete(f func()) func(provider *ReaderSampleProvider)
- func ReaderTrackWithRTCPHandler(f func(rtcp.Packet)) func(provider *ReaderSampleProvider)
- func ReaderTrackWithSampleOptions(opts ...LocalTrackOptions) func(provider *ReaderSampleProvider)
- func SetLogger(l protoLogger.Logger)
- func ToHttpURL(url string) string
- func ToProtoSessionDescription(sd webrtc.SessionDescription) *livekit.SessionDescription
- func ToProtoTrickle(candidateInit webrtc.ICECandidateInit, target livekit.SignalTarget) *livekit.TrickleRequest
- func ToWebsocketURL(url string) string
- type AgentDispatchClient
- func (c *AgentDispatchClient) CreateDispatch(ctx context.Context, req *livekit.CreateAgentDispatchRequest) (*livekit.AgentDispatch, error)
- func (c *AgentDispatchClient) DeleteDispatch(ctx context.Context, req *livekit.DeleteAgentDispatchRequest) (*livekit.AgentDispatch, error)
- func (c *AgentDispatchClient) ListDispatch(ctx context.Context, req *livekit.ListAgentDispatchRequest) (*livekit.ListAgentDispatchResponse, error)
- type AudioSampleProvider
- type BaseSampleProvider
- type ConnectInfo
- type ConnectOption
- func WithAutoSubscribe(val bool) ConnectOption
- func WithDisableRegionDiscovery() ConnectOption
- func WithICETransportPolicy(iceTransportPolicy webrtc.ICETransportPolicy) ConnectOption
- func WithInterceptors(interceptors []interceptor.Factory) ConnectOption
- func WithPacer(pacer pacer.Factory) ConnectOption
- func WithRetransmitBufferSize(val uint16) ConnectOption
- type ConnectionState
- type DataPacket
- type DataPublishOption
- type DataReceiveParams
- type DisconnectionReason
- type EgressClient
- func (c *EgressClient) ListEgress(ctx context.Context, req *livekit.ListEgressRequest) (*livekit.ListEgressResponse, error)
- func (c *EgressClient) StartParticipantEgress(ctx context.Context, req *livekit.ParticipantEgressRequest) (*livekit.EgressInfo, error)
- func (c *EgressClient) StartRoomCompositeEgress(ctx context.Context, req *livekit.RoomCompositeEgressRequest) (*livekit.EgressInfo, error)
- func (c *EgressClient) StartTrackCompositeEgress(ctx context.Context, req *livekit.TrackCompositeEgressRequest) (*livekit.EgressInfo, error)
- func (c *EgressClient) StartTrackEgress(ctx context.Context, req *livekit.TrackEgressRequest) (*livekit.EgressInfo, error)
- func (c *EgressClient) StartWebEgress(ctx context.Context, req *livekit.WebEgressRequest) (*livekit.EgressInfo, error)
- func (c *EgressClient) StopEgress(ctx context.Context, req *livekit.StopEgressRequest) (*livekit.EgressInfo, error)
- func (c *EgressClient) UpdateLayout(ctx context.Context, req *livekit.UpdateLayoutRequest) (*livekit.EgressInfo, error)
- func (c *EgressClient) UpdateStream(ctx context.Context, req *livekit.UpdateStreamRequest) (*livekit.EgressInfo, error)
- type IngressClient
- func (c *IngressClient) CreateIngress(ctx context.Context, in *livekit.CreateIngressRequest) (*livekit.IngressInfo, error)
- func (c *IngressClient) DeleteIngress(ctx context.Context, in *livekit.DeleteIngressRequest) (*livekit.IngressInfo, error)
- func (c *IngressClient) ListIngress(ctx context.Context, in *livekit.ListIngressRequest) (*livekit.ListIngressResponse, error)
- func (c *IngressClient) UpdateIngress(ctx context.Context, in *livekit.UpdateIngressRequest) (*livekit.IngressInfo, error)
- type LocalParticipant
- func (p *LocalParticipant) Attributes() map[string]string
- func (p *LocalParticipant) AudioLevel() float32
- func (p *LocalParticipant) GetPublisherPeerConnection() *webrtc.PeerConnection
- func (p *LocalParticipant) GetSubscriberPeerConnection() *webrtc.PeerConnection
- func (p *LocalParticipant) GetTrackPublication(source livekit.TrackSource) TrackPublication
- func (p *LocalParticipant) Identity() string
- func (p *LocalParticipant) IsCameraEnabled() bool
- func (p *LocalParticipant) IsMicrophoneEnabled() bool
- func (p *LocalParticipant) IsScreenShareAudioEnabled() bool
- func (p *LocalParticipant) IsScreenShareEnabled() bool
- func (p *LocalParticipant) IsSpeaking() bool
- func (p *LocalParticipant) Kind() ParticipantKind
- func (p *LocalParticipant) Metadata() string
- func (p *LocalParticipant) Name() string
- func (p *LocalParticipant) Permissions() *livekit.ParticipantPermission
- func (p *LocalParticipant) PublishData(payload []byte, opts ...DataPublishOption) errordeprecated
- func (p *LocalParticipant) PublishDataPacket(pck DataPacket, opts ...DataPublishOption) error
- func (p *LocalParticipant) PublishSimulcastTrack(tracks []*LocalTrack, opts *TrackPublicationOptions) (*LocalTrackPublication, error)
- func (p *LocalParticipant) PublishTrack(track webrtc.TrackLocal, opts *TrackPublicationOptions) (*LocalTrackPublication, error)
- func (p *LocalParticipant) SID() string
- func (p *LocalParticipant) SetAttributes(attrs map[string]string)
- func (p *LocalParticipant) SetMetadata(metadata string)
- func (p *LocalParticipant) SetName(name string)
- func (p *LocalParticipant) SetSubscriptionPermission(sp *livekit.SubscriptionPermission)
- func (p *LocalParticipant) TrackPublications() []TrackPublication
- func (p *LocalParticipant) UnpublishTrack(sid string) error
- type LocalSampleTrack
- type LocalSampleTrackOptions
- type LocalTrack
- func NewLocalFileTrack(file string, options ...ReaderSampleProviderOption) (*LocalTrack, error)
- func NewLocalReaderTrack(in io.ReadCloser, mime string, options ...ReaderSampleProviderOption) (*LocalTrack, error)
- func NewLocalSampleTrack(c webrtc.RTPCodecCapability, opts ...LocalTrackOptions) (*LocalTrack, error)
- func NewLocalTrack(c webrtc.RTPCodecCapability, opts ...LocalTrackOptions) (*LocalTrack, error)
- func (s *LocalTrack) Bind(t webrtc.TrackLocalContext) (webrtc.RTPCodecParameters, error)
- func (s *LocalTrack) Close() error
- func (s *LocalTrack) Codec() webrtc.RTPCodecCapability
- func (s *LocalTrack) ID() string
- func (s *LocalTrack) IsBound() bool
- func (s *LocalTrack) Kind() webrtc.RTPCodecType
- func (s *LocalTrack) OnBind(f func())
- func (s *LocalTrack) OnUnbind(f func())
- func (s *LocalTrack) RID() string
- func (s *LocalTrack) SSRC() webrtc.SSRC
- func (s *LocalTrack) SetLogger(l protoLogger.Logger)
- func (s *LocalTrack) SetTransceiver(transceiver *webrtc.RTPTransceiver)
- func (s *LocalTrack) StartWrite(provider SampleProvider, onComplete func()) error
- func (s *LocalTrack) StreamID() string
- func (s *LocalTrack) Unbind(t webrtc.TrackLocalContext) error
- func (s *LocalTrack) WriteRTP(p *rtp.Packet, opts *SampleWriteOptions) error
- func (s *LocalTrack) WriteSample(sample media.Sample, opts *SampleWriteOptions) error
- type LocalTrackOptions
- type LocalTrackPublication
- func (p *LocalTrackPublication) CloseTrack()
- func (p *LocalTrackPublication) GetSimulcastTrack(quality livekit.VideoQuality) *LocalTrack
- func (p *LocalTrackPublication) IsMuted() bool
- func (p *LocalTrackPublication) IsSubscribed() bool
- func (p *LocalTrackPublication) Kind() TrackKind
- func (p *LocalTrackPublication) MimeType() string
- func (p *LocalTrackPublication) Name() string
- func (p *LocalTrackPublication) PublicationOptions() TrackPublicationOptions
- func (p *LocalTrackPublication) SID() string
- func (p *LocalTrackPublication) SetMuted(muted bool)
- func (p *LocalTrackPublication) SimulateDisconnection(duration time.Duration)
- func (p *LocalTrackPublication) Source() livekit.TrackSource
- func (p *LocalTrackPublication) Track() Track
- func (p *LocalTrackPublication) TrackInfo() *livekit.TrackInfo
- func (p *LocalTrackPublication) TrackLocal() webrtc.TrackLocal
- type LocalTrackWithClose
- type NullSampleProvider
- type PCTransport
- func (t *PCTransport) AddICECandidate(candidate webrtc.ICECandidateInit) error
- func (t *PCTransport) Close() error
- func (t *PCTransport) GetSelectedCandidatePair() (*webrtc.ICECandidatePair, error)
- func (t *PCTransport) IsConnected() bool
- func (t *PCTransport) Negotiate()
- func (t *PCTransport) OnRemoteDescriptionSettled(f func() error)
- func (t *PCTransport) PeerConnection() *webrtc.PeerConnection
- func (t *PCTransport) SetConfiguration(config webrtc.Configuration) error
- func (t *PCTransport) SetLogger(l protoLogger.Logger)
- func (t *PCTransport) SetRTT(rtt uint32)
- func (t *PCTransport) SetRemoteDescription(sd webrtc.SessionDescription) error
- type PCTransportParams
- type PLIWriter
- type Participant
- type ParticipantAttributesChangedFunc
- type ParticipantCallback
- type ParticipantKind
- type PubCallback
- type RTCEngine
- func (e *RTCEngine) Close()
- func (e *RTCEngine) GetDataChannel(kind livekit.DataPacket_Kind) *webrtc.DataChannel
- func (e *RTCEngine) GetDataChannelSub(kind livekit.DataPacket_Kind) *webrtc.DataChannel
- func (e *RTCEngine) IsConnected() bool
- func (e *RTCEngine) Join(url string, token string, params *SignalClientConnectParams) (*livekit.JoinResponse, error)
- func (e *RTCEngine) Publisher() (*PCTransport, bool)
- func (e *RTCEngine) RegisterTrackPublishedListener(cid string, c chan *livekit.TrackPublishedResponse)
- func (e *RTCEngine) SetLogger(l protoLogger.Logger)
- func (e *RTCEngine) Subscriber() (*PCTransport, bool)
- func (e *RTCEngine) UnregisterTrackPublishedListener(cid string)
- type ReaderSampleProvider
- type ReaderSampleProviderOption
- type RemoteParticipant
- func (p *RemoteParticipant) Attributes() map[string]string
- func (p *RemoteParticipant) AudioLevel() float32
- func (p *RemoteParticipant) GetTrackPublication(source livekit.TrackSource) TrackPublication
- func (p *RemoteParticipant) Identity() string
- func (p *RemoteParticipant) IsCameraEnabled() bool
- func (p *RemoteParticipant) IsMicrophoneEnabled() bool
- func (p *RemoteParticipant) IsScreenShareAudioEnabled() bool
- func (p *RemoteParticipant) IsScreenShareEnabled() bool
- func (p *RemoteParticipant) IsSpeaking() bool
- func (p *RemoteParticipant) Kind() ParticipantKind
- func (p *RemoteParticipant) Metadata() string
- func (p *RemoteParticipant) Name() string
- func (p *RemoteParticipant) Permissions() *livekit.ParticipantPermission
- func (p *RemoteParticipant) SID() string
- func (p *RemoteParticipant) TrackPublications() []TrackPublication
- func (p *RemoteParticipant) WritePLI(ssrc webrtc.SSRC)
- type RemoteTrackPublication
- func (p *RemoteTrackPublication) IsEnabled() bool
- func (p *RemoteTrackPublication) IsMuted() bool
- func (p *RemoteTrackPublication) IsSubscribed() bool
- func (p *RemoteTrackPublication) Kind() TrackKind
- func (p *RemoteTrackPublication) MimeType() string
- func (p *RemoteTrackPublication) Name() string
- func (p *RemoteTrackPublication) OnRTCP(cb func(rtcp.Packet))
- func (p *RemoteTrackPublication) Receiver() *webrtc.RTPReceiver
- func (p *RemoteTrackPublication) SID() string
- func (p *RemoteTrackPublication) SetEnabled(enabled bool)
- func (p *RemoteTrackPublication) SetSubscribed(subscribed bool) error
- func (p *RemoteTrackPublication) SetVideoDimensions(width uint32, height uint32)
- func (p *RemoteTrackPublication) SetVideoQuality(quality livekit.VideoQuality) error
- func (p *RemoteTrackPublication) Source() livekit.TrackSource
- func (p *RemoteTrackPublication) Track() Track
- func (p *RemoteTrackPublication) TrackInfo() *livekit.TrackInfo
- func (p *RemoteTrackPublication) TrackRemote() *webrtc.TrackRemote
- type Room
- func (r *Room) ActiveSpeakers() []Participant
- func (r *Room) ConnectionState() ConnectionState
- func (r *Room) Disconnect()
- func (r *Room) DisconnectWithReason(reason livekit.DisconnectReason)
- func (r *Room) GetParticipantByIdentity(identity string) *RemoteParticipant
- func (r *Room) GetParticipantBySID(sid string) *RemoteParticipant
- func (r *Room) GetRemoteParticipants() []*RemoteParticipant
- func (r *Room) Join(url string, info ConnectInfo, opts ...ConnectOption) error
- func (r *Room) JoinWithToken(url, token string, opts ...ConnectOption) error
- func (r *Room) Metadata() string
- func (r *Room) Name() string
- func (r *Room) PrepareConnection(url, token string) error
- func (r *Room) SID() string
- func (r *Room) ServerInfo() *livekit.ServerInfo
- func (r *Room) SetLogger(l protoLogger.Logger)
- func (r *Room) Simulate(scenario SimulateScenario)
- type RoomCallback
- type RoomServiceClient
- func (c *RoomServiceClient) CreateRoom(ctx context.Context, req *livekit.CreateRoomRequest) (*livekit.Room, error)
- func (c *RoomServiceClient) CreateToken() *auth.AccessToken
- func (c *RoomServiceClient) DeleteRoom(ctx context.Context, req *livekit.DeleteRoomRequest) (*livekit.DeleteRoomResponse, error)
- func (c *RoomServiceClient) GetParticipant(ctx context.Context, req *livekit.RoomParticipantIdentity) (*livekit.ParticipantInfo, error)
- func (c *RoomServiceClient) ListParticipants(ctx context.Context, req *livekit.ListParticipantsRequest) (*livekit.ListParticipantsResponse, error)
- func (c *RoomServiceClient) ListRooms(ctx context.Context, req *livekit.ListRoomsRequest) (*livekit.ListRoomsResponse, error)
- func (c *RoomServiceClient) MutePublishedTrack(ctx context.Context, req *livekit.MuteRoomTrackRequest) (*livekit.MuteRoomTrackResponse, error)
- func (c *RoomServiceClient) RemoveParticipant(ctx context.Context, req *livekit.RoomParticipantIdentity) (*livekit.RemoveParticipantResponse, error)
- func (c *RoomServiceClient) SendData(ctx context.Context, req *livekit.SendDataRequest) (*livekit.SendDataResponse, error)
- func (c *RoomServiceClient) UpdateParticipant(ctx context.Context, req *livekit.UpdateParticipantRequest) (*livekit.ParticipantInfo, error)
- func (c *RoomServiceClient) UpdateRoomMetadata(ctx context.Context, req *livekit.UpdateRoomMetadataRequest) (*livekit.Room, error)
- func (c *RoomServiceClient) UpdateSubscriptions(ctx context.Context, req *livekit.UpdateSubscriptionsRequest) (*livekit.UpdateSubscriptionsResponse, error)
- type SIPClient
- func (s *SIPClient) CreateSIPDispatchRule(ctx context.Context, in *livekit.CreateSIPDispatchRuleRequest) (*livekit.SIPDispatchRuleInfo, error)
- func (s *SIPClient) CreateSIPInboundTrunk(ctx context.Context, in *livekit.CreateSIPInboundTrunkRequest) (*livekit.SIPInboundTrunkInfo, error)
- func (s *SIPClient) CreateSIPOutboundTrunk(ctx context.Context, in *livekit.CreateSIPOutboundTrunkRequest) (*livekit.SIPOutboundTrunkInfo, error)
- func (s *SIPClient) CreateSIPParticipant(ctx context.Context, in *livekit.CreateSIPParticipantRequest) (*livekit.SIPParticipantInfo, error)
- func (s *SIPClient) DeleteSIPDispatchRule(ctx context.Context, in *livekit.DeleteSIPDispatchRuleRequest) (*livekit.SIPDispatchRuleInfo, error)
- func (s *SIPClient) DeleteSIPTrunk(ctx context.Context, in *livekit.DeleteSIPTrunkRequest) (*livekit.SIPTrunkInfo, error)
- func (s *SIPClient) ListSIPDispatchRule(ctx context.Context, in *livekit.ListSIPDispatchRuleRequest) (*livekit.ListSIPDispatchRuleResponse, error)
- func (s *SIPClient) ListSIPInboundTrunk(ctx context.Context, in *livekit.ListSIPInboundTrunkRequest) (*livekit.ListSIPInboundTrunkResponse, error)
- func (s *SIPClient) ListSIPOutboundTrunk(ctx context.Context, in *livekit.ListSIPOutboundTrunkRequest) (*livekit.ListSIPOutboundTrunkResponse, error)
- func (s *SIPClient) ListSIPTrunk(ctx context.Context, in *livekit.ListSIPTrunkRequest) (*livekit.ListSIPTrunkResponse, error)deprecated
- func (s *SIPClient) TransferSIPParticipant(ctx context.Context, in *livekit.TransferSIPParticipantRequest) (*emptypb.Empty, error)
- type SampleProvider
- type SampleWriteOptions
- type SignalClient
- func (c *SignalClient) Close()
- func (c *SignalClient) IsStarted() bool
- func (c *SignalClient) Join(urlPrefix string, token string, params SignalClientConnectParams) (*livekit.JoinResponse, error)
- func (c *SignalClient) Reconnect(urlPrefix string, token string, params SignalClientConnectParams, ...) (*livekit.ReconnectResponse, error)
- func (c *SignalClient) SendAnswer(sd webrtc.SessionDescription) error
- func (c *SignalClient) SendICECandidate(candidate webrtc.ICECandidateInit, target livekit.SignalTarget) error
- func (c *SignalClient) SendLeave() error
- func (c *SignalClient) SendLeaveWithReason(reason livekit.DisconnectReason) error
- func (c *SignalClient) SendMuteTrack(sid string, muted bool) error
- func (c *SignalClient) SendOffer(sd webrtc.SessionDescription) error
- func (c *SignalClient) SendRequest(req *livekit.SignalRequest) error
- func (c *SignalClient) SendSyncState(state *livekit.SyncState) error
- func (c *SignalClient) SendUpdateParticipantMetadata(metadata *livekit.UpdateParticipantMetadata) error
- func (c *SignalClient) SendUpdateTrackSettings(settings *livekit.UpdateTrackSettings) error
- func (c *SignalClient) SetLogger(l protoLogger.Logger)
- func (c *SignalClient) Start()
- type SignalClientConnectParams
- type SimulateScenario
- type SimulcastTrack
- type Track
- type TrackKind
- type TrackPubCallback
- type TrackPublication
- type TrackPublicationOptions
- type UserDataPacket
Constants ¶
const ( ParticipantStandard = ParticipantKind(livekit.ParticipantInfo_STANDARD) ParticipantIngress = ParticipantKind(livekit.ParticipantInfo_INGRESS) ParticipantEgress = ParticipantKind(livekit.ParticipantInfo_EGRESS) ParticipantSIP = ParticipantKind(livekit.ParticipantInfo_SIP) ParticipantAgent = ParticipantKind(livekit.ParticipantInfo_AGENT) )
const PROTOCOL = 12
const (
SimulateSpeakerUpdateInterval = 5
)
const Version = "2.4.0"
Variables ¶
var ( ErrURLNotProvided = errors.New("URL was not provided") ErrConnectionTimeout = errors.New("could not connect after timeout") ErrTrackPublishTimeout = errors.New("timed out publishing track") ErrCannotDetermineMime = errors.New("cannot determine mimetype from file extension") ErrUnsupportedFileType = errors.New("ReaderSampleProvider does not support this mime type") ErrUnsupportedSimulcastKind = errors.New("simulcast is only supported for video") ErrInvalidSimulcastTrack = errors.New("simulcast track was not initiated correctly") ErrCannotFindTrack = errors.New("could not find the track") ErrInvalidParameter = errors.New("invalid parameter") ErrCannotConnectSignal = errors.New("could not establish signal connection") ErrCannotDialSignal = errors.New("could not dial signal connection") ErrNoPeerConnection = errors.New("peer connection not established") ErrAborted = errors.New("operation was aborted") )
Functions ¶
func FromProtoIceServers ¶
func FromProtoSessionDescription ¶
func FromProtoSessionDescription(sd *livekit.SessionDescription) webrtc.SessionDescription
func FromProtoTrickle ¶
func FromProtoTrickle(trickle *livekit.TrickleRequest) webrtc.ICECandidateInit
func ReaderTrackWithFrameDuration ¶
func ReaderTrackWithFrameDuration(duration time.Duration) func(provider *ReaderSampleProvider)
func ReaderTrackWithMime ¶
func ReaderTrackWithMime(mime string) func(provider *ReaderSampleProvider)
func ReaderTrackWithOnWriteComplete ¶
func ReaderTrackWithOnWriteComplete(f func()) func(provider *ReaderSampleProvider)
func ReaderTrackWithRTCPHandler ¶
func ReaderTrackWithRTCPHandler(f func(rtcp.Packet)) func(provider *ReaderSampleProvider)
func ReaderTrackWithSampleOptions ¶
func ReaderTrackWithSampleOptions(opts ...LocalTrackOptions) func(provider *ReaderSampleProvider)
func SetLogger ¶
func SetLogger(l protoLogger.Logger)
SetLogger overrides default logger. To use a [logr](https://github.com/go-logr/logr) compatible logger, pass in SetLogger(logger.LogRLogger(logRLogger))
func ToProtoSessionDescription ¶
func ToProtoSessionDescription(sd webrtc.SessionDescription) *livekit.SessionDescription
func ToProtoTrickle ¶
func ToProtoTrickle(candidateInit webrtc.ICECandidateInit, target livekit.SignalTarget) *livekit.TrickleRequest
func ToWebsocketURL ¶
Types ¶
type AgentDispatchClient ¶ added in v2.2.1
type AgentDispatchClient struct {
// contains filtered or unexported fields
}
func NewAgentDispatchServiceClient ¶ added in v2.2.1
func NewAgentDispatchServiceClient(url string, apiKey string, secretKey string, opts ...twirp.ClientOption) *AgentDispatchClient
func (*AgentDispatchClient) CreateDispatch ¶ added in v2.2.1
func (c *AgentDispatchClient) CreateDispatch(ctx context.Context, req *livekit.CreateAgentDispatchRequest) (*livekit.AgentDispatch, error)
func (*AgentDispatchClient) DeleteDispatch ¶ added in v2.2.1
func (c *AgentDispatchClient) DeleteDispatch(ctx context.Context, req *livekit.DeleteAgentDispatchRequest) (*livekit.AgentDispatch, error)
func (*AgentDispatchClient) ListDispatch ¶ added in v2.2.1
func (c *AgentDispatchClient) ListDispatch(ctx context.Context, req *livekit.ListAgentDispatchRequest) (*livekit.ListAgentDispatchResponse, error)
type AudioSampleProvider ¶
type AudioSampleProvider interface { SampleProvider CurrentAudioLevel() uint8 }
type BaseSampleProvider ¶
type BaseSampleProvider struct { }
BaseSampleProvider provides empty implementations for OnBind and OnUnbind
func (*BaseSampleProvider) Close ¶
func (p *BaseSampleProvider) Close() error
func (*BaseSampleProvider) OnBind ¶
func (p *BaseSampleProvider) OnBind() error
func (*BaseSampleProvider) OnUnbind ¶
func (p *BaseSampleProvider) OnUnbind() error
type ConnectInfo ¶
type ConnectOption ¶
type ConnectOption func(*SignalClientConnectParams)
func WithAutoSubscribe ¶
func WithAutoSubscribe(val bool) ConnectOption
func WithDisableRegionDiscovery ¶ added in v2.2.1
func WithDisableRegionDiscovery() ConnectOption
func WithICETransportPolicy ¶ added in v2.1.1
func WithICETransportPolicy(iceTransportPolicy webrtc.ICETransportPolicy) ConnectOption
func WithInterceptors ¶ added in v2.1.1
func WithInterceptors(interceptors []interceptor.Factory) ConnectOption
func WithPacer ¶
func WithPacer(pacer pacer.Factory) ConnectOption
WithPacer enables the use of a pacer on this connection A pacer helps to smooth out video packet rate to avoid overwhelming downstream. Learn more at: https://chromium.googlesource.com/external/webrtc/+/master/modules/pacing/g3doc/index.md
func WithRetransmitBufferSize ¶
func WithRetransmitBufferSize(val uint16) ConnectOption
Retransmit buffer size to reponse to nack request, must be one of: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768
type ConnectionState ¶ added in v2.2.0
type ConnectionState string
const ( ConnectionStateConnected ConnectionState = "connected" ConnectionStateReconnecting ConnectionState = "reconnecting" ConnectionStateDisconnected ConnectionState = "disconnected" )
type DataPacket ¶ added in v2.0.5
type DataPacket interface {
ToProto() *livekit.DataPacket
}
type DataPublishOption ¶
type DataPublishOption func(*dataPublishOptions)
func WithDataPublishDestination ¶
func WithDataPublishDestination(identities []string) DataPublishOption
func WithDataPublishReliable ¶
func WithDataPublishReliable(reliable bool) DataPublishOption
func WithDataPublishTopic ¶
func WithDataPublishTopic(topic string) DataPublishOption
type DataReceiveParams ¶
type DataReceiveParams struct { Sender *RemoteParticipant SenderIdentity string Topic string // Deprecated: Use UserDataPacket.Topic }
type DisconnectionReason ¶ added in v2.1.0
type DisconnectionReason string
const ( LeaveRequested DisconnectionReason = "leave requested by room" RejectedByUser DisconnectionReason = "rejected by remote user" Failed DisconnectionReason = "connection to room failed" )
func GetDisconnectionReason ¶ added in v2.3.0
func GetDisconnectionReason(reason livekit.DisconnectReason) DisconnectionReason
type EgressClient ¶
type EgressClient struct {
// contains filtered or unexported fields
}
func NewEgressClient ¶
func NewEgressClient(url string, apiKey string, secretKey string, opts ...twirp.ClientOption) *EgressClient
func (*EgressClient) ListEgress ¶
func (c *EgressClient) ListEgress(ctx context.Context, req *livekit.ListEgressRequest) (*livekit.ListEgressResponse, error)
func (*EgressClient) StartParticipantEgress ¶
func (c *EgressClient) StartParticipantEgress(ctx context.Context, req *livekit.ParticipantEgressRequest) (*livekit.EgressInfo, error)
func (*EgressClient) StartRoomCompositeEgress ¶
func (c *EgressClient) StartRoomCompositeEgress(ctx context.Context, req *livekit.RoomCompositeEgressRequest) (*livekit.EgressInfo, error)
func (*EgressClient) StartTrackCompositeEgress ¶
func (c *EgressClient) StartTrackCompositeEgress(ctx context.Context, req *livekit.TrackCompositeEgressRequest) (*livekit.EgressInfo, error)
func (*EgressClient) StartTrackEgress ¶
func (c *EgressClient) StartTrackEgress(ctx context.Context, req *livekit.TrackEgressRequest) (*livekit.EgressInfo, error)
func (*EgressClient) StartWebEgress ¶
func (c *EgressClient) StartWebEgress(ctx context.Context, req *livekit.WebEgressRequest) (*livekit.EgressInfo, error)
func (*EgressClient) StopEgress ¶
func (c *EgressClient) StopEgress(ctx context.Context, req *livekit.StopEgressRequest) (*livekit.EgressInfo, error)
func (*EgressClient) UpdateLayout ¶
func (c *EgressClient) UpdateLayout(ctx context.Context, req *livekit.UpdateLayoutRequest) (*livekit.EgressInfo, error)
func (*EgressClient) UpdateStream ¶
func (c *EgressClient) UpdateStream(ctx context.Context, req *livekit.UpdateStreamRequest) (*livekit.EgressInfo, error)
type IngressClient ¶
type IngressClient struct {
// contains filtered or unexported fields
}
func NewIngressClient ¶
func NewIngressClient(url string, apiKey string, secretKey string, opts ...twirp.ClientOption) *IngressClient
func (*IngressClient) CreateIngress ¶
func (c *IngressClient) CreateIngress(ctx context.Context, in *livekit.CreateIngressRequest) (*livekit.IngressInfo, error)
func (*IngressClient) DeleteIngress ¶
func (c *IngressClient) DeleteIngress(ctx context.Context, in *livekit.DeleteIngressRequest) (*livekit.IngressInfo, error)
func (*IngressClient) ListIngress ¶
func (c *IngressClient) ListIngress(ctx context.Context, in *livekit.ListIngressRequest) (*livekit.ListIngressResponse, error)
func (*IngressClient) UpdateIngress ¶
func (c *IngressClient) UpdateIngress(ctx context.Context, in *livekit.UpdateIngressRequest) (*livekit.IngressInfo, error)
type LocalParticipant ¶
type LocalParticipant struct {
// contains filtered or unexported fields
}
func (*LocalParticipant) Attributes ¶ added in v2.2.1
func (*LocalParticipant) AudioLevel ¶
func (p *LocalParticipant) AudioLevel() float32
func (*LocalParticipant) GetPublisherPeerConnection ¶
func (p *LocalParticipant) GetPublisherPeerConnection() *webrtc.PeerConnection
GetPublisherPeerConnection is a power-user API that gives access to the underlying publisher peer connection local tracks are published to server via this PeerConnection
func (*LocalParticipant) GetSubscriberPeerConnection ¶
func (p *LocalParticipant) GetSubscriberPeerConnection() *webrtc.PeerConnection
GetSubscriberPeerConnection is a power-user API that gives access to the underlying subscriber peer connection subscribed tracks are received using this PeerConnection
func (*LocalParticipant) GetTrackPublication ¶
func (p *LocalParticipant) GetTrackPublication(source livekit.TrackSource) TrackPublication
func (*LocalParticipant) IsCameraEnabled ¶
func (p *LocalParticipant) IsCameraEnabled() bool
func (*LocalParticipant) IsMicrophoneEnabled ¶
func (p *LocalParticipant) IsMicrophoneEnabled() bool
func (*LocalParticipant) IsScreenShareAudioEnabled ¶
func (p *LocalParticipant) IsScreenShareAudioEnabled() bool
func (*LocalParticipant) IsScreenShareEnabled ¶
func (p *LocalParticipant) IsScreenShareEnabled() bool
func (*LocalParticipant) IsSpeaking ¶
func (p *LocalParticipant) IsSpeaking() bool
func (*LocalParticipant) Kind ¶
func (p *LocalParticipant) Kind() ParticipantKind
func (*LocalParticipant) Permissions ¶
func (p *LocalParticipant) Permissions() *livekit.ParticipantPermission
func (*LocalParticipant) PublishData
deprecated
func (p *LocalParticipant) PublishData(payload []byte, opts ...DataPublishOption) error
PublishData sends custom user data via WebRTC data channel.
By default, the message can be received by all participants in a room, see WithDataPublishDestination for choosing specific participants.
Messages are sent via a LOSSY channel by default, see WithDataPublishReliable for sending reliable data.
Deprecated: Use PublishDataPacket with UserData instead.
func (*LocalParticipant) PublishDataPacket ¶ added in v2.0.5
func (p *LocalParticipant) PublishDataPacket(pck DataPacket, opts ...DataPublishOption) error
PublishDataPacket sends a packet via a WebRTC data channel. UserData can be used for sending custom user data.
By default, the message can be received by all participants in a room, see WithDataPublishDestination for choosing specific participants.
Messages are sent via UDP and offer no delivery guarantees, see WithDataPublishReliable for sending data reliably (with retries).
func (*LocalParticipant) PublishSimulcastTrack ¶
func (p *LocalParticipant) PublishSimulcastTrack(tracks []*LocalTrack, opts *TrackPublicationOptions) (*LocalTrackPublication, error)
PublishSimulcastTrack publishes up to three layers to the server
func (*LocalParticipant) PublishTrack ¶
func (p *LocalParticipant) PublishTrack(track webrtc.TrackLocal, opts *TrackPublicationOptions) (*LocalTrackPublication, error)
func (*LocalParticipant) SetAttributes ¶ added in v2.2.1
func (p *LocalParticipant) SetAttributes(attrs map[string]string)
SetAttributes sets the KV attributes of the current participant. To remove an attribute, set it to empty value. Updates will be performed only if the participant has canUpdateOwnMetadata grant.
func (*LocalParticipant) SetMetadata ¶
func (p *LocalParticipant) SetMetadata(metadata string)
SetMetadata sets the metadata of the current participant. Updates will be performed only if the participant has canUpdateOwnMetadata grant.
func (*LocalParticipant) SetName ¶
func (p *LocalParticipant) SetName(name string)
SetName sets the name of the current participant. updates will be performed only if the participant has canUpdateOwnMetadata grant
func (*LocalParticipant) SetSubscriptionPermission ¶ added in v2.3.0
func (p *LocalParticipant) SetSubscriptionPermission(sp *livekit.SubscriptionPermission)
Control who can subscribe to LocalParticipant's published tracks.
By default, all participants can subscribe. This allows fine-grained control over who is able to subscribe at a participant and track level.
Note: if access is given at a track-level (i.e. both `AllParticipants` and `TrackPermission.AllTracks` are false), any newer published tracks will not grant permissions to any participants and will require a subsequent permissions update to allow subscription.
func (*LocalParticipant) TrackPublications ¶
func (p *LocalParticipant) TrackPublications() []TrackPublication
func (*LocalParticipant) UnpublishTrack ¶
func (p *LocalParticipant) UnpublishTrack(sid string) error
type LocalSampleTrack ¶
type LocalSampleTrack = LocalTrack
type LocalSampleTrackOptions ¶
type LocalSampleTrackOptions = LocalTrackOptions
type LocalTrack ¶
type LocalTrack struct {
// contains filtered or unexported fields
}
LocalTrack is a local track that simplifies writing samples. It handles timing and publishing of things, so as long as a SampleProvider is provided, the class takes care of publishing tracks at the right frequency This extends webrtc.TrackLocalStaticSample, and adds the ability to write RTP extensions
func NewLocalFileTrack ¶
func NewLocalFileTrack(file string, options ...ReaderSampleProviderOption) (*LocalTrack, error)
NewLocalFileTrack creates an *os.File reader for NewLocalReaderTrack
func NewLocalReaderTrack ¶
func NewLocalReaderTrack(in io.ReadCloser, mime string, options ...ReaderSampleProviderOption) (*LocalTrack, error)
NewLocalReaderTrack uses io.ReadCloser interface to adapt to various ingress types - mime: has to be one of webrtc.MimeType... (e.g. webrtc.MimeTypeOpus)
func NewLocalSampleTrack ¶
func NewLocalSampleTrack(c webrtc.RTPCodecCapability, opts ...LocalTrackOptions) (*LocalTrack, error)
func NewLocalTrack ¶
func NewLocalTrack(c webrtc.RTPCodecCapability, opts ...LocalTrackOptions) (*LocalTrack, error)
func (*LocalTrack) Bind ¶
func (s *LocalTrack) Bind(t webrtc.TrackLocalContext) (webrtc.RTPCodecParameters, error)
Bind is an interface for TrackLocal, not for external consumption
func (*LocalTrack) Close ¶
func (s *LocalTrack) Close() error
func (*LocalTrack) Codec ¶
func (s *LocalTrack) Codec() webrtc.RTPCodecCapability
Codec gets the Codec of the track
func (*LocalTrack) ID ¶
func (s *LocalTrack) ID() string
ID is the unique identifier for this Track. This should be unique for the stream, but doesn't have to globally unique. A common example would be 'audio' or 'video' and StreamID would be 'desktop' or 'webcam'
func (*LocalTrack) IsBound ¶
func (s *LocalTrack) IsBound() bool
func (*LocalTrack) Kind ¶
func (s *LocalTrack) Kind() webrtc.RTPCodecType
Kind controls if this TrackLocal is audio or video
func (*LocalTrack) OnBind ¶
func (s *LocalTrack) OnBind(f func())
OnBind sets a callback to be called when the track has been negotiated for publishing and bound to a peer connection
func (*LocalTrack) OnUnbind ¶
func (s *LocalTrack) OnUnbind(f func())
OnUnbind sets a callback to be called after the track is removed from a peer connection
func (*LocalTrack) SSRC ¶ added in v2.1.1
func (s *LocalTrack) SSRC() webrtc.SSRC
func (*LocalTrack) SetLogger ¶ added in v2.2.1
func (s *LocalTrack) SetLogger(l protoLogger.Logger)
SetLogger overrides default logger.
func (*LocalTrack) SetTransceiver ¶
func (s *LocalTrack) SetTransceiver(transceiver *webrtc.RTPTransceiver)
func (*LocalTrack) StartWrite ¶
func (s *LocalTrack) StartWrite(provider SampleProvider, onComplete func()) error
func (*LocalTrack) StreamID ¶
func (s *LocalTrack) StreamID() string
StreamID is the group this track belongs too. This must be unique
func (*LocalTrack) Unbind ¶
func (s *LocalTrack) Unbind(t webrtc.TrackLocalContext) error
Unbind is an interface for TrackLocal, not for external consumption
func (*LocalTrack) WriteRTP ¶
func (s *LocalTrack) WriteRTP(p *rtp.Packet, opts *SampleWriteOptions) error
func (*LocalTrack) WriteSample ¶
func (s *LocalTrack) WriteSample(sample media.Sample, opts *SampleWriteOptions) error
type LocalTrackOptions ¶
type LocalTrackOptions func(s *LocalTrack)
func WithRTCPHandler ¶
func WithRTCPHandler(cb func(rtcp.Packet)) LocalTrackOptions
func WithSimulcast ¶
func WithSimulcast(simulcastID string, layer *livekit.VideoLayer) LocalTrackOptions
WithSimulcast marks the current track for simulcasting. In order to use simulcast, simulcastID must be identical across all layers
type LocalTrackPublication ¶
type LocalTrackPublication struct {
// contains filtered or unexported fields
}
func NewLocalTrackPublication ¶
func NewLocalTrackPublication(kind TrackKind, track Track, opts TrackPublicationOptions, client *SignalClient) *LocalTrackPublication
func (*LocalTrackPublication) CloseTrack ¶
func (p *LocalTrackPublication) CloseTrack()
func (*LocalTrackPublication) GetSimulcastTrack ¶
func (p *LocalTrackPublication) GetSimulcastTrack(quality livekit.VideoQuality) *LocalTrack
func (*LocalTrackPublication) IsSubscribed ¶
func (p *LocalTrackPublication) IsSubscribed() bool
func (*LocalTrackPublication) PublicationOptions ¶
func (p *LocalTrackPublication) PublicationOptions() TrackPublicationOptions
func (*LocalTrackPublication) SetMuted ¶
func (p *LocalTrackPublication) SetMuted(muted bool)
func (*LocalTrackPublication) SimulateDisconnection ¶ added in v2.2.1
func (p *LocalTrackPublication) SimulateDisconnection(duration time.Duration)
func (*LocalTrackPublication) Source ¶
func (p *LocalTrackPublication) Source() livekit.TrackSource
func (*LocalTrackPublication) TrackLocal ¶
func (p *LocalTrackPublication) TrackLocal() webrtc.TrackLocal
type LocalTrackWithClose ¶
type LocalTrackWithClose interface {
webrtc.TrackLocal
Close() error
}
type NullSampleProvider ¶
type NullSampleProvider struct { BaseSampleProvider BytesPerSample uint32 SampleDuration time.Duration }
NullSampleProvider is a media provider that provides null packets, it could meet a certain bitrate, if desired
func NewNullSampleProvider ¶
func NewNullSampleProvider(bitrate uint32) *NullSampleProvider
func (*NullSampleProvider) NextSample ¶
type PCTransport ¶
type PCTransport struct { OnOffer func(description webrtc.SessionDescription) // contains filtered or unexported fields }
PCTransport is a wrapper around PeerConnection, with some helper methods
func NewPCTransport ¶
func NewPCTransport(params PCTransportParams) (*PCTransport, error)
func (*PCTransport) AddICECandidate ¶
func (t *PCTransport) AddICECandidate(candidate webrtc.ICECandidateInit) error
func (*PCTransport) Close ¶
func (t *PCTransport) Close() error
func (*PCTransport) GetSelectedCandidatePair ¶
func (t *PCTransport) GetSelectedCandidatePair() (*webrtc.ICECandidatePair, error)
func (*PCTransport) IsConnected ¶
func (t *PCTransport) IsConnected() bool
func (*PCTransport) Negotiate ¶
func (t *PCTransport) Negotiate()
func (*PCTransport) OnRemoteDescriptionSettled ¶
func (t *PCTransport) OnRemoteDescriptionSettled(f func() error)
func (*PCTransport) PeerConnection ¶
func (t *PCTransport) PeerConnection() *webrtc.PeerConnection
func (*PCTransport) SetConfiguration ¶ added in v2.2.1
func (t *PCTransport) SetConfiguration(config webrtc.Configuration) error
func (*PCTransport) SetLogger ¶ added in v2.2.1
func (t *PCTransport) SetLogger(l protoLogger.Logger)
SetLogger overrides default logger.
func (*PCTransport) SetRTT ¶
func (t *PCTransport) SetRTT(rtt uint32)
func (*PCTransport) SetRemoteDescription ¶
func (t *PCTransport) SetRemoteDescription(sd webrtc.SessionDescription) error
type PCTransportParams ¶
type Participant ¶
type Participant interface { SID() string Identity() string Name() string Kind() ParticipantKind IsSpeaking() bool AudioLevel() float32 TrackPublications() []TrackPublication IsCameraEnabled() bool IsMicrophoneEnabled() bool Metadata() string Attributes() map[string]string GetTrackPublication(source livekit.TrackSource) TrackPublication Permissions() *livekit.ParticipantPermission // contains filtered or unexported methods }
type ParticipantAttributesChangedFunc ¶ added in v2.2.1
type ParticipantAttributesChangedFunc func(changed map[string]string, p Participant)
ParticipantAttributesChangedFunc is callback for Participant attribute change event. The function is called with an already updated participant state and the map of changes attributes. Deleted attributes will have empty string value in the changed map.
type ParticipantCallback ¶
type ParticipantCallback struct { // for local participant OnLocalTrackPublished func(publication *LocalTrackPublication, lp *LocalParticipant) OnLocalTrackUnpublished func(publication *LocalTrackPublication, lp *LocalParticipant) // for all participants OnTrackMuted func(pub TrackPublication, p Participant) OnTrackUnmuted func(pub TrackPublication, p Participant) OnMetadataChanged func(oldMetadata string, p Participant) OnAttributesChanged ParticipantAttributesChangedFunc OnIsSpeakingChanged func(p Participant) OnConnectionQualityChanged func(update *livekit.ConnectionQualityInfo, p Participant) // for remote participants OnTrackSubscribed func(track *webrtc.TrackRemote, publication *RemoteTrackPublication, rp *RemoteParticipant) OnTrackUnsubscribed func(track *webrtc.TrackRemote, publication *RemoteTrackPublication, rp *RemoteParticipant) OnTrackSubscriptionFailed func(sid string, rp *RemoteParticipant) OnTrackPublished func(publication *RemoteTrackPublication, rp *RemoteParticipant) OnTrackUnpublished func(publication *RemoteTrackPublication, rp *RemoteParticipant) OnDataReceived func(data []byte, params DataReceiveParams) // Deprecated: Use OnDataPacket instead OnDataPacket func(data DataPacket, params DataReceiveParams) }
func NewParticipantCallback ¶
func NewParticipantCallback() *ParticipantCallback
func (*ParticipantCallback) Merge ¶
func (cb *ParticipantCallback) Merge(other *ParticipantCallback)
type ParticipantKind ¶
type ParticipantKind int
type PubCallback ¶
type PubCallback func(pub TrackPublication, participant *RemoteParticipant)
type RTCEngine ¶
type RTCEngine struct { JoinTimeout time.Duration // callbacks OnLocalTrackUnpublished func(response *livekit.TrackUnpublishedResponse) OnTrackRemoteMuted func(request *livekit.MuteTrackRequest) OnDisconnected func(reason DisconnectionReason) OnMediaTrack func(track *webrtc.TrackRemote, receiver *webrtc.RTPReceiver) OnParticipantUpdate func([]*livekit.ParticipantInfo) OnSpeakersChanged func([]*livekit.SpeakerInfo) OnDataReceived func(userPacket *livekit.UserPacket) // Deprecated: Use OnDataPacket instead OnDataPacket func(identity string, dataPacket DataPacket) OnConnectionQuality func([]*livekit.ConnectionQualityInfo) OnRoomUpdate func(room *livekit.Room) OnRestarting func() OnRestarted func(*livekit.JoinResponse) OnResuming func() OnResumed func() // callbacks to get data CbGetLocalParticipantSID func() string // contains filtered or unexported fields }
func NewRTCEngine ¶
func NewRTCEngine() *RTCEngine
func (*RTCEngine) GetDataChannel ¶
func (e *RTCEngine) GetDataChannel(kind livekit.DataPacket_Kind) *webrtc.DataChannel
func (*RTCEngine) GetDataChannelSub ¶
func (e *RTCEngine) GetDataChannelSub(kind livekit.DataPacket_Kind) *webrtc.DataChannel
func (*RTCEngine) IsConnected ¶
func (*RTCEngine) Join ¶
func (e *RTCEngine) Join(url string, token string, params *SignalClientConnectParams) (*livekit.JoinResponse, error)
func (*RTCEngine) Publisher ¶ added in v2.0.4
func (e *RTCEngine) Publisher() (*PCTransport, bool)
func (*RTCEngine) RegisterTrackPublishedListener ¶ added in v2.3.1
func (e *RTCEngine) RegisterTrackPublishedListener(cid string, c chan *livekit.TrackPublishedResponse)
func (*RTCEngine) SetLogger ¶ added in v2.2.1
func (e *RTCEngine) SetLogger(l protoLogger.Logger)
SetLogger overrides default logger.
func (*RTCEngine) Subscriber ¶ added in v2.0.4
func (e *RTCEngine) Subscriber() (*PCTransport, bool)
func (*RTCEngine) UnregisterTrackPublishedListener ¶ added in v2.3.1
type ReaderSampleProvider ¶
type ReaderSampleProvider struct { // Configuration Mime string FrameDuration time.Duration OnWriteComplete func() AudioLevel uint8 // contains filtered or unexported fields }
ReaderSampleProvider provides samples by reading from an io.ReadCloser implementation
func (*ReaderSampleProvider) Close ¶
func (p *ReaderSampleProvider) Close() error
func (*ReaderSampleProvider) CurrentAudioLevel ¶
func (p *ReaderSampleProvider) CurrentAudioLevel() uint8
func (*ReaderSampleProvider) NextSample ¶
func (*ReaderSampleProvider) OnBind ¶
func (p *ReaderSampleProvider) OnBind() error
func (*ReaderSampleProvider) OnUnbind ¶
func (p *ReaderSampleProvider) OnUnbind() error
type ReaderSampleProviderOption ¶
type ReaderSampleProviderOption func(*ReaderSampleProvider)
type RemoteParticipant ¶
type RemoteParticipant struct {
// contains filtered or unexported fields
}
func (*RemoteParticipant) Attributes ¶ added in v2.2.1
func (*RemoteParticipant) AudioLevel ¶
func (p *RemoteParticipant) AudioLevel() float32
func (*RemoteParticipant) GetTrackPublication ¶
func (p *RemoteParticipant) GetTrackPublication(source livekit.TrackSource) TrackPublication
func (*RemoteParticipant) IsCameraEnabled ¶
func (p *RemoteParticipant) IsCameraEnabled() bool
func (*RemoteParticipant) IsMicrophoneEnabled ¶
func (p *RemoteParticipant) IsMicrophoneEnabled() bool
func (*RemoteParticipant) IsScreenShareAudioEnabled ¶
func (p *RemoteParticipant) IsScreenShareAudioEnabled() bool
func (*RemoteParticipant) IsScreenShareEnabled ¶
func (p *RemoteParticipant) IsScreenShareEnabled() bool
func (*RemoteParticipant) IsSpeaking ¶
func (p *RemoteParticipant) IsSpeaking() bool
func (*RemoteParticipant) Kind ¶
func (p *RemoteParticipant) Kind() ParticipantKind
func (*RemoteParticipant) Permissions ¶
func (p *RemoteParticipant) Permissions() *livekit.ParticipantPermission
func (*RemoteParticipant) TrackPublications ¶
func (p *RemoteParticipant) TrackPublications() []TrackPublication
func (*RemoteParticipant) WritePLI ¶
func (p *RemoteParticipant) WritePLI(ssrc webrtc.SSRC)
type RemoteTrackPublication ¶
type RemoteTrackPublication struct {
// contains filtered or unexported fields
}
func (*RemoteTrackPublication) IsEnabled ¶
func (p *RemoteTrackPublication) IsEnabled() bool
func (*RemoteTrackPublication) IsSubscribed ¶
func (p *RemoteTrackPublication) IsSubscribed() bool
func (*RemoteTrackPublication) OnRTCP ¶
func (p *RemoteTrackPublication) OnRTCP(cb func(rtcp.Packet))
func (*RemoteTrackPublication) Receiver ¶
func (p *RemoteTrackPublication) Receiver() *webrtc.RTPReceiver
func (*RemoteTrackPublication) SetEnabled ¶
func (p *RemoteTrackPublication) SetEnabled(enabled bool)
func (*RemoteTrackPublication) SetSubscribed ¶
func (p *RemoteTrackPublication) SetSubscribed(subscribed bool) error
func (*RemoteTrackPublication) SetVideoDimensions ¶
func (p *RemoteTrackPublication) SetVideoDimensions(width uint32, height uint32)
func (*RemoteTrackPublication) SetVideoQuality ¶
func (p *RemoteTrackPublication) SetVideoQuality(quality livekit.VideoQuality) error
func (*RemoteTrackPublication) Source ¶
func (p *RemoteTrackPublication) Source() livekit.TrackSource
func (*RemoteTrackPublication) TrackRemote ¶
func (p *RemoteTrackPublication) TrackRemote() *webrtc.TrackRemote
type Room ¶
type Room struct { LocalParticipant *LocalParticipant // contains filtered or unexported fields }
func ConnectToRoom ¶
func ConnectToRoom(url string, info ConnectInfo, callback *RoomCallback, opts ...ConnectOption) (*Room, error)
ConnectToRoom creates and joins the room
func ConnectToRoomWithToken ¶
func ConnectToRoomWithToken(url, token string, callback *RoomCallback, opts ...ConnectOption) (*Room, error)
ConnectToRoomWithToken creates and joins the room
func NewRoom ¶
func NewRoom(callback *RoomCallback) *Room
NewRoom can be used to update callbacks before calling Join
func (*Room) ActiveSpeakers ¶
func (r *Room) ActiveSpeakers() []Participant
func (*Room) ConnectionState ¶ added in v2.2.0
func (r *Room) ConnectionState() ConnectionState
func (*Room) Disconnect ¶
func (r *Room) Disconnect()
func (*Room) DisconnectWithReason ¶ added in v2.3.0
func (r *Room) DisconnectWithReason(reason livekit.DisconnectReason)
func (*Room) GetParticipantByIdentity ¶
func (r *Room) GetParticipantByIdentity(identity string) *RemoteParticipant
func (*Room) GetParticipantBySID ¶
func (r *Room) GetParticipantBySID(sid string) *RemoteParticipant
func (*Room) GetRemoteParticipants ¶
func (r *Room) GetRemoteParticipants() []*RemoteParticipant
func (*Room) Join ¶
func (r *Room) Join(url string, info ConnectInfo, opts ...ConnectOption) error
Join - joins the room as with default permissions
func (*Room) JoinWithToken ¶
func (r *Room) JoinWithToken(url, token string, opts ...ConnectOption) error
JoinWithToken - customize participant options by generating your own token
func (*Room) PrepareConnection ¶ added in v2.2.1
PrepareConnection - with LiveKit Cloud, determine the best edge data center for the current client to connect to
func (*Room) ServerInfo ¶
func (r *Room) ServerInfo() *livekit.ServerInfo
func (*Room) SetLogger ¶ added in v2.2.1
func (r *Room) SetLogger(l protoLogger.Logger)
SetLogger overrides default logger.
func (*Room) Simulate ¶
func (r *Room) Simulate(scenario SimulateScenario)
type RoomCallback ¶
type RoomCallback struct { OnDisconnected func() OnDisconnectedWithReason func(reason DisconnectionReason) OnParticipantConnected func(*RemoteParticipant) OnParticipantDisconnected func(*RemoteParticipant) OnActiveSpeakersChanged func([]Participant) OnRoomMetadataChanged func(metadata string) OnReconnecting func() OnReconnected func() // participant events are sent to the room as well ParticipantCallback }
func NewRoomCallback ¶
func NewRoomCallback() *RoomCallback
func (*RoomCallback) Merge ¶
func (cb *RoomCallback) Merge(other *RoomCallback)
type RoomServiceClient ¶
type RoomServiceClient struct {
// contains filtered or unexported fields
}
func NewRoomServiceClient ¶
func NewRoomServiceClient(url string, apiKey string, secretKey string, opts ...twirp.ClientOption) *RoomServiceClient
func (*RoomServiceClient) CreateRoom ¶
func (c *RoomServiceClient) CreateRoom(ctx context.Context, req *livekit.CreateRoomRequest) (*livekit.Room, error)
func (*RoomServiceClient) CreateToken ¶
func (c *RoomServiceClient) CreateToken() *auth.AccessToken
func (*RoomServiceClient) DeleteRoom ¶
func (c *RoomServiceClient) DeleteRoom(ctx context.Context, req *livekit.DeleteRoomRequest) (*livekit.DeleteRoomResponse, error)
func (*RoomServiceClient) GetParticipant ¶
func (c *RoomServiceClient) GetParticipant(ctx context.Context, req *livekit.RoomParticipantIdentity) (*livekit.ParticipantInfo, error)
func (*RoomServiceClient) ListParticipants ¶
func (c *RoomServiceClient) ListParticipants(ctx context.Context, req *livekit.ListParticipantsRequest) (*livekit.ListParticipantsResponse, error)
func (*RoomServiceClient) ListRooms ¶
func (c *RoomServiceClient) ListRooms(ctx context.Context, req *livekit.ListRoomsRequest) (*livekit.ListRoomsResponse, error)
func (*RoomServiceClient) MutePublishedTrack ¶
func (c *RoomServiceClient) MutePublishedTrack(ctx context.Context, req *livekit.MuteRoomTrackRequest) (*livekit.MuteRoomTrackResponse, error)
func (*RoomServiceClient) RemoveParticipant ¶
func (c *RoomServiceClient) RemoveParticipant(ctx context.Context, req *livekit.RoomParticipantIdentity) (*livekit.RemoveParticipantResponse, error)
func (*RoomServiceClient) SendData ¶
func (c *RoomServiceClient) SendData(ctx context.Context, req *livekit.SendDataRequest) (*livekit.SendDataResponse, error)
func (*RoomServiceClient) UpdateParticipant ¶
func (c *RoomServiceClient) UpdateParticipant(ctx context.Context, req *livekit.UpdateParticipantRequest) (*livekit.ParticipantInfo, error)
func (*RoomServiceClient) UpdateRoomMetadata ¶
func (c *RoomServiceClient) UpdateRoomMetadata(ctx context.Context, req *livekit.UpdateRoomMetadataRequest) (*livekit.Room, error)
func (*RoomServiceClient) UpdateSubscriptions ¶
func (c *RoomServiceClient) UpdateSubscriptions(ctx context.Context, req *livekit.UpdateSubscriptionsRequest) (*livekit.UpdateSubscriptionsResponse, error)
type SIPClient ¶
type SIPClient struct {
// contains filtered or unexported fields
}
func NewSIPClient ¶
func NewSIPClient(url string, apiKey string, secretKey string, opts ...twirp.ClientOption) *SIPClient
NewSIPClient creates a LiveKit SIP client.
func (*SIPClient) CreateSIPDispatchRule ¶
func (s *SIPClient) CreateSIPDispatchRule(ctx context.Context, in *livekit.CreateSIPDispatchRuleRequest) (*livekit.SIPDispatchRuleInfo, error)
CreateSIPDispatchRule creates SIP Dispatch Rules.
func (*SIPClient) CreateSIPInboundTrunk ¶ added in v2.2.0
func (s *SIPClient) CreateSIPInboundTrunk(ctx context.Context, in *livekit.CreateSIPInboundTrunkRequest) (*livekit.SIPInboundTrunkInfo, error)
CreateSIPInboundTrunk creates a new SIP Trunk for accepting inbound calls to LiveKit.
func (*SIPClient) CreateSIPOutboundTrunk ¶ added in v2.2.0
func (s *SIPClient) CreateSIPOutboundTrunk(ctx context.Context, in *livekit.CreateSIPOutboundTrunkRequest) (*livekit.SIPOutboundTrunkInfo, error)
CreateSIPOutboundTrunk creates a new SIP Trunk for making outbound calls from LiveKit.
func (*SIPClient) CreateSIPParticipant ¶
func (s *SIPClient) CreateSIPParticipant(ctx context.Context, in *livekit.CreateSIPParticipantRequest) (*livekit.SIPParticipantInfo, error)
CreateSIPParticipant creates SIP Participant by making an outbound call.
func (*SIPClient) DeleteSIPDispatchRule ¶
func (s *SIPClient) DeleteSIPDispatchRule(ctx context.Context, in *livekit.DeleteSIPDispatchRuleRequest) (*livekit.SIPDispatchRuleInfo, error)
DeleteSIPDispatchRule deletes SIP Dispatch Rule given an ID.
func (*SIPClient) DeleteSIPTrunk ¶
func (s *SIPClient) DeleteSIPTrunk(ctx context.Context, in *livekit.DeleteSIPTrunkRequest) (*livekit.SIPTrunkInfo, error)
DeleteSIPTrunk deletes SIP Trunk given an ID.
func (*SIPClient) ListSIPDispatchRule ¶
func (s *SIPClient) ListSIPDispatchRule(ctx context.Context, in *livekit.ListSIPDispatchRuleRequest) (*livekit.ListSIPDispatchRuleResponse, error)
ListSIPDispatchRule lists SIP Dispatch Rules.
func (*SIPClient) ListSIPInboundTrunk ¶ added in v2.2.0
func (s *SIPClient) ListSIPInboundTrunk(ctx context.Context, in *livekit.ListSIPInboundTrunkRequest) (*livekit.ListSIPInboundTrunkResponse, error)
ListSIPInboundTrunk lists SIP Trunks accepting inbound calls.
func (*SIPClient) ListSIPOutboundTrunk ¶ added in v2.2.0
func (s *SIPClient) ListSIPOutboundTrunk(ctx context.Context, in *livekit.ListSIPOutboundTrunkRequest) (*livekit.ListSIPOutboundTrunkResponse, error)
ListSIPOutboundTrunk lists SIP Trunks for making outbound calls.
func (*SIPClient) ListSIPTrunk
deprecated
func (s *SIPClient) ListSIPTrunk(ctx context.Context, in *livekit.ListSIPTrunkRequest) (*livekit.ListSIPTrunkResponse, error)
ListSIPTrunk lists SIP Trunks.
Deprecated: Use ListSIPInboundTrunk or ListSIPOutboundTrunk
func (*SIPClient) TransferSIPParticipant ¶ added in v2.3.0
func (s *SIPClient) TransferSIPParticipant(ctx context.Context, in *livekit.TransferSIPParticipantRequest) (*emptypb.Empty, error)
TransferSIPParticipant transfer an existing SIP participant to an outside SIP endpoint.
type SampleProvider ¶
type SampleWriteOptions ¶
type SampleWriteOptions struct {
AudioLevel *uint8
}
type SignalClient ¶
type SignalClient struct { OnClose func() OnAnswer func(sd webrtc.SessionDescription) OnOffer func(sd webrtc.SessionDescription) OnTrickle func(init webrtc.ICECandidateInit, target livekit.SignalTarget) OnParticipantUpdate func([]*livekit.ParticipantInfo) OnLocalTrackPublished func(response *livekit.TrackPublishedResponse) OnSpeakersChanged func([]*livekit.SpeakerInfo) OnConnectionQuality func([]*livekit.ConnectionQualityInfo) OnRoomUpdate func(room *livekit.Room) OnTrackRemoteMuted func(request *livekit.MuteTrackRequest) OnLocalTrackUnpublished func(response *livekit.TrackUnpublishedResponse) OnTokenRefresh func(refreshToken string) OnLeave func(*livekit.LeaveRequest) // contains filtered or unexported fields }
func NewSignalClient ¶
func NewSignalClient() *SignalClient
func (*SignalClient) Close ¶
func (c *SignalClient) Close()
func (*SignalClient) IsStarted ¶
func (c *SignalClient) IsStarted() bool
func (*SignalClient) Join ¶
func (c *SignalClient) Join(urlPrefix string, token string, params SignalClientConnectParams) (*livekit.JoinResponse, error)
func (*SignalClient) Reconnect ¶
func (c *SignalClient) Reconnect(urlPrefix string, token string, params SignalClientConnectParams, participantSID string) (*livekit.ReconnectResponse, error)
Reconnect starts a new WebSocket connection to the server, passing in reconnect=1 when successful, it'll return a ReconnectResponse; older versions of the server will not send back a ReconnectResponse
func (*SignalClient) SendAnswer ¶
func (c *SignalClient) SendAnswer(sd webrtc.SessionDescription) error
func (*SignalClient) SendICECandidate ¶
func (c *SignalClient) SendICECandidate(candidate webrtc.ICECandidateInit, target livekit.SignalTarget) error
func (*SignalClient) SendLeave ¶
func (c *SignalClient) SendLeave() error
func (*SignalClient) SendLeaveWithReason ¶ added in v2.3.0
func (c *SignalClient) SendLeaveWithReason(reason livekit.DisconnectReason) error
func (*SignalClient) SendMuteTrack ¶
func (c *SignalClient) SendMuteTrack(sid string, muted bool) error
func (*SignalClient) SendOffer ¶
func (c *SignalClient) SendOffer(sd webrtc.SessionDescription) error
func (*SignalClient) SendRequest ¶
func (c *SignalClient) SendRequest(req *livekit.SignalRequest) error
func (*SignalClient) SendSyncState ¶
func (c *SignalClient) SendSyncState(state *livekit.SyncState) error
func (*SignalClient) SendUpdateParticipantMetadata ¶
func (c *SignalClient) SendUpdateParticipantMetadata(metadata *livekit.UpdateParticipantMetadata) error
func (*SignalClient) SendUpdateTrackSettings ¶
func (c *SignalClient) SendUpdateTrackSettings(settings *livekit.UpdateTrackSettings) error
func (*SignalClient) SetLogger ¶ added in v2.2.1
func (c *SignalClient) SetLogger(l protoLogger.Logger)
SetLogger overrides default logger.
func (*SignalClient) Start ¶
func (c *SignalClient) Start()
type SignalClientConnectParams ¶ added in v2.3.1
type SignalClientConnectParams struct { AutoSubscribe bool Reconnect bool DisableRegionDiscovery bool RetransmitBufferSize uint16 Pacer pacer.Factory Interceptors []interceptor.Factory ICETransportPolicy webrtc.ICETransportPolicy }
not exposed to users. clients should use ConnectOption
type SimulateScenario ¶
type SimulateScenario int
const ( SimulateSignalReconnect SimulateScenario = iota SimulateForceTCP SimulateForceTLS SimulateSpeakerUpdate SimulateMigration SimulateServerLeave SimulateNodeFailure )
type SimulcastTrack ¶
type SimulcastTrack struct {
// contains filtered or unexported fields
}
func NewSimulcastTrack ¶
func NewSimulcastTrack(trackLocal webrtc.TrackLocal, videoLayer *livekit.VideoLayer) *SimulcastTrack
func (*SimulcastTrack) Quality ¶
func (t *SimulcastTrack) Quality() livekit.VideoQuality
func (*SimulcastTrack) TrackLocal ¶
func (t *SimulcastTrack) TrackLocal() webrtc.TrackLocal
func (*SimulcastTrack) VideoLayer ¶
func (t *SimulcastTrack) VideoLayer() *livekit.VideoLayer
type TrackKind ¶
type TrackKind string
func KindFromRTPType ¶
func KindFromRTPType(rt webrtc.RTPCodecType) TrackKind
type TrackPubCallback ¶
type TrackPubCallback func(track Track, pub TrackPublication, participant *RemoteParticipant)
type TrackPublication ¶
type TrackPublication interface { Name() string SID() string Source() livekit.TrackSource Kind() TrackKind MimeType() string IsMuted() bool IsSubscribed() bool TrackInfo() *livekit.TrackInfo // Track is either a webrtc.TrackLocal or webrtc.TrackRemote Track() Track // contains filtered or unexported methods }
type TrackPublicationOptions ¶
type TrackPublicationOptions struct { Name string Source livekit.TrackSource // Set dimensions for video VideoWidth int VideoHeight int // Opus only DisableDTX bool Stereo bool // which stream the track belongs to, used to group tracks together. // if not specified, server will infer it from track source to bundle camera/microphone, screenshare/audio together Stream string }
type UserDataPacket ¶ added in v2.0.5
UserDataPacket is a custom user data that can be sent via WebRTC on a custom topic.
func UserData ¶ added in v2.0.5
func UserData(data []byte) *UserDataPacket
UserData is a custom user data that can be sent via WebRTC.
func (*UserDataPacket) ToProto ¶ added in v2.0.5
func (p *UserDataPacket) ToProto() *livekit.DataPacket
ToProto implements DataPacket.
Source Files ¶
- agent_dispatch_client.go
- auth.go
- callback.go
- data.go
- egressclient.go
- engine.go
- errors.go
- ingressclient.go
- localparticipant.go
- localtrack.go
- logger.go
- participant.go
- publication.go
- readersampleprovider.go
- regionurlprovider.go
- remoteparticipant.go
- room.go
- roomclient.go
- sampleprovider.go
- signalclient.go
- sipclient.go
- track.go
- transport.go
- utils.go
- version.go
Directories ¶
Path | Synopsis |
---|---|
examples
|
|
pkg
|
|
samplebuilder
Package samplebuilder builds media frames from RTP packets.
|
Package samplebuilder builds media frames from RTP packets. |