Documentation
¶
Index ¶
- Constants
- type AddSubscriberParams
- type LocalMediaTrack
- type LocalParticipant
- type MediaTrack
- type MigrateState
- type Participant
- type ProtocolVersion
- func (v ProtocolVersion) HandlesDataPackets() bool
- func (v ProtocolVersion) SubscriberAsPrimary() bool
- func (v ProtocolVersion) SupportsConnectionQuality() bool
- func (v ProtocolVersion) SupportsICELite() bool
- func (v ProtocolVersion) SupportsPackedStreamId() bool
- func (v ProtocolVersion) SupportsProtobuf() bool
- func (v ProtocolVersion) SupportsSessionMigrate() bool
- func (v ProtocolVersion) SupportsSpeakerChanged() bool
- func (v ProtocolVersion) SupportsTransceiverReuse() bool
- func (v ProtocolVersion) SupportsUnpublish() bool
- type Room
- type SubscribedTrack
- type WebsocketClient
Constants ¶
View Source
const DefaultProtocol = 6
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddSubscriberParams ¶ added in v0.15.2
type LocalMediaTrack ¶ added in v0.15.3
type LocalParticipant ¶ added in v0.15.3
type LocalParticipant interface {
Participant
GetLogger() logger.Logger
ProtocolVersion() ProtocolVersion
ConnectedAt() time.Time
State() livekit.ParticipantInfo_State
IsReady() bool
SubscriberAsPrimary() bool
GetResponseSink() routing.MessageSink
SetResponseSink(sink routing.MessageSink)
// permissions
ClaimGrants() *auth.ClaimGrants
SetPermission(permission *livekit.ParticipantPermission) bool
CanPublish() bool
CanSubscribe() bool
CanPublishData() bool
AddICECandidate(candidate webrtc.ICECandidateInit, target livekit.SignalTarget) error
HandleOffer(sdp webrtc.SessionDescription) (answer webrtc.SessionDescription, err error)
AddTrack(req *livekit.AddTrackRequest)
SetTrackMuted(trackID livekit.TrackID, muted bool, fromAdmin bool)
SubscriberMediaEngine() *webrtc.MediaEngine
SubscriberPC() *webrtc.PeerConnection
HandleAnswer(sdp webrtc.SessionDescription) error
Negotiate()
ICERestart() error
AddSubscribedTrack(st SubscribedTrack)
RemoveSubscribedTrack(st SubscribedTrack)
UpdateSubscribedTrackSettings(trackID livekit.TrackID, settings *livekit.UpdateTrackSettings) error
GetSubscribedTracks() []SubscribedTrack
// returns list of participant identities that the current participant is subscribed to
GetSubscribedParticipants() []livekit.ParticipantID
GetAudioLevel() (level uint8, active bool)
GetConnectionQuality() *livekit.ConnectionQualityInfo
// server sent messages
SendJoinResponse(info *livekit.Room, otherParticipants []*livekit.ParticipantInfo, iceServers []*livekit.ICEServer, region string) error
SendParticipantUpdate(participants []*livekit.ParticipantInfo) error
SendSpeakerUpdate(speakers []*livekit.SpeakerInfo) error
SendDataPacket(packet *livekit.DataPacket) error
SendRoomUpdate(room *livekit.Room) error
SendConnectionQualityUpdate(update *livekit.ConnectionQualityUpdate) error
SubscriptionPermissionUpdate(publisherID livekit.ParticipantID, trackID livekit.TrackID, allowed bool)
SendRefreshToken(token string) error
// callbacks
OnStateChange(func(p LocalParticipant, oldState livekit.ParticipantInfo_State))
// OnTrackPublished - remote added a track
OnTrackPublished(func(LocalParticipant, MediaTrack))
// OnTrackUpdated - one of its publishedTracks changed in status
OnTrackUpdated(callback func(LocalParticipant, MediaTrack))
// OnParticipantUpdate - metadata or permission is updated
OnParticipantUpdate(callback func(LocalParticipant))
OnDataPacket(callback func(LocalParticipant, *livekit.DataPacket))
OnClose(_callback func(LocalParticipant, map[livekit.TrackID]livekit.ParticipantID))
OnClaimsChanged(_callback func(LocalParticipant))
// session migration
SetMigrateState(s MigrateState)
MigrateState() MigrateState
SetMigrateInfo(mediaTracks []*livekit.TrackPublishedResponse, dataChannels []*livekit.DataChannelInfo)
SetPreviousAnswer(previous *webrtc.SessionDescription)
UpdateRTT(rtt uint32)
}
type MediaTrack ¶ added in v0.15.0
type MediaTrack interface {
ID() livekit.TrackID
Kind() livekit.TrackType
Name() string
Source() livekit.TrackSource
ToProto() *livekit.TrackInfo
PublisherID() livekit.ParticipantID
PublisherIdentity() livekit.ParticipantIdentity
IsMuted() bool
SetMuted(muted bool)
UpdateVideoLayers(layers []*livekit.VideoLayer)
IsSimulcast() bool
Receiver() sfu.TrackReceiver
// callbacks
AddOnClose(func())
// subscribers
AddSubscriber(participant LocalParticipant) error
RemoveSubscriber(participantID livekit.ParticipantID, resume bool)
IsSubscriber(subID livekit.ParticipantID) bool
RemoveAllSubscribers()
RevokeDisallowedSubscribers(allowedSubscriberIDs []livekit.ParticipantID) []livekit.ParticipantID
GetAllSubscribers() []livekit.ParticipantID
// returns quality information that's appropriate for width & height
GetQualityForDimension(width, height uint32) livekit.VideoQuality
NotifySubscriberNodeMaxQuality(nodeID livekit.NodeID, quality livekit.VideoQuality)
NotifySubscriberNodeMediaLoss(nodeID livekit.NodeID, fractionalLoss uint8)
}
MediaTrack represents a media track
type MigrateState ¶ added in v0.15.3
type MigrateState int32
const ( MigrateStateInit MigrateState = iota MigrateStateSync MigrateStateComplete )
func (MigrateState) String ¶ added in v0.15.3
func (m MigrateState) String() string
type Participant ¶
type Participant interface {
ID() livekit.ParticipantID
Identity() livekit.ParticipantIdentity
ToProto() *livekit.ParticipantInfo
SetMetadata(metadata string)
GetPublishedTrack(sid livekit.TrackID) MediaTrack
GetPublishedTracks() []MediaTrack
AddSubscriber(op LocalParticipant, params AddSubscriberParams) (int, error)
RemoveSubscriber(op LocalParticipant, trackID livekit.TrackID, resume bool)
// permissions
Hidden() bool
IsRecorder() bool
Start()
Close(sendLeave bool) error
SubscriptionPermission() *livekit.SubscriptionPermission
// updates from remotes
UpdateSubscriptionPermission(subscriptionPermission *livekit.SubscriptionPermission, resolver func(participantID livekit.ParticipantID) LocalParticipant) error
UpdateVideoLayers(updateVideoLayers *livekit.UpdateVideoLayers) error
UpdateSubscribedQuality(nodeID livekit.NodeID, trackID livekit.TrackID, maxQuality livekit.VideoQuality) error
UpdateMediaLoss(nodeID livekit.NodeID, trackID livekit.TrackID, fractionalLoss uint32) error
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) SupportsConnectionQuality ¶ added in v0.14.0
func (v ProtocolVersion) SupportsConnectionQuality() bool
SupportsConnectionQuality - avoid sending frequent ConnectionQuality updates for lower protocol versions
func (ProtocolVersion) SupportsICELite ¶ added in v0.15.4
func (v ProtocolVersion) SupportsICELite() bool
func (ProtocolVersion) SupportsPackedStreamId ¶
func (v ProtocolVersion) SupportsPackedStreamId() bool
func (ProtocolVersion) SupportsProtobuf ¶ added in v0.11.0
func (v ProtocolVersion) SupportsProtobuf() bool
func (ProtocolVersion) SupportsSessionMigrate ¶ added in v0.15.3
func (v ProtocolVersion) SupportsSessionMigrate() 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
func (ProtocolVersion) SupportsTransceiverReuse ¶ added in v0.13.3
func (v ProtocolVersion) SupportsTransceiverReuse() bool
SupportsTransceiverReuse - if transceiver reuse is supported, optimizes SDP size
func (ProtocolVersion) SupportsUnpublish ¶ added in v0.15.6
func (v ProtocolVersion) SupportsUnpublish() bool
type Room ¶ added in v0.15.0
type Room interface {
Name() livekit.RoomName
ID() livekit.RoomID
UpdateSubscriptions(participant LocalParticipant, trackIDs []livekit.TrackID, participantTracks []*livekit.ParticipantTracks, subscribe bool) error
UpdateSubscriptionPermission(participant LocalParticipant, permissions *livekit.SubscriptionPermission) error
SyncState(participant LocalParticipant, state *livekit.SyncState) error
SimulateScenario(participant LocalParticipant, scenario *livekit.SimulateScenario) error
SetParticipantPermission(participant LocalParticipant, permission *livekit.ParticipantPermission) error
UpdateVideoLayers(participant Participant, updateVideoLayers *livekit.UpdateVideoLayers) error
}
Room is a container of participants, and can provide room-level actions
type SubscribedTrack ¶
type SubscribedTrack interface {
OnBind(f func())
ID() livekit.TrackID
PublisherID() livekit.ParticipantID
PublisherIdentity() livekit.ParticipantIdentity
SubscriberID() livekit.ParticipantID
DownTrack() *sfu.DownTrack
MediaTrack() MediaTrack
IsMuted() bool
SetPublisherMuted(muted bool)
UpdateSubscriberSettings(settings *livekit.UpdateTrackSettings)
// selects appropriate video layer according to subscriber preferences
UpdateVideoLayer()
}
MediaTrack is the main interface representing a track published to the room
Click to show internal directories.
Click to hide internal directories.