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 TrackRemote ¶
type TrackRemote interface {
SSRC() webrtc.SSRC
StreamID() string
Kind() webrtc.RTPCodecType
Codec() webrtc.RTPCodecParameters
}
interface for properties of webrtc.TrackRemote
Click to show internal directories.
Click to hide internal directories.