Documentation
¶
Index ¶
- func NewWebSocketConn(host, token string, opts *Options) (*websocket.Conn, error)
- func SetAuthorizationToken(header http.Header, token string)
- type AddTrackOption
- type AddTrackParams
- type DataChannelReader
- type DataTrackRemote
- type Options
- type RTCClient
- func (c *RTCClient) AddFileTrack(path string, id string, label string) (writer TrackWriter, err error)
- func (c *RTCClient) AddStaticTrack(mime string, id string, label string, opts ...AddTrackOption) (writer TrackWriter, err error)
- func (c *RTCClient) AddStaticTrackWithCodec(codec webrtc.RTPCodecCapability, id string, label string, ...) (writer TrackWriter, err error)
- func (c *RTCClient) AddTrack(track *webrtc.TrackLocalStaticSample, path string, opts ...AddTrackOption) (writer TrackWriter, err error)
- func (c *RTCClient) BytesReceived() uint64
- func (c *RTCClient) GetPublishedTrackIDs() []string
- func (c *RTCClient) GetRemoteParticipant(sid livekit.ParticipantID) *livekit.ParticipantInfo
- func (c *RTCClient) GetSubscriptionResponseAndClear() *livekit.SubscriptionResponse
- func (c *RTCClient) ID() livekit.ParticipantID
- func (c *RTCClient) LastAnswer() *webrtc.SessionDescription
- func (c *RTCClient) PongReceivedAt() int64
- func (c *RTCClient) PublishData(data []byte, kind livekit.DataPacket_Kind) error
- func (c *RTCClient) PublishDataTrack() (writer TrackWriter, err error)
- func (c *RTCClient) PublishDataUnlabeled(data []byte) error
- func (c *RTCClient) ReadResponse() (*livekit.SignalResponse, error)
- func (c *RTCClient) RefreshToken() string
- func (c *RTCClient) RemoteParticipants() []*livekit.ParticipantInfo
- func (c *RTCClient) Run() error
- func (c *RTCClient) SendAddTrack(cid string, mimeType string, name string, trackType livekit.TrackType) error
- func (c *RTCClient) SendIceCandidate(ic *webrtc.ICECandidate, target livekit.SignalTarget) error
- func (c *RTCClient) SendNacks(count int)
- func (c *RTCClient) SendPing() error
- func (c *RTCClient) SendRequest(msg *livekit.SignalRequest) error
- func (c *RTCClient) SetAttributes(attrs map[string]string) error
- func (c *RTCClient) Stop()
- func (c *RTCClient) SubscribedDataTracks() map[livekit.ParticipantID]map[uint16]*DataTrackRemote
- func (c *RTCClient) SubscribedTracks() map[livekit.ParticipantID][]*webrtc.TrackRemote
- func (c *RTCClient) WaitUntilConnected() error
- type SignalRequestHandler
- type SignalRequestInterceptor
- type SignalResponseHandler
- type SignalResponseInterceptor
- type TrackWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewWebSocketConn ¶
func SetAuthorizationToken ¶
Types ¶
type AddTrackOption ¶
type AddTrackOption func(params *AddTrackParams)
func AddTrackNoWriter ¶
func AddTrackNoWriter() AddTrackOption
type AddTrackParams ¶
type AddTrackParams struct {
NoWriter bool
}
type DataChannelReader ¶
type DataChannelReader struct {
// contains filtered or unexported fields
}
func NewDataChannelReader ¶
func NewDataChannelReader(bitrate int) *DataChannelReader
func (*DataChannelReader) Read ¶
func (d *DataChannelReader) Read(p []byte, sid string)
type DataTrackRemote ¶
type DataTrackRemote struct {
// contains filtered or unexported fields
}
func NewDataTrackRemote ¶
func NewDataTrackRemote( publisherIdentity livekit.ParticipantIdentity, publisherID livekit.ParticipantID, handle uint16, trackID livekit.TrackID, logger logger.Logger, ) *DataTrackRemote
func (*DataTrackRemote) Close ¶
func (d *DataTrackRemote) Close()
func (*DataTrackRemote) Handle ¶
func (d *DataTrackRemote) Handle() uint16
func (*DataTrackRemote) ID ¶
func (d *DataTrackRemote) ID() livekit.TrackID
func (*DataTrackRemote) NumReceivedPackets ¶
func (d *DataTrackRemote) NumReceivedPackets() uint32
func (*DataTrackRemote) PacketReceived ¶
func (d *DataTrackRemote) PacketReceived(packet *datatrack.Packet)
type Options ¶
type Options struct {
AutoSubscribe bool
Publish string
Attributes map[string]string
ClientInfo *livekit.ClientInfo
DisabledCodecs []webrtc.RTPCodecCapability
TokenCustomizer func(token *auth.AccessToken, grants *auth.VideoGrant)
SignalRequestInterceptor SignalRequestInterceptor
SignalResponseInterceptor SignalResponseInterceptor
UseJoinRequestQueryParam bool
}
type RTCClient ¶
type RTCClient struct {
OnConnected func()
OnDataReceived func(data []byte, sid string)
OnDataUnlabeledReceived func(data []byte)
// contains filtered or unexported fields
}
func NewRTCClient ¶
func (*RTCClient) AddFileTrack ¶
func (*RTCClient) AddStaticTrack ¶
func (c *RTCClient) AddStaticTrack(mime string, id string, label string, opts ...AddTrackOption) (writer TrackWriter, err error)
func (*RTCClient) AddStaticTrackWithCodec ¶
func (c *RTCClient) AddStaticTrackWithCodec(codec webrtc.RTPCodecCapability, id string, label string, opts ...AddTrackOption) (writer TrackWriter, err error)
func (*RTCClient) AddTrack ¶
func (c *RTCClient) AddTrack(track *webrtc.TrackLocalStaticSample, path string, opts ...AddTrackOption) (writer TrackWriter, err error)
func (*RTCClient) BytesReceived ¶
func (*RTCClient) GetPublishedTrackIDs ¶
func (*RTCClient) GetRemoteParticipant ¶
func (c *RTCClient) GetRemoteParticipant(sid livekit.ParticipantID) *livekit.ParticipantInfo
func (*RTCClient) GetSubscriptionResponseAndClear ¶
func (c *RTCClient) GetSubscriptionResponseAndClear() *livekit.SubscriptionResponse
func (*RTCClient) ID ¶
func (c *RTCClient) ID() livekit.ParticipantID
func (*RTCClient) LastAnswer ¶
func (c *RTCClient) LastAnswer() *webrtc.SessionDescription
LastAnswer return SDP of the last answer for the publisher connection
func (*RTCClient) PongReceivedAt ¶
func (*RTCClient) PublishData ¶
func (c *RTCClient) PublishData(data []byte, kind livekit.DataPacket_Kind) error
func (*RTCClient) PublishDataTrack ¶
func (c *RTCClient) PublishDataTrack() (writer TrackWriter, err error)
func (*RTCClient) PublishDataUnlabeled ¶
func (*RTCClient) ReadResponse ¶
func (c *RTCClient) ReadResponse() (*livekit.SignalResponse, error)
func (*RTCClient) RefreshToken ¶
func (*RTCClient) RemoteParticipants ¶
func (c *RTCClient) RemoteParticipants() []*livekit.ParticipantInfo
func (*RTCClient) SendAddTrack ¶
func (c *RTCClient) SendAddTrack(cid string, mimeType string, name string, trackType livekit.TrackType) error
send AddTrack command to server to initiate server-side negotiation
func (*RTCClient) SendIceCandidate ¶
func (c *RTCClient) SendIceCandidate(ic *webrtc.ICECandidate, target livekit.SignalTarget) error
func (*RTCClient) SendRequest ¶
func (c *RTCClient) SendRequest(msg *livekit.SignalRequest) error
func (*RTCClient) SubscribedDataTracks ¶
func (c *RTCClient) SubscribedDataTracks() map[livekit.ParticipantID]map[uint16]*DataTrackRemote
func (*RTCClient) SubscribedTracks ¶
func (c *RTCClient) SubscribedTracks() map[livekit.ParticipantID][]*webrtc.TrackRemote
func (*RTCClient) WaitUntilConnected ¶
type SignalRequestHandler ¶
type SignalRequestHandler func(msg *livekit.SignalRequest) error
type SignalRequestInterceptor ¶
type SignalRequestInterceptor func(msg *livekit.SignalRequest, next SignalRequestHandler) error
type SignalResponseHandler ¶
type SignalResponseHandler func(msg *livekit.SignalResponse) error
type SignalResponseInterceptor ¶
type SignalResponseInterceptor func(msg *livekit.SignalResponse, next SignalResponseHandler) error
type TrackWriter ¶
type TrackWriter interface {
Start() error
Stop()
}
func NewDataTrackWriter ¶
func NewDataTrackWriter(ctx context.Context, handle uint16, transport types.DataTrackTransport) TrackWriter
func NewTrackWriter ¶
func NewTrackWriter(ctx context.Context, track *webrtc.TrackLocalStaticSample, filePath string) TrackWriter
Click to show internal directories.
Click to hide internal directories.