Documentation ¶
Index ¶
- Constants
- Variables
- func FileTrackWithFrameDuration(duration time.Duration) func(provider *FileSampleProvider)
- func FileTrackWithMime(mime string) func(provider *FileSampleProvider)
- func FileTrackWithOnWriteComplete(f func()) func(provider *FileSampleProvider)
- 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 AudioSampleProvider
- type ConnectInfo
- type ConnectOption
- type ConnectParams
- type FileSampleProvider
- type FileSampleProviderOption
- type LoadTestProvider
- type LocalParticipant
- func (p *LocalParticipant) AudioLevel() float32
- func (p *LocalParticipant) GetTrack(source livekit.TrackSource) TrackPublication
- func (p *LocalParticipant) Identity() string
- func (p *LocalParticipant) IsCameraEnabled() bool
- func (p *LocalParticipant) IsMicrophoneEnabled() bool
- func (p *LocalParticipant) IsScreenShareEnabled() bool
- func (p *LocalParticipant) IsSpeaking() bool
- func (p *LocalParticipant) Metadata() string
- func (p *LocalParticipant) Name() string
- func (p *LocalParticipant) PublishData(data []byte, kind livekit.DataPacket_Kind, destinationSids []string) error
- func (p *LocalParticipant) PublishTrack(track webrtc.TrackLocal, name string) (*LocalTrackPublication, error)
- func (p *LocalParticipant) SID() string
- func (p *LocalParticipant) Tracks() []TrackPublication
- func (p *LocalParticipant) UnpublishTrack(sid string) error
- type LocalSampleTrack
- func (s *LocalSampleTrack) Bind(t webrtc.TrackLocalContext) (webrtc.RTPCodecParameters, error)
- func (s *LocalSampleTrack) Codec() webrtc.RTPCodecCapability
- func (s *LocalSampleTrack) ID() string
- func (s *LocalSampleTrack) IsBound() bool
- func (s *LocalSampleTrack) Kind() webrtc.RTPCodecType
- func (s *LocalSampleTrack) OnBind(f func())
- func (s *LocalSampleTrack) OnUnbind(f func())
- func (s *LocalSampleTrack) StartWrite(provider SampleProvider, onComplete func()) error
- func (s *LocalSampleTrack) StreamID() string
- func (s *LocalSampleTrack) Unbind(t webrtc.TrackLocalContext) error
- func (s *LocalSampleTrack) WriteSample(sample media.Sample, opts *SampleWriteOptions) error
- type LocalTrackPublication
- 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) SID() string
- func (p *LocalTrackPublication) SetMuted(muted bool)
- func (p *LocalTrackPublication) Source() livekit.TrackSource
- 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) Negotiate()
- func (t *PCTransport) PeerConnection() *webrtc.PeerConnection
- func (t *PCTransport) SetRemoteDescription(sd webrtc.SessionDescription) error
- type Participant
- type ParticipantCallback
- type PubCallback
- type RTCEngine
- type RecordingServiceClient
- func (c *RecordingServiceClient) AddOutput(ctx context.Context, req *livekit.AddOutputRequest) (*emptypb.Empty, error)
- func (c *RecordingServiceClient) EndRecording(ctx context.Context, req *livekit.EndRecordingRequest) (*emptypb.Empty, error)
- func (c *RecordingServiceClient) RemoveOutput(ctx context.Context, req *livekit.RemoveOutputRequest) (*emptypb.Empty, error)
- func (c *RecordingServiceClient) StartRecording(ctx context.Context, req *livekit.StartRecordingRequest) (*livekit.StartRecordingResponse, error)
- type RemoteParticipant
- func (p *RemoteParticipant) AudioLevel() float32
- func (p *RemoteParticipant) GetTrack(source livekit.TrackSource) TrackPublication
- func (p *RemoteParticipant) Identity() string
- func (p *RemoteParticipant) IsCameraEnabled() bool
- func (p *RemoteParticipant) IsMicrophoneEnabled() bool
- func (p *RemoteParticipant) IsScreenShareEnabled() bool
- func (p *RemoteParticipant) IsSpeaking() bool
- func (p *RemoteParticipant) Metadata() string
- func (p *RemoteParticipant) Name() string
- func (p *RemoteParticipant) SID() string
- func (p *RemoteParticipant) Tracks() []TrackPublication
- type RemoteTrackPublication
- 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) Receiver() *webrtc.RTPReceiver
- func (p *RemoteTrackPublication) SID() string
- func (p *RemoteTrackPublication) Source() livekit.TrackSource
- 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) 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 SampleProvider
- type SampleWriteOptions
- type SignalClient
- func (c *SignalClient) Close()
- func (c *SignalClient) IsConnected() bool
- func (c *SignalClient) Join(urlPrefix string, token string, params *ConnectParams) (*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 ¶
const PROTOCOL = 5
const Version = "0.8.2"
Variables ¶
var ( 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("FileSampleProvider does not support this mime type") )
Functions ¶
func FileTrackWithFrameDuration ¶ added in v0.7.0
func FileTrackWithFrameDuration(duration time.Duration) func(provider *FileSampleProvider)
func FileTrackWithMime ¶ added in v0.7.0
func FileTrackWithMime(mime string) func(provider *FileSampleProvider)
func FileTrackWithOnWriteComplete ¶ added in v0.7.0
func FileTrackWithOnWriteComplete(f func()) func(provider *FileSampleProvider)
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 AudioSampleProvider ¶ added in v0.7.0
type AudioSampleProvider interface { SampleProvider CurrentAudioLevel() uint8 }
type ConnectInfo ¶
type ConnectOption ¶ added in v0.6.1
type ConnectOption func(*ConnectParams)
func WithAutoSubscribe ¶ added in v0.6.1
func WithAutoSubscribe(val bool) ConnectOption
type ConnectParams ¶ added in v0.6.1
type ConnectParams struct {
AutoSubscribe bool
}
type FileSampleProvider ¶ added in v0.7.0
type FileSampleProvider struct { Mime string FileName string FrameDuration time.Duration OnWriteComplete func() AudioLevel uint8 // contains filtered or unexported fields }
FileSampleProvider provides samples by reading from a video file
func (*FileSampleProvider) CurrentAudioLevel ¶ added in v0.7.0
func (p *FileSampleProvider) CurrentAudioLevel() uint8
func (*FileSampleProvider) NextSample ¶ added in v0.7.0
func (p *FileSampleProvider) NextSample() (media.Sample, error)
func (*FileSampleProvider) OnBind ¶ added in v0.7.0
func (p *FileSampleProvider) OnBind() error
func (*FileSampleProvider) OnUnbind ¶ added in v0.7.0
func (p *FileSampleProvider) OnUnbind() error
type FileSampleProviderOption ¶ added in v0.7.0
type FileSampleProviderOption func(*FileSampleProvider)
type LoadTestProvider ¶
LoadTestProvider is designed to be used with the load tester. It provides samples that are encoded with sequence and timing information, in order determine RTT and loss
func NewLoadTestProvider ¶
func NewLoadTestProvider(bitrate uint32) (*LoadTestProvider, error)
func (*LoadTestProvider) NextSample ¶
func (p *LoadTestProvider) NextSample() (media.Sample, error)
func (*LoadTestProvider) OnBind ¶ added in v0.7.0
func (p *LoadTestProvider) OnBind() error
func (*LoadTestProvider) OnUnbind ¶ added in v0.7.0
func (p *LoadTestProvider) OnUnbind() error
type LocalParticipant ¶
type LocalParticipant struct {
// contains filtered or unexported fields
}
func (*LocalParticipant) AudioLevel ¶
func (p *LocalParticipant) AudioLevel() float32
func (*LocalParticipant) GetTrack ¶ added in v0.8.0
func (p *LocalParticipant) GetTrack(source livekit.TrackSource) TrackPublication
func (*LocalParticipant) IsCameraEnabled ¶ added in v0.8.0
func (p *LocalParticipant) IsCameraEnabled() bool
func (*LocalParticipant) IsMicrophoneEnabled ¶ added in v0.8.0
func (p *LocalParticipant) IsMicrophoneEnabled() bool
func (*LocalParticipant) IsScreenShareEnabled ¶ added in v0.8.0
func (p *LocalParticipant) IsScreenShareEnabled() bool
func (*LocalParticipant) IsSpeaking ¶
func (p *LocalParticipant) IsSpeaking() bool
func (*LocalParticipant) PublishData ¶ added in v0.5.12
func (p *LocalParticipant) PublishData(data []byte, kind livekit.DataPacket_Kind, destinationSids []string) error
func (*LocalParticipant) PublishTrack ¶
func (p *LocalParticipant) PublishTrack(track webrtc.TrackLocal, name string) (*LocalTrackPublication, error)
func (*LocalParticipant) Tracks ¶
func (p *LocalParticipant) Tracks() []TrackPublication
func (*LocalParticipant) UnpublishTrack ¶ added in v0.7.0
func (p *LocalParticipant) UnpublishTrack(sid string) error
type LocalSampleTrack ¶
type LocalSampleTrack struct {
// 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 This extends webrtc.TrackLocalStaticSample, and adds the ability to write RTP extensions
func NewLocalFileTrack ¶ added in v0.7.0
func NewLocalFileTrack(file string, options ...FileSampleProviderOption) (*LocalSampleTrack, error)
func NewLocalSampleTrack ¶
func NewLocalSampleTrack(c webrtc.RTPCodecCapability) (*LocalSampleTrack, error)
func (*LocalSampleTrack) Bind ¶
func (s *LocalSampleTrack) Bind(t webrtc.TrackLocalContext) (webrtc.RTPCodecParameters, error)
Bind is an interface for TrackLocal, not for external consumption
func (*LocalSampleTrack) Codec ¶ added in v0.7.0
func (s *LocalSampleTrack) Codec() webrtc.RTPCodecCapability
Codec gets the Codec of the track
func (*LocalSampleTrack) ID ¶ added in v0.7.0
func (s *LocalSampleTrack) 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 (*LocalSampleTrack) IsBound ¶ added in v0.7.0
func (s *LocalSampleTrack) IsBound() bool
func (*LocalSampleTrack) Kind ¶ added in v0.7.0
func (s *LocalSampleTrack) Kind() webrtc.RTPCodecType
Kind controls if this TrackLocal is audio or video
func (*LocalSampleTrack) OnBind ¶ added in v0.7.0
func (s *LocalSampleTrack) 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 (*LocalSampleTrack) OnUnbind ¶ added in v0.7.0
func (s *LocalSampleTrack) OnUnbind(f func())
OnUnbind sets a callback to be called after the track is removed from a peer connection
func (*LocalSampleTrack) StartWrite ¶ added in v0.7.0
func (s *LocalSampleTrack) StartWrite(provider SampleProvider, onComplete func()) error
func (*LocalSampleTrack) StreamID ¶ added in v0.7.0
func (s *LocalSampleTrack) StreamID() string
StreamID is the group this track belongs too. This must be unique
func (*LocalSampleTrack) Unbind ¶
func (s *LocalSampleTrack) Unbind(t webrtc.TrackLocalContext) error
Unbind is an interface for TrackLocal, not for external consumption
func (*LocalSampleTrack) WriteSample ¶ added in v0.7.0
func (s *LocalSampleTrack) WriteSample(sample media.Sample, opts *SampleWriteOptions) error
type LocalTrackPublication ¶
type LocalTrackPublication struct {
// contains filtered or unexported fields
}
func (*LocalTrackPublication) IsSubscribed ¶
func (p *LocalTrackPublication) IsSubscribed() bool
func (*LocalTrackPublication) MimeType ¶ added in v0.8.2
func (p *LocalTrackPublication) MimeType() string
func (*LocalTrackPublication) SetMuted ¶
func (p *LocalTrackPublication) SetMuted(muted bool)
func (*LocalTrackPublication) Source ¶ added in v0.8.0
func (p *LocalTrackPublication) Source() livekit.TrackSource
func (*LocalTrackPublication) TrackLocal ¶
func (p *LocalTrackPublication) TrackLocal() webrtc.TrackLocal
type NullSampleProvider ¶
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 ¶
func (p *NullSampleProvider) NextSample() (media.Sample, error)
func (*NullSampleProvider) OnBind ¶ added in v0.7.0
func (p *NullSampleProvider) OnBind() error
func (*NullSampleProvider) OnUnbind ¶ added in v0.7.0
func (p *NullSampleProvider) OnUnbind() error
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(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) Negotiate ¶ added in v0.7.0
func (t *PCTransport) Negotiate()
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 Name() string IsSpeaking() bool AudioLevel() float32 Tracks() []TrackPublication IsCameraEnabled() bool IsMicrophoneEnabled() bool Metadata() string GetTrack(source livekit.TrackSource) TrackPublication // contains filtered or unexported methods }
type ParticipantCallback ¶
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) 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, rp *RemoteParticipant) }
func NewParticipantCallback ¶
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) OnSpeakersChanged func([]*livekit.SpeakerInfo) OnDataReceived func(userPacket *livekit.UserPacket) OnConnectionQuality func([]*livekit.ConnectionQualityInfo) OnRoomUpdate func(room *livekit.Room) // contains filtered or unexported fields }
func NewRTCEngine ¶
func NewRTCEngine() *RTCEngine
func (*RTCEngine) IsConnected ¶
func (*RTCEngine) Join ¶
func (e *RTCEngine) Join(url string, token string, params *ConnectParams) (*livekit.JoinResponse, error)
func (*RTCEngine) TrackPublishedChan ¶
func (e *RTCEngine) TrackPublishedChan() <-chan *livekit.TrackPublishedResponse
type RecordingServiceClient ¶ added in v0.6.1
type RecordingServiceClient struct { livekit.RecordingService // contains filtered or unexported fields }
func NewRecordingServiceClient ¶ added in v0.6.1
func NewRecordingServiceClient(url string, apiKey string, secretKey string) *RecordingServiceClient
func (*RecordingServiceClient) AddOutput ¶ added in v0.7.2
func (c *RecordingServiceClient) AddOutput(ctx context.Context, req *livekit.AddOutputRequest) (*emptypb.Empty, error)
func (*RecordingServiceClient) EndRecording ¶ added in v0.6.1
func (c *RecordingServiceClient) EndRecording(ctx context.Context, req *livekit.EndRecordingRequest) (*emptypb.Empty, error)
func (*RecordingServiceClient) RemoveOutput ¶ added in v0.7.2
func (c *RecordingServiceClient) RemoveOutput(ctx context.Context, req *livekit.RemoveOutputRequest) (*emptypb.Empty, error)
func (*RecordingServiceClient) StartRecording ¶ added in v0.6.1
func (c *RecordingServiceClient) StartRecording(ctx context.Context, req *livekit.StartRecordingRequest) (*livekit.StartRecordingResponse, error)
type RemoteParticipant ¶
type RemoteParticipant struct {
// contains filtered or unexported fields
}
func (*RemoteParticipant) AudioLevel ¶
func (p *RemoteParticipant) AudioLevel() float32
func (*RemoteParticipant) GetTrack ¶ added in v0.8.0
func (p *RemoteParticipant) GetTrack(source livekit.TrackSource) TrackPublication
func (*RemoteParticipant) IsCameraEnabled ¶ added in v0.8.0
func (p *RemoteParticipant) IsCameraEnabled() bool
func (*RemoteParticipant) IsMicrophoneEnabled ¶ added in v0.8.0
func (p *RemoteParticipant) IsMicrophoneEnabled() bool
func (*RemoteParticipant) IsScreenShareEnabled ¶ added in v0.8.0
func (p *RemoteParticipant) IsScreenShareEnabled() bool
func (*RemoteParticipant) IsSpeaking ¶
func (p *RemoteParticipant) IsSpeaking() bool
func (*RemoteParticipant) Tracks ¶
func (p *RemoteParticipant) Tracks() []TrackPublication
type RemoteTrackPublication ¶
type RemoteTrackPublication struct {
// contains filtered or unexported fields
}
func (*RemoteTrackPublication) IsSubscribed ¶
func (p *RemoteTrackPublication) IsSubscribed() bool
func (*RemoteTrackPublication) MimeType ¶ added in v0.8.2
func (p *RemoteTrackPublication) MimeType() string
func (*RemoteTrackPublication) Receiver ¶
func (p *RemoteTrackPublication) Receiver() *webrtc.RTPReceiver
func (*RemoteTrackPublication) Source ¶ added in v0.8.0
func (p *RemoteTrackPublication) Source() livekit.TrackSource
func (*RemoteTrackPublication) TrackRemote ¶
func (p *RemoteTrackPublication) TrackRemote() *webrtc.TrackRemote
type Room ¶
type Room struct { SID string Name string LocalParticipant *LocalParticipant Callback *RoomCallback // contains filtered or unexported fields }
func ConnectToRoom ¶
func ConnectToRoom(url string, info ConnectInfo, opts ...ConnectOption) (*Room, error)
func ConnectToRoomWithToken ¶
func ConnectToRoomWithToken(url, token string, opts ...ConnectOption) (*Room, error)
func (*Room) ActiveSpeakers ¶
func (r *Room) ActiveSpeakers() []Participant
func (*Room) Disconnect ¶
func (r *Room) Disconnect()
func (*Room) GetParticipant ¶
func (r *Room) GetParticipant(sid string) *RemoteParticipant
func (*Room) GetParticipants ¶
func (r *Room) GetParticipants() []*RemoteParticipant
type RoomCallback ¶
type RoomCallback struct { OnDisconnected func() OnParticipantConnected func(*RemoteParticipant) OnParticipantDisconnected func(*RemoteParticipant) OnActiveSpeakersChanged func([]Participant) OnRoomMetadataChanged func(metadata string) // participant events are sent to the room as well ParticipantCallback }
func NewRoomCallback ¶
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 ¶
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 ¶ added in v0.7.1
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 ¶ added in v0.8.0
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 SampleProvider ¶
type SampleWriteOptions ¶ added in v0.7.0
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) 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, params *ConnectParams) (*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 ¶
func (c *SignalClient) SendLeave() 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
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 TrackPublicationOptions ¶
type TrackPublicationOptions struct {
Name string
}