types

package
v1.10.6 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: Apache-2.0 Imports: 6 Imported by: 5

Documentation

Index

Constants

View Source
const DefaultProtocol = 2

Variables

This section is empty.

Functions

This section is empty.

Types

type Participant

type Participant interface {
	ID() string
	Identity() string
	State() livekit.ParticipantInfo_State
	ProtocolVersion() ProtocolVersion
	IsReady() bool
	ConnectedAt() time.Time
	ToProto() *livekit.ParticipantInfo
	RTCPChan() chan []rtcp.Packet
	SetMetadata(metadata string)
	SetPermission(permission *livekit.ParticipantPermission)
	GetResponseSink() routing.MessageSink
	SetResponseSink(sink routing.MessageSink)
	SubscriberMediaEngine() *webrtc.MediaEngine
	Negotiate()
	ICERestart() error

	AddTrack(req *livekit.AddTrackRequest)
	GetPublishedTracks() []PublishedTrack
	GetSubscribedTracks() []SubscribedTrack
	HandleOffer(sdp webrtc.SessionDescription) (answer webrtc.SessionDescription, err error)
	HandleAnswer(sdp webrtc.SessionDescription) error
	AddICECandidate(candidate webrtc.ICECandidateInit, target livekit.SignalTarget) error
	AddSubscriber(op Participant) (int, error)
	RemoveSubscriber(peerId string)
	SendJoinResponse(info *livekit.Room, otherParticipants []Participant, iceServers []*livekit.ICEServer) error
	SendParticipantUpdate(participants []*livekit.ParticipantInfo) error
	SendActiveSpeakers(speakers []*livekit.SpeakerInfo) error
	SendDataPacket(packet *livekit.DataPacket) error
	SetTrackMuted(trackId string, muted bool)
	GetAudioLevel() (level uint8, active bool)

	CanPublish() bool
	CanSubscribe() bool

	Start()
	Close() error

	OnStateChange(func(p Participant, oldState livekit.ParticipantInfo_State))
	// OnTrackPublished - remote added a remoteTrack
	OnTrackPublished(func(Participant, PublishedTrack))
	// OnTrackUpdated - one of its publishedTracks changed in status
	OnTrackUpdated(callback func(Participant, PublishedTrack))
	OnMetadataUpdate(callback func(Participant))
	OnDataPacket(callback func(Participant, *livekit.DataPacket))
	OnClose(func(Participant))

	AddSubscribedTrack(participantId string, st SubscribedTrack)
	RemoveSubscribedTrack(participantId string, st SubscribedTrack)
	SubscriberPC() *webrtc.PeerConnection
	UpdateAfterActive() bool

	DebugInfo() map[string]interface{}
}

type ProtocolVersion

type ProtocolVersion int

func (ProtocolVersion) HandlesDataPackets

func (v ProtocolVersion) HandlesDataPackets() bool

func (ProtocolVersion) SupportsPackedStreamId

func (v ProtocolVersion) SupportsPackedStreamId() bool

type PublishedTrack

type PublishedTrack interface {
	Start()
	ID() string
	Kind() livekit.TrackType
	Name() string
	IsMuted() bool
	SetMuted(muted bool)
	AddSubscriber(participant Participant) error
	RemoveSubscriber(participantId string)
	IsSubscriber(subId string) bool
	RemoveAllSubscribers()
	ToProto() *livekit.TrackInfo

	// callbacks
	OnClose(func())
}

PublishedTrack is the main interface representing a track published to the room it's responsible for managing subscribers and forwarding data from the input track to all subscribers

type SubscribedTrack

type SubscribedTrack interface {
	ID() string
	DownTrack() *sfu.DownTrack
	IsMuted() bool
	SetPublisherMuted(muted bool)
	UpdateSubscriberSettings(enabled bool, quality livekit.VideoQuality)
}

type TrackRemote

type TrackRemote interface {
	SSRC() webrtc.SSRC
	StreamID() string
	Kind() webrtc.RTPCodecType
	Codec() webrtc.RTPCodecParameters
}

interface for properties of webrtc.TrackRemote

type WebsocketClient

type WebsocketClient interface {
	ReadMessage() (messageType int, p []byte, err error)
	WriteMessage(messageType int, data []byte) error
	WriteControl(messageType int, data []byte, deadline time.Time) error
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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