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 SetLogger(l logr.Logger)
- func ToProtoSessionDescription(sd webrtc.SessionDescription) *livekit.SessionDescription
- func ToProtoTrickle(candidateInit webrtc.ICECandidateInit, target livekit.SignalTarget) *livekit.TrickleRequest
- type ConnectInfo
- type LoadTestProvider
- type LocalParticipant
- func (p *LocalParticipant) AudioLevel() float32
- func (p *LocalParticipant) Identity() string
- func (p *LocalParticipant) IsSpeaking() bool
- func (p *LocalParticipant) PublishTrack(track webrtc.TrackLocal, name string) (*LocalTrackPublication, error)
- func (p *LocalParticipant) SID() string
- func (p *LocalParticipant) Tracks() []TrackPublication
- type LocalSampleTrack
- type LocalTrackPublication
- func (p *LocalTrackPublication) IsMuted() bool
- func (p *LocalTrackPublication) IsSubscribed() bool
- func (p *LocalTrackPublication) Kind() TrackKind
- func (p *LocalTrackPublication) Name() string
- func (p *LocalTrackPublication) SID() string
- func (p *LocalTrackPublication) SetMuted(muted bool)
- func (p *LocalTrackPublication) Track() Track
- func (p *LocalTrackPublication) TrackLocal() webrtc.TrackLocal
- type NullSampleProvider
- type PCTransport
- func (t *PCTransport) AddICECandidate(candidate webrtc.ICECandidateInit) error
- func (t *PCTransport) Close() error
- func (t *PCTransport) IsConnected() bool
- func (t *PCTransport) OnNegotiationNeeded(f func())
- func (t *PCTransport) PeerConnection() *webrtc.PeerConnection
- func (t *PCTransport) SetRemoteDescription(sd webrtc.SessionDescription) error
- type Participant
- type ParticipantCallback
- type PubCallback
- type RTCEngine
- type RemoteParticipant
- type RemoteTrackPublication
- func (p *RemoteTrackPublication) IsMuted() bool
- func (p *RemoteTrackPublication) IsSubscribed() bool
- func (p *RemoteTrackPublication) Kind() TrackKind
- func (p *RemoteTrackPublication) Name() string
- func (p *RemoteTrackPublication) Receiver() *webrtc.RTPReceiver
- func (p *RemoteTrackPublication) SID() string
- func (p *RemoteTrackPublication) Track() Track
- func (p *RemoteTrackPublication) TrackRemote() *webrtc.TrackRemote
- type Room
- 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) UpdateParticipant(ctx context.Context, req *livekit.UpdateParticipantRequest) (*livekit.ParticipantInfo, error)
- func (c *RoomServiceClient) UpdateSubscriptions(ctx context.Context, req *livekit.UpdateSubscriptionsRequest) (*livekit.UpdateSubscriptionsResponse, error)
- type SampleProvider
- type SignalClient
- func (c *SignalClient) Close()
- func (c *SignalClient) IsConnected() bool
- func (c *SignalClient) Join(urlPrefix string, token string) (*livekit.JoinResponse, error)
- func (c *SignalClient) ReadResponse() (*livekit.SignalResponse, 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) SendMuteTrack(sid string, muted bool) error
- func (c *SignalClient) SendOffer(sd webrtc.SessionDescription) error
- func (c *SignalClient) SendRequest(req *livekit.SignalRequest) error
- type Track
- type TrackKind
- type TrackPubCallback
- type TrackPublication
- type TrackPublicationOptions
Constants ¶
View Source
const PROTOCOL = 2
Variables ¶
View Source
var ( ErrConnectionTimeout = errors.New("could not connect after timeout") ErrTrackPublishTimeout = errors.New("timed out publishing track") )
Functions ¶
func FromProtoIceServers ¶
func FromProtoSessionDescription ¶
func FromProtoSessionDescription(sd *livekit.SessionDescription) webrtc.SessionDescription
func FromProtoTrickle ¶
func FromProtoTrickle(trickle *livekit.TrickleRequest) webrtc.ICECandidateInit
func SetLogger ¶
SetLogger overrides logger with a logr implementation https://github.com/go-logr/logr
func ToProtoSessionDescription ¶
func ToProtoSessionDescription(sd webrtc.SessionDescription) *livekit.SessionDescription
func ToProtoTrickle ¶
func ToProtoTrickle(candidateInit webrtc.ICECandidateInit, target livekit.SignalTarget) *livekit.TrickleRequest
Types ¶
type ConnectInfo ¶
type LoadTestProvider ¶ added in v0.5.6
func NewLoadTestProvider ¶ added in v0.5.6
func NewLoadTestProvider(bitrate uint32) (*LoadTestProvider, error)
func (*LoadTestProvider) NextSample ¶ added in v0.5.6
func (p *LoadTestProvider) NextSample() (media.Sample, error)
type LocalParticipant ¶
type LocalParticipant struct {
// contains filtered or unexported fields
}
func (*LocalParticipant) AudioLevel ¶
func (p *LocalParticipant) AudioLevel() float32
func (*LocalParticipant) IsSpeaking ¶ added in v0.5.0
func (p *LocalParticipant) IsSpeaking() bool
func (*LocalParticipant) PublishTrack ¶ added in v0.5.2
func (p *LocalParticipant) PublishTrack(track webrtc.TrackLocal, name string) (*LocalTrackPublication, error)
func (*LocalParticipant) Tracks ¶ added in v0.5.3
func (p *LocalParticipant) Tracks() []TrackPublication
type LocalSampleTrack ¶ added in v0.5.2
type LocalSampleTrack struct { webrtc.TrackLocalStaticSample // contains filtered or unexported fields }
LocalSampleTrack 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
func NewLocalSampleTrack ¶ added in v0.5.2
func NewLocalSampleTrack(c webrtc.RTPCodecCapability, sampleProvider SampleProvider) (*LocalSampleTrack, error)
func (*LocalSampleTrack) Bind ¶ added in v0.5.2
func (s *LocalSampleTrack) Bind(t webrtc.TrackLocalContext) (webrtc.RTPCodecParameters, error)
func (*LocalSampleTrack) Unbind ¶ added in v0.5.2
func (s *LocalSampleTrack) Unbind(t webrtc.TrackLocalContext) error
type LocalTrackPublication ¶ added in v0.5.0
type LocalTrackPublication struct {
// contains filtered or unexported fields
}
func (*LocalTrackPublication) IsMuted ¶ added in v0.5.0
func (p *LocalTrackPublication) IsMuted() bool
func (*LocalTrackPublication) IsSubscribed ¶ added in v0.5.0
func (p *LocalTrackPublication) IsSubscribed() bool
func (*LocalTrackPublication) Kind ¶ added in v0.5.0
func (p *LocalTrackPublication) Kind() TrackKind
func (*LocalTrackPublication) SetMuted ¶ added in v0.5.0
func (p *LocalTrackPublication) SetMuted(muted bool)
func (*LocalTrackPublication) TrackLocal ¶ added in v0.5.0
func (p *LocalTrackPublication) TrackLocal() webrtc.TrackLocal
type NullSampleProvider ¶ added in v0.5.2
NullSampleProvider is a media provider that provides null packets, it could meet a certain bitrate, if desired
func NewNullSampleProvider ¶ added in v0.5.2
func NewNullSampleProvider(bitrate uint32) *NullSampleProvider
func (*NullSampleProvider) NextSample ¶ added in v0.5.2
func (p *NullSampleProvider) NextSample() (media.Sample, error)
type PCTransport ¶
type PCTransport struct {
// contains filtered or unexported fields
}
PCTransport is a wrapper around PeerConnection, with some helper methods
func NewPCTransport ¶
func NewPCTransport(iceServers []webrtc.ICEServer) (*PCTransport, error)
func (*PCTransport) AddICECandidate ¶
func (t *PCTransport) AddICECandidate(candidate webrtc.ICECandidateInit) error
func (*PCTransport) Close ¶
func (t *PCTransport) Close() error
func (*PCTransport) IsConnected ¶
func (t *PCTransport) IsConnected() bool
func (*PCTransport) OnNegotiationNeeded ¶
func (t *PCTransport) OnNegotiationNeeded(f func())
func (*PCTransport) PeerConnection ¶
func (t *PCTransport) PeerConnection() *webrtc.PeerConnection
func (*PCTransport) SetRemoteDescription ¶
func (t *PCTransport) SetRemoteDescription(sd webrtc.SessionDescription) error
type Participant ¶
type Participant interface { SID() string Identity() string IsSpeaking() bool AudioLevel() float32 Tracks() []TrackPublication // contains filtered or unexported methods }
type ParticipantCallback ¶ added in v0.5.0
type ParticipantCallback struct { // for all participants OnTrackMuted func(pub TrackPublication, p Participant) OnTrackUnmuted func(pub TrackPublication, p Participant) OnMetadataChanged func(oldMetadata string, p Participant) OnIsSpeakingChanged func(p Participant) // for remote participants OnTrackSubscribed func(track *webrtc.TrackRemote, publication TrackPublication, rp *RemoteParticipant) OnTrackUnsubscribed func(track *webrtc.TrackRemote, publication TrackPublication, rp *RemoteParticipant) OnTrackSubscriptionFailed func(sid string, rp *RemoteParticipant) OnTrackPublished func(publication TrackPublication, rp *RemoteParticipant) OnTrackUnpublished func(publication TrackPublication, rp *RemoteParticipant) OnDataReceived func(data []byte, rp *RemoteParticipant) }
func NewParticipantCallback ¶ added in v0.5.0
func NewParticipantCallback() *ParticipantCallback
type PubCallback ¶
type PubCallback func(pub TrackPublication, participant *RemoteParticipant)
type RTCEngine ¶
type RTCEngine struct { JoinTimeout time.Duration // callbacks OnDisconnected func() OnMediaTrack func(track *webrtc.TrackRemote, receiver *webrtc.RTPReceiver) OnParticipantUpdate func([]*livekit.ParticipantInfo) OnActiveSpeakersChanged func([]*livekit.SpeakerInfo) // contains filtered or unexported fields }
func NewRTCEngine ¶
func NewRTCEngine() *RTCEngine
func (*RTCEngine) IsConnected ¶
func (*RTCEngine) TrackPublishedChan ¶ added in v0.5.2
func (e *RTCEngine) TrackPublishedChan() <-chan *livekit.TrackPublishedResponse
type RemoteParticipant ¶
type RemoteParticipant struct {
// contains filtered or unexported fields
}
func (*RemoteParticipant) AudioLevel ¶
func (p *RemoteParticipant) AudioLevel() float32
func (*RemoteParticipant) IsSpeaking ¶ added in v0.5.0
func (p *RemoteParticipant) IsSpeaking() bool
func (*RemoteParticipant) Tracks ¶ added in v0.5.3
func (p *RemoteParticipant) Tracks() []TrackPublication
type RemoteTrackPublication ¶ added in v0.5.0
type RemoteTrackPublication struct {
// contains filtered or unexported fields
}
func (*RemoteTrackPublication) IsMuted ¶ added in v0.5.0
func (p *RemoteTrackPublication) IsMuted() bool
func (*RemoteTrackPublication) IsSubscribed ¶ added in v0.5.0
func (p *RemoteTrackPublication) IsSubscribed() bool
func (*RemoteTrackPublication) Kind ¶ added in v0.5.0
func (p *RemoteTrackPublication) Kind() TrackKind
func (*RemoteTrackPublication) Name ¶ added in v0.5.0
func (p *RemoteTrackPublication) Name() string
func (*RemoteTrackPublication) Receiver ¶ added in v0.5.0
func (p *RemoteTrackPublication) Receiver() *webrtc.RTPReceiver
func (*RemoteTrackPublication) Track ¶ added in v0.5.0
func (p *RemoteTrackPublication) Track() Track
func (*RemoteTrackPublication) TrackRemote ¶ added in v0.5.0
func (p *RemoteTrackPublication) TrackRemote() *webrtc.TrackRemote
type Room ¶
type Room struct { SID string Name string LocalParticipant *LocalParticipant Participants map[string]*RemoteParticipant ActiveSpeakers []Participant Callback *RoomCallback // contains filtered or unexported fields }
func ConnectToRoom ¶
func ConnectToRoom(url string, info ConnectInfo) (*Room, error)
func ConnectToRoomWithToken ¶
func (*Room) Disconnect ¶
func (r *Room) Disconnect()
func (*Room) GetParticipant ¶
func (r *Room) GetParticipant(sid string) *RemoteParticipant
func (*Room) GetParticipants ¶ added in v0.5.4
func (r *Room) GetParticipants() []*RemoteParticipant
type RoomCallback ¶ added in v0.5.0
type RoomCallback struct { OnDisconnected func() OnParticipantConnected func(*RemoteParticipant) OnParticipantDisconnected func(*RemoteParticipant) OnActiveSpeakersChanged func([]Participant) ParticipantCallback }
func NewRoomCallback ¶ added in v0.5.0
func NewRoomCallback() *RoomCallback
type RoomServiceClient ¶
type RoomServiceClient struct { livekit.RoomService // contains filtered or unexported fields }
func NewRoomServiceClient ¶
func NewRoomServiceClient(url string, apiKey string, secretKey string) *RoomServiceClient
func (*RoomServiceClient) CreateRoom ¶
func (c *RoomServiceClient) CreateRoom(ctx context.Context, req *livekit.CreateRoomRequest) (*livekit.Room, error)
func (*RoomServiceClient) CreateToken ¶ added in v0.1.2
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) UpdateParticipant ¶ added in v0.1.4
func (c *RoomServiceClient) UpdateParticipant(ctx context.Context, req *livekit.UpdateParticipantRequest) (*livekit.ParticipantInfo, error)
func (*RoomServiceClient) UpdateSubscriptions ¶ added in v0.5.8
func (c *RoomServiceClient) UpdateSubscriptions(ctx context.Context, req *livekit.UpdateSubscriptionsRequest) (*livekit.UpdateSubscriptionsResponse, error)
type SampleProvider ¶ added in v0.5.2
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) OnActiveSpeakersChanged func([]*livekit.SpeakerInfo) OnLeave func() // contains filtered or unexported fields }
func NewSignalClient ¶
func NewSignalClient() *SignalClient
func (*SignalClient) Close ¶
func (c *SignalClient) Close()
func (*SignalClient) IsConnected ¶
func (c *SignalClient) IsConnected() bool
func (*SignalClient) Join ¶
func (c *SignalClient) Join(urlPrefix string, token string) (*livekit.JoinResponse, error)
func (*SignalClient) ReadResponse ¶
func (c *SignalClient) ReadResponse() (*livekit.SignalResponse, error)
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 ¶ added in v0.5.0
func (c *SignalClient) SendLeave() error
func (*SignalClient) SendMuteTrack ¶ added in v0.5.0
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
type TrackKind ¶
type TrackKind string
func KindFromRTPType ¶ added in v0.5.2
func KindFromRTPType(rt webrtc.RTPCodecType) TrackKind
type TrackPubCallback ¶
type TrackPubCallback func(track Track, pub TrackPublication, participant *RemoteParticipant)
type TrackPublication ¶
type TrackPublicationOptions ¶ added in v0.5.2
type TrackPublicationOptions struct {
Name string
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.