types

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: Apache-2.0 Imports: 6 Imported by: 6

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
	SendSpeakerUpdate(speakers []*livekit.SpeakerInfo) error
	SendDataPacket(packet *livekit.DataPacket) error
	SetTrackMuted(trackId string, muted bool, fromAdmin bool)
	GetAudioLevel() (level uint8, active bool)

	CanPublish() bool
	CanSubscribe() bool
	CanPublishData() bool
	Hidden() 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) SubscriberAsPrimary added in v0.13.0

func (v ProtocolVersion) SubscriberAsPrimary() bool

SubscriberAsPrimary indicates clients initiate subscriber connection as primary

func (ProtocolVersion) SupportsPackedStreamId

func (v ProtocolVersion) SupportsPackedStreamId() bool

func (ProtocolVersion) SupportsProtobuf added in v0.11.0

func (v ProtocolVersion) SupportsProtobuf() bool

func (ProtocolVersion) SupportsSpeakerChanged added in v0.13.0

func (v ProtocolVersion) SupportsSpeakerChanged() bool

SupportsSpeakerChanged - if client handles speaker info deltas, instead of a comprehensive list

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