Files
livekit/pkg/rtc/publishedtrack.go
T
2020-12-19 16:13:56 -08:00

26 lines
628 B
Go

package rtc
import (
"github.com/livekit/livekit-server/proto/livekit"
)
// 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 PublishedTrack interface {
Start()
ID() string
Kind() livekit.TrackInfo_Type
StreamID() string
AddSubscriber(participant *Participant) error
RemoveSubscriber(participantId string)
RemoveAllSubscribers()
}
func TrackToProto(t PublishedTrack) *livekit.TrackInfo {
return &livekit.TrackInfo{
Sid: t.ID(),
Type: t.Kind(),
Name: t.StreamID(),
}
}