client

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: Apache-2.0 Imports: 26 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWebSocketConn

func NewWebSocketConn(host, token string, opts *Options) (*websocket.Conn, error)

func SetAuthorizationToken

func SetAuthorizationToken(header http.Header, token string)

Types

type Options

type Options struct {
	AutoSubscribe bool
	Publish       string
}

type RTCClient

type RTCClient struct {
	OnConnected    func()
	OnDataReceived func(data []byte, sid string)
	// contains filtered or unexported fields
}

func NewRTCClient

func NewRTCClient(conn *websocket.Conn) (*RTCClient, error)

func (*RTCClient) AddFileTrack

func (c *RTCClient) AddFileTrack(path string, id string, label string) (writer *TrackWriter, err error)

func (*RTCClient) AddStaticTrack

func (c *RTCClient) AddStaticTrack(mime string, id string, label string) (writer *TrackWriter, err error)

func (*RTCClient) AddStaticTrackWithCodec

func (c *RTCClient) AddStaticTrackWithCodec(codec webrtc.RTPCodecCapability, id string, label string) (writer *TrackWriter, err error)

func (*RTCClient) AddTrack

func (c *RTCClient) AddTrack(track *webrtc.TrackLocalStaticSample, path string) (writer *TrackWriter, err error)

func (*RTCClient) BytesReceived

func (c *RTCClient) BytesReceived() uint64

func (*RTCClient) GetPublishedTrackIDs

func (c *RTCClient) GetPublishedTrackIDs() []string

func (*RTCClient) GetRemoteParticipant

func (c *RTCClient) GetRemoteParticipant(sid livekit.ParticipantID) *livekit.ParticipantInfo

func (*RTCClient) ID

func (*RTCClient) PongReceivedAt

func (c *RTCClient) PongReceivedAt() int64

func (*RTCClient) PublishData

func (c *RTCClient) PublishData(data []byte, kind livekit.DataPacket_Kind) error

func (*RTCClient) ReadResponse

func (c *RTCClient) ReadResponse() (*livekit.SignalResponse, error)

func (*RTCClient) RefreshToken

func (c *RTCClient) RefreshToken() string

func (*RTCClient) RemoteParticipants

func (c *RTCClient) RemoteParticipants() []*livekit.ParticipantInfo

func (*RTCClient) Run

func (c *RTCClient) Run() error

create an offer for the server

func (*RTCClient) SendAddTrack

func (c *RTCClient) SendAddTrack(cid 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) SendNacks

func (c *RTCClient) SendNacks(count int)

func (*RTCClient) SendPing

func (c *RTCClient) SendPing() error

func (*RTCClient) SendRequest

func (c *RTCClient) SendRequest(msg *livekit.SignalRequest) error

func (*RTCClient) Stop

func (c *RTCClient) Stop()

func (*RTCClient) SubscribedTracks

func (c *RTCClient) SubscribedTracks() map[livekit.ParticipantID][]*webrtc.TrackRemote

func (*RTCClient) WaitUntilConnected

func (c *RTCClient) WaitUntilConnected() error

type TrackWriter

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

Writes a file to an RTP track. makes it easier to debug and create RTP streams

func NewTrackWriter

func NewTrackWriter(ctx context.Context, track *webrtc.TrackLocalStaticSample, filePath string) *TrackWriter

func (*TrackWriter) Start

func (w *TrackWriter) Start() error

func (*TrackWriter) Stop

func (w *TrackWriter) Stop()

Jump to

Keyboard shortcuts

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