mirror of
https://github.com/livekit/livekit.git
synced 2026-04-26 23:55:25 +00:00
26 lines
628 B
Go
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(),
|
|
}
|
|
}
|